@super-calendar/native 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DefaultMonthEvent-BSvuJUFk.d.ts → DefaultMonthEvent-DCPDsnvq.d.ts} +10 -6
- package/dist/{DefaultMonthEvent-zDj9dHEv.d.mts → DefaultMonthEvent-DMOC5aNL.d.mts} +10 -6
- package/dist/{MonthList-Aczb2RSY.js → MonthList-CJs1vq5T.js} +81 -12
- package/dist/{MonthList-zPLklHAY.mjs → MonthList-Dn37Ezj0.mjs} +83 -14
- package/dist/index.d.mts +130 -18
- package/dist/index.d.ts +130 -18
- package/dist/index.js +799 -121
- package/dist/index.mjs +778 -125
- package/dist/picker.d.mts +1 -1
- package/dist/picker.d.ts +1 -1
- package/dist/picker.js +1 -1
- package/dist/picker.mjs +1 -1
- package/package.json +2 -2
- package/src/components/Agenda.tsx +5 -2
- package/src/components/AllDayLane.tsx +3 -2
- package/src/components/Calendar.tsx +61 -2
- package/src/components/DefaultEvent.tsx +3 -1
- package/src/components/MonthPager.tsx +12 -3
- package/src/components/MonthView.tsx +95 -8
- package/src/components/ResourceTimeline.tsx +270 -29
- package/src/components/TimeGrid.tsx +656 -97
- package/src/components/YearView.tsx +286 -0
- package/src/index.tsx +11 -1
- package/src/types.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as PartialCalendarTheme, C as RenderEvent, D as WeekdayFormat, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, S as RecurrenceRule, T as TimeGridMode, _ as EventAccessibilityLabelContext, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as darkTheme, k as CalendarThemeProvider, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RenderEventArgs, x as RecurrenceFrequency, y as EventKeyExtractor } from "./DefaultMonthEvent-DMOC5aNL.mjs";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
|
-
import { ComponentType, ReactElement } from "react";
|
|
3
|
+
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
5
|
-
import { CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useMonthGrid, weekdayFormatToken } from "@super-calendar/core";
|
|
5
|
+
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
6
6
|
import { StyleProp, ViewStyle } from "react-native";
|
|
7
|
+
//#region src/components/YearView.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
10
|
+
* text/marker inside a day cell (React Native text colour doesn't inherit).
|
|
11
|
+
*/
|
|
12
|
+
type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayText" | "eventDot";
|
|
13
|
+
/** Props for {@link YearView}, the twelve mini-month year grid. */
|
|
14
|
+
type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
15
|
+
/** Any date inside the year to render. */
|
|
16
|
+
date: Date;
|
|
17
|
+
/** Days holding at least one event get a dot. Omit for a plain year. */
|
|
18
|
+
events?: CalendarEvent<T>[];
|
|
19
|
+
weekStartsOn: WeekStartsOn;
|
|
20
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
21
|
+
hiddenDays?: number[];
|
|
22
|
+
locale?: Locale;
|
|
23
|
+
/** Highlight this date instead of the real "today". */
|
|
24
|
+
activeDate?: Date;
|
|
25
|
+
/**
|
|
26
|
+
* Smallest width a mini month may take before the grid drops a column
|
|
27
|
+
* (default 150). The grid fits 2–4 columns from the measured width.
|
|
28
|
+
*/
|
|
29
|
+
minMonthWidth?: number;
|
|
30
|
+
/** Tap a day cell (e.g. to drill into the day or month view). */
|
|
31
|
+
onPressDay?: (date: Date) => void;
|
|
32
|
+
/** Tap a month's title (e.g. to jump to that month's view). */
|
|
33
|
+
onPressMonth?: (month: Date) => void;
|
|
34
|
+
};
|
|
35
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
36
|
+
/**
|
|
37
|
+
* A year at a glance: the twelve months as compact mini grids, with today
|
|
38
|
+
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
39
|
+
* title to drill into a denser view. It's the view `Calendar` renders for
|
|
40
|
+
* `mode="year"`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* import { YearView } from "@super-calendar/native";
|
|
45
|
+
*
|
|
46
|
+
* <YearView
|
|
47
|
+
* date={new Date()}
|
|
48
|
+
* events={events}
|
|
49
|
+
* weekStartsOn={1}
|
|
50
|
+
* onPressDay={(day) => console.log(day)}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const YearView: typeof YearViewInner;
|
|
55
|
+
//#endregion
|
|
7
56
|
//#region src/components/Agenda.d.ts
|
|
8
57
|
/**
|
|
9
58
|
* The styleable parts of {@link Agenda}. Mirrors the dom renderer's slot names;
|
|
@@ -59,7 +108,7 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
59
108
|
* `styles` map; their `className` reaches the element but needs a Tailwind
|
|
60
109
|
* runtime that styles Animated components.
|
|
61
110
|
*/
|
|
62
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
111
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
63
112
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
64
113
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
65
114
|
mode: TimeGridMode;
|
|
@@ -71,6 +120,12 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
71
120
|
* precedence over `numberOfDays`. Ignored by other modes.
|
|
72
121
|
*/
|
|
73
122
|
weekEndsOn?: WeekStartsOn;
|
|
123
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
124
|
+
hiddenDays?: number[];
|
|
125
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
126
|
+
now?: Date;
|
|
127
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
128
|
+
timeZone?: string;
|
|
74
129
|
date: Date;
|
|
75
130
|
events: CalendarEvent<T>[];
|
|
76
131
|
cellHeight: SharedValue<number>;
|
|
@@ -95,9 +150,19 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
95
150
|
timeslots?: number;
|
|
96
151
|
/** Show the all-day lane above the grid. Default true. */
|
|
97
152
|
showAllDayEventCell?: boolean;
|
|
153
|
+
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
154
|
+
* false to treat weekends like any other day. */
|
|
155
|
+
highlightWeekends?: boolean;
|
|
98
156
|
/** Per-date style merged onto each day column. */
|
|
99
157
|
calendarCellStyle?: (date: Date) => StyleProp<ViewStyle>;
|
|
100
158
|
businessHours?: BusinessHours;
|
|
159
|
+
/**
|
|
160
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
161
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
162
|
+
* and your output fills the band instead. Decorative only: the
|
|
163
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
164
|
+
*/
|
|
165
|
+
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
101
166
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
102
167
|
showWeekNumber?: boolean;
|
|
103
168
|
/** Element rendered between the day header and the grid. */
|
|
@@ -154,7 +219,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
154
219
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
155
220
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
156
221
|
};
|
|
157
|
-
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, calendarCellStyle, businessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
222
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
158
223
|
/**
|
|
159
224
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
160
225
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -182,7 +247,7 @@ declare const TimeGrid: typeof TimeGridInner;
|
|
|
182
247
|
* month pager, the grid slots reach the time grid, and the agenda slots reach
|
|
183
248
|
* the schedule view; slots for views that aren't rendered are ignored.
|
|
184
249
|
*/
|
|
185
|
-
type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot;
|
|
250
|
+
type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot | YearViewSlot;
|
|
186
251
|
/** Props for the {@link Calendar} component. */
|
|
187
252
|
type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
188
253
|
events: CalendarEvent<T>[];
|
|
@@ -217,8 +282,10 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
217
282
|
* drag-to-move and drag-to-resize working while hiding the visible indicator.
|
|
218
283
|
*/
|
|
219
284
|
showDragHandle?: boolean;
|
|
220
|
-
/** Tap a day cell (month
|
|
285
|
+
/** Tap a day cell (month and year modes) — e.g. drill into the day view. */
|
|
221
286
|
onPressDay?: (date: Date) => void;
|
|
287
|
+
/** Tap a month's title in the year view — e.g. jump to that month. */
|
|
288
|
+
onPressMonth?: (month: Date) => void;
|
|
222
289
|
/** Long-press a day cell (month mode). */
|
|
223
290
|
onLongPressDay?: (date: Date) => void;
|
|
224
291
|
/** Tap the "+N more" overflow label in a month cell. */
|
|
@@ -255,6 +322,14 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
255
322
|
disableMonthEventCellPress?: boolean;
|
|
256
323
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
257
324
|
weekStartsOn?: WeekStartsOn;
|
|
325
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
326
|
+
hiddenDays?: number[];
|
|
327
|
+
/**
|
|
328
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick), e.g. a
|
|
329
|
+
* server-synced clock. Defaults to the device clock, shifted into `timeZone`
|
|
330
|
+
* when one is set so the line matches the displayed events.
|
|
331
|
+
*/
|
|
332
|
+
now?: Date;
|
|
258
333
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
259
334
|
weekdayFormat?: WeekdayFormat$1;
|
|
260
335
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
@@ -283,6 +358,13 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
283
358
|
* whole day (closed). Omit for no shading.
|
|
284
359
|
*/
|
|
285
360
|
businessHours?: BusinessHours;
|
|
361
|
+
/**
|
|
362
|
+
* Week/day grid only: render a closed-hours band's content yourself (a
|
|
363
|
+
* label, icon, pattern). The grid keeps positioning the band; when set, the
|
|
364
|
+
* themed tint is dropped and your output fills the band instead. Decorative only: the
|
|
365
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
366
|
+
*/
|
|
367
|
+
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
286
368
|
/** Stable key per event. Defaults to start-time + index. */
|
|
287
369
|
keyExtractor?: EventKeyExtractor<T>;
|
|
288
370
|
/** Partial theme merged over the defaults. */
|
|
@@ -304,6 +386,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
304
386
|
* whole-day spans) are not shown on the time grid.
|
|
305
387
|
*/
|
|
306
388
|
showAllDayEventCell?: boolean;
|
|
389
|
+
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
390
|
+
highlightWeekends?: boolean;
|
|
307
391
|
/** Show the ISO week number in the week/day header gutter. Default false. */
|
|
308
392
|
showWeekNumber?: boolean;
|
|
309
393
|
/** Prefix for the week-number label (e.g. "W"). Default "W". */
|
|
@@ -397,7 +481,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
397
481
|
* }
|
|
398
482
|
* ```
|
|
399
483
|
*/
|
|
400
|
-
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
484
|
+
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
401
485
|
//#endregion
|
|
402
486
|
//#region src/components/DefaultEvent.d.ts
|
|
403
487
|
/**
|
|
@@ -443,6 +527,19 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
443
527
|
orientation?: "horizontal" | "vertical";
|
|
444
528
|
/** The resource lanes: rows when horizontal, columns when vertical. */
|
|
445
529
|
resources: Resource[];
|
|
530
|
+
/**
|
|
531
|
+
* Cap the number of lanes shown at once; the rest sit on further pages. Pair
|
|
532
|
+
* with `resourcePage` and your own prev/next controls to page through them
|
|
533
|
+
* (like `date` drives the time axis). Omit to show every lane, sharing the
|
|
534
|
+
* available space.
|
|
535
|
+
*/
|
|
536
|
+
resourcesPerPage?: number;
|
|
537
|
+
/**
|
|
538
|
+
* The 0-based page of lanes to show when `resourcesPerPage` is set (default
|
|
539
|
+
* 0, clamped to the last page). Controlled: update it from your own paging
|
|
540
|
+
* controls.
|
|
541
|
+
*/
|
|
542
|
+
resourcePage?: number;
|
|
446
543
|
/** Events; each is placed in the row named by `resourceId(event)`. */
|
|
447
544
|
events: CalendarEvent$1<T>[];
|
|
448
545
|
/** Read an event's resource id. Default: `event.resourceId`. */
|
|
@@ -471,11 +568,14 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
471
568
|
*/
|
|
472
569
|
onLongPressEvent?: (event: CalendarEvent$1<T>) => void;
|
|
473
570
|
/**
|
|
474
|
-
* Enables drag-to-move and edge-resize
|
|
475
|
-
*
|
|
476
|
-
* start/end
|
|
571
|
+
* Enables drag-to-move and edge-resize: long-press a bar to move it along the
|
|
572
|
+
* time axis or across lanes, or drag its trailing edge to resize. Called with
|
|
573
|
+
* the proposed new start/end and the lane the bar was dropped in (the original
|
|
574
|
+
* lane when it didn't cross); retarget the event's resource from it. Return
|
|
575
|
+
* `false` to reject the drop (it snaps back). Only visible lanes are drop
|
|
576
|
+
* targets (see `resourcesPerPage`).
|
|
477
577
|
*/
|
|
478
|
-
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
578
|
+
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date, resource: Resource) => void | boolean;
|
|
479
579
|
/** Tap empty lane space; called with the snapped time and the lane's resource. */
|
|
480
580
|
onPressCell?: (at: Date, resource: Resource) => void;
|
|
481
581
|
/**
|
|
@@ -493,12 +593,24 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
493
593
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
494
594
|
* (return `null` for a fully closed lane). A date-only function is accepted.
|
|
495
595
|
*/
|
|
496
|
-
businessHours?: (date: Date, resource: Resource) =>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
596
|
+
businessHours?: (date: Date, resource: Resource) => BusinessHoursValue;
|
|
597
|
+
/**
|
|
598
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern). The
|
|
599
|
+
* board keeps positioning the band; when set, the themed tint is dropped and
|
|
600
|
+
* your output fills the band instead. Receives the lane's resource. Decorative only: the
|
|
601
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
602
|
+
*/
|
|
603
|
+
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
604
|
+
resource: Resource;
|
|
605
|
+
}) => ReactNode;
|
|
500
606
|
/** Snap dragged events to this many minutes (default 15). */
|
|
501
607
|
dragStepMinutes?: number;
|
|
608
|
+
/** Show the current-time line when `date` is today (default true). */
|
|
609
|
+
showNowIndicator?: boolean;
|
|
610
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
611
|
+
now?: Date;
|
|
612
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
613
|
+
timeZone?: string;
|
|
502
614
|
}
|
|
503
615
|
/**
|
|
504
616
|
* A horizontal resource timeline: rows are resources (rooms, people, machines)
|
|
@@ -518,6 +630,6 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
518
630
|
* />
|
|
519
631
|
* ```
|
|
520
632
|
*/
|
|
521
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, dragStepMinutes }: ResourceTimelineProps<T>): ReactElement;
|
|
633
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone }: ResourceTimelineProps<T>): ReactElement;
|
|
522
634
|
//#endregion
|
|
523
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, DEFAULT_HOUR_HEIGHT, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultEvent, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useMonthGrid, weekdayFormatToken };
|
|
635
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, DEFAULT_HOUR_HEIGHT, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultEvent, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as PartialCalendarTheme, C as RenderEvent, D as WeekdayFormat, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, S as RecurrenceRule, T as TimeGridMode, _ as EventAccessibilityLabelContext, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as darkTheme, k as CalendarThemeProvider, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RenderEventArgs, x as RecurrenceFrequency, y as EventKeyExtractor } from "./DefaultMonthEvent-DCPDsnvq.js";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
|
-
import { ComponentType, ReactElement } from "react";
|
|
3
|
+
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { StyleProp, ViewStyle } from "react-native";
|
|
5
5
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
6
|
-
import { CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useMonthGrid, weekdayFormatToken } from "@super-calendar/core";
|
|
6
|
+
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
7
|
+
//#region src/components/YearView.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
10
|
+
* text/marker inside a day cell (React Native text colour doesn't inherit).
|
|
11
|
+
*/
|
|
12
|
+
type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayText" | "eventDot";
|
|
13
|
+
/** Props for {@link YearView}, the twelve mini-month year grid. */
|
|
14
|
+
type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
15
|
+
/** Any date inside the year to render. */
|
|
16
|
+
date: Date;
|
|
17
|
+
/** Days holding at least one event get a dot. Omit for a plain year. */
|
|
18
|
+
events?: CalendarEvent<T>[];
|
|
19
|
+
weekStartsOn: WeekStartsOn;
|
|
20
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
21
|
+
hiddenDays?: number[];
|
|
22
|
+
locale?: Locale;
|
|
23
|
+
/** Highlight this date instead of the real "today". */
|
|
24
|
+
activeDate?: Date;
|
|
25
|
+
/**
|
|
26
|
+
* Smallest width a mini month may take before the grid drops a column
|
|
27
|
+
* (default 150). The grid fits 2–4 columns from the measured width.
|
|
28
|
+
*/
|
|
29
|
+
minMonthWidth?: number;
|
|
30
|
+
/** Tap a day cell (e.g. to drill into the day or month view). */
|
|
31
|
+
onPressDay?: (date: Date) => void;
|
|
32
|
+
/** Tap a month's title (e.g. to jump to that month's view). */
|
|
33
|
+
onPressMonth?: (month: Date) => void;
|
|
34
|
+
};
|
|
35
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
36
|
+
/**
|
|
37
|
+
* A year at a glance: the twelve months as compact mini grids, with today
|
|
38
|
+
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
39
|
+
* title to drill into a denser view. It's the view `Calendar` renders for
|
|
40
|
+
* `mode="year"`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* import { YearView } from "@super-calendar/native";
|
|
45
|
+
*
|
|
46
|
+
* <YearView
|
|
47
|
+
* date={new Date()}
|
|
48
|
+
* events={events}
|
|
49
|
+
* weekStartsOn={1}
|
|
50
|
+
* onPressDay={(day) => console.log(day)}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const YearView: typeof YearViewInner;
|
|
55
|
+
//#endregion
|
|
7
56
|
//#region src/components/Agenda.d.ts
|
|
8
57
|
/**
|
|
9
58
|
* The styleable parts of {@link Agenda}. Mirrors the dom renderer's slot names;
|
|
@@ -59,7 +108,7 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
59
108
|
* `styles` map; their `className` reaches the element but needs a Tailwind
|
|
60
109
|
* runtime that styles Animated components.
|
|
61
110
|
*/
|
|
62
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
111
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
63
112
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
64
113
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
65
114
|
mode: TimeGridMode;
|
|
@@ -71,6 +120,12 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
71
120
|
* precedence over `numberOfDays`. Ignored by other modes.
|
|
72
121
|
*/
|
|
73
122
|
weekEndsOn?: WeekStartsOn;
|
|
123
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
124
|
+
hiddenDays?: number[];
|
|
125
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
126
|
+
now?: Date;
|
|
127
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
128
|
+
timeZone?: string;
|
|
74
129
|
date: Date;
|
|
75
130
|
events: CalendarEvent<T>[];
|
|
76
131
|
cellHeight: SharedValue<number>;
|
|
@@ -95,9 +150,19 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
95
150
|
timeslots?: number;
|
|
96
151
|
/** Show the all-day lane above the grid. Default true. */
|
|
97
152
|
showAllDayEventCell?: boolean;
|
|
153
|
+
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
154
|
+
* false to treat weekends like any other day. */
|
|
155
|
+
highlightWeekends?: boolean;
|
|
98
156
|
/** Per-date style merged onto each day column. */
|
|
99
157
|
calendarCellStyle?: (date: Date) => StyleProp<ViewStyle>;
|
|
100
158
|
businessHours?: BusinessHours;
|
|
159
|
+
/**
|
|
160
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
161
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
162
|
+
* and your output fills the band instead. Decorative only: the
|
|
163
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
164
|
+
*/
|
|
165
|
+
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
101
166
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
102
167
|
showWeekNumber?: boolean;
|
|
103
168
|
/** Element rendered between the day header and the grid. */
|
|
@@ -154,7 +219,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
154
219
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
155
220
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
156
221
|
};
|
|
157
|
-
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, calendarCellStyle, businessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
222
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
158
223
|
/**
|
|
159
224
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
160
225
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -182,7 +247,7 @@ declare const TimeGrid: typeof TimeGridInner;
|
|
|
182
247
|
* month pager, the grid slots reach the time grid, and the agenda slots reach
|
|
183
248
|
* the schedule view; slots for views that aren't rendered are ignored.
|
|
184
249
|
*/
|
|
185
|
-
type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot;
|
|
250
|
+
type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot | YearViewSlot;
|
|
186
251
|
/** Props for the {@link Calendar} component. */
|
|
187
252
|
type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
188
253
|
events: CalendarEvent<T>[];
|
|
@@ -217,8 +282,10 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
217
282
|
* drag-to-move and drag-to-resize working while hiding the visible indicator.
|
|
218
283
|
*/
|
|
219
284
|
showDragHandle?: boolean;
|
|
220
|
-
/** Tap a day cell (month
|
|
285
|
+
/** Tap a day cell (month and year modes) — e.g. drill into the day view. */
|
|
221
286
|
onPressDay?: (date: Date) => void;
|
|
287
|
+
/** Tap a month's title in the year view — e.g. jump to that month. */
|
|
288
|
+
onPressMonth?: (month: Date) => void;
|
|
222
289
|
/** Long-press a day cell (month mode). */
|
|
223
290
|
onLongPressDay?: (date: Date) => void;
|
|
224
291
|
/** Tap the "+N more" overflow label in a month cell. */
|
|
@@ -255,6 +322,14 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
255
322
|
disableMonthEventCellPress?: boolean;
|
|
256
323
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
257
324
|
weekStartsOn?: WeekStartsOn;
|
|
325
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
326
|
+
hiddenDays?: number[];
|
|
327
|
+
/**
|
|
328
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick), e.g. a
|
|
329
|
+
* server-synced clock. Defaults to the device clock, shifted into `timeZone`
|
|
330
|
+
* when one is set so the line matches the displayed events.
|
|
331
|
+
*/
|
|
332
|
+
now?: Date;
|
|
258
333
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
259
334
|
weekdayFormat?: WeekdayFormat$1;
|
|
260
335
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
@@ -283,6 +358,13 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
283
358
|
* whole day (closed). Omit for no shading.
|
|
284
359
|
*/
|
|
285
360
|
businessHours?: BusinessHours;
|
|
361
|
+
/**
|
|
362
|
+
* Week/day grid only: render a closed-hours band's content yourself (a
|
|
363
|
+
* label, icon, pattern). The grid keeps positioning the band; when set, the
|
|
364
|
+
* themed tint is dropped and your output fills the band instead. Decorative only: the
|
|
365
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
366
|
+
*/
|
|
367
|
+
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
286
368
|
/** Stable key per event. Defaults to start-time + index. */
|
|
287
369
|
keyExtractor?: EventKeyExtractor<T>;
|
|
288
370
|
/** Partial theme merged over the defaults. */
|
|
@@ -304,6 +386,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
304
386
|
* whole-day spans) are not shown on the time grid.
|
|
305
387
|
*/
|
|
306
388
|
showAllDayEventCell?: boolean;
|
|
389
|
+
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
390
|
+
highlightWeekends?: boolean;
|
|
307
391
|
/** Show the ISO week number in the week/day header gutter. Default false. */
|
|
308
392
|
showWeekNumber?: boolean;
|
|
309
393
|
/** Prefix for the week-number label (e.g. "W"). Default "W". */
|
|
@@ -397,7 +481,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
397
481
|
* }
|
|
398
482
|
* ```
|
|
399
483
|
*/
|
|
400
|
-
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
484
|
+
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
401
485
|
//#endregion
|
|
402
486
|
//#region src/components/DefaultEvent.d.ts
|
|
403
487
|
/**
|
|
@@ -443,6 +527,19 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
443
527
|
orientation?: "horizontal" | "vertical";
|
|
444
528
|
/** The resource lanes: rows when horizontal, columns when vertical. */
|
|
445
529
|
resources: Resource[];
|
|
530
|
+
/**
|
|
531
|
+
* Cap the number of lanes shown at once; the rest sit on further pages. Pair
|
|
532
|
+
* with `resourcePage` and your own prev/next controls to page through them
|
|
533
|
+
* (like `date` drives the time axis). Omit to show every lane, sharing the
|
|
534
|
+
* available space.
|
|
535
|
+
*/
|
|
536
|
+
resourcesPerPage?: number;
|
|
537
|
+
/**
|
|
538
|
+
* The 0-based page of lanes to show when `resourcesPerPage` is set (default
|
|
539
|
+
* 0, clamped to the last page). Controlled: update it from your own paging
|
|
540
|
+
* controls.
|
|
541
|
+
*/
|
|
542
|
+
resourcePage?: number;
|
|
446
543
|
/** Events; each is placed in the row named by `resourceId(event)`. */
|
|
447
544
|
events: CalendarEvent$1<T>[];
|
|
448
545
|
/** Read an event's resource id. Default: `event.resourceId`. */
|
|
@@ -471,11 +568,14 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
471
568
|
*/
|
|
472
569
|
onLongPressEvent?: (event: CalendarEvent$1<T>) => void;
|
|
473
570
|
/**
|
|
474
|
-
* Enables drag-to-move and edge-resize
|
|
475
|
-
*
|
|
476
|
-
* start/end
|
|
571
|
+
* Enables drag-to-move and edge-resize: long-press a bar to move it along the
|
|
572
|
+
* time axis or across lanes, or drag its trailing edge to resize. Called with
|
|
573
|
+
* the proposed new start/end and the lane the bar was dropped in (the original
|
|
574
|
+
* lane when it didn't cross); retarget the event's resource from it. Return
|
|
575
|
+
* `false` to reject the drop (it snaps back). Only visible lanes are drop
|
|
576
|
+
* targets (see `resourcesPerPage`).
|
|
477
577
|
*/
|
|
478
|
-
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
578
|
+
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date, resource: Resource) => void | boolean;
|
|
479
579
|
/** Tap empty lane space; called with the snapped time and the lane's resource. */
|
|
480
580
|
onPressCell?: (at: Date, resource: Resource) => void;
|
|
481
581
|
/**
|
|
@@ -493,12 +593,24 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
493
593
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
494
594
|
* (return `null` for a fully closed lane). A date-only function is accepted.
|
|
495
595
|
*/
|
|
496
|
-
businessHours?: (date: Date, resource: Resource) =>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
596
|
+
businessHours?: (date: Date, resource: Resource) => BusinessHoursValue;
|
|
597
|
+
/**
|
|
598
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern). The
|
|
599
|
+
* board keeps positioning the band; when set, the themed tint is dropped and
|
|
600
|
+
* your output fills the band instead. Receives the lane's resource. Decorative only: the
|
|
601
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
602
|
+
*/
|
|
603
|
+
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
604
|
+
resource: Resource;
|
|
605
|
+
}) => ReactNode;
|
|
500
606
|
/** Snap dragged events to this many minutes (default 15). */
|
|
501
607
|
dragStepMinutes?: number;
|
|
608
|
+
/** Show the current-time line when `date` is today (default true). */
|
|
609
|
+
showNowIndicator?: boolean;
|
|
610
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
611
|
+
now?: Date;
|
|
612
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
613
|
+
timeZone?: string;
|
|
502
614
|
}
|
|
503
615
|
/**
|
|
504
616
|
* A horizontal resource timeline: rows are resources (rooms, people, machines)
|
|
@@ -518,6 +630,6 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
518
630
|
* />
|
|
519
631
|
* ```
|
|
520
632
|
*/
|
|
521
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, dragStepMinutes }: ResourceTimelineProps<T>): ReactElement;
|
|
633
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone }: ResourceTimelineProps<T>): ReactElement;
|
|
522
634
|
//#endregion
|
|
523
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, DEFAULT_HOUR_HEIGHT, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultEvent, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useMonthGrid, weekdayFormatToken };
|
|
635
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, DEFAULT_HOUR_HEIGHT, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultEvent, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|