@oslokommune/punkt-elements 15.3.1 → 15.4.2

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 (138) hide show
  1. package/dist/{accordionitem-BbeS44TD.js → accordionitem-CHXGzgLv.js} +4 -4
  2. package/dist/accordionitem-To95GT6b.cjs +34 -0
  3. package/dist/{alert-B9flMht5.cjs → alert-BDXWFRcf.cjs} +5 -5
  4. package/dist/{alert-BpFxQviu.js → alert-BHSd2Vpj.js} +6 -6
  5. package/dist/{backlink-DfMabyBp.js → backlink-C68H4Z3b.js} +5 -5
  6. package/dist/{backlink-Bn16ZEIX.cjs → backlink-CQoNgoa-.cjs} +1 -1
  7. package/dist/{button-CKgpX5QA.js → button-CHUuxLQV.js} +10 -10
  8. package/dist/{button-BgCKV0zW.cjs → button-VWxZW89G.cjs} +7 -7
  9. package/dist/{calendar-BMarIeVp.js → calendar-DTnx3DDH.js} +22 -22
  10. package/dist/{calendar-C6xgAJ7Z.cjs → calendar-DjbO2g5L.cjs} +11 -11
  11. package/dist/{card-DI3KodEc.cjs → card-5S2r9UD1.cjs} +27 -27
  12. package/dist/{card-h8ekgJRr.js → card-CnPjrdre.js} +7 -7
  13. package/dist/{checkbox-BJ9pz3kV.js → checkbox-BSz71IeT.js} +4 -4
  14. package/dist/{checkbox-B2t7wfxe.cjs → checkbox-D98_NjcU.cjs} +9 -9
  15. package/dist/{class-map-Dt2jXOlF.js → class-map-3ADKve8g.js} +3 -3
  16. package/dist/class-map-Bokp1SoS.cjs +5 -0
  17. package/dist/{combobox-BjAvk8Y-.js → combobox-CXBYVeh-.js} +11 -11
  18. package/dist/{combobox-HNN7GTzh.cjs → combobox-CZsCRADa.cjs} +12 -12
  19. package/dist/{consent-C37tuFwZ.cjs → consent-BQLkfN3d.cjs} +3 -3
  20. package/dist/{consent-DAk2BJ7I.js → consent-knPF4PS_.js} +3 -3
  21. package/dist/{datepicker-DvcH2QD9.js → datepicker-BOW852c2.js} +13 -13
  22. package/dist/{datepicker-2bneToiA.cjs → datepicker-BqGkvUmw.cjs} +21 -21
  23. package/dist/directive-helpers-B3Vpl3xV.cjs +5 -0
  24. package/dist/directive-helpers-CyPtA1_i.js +38 -0
  25. package/dist/element-CMTfByxQ.cjs +27 -0
  26. package/dist/{element-BXsf_NlG.js → element-CV9utnHJ.js} +114 -114
  27. package/dist/{heading-CBepYb7H.cjs → heading-B0XRE0lq.cjs} +1 -1
  28. package/dist/{heading-J7dN9nRi.js → heading-D9R5UBcv.js} +1 -1
  29. package/dist/{helptext-BG1P_9j0.cjs → helptext-BjW1WdOn.cjs} +3 -3
  30. package/dist/{helptext-Cm6FLBVf.js → helptext-TFpeGJ1P.js} +5 -5
  31. package/dist/{icon-DBZvMard.js → icon-D0IQAVwS.js} +3 -3
  32. package/dist/{icon-n4-ve48P.cjs → icon-Dj0oZZSa.cjs} +3 -3
  33. package/dist/if-defined-hKKmbsI8.cjs +5 -0
  34. package/dist/{if-defined-CxHgig4I.js → if-defined-rXcLNTzN.js} +1 -1
  35. package/dist/{input-element-CbjYtVou.js → input-element-Bkv6Yxld.js} +1 -1
  36. package/dist/{input-element-BBv4xjPb.cjs → input-element-DM0tY799.cjs} +1 -1
  37. package/dist/{input-wrapper-Bwmva-69.js → input-wrapper-CaUY90qz.js} +12 -12
  38. package/dist/{input-wrapper-CJqmwe3I.cjs → input-wrapper-JU4D2TGu.cjs} +19 -19
  39. package/dist/{link-BKnT-97D.js → link-Bscfb6s9.js} +4 -4
  40. package/dist/{link-DRPFqqEn.cjs → link-CDuv1jxx.cjs} +3 -3
  41. package/dist/{linkcard-02fxYQ2g.cjs → linkcard-3WUL0CpY.cjs} +3 -3
  42. package/dist/{linkcard-C2UENcqo.js → linkcard-wNgRxJ-S.js} +4 -4
  43. package/dist/{listbox-CLtowV6W.js → listbox-CI7Wfn_e.js} +8 -8
  44. package/dist/{listbox-C_0RhGhk.cjs → listbox-TRqKskJT.cjs} +12 -12
  45. package/dist/{loader-BW-AWQiE.js → loader-BF9K1VCZ.js} +5 -5
  46. package/dist/{loader-Cj4kUNRE.cjs → loader-C1LI8Q4z.cjs} +4 -4
  47. package/dist/{messagebox-CK0sSRep.cjs → messagebox-Dmot5szX.cjs} +4 -4
  48. package/dist/{messagebox-DB8tEXrV.js → messagebox-LBEzcr6B.js} +12 -12
  49. package/dist/{modal-ClYfWW2a.js → modal-CGHWsjk8.js} +5 -5
  50. package/dist/{modal-BzVQSQy2.cjs → modal-S9MOKOaz.cjs} +6 -6
  51. package/dist/pkt-accordion.cjs +1 -1
  52. package/dist/pkt-accordion.js +2 -2
  53. package/dist/pkt-alert.cjs +1 -1
  54. package/dist/pkt-alert.js +1 -1
  55. package/dist/pkt-backlink.cjs +1 -1
  56. package/dist/pkt-backlink.js +1 -1
  57. package/dist/pkt-button.cjs +1 -1
  58. package/dist/pkt-button.js +1 -1
  59. package/dist/pkt-calendar.cjs +1 -1
  60. package/dist/pkt-calendar.js +1 -1
  61. package/dist/pkt-card.cjs +1 -1
  62. package/dist/pkt-card.js +1 -1
  63. package/dist/pkt-checkbox.cjs +1 -1
  64. package/dist/pkt-checkbox.js +1 -1
  65. package/dist/pkt-combobox.cjs +1 -1
  66. package/dist/pkt-combobox.js +1 -1
  67. package/dist/pkt-consent.cjs +1 -1
  68. package/dist/pkt-consent.js +1 -1
  69. package/dist/pkt-datepicker.cjs +1 -1
  70. package/dist/pkt-datepicker.js +2 -2
  71. package/dist/pkt-header.cjs +52 -52
  72. package/dist/pkt-header.js +9 -9
  73. package/dist/pkt-heading.cjs +1 -1
  74. package/dist/pkt-heading.js +1 -1
  75. package/dist/pkt-helptext.cjs +1 -1
  76. package/dist/pkt-helptext.js +1 -1
  77. package/dist/pkt-icon.cjs +1 -1
  78. package/dist/pkt-icon.js +1 -1
  79. package/dist/pkt-index.cjs +1 -1
  80. package/dist/pkt-index.js +26 -26
  81. package/dist/pkt-input-wrapper.cjs +1 -1
  82. package/dist/pkt-input-wrapper.js +1 -1
  83. package/dist/pkt-link.cjs +1 -1
  84. package/dist/pkt-link.js +1 -1
  85. package/dist/pkt-linkcard.cjs +1 -1
  86. package/dist/pkt-linkcard.js +1 -1
  87. package/dist/pkt-listbox.cjs +1 -1
  88. package/dist/pkt-listbox.js +1 -1
  89. package/dist/pkt-loader.cjs +1 -1
  90. package/dist/pkt-loader.js +1 -1
  91. package/dist/pkt-messagebox.cjs +1 -1
  92. package/dist/pkt-messagebox.js +1 -1
  93. package/dist/pkt-modal.cjs +1 -1
  94. package/dist/pkt-modal.js +1 -1
  95. package/dist/pkt-progressbar.cjs +1 -1
  96. package/dist/pkt-progressbar.js +2 -2
  97. package/dist/pkt-radiobutton.cjs +1 -1
  98. package/dist/pkt-radiobutton.js +1 -1
  99. package/dist/pkt-select.cjs +1 -1
  100. package/dist/pkt-select.js +1 -1
  101. package/dist/pkt-tabs.cjs +1 -1
  102. package/dist/pkt-tabs.js +2 -2
  103. package/dist/pkt-tag.cjs +1 -1
  104. package/dist/pkt-tag.js +1 -1
  105. package/dist/pkt-textarea.cjs +1 -1
  106. package/dist/pkt-textarea.js +1 -1
  107. package/dist/pkt-textinput.cjs +1 -1
  108. package/dist/pkt-textinput.js +1 -1
  109. package/dist/{progressbar-ClZOyCz9.cjs → progressbar-Bxh335uT.cjs} +5 -5
  110. package/dist/{progressbar-CJa70NEo.js → progressbar-GSA4Md1u.js} +7 -7
  111. package/dist/{radiobutton-DWoYQn8H.cjs → radiobutton-95wp024h.cjs} +7 -7
  112. package/dist/{radiobutton-CvKKNFMd.js → radiobutton-CTFAV5GU.js} +9 -9
  113. package/dist/{ref-C5iJMIE1.cjs → ref-CxLwrCxt.cjs} +3 -3
  114. package/dist/{ref-BxiKhrfa.js → ref-Dma3n3i8.js} +5 -5
  115. package/dist/repeat-C-FJ2vfy.cjs +5 -0
  116. package/dist/repeat-DnlRNf63.js +61 -0
  117. package/dist/{select-BQUp88lY.cjs → select-CZ_Lx5W6.cjs} +2 -2
  118. package/dist/{select-CFkxir_l.js → select-YLvYAQX6.js} +6 -6
  119. package/dist/{state-GDzxl12x.cjs → state-BNgpvY-A.cjs} +1 -1
  120. package/dist/{state-DgnkjP0q.js → state-l4hGZdFJ.js} +1 -1
  121. package/dist/tabitem-BKv4eN0a.cjs +65 -0
  122. package/dist/{tabitem-C8-tZyc_.js → tabitem-DQRzgAT4.js} +10 -10
  123. package/dist/{tag-DIJMJhyp.js → tag-68q0_Sn0.js} +6 -6
  124. package/dist/{tag-h0vD2Na0.cjs → tag-BnT5onW2.cjs} +4 -4
  125. package/dist/{textarea-DcCOfNlr.cjs → textarea-CuTsE1WX.cjs} +3 -3
  126. package/dist/{textarea-CMuiBUee.js → textarea-DhWH99qN.js} +16 -16
  127. package/dist/{textinput-D30TCADP.js → textinput-BCi9p0Du.js} +8 -8
  128. package/dist/{textinput-DR3aaHTH.cjs → textinput-st4Vml5J.cjs} +11 -11
  129. package/package.json +3 -3
  130. package/dist/accordionitem-DUWhTUEI.cjs +0 -34
  131. package/dist/class-map-CApIYSRo.cjs +0 -5
  132. package/dist/directive-helpers-CQef4qUQ.js +0 -38
  133. package/dist/directive-helpers-CYIEJ8pI.cjs +0 -5
  134. package/dist/element-aUzIoa1s.cjs +0 -27
  135. package/dist/if-defined-BElHLTlB.cjs +0 -5
  136. package/dist/repeat-B55jMEsG.js +0 -61
  137. package/dist/repeat-DcYSFU2y.cjs +0 -5
  138. package/dist/tabitem-DaYfUaxw.cjs +0 -65
