@super-calendar/dom 2.6.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/index.d.mts +84 -15
- package/dist/index.d.ts +84 -15
- package/dist/index.js +571 -118
- package/dist/index.mjs +549 -120
- package/package.json +2 -2
- package/src/Agenda.tsx +5 -2
- package/src/Calendar.tsx +30 -0
- package/src/MonthList.tsx +3 -1
- package/src/MonthView.tsx +135 -3
- package/src/ResourceTimeline.tsx +269 -20
- package/src/TimeGrid.tsx +364 -80
- package/src/YearView.tsx +14 -4
- package/src/index.ts +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { CSSProperties, ComponentType, ReactElement, ReactNode } from "react";
|
|
3
|
-
import { BusinessHours, BusinessHours as BusinessHours$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken } from "@super-calendar/core";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
4
4
|
//#region src/slots.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Per-slot styling overrides. Give a slot a Tailwind/CSS class and/or an inline
|
|
@@ -136,6 +136,8 @@ interface YearViewProps<T = unknown> extends SlotStyleProps<YearViewSlot> {
|
|
|
136
136
|
events?: CalendarEvent$1<T>[];
|
|
137
137
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
138
138
|
weekStartsOn?: WeekStartsOn$1;
|
|
139
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
140
|
+
hiddenDays?: number[];
|
|
139
141
|
locale?: Locale;
|
|
140
142
|
/** Highlight this date instead of the real "today". */
|
|
141
143
|
activeDate?: Date;
|
|
@@ -160,14 +162,14 @@ interface YearViewProps<T = unknown> extends SlotStyleProps<YearViewSlot> {
|
|
|
160
162
|
* highlighted and a dot under days that hold events. It's the view `Calendar`
|
|
161
163
|
* renders for `mode="year"`.
|
|
162
164
|
*/
|
|
163
|
-
declare function YearView<T = unknown>({ date, events, weekStartsOn, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, theme: themeOverrides, className, style, classNames, styles }: YearViewProps<T>): ReactElement;
|
|
165
|
+
declare function YearView<T = unknown>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, theme: themeOverrides, className, style, classNames, styles }: YearViewProps<T>): ReactElement;
|
|
164
166
|
//#endregion
|
|
165
167
|
//#region src/MonthView.d.ts
|
|
166
168
|
/**
|
|
167
169
|
* Styleable parts of {@link MonthView}. Pass a class or inline style per slot via
|
|
168
170
|
* the `classNames` / `styles` props to restyle just that part.
|
|
169
171
|
*/
|
|
170
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "rangeBand" | "events" | "chipButton" | "chip" | "more";
|
|
172
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "rangeBand" | "events" | "chipButton" | "chip" | "more" | "morePopover";
|
|
171
173
|
/** Props passed to a custom month event chip renderer. */
|
|
172
174
|
interface DomMonthEventArgs<T = unknown> {
|
|
173
175
|
/** The event to render. */
|
|
@@ -183,6 +185,8 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
183
185
|
date: Date;
|
|
184
186
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
185
187
|
weekStartsOn?: WeekStartsOn$1;
|
|
188
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
189
|
+
hiddenDays?: number[];
|
|
186
190
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
187
191
|
weekdayFormat?: WeekdayFormat$1;
|
|
188
192
|
/**
|
|
@@ -259,14 +263,14 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
259
263
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
260
264
|
* ```
|
|
261
265
|
*/
|
|
262
|
-
declare function MonthView<T = unknown>({ date, weekStartsOn, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
266
|
+
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
263
267
|
//#endregion
|
|
264
268
|
//#region src/TimeGrid.d.ts
|
|
265
269
|
/**
|
|
266
270
|
* Styleable parts of {@link TimeGrid}. Pass a class or inline style per slot via
|
|
267
271
|
* the `classNames` / `styles` props.
|
|
268
272
|
*/
|
|
269
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "dayColumn" | "gridLines" | "businessHours" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
273
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "dayColumn" | "gridLines" | "businessHours" | "backgroundEvent" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
270
274
|
/** Props passed to a custom time-grid event renderer. */
|
|
271
275
|
interface DomRenderEventArgs<T = unknown> {
|
|
272
276
|
/** The event to render. */
|
|
@@ -328,12 +332,28 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
328
332
|
showWeekNumber?: boolean;
|
|
329
333
|
/** Prefix for the week number, e.g. "W" → "W28". Default "W". */
|
|
330
334
|
weekNumberPrefix?: string;
|
|
335
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
336
|
+
hiddenDays?: number[];
|
|
331
337
|
/** Shade the hours outside business hours; `null` shades the whole day. */
|
|
332
338
|
businessHours?: BusinessHours$1;
|
|
339
|
+
/**
|
|
340
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
341
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
342
|
+
* and your output fills the band instead. Decorative only: the
|
|
343
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
344
|
+
*/
|
|
345
|
+
renderBusinessHours?: (band: BusinessHoursBand$1) => ReactNode;
|
|
333
346
|
/** Show the current-time indicator on today's column (default true). */
|
|
334
347
|
showNowIndicator?: boolean;
|
|
348
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
349
|
+
now?: Date;
|
|
350
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
351
|
+
timeZone?: string;
|
|
335
352
|
/** Show the all-day lane above the grid (default true). */
|
|
336
353
|
showAllDayEventCell?: boolean;
|
|
354
|
+
/** Tint Saturday/Sunday columns with the weekend background (default true). Set
|
|
355
|
+
* false to treat weekends like any other day. */
|
|
356
|
+
highlightWeekends?: boolean;
|
|
337
357
|
/** date-fns locale for the column headers and time labels. */
|
|
338
358
|
locale?: Locale;
|
|
339
359
|
/** Theme overrides; falls back to the default light theme. */
|
|
@@ -374,6 +394,13 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
374
394
|
* Return `false` to reject the drop (the event snaps back).
|
|
375
395
|
*/
|
|
376
396
|
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Page the grid to a new anchor date. Supplying it alongside `onDragEvent`
|
|
399
|
+
* turns on edge auto-advance: dragging an event to the left/right edge and
|
|
400
|
+
* dwelling briefly pages the view so the event can be dropped on a day in the
|
|
401
|
+
* previous/next period. Controlled, like the native renderer's `onChangeDate`.
|
|
402
|
+
*/
|
|
403
|
+
onChangeDate?: (date: Date) => void;
|
|
377
404
|
/** Class applied to the root element. */
|
|
378
405
|
className?: string;
|
|
379
406
|
/** Inline styles applied to the root element. */
|
|
@@ -390,7 +417,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
390
417
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
391
418
|
* ```
|
|
392
419
|
*/
|
|
393
|
-
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, keyboardEventNavigation, businessHours, showNowIndicator, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
420
|
+
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
394
421
|
//#endregion
|
|
395
422
|
//#region src/Calendar.d.ts
|
|
396
423
|
/**
|
|
@@ -419,6 +446,14 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
419
446
|
events?: CalendarEvent$1<T>[];
|
|
420
447
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
421
448
|
weekStartsOn?: WeekStartsOn$1;
|
|
449
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
450
|
+
hiddenDays?: number[];
|
|
451
|
+
/**
|
|
452
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick), e.g. a
|
|
453
|
+
* server-synced clock. Defaults to the device clock, shifted into `timeZone`
|
|
454
|
+
* when one is set so the line matches the displayed events.
|
|
455
|
+
*/
|
|
456
|
+
now?: Date;
|
|
422
457
|
/** Column count for `mode="custom"`. */
|
|
423
458
|
numberOfDays?: number;
|
|
424
459
|
/** date-fns locale for titles, headers, and time labels. */
|
|
@@ -465,10 +500,19 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
465
500
|
weekNumberPrefix?: string;
|
|
466
501
|
/** Shade the hours outside business hours. */
|
|
467
502
|
businessHours?: BusinessHours$1;
|
|
503
|
+
/**
|
|
504
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
505
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
506
|
+
* and your output fills the band instead. Decorative only: the
|
|
507
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
508
|
+
*/
|
|
509
|
+
renderBusinessHours?: (band: BusinessHoursBand$1) => ReactNode;
|
|
468
510
|
/** Show the current-time indicator (default true). */
|
|
469
511
|
showNowIndicator?: boolean;
|
|
470
512
|
/** Show the all-day lane (default true). */
|
|
471
513
|
showAllDayEventCell?: boolean;
|
|
514
|
+
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
515
|
+
highlightWeekends?: boolean;
|
|
472
516
|
/** Snap dragged/created events to this many minutes. */
|
|
473
517
|
dragStepMinutes?: number;
|
|
474
518
|
/** Tap empty grid space. */
|
|
@@ -532,7 +576,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
532
576
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
533
577
|
* ```
|
|
534
578
|
*/
|
|
535
|
-
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, showNowIndicator, showAllDayEventCell, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
579
|
+
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
536
580
|
//#endregion
|
|
537
581
|
//#region src/MonthList.d.ts
|
|
538
582
|
/**
|
|
@@ -670,7 +714,7 @@ declare function DateRangePicker({ value, onChange, formatLabel, weekStartsOn, h
|
|
|
670
714
|
* Styleable parts of {@link ResourceTimeline}. Pass a class or inline style per
|
|
671
715
|
* slot via the `classNames` / `styles` props.
|
|
672
716
|
*/
|
|
673
|
-
type ResourceTimelineSlot = "header" | "corner" | "timeAxis" | "hourTick" | "resourceLabel" | "row" | "track" | "gridLines" | "businessHours" | "event" | "eventBox" | "createGhost";
|
|
717
|
+
type ResourceTimelineSlot = "header" | "corner" | "timeAxis" | "hourTick" | "resourceLabel" | "row" | "track" | "gridLines" | "businessHours" | "backgroundEvent" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
674
718
|
/** A schedulable lane (room, person, machine) that events are grouped under. */
|
|
675
719
|
interface Resource {
|
|
676
720
|
/** Stable id events reference via their `resourceId`. */
|
|
@@ -703,6 +747,19 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
703
747
|
orientation?: "horizontal" | "vertical";
|
|
704
748
|
/** The resource lanes: rows when horizontal, columns when vertical. */
|
|
705
749
|
resources: Resource[];
|
|
750
|
+
/**
|
|
751
|
+
* Cap the number of lanes shown at once; the rest sit on further pages. Pair
|
|
752
|
+
* with `resourcePage` and your own prev/next controls to page through them
|
|
753
|
+
* (like `date` drives the time axis). Omit to show every lane, sharing the
|
|
754
|
+
* available space.
|
|
755
|
+
*/
|
|
756
|
+
resourcesPerPage?: number;
|
|
757
|
+
/**
|
|
758
|
+
* The 0-based page of lanes to show when `resourcesPerPage` is set (default
|
|
759
|
+
* 0, clamped to the last page). Controlled: update it from your own paging
|
|
760
|
+
* controls.
|
|
761
|
+
*/
|
|
762
|
+
resourcePage?: number;
|
|
706
763
|
/** Events; each is placed in the row named by `resourceId(event)`. */
|
|
707
764
|
events: CalendarEvent$1<T>[];
|
|
708
765
|
/** Read an event's resource id. Default: `event.resourceId`. */
|
|
@@ -731,7 +788,7 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
731
788
|
* Enables drag-to-move and edge-resize along the time axis; called with the
|
|
732
789
|
* proposed new start/end. Return `false` to reject the drop (it snaps back).
|
|
733
790
|
*/
|
|
734
|
-
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
791
|
+
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date, resource: Resource) => void | boolean;
|
|
735
792
|
/** Tap empty lane space; called with the snapped time and the lane's resource. */
|
|
736
793
|
onPressCell?: (at: Date, resource: Resource) => void;
|
|
737
794
|
/** Drag empty lane space to create; called with the swept start/end and the lane's resource. */
|
|
@@ -741,12 +798,24 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
741
798
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
742
799
|
* (return `null` for a fully closed lane). A date-only function is accepted.
|
|
743
800
|
*/
|
|
744
|
-
businessHours?: (date: Date, resource: Resource) =>
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
801
|
+
businessHours?: (date: Date, resource: Resource) => BusinessHoursValue;
|
|
802
|
+
/**
|
|
803
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern). The
|
|
804
|
+
* board keeps positioning the band; when set, the themed tint is dropped and
|
|
805
|
+
* your output fills the band instead. Receives the lane's resource. Decorative only: the
|
|
806
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
807
|
+
*/
|
|
808
|
+
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
809
|
+
resource: Resource;
|
|
810
|
+
}) => ReactNode;
|
|
748
811
|
/** Snap dragged events to this many minutes (default 15). */
|
|
749
812
|
dragStepMinutes?: number;
|
|
813
|
+
/** Show the current-time line when `date` is today (default true). */
|
|
814
|
+
showNowIndicator?: boolean;
|
|
815
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
816
|
+
now?: Date;
|
|
817
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
818
|
+
timeZone?: string;
|
|
750
819
|
/** Class applied to the root element. */
|
|
751
820
|
className?: string;
|
|
752
821
|
/** Inline styles applied to the root element. */
|
|
@@ -768,6 +837,6 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
768
837
|
* />
|
|
769
838
|
* ```
|
|
770
839
|
*/
|
|
771
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, dragStepMinutes, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
840
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
772
841
|
//#endregion
|
|
773
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, 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, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken };
|
|
842
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, 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, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { CSSProperties, ComponentType, ReactElement, ReactNode } from "react";
|
|
3
|
-
import { BusinessHours, BusinessHours as BusinessHours$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken } from "@super-calendar/core";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
4
4
|
//#region src/slots.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Per-slot styling overrides. Give a slot a Tailwind/CSS class and/or an inline
|
|
@@ -136,6 +136,8 @@ interface YearViewProps<T = unknown> extends SlotStyleProps<YearViewSlot> {
|
|
|
136
136
|
events?: CalendarEvent$1<T>[];
|
|
137
137
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
138
138
|
weekStartsOn?: WeekStartsOn$1;
|
|
139
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
140
|
+
hiddenDays?: number[];
|
|
139
141
|
locale?: Locale;
|
|
140
142
|
/** Highlight this date instead of the real "today". */
|
|
141
143
|
activeDate?: Date;
|
|
@@ -160,14 +162,14 @@ interface YearViewProps<T = unknown> extends SlotStyleProps<YearViewSlot> {
|
|
|
160
162
|
* highlighted and a dot under days that hold events. It's the view `Calendar`
|
|
161
163
|
* renders for `mode="year"`.
|
|
162
164
|
*/
|
|
163
|
-
declare function YearView<T = unknown>({ date, events, weekStartsOn, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, theme: themeOverrides, className, style, classNames, styles }: YearViewProps<T>): ReactElement;
|
|
165
|
+
declare function YearView<T = unknown>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, theme: themeOverrides, className, style, classNames, styles }: YearViewProps<T>): ReactElement;
|
|
164
166
|
//#endregion
|
|
165
167
|
//#region src/MonthView.d.ts
|
|
166
168
|
/**
|
|
167
169
|
* Styleable parts of {@link MonthView}. Pass a class or inline style per slot via
|
|
168
170
|
* the `classNames` / `styles` props to restyle just that part.
|
|
169
171
|
*/
|
|
170
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "rangeBand" | "events" | "chipButton" | "chip" | "more";
|
|
172
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "rangeBand" | "events" | "chipButton" | "chip" | "more" | "morePopover";
|
|
171
173
|
/** Props passed to a custom month event chip renderer. */
|
|
172
174
|
interface DomMonthEventArgs<T = unknown> {
|
|
173
175
|
/** The event to render. */
|
|
@@ -183,6 +185,8 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
183
185
|
date: Date;
|
|
184
186
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
185
187
|
weekStartsOn?: WeekStartsOn$1;
|
|
188
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
189
|
+
hiddenDays?: number[];
|
|
186
190
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
187
191
|
weekdayFormat?: WeekdayFormat$1;
|
|
188
192
|
/**
|
|
@@ -259,14 +263,14 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
259
263
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
260
264
|
* ```
|
|
261
265
|
*/
|
|
262
|
-
declare function MonthView<T = unknown>({ date, weekStartsOn, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
266
|
+
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
263
267
|
//#endregion
|
|
264
268
|
//#region src/TimeGrid.d.ts
|
|
265
269
|
/**
|
|
266
270
|
* Styleable parts of {@link TimeGrid}. Pass a class or inline style per slot via
|
|
267
271
|
* the `classNames` / `styles` props.
|
|
268
272
|
*/
|
|
269
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "dayColumn" | "gridLines" | "businessHours" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
273
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "dayColumn" | "gridLines" | "businessHours" | "backgroundEvent" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
270
274
|
/** Props passed to a custom time-grid event renderer. */
|
|
271
275
|
interface DomRenderEventArgs<T = unknown> {
|
|
272
276
|
/** The event to render. */
|
|
@@ -328,12 +332,28 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
328
332
|
showWeekNumber?: boolean;
|
|
329
333
|
/** Prefix for the week number, e.g. "W" → "W28". Default "W". */
|
|
330
334
|
weekNumberPrefix?: string;
|
|
335
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
336
|
+
hiddenDays?: number[];
|
|
331
337
|
/** Shade the hours outside business hours; `null` shades the whole day. */
|
|
332
338
|
businessHours?: BusinessHours$1;
|
|
339
|
+
/**
|
|
340
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
341
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
342
|
+
* and your output fills the band instead. Decorative only: the
|
|
343
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
344
|
+
*/
|
|
345
|
+
renderBusinessHours?: (band: BusinessHoursBand$1) => ReactNode;
|
|
333
346
|
/** Show the current-time indicator on today's column (default true). */
|
|
334
347
|
showNowIndicator?: boolean;
|
|
348
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
349
|
+
now?: Date;
|
|
350
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
351
|
+
timeZone?: string;
|
|
335
352
|
/** Show the all-day lane above the grid (default true). */
|
|
336
353
|
showAllDayEventCell?: boolean;
|
|
354
|
+
/** Tint Saturday/Sunday columns with the weekend background (default true). Set
|
|
355
|
+
* false to treat weekends like any other day. */
|
|
356
|
+
highlightWeekends?: boolean;
|
|
337
357
|
/** date-fns locale for the column headers and time labels. */
|
|
338
358
|
locale?: Locale;
|
|
339
359
|
/** Theme overrides; falls back to the default light theme. */
|
|
@@ -374,6 +394,13 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
374
394
|
* Return `false` to reject the drop (the event snaps back).
|
|
375
395
|
*/
|
|
376
396
|
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Page the grid to a new anchor date. Supplying it alongside `onDragEvent`
|
|
399
|
+
* turns on edge auto-advance: dragging an event to the left/right edge and
|
|
400
|
+
* dwelling briefly pages the view so the event can be dropped on a day in the
|
|
401
|
+
* previous/next period. Controlled, like the native renderer's `onChangeDate`.
|
|
402
|
+
*/
|
|
403
|
+
onChangeDate?: (date: Date) => void;
|
|
377
404
|
/** Class applied to the root element. */
|
|
378
405
|
className?: string;
|
|
379
406
|
/** Inline styles applied to the root element. */
|
|
@@ -390,7 +417,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
390
417
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
391
418
|
* ```
|
|
392
419
|
*/
|
|
393
|
-
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, keyboardEventNavigation, businessHours, showNowIndicator, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
420
|
+
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
394
421
|
//#endregion
|
|
395
422
|
//#region src/Calendar.d.ts
|
|
396
423
|
/**
|
|
@@ -419,6 +446,14 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
419
446
|
events?: CalendarEvent$1<T>[];
|
|
420
447
|
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
421
448
|
weekStartsOn?: WeekStartsOn$1;
|
|
449
|
+
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
450
|
+
hiddenDays?: number[];
|
|
451
|
+
/**
|
|
452
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick), e.g. a
|
|
453
|
+
* server-synced clock. Defaults to the device clock, shifted into `timeZone`
|
|
454
|
+
* when one is set so the line matches the displayed events.
|
|
455
|
+
*/
|
|
456
|
+
now?: Date;
|
|
422
457
|
/** Column count for `mode="custom"`. */
|
|
423
458
|
numberOfDays?: number;
|
|
424
459
|
/** date-fns locale for titles, headers, and time labels. */
|
|
@@ -465,10 +500,19 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
465
500
|
weekNumberPrefix?: string;
|
|
466
501
|
/** Shade the hours outside business hours. */
|
|
467
502
|
businessHours?: BusinessHours$1;
|
|
503
|
+
/**
|
|
504
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern).
|
|
505
|
+
* The grid keeps positioning the band; when set, the themed tint is dropped
|
|
506
|
+
* and your output fills the band instead. Decorative only: the
|
|
507
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
508
|
+
*/
|
|
509
|
+
renderBusinessHours?: (band: BusinessHoursBand$1) => ReactNode;
|
|
468
510
|
/** Show the current-time indicator (default true). */
|
|
469
511
|
showNowIndicator?: boolean;
|
|
470
512
|
/** Show the all-day lane (default true). */
|
|
471
513
|
showAllDayEventCell?: boolean;
|
|
514
|
+
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
515
|
+
highlightWeekends?: boolean;
|
|
472
516
|
/** Snap dragged/created events to this many minutes. */
|
|
473
517
|
dragStepMinutes?: number;
|
|
474
518
|
/** Tap empty grid space. */
|
|
@@ -532,7 +576,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
532
576
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
533
577
|
* ```
|
|
534
578
|
*/
|
|
535
|
-
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, showNowIndicator, showAllDayEventCell, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
579
|
+
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
536
580
|
//#endregion
|
|
537
581
|
//#region src/MonthList.d.ts
|
|
538
582
|
/**
|
|
@@ -670,7 +714,7 @@ declare function DateRangePicker({ value, onChange, formatLabel, weekStartsOn, h
|
|
|
670
714
|
* Styleable parts of {@link ResourceTimeline}. Pass a class or inline style per
|
|
671
715
|
* slot via the `classNames` / `styles` props.
|
|
672
716
|
*/
|
|
673
|
-
type ResourceTimelineSlot = "header" | "corner" | "timeAxis" | "hourTick" | "resourceLabel" | "row" | "track" | "gridLines" | "businessHours" | "event" | "eventBox" | "createGhost";
|
|
717
|
+
type ResourceTimelineSlot = "header" | "corner" | "timeAxis" | "hourTick" | "resourceLabel" | "row" | "track" | "gridLines" | "businessHours" | "backgroundEvent" | "event" | "eventBox" | "nowIndicator" | "createGhost";
|
|
674
718
|
/** A schedulable lane (room, person, machine) that events are grouped under. */
|
|
675
719
|
interface Resource {
|
|
676
720
|
/** Stable id events reference via their `resourceId`. */
|
|
@@ -703,6 +747,19 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
703
747
|
orientation?: "horizontal" | "vertical";
|
|
704
748
|
/** The resource lanes: rows when horizontal, columns when vertical. */
|
|
705
749
|
resources: Resource[];
|
|
750
|
+
/**
|
|
751
|
+
* Cap the number of lanes shown at once; the rest sit on further pages. Pair
|
|
752
|
+
* with `resourcePage` and your own prev/next controls to page through them
|
|
753
|
+
* (like `date` drives the time axis). Omit to show every lane, sharing the
|
|
754
|
+
* available space.
|
|
755
|
+
*/
|
|
756
|
+
resourcesPerPage?: number;
|
|
757
|
+
/**
|
|
758
|
+
* The 0-based page of lanes to show when `resourcesPerPage` is set (default
|
|
759
|
+
* 0, clamped to the last page). Controlled: update it from your own paging
|
|
760
|
+
* controls.
|
|
761
|
+
*/
|
|
762
|
+
resourcePage?: number;
|
|
706
763
|
/** Events; each is placed in the row named by `resourceId(event)`. */
|
|
707
764
|
events: CalendarEvent$1<T>[];
|
|
708
765
|
/** Read an event's resource id. Default: `event.resourceId`. */
|
|
@@ -731,7 +788,7 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
731
788
|
* Enables drag-to-move and edge-resize along the time axis; called with the
|
|
732
789
|
* proposed new start/end. Return `false` to reject the drop (it snaps back).
|
|
733
790
|
*/
|
|
734
|
-
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date) => void | boolean;
|
|
791
|
+
onDragEvent?: (event: CalendarEvent$1<T>, start: Date, end: Date, resource: Resource) => void | boolean;
|
|
735
792
|
/** Tap empty lane space; called with the snapped time and the lane's resource. */
|
|
736
793
|
onPressCell?: (at: Date, resource: Resource) => void;
|
|
737
794
|
/** Drag empty lane space to create; called with the swept start/end and the lane's resource. */
|
|
@@ -741,12 +798,24 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
741
798
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
742
799
|
* (return `null` for a fully closed lane). A date-only function is accepted.
|
|
743
800
|
*/
|
|
744
|
-
businessHours?: (date: Date, resource: Resource) =>
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
801
|
+
businessHours?: (date: Date, resource: Resource) => BusinessHoursValue;
|
|
802
|
+
/**
|
|
803
|
+
* Render a closed-hours band's content yourself (a label, icon, pattern). The
|
|
804
|
+
* board keeps positioning the band; when set, the themed tint is dropped and
|
|
805
|
+
* your output fills the band instead. Receives the lane's resource. Decorative only: the
|
|
806
|
+
* band stays non-interactive and hidden from assistive tech.
|
|
807
|
+
*/
|
|
808
|
+
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
809
|
+
resource: Resource;
|
|
810
|
+
}) => ReactNode;
|
|
748
811
|
/** Snap dragged events to this many minutes (default 15). */
|
|
749
812
|
dragStepMinutes?: number;
|
|
813
|
+
/** Show the current-time line when `date` is today (default true). */
|
|
814
|
+
showNowIndicator?: boolean;
|
|
815
|
+
/** Fixed "now" instant for the indicator (doesn't tick). Defaults to the device clock. */
|
|
816
|
+
now?: Date;
|
|
817
|
+
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
818
|
+
timeZone?: string;
|
|
750
819
|
/** Class applied to the root element. */
|
|
751
820
|
className?: string;
|
|
752
821
|
/** Inline styles applied to the root element. */
|
|
@@ -768,6 +837,6 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
768
837
|
* />
|
|
769
838
|
* ```
|
|
770
839
|
*/
|
|
771
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, dragStepMinutes, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
840
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
772
841
|
//#endregion
|
|
773
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, 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, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken };
|
|
842
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, 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, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|