cally 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cally.d.ts +4 -0
- package/dist/cally.js +555 -621
- package/package.json +1 -1
package/dist/cally.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class te {
|
|
2
2
|
/**
|
|
3
3
|
* @type {T}
|
|
4
4
|
*/
|
|
@@ -20,7 +20,7 @@ class oe {
|
|
|
20
20
|
* @param {T} value
|
|
21
21
|
*/
|
|
22
22
|
set current(t) {
|
|
23
|
-
this.#t != t && (this.#t = t, this.#e.forEach((
|
|
23
|
+
this.#t != t && (this.#t = t, this.#e.forEach((n) => n(t)));
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @type {import("hooks").Ref["on"]}
|
|
@@ -29,113 +29,113 @@ class oe {
|
|
|
29
29
|
return this.#e.add(t), () => this.#e.delete(t);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
globalThis[
|
|
34
|
-
let N = globalThis[
|
|
35
|
-
const
|
|
36
|
-
const { i:
|
|
37
|
-
return r.value = e(r.value), r.effect = t, r.tag =
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
const r = () => o,
|
|
41
|
-
for (const
|
|
42
|
-
const
|
|
43
|
-
|
|
32
|
+
const Ct = (e) => new te(e), X = Symbol.for("atomico.hooks");
|
|
33
|
+
globalThis[X] = globalThis[X] || {};
|
|
34
|
+
let N = globalThis[X];
|
|
35
|
+
const ee = Symbol.for("Atomico.suspense"), Pt = Symbol.for("Atomico.effect"), ne = Symbol.for("Atomico.layoutEffect"), Nt = Symbol.for("Atomico.insertionEffect"), k = (e, t, n) => {
|
|
36
|
+
const { i: s, hooks: o } = N.c, r = o[s] = o[s] || {};
|
|
37
|
+
return r.value = e(r.value), r.effect = t, r.tag = n, N.c.i++, o[s].value;
|
|
38
|
+
}, se = (e) => k((t = Ct(e)) => t), $ = () => k((e = Ct(N.c.host)) => e), kt = () => N.c.update, oe = (e, t, n = 0) => {
|
|
39
|
+
let s = {}, o = !1;
|
|
40
|
+
const r = () => o, c = (i, u) => {
|
|
41
|
+
for (const d in s) {
|
|
42
|
+
const l = s[d];
|
|
43
|
+
l.effect && l.tag === i && (l.value = l.effect(l.value, u));
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
return { load: (
|
|
47
|
-
N.c = { host: t, hooks:
|
|
48
|
-
let
|
|
46
|
+
return { load: (i) => {
|
|
47
|
+
N.c = { host: t, hooks: s, update: e, i: 0, id: n };
|
|
48
|
+
let u;
|
|
49
49
|
try {
|
|
50
|
-
o = !1,
|
|
51
|
-
} catch (
|
|
52
|
-
if (
|
|
53
|
-
throw
|
|
50
|
+
o = !1, u = i();
|
|
51
|
+
} catch (d) {
|
|
52
|
+
if (d !== ee)
|
|
53
|
+
throw d;
|
|
54
54
|
o = !0;
|
|
55
55
|
} finally {
|
|
56
56
|
N.c = null;
|
|
57
57
|
}
|
|
58
|
-
return
|
|
59
|
-
}, cleanEffects: (
|
|
60
|
-
|
|
58
|
+
return u;
|
|
59
|
+
}, cleanEffects: (i) => (c(Nt, i), () => (c(ne, i), () => {
|
|
60
|
+
c(Pt, i);
|
|
61
61
|
})), isSuspense: r };
|
|
62
|
-
},
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
62
|
+
}, O = Symbol.for;
|
|
63
|
+
function Ot(e, t) {
|
|
64
|
+
const n = e.length;
|
|
65
|
+
if (n !== t.length)
|
|
66
66
|
return !1;
|
|
67
|
-
for (let
|
|
68
|
-
let o = e[
|
|
67
|
+
for (let s = 0; s < n; s++) {
|
|
68
|
+
let o = e[s], r = t[s];
|
|
69
69
|
if (o !== r)
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
72
|
return !0;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const T = (e) => typeof e == "function", R = (e) => typeof e == "object", { isArray: re } = Array, G = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
|
|
75
75
|
function At(e, t) {
|
|
76
|
-
let
|
|
77
|
-
const
|
|
76
|
+
let n;
|
|
77
|
+
const s = (o) => {
|
|
78
78
|
let { length: r } = o;
|
|
79
|
-
for (let
|
|
80
|
-
const f = o[
|
|
79
|
+
for (let c = 0; c < r; c++) {
|
|
80
|
+
const f = o[c];
|
|
81
81
|
if (f && Array.isArray(f))
|
|
82
|
-
|
|
82
|
+
s(f);
|
|
83
83
|
else {
|
|
84
|
-
const
|
|
85
|
-
if (f == null ||
|
|
84
|
+
const a = typeof f;
|
|
85
|
+
if (f == null || a === "function" || a === "boolean")
|
|
86
86
|
continue;
|
|
87
|
-
|
|
87
|
+
a === "string" || a === "number" ? (n == null && (n = ""), n += f) : (n != null && (t(n), n = null), t(f));
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
s(e), n != null && t(n);
|
|
92
92
|
}
|
|
93
|
-
const Rt = (e, t,
|
|
94
|
-
class
|
|
93
|
+
const Rt = (e, t, n) => (e.addEventListener(t, n), () => e.removeEventListener(t, n));
|
|
94
|
+
class Mt {
|
|
95
95
|
/**
|
|
96
96
|
*
|
|
97
97
|
* @param {HTMLElement} target
|
|
98
98
|
* @param {string} message
|
|
99
99
|
* @param {string} value
|
|
100
100
|
*/
|
|
101
|
-
constructor(t,
|
|
102
|
-
this.message =
|
|
101
|
+
constructor(t, n, s) {
|
|
102
|
+
this.message = n, this.target = t, this.value = s;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
class
|
|
105
|
+
class Ft extends Mt {
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class ce extends Mt {
|
|
108
108
|
}
|
|
109
|
-
const
|
|
110
|
-
function
|
|
109
|
+
const _ = "Custom", ie = null, ae = { true: 1, "": 1, 1: 1 };
|
|
110
|
+
function le(e, t, n, s, o) {
|
|
111
111
|
const {
|
|
112
112
|
type: r,
|
|
113
|
-
reflect:
|
|
113
|
+
reflect: c,
|
|
114
114
|
event: f,
|
|
115
|
-
value:
|
|
116
|
-
attr:
|
|
117
|
-
} =
|
|
115
|
+
value: a,
|
|
116
|
+
attr: i = ue(t)
|
|
117
|
+
} = n?.name != _ && R(n) && n != ie ? n : { type: n }, u = r?.name === _ && r.map, d = a != null ? r == Function || !T(a) ? () => a : a : null;
|
|
118
118
|
Object.defineProperty(e, t, {
|
|
119
119
|
configurable: !0,
|
|
120
120
|
/**
|
|
121
121
|
* @this {import("dom").AtomicoThisInternal}
|
|
122
122
|
* @param {any} newValue
|
|
123
123
|
*/
|
|
124
|
-
set(
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const { error:
|
|
124
|
+
set(l) {
|
|
125
|
+
const m = this[t];
|
|
126
|
+
d && r != Boolean && l == null && (l = d());
|
|
127
|
+
const { error: p, value: y } = (u ? he : me)(
|
|
128
128
|
r,
|
|
129
|
-
|
|
129
|
+
l
|
|
130
130
|
);
|
|
131
|
-
if (
|
|
132
|
-
throw new
|
|
131
|
+
if (p && y != null)
|
|
132
|
+
throw new Ft(
|
|
133
133
|
this,
|
|
134
134
|
`The value defined for prop '${t}' must be of type '${r.name}'`,
|
|
135
|
-
|
|
135
|
+
y
|
|
136
136
|
);
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
m != y && (this._props[t] = y ?? void 0, this.update(), f && It(this, f), this.updated.then(() => {
|
|
138
|
+
c && (this._ignoreAttr = i, fe(this, r, i, this[t]), this._ignoreAttr = null);
|
|
139
139
|
}));
|
|
140
140
|
},
|
|
141
141
|
/**
|
|
@@ -144,21 +144,21 @@ function he(e, t, s, n, o) {
|
|
|
144
144
|
get() {
|
|
145
145
|
return this._props[t];
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), d && (o[t] = d()), s[i] = { prop: t, type: r };
|
|
148
148
|
}
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
t?.name ===
|
|
152
|
-
),
|
|
149
|
+
const It = (e, { type: t, base: n = CustomEvent, ...s }) => e.dispatchEvent(new n(t, s)), ue = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), fe = (e, t, n, s) => s == null || t == Boolean && !s ? e.removeAttribute(n) : e.setAttribute(
|
|
150
|
+
n,
|
|
151
|
+
t?.name === _ && t?.serialize ? t?.serialize(s) : R(s) ? JSON.stringify(s) : t == Boolean ? "" : s
|
|
152
|
+
), de = (e, t) => e == Boolean ? !!ae[t] : e == Number ? Number(t) : e == String ? t : e == Array || e == Object ? JSON.parse(t) : e.name == _ ? t : (
|
|
153
153
|
// TODO: If when defining reflect the prop can also be of type string?
|
|
154
154
|
new e(t)
|
|
155
|
-
),
|
|
155
|
+
), he = ({ map: e }, t) => {
|
|
156
156
|
try {
|
|
157
157
|
return { value: e(t), error: !1 };
|
|
158
158
|
} catch {
|
|
159
159
|
return { value: t, error: !0 };
|
|
160
160
|
}
|
|
161
|
-
},
|
|
161
|
+
}, me = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? {
|
|
162
162
|
value: t,
|
|
163
163
|
error: {}.toString.call(t) !== `[object ${e.name}]`
|
|
164
164
|
} : t instanceof e ? {
|
|
@@ -168,17 +168,17 @@ const xt = (e, { type: t, base: s = CustomEvent, ...n }) => e.dispatchEvent(new
|
|
|
168
168
|
value: t,
|
|
169
169
|
error: e == Number ? typeof t != "number" ? !0 : Number.isNaN(t) : e == String ? typeof t != "string" : typeof t != "boolean"
|
|
170
170
|
} : { value: t, error: !0 };
|
|
171
|
-
let
|
|
172
|
-
const
|
|
171
|
+
let ye = 0;
|
|
172
|
+
const pe = (e) => {
|
|
173
173
|
const t = (e?.dataset || {})?.hydrate || "";
|
|
174
|
-
return t || "c" +
|
|
175
|
-
},
|
|
176
|
-
const
|
|
177
|
-
class
|
|
174
|
+
return t || "c" + ye++;
|
|
175
|
+
}, j = (e, t = HTMLElement) => {
|
|
176
|
+
const n = {}, s = {}, o = "prototype" in t && t.prototype instanceof Element, r = o ? t : "base" in t ? t.base : HTMLElement, { props: c, styles: f } = o ? e : t;
|
|
177
|
+
class a extends r {
|
|
178
178
|
constructor() {
|
|
179
179
|
super(), this._setup(), this._render = () => e({ ...this._props });
|
|
180
|
-
for (const
|
|
181
|
-
this[
|
|
180
|
+
for (const u in s)
|
|
181
|
+
this[u] = s[u];
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* @returns {import("core").Sheets[]}
|
|
@@ -190,37 +190,37 @@ const we = (e) => {
|
|
|
190
190
|
if (this._props)
|
|
191
191
|
return;
|
|
192
192
|
this._props = {};
|
|
193
|
-
let
|
|
193
|
+
let u, d;
|
|
194
194
|
this.mounted = new Promise(
|
|
195
|
-
(
|
|
196
|
-
|
|
195
|
+
(E) => this.mount = () => {
|
|
196
|
+
E(), u != this.parentNode && (d != u ? this.unmounted.then(this.update) : this.update()), u = this.parentNode;
|
|
197
197
|
}
|
|
198
198
|
), this.unmounted = new Promise(
|
|
199
|
-
(
|
|
200
|
-
|
|
199
|
+
(E) => this.unmount = () => {
|
|
200
|
+
E(), (u != this.parentNode || !this.isConnected) && (l.cleanEffects(!0)()(), d = this.parentNode, u = null);
|
|
201
201
|
}
|
|
202
202
|
), this.symbolId = this.symbolId || Symbol(), this.symbolIdParent = Symbol();
|
|
203
|
-
const
|
|
203
|
+
const l = oe(
|
|
204
204
|
() => this.update(),
|
|
205
205
|
this,
|
|
206
|
-
|
|
206
|
+
pe(this)
|
|
207
207
|
);
|
|
208
|
-
let
|
|
209
|
-
const
|
|
210
|
-
this.update = () => (
|
|
208
|
+
let m, p = !0;
|
|
209
|
+
const y = G(this);
|
|
210
|
+
this.update = () => (m || (m = !0, this.updated = (this.updated || this.mounted).then(() => {
|
|
211
211
|
try {
|
|
212
|
-
const
|
|
213
|
-
return
|
|
214
|
-
|
|
212
|
+
const E = l.load(this._render), h = l.cleanEffects();
|
|
213
|
+
return E && //@ts-ignore
|
|
214
|
+
E.render(this, this.symbolId, y), m = !1, p && !l.isSuspense() && (p = !1, !y && be(this)), h();
|
|
215
215
|
} finally {
|
|
216
|
-
|
|
216
|
+
m = !1;
|
|
217
217
|
}
|
|
218
218
|
}).then(
|
|
219
219
|
/**
|
|
220
220
|
* @param {import("internal/hooks.js").CleanUseEffects} [cleanUseEffect]
|
|
221
221
|
*/
|
|
222
|
-
(
|
|
223
|
-
|
|
222
|
+
(E) => {
|
|
223
|
+
E && E();
|
|
224
224
|
}
|
|
225
225
|
)), this.updated), this.update();
|
|
226
226
|
}
|
|
@@ -236,74 +236,74 @@ const we = (e) => {
|
|
|
236
236
|
* @param {(string|null)} oldValue
|
|
237
237
|
* @param {(string|null)} value
|
|
238
238
|
*/
|
|
239
|
-
attributeChangedCallback(
|
|
240
|
-
if (
|
|
241
|
-
if (
|
|
239
|
+
attributeChangedCallback(u, d, l) {
|
|
240
|
+
if (n[u]) {
|
|
241
|
+
if (u === this._ignoreAttr || d === l)
|
|
242
242
|
return;
|
|
243
|
-
const { prop:
|
|
243
|
+
const { prop: m, type: p } = n[u];
|
|
244
244
|
try {
|
|
245
|
-
this[
|
|
245
|
+
this[m] = de(p, l);
|
|
246
246
|
} catch {
|
|
247
|
-
throw new
|
|
247
|
+
throw new ce(
|
|
248
248
|
this,
|
|
249
|
-
`The value defined as attr '${
|
|
250
|
-
|
|
249
|
+
`The value defined as attr '${u}' cannot be parsed by type '${p.name}'`,
|
|
250
|
+
l
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
253
|
} else
|
|
254
|
-
super.attributeChangedCallback(
|
|
254
|
+
super.attributeChangedCallback(u, d, l);
|
|
255
255
|
}
|
|
256
256
|
static get props() {
|
|
257
|
-
return { ...super.props, ...
|
|
257
|
+
return { ...super.props, ...c };
|
|
258
258
|
}
|
|
259
259
|
static get observedAttributes() {
|
|
260
|
-
const
|
|
261
|
-
for (const
|
|
262
|
-
|
|
263
|
-
return Object.keys(
|
|
260
|
+
const u = super.observedAttributes || [];
|
|
261
|
+
for (const d in c)
|
|
262
|
+
le(this.prototype, d, c[d], n, s);
|
|
263
|
+
return Object.keys(n).concat(u);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
return
|
|
266
|
+
return a;
|
|
267
267
|
};
|
|
268
|
-
function
|
|
269
|
-
const { styles: t } = e.constructor, { shadowRoot:
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
268
|
+
function be(e) {
|
|
269
|
+
const { styles: t } = e.constructor, { shadowRoot: n } = e;
|
|
270
|
+
if (n && t.length) {
|
|
271
|
+
const s = [];
|
|
272
272
|
At(t, (o) => {
|
|
273
|
-
o && (o instanceof Element ?
|
|
274
|
-
}),
|
|
273
|
+
o && (o instanceof Element ? n.appendChild(o.cloneNode(!0)) : s.push(o));
|
|
274
|
+
}), s.length && (n.adoptedStyleSheets = s);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
const Ut = (e) => (t,
|
|
278
|
-
|
|
277
|
+
const Ut = (e) => (t, n) => {
|
|
278
|
+
k(
|
|
279
279
|
/**
|
|
280
280
|
* Clean the effect hook
|
|
281
281
|
* @type {import("internal/hooks.js").CollectorEffect}
|
|
282
282
|
*/
|
|
283
|
-
([
|
|
283
|
+
([s, o] = []) => ((o || !o) && (o && Ot(o, n) ? s = s || !0 : (T(s) && s(), s = null)), [s, n]),
|
|
284
284
|
/**
|
|
285
285
|
* @returns {any}
|
|
286
286
|
*/
|
|
287
|
-
([
|
|
287
|
+
([s, o], r) => r ? (T(s) && s(), []) : [s || t(), o],
|
|
288
288
|
e
|
|
289
289
|
);
|
|
290
|
-
},
|
|
291
|
-
class
|
|
290
|
+
}, nt = Ut(Pt), ge = Ut(Nt);
|
|
291
|
+
class $t extends Array {
|
|
292
292
|
/**
|
|
293
293
|
*
|
|
294
294
|
* @param {any} initialState
|
|
295
295
|
* @param {(nextState: any, state:any[], mount: boolean )=>void} mapState
|
|
296
296
|
*/
|
|
297
|
-
constructor(t,
|
|
298
|
-
let
|
|
297
|
+
constructor(t, n) {
|
|
298
|
+
let s = !0;
|
|
299
299
|
const o = (r) => {
|
|
300
300
|
try {
|
|
301
|
-
|
|
301
|
+
n(r, this, s);
|
|
302
302
|
} finally {
|
|
303
|
-
|
|
303
|
+
s = !1;
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
super(void 0, o,
|
|
306
|
+
super(void 0, o, n), o(t);
|
|
307
307
|
}
|
|
308
308
|
/**
|
|
309
309
|
* The following code allows a mutable approach to useState
|
|
@@ -318,45 +318,45 @@ class _t extends Array {
|
|
|
318
318
|
// this[2](nextState, this);
|
|
319
319
|
// }
|
|
320
320
|
}
|
|
321
|
-
const
|
|
321
|
+
const st = (e) => {
|
|
322
322
|
const t = kt();
|
|
323
|
-
return
|
|
324
|
-
(
|
|
325
|
-
|
|
326
|
-
})) =>
|
|
323
|
+
return k(
|
|
324
|
+
(n = new $t(e, (s, o, r) => {
|
|
325
|
+
s = T(s) ? s(o[0]) : s, s !== o[0] && (o[0] = s, r || t());
|
|
326
|
+
})) => n
|
|
327
327
|
);
|
|
328
328
|
}, P = (e, t) => {
|
|
329
|
-
const [
|
|
330
|
-
return
|
|
329
|
+
const [n] = k(([s, o, r = 0] = []) => ((!o || o && !Ot(o, t)) && (s = e()), [s, t, r]));
|
|
330
|
+
return n;
|
|
331
331
|
}, Lt = (e) => {
|
|
332
|
-
const { current: t } =
|
|
332
|
+
const { current: t } = $();
|
|
333
333
|
if (!(e in t))
|
|
334
|
-
throw new
|
|
334
|
+
throw new Ft(
|
|
335
335
|
t,
|
|
336
336
|
`For useProp("${e}"), the prop does not exist on the host.`,
|
|
337
337
|
e
|
|
338
338
|
);
|
|
339
|
-
return
|
|
340
|
-
(
|
|
341
|
-
|
|
342
|
-
})) => (
|
|
339
|
+
return k(
|
|
340
|
+
(n = new $t(t[e], (s, o) => {
|
|
341
|
+
s = T(s) ? s(t[e]) : s, t[e] = s;
|
|
342
|
+
})) => (n[0] = t[e], n)
|
|
343
343
|
);
|
|
344
|
-
},
|
|
345
|
-
const
|
|
346
|
-
return
|
|
344
|
+
}, C = (e, t = {}) => {
|
|
345
|
+
const n = $();
|
|
346
|
+
return n[e] || (n[e] = (s = t.detail) => It(n.current, {
|
|
347
347
|
type: e,
|
|
348
348
|
...t,
|
|
349
|
-
detail:
|
|
350
|
-
})),
|
|
351
|
-
},
|
|
352
|
-
globalThis[
|
|
349
|
+
detail: s
|
|
350
|
+
})), n[e];
|
|
351
|
+
}, Q = O("atomico/options");
|
|
352
|
+
globalThis[Q] = globalThis[Q] || {
|
|
353
353
|
sheet: !!document.adoptedStyleSheets
|
|
354
354
|
};
|
|
355
|
-
const
|
|
355
|
+
const _t = globalThis[Q], Ee = {
|
|
356
356
|
checked: 1,
|
|
357
357
|
value: 1,
|
|
358
358
|
selected: 1
|
|
359
|
-
},
|
|
359
|
+
}, De = {
|
|
360
360
|
list: 1,
|
|
361
361
|
type: 1,
|
|
362
362
|
size: 1,
|
|
@@ -366,24 +366,24 @@ const Yt = globalThis[tt], ve = {
|
|
|
366
366
|
src: 1,
|
|
367
367
|
href: 1,
|
|
368
368
|
slot: 1
|
|
369
|
-
},
|
|
369
|
+
}, Se = {
|
|
370
370
|
shadowDom: 1,
|
|
371
371
|
staticNode: 1,
|
|
372
372
|
cloneNode: 1,
|
|
373
373
|
children: 1,
|
|
374
374
|
key: 1
|
|
375
|
-
}, L = {},
|
|
376
|
-
class
|
|
375
|
+
}, L = {}, V = [];
|
|
376
|
+
class tt extends Text {
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const we = O("atomico/id"), M = O("atomico/type"), H = O("atomico/ref"), jt = O("atomico/vnode"), ve = () => {
|
|
379
379
|
};
|
|
380
|
-
function
|
|
381
|
-
return
|
|
380
|
+
function Te(e, t, n) {
|
|
381
|
+
return xt(this, e, t, n);
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
let { children: o } =
|
|
386
|
-
if (o = o ?? (
|
|
383
|
+
const Yt = (e, t, ...n) => {
|
|
384
|
+
const s = t || L;
|
|
385
|
+
let { children: o } = s;
|
|
386
|
+
if (o = o ?? (n.length ? n : V), e === ve)
|
|
387
387
|
return o;
|
|
388
388
|
const r = e ? e instanceof Node ? 1 : (
|
|
389
389
|
//@ts-ignore
|
|
@@ -391,170 +391,170 @@ const jt = (e, t, ...s) => {
|
|
|
391
391
|
) : 0;
|
|
392
392
|
if (r === !1 && e instanceof Function)
|
|
393
393
|
return e(
|
|
394
|
-
o !=
|
|
394
|
+
o != V ? { children: o, ...s } : s
|
|
395
395
|
);
|
|
396
|
-
const
|
|
396
|
+
const c = _t.render || Te;
|
|
397
397
|
return {
|
|
398
|
-
[
|
|
398
|
+
[M]: jt,
|
|
399
399
|
type: e,
|
|
400
|
-
props:
|
|
400
|
+
props: s,
|
|
401
401
|
children: o,
|
|
402
|
-
key:
|
|
402
|
+
key: s.key,
|
|
403
403
|
// key for lists by keys
|
|
404
404
|
// define if the node declares its shadowDom
|
|
405
|
-
shadow:
|
|
405
|
+
shadow: s.shadowDom,
|
|
406
406
|
// allows renderings to run only once
|
|
407
|
-
static:
|
|
407
|
+
static: s.staticNode,
|
|
408
408
|
// defines whether the type is a childNode `1` or a constructor `2`
|
|
409
409
|
raw: r,
|
|
410
410
|
// defines whether to use the second parameter for document.createElement
|
|
411
|
-
is:
|
|
411
|
+
is: s.is,
|
|
412
412
|
// clone the node if it comes from a reference
|
|
413
|
-
clone:
|
|
414
|
-
render:
|
|
413
|
+
clone: s.cloneNode,
|
|
414
|
+
render: c
|
|
415
415
|
};
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function xt(e, t, n = we, s, o) {
|
|
418
418
|
let r;
|
|
419
|
-
if (t && t[
|
|
419
|
+
if (t && t[n] && t[n].vnode == e || e[M] != jt)
|
|
420
420
|
return t;
|
|
421
|
-
(e || !t) && (o = o || e.type == "svg", r = e.type != "host" && (e.raw == 1 ? (t && e.clone ? t[
|
|
421
|
+
(e || !t) && (o = o || e.type == "svg", r = e.type != "host" && (e.raw == 1 ? (t && e.clone ? t[H] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[H] || t.localName != e.type : !t), r && e.type != null && (e.raw == 1 && e.clone ? (s = !0, t = e.type.cloneNode(!0), t[H] = e.type) : t = e.raw == 1 ? e.type : e.raw == 2 ? new e.type() : o ? document.createElementNS(
|
|
422
422
|
"http://www.w3.org/2000/svg",
|
|
423
423
|
e.type
|
|
424
424
|
) : document.createElement(
|
|
425
425
|
e.type,
|
|
426
426
|
e.is ? { is: e.is } : void 0
|
|
427
427
|
)));
|
|
428
|
-
const
|
|
429
|
-
let { fragment:
|
|
430
|
-
const { children:
|
|
431
|
-
if (
|
|
428
|
+
const c = t[n] ? t[n] : L, { vnode: f = L, cycle: a = 0 } = c;
|
|
429
|
+
let { fragment: i, handlers: u } = c;
|
|
430
|
+
const { children: d = V, props: l = L } = f;
|
|
431
|
+
if (u = r ? {} : u || {}, e.static && !r)
|
|
432
432
|
return t;
|
|
433
433
|
if (e.shadow && !t.shadowRoot && // @ts-ignore
|
|
434
|
-
t.attachShadow({ mode: "open", ...e.shadow }), e.props !=
|
|
435
|
-
const
|
|
436
|
-
|
|
434
|
+
t.attachShadow({ mode: "open", ...e.shadow }), e.props != l && Ne(t, l, e.props, u, o), e.children !== d) {
|
|
435
|
+
const m = e.shadow ? t.shadowRoot : t;
|
|
436
|
+
i = Pe(
|
|
437
437
|
e.children,
|
|
438
438
|
/**
|
|
439
439
|
* @todo for hydration use attribute and send childNodes
|
|
440
440
|
*/
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
i,
|
|
442
|
+
m,
|
|
443
|
+
n,
|
|
444
444
|
// add support to foreignObject, children will escape from svg
|
|
445
|
-
!
|
|
445
|
+
!a && s,
|
|
446
446
|
o && e.type == "foreignObject" ? !1 : o
|
|
447
447
|
);
|
|
448
448
|
}
|
|
449
|
-
return t[
|
|
449
|
+
return t[n] = { vnode: e, handlers: u, fragment: i, cycle: a + 1 }, t;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const
|
|
451
|
+
function Ce(e, t) {
|
|
452
|
+
const n = new tt(""), s = new tt("");
|
|
453
453
|
let o;
|
|
454
|
-
if (e[t ? "prepend" : "append"](
|
|
454
|
+
if (e[t ? "prepend" : "append"](n), t) {
|
|
455
455
|
let { lastElementChild: r } = e;
|
|
456
456
|
for (; r; ) {
|
|
457
|
-
const { previousElementSibling:
|
|
458
|
-
if (
|
|
457
|
+
const { previousElementSibling: c } = r;
|
|
458
|
+
if (G(r, !0) && !G(c, !0)) {
|
|
459
459
|
o = r;
|
|
460
460
|
break;
|
|
461
461
|
}
|
|
462
|
-
r =
|
|
462
|
+
r = c;
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
return o ? o.before(
|
|
466
|
-
markStart:
|
|
467
|
-
markEnd:
|
|
465
|
+
return o ? o.before(s) : e.append(s), {
|
|
466
|
+
markStart: n,
|
|
467
|
+
markEnd: s
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function
|
|
471
|
-
e = e == null ? null :
|
|
472
|
-
const
|
|
473
|
-
let
|
|
474
|
-
const
|
|
475
|
-
let
|
|
476
|
-
if (e && At(e, (
|
|
477
|
-
if (typeof
|
|
470
|
+
function Pe(e, t, n, s, o, r) {
|
|
471
|
+
e = e == null ? null : re(e) ? e : [e];
|
|
472
|
+
const c = t || Ce(n, o), { markStart: f, markEnd: a, keyes: i } = c;
|
|
473
|
+
let u;
|
|
474
|
+
const d = i && /* @__PURE__ */ new Set();
|
|
475
|
+
let l = f;
|
|
476
|
+
if (e && At(e, (m) => {
|
|
477
|
+
if (typeof m == "object" && !m[M])
|
|
478
478
|
return;
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
|
|
479
|
+
const p = m[M] && m.key, y = i && p != null && i.get(p);
|
|
480
|
+
l != a && l === y ? d.delete(l) : l = l == a ? a : l.nextSibling;
|
|
481
|
+
const E = i ? y : l;
|
|
482
|
+
let h = E;
|
|
483
|
+
if (m[M])
|
|
484
|
+
h = xt(m, E, s, o, r);
|
|
485
485
|
else {
|
|
486
|
-
const
|
|
487
|
-
!(
|
|
486
|
+
const v = m + "";
|
|
487
|
+
!(h instanceof Text) || h instanceof tt ? h = new Text(v) : h.data != v && (h.data = v);
|
|
488
488
|
}
|
|
489
|
-
|
|
490
|
-
}),
|
|
491
|
-
for (;
|
|
492
|
-
const
|
|
493
|
-
|
|
489
|
+
h != l && (i && d.delete(h), !E || i ? (n.insertBefore(h, l), i && l != a && d.add(l)) : E == a ? n.insertBefore(h, a) : (n.replaceChild(h, E), l = h)), p != null && (u = u || /* @__PURE__ */ new Map(), u.set(p, h));
|
|
490
|
+
}), l = l == a ? a : l.nextSibling, t && l != a)
|
|
491
|
+
for (; l != a; ) {
|
|
492
|
+
const m = l;
|
|
493
|
+
l = l.nextSibling, m.remove();
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return d && d.forEach((m) => m.remove()), c.keyes = u, c;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function Ne(e, t, n, s, o) {
|
|
498
498
|
for (const r in t)
|
|
499
|
-
!(r in
|
|
500
|
-
for (const r in
|
|
501
|
-
|
|
499
|
+
!(r in n) && yt(e, r, t[r], null, o, s);
|
|
500
|
+
for (const r in n)
|
|
501
|
+
yt(e, r, t[r], n[r], o, s);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
if (t = t == "class" && !o ? "className" : t,
|
|
505
|
-
if (t[0] == "o" && t[1] == "n" && (
|
|
506
|
-
|
|
503
|
+
function yt(e, t, n, s, o, r) {
|
|
504
|
+
if (t = t == "class" && !o ? "className" : t, n = n ?? null, s = s ?? null, t in e && Ee[t] && (n = e[t]), !(s === n || Se[t] || t[0] == "_"))
|
|
505
|
+
if (t[0] == "o" && t[1] == "n" && (T(s) || T(n)))
|
|
506
|
+
ke(e, t.slice(2), s, r);
|
|
507
507
|
else if (t == "ref")
|
|
508
|
-
|
|
508
|
+
s && (T(s) ? s(e) : s.current = e);
|
|
509
509
|
else if (t == "style") {
|
|
510
|
-
const { style:
|
|
511
|
-
|
|
512
|
-
const f = R(
|
|
510
|
+
const { style: c } = e;
|
|
511
|
+
n = n || "", s = s || "";
|
|
512
|
+
const f = R(n), a = R(s);
|
|
513
513
|
if (f)
|
|
514
|
-
for (const
|
|
515
|
-
if (
|
|
516
|
-
!(
|
|
514
|
+
for (const i in n)
|
|
515
|
+
if (a)
|
|
516
|
+
!(i in s) && pt(c, i, null);
|
|
517
517
|
else
|
|
518
518
|
break;
|
|
519
|
-
if (
|
|
520
|
-
for (const
|
|
521
|
-
const
|
|
522
|
-
f &&
|
|
519
|
+
if (a)
|
|
520
|
+
for (const i in s) {
|
|
521
|
+
const u = s[i];
|
|
522
|
+
f && n[i] === u || pt(c, i, u);
|
|
523
523
|
}
|
|
524
524
|
else
|
|
525
|
-
|
|
525
|
+
c.cssText = s;
|
|
526
526
|
} else {
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
R(
|
|
527
|
+
const c = t[0] == "$" ? t.slice(1) : t;
|
|
528
|
+
c === t && (!o && !De[t] && t in e || T(s) || T(n)) ? e[t] = s ?? "" : s == null ? e.removeAttribute(c) : e.setAttribute(
|
|
529
|
+
c,
|
|
530
|
+
R(s) ? JSON.stringify(s) : s
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
if (
|
|
536
|
-
if (!
|
|
537
|
-
const o =
|
|
538
|
-
e.addEventListener(t,
|
|
534
|
+
function ke(e, t, n, s) {
|
|
535
|
+
if (s.handleEvent || (s.handleEvent = (o) => s[o.type].call(e, o)), n) {
|
|
536
|
+
if (!s[t]) {
|
|
537
|
+
const o = n.capture || n.once || n.passive ? Object.assign({}, n) : null;
|
|
538
|
+
e.addEventListener(t, s, o);
|
|
539
539
|
}
|
|
540
|
-
|
|
540
|
+
s[t] = n;
|
|
541
541
|
} else
|
|
542
|
-
|
|
542
|
+
s[t] && (e.removeEventListener(t, s), delete s[t]);
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
let
|
|
546
|
-
|
|
544
|
+
function pt(e, t, n) {
|
|
545
|
+
let s = "setProperty";
|
|
546
|
+
n == null && (s = "removeProperty", n = null), ~t.indexOf("-") ? e[s](t, n) : e[t] = n;
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
function
|
|
550
|
-
const
|
|
551
|
-
(
|
|
548
|
+
const bt = {};
|
|
549
|
+
function Y(e, ...t) {
|
|
550
|
+
const n = (e.raw || e).reduce(
|
|
551
|
+
(s, o, r) => s + o + (t[r] || ""),
|
|
552
552
|
""
|
|
553
553
|
);
|
|
554
|
-
return
|
|
554
|
+
return bt[n] = bt[n] || Oe(n);
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
if (
|
|
556
|
+
function Oe(e) {
|
|
557
|
+
if (_t.sheet) {
|
|
558
558
|
const t = new CSSStyleSheet();
|
|
559
559
|
return t.replaceSync(e), t;
|
|
560
560
|
} else {
|
|
@@ -562,52 +562,52 @@ function Fe(e) {
|
|
|
562
562
|
return t.textContent = e, t;
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
|
-
const
|
|
566
|
-
const
|
|
567
|
-
|
|
565
|
+
const Ae = Yt("host", { style: "display: contents" }), K = O("atomico/context"), Re = (e, t) => {
|
|
566
|
+
const n = $();
|
|
567
|
+
ge(
|
|
568
568
|
() => Rt(
|
|
569
|
-
|
|
569
|
+
n.current,
|
|
570
570
|
"ConnectContext",
|
|
571
571
|
/**
|
|
572
572
|
* @param {CustomEvent<import("context").DetailConnectContext>} event
|
|
573
573
|
*/
|
|
574
|
-
(
|
|
575
|
-
e ===
|
|
574
|
+
(s) => {
|
|
575
|
+
e === s.detail.id && (s.stopPropagation(), s.detail.connect(t));
|
|
576
576
|
}
|
|
577
577
|
),
|
|
578
578
|
[e]
|
|
579
579
|
);
|
|
580
|
-
},
|
|
581
|
-
const t =
|
|
580
|
+
}, Me = (e) => {
|
|
581
|
+
const t = C("ConnectContext", {
|
|
582
582
|
bubbles: !0,
|
|
583
583
|
composed: !0
|
|
584
|
-
}),
|
|
584
|
+
}), n = () => {
|
|
585
585
|
let r;
|
|
586
586
|
return t({
|
|
587
587
|
id: e,
|
|
588
|
-
connect(
|
|
589
|
-
r =
|
|
588
|
+
connect(c) {
|
|
589
|
+
r = c;
|
|
590
590
|
}
|
|
591
591
|
}), r;
|
|
592
|
-
}, [
|
|
593
|
-
|
|
592
|
+
}, [s, o] = st(
|
|
593
|
+
n
|
|
594
594
|
);
|
|
595
|
-
return
|
|
596
|
-
|
|
595
|
+
return nt(() => {
|
|
596
|
+
s || (e[K] || (e[K] = customElements.whenDefined(
|
|
597
597
|
new e().localName
|
|
598
|
-
)), e[
|
|
599
|
-
() => o(
|
|
598
|
+
)), e[K].then(
|
|
599
|
+
() => o(n)
|
|
600
600
|
));
|
|
601
|
-
}, [e]),
|
|
602
|
-
},
|
|
603
|
-
const t =
|
|
604
|
-
return
|
|
601
|
+
}, [e]), s;
|
|
602
|
+
}, Fe = (e) => {
|
|
603
|
+
const t = Me(e), n = kt();
|
|
604
|
+
return nt(() => {
|
|
605
605
|
if (t)
|
|
606
|
-
return Rt(t, "UpdatedValue",
|
|
606
|
+
return Rt(t, "UpdatedValue", n);
|
|
607
607
|
}, [t]), (t || e).value;
|
|
608
|
-
},
|
|
609
|
-
const t =
|
|
610
|
-
() => (
|
|
608
|
+
}, Ie = (e) => {
|
|
609
|
+
const t = j(
|
|
610
|
+
() => (Re(t, $().current), Ae),
|
|
611
611
|
{
|
|
612
612
|
props: {
|
|
613
613
|
value: {
|
|
@@ -619,343 +619,254 @@ const Ie = jt("host", { style: "display: contents" }), Z = k("atomico/context"),
|
|
|
619
619
|
}
|
|
620
620
|
);
|
|
621
621
|
return t.value = e, t;
|
|
622
|
-
},
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
-
}
|
|
626
|
-
function ct(e, t = 0) {
|
|
627
|
-
const s = e.toDate(), n = s.getUTCDay(), o = (n < t ? 7 : 0) + n - t;
|
|
628
|
-
return s.setUTCDate(s.getUTCDate() - o), g.from(s);
|
|
629
|
-
}
|
|
630
|
-
function Ht(e, t = 0) {
|
|
631
|
-
return ct(e, t).add({ days: 6 });
|
|
632
|
-
}
|
|
633
|
-
function ut(e) {
|
|
634
|
-
return g.from(new Date(Date.UTC(e.year, e.month, 0)));
|
|
635
|
-
}
|
|
636
|
-
function Wt(e, t) {
|
|
637
|
-
const s = e.toDate(), n = t.toDate();
|
|
638
|
-
return s < n ? -1 : s > n ? 1 : 0;
|
|
639
|
-
}
|
|
640
|
-
function z(e, t, s) {
|
|
641
|
-
return t && g.compare(e, t) < 0 ? t : s && g.compare(e, s) > 0 ? s : e;
|
|
642
|
-
}
|
|
643
|
-
function st(e, t, s) {
|
|
644
|
-
return z(e, t, s) === e;
|
|
622
|
+
}, b = (e, t, n) => (t == null ? t = { key: n } : t.key = n, Yt(e, t)), F = b, Bt = Y`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, zt = Y`.vh{position:absolute;transform:scale(0)}`;
|
|
623
|
+
function ot() {
|
|
624
|
+
return D.from(/* @__PURE__ */ new Date());
|
|
645
625
|
}
|
|
646
|
-
function
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
e = e.add(s), n.push(e);
|
|
650
|
-
return n;
|
|
651
|
-
}
|
|
652
|
-
function $e(e, t) {
|
|
653
|
-
const s = [];
|
|
654
|
-
for (let n = 0; n < e.length; n += t)
|
|
655
|
-
s.push(e.slice(n, n + t));
|
|
656
|
-
return s;
|
|
626
|
+
function rt(e, t = 0) {
|
|
627
|
+
const n = w(e), s = n.getUTCDay(), o = (s < t ? 7 : 0) + s - t;
|
|
628
|
+
return n.setUTCDate(n.getUTCDate() - o), D.from(n);
|
|
657
629
|
}
|
|
658
|
-
function
|
|
659
|
-
|
|
660
|
-
return $e(Ye(s, n), 7);
|
|
630
|
+
function qt(e, t = 0) {
|
|
631
|
+
return rt(e, t).add({ days: 6 });
|
|
661
632
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (Kt in e)
|
|
665
|
-
return { years: -e.years };
|
|
666
|
-
if (Jt in e)
|
|
667
|
-
return { months: -e.months };
|
|
668
|
-
if (Zt in e)
|
|
669
|
-
return { days: -e.days };
|
|
670
|
-
throw new TypeError();
|
|
633
|
+
function Ht(e) {
|
|
634
|
+
return D.from(new Date(Date.UTC(e.year, e.month, 0)));
|
|
671
635
|
}
|
|
672
|
-
function
|
|
673
|
-
return
|
|
636
|
+
function x(e, t, n) {
|
|
637
|
+
return t && D.compare(e, t) < 0 ? t : n && D.compare(e, n) > 0 ? n : e;
|
|
674
638
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
639
|
+
const Ue = { days: 1 };
|
|
640
|
+
function $e(e, t = 0) {
|
|
641
|
+
let n = rt(e.toPlainDate(), t);
|
|
642
|
+
const s = qt(Ht(e), t), o = [];
|
|
643
|
+
for (; D.compare(n, s) < 0; ) {
|
|
644
|
+
const r = [];
|
|
645
|
+
for (let c = 0; c < 7; c++)
|
|
646
|
+
r.push(n), n = n.add(Ue);
|
|
647
|
+
o.push(r);
|
|
648
|
+
}
|
|
649
|
+
return o;
|
|
682
650
|
}
|
|
683
|
-
function
|
|
684
|
-
return
|
|
651
|
+
function w(e) {
|
|
652
|
+
return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1));
|
|
685
653
|
}
|
|
686
|
-
const
|
|
687
|
-
class
|
|
688
|
-
constructor(t,
|
|
689
|
-
this.year = t, this.month =
|
|
654
|
+
const Le = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, J = (e, t) => e.toString().padStart(t, "0");
|
|
655
|
+
class D {
|
|
656
|
+
constructor(t, n, s) {
|
|
657
|
+
this.year = t, this.month = n, this.day = s;
|
|
690
658
|
}
|
|
659
|
+
// this is an incomplete implementation that only handles arithmetic on a single unit at a time.
|
|
660
|
+
// i didn't want to get into more complex arithmetic since it get tricky fast
|
|
661
|
+
// this is enough to serve my needs and will still be a drop-in replacement when actual Temporal API lands
|
|
691
662
|
add(t) {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
663
|
+
const n = w(this);
|
|
664
|
+
if ("days" in t)
|
|
665
|
+
return n.setUTCDate(this.day + t.days), D.from(n);
|
|
666
|
+
let { year: s, month: o } = this;
|
|
667
|
+
"months" in t ? (o = this.month + t.months, n.setUTCMonth(o - 1)) : (s = this.year + t.years, n.setUTCFullYear(s));
|
|
668
|
+
const r = D.from(w({ year: s, month: o, day: 1 }));
|
|
669
|
+
return x(D.from(n), r, Ht(r));
|
|
696
670
|
}
|
|
697
671
|
toString() {
|
|
698
|
-
return `${
|
|
699
|
-
}
|
|
700
|
-
toDate() {
|
|
701
|
-
return new Date(Date.UTC(this.year, this.month - 1, this.day, 0, 0, 0));
|
|
672
|
+
return `${J(this.year, 4)}-${J(this.month, 2)}-${J(this.day, 2)}`;
|
|
702
673
|
}
|
|
703
674
|
toPlainYearMonth() {
|
|
704
|
-
return new
|
|
675
|
+
return new B(this.year, this.month);
|
|
705
676
|
}
|
|
706
677
|
equals(t) {
|
|
707
|
-
return
|
|
678
|
+
return D.compare(this, t) === 0;
|
|
708
679
|
}
|
|
709
|
-
static compare(t,
|
|
710
|
-
return
|
|
680
|
+
static compare(t, n) {
|
|
681
|
+
return t.year < n.year ? -1 : t.year > n.year ? 1 : t.month < n.month ? -1 : t.month > n.month ? 1 : t.day < n.day ? -1 : t.day > n.day ? 1 : 0;
|
|
711
682
|
}
|
|
712
683
|
static from(t) {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
static fromDate(t) {
|
|
727
|
-
return new g(
|
|
684
|
+
if (typeof t == "string") {
|
|
685
|
+
const n = t.match(Le);
|
|
686
|
+
if (!n)
|
|
687
|
+
throw new TypeError(t);
|
|
688
|
+
const [, s, o, r] = n;
|
|
689
|
+
return new D(
|
|
690
|
+
parseInt(s, 10),
|
|
691
|
+
parseInt(o, 10),
|
|
692
|
+
parseInt(r, 10)
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
return new D(
|
|
728
696
|
t.getUTCFullYear(),
|
|
729
697
|
t.getUTCMonth() + 1,
|
|
730
698
|
t.getUTCDate()
|
|
731
699
|
);
|
|
732
700
|
}
|
|
733
701
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
function Et(e, t) {
|
|
738
|
-
const s = e.toDate();
|
|
739
|
-
return s.setUTCMonth(s.getUTCMonth() + t), new C(s.getUTCFullYear(), s.getUTCMonth() + 1);
|
|
740
|
-
}
|
|
741
|
-
class C {
|
|
742
|
-
constructor(t, s) {
|
|
743
|
-
this.year = t, this.month = s;
|
|
702
|
+
class B {
|
|
703
|
+
constructor(t, n) {
|
|
704
|
+
this.year = t, this.month = n;
|
|
744
705
|
}
|
|
745
706
|
add(t) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
subtract(t) {
|
|
749
|
-
return Et(this, -wt(t));
|
|
750
|
-
}
|
|
751
|
-
toDate() {
|
|
752
|
-
return new Date(Date.UTC(this.year, this.month - 1, 1));
|
|
707
|
+
const n = w(this), s = (t.months ?? 0) + (t.years ?? 0) * 12;
|
|
708
|
+
return n.setUTCMonth(n.getUTCMonth() + s), new B(n.getUTCFullYear(), n.getUTCMonth() + 1);
|
|
753
709
|
}
|
|
754
710
|
equals(t) {
|
|
755
711
|
return this.year === t.year && this.month === t.month;
|
|
756
712
|
}
|
|
757
713
|
toPlainDate() {
|
|
758
|
-
return new
|
|
759
|
-
}
|
|
760
|
-
static compare(t, s) {
|
|
761
|
-
const n = t instanceof g ? t.toPlainYearMonth() : t, o = s instanceof g ? s.toPlainYearMonth() : s;
|
|
762
|
-
return Wt(n, o);
|
|
714
|
+
return new D(this.year, this.month, 1);
|
|
763
715
|
}
|
|
764
716
|
}
|
|
765
|
-
function
|
|
717
|
+
function et(e, t) {
|
|
766
718
|
if (t)
|
|
767
719
|
try {
|
|
768
720
|
return e.from(t);
|
|
769
721
|
} catch {
|
|
770
722
|
}
|
|
771
723
|
}
|
|
772
|
-
function
|
|
773
|
-
const [t,
|
|
774
|
-
return [P(() =>
|
|
724
|
+
function I(e) {
|
|
725
|
+
const [t, n] = Lt(e);
|
|
726
|
+
return [P(() => et(D, t), [t]), (r) => n(r.toString())];
|
|
775
727
|
}
|
|
776
|
-
function
|
|
728
|
+
function _e(e) {
|
|
777
729
|
if (e) {
|
|
778
|
-
const [t,
|
|
779
|
-
if (
|
|
780
|
-
return [
|
|
730
|
+
const [t, n] = e.split("/"), s = et(D, t), o = et(D, n);
|
|
731
|
+
if (s && o)
|
|
732
|
+
return [s, o];
|
|
781
733
|
}
|
|
782
734
|
return [];
|
|
783
735
|
}
|
|
784
|
-
function
|
|
785
|
-
|
|
736
|
+
function je(e) {
|
|
737
|
+
const [t, n] = Lt(e);
|
|
738
|
+
return [P(() => _e(t), [t]), (r) => n(`${r[0]}/${r[1]}`)];
|
|
786
739
|
}
|
|
787
|
-
function
|
|
788
|
-
const [t, s] = Lt(e);
|
|
789
|
-
return [P(() => Ke(t), [t]), (r) => s(Je(r[0], r[1]))];
|
|
790
|
-
}
|
|
791
|
-
function x(e, t) {
|
|
740
|
+
function U(e, t) {
|
|
792
741
|
return P(
|
|
793
742
|
() => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
|
|
794
743
|
[t, e]
|
|
795
744
|
);
|
|
796
745
|
}
|
|
797
|
-
function
|
|
798
|
-
const
|
|
746
|
+
function gt(e, t, n) {
|
|
747
|
+
const s = U(e, n);
|
|
799
748
|
return P(() => {
|
|
800
749
|
const o = [], r = /* @__PURE__ */ new Date();
|
|
801
|
-
for (var
|
|
750
|
+
for (var c = 0; c < 7; c++) {
|
|
802
751
|
const f = (r.getDay() - t + 7) % 7;
|
|
803
|
-
o[f] =
|
|
752
|
+
o[f] = s.format(r), r.setDate(r.getDate() + 1);
|
|
804
753
|
}
|
|
805
754
|
return o;
|
|
806
|
-
}, [t,
|
|
807
|
-
}
|
|
808
|
-
function Xe(e) {
|
|
809
|
-
let t = "";
|
|
810
|
-
for (const s in e)
|
|
811
|
-
e[s] && (t += ` ${s}`);
|
|
812
|
-
return t;
|
|
755
|
+
}, [t, s]);
|
|
813
756
|
}
|
|
814
|
-
const
|
|
815
|
-
function
|
|
816
|
-
const { offset:
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
757
|
+
const Et = (e, t, n) => x(e, t, n) === e, Dt = (e) => e.target.matches(":dir(ltr)"), Ye = { month: "long", day: "numeric" }, xe = { month: "long" }, Be = { weekday: "narrow" }, ze = { weekday: "long" }, Z = { bubbles: !0 };
|
|
758
|
+
function qe({ props: e, context: t }) {
|
|
759
|
+
const { offset: n } = e, {
|
|
760
|
+
firstDayOfWeek: s,
|
|
761
|
+
isDateDisallowed: o,
|
|
762
|
+
min: r,
|
|
763
|
+
max: c,
|
|
764
|
+
page: f,
|
|
765
|
+
locale: a,
|
|
766
|
+
focusedDate: i
|
|
767
|
+
} = t, u = ot(), d = gt(ze, s, a), l = gt(Be, s, a), m = U(Ye, a), p = U(xe, a), y = P(
|
|
768
|
+
() => f.start.add({ months: n }),
|
|
769
|
+
[f, n]
|
|
770
|
+
), E = P(
|
|
771
|
+
() => $e(y, s),
|
|
772
|
+
[y, s]
|
|
773
|
+
), h = C("focusday", Z), v = C("selectday", Z), z = C("hoverday", Z);
|
|
774
|
+
function it(g) {
|
|
775
|
+
h(x(g, r, c));
|
|
825
776
|
}
|
|
826
|
-
function
|
|
827
|
-
let
|
|
828
|
-
switch (
|
|
777
|
+
function Xt(g) {
|
|
778
|
+
let S;
|
|
779
|
+
switch (g.key) {
|
|
829
780
|
case "ArrowRight":
|
|
830
|
-
|
|
781
|
+
S = i.add({ days: Dt(g) ? 1 : -1 });
|
|
831
782
|
break;
|
|
832
783
|
case "ArrowLeft":
|
|
833
|
-
|
|
784
|
+
S = i.add({ days: Dt(g) ? -1 : 1 });
|
|
834
785
|
break;
|
|
835
786
|
case "ArrowDown":
|
|
836
|
-
|
|
787
|
+
S = i.add({ days: 7 });
|
|
837
788
|
break;
|
|
838
789
|
case "ArrowUp":
|
|
839
|
-
|
|
790
|
+
S = i.add({ days: -7 });
|
|
840
791
|
break;
|
|
841
792
|
case "PageUp":
|
|
842
|
-
|
|
793
|
+
S = i.add(g.shiftKey ? { years: -1 } : { months: -1 });
|
|
843
794
|
break;
|
|
844
795
|
case "PageDown":
|
|
845
|
-
|
|
796
|
+
S = i.add(g.shiftKey ? { years: 1 } : { months: 1 });
|
|
846
797
|
break;
|
|
847
798
|
case "Home":
|
|
848
|
-
|
|
799
|
+
S = rt(i, s);
|
|
849
800
|
break;
|
|
850
801
|
case "End":
|
|
851
|
-
|
|
802
|
+
S = qt(i, s);
|
|
852
803
|
break;
|
|
853
804
|
default:
|
|
854
805
|
return;
|
|
855
806
|
}
|
|
856
|
-
|
|
807
|
+
it(S), g.preventDefault();
|
|
857
808
|
}
|
|
858
|
-
function
|
|
859
|
-
const
|
|
860
|
-
|
|
809
|
+
function Gt(g) {
|
|
810
|
+
const S = y.equals(g);
|
|
811
|
+
if (!S && !t.showOutsideDays)
|
|
812
|
+
return;
|
|
813
|
+
const Qt = g.equals(i), Vt = g.equals(u), at = w(g), q = o?.(at), lt = !Et(g, r, c);
|
|
814
|
+
let ut = "", A;
|
|
861
815
|
if ("highlightedRange" in t) {
|
|
862
|
-
const [
|
|
863
|
-
|
|
816
|
+
const [ft, dt] = t.highlightedRange, ht = ft?.equals(g), mt = dt?.equals(g);
|
|
817
|
+
A = Et(g, ft, dt), ut = `${ht ? "range-start" : ""} ${mt ? "range-end" : ""} ${A && !ht && !mt ? "range-inner" : ""}`;
|
|
864
818
|
} else
|
|
865
|
-
|
|
819
|
+
A = t.value?.equals(g);
|
|
866
820
|
return {
|
|
867
|
-
part:
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
"range-end": H,
|
|
876
|
-
"range-inner": yt && A && !B && !H
|
|
877
|
-
}),
|
|
878
|
-
tabindex: E && se ? 0 : -1,
|
|
879
|
-
disabled: mt,
|
|
880
|
-
"aria-disabled": _ ? "true" : void 0,
|
|
881
|
-
"aria-pressed": E && A,
|
|
882
|
-
"aria-current": dt ? "date" : void 0,
|
|
883
|
-
"aria-label": a.format(ht),
|
|
884
|
-
onkeydown: ee,
|
|
821
|
+
part: `button day ${S && A ? "selected" : ""} ${ut}`,
|
|
822
|
+
tabindex: S && Qt ? 0 : -1,
|
|
823
|
+
disabled: lt,
|
|
824
|
+
"aria-disabled": q ? "true" : void 0,
|
|
825
|
+
"aria-pressed": S && A,
|
|
826
|
+
"aria-current": Vt ? "date" : void 0,
|
|
827
|
+
"aria-label": m.format(at),
|
|
828
|
+
onkeydown: Xt,
|
|
885
829
|
onclick() {
|
|
886
|
-
|
|
830
|
+
q || v(g), it(g);
|
|
887
831
|
},
|
|
888
832
|
onmouseover() {
|
|
889
|
-
!
|
|
833
|
+
!q && !lt && z(g);
|
|
890
834
|
}
|
|
891
835
|
};
|
|
892
836
|
}
|
|
893
837
|
return {
|
|
894
|
-
weeks:
|
|
895
|
-
yearMonth:
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
getDayProps:
|
|
838
|
+
weeks: E,
|
|
839
|
+
yearMonth: y,
|
|
840
|
+
daysLong: d,
|
|
841
|
+
daysShort: l,
|
|
842
|
+
formatter: p,
|
|
843
|
+
getDayProps: Gt
|
|
900
844
|
};
|
|
901
845
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
this.start = t, this.duration = s, this.focusedDate = n, this.end = t.add({ months: s.months - 1 });
|
|
905
|
-
}
|
|
906
|
-
end;
|
|
907
|
-
contains(t) {
|
|
908
|
-
return C.compare(t, this.start) >= 0 && C.compare(t, this.end) <= 0;
|
|
909
|
-
}
|
|
910
|
-
adjust(t) {
|
|
911
|
-
const { start: s, duration: n } = this, o = C.compare(s, t) > 0;
|
|
912
|
-
let r = new T(s, n, t);
|
|
913
|
-
for (; !r.contains(t); )
|
|
914
|
-
r = new T(
|
|
915
|
-
o ? r.start.subtract(n) : r.start.add(n),
|
|
916
|
-
n,
|
|
917
|
-
t
|
|
918
|
-
);
|
|
919
|
-
return r;
|
|
920
|
-
}
|
|
921
|
-
next() {
|
|
922
|
-
return new T(
|
|
923
|
-
this.start.add(this.duration),
|
|
924
|
-
this.duration,
|
|
925
|
-
this.focusedDate.add(this.duration)
|
|
926
|
-
);
|
|
927
|
-
}
|
|
928
|
-
prev() {
|
|
929
|
-
return new T(
|
|
930
|
-
this.start.subtract(this.duration),
|
|
931
|
-
this.duration,
|
|
932
|
-
this.focusedDate.subtract(this.duration)
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
const Tt = at(), lt = Le({
|
|
937
|
-
firstDayOfWeek: 0,
|
|
846
|
+
const W = ot(), ct = Ie({
|
|
847
|
+
firstDayOfWeek: 1,
|
|
938
848
|
isDateDisallowed: () => !1,
|
|
939
|
-
|
|
849
|
+
focusedDate: W,
|
|
850
|
+
page: { start: W.toPlainYearMonth(), end: W.toPlainYearMonth() }
|
|
940
851
|
});
|
|
941
|
-
customElements.define("calendar-month-ctx",
|
|
942
|
-
const
|
|
852
|
+
customElements.define("calendar-month-ctx", ct);
|
|
853
|
+
const He = j(
|
|
943
854
|
(e) => {
|
|
944
|
-
const t =
|
|
855
|
+
const t = Fe(ct), n = se(), s = qe({ props: e, context: t });
|
|
945
856
|
function o() {
|
|
946
|
-
|
|
857
|
+
n.current.querySelector("button[tabindex='0']")?.focus();
|
|
947
858
|
}
|
|
948
|
-
return /* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ F("host", { shadowDom: !0, focus: o, children: [
|
|
860
|
+
/* @__PURE__ */ b("div", { id: "h", part: "heading", children: s.formatter.format(w(s.yearMonth)) }),
|
|
861
|
+
/* @__PURE__ */ F("table", { ref: n, "aria-labelledby": "h", part: "table", children: [
|
|
862
|
+
/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { part: "tr head", children: s.daysLong.map((r, c) => /* @__PURE__ */ F("th", { part: "th", scope: "col", children: [
|
|
863
|
+
/* @__PURE__ */ b("span", { class: "vh", children: r }),
|
|
864
|
+
/* @__PURE__ */ b("span", { "aria-hidden": "true", children: s.daysShort[c] })
|
|
954
865
|
] })) }) }),
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
const
|
|
957
|
-
return /* @__PURE__ */
|
|
958
|
-
}) },
|
|
866
|
+
/* @__PURE__ */ b("tbody", { children: s.weeks.map((r, c) => /* @__PURE__ */ b("tr", { part: "tr week", children: r.map((f, a) => {
|
|
867
|
+
const i = s.getDayProps(f);
|
|
868
|
+
return /* @__PURE__ */ b("td", { part: "td", children: i && /* @__PURE__ */ b("button", { ...i, children: f.day }) }, a);
|
|
869
|
+
}) }, c)) })
|
|
959
870
|
] })
|
|
960
871
|
] });
|
|
961
872
|
},
|
|
@@ -967,51 +878,46 @@ const nn = $(
|
|
|
967
878
|
}
|
|
968
879
|
},
|
|
969
880
|
styles: [
|
|
970
|
-
zt,
|
|
971
881
|
Bt,
|
|
972
|
-
|
|
882
|
+
zt,
|
|
883
|
+
Y`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{font-weight:700;block-size:2.25rem}td{padding-inline:0}button{color:inherit;font-size:inherit;background:transparent;border:0;font-variant-numeric:tabular-nums;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled)){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`
|
|
973
884
|
]
|
|
974
885
|
}
|
|
975
886
|
);
|
|
976
|
-
customElements.define("calendar-month",
|
|
977
|
-
function
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
onclick: e.next,
|
|
997
|
-
"aria-disabled": e.next ? null : "true",
|
|
998
|
-
children: /* @__PURE__ */ p("slot", { name: "next", children: "Next" })
|
|
999
|
-
}
|
|
1000
|
-
)
|
|
887
|
+
customElements.define("calendar-month", He);
|
|
888
|
+
function St(e) {
|
|
889
|
+
return /* @__PURE__ */ b(
|
|
890
|
+
"button",
|
|
891
|
+
{
|
|
892
|
+
part: `button ${e.name} ${e.onclick ? "" : "disabled"}`,
|
|
893
|
+
onclick: e.onclick,
|
|
894
|
+
"aria-disabled": e.onclick ? null : "true",
|
|
895
|
+
children: /* @__PURE__ */ b("slot", { name: e.name, children: e.children })
|
|
896
|
+
}
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
function Kt(e) {
|
|
900
|
+
const t = w(e.page.start), n = w(e.page.end);
|
|
901
|
+
return /* @__PURE__ */ F("div", { role: "group", "aria-labelledby": "h", part: "container", children: [
|
|
902
|
+
/* @__PURE__ */ b("div", { id: "h", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, n) }),
|
|
903
|
+
/* @__PURE__ */ F("div", { part: "header", children: [
|
|
904
|
+
/* @__PURE__ */ b(St, { name: "previous", onclick: e.previous, children: "Previous" }),
|
|
905
|
+
/* @__PURE__ */ b("div", { part: "heading", "aria-hidden": "true", children: e.format.formatRange(t, n) }),
|
|
906
|
+
/* @__PURE__ */ b(St, { name: "next", onclick: e.next, children: "Next" })
|
|
1001
907
|
] }),
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
|
|
908
|
+
/* @__PURE__ */ b(
|
|
909
|
+
ct,
|
|
1004
910
|
{
|
|
1005
911
|
value: e,
|
|
1006
912
|
onselectday: e.onSelect,
|
|
1007
913
|
onfocusday: e.onFocus,
|
|
1008
914
|
onhoverday: e.onHover,
|
|
1009
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ b("slot", {})
|
|
1010
916
|
}
|
|
1011
917
|
)
|
|
1012
918
|
] });
|
|
1013
919
|
}
|
|
1014
|
-
const
|
|
920
|
+
const Jt = {
|
|
1015
921
|
value: {
|
|
1016
922
|
type: String,
|
|
1017
923
|
value: ""
|
|
@@ -1034,7 +940,7 @@ const Gt = {
|
|
|
1034
940
|
},
|
|
1035
941
|
showOutsideDays: {
|
|
1036
942
|
type: Boolean,
|
|
1037
|
-
value:
|
|
943
|
+
value: !1
|
|
1038
944
|
},
|
|
1039
945
|
locale: {
|
|
1040
946
|
type: String,
|
|
@@ -1044,101 +950,129 @@ const Gt = {
|
|
|
1044
950
|
months: {
|
|
1045
951
|
type: Number,
|
|
1046
952
|
value: 1
|
|
953
|
+
},
|
|
954
|
+
focusedDate: {
|
|
955
|
+
type: String,
|
|
956
|
+
value: () => {
|
|
957
|
+
}
|
|
1047
958
|
}
|
|
1048
|
-
},
|
|
1049
|
-
zt,
|
|
959
|
+
}, Zt = [
|
|
1050
960
|
Bt,
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
961
|
+
zt,
|
|
962
|
+
Y`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}button{display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.5}`
|
|
963
|
+
], Ke = { year: "numeric" }, Je = { year: "numeric", month: "long" };
|
|
964
|
+
function wt(e, t) {
|
|
965
|
+
return (t.year - e.year) * 12 + t.month - e.month;
|
|
966
|
+
}
|
|
967
|
+
const vt = (e, t) => (e = t === 12 ? new B(e.year, 1) : e, {
|
|
968
|
+
start: e,
|
|
969
|
+
end: e.add({ months: t - 1 })
|
|
970
|
+
});
|
|
971
|
+
function Wt({
|
|
972
|
+
months: e,
|
|
973
|
+
locale: t,
|
|
974
|
+
focusedDate: n,
|
|
975
|
+
setFocusedDate: s
|
|
976
|
+
}) {
|
|
977
|
+
const [o] = I("min"), [r] = I("max"), c = C("focusday"), f = C("change"), a = P(
|
|
978
|
+
() => x(n ?? ot(), o, r),
|
|
979
|
+
[n, o, r]
|
|
980
|
+
), [i, u] = st(
|
|
981
|
+
() => vt(a.toPlainYearMonth(), e)
|
|
982
|
+
), d = (h) => {
|
|
983
|
+
const v = wt(i.start, h.toPlainYearMonth());
|
|
984
|
+
return v >= 0 && v < e;
|
|
985
|
+
};
|
|
986
|
+
nt(() => {
|
|
987
|
+
let h = i.start;
|
|
988
|
+
if (!d(a)) {
|
|
989
|
+
const v = wt(h, a.toPlainYearMonth()), z = Math.floor(v / e);
|
|
990
|
+
h = h.add({ months: z * e });
|
|
991
|
+
}
|
|
992
|
+
u(vt(h, e));
|
|
993
|
+
}, [a, e]);
|
|
994
|
+
const l = $();
|
|
995
|
+
function m() {
|
|
996
|
+
l.current.querySelectorAll("calendar-month").forEach((h) => h.focus());
|
|
1063
997
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
c.current.querySelectorAll("calendar-month").forEach((m) => m.focus());
|
|
998
|
+
function p(h) {
|
|
999
|
+
s(h), c(w(h));
|
|
1067
1000
|
}
|
|
1068
|
-
const
|
|
1001
|
+
const y = U(Ke, t), E = U(Je, t);
|
|
1069
1002
|
return {
|
|
1070
|
-
format:
|
|
1071
|
-
formatVerbose:
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1003
|
+
format: y,
|
|
1004
|
+
formatVerbose: E,
|
|
1005
|
+
page: i,
|
|
1006
|
+
focusedDate: a,
|
|
1007
|
+
dispatch: f,
|
|
1008
|
+
onFocus(h) {
|
|
1009
|
+
h.stopPropagation(), p(h.detail), setTimeout(m);
|
|
1076
1010
|
},
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
focus: h
|
|
1011
|
+
min: o,
|
|
1012
|
+
max: r,
|
|
1013
|
+
next: r == null || !d(r) ? () => p(a.add({ months: e })) : void 0,
|
|
1014
|
+
previous: o == null || !d(o) ? () => p(a.add({ months: -e })) : void 0,
|
|
1015
|
+
focus: m
|
|
1083
1016
|
};
|
|
1084
1017
|
}
|
|
1085
|
-
const
|
|
1018
|
+
const Ze = j(
|
|
1086
1019
|
(e) => {
|
|
1087
|
-
const [t,
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1020
|
+
const [t, n] = I("value"), [s = t, o] = I("focusedDate"), r = Wt({
|
|
1021
|
+
...e,
|
|
1022
|
+
focusedDate: s,
|
|
1023
|
+
setFocusedDate: o
|
|
1024
|
+
});
|
|
1025
|
+
function c(f) {
|
|
1026
|
+
n(f.detail), r.dispatch();
|
|
1093
1027
|
}
|
|
1094
|
-
return /* @__PURE__ */
|
|
1095
|
-
|
|
1028
|
+
return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
|
|
1029
|
+
Kt,
|
|
1096
1030
|
{
|
|
1097
1031
|
...e,
|
|
1098
|
-
...
|
|
1032
|
+
...r,
|
|
1099
1033
|
value: t,
|
|
1100
|
-
|
|
1101
|
-
onSelect: o
|
|
1034
|
+
onSelect: c
|
|
1102
1035
|
}
|
|
1103
1036
|
) });
|
|
1104
1037
|
},
|
|
1105
|
-
{ props:
|
|
1038
|
+
{ props: Jt, styles: Zt }
|
|
1106
1039
|
);
|
|
1107
|
-
customElements.define("calendar-date",
|
|
1108
|
-
const
|
|
1040
|
+
customElements.define("calendar-date", Ze);
|
|
1041
|
+
const Tt = (e, t) => D.compare(e, t) < 0 ? [e, t] : [t, e], We = j(
|
|
1109
1042
|
(e) => {
|
|
1110
|
-
const [t,
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1043
|
+
const [t, n] = je("value"), [s = t[0], o] = I("focusedDate"), r = Wt({
|
|
1044
|
+
...e,
|
|
1045
|
+
focusedDate: s,
|
|
1046
|
+
setFocusedDate: o
|
|
1047
|
+
}), c = C("rangestart"), f = C("rangeend"), [a, i] = st();
|
|
1048
|
+
function u(p) {
|
|
1049
|
+
r.onFocus(p), d(p);
|
|
1116
1050
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1051
|
+
function d(p) {
|
|
1052
|
+
p.stopPropagation(), i((y) => y && { ...y, b: p.detail });
|
|
1119
1053
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1054
|
+
function l(p) {
|
|
1055
|
+
const y = p.detail;
|
|
1056
|
+
p.stopPropagation(), a ? (n(Tt(a.a, y)), i(void 0), f(w(y)), r.dispatch()) : (i({ a: y, b: y }), c(w(y)));
|
|
1123
1057
|
}
|
|
1124
|
-
const
|
|
1125
|
-
return /* @__PURE__ */
|
|
1126
|
-
|
|
1058
|
+
const m = a ? Tt(a.a, a.b) : t;
|
|
1059
|
+
return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
|
|
1060
|
+
Kt,
|
|
1127
1061
|
{
|
|
1128
1062
|
...e,
|
|
1129
|
-
...
|
|
1130
|
-
highlightedRange:
|
|
1063
|
+
...r,
|
|
1064
|
+
highlightedRange: m,
|
|
1131
1065
|
onFocus: u,
|
|
1132
|
-
onHover:
|
|
1133
|
-
onSelect:
|
|
1066
|
+
onHover: d,
|
|
1067
|
+
onSelect: l
|
|
1134
1068
|
}
|
|
1135
1069
|
) });
|
|
1136
1070
|
},
|
|
1137
|
-
{ props:
|
|
1071
|
+
{ props: Jt, styles: Zt }
|
|
1138
1072
|
);
|
|
1139
|
-
customElements.define("calendar-range",
|
|
1073
|
+
customElements.define("calendar-range", We);
|
|
1140
1074
|
export {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1075
|
+
Ze as CalendarDate,
|
|
1076
|
+
He as CalendarMonth,
|
|
1077
|
+
We as CalendarRange
|
|
1144
1078
|
};
|