@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.
Files changed (193) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/accordionitem-_9AiCIvd.cjs +34 -0
  3. package/dist/{accordionitem-ZlaXvjt5.js → accordionitem-dCfSrxh5.js} +57 -55
  4. package/dist/alert-BtOk8yRH.cjs +33 -0
  5. package/dist/{alert-BuAXrnKl.js → alert-DlY2_grU.js} +48 -46
  6. package/dist/backlink-Ce5Vldop.js +49 -0
  7. package/dist/backlink-y3dwjKPC.cjs +13 -0
  8. package/dist/button-B_TXwNzt.cjs +27 -0
  9. package/dist/{button-DEyvt1LI.js → button-BiY-wlKF.js} +79 -77
  10. package/dist/calendar-B2pji2zn.cjs +90 -0
  11. package/dist/{calendar-S63oreVW.js → calendar-DhjQDC4C.js} +689 -687
  12. package/dist/card-BwMNB5Bb.cjs +87 -0
  13. package/dist/{card-DDiLfuO4.js → card-CGlmcMSR.js} +99 -97
  14. package/dist/checkbox-BsJZYA26.js +147 -0
  15. package/dist/checkbox-CTY8f_qn.cjs +31 -0
  16. package/dist/{combobox-BmxSecfE.js → combobox-DSB5WOxg.js} +223 -226
  17. package/dist/{combobox-Hb2V-fPX.cjs → combobox-DbICIgKG.cjs} +4 -4
  18. package/dist/consent-DkOQpbsg.cjs +11 -0
  19. package/dist/{consent-iXyx5v6J.js → consent-SNWV_mMU.js} +48 -46
  20. package/dist/datepicker-BEWl9iz3.cjs +273 -0
  21. package/dist/{datepicker-CZl7b8Na.js → datepicker-euHyzXnb.js} +341 -329
  22. package/dist/{heading-CKt7cVn7.js → heading-D2tVS6lS.js} +30 -28
  23. package/dist/heading-DrzbgDb6.cjs +1 -0
  24. package/dist/helptext-BKtU4mas.js +82 -0
  25. package/dist/helptext-DcRC7wW2.cjs +24 -0
  26. package/dist/icon-CxQcIa5F.js +105 -0
  27. package/dist/icon-q81vqPK_.cjs +9 -0
  28. package/dist/input-wrapper-Bs4CRNst.js +181 -0
  29. package/dist/input-wrapper-Bv9aqqVq.cjs +54 -0
  30. package/dist/link-C0rl-86s.cjs +7 -0
  31. package/dist/link-Cdqgl60z.js +55 -0
  32. package/dist/linkcard-Dimu7Rlx.cjs +13 -0
  33. package/dist/linkcard-Lbq_UhjZ.js +56 -0
  34. package/dist/{listbox-BQKDZvZn.js → listbox-Bia4_tvN.js} +131 -129
  35. package/dist/listbox-La2GZQei.cjs +106 -0
  36. package/dist/loader-D1ugDXGV.cjs +16 -0
  37. package/dist/{loader-Ci3CHU8k.js → loader-DyN6RGC5.js} +51 -49
  38. package/dist/messagebox-BGMVm2t9.js +71 -0
  39. package/dist/messagebox-M0yIgCz9.cjs +13 -0
  40. package/dist/modal-CMO1RtIi.cjs +36 -0
  41. package/dist/{modal-DzGe1g8Z.js → modal-DjPQDE-Z.js} +53 -51
  42. package/dist/pkt-accordion.cjs +1 -1
  43. package/dist/pkt-accordion.js +2 -2
  44. package/dist/pkt-alert.cjs +1 -1
  45. package/dist/pkt-alert.js +3 -4
  46. package/dist/pkt-backlink.cjs +1 -1
  47. package/dist/pkt-backlink.js +2 -3
  48. package/dist/pkt-breadcrumbs.cjs +11 -11
  49. package/dist/pkt-breadcrumbs.js +30 -28
  50. package/dist/pkt-button.cjs +1 -1
  51. package/dist/pkt-button.js +3 -4
  52. package/dist/pkt-calendar.cjs +1 -1
  53. package/dist/pkt-calendar.js +2 -3
  54. package/dist/pkt-card.cjs +1 -1
  55. package/dist/pkt-card.js +2 -3
  56. package/dist/pkt-checkbox.cjs +1 -1
  57. package/dist/pkt-checkbox.js +3 -4
  58. package/dist/pkt-combobox.cjs +1 -1
  59. package/dist/pkt-combobox.js +3 -4
  60. package/dist/pkt-consent.cjs +1 -1
  61. package/dist/pkt-consent.js +2 -3
  62. package/dist/pkt-datepicker.cjs +1 -1
  63. package/dist/pkt-datepicker.js +7 -8
  64. package/dist/pkt-header.cjs +35 -35
  65. package/dist/pkt-header.js +224 -218
  66. package/dist/pkt-heading.cjs +1 -1
  67. package/dist/pkt-heading.js +3 -4
  68. package/dist/pkt-helptext.cjs +1 -1
  69. package/dist/pkt-helptext.js +3 -4
  70. package/dist/pkt-icon.cjs +1 -1
  71. package/dist/pkt-icon.js +3 -4
  72. package/dist/pkt-index.cjs +1 -1
  73. package/dist/pkt-index.js +26 -26
  74. package/dist/pkt-input-wrapper.cjs +1 -1
  75. package/dist/pkt-input-wrapper.js +2 -3
  76. package/dist/pkt-link.cjs +1 -1
  77. package/dist/pkt-link.js +2 -3
  78. package/dist/pkt-linkcard.cjs +1 -1
  79. package/dist/pkt-linkcard.js +3 -4
  80. package/dist/pkt-listbox.cjs +1 -1
  81. package/dist/pkt-listbox.js +3 -4
  82. package/dist/pkt-loader.cjs +1 -1
  83. package/dist/pkt-loader.js +3 -4
  84. package/dist/pkt-messagebox.cjs +1 -1
  85. package/dist/pkt-messagebox.js +3 -4
  86. package/dist/pkt-modal.cjs +1 -1
  87. package/dist/pkt-modal.js +3 -4
  88. package/dist/pkt-progressbar.cjs +1 -1
  89. package/dist/pkt-progressbar.js +2 -3
  90. package/dist/pkt-radiobutton.cjs +1 -1
  91. package/dist/pkt-radiobutton.js +3 -4
  92. package/dist/pkt-select.cjs +1 -1
  93. package/dist/pkt-select.js +3 -4
  94. package/dist/pkt-tabs.cjs +1 -1
  95. package/dist/pkt-tabs.js +2 -2
  96. package/dist/pkt-tag.cjs +1 -1
  97. package/dist/pkt-tag.js +3 -4
  98. package/dist/pkt-textarea.cjs +1 -1
  99. package/dist/pkt-textarea.js +3 -4
  100. package/dist/pkt-textinput.cjs +1 -1
  101. package/dist/pkt-textinput.js +3 -4
  102. package/dist/pkt-timepicker.cjs +16 -16
  103. package/dist/pkt-timepicker.js +91 -89
  104. package/dist/progressbar-BqlMzkM_.cjs +21 -0
  105. package/dist/{progressbar-By7e0lEI.js → progressbar-sbHDFC12.js} +88 -88
  106. package/dist/radiobutton-5ZqVVtTT.cjs +31 -0
  107. package/dist/{radiobutton-6frNG9J_.js → radiobutton-D8Ai8ETa.js} +44 -42
  108. package/dist/select-De-n8on9.js +230 -0
  109. package/dist/select-dTWibR6_.cjs +49 -0
  110. package/dist/tabitem-B9-jeV97.js +334 -0
  111. package/dist/tabitem-BnhzqfW3.cjs +65 -0
  112. package/dist/tag-CbwO8yvD.cjs +27 -0
  113. package/dist/{tag-BuCpqaks.js → tag-D4FI5t3y.js} +42 -40
  114. package/dist/textarea-BmLaKzsc.cjs +50 -0
  115. package/dist/{textarea-Bzuymclz.js → textarea-CMiSJaYL.js} +62 -60
  116. package/dist/textinput-em9y4yrL.cjs +70 -0
  117. package/dist/{textinput-9lHjs4ce.js → textinput-r8udK0IX.js} +57 -55
  118. package/package.json +2 -2
  119. package/src/components/accordion/accordion.ts +6 -1
  120. package/src/components/accordion/accordionitem.ts +6 -1
  121. package/src/components/alert/alert.ts +6 -1
  122. package/src/components/backlink/backlink.ts +6 -1
  123. package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
  124. package/src/components/button/button.ts +6 -1
  125. package/src/components/calendar/calendar.ts +6 -1
  126. package/src/components/card/card.ts +6 -1
  127. package/src/components/checkbox/checkbox.ts +6 -1
  128. package/src/components/combobox/combobox.ts +6 -1
  129. package/src/components/consent/consent.ts +6 -1
  130. package/src/components/datepicker/date-tags.ts +6 -1
  131. package/src/components/datepicker/datepicker-multiple.ts +6 -1
  132. package/src/components/datepicker/datepicker-popup.ts +6 -1
  133. package/src/components/datepicker/datepicker-range.ts +6 -1
  134. package/src/components/datepicker/datepicker-single.ts +6 -1
  135. package/src/components/datepicker/datepicker.ts +6 -1
  136. package/src/components/header/header-service.ts +6 -1
  137. package/src/components/header/header-user-menu.ts +6 -1
  138. package/src/components/header/header.ts +6 -1
  139. package/src/components/heading/heading.ts +6 -1
  140. package/src/components/helptext/helptext.ts +6 -1
  141. package/src/components/icon/icon.ts +6 -1
  142. package/src/components/input-wrapper/input-wrapper.ts +6 -1
  143. package/src/components/link/link.ts +6 -1
  144. package/src/components/linkcard/linkcard.ts +6 -1
  145. package/src/components/listbox/listbox.ts +6 -1
  146. package/src/components/loader/loader.ts +6 -1
  147. package/src/components/messagebox/messagebox.ts +6 -1
  148. package/src/components/modal/modal.ts +6 -1
  149. package/src/components/progressbar/progressbar.ts +6 -1
  150. package/src/components/radiobutton/radiobutton.ts +6 -1
  151. package/src/components/select/select.ts +6 -1
  152. package/src/components/tabs/tabitem.ts +6 -1
  153. package/src/components/tabs/tabs.ts +6 -1
  154. package/src/components/tag/tag.ts +6 -1
  155. package/src/components/textarea/textarea.ts +6 -1
  156. package/src/components/textinput/textinput.ts +6 -1
  157. package/src/components/timepicker/timepicker.ts +6 -1
  158. package/dist/accordionitem-D1Agl1bB.cjs +0 -34
  159. package/dist/alert-DFkFNTxh.cjs +0 -33
  160. package/dist/backlink-EiAXUUZP.cjs +0 -13
  161. package/dist/backlink-V4DAt17e.js +0 -47
  162. package/dist/button-DYv5Dg4M.cjs +0 -27
  163. package/dist/calendar-HIE9nxcc.cjs +0 -90
  164. package/dist/card-CyeH6l1c.cjs +0 -87
  165. package/dist/checkbox-BLlwTABj.cjs +0 -31
  166. package/dist/checkbox-ejBUa5qQ.js +0 -145
  167. package/dist/consent-ruWAEVXW.cjs +0 -11
  168. package/dist/datepicker-D2H7U6MS.cjs +0 -273
  169. package/dist/heading-Cvz8m1xL.cjs +0 -1
  170. package/dist/helptext-5Mzp65-F.cjs +0 -24
  171. package/dist/helptext-jIoWRcCF.js +0 -80
  172. package/dist/icon-BlKA8YuW.js +0 -103
  173. package/dist/icon-Bqj9oBbl.cjs +0 -9
  174. package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
  175. package/dist/input-wrapper-B2JpK016.js +0 -179
  176. package/dist/link-R_lNhViF.cjs +0 -7
  177. package/dist/link-Z_GizclR.js +0 -53
  178. package/dist/linkcard-BlQvdB1a.js +0 -54
  179. package/dist/linkcard-C7HbSLlX.cjs +0 -13
  180. package/dist/listbox-CGgV9MAe.cjs +0 -106
  181. package/dist/loader-e2gs_1xz.cjs +0 -16
  182. package/dist/messagebox-Bf-XMlvW.js +0 -69
  183. package/dist/messagebox-D67w71VX.cjs +0 -13
  184. package/dist/modal-CyvEkbfQ.cjs +0 -36
  185. package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
  186. package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
  187. package/dist/select-CXZt1nHS.js +0 -228
  188. package/dist/select-WFhS4Vfp.cjs +0 -49
  189. package/dist/tabitem-CB8wkKmv.js +0 -332
  190. package/dist/tabitem-DZpspU4Q.cjs +0 -65
  191. package/dist/tag-X6xdjR0N.cjs +0 -27
  192. package/dist/textarea-DoeHJ7HR.cjs +0 -50
  193. package/dist/textinput-BNsLd26i.cjs +0 -70
