@cocoar/vue-calendar 3.1.0 → 3.2.0-beta.5

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 (100) hide show
  1. package/README.md +33 -6
  2. package/dist/builders/calendar-builder-config.d.ts +171 -0
  3. package/dist/builders/calendar-builder-config.d.ts.map +1 -0
  4. package/dist/builders/calendar-builder-handlers.d.ts +50 -0
  5. package/dist/builders/calendar-builder-handlers.d.ts.map +1 -0
  6. package/dist/builders/calendar-builder-internals.d.ts +18 -2
  7. package/dist/builders/calendar-builder-internals.d.ts.map +1 -1
  8. package/dist/builders/calendar-builder-state.d.ts +232 -0
  9. package/dist/builders/calendar-builder-state.d.ts.map +1 -0
  10. package/dist/builders/calendar-builder.d.ts +41 -452
  11. package/dist/builders/calendar-builder.d.ts.map +1 -1
  12. package/dist/builders/internal/event-validation.d.ts +13 -0
  13. package/dist/builders/internal/event-validation.d.ts.map +1 -0
  14. package/dist/builders/internal/events-for-window.d.ts +6 -0
  15. package/dist/builders/internal/events-for-window.d.ts.map +1 -0
  16. package/dist/builders/internal/loader-pipeline.d.ts +50 -0
  17. package/dist/builders/internal/loader-pipeline.d.ts.map +1 -0
  18. package/dist/builders/internal/loading-tracker.d.ts +12 -0
  19. package/dist/builders/internal/loading-tracker.d.ts.map +1 -0
  20. package/dist/builders/internal/navigation.d.ts +28 -0
  21. package/dist/builders/internal/navigation.d.ts.map +1 -0
  22. package/dist/builders/internal/range-label.d.ts +7 -0
  23. package/dist/builders/internal/range-label.d.ts.map +1 -0
  24. package/dist/builders/internal/series-pipeline.d.ts +67 -0
  25. package/dist/builders/internal/series-pipeline.d.ts.map +1 -0
  26. package/dist/builders/internal/window-utils.d.ts +44 -0
  27. package/dist/builders/internal/window-utils.d.ts.map +1 -0
  28. package/dist/builders/types.d.ts +18 -3
  29. package/dist/builders/types.d.ts.map +1 -1
  30. package/dist/components/CoarAgendaView.vue.d.ts +18 -0
  31. package/dist/components/CoarAgendaView.vue.d.ts.map +1 -1
  32. package/dist/components/CoarCalendar.vue.d.ts +25 -1
  33. package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
  34. package/dist/components/CoarContinuousMonthView.vue.d.ts.map +1 -1
  35. package/dist/components/CoarDayView.vue.d.ts +16 -2
  36. package/dist/components/CoarDayView.vue.d.ts.map +1 -1
  37. package/dist/components/CoarMonthListView.vue.d.ts.map +1 -1
  38. package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
  39. package/dist/components/CoarTimeGrid.vue.d.ts +33 -7
  40. package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
  41. package/dist/components/CoarTimelineView.vue.d.ts.map +1 -1
  42. package/dist/components/CoarWeekView.vue.d.ts.map +1 -1
  43. package/dist/components/CoarWorkWeekView.vue.d.ts +1 -2
  44. package/dist/components/CoarWorkWeekView.vue.d.ts.map +1 -1
  45. package/dist/components/CoarYearView.vue.d.ts.map +1 -1
  46. package/dist/components/VirtualizedSurface1DY.vue.d.ts.map +1 -1
  47. package/dist/components/internal/CoarEventDecorations.vue.d.ts.map +1 -1
  48. package/dist/components/internal/agenda/agendaTimeLabel.d.ts +4 -0
  49. package/dist/components/internal/agenda/agendaTimeLabel.d.ts.map +1 -0
  50. package/dist/components/internal/month/CoarMonthBar.vue.d.ts +2 -0
  51. package/dist/components/internal/month/CoarMonthBar.vue.d.ts.map +1 -1
  52. package/dist/components/internal/month/CoarMonthCell.vue.d.ts +3 -1
  53. package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
  54. package/dist/components/internal/month/CoarMonthPill.vue.d.ts +2 -0
  55. package/dist/components/internal/month/CoarMonthPill.vue.d.ts.map +1 -1
  56. package/dist/components/internal/originatesFromEvent.d.ts +18 -0
  57. package/dist/components/internal/originatesFromEvent.d.ts.map +1 -0
  58. package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts +15 -1
  59. package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts.map +1 -1
  60. package/dist/components/internal/time-grid/CoarTimeGridAllDayBar.vue.d.ts +2 -0
  61. package/dist/components/internal/time-grid/CoarTimeGridAllDayBar.vue.d.ts.map +1 -1
  62. package/dist/components/internal/time-grid/CoarTimeGridAllDayOverflow.vue.d.ts +27 -0
  63. package/dist/components/internal/time-grid/CoarTimeGridAllDayOverflow.vue.d.ts.map +1 -0
  64. package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts +2 -0
  65. package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts.map +1 -1
  66. package/dist/components/internal/time-grid/CoarTimeGridEvent.vue.d.ts +12 -1
  67. package/dist/components/internal/time-grid/CoarTimeGridEvent.vue.d.ts.map +1 -1
  68. package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts +12 -1
  69. package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts.map +1 -1
  70. package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts +53 -0
  71. package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts.map +1 -0
  72. package/dist/composables/useMonthExpansion.d.ts +0 -5
  73. package/dist/composables/useMonthExpansion.d.ts.map +1 -1
  74. package/dist/composables/useTimeGridSwipe.d.ts +47 -0
  75. package/dist/composables/useTimeGridSwipe.d.ts.map +1 -0
  76. package/dist/composables/useViewWindow.d.ts +4 -2
  77. package/dist/composables/useViewWindow.d.ts.map +1 -1
  78. package/dist/core/allDayBandCap.d.ts +41 -0
  79. package/dist/core/allDayBandCap.d.ts.map +1 -0
  80. package/dist/core/eventTextContrast.d.ts +53 -2
  81. package/dist/core/eventTextContrast.d.ts.map +1 -1
  82. package/dist/core/index.d.ts +5 -1
  83. package/dist/core/index.d.ts.map +1 -1
  84. package/dist/core/rangeLabel.d.ts +14 -0
  85. package/dist/core/rangeLabel.d.ts.map +1 -0
  86. package/dist/core/timeGridRange.d.ts +50 -0
  87. package/dist/core/timeGridRange.d.ts.map +1 -0
  88. package/dist/core/timedCardAnatomy.d.ts +47 -0
  89. package/dist/core/timedCardAnatomy.d.ts.map +1 -0
  90. package/dist/core/viewWindow.d.ts +17 -4
  91. package/dist/core/viewWindow.d.ts.map +1 -1
  92. package/dist/{core-CiKX2hZM.js → core-COjCRcPw.js} +266 -80
  93. package/dist/core.js +2 -2
  94. package/dist/i18n/messages.d.ts +16 -0
  95. package/dist/i18n/messages.d.ts.map +1 -0
  96. package/dist/index.d.ts +3 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +2383 -1655
  99. package/dist/vue-calendar.css +1 -1
  100. package/package.json +4 -3
