@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,19 +1,19 @@
1
- import { P as M, s as S } from "./element-with-slot-Dqk6-TRR.js";
2
- import { P as C, A as l, b as n, n as s, t as _ } from "./element-CPpT3rFQ.js";
1
+ import { P as _, s as S } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { t as M, P as C, A as h, b as n, n as s } from "./element-CPpT3rFQ.js";
3
3
  import { o as $ } from "./if-defined-B0krMLad.js";
4
4
  import { b as d } from "./booleanish-C9R0tdXH.js";
5
- import { r as k } from "./state-C_1EOo3D.js";
6
- import { e as g } from "./class-map-CEnykyO_.js";
7
- import { e as f, n as y } from "./ref-Bg_Swj5w.js";
8
- import "./button-DEyvt1LI.js";
9
- import "./icon-BlKA8YuW.js";
10
- import "./link-Z_GizclR.js";
11
- import "./textinput-9lHjs4ce.js";
12
- const L = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.iconName, href: e.target } : { title: e.title, iconName: e.iconName, onClick: e.target }, w = (e) => L(e), O = (e) => {
13
- if (!e) return;
14
- const t = typeof e == "string" ? new Date(e) : e;
15
- if (!isNaN(t.getTime()))
16
- return t.toLocaleDateString("nb-NO", {
5
+ import { r as g } from "./state-C_1EOo3D.js";
6
+ import { e as k } from "./class-map-CEnykyO_.js";
7
+ import { e as b, n as f } from "./ref-Bg_Swj5w.js";
8
+ import "./button-BiY-wlKF.js";
9
+ import "./icon-CxQcIa5F.js";
10
+ import "./link-Cdqgl60z.js";
11
+ import "./textinput-r8udK0IX.js";
12
+ const L = (o) => typeof o.target == "string" ? { title: o.title, iconName: o.iconName, href: o.target } : { title: o.title, iconName: o.iconName, onClick: o.target }, w = (o) => L(o), O = (o) => {
13
+ if (!o) return;
14
+ const e = typeof o == "string" ? new Date(o) : o;
15
+ if (!isNaN(e.getTime()))
16
+ return e.toLocaleDateString("nb-NO", {
17
17
  day: "numeric",
18
18
  month: "long",
19
19
  year: "numeric",
@@ -21,12 +21,12 @@ const L = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.ico
21
21
  minute: "2-digit"
22
22
  });
23
23
  };
24
- var R = Object.defineProperty, B = Object.getOwnPropertyDescriptor, b = (e, t, i, u) => {
25
- for (var a = u > 1 ? void 0 : u ? B(t, i) : t, p = e.length - 1, m; p >= 0; p--)
26
- (m = e[p]) && (a = (u ? m(t, i, a) : m(a)) || a);
27
- return u && a && R(t, i, a), a;
24
+ var R = Object.defineProperty, y = (o, e, t, i) => {
25
+ for (var r = void 0, p = o.length - 1, m; p >= 0; p--)
26
+ (m = o[p]) && (r = m(e, t, r) || r);
27
+ return r && R(e, t, r), r;
28
28
  };
29
- let v = class extends C {
29
+ class v extends C {
30
30
  constructor() {
31
31
  super(...arguments), this.canChangeRepresentation = !1, this.logoutOnClick = !1;
32
32
  }
@@ -50,7 +50,7 @@ let v = class extends C {
50
50
  "onClick" in e && typeof e.onClick == "function" && e.onClick();
51
51
  }
52
52
  renderLinkOrButton(e, t) {
53
- const i = "href" in e, u = g({
53
+ const i = "href" in e, r = k({
54
54
  "pkt-user-menu__link": !0,
55
55
  "pkt-link-button": !i,
56
56
  "pkt-link": !i,
@@ -59,7 +59,7 @@ let v = class extends C {
59
59
  });
60
60
  return i ? n`
61
61
  <pkt-link
62
- icon-name=${e.iconName || l}
62
+ icon-name=${e.iconName || h}
63
63
  href=${e.href}
64
64
  aria-hidden="true"
65
65
  class="pkt-user-menu__link ${t || ""}"
@@ -67,12 +67,12 @@ let v = class extends C {
67
67
  ${e.title}
68
68
  </pkt-link>
69
69
  ` : n`
70
- <button class=${u} type="button" @click=${() => this.handleMenuItemClick(e)}>
70
+ <button class=${r} type="button" @click=${() => this.handleMenuItemClick(e)}>
71
71
  ${e.iconName ? n`<pkt-icon
72
72
  name=${e.iconName}
73
73
  class="pkt-link__icon"
74
74
  aria-hidden="true"
75
- ></pkt-icon>` : l}
75
+ ></pkt-icon>` : h}
76
76
  ${e.title}
77
77
  </button>
78
78
  `;
@@ -103,14 +103,14 @@ let v = class extends C {
103
103
  <div class="pkt-user-menu__last-logged-in">
104
104
  Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
105
105
  </div>
106
- ` : l}
106
+ ` : h}
107
107
  </li>
108
- ` : l}
108
+ ` : h}
109
109
 
110
110
  <!-- User menu items -->
111
111
  ${e && e.length > 0 ? n`
112
112
  <li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
113
- ` : l}
113
+ ` : h}
114
114
 
115
115
  <!-- Representing section -->
116
116
  ${this.representing ? n`
@@ -119,7 +119,7 @@ let v = class extends C {
119
119
  <div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
120
120
  ${this.representing.orgNumber ? n`<div class="pkt-user-menu__org-number">
121
121
  Org.nr. ${this.representing.orgNumber}
122
- </div>` : l}
122
+ </div>` : h}
123
123
  ${this.canChangeRepresentation ? n`
124
124
  <ul class="pkt-user-menu__sublist mt-size-16">
125
125
  <li class="pkt-user-menu__subitem">
@@ -130,9 +130,9 @@ let v = class extends C {
130
130
  })}
131
131
  </li>
132
132
  </ul>
133
- ` : l}
133
+ ` : h}
134
134
  </li>
135
- ` : l}
135
+ ` : h}
136
136
 
137
137
  <!-- Change representation without representing object -->
138
138
  ${!this.representing && this.canChangeRepresentation ? n`
@@ -147,7 +147,7 @@ let v = class extends C {
147
147
  </li>
148
148
  </ul>
149
149
  </li>
150
- ` : l}
150
+ ` : h}
151
151
 
152
152
  <!-- Logout -->
153
153
  ${this.logoutOnClick ? n`
@@ -158,46 +158,48 @@ let v = class extends C {
158
158
  onClick: () => this.handleLogout()
159
159
  })}
160
160
  </li>
161
- ` : l}
161
+ ` : h}
162
162
  </ul>
163
163
  </nav>
164
164
  `;
165
165
  }
166
- };
167
- b([
166
+ }
167
+ y([
168
168
  s({ type: Object })
169
- ], v.prototype, "user", 2);
170
- b([
169
+ ], v.prototype, "user");
170
+ y([
171
171
  s({ type: String, attribute: "formatted-last-logged-in" })
172
- ], v.prototype, "formattedLastLoggedIn", 2);
173
- b([
172
+ ], v.prototype, "formattedLastLoggedIn");
173
+ y([
174
174
  s({ type: Object })
175
- ], v.prototype, "representing", 2);
176
- b([
175
+ ], v.prototype, "representing");
176
+ y([
177
177
  s({ type: Array, attribute: "user-menu" })
178
- ], v.prototype, "userMenu", 2);
179
- b([
178
+ ], v.prototype, "userMenu");
179
+ y([
180
180
  s({
181
181
  type: Boolean,
182
182
  attribute: "can-change-representation",
183
183
  converter: d
184
184
  })
185
- ], v.prototype, "canChangeRepresentation", 2);
186
- b([
185
+ ], v.prototype, "canChangeRepresentation");
186
+ y([
187
187
  s({ type: Boolean, attribute: "logout-on-click", converter: d })
188
- ], v.prototype, "logoutOnClick", 2);
189
- v = b([
190
- _("pkt-header-user-menu")
191
- ], v);
192
- var E = Object.defineProperty, P = Object.getOwnPropertyDescriptor, r = (e, t, i, u) => {
193
- for (var a = u > 1 ? void 0 : u ? P(t, i) : t, p = e.length - 1, m; p >= 0; p--)
194
- (m = e[p]) && (a = (u ? m(t, i, a) : m(a)) || a);
195
- return u && a && E(t, i, a), a;
188
+ ], v.prototype, "logoutOnClick");
189
+ try {
190
+ M("pkt-header-user-menu")(v);
191
+ } catch {
192
+ console.warn("Forsøker å definere <pkt-header-user-menu>, men den er allerede definert");
193
+ }
194
+ var B = Object.defineProperty, l = (o, e, t, i) => {
195
+ for (var r = void 0, p = o.length - 1, m; p >= 0; p--)
196
+ (m = o[p]) && (r = m(e, t, r) || r);
197
+ return r && B(e, t, r), r;
196
198
  };
197
- const x = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
198
- let o = class extends M {
199
+ const E = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
200
+ class a extends _ {
199
201
  constructor() {
200
- super(...arguments), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.isMobile = !1, this.isTablet = !1, this.openMenu = "none", this.isHidden = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.alignSlotRight = !1, this.alignSearchRight = !1, this.headerRef = f(), this.userContainerRef = f(), this.slotContainerRef = f(), this.searchContainerRef = f(), this.slotContentRef = f(), this.searchMenuRef = f(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
202
+ super(...arguments), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.isMobile = !1, this.isTablet = !1, this.openMenu = "none", this.isHidden = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.alignSlotRight = !1, this.alignSearchRight = !1, this.headerRef = b(), this.userContainerRef = b(), this.slotContainerRef = b(), this.searchContainerRef = b(), this.slotContentRef = b(), this.searchMenuRef = b(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
201
203
  if (!this.shouldHideOnScroll) return;
202
204
  const e = window.pageYOffset || document.documentElement.scrollTop;
203
205
  e < 0 || Math.abs(e - this.lastScrollPosition) < 60 || (this.isHidden = e > this.lastScrollPosition, this.lastScrollPosition = e);
@@ -206,22 +208,22 @@ let o = class extends M {
206
208
  this.user && this.openMenu === "user" && !t.closest(".pkt-header-service__user-container") && (this.openMenu = "none"), this.openMenu === "slot" && !t.closest(".pkt-header-service__slot-container") && (this.openMenu = "none"), this.openMenu === "search" && !t.closest(".pkt-header-service__search-container") && !t.closest(".pkt-header-service__search-input") && (this.openMenu = "none");
207
209
  }, this.handleFocusOut = (e, t) => {
208
210
  const i = e.relatedTarget;
209
- let u;
211
+ let r;
210
212
  switch (t) {
211
213
  case "user":
212
- u = this.userContainerRef;
214
+ r = this.userContainerRef;
213
215
  break;
214
216
  case "slot":
215
- u = this.slotContainerRef;
217
+ r = this.slotContainerRef;
216
218
  break;
217
219
  case "search":
218
- u = this.searchContainerRef;
220
+ r = this.searchContainerRef;
219
221
  break;
220
222
  default:
221
223
  return;
222
224
  }
223
- const a = u.value;
224
- a && (!i || !a.contains(i)) && (this.openMenu = "none");
225
+ const p = r.value;
226
+ p && (!i || !p.contains(i)) && (this.openMenu = "none");
225
227
  }, this.handleEscapeKey = (e) => {
226
228
  e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.shouldRestoreFocus = !0, this.openMenu = "none");
227
229
  };
@@ -280,8 +282,8 @@ let o = class extends M {
280
282
  checkDropdownAlignment(e) {
281
283
  const t = e === "slot" ? this.slotContainerRef : this.searchContainerRef, i = e === "slot" ? this.slotContentRef : this.searchMenuRef;
282
284
  if (!t.value || !i.value || !this.isTablet || this.isMobile) return;
283
- const u = t.value.getBoundingClientRect(), a = i.value.offsetWidth, p = u.left + a > window.innerWidth;
284
- e === "slot" ? this.alignSlotRight = p : this.alignSearchRight = p;
285
+ const r = t.value.getBoundingClientRect(), p = i.value.offsetWidth, m = r.left + p > window.innerWidth;
286
+ e === "slot" ? this.alignSlotRight = m : this.alignSearchRight = m;
285
287
  }
286
288
  handleMenuToggle(e) {
287
289
  this.openMenu !== "none" ? this.openMenu = "none" : (this.lastFocusedElement = document.activeElement, this.openMenu = e);
@@ -354,9 +356,9 @@ let o = class extends M {
354
356
  return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
355
357
  }
356
358
  renderLogo() {
357
- if (this.hideLogo) return l;
359
+ if (this.hideLogo) return h;
358
360
  const e = n`
359
- <pkt-icon name="oslologo" aria-hidden="true" path=${x}></pkt-icon>
361
+ <pkt-icon name="oslologo" aria-hidden="true" path=${E}></pkt-icon>
360
362
  `;
361
363
  return this.logoLink && typeof this.logoLink == "string" ? n`
362
364
  <span class="pkt-header-service__logo">
@@ -402,14 +404,14 @@ let o = class extends M {
402
404
  <span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
403
405
  <span class="pkt-header-service__service-link">${this.serviceName}</span>
404
406
  </span>
405
- ` : l;
407
+ ` : h;
406
408
  }
407
409
  renderSlotContainer() {
408
- if (!this.hasSlotContent()) return l;
409
- const e = g({
410
+ if (!this.hasSlotContent()) return h;
411
+ const e = k({
410
412
  "pkt-header-service__slot-container": !0,
411
413
  "is-open": this.openMenu === "slot"
412
- }), t = g({
414
+ }), t = k({
413
415
  "pkt-header-service__slot-content": !0,
414
416
  "align-right": this.alignSlotRight
415
417
  });
@@ -417,7 +419,7 @@ let o = class extends M {
417
419
  <div
418
420
  class=${e}
419
421
  @focusout=${(i) => this.handleFocusOut(i, "slot")}
420
- ${y(this.slotContainerRef)}
422
+ ${f(this.slotContainerRef)}
421
423
  >
422
424
  ${this.isTablet && this.hasSlotContent() ? n`
423
425
  <pkt-button
@@ -433,13 +435,13 @@ let o = class extends M {
433
435
  >
434
436
  ${this.slotMenuText}
435
437
  </pkt-button>
436
- ` : l}
438
+ ` : h}
437
439
  <div
438
440
  class=${t}
439
441
  id="mobile-slot-menu"
440
- role=${this.isTablet ? "menu" : l}
441
- aria-label=${this.isTablet ? "Meny" : l}
442
- ${y(this.slotContentRef)}
442
+ role=${this.isTablet ? "menu" : h}
443
+ aria-label=${this.isTablet ? "Meny" : h}
444
+ ${f(this.slotContentRef)}
443
445
  >
444
446
  ${S(this)}
445
447
  </div>
@@ -447,12 +449,12 @@ let o = class extends M {
447
449
  `;
448
450
  }
449
451
  renderSearch() {
450
- if (!this.showSearch) return l;
452
+ if (!this.showSearch) return h;
451
453
  if (this.isTablet) {
452
- const e = g({
454
+ const e = k({
453
455
  "pkt-header-service__search-container": !0,
454
456
  "is-open": this.openMenu === "search"
455
- }), t = g({
457
+ }), t = k({
456
458
  "pkt-header-service__mobile-menu": !0,
457
459
  "is-open": this.openMenu === "search",
458
460
  "align-right": this.alignSearchRight
@@ -461,7 +463,7 @@ let o = class extends M {
461
463
  <div
462
464
  class=${e}
463
465
  @focusout=${(i) => this.handleFocusOut(i, "search")}
464
- ${y(this.searchContainerRef)}
466
+ ${f(this.searchContainerRef)}
465
467
  >
466
468
  <pkt-button
467
469
  skin="secondary"
@@ -476,7 +478,7 @@ let o = class extends M {
476
478
  >
477
479
  Søk
478
480
  </pkt-button>
479
- <div class=${t} ${y(this.searchMenuRef)}>
481
+ <div class=${t} ${f(this.searchMenuRef)}>
480
482
  ${this.openMenu === "search" ? n`
481
483
  <pkt-textinput
482
484
  id="mobile-search-menu"
@@ -493,7 +495,7 @@ let o = class extends M {
493
495
  i.key === "Enter" && this.handleSearch(i.target.value);
494
496
  }}
495
497
  ></pkt-textinput>
496
- ` : l}
498
+ ` : h}
497
499
  </div>
498
500
  </div>
499
501
  `;
@@ -514,8 +516,8 @@ let o = class extends M {
514
516
  }
515
517
  renderUserButton() {
516
518
  var t;
517
- if (!this.user) return l;
518
- const e = g({
519
+ if (!this.user) return h;
520
+ const e = k({
519
521
  "pkt-header-service__user-menu": this.isMobile === !1,
520
522
  "pkt-header-service__mobile-menu": this.isMobile === !0,
521
523
  "is-open": this.openMenu === "user"
@@ -524,10 +526,10 @@ let o = class extends M {
524
526
  <div
525
527
  class="pkt-header-service__user-container"
526
528
  @focusout=${(i) => this.handleFocusOut(i, "user")}
527
- ${y(this.userContainerRef)}
529
+ ${f(this.userContainerRef)}
528
530
  >
529
531
  <pkt-button
530
- class=${g({
532
+ class=${k({
531
533
  "pkt-header-service__user-button": !0,
532
534
  "pkt-header-service__user-button--mobile": this.isMobile
533
535
  })}
@@ -546,7 +548,7 @@ let o = class extends M {
546
548
  <div class=${e}>
547
549
  <pkt-header-user-menu
548
550
  .user=${this.user}
549
- formatted-last-logged-in=${this.formattedLastLoggedIn || l}
551
+ formatted-last-logged-in=${this.formattedLastLoggedIn || h}
550
552
  .representing=${this.representing}
551
553
  .userMenu=${this.userMenu}
552
554
  ?can-change-representation=${this.canChangeRepresentation}
@@ -557,12 +559,12 @@ let o = class extends M {
557
559
  @log-out=${this.handleLogout}
558
560
  ></pkt-header-user-menu>
559
561
  </div>
560
- ` : l}
562
+ ` : h}
561
563
  </div>
562
564
  `;
563
565
  }
564
566
  renderHeader() {
565
- const e = g({
567
+ const e = k({
566
568
  "pkt-header-service": !0,
567
569
  "pkt-header-service--compact": this.compact,
568
570
  "pkt-header-service--mobile": this.isMobile,
@@ -570,12 +572,12 @@ let o = class extends M {
570
572
  "pkt-header-service--fixed": this.isFixed,
571
573
  "pkt-header-service--scroll-to-hide": this.shouldHideOnScroll,
572
574
  "pkt-header-service--hidden": this.isHidden
573
- }), t = g({
575
+ }), t = k({
574
576
  "pkt-header-service__logo-area": !0,
575
577
  "pkt-header-service__logo-area--without-service": !this.serviceName
576
578
  });
577
579
  return n`
578
- <header class=${e} ${y(this.headerRef)}>
580
+ <header class=${e} ${f(this.headerRef)}>
579
581
  <div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
580
582
 
581
583
  ${this.hasSlotContent() || this.showSearch || this.showLogoutInHeader ? n`<div class="pkt-header-service__content">
@@ -590,8 +592,8 @@ let o = class extends M {
590
592
  >
591
593
  Logg ut
592
594
  </pkt-button>
593
- ` : l}
594
- </div>` : l}
595
+ ` : h}
596
+ </div>` : h}
595
597
  ${this.user || !this.isTablet && this.showLogoutInHeader ? n`<div class="pkt-header-service__user">
596
598
  ${this.renderUserButton()}
597
599
  ${!this.isTablet && this.showLogoutInHeader ? n`
@@ -604,15 +606,15 @@ let o = class extends M {
604
606
  >
605
607
  Logg ut
606
608
  </pkt-button>
607
- ` : l}
608
- </div>` : l}
609
+ ` : h}
610
+ </div>` : h}
609
611
  </header>
610
612
  `;
611
613
  }
612
614
  render() {
613
615
  const e = this.renderHeader();
614
616
  if (this.isFixed) {
615
- const t = g({
617
+ const t = k({
616
618
  "pkt-header-service-spacer": !0,
617
619
  "pkt-header-service-spacer--compact": this.compact,
618
620
  "pkt-header-service-spacer--has-user": !!this.user,
@@ -627,104 +629,106 @@ let o = class extends M {
627
629
  }
628
630
  return e;
629
631
  }
630
- };
631
- r([
632
+ }
633
+ l([
632
634
  s({ type: String, attribute: "service-name" })
633
- ], o.prototype, "serviceName", 2);
634
- r([
635
+ ], a.prototype, "serviceName");
636
+ l([
635
637
  s({ type: String, attribute: "service-link" })
636
- ], o.prototype, "serviceLink", 2);
637
- r([
638
+ ], a.prototype, "serviceLink");
639
+ l([
638
640
  s({ type: String, attribute: "logo-link" })
639
- ], o.prototype, "logoLink", 2);
640
- r([
641
+ ], a.prototype, "logoLink");
642
+ l([
641
643
  s({ type: String, attribute: "search-placeholder" })
642
- ], o.prototype, "searchPlaceholder", 2);
643
- r([
644
+ ], a.prototype, "searchPlaceholder");
645
+ l([
644
646
  s({ type: String, attribute: "search-value" })
645
- ], o.prototype, "searchValue", 2);
646
- r([
647
+ ], a.prototype, "searchValue");
648
+ l([
647
649
  s({ type: Number, attribute: "mobile-breakpoint" })
648
- ], o.prototype, "mobileBreakpoint", 2);
649
- r([
650
+ ], a.prototype, "mobileBreakpoint");
651
+ l([
650
652
  s({ type: Number, attribute: "tablet-breakpoint" })
651
- ], o.prototype, "tabletBreakpoint", 2);
652
- r([
653
+ ], a.prototype, "tabletBreakpoint");
654
+ l([
653
655
  s({ type: String, attribute: "opened-menu" })
654
- ], o.prototype, "openedMenu", 2);
655
- r([
656
+ ], a.prototype, "openedMenu");
657
+ l([
656
658
  s({ type: String, attribute: "log-out-button-placement" })
657
- ], o.prototype, "logOutButtonPlacement", 2);
658
- r([
659
+ ], a.prototype, "logOutButtonPlacement");
660
+ l([
659
661
  s({ type: String })
660
- ], o.prototype, "position", 2);
661
- r([
662
+ ], a.prototype, "position");
663
+ l([
662
664
  s({ type: String, attribute: "scroll-behavior" })
663
- ], o.prototype, "scrollBehavior", 2);
664
- r([
665
+ ], a.prototype, "scrollBehavior");
666
+ l([
665
667
  s({ type: String, attribute: "slot-menu-variant" })
666
- ], o.prototype, "slotMenuVariant", 2);
667
- r([
668
+ ], a.prototype, "slotMenuVariant");
669
+ l([
668
670
  s({ type: String, attribute: "slot-menu-text" })
669
- ], o.prototype, "slotMenuText", 2);
670
- r([
671
+ ], a.prototype, "slotMenuText");
672
+ l([
671
673
  s({ type: Boolean, attribute: "hide-logo", converter: d })
672
- ], o.prototype, "hideLogo", 2);
673
- r([
674
+ ], a.prototype, "hideLogo");
675
+ l([
674
676
  s({ type: Boolean, converter: d })
675
- ], o.prototype, "compact", 2);
676
- r([
677
+ ], a.prototype, "compact");
678
+ l([
677
679
  s({ type: Boolean, attribute: "show-search", converter: d })
678
- ], o.prototype, "showSearch", 2);
679
- r([
680
+ ], a.prototype, "showSearch");
681
+ l([
680
682
  s({
681
683
  type: Boolean,
682
684
  attribute: "can-change-representation",
683
685
  converter: d
684
686
  })
685
- ], o.prototype, "canChangeRepresentation", 2);
686
- r([
687
+ ], a.prototype, "canChangeRepresentation");
688
+ l([
687
689
  s({ type: Boolean, attribute: "has-log-out", converter: d })
688
- ], o.prototype, "hasLogOut", 2);
689
- r([
690
+ ], a.prototype, "hasLogOut");
691
+ l([
690
692
  s({ type: Object })
691
- ], o.prototype, "user", 2);
692
- r([
693
+ ], a.prototype, "user");
694
+ l([
693
695
  s({ type: Array, attribute: "user-menu" })
694
- ], o.prototype, "userMenu", 2);
695
- r([
696
+ ], a.prototype, "userMenu");
697
+ l([
696
698
  s({ type: Object })
697
- ], o.prototype, "representing", 2);
698
- r([
699
- k()
700
- ], o.prototype, "isMobile", 2);
701
- r([
702
- k()
703
- ], o.prototype, "isTablet", 2);
704
- r([
705
- k()
706
- ], o.prototype, "openMenu", 2);
707
- r([
708
- k()
709
- ], o.prototype, "isHidden", 2);
710
- r([
711
- k()
712
- ], o.prototype, "componentWidth", 2);
713
- r([
714
- k()
715
- ], o.prototype, "alignSlotRight", 2);
716
- r([
717
- k()
718
- ], o.prototype, "alignSearchRight", 2);
719
- o = r([
720
- _("pkt-header-service")
721
- ], o);
722
- var N = Object.defineProperty, T = Object.getOwnPropertyDescriptor, c = (e, t, i, u) => {
723
- for (var a = u > 1 ? void 0 : u ? T(t, i) : t, p = e.length - 1, m; p >= 0; p--)
724
- (m = e[p]) && (a = (u ? m(t, i, a) : m(a)) || a);
725
- return u && a && N(t, i, a), a;
699
+ ], a.prototype, "representing");
700
+ l([
701
+ g()
702
+ ], a.prototype, "isMobile");
703
+ l([
704
+ g()
705
+ ], a.prototype, "isTablet");
706
+ l([
707
+ g()
708
+ ], a.prototype, "openMenu");
709
+ l([
710
+ g()
711
+ ], a.prototype, "isHidden");
712
+ l([
713
+ g()
714
+ ], a.prototype, "componentWidth");
715
+ l([
716
+ g()
717
+ ], a.prototype, "alignSlotRight");
718
+ l([
719
+ g()
720
+ ], a.prototype, "alignSearchRight");
721
+ try {
722
+ M("pkt-header-service")(a);
723
+ } catch {
724
+ console.warn("Forsøker å definere <pkt-header-service>, men den er allerede definert");
725
+ }
726
+ var P = Object.defineProperty, u = (o, e, t, i) => {
727
+ for (var r = void 0, p = o.length - 1, m; p >= 0; p--)
728
+ (m = o[p]) && (r = m(e, t, r) || r);
729
+ return r && P(e, t, r), r;
726
730
  };
727
- let h = class extends M {
731
+ class c extends _ {
728
732
  constructor() {
729
733
  super(...arguments), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1;
730
734
  }
@@ -766,90 +770,92 @@ let h = class extends M {
766
770
  .userMenu=${this.effectiveUserMenu}
767
771
  .representing=${this.representing}
768
772
  >
769
- ${this.hasSlotContent() ? n`<div class="pkt-contents">${S(this)}</div>` : l}
773
+ ${this.hasSlotContent() ? n`<div class="pkt-contents">${S(this)}</div>` : h}
770
774
  </pkt-header-service>
771
775
  `;
772
776
  }
773
- };
774
- c([
777
+ }
778
+ u([
775
779
  s({ type: String, attribute: "service-name" })
776
- ], h.prototype, "serviceName", 2);
777
- c([
780
+ ], c.prototype, "serviceName");
781
+ u([
778
782
  s({ type: String, attribute: "service-link" })
779
- ], h.prototype, "serviceLink", 2);
780
- c([
783
+ ], c.prototype, "serviceLink");
784
+ u([
781
785
  s({ type: String, attribute: "logo-link" })
782
- ], h.prototype, "logoLink", 2);
783
- c([
786
+ ], c.prototype, "logoLink");
787
+ u([
784
788
  s({ type: String, attribute: "search-placeholder" })
785
- ], h.prototype, "searchPlaceholder", 2);
786
- c([
789
+ ], c.prototype, "searchPlaceholder");
790
+ u([
787
791
  s({ type: String, attribute: "search-value" })
788
- ], h.prototype, "searchValue", 2);
789
- c([
792
+ ], c.prototype, "searchValue");
793
+ u([
790
794
  s({ type: Number, attribute: "mobile-breakpoint" })
791
- ], h.prototype, "mobileBreakpoint", 2);
792
- c([
795
+ ], c.prototype, "mobileBreakpoint");
796
+ u([
793
797
  s({ type: Number, attribute: "tablet-breakpoint" })
794
- ], h.prototype, "tabletBreakpoint", 2);
795
- c([
798
+ ], c.prototype, "tabletBreakpoint");
799
+ u([
796
800
  s({ type: String, attribute: "opened-menu" })
797
- ], h.prototype, "openedMenu", 2);
798
- c([
801
+ ], c.prototype, "openedMenu");
802
+ u([
799
803
  s({ type: String, attribute: "log-out-button-placement" })
800
- ], h.prototype, "logOutButtonPlacement", 2);
801
- c([
804
+ ], c.prototype, "logOutButtonPlacement");
805
+ u([
802
806
  s({ type: String })
803
- ], h.prototype, "position", 2);
804
- c([
807
+ ], c.prototype, "position");
808
+ u([
805
809
  s({ type: String, attribute: "scroll-behavior" })
806
- ], h.prototype, "scrollBehavior", 2);
807
- c([
810
+ ], c.prototype, "scrollBehavior");
811
+ u([
808
812
  s({ type: String, attribute: "slot-menu-variant" })
809
- ], h.prototype, "slotMenuVariant", 2);
810
- c([
813
+ ], c.prototype, "slotMenuVariant");
814
+ u([
811
815
  s({ type: String, attribute: "slot-menu-text" })
812
- ], h.prototype, "slotMenuText", 2);
813
- c([
816
+ ], c.prototype, "slotMenuText");
817
+ u([
814
818
  s({ type: Boolean, attribute: "hide-logo", converter: d })
815
- ], h.prototype, "hideLogo", 2);
816
- c([
819
+ ], c.prototype, "hideLogo");
820
+ u([
817
821
  s({ type: Boolean, converter: d })
818
- ], h.prototype, "compact", 2);
819
- c([
822
+ ], c.prototype, "compact");
823
+ u([
820
824
  s({ type: Boolean, attribute: "show-search", converter: d })
821
- ], h.prototype, "showSearch", 2);
822
- c([
825
+ ], c.prototype, "showSearch");
826
+ u([
823
827
  s({
824
828
  type: Boolean,
825
829
  attribute: "can-change-representation",
826
830
  converter: d
827
831
  })
828
- ], h.prototype, "canChangeRepresentation", 2);
829
- c([
832
+ ], c.prototype, "canChangeRepresentation");
833
+ u([
830
834
  s({ type: Boolean, attribute: "has-log-out", converter: d })
831
- ], h.prototype, "hasLogOut", 2);
832
- c([
835
+ ], c.prototype, "hasLogOut");
836
+ u([
833
837
  s({ type: Object })
834
- ], h.prototype, "user", 2);
835
- c([
838
+ ], c.prototype, "user");
839
+ u([
836
840
  s({ type: Array, attribute: "user-menu" })
837
- ], h.prototype, "userMenu", 2);
838
- c([
841
+ ], c.prototype, "userMenu");
842
+ u([
839
843
  s({ type: Object })
840
- ], h.prototype, "representing", 2);
841
- c([
844
+ ], c.prototype, "representing");
845
+ u([
842
846
  s({ type: Array, attribute: "user-menu-footer" })
843
- ], h.prototype, "userMenuFooter", 2);
844
- c([
847
+ ], c.prototype, "userMenuFooter");
848
+ u([
845
849
  s({ type: Array, attribute: "user-options" })
846
- ], h.prototype, "userOptions", 2);
847
- h = c([
848
- _("pkt-header")
849
- ], h);
850
+ ], c.prototype, "userOptions");
851
+ try {
852
+ M("pkt-header")(c);
853
+ } catch {
854
+ console.warn("Forsøker å definere <pkt-header>, men den er allerede definert");
855
+ }
850
856
  export {
851
- h as PktHeader,
852
- o as PktHeaderService,
857
+ c as PktHeader,
858
+ a as PktHeaderService,
853
859
  v as PktHeaderUserMenu,
854
860
  O as formatLastLoggedIn
855
861
  };