@oslokommune/punkt-elements 12.31.2 → 12.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/{alert-BDxxRqgi.cjs → alert-D5G5UJuo.cjs} +1 -1
  2. package/dist/{alert-D0S57u0r.js → alert-gERpVuB7.js} +6 -6
  3. package/dist/alert.d.ts +32 -0
  4. package/dist/{backlink-CzpB-ih9.js → backlink-DdNgqA56.js} +2 -2
  5. package/dist/{backlink-Dn4DfWVR.cjs → backlink-Q2HTG9jm.cjs} +1 -1
  6. package/dist/backlink.d.ts +32 -0
  7. package/dist/{button-Beo3c7cx.cjs → button-BPyZeW73.cjs} +1 -1
  8. package/dist/{button-9NwGr-OS.js → button-rArIL0-j.js} +3 -3
  9. package/dist/button.d.ts +32 -0
  10. package/dist/{calendar-BbZNxsKY.js → calendar-1ryAEdX3.js} +4 -4
  11. package/dist/{calendar-CxBo98iI.cjs → calendar-2DqPLXdD.cjs} +1 -1
  12. package/dist/calendar.d.ts +32 -0
  13. package/dist/{card-DQfNKnKl.js → card-BbMBpvJt.js} +7 -7
  14. package/dist/{card-C63x_nll.cjs → card-ZX09f_ka.cjs} +1 -1
  15. package/dist/card.d.ts +32 -0
  16. package/dist/{checkbox-9Zjy_NU7.cjs → checkbox-BnDG6wIO.cjs} +1 -1
  17. package/dist/{checkbox-CzDpR6_8.js → checkbox-Ceui2TLp.js} +4 -4
  18. package/dist/checkbox.d.ts +32 -0
  19. package/dist/{class-map-DWtqmIRS.js → class-map-ChuDQU5C.js} +1 -1
  20. package/dist/{class-map-Dj5mbCUg.cjs → class-map-D4rXyUxT.cjs} +1 -1
  21. package/dist/combobox-DH-YlbNh.cjs +115 -0
  22. package/dist/combobox-DbO6I0GT.js +694 -0
  23. package/dist/combobox.d.ts +47 -0
  24. package/dist/{datepicker-CYUvRGhE.js → datepicker-8MOgQsyL.js} +144 -196
  25. package/dist/datepicker-BRH-59Q9.cjs +153 -0
  26. package/dist/datepicker.d.ts +32 -0
  27. package/dist/directive-helpers-D7XIyCQ_.js +45 -0
  28. package/dist/directive-helpers-mGjAtADc.cjs +5 -0
  29. package/dist/{element-CzFXQBoS.cjs → element-BBo3JZk5.cjs} +1 -1
  30. package/dist/{element-C7XjZtLU.js → element-G8JoS0Lj.js} +6 -0
  31. package/dist/{helptext-B9kxDc2b.cjs → helptext-B4Uc-d56.cjs} +2 -2
  32. package/dist/{helptext-CqnoPodd.js → helptext-Y4cSgTkd.js} +10 -10
  33. package/dist/helptext.d.ts +32 -0
  34. package/dist/{icon-BEUgV9Wo.js → icon-BJnwW0eh.js} +1 -1
  35. package/dist/{icon-BOKusjAA.cjs → icon-BTUCDPN5.cjs} +1 -1
  36. package/dist/icon.d.ts +32 -0
  37. package/dist/{if-defined-CpIkv1A4.cjs → if-defined-C1ZDVzYn.cjs} +1 -1
  38. package/dist/{if-defined-eRX4e5zO.js → if-defined-rCqT8Od1.js} +1 -1
  39. package/dist/index.d.ts +208 -14
  40. package/dist/input-element-AhnBdCb8.cjs +1 -0
  41. package/dist/{input-element-BK8UkQli.js → input-element-DM2uSYaW.js} +22 -19
  42. package/dist/input-wrapper-BdZxmQyO.cjs +52 -0
  43. package/dist/input-wrapper-DQmYzhcy.js +185 -0
  44. package/dist/input-wrapper.d.ts +32 -0
  45. package/dist/{link-D3U0Jkz8.js → link-C3lW3z8X.js} +5 -5
  46. package/dist/{link-1iq0Pmuf.cjs → link-DOVlsg2S.cjs} +1 -1
  47. package/dist/link.d.ts +32 -0
  48. package/dist/{linkcard-CRpo3tiw.js → linkcard-CvqqyHVW.js} +4 -4
  49. package/dist/{linkcard-2WzDJPZz.cjs → linkcard-DDD92XfD.cjs} +1 -1
  50. package/dist/linkcard.d.ts +32 -0
  51. package/dist/listbox-BTVnrHWv.cjs +95 -0
  52. package/dist/listbox-DX-Euxdm.js +360 -0
  53. package/dist/listbox.d.ts +47 -0
  54. package/dist/{loader-B1edLWTg.js → loader-BudoV0yd.js} +6 -6
  55. package/dist/{loader-DI74pe25.cjs → loader-Csq0Yd1k.cjs} +1 -1
  56. package/dist/loader.d.ts +32 -0
  57. package/dist/{messagebox-DQpEMkS2.cjs → messagebox-8GwnNqb0.cjs} +1 -1
  58. package/dist/{messagebox-KP-8-tA9.js → messagebox-D6uexEhg.js} +6 -6
  59. package/dist/messagebox.d.ts +32 -0
  60. package/dist/{modal-ytIJwfr3.cjs → modal-CLixB4Dz.cjs} +1 -1
  61. package/dist/{modal-kPX8nO_L.js → modal-DnYn2Rlg.js} +6 -6
  62. package/dist/modal.d.ts +32 -0
  63. package/dist/pkt-alert.cjs +1 -1
  64. package/dist/pkt-alert.js +1 -1
  65. package/dist/pkt-backlink.cjs +1 -1
  66. package/dist/pkt-backlink.js +1 -1
  67. package/dist/pkt-button.cjs +1 -1
  68. package/dist/pkt-button.js +1 -1
  69. package/dist/pkt-calendar.cjs +1 -1
  70. package/dist/pkt-calendar.js +1 -1
  71. package/dist/pkt-card.cjs +1 -1
  72. package/dist/pkt-card.js +1 -1
  73. package/dist/pkt-checkbox.cjs +1 -1
  74. package/dist/pkt-checkbox.js +1 -1
  75. package/dist/pkt-combobox.cjs +1 -0
  76. package/dist/pkt-combobox.js +6 -0
  77. package/dist/pkt-datepicker.cjs +1 -1
  78. package/dist/pkt-datepicker.js +1 -1
  79. package/dist/pkt-helptext.cjs +1 -1
  80. package/dist/pkt-helptext.js +1 -1
  81. package/dist/pkt-icon.cjs +1 -1
  82. package/dist/pkt-icon.js +1 -1
  83. package/dist/pkt-index.cjs +3 -3
  84. package/dist/pkt-index.js +45 -43
  85. package/dist/pkt-input-wrapper.cjs +1 -1
  86. package/dist/pkt-input-wrapper.js +1 -1
  87. package/dist/pkt-link.cjs +1 -1
  88. package/dist/pkt-link.js +1 -1
  89. package/dist/pkt-linkcard.cjs +1 -1
  90. package/dist/pkt-linkcard.js +1 -1
  91. package/dist/pkt-listbox.cjs +1 -0
  92. package/dist/pkt-listbox.js +6 -0
  93. package/dist/pkt-loader.cjs +1 -1
  94. package/dist/pkt-loader.js +1 -1
  95. package/dist/pkt-messagebox.cjs +1 -1
  96. package/dist/pkt-messagebox.js +1 -1
  97. package/dist/pkt-modal.cjs +1 -1
  98. package/dist/pkt-modal.js +1 -1
  99. package/dist/pkt-options-controller-BtU1zEtG.cjs +1 -0
  100. package/dist/pkt-options-controller-CZplGTgu.js +38 -0
  101. package/dist/pkt-progressbar.cjs +1 -1
  102. package/dist/pkt-progressbar.js +2 -2
  103. package/dist/pkt-radiobutton.cjs +1 -1
  104. package/dist/pkt-radiobutton.js +1 -1
  105. package/dist/pkt-select.cjs +1 -1
  106. package/dist/pkt-select.js +1 -1
  107. package/dist/pkt-slot-controller-CqNvEpFd.cjs +1 -0
  108. package/dist/{pkt-slot-controller-Clbye6cM.js → pkt-slot-controller-D1DakVrU.js} +17 -7
  109. package/dist/pkt-tag.cjs +1 -1
  110. package/dist/pkt-tag.js +1 -1
  111. package/dist/pkt-textarea.cjs +1 -1
  112. package/dist/pkt-textarea.js +1 -1
  113. package/dist/pkt-textinput.cjs +1 -1
  114. package/dist/pkt-textinput.js +1 -1
  115. package/dist/{progressbar-B6A9UVXS.cjs → progressbar-BW_icNId.cjs} +1 -1
  116. package/dist/{progressbar-D0nxLqHu.js → progressbar-czvExwTL.js} +5 -5
  117. package/dist/progressbar.d.ts +32 -0
  118. package/dist/{radiobutton-BWyQgR_x.cjs → radiobutton-BeSuCrbp.cjs} +1 -1
  119. package/dist/{radiobutton-DLWjvLBO.js → radiobutton-DKo27Stm.js} +5 -5
  120. package/dist/radiobutton.d.ts +32 -0
  121. package/dist/ref-DsoUUoPU.cjs +9 -0
  122. package/dist/ref-cRTOoM4R.js +102 -0
  123. package/dist/repeat-CArTw6-s.js +61 -0
  124. package/dist/repeat-kruY8poV.cjs +5 -0
  125. package/dist/select-DxHhPEgD.js +118 -0
  126. package/dist/select-lvFnhEVg.cjs +49 -0
  127. package/dist/select.d.ts +32 -0
  128. package/dist/{state-HNj0_316.cjs → state-BILlRnrD.cjs} +1 -1
  129. package/dist/{state-CDQk0DFQ.js → state-gfUuUqVg.js} +1 -1
  130. package/dist/{tag-CmFcSdOV.js → tag-CWx1XsGR.js} +7 -7
  131. package/dist/{tag-BeLSOjNh.cjs → tag-DThwKsrg.cjs} +1 -1
  132. package/dist/tag.d.ts +32 -0
  133. package/dist/{textarea-BPqWCymU.js → textarea-BNNDbxxO.js} +18 -17
  134. package/dist/{textarea-VG-UTMLP.cjs → textarea-CDsLbogK.cjs} +6 -6
  135. package/dist/textarea.d.ts +32 -0
  136. package/dist/{textinput-CEP7QA3E.cjs → textinput-C3C088Ki.cjs} +5 -4
  137. package/dist/{textinput-VD74aGzx.js → textinput-M8I4dfoP.js} +25 -24
  138. package/dist/textinput.d.ts +32 -0
  139. package/package.json +3 -3
  140. package/src/components/combobox/combobox.ts +873 -0
  141. package/src/components/combobox/countrycodes.json +927 -0
  142. package/src/components/combobox/index.ts +6 -0
  143. package/src/components/datepicker/datepicker.ts +2 -0
  144. package/src/components/helptext/helptext.ts +1 -1
  145. package/src/components/index.ts +7 -0
  146. package/src/components/input-wrapper/input-wrapper.ts +42 -34
  147. package/src/components/listbox/index.ts +4 -0
  148. package/src/components/listbox/listbox.ts +474 -0
  149. package/src/components/select/select.ts +7 -0
  150. package/src/components/textinput/textinput.ts +3 -2
  151. package/dist/datepicker-FuAL0uNU.cjs +0 -155
  152. package/dist/input-element-Dtyuf6s8.cjs +0 -1
  153. package/dist/input-wrapper-Bo2_t6pA.cjs +0 -50
  154. package/dist/input-wrapper-DaZZq8c0.js +0 -172
  155. package/dist/pkt-slot-controller-Oc32unDk.cjs +0 -1
  156. package/dist/ref-2anvRHT4.cjs +0 -13
  157. package/dist/ref-DbOSDQbk.js +0 -143
  158. package/dist/select-CzuxXKll.js +0 -150
  159. package/dist/select-DZL6aa2s.cjs +0 -48
