@cocoar/vue-calendar 2.18.0 → 2.19.0-beta.7

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.
Files changed (56) hide show
  1. package/README.md +66 -10
  2. package/dist/builders/calendar-builder.d.ts +23 -1
  3. package/dist/builders/calendar-builder.d.ts.map +1 -1
  4. package/dist/components/CoarAgendaView.vue.d.ts +2 -0
  5. package/dist/components/CoarAgendaView.vue.d.ts.map +1 -1
  6. package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
  7. package/dist/components/CoarContinuousMonthView.vue.d.ts +39 -0
  8. package/dist/components/CoarContinuousMonthView.vue.d.ts.map +1 -0
  9. package/dist/components/CoarDayView.vue.d.ts.map +1 -1
  10. package/dist/components/CoarMonthListView.vue.d.ts +28 -0
  11. package/dist/components/CoarMonthListView.vue.d.ts.map +1 -0
  12. package/dist/components/CoarMonthView.vue.d.ts +7 -1
  13. package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
  14. package/dist/components/CoarTimeGrid.vue.d.ts +4 -0
  15. package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
  16. package/dist/components/CoarYearView.vue.d.ts +17 -0
  17. package/dist/components/CoarYearView.vue.d.ts.map +1 -0
  18. package/dist/components/internal/CoarEventAssignees.vue.d.ts +19 -0
  19. package/dist/components/internal/CoarEventAssignees.vue.d.ts.map +1 -0
  20. package/dist/components/internal/agenda/CoarAgendaEvent.vue.d.ts.map +1 -1
  21. package/dist/components/internal/month/CoarMonthBar.vue.d.ts.map +1 -1
  22. package/dist/components/internal/month/CoarMonthCell.vue.d.ts +3 -0
  23. package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
  24. package/dist/components/internal/month/CoarMonthPill.vue.d.ts.map +1 -1
  25. package/dist/components/internal/month/CoarMonthRow.vue.d.ts.map +1 -1
  26. package/dist/components/internal/time-grid/CoarTimeGridAllDayBar.vue.d.ts.map +1 -1
  27. package/dist/components/internal/time-grid/CoarTimeGridEvent.vue.d.ts.map +1 -1
  28. package/dist/composables/useCalendarDnd.d.ts.map +1 -1
  29. package/dist/composables/useMonthExpansion.d.ts +5 -3
  30. package/dist/composables/useMonthExpansion.d.ts.map +1 -1
  31. package/dist/composables/useViewWindow.d.ts +5 -1
  32. package/dist/composables/useViewWindow.d.ts.map +1 -1
  33. package/dist/core/cascadeLayout.d.ts +21 -0
  34. package/dist/core/cascadeLayout.d.ts.map +1 -0
  35. package/dist/core/dayColumns.d.ts +3 -0
  36. package/dist/core/dayColumns.d.ts.map +1 -0
  37. package/dist/core/dnd/move-math.d.ts.map +1 -1
  38. package/dist/core/eventTextContrast.d.ts +3 -0
  39. package/dist/core/eventTextContrast.d.ts.map +1 -0
  40. package/dist/core/index.d.ts +5 -2
  41. package/dist/core/index.d.ts.map +1 -1
  42. package/dist/core/monthGridLayout.d.ts +5 -2
  43. package/dist/core/monthGridLayout.d.ts.map +1 -1
  44. package/dist/core/types.d.ts +12 -9
  45. package/dist/core/types.d.ts.map +1 -1
  46. package/dist/core/viewWindow.d.ts +8 -1
  47. package/dist/core/viewWindow.d.ts.map +1 -1
  48. package/dist/{core-D8QAB2K3.js → core-CiKX2hZM.js} +214 -107
  49. package/dist/core.js +3 -3
  50. package/dist/index.d.ts +4 -1
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +2095 -1348
  53. package/dist/{move-math-vYSpEW-r.js → move-math-BFP9Tfuo.js} +9 -1
  54. package/dist/recurrence.js +1 -1
  55. package/dist/vue-calendar.css +1 -1
  56. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- import { o as e, s as t } from "./move-math-vYSpEW-r.js";
1
+ import { o as e, s as t } from "./move-math-BFP9Tfuo.js";
2
2
  import { Temporal as n, Temporal as r } from "@js-temporal/polyfill";
3
3
  //#region src/core/temporal.ts
