@oslokommune/punkt-elements 12.6.3 → 12.6.6
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.
- package/dist/{class-map-Ch54kkX5.cjs → class-map-DjxCaVFk.cjs} +1 -1
- package/dist/{class-map-DunDFQn7.js → class-map-luGhSuLj.js} +1 -1
- package/dist/{index-CyqOyy_9.js → index-B-KXmo65.js} +1 -1
- package/dist/{index-DSyh6tUw.cjs → index-BYZhBzXZ.cjs} +1 -1
- package/dist/{index-BI6-RUqp.js → index-BkXggpNp.js} +123 -110
- package/dist/{index-CsTujnXs.js → index-CF6_-ZoF.js} +15 -12
- package/dist/{index-BNOnscrA.cjs → index-CzPkBTm-.cjs} +29 -18
- package/dist/{index-Bpc07w_P.cjs → index-DAWAnAW_.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +18 -14
- package/dist/pkt-datepicker.js +40 -37
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +2 -2
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +4 -4
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-tag.cjs +2 -2
- package/dist/pkt-tag.js +13 -13
- package/dist/{ref-C3InMDfU.cjs → ref-BuQtfKiL.cjs} +1 -1
- package/dist/{ref-By_W8A-f.js → ref-rfvuMlT1.js} +1 -1
- package/package.json +3 -3
- package/src/components/calendar/index.ts +22 -8
- package/src/components/datepicker/index.ts +22 -6
package/dist/pkt-datepicker.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as K, a as z, x as M, E as
|
|
1
|
+
import { T as K, a as z, x as M, E as N, n as y } from "./index-CF6_-ZoF.js";
|
|
2
2
|
import { e as Z, i as tt, a as et, t as nt } from "./directive-Cxhakbpr.js";
|
|
3
|
-
import { p as at, v as O, r as S, M as Y, m as rt, e as C, n as P } from "./ref-
|
|
4
|
-
import { e as R } from "./class-map-
|
|
3
|
+
import { p as at, v as O, r as S, M as Y, m as rt, e as C, n as P } from "./ref-rfvuMlT1.js";
|
|
4
|
+
import { e as R } from "./class-map-luGhSuLj.js";
|
|
5
5
|
import { a as G } from "./converters-DNCwIFwr.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-
|
|
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-BkXggpNp.js";
|
|
7
7
|
import "./pkt-input-wrapper.js";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-B-KXmo65.js";
|
|
9
9
|
import "./pkt-tag.js";
|
|
10
10
|
function I(t) {
|
|
11
11
|
return it(t, { weekStartsOn: 1 });
|
|
@@ -18,11 +18,11 @@ function U(t) {
|
|
|
18
18
|
const s = I(i);
|
|
19
19
|
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function B(t) {
|
|
22
22
|
const e = k(t);
|
|
23
23
|
return e.setHours(0, 0, 0, 0), e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function V(t) {
|
|
26
26
|
const e = k(t), n = new Date(
|
|
27
27
|
Date.UTC(
|
|
28
28
|
e.getFullYear(),
|
|
@@ -37,7 +37,7 @@ function j(t) {
|
|
|
37
37
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
38
38
|
}
|
|
39
39
|
function ct(t, e) {
|
|
40
|
-
const n =
|
|
40
|
+
const n = B(t), a = B(e), r = +n - V(n), i = +a - V(a);
|
|
41
41
|
return Math.round((r - i) / st);
|
|
42
42
|
}
|
|
43
43
|
function ht(t) {
|
|
@@ -563,7 +563,7 @@ const b = {
|
|
|
563
563
|
afternoon: "afternoon",
|
|
564
564
|
evening: "evening",
|
|
565
565
|
night: "night"
|
|
566
|
-
},
|
|
566
|
+
}, j = {
|
|
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
|
|
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
|
|
1007
|
+
return A(a);
|
|
1008
1008
|
case "xxxx":
|
|
1009
1009
|
case "xx":
|
|
1010
1010
|
return T(a);
|
|
@@ -1021,7 +1021,7 @@ const b = {
|
|
|
1021
1021
|
case "O":
|
|
1022
1022
|
case "OO":
|
|
1023
1023
|
case "OOO":
|
|
1024
|
-
return "GMT" +
|
|
1024
|
+
return "GMT" + H(a, ":");
|
|
1025
1025
|
case "OOOO":
|
|
1026
1026
|
default:
|
|
1027
1027
|
return "GMT" + T(a, ":");
|
|
@@ -1034,7 +1034,7 @@ const b = {
|
|
|
1034
1034
|
case "z":
|
|
1035
1035
|
case "zz":
|
|
1036
1036
|
case "zzz":
|
|
1037
|
-
return "GMT" +
|
|
1037
|
+
return "GMT" + H(a, ":");
|
|
1038
1038
|
case "zzzz":
|
|
1039
1039
|
default:
|
|
1040
1040
|
return "GMT" + T(a, ":");
|
|
@@ -1051,18 +1051,18 @@ const b = {
|
|
|
1051
1051
|
return o(a, e.length);
|
|
1052
1052
|
}
|
|
1053
1053
|
};
|
|
1054
|
-
function
|
|
1054
|
+
function H(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
|
|
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 = "") {
|
|
1062
1062
|
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = o(Math.trunc(a / 60), 2), i = o(a % 60, 2);
|
|
1063
1063
|
return n + r + e + i;
|
|
1064
1064
|
}
|
|
1065
|
-
const
|
|
1065
|
+
const L = (t, e) => {
|
|
1066
1066
|
switch (t) {
|
|
1067
1067
|
case "P":
|
|
1068
1068
|
return e.date({ width: "short" });
|
|
@@ -1089,7 +1089,7 @@ const Q = (t, e) => {
|
|
|
1089
1089
|
}, Kt = (t, e) => {
|
|
1090
1090
|
const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
|
|
1091
1091
|
if (!r)
|
|
1092
|
-
return
|
|
1092
|
+
return L(t, e);
|
|
1093
1093
|
let i;
|
|
1094
1094
|
switch (a) {
|
|
1095
1095
|
case "P":
|
|
@@ -1106,7 +1106,7 @@ const Q = (t, e) => {
|
|
|
1106
1106
|
i = e.dateTime({ width: "full" });
|
|
1107
1107
|
break;
|
|
1108
1108
|
}
|
|
1109
|
-
return i.replace("{{date}}",
|
|
1109
|
+
return i.replace("{{date}}", L(a, e)).replace("{{time}}", J(r, e));
|
|
1110
1110
|
}, zt = {
|
|
1111
1111
|
p: J,
|
|
1112
1112
|
P: Kt
|
|
@@ -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 (
|
|
1147
|
+
if (j[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 $ =
|
|
1165
|
+
const $ = j[c[0]];
|
|
1166
1166
|
return $(d, c, r.localize, v);
|
|
1167
1167
|
}).join("");
|
|
1168
1168
|
}
|
|
@@ -1175,7 +1175,7 @@ function he(t) {
|
|
|
1175
1175
|
* Copyright 2017 Google LLC
|
|
1176
1176
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1177
1177
|
*/
|
|
1178
|
-
const
|
|
1178
|
+
const Q = (t, e, n) => {
|
|
1179
1179
|
const a = /* @__PURE__ */ new Map();
|
|
1180
1180
|
for (let r = e; r <= n; r++) a.set(t[r], r);
|
|
1181
1181
|
return a;
|
|
@@ -1205,11 +1205,11 @@ const X = (t, e, n) => {
|
|
|
1205
1205
|
else if (d[m] === s[u]) g[u] = O(r[m], i[u]), m--, u--;
|
|
1206
1206
|
else if (d[l] === s[u]) g[u] = O(r[l], i[u]), S(t, g[u + 1], r[l]), l++, u--;
|
|
1207
1207
|
else if (d[m] === s[h]) g[h] = O(r[m], i[h]), S(t, r[l], r[m]), m--, h++;
|
|
1208
|
-
else if (v === void 0 && (v =
|
|
1208
|
+
else if (v === void 0 && (v = Q(s, h, u), x = Q(d, l, m)), v.has(d[l])) if (v.has(d[m])) {
|
|
1209
1209
|
const c = x.get(s[h]), $ = c !== void 0 ? r[c] : null;
|
|
1210
1210
|
if ($ === null) {
|
|
1211
|
-
const
|
|
1212
|
-
O(
|
|
1211
|
+
const q = S(t, r[l]);
|
|
1212
|
+
O(q, i[h]), g[h] = q;
|
|
1213
1213
|
} else g[h] = O($, i[h]), S(t, r[l], $), r[c] = null;
|
|
1214
1214
|
h++;
|
|
1215
1215
|
} else Y(r[m]), m--;
|
|
@@ -1411,7 +1411,7 @@ var ve = Object.defineProperty, we = Object.getOwnPropertyDescriptor, p = (t, e,
|
|
|
1411
1411
|
(s = t[i]) && (r = (a ? s(e, n, r) : s(r)) || r);
|
|
1412
1412
|
return a && r && ve(e, n, r), r;
|
|
1413
1413
|
};
|
|
1414
|
-
const
|
|
1414
|
+
const X = (t) => new Promise((e) => setTimeout(e, t));
|
|
1415
1415
|
let f = class extends z {
|
|
1416
1416
|
constructor() {
|
|
1417
1417
|
super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = w.props.helptextDropdownButton.default, this.dateformat = w.props.dateformat.default, this.multiple = w.props.multiple.default, this.maxlength = w.props.maxlength.default, this.range = w.props.range.default, this.weeknumbers = w.props.weeknumbers.default, this.withcontrols = w.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.inputRef = C(), this.inputRefTo = C(), this.btnRef = C(), this.calRef = C(), this.popupRef = C(), this.inputClasses = {
|
|
@@ -1446,7 +1446,7 @@ let f = class extends z {
|
|
|
1446
1446
|
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", (t) => {
|
|
1447
1447
|
var e, n;
|
|
1448
1448
|
(e = this.inputRef) != null && e.value && ((n = this.btnRef) != null && n.value) && !this.inputRef.value.contains(t.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(t.target)) && !this.btnRef.value.contains(t.target) && !t.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
|
|
1449
|
-
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || w.props.min.default, this.max = this.max || w.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
|
|
1449
|
+
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || w.props.min.default, this.max = this.max || w.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 X(20), this.handleCalendarPosition());
|
|
1450
1450
|
}
|
|
1451
1451
|
disconnectedCallback() {
|
|
1452
1452
|
super.disconnectedCallback(), document && document.body.removeEventListener("click", (t) => {
|
|
@@ -1487,7 +1487,7 @@ let f = class extends z {
|
|
|
1487
1487
|
?disabled=${this.disabled}
|
|
1488
1488
|
@keydown=${(t) => {
|
|
1489
1489
|
var e;
|
|
1490
|
-
(t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur());
|
|
1490
|
+
(t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
1491
1491
|
}}
|
|
1492
1492
|
@input=${(t) => {
|
|
1493
1493
|
this.onInput(), t.stopImmediatePropagation();
|
|
@@ -1522,7 +1522,7 @@ let f = class extends z {
|
|
|
1522
1522
|
?disabled=${this.disabled}
|
|
1523
1523
|
@keydown=${(t) => {
|
|
1524
1524
|
var e;
|
|
1525
|
-
(t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur());
|
|
1525
|
+
(t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
1526
1526
|
}}
|
|
1527
1527
|
@input=${(t) => {
|
|
1528
1528
|
this.onInput(), t.stopImmediatePropagation();
|
|
@@ -1543,11 +1543,12 @@ let f = class extends z {
|
|
|
1543
1543
|
}}
|
|
1544
1544
|
${P(this.inputRef)}
|
|
1545
1545
|
/>
|
|
1546
|
-
<div class="pkt-input-prefix">Til</div>
|
|
1546
|
+
<div class="pkt-input-prefix" id="${this.id}-to-label">Til</div>
|
|
1547
1547
|
<input
|
|
1548
1548
|
class=${R(this.inputClasses)}
|
|
1549
1549
|
.type=${this.inputType}
|
|
1550
1550
|
id="${this.id}-to"
|
|
1551
|
+
aria-labelledby="${this.id}-to-label"
|
|
1551
1552
|
.value=${this._value[1] ?? ""}
|
|
1552
1553
|
min=${this.min}
|
|
1553
1554
|
max=${this.max}
|
|
@@ -1557,7 +1558,7 @@ let f = class extends z {
|
|
|
1557
1558
|
?disabled=${this.disabled}
|
|
1558
1559
|
@keydown=${(t) => {
|
|
1559
1560
|
var e;
|
|
1560
|
-
(t.key === "," || t.key === "Enter") && ((e = this.inputRefTo.value) == null || e.blur());
|
|
1561
|
+
(t.key === "," || t.key === "Enter") && ((e = this.inputRefTo.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
1561
1562
|
}}
|
|
1562
1563
|
@input=${(t) => {
|
|
1563
1564
|
this.onInput(), t.stopImmediatePropagation();
|
|
@@ -1612,7 +1613,7 @@ let f = class extends z {
|
|
|
1612
1613
|
this.onFocus(), this.isMobileSafari && this.showCalendar();
|
|
1613
1614
|
}}
|
|
1614
1615
|
@keydown=${(t) => {
|
|
1615
|
-
(t.key === "," || t.key === "Enter") && (t.preventDefault(), this.addToSelected(t));
|
|
1616
|
+
(t.key === "," || t.key === "Enter") && (t.preventDefault(), this.addToSelected(t)), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
1616
1617
|
}}
|
|
1617
1618
|
?disabled=${this.disabled || this.maxlength && this._value.length >= this.maxlength}
|
|
1618
1619
|
@change=${(t) => {
|
|
@@ -1632,14 +1633,15 @@ let f = class extends z {
|
|
|
1632
1633
|
<pkt-tag
|
|
1633
1634
|
.id="${this.id + t + "-tag"}"
|
|
1634
1635
|
closeTag
|
|
1635
|
-
|
|
1636
|
+
ariaLabel="${this.strings.calendar.deleteDate} ${this.fromISOtoLocal(t)}"
|
|
1637
|
+
@close=${() => {
|
|
1636
1638
|
var e;
|
|
1637
1639
|
return (e = this.calRef.value) == null ? void 0 : e.handleDateSelect(this.fromISOToDate(t));
|
|
1638
1640
|
}}
|
|
1639
1641
|
>${this.fromISOtoLocal(t)}</pkt-tag
|
|
1640
1642
|
>
|
|
1641
1643
|
`
|
|
1642
|
-
) :
|
|
1644
|
+
) : N}
|
|
1643
1645
|
</div>
|
|
1644
1646
|
`;
|
|
1645
1647
|
}
|
|
@@ -1653,6 +1655,7 @@ let f = class extends z {
|
|
|
1653
1655
|
${P(this.popupRef)}
|
|
1654
1656
|
>
|
|
1655
1657
|
<pkt-calendar
|
|
1658
|
+
id="${this.id}-calendar"
|
|
1656
1659
|
?multiple=${this.multiple}
|
|
1657
1660
|
?range=${this.range}
|
|
1658
1661
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -1696,12 +1699,13 @@ let f = class extends z {
|
|
|
1696
1699
|
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
1697
1700
|
class="pkt-datepicker"
|
|
1698
1701
|
>
|
|
1699
|
-
${this.multiple ? this.renderTags() :
|
|
1702
|
+
${this.multiple ? this.renderTags() : N}
|
|
1700
1703
|
<div class="pkt-datepicker__inputs ${this.range ? "pkt-input__range-inputs" : ""}">
|
|
1701
1704
|
<div class="pkt-input__container">
|
|
1702
1705
|
${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
|
|
1703
1706
|
<button
|
|
1704
1707
|
class="${R(this.buttonClasses)}"
|
|
1708
|
+
type="button"
|
|
1705
1709
|
@click=${this.toggleCalendar}
|
|
1706
1710
|
?disabled=${this.disabled}
|
|
1707
1711
|
${P(this.btnRef)}
|
|
@@ -1731,14 +1735,13 @@ let f = class extends z {
|
|
|
1731
1735
|
}
|
|
1732
1736
|
async showCalendar() {
|
|
1733
1737
|
var t;
|
|
1734
|
-
this.calendarOpen = !0, await
|
|
1738
|
+
this.calendarOpen = !0, await X(20), this.handleCalendarPosition(), this.isMobileSafari && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
|
|
1735
1739
|
}
|
|
1736
1740
|
hideCalendar() {
|
|
1737
1741
|
this.calendarOpen = !1;
|
|
1738
1742
|
}
|
|
1739
1743
|
async toggleCalendar(t) {
|
|
1740
|
-
|
|
1741
|
-
t.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar(), await q(20), this.isMobileSafari && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
|
|
1744
|
+
t.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
|
|
1742
1745
|
}
|
|
1743
1746
|
};
|
|
1744
1747
|
p([
|
package/dist/pkt-element.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BYZhBzXZ.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
|
package/dist/pkt-element.js
CHANGED
package/dist/pkt-icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BYZhBzXZ.cjs");require("./directive-DtixNHDT.cjs");const e=require("./index-DAWAnAW_.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
|
package/dist/pkt-icon.js
CHANGED
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-CzPkBTm-.cjs"),r=require("./pkt-card.cjs"),n=require("./pkt-component-template.cjs"),o=require("./pkt-datepicker.cjs"),u=require("./index-DAWAnAW_.cjs"),a=require("./pkt-input-wrapper.cjs"),c=require("./pkt-link.cjs"),i=require("./pkt-messagebox.cjs"),P=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,"PktIcon",{enumerable:!0,get:()=>u.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>a.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>c.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>i.PktMessagebox});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>P.PktTag});
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PktAlert as t } from "./pkt-alert.js";
|
|
2
|
-
import { P as p } from "./index-
|
|
2
|
+
import { P as p } from "./index-BkXggpNp.js";
|
|
3
3
|
import { PktCard as P } from "./pkt-card.js";
|
|
4
4
|
import { PktComponent as x } from "./pkt-component-template.js";
|
|
5
5
|
import { PktDatepicker as a } from "./pkt-datepicker.js";
|
|
6
|
-
import { P as s } from "./index-
|
|
6
|
+
import { P as s } from "./index-B-KXmo65.js";
|
|
7
7
|
import { PktInputWrapper as c } from "./pkt-input-wrapper.js";
|
|
8
8
|
import { PktLink as g } from "./pkt-link.js";
|
|
9
9
|
import { PktMessagebox as l } from "./pkt-messagebox.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BYZhBzXZ.cjs"),k=require("./ref-BuQtfKiL.cjs"),c=require("./index-DAWAnAW_.cjs"),u=require("./class-map-DjxCaVFk.cjs"),$=require("./directive-DtixNHDT.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, E as o, x as i, n as r } from "./index-
|
|
2
|
-
import { e as _, P as D, n as I } from "./ref-
|
|
3
|
-
import { o as f } from "./index-
|
|
4
|
-
import { e as c } from "./class-map-
|
|
1
|
+
import { P as w, v as T, E as o, x as i, n as r } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as _, P as D, n as I } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { o as f } from "./index-B-KXmo65.js";
|
|
4
|
+
import { e as c } from "./class-map-luGhSuLj.js";
|
|
5
5
|
import { t as E } from "./directive-Cxhakbpr.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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BYZhBzXZ.cjs"),c=require("./ref-BuQtfKiL.cjs"),k=require("./class-map-DjxCaVFk.cjs"),h=require("./directive-DtixNHDT.cjs");require("./index-DAWAnAW_.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.e(),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.x`<a
|
|
2
2
|
class=${k.e(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, x as k, E as h, n as i } from "./index-
|
|
2
|
-
import { e as m, P as d, n as u } from "./ref-
|
|
3
|
-
import { e as P } from "./class-map-
|
|
1
|
+
import { P as f, x as k, E as h, n as i } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as m, P as d, n as u } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as P } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as y } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const g = "pkt-link", v = !0, _ = {
|
|
7
7
|
href: {
|
|
8
8
|
name: "URL",
|
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BYZhBzXZ.cjs"),c=require("./ref-BuQtfKiL.cjs"),b=require("./class-map-DjxCaVFk.cjs"),d=require("./directive-DtixNHDT.cjs");require("./index-DAWAnAW_.cjs");const k="pkt-messagebox",u=!0,g={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},m={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},h={default:{description:"Innholdet i meldingsboksen"}},p={name:k,"css-class":"pkt-messagebox",isElement:u,events:g,props:m,slots:h};var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,o=(i,t,n,l)=>{for(var s=l>1?void 0:l?x(t,n):t,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(l?a(t,n,s):a(s))||s);return l&&s&&f(t,n,s),s};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closable=p.props.closable.default,this.compact=p.props.compact.default,this.title="",this.skin=p.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this.slotController=new c.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.x`<div class=${b.e(t)}>
|
|
2
2
|
${this.closable?e.x`<div class="pkt-messagebox__close">
|
|
3
3
|
<button
|
|
4
4
|
@click=${this.close}
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as b, P as k, x as c, E as d, n } from "./index-
|
|
2
|
-
import { e as u, P as g, n as h } from "./ref-
|
|
3
|
-
import { e as f } from "./class-map-
|
|
1
|
+
import { r as b, P as k, x as c, E as d, n } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as u, P as g, n as h } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as f } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as v } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const _ = "pkt-messagebox", x = !0, y = {
|
|
7
7
|
onClose: {
|
|
8
8
|
description: "React: Event som trigges når meldingsboksen lukkes"
|
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-DjxCaVFk.cjs"),g=require("./directive-DtixNHDT.cjs"),t=require("./index-BYZhBzXZ.cjs"),o=require("./ref-BuQtfKiL.cjs");require("./index-DAWAnAW_.cjs");const h="pkt-tag",d=!0,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:"Lukk"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",isElement:d,props:k,slots:f};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,s=(n,e,r,l)=>{for(var i=l>1?void 0:l?b(e,r):e,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(l?c(e,r,i):c(i))||i);return l&&i&&y(e,r,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.e(),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=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const e={"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,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
2
2
|
<button
|
|
3
|
-
class=${u.e(
|
|
3
|
+
class=${u.e(r)}
|
|
4
4
|
type=${this.type}
|
|
5
5
|
aria-label=${this.ariaLabel}
|
|
6
6
|
@click=${this.close}
|
package/dist/pkt-tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as h } from "./class-map-
|
|
1
|
+
import { e as h } from "./class-map-luGhSuLj.js";
|
|
2
2
|
import { t as d } from "./directive-Cxhakbpr.js";
|
|
3
|
-
import { r as y, P as g, x as p, n as l } from "./index-
|
|
4
|
-
import { e as m, P as k, n as f } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as y, P as g, x as p, n as l } from "./index-CF6_-ZoF.js";
|
|
4
|
+
import { e as m, P as k, n as f } from "./ref-rfvuMlT1.js";
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const b = "pkt-tag", S = !0, $ = {
|
|
7
7
|
closeTag: {
|
|
8
8
|
type: "boolean",
|
|
@@ -55,27 +55,27 @@ const b = "pkt-tag", S = !0, $ = {
|
|
|
55
55
|
ariaLabel: {
|
|
56
56
|
type: "string",
|
|
57
57
|
required: !1,
|
|
58
|
-
default: "
|
|
58
|
+
default: "Lukk"
|
|
59
59
|
}
|
|
60
60
|
}, _ = {
|
|
61
61
|
default: {
|
|
62
62
|
description: "Teksten til tag"
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, a = {
|
|
65
65
|
name: b,
|
|
66
66
|
"css-class": "pkt-tag",
|
|
67
67
|
isElement: S,
|
|
68
68
|
props: $,
|
|
69
69
|
slots: _
|
|
70
70
|
};
|
|
71
|
-
var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s,
|
|
72
|
-
for (var i =
|
|
73
|
-
(u = s[c]) && (i = (
|
|
74
|
-
return
|
|
71
|
+
var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s, r, n, o) => {
|
|
72
|
+
for (var i = o > 1 ? void 0 : o ? C(r, n) : r, c = s.length - 1, u; c >= 0; c--)
|
|
73
|
+
(u = s[c]) && (i = (o ? u(r, n, i) : u(i)) || i);
|
|
74
|
+
return o && i && x(r, n, i), i;
|
|
75
75
|
};
|
|
76
76
|
let t = class extends g {
|
|
77
77
|
constructor() {
|
|
78
|
-
super(), this.defaultSlot = m(), this.closeTag =
|
|
78
|
+
super(), this.defaultSlot = m(), 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) => {
|
|
79
79
|
this._isClosed = !0, this.dispatchEvent(
|
|
80
80
|
new CustomEvent("close", { detail: { origin: s }, bubbles: !0, composed: !0 })
|
|
81
81
|
), this.dispatchEvent(
|
|
@@ -89,7 +89,7 @@ let t = class extends g {
|
|
|
89
89
|
[`pkt-tag--${this.size}`]: !!this.size,
|
|
90
90
|
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
91
91
|
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
92
|
-
},
|
|
92
|
+
}, r = {
|
|
93
93
|
"pkt-tag": !0,
|
|
94
94
|
"pkt-btn": !0,
|
|
95
95
|
"pkt-btn--tertiary": !0,
|
|
@@ -101,7 +101,7 @@ let t = class extends g {
|
|
|
101
101
|
};
|
|
102
102
|
return this.closeTag ? p`
|
|
103
103
|
<button
|
|
104
|
-
class=${h(
|
|
104
|
+
class=${h(r)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
aria-label=${this.ariaLabel}
|
|
107
107
|
@click=${this.close}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const A=require("./index-
|
|
1
|
+
"use strict";const A=require("./index-BYZhBzXZ.cjs"),a=require("./directive-DtixNHDT.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(o=>o.getAttribute&&o.getAttribute("slot")==s?this.nodeFromElement(o,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.6.
|
|
3
|
+
"version": "12.6.6",
|
|
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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@oslokommune/punkt-assets": "^12.4.0",
|
|
31
|
-
"@oslokommune/punkt-css": "^12.6.
|
|
31
|
+
"@oslokommune/punkt-css": "^12.6.6",
|
|
32
32
|
"sass": "^1.78.0",
|
|
33
33
|
"typescript": "^5.6.2",
|
|
34
34
|
"vite": "^5.4.4",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
56
56
|
},
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "936cdb5ca60100a3356cfbf03994c85eebba732e"
|
|
59
59
|
}
|
|
@@ -167,6 +167,9 @@ export class PktCalendar extends PktElement {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
handleArrowKey(e: KeyboardEvent, direction: number) {
|
|
170
|
+
if ((e.target as HTMLElement)?.nodeName === 'INPUT') return
|
|
171
|
+
if ((e.target as HTMLElement)?.nodeName === 'SELECT') return
|
|
172
|
+
if ((e.target as HTMLElement)?.nodeName === 'BUTTON') return
|
|
170
173
|
e.preventDefault()
|
|
171
174
|
if (!this.focusedDate) {
|
|
172
175
|
this.focusOnCurrentDate()
|
|
@@ -213,7 +216,8 @@ export class PktCalendar extends PktElement {
|
|
|
213
216
|
>
|
|
214
217
|
<nav class="pkt-cal-month-nav">
|
|
215
218
|
<div>
|
|
216
|
-
<
|
|
219
|
+
<button
|
|
220
|
+
type="button"
|
|
217
221
|
@click=${this.isPrevMonthAllowed() && this.prevMonth}
|
|
218
222
|
@keydown=${(e: KeyboardEvent) => {
|
|
219
223
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
@@ -230,11 +234,12 @@ export class PktCalendar extends PktElement {
|
|
|
230
234
|
>
|
|
231
235
|
<pkt-icon class="pkt-btn__icon" name="chevron-thin-left"></pkt-icon>
|
|
232
236
|
<span class="pkt-btn__text">${this.prevMonthString}</span>
|
|
233
|
-
</
|
|
237
|
+
</button>
|
|
234
238
|
</div>
|
|
235
239
|
${this.renderMonthNav()}
|
|
236
240
|
<div>
|
|
237
|
-
<
|
|
241
|
+
<button
|
|
242
|
+
type="button"
|
|
238
243
|
@click=${this.isNextMonthAllowed() && this.nextMonth}
|
|
239
244
|
@keydown=${(e: KeyboardEvent) => {
|
|
240
245
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
@@ -251,7 +256,7 @@ export class PktCalendar extends PktElement {
|
|
|
251
256
|
>
|
|
252
257
|
<pkt-icon class="pkt-btn__icon" name="chevron-thin-right"></pkt-icon>
|
|
253
258
|
<span class="pkt-btn__text">${this.nextMonthString}</span>
|
|
254
|
-
</
|
|
259
|
+
</button>
|
|
255
260
|
</div>
|
|
256
261
|
</nav>
|
|
257
262
|
<table
|
|
@@ -259,7 +264,12 @@ export class PktCalendar extends PktElement {
|
|
|
259
264
|
role="grid"
|
|
260
265
|
?aria-multiselectable=${this.range || this.multiple}
|
|
261
266
|
>
|
|
262
|
-
|
|
267
|
+
<thead>
|
|
268
|
+
${this.renderDayNames()}
|
|
269
|
+
</thead>
|
|
270
|
+
<tbody>
|
|
271
|
+
${this.renderCalendarBody()}
|
|
272
|
+
</tbody>
|
|
263
273
|
</table>
|
|
264
274
|
</div>
|
|
265
275
|
`
|
|
@@ -268,12 +278,12 @@ export class PktCalendar extends PktElement {
|
|
|
268
278
|
private renderDayNames() {
|
|
269
279
|
const days = []
|
|
270
280
|
if (this.weeknumbers) {
|
|
271
|
-
days.push(html`<
|
|
281
|
+
days.push(html`<th><div>${this.weekString}</div></th>`)
|
|
272
282
|
}
|
|
273
283
|
for (let i = 0; i < this.dayStrings.length; i++) {
|
|
274
|
-
days.push(html`<
|
|
284
|
+
days.push(html`<th><div>${this.dayStrings[i]}</div></th>`)
|
|
275
285
|
}
|
|
276
|
-
return html`<tr class="pkt-cal-week-row"
|
|
286
|
+
return html`<tr class="pkt-cal-week-row">
|
|
277
287
|
${days}
|
|
278
288
|
</tr>`
|
|
279
289
|
}
|
|
@@ -283,8 +293,10 @@ export class PktCalendar extends PktElement {
|
|
|
283
293
|
if (this.withcontrols) {
|
|
284
294
|
monthView.push(
|
|
285
295
|
html`<div class="pkt-cal-month-picker">
|
|
296
|
+
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
286
297
|
<select
|
|
287
298
|
class="pkt-input pkt-input-compact"
|
|
299
|
+
id="${this.id}-monthnav"
|
|
288
300
|
@change=${(e: any) => {
|
|
289
301
|
this.changeMonth(this.year, e.target.value)
|
|
290
302
|
}}
|
|
@@ -294,8 +306,10 @@ export class PktCalendar extends PktElement {
|
|
|
294
306
|
html`<option value=${index} ?selected=${this.month === index}>${month}</option>`,
|
|
295
307
|
)}
|
|
296
308
|
</select>
|
|
309
|
+
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
297
310
|
<input
|
|
298
311
|
class="pkt-input pkt-cal-input-year pkt-input-compact"
|
|
312
|
+
id="${this.id}-yearnav"
|
|
299
313
|
type="number"
|
|
300
314
|
size="4"
|
|
301
315
|
placeholder="0000"
|