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