@oslokommune/punkt-elements 14.1.1 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/booleanish-BKVonob4.cjs +1 -0
  3. package/dist/booleanish-C9R0tdXH.js +11 -0
  4. package/dist/{checkbox-BP5zOlPy.cjs → checkbox-C0TPnShf.cjs} +1 -1
  5. package/dist/{checkbox-CfXOh6Lw.js → checkbox-CnhA52o_.js} +1 -1
  6. package/dist/{combobox-BWsCkPH2.cjs → combobox-C1xwAju5.cjs} +1 -1
  7. package/dist/{combobox-BMznle0M.js → combobox-Dcp_fHcL.js} +2 -2
  8. package/dist/{datepicker-2s6FUxdi.js → datepicker-Bjb9GK1E.js} +2 -2
  9. package/dist/{datepicker-D1c9oP-2.cjs → datepicker-COIRRau0.cjs} +1 -1
  10. package/dist/index.d.ts +68 -180
  11. package/dist/{input-element-B0VPRK_E.js → input-element-B8M8Nppd.js} +77 -84
  12. package/dist/input-element-D697OAJo.cjs +1 -0
  13. package/dist/{input-wrapper-CAwzMR9o.js → input-wrapper-1PCXqtiu.js} +42 -49
  14. package/dist/{input-wrapper-DXg2N3wx.cjs → input-wrapper-CtBiAb04.cjs} +20 -20
  15. package/dist/pkt-checkbox.cjs +1 -1
  16. package/dist/pkt-checkbox.js +1 -1
  17. package/dist/pkt-combobox.cjs +1 -1
  18. package/dist/pkt-combobox.js +1 -1
  19. package/dist/pkt-datepicker.cjs +1 -1
  20. package/dist/pkt-datepicker.js +2 -2
  21. package/dist/pkt-header.cjs +14 -12
  22. package/dist/pkt-header.js +163 -155
  23. package/dist/pkt-index.cjs +1 -1
  24. package/dist/pkt-index.js +8 -8
  25. package/dist/pkt-input-wrapper.cjs +1 -1
  26. package/dist/pkt-input-wrapper.js +1 -1
  27. package/dist/pkt-radiobutton.cjs +1 -1
  28. package/dist/pkt-radiobutton.js +1 -1
  29. package/dist/pkt-select.cjs +1 -1
  30. package/dist/pkt-select.js +1 -1
  31. package/dist/pkt-textarea.cjs +1 -1
  32. package/dist/pkt-textarea.js +1 -1
  33. package/dist/pkt-textinput.cjs +1 -1
  34. package/dist/pkt-textinput.js +1 -1
  35. package/dist/{radiobutton-BuKXgQm_.cjs → radiobutton-BkqaqO5E.cjs} +1 -1
  36. package/dist/{radiobutton-C_MzK8dE.js → radiobutton-Caq8-GhM.js} +1 -1
  37. package/dist/{select-Ds4Ws1_6.cjs → select-3dwlk22G.cjs} +1 -1
  38. package/dist/{select-CteaDnzz.js → select-_C-yztI0.js} +2 -2
  39. package/dist/{textarea-zeFp1hxO.cjs → textarea-DyUy8u7X.cjs} +1 -1
  40. package/dist/{textarea-D4T9yqw7.js → textarea-a6T4aJJU.js} +2 -2
  41. package/dist/{textinput-Cddq4eF_.js → textinput-DIuM70dd.js} +2 -2
  42. package/dist/{textinput-DFFL5v-U.cjs → textinput-IN3b0nSH.cjs} +1 -1
  43. package/package.json +2 -2
  44. package/src/components/accordion/accordion.ts +2 -1
  45. package/src/components/alert/alert.ts +2 -2
  46. package/src/components/button/button.ts +2 -3
  47. package/src/components/card/card.ts +2 -3
  48. package/src/components/header/header-service.ts +12 -8
  49. package/src/components/header/header.ts +8 -2
  50. package/src/components/header/index.ts +4 -1
  51. package/src/components/header/types.ts +33 -98
  52. package/src/components/heading/heading.ts +4 -3
  53. package/src/components/index.ts +4 -1
  54. package/src/components/input-wrapper/input-wrapper.ts +2 -16
  55. package/src/components/messagebox/messagebox.ts +2 -1
  56. package/src/components/progressbar/progressbar.ts +1 -1
  57. package/src/components/tag/tag.ts +2 -2
  58. package/dist/input-element-BmXkhljw.cjs +0 -1
