+93
-93
@@ -124,3 +124,3 @@ class le { | ||
| d && r != Boolean && i == null && (i = d()); | ||
| const { error: g, value: b } = (c ? Ee : ve)( | ||
| const { error: g, value: b } = (c ? Te : Ee)( | ||
| r, | ||
@@ -153,3 +153,3 @@ i | ||
| new e(t) | ||
| ), Ee = ({ map: e }, t) => { | ||
| ), Te = ({ map: e }, t) => { | ||
| try { | ||
@@ -160,3 +160,3 @@ return { value: e(t), error: !1 }; | ||
| } | ||
| }, ve = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? { | ||
| }, Ee = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? { | ||
| value: t, | ||
@@ -171,6 +171,6 @@ error: {}.toString.call(t) !== `[object ${e.name}]` | ||
| } : { value: t, error: !0 }; | ||
| let we = 0; | ||
| const Se = (e) => { | ||
| let ve = 0; | ||
| const we = (e) => { | ||
| const t = (e?.dataset || {})?.hydrate || ""; | ||
| return t || "c" + we++; | ||
| return t || "c" + ve++; | ||
| }, k = (e, t = HTMLElement) => { | ||
@@ -205,3 +205,3 @@ const n = {}, s = {}, o = "prototype" in t && t.prototype instanceof Element, r = o ? t : "base" in t ? t.base : HTMLElement, { props: a, styles: u } = o ? e : t; | ||
| this, | ||
| Se(this) | ||
| we(this) | ||
| ); | ||
@@ -214,3 +214,3 @@ let m, g = !0; | ||
| return y && //@ts-ignore | ||
| y.render(this, this.symbolId, b), m = !1, g && !i.isSuspense() && (g = !1, !b && Te(this)), p(); | ||
| y.render(this, this.symbolId, b), m = !1, g && !i.isSuspense() && (g = !1, !b && Se(this)), p(); | ||
| } finally { | ||
@@ -268,3 +268,3 @@ m = !1; | ||
| }; | ||
| function Te(e) { | ||
| function Se(e) { | ||
| const { styles: t } = e.constructor, { shadowRoot: n } = e; | ||
@@ -329,3 +329,3 @@ if (n && t.length) { | ||
| ); | ||
| }, S = (e, t) => { | ||
| }, w = (e, t) => { | ||
| const [n] = R(([s, o, r = 0] = []) => ((!o || o && !xt(o, t)) && (s = e()), [s, t, r])); | ||
@@ -384,3 +384,3 @@ return n; | ||
| }; | ||
| function $e(e, t, n) { | ||
| function Ue(e, t, n) { | ||
| return Xt(this, e, t, n); | ||
@@ -401,3 +401,3 @@ } | ||
| ); | ||
| const a = K.render || $e; | ||
| const a = K.render || Ue; | ||
| return { | ||
@@ -456,3 +456,3 @@ [I]: Kt, | ||
| } | ||
| function Ue(e, t) { | ||
| function $e(e, t) { | ||
| const n = new ct(""), s = new ct(""); | ||
@@ -478,3 +478,3 @@ let o; | ||
| e = e == null ? null : he(e) ? e : [e]; | ||
| const a = t || Ue(n, o), { markStart: u, markEnd: f, keyes: l } = a; | ||
| const a = t || $e(n, o), { markStart: u, markEnd: f, keyes: l } = a; | ||
| let c; | ||
@@ -493,4 +493,4 @@ const d = l && /* @__PURE__ */ new Set(); | ||
| else { | ||
| const w = m + ""; | ||
| !(p instanceof Text) || p instanceof ct ? p = new Text(w) : p.data != w && (p.data = w); | ||
| const v = m + ""; | ||
| !(p instanceof Text) || p instanceof ct ? p = new Text(v) : p.data != v && (p.data = v); | ||
| } | ||
@@ -507,7 +507,7 @@ p != i && (l && d.delete(p), !y || l ? (n.insertBefore(p, i), l && i != f && d.add(i)) : y == f ? n.insertBefore(p, f) : (n.replaceChild(p, y), i = p)), g != null && (c = c || /* @__PURE__ */ new Map(), c.set(g, p)); | ||
| for (const r in t) | ||
| !(r in n) && Tt(e, r, t[r], null, o, s); | ||
| !(r in n) && St(e, r, t[r], null, o, s); | ||
| for (const r in n) | ||
| Tt(e, r, t[r], n[r], o, s); | ||
| St(e, r, t[r], n[r], o, s); | ||
| } | ||
| function Tt(e, t, n, s, o, r) { | ||
| function St(e, t, n, s, o, r) { | ||
| if (t = t == "class" && !o ? "className" : t, n = n ?? null, s = s ?? null, t in e && Pe[t] && (n = e[t]), !(s === n || Oe[t] || t[0] == "_")) | ||
@@ -642,3 +642,3 @@ if (e.localName === "slot" && t === "assignNode" && "assign" in e) | ||
| } | ||
| const h = (e, t, n) => (t == null ? t = { key: n } : t.key = n, Zt(e, t)), T = h, ft = J`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, dt = J`.vh{position:absolute;transform:scale(0)}`; | ||
| const h = (e, t, n) => (t == null ? t = { key: n } : t.key = n, Zt(e, t)), S = h, ft = J`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, dt = J`.vh{position:absolute;transform:scale(0)}`; | ||
| function ht() { | ||
@@ -650,5 +650,5 @@ const e = /* @__PURE__ */ new Date(); | ||
| function je(e) { | ||
| const t = v(e); | ||
| t.setDate(t.getUTCDate() + 3 - (t.getUTCDay() + 6) % 7); | ||
| const n = new Date(t.getUTCFullYear(), 0, 4); | ||
| const t = E(e); | ||
| t.setUTCDate(t.getUTCDate() + 3 - (t.getUTCDay() + 6) % 7); | ||
| const n = new Date(Date.UTC(t.getUTCFullYear(), 0, 4)); | ||
| return 1 + Math.round( | ||
@@ -659,3 +659,3 @@ ((t.getTime() - n.getTime()) / _e - 3 + (n.getUTCDay() + 6) % 7) / 7 | ||
| function mt(e, t = 0) { | ||
| const n = v(e), s = n.getUTCDay(), o = (s < t ? 7 : 0) + s - t; | ||
| const n = E(e), s = n.getUTCDay(), o = (s < t ? 7 : 0) + s - t; | ||
| return n.setUTCDate(n.getUTCDate() - o), C.from(n); | ||
@@ -684,3 +684,3 @@ } | ||
| } | ||
| function v(e) { | ||
| function E(e) { | ||
| return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1)); | ||
@@ -697,3 +697,3 @@ } | ||
| add(t) { | ||
| const n = v(this); | ||
| const n = E(this); | ||
| if ("days" in t) | ||
@@ -703,3 +703,3 @@ return n.setUTCDate(this.day + t.days), C.from(n); | ||
| "months" in t ? (o = this.month + t.months, n.setUTCMonth(o - 1)) : (s = this.year + t.years, n.setUTCFullYear(s)); | ||
| const r = C.from(v({ year: s, month: o, day: 1 })); | ||
| const r = C.from(E({ year: s, month: o, day: 1 })); | ||
| return Z(C.from(n), r, te(r)); | ||
@@ -711,3 +711,3 @@ } | ||
| toPlainYearMonth() { | ||
| return new $(this.year, this.month); | ||
| return new U(this.year, this.month); | ||
| } | ||
@@ -739,3 +739,3 @@ equals(t) { | ||
| } | ||
| class $ { | ||
| class U { | ||
| constructor(t, n) { | ||
@@ -745,4 +745,4 @@ this.year = t, this.month = n; | ||
| add(t) { | ||
| const n = v(this), s = (t.months ?? 0) + (t.years ?? 0) * 12; | ||
| return n.setUTCMonth(n.getUTCMonth() + s), new $(n.getUTCFullYear(), n.getUTCMonth() + 1); | ||
| const n = E(this), s = (t.months ?? 0) + (t.years ?? 0) * 12; | ||
| return n.setUTCMonth(n.getUTCMonth() + s), new U(n.getUTCFullYear(), n.getUTCMonth() + 1); | ||
| } | ||
@@ -768,7 +768,7 @@ equals(t) { | ||
| const [t, n] = lt(e); | ||
| return [S(() => H(C, t), [t]), (r) => n(r?.toString())]; | ||
| return [w(() => H(C, t), [t]), (r) => n(r?.toString())]; | ||
| } | ||
| function He(e) { | ||
| const [t = "", n] = lt(e); | ||
| return [S(() => { | ||
| return [w(() => { | ||
| const [r, a] = t.split("/"), u = H(C, r), f = H(C, a); | ||
@@ -780,3 +780,3 @@ return u && f ? [u, f] : []; | ||
| const [t = "", n] = lt(e); | ||
| return [S(() => { | ||
| return [w(() => { | ||
| const r = []; | ||
@@ -790,4 +790,4 @@ for (const a of t.trim().split(/\s+/)) { | ||
| } | ||
| function U(e, t) { | ||
| return S( | ||
| function $(e, t) { | ||
| return w( | ||
| () => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }), | ||
@@ -798,4 +798,4 @@ [t, e] | ||
| function Pt(e, t, n) { | ||
| const s = U(e, n); | ||
| return S(() => { | ||
| const s = $(e, n); | ||
| return w(() => { | ||
| const o = [], r = /* @__PURE__ */ new Date(); | ||
@@ -821,11 +821,11 @@ for (var a = 0; a < 7; a++) { | ||
| formatWeekday: d | ||
| } = t, i = u ?? ht(), m = Pt(Ze, s, l), g = S( | ||
| } = t, i = u ?? ht(), m = Pt(Ze, s, l), g = w( | ||
| () => ({ weekday: d }), | ||
| [d] | ||
| ), b = Pt(g, s, l), y = U(Ke, l), p = U(Je, l), w = S( | ||
| ), b = Pt(g, s, l), y = $(Ke, l), p = $(Je, l), v = w( | ||
| () => f.start.add({ months: n }), | ||
| [f, n] | ||
| ), X = S( | ||
| () => qe(w, s), | ||
| [w, s] | ||
| ), X = w( | ||
| () => qe(v, s), | ||
| [v, s] | ||
| ), se = N("focusday", tt), oe = N("selectday", tt), re = N("hoverday", tt); | ||
@@ -836,27 +836,27 @@ function Dt(D) { | ||
| function ae(D) { | ||
| let E; | ||
| let T; | ||
| switch (D.key) { | ||
| case "ArrowRight": | ||
| E = c.add({ days: Ot(D) ? 1 : -1 }); | ||
| T = c.add({ days: Ot(D) ? 1 : -1 }); | ||
| break; | ||
| case "ArrowLeft": | ||
| E = c.add({ days: Ot(D) ? -1 : 1 }); | ||
| T = c.add({ days: Ot(D) ? -1 : 1 }); | ||
| break; | ||
| case "ArrowDown": | ||
| E = c.add({ days: 7 }); | ||
| T = c.add({ days: 7 }); | ||
| break; | ||
| case "ArrowUp": | ||
| E = c.add({ days: -7 }); | ||
| T = c.add({ days: -7 }); | ||
| break; | ||
| case "PageUp": | ||
| E = c.add(D.shiftKey ? { years: -1 } : { months: -1 }); | ||
| T = c.add(D.shiftKey ? { years: -1 } : { months: -1 }); | ||
| break; | ||
| case "PageDown": | ||
| E = c.add(D.shiftKey ? { years: 1 } : { months: 1 }); | ||
| T = c.add(D.shiftKey ? { years: 1 } : { months: 1 }); | ||
| break; | ||
| case "Home": | ||
| E = mt(c, s); | ||
| T = mt(c, s); | ||
| break; | ||
| case "End": | ||
| E = Vt(c, s); | ||
| T = Vt(c, s); | ||
| break; | ||
@@ -866,21 +866,21 @@ default: | ||
| } | ||
| Dt(E), D.preventDefault(); | ||
| Dt(T), D.preventDefault(); | ||
| } | ||
| function ce(D) { | ||
| const E = w.equals(D); | ||
| if (!t.showOutsideDays && !E) | ||
| const T = v.equals(D); | ||
| if (!t.showOutsideDays && !T) | ||
| return; | ||
| const ie = D.equals(c), Ct = D.equals(i), j = v(D), B = o?.(j), Et = !kt(D, r, a); | ||
| let vt = "", O; | ||
| const ie = D.equals(c), Ct = D.equals(i), j = E(D), B = o?.(j), Tt = !kt(D, r, a); | ||
| let Et = "", O; | ||
| if (t.type === "range") { | ||
| const [Y, G] = t.value, wt = Y?.equals(D), St = G?.equals(D); | ||
| O = Y && G && kt(D, Y, G), vt = `${wt ? "range-start" : ""} ${St ? "range-end" : ""} ${O && !wt && !St ? "range-inner" : ""}`; | ||
| const [Y, G] = t.value, vt = Y?.equals(D), wt = G?.equals(D); | ||
| O = Y && G && kt(D, Y, G), Et = `${vt ? "range-start" : ""} ${wt ? "range-end" : ""} ${O && !vt && !wt ? "range-inner" : ""}`; | ||
| } else t.type === "multi" ? O = t.value.some((Y) => Y.equals(D)) : O = t.value?.equals(D); | ||
| return { | ||
| part: `${`button day day-${j.getDay()} ${// we don't want outside days to ever be shown as selected | ||
| E ? O ? "selected" : "" : "outside"} ${B ? "disallowed" : ""} ${Ct ? "today" : ""} ${t.getDayParts?.(j) ?? ""}`} ${vt}`, | ||
| tabindex: E && ie ? 0 : -1, | ||
| disabled: Et, | ||
| part: `${`button day day-${j.getUTCDay()} ${// we don't want outside days to ever be shown as selected | ||
| T ? O ? "selected" : "" : "outside"} ${B ? "disallowed" : ""} ${Ct ? "today" : ""} ${t.getDayParts?.(j) ?? ""}`} ${Et}`, | ||
| tabindex: T && ie ? 0 : -1, | ||
| disabled: Tt, | ||
| "aria-disabled": B ? "true" : void 0, | ||
| "aria-pressed": E && O, | ||
| "aria-pressed": T && O, | ||
| "aria-current": Ct ? "date" : void 0, | ||
@@ -893,3 +893,3 @@ "aria-label": y.format(j), | ||
| onmouseover() { | ||
| !B && !Et && re(D); | ||
| !B && !Tt && re(D); | ||
| } | ||
@@ -900,3 +900,3 @@ }; | ||
| weeks: X, | ||
| yearMonth: w, | ||
| yearMonth: v, | ||
| daysLong: m, | ||
@@ -921,6 +921,6 @@ daysVisible: b, | ||
| } | ||
| return /* @__PURE__ */ T("host", { shadowDom: !0, focus: o, children: [ | ||
| /* @__PURE__ */ h("div", { id: "h", part: "heading", children: s.formatter.format(v(s.yearMonth)) }), | ||
| /* @__PURE__ */ T("table", { ref: n, "aria-labelledby": "h", part: "table", children: [ | ||
| /* @__PURE__ */ T("colgroup", { children: [ | ||
| return /* @__PURE__ */ S("host", { shadowDom: !0, focus: o, children: [ | ||
| /* @__PURE__ */ h("div", { id: "h", part: "heading", children: s.formatter.format(E(s.yearMonth)) }), | ||
| /* @__PURE__ */ S("table", { ref: n, "aria-labelledby": "h", part: "table", children: [ | ||
| /* @__PURE__ */ S("colgroup", { children: [ | ||
| t.showWeekNumbers && /* @__PURE__ */ h("col", { part: "col-weeknumber" }), | ||
@@ -935,8 +935,8 @@ /* @__PURE__ */ h("col", { part: "col-1" }), | ||
| ] }), | ||
| /* @__PURE__ */ h("thead", { children: /* @__PURE__ */ T("tr", { part: "tr head", children: [ | ||
| t.showWeekNumbers && /* @__PURE__ */ h("th", { part: "th weeknumber", children: /* @__PURE__ */ T("slot", { name: "weeknumber", children: [ | ||
| /* @__PURE__ */ h("thead", { children: /* @__PURE__ */ S("tr", { part: "tr head", children: [ | ||
| t.showWeekNumbers && /* @__PURE__ */ h("th", { part: "th weeknumber", children: /* @__PURE__ */ S("slot", { name: "weeknumber", children: [ | ||
| /* @__PURE__ */ h("span", { class: "vh", children: "Week" }), | ||
| /* @__PURE__ */ h("span", { "aria-hidden": "true", children: "#" }) | ||
| ] }) }), | ||
| s.daysLong.map((r, a) => /* @__PURE__ */ T( | ||
| s.daysLong.map((r, a) => /* @__PURE__ */ S( | ||
| "th", | ||
@@ -953,3 +953,3 @@ { | ||
| ] }) }), | ||
| /* @__PURE__ */ h("tbody", { children: s.weeks.map((r, a) => /* @__PURE__ */ T("tr", { part: "tr week", children: [ | ||
| /* @__PURE__ */ h("tbody", { children: s.weeks.map((r, a) => /* @__PURE__ */ S("tr", { part: "tr week", children: [ | ||
| t.showWeekNumbers && /* @__PURE__ */ h("th", { class: "num", part: "th weeknumber", scope: "row", children: je(r[0]) }), | ||
@@ -991,3 +991,3 @@ r.map((u, f) => { | ||
| function yt(e) { | ||
| const t = v(e.page.start), n = v(e.page.end); | ||
| const t = E(e.page.start), n = E(e.page.end); | ||
| return /* @__PURE__ */ h( | ||
@@ -1000,5 +1000,5 @@ _, | ||
| onhoverday: e.onHover, | ||
| children: /* @__PURE__ */ T("div", { role: "group", "aria-labelledby": "h", part: "container", children: [ | ||
| children: /* @__PURE__ */ S("div", { role: "group", "aria-labelledby": "h", part: "container", children: [ | ||
| /* @__PURE__ */ h("div", { id: "h", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, n) }), | ||
| /* @__PURE__ */ T("div", { part: "header", children: [ | ||
| /* @__PURE__ */ S("div", { part: "header", children: [ | ||
| /* @__PURE__ */ h(At, { name: "previous", onclick: e.previous, children: "Previous" }), | ||
@@ -1080,3 +1080,3 @@ /* @__PURE__ */ h("slot", { part: "heading", name: "heading", children: /* @__PURE__ */ h("div", { "aria-hidden": "true", children: e.format.formatRange(t, n) }) }), | ||
| } | ||
| const $t = (e, t) => (e = t === 12 ? new $(e.year, 1) : e, { | ||
| const Ut = (e, t) => (e = t === 12 ? new U(e.year, 1) : e, { | ||
| start: e, | ||
@@ -1094,4 +1094,4 @@ end: e.add({ months: t - 1 }) | ||
| const a = e === "single" ? 1 : n, [u, f] = it( | ||
| () => $t(t.toPlainYearMonth(), n) | ||
| ), l = (d) => f($t(u.start.add({ months: d }), n)), c = (d) => { | ||
| () => Ut(t.toPlainYearMonth(), n) | ||
| ), l = (d) => f(Ut(u.start.add({ months: d }), n)), c = (d) => { | ||
| const i = nt(u.start, d.toPlainYearMonth()); | ||
@@ -1123,3 +1123,3 @@ return i >= 0 && i < n; | ||
| }) { | ||
| const [r] = P("min"), [a] = P("max"), [u] = P("today"), f = N("focusday"), l = N("change"), c = S( | ||
| const [r] = P("min"), [a] = P("max"), [u] = P("today"), f = N("focusday"), l = N("change"), c = w( | ||
| () => Z(s ?? u ?? ht(), r, a), | ||
@@ -1129,3 +1129,3 @@ [s, u, r, a] | ||
| function d(p) { | ||
| o(p), f(v(p)); | ||
| o(p), f(E(p)); | ||
| } | ||
@@ -1141,8 +1141,8 @@ const { next: i, previous: m, page: g } = en({ | ||
| function y(p) { | ||
| const w = p?.target ?? "day"; | ||
| w === "day" ? b.current.querySelectorAll("calendar-month").forEach((X) => X.focus(p)) : b.current.shadowRoot.querySelector(`[part~='${w}']`).focus(p); | ||
| const v = p?.target ?? "day"; | ||
| v === "day" ? b.current.querySelectorAll("calendar-month").forEach((X) => X.focus(p)) : b.current.shadowRoot.querySelector(`[part~='${v}']`).focus(p); | ||
| } | ||
| return { | ||
| format: U(Ve, n), | ||
| formatVerbose: U(tn, n), | ||
| format: $(Ve, n), | ||
| formatVerbose: $(tn, n), | ||
| page: g, | ||
@@ -1187,3 +1187,3 @@ focusedDate: c, | ||
| function ee(e) { | ||
| return /* @__PURE__ */ T(Jt, { children: [ | ||
| return /* @__PURE__ */ S(Jt, { children: [ | ||
| /* @__PURE__ */ h("label", { part: "label", for: "s", children: /* @__PURE__ */ h("slot", { name: "label", children: e.label }) }), | ||
@@ -1226,6 +1226,6 @@ /* @__PURE__ */ h("select", { id: "s", part: "select", onchange: e.onChange, children: e.options.map((t) => /* @__PURE__ */ h("option", { part: "option", ...t })) }) | ||
| function an(e) { | ||
| const { min: t, max: n, focusedDate: s, locale: o } = ut(_), r = N("focusday", { bubbles: !0 }), a = S( | ||
| const { min: t, max: n, focusedDate: s, locale: o } = ut(_), r = N("focusday", { bubbles: !0 }), a = w( | ||
| () => ({ month: e.formatMonth }), | ||
| [e.formatMonth] | ||
| ), u = U(a, o), f = S(() => { | ||
| ), u = $(a, o), f = w(() => { | ||
| const i = [], m = /* @__PURE__ */ new Date(); | ||
@@ -1239,3 +1239,3 @@ m.setUTCDate(1); | ||
| }, [u]), l = s.toPlainYearMonth(), c = f.map((i, m) => { | ||
| const g = m + 1, b = l.add({ months: g - l.month }), y = t != null && $.compare(b, t) < 0 || n != null && $.compare(b, n) > 0; | ||
| const g = m + 1, b = l.add({ months: g - l.month }), y = t != null && U.compare(b, t) < 0 || n != null && U.compare(b, n) > 0; | ||
| return { | ||
@@ -1270,3 +1270,3 @@ label: i, | ||
| customElements.define("calendar-select-month", cn); | ||
| const Ut = (e, t) => C.compare(e, t) < 0 ? [e, t] : [t, e], ln = k( | ||
| const $t = (e, t) => C.compare(e, t) < 0 ? [e, t] : [t, e], ln = k( | ||
| (e) => { | ||
@@ -1289,5 +1289,5 @@ const [t, n] = He("value"), [s = t[0], o] = P("focusedDate"), r = bt({ | ||
| const p = y.detail; | ||
| y.stopPropagation(), f ? (n(Ut(f, p)), l(void 0), u(v(p)), r.dispatch()) : (l(p), a(v(p))); | ||
| y.stopPropagation(), f ? (n($t(f, p)), l(void 0), u(E(p)), r.dispatch()) : (l(p), a(E(p))); | ||
| } | ||
| const b = f ? Ut(f, c ?? f) : t; | ||
| const b = f ? $t(f, c ?? f) : t; | ||
| return /* @__PURE__ */ h("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ h( | ||
@@ -1294,0 +1294,0 @@ yt, |
+1
-1
| { | ||
| "name": "cally", | ||
| "version": "0.9.1", | ||
| "version": "0.9.2", | ||
| "description": "small, feature-rich calendar components", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
48121
0.03%