use-wc 1.0.0-pre.26 → 1.0.0-pre.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/use-wc.js +706 -710
- package/dist/use-wc.umd.cjs +88 -95
- package/package.json +1 -1
package/dist/use-wc.js
CHANGED
|
@@ -2,38 +2,38 @@ var ia = (t) => {
|
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
4
|
var Xi = (t, e, i) => e.has(t) || ia("Cannot " + i);
|
|
5
|
-
var b = (t, e, i) => (Xi(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
6
|
-
import { css as pt, LitElement as I, html as
|
|
7
|
-
import { property as h, customElement as
|
|
8
|
-
import { getTabIndex as
|
|
5
|
+
var b = (t, e, i) => (Xi(t, e, "read from private field"), i ? i.call(t) : e.get(t)), st = (t, e, i) => e.has(t) ? ia("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, s) => (Xi(t, e, "write to private field"), s ? s.call(t, i) : e.set(t, i), i), B = (t, e, i) => (Xi(t, e, "access private method"), i);
|
|
6
|
+
import { css as pt, LitElement as I, html as y } from "lit";
|
|
7
|
+
import { property as h, customElement as it, query as k, queryAssignedElements as na } from "lit/decorators.js";
|
|
8
|
+
import { getTabIndex as di, tabbable as as, isTabbable as nn } from "tabbable";
|
|
9
9
|
import * as ws from "duration-fns";
|
|
10
|
-
import { map as
|
|
11
|
-
import { keyed as
|
|
10
|
+
import { map as on } from "lit/directives/map.js";
|
|
11
|
+
import { keyed as ln } from "lit/directives/keyed.js";
|
|
12
12
|
function xt() {
|
|
13
13
|
return ":" + Math.random().toString(36).substring(2, 6) + ":";
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var hn = Object.defineProperty, dn = Object.getOwnPropertyDescriptor, oa = (t) => {
|
|
16
16
|
throw TypeError(t);
|
|
17
17
|
}, zi = (t, e, i, s) => {
|
|
18
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
18
|
+
for (var a = s > 1 ? void 0 : s ? dn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
19
19
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
20
|
-
return s && a &&
|
|
21
|
-
}, la = (t, e, i) => e.has(t) || oa("Cannot " + i), It = (t, e, i) => (la(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
22
|
-
let
|
|
20
|
+
return s && a && hn(e, i, a), a;
|
|
21
|
+
}, la = (t, e, i) => e.has(t) || oa("Cannot " + i), It = (t, e, i) => (la(t, e, "read from private field"), i ? i.call(t) : e.get(t)), un = (t, e, i) => e.has(t) ? oa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), cn = (t, e, i, s) => (la(t, e, "write to private field"), e.set(t, i), i), at;
|
|
22
|
+
let Pe = class extends I {
|
|
23
23
|
constructor() {
|
|
24
|
-
super(),
|
|
24
|
+
super(), un(this, at), cn(this, at, this.attachInternals()), this.id || (this.id = xt()), this.hasAttribute("selected") && It(this, at).states.add("selected"), this.hasAttribute("disabled") && It(this, at).states.add("disabled");
|
|
25
25
|
}
|
|
26
26
|
set selected(t) {
|
|
27
|
-
t ? It(this,
|
|
27
|
+
t ? It(this, at).states.add("selected") : It(this, at).states.delete("selected");
|
|
28
28
|
}
|
|
29
29
|
get selected() {
|
|
30
|
-
return It(this,
|
|
30
|
+
return It(this, at).states.has("selected");
|
|
31
31
|
}
|
|
32
32
|
set disabled(t) {
|
|
33
|
-
t ? It(this,
|
|
33
|
+
t ? It(this, at).states.add("disabled") : It(this, at).states.delete("disabled");
|
|
34
34
|
}
|
|
35
35
|
get disabled() {
|
|
36
|
-
return It(this,
|
|
36
|
+
return It(this, at).states.has("disabled");
|
|
37
37
|
}
|
|
38
38
|
set value(t) {
|
|
39
39
|
t != null && this.setAttribute("value", t);
|
|
@@ -45,10 +45,10 @@ let Oe = class extends I {
|
|
|
45
45
|
this.selected = !this.selected;
|
|
46
46
|
}
|
|
47
47
|
setActive(t) {
|
|
48
|
-
t ? It(this,
|
|
48
|
+
t ? It(this, at).states.add("active") : It(this, at).states.delete("active");
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
return
|
|
51
|
+
return y`
|
|
52
52
|
<slot part="selected-indicator" name="selected-indicator">
|
|
53
53
|
<span part="selected-indicator-default">✔</span>
|
|
54
54
|
</slot>
|
|
@@ -56,8 +56,8 @@ let Oe = class extends I {
|
|
|
56
56
|
`;
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
at = /* @__PURE__ */ new WeakMap();
|
|
60
|
+
Pe.styles = pt`
|
|
61
61
|
:host {
|
|
62
62
|
display: flex;
|
|
63
63
|
align-items: center;
|
|
@@ -79,16 +79,16 @@ Oe.styles = pt`
|
|
|
79
79
|
`;
|
|
80
80
|
zi([
|
|
81
81
|
h({ type: Boolean })
|
|
82
|
-
],
|
|
82
|
+
], Pe.prototype, "selected", 1);
|
|
83
83
|
zi([
|
|
84
84
|
h({ type: Boolean })
|
|
85
|
-
],
|
|
85
|
+
], Pe.prototype, "disabled", 1);
|
|
86
86
|
zi([
|
|
87
87
|
h()
|
|
88
|
-
],
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
],
|
|
88
|
+
], Pe.prototype, "value", 1);
|
|
89
|
+
Pe = zi([
|
|
90
|
+
it("use-option")
|
|
91
|
+
], Pe);
|
|
92
92
|
const $s = {
|
|
93
93
|
am: "AM",
|
|
94
94
|
pm: "PM",
|
|
@@ -104,7 +104,7 @@ const $s = {
|
|
|
104
104
|
function Ds(t, { plural: e = !0 } = {}) {
|
|
105
105
|
const i = `${t}-${e ? "plural" : "singular"}`;
|
|
106
106
|
if (!Zi.has(i)) {
|
|
107
|
-
const a = new Intl.DisplayNames(t, { type: "dateTimeField" }).of("dayPeriod") ?? "AM/PM", [r = "AM", n = "PM"] = a?.split("/") ?? [],
|
|
107
|
+
const a = new Intl.DisplayNames(t, { type: "dateTimeField" }).of("dayPeriod") ?? "AM/PM", [r = "AM", n = "PM"] = a?.split("/") ?? [], p = new Intl.DurationFormat(t, { style: "long" }).formatToParts({
|
|
108
108
|
years: e ? 2 : 1,
|
|
109
109
|
months: e ? 2 : 1,
|
|
110
110
|
weeks: e ? 2 : 1,
|
|
@@ -113,8 +113,8 @@ function Ds(t, { plural: e = !0 } = {}) {
|
|
|
113
113
|
minutes: e ? 2 : 1,
|
|
114
114
|
seconds: e ? 2 : 1,
|
|
115
115
|
milliseconds: e ? 2 : 1
|
|
116
|
-
}).filter((c) => c.type === "unit" && c.unit),
|
|
117
|
-
Zi.set(i, { am: r, pm: n, hour:
|
|
116
|
+
}).filter((c) => c.type === "unit" && c.unit), N = p.find((c) => c.unit === "year")?.value ?? "year", F = p.find((c) => c.unit === "month")?.value ?? "month", Y = p.find((c) => c.unit === "day")?.value ?? "day", lt = p.find((c) => c.unit === "hour")?.value ?? "hour", Ct = p.find((c) => c.unit === "minute")?.value ?? "minute", Hi = p.find((c) => c.unit === "second")?.value ?? "second", Gi = p.find((c) => c.unit === "millisecond")?.value ?? "millisecond";
|
|
117
|
+
Zi.set(i, { am: r, pm: n, hour: lt, minute: Ct, second: Hi, millisecond: Gi, dayPeriod: a, year: N, month: F, day: Y });
|
|
118
118
|
}
|
|
119
119
|
return Zi.get(i);
|
|
120
120
|
}
|
|
@@ -122,7 +122,7 @@ function As(t = "en") {
|
|
|
122
122
|
return new Intl.Locale(t).getWeekInfo().firstDay % 7;
|
|
123
123
|
}
|
|
124
124
|
const Qi = /* @__PURE__ */ new Map();
|
|
125
|
-
function
|
|
125
|
+
function pn(t = "en", e = "long") {
|
|
126
126
|
const i = `${t}-${e}`;
|
|
127
127
|
if (!Qi.has(i)) {
|
|
128
128
|
const s = new Intl.DateTimeFormat(t, { weekday: e }), a = [7, 8, 9, 10, 11, 12, 13].map((n) => s.format(new Date(2024, 0, n))), r = As(t);
|
|
@@ -131,7 +131,7 @@ function cn(t = "en", e = "long") {
|
|
|
131
131
|
return Qi.get(i);
|
|
132
132
|
}
|
|
133
133
|
const Ji = /* @__PURE__ */ new Map();
|
|
134
|
-
function
|
|
134
|
+
function fn(t = "en", e = "long") {
|
|
135
135
|
const i = `${t}-${e}`;
|
|
136
136
|
if (!Ji.has(i)) {
|
|
137
137
|
const s = new Intl.DateTimeFormat(t, { month: e });
|
|
@@ -142,89 +142,89 @@ function pn(t = "en", e = "long") {
|
|
|
142
142
|
}
|
|
143
143
|
return Ji.get(i);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function gn(t) {
|
|
146
146
|
const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()));
|
|
147
147
|
e.setUTCDate(e.getUTCDate() + 4 - (e.getUTCDay() || 7));
|
|
148
148
|
const i = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
|
|
149
149
|
return Math.ceil(((e.getTime() - i.getTime()) / 864e5 + 1) / 7);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function yn(t) {
|
|
152
152
|
const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()));
|
|
153
153
|
return e.setUTCDate(e.getUTCDate() + 4 - (e.getUTCDay() || 7)), e.getUTCFullYear();
|
|
154
154
|
}
|
|
155
155
|
function ha(t) {
|
|
156
|
-
const e =
|
|
156
|
+
const e = yn(t), i = gn(t);
|
|
157
157
|
return `${e}-W${String(i).padStart(2, "0")}`;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const [e, i] = t.split("-W"), s = Number(e), a = Number(i), n = new Date(s, 0, 4).getDay() || 7,
|
|
161
|
-
return
|
|
159
|
+
function mn(t) {
|
|
160
|
+
const [e, i] = t.split("-W"), s = Number(e), a = Number(i), n = new Date(s, 0, 4).getDay() || 7, p = new Date(s, 0, 4 - (n - 1)), N = new Date(p);
|
|
161
|
+
return N.setDate(p.getDate() + (a - 1) * 7), N;
|
|
162
162
|
}
|
|
163
|
-
var
|
|
163
|
+
var bn = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, da = (t) => {
|
|
164
164
|
throw TypeError(t);
|
|
165
|
-
},
|
|
166
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
165
|
+
}, re = (t, e, i, s) => {
|
|
166
|
+
for (var a = s > 1 ? void 0 : s ? vn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
167
167
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
168
|
-
return s && a &&
|
|
169
|
-
}, ks = (t, e, i) => e.has(t) || da("Cannot " + i),
|
|
168
|
+
return s && a && bn(e, i, a), a;
|
|
169
|
+
}, ks = (t, e, i) => e.has(t) || da("Cannot " + i), M = (t, e, i) => (ks(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Kt = (t, e, i) => e.has(t) ? da("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Tt = (t, e, i, s) => (ks(t, e, "write to private field"), e.set(t, i), i), Wt = (t, e, i) => (ks(t, e, "access private method"), i), mt, pi, Ae, fi, gi, vt, rs, ua, ca, Dt, pa, xs, fa, ga, je;
|
|
170
170
|
let ct = class extends I {
|
|
171
171
|
constructor() {
|
|
172
|
-
super(),
|
|
172
|
+
super(), Kt(this, vt), Kt(this, mt), Kt(this, pi), Kt(this, Ae), Kt(this, fi, $s), Kt(this, gi, []), Kt(this, Dt, { year: "", month: "", day: "" }), Kt(this, je, ""), this.locale = navigator.language || "en-US", Tt(this, mt, this.attachInternals()), Tt(this, pi, this.closest("form")?.id), Tt(this, Ae, this.hasAttribute("id") ? this.getAttribute("id") : xt()), Wt(this, vt, rs).call(this, this.getAttribute("value") ?? ""), this.hasAttribute("disabled") && M(this, mt).states.add("disabled");
|
|
173
173
|
}
|
|
174
174
|
connectedCallback() {
|
|
175
|
-
super.connectedCallback(), Tt(this,
|
|
175
|
+
super.connectedCallback(), Tt(this, fi, Wt(this, vt, ca).call(this)), Tt(this, gi, Wt(this, vt, ua).call(this));
|
|
176
176
|
}
|
|
177
177
|
get id() {
|
|
178
|
-
return
|
|
178
|
+
return M(this, Ae);
|
|
179
179
|
}
|
|
180
180
|
set id(t) {
|
|
181
|
-
const e =
|
|
181
|
+
const e = M(this, Ae);
|
|
182
182
|
Tt(this, Ae, t), this.requestUpdate("id", e);
|
|
183
183
|
}
|
|
184
184
|
set disabled(t) {
|
|
185
|
-
t ?
|
|
185
|
+
t ? M(this, mt).states.add("disabled") : M(this, mt).states.delete("disabled");
|
|
186
186
|
}
|
|
187
187
|
get disabled() {
|
|
188
|
-
return
|
|
188
|
+
return M(this, mt).states.has("disabled");
|
|
189
189
|
}
|
|
190
190
|
set readOnly(t) {
|
|
191
|
-
t ?
|
|
191
|
+
t ? M(this, mt).states.add("readonly") : M(this, mt).states.delete("readonly");
|
|
192
192
|
}
|
|
193
193
|
get readOnly() {
|
|
194
|
-
return
|
|
194
|
+
return M(this, mt).states.has("readonly");
|
|
195
195
|
}
|
|
196
196
|
get value() {
|
|
197
|
-
return
|
|
197
|
+
return M(this, je);
|
|
198
198
|
}
|
|
199
199
|
set value(t) {
|
|
200
200
|
Wt(this, vt, rs).call(this, t), Wt(this, vt, pa).call(this);
|
|
201
201
|
}
|
|
202
202
|
render() {
|
|
203
|
-
return
|
|
204
|
-
${
|
|
203
|
+
return y`
|
|
204
|
+
${M(this, gi).map((t) => ["year", "month", "day"].includes(t.type) ? y`
|
|
205
205
|
<input
|
|
206
206
|
type="number"
|
|
207
|
-
.value=${
|
|
207
|
+
.value=${M(this, Dt)[t.type]}
|
|
208
208
|
?disabled=${this.disabled}
|
|
209
209
|
?readonly=${this.readOnly}
|
|
210
|
-
aria-label=${
|
|
210
|
+
aria-label=${M(this, fi)[t.type]}
|
|
211
211
|
min=${t.type === "year" ? "0" : "1"}
|
|
212
212
|
max=${t.type === "month" ? "12" : t.type === "day" ? "31" : void 0}
|
|
213
213
|
part="segment-input segment-input-${t.type}"
|
|
214
214
|
id="${Wt(this, vt, ga).call(this, t.type)}"
|
|
215
|
-
form=${
|
|
215
|
+
form=${M(this, pi)}
|
|
216
216
|
size=${t.type === "year" ? 4 : 2}
|
|
217
217
|
@input=${Wt(this, vt, fa).call(this, t.type)}
|
|
218
218
|
/>
|
|
219
|
-
` : t.type === "literal" ?
|
|
219
|
+
` : t.type === "literal" ? y`<span part="segment-literal segment-literal-date" aria-hidden="true">${t.value}</span>` : null)}
|
|
220
220
|
`;
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
mt = /* @__PURE__ */ new WeakMap();
|
|
224
|
-
ci = /* @__PURE__ */ new WeakMap();
|
|
225
|
-
Ae = /* @__PURE__ */ new WeakMap();
|
|
226
224
|
pi = /* @__PURE__ */ new WeakMap();
|
|
225
|
+
Ae = /* @__PURE__ */ new WeakMap();
|
|
227
226
|
fi = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
gi = /* @__PURE__ */ new WeakMap();
|
|
228
228
|
vt = /* @__PURE__ */ new WeakSet();
|
|
229
229
|
rs = function(t) {
|
|
230
230
|
try {
|
|
@@ -261,22 +261,22 @@ ca = function() {
|
|
|
261
261
|
};
|
|
262
262
|
Dt = /* @__PURE__ */ new WeakMap();
|
|
263
263
|
pa = function() {
|
|
264
|
-
this.yearInput && (this.yearInput.value =
|
|
264
|
+
this.yearInput && (this.yearInput.value = M(this, Dt).year), this.monthInput && (this.monthInput.value = M(this, Dt).month), this.dayInput && (this.dayInput.value = M(this, Dt).day);
|
|
265
265
|
};
|
|
266
266
|
xs = function() {
|
|
267
|
-
const { year: t, month: e, day: i } =
|
|
268
|
-
Tt(this,
|
|
267
|
+
const { year: t, month: e, day: i } = M(this, Dt);
|
|
268
|
+
Tt(this, je, [t.padStart(4, "0"), e.padStart(2, "0"), i.padStart(2, "0")].join("-")), M(this, mt).setFormValue(M(this, je));
|
|
269
269
|
};
|
|
270
270
|
fa = function(t) {
|
|
271
271
|
return (e) => {
|
|
272
272
|
const i = e.target;
|
|
273
|
-
|
|
273
|
+
M(this, Dt)[t] = i.value, i.value = i.value, Wt(this, vt, xs).call(this);
|
|
274
274
|
};
|
|
275
275
|
};
|
|
276
276
|
ga = function(t) {
|
|
277
277
|
return `${this.id}-segment-${t}`;
|
|
278
278
|
};
|
|
279
|
-
|
|
279
|
+
je = /* @__PURE__ */ new WeakMap();
|
|
280
280
|
ct.formAssociated = !0;
|
|
281
281
|
ct.shadowRootOptions = {
|
|
282
282
|
...I.shadowRootOptions,
|
|
@@ -304,38 +304,38 @@ ct.styles = pt`
|
|
|
304
304
|
margin: 0;
|
|
305
305
|
}
|
|
306
306
|
`;
|
|
307
|
-
|
|
307
|
+
re([
|
|
308
308
|
k('input[part="segment-input segment-input-year"]')
|
|
309
309
|
], ct.prototype, "yearInput", 2);
|
|
310
|
-
|
|
310
|
+
re([
|
|
311
311
|
k('input[part="segment-input segment-input-month"]')
|
|
312
312
|
], ct.prototype, "monthInput", 2);
|
|
313
|
-
|
|
313
|
+
re([
|
|
314
314
|
k('input[part="segment-input segment-input-day"]')
|
|
315
315
|
], ct.prototype, "dayInput", 2);
|
|
316
|
-
|
|
316
|
+
re([
|
|
317
317
|
h({ type: Boolean })
|
|
318
318
|
], ct.prototype, "disabled", 1);
|
|
319
|
-
|
|
319
|
+
re([
|
|
320
320
|
h({ type: Boolean, attribute: "readonly" })
|
|
321
321
|
], ct.prototype, "readOnly", 1);
|
|
322
|
-
|
|
322
|
+
re([
|
|
323
323
|
h({ type: String })
|
|
324
324
|
], ct.prototype, "value", 1);
|
|
325
|
-
|
|
325
|
+
re([
|
|
326
326
|
h({ type: String, attribute: !0 })
|
|
327
327
|
], ct.prototype, "locale", 2);
|
|
328
|
-
ct =
|
|
329
|
-
|
|
328
|
+
ct = re([
|
|
329
|
+
it("use-date")
|
|
330
330
|
], ct);
|
|
331
|
-
var
|
|
331
|
+
var _n = Object.defineProperty, wn = Object.getOwnPropertyDescriptor, ya = (t) => {
|
|
332
332
|
throw TypeError(t);
|
|
333
333
|
}, Ss = (t, e, i, s) => {
|
|
334
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
334
|
+
for (var a = s > 1 ? void 0 : s ? wn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
335
335
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
336
|
-
return s && a &&
|
|
337
|
-
}, Is = (t, e, i) => e.has(t) || ya("Cannot " + i), x = (t, e, i) => (Is(t, e, "read from private field"), i ? i.call(t) : e.get(t)), _e = (t, e, i) => e.has(t) ? ya("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Oi = (t, e, i, s) => (Is(t, e, "write to private field"), e.set(t, i), i),
|
|
338
|
-
const
|
|
336
|
+
return s && a && _n(e, i, a), a;
|
|
337
|
+
}, Is = (t, e, i) => e.has(t) || ya("Cannot " + i), x = (t, e, i) => (Is(t, e, "read from private field"), i ? i.call(t) : e.get(t)), _e = (t, e, i) => e.has(t) ? ya("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Oi = (t, e, i, s) => (Is(t, e, "write to private field"), e.set(t, i), i), nt = (t, e, i) => (Is(t, e, "access private method"), i), Ce, yi, Nt, ti, Te, T, ns, mi, ma, ba, Es, va, Ms, _a, wa, os, $a, Da, Aa;
|
|
338
|
+
const $n = "data-usewc-dropdown-tabindex", Dn = `
|
|
339
339
|
:is(
|
|
340
340
|
[role="menuitem"],
|
|
341
341
|
[role="menuitemcheckbox"],
|
|
@@ -348,96 +348,96 @@ const wn = "data-usewc-dropdown-tabindex", $n = `
|
|
|
348
348
|
[aria-hidden="true"]
|
|
349
349
|
))
|
|
350
350
|
`;
|
|
351
|
-
let
|
|
351
|
+
let me = class extends I {
|
|
352
352
|
constructor() {
|
|
353
|
-
super(), _e(this,
|
|
353
|
+
super(), _e(this, T), _e(this, Ce, []), _e(this, yi), _e(this, Nt), _e(this, ti, []), _e(this, Te, this.parentElement?.closest("use-dropdown") != null), this.trigger = null, Oi(this, yi, xt()), Oi(this, Nt, this.attachInternals()), nt(this, T, Es).call(this), this.hasAttribute("disabled") && x(this, Nt).states.add("disabled");
|
|
354
354
|
}
|
|
355
355
|
set disabled(t) {
|
|
356
|
-
|
|
356
|
+
nt(this, T, _a).call(this, t);
|
|
357
357
|
}
|
|
358
358
|
get disabled() {
|
|
359
|
-
return x(this,
|
|
359
|
+
return x(this, Nt).states.has("disabled");
|
|
360
360
|
}
|
|
361
361
|
getId() {
|
|
362
|
-
return this.id ? this.id : x(this,
|
|
362
|
+
return this.id ? this.id : x(this, yi);
|
|
363
363
|
}
|
|
364
364
|
firstUpdated() {
|
|
365
365
|
this.trigger = this.shadowRoot?.querySelector('button[part="trigger"]') ?? null;
|
|
366
366
|
}
|
|
367
367
|
render() {
|
|
368
|
-
return
|
|
368
|
+
return y`
|
|
369
369
|
<button
|
|
370
370
|
part="trigger"
|
|
371
371
|
type="button"
|
|
372
|
-
id=${x(this,
|
|
373
|
-
popovertarget=${x(this,
|
|
372
|
+
id=${x(this, T, ns)}
|
|
373
|
+
popovertarget=${x(this, T, mi)}
|
|
374
374
|
popovertargetaction="toggle"
|
|
375
|
-
aria-controls=${x(this,
|
|
375
|
+
aria-controls=${x(this, T, mi)}
|
|
376
376
|
aria-haspopup="menu"
|
|
377
377
|
aria-expanded="false"
|
|
378
378
|
?disabled=${this.disabled}
|
|
379
|
-
@keydown=${
|
|
379
|
+
@keydown=${nt(this, T, os)}
|
|
380
380
|
>
|
|
381
381
|
<slot name="trigger-content">
|
|
382
382
|
<slot part="trigger-label" name="trigger-label">${this.label}</slot>
|
|
383
|
-
<slot part="trigger-icon" name="trigger-icon">${x(this,
|
|
383
|
+
<slot part="trigger-icon" name="trigger-icon">${x(this, T, Aa)}</slot>
|
|
384
384
|
</slot>
|
|
385
385
|
</button>
|
|
386
386
|
<div
|
|
387
|
-
id=${x(this,
|
|
387
|
+
id=${x(this, T, mi)}
|
|
388
388
|
role="menu"
|
|
389
389
|
part="menu"
|
|
390
390
|
popover
|
|
391
|
-
aria-labelledby=${x(this,
|
|
392
|
-
@click=${
|
|
393
|
-
@toggle=${
|
|
394
|
-
@keydown=${
|
|
391
|
+
aria-labelledby=${x(this, T, ns)}
|
|
392
|
+
@click=${nt(this, T, va)}
|
|
393
|
+
@toggle=${nt(this, T, $a)}
|
|
394
|
+
@keydown=${nt(this, T, os)}
|
|
395
395
|
>
|
|
396
|
-
<slot @slotchange=${
|
|
396
|
+
<slot @slotchange=${nt(this, T, Da)}></slot>
|
|
397
397
|
</div>
|
|
398
398
|
`;
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
Ce = /* @__PURE__ */ new WeakMap();
|
|
402
|
+
yi = /* @__PURE__ */ new WeakMap();
|
|
403
|
+
Nt = /* @__PURE__ */ new WeakMap();
|
|
404
|
+
ti = /* @__PURE__ */ new WeakMap();
|
|
405
405
|
Te = /* @__PURE__ */ new WeakMap();
|
|
406
|
-
|
|
406
|
+
T = /* @__PURE__ */ new WeakSet();
|
|
407
407
|
ns = function() {
|
|
408
408
|
return `${this.getId()}-trigger`;
|
|
409
409
|
};
|
|
410
|
-
|
|
410
|
+
mi = function() {
|
|
411
411
|
return `${this.getId()}-dropdown`;
|
|
412
412
|
};
|
|
413
413
|
ma = function() {
|
|
414
|
-
return Array.from(this.querySelectorAll(
|
|
414
|
+
return Array.from(this.querySelectorAll(Dn)).filter((t) => t.parentElement?.closest("use-dropdown") === this);
|
|
415
415
|
};
|
|
416
416
|
ba = function(t) {
|
|
417
|
-
return t.shadowRoot?.delegatesFocus || t.getAttribute("tabindex") === null ? null : String(
|
|
417
|
+
return t.shadowRoot?.delegatesFocus || t.getAttribute("tabindex") === null ? null : String(di(t));
|
|
418
418
|
};
|
|
419
419
|
Es = function() {
|
|
420
|
-
Oi(this,
|
|
420
|
+
Oi(this, Ce, nt(this, T, ma).call(this)), Oi(this, ti, []), x(this, Ce).forEach((t, e) => {
|
|
421
421
|
const i = t.textContent?.trim();
|
|
422
|
-
i && i && (x(this,
|
|
423
|
-
const s =
|
|
424
|
-
s != null && t.setAttribute(
|
|
422
|
+
i && i && (x(this, ti)[e] = i);
|
|
423
|
+
const s = nt(this, T, ba).call(this, t);
|
|
424
|
+
s != null && t.setAttribute($n, s), t.setAttribute("tabindex", "-1");
|
|
425
425
|
});
|
|
426
426
|
};
|
|
427
427
|
va = function(t) {
|
|
428
|
-
t.target instanceof
|
|
428
|
+
t.target instanceof me && t.target !== this || t.target.getAttribute("menu-item")?.includes("keep-open") || nt(this, T, Ms).call(this);
|
|
429
429
|
};
|
|
430
430
|
Ms = function(t = !0) {
|
|
431
431
|
(this.trigger?.popoverTargetElement).hidePopover(), t && this.trigger?.focus();
|
|
432
432
|
};
|
|
433
433
|
_a = async function(t) {
|
|
434
|
-
await this.updateComplete, t ? (x(this,
|
|
434
|
+
await this.updateComplete, t ? (x(this, Nt).states.add("disabled"), this.trigger?.setAttribute("disabled", "disabled")) : (x(this, Nt).states.delete("disabled"), this.trigger?.removeAttribute("disabled")), this.trigger && (this.trigger.disabled = t);
|
|
435
435
|
};
|
|
436
436
|
wa = function() {
|
|
437
437
|
return this.trigger?.popoverTargetElement?.matches(":popover-open");
|
|
438
438
|
};
|
|
439
439
|
os = function(t) {
|
|
440
|
-
const e =
|
|
440
|
+
const e = nt(this, T, wa).call(this);
|
|
441
441
|
if (!e && !x(this, Te) && ["ArrowDown", "ArrowUp"].includes(t.key)) {
|
|
442
442
|
t.preventDefault(), (this.trigger?.popoverTargetElement).showPopover();
|
|
443
443
|
return;
|
|
@@ -449,10 +449,10 @@ os = function(t) {
|
|
|
449
449
|
if (!e)
|
|
450
450
|
return;
|
|
451
451
|
if (e && x(this, Te) && t.key === "ArrowLeft") {
|
|
452
|
-
|
|
452
|
+
nt(this, T, Ms).call(this), t.preventDefault(), t.stopPropagation();
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
const i = x(this,
|
|
455
|
+
const i = x(this, Ce), s = i.findIndex((r) => r === document.activeElement);
|
|
456
456
|
let a;
|
|
457
457
|
switch (t.key) {
|
|
458
458
|
case "ArrowUp":
|
|
@@ -475,26 +475,26 @@ os = function(t) {
|
|
|
475
475
|
break;
|
|
476
476
|
}
|
|
477
477
|
if (!a && t.key.match(/^[\w\d]$/)) {
|
|
478
|
-
const r = x(this,
|
|
478
|
+
const r = x(this, ti).findIndex((n) => n.toLowerCase().startsWith(t.key.toLowerCase()));
|
|
479
479
|
r > -1 && (a = i[r]);
|
|
480
480
|
}
|
|
481
481
|
a?.focus();
|
|
482
482
|
};
|
|
483
483
|
$a = function(t) {
|
|
484
484
|
const e = t.newState === "open";
|
|
485
|
-
this.trigger && (this.trigger.ariaExpanded = e ? "true" : "false"), e ? (x(this,
|
|
485
|
+
this.trigger && (this.trigger.ariaExpanded = e ? "true" : "false"), e ? (x(this, Ce)[0]?.focus(), x(this, Nt).states.add("open")) : x(this, Nt).states.delete("open");
|
|
486
486
|
};
|
|
487
487
|
Da = function() {
|
|
488
|
-
|
|
488
|
+
nt(this, T, Es).call(this);
|
|
489
489
|
};
|
|
490
490
|
Aa = function() {
|
|
491
491
|
return x(this, Te) ? "▶" : "▼";
|
|
492
492
|
};
|
|
493
|
-
|
|
493
|
+
me.shadowRootOptions = {
|
|
494
494
|
...I.shadowRootOptions,
|
|
495
495
|
delegatesFocus: !0
|
|
496
496
|
};
|
|
497
|
-
|
|
497
|
+
me.styles = pt`
|
|
498
498
|
:host(:state(disabled)) {
|
|
499
499
|
pointer-events: none;
|
|
500
500
|
}
|
|
@@ -515,20 +515,20 @@ ye.styles = pt`
|
|
|
515
515
|
`;
|
|
516
516
|
Ss([
|
|
517
517
|
h({ type: Boolean })
|
|
518
|
-
],
|
|
518
|
+
], me.prototype, "disabled", 1);
|
|
519
519
|
Ss([
|
|
520
520
|
h()
|
|
521
|
-
],
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
],
|
|
525
|
-
var
|
|
521
|
+
], me.prototype, "label", 2);
|
|
522
|
+
me = Ss([
|
|
523
|
+
it("use-dropdown")
|
|
524
|
+
], me);
|
|
525
|
+
var An = Object.defineProperty, kn = Object.getOwnPropertyDescriptor, ka = (t) => {
|
|
526
526
|
throw TypeError(t);
|
|
527
527
|
}, E = (t, e, i, s) => {
|
|
528
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
528
|
+
for (var a = s > 1 ? void 0 : s ? kn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
529
529
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
530
|
-
return s && a &&
|
|
531
|
-
}, Ts = (t, e, i) => e.has(t) || ka("Cannot " + i), v = (t, e, i) => (Ts(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
530
|
+
return s && a && An(e, i, a), a;
|
|
531
|
+
}, Ts = (t, e, i) => e.has(t) || ka("Cannot " + i), v = (t, e, i) => (Ts(t, e, "read from private field"), i ? i.call(t) : e.get(t)), ne = (t, e, i) => e.has(t) ? ka("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Zt = (t, e, i, s) => (Ts(t, e, "write to private field"), e.set(t, i), i), Ht = (t, e, i) => (Ts(t, e, "access private method"), i), bt, bi, gt, ls, ke, H, Pi, Ye, xa, Sa, hs, Ia, Ea, Ma;
|
|
532
532
|
const Ta = {
|
|
533
533
|
year: "years",
|
|
534
534
|
month: "months",
|
|
@@ -541,17 +541,17 @@ const Ta = {
|
|
|
541
541
|
};
|
|
542
542
|
let _ = class extends I {
|
|
543
543
|
constructor() {
|
|
544
|
-
super(),
|
|
544
|
+
super(), ne(this, gt), ne(this, bt), ne(this, bi), ne(this, ke, ""), this.years = !1, this.months = !1, this.weeks = !1, this.days = !1, this.hours = !1, this.minutes = !1, this.seconds = !1, this.milliseconds = !1, ne(this, H, {}), this.locale = navigator.language || "en-US", this.format = "short", ne(this, Pi, []), ne(this, Ye, $s), Zt(this, bt, this.attachInternals()), Zt(this, bi, this.closest("form")?.id), Zt(this, ke, this.hasAttribute("id") ? this.getAttribute("id") : xt()), Ht(this, gt, ls).call(this, this.getAttribute("value") ?? "PT0S"), this.hasAttribute("disabled") && v(this, bt).states.add("disabled");
|
|
545
545
|
}
|
|
546
546
|
connectedCallback() {
|
|
547
|
-
super.connectedCallback(),
|
|
547
|
+
super.connectedCallback(), Zt(this, Pi, Ht(this, gt, xa).call(this)), Zt(this, Ye, Ht(this, gt, Ma).call(this));
|
|
548
548
|
}
|
|
549
549
|
get id() {
|
|
550
550
|
return v(this, ke);
|
|
551
551
|
}
|
|
552
552
|
set id(t) {
|
|
553
553
|
const e = v(this, ke);
|
|
554
|
-
|
|
554
|
+
Zt(this, ke, t), this.requestUpdate("id", e);
|
|
555
555
|
}
|
|
556
556
|
set disabled(t) {
|
|
557
557
|
t ? v(this, bt).states.add("disabled") : v(this, bt).states.delete("disabled");
|
|
@@ -566,56 +566,56 @@ let _ = class extends I {
|
|
|
566
566
|
return v(this, bt).states.has("readonly");
|
|
567
567
|
}
|
|
568
568
|
get value() {
|
|
569
|
-
return ws.toString(v(this,
|
|
569
|
+
return ws.toString(v(this, H));
|
|
570
570
|
}
|
|
571
571
|
set value(t) {
|
|
572
|
-
|
|
572
|
+
Ht(this, gt, ls).call(this, t), Ht(this, gt, Ea).call(this);
|
|
573
573
|
}
|
|
574
574
|
render() {
|
|
575
|
-
return Array.from(v(this, gt, Sa).entries()).map(([t, e]) =>
|
|
575
|
+
return Array.from(v(this, gt, Sa).entries()).map(([t, e]) => y`
|
|
576
576
|
<div part="segment segment-${t}">
|
|
577
577
|
${e.map((i) => {
|
|
578
578
|
if (["integer", "fraction"].includes(i.type))
|
|
579
|
-
return
|
|
579
|
+
return y`
|
|
580
580
|
<input
|
|
581
581
|
type="number"
|
|
582
|
-
.value=${v(this,
|
|
582
|
+
.value=${v(this, H)[Ta[t]]}
|
|
583
583
|
?disabled=${this.disabled}
|
|
584
584
|
?readonly=${this.readOnly}
|
|
585
|
-
aria-label=${this.format === "digital" && i.type === "fraction" ? v(this,
|
|
585
|
+
aria-label=${this.format === "digital" && i.type === "fraction" ? v(this, Ye).millisecond : v(this, Ye)[t]}
|
|
586
586
|
min="0"
|
|
587
587
|
part="segment-input segment-input-${t}"
|
|
588
|
-
id="${
|
|
589
|
-
form=${v(this,
|
|
590
|
-
@input=${
|
|
588
|
+
id="${Ht(this, gt, hs).call(this, t)}"
|
|
589
|
+
form=${v(this, bi)}
|
|
590
|
+
@input=${Ht(this, gt, Ia).call(this, t)}
|
|
591
591
|
/>
|
|
592
592
|
`;
|
|
593
593
|
if (["unit", "decimal"].includes(i.type))
|
|
594
|
-
return
|
|
595
|
-
<label for="${
|
|
594
|
+
return y`
|
|
595
|
+
<label for="${Ht(this, gt, hs).call(this, t)}" part="segment-unit segment-unit-${t}">${i.value}</label>
|
|
596
596
|
`;
|
|
597
597
|
if (this.format === "digital" && i.type === "literal")
|
|
598
|
-
return
|
|
598
|
+
return y`<span part="segment-literal segment-literal-${t}">${i.value}</span>`;
|
|
599
599
|
})}
|
|
600
600
|
</div>
|
|
601
601
|
`);
|
|
602
602
|
}
|
|
603
603
|
};
|
|
604
604
|
bt = /* @__PURE__ */ new WeakMap();
|
|
605
|
-
|
|
605
|
+
bi = /* @__PURE__ */ new WeakMap();
|
|
606
606
|
gt = /* @__PURE__ */ new WeakSet();
|
|
607
607
|
ls = function(t) {
|
|
608
608
|
try {
|
|
609
|
-
|
|
609
|
+
Zt(this, H, ws.parse(t));
|
|
610
610
|
} catch {
|
|
611
|
-
|
|
611
|
+
Zt(this, H, {});
|
|
612
612
|
}
|
|
613
613
|
v(this, bt).setFormValue(t);
|
|
614
614
|
};
|
|
615
615
|
ke = /* @__PURE__ */ new WeakMap();
|
|
616
|
-
|
|
616
|
+
H = /* @__PURE__ */ new WeakMap();
|
|
617
617
|
Pi = /* @__PURE__ */ new WeakMap();
|
|
618
|
-
|
|
618
|
+
Ye = /* @__PURE__ */ new WeakMap();
|
|
619
619
|
xa = function() {
|
|
620
620
|
try {
|
|
621
621
|
return new Intl.DurationFormat(this.locale, { style: this.format }).formatToParts({
|
|
@@ -646,11 +646,11 @@ hs = function(t) {
|
|
|
646
646
|
Ia = function(t) {
|
|
647
647
|
return (e) => {
|
|
648
648
|
const i = e.target;
|
|
649
|
-
v(this,
|
|
649
|
+
v(this, H)[Ta[t]] = isNaN(i.valueAsNumber) ? 0 : i.valueAsNumber, this.value = ws.toString(v(this, H));
|
|
650
650
|
};
|
|
651
651
|
};
|
|
652
652
|
Ea = function() {
|
|
653
|
-
this.yearInput && (this.yearInput.value = String(v(this,
|
|
653
|
+
this.yearInput && (this.yearInput.value = String(v(this, H).years ?? 0)), this.monthInput && (this.monthInput.value = String(v(this, H).months ?? 0)), this.weekInput && (this.weekInput.value = String(v(this, H).weeks ?? 0)), this.dayInput && (this.dayInput.value = String(v(this, H).days ?? 0)), this.hourInput && (this.hourInput.value = String(v(this, H).hours ?? 0)), this.minuteInput && (this.minuteInput.value = String(v(this, H).minutes ?? 0)), this.secondInput && (this.secondInput.value = String(v(this, H).seconds ?? 0)), this.millisecondInput && (this.millisecondInput.value = String(v(this, H).milliseconds ?? 0));
|
|
654
654
|
};
|
|
655
655
|
Ma = function() {
|
|
656
656
|
return Ds(this.locale, { plural: !0 });
|
|
@@ -742,22 +742,22 @@ E([
|
|
|
742
742
|
h({ type: String, attribute: !0 })
|
|
743
743
|
], _.prototype, "format", 2);
|
|
744
744
|
_ = E([
|
|
745
|
-
|
|
745
|
+
it("use-duration")
|
|
746
746
|
], _);
|
|
747
|
-
var
|
|
747
|
+
var xn = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, Oa = (t) => {
|
|
748
748
|
throw TypeError(t);
|
|
749
749
|
}, ve = (t, e, i, s) => {
|
|
750
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
750
|
+
for (var a = s > 1 ? void 0 : s ? Sn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
751
751
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
752
|
-
return s && a &&
|
|
753
|
-
}, Os = (t, e, i) => e.has(t) || Oa("Cannot " + i), S = (t, e, i) => (Os(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
754
|
-
const
|
|
752
|
+
return s && a && xn(e, i, a), a;
|
|
753
|
+
}, Os = (t, e, i) => e.has(t) || Oa("Cannot " + i), S = (t, e, i) => (Os(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Be = (t, e, i) => e.has(t) ? Oa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), ji = (t, e, i, s) => (Os(t, e, "write to private field"), e.set(t, i), i), Ee = (t, e, i) => (Os(t, e, "access private method"), i), vi, Bt, zt, et, Pa, Ps, Ca, Ke, Wa, ge, Fa;
|
|
754
|
+
const In = "__value";
|
|
755
755
|
let kt = class extends I {
|
|
756
756
|
constructor() {
|
|
757
|
-
super(),
|
|
757
|
+
super(), Be(this, et), Be(this, vi), Be(this, Bt), Be(this, zt, new FormData()), this.placeholder = "", this.multiple = !1, Be(this, Ke, null), ji(this, vi, xt()), ji(this, Bt, this.attachInternals()), this.hasAttribute("disabled") && S(this, Bt).states.add("disabled");
|
|
758
758
|
}
|
|
759
759
|
set disabled(t) {
|
|
760
|
-
Ee(this,
|
|
760
|
+
Ee(this, et, Wa).call(this, t);
|
|
761
761
|
}
|
|
762
762
|
get disabled() {
|
|
763
763
|
return S(this, Bt).states.has("disabled");
|
|
@@ -773,42 +773,42 @@ let kt = class extends I {
|
|
|
773
773
|
return this.options.find((t) => t.selected);
|
|
774
774
|
}
|
|
775
775
|
getId() {
|
|
776
|
-
return this.id ? this.id : S(this,
|
|
776
|
+
return this.id ? this.id : S(this, vi);
|
|
777
777
|
}
|
|
778
778
|
get activeOption() {
|
|
779
|
-
return S(this,
|
|
779
|
+
return S(this, Ke);
|
|
780
780
|
}
|
|
781
781
|
set activeOption(t) {
|
|
782
|
-
S(this,
|
|
782
|
+
S(this, Ke)?.setActive(!1), ji(this, Ke, t), this.listbox.setAttribute("aria-activedescendant", t?.id ?? ""), t?.setActive(!0);
|
|
783
783
|
}
|
|
784
784
|
firstUpdated() {
|
|
785
|
-
Ee(this,
|
|
785
|
+
Ee(this, et, Ca).call(this), this.activeOption = this.firstSelected ?? this.options.at(0) ?? null;
|
|
786
786
|
}
|
|
787
787
|
get value() {
|
|
788
788
|
return S(this, zt);
|
|
789
789
|
}
|
|
790
790
|
render() {
|
|
791
|
-
return
|
|
792
|
-
<div role="listbox" part="listbox" tabindex=${0} @click=${Ee(this,
|
|
791
|
+
return y`
|
|
792
|
+
<div role="listbox" part="listbox" tabindex=${0} @click=${Ee(this, et, Pa)} @keydown=${Ee(this, et, Fa)}>
|
|
793
793
|
<slot></slot>
|
|
794
794
|
</div>
|
|
795
795
|
`;
|
|
796
796
|
}
|
|
797
797
|
};
|
|
798
|
-
|
|
798
|
+
vi = /* @__PURE__ */ new WeakMap();
|
|
799
799
|
Bt = /* @__PURE__ */ new WeakMap();
|
|
800
800
|
zt = /* @__PURE__ */ new WeakMap();
|
|
801
|
-
|
|
801
|
+
et = /* @__PURE__ */ new WeakSet();
|
|
802
802
|
Pa = function(t) {
|
|
803
803
|
const e = t.target?.closest("use-option");
|
|
804
|
-
e?.value != null && (t.preventDefault(), Ee(this,
|
|
804
|
+
e?.value != null && (t.preventDefault(), Ee(this, et, Ps).call(this, e), this.activeOption = e);
|
|
805
805
|
};
|
|
806
806
|
Ps = function(t) {
|
|
807
|
-
t.value == null || t.disabled || (this.multiple ? (t.toggleSelected(), S(this, zt).delete(S(this,
|
|
808
|
-
e.selected && e.value && S(this, zt).append(S(this,
|
|
807
|
+
t.value == null || t.disabled || (this.multiple ? (t.toggleSelected(), S(this, zt).delete(S(this, et, ge)), this.options?.forEach((e) => {
|
|
808
|
+
e.selected && e.value && S(this, zt).append(S(this, et, ge), e.value);
|
|
809
809
|
})) : (this.options?.forEach((e) => {
|
|
810
810
|
e.selected = e === t;
|
|
811
|
-
}), S(this, zt).set(S(this,
|
|
811
|
+
}), S(this, zt).set(S(this, et, ge), t.value)), S(this, Bt).setFormValue(this.value), this.dispatchEvent(
|
|
812
812
|
new CustomEvent("use-change", {
|
|
813
813
|
detail: { value: this.value },
|
|
814
814
|
bubbles: !0,
|
|
@@ -818,22 +818,22 @@ Ps = function(t) {
|
|
|
818
818
|
};
|
|
819
819
|
Ca = function() {
|
|
820
820
|
const t = this.selected.map((e) => e.getAttribute("value") ?? e.textContent);
|
|
821
|
-
S(this, zt).delete(S(this,
|
|
822
|
-
e && S(this, zt).append(S(this,
|
|
823
|
-
}) : t[0] && S(this, zt).set(S(this,
|
|
821
|
+
S(this, zt).delete(S(this, et, ge)), this.multiple ? t.forEach((e) => {
|
|
822
|
+
e && S(this, zt).append(S(this, et, ge), e);
|
|
823
|
+
}) : t[0] && S(this, zt).set(S(this, et, ge), t[0]), S(this, Bt).setFormValue(this.value);
|
|
824
824
|
};
|
|
825
|
-
|
|
825
|
+
Ke = /* @__PURE__ */ new WeakMap();
|
|
826
826
|
Wa = async function(t) {
|
|
827
827
|
await this.updateComplete, t ? (S(this, Bt).states.add("disabled"), this.listbox.removeAttribute("tabindex")) : (S(this, Bt).states.delete("disabled"), this.listbox.setAttribute("tabindex", "0"));
|
|
828
828
|
};
|
|
829
|
-
|
|
830
|
-
return this.name ??
|
|
829
|
+
ge = function() {
|
|
830
|
+
return this.name ?? In;
|
|
831
831
|
};
|
|
832
832
|
Fa = function(t) {
|
|
833
833
|
if (this.disabled)
|
|
834
834
|
return;
|
|
835
835
|
if (["Enter", " "].includes(t.key) && this.activeOption) {
|
|
836
|
-
t.preventDefault(), Ee(this,
|
|
836
|
+
t.preventDefault(), Ee(this, et, Ps).call(this, this.activeOption);
|
|
837
837
|
return;
|
|
838
838
|
}
|
|
839
839
|
const e = this.options, i = this.activeOption?.id, s = i ? e.findIndex((r) => r.id === i) : -1;
|
|
@@ -898,22 +898,22 @@ ve([
|
|
|
898
898
|
k('[part="listbox"]', !0)
|
|
899
899
|
], kt.prototype, "listbox", 2);
|
|
900
900
|
kt = ve([
|
|
901
|
-
|
|
901
|
+
it("use-listbox")
|
|
902
902
|
], kt);
|
|
903
|
-
var
|
|
903
|
+
var En = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Ua = (t) => {
|
|
904
904
|
throw TypeError(t);
|
|
905
|
-
},
|
|
906
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
905
|
+
}, Le = (t, e, i, s) => {
|
|
906
|
+
for (var a = s > 1 ? void 0 : s ? Mn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
907
907
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
908
|
-
return s && a &&
|
|
909
|
-
}, Cs = (t, e, i) => e.has(t) || Ua("Cannot " + i), D = (t, e, i) => (Cs(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
910
|
-
const
|
|
908
|
+
return s && a && En(e, i, a), a;
|
|
909
|
+
}, Cs = (t, e, i) => e.has(t) || Ua("Cannot " + i), D = (t, e, i) => (Cs(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Ve = (t, e, i) => e.has(t) ? Ua("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), ts = (t, e, i, s) => (Cs(t, e, "write to private field"), e.set(t, i), i), _t = (t, e, i) => (Cs(t, e, "access private method"), i), _i, wt, We, P, La, wi, Ra, Ws, Fs, Na, Ba, He, Va, za, Ci, qa, Ya, Ka;
|
|
910
|
+
const Tn = "__value";
|
|
911
911
|
let Ot = class extends I {
|
|
912
912
|
constructor() {
|
|
913
|
-
super(),
|
|
913
|
+
super(), Ve(this, P), Ve(this, _i), Ve(this, wt), Ve(this, We, new FormData()), this.placeholder = "", this.trigger = null, Ve(this, He, null), ts(this, _i, xt()), ts(this, wt, this.attachInternals()), this.hasAttribute("disabled") && D(this, wt).states.add("disabled");
|
|
914
914
|
}
|
|
915
915
|
set disabled(t) {
|
|
916
|
-
_t(this,
|
|
916
|
+
_t(this, P, za).call(this, t);
|
|
917
917
|
}
|
|
918
918
|
get disabled() {
|
|
919
919
|
return D(this, wt).states.has("disabled");
|
|
@@ -925,33 +925,33 @@ let Ot = class extends I {
|
|
|
925
925
|
return this.options.find((t) => t.selected);
|
|
926
926
|
}
|
|
927
927
|
getId() {
|
|
928
|
-
return this.id ? this.id : D(this,
|
|
928
|
+
return this.id ? this.id : D(this, _i);
|
|
929
929
|
}
|
|
930
930
|
get activeOption() {
|
|
931
|
-
return D(this,
|
|
931
|
+
return D(this, He);
|
|
932
932
|
}
|
|
933
933
|
set activeOption(t) {
|
|
934
|
-
D(this,
|
|
934
|
+
D(this, He)?.setActive(!1), ts(this, He, t), this.trigger?.setAttribute("aria-activedescendant", t?.id ?? ""), t?.setActive(!0);
|
|
935
935
|
}
|
|
936
936
|
firstUpdated() {
|
|
937
|
-
this.trigger = this.shadowRoot?.querySelector('button[part="trigger"]') ?? null, _t(this,
|
|
937
|
+
this.trigger = this.shadowRoot?.querySelector('button[part="trigger"]') ?? null, _t(this, P, Ba).call(this), _t(this, P, Fs).call(this);
|
|
938
938
|
}
|
|
939
939
|
get value() {
|
|
940
|
-
return D(this,
|
|
940
|
+
return D(this, We);
|
|
941
941
|
}
|
|
942
942
|
render() {
|
|
943
|
-
return
|
|
943
|
+
return y`
|
|
944
944
|
<button
|
|
945
945
|
part="trigger"
|
|
946
946
|
type="button"
|
|
947
947
|
role="combobox"
|
|
948
|
-
id=${D(this,
|
|
949
|
-
popovertarget=${D(this,
|
|
950
|
-
aria-controls=${D(this,
|
|
948
|
+
id=${D(this, P, La)}
|
|
949
|
+
popovertarget=${D(this, P, wi)}
|
|
950
|
+
aria-controls=${D(this, P, wi)}
|
|
951
951
|
aria-haspopup="listbox"
|
|
952
952
|
aria-expanded="false"
|
|
953
953
|
?disabled=${this.disabled}
|
|
954
|
-
@keydown=${_t(this,
|
|
954
|
+
@keydown=${_t(this, P, Ya)}
|
|
955
955
|
>
|
|
956
956
|
<span part="trigger-label">${this.placeholder}</span>
|
|
957
957
|
<slot part="trigger-arrow" name="trigger-arrow">
|
|
@@ -961,50 +961,50 @@ let Ot = class extends I {
|
|
|
961
961
|
</slot>
|
|
962
962
|
</button>
|
|
963
963
|
<div
|
|
964
|
-
id=${D(this,
|
|
964
|
+
id=${D(this, P, wi)}
|
|
965
965
|
role="listbox"
|
|
966
966
|
part="listbox"
|
|
967
967
|
popover
|
|
968
|
-
@click=${_t(this,
|
|
969
|
-
@toggle=${_t(this,
|
|
968
|
+
@click=${_t(this, P, Ra)}
|
|
969
|
+
@toggle=${_t(this, P, Ka)}
|
|
970
970
|
>
|
|
971
971
|
<slot></slot>
|
|
972
972
|
</div>
|
|
973
973
|
`;
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
|
-
|
|
976
|
+
_i = /* @__PURE__ */ new WeakMap();
|
|
977
977
|
wt = /* @__PURE__ */ new WeakMap();
|
|
978
|
-
|
|
979
|
-
|
|
978
|
+
We = /* @__PURE__ */ new WeakMap();
|
|
979
|
+
P = /* @__PURE__ */ new WeakSet();
|
|
980
980
|
La = function() {
|
|
981
981
|
return `${this.getId()}-trigger`;
|
|
982
982
|
};
|
|
983
|
-
|
|
983
|
+
wi = function() {
|
|
984
984
|
return `${this.getId()}-dropdown`;
|
|
985
985
|
};
|
|
986
|
-
|
|
986
|
+
Ra = function(t) {
|
|
987
987
|
const e = t.target?.closest("use-option");
|
|
988
|
-
e?.value != null && (t.preventDefault(), _t(this,
|
|
988
|
+
e?.value != null && (t.preventDefault(), _t(this, P, Ws).call(this, e), e.disabled ? this.trigger?.focus() : (this.trigger?.popoverTargetElement).hidePopover());
|
|
989
989
|
};
|
|
990
990
|
Ws = function(t) {
|
|
991
991
|
t.value == null || t.disabled || (this.options?.forEach((e) => {
|
|
992
992
|
e.selected = e === t;
|
|
993
|
-
}), D(this,
|
|
993
|
+
}), D(this, We).set(D(this, P, Ci), t.value), D(this, wt).setFormValue(this.value), _t(this, P, Fs).call(this));
|
|
994
994
|
};
|
|
995
995
|
Fs = function() {
|
|
996
|
-
const t = D(this,
|
|
996
|
+
const t = D(this, P, Na);
|
|
997
997
|
this.label.innerHTML = t ?? this.placeholder, t ? D(this, wt).states.delete("placeholder") : D(this, wt).states.add("placeholder");
|
|
998
998
|
};
|
|
999
|
-
|
|
999
|
+
Na = function() {
|
|
1000
1000
|
const t = this.selected;
|
|
1001
1001
|
return t.length > 0 ? t.map((e) => e.textContent).toLocaleString() : void 0;
|
|
1002
1002
|
};
|
|
1003
1003
|
Ba = function() {
|
|
1004
1004
|
const t = this.selected.map((e) => e.getAttribute("value") ?? e.textContent);
|
|
1005
|
-
D(this,
|
|
1005
|
+
D(this, We).delete(D(this, P, Ci)), t[0] && D(this, We).set(D(this, P, Ci), t[0]), D(this, wt).setFormValue(this.value);
|
|
1006
1006
|
};
|
|
1007
|
-
|
|
1007
|
+
He = /* @__PURE__ */ new WeakMap();
|
|
1008
1008
|
Va = function() {
|
|
1009
1009
|
const t = this.firstSelected ?? this.options.at(0) ?? null;
|
|
1010
1010
|
return this.activeOption = t, t?.id ?? "";
|
|
@@ -1013,13 +1013,13 @@ za = async function(t) {
|
|
|
1013
1013
|
await this.updateComplete, t ? (D(this, wt).states.add("disabled"), this.trigger?.setAttribute("disabled", "disabled")) : (D(this, wt).states.delete("disabled"), this.trigger?.removeAttribute("disabled")), this.trigger && (this.trigger.disabled = t);
|
|
1014
1014
|
};
|
|
1015
1015
|
Ci = function() {
|
|
1016
|
-
return this.name ??
|
|
1016
|
+
return this.name ?? Tn;
|
|
1017
1017
|
};
|
|
1018
1018
|
qa = function() {
|
|
1019
1019
|
return this.trigger?.popoverTargetElement?.matches(":popover-open");
|
|
1020
1020
|
};
|
|
1021
1021
|
Ya = function(t) {
|
|
1022
|
-
const e = _t(this,
|
|
1022
|
+
const e = _t(this, P, qa).call(this);
|
|
1023
1023
|
if (!e && ["ArrowDown", "ArrowUp"].includes(t.key)) {
|
|
1024
1024
|
t.preventDefault(), (this.trigger?.popoverTargetElement).showPopover();
|
|
1025
1025
|
return;
|
|
@@ -1027,7 +1027,7 @@ Ya = function(t) {
|
|
|
1027
1027
|
if (!e)
|
|
1028
1028
|
return;
|
|
1029
1029
|
if (["Enter", " "].includes(t.key) && this.activeOption) {
|
|
1030
|
-
t.preventDefault(), _t(this,
|
|
1030
|
+
t.preventDefault(), _t(this, P, Ws).call(this, this.activeOption);
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
1033
|
const i = this.options, s = this.activeOption?.id, a = s ? i.findIndex((n) => n.id === s) : -1;
|
|
@@ -1047,7 +1047,7 @@ Ya = function(t) {
|
|
|
1047
1047
|
};
|
|
1048
1048
|
Ka = function(t) {
|
|
1049
1049
|
const e = t.newState === "open";
|
|
1050
|
-
this.trigger && (this.trigger.ariaExpanded = e ? "true" : "false"), e && _t(this,
|
|
1050
|
+
this.trigger && (this.trigger.ariaExpanded = e ? "true" : "false"), e && _t(this, P, Va).call(this);
|
|
1051
1051
|
};
|
|
1052
1052
|
Ot.formAssociated = !0;
|
|
1053
1053
|
Ot.shadowRootOptions = {
|
|
@@ -1084,98 +1084,98 @@ Ot.styles = pt`
|
|
|
1084
1084
|
background-color: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
|
1085
1085
|
}
|
|
1086
1086
|
`;
|
|
1087
|
-
|
|
1087
|
+
Le([
|
|
1088
1088
|
h()
|
|
1089
1089
|
], Ot.prototype, "name", 2);
|
|
1090
|
-
|
|
1090
|
+
Le([
|
|
1091
1091
|
h()
|
|
1092
1092
|
], Ot.prototype, "placeholder", 2);
|
|
1093
|
-
|
|
1093
|
+
Le([
|
|
1094
1094
|
h({ type: Boolean })
|
|
1095
1095
|
], Ot.prototype, "disabled", 1);
|
|
1096
|
-
|
|
1096
|
+
Le([
|
|
1097
1097
|
na({ selector: "use-option" })
|
|
1098
1098
|
], Ot.prototype, "options", 2);
|
|
1099
|
-
|
|
1099
|
+
Le([
|
|
1100
1100
|
k('[part="trigger-label"]', !0)
|
|
1101
1101
|
], Ot.prototype, "label", 2);
|
|
1102
|
-
Ot =
|
|
1103
|
-
|
|
1102
|
+
Ot = Le([
|
|
1103
|
+
it("use-select")
|
|
1104
1104
|
], Ot);
|
|
1105
|
-
var
|
|
1105
|
+
var On = Object.defineProperty, Pn = Object.getOwnPropertyDescriptor, Ha = (t) => {
|
|
1106
1106
|
throw TypeError(t);
|
|
1107
1107
|
}, q = (t, e, i, s) => {
|
|
1108
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1108
|
+
for (var a = s > 1 ? void 0 : s ? Pn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1109
1109
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1110
|
-
return s && a &&
|
|
1111
|
-
}, Us = (t, e, i) => e.has(t) || Ha("Cannot " + i),
|
|
1112
|
-
let
|
|
1110
|
+
return s && a && On(e, i, a), a;
|
|
1111
|
+
}, Us = (t, e, i) => e.has(t) || Ha("Cannot " + i), u = (t, e, i) => (Us(t, e, "read from private field"), i ? i.call(t) : e.get(t)), ft = (t, e, i) => e.has(t) ? Ha("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), G = (t, e, i, s) => (Us(t, e, "write to private field"), e.set(t, i), i), A = (t, e, i) => (Us(t, e, "access private method"), i), Qt, tt, $i, Re, ee, qi, Yi, w, ds, Ga, xe, f, Xa, Di, Za, Qa, Ja, ja, tr, Wi, er, ir, Ls, sr, ar, ei, rr;
|
|
1112
|
+
let C = class extends I {
|
|
1113
1113
|
constructor() {
|
|
1114
|
-
super(), ft(this, w), ft(this,
|
|
1114
|
+
super(), ft(this, w), ft(this, Qt, ""), ft(this, tt), ft(this, $i), ft(this, Re, 23), ft(this, ee, $s), ft(this, qi, "a"), ft(this, Yi, "p"), ft(this, xe, ""), this.hours = !1, this.minutes = !1, this.seconds = !1, this.fractionalSeconds = !1, this.dayPeriod = !1, ft(this, f, {
|
|
1115
1115
|
hour: void 0,
|
|
1116
1116
|
minute: void 0,
|
|
1117
1117
|
second: void 0,
|
|
1118
1118
|
fractionalSecond: void 0,
|
|
1119
1119
|
dayPeriod: void 0
|
|
1120
|
-
}), this.locale = navigator.language || "en-US", this.format = "long", ft(this,
|
|
1120
|
+
}), this.locale = navigator.language || "en-US", this.format = "long", ft(this, Di, []), G(this, tt, this.attachInternals()), G(this, $i, this.closest("form")?.id), G(this, xe, this.hasAttribute("id") ? this.getAttribute("id") : xt()), this.hasAttribute("disabled") && u(this, tt).states.add("disabled");
|
|
1121
1121
|
}
|
|
1122
1122
|
connectedCallback() {
|
|
1123
|
-
super.connectedCallback(), A(this, w, Ja).call(this), A(this, w, Za).call(this),
|
|
1123
|
+
super.connectedCallback(), A(this, w, Ja).call(this), A(this, w, Za).call(this), G(this, Di, A(this, w, Qa).call(this)), A(this, w, ds).call(this, this.getAttribute("value") ?? "");
|
|
1124
1124
|
}
|
|
1125
1125
|
get id() {
|
|
1126
|
-
return
|
|
1126
|
+
return u(this, xe);
|
|
1127
1127
|
}
|
|
1128
1128
|
set id(t) {
|
|
1129
|
-
const e =
|
|
1130
|
-
|
|
1129
|
+
const e = u(this, xe);
|
|
1130
|
+
G(this, xe, t), this.requestUpdate("id", e);
|
|
1131
1131
|
}
|
|
1132
1132
|
set disabled(t) {
|
|
1133
|
-
t ?
|
|
1133
|
+
t ? u(this, tt).states.add("disabled") : u(this, tt).states.delete("disabled");
|
|
1134
1134
|
}
|
|
1135
1135
|
get disabled() {
|
|
1136
|
-
return
|
|
1136
|
+
return u(this, tt).states.has("disabled");
|
|
1137
1137
|
}
|
|
1138
1138
|
set readOnly(t) {
|
|
1139
|
-
t ?
|
|
1139
|
+
t ? u(this, tt).states.add("readonly") : u(this, tt).states.delete("readonly");
|
|
1140
1140
|
}
|
|
1141
1141
|
get readOnly() {
|
|
1142
|
-
return
|
|
1142
|
+
return u(this, tt).states.has("readonly");
|
|
1143
1143
|
}
|
|
1144
1144
|
get value() {
|
|
1145
|
-
return
|
|
1145
|
+
return u(this, Qt);
|
|
1146
1146
|
}
|
|
1147
1147
|
set value(t) {
|
|
1148
1148
|
A(this, w, ds).call(this, t), A(this, w, Xa).call(this);
|
|
1149
1149
|
}
|
|
1150
1150
|
render() {
|
|
1151
|
-
return
|
|
1151
|
+
return u(this, Di).map((t) => t.type === "literal" ? y`<span part="segment-literal segment-literal-${t.type}" aria-hidden="true">${t.value}</span>` : y`<input
|
|
1152
1152
|
type=${t.type === "dayPeriod" ? "text" : "number"}
|
|
1153
|
-
value=${t.type === "dayPeriod" ?
|
|
1153
|
+
value=${t.type === "dayPeriod" ? u(this, f).dayPeriod ? u(this, ee)[u(this, f).dayPeriod] : "" : u(this, f)[t.type]}
|
|
1154
1154
|
?disabled=${this.disabled}
|
|
1155
1155
|
?readonly=${this.readOnly}
|
|
1156
|
-
aria-label=${
|
|
1156
|
+
aria-label=${u(this, ee)[t.type === "fractionalSecond" ? "millisecond" : t.type]}
|
|
1157
1157
|
min="0"
|
|
1158
1158
|
max=${A(this, w, rr).call(this, t.type)}
|
|
1159
1159
|
part="segment-input segment-input-${t.type}"
|
|
1160
1160
|
id="${A(this, w, ja).call(this, t.type)}"
|
|
1161
|
-
form=${
|
|
1161
|
+
form=${u(this, $i)}
|
|
1162
1162
|
@input=${A(this, w, ir).call(this, t.type)}
|
|
1163
1163
|
@keydown=${t.type === "dayPeriod" ? A(this, w, sr) : void 0}
|
|
1164
1164
|
/>`);
|
|
1165
1165
|
}
|
|
1166
1166
|
};
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1167
|
+
Qt = /* @__PURE__ */ new WeakMap();
|
|
1168
|
+
tt = /* @__PURE__ */ new WeakMap();
|
|
1169
|
+
$i = /* @__PURE__ */ new WeakMap();
|
|
1170
|
+
Re = /* @__PURE__ */ new WeakMap();
|
|
1171
|
+
ee = /* @__PURE__ */ new WeakMap();
|
|
1172
1172
|
qi = /* @__PURE__ */ new WeakMap();
|
|
1173
1173
|
Yi = /* @__PURE__ */ new WeakMap();
|
|
1174
1174
|
w = /* @__PURE__ */ new WeakSet();
|
|
1175
1175
|
ds = function(t) {
|
|
1176
1176
|
try {
|
|
1177
1177
|
if (!t)
|
|
1178
|
-
|
|
1178
|
+
G(this, f, {
|
|
1179
1179
|
hour: void 0,
|
|
1180
1180
|
minute: void 0,
|
|
1181
1181
|
second: void 0,
|
|
@@ -1184,7 +1184,7 @@ ds = function(t) {
|
|
|
1184
1184
|
});
|
|
1185
1185
|
else {
|
|
1186
1186
|
const [e, i, s] = t.split(":"), [a, r] = s ? s.split(".") : [void 0, void 0], n = e && Number(e) >= 12 ? "pm" : "am";
|
|
1187
|
-
|
|
1187
|
+
G(this, f, {
|
|
1188
1188
|
hour: e ? A(this, w, Ga).call(this, e, n) : void 0,
|
|
1189
1189
|
minute: i,
|
|
1190
1190
|
second: a,
|
|
@@ -1193,7 +1193,7 @@ ds = function(t) {
|
|
|
1193
1193
|
});
|
|
1194
1194
|
}
|
|
1195
1195
|
} catch {
|
|
1196
|
-
|
|
1196
|
+
G(this, f, {
|
|
1197
1197
|
hour: void 0,
|
|
1198
1198
|
minute: void 0,
|
|
1199
1199
|
second: void 0,
|
|
@@ -1201,18 +1201,18 @@ ds = function(t) {
|
|
|
1201
1201
|
dayPeriod: void 0
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
A(this, w,
|
|
1204
|
+
A(this, w, ei).call(this);
|
|
1205
1205
|
};
|
|
1206
1206
|
Ga = function(t, e) {
|
|
1207
1207
|
const i = Number(t);
|
|
1208
|
-
return
|
|
1208
|
+
return u(this, Re) === 12 ? e === "am" ? i === 12 ? "00" : i.toString() : i > 12 ? (i - 12).toString() : i === 12 ? "12" : (i + 12).toString() : i.toString();
|
|
1209
1209
|
};
|
|
1210
1210
|
xe = /* @__PURE__ */ new WeakMap();
|
|
1211
|
-
|
|
1211
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
1212
1212
|
Xa = function() {
|
|
1213
|
-
this.hourInput && (this.hourFormat === "12" ? this.hourInput.value =
|
|
1213
|
+
this.hourInput && (this.hourFormat === "12" ? this.hourInput.value = u(this, f).hour ? u(this, f).hour : "" : this.hourInput.value = u(this, f).hour ? u(this, f).hour.padStart(2, "0") : ""), this.minuteInput && (this.minuteInput.value = u(this, f).minute ? u(this, f).minute.padStart(2, "0") : ""), this.secondInput && (this.secondInput.value = u(this, f).second ? u(this, f).second.padStart(2, "0") : ""), this.fractionalSecondInput && (this.fractionalSecondInput.value = u(this, f).fractionalSecond ? u(this, f).fractionalSecond.padStart(3, "0") : ""), this.dayPeriodInput && (this.dayPeriodInput.value = u(this, f).dayPeriod ? u(this, ee)[u(this, f).dayPeriod] ?? "" : "");
|
|
1214
1214
|
};
|
|
1215
|
-
|
|
1215
|
+
Di = /* @__PURE__ */ new WeakMap();
|
|
1216
1216
|
Za = function() {
|
|
1217
1217
|
if (!this.hourFormat) {
|
|
1218
1218
|
const t = new Intl.DateTimeFormat(this.locale, { hour: "numeric" });
|
|
@@ -1229,9 +1229,9 @@ Qa = function() {
|
|
|
1229
1229
|
hour12: this.hourFormat ? this.hourFormat === "12" : void 0,
|
|
1230
1230
|
timeZone: "UTC"
|
|
1231
1231
|
}, s = new Intl.DateTimeFormat(this.locale, i), a = new Date(2024, 0, 1, 12, 30, 45), r = s.formatToParts(a), n = !!s.resolvedOptions().hour12 && this.dayPeriod;
|
|
1232
|
-
|
|
1233
|
-
const [
|
|
1234
|
-
return
|
|
1232
|
+
G(this, Re, n ? 12 : 23), G(this, ee, Ds(this.locale));
|
|
1233
|
+
const [p, N] = u(this, ee).dayPeriod.split("/").map((F) => F.toLowerCase().charAt(0));
|
|
1234
|
+
return G(this, qi, p), G(this, Yi, N), this.dayPeriod ? e ? r.filter((F) => F.type === "dayPeriod") : r.filter((F) => F.value.trim() !== "") : r.filter((F) => F.type !== "dayPeriod");
|
|
1235
1235
|
} catch {
|
|
1236
1236
|
return [];
|
|
1237
1237
|
}
|
|
@@ -1246,7 +1246,7 @@ tr = function(t) {
|
|
|
1246
1246
|
return ["ArrowUp", "ArrowDown"].includes(t);
|
|
1247
1247
|
};
|
|
1248
1248
|
Wi = function(t) {
|
|
1249
|
-
const e = [
|
|
1249
|
+
const e = [u(this, qi), u(this, Yi)].indexOf(t.toLowerCase().charAt(0));
|
|
1250
1250
|
return e === -1 ? null : e === 0 ? "am" : "pm";
|
|
1251
1251
|
};
|
|
1252
1252
|
er = function(t) {
|
|
@@ -1257,19 +1257,19 @@ ir = function(t) {
|
|
|
1257
1257
|
return (e) => {
|
|
1258
1258
|
const i = e.target;
|
|
1259
1259
|
if (i.value === "") {
|
|
1260
|
-
|
|
1260
|
+
u(this, f)[t] = void 0, A(this, w, ei).call(this);
|
|
1261
1261
|
return;
|
|
1262
1262
|
}
|
|
1263
1263
|
const s = isNaN(i.valueAsNumber) ? 0 : i.valueAsNumber;
|
|
1264
1264
|
if (t === "hour") {
|
|
1265
1265
|
const a = this.hourFormat === "12" && this.dayPeriod, r = a ? 1 : 0, n = a ? 12 : 23;
|
|
1266
|
-
|
|
1266
|
+
u(this, f).hour = Math.max(r, Math.min(n, s)).toString(), i.value = this.hourFormat === "12" ? u(this, f).hour : u(this, f).hour.padStart(2, "0");
|
|
1267
1267
|
} else if (t === "minute")
|
|
1268
|
-
|
|
1268
|
+
u(this, f).minute = Math.max(0, Math.min(59, s)).toString(), i.value = u(this, f).minute.padStart(2, "0");
|
|
1269
1269
|
else if (t === "second")
|
|
1270
|
-
|
|
1270
|
+
u(this, f).second = Math.max(0, Math.min(59, s)).toString(), i.value = u(this, f).second.padStart(2, "0");
|
|
1271
1271
|
else if (t === "fractionalSecond")
|
|
1272
|
-
|
|
1272
|
+
u(this, f).fractionalSecond = Math.max(0, Math.min(999, s)).toString(), i.value = u(this, f).fractionalSecond.padStart(3, "0");
|
|
1273
1273
|
else if (t === "dayPeriod") {
|
|
1274
1274
|
e.preventDefault();
|
|
1275
1275
|
const a = A(this, w, er).call(this, e);
|
|
@@ -1278,12 +1278,12 @@ ir = function(t) {
|
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
A(this, w,
|
|
1281
|
+
A(this, w, ei).call(this);
|
|
1282
1282
|
};
|
|
1283
1283
|
};
|
|
1284
1284
|
Ls = function(t, e) {
|
|
1285
|
-
const i =
|
|
1286
|
-
|
|
1285
|
+
const i = u(this, f).dayPeriod ?? "am", s = e ?? A(this, w, ar).call(this, i);
|
|
1286
|
+
u(this, f).dayPeriod = s, t.value = u(this, ee)[s] ?? "", A(this, w, ei).call(this);
|
|
1287
1287
|
};
|
|
1288
1288
|
sr = function(t) {
|
|
1289
1289
|
["Enter", "Tab"].includes(t.key) || (!A(this, w, Wi).call(this, t.key) && !t.ctrlKey && !t.metaKey && t.preventDefault(), A(this, w, tr).call(this, t.key) && (A(this, w, Ls).call(this, t.target), this.dispatchEvent(
|
|
@@ -1296,14 +1296,14 @@ sr = function(t) {
|
|
|
1296
1296
|
ar = function(t) {
|
|
1297
1297
|
return t === "am" ? "pm" : "am";
|
|
1298
1298
|
};
|
|
1299
|
-
|
|
1300
|
-
const { hour: t, minute: e, second: i, fractionalSecond: s, dayPeriod: a } =
|
|
1299
|
+
ei = function() {
|
|
1300
|
+
const { hour: t, minute: e, second: i, fractionalSecond: s, dayPeriod: a } = u(this, f), r = [];
|
|
1301
1301
|
if (this.hours) {
|
|
1302
1302
|
if (!t) {
|
|
1303
|
-
|
|
1303
|
+
G(this, Qt, ""), u(this, tt).setFormValue(null);
|
|
1304
1304
|
return;
|
|
1305
1305
|
}
|
|
1306
|
-
if (
|
|
1306
|
+
if (u(this, Re) === 12 && this.dayPeriod)
|
|
1307
1307
|
if (a === "am")
|
|
1308
1308
|
r.push(t === "12" ? "00" : t.padStart(2, "0"));
|
|
1309
1309
|
else {
|
|
@@ -1315,34 +1315,34 @@ ti = function() {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
if (this.minutes) {
|
|
1317
1317
|
if (!e) {
|
|
1318
|
-
|
|
1318
|
+
G(this, Qt, ""), u(this, tt).setFormValue(null);
|
|
1319
1319
|
return;
|
|
1320
1320
|
}
|
|
1321
1321
|
r.push(e.padStart(2, "0"));
|
|
1322
1322
|
}
|
|
1323
1323
|
if (this.seconds) {
|
|
1324
1324
|
if (!i) {
|
|
1325
|
-
|
|
1325
|
+
G(this, Qt, ""), u(this, tt).setFormValue(null);
|
|
1326
1326
|
return;
|
|
1327
1327
|
}
|
|
1328
1328
|
r.push(i.padStart(2, "0"));
|
|
1329
1329
|
}
|
|
1330
|
-
|
|
1330
|
+
G(this, Qt, r.join(":").concat(s && this.fractionalSeconds ? "." + s.padStart(3, "0") : "")), u(this, tt).setFormValue(u(this, Qt));
|
|
1331
1331
|
};
|
|
1332
1332
|
rr = function(t) {
|
|
1333
1333
|
if (t === "hour")
|
|
1334
|
-
return
|
|
1334
|
+
return u(this, Re);
|
|
1335
1335
|
if (t === "minute" || t === "second")
|
|
1336
1336
|
return 59;
|
|
1337
1337
|
if (t === "fractionalSecond")
|
|
1338
1338
|
return 999;
|
|
1339
1339
|
};
|
|
1340
|
-
|
|
1341
|
-
|
|
1340
|
+
C.formAssociated = !0;
|
|
1341
|
+
C.shadowRootOptions = {
|
|
1342
1342
|
...I.shadowRootOptions,
|
|
1343
1343
|
delegatesFocus: !0
|
|
1344
1344
|
};
|
|
1345
|
-
|
|
1345
|
+
C.styles = pt`
|
|
1346
1346
|
:host {
|
|
1347
1347
|
display: inline-flex;
|
|
1348
1348
|
align-items: center;
|
|
@@ -1369,83 +1369,83 @@ W.styles = pt`
|
|
|
1369
1369
|
`;
|
|
1370
1370
|
q([
|
|
1371
1371
|
h({ type: Boolean, attribute: !0 })
|
|
1372
|
-
],
|
|
1372
|
+
], C.prototype, "hours", 2);
|
|
1373
1373
|
q([
|
|
1374
1374
|
h({ type: Boolean, attribute: !0 })
|
|
1375
|
-
],
|
|
1375
|
+
], C.prototype, "minutes", 2);
|
|
1376
1376
|
q([
|
|
1377
1377
|
h({ type: Boolean, attribute: !0 })
|
|
1378
|
-
],
|
|
1378
|
+
], C.prototype, "seconds", 2);
|
|
1379
1379
|
q([
|
|
1380
1380
|
h({ type: Boolean, attribute: !0 })
|
|
1381
|
-
],
|
|
1381
|
+
], C.prototype, "fractionalSeconds", 2);
|
|
1382
1382
|
q([
|
|
1383
1383
|
h({ type: Boolean, attribute: !0 })
|
|
1384
|
-
],
|
|
1384
|
+
], C.prototype, "dayPeriod", 2);
|
|
1385
1385
|
q([
|
|
1386
1386
|
h({ type: String, attribute: !0 })
|
|
1387
|
-
],
|
|
1387
|
+
], C.prototype, "hourFormat", 2);
|
|
1388
1388
|
q([
|
|
1389
1389
|
k('input[part="segment-input segment-input-hour"]')
|
|
1390
|
-
],
|
|
1390
|
+
], C.prototype, "hourInput", 2);
|
|
1391
1391
|
q([
|
|
1392
1392
|
k('input[part="segment-input segment-input-minute"]')
|
|
1393
|
-
],
|
|
1393
|
+
], C.prototype, "minuteInput", 2);
|
|
1394
1394
|
q([
|
|
1395
1395
|
k('input[part="segment-input segment-input-second"]')
|
|
1396
|
-
],
|
|
1396
|
+
], C.prototype, "secondInput", 2);
|
|
1397
1397
|
q([
|
|
1398
1398
|
k('input[part="segment-input segment-input-fractionalSecond"]')
|
|
1399
|
-
],
|
|
1399
|
+
], C.prototype, "fractionalSecondInput", 2);
|
|
1400
1400
|
q([
|
|
1401
1401
|
k('input[part="segment-input segment-input-dayPeriod"]')
|
|
1402
|
-
],
|
|
1402
|
+
], C.prototype, "dayPeriodInput", 2);
|
|
1403
1403
|
q([
|
|
1404
1404
|
h({ type: Boolean })
|
|
1405
|
-
],
|
|
1405
|
+
], C.prototype, "disabled", 1);
|
|
1406
1406
|
q([
|
|
1407
1407
|
h({ type: Boolean, attribute: "readonly" })
|
|
1408
|
-
],
|
|
1408
|
+
], C.prototype, "readOnly", 1);
|
|
1409
1409
|
q([
|
|
1410
1410
|
h({ type: String, attribute: !0 })
|
|
1411
|
-
],
|
|
1411
|
+
], C.prototype, "value", 1);
|
|
1412
1412
|
q([
|
|
1413
1413
|
h({ type: String, attribute: !0 })
|
|
1414
|
-
],
|
|
1414
|
+
], C.prototype, "locale", 2);
|
|
1415
1415
|
q([
|
|
1416
1416
|
h({ type: String, attribute: !0 })
|
|
1417
|
-
],
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
],
|
|
1421
|
-
var
|
|
1417
|
+
], C.prototype, "format", 2);
|
|
1418
|
+
C = q([
|
|
1419
|
+
it("use-time")
|
|
1420
|
+
], C);
|
|
1421
|
+
var Cn = Object.defineProperty, Wn = Object.getOwnPropertyDescriptor, nr = (t) => {
|
|
1422
1422
|
throw TypeError(t);
|
|
1423
|
-
},
|
|
1424
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1423
|
+
}, ui = (t, e, i, s) => {
|
|
1424
|
+
for (var a = s > 1 ? void 0 : s ? Wn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1425
1425
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1426
|
-
return s && a &&
|
|
1427
|
-
},
|
|
1426
|
+
return s && a && Cn(e, i, a), a;
|
|
1427
|
+
}, Rs = (t, e, i) => e.has(t) || nr("Cannot " + i), ht = (t, e, i) => (Rs(t, e, "read from private field"), i ? i.call(t) : e.get(t)), sa = (t, e, i) => e.has(t) ? nr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Fn = (t, e, i, s) => (Rs(t, e, "write to private field"), e.set(t, i), i), aa = (t, e, i) => (Rs(t, e, "access private method"), i), Z, Ai, us;
|
|
1428
1428
|
let Pt = class extends I {
|
|
1429
1429
|
constructor() {
|
|
1430
|
-
super(), sa(this,
|
|
1430
|
+
super(), sa(this, Ai), sa(this, Z), Fn(this, Z, this.attachInternals()), this.id || (this.id = xt()), this.hasAttribute("selected") && ht(this, Z).states.add("selected"), (this.hasAttribute("disabled") || aa(this, Ai, us).call(this)) && ht(this, Z).states.add("disabled"), this.parentElement instanceof Pt && (this.slot = "tree-items"), this.querySelector("use-treeitem") && ht(this, Z).states.add("has-children");
|
|
1431
1431
|
}
|
|
1432
1432
|
set selected(t) {
|
|
1433
|
-
t ? ht(this,
|
|
1433
|
+
t ? ht(this, Z).states.add("selected") : ht(this, Z).states.delete("selected");
|
|
1434
1434
|
}
|
|
1435
1435
|
get selected() {
|
|
1436
|
-
return ht(this,
|
|
1436
|
+
return ht(this, Z).states.has("selected");
|
|
1437
1437
|
}
|
|
1438
1438
|
set disabled(t) {
|
|
1439
|
-
t ? ht(this,
|
|
1439
|
+
t ? ht(this, Z).states.add("disabled") : ht(this, Z).states.delete("disabled");
|
|
1440
1440
|
}
|
|
1441
1441
|
get disabled() {
|
|
1442
|
-
return ht(this,
|
|
1442
|
+
return ht(this, Z).states.has("disabled") || aa(this, Ai, us).call(this);
|
|
1443
1443
|
}
|
|
1444
1444
|
set expanded(t) {
|
|
1445
|
-
t ? ht(this,
|
|
1445
|
+
t ? ht(this, Z).states.add("expanded") : ht(this, Z).states.delete("expanded");
|
|
1446
1446
|
}
|
|
1447
1447
|
get expanded() {
|
|
1448
|
-
return ht(this,
|
|
1448
|
+
return ht(this, Z).states.has("expanded");
|
|
1449
1449
|
}
|
|
1450
1450
|
set value(t) {
|
|
1451
1451
|
t != null && this.setAttribute("value", t);
|
|
@@ -1466,7 +1466,7 @@ let Pt = class extends I {
|
|
|
1466
1466
|
!!this.querySelector("use-treeitem") ? this.setAttribute("aria-expanded", this.expanded ? "true" : "false") : this.removeAttribute("aria-expanded");
|
|
1467
1467
|
}
|
|
1468
1468
|
render() {
|
|
1469
|
-
return
|
|
1469
|
+
return y`
|
|
1470
1470
|
<div part="content">
|
|
1471
1471
|
<div part="toggle-indicator" aria-hidden="true" @click=${this.toggle}>
|
|
1472
1472
|
<slot name="expanded-indicator" part="expanded-indicator">
|
|
@@ -1487,8 +1487,8 @@ let Pt = class extends I {
|
|
|
1487
1487
|
`;
|
|
1488
1488
|
}
|
|
1489
1489
|
};
|
|
1490
|
-
|
|
1491
|
-
|
|
1490
|
+
Z = /* @__PURE__ */ new WeakMap();
|
|
1491
|
+
Ai = /* @__PURE__ */ new WeakSet();
|
|
1492
1492
|
us = function() {
|
|
1493
1493
|
return this.parentElement instanceof Pt && this.parentElement.hasAttribute("disabled");
|
|
1494
1494
|
};
|
|
@@ -1562,38 +1562,38 @@ Pt.styles = pt`
|
|
|
1562
1562
|
background-color: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
|
1563
1563
|
}
|
|
1564
1564
|
`;
|
|
1565
|
-
|
|
1565
|
+
ui([
|
|
1566
1566
|
h({ type: Boolean })
|
|
1567
1567
|
], Pt.prototype, "selected", 1);
|
|
1568
|
-
|
|
1568
|
+
ui([
|
|
1569
1569
|
h({ type: Boolean })
|
|
1570
1570
|
], Pt.prototype, "disabled", 1);
|
|
1571
|
-
|
|
1571
|
+
ui([
|
|
1572
1572
|
h({ type: Boolean })
|
|
1573
1573
|
], Pt.prototype, "expanded", 1);
|
|
1574
|
-
|
|
1574
|
+
ui([
|
|
1575
1575
|
h()
|
|
1576
1576
|
], Pt.prototype, "value", 1);
|
|
1577
|
-
Pt =
|
|
1578
|
-
|
|
1577
|
+
Pt = ui([
|
|
1578
|
+
it("use-treeitem")
|
|
1579
1579
|
], Pt);
|
|
1580
|
-
var
|
|
1580
|
+
var Un = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, or = (t) => {
|
|
1581
1581
|
throw TypeError(t);
|
|
1582
1582
|
}, Ne = (t, e, i, s) => {
|
|
1583
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1583
|
+
for (var a = s > 1 ? void 0 : s ? Ln(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1584
1584
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1585
|
-
return s && a &&
|
|
1586
|
-
},
|
|
1587
|
-
const
|
|
1585
|
+
return s && a && Un(e, i, a), a;
|
|
1586
|
+
}, Ns = (t, e, i) => e.has(t) || or("Cannot " + i), g = (t, e, i) => (Ns(t, e, "read from private field"), i ? i.call(t) : e.get(t)), we = (t, e, i) => e.has(t) ? or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Qe = (t, e, i, s) => (Ns(t, e, "write to private field"), e.set(t, i), i), Ft = (t, e, i) => (Ns(t, e, "access private method"), i), ki, Gt, dt, be, L, lr, hr, dr, ur, Bs, cr, pr, te, Ut, fr;
|
|
1587
|
+
const Rn = "__value";
|
|
1588
1588
|
let qt = class extends I {
|
|
1589
1589
|
constructor() {
|
|
1590
|
-
super(), we(this,
|
|
1590
|
+
super(), we(this, L), we(this, ki), we(this, Gt), we(this, dt, new FormData()), this.multiple = !1, this.lazyItems = [], we(this, be, null), we(this, te, null), Qe(this, ki, xt()), Qe(this, Gt, this.attachInternals()), this.hasAttribute("disabled") && g(this, Gt).states.add("disabled"), this.addEventListener("focusin", Ft(this, L, hr)), this.addEventListener("focusout", Ft(this, L, dr));
|
|
1591
1591
|
}
|
|
1592
1592
|
set disabled(t) {
|
|
1593
|
-
t ?
|
|
1593
|
+
t ? g(this, Gt).states.add("disabled") : g(this, Gt).states.delete("disabled");
|
|
1594
1594
|
}
|
|
1595
1595
|
get disabled() {
|
|
1596
|
-
return
|
|
1596
|
+
return g(this, Gt).states.has("disabled");
|
|
1597
1597
|
}
|
|
1598
1598
|
/**
|
|
1599
1599
|
* UseTreeItem[]
|
|
@@ -1606,31 +1606,31 @@ let qt = class extends I {
|
|
|
1606
1606
|
return this.lazyQueryItems().find((t) => t.selected);
|
|
1607
1607
|
}
|
|
1608
1608
|
getId() {
|
|
1609
|
-
return this.id ? this.id :
|
|
1609
|
+
return this.id ? this.id : g(this, ki);
|
|
1610
1610
|
}
|
|
1611
1611
|
get activeOption() {
|
|
1612
|
-
return
|
|
1612
|
+
return g(this, te);
|
|
1613
1613
|
}
|
|
1614
1614
|
set activeOption(t) {
|
|
1615
|
-
|
|
1615
|
+
g(this, te)?.setAttribute("tabindex", "-1"), Qe(this, te, t), t?.setAttribute("tabindex", "0");
|
|
1616
1616
|
}
|
|
1617
1617
|
firstUpdated() {
|
|
1618
|
-
Ft(this,
|
|
1618
|
+
Ft(this, L, cr).call(this), Ft(this, L, pr).call(this), this.setAttribute("role", "tree"), this.hasAttribute("disabled") || (this.activeOption = this.firstSelected ?? this.lazyQueryItems().at(0) ?? null, this.setAttribute("tabindex", "0"));
|
|
1619
1619
|
}
|
|
1620
1620
|
updated() {
|
|
1621
1621
|
this.multiple ? this.setAttribute("aria-multiselectable", "true") : this.removeAttribute("aria-multiselectable");
|
|
1622
1622
|
}
|
|
1623
1623
|
set value(t) {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
}) :
|
|
1627
|
-
const e =
|
|
1624
|
+
g(this, dt).delete(g(this, L, Ut)), this.multiple ? Array.isArray(t) ? t.forEach((s) => {
|
|
1625
|
+
g(this, dt).append(g(this, L, Ut), s);
|
|
1626
|
+
}) : g(this, dt).append(g(this, L, Ut), t) : Array.isArray(t) && t.length > 0 ? g(this, dt).set(g(this, L, Ut), t[0]) : typeof t == "string" && t.length > 0 && g(this, dt).set(g(this, L, Ut), t);
|
|
1627
|
+
const e = g(this, dt).getAll(g(this, L, Ut));
|
|
1628
1628
|
this.queryLazyAvailableItems().forEach((s) => {
|
|
1629
1629
|
s.selected = e.includes(s.getAttribute("value") ?? s.textContent ?? "");
|
|
1630
|
-
}),
|
|
1630
|
+
}), g(this, Gt).setFormValue(g(this, dt)), this.dispatchEvent(
|
|
1631
1631
|
new CustomEvent("use-change", {
|
|
1632
1632
|
detail: {
|
|
1633
|
-
value: this.multiple ? e :
|
|
1633
|
+
value: this.multiple ? e : g(this, dt).get(g(this, L, Ut)) ?? null
|
|
1634
1634
|
},
|
|
1635
1635
|
bubbles: !0,
|
|
1636
1636
|
composed: !0
|
|
@@ -1638,7 +1638,7 @@ let qt = class extends I {
|
|
|
1638
1638
|
);
|
|
1639
1639
|
}
|
|
1640
1640
|
get value() {
|
|
1641
|
-
return
|
|
1641
|
+
return g(this, dt);
|
|
1642
1642
|
}
|
|
1643
1643
|
lazyQueryItems() {
|
|
1644
1644
|
return Array.from(this.querySelectorAll("use-treeitem"));
|
|
@@ -1654,13 +1654,13 @@ let qt = class extends I {
|
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
1656
|
render() {
|
|
1657
|
-
return
|
|
1657
|
+
return y`
|
|
1658
1658
|
<div
|
|
1659
1659
|
role="tree"
|
|
1660
1660
|
part="tree"
|
|
1661
|
-
@mousedown=${Ft(this,
|
|
1662
|
-
@click=${Ft(this,
|
|
1663
|
-
@keydown=${Ft(this,
|
|
1661
|
+
@mousedown=${Ft(this, L, lr)}
|
|
1662
|
+
@click=${Ft(this, L, ur)}
|
|
1663
|
+
@keydown=${Ft(this, L, fr)}
|
|
1664
1664
|
>
|
|
1665
1665
|
<slot name="expanded-indicator" part="expanded-indicator"></slot>
|
|
1666
1666
|
<slot name="collapsed-indicator" part="collapsed-indicator"></slot>
|
|
@@ -1670,33 +1670,33 @@ let qt = class extends I {
|
|
|
1670
1670
|
`;
|
|
1671
1671
|
}
|
|
1672
1672
|
};
|
|
1673
|
-
|
|
1674
|
-
|
|
1673
|
+
ki = /* @__PURE__ */ new WeakMap();
|
|
1674
|
+
Gt = /* @__PURE__ */ new WeakMap();
|
|
1675
1675
|
dt = /* @__PURE__ */ new WeakMap();
|
|
1676
|
-
|
|
1677
|
-
|
|
1676
|
+
be = /* @__PURE__ */ new WeakMap();
|
|
1677
|
+
L = /* @__PURE__ */ new WeakSet();
|
|
1678
1678
|
lr = function(t) {
|
|
1679
|
-
|
|
1679
|
+
Qe(this, be, t.target), g(this, be)?.setAttribute("tabindex", "0");
|
|
1680
1680
|
};
|
|
1681
1681
|
hr = function(t) {
|
|
1682
1682
|
let e = t.target;
|
|
1683
|
-
|
|
1683
|
+
g(this, be) ? e = g(this, be) : e === this && (e = this.activeOption), this.activeOption = e, e?.focus(), this.setAttribute("tabindex", "-1");
|
|
1684
1684
|
};
|
|
1685
1685
|
dr = function(t) {
|
|
1686
1686
|
if (t.relatedTarget === this) {
|
|
1687
|
-
|
|
1687
|
+
g(this, te) && (this.activeOption = g(this, te), g(this, te).focus(), this.setAttribute("tabindex", "-1"));
|
|
1688
1688
|
return;
|
|
1689
1689
|
}
|
|
1690
1690
|
this.contains(t.relatedTarget) || this.setAttribute("tabindex", "0");
|
|
1691
1691
|
};
|
|
1692
1692
|
ur = function(t) {
|
|
1693
|
-
if (
|
|
1693
|
+
if (Qe(this, be, null), this.disabled)
|
|
1694
1694
|
return;
|
|
1695
1695
|
const i = t.target?.closest("use-treeitem");
|
|
1696
|
-
i?.disabled || i?.value != null && (t.preventDefault(), t.composedPath().some((a) => a instanceof HTMLElement ? a.getAttribute("part") === "toggle-indicator" : !1) || Ft(this,
|
|
1696
|
+
i?.disabled || i?.value != null && (t.preventDefault(), t.composedPath().some((a) => a instanceof HTMLElement ? a.getAttribute("part") === "toggle-indicator" : !1) || Ft(this, L, Bs).call(this, i));
|
|
1697
1697
|
};
|
|
1698
1698
|
Bs = function(t) {
|
|
1699
|
-
let e =
|
|
1699
|
+
let e = g(this, dt).getAll(g(this, L, Ut));
|
|
1700
1700
|
const i = t.value;
|
|
1701
1701
|
i == null || t.disabled || (t.selected ? e = e.filter((s) => s !== i) : this.multiple ? e.push(i) : e = [i], this.value = e);
|
|
1702
1702
|
};
|
|
@@ -1711,19 +1711,19 @@ pr = function() {
|
|
|
1711
1711
|
r && (r.slot = "expanded-indicator", a.appendChild(r));
|
|
1712
1712
|
const n = i?.cloneNode(!0);
|
|
1713
1713
|
n && (n.slot = "collapsed-indicator", a.appendChild(n));
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1714
|
+
const p = s?.cloneNode(!0);
|
|
1715
|
+
p && (p.slot = "selected-indicator", a.appendChild(p));
|
|
1716
1716
|
});
|
|
1717
1717
|
};
|
|
1718
|
-
|
|
1718
|
+
te = /* @__PURE__ */ new WeakMap();
|
|
1719
1719
|
Ut = function() {
|
|
1720
|
-
return this.name ??
|
|
1720
|
+
return this.name ?? Rn;
|
|
1721
1721
|
};
|
|
1722
1722
|
fr = function(t) {
|
|
1723
1723
|
if (this.disabled)
|
|
1724
1724
|
return;
|
|
1725
1725
|
if (["Enter", " "].includes(t.key) && this.activeOption) {
|
|
1726
|
-
t.preventDefault(), Ft(this,
|
|
1726
|
+
t.preventDefault(), Ft(this, L, Bs).call(this, this.activeOption);
|
|
1727
1727
|
return;
|
|
1728
1728
|
}
|
|
1729
1729
|
const e = this.queryLazyAvailableItems(), i = this.activeOption?.id, s = i ? e.findIndex((r) => r.id === i) : -1;
|
|
@@ -1783,33 +1783,33 @@ Ne([
|
|
|
1783
1783
|
k('[part="tree"]', !0)
|
|
1784
1784
|
], qt.prototype, "tree", 2);
|
|
1785
1785
|
qt = Ne([
|
|
1786
|
-
|
|
1786
|
+
it("use-tree")
|
|
1787
1787
|
], qt);
|
|
1788
1788
|
const $e = "data-usewc-focusgroup-tabindex", es = "initial";
|
|
1789
1789
|
function is(t) {
|
|
1790
1790
|
return t instanceof Fi;
|
|
1791
1791
|
}
|
|
1792
|
-
var
|
|
1792
|
+
var J, ni, oi, li, hi, Jt, ce, pe, jt, m, cs, gr, Lt, yr, ps, mr, xi, br, vr, Si, fe, _r, wr;
|
|
1793
1793
|
const ea = class ea extends HTMLElement {
|
|
1794
1794
|
constructor() {
|
|
1795
1795
|
super();
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
this.features = "", this.focusedElement = null,
|
|
1796
|
+
st(this, m);
|
|
1797
|
+
st(this, J);
|
|
1798
|
+
st(this, ni);
|
|
1799
|
+
st(this, oi);
|
|
1800
|
+
st(this, li);
|
|
1801
|
+
st(this, hi);
|
|
1802
|
+
st(this, Jt);
|
|
1803
|
+
st(this, ce);
|
|
1804
|
+
st(this, pe);
|
|
1805
|
+
st(this, jt);
|
|
1806
|
+
st(this, Lt);
|
|
1807
|
+
st(this, fe);
|
|
1808
|
+
this.features = "", this.focusedElement = null, W(this, J, []), W(this, Jt, !1), W(this, ce, !0), W(this, pe, null), W(this, jt, !1), W(this, Lt, null), W(this, fe, !1);
|
|
1809
1809
|
}
|
|
1810
1810
|
connectedCallback() {
|
|
1811
|
-
B(this, m, cs).call(this),
|
|
1812
|
-
B(this, m,
|
|
1811
|
+
B(this, m, cs).call(this), W(this, pe, this.parentElement?.closest("use-focusgroup")), W(this, jt, b(this, pe) != null), setTimeout(() => {
|
|
1812
|
+
B(this, m, Si).call(this);
|
|
1813
1813
|
}, 0), B(this, m, gr).call(this);
|
|
1814
1814
|
}
|
|
1815
1815
|
disconnectedCallback() {
|
|
@@ -1819,7 +1819,7 @@ const ea = class ea extends HTMLElement {
|
|
|
1819
1819
|
i === "features" && B(this, m, cs).call(this);
|
|
1820
1820
|
}
|
|
1821
1821
|
focus() {
|
|
1822
|
-
this.focusedElement ? this.focusedElement.focus() : b(this,
|
|
1822
|
+
this.focusedElement ? this.focusedElement.focus() : b(this, J)[0].focus();
|
|
1823
1823
|
}
|
|
1824
1824
|
/**
|
|
1825
1825
|
* Whether the use-focusgroup is promoted to the top of the tab order inside a parent use-focusgroup.
|
|
@@ -1829,66 +1829,66 @@ const ea = class ea extends HTMLElement {
|
|
|
1829
1829
|
* @default false
|
|
1830
1830
|
*/
|
|
1831
1831
|
get promoted() {
|
|
1832
|
-
return b(this,
|
|
1832
|
+
return b(this, fe);
|
|
1833
1833
|
}
|
|
1834
1834
|
/**
|
|
1835
1835
|
* Promotes the use-focusgroup to the top of the tab order inside a parent use-focusgroup.
|
|
1836
1836
|
*/
|
|
1837
1837
|
promote() {
|
|
1838
|
-
|
|
1838
|
+
W(this, fe, !0);
|
|
1839
1839
|
}
|
|
1840
1840
|
};
|
|
1841
|
-
|
|
1841
|
+
J = new WeakMap(), ni = new WeakMap(), oi = new WeakMap(), li = new WeakMap(), hi = new WeakMap(), Jt = new WeakMap(), ce = new WeakMap(), pe = new WeakMap(), jt = new WeakMap(), m = new WeakSet(), cs = function() {
|
|
1842
1842
|
this.features = this.getAttribute("features") ?? "";
|
|
1843
1843
|
const i = ` ${this.features} `, s = i.includes(" inline "), a = i.includes(" block "), r = !a && !s || a && s;
|
|
1844
|
-
|
|
1844
|
+
W(this, ni, r || s ? "ArrowLeft" : "ArrowLeft-DISABLED"), W(this, oi, r || s ? "ArrowRight" : "ArrowRight-DISABLED"), W(this, li, r || a ? "ArrowDown" : "ArrowDown-DISABLED"), W(this, hi, r || a ? "ArrowUp" : "ArrowUp-DISABLED"), W(this, Jt, i.includes(" no-memory ")), W(this, ce, i.includes(" wrap "));
|
|
1845
1845
|
}, gr = function() {
|
|
1846
1846
|
this.addEventListener("keydown", (i) => {
|
|
1847
1847
|
let s = -1;
|
|
1848
1848
|
const a = i.target, r = a.closest("use-focusgroup");
|
|
1849
1849
|
switch (i.key) {
|
|
1850
|
-
case b(this, ni):
|
|
1851
1850
|
case b(this, oi):
|
|
1851
|
+
case b(this, li):
|
|
1852
1852
|
if (a.matches("select, input, textarea"))
|
|
1853
1853
|
break;
|
|
1854
|
-
const n = b(this,
|
|
1855
|
-
n < b(this,
|
|
1854
|
+
const n = b(this, J).indexOf(this === r ? i.target : r);
|
|
1855
|
+
n < b(this, J).length - 1 ? s = n + 1 : b(this, ce) && (s = 0);
|
|
1856
1856
|
break;
|
|
1857
|
-
case b(this,
|
|
1858
|
-
case b(this,
|
|
1857
|
+
case b(this, ni):
|
|
1858
|
+
case b(this, hi):
|
|
1859
1859
|
if (a.matches("select, input, textarea"))
|
|
1860
1860
|
break;
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1861
|
+
const p = b(this, J).indexOf(this === r ? i.target : r);
|
|
1862
|
+
p > 0 ? s = p - 1 : b(this, ce) && (s = b(this, J).length - 1);
|
|
1863
1863
|
break;
|
|
1864
1864
|
}
|
|
1865
|
-
s > -1 && (i.preventDefault(), i.stopPropagation(), b(this,
|
|
1865
|
+
s > -1 && (i.preventDefault(), i.stopPropagation(), b(this, J)[s].focus());
|
|
1866
1866
|
}), this.addEventListener("focusout", (i) => {
|
|
1867
|
-
this.contains(i.relatedTarget) && (b(this,
|
|
1867
|
+
this.contains(i.relatedTarget) && (b(this, jt) && b(this, pe)?.contains(i.target) && B(this, m, xi).call(this, i.target), b(this, jt) || B(this, m, xi).call(this, i.target));
|
|
1868
1868
|
}), this.addEventListener("focusin", (i) => {
|
|
1869
1869
|
i.stopPropagation(), i.preventDefault(), B(this, m, mr).call(this, i.target);
|
|
1870
1870
|
}), this.addEventListener(
|
|
1871
1871
|
"toggle",
|
|
1872
1872
|
() => {
|
|
1873
|
-
B(this, m,
|
|
1873
|
+
B(this, m, Si).call(this, !0);
|
|
1874
1874
|
},
|
|
1875
1875
|
!0
|
|
1876
1876
|
);
|
|
1877
1877
|
}, Lt = new WeakMap(), yr = function() {
|
|
1878
|
-
b(this, Lt) || (
|
|
1879
|
-
B(this, m,
|
|
1878
|
+
b(this, Lt) || (W(this, Lt, new MutationObserver(() => {
|
|
1879
|
+
B(this, m, Si).call(this, !0);
|
|
1880
1880
|
})), b(this, Lt).observe(this, { attributes: !1, childList: !0, subtree: !0 }));
|
|
1881
1881
|
}, ps = function() {
|
|
1882
|
-
b(this, Lt)?.disconnect(),
|
|
1882
|
+
b(this, Lt)?.disconnect(), W(this, Lt, null);
|
|
1883
1883
|
}, mr = function(i) {
|
|
1884
|
-
if (i != null && !b(this,
|
|
1885
|
-
B(this, m,
|
|
1884
|
+
if (i != null && !b(this, Jt) && (this.focusedElement = i, b(this, J).forEach((s) => {
|
|
1885
|
+
B(this, m, xi).call(this, s);
|
|
1886
1886
|
}), !is(i))) {
|
|
1887
1887
|
const s = i.getAttribute($e);
|
|
1888
1888
|
s === es ? i.removeAttribute("tabindex") : s && i.setAttribute("tabindex", s);
|
|
1889
1889
|
}
|
|
1890
|
-
},
|
|
1891
|
-
b(this,
|
|
1890
|
+
}, xi = function(i) {
|
|
1891
|
+
b(this, Jt) || !is(i) && i.getAttribute($e) && i.setAttribute("tabindex", "-1");
|
|
1892
1892
|
}, br = function() {
|
|
1893
1893
|
const i = as(this, { getShadowRoot: !0 }), s = [];
|
|
1894
1894
|
for (const a of i) {
|
|
@@ -1897,53 +1897,53 @@ j = new WeakMap(), ri = new WeakMap(), ni = new WeakMap(), oi = new WeakMap(), l
|
|
|
1897
1897
|
}
|
|
1898
1898
|
return s.map((a) => a.getRootNode()?.host ?? a);
|
|
1899
1899
|
}, vr = function(i) {
|
|
1900
|
-
return i.shadowRoot?.delegatesFocus && i.getAttribute("tabindex") === null ? "0" : i.getAttribute("tabindex") === null ? es : String(
|
|
1901
|
-
},
|
|
1900
|
+
return i.shadowRoot?.delegatesFocus && i.getAttribute("tabindex") === null ? "0" : i.getAttribute("tabindex") === null ? es : String(di(i));
|
|
1901
|
+
}, Si = function(i = !1) {
|
|
1902
1902
|
i && B(this, m, _r).call(this), B(this, m, wr).call(this), B(this, m, ps).call(this), B(this, m, yr).call(this);
|
|
1903
|
-
},
|
|
1904
|
-
b(this,
|
|
1903
|
+
}, fe = new WeakMap(), _r = function() {
|
|
1904
|
+
b(this, J).forEach((i) => {
|
|
1905
1905
|
const s = i.getAttribute($e);
|
|
1906
1906
|
s === es ? i.removeAttribute("tabindex") : s && i.setAttribute("tabindex", s), i.removeAttribute($e);
|
|
1907
1907
|
});
|
|
1908
1908
|
}, wr = function() {
|
|
1909
|
-
|
|
1909
|
+
W(this, J, B(this, m, br).call(this)), b(this, J).forEach((i, s) => {
|
|
1910
1910
|
if (is(i)) {
|
|
1911
1911
|
s === 0 && i.promote();
|
|
1912
1912
|
return;
|
|
1913
1913
|
}
|
|
1914
|
-
i.hasAttribute($e) || i.setAttribute($e, B(this, m, vr).call(this, i)), (b(this,
|
|
1914
|
+
i.hasAttribute($e) || i.setAttribute($e, B(this, m, vr).call(this, i)), (b(this, Jt) || s === 0 && !this.focusedElement) && (this.focusedElement = i), (b(this, jt) && !b(this, fe) || s > 0) && i.setAttribute("tabindex", "-1");
|
|
1915
1915
|
});
|
|
1916
1916
|
}, ea.observedAttributes = ["features"];
|
|
1917
1917
|
let Fi = ea;
|
|
1918
1918
|
customElements.define("use-focusgroup", Fi);
|
|
1919
1919
|
var Nn = Object.getOwnPropertyDescriptor, $r = (t) => {
|
|
1920
1920
|
throw TypeError(t);
|
|
1921
|
-
},
|
|
1921
|
+
}, Bn = (t, e, i, s) => {
|
|
1922
1922
|
for (var a = s > 1 ? void 0 : s ? Nn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1923
1923
|
(n = t[r]) && (a = n(a) || a);
|
|
1924
1924
|
return a;
|
|
1925
|
-
}, Vs = (t, e, i) => e.has(t) || $r("Cannot " + i),
|
|
1925
|
+
}, Vs = (t, e, i) => e.has(t) || $r("Cannot " + i), U = (t, e, i) => (Vs(t, e, "read from private field"), i ? i.call(t) : e.get(t)), ci = (t, e, i) => e.has(t) ? $r("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Je = (t, e, i, s) => (Vs(t, e, "write to private field"), e.set(t, i), i), ze = (t, e, i) => (Vs(t, e, "access private method"), i), Xt, Q, oe, Dr, Ar, ye, kr, fs;
|
|
1926
1926
|
const ss = "data-usewc-widget-tabindex";
|
|
1927
1927
|
let ra = class extends I {
|
|
1928
1928
|
constructor() {
|
|
1929
|
-
super(...arguments),
|
|
1929
|
+
super(...arguments), ci(this, oe), ci(this, Xt, !1), ci(this, Q, []), ci(this, ye, null);
|
|
1930
1930
|
}
|
|
1931
1931
|
createRenderRoot() {
|
|
1932
1932
|
return this;
|
|
1933
1933
|
}
|
|
1934
1934
|
initializeWidget() {
|
|
1935
|
-
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"),
|
|
1936
|
-
t.setAttribute(ss,
|
|
1937
|
-
}),
|
|
1935
|
+
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), Je(this, Q, ze(this, oe, Dr).call(this)), U(this, Q).forEach((t) => {
|
|
1936
|
+
t.setAttribute(ss, ze(this, oe, Ar).call(this, t)), t.setAttribute("tabindex", "-1");
|
|
1937
|
+
}), ze(this, oe, fs).call(this), ze(this, oe, kr).call(this);
|
|
1938
1938
|
}
|
|
1939
1939
|
enableWidget(t = !0) {
|
|
1940
|
-
|
|
1940
|
+
U(this, Xt) || (Je(this, Xt, !0), this.setAttribute("active", ""), U(this, Q).forEach((e) => {
|
|
1941
1941
|
const i = e.getAttribute(ss);
|
|
1942
1942
|
i && e.setAttribute("tabindex", i);
|
|
1943
|
-
}), t &&
|
|
1943
|
+
}), t && U(this, Q).at(0)?.focus(), this.setAttribute("tabindex", "-1"));
|
|
1944
1944
|
}
|
|
1945
1945
|
disableWidget(t = !0) {
|
|
1946
|
-
|
|
1946
|
+
U(this, Xt) && (Je(this, Xt, !1), this.removeAttribute("active"), U(this, Q).forEach((e) => {
|
|
1947
1947
|
e.getAttribute(ss) && e.setAttribute("tabindex", "-1");
|
|
1948
1948
|
}), t && this.focus(), this.setAttribute("tabindex", "0"));
|
|
1949
1949
|
}
|
|
@@ -1958,24 +1958,24 @@ let ra = class extends I {
|
|
|
1958
1958
|
this.disableWidget();
|
|
1959
1959
|
break;
|
|
1960
1960
|
case "F2":
|
|
1961
|
-
|
|
1961
|
+
U(this, Xt) ? this.disableWidget() : this.enableWidget();
|
|
1962
1962
|
break;
|
|
1963
1963
|
}
|
|
1964
|
-
if (
|
|
1964
|
+
if (U(this, Xt))
|
|
1965
1965
|
switch (t.key) {
|
|
1966
1966
|
case "ArrowRight":
|
|
1967
1967
|
case "ArrowDown":
|
|
1968
1968
|
if (e.matches("select, input, textarea"))
|
|
1969
1969
|
break;
|
|
1970
|
-
const i =
|
|
1971
|
-
i <
|
|
1970
|
+
const i = U(this, Q).indexOf(t.target);
|
|
1971
|
+
i < U(this, Q).length - 1 ? U(this, Q)[i + 1].focus() : U(this, Q)[0].focus(), t.preventDefault(), t.stopPropagation();
|
|
1972
1972
|
break;
|
|
1973
1973
|
case "ArrowLeft":
|
|
1974
1974
|
case "ArrowUp":
|
|
1975
1975
|
if (e.matches("select, input, textarea"))
|
|
1976
1976
|
break;
|
|
1977
|
-
const s =
|
|
1978
|
-
s > 0 ?
|
|
1977
|
+
const s = U(this, Q).indexOf(t.target);
|
|
1978
|
+
s > 0 ? U(this, Q)[s - 1].focus() : U(this, Q)[U(this, Q).length - 1].focus(), t.preventDefault(), t.stopPropagation();
|
|
1979
1979
|
break;
|
|
1980
1980
|
}
|
|
1981
1981
|
}), this.addEventListener("click", () => {
|
|
@@ -1991,46 +1991,46 @@ let ra = class extends I {
|
|
|
1991
1991
|
);
|
|
1992
1992
|
}
|
|
1993
1993
|
disconnectedCallback() {
|
|
1994
|
-
|
|
1994
|
+
ze(this, oe, fs).call(this);
|
|
1995
1995
|
}
|
|
1996
1996
|
render() {
|
|
1997
|
-
return
|
|
1997
|
+
return y`<slot></slot>`;
|
|
1998
1998
|
}
|
|
1999
1999
|
};
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2000
|
+
Xt = /* @__PURE__ */ new WeakMap();
|
|
2001
|
+
Q = /* @__PURE__ */ new WeakMap();
|
|
2002
|
+
oe = /* @__PURE__ */ new WeakSet();
|
|
2003
2003
|
Dr = function() {
|
|
2004
2004
|
const t = document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT, {
|
|
2005
|
-
acceptNode: (i) => i instanceof HTMLElement && (
|
|
2005
|
+
acceptNode: (i) => i instanceof HTMLElement && (nn(i) || i.shadowRoot?.delegatesFocus) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
2006
2006
|
}), e = [];
|
|
2007
2007
|
for (; t.nextNode(); )
|
|
2008
2008
|
e.push(t.currentNode);
|
|
2009
2009
|
return e;
|
|
2010
2010
|
};
|
|
2011
2011
|
Ar = function(t) {
|
|
2012
|
-
return t.shadowRoot?.delegatesFocus && t.getAttribute("tabindex") === null ? "0" : String(
|
|
2012
|
+
return t.shadowRoot?.delegatesFocus && t.getAttribute("tabindex") === null ? "0" : String(di(t));
|
|
2013
2013
|
};
|
|
2014
|
-
|
|
2014
|
+
ye = /* @__PURE__ */ new WeakMap();
|
|
2015
2015
|
kr = function() {
|
|
2016
|
-
|
|
2016
|
+
U(this, ye) || (Je(this, ye, new MutationObserver(() => {
|
|
2017
2017
|
this.initializeWidget();
|
|
2018
|
-
})),
|
|
2018
|
+
})), U(this, ye).observe(this, { attributes: !1, childList: !0, subtree: !0 }));
|
|
2019
2019
|
};
|
|
2020
2020
|
fs = function() {
|
|
2021
|
-
|
|
2021
|
+
U(this, ye)?.disconnect(), Je(this, ye, null);
|
|
2022
2022
|
};
|
|
2023
|
-
ra =
|
|
2024
|
-
|
|
2023
|
+
ra = Bn([
|
|
2024
|
+
it("use-widget")
|
|
2025
2025
|
], ra);
|
|
2026
|
-
var
|
|
2026
|
+
var Vn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, xr = (t) => {
|
|
2027
2027
|
throw TypeError(t);
|
|
2028
2028
|
}, zs = (t, e, i, s) => {
|
|
2029
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2029
|
+
for (var a = s > 1 ? void 0 : s ? zn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
2030
2030
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
2031
|
-
return s && a &&
|
|
2032
|
-
}, qs = (t, e, i) => e.has(t) || xr("Cannot " + i), $t = (t, e, i) => (qs(t, e, "read from private field"), i ? i.call(t) : e.get(t)),
|
|
2033
|
-
const
|
|
2031
|
+
return s && a && Vn(e, i, a), a;
|
|
2032
|
+
}, qs = (t, e, i) => e.has(t) || xr("Cannot " + i), $t = (t, e, i) => (qs(t, e, "read from private field"), i ? i.call(t) : e.get(t)), qe = (t, e, i) => e.has(t) ? xr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Ui = (t, e, i, s) => (qs(t, e, "write to private field"), e.set(t, i), i), he = (t, e, i) => (qs(t, e, "access private method"), i), de, Ii, ue, ii, Rt, Sr, Ir, Ys, Er, Mr, Tr;
|
|
2033
|
+
const qn = "data-usewc-menu-tabindex", Yn = `
|
|
2034
2034
|
:is(
|
|
2035
2035
|
[role="menuitem"],
|
|
2036
2036
|
[role="menuitemcheckbox"],
|
|
@@ -2043,56 +2043,56 @@ const zn = "data-usewc-menu-tabindex", qn = `
|
|
|
2043
2043
|
[aria-hidden="true"]
|
|
2044
2044
|
))
|
|
2045
2045
|
`;
|
|
2046
|
-
let
|
|
2046
|
+
let Fe = class extends I {
|
|
2047
2047
|
constructor() {
|
|
2048
|
-
super(),
|
|
2048
|
+
super(), qe(this, Rt), qe(this, de, []), qe(this, Ii), qe(this, ue), qe(this, ii, []), this.trigger = null, Ui(this, Ii, xt()), Ui(this, ue, this.attachInternals()), he(this, Rt, Ys).call(this), this.hasAttribute("disabled") && $t(this, ue).states.add("disabled");
|
|
2049
2049
|
}
|
|
2050
2050
|
set disabled(t) {
|
|
2051
|
-
|
|
2051
|
+
he(this, Rt, Er).call(this, t);
|
|
2052
2052
|
}
|
|
2053
2053
|
get disabled() {
|
|
2054
|
-
return $t(this,
|
|
2054
|
+
return $t(this, ue).states.has("disabled");
|
|
2055
2055
|
}
|
|
2056
2056
|
getId() {
|
|
2057
|
-
return this.id ? this.id : $t(this,
|
|
2057
|
+
return this.id ? this.id : $t(this, Ii);
|
|
2058
2058
|
}
|
|
2059
2059
|
firstUpdated() {
|
|
2060
2060
|
this.trigger = this.shadowRoot?.querySelector('button[part="trigger"]') ?? null;
|
|
2061
2061
|
}
|
|
2062
2062
|
render() {
|
|
2063
|
-
return
|
|
2064
|
-
<div role="menu" part="menu" @keydown=${
|
|
2065
|
-
<slot @slotchange=${
|
|
2063
|
+
return y`
|
|
2064
|
+
<div role="menu" part="menu" @keydown=${he(this, Rt, Mr)}>
|
|
2065
|
+
<slot @slotchange=${he(this, Rt, Tr)}></slot>
|
|
2066
2066
|
</div>
|
|
2067
2067
|
`;
|
|
2068
2068
|
}
|
|
2069
2069
|
};
|
|
2070
|
-
he = /* @__PURE__ */ new WeakMap();
|
|
2071
|
-
Si = /* @__PURE__ */ new WeakMap();
|
|
2072
2070
|
de = /* @__PURE__ */ new WeakMap();
|
|
2073
|
-
|
|
2074
|
-
|
|
2071
|
+
Ii = /* @__PURE__ */ new WeakMap();
|
|
2072
|
+
ue = /* @__PURE__ */ new WeakMap();
|
|
2073
|
+
ii = /* @__PURE__ */ new WeakMap();
|
|
2074
|
+
Rt = /* @__PURE__ */ new WeakSet();
|
|
2075
2075
|
Sr = function() {
|
|
2076
|
-
return Array.from(this.querySelectorAll(
|
|
2076
|
+
return Array.from(this.querySelectorAll(Yn)).filter((t) => t.parentElement?.closest("use-menu") === this);
|
|
2077
2077
|
};
|
|
2078
2078
|
Ir = function(t) {
|
|
2079
|
-
return t.shadowRoot?.delegatesFocus || t.getAttribute("tabindex") === null ? null : String(
|
|
2079
|
+
return t.shadowRoot?.delegatesFocus || t.getAttribute("tabindex") === null ? null : String(di(t));
|
|
2080
2080
|
};
|
|
2081
2081
|
Ys = function() {
|
|
2082
|
-
Ui(this,
|
|
2083
|
-
const t = $t(this,
|
|
2084
|
-
$t(this,
|
|
2082
|
+
Ui(this, de, he(this, Rt, Sr).call(this)), Ui(this, ii, []);
|
|
2083
|
+
const t = $t(this, de).find((e) => e.matches("[aria-current]")) ?? $t(this, de)[0];
|
|
2084
|
+
$t(this, de).forEach((e, i) => {
|
|
2085
2085
|
const s = e.textContent?.trim();
|
|
2086
|
-
s && s && ($t(this,
|
|
2087
|
-
const a =
|
|
2088
|
-
a != null && e.setAttribute(
|
|
2086
|
+
s && s && ($t(this, ii)[i] = s);
|
|
2087
|
+
const a = he(this, Rt, Ir).call(this, e);
|
|
2088
|
+
a != null && e.setAttribute(qn, a), e !== t && e.setAttribute("tabindex", "-1");
|
|
2089
2089
|
});
|
|
2090
2090
|
};
|
|
2091
2091
|
Er = async function(t) {
|
|
2092
|
-
await this.updateComplete, t ? ($t(this,
|
|
2092
|
+
await this.updateComplete, t ? ($t(this, ue).states.add("disabled"), this.trigger?.setAttribute("disabled", "disabled")) : ($t(this, ue).states.delete("disabled"), this.trigger?.removeAttribute("disabled")), this.trigger && (this.trigger.disabled = t);
|
|
2093
2093
|
};
|
|
2094
2094
|
Mr = function(t) {
|
|
2095
|
-
const e = $t(this,
|
|
2095
|
+
const e = $t(this, de), i = e.findIndex((a) => a === document.activeElement);
|
|
2096
2096
|
let s;
|
|
2097
2097
|
switch (t.key) {
|
|
2098
2098
|
case "ArrowUp":
|
|
@@ -2109,19 +2109,19 @@ Mr = function(t) {
|
|
|
2109
2109
|
break;
|
|
2110
2110
|
}
|
|
2111
2111
|
if (!s && t.key.match(/^[\w\d]$/)) {
|
|
2112
|
-
const a = $t(this,
|
|
2112
|
+
const a = $t(this, ii).findIndex((r) => r.toLowerCase().startsWith(t.key.toLowerCase()));
|
|
2113
2113
|
a > -1 && (s = e[a]);
|
|
2114
2114
|
}
|
|
2115
2115
|
s && (s.focus(), s.setAttribute("tabindex", "0"), e[i].setAttribute("tabindex", "-1"));
|
|
2116
2116
|
};
|
|
2117
2117
|
Tr = function() {
|
|
2118
|
-
|
|
2118
|
+
he(this, Rt, Ys).call(this);
|
|
2119
2119
|
};
|
|
2120
|
-
|
|
2120
|
+
Fe.shadowRootOptions = {
|
|
2121
2121
|
...I.shadowRootOptions,
|
|
2122
2122
|
delegatesFocus: !0
|
|
2123
2123
|
};
|
|
2124
|
-
|
|
2124
|
+
Fe.styles = pt`
|
|
2125
2125
|
:host(:state(disabled)) {
|
|
2126
2126
|
pointer-events: none;
|
|
2127
2127
|
}
|
|
@@ -2142,21 +2142,21 @@ We.styles = pt`
|
|
|
2142
2142
|
`;
|
|
2143
2143
|
zs([
|
|
2144
2144
|
h({ type: Boolean, reflect: !0 })
|
|
2145
|
-
],
|
|
2145
|
+
], Fe.prototype, "disabled", 1);
|
|
2146
2146
|
zs([
|
|
2147
2147
|
h()
|
|
2148
|
-
],
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
],
|
|
2148
|
+
], Fe.prototype, "label", 2);
|
|
2149
|
+
Fe = zs([
|
|
2150
|
+
it("use-menu")
|
|
2151
|
+
], Fe);
|
|
2152
2152
|
const Or = "initial";
|
|
2153
2153
|
function Pr(t) {
|
|
2154
|
-
return t.shadowRoot?.delegatesFocus && t.getAttribute("tabindex") === null ? "0" : t.getAttribute("tabindex") === null ? Or : String(
|
|
2154
|
+
return t.shadowRoot?.delegatesFocus && t.getAttribute("tabindex") === null ? "0" : t.getAttribute("tabindex") === null ? Or : String(di(t));
|
|
2155
2155
|
}
|
|
2156
|
-
var
|
|
2157
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2156
|
+
var Kn = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Cr = (t, e, i, s) => {
|
|
2157
|
+
for (var a = s > 1 ? void 0 : s ? Hn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
2158
2158
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
2159
|
-
return s && a &&
|
|
2159
|
+
return s && a && Kn(e, i, a), a;
|
|
2160
2160
|
};
|
|
2161
2161
|
let gs = class extends I {
|
|
2162
2162
|
createRenderRoot() {
|
|
@@ -2173,30 +2173,30 @@ Cr([
|
|
|
2173
2173
|
h()
|
|
2174
2174
|
], gs.prototype, "date", 2);
|
|
2175
2175
|
gs = Cr([
|
|
2176
|
-
|
|
2176
|
+
it("use-calendarday")
|
|
2177
2177
|
], gs);
|
|
2178
|
-
var
|
|
2178
|
+
var Gn = Object.defineProperty, Xn = Object.getOwnPropertyDescriptor, Wr = (t) => {
|
|
2179
2179
|
throw TypeError(t);
|
|
2180
|
-
},
|
|
2181
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2180
|
+
}, X = (t, e, i, s) => {
|
|
2181
|
+
for (var a = s > 1 ? void 0 : s ? Xn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
2182
2182
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
2183
|
-
return s && a &&
|
|
2184
|
-
}, Ks = (t, e, i) => e.has(t) || Wr("Cannot " + i), o = (t, e, i) => (Ks(t, e, "read from private field"), i ? i.call(t) : e.get(t)), V = (t, e, i) => e.has(t) ? Wr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i),
|
|
2185
|
-
const
|
|
2183
|
+
return s && a && Gn(e, i, a), a;
|
|
2184
|
+
}, Ks = (t, e, i) => e.has(t) || Wr("Cannot " + i), o = (t, e, i) => (Ks(t, e, "read from private field"), i ? i.call(t) : e.get(t)), V = (t, e, i) => e.has(t) ? Wr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), O = (t, e, i, s) => (Ks(t, e, "write to private field"), e.set(t, i), i), d = (t, e, i) => (Ks(t, e, "access private method"), i), Me, j, Ge, l, Xe, Fr, Hs, rt, Et, $, yt, si, ys, Oe, Mt, Li, Ur, ai, Ri, Gs, Lr, Rr, Xs, Nr, Br, Vr, Yt, Vt, Zs, zr, qr, Yr, Ei, ms, ie, At, Kr, Hr, ri, Gr, Qs, Ki, Ue, Xr, Zr, Qr, Jr, jr, Js, Se, tn, bs, js, Mi, Ti, en;
|
|
2185
|
+
const Ni = "data-usewc-calendar-tabindex";
|
|
2186
2186
|
let R = class extends I {
|
|
2187
2187
|
constructor() {
|
|
2188
|
-
super(), V(this, l), V(this, Me), V(this,
|
|
2188
|
+
super(), V(this, l), V(this, Me), V(this, j, new FormData()), V(this, Ge, !1), this.year = (/* @__PURE__ */ new Date()).getFullYear(), this.month = (/* @__PURE__ */ new Date()).getMonth() + 1, this.locale = navigator.language, this.controls = !1, this.navigation = "on", this.hiddenmonths = "", this.focusmode = "cell", this.name = "", this.selected = [], V(this, rt, null), V(this, Et, null), V(this, $, new Date(this.year, this.month - 1, 1)), V(this, yt, "days"), V(this, si, null), V(this, ys, new Intl.DateTimeFormat(navigator.language, {
|
|
2189
2189
|
month: "long",
|
|
2190
2190
|
year: "numeric",
|
|
2191
2191
|
day: "numeric",
|
|
2192
2192
|
timeZone: "UTC"
|
|
2193
|
-
}).format(/* @__PURE__ */ new Date())), V(this, Vt, /* @__PURE__ */ new Map()), this.renderDay = ({ day: t }) => String(t), V(this, At, []), V(this,
|
|
2193
|
+
}).format(/* @__PURE__ */ new Date())), V(this, Vt, /* @__PURE__ */ new Map()), this.renderDay = ({ day: t }) => String(t), V(this, At, []), V(this, ri, null), V(this, bs, () => {
|
|
2194
2194
|
const t = o(this, yt) !== "picker";
|
|
2195
2195
|
if (t) {
|
|
2196
2196
|
const e = this.shadowRoot?.querySelector('[part="grid"]');
|
|
2197
|
-
|
|
2197
|
+
O(this, si, e?.offsetHeight ?? null);
|
|
2198
2198
|
}
|
|
2199
|
-
|
|
2199
|
+
O(this, yt, t ? "picker" : "days"), this.requestUpdate(), t && this.updateComplete.then(() => {
|
|
2200
2200
|
const e = this.shadowRoot?.querySelector('[part="picker"]'), i = this.shadowRoot?.querySelector('[part~="picker-month-current"]');
|
|
2201
2201
|
if (e && i) {
|
|
2202
2202
|
const s = e.getBoundingClientRect(), a = i.getBoundingClientRect();
|
|
@@ -2205,13 +2205,13 @@ let R = class extends I {
|
|
|
2205
2205
|
i?.focus();
|
|
2206
2206
|
});
|
|
2207
2207
|
}), V(this, js, (t, e) => {
|
|
2208
|
-
this.month = t, this.year = e,
|
|
2208
|
+
this.month = t, this.year = e, O(this, $, new Date(e, t - 1, 1)), O(this, yt, "days"), this.requestUpdate(), this.updateComplete.then(() => {
|
|
2209
2209
|
this.shadowRoot?.querySelector('[part="title-button"]')?.focus();
|
|
2210
2210
|
});
|
|
2211
2211
|
}), V(this, Mi, (t) => {
|
|
2212
2212
|
if (o(this, yt) !== "picker") return;
|
|
2213
2213
|
if (t.key === "Escape") {
|
|
2214
|
-
t.stopPropagation(),
|
|
2214
|
+
t.stopPropagation(), O(this, yt, "days"), this.requestUpdate(), this.updateComplete.then(() => {
|
|
2215
2215
|
this.shadowRoot?.querySelector('[part="title-button"]')?.focus();
|
|
2216
2216
|
});
|
|
2217
2217
|
return;
|
|
@@ -2224,8 +2224,8 @@ let R = class extends I {
|
|
|
2224
2224
|
r.tabIndex = n === a ? 0 : -1;
|
|
2225
2225
|
}), e[a].focus(), e[a].scrollIntoView({ block: "nearest" }));
|
|
2226
2226
|
}), V(this, Ti, (t) => {
|
|
2227
|
-
o(this, yt) === "picker" && !this.shadowRoot.contains(t.relatedTarget) && (
|
|
2228
|
-
}),
|
|
2227
|
+
o(this, yt) === "picker" && !this.shadowRoot.contains(t.relatedTarget) && (O(this, yt, "days"), this.requestUpdate());
|
|
2228
|
+
}), O(this, Me, this.attachInternals());
|
|
2229
2229
|
}
|
|
2230
2230
|
get navigationEnabled() {
|
|
2231
2231
|
return this.navigation !== "off";
|
|
@@ -2234,47 +2234,47 @@ let R = class extends I {
|
|
|
2234
2234
|
super.connectedCallback(), this.value = this.getAttribute("value") || "", this.year = Number(this.getAttribute("year")) || (/* @__PURE__ */ new Date()).getFullYear(), this.month = Number(this.getAttribute("month")) || (/* @__PURE__ */ new Date()).getMonth() + 1;
|
|
2235
2235
|
let t = 1;
|
|
2236
2236
|
const e = this.getAttribute("start");
|
|
2237
|
-
e && (
|
|
2237
|
+
e && (O(this, rt, d(this, l, Oe).call(this, e === "min" ? this.getAttribute("min") : e)), o(this, rt) && o(this, rt).getMonth() + 1 === this.month && (t = o(this, rt).getDate()));
|
|
2238
2238
|
const i = this.getAttribute("end");
|
|
2239
|
-
i &&
|
|
2239
|
+
i && O(this, Et, d(this, l, Oe).call(this, i === "max" ? this.getAttribute("max") : i)), O(this, $, new Date(this.year, this.month - 1, t)), this.addEventListener("keydown", o(this, Mi)), this.addEventListener("focusout", o(this, Ti));
|
|
2240
2240
|
}
|
|
2241
2241
|
disconnectedCallback() {
|
|
2242
2242
|
super.disconnectedCallback(), this.removeEventListener("keydown", o(this, Mi)), this.removeEventListener("focusout", o(this, Ti));
|
|
2243
2243
|
}
|
|
2244
2244
|
firstUpdated() {
|
|
2245
|
-
|
|
2245
|
+
O(this, Ge, !0), d(this, l, Zs).call(this);
|
|
2246
2246
|
}
|
|
2247
2247
|
get value() {
|
|
2248
|
-
return o(this,
|
|
2248
|
+
return o(this, j).get(o(this, l, Mt)) || "";
|
|
2249
2249
|
}
|
|
2250
2250
|
set value(t) {
|
|
2251
|
-
o(this,
|
|
2251
|
+
o(this, j).delete(o(this, l, Mt));
|
|
2252
2252
|
const e = Array.isArray(t) ? t : t.trim().split(" ");
|
|
2253
2253
|
if (this.selectmode === "multiple")
|
|
2254
2254
|
Array.isArray(t) ? t.forEach((i) => {
|
|
2255
|
-
o(this,
|
|
2256
|
-
}) : o(this,
|
|
2255
|
+
o(this, j).append(o(this, l, Mt), i);
|
|
2256
|
+
}) : o(this, j).append(o(this, l, Mt), t);
|
|
2257
2257
|
else if (this.selectmode === "single")
|
|
2258
|
-
Array.isArray(t) && t.length > 0 ? o(this,
|
|
2258
|
+
Array.isArray(t) && t.length > 0 ? o(this, j).set(o(this, l, Mt), t[0]) : typeof t == "string" && t.length > 0 && o(this, j).set(o(this, l, Mt), t);
|
|
2259
2259
|
else if (this.selectmode === "week" && typeof t == "string" && t.match(/^\d{4}-W\d{2}$/)) {
|
|
2260
|
-
o(this,
|
|
2261
|
-
const i =
|
|
2260
|
+
o(this, j).set(o(this, l, Mt), t);
|
|
2261
|
+
const i = mn(t), s = Array.from({ length: 7 }, (a, r) => {
|
|
2262
2262
|
const n = new Date(i);
|
|
2263
|
-
return n.setDate(i.getDate() + r),
|
|
2263
|
+
return n.setDate(i.getDate() + r), d(this, l, Yt).call(this, n.getFullYear(), n.getMonth() + 1, n.getDate());
|
|
2264
2264
|
});
|
|
2265
|
-
o(this, Me).setFormValue(o(this,
|
|
2265
|
+
o(this, Me).setFormValue(o(this, j)), this.selected = s, this.navigationEnabled && o(this, Ge) && this.goTo(s[0]);
|
|
2266
2266
|
return;
|
|
2267
2267
|
}
|
|
2268
|
-
o(this, Me).setFormValue(o(this,
|
|
2268
|
+
o(this, Me).setFormValue(o(this, j)), this.selected = e, this.navigationEnabled && this.selectmode === "single" && e[0] && o(this, Ge) && this.goTo(e[0]);
|
|
2269
2269
|
}
|
|
2270
2270
|
getDateForDay(t) {
|
|
2271
2271
|
const e = new Date(this.year, this.month - 1, t);
|
|
2272
|
-
return
|
|
2272
|
+
return d(this, l, Yt).call(this, e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
2273
2273
|
}
|
|
2274
2274
|
previousMonth() {
|
|
2275
2275
|
if (this.navigation === "off") return;
|
|
2276
2276
|
let t = o(this, $).getMonth(), e = o(this, $).getFullYear();
|
|
2277
|
-
t === 0 && (e--, t = 12), this.goTo(e, t, 1),
|
|
2277
|
+
t === 0 && (e--, t = 12), this.goTo(e, t, 1), d(this, l, ms).call(this);
|
|
2278
2278
|
}
|
|
2279
2279
|
today() {
|
|
2280
2280
|
this.navigation !== "off" && this.goTo(/* @__PURE__ */ new Date());
|
|
@@ -2289,36 +2289,36 @@ let R = class extends I {
|
|
|
2289
2289
|
*/
|
|
2290
2290
|
async goTo(t, e, i) {
|
|
2291
2291
|
let s = null;
|
|
2292
|
-
typeof t == "string" ? s =
|
|
2292
|
+
typeof t == "string" ? s = d(this, l, Oe).call(this, t) || /* @__PURE__ */ new Date() : t instanceof Date ? s = t : s = new Date(t, (e || 1) - 1, i ?? 1), s && o(this, rt) && s < o(this, rt) && (s = o(this, rt)), s && o(this, Et) && s > o(this, Et) && (s = o(this, Et)), s && O(this, $, s), (this.year !== o(this, $).getFullYear() || this.month !== o(this, $).getMonth() + 1) && (this.year = o(this, $).getFullYear(), this.month = o(this, $).getMonth() + 1, await d(this, l, ms).call(this));
|
|
2293
2293
|
}
|
|
2294
2294
|
focus() {
|
|
2295
2295
|
this.gridBody.focus();
|
|
2296
2296
|
}
|
|
2297
2297
|
render() {
|
|
2298
|
-
const t = [], e = o(this, l,
|
|
2299
|
-
let
|
|
2300
|
-
for (let c = 1; c <=
|
|
2301
|
-
t[
|
|
2302
|
-
const St = i.days -
|
|
2303
|
-
t[
|
|
2304
|
-
!a ||
|
|
2305
|
-
),
|
|
2306
|
-
}
|
|
2307
|
-
for (let c = n; c <=
|
|
2308
|
-
const St =
|
|
2309
|
-
t[
|
|
2310
|
-
}
|
|
2311
|
-
const Ct = 8 -
|
|
2298
|
+
const t = [], e = o(this, l, Ri), i = o(this, l, Gs), s = o(this, l, Xs), a = o(this, rt), r = o(this, Et), n = a && d(this, l, Se).call(this, a) ? a.getDate() : 1, p = r && d(this, l, Se).call(this, r) ? r.getDate() : e, N = As(this.locale), F = a && d(this, l, Se).call(this, a) ? (a.getDay() - N + 7) % 7 : o(this, l, Nr);
|
|
2299
|
+
let Y = 1, lt = 1;
|
|
2300
|
+
for (let c = 1; c <= F; c++) {
|
|
2301
|
+
t[Y] = t[Y] || [];
|
|
2302
|
+
const St = i.days - F + c, rn = new Date(i.year, i.month - 1, St);
|
|
2303
|
+
t[Y].push(
|
|
2304
|
+
!a || rn >= a ? d(this, l, Ei).call(this, i.year, i.month, St, Y + 1, lt, !0) : y`<div part="day day-empty"></div>`
|
|
2305
|
+
), lt++;
|
|
2306
|
+
}
|
|
2307
|
+
for (let c = n; c <= p; c++) {
|
|
2308
|
+
const St = d(this, l, Ei).call(this, this.year, this.month, c, Y + 1, lt);
|
|
2309
|
+
t[Y] = t[Y] || [], t[Y].push(St), lt++, lt === 8 && (Y++, lt = 1);
|
|
2310
|
+
}
|
|
2311
|
+
const Ct = 8 - lt;
|
|
2312
2312
|
if (o(this, l, Hs) && Ct < 7)
|
|
2313
2313
|
for (let c = 1; c <= Ct; c++) {
|
|
2314
|
-
t[
|
|
2314
|
+
t[Y] = t[Y] || [];
|
|
2315
2315
|
const St = new Date(s.year, s.month - 1, c);
|
|
2316
|
-
t[
|
|
2317
|
-
!r || St <= r ?
|
|
2316
|
+
t[Y].push(
|
|
2317
|
+
!r || St <= r ? d(this, l, Ei).call(this, s.year, s.month, c, Y + 1, lt, !0) : y`<div part="day day-empty"></div>`
|
|
2318
2318
|
);
|
|
2319
2319
|
}
|
|
2320
|
-
const Hi = t.filter((c) => c?.length > 0), Gi =
|
|
2321
|
-
return
|
|
2320
|
+
const Hi = t.filter((c) => c?.length > 0), Gi = d(this, l, Br).call(this);
|
|
2321
|
+
return y`
|
|
2322
2322
|
<div part="header">
|
|
2323
2323
|
<slot name="header-start"></slot>
|
|
2324
2324
|
<slot part="title" name="title" id="calendar-title">
|
|
@@ -2329,17 +2329,17 @@ let R = class extends I {
|
|
|
2329
2329
|
aria-controls="calendar-picker"
|
|
2330
2330
|
@click=${o(this, bs)}
|
|
2331
2331
|
>
|
|
2332
|
-
${o(this, l,
|
|
2332
|
+
${o(this, l, Vr).map((c) => y`<span part="title-${c.type}">${c.value}</span>`)}
|
|
2333
2333
|
</button>
|
|
2334
2334
|
</slot>
|
|
2335
2335
|
<slot part="controls" name="controls">
|
|
2336
|
-
${this.controls ?
|
|
2336
|
+
${this.controls ? y`
|
|
2337
2337
|
<button
|
|
2338
2338
|
type="button"
|
|
2339
2339
|
part="control control-previous"
|
|
2340
|
-
aria-label=${o(this, l,
|
|
2340
|
+
aria-label=${o(this, l, Lr)}
|
|
2341
2341
|
@click=${this.previousMonth}
|
|
2342
|
-
?disabled=${o(this,
|
|
2342
|
+
?disabled=${o(this, rt) && d(this, l, Se).call(this, o(this, rt))}
|
|
2343
2343
|
>
|
|
2344
2344
|
◄
|
|
2345
2345
|
</button>
|
|
@@ -2348,16 +2348,16 @@ let R = class extends I {
|
|
|
2348
2348
|
part="control control-today"
|
|
2349
2349
|
aria-label=${o(this, ys)}
|
|
2350
2350
|
@click=${this.today}
|
|
2351
|
-
?hidden=${
|
|
2351
|
+
?hidden=${d(this, l, tn).call(this, o(this, rt), o(this, Et))}
|
|
2352
2352
|
>
|
|
2353
2353
|
●
|
|
2354
2354
|
</button>
|
|
2355
2355
|
<button
|
|
2356
2356
|
type="button"
|
|
2357
2357
|
part="control control-next"
|
|
2358
|
-
aria-label=${o(this, l,
|
|
2358
|
+
aria-label=${o(this, l, Rr)}
|
|
2359
2359
|
@click=${this.nextMonth}
|
|
2360
|
-
?disabled=${o(this, Et) &&
|
|
2360
|
+
?disabled=${o(this, Et) && d(this, l, Se).call(this, o(this, Et))}
|
|
2361
2361
|
>
|
|
2362
2362
|
►
|
|
2363
2363
|
</button>
|
|
@@ -2365,30 +2365,30 @@ let R = class extends I {
|
|
|
2365
2365
|
</slot>
|
|
2366
2366
|
<slot name="header-end"></slot>
|
|
2367
2367
|
</div>
|
|
2368
|
-
${o(this, yt) === "picker" ?
|
|
2368
|
+
${o(this, yt) === "picker" ? d(this, l, en).call(this) : y`
|
|
2369
2369
|
<div part="grid" role="grid" aria-labelledby="calendar-title">
|
|
2370
2370
|
<div part="grid-header" role="row" aria-rowindex="1">
|
|
2371
2371
|
${Gi.map(
|
|
2372
|
-
(c, St) =>
|
|
2372
|
+
(c, St) => y`<div part="grid-header-cell" role="columnheader" aria-colindex="${St + 1}">${c}</div>`
|
|
2373
2373
|
)}
|
|
2374
2374
|
</div>
|
|
2375
2375
|
<div
|
|
2376
2376
|
part="grid-body"
|
|
2377
2377
|
role="rowgroup"
|
|
2378
2378
|
tabindex=${this.navigationEnabled ? "0" : void 0}
|
|
2379
|
-
@focusin=${this.navigationEnabled ?
|
|
2380
|
-
@focusout=${this.navigationEnabled ?
|
|
2381
|
-
@mousedown=${this.navigationEnabled ?
|
|
2382
|
-
@click=${this.navigationEnabled ?
|
|
2383
|
-
@keydown=${this.navigationEnabled ?
|
|
2384
|
-
@mouseover=${this.selectmode === "week" ?
|
|
2385
|
-
@mouseleave=${this.selectmode === "week" ?
|
|
2379
|
+
@focusin=${this.navigationEnabled ? d(this, l, Zr) : void 0}
|
|
2380
|
+
@focusout=${this.navigationEnabled ? d(this, l, Qr) : void 0}
|
|
2381
|
+
@mousedown=${this.navigationEnabled ? d(this, l, Gr) : void 0}
|
|
2382
|
+
@click=${this.navigationEnabled ? d(this, l, Xr) : void 0}
|
|
2383
|
+
@keydown=${this.navigationEnabled ? d(this, l, Jr) : void 0}
|
|
2384
|
+
@mouseover=${this.selectmode === "week" ? d(this, l, Kr) : void 0}
|
|
2385
|
+
@mouseleave=${this.selectmode === "week" ? d(this, l, Hr) : void 0}
|
|
2386
2386
|
>
|
|
2387
|
-
${
|
|
2387
|
+
${ln(
|
|
2388
2388
|
`${this.year}-${this.month}`,
|
|
2389
|
-
|
|
2389
|
+
on(
|
|
2390
2390
|
Hi,
|
|
2391
|
-
(c, St) =>
|
|
2391
|
+
(c, St) => y`<div role="row" part="row" aria-rowindex=${St + 1}>${c}</div>`
|
|
2392
2392
|
)
|
|
2393
2393
|
)}
|
|
2394
2394
|
</div>
|
|
@@ -2398,10 +2398,10 @@ let R = class extends I {
|
|
|
2398
2398
|
}
|
|
2399
2399
|
};
|
|
2400
2400
|
Me = /* @__PURE__ */ new WeakMap();
|
|
2401
|
-
|
|
2402
|
-
|
|
2401
|
+
j = /* @__PURE__ */ new WeakMap();
|
|
2402
|
+
Ge = /* @__PURE__ */ new WeakMap();
|
|
2403
2403
|
l = /* @__PURE__ */ new WeakSet();
|
|
2404
|
-
|
|
2404
|
+
Xe = function() {
|
|
2405
2405
|
return !` ${this.navigation} `.includes(" nowrap ");
|
|
2406
2406
|
};
|
|
2407
2407
|
Fr = function() {
|
|
@@ -2410,13 +2410,13 @@ Fr = function() {
|
|
|
2410
2410
|
Hs = function() {
|
|
2411
2411
|
return !` ${this.hiddenmonths} `.includes(" next ");
|
|
2412
2412
|
};
|
|
2413
|
-
|
|
2413
|
+
rt = /* @__PURE__ */ new WeakMap();
|
|
2414
2414
|
Et = /* @__PURE__ */ new WeakMap();
|
|
2415
2415
|
$ = /* @__PURE__ */ new WeakMap();
|
|
2416
2416
|
yt = /* @__PURE__ */ new WeakMap();
|
|
2417
|
-
|
|
2417
|
+
si = /* @__PURE__ */ new WeakMap();
|
|
2418
2418
|
ys = /* @__PURE__ */ new WeakMap();
|
|
2419
|
-
|
|
2419
|
+
Oe = function(t) {
|
|
2420
2420
|
const [e, i, s] = t.split("-").map(Number);
|
|
2421
2421
|
return e && i && s ? new Date(e, i - 1, s) : null;
|
|
2422
2422
|
};
|
|
@@ -2426,9 +2426,13 @@ Mt = function() {
|
|
|
2426
2426
|
Li = function(t) {
|
|
2427
2427
|
return this.min && t < this.min || this.max && t > this.max;
|
|
2428
2428
|
};
|
|
2429
|
-
|
|
2429
|
+
Ur = function(t, e) {
|
|
2430
|
+
const i = d(this, l, Yt).call(this, e, t, 1), s = d(this, l, Yt).call(this, e, t, new Date(e, t, 0).getDate());
|
|
2431
|
+
return (!this.min || s >= this.min) && (!this.max || i <= this.max);
|
|
2432
|
+
};
|
|
2433
|
+
ai = function(t) {
|
|
2430
2434
|
if (typeof t == "string") {
|
|
2431
|
-
if (
|
|
2435
|
+
if (d(this, l, Li).call(this, t)) return;
|
|
2432
2436
|
this.value = t, this.dispatchEvent(
|
|
2433
2437
|
new CustomEvent("use-change", {
|
|
2434
2438
|
detail: {
|
|
@@ -2441,15 +2445,15 @@ si = function(t) {
|
|
|
2441
2445
|
);
|
|
2442
2446
|
return;
|
|
2443
2447
|
}
|
|
2444
|
-
const { isoWeek: e, dates: i } = t, s = i.filter((a) => !
|
|
2445
|
-
s.length !== 0 && (o(this,
|
|
2448
|
+
const { isoWeek: e, dates: i } = t, s = i.filter((a) => !d(this, l, Li).call(this, a));
|
|
2449
|
+
s.length !== 0 && (o(this, j).delete(o(this, l, Mt)), o(this, j).set(o(this, l, Mt), e), o(this, Me).setFormValue(o(this, j)), this.selected = s, this.dispatchEvent(
|
|
2446
2450
|
new CustomEvent("use-change", {
|
|
2447
2451
|
detail: {
|
|
2448
2452
|
value: e,
|
|
2449
2453
|
dates: s,
|
|
2450
2454
|
valueAsDate: s.map((a) => {
|
|
2451
|
-
const [r, n,
|
|
2452
|
-
return new Date(r, n - 1,
|
|
2455
|
+
const [r, n, p] = a.split("-").map(Number);
|
|
2456
|
+
return new Date(r, n - 1, p);
|
|
2453
2457
|
})
|
|
2454
2458
|
},
|
|
2455
2459
|
bubbles: !0,
|
|
@@ -2457,7 +2461,7 @@ si = function(t) {
|
|
|
2457
2461
|
})
|
|
2458
2462
|
));
|
|
2459
2463
|
};
|
|
2460
|
-
|
|
2464
|
+
Ri = function() {
|
|
2461
2465
|
return new Date(this.year, this.month, 0).getDate();
|
|
2462
2466
|
};
|
|
2463
2467
|
Gs = function() {
|
|
@@ -2469,13 +2473,13 @@ Gs = function() {
|
|
|
2469
2473
|
month: t.getMonth() + 1
|
|
2470
2474
|
};
|
|
2471
2475
|
};
|
|
2472
|
-
|
|
2476
|
+
Lr = function() {
|
|
2473
2477
|
const { year: t, month: e } = o(this, l, Gs);
|
|
2474
2478
|
return new Intl.DateTimeFormat(this.locale, { month: "long", year: "numeric", timeZone: "UTC" }).format(
|
|
2475
2479
|
new Date(t, e - 1, 1)
|
|
2476
2480
|
);
|
|
2477
2481
|
};
|
|
2478
|
-
|
|
2482
|
+
Rr = function() {
|
|
2479
2483
|
const { year: t, month: e } = o(this, l, Xs);
|
|
2480
2484
|
return new Intl.DateTimeFormat(this.locale, { month: "long", year: "numeric", timeZone: "UTC" }).format(
|
|
2481
2485
|
new Date(t, e - 1, 1)
|
|
@@ -2493,10 +2497,10 @@ Xs = function() {
|
|
|
2493
2497
|
Nr = function() {
|
|
2494
2498
|
return (new Date(this.year, this.month - 1, 1).getDay() - As(this.locale) + 7) % 7;
|
|
2495
2499
|
};
|
|
2496
|
-
Rr = function() {
|
|
2497
|
-
return cn(this.locale, "short");
|
|
2498
|
-
};
|
|
2499
2500
|
Br = function() {
|
|
2501
|
+
return pn(this.locale, "short");
|
|
2502
|
+
};
|
|
2503
|
+
Vr = function() {
|
|
2500
2504
|
try {
|
|
2501
2505
|
const t = {
|
|
2502
2506
|
year: "numeric",
|
|
@@ -2509,54 +2513,54 @@ Br = function() {
|
|
|
2509
2513
|
return [];
|
|
2510
2514
|
}
|
|
2511
2515
|
};
|
|
2512
|
-
|
|
2516
|
+
Yt = function(t, e, i) {
|
|
2513
2517
|
return `${t}-${e.toString().padStart(2, "0")}-${i.toString().padStart(2, "0")}`;
|
|
2514
2518
|
};
|
|
2515
2519
|
Vt = /* @__PURE__ */ new WeakMap();
|
|
2516
2520
|
Zs = function() {
|
|
2517
2521
|
o(this, Vt).clear(), as(this).concat(as(this.gridBody)).forEach((t) => {
|
|
2518
|
-
t.setAttribute(
|
|
2519
|
-
const e =
|
|
2522
|
+
t.setAttribute(Ni, Pr(t)), t.tabIndex = -1;
|
|
2523
|
+
const e = d(this, l, Qs).call(this, t);
|
|
2520
2524
|
e && (o(this, Vt).has(e) || o(this, Vt).set(e, []), o(this, Vt).get(e)?.push(t));
|
|
2521
2525
|
});
|
|
2522
2526
|
};
|
|
2523
|
-
|
|
2527
|
+
zr = function(t) {
|
|
2524
2528
|
const i = t.currentTarget.getAttribute("data-usewc-date");
|
|
2525
2529
|
if (!i) return;
|
|
2526
2530
|
const s = o(this, Vt).get(i);
|
|
2527
2531
|
s && s.forEach((a) => {
|
|
2528
|
-
const r = a.getAttribute(
|
|
2529
|
-
r === Or ? a.removeAttribute("tabindex") : r && a.setAttribute("tabindex", r), a.removeAttribute(
|
|
2532
|
+
const r = a.getAttribute(Ni);
|
|
2533
|
+
r === Or ? a.removeAttribute("tabindex") : r && a.setAttribute("tabindex", r), a.removeAttribute(Ni);
|
|
2530
2534
|
});
|
|
2531
2535
|
};
|
|
2532
|
-
|
|
2536
|
+
qr = function(t) {
|
|
2533
2537
|
const e = t.currentTarget, i = e.getAttribute("data-usewc-date"), s = t.relatedTarget, a = o(this, Vt).get(i || "");
|
|
2534
2538
|
if (!i || !a || a.includes(s)) {
|
|
2535
2539
|
e.contains(s) && e.setAttribute("tabindex", "-1");
|
|
2536
2540
|
return;
|
|
2537
2541
|
}
|
|
2538
2542
|
(this.contains(s) || this.gridBody.contains(s)) && a.forEach((r) => {
|
|
2539
|
-
r.setAttribute(
|
|
2543
|
+
r.setAttribute(Ni, Pr(r)), r.tabIndex = -1;
|
|
2540
2544
|
});
|
|
2541
2545
|
};
|
|
2542
|
-
|
|
2546
|
+
Yr = function() {
|
|
2543
2547
|
return this.getDateForDay((/* @__PURE__ */ new Date()).getDate());
|
|
2544
2548
|
};
|
|
2545
2549
|
Ei = function(t, e, i, s, a, r = !1) {
|
|
2546
|
-
const n =
|
|
2547
|
-
return
|
|
2550
|
+
const n = d(this, l, Yt).call(this, t, e, i), p = d(this, l, Li).call(this, n);
|
|
2551
|
+
return y`
|
|
2548
2552
|
<div
|
|
2549
|
-
@focusin=${
|
|
2550
|
-
@focusout=${
|
|
2553
|
+
@focusin=${d(this, l, zr)}
|
|
2554
|
+
@focusout=${d(this, l, qr)}
|
|
2551
2555
|
part=${[
|
|
2552
2556
|
"day",
|
|
2553
2557
|
r ? "day-empty" : "",
|
|
2554
2558
|
this.selected.includes(n) ? "day-selected" : "",
|
|
2555
|
-
o(this, l,
|
|
2556
|
-
|
|
2559
|
+
o(this, l, Yr) === n ? "day-today" : "",
|
|
2560
|
+
p ? "day-disabled" : "",
|
|
2557
2561
|
o(this, At).includes(n) ? "day-week-hover" : ""
|
|
2558
2562
|
].join(" ").trim()}
|
|
2559
|
-
aria-disabled=${
|
|
2563
|
+
aria-disabled=${p ? "true" : "false"}
|
|
2560
2564
|
aria-selected=${this.selected.includes(n) ? "true" : "false"}
|
|
2561
2565
|
role="gridcell"
|
|
2562
2566
|
data-usewc-day=${i}
|
|
@@ -2565,100 +2569,100 @@ Ei = function(t, e, i, s, a, r = !1) {
|
|
|
2565
2569
|
aria-rowindex="${s}"
|
|
2566
2570
|
aria-colindex="${a}"
|
|
2567
2571
|
>
|
|
2568
|
-
<slot name="date-${n}">${this.renderDay({ day: i, date: n },
|
|
2572
|
+
<slot name="date-${n}">${this.renderDay({ day: i, date: n }, y)}</slot>
|
|
2569
2573
|
</div>
|
|
2570
2574
|
`;
|
|
2571
2575
|
};
|
|
2572
2576
|
ms = async function() {
|
|
2573
|
-
await this.updateComplete,
|
|
2577
|
+
await this.updateComplete, d(this, l, Zs).call(this);
|
|
2574
2578
|
};
|
|
2575
|
-
|
|
2579
|
+
ie = function() {
|
|
2576
2580
|
return o(this, $).toISOString().split("T")[0];
|
|
2577
2581
|
};
|
|
2578
2582
|
At = /* @__PURE__ */ new WeakMap();
|
|
2579
|
-
|
|
2580
|
-
const i =
|
|
2583
|
+
Kr = function(t) {
|
|
2584
|
+
const i = d(this, l, Ki).call(this, t.target)?.getAttribute("data-usewc-date");
|
|
2581
2585
|
if (!i) {
|
|
2582
|
-
o(this, At).length > 0 && (
|
|
2586
|
+
o(this, At).length > 0 && (O(this, At, []), this.requestUpdate());
|
|
2583
2587
|
return;
|
|
2584
2588
|
}
|
|
2585
|
-
const [s, a, r] = i.split("-").map(Number), n = new Date(s, a - 1, r),
|
|
2586
|
-
|
|
2587
|
-
const
|
|
2588
|
-
const Ct = new Date(
|
|
2589
|
-
return Ct.setDate(
|
|
2589
|
+
const [s, a, r] = i.split("-").map(Number), n = new Date(s, a - 1, r), p = n.getDay() || 7, N = new Date(n);
|
|
2590
|
+
N.setDate(n.getDate() - (p - 1));
|
|
2591
|
+
const F = Array.from({ length: 7 }, (Y, lt) => {
|
|
2592
|
+
const Ct = new Date(N);
|
|
2593
|
+
return Ct.setDate(N.getDate() + lt), d(this, l, Yt).call(this, Ct.getFullYear(), Ct.getMonth() + 1, Ct.getDate());
|
|
2590
2594
|
});
|
|
2591
|
-
|
|
2595
|
+
O(this, At, F), this.requestUpdate();
|
|
2592
2596
|
};
|
|
2593
|
-
|
|
2594
|
-
|
|
2597
|
+
Hr = function() {
|
|
2598
|
+
O(this, At, []), this.requestUpdate();
|
|
2595
2599
|
};
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2600
|
+
ri = /* @__PURE__ */ new WeakMap();
|
|
2601
|
+
Gr = function(t) {
|
|
2602
|
+
O(this, ri, d(this, l, Ki).call(this, t.target)), o(this, $).setDate(Number(o(this, ri)?.getAttribute("data-usewc-day")) || 1);
|
|
2599
2603
|
};
|
|
2600
2604
|
Qs = function(t) {
|
|
2601
2605
|
return t?.closest("[data-usewc-date]")?.getAttribute("data-usewc-date") || t?.closest('[slot^="date-"]')?.getAttribute("slot")?.replace("date-", "");
|
|
2602
2606
|
};
|
|
2603
2607
|
Ki = function(t) {
|
|
2604
|
-
const e =
|
|
2608
|
+
const e = d(this, l, Qs).call(this, t);
|
|
2605
2609
|
return this.shadowRoot?.querySelector(`[data-usewc-date="${e}"]`);
|
|
2606
2610
|
};
|
|
2607
|
-
|
|
2611
|
+
Ue = function(t) {
|
|
2608
2612
|
const [e, i, s] = t.split("-").map(Number), a = new Date(e, i - 1, s), r = a.getDay() || 7, n = new Date(a);
|
|
2609
|
-
return n.setDate(a.getDate() - (r - 1)), Array.from({ length: 7 }, (
|
|
2610
|
-
const
|
|
2611
|
-
return
|
|
2613
|
+
return n.setDate(a.getDate() - (r - 1)), Array.from({ length: 7 }, (p, N) => {
|
|
2614
|
+
const F = new Date(n);
|
|
2615
|
+
return F.setDate(n.getDate() + N), d(this, l, Yt).call(this, F.getFullYear(), F.getMonth() + 1, F.getDate());
|
|
2612
2616
|
});
|
|
2613
2617
|
};
|
|
2614
|
-
|
|
2615
|
-
if (
|
|
2616
|
-
const e = t.target, i =
|
|
2618
|
+
Xr = function(t) {
|
|
2619
|
+
if (O(this, ri, null), !this.navigationEnabled) return;
|
|
2620
|
+
const e = t.target, i = d(this, l, Ki).call(this, e);
|
|
2617
2621
|
if (i) {
|
|
2618
|
-
if (this.selectmode === "single" &&
|
|
2622
|
+
if (this.selectmode === "single" && d(this, l, ai).call(this, i.getAttribute("data-usewc-date") || ""), this.selectmode === "week") {
|
|
2619
2623
|
const s = i.getAttribute("data-usewc-date") || "", [a, r, n] = s.split("-").map(Number);
|
|
2620
|
-
|
|
2624
|
+
d(this, l, ai).call(this, { isoWeek: ha(new Date(a, r - 1, n)), dates: d(this, l, Ue).call(this, s) });
|
|
2621
2625
|
}
|
|
2622
2626
|
this.navigationEnabled && (o(this, $).setDate(Number(i.getAttribute("data-usewc-day")) || 1), this.gridBody.setAttribute("tabindex", "-1"));
|
|
2623
2627
|
}
|
|
2624
2628
|
};
|
|
2625
|
-
|
|
2626
|
-
const e = t.target, i = this.shadowRoot?.querySelector(`[data-usewc-date="${o(this, l,
|
|
2629
|
+
Zr = function(t) {
|
|
2630
|
+
const e = t.target, i = this.shadowRoot?.querySelector(`[data-usewc-date="${o(this, l, ie)}"]`);
|
|
2627
2631
|
if (this.gridBody.setAttribute("tabindex", "-1"), t.target === this.gridBody) {
|
|
2628
|
-
|
|
2632
|
+
d(this, l, Js).call(this, this.year, this.month, o(this, $).getDate()), this.selectmode === "week" && (O(this, At, d(this, l, Ue).call(this, o(this, l, ie))), this.requestUpdate());
|
|
2629
2633
|
return;
|
|
2630
2634
|
}
|
|
2631
|
-
this.contains(e) && (i?.setAttribute("tabindex", "0"), this.selectmode === "week" && (
|
|
2635
|
+
this.contains(e) && (i?.setAttribute("tabindex", "0"), this.selectmode === "week" && (O(this, At, d(this, l, Ue).call(this, o(this, l, ie))), this.requestUpdate()));
|
|
2632
2636
|
};
|
|
2633
|
-
|
|
2637
|
+
Qr = function(t) {
|
|
2634
2638
|
this.contains(t.relatedTarget) || (this.gridBody.querySelectorAll("[data-usewc-day]").forEach((e) => {
|
|
2635
2639
|
e.setAttribute("tabindex", "-1");
|
|
2636
|
-
}), this.gridBody.setAttribute("tabindex", "0"), this.selectmode === "week" && (
|
|
2640
|
+
}), this.gridBody.setAttribute("tabindex", "0"), this.selectmode === "week" && (O(this, At, []), this.requestUpdate()));
|
|
2637
2641
|
};
|
|
2638
|
-
|
|
2642
|
+
Jr = function(t) {
|
|
2639
2643
|
const e = o(this, $).getDate();
|
|
2640
2644
|
if ([" ", "Enter"].includes(t.key) && this.selectmode === "single") {
|
|
2641
|
-
t.preventDefault(), t.stopPropagation(),
|
|
2645
|
+
t.preventDefault(), t.stopPropagation(), d(this, l, ai).call(this, o(this, l, ie));
|
|
2642
2646
|
return;
|
|
2643
2647
|
}
|
|
2644
2648
|
if ([" ", "Enter"].includes(t.key) && this.selectmode === "week") {
|
|
2645
2649
|
t.preventDefault(), t.stopPropagation();
|
|
2646
|
-
const [s, a, r] = o(this, l,
|
|
2647
|
-
|
|
2650
|
+
const [s, a, r] = o(this, l, ie).split("-").map(Number);
|
|
2651
|
+
d(this, l, ai).call(this, {
|
|
2648
2652
|
isoWeek: ha(new Date(s, a - 1, r)),
|
|
2649
|
-
dates:
|
|
2653
|
+
dates: d(this, l, Ue).call(this, o(this, l, ie))
|
|
2650
2654
|
});
|
|
2651
2655
|
return;
|
|
2652
2656
|
}
|
|
2653
2657
|
let i;
|
|
2654
|
-
t.key === "ArrowRight" ? (i = e + 1, o(this, l,
|
|
2658
|
+
t.key === "ArrowRight" ? (i = e + 1, o(this, l, Xe) || (i = Math.min(i, o(this, l, Ri)))) : t.key === "ArrowLeft" ? (i = e - 1, o(this, l, Xe) || (i = Math.max(i, 1))) : t.key === "ArrowUp" ? o(this, l, Fr) && o(this, l, Xe) ? i = e - 7 : i = Math.max(e - 7, 1) : t.key === "ArrowDown" && (o(this, l, Hs) && o(this, l, Xe) ? i = e + 7 : i = Math.min(e + 7, o(this, l, Ri))), i != null && (d(this, l, jr).call(this, i), t.preventDefault(), t.stopPropagation());
|
|
2655
2659
|
};
|
|
2656
|
-
|
|
2657
|
-
await
|
|
2660
|
+
jr = async function(t) {
|
|
2661
|
+
await d(this, l, Js).call(this, o(this, $).getFullYear(), o(this, $).getMonth() + 1, t), this.selectmode === "week" && (O(this, At, d(this, l, Ue).call(this, o(this, l, ie))), this.requestUpdate());
|
|
2658
2662
|
};
|
|
2659
2663
|
Js = async function(t, e, i) {
|
|
2660
2664
|
await this.goTo(t, e, i);
|
|
2661
|
-
const s =
|
|
2665
|
+
const s = d(this, l, Yt).call(this, o(this, $).getFullYear(), o(this, $).getMonth() + 1, o(this, $).getDate());
|
|
2662
2666
|
if (this.focusmode === "control") {
|
|
2663
2667
|
const r = o(this, Vt).get(s)?.at(0);
|
|
2664
2668
|
if (r) {
|
|
@@ -2672,51 +2676,47 @@ Js = async function(t, e, i) {
|
|
|
2672
2676
|
Se = function(t) {
|
|
2673
2677
|
return t == null ? !1 : t.getFullYear() === this.year && t.getMonth() + 1 === this.month;
|
|
2674
2678
|
};
|
|
2675
|
-
|
|
2679
|
+
tn = function(t, e) {
|
|
2676
2680
|
return t == null || e == null ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
|
|
2677
2681
|
};
|
|
2678
2682
|
bs = /* @__PURE__ */ new WeakMap();
|
|
2679
2683
|
js = /* @__PURE__ */ new WeakMap();
|
|
2680
2684
|
Mi = /* @__PURE__ */ new WeakMap();
|
|
2681
2685
|
Ti = /* @__PURE__ */ new WeakMap();
|
|
2682
|
-
|
|
2683
|
-
const t =
|
|
2684
|
-
return
|
|
2686
|
+
en = function() {
|
|
2687
|
+
const t = fn(this.locale, "short"), e = this.min ? d(this, l, Oe).call(this, this.min)?.getFullYear() ?? 1970 : 1970, i = this.max ? d(this, l, Oe).call(this, this.max)?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear() + 100 : (/* @__PURE__ */ new Date()).getFullYear() + 100, s = Array.from({ length: i - e + 1 }, (a, r) => e + r);
|
|
2688
|
+
return y`
|
|
2685
2689
|
<div
|
|
2686
2690
|
part="picker"
|
|
2687
2691
|
id="calendar-picker"
|
|
2688
|
-
style=${o(this,
|
|
2692
|
+
style=${o(this, si) != null ? `max-height:${o(this, si)}px` : ""}
|
|
2689
2693
|
>
|
|
2690
|
-
${
|
|
2691
|
-
(
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
<div part="picker-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
})}
|
|
2713
|
-
</div>
|
|
2714
|
-
`
|
|
2715
|
-
)}
|
|
2694
|
+
${s.map((a) => {
|
|
2695
|
+
const r = t.map((n, p) => ({ name: n, monthNum: p + 1 })).filter(({ monthNum: n }) => d(this, l, Ur).call(this, n, a));
|
|
2696
|
+
return y`
|
|
2697
|
+
<div part="picker-year-section" data-picker-year=${a}>
|
|
2698
|
+
<div part="picker-year-label">${a}</div>
|
|
2699
|
+
<div part="picker-months" role="grid" aria-label=${String(a)}>
|
|
2700
|
+
${r.map(({ name: n, monthNum: p }) => {
|
|
2701
|
+
const N = a === this.year && p === this.month;
|
|
2702
|
+
return y`
|
|
2703
|
+
<button
|
|
2704
|
+
part="picker-month ${N ? "picker-month-current" : ""}"
|
|
2705
|
+
role="gridcell"
|
|
2706
|
+
type="button"
|
|
2707
|
+
aria-selected=${N ? "true" : "false"}
|
|
2708
|
+
tabindex=${N ? "0" : "-1"}
|
|
2709
|
+
data-picker-month=${p}
|
|
2710
|
+
@click=${() => o(this, js).call(this, p, a)}
|
|
2711
|
+
>
|
|
2712
|
+
${n}
|
|
2713
|
+
</button>
|
|
2714
|
+
`;
|
|
2715
|
+
})}
|
|
2716
2716
|
</div>
|
|
2717
2717
|
</div>
|
|
2718
|
-
|
|
2719
|
-
)}
|
|
2718
|
+
`;
|
|
2719
|
+
})}
|
|
2720
2720
|
</div>
|
|
2721
2721
|
`;
|
|
2722
2722
|
};
|
|
@@ -2788,10 +2788,6 @@ R.styles = pt`
|
|
|
2788
2788
|
grid-template-columns: repeat(4, 1fr);
|
|
2789
2789
|
}
|
|
2790
2790
|
|
|
2791
|
-
[part='picker-months'] [role='row'] {
|
|
2792
|
-
display: contents;
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
2791
|
[part~='picker-month'] {
|
|
2796
2792
|
background: none;
|
|
2797
2793
|
border: none;
|
|
@@ -2804,107 +2800,107 @@ R.styles = pt`
|
|
|
2804
2800
|
background-color: rgba(0, 0, 0, 0.25);
|
|
2805
2801
|
}
|
|
2806
2802
|
`;
|
|
2807
|
-
|
|
2803
|
+
X([
|
|
2808
2804
|
k('[part="grid-body"]')
|
|
2809
2805
|
], R.prototype, "gridBody", 2);
|
|
2810
|
-
|
|
2806
|
+
X([
|
|
2811
2807
|
h({ type: Number, attribute: !0, reflect: !0 })
|
|
2812
2808
|
], R.prototype, "year", 2);
|
|
2813
|
-
|
|
2809
|
+
X([
|
|
2814
2810
|
h({ type: Number, attribute: !0, reflect: !0 })
|
|
2815
2811
|
], R.prototype, "month", 2);
|
|
2816
|
-
|
|
2812
|
+
X([
|
|
2817
2813
|
h({ type: String })
|
|
2818
2814
|
], R.prototype, "locale", 2);
|
|
2819
|
-
|
|
2815
|
+
X([
|
|
2820
2816
|
h({ type: Boolean, attribute: !0, reflect: !0 })
|
|
2821
2817
|
], R.prototype, "controls", 2);
|
|
2822
|
-
|
|
2818
|
+
X([
|
|
2823
2819
|
h({ type: String, attribute: !0, reflect: !0 })
|
|
2824
2820
|
], R.prototype, "navigation", 2);
|
|
2825
|
-
|
|
2821
|
+
X([
|
|
2826
2822
|
h({ type: String, attribute: !0, reflect: !0 })
|
|
2827
2823
|
], R.prototype, "hiddenmonths", 2);
|
|
2828
|
-
|
|
2824
|
+
X([
|
|
2829
2825
|
h({ type: String, attribute: !0, reflect: !0 })
|
|
2830
2826
|
], R.prototype, "selectmode", 2);
|
|
2831
|
-
|
|
2827
|
+
X([
|
|
2832
2828
|
h({ type: String, attribute: !0 })
|
|
2833
2829
|
], R.prototype, "focusmode", 2);
|
|
2834
|
-
|
|
2830
|
+
X([
|
|
2835
2831
|
h({ type: String, attribute: !0 })
|
|
2836
2832
|
], R.prototype, "name", 2);
|
|
2837
|
-
|
|
2833
|
+
X([
|
|
2838
2834
|
h({ type: Array, attribute: !1 })
|
|
2839
2835
|
], R.prototype, "selected", 2);
|
|
2840
|
-
|
|
2836
|
+
X([
|
|
2841
2837
|
h({ type: String, attribute: !0 })
|
|
2842
2838
|
], R.prototype, "min", 2);
|
|
2843
|
-
|
|
2839
|
+
X([
|
|
2844
2840
|
h({ type: String, attribute: !0 })
|
|
2845
2841
|
], R.prototype, "max", 2);
|
|
2846
|
-
|
|
2842
|
+
X([
|
|
2847
2843
|
h({ type: String, attribute: !0 })
|
|
2848
2844
|
], R.prototype, "start", 2);
|
|
2849
|
-
|
|
2845
|
+
X([
|
|
2850
2846
|
h({ type: String, attribute: !0 })
|
|
2851
2847
|
], R.prototype, "end", 2);
|
|
2852
|
-
R =
|
|
2853
|
-
|
|
2848
|
+
R = X([
|
|
2849
|
+
it("use-calendar")
|
|
2854
2850
|
], R);
|
|
2855
|
-
var
|
|
2851
|
+
var Zn = Object.defineProperty, Qn = Object.getOwnPropertyDescriptor, sn = (t) => {
|
|
2856
2852
|
throw TypeError(t);
|
|
2857
|
-
},
|
|
2858
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2853
|
+
}, ot = (t, e, i, s) => {
|
|
2854
|
+
for (var a = s > 1 ? void 0 : s ? Qn(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
2859
2855
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
2860
|
-
return s && a &&
|
|
2861
|
-
}, ta = (t, e, i) => e.has(t) ||
|
|
2856
|
+
return s && a && Zn(e, i, a), a;
|
|
2857
|
+
}, ta = (t, e, i) => e.has(t) || sn("Cannot " + i), K = (t, e, i) => (ta(t, e, "read from private field"), i ? i.call(t) : e.get(t)), De = (t, e, i) => e.has(t) ? sn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), se = (t, e, i, s) => (ta(t, e, "write to private field"), e.set(t, i), i), Ze = (t, e, i) => (ta(t, e, "access private method"), i), ut, Ie, ae, Bi, Vi, le, vs, an, _s;
|
|
2862
2858
|
let z = class extends I {
|
|
2863
2859
|
constructor() {
|
|
2864
|
-
super(), De(this,
|
|
2860
|
+
super(), De(this, le), De(this, ut), De(this, Ie), this.locale = navigator.language || "en-US", this.hours = !1, this.minutes = !1, this.seconds = !1, this.fractionalSeconds = !1, this.dayPeriod = !1, De(this, ae, ""), De(this, Bi, ""), De(this, Vi, ""), se(this, ut, this.attachInternals()), se(this, Ie, this.hasAttribute("id") ? this.getAttribute("id") : xt()), this.hasAttribute("disabled") && K(this, ut).states.add("disabled");
|
|
2865
2861
|
}
|
|
2866
2862
|
get id() {
|
|
2867
|
-
return
|
|
2863
|
+
return K(this, Ie);
|
|
2868
2864
|
}
|
|
2869
2865
|
set id(t) {
|
|
2870
|
-
const e =
|
|
2871
|
-
|
|
2866
|
+
const e = K(this, Ie);
|
|
2867
|
+
se(this, Ie, t), this.requestUpdate("id", e);
|
|
2872
2868
|
}
|
|
2873
2869
|
set disabled(t) {
|
|
2874
|
-
t ?
|
|
2870
|
+
t ? K(this, ut).states.add("disabled") : K(this, ut).states.delete("disabled");
|
|
2875
2871
|
}
|
|
2876
2872
|
get disabled() {
|
|
2877
|
-
return
|
|
2873
|
+
return K(this, ut).states.has("disabled");
|
|
2878
2874
|
}
|
|
2879
2875
|
set readOnly(t) {
|
|
2880
|
-
t ?
|
|
2876
|
+
t ? K(this, ut).states.add("readonly") : K(this, ut).states.delete("readonly");
|
|
2881
2877
|
}
|
|
2882
2878
|
get readOnly() {
|
|
2883
|
-
return
|
|
2879
|
+
return K(this, ut).states.has("readonly");
|
|
2884
2880
|
}
|
|
2885
2881
|
get value() {
|
|
2886
|
-
return
|
|
2882
|
+
return K(this, ae);
|
|
2887
2883
|
}
|
|
2888
2884
|
set value(t) {
|
|
2889
|
-
|
|
2885
|
+
Ze(this, le, vs).call(this, t);
|
|
2890
2886
|
}
|
|
2891
2887
|
connectedCallback() {
|
|
2892
|
-
super.connectedCallback(),
|
|
2888
|
+
super.connectedCallback(), Ze(this, le, vs).call(this, this.getAttribute("value") ?? "");
|
|
2893
2889
|
}
|
|
2894
2890
|
render() {
|
|
2895
|
-
return
|
|
2891
|
+
return y`
|
|
2896
2892
|
<use-date
|
|
2897
2893
|
part="date"
|
|
2898
|
-
value=${
|
|
2894
|
+
value=${K(this, Bi)}
|
|
2899
2895
|
.disabled=${this.disabled}
|
|
2900
2896
|
.readOnly=${this.readOnly}
|
|
2901
2897
|
.locale=${this.locale}
|
|
2902
|
-
@input=${
|
|
2898
|
+
@input=${Ze(this, le, _s)}
|
|
2903
2899
|
exportparts="segment-input, segment-literal"
|
|
2904
2900
|
></use-date>
|
|
2905
2901
|
<use-time
|
|
2906
2902
|
part="time"
|
|
2907
|
-
value=${
|
|
2903
|
+
value=${K(this, Vi)}
|
|
2908
2904
|
.disabled=${this.disabled}
|
|
2909
2905
|
.readOnly=${this.readOnly}
|
|
2910
2906
|
.locale=${this.locale}
|
|
@@ -2914,7 +2910,7 @@ let z = class extends I {
|
|
|
2914
2910
|
.fractionalSeconds=${this.fractionalSeconds}
|
|
2915
2911
|
.dayPeriod=${this.dayPeriod}
|
|
2916
2912
|
.hourFormat=${this.hourFormat}
|
|
2917
|
-
@input=${
|
|
2913
|
+
@input=${Ze(this, le, _s)}
|
|
2918
2914
|
exportparts="segment-input, segment-literal, segment-input-dayPeriod"
|
|
2919
2915
|
></use-time>
|
|
2920
2916
|
`;
|
|
@@ -2922,21 +2918,21 @@ let z = class extends I {
|
|
|
2922
2918
|
};
|
|
2923
2919
|
ut = /* @__PURE__ */ new WeakMap();
|
|
2924
2920
|
Ie = /* @__PURE__ */ new WeakMap();
|
|
2925
|
-
|
|
2921
|
+
ae = /* @__PURE__ */ new WeakMap();
|
|
2926
2922
|
Bi = /* @__PURE__ */ new WeakMap();
|
|
2927
2923
|
Vi = /* @__PURE__ */ new WeakMap();
|
|
2928
|
-
|
|
2924
|
+
le = /* @__PURE__ */ new WeakSet();
|
|
2929
2925
|
vs = function(t) {
|
|
2930
2926
|
const [e, i] = this.value.replace("Z", "").split("T");
|
|
2931
|
-
|
|
2927
|
+
se(this, Bi, e ?? ""), se(this, Vi, i ?? ""), se(this, ae, t), K(this, ut).setFormValue(K(this, ae));
|
|
2932
2928
|
};
|
|
2933
|
-
|
|
2929
|
+
an = function() {
|
|
2934
2930
|
const t = this.dateElement?.value ?? "", e = this.timeElement?.value ?? "";
|
|
2935
|
-
t ?
|
|
2931
|
+
t ? se(this, ae, `${t}T${e}`) : se(this, ae, ""), K(this, ut).setFormValue(K(this, ae));
|
|
2936
2932
|
};
|
|
2937
2933
|
_s = function(t) {
|
|
2938
2934
|
const e = t.target;
|
|
2939
|
-
(e === this.dateElement || e === this.timeElement) &&
|
|
2935
|
+
(e === this.dateElement || e === this.timeElement) && Ze(this, le, an).call(this);
|
|
2940
2936
|
};
|
|
2941
2937
|
z.formAssociated = !0;
|
|
2942
2938
|
z.shadowRootOptions = {
|
|
@@ -2950,57 +2946,57 @@ z.styles = pt`
|
|
|
2950
2946
|
gap: 1ch;
|
|
2951
2947
|
}
|
|
2952
2948
|
`;
|
|
2953
|
-
|
|
2949
|
+
ot([
|
|
2954
2950
|
k("use-date", !0)
|
|
2955
2951
|
], z.prototype, "dateElement", 2);
|
|
2956
|
-
|
|
2952
|
+
ot([
|
|
2957
2953
|
k("use-time", !0)
|
|
2958
2954
|
], z.prototype, "timeElement", 2);
|
|
2959
|
-
|
|
2955
|
+
ot([
|
|
2960
2956
|
h({ type: Boolean })
|
|
2961
2957
|
], z.prototype, "disabled", 1);
|
|
2962
|
-
|
|
2958
|
+
ot([
|
|
2963
2959
|
h({ type: Boolean, attribute: "readonly" })
|
|
2964
2960
|
], z.prototype, "readOnly", 1);
|
|
2965
|
-
|
|
2961
|
+
ot([
|
|
2966
2962
|
h({ type: String, attribute: !0 })
|
|
2967
2963
|
], z.prototype, "locale", 2);
|
|
2968
|
-
|
|
2964
|
+
ot([
|
|
2969
2965
|
h({ type: Boolean, attribute: !0 })
|
|
2970
2966
|
], z.prototype, "hours", 2);
|
|
2971
|
-
|
|
2967
|
+
ot([
|
|
2972
2968
|
h({ type: Boolean, attribute: !0 })
|
|
2973
2969
|
], z.prototype, "minutes", 2);
|
|
2974
|
-
|
|
2970
|
+
ot([
|
|
2975
2971
|
h({ type: Boolean, attribute: !0 })
|
|
2976
2972
|
], z.prototype, "seconds", 2);
|
|
2977
|
-
|
|
2973
|
+
ot([
|
|
2978
2974
|
h({ type: Boolean, attribute: !0 })
|
|
2979
2975
|
], z.prototype, "fractionalSeconds", 2);
|
|
2980
|
-
|
|
2976
|
+
ot([
|
|
2981
2977
|
h({ type: Boolean, attribute: !0 })
|
|
2982
2978
|
], z.prototype, "dayPeriod", 2);
|
|
2983
|
-
|
|
2979
|
+
ot([
|
|
2984
2980
|
h({ type: String, attribute: !0 })
|
|
2985
2981
|
], z.prototype, "hourFormat", 2);
|
|
2986
|
-
|
|
2982
|
+
ot([
|
|
2987
2983
|
h({ type: String })
|
|
2988
2984
|
], z.prototype, "value", 1);
|
|
2989
|
-
z =
|
|
2990
|
-
|
|
2985
|
+
z = ot([
|
|
2986
|
+
it("use-datetime")
|
|
2991
2987
|
], z);
|
|
2992
2988
|
export {
|
|
2993
2989
|
R as UseCalendar,
|
|
2994
2990
|
ct as UseDate,
|
|
2995
2991
|
z as UseDatetime,
|
|
2996
|
-
|
|
2992
|
+
me as UseDropdown,
|
|
2997
2993
|
_ as UseDuration,
|
|
2998
2994
|
Fi as UseFocusgroup,
|
|
2999
2995
|
kt as UseListbox,
|
|
3000
|
-
|
|
3001
|
-
|
|
2996
|
+
Fe as UseMenu,
|
|
2997
|
+
Pe as UseOption,
|
|
3002
2998
|
Ot as UseSelect,
|
|
3003
|
-
|
|
2999
|
+
C as UseTime,
|
|
3004
3000
|
qt as UseTree,
|
|
3005
3001
|
Pt as UseTreeitem,
|
|
3006
3002
|
ra as UseWidget
|