@oslokommune/punkt-elements 14.2.0 → 14.4.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 +34 -0
  2. package/dist/{checkbox-CnhA52o_.js → checkbox-DfVUNTjH.js} +1 -1
  3. package/dist/{checkbox-C0TPnShf.cjs → checkbox-uxeHrTLH.cjs} +1 -1
  4. package/dist/{combobox-C1xwAju5.cjs → combobox-CcyHcqdW.cjs} +13 -13
  5. package/dist/{combobox-Dcp_fHcL.js → combobox-MZsqmVL-.js} +45 -45
  6. package/dist/{datepicker-COIRRau0.cjs → datepicker-BeMs_vsm.cjs} +25 -25
  7. package/dist/{datepicker-Bjb9GK1E.js → datepicker-a2LvhbRb.js} +215 -234
  8. package/dist/index.d.ts +236 -34
  9. package/dist/input-element-CARcDzQB.js +840 -0
  10. package/dist/input-element-CiaV6jln.cjs +1 -0
  11. package/dist/pkt-checkbox.cjs +1 -1
  12. package/dist/pkt-checkbox.js +1 -1
  13. package/dist/pkt-combobox.cjs +1 -1
  14. package/dist/pkt-combobox.js +1 -1
  15. package/dist/pkt-datepicker.cjs +1 -1
  16. package/dist/pkt-datepicker.js +2 -2
  17. package/dist/pkt-header.cjs +9 -7
  18. package/dist/pkt-header.js +137 -123
  19. package/dist/pkt-index.cjs +1 -1
  20. package/dist/pkt-index.js +7 -7
  21. package/dist/pkt-options-controller-DjBCEHU4.cjs +1 -0
  22. package/dist/{pkt-options-controller-CZO1nxZ8.js → pkt-options-controller-zn5cmMvL.js} +3 -3
  23. package/dist/pkt-radiobutton.cjs +1 -1
  24. package/dist/pkt-radiobutton.js +1 -1
  25. package/dist/pkt-select.cjs +1 -1
  26. package/dist/pkt-select.js +1 -1
  27. package/dist/pkt-textarea.cjs +1 -1
  28. package/dist/pkt-textarea.js +1 -1
  29. package/dist/pkt-textinput.cjs +1 -1
  30. package/dist/pkt-textinput.js +1 -1
  31. package/dist/{radiobutton-Caq8-GhM.js → radiobutton-BmgdSpYf.js} +1 -1
  32. package/dist/{radiobutton-BkqaqO5E.cjs → radiobutton-DVe09YxP.cjs} +1 -1
  33. package/dist/select-7KFOnLln.cjs +49 -0
  34. package/dist/select-CKqz-JKZ.js +228 -0
  35. package/dist/{textarea-a6T4aJJU.js → textarea-Bmrv_vve.js} +1 -1
  36. package/dist/{textarea-DyUy8u7X.cjs → textarea-VBUXPS1O.cjs} +1 -1
  37. package/dist/{textinput-IN3b0nSH.cjs → textinput-BkYKotc1.cjs} +1 -1
  38. package/dist/{textinput-DIuM70dd.js → textinput-Lp1crOmj.js} +1 -1
  39. package/package.json +2 -2
  40. package/src/components/checkbox/checkbox.ts +1 -1
  41. package/src/components/combobox/combobox.ts +2 -2
  42. package/src/components/datepicker/datepicker-utils.test.ts +0 -25
  43. package/src/components/datepicker/datepicker-utils.ts +0 -28
  44. package/src/components/datepicker/datepicker.ts +0 -6
  45. package/src/components/header/header-service.ts +12 -8
  46. package/src/components/header/header.ts +8 -2
  47. package/src/components/header/index.ts +4 -1
  48. package/src/components/header/types.ts +18 -22
  49. package/src/components/index.ts +4 -1
  50. package/src/components/radiobutton/radiobutton.ts +1 -1
  51. package/src/components/select/select.ts +12 -47
  52. package/src/components/textarea/textarea.ts +1 -1
  53. package/src/components/textinput/textinput.ts +1 -1
  54. package/dist/input-element-B8M8Nppd.js +0 -708
  55. package/dist/input-element-D697OAJo.cjs +0 -1
  56. package/dist/pkt-options-controller-CiuBG6Lt.cjs +0 -1
  57. package/dist/select-3dwlk22G.cjs +0 -49
  58. package/dist/select-_C-yztI0.js +0 -173
