@golemui/gui-lit 1.1.0 → 1.1.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
- package/{calendar-BuJgwvZx.js → calendar-D31xNsxx.js} +72 -59
- package/{calendar.element-M5MPJmap.js → calendar.element-BhFrCsns.js} +22 -20
- package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
- package/{currency.element-CfFrAtrr.js → currency.element-D8A2ObpM.js} +11 -10
- package/{date-Bj9mI3GU.js → date-DBuYpvcO.js} +35 -27
- package/{date-input-cJDkNnVw.js → date-input-DLiMreSS.js} +64 -44
- package/date-picker.element-DeUQtbLg.js +357 -0
- package/{date-time-calendar-BzRfkLKU.js → date-time-calendar-DzU-FtVl.js} +89 -76
- package/{date-time-calendar.element-DC4NK0y1.js → date-time-calendar.element-BLBcVsFu.js} +13 -11
- package/{date-time-input-BXxsfuyZ.js → date-time-input-DZaz2heD.js} +75 -43
- package/{date-time-picker.element-Dy-8cb-_.js → date-time-picker.element-BUbLdV6i.js} +125 -65
- package/{date-time.element-Bv4XdzMi.js → date-time.element-B5onfSBG.js} +31 -25
- package/{date.element-Consgsbb.js → date.element-BsKhLrEc.js} +22 -19
- package/{day-status-0-hJHrI7.js → day-status-CsWStVQV.js} +153 -129
- package/{dropdown.element-WsD61Qel.js → dropdown.element-CXpMwJsU.js} +19 -13
- package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
- package/index.js +1643 -1184
- package/index.umd.cjs +792 -399
- package/{list-CrLIL4by.js → list-D730tmGN.js} +115 -116
- package/{list.element-DV82YxnJ.js → list.element-eo3DIOrp.js} +2 -2
- package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
- package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
- package/package.json +6 -6
- package/{part-templates-Db871PS3.js → part-templates-VORbpgs2.js} +132 -118
- package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
- package/{pill-ranges-DCqDmpkk.js → pill-ranges-DpvWwP-3.js} +12 -12
- package/{pills-Be1UrLgq.js → pills-BDMO2NiR.js} +80 -58
- package/popup.controller-B33OvX_y.js +86 -0
- package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
- package/{range-calendar-CKPYeSGt.js → range-calendar-DO_woqcF.js} +101 -87
- package/{range-calendar.element-D6KYq18B.js → range-calendar.element-DHLZhpnj.js} +15 -13
- package/{range-date-input-D--AqBMv.js → range-date-input-Br7XqQPK.js} +90 -71
- package/{range-date-input.element-D4nIXJbw.js → range-date-input.element-BdD4SlB4.js} +15 -12
- package/{range-date-picker.element-dhxPAAE6.js → range-date-picker.element-DWRHiAoC.js} +97 -49
- package/{range-date-time-calendar-yksWrR7b.js → range-date-time-calendar-B3EMgN1E.js} +150 -136
- package/{range-date-time-calendar.element-C00aDefZ.js → range-date-time-calendar.element-Coea6RF4.js} +9 -7
- package/{range-date-time-input-B37TUoM3.js → range-date-time-input-Cu-T_nuC.js} +125 -94
- package/{range-date-time-input.element-DUnbv4ed.js → range-date-time-input.element-Cti44iuW.js} +31 -25
- package/{range-date-time-picker.element-Cbps6s_G.js → range-date-time-picker.element-CDN2RL1y.js} +107 -47
- package/{range-time-input-3lhqR1Ku.js → range-time-input-BP9ZL9O8.js} +85 -66
- package/{range-time-input.element-dU2iBdmJ.js → range-time-input.element-B7wtHJoQ.js} +14 -11
- package/{range-time-picker.element-v6nQsIPw.js → range-time-picker.element-CPIAiQPC.js} +92 -51
- package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
- package/{select.element-C0V-Bv3L.js → select.element-eepcXTpL.js} +84 -78
- package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
- package/{tags.element-DvwEpxpK.js → tags.element-CPHgotb0.js} +21 -14
- package/templates-Dmr34nwp.js +88 -0
- package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
- package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
- package/{time-input-BOhlBGJZ.js → time-input-5dkSm8UW.js} +67 -47
- package/{time-list-Czo48bZm.js → time-list-DLcq8BAp.js} +1 -1
- package/{time-picker-bFJ63ky8.js → time-picker-g337F8d0.js} +89 -51
- package/{time-picker.element-CYZVXgRS.js → time-picker.element-DLihegjg.js} +23 -19
- package/{time.element-fK3oLi49.js → time.element-BneqgMlQ.js} +22 -19
- package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
- package/date-picker.element-va_-LGZD.js +0 -312
- package/popup.controller-eUDxE6jD.js +0 -71
- package/templates-Dk1jxLwS.js +0 -75
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html as D, nothing as
|
|
2
|
-
import { p as b,
|
|
1
|
+
import { html as D, nothing as I } from "lit";
|
|
2
|
+
import { p as b, s as V, u as C, I as O, b as R, v, x, t as B } from "./date-DBuYpvcO.js";
|
|
3
3
|
import { live as H } from "lit/directives/live.js";
|
|
4
4
|
import { repeat as T } from "lit-html/directives/repeat.js";
|
|
5
5
|
const A = new Date(2025, 0, 15, 9, 5, 0);
|
|
@@ -10,14 +10,14 @@ function K(n, t) {
|
|
|
10
10
|
}).resolvedOptions();
|
|
11
11
|
return r === "h11" || r === "h12" ? "12" : "24";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ct(n, t) {
|
|
14
14
|
return new Intl.DateTimeFormat(n ?? "en", {
|
|
15
15
|
hour: "numeric",
|
|
16
16
|
minute: "numeric",
|
|
17
17
|
hourCycle: t === "12" ? "h12" : "h23"
|
|
18
18
|
}).formatToParts(A);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function lt(n, t) {
|
|
21
21
|
return new Intl.DateTimeFormat(n ?? "en", {
|
|
22
22
|
year: "numeric",
|
|
23
23
|
month: "numeric",
|
|
@@ -34,7 +34,7 @@ function U(n) {
|
|
|
34
34
|
}), r = (e) => t.formatToParts(new Date(2025, 0, 15, e, 0, 0)).find((s) => s.type === "dayPeriod")?.value ?? "";
|
|
35
35
|
return { am: r(9) || "AM", pm: r(21) || "PM" };
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function $(n) {
|
|
38
38
|
const t = n.getFullYear(), r = String(n.getMonth() + 1).padStart(2, "0"), e = String(n.getDate()).padStart(2, "0"), s = String(n.getHours()).padStart(2, "0"), i = String(n.getMinutes()).padStart(2, "0"), a = String(n.getSeconds()).padStart(2, "0");
|
|
39
39
|
return `${t}-${r}-${e}T${s}:${i}:${a}`;
|
|
40
40
|
}
|
|
@@ -50,7 +50,7 @@ function P(n) {
|
|
|
50
50
|
seconds: Number(t[3] ?? 0)
|
|
51
51
|
} : null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function d(n) {
|
|
54
54
|
const t = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(n);
|
|
55
55
|
return t ? new Date(
|
|
56
56
|
Number(t[1]),
|
|
@@ -61,19 +61,19 @@ function l(n) {
|
|
|
61
61
|
Number(t[6] ?? 0)
|
|
62
62
|
) : new Date(n);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const dt = "No available times";
|
|
65
65
|
function f(n, t) {
|
|
66
66
|
const r = (i) => i.length === 5 ? `${i}:00` : i, e = r(n), s = r(t);
|
|
67
67
|
return e < s ? -1 : e > s ? 1 : 0;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function mt(n, t) {
|
|
70
70
|
const r = P(n);
|
|
71
71
|
if (!r) return;
|
|
72
72
|
const e = r.hours * 60 + r.minutes + (t || 30);
|
|
73
73
|
if (!(e >= 1440))
|
|
74
74
|
return S(new Date(1970, 0, 1, Math.floor(e / 60), e % 60, 0));
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ht(n, t) {
|
|
77
77
|
if (!n?.length) return [];
|
|
78
78
|
const r = b(t).getDay();
|
|
79
79
|
return n.filter(
|
|
@@ -85,7 +85,7 @@ function q(n, t) {
|
|
|
85
85
|
(r) => f(n, r.start) >= 0 && f(n, r.end ?? r.start) <= 0
|
|
86
86
|
) : !1;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function ft(n, t, r) {
|
|
89
89
|
if (!r?.length) return !1;
|
|
90
90
|
const e = t ?? n;
|
|
91
91
|
return r.some((s) => {
|
|
@@ -93,64 +93,64 @@ function ht(n, t, r) {
|
|
|
93
93
|
return f(n, i) <= 0 && f(s.start, e) <= 0;
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function w(n) {
|
|
97
97
|
return n.length === 5 ? `${n}:00` : n;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function pt(n) {
|
|
100
100
|
if (!n.length) return [];
|
|
101
|
-
const t = n.map((e) => ({ start:
|
|
101
|
+
const t = n.map((e) => ({ start: w(e.start), end: w(e.end ?? e.start) })).sort((e, s) => f(e.start, s.start)), r = [];
|
|
102
102
|
for (const e of t) {
|
|
103
103
|
const s = r[r.length - 1];
|
|
104
104
|
s && f(e.start, s.end) <= 0 ? f(e.end, s.end) > 0 && (s.end = e.end) : r.push({ ...e });
|
|
105
105
|
}
|
|
106
106
|
return r;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
function gt(n, t) {
|
|
109
|
+
return d(n).getTime() <= d(t).getTime() ? { start: n, end: t } : { start: t, end: n };
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function yt(n) {
|
|
112
112
|
if (!n.length) return [];
|
|
113
113
|
const t = n.map((e) => ({
|
|
114
|
-
start:
|
|
115
|
-
end:
|
|
114
|
+
start: d(e.start).getTime(),
|
|
115
|
+
end: d(e.end ?? e.start).getTime()
|
|
116
116
|
})).sort((e, s) => e.start - s.start), r = [];
|
|
117
117
|
for (const e of t) {
|
|
118
118
|
const s = r[r.length - 1];
|
|
119
119
|
s && e.start <= s.end ? e.end > s.end && (s.end = e.end) : r.push({ start: e.start, end: e.end });
|
|
120
120
|
}
|
|
121
121
|
return r.map((e) => ({
|
|
122
|
-
start:
|
|
123
|
-
end:
|
|
122
|
+
start: $(new Date(e.start)),
|
|
123
|
+
end: $(new Date(e.end))
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function St(n, t) {
|
|
127
127
|
if (!t?.length) return !1;
|
|
128
|
-
const r =
|
|
128
|
+
const r = d(n.start).getTime(), e = d(n.end ?? n.start).getTime();
|
|
129
129
|
return t.some((s) => {
|
|
130
|
-
const i =
|
|
130
|
+
const i = d(s.start).getTime(), a = d(s.end ?? s.start).getTime();
|
|
131
131
|
return r < a && i < e;
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Tt(n, t) {
|
|
135
135
|
if (!t?.length) return !1;
|
|
136
|
-
const r =
|
|
136
|
+
const r = d(`${n}T00:00:00`).getTime(), e = d(`${n}T23:59:59`).getTime();
|
|
137
137
|
return t.some((s) => {
|
|
138
|
-
const i =
|
|
138
|
+
const i = d(s.start).getTime(), a = d(s.end ?? s.start).getTime();
|
|
139
139
|
return i <= r && a >= e;
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Dt(n, t) {
|
|
143
143
|
if (!n?.length) return [];
|
|
144
|
-
const r =
|
|
144
|
+
const r = d(`${t}T00:00:00`).getTime(), e = d(`${t}T23:59:59`).getTime(), s = [];
|
|
145
145
|
for (const i of n) {
|
|
146
|
-
const a =
|
|
146
|
+
const a = d(i.start).getTime(), o = d(i.end ?? i.start).getTime();
|
|
147
147
|
if (o < r || a > e) continue;
|
|
148
148
|
const u = a <= r ? "00:00:00" : S(new Date(a)), c = o >= e ? "23:59:59" : S(new Date(o));
|
|
149
149
|
s.push({ start: u, end: c });
|
|
150
150
|
}
|
|
151
151
|
return s;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Pt(n) {
|
|
154
154
|
const t = n.minuteStep || 30, r = P(n.minTime ?? "") ?? { hours: 0, minutes: 0, seconds: 0 }, e = S(new Date(1970, 0, 1, r.hours, r.minutes, r.seconds)), s = n.maxTime ?? "23:59:59", i = [];
|
|
155
155
|
for (let a = r.hours * 60 + r.minutes; a < 1440; a += t) {
|
|
156
156
|
const o = S(
|
|
@@ -161,7 +161,7 @@ function Dt(n) {
|
|
|
161
161
|
}
|
|
162
162
|
return i;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function _t(n, t, r) {
|
|
165
165
|
const e = P(n);
|
|
166
166
|
return e ? new Intl.DateTimeFormat(t ?? "en", {
|
|
167
167
|
hour: "numeric",
|
|
@@ -169,8 +169,8 @@ function Pt(n, t, r) {
|
|
|
169
169
|
hourCycle: r === "12" ? "h12" : "h23"
|
|
170
170
|
}).format(new Date(2025, 0, 15, e.hours, e.minutes, e.seconds)) : n;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
const e =
|
|
172
|
+
function It(n, t, r) {
|
|
173
|
+
const e = d(n);
|
|
174
174
|
return isNaN(e.getTime()) ? n : new Intl.DateTimeFormat(t ?? "en", {
|
|
175
175
|
year: "numeric",
|
|
176
176
|
month: "2-digit",
|
|
@@ -180,16 +180,16 @@ function _t(n, t, r) {
|
|
|
180
180
|
hour12: r === "12"
|
|
181
181
|
}).format(e);
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
const s =
|
|
183
|
+
function $t(n, t, r, e) {
|
|
184
|
+
const s = d(n).getTime();
|
|
185
185
|
if (isNaN(s)) return null;
|
|
186
186
|
if (t) {
|
|
187
|
-
const i =
|
|
187
|
+
const i = d(t);
|
|
188
188
|
if (!isNaN(i.getTime()) && s < i.getTime())
|
|
189
189
|
return e?.minDateTimeMessage ?? V;
|
|
190
190
|
}
|
|
191
191
|
if (r) {
|
|
192
|
-
const i =
|
|
192
|
+
const i = d(r);
|
|
193
193
|
if (!isNaN(i.getTime()) && s > i.getTime())
|
|
194
194
|
return e?.maxDateTimeMessage ?? C;
|
|
195
195
|
}
|
|
@@ -203,7 +203,16 @@ function Y(n) {
|
|
|
203
203
|
const t = n >= 12 ? "pm" : "am";
|
|
204
204
|
return { hour12: n % 12 === 0 ? 12 : n % 12, period: t };
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
const W = {
|
|
207
|
+
day: "Day",
|
|
208
|
+
month: "Month",
|
|
209
|
+
year: "Year",
|
|
210
|
+
hour: "Hour",
|
|
211
|
+
minute: "Minute",
|
|
212
|
+
second: "Second",
|
|
213
|
+
dayPeriod: "AM/PM"
|
|
214
|
+
};
|
|
215
|
+
function z() {
|
|
207
216
|
return {
|
|
208
217
|
day: { type: "day", kind: "numeric", maxLength: 2, min: 1, max: 31, placeholder: "dd" },
|
|
209
218
|
month: { type: "month", kind: "numeric", maxLength: 2, min: 1, max: 12, placeholder: "mm" },
|
|
@@ -218,7 +227,7 @@ function W() {
|
|
|
218
227
|
}
|
|
219
228
|
};
|
|
220
229
|
}
|
|
221
|
-
function
|
|
230
|
+
function j(n, t, r) {
|
|
222
231
|
return {
|
|
223
232
|
hour: n === "12" ? {
|
|
224
233
|
type: "hour",
|
|
@@ -257,23 +266,23 @@ function z(n, t, r) {
|
|
|
257
266
|
}
|
|
258
267
|
};
|
|
259
268
|
}
|
|
260
|
-
function
|
|
269
|
+
function L(n, t, r) {
|
|
261
270
|
return n[t]?.[r] ?? "";
|
|
262
271
|
}
|
|
263
|
-
function
|
|
272
|
+
function G(n, t, r, e) {
|
|
264
273
|
return { ...n, [t]: { ...n[t], [r]: e } };
|
|
265
274
|
}
|
|
266
|
-
function
|
|
275
|
+
function X(n, t) {
|
|
267
276
|
return { ...n, [t]: {} };
|
|
268
277
|
}
|
|
269
|
-
function
|
|
278
|
+
function J(n, t, r) {
|
|
270
279
|
if (r !== "12") return n;
|
|
271
280
|
let e = n;
|
|
272
281
|
for (const s of t)
|
|
273
|
-
|
|
282
|
+
L(e, s, "dayPeriod") || (e = G(e, s, "dayPeriod", "am"));
|
|
274
283
|
return e;
|
|
275
284
|
}
|
|
276
|
-
function
|
|
285
|
+
function Q(n, t) {
|
|
277
286
|
if (isNaN(t)) return { value: t };
|
|
278
287
|
if (!n) return { value: t };
|
|
279
288
|
const r = Math.max(n.min, Math.min(n.max, t));
|
|
@@ -283,7 +292,7 @@ function J(n, t) {
|
|
|
283
292
|
};
|
|
284
293
|
}
|
|
285
294
|
function p(n, t, r, e) {
|
|
286
|
-
const s = parseInt(n[r] ?? "", 10), { value: i, writeBack: a } =
|
|
295
|
+
const s = parseInt(n[r] ?? "", 10), { value: i, writeBack: a } = Q(t[r], s);
|
|
287
296
|
return a !== void 0 && (e[r] = a), i;
|
|
288
297
|
}
|
|
289
298
|
function kt(n, t) {
|
|
@@ -298,7 +307,7 @@ function kt(n, t) {
|
|
|
298
307
|
const c = new Date(e, s - 1, i);
|
|
299
308
|
return { result: { kind: "valid", iso: B(c), instant: c }, writeBacks: r };
|
|
300
309
|
}
|
|
301
|
-
function
|
|
310
|
+
function Et(n, t) {
|
|
302
311
|
const r = t.hourFormat === "12", e = {}, s = p(n, t.descriptors, "hour", e), i = p(n, t.descriptors, "minute", e), a = n.dayPeriod ?? "";
|
|
303
312
|
if (isNaN(s) || isNaN(i)) return { result: { kind: "incomplete" }, writeBacks: e };
|
|
304
313
|
if (r && a !== "am" && a !== "pm")
|
|
@@ -306,22 +315,22 @@ function $t(n, t) {
|
|
|
306
315
|
const o = r ? M(s, a) : s, u = new Date(1970, 0, 1, o, i, 0);
|
|
307
316
|
return { result: { kind: "valid", iso: S(u), instant: u }, writeBacks: e };
|
|
308
317
|
}
|
|
309
|
-
function
|
|
310
|
-
const r = t.hourFormat === "12", e = {}, s = p(n, t.descriptors, "year", e), i = p(n, t.descriptors, "month", e), a = p(n, t.descriptors, "day", e), o = p(n, t.descriptors, "hour", e), u = p(n, t.descriptors, "minute", e), c = n.dayPeriod ?? "",
|
|
311
|
-
if (!(
|
|
318
|
+
function wt(n, t) {
|
|
319
|
+
const r = t.hourFormat === "12", e = {}, s = p(n, t.descriptors, "year", e), i = p(n, t.descriptors, "month", e), a = p(n, t.descriptors, "day", e), o = p(n, t.descriptors, "hour", e), u = p(n, t.descriptors, "minute", e), c = n.dayPeriod ?? "", l = !isNaN(s) && String(s).length === 4, m = !isNaN(i) && i > 0, h = !isNaN(a) && a > 0, g = !isNaN(o), y = !isNaN(u);
|
|
320
|
+
if (!(l && m && h && g && y && (!r || c === "am" || c === "pm")))
|
|
312
321
|
return { result: { kind: "incomplete" }, writeBacks: e };
|
|
313
322
|
if (a > v(i, s))
|
|
314
323
|
return {
|
|
315
324
|
result: { kind: "invalid", message: t.invalidDateMessage ?? x },
|
|
316
325
|
writeBacks: e
|
|
317
326
|
};
|
|
318
|
-
const _ = r ? M(o, c) : o,
|
|
319
|
-
return { result: { kind: "valid", iso:
|
|
327
|
+
const _ = r ? M(o, c) : o, E = new Date(s, i - 1, a, _, u, 0);
|
|
328
|
+
return { result: { kind: "valid", iso: $(E), instant: E }, writeBacks: e };
|
|
320
329
|
}
|
|
321
|
-
function
|
|
330
|
+
function Nt(n, t) {
|
|
322
331
|
return t.minTime && f(n, t.minTime) < 0 ? t.minTimeMessage ?? O : t.maxTime && f(n, t.maxTime) > 0 ? t.maxTimeMessage ?? R : null;
|
|
323
332
|
}
|
|
324
|
-
const
|
|
333
|
+
const Z = [
|
|
325
334
|
"Backspace",
|
|
326
335
|
"Tab",
|
|
327
336
|
"ArrowUp",
|
|
@@ -334,10 +343,10 @@ const Q = [
|
|
|
334
343
|
function F(n) {
|
|
335
344
|
return /^[0-9]$/.test(n);
|
|
336
345
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
346
|
+
function tt(n, t) {
|
|
347
|
+
return Z.includes(n.key) || n.ctrlKey || n.metaKey || t ? !1 : !F(n.key);
|
|
339
348
|
}
|
|
340
|
-
function
|
|
349
|
+
function et(n, t, r) {
|
|
341
350
|
const e = n?.step ?? 1, s = n?.incrementFallback ?? 1, i = r === "up" ? e : -e, a = parseInt(t, 10);
|
|
342
351
|
let o;
|
|
343
352
|
if (isNaN(a))
|
|
@@ -348,14 +357,14 @@ function tt(n, t, r) {
|
|
|
348
357
|
} else n && (o = Math.max(n.min, Math.min(n.max, o)));
|
|
349
358
|
return o.toString().padStart(n?.maxLength ?? 2, "0");
|
|
350
359
|
}
|
|
351
|
-
const
|
|
352
|
-
function
|
|
353
|
-
const s = r || 1, i = `${n ?? ""}|${t ?? ""}|${s}|${e ? "dt" : "t"}`, a =
|
|
360
|
+
const N = /* @__PURE__ */ new Map();
|
|
361
|
+
function bt(n, t, r, e = !1) {
|
|
362
|
+
const s = r || 1, i = `${n ?? ""}|${t ?? ""}|${s}|${e ? "dt" : "t"}`, a = N.get(i);
|
|
354
363
|
if (a) return a;
|
|
355
|
-
const o = K(n, t), u = U(n), c =
|
|
356
|
-
return
|
|
364
|
+
const o = K(n, t), u = U(n), c = j(o, s, u.am), l = e ? { ...z(), ...c } : c, m = { effectiveHourFormat: o, dayPeriodLabels: u, descriptors: l };
|
|
365
|
+
return N.set(i, m), m;
|
|
357
366
|
}
|
|
358
|
-
class
|
|
367
|
+
class vt {
|
|
359
368
|
constructor(t, r) {
|
|
360
369
|
this._values = {}, this._hasSurfacedInputError = !1, this.getPartDisplay = (e, s) => {
|
|
361
370
|
const i = this.getPart(e, s);
|
|
@@ -365,15 +374,15 @@ class bt {
|
|
|
365
374
|
}
|
|
366
375
|
return i;
|
|
367
376
|
}, this.handleKeyDown = (e, s, i) => {
|
|
368
|
-
e.key === "Enter" && this.options.onEnter && (e.preventDefault(), e.target instanceof HTMLInputElement && this.setPart(s, i, e.target.value.replace(/[^0-9]/g, ""))),
|
|
377
|
+
e.key === "Enter" && this.options.onEnter && (e.preventDefault(), e.target instanceof HTMLInputElement && this.setPart(s, i, e.target.value.replace(/[^0-9]/g, ""))), tt(e, this.options.isReadonly()) && e.preventDefault();
|
|
369
378
|
}, this.handleDayPeriodKeyDown = (e) => {
|
|
370
379
|
(e.key === "ArrowUp" || e.key === "ArrowDown") && e.preventDefault(), e.key === "Enter" && e.preventDefault();
|
|
371
380
|
}, this.handleFocus = (e) => {
|
|
372
381
|
this.host.dispatchEvent(new CustomEvent("focus", { detail: e }));
|
|
373
382
|
}, this.handleKeyUp = (e, s, i) => {
|
|
374
383
|
if (this.options.isReadonly()) return;
|
|
375
|
-
const a = window.getComputedStyle(this.host).direction === "rtl", o = e.target, u = o, c = this.getGroupInputs(s),
|
|
376
|
-
switch (o instanceof HTMLInputElement && u.value.length === u.maxLength && F(e.key) && (
|
|
384
|
+
const a = window.getComputedStyle(this.host).direction === "rtl", o = e.target, u = o, c = this.getGroupInputs(s), l = c.indexOf(o), m = this.options.getDescriptor(i);
|
|
385
|
+
switch (o instanceof HTMLInputElement && u.value.length === u.maxLength && F(e.key) && (l === c.length - 1 ? this.autoAdvanceFromGroupEnd(s) : c[l + 1].focus()), e.key) {
|
|
377
386
|
case "Enter": {
|
|
378
387
|
this.options.onEnter?.(e, s);
|
|
379
388
|
break;
|
|
@@ -384,7 +393,7 @@ class bt {
|
|
|
384
393
|
this.toggleDayPeriod(s, i);
|
|
385
394
|
break;
|
|
386
395
|
}
|
|
387
|
-
const h =
|
|
396
|
+
const h = et(
|
|
388
397
|
m,
|
|
389
398
|
u.value,
|
|
390
399
|
e.key === "ArrowUp" ? "up" : "down"
|
|
@@ -424,13 +433,13 @@ class bt {
|
|
|
424
433
|
return this._values;
|
|
425
434
|
}
|
|
426
435
|
getPart(t, r) {
|
|
427
|
-
return
|
|
436
|
+
return L(this._values, t, r);
|
|
428
437
|
}
|
|
429
438
|
setPart(t, r, e) {
|
|
430
|
-
this._values =
|
|
439
|
+
this._values = G(this._values, t, r, e), this.host.requestUpdate();
|
|
431
440
|
}
|
|
432
441
|
clearGroup(t) {
|
|
433
|
-
this._values =
|
|
442
|
+
this._values = X(this._values, t), this.host.requestUpdate();
|
|
434
443
|
}
|
|
435
444
|
/** Writes clamp corrections back into the state. */
|
|
436
445
|
applyWriteBacks(t, r) {
|
|
@@ -448,7 +457,7 @@ class bt {
|
|
|
448
457
|
this.seedWith(t, this.options.getHourFormat?.() ?? "24");
|
|
449
458
|
}
|
|
450
459
|
seedWith(t, r) {
|
|
451
|
-
const e =
|
|
460
|
+
const e = J(this._values, t, r);
|
|
452
461
|
e !== this._values && (this._values = e, this.host.requestUpdate());
|
|
453
462
|
}
|
|
454
463
|
/**
|
|
@@ -477,14 +486,14 @@ class bt {
|
|
|
477
486
|
if (e === "time") {
|
|
478
487
|
let o = P(r);
|
|
479
488
|
if (!o) {
|
|
480
|
-
const u =
|
|
489
|
+
const u = d(r);
|
|
481
490
|
if (isNaN(u.getTime())) return;
|
|
482
491
|
o = { hours: u.getHours(), minutes: u.getMinutes(), seconds: u.getSeconds() };
|
|
483
492
|
}
|
|
484
493
|
this.writeTimeParts(t, o.hours, o.minutes, i);
|
|
485
494
|
return;
|
|
486
495
|
}
|
|
487
|
-
const a =
|
|
496
|
+
const a = d(r);
|
|
488
497
|
isNaN(a.getTime()) || (this.setPart(t, "day", String(a.getDate()).padStart(2, "0")), this.setPart(t, "month", String(a.getMonth() + 1).padStart(2, "0")), this.setPart(t, "year", String(a.getFullYear()).padStart(4, "0")), this.writeTimeParts(t, a.getHours(), a.getMinutes(), i));
|
|
489
498
|
}
|
|
490
499
|
writeTimeParts(t, r, e, s) {
|
|
@@ -567,16 +576,16 @@ class bt {
|
|
|
567
576
|
this._hasSurfacedInputError = !1;
|
|
568
577
|
}
|
|
569
578
|
}
|
|
570
|
-
const
|
|
571
|
-
function
|
|
572
|
-
const e = t.formatParts, s = t.groups.length > 1, i = (
|
|
573
|
-
if (
|
|
574
|
-
return
|
|
575
|
-
const h = t.getDescriptor(
|
|
579
|
+
const nt = (n, t) => D`<span class="${t}__separator">${n.value}</span>`;
|
|
580
|
+
function xt(n, t, r) {
|
|
581
|
+
const e = t.formatParts, s = t.groups.length > 1, i = (l) => s ? `${n}-${l.type}` : l.type, a = (l, m) => {
|
|
582
|
+
if (l.type === "literal")
|
|
583
|
+
return nt(l, t.blockClass);
|
|
584
|
+
const h = t.getDescriptor(l.type);
|
|
576
585
|
if (!h) return "";
|
|
577
586
|
const g = n === t.groups[0] && m === 0 ? 0 : -1;
|
|
578
|
-
return
|
|
579
|
-
}, o = (
|
|
587
|
+
return rt(n, h, g, t, r);
|
|
588
|
+
}, o = (l) => l.type === "hour" || l.type === "minute" || l.type === "second", u = e.findIndex(o);
|
|
580
589
|
if (u === -1)
|
|
581
590
|
return T(e, i, a);
|
|
582
591
|
let c = e.length - 1;
|
|
@@ -584,43 +593,47 @@ function vt(n, t, r) {
|
|
|
584
593
|
return D`
|
|
585
594
|
${T(e.slice(0, u), i, a)}
|
|
586
595
|
<div class="gui-parts__time-cluster ${t.blockClass}__time-cluster" dir="ltr">
|
|
587
|
-
${T(e.slice(u, c + 1), i, (
|
|
596
|
+
${T(e.slice(u, c + 1), i, (l, m) => a(l, u + m))}
|
|
588
597
|
</div>
|
|
589
|
-
${T(e.slice(c + 1), i, (
|
|
598
|
+
${T(e.slice(c + 1), i, (l, m) => a(l, c + 1 + m))}
|
|
590
599
|
`;
|
|
591
600
|
}
|
|
592
|
-
function
|
|
601
|
+
function rt(n, t, r, e, s) {
|
|
593
602
|
const i = e.blockClass, a = t.type;
|
|
594
603
|
if (t.kind === "dayPeriod")
|
|
595
|
-
return
|
|
596
|
-
const o = a === "year" ? `gui-parts__year ${i}__year` : "";
|
|
604
|
+
return st(n, t, r, e, s);
|
|
605
|
+
const o = a === "year" ? `gui-parts__year ${i}__year` : "", u = e.getDisplayValue(n, a), c = parseInt(u, 10);
|
|
597
606
|
return D`
|
|
598
607
|
<div class="gui-parts__touch-target ${i}__touch-target">
|
|
599
608
|
<input
|
|
600
609
|
type="text"
|
|
601
610
|
inputmode="numeric"
|
|
611
|
+
role="spinbutton"
|
|
602
612
|
class="gui-parts__part ${i}__part ${o}"
|
|
603
613
|
data-type=${a}
|
|
604
|
-
data-group=${e.groups.length > 1 ? n :
|
|
614
|
+
data-group=${e.groups.length > 1 ? n : I}
|
|
605
615
|
maxlength=${t.maxLength}
|
|
606
616
|
placeholder=${t.placeholder}
|
|
607
617
|
tabindex=${r}
|
|
608
|
-
|
|
618
|
+
aria-label=${e.getPartAriaLabel?.(n, a) ?? W[a]}
|
|
619
|
+
aria-valuemin=${t.min}
|
|
620
|
+
aria-valuemax=${t.max}
|
|
621
|
+
aria-valuenow=${isNaN(c) ? I : c}
|
|
609
622
|
?disabled=${e.disabled}
|
|
610
623
|
?readonly=${e.partsReadonly}
|
|
611
624
|
autocomplete="off"
|
|
612
625
|
.value=${H(e.getDisplayValue(n, a))}
|
|
613
|
-
@keydown=${(
|
|
614
|
-
@keyup=${(
|
|
626
|
+
@keydown=${(l) => s.handleKeyDown(l, n, a)}
|
|
627
|
+
@keyup=${(l) => s.handleKeyUp(l, n, a)}
|
|
615
628
|
@focus=${s.handleFocus}
|
|
616
|
-
@blur=${(
|
|
617
|
-
@change=${(
|
|
629
|
+
@blur=${(l) => s.handleBlur(l, n, a)}
|
|
630
|
+
@change=${(l) => s.handleChange(l, n, a)}
|
|
618
631
|
/>
|
|
619
632
|
<div class="gui-parts__visual-underline ${i}__visual-underline"></div>
|
|
620
633
|
</div>
|
|
621
634
|
`;
|
|
622
635
|
}
|
|
623
|
-
function
|
|
636
|
+
function st(n, t, r, e, s) {
|
|
624
637
|
const i = e.blockClass, a = t.type;
|
|
625
638
|
return D`
|
|
626
639
|
<div class="gui-parts__touch-target ${i}__touch-target">
|
|
@@ -628,7 +641,7 @@ function rt(n, t, r, e, s) {
|
|
|
628
641
|
type="button"
|
|
629
642
|
class="gui-parts__part gui-parts__dayperiod ${i}__part ${i}__dayperiod"
|
|
630
643
|
data-type=${a}
|
|
631
|
-
data-group=${e.groups.length > 1 ? n :
|
|
644
|
+
data-group=${e.groups.length > 1 ? n : I}
|
|
632
645
|
tabindex=${r}
|
|
633
646
|
?disabled=${e.disabled}
|
|
634
647
|
aria-label=${e.dayPeriodAriaLabel ?? "AM/PM"}
|
|
@@ -645,33 +658,34 @@ function rt(n, t, r, e, s) {
|
|
|
645
658
|
`;
|
|
646
659
|
}
|
|
647
660
|
export {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
661
|
+
Pt as A,
|
|
662
|
+
vt as G,
|
|
663
|
+
dt as N,
|
|
664
|
+
W as P,
|
|
665
|
+
lt as a,
|
|
666
|
+
wt as b,
|
|
667
|
+
St as c,
|
|
668
|
+
$t as d,
|
|
655
669
|
K as e,
|
|
656
|
-
|
|
657
|
-
|
|
670
|
+
It as f,
|
|
671
|
+
bt as g,
|
|
658
672
|
q as h,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
673
|
+
Tt as i,
|
|
674
|
+
Dt as j,
|
|
675
|
+
mt as k,
|
|
676
|
+
_t as l,
|
|
677
|
+
yt as m,
|
|
678
|
+
z as n,
|
|
679
|
+
gt as o,
|
|
680
|
+
d as p,
|
|
667
681
|
kt as q,
|
|
668
|
-
|
|
682
|
+
xt as r,
|
|
669
683
|
f as s,
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
684
|
+
ft as t,
|
|
685
|
+
ct as u,
|
|
686
|
+
Et as v,
|
|
687
|
+
Nt as w,
|
|
688
|
+
pt as x,
|
|
689
|
+
ht as y,
|
|
676
690
|
S as z
|
|
677
691
|
};
|
|
@@ -2,12 +2,12 @@ import { InputWidgetAdapter as m, formContext as y, inputContext as P } from "@g
|
|
|
2
2
|
import { LitElement as w, nothing as n, html as u } from "lit";
|
|
3
3
|
import { property as o, state as g, customElement as b } from "lit/decorators.js";
|
|
4
4
|
import { classMap as v } from "lit/directives/class-map.js";
|
|
5
|
-
import { G as $, a as f, b as I, c as C } from "./templates-
|
|
5
|
+
import { G as $, a as f, b as I, c as C } from "./templates-Dmr34nwp.js";
|
|
6
6
|
import { consume as D, provide as L } from "@lit/context";
|
|
7
7
|
import "rxjs";
|
|
8
8
|
var S = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, s = (t, a, i, d) => {
|
|
9
|
-
for (var r = d > 1 ? void 0 : d ? _(a, i) : a, l = t.length - 1,
|
|
10
|
-
(
|
|
9
|
+
for (var r = d > 1 ? void 0 : d ? _(a, i) : a, l = t.length - 1, h; l >= 0; l--)
|
|
10
|
+
(h = t[l]) && (r = (d ? h(a, i, r) : h(r)) || r);
|
|
11
11
|
return d && r && S(a, i, r), r;
|
|
12
12
|
};
|
|
13
13
|
let e = class extends w {
|
|
@@ -21,7 +21,8 @@ let e = class extends w {
|
|
|
21
21
|
errors: this.errors,
|
|
22
22
|
readonly: this.readOnly,
|
|
23
23
|
disabled: this.disabled,
|
|
24
|
-
touched: this.touched
|
|
24
|
+
touched: this.touched,
|
|
25
|
+
required: this.required
|
|
25
26
|
}
|
|
26
27
|
})
|
|
27
28
|
});
|
|
@@ -65,7 +66,7 @@ let e = class extends w {
|
|
|
65
66
|
data-cy=${`${this.uid}_password`}
|
|
66
67
|
class=${v(i)}
|
|
67
68
|
value=${this.value}
|
|
68
|
-
?required=${this.
|
|
69
|
+
?required=${this.required}
|
|
69
70
|
?disabled=${this.disabled}
|
|
70
71
|
?readonly=${this.readOnly}
|
|
71
72
|
placeholder=${this.placeholder || n}
|
|
@@ -78,10 +79,11 @@ let e = class extends w {
|
|
|
78
79
|
class=${`gui-password__toggle gui-widget-icon ${this.showPassword && t.showPasswordIcon ? t.showPasswordIcon : ""} ${!this.showPassword && t.hidePasswordIcon ? t.hidePasswordIcon : ""}`}
|
|
79
80
|
data-icon=${this.showPassword ? t.showPasswordIcon : t.hidePasswordIcon}
|
|
80
81
|
type="button"
|
|
81
|
-
|
|
82
|
+
?disabled=${this.disabled}
|
|
83
|
+
aria-label=${this.showPassword ? t.hidePasswordLabel ?? "Hide password" : t.showPasswordLabel ?? "Show password"}
|
|
82
84
|
@click=${() => this.showPassword = !this.showPassword}
|
|
83
85
|
>
|
|
84
|
-
${t.showPasswordIcon || t.hidePasswordIcon ? n : u`<span
|
|
86
|
+
${t.showPasswordIcon || t.hidePasswordIcon ? n : u`<span aria-hidden="true"
|
|
85
87
|
>${this.showPassword ? t.hidePasswordLabel ?? "Hide" : t.showPasswordLabel ?? "Show"}</span
|
|
86
88
|
>`}
|
|
87
89
|
</button>
|
|
@@ -169,12 +171,12 @@ e = s([
|
|
|
169
171
|
b("gui-password")
|
|
170
172
|
], e);
|
|
171
173
|
typeof customElements < "u" && !customElements.get("gui-password") && customElements.define("gui-password", e);
|
|
172
|
-
var
|
|
173
|
-
for (var r = d > 1 ? void 0 : d ?
|
|
174
|
-
(
|
|
175
|
-
return d && r &&
|
|
174
|
+
var O = Object.defineProperty, x = Object.getOwnPropertyDescriptor, c = (t, a, i, d) => {
|
|
175
|
+
for (var r = d > 1 ? void 0 : d ? x(a, i) : a, l = t.length - 1, h; l >= 0; l--)
|
|
176
|
+
(h = t[l]) && (r = (d ? h(a, i, r) : h(r)) || r);
|
|
177
|
+
return d && r && O(a, i, r), r;
|
|
176
178
|
};
|
|
177
|
-
let
|
|
179
|
+
let p = class extends w {
|
|
178
180
|
constructor() {
|
|
179
181
|
super(...arguments), this.adapter = new m(), this.subscriptions = [];
|
|
180
182
|
}
|
|
@@ -226,13 +228,13 @@ let h = class extends w {
|
|
|
226
228
|
c([
|
|
227
229
|
D({ context: y }),
|
|
228
230
|
o({ attribute: !1 })
|
|
229
|
-
],
|
|
231
|
+
], p.prototype, "formContext", 2);
|
|
230
232
|
c([
|
|
231
233
|
L({ context: P })
|
|
232
|
-
],
|
|
233
|
-
|
|
234
|
+
], p.prototype, "adapter", 2);
|
|
235
|
+
p = c([
|
|
234
236
|
b("gui-password-input")
|
|
235
|
-
],
|
|
237
|
+
], p);
|
|
236
238
|
export {
|
|
237
|
-
|
|
239
|
+
p as PasswordElement
|
|
238
240
|
};
|