4
4
  function i(e) {
@@ -118,22 +118,26 @@ function E(e) {
118
118
  }
119
119
  //#endregion
120
120
  //#region src/core/viewWindow.ts
121
- var D = [
121
+ var ee = [
122
122
  1,
123
123
  2,
124
124
  3,
125
125
  4,
126
126
  5
127
127
  ];
128
- function O(e) {
128
+ function D(e) {
129
129
  let { view: t, cursor: r, firstDayOfWeek: i, timezone: a } = e;
130
130
  switch (t) {
131
- case "day": return {
132
- view: t,
133
- start: r.toString(),
134
- end: r.add({ days: 1 }).toString(),
135
- timezone: a
136
- };
131
+ case "day": {
132
+ let n = Math.max(1, e.dayColumnCount ?? 1);
133
+ return {
134
+ view: t,
135
+ start: r.toString(),
136
+ end: r.add({ days: n }).toString(),
137
+ timezone: a
138
+ };
139
+ }
140
+ case "dayAgenda":
137
141
  case "week": {
138
142
  let e = d(r, i);
139
143
  return {
@@ -153,6 +157,18 @@ function O(e) {
153
157
  };
154
158
  }
155
159
  case "month": {
160
+ let o = Math.max(0, Math.floor(e.monthBuffer ?? 0)), s = n.PlainYearMonth.from({
161
+ year: r.year,
162
+ month: r.month
163
+ }), c = v(s.subtract({ months: o }), i), l = v(s.add({ months: o }), i);
164
+ return {
165
+ view: t,
166
+ start: c[0].toString(),
167
+ end: l[41].add({ days: 1 }).toString(),
168
+ timezone: a
169
+ };
170
+ }
171
+ case "monthList": {
156
172
  let e = v(n.PlainYearMonth.from({
157
173
  year: r.year,
158
174
  month: r.month
@@ -182,43 +198,123 @@ function O(e) {
182
198
  timezone: a
183
199
  };
184
200
  }
185
- case "year": return {
186
- view: t,
187
- start: r.toString(),
188
- end: r.add({ days: 1 }).toString(),
189
- timezone: a
190
- };
201
+ case "year": {
202
+ let e = n.PlainDate.from({
203
+ year: r.year,
204
+ month: 1,
205
+ day: 1
206
+ });
207
+ return {
208
+ view: t,
209
+ start: e.toString(),
210
+ end: e.add({ years: 1 }).toString(),
211
+ timezone: a
212
+ };
213
+ }
191
214
  default: throw Error(`Unsupported view: ${String(t)}`);
192
215
  }
193
216
  }
194
- function* k(e) {
217
+ function* O(e) {
195
218
  let t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end);
196
219
  for (; n.PlainDate.compare(t, r) < 0;) yield t, t = t.add({ days: 1 });
197
220
  }
198
- function A(e) {
221
+ function k(e) {
199
222
  let t = n.PlainDate.from(e.start);
200
223
  return n.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
201
224
  }
202
- function j(e, t) {
225
+ function A(e, t) {
203
226
  let r = n.PlainDate.from(e.start), i = n.PlainDate.from(e.end);
204
227
  return n.PlainDate.compare(t, r) >= 0 && n.PlainDate.compare(t, i) < 0;
205
228
  }
206
- function M(e, t, n, r = 30, i = 60) {
207
- let a = n === "next" ? 1 : -1;
229
+ function j(e, t, n, r = 30, i = 60, a = 1) {
230
+ let o = n === "next" ? 1 : -1;
208
231
  switch (e) {
209
- case "day": return t.add({ days: 1 * a });
232
+ case "day": return t.add({ days: Math.max(1, a) * o });
233
+ case "dayAgenda":
210
234
  case "week":
211
- case "workWeek": return t.add({ days: 7 * a });
212
- case "month": return t.add({ months: 1 * a });
213
- case "agenda": return t.add({ days: r * a });
214
- case "timeline": return t.add({ days: i * a });
215
- case "year": return t.add({ months: 1 * a });
235
+ case "workWeek": return t.add({ days: 7 * o });
236
+ case "month":
237
+ case "monthList": return t.add({ months: 1 * o });
238
+ case "agenda": return t.add({ days: r * o });
239
+ case "timeline": return t.add({ days: i * o });
240
+ case "year": return t.add({ years: 1 * o });
216
241
  default: throw Error(`Unsupported view: ${String(e)}`);
217
242
  }
218
243
  }
219
244
  //#endregion
245
+ //#region src/core/dayColumns.ts
246
+ function M(e, t = 1, n = 220, r = 64, i = 7) {
247
+ let a = Math.max(1, Math.round(t));
248
+ if (!Number.isFinite(e) || e <= 0) return a;
249
+ let o = Math.max(120, Number.isFinite(n) ? n : 220), s = Math.floor(Math.max(0, e - Math.max(0, r)) / o);
250
+ return Math.min(Math.max(a, i), Math.max(a, s));
251
+ }
252
+ //#endregion
253
+ //#region src/core/cascadeLayout.ts
254
+ function N(e, t = 100, n = 1.5, r = 18) {
255
+ let i = /* @__PURE__ */ new Map();
256
+ if (!Number.isFinite(t) || t <= 0 || e.length === 0) return i;
257
+ let a = Number.isFinite(n) ? Math.min(t / 2, Math.max(0, n)) : 0, o = Math.max(0, t - 2 * a), s = Number.isFinite(r) ? Math.max(0, r) : 0, c = e.map((e, t) => ({
258
+ item: e,
259
+ index: t
260
+ })).sort((e, t) => e.item.startMinutes - t.item.startMinutes || t.item.endMinutes - e.item.endMinutes || e.index - t.index).map(({ item: e }) => e), l = [], u = [], d = -Infinity;
261
+ for (let e of c) e.startMinutes >= d ? (u.length && l.push(u), u = [e], d = e.endMinutes) : (u.push(e), d = Math.max(d, e.endMinutes));
262
+ u.length && l.push(u);
263
+ for (let e of l) {
264
+ let t = Math.max(...e.map((e) => e.laneCount), 1), n = o / t, r = (r) => {
265
+ let i = Array.from({ length: Math.max(0, t - 1) }, () => Math.min(s, n));
266
+ for (let n of e.filter((e) => e.lane < t - 1)) {
267
+ if (n.lane < 0) return null;
268
+ let t = Math.min(n.endMinutes, n.textEndMinutes);
269
+ if (!e.some((e) => e.lane > n.lane && e.startMinutes < t && e.endMinutes > n.startMinutes)) continue;
270
+ let a = r ? n.compactPreferredVisibleWidth ?? n.preferredVisibleWidth : n.preferredVisibleWidth;
271
+ if (!Number.isFinite(a)) return null;
272
+ i[n.lane] = Math.max(i[n.lane], Math.max(0, a));
273
+ }
274
+ let a = o - i.reduce((e, t) => e + t, 0);
275
+ return a >= n && !i.some((e) => e > a) ? i : null;
276
+ }, c = r(!1) ?? r(!0), l = c === null, u = c ?? Array.from({ length: Math.max(0, t - 1) }, () => n), d = l ? n : o - u.reduce((e, t) => e + t, 0), f = Array.from({ length: t }, () => a);
277
+ for (let e = 1; e < t; e += 1) f[e] = f[e - 1] + u[e - 1];
278
+ for (let n of e.filter((e) => e.lane >= 0 && e.lane < t)) {
279
+ let r = d;
280
+ if (!l) {
281
+ let i = Math.min(n.endMinutes, n.textEndMinutes), a = e.filter((e) => e.lane > n.lane && e.lane < t && e.startMinutes < i && e.endMinutes > n.startMinutes).map((e) => f[e.lane]);
282
+ a.length && (r = Math.max(0, Math.min(d, Math.min(...a) - f[n.lane])));
283
+ }
284
+ i.set(n.id, {
285
+ x: f[n.lane],
286
+ width: d,
287
+ visibleContentWidth: r
288
+ });
289
+ }
290
+ }
291
+ return i;
292
+ }
293
+ //#endregion
294
+ //#region src/core/eventTextContrast.ts
295
+ function P(e, t = "var(--coar-text-base, #1a1c1f)") {
296
+ let n = F(e);
297
+ if (!n) return t;
298
+ let r = .2126 * I(n[0]) + .7152 * I(n[1]) + .0722 * I(n[2]);
299
+ return 1.05 / (r + .05) >= (r + .05) / .05 ? "#ffffff" : "#000000";
300
+ }
301
+ function F(e) {
302
+ let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
303
+ if (!t) return null;
304
+ let n = t[1].length === 3 ? [...t[1]].map((e) => e + e).join("") : t[1];
305
+ return [
306
+ 0,
307
+ 2,
308
+ 4
309
+ ].map((e) => Number.parseInt(n.slice(e, e + 2), 16));
310
+ }
311
+ function I(e) {
312
+ let t = e / 255;
313
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
314
+ }
315
+ //#endregion
220
316
  //#region src/core/overlapLayout.ts
221
- function N(e, t) {
317
+ function L(e, t) {
222
318
  e.push(t);
223
319
  let n = e.length - 1;
224
320
  for (; n > 0;) {
@@ -227,7 +323,7 @@ function N(e, t) {
227
323
  [e[t], e[n]] = [e[n], e[t]], n = t;
228
324
  }
229
325
  }
230
- function P(e) {
326
+ function R(e) {
231
327
  let t = e[0], n = e.pop();
232
328
  if (e.length > 0) {
233
329
  e[0] = n;
@@ -240,7 +336,7 @@ function P(e) {
240
336
  }
241
337
  return t;
242
338
  }
243
- function F(e, t, n, r) {
339
+ function z(e, t, n, r) {
244
340
  e.push(n), t.push(r);
245
341
  let i = e.length - 1;
246
342
  for (; i > 0;) {
@@ -249,10 +345,10 @@ function F(e, t, n, r) {
249
345
  [e[n], e[i]] = [e[i], e[n]], [t[n], t[i]] = [t[i], t[n]], i = n;
250
346
  }
251
347
  }
252
- function I(e) {
348
+ function B(e) {
253
349
  return e.length > 0 ? e[0] : Infinity;
254
350
  }
255
- function L(e, t) {
351
+ function V(e, t) {
256
352
  let n = {
257
353
  end: e[0],
258
354
  lane: t[0]
@@ -268,7 +364,7 @@ function L(e, t) {
268
364
  }
269
365
  return n;
270
366
  }
271
- function R(e) {
367
+ function H(e) {
272
368
  let t = e.length;
273
369
  if (t === 0) return {
274
370
  bars: [],
@@ -284,12 +380,12 @@ function R(e) {
284
380
  let r = [], i = [], a = [], o = 0, s = Array(t);
285
381
  for (let e = 0; e < t; e++) {
286
382
  let t = n[e];
287
- for (; I(r) < t.start;) {
288
- let { lane: e } = L(r, i);
289
- N(a, e);
383
+ for (; B(r) < t.start;) {
384
+ let { lane: e } = V(r, i);
385
+ L(a, e);
290
386
  }
291
387
  let c;
292
- c = a.length > 0 ? P(a) : o++, F(r, i, t.end, c), s[e] = {
388
+ c = a.length > 0 ? R(a) : o++, z(r, i, t.end, c), s[e] = {
293
389
  id: t.id,
294
390
  lane: c,
295
391
  start: t.start,
@@ -303,14 +399,14 @@ function R(e) {
303
399
  }
304
400
  //#endregion
305
401
  //#region src/core/timeGridLayout.ts
306
- function z(e, n) {
402
+ function te(e, n) {
307
403
  let { day: r, timeRange: i, timezone: a } = n, [o, s] = i, c = o * 60, l = s * 60;
308
404
  if (l - c <= 0) return [];
309
405
  let u = [], d = /* @__PURE__ */ new Set();
310
406
  for (let n of e) {
311
407
  if (d.has(n.id) || (d.add(n.id), !t(n))) continue;
312
- let e = V(n.start, r, a), i;
313
- if (n.end) i = V(n.end, r, a);
408
+ let e = W(n.start, r, a), i;
409
+ if (n.end) i = W(n.end, r, a);
314
410
  else {
315
411
  if (e < 0) continue;
316
412
  i = e + 30;
@@ -333,7 +429,7 @@ function z(e, n) {
333
429
  m.length > 0 && p.push(m);
334
430
  let g = /* @__PURE__ */ new Map();
335
431
  for (let e of p) {
336
- let t = R(e.map((e) => ({
432
+ let t = H(e.map((e) => ({
337
433
  id: e.event.id,
338
434
  start: e.startMinutes,
339
435
  end: Math.max(e.startMinutes, e.endMinutes - 1)
@@ -369,7 +465,7 @@ function z(e, n) {
369
465
  };
370
466
  });
371
467
  }
372
- function B(t, n) {
468
+ function U(t, n) {
373
469
  let { days: i } = n;
374
470
  if (n.timezone, i.length === 0) return [];
375
471
  let a = /* @__PURE__ */ new Map();
@@ -392,7 +488,7 @@ function B(t, n) {
392
488
  });
393
489
  }
394
490
  if (o.length === 0) return [];
395
- let c = R(o.map((e) => ({
491
+ let c = H(o.map((e) => ({
396
492
  id: e.event.id,
397
493
  start: e.startCol,
398
494
  end: e.endCol
@@ -408,7 +504,7 @@ function B(t, n) {
408
504
  clippedEnd: e.clippedEnd
409
505
  }));
410
506
  }
411
- function V(e, t, n) {
507
+ function W(e, t, n) {
412
508
  let i = e.withTimeZone(n), a = r.PlainDateTime.from({
413
509
  year: t.year,
414
510
  month: t.month,
@@ -420,11 +516,11 @@ function V(e, t, n) {
420
516
  }
421
517
  //#endregion
422
518
  //#region src/core/monthGridLayout.ts
423
- function H(e, t) {
519
+ function G(e, t) {
424
520
  let { gridDates: n, timezone: i } = t;
425
- if (n.length !== 42) throw RangeError(`gridDates must have exactly 42 entries (got ${n.length})`);
521
+ if (n.length < 7 || n.length % 7 != 0) throw RangeError(`gridDates must contain complete seven-day rows (got ${n.length})`);
426
522
  let a = [];
427
- for (let e = 0; e < 6; e++) {
523
+ for (let e = 0; e < n.length / 7; e++) {
428
524
  let t = n.slice(e * 7, e * 7 + 7), r = /* @__PURE__ */ new Map();
429
525
  for (let e = 0; e < 7; e++) r.set(b(t[e]), e);
430
526
  a.push({
@@ -436,69 +532,80 @@ function H(e, t) {
436
532
  });
437
533
  }
438
534
  let o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map();
439
- for (let t of e) {
440
- if (o.has(t.id)) continue;
441
- o.add(t.id);
442
- let { firstDay: e, lastDayInclusive: n, isMultiDay: r } = U(t, i);
443
- if (r) s.push({
444
- event: t,
535
+ for (let n of e) {
536
+ if (o.has(n.id)) continue;
537
+ o.add(n.id);
538
+ let { firstDay: e, lastDayInclusive: a, isMultiDay: l } = K(n, i), u = (e) => (!t.visibleStart || r.PlainDate.compare(e, t.visibleStart) >= 0) && (!t.visibleEnd || r.PlainDate.compare(e, t.visibleEnd) <= 0);
539
+ if (l) s.push({
540
+ event: n,
445
541
  firstDay: e,
446
- lastDayInclusive: n
542
+ lastDayInclusive: a
447
543
  });
448
- else {
449
- let n = b(e), r = c.get(n), i = {
450
- event: t,
544
+ else if (u(e)) {
545
+ let t = b(e), r = c.get(t), i = {
546
+ event: n,
451
547
  order: r ? r.length : 0
452
548
  };
453
- r ? r.push(i) : c.set(n, [i]);
549
+ r ? r.push(i) : c.set(t, [i]);
454
550
  }
455
551
  }
456
552
  return { weekRows: a.map((e) => {
457
- let t = [];
458
- for (let n of s) {
459
- if (r.PlainDate.compare(n.lastDayInclusive, e.weekStart) < 0 || r.PlainDate.compare(n.firstDay, e.weekEnd) > 0) continue;
460
- let i = r.PlainDate.compare(n.firstDay, e.weekStart) < 0 ? e.weekStart : n.firstDay, a = r.PlainDate.compare(n.lastDayInclusive, e.weekEnd) > 0 ? e.weekEnd : n.lastDayInclusive, o = e.dayKeyToCol.get(b(i)), s = e.dayKeyToCol.get(b(a));
461
- o === void 0 || s === void 0 || t.push({
462
- ...n,
463
- startCol: o,
464
- endCol: s,
465
- clippedStart: r.PlainDate.compare(n.firstDay, e.weekStart) < 0,
466
- clippedEnd: r.PlainDate.compare(n.lastDayInclusive, e.weekEnd) > 0
553
+ let n = [];
554
+ for (let i of s) {
555
+ if (r.PlainDate.compare(i.lastDayInclusive, e.weekStart) < 0 || r.PlainDate.compare(i.firstDay, e.weekEnd) > 0) continue;
556
+ let a = [
557
+ i.firstDay,
558
+ e.weekStart,
559
+ t.visibleStart
560
+ ].filter((e) => e !== void 0).reduce((e, t) => r.PlainDate.compare(t, e) > 0 ? t : e), o = [
561
+ i.lastDayInclusive,
562
+ e.weekEnd,
563
+ t.visibleEnd
564
+ ].filter((e) => e !== void 0).reduce((e, t) => r.PlainDate.compare(t, e) < 0 ? t : e);
565
+ if (r.PlainDate.compare(a, o) > 0) continue;
566
+ let s = e.dayKeyToCol.get(b(a)), c = e.dayKeyToCol.get(b(o));
567
+ s === void 0 || c === void 0 || n.push({
568
+ ...i,
569
+ startCol: s,
570
+ endCol: c,
571
+ clippedStart: r.PlainDate.compare(i.firstDay, e.weekStart) < 0,
572
+ clippedEnd: r.PlainDate.compare(i.lastDayInclusive, e.weekEnd) > 0
467
573
  });
468
574
  }
469
- let n = [];
470
- if (t.length > 0) {
471
- let e = R(t.map((e) => ({
575
+ let i = [];
576
+ if (n.length > 0) {
577
+ let e = H(n.map((e) => ({
472
578
  id: e.event.id,
473
579
  start: e.startCol,
474
580
  end: e.endCol
475
- }))), r = /* @__PURE__ */ new Map();
476
- for (let t of e.bars) r.set(t.id, t.lane);
477
- n = t.map((t) => ({
478
- event: t.event,
479
- lane: r.get(t.event.id) ?? 0,
581
+ }))), t = /* @__PURE__ */ new Map();
582
+ for (let n of e.bars) t.set(n.id, n.lane);
583
+ i = n.map((n) => ({
584
+ event: n.event,
585
+ lane: t.get(n.event.id) ?? 0,
480
586
  laneCount: e.laneCount,
481
- startCol: t.startCol,
482
- endCol: t.endCol,
483
- clippedStart: t.clippedStart,
484
- clippedEnd: t.clippedEnd
587
+ startCol: n.startCol,
588
+ endCol: n.endCol,
589
+ clippedStart: n.clippedStart,
590
+ clippedEnd: n.clippedEnd
485
591
  }));
486
592
  }
487
- let i = /* @__PURE__ */ new Map();
488
- for (let t of e.days) {
489
- let e = b(t), n = c.get(e);
490
- n && i.set(e, n);
593
+ let a = /* @__PURE__ */ new Map();
594
+ for (let n of e.days) {
595
+ if (t.visibleStart && r.PlainDate.compare(n, t.visibleStart) < 0 || t.visibleEnd && r.PlainDate.compare(n, t.visibleEnd) > 0) continue;
596
+ let e = b(n), i = c.get(e);
597
+ i && a.set(e, i);
491
598
  }
492
599
  return {
493
600
  rowIndex: e.rowIndex,
494
601
  weekStart: e.weekStart,
495
602
  days: e.days,
496
- multiDayBars: n,
497
- cellPills: i
603
+ multiDayBars: i,
604
+ cellPills: a
498
605
  };
499
606
  }) };
500
607
  }
501
- function U(t, n) {
608
+ function K(t, n) {
502
609
  if (e(t)) {
503
610
  let e = t.start, n;
504
611
  return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
@@ -516,7 +623,7 @@ function U(t, n) {
516
623
  }
517
624
  //#endregion
518
625
  //#region src/core/agendaLayout.ts
519
- function W(t, n) {
626
+ function q(t, n) {
520
627
  let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c = r.PlainDate.from(i), l = r.PlainDate.from(a);
521
628
  if (r.PlainDate.compare(l, c) <= 0) return [];
522
629
  let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
@@ -530,7 +637,7 @@ function W(t, n) {
530
637
  for (let n of t) {
531
638
  if (d.has(n.id)) continue;
532
639
  d.add(n.id);
533
- let t = e(n), { firstDay: i, lastDayInclusive: a } = G(n, o), s = r.PlainDate.compare(i, c) < 0 ? c : i, u = l.subtract({ days: 1 }), p = r.PlainDate.compare(a, u) > 0 ? u : a;
640
+ let t = e(n), { firstDay: i, lastDayInclusive: a } = J(n, o), s = r.PlainDate.compare(i, c) < 0 ? c : i, u = l.subtract({ days: 1 }), p = r.PlainDate.compare(a, u) > 0 ? u : a;
534
641
  if (r.PlainDate.compare(p, s) < 0) continue;
535
642
  let m = s, h = !0;
536
643
  for (; r.PlainDate.compare(m, p) <= 0;) {
@@ -540,7 +647,7 @@ function W(t, n) {
540
647
  isContinuation: a
541
648
  });
542
649
  else {
543
- let t = a ? -Infinity : K(n, o);
650
+ let t = a ? -Infinity : Y(n, o);
544
651
  e.timed.push({
545
652
  event: n,
546
653
  startMs: t,
@@ -580,7 +687,7 @@ function W(t, n) {
580
687
  }
581
688
  return p;
582
689
  }
583
- function G(t, n) {
690
+ function J(t, n) {
584
691
  if (e(t)) {
585
692
  let e = t.start, n;
586
693
  return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
@@ -598,15 +705,15 @@ function G(t, n) {
598
705
  lastDayInclusive: a
599
706
  };
600
707
  }
601
- function K(t, n) {
708
+ function Y(t, n) {
602
709
  return e(t) ? t.start.toZonedDateTime({ timeZone: n }).epochMilliseconds : t.start.epochMilliseconds;
603
710
  }
604
711
  //#endregion
605
712
  //#region src/core/timelineLayout.ts
606
- function q(e, t) {
713
+ function X(e, t) {
607
714
  let { windowStart: r, windowEnd: i, pixelsPerDay: a, rowHeight: o, displayZone: s } = t, c = r.until(i, { largestUnit: "days" }).days * a, l = /* @__PURE__ */ new Map();
608
715
  for (let t of e) {
609
- let e = Y(t), n = J(t) !== null, r = l.get(e);
716
+ let e = Q(t), n = Z(t) !== null, r = l.get(e);
610
717
  r || (r = {
611
718
  events: [],
612
719
  isRecurring: n
@@ -616,7 +723,7 @@ function q(e, t) {
616
723
  for (let [e, t] of l) {
617
724
  let o = [];
618
725
  for (let e of t.events) {
619
- let { startDate: t, endDate: c } = X(e, s);
726
+ let { startDate: t, endDate: c } = ne(e, s);
620
727
  if (n.PlainDate.compare(c, r) <= 0 || n.PlainDate.compare(t, i) >= 0) continue;
621
728
  let l = n.PlainDate.compare(t, r) < 0, u = n.PlainDate.compare(c, i) > 0, d = l ? r : t, f = u ? i : c, p = r.until(d, { largestUnit: "days" }).days, m = d.until(f, { largestUnit: "days" }).days;
622
729
  o.push({
@@ -648,14 +755,14 @@ function q(e, t) {
648
755
  totalHeight: d.length * o
649
756
  };
650
757
  }
651
- function J(e) {
758
+ function Z(e) {
652
759
  let t = e.meta?.__recurrence?.seriesId;
653
760
  return typeof t == "string" ? t : null;
654
761
  }
655
- function Y(e) {
656
- return J(e) ?? e.id;
762
+ function Q(e) {
763
+ return Z(e) ?? e.id;
657
764
  }
658
- function X(e, t) {
765
+ function ne(e, t) {
659
766
  if (e.start instanceof n.PlainDate) {
660
767
  let t = e.start;
661
768
  return {
@@ -671,7 +778,7 @@ function X(e, t) {
671
778
  }
672
779
  //#endregion
673
780
  //#region src/core/measurementCache.ts
674
- var Z = class {
781
+ var re = class {
675
782
  _itemCount;
676
783
  _estimatedSize;
677
784
  _measured;
@@ -753,7 +860,7 @@ var Z = class {
753
860
  };
754
861
  //#endregion
755
862
  //#region src/core/virtualScroll.ts
756
- function Q(e, t, n, r = 3) {
863
+ function $(e, t, n, r = 3) {
757
864
  if (e.itemCount === 0) return {
758
865
  startIndex: 0,
759
866
  endIndex: 0,
@@ -770,20 +877,20 @@ function Q(e, t, n, r = 3) {
770
877
  totalSize: i
771
878
  };
772
879
  }
773
- function $(e, t, n, r, i, a, o = 3, s = 3) {
880
+ function ie(e, t, n, r, i, a, o = 3, s = 3) {
774
881
  return {
775
- x: Q(e, n, i, o),
776
- y: Q(t, r, a, s)
882
+ x: $(e, n, i, o),
883
+ y: $(t, r, a, s)
777
884
  };
778
885
  }
779
- function ee(e, t, n) {
886
+ function ae(e, t, n) {
780
887
  if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
781
888
  let r = e.prefixSum(n);
782
889
  return t.prefixSum(n) - r;
783
890
  }
784
891
  //#endregion
785
892
  //#region src/core/dragHitTest.ts
786
- function te(e, t, n, r, i) {
893
+ function oe(e, t, n, r, i) {
787
894
  if (r.itemCount === 0) return {
788
895
  itemIndex: -1,
789
896
  ratio: NaN,
@@ -814,7 +921,7 @@ function te(e, t, n, r, i) {
814
921
  pixelInItem: u
815
922
  };
816
923
  }
817
- function ne(e, t, n, r = {}) {
924
+ function se(e, t, n, r = {}) {
818
925
  let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
819
926
  if (i <= 0 || a <= 0) return {
820
927
  velocityX: 0,
@@ -838,4 +945,4 @@ function ne(e, t, n, r = {}) {
838
945
  };
839
946
  }
840
947
  //#endregion
841
- export { y as A, o as C, x as D, f as E, p as F, d as I, S as L, C as M, T as N, E as O, w as P, g as R, l as S, m as T, j as _, $ as a, u as b, W as c, z as d, R as f, M as g, k as h, Q as i, v as j, h as k, H as l, O as m, te as n, Z as o, D as p, ee as r, q as s, ne as t, B as u, A as v, s as w, b as x, r as y, _ as z };
948
+ export { x as A, S as B, u as C, s as D, o as E, C as F, _ as H, T as I, w as L, h as M, y as N, m as O, v as P, p as R, r as S, l as T, g as V, D as _, ie as a, A as b, q as c, te as d, H as f, ee as g, M as h, $ as i, E as j, f as k, G as l, N as m, oe as n, re as o, P as p, ae as r, X as s, se as t, U as u, O as v, b as w, k as x, j as y, d as z };
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./move-math-vYSpEW-r.js";
2
- import { A as c, C as l, D as u, E as d, F as f, I as p, L as m, M as h, N as g, O as _, P as v, R as y, S as b, T as x, _ as S, a as C, b as w, c as T, d as E, f as D, g as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as I, p as L, r as R, s as z, t as B, u as V, v as H, w as U, x as W, y as G, z as K } from "./core-D8QAB2K3.js";
3
- export { L as DEFAULT_WORK_DAYS, s as DstResolutionError, r as MIN_RESIZE_MINUTES, I as MeasurementCache, G as Temporal, a as applyMoveToEvent, T as buildAgendaItems, n as buildDropPayload, w as buildFormatOptions, R as computeAnchorAdjustment, B as computeAutoScrollVelocity, P as computeViewWindow, W as dateKey, k as daysInWindow, b as detectBrowserTimezone, e as detectDstSituation, l as detectFirstDayOfWeekFromLocale, U as detectHour12FromLocale, x as endOfMonth, d as endOfWeek, u as eventStartDateInZone, _ as formatScheduledTime, A as getVisibleRange1D, C as getVisibleRange2D, F as hitTestVerticalSurface, i as isAllDayEvent, o as isTimedEvent, M as isoWeekNumber, V as layoutAllDayBand, E as layoutDayEvents, N as layoutMonthGrid, D as layoutOverlappingIntervals, z as layoutTimeline, c as localizedWeekdayNames, j as monthGridDates, O as navigateCursor, h as nowInZone, g as parsePlainDate, v as parseScheduledTime, f as startOfMonth, p as startOfWeek, m as todayInZone, t as validateCalendarEvent, y as weekDates, S as windowContainsDate, H as windowDayCount, K as workWeekDates };
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./move-math-BFP9Tfuo.js";
2
+ import { A as c, B as l, C as u, D as d, E as f, F as p, H as m, I as h, L as g, M as _, N as v, O as y, P as b, R as x, S, T as C, V as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./core-CiKX2hZM.js";
3
+ export { j as DEFAULT_WORK_DAYS, s as DstResolutionError, r as MIN_RESIZE_MINUTES, z as MeasurementCache, S as Temporal, a as applyMoveToEvent, O as buildAgendaItems, n as buildDropPayload, u as buildFormatOptions, V as computeAnchorAdjustment, U as computeAutoScrollVelocity, T as computeViewWindow, L as contentAwareCascadeFrames, K as dateKey, G as daysInWindow, C as detectBrowserTimezone, e as detectDstSituation, f as detectFirstDayOfWeekFromLocale, d as detectHour12FromLocale, y as endOfMonth, F as endOfWeek, c as eventStartDateInZone, B as eventTextColor, P as formatScheduledTime, N as getVisibleRange1D, E as getVisibleRange2D, R as hitTestVerticalSurface, i as isAllDayEvent, o as isTimedEvent, _ as isoWeekNumber, W as layoutAllDayBand, k as layoutDayEvents, I as layoutMonthGrid, A as layoutOverlappingIntervals, H as layoutTimeline, v as localizedWeekdayNames, b as monthGridDates, J as navigateCursor, p as nowInZone, h as parsePlainDate, g as parseScheduledTime, M as responsiveDayColumnCount, x as startOfMonth, Y as startOfWeek, l as todayInZone, t as validateCalendarEvent, w as weekDates, D as windowContainsDate, q as windowDayCount, m as workWeekDates };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { useCalendar } from './useCalendar';
2
2
  export { CalendarBuilder, type CalendarApi, type CalendarBuilderState, } from './builders/calendar-builder';
3
3
  export type { CalendarDensity, CanDropFn, DateClickHandler, DayHeaderRenderer, DstPolicy, EventClickHandler, EventDoubleClickHandler, EventDropHandler, EventHoverHandler, EventHoverLeaveHandler, EventDropPayload, EventLayoutCtx, EventRenderer, EventRendererCtx, EventsLoader, MoreClickHandler, RangeChangeHandler, SeriesLoader, TimeClickHandler, TimeRange, } from './builders/types';
4
- export { getEventZoneHints, type EventZoneHints, } from './builders/event-zone-hints';
4
+ export { getEventZoneHints, type EventZoneHints } from './builders/event-zone-hints';
5
5
  export { useViewWindow } from './composables/useViewWindow';
6
6
  export { useCalendarDnd, buildDropPayload, type UseCalendarDndOptions, type UseCalendarDndReturn, type CalendarDragMode, type CalendarDropTarget, type DstDisambiguation, } from './composables/useCalendarDnd';
7
7
  export { useCoarDrag, type DragContext, type UseCoarDragOptions, type UseCoarDragReturn, } from './composables/useCoarDrag';
@@ -20,8 +20,11 @@ export { default as CoarWeekView } from './components/CoarWeekView.vue';
20
20
  export { default as CoarWorkWeekView } from './components/CoarWorkWeekView.vue';
21
21
  export { default as CoarTimeGrid } from './components/CoarTimeGrid.vue';
22
22
  export { default as CoarMonthView } from './components/CoarMonthView.vue';
23
+ export { default as CoarContinuousMonthView } from './components/CoarContinuousMonthView.vue';
24
+ export { default as CoarMonthListView } from './components/CoarMonthListView.vue';
23
25
  export { default as CoarAgendaView } from './components/CoarAgendaView.vue';
24
26
  export { default as CoarTimelineView } from './components/CoarTimelineView.vue';
27
+ export { default as CoarYearView } from './components/CoarYearView.vue';
25
28
  export { default as CoarDisplayZoneSwitcher } from './components/CoarDisplayZoneSwitcher.vue';
26
29
  export { default as VirtualizedSurface1DY } from './components/VirtualizedSurface1DY.vue';
27
30
  export { default as VirtualizedSurface2D } from './components/VirtualizedSurface2D.vue';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA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