@telia-ace/alliance-ui 1.0.6-next.0 → 1.0.6-next.1
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/CHANGELOG.md +7 -0
- package/LICENSE.txt +8 -5
- package/README.md +0 -1
- package/chunks/check-circle-filled-42095247.js.map +1 -1
- package/chunks/chevron-down-50d47dd6.js.map +1 -1
- package/chunks/close-ac6e4f1c.js.map +1 -1
- package/chunks/close-cf3fd2c4.js.map +1 -1
- package/chunks/error-filled-8de50bdd.js.map +1 -1
- package/chunks/getSvgContent-f2389ce0.js.map +1 -1
- package/chunks/stringCombiner-10b57054.js.map +1 -1
- package/chunks/{telia-button-ef4894d0.js → telia-button2-d25eddda.js} +5 -2
- package/chunks/telia-button2-d25eddda.js.map +1 -0
- package/chunks/telia-card-frame2-2d46eef6.js.map +1 -1
- package/chunks/{telia-field-assistive-text2-fd970326.js → telia-field-assistive-text2-8e042a32.js} +2 -2
- package/chunks/telia-field-assistive-text2-8e042a32.js.map +1 -0
- package/chunks/{telia-field-error2-63eae7b3.js → telia-field-error2-8beb1632.js} +2 -2
- package/chunks/{telia-field-error2-63eae7b3.js.map → telia-field-error2-8beb1632.js.map} +1 -1
- package/chunks/telia-field-valid2-bda898b1.js.map +1 -1
- package/chunks/{telia-heading2-5fdf4c16.js → telia-heading2-9d3ab48b.js} +8 -2
- package/chunks/telia-heading2-9d3ab48b.js.map +1 -0
- package/chunks/telia-icon2-34bf5aef.js.map +1 -1
- package/chunks/telia-label2-4d674e5e.js.map +1 -1
- package/chunks/telia-link2-7769b385.js.map +1 -1
- package/chunks/telia-navigation-button2-a0b24d67.js.map +1 -1
- package/chunks/telia-style-link2-bbd8d17a.js.map +1 -1
- package/chunks/telia-style-navigation-item2-58683cd9.js.map +1 -1
- package/chunks/telia-tab-header2-bd04582d.js.map +1 -1
- package/chunks/telia-visually-hidden2-71416262.js.map +1 -1
- package/chunks/telia-vst2-1a7f7bd6.js.map +1 -1
- package/chunks/uniqueId-0daf01ec.js.map +1 -1
- package/chunks/variables-03fe2cd9.js.map +1 -1
- package/components/index.js +2 -2
- package/package.json +5 -5
- package/voca/components/telia-accordion-item.js.map +1 -1
- package/voca/components/telia-accordion.js +1 -1
- package/voca/components/telia-accordion.js.map +1 -1
- package/voca/components/telia-badge.js.map +1 -1
- package/voca/components/telia-button.js +1 -1
- package/voca/components/telia-card-frame-link.js.map +1 -1
- package/voca/components/telia-checkbox.js +20 -20
- package/voca/components/telia-checkbox.js.map +1 -1
- package/voca/components/telia-chip-choice.js +12 -12
- package/voca/components/telia-chip-choice.js.map +1 -1
- package/voca/components/telia-chip-filter.js +5 -5
- package/voca/components/telia-chip-filter.js.map +1 -1
- package/voca/components/telia-col.js.map +1 -1
- package/voca/components/telia-color-dot.js.map +1 -1
- package/voca/components/telia-cta-link.js +11 -9
- package/voca/components/telia-cta-link.js.map +1 -1
- package/voca/components/telia-date-picker.js +130 -116
- package/voca/components/telia-date-picker.js.map +1 -1
- package/voca/components/telia-divider.js +6 -6
- package/voca/components/telia-divider.js.map +1 -1
- package/voca/components/telia-field-assistive-text.js +1 -1
- package/voca/components/telia-field-error.js +1 -1
- package/voca/components/telia-fieldset.js.map +1 -1
- package/voca/components/telia-focus-trap.js.map +1 -1
- package/voca/components/telia-form.js.map +1 -1
- package/voca/components/telia-grid.js.map +1 -1
- package/voca/components/telia-heading.js +1 -1
- package/voca/components/telia-image.js.map +1 -1
- package/voca/components/telia-link-image.js.map +1 -1
- package/voca/components/telia-list.js.map +1 -1
- package/voca/components/telia-logo.js.map +1 -1
- package/voca/components/telia-navigation-dropdown.js.map +1 -1
- package/voca/components/telia-navigation-link.js.map +1 -1
- package/voca/components/telia-notification.js +14 -14
- package/voca/components/telia-notification.js.map +1 -1
- package/voca/components/telia-overlay.js.map +1 -1
- package/voca/components/telia-p.js.map +1 -1
- package/voca/components/telia-pictogram.js.map +1 -1
- package/voca/components/telia-radio-button.js +5 -5
- package/voca/components/telia-radio-button.js.map +1 -1
- package/voca/components/telia-row.js.map +1 -1
- package/voca/components/telia-select.js +3 -3
- package/voca/components/telia-select.js.map +1 -1
- package/voca/components/telia-skeleton.js.map +1 -1
- package/voca/components/telia-status-badge.js.map +1 -1
- package/voca/components/telia-tab-content.js.map +1 -1
- package/voca/components/telia-tab.js.map +1 -1
- package/voca/components/telia-text-input.js +7 -7
- package/voca/components/telia-text-input.js.map +1 -1
- package/voca/components/telia-text-spacing.js.map +1 -1
- package/voca/components/telia-textarea.js +7 -7
- package/voca/components/telia-textarea.js.map +1 -1
- package/voca/components/telia-toggle.js +1 -1
- package/voca/components/telia-toggle.js.map +1 -1
- package/voca/icons/index.js.map +1 -1
- package/chunks/telia-button-ef4894d0.js.map +0 -1
- package/chunks/telia-button-text2-e1510558.js +0 -86
- package/chunks/telia-button-text2-e1510558.js.map +0 -1
- package/chunks/telia-field-assistive-text2-fd970326.js.map +0 -1
- package/chunks/telia-heading2-5fdf4c16.js.map +0 -1
- package/voca/components/telia-button-text.d.ts +0 -1
- package/voca/components/telia-button-text.js +0 -6
- package/voca/components/telia-button-text.js.map +0 -1
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { p as q, H as K, c as F, h as i, a as $, F as W } from "../../chunks/index-17652cf7.js";
|
|
2
|
-
import { u as
|
|
2
|
+
import { u as k } from "../../chunks/uniqueId-0daf01ec.js";
|
|
3
3
|
import { s as j } from "../../chunks/stringCombiner-10b57054.js";
|
|
4
4
|
import { c as E } from "../../chunks/chevron-down-50d47dd6.js";
|
|
5
5
|
import { c as J } from "../../chunks/close-ac6e4f1c.js";
|
|
6
|
-
import { d as U } from "../../chunks/telia-
|
|
7
|
-
import { d as X } from "../../chunks/telia-field-
|
|
8
|
-
import { d as Q } from "../../chunks/telia-
|
|
9
|
-
import { d as ee } from "../../chunks/telia-
|
|
10
|
-
import { d as te } from "../../chunks/telia-
|
|
11
|
-
import { d as ae } from "../../chunks/telia-
|
|
6
|
+
import { d as U } from "../../chunks/telia-button2-d25eddda.js";
|
|
7
|
+
import { d as X } from "../../chunks/telia-field-assistive-text2-8e042a32.js";
|
|
8
|
+
import { d as Q } from "../../chunks/telia-field-error2-8beb1632.js";
|
|
9
|
+
import { d as ee } from "../../chunks/telia-heading2-9d3ab48b.js";
|
|
10
|
+
import { d as te } from "../../chunks/telia-icon2-34bf5aef.js";
|
|
11
|
+
import { d as ae } from "../../chunks/telia-label2-4d674e5e.js";
|
|
12
|
+
import { d as ie } from "../../chunks/telia-vst2-1a7f7bd6.js";
|
|
12
13
|
import "../../chunks/error-filled-8de50bdd.js";
|
|
13
14
|
import "../../chunks/getSvgContent-f2389ce0.js";
|
|
14
|
-
const
|
|
15
|
-
var
|
|
15
|
+
const re = { name: "chevron-right", svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M47.1663 32.0005C47.1667 32.6147 46.9059 33.2001 46.449 33.6106L24.7824 53.1106C23.8931 53.9111 22.5233 53.8391 21.7228 52.9498C20.9223 52.0606 20.9943 50.6907 21.8836 49.8903L41.7613 32.0005L21.8836 14.1106C21.3083 13.5928 21.053 12.8075 21.2138 12.0503C21.3746 11.2932 21.9271 10.6794 22.6632 10.4402C23.3993 10.2009 24.2071 10.3724 24.7824 10.8903L46.449 30.3903C46.9059 30.8008 47.1667 31.3862 47.1663 32.0005Z"/></svg>' }, le = { name: "calendar", svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58 51.3846V16.9231C57.9973 14.5451 56.0588 12.6181 53.6667 12.6154H49.3333V8.30769C49.3306 5.92975 47.3921 4.00272 45 4H40.6667C38.2746 4.00272 36.3361 5.92975 36.3333 8.30769V12.6154H27.6667V8.30769C27.6639 5.92975 25.7254 4.00272 23.3333 4H19C16.6079 4.00272 14.6694 5.92975 14.6667 8.30769V12.6154H10.3333C7.94123 12.6181 6.00273 14.5451 6 16.9231V51.3846C6.00547 56.1405 9.88247 59.9946 14.6667 60H49.3333C54.1175 59.9946 57.9945 56.1405 58 51.3846ZM44.9999 16.923H40.6666V8.30766H44.9999V16.923ZM23.3333 16.923H18.9999V8.30766H23.3333V16.923ZM49.3334 16.9231H53.6668V24.9852H10.3334V16.9231H14.6668C14.6695 19.301 16.608 21.228 19.0001 21.2307H23.3334C25.7255 21.228 27.664 19.301 27.6668 16.9231H36.3334C36.3362 19.301 38.2747 21.228 40.6668 21.2307H45.0001C47.3922 21.228 49.3307 19.301 49.3334 16.9231ZM10.3334 28.9852V51.3846C10.3362 53.7625 12.2747 55.6896 14.6668 55.6923H49.3334C51.7255 55.6896 53.664 53.7625 53.6668 51.3846V28.9852H10.3334Z"/><path d="M14.6949 35.3069C14.6949 34.2023 15.5957 33.3069 16.7068 33.3069H21.378C22.4891 33.3069 23.3899 34.2024 23.3899 35.3069V36.7091C23.3899 37.8137 22.4891 38.7091 21.378 38.7091H16.7068C15.5957 38.7091 14.6949 37.8137 14.6949 36.7091V35.3069Z"/><path d="M27.7374 35.3069C27.7374 34.2023 28.6381 33.3069 29.7493 33.3069H34.4204C35.5316 33.3069 36.4323 34.2024 36.4323 35.3069V36.7091C36.4323 37.8137 35.5316 38.7091 34.4204 38.7091H29.7493C28.6381 38.7091 27.7374 37.8137 27.7374 36.7091V35.3069Z"/><path d="M40.7798 35.3069C40.7798 34.2023 41.6806 33.3069 42.7917 33.3069H47.4629C48.574 33.3069 49.4748 34.2024 49.4748 35.3069V36.7091C49.4748 37.8137 48.574 38.7091 47.4629 38.7091H42.7917C41.6806 38.7091 40.7798 37.8137 40.7798 36.7091V35.3069Z"/><path d="M14.6949 46.1114C14.6949 45.0068 15.5957 44.1114 16.7068 44.1114H21.378C22.4891 44.1114 23.3899 45.0068 23.3899 46.1114V47.5136C23.3899 48.6181 22.4891 49.5136 21.378 49.5136H16.7068C15.5957 49.5136 14.6949 48.6181 14.6949 47.5136V46.1114Z"/><path d="M27.7374 46.1114C27.7374 45.0068 28.6381 44.1114 29.7493 44.1114H34.4204C35.5316 44.1114 36.4323 45.0068 36.4323 46.1114V47.5136C36.4323 48.6181 35.5316 49.5136 34.4204 49.5136H29.7493C28.6381 49.5136 27.7374 48.6181 27.7374 47.5136V46.1114Z"/><path d="M40.7798 46.1114C40.7798 45.0068 41.6806 44.1114 42.7917 44.1114H47.4629C48.574 44.1114 49.4748 45.0068 49.4748 46.1114V47.5136C49.4748 48.6181 48.574 49.5136 47.4629 49.5136H42.7917C41.6806 49.5136 40.7798 48.6181 40.7798 47.5136V46.1114Z"/></svg>' }, oe = { name: "chevron-left", svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M42.1162 49.8902C42.6915 50.4081 42.9468 51.1934 42.786 51.9505C42.6252 52.7076 42.0727 53.3214 41.3366 53.5607C40.6005 53.8 39.7927 53.6284 39.2174 53.1106L17.5508 33.6106C17.0942 33.1999 16.8335 32.6146 16.8335 32.0004C16.8335 31.3863 17.0942 30.801 17.5508 30.3902L39.2174 10.8902C40.1067 10.0898 41.4766 10.1618 42.277 11.0511C43.0775 11.9403 43.0055 13.3102 42.1162 14.1106L22.2385 32.0004L42.1162 49.8902Z"/></svg>' }, se = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
16
|
+
var y;
|
|
16
17
|
(function(e) {
|
|
17
18
|
e[e.Sunday = 0] = "Sunday", e[e.Monday = 1] = "Monday", e[e.Tuesday = 2] = "Tuesday", e[e.Wednesday = 3] = "Wednesday", e[e.Thursday = 4] = "Thursday", e[e.Friday = 5] = "Friday", e[e.Saturday = 6] = "Saturday";
|
|
18
|
-
})(
|
|
19
|
+
})(y || (y = {}));
|
|
19
20
|
function S(e, t, a) {
|
|
20
|
-
const r = parseInt(a, 10), l = parseInt(t, 10),
|
|
21
|
-
if (Number.isInteger(
|
|
21
|
+
const r = parseInt(a, 10), l = parseInt(t, 10), o = parseInt(e, 10);
|
|
22
|
+
if (Number.isInteger(o) && // all parts should be integers
|
|
22
23
|
Number.isInteger(l) && Number.isInteger(r) && l > 0 && // month must be 1-12
|
|
23
24
|
l <= 12 && r > 0 && // day must be 1-31
|
|
24
|
-
r <= 31 &&
|
|
25
|
-
return new Date(
|
|
25
|
+
r <= 31 && o > 0)
|
|
26
|
+
return new Date(o, l - 1, r);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function v(e) {
|
|
28
29
|
if (!e)
|
|
29
30
|
return;
|
|
30
|
-
const t = e.match(
|
|
31
|
+
const t = e.match(se);
|
|
31
32
|
if (t !== null && t.length)
|
|
32
33
|
return S(t[1], t[2], t[3]);
|
|
33
34
|
}
|
|
@@ -37,7 +38,7 @@ function V(e) {
|
|
|
37
38
|
let t = e.getDate().toString(10), a = (e.getMonth() + 1).toString(10), r = e.getFullYear().toString(10);
|
|
38
39
|
return e.getDate() < 10 && (t = `0${t}`), e.getMonth() < 9 && (a = `0${a}`), `${r}-${a}-${t}`;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function x(e, t) {
|
|
41
42
|
return e == null || t == null ? !1 : A(e, t) && e.getDate() === t.getDate();
|
|
42
43
|
}
|
|
43
44
|
function A(e, t) {
|
|
@@ -47,18 +48,18 @@ function z(e, t) {
|
|
|
47
48
|
const a = new Date(e);
|
|
48
49
|
return a.setDate(a.getDate() + t), a;
|
|
49
50
|
}
|
|
50
|
-
function P(e, t =
|
|
51
|
+
function P(e, t = y.Monday) {
|
|
51
52
|
const a = new Date(e), r = a.getDay(), l = (r < t ? 7 : 0) + r - t;
|
|
52
53
|
return a.setDate(a.getDate() - l), a;
|
|
53
54
|
}
|
|
54
|
-
function R(e, t =
|
|
55
|
+
function R(e, t = y.Monday) {
|
|
55
56
|
const a = new Date(e), r = a.getDay(), l = (r < t ? -7 : 0) + 6 - (r - t);
|
|
56
57
|
return a.setDate(a.getDate() + l), a;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function D(e) {
|
|
59
60
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function C(e) {
|
|
62
63
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
63
64
|
}
|
|
64
65
|
function H(e, t) {
|
|
@@ -69,81 +70,91 @@ function Y(e, t) {
|
|
|
69
70
|
const a = new Date(e);
|
|
70
71
|
return a.setFullYear(t), a;
|
|
71
72
|
}
|
|
72
|
-
function C(e, t, a) {
|
|
73
|
-
return M(e, t, a) === e;
|
|
74
|
-
}
|
|
75
73
|
function M(e, t, a) {
|
|
74
|
+
return I(e, t, a) === e;
|
|
75
|
+
}
|
|
76
|
+
function I(e, t, a) {
|
|
76
77
|
const r = e.getTime();
|
|
77
78
|
return t && t instanceof Date && r < t.getTime() ? t : a && a instanceof Date && r > a.getTime() ? a : e;
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function ce(e, t) {
|
|
80
81
|
const a = [];
|
|
81
82
|
let r = e;
|
|
82
|
-
for (; !
|
|
83
|
+
for (; !x(r, t); )
|
|
83
84
|
a.push(r), r = z(r, 1);
|
|
84
85
|
return a.push(r), a;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
const a = P(
|
|
88
|
-
return
|
|
87
|
+
function ne(e, t = y.Monday) {
|
|
88
|
+
const a = P(D(e), t), r = R(C(e), t);
|
|
89
|
+
return ce(a, r);
|
|
89
90
|
}
|
|
90
|
-
const
|
|
91
|
+
const de = ({ onClick: e, dateFormatter: t, describedBy: a, localization: r, name: l, formattedValue: o, valueAsDate: s, value: d, identifier: h, disabled: n, readonly: u, required: _, role: g, touched: b, buttonLabel: m, buttonRef: c, inputRef: f, onInput: N, onBlur: O, onFocus: B, makeTouched: T, htmlForm: Z }) => {
|
|
91
92
|
const G = u || n;
|
|
92
93
|
return i(
|
|
93
94
|
W,
|
|
94
95
|
null,
|
|
95
96
|
i("input", { class: {
|
|
96
97
|
"telia-date-picker__input": !0,
|
|
97
|
-
"telia-date-picker__input--touched":
|
|
98
|
-
}, value:
|
|
99
|
-
T(), O(
|
|
100
|
-
}, autoComplete: "off", ref:
|
|
101
|
-
T(),
|
|
98
|
+
"telia-date-picker__input--touched": b
|
|
99
|
+
}, value: o, id: h, disabled: n, readonly: u, role: g, required: _ ? !0 : void 0, "aria-autocomplete": "none", "aria-describedby": a, onInput: N, onFocus: B, onBlur: (w) => {
|
|
100
|
+
T(), O(w);
|
|
101
|
+
}, autoComplete: "off", ref: f, onInvalid: (w) => {
|
|
102
|
+
T(), w.preventDefault();
|
|
102
103
|
}, form: Z }),
|
|
103
104
|
i("input", { type: "hidden", name: l, value: d }),
|
|
104
105
|
i(
|
|
105
106
|
"div",
|
|
106
107
|
{ class: "telia-date-picker__input-icon-container" },
|
|
107
108
|
i(
|
|
108
|
-
"button",
|
|
109
|
-
{
|
|
110
|
-
i("telia-icon", { class: "telia-date-picker__toggle-icon", svg:
|
|
109
|
+
"telia-button",
|
|
110
|
+
{ allyLabel: m, variant: "text", size: "sm", onClick: e, disabled: G, ref: (w) => c(w), type: "button", "data-testid": "telia-date-picker__toggle-button" },
|
|
111
|
+
i("telia-icon", { class: "telia-date-picker__toggle-icon", svg: le.svg, size: "sm" }),
|
|
111
112
|
i(
|
|
112
113
|
"span",
|
|
113
114
|
{ class: "telia-date-picker__vhidden" },
|
|
114
115
|
r.buttonLabel,
|
|
115
|
-
|
|
116
|
+
s && i(
|
|
116
117
|
"span",
|
|
117
118
|
null,
|
|
118
119
|
", ",
|
|
119
120
|
r.selectedDateMessage,
|
|
120
121
|
" ",
|
|
121
|
-
t.format(
|
|
122
|
+
t.format(s)
|
|
122
123
|
)
|
|
123
124
|
)
|
|
124
125
|
)
|
|
125
126
|
)
|
|
126
127
|
);
|
|
127
|
-
},
|
|
128
|
-
const u =
|
|
128
|
+
}, ue = ({ focusedDay: e, today: t, day: a, onDaySelect: r, onKeyboardNavigation: l, focusedDayRef: o, disabled: s, inRange: d, isSelected: h, dateFormatter: n }) => {
|
|
129
|
+
const u = x(a, t), _ = A(a, e), g = x(a, e), b = !d, m = s || b;
|
|
129
130
|
return i(
|
|
130
131
|
"button",
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
{
|
|
133
|
+
class: {
|
|
134
|
+
"telia-date-picker__day": !0,
|
|
135
|
+
"is-today": u,
|
|
136
|
+
"is-month": _,
|
|
137
|
+
"is-disabled": m
|
|
138
|
+
},
|
|
139
|
+
tabIndex: g ? 0 : -1,
|
|
140
|
+
onClick: (f) => {
|
|
141
|
+
r(f, a);
|
|
142
|
+
},
|
|
143
|
+
onKeyDown: l,
|
|
144
|
+
"aria-disabled": m ? "true" : void 0,
|
|
145
|
+
// disabled days have to be focusable for a11y purposes
|
|
146
|
+
disabled: b,
|
|
147
|
+
type: "button",
|
|
148
|
+
"aria-pressed": h ? "true" : "false",
|
|
149
|
+
ref: (f) => {
|
|
150
|
+
g && f && o && o(f);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
142
153
|
i("span", { "aria-hidden": "true" }, a.getDate()),
|
|
143
154
|
i("span", { class: "telia-date-picker__vhidden" }, n.format(a))
|
|
144
155
|
);
|
|
145
156
|
};
|
|
146
|
-
function
|
|
157
|
+
function he(e, t) {
|
|
147
158
|
const a = [];
|
|
148
159
|
for (let r = 0; r < e.length; r += t)
|
|
149
160
|
a.push(e.slice(r, r + t));
|
|
@@ -151,12 +162,12 @@ function ue(e, t) {
|
|
|
151
162
|
}
|
|
152
163
|
function me(e, t, a) {
|
|
153
164
|
return e.map((r, l) => {
|
|
154
|
-
const
|
|
155
|
-
return a(e[
|
|
165
|
+
const o = (l + t) % e.length;
|
|
166
|
+
return a(e[o]);
|
|
156
167
|
});
|
|
157
168
|
}
|
|
158
|
-
const
|
|
159
|
-
const
|
|
169
|
+
const pe = ({ selectedDate: e, focusedDate: t, labelledById: a, localization: r, firstDayOfWeek: l, min: o, max: s, dateFormatter: d, isDateDisabled: h, onDateSelect: n, onKeyboardNavigation: u, focusedDayRef: _ }) => {
|
|
170
|
+
const g = new Date(), b = ne(t, l);
|
|
160
171
|
return i(
|
|
161
172
|
"div",
|
|
162
173
|
{ class: "telia-date-picker__table-wrapper" },
|
|
@@ -166,21 +177,21 @@ const he = ({ selectedDate: e, focusedDate: t, labelledById: a, localization: r,
|
|
|
166
177
|
i(
|
|
167
178
|
"thead",
|
|
168
179
|
null,
|
|
169
|
-
i("tr", null, me(r.dayNames, l, (
|
|
180
|
+
i("tr", null, me(r.dayNames, l, (m) => i(
|
|
170
181
|
"th",
|
|
171
182
|
{ class: "telia-date-picker__table-header", scope: "col" },
|
|
172
|
-
i("span", { "aria-hidden": "true" },
|
|
173
|
-
i("span", { class: "telia-date-picker__vhidden" },
|
|
183
|
+
i("span", { "aria-hidden": "true" }, m.substr(0, 2)),
|
|
184
|
+
i("span", { class: "telia-date-picker__vhidden" }, m)
|
|
174
185
|
)))
|
|
175
186
|
),
|
|
176
|
-
i("tbody", null,
|
|
187
|
+
i("tbody", null, he(b, 7).map((m) => i("tr", { class: "telia-date-picker__row" }, m.map((c) => i(
|
|
177
188
|
"td",
|
|
178
189
|
{ class: "telia-date-picker__cell" },
|
|
179
|
-
i(
|
|
190
|
+
i(ue, { day: c, today: g, focusedDay: t, isSelected: x(c, e), disabled: h(c), inRange: M(c, o, s), onDaySelect: n, dateFormatter: d, onKeyboardNavigation: u, focusedDayRef: _ })
|
|
180
191
|
)))))
|
|
181
192
|
)
|
|
182
193
|
);
|
|
183
|
-
},
|
|
194
|
+
}, ve = {
|
|
184
195
|
buttonLabel: "Choose date",
|
|
185
196
|
placeholder: "YYYY-MM-DD",
|
|
186
197
|
selectedDateMessage: "Selected date is",
|
|
@@ -228,15 +239,15 @@ const he = ({ selectedDate: e, focusedDate: t, labelledById: a, localization: r,
|
|
|
228
239
|
"Dec"
|
|
229
240
|
],
|
|
230
241
|
locale: "en-GB"
|
|
231
|
-
},
|
|
232
|
-
parse:
|
|
242
|
+
}, fe = {
|
|
243
|
+
parse: v,
|
|
233
244
|
format: V
|
|
234
|
-
},
|
|
245
|
+
}, ge = (e, t) => {
|
|
235
246
|
const a = [];
|
|
236
247
|
for (var r = e; r <= t; r++)
|
|
237
248
|
a.push(r);
|
|
238
249
|
return a;
|
|
239
|
-
}, ge = '.telia-date-picker{display:flex;flex-direction:column;position:relative}.telia-date-picker__label{order:1}.telia-date-picker__input{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90;border-radius:calc(0.2rem * var(--voca-rem-multiplier));background-color:#ffffff;color:#222222;font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1.6rem * var(--voca-rem-multiplier));line-height:1.5;-webkit-appearance:none;appearance:none;box-sizing:border-box;display:block;margin:0;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier));width:100%;height:calc(4.6rem * var(--voca-rem-multiplier));margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:2}.telia-date-picker__input:required{box-shadow:none}.telia-date-picker__input:hover{border:calc(0.2rem * var(--voca-rem-multiplier)) solid #29003e;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-date-picker__input:hover:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90}.telia-date-picker__input:focus{outline:solid calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline-offset:calc(0.2rem * var(--voca-rem-multiplier));padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:focus:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90}.telia-date-picker__input:read-only{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;background-color:#e8e8ed}.telia-date-picker__input:read-only:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:disabled{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;background-color:#dcdce1;color:#606064;cursor:not-allowed;-webkit-text-fill-color:#606064}.telia-date-picker__input:disabled:hover{padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:disabled~.telia-date-picker__label .telia-label{color:#606064;cursor:not-allowed}.telia-date-picker__input:disabled~.telia-date-picker__additional{color:#b0b0b5}.telia-date-picker__input:invalid{box-shadow:none}.telia-date-picker__input--touched:invalid{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #be0040}.telia-date-picker__input--touched:invalid:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90}.telia-date-picker__input--touched:invalid:hover:not(:focus){border:calc(0.2rem * var(--voca-rem-multiplier)) solid #be0040;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-date-picker__input-icon-container{align-items:center;display:flex;flex-direction:row;height:calc(4.6rem * var(--voca-rem-multiplier));justify-content:flex-end;margin:calc(-1 * calc(4.6rem * var(--voca-rem-multiplier))) 0 0 calc(100% - calc(1.2rem * var(--voca-rem-multiplier)));order:3}.telia-date-picker__additional{order:5}.telia-date-picker__error{margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:6}.telia-date-picker__toggle{border:0 solid #8c8c90;border-left:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90;border-top-right-radius:calc(0.2rem * var(--voca-rem-multiplier));border-bottom-right-radius:calc(0.2rem * var(--voca-rem-multiplier));color:#29003e;align-items:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;cursor:pointer;display:flex;height:calc(calc(4.6rem * var(--voca-rem-multiplier)) - calc(0.2rem * var(--voca-rem-multiplier)));justify-content:center;padding:0;-webkit-user-select:none;user-select:none}.telia-date-picker__toggle:focus{outline:solid calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline-offset:calc(0.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:read-only~.telia-date-picker__input-icon-container .telia-date-picker__toggle{border-left:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;color:#606064}.telia-date-picker__input:invalid~.telia-date-picker__input-icon-container .telia-date-picker__toggle{color:#be0040}.telia-date-picker__input:disabled~.telia-date-picker__input-icon-container .telia-date-picker__toggle{border-left:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;color:#606064;cursor:not-allowed}.telia-date-picker__input:hover~.telia-date-picker__input-icon-container .telia-date-picker__toggle,.telia-date-picker__input:hover:focus~.telia-date-picker__input-icon-container .telia-date-picker__toggle{height:calc(calc(4.6rem * var(--voca-rem-multiplier)) - calc(0.4rem * var(--voca-rem-multiplier)))}.telia-date-picker__toggle-icon{margin:0 calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__dialog-container{order:4}.telia-date-picker__dialog{z-index:300;background-color:rgba(0, 0, 0, 0.3);bottom:0;display:flex;left:0;min-width:calc(32rem * var(--voca-rem-multiplier));opacity:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility}@media screen and (min-width: 37.5em){.telia-date-picker__dialog{z-index:100;background:none;bottom:auto;position:absolute;right:auto;top:auto;transform:scale(0.96) translateZ(0) translateY(-2rem);transform-origin:top right}}.telia-date-picker__dialog.is-left{left:auto;right:0;width:auto}.telia-date-picker__dialog.is-active{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.telia-date-picker__dialog-content{background-color:#ffffff;border-radius:0;border-top-left-radius:calc(0.2rem * var(--voca-rem-multiplier));border-top-right-radius:calc(0.2rem * var(--voca-rem-multiplier));border-top:calc(0.1rem * var(--voca-rem-multiplier)) solid #606064;bottom:0;display:none;left:0;margin:0;max-width:none;padding:0;position:absolute;transform:translateZ(0) translateY(100%);width:100%}@media screen and (min-width: 37.5em){.telia-date-picker__dialog-content{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #8c8c90;border-radius:calc(0.2rem * var(--voca-rem-multiplier));box-shadow:0 calc(0.8rem * var(--voca-rem-multiplier)) calc(2.4rem * var(--voca-rem-multiplier)) #dcdce1;margin:calc(0.8rem * var(--voca-rem-multiplier)) 0 0 auto;max-width:calc(31rem * var(--voca-rem-multiplier));min-width:calc(29rem * var(--voca-rem-multiplier));padding:0;position:relative;transform:none;transition:none;visibility:visible}}.is-active .telia-date-picker__dialog-content{display:block;transform:translateZ(0) translateY(0)}.telia-date-picker__table-wrapper{margin:calc(1.6rem * var(--voca-rem-multiplier)) 0 calc(2rem * var(--voca-rem-multiplier));padding:0 calc(1.6rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier))}@media screen and (min-width: 37.5em){.telia-date-picker__table-wrapper{padding:0 calc(2rem * var(--voca-rem-multiplier))}}.telia-date-picker__table{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1rem * var(--voca-rem-multiplier));color:#222222;border-collapse:collapse;border-spacing:0;line-height:1.25;margin:0;padding:0;text-align:center;width:100%}.telia-date-picker__table-header{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;font-size:calc(1.2rem * var(--voca-rem-multiplier));color:#222222;letter-spacing:calc(0.1rem * var(--voca-rem-multiplier));line-height:1.4;padding-bottom:calc(0.8rem * var(--voca-rem-multiplier));text-decoration:none;text-transform:uppercase}.telia-date-picker__cell{text-align:center}.telia-date-picker__day{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1.4rem * var(--voca-rem-multiplier));color:#222222;-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;cursor:pointer;display:inline-block;font-variant-numeric:tabular-nums;height:calc(3.2rem * var(--voca-rem-multiplier));line-height:calc(1.6rem * var(--voca-rem-multiplier));padding:0 0 calc(0.1rem * var(--voca-rem-multiplier));position:relative;text-align:center;vertical-align:middle;width:calc(3.2rem * var(--voca-rem-multiplier))}.telia-date-picker__day.is-today{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;color:#29003e;border:calc(0.1rem * var(--voca-rem-multiplier)) solid #29003e}.telia-date-picker__day.is-today:hover{background-color:#fbf0ff}.telia-date-picker__day:hover{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;background-color:#edc8ff;color:#29003e}.telia-date-picker__day[aria-pressed=true],.telia-date-picker__day[aria-pressed=true]:hover{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;background-color:#990ae3;color:#ffffff;box-shadow:none;outline:0}.telia-date-picker__day:focus-visible{outline:none}.telia-date-picker__day:focus{outline:none;}.telia-date-picker__day:focus::before{border-radius:calc(99.9rem * var(--voca-rem-multiplier));box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;bottom:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));content:"";display:block;left:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));position:absolute;right:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));top:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));z-index:101}@media screen and (min-width: 37.5em){.telia-date-picker__day:focus::before{z-index:301}}.telia-date-picker__day:not(.is-month){font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;box-shadow:none}.telia-date-picker__day:not(.is-month),.telia-date-picker__day[aria-disabled=true]{color:#b0b0b5;background:transparent;cursor:default}.telia-date-picker__day[aria-disabled=true]{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;background-color:#e8e8ed;color:#8c8c90}.telia-date-picker__day[aria-disabled=true]:not(.is-today)::before{display:none}.telia-date-picker__day.is-outside{color:#606064;background-color:#e8e8ed;box-shadow:none;cursor:default;opacity:0.6;pointer-events:none}.telia-date-picker__day.is-outside::before{display:none}.telia-date-picker__header{border-bottom:calc(0.1rem * var(--voca-rem-multiplier)) solid #dcdce1;align-items:center;display:flex;justify-content:space-between;padding:calc(3.2rem * var(--voca-rem-multiplier)) calc(1.6rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier)) calc(calc(1.6rem * var(--voca-rem-multiplier)) - calc(0.8rem * var(--voca-rem-multiplier)));width:100%}@media screen and (min-width: 37.5em){.telia-date-picker__header{padding:calc(3.2rem * var(--voca-rem-multiplier)) calc(2rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier))}}.telia-date-picker__nav{white-space:nowrap}.telia-date-picker__prev,.telia-date-picker__next{color:#29003e;border:calc(0.1rem * var(--voca-rem-multiplier)) solid #29003e;align-items:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;border-radius:50%;cursor:pointer;display:inline-flex;height:calc(3.2rem * var(--voca-rem-multiplier));justify-content:center;margin-left:calc(0.8rem * var(--voca-rem-multiplier));padding:0;width:calc(3.2rem * var(--voca-rem-multiplier))}.telia-date-picker__prev:hover,.telia-date-picker__next:hover{background-color:#edc8ff}.telia-date-picker__prev:focus,.telia-date-picker__next:focus{box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline:none}.telia-date-picker__prev:active:focus,.telia-date-picker__next:active:focus{box-shadow:none}.telia-date-picker__prev:disabled,.telia-date-picker__next:disabled{cursor:default;opacity:0.5}.telia-date-picker__prev-icon{margin:0 auto}.telia-date-picker__next-icon{margin:0 auto}.telia-date-picker__select{display:inline-flex;margin-top:calc(0.4rem * var(--voca-rem-multiplier));position:relative}.telia-date-picker__select select{cursor:pointer;font-size:calc(1rem * var(--voca-rem-multiplier));height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.telia-date-picker__select select:focus+.telia-date-picker__select-label{box-shadow:0 0 0 calc(0.2rem * var(--voca-rem-multiplier)) #0099ff}.telia-date-picker__select-icon{margin:0 0 0 calc(0.4rem * var(--voca-rem-multiplier))}.telia-date-picker__select-label{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;font-size:calc(1.6rem * var(--voca-rem-multiplier));color:#222222;border-radius:calc(0.2rem * var(--voca-rem-multiplier));align-items:center;display:flex;line-height:1.25;padding:0 calc(0.4rem * var(--voca-rem-multiplier)) 0 calc(0.8rem * var(--voca-rem-multiplier));pointer-events:none;position:relative;width:100%}.telia-date-picker__mobile{background-color:#fbf0ff;align-items:center;display:flex;justify-content:space-between;overflow:hidden;padding:calc(1.6rem * var(--voca-rem-multiplier)) calc(1.6rem * var(--voca-rem-multiplier));position:relative;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width: 37.5em){.telia-date-picker__mobile{background-color:transparent;border:0;overflow:visible;padding:0;position:absolute;right:calc(-0.8rem * var(--voca-rem-multiplier));top:calc(-0.8rem * var(--voca-rem-multiplier))}}.telia-date-picker__mobile-heading{color:#29003e;display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width: 37.5em){.telia-date-picker__mobile-heading{display:none}}.telia-date-picker__close{color:#222222;border-radius:calc(99.9rem * var(--voca-rem-multiplier));align-items:center;-webkit-appearance:none;appearance:none;border:0;cursor:pointer;display:flex;height:calc(2.4rem * var(--voca-rem-multiplier));justify-content:center;padding:0;width:calc(2.4rem * var(--voca-rem-multiplier))}@media screen and (min-width: 37.5em){.telia-date-picker__close{opacity:0}}.telia-date-picker__close:hover{color:#29003e}.telia-date-picker__close:focus{box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline:none}@media screen and (min-width: 37.5em){.telia-date-picker__close:focus{opacity:1}}.telia-date-picker__close-icon{margin:0 auto}.telia-date-picker__vhidden{border:0;clip:rect(calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)));height:calc(0.1rem * var(--voca-rem-multiplier));overflow:hidden;padding:0;position:absolute;top:0;width:calc(0.1rem * var(--voca-rem-multiplier))}', h = {
|
|
250
|
+
}, be = '.telia-date-picker{display:flex;flex-direction:column;position:relative}.telia-date-picker__label{order:1}.telia-date-picker__label label{color:rgba(0, 0, 0, 0.85)}.telia-date-picker__input{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3);border-radius:calc(0.2rem * var(--voca-rem-multiplier));background-color:#ffffff;font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1.6rem * var(--voca-rem-multiplier));line-height:1.5;-webkit-appearance:none;appearance:none;box-sizing:border-box;color:rgba(0, 0, 0, 0.85);display:block;margin:0;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier));width:100%;color:rgba(0, 0, 0, 0.85);height:calc(4.6rem * var(--voca-rem-multiplier));margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:2}.telia-date-picker__input:required{box-shadow:none}.telia-date-picker__input:hover{border:calc(0.2rem * var(--voca-rem-multiplier)) solid #29003e;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-date-picker__input:hover:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-date-picker__input:focus{outline:solid calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline-offset:calc(0.2rem * var(--voca-rem-multiplier));padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:focus:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-date-picker__input:read-only{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;background-color:rgba(0, 0, 0, 0.05)}.telia-date-picker__input:read-only:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:disabled{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.15);background-color:rgba(0, 0, 0, 0.1);color:rgba(0, 0, 0, 0.4);cursor:not-allowed;-webkit-text-fill-color:#606064}.telia-date-picker__input:disabled:hover{padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:disabled~.telia-date-picker__label .telia-label{color:rgba(0, 0, 0, 0.4);cursor:not-allowed}.telia-date-picker__input:disabled~.telia-date-picker__additional{color:rgba(0, 0, 0, 0.4)}.telia-date-picker__input:invalid{box-shadow:none}.telia-date-picker__input--touched:invalid{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #e4175c}.telia-date-picker__input--touched:invalid:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-date-picker__input--touched:invalid:hover:not(:focus){border:calc(0.2rem * var(--voca-rem-multiplier)) solid #e4175c;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-date-picker__input-icon-container{align-items:center;display:flex;flex-direction:row;height:calc(4.6rem * var(--voca-rem-multiplier));justify-content:flex-end;margin:calc(-1 * calc(4.6rem * var(--voca-rem-multiplier))) 0 0 calc(100% - calc(1.2rem * var(--voca-rem-multiplier)));order:3}.telia-date-picker__additional{order:5}.telia-date-picker__error{margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:6}.telia-date-picker__toggle-icon{margin:0 calc(1.2rem * var(--voca-rem-multiplier))}.telia-date-picker__input:invalid~.telia-date-picker__input-icon-container .telia-date-picker__toggle-icon{color:#e4175c}.telia-date-picker__dialog-container{order:4}.telia-date-picker__dialog{z-index:300;background-color:rgba(0, 0, 0, 0.3);bottom:0;display:flex;left:0;min-width:calc(32rem * var(--voca-rem-multiplier));opacity:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility}@media screen and (min-width: 37.5em){.telia-date-picker__dialog{z-index:100;background:none;bottom:auto;position:absolute;right:auto;top:auto;transform:scale(0.96) translateZ(0) translateY(-2rem);transform-origin:top right}}.telia-date-picker__dialog.is-left{left:auto;right:0;width:auto}.telia-date-picker__dialog.is-active{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.telia-date-picker__dialog-content{background-color:#ffffff;border-radius:0;border-top-left-radius:calc(0.2rem * var(--voca-rem-multiplier));border-top-right-radius:calc(0.2rem * var(--voca-rem-multiplier));border-top:calc(0.1rem * var(--voca-rem-multiplier)) solid #606064;bottom:0;display:none;left:0;margin:0;max-width:none;padding:0;position:absolute;transform:translateZ(0) translateY(100%);width:100%}@media screen and (min-width: 37.5em){.telia-date-picker__dialog-content{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3);border-radius:calc(0.2rem * var(--voca-rem-multiplier));box-shadow:0 calc(0.8rem * var(--voca-rem-multiplier)) calc(2.4rem * var(--voca-rem-multiplier)) #dcdce1;margin:calc(0.8rem * var(--voca-rem-multiplier)) 0 0 auto;max-width:calc(31rem * var(--voca-rem-multiplier));min-width:calc(29rem * var(--voca-rem-multiplier));padding:0;position:relative;transform:none;transition:none;visibility:visible}}.is-active .telia-date-picker__dialog-content{display:block;transform:translateZ(0) translateY(0)}.telia-date-picker__table-wrapper{margin:calc(1.6rem * var(--voca-rem-multiplier)) 0 calc(2rem * var(--voca-rem-multiplier));padding:0 calc(1.6rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier))}@media screen and (min-width: 37.5em){.telia-date-picker__table-wrapper{padding:0 calc(2rem * var(--voca-rem-multiplier))}}.telia-date-picker__table{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1rem * var(--voca-rem-multiplier));color:#222222;border-collapse:collapse;border-spacing:0;line-height:1.25;margin:0;padding:0;text-align:center;width:100%}.telia-date-picker__table-header{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;font-size:calc(1.2rem * var(--voca-rem-multiplier));color:#222222;letter-spacing:calc(0.1rem * var(--voca-rem-multiplier));line-height:1.4;padding-bottom:calc(0.8rem * var(--voca-rem-multiplier));text-decoration:none;text-transform:uppercase}.telia-date-picker__cell{text-align:center}.telia-date-picker__day{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1.4rem * var(--voca-rem-multiplier));color:#29003e;-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;cursor:pointer;display:inline-block;font-variant-numeric:tabular-nums;height:calc(3.2rem * var(--voca-rem-multiplier));line-height:calc(1.6rem * var(--voca-rem-multiplier));padding:0 0 calc(0.1rem * var(--voca-rem-multiplier));position:relative;text-align:center;vertical-align:middle;width:calc(3.2rem * var(--voca-rem-multiplier))}.telia-date-picker__day.is-today{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;color:#29003e;border:calc(0.1rem * var(--voca-rem-multiplier)) solid #29003e}.telia-date-picker__day:hover{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;background-color:#edc8ff;color:#29003e}.telia-date-picker__day[aria-pressed=true]{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;background-color:#29003e;color:#ffffff;box-shadow:none;outline:0}.telia-date-picker__day:focus-visible{outline:none}.telia-date-picker__day:focus{outline:none;}.telia-date-picker__day:focus::before{border-radius:calc(99.9rem * var(--voca-rem-multiplier));box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;bottom:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));content:"";display:block;left:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));position:absolute;right:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));top:calc(-1 * calc(0.4rem * var(--voca-rem-multiplier)));z-index:101}@media screen and (min-width: 37.5em){.telia-date-picker__day:focus::before{z-index:301}}.telia-date-picker__day:not(.is-month){font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;box-shadow:none}.telia-date-picker__day:not(.is-month),.telia-date-picker__day[aria-disabled=true]{background:transparent;color:rgba(0, 0, 0, 0.4);cursor:default}.telia-date-picker__day[aria-disabled=true]{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;background-color:rgba(0, 0, 0, 0.1);color:rgba(0, 0, 0, 0.6)}.telia-date-picker__header{border-bottom:calc(0.1rem * var(--voca-rem-multiplier)) solid #dcdce1;align-items:center;display:flex;justify-content:space-between;padding:calc(3.2rem * var(--voca-rem-multiplier)) calc(1.6rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier)) calc(calc(1.6rem * var(--voca-rem-multiplier)) - calc(0.8rem * var(--voca-rem-multiplier)));width:100%}@media screen and (min-width: 37.5em){.telia-date-picker__header{padding:calc(3.2rem * var(--voca-rem-multiplier)) calc(2rem * var(--voca-rem-multiplier)) calc(0.8rem * var(--voca-rem-multiplier))}}.telia-date-picker__nav{white-space:nowrap}.telia-date-picker__prev,.telia-date-picker__next{color:#29003e;border:calc(0.1rem * var(--voca-rem-multiplier)) solid #29003e;align-items:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;border-radius:50%;cursor:pointer;display:inline-flex;height:calc(3.2rem * var(--voca-rem-multiplier));justify-content:center;margin-left:calc(0.8rem * var(--voca-rem-multiplier));padding:0;width:calc(3.2rem * var(--voca-rem-multiplier))}.telia-date-picker__prev:not([disabled]):hover,.telia-date-picker__next:not([disabled]):hover{background-color:#edc8ff}.telia-date-picker__prev:focus,.telia-date-picker__next:focus{box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline:none}.telia-date-picker__prev:active:focus,.telia-date-picker__next:active:focus{box-shadow:none}.telia-date-picker__prev:disabled,.telia-date-picker__next:disabled{cursor:default;opacity:0.5}.telia-date-picker__prev-icon{margin:0 auto}.telia-date-picker__next-icon{margin:0 auto}.telia-date-picker__select{display:inline-flex;margin-top:calc(0.4rem * var(--voca-rem-multiplier));position:relative}.telia-date-picker__select select{cursor:pointer;font-size:calc(1rem * var(--voca-rem-multiplier));height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.telia-date-picker__select select:focus+.telia-date-picker__select-label{box-shadow:0 0 0 calc(0.2rem * var(--voca-rem-multiplier)) #0099ff}.telia-date-picker__select-icon{margin:0 0 0 calc(0.4rem * var(--voca-rem-multiplier))}.telia-date-picker__select-label{font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:bold;font-size:calc(1.6rem * var(--voca-rem-multiplier));color:#222222;border-radius:calc(0.2rem * var(--voca-rem-multiplier));align-items:center;display:flex;line-height:1.25;padding:0 calc(0.4rem * var(--voca-rem-multiplier)) 0 calc(0.8rem * var(--voca-rem-multiplier));pointer-events:none;position:relative;width:100%}.telia-date-picker__mobile{background-color:#fbf0ff;align-items:center;display:flex;justify-content:space-between;overflow:hidden;padding:calc(1.6rem * var(--voca-rem-multiplier)) calc(1.6rem * var(--voca-rem-multiplier));position:relative;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width: 37.5em){.telia-date-picker__mobile{background-color:transparent;border:0;overflow:visible;padding:0;position:absolute;right:calc(-0.8rem * var(--voca-rem-multiplier));top:calc(-0.8rem * var(--voca-rem-multiplier))}}.telia-date-picker__mobile-heading{color:#29003e;display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width: 37.5em){.telia-date-picker__mobile-heading{display:none}}.telia-date-picker__close{color:#222222;border-radius:calc(99.9rem * var(--voca-rem-multiplier));align-items:center;-webkit-appearance:none;appearance:none;border:0;cursor:pointer;display:flex;height:calc(2.4rem * var(--voca-rem-multiplier));justify-content:center;padding:0;width:calc(2.4rem * var(--voca-rem-multiplier))}@media screen and (min-width: 37.5em){.telia-date-picker__close{opacity:0}}.telia-date-picker__close:hover{color:#29003e}.telia-date-picker__close:focus{box-shadow:0 0 0 calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline:none}@media screen and (min-width: 37.5em){.telia-date-picker__close:focus{opacity:1}}.telia-date-picker__close-icon{margin:0 auto}.telia-date-picker__vhidden{border:0;clip:rect(calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)), calc(0.1rem * var(--voca-rem-multiplier)));height:calc(0.1rem * var(--voca-rem-multiplier));overflow:hidden;padding:0;position:absolute;top:0;width:calc(0.1rem * var(--voca-rem-multiplier))}', p = {
|
|
240
251
|
TAB: 9,
|
|
241
252
|
ESC: 27,
|
|
242
253
|
SPACE: 32,
|
|
@@ -250,19 +261,19 @@ const he = ({ selectedDate: e, focusedDate: t, labelledById: a, localization: r,
|
|
|
250
261
|
DOWN: 40
|
|
251
262
|
};
|
|
252
263
|
function _e(e, t) {
|
|
253
|
-
const a = e.value, r = e.selectionStart, l = a.slice(0, r),
|
|
254
|
-
return e.value =
|
|
264
|
+
const a = e.value, r = e.selectionStart, l = a.slice(0, r), o = a.slice(r, a.length), s = l.replace(t, ""), d = o.replace(t, ""), h = s + d, n = s.length;
|
|
265
|
+
return e.value = h, e.selectionStart = e.selectionEnd = n, h;
|
|
255
266
|
}
|
|
256
|
-
const
|
|
267
|
+
const ke = /[^0-9\.\/\-]+/g, L = 300, ye = /* @__PURE__ */ q(class extends K {
|
|
257
268
|
constructor() {
|
|
258
|
-
super(), this.__registerHost(), this.vocaChange = F(this, "vocaChange", 7), this.vocaBlur = F(this, "vocaBlur", 7), this.vocaFocus = F(this, "vocaFocus", 7), this.monthSelectId =
|
|
269
|
+
super(), this.__registerHost(), this.vocaChange = F(this, "vocaChange", 7), this.vocaBlur = F(this, "vocaBlur", 7), this.vocaFocus = F(this, "vocaFocus", 7), this.monthSelectId = k("dateMonth"), this.yearSelectId = k("dateYear"), this.dialogLabelId = k("dateLabel"), this.body = document.body, this.initialTouchX = null, this.initialTouchY = null, this.dataTrackingId = "telia-date-picker", this.name = "date", this.additionalId = k("additional"), this.inputId = k("input"), this.disabled = !1, this.direction = "right", this.readonly = !1, this.required = !1, this.value = "", this.min = "", this.max = "", this.yearRange = { past: 10, future: 10 }, this.firstDayOfWeek = y.Monday, this.localization = ve, this.dateAdapter = fe, this.modalOpen = !1, this.isDateDisabled = () => !1, this.errorId = k("error"), this.activeFocus = !1, this.focusedDay = new Date(), this.open = this.modalOpen, this.errorMessageState = "", this.touched = !1, this.enableActiveFocus = () => {
|
|
259
270
|
this.activeFocus = !0;
|
|
260
271
|
}, this.disableActiveFocus = () => {
|
|
261
272
|
this.activeFocus = !1;
|
|
262
273
|
}, this.toggleOpen = (e) => {
|
|
263
274
|
e.preventDefault(), this.open ? this.hide(!1) : this.show();
|
|
264
275
|
}, this.handleEscKey = (e) => {
|
|
265
|
-
e.keyCode ===
|
|
276
|
+
e.keyCode === p.ESC && this.hide();
|
|
266
277
|
}, this.handleBlur = (e) => {
|
|
267
278
|
e.stopPropagation(), this.updateErrorState(), this.vocaBlur.emit({
|
|
268
279
|
component: "telia-date-picker"
|
|
@@ -275,45 +286,45 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
275
286
|
const t = e.changedTouches[0];
|
|
276
287
|
this.initialTouchX = t.pageX, this.initialTouchY = t.pageY;
|
|
277
288
|
}, this.handleTouchEnd = (e) => {
|
|
278
|
-
const t = e.changedTouches[0], a = t.pageX - this.initialTouchX, r = t.pageY - this.initialTouchY, l = 70,
|
|
279
|
-
|
|
289
|
+
const t = e.changedTouches[0], a = t.pageX - this.initialTouchX, r = t.pageY - this.initialTouchY, l = 70, o = Math.abs(a) >= l && Math.abs(r) <= l, s = Math.abs(r) >= l && Math.abs(a) <= l && r > 0;
|
|
290
|
+
o ? this.addMonths(a < 0 ? 1 : -1) : s && (this.hide(!1), e.preventDefault()), this.initialTouchY = null, this.initialTouchX = null;
|
|
280
291
|
}, this.handleNextMonthClick = (e) => {
|
|
281
292
|
e.preventDefault(), this.addMonths(1);
|
|
282
293
|
}, this.handlePreviousMonthClick = (e) => {
|
|
283
294
|
e.preventDefault(), this.addMonths(-1);
|
|
284
295
|
}, this.handleFirstFocusableKeydown = (e) => {
|
|
285
|
-
e.keyCode ===
|
|
296
|
+
e.keyCode === p.TAB && e.shiftKey && (this.focusedDayNode.focus(), e.preventDefault());
|
|
286
297
|
}, this.handleCloseButtonClick = () => {
|
|
287
298
|
this.hide();
|
|
288
299
|
}, this.handleKeyboardNavigation = (e) => {
|
|
289
|
-
if (e.keyCode ===
|
|
300
|
+
if (e.keyCode === p.TAB && !e.shiftKey) {
|
|
290
301
|
e.preventDefault(), this.firstFocusableElement.focus();
|
|
291
302
|
return;
|
|
292
303
|
}
|
|
293
304
|
var t = !0;
|
|
294
305
|
switch (e.keyCode) {
|
|
295
|
-
case
|
|
306
|
+
case p.RIGHT:
|
|
296
307
|
this.addDays(1);
|
|
297
308
|
break;
|
|
298
|
-
case
|
|
309
|
+
case p.LEFT:
|
|
299
310
|
this.addDays(-1);
|
|
300
311
|
break;
|
|
301
|
-
case
|
|
312
|
+
case p.DOWN:
|
|
302
313
|
this.addDays(7);
|
|
303
314
|
break;
|
|
304
|
-
case
|
|
315
|
+
case p.UP:
|
|
305
316
|
this.addDays(-7);
|
|
306
317
|
break;
|
|
307
|
-
case
|
|
318
|
+
case p.PAGE_UP:
|
|
308
319
|
e.shiftKey ? this.addYears(-1) : this.addMonths(-1);
|
|
309
320
|
break;
|
|
310
|
-
case
|
|
321
|
+
case p.PAGE_DOWN:
|
|
311
322
|
e.shiftKey ? this.addYears(1) : this.addMonths(1);
|
|
312
323
|
break;
|
|
313
|
-
case
|
|
324
|
+
case p.HOME:
|
|
314
325
|
this.startOfWeek();
|
|
315
326
|
break;
|
|
316
|
-
case
|
|
327
|
+
case p.END:
|
|
317
328
|
this.endOfWeek();
|
|
318
329
|
break;
|
|
319
330
|
default:
|
|
@@ -321,7 +332,7 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
321
332
|
}
|
|
322
333
|
t && (e.preventDefault(), this.enableActiveFocus());
|
|
323
334
|
}, this.handleDaySelect = (e, t) => {
|
|
324
|
-
const a =
|
|
335
|
+
const a = M(t, v(this.min), v(this.max)), r = !this.isDateDisabled(t);
|
|
325
336
|
a && r ? (this.setValue(t), this.hide()) : this.setFocusedDay(t);
|
|
326
337
|
}, this.handleMonthSelect = (e) => {
|
|
327
338
|
e.stopPropagation(), this.setMonth(parseInt(e.target.value, 10));
|
|
@@ -329,7 +340,7 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
329
340
|
e.stopPropagation(), this.setYear(parseInt(e.target.value, 10));
|
|
330
341
|
}, this.handleInputChange = () => {
|
|
331
342
|
const e = this.datePickerInput;
|
|
332
|
-
_e(e,
|
|
343
|
+
_e(e, ke);
|
|
333
344
|
const t = this.dateAdapter.parse(e.value, S);
|
|
334
345
|
(t || e.value === "") && this.setValue(t);
|
|
335
346
|
}, this.processFocusedDayNode = (e) => {
|
|
@@ -338,7 +349,7 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
338
349
|
this.touched = !0;
|
|
339
350
|
}, this.isValueValid = () => {
|
|
340
351
|
const e = this.datePickerInput.value, t = this.dateAdapter.parse(e, S);
|
|
341
|
-
return t === void 0 || !
|
|
352
|
+
return t === void 0 || !M(t, v(this.min), v(this.max)) ? !1 : !this.isDateDisabled(t);
|
|
342
353
|
}, this.updateErrorMessage = (e) => {
|
|
343
354
|
var t;
|
|
344
355
|
(t = this.datePickerInput) === null || t === void 0 || t.setCustomValidity(e), this.errorMessageState = e;
|
|
@@ -347,13 +358,13 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
347
358
|
return ((e = this.datePickerInput) === null || e === void 0 ? void 0 : e.value.length) === 0;
|
|
348
359
|
}, this.updateErrorState = () => {
|
|
349
360
|
var e, t, a;
|
|
350
|
-
const r = !!(!((e = this.errorMessageState) === null || e === void 0) && e.length), l = this.required,
|
|
351
|
-
if (
|
|
361
|
+
const r = !!(!((e = this.errorMessageState) === null || e === void 0) && e.length), l = this.required, o = !!(!((t = this.errorMessage) === null || t === void 0) && t.length), s = !!(!((a = this.invalidErrorMessage) === null || a === void 0) && a.length), d = !!this.datePickerInput;
|
|
362
|
+
if (o) {
|
|
352
363
|
this.updateErrorMessage(this.errorMessage), this.makeTouched();
|
|
353
364
|
return;
|
|
354
365
|
}
|
|
355
|
-
if (
|
|
356
|
-
if (
|
|
366
|
+
if (s && d && !this.isValueValid() && this.updateErrorMessage(this.invalidErrorMessage), l && this.touched && this.requiredErrorMessage && this.isValueMissing() && this.updateErrorMessage(this.requiredErrorMessage), r) {
|
|
367
|
+
if (o || s && !this.isValueValid())
|
|
357
368
|
return;
|
|
358
369
|
this.updateErrorMessage("");
|
|
359
370
|
}
|
|
@@ -406,7 +417,7 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
406
417
|
* Show the calendar modal, moving focus to the calendar inside.
|
|
407
418
|
*/
|
|
408
419
|
async show() {
|
|
409
|
-
this.open = !0, this.modalOpen = !0, this.setFocusedDay(
|
|
420
|
+
this.open = !0, this.modalOpen = !0, this.setFocusedDay(v(this.value) || new Date());
|
|
410
421
|
let { matches: e } = window.matchMedia("(max-width: 600px)");
|
|
411
422
|
e && (this.body.style.overflowY = "hidden", this.body.style.position = "fixed", this.body.style.width = "100%"), clearTimeout(this.focusTimeoutId), this.focusTimeoutId = setTimeout(() => this.monthSelectNode.focus(), L);
|
|
412
423
|
}
|
|
@@ -433,15 +444,15 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
433
444
|
this.setFocusedDay(R(this.focusedDay, this.firstDayOfWeek));
|
|
434
445
|
}
|
|
435
446
|
setMonth(e) {
|
|
436
|
-
const t = H(
|
|
437
|
-
this.setFocusedDay(
|
|
447
|
+
const t = H(D(this.focusedDay), e), a = C(t), r = H(this.focusedDay, e);
|
|
448
|
+
this.setFocusedDay(I(r, t, a));
|
|
438
449
|
}
|
|
439
450
|
setYear(e) {
|
|
440
|
-
const t = Y(
|
|
441
|
-
this.setFocusedDay(
|
|
451
|
+
const t = Y(D(this.focusedDay), e), a = C(t), r = Y(this.focusedDay, e);
|
|
452
|
+
this.setFocusedDay(I(r, t, a));
|
|
442
453
|
}
|
|
443
454
|
setFocusedDay(e) {
|
|
444
|
-
this.focusedDay =
|
|
455
|
+
this.focusedDay = I(e, v(this.min), v(this.max));
|
|
445
456
|
}
|
|
446
457
|
setValue(e) {
|
|
447
458
|
this.value = V(e), this.vocaChange.emit({
|
|
@@ -459,16 +470,16 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
459
470
|
const t = !!this.additional, a = !!(!((e = this.errorMessageState) === null || e === void 0) && e.length), r = j({
|
|
460
471
|
[this.additionalId]: t,
|
|
461
472
|
[this.errorId]: a
|
|
462
|
-
}), l =
|
|
463
|
-
return i($, null, i("telia-vst", { dataTrackingId: this.dataTrackingId }), i("div", { class: "telia-date-picker" }, i(
|
|
473
|
+
}), l = v(this.value), o = l && this.dateAdapter.format(l), s = (l || this.focusedDay).getFullYear(), d = this.focusedDay.getMonth(), h = this.focusedDay.getFullYear(), n = v(this.min), u = v(this.max), _ = n !== void 0 && n.getMonth() === d && n.getFullYear() === h, g = u !== void 0 && u.getMonth() === d && u.getFullYear() === h, b = n !== void 0 ? n.getFullYear() : s - this.range.past, m = u !== void 0 ? u.getFullYear() : s + this.range.future;
|
|
474
|
+
return i($, null, i("telia-vst", { dataTrackingId: this.dataTrackingId }), i("div", { class: "telia-date-picker" }, i(de, { dateFormatter: this.dateFormatLong, describedBy: r, value: this.value, valueAsDate: l, formattedValue: o, onInput: this.handleInputChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.toggleOpen, name: this.name, disabled: this.disabled, readonly: this.readonly, role: this.role, required: this.required, identifier: this.inputId, localization: this.localization, buttonLabel: this.buttonLabel, buttonRef: this.setToggleRef, inputRef: this.setTextInputRef, touched: this.touched, makeTouched: this.makeTouched, htmlForm: this.htmlForm }), i("telia-label", { class: "telia-date-picker__label", htmlFor: this.inputId }, this.required && i("span", { "aria-hidden": "true" }, "* "), this.label), t && i("telia-field-assistive-text", { class: "telia-date-picker__additional", id: this.additionalId }, this.additional), a && i("telia-field-error", { class: "telia-date-picker__error", id: this.errorId }, this.errorMessageState), i("div", { class: "telia-date-picker__dialog-container" }, i("div", { class: {
|
|
464
475
|
"telia-date-picker__dialog": !0,
|
|
465
476
|
"is-left": this.direction === "left",
|
|
466
477
|
"is-active": this.open
|
|
467
|
-
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, i("div", { class: "telia-date-picker__dialog-content", onKeyDown: this.handleEscKey, ref: this.setDialogWrapperRef }, i("div", { class: "telia-date-picker__mobile", onFocusin: this.disableActiveFocus }, i("telia-heading", { tag: "h2", class: "telia-date-picker__mobile-heading", variant: "subsection-100" }, this.localization.calendarHeading), i("button", { class: "telia-date-picker__close", ref: this.setCloseButtonRef, onKeyDown: this.handleFirstFocusableKeydown, onClick: this.handleCloseButtonClick, type: "button" }, i("telia-icon", { class: "telia-date-picker__close-icon", svg: J.svg, size: "sm" }), i("span", { class: "telia-date-picker__vhidden" }, this.localization.closeLabel))), i("div", { class: "telia-date-picker__header", onFocusin: this.disableActiveFocus }, i("div", null, i("h2", { id: this.dialogLabelId, class: "telia-date-picker__vhidden", "aria-live": "polite", "aria-atomic": "true" }, this.localization.monthNames[d], " ", this.focusedDay.getFullYear()), i("label", { htmlFor: this.monthSelectId, class: "telia-date-picker__vhidden" }, this.localization.monthSelectLabel), i("div", { class: "telia-date-picker__select" }, i("select", { id: this.monthSelectId, class: "telia-date-picker__select--month", ref: this.setMonthSelectRef, onChange: this.handleMonthSelect, onInput: (
|
|
468
|
-
|
|
469
|
-
} }, this.localization.monthNames.map((
|
|
470
|
-
|
|
471
|
-
} },
|
|
478
|
+
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, i("div", { class: "telia-date-picker__dialog-content", onKeyDown: this.handleEscKey, ref: this.setDialogWrapperRef }, i("div", { class: "telia-date-picker__mobile", onFocusin: this.disableActiveFocus }, i("telia-heading", { tag: "h2", class: "telia-date-picker__mobile-heading", variant: "subsection-100" }, this.localization.calendarHeading), i("button", { class: "telia-date-picker__close", ref: this.setCloseButtonRef, onKeyDown: this.handleFirstFocusableKeydown, onClick: this.handleCloseButtonClick, type: "button" }, i("telia-icon", { class: "telia-date-picker__close-icon", svg: J.svg, size: "sm" }), i("span", { class: "telia-date-picker__vhidden" }, this.localization.closeLabel))), i("div", { class: "telia-date-picker__header", onFocusin: this.disableActiveFocus }, i("div", null, i("h2", { id: this.dialogLabelId, class: "telia-date-picker__vhidden", "aria-live": "polite", "aria-atomic": "true" }, this.localization.monthNames[d], " ", this.focusedDay.getFullYear()), i("label", { htmlFor: this.monthSelectId, class: "telia-date-picker__vhidden" }, this.localization.monthSelectLabel), i("div", { class: "telia-date-picker__select" }, i("select", { id: this.monthSelectId, class: "telia-date-picker__select--month", ref: this.setMonthSelectRef, onChange: this.handleMonthSelect, onInput: (c) => {
|
|
479
|
+
c.stopPropagation();
|
|
480
|
+
} }, this.localization.monthNames.map((c, f) => i("option", { key: c, value: f, selected: f === d, disabled: !M(new Date(h, f, 1), n !== void 0 ? D(n) : null, u !== void 0 ? C(u) : null) }, c))), i("div", { class: "telia-date-picker__select-label", "aria-hidden": "true" }, i("span", null, this.localization.monthNamesShort[d]), i("telia-icon", { class: "telia-date-picker__select-icon", svg: E.svg, size: "sm" }))), i("label", { htmlFor: this.yearSelectId, class: "telia-date-picker__vhidden" }, this.localization.yearSelectLabel), i("div", { class: "telia-date-picker__select" }, i("select", { id: this.yearSelectId, class: "telia-date-picker__select--year", onChange: this.handleYearSelect, onInput: (c) => {
|
|
481
|
+
c.stopPropagation();
|
|
482
|
+
} }, ge(b, m).map((c) => i("option", { key: c, selected: c === h }, c))), i("div", { class: "telia-date-picker__select-label", "aria-hidden": "true" }, i("span", null, this.focusedDay.getFullYear()), i("telia-icon", { class: "telia-date-picker__select-icon", svg: E.svg, size: "sm" })))), i("div", { class: "telia-date-picker__nav" }, i("button", { class: "telia-date-picker__prev", onClick: this.handlePreviousMonthClick, disabled: _, type: "button" }, i("telia-icon", { class: "telia-date-picker__prev-icon", svg: oe.svg, size: "sm" }), i("span", { class: "telia-date-picker__vhidden" }, this.localization.prevMonthLabel)), i("button", { class: "telia-date-picker__next", onClick: this.handleNextMonthClick, disabled: g, type: "button" }, i("telia-icon", { class: "telia-date-picker__next-icon", svg: re.svg, size: "sm" }), i("span", { class: "telia-date-picker__vhidden" }, this.localization.nextMonthLabel)))), i(pe, { dateFormatter: this.dateFormatShort, selectedDate: l, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, localization: this.localization, firstDayOfWeek: this.firstDayOfWeek, focusedDayRef: this.processFocusedDayNode, min: n, max: u, isDateDisabled: this.isDateDisabled }))))));
|
|
472
483
|
}
|
|
473
484
|
get element() {
|
|
474
485
|
return this;
|
|
@@ -480,7 +491,7 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
480
491
|
};
|
|
481
492
|
}
|
|
482
493
|
static get style() {
|
|
483
|
-
return
|
|
494
|
+
return be;
|
|
484
495
|
}
|
|
485
496
|
}, [0, "telia-date-picker", {
|
|
486
497
|
dataTestid: [1, "data-testid"],
|
|
@@ -518,34 +529,37 @@ const be = /[^0-9\.\/\-]+/g, L = 300, ke = /* @__PURE__ */ q(class extends K {
|
|
|
518
529
|
show: [64],
|
|
519
530
|
hide: [64]
|
|
520
531
|
}, [[6, "click", "handleDocumentClick"]]]);
|
|
521
|
-
function
|
|
532
|
+
function we() {
|
|
522
533
|
if (typeof customElements > "u")
|
|
523
534
|
return;
|
|
524
|
-
["telia-date-picker", "telia-field-assistive-text", "telia-field-error", "telia-heading", "telia-icon", "telia-label", "telia-vst"].forEach((t) => {
|
|
535
|
+
["telia-date-picker", "telia-button", "telia-field-assistive-text", "telia-field-error", "telia-heading", "telia-icon", "telia-label", "telia-vst"].forEach((t) => {
|
|
525
536
|
switch (t) {
|
|
526
537
|
case "telia-date-picker":
|
|
527
|
-
customElements.get(t) || customElements.define(t,
|
|
538
|
+
customElements.get(t) || customElements.define(t, ye);
|
|
528
539
|
break;
|
|
529
|
-
case "telia-
|
|
540
|
+
case "telia-button":
|
|
530
541
|
customElements.get(t) || U();
|
|
531
542
|
break;
|
|
532
|
-
case "telia-field-
|
|
543
|
+
case "telia-field-assistive-text":
|
|
533
544
|
customElements.get(t) || X();
|
|
534
545
|
break;
|
|
535
|
-
case "telia-
|
|
546
|
+
case "telia-field-error":
|
|
536
547
|
customElements.get(t) || Q();
|
|
537
548
|
break;
|
|
538
|
-
case "telia-
|
|
549
|
+
case "telia-heading":
|
|
539
550
|
customElements.get(t) || ee();
|
|
540
551
|
break;
|
|
541
|
-
case "telia-
|
|
552
|
+
case "telia-icon":
|
|
542
553
|
customElements.get(t) || te();
|
|
543
554
|
break;
|
|
544
|
-
case "telia-
|
|
555
|
+
case "telia-label":
|
|
545
556
|
customElements.get(t) || ae();
|
|
546
557
|
break;
|
|
558
|
+
case "telia-vst":
|
|
559
|
+
customElements.get(t) || ie();
|
|
560
|
+
break;
|
|
547
561
|
}
|
|
548
562
|
});
|
|
549
563
|
}
|
|
550
|
-
|
|
564
|
+
we();
|
|
551
565
|
//# sourceMappingURL=telia-date-picker.js.map
|