@oslokommune/punkt-elements 12.34.2 → 12.34.4

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 (144) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/accordion.d.ts +0 -46
  3. package/dist/{accordionitem-Cg-LZy7n.js → accordionitem-Db-3WiJS.js} +3 -3
  4. package/dist/{accordionitem-DDnUkCJP.cjs → accordionitem-cvsySqgK.cjs} +1 -1
  5. package/dist/{alert-BOvwM-m4.js → alert-B5lVS6Qs.js} +5 -5
  6. package/dist/{alert-B3HuK30R.cjs → alert-DWIElKEZ.cjs} +1 -1
  7. package/dist/alert.d.ts +0 -46
  8. package/dist/{backlink-1p-ADrG8.cjs → backlink-HHM21crL.cjs} +1 -1
  9. package/dist/{backlink-fjBQGFYt.js → backlink-hvyJmwrO.js} +2 -2
  10. package/dist/backlink.d.ts +0 -46
  11. package/dist/{button-Cl6psvlo.js → button-B6uRE7uT.js} +2 -2
  12. package/dist/{button-5tOMyPEx.cjs → button-BNdVIhUp.cjs} +1 -1
  13. package/dist/button.d.ts +0 -46
  14. package/dist/{calendar-Bi49Yxom.js → calendar-mTDcujoj.js} +4 -4
  15. package/dist/{calendar-BU7DqDLG.cjs → calendar-oX4HJomV.cjs} +1 -1
  16. package/dist/calendar.d.ts +0 -46
  17. package/dist/{card-Dphjc_iO.js → card-B5zTEmH1.js} +6 -6
  18. package/dist/{card-a_Cs18EQ.cjs → card-BDcr3PII.cjs} +1 -1
  19. package/dist/card.d.ts +0 -46
  20. package/dist/{checkbox-bsBqWqcn.cjs → checkbox-CqatE-eX.cjs} +1 -1
  21. package/dist/{checkbox-nAnAn0E5.js → checkbox-CyYfA2fu.js} +4 -4
  22. package/dist/checkbox.d.ts +0 -46
  23. package/dist/{class-map-BjTUtIEl.cjs → class-map-DCyaICmy.cjs} +1 -1
  24. package/dist/{class-map-D4QK1bDP.js → class-map-KyMqi0fa.js} +1 -1
  25. package/dist/{combobox-CKmkM6tY.js → combobox-CELUAZxF.js} +129 -125
  26. package/dist/combobox-D9NKnao2.cjs +115 -0
  27. package/dist/combobox.d.ts +0 -46
  28. package/dist/{datepicker-DarYkBIy.js → datepicker-B6qk_tTl.js} +11 -11
  29. package/dist/{datepicker-DW6AdQ9X.cjs → datepicker-CskZMUib.cjs} +1 -1
  30. package/dist/datepicker.d.ts +0 -46
  31. package/dist/{directive-helpers-CVAnO9Xf.js → directive-helpers-8uS_Izwn.js} +1 -1
  32. package/dist/{directive-helpers-CQimZ5PA.cjs → directive-helpers-CG7Oxal3.cjs} +1 -1
  33. package/dist/element-BSypUpzA.cjs +238 -0
  34. package/dist/{element-J964Wi0N.js → element-DjjF_tEh.js} +6679 -6673
  35. package/dist/{helptext-qBgH0lvl.js → helptext-BLHAJ1aC.js} +5 -5
  36. package/dist/{helptext-OW48aGy8.cjs → helptext-CCnYxYA9.cjs} +1 -1
  37. package/dist/helptext.d.ts +0 -46
  38. package/dist/{icon-kSv2VoAB.js → icon-Beoxup8E.js} +1 -1
  39. package/dist/{icon-Cc4gVHxd.cjs → icon-BnKGwYjj.cjs} +1 -1
  40. package/dist/icon.d.ts +0 -46
  41. package/dist/{if-defined-DEXc_i_J.js → if-defined-BErSJCeJ.js} +1 -1
  42. package/dist/{if-defined-ZR_9IQ1L.cjs → if-defined-a3sotaUr.cjs} +1 -1
  43. package/dist/index.d.ts +0 -46
  44. package/dist/{input-element-BoUU9kvo.js → input-element-Bic-t96S.js} +2 -2
  45. package/dist/{input-element-BYE0qiMh.cjs → input-element-C9ma8cdz.cjs} +1 -1
  46. package/dist/{input-wrapper-CZI_ibQL.js → input-wrapper-CeeNYbDA.js} +6 -6
  47. package/dist/{input-wrapper-DmVnotQ2.cjs → input-wrapper-Cn929YTV.cjs} +1 -1
  48. package/dist/input-wrapper.d.ts +0 -46
  49. package/dist/{link-D1Nr-VBI.js → link-BYI8VNGd.js} +4 -4
  50. package/dist/{link-3uccc2MM.cjs → link-CnibgS3c.cjs} +1 -1
  51. package/dist/link.d.ts +0 -46
  52. package/dist/{linkcard-CTNdTxvV.js → linkcard--zuuAt_v.js} +3 -3
  53. package/dist/{linkcard-P1I3dzQb.cjs → linkcard-DPGX1kb1.cjs} +1 -1
  54. package/dist/linkcard.d.ts +0 -46
  55. package/dist/{listbox-B4tiuVzB.js → listbox-C1oYnM-t.js} +5 -5
  56. package/dist/{listbox-BQu6MjAp.cjs → listbox-DqpGh7eq.cjs} +1 -1
  57. package/dist/listbox.d.ts +0 -46
  58. package/dist/{loader-CM7wLajY.cjs → loader-BN4q8pSl.cjs} +1 -1
  59. package/dist/{loader-C0zNKIJ0.js → loader-DgIiyYBl.js} +5 -5
  60. package/dist/loader.d.ts +0 -46
  61. package/dist/{messagebox-CD8fS0Ym.cjs → messagebox-BWJr42m9.cjs} +1 -1
  62. package/dist/{messagebox-DyLx08sr.js → messagebox-cme5VbUM.js} +5 -5
  63. package/dist/messagebox.d.ts +0 -46
  64. package/dist/{modal-Dnv6Y4Nv.js → modal-B-varrJT.js} +5 -5
  65. package/dist/{modal-DOCsiHGv.cjs → modal-cPcTJriW.cjs} +1 -1
  66. package/dist/modal.d.ts +0 -46
  67. package/dist/pkt-accordion.cjs +1 -1
  68. package/dist/pkt-accordion.js +2 -2
  69. package/dist/pkt-alert.cjs +1 -1
  70. package/dist/pkt-alert.js +1 -1
  71. package/dist/pkt-backlink.cjs +1 -1
  72. package/dist/pkt-backlink.js +1 -1
  73. package/dist/pkt-button.cjs +1 -1
  74. package/dist/pkt-button.js +1 -1
  75. package/dist/pkt-calendar.cjs +1 -1
  76. package/dist/pkt-calendar.js +1 -1
  77. package/dist/pkt-card.cjs +1 -1
  78. package/dist/pkt-card.js +1 -1
  79. package/dist/pkt-checkbox.cjs +1 -1
  80. package/dist/pkt-checkbox.js +1 -1
  81. package/dist/pkt-combobox.cjs +1 -1
  82. package/dist/pkt-combobox.js +1 -1
  83. package/dist/pkt-datepicker.cjs +1 -1
  84. package/dist/pkt-datepicker.js +1 -1
  85. package/dist/pkt-helptext.cjs +1 -1
  86. package/dist/pkt-helptext.js +1 -1
  87. package/dist/pkt-icon.cjs +1 -1
  88. package/dist/pkt-icon.js +1 -1
  89. package/dist/pkt-index.cjs +1 -1
  90. package/dist/pkt-index.js +27 -27
  91. package/dist/pkt-input-wrapper.cjs +1 -1
  92. package/dist/pkt-input-wrapper.js +1 -1
  93. package/dist/pkt-link.cjs +1 -1
  94. package/dist/pkt-link.js +1 -1
  95. package/dist/pkt-linkcard.cjs +1 -1
  96. package/dist/pkt-linkcard.js +1 -1
  97. package/dist/pkt-listbox.cjs +1 -1
  98. package/dist/pkt-listbox.js +1 -1
  99. package/dist/pkt-loader.cjs +1 -1
  100. package/dist/pkt-loader.js +1 -1
  101. package/dist/pkt-messagebox.cjs +1 -1
  102. package/dist/pkt-messagebox.js +1 -1
  103. package/dist/pkt-modal.cjs +1 -1
  104. package/dist/pkt-modal.js +1 -1
  105. package/dist/pkt-progressbar.cjs +1 -1
  106. package/dist/pkt-progressbar.js +2 -2
  107. package/dist/pkt-radiobutton.cjs +1 -1
  108. package/dist/pkt-radiobutton.js +1 -1
  109. package/dist/pkt-select.cjs +1 -1
  110. package/dist/pkt-select.js +1 -1
  111. package/dist/pkt-tag.cjs +1 -1
  112. package/dist/pkt-tag.js +1 -1
  113. package/dist/pkt-textarea.cjs +1 -1
  114. package/dist/pkt-textarea.js +1 -1
  115. package/dist/pkt-textinput.cjs +1 -1
  116. package/dist/pkt-textinput.js +1 -1
  117. package/dist/{progressbar-D3sqQ5g1.js → progressbar-BKt_aj7f.js} +5 -5
  118. package/dist/{progressbar-BmI-K95y.cjs → progressbar-DiRfScnB.cjs} +1 -1
  119. package/dist/progressbar.d.ts +0 -46
  120. package/dist/{radiobutton-CJYNTtFF.cjs → radiobutton-CIW0FvT8.cjs} +1 -1
  121. package/dist/{radiobutton-Bat-fmTh.js → radiobutton-DtHuz7qn.js} +5 -5
  122. package/dist/radiobutton.d.ts +0 -46
  123. package/dist/{ref-BbKbXwub.cjs → ref-BvbyvXRH.cjs} +2 -2
  124. package/dist/{ref-3rhflVgg.js → ref-iIffqQAI.js} +10 -10
  125. package/dist/{repeat-DK_E7chz.cjs → repeat-BnuruAat.cjs} +1 -1
  126. package/dist/{repeat-CTBD0h6a.js → repeat-D4kMediE.js} +2 -2
  127. package/dist/{select-Swc0c6lZ.cjs → select-BJziJVde.cjs} +1 -1
  128. package/dist/{select-CVWm9dL1.js → select-DbRLz-7l.js} +6 -6
  129. package/dist/select.d.ts +0 -46
  130. package/dist/{state-y7tCw3bg.cjs → state-B5KCNjEd.cjs} +1 -1
  131. package/dist/{state-fdb9lRrL.js → state-BtbpSrdV.js} +1 -1
  132. package/dist/{tag-Dizhf3tl.js → tag-CGnj4c1Z.js} +6 -6
  133. package/dist/{tag-Dg2-c_OZ.cjs → tag-CgkUxA5D.cjs} +1 -1
  134. package/dist/tag.d.ts +0 -46
  135. package/dist/{textarea-DkQfMu1d.js → textarea-CiA4IzMs.js} +9 -9
  136. package/dist/{textarea-go_AyeP-.cjs → textarea-qX4Inr1X.cjs} +1 -1
  137. package/dist/textarea.d.ts +0 -46
  138. package/dist/{textinput-FvLq5W70.cjs → textinput-BlsgLNwW.cjs} +1 -1
  139. package/dist/{textinput-CyJB8IDv.js → textinput-CrxjZNEq.js} +8 -8
  140. package/dist/textinput.d.ts +0 -46
  141. package/package.json +5 -5
  142. package/src/components/combobox/combobox.ts +17 -3
  143. package/dist/combobox-DqHwVglB.cjs +0 -115
  144. package/dist/element-BYpg5e6C.cjs +0 -238
