@oslokommune/punkt-elements 12.3.4 → 12.3.9

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 (38) hide show
  1. package/dist/{class-map-1LSYgumx.cjs → class-map-CFiVus5w.cjs} +1 -1
  2. package/dist/{class-map-QbdgvBsV.js → class-map-DnAEF9tj.js} +1 -1
  3. package/dist/{index-CGGB6fVA.js → index-BoxUN9GL.js} +100 -85
  4. package/dist/{index-C9AIH4rL.js → index-CiTPWPc2.js} +3 -3
  5. package/dist/{index-t0H-gKGh.js → index-CsKoXqeT.js} +1 -1
  6. package/dist/{index-C7NOKSUx.cjs → index-DZ0cjZdG.cjs} +1 -1
  7. package/dist/{index-CSa2k4ML.cjs → index-DZGlpxj6.cjs} +7 -7
  8. package/dist/{index-B5_qWvbO.cjs → index-ZXmkp0To.cjs} +1 -1
  9. package/dist/index.d.ts +3 -0
  10. package/dist/pkt-alert.cjs +1 -1
  11. package/dist/pkt-alert.js +4 -4
  12. package/dist/pkt-calendar.cjs +1 -1
  13. package/dist/pkt-calendar.js +4 -4
  14. package/dist/pkt-card.cjs +1 -1
  15. package/dist/pkt-card.js +4 -4
  16. package/dist/pkt-component-template.cjs +1 -1
  17. package/dist/pkt-component-template.js +3 -3
  18. package/dist/pkt-datepicker.cjs +9 -9
  19. package/dist/pkt-datepicker.js +58 -57
  20. package/dist/pkt-element.cjs +1 -1
  21. package/dist/pkt-element.js +1 -1
  22. package/dist/pkt-icon.cjs +1 -1
  23. package/dist/pkt-icon.js +2 -2
  24. package/dist/pkt-index.cjs +1 -1
  25. package/dist/pkt-index.js +2 -2
  26. package/dist/pkt-input-wrapper.cjs +1 -1
  27. package/dist/pkt-input-wrapper.js +4 -4
  28. package/dist/pkt-link.cjs +1 -1
  29. package/dist/pkt-link.js +4 -4
  30. package/dist/pkt-messagebox.cjs +1 -1
  31. package/dist/pkt-messagebox.js +4 -4
  32. package/dist/pkt-tag.cjs +1 -1
  33. package/dist/pkt-tag.js +4 -4
  34. package/dist/{ref-v9geUvt6.js → ref-DzpbHCb_.js} +1 -1
  35. package/dist/{ref-BK6FYWo3.cjs → ref-G2cIenWo.cjs} +1 -1
  36. package/package.json +2 -2
  37. package/src/components/datepicker/index.ts +9 -25
  38. package/src/components/element/index.ts +53 -9
@@ -1,28 +1,28 @@
1
- import { R as K, a as z, k as P, D as N, n as y } from "./index-CGGB6fVA.js";
1
+ import { R as K, a as z, k as P, D as N, n as y } from "./index-BoxUN9GL.js";
2
2
  import { e as Z, i as tt, a as et, t as nt } from "./directive-DA0-wdk7.js";
3
- import { u as at, c as M, a as S, p as F, d as rt, i as C, K as D } from "./ref-v9geUvt6.js";
4
- import { R } from "./class-map-QbdgvBsV.js";
3
+ import { u as at, c as M, a as S, p as F, d as rt, i as C, K as D } from "./ref-DzpbHCb_.js";
4
+ import { R } from "./class-map-DnAEF9tj.js";
5
5
  import { a as G } from "./converters-DNCwIFwr.js";
6
- import { s as it, t as k, c as E, m as st, a as ot, g as ut, b as lt, d as dt } from "./index-C9AIH4rL.js";
6
+ import { s as it, t as k, c as _, m as st, a as ot, g as ut, b as lt, d as dt } from "./index-CiTPWPc2.js";
7
7
  import "./pkt-input-wrapper.js";
8
- import "./index-t0H-gKGh.js";
8
+ import "./index-CsKoXqeT.js";
9
9
  import "./pkt-tag.js";
10
10
  function Y(t) {
11
11
  return it(t, { weekStartsOn: 1 });
12
12
  }
13
13
  function U(t) {
14
- const e = k(t), n = e.getFullYear(), a = E(t, 0);
14
+ const e = k(t), n = e.getFullYear(), a = _(t, 0);
15
15
  a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
16
- const r = Y(a), i = E(t, 0);
16
+ const r = Y(a), i = _(t, 0);
17
17
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
18
18
  const s = Y(i);
19
19
  return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
20
20
  }
