cally 0.4.2 → 0.4.3
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/cally.js +177 -179
- package/package.json +1 -1
package/dist/cally.js
CHANGED
|
@@ -29,13 +29,13 @@ class oe {
|
|
|
29
29
|
return this.#e.add(t), () => this.#e.delete(t);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const Nt = (e) => new oe(e),
|
|
33
|
-
globalThis[
|
|
34
|
-
let N = globalThis[
|
|
32
|
+
const Nt = (e) => new oe(e), Q = Symbol.for("atomico.hooks");
|
|
33
|
+
globalThis[Q] = globalThis[Q] || {};
|
|
34
|
+
let N = globalThis[Q];
|
|
35
35
|
const re = Symbol.for("Atomico.suspense"), Pt = Symbol.for("Atomico.effect"), ie = Symbol.for("Atomico.layoutEffect"), Ot = Symbol.for("Atomico.insertionEffect"), O = (e, t, s) => {
|
|
36
36
|
const { i: n, hooks: o } = N.c, r = o[n] = o[n] || {};
|
|
37
37
|
return r.value = e(r.value), r.effect = t, r.tag = s, N.c.i++, o[n].value;
|
|
38
|
-
}, ae = (e) => O((t = Nt(e)) => t), U = () => O((e = Nt(N.c.host)) => e),
|
|
38
|
+
}, ae = (e) => O((t = Nt(e)) => t), U = () => O((e = Nt(N.c.host)) => e), kt = () => N.c.update, ce = (e, t, s = 0) => {
|
|
39
39
|
let n = {}, o = !1;
|
|
40
40
|
const r = () => o, i = (l, c) => {
|
|
41
41
|
for (const h in n) {
|
|
@@ -59,7 +59,7 @@ const re = Symbol.for("Atomico.suspense"), Pt = Symbol.for("Atomico.effect"), ie
|
|
|
59
59
|
}, cleanEffects: (l) => (i(Ot, l), () => (i(ie, l), () => {
|
|
60
60
|
i(Pt, l);
|
|
61
61
|
})), isSuspense: r };
|
|
62
|
-
},
|
|
62
|
+
}, k = Symbol.for;
|
|
63
63
|
function Mt(e, t) {
|
|
64
64
|
const s = e.length;
|
|
65
65
|
if (s !== t.length)
|
|
@@ -71,8 +71,8 @@ function Mt(e, t) {
|
|
|
71
71
|
}
|
|
72
72
|
return !0;
|
|
73
73
|
}
|
|
74
|
-
const S = (e) => typeof e == "function",
|
|
75
|
-
function
|
|
74
|
+
const S = (e) => typeof e == "function", R = (e) => typeof e == "object", { isArray: ue } = Array, V = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
|
|
75
|
+
function At(e, t) {
|
|
76
76
|
let s;
|
|
77
77
|
const n = (o) => {
|
|
78
78
|
let { length: r } = o;
|
|
@@ -90,8 +90,8 @@ function kt(e, t) {
|
|
|
90
90
|
};
|
|
91
91
|
n(e), s != null && t(s);
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
class
|
|
93
|
+
const Rt = (e, t, s) => (e.addEventListener(t, s), () => e.removeEventListener(t, s));
|
|
94
|
+
class Ft {
|
|
95
95
|
/**
|
|
96
96
|
*
|
|
97
97
|
* @param {HTMLElement} target
|
|
@@ -102,11 +102,11 @@ class Rt {
|
|
|
102
102
|
this.message = s, this.target = t, this.value = n;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
class It extends
|
|
105
|
+
class It extends Ft {
|
|
106
106
|
}
|
|
107
|
-
class le extends
|
|
107
|
+
class le extends Ft {
|
|
108
108
|
}
|
|
109
|
-
const
|
|
109
|
+
const Y = "Custom", fe = null, de = { true: 1, "": 1, 1: 1 };
|
|
110
110
|
function he(e, t, s, n, o) {
|
|
111
111
|
const {
|
|
112
112
|
type: r,
|
|
@@ -114,7 +114,7 @@ function he(e, t, s, n, o) {
|
|
|
114
114
|
event: f,
|
|
115
115
|
value: u,
|
|
116
116
|
attr: l = me(t)
|
|
117
|
-
} = s?.name !=
|
|
117
|
+
} = s?.name != Y && R(s) && s != fe ? s : { type: s }, c = r?.name === Y && r.map, h = u != null ? r == Function || !S(u) ? () => u : u : null;
|
|
118
118
|
Object.defineProperty(e, t, {
|
|
119
119
|
configurable: !0,
|
|
120
120
|
/**
|
|
@@ -124,7 +124,7 @@ function he(e, t, s, n, o) {
|
|
|
124
124
|
set(a) {
|
|
125
125
|
const d = this[t];
|
|
126
126
|
h && r != Boolean && a == null && (a = h());
|
|
127
|
-
const { error: y, value: D } = (c ?
|
|
127
|
+
const { error: y, value: D } = (c ? be : ge)(
|
|
128
128
|
r,
|
|
129
129
|
a
|
|
130
130
|
);
|
|
@@ -134,7 +134,7 @@ function he(e, t, s, n, o) {
|
|
|
134
134
|
`The value defined for prop '${t}' must be of type '${r.name}'`,
|
|
135
135
|
D
|
|
136
136
|
);
|
|
137
|
-
d != D && (this._props[t] = D ?? void 0, this.update(), f &&
|
|
137
|
+
d != D && (this._props[t] = D ?? void 0, this.update(), f && xt(this, f), this.updated.then(() => {
|
|
138
138
|
i && (this._ignoreAttr = l, ye(this, r, l, this[t]), this._ignoreAttr = null);
|
|
139
139
|
}));
|
|
140
140
|
},
|
|
@@ -146,13 +146,13 @@ function he(e, t, s, n, o) {
|
|
|
146
146
|
}
|
|
147
147
|
}), h && (o[t] = h()), n[l] = { prop: t, type: r };
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const xt = (e, { type: t, base: s = CustomEvent, ...n }) => e.dispatchEvent(new s(t, n)), me = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), ye = (e, t, s, n) => n == null || t == Boolean && !n ? e.removeAttribute(s) : e.setAttribute(
|
|
150
150
|
s,
|
|
151
|
-
t?.name ===
|
|
152
|
-
),
|
|
151
|
+
t?.name === Y && t?.serialize ? t?.serialize(n) : R(n) ? JSON.stringify(n) : t == Boolean ? "" : n
|
|
152
|
+
), pe = (e, t) => e == Boolean ? !!de[t] : e == Number ? Number(t) : e == String ? t : e == Array || e == Object ? JSON.parse(t) : e.name == Y ? t : (
|
|
153
153
|
// TODO: If when defining reflect the prop can also be of type string?
|
|
154
154
|
new e(t)
|
|
155
|
-
),
|
|
155
|
+
), be = ({ map: e }, t) => {
|
|
156
156
|
try {
|
|
157
157
|
return { value: e(t), error: !1 };
|
|
158
158
|
} catch {
|
|
@@ -206,7 +206,7 @@ const we = (e) => {
|
|
|
206
206
|
we(this)
|
|
207
207
|
);
|
|
208
208
|
let d, y = !0;
|
|
209
|
-
const D =
|
|
209
|
+
const D = V(this);
|
|
210
210
|
this.update = () => (d || (d = !0, this.updated = (this.updated || this.mounted).then(() => {
|
|
211
211
|
try {
|
|
212
212
|
const m = a.load(this._render), w = a.cleanEffects();
|
|
@@ -242,7 +242,7 @@ const we = (e) => {
|
|
|
242
242
|
return;
|
|
243
243
|
const { prop: d, type: y } = s[c];
|
|
244
244
|
try {
|
|
245
|
-
this[d] =
|
|
245
|
+
this[d] = pe(y, a);
|
|
246
246
|
} catch {
|
|
247
247
|
throw new le(
|
|
248
248
|
this,
|
|
@@ -269,12 +269,12 @@ function Ee(e) {
|
|
|
269
269
|
const { styles: t } = e.constructor, { shadowRoot: s } = e;
|
|
270
270
|
if (s && t.length) {
|
|
271
271
|
const n = [];
|
|
272
|
-
|
|
272
|
+
At(t, (o) => {
|
|
273
273
|
o && (o instanceof Element ? s.appendChild(o.cloneNode(!0)) : n.push(o));
|
|
274
274
|
}), n.length && (s.adoptedStyleSheets = n);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
const
|
|
277
|
+
const Ut = (e) => (t, s) => {
|
|
278
278
|
O(
|
|
279
279
|
/**
|
|
280
280
|
* Clean the effect hook
|
|
@@ -287,7 +287,7 @@ const xt = (e) => (t, s) => {
|
|
|
287
287
|
([n, o], r) => r ? (S(n) && n(), []) : [n || t(), o],
|
|
288
288
|
e
|
|
289
289
|
);
|
|
290
|
-
}, j =
|
|
290
|
+
}, j = Ut(Pt), Se = Ut(Ot);
|
|
291
291
|
class _t extends Array {
|
|
292
292
|
/**
|
|
293
293
|
*
|
|
@@ -318,8 +318,8 @@ class _t extends Array {
|
|
|
318
318
|
// this[2](nextState, this);
|
|
319
319
|
// }
|
|
320
320
|
}
|
|
321
|
-
const
|
|
322
|
-
const t =
|
|
321
|
+
const it = (e) => {
|
|
322
|
+
const t = kt();
|
|
323
323
|
return O(
|
|
324
324
|
(s = new _t(e, (n, o, r) => {
|
|
325
325
|
n = S(n) ? n(o[0]) : n, n !== o[0] && (o[0] = n, r || t());
|
|
@@ -343,16 +343,16 @@ const ct = (e) => {
|
|
|
343
343
|
);
|
|
344
344
|
}, v = (e, t = {}) => {
|
|
345
345
|
const s = U();
|
|
346
|
-
return s[e] || (s[e] = (n = t.detail) =>
|
|
346
|
+
return s[e] || (s[e] = (n = t.detail) => xt(s.current, {
|
|
347
347
|
type: e,
|
|
348
348
|
...t,
|
|
349
349
|
detail: n
|
|
350
350
|
})), s[e];
|
|
351
|
-
},
|
|
352
|
-
globalThis[
|
|
351
|
+
}, tt = k("atomico/options");
|
|
352
|
+
globalThis[tt] = globalThis[tt] || {
|
|
353
353
|
sheet: !!document.adoptedStyleSheets
|
|
354
354
|
};
|
|
355
|
-
const Yt = globalThis[
|
|
355
|
+
const Yt = globalThis[tt], ve = {
|
|
356
356
|
checked: 1,
|
|
357
357
|
value: 1,
|
|
358
358
|
selected: 1
|
|
@@ -372,18 +372,18 @@ const Yt = globalThis[nt], ve = {
|
|
|
372
372
|
cloneNode: 1,
|
|
373
373
|
children: 1,
|
|
374
374
|
key: 1
|
|
375
|
-
},
|
|
376
|
-
class
|
|
375
|
+
}, L = {}, et = [];
|
|
376
|
+
class nt extends Text {
|
|
377
377
|
}
|
|
378
|
-
const Ne =
|
|
378
|
+
const Ne = k("atomico/id"), F = k("atomico/type"), J = k("atomico/ref"), $t = k("atomico/vnode"), Pe = () => {
|
|
379
379
|
};
|
|
380
380
|
function Oe(e, t, s) {
|
|
381
381
|
return qt(this, e, t, s);
|
|
382
382
|
}
|
|
383
383
|
const jt = (e, t, ...s) => {
|
|
384
|
-
const n = t ||
|
|
384
|
+
const n = t || L;
|
|
385
385
|
let { children: o } = n;
|
|
386
|
-
if (o = o ?? (s.length ? s :
|
|
386
|
+
if (o = o ?? (s.length ? s : et), e === Pe)
|
|
387
387
|
return o;
|
|
388
388
|
const r = e ? e instanceof Node ? 1 : (
|
|
389
389
|
//@ts-ignore
|
|
@@ -391,11 +391,11 @@ const jt = (e, t, ...s) => {
|
|
|
391
391
|
) : 0;
|
|
392
392
|
if (r === !1 && e instanceof Function)
|
|
393
393
|
return e(
|
|
394
|
-
o !=
|
|
394
|
+
o != et ? { children: o, ...n } : n
|
|
395
395
|
);
|
|
396
396
|
const i = Yt.render || Oe;
|
|
397
397
|
return {
|
|
398
|
-
[
|
|
398
|
+
[F]: $t,
|
|
399
399
|
type: e,
|
|
400
400
|
props: n,
|
|
401
401
|
children: o,
|
|
@@ -416,22 +416,22 @@ const jt = (e, t, ...s) => {
|
|
|
416
416
|
};
|
|
417
417
|
function qt(e, t, s = Ne, n, o) {
|
|
418
418
|
let r;
|
|
419
|
-
if (t && t[s] && t[s].vnode == e || e[
|
|
419
|
+
if (t && t[s] && t[s].vnode == e || e[F] != $t)
|
|
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[J] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[J] || t.localName != e.type : !t), r && e.type != null && (e.raw == 1 && e.clone ? (n = !0, t = e.type.cloneNode(!0), t[J] = 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 i = t[s] ? t[s] :
|
|
428
|
+
const i = t[s] ? t[s] : L, { vnode: f = L, cycle: u = 0 } = i;
|
|
429
429
|
let { fragment: l, handlers: c } = i;
|
|
430
|
-
const { children: h =
|
|
430
|
+
const { children: h = et, props: a = L } = f;
|
|
431
431
|
if (c = r ? {} : c || {}, 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 != a &&
|
|
434
|
+
t.attachShadow({ mode: "open", ...e.shadow }), e.props != a && Ae(t, a, e.props, c, o), e.children !== h) {
|
|
435
435
|
const d = e.shadow ? t.shadowRoot : t;
|
|
436
436
|
l = Me(
|
|
437
437
|
e.children,
|
|
@@ -448,14 +448,14 @@ function qt(e, t, s = Ne, n, o) {
|
|
|
448
448
|
}
|
|
449
449
|
return t[s] = { vnode: e, handlers: c, fragment: l, cycle: u + 1 }, t;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const s = new
|
|
451
|
+
function ke(e, t) {
|
|
452
|
+
const s = new nt(""), n = new nt("");
|
|
453
453
|
let o;
|
|
454
454
|
if (e[t ? "prepend" : "append"](s), t) {
|
|
455
455
|
let { lastElementChild: r } = e;
|
|
456
456
|
for (; r; ) {
|
|
457
457
|
const { previousElementSibling: i } = r;
|
|
458
|
-
if (
|
|
458
|
+
if (V(r, !0) && !V(i, !0)) {
|
|
459
459
|
o = r;
|
|
460
460
|
break;
|
|
461
461
|
}
|
|
@@ -469,22 +469,22 @@ function Fe(e, t) {
|
|
|
469
469
|
}
|
|
470
470
|
function Me(e, t, s, n, o, r) {
|
|
471
471
|
e = e == null ? null : ue(e) ? e : [e];
|
|
472
|
-
const i = t ||
|
|
472
|
+
const i = t || ke(s, o), { markStart: f, markEnd: u, keyes: l } = i;
|
|
473
473
|
let c;
|
|
474
474
|
const h = l && /* @__PURE__ */ new Set();
|
|
475
475
|
let a = f;
|
|
476
|
-
if (e &&
|
|
477
|
-
if (typeof d == "object" && !d[
|
|
476
|
+
if (e && At(e, (d) => {
|
|
477
|
+
if (typeof d == "object" && !d[F])
|
|
478
478
|
return;
|
|
479
|
-
const y = d[
|
|
479
|
+
const y = d[F] && d.key, D = l && y != null && l.get(y);
|
|
480
480
|
a != u && a === D ? h.delete(a) : a = a == u ? u : a.nextSibling;
|
|
481
481
|
const m = l ? D : a;
|
|
482
482
|
let w = m;
|
|
483
|
-
if (d[
|
|
483
|
+
if (d[F])
|
|
484
484
|
w = qt(d, m, n, o, r);
|
|
485
485
|
else {
|
|
486
486
|
const M = d + "";
|
|
487
|
-
!(w instanceof Text) || w instanceof
|
|
487
|
+
!(w instanceof Text) || w instanceof nt ? w = new Text(M) : w.data != M && (w.data = M);
|
|
488
488
|
}
|
|
489
489
|
w != a && (l && h.delete(w), !m || l ? (s.insertBefore(w, a), l && a != u && h.add(a)) : m == u ? s.insertBefore(w, u) : (s.replaceChild(w, m), a = w)), y != null && (c = c || /* @__PURE__ */ new Map(), c.set(y, w));
|
|
490
490
|
}), a = a == u ? u : a.nextSibling, t && a != u)
|
|
@@ -494,32 +494,32 @@ function Me(e, t, s, n, o, r) {
|
|
|
494
494
|
}
|
|
495
495
|
return h && h.forEach((d) => d.remove()), i.keyes = c, i;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function Ae(e, t, s, n, o) {
|
|
498
498
|
for (const r in t)
|
|
499
|
-
!(r in s) &&
|
|
499
|
+
!(r in s) && pt(e, r, t[r], null, o, n);
|
|
500
500
|
for (const r in s)
|
|
501
|
-
|
|
501
|
+
pt(e, r, t[r], s[r], o, n);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function pt(e, t, s, n, o, r) {
|
|
504
504
|
if (t = t == "class" && !o ? "className" : t, s = s ?? null, n = n ?? null, t in e && ve[t] && (s = e[t]), !(n === s || Ce[t] || t[0] == "_"))
|
|
505
505
|
if (t[0] == "o" && t[1] == "n" && (S(n) || S(s)))
|
|
506
|
-
|
|
506
|
+
Re(e, t.slice(2), n, r);
|
|
507
507
|
else if (t == "ref")
|
|
508
508
|
n && (S(n) ? n(e) : n.current = e);
|
|
509
509
|
else if (t == "style") {
|
|
510
510
|
const { style: i } = e;
|
|
511
511
|
s = s || "", n = n || "";
|
|
512
|
-
const f =
|
|
512
|
+
const f = R(s), u = R(n);
|
|
513
513
|
if (f)
|
|
514
514
|
for (const l in s)
|
|
515
515
|
if (u)
|
|
516
|
-
!(l in n) &&
|
|
516
|
+
!(l in n) && bt(i, l, null);
|
|
517
517
|
else
|
|
518
518
|
break;
|
|
519
519
|
if (u)
|
|
520
520
|
for (const l in n) {
|
|
521
521
|
const c = n[l];
|
|
522
|
-
f && s[l] === c ||
|
|
522
|
+
f && s[l] === c || bt(i, l, c);
|
|
523
523
|
}
|
|
524
524
|
else
|
|
525
525
|
i.cssText = n;
|
|
@@ -527,11 +527,11 @@ function bt(e, t, s, n, o, r) {
|
|
|
527
527
|
const i = t[0] == "$" ? t.slice(1) : t;
|
|
528
528
|
i === t && (!o && !Te[t] && t in e || S(n) || S(s)) ? e[t] = n ?? "" : n == null ? e.removeAttribute(i) : e.setAttribute(
|
|
529
529
|
i,
|
|
530
|
-
|
|
530
|
+
R(n) ? JSON.stringify(n) : n
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Re(e, t, s, n) {
|
|
535
535
|
if (n.handleEvent || (n.handleEvent = (o) => n[o.type].call(e, o)), s) {
|
|
536
536
|
if (!n[t]) {
|
|
537
537
|
const o = s.capture || s.once || s.passive ? Object.assign({}, s) : null;
|
|
@@ -541,7 +541,7 @@ function Ae(e, t, s, n) {
|
|
|
541
541
|
} else
|
|
542
542
|
n[t] && (e.removeEventListener(t, n), delete n[t]);
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function bt(e, t, s) {
|
|
545
545
|
let n = "setProperty";
|
|
546
546
|
s == null && (n = "removeProperty", s = null), ~t.indexOf("-") ? e[n](t, s) : e[t] = s;
|
|
547
547
|
}
|
|
@@ -551,9 +551,9 @@ function q(e, ...t) {
|
|
|
551
551
|
(n, o, r) => n + o + (t[r] || ""),
|
|
552
552
|
""
|
|
553
553
|
);
|
|
554
|
-
return gt[s] = gt[s] ||
|
|
554
|
+
return gt[s] = gt[s] || Fe(s);
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function Fe(e) {
|
|
557
557
|
if (Yt.sheet) {
|
|
558
558
|
const t = new CSSStyleSheet();
|
|
559
559
|
return t.replaceSync(e), t;
|
|
@@ -562,10 +562,10 @@ function Re(e) {
|
|
|
562
562
|
return t.textContent = e, t;
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
|
-
const Ie = jt("host", { style: "display: contents" }),
|
|
565
|
+
const Ie = jt("host", { style: "display: contents" }), Z = k("atomico/context"), xe = (e, t) => {
|
|
566
566
|
const s = U();
|
|
567
567
|
Se(
|
|
568
|
-
() =>
|
|
568
|
+
() => Rt(
|
|
569
569
|
s.current,
|
|
570
570
|
"ConnectContext",
|
|
571
571
|
/**
|
|
@@ -577,7 +577,7 @@ const Ie = jt("host", { style: "display: contents" }), G = F("atomico/context"),
|
|
|
577
577
|
),
|
|
578
578
|
[e]
|
|
579
579
|
);
|
|
580
|
-
},
|
|
580
|
+
}, Ue = (e) => {
|
|
581
581
|
const t = v("ConnectContext", {
|
|
582
582
|
bubbles: !0,
|
|
583
583
|
composed: !0
|
|
@@ -589,25 +589,25 @@ const Ie = jt("host", { style: "display: contents" }), G = F("atomico/context"),
|
|
|
589
589
|
r = i;
|
|
590
590
|
}
|
|
591
591
|
}), r;
|
|
592
|
-
}, [n, o] =
|
|
592
|
+
}, [n, o] = it(
|
|
593
593
|
s
|
|
594
594
|
);
|
|
595
595
|
return j(() => {
|
|
596
|
-
n || (e[
|
|
596
|
+
n || (e[Z] || (e[Z] = customElements.whenDefined(
|
|
597
597
|
new e().localName
|
|
598
|
-
)), e[
|
|
598
|
+
)), e[Z].then(
|
|
599
599
|
() => o(s)
|
|
600
600
|
));
|
|
601
601
|
}, [e]), n;
|
|
602
602
|
}, _e = (e) => {
|
|
603
|
-
const t =
|
|
603
|
+
const t = Ue(e), s = kt();
|
|
604
604
|
return j(() => {
|
|
605
605
|
if (t)
|
|
606
|
-
return
|
|
606
|
+
return Rt(t, "UpdatedValue", s);
|
|
607
607
|
}, [t]), (t || e).value;
|
|
608
608
|
}, Le = (e) => {
|
|
609
609
|
const t = $(
|
|
610
|
-
() => (
|
|
610
|
+
() => (xe(t, U().current), Ie),
|
|
611
611
|
{
|
|
612
612
|
props: {
|
|
613
613
|
value: {
|
|
@@ -619,17 +619,16 @@ const Ie = jt("host", { style: "display: contents" }), G = F("atomico/context"),
|
|
|
619
619
|
}
|
|
620
620
|
);
|
|
621
621
|
return t.value = e, t;
|
|
622
|
-
},
|
|
623
|
-
function
|
|
624
|
-
|
|
625
|
-
return new g(e.getUTCFullYear(), e.getUTCMonth() + 1, e.getUTCDate());
|
|
622
|
+
}, p = (e, t, s) => (t == null ? t = { key: s } : t.key = s, jt(e, t)), I = p, zt = q`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation}`, Bt = q`.vh{position:absolute;transform:scale(0)}`;
|
|
623
|
+
function at() {
|
|
624
|
+
return g.from(/* @__PURE__ */ new Date());
|
|
626
625
|
}
|
|
627
|
-
function
|
|
626
|
+
function ct(e, t = 0) {
|
|
628
627
|
const s = e.toDate(), n = s.getUTCDay(), o = (n < t ? 7 : 0) + n - t;
|
|
629
628
|
return s.setUTCDate(s.getUTCDate() - o), g.from(s);
|
|
630
629
|
}
|
|
631
630
|
function Ht(e, t = 0) {
|
|
632
|
-
return
|
|
631
|
+
return ct(e, t).add({ days: 6 });
|
|
633
632
|
}
|
|
634
633
|
function ut(e) {
|
|
635
634
|
return g.from(new Date(Date.UTC(e.year, e.month, 0)));
|
|
@@ -638,11 +637,11 @@ function Wt(e, t) {
|
|
|
638
637
|
const s = e.toDate(), n = t.toDate();
|
|
639
638
|
return s < n ? -1 : s > n ? 1 : 0;
|
|
640
639
|
}
|
|
641
|
-
function
|
|
640
|
+
function z(e, t, s) {
|
|
642
641
|
return t && g.compare(e, t) < 0 ? t : s && g.compare(e, s) > 0 ? s : e;
|
|
643
642
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
643
|
+
function st(e, t, s) {
|
|
644
|
+
return z(e, t, s) === e;
|
|
646
645
|
}
|
|
647
646
|
function Ye(e, t) {
|
|
648
647
|
const s = { days: 1 }, n = [e];
|
|
@@ -657,17 +656,11 @@ function $e(e, t) {
|
|
|
657
656
|
return s;
|
|
658
657
|
}
|
|
659
658
|
function je(e, t = 0) {
|
|
660
|
-
const s =
|
|
659
|
+
const s = ct(e.toPlainDate(), t), n = Ht(ut(e), t);
|
|
661
660
|
return $e(Ye(s, n), 7);
|
|
662
661
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
for (let f = 0; f < 7; f++)
|
|
666
|
-
n[f] = i.format(r), r.setDate(r.getDate() + 1);
|
|
667
|
-
return n;
|
|
668
|
-
}
|
|
669
|
-
const ze = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, Kt = "years", Jt = "months", Zt = "days";
|
|
670
|
-
function Be(e) {
|
|
662
|
+
const qe = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, Kt = "years", Jt = "months", Zt = "days";
|
|
663
|
+
function ze(e) {
|
|
671
664
|
if (Kt in e)
|
|
672
665
|
return { years: -e.years };
|
|
673
666
|
if (Jt in e)
|
|
@@ -676,21 +669,21 @@ function Be(e) {
|
|
|
676
669
|
return { days: -e.days };
|
|
677
670
|
throw new TypeError();
|
|
678
671
|
}
|
|
679
|
-
function
|
|
672
|
+
function Be(e, t) {
|
|
680
673
|
return g.from(new Date(Date.UTC(e.year, e.month - 1, t)));
|
|
681
674
|
}
|
|
682
|
-
function
|
|
675
|
+
function He(e, t) {
|
|
683
676
|
const s = new g(t, e.month, 1), n = ut(s), o = e.toDate();
|
|
684
|
-
return o.setUTCFullYear(t),
|
|
677
|
+
return o.setUTCFullYear(t), z(g.from(o), s, n);
|
|
685
678
|
}
|
|
686
|
-
function
|
|
679
|
+
function We(e, t) {
|
|
687
680
|
const s = new g(e.year, t, 1), n = ut(s), o = e.toDate();
|
|
688
|
-
return o.setUTCMonth(t - 1),
|
|
681
|
+
return o.setUTCMonth(t - 1), z(g.from(o), s, n);
|
|
689
682
|
}
|
|
690
683
|
function Dt(e, t) {
|
|
691
|
-
return Zt in t ?
|
|
684
|
+
return Zt in t ? Be(e, e.day + t.days) : Jt in t ? We(e, e.month + t.months) : Kt in t ? He(e, e.year + t.years) : e;
|
|
692
685
|
}
|
|
693
|
-
const
|
|
686
|
+
const X = (e, t) => e.toString().padStart(t, "0");
|
|
694
687
|
class g {
|
|
695
688
|
constructor(t, s, n) {
|
|
696
689
|
this.year = t, this.month = s, this.day = n;
|
|
@@ -699,10 +692,10 @@ class g {
|
|
|
699
692
|
return Dt(this, t);
|
|
700
693
|
}
|
|
701
694
|
subtract(t) {
|
|
702
|
-
return Dt(this,
|
|
695
|
+
return Dt(this, ze(t));
|
|
703
696
|
}
|
|
704
697
|
toString() {
|
|
705
|
-
return `${
|
|
698
|
+
return `${X(this.year, 4)}-${X(this.month, 2)}-${X(this.day, 2)}`;
|
|
706
699
|
}
|
|
707
700
|
toDate() {
|
|
708
701
|
return new Date(Date.UTC(this.year, this.month - 1, this.day, 0, 0, 0));
|
|
@@ -720,7 +713,7 @@ class g {
|
|
|
720
713
|
return typeof t == "string" ? this.fromString(t) : this.fromDate(t);
|
|
721
714
|
}
|
|
722
715
|
static fromString(t) {
|
|
723
|
-
const s = t.match(
|
|
716
|
+
const s = t.match(qe);
|
|
724
717
|
if (!s)
|
|
725
718
|
throw new TypeError(t);
|
|
726
719
|
const [, n, o, r] = s;
|
|
@@ -769,70 +762,75 @@ class C {
|
|
|
769
762
|
return Wt(n, o);
|
|
770
763
|
}
|
|
771
764
|
}
|
|
772
|
-
function
|
|
765
|
+
function ot(e, t) {
|
|
773
766
|
if (t)
|
|
774
767
|
try {
|
|
775
768
|
return e.from(t);
|
|
776
769
|
} catch {
|
|
777
770
|
}
|
|
778
771
|
}
|
|
779
|
-
function
|
|
772
|
+
function rt(e) {
|
|
780
773
|
const [t, s] = Lt(e);
|
|
781
|
-
return [P(() =>
|
|
774
|
+
return [P(() => ot(g, t), [t]), (r) => s(r.toString())];
|
|
782
775
|
}
|
|
783
|
-
function
|
|
776
|
+
function Ke(e) {
|
|
784
777
|
if (e) {
|
|
785
|
-
const [t, s] = e.split("/"), n =
|
|
778
|
+
const [t, s] = e.split("/"), n = ot(g, t), o = ot(g, s);
|
|
786
779
|
if (n && o)
|
|
787
780
|
return [n, o];
|
|
788
781
|
}
|
|
789
782
|
return [];
|
|
790
783
|
}
|
|
791
|
-
function
|
|
784
|
+
function Je(e, t) {
|
|
792
785
|
return `${e}/${t}`;
|
|
793
786
|
}
|
|
794
|
-
function
|
|
787
|
+
function Ze(e) {
|
|
795
788
|
const [t, s] = Lt(e);
|
|
796
|
-
return [P(() =>
|
|
789
|
+
return [P(() => Ke(t), [t]), (r) => s(Je(r[0], r[1]))];
|
|
797
790
|
}
|
|
798
|
-
function
|
|
791
|
+
function x(e, t) {
|
|
799
792
|
return P(
|
|
800
793
|
() => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
|
|
801
794
|
[t, e]
|
|
802
795
|
);
|
|
803
796
|
}
|
|
804
797
|
function St(e, t, s) {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
[
|
|
808
|
-
|
|
798
|
+
const n = x(e, s);
|
|
799
|
+
return P(() => {
|
|
800
|
+
const o = [], r = /* @__PURE__ */ new Date();
|
|
801
|
+
for (var i = 0; i < 7; i++) {
|
|
802
|
+
const f = (r.getDay() - t + 7) % 7;
|
|
803
|
+
o[f] = n.format(r), r.setDate(r.getDate() + 1);
|
|
804
|
+
}
|
|
805
|
+
return o;
|
|
806
|
+
}, [t, n]);
|
|
809
807
|
}
|
|
810
|
-
function
|
|
808
|
+
function Xe(e) {
|
|
811
809
|
let t = "";
|
|
812
810
|
for (const s in e)
|
|
813
811
|
e[s] && (t += ` ${s}`);
|
|
814
812
|
return t;
|
|
815
813
|
}
|
|
816
|
-
const vt = (e) => e.target.matches(":dir(ltr)"),
|
|
817
|
-
function
|
|
818
|
-
const { offset: s } = e, { firstDayOfWeek: n, isDateDisallowed: o, min: r, max: i, dateWindow: f, locale: u } = t, l =
|
|
814
|
+
const vt = (e) => e.target.matches(":dir(ltr)"), Ge = { month: "long", day: "numeric" }, Qe = { month: "long" }, Ve = { weekday: "narrow" }, tn = { weekday: "long" }, G = { bubbles: !0 };
|
|
815
|
+
function en({ props: e, context: t }) {
|
|
816
|
+
const { offset: s } = e, { firstDayOfWeek: n, isDateDisallowed: o, min: r, max: i, dateWindow: f, locale: u } = t, l = at(), c = St(tn, n, u), h = St(Ve, n, u), a = x(Ge, u), d = x(Qe, u), { focusedDate: y } = f, D = P(
|
|
819
817
|
() => f.start.add({ months: s }),
|
|
820
818
|
[f, s]
|
|
821
819
|
), m = P(
|
|
822
820
|
() => je(D, n),
|
|
823
821
|
[D, n]
|
|
824
|
-
), w = v("focusday",
|
|
825
|
-
function ft(
|
|
826
|
-
w(
|
|
822
|
+
), w = v("focusday", G), M = v("selectday", G), te = v("hoverday", G);
|
|
823
|
+
function ft(b) {
|
|
824
|
+
w(z(b, r, i));
|
|
827
825
|
}
|
|
828
|
-
function ee(
|
|
826
|
+
function ee(b) {
|
|
829
827
|
let E;
|
|
830
|
-
switch (
|
|
828
|
+
switch (b.key) {
|
|
831
829
|
case "ArrowRight":
|
|
832
|
-
E = y.add({ days: vt(
|
|
830
|
+
E = y.add({ days: vt(b) ? 1 : -1 });
|
|
833
831
|
break;
|
|
834
832
|
case "ArrowLeft":
|
|
835
|
-
E = y.add({ days: vt(
|
|
833
|
+
E = y.add({ days: vt(b) ? -1 : 1 });
|
|
836
834
|
break;
|
|
837
835
|
case "ArrowDown":
|
|
838
836
|
E = y.add({ days: 7 });
|
|
@@ -841,13 +839,13 @@ function tn({ props: e, context: t }) {
|
|
|
841
839
|
E = y.add({ days: -7 });
|
|
842
840
|
break;
|
|
843
841
|
case "PageUp":
|
|
844
|
-
E = y.add(
|
|
842
|
+
E = y.add(b.shiftKey ? { years: -1 } : { months: -1 });
|
|
845
843
|
break;
|
|
846
844
|
case "PageDown":
|
|
847
|
-
E = y.add(
|
|
845
|
+
E = y.add(b.shiftKey ? { years: 1 } : { months: 1 });
|
|
848
846
|
break;
|
|
849
847
|
case "Home":
|
|
850
|
-
E =
|
|
848
|
+
E = ct(y, n);
|
|
851
849
|
break;
|
|
852
850
|
case "End":
|
|
853
851
|
E = Ht(y, n);
|
|
@@ -855,40 +853,40 @@ function tn({ props: e, context: t }) {
|
|
|
855
853
|
default:
|
|
856
854
|
return;
|
|
857
855
|
}
|
|
858
|
-
ft(E),
|
|
856
|
+
ft(E), b.preventDefault();
|
|
859
857
|
}
|
|
860
|
-
function ne(
|
|
861
|
-
const E = D.equals(
|
|
862
|
-
let
|
|
858
|
+
function ne(b) {
|
|
859
|
+
const E = D.equals(b), se = b.equals(y), dt = b.equals(l), ht = b.toDate(), _ = o?.(ht), mt = !st(b, r, i);
|
|
860
|
+
let A = !1, yt = !1, B = !1, H = !1;
|
|
863
861
|
if ("highlightedRange" in t) {
|
|
864
|
-
const [
|
|
865
|
-
yt = !0,
|
|
862
|
+
const [W, K] = t.highlightedRange;
|
|
863
|
+
yt = !0, B = W?.equals(b) ?? !1, H = K?.equals(b) ?? !1, A = W && K ? st(b, W, K) : !1;
|
|
866
864
|
} else
|
|
867
|
-
"value" in t && (
|
|
865
|
+
"value" in t && (A = t.value?.equals(b) ?? !1);
|
|
868
866
|
return {
|
|
869
|
-
part:
|
|
867
|
+
part: Xe({
|
|
870
868
|
button: !0,
|
|
871
869
|
day: !0,
|
|
872
|
-
selected: E &&
|
|
870
|
+
selected: E && A,
|
|
873
871
|
today: dt,
|
|
874
|
-
disallowed:
|
|
872
|
+
disallowed: _,
|
|
875
873
|
outside: !E,
|
|
876
|
-
"range-start":
|
|
877
|
-
"range-end":
|
|
878
|
-
"range-inner": yt &&
|
|
874
|
+
"range-start": B,
|
|
875
|
+
"range-end": H,
|
|
876
|
+
"range-inner": yt && A && !B && !H
|
|
879
877
|
}),
|
|
880
878
|
tabindex: E && se ? 0 : -1,
|
|
881
879
|
disabled: mt,
|
|
882
|
-
"aria-disabled":
|
|
883
|
-
"aria-pressed": E &&
|
|
880
|
+
"aria-disabled": _ ? "true" : void 0,
|
|
881
|
+
"aria-pressed": E && A,
|
|
884
882
|
"aria-current": dt ? "date" : void 0,
|
|
885
883
|
"aria-label": a.format(ht),
|
|
886
884
|
onkeydown: ee,
|
|
887
885
|
onclick() {
|
|
888
|
-
|
|
886
|
+
_ || M(b), ft(b);
|
|
889
887
|
},
|
|
890
888
|
onmouseover() {
|
|
891
|
-
!
|
|
889
|
+
!_ && !mt && te(b);
|
|
892
890
|
}
|
|
893
891
|
};
|
|
894
892
|
}
|
|
@@ -935,28 +933,28 @@ class T {
|
|
|
935
933
|
);
|
|
936
934
|
}
|
|
937
935
|
}
|
|
938
|
-
const Tt =
|
|
936
|
+
const Tt = at(), lt = Le({
|
|
939
937
|
firstDayOfWeek: 0,
|
|
940
938
|
isDateDisallowed: () => !1,
|
|
941
939
|
dateWindow: new T(Tt.toPlainYearMonth(), { months: 1 }, Tt)
|
|
942
940
|
});
|
|
943
941
|
customElements.define("calendar-month-ctx", lt);
|
|
944
|
-
const
|
|
942
|
+
const nn = $(
|
|
945
943
|
(e) => {
|
|
946
|
-
const t = _e(lt), s = ae(), n =
|
|
944
|
+
const t = _e(lt), s = ae(), n = en({ props: e, context: t });
|
|
947
945
|
function o() {
|
|
948
946
|
s.current.querySelector("button[tabindex='0']")?.focus();
|
|
949
947
|
}
|
|
950
948
|
return /* @__PURE__ */ I("host", { shadowDom: !0, focus: o, children: [
|
|
951
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ p("div", { id: "heading", part: "heading", children: n.monthFormatter.format(n.yearMonth.toDate()) }),
|
|
952
950
|
/* @__PURE__ */ I("table", { ref: s, "aria-labelledby": "heading", part: "table", children: [
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { part: "tr head", children: n.dayNamesLong.map((r, i) => /* @__PURE__ */ I("th", { part: "th", scope: "col", children: [
|
|
952
|
+
/* @__PURE__ */ p("span", { class: "vh", children: r }),
|
|
953
|
+
/* @__PURE__ */ p("span", { "aria-hidden": "true", children: n.dayNamesShort[i] })
|
|
956
954
|
] })) }) }),
|
|
957
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ p("tbody", { children: n.weeks.map((r, i) => /* @__PURE__ */ p("tr", { part: "tr week", children: r.map((f, u) => {
|
|
958
956
|
const l = n.yearMonth.equals(f), c = t.showOutsideDays || l;
|
|
959
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ p("td", { part: "td", children: c && /* @__PURE__ */ p("button", { ...n.getDayProps(f), children: f.day }) }, u);
|
|
960
958
|
}) }, i)) })
|
|
961
959
|
] })
|
|
962
960
|
] });
|
|
@@ -975,40 +973,40 @@ const en = $(
|
|
|
975
973
|
]
|
|
976
974
|
}
|
|
977
975
|
);
|
|
978
|
-
customElements.define("calendar-month",
|
|
976
|
+
customElements.define("calendar-month", nn);
|
|
979
977
|
function Xt(e) {
|
|
980
978
|
const t = e.dateWindow.start.toDate(), s = e.dateWindow.end.toDate();
|
|
981
979
|
return /* @__PURE__ */ I("div", { role: "group", "aria-labelledby": "label", part: "container", children: [
|
|
982
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ p("div", { id: "label", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, s) }),
|
|
983
981
|
/* @__PURE__ */ I("div", { class: "header", part: "header", children: [
|
|
984
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ p(
|
|
985
983
|
"button",
|
|
986
984
|
{
|
|
987
985
|
part: `button previous ${e.previous ? "" : "disabled"}`,
|
|
988
986
|
onclick: e.previous,
|
|
989
987
|
"aria-disabled": e.previous ? null : "true",
|
|
990
|
-
children: /* @__PURE__ */
|
|
988
|
+
children: /* @__PURE__ */ p("slot", { name: "previous", children: "Previous" })
|
|
991
989
|
}
|
|
992
990
|
),
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ p("div", { id: "heading", part: "heading", "aria-hidden": "true", children: e.format.formatRange(t, s) }),
|
|
992
|
+
/* @__PURE__ */ p(
|
|
995
993
|
"button",
|
|
996
994
|
{
|
|
997
995
|
part: `button next ${e.next ? "" : "disabled"}`,
|
|
998
996
|
onclick: e.next,
|
|
999
997
|
"aria-disabled": e.next ? null : "true",
|
|
1000
|
-
children: /* @__PURE__ */
|
|
998
|
+
children: /* @__PURE__ */ p("slot", { name: "next", children: "Next" })
|
|
1001
999
|
}
|
|
1002
1000
|
)
|
|
1003
1001
|
] }),
|
|
1004
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ p(
|
|
1005
1003
|
lt,
|
|
1006
1004
|
{
|
|
1007
1005
|
value: e,
|
|
1008
1006
|
onselectday: e.onSelect,
|
|
1009
1007
|
onfocusday: e.onFocus,
|
|
1010
1008
|
onhoverday: e.onHover,
|
|
1011
|
-
children: /* @__PURE__ */
|
|
1009
|
+
children: /* @__PURE__ */ p("slot", {})
|
|
1012
1010
|
}
|
|
1013
1011
|
)
|
|
1014
1012
|
] });
|
|
@@ -1051,10 +1049,10 @@ const Gt = {
|
|
|
1051
1049
|
zt,
|
|
1052
1050
|
Bt,
|
|
1053
1051
|
q`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}.header{display:flex;align-items:center;justify-content:space-between}#heading{font-weight:700;font-size:1.25em}button{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.4}`
|
|
1054
|
-
],
|
|
1052
|
+
], sn = { year: "numeric" }, on = { year: "numeric", month: "long" };
|
|
1055
1053
|
function Vt({ months: e, locale: t }) {
|
|
1056
|
-
const [s] =
|
|
1057
|
-
const m =
|
|
1054
|
+
const [s] = rt("min"), [n] = rt("max"), o = v("focusday"), r = v("change"), [i, f] = it(() => {
|
|
1055
|
+
const m = at(), w = e === 12 ? new C(m.year, 1) : m.toPlainYearMonth();
|
|
1058
1056
|
return new T(w, { months: e }, m);
|
|
1059
1057
|
});
|
|
1060
1058
|
function u(m) {
|
|
@@ -1067,7 +1065,7 @@ function Vt({ months: e, locale: t }) {
|
|
|
1067
1065
|
function h() {
|
|
1068
1066
|
c.current.querySelectorAll("calendar-month").forEach((m) => m.focus());
|
|
1069
1067
|
}
|
|
1070
|
-
const a =
|
|
1068
|
+
const a = x(sn, t), d = x(on, t), y = n == null || !i.contains(n), D = s == null || !i.contains(s);
|
|
1071
1069
|
return {
|
|
1072
1070
|
format: a,
|
|
1073
1071
|
formatVerbose: d,
|
|
@@ -1084,16 +1082,16 @@ function Vt({ months: e, locale: t }) {
|
|
|
1084
1082
|
focus: h
|
|
1085
1083
|
};
|
|
1086
1084
|
}
|
|
1087
|
-
const
|
|
1085
|
+
const rn = $(
|
|
1088
1086
|
(e) => {
|
|
1089
|
-
const [t, s] =
|
|
1087
|
+
const [t, s] = rt("value"), n = Vt(e);
|
|
1090
1088
|
j(() => {
|
|
1091
1089
|
t && n.setFocusedDate(t);
|
|
1092
1090
|
}, [t]);
|
|
1093
1091
|
function o(r) {
|
|
1094
1092
|
s(r.detail), n.dispatch();
|
|
1095
1093
|
}
|
|
1096
|
-
return /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ p("host", { shadowDom: !0, focus: n.focus, children: /* @__PURE__ */ p(
|
|
1097
1095
|
Xt,
|
|
1098
1096
|
{
|
|
1099
1097
|
...e,
|
|
@@ -1106,12 +1104,12 @@ const on = $(
|
|
|
1106
1104
|
},
|
|
1107
1105
|
{ props: Gt, styles: Qt }
|
|
1108
1106
|
);
|
|
1109
|
-
customElements.define("calendar-date",
|
|
1110
|
-
const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e],
|
|
1107
|
+
customElements.define("calendar-date", rn);
|
|
1108
|
+
const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e], an = $(
|
|
1111
1109
|
(e) => {
|
|
1112
|
-
const [t, s] =
|
|
1110
|
+
const [t, s] = Ze("value"), n = Vt(e), o = v("rangestart"), r = v("rangeend"), [i, f] = it();
|
|
1113
1111
|
j(() => {
|
|
1114
|
-
t.length && !
|
|
1112
|
+
t.length && !st(n.dateWindow.focusedDate, t[0], t[1]) && n.setFocusedDate(t[1]);
|
|
1115
1113
|
}, [t]);
|
|
1116
1114
|
async function u(a) {
|
|
1117
1115
|
n.handleFocus(a), l(a);
|
|
@@ -1124,7 +1122,7 @@ const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e], rn = $(
|
|
|
1124
1122
|
a.stopPropagation(), i ? (s(Ct(i.first, d)), f(void 0), r(d.toDate()), n.dispatch()) : (f({ first: d, second: d }), o(d.toDate()));
|
|
1125
1123
|
}
|
|
1126
1124
|
const h = i ? Ct(i.first, i.second) : t;
|
|
1127
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ p("host", { shadowDom: !0, focus: n.focus, children: /* @__PURE__ */ p(
|
|
1128
1126
|
Xt,
|
|
1129
1127
|
{
|
|
1130
1128
|
...e,
|
|
@@ -1138,9 +1136,9 @@ const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e], rn = $(
|
|
|
1138
1136
|
},
|
|
1139
1137
|
{ props: Gt, styles: Qt }
|
|
1140
1138
|
);
|
|
1141
|
-
customElements.define("calendar-range",
|
|
1139
|
+
customElements.define("calendar-range", an);
|
|
1142
1140
|
export {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1141
|
+
rn as CalendarDate,
|
|
1142
|
+
nn as CalendarMonth,
|
|
1143
|
+
an as CalendarRange
|
|
1146
1144
|
};
|