@@ -1,28 +1,28 @@
1
- import { P as L, A as D, b as h, n as r, t as x } from "./element-CPpT3rFQ.js";
2
- import { r as z } from "./state-C_1EOo3D.js";
3
- import { s as H, f as N, a as Q, i as X, n as k, b as j, c as W, v as I, d as Y, p as Z, e as G } from "./calendar-S63oreVW.js";
1
+ import { t as w, P as L, A as T, b as h, n as r } from "./element-CPpT3rFQ.js";
2
+ import { r as q } from "./state-C_1EOo3D.js";
3
+ import { s as z, f as U, a as Q, i as X, n as C, b as F, c as H, v as E, d as Y, p as Z, e as W } from "./calendar-DhjQDC4C.js";
4
4
  import { P as ee } from "./input-element-8nLwuQS4.js";
5
5
  import { e as m, n as v } from "./ref-Bg_Swj5w.js";
6
- import "./icon-BlKA8YuW.js";
7
- import "./input-wrapper-B2JpK016.js";
8
- import { e as $ } from "./class-map-CEnykyO_.js";
6
+ import "./icon-CxQcIa5F.js";
7
+ import "./input-wrapper-Bs4CRNst.js";
8
+ import { e as b } from "./class-map-CEnykyO_.js";
9
9
  import { c as te } from "./repeat-BD8TKgJb.js";
10
- import "./tag-BuCpqaks.js";
10
+ import "./tag-D4FI5t3y.js";
11
11
  import { u as se, s as ie } from "./utils-DznhwRXm.js";
12
12
  import { o as f } from "./if-defined-B0krMLad.js";
13
13
  import { s as ae } from "./element-with-slot-Dqk6-TRR.js";
14
- const J = {
14
+ const G = {
15
15
  calendar: { buttonAltText: "Åpne kalender" }
16
16
  }, ne = {
17
17
  calendar: { buttonAltText: "Åpne kalender" },
18
18
  generic: { from: "Fra", to: "Til" }
19
19
  };
20
- var le = Object.defineProperty, re = Object.getOwnPropertyDescriptor, E = (e, t, s, n) => {
21
- for (var i = n > 1 ? void 0 : n ? re(t, s) : t, a = e.length - 1, l; a >= 0; a--)
22
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
23
- return n && i && le(t, s, i), i;
20
+ var le = Object.defineProperty, P = (i, e, t, a) => {
21
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
22
+ (n = i[l]) && (s = n(e, t, s) || s);
23
+ return s && le(e, t, s), s;
24
24
  };
25
- let w = class extends L {
25
+ class R extends L {
26
26
  constructor() {
27
27
  super(...arguments), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase = se();
28
28
  }
@@ -31,9 +31,9 @@ let w = class extends L {
31
31
  "pkt-date-tags": !0,
32
32
  [this.className]: !0
33
33
  }, h`
34
- <div class=${$(this.classes)} aria-live="polite">
34
+ <div class=${b(this.classes)} aria-live="polite">
35
35
  ${Array.isArray(this.dates) && this.dates[0] ? te(
36
- H((this.dates ?? []).filter(Boolean)),
36
+ z((this.dates ?? []).filter(Boolean)),
37
37
  (e) => e,
38
38
  (e) => {
39
39
  var t;
@@ -43,137 +43,139 @@ let w = class extends L {
43
43
  @close=${() => {
44
44
  this.dispatchEvent(new CustomEvent("date-tag-removed", { detail: e }));
45
45
  }}
46
- .ariaLabel=${`${(t = this.strings) == null ? void 0 : t.calendar.deleteDate} ${N(e, this.dateformat)}`}
46
+ .ariaLabel=${`${(t = this.strings) == null ? void 0 : t.calendar.deleteDate} ${U(e, this.dateformat)}`}
47
47
  >
48
- <time datetime=${e}>${N(e, this.dateformat)}</time>
48
+ <time datetime=${e}>${U(e, this.dateformat)}</time>
49
49
  </pkt-tag>`;
50
50
  }
51
- ) : D}
51
+ ) : T}
52
52
  </div>