@@ -81,13 +81,13 @@ function b(e) {
81
81
  function x(e, t) {
82
82
  return e instanceof r.PlainDate ? e : e.withTimeZone(t).toPlainDate();
83
83
  }
84
- function S(e) {
84
+ function ee(e) {
85
85
  return r.Now.plainDateISO(e);
86
86
  }
87
- function C(e) {
87
+ function S(e) {
88
88
  return r.Now.zonedDateTimeISO(e);
89
89
  }
90
- function w(e) {
90
+ function C(e) {
91
91
  let { local: t, timeZoneId: n, dstPolicy: i = "compatible" } = e, a;
92
92
  try {
93
93
  a = r.PlainDateTime.from(t);
@@ -103,51 +103,98 @@ function w(e) {
103
103
  }
104
104
  return o;
105
105
  }
106
- function T(e) {
106
+ function w(e) {
107
107
  try {
108
108
  return r.PlainDate.from(e);
109
109
  } catch (t) {
110
110
  throw RangeError(`[parsePlainDate] iso='${e}' is not a parseable ISO-8601 date (${t.message}). Expected format: 'YYYY-MM-DD'.`, { cause: t });
111
111
  }
112
112
  }
113
- function E(e) {
113
+ function T(e) {
114
114
  return {
115
115
  local: e.toPlainDateTime().toString(),
116
116
  timeZoneId: e.timeZoneId
117
117
  };
118
118
  }
119
119
  //#endregion
120
+ //#region src/core/timeGridRange.ts
121
+ var E = {
122
+ daySingle: {
123
+ anchor: "cursor",
124
+ span: 1,
125
+ filter: "all",
126
+ step: "span"
127
+ },
128
+ dayMulti: {
129
+ anchor: "cursor",
130
+ span: "responsive",
131
+ filter: "all",
132
+ step: "span"
133
+ },
134
+ week: {
135
+ anchor: "weekStart",
136
+ span: 7,
137
+ filter: "all",
138
+ step: 7
139
+ },
140
+ workWeek: {
141
+ anchor: "weekStart",
142
+ span: 7,
143
+ filter: "workDays",
144
+ step: 7
145
+ }
146
+ };
147
+ function D(e, t = {}) {
148
+ return e === "week" ? E.week : e === "workWeek" ? E.workWeek : t.explicit ? t.explicit : t.dayMode === "multiDay" ? E.dayMulti : E.daySingle;
149
+ }
150
+ function O(e) {
151
+ let { spec: t, cursor: n, firstDayOfWeek: r, workDays: a } = e, o = t.anchor === "weekStart" ? d(n, r) : n, s = k(t, e.responsiveColumns), c = Array.from({ length: s }, (e, t) => o.add({ days: t }));
152
+ return {
153
+ start: o,
154
+ spanDays: s,
155
+ days: t.filter === "workDays" ? c.filter((e) => a.includes(i(e.dayOfWeek))) : c,
156
+ stepDays: A(t, s)
157
+ };
158
+ }
159
+ function k(e, t) {
160
+ return e.span === "responsive" ? Math.max(1, Math.floor(t)) : Math.max(1, Math.floor(e.span));
161
+ }
162
+ function A(e, t) {
163
+ return e.step === "span" ? Math.max(1, t) : Math.max(1, Math.floor(e.step));
164
+ }
165
+ //#endregion
120
166
  //#region src/core/viewWindow.ts
121
- var ee = [
167
+ var te = [
122
168
  1,
123
169
  2,
124
170
  3,
125
171
  4,
126
172
  5
127
173
  ];
128
- function D(e) {
174
+ function ne(e) {
129
175
  let { view: t, cursor: r, firstDayOfWeek: i, timezone: a } = e;
130
176
  switch (t) {
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":
141
- case "week": {
142
- let e = d(r, i);
177
+ case "day":
178
+ case "week":
179
+ case "workWeek": {
180
+ let n = O({
181
+ spec: D(t, {
182
+ dayMode: "multiDay",
183
+ explicit: t === "day" ? e.timeGridRange ?? null : null
184
+ }),
185
+ cursor: r,
186
+ firstDayOfWeek: i,
187
+ workDays: [],
188
+ responsiveColumns: e.dayColumnCount ?? 1
189
+ });
143
190
  return {
144
191
  view: t,
145
- start: e.toString(),
146
- end: e.add({ days: 7 }).toString(),
192
+ start: n.start.toString(),
193
+ end: n.start.add({ days: n.spanDays }).toString(),
147
194
  timezone: a
148
195
  };
149
196
  }
150
- case "workWeek": {
197
+ case "dayAgenda": {
151
198
  let e = d(r, i);
152
199
  return {
153
200
  view: t,
@@ -214,19 +261,19 @@ function D(e) {
214
261
  default: throw Error(`Unsupported view: ${String(t)}`);
215
262
  }
216
263
  }
217
- function* O(e) {
264
+ function* re(e) {
218
265
  let t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end);
219
266
  for (; n.PlainDate.compare(t, r) < 0;) yield t, t = t.add({ days: 1 });
220
267
  }
221
- function k(e) {
268
+ function ie(e) {
222
269
  let t = n.PlainDate.from(e.start);
223
270
  return n.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
224
271
  }
225
- function A(e, t) {
272
+ function ae(e, t) {
226
273
  let r = n.PlainDate.from(e.start), i = n.PlainDate.from(e.end);
227
274
  return n.PlainDate.compare(t, r) >= 0 && n.PlainDate.compare(t, i) < 0;
228
275
  }
229
- function j(e, t, n, r = 30, i = 60, a = 1) {
276
+ function oe(e, t, n, r = 30, i = 60, a = 1) {
230
277
  let o = n === "next" ? 1 : -1;
231
278
  switch (e) {
232
279
  case "day": return t.add({ days: Math.max(1, a) * o });
@@ -243,15 +290,111 @@ function j(e, t, n, r = 30, i = 60, a = 1) {
243
290
  }
244
291
  //#endregion
245
292
  //#region src/core/dayColumns.ts
246
- function M(e, t = 1, n = 220, r = 64, i = 7) {
293
+ function se(e, t = 1, n = 220, r = 64, i = 7) {
247
294
  let a = Math.max(1, Math.round(t));
248
295
  if (!Number.isFinite(e) || e <= 0) return a;
249
296
  let o = Math.max(120, Number.isFinite(n) ? n : 220), s = Math.floor(Math.max(0, e - Math.max(0, r)) / o);
250
297
  return Math.min(Math.max(a, i), Math.max(a, s));
251
298
  }
252
299
  //#endregion
300
+ //#region src/core/rangeLabel.ts
301
+ var ce = {
302
+ month: "short",
303
+ day: "numeric",
304
+ year: "numeric",
305
+ timeZone: "UTC"
306
+ }, j = {
307
+ weekday: "long",
308
+ day: "numeric",
309
+ month: "long",
310
+ year: "numeric",
311
+ timeZone: "UTC"
312
+ }, le = {
313
+ year: "numeric",
314
+ month: "long",
315
+ timeZone: "UTC"
316
+ };
317
+ function M(e) {
318
+ return new Date(Date.UTC(e.year, e.month - 1, e.day));
319
+ }
320
+ function N(e) {
321
+ let { view: t, window: r, cursor: i, locale: a } = e, o = {
322
+ dateStyle: e.dateStyle,
323
+ timeStyle: e.timeStyle,
324
+ hour12: e.hour12
325
+ }, s = n.PlainDate.from(r.start), c = n.PlainDate.from(r.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(a, u(ce, o)).formatRange(M(s), M(c)), d = (e) => new Intl.DateTimeFormat(a, u(e, o)).format(M(i));
326
+ switch (t) {
327
+ case "day": return s.until(c, { largestUnit: "day" }).days > 0 ? l() : d(j);
328
+ case "dayAgenda": return d(j);
329
+ case "week":
330
+ case "workWeek": return l();
331
+ case "month":
332
+ case "monthList": return d(le);
333
+ case "agenda":
334
+ case "timeline": return l();
335
+ case "year": return String(i.year);
336
+ default: return "";
337
+ }
338
+ }
339
+ //#endregion
340
+ //#region src/core/timedCardAnatomy.ts
341
+ var P = 112, F = Object.freeze({
342
+ compact: !0,
343
+ titleLines: 1,
344
+ showLocation: !1,
345
+ showTime: !1
346
+ });
347
+ function I(e) {
348
+ let { durationMinutes: t, visibleWidthPx: n, detailMinWidth: r, overlapped: i, hasLocation: a } = e;
349
+ return i && r > 0 && n !== null && n < r ? F : {
350
+ compact: !1,
351
+ titleLines: t >= 70 ? 2 : 1,
352
+ showLocation: a && t >= 34,
353
+ showTime: t >= 52
354
+ };
355
+ }
356
+ //#endregion
357
+ //#region src/core/allDayBandCap.ts
358
+ var L = 3;
359
+ function R(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
360
+ let i = e.length === 0 ? 0 : e[0].laneCount, a = t === null ? null : Math.max(1, Math.floor(t)), o = a !== null && i > a;
361
+ if (!o || n) return {
362
+ bars: [...e],
363
+ overflow: [],
364
+ visibleLanes: i,
365
+ capped: !1,
366
+ exceedsCap: o
367
+ };
368
+ let s = a - 1, c = e.filter((e) => e.lane < s), l = Array(r).fill(0);
369
+ for (let t of e) {
370
+ if (t.lane < s) continue;
371
+ let e = Math.max(0, t.startCol), n = Math.min(r - 1, t.endCol);
372
+ for (let t = e; t <= n; t++) l[t] += 1;
373
+ }
374
+ let u = [];
375
+ return l.forEach((e, t) => {
376
+ e > 0 && u.push({
377
+ col: t,
378
+ hidden: e
379
+ });
380
+ }), {
381
+ bars: c,
382
+ overflow: u,
383
+ visibleLanes: a,
384
+ capped: !0,
385
+ exceedsCap: o
386
+ };
387
+ }
388
+ function z(e, t, n) {
389
+ switch (t) {
390
+ case "alwaysOneLane": return Math.max(1, e);
391
+ case "reservesCap": return Math.max(n ?? 0, e);
392
+ default: return e;
393
+ }
394
+ }
395
+ //#endregion
253
396
  //#region src/core/cascadeLayout.ts
254
- function N(e, t = 100, n = 1.5, r = 18) {
397
+ function B(e, t = 100, n = 1.5, r = 18) {
255
398
  let i = /* @__PURE__ */ new Map();
256
399
  if (!Number.isFinite(t) || t <= 0 || e.length === 0) return i;
257
400
  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) => ({
@@ -290,15 +433,62 @@ function N(e, t = 100, n = 1.5, r = 18) {
290
433
  }
291
434
  return i;
292
435
  }
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) {
436
+ var V = "#ffffff", H = "#000000", U = "var(--coar-text-base, #1a1c1f)";
437
+ function W(e, t = {}) {
438
+ let n = typeof t == "string" ? { fallback: t } : t, r = pe(e);
439
+ return r ? (n.policy ?? "wcag") === "apca" ? fe(r) : de(r) : n.fallback ?? U;
440
+ }
441
+ function ue({ background: e, textColor: t, policy: n, fallback: r }) {
442
+ return typeof t == "string" && t.trim() !== "" ? t : W(e, {
443
+ policy: n,
444
+ fallback: r
445
+ });
446
+ }
447
+ function de(e) {
448
+ let t = .2126 * G(e[0]) + .7152 * G(e[1]) + .0722 * G(e[2]);
449
+ return 1.05 / (t + .05) >= (t + .05) / .05 ? V : H;
450
+ }
451
+ function G(e) {
452
+ let t = e / 255;
453
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
454
+ }
455
+ var K = {
456
+ exponent: 2.4,
457
+ blackThreshold: .022,
458
+ blackClamp: 1.414,
459
+ normBg: .56,
460
+ normText: .57,
461
+ revBg: .65,
462
+ revText: .62,
463
+ scale: 1.14,
464
+ loClip: .1,
465
+ loOffset: .027
466
+ };
467
+ function q(e) {
468
+ let t = (e) => (e / 255) ** K.exponent, n = .2126729 * t(e[0]) + .7151522 * t(e[1]) + .072175 * t(e[2]);
469
+ return n < K.blackThreshold ? n + (K.blackThreshold - n) ** K.blackClamp : n;
470
+ }
471
+ function J(e, t) {
472
+ let n = q(e), r = q(t);
473
+ if (r > n) {
474
+ let e = (r ** K.normBg - n ** K.normText) * K.scale;
475
+ return e < K.loClip ? 0 : (e - K.loOffset) * 100;
476
+ }
477
+ let i = (r ** K.revBg - n ** K.revText) * K.scale;
478
+ return i > -K.loClip ? 0 : (i + K.loOffset) * 100;
479
+ }
480
+ function fe(e) {
481
+ return Math.abs(J([
482
+ 255,
483
+ 255,
484
+ 255
485
+ ], e)) >= Math.abs(J([
486
+ 0,
487
+ 0,
488
+ 0
489
+ ], e)) ? V : H;
490
+ }
491
+ function pe(e) {
302
492
  let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
303
493
  if (!t) return null;
304
494
  let n = t[1].length === 3 ? [...t[1]].map((e) => e + e).join("") : t[1];
@@ -308,13 +498,9 @@ function F(e) {
308
498
  4
309
499
  ].map((e) => Number.parseInt(n.slice(e, e + 2), 16));
310
500
  }
311
- function I(e) {
312
- let t = e / 255;
313
- return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
314
- }
315
501
  //#endregion
316
502
  //#region src/core/overlapLayout.ts
317
- function L(e, t) {
503
+ function me(e, t) {
318
504
  e.push(t);
319
505
  let n = e.length - 1;
320
506
  for (; n > 0;) {
@@ -323,7 +509,7 @@ function L(e, t) {
323
509
  [e[t], e[n]] = [e[n], e[t]], n = t;
324
510
  }
325
511
  }
326
- function R(e) {
512
+ function he(e) {
327
513
  let t = e[0], n = e.pop();
328
514
  if (e.length > 0) {
329
515
  e[0] = n;
@@ -336,7 +522,7 @@ function R(e) {
336
522
  }
337
523
  return t;
338
524
  }
339
- function z(e, t, n, r) {
525
+ function ge(e, t, n, r) {
340
526
  e.push(n), t.push(r);
341
527
  let i = e.length - 1;
342
528
  for (; i > 0;) {
@@ -345,10 +531,10 @@ function z(e, t, n, r) {
345
531
  [e[n], e[i]] = [e[i], e[n]], [t[n], t[i]] = [t[i], t[n]], i = n;
346
532
  }
347
533
  }
348
- function B(e) {
534
+ function _e(e) {
349
535
  return e.length > 0 ? e[0] : Infinity;
350
536
  }
351
- function V(e, t) {
537
+ function ve(e, t) {
352
538
  let n = {
353
539
  end: e[0],
354
540
  lane: t[0]
@@ -364,7 +550,7 @@ function V(e, t) {
364
550
  }
365
551
  return n;
366
552
  }
367
- function H(e) {
553
+ function Y(e) {
368
554
  let t = e.length;
369
555
  if (t === 0) return {
370
556
  bars: [],
@@ -380,12 +566,12 @@ function H(e) {
380
566
  let r = [], i = [], a = [], o = 0, s = Array(t);
381
567
  for (let e = 0; e < t; e++) {
382
568
  let t = n[e];
383
- for (; B(r) < t.start;) {
384
- let { lane: e } = V(r, i);
385
- L(a, e);
569
+ for (; _e(r) < t.start;) {
570
+ let { lane: e } = ve(r, i);
571
+ me(a, e);
386
572
  }
387
573
  let c;
388
- c = a.length > 0 ? R(a) : o++, z(r, i, t.end, c), s[e] = {
574
+ c = a.length > 0 ? he(a) : o++, ge(r, i, t.end, c), s[e] = {
389
575
  id: t.id,
390
576
  lane: c,
391
577
  start: t.start,
@@ -399,14 +585,14 @@ function H(e) {
399
585
  }
400
586
  //#endregion
401
587
  //#region src/core/timeGridLayout.ts
402
- function te(e, n) {
588
+ function ye(e, n) {
403
589
  let { day: r, timeRange: i, timezone: a } = n, [o, s] = i, c = o * 60, l = s * 60;
404
590
  if (l - c <= 0) return [];
405
591
  let u = [], d = /* @__PURE__ */ new Set();
406
592
  for (let n of e) {
407
593
  if (d.has(n.id) || (d.add(n.id), !t(n))) continue;
408
- let e = W(n.start, r, a), i;
409
- if (n.end) i = W(n.end, r, a);
594
+ let e = X(n.start, r, a), i;
595
+ if (n.end) i = X(n.end, r, a);
410
596
  else {
411
597
  if (e < 0) continue;
412
598
  i = e + 30;
@@ -429,7 +615,7 @@ function te(e, n) {
429
615
  m.length > 0 && p.push(m);
430
616
  let g = /* @__PURE__ */ new Map();
431
617
  for (let e of p) {
432
- let t = H(e.map((e) => ({
618
+ let t = Y(e.map((e) => ({
433
619
  id: e.event.id,
434
620
  start: e.startMinutes,
435
621
  end: Math.max(e.startMinutes, e.endMinutes - 1)
@@ -465,7 +651,7 @@ function te(e, n) {
465
651
  };
466
652
  });
467
653
  }
468
- function U(t, n) {
654
+ function be(t, n) {
469
655
  let { days: i } = n;
470
656
  if (n.timezone, i.length === 0) return [];
471
657
  let a = /* @__PURE__ */ new Map();
@@ -488,7 +674,7 @@ function U(t, n) {
488
674
  });
489
675
  }
490
676
  if (o.length === 0) return [];
491
- let c = H(o.map((e) => ({
677
+ let c = Y(o.map((e) => ({
492
678
  id: e.event.id,
493
679
  start: e.startCol,
494
680
  end: e.endCol
@@ -504,7 +690,7 @@ function U(t, n) {
504
690
  clippedEnd: e.clippedEnd
505
691
  }));
506
692
  }
507
- function W(e, t, n) {
693
+ function X(e, t, n) {
508
694
  let i = e.withTimeZone(n), a = r.PlainDateTime.from({
509
695
  year: t.year,
510
696
  month: t.month,
@@ -516,7 +702,7 @@ function W(e, t, n) {
516
702
  }
517
703
  //#endregion
518
704
  //#region src/core/monthGridLayout.ts
519
- function G(e, t) {
705
+ function xe(e, t) {
520
706
  let { gridDates: n, timezone: i } = t;
521
707
  if (n.length < 7 || n.length % 7 != 0) throw RangeError(`gridDates must contain complete seven-day rows (got ${n.length})`);
522
708
  let a = [];
@@ -535,7 +721,7 @@ function G(e, t) {
535
721
  for (let n of e) {
536
722
  if (o.has(n.id)) continue;
537
723
  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);
724
+ let { firstDay: e, lastDayInclusive: a, isMultiDay: l } = Se(n, i), u = (e) => (!t.visibleStart || r.PlainDate.compare(e, t.visibleStart) >= 0) && (!t.visibleEnd || r.PlainDate.compare(e, t.visibleEnd) <= 0);
539
725
  if (l) s.push({
540
726
  event: n,
541
727
  firstDay: e,
@@ -574,7 +760,7 @@ function G(e, t) {
574
760
  }
575
761
  let i = [];
576
762
  if (n.length > 0) {
577
- let e = H(n.map((e) => ({
763
+ let e = Y(n.map((e) => ({
578
764
  id: e.event.id,
579
765
  start: e.startCol,
580
766
  end: e.endCol
@@ -605,7 +791,7 @@ function G(e, t) {
605
791
  };
606
792
  }) };
607
793
  }
608
- function K(t, n) {
794
+ function Se(t, n) {
609
795
  if (e(t)) {
610
796
  let e = t.start, n;
611
797
  return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
@@ -623,7 +809,7 @@ function K(t, n) {
623
809
  }
624
810
  //#endregion
625
811
  //#region src/core/agendaLayout.ts
626
- function q(t, n) {
812
+ function Z(t, n) {
627
813
  let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c = r.PlainDate.from(i), l = r.PlainDate.from(a);
628
814
  if (r.PlainDate.compare(l, c) <= 0) return [];
629
815
  let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
@@ -637,7 +823,7 @@ function q(t, n) {
637
823
  for (let n of t) {
638
824
  if (d.has(n.id)) continue;
639
825
  d.add(n.id);
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;
826
+ let t = e(n), { firstDay: i, lastDayInclusive: a } = Ce(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;
641
827
  if (r.PlainDate.compare(p, s) < 0) continue;
642
828
  let m = s, h = !0;
643
829
  for (; r.PlainDate.compare(m, p) <= 0;) {
@@ -647,7 +833,7 @@ function q(t, n) {
647
833
  isContinuation: a
648
834
  });
649
835
  else {
650
- let t = a ? -Infinity : Y(n, o);
836
+ let t = a ? -Infinity : we(n, o);
651
837
  e.timed.push({
652
838
  event: n,
653
839
  startMs: t,
@@ -687,7 +873,7 @@ function q(t, n) {
687
873
  }
688
874
  return p;
689
875
  }
690
- function J(t, n) {
876
+ function Ce(t, n) {
691
877
  if (e(t)) {
692
878
  let e = t.start, n;
693
879
  return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
@@ -705,15 +891,15 @@ function J(t, n) {
705
891
  lastDayInclusive: a
706
892
  };
707
893
  }
708
- function Y(t, n) {
894
+ function we(t, n) {
709
895
  return e(t) ? t.start.toZonedDateTime({ timeZone: n }).epochMilliseconds : t.start.epochMilliseconds;
710
896
  }
711
897
  //#endregion
712
898
  //#region src/core/timelineLayout.ts
713
- function X(e, t) {
899
+ function Te(e, t) {
714
900
  let { windowStart: r, windowEnd: i, pixelsPerDay: a, rowHeight: o, displayZone: s } = t, c = r.until(i, { largestUnit: "days" }).days * a, l = /* @__PURE__ */ new Map();
715
901
  for (let t of e) {
716
- let e = Q(t), n = Z(t) !== null, r = l.get(e);
902
+ let e = Ee(t), n = Q(t) !== null, r = l.get(e);
717
903
  r || (r = {
718
904
  events: [],
719
905
  isRecurring: n
@@ -723,7 +909,7 @@ function X(e, t) {
723
909
  for (let [e, t] of l) {
724
910
  let o = [];
725
911
  for (let e of t.events) {
726
- let { startDate: t, endDate: c } = ne(e, s);
912
+ let { startDate: t, endDate: c } = De(e, s);
727
913
  if (n.PlainDate.compare(c, r) <= 0 || n.PlainDate.compare(t, i) >= 0) continue;
728
914
  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;
729
915
  o.push({
@@ -755,14 +941,14 @@ function X(e, t) {
755
941
  totalHeight: d.length * o
756
942
  };
757
943
  }
758
- function Z(e) {
944
+ function Q(e) {
759
945
  let t = e.meta?.__recurrence?.seriesId;
760
946
  return typeof t == "string" ? t : null;
761
947
  }
762
- function Q(e) {
763
- return Z(e) ?? e.id;
948
+ function Ee(e) {
949
+ return Q(e) ?? e.id;
764
950
  }
765
- function ne(e, t) {
951
+ function De(e, t) {
766
952
  if (e.start instanceof n.PlainDate) {
767
953
  let t = e.start;
768
954
  return {
@@ -778,7 +964,7 @@ function ne(e, t) {
778
964
  }
779
965
  //#endregion
780
966
  //#region src/core/measurementCache.ts
781
- var re = class {
967
+ var Oe = class {
782
968
  _itemCount;
783
969
  _estimatedSize;
784
970
  _measured;
@@ -877,20 +1063,20 @@ function $(e, t, n, r = 3) {
877
1063
  totalSize: i
878
1064
  };
879
1065
  }
880
- function ie(e, t, n, r, i, a, o = 3, s = 3) {
1066
+ function ke(e, t, n, r, i, a, o = 3, s = 3) {
881
1067
  return {
882
1068
  x: $(e, n, i, o),
883
1069
  y: $(t, r, a, s)
884
1070
  };
885
1071
  }
886
- function ae(e, t, n) {
1072
+ function Ae(e, t, n) {
887
1073
  if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
888
1074
  let r = e.prefixSum(n);
889
1075
  return t.prefixSum(n) - r;
890
1076
  }
891
1077
  //#endregion
892
1078
  //#region src/core/dragHitTest.ts
893
- function oe(e, t, n, r, i) {
1079
+ function je(e, t, n, r, i) {
894
1080
  if (r.itemCount === 0) return {
895
1081
  itemIndex: -1,
896
1082
  ratio: NaN,
@@ -921,7 +1107,7 @@ function oe(e, t, n, r, i) {
921
1107
  pixelInItem: u
922
1108
  };
923
1109
  }
924
- function se(e, t, n, r = {}) {
1110
+ function Me(e, t, n, r = {}) {
925
1111
  let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
926
1112
  if (i <= 0 || a <= 0) return {
927
1113
  velocityX: 0,
@@ -945,4 +1131,4 @@ function se(e, t, n, r = {}) {
945
1131
  };
946
1132
  }
947
1133
  //#endregion
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 };
1134
+ export { g as $, k as A, m as B, te as C, ae as D, oe as E, u as F, y as G, x as H, b as I, w as J, v as K, l as L, D as M, A as N, ie as O, r as P, ee as Q, o as R, se as S, re as T, T as U, f as V, h as W, p as X, C as Y, d as Z, z as _, ke as a, I as b, Z as c, ye as d, _ as et, Y as f, L as g, B as h, $ as i, O as j, E as k, xe as l, W as m, je as n, Oe as o, ue as p, S as q, Ae as r, Te as s, Me as t, be as u, R as v, ne as w, N as x, P as y, s as z };
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
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 };
2
+ import { $ as c, A as l, B as u, C as d, D as f, E as p, F as m, G as h, H as g, I as _, J as v, K as y, L as b, M as x, N as S, O as C, P as w, Q as T, R as E, S as D, T as O, U as k, V as A, W as j, X as M, Y as N, Z as P, _ as F, a as I, b as L, c as R, d as z, et as B, f as V, g as H, h as U, i as W, j as G, k as K, l as q, m as J, n as Y, o as X, p as Z, q as Q, r as $, s as ee, t as te, u as ne, v as re, w as ie, x as ae, y as oe, z as se } from "./core-COjCRcPw.js";
3
+ export { H as DEFAULT_ALL_DAY_MAX_VISIBLE_LANES, oe as DEFAULT_TIMED_EVENT_DETAIL_MIN_WIDTH, d as DEFAULT_WORK_DAYS, s as DstResolutionError, r as MIN_RESIZE_MINUTES, X as MeasurementCache, K as TIME_GRID_PRESETS, w as Temporal, F as allDayBandLanes, a as applyMoveToEvent, R as buildAgendaItems, n as buildDropPayload, m as buildFormatOptions, re as capAllDayBand, $ as computeAnchorAdjustment, te as computeAutoScrollVelocity, ie as computeViewWindow, U as contentAwareCascadeFrames, _ as dateKey, O as daysInWindow, b as detectBrowserTimezone, e as detectDstSituation, E as detectFirstDayOfWeekFromLocale, se as detectHour12FromLocale, u as endOfMonth, A as endOfWeek, Z as eventInkColor, g as eventStartDateInZone, J as eventTextColor, ae as formatRangeLabel, k as formatScheduledTime, W as getVisibleRange1D, I as getVisibleRange2D, Y as hitTestVerticalSurface, i as isAllDayEvent, o as isTimedEvent, j as isoWeekNumber, ne as layoutAllDayBand, z as layoutDayEvents, q as layoutMonthGrid, V as layoutOverlappingIntervals, ee as layoutTimeline, h as localizedWeekdayNames, y as monthGridDates, p as navigateCursor, Q as nowInZone, v as parsePlainDate, N as parseScheduledTime, l as resolveSpanDays, G as resolveTimeGridRange, L as resolveTimedCardAnatomy, D as responsiveDayColumnCount, M as startOfMonth, P as startOfWeek, x as timeGridRangeSpecFor, S as timeGridStepDays, T as todayInZone, t as validateCalendarEvent, c as weekDates, f as windowContainsDate, C as windowDayCount, B as workWeekDates };
@@ -0,0 +1,16 @@
1
+ import { CoarTranslationSource } from '@cocoar/vue-localization';
2
+ export type CalendarMessageCatalog = Readonly<Record<string, string>>;
3
+ /**
4
+ * The shipped catalogs, keyed by base language. Flat
5
+ * `'coar.calendar.<group>.<name>'` keys — the same shape a host
6
+ * would write by hand, so merging into an app catalog is a spread.
7
+ */
8
+ export declare const calendarMessages: Readonly<Record<'en' | 'de', CalendarMessageCatalog>>;
9
+ /**
10
+ * A `CoarTranslationSource` serving the shipped catalogs. Regional
11
+ * tags resolve to their base language (`de-AT` → `de`); unknown
12
+ * languages yield `null` so the service moves on to the next source
13
+ * and the inline English fallbacks take over.
14
+ */
15
+ export declare function createCalendarTranslationSource(): CoarTranslationSource;
16
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAoGtE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAc,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,+BAA+B,IAAI,qBAAqB,CAUvE"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  export { useCalendar } from './useCalendar';
2
2
  export { CalendarBuilder, type CalendarApi, type CalendarBuilderState, } from './builders/calendar-builder';
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';
3
+ export type { CalendarDensity, CanDropFn, DateClickHandler, DateDoubleClickHandler, DayHeaderRenderer, DstPolicy, EventClickHandler, EventDoubleClickHandler, EventDropHandler, EventHoverHandler, EventHoverLeaveHandler, EventDropPayload, EventLayoutCtx, EventRenderer, EventRendererCtx, EventsLoader, RangeChangeHandler, SeriesLoader, TimeClickHandler, TimeDoubleClickHandler, TimeRange, } from './builders/types';
4
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';
8
8
  export { useA11yAnnouncer } from './composables/useA11yAnnouncer';
9
+ export { useTimeGridSwipe, type UseTimeGridSwipeOptions, type UseTimeGridSwipeReturn, } from './composables/useTimeGridSwipe';
9
10
  export { useTimeGridDnd, type UseTimeGridDndOptions, type UseTimeGridDndReturn, } from './composables/useTimeGridDnd';
10
11
  export { useMonthDnd, type UseMonthDndOptions, type UseMonthDndReturn, } from './composables/useMonthDnd';
11
12
  export { useDayView } from './useDayView';
@@ -28,5 +29,6 @@ export { default as CoarYearView } from './components/CoarYearView.vue';
28
29
  export { default as CoarDisplayZoneSwitcher } from './components/CoarDisplayZoneSwitcher.vue';
29
30
  export { default as VirtualizedSurface1DY } from './components/VirtualizedSurface1DY.vue';
30
31
  export { default as VirtualizedSurface2D } from './components/VirtualizedSurface2D.vue';
32
+ export { calendarMessages, createCalendarTranslationSource, type CalendarMessageCatalog, } from './i18n/messages';
31
33
  export * from './core/index';
32
34
  //# sourceMappingURL=index.d.ts.map