@@ -1,21 +1,15 @@
1
- import { P as _, E as c, x as n, n as s, a as M } from "./element-CRDRygXu.js";
1
+ import { P as _, E as u, x as n, n as s, a as M } from "./element-CRDRygXu.js";
2
2
  import { P as S } from "./pkt-slot-controller-BPGj-LC5.js";
3
3
  import { o as $ } from "./if-defined-BWZGb3bh.js";
4
- import { e as k, n as v } from "./ref-Xa5dbh--.js";
4
+ import { e as v, n as k } from "./ref-Xa5dbh--.js";
5
+ import { b as d } from "./booleanish-C9R0tdXH.js";
5
6
  import { r as f } from "./state-DS_kr2Fy.js";
6
- import { e as m } from "./class-map-wy7PUk0P.js";
7
+ import { e as g } from "./class-map-wy7PUk0P.js";
7
8
  import "./button-CjXih_Nx.js";
8
9
  import "./icon-BB7e5iQN.js";
9
10
  import "./link-BboUBUcg.js";
10
- import "./textinput-Cddq4eF_.js";
11
- const d = {
12
- fromAttribute(e) {
13
- return e == null ? !1 : e === "" || e === "true" || e === !0 ? !0 : e === "false" || e === !1 ? !1 : !!e;
14
- },
15
- toAttribute(e) {
16
- return e ? "true" : "false";
17
- }
18
- }, C = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.iconName, href: e.target } : { title: e.title, iconName: e.iconName, onClick: e.target }, L = (e) => {
11
+ import "./textinput-DIuM70dd.js";
12
+ const C = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.iconName, href: e.target } : { title: e.title, iconName: e.iconName, onClick: e.target }, L = (e) => C(e), w = (e) => {
19
13
  if (!e) return;
20
14
  const t = typeof e == "string" ? new Date(e) : e;
21
15
  if (!isNaN(t.getTime()))
@@ -27,10 +21,10 @@ const d = {
27
21
  minute: "2-digit"
28
22
  });
29
23
  };
30
- var w = Object.defineProperty, O = Object.getOwnPropertyDescriptor, y = (e, t, i, l) => {
31
- for (var r = l > 1 ? void 0 : l ? O(t, i) : t, p = e.length - 1, g; p >= 0; p--)
32
- (g = e[p]) && (r = (l ? g(t, i, r) : g(r)) || r);
33
- return l && r && w(t, i, r), r;
24
+ var O = Object.defineProperty, R = Object.getOwnPropertyDescriptor, y = (e, t, i, c) => {
25
+ for (var a = c > 1 ? void 0 : c ? R(t, i) : t, p = e.length - 1, m; p >= 0; p--)
26
+ (m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
27
+ return c && a && O(t, i, a), a;
34
28
  };
35
29
  let b = class extends _ {
36
30
  constructor() {
@@ -56,7 +50,7 @@ let b = class extends _ {
56
50
  "onClick" in e && typeof e.onClick == "function" && e.onClick();
57
51
  }
58
52
  renderLinkOrButton(e, t) {
59
- const i = "href" in e, l = m({
53
+ const i = "href" in e, c = g({
60
54
  "pkt-user-menu__link": !0,
61
55
  "pkt-link-button": !i,
62
56
  "pkt-link": !i,
@@ -65,7 +59,7 @@ let b = class extends _ {
65
59
  });
66
60
  return i ? n`
67
61
  <pkt-link
68
- icon-name=${e.iconName || c}
62
+ icon-name=${e.iconName || u}
69
63
  href=${e.href}
70
64
  aria-hidden="true"
71
65
  class="pkt-user-menu__link ${t || ""}"
@@ -73,12 +67,12 @@ let b = class extends _ {
73
67
  ${e.title}
74
68
  </pkt-link>
75
69
  ` : n`
76
- <button class=${l} type="button" @click=${() => this.handleMenuItemClick(e)}>
70
+ <button class=${c} type="button" @click=${() => this.handleMenuItemClick(e)}>
77
71
  ${e.iconName ? n`<pkt-icon
78
72
  name=${e.iconName}
79
73
  class="pkt-link__icon"
80
74
  aria-hidden="true"
81
- ></pkt-icon>` : c}
75
+ ></pkt-icon>` : u}
82
76
  ${e.title}
83
77
  </button>
84
78
  `;
@@ -96,7 +90,7 @@ let b = class extends _ {
96
90
  }
97
91
  render() {
98
92
  var t;
99
- const e = (t = this.userMenu) == null ? void 0 : t.map(C);
93
+ const e = (t = this.userMenu) == null ? void 0 : t.map(L);
100
94
  return n`
101
95
  <nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
102
96
  <ul class="pkt-user-menu__list">
@@ -109,14 +103,14 @@ let b = class extends _ {
109
103
  <div class="pkt-user-menu__last-logged-in">
110
104
  Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
111
105
  </div>
112
- ` : c}
106
+ ` : u}
113
107
  </li>
114
- ` : c}
108
+ ` : u}
115
109
 
116
110
  <!-- User menu items -->
117
111
  ${e && e.length > 0 ? n`
118
112
  <li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
119
- ` : c}
113
+ ` : u}
120
114
 
121
115
  <!-- Representing section -->
122
116
  ${this.representing ? n`
@@ -125,7 +119,7 @@ let b = class extends _ {
125
119
  <div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
126
120
  ${this.representing.orgNumber ? n`<div class="pkt-user-menu__org-number">
127
121
  Org.nr. ${this.representing.orgNumber}
128
- </div>` : c}
122
+ </div>` : u}
129
123
  ${this.canChangeRepresentation ? n`
130
124
  <ul class="pkt-user-menu__sublist mt-size-16">
131
125
  <li class="pkt-user-menu__subitem">
@@ -136,9 +130,9 @@ let b = class extends _ {
136
130
  })}
137
131
  </li>
138
132
  </ul>
139
- ` : c}
133
+ ` : u}
140
134
  </li>
141
- ` : c}
135
+ ` : u}
142
136
 
143
137
  <!-- Change representation without representing object -->
144
138
  ${!this.representing && this.canChangeRepresentation ? n`
@@ -153,7 +147,7 @@ let b = class extends _ {
153
147
  </li>
154
148
  </ul>
155
149
  </li>
156
- ` : c}
150
+ ` : u}
157
151
 
158
152
  <!-- Logout -->
159
153
  ${this.logoutOnClick ? n`
@@ -164,7 +158,7 @@ let b = class extends _ {
164
158
  onClick: () => this.handleLogout()
165
159
  })}
166
160
  </li>
167
- ` : c}
161
+ ` : u}
168
162
  </ul>