53
53
  `;
54
54
  }
55
- };
56
- E([
55
+ }
56
+ P([
57
57
  r({ type: Array })
58
- ], w.prototype, "dates", 2);
59
- E([
58
+ ], R.prototype, "dates");
59
+ P([
60
60
  r({ type: String })
61
- ], w.prototype, "dateformat", 2);
62
- E([
61
+ ], R.prototype, "dateformat");
62
+ P([
63
63
  r({ type: String, attribute: "class" })
64
- ], w.prototype, "className", 2);
65
- E([
64
+ ], R.prototype, "className");
65
+ P([
66
66
  r({ type: String, attribute: "id-base" })
67
- ], w.prototype, "idBase", 2);
68
- w = E([
69
- x("pkt-date-tags")
70
- ], w);
71
- const oe = { dateformat: { default: "dd.MM.yyyy" }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, range: { default: !1 } }, _ = {
72
- props: oe
73
- }, b = () => {
74
- const e = navigator.userAgent;
75
- return !!(/iP(hone|od|ad)/.test(e) || /Macintosh/.test(e) && "ontouchend" in document);
76
- }, ue = () => b() ? "text" : "date", pe = (e) => !e || e.length !== 2 ? !0 : X(e[0], e[1]), he = (e) => H(e), de = (e, t, s, n, i) => Q(e, t, s, n, i), ce = (e, t, s, n, i, a) => ({
67
+ ], R.prototype, "idBase");
68
+ try {
69
+ w("pkt-date-tags")(R);
70
+ } catch {
71
+ console.warn("Forsøker å definere <pkt-date-tags>, men den er allerede definert");
72
+ }
73
+ const re = { dateformat: { default: "dd.MM.yyyy" }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, range: { default: !1 } }, x = {
74
+ props: re
75
+ }, k = () => {
76
+ const i = navigator.userAgent;
77
+ return !!(/iP(hone|od|ad)/.test(i) || /Macintosh/.test(i) && "ontouchend" in document);
78
+ }, oe = () => k() ? "text" : "date", ue = (i) => !i || i.length !== 2 ? !0 : X(i[0], i[1]), pe = (i) => z(i), he = (i, e, t, a, s) => Q(i, e, t, a, s), de = (i, e, t, a, s, l) => ({
77
79
  "pkt-input": !0,
78
80
  "pkt-datepicker__input": !0,
79
- "pkt-input--fullwidth": e,
80
- "pkt-datepicker--hasrangelabels": t,
81
- "pkt-datepicker--multiple": s,
82
- "pkt-datepicker--range": n,
83
- "ios-readonly-hack": i === !1 && a === "text"
84
- }), fe = () => ({
81
+ "pkt-input--fullwidth": i,
82
+ "pkt-datepicker--hasrangelabels": e,
83
+ "pkt-datepicker--multiple": t,
84
+ "pkt-datepicker--range": a,
85
+ "ios-readonly-hack": s === !1 && l === "text"
86
+ }), ce = () => ({
85
87
  "pkt-input-icon": !0,
86
88
  "pkt-btn": !0,
87
89
  "pkt-btn--icon-only": !0,
88
90
  "pkt-btn--tertiary": !0,
89
91
  "pkt-datepicker__calendar-button": !0
90
- }), ge = (e) => ({
91
- "pkt-input-prefix": e,
92
- "pkt-hide": !e
93
- }), me = (e, t, s) => !t && !s ? Array.isArray(e) ? e[0] || "" : e : Array.isArray(e) ? e.join(",") : e, ve = (e, t, s = !1) => {
92
+ }), fe = (i) => ({
93
+ "pkt-input-prefix": i,
94
+ "pkt-hide": !i
95
+ }), ge = (i, e, t) => !e && !t ? Array.isArray(i) ? i[0] || "" : i : Array.isArray(i) ? i.join(",") : i, me = (i, e, t = !1) => {
94
96
  var o;
95
- if (!e || !t) return;
96
- const n = ((o = t.parentElement) == null ? void 0 : o.getBoundingClientRect()) || t.getBoundingClientRect(), i = s ? n.height + 30 : n.height, a = e.getBoundingClientRect().height;
97
- let l = s ? "calc(100% - 30px)" : "100%";
98
- n && n.top + a > window.innerHeight && n.top - a > 0 && (l = `calc(100% - ${i}px - ${a}px)`), e.style.top = l;
99
- }, ye = (e, t, s, n, i, a) => {
100
- const { key: l } = e;
101
- l === "," && (e.preventDefault(), a ? a(e) : i && i()), (l === "Space" || l === " ") && (e.preventDefault(), t(e)), l === "Enter" && (e.preventDefault(), s ? s() : n ? n() : i && i());
102
- }, $e = (e, t) => {
103
- const { key: s } = e;
104
- (s === "Enter" || s === " " || s === "Space") && (e.preventDefault(), t(e));
105
- }, q = {
106
- validateRangeOrder: pe,
107
- sortDates: he,
108
- filterSelectableDates: de
109
- }, be = {
110
- getInputType: ue
111
- }, T = {
112
- submitForm(e) {
113
- var s;
114
- const t = (s = e.internals) == null ? void 0 : s.form;
115
- t && t.requestSubmit();
97
+ if (!i || !e) return;
98
+ const a = ((o = e.parentElement) == null ? void 0 : o.getBoundingClientRect()) || e.getBoundingClientRect(), s = t ? a.height + 30 : a.height, l = i.getBoundingClientRect().height;
99
+ let n = t ? "calc(100% - 30px)" : "100%";
100
+ a && a.top + l > window.innerHeight && a.top - l > 0 && (n = `calc(100% - ${s}px - ${l}px)`), i.style.top = n;
101
+ }, ve = (i, e, t, a, s, l) => {
102
+ const { key: n } = i;
103
+ n === "," && (i.preventDefault(), l ? l(i) : s && s()), (n === "Space" || n === " ") && (i.preventDefault(), e(i)), n === "Enter" && (i.preventDefault(), t ? t() : a ? a() : s && s());
104
+ }, ye = (i, e) => {
105
+ const { key: t } = i;
106
+ (t === "Enter" || t === " " || t === "Space") && (i.preventDefault(), e(i));
107
+ }, N = {
108
+ validateRangeOrder: ue,
109
+ sortDates: pe,
110
+ filterSelectableDates: he
111
+ }, $e = {
112
+ getInputType: oe
113
+ }, _ = {
114
+ submitForm(i) {
115
+ var t;
116
+ const e = (t = i.internals) == null ? void 0 : t.form;
117
+ e && e.requestSubmit();
116
118
  },
117
- submitFormOrFallback(e, t) {
118
- const s = e == null ? void 0 : e.form;
119
- s ? s.requestSubmit() : t();
119
+ submitFormOrFallback(i, e) {
120
+ const t = i == null ? void 0 : i.form;
121
+ t ? t.requestSubmit() : e();
120
122
  },
121
- validateDateInput(e, t, s, n, i) {
122
- var l, o, K, U;
123
- const a = e.value;
124
- a && (s && s > a ? t.setValidity(
123
+ validateDateInput(i, e, t, a, s) {
124
+ var n, o, $, K;
125
+ const l = i.value;
126
+ l && (t && t > l ? e.setValidity(
125
127
  { rangeUnderflow: !0 },
126
- ((o = (l = i == null ? void 0 : i.forms) == null ? void 0 : l.messages) == null ? void 0 : o.rangeUnderflow) || "Value is below minimum",
127
- e
128
- ) : n && n < a && t.setValidity(
128
+ ((o = (n = s == null ? void 0 : s.forms) == null ? void 0 : n.messages) == null ? void 0 : o.rangeUnderflow) || "Value is below minimum",
129
+ i
130
+ ) : a && a < l && e.setValidity(
129
131
  { rangeOverflow: !0 },
130
- ((U = (K = i == null ? void 0 : i.forms) == null ? void 0 : K.messages) == null ? void 0 : U.rangeOverflow) || "Value is above maximum",
131
- e
132
+ ((K = ($ = s == null ? void 0 : s.forms) == null ? void 0 : $.messages) == null ? void 0 : K.rangeOverflow) || "Value is above maximum",
133
+ i
132
134
  ));
133
135
  }
134
- }, P = {
135
- addToSelected(e, t, s, n) {
136
- const i = e.target;
137
- if (!i.value) return;
138
- const a = s ? k(s) : null, l = n ? k(n) : null, o = k(i.value.split(",")[0]);
139
- o && !isNaN(o.getTime()) && (!a || o >= a) && (!l || o <= l) && t.value && t.value.handleDateSelect(o), i.value = "";
136
+ }, S = {
137
+ addToSelected(i, e, t, a) {
138
+ const s = i.target;
139
+ if (!s.value) return;
140
+ const l = t ? C(t) : null, n = a ? C(a) : null, o = C(s.value.split(",")[0]);
141
+ o && !isNaN(o.getTime()) && (!l || o >= l) && (!n || o <= n) && e.value && e.value.handleDateSelect(o), s.value = "";
140
142
  },
141
- handleCalendarPosition(e, t, s = !1) {
142
- ve(e.value ?? null, t.value ?? null, s);
143
+ handleCalendarPosition(i, e, t = !1) {
144
+ me(i.value ?? null, e.value ?? null, t);
143
145
  }
144
146
  }, V = {
145
- getInputClasses: ce,
146
- getButtonClasses: fe,
147
- getRangeLabelClasses: ge
148
- }, F = {
149
- processDateSelection: me,
150
- updateInputValues(e, t, s, n, i, a) {
151
- e.value && (n && (t != null && t.value) ? (e.value.value = s[0] ?? "", t.value.value = s[1] ?? "", a(e.value), a(t.value)) : i || (e.value.value = s.length ? s[0] : "", a(e.value)));
147
+ getInputClasses: de,
148
+ getButtonClasses: ce,
149
+ getRangeLabelClasses: fe
150
+ }, A = {
151
+ processDateSelection: ge,
152
+ updateInputValues(i, e, t, a, s, l) {
153
+ i.value && (a && (e != null && e.value) ? (i.value.value = t[0] ?? "", e.value.value = t[1] ?? "", l(i.value), l(e.value)) : s || (i.value.value = t.length ? t[0] : "", l(i.value)));
152
154
  },
153
- processRangeBlur(e, t, s, n, i) {
154
- var l;
155
- const a = e.target;
156
- if (a.value) {
157
- i(a);
158
- const o = j(a.value);
159
- o && ((l = s == null ? void 0 : s.value) == null || l.handleDateSelect(o));
160
- } else t[0] && n();
161
- }
162
- }, O = {
163
- handleInputKeydown: ye,
164
- handleButtonKeydown: $e
155
+ processRangeBlur(i, e, t, a, s) {
156
+ var n;
157
+ const l = i.target;
158
+ if (l.value) {
159
+ s(l);
160
+ const o = F(l.value);
161
+ o && ((n = t == null ? void 0 : t.value) == null || n.handleDateSelect(o));
162
+ } else e[0] && a();
163
+ }
164
+ }, I = {
165
+ handleInputKeydown: ve,
166
+ handleButtonKeydown: ye
165
167
  };
166
- var ke = Object.defineProperty, we = Object.getOwnPropertyDescriptor, c = (e, t, s, n) => {
167
- for (var i = n > 1 ? void 0 : n ? we(t, s) : t, a = e.length - 1, l; a >= 0; a--)
168
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
169
- return n && i && ke(t, s, i), i;
168
+ var be = Object.defineProperty, c = (i, e, t, a) => {
169
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
170
+ (n = i[l]) && (s = n(e, t, s) || s);
171
+ return s && be(e, t, s), s;
170
172
  };
171
- let d = class extends L {
173
+ class d extends L {
172
174
  constructor() {
173
175
  super(...arguments), this.open = !1, this.multiple = !1, this.range = !1, this.weeknumbers = !1, this.withcontrols = !1, this.maxMultiple = null, this.selected = [], this.earliest = null, this.latest = null, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this._hasBeenOpened = !1, this.popupRef = m(), this.calendarRef = m(), this.handleDocumentClick = (e) => {
174
176
  if (!this.open) return;
175
- const t = e.composedPath(), s = this.parentElement, n = this.popupRef.value;
176
- !t.includes(this) && !t.includes(n) && !(s && t.includes(s)) && (this.hide(), this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 })));
177
+ const t = e.composedPath(), a = this.parentElement, s = this.popupRef.value;
178
+ !t.includes(this) && !t.includes(s) && !(a && t.includes(a)) && (this.hide(), this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 })));
177
179
  }, this.handleDocumentKeydown = (e) => {
178
180
  this.open && e.key === "Escape" && (this.hide(), this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 })));
179
181
  };
@@ -205,27 +207,27 @@ let d = class extends L {
205
207
  const e = this.calendarRef.value;
206
208
  e && typeof e.focusOnCurrentDate == "function" && e.focusOnCurrentDate();
207
209
  }
208
- addToSelected(e, t, s) {
209
- if (this.calendarRef.value && typeof P.addToSelected == "function")
210
- return P.addToSelected(e, this.calendarRef, t, s);
211
- const i = e.target;
212
- if (!i.value) return;
213
- const a = t ? k(t) : null, l = s ? k(s) : null, o = k(i.value.split(",")[0]);
214
- o && !isNaN(o.getTime()) && (!a || o >= a) && (!l || o <= l) && this.handleDateSelect(o), i.value = "";
210
+ addToSelected(e, t, a) {
211
+ if (this.calendarRef.value && typeof S.addToSelected == "function")
212
+ return S.addToSelected(e, this.calendarRef, t, a);
213
+ const l = e.target;
214
+ if (!l.value) return;
215
+ const n = t ? C(t) : null, o = a ? C(a) : null, $ = C(l.value.split(",")[0]);
216
+ $ && !isNaN($.getTime()) && (!n || $ >= n) && (!o || $ <= o) && this.handleDateSelect($), l.value = "";
215
217
  }
216
218
  handleDateSelect(e) {
217
219
  const t = this.calendarRef.value;
218
220
  if (t && typeof t.handleDateSelect == "function") return t.handleDateSelect(e);
219
- const s = W(e), i = this.selected.indexOf(s) >= 0 ? this.selected.filter((a) => a !== s) : [...this.selected, s];
220
- this.selected = i, this.dispatchEvent(
221
- new CustomEvent("date-selected", { detail: i, bubbles: !0, composed: !0 })
221
+ const a = H(e), l = this.selected.indexOf(a) >= 0 ? this.selected.filter((n) => n !== a) : [...this.selected, a];
222
+ this.selected = l, this.dispatchEvent(
223
+ new CustomEvent("date-selected", { detail: l, bubbles: !0, composed: !0 })
222
224
  );
223
225
  }
224
226
  render() {
225
227
  const e = { "pkt-calendar-popup": !0, show: this.open, hide: !this.open };
226
228
  return h`