@@ -1,4 +1,4 @@
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
4
  import { e as v, n as k } from "./ref-Xa5dbh--.js";
@@ -8,7 +8,7 @@ import { e as g } from "./class-map-wy7PUk0P.js";
8
8
  import "./button-CjXih_Nx.js";
9
9
  import "./icon-BB7e5iQN.js";
10
10
  import "./link-BboUBUcg.js";
11
- import "./textinput-DIuM70dd.js";
11
+ import "./textinput-Lp1crOmj.js";
12
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) => {
13
13
  if (!e) return;
14
14
  const t = typeof e == "string" ? new Date(e) : e;
@@ -21,10 +21,10 @@ const C = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.ico
21
21
  minute: "2-digit"
22
22
  });
23
23
  };
24
- var O = Object.defineProperty, R = Object.getOwnPropertyDescriptor, y = (e, t, i, l) => {
25
- for (var r = l > 1 ? void 0 : l ? R(t, i) : t, p = e.length - 1, m; p >= 0; p--)
26
- (m = e[p]) && (r = (l ? m(t, i, r) : m(r)) || r);
27
- return l && r && O(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;
28
28
  };
29
29
  let b = class extends _ {
30
30
  constructor() {
@@ -50,7 +50,7 @@ let b = class extends _ {
50
50
  "onClick" in e && typeof e.onClick == "function" && e.onClick();
51
51
  }
52
52
  renderLinkOrButton(e, t) {
53
- const i = "href" in e, l = g({
53
+ const i = "href" in e, c = g({
54
54
  "pkt-user-menu__link": !0,
55
55
  "pkt-link-button": !i,
56
56
  "pkt-link": !i,
@@ -59,7 +59,7 @@ let b = class extends _ {
59
59
  });
60
60
  return i ? n`
61
61
  <pkt-link
62
- icon-name=${e.iconName || c}
62
+ icon-name=${e.iconName || u}
63
63
  href=${e.href}
64
64
  aria-hidden="true"
65
65
  class="pkt-user-menu__link ${t || ""}"
@@ -67,12 +67,12 @@ let b = class extends _ {
67
67
  ${e.title}
68
68
  </pkt-link>
69
69
  ` : n`
70
- <button class=${l} type="button" @click=${() => this.handleMenuItemClick(e)}>
70
+ <button class=${c} 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>` : c}
75
+ ></pkt-icon>` : u}
76
76
  ${e.title}
77
77
  </button>
78
78
  `;
@@ -103,14 +103,14 @@ let b = class extends _ {
103
103
  <div class="pkt-user-menu__last-logged-in">
104
104
  Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
105
105
  </div>
106
- ` : c}
106
+ ` : u}
107
107
  </li>
108
- ` : c}
108
+ ` : u}
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
- ` : c}
113
+ ` : u}
114
114
 
115
115
  <!-- Representing section -->
116
116
  ${this.representing ? n`
@@ -119,7 +119,7 @@ let b = class extends _ {
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>` : c}
122
+ </div>` : u}
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 b = class extends _ {
130
130
  })}
131
131
  </li>
132
132
  </ul>
133
- ` : c}
133
+ ` : u}
134
134
  </li>
135
- ` : c}
135
+ ` : u}
136
136
 
137
137
  <!-- Change representation without representing object -->
138
138
  ${!this.representing && this.canChangeRepresentation ? n`
@@ -147,7 +147,7 @@ let b = class extends _ {
147
147
  </li>
148
148
  </ul>
149
149
  </li>
150
- ` : c}
150
+ ` : u}
151
151
 
152
152
  <!-- Logout -->
153
153
  ${this.logoutOnClick ? n`
@@ -158,7 +158,7 @@ let b = class extends _ {
158
158
  onClick: () => this.handleLogout()
159
159
  })}
160
160
  </li>
161
- ` : c}
161
+ ` : u}
162
162
  </ul>
163
163
  </nav>
164
164
  `;
@@ -189,15 +189,15 @@ y([
189
189
  b = y([
190
190
  M("pkt-header-user-menu")
191
191
  ], b);
192
- var B = Object.defineProperty, E = Object.getOwnPropertyDescriptor, a = (e, t, i, l) => {
193
- for (var r = l > 1 ? void 0 : l ? E(t, i) : t, p = e.length - 1, m; p >= 0; p--)
194
- (m = e[p]) && (r = (l ? m(t, i, r) : m(r)) || r);
195
- return l && r && B(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;
196
196
  };
197
197
  const P = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
198
198
  let o = class extends _ {
199
199
  constructor() {
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.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 = () => {
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 = () => {
201
201
  if (!this.shouldHideOnScroll) return;
202
202
  const e = window.pageYOffset || document.documentElement.scrollTop;
203
203
  e < 0 || Math.abs(e - this.lastScrollPosition) < 60 || (this.isHidden = e > this.lastScrollPosition, this.lastScrollPosition = e);
@@ -206,22 +206,22 @@ let o = class extends _ {
206
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");
207
207
  }, this.handleFocusOut = (e, t) => {
208
208
  const i = e.relatedTarget;
209
- let l;
209
+ let c;
210
210
  switch (t) {
211
211
  case "user":
212
- l = this.userContainerRef;
212
+ c = this.userContainerRef;
213
213
  break;
214
214
  case "slot":
215
- l = this.slotContainerRef;
215
+ c = this.slotContainerRef;
216
216
  break;
217
217
  case "search":
218
- l = this.searchContainerRef;
218
+ c = this.searchContainerRef;
219
219
  break;
220
220
  default:
221
221
  return;
222
222
  }
223
- const r = l.value;
224
- r && (!i || !r.contains(i)) && (this.openMenu = "none");
223
+ const a = c.value;
224
+ a && (!i || !a.contains(i)) && (this.openMenu = "none");
225
225
  }, this.handleEscapeKey = (e) => {
226
226
  e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.shouldRestoreFocus = !0, this.openMenu = "none");
227
227
  }, this.slotController = new S(this, this.defaultSlot);
@@ -283,7 +283,7 @@ let o = class extends _ {
283
283
  checkDropdownAlignment(e) {
284
284
  const t = e === "slot" ? this.slotContainerRef : this.searchContainerRef, i = e === "slot" ? this.slotContentRef : this.searchMenuRef;
285
285
  if (!t.value || !i.value || !this.isTablet || this.isMobile) return;
286
- 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;
287
287
  e === "slot" ? this.alignSlotRight = p : this.alignSearchRight = p;
288
288
  }
289
289
  handleMenuToggle(e) {
@@ -357,7 +357,7 @@ let o = class extends _ {
357
357
  return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
358
358
  }
359
359
  renderLogo() {
360
- if (this.hideLogo) return c;
360
+ if (this.hideLogo) return u;
361
361
  const e = n`
362
362
  <pkt-icon name="oslologo" aria-hidden="true" path=${P}></pkt-icon>
363
363
  `;
@@ -405,7 +405,7 @@ let o = class extends _ {
405
405
  <span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
406
406
  <span class="pkt-header-service__service-link">${this.serviceName}</span>
407
407
  </span>
408
- ` : c;
408
+ ` : u;
409
409
  }
410
410
  renderSlotContainer() {
411
411
  const e = g({
@@ -424,7 +424,7 @@ let o = class extends _ {
424
424
  ${this.isTablet && this.hasSlotContent ? n`
425
425
  <pkt-button
426
426
  skin="secondary"
427
- variant="icon-only"
427
+ variant=${this.slotMenuVariant}
428
428
  iconName="menu"
429
429
  size=${this.isMobile ? "small" : "medium"}
430
430
  state=${this.openMenu === "slot" ? "active" : "normal"}
@@ -433,14 +433,14 @@ let o = class extends _ {
433
433
  aria-controls="mobile-slot-menu"
434
434
  aria-label="Åpne meny"
435
435
  >
436
- Meny
436
+ ${this.slotMenuText}
437
437
  </pkt-button>
438
- ` : c}
438
+ ` : u}
439
439
  <div
440
440
  class=${t}
441
441
  id="mobile-slot-menu"
442
- role=${this.isTablet ? "menu" : c}
443
- aria-label=${this.isTablet ? "Meny" : c}
442
+ role=${this.isTablet ? "menu" : u}
443
+ aria-label=${this.isTablet ? "Meny" : u}
444
444
  ${k(this.slotContentRef)}
445
445
  ${k(this.defaultSlot)}
446
446
  ></div>
@@ -448,7 +448,7 @@ let o = class extends _ {
448
448
  `;
449
449
  }
450
450
  renderSearch() {
451
- if (!this.showSearch) return c;
451
+ if (!this.showSearch) return u;
452
452
  if (this.isTablet) {
453
453
  const e = g({
454
454
  "pkt-header-service__search-container": !0,
@@ -494,7 +494,7 @@ let o = class extends _ {
494
494
  i.key === "Enter" && this.handleSearch(i.target.value);
495
495
  }}
496
496
  ></pkt-textinput>
497
- ` : c}
497
+ ` : u}
498
498
  </div>
499
499
  </div>
500
500
  `;
@@ -515,7 +515,7 @@ let o = class extends _ {
515
515
  }
516
516
  renderUserButton() {
517
517
  var t;
518
- if (!this.user) return c;
518
+ if (!this.user) return u;
519
519
  const e = g({
520
520
  "pkt-header-service__user-menu": this.isMobile === !1,
521
521
  "pkt-header-service__mobile-menu": this.isMobile === !0,
@@ -547,7 +547,7 @@ let o = class extends _ {
547
547
  <div class=${e}>
548
548
  <pkt-header-user-menu
549
549
  .user=${this.user}
550
- formatted-last-logged-in=${this.formattedLastLoggedIn || c}
550
+ formatted-last-logged-in=${this.formattedLastLoggedIn || u}
551
551
  .representing=${this.representing}
552
552
  .userMenu=${this.userMenu}
553
553
  ?can-change-representation=${this.canChangeRepresentation}
@@ -558,7 +558,7 @@ let o = class extends _ {
558
558
  @log-out=${this.handleLogout}
559
559
  ></pkt-header-user-menu>
560
560
  </div>
561
- ` : c}
561
+ ` : u}
562
562
  </div>
563
563
  `;
564
564
  }
@@ -591,7 +591,7 @@ let o = class extends _ {
591
591
  >
592
592
  Logg ut
593
593
  </pkt-button>
594
- ` : c}
594
+ ` : u}
595
595
  </div>
596
596
 
597
597
  <div class="pkt-header-service__user">
@@ -606,7 +606,7 @@ let o = class extends _ {
606
606
  >
607
607
  Logg ut
608
608
  </pkt-button>
609
- ` : c}
609
+ ` : u}
610
610
  </div>
611
611
  </header>
612
612
  `;
@@ -630,102 +630,108 @@ let o = class extends _ {
630
630
  return e;
631
631
  }
632
632
  };
633
- a([
633
+ r([
634
634
  s({ type: String, attribute: "service-name" })
635
635
  ], o.prototype, "serviceName", 2);
636
- a([
636
+ r([
637
637
  s({ type: String, attribute: "service-link" })
638
638
  ], o.prototype, "serviceLink", 2);
639
- a([
639
+ r([
640
640
  s({ type: String, attribute: "logo-link" })
641
641
  ], o.prototype, "logoLink", 2);
642
- a([
642
+ r([
643
643
  s({ type: String, attribute: "search-placeholder" })
644
644
  ], o.prototype, "searchPlaceholder", 2);
645
- a([
645
+ r([
646
646
  s({ type: String, attribute: "search-value" })
647
647
  ], o.prototype, "searchValue", 2);
648
- a([
648
+ r([
649
649
  s({ type: Number, attribute: "mobile-breakpoint" })
650
650
  ], o.prototype, "mobileBreakpoint", 2);
651
- a([
651
+ r([
652
652
  s({ type: Number, attribute: "tablet-breakpoint" })
653
653
  ], o.prototype, "tabletBreakpoint", 2);
654
- a([
654
+ r([
655
655
  s({ type: String, attribute: "opened-menu" })
656
656
  ], o.prototype, "openedMenu", 2);
657
- a([
657
+ r([
658
658
  s({ type: String, attribute: "log-out-button-placement" })
659
659
  ], o.prototype, "logOutButtonPlacement", 2);
660
- a([
660
+ r([
661
661
  s({ type: String })
662
662
  ], o.prototype, "position", 2);
663
- a([
663
+ r([
664
664
  s({ type: String, attribute: "scroll-behavior" })
665
665
  ], o.prototype, "scrollBehavior", 2);
666
- 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([
667
673
  s({ type: Boolean, attribute: "hide-logo", converter: d })
668
674
  ], o.prototype, "hideLogo", 2);
669
- a([
675
+ r([
670
676
  s({ type: Boolean, converter: d })
671
677
  ], o.prototype, "compact", 2);
672
- a([
678
+ r([
673
679
  s({ type: Boolean, attribute: "show-search", converter: d })
674
680
  ], o.prototype, "showSearch", 2);
675
- a([
681
+ r([
676
682
  s({
677
683
  type: Boolean,
678
684
  attribute: "can-change-representation",
679
685
  converter: d
680
686
  })
681
687
  ], o.prototype, "canChangeRepresentation", 2);
682
- a([
688
+ r([
683
689
  s({ type: Boolean, attribute: "has-log-out", converter: d })
684
690
  ], o.prototype, "hasLogOut", 2);
685
- a([
691
+ r([
686
692
  s({ type: Object })
687
693
  ], o.prototype, "user", 2);
688
- a([
694
+ r([
689
695
  s({ type: Array, attribute: "user-menu" })
690
696
  ], o.prototype, "userMenu", 2);
691
- a([
697
+ r([
692
698
  s({ type: Object })
693
699
  ], o.prototype, "representing", 2);
694
- a([
700
+ r([
695
701
  f()
696
702
  ], o.prototype, "isMobile", 2);
697
- a([
703
+ r([
698
704
  f()
699
705
  ], o.prototype, "isTablet", 2);
700
- a([
706
+ r([
701
707
  f()
702
708
  ], o.prototype, "openMenu", 2);
703
- a([
709
+ r([
704
710
  f()
705
711
  ], o.prototype, "isHidden", 2);
706
- a([
712
+ r([
707
713
  f()
708
714
  ], o.prototype, "componentWidth", 2);
709
- a([
715
+ r([
710
716
  f()
711
717
  ], o.prototype, "hasSlotContent", 2);
712
- a([
718
+ r([
713
719
  f()
714
720
  ], o.prototype, "alignSlotRight", 2);
715
- a([
721
+ r([
716
722
  f()
717
723
  ], o.prototype, "alignSearchRight", 2);
718
- o = a([
724
+ o = r([
719
725
  M("pkt-header-service")
720
726
  ], o);
721
- var N = Object.defineProperty, I = Object.getOwnPropertyDescriptor, u = (e, t, i, l) => {
722
- for (var r = l > 1 ? void 0 : l ? I(t, i) : t, p = e.length - 1, m; p >= 0; p--)
723
- (m = e[p]) && (r = (l ? m(t, i, r) : m(r)) || r);
724
- return l && r && N(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;
725
731
  };
726
- let h = class extends _ {
732
+ let l = class extends _ {
727
733
  constructor() {
728
- 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.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);
729
735
  }
730
736
  firstUpdated(e) {
731
737
  super.firstUpdated(e), this.emitDeprecationWarnings();
@@ -754,6 +760,8 @@ let h = class extends _ {
754
760
  log-out-button-placement=${this.logOutButtonPlacement}
755
761
  position=${this.position}
756
762
  scroll-behavior=${this.scrollBehavior}
763
+ slot-menu-variant=${this.slotMenuVariant}
764
+ slot-menu-text=${this.slotMenuText}
757
765
  .hideLogo=${this.hideLogo}
758
766
  .compact=${this.compact}
759
767
  .showSearch=${this.showSearch}
@@ -768,78 +776,84 @@ let h = class extends _ {
768
776
  `;
769
777
  }
770
778
  };
771
- u([
779
+ h([
772
780
  s({ type: String, attribute: "service-name" })
773
- ], h.prototype, "serviceName", 2);
774
- u([
781
+ ], l.prototype, "serviceName", 2);
782
+ h([
775
783
  s({ type: String, attribute: "service-link" })
776
- ], h.prototype, "serviceLink", 2);
777
- u([
784
+ ], l.prototype, "serviceLink", 2);
785
+ h([
778
786
  s({ type: String, attribute: "logo-link" })
779
- ], h.prototype, "logoLink", 2);
780
- u([
787
+ ], l.prototype, "logoLink", 2);
788
+ h([
781
789
  s({ type: String, attribute: "search-placeholder" })
782
- ], h.prototype, "searchPlaceholder", 2);
783
- u([
790
+ ], l.prototype, "searchPlaceholder", 2);
791
+ h([
784
792
  s({ type: String, attribute: "search-value" })
785
- ], h.prototype, "searchValue", 2);
786
- u([
793
+ ], l.prototype, "searchValue", 2);
794
+ h([
787
795
  s({ type: Number, attribute: "mobile-breakpoint" })
788
- ], h.prototype, "mobileBreakpoint", 2);
789
- u([
796
+ ], l.prototype, "mobileBreakpoint", 2);
797
+ h([
790
798
  s({ type: Number, attribute: "tablet-breakpoint" })
791
- ], h.prototype, "tabletBreakpoint", 2);
792
- u([
799
+ ], l.prototype, "tabletBreakpoint", 2);
800
+ h([
793
801
  s({ type: String, attribute: "opened-menu" })
794
- ], h.prototype, "openedMenu", 2);
795
- u([
802
+ ], l.prototype, "openedMenu", 2);
803
+ h([
796
804
  s({ type: String, attribute: "log-out-button-placement" })
797
- ], h.prototype, "logOutButtonPlacement", 2);
798
- u([
805
+ ], l.prototype, "logOutButtonPlacement", 2);
806
+ h([
799
807
  s({ type: String })
800
- ], h.prototype, "position", 2);
801
- u([
808
+ ], l.prototype, "position", 2);
809
+ h([
802
810
  s({ type: String, attribute: "scroll-behavior" })
803
- ], h.prototype, "scrollBehavior", 2);
804
- 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([
805
819
  s({ type: Boolean, attribute: "hide-logo", converter: d })
806
- ], h.prototype, "hideLogo", 2);
807
- u([
820
+ ], l.prototype, "hideLogo", 2);
821
+ h([
808
822
  s({ type: Boolean, converter: d })
809
- ], h.prototype, "compact", 2);
810
- u([
823
+ ], l.prototype, "compact", 2);
824
+ h([
811
825
  s({ type: Boolean, attribute: "show-search", converter: d })
812
- ], h.prototype, "showSearch", 2);
813
- u([
826
+ ], l.prototype, "showSearch", 2);
827
+ h([
814
828
  s({
815
829
  type: Boolean,
816
830
  attribute: "can-change-representation",
817
831
  converter: d
818
832
  })
819
- ], h.prototype, "canChangeRepresentation", 2);
820
- u([
833
+ ], l.prototype, "canChangeRepresentation", 2);
834
+ h([
821
835
  s({ type: Boolean, attribute: "has-log-out", converter: d })
822
- ], h.prototype, "hasLogOut", 2);
823
- u([
836
+ ], l.prototype, "hasLogOut", 2);
837
+ h([
824
838
  s({ type: Object })
825
- ], h.prototype, "user", 2);
826
- u([
839
+ ], l.prototype, "user", 2);
840
+ h([
827
841
  s({ type: Array, attribute: "user-menu" })
828
- ], h.prototype, "userMenu", 2);
829
- u([
842
+ ], l.prototype, "userMenu", 2);
843
+ h([
830
844
  s({ type: Object })
831
- ], h.prototype, "representing", 2);
832
- u([
845
+ ], l.prototype, "representing", 2);
846
+ h([
833
847
  s({ type: Array, attribute: "user-menu-footer" })
834
- ], h.prototype, "userMenuFooter", 2);
835
- u([
848
+ ], l.prototype, "userMenuFooter", 2);
849
+ h([
836
850
  s({ type: Array, attribute: "user-options" })
837
- ], h.prototype, "userOptions", 2);
838
- h = u([
851
+ ], l.prototype, "userOptions", 2);
852
+ l = h([
839
853
  M("pkt-header")
840
- ], h);
854
+ ], l);
841
855
  export {
842
- h as PktHeader,
856
+ l as PktHeader,
843
857
  o as PktHeaderService,
844
858
  b as PktHeaderUserMenu,
845
859
  w as formatLastLoggedIn
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./alert-SvqEDHuW.cjs"),P=require("./accordionitem-DCZrHVNR.cjs"),g=require("./backlink-BrIIpgJ7.cjs"),h=require("./button-DaM4jvhJ.cjs"),k=require("./calendar-ZzLAjDpv.cjs"),f=require("./card-C1gRTfXb.cjs"),y=require("./combobox-C1xwAju5.cjs"),O=require("./consent-Daj-Xa7w.cjs"),j=require("./checkbox-C0TPnShf.cjs"),t=require("./element-CJ_QKaki.cjs"),q=require("./pkt-slot-controller-BzddBp7z.cjs"),a=require("./ref-BFa5Utho.cjs"),x=require("./class-map-C_erArZz.cjs"),d=require("./datepicker-COIRRau0.cjs"),l=require("./pkt-header.cjs"),C=require("./helptext-hlcc584n.cjs"),v=require("./heading-Dv_cH6N1.cjs"),S=require("./icon-MRx-m0Or.cjs"),T=require("./input-wrapper-CtBiAb04.cjs"),$=require("./link-Dw39h-YN.cjs"),H=require("./linkcard-DUA3kGGd.cjs"),L=require("./loader-DjGxT7C3.cjs"),_=require("./messagebox-ChIKVTO_.cjs"),I=require("./modal-B4qq0VFB.cjs"),A=require("./progressbar-CmAQ-DVW.cjs"),p=require("./radiobutton-BkqaqO5E.cjs"),B=require("./tag-B02fKJ66.cjs"),b=require("./tabitem-D5zyipN1.cjs"),M=require("./textarea-DyUy8u7X.cjs"),D=require("./textinput-IN3b0nSH.cjs"),R=require("./select-3dwlk22G.cjs");var w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,o=(s,e,r,i)=>{for(var n=i>1?void 0:i?E(e,r):e,u=s.length-1,c;u>=0;u--)(c=s[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&w(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=a.e(),this.namedSlot=a.e(),this.slotController=new q.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./alert-SvqEDHuW.cjs"),P=require("./accordionitem-DCZrHVNR.cjs"),g=require("./backlink-BrIIpgJ7.cjs"),h=require("./button-DaM4jvhJ.cjs"),k=require("./calendar-ZzLAjDpv.cjs"),f=require("./card-C1gRTfXb.cjs"),y=require("./combobox-CcyHcqdW.cjs"),O=require("./consent-Daj-Xa7w.cjs"),j=require("./checkbox-uxeHrTLH.cjs"),t=require("./element-CJ_QKaki.cjs"),q=require("./pkt-slot-controller-BzddBp7z.cjs"),a=require("./ref-BFa5Utho.cjs"),x=require("./class-map-C_erArZz.cjs"),d=require("./datepicker-BeMs_vsm.cjs"),l=require("./pkt-header.cjs"),C=require("./helptext-hlcc584n.cjs"),v=require("./heading-Dv_cH6N1.cjs"),S=require("./icon-MRx-m0Or.cjs"),T=require("./input-wrapper-CtBiAb04.cjs"),$=require("./link-Dw39h-YN.cjs"),H=require("./linkcard-DUA3kGGd.cjs"),L=require("./loader-DjGxT7C3.cjs"),_=require("./messagebox-ChIKVTO_.cjs"),I=require("./modal-B4qq0VFB.cjs"),A=require("./progressbar-CmAQ-DVW.cjs"),p=require("./radiobutton-DVe09YxP.cjs"),B=require("./tag-B02fKJ66.cjs"),b=require("./tabitem-D5zyipN1.cjs"),M=require("./textarea-VBUXPS1O.cjs"),D=require("./textinput-BkYKotc1.cjs"),R=require("./select-7KFOnLln.cjs");var w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,o=(s,e,r,i)=>{for(var n=i>1?void 0:i?E(e,r):e,u=s.length-1,c;u>=0;u--)(c=s[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&w(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=a.e(),this.namedSlot=a.e(),this.slotController=new q.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${x.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -5,14 +5,14 @@ import { P as E } from "./button-CjXih_Nx.js";
5
5
  import { c as d } from "./calendar-CvfMj3fA.js";
6
6
  import { P as R } from "./calendar-CvfMj3fA.js";
7
7
  import { P as M } from "./card-CO3D8wQE.js";
8
- import { P as U } from "./combobox-Dcp_fHcL.js";
8
+ import { P as U } from "./combobox-MZsqmVL-.js";
9
9
  import { P as N } from "./consent-BO3Ga8N4.js";
10
- import { P as q } from "./checkbox-CnhA52o_.js";
10
+ import { P as q } from "./checkbox-DfVUNTjH.js";
11
11
  import { P as f, t as h, x as l, n, a as c } from "./element-CRDRygXu.js";
12
12
  import { P as x } from "./pkt-slot-controller-BPGj-LC5.js";
13
13
  import { e as m, n as k } from "./ref-Xa5dbh--.js";
14
14
  import { e as u } from "./class-map-wy7PUk0P.js";
15
- import { P as F, a as J } from "./datepicker-Bjb9GK1E.js";
15
+ import { P as F, a as J } from "./datepicker-a2LvhbRb.js";
16
16
  import { PktHeader as V, PktHeaderService as X, PktHeaderUserMenu as Y } from "./pkt-header.js";
17
17
  import { P as tt } from "./helptext-Bn17Picx.js";
18
18
  import { P as rt } from "./heading-BUdy170t.js";
@@ -24,12 +24,12 @@ import { P as kt } from "./loader-DIum_s_D.js";
24
24
  import { P as ft } from "./messagebox-aPlConlJ.js";
25
25
  import { P as ct } from "./modal-jAUtM-NP.js";
26
26
  import { P as ut } from "./progressbar-CVt73-JQ.js";
27
- import { P as vt, P as bt } from "./radiobutton-Caq8-GhM.js";
27
+ import { P as vt, P as bt } from "./radiobutton-BmgdSpYf.js";
28
28
  import { P as Ct } from "./tag-CES41g0D.js";
29
29
  import { a as yt, P as _t } from "./tabitem-NV2fzs_-.js";
30
- import { P as Tt } from "./textarea-a6T4aJJU.js";
31
- import { P as At } from "./textinput-DIuM70dd.js";
32
- import { P as wt } from "./select-_C-yztI0.js";
30
+ import { P as Tt } from "./textarea-Bmrv_vve.js";
31
+ import { P as At } from "./textinput-Lp1crOmj.js";
32
+ import { P as wt } from "./select-CKqz-JKZ.js";
33
33
  var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, e, i, a) => {
34
34
  for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, P; p >= 0; p--)
35
35
  (P = t[p]) && (r = (a ? P(e, i, r) : P(r)) || r);
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./pkt-slot-controller-BzddBp7z.cjs");class a{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.requestUpdate()}handleMutations(t){let e=!1;t.forEach(s=>{s.type==="childList"&&(s.addedNodes.forEach(i=>{r.isOptionElement(i)&&(this.addNode(i),e=!0)}),s.removedNodes.forEach(i=>{r.isOptionElement(i)&&(this.nodes=this.nodes.filter(h=>h!==i),e=!0)})),s.type==="attributes"&&r.isOptionElement(s.target)&&(this.addNode(s.target),e=!0)}),e&&this.createOptions()}}exports.PktOptionsSlotController=a;
@@ -6,7 +6,7 @@ class o {
6
6
  hostConnected() {
7
7
  Array.from(this.host.childNodes).forEach((t) => {
8
8
  (t.nodeName === "OPTION" || t.nodeName === "DATA") && this.addNode(t);
9
- }), this.observer.observe(this.host, { childList: !0, subtree: !1, attributes: !0 });
9
+ }), this.createOptions(), this.observer.observe(this.host, { childList: !0, subtree: !1, attributes: !0 });
10
10
  }
11
11
  hostDisconnected() {
12
12
  this.observer.disconnect();
@@ -21,7 +21,7 @@ class o {
21
21
  selected: t.hasAttribute("selected"),
22
22
  disabled: t.hasAttribute("disabled"),
23
23
  hidden: t.hasAttribute("data-hidden")
24
- })), this.host.setAttribute("options", JSON.stringify(this.options));
24
+ })), this.host.requestUpdate();
25
25
  }
26
26
  handleMutations(t) {
27
27
  let e = !1;
@@ -29,7 +29,7 @@ class o {
29
29
  s.type === "childList" && (s.addedNodes.forEach((i) => {
30
30
  r(i) && (this.addNode(i), e = !0);
31
31
  }), s.removedNodes.forEach((i) => {
32
- r(i) && (this.nodes = this.nodes.filter((h) => h !== i), e = !0);
32
+ r(i) && (this.nodes = this.nodes.filter((a) => a !== i), e = !0);
33
33
  })), s.type === "attributes" && r(s.target) && (this.addNode(s.target), e = !0);
34
34
  }), e && this.createOptions();
35
35
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./radiobutton-BkqaqO5E.cjs"),e=t.PktRadioButton;Object.defineProperty(exports,"PktRadioButton",{enumerable:!0,get:()=>t.PktRadioButton});exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./radiobutton-DVe09YxP.cjs"),e=t.PktRadioButton;Object.defineProperty(exports,"PktRadioButton",{enumerable:!0,get:()=>t.PktRadioButton});exports.default=e;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./radiobutton-Caq8-GhM.js";
1
+ import { P as t } from "./radiobutton-BmgdSpYf.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktRadioButton,