@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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { CalendarMonthDensity, MonthLayout } from '../core';
|
|
3
|
+
import { MonthMetrics } from './useMonthMetrics';
|
|
4
|
+
/**
|
|
5
|
+
* Details base row: the day-number row, `maxEventsPerCell` pills, the
|
|
6
|
+
* "+N" row and the list's gaps / padding — measured in the host's
|
|
7
|
+
* styling — and never less than the iOS 94 px. With the stylesheet
|
|
8
|
+
* defaults and two pills this is exactly the iOS row; a host that
|
|
9
|
+
* restyles pills taller gets a row that still fits everything.
|
|
10
|
+
*/
|
|
11
|
+
export declare function detailsRowHeight(metrics: MonthMetrics, maxEventsPerCell: number): number;
|
|
12
|
+
export interface UseMonthGeometryOptions {
|
|
13
|
+
/** Pixel-perfect month layout from `layoutMonthGrid`. */
|
|
14
|
+
layout: ComputedRef<MonthLayout> | Ref<MonthLayout>;
|
|
15
|
+
/** Apple-style month density controlling base row and multi-day lane height. */
|
|
16
|
+
monthDensity?: MaybeRefOrGetter<CalendarMonthDensity>;
|
|
17
|
+
/** Lanes a row shows at most; `null` = unlimited. Default unlimited. */
|
|
18
|
+
maxLanes?: MaybeRefOrGetter<number | null>;
|
|
19
|
+
/** Measured cell metrics (`useMonthMetrics`). Default: stylesheet numbers. */
|
|
20
|
+
metrics?: MaybeRefOrGetter<MonthMetrics>;
|
|
21
|
+
/** Pills a Details cell shows — sizes the Details row. Default 2. */
|
|
22
|
+
maxEventsPerCell?: MaybeRefOrGetter<number>;
|
|
23
|
+
}
|
|
24
|
+
export interface UseMonthGeometryReturn {
|
|
25
|
+
/** Geometry exposed for the parent's bar math. */
|
|
26
|
+
readonly BAR_HEIGHT: ComputedRef<number>;
|
|
27
|
+
readonly BAR_GAP: number;
|
|
28
|
+
/** Measured height of the day-number row (bars start below it). */
|
|
29
|
+
readonly DAY_NUMBER_HEIGHT: ComputedRef<number>;
|
|
30
|
+
/** Top-of-bar offset within a row for a given lane. */
|
|
31
|
+
barTopPx(lane: number): number;
|
|
32
|
+
/** Per-row total bar-area pixel height (used by the pills
|
|
33
|
+
* container's `margin-top`). */
|
|
34
|
+
rowBarHeightsPx: ComputedRef<number[]>;
|
|
35
|
+
/** Per-row total height. */
|
|
36
|
+
rowHeightPx: ComputedRef<number[]>;
|
|
37
|
+
}
|
|
38
|
+
export declare function useMonthGeometry(opts: UseMonthGeometryOptions): UseMonthGeometryReturn;
|
|
39
|
+
//# sourceMappingURL=useMonthGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMonthGeometry.d.ts","sourceRoot":"","sources":["../../src/composables/useMonthGeometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAqB,MAAM,KAAK,CAAC;AAC3F,OAAO,EAAoB,KAAK,oBAAoB,EAAE,KAA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etrics {
|
|
3
|
+
/** Height of `.coar-month-cell__day-number-row`. */
|
|
4
|
+
dayNumberHeight: number;
|
|
5
|
+
/** Height of one live single-day pill. */
|
|
6
|
+
pillHeight: number;
|
|
7
|
+
/** Height of the "+N" row. */
|
|
8
|
+
markerHeight: number;
|
|
9
|
+
/** `.coar-month-cell__pills` row gap and vertical padding. */
|
|
10
|
+
pillGap: number;
|
|
11
|
+
pillsPaddingTop: number;
|
|
12
|
+
pillsPaddingBottom: number;
|
|
13
|
+
}
|
|
14
|
+
/** The stylesheet's numbers — what `CoarMonthCell` / `CoarMonthPill` render unstyled. */
|
|
15
|
+
export declare const DEFAULT_MONTH_METRICS: Readonly<MonthMetrics>;
|
|
16
|
+
export interface UseMonthMetricsOptions {
|
|
17
|
+
/** Month view root — cells are queried inside it. */
|
|
18
|
+
rootRef: Ref<HTMLElement | null>;
|
|
19
|
+
/** Re-measure whenever this changes (typically the layout). */
|
|
20
|
+
trigger?: MaybeRefOrGetter<unknown>;
|
|
21
|
+
}
|
|
22
|
+
/** The elements a measurement read, so they can be observed for resizes. */
|
|
23
|
+
export interface MonthMetricSources {
|
|
24
|
+
dayRow: HTMLElement;
|
|
25
|
+
pill: HTMLElement | null;
|
|
26
|
+
marker: HTMLElement | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function findMonthMetricSources(root: HTMLElement): MonthMetricSources | null;
|
|
29
|
+
/** Measure the rendered cells; `null` when nothing measurable is in the DOM. */
|
|
30
|
+
export declare function measureMonthMetrics(root: HTMLElement): MonthMetrics | null;
|
|
31
|
+
export declare function useMonthMetrics(opts: UseMonthMetricsOptions): Ref<MonthMetrics>;
|
|
32
|
+
//# sourceMappingURL=useMonthMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMonthMetrics.d.ts","sourceRoot":"","sources":["../../src/composables/useMonthMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,GAAG,EAOT,MAAM,KAAK,CAAC;AAEb,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAOvD,CAAC;AAEH,MAAM,WAAW,sBAAsB;IACrC,qDAAqD;IACrD,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACjC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACrC;AAOD,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,GAAG,kBAAkB,GAAG,IAAI,CAUnF;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,IAAI,CAmB1E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,GAAG,CAAC,YAAY,CAAC,CA+D/E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/** Snapshot the grid emits so its host can mirror the swipe on sibling pages. */
|
|
3
|
+
export interface TimeGridSwipeState {
|
|
4
|
+
engaged: boolean;
|
|
5
|
+
swiping: boolean;
|
|
6
|
+
settling: boolean;
|
|
7
|
+
/** The `--coar-time-grid-swipe-x` value, e.g. `'-140px'`. */
|
|
8
|
+
offsetX: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UseTimeGridSwipeOptions {
|
|
11
|
+
/** The element whose width is one "page" (the body columns container). */
|
|
12
|
+
columnsEl: Ref<HTMLElement | null>;
|
|
13
|
+
/** Read on every gesture (C7). `false` disables the pan entirely. */
|
|
14
|
+
enabled: () => boolean;
|
|
15
|
+
/** Called after the settle animation; `1` = next, `-1` = previous. */
|
|
16
|
+
onCommit: (direction: 1 | -1) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface UseTimeGridSwipeReturn {
|
|
19
|
+
/** Bind to the grid root: sets `--coar-time-grid-swipe-x`. */
|
|
20
|
+
swipeStyle: Ref<Record<string, string>>;
|
|
21
|
+
/** Bind as a class on the grid root while the grid settles. */
|
|
22
|
+
settling: Ref<boolean>;
|
|
23
|
+
/** True from the first horizontal move until release. */
|
|
24
|
+
isSwiping: Ref<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* True from the moment a pointer was taken until the gesture ends
|
|
27
|
+
* (release, cancel, end of settle). The surface mounts the
|
|
28
|
+
* neighbour pages on this — before the first movement, so they are
|
|
29
|
+
* there when the pan starts.
|
|
30
|
+
*/
|
|
31
|
+
engaged: Ref<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Feed a `pointerdown`. Returns `true` when the composable took the
|
|
34
|
+
* pointer — the caller must then NOT fire its click semantics; they
|
|
35
|
+
* arrive via `onTap` on release instead. Touch is always taken;
|
|
36
|
+
* mouse / pen only with `allowMouse` (the day-header strip).
|
|
37
|
+
*/
|
|
38
|
+
onPointerdown: (e: PointerEvent, options?: SwipePointerdownOptions) => boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface SwipePointerdownOptions {
|
|
41
|
+
/** Deferred click semantics, fired on release when the pointer never moved. */
|
|
42
|
+
onTap?: () => void;
|
|
43
|
+
/** Take mouse / pen pointers too (primary button only). */
|
|
44
|
+
allowMouse?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function useTimeGridSwipe(options: UseTimeGridSwipeOptions): UseTimeGridSwipeReturn;
|
|
47
|
+
//# sourceMappingURL=useTimeGridSwipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimeGridSwipe.d.ts","sourceRoot":"","sources":["../../src/composables/useTimeGridSwipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAkC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/D,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnC,qEAAqE;IACrE,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,sEAAsE;IACtE,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,+DAA+D;IAC/D,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,yDAAyD;IACzD,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB;;;;;OAKG;IACH,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB;;;;;OAKG;IACH,aAAa,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC;CAChF;AAED,MAAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAcD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CA2JzF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ref, MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { CalendarView, ViewWindow } from '../core';
|
|
2
|
+
import { CalendarView, TimeGridRangeSpec, ViewWindow } from '../core';
|
|
3
3
|
import { CalendarBuilder } from '../builders/calendar-builder';
|
|
4
4
|
export interface UseViewWindowOptions {
|
|
5
5
|
/**
|
|
@@ -9,8 +9,10 @@ export interface UseViewWindowOptions {
|
|
|
9
9
|
* separately remember to set `builder.state.view`.
|
|
10
10
|
*/
|
|
11
11
|
view?: CalendarView;
|
|
12
|
-
/** Resolved
|
|
12
|
+
/** Resolved column count for a `'responsive'` time-grid span (may react to container width). */
|
|
13
13
|
dayColumnCount?: MaybeRefOrGetter<number>;
|
|
14
|
+
/** The time-grid range spec the surface renders with (day view only; week / workWeek are presets). */
|
|
15
|
+
timeGridRange?: MaybeRefOrGetter<TimeGridRangeSpec | null>;
|
|
14
16
|
/** Adjacent months to include in the loader/recurrence window. */
|
|
15
17
|
monthBuffer?: MaybeRefOrGetter<number>;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewWindow.d.ts","sourceRoot":"","sources":["../../src/composables/useViewWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAA4C,MAAM,KAAK,CAAC;AAChG,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EAGhB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"useViewWindow.d.ts","sourceRoot":"","sources":["../../src/composables/useViewWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAA4C,MAAM,KAAK,CAAC;AAChG,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAGhB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gGAAgG;IAChG,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,sGAAsG;IACtG,aAAa,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC3D,kEAAkE;IAClE,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACxC;AASD,UAAU,mBAAmB;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;CACzD;AAED,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3F,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,EAC/B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CAgErB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AllDayBar } from './timeGridLayout';
|
|
2
|
+
export type AllDayBandMode = 'fitsContent' | 'alwaysOneLane' | 'reservesCap';
|
|
3
|
+
export declare const DEFAULT_ALL_DAY_MAX_VISIBLE_LANES = 3;
|
|
4
|
+
export interface AllDayCapOptions {
|
|
5
|
+
/** Lanes shown before the band folds. `null` = unlimited. */
|
|
6
|
+
maxVisibleLanes: number | null;
|
|
7
|
+
/** The user expanded the band — show everything, offer collapse. */
|
|
8
|
+
expanded: boolean;
|
|
9
|
+
/** Visible day columns; overflow markers are reported per column. */
|
|
10
|
+
columnCount: number;
|
|
11
|
+
}
|
|
12
|
+
export interface AllDayOverflowMarker {
|
|
13
|
+
/** Column index, 0-based. */
|
|
14
|
+
col: number;
|
|
15
|
+
/** Bars hidden in this column while capped. */
|
|
16
|
+
hidden: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AllDayCapResult<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
19
|
+
/** Bars to render (all of them when not capped). */
|
|
20
|
+
bars: AllDayBar<TMeta>[];
|
|
21
|
+
/** One marker per column that has hidden bars; empty when not capped. */
|
|
22
|
+
overflow: AllDayOverflowMarker[];
|
|
23
|
+
/** Lanes the rendered bars + markers occupy. */
|
|
24
|
+
visibleLanes: number;
|
|
25
|
+
/** True while bars are being hidden behind markers. */
|
|
26
|
+
capped: boolean;
|
|
27
|
+
/** True when the layout needs more lanes than the cap (expanded or not). */
|
|
28
|
+
exceedsCap: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Apply the cap to a laid-out band. A layout that fits within the
|
|
32
|
+
* cap is returned untouched — the marker lane is only sacrificed
|
|
33
|
+
* when there is actually something to hide.
|
|
34
|
+
*/
|
|
35
|
+
export declare function capAllDayBand<TMeta extends Record<string, unknown>>(bars: ReadonlyArray<AllDayBar<TMeta>>, { maxVisibleLanes, expanded, columnCount }: AllDayCapOptions): AllDayCapResult<TMeta>;
|
|
36
|
+
/**
|
|
37
|
+
* Lanes the band should be sized for under `mode`. `0` means "no
|
|
38
|
+
* band at all" (only possible in `fitsContent`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function allDayBandLanes(visibleLanes: number, mode: AllDayBandMode, maxVisibleLanes: number | null): number;
|
|
41
|
+
//# sourceMappingURL=allDayBandCap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allDayBandCap.d.ts","sourceRoot":"","sources":["../../src/core/allDayBandCap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,CAAC;AAE7E,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9F,oDAAoD;IACpD,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IACzB,yEAAyE;IACzE,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EACrC,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAC3D,eAAe,CAAC,KAAK,CAAC,CAqBxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,cAAc,EACpB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,CASR"}
|
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Text colour on event surfaces — black or white on a supplied hex
|
|
3
|
+
* event colour, or a consumer-supplied ink.
|
|
4
|
+
*
|
|
5
|
+
* Two contrast policies (mirrors `CalendarTheme.eventTextContrast`
|
|
6
|
+
* in the SwiftUI port):
|
|
7
|
+
*
|
|
8
|
+
* - `'wcag'` (default) — WCAG 2 relative-luminance ratio. Known
|
|
9
|
+
* flaw: it over-rates black on saturated mid-tones. On `#e03131`
|
|
10
|
+
* it scores black 4.65 vs white 4.51 — three percent decide, and
|
|
11
|
+
* the visibly worse colour wins.
|
|
12
|
+
* - `'apca'` — APCA-W3 (the WCAG 3 draft method). On `#e03131` it
|
|
13
|
+
* says white, Lc 75 vs 34. On yellow `#f2c010` both agree on
|
|
14
|
+
* black; the disagreement is confined to saturated mid-tones.
|
|
15
|
+
*
|
|
16
|
+
* Neither policy is "correct" for a tone on the fence — that is a
|
|
17
|
+
* design decision. So a per-event `textColor` (`meta.textColor`) wins
|
|
18
|
+
* over both, with no computation and no threshold.
|
|
19
|
+
*
|
|
20
|
+
* Decisions are made on the SUPPLIED colour, not on the rendered
|
|
21
|
+
* surface; the time grid paints cards at reduced opacity, so black
|
|
22
|
+
* stays right there more often than on the fully saturated month
|
|
23
|
+
* chips and all-day bars.
|
|
24
|
+
*/
|
|
25
|
+
export type EventTextContrastPolicy = 'wcag' | 'apca';
|
|
26
|
+
export declare const DEFAULT_EVENT_TEXT_CONTRAST: EventTextContrastPolicy;
|
|
27
|
+
export interface EventTextColorOptions {
|
|
28
|
+
/** Returned when `background` is not a parseable hex colour (CSS `var()` …). */
|
|
29
|
+
fallback?: string;
|
|
30
|
+
policy?: EventTextContrastPolicy;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Black or white for `background` under `policy`. The second argument
|
|
34
|
+
* accepts the historical `fallback` string as well as an options bag.
|
|
35
|
+
*/
|
|
36
|
+
export declare function eventTextColor(background: string, fallbackOrOptions?: string | EventTextColorOptions): string;
|
|
37
|
+
export interface EventInkOptions {
|
|
38
|
+
/** The event surface colour (hex or any CSS colour expression). */
|
|
39
|
+
background: string;
|
|
40
|
+
/** Consumer-supplied ink (`meta.textColor`). Wins outright when set. */
|
|
41
|
+
textColor?: unknown;
|
|
42
|
+
policy?: EventTextContrastPolicy;
|
|
43
|
+
fallback?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The ink a view should paint event text with: `textColor` if the
|
|
47
|
+
* consumer supplied one, otherwise the policy's black/white choice.
|
|
48
|
+
*/
|
|
49
|
+
export declare function eventInkColor({ background, textColor, policy, fallback, }: EventInkOptions): string;
|
|
50
|
+
/** Signed Lc for `text` on `background` (positive = dark text on light). */
|
|
51
|
+
export declare function apcaContrast(text: Rgb, background: Rgb): number;
|
|
52
|
+
export type Rgb = [number, number, number];
|
|
53
|
+
export declare function parseHex(value: string): Rgb | null;
|
|
3
54
|
//# sourceMappingURL=eventTextContrast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventTextContrast.d.ts","sourceRoot":"","sources":["../../src/core/eventTextContrast.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"eventTextContrast.d.ts","sourceRoot":"","sources":["../../src/core/eventTextContrast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD,eAAO,MAAM,2BAA2B,EAAE,uBAAgC,CAAC;AAM3E,MAAM,WAAW,qBAAqB;IACpC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,iBAAiB,GAAE,MAAM,GAAG,qBAA0B,GACrD,MAAM,CAQR;AAED,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,GAAG,MAAM,CAG1B;AA0CD,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAS/D;AAUD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAKlD"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -14,10 +14,14 @@ export { isTimedEvent, isAllDayEvent, validateCalendarEvent } from './types';
|
|
|
14
14
|
export { Temporal, type DayOfWeek, detectFirstDayOfWeekFromLocale, detectHour12FromLocale, detectBrowserTimezone, startOfWeek, endOfWeek, startOfMonth, endOfMonth, isoWeekNumber, weekDates, workWeekDates, monthGridDates, localizedWeekdayNames, dateKey, eventStartDateInZone, todayInZone, nowInZone, buildFormatOptions, type FormatOverrides, parseScheduledTime, parsePlainDate, formatScheduledTime, type ScheduledTimeWire, type DstPolicy, } from './temporal';
|
|
15
15
|
export { computeViewWindow, daysInWindow, windowDayCount, windowContainsDate, navigateCursor, DEFAULT_WORK_DAYS, type ViewWindowOptions, } from './viewWindow';
|
|
16
16
|
export { responsiveDayColumnCount } from './dayColumns';
|
|
17
|
+
export { formatRangeLabel, type RangeLabelOptions } from './rangeLabel';
|
|
18
|
+
export { DEFAULT_TIMED_EVENT_DETAIL_MIN_WIDTH, resolveTimedCardAnatomy, type TimedCardAnatomy, type TimedCardAnatomyInput, } from './timedCardAnatomy';
|
|
19
|
+
export { TIME_GRID_PRESETS, resolveTimeGridRange, resolveSpanDays, timeGridRangeSpecFor, timeGridStepDays, type TimeGridAnchor, type TimeGridFilter, type TimeGridRange, type TimeGridRangeSpec, type TimeGridView, type ResolveTimeGridRangeOptions, } from './timeGridRange';
|
|
20
|
+
export { capAllDayBand, allDayBandLanes, DEFAULT_ALL_DAY_MAX_VISIBLE_LANES, type AllDayBandMode, type AllDayCapOptions, type AllDayCapResult, type AllDayOverflowMarker, } from './allDayBandCap';
|
|
17
21
|
export { contentAwareCascadeFrames, type CascadeItem, type CascadeFrame } from './cascadeLayout';
|
|
18
|
-
export { eventTextColor } from './eventTextContrast';
|
|
22
|
+
export { eventTextColor, eventInkColor, type EventTextContrastPolicy, type EventTextColorOptions, type EventInkOptions, } from './eventTextContrast';
|
|
19
23
|
export { layoutDayEvents, layoutAllDayBand, type DayLayoutOptions, type AllDayBandOptions, type PositionedEvent, type AllDayBar, } from './timeGridLayout';
|
|
20
|
-
export { layoutMonthGrid, type MonthLayout, type MonthLayoutOptions, type MonthWeekRow, type MonthMultiDayBar, type MonthCellPill, } from './monthGridLayout';
|
|
24
|
+
export { layoutMonthGrid, capMonthCellPills, capMonthRowLanes, monthCellPillLimit, MONTH_DEFAULT_MAX_VISIBLE_LANES, type MonthRowLaneCap, MONTH_STACKED_VISIBLE_PILLS, MONTH_COMPACT_VISIBLE_PILLS, type MonthCellPillCap, type MonthLayout, type MonthLayoutOptions, type MonthWeekRow, type MonthMultiDayBar, type MonthCellPill, } from './monthGridLayout';
|
|
21
25
|
export { buildAgendaItems, type AgendaItem, type AgendaHeaderItem, type AgendaEventItem, type AgendaLayoutOptions, } from './agendaLayout';
|
|
22
26
|
export { layoutTimeline, type TimelineLayout, type TimelineLayoutOptions, type TimelineRow, type TimelineBar, } from './timelineLayout';
|
|
23
27
|
export { MeasurementCache } from './measurementCache';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,cAAc,EAEd,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,QAAQ,EACR,KAAK,SAAS,EACd,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,OAAO,EACP,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,KAAK,eAAe,EAEpB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,cAAc,EAEd,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,QAAQ,EACR,KAAK,SAAS,EACd,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,OAAO,EACP,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,KAAK,eAAe,EAEpB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EACL,oCAAoC,EACpC,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,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OAAO,EACZ,KAAK,OAAO,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,0BAA0B,EAC1B,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalendarEvent } from './types';
|
|
1
|
+
import { CalendarEvent, CalendarMonthDensity } from './types';
|
|
2
2
|
import { Temporal } from './temporal';
|
|
3
3
|
export interface MonthMultiDayBar<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
4
4
|
event: CalendarEvent<TMeta>;
|
|
@@ -60,6 +60,48 @@ export interface MonthLayoutOptions {
|
|
|
60
60
|
visibleStart?: Temporal.PlainDate;
|
|
61
61
|
visibleEnd?: Temporal.PlainDate;
|
|
62
62
|
}
|
|
63
|
+
/** Colour marks a Stacked month cell shows. Mirrors iOS. */
|
|
64
|
+
export declare const MONTH_STACKED_VISIBLE_PILLS = 2;
|
|
65
|
+
/** Segments a Compact month cell's colour capsule shows. Mirrors iOS. */
|
|
66
|
+
export declare const MONTH_COMPACT_VISIBLE_PILLS = 6;
|
|
67
|
+
/**
|
|
68
|
+
* Single-day pills a month cell shows for a density before the
|
|
69
|
+
* remainder folds into the "+N" marker. Details honours the
|
|
70
|
+
* builder's `maxEventsPerCell`; Stacked and Compact use the fixed
|
|
71
|
+
* iOS limits because their marks carry no title to read.
|
|
72
|
+
*/
|
|
73
|
+
export declare function monthCellPillLimit(density: CalendarMonthDensity, maxEventsPerCell: number): number;
|
|
74
|
+
export interface MonthCellPillCap<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
75
|
+
/** Pills the cell renders, in layout order. */
|
|
76
|
+
visible: ReadonlyArray<MonthCellPill<TMeta>>;
|
|
77
|
+
/** Pills folded into the "+N" marker. `0` = no marker. */
|
|
78
|
+
hidden: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Cap a cell's pills at `limit`. A non-finite or negative limit
|
|
82
|
+
* means "no cap". Pure — the same input always yields the same
|
|
83
|
+
* split, so the marker count is stable across renders.
|
|
84
|
+
*/
|
|
85
|
+
export declare function capMonthCellPills<TMeta extends Record<string, unknown> = Record<string, unknown>>(pills: ReadonlyArray<MonthCellPill<TMeta>>, limit: number): MonthCellPillCap<TMeta>;
|
|
86
|
+
/** Multi-day lanes a month row shows before the rest fold into "+N". */
|
|
87
|
+
export declare const MONTH_DEFAULT_MAX_VISIBLE_LANES = 2;
|
|
88
|
+
export interface MonthRowLaneCap<TMeta extends Record<string, unknown> = Record<string, unknown>> {
|
|
89
|
+
/** Bars the row renders (lane < cap), in layout order. */
|
|
90
|
+
visible: ReadonlyArray<MonthMultiDayBar<TMeta>>;
|
|
91
|
+
/** Bars folded away (lane >= cap). */
|
|
92
|
+
hidden: ReadonlyArray<MonthMultiDayBar<TMeta>>;
|
|
93
|
+
/** Hidden bars covering each column 0..6 — feeds the cell's "+N". */
|
|
94
|
+
hiddenPerColumn: ReadonlyArray<number>;
|
|
95
|
+
/** Lanes the row actually shows. */
|
|
96
|
+
laneCount: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Cap a row's multi-day bars at `maxLanes`. `null`, a non-finite or
|
|
100
|
+
* a negative value means "no cap" (the row grows with its lanes).
|
|
101
|
+
* Lane numbers come from the first-fit interval layout, so a bar
|
|
102
|
+
* is either fully visible or fully folded — never clipped mid-row.
|
|
103
|
+
*/
|
|
104
|
+
export declare function capMonthRowLanes<TMeta extends Record<string, unknown> = Record<string, unknown>>(bars: ReadonlyArray<MonthMultiDayBar<TMeta>>, maxLanes: number | null): MonthRowLaneCap<TMeta>;
|
|
63
105
|
/**
|
|
64
106
|
* Compute the full layout for a month grid.
|
|
65
107
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthGridLayout.d.ts","sourceRoot":"","sources":["../../src/core/monthGridLayout.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"monthGridLayout.d.ts","sourceRoot":"","sources":["../../src/core/monthGridLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAiC,MAAM,YAAY,CAAC;AAIrE,MAAM,WAAW,gBAAgB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/F,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,YAAY,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5F,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B;sBACkB;IAClB,KAAK,EAAE,MA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;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7F,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAC3C,IAAI,EAAE,kBAAkB,GACvB,WAAW,CAAC,KAAK,CAAC,CAoJpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import { FormatOverrides } from './temporal';
|
|
3
|
+
import { CalendarView, ViewWindow } from './types';
|
|
4
|
+
export interface RangeLabelOptions extends FormatOverrides {
|
|
5
|
+
view: CalendarView;
|
|
6
|
+
/** The rendered window — `[start, end)` as ISO dates in the display zone. */
|
|
7
|
+
window: ViewWindow;
|
|
8
|
+
/** The builder's cursor date (day / month / year labels are cursor-based). */
|
|
9
|
+
cursor: Temporal.PlainDate;
|
|
10
|
+
locale: string;
|
|
11
|
+
}
|
|
12
|
+
/** Format the label for `view` over `window`, respecting the C6 format overrides. */
|
|
13
|
+
export declare function formatRangeLabel(opts: RangeLabelOptions): string;
|
|
14
|
+
//# sourceMappingURL=rangeLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rangeLabel.d.ts","sourceRoot":"","sources":["../../src/core/rangeLabel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAExD,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,IAAI,EAAE,YAAY,CAAC;IACnB,6EAA6E;IAC7E,MAAM,EAAE,UAAU,CAAC;IACnB,8EAA8E;IAC9E,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAqBD,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAwChE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import { DayOfWeek } from './temporal';
|
|
3
|
+
export type TimeGridAnchor = 'cursor' | 'weekStart';
|
|
4
|
+
export type TimeGridFilter = 'all' | 'workDays';
|
|
5
|
+
/** The three views that render on the time grid. */
|
|
6
|
+
export type TimeGridView = 'day' | 'week' | 'workWeek';
|
|
7
|
+
export interface TimeGridRangeSpec {
|
|
8
|
+
anchor: TimeGridAnchor;
|
|
9
|
+
/** Days from the anchor (≥ 1), or as many complete columns as fit. */
|
|
10
|
+
span: number | 'responsive';
|
|
11
|
+
filter: TimeGridFilter;
|
|
12
|
+
/** Days per page turn (≥ 1), or `'span'` = as many as are shown. */
|
|
13
|
+
step: number | 'span';
|
|
14
|
+
}
|
|
15
|
+
export declare const TIME_GRID_PRESETS: Readonly<Record<'daySingle' | 'dayMulti' | 'week' | 'workWeek', TimeGridRangeSpec>>;
|
|
16
|
+
/**
|
|
17
|
+
* The spec a view renders with. `week` / `workWeek` are fixed presets
|
|
18
|
+
* by definition; `day` honours an explicit `builder.timeGridRange(...)`
|
|
19
|
+
* and otherwise follows `dayMode`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function timeGridRangeSpecFor(view: TimeGridView, options?: {
|
|
22
|
+
dayMode?: 'single' | 'multiDay';
|
|
23
|
+
explicit?: TimeGridRangeSpec | null;
|
|
24
|
+
}): TimeGridRangeSpec;
|
|
25
|
+
export interface ResolveTimeGridRangeOptions {
|
|
26
|
+
spec: TimeGridRangeSpec;
|
|
27
|
+
cursor: Temporal.PlainDate;
|
|
28
|
+
/** 0 = Sun … 6 = Sat. Only read for the `weekStart` anchor. */
|
|
29
|
+
firstDayOfWeek: DayOfWeek;
|
|
30
|
+
/** Only read for the `workDays` filter. */
|
|
31
|
+
workDays: readonly DayOfWeek[];
|
|
32
|
+
/** The measured column count for a `'responsive'` span (≥ 1). */
|
|
33
|
+
responsiveColumns: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TimeGridRange {
|
|
36
|
+
/** First day of the (unfiltered) span — the loader window's start. */
|
|
37
|
+
start: Temporal.PlainDate;
|
|
38
|
+
/** Length of the unfiltered span in days — the loader window's length. */
|
|
39
|
+
spanDays: number;
|
|
40
|
+
/** The dates actually rendered as columns, in order. */
|
|
41
|
+
days: Temporal.PlainDate[];
|
|
42
|
+
/** Days `next` / `prev` move the cursor. */
|
|
43
|
+
stepDays: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function resolveTimeGridRange(opts: ResolveTimeGridRangeOptions): TimeGridRange;
|
|
46
|
+
/** The unfiltered span length for `spec` given the measured column count. */
|
|
47
|
+
export declare function resolveSpanDays(spec: TimeGridRangeSpec, responsiveColumns: number): number;
|
|
48
|
+
/** Days one page turn moves for `spec` whose span resolved to `spanDays`. */
|
|
49
|
+
export declare function timeGridStepDays(spec: TimeGridRangeSpec, spanDays: number): number;
|
|
50
|
+
//# sourceMappingURL=timeGridRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeGridRange.d.ts","sourceRoot":"","sources":["../../src/core/timeGridRange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,SAAS,EAAyC,MAAM,YAAY,CAAC;AAEnF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,CAAC;AAChD,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AA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;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGlF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timed-card anatomy — what the built-in Day / Week card shows, given
|
|
3
|
+
* how much of it is actually unobscured (iOS 4.0 parity).
|
|
4
|
+
*
|
|
5
|
+
* Overlapping cards form a content-aware cascade; a front card may
|
|
6
|
+
* cover most of the card behind it. When an overlapped card's width
|
|
7
|
+
* that stays visible falls below `detailMinWidth` (iOS
|
|
8
|
+
* `timedEventDetailMinimumWidth`, 112 pt), it switches to a
|
|
9
|
+
* **compact** anatomy: one end-truncated title line, no location row,
|
|
10
|
+
* no time row. Every card stays a separate tappable, draggable target.
|
|
11
|
+
* A card alone in its column is never compacted — a narrow column
|
|
12
|
+
* ellipsizes its rows instead. `detailMinWidth` of `0` disables the
|
|
13
|
+
* switch.
|
|
14
|
+
*
|
|
15
|
+
* The full anatomy grows with the card's height, using the same
|
|
16
|
+
* duration thresholds the cascade budgets for its content block:
|
|
17
|
+
* location from 34 minutes, time row from 52, a second title line
|
|
18
|
+
* from 70 (at the default 60 px per hour).
|
|
19
|
+
*
|
|
20
|
+
* Pure: no DOM, no Vue.
|
|
21
|
+
*/
|
|
22
|
+
export interface TimedCardAnatomy {
|
|
23
|
+
/** Compact policy engaged: one title line, nothing else. */
|
|
24
|
+
compact: boolean;
|
|
25
|
+
/** Title lines the card may use (clamped with an ellipsis). */
|
|
26
|
+
titleLines: 1 | 2;
|
|
27
|
+
showLocation: boolean;
|
|
28
|
+
showTime: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface TimedCardAnatomyInput {
|
|
31
|
+
/** Visible duration of the card in minutes. */
|
|
32
|
+
durationMinutes: number;
|
|
33
|
+
/**
|
|
34
|
+
* Width that stays unobscured by cards in front, in pixels. `null`
|
|
35
|
+
* when the column hasn't been measured yet (never compact then).
|
|
36
|
+
*/
|
|
37
|
+
visibleWidthPx: number | null;
|
|
38
|
+
/** iOS `timedEventDetailMinimumWidth`; `0` disables the compact switch. */
|
|
39
|
+
detailMinWidth: number;
|
|
40
|
+
/** The card shares its time with others (cascade lanes > 1). */
|
|
41
|
+
overlapped: boolean;
|
|
42
|
+
hasLocation: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const DEFAULT_TIMED_EVENT_DETAIL_MIN_WIDTH = 112;
|
|
45
|
+
export declare const COMPACT_TIMED_CARD: TimedCardAnatomy;
|
|
46
|
+
export declare function resolveTimedCardAnatomy(input: TimedCardAnatomyInput): TimedCardAnatomy;
|
|
47
|
+
//# sourceMappingURL=timedCardAnatomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timedCardAnatomy.d.ts","sourceRoot":"","sources":["../../src/core/timedCardAnatomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD,eAAO,MAAM,kBAAkB,EAAE,gBAK/B,CAAC;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,CAgBtF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Temporal } from '@js-temporal/polyfill';
|
|
2
2
|
import { DayOfWeek } from './temporal';
|
|
3
3
|
import { CalendarView, ViewWindow } from './types';
|
|
4
|
+
import { TimeGridRangeSpec } from './timeGridRange';
|
|
4
5
|
/** Default `workDays` — Mon–Fri using the 0=Sun..6=Sat convention. */
|
|
5
6
|
export declare const DEFAULT_WORK_DAYS: readonly DayOfWeek[];
|
|
6
7
|
export interface ViewWindowOptions {
|
|
@@ -20,10 +21,17 @@ export interface ViewWindowOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
timelineRangeDays?: number;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Ignored
|
|
24
|
+
* Resolved column count for a `'responsive'` time-grid span (the
|
|
25
|
+
* day view measures its container). Default 1. Ignored by views
|
|
26
|
+
* whose spec has a fixed span.
|
|
25
27
|
*/
|
|
26
28
|
dayColumnCount?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Explicit time-grid range spec for the `day` view
|
|
31
|
+
* (`builder.timeGridRange(...)`). `week` / `workWeek` are fixed
|
|
32
|
+
* presets and ignore it. Without it the day view is one column.
|
|
33
|
+
*/
|
|
34
|
+
timeGridRange?: TimeGridRangeSpec | null;
|
|
27
35
|
/** Adjacent calendar months loaded around the cursor for the continuous month surface. */
|
|
28
36
|
monthBuffer?: number;
|
|
29
37
|
/**
|
|
@@ -56,11 +64,16 @@ export declare function windowContainsDate(window: ViewWindow, date: Temporal.Pl
|
|
|
56
64
|
/**
|
|
57
65
|
* Navigate forward / backward by one logical "page" in the view.
|
|
58
66
|
*
|
|
59
|
-
* - day: ±
|
|
60
|
-
* - week: ±7 days
|
|
67
|
+
* - day: ± the rendered column count (the time-grid preset's step)
|
|
68
|
+
* - week / workWeek: ±7 days
|
|
61
69
|
* - month: ±1 month (from the cursor's calendar month)
|
|
62
70
|
* - agenda: ± agendaLengthDays
|
|
63
71
|
*
|
|
72
|
+
* The builder resolves the time-grid views through
|
|
73
|
+
* `timeGridStepDays(spec, spanDays)` so an explicit
|
|
74
|
+
* `builder.timeGridRange(...)` step applies; this function keeps the
|
|
75
|
+
* preset semantics for direct callers.
|
|
76
|
+
*
|
|
64
77
|
* Returns the new cursor for the next computeViewWindow call.
|
|
65
78
|
*/
|
|
66
79
|
export declare function navigateCursor(view: CalendarView, cursor: Temporal.PlainDate, direction: 'prev' | 'next', agendaLengthDays?: number, timelineRangeDays?: number, dayColumnCount?: number): Temporal.PlainDate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewWindow.d.ts","sourceRoot":"","sources":["../../src/core/viewWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,YAAY,CAAC;AAEzE,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,SAAS,SAAS,EAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"viewWindow.d.ts","sourceRoot":"","sources":["../../src/core/viewWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,YAAY,CAAC;AAEzE,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,SAAS,SAAS,EAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,QAAQ,CAAC,SAAS,CAA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