@cocoar/vue-calendar 3.1.0 → 3.2.0-beta.11
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/README.md +35 -8
- package/dist/builders/calendar-builder-config.d.ts +181 -0
- package/dist/builders/calendar-builder-config.d.ts.map +1 -0
- package/dist/builders/calendar-builder-handlers.d.ts +50 -0
- package/dist/builders/calendar-builder-handlers.d.ts.map +1 -0
- package/dist/builders/calendar-builder-internals.d.ts +18 -2
- package/dist/builders/calendar-builder-internals.d.ts.map +1 -1
- package/dist/builders/calendar-builder-state.d.ts +234 -0
- package/dist/builders/calendar-builder-state.d.ts.map +1 -0
- package/dist/builders/calendar-builder.d.ts +41 -452
- package/dist/builders/calendar-builder.d.ts.map +1 -1
- package/dist/builders/internal/event-validation.d.ts +13 -0
- package/dist/builders/internal/event-validation.d.ts.map +1 -0
- package/dist/builders/internal/events-for-window.d.ts +6 -0
- package/dist/builders/internal/events-for-window.d.ts.map +1 -0
- package/dist/builders/internal/loader-pipeline.d.ts +50 -0
- package/dist/builders/internal/loader-pipeline.d.ts.map +1 -0
- package/dist/builders/internal/loading-tracker.d.ts +12 -0
- package/dist/builders/internal/loading-tracker.d.ts.map +1 -0
- package/dist/builders/internal/navigation.d.ts +28 -0
- package/dist/builders/internal/navigation.d.ts.map +1 -0
- package/dist/builders/internal/range-label.d.ts +7 -0
- package/dist/builders/internal/range-label.d.ts.map +1 -0
- package/dist/builders/internal/series-pipeline.d.ts +67 -0
- package/dist/builders/internal/series-pipeline.d.ts.map +1 -0
- package/dist/builders/internal/window-utils.d.ts +44 -0
- package/dist/builders/internal/window-utils.d.ts.map +1 -0
- package/dist/builders/types.d.ts +30 -3
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/components/CoarAgendaView.vue.d.ts +35 -0
- package/dist/components/CoarAgendaView.vue.d.ts.map +1 -1
- package/dist/components/CoarCalendar.vue.d.ts +46 -1
- package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
- package/dist/components/CoarContinuousMonthView.vue.d.ts +7 -0
- package/dist/components/CoarContinuousMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarDayView.vue.d.ts +16 -2
- package/dist/components/CoarDayView.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthListView.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarTimeGrid.vue.d.ts +33 -7
- package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
- package/dist/components/CoarTimelineView.vue.d.ts.map +1 -1
- package/dist/components/CoarWeekView.vue.d.ts.map +1 -1
- package/dist/components/CoarWorkWeekView.vue.d.ts +1 -2
- package/dist/components/CoarWorkWeekView.vue.d.ts.map +1 -1
- package/dist/components/CoarYearView.vue.d.ts.map +1 -1
- package/dist/components/VirtualizedSurface1DY.vue.d.ts.map +1 -1
- package/dist/components/internal/CoarEventDecorations.vue.d.ts.map +1 -1
- package/dist/components/internal/agenda/agendaTimeLabel.d.ts +4 -0
- package/dist/components/internal/agenda/agendaTimeLabel.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthBar.vue.d.ts +2 -0
- package/dist/components/internal/month/CoarMonthBar.vue.d.ts.map +1 -1
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts +20 -13
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
- package/dist/components/internal/month/CoarMonthDayOverlay.vue.d.ts +51 -0
- package/dist/components/internal/month/CoarMonthDayOverlay.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthPill.vue.d.ts +2 -0
- package/dist/components/internal/month/CoarMonthPill.vue.d.ts.map +1 -1
- package/dist/components/internal/month/CoarMonthRow.vue.d.ts +4 -4
- package/dist/components/internal/month/CoarMonthRow.vue.d.ts.map +1 -1
- package/dist/components/internal/originatesFromEvent.d.ts +18 -0
- package/dist/components/internal/originatesFromEvent.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts +15 -1
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBar.vue.d.ts +2 -0
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBar.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridAllDayOverflow.vue.d.ts +27 -0
- package/dist/components/internal/time-grid/CoarTimeGridAllDayOverflow.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts +2 -0
- package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridEvent.vue.d.ts +12 -1
- package/dist/components/internal/time-grid/CoarTimeGridEvent.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts +12 -1
- package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts +53 -0
- package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts.map +1 -0
- package/dist/composables/useMonthDayOverlay.d.ts +34 -0
- package/dist/composables/useMonthDayOverlay.d.ts.map +1 -0
- package/dist/composables/useMonthGeometry.d.ts +39 -0
- package/dist/composables/useMonthGeometry.d.ts.map +1 -0
- package/dist/composables/useMonthMetrics.d.ts +32 -0
- package/dist/composables/useMonthMetrics.d.ts.map +1 -0
- package/dist/composables/useTimeGridSwipe.d.ts +47 -0
- package/dist/composables/useTimeGridSwipe.d.ts.map +1 -0
- package/dist/composables/useViewWindow.d.ts +4 -2
- package/dist/composables/useViewWindow.d.ts.map +1 -1
- package/dist/core/allDayBandCap.d.ts +41 -0
- package/dist/core/allDayBandCap.d.ts.map +1 -0
- package/dist/core/eventTextContrast.d.ts +53 -2
- package/dist/core/eventTextContrast.d.ts.map +1 -1
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/monthGridLayout.d.ts +43 -1
- package/dist/core/monthGridLayout.d.ts.map +1 -1
- package/dist/core/rangeLabel.d.ts +14 -0
- package/dist/core/rangeLabel.d.ts.map +1 -0
- package/dist/core/timeGridRange.d.ts +50 -0
- package/dist/core/timeGridRange.d.ts.map +1 -0
- package/dist/core/timedCardAnatomy.d.ts +47 -0
- package/dist/core/timedCardAnatomy.d.ts.map +1 -0
- package/dist/core/viewWindow.d.ts +17 -4
- package/dist/core/viewWindow.d.ts.map +1 -1
- package/dist/{core-CiKX2hZM.js → core-DNwsMOSU.js} +329 -80
- package/dist/core.js +2 -2
- package/dist/i18n/messages.d.ts +16 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2927 -1873
- package/dist/vue-calendar.css +1 -1
- package/package.json +4 -3
- package/dist/composables/useMonthExpansion.d.ts +0 -37
- package/dist/composables/useMonthExpansion.d.ts.map +0 -1
|
@@ -1,489 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Reactive state owned by a `CalendarBuilder`. All reads go through
|
|
8
|
-
* `toValue()` for `MaybeRefOrGetter<T>` fields and `.value` for
|
|
9
|
-
* `Ref<T>` fields. Function fields (canDrop / handlers / renderers)
|
|
10
|
-
* are stored verbatim and called at the read site.
|
|
11
|
-
*/
|
|
12
|
-
export interface CalendarBuilderState<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
13
|
-
events: MaybeRefOrGetter<CalendarEvent<TMeta>[]> | null;
|
|
14
|
-
eventsLoader: EventsLoader<TMeta> | null;
|
|
15
|
-
/**
|
|
16
|
-
* Recurring-series source (Phase 4). Reactive — expansion re-runs
|
|
17
|
-
* when the source changes or the visible range changes.
|
|
18
|
-
* Mutually exclusive with `seriesLoader`.
|
|
19
|
-
*/
|
|
20
|
-
series: MaybeRefOrGetter<RecurringSeries<TMeta>[]> | null;
|
|
21
|
-
/**
|
|
22
|
-
* Calendar-managed recurring-series loader (Phase 4). Called per
|
|
23
|
-
* visible-range change; results are expanded by the configured
|
|
24
|
-
* engine and cached per-window key. Mutually exclusive with `series`.
|
|
25
|
-
*/
|
|
26
|
-
seriesLoader: SeriesLoader<TMeta> | null;
|
|
27
|
-
/** Display zone (C5). Defaults to the browser's IANA zone. */
|
|
28
|
-
timezone: MaybeRefOrGetter<string>;
|
|
29
|
-
locale: MaybeRefOrGetter<string>;
|
|
30
|
-
/** Locale-derived when undefined (Article 9 — defaults are not decisions). */
|
|
31
|
-
firstDayOfWeek: MaybeRefOrGetter<DayOfWeek | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Days that count as "working days" for the `'workWeek'` view.
|
|
34
|
-
* 0 = Sun … 6 = Sat. Default is Mon–Fri (`[1, 2, 3, 4, 5]`).
|
|
35
|
-
* Empty array yields an empty workWeek (rendered as "no working
|
|
36
|
-
* days configured" — UI concern, not a runtime error).
|
|
37
|
-
*
|
|
38
|
-
* Article 9: this is an explicit decision — the locale gets a
|
|
39
|
-
* vote on `firstDayOfWeek` but NOT on which weekdays are
|
|
40
|
-
* working days (varies by country/industry independently of
|
|
41
|
-
* BCP-47).
|
|
42
|
-
*/
|
|
43
|
-
workDays: MaybeRefOrGetter<readonly DayOfWeek[]>;
|
|
44
|
-
/** Tint Saturday and Sunday cells in month views. Enabled by default. */
|
|
45
|
-
shadeWeekends: MaybeRefOrGetter<boolean>;
|
|
46
|
-
density: MaybeRefOrGetter<CalendarDensity>;
|
|
47
|
-
/** Apple-style month presentation. Default `details` preserves the classic web grid. */
|
|
48
|
-
monthDensity: MaybeRefOrGetter<CalendarMonthDensity>;
|
|
49
|
-
/** One fixed day or a width-driven 1…7-day surface. */
|
|
50
|
-
dayMode: MaybeRefOrGetter<CalendarDayMode>;
|
|
51
|
-
/** Intl date style (C6 — independent of timeStyle / hour12).
|
|
52
|
-
* Locale-derived when undefined (Article 9). */
|
|
53
|
-
dateStyle: MaybeRefOrGetter<'short' | 'medium' | 'long' | 'full' | undefined>;
|
|
54
|
-
/** Intl time style (C6). */
|
|
55
|
-
/** Intl time style (C6). Locale-derived when undefined (Article 9). */
|
|
56
|
-
timeStyle: MaybeRefOrGetter<'short' | 'medium' | 'long' | undefined>;
|
|
57
|
-
/** 12h vs 24h clock (C6 — independent of locale). */
|
|
58
|
-
hour12: MaybeRefOrGetter<boolean | undefined>;
|
|
59
|
-
/** DST disambiguation policy (C4). Default `'compatible'`. */
|
|
60
|
-
dstPolicy: MaybeRefOrGetter<DstPolicy>;
|
|
61
|
-
/**
|
|
62
|
-
* Recurrence engine (Phase 4 §A8). One of:
|
|
63
|
-
* - `RecurrenceEngine` instance — eager.
|
|
64
|
-
* - `() => RecurrenceEngine` factory — SSR-friendly lazy.
|
|
65
|
-
* - `null` — defer to the lazy default (rrule-temporal adapter
|
|
66
|
-
* loaded via dynamic import on first `expandSeries` call).
|
|
67
|
-
*
|
|
68
|
-
* Intentionally NOT `MaybeRefOrGetter`: mid-session swap has no
|
|
69
|
-
* sensible semantics (in-flight requests, worker lifecycle). Set
|
|
70
|
-
* once at construction.
|
|
71
|
-
*/
|
|
72
|
-
recurrenceEngine: RecurrenceEngine | (() => RecurrenceEngine) | null;
|
|
73
|
-
/** Subset of CalendarView the view-switcher offers. */
|
|
74
|
-
availableViews: MaybeRefOrGetter<readonly CalendarView[]>;
|
|
75
|
-
timeRange: MaybeRefOrGetter<TimeRange>;
|
|
76
|
-
slotDuration: MaybeRefOrGetter<number>;
|
|
77
|
-
pixelsPerHour: MaybeRefOrGetter<number>;
|
|
78
|
-
maxEventsPerCell: MaybeRefOrGetter<number>;
|
|
79
|
-
/** Minimum number of adjacent columns in the responsive day view. */
|
|
80
|
-
dayColumnCount: MaybeRefOrGetter<number>;
|
|
81
|
-
/** Target width of one responsive day column in CSS pixels. */
|
|
82
|
-
dayColumnMinWidth: MaybeRefOrGetter<number>;
|
|
83
|
-
agendaLengthDays: MaybeRefOrGetter<number>;
|
|
84
|
-
showEmptyDays: MaybeRefOrGetter<boolean>;
|
|
85
|
-
/**
|
|
86
|
-
* Number of days the `'timeline'` view spans starting from the
|
|
87
|
-
* cursor. Default 60 (~two months — fits sprint-planning horizons
|
|
88
|
-
* without overwhelming the horizontal scroll).
|
|
89
|
-
*/
|
|
90
|
-
timelineRangeDays: MaybeRefOrGetter<number>;
|
|
91
|
-
/**
|
|
92
|
-
* Horizontal pixel density of the `'timeline'` view's time axis.
|
|
93
|
-
* Default 56 — a localized "DD. Mon" label (e.g. "15. Juni") fits
|
|
94
|
-
* on one line at the default font size. Bump to 80 for hour-
|
|
95
|
-
* granularity layout, drop to 24 for quarter-zoomed sprint
|
|
96
|
-
* overviews.
|
|
97
|
-
*/
|
|
98
|
-
timelinePixelsPerDay: MaybeRefOrGetter<number>;
|
|
99
|
-
/**
|
|
100
|
-
* Height of each event row in the `'timeline'` view, in pixels.
|
|
101
|
-
* Default 32 — matches the default density's pill height.
|
|
102
|
-
*/
|
|
103
|
-
timelineRowHeight: MaybeRefOrGetter<number>;
|
|
104
|
-
/**
|
|
105
|
-
* Width of the left label-pane in the `'timeline'` view, in pixels.
|
|
106
|
-
* Default 200 — wide enough for most event titles without
|
|
107
|
-
* crowding the time-grid.
|
|
108
|
-
*/
|
|
109
|
-
timelineLabelWidth: MaybeRefOrGetter<number>;
|
|
110
|
-
/** Active view. Held as Ref so api.setView can write back. */
|
|
111
|
-
view: Ref<CalendarView>;
|
|
112
|
-
/** Cursor date. Held as Ref so api.next/prev/goTo can write back. */
|
|
113
|
-
date: Ref<Temporal.PlainDate>;
|
|
114
|
-
canDrop: CanDropFn<TMeta> | null;
|
|
115
|
-
eventRenderer: EventRenderer<TMeta> | null;
|
|
116
|
-
dayHeaderRenderer: DayHeaderRenderer | null;
|
|
117
|
-
onEventClick: EventClickHandler<TMeta> | null;
|
|
118
|
-
onEventDoubleClick: EventDoubleClickHandler<TMeta> | null;
|
|
119
|
-
onEventHover: EventHoverHandler<TMeta> | null;
|
|
120
|
-
onEventHoverLeave: EventHoverLeaveHandler<TMeta> | null;
|
|
121
|
-
onEventDrop: EventDropHandler<TMeta> | null;
|
|
122
|
-
onDateClick: DateClickHandler | null;
|
|
123
|
-
onTimeClick: TimeClickHandler | null;
|
|
124
|
-
onMoreClick: MoreClickHandler<TMeta> | null;
|
|
125
|
-
onRangeChange: RangeChangeHandler | null;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Imperative + reactive surface returned alongside the builder.
|
|
129
|
-
*/
|
|
130
|
-
export interface CalendarApi<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
131
|
-
/** `true` while at least one `eventsLoader` invocation is in flight. */
|
|
132
|
-
readonly loading: Readonly<Ref<boolean>>;
|
|
133
|
-
/** Currently rendered window. `null` before first paint. */
|
|
134
|
-
readonly visibleRange: Readonly<ShallowRef<ViewWindow | null>>;
|
|
135
|
-
/** `true` once the active view's grid has reported ready. */
|
|
136
|
-
readonly gridReady: Readonly<Ref<boolean>>;
|
|
137
|
-
goTo(date: Temporal.PlainDate): void;
|
|
138
|
-
goToToday(): void;
|
|
139
|
-
next(): void;
|
|
140
|
-
prev(): void;
|
|
141
|
-
setView(view: CalendarView): void;
|
|
142
|
-
setMonthDensity(density: CalendarMonthDensity): void;
|
|
143
|
-
setDayMode(mode: CalendarDayMode): void;
|
|
144
|
-
/** Wired in Session 3 (component-side). No-op until then. */
|
|
145
|
-
scrollToTime(time: Temporal.PlainTime): void;
|
|
146
|
-
/** Wired in Session 3 (component-side). No-op until then. */
|
|
147
|
-
scrollToDate(date: Temporal.PlainDate): void;
|
|
148
|
-
/** Invalidate the entire loader cache and re-fetch the current window. */
|
|
149
|
-
refresh(): void;
|
|
150
|
-
/** Invalidate any cached entries that intersect `window` and re-fetch
|
|
151
|
-
* if the current window intersects. */
|
|
152
|
-
refreshRange(window: ViewWindow): void;
|
|
153
|
-
/** Synchronous read of the current window. `null` before first paint. */
|
|
154
|
-
getVisibleRange(): ViewWindow | null;
|
|
155
|
-
/** Snapshot of events visible in the current window — from
|
|
156
|
-
* `events()` source if set, else the loader cache (or empty if no
|
|
157
|
-
* cache hit yet). */
|
|
158
|
-
getVisibleEvents(): CalendarEvent<TMeta>[];
|
|
159
|
-
}
|
|
160
|
-
export declare class CalendarBuilder<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
161
|
-
/** Reactive state — single source of truth (C7 read site). */
|
|
162
|
-
readonly state: CalendarBuilderState<TMeta>;
|
|
1
|
+
import { CalendarEvent, ViewWindow, Temporal } from '../core';
|
|
2
|
+
import { SET_TOPMOST_VISIBLE_MONTH, SET_VISIBLE_RANGE, INVALIDATE_LOADER_CACHE, PREFETCH_WINDOWS } from './calendar-builder-internals';
|
|
3
|
+
import { CalendarBuilderHandlers } from './calendar-builder-handlers';
|
|
4
|
+
import { CalendarApi } from './calendar-builder-state';
|
|
5
|
+
export type { CalendarApi, CalendarBuilderState } from './calendar-builder-state';
|
|
6
|
+
export declare class CalendarBuilder<TMeta extends Record<string, unknown> = Record<string, unknown>> extends CalendarBuilderHandlers<TMeta> {
|
|
163
7
|
/** Imperative + reactive surface. */
|
|
164
8
|
readonly api: CalendarApi<TMeta>;
|
|
165
|
-
private readonly _loading;
|
|
166
9
|
private readonly _visibleRange;
|
|
10
|
+
private readonly _topmostVisibleMonth;
|
|
167
11
|
private readonly _gridReady;
|
|
168
|
-
/** Active view's scroll
|
|
169
|
-
* via `_setScrollToTime(fn)` and clears on unmount. */
|
|
12
|
+
/** Active view's scroll delegates. Registered on mount, cleared on unmount. */
|
|
170
13
|
private _scrollToTimeImpl;
|
|
171
|
-
/** Active view's scroll-to-date delegate. */
|
|
172
14
|
private _scrollToDateImpl;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
private readonly
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
/** Pending debounced loader handle — cleared on subsequent
|
|
180
|
-
* `_setVisibleRange` calls within the debounce window. */
|
|
181
|
-
private _debounceHandle;
|
|
182
|
-
/**
|
|
183
|
-
* Generation counter — bumped on `refresh()` so an in-flight loader
|
|
184
|
-
* whose result arrives AFTER an invalidation is discarded instead
|
|
185
|
-
* of poisoning the cache.
|
|
186
|
-
*/
|
|
187
|
-
private _generation;
|
|
188
|
-
/** Map<windowKey, expanded events>. Same key shape as _loaderCache.
|
|
189
|
-
* Holds occurrences expanded from `state.series` / `state.seriesLoader`. */
|
|
190
|
-
private readonly _seriesCache;
|
|
191
|
-
/** Bumped on series invalidation. Independent of `_generation` so
|
|
192
|
-
* series and events caches don't fight over the same counter. */
|
|
193
|
-
private _seriesGeneration;
|
|
194
|
-
/** Resolved engine instance (lazy-constructed from
|
|
195
|
-
* `state.recurrenceEngine`). `null` means "use the lazy default
|
|
196
|
-
* inside expandSeries". */
|
|
197
|
-
private _resolvedEngine;
|
|
198
|
-
/** Window keys with a pending series expansion. Prevents duplicate
|
|
199
|
-
* dispatches when series-watcher and [SET_VISIBLE_RANGE] both fire
|
|
200
|
-
* for the same window in close succession. */
|
|
201
|
-
private readonly _inFlightSeriesKeys;
|
|
202
|
-
/** Memoized lazy import of `expandSeries`. Dynamic-import keeps
|
|
203
|
-
* the recurrence runtime out of the main bundle for apps that
|
|
204
|
-
* don't use series — the chunk only loads on first
|
|
205
|
-
* `_runSeriesExpansion` call. Per Phase 4 §A1 topology rule. */
|
|
206
|
-
private _expandSeriesFnPromise;
|
|
207
|
-
/** Effect scope for builder-owned watchers (audit fix #1 — events
|
|
208
|
-
* source watcher). Cleaned up if/when a `.dispose()` is added in
|
|
209
|
-
* Phase 4+; currently builders live for the page lifetime. */
|
|
15
|
+
private readonly _warnedScrollMethods;
|
|
16
|
+
private readonly _loading;
|
|
17
|
+
private readonly _validator;
|
|
18
|
+
private readonly _loader;
|
|
19
|
+
private readonly _series;
|
|
20
|
+
/** Effect scope for builder-owned watchers. Builders live for the page lifetime. */
|
|
210
21
|
private readonly _scope;
|
|
211
|
-
/** Tracks event-array references already validated, so re-renders
|
|
212
|
-
* don't re-walk them. Per-event-object validation; consumers who
|
|
213
|
-
* recreate event objects on every render pay the validation cost
|
|
214
|
-
* every render (cheap — a few `instanceof` checks). */
|
|
215
|
-
private readonly _validatedEventObjects;
|
|
216
22
|
private constructor();
|
|
217
|
-
/** Factory —
|
|
218
|
-
* `useCalendar()`. */
|
|
23
|
+
/** Factory — `new` is private so the only entry point is `useCalendar()`. */
|
|
219
24
|
static create<TMeta extends Record<string, unknown> = Record<string, unknown>>(): CalendarBuilder<TMeta>;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
* The library accepts ONLY `Temporal.ZonedDateTime` (timed) or
|
|
226
|
-
* `Temporal.PlainDate` (all-day) on event start/end. Strings,
|
|
227
|
-
* `Date`, floating `PlainDateTime` etc. throw at index-insert via
|
|
228
|
-
* `validateCalendarEvent` (C1).
|
|
229
|
-
*/
|
|
230
|
-
events(source: MaybeRefOrGetter<CalendarEvent<TMeta>[]>): this;
|
|
231
|
-
/**
|
|
232
|
-
* Bind a calendar-managed loader. Called whenever the visible
|
|
233
|
-
* window changes; results cached per `(view, timezone, start, end)`
|
|
234
|
-
* so navigation back to a previously-seen window doesn't re-fetch.
|
|
235
|
-
* Mutually exclusive with `events()`.
|
|
236
|
-
*/
|
|
237
|
-
eventsLoader(loader: EventsLoader<TMeta>): this;
|
|
238
|
-
/**
|
|
239
|
-
* Phase 4 — bind a recurring-series source. Reactive: expansion
|
|
240
|
-
* re-runs whenever the source changes or the visible range changes.
|
|
241
|
-
*
|
|
242
|
-
* Composes with `events()` / `eventsLoader()`; `getVisibleEvents()`
|
|
243
|
-
* returns the merged set. Mutually exclusive with `seriesLoader()`
|
|
244
|
-
* (one or the other, not both).
|
|
245
|
-
*
|
|
246
|
-
* Expansion uses the engine from `recurrenceEngine()` if set, else
|
|
247
|
-
* the lazy default rrule-temporal adapter. DST policy from
|
|
248
|
-
* `dstPolicy()` applies uniformly to every expanded occurrence.
|
|
249
|
-
*/
|
|
250
|
-
series(source: MaybeRefOrGetter<RecurringSeries<TMeta>[]>): this;
|
|
251
|
-
/**
|
|
252
|
-
* Phase 4 — bind a calendar-managed recurring-series loader.
|
|
253
|
-
* Called per visible-range change; results expanded by the
|
|
254
|
-
* configured engine and cached per-window. Mutually exclusive with
|
|
255
|
-
* `series()`.
|
|
256
|
-
*/
|
|
257
|
-
seriesLoader(loader: SeriesLoader<TMeta>): this;
|
|
258
|
-
/** C5 — Display zone (IANA). Source zones on individual events
|
|
259
|
-
* remain independent and per-endpoint preserved (C3). */
|
|
260
|
-
timezone(tz: MaybeRefOrGetter<string>): this;
|
|
261
|
-
locale(loc: MaybeRefOrGetter<string>): this;
|
|
262
|
-
firstDayOfWeek(d: MaybeRefOrGetter<DayOfWeek>): this;
|
|
263
|
-
/**
|
|
264
|
-
* Working-day set for the `'workWeek'` view. 0 = Sun … 6 = Sat.
|
|
265
|
-
* Default is Mon–Fri. Reactive — changing it while a workWeek
|
|
266
|
-
* view is active reflows the rendered columns.
|
|
267
|
-
*/
|
|
268
|
-
workDays(d: MaybeRefOrGetter<readonly DayOfWeek[]>): this;
|
|
269
|
-
/** Tint Saturday and Sunday cells in month views. */
|
|
270
|
-
shadeWeekends(enabled: MaybeRefOrGetter<boolean>): this;
|
|
271
|
-
density(d: MaybeRefOrGetter<CalendarDensity>): this;
|
|
272
|
-
monthDensity(density: MaybeRefOrGetter<CalendarMonthDensity>): this;
|
|
273
|
-
dayMode(mode: MaybeRefOrGetter<CalendarDayMode>): this;
|
|
274
|
-
/** C6 — independent of timeStyle / hour12. */
|
|
275
|
-
dateStyle(s: MaybeRefOrGetter<'short' | 'medium' | 'long' | 'full'>): this;
|
|
276
|
-
/** C6 — independent of dateStyle / hour12. */
|
|
277
|
-
timeStyle(s: MaybeRefOrGetter<'short' | 'medium' | 'long'>): this;
|
|
278
|
-
/**
|
|
279
|
-
* C6 — independent of locale. `undefined` lets Intl derive from
|
|
280
|
-
* locale (default); `true` / `false` overrides explicitly.
|
|
281
|
-
*/
|
|
282
|
-
hour12(h: MaybeRefOrGetter<boolean | undefined>): this;
|
|
283
|
-
/**
|
|
284
|
-
* C4 — DST disambiguation policy. Read by every wall-time → instant
|
|
285
|
-
* conversion in the drop pipeline. Default `'compatible'`.
|
|
286
|
-
*/
|
|
287
|
-
dstPolicy(p: MaybeRefOrGetter<DstPolicy>): this;
|
|
288
|
-
/**
|
|
289
|
-
* Phase 4 §A8 — recurrence engine.
|
|
290
|
-
*
|
|
291
|
-
* Bind a specific engine for `expandSeries` calls associated with
|
|
292
|
-
* this builder. Without this call, the lazy default
|
|
293
|
-
* (rrule-temporal adapter) is used.
|
|
294
|
-
*
|
|
295
|
-
* The factory form is the SSR escape: pass
|
|
296
|
-
* `() => new SyncOnlyRecurrenceEngine()` so the engine is
|
|
297
|
-
* constructed only when actually needed (SSR with non-recurring
|
|
298
|
-
* events doesn't trigger construction).
|
|
299
|
-
*
|
|
300
|
-
* Use cases:
|
|
301
|
-
* - Custom engines: implement the `RecurrenceEngine` interface
|
|
302
|
-
* in consumer code (e.g. server-side pre-expansion, alternate
|
|
303
|
-
* RRULE parser, mock for tests).
|
|
304
|
-
* - SSR: pass a factory form to defer engine construction to
|
|
305
|
-
* the first client-side call.
|
|
306
|
-
* - Tests: pass a mock engine for deterministic output.
|
|
307
|
-
*
|
|
308
|
-
* **Set once at construction.** Mid-session swap has no sensible
|
|
309
|
-
* semantics (in-flight requests, worker lifecycle, cache coherency)
|
|
310
|
-
* — calling this method after a series expansion has been
|
|
311
|
-
* dispatched does NOT cancel or re-route in-flight calls.
|
|
312
|
-
*/
|
|
313
|
-
recurrenceEngine(engineOrFactory: RecurrenceEngine | (() => RecurrenceEngine)): this;
|
|
314
|
-
/**
|
|
315
|
-
* Active view. Setter accepts a `Ref<CalendarView>` (two-way
|
|
316
|
-
* binding) or a plain value (wrapped into an internal ref).
|
|
317
|
-
* Function-getters are rejected — `api.setView` must be able to
|
|
318
|
-
* write back.
|
|
319
|
-
*/
|
|
320
|
-
view(v: Ref<CalendarView> | CalendarView): this;
|
|
321
|
-
availableViews(views: MaybeRefOrGetter<readonly CalendarView[]>): this;
|
|
322
|
-
/**
|
|
323
|
-
* Cursor date. Setter accepts a `Ref<PlainDate>` or a plain
|
|
324
|
-
* `PlainDate`; function-getters rejected (api.next/prev/goTo
|
|
325
|
-
* must write).
|
|
326
|
-
*/
|
|
327
|
-
date(d: Ref<Temporal.PlainDate> | Temporal.PlainDate): this;
|
|
328
|
-
/** Time-grid view setting (`day` / `week`). */
|
|
329
|
-
timeRange(r: MaybeRefOrGetter<TimeRange>): this;
|
|
330
|
-
slotDuration(minutes: MaybeRefOrGetter<number>): this;
|
|
331
|
-
pixelsPerHour(px: MaybeRefOrGetter<number>): this;
|
|
332
|
-
/** Month view setting — pills before "+N more". */
|
|
333
|
-
maxEventsPerCell(n: MaybeRefOrGetter<number>): this;
|
|
334
|
-
/** Responsive day view: minimum number of full day columns. */
|
|
335
|
-
dayColumnCount(n: MaybeRefOrGetter<number>): this;
|
|
336
|
-
/** Responsive day view: target width used to derive additional columns. */
|
|
337
|
-
dayColumnMinWidth(px: MaybeRefOrGetter<number>): this;
|
|
338
|
-
/** Agenda view setting — number of days the linear list covers. */
|
|
339
|
-
agendaLengthDays(n: MaybeRefOrGetter<number>): this;
|
|
340
|
-
/** Agenda view setting — show day headers even when no events. */
|
|
341
|
-
showEmptyDays(b: MaybeRefOrGetter<boolean>): this;
|
|
342
|
-
/** Days the `'timeline'` view spans starting from the cursor. Default 60. */
|
|
343
|
-
timelineRangeDays(n: MaybeRefOrGetter<number>): this;
|
|
344
|
-
/** Horizontal pixel density of the `'timeline'` view (pixels per day). Default 56. */
|
|
345
|
-
timelinePixelsPerDay(p: MaybeRefOrGetter<number>): this;
|
|
346
|
-
/** Event-row height in the `'timeline'` view, in pixels. Default 32. */
|
|
347
|
-
timelineRowHeight(h: MaybeRefOrGetter<number>): this;
|
|
348
|
-
/** Left-pane label width in the `'timeline'` view, in pixels. Default 200. */
|
|
349
|
-
timelineLabelWidth(w: MaybeRefOrGetter<number>): this;
|
|
350
|
-
/**
|
|
351
|
-
* Drop validator. Read on EVERY hit-test (C7 + D4 — no library-
|
|
352
|
-
* side memoization). If you do expensive work in here, memoize
|
|
353
|
-
* client-side; the library reading fresh state is the correct
|
|
354
|
-
* behaviour and intentionally not cached.
|
|
355
|
-
*
|
|
356
|
-
* @example
|
|
357
|
-
* ```ts
|
|
358
|
-
* // Consumer-side memoization for expensive checks:
|
|
359
|
-
* const memoized = computed(() => {
|
|
360
|
-
* const rules = expensivelyCompiledRules.value;
|
|
361
|
-
* return (event, target) => rules.matches(event, target);
|
|
362
|
-
* });
|
|
363
|
-
* builder.canDrop(memoized.value);
|
|
364
|
-
* ```
|
|
365
|
-
*/
|
|
366
|
-
canDrop(fn: CanDropFn<TMeta>): this;
|
|
367
|
-
eventRenderer(r: EventRenderer<TMeta>): this;
|
|
368
|
-
dayHeaderRenderer(r: DayHeaderRenderer): this;
|
|
369
|
-
onEventClick(h: EventClickHandler<TMeta>): this;
|
|
370
|
-
onEventDoubleClick(h: EventDoubleClickHandler<TMeta>): this;
|
|
371
|
-
/**
|
|
372
|
-
* Fires on `pointerenter` over an event element in any view.
|
|
373
|
-
* Pair with `useOverlay()` (from `@cocoar/vue-ui`) to anchor a
|
|
374
|
-
* popover at `payload.native.currentTarget`. The library does
|
|
375
|
-
* NOT apply hover delay — consumer wraps the handler if a delay
|
|
376
|
-
* is wanted.
|
|
377
|
-
*/
|
|
378
|
-
onEventHover(h: EventHoverHandler<TMeta>): this;
|
|
379
|
-
/** Companion to `onEventHover` — fires on `pointerleave`. */
|
|
380
|
-
onEventHoverLeave(h: EventHoverLeaveHandler<TMeta>): this;
|
|
381
|
-
onEventDrop(h: EventDropHandler<TMeta>): this;
|
|
382
|
-
onDateClick(h: DateClickHandler): this;
|
|
383
|
-
onTimeClick(h: TimeClickHandler): this;
|
|
384
|
-
/**
|
|
385
|
-
* Audit Session 5 N1 — `onMoreClick` is wired by month-view's
|
|
386
|
-
* "+N more" overflow surface, which is a Session 3.5+ visual
|
|
387
|
-
* polish item. The setter is honoured today (handler stored on
|
|
388
|
-
* state, read-on-fire), but the overflow trigger is not yet
|
|
389
|
-
* implemented in `<CoarMonthView>`. A one-shot dev-warn surfaces
|
|
390
|
-
* the gap so consumers don't ship features that never fire.
|
|
391
|
-
*/
|
|
392
|
-
onMoreClick(h: MoreClickHandler<TMeta>): this;
|
|
393
|
-
onRangeChange(h: RangeChangeHandler): this;
|
|
25
|
+
private _installWatchers;
|
|
26
|
+
protected _validateEvents(events: ReadonlyArray<CalendarEvent<TMeta>>): void;
|
|
27
|
+
protected _resetLoaderCache(): void;
|
|
28
|
+
protected _invalidateSeries(rerun: boolean): void;
|
|
29
|
+
protected _resetRecurrenceEngine(): void;
|
|
394
30
|
private _goTo;
|
|
395
31
|
private _goToToday;
|
|
396
32
|
private _navigate;
|
|
397
33
|
private _setView;
|
|
398
34
|
private _setMonthDensity;
|
|
399
35
|
private _setDayMode;
|
|
36
|
+
private _warnScrollNotWired;
|
|
400
37
|
/**
|
|
401
38
|
* SOLE writer of `_visibleRange`. Called by `useViewWindow` only.
|
|
402
39
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
40
|
+
* Symbol-keyed instead of underscore-prefixed-public so consumers
|
|
41
|
+
* cannot forge windows by calling `builder._setVisibleRange(...)`
|
|
42
|
+
* from outside. The symbol is exported from
|
|
43
|
+
* `calendar-builder-internals.ts`, which is intentionally NOT in
|
|
44
|
+
* `index.ts`'s public surface.
|
|
408
45
|
*
|
|
409
|
-
* Side effects:
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
* window-equality check — no-op if the window didn't change).
|
|
413
|
-
* 3. Schedules a debounced loader call if `eventsLoader` is set
|
|
414
|
-
* and the cache doesn't already have this window.
|
|
46
|
+
* Side effects (no-op when the window didn't change): updates
|
|
47
|
+
* `api.visibleRange`, fires `onRangeChange`, schedules the loader on
|
|
48
|
+
* a cache miss, runs the recurring-series expansion.
|
|
415
49
|
*
|
|
416
50
|
* @internal symbol-keyed; reachable only via the internal symbol.
|
|
417
51
|
*/
|
|
418
52
|
[SET_VISIBLE_RANGE](window: ViewWindow | null): void;
|
|
53
|
+
/** @internal symbol-keyed — the continuous month surface's live anchor. */
|
|
54
|
+
[SET_TOPMOST_VISIBLE_MONTH](month: Temporal.PlainYearMonth | null): void;
|
|
419
55
|
/**
|
|
420
|
-
* Invalidate
|
|
421
|
-
*
|
|
422
|
-
* into the void instead of poisoning fresh data.
|
|
56
|
+
* Invalidate both caches. Called by `api.refresh()`. In-flight
|
|
57
|
+
* results are discarded on arrival instead of poisoning fresh data.
|
|
423
58
|
*
|
|
424
59
|
* @internal symbol-keyed; reachable only via the internal symbol.
|
|
425
60
|
*/
|
|
426
61
|
[INVALIDATE_LOADER_CACHE](): void;
|
|
427
|
-
private _maybeScheduleLoad;
|
|
428
|
-
private _runLoader;
|
|
429
62
|
/**
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
63
|
+
* Warm both caches for windows the user is about to see — the
|
|
64
|
+
* neighbour pages drawn during a swipe. Cache hits and in-flight
|
|
65
|
+
* windows are skipped; `_visibleRange` and `onRangeChange` are NOT
|
|
66
|
+
* touched, so consumers see no navigation.
|
|
433
67
|
*
|
|
434
|
-
*
|
|
435
|
-
* error (which names the event id). Loader path catches this in
|
|
436
|
-
* the `.catch` and logs without caching; events-source path lets
|
|
437
|
-
* it propagate so the consumer's render fails loudly (Article 9 —
|
|
438
|
-
* silent partial-render hiding bad data is the worse outcome).
|
|
439
|
-
*/
|
|
440
|
-
private _validateEvents;
|
|
441
|
-
private _warnedScrollMethods;
|
|
442
|
-
/**
|
|
443
|
-
* Audit fix #16 — `scrollTo*` is wired by component mount in
|
|
444
|
-
* Session 3. Until then, calling it is a no-op; in dev we log
|
|
445
|
-
* once-per-method so consumer e2e tests don't false-pass.
|
|
68
|
+
* @internal symbol-keyed; reachable only via the internal symbol.
|
|
446
69
|
*/
|
|
447
|
-
|
|
70
|
+
[PREFETCH_WINDOWS](windows: ReadonlyArray<ViewWindow>): void;
|
|
448
71
|
private _refresh;
|
|
449
72
|
private _refreshRange;
|
|
450
|
-
|
|
451
|
-
private _getNonRecurringEvents;
|
|
452
|
-
private _getRecurringEvents;
|
|
453
|
-
/**
|
|
454
|
-
* Resolve the configured engine, lazy-constructing factory form
|
|
455
|
-
* once. Returns `undefined` when no engine is configured —
|
|
456
|
-
* `expandSeries` falls back to its own lazy default
|
|
457
|
-
* (rrule-temporal) in that case.
|
|
458
|
-
*/
|
|
459
|
-
private _resolveEngine;
|
|
460
|
-
/**
|
|
461
|
-
* Trigger a recurring-series expansion for `window`. No-op if no
|
|
462
|
-
* series source is configured. Cache hit short-circuits.
|
|
463
|
-
*
|
|
464
|
-
* Async by design (the engine interface is async). Result lands in
|
|
465
|
-
* `_seriesCache` on success; consumers read via
|
|
466
|
-
* `getVisibleEvents()` which reactively re-renders when the cache
|
|
467
|
-
* shallowRef updates.
|
|
468
|
-
*
|
|
469
|
-
* Generation-guarded: a result that arrives after `refresh()` /
|
|
470
|
-
* source-replacement is discarded so it doesn't poison fresh data.
|
|
471
|
-
*/
|
|
472
|
-
private _runSeriesExpansion;
|
|
473
|
-
private _loadExpandSeries;
|
|
474
|
-
private _readSeriesForWindow;
|
|
475
|
-
/**
|
|
476
|
-
* Snapshot of the loader cache keys for diagnostics / tests.
|
|
477
|
-
* Not part of the public API surface.
|
|
478
|
-
*
|
|
479
|
-
* @internal
|
|
480
|
-
*/
|
|
73
|
+
/** Snapshot of the loader cache keys for diagnostics / tests. @internal */
|
|
481
74
|
_debug_cacheKeys(): string[];
|
|
482
|
-
/**
|
|
483
|
-
* Current in-flight counter for diagnostics / tests.
|
|
484
|
-
*
|
|
485
|
-
* @internal
|
|
486
|
-
*/
|
|
75
|
+
/** Current in-flight counter for diagnostics / tests. @internal */
|
|
487
76
|
_debug_inFlight(): number;
|
|
488
77
|
/** @internal */
|
|
489
78
|
_setScrollToTime(fn: ((time: Temporal.PlainTime) => void) | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-builder.d.ts","sourceRoot":"","sources":["../../src/builders/calendar-builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"calendar-builder.d.ts","sourceRoot":"","sources":["../../src/builders/calendar-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAYH,OAAO,EAEL,KAAK,aAAa,EAGlB,KAAK,UAAU,EACf,QAAQ,EAET,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAUxF,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIlF,qBAAa,eAAe,CAC1B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC/D,SAAQ,uBAAuB,CAAC,KAAK,CAAC;IACtC,qCAAqC;IACrC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAGjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuC;IACrE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAoD;IACzF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,+EAA+E;IAC/E,OAAO,CAAC,iBAAiB,CAAmD;IAC5E,OAAO,CAAC,iBAAiB,CAAmD;IAC5E,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAG1D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAEhD,oFAAoF;IACpF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;IAEzD,OAAO;IAoEP,6EAA6E;IAC7E,MAAM,CAAC,MAAM,CACX,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5D,eAAe,CAAC,KAAK,CAAC;IAM3B,OAAO,CAAC,gBAAgB;IAqDxB,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI;IAI5E,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAInC,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAOjD,SAAS,CAAC,sBAAsB,IAAI,IAAI;IAOxC,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,mBAAmB;IAY3B;;;;;;;;;;;;;;OAcG;IACH,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI;IAiBpD,2EAA2E;IAC3E,CAAC,yBAAyB,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,GAAG,IAAI,GAAG,IAAI;IAMxE;;;;;OAKG;IACH,CAAC,uBAAuB,CAAC,IAAI,IAAI;IAKjC;;;;;;;OAOG;IACH,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI;IAO5D,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,aAAa;IAWrB,2EAA2E;IAC3E,gBAAgB,IAAI,MAAM,EAAE;IAI5B,mEAAmE;IACnE,eAAe,IAAI,MAAM;IASzB,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI;IAG5E,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI;IAG5E,gBAAgB;IAChB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAGpC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CalendarEvent } from '../../core';
|
|
2
|
+
export declare class EventValidator<TMeta extends Record<string, unknown>> {
|
|
3
|
+
private readonly _validated;
|
|
4
|
+
/**
|
|
5
|
+
* Throws on the first bad event with `validateCalendarEvent`'s
|
|
6
|
+
* error (which names the event id). The loader path catches this
|
|
7
|
+
* and logs without caching; the events-source path lets it
|
|
8
|
+
* propagate so the consumer's setup fails loudly (Article 9 —
|
|
9
|
+
* silent partial-render hiding bad data is the worse outcome).
|
|
10
|
+
*/
|
|
11
|
+
validate(events: ReadonlyArray<CalendarEvent<TMeta>>): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=event-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-validation.d.ts","sourceRoot":"","sources":["../../../src/builders/internal/event-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvE,qBAAa,cAAc,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IAEpD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI;CAY5D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalendarEvent, ViewWindow } from '../../core';
|
|
2
|
+
import { CalendarBuilderState } from '../calendar-builder-state';
|
|
3
|
+
import { LoaderPipeline } from './loader-pipeline';
|
|
4
|
+
import { SeriesPipeline } from './series-pipeline';
|
|
5
|
+
export declare function eventsForWindow<TMeta extends Record<string, unknown>>(state: Pick<CalendarBuilderState<TMeta>, 'events'>, loader: LoaderPipeline<TMeta>, series: SeriesPipeline<TMeta>, window: ViewWindow | null): CalendarEvent<TMeta>[];
|
|
6
|
+
//# sourceMappingURL=events-for-window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-for-window.d.ts","sourceRoot":"","sources":["../../../src/builders/internal/events-for-window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,KAAK,EAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,EAClD,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,EAC7B,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,EAC7B,MAAM,EAAE,UAAU,GAAG,IAAI,GACxB,aAAa,CAAC,KAAK,CAAC,EAAE,CAMxB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { CalendarEvent, ViewWindow } from '../../core';
|
|
3
|
+
import { EventsLoader } from '../types';
|
|
4
|
+
import { LoadingTracker } from './loading-tracker';
|
|
5
|
+
import { EventValidator } from './event-validation';
|
|
6
|
+
export interface LoaderPipelineDeps<TMeta extends Record<string, unknown>> {
|
|
7
|
+
/** Read on every call (C7). `null` = `events()` mode, nothing to load. */
|
|
8
|
+
loader: () => EventsLoader<TMeta> | null;
|
|
9
|
+
validator: EventValidator<TMeta>;
|
|
10
|
+
loading: LoadingTracker;
|
|
11
|
+
}
|
|
12
|
+
export declare class LoaderPipeline<TMeta extends Record<string, unknown>> {
|
|
13
|
+
private readonly deps;
|
|
14
|
+
/** Map<windowKey, events>. */
|
|
15
|
+
readonly cache: ShallowRef<Map<string, CalendarEvent<TMeta>[]>>;
|
|
16
|
+
/**
|
|
17
|
+
* Bumped on every invalidation so an in-flight loader whose result
|
|
18
|
+
* arrives AFTER the invalidation is discarded instead of poisoning
|
|
19
|
+
* fresh data.
|
|
20
|
+
*/
|
|
21
|
+
private _generation;
|
|
22
|
+
private _debounceHandle;
|
|
23
|
+
/** Window keys with a fetch in flight — `prefetch` must not double-dispatch. */
|
|
24
|
+
private readonly _inFlightKeys;
|
|
25
|
+
constructor(deps: LoaderPipelineDeps<TMeta>);
|
|
26
|
+
/** Cached events for `window`, or `undefined` on a miss. */
|
|
27
|
+
get(window: ViewWindow): CalendarEvent<TMeta>[] | undefined;
|
|
28
|
+
has(window: ViewWindow): boolean;
|
|
29
|
+
/** Schedule a debounced load unless the window is already cached. */
|
|
30
|
+
maybeSchedule(window: ViewWindow): void;
|
|
31
|
+
/**
|
|
32
|
+
* Warm the cache for a window the user is about to see. No
|
|
33
|
+
* debounce — this runs AFTER the visible window settled — and no
|
|
34
|
+
* double dispatch while the same window is already in flight.
|
|
35
|
+
*/
|
|
36
|
+
prefetch(window: ViewWindow): void;
|
|
37
|
+
/** Invoke the loader for `window` now (no debounce). */
|
|
38
|
+
run(window: ViewWindow): void;
|
|
39
|
+
/** Drop everything; in-flight results are discarded on arrival. */
|
|
40
|
+
invalidateAll(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Drop cached entries whose window intersects `window` (same view
|
|
43
|
+
* + zone, overlapping bounds). Returns `true` when something was
|
|
44
|
+
* dropped.
|
|
45
|
+
*/
|
|
46
|
+
invalidateIntersecting(window: ViewWindow): boolean;
|
|
47
|
+
/** Snapshot of the cache keys (diagnostics / tests). */
|
|
48
|
+
keys(): string[];
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=loader-pipeline.d.ts.map
|