227
229
  <div
228
- class="${$(e)}"
230
+ class="${b(e)}"
229
231
  ${v(this.popupRef)}
230
232
  id="date-popup"
231
233
  ?hidden=${!this.open}
@@ -253,60 +255,62 @@ let d = class extends L {
253
255
  @close=${() => {
254
256
  this.hide(), this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
255
257
  }}
256
- ></pkt-calendar>` : D}
258
+ ></pkt-calendar>` : T}
257
259
  </div>
258
260
  `;
259
261
  }
260
- };
262
+ }
261
263
  c([
262
264
  r({ type: Boolean, reflect: !0 })
263
- ], d.prototype, "open", 2);
265
+ ], d.prototype, "open");
264
266
  c([
265
267
  r({ type: Boolean })
266
- ], d.prototype, "multiple", 2);
268
+ ], d.prototype, "multiple");
267
269
  c([
268
270
  r({ type: Boolean })
269
- ], d.prototype, "range", 2);
271
+ ], d.prototype, "range");
270
272
  c([
271
273
  r({ type: Boolean })
272
- ], d.prototype, "weeknumbers", 2);
274
+ ], d.prototype, "weeknumbers");
273
275
  c([
274
276
  r({ type: Boolean })
275
- ], d.prototype, "withcontrols", 2);
277
+ ], d.prototype, "withcontrols");
276
278
  c([
277
279
  r({ type: Number })
278
- ], d.prototype, "maxMultiple", 2);
280
+ ], d.prototype, "maxMultiple");
279
281
  c([
280
282
  r({ type: Array })
281
- ], d.prototype, "selected", 2);
283
+ ], d.prototype, "selected");
282
284
  c([
283
285
  r({ type: String })
284
- ], d.prototype, "earliest", 2);
286
+ ], d.prototype, "earliest");
285
287
  c([
286
288
  r({ type: String })
287
- ], d.prototype, "latest", 2);
289
+ ], d.prototype, "latest");
288
290
  c([
289
291
  r({ type: Array })
290
- ], d.prototype, "excludedates", 2);
292
+ ], d.prototype, "excludedates");
291
293
  c([
292
294
  r({ type: Array })
293
- ], d.prototype, "excludeweekdays", 2);
295
+ ], d.prototype, "excludeweekdays");
294
296
  c([
295
297
  r({ type: String })
296
- ], d.prototype, "currentmonth", 2);
298
+ ], d.prototype, "currentmonth");
297
299
  c([
298
300
  r({ type: String })
299
- ], d.prototype, "today", 2);
301
+ ], d.prototype, "today");
300
302
  c([
301
- z()
302
- ], d.prototype, "_hasBeenOpened", 2);
303
- d = c([
304
- x("pkt-datepicker-popup")
305
- ], d);
306
- var Ce = Object.defineProperty, y = (e, t, s, n) => {
307
- for (var i = void 0, a = e.length - 1, l; a >= 0; a--)
308
- (l = e[a]) && (i = l(t, s, i) || i);
309
- return i && Ce(t, s, i), i;
303
+ q()
304
+ ], d.prototype, "_hasBeenOpened");
305
+ try {
306
+ w("pkt-datepicker-popup")(d);
307
+ } catch {
308
+ console.warn("Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert");
309
+ }
310
+ var ke = Object.defineProperty, y = (i, e, t, a) => {
311
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
312
+ (n = i[l]) && (s = n(e, t, s) || s);
313
+ return s && ke(e, t, s), s;
310
314
  };
311
315
  class g extends L {
312
316
  constructor() {
@@ -323,19 +327,19 @@ class g extends L {
323
327
  return this.readonly || this.inputType === "text";
324
328
  }
325
329
  // Shared event dispatchers (protected so subclasses can use them)
326
- dispatchToggleCalendar(t) {
330
+ dispatchToggleCalendar(e) {
327
331
  this.readonly || this.dispatchEvent(
328
332
  new CustomEvent("toggle-calendar", {
329
- detail: t,
333
+ detail: e,
330
334
  bubbles: !0,
331
335
  composed: !0
332
336
  })
333
337
  );
334
338
  }
335
- dispatchInput(t) {
339
+ dispatchInput(e) {
336
340
  this.dispatchEvent(
337
341
  new CustomEvent("input-change", {
338
- detail: t,
342
+ detail: e,
339
343
  bubbles: !0,
340
344
  composed: !0
341
345
  })
@@ -349,19 +353,19 @@ class g extends L {
349
353
  })
350
354
  );
351
355
  }
352
- dispatchBlur(t) {
356
+ dispatchBlur(e) {
353
357
  this.dispatchEvent(
354
358
  new CustomEvent("input-blur", {
355
- detail: t,
359
+ detail: e,
356
360
  bubbles: !0,
357
361
  composed: !0
358
362
  })
359
363
  );
360
364
  }
361
- dispatchChange(t) {
365
+ dispatchChange(e) {
362
366
  this.dispatchEvent(
363
367
  new CustomEvent("input-changed", {
364
- detail: t,
368
+ detail: e,
365
369
  bubbles: !0,
366
370
  composed: !0
367
371
  })
@@ -369,21 +373,21 @@ class g extends L {
369
373
  }
370
374
  // Shared render helper for calendar button
371
375
  renderCalendarButton() {
372
- var t;
376
+ var e;
373
377
  return h`