21
- function A(t) {
21
+ function B(t) {
22
22
  const e = k(t);
23
23
  return e.setHours(0, 0, 0, 0), e;
24
24
  }
25
- function B(t) {
25
+ function H(t) {
26
26
  const e = k(t), n = new Date(
27
27
  Date.UTC(
28
28
  e.getFullYear(),
@@ -37,11 +37,11 @@ function B(t) {
37
37
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
38
38
  }
39
39
  function ct(t, e) {
40
- const n = A(t), a = A(e), r = +n - B(n), i = +a - B(a);
40
+ const n = B(t), a = B(e), r = +n - H(n), i = +a - H(a);
41
41
  return Math.round((r - i) / st);
42
42
  }
43
43
  function ht(t) {
44
- const e = U(t), n = E(t, 0);
44
+ const e = U(t), n = _(t, 0);
45
45
  return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), Y(n);
46
46
  }
47
47
  function mt(t) {
@@ -54,7 +54,7 @@ function ft(t) {
54
54
  return !isNaN(Number(e));
55
55
  }
56
56
  function pt(t) {
57
- const e = k(t), n = E(t, 0);
57
+ const e = k(t), n = _(t, 0);
58
58
  return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
59
59
  }
60
60
  const gt = {
@@ -166,7 +166,7 @@ const vt = {
166
166
  nextWeek: "eeee 'at' p",
167
167
  other: "P"
168
168
  }, Ot = (t, e, n, a) => xt[t];
169
- function W(t) {
169
+ function E(t) {
170
170
  return (e, n) => {
171
171
  const a = n != null && n.context ? String(n.context) : "standalone";
172
172
  let r;
@@ -308,38 +308,38 @@ const Pt = {
308
308
  return n + "th";
309
309
  }, Rt = {
310
310
  ordinalNumber: Ct,
311
- era: W({
311
+ era: E({
312
312
  values: Pt,
313
313
  defaultWidth: "wide"
314
314
  }),
315
- quarter: W({
315
+ quarter: E({
316
316
  values: Mt,
317
317
  defaultWidth: "wide",
318
318
  argumentCallback: (t) => t - 1
319
319
  }),
320
- month: W({
320
+ month: E({
321
321
  values: Dt,
322
322
  defaultWidth: "wide"
323
323
  }),
324
- day: W({
324
+ day: E({
325
325
  values: Tt,
326
326
  defaultWidth: "wide"
327
327
  }),
328
- dayPeriod: W({
328
+ dayPeriod: E({
329
329
  values: $t,
330
330
  defaultWidth: "wide",
331
331
  formattingValues: St,
332
332
  defaultFormattingWidth: "wide"
333
333
  })
334
334
  };
335
- function _(t) {
335
+ function W(t) {
336
336
  return (e, n = {}) => {
337
337
  const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
338
338
  if (!i)
339
339
  return null;
340
- const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ? _t(d, (l) => l.test(s)) : (
340
+ const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ? Wt(d, (l) => l.test(s)) : (
341
341
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
342
- Wt(d, (l) => l.test(s))
342
+ Et(d, (l) => l.test(s))
343
343
  );
344
344
  let v;
345
345
  v = t.valueCallback ? t.valueCallback(g) : g, v = n.valueCallback ? (
@@ -350,17 +350,17 @@ function _(t) {
350
350
  return { value: v, rest: x };
351
351
  };
352
352
  }
353
- function Wt(t, e) {
353
+ function Et(t, e) {
354
354
  for (const n in t)
355
355
  if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
356
356
  return n;
357
357
  }
358
- function _t(t, e) {
358
+ function Wt(t, e) {
359
359
  for (let n = 0; n < t.length; n++)
360
360
  if (e(t[n]))
361
361
  return n;
362
362
  }
363
- function Et(t) {
363
+ function _t(t) {
364
364
  return (e, n = {}) => {
365
365
  const a = e.match(t.matchPattern);
366
366
  if (!a) return null;
@@ -382,13 +382,13 @@ const Yt = /^(\d+)(th|st|nd|rd)?/i, Ft = /\d+/i, qt = {
382
382
  narrow: /^[1234]/i,
383
383
  abbreviated: /^q[1234]/i,
384
384
  wide: /^[1234](th|st|nd|rd)? quarter/i
385
- }, At = {
386
- any: [/1/i, /2/i, /3/i, /4/i]
387
385
  }, Bt = {
386
+ any: [/1/i, /2/i, /3/i, /4/i]
387
+ }, Ht = {
388
388
  narrow: /^[jfmasond]/i,
389
389
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
390
390
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
391
- }, Ht = {
391
+ }, Vt = {
392
392
  narrow: [
393
393
  /^j/i,
394
394
  /^f/i,
@@ -422,7 +422,7 @@ const Yt = /^(\d+)(th|st|nd|rd)?/i, Ft = /\d+/i, qt = {
422
422
  short: /^(su|mo|tu|we|th|fr|sa)/i,
423
423
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
424
424
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
425
- }, Vt = {
425
+ }, At = {
426
426
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
427
427
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
428
428
  }, Lt = {
@@ -440,37 +440,37 @@ const Yt = /^(\d+)(th|st|nd|rd)?/i, Ft = /\d+/i, qt = {
440
440
  night: /night/i
441
441
  }
442
442
  }, Xt = {
443
- ordinalNumber: Et({
443
+ ordinalNumber: _t({
444
444
  matchPattern: Yt,
445
445
  parsePattern: Ft,
446
446
  valueCallback: (t) => parseInt(t, 10)
447
447
  }),
448
- era: _({
448
+ era: W({
449
449
  matchPatterns: qt,
450
450
  defaultMatchWidth: "wide",
451
451
  parsePatterns: It,
452
452
  defaultParseWidth: "any"
453
453
  }),
454
- quarter: _({
454
+ quarter: W({
455
455
  matchPatterns: Nt,
456
456
  defaultMatchWidth: "wide",
457
- parsePatterns: At,
457
+ parsePatterns: Bt,
458
458
  defaultParseWidth: "any",
459
459
  valueCallback: (t) => t + 1
460
460
  }),
461
- month: _({
462
- matchPatterns: Bt,
461
+ month: W({
462
+ matchPatterns: Ht,
463
463
  defaultMatchWidth: "wide",
464
- parsePatterns: Ht,
464
+ parsePatterns: Vt,
465
465
  defaultParseWidth: "any"
466
466
  }),
467
- day: _({
467
+ day: W({
468
468
  matchPatterns: jt,
469
469
  defaultMatchWidth: "wide",
470
- parsePatterns: Vt,
470
+ parsePatterns: At,
471
471
  defaultParseWidth: "any"
472
472
  }),
473
- dayPeriod: _({
473
+ dayPeriod: W({
474
474
  matchPatterns: Lt,
475
475
  defaultMatchWidth: "any",
476
476
  parsePatterns: Qt,
@@ -563,7 +563,7 @@ const b = {
563
563
  afternoon: "afternoon",
564
564
  evening: "evening",
565
565
  night: "night"
566
- }, H = {
566
+ }, V = {
567
567
  // Era
568
568
  G: function(t, e, n) {
569
569
  const a = t.getFullYear() > 0 ? 1 : 0;
@@ -989,7 +989,7 @@ const b = {
989
989
  return "Z";
990
990
  switch (e) {
991
991
  case "X":
992
- return V(a);
992
+ return A(a);
993
993
  case "XXXX":
994
994
  case "XX":
995
995
  return T(a);
@@ -1004,7 +1004,7 @@ const b = {
1004
1004
  const a = t.getTimezoneOffset();
1005
1005
  switch (e) {
1006
1006
  case "x":
1007
- return V(a);
1007
+ return A(a);
1008
1008
  case "xxxx":
1009
1009
  case "xx":
1010
1010
  return T(a);
@@ -1055,7 +1055,7 @@ function j(t, e = "") {
1055
1055
  const n = t > 0 ? "-" : "+", a = Math.abs(t), r = Math.trunc(a / 60), i = a % 60;
1056
1056
  return i === 0 ? n + String(r) : n + String(r) + e + o(i, 2);
1057
1057
  }
1058
- function V(t, e) {
1058
+ function A(t, e) {
1059
1059
  return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : T(t, e);
1060
1060
  }
1061
1061
  function T(t, e = "") {
@@ -1144,7 +1144,7 @@ function ce(t, e, n) {
1144
1144
  const c = u[0];
1145
1145
  if (c === "'")
1146
1146
  return { isToken: !1, value: he(u) };
1147
- if (H[c])
1147
+ if (V[c])
1148
1148
  return { isToken: !0, value: u };
1149
1149
  if (c.match(de))
1150
1150
  throw new RangeError(
@@ -1162,7 +1162,7 @@ function ce(t, e, n) {
1162
1162
  if (!u.isToken) return u.value;
1163
1163
  const c = u.value;
1164
1164
  (ae(c) || ne(c)) && re(c, e, String(t));
1165
- const O = H[c[0]];
1165
+ const O = V[c[0]];
1166
1166
  return O(d, c, r.localize, v);
1167
1167
  }).join("");
1168
1168
  }
@@ -1388,12 +1388,15 @@ const Q = (t, e, n) => {
1388
1388
  }
1389
1389
  }, ye = {
1390
1390
  change: {
1391
- description: "Returnerer kommaseparert liste av valgte datoer i ISO-format"
1391
+ type: "Event",
1392
+ description: "Returnerer valgt dato som streng i ISO-format"
1392
1393
  },
1393
- "value-changed": {
1394
+ "value-change": {
1395
+ type: "CustomEvent",
1394
1396
  description: "Returnerer en <code>array</code> med valgte datoer i ISO-format"
1395
1397
  },
1396
1398
  toggleHelpText: {
1399
+ type: "CustomEvent",
1397
1400
  description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
1398
1401
  }
1399
1402
  }, w = {
@@ -1452,17 +1455,15 @@ let m = class extends z {
1452
1455
  });
1453
1456
  }
1454
1457
  attributeChangedCallback(t, e, n) {
1455
- t === "value" && (this.value === "" || this.value.length === 0 || typeof this.value > "u" ? this._value = [] : this.value.length && this._value.length === 0 && (!Array.isArray(this.value) && this.value.includes(",") && (this.value = this.value.split(",")), this._value = Array.isArray(this.value) ? this.value : this.value.split(","))), t === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (n == null ? void 0 : n.split(",")) ?? []), t === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (n == null ? void 0 : n.split(",")) ?? []), super.attributeChangedCallback(t, e, n);
1458
+ t === "value" && this.valueChanged(this.value, e), t === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (n == null ? void 0 : n.split(",")) ?? []), t === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (n == null ? void 0 : n.split(",")) ?? []), super.attributeChangedCallback(t, e, n);
1456
1459
  }
1457
1460
  firstUpdated(t) {
1458
1461
  super.firstUpdated(t);
1459
1462
  }
1460
1463
  updated(t) {
1461
- var e;
1462
1464
  if (super.updated(t), t.has("value")) {
1463
- if (this.range && this._value.length === 1 || ((e = t.get("value")) == null ? void 0 : e.toString()) === this.value.toString())
1464
- return;
1465
- this.onInput(this.value);
1465
+ if (this.range && this._value.length === 1) return;
1466
+ this.valueChanged(this.value, t.get("value"));
1466
1467
  }
1467
1468
  }
1468
1469
  /**
@@ -1477,7 +1478,7 @@ let m = class extends z {
1477
1478
  class="${R(this.inputClasses)}"
1478
1479
  type="date"
1479
1480
  id="${this.id}-input"
1480
- value=${this.value}
1481
+ .value=${this._value[0] ?? ""}
1481
1482
  min=${this.min}
1482
1483
  max=${this.max}
1483
1484
  @click=${(t) => {
@@ -1485,7 +1486,7 @@ let m = class extends z {
1485
1486
  }}
1486
1487
  ?disabled=${this.disabled}
1487
1488
  @blur=${(t) => {
1488
- this.manageValidity(t.target), this.value = t.target.value, this._value = this.massageDates(t.target.value.split(","));
1489
+ this.manageValidity(t.target), this.value = t.target.value;
1489
1490
  }}
1490
1491
  @change=${(t) => {
1491
1492
  t.stopImmediatePropagation();
@@ -1501,7 +1502,7 @@ let m = class extends z {
1501
1502
  class=${R(this.inputClasses)}
1502
1503
  type="date"
1503
1504
  id="${this.id}-input"
1504
- value=${this._value[0] ?? ""}
1505
+ .value=${this._value[0] ?? ""}
1505
1506
  min=${this.min}
1506
1507
  max=${this.max}
1507
1508
  @click=${(t) => {
@@ -1514,7 +1515,7 @@ let m = class extends z {
1514
1515
  this.manageValidity(t.target);
1515
1516
  const a = this.fromISOToDate(t.target.value);
1516
1517
  a && this._value[0] !== t.target.value && this._value[1] && ((n = (e = this.calRef) == null ? void 0 : e.value) == null || n.handleDateSelect(a));
1517
- }
1518
+ } else this._value[0] && this.clearInputValue();
1518
1519
  }}
1519
1520
  @change=${(t) => {
1520
1521
  t.stopImmediatePropagation();
@@ -1526,7 +1527,7 @@ let m = class extends z {
1526
1527
  class=${R(this.inputClasses)}
1527
1528
  type="date"
1528
1529
  id="${this.id}-to"
1529
- value=${this._value[1] ?? ""}
1530
+ .value=${this._value[1] ?? ""}
1530
1531
  min=${this.min}
1531
1532
  max=${this.max}
1532
1533
  @click=${(t) => {
@@ -1624,7 +1625,7 @@ let m = class extends z {
1624
1625
  .excludeweekdays=${this.excludeweekdays}
1625
1626
  .currentmonth=${new Date(this.currentmonth)}
1626
1627
  @date-selected=${(t) => {
1627
- this.value = !this.multiple && !this.range ? Array.isArray(t.detail) ? t.detail[0] : t.detail.split(",")[0] : t.detail, this._value = t.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] : ""));
1628
+ this.value = !this.multiple && !this.range ? t.detail[0] : t.detail, this._value = t.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] : ""));
1628
1629
  }}
1629
1630
  @close=${this.hideCalendar}
1630
1631
  ${D(this.calRef)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSa2k4ML.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DZGlpxj6.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
@@ -1,4 +1,4 @@
1
- import { P as a, a as m } from "./index-CGGB6fVA.js";
1
+ import { P as a, a as m } from "./index-BoxUN9GL.js";
2
2
  export {
3
3
  a as PktElement,
4
4
  m as PktInputElement
package/dist/pkt-icon.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSa2k4ML.cjs");require("./directive-19_ixLKS.cjs");const e=require("./index-C7NOKSUx.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DZGlpxj6.cjs");require("./directive-19_ixLKS.cjs");const e=require("./index-DZ0cjZdG.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
package/dist/pkt-icon.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./index-CGGB6fVA.js";
1
+ import "./index-BoxUN9GL.js";
2
2
  import "./directive-DA0-wdk7.js";
3
- import { P as p } from "./index-t0H-gKGh.js";
3
+ import { P as p } from "./index-CsKoXqeT.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("./index-B5_qWvbO.cjs"),t=require("./pkt-card.cjs"),r=require("./pkt-component-template.cjs"),n=require("./pkt-datepicker.cjs"),o=require("./index-C7NOKSUx.cjs"),a=require("./pkt-input-wrapper.cjs"),u=require("./pkt-link.cjs"),c=require("./pkt-messagebox.cjs"),i=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>t.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>r.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>n.PktDatepicker});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>o.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>a.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>u.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>c.PktMessagebox});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>i.PktTag});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ZXmkp0To.cjs"),t=require("./pkt-card.cjs"),r=require("./pkt-component-template.cjs"),n=require("./pkt-datepicker.cjs"),o=require("./index-DZ0cjZdG.cjs"),a=require("./pkt-input-wrapper.cjs"),u=require("./pkt-link.cjs"),c=require("./pkt-messagebox.cjs"),i=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>t.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>r.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>n.PktDatepicker});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>o.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>a.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>u.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>c.PktMessagebox});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>i.PktTag});
package/dist/pkt-index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { P as t } from "./index-C9AIH4rL.js";
1
+ import { P as t } from "./index-CiTPWPc2.js";
2
2
  import { PktCard as p } from "./pkt-card.js";
3
3
  import { PktComponent as P } from "./pkt-component-template.js";
4
4
  import { PktDatepicker as x } from "./pkt-datepicker.js";
5
- import { P as f } from "./index-t0H-gKGh.js";
5
+ import { P as f } from "./index-CsKoXqeT.js";
6
6
  import { PktInputWrapper as s } from "./pkt-input-wrapper.js";
7
7
  import { PktLink as c } from "./pkt-link.js";
8
8
  import { PktMessagebox as g } from "./pkt-messagebox.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSa2k4ML.cjs"),f=require("./ref-BK6FYWo3.cjs"),c=require("./index-C7NOKSUx.cjs"),u=require("./class-map-1LSYgumx.cjs"),$=require("./directive-19_ixLKS.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DZGlpxj6.cjs"),f=require("./ref-G2cIenWo.cjs"),c=require("./index-DZ0cjZdG.cjs"),u=require("./class-map-CFiVus5w.cjs"),$=require("./directive-19_ixLKS.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,7 +1,7 @@
1
- import { P as w, v as T, D as o, k as i, n as r } from "./index-CGGB6fVA.js";
2
- import { i as _, P as D, K as I } from "./ref-v9geUvt6.js";
3
- import { a as f } from "./index-t0H-gKGh.js";
4
- import { R as c } from "./class-map-QbdgvBsV.js";
1
+ import { P as w, v as T, D as o, k as i, n as r } from "./index-BoxUN9GL.js";
2
+ import { i as _, P as D, K as I } from "./ref-DzpbHCb_.js";
3
+ import { a as f } from "./index-CsKoXqeT.js";
4
+ import { R as c } from "./class-map-DnAEF9tj.js";
5
5
  import { t as S } from "./directive-DA0-wdk7.js";
6
6
  /**
7
7
  * @license
package/dist/pkt-link.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSa2k4ML.cjs"),c=require("./ref-BK6FYWo3.cjs"),k=require("./class-map-1LSYgumx.cjs"),h=require("./directive-19_ixLKS.cjs");require("./index-C7NOKSUx.cjs");const f="pkt-link",u=!0,d={href:{name:"URL",description:"URL til lenken",type:"string",default:"#"},target:{name:"Mål",description:"Mål for lenken",type:["_blank","_self","_parent","_top"],default:"_self"},iconName:{name:"Ikon",description:"Ikon som skal vises ved siden av lenketeksten",type:"icon"},iconPosition:{name:"Ikonposisjon",description:"Posisjonen til ikonet i forhold til lenketeksten",type:["left","right"]},external:{name:"Ekstern lenke",description:"Vis ikon for ekstern lenke",type:"boolean",default:!1}},m={default:{description:"Innholdet i lenken"}},p={name:f,"css-class":"pkt-link","dark-mode":!0,isElement:u,props:d,slots:m};var P=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(s,n,r,o)=>{for(var t=o>1?void 0:o?y(n,r):n,l=s.length-1,a;l>=0;l--)(a=s[l])&&(t=(o?a(n,r,t):a(t))||t);return o&&t&&P(n,r,t),t};exports.PktLink=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.href=p.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=p.props.external.default,this.target=p.props.target.default,this.slotController=new c.PktSlotController(this,this.defaultSlot)}render(){const n={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return e.ke`<a
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DZGlpxj6.cjs"),c=require("./ref-G2cIenWo.cjs"),k=require("./class-map-CFiVus5w.cjs"),h=require("./directive-19_ixLKS.cjs");require("./index-DZ0cjZdG.cjs");const f="pkt-link",u=!0,d={href:{name:"URL",description:"URL til lenken",type:"string",default:"#"},target:{name:"Mål",description:"Mål for lenken",type:["_blank","_self","_parent","_top"],default:"_self"},iconName:{name:"Ikon",description:"Ikon som skal vises ved siden av lenketeksten",type:"icon"},iconPosition:{name:"Ikonposisjon",description:"Posisjonen til ikonet i forhold til lenketeksten",type:["left","right"]},external:{name:"Ekstern lenke",description:"Vis ikon for ekstern lenke",type:"boolean",default:!1}},m={default:{description:"Innholdet i lenken"}},p={name:f,"css-class":"pkt-link","dark-mode":!0,isElement:u,props:d,slots:m};var P=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(s,n,r,o)=>{for(var t=o>1?void 0:o?y(n,r):n,l=s.length-1,a;l>=0;l--)(a=s[l])&&(t=(o?a(n,r,t):a(t))||t);return o&&t&&P(n,r,t),t};exports.PktLink=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.href=p.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=p.props.external.default,this.target=p.props.target.default,this.slotController=new c.PktSlotController(this,this.defaultSlot)}render(){const n={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return e.ke`<a
2
2
  class=${k.Rt(n)}
3
3
  href=${this.href}
4
4
  @click=${this.handleClick}
package/dist/pkt-link.js CHANGED
@@ -1,8 +1,8 @@
1
- import { P as f, k, D as h, n as i } from "./index-CGGB6fVA.js";
2
- import { i as m, P as d, K as u } from "./ref-v9geUvt6.js";
3
- import { R as P } from "./class-map-QbdgvBsV.js";
1
+ import { P as f, k, D as h, n as i } from "./index-BoxUN9GL.js";
2
+ import { i as m, P as d, K as u } from "./ref-DzpbHCb_.js";
3
+ import { R as P } from "./class-map-DnAEF9tj.js";
4
4
  import { t as y } from "./directive-DA0-wdk7.js";
5
- import "./index-t0H-gKGh.js";
5
+ import "./index-CsKoXqeT.js";
6
6
  const g = "pkt-link", v = !0, _ = {
7
7
  href: {
8
8
  name: "URL",
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSa2k4ML.cjs"),c=require("./ref-BK6FYWo3.cjs"),p=require("./class-map-1LSYgumx.cjs"),b=require("./directive-19_ixLKS.cjs");require("./index-C7NOKSUx.cjs");var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=(i,o,r,l)=>{for(var t=l>1?void 0:l?u(o,r):o,a=i.length-1,n;a>=0;a--)(n=i[a])&&(t=(l?n(o,r,t):n(t))||t);return l&&t&&k(o,r,t),t};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.closable=!1,this.compact=!1,this.title="",this.skin="beige",this.isDisplayed=!0,this.slotController=new c.PktSlotController(this,this.defaultSlot)}handleClose(){this.isDisplayed=!1,this.onClose&&this.onClose()}render(){const o={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable};return this.isDisplayed?e.ke`<div class=${p.Rt(o)}>
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DZGlpxj6.cjs"),c=require("./ref-G2cIenWo.cjs"),p=require("./class-map-CFiVus5w.cjs"),b=require("./directive-19_ixLKS.cjs");require("./index-DZ0cjZdG.cjs");var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=(i,o,r,l)=>{for(var t=l>1?void 0:l?u(o,r):o,a=i.length-1,n;a>=0;a--)(n=i[a])&&(t=(l?n(o,r,t):n(t))||t);return l&&t&&k(o,r,t),t};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.closable=!1,this.compact=!1,this.title="",this.skin="beige",this.isDisplayed=!0,this.slotController=new c.PktSlotController(this,this.defaultSlot)}handleClose(){this.isDisplayed=!1,this.onClose&&this.onClose()}render(){const o={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable};return this.isDisplayed?e.ke`<div class=${p.Rt(o)}>
2
2
  ${this.closable?e.ke`<div class="pkt-messagebox__close">
3
3
  <button
4
4
  @click=${this.handleClose}
@@ -1,8 +1,8 @@
1
- import { P as m, D as c, k as h, n as o } from "./index-CGGB6fVA.js";
2
- import { i as b, P as f, K as k } from "./ref-v9geUvt6.js";
3
- import { R as u } from "./class-map-QbdgvBsV.js";
1
+ import { P as m, D as c, k as h, n as o } from "./index-BoxUN9GL.js";
2
+ import { i as b, P as f, K as k } from "./ref-DzpbHCb_.js";
3
+ import { R as u } from "./class-map-DnAEF9tj.js";
4
4
  import { t as y } from "./directive-DA0-wdk7.js";
5
- import "./index-t0H-gKGh.js";
5
+ import "./index-CsKoXqeT.js";
6
6
  var d = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (l, i, p, r) => {
7
7
  for (var e = r > 1 ? void 0 : r ? v(i, p) : i, a = l.length - 1, n; a >= 0; a--)
8
8
  (n = l[a]) && (e = (r ? n(i, p, e) : n(e)) || e);
package/dist/pkt-tag.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-1LSYgumx.cjs"),g=require("./directive-19_ixLKS.cjs"),t=require("./index-CSa2k4ML.cjs"),o=require("./ref-BK6FYWo3.cjs");require("./index-C7NOKSUx.cjs");const h="pkt-tag",k={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"close"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",props:k,slots:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,e=(n,s,r,l)=>{for(var i=l>1?void 0:l?y(s,r):s,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(l?c(s,r,i):c(i))||i);return l&&i&&d(s,r,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.ii(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("onClose",{detail:{origin:s},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const s={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},r={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName};return this.closeTag?this._isClosed?t.D:t.ke`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-CFiVus5w.cjs"),g=require("./directive-19_ixLKS.cjs"),t=require("./index-DZGlpxj6.cjs"),o=require("./ref-G2cIenWo.cjs");require("./index-DZ0cjZdG.cjs");const h="pkt-tag",k={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"close"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",props:k,slots:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,e=(n,s,r,l)=>{for(var i=l>1?void 0:l?y(s,r):s,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(l?c(s,r,i):c(i))||i);return l&&i&&d(s,r,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.ii(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("onClose",{detail:{origin:s},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const s={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},r={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName};return this.closeTag?this._isClosed?t.D:t.ke`
2
2
  <button
3
3
  class=${u.Rt(r)}
4
4
  type=${this.type}
package/dist/pkt-tag.js CHANGED
@@ -1,8 +1,8 @@
1
- import { R as h } from "./class-map-QbdgvBsV.js";
1
+ import { R as h } from "./class-map-DnAEF9tj.js";
2
2
  import { t as y } from "./directive-DA0-wdk7.js";
3
- import { r as d, P as g, k as p, D as k, n as i } from "./index-CGGB6fVA.js";
4
- import { i as m, P as b, K as f } from "./ref-v9geUvt6.js";
5
- import "./index-t0H-gKGh.js";
3
+ import { r as d, P as g, k as p, D as k, n as i } from "./index-BoxUN9GL.js";
4
+ import { i as m, P as b, K as f } from "./ref-DzpbHCb_.js";
5
+ import "./index-CsKoXqeT.js";
6
6
  const S = "pkt-tag", _ = {
7
7
  closeTag: {
8
8
  type: "boolean",
@@ -1,4 +1,4 @@
1
- import { s as p, D as _ } from "./index-CGGB6fVA.js";
1
+ import { s as p, D as _ } from "./index-BoxUN9GL.js";
2
2
  import { i as v, a as m, e as g } from "./directive-DA0-wdk7.js";
3
3
  class H {
4
4
  constructor(e, ...s) {
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./index-CSa2k4ML.cjs"),$=require("./directive-19_ixLKS.cjs");class p{constructor(e,...s){this.nodes=[],this.host=e,this.host.addController(this),this.slots=s,this.nodes=[]}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{var s;if(e.nodeName==="#text"){if((s=e.nodeValue)!=null&&s.trim()){const i=document==null?void 0:document.createElement("template");i.content.appendChild(e),this.nodes.push(i)}}else this.nodes.push(e)})}hostUpdated(){this.slots.forEach(e=>{if(!e.value)return;const s=e.value.getAttribute("name"),i=this.nodes.flatMap(n=>n.getAttribute&&n.getAttribute("slot")==s?this.nodeFromElement(n,e):[]);i.length&&e.value.replaceChildren(...i)})}nodeFromElement(e,s){var i;return e===((i=s.value)==null?void 0:i.parentNode)?[]:e instanceof HTMLTemplateElement?Array.from(e.content.childNodes):e}}/**
1
+ "use strict";const a=require("./index-DZGlpxj6.cjs"),$=require("./directive-19_ixLKS.cjs");class p{constructor(e,...s){this.nodes=[],this.host=e,this.host.addController(this),this.slots=s,this.nodes=[]}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{var s;if(e.nodeName==="#text"){if((s=e.nodeValue)!=null&&s.trim()){const i=document==null?void 0:document.createElement("template");i.content.appendChild(e),this.nodes.push(i)}}else this.nodes.push(e)})}hostUpdated(){this.slots.forEach(e=>{if(!e.value)return;const s=e.value.getAttribute("name"),i=this.nodes.flatMap(n=>n.getAttribute&&n.getAttribute("slot")==s?this.nodeFromElement(n,e):[]);i.length&&e.value.replaceChildren(...i)})}nodeFromElement(e,s){var i;return e===((i=s.value)==null?void 0:i.parentNode)?[]:e instanceof HTMLTemplateElement?Array.from(e.content.childNodes):e}}/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.3.4",
3
+ "version": "12.3.9",
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",
@@ -55,5 +55,5 @@
55
55
  "url": "https://github.com/oslokommune/punkt/issues"
56
56
  },
57
57
  "license": "MIT",
58
- "gitHead": "03713d6eb45c661add11500370667746903294dc"
58
+ "gitHead": "794e48054ce7da8965056cca1d34a731d5edc318"
59
59
  }
@@ -134,14 +134,7 @@ export class PktDatepicker extends PktInputElement {
134
134
 
135
135
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
136
136
  if (name === 'value') {
137
- if (this.value === '' || this.value.length === 0 || typeof this.value === 'undefined') {
138
- this._value = []
139
- } else if (this.value.length && this._value.length === 0) {
140
- if (!Array.isArray(this.value) && this.value.includes(',')) {
141
- this.value = this.value.split(',')
142
- }
143
- this._value = !Array.isArray(this.value) ? this.value.split(',') : this.value
144
- }
137
+ this.valueChanged(this.value, _old)
145
138
  }
146
139
 
147
140
  if (name === 'excludedates' && typeof this.excludedates === 'string') {
@@ -161,13 +154,8 @@ export class PktDatepicker extends PktInputElement {
161
154
  updated(changedProperties: PropertyValues): void {
162
155
  super.updated(changedProperties)
163
156
  if (changedProperties.has('value')) {
164
- if (this.range && this._value.length === 1) {
165
- return
166
- }
167
- if (changedProperties.get('value')?.toString() === this.value.toString()) {
168
- return
169
- }
170
- this.onInput(this.value)
157
+ if (this.range && this._value.length === 1) return
158
+ this.valueChanged(this.value, changedProperties.get('value'))
171
159
  }
172
160
  }
173
161
 
@@ -240,7 +228,7 @@ export class PktDatepicker extends PktInputElement {
240
228
  class="${classMap(this.inputClasses)}"
241
229
  type="date"
242
230
  id="${this.id}-input"
243
- value=${this.value}
231
+ .value=${this._value[0] ?? ''}
244
232
  min=${this.min}
245
233
  max=${this.max}
246
234
  @click=${(e: MouseEvent) => {
@@ -251,7 +239,6 @@ export class PktDatepicker extends PktInputElement {
251
239
  @blur=${(e: Event) => {
252
240
  this.manageValidity(e.target as HTMLInputElement)
253
241
  this.value = (e.target as HTMLInputElement).value
254
- this._value = this.massageDates((e.target as HTMLInputElement).value.split(','))
255
242
  }}
256
243
  @change=${(e: Event) => {
257
244
  e.stopImmediatePropagation()
@@ -268,7 +255,7 @@ export class PktDatepicker extends PktInputElement {
268
255
  class=${classMap(this.inputClasses)}
269
256
  type="date"
270
257
  id="${this.id}-input"
271
- value=${this._value[0] ?? ''}
258
+ .value=${this._value[0] ?? ''}
272
259
  min=${this.min}
273
260
  max=${this.max}
274
261
  @click=${(e: MouseEvent) => {
@@ -285,6 +272,8 @@ export class PktDatepicker extends PktInputElement {
285
272
  this.calRef?.value?.handleDateSelect(date)
286
273
  }
287
274
  }
275
+ } else if (this._value[0]) {
276
+ this.clearInputValue()
288
277
  }
289
278
  }}
290
279
  @change=${(e: Event) => {
@@ -297,7 +286,7 @@ export class PktDatepicker extends PktInputElement {
297
286
  class=${classMap(this.inputClasses)}
298
287
  type="date"
299
288
  id="${this.id}-to"
300
- value=${this._value[1] ?? ''}
289
+ .value=${this._value[1] ?? ''}
301
290
  min=${this.min}
302
291
  max=${this.max}
303
292
  @click=${(e: MouseEvent) => {
@@ -411,12 +400,7 @@ export class PktDatepicker extends PktInputElement {
411
400
  .excludeweekdays=${this.excludeweekdays}
412
401
  .currentmonth=${new Date(this.currentmonth)}
413
402
  @date-selected=${(e: CustomEvent) => {
414
- this.value =
415
- !this.multiple && !this.range
416
- ? !Array.isArray(e.detail)
417
- ? e.detail.split(',')[0]
418
- : e.detail[0]
419
- : e.detail
403
+ this.value = !this.multiple && !this.range ? e.detail[0] : e.detail
420
404
  this._value = e.detail
421
405
  if (this.inputRef.value) {
422
406
  if (this.range && this.inputRefTo.value) {