@oslokommune/punkt-elements 12.11.2 → 12.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{class-map-DpN1m5lh.js → class-map-BQ3-MseA.js} +1 -1
  2. package/dist/{class-map-B9m-NycN.cjs → class-map-DLFPHEre.cjs} +1 -1
  3. package/dist/{helptext-B0Frb38k.js → helptext-D-5_-HAW.js} +3 -3
  4. package/dist/{helptext-0fI9cWEe.cjs → helptext-WCq0-Dq8.cjs} +1 -1
  5. package/dist/{index-Dw-V4--g.js → index-BQ9BMXel.js} +31 -27
  6. package/dist/{index-DmedytuY.js → index-BR7EVgX9.js} +3 -3
  7. package/dist/{index-CBFF6OHE.cjs → index-BVbNUNAa.cjs} +5 -5
  8. package/dist/{index-DkLa0YLm.js → index-BfUPq43a.js} +1 -1
  9. package/dist/{index-CqWQt14b.cjs → index-DYiD-o1w.cjs} +1 -1
  10. package/dist/{index-aLVFdclF.cjs → index-DyL6sqFY.cjs} +1 -1
  11. package/dist/index.d.ts +3 -14
  12. package/dist/{modal-FnkYHLoK.cjs → modal-BXKX0dxk.cjs} +1 -1
  13. package/dist/{modal-D6J8TqCp.js → modal-CYx_wrz1.js} +4 -4
  14. package/dist/pkt-alert.cjs +1 -1
  15. package/dist/pkt-alert.js +4 -4
  16. package/dist/pkt-calendar.cjs +1 -1
  17. package/dist/pkt-calendar.js +4 -4
  18. package/dist/pkt-card.cjs +1 -1
  19. package/dist/pkt-card.js +4 -4
  20. package/dist/pkt-component-template.cjs +1 -1
  21. package/dist/pkt-component-template.js +3 -3
  22. package/dist/pkt-datepicker.cjs +42 -37
  23. package/dist/pkt-datepicker.js +194 -173
  24. package/dist/pkt-element.cjs +1 -1
  25. package/dist/pkt-element.js +1 -1
  26. package/dist/pkt-helptext.cjs +1 -1
  27. package/dist/pkt-helptext.js +1 -1
  28. package/dist/pkt-icon.cjs +1 -1
  29. package/dist/pkt-icon.js +2 -2
  30. package/dist/pkt-index.cjs +1 -1
  31. package/dist/pkt-index.js +4 -4
  32. package/dist/pkt-input-wrapper.cjs +1 -1
  33. package/dist/pkt-input-wrapper.js +5 -5
  34. package/dist/pkt-link.cjs +1 -1
  35. package/dist/pkt-link.js +4 -4
  36. package/dist/pkt-messagebox.cjs +1 -1
  37. package/dist/pkt-messagebox.js +4 -4
  38. package/dist/pkt-modal.cjs +1 -1
  39. package/dist/pkt-modal.js +1 -1
  40. package/dist/pkt-tag.cjs +1 -1
  41. package/dist/pkt-tag.js +4 -4
  42. package/dist/{ref-D5FOI49b.js → ref-BjO0bKwt.js} +1 -1
  43. package/dist/{ref-3QXuhm6y.cjs → ref-CIjJrMxp.cjs} +1 -1
  44. package/package.json +3 -3
  45. package/src/components/datepicker/index.ts +42 -23
@@ -1,67 +1,67 @@
1
- import { T as V, a as A, x as k, E as O, n as u } from "./index-Dw-V4--g.js";
1
+ import { T as A, r as P, a as L, x as v, E as b, n as d } from "./index-BQ9BMXel.js";
2
2
  import { e as j, i as F, a as q, t as H } from "./custom-element-CWfU4dcr.js";
3
- import { p as U, v as y, r as b, M as S, m as L, e as x, n as $ } from "./ref-D5FOI49b.js";
4
- import { e as w } from "./class-map-DpN1m5lh.js";
5
- import { a as P } from "./converters-DNCwIFwr.js";
6
- import { n as C, f as _, a as N, b as M } from "./index-DmedytuY.js";
3
+ import { p as U, v as y, r as w, M as _, m as N, e as R, n as $ } from "./ref-BjO0bKwt.js";
4
+ import { e as x } from "./class-map-BQ3-MseA.js";
5
+ import { a as V } from "./converters-DNCwIFwr.js";
6
+ import { n as T, f as D, a as W, b as M } from "./index-BR7EVgX9.js";
7
7
  import "./pkt-input-wrapper.js";