169
163
  </nav>
170
164
  `;
@@ -195,15 +189,15 @@ y([
195
189
  b = y([
196
190
  M("pkt-header-user-menu")
197
191
  ], b);
198
- var R = Object.defineProperty, B = Object.getOwnPropertyDescriptor, a = (e, t, i, l) => {
199
- for (var r = l > 1 ? void 0 : l ? B(t, i) : t, p = e.length - 1, g; p >= 0; p--)
200
- (g = e[p]) && (r = (l ? g(t, i, r) : g(r)) || r);
201
- return l && r && R(t, i, r), r;
192
+ var B = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, t, i, c) => {
193
+ for (var a = c > 1 ? void 0 : c ? E(t, i) : t, p = e.length - 1, m; p >= 0; p--)
194
+ (m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
195
+ return c && a && B(t, i, a), a;
202
196
  };
203
- const E = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
197
+ const P = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
204
198
  let o = class extends _ {
205
199
  constructor() {
206
- super(), 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.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.hasSlotContent = !1, this.alignSlotRight = !1, this.alignSearchRight = !1, this.defaultSlot = k(), this.headerRef = k(), this.userContainerRef = k(), this.slotContainerRef = k(), this.searchContainerRef = k(), this.slotContentRef = k(), this.searchMenuRef = k(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
200
+ super(), 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.hasSlotContent = !1, this.alignSlotRight = !1, this.alignSearchRight = !1, this.defaultSlot = v(), this.headerRef = v(), this.userContainerRef = v(), this.slotContainerRef = v(), this.searchContainerRef = v(), this.slotContentRef = v(), this.searchMenuRef = v(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
207
201
  if (!this.shouldHideOnScroll) return;
208
202
  const e = window.pageYOffset || document.documentElement.scrollTop;
209
203
  e < 0 || Math.abs(e - this.lastScrollPosition) < 60 || (this.isHidden = e > this.lastScrollPosition, this.lastScrollPosition = e);
@@ -212,22 +206,22 @@ let o = class extends _ {
212
206
  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");
213
207
  }, this.handleFocusOut = (e, t) => {
214
208
  const i = e.relatedTarget;
215
- let l;
209
+ let c;
216
210
  switch (t) {
217
211
  case "user":
218
- l = this.userContainerRef;
212
+ c = this.userContainerRef;
219
213
  break;
220
214
  case "slot":
221
- l = this.slotContainerRef;
215
+ c = this.slotContainerRef;
222
216
  break;
223
217
  case "search":
224
- l = this.searchContainerRef;
218
+ c = this.searchContainerRef;
225
219
  break;
226
220
  default:
227
221
  return;
228
222
  }
229
- const r = l.value;
230
- r && (!i || !r.contains(i)) && (this.openMenu = "none");
223
+ const a = c.value;
224
+ a && (!i || !a.contains(i)) && (this.openMenu = "none");
231
225
  }, this.handleEscapeKey = (e) => {
232
226
  e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.shouldRestoreFocus = !0, this.openMenu = "none");
233
227
  }, this.slotController = new S(this, this.defaultSlot);
@@ -289,7 +283,7 @@ let o = class extends _ {
289
283
  checkDropdownAlignment(e) {
290
284
  const t = e === "slot" ? this.slotContainerRef : this.searchContainerRef, i = e === "slot" ? this.slotContentRef : this.searchMenuRef;
291
285
  if (!t.value || !i.value || !this.isTablet || this.isMobile) return;
292
- const l = t.value.getBoundingClientRect(), r = i.value.offsetWidth, p = l.left + r > window.innerWidth;
286
+ const c = t.value.getBoundingClientRect(), a = i.value.offsetWidth, p = c.left + a > window.innerWidth;
293
287
  e === "slot" ? this.alignSlotRight = p : this.alignSearchRight = p;
294
288
  }
295
289
  handleMenuToggle(e) {
@@ -348,7 +342,7 @@ let o = class extends _ {
348
342
  }
349
343
  get formattedLastLoggedIn() {
350
344
  var e;
351
- return L((e = this.user) == null ? void 0 : e.lastLoggedIn);
345
+ return w((e = this.user) == null ? void 0 : e.lastLoggedIn);
352
346
  }
353
347
  get isFixed() {
354
348
  return this.position === "fixed";
@@ -363,9 +357,9 @@ let o = class extends _ {
363
357
  return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
364
358
  }
365
359
  renderLogo() {
366
- if (this.hideLogo) return c;
360
+ if (this.hideLogo) return u;
367
361
  const e = n`