@@ -1,7 +1,7 @@
1
- import { E as n, x as r, n as s, a as d } from "./element-J964Wi0N.js";
2
- import { P as k } from "./input-element-BoUU9kvo.js";
3
- import { e as b, n as f } from "./ref-3rhflVgg.js";
4
- import { e as u } from "./class-map-D4QK1bDP.js";
1
+ import { E as n, x as r, n as s, a as d } from "./element-DjjF_tEh.js";
2
+ import { P as k } from "./input-element-Bic-t96S.js";
3
+ import { e as b, n as f } from "./ref-iIffqQAI.js";
4
+ import { e as u } from "./class-map-KyMqi0fa.js";
5
5
  var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, h, c, l) => {
6
6
  for (var p = l > 1 ? void 0 : l ? y(h, c) : h, a = e.length - 1, o; a >= 0; a--)
7
7
  (o = e[a]) && (p = (l ? o(h, c, p) : o(p)) || p);
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./element-BYpg5e6C.cjs"),r=require("./directive-C7oCP5Bh.cjs");/**
1
+ "use strict";const a=require("./element-BSypUpzA.cjs"),r=require("./directive-C7oCP5Bh.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { T as a } from "./element-J964Wi0N.js";
1
+ import { T as a } from "./element-DjjF_tEh.js";
2
2
  import { e as h, i as d, t as c } from "./directive-oAbCiebi.js";
3
3
  /**
4
4
  * @license
@@ -1,16 +1,16 @@
1
- import { E as y, x as d, n as r, a as O } from "./element-J964Wi0N.js";
2
- import { o as f } from "./if-defined-DEXc_i_J.js";
3
- import { r as c } from "./state-fdb9lRrL.js";
4
- import { e as _, n as v } from "./ref-3rhflVgg.js";
5
- import { e as k } from "./class-map-D4QK1bDP.js";
6
- import { c as R } from "./repeat-CTBD0h6a.js";
7
- import { P as V } from "./input-element-BoUU9kvo.js";
1
+ import { E as y, x as d, n as r, a as O } from "./element-DjjF_tEh.js";
2
+ import { o as f } from "./if-defined-BErSJCeJ.js";
3
+ import { r as c } from "./state-BtbpSrdV.js";
4
+ import { e as _, n as v } from "./ref-iIffqQAI.js";
5
+ import { e as k } from "./class-map-KyMqi0fa.js";
6
+ import { c as R } from "./repeat-D4kMediE.js";
7
+ import { P as V } from "./input-element-Bic-t96S.js";
8
8
  import { P as C } from "./pkt-options-controller-CFmzX4xL.js";
9
9
  import { P as S } from "./pkt-slot-controller-DFrc5O93.js";
10
- import "./input-wrapper-CZI_ibQL.js";
11
- import "./icon-kSv2VoAB.js";
12
- import "./tag-Dizhf3tl.js";
13
- import "./listbox-B4tiuVzB.js";
10
+ import "./input-wrapper-CeeNYbDA.js";
11
+ import "./icon-Beoxup8E.js";
12
+ import "./tag-CGnj4c1Z.js";
13
+ import "./listbox-C1oYnM-t.js";
14
14
  const T = {
15
15
  displayValueAs: {
16
16
  default: "label"
@@ -18,10 +18,10 @@ const T = {
18
18
  }, A = {
19
19
  props: T
20
20
  };
21
- var M = Object.defineProperty, F = Object.getOwnPropertyDescriptor, h = (t, e, s, i) => {
22
- for (var o = i > 1 ? void 0 : i ? F(e, s) : e, n = t.length - 1, l; n >= 0; n--)
23
- (l = t[n]) && (o = (i ? l(e, s, o) : l(o)) || o);
24
- return i && o && M(e, s, o), o;
21
+ var M = Object.defineProperty, F = Object.getOwnPropertyDescriptor, h = (e, t, s, i) => {
22
+ for (var n = i > 1 ? void 0 : i ? F(t, s) : t, o = e.length - 1, l; o >= 0; o--)
23
+ (l = e[o]) && (n = (i ? l(t, s, n) : l(n)) || n);
24
+ return i && n && M(t, s, n), n;
25
25
  };
26
26
  let a = class extends V {
27
27
  constructor() {
@@ -29,34 +29,38 @@ let a = class extends V {
29
29
  }
30
30
  // Lifecycle methods
31
31
  connectedCallback() {
32
- if (super.connectedCallback(), document && document.body.addEventListener("click", (t) => {
33
- this._isOptionsOpen && !this.contains(t.target) && this.handleFocusOut(t);
32
+ if (super.connectedCallback(), document && document.body.addEventListener("click", (e) => {
33
+ this._isOptionsOpen && !this.contains(e.target) && this.handleFocusOut(e);
34
34
  }), this._options = [], this.optionsController.nodes.length) {
35
- const t = [];
36
- this.optionsController.nodes.forEach((e) => {
37
- if (!e.textContent && !e.getAttribute("value")) return null;
35
+ const e = [];
36
+ this.optionsController.nodes.forEach((t) => {
37
+ if (!t.textContent && !t.getAttribute("value")) return null;
38
38
  const s = {
39
- value: e.getAttribute("value") || e.textContent || "",
40
- label: e.textContent || e.getAttribute("value") || ""
39
+ value: t.getAttribute("value") || t.textContent || "",
40
+ label: t.textContent || t.getAttribute("value") || ""
41
41
  };
42
- e.getAttribute("data-prefix") && (s.prefix = e.getAttribute("data-prefix") || void 0), e.getAttribute("tagskincolor") && (s.tagSkinColor = e.getAttribute("tagskincolor")), e.getAttribute("description") && (s.description = e.getAttribute("description") || void 0), s.fulltext = s.value + s.label + (s.prefix || ""), t.push(s);
43
- }), t.length && (this.options = [...t], this._options = [...t]);
42
+ t.getAttribute("data-prefix") && (s.prefix = t.getAttribute("data-prefix") || void 0), t.getAttribute("tagskincolor") && (s.tagSkinColor = t.getAttribute("tagskincolor")), t.getAttribute("description") && (s.description = t.getAttribute("description") || void 0), s.fulltext = s.value + s.label + (s.prefix || ""), e.push(s);
43
+ }), e.length && (this.options = [...e], this._options = [...e]);
44
44
  }
45
45
  }
46
- updated(t) {
47
- t.has("_value") && this.valueChanged(this._value, t.get("_value")), t.has("value") && (this._value = Array.isArray(this.value) ? this.value : this.value ? this.value.split(",") : [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]]), this.isMaxItemsReached()), t.has("options") && this.options.length && (this._options = this.options, this._options.forEach((e) => {
48
- e.fulltext = e.value + e.label + (e.prefix || ""), e.selected = this._value.includes(e.value);
49
- })), t.has("_search") && this.dispatchEvent(
46
+ updated(e) {
47
+ e.has("_value") && this.valueChanged(this._value, e.get("_value")), e.has("value") && (this._value = Array.isArray(this.value) ? this.value : this.value ? this.value.split(",") : [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]]), this.isMaxItemsReached()), e.has("options") && this.options.length && (this._options = this.options, this._options.forEach((t) => {
48
+ if (t.value && !t.label && (t.label = t.value), t.selected && !this._value.includes(t.value)) {
49
+ const s = [...this._value];
50
+ this._value = [...this._value, t.value], this.valueChanged(this._value, s);
51
+ }
52
+ t.fulltext = t.value + t.label + (t.prefix || ""), t.selected = t.selected || this._value.includes(t.value);
53
+ })), e.has("_search") && this.dispatchEvent(
50
54
  new CustomEvent("search", {
51
55
  detail: this._search,
52
56
  bubbles: !1
53
57
  })
54
- ), super.updated(t);
58
+ ), super.updated(e);
55
59
  }
56
- attributeChangedCallback(t, e, s) {
57
- t === "value" && (this._value = Array.isArray(this.value) ? this.value : this.value ? this.value.split(",") : [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]])), t === "options" && (this._options = this.options, this._options.forEach((i) => {
58
- i.fulltext = i.value + i.label + (i.prefix || "");
59
- }), this._search = ""), super.attributeChangedCallback(t, e, s);
60
+ attributeChangedCallback(e, t, s) {
61
+ e === "value" && (this._value = Array.isArray(this.value) ? this.value : this.value ? this.value.split(",") : [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]])), e === "options" && (this._options = this.options, this._options.forEach((i) => {
62
+ i.value && !i.label && (i.label = i.value), i.selected && !this._value.includes(i.value) && (this._value = [...this._value, i.value]), i.fulltext = i.value + i.label + (i.prefix || "");
63
+ }), this._search = ""), super.attributeChangedCallback(e, t, s);
60
64
  }
61
65
  // Render methods
62
66
  render() {
@@ -183,62 +187,62 @@ let a = class extends V {
183
187
  `;
184
188
  }
185
189
  renderSingleOrMultipleValues() {
186
- const t = !this.multiple, e = this._editingSingleValue ? null : this.renderValueTag(this.findValueInOptions(this._value[0])), s = R(
190
+ const e = !this.multiple, t = this._editingSingleValue ? null : this.renderValueTag(this.findValueInOptions(this._value[0])), s = R(
187
191
  this._value,
188
192
  (i) => i,
189
193
  (i) => {
190
194
  var l;
191
- const o = this.findValueInOptions(i), n = (l = this.options.find((u) => u.value === i)) == null ? void 0 : l.tagSkinColor;
195
+ const n = this.findValueInOptions(i), o = (l = this.options.find((u) => u.value === i)) == null ? void 0 : l.tagSkinColor;
192
196
  return d`
193
197
  <pkt-tag
194
- skin=${n || "blue-dark"}
198
+ skin=${o || "blue-dark"}
195
199
  ?closeTag=${!this.disabled}
196
200
  @close=${() => this.handleTagRemove(i)}
197
201
  >
198
- ${this.renderValueTag(o)}
202
+ ${this.renderValueTag(n)}
199
203
  </pkt-tag>
200
204
  `;
201
205
  }
202
206
  );
203
- return t ? e : s;
207
+ return e ? t : s;
204
208
  }
205
- renderValueTag(t) {
206
- if (!t) return "";
209
+ renderValueTag(e) {
210
+ if (!e) return "";
207
211
  switch (this.displayValueAs) {
208
212
  case "prefixAndValue":
209
- return d`<span data-focusfix=${this.id}>${t.prefix || ""} ${t.value}</span>`;
213
+ return d`<span data-focusfix=${this.id}>${e.prefix || ""} ${e.value}</span>`;
210
214
  case "value":
211
- return d`<span data-focusfix=${this.id}>${t.value}</span>`;
215
+ return d`<span data-focusfix=${this.id}>${e.value}</span>`;
212
216
  case "label":
213
217
  default:
214
- return d`<span data-focusfix=${this.id}>${t.label || t.value}</span>`;
218
+ return d`<span data-focusfix=${this.id}>${e.label || e.value}</span>`;
215
219
  }
216
220
  }
217
221
  // Event handlers
218
- handleInput(t) {
219
- if (t.stopPropagation(), t.stopImmediatePropagation(), this.disabled) return;
222
+ handleInput(e) {
223
+ if (e.stopPropagation(), e.stopImmediatePropagation(), this.disabled) return;
220
224
  this.touched = !0;
221
- const e = t.target;
222
- if (this._search = e.value, this.checkForMatches(), this.typeahead)
225
+ const t = e.target;
226
+ if (this._search = t.value, this.checkForMatches(), this.typeahead)
223
227
  if (this._search) {
224
228
  if (this._options = this.options.filter(
225
229
  (s) => {
226
230
  var i;
227
231
  return (i = s.fulltext) == null ? void 0 : i.toLowerCase().includes(this._search.toLowerCase());
228
232
  }
229
- ), t.inputType !== "deleteContentBackward") {
233
+ ), e.inputType !== "deleteContentBackward") {
230
234
  const s = this._options.filter(
231
235
  (i) => {
232
- var o;
233
- return !i.selected && ((o = i.label) == null ? void 0 : o.toLowerCase().startsWith(this._search.toLowerCase()));
236
+ var n;
237
+ return !i.selected && ((n = i.label) == null ? void 0 : n.toLowerCase().startsWith(this._search.toLowerCase()));
234
238
  }
235
239
  );
236
240
  if (s.length > 0 && this.inputRef.value && this.inputRef.value.type !== "hidden") {
237
241
  const i = s[0];
238
- i != null && i.label && (e.value = i.label, window.setTimeout(
239
- () => e.setSelectionRange(this._search.length, e.value.length),
242
+ i != null && i.label && (t.value = i.label, window.setTimeout(
243
+ () => t.setSelectionRange(this._search.length, t.value.length),
240
244
  0
241
- ), e.selectionDirection = "backward");
245
+ ), t.selectionDirection = "backward");
242
246
  }
243
247
  }
244
248
  } else
@@ -247,15 +251,15 @@ let a = class extends V {
247
251
  handleFocus() {
248
252
  if (!this.disabled) {
249
253
  if (!this.multiple && this._value[0] && this.inputRef.value && this.inputRef.value.type !== "hidden") {
250
- const t = this.findValueInOptions(this._value[0]);
251
- this._editingSingleValue = !0, this.inputRef.value.value = this.displayValueAs === "label" && (t != null && t.label) ? t.label : this._value[0];
254
+ const e = this.findValueInOptions(this._value[0]);
255
+ this._editingSingleValue = !0, this.inputRef.value.value = this.displayValueAs === "label" && (e != null && e.label) ? e.label : this._value[0];
252
256
  }
253
257
  this._inputFocus = !0, this._search = "", this._options = [...this.options], this._isOptionsOpen = !0, this.onFocus(), this.requestUpdate();
254
258
  }
255
259
  }
256
- handleFocusOut(t) {
257
- var e, s, i, o, n;
258
- if (!this.disabled && ((s = (e = t.relatedTarget) == null ? void 0 : e.closest("pkt-combobox")) == null ? void 0 : s.id) !== this.id && ((o = (i = t.relatedTarget) == null ? void 0 : i.closest("pkt-combobox")) == null ? void 0 : o.id) !== this.id && ((n = t.target) == null ? void 0 : n.getAttribute("data-focusfix")) !== this.id && t.relatedTarget !== this.focusRef.value && t.relatedTarget !== this.inputRef.value && t.relatedTarget !== this.arrowRef.value && this._isOptionsOpen) {
260
+ handleFocusOut(e) {
261
+ var t, s, i, n, o;
262
+ if (!this.disabled && ((s = (t = e.relatedTarget) == null ? void 0 : t.closest("pkt-combobox")) == null ? void 0 : s.id) !== this.id && ((n = (i = e.relatedTarget) == null ? void 0 : i.closest("pkt-combobox")) == null ? void 0 : n.id) !== this.id && ((o = e.target) == null ? void 0 : o.getAttribute("data-focusfix")) !== this.id && e.relatedTarget !== this.focusRef.value && e.relatedTarget !== this.inputRef.value && e.relatedTarget !== this.arrowRef.value && this._isOptionsOpen) {
259
263
  if (this._inputFocus = !1, this._addValueText = null, this._userInfoMessage = "", this._search = "", this.inputRef.value && this.inputRef.value.type !== "hidden" && this.inputRef.value.value !== "") {
260
264
  const l = this.inputRef.value.value;
261
265
  !this._value.includes(l) && !this._options.find((u) => u.label === l) ? this.allowUserInput ? this.addNewUserValue(l) : this.multiple || this.removeValue(this._value[0]) : this._value.includes(l) || this.setSelected(l), this.inputRef.value.value = "";
@@ -266,66 +270,66 @@ let a = class extends V {
266
270
  handleBlur() {
267
271
  this._inputFocus = !1, this._editingSingleValue = !1, this.onBlur();
268
272
  }
269
- handleInputClick(t) {
270
- var e, s;
271
- this.disabled || (t.currentTarget && t.currentTarget !== this.arrowRef.value && ((e = this.inputRef.value) == null ? void 0 : e.type) !== "hidden" ? (s = this.inputRef.value) == null || s.focus() : this.handleArrowClick(t));
273
+ handleInputClick(e) {
274
+ var t, s;
275
+ this.disabled || (e.currentTarget && e.currentTarget !== this.arrowRef.value && ((t = this.inputRef.value) == null ? void 0 : t.type) !== "hidden" ? (s = this.inputRef.value) == null || s.focus() : this.handleArrowClick(e));
272
276
  }
273
- handleArrowClick(t) {
274
- var e, s;
275
- this.disabled || t instanceof KeyboardEvent && t.key && t.key !== "Enter" && t.key !== " " && t.key !== "ArrowDown" || (t.stopImmediatePropagation(), t.preventDefault(), this._isOptionsOpen = !this._isOptionsOpen, this._isOptionsOpen ? (e = this.listboxRef.value) == null || e.focusFirstOrSelectedOption() : (s = this.arrowRef.value) == null || s.focus());
277
+ handleArrowClick(e) {
278
+ var t, s;
279
+ this.disabled || e instanceof KeyboardEvent && e.key && e.key !== "Enter" && e.key !== " " && e.key !== "ArrowDown" || (e.stopImmediatePropagation(), e.preventDefault(), this._isOptionsOpen = !this._isOptionsOpen, this._isOptionsOpen ? (t = this.listboxRef.value) == null || t.focusFirstOrSelectedOption() : (s = this.arrowRef.value) == null || s.focus());
276
280
  }
277
- handleOptionToggled(t) {
278
- this.toggleValue(t.detail);
281
+ handleOptionToggled(e) {
282
+ this.toggleValue(e.detail);
279
283
  }
280
- handleSearch(t) {
281
- t.stopPropagation(), this._search = t.detail.toLowerCase();
284
+ handleSearch(e) {
285
+ e.stopPropagation(), this._search = e.detail.toLowerCase();
282
286
  }
283
- handleInputKeydown(t) {
284
- var e, s, i;
285
- switch (t.key) {
287
+ handleInputKeydown(e) {
288
+ var t, s, i;
289
+ switch (e.key) {
286
290
  case ",":
287
291
  case "Enter":
288
- t.preventDefault(), this.addValue();
292
+ e.preventDefault(), this.addValue();
289
293
  break;
290
294
  case "Backspace":
291
- !this._search && ((e = this.inputRef.value) == null ? void 0 : e.type) === "hidden" && this.removeLastValue(t);
295
+ !this._search && ((t = this.inputRef.value) == null ? void 0 : t.type) === "hidden" && this.removeLastValue(e);
292
296
  break;
293
297
  case "Tab":
294
298
  case "ArrowDown":
295
- t.shiftKey || ((s = this.listboxRef.value) == null || s.focusFirstOrSelectedOption(), t.preventDefault());
299
+ e.shiftKey || ((s = this.listboxRef.value) == null || s.focusFirstOrSelectedOption(), e.preventDefault());
296
300
  break;
297
301
  case "Escape":
298
- this._isOptionsOpen = !1, (i = this.arrowRef.value) == null || i.focus(), t.preventDefault();
302
+ this._isOptionsOpen = !1, (i = this.arrowRef.value) == null || i.focus(), e.preventDefault();
299
303
  break;
300
304
  }
301
305
  }
302
- handleTagRemove(t) {
303
- this.removeSelected(t);
306
+ handleTagRemove(e) {
307
+ this.removeSelected(e);
304
308
  }
305
309
  blurInput() {
306
310
  this.inputRef.value && this.inputRef.value.matches(":focus") && this.inputRef.value.blur();
307
311
  }
308
312
  checkForMatches() {
309
- var n;
310
- const t = ((n = this.inputRef.value) == null ? void 0 : n.value) || this._search || "", e = t.trim().toLowerCase() || "";
311
- if (!e) {
313
+ var o;
314
+ const e = ((o = this.inputRef.value) == null ? void 0 : o.value) || this._search || "", t = e.trim().toLowerCase() || "";
315
+ if (!t) {
312
316
  !this.multiple && this._value[0] && this.removeValue(this._value[0]), this.resetComboboxInput(!1);
313
317
  return;
314
318
  }
315
- const s = this._value.find((l) => l.toLowerCase() === e), i = this._options.filter(
319
+ const s = this._value.find((l) => l.toLowerCase() === t), i = this._options.filter(
316
320
  (l) => {
317
321
  var u;
318
- return ((u = l.label) == null ? void 0 : u.toLowerCase().includes(e)) ?? !1;
322
+ return ((u = l.label) == null ? void 0 : u.toLowerCase().includes(t)) ?? !1;
319
323
  }
320
- ), o = i.find(
324
+ ), n = i.find(
321
325
  (l) => {
322
326
  var u;
323
- return ((u = l.label) == null ? void 0 : u.toLowerCase()) === e || l.value.toLowerCase() === e;
327
+ return ((u = l.label) == null ? void 0 : u.toLowerCase()) === t || l.value.toLowerCase() === t;
324
328
  }
325
329
  );
326
330
  switch (!0) {
327
- case ((i.length === 0 || !o) && this.allowUserInput):
328
- this._addValueText = t, this._userInfoMessage = "";
331
+ case ((i.length === 0 || !n) && this.allowUserInput):
332
+ this._addValueText = e, this._userInfoMessage = "";
329
333
  break;
330
334
  case (i.length === 0 && !this.allowUserInput):
331
335
  this._addValueText = null, this._userInfoMessage = "Ingen match i søket";
@@ -340,41 +344,41 @@ let a = class extends V {
340
344
  this._addValueText = null, this._userInfoMessage = "";
341
345
  }
342
346
  }
343
- findValueInOptions(t) {
344
- return this.options.find((e) => e.value === t || e.label === t) || null;
347
+ findValueInOptions(e) {
348
+ return this.options.find((t) => t.value === e || t.label === e) || null;
345
349
  }
346
- findIndexInOptions(t) {
347
- return this._options.findIndex((e) => e.value === t || e.label === t);
350
+ findIndexInOptions(e) {
351
+ return this._options.findIndex((t) => t.value === e || t.label === e);
348
352
  }
349
353
  isMaxItemsReached() {
350
- const t = this.maxlength !== null && this._value.length >= this.maxlength;
351
- return t ? this._maxIsReached = !0 : this._maxIsReached = !1, t;
354
+ const e = this.maxlength !== null && this._value.length >= this.maxlength;
355
+ return e ? this._maxIsReached = !0 : this._maxIsReached = !1, e;
352
356
  }
353
- toggleValue(t) {
357
+ toggleValue(e) {
354
358
  var I, w;
355
359
  if (this.disabled) return;
356
360
  this.touched = !0, this._userInfoMessage = "", this._addValueText = null;
357
- const e = ((I = this.findValueInOptions(t)) == null ? void 0 : I.value) || null, s = this._value.includes(t || e || ""), i = !!e, o = ((w = this._options.find((m) => m.value === t)) == null ? void 0 : w.disabled) || !1, n = !(t != null && t.trim()), l = !this.multiple, u = this.multiple, $ = this.isMaxItemsReached();
361
+ const t = ((I = this.findValueInOptions(e)) == null ? void 0 : I.value) || null, s = this._value.includes(e || t || ""), i = !!t, n = ((w = this._options.find((m) => m.value === e)) == null ? void 0 : w.disabled) || !1, o = !(e != null && e.trim()), l = !this.multiple, u = this.multiple, $ = this.isMaxItemsReached();
358
362
  let p = !1, b = !0, g = "", x = "";
359
- o || (!i && this.allowUserInput && !n ? (this.addNewUserValue(t), g = "Ny verdi lagt til", p = !u) : !i && !this.allowUserInput ? (l && this._value[0] && this.removeValue(this._value[0]), b = !1, p = !0, g = "Ingen treff i søket") : s ? (this.removeValue(e), p = !0) : n && l ? (this.removeAllSelected(), p = !0) : l ? (this._value[0] && this.removeSelected(this._value[0]), this.setSelected(e), p = !1, this.inputRef.value && this.inputRef.value.type !== "hidden" && (this.inputRef.value.value = "", this.inputRef.value.blur())) : u && !$ ? (this.setSelected(e), p = !0) : u && $ ? (this._userInfoMessage = "Maks antall valg nådd", b = !1, x = t) : (l && this.removeAllSelected(), this._userInfoMessage = "Ingen gyldig verdi valgt", b = !1, p = !0, x = t), this._isOptionsOpen = p, p || window.setTimeout(() => {
363
+ n || (!i && this.allowUserInput && !o ? (this.addNewUserValue(e), g = "Ny verdi lagt til", p = !u) : !i && !this.allowUserInput ? (l && this._value[0] && this.removeValue(this._value[0]), b = !1, p = !0, g = "Ingen treff i søket") : s ? (this.removeValue(t), p = !0) : o && l ? (this.removeAllSelected(), p = !0) : l ? (this._value[0] && this.removeSelected(this._value[0]), this.setSelected(t), p = !1, this.inputRef.value && this.inputRef.value.type !== "hidden" && (this.inputRef.value.value = "", this.inputRef.value.blur())) : u && !$ ? (this.setSelected(t), p = !0) : u && $ ? (this._userInfoMessage = "Maks antall valg nådd", b = !1, x = e) : (l && this.removeAllSelected(), this._userInfoMessage = "Ingen gyldig verdi valgt", b = !1, p = !0, x = e), this._isOptionsOpen = p, p || window.setTimeout(() => {
360
364
  var m;
361
365
  (m = this.focusRef.value) == null || m.focus();
362
366
  }, 0), this._userInfoMessage = g, this._search = x || "", this.resetComboboxInput(b), u && this.isMaxItemsReached());
363
367
  }
364
- setSelected(t) {
365
- if (!this._value.includes(t)) {
368
+ setSelected(e) {
369
+ if (!this._value.includes(e)) {
366
370
  if (this.multiple && this.isMaxItemsReached()) {
367
371
  this._userInfoMessage = "Maks antall valg nådd";
368
372
  return;
369
373
  }
370
- !this.multiple && this.removeAllSelected(), this._value = t ? [...this._value, t] : this._value, this._options = this._options.map((e) => (e.value === t && (e.selected = !0), e)), this.resetComboboxInput(!0);
374
+ !this.multiple && this.removeAllSelected(), this._value = e ? [...this._value, e] : this._value, this._options = this._options.map((t) => (t.value === e && (t.selected = !0), t)), this.resetComboboxInput(!0);
371
375
  }
372
376
  }
373
- removeSelected(t) {
374
- if (!t) return;
375
- this._value = this._value.filter((s) => s !== t);
376
- const e = this.findValueInOptions(t);
377
- e ? (e.selected = !1, e.userAdded ? (this._options = [...this._options.filter((s) => s.value !== t)], this.options = [...this.options.filter((s) => s.value !== t)]) : this._options = [...this._options, e]) : !t && !this.multiple && (this._options = this._options.map((s) => (s.selected = !1, s)));
377
+ removeSelected(e) {
378
+ if (!e) return;
379
+ this._value = this._value.filter((s) => s !== e);
380
+ const t = this.findValueInOptions(e);
381
+ t ? (t.selected = !1, t.userAdded ? (this._options = [...this._options.filter((s) => s.value !== e)], this.options = [...this.options.filter((s) => s.value !== e)]) : this._options = [...this._options, t]) : !e && !this.multiple && (this._options = this._options.map((s) => (s.selected = !1, s)));
378
382
  }
379
383
  addAllOptions() {
380
384
  if (this.multiple) {
@@ -382,48 +386,48 @@ let a = class extends V {
382
386
  this._userInfoMessage = "For mange valgt";
383
387
  return;
384
388
  }
385
- this._value = this._options.map((t) => t.value), this._options = this._options.map((t) => (t.selected = !0, t)), this.requestUpdate();
389
+ this._value = this._options.map((e) => e.value), this._options = this._options.map((e) => (e.selected = !0, e)), this.requestUpdate();
386
390
  }
387
391
  }
388
392
  removeAllSelected() {
389
- this._value = [], this._options = this._options.map((t) => (t.selected = !1, t)), this._options = this._options.filter((t) => !t.userAdded), this.requestUpdate();
393
+ this._value = [], this._options = this._options.map((e) => (e.selected = !1, e)), this._options = this._options.filter((e) => !e.userAdded), this.requestUpdate();
390
394
  }
391
395
  addValue() {
392
- var e;
393
- const t = ((e = this.inputRef.value) == null ? void 0 : e.value.trim()) || "";
394
- this._search = t, this.toggleValue(t);
396
+ var t;
397
+ const e = ((t = this.inputRef.value) == null ? void 0 : t.value.trim()) || "";
398
+ this._search = e, this.toggleValue(e);
395
399
  }
396
- removeValue(t) {
397
- this._value = this.multiple ? this._value.filter((e) => e !== t) : [], this.removeSelected(t);
400
+ removeValue(e) {
401
+ this._value = this.multiple ? this._value.filter((t) => t !== e) : [], this.removeSelected(e);
398
402
  }
399
- addNewUserValue(t) {
400
- if (!t || t.trim() === "") return;
403
+ addNewUserValue(e) {
404
+ if (!e || e.trim() === "") return;
401
405
  if (!this.multiple)
402
- this._value[0] && this.removeSelected(this._value[0]), this._value = [t], this._isOptionsOpen = !1, this.blurInput();
403
- else if (!this.findValueInOptions(t)) {
406
+ this._value[0] && this.removeSelected(this._value[0]), this._value = [e], this._isOptionsOpen = !1, this.blurInput();
407
+ else if (!this.findValueInOptions(e)) {
404
408
  if (this.isMaxItemsReached()) return;
405
- this._value = [...this._value, t];
409
+ this._value = [...this._value, e];
406
410
  }
407
- const e = { value: t, label: t, userAdded: !0 };
408
- this.options = [e, ...this.options], this._options = [e, ...this._options], this.setSelected(t), this.requestUpdate();
411
+ const t = { value: e, label: e, userAdded: !0 };
412
+ this.options = [t, ...this.options], this._options = [t, ...this._options], this.setSelected(e), this.requestUpdate();
409
413
  }
410
- resetComboboxInput(t = !0) {
411
- if (this._addValueText = null, this.inputRef.value && this.inputRef.value.type !== "hidden" && t)
414
+ resetComboboxInput(e = !0) {
415
+ if (this._addValueText = null, this.inputRef.value && this.inputRef.value.type !== "hidden" && e)
412
416
  if (this._search = "", this.multiple)
413
417
  this.inputRef.value.value = "";
414
418
  else {
415
- const e = this.findValueInOptions(this._value[0]);
419
+ const t = this.findValueInOptions(this._value[0]);
416
420
  window.setTimeout(() => {
417
- !this.inputRef.value || this.inputRef.value.type === "hidden" || (this.inputRef.value.value = this.displayValueAs === "label" && (e != null && e.label) ? e.label : this._value[0] || "");
421
+ !this.inputRef.value || this.inputRef.value.type === "hidden" || (this.inputRef.value.value = this.displayValueAs === "label" && (t != null && t.label) ? t.label : this._value[0] || "");
418
422
  }, 0), this._userInfoMessage = "";
419
423
  }
420
424
  this._options = [...this.options];
421
425
  }
422
- removeLastValue(t) {
426
+ removeLastValue(e) {
423
427
  if (this._value.length === 0) return;
424
- t.preventDefault();
425
- const e = this._value[this._value.length - 1];
426
- e && this.removeSelected(e), this.isMaxItemsReached();
428
+ e.preventDefault();
429
+ const t = this._value[this._value.length - 1];
430
+ t && this.removeSelected(t), this.isMaxItemsReached();
427
431
  }
428
432
  };
429
433
  h([