8
- import "./index-DkLa0YLm.js";
8
+ import "./index-BfUPq43a.js";
9
9
  import "./pkt-tag.js";
10
10
  /**
11
11
  * @license
12
12
  * Copyright 2017 Google LLC
13
13
  * SPDX-License-Identifier: BSD-3-Clause
14
14
  */
15
- const E = (e, t, a) => {
16
- const s = /* @__PURE__ */ new Map();
17
- for (let i = t; i <= a; i++) s.set(e[i], i);
18
- return s;
19
- }, W = j(class extends F {
15
+ const E = (e, t, s) => {
16
+ const a = /* @__PURE__ */ new Map();
17
+ for (let i = t; i <= s; i++) a.set(e[i], i);
18
+ return a;
19
+ }, K = j(class extends F {
20
20
  constructor(e) {
21
21
  if (super(e), e.type !== q.CHILD) throw Error("repeat() can only be used in text expressions");
22
22
  }
23
- dt(e, t, a) {
24
- let s;
25
- a === void 0 ? a = t : t !== void 0 && (s = t);
26
- const i = [], n = [];
27
- let r = 0;
28
- for (const f of e) i[r] = s ? s(f, r) : r, n[r] = a(f, r), r++;
29
- return { values: n, keys: i };
23
+ dt(e, t, s) {
24
+ let a;
25
+ s === void 0 ? s = t : t !== void 0 && (a = t);
26
+ const i = [], r = [];
27
+ let n = 0;
28
+ for (const f of e) i[n] = a ? a(f, n) : n, r[n] = s(f, n), n++;
29
+ return { values: r, keys: i };
30
30
  }
31
- render(e, t, a) {
32
- return this.dt(e, t, a).values;
31
+ render(e, t, s) {
32
+ return this.dt(e, t, s).values;
33
33
  }
34
- update(e, [t, a, s]) {
35
- const i = U(e), { values: n, keys: r } = this.dt(t, a, s);
36
- if (!Array.isArray(i)) return this.ut = r, n;
34
+ update(e, [t, s, a]) {
35
+ const i = U(e), { values: r, keys: n } = this.dt(t, s, a);
36
+ if (!Array.isArray(i)) return this.ut = n, r;
37
37
  const f = this.ut ?? (this.ut = []), m = [];
38
- let R, D, o = 0, h = i.length - 1, p = 0, c = n.length - 1;
39
- for (; o <= h && p <= c; ) if (i[o] === null) o++;
38
+ let C, I, p = 0, h = i.length - 1, u = 0, c = r.length - 1;
39
+ for (; p <= h && u <= c; ) if (i[p] === null) p++;
40
40
  else if (i[h] === null) h--;
41
- else if (f[o] === r[p]) m[p] = y(i[o], n[p]), o++, p++;
42
- else if (f[h] === r[c]) m[c] = y(i[h], n[c]), h--, c--;
43
- else if (f[o] === r[c]) m[c] = y(i[o], n[c]), b(e, m[c + 1], i[o]), o++, c--;
44
- else if (f[h] === r[p]) m[p] = y(i[h], n[p]), b(e, i[o], i[h]), h--, p++;
45
- else if (R === void 0 && (R = E(r, p, c), D = E(f, o, h)), R.has(f[o])) if (R.has(f[h])) {
46
- const g = D.get(r[p]), T = g !== void 0 ? i[g] : null;
47
- if (T === null) {
48
- const I = b(e, i[o]);
49
- y(I, n[p]), m[p] = I;
50
- } else m[p] = y(T, n[p]), b(e, i[o], T), i[g] = null;
51
- p++;
52
- } else S(i[h]), h--;
53
- else S(i[o]), o++;
54
- for (; p <= c; ) {
55
- const g = b(e, m[c + 1]);
56
- y(g, n[p]), m[p++] = g;
41
+ else if (f[p] === n[u]) m[u] = y(i[p], r[u]), p++, u++;
42
+ else if (f[h] === n[c]) m[c] = y(i[h], r[c]), h--, c--;
43
+ else if (f[p] === n[c]) m[c] = y(i[p], r[c]), w(e, m[c + 1], i[p]), p++, c--;
44
+ else if (f[h] === n[u]) m[u] = y(i[h], r[u]), w(e, i[p], i[h]), h--, u++;
45
+ else if (C === void 0 && (C = E(n, u, c), I = E(f, p, h)), C.has(f[p])) if (C.has(f[h])) {
46
+ const g = I.get(n[u]), S = g !== void 0 ? i[g] : null;
47
+ if (S === null) {
48
+ const O = w(e, i[p]);
49
+ y(O, r[u]), m[u] = O;
50
+ } else m[u] = y(S, r[u]), w(e, i[p], S), i[g] = null;
51
+ u++;
52
+ } else _(i[h]), h--;
53
+ else _(i[p]), p++;
54
+ for (; u <= c; ) {
55
+ const g = w(e, m[c + 1]);
56
+ y(g, r[u]), m[u++] = g;
57
57
  }
58
- for (; o <= h; ) {
59
- const g = i[o++];
60
- g !== null && S(g);
58
+ for (; p <= h; ) {
59
+ const g = i[p++];
60
+ g !== null && _(g);
61
61
  }
62
- return this.ut = r, L(e, m), V;
62
+ return this.ut = n, N(e, m), A;
63
63
  }
64
- }), K = "pkt-datepicker", z = !0, G = {
64
+ }), z = "pkt-datepicker", G = !0, J = {
65
65
  name: {
66
66
  type: "string",
67
67
  name: "Navn",
@@ -229,7 +229,7 @@ const E = (e, t, a) => {
229
229
  name: "ID",
230
230
  description: "Unik identifikasjon for datovelgeren"
231
231
  }
232
- }, J = {
232
+ }, Q = {
233
233
  change: {
234
234
  type: "Event",
235
235
  description: "Returnerer valgt dato som streng i ISO-format"
@@ -242,35 +242,26 @@ const E = (e, t, a) => {
242
242
  type: "CustomEvent",
243
243
  description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
244
244
  }
245
- }, v = {
246
- name: K,
245
+ }, k = {
246
+ name: z,
247
247
  "css-class": "pkt-datepicker",
248
- isElement: z,
249
- props: G,
250
- events: J
248
+ isElement: G,
249
+ props: J,
250
+ events: Q
251
251
  };
252
- var Q = Object.defineProperty, X = Object.getOwnPropertyDescriptor, d = (e, t, a, s) => {
253
- for (var i = s > 1 ? void 0 : s ? X(t, a) : t, n = e.length - 1, r; n >= 0; n--)
254
- (r = e[n]) && (i = (s ? r(t, a, i) : r(i)) || i);
255
- return s && i && Q(t, a, i), i;
252
+ var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, o = (e, t, s, a) => {
253
+ for (var i = a > 1 ? void 0 : a ? Y(t, s) : t, r = e.length - 1, n; r >= 0; r--)
254
+ (n = e[r]) && (i = (a ? n(t, s, i) : n(i)) || i);
255
+ return a && i && X(t, s, i), i;
256
256
  };
257
257
  const B = (e) => new Promise((t) => setTimeout(t, e));
258
- let l = class extends A {
258
+ let l = class extends L {
259
259
  constructor() {
260
- super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = v.props.dateformat.default, this.multiple = v.props.multiple.default, this.maxlength = v.props.maxlength.default, this.range = v.props.range.default, this.min = null, this.max = null, this.weeknumbers = v.props.weeknumbers.default, this.withcontrols = v.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.useWrapper = !0, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputRef = x(), this.inputRefTo = x(), this.btnRef = x(), this.calRef = x(), this.popupRef = x(), this.inputClasses = {
261
- "pkt-input": !0,
262
- "pkt-datepicker__input": !0,
263
- "pkt-input--fullwidth": this.fullwidth
264
- }, this.buttonClasses = {
265
- "pkt-input-icon": !0,
266
- "pkt-btn": !0,
267
- "pkt-btn--icon-only": !0,
268
- "pkt-btn--tertiary": !0
269
- }, this.addToSelected = (e) => {
260
+ super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = k.props.dateformat.default, this.multiple = k.props.multiple.default, this.maxlength = k.props.maxlength.default, this.range = k.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = k.props.weeknumbers.default, this.withcontrols = k.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.useWrapper = !0, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = R(), this.inputRefTo = R(), this.btnRef = R(), this.calRef = R(), this.popupRef = R(), this.addToSelected = (e) => {
270
261
  const t = e.target;
271
262
  if (!t.value) return;
272
- const a = this.min ? C(this.min) : null, s = this.max ? C(this.max) : null, i = C(t.value.split(",")[0]);
273
- i && !isNaN(i.getTime()) && (!a || i >= a) && (!s || i <= s) && this.calRef.value && this.calRef.value.handleDateSelect(i), t.value = "";
263
+ const s = this.min ? T(this.min) : null, a = this.max ? T(this.max) : null, i = T(t.value.split(",")[0]);
264
+ i && !isNaN(i.getTime()) && (!s || i >= s) && (!a || i <= a) && this.calRef.value && this.calRef.value.handleDateSelect(i), t.value = "";
274
265
  };
275
266
  }
276
267
  /**
@@ -278,18 +269,18 @@ let l = class extends A {
278
269
  */
279
270
  async connectedCallback() {
280
271
  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) => {
281
- var t, a;
282
- (t = this.inputRef) != null && t.value && ((a = this.btnRef) != null && a.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());
283
- }), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || v.props.min.default, this.max = this.max || v.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());
272
+ var t, s;
273
+ (t = this.inputRef) != null && t.value && ((s = this.btnRef) != null && s.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());
274
+ }), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || k.props.min.default, this.max = this.max || k.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());
284
275
  }
285
276
  disconnectedCallback() {
286
277
  super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
287
- var t, a;
288
- (t = this.inputRef) != null && t.value && ((a = this.btnRef) != null && a.value) && !this.inputRef.value.contains(e.target) && !this.btnRef.value.contains(e.target) && this.hideCalendar();
278
+ var t, s;
279
+ (t = this.inputRef) != null && t.value && ((s = this.btnRef) != null && s.value) && !this.inputRef.value.contains(e.target) && !this.btnRef.value.contains(e.target) && this.hideCalendar();
289
280
  });
290
281
  }
291
- attributeChangedCallback(e, t, a) {
292
- e === "value" && this.valueChanged(this.value, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (a == null ? void 0 : a.split(",")) ?? []), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (a == null ? void 0 : a.split(",")) ?? []), super.attributeChangedCallback(e, t, a);
282
+ attributeChangedCallback(e, t, s) {
283
+ e === "value" && this.valueChanged(this.value, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (s == null ? void 0 : s.split(",")) ?? []), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (s == null ? void 0 : s.split(",")) ?? []), super.attributeChangedCallback(e, t, s);
293
284
  }
294
285
  firstUpdated(e) {
295
286
  super.firstUpdated(e);
@@ -304,9 +295,9 @@ let l = class extends A {
304
295
  * Rendering
305
296
  */
306
297
  renderInput() {
307
- return k`
298
+ return v`
308
299
  <input
309
- class="${w(this.inputClasses)}"
300
+ class="${x(this.inputClasses)}"
310
301
  .type=${this.inputType}
311
302
  id="${this.id}-input"
312
303
  .value=${this._value[0] ?? ""}
@@ -338,98 +329,105 @@ let l = class extends A {
338
329
  `;
339
330
  }
340
331
  renderRangeInput() {
341
- return k`
342
- <div class="pkt-input-prefix">Fra</div>
332
+ const e = {
333
+ "pkt-input-prefix": this.showRangeLabels,
334
+ "pkt-hide": !this.showRangeLabels
335
+ };
336
+ return v`
337
+ ${this.showRangeLabels ? v` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : b}
343
338
  <input
344
- class=${w(this.inputClasses)}
339
+ class=${x(this.inputClasses)}
345
340
  .type=${this.inputType}
346
341
  id="${this.id}-input"
347
342
  .value=${this._value[0] ?? ""}
348
343
  min=${this.min}
349
344
  max=${this.max}
350
- @click=${(e) => {
351
- e.preventDefault(), this.showCalendar();
345
+ @click=${(t) => {
346
+ t.preventDefault(), this.showCalendar();
352
347
  }}
353
348
  ?disabled=${this.disabled}
354
- @keydown=${(e) => {
355
- var t;
356
- (e.key === "," || e.key === "Enter") && ((t = this.inputRef.value) == null || t.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
349
+ @keydown=${(t) => {
350
+ var s;
351
+ (t.key === "," || t.key === "Enter") && ((s = this.inputRef.value) == null || s.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
357
352
  }}
358
- @input=${(e) => {
359
- this.onInput(), e.stopImmediatePropagation();
353
+ @input=${(t) => {
354
+ this.onInput(), t.stopImmediatePropagation();
360
355
  }}
361
356
  @focus=${() => {
362
357
  this.onFocus(), this.isMobileSafari && this.showCalendar();
363
358
  }}
364
- @blur=${(e) => {
365
- var t, a;
366
- if (e.target.value) {
367
- this.manageValidity(e.target);
368
- const s = _(e.target.value);
369
- s && this._value[0] !== e.target.value && this._value[1] && (this.clearInputValue(), (a = (t = this.calRef) == null ? void 0 : t.value) == null || a.handleDateSelect(s));
359
+ @blur=${(t) => {
360
+ var s, a;
361
+ if (t.target.value) {
362
+ this.manageValidity(t.target);
363
+ const i = D(t.target.value);
364
+ i && this._value[0] !== t.target.value && this._value[1] && (this.clearInputValue(), (a = (s = this.calRef) == null ? void 0 : s.value) == null || a.handleDateSelect(i));
370
365
  } else this._value[0] && this.clearInputValue();
371
366
  }}
372
- @change=${(e) => {
373
- e.stopImmediatePropagation();
367
+ @change=${(t) => {
368
+ t.stopImmediatePropagation();
374
369
  }}
375
370
  ${$(this.inputRef)}
376
371
  />
377
- <div class="pkt-input-prefix" id="${this.id}-to-label">Til</div>
372
+ <div class="${x(e)}" id="${this.id}-to-label">
373
+ ${this.strings.generic.to}
374
+ </div>
375
+ ${this.showRangeLabels ? b : v` <div class="pkt-input-separator">–</div> `}
378
376
  <input
379
- class=${w(this.inputClasses)}
377
+ class=${x(this.inputClasses)}
380
378
  .type=${this.inputType}
381
379
  id="${this.id}-to"
382
380
  aria-labelledby="${this.id}-to-label"
383
381
  .value=${this._value[1] ?? ""}
384
382
  min=${this.min}
385
383
  max=${this.max}
386
- @click=${(e) => {
387
- e.preventDefault(), this.showCalendar();
384
+ @click=${(t) => {
385
+ t.preventDefault(), this.showCalendar();
388
386
  }}
389
387
  ?disabled=${this.disabled}
390
- @keydown=${(e) => {
391
- var t;
392
- (e.key === "," || e.key === "Enter") && ((t = this.inputRefTo.value) == null || t.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
388
+ @keydown=${(t) => {
389
+ var s;
390
+ (t.key === "," || t.key === "Enter") && ((s = this.inputRefTo.value) == null || s.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
393
391
  }}
394
- @input=${(e) => {
395
- this.onInput(), e.stopImmediatePropagation();
392
+ @input=${(t) => {
393
+ this.onInput(), t.stopImmediatePropagation();
396
394
  }}
397
395
  @focus=${() => {
398
396
  this.onFocus(), this.isMobileSafari && this.showCalendar();
399
397
  }}
400
- @blur=${(e) => {
401
- var t, a, s;
402
- if ((t = this.calRef.value) != null && t.contains(e.relatedTarget) || this.onBlur(), e.target.value) {
403
- this.manageValidity(e.target);
404
- const i = e.target.value;
405
- this.min && this.min > i ? this.internals.setValidity(
398
+ @blur=${(t) => {
399
+ var s, a, i;
400
+ if ((s = this.calRef.value) != null && s.contains(t.relatedTarget) || this.onBlur(), t.target.value) {
401
+ this.manageValidity(t.target);
402
+ const r = t.target.value;
403
+ this.min && this.min > r ? this.internals.setValidity(
406
404
  { rangeUnderflow: !0 },
407
405
  this.strings.forms.messages.rangeUnderflow,
408
- e.target
409
- ) : this.max && this.max < i && this.internals.setValidity(
406
+ t.target
407
+ ) : this.max && this.max < r && this.internals.setValidity(
410
408
  { rangeOverflow: !0 },
411
409
  this.strings.forms.messages.rangeOverflow,
412
- e.target
410
+ t.target
413
411
  );
414
- const n = _(e.target.value);
415
- n && this._value[1] !== N(n) && ((s = (a = this.calRef) == null ? void 0 : a.value) == null || s.handleDateSelect(n));
412
+ const n = D(t.target.value);
413
+ n && this._value[1] !== W(n) && ((i = (a = this.calRef) == null ? void 0 : a.value) == null || i.handleDateSelect(n));
416
414
  }
417
415
  }}
418
- @change=${(e) => {
419
- e.stopImmediatePropagation();
416
+ @change=${(t) => {
417
+ t.stopImmediatePropagation();
420
418
  }}
421
419
  ${$(this.inputRefTo)}
422
420
  />
423
421
  `;
424
422
  }
425
423
  renderMultipleInput() {
426
- return k`
424
+ return console.log("renderMultipleInput", this.inputClasses, this.multiple), v`
427
425
  <input
428
- class=${w(this.inputClasses)}
426
+ class=${x(this.inputClasses)}
429
427
  .type=${this.inputType}
430
428
  id="${this.id}-input"
431
- min=${this.min}
432
- max=${this.max}
429
+ .min=${this.min || b}
430
+ .max=${this.max || b}
433
431
  @click=${(e) => {
434
432
  e.preventDefault(), this.showCalendar();
435
433
  }}
@@ -455,12 +453,12 @@ let l = class extends A {
455
453
  `;
456
454
  }
457
455
  renderTags() {
458
- return k`
456
+ return v`
459
457
  <div class="pkt-datepicker__tags" aria-live="polite">
460
- ${this._value[0] ? W(
458
+ ${this._value[0] ? K(
461
459
  this._value ?? [],
462
460
  (e) => e,
463
- (e) => k`
461
+ (e) => v`
464
462
  <pkt-tag
465
463
  .id="${this.id + e + "-tag"}"
466
464
  closeTag
@@ -470,17 +468,17 @@ let l = class extends A {
470
468
  )}"
471
469
  @close=${() => {
472
470
  var t;
473
- return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(_(e));
471
+ return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(D(e));
474
472
  }}
475
473
  >${M(e, this.dateformat)}</pkt-tag
476
474
  >
477
475
  `
478
- ) : O}
476
+ ) : b}
479
477
  </div>
480
478
  `;
481
479
  }
482
480
  renderCalendar() {
483
- return k`<div
481
+ return v`<div
484
482
  class="pkt-calendar-popup pkt-${this.calendarOpen ? "show" : "hide"}"
485
483
  @focusout=${(e) => {
486
484
  this.calendarOpen && this.handleFocusOut(e);
@@ -500,7 +498,7 @@ let l = class extends A {
500
498
  .latest=${this.max}
501
499
  .excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
502
500
  .excludeweekdays=${this.excludeweekdays}
503
- .currentmonth=${this.currentmonth ? C(this.currentmonth) : null}
501
+ .currentmonth=${this.currentmonth ? T(this.currentmonth) : null}
504
502
  @date-selected=${(e) => {
505
503
  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] : ""));
506
504
  }}
@@ -512,7 +510,19 @@ let l = class extends A {
512
510
  </div>`;
513
511
  }
514
512
  render() {
515
- return k`
513
+ return this.inputClasses = {
514
+ "pkt-input": !0,
515
+ "pkt-datepicker__input": !0,
516
+ "pkt-input--fullwidth": this.fullwidth,
517
+ "pkt-datepicker--hasrangelabels": this.showRangeLabels,
518
+ "pkt-datepicker--multiple": this.multiple,
519
+ "pkt-datepicker--range": this.range
520
+ }, this.buttonClasses = {
521
+ "pkt-input-icon": !0,
522
+ "pkt-btn": !0,
523
+ "pkt-btn--icon-only": !0,
524
+ "pkt-btn--tertiary": !0
525
+ }, v`
516
526
  <pkt-input-wrapper
517
527
  label="${this.label}"
518
528
  forId="${this.id}-input"
@@ -533,12 +543,14 @@ let l = class extends A {
533
543
  .helptextDropdownButton=${this.helptextDropdownButton}
534
544
  class="pkt-datepicker"
535
545
  >
536
- ${this.multiple ? this.renderTags() : O}
537
- <div class="pkt-datepicker__inputs ${this.range ? "pkt-input__range-inputs" : ""}">
546
+ ${this.multiple ? this.renderTags() : b}
547
+ <div
548
+ class="pkt-datepicker__inputs ${this.range && this.showRangeLabels ? "pkt-input__range-inputs" : ""}"
549
+ >
538
550
  <div class="pkt-input__container">
539
551
  ${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
540
552
  <button
541
- class="${w(this.buttonClasses)}"
553
+ class="${x(this.buttonClasses)}"
542
554
  type="button"
543
555
  @click=${this.toggleCalendar}
544
556
  ?disabled=${this.disabled}
@@ -559,9 +571,9 @@ let l = class extends A {
559
571
  handleCalendarPosition() {
560
572
  var e;
561
573
  if (this.popupRef.value && this.inputRef.value) {
562
- const t = this.multiple && !!this.maxlength, a = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), s = t ? a.height + 30 : a.height, i = this.popupRef.value.getBoundingClientRect().height;
563
- let n = t ? "calc(100% - 30px)" : "100%";
564
- a && a.top + i > window.innerHeight && a.top - i > 0 && (n = `calc(100% - ${s}px - ${i}px)`), this.popupRef.value.style.top = n;
574
+ const t = this.multiple && !!this.maxlength, s = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = t ? s.height + 30 : s.height, i = this.popupRef.value.getBoundingClientRect().height;
575
+ let r = t ? "calc(100% - 30px)" : "100%";
576
+ s && s.top + i > window.innerHeight && s.top - i > 0 && (r = `calc(100% - ${a}px - ${i}px)`), this.popupRef.value.style.top = r;
565
577
  }
566
578
  }
567
579
  handleFocusOut(e) {
@@ -578,61 +590,70 @@ let l = class extends A {
578
590
  e.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
579
591
  }
580
592
  };
581
- d([
582
- u({ type: String, reflect: !0 })
593
+ o([
594
+ d({ type: String, reflect: !0 })
583
595
  ], l.prototype, "value", 2);
584
- d([
585
- u({ type: Array })
596
+ o([
597
+ d({ type: Array })
586
598
  ], l.prototype, "_value", 2);
587
- d([
588
- u({ type: String })
599
+ o([
600
+ d({ type: String })
589
601
  ], l.prototype, "label", 2);
590
- d([
591
- u({ type: String })
602
+ o([
603
+ d({ type: String })
592
604
  ], l.prototype, "dateformat", 2);
593
- d([
594
- u({ type: Boolean, reflect: !0 })
605
+ o([
606
+ d({ type: Boolean, reflect: !0 })
595
607
  ], l.prototype, "multiple", 2);
596
- d([
597
- u({ type: Number })
608
+ o([
609
+ d({ type: Number })
598
610
  ], l.prototype, "maxlength", 2);
599
- d([
600
- u({ type: Boolean, reflect: !0 })
611
+ o([
612
+ d({ type: Boolean, reflect: !0 })
601
613
  ], l.prototype, "range", 2);
602
- d([
603
- u({ type: String })
614
+ o([
615
+ d({ type: Boolean })
616
+ ], l.prototype, "showRangeLabels", 2);
617
+ o([
618
+ d({ type: String })
604
619
  ], l.prototype, "min", 2);
605
- d([
606
- u({ type: String })
620
+ o([
621
+ d({ type: String })
607
622
  ], l.prototype, "max", 2);
608
- d([
609
- u({ type: Boolean })
623
+ o([
624
+ d({ type: Boolean })
610
625
  ], l.prototype, "weeknumbers", 2);
611
- d([
612
- u({ type: Boolean })
626
+ o([
627
+ d({ type: Boolean })
613
628
  ], l.prototype, "withcontrols", 2);
614
- d([
615
- u({ type: Boolean })
629
+ o([
630
+ d({ type: Boolean })
616
631
  ], l.prototype, "fullwidth", 2);
617
- d([
618
- u({ converter: P.csvToArray })
632
+ o([
633
+ d({ converter: V.csvToArray })
619
634
  ], l.prototype, "excludedates", 2);
620
- d([
621
- u({ converter: P.csvToArray })
635
+ o([
636
+ d({ converter: V.csvToArray })
622
637
  ], l.prototype, "excludeweekdays", 2);
623
- d([
624
- u({ type: String })
638
+ o([
639
+ d({ type: String })
625
640
  ], l.prototype, "currentmonth", 2);
626
- d([
627
- u({ type: Boolean })
641
+ o([
642
+ d({ type: Boolean })
628
643
  ], l.prototype, "useWrapper", 2);
629
- d([
630
- u({ type: Boolean, reflect: !0 })
644
+ o([
645
+ d({ type: Boolean, reflect: !0 })
631
646
  ], l.prototype, "calendarOpen", 2);
632
- d([
633
- u({ type: String })
647
+ o([
648
+ d({ type: String })
634
649
  ], l.prototype, "timezone", 2);
635
- l = d([
650
+ o([
651
+ P()
652
+ ], l.prototype, "inputClasses", 2);
653
+ o([
654
+ P()
655
+ ], l.prototype, "buttonClasses", 2);
656
+ l = o([
636
657
  H("pkt-datepicker")
637
658
  ], l);
638
659
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CBFF6OHE.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BVbNUNAa.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
@@ -1,4 +1,4 @@
1
- import { P as a, a as m } from "./index-Dw-V4--g.js";
1
+ import { P as a, a as m } from "./index-BQ9BMXel.js";
2
2
  export {
3
3
  a as PktElement,
4
4
  m as PktInputElement
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./helptext-0fI9cWEe.cjs"),t=e.PktHelptext;Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>e.PktHelptext});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./helptext-WCq0-Dq8.cjs"),t=e.PktHelptext;Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>e.PktHelptext});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./helptext-B0Frb38k.js";
1
+ import { P as t } from "./helptext-D-5_-HAW.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktHelptext,
package/dist/pkt-icon.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CBFF6OHE.cjs");require("./custom-element-B-TlBwRu.cjs");const e=require("./index-CqWQt14b.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BVbNUNAa.cjs");require("./custom-element-B-TlBwRu.cjs");const e=require("./index-DYiD-o1w.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
package/dist/pkt-icon.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./index-Dw-V4--g.js";
1
+ import "./index-BQ9BMXel.js";
2
2
  import "./custom-element-CWfU4dcr.js";
3
- import { P as p } from "./index-DkLa0YLm.js";
3
+ import { P as p } from "./index-BfUPq43a.js";
4
4
  export {
5
5
  p as PktIcon
6
6
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-aLVFdclF.cjs"),r=require("./pkt-card.cjs"),n=require("./pkt-component-template.cjs"),o=require("./pkt-datepicker.cjs"),u=require("./helptext-0fI9cWEe.cjs"),a=require("./index-CqWQt14b.cjs"),P=require("./pkt-input-wrapper.cjs"),c=require("./pkt-link.cjs"),i=require("./pkt-messagebox.cjs"),p=require("./modal-FnkYHLoK.cjs"),k=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktAlert",{enumerable:!0,get:()=>e.PktAlert});Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>t.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>r.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>n.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>o.PktDatepicker});Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>u.PktHelptext});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>a.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>P.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>c.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>i.PktMessagebox});Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>p.PktModal});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>k.PktTag});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-DyL6sqFY.cjs"),r=require("./pkt-card.cjs"),n=require("./pkt-component-template.cjs"),o=require("./pkt-datepicker.cjs"),u=require("./helptext-WCq0-Dq8.cjs"),a=require("./index-DYiD-o1w.cjs"),P=require("./pkt-input-wrapper.cjs"),c=require("./pkt-link.cjs"),i=require("./pkt-messagebox.cjs"),p=require("./modal-BXKX0dxk.cjs"),k=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktAlert",{enumerable:!0,get:()=>e.PktAlert});Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>t.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>r.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>n.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>o.PktDatepicker});Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>u.PktHelptext});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>a.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>P.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>c.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>i.PktMessagebox});Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>p.PktModal});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>k.PktTag});
package/dist/pkt-index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { PktAlert as o } from "./pkt-alert.js";
2
- import { P as p } from "./index-DmedytuY.js";
2
+ import { P as p } from "./index-BR7EVgX9.js";
3
3
  import { PktCard as k } from "./pkt-card.js";
4
4
  import { PktComponent as m } from "./pkt-component-template.js";
5
5
  import { PktDatepicker as f } from "./pkt-datepicker.js";
6
- import { P as s } from "./helptext-B0Frb38k.js";
7
- import { P as d } from "./index-DkLa0YLm.js";
6
+ import { P as s } from "./helptext-D-5_-HAW.js";
7
+ import { P as d } from "./index-BfUPq43a.js";
8
8
  import { PktInputWrapper as c } from "./pkt-input-wrapper.js";
9
9
  import { PktLink as i } from "./pkt-link.js";
10
10
  import { PktMessagebox as M } from "./pkt-messagebox.js";
11
- import { P as u } from "./modal-D6J8TqCp.js";
11
+ import { P as u } from "./modal-CYx_wrz1.js";
12
12
  import { PktTag as D } from "./pkt-tag.js";
13
13
  export {
14
14
  o as PktAlert,