@oslokommune/punkt-elements 16.7.0 → 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 +34 -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 +22 -19
  103. package/dist/pkt-timepicker.js +84 -76
  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 +14 -2
  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,34 +1,34 @@
1
- import { s as c, b as u, A as o, n as b, t as w } from "./element-CPpT3rFQ.js";
1
+ import { t as I, s as c, b as u, A as p, n as b } from "./element-CPpT3rFQ.js";
2
2
  import { r as v } from "./state-C_1EOo3D.js";
3
3
  import { e as m, n as _ } from "./ref-Bg_Swj5w.js";
4
4
  import { o as k } from "./if-defined-B0krMLad.js";
5
- import { e as x } from "./class-map-CEnykyO_.js";
6
- import { P as I } from "./input-element-8nLwuQS4.js";
7
- import { s as F } from "./element-with-slot-Dqk6-TRR.js";
8
- import "./icon-BlKA8YuW.js";
9
- import "./input-wrapper-B2JpK016.js";
10
- const A = (t) => /^\d{2}:\d{2}$/.test(t) && parseInt(t.slice(0, 2), 10) <= 23 && parseInt(t.slice(3), 10) <= 59, f = (t) => {
11
- const [e, s] = t.split(":").map(Number);
12
- return e * 60 + s;
13
- }, g = (t) => t ? Math.max(1, Math.round(t / 60)) : 1, C = (t, e) => {
14
- const s = t ? parseInt(String(t).split(":")[0], 10) : 0, i = e ? parseInt(String(e).split(":")[0], 10) : 23;
15
- return Array.from({ length: i - s + 1 }, (n, r) => r + s);
16
- }, O = (t) => {
17
- const e = g(t);
18
- return Array.from({ length: Math.floor(60 / e) }, (s, i) => i * e);
19
- }, T = (t, e, s, i) => {
20
- let a = t !== "" ? parseInt(t, 10) : s === 1 ? 0 : 23, p = e !== "" ? parseInt(e, 10) : s === 1 ? 0 : Math.floor(59 / i) * i;
21
- return p += s * i, p > 59 ? (p = 0, a = (a + 1) % 24) : p < 0 && (p = Math.floor(59 / i) * i, a = (a - 1 + 24) % 24), {
22
- hours: String(a).padStart(2, "0"),
23
- minutes: String(p).padStart(2, "0")
5
+ import { e as F } from "./class-map-CEnykyO_.js";
6
+ import { P as A } from "./input-element-8nLwuQS4.js";
7
+ import { s as C } from "./element-with-slot-Dqk6-TRR.js";
8
+ import "./icon-CxQcIa5F.js";
9
+ import "./input-wrapper-Bs4CRNst.js";
10
+ const O = (a) => /^\d{2}:\d{2}$/.test(a) && parseInt(a.slice(0, 2), 10) <= 23 && parseInt(a.slice(3), 10) <= 59, f = (a) => {
11
+ const [t, e] = a.split(":").map(Number);
12
+ return t * 60 + e;
13
+ }, g = (a) => a ? Math.max(1, Math.round(a / 60)) : 1, T = (a, t) => {
14
+ const e = a ? parseInt(String(a).split(":")[0], 10) : 0, s = t ? parseInt(String(t).split(":")[0], 10) : 23;
15
+ return Array.from({ length: s - e + 1 }, (i, n) => n + e);
16
+ }, M = (a) => {
17
+ const t = g(a);
18
+ return Array.from({ length: Math.floor(60 / t) }, (e, s) => s * t);
19
+ }, V = (a, t, e, s) => {
20
+ let r = a !== "" ? parseInt(a, 10) : e === 1 ? 0 : 23, o = t !== "" ? parseInt(t, 10) : e === 1 ? 0 : Math.floor(59 / s) * s;
21
+ return o += e * s, o > 59 ? (o = 0, r = (r + 1) % 24) : o < 0 && (o = Math.floor(59 / s) * s, r = (r - 1 + 24) % 24), {
22
+ hours: String(r).padStart(2, "0"),
23
+ minutes: String(o).padStart(2, "0")
24
24
  };
25
25
  };
26
- var M = Object.defineProperty, V = Object.getOwnPropertyDescriptor, l = (t, e, s, i) => {
27
- for (var n = i > 1 ? void 0 : i ? V(e, s) : e, r = t.length - 1, a; r >= 0; r--)
28
- (a = t[r]) && (n = (i ? a(e, s, n) : a(n)) || n);
29
- return i && n && M(e, s, n), n;
26
+ var P = Object.defineProperty, d = (a, t, e, s) => {
27
+ for (var i = void 0, n = a.length - 1, r; n >= 0; n--)
28
+ (r = a[n]) && (i = r(t, e, i) || i);
29
+ return i && P(t, e, i), i;
30
30
  };
31
- let h = class extends I {
31
+ class l extends A {
32
32
  constructor() {
33
33
  super(...arguments), this.hiddenInputRef = m(), this.hoursInputRef = m(), this.minutesInputRef = m(), this.buttonRef = m(), this.value = "", this.hidePicker = !1, this.stepArrows = !1, this._hours = "", this._minutes = "", this._isOpen = !1, this._hoursDigitCount = 0, this._hoursFirstDigit = -1, this._minutesDigitCount = 0, this._minutesFirstDigit = -1, this._hasFocus = !1, this._outsideClickHandler = (t) => {
34
34
  this.contains(t.target) || this._closePopup();
@@ -74,8 +74,8 @@ let h = class extends I {
74
74
  if (this._hoursDigitCount === 0)
75
75
  this._hoursFirstDigit = r, this._hours = String(r).padStart(2, "0"), this._hoursDigitCount = 1, this.onInput(), r >= 3 && (this._hoursFirstDigit = -1, this._hoursDigitCount = 0, this._syncValueFromDisplay(), (i = this.minutesInputRef.value) == null || i.focus());
76
76
  else {
77
- const a = this._hoursFirstDigit * 10 + r;
78
- this._hours = a <= 23 ? String(a).padStart(2, "0") : String(r).padStart(2, "0"), this._hoursFirstDigit = -1, this._hoursDigitCount = 0, this._syncValueFromDisplay(), this.onInput(), (n = this.minutesInputRef.value) == null || n.focus();
77
+ const o = this._hoursFirstDigit * 10 + r;
78
+ this._hours = o <= 23 ? String(o).padStart(2, "0") : String(r).padStart(2, "0"), this._hoursFirstDigit = -1, this._hoursDigitCount = 0, this._syncValueFromDisplay(), this.onInput(), (n = this.minutesInputRef.value) == null || n.focus();
79
79
  }
80
80
  } else
81
81
  t.preventDefault();
@@ -129,7 +129,7 @@ let h = class extends I {
129
129
  }, this._handleMinutesBlur = () => {
130
130
  this._minutes !== "" && (this._minutes = String(parseInt(this._minutes, 10)).padStart(2, "0")), this._minutesDigitCount = 0, this._minutesFirstDigit = -1, this._syncValueFromDisplay();
131
131
  }, this._handlePopupKeydown = (t) => {
132
- var a;
132
+ var o;
133
133
  const e = document.activeElement, s = e.closest(".pkt-timepicker-popup__col");
134
134
  if (!s) return;
135
135
  const i = Array.from(s.querySelectorAll(".pkt-timepicker-popup__option")), n = i.indexOf(e), r = e.dataset.type ?? "";
@@ -161,7 +161,7 @@ let h = class extends I {
161
161
  t.preventDefault(), e.click();
162
162
  break;
163
163
  case "Escape":
164
- t.preventDefault(), this._closePopup(), (a = this.buttonRef.value) == null || a.focus();
164
+ t.preventDefault(), this._closePopup(), (o = this.buttonRef.value) == null || o.focus();
165
165
  break;
166
166
  }
167
167
  };
@@ -245,7 +245,7 @@ let h = class extends I {
245
245
  return t === 3600 || t < 3600 && 3600 % t === 0 && t % 60 === 0;
246
246
  }
247
247
  _syncDisplayFromValue() {
248
- const t = A(this.value) ? this.value.split(":") : null;
248
+ const t = O(this.value) ? this.value.split(":") : null;
249
249
  t ? (this._hours = t[0], this._minutes = t[1]) : (this._hours = "", this._minutes = "");
250
250
  }
251
251
  _syncValueFromDisplay() {
@@ -258,10 +258,10 @@ let h = class extends I {
258
258
  return g(this.step);
259
259
  }
260
260
  get _hourOptions() {
261
- return C(this.min, this.max);
261
+ return T(this.min, this.max);
262
262
  }
263
263
  get _minuteOptions() {
264
- return O(this.step);
264
+ return M(this.step);
265
265
  }
266
266
  _openPopup() {
267
267
  this._isOpen = !0, this.updateComplete.then(() => {
@@ -282,7 +282,7 @@ let h = class extends I {
282
282
  });
283
283
  }
284
284
  _focusSelectedOrFirst(t) {
285
- var a;
285
+ var o;
286
286
  const e = this.querySelector(".pkt-timepicker-popup");
287
287
  if (!e) return;
288
288
  const s = e.querySelectorAll(".pkt-timepicker-popup__col"), i = t === "hour" ? s[0] : s[1];
@@ -290,7 +290,7 @@ let h = class extends I {
290
290
  const n = i.querySelector(
291
291
  ".pkt-timepicker-popup__option--selected"
292
292
  ), r = i.querySelector(".pkt-timepicker-popup__option");
293
- (a = n || r) == null || a.focus();
293
+ (o = n || r) == null || o.focus();
294
294
  }
295
295
  _handleOptionClick(t, e) {
296
296
  var i;
@@ -303,14 +303,14 @@ let h = class extends I {
303
303
  e === "hour" ? this._hours = String(s).padStart(2, "0") : this._minutes = String(s).padStart(2, "0"), t.focus();
304
304
  }
305
305
  _stepTime(t) {
306
- const e = T(this._hours, this._minutes, t, this._minuteStep);
306
+ const e = V(this._hours, this._minutes, t, this._minuteStep);
307
307
  this._hours = e.hours, this._minutes = e.minutes, this._syncValueFromDisplay();
308
308
  }
309
309
  _renderOption(t, e) {
310
310
  const s = String(t).padStart(2, "0"), i = e === "hour" ? this._hours !== "" ? parseInt(this._hours, 10) : NaN : this._minutes !== "" ? parseInt(this._minutes, 10) : NaN, n = t === i;
311
311
  return u`
312
312
  <button
313
- class=${x({
313
+ class=${F({
314
314
  "pkt-btn": !0,
315
315
  "pkt-btn--tertiary": !0,
316
316
  "pkt-btn--small": !0,
@@ -367,24 +367,30 @@ let h = class extends I {
367
367
  `;
368
368
  }
369
369
  _renderContainer() {
370
- var n, r, a, p, $, y, S, D;
370
+ var n, r, o, $, y, S, D, w;
371
371
  const t = ((n = this.strings.timepicker) == null ? void 0 : n.hours) ?? "Timer", e = ((r = this.strings.timepicker) == null ? void 0 : r.minutes) ?? "Minutter", s = this.label ? `${t}, ${this.label}` : t, i = this.label ? `${e}, ${this.label}` : e;
372
372
  return u`
373
- <div class="pkt-input__container">
373
+ <div
374
+ class="pkt-input__container"
375
+ @click=${(h) => {
376
+ var x;
377
+ h.target.closest("button, input") || (x = this.hoursInputRef.value) == null || x.focus();
378
+ }}
379
+ >
374
380
  ${this.stepArrows ? u`
375
381
  <button
376
382
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--prev"
377
383
  type="button"
378
- aria-label=${((a = this.strings.timepicker) == null ? void 0 : a.prevTime) ?? "Forrige tidspunkt"}
384
+ aria-label=${((o = this.strings.timepicker) == null ? void 0 : o.prevTime) ?? "Forrige tidspunkt"}
379
385
  ?disabled=${this.disabled}
380
386
  @click=${() => this._stepTime(-1)}
381
387
  >
382
388
  <pkt-icon name="chevron-thin-left"></pkt-icon>
383
389
  <span class="pkt-btn__text"
384
- >${((p = this.strings.timepicker) == null ? void 0 : p.prevTime) ?? "Forrige tidspunkt"}</span
390
+ >${(($ = this.strings.timepicker) == null ? void 0 : $.prevTime) ?? "Forrige tidspunkt"}</span
385
391
  >
386
392
  </button>
387
- ` : o}
393
+ ` : p}
388
394
  <input
389
395
  ${_(this.hoursInputRef)}
390
396
  type="text"
@@ -399,17 +405,17 @@ let h = class extends I {
399
405
  placeholder="––"
400
406
  aria-label=${s}
401
407
  role="spinbutton"
402
- aria-invalid=${this.hasError ? "true" : o}
408
+ aria-invalid=${this.hasError ? "true" : p}
403
409
  aria-valuemin="0"
404
410
  aria-valuemax="23"
405
- aria-valuenow=${this._hours !== "" ? this._hours : o}
406
- aria-valuetext=${this._hours !== "" ? `${this._hours} ${t.toLowerCase()}` : o}
411
+ aria-valuenow=${this._hours !== "" ? this._hours : p}
412
+ aria-valuetext=${this._hours !== "" ? `${this._hours} ${t.toLowerCase()}` : p}
407
413
  autocomplete="off"
408
414
  ?disabled=${this.disabled}
409
415
  @keydown=${this._handleHoursKeydown}
410
416
  @blur=${this._handleHoursBlur}
411
- @focus=${(d) => {
412
- d.target.select(), d.stopImmediatePropagation();
417
+ @focus=${(h) => {
418
+ h.target.select(), h.stopImmediatePropagation();
413
419
  }}
414
420
  />
415
421
  <span class="pkt-timepicker__separator">:</span>
@@ -427,30 +433,30 @@ let h = class extends I {
427
433
  placeholder="––"
428
434
  aria-label=${i}
429
435
  role="spinbutton"
430
- aria-invalid=${this.hasError ? "true" : o}
436
+ aria-invalid=${this.hasError ? "true" : p}
431
437
  aria-valuemin="0"
432
438
  aria-valuemax="59"
433
- aria-valuenow=${this._minutes !== "" ? this._minutes : o}
434
- aria-valuetext=${this._minutes !== "" ? `${this._minutes} ${e.toLowerCase()}` : o}
439
+ aria-valuenow=${this._minutes !== "" ? this._minutes : p}
440
+ aria-valuetext=${this._minutes !== "" ? `${this._minutes} ${e.toLowerCase()}` : p}
435
441
  autocomplete="off"
436
442
  ?disabled=${this.disabled}
437
443
  @keydown=${this._handleMinutesKeydown}
438
444
  @blur=${this._handleMinutesBlur}
439
- @focus=${(d) => {
440
- d.target.select(), d.stopImmediatePropagation();
445
+ @focus=${(h) => {
446
+ h.target.select(), h.stopImmediatePropagation();
441
447
  }}
442
448
  />
443
449
  ${this.hidePicker && !this.stepArrows ? u`<pkt-icon
444
450
  class="pkt-input-icon pkt-timepicker__icon"
445
451
  name="clock"
446
452
  aria-hidden="true"
447
- ></pkt-icon>` : o}
453
+ ></pkt-icon>` : p}
448
454
  ${!this.hidePicker && !this.stepArrows ? u`
449
455
  <button
450
456
  ${_(this.buttonRef)}
451
457
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button"
452
458
  type="button"
453
- aria-label=${(($ = this.strings.timepicker) == null ? void 0 : $.openPicker) ?? "Åpne tidspunkt-velger"}
459
+ aria-label=${((y = this.strings.timepicker) == null ? void 0 : y.openPicker) ?? "Åpne tidspunkt-velger"}
454
460
  aria-haspopup="listbox"
455
461
  aria-expanded=${this._isOpen ? "true" : "false"}
456
462
  aria-controls=${this.id + "-popup"}
@@ -459,24 +465,24 @@ let h = class extends I {
459
465
  >
460
466
  <pkt-icon name="clock"></pkt-icon>
461
467
  <span class="pkt-btn__text"
462
- >${((y = this.strings.timepicker) == null ? void 0 : y.openPicker) ?? "Åpne tidspunkt-velger"}</span
468
+ >${((S = this.strings.timepicker) == null ? void 0 : S.openPicker) ?? "Åpne tidspunkt-velger"}</span
463
469
  >
464
470
  </button>
465
- ` : o}
471
+ ` : p}
466
472
  ${this.stepArrows ? u`
467
473
  <button
468
474
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--next"
469
475
  type="button"
470
- aria-label=${((S = this.strings.timepicker) == null ? void 0 : S.nextTime) ?? "Neste tidspunkt"}
476
+ aria-label=${((D = this.strings.timepicker) == null ? void 0 : D.nextTime) ?? "Neste tidspunkt"}
471
477
  ?disabled=${this.disabled}
472
478
  @click=${() => this._stepTime(1)}
473
479
  >
474
480
  <pkt-icon name="chevron-thin-right"></pkt-icon>
475
481
  <span class="pkt-btn__text"
476
- >${((D = this.strings.timepicker) == null ? void 0 : D.nextTime) ?? "Neste tidspunkt"}</span
482
+ >${((w = this.strings.timepicker) == null ? void 0 : w.nextTime) ?? "Neste tidspunkt"}</span
477
483
  >
478
484
  </button>
479
- ` : o}
485
+ ` : p}
480
486
  <input
481
487
  ${_(this.hiddenInputRef)}
482
488
  type="time"
@@ -516,7 +522,7 @@ let h = class extends I {
516
522
  .requiredText=${this.requiredText}
517
523
  .tagText=${this.tagText}
518
524
  >
519
- <div class="pkt-contents" slot="helptext">${F(this, "helptext")}</div>
525
+ <div class="pkt-contents" slot="helptext">${C(this, "helptext")}</div>
520
526
  ${!this.hidePicker && !this.stepArrows ? u`
521
527
  <div class="pkt-timepicker__anchor">
522
528
  ${this._renderContainer()} ${this._renderPopup()}
@@ -525,28 +531,30 @@ let h = class extends I {
525
531
  </pkt-input-wrapper>
526
532
  `;
527
533
  }
528
- };
529
- l([
534
+ }
535
+ d([
530
536
  b({ type: String, reflect: !0 })
531
- ], h.prototype, "value", 2);
532
- l([
537
+ ], l.prototype, "value");
538
+ d([
533
539
  b({ type: Boolean, reflect: !0, attribute: "hide-picker" })
534
- ], h.prototype, "hidePicker", 2);
535
- l([
540
+ ], l.prototype, "hidePicker");
541
+ d([
536
542
  b({ type: Boolean, reflect: !0, attribute: "step-arrows" })
537
- ], h.prototype, "stepArrows", 2);
538
- l([
543
+ ], l.prototype, "stepArrows");
544
+ d([
539
545
  v()
540
- ], h.prototype, "_hours", 2);
541
- l([
546
+ ], l.prototype, "_hours");
547
+ d([
542
548
  v()
543
- ], h.prototype, "_minutes", 2);
544
- l([
549
+ ], l.prototype, "_minutes");
550
+ d([
545
551
  v()
546
- ], h.prototype, "_isOpen", 2);
547
- h = l([
548
- w("pkt-timepicker")
549
- ], h);
552
+ ], l.prototype, "_isOpen");
553
+ try {
554
+ I("pkt-timepicker")(l);
555
+ } catch {
556
+ console.warn("Forsøker å definere <pkt-timepicker>, men den er allerede definert");
557
+ }
550
558
  export {
551
- h as PktTimepicker
559
+ l as PktTimepicker
552
560
  };
@@ -0,0 +1,21 @@
1
+ "use strict";const p=require("./class-map-CsENJXf1.cjs"),e=require("./element-gR_VtSiD.cjs"),h=require("./state-Dg-53wQ8.cjs"),d=require("./ref-CL-Xk9Xm.cjs"),b=require("./directive-C7oCP5Bh.cjs"),c=require("./utils-byXsEz1u.cjs");require("./icon-q81vqPK_.cjs");/**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const y="important",m=" !"+y,_=b.e(class extends b.i{constructor(n){var t;if(super(n),n.type!==b.t.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,s)=>{const a=n[s];return a==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`},"")}update(n,[t]){const{style:s}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const a of this.ft)t[a]==null&&(this.ft.delete(a),a.includes("-")?s.removeProperty(a):s[a]=null);for(const a in t){const l=t[a];if(l!=null){this.ft.add(a);const u=typeof l=="string"&&l.endsWith(m);a.includes("-")||u?s.setProperty(a,u?l.slice(0,-11):l,u?y:""):s[a]=l}}return e.E}});var A=Object.defineProperty,i=(n,t,s,a)=>{for(var l=void 0,u=n.length-1,o;u>=0;u--)(o=n[u])&&(l=o(t,s,l)||l);return l&&A(t,s,l),l};class r extends e.PktElement{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=c.uuidish(),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=d.e(),this.progressBarRef=d.e()}firstUpdated(t){super.firstUpdated(t),this.setComputedValues(),this.syncAttributes()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id),(t.has("statusType")||t.has("id")||t.has("ariaLabelledby"))&&(this.progressbarId=this.id||c.uuidish(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(t.has("ariaValueText")||t.has("valueCurrent")||t.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const t=this.statusType!=="none",s=this.valueMax-this.valueMin,a=this.valueCurrent/s*100,l=this.statusType==="fraction"?Math.round(a):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),u=`${this.valueCurrent} av ${s}`,o=p.e({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),v=p.e({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),f=p.e({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),g=p.e({"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.b` <div
6
+ class="pkt-progressbar__container"
7
+ .ref=${this.progressBarRef}
8
+ style=${_({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${l}%`})}
9
+ >
10
+ ${this.title?e.b`<p id=${`${this.progressBarId}-title`} class=${v}>${this.title}</p>`:e.A}
11
+
12
+ <div class="pkt-progressbar__bar-wrapper">
13
+ <div class=${o}></div>
14
+ </div>
15
+
16
+ ${t?e.b`<div class=${f}>
17
+ <span class=${g} ${d.n(this.labelRef)}>
18
+ ${this.statusType==="percentage"?`${l}%`:u}
19
+ </span>
20
+ </div>`:e.A}
21
+ </div>`}setComputedValues(){this.progressbarId=this.id||c.uuidish(),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(t,s){s==null||s===""?this.removeAttribute(t):this.setAttribute(t,String(s))}}i([e.n({type:String})],r.prototype,"ariaLabel");i([e.n({type:String,reflect:!0})],r.prototype,"ariaLabelledby");i([e.n({type:String,reflect:!0})],r.prototype,"ariaValueText");i([e.n({type:String})],r.prototype,"ariaLive");i([e.n({type:String,reflect:!0})],r.prototype,"id");i([e.n({type:String})],r.prototype,"role");i([e.n({type:String})],r.prototype,"skin");i([e.n({type:String})],r.prototype,"statusPlacement");i([e.n({type:String})],r.prototype,"statusType");i([e.n({type:String,reflect:!0})],r.prototype,"title");i([e.n({type:String})],r.prototype,"titlePosition");i([e.n({type:Number,reflect:!0})],r.prototype,"valueCurrent");i([e.n({type:Number})],r.prototype,"valueMax");i([e.n({type:Number})],r.prototype,"valueMin");i([h.r()],r.prototype,"labelWidth");i([h.r()],r.prototype,"progressbarId");i([h.r()],r.prototype,"computedAriaLabelledby");i([h.r()],r.prototype,"computedAriaValueText");try{e.t("pkt-progressbar")(r)}catch{console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert")}exports.PktProgressbar=r;
@@ -1,95 +1,95 @@
1
- import { e as n } from "./class-map-CEnykyO_.js";
2
- import { E as g, P as _, A as c, b, n as u, t as $ } from "./element-CPpT3rFQ.js";
1
+ import { e as p } from "./class-map-CEnykyO_.js";
2
+ import { E as _, t as $, P as A, A as c, b as d, n as u } from "./element-CPpT3rFQ.js";
3
3
  import { r as h } from "./state-C_1EOo3D.js";
4
- import { e as y, n as A } from "./ref-Bg_Swj5w.js";
5
- import { e as x, i as T, t as k } from "./directive-oAbCiebi.js";
6
- import { u as d } from "./utils-DznhwRXm.js";
7
- import "./icon-BlKA8YuW.js";
4
+ import { e as y, n as k } from "./ref-Bg_Swj5w.js";
5
+ import { e as x, i as T, t as C } from "./directive-oAbCiebi.js";
6
+ import { u as b } from "./utils-DznhwRXm.js";
7
+ import "./icon-CxQcIa5F.js";
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2018 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
12
  */
13
- const v = "important", C = " !" + v, M = x(class extends T {
14
- constructor(t) {
15
- var e;
16
- if (super(t), t.type !== k.ATTRIBUTE || t.name !== "style" || ((e = t.strings) == null ? void 0 : e.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
13
+ const f = "important", M = " !" + f, L = x(class extends T {
14
+ constructor(l) {
15
+ var t;
16
+ if (super(l), l.type !== C.ATTRIBUTE || l.name !== "style" || ((t = l.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
17
17
  }
18
- render(t) {
19
- return Object.keys(t).reduce((e, a) => {
20
- const s = t[a];
21
- return s == null ? e : e + `${a = a.includes("-") ? a : a.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
18
+ render(l) {
19
+ return Object.keys(l).reduce((t, e) => {
20
+ const i = l[e];
21
+ return i == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`;
22
22
  }, "");
23
23
  }
24
- update(t, [e]) {
25
- const { style: a } = t.element;
26
- if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
27
- for (const s of this.ft) e[s] == null && (this.ft.delete(s), s.includes("-") ? a.removeProperty(s) : a[s] = null);
28
- for (const s in e) {
29
- const l = e[s];
30
- if (l != null) {
31
- this.ft.add(s);
32
- const o = typeof l == "string" && l.endsWith(C);
33
- s.includes("-") || o ? a.setProperty(s, o ? l.slice(0, -11) : l, o ? v : "") : a[s] = l;
24
+ update(l, [t]) {
25
+ const { style: e } = l.element;
26
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
27
+ for (const i of this.ft) t[i] == null && (this.ft.delete(i), i.includes("-") ? e.removeProperty(i) : e[i] = null);
28
+ for (const i in t) {
29
+ const a = t[i];
30
+ if (a != null) {
31
+ this.ft.add(i);
32
+ const o = typeof a == "string" && a.endsWith(M);
33
+ i.includes("-") || o ? e.setProperty(i, o ? a.slice(0, -11) : a, o ? f : "") : e[i] = a;
34
34
  }
35
35
  }
36
- return g;
36
+ return _;
37
37
  }
38
38
  });
39
- var L = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, e, a, s) => {
40
- for (var l = s > 1 ? void 0 : s ? S(e, a) : e, o = t.length - 1, p; o >= 0; o--)
41
- (p = t[o]) && (l = (s ? p(e, a, l) : p(l)) || l);
42
- return s && l && L(e, a, l), l;
39
+ var S = Object.defineProperty, r = (l, t, e, i) => {
40
+ for (var a = void 0, o = l.length - 1, n; o >= 0; o--)
41
+ (n = l[o]) && (a = n(t, e, a) || a);
42
+ return a && S(t, e, a), a;
43
43
  };
44
- let r = class extends _ {
44
+ class s extends A {
45
45
  constructor() {
46
- super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = d(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.computedAriaLabelledby = null, this.computedAriaValueText = "", this.labelRef = y(), this.progressBarRef = y();
46
+ super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = b(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.computedAriaLabelledby = null, this.computedAriaValueText = "", this.labelRef = y(), this.progressBarRef = y();
47
47
  }
48
48
  firstUpdated(t) {
49
49
  super.firstUpdated(t), this.setComputedValues(), this.syncAttributes();
50
50
  }
51
51
  updated(t) {
52
- super.updated(t), t.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), t.has("id") && this.id && (this.progressBarId = this.id), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id || d(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (t.has("ariaValueText") || t.has("valueCurrent") || t.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
52
+ super.updated(t), t.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), t.has("id") && this.id && (this.progressBarId = this.id), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (t.has("ariaValueText") || t.has("valueCurrent") || t.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
53
53
  }
54
54
  render() {
55
- const t = this.statusType !== "none", e = this.valueMax - this.valueMin, a = this.valueCurrent / e * 100, s = this.statusType === "fraction" ? Math.round(a) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), l = `${this.valueCurrent} av ${e}`, o = n({
55
+ const t = this.statusType !== "none", e = this.valueMax - this.valueMin, i = this.valueCurrent / e * 100, a = this.statusType === "fraction" ? Math.round(i) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), o = `${this.valueCurrent} av ${e}`, n = p({
56
56
  "pkt-progressbar__bar": !0,
57
57
  [`pkt-progressbar__bar--${this.skin}`]: !!this.skin
58
- }), p = n({
58
+ }), v = p({
59
59
  "pkt-progressbar__title": !0,
60
60
  "pkt-progressbar__title-center": this.titlePosition === "center"
61
- }), f = n({
61
+ }), m = p({
62
62
  "pkt-progressbar__status": !0,
63
63
  "pkt-progressbar__status--center": this.statusPlacement === "center"
64
- }), m = n({
64
+ }), g = p({
65
65
  "pkt-progressbar__status-placement--following": this.statusPlacement === "following",
66
66
  "pkt-progressbar__status-placement--center": this.statusPlacement === "center",
67
67
  "pkt-progressbar__status-placement--left": this.statusPlacement === "left"
68
68
  });
69
- return b` <div
69
+ return d` <div
70
70
  class="pkt-progressbar__container"
71
71
  .ref=${this.progressBarRef}
72
- style=${M({
72
+ style=${L({
73
73
  "--pkt-progress-label-width": `${this.labelWidth}px`,
74
- "--pkt-progress-width": `${s}%`
74
+ "--pkt-progress-width": `${a}%`
75
75
  })}
76
76
  >
77
- ${this.title ? b`<p id=${`${this.progressBarId}-title`} class=${p}>${this.title}</p>` : c}
77
+ ${this.title ? d`<p id=${`${this.progressBarId}-title`} class=${v}>${this.title}</p>` : c}
78
78
 
79
79
  <div class="pkt-progressbar__bar-wrapper">
80
- <div class=${o}></div>
80
+ <div class=${n}></div>
81
81
  </div>
82
82
 
83
- ${t ? b`<div class=${f}>
84
- <span class=${m} ${A(this.labelRef)}>
85
- ${this.statusType === "percentage" ? `${s}%` : l}
83
+ ${t ? d`<div class=${m}>
84
+ <span class=${g} ${k(this.labelRef)}>
85
+ ${this.statusType === "percentage" ? `${a}%` : o}
86
86
  </span>
87
87
  </div>` : c}
88
88
  </div>`;
89
89
  }
90
90
  // methods
91
91
  setComputedValues() {
92
- this.progressbarId = this.id || d(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`, this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "";
92
+ this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`, this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "";
93
93
  }
94
94
  syncAttributes() {
95
95
  this._handleAttribute("aria-live", this.ariaLive), this._handleAttribute("aria-valuenow", this.valueCurrent), this._handleAttribute("aria-valuemin", this.valueMin), this._handleAttribute("aria-valuemax", this.valueMax), this._handleAttribute("aria-valuetext", this.computedAriaValueText), this._handleAttribute("aria-label", this.ariaLabel), this._handleAttribute("role", this.role), this._handleAttribute("aria-atomic", "true"), this._handleAttribute("id", this.progressbarId), this.ariaLabel || this._handleAttribute("aria-labelledby", this.computedAriaLabelledby);
@@ -97,66 +97,66 @@ let r = class extends _ {
97
97
  _handleAttribute(t, e) {
98
98
  e == null || e === "" ? this.removeAttribute(t) : this.setAttribute(t, String(e));
99
99
  }
100
- };
101
- i([
100
+ }
101
+ r([
102
102
  u({ type: String })
103
- ], r.prototype, "ariaLabel", 2);
104
- i([
103
+ ], s.prototype, "ariaLabel");
104
+ r([
105
105
  u({ type: String, reflect: !0 })
106
- ], r.prototype, "ariaLabelledby", 2);
107
- i([
106
+ ], s.prototype, "ariaLabelledby");
107
+ r([
108
108
  u({ type: String, reflect: !0 })
109
- ], r.prototype, "ariaValueText", 2);
110
- i([
109
+ ], s.prototype, "ariaValueText");
110
+ r([
111
111
  u({ type: String })
112
- ], r.prototype, "ariaLive", 2);
113
- i([
112
+ ], s.prototype, "ariaLive");
113
+ r([
114
114
  u({ type: String, reflect: !0 })
115
- ], r.prototype, "id", 2);
116
- i([
115
+ ], s.prototype, "id");
116
+ r([
117
117
  u({ type: String })
118
- ], r.prototype, "role", 2);
119
- i([
118
+ ], s.prototype, "role");
119
+ r([
120
120
  u({ type: String })
121
- ], r.prototype, "skin", 2);
122
- i([
121
+ ], s.prototype, "skin");
122
+ r([
123
123
  u({ type: String })
124
- ], r.prototype, "statusPlacement", 2);
125
- i([
124
+ ], s.prototype, "statusPlacement");
125
+ r([
126
126
  u({ type: String })
127
- ], r.prototype, "statusType", 2);
128
- i([
127
+ ], s.prototype, "statusType");
128
+ r([
129
129
  u({ type: String, reflect: !0 })
130
- ], r.prototype, "title", 2);
131
- i([
130
+ ], s.prototype, "title");
131
+ r([
132
132
  u({ type: String })
133
- ], r.prototype, "titlePosition", 2);
134
- i([
133
+ ], s.prototype, "titlePosition");
134
+ r([
135
135
  u({ type: Number, reflect: !0 })
136
- ], r.prototype, "valueCurrent", 2);
137
- i([
136
+ ], s.prototype, "valueCurrent");
137
+ r([
138
138
  u({ type: Number })
139
- ], r.prototype, "valueMax", 2);
140
- i([
139
+ ], s.prototype, "valueMax");
140
+ r([
141
141
  u({ type: Number })
142
- ], r.prototype, "valueMin", 2);
143
- i([
142
+ ], s.prototype, "valueMin");
143
+ r([
144
144
  h()
145
- ], r.prototype, "labelWidth", 2);
146
- i([
145
+ ], s.prototype, "labelWidth");
146
+ r([
147
147
  h()
148
- ], r.prototype, "progressbarId", 2);
149
- i([
148
+ ], s.prototype, "progressbarId");
149
+ r([
150
150
  h()
151
- ], r.prototype, "computedAriaLabelledby", 2);
152
- i([
151
+ ], s.prototype, "computedAriaLabelledby");
152
+ r([
153
153
  h()
154
- ], r.prototype, "computedAriaValueText", 2);
155
- r = i([
156
- $("pkt-progressbar")
157
- ], r);
158
- const W = r;
154
+ ], s.prototype, "computedAriaValueText");
155
+ try {
156
+ $("pkt-progressbar")(s);
157
+ } catch {
158
+ console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert");
159
+ }
159
160
  export {
160
- r as P,
161
- W as a
161
+ s as P
162
162
  };