cally 0.4.0 → 0.4.2
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 +82 -82
- package/package.json +2 -1
package/dist/cally.js
CHANGED
|
@@ -37,17 +37,17 @@ const re = Symbol.for("Atomico.suspense"), Pt = Symbol.for("Atomico.effect"), ie
|
|
|
37
37
|
return r.value = e(r.value), r.effect = t, r.tag = s, N.c.i++, o[n].value;
|
|
38
38
|
}, ae = (e) => O((t = Nt(e)) => t), U = () => O((e = Nt(N.c.host)) => e), Ft = () => N.c.update, ce = (e, t, s = 0) => {
|
|
39
39
|
let n = {}, o = !1;
|
|
40
|
-
const r = () => o, i = (
|
|
40
|
+
const r = () => o, i = (l, c) => {
|
|
41
41
|
for (const h in n) {
|
|
42
42
|
const a = n[h];
|
|
43
|
-
a.effect && a.tag ===
|
|
43
|
+
a.effect && a.tag === l && (a.value = a.effect(a.value, c));
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
return { load: (
|
|
46
|
+
return { load: (l) => {
|
|
47
47
|
N.c = { host: t, hooks: n, update: e, i: 0, id: s };
|
|
48
48
|
let c;
|
|
49
49
|
try {
|
|
50
|
-
o = !1, c =
|
|
50
|
+
o = !1, c = l();
|
|
51
51
|
} catch (h) {
|
|
52
52
|
if (h !== re)
|
|
53
53
|
throw h;
|
|
@@ -56,8 +56,8 @@ const re = Symbol.for("Atomico.suspense"), Pt = Symbol.for("Atomico.effect"), ie
|
|
|
56
56
|
N.c = null;
|
|
57
57
|
}
|
|
58
58
|
return c;
|
|
59
|
-
}, cleanEffects: (
|
|
60
|
-
i(Pt,
|
|
59
|
+
}, cleanEffects: (l) => (i(Ot, l), () => (i(ie, l), () => {
|
|
60
|
+
i(Pt, l);
|
|
61
61
|
})), isSuspense: r };
|
|
62
62
|
}, F = Symbol.for;
|
|
63
63
|
function Mt(e, t) {
|
|
@@ -71,7 +71,7 @@ function Mt(e, t) {
|
|
|
71
71
|
}
|
|
72
72
|
return !0;
|
|
73
73
|
}
|
|
74
|
-
const S = (e) => typeof e == "function", A = (e) => typeof e == "object", { isArray:
|
|
74
|
+
const S = (e) => typeof e == "function", A = (e) => typeof e == "object", { isArray: ue } = Array, et = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
|
|
75
75
|
function kt(e, t) {
|
|
76
76
|
let s;
|
|
77
77
|
const n = (o) => {
|
|
@@ -81,10 +81,10 @@ function kt(e, t) {
|
|
|
81
81
|
if (f && Array.isArray(f))
|
|
82
82
|
n(f);
|
|
83
83
|
else {
|
|
84
|
-
const
|
|
85
|
-
if (f == null ||
|
|
84
|
+
const u = typeof f;
|
|
85
|
+
if (f == null || u === "function" || u === "boolean")
|
|
86
86
|
continue;
|
|
87
|
-
|
|
87
|
+
u === "string" || u === "number" ? (s == null && (s = ""), s += f) : (s != null && (t(s), s = null), t(f));
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
};
|
|
@@ -104,7 +104,7 @@ class Rt {
|
|
|
104
104
|
}
|
|
105
105
|
class It extends Rt {
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class le extends Rt {
|
|
108
108
|
}
|
|
109
109
|
const L = "Custom", fe = null, de = { true: 1, "": 1, 1: 1 };
|
|
110
110
|
function he(e, t, s, n, o) {
|
|
@@ -112,9 +112,9 @@ function he(e, t, s, n, o) {
|
|
|
112
112
|
type: r,
|
|
113
113
|
reflect: i,
|
|
114
114
|
event: f,
|
|
115
|
-
value:
|
|
116
|
-
attr:
|
|
117
|
-
} = s?.name != L && A(s) && s != fe ? s : { type: s }, c = r?.name === L && r.map, h =
|
|
115
|
+
value: u,
|
|
116
|
+
attr: l = me(t)
|
|
117
|
+
} = s?.name != L && A(s) && s != fe ? s : { type: s }, c = r?.name === L && r.map, h = u != null ? r == Function || !S(u) ? () => u : u : null;
|
|
118
118
|
Object.defineProperty(e, t, {
|
|
119
119
|
configurable: !0,
|
|
120
120
|
/**
|
|
@@ -135,7 +135,7 @@ function he(e, t, s, n, o) {
|
|
|
135
135
|
D
|
|
136
136
|
);
|
|
137
137
|
d != D && (this._props[t] = D ?? void 0, this.update(), f && Ut(this, f), this.updated.then(() => {
|
|
138
|
-
i && (this._ignoreAttr =
|
|
138
|
+
i && (this._ignoreAttr = l, ye(this, r, l, this[t]), this._ignoreAttr = null);
|
|
139
139
|
}));
|
|
140
140
|
},
|
|
141
141
|
/**
|
|
@@ -144,7 +144,7 @@ function he(e, t, s, n, o) {
|
|
|
144
144
|
get() {
|
|
145
145
|
return this._props[t];
|
|
146
146
|
}
|
|
147
|
-
}), h && (o[t] = h()), n[
|
|
147
|
+
}), h && (o[t] = h()), n[l] = { prop: t, type: r };
|
|
148
148
|
}
|
|
149
149
|
const Ut = (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,
|
|
@@ -174,7 +174,7 @@ const we = (e) => {
|
|
|
174
174
|
return t || "c" + De++;
|
|
175
175
|
}, $ = (e, t = HTMLElement) => {
|
|
176
176
|
const s = {}, n = {}, o = "prototype" in t && t.prototype instanceof Element, r = o ? t : "base" in t ? t.base : HTMLElement, { props: i, styles: f } = o ? e : t;
|
|
177
|
-
class
|
|
177
|
+
class u extends r {
|
|
178
178
|
constructor() {
|
|
179
179
|
super(), this._setup(), this._render = () => e({ ...this._props });
|
|
180
180
|
for (const c in n)
|
|
@@ -244,7 +244,7 @@ const we = (e) => {
|
|
|
244
244
|
try {
|
|
245
245
|
this[d] = be(y, a);
|
|
246
246
|
} catch {
|
|
247
|
-
throw new
|
|
247
|
+
throw new le(
|
|
248
248
|
this,
|
|
249
249
|
`The value defined as attr '${c}' cannot be parsed by type '${y.name}'`,
|
|
250
250
|
a
|
|
@@ -263,7 +263,7 @@ const we = (e) => {
|
|
|
263
263
|
return Object.keys(s).concat(c);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
return
|
|
266
|
+
return u;
|
|
267
267
|
};
|
|
268
268
|
function Ee(e) {
|
|
269
269
|
const { styles: t } = e.constructor, { shadowRoot: s } = e;
|
|
@@ -375,7 +375,7 @@ const Yt = globalThis[nt], ve = {
|
|
|
375
375
|
}, _ = {}, st = [];
|
|
376
376
|
class ot extends Text {
|
|
377
377
|
}
|
|
378
|
-
const Ne = F("atomico/id"), R = F("atomico/type"),
|
|
378
|
+
const Ne = F("atomico/id"), R = F("atomico/type"), X = F("atomico/ref"), $t = F("atomico/vnode"), Pe = () => {
|
|
379
379
|
};
|
|
380
380
|
function Oe(e, t, s) {
|
|
381
381
|
return qt(this, e, t, s);
|
|
@@ -418,35 +418,35 @@ function qt(e, t, s = Ne, n, o) {
|
|
|
418
418
|
let r;
|
|
419
419
|
if (t && t[s] && t[s].vnode == e || e[R] != $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[X] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[X] || t.localName != e.type : !t), r && e.type != null && (e.raw == 1 && e.clone ? (n = !0, t = e.type.cloneNode(!0), t[X] = 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] : _, { vnode: f = _, cycle:
|
|
429
|
-
let { fragment:
|
|
428
|
+
const i = t[s] ? t[s] : _, { vnode: f = _, cycle: u = 0 } = i;
|
|
429
|
+
let { fragment: l, handlers: c } = i;
|
|
430
430
|
const { children: h = st, props: a = _ } = f;
|
|
431
431
|
if (c = r ? {} : c || {}, e.static && !r)
|
|
432
432
|
return t;
|
|
433
433
|
if (e.shadow && !t.shadowRoot && // @ts-ignore
|
|
434
434
|
t.attachShadow({ mode: "open", ...e.shadow }), e.props != a && ke(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,
|
|
438
438
|
/**
|
|
439
439
|
* @todo for hydration use attribute and send childNodes
|
|
440
440
|
*/
|
|
441
|
-
|
|
441
|
+
l,
|
|
442
442
|
d,
|
|
443
443
|
s,
|
|
444
444
|
// add support to foreignObject, children will escape from svg
|
|
445
|
-
!
|
|
445
|
+
!u && n,
|
|
446
446
|
o && e.type == "foreignObject" ? !1 : o
|
|
447
447
|
);
|
|
448
448
|
}
|
|
449
|
-
return t[s] = { vnode: e, handlers: c, fragment:
|
|
449
|
+
return t[s] = { vnode: e, handlers: c, fragment: l, cycle: u + 1 }, t;
|
|
450
450
|
}
|
|
451
451
|
function Fe(e, t) {
|
|
452
452
|
const s = new ot(""), n = new ot("");
|
|
@@ -468,17 +468,17 @@ function Fe(e, t) {
|
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
function Me(e, t, s, n, o, r) {
|
|
471
|
-
e = e == null ? null :
|
|
472
|
-
const i = t || Fe(s, o), { markStart: f, markEnd:
|
|
471
|
+
e = e == null ? null : ue(e) ? e : [e];
|
|
472
|
+
const i = t || Fe(s, o), { markStart: f, markEnd: u, keyes: l } = i;
|
|
473
473
|
let c;
|
|
474
|
-
const h =
|
|
474
|
+
const h = l && /* @__PURE__ */ new Set();
|
|
475
475
|
let a = f;
|
|
476
476
|
if (e && kt(e, (d) => {
|
|
477
477
|
if (typeof d == "object" && !d[R])
|
|
478
478
|
return;
|
|
479
|
-
const y = d[R] && d.key, D =
|
|
480
|
-
a !=
|
|
481
|
-
const m =
|
|
479
|
+
const y = d[R] && d.key, D = l && y != null && l.get(y);
|
|
480
|
+
a != u && a === D ? h.delete(a) : a = a == u ? u : a.nextSibling;
|
|
481
|
+
const m = l ? D : a;
|
|
482
482
|
let w = m;
|
|
483
483
|
if (d[R])
|
|
484
484
|
w = qt(d, m, n, o, r);
|
|
@@ -486,9 +486,9 @@ function Me(e, t, s, n, o, r) {
|
|
|
486
486
|
const M = d + "";
|
|
487
487
|
!(w instanceof Text) || w instanceof ot ? w = new Text(M) : w.data != M && (w.data = M);
|
|
488
488
|
}
|
|
489
|
-
w != a && (
|
|
490
|
-
}), a = a ==
|
|
491
|
-
for (; a !=
|
|
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
|
+
}), a = a == u ? u : a.nextSibling, t && a != u)
|
|
491
|
+
for (; a != u; ) {
|
|
492
492
|
const d = a;
|
|
493
493
|
a = a.nextSibling, d.remove();
|
|
494
494
|
}
|
|
@@ -509,17 +509,17 @@ function bt(e, t, s, n, o, r) {
|
|
|
509
509
|
else if (t == "style") {
|
|
510
510
|
const { style: i } = e;
|
|
511
511
|
s = s || "", n = n || "";
|
|
512
|
-
const f = A(s),
|
|
512
|
+
const f = A(s), u = A(n);
|
|
513
513
|
if (f)
|
|
514
|
-
for (const
|
|
515
|
-
if (
|
|
516
|
-
!(
|
|
514
|
+
for (const l in s)
|
|
515
|
+
if (u)
|
|
516
|
+
!(l in n) && pt(i, l, null);
|
|
517
517
|
else
|
|
518
518
|
break;
|
|
519
|
-
if (
|
|
520
|
-
for (const
|
|
521
|
-
const c = n[
|
|
522
|
-
f && s[
|
|
519
|
+
if (u)
|
|
520
|
+
for (const l in n) {
|
|
521
|
+
const c = n[l];
|
|
522
|
+
f && s[l] === c || pt(i, l, c);
|
|
523
523
|
}
|
|
524
524
|
else
|
|
525
525
|
i.cssText = n;
|
|
@@ -619,7 +619,7 @@ const Ie = jt("host", { style: "display: contents" }), G = F("atomico/context"),
|
|
|
619
619
|
}
|
|
620
620
|
);
|
|
621
621
|
return t.value = e, t;
|
|
622
|
-
}, b = (e, t, s) => (t == null ? t = { key: s } : t.key = s, jt(e, t)), I = b, zt = q`*,*:before,*:after{box-sizing:border-box}`, Bt = q`.vh{position:absolute;transform:scale(0)}`;
|
|
622
|
+
}, b = (e, t, s) => (t == null ? t = { key: s } : t.key = s, jt(e, t)), I = b, zt = q`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation}`, Bt = q`.vh{position:absolute;transform:scale(0)}`;
|
|
623
623
|
function z() {
|
|
624
624
|
const e = new Date(Date.now());
|
|
625
625
|
return new g(e.getUTCFullYear(), e.getUTCMonth() + 1, e.getUTCDate());
|
|
@@ -631,7 +631,7 @@ function B(e, t = 0) {
|
|
|
631
631
|
function Ht(e, t = 0) {
|
|
632
632
|
return B(e, t).add({ days: 6 });
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function ut(e) {
|
|
635
635
|
return g.from(new Date(Date.UTC(e.year, e.month, 0)));
|
|
636
636
|
}
|
|
637
637
|
function Wt(e, t) {
|
|
@@ -657,7 +657,7 @@ function $e(e, t) {
|
|
|
657
657
|
return s;
|
|
658
658
|
}
|
|
659
659
|
function je(e, t = 0) {
|
|
660
|
-
const s = B(e.toPlainDate(), t), n = Ht(
|
|
660
|
+
const s = B(e.toPlainDate(), t), n = Ht(ut(e), t);
|
|
661
661
|
return $e(Ye(s, n), 7);
|
|
662
662
|
}
|
|
663
663
|
function qe(e, t, s) {
|
|
@@ -666,13 +666,13 @@ function qe(e, t, s) {
|
|
|
666
666
|
n[f] = i.format(r), r.setDate(r.getDate() + 1);
|
|
667
667
|
return n;
|
|
668
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",
|
|
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
670
|
function Be(e) {
|
|
671
671
|
if (Kt in e)
|
|
672
672
|
return { years: -e.years };
|
|
673
673
|
if (Jt in e)
|
|
674
674
|
return { months: -e.months };
|
|
675
|
-
if (
|
|
675
|
+
if (Zt in e)
|
|
676
676
|
return { days: -e.days };
|
|
677
677
|
throw new TypeError();
|
|
678
678
|
}
|
|
@@ -680,15 +680,15 @@ function He(e, t) {
|
|
|
680
680
|
return g.from(new Date(Date.UTC(e.year, e.month - 1, t)));
|
|
681
681
|
}
|
|
682
682
|
function We(e, t) {
|
|
683
|
-
const s = new g(t, e.month, 1), n =
|
|
683
|
+
const s = new g(t, e.month, 1), n = ut(s), o = e.toDate();
|
|
684
684
|
return o.setUTCFullYear(t), H(g.from(o), s, n);
|
|
685
685
|
}
|
|
686
686
|
function Ke(e, t) {
|
|
687
|
-
const s = new g(e.year, t, 1), n =
|
|
687
|
+
const s = new g(e.year, t, 1), n = ut(s), o = e.toDate();
|
|
688
688
|
return o.setUTCMonth(t - 1), H(g.from(o), s, n);
|
|
689
689
|
}
|
|
690
690
|
function Dt(e, t) {
|
|
691
|
-
return
|
|
691
|
+
return Zt in t ? He(e, e.day + t.days) : Jt in t ? Ke(e, e.month + t.months) : Kt in t ? We(e, e.year + t.years) : e;
|
|
692
692
|
}
|
|
693
693
|
const Q = (e, t) => e.toString().padStart(t, "0");
|
|
694
694
|
class g {
|
|
@@ -788,16 +788,16 @@ function Je(e) {
|
|
|
788
788
|
}
|
|
789
789
|
return [];
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ze(e, t) {
|
|
792
792
|
return `${e}/${t}`;
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function Xe(e) {
|
|
795
795
|
const [t, s] = Lt(e);
|
|
796
|
-
return [P(() => Je(t), [t]), (r) => s(
|
|
796
|
+
return [P(() => Je(t), [t]), (r) => s(Ze(r[0], r[1]))];
|
|
797
797
|
}
|
|
798
798
|
function Y(e, t) {
|
|
799
799
|
return P(
|
|
800
|
-
() => new Intl.DateTimeFormat(t, e),
|
|
800
|
+
() => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
|
|
801
801
|
[t, e]
|
|
802
802
|
);
|
|
803
803
|
}
|
|
@@ -815,7 +815,7 @@ function Ge(e) {
|
|
|
815
815
|
}
|
|
816
816
|
const vt = (e) => e.target.matches(":dir(ltr)"), Qe = { month: "long", day: "numeric" }, Ve = { month: "long" }, V = { bubbles: !0 };
|
|
817
817
|
function tn({ props: e, context: t }) {
|
|
818
|
-
const { offset: s } = e, { firstDayOfWeek: n, isDateDisallowed: o, min: r, max: i, dateWindow: f, locale:
|
|
818
|
+
const { offset: s } = e, { firstDayOfWeek: n, isDateDisallowed: o, min: r, max: i, dateWindow: f, locale: u } = t, l = z(), c = St("long", n, u), h = St("narrow", n, u), a = Y(Qe, u), d = Y(Ve, u), { focusedDate: y } = f, D = P(
|
|
819
819
|
() => f.start.add({ months: s }),
|
|
820
820
|
[f, s]
|
|
821
821
|
), m = P(
|
|
@@ -858,11 +858,11 @@ function tn({ props: e, context: t }) {
|
|
|
858
858
|
ft(E), p.preventDefault();
|
|
859
859
|
}
|
|
860
860
|
function ne(p) {
|
|
861
|
-
const E = D.equals(p), se = p.equals(y), dt = p.equals(
|
|
861
|
+
const E = D.equals(p), se = p.equals(y), dt = p.equals(l), ht = p.toDate(), x = o?.(ht), mt = !rt(p, r, i);
|
|
862
862
|
let k = !1, yt = !1, W = !1, K = !1;
|
|
863
863
|
if ("highlightedRange" in t) {
|
|
864
|
-
const [J,
|
|
865
|
-
yt = !0, W = J?.equals(p) ?? !1, K =
|
|
864
|
+
const [J, Z] = t.highlightedRange;
|
|
865
|
+
yt = !0, W = J?.equals(p) ?? !1, K = Z?.equals(p) ?? !1, k = J && Z ? rt(p, J, Z) : !1;
|
|
866
866
|
} else
|
|
867
867
|
"value" in t && (k = t.value?.equals(p) ?? !1);
|
|
868
868
|
return {
|
|
@@ -935,15 +935,15 @@ class T {
|
|
|
935
935
|
);
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
|
-
const Tt = z(),
|
|
938
|
+
const Tt = z(), lt = Le({
|
|
939
939
|
firstDayOfWeek: 0,
|
|
940
940
|
isDateDisallowed: () => !1,
|
|
941
941
|
dateWindow: new T(Tt.toPlainYearMonth(), { months: 1 }, Tt)
|
|
942
942
|
});
|
|
943
|
-
customElements.define("calendar-month-ctx",
|
|
943
|
+
customElements.define("calendar-month-ctx", lt);
|
|
944
944
|
const en = $(
|
|
945
945
|
(e) => {
|
|
946
|
-
const t = _e(
|
|
946
|
+
const t = _e(lt), s = ae(), n = tn({ props: e, context: t });
|
|
947
947
|
function o() {
|
|
948
948
|
s.current.querySelector("button[tabindex='0']")?.focus();
|
|
949
949
|
}
|
|
@@ -954,9 +954,9 @@ const en = $(
|
|
|
954
954
|
/* @__PURE__ */ b("span", { class: "vh", children: r }),
|
|
955
955
|
/* @__PURE__ */ b("span", { "aria-hidden": "true", children: n.dayNamesShort[i] })
|
|
956
956
|
] })) }) }),
|
|
957
|
-
/* @__PURE__ */ b("tbody", { children: n.weeks.map((r, i) => /* @__PURE__ */ b("tr", { part: "tr week", children: r.map((f,
|
|
958
|
-
const
|
|
959
|
-
return /* @__PURE__ */ b("td", { part: "td", children: c && /* @__PURE__ */ b("button", { ...n.getDayProps(f), children: f.day }) },
|
|
957
|
+
/* @__PURE__ */ b("tbody", { children: n.weeks.map((r, i) => /* @__PURE__ */ b("tr", { part: "tr week", children: r.map((f, u) => {
|
|
958
|
+
const l = n.yearMonth.equals(f), c = t.showOutsideDays || l;
|
|
959
|
+
return /* @__PURE__ */ b("td", { part: "td", children: c && /* @__PURE__ */ b("button", { ...n.getDayProps(f), children: f.day }) }, u);
|
|
960
960
|
}) }, i)) })
|
|
961
961
|
] })
|
|
962
962
|
] });
|
|
@@ -976,7 +976,7 @@ const en = $(
|
|
|
976
976
|
}
|
|
977
977
|
);
|
|
978
978
|
customElements.define("calendar-month", en);
|
|
979
|
-
function
|
|
979
|
+
function Xt(e) {
|
|
980
980
|
const t = e.dateWindow.start.toDate(), s = e.dateWindow.end.toDate();
|
|
981
981
|
return /* @__PURE__ */ I("div", { role: "group", "aria-labelledby": "label", part: "container", children: [
|
|
982
982
|
/* @__PURE__ */ b("div", { id: "label", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, s) }),
|
|
@@ -1002,7 +1002,7 @@ function Zt(e) {
|
|
|
1002
1002
|
)
|
|
1003
1003
|
] }),
|
|
1004
1004
|
/* @__PURE__ */ b(
|
|
1005
|
-
|
|
1005
|
+
lt,
|
|
1006
1006
|
{
|
|
1007
1007
|
value: e,
|
|
1008
1008
|
onselectday: e.onSelect,
|
|
@@ -1057,10 +1057,10 @@ function Vt({ months: e, locale: t }) {
|
|
|
1057
1057
|
const m = z(), w = e === 12 ? new C(m.year, 1) : m.toPlainYearMonth();
|
|
1058
1058
|
return new T(w, { months: e }, m);
|
|
1059
1059
|
});
|
|
1060
|
-
function
|
|
1060
|
+
function u(m) {
|
|
1061
1061
|
f(m), o(m.focusedDate.toDate());
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function l(m) {
|
|
1064
1064
|
f(i.adjust(m));
|
|
1065
1065
|
}
|
|
1066
1066
|
const c = U();
|
|
@@ -1074,13 +1074,13 @@ function Vt({ months: e, locale: t }) {
|
|
|
1074
1074
|
dateWindow: i,
|
|
1075
1075
|
dispatch: r,
|
|
1076
1076
|
handleFocus(m) {
|
|
1077
|
-
m.stopPropagation(),
|
|
1077
|
+
m.stopPropagation(), l(m.detail), o(m.detail.toDate()), setTimeout(h);
|
|
1078
1078
|
},
|
|
1079
|
-
setFocusedDate:
|
|
1079
|
+
setFocusedDate: l,
|
|
1080
1080
|
min: s,
|
|
1081
1081
|
max: n,
|
|
1082
|
-
next: y ? () =>
|
|
1083
|
-
previous: D ? () =>
|
|
1082
|
+
next: y ? () => u(i.next()) : void 0,
|
|
1083
|
+
previous: D ? () => u(i.prev()) : void 0,
|
|
1084
1084
|
focus: h
|
|
1085
1085
|
};
|
|
1086
1086
|
}
|
|
@@ -1094,7 +1094,7 @@ const on = $(
|
|
|
1094
1094
|
s(r.detail), n.dispatch();
|
|
1095
1095
|
}
|
|
1096
1096
|
return /* @__PURE__ */ b("host", { shadowDom: !0, focus: n.focus, children: /* @__PURE__ */ b(
|
|
1097
|
-
|
|
1097
|
+
Xt,
|
|
1098
1098
|
{
|
|
1099
1099
|
...e,
|
|
1100
1100
|
...n,
|
|
@@ -1109,14 +1109,14 @@ const on = $(
|
|
|
1109
1109
|
customElements.define("calendar-date", on);
|
|
1110
1110
|
const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e], rn = $(
|
|
1111
1111
|
(e) => {
|
|
1112
|
-
const [t, s] =
|
|
1112
|
+
const [t, s] = Xe("value"), n = Vt(e), o = v("rangestart"), r = v("rangeend"), [i, f] = ct();
|
|
1113
1113
|
j(() => {
|
|
1114
1114
|
t.length && !rt(n.dateWindow.focusedDate, t[0], t[1]) && n.setFocusedDate(t[1]);
|
|
1115
1115
|
}, [t]);
|
|
1116
|
-
async function
|
|
1117
|
-
n.handleFocus(a),
|
|
1116
|
+
async function u(a) {
|
|
1117
|
+
n.handleFocus(a), l(a);
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function l(a) {
|
|
1120
1120
|
a.stopPropagation(), f((d) => d && { ...d, second: a.detail });
|
|
1121
1121
|
}
|
|
1122
1122
|
function c(a) {
|
|
@@ -1125,13 +1125,13 @@ const Ct = (e, t) => g.compare(e, t) < 0 ? [e, t] : [t, e], rn = $(
|
|
|
1125
1125
|
}
|
|
1126
1126
|
const h = i ? Ct(i.first, i.second) : t;
|
|
1127
1127
|
return /* @__PURE__ */ b("host", { shadowDom: !0, focus: n.focus, children: /* @__PURE__ */ b(
|
|
1128
|
-
|
|
1128
|
+
Xt,
|
|
1129
1129
|
{
|
|
1130
1130
|
...e,
|
|
1131
1131
|
...n,
|
|
1132
1132
|
highlightedRange: h,
|
|
1133
|
-
onFocus:
|
|
1134
|
-
onHover:
|
|
1133
|
+
onFocus: u,
|
|
1134
|
+
onHover: l,
|
|
1135
1135
|
onSelect: c
|
|
1136
1136
|
}
|
|
1137
1137
|
) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cally",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "small, feature-rich calendar components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@web/test-runner-playwright": "^0.11.0",
|
|
49
49
|
"@web/test-runner-visual-regression": "^0.9.0",
|
|
50
50
|
"astro": "^4.5.10",
|
|
51
|
+
"postcss-nesting": "^12.1.1",
|
|
51
52
|
"prettier": "^3.2.5",
|
|
52
53
|
"typescript": "^5.3.3",
|
|
53
54
|
"vite": "^5.1.4",
|