@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
@@ -0,0 +1,47 @@
1
+ export { }
2
+
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
+
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'pkt-icon': PktIcon;
32
+ }
33
+ }
34
+
35
+
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ 'pkt-listbox': PktListbox;
39
+ }
40
+ }
41
+
42
+
43
+ declare global {
44
+ interface Window {
45
+ pktTz: string;
46
+ }
47
+ }
@@ -1,70 +1,16 @@
1
- import { e as x } from "./class-map-DWtqmIRS.js";
2
- import { o as k } from "./if-defined-eRX4e5zO.js";
3
- import { T as L, x as v, E as T, n as u, a as j } from "./element-C7XjZtLU.js";
4
- import { r as V } from "./state-CDQk0DFQ.js";
5
- import { n as S, f as _, a as F, b as P, d as A } from "./calendar-BbZNxsKY.js";
6
- import { P as q } from "./input-element-BK8UkQli.js";
7
- import { p as H, v as $, r as R, M as I, m as N, e as w, n as y } from "./ref-DbOSDQbk.js";
8
- import { e as U, i as K, t as W } from "./directive-B76A7YXI.js";
9
- import "./icon-BEUgV9Wo.js";
10
- import "./input-wrapper-DaZZq8c0.js";
11
- import "./tag-CmFcSdOV.js";
12
- import { P as z } from "./pkt-slot-controller-Clbye6cM.js";
13
- /**
14
- * @license
15
- * Copyright 2017 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */
18
- const E = (e, t, i) => {
19
- const a = /* @__PURE__ */ new Map();
20
- for (let s = t; s <= i; s++) a.set(e[s], s);
21
- return a;
22
- }, G = U(class extends K {
23
- constructor(e) {
24
- if (super(e), e.type !== W.CHILD) throw Error("repeat() can only be used in text expressions");
25
- }
26
- dt(e, t, i) {
27
- let a;
28
- i === void 0 ? i = t : t !== void 0 && (a = t);
29
- const s = [], l = [];
30
- let n = 0;
31
- for (const f of e) s[n] = a ? a(f, n) : n, l[n] = i(f, n), n++;
32
- return { values: l, keys: s };
33
- }
34
- render(e, t, i) {
35
- return this.dt(e, t, i).values;
36
- }
37
- update(e, [t, i, a]) {
38
- const s = H(e), { values: l, keys: n } = this.dt(t, i, a);
39
- if (!Array.isArray(s)) return this.ut = n, l;
40
- const f = this.ut ?? (this.ut = []), m = [];
41
- let C, O, p = 0, h = s.length - 1, d = 0, c = l.length - 1;
42
- for (; p <= h && d <= c; ) if (s[p] === null) p++;
43
- else if (s[h] === null) h--;
44
- else if (f[p] === n[d]) m[d] = $(s[p], l[d]), p++, d++;
45
- else if (f[h] === n[c]) m[c] = $(s[h], l[c]), h--, c--;
46
- else if (f[p] === n[c]) m[c] = $(s[p], l[c]), R(e, m[c + 1], s[p]), p++, c--;
47
- else if (f[h] === n[d]) m[d] = $(s[h], l[d]), R(e, s[p], s[h]), h--, d++;
48
- else if (C === void 0 && (C = E(n, d, c), O = E(f, p, h)), C.has(f[p])) if (C.has(f[h])) {
49
- const g = O.get(n[d]), D = g !== void 0 ? s[g] : null;
50
- if (D === null) {
51
- const M = R(e, s[p]);
52
- $(M, l[d]), m[d] = M;
53
- } else m[d] = $(D, l[d]), R(e, s[p], D), s[g] = null;
54
- d++;
55
- } else I(s[h]), h--;
56
- else I(s[p]), p++;
57
- for (; d <= c; ) {
58
- const g = R(e, m[c + 1]);
59
- $(g, l[d]), m[d++] = g;
60
- }
61
- for (; p <= h; ) {
62
- const g = s[p++];
63
- g !== null && I(g);
64
- }
65
- return this.ut = n, N(e, m), L;
66
- }
67
- }), J = "pkt-datepicker", Q = !0, X = {
1
+ import { e as m } from "./class-map-ChuDQU5C.js";
2
+ import { o as d } from "./if-defined-rCqT8Od1.js";
3
+ import { x as p, E as g, n as l, a as w } from "./element-G8JoS0Lj.js";
4
+ import { r as b } from "./state-gfUuUqVg.js";
5
+ import { n as v, f as k, a as R, b as y, d as x } from "./calendar-1ryAEdX3.js";
6
+ import { P as C } from "./input-element-DM2uSYaW.js";
7
+ import { e as f, n as h } from "./ref-cRTOoM4R.js";
8
+ import { c as T } from "./repeat-CArTw6-s.js";
9
+ import "./icon-BJnwW0eh.js";
10
+ import "./input-wrapper-DQmYzhcy.js";
11
+ import "./tag-CWx1XsGR.js";
12
+ import { P as S } from "./pkt-slot-controller-D1DakVrU.js";
13
+ const D = "pkt-datepicker", _ = !0, I = {
68
14
  name: {
69
15
  type: "string",
70
16
  name: "Navn",
@@ -233,7 +179,7 @@ const E = (e, t, i) => {
233
179
  name: "ID",
234
180
  description: "Unik identifikasjon for datovelgeren"
235
181
  }
236
- }, Y = {
182
+ }, O = {
237
183
  change: {
238
184
  type: "Event",
239
185
  description: "Returnerer valgt dato som streng i ISO-format"
@@ -246,36 +192,36 @@ const E = (e, t, i) => {
246
192
  type: "CustomEvent",
247
193
  description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
248
194
  }
249
- }, b = {
250
- name: J,
195
+ }, c = {
196
+ name: D,
251
197
  "css-class": "pkt-datepicker",
252
- isElement: Q,
253
- props: X,
254
- events: Y
198
+ isElement: _,
199
+ props: I,
200
+ events: O
255
201
  };
256
- var Z = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, o = (e, t, i, a) => {
257
- for (var s = a > 1 ? void 0 : a ? ee(t, i) : t, l = e.length - 1, n; l >= 0; l--)
258
- (n = e[l]) && (s = (a ? n(t, i, s) : n(s)) || s);
259
- return a && s && Z(t, i, s), s;
202
+ var P = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (e, t, i, r) => {
203
+ for (var s = r > 1 ? void 0 : r ? B(t, i) : t, o = e.length - 1, u; o >= 0; o--)
204
+ (u = e[o]) && (s = (r ? u(t, i, s) : u(s)) || s);
205
+ return r && s && P(t, i, s), s;
260
206
  };
261
- const B = (e) => new Promise((t) => setTimeout(t, e));
262
- let r = class extends q {
207
+ const $ = (e) => new Promise((t) => setTimeout(t, e));
208
+ let a = class extends C {
263
209
  /**
264
210
  * Housekeeping / lifecycle methods
265
211
  */
266
212
  constructor() {
267
- super(), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = b.props.dateformat.default, this.multiple = b.props.multiple.default, this.maxlength = null, this.range = b.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = b.props.weeknumbers.default, this.withcontrols = b.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = w(), this.inputRefTo = w(), this.btnRef = w(), this.calRef = w(), this.popupRef = w(), this.helptextSlot = w(), this.addToSelected = (e) => {
213
+ super(), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = c.props.dateformat.default, this.multiple = c.props.multiple.default, this.maxlength = null, this.range = c.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = c.props.weeknumbers.default, this.withcontrols = c.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = f(), this.inputRefTo = f(), this.btnRef = f(), this.calRef = f(), this.popupRef = f(), this.helptextSlot = f(), this.addToSelected = (e) => {
268
214
  const t = e.target;
269
215
  if (!t.value) return;
270
- const i = this.min ? S(this.min) : null, a = this.max ? S(this.max) : null, s = S(t.value.split(",")[0]);
271
- s && !isNaN(s.getTime()) && (!i || s >= i) && (!a || s <= a) && this.calRef.value && this.calRef.value.handleDateSelect(s), t.value = "";
272
- }, this.slotController = new z(this, this.helptextSlot);
216
+ const i = this.min ? v(this.min) : null, r = this.max ? v(this.max) : null, s = v(t.value.split(",")[0]);
217
+ s && !isNaN(s.getTime()) && (!i || s >= i) && (!r || s <= r) && this.calRef.value && this.calRef.value.handleDateSelect(s), t.value = "";
218
+ }, this.slotController = new S(this, this.helptextSlot);
273
219
  }
274
220
  async connectedCallback() {
275
221
  super.connectedCallback(), this.isMobileSafari = /iP(ad|od|hone)/i.test(window.navigator.userAgent) && !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/), this.inputType = this.isMobileSafari ? "text" : "date", document && document.body.addEventListener("click", (e) => {
276
222
  var t, i;
277
223
  (t = this.inputRef) != null && t.value && ((i = this.btnRef) != null && i.value) && !this.inputRef.value.contains(e.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(e.target)) && !this.btnRef.value.contains(e.target) && !e.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
278
- }), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || b.props.min.default, this.max = this.max || b.props.max.default, typeof this.excludedates == "string" && (this.excludedates = this.excludedates.split(",")), typeof this.excludeweekdays == "string" && (this.excludeweekdays = this.excludeweekdays.split(",")), (this.multiple || this.range) && this.name && !this.name.endsWith("[]") && (this.name = this.name + "[]"), this.calendarOpen && (await B(20), this.handleCalendarPosition());
224
+ }), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || c.props.min.default, this.max = this.max || c.props.max.default, typeof this.excludedates == "string" && (this.excludedates = this.excludedates.split(",")), typeof this.excludeweekdays == "string" && (this.excludeweekdays = this.excludeweekdays.split(",")), (this.multiple || this.range) && this.name && !this.name.endsWith("[]") && (this.name = this.name + "[]"), this.calendarOpen && (await $(20), this.handleCalendarPosition());
279
225
  }
280
226
  disconnectedCallback() {
281
227
  super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
@@ -301,14 +247,14 @@ let r = class extends q {
301
247
  * Rendering
302
248
  */
303
249
  renderInput() {
304
- return v`
250
+ return p`
305
251
  <input
306
- class="${x(this.inputClasses)}"
252
+ class="${m(this.inputClasses)}"
307
253
  .type=${this.inputType}
308
254
  id="${this.id}-input"
309
255
  .value=${this._value[0] ?? ""}
310
- min=${k(this.min)}
311
- max=${k(this.max)}
256
+ min=${d(this.min)}
257
+ max=${d(this.max)}
312
258
  @click=${(e) => {
313
259
  e.preventDefault(), this.showCalendar();
314
260
  }}
@@ -330,7 +276,7 @@ let r = class extends q {
330
276
  @change=${(e) => {
331
277
  e.stopImmediatePropagation();
332
278
  }}
333
- ${y(this.inputRef)}
279
+ ${h(this.inputRef)}
334
280
  />
335
281
  `;
336
282
  }
@@ -339,15 +285,15 @@ let r = class extends q {
339
285
  "pkt-input-prefix": this.showRangeLabels,
340
286
  "pkt-hide": !this.showRangeLabels
341
287
  };
342
- return v`
343
- ${this.showRangeLabels ? v` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : T}
288
+ return p`
289
+ ${this.showRangeLabels ? p` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : g}
344
290
  <input
345
- class=${x(this.inputClasses)}
291
+ class=${m(this.inputClasses)}
346
292
  .type=${this.inputType}
347
293
  id="${this.id}-input"
348
294
  .value=${this._value[0] ?? ""}
349
- min=${k(this.min)}
350
- max=${k(this.max)}
295
+ min=${d(this.min)}
296
+ max=${d(this.max)}
351
297
  ?disabled=${this.disabled}
352
298
  @click=${(t) => {
353
299
  t.preventDefault(), this.showCalendar();
@@ -363,30 +309,30 @@ let r = class extends q {
363
309
  this.onFocus(), this.isMobileSafari && this.showCalendar();
364
310
  }}
365
311
  @blur=${(t) => {
366
- var i, a;
312
+ var i, r;
367
313
  if (t.target.value) {
368
314
  this.manageValidity(t.target);
369
- const s = _(t.target.value);
370
- s && this._value[0] !== t.target.value && this._value[1] && (this.clearInputValue(), (a = (i = this.calRef) == null ? void 0 : i.value) == null || a.handleDateSelect(s));
315
+ const s = k(t.target.value);
316
+ s && this._value[0] !== t.target.value && this._value[1] && (this.clearInputValue(), (r = (i = this.calRef) == null ? void 0 : i.value) == null || r.handleDateSelect(s));
371
317
  } else this._value[0] && this.clearInputValue();
372
318
  }}
373
319
  @change=${(t) => {
374
320
  t.stopImmediatePropagation();
375
321
  }}
376
- ${y(this.inputRef)}
322
+ ${h(this.inputRef)}
377
323
  />
378
- <div class="${x(e)}" id="${this.id}-to-label">
324
+ <div class="${m(e)}" id="${this.id}-to-label">
379
325
  ${this.strings.generic.to}
380
326
  </div>
381
- ${this.showRangeLabels ? T : v` <div class="pkt-input-separator">–</div> `}
327
+ ${this.showRangeLabels ? g : p` <div class="pkt-input-separator">–</div> `}
382
328
  <input
383
- class=${x(this.inputClasses)}
329
+ class=${m(this.inputClasses)}
384
330
  .type=${this.inputType}
385
331
  id="${this.id}-to"
386
332
  aria-labelledby="${this.id}-to-label"
387
333
  .value=${this._value[1] ?? ""}
388
- min=${k(this.min)}
389
- max=${k(this.max)}
334
+ min=${d(this.min)}
335
+ max=${d(this.max)}
390
336
  ?disabled=${this.disabled}
391
337
  @click=${(t) => {
392
338
  t.preventDefault(), this.showCalendar();
@@ -402,38 +348,38 @@ let r = class extends q {
402
348
  this.onFocus(), this.isMobileSafari && this.showCalendar();
403
349
  }}
404
350
  @blur=${(t) => {
405
- var i, a, s;
351
+ var i, r, s;
406
352
  if ((i = this.calRef.value) != null && i.contains(t.relatedTarget) || this.onBlur(), t.target.value) {
407
353
  this.manageValidity(t.target);
408
- const l = t.target.value;
409
- this.min && this.min > l ? this.internals.setValidity(
354
+ const o = t.target.value;
355
+ this.min && this.min > o ? this.internals.setValidity(
410
356
  { rangeUnderflow: !0 },
411
357
  this.strings.forms.messages.rangeUnderflow,
412
358
  t.target
413
- ) : this.max && this.max < l && this.internals.setValidity(
359
+ ) : this.max && this.max < o && this.internals.setValidity(
414
360
  { rangeOverflow: !0 },
415
361
  this.strings.forms.messages.rangeOverflow,
416
362
  t.target
417
363
  );
418
- const n = _(t.target.value);
419
- n && this._value[1] !== F(n) && ((s = (a = this.calRef) == null ? void 0 : a.value) == null || s.handleDateSelect(n));
364
+ const u = k(t.target.value);
365
+ u && this._value[1] !== R(u) && ((s = (r = this.calRef) == null ? void 0 : r.value) == null || s.handleDateSelect(u));
420
366
  }
421
367
  }}
422
368
  @change=${(t) => {
423
369
  t.stopImmediatePropagation();
424
370
  }}
425
- ${y(this.inputRefTo)}
371
+ ${h(this.inputRefTo)}
426
372
  />
427
373
  `;
428
374
  }
429
375
  renderMultipleInput() {
430
- return v`
376
+ return p`
431
377
  <input
432
- class=${x(this.inputClasses)}
378
+ class=${m(this.inputClasses)}
433
379
  .type=${this.inputType}
434
380
  id="${this.id}-input"
435
- min=${k(this.min)}
436
- max=${k(this.max)}
381
+ min=${d(this.min)}
382
+ max=${d(this.max)}
437
383
  ?disabled=${this.disabled || this.maxlength && this._value.length >= this.maxlength}
438
384
  @click=${(e) => {
439
385
  e.preventDefault(), this.showCalendar();
@@ -454,43 +400,43 @@ let r = class extends q {
454
400
  @change=${(e) => {
455
401
  e.stopImmediatePropagation();
456
402
  }}
457
- ${y(this.inputRef)}
403
+ ${h(this.inputRef)}
458
404
  />
459
405
  `;
460
406
  }
461
407
  renderTags() {
462
- return v`
408
+ return p`
463
409
  <div class="pkt-datepicker__tags" aria-live="polite">
464
- ${this._value[0] ? G(
410
+ ${this._value[0] ? T(
465
411
  this._value ?? [],
466
412
  (e) => e,
467
- (e) => v`
413
+ (e) => p`
468
414
  <pkt-tag
469
415
  .id="${this.id + e + "-tag"}"
470
416
  closeTag
471
- ariaLabel="${this.strings.calendar.deleteDate} ${P(
417
+ ariaLabel="${this.strings.calendar.deleteDate} ${y(
472
418
  e,
473
419
  this.dateformat
474
420
  )}"
475
421
  @close=${() => {
476
422
  var t;
477
- return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(_(e));
423
+ return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(k(e));
478
424
  }}
479
- ><time datetime="${e}">${P(e, this.dateformat)}</time></pkt-tag
425
+ ><time datetime="${e}">${y(e, this.dateformat)}</time></pkt-tag
480
426
  >
481
427
  `
482
- ) : T}
428
+ ) : g}
483
429
  </div>
484
430
  `;
485
431
  }
486
432
  renderCalendar() {
487
- return v`<div
433
+ return p`<div
488
434
  class="pkt-calendar-popup pkt-${this.calendarOpen ? "show" : "hide"}"
489
435
  @focusout=${(e) => {
490
436
  this.calendarOpen && this.handleFocusOut(e);
491
437
  }}
492
438
  id="${this.id}-popup"
493
- ${y(this.popupRef)}
439
+ ${h(this.popupRef)}
494
440
  >
495
441
  <pkt-calendar
496
442
  id="${this.id}-calendar"
@@ -504,14 +450,14 @@ let r = class extends q {
504
450
  .latest=${this.max}
505
451
  .excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
506
452
  .excludeweekdays=${this.excludeweekdays}
507
- .currentmonth=${this.currentmonth ? S(this.currentmonth) : null}
453
+ .currentmonth=${this.currentmonth ? v(this.currentmonth) : null}
508
454
  @date-selected=${(e) => {
509
455
  this.value = !this.multiple && !this.range ? e.detail[0] : e.detail, this._value = e.detail, this.inputRef.value && (this.range && this.inputRefTo.value ? (this.inputRef.value.value = this._value[0] ?? "", this.inputRefTo.value.value = this._value[1] ?? "") : this.multiple || (this.inputRef.value.value = this._value.length ? this._value[0] : ""));
510
456
  }}
511
457
  @close=${() => {
512
458
  this.onBlur(), this.hideCalendar();
513
459
  }}
514
- ${y(this.calRef)}
460
+ ${h(this.calRef)}
515
461
  ></pkt-calendar>
516
462
  </div>`;
517
463
  }
@@ -528,7 +474,7 @@ let r = class extends q {
528
474
  "pkt-btn": !0,
529
475
  "pkt-btn--icon-only": !0,
530
476
  "pkt-btn--tertiary": !0
531
- }, v`
477
+ }, p`
532
478
  <pkt-input-wrapper
533
479
  label="${this.label}"
534
480
  forId="${this.id}-input"
@@ -537,6 +483,8 @@ let r = class extends q {
537
483
  .counterMaxLength=${this.maxlength}
538
484
  ?disabled=${this.disabled}
539
485
  ?hasError=${this.hasError}
486
+ ?hasFieldset=${this.hasFieldset}
487
+ ?inline=${this.inline}
540
488
  ?required=${this.required}
541
489
  ?optionalTag=${this.optionalTag}
542
490
  ?requiredTag=${this.requiredTag}
@@ -550,19 +498,19 @@ let r = class extends q {
550
498
  .ariaDescribedBy=${this.ariaDescribedBy}
551
499
  class="pkt-datepicker"
552
500
  >
553
- <div class="pkt-contents" ${y(this.helptextSlot)} name="helptext" slot="helptext"></div>
554
- ${this.multiple ? this.renderTags() : T}
501
+ <div class="pkt-contents" ${h(this.helptextSlot)} name="helptext" slot="helptext"></div>
502
+ ${this.multiple ? this.renderTags() : g}
555
503
  <div
556
504
  class="pkt-datepicker__inputs ${this.range && this.showRangeLabels ? "pkt-input__range-inputs" : ""}"
557
505
  >
558
506
  <div class="pkt-input__container">
559
507
  ${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
560
508
  <button
561
- class="${x(this.buttonClasses)}"
509
+ class="${m(this.buttonClasses)}"
562
510
  type="button"
563
511
  @click=${this.toggleCalendar}
564
512
  ?disabled=${this.disabled}
565
- ${y(this.btnRef)}
513
+ ${h(this.btnRef)}
566
514
  >
567
515
  <pkt-icon name="calendar"></pkt-icon>
568
516
  <span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
@@ -579,9 +527,9 @@ let r = class extends q {
579
527
  handleCalendarPosition() {
580
528
  var e;
581
529
  if (this.popupRef.value && this.inputRef.value) {
582
- const t = this.multiple && !!this.maxlength, i = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = t ? i.height + 30 : i.height, s = this.popupRef.value.getBoundingClientRect().height;
583
- let l = t ? "calc(100% - 30px)" : "100%";
584
- i && i.top + s > window.innerHeight && i.top - s > 0 && (l = `calc(100% - ${a}px - ${s}px)`), this.popupRef.value.style.top = l;
530
+ const t = this.multiple && !!this.maxlength, i = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), r = t ? i.height + 30 : i.height, s = this.popupRef.value.getBoundingClientRect().height;
531
+ let o = t ? "calc(100% - 30px)" : "100%";
532
+ i && i.top + s > window.innerHeight && i.top - s > 0 && (o = `calc(100% - ${r}px - ${s}px)`), this.popupRef.value.style.top = o;
585
533
  }
586
534
  }
587
535
  handleFocusOut(e) {
@@ -589,7 +537,7 @@ let r = class extends q {
589
537
  }
590
538
  async showCalendar() {
591
539
  var e;
592
- this.calendarOpen = !0, await B(20), this.handleCalendarPosition(), this.isMobileSafari && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
540
+ this.calendarOpen = !0, await $(20), this.handleCalendarPosition(), this.isMobileSafari && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
593
541
  }
594
542
  hideCalendar() {
595
543
  this.calendarOpen = !1;
@@ -598,66 +546,66 @@ let r = class extends q {
598
546
  e.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
599
547
  }
600
548
  };
601
- o([
602
- u({ type: String, reflect: !0 })
603
- ], r.prototype, "value", 2);
604
- o([
605
- u({ type: Array })
606
- ], r.prototype, "_value", 2);
607
- o([
608
- u({ type: String, reflect: !0 })
609
- ], r.prototype, "label", 2);
610
- o([
611
- u({ type: String })
612
- ], r.prototype, "dateformat", 2);
613
- o([
614
- u({ type: Boolean, reflect: !0 })
615
- ], r.prototype, "multiple", 2);
616
- o([
617
- u({ type: Number, reflect: !0 })
618
- ], r.prototype, "maxlength", 2);
619
- o([
620
- u({ type: Boolean, reflect: !0 })
621
- ], r.prototype, "range", 2);
622
- o([
623
- u({ type: Boolean })
624
- ], r.prototype, "showRangeLabels", 2);
625
- o([
626
- u({ type: String, reflect: !0 })
627
- ], r.prototype, "min", 2);
628
- o([
629
- u({ type: String, reflect: !0 })
630
- ], r.prototype, "max", 2);
631
- o([
632
- u({ type: Boolean })
633
- ], r.prototype, "weeknumbers", 2);
634
- o([
635
- u({ type: Boolean, reflect: !0 })
636
- ], r.prototype, "withcontrols", 2);
637
- o([
638
- u({ converter: A.csvToArray })
639
- ], r.prototype, "excludedates", 2);
640
- o([
641
- u({ converter: A.csvToArray })
642
- ], r.prototype, "excludeweekdays", 2);
643
- o([
644
- u({ type: String })
645
- ], r.prototype, "currentmonth", 2);
646
- o([
647
- u({ type: Boolean, reflect: !0 })
648
- ], r.prototype, "calendarOpen", 2);
649
- o([
650
- u({ type: String })
651
- ], r.prototype, "timezone", 2);
652
- o([
653
- V()
654
- ], r.prototype, "inputClasses", 2);
655
- o([
656
- V()
657
- ], r.prototype, "buttonClasses", 2);
658
- r = o([
659
- j("pkt-datepicker")
660
- ], r);
549
+ n([
550
+ l({ type: String, reflect: !0 })
551
+ ], a.prototype, "value", 2);
552
+ n([
553
+ l({ type: Array })
554
+ ], a.prototype, "_value", 2);
555
+ n([
556
+ l({ type: String, reflect: !0 })
557
+ ], a.prototype, "label", 2);
558
+ n([
559
+ l({ type: String })
560
+ ], a.prototype, "dateformat", 2);
561
+ n([
562
+ l({ type: Boolean, reflect: !0 })
563
+ ], a.prototype, "multiple", 2);
564
+ n([
565
+ l({ type: Number, reflect: !0 })
566
+ ], a.prototype, "maxlength", 2);
567
+ n([
568
+ l({ type: Boolean, reflect: !0 })
569
+ ], a.prototype, "range", 2);
570
+ n([
571
+ l({ type: Boolean })
572
+ ], a.prototype, "showRangeLabels", 2);
573
+ n([
574
+ l({ type: String, reflect: !0 })
575
+ ], a.prototype, "min", 2);
576
+ n([
577
+ l({ type: String, reflect: !0 })
578
+ ], a.prototype, "max", 2);
579
+ n([
580
+ l({ type: Boolean })
581
+ ], a.prototype, "weeknumbers", 2);
582
+ n([
583
+ l({ type: Boolean, reflect: !0 })
584
+ ], a.prototype, "withcontrols", 2);
585
+ n([
586
+ l({ converter: x.csvToArray })
587
+ ], a.prototype, "excludedates", 2);
588
+ n([
589
+ l({ converter: x.csvToArray })
590
+ ], a.prototype, "excludeweekdays", 2);
591
+ n([
592
+ l({ type: String })
593
+ ], a.prototype, "currentmonth", 2);
594
+ n([
595
+ l({ type: Boolean, reflect: !0 })
596
+ ], a.prototype, "calendarOpen", 2);
597
+ n([
598
+ l({ type: String })
599
+ ], a.prototype, "timezone", 2);
600
+ n([
601
+ b()
602
+ ], a.prototype, "inputClasses", 2);
603
+ n([
604
+ b()
605
+ ], a.prototype, "buttonClasses", 2);
606
+ a = n([
607
+ w("pkt-datepicker")
608
+ ], a);
661
609
  export {
662
- r as P
610
+ a as P
663
611
  };