368
- <pkt-icon name="oslologo" aria-hidden="true" path=${E}></pkt-icon>
362
+ <pkt-icon name="oslologo" aria-hidden="true" path=${P}></pkt-icon>
369
363
  `;
370
364
  return this.logoLink && typeof this.logoLink == "string" ? n`
371
365
  <span class="pkt-header-service__logo">
@@ -411,13 +405,13 @@ let o = class extends _ {
411
405
  <span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
412
406
  <span class="pkt-header-service__service-link">${this.serviceName}</span>
413
407
  </span>
414
- ` : c;
408
+ ` : u;
415
409
  }
416
410
  renderSlotContainer() {
417
- const e = m({
411
+ const e = g({
418
412
  "pkt-header-service__slot-container": !0,
419
413
  "is-open": this.openMenu === "slot"
420
- }), t = m({
414
+ }), t = g({
421
415
  "pkt-header-service__slot-content": !0,
422
416
  "align-right": this.alignSlotRight
423
417
  });
@@ -425,12 +419,12 @@ let o = class extends _ {
425
419
  <div
426
420
  class=${e}
427
421
  @focusout=${(i) => this.handleFocusOut(i, "slot")}
428
- ${v(this.slotContainerRef)}
422
+ ${k(this.slotContainerRef)}
429
423
  >
430
424
  ${this.isTablet && this.hasSlotContent ? n`
431
425
  <pkt-button
432
426
  skin="secondary"
433
- variant="icon-only"
427
+ variant=${this.slotMenuVariant}
434
428
  iconName="menu"
435
429
  size=${this.isMobile ? "small" : "medium"}
436
430
  state=${this.openMenu === "slot" ? "active" : "normal"}
@@ -439,27 +433,27 @@ let o = class extends _ {
439
433
  aria-controls="mobile-slot-menu"
440
434
  aria-label="Åpne meny"
441
435
  >
442
- Meny
436
+ ${this.slotMenuText}
443
437
  </pkt-button>
444
- ` : c}
438
+ ` : u}
445
439
  <div
446
440
  class=${t}
447
441
  id="mobile-slot-menu"
448
- role=${this.isTablet ? "menu" : c}
449
- aria-label=${this.isTablet ? "Meny" : c}
450
- ${v(this.slotContentRef)}
451
- ${v(this.defaultSlot)}
442
+ role=${this.isTablet ? "menu" : u}
443
+ aria-label=${this.isTablet ? "Meny" : u}
444
+ ${k(this.slotContentRef)}
445
+ ${k(this.defaultSlot)}
452
446
  ></div>
453
447
  </div>
454
448
  `;
455
449
  }
456
450
  renderSearch() {
457
- if (!this.showSearch) return c;
451
+ if (!this.showSearch) return u;
458
452
  if (this.isTablet) {
459
- const e = m({
453
+ const e = g({
460
454
  "pkt-header-service__search-container": !0,
461
455
  "is-open": this.openMenu === "search"
462
- }), t = m({
456
+ }), t = g({
463
457
  "pkt-header-service__mobile-menu": !0,
464
458
  "is-open": this.openMenu === "search",
465
459
  "align-right": this.alignSearchRight
@@ -468,7 +462,7 @@ let o = class extends _ {
468
462
  <div
469
463
  class=${e}
470
464
  @focusout=${(i) => this.handleFocusOut(i, "search")}
471
- ${v(this.searchContainerRef)}
465
+ ${k(this.searchContainerRef)}
472
466
  >
473
467
  <pkt-button
474
468
  skin="secondary"
@@ -483,7 +477,7 @@ let o = class extends _ {
483
477
  >
484
478
  Søk
485
479
  </pkt-button>
486
- <div class=${t} ${v(this.searchMenuRef)}>
480
+ <div class=${t} ${k(this.searchMenuRef)}>
487
481
  ${this.openMenu === "search" ? n`
488
482
  <pkt-textinput
489
483
  id="mobile-search-menu"
@@ -500,7 +494,7 @@ let o = class extends _ {
500
494
  i.key === "Enter" && this.handleSearch(i.target.value);
501
495
  }}
502
496
  ></pkt-textinput>
503
- ` : c}
497
+ ` : u}
504
498
  </div>
505
499
  </div>
506
500
  `;
@@ -521,8 +515,8 @@ let o = class extends _ {
521
515
  }
522
516
  renderUserButton() {
523
517
  var t;
524
- if (!this.user) return c;
525
- const e = m({
518
+ if (!this.user) return u;
519
+ const e = g({
526
520
  "pkt-header-service__user-menu": this.isMobile === !1,
527
521
  "pkt-header-service__mobile-menu": this.isMobile === !0,
528
522
  "is-open": this.openMenu === "user"
@@ -531,10 +525,10 @@ let o = class extends _ {
531
525
  <div
532
526
  class="pkt-header-service__user-container"
533
527
  @focusout=${(i) => this.handleFocusOut(i, "user")}
534
- ${v(this.userContainerRef)}
528
+ ${k(this.userContainerRef)}
535
529
  >
536
530
  <pkt-button
537
- class=${m({
531
+ class=${g({
538
532
  "pkt-header-service__user-button": !0,
539
533
  "pkt-header-service__user-button--mobile": this.isMobile
540
534
  })}
@@ -553,7 +547,7 @@ let o = class extends _ {
553
547
  <div class=${e}>
554
548
  <pkt-header-user-menu
555
549
  .user=${this.user}
556
- formatted-last-logged-in=${this.formattedLastLoggedIn || c}
550
+ formatted-last-logged-in=${this.formattedLastLoggedIn || u}
557
551
  .representing=${this.representing}
558
552
  .userMenu=${this.userMenu}
559
553
  ?can-change-representation=${this.canChangeRepresentation}
@@ -564,12 +558,12 @@ let o = class extends _ {
564
558
  @log-out=${this.handleLogout}
565
559
  ></pkt-header-user-menu>
566
560
  </div>
567
- ` : c}
561
+ ` : u}
568
562
  </div>
569
563
  `;
570
564
  }
571
565
  renderHeader() {
572
- const e = m({
566
+ const e = g({
573
567
  "pkt-header-service": !0,
574
568
  "pkt-header-service--compact": this.compact,
575
569
  "pkt-header-service--mobile": this.isMobile,
@@ -577,12 +571,12 @@ let o = class extends _ {
577
571
  "pkt-header-service--fixed": this.isFixed,
578
572
  "pkt-header-service--scroll-to-hide": this.shouldHideOnScroll,
579
573
  "pkt-header-service--hidden": this.isHidden
580
- }), t = m({
574
+ }), t = g({
581
575
  "pkt-header-service__logo-area": !0,
582
576
  "pkt-header-service__logo-area--without-service": !this.serviceName
583
577
  });
584
578
  return n`
585
- <header class=${e} ${v(this.headerRef)}>
579
+ <header class=${e} ${k(this.headerRef)}>
586
580
  <div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
587
581
 
588
582
  <div class="pkt-header-service__content">
@@ -597,7 +591,7 @@ let o = class extends _ {
597
591
  >
598
592
  Logg ut
599
593
  </pkt-button>
600
- ` : c}
594
+ ` : u}
601
595
  </div>
602
596
 
603
597
  <div class="pkt-header-service__user">
@@ -612,7 +606,7 @@ let o = class extends _ {
612
606
  >
613
607
  Logg ut
614
608
  </pkt-button>
615
- ` : c}
609
+ ` : u}
616
610
  </div>
617
611
  </header>
618
612
  `;
@@ -620,7 +614,7 @@ let o = class extends _ {
620
614
  render() {
621
615
  const e = this.renderHeader();
622
616
  if (this.isFixed) {
623
- const t = m({
617
+ const t = g({
624
618
  "pkt-header-service-spacer": !0,
625
619
  "pkt-header-service-spacer--compact": this.compact,
626
620
  "pkt-header-service-spacer--has-user": !!this.user,
@@ -636,102 +630,108 @@ let o = class extends _ {
636
630
  return e;
637
631
  }
638
632
  };
639
- a([
633
+ r([
640
634
  s({ type: String, attribute: "service-name" })
641
635
  ], o.prototype, "serviceName", 2);
642
- a([
636
+ r([
643
637
  s({ type: String, attribute: "service-link" })
644
638
  ], o.prototype, "serviceLink", 2);
645
- a([
639
+ r([
646
640
  s({ type: String, attribute: "logo-link" })
647
641
  ], o.prototype, "logoLink", 2);
648
- a([
642
+ r([
649
643
  s({ type: String, attribute: "search-placeholder" })
650
644
  ], o.prototype, "searchPlaceholder", 2);
651
- a([
645
+ r([
652
646
  s({ type: String, attribute: "search-value" })
653
647
  ], o.prototype, "searchValue", 2);
654
- a([
648
+ r([
655
649
  s({ type: Number, attribute: "mobile-breakpoint" })
656
650
  ], o.prototype, "mobileBreakpoint", 2);
657
- a([
651
+ r([
658
652
  s({ type: Number, attribute: "tablet-breakpoint" })
659
653
  ], o.prototype, "tabletBreakpoint", 2);
660
- a([
654
+ r([
661
655
  s({ type: String, attribute: "opened-menu" })
662
656
  ], o.prototype, "openedMenu", 2);
663
- a([
657
+ r([
664
658
  s({ type: String, attribute: "log-out-button-placement" })
665
659
  ], o.prototype, "logOutButtonPlacement", 2);
666
- a([
660
+ r([
667
661
  s({ type: String })
668
662
  ], o.prototype, "position", 2);
669
- a([
663
+ r([
670
664
  s({ type: String, attribute: "scroll-behavior" })
671
665
  ], o.prototype, "scrollBehavior", 2);
672
- a([
666
+ r([
667
+ s({ type: String, attribute: "slot-menu-variant" })
668
+ ], o.prototype, "slotMenuVariant", 2);
669
+ r([
670
+ s({ type: String, attribute: "slot-menu-text" })
671
+ ], o.prototype, "slotMenuText", 2);
672
+ r([
673
673
  s({ type: Boolean, attribute: "hide-logo", converter: d })
674
674
  ], o.prototype, "hideLogo", 2);
675
- a([
675
+ r([
676
676
  s({ type: Boolean, converter: d })
677
677
  ], o.prototype, "compact", 2);
678
- a([
678
+ r([
679
679
  s({ type: Boolean, attribute: "show-search", converter: d })
680
680
  ], o.prototype, "showSearch", 2);
681
- a([
681
+ r([
682
682
  s({
683
683
  type: Boolean,
684
684
  attribute: "can-change-representation",
685
685
  converter: d
686
686
  })
687
687
  ], o.prototype, "canChangeRepresentation", 2);
688
- a([
688
+ r([
689
689
  s({ type: Boolean, attribute: "has-log-out", converter: d })
690
690
  ], o.prototype, "hasLogOut", 2);
691
- a([
691
+ r([
692
692
  s({ type: Object })
693
693
  ], o.prototype, "user", 2);
694
- a([
694
+ r([
695
695
  s({ type: Array, attribute: "user-menu" })
696
696
  ], o.prototype, "userMenu", 2);
697
- a([
697
+ r([
698
698
  s({ type: Object })
699
699
  ], o.prototype, "representing", 2);
700
- a([
700
+ r([
701
701
  f()
702
702
  ], o.prototype, "isMobile", 2);
703
- a([
703
+ r([
704
704
  f()
705
705
  ], o.prototype, "isTablet", 2);
706
- a([
706
+ r([
707
707
  f()
708
708
  ], o.prototype, "openMenu", 2);
709
- a([
709
+ r([
710
710
  f()
711
711
  ], o.prototype, "isHidden", 2);
712
- a([
712
+ r([
713
713
  f()
714
714
  ], o.prototype, "componentWidth", 2);
715
- a([
715
+ r([
716
716
  f()
717
717
  ], o.prototype, "hasSlotContent", 2);
718
- a([
718
+ r([
719
719
  f()
720
720
  ], o.prototype, "alignSlotRight", 2);
721
- a([
721
+ r([
722
722
  f()
723
723
  ], o.prototype, "alignSearchRight", 2);
724
- o = a([
724
+ o = r([
725
725
  M("pkt-header-service")
726
726
  ], o);
727
- var P = Object.defineProperty, N = Object.getOwnPropertyDescriptor, u = (e, t, i, l) => {
728
- for (var r = l > 1 ? void 0 : l ? N(t, i) : t, p = e.length - 1, g; p >= 0; p--)
729
- (g = e[p]) && (r = (l ? g(t, i, r) : g(r)) || r);
730
- return l && r && P(t, i, r), r;
727
+ var x = Object.defineProperty, N = Object.getOwnPropertyDescriptor, h = (e, t, i, c) => {
728
+ for (var a = c > 1 ? void 0 : c ? N(t, i) : t, p = e.length - 1, m; p >= 0; p--)
729
+ (m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
730
+ return c && a && x(t, i, a), a;
731
731
  };
732
- let h = class extends _ {
732
+ let l = class extends _ {
733
733
  constructor() {
734
- super(), this.defaultSlot = k(), 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.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.slotController = new S(this, this.defaultSlot);
734
+ super(), this.defaultSlot = v(), 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.slotController = new S(this, this.defaultSlot);
735
735
  }
736
736
  firstUpdated(e) {
737
737
  super.firstUpdated(e), this.emitDeprecationWarnings();
@@ -760,6 +760,8 @@ let h = class extends _ {
760
760
  log-out-button-placement=${this.logOutButtonPlacement}
761
761
  position=${this.position}
762
762
  scroll-behavior=${this.scrollBehavior}
763
+ slot-menu-variant=${this.slotMenuVariant}
764
+ slot-menu-text=${this.slotMenuText}
763
765
  .hideLogo=${this.hideLogo}
764
766
  .compact=${this.compact}
765
767
  .showSearch=${this.showSearch}
@@ -769,84 +771,90 @@ let h = class extends _ {
769
771
  .userMenu=${this.effectiveUserMenu}
770
772
  .representing=${this.representing}
771
773
  >
772
- <div class="pkt-contents" ${v(this.defaultSlot)}></div>
774
+ <div class="pkt-contents" ${k(this.defaultSlot)}></div>
773
775
  </pkt-header-service>
774
776
  `;
775
777
  }
776
778
  };
777
- u([
779
+ h([
778
780
  s({ type: String, attribute: "service-name" })
779
- ], h.prototype, "serviceName", 2);
780
- u([
781
+ ], l.prototype, "serviceName", 2);
782
+ h([
781
783
  s({ type: String, attribute: "service-link" })
782
- ], h.prototype, "serviceLink", 2);
783
- u([
784
+ ], l.prototype, "serviceLink", 2);
785
+ h([
784
786
  s({ type: String, attribute: "logo-link" })
785
- ], h.prototype, "logoLink", 2);
786
- u([
787
+ ], l.prototype, "logoLink", 2);
788
+ h([
787
789
  s({ type: String, attribute: "search-placeholder" })
788
- ], h.prototype, "searchPlaceholder", 2);
789
- u([
790
+ ], l.prototype, "searchPlaceholder", 2);
791
+ h([
790
792
  s({ type: String, attribute: "search-value" })
791
- ], h.prototype, "searchValue", 2);
792
- u([
793
+ ], l.prototype, "searchValue", 2);
794
+ h([
793
795
  s({ type: Number, attribute: "mobile-breakpoint" })
794
- ], h.prototype, "mobileBreakpoint", 2);
795
- u([
796
+ ], l.prototype, "mobileBreakpoint", 2);
797
+ h([
796
798
  s({ type: Number, attribute: "tablet-breakpoint" })
797
- ], h.prototype, "tabletBreakpoint", 2);
798
- u([
799
+ ], l.prototype, "tabletBreakpoint", 2);
800
+ h([
799
801
  s({ type: String, attribute: "opened-menu" })
800
- ], h.prototype, "openedMenu", 2);
801
- u([
802
+ ], l.prototype, "openedMenu", 2);
803
+ h([
802
804
  s({ type: String, attribute: "log-out-button-placement" })
803
- ], h.prototype, "logOutButtonPlacement", 2);
804
- u([
805
+ ], l.prototype, "logOutButtonPlacement", 2);
806
+ h([
805
807
  s({ type: String })
806
- ], h.prototype, "position", 2);
807
- u([
808
+ ], l.prototype, "position", 2);
809
+ h([
808
810
  s({ type: String, attribute: "scroll-behavior" })
809
- ], h.prototype, "scrollBehavior", 2);
810
- u([
811
+ ], l.prototype, "scrollBehavior", 2);
812
+ h([
813
+ s({ type: String, attribute: "slot-menu-variant" })
814
+ ], l.prototype, "slotMenuVariant", 2);
815
+ h([
816
+ s({ type: String, attribute: "slot-menu-text" })
817
+ ], l.prototype, "slotMenuText", 2);
818
+ h([
811
819
  s({ type: Boolean, attribute: "hide-logo", converter: d })
812
- ], h.prototype, "hideLogo", 2);
813
- u([
820
+ ], l.prototype, "hideLogo", 2);
821
+ h([
814
822
  s({ type: Boolean, converter: d })
815
- ], h.prototype, "compact", 2);
816
- u([
823
+ ], l.prototype, "compact", 2);
824
+ h([
817
825
  s({ type: Boolean, attribute: "show-search", converter: d })
818
- ], h.prototype, "showSearch", 2);
819
- u([
826
+ ], l.prototype, "showSearch", 2);
827
+ h([
820
828
  s({
821
829
  type: Boolean,
822
830
  attribute: "can-change-representation",
823
831
  converter: d
824
832
  })
825
- ], h.prototype, "canChangeRepresentation", 2);
826
- u([
833
+ ], l.prototype, "canChangeRepresentation", 2);
834
+ h([
827
835
  s({ type: Boolean, attribute: "has-log-out", converter: d })
828
- ], h.prototype, "hasLogOut", 2);
829
- u([
836
+ ], l.prototype, "hasLogOut", 2);
837
+ h([
830
838
  s({ type: Object })
831
- ], h.prototype, "user", 2);
832
- u([
839
+ ], l.prototype, "user", 2);
840
+ h([
833
841
  s({ type: Array, attribute: "user-menu" })
834
- ], h.prototype, "userMenu", 2);
835
- u([
842
+ ], l.prototype, "userMenu", 2);
843
+ h([
836
844
  s({ type: Object })
837
- ], h.prototype, "representing", 2);
838
- u([
845
+ ], l.prototype, "representing", 2);
846
+ h([
839
847
  s({ type: Array, attribute: "user-menu-footer" })
840
- ], h.prototype, "userMenuFooter", 2);
841
- u([
848
+ ], l.prototype, "userMenuFooter", 2);
849
+ h([
842
850
  s({ type: Array, attribute: "user-options" })
843
- ], h.prototype, "userOptions", 2);
844
- h = u([
851
+ ], l.prototype, "userOptions", 2);
852
+ l = h([
845
853
  M("pkt-header")
846
- ], h);
854
+ ], l);
847
855
  export {
848
- h as PktHeader,
856
+ l as PktHeader,
849
857
  o as PktHeaderService,
850
858
  b as PktHeaderUserMenu,
851
- L as formatLastLoggedIn
859
+ w as formatLastLoggedIn
852
860
  };