@@ -1,8 +1,8 @@
1
- "use strict";const s=require("./element-CzFXQBoS.cjs"),p=require("./if-defined-CpIkv1A4.cjs"),d=require("./state-HNj0_316.cjs"),o=require("./ref-2anvRHT4.cjs"),c=require("./class-map-Dj5mbCUg.cjs"),a=require("./directive-C_VV3qwo.cjs"),$=require("./input-element-Dtyuf6s8.cjs"),x=require("./pkt-slot-controller-Oc32unDk.cjs");require("./input-wrapper-Bo2_t6pA.cjs");require("./icon-BOKusjAA.cjs");/**
1
+ "use strict";const s=require("./element-BBo3JZk5.cjs"),p=require("./if-defined-C1ZDVzYn.cjs"),c=require("./state-BILlRnrD.cjs"),l=require("./ref-DsoUUoPU.cjs"),$=require("./class-map-D4rXyUxT.cjs"),a=require("./directive-C_VV3qwo.cjs"),d=require("./directive-helpers-mGjAtADc.cjs"),x=require("./input-element-AhnBdCb8.cjs"),T=require("./pkt-slot-controller-CqNvEpFd.cjs");require("./input-wrapper-BdZxmQyO.cjs");require("./icon-BTUCDPN5.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
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(!o.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 o.m(r),e}});var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l=(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&&g(e,i,n),n};exports.PktTextarea=class extends $.PktInputElement{constructor(){super(),this.inputRef=o.e(),this.helptextSlot=o.e(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new x.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=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}),i=this.ariaLabelledby||`${this.id}-input-label`;return s.x`<pkt-input-wrapper
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
6
6
  label=${this.label}
7
7
  ?counter=${this.counter}
8
8
  ?disabled=${this.disabled}
@@ -24,14 +24,14 @@
24
24
  .requiredText=${this.requiredText}
25
25
  class="pkt-textarea"
26
26
  >
27
- <div class="pkt-contents" ${o.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
27
+ <div class="pkt-contents" ${l.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
28
28
  <textarea
29
- ${o.n(this.inputRef)}
29
+ ${l.n(this.inputRef)}
30
30
  class=${e}
31
31
  id=${this.id+"-input"}
32
32
  name=${(this.name||this.id)+"-input"}
33
33
  placeholder=${p.o(this.placeholder)}
34
- .value=${T(this.value)}
34
+ .value=${g(this.value)}
35
35
  minlength=${p.o(this.minlength)}
36
36
  maxlength=${p.o(this.maxlength)}
37
37
  ?readonly=${this.readonly}
@@ -46,4 +46,4 @@
46
46
  @focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
47
47
  @blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
48
48
  ></textarea>
49
- </pkt-input-wrapper>`}};l([s.n({type:String,reflect:!0})],exports.PktTextarea.prototype,"value",2);l([s.n({type:String})],exports.PktTextarea.prototype,"autocomplete",2);l([s.n({type:Number})],exports.PktTextarea.prototype,"rows",2);l([d.r()],exports.PktTextarea.prototype,"counterCurrent",2);exports.PktTextarea=l([s.t("pkt-textarea")],exports.PktTextarea);
49
+ </pkt-input-wrapper>`}};o([s.n({type:String,reflect:!0})],exports.PktTextarea.prototype,"value",2);o([s.n({type:String})],exports.PktTextarea.prototype,"autocomplete",2);o([s.n({type:Number})],exports.PktTextarea.prototype,"rows",2);o([c.r()],exports.PktTextarea.prototype,"counterCurrent",2);exports.PktTextarea=o([s.t("pkt-textarea")],exports.PktTextarea);
@@ -1,6 +1,31 @@
1
1
  export { }
2
2
 
3
3
 
4
+ /**
5
+ * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
6
+ *
7
+ * The component will prioritize options passed as a prop over options passed as children if both are provided.
8
+ * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
9
+ *
10
+ * @slot (default) - Options to be rendered as children
11
+ * @prop {TSelectOption[]} options - Options to be rendered as children
12
+ *
13
+ *
14
+ */
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'pkt-select': PktSelect & HTMLSelectElement;
18
+ }
19
+ }
20
+
21
+
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'pkt-combobox': PktCombobox & HTMLSelectElement;
25
+ }
26
+ }
27
+
28
+
4
29
  declare global {
5
30
  interface HTMLElementTagNameMap {
6
31
  'pkt-icon': PktIcon;
@@ -8,6 +33,13 @@ declare global {
8
33
  }
9
34
 
10
35
 
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ 'pkt-listbox': PktListbox;
39
+ }
40
+ }
41
+
42
+
11
43
  declare global {
12
44
  interface Window {
13
45
  pktTz: string;
@@ -1,9 +1,10 @@
1
- "use strict";const t=require("./element-CzFXQBoS.cjs"),u=require("./if-defined-CpIkv1A4.cjs"),l=require("./state-HNj0_316.cjs"),p=require("./ref-2anvRHT4.cjs"),c=require("./class-map-Dj5mbCUg.cjs"),x=require("./input-element-Dtyuf6s8.cjs"),d=require("./pkt-slot-controller-Oc32unDk.cjs");require("./input-wrapper-Bo2_t6pA.cjs");require("./icon-BOKusjAA.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(o,i,n,s)=>{for(var e=s>1?void 0:s?g(i,n):i,a=o.length-1,h;a>=0;a--)(h=o[a])&&(e=(s?h(i,n,e):h(e))||e);return s&&e&&$(i,n,e),e};exports.PktTextinput=class extends x.PktInputElement{constructor(){super(),this.inputRef=p.e(),this.helptextSlot=p.e(),this.value="",this.type="text",this.size=null,this.autocomplete="off",this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new d.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,n,s){i==="value"&&this.value!==n&&(this.counterCurrent=s?s.length:0,this.valueChanged(s,n)),super.attributeChangedCallback(i,n,s)}updated(i){var n;super.updated(i),i.has("value")&&(this.counterCurrent=((n=this.value)==null?void 0:n.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,n=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}),s=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
1
+ "use strict";const t=require("./element-BBo3JZk5.cjs"),u=require("./if-defined-C1ZDVzYn.cjs"),l=require("./state-BILlRnrD.cjs"),p=require("./ref-DsoUUoPU.cjs"),c=require("./class-map-D4rXyUxT.cjs"),d=require("./input-element-AhnBdCb8.cjs"),x=require("./pkt-slot-controller-CqNvEpFd.cjs");require("./input-wrapper-BdZxmQyO.cjs");require("./icon-BTUCDPN5.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(o,i,s,n)=>{for(var e=n>1?void 0:n?g(i,s):i,a=o.length-1,h;a>=0;a--)(h=o[a])&&(e=(n?h(i,s,e):h(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=p.e(),this.helptextSlot=p.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`
2
2
  <pkt-input-wrapper
3
3
  label="${this.label}"
4
4
  ?counter=${this.counter}
5
5
  ?disabled=${this.disabled}
6
6
  ?hasError=${this.hasError}
7
+ ?hasFieldset=${this.hasFieldset}
7
8
  ?inline=${this.inline}
8
9
  ?optionalTag=${this.optionalTag}
9
10
  ?required=${this.required}
@@ -26,13 +27,13 @@
26
27
  ${this.prefix?t.x`<div class="pkt-input-prefix">${this.prefix}</div>`:t.E}
27
28
  <input
28
29
  ${p.n(this.inputRef)}
29
- class=${n}
30
+ class=${s}
30
31
  type=${this.type}
31
32
  name=${(this.name||this.id)+"-input"}
32
33
  id=${this.id+"-input"}
33
34
  placeholder=${u.o(this.placeholder)}
34
- aria-labelledby=${s}
35
- autocomplete=${this.autocomplete}
35
+ aria-labelledby=${n}
36
+ autocomplete=${this.autocomplete||"off"}
36
37
  minlength=${u.o(this.minlength)}
37
38
  maxlength=${u.o(this.maxlength)}
38
39
  ?readonly=${this.readonly}
@@ -1,30 +1,30 @@
1
- import { x as p, E as h, n as o, a as $ } from "./element-C7XjZtLU.js";
2
- import { o as c } from "./if-defined-eRX4e5zO.js";
3
- import { r as f } from "./state-CDQk0DFQ.js";
4
- import { e as d, n as m } from "./ref-DbOSDQbk.js";
5
- import { e as g } from "./class-map-DWtqmIRS.js";
6
- import { P as x } from "./input-element-BK8UkQli.js";
7
- import { P as y } from "./pkt-slot-controller-Clbye6cM.js";
8
- import "./input-wrapper-DaZZq8c0.js";
9
- import "./icon-BEUgV9Wo.js";
10
- var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (i, e, r, t) => {
11
- for (var a = t > 1 ? void 0 : t ? b(e, r) : e, l = i.length - 1, u; l >= 0; l--)
12
- (u = i[l]) && (a = (t ? u(e, r, a) : u(a)) || a);
13
- return t && a && v(e, r, a), a;
1
+ import { x as p, E as h, n as o, a as $ } from "./element-G8JoS0Lj.js";
2
+ import { o as c } from "./if-defined-rCqT8Od1.js";
3
+ import { r as f } from "./state-gfUuUqVg.js";
4
+ import { e as d, n as m } from "./ref-cRTOoM4R.js";
5
+ import { e as g } from "./class-map-ChuDQU5C.js";
6
+ import { P as x } from "./input-element-DM2uSYaW.js";
7
+ import { P as y } from "./pkt-slot-controller-D1DakVrU.js";
8
+ import "./input-wrapper-DQmYzhcy.js";
9
+ import "./icon-BJnwW0eh.js";
10
+ var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (e, i, r, t) => {
11
+ for (var a = t > 1 ? void 0 : t ? b(i, r) : i, l = e.length - 1, u; l >= 0; l--)
12
+ (u = e[l]) && (a = (t ? u(i, r, a) : u(a)) || a);
13
+ return t && a && v(i, r, a), a;
14
14
  };
15
15
  let s = class extends x {
16
16
  constructor() {
17
- super(), this.inputRef = d(), this.helptextSlot = d(), this.value = "", this.type = "text", this.size = null, this.autocomplete = "off", this.iconNameRight = null, this.prefix = null, this.suffix = null, this.omitSearchIcon = !1, this.counterCurrent = 0, this.slotController = new y(this, this.helptextSlot);
17
+ super(), this.inputRef = d(), this.helptextSlot = d(), 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 y(this, this.helptextSlot);
18
18
  }
19
- attributeChangedCallback(i, e, r) {
20
- i === "value" && this.value !== e && (this.counterCurrent = r ? r.length : 0, this.valueChanged(r, e)), super.attributeChangedCallback(i, e, r);
19
+ attributeChangedCallback(e, i, r) {
20
+ e === "value" && this.value !== i && (this.counterCurrent = r ? r.length : 0, this.valueChanged(r, i)), super.attributeChangedCallback(e, i, r);
21
21
  }
22
- updated(i) {
23
- var e;
24
- super.updated(i), i.has("value") && (this.counterCurrent = ((e = this.value) == null ? void 0 : e.length) || 0, this.valueChanged(this.value, i.get("value"))), i.has("id") && !this.name && this.id && (this.name = this.id);
22
+ updated(e) {
23
+ var i;
24
+ 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);
25
25
  }
26
26
  render() {
27
- const i = this.type === "search" && !this.iconNameRight && !this.omitSearchIcon, e = g({
27
+ const e = this.type === "search" && !this.iconNameRight && !this.omitSearchIcon, i = g({
28
28
  "pkt-input": !0,
29
29
  "pkt-input--fullwidth": this.fullwidth,
30
30
  "pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
@@ -35,6 +35,7 @@ let s = class extends x {
35
35
  ?counter=${this.counter}
36
36
  ?disabled=${this.disabled}
37
37
  ?hasError=${this.hasError}
38
+ ?hasFieldset=${this.hasFieldset}
38
39
  ?inline=${this.inline}
39
40
  ?optionalTag=${this.optionalTag}
40
41
  ?required=${this.required}
@@ -57,13 +58,13 @@ let s = class extends x {
57
58
  ${this.prefix ? p`<div class="pkt-input-prefix">${this.prefix}</div>` : h}
58
59
  <input
59
60
  ${m(this.inputRef)}
60
- class=${e}
61
+ class=${i}
61
62
  type=${this.type}
62
63
  name=${(this.name || this.id) + "-input"}
63
64
  id=${this.id + "-input"}
64
65
  placeholder=${c(this.placeholder)}
65
66
  aria-labelledby=${r}
66
- autocomplete=${this.autocomplete}
67
+ autocomplete=${this.autocomplete || "off"}
67
68
  minlength=${c(this.minlength)}
68
69
  maxlength=${c(this.maxlength)}
69
70
  ?readonly=${this.readonly}
@@ -91,13 +92,13 @@ let s = class extends x {
91
92
  class="pkt-input-suffix-icon"
92
93
  name=${this.iconNameRight}
93
94
  ></pkt-icon>` : h}
94
- ${i ? p`<pkt-icon
95
+ ${e ? p`<pkt-icon
95
96
  class="pkt-input-suffix-icon"
96
97
  name="magnifying-glass-big"
97
98
  ></pkt-icon>` : h}
98
99
  </div>` : h}
99
100
  ${!this.suffix && this.iconNameRight ? p`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>` : h}
100
- ${!this.suffix && i ? p`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>` : h}
101
+ ${!this.suffix && e ? p`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>` : h}
101
102
  </div>
102
103
  </pkt-input-wrapper>
103
104
  `;
@@ -1,6 +1,31 @@
1
1
  export { }
2
2
 
3
3
 
4
+ /**
5
+ * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
6
+ *
7
+ * The component will prioritize options passed as a prop over options passed as children if both are provided.
8
+ * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
9
+ *
10
+ * @slot (default) - Options to be rendered as children
11
+ * @prop {TSelectOption[]} options - Options to be rendered as children
12
+ *
13
+ *
14
+ */
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'pkt-select': PktSelect & HTMLSelectElement;
18
+ }
19
+ }
20
+
21
+
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'pkt-combobox': PktCombobox & HTMLSelectElement;
25
+ }
26
+ }
27
+
28
+
4
29
  declare global {
5
30
  interface HTMLElementTagNameMap {
6
31
  'pkt-icon': PktIcon;
@@ -8,6 +33,13 @@ declare global {
8
33
  }
9
34
 
10
35
 
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ 'pkt-listbox': PktListbox;
39
+ }
40
+ }
41
+
42
+
11
43
  declare global {
12
44
  interface Window {
13
45
  pktTz: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.31.2",
3
+ "version": "12.32.0",
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",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@oslokommune/punkt-assets": "^12.30.1",
33
- "@oslokommune/punkt-css": "^12.31.0",
33
+ "@oslokommune/punkt-css": "^12.32.0",
34
34
  "sass": "^1.78.0",
35
35
  "typescript": "^5.6.2",
36
36
  "vite": "^5.4.4",
@@ -57,5 +57,5 @@
57
57
  "url": "https://github.com/oslokommune/punkt/issues"
58
58
  },
59
59
  "license": "MIT",
60
- "gitHead": "bb030d6ba98fa9e45a95cf3092d95b46a750a730"
60
+ "gitHead": "8d17b2b21d83b498b237d837747e753c64570285"
61
61
  }