374
378
  <button
375
- class="${$(V.getButtonClasses())}"
379
+ class="${b(V.getButtonClasses())}"
376
380
  type="button"
377
- @click=${(s) => this.dispatchToggleCalendar(s)}
378
- @keydown=${(s) => {
379
- const { key: n } = s;
380
- (n === "Enter" || n === " " || n === "Space") && (s.preventDefault(), this.dispatchToggleCalendar(s));
381
+ @click=${(t) => this.dispatchToggleCalendar(t)}
382
+ @keydown=${(t) => {
383
+ const { key: a } = t;
384
+ (a === "Enter" || a === " " || a === "Space") && (t.preventDefault(), this.dispatchToggleCalendar(t));
381
385
  }}
382
386
  ?disabled=${this.disabled}
383
387
  ${this.btnRef}
384
388
  >
385
389
  <pkt-icon name="calendar"></pkt-icon>
386
- <span class="pkt-btn__text">${((t = this.strings.calendar) == null ? void 0 : t.buttonAltText) || "Åpne kalender"}</span>
390
+ <span class="pkt-btn__text">${((e = this.strings.calendar) == null ? void 0 : e.buttonAltText) || "Åpne kalender"}</span>
387
391
  </button>
388
392
  `;
389
393
  }
@@ -419,14 +423,14 @@ y([
419
423
  y([
420
424
  r({ type: Object })
421
425
  ], g.prototype, "internals");
422
- var xe = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, M = (e, t, s, n) => {
423
- for (var i = n > 1 ? void 0 : n ? _e(t, s) : t, a = e.length - 1, l; a >= 0; a--)
424
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
425
- return n && i && xe(t, s, i), i;
426
+ var Ce = Object.defineProperty, J = (i, e, t, a) => {
427
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
428
+ (n = i[l]) && (s = n(e, t, s) || s);
429
+ return s && Ce(e, t, s), s;
426
430
  };
427
- let B = class extends g {
431
+ class j extends g {
428
432
  constructor() {
429
- super(...arguments), this.value = "", this.strings = J;
433
+ super(...arguments), this.value = "", this.strings = G;
430
434
  }
431
435
  dispatchManageValidity(e) {
432
436
  this.dispatchEvent(
@@ -441,7 +445,7 @@ let B = class extends g {
441
445
  return h`
442
446
  <div class="pkt-input__container">
443
447
  <input
444
- class="${$(this.inputClasses)}"
448
+ class="${b(this.inputClasses)}"
445
449
  .type=${this.inputType}
446
450
  id="${this.id}-input"
447
451
  .value=${this.value}
@@ -457,10 +461,10 @@ let B = class extends g {
457
461
  e.preventDefault(), this.dispatchToggleCalendar(e);
458
462
  }}
459
463
  ?disabled=${this.disabled}
460
- @keydown=${(e) => O.handleInputKeydown(
464
+ @keydown=${(e) => I.handleInputKeydown(
461
465
  e,
462
466
  (t) => this.dispatchToggleCalendar(t),
463
- () => T.submitFormOrFallback(this.internals, () => {
467
+ () => _.submitFormOrFallback(this.internals, () => {
464
468
  var t;
465
469
  return (t = this.inputRef.value) == null ? void 0 : t.blur();
466
470
  }),
@@ -474,7 +478,7 @@ let B = class extends g {
474
478
  this.dispatchInput(e), e.stopImmediatePropagation();
475
479
  }}
476
480
  @focus=${() => {
477
- this.dispatchFocus(), b() && this.dispatchToggleCalendar(new Event("focus"));
481
+ this.dispatchFocus(), k() && this.dispatchToggleCalendar(new Event("focus"));
478
482
  }}
479
483
  @blur=${(e) => {
480
484
  this.dispatchBlur(e), this.dispatchManageValidity(e.target), this.dispatchEvent(
@@ -494,22 +498,24 @@ let B = class extends g {
494
498
  </div>
495
499
  `;
496
500
  }
497
- };
498
- M([
501
+ }
502
+ J([
499
503
  r({ type: String })
500
- ], B.prototype, "value", 2);
501
- M([
504
+ ], j.prototype, "value");
505
+ J([
502
506
  r({ type: Object })
503
- ], B.prototype, "strings", 2);
504
- B = M([
505
- x("pkt-datepicker-single")
506
- ], B);
507
- var De = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, S = (e, t, s, n) => {
508
- for (var i = n > 1 ? void 0 : n ? Te(t, s) : t, a = e.length - 1, l; a >= 0; a--)
509
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
510
- return n && i && De(t, s, i), i;
507
+ ], j.prototype, "strings");
508
+ try {
509
+ w("pkt-datepicker-single")(j);
510
+ } catch {
511
+ console.warn("Forsøker å definere <pkt-datepicker-single>, men den er allerede definert");
512
+ }
513
+ var we = Object.defineProperty, B = (i, e, t, a) => {
514
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
515
+ (n = i[l]) && (s = n(e, t, s) || s);
516
+ return s && we(e, t, s), s;
511
517
  };
512
- let C = class extends g {
518
+ class D extends g {
513
519
  constructor() {
514
520
  super(...arguments), this.value = [], this.label = "", this.showRangeLabels = !1, this.strings = ne, this.inputRefTo = m();
515
521
  }
@@ -517,58 +523,58 @@ let C = class extends g {
517
523
  return this.inputRefTo.value;
518
524
  }
519
525
  render() {
520
- var t, s, n, i;
526
+ var t, a, s, l;
521
527
  const e = V.getRangeLabelClasses(this.showRangeLabels);
522
528
  return h`
523
529
  <div class="pkt-input__container">
524
- ${this.showRangeLabels ? h` <div class="pkt-input-prefix">${(t = this.strings.generic) == null ? void 0 : t.from}</div> ` : D}
530
+ ${this.showRangeLabels ? h` <div class="pkt-input-prefix">${(t = this.strings.generic) == null ? void 0 : t.from}</div> ` : T}
525
531
  <input
526
- class=${$(this.inputClasses)}
532
+ class=${b(this.inputClasses)}
527
533
  .type=${this.inputType}
528
534
  id="${this.id}-input"
529
- aria-label="${this.label} ${((s = this.strings.generic) == null ? void 0 : s.from) ?? "Fra"}"
535
+ aria-label="${this.label} ${((a = this.strings.generic) == null ? void 0 : a.from) ?? "Fra"}"
530
536
  .value=${this.value[0] ?? ""}
531
537
  min=${f(this.min)}
532
538
  max=${f(this.max)}
533
539
  placeholder=${f(this.placeholder)}
534
540
  ?readonly=${this.isInputReadonly}
535
541
  ?disabled=${this.disabled}
536
- @click=${(a) => {
537
- a.preventDefault(), this.dispatchToggleCalendar(a);
542
+ @click=${(n) => {
543
+ n.preventDefault(), this.dispatchToggleCalendar(n);
538
544
  }}
539
- @touchend=${(a) => {
540
- a.preventDefault(), this.dispatchToggleCalendar(a);
545
+ @touchend=${(n) => {
546
+ n.preventDefault(), this.dispatchToggleCalendar(n);
541
547
  }}
542
- @keydown=${(a) => O.handleInputKeydown(
543
- a,
544
- (l) => this.dispatchToggleCalendar(l),
545
- () => T.submitFormOrFallback(
548
+ @keydown=${(n) => I.handleInputKeydown(
549
+ n,
550
+ (o) => this.dispatchToggleCalendar(o),
551
+ () => _.submitFormOrFallback(
546
552
  this.internals,
547
553
  () => {
548
- var l;
549
- return (l = this.inputRefTo.value) == null ? void 0 : l.focus();
554
+ var o;
555
+ return (o = this.inputRefTo.value) == null ? void 0 : o.focus();
550
556
  }
551
557
  ),
552
558
  () => {
553
- var l;
554
- return (l = this.inputRefTo.value) == null ? void 0 : l.focus();
559
+ var o;
560
+ return (o = this.inputRefTo.value) == null ? void 0 : o.focus();
555
561
  },
556
562
  () => {
557
- var l;
558
- return (l = this.inputRef.value) == null ? void 0 : l.blur();
563
+ var o;
564
+ return (o = this.inputRef.value) == null ? void 0 : o.blur();
559
565
  }
560
566
  )}
561
- @input=${(a) => {
562
- this.dispatchInput(a), a.stopImmediatePropagation();
567
+ @input=${(n) => {
568
+ this.dispatchInput(n), n.stopImmediatePropagation();
563
569
  }}
564
570
  @focus=${() => {
565
- this.dispatchFocus(), b() && this.dispatchToggleCalendar(new Event("focus"));
571
+ this.dispatchFocus(), k() && this.dispatchToggleCalendar(new Event("focus"));
566
572
  }}
567
- @blur=${(a) => {
568
- this.dispatchBlur(a), this.dispatchEvent(
573
+ @blur=${(n) => {
574
+ this.dispatchBlur(n), this.dispatchEvent(
569
575
  new CustomEvent("range-blur", {
570
576
  detail: {
571
- event: a,
577
+ event: n,
572
578
  values: this.value,
573
579
  inputType: "from"
574
580
  },
@@ -577,56 +583,56 @@ let C = class extends g {
577
583
  })
578
584
  );
579
585
  }}
580
- @change=${(a) => {
581
- this.dispatchChange(a), a.stopImmediatePropagation();
586
+ @change=${(n) => {
587
+ this.dispatchChange(n), n.stopImmediatePropagation();
582
588
  }}
583
589
  ${v(this.inputRef)}
584
590
  />
585
- <div class="${$(e)}" id="${this.id}-to-label">
586
- ${(n = this.strings.generic) == null ? void 0 : n.to}
591
+ <div class="${b(e)}" id="${this.id}-to-label">
592
+ ${(s = this.strings.generic) == null ? void 0 : s.to}
587
593
  </div>
588
- ${this.showRangeLabels ? D : h` <div class="pkt-input-separator">–</div> `}
594
+ ${this.showRangeLabels ? T : h` <div class="pkt-input-separator">–</div> `}
589
595
  <input
590
- class=${$(this.inputClasses)}
596
+ class=${b(this.inputClasses)}
591
597
  .type=${this.inputType}
592
598
  id="${this.id}-to"
593
- aria-label="${this.label} ${((i = this.strings.generic) == null ? void 0 : i.to) ?? "Til"}"
599
+ aria-label="${this.label} ${((l = this.strings.generic) == null ? void 0 : l.to) ?? "Til"}"
594
600
  .value=${this.value[1] ?? ""}
595
601
  min=${f(this.min)}
596
602
  max=${f(this.max)}
597
603
  placeholder=${f(this.placeholder)}
598
604
  ?readonly=${this.isInputReadonly}
599
605
  ?disabled=${this.disabled}
600
- @click=${(a) => {
601
- a.preventDefault(), this.dispatchToggleCalendar(a);
606
+ @click=${(n) => {
607
+ n.preventDefault(), this.dispatchToggleCalendar(n);
602
608
  }}
603
- @touchend=${(a) => {
604
- a.preventDefault(), this.dispatchToggleCalendar(a);
609
+ @touchend=${(n) => {
610
+ n.preventDefault(), this.dispatchToggleCalendar(n);
605
611
  }}
606
- @keydown=${(a) => O.handleInputKeydown(
607
- a,
608
- (l) => this.dispatchToggleCalendar(l),
609
- () => T.submitFormOrFallback(this.internals, () => {
610
- var l;
611
- return (l = this.inputRefTo.value) == null ? void 0 : l.blur();
612
+ @keydown=${(n) => I.handleInputKeydown(
613
+ n,
614
+ (o) => this.dispatchToggleCalendar(o),
615
+ () => _.submitFormOrFallback(this.internals, () => {
616
+ var o;
617
+ return (o = this.inputRefTo.value) == null ? void 0 : o.blur();
612
618
  }),
613
619
  void 0,
614
620
  () => {
615
- var l;
616
- return (l = this.inputRefTo.value) == null ? void 0 : l.blur();
621
+ var o;
622
+ return (o = this.inputRefTo.value) == null ? void 0 : o.blur();
617
623
  }
618
624
  )}
619
- @input=${(a) => {
620
- this.dispatchInput(a), a.stopImmediatePropagation();
625
+ @input=${(n) => {
626
+ this.dispatchInput(n), n.stopImmediatePropagation();
621
627
  }}
622
628
  @focus=${() => {
623
- this.dispatchFocus(), b() && this.dispatchToggleCalendar(new Event("focus"));
629
+ this.dispatchFocus(), k() && this.dispatchToggleCalendar(new Event("focus"));
624
630
  }}
625
- @blur=${(a) => {
626
- this.dispatchBlur(a), this.dispatchEvent(
631
+ @blur=${(n) => {
632
+ this.dispatchBlur(n), this.dispatchEvent(
627
633
  new CustomEvent("range-blur", {
628
634
  detail: {
629
- event: a,
635
+ event: n,
630
636
  values: this.value,
631
637
  inputType: "to"
632
638
  },
@@ -635,8 +641,8 @@ let C = class extends g {
635
641
  })
636
642
  );
637
643
  }}
638
- @change=${(a) => {
639
- this.dispatchChange(a), a.stopImmediatePropagation();
644
+ @change=${(n) => {
645
+ this.dispatchChange(n), n.stopImmediatePropagation();
640
646
  }}
641
647
  ${v(this.inputRefTo)}
642
648
  />
@@ -644,30 +650,32 @@ let C = class extends g {
644
650
  </div>
645
651
  `;
646
652
  }
647
- };
648
- S([
653
+ }
654
+ B([
649
655
  r({ type: Array })
650
- ], C.prototype, "value", 2);
651
- S([
656
+ ], D.prototype, "value");
657
+ B([
652
658
  r({ type: String })
653
- ], C.prototype, "label", 2);
654
- S([
659
+ ], D.prototype, "label");
660
+ B([
655
661
  r({ type: Boolean })
656
- ], C.prototype, "showRangeLabels", 2);
657
- S([
662
+ ], D.prototype, "showRangeLabels");
663
+ B([
658
664
  r({ type: Object })
659
- ], C.prototype, "strings", 2);
660
- C = S([
661
- x("pkt-datepicker-range")
662
- ], C);
663
- var Re = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, A = (e, t, s, n) => {
664
- for (var i = n > 1 ? void 0 : n ? Ee(t, s) : t, a = e.length - 1, l; a >= 0; a--)
665
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
666
- return n && i && Re(t, s, i), i;
665
+ ], D.prototype, "strings");
666
+ try {
667
+ w("pkt-datepicker-range")(D);
668
+ } catch {
669
+ console.warn("Forsøker å definere <pkt-datepicker-range>, men den er allerede definert");
670
+ }
671
+ var xe = Object.defineProperty, M = (i, e, t, a) => {
672
+ for (var s = void 0, l = i.length - 1, n; l >= 0; l--)
673
+ (n = i[l]) && (s = n(e, t, s) || s);
674
+ return s && xe(e, t, s), s;
667
675
  };
668
- let R = class extends g {
676
+ class O extends g {
669
677
  constructor() {
670
- super(...arguments), this.value = [], this.strings = J;
678
+ super(...arguments), this.value = [], this.strings = G;
671
679
  }
672
680
  get isInputDisabled() {
673
681
  return this.disabled || this.maxlength !== void 0 && this.maxlength !== null && this.value.length >= this.maxlength;
@@ -685,7 +693,7 @@ let R = class extends g {
685
693
  return h`
686
694
  <div class="pkt-input__container">
687
695
  <input
688
- class=${$(this.inputClasses)}
696
+ class=${b(this.inputClasses)}
689
697
  .type=${this.inputType}
690
698
  id="${this.id}-input"
691
699
  min=${f(this.min)}
@@ -706,12 +714,12 @@ let R = class extends g {
706
714
  this.dispatchInput(e), e.stopImmediatePropagation();
707
715
  }}
708
716
  @focus=${() => {
709
- this.dispatchFocus(), b() && this.dispatchToggleCalendar(new Event("focus"));
717
+ this.dispatchFocus(), k() && this.dispatchToggleCalendar(new Event("focus"));
710
718
  }}
711
- @keydown=${(e) => O.handleInputKeydown(
719
+ @keydown=${(e) => I.handleInputKeydown(
712
720
  e,
713
721
  (t) => this.dispatchToggleCalendar(t),
714
- () => T.submitFormOrFallback(this.internals, () => {
722
+ () => _.submitFormOrFallback(this.internals, () => {
715
723
  var t;
716
724
  return (t = this.inputRef.value) == null ? void 0 : t.blur();
717
725
  }),
@@ -728,29 +736,31 @@ let R = class extends g {
728
736
  </div>
729
737
  `;
730
738
  }
731
- };
732
- A([
739
+ }
740
+ M([
733
741
  r({ type: Array })
734
- ], R.prototype, "value", 2);
735
- A([
742
+ ], O.prototype, "value");
743
+ M([
736
744
  r({ type: Number })
737
- ], R.prototype, "maxlength", 2);
738
- A([
745
+ ], O.prototype, "maxlength");
746
+ M([
739
747
  r({ type: Object })
740
- ], R.prototype, "strings", 2);
741
- R = A([
742
- x("pkt-datepicker-multiple")
743
- ], R);
744
- var Se = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, p = (e, t, s, n) => {
745
- for (var i = n > 1 ? void 0 : n ? Ie(t, s) : t, a = e.length - 1, l; a >= 0; a--)
746
- (l = e[a]) && (i = (n ? l(t, s, i) : l(i)) || i);
747
- return n && i && Se(t, s, i), i;
748
+ ], O.prototype, "strings");
749
+ try {
750
+ w("pkt-datepicker-multiple")(O);
751
+ } catch {
752
+ console.warn("Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert");
753
+ }
754
+ var Te = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, p = (i, e, t, a) => {
755
+ for (var s = a > 1 ? void 0 : a ? _e(e, t) : e, l = i.length - 1, n; l >= 0; l--)
756
+ (n = i[l]) && (s = (a ? n(e, t, s) : n(s)) || s);
757
+ return a && s && Te(e, t, s), s;
748
758
  };
749
- let u = class extends ee {
759
+ class u extends ee {
750
760
  constructor() {
751
- super(...arguments), this._valueProperty = "", this._valueProcessing = !1, this.datepickerPopupRef = m(), this._value = [], this.label = "Datovelger", this.dateformat = _.props.dateformat.default, this.multiple = _.props.multiple.default, this.maxlength = null, this.range = _.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = _.props.weeknumbers.default, this.withcontrols = _.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.calRef = m(), this.popupRef = m(), this.singleInputRef = m(), this.rangeInputRef = m(), this.multipleInputRef = m(), this.addToSelected = (e) => {
761
+ super(...arguments), this._valueProperty = "", this._valueProcessing = !1, this.datepickerPopupRef = m(), this._value = [], this.label = "Datovelger", this.dateformat = x.props.dateformat.default, this.multiple = x.props.multiple.default, this.maxlength = null, this.range = x.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = x.props.weeknumbers.default, this.withcontrols = x.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.calRef = m(), this.popupRef = m(), this.singleInputRef = m(), this.rangeInputRef = m(), this.multipleInputRef = m(), this.addToSelected = (e) => {
752
762
  const t = this.datepickerPopupRef.value;
753
- return t && typeof t.addToSelected == "function" ? t.addToSelected(e, this.min, this.max) : P.addToSelected(e, this.calRef, this.min, this.max);
763
+ return t && typeof t.addToSelected == "function" ? t.addToSelected(e, this.min, this.max) : S.addToSelected(e, this.calRef, this.min, this.max);
754
764
  };
755
765
  }
756
766
  get value() {
@@ -764,7 +774,7 @@ let u = class extends ee {
764
774
  * Computed properties
765
775
  */
766
776
  get inputType() {
767
- return be.getInputType();
777
+ return $e.getInputType();
768
778
  }
769
779
  /**
770
780
  * Housekeeping / lifecycle methods
@@ -782,35 +792,35 @@ let u = class extends ee {
782
792
  if (!(this._valueProcessing || e === t)) {
783
793
  this._valueProcessing = !0;
784
794
  try {
785
- const s = I(e), n = this.multiple && s.length > 1 ? q.filterSelectableDates(
786
- s,
795
+ const a = E(e), s = this.multiple && a.length > 1 ? N.filterSelectableDates(
796
+ a,
787
797
  this.min,
788
798
  this.max,
789
799
  this.excludedates,
790
800
  this.excludeweekdays
791
- ) : s;
792
- if (this.range && !q.validateRangeOrder(n)) {
801
+ ) : a;
802
+ if (this.range && !N.validateRangeOrder(s)) {
793
803
  this._value = [], this._valueProperty = "", super.valueChanged("", t);
794
804
  return;
795
805
  }
796
- this._value = n;
797
- const i = Y(n);
798
- if (this._valueProperty !== i && (this._valueProperty = i), this.range && n.length < 2) return;
799
- super.valueChanged(i, t);
806
+ this._value = s;
807
+ const l = Y(s);
808
+ if (this._valueProperty !== l && (this._valueProperty = l), this.range && s.length < 2) return;
809
+ super.valueChanged(l, t);
800
810
  } finally {
801
811
  this._valueProcessing = !1;
802
812
  }
803
813
  }
804
814
  }
805
- attributeChangedCallback(e, t, s) {
806
- e === "value" && this.value !== t && this.valueChanged(s, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = I(s || "")), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = I(s || "")), super.attributeChangedCallback(e, t, s);
815
+ attributeChangedCallback(e, t, a) {
816
+ e === "value" && this.value !== t && this.valueChanged(a, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = E(a || "")), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = E(a || "")), super.attributeChangedCallback(e, t, a);
807
817
  }
808
818
  updated(e) {
809
819
  if (e.has("value") && (e.has("multiple") || e.has("range"))) {
810
- const t = Array.isArray(this.value) ? this.value.join(",") : this.value, s = e.get("value"), n = Array.isArray(s) ? s.join(",") : s;
811
- this.valueChanged(t, n);
820
+ const t = Array.isArray(this.value) ? this.value.join(",") : this.value, a = e.get("value"), s = Array.isArray(a) ? a.join(",") : a;
821
+ this.valueChanged(t, s);
812
822
  }
813
- e.has("multiple") && (this.multiple && !Array.isArray(this._value) ? this._value = I(this.value) : !this.multiple && Array.isArray(this._value) && (this._value = this._value.filter(Boolean)), !this.multiple && !this.range && Array.isArray(this._value) && (this._value = [this._value[0] ?? ""])), super.updated(e);
823
+ e.has("multiple") && (this.multiple && !Array.isArray(this._value) ? this._value = E(this.value) : !this.multiple && Array.isArray(this._value) && (this._value = this._value.filter(Boolean)), !this.multiple && !this.range && Array.isArray(this._value) && (this._value = [this._value[0] ?? ""])), super.updated(e);
814
824
  }
815
825
  /**
816
826
  * Element references
@@ -824,8 +834,8 @@ let u = class extends ee {
824
834
  }
825
835
  // Getters for backward compatibility with input refs
826
836
  get currentInputElement() {
827
- var e, t, s;
828
- return this.multiple ? (e = this.multipleInputRef.value) == null ? void 0 : e.inputElement : this.range ? (t = this.rangeInputRef.value) == null ? void 0 : t.inputElement : (s = this.singleInputRef.value) == null ? void 0 : s.inputElement;
837
+ var e, t, a;
838
+ return this.multiple ? (e = this.multipleInputRef.value) == null ? void 0 : e.inputElement : this.range ? (t = this.rangeInputRef.value) == null ? void 0 : t.inputElement : (a = this.singleInputRef.value) == null ? void 0 : a.inputElement;
829
839
  }
830
840
  get currentInputElementTo() {
831
841
  var e;
@@ -833,8 +843,8 @@ let u = class extends ee {
833
843
  return (e = this.rangeInputRef.value) == null ? void 0 : e.inputElementTo;
834
844
  }
835
845
  get currentButtonElement() {
836
- var e, t, s;
837
- return this.multiple ? (e = this.multipleInputRef.value) == null ? void 0 : e.buttonElement : this.range ? (t = this.rangeInputRef.value) == null ? void 0 : t.buttonElement : (s = this.singleInputRef.value) == null ? void 0 : s.buttonElement;
846
+ var e, t, a;
847
+ return this.multiple ? (e = this.multipleInputRef.value) == null ? void 0 : e.buttonElement : this.range ? (t = this.rangeInputRef.value) == null ? void 0 : t.buttonElement : (a = this.singleInputRef.value) == null ? void 0 : a.buttonElement;
838
848
  }
839
849
  // Override btnRef for compatibility
840
850
  get btnRef() {
@@ -899,34 +909,34 @@ let u = class extends ee {
899
909
  (t = this.calRef.value) != null && t.contains(e.detail.relatedTarget) || this.onBlur();
900
910
  }}
901
911
  @range-blur=${(e) => {
902
- const t = this.currentInputElement, s = this.currentInputElementTo;
903
- if (t && s) {
904
- const n = t.value, i = s.value;
905
- if (n && i && n > i)
906
- s.value = "", this._value = [n], this.value = n;
912
+ const t = this.currentInputElement, a = this.currentInputElementTo;
913
+ if (t && a) {
914
+ const s = t.value, l = a.value;
915
+ if (s && l && s > l)
916
+ a.value = "", this._value = [s], this.value = s;
907
917
  else {
908
- const a = [n, i].filter(Boolean);
909
- a.length > 0 && (a[0] !== this._value[0] || a[1] !== this._value[1]) && (this._value = a, this.value = a.join(","));
918
+ const n = [s, l].filter(Boolean);
919
+ n.length > 0 && (n[0] !== this._value[0] || n[1] !== this._value[1]) && (this._value = n, this.value = n.join(","));
910
920
  }
911
921
  }
912
- F.processRangeBlur(
922
+ A.processRangeBlur(
913
923
  e.detail.event,
914
924
  e.detail.values,
915
925
  this.calRef,
916
926
  () => this.clearInputValue(),
917
- (n) => this.manageValidity(n)
927
+ (s) => this.manageValidity(s)
918
928
  );
919
929
  }}
920
930
  @manage-validity=${(e) => this.manageValidity(e.detail)}
921
931
  @validate-date-input=${(e) => {
922
- T.validateDateInput(e.detail, this.internals, this.min, this.max, this.strings);
932
+ _.validateDateInput(e.detail, this.internals, this.min, this.max, this.strings);
923
933
  }}
924
934
  @handle-date-select=${(e) => {
925
- var s, n;
926
- const t = j(e.detail);
935
+ var a, s;
936
+ const t = F(e.detail);
927
937
  if (t) {
928
- const i = W(t);
929
- this._value[0] !== i && this._value[1] !== i && ((n = (s = this.calRef) == null ? void 0 : s.value) == null || n.handleDateSelect(t));
938
+ const l = H(t);
939
+ this._value[0] !== l && this._value[1] !== l && ((s = (a = this.calRef) == null ? void 0 : a.value) == null || s.handleDateSelect(t));
930
940
  }
931
941
  }}
932
942
  @input-changed=${() => {
@@ -984,7 +994,7 @@ let u = class extends ee {
984
994
  .currentmonth=${this.currentmonth ? Z(this.currentmonth) : null}
985
995
  .today=${this.today}
986
996
  @date-selected=${(e) => {
987
- this.value = F.processDateSelection(e.detail, this.multiple, this.range), this._value = e.detail, F.updateInputValues(
997
+ this.value = A.processDateSelection(e.detail, this.multiple, this.range), this._value = e.detail, A.updateInputValues(
988
998
  this.inputRef,
989
999
  this.inputRefTo,
990
1000
  this._value,
@@ -1040,11 +1050,11 @@ let u = class extends ee {
1040
1050
  strings=${this.strings}
1041
1051
  id-base=${this.id}
1042
1052
  @date-tag-removed=${(e) => {
1043
- var n;
1044
- const t = this.datepickerPopupRef.value, s = j(e.detail);
1045
- t && s && typeof t.handleDateSelect == "function" ? t.handleDateSelect(s) : (n = this.calRef.value) == null || n.handleDateSelect(s);
1053
+ var s;
1054
+ const t = this.datepickerPopupRef.value, a = F(e.detail);
1055
+ t && a && typeof t.handleDateSelect == "function" ? t.handleDateSelect(a) : (s = this.calRef.value) == null || s.handleDateSelect(a);
1046
1056
  }}
1047
- ></pkt-date-tags>` : D}
1057
+ ></pkt-date-tags>` : T}
1048
1058
  <div class="pkt-datepicker__inputs ${this.range ? "pkt-input__range-inputs" : ""}">
1049
1059
  ${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
1050
1060
  </div>
@@ -1057,16 +1067,16 @@ let u = class extends ee {
1057
1067
  */
1058
1068
  handleCalendarPosition() {
1059
1069
  const e = this.multiple && !!this.maxlength;
1060
- P.handleCalendarPosition(this.popupRef, this.inputRef, e);
1070
+ S.handleCalendarPosition(this.popupRef, this.inputRef, e);
1061
1071
  }
1062
1072
  async showCalendar() {
1063
1073
  var t;
1064
1074
  const e = this.datepickerPopupRef.value;
1065
1075
  if (this.calendarOpen = !0, e && typeof e.show == "function") {
1066
- e.show(), b() && e.focusOnCurrentDate();
1076
+ e.show(), k() && e.focusOnCurrentDate();
1067
1077
  return;
1068
1078
  }
1069
- await ie(20), this.handleCalendarPosition(), b() && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
1079
+ await ie(20), this.handleCalendarPosition(), k() && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
1070
1080
  }
1071
1081
  hideCalendar() {
1072
1082
  const e = this.datepickerPopupRef.value;
@@ -1076,8 +1086,8 @@ let u = class extends ee {
1076
1086
  e.preventDefault();
1077
1087
  const t = this.datepickerPopupRef.value;
1078
1088
  if (t && typeof t.toggle == "function") {
1079
- const s = !!t.open;
1080
- t.toggle(), this.calendarOpen = !s;
1089
+ const a = !!t.open;
1090
+ t.toggle(), this.calendarOpen = !a;
1081
1091
  return;
1082
1092
  }
1083
1093
  this.calendarOpen ? this.hideCalendar() : this.showCalendar();
@@ -1091,7 +1101,7 @@ let u = class extends ee {
1091
1101
  })
1092
1102
  );
1093
1103
  }
1094
- };
1104
+ }
1095
1105
  p([
1096
1106
  r({ type: String, reflect: !0 })
1097
1107
  ], u.prototype, "value", 1);
@@ -1126,10 +1136,10 @@ p([
1126
1136
  r({ type: Boolean, reflect: !0 })
1127
1137
  ], u.prototype, "withcontrols", 2);
1128
1138
  p([
1129
- r({ converter: G.csvToArray })
1139
+ r({ converter: W.csvToArray })
1130
1140
  ], u.prototype, "excludedates", 2);
1131
1141
  p([
1132
- r({ converter: G.csvToArray })
1142
+ r({ converter: W.csvToArray })
1133
1143
  ], u.prototype, "excludeweekdays", 2);
1134
1144
  p([
1135
1145
  r({ type: String })
@@ -1144,15 +1154,17 @@ p([
1144
1154
  r({ type: String })
1145
1155
  ], u.prototype, "timezone", 2);
1146
1156
  p([
1147
- z()
1157
+ q()
1148
1158
  ], u.prototype, "inputClasses", 2);
1149
- u = p([
1150
- x("pkt-datepicker")
1151
- ], u);
1159
+ try {
1160
+ w("pkt-datepicker")(u);
1161
+ } catch {
1162
+ console.warn("Forsøker å definere <pkt-datepicker>, men den er allerede definert");
1163
+ }
1152
1164
  export {
1153
- w as P,
1165
+ R as P,
1154
1166
  u as a,
1155
- R as b,
1156
- C as c,
1157
- B as d
1167
+ O as b,
1168
+ D as c,
1169
+ j as d
1158
1170
  };