@@ -1,8 +1,8 @@
1
- "use strict";const s=require("./element-aUzIoa1s.cjs"),p=require("./if-defined-BElHLTlB.cjs"),c=require("./state-GDzxl12x.cjs"),l=require("./ref-C5iJMIE1.cjs"),$=require("./class-map-CApIYSRo.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-CYIEJ8pI.cjs"),x=require("./input-element-BBv4xjPb.cjs"),T=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-CJqmwe3I.cjs");require("./icon-n4-ve48P.cjs");/**
1
+ "use strict";const s=require("./element-CMTfByxQ.cjs"),p=require("./if-defined-hKKmbsI8.cjs"),c=require("./state-BNgpvY-A.cjs"),l=require("./ref-CxLwrCxt.cjs"),$=require("./class-map-Bokp1SoS.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-B3Vpl3xV.cjs"),x=require("./input-element-DM0tY799.cjs"),g=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-JU4D2TGu.cjs");require("./icon-Dj0oZZSa.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const g=a.e(class extends a.i{constructor(r){if(super(r),r.type!==a.t.PROPERTY&&r.type!==a.t.ATTRIBUTE&&r.type!==a.t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!d.f(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===s.T||e===s.E)return e;const i=r.element,t=r.name;if(r.type===a.t.PROPERTY){if(e===i[t])return s.T}else if(r.type===a.t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(t))return s.T}else if(r.type===a.t.ATTRIBUTE&&i.getAttribute(t)===e+"")return s.T;return d.m(r),e}});var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,o=(r,e,i,t)=>{for(var n=t>1?void 0:t?f(e,i):e,u=r.length-1,h;u>=0;u--)(h=r[u])&&(n=(t?h(e,i,n):h(n))||n);return t&&n&&v(e,i,n),n};exports.PktTextarea=class extends x.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new T.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(e,i,t){e==="value"&&this.value!==i&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,i)),super.attributeChangedCallback(e,i,t)}updated(e){var i;super.updated(e),e.has("value")&&(this.counterCurrent=((i=this.value)==null?void 0:i.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=$.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return s.x`<pkt-input-wrapper
5
+ */const T=a.e(class extends a.i{constructor(r){if(super(r),r.type!==a.t.PROPERTY&&r.type!==a.t.ATTRIBUTE&&r.type!==a.t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!d.r(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===s.E||e===s.A)return e;const i=r.element,t=r.name;if(r.type===a.t.PROPERTY){if(e===i[t])return s.E}else if(r.type===a.t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(t))return s.E}else if(r.type===a.t.ATTRIBUTE&&i.getAttribute(t)===e+"")return s.E;return d.p(r),e}});var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,o=(r,e,i,t)=>{for(var n=t>1?void 0:t?f(e,i):e,u=r.length-1,h;u>=0;u--)(h=r[u])&&(n=(t?h(e,i,n):h(n))||n);return t&&n&&v(e,i,n),n};exports.PktTextarea=class extends x.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new g.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(e,i,t){e==="value"&&this.value!==i&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,i)),super.attributeChangedCallback(e,i,t)}updated(e){var i;super.updated(e),e.has("value")&&(this.counterCurrent=((i=this.value)==null?void 0:i.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=$.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return s.b`<pkt-input-wrapper
6
6
  label=${this.label}
7
7
  ?counter=${this.counter}
8
8
  ?disabled=${this.disabled}
@@ -32,7 +32,7 @@
32
32
  id=${this.id+"-input"}
33
33
  name=${(this.name||this.id)+"-input"}
34
34
  placeholder=${p.o(this.placeholder)}
35
- .value=${g(this.value)}
35
+ .value=${T(this.value)}
36
36
  minlength=${p.o(this.minlength)}
37
37
  maxlength=${p.o(this.maxlength)}
38
38
  ?readonly=${this.readonly}
@@ -1,20 +1,20 @@
1
- import { T as l, E as $, x as f, n as d, t as g } from "./element-BXsf_NlG.js";
2
- import { o as u } from "./if-defined-CxHgig4I.js";
3
- import { r as x } from "./state-DgnkjP0q.js";
4
- import { e as m, n as c } from "./ref-BxiKhrfa.js";
5
- import { e as v } from "./class-map-Dt2jXOlF.js";
6
- import { e as T, i as b, t as a } from "./directive-oAbCiebi.js";
7
- import { f as y, m as w } from "./directive-helpers-CQef4qUQ.js";
8
- import { P as C } from "./input-element-CbjYtVou.js";
1
+ import { E as l, A as $, b as g, n as d, t as f } from "./element-CV9utnHJ.js";
2
+ import { o as u } from "./if-defined-rXcLNTzN.js";
3
+ import { r as x } from "./state-l4hGZdFJ.js";
4
+ import { e as c, n as m } from "./ref-Dma3n3i8.js";
5
+ import { e as v } from "./class-map-3ADKve8g.js";
6
+ import { e as b, i as T, t as a } from "./directive-oAbCiebi.js";
7
+ import { r as y, p as w } from "./directive-helpers-CyPtA1_i.js";
8
+ import { P as C } from "./input-element-Bkv6Yxld.js";
9
9
  import { P as E } from "./pkt-slot-controller-D7CrjM52.js";
10
- import "./input-wrapper-Bwmva-69.js";
11
- import "./icon-DBZvMard.js";
10
+ import "./input-wrapper-CaUY90qz.js";
11
+ import "./icon-D0IQAVwS.js";
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2020 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const P = T(class extends b {
17
+ const P = b(class extends T {
18
18
  constructor(t) {
19
19
  if (super(t), t.type !== a.PROPERTY && t.type !== a.ATTRIBUTE && t.type !== a.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
20
20
  if (!y(t)) throw Error("`live` bindings can only contain a single expression");
@@ -40,7 +40,7 @@ var B = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (t, r, e
40
40
  };
41
41
  let o = class extends C {
42
42
  constructor() {
43
- super(), this.inputRef = m(), this.helptextSlot = m(), this.value = "", this.autocomplete = "off", this.rows = null, this.counterCurrent = 0, this.slotController = new E(this, this.helptextSlot);
43
+ super(), this.inputRef = c(), this.helptextSlot = c(), this.value = "", this.autocomplete = "off", this.rows = null, this.counterCurrent = 0, this.slotController = new E(this, this.helptextSlot);
44
44
  }
45
45
  attributeChangedCallback(t, r, e) {
46
46
  t === "value" && this.value !== r && (this.counterCurrent = e ? e.length : 0, this.valueChanged(e, r)), super.attributeChangedCallback(t, r, e);
@@ -55,7 +55,7 @@ let o = class extends C {
55
55
  "pkt-input--fullwidth": this.fullwidth,
56
56
  "pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
57
57
  }), r = this.ariaLabelledby || `${this.id}-input-label`;
58
- return f`<pkt-input-wrapper
58
+ return g`<pkt-input-wrapper
59
59
  label=${this.label}
60
60
  ?counter=${this.counter}
61
61
  ?disabled=${this.disabled}
@@ -78,9 +78,9 @@ let o = class extends C {
78
78
  .tagText=${this.tagText}
79
79
  class="pkt-textarea"
80
80
  >
81
- <div class="pkt-contents" ${c(this.helptextSlot)} name="helptext" slot="helptext"></div>
81
+ <div class="pkt-contents" ${m(this.helptextSlot)} name="helptext" slot="helptext"></div>
82
82
  <textarea
83
- ${c(this.inputRef)}
83
+ ${m(this.inputRef)}
84
84
  class=${t}
85
85
  id=${this.id + "-input"}
86
86
  name=${(this.name || this.id) + "-input"}
@@ -124,7 +124,7 @@ n([
124
124
  x()
125
125
  ], o.prototype, "counterCurrent", 2);
126
126
  o = n([
127
- g("pkt-textarea")
127
+ f("pkt-textarea")
128
128
  ], o);
129
129
  export {
130
130
  o as P
@@ -1,12 +1,12 @@
1
- import { E as p, x as h, n as a, t as $ } from "./element-BXsf_NlG.js";
2
- import { o as u } from "./if-defined-CxHgig4I.js";
3
- import { r as f } from "./state-DgnkjP0q.js";
4
- import { e as d, n as m } from "./ref-BxiKhrfa.js";
5
- import { e as g } from "./class-map-Dt2jXOlF.js";
6
- import { P as x } from "./input-element-CbjYtVou.js";
1
+ import { A as p, b as h, n as a, t as $ } from "./element-CV9utnHJ.js";
2
+ import { o as u } from "./if-defined-rXcLNTzN.js";
3
+ import { r as f } from "./state-l4hGZdFJ.js";
4
+ import { e as d, n as m } from "./ref-Dma3n3i8.js";
5
+ import { e as g } from "./class-map-3ADKve8g.js";
6
+ import { P as x } from "./input-element-Bkv6Yxld.js";
7
7
  import { P as v } from "./pkt-slot-controller-D7CrjM52.js";
8
- import "./input-wrapper-Bwmva-69.js";
9
- import "./icon-DBZvMard.js";
8
+ import "./input-wrapper-CaUY90qz.js";
9
+ import "./icon-D0IQAVwS.js";
10
10
  var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (i, e, r, t) => {
11
11
  for (var n = t > 1 ? void 0 : t ? b(e, r) : e, l = i.length - 1, c; l >= 0; l--)
12
12
  (c = i[l]) && (n = (t ? c(e, r, n) : c(n)) || n);
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-aUzIoa1s.cjs"),a=require("./if-defined-BElHLTlB.cjs"),l=require("./state-GDzxl12x.cjs"),h=require("./ref-C5iJMIE1.cjs"),c=require("./class-map-CApIYSRo.cjs"),d=require("./input-element-BBv4xjPb.cjs"),x=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-CJqmwe3I.cjs");require("./icon-n4-ve48P.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(u,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new x.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=c.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
1
+ "use strict";const t=require("./element-CMTfByxQ.cjs"),a=require("./if-defined-hKKmbsI8.cjs"),l=require("./state-BNgpvY-A.cjs"),h=require("./ref-CxLwrCxt.cjs"),c=require("./class-map-Bokp1SoS.cjs"),d=require("./input-element-DM0tY799.cjs"),$=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-JU4D2TGu.cjs");require("./icon-Dj0oZZSa.cjs");var x=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(u,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&x(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new $.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=c.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.b`
2
2
  <pkt-input-wrapper
3
3
  label="${this.label}"
4
4
  ?counter=${this.counter}
@@ -25,7 +25,7 @@
25
25
  >
26
26
  <div class="pkt-contents" ${h.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
27
27
  <div class="pkt-input__container">
28
- ${this.prefix?t.x`<div class="pkt-input-prefix">${this.prefix}</div>`:t.E}
28
+ ${this.prefix?t.b`<div class="pkt-input-prefix">${this.prefix}</div>`:t.A}
29
29
  <input
30
30
  ${h.n(this.inputRef)}
31
31
  class=${s}
@@ -41,7 +41,7 @@
41
41
  max=${a.o(this.max||void 0)}
42
42
  step=${a.o(this.step||void 0)}
43
43
  ?readonly=${this.readonly}
44
- size=${this.size||t.E}
44
+ size=${this.size||t.A}
45
45
  .value=${this.value}
46
46
  ?disabled=${this.disabled}
47
47
  aria-invalid=${this.hasError}
@@ -52,19 +52,19 @@
52
52
  @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
53
53
  @keydown=${e=>{var o;if(e.key==="Enter"){const p=this.internals.form;p?p.requestSubmit():(o=this.inputRef.value)==null||o.blur()}}}
54
54
  />
55
- ${this.suffix?t.x`<div class="pkt-input-suffix">
55
+ ${this.suffix?t.b`<div class="pkt-input-suffix">
56
56
  ${this.suffix}
57
- ${this.iconNameRight?t.x`<pkt-icon
57
+ ${this.iconNameRight?t.b`<pkt-icon
58
58
  class="pkt-input-suffix-icon"
59
59
  name=${this.iconNameRight}
60
- ></pkt-icon>`:t.E}
61
- ${i?t.x`<pkt-icon
60
+ ></pkt-icon>`:t.A}
61
+ ${i?t.b`<pkt-icon
62
62
  class="pkt-input-suffix-icon"
63
63
  name="magnifying-glass-big"
64
- ></pkt-icon>`:t.E}
65
- </div>`:t.E}
66
- ${!this.suffix&&this.iconNameRight?t.x`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:t.E}
67
- ${!this.suffix&&i?t.x`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:t.E}
64
+ ></pkt-icon>`:t.A}
65
+ </div>`:t.A}
66
+ ${!this.suffix&&this.iconNameRight?t.b`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:t.A}
67
+ ${!this.suffix&&i?t.b`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:t.A}
68
68
  </div>
69
69
  </pkt-input-wrapper>
70
70
  `}};r([t.n({type:String,reflect:!0})],exports.PktTextinput.prototype,"value",2);r([t.n({type:String})],exports.PktTextinput.prototype,"type",2);r([t.n({type:Number})],exports.PktTextinput.prototype,"size",2);r([t.n({type:String})],exports.PktTextinput.prototype,"autocomplete",2);r([t.n({type:String})],exports.PktTextinput.prototype,"iconNameRight",2);r([t.n({type:String})],exports.PktTextinput.prototype,"prefix",2);r([t.n({type:String})],exports.PktTextinput.prototype,"suffix",2);r([t.n({type:Boolean})],exports.PktTextinput.prototype,"omitSearchIcon",2);r([l.r()],exports.PktTextinput.prototype,"counterCurrent",2);exports.PktTextinput=r([t.t("pkt-textinput")],exports.PktTextinput);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "15.3.1",
3
+ "version": "15.4.2",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -42,7 +42,7 @@
42
42
  "@babel/preset-env": "^7.28.3",
43
43
  "@babel/preset-typescript": "^7.25.9",
44
44
  "@oslokommune/punkt-assets": "^15.0.0",
45
- "@oslokommune/punkt-css": "^15.3.1",
45
+ "@oslokommune/punkt-css": "^15.4.2",
46
46
  "@testing-library/jest-dom": "^6.6.3",
47
47
  "@typescript-eslint/eslint-plugin": "^8.46.0",
48
48
  "@typescript-eslint/parser": "^8.46.0",
@@ -79,5 +79,5 @@
79
79
  "url": "https://github.com/oslokommune/punkt/issues"
80
80
  },
81
81
  "license": "MIT",
82
- "gitHead": "b4500307b2fb41eb76b25433aec3d99ec66f27e2"
82
+ "gitHead": "1186b7601af17e09107f3f8e55410af0fea62248"
83
83
  }
@@ -1,34 +0,0 @@
1
- "use strict";const e=require("./element-aUzIoa1s.cjs"),u=require("./class-map-CApIYSRo.cjs"),h=require("./pkt-slot-controller-D4nKlom5.cjs"),m=require("./ref-C5iJMIE1.cjs"),f=require("./if-defined-BElHLTlB.cjs");var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,d=(t,i,n,r)=>{for(var o=r>1?void 0:r?k(i,n):i,c=t.length-1,a;c>=0;c--)(a=t[c])&&(o=(r?a(i,n,o):a(o))||o);return r&&o&&y(i,n,o),o};let p=class extends e.i{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const i=(t=this.renderRoot)==null?void 0:t.querySelector("slot");i&&i.assignedElements().forEach(r=>{r.tagName.toLowerCase()==="pkt-accordion-item"&&(r.hasAttribute("name")||r.setAttribute("name",this.name))})}}firstUpdated(){var i;const t=(i=this.renderRoot)==null?void 0:i.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e.x`
2
- <div
3
- part="container"
4
- class=${u.e(t)}
5
- data-testid="pkt-accordion"
6
- aria-labelledby=${this.ariaLabelledBy}
7
- >
8
- <slot></slot>
9
- </div>
10
- `}};d([e.n({type:String,reflect:!0,attribute:"aria-labelledby"})],p.prototype,"ariaLabelledBy",2);d([e.n({type:Boolean,reflect:!0,attribute:"compact"})],p.prototype,"compact",2);d([e.n({type:String,reflect:!0,attribute:"skin"})],p.prototype,"skin",2);d([e.n({type:String,reflect:!0,attribute:"name"})],p.prototype,"name",2);p=d([e.t("pkt-accordion")],p);const _=p;var v=Object.defineProperty,$=Object.getOwnPropertyDescriptor,l=(t,i,n,r)=>{for(var o=r>1?void 0:r?$(i,n):i,c=t.length-1,a;c>=0;c--)(a=t[c])&&(o=(r?a(i,n,o):a(o))||o);return r&&o&&v(i,n,o),o};let s=class extends e.PktElement{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=m.e(),this.defaultSlot=m.e(),this.slotController=new h.PktSlotController(this,this.defaultSlot)}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return e.x`
11
- <details
12
- class=${u.e(t)}
13
- id=${this.id}
14
- ?open=${this.isOpen}
15
- ${m.n(this.accordionItemRef)}
16
- name=${f.o(this.name)}
17
- >
18
- <summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
19
- ${this.title}
20
- <pkt-icon
21
- name="chevron-thin-down"
22
- class="pkt-accordion-item__icon"
23
- aria-hidden="true"
24
- ></pkt-icon>
25
- </summary>
26
- <div
27
- class="pkt-accordion-item__content"
28
- id="pkt-accordion-item__content-${this.id}"
29
- role="region"
30
- >
31
- <div class="pkt-accordion-item__content-inner" ${m.n(this.defaultSlot)}></div>
32
- </div>
33
- </details>
34
- `}};l([e.n({type:Boolean})],s.prototype,"defaultOpen",2);l([e.n({type:String})],s.prototype,"title",2);l([e.n({type:String,reflect:!0})],s.prototype,"skin",2);l([e.n({type:Boolean,reflect:!0})],s.prototype,"compact",2);l([e.n({type:Boolean,reflect:!0})],s.prototype,"isOpen",2);l([e.n({type:String,reflect:!0})],s.prototype,"name",2);s=l([e.t("pkt-accordion-item")],s);const b=s;exports.PktAccordion=_;exports.PktAccordionItem=b;
@@ -1,5 +0,0 @@
1
- "use strict";const a=require("./element-aUzIoa1s.cjs"),r=require("./directive-C7oCP5Bh.cjs");/**
2
- * @license
3
- * Copyright 2018 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const c=r.e(class extends r.i{constructor(s){var e;if(super(s),s.type!==r.t.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter((e=>s[e])).join(" ")+" "}update(s,[e]){var i,o;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>t!==""))));for(const t in e)e[t]&&!((i=this.nt)!=null&&i.has(t))&&this.st.add(t);return this.render(e)}const n=s.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const h=!!e[t];h===this.st.has(t)||(o=this.nt)!=null&&o.has(t)||(h?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return a.T}});exports.e=c;
@@ -1,38 +0,0 @@
1
- import { Z as m } from "./element-BXsf_NlG.js";
2
- /**
3
- * @license
4
- * Copyright 2020 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- const { I: l } = m, p = (e) => e.strings === void 0, d = () => document.createComment(""), B = (e, i, t) => {
8
- var o;
9
- const s = e._$AA.parentNode, $ = i === void 0 ? e._$AB : i._$AA;
10
- if (t === void 0) {
11
- const r = s.insertBefore(d(), $), _ = s.insertBefore(d(), $);
12
- t = new l(r, _, e, e.options);
13
- } else {
14
- const r = t._$AB.nextSibling, _ = t._$AM, f = _ !== e;
15
- if (f) {
16
- let A;
17
- (o = t._$AQ) == null || o.call(t, e), t._$AM = e, t._$AP !== void 0 && (A = e._$AU) !== _._$AU && t._$AP(A);
18
- }
19
- if (r !== $ || f) {
20
- let A = t._$AA;
21
- for (; A !== r; ) {
22
- const c = A.nextSibling;
23
- s.insertBefore(A, $), A = c;
24
- }
25
- }
26
- }
27
- return t;
28
- }, a = (e, i, t = e) => (e._$AI(i, t), e), n = {}, g = (e, i = n) => e._$AH = i, u = (e) => e._$AH, x = (e) => {
29
- e._$AR(), e._$AA.remove();
30
- };
31
- export {
32
- x as M,
33
- p as f,
34
- g as m,
35
- u as p,
36
- B as s,
37
- a as v
38
- };
@@ -1,5 +0,0 @@
1
- "use strict";const n=require("./element-aUzIoa1s.cjs");/**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const{I:l}=n.Z,m=e=>e.strings===void 0,f=()=>document.createComment(""),v=(e,i,t)=>{var o;const _=e._$AA.parentNode,$=i===void 0?e._$AB:i._$AA;if(t===void 0){const r=_.insertBefore(f(),$),s=_.insertBefore(f(),$);t=new l(r,s,e,e.options)}else{const r=t._$AB.nextSibling,s=t._$AM,c=s!==e;if(c){let A;(o=t._$AQ)==null||o.call(t,e),t._$AM=e,t._$AP!==void 0&&(A=e._$AU)!==s._$AU&&t._$AP(A)}if(r!==$||c){let A=t._$AA;for(;A!==r;){const d=A.nextSibling;_.insertBefore(A,$),A=d}}}return t},u=(e,i,t=e)=>(e._$AI(i,t),e),B={},p=(e,i=B)=>e._$AH=i,M=e=>e._$AH,g=e=>{e._$AR(),e._$AA.remove()};exports.M=g;exports.f=m;exports.m=p;exports.p=M;exports.s=v;exports.v=u;
@@ -1,27 +0,0 @@
1
- "use strict";/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const C=globalThis,H=C.trustedTypes,J=H?H.createPolicy("lit-html",{createHTML:r=>r}):void 0,it="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,rt="?"+_,ct=`<${rt}>`,y=document,U=()=>y.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",B=Array.isArray,dt=r=>B(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",L=`[
6
- \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,Z=/>/g,g=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,G=/"/g,nt=/^(?:script|style|textarea|title)$/i,pt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ut=pt(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Q=new WeakMap,m=y.createTreeWalker(y,129);function ot(r,t){if(!B(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return J!==void 0?J.createHTML(t):t}const $t=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",o=P;for(let a=0;a<e;a++){const h=r[a];let c,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===P?p[1]==="!--"?o=W:p[1]!==void 0?o=Z:p[2]!==void 0?(nt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=g):p[3]!==void 0&&(o=g):o===g?p[0]===">"?(o=i??P,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?g:p[3]==='"'?G:K):o===G||o===K?o=g:o===W||o===Z?o=P:(o=g,i=void 0);const $=o===g&&r[a+1].startsWith("/>")?" ":"";n+=o===P?h+ct:l>=0?(s.push(c),h.slice(0,l)+it+h.slice(l)+_+$):h+_+(l===-2?a:$)}return[ot(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class M{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const a=t.length-1,h=this.parts,[c,p]=$t(t,e);if(this.el=M.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=m.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(it)){const u=p[o++],$=i.getAttribute(l).split(_),T=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:T[2],strings:$,ctor:T[1]==="."?ft:T[1]==="?"?gt:T[1]==="@"?mt:R}),i.removeAttribute(l)}else l.startsWith(_)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(nt.test(i.tagName)){const l=i.textContent.split(_),u=l.length-1;if(u>0){i.textContent=H?H.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],U()),m.nextNode(),h.push({type:2,index:++n});i.append(l[u],U())}}}else if(i.nodeType===8)if(i.data===rt)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)h.push({type:7,index:n}),l+=_.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}}function b(r,t,e=r,s){var o,a;if(t===v)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=b(r,i._$AS(r,t.values),i,s)),t}class _t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??y).importNode(e,!0);m.currentNode=i;let n=m.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new w(n,n.nextSibling,this,t):h.type===1?c=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(c=new At(n,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=m.nextNode(),o++)}return m.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=b(this,t,e),O(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):dt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=M.createElement(ot(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const o=new _t(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Q.get(t.strings);return e===void 0&&Q.set(t.strings,e=new M(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new w(this.O(U()),this.O(U()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=b(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const a=t;let h,c;for(t=n[0],h=0;h<n.length-1;h++)c=b(this,a[s+h],e,h),c===v&&(c=this._$AH[h]),o||(o=!O(c)||c!==this._$AH[h]),c===d?t=d:t!==d&&(t+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ft extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class gt extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class mt extends R{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=b(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){b(this,t)}}const yt={I:w},j=C.litHtmlPolyfillSupport;j==null||j(M,w),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.1");const vt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new w(t.insertBefore(U(),n),n,void 0,e??{})}return i._$AI(r),i};/**
8
- * @license
9
- * Copyright 2017 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- */const Et=r=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(r,t)})):customElements.define(r,t)};/**
12
- * @license
13
- * Copyright 2019 Google LLC
14
- * SPDX-License-Identifier: BSD-3-Clause
15
- */const k=globalThis,F=k.ShadowRoot&&(k.ShadyCSS===void 0||k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),X=new WeakMap;let St=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(F&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&X.set(e,t))}return t}toString(){return this.cssText}};const bt=r=>new St(typeof r=="string"?r:r+"",void 0,ht),wt=(r,t)=>{if(F)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=k.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},Y=F?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return bt(e)})(r):r;/**
16
- * @license
17
- * Copyright 2017 Google LLC
18
- * SPDX-License-Identifier: BSD-3-Clause
19
- */const{is:Pt,defineProperty:Ct,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Ut,getOwnPropertySymbols:Ot,getPrototypeOf:Mt}=Object,f=globalThis,tt=f.trustedTypes,Tt=tt?tt.emptyScript:"",z=f.reactiveElementPolyfillSupport,x=(r,t)=>r,N={toAttribute(r,t){switch(t){case Boolean:r=r?Tt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},q=(r,t)=>!Pt(r,t),et={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=et){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ct(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=xt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);n==null||n.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??et}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,s=[...Ut(e),...Ot(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Y(i))}else t!==void 0&&e.push(Y(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:N).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var n,o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const a=s.getPropertyOptions(i),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:N;this._$Em=i;const c=h.fromAttribute(e,a.type);this[i]=c??((o=this._$Ej)==null?void 0:o.get(i))??c,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,o=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??q)(o,e)||s.useDefault&&s.reflect&&o===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,o]of i){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[x("elementProperties")]=new Map,E[x("finalized")]=new Map,z==null||z({ReactiveElement:E}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.1.1");/**
20
- * @license
21
- * Copyright 2017 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- */const kt={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:q},Ht=(r=kt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(e.name,r),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,r)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,r)}}throw Error("Unsupported decorator location: "+s)};function V(r){return(t,e)=>typeof e=="object"?Ht(r,t,e):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(r,t,e)}/**
24
- * @license
25
- * Copyright 2017 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- */const A=globalThis;class S extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=vt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var st;S._$litElement$=!0,S.finalized=!0,(st=A.litElementHydrateSupport)==null||st.call(A,{LitElement:S});const I=A.litElementPolyfillSupport;I==null||I({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.1");const Nt={hi:"Hei!"},Rt={from:"Fra",to:"Til"},Dt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Lt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},jt={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},at={example:Nt,generic:Rt,calendar:Dt,dates:Lt,forms:jt};var zt=Object.defineProperty,lt=(r,t,e,s)=>{for(var i=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(i=o(t,e,i)||i);return i&&zt(t,e,i),i};class D extends S{constructor(){super(...arguments),this.strings=at,this.role=null}hotReplacedCallback(){this.requestUpdate()}}lt([V({type:Object})],D.prototype,"strings");lt([V({type:String})],D.prototype,"role");class It extends D{createRenderRoot(){return this}}exports.E=d;exports.PktElement=It;exports.PktShadowElement=D;exports.T=v;exports.Z=yt;exports.i=S;exports.n=V;exports.strings=at;exports.t=Et;exports.x=ut;
@@ -1,5 +0,0 @@
1
- "use strict";const t=require("./element-aUzIoa1s.cjs");/**
2
- * @license
3
- * Copyright 2018 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const o=e=>e??t.E;exports.o=o;
@@ -1,61 +0,0 @@
1
- import { T as A } from "./element-BXsf_NlG.js";
2
- import { e as M, i as b, t as j } from "./directive-oAbCiebi.js";
3
- import { p as C, v as h, s as v, M as x, m as D } from "./directive-helpers-CQef4qUQ.js";
4
- /**
5
- * @license
6
- * Copyright 2017 Google LLC
7
- * SPDX-License-Identifier: BSD-3-Clause
8
- */
9
- const w = (s, c, a) => {
10
- const p = /* @__PURE__ */ new Map();
11
- for (let e = c; e <= a; e++) p.set(s[e], e);
12
- return p;
13
- }, L = M(class extends b {
14
- constructor(s) {
15
- if (super(s), s.type !== j.CHILD) throw Error("repeat() can only be used in text expressions");
16
- }
17
- dt(s, c, a) {
18
- let p;
19
- a === void 0 ? a = c : c !== void 0 && (p = c);
20
- const e = [], i = [];
21
- let l = 0;
22
- for (const u of s) e[l] = p ? p(u, l) : l, i[l] = a(u, l), l++;
23
- return { values: i, keys: e };
24
- }
25
- render(s, c, a) {
26
- return this.dt(s, c, a).values;
27
- }
28
- update(s, [c, a, p]) {
29
- const e = C(s), { values: i, keys: l } = this.dt(c, a, p);
30
- if (!Array.isArray(e)) return this.ut = l, i;
31
- const u = this.ut ?? (this.ut = []), f = [];
32
- let m, g, t = 0, o = e.length - 1, r = 0, n = i.length - 1;
33
- for (; t <= o && r <= n; ) if (e[t] === null) t++;
34
- else if (e[o] === null) o--;
35
- else if (u[t] === l[r]) f[r] = h(e[t], i[r]), t++, r++;
36
- else if (u[o] === l[n]) f[n] = h(e[o], i[n]), o--, n--;
37
- else if (u[t] === l[n]) f[n] = h(e[t], i[n]), v(s, f[n + 1], e[t]), t++, n--;
38
- else if (u[o] === l[r]) f[r] = h(e[o], i[r]), v(s, e[t], e[o]), o--, r++;
39
- else if (m === void 0 && (m = w(l, r, n), g = w(u, t, o)), m.has(u[t])) if (m.has(u[o])) {
40
- const d = g.get(l[r]), y = d !== void 0 ? e[d] : null;
41
- if (y === null) {
42
- const k = v(s, e[t]);
43
- h(k, i[r]), f[r] = k;
44
- } else f[r] = h(y, i[r]), v(s, e[t], y), e[d] = null;
45
- r++;
46
- } else x(e[o]), o--;
47
- else x(e[t]), t++;
48
- for (; r <= n; ) {
49
- const d = v(s, f[n + 1]);
50
- h(d, i[r]), f[r++] = d;
51
- }
52
- for (; t <= o; ) {
53
- const d = e[t++];
54
- d !== null && x(d);
55
- }
56
- return this.ut = l, D(s, f), A;
57
- }
58
- });
59
- export {
60
- L as c
61
- };
@@ -1,5 +0,0 @@
1
- "use strict";const m=require("./element-aUzIoa1s.cjs"),x=require("./directive-C7oCP5Bh.cjs"),r=require("./directive-helpers-CYIEJ8pI.cjs");/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const k=(l,v,d)=>{const h=new Map;for(let e=v;e<=d;e++)h.set(l[e],e);return h},q=x.e(class extends x.i{constructor(l){if(super(l),l.type!==x.t.CHILD)throw Error("repeat() can only be used in text expressions")}dt(l,v,d){let h;d===void 0?d=v:v!==void 0&&(h=v);const e=[],u=[];let n=0;for(const c of l)e[n]=h?h(c,n):n,u[n]=d(c,n),n++;return{values:u,keys:e}}render(l,v,d){return this.dt(l,v,d).values}update(l,[v,d,h]){const e=r.p(l),{values:u,keys:n}=this.dt(v,d,h);if(!Array.isArray(e))return this.ut=n,u;const c=this.ut??(this.ut=[]),f=[];let p,M,t=0,i=e.length-1,s=0,o=u.length-1;for(;t<=i&&s<=o;)if(e[t]===null)t++;else if(e[i]===null)i--;else if(c[t]===n[s])f[s]=r.v(e[t],u[s]),t++,s++;else if(c[i]===n[o])f[o]=r.v(e[i],u[o]),i--,o--;else if(c[t]===n[o])f[o]=r.v(e[t],u[o]),r.s(l,f[o+1],e[t]),t++,o--;else if(c[i]===n[s])f[s]=r.v(e[i],u[s]),r.s(l,e[t],e[i]),i--,s++;else if(p===void 0&&(p=k(n,s,o),M=k(c,t,i)),p.has(c[t]))if(p.has(c[i])){const a=M.get(n[s]),y=a!==void 0?e[a]:null;if(y===null){const g=r.s(l,e[t]);r.v(g,u[s]),f[s]=g}else f[s]=r.v(y,u[s]),r.s(l,e[t],y),e[a]=null;s++}else r.M(e[i]),i--;else r.M(e[t]),t++;for(;s<=o;){const a=r.s(l,f[o+1]);r.v(a,u[s]),f[s++]=a}for(;t<=i;){const a=e[t++];a!==null&&r.M(a)}return this.ut=n,r.m(l,f),m.T}});exports.c=q;
@@ -1,65 +0,0 @@
1
- "use strict";const a=require("./element-aUzIoa1s.cjs"),g=require("./pkt-slot-controller-D4nKlom5.cjs"),v=require("./state-GDzxl12x.cjs"),p=require("./ref-C5iJMIE1.cjs"),u=require("./if-defined-BElHLTlB.cjs");/**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */let C=class extends Event{constructor(t,s,i,e){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s,this.callback=i,this.subscribe=e??!1}};/**
6
- * @license
7
- * Copyright 2021 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- *//**
10
- * @license
11
- * Copyright 2021 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */let k=class{constructor(t,s,i,e){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,r)),this.unsubscribe=r},this.host=t,s.context!==void 0){const n=s;this.context=n.context,this.callback=n.callback,this.subscribe=n.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=e??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new C(this.context,this.host,this.t,this.subscribe))}};/**
14
- * @license
15
- * Copyright 2021 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */class ${get value(){return this.o}set value(t){this.setValue(t)}setValue(t,s=!1){const i=s||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:i}]of this.subscriptions)s(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,s,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:s});const{disposer:e}=this.subscriptions.get(t);t(this.value,e)}clearCallbacks(){this.subscriptions.clear()}}/**
18
- * @license
19
- * Copyright 2021 Google LLC
20
- * SPDX-License-Identifier: BSD-3-Clause
21
- */let m=class extends Event{constructor(t,s){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}};class w extends ${constructor(t,s,i){var e,n;super(s.context!==void 0?s.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const c=r.contextTarget??r.composedPath()[0];c!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,c,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const c=new Set;for(const[f,{consumerHost:x}]of this.subscriptions)c.has(f)||(c.add(f),x.dispatchEvent(new C(this.context,x,f,!0)));r.stopPropagation()},this.host=t,s.context!==void 0?this.context=s.context:this.context=s,this.attachListeners(),(n=(e=this.host).addController)==null||n.call(e,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new m(this.context,this.host))}}/**
22
- * @license
23
- * Copyright 2017 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */function P({context:o}){return(t,s)=>{const i=new WeakMap;if(typeof s=="object")return{get(){return t.get.call(this)},set(e){return i.get(this).setValue(e),t.set.call(this,e)},init(e){return i.set(this,new w(this,{context:o,initialValue:e})),e}};{t.constructor.addInitializer((r=>{i.set(r,new w(r,{context:o}))}));const e=Object.getOwnPropertyDescriptor(t,s);let n;if(e===void 0){const r=new WeakMap;n={get(){return r.get(this)},set(c){i.get(this).setValue(c),r.set(this,c)},configurable:!0,enumerable:!0}}else{const r=e.set;n={...e,set(c){i.get(this).setValue(c),r==null||r.call(this,c)}}}return void Object.defineProperty(t,s,n)}}}/**
26
- * @license
27
- * Copyright 2022 Google LLC
28
- * SPDX-License-Identifier: BSD-3-Clause
29
- */function S({context:o,subscribe:t}){return(s,i)=>{typeof i=="object"?i.addInitializer((function(){new k(this,{context:o,callback:e=>{s.set.call(this,e)},subscribe:t})})):s.constructor.addInitializer((e=>{new k(e,{context:o,callback:n=>{e[i]=n},subscribe:t})}))}}const y=Symbol("pkt-tabs-context");var N=Object.defineProperty,_=Object.getOwnPropertyDescriptor,d=(o,t,s,i)=>{for(var e=i>1?void 0:i?_(t,s):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(e=(i?r(t,s,e):r(e))||e);return i&&e&&N(t,s,e),e};let b=class extends a.PktElement{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=p.e(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new g.PktSlotController(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(o){(o.has("arrowNav")||o.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(o,t){this.tabRefs[t]=o,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(o){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:o},bubbles:!0,composed:!0}))}handleKeyUp(o,t){var s,i;this.useArrowNav&&(o.code==="ArrowLeft"&&t!==0&&((s=this.tabRefs[t-1])==null||s.focus()),o.code==="ArrowRight"&&t<this.tabCount-1&&((i=this.tabRefs[t+1])==null||i.focus()),(o.code==="ArrowDown"||o.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const o=this.useArrowNav?"tablist":"navigation";return a.x`
30
- <div class="pkt-tabs">
31
- <div class="pkt-tabs__list" role=${o} ${p.n(this.defaultSlot)}></div>
32
- </div>
33
- `}};d([a.n({type:Boolean,reflect:!0,attribute:"arrow-nav"})],b.prototype,"arrowNav",2);d([a.n({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],b.prototype,"disableArrowNav",2);d([v.r()],b.prototype,"tabRefs",2);d([v.r()],b.prototype,"tabCount",2);d([P({context:y}),v.r()],b.prototype,"context",2);b=d([a.t("pkt-tabs")],b);const R=b;var A=Object.defineProperty,q=Object.getOwnPropertyDescriptor,l=(o,t,s,i)=>{for(var e=i>1?void 0:i?q(t,s):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(e=(i?r(t,s,e):r(e))||e);return i&&e&&A(t,s,e),e};let h=class extends a.PktElement{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=p.e(),this.defaultSlot=p.e(),this.slotController=new g.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(o){this.context&&this.context.handleKeyUp(o,this.index)}render(){var r;const o=((r=this.context)==null?void 0:r.useArrowNav)??!0,t=this.active?"active":"",s=o?"tab":void 0,i=o?this.active:void 0,e=this.active||!o?void 0:-1,n=a.x`
34
- ${this.icon?a.x`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
35
- <span ${p.n(this.defaultSlot)}></span>
36
- ${this.tag?a.x`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
37
- `;return this.href?a.x`
38
- <a
39
- ${p.n(this.elementRef)}
40
- href=${this.href}
41
- class="pkt-tabs__link ${t}"
42
- role=${u.o(s)}
43
- aria-selected=${u.o(i)}
44
- aria-controls=${u.o(this.controls||void 0)}
45
- tabindex=${u.o(e)}
46
- @click=${this.handleClick}
47
- @keyup=${this.handleKeyUp}
48
- >
49
- ${n}
50
- </a>
51
- `:a.x`
52
- <button
53
- ${p.n(this.elementRef)}
54
- type="button"
55
- class="pkt-tabs__button pkt-link-button ${t}"
56
- role=${u.o(s)}
57
- aria-selected=${u.o(i)}
58
- aria-controls=${u.o(this.controls||void 0)}
59
- tabindex=${u.o(e)}
60
- @click=${this.handleClick}
61
- @keyup=${this.handleKeyUp}
62
- >
63
- ${n}
64
- </button>
65
- `}};l([a.n({type:Boolean,reflect:!0})],h.prototype,"active",2);l([a.n({type:String,reflect:!0})],h.prototype,"href",2);l([a.n({type:String,reflect:!0})],h.prototype,"icon",2);l([a.n({type:String,reflect:!0})],h.prototype,"controls",2);l([a.n({type:String,reflect:!0})],h.prototype,"tag",2);l([a.n({type:String,reflect:!0,attribute:"tag-skin"})],h.prototype,"tagSkin",2);l([a.n({type:Number,reflect:!0})],h.prototype,"index",2);l([S({context:y,subscribe:!0}),a.n({attribute:!1})],h.prototype,"context",2);h=l([a.t("pkt-tab-item")],h);const O=h;exports.PktTabItem=O;exports.PktTabs=R;