@super-calendar/native 2.15.0 → 2.17.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/README.md +63 -0
- package/dist/{DefaultMonthEvent-BDD7GgL8.d.mts → DefaultMonthEvent-C3C30hfV.d.mts} +7 -21
- package/dist/{DefaultMonthEvent-ggwYo7Fy.d.ts → DefaultMonthEvent-Dx3lD7ig.d.ts} +7 -21
- package/dist/{MonthList-D4_LBnbU.js → MonthList-B2TSGYp7.js} +409 -109
- package/dist/{MonthList-DWCH3GT5.mjs → MonthList-N1GVDIE4.mjs} +400 -112
- package/dist/index.d.mts +50 -16
- package/dist/index.d.ts +50 -16
- package/dist/index.js +375 -46
- package/dist/index.mjs +370 -47
- 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/Calendar.tsx +83 -9
- package/src/components/MonthPager.tsx +175 -20
- package/src/components/MonthView.tsx +332 -116
- package/src/components/MultiWeekView.tsx +34 -0
- package/src/components/ResourceTimeline.tsx +153 -4
- package/src/components/TimeGrid.tsx +241 -7
- package/src/index.tsx +8 -0
- package/src/types.ts +1 -0
- package/src/utils/holdWebDateDrag.ts +63 -0
package/README.md
CHANGED
|
@@ -63,6 +63,45 @@ export function MyCalendar() {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
## Multi-week grids
|
|
67
|
+
|
|
68
|
+
Use `mode="multiweek"` with `numberOfWeeks` (default `2`) for consecutive full
|
|
69
|
+
week rows without hourly slots. The first week contains `date` and aligns to
|
|
70
|
+
`weekStartsOn`. Navigation moves by the full number of weeks. `hiddenDays` only
|
|
71
|
+
shortens rows; `custom` views remain hourly even above seven columns.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { useState } from "react";
|
|
75
|
+
import { Calendar } from "@super-calendar/native";
|
|
76
|
+
|
|
77
|
+
export function MultiWeekCalendar() {
|
|
78
|
+
const [date, setDate] = useState(new Date(2026, 11, 28));
|
|
79
|
+
return (
|
|
80
|
+
<Calendar
|
|
81
|
+
mode="multiweek"
|
|
82
|
+
numberOfWeeks={3}
|
|
83
|
+
weekStartsOn={1}
|
|
84
|
+
date={date}
|
|
85
|
+
onChangeDate={setDate}
|
|
86
|
+
events={[]}
|
|
87
|
+
onPressEvent={(event) => console.log(event.title)}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`MultiWeekView` exposes a standalone window with the month grid's event bars,
|
|
94
|
+
overflow, selection, drag interactions, and styling. Pass expanded events to it;
|
|
95
|
+
`Calendar` handles recurrence and time zones. Custom event renderers receive
|
|
96
|
+
`mode: "multiweek"`. Rows scroll vertically when the container is too short.
|
|
97
|
+
Counts must be positive safe integers whose date span is representable; invalid
|
|
98
|
+
counts or dates throw `RangeError`. Rows are materialized, so larger counts need
|
|
99
|
+
more space. `MonthView` and `MonthPager` retain their month-only behavior.
|
|
100
|
+
|
|
101
|
+
Keep `events` stable during unrelated UI updates. With recurrence or `timeZone`,
|
|
102
|
+
replacing the array rebuilds displayed events and cancels a held move on web. See
|
|
103
|
+
[keep event data stable](https://super-calendar.afonsojramos.me/guides/events#keep-event-data-stable).
|
|
104
|
+
|
|
66
105
|
## Moving events
|
|
67
106
|
|
|
68
107
|
Pass `onDragEvent` and update your event state with the returned `start` and `end`.
|
|
@@ -78,6 +117,30 @@ Set an event's `dragHandleColor` to colour its resize grips in `TimeGrid` and
|
|
|
78
117
|
`showDragHandle={false}` still hides the time-grid grips.
|
|
79
118
|
You can toggle it after mounting without replacing the `events` array.
|
|
80
119
|
|
|
120
|
+
## Creating events
|
|
121
|
+
|
|
122
|
+
Pass `onCreateEvent` to long-press and sweep out a new event. To show a draft in
|
|
123
|
+
the preview while it is swept, add a `renderCreateGhost` component. It receives
|
|
124
|
+
the `start` and `end` that `onCreateEvent` would get on release and updates each
|
|
125
|
+
time the sweep crosses a snap step:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { Calendar, type CreateGhostArgs } from "@super-calendar/native";
|
|
129
|
+
import { format } from "date-fns";
|
|
130
|
+
import { Text } from "react-native";
|
|
131
|
+
|
|
132
|
+
function DraftPreview({ start, end }: CreateGhostArgs) {
|
|
133
|
+
return <Text>{`New event ${format(start, "HH:mm")} - ${format(end, "HH:mm")}`}</Text>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
<Calendar mode="week" /* ... */ onCreateEvent={createEvent} renderCreateGhost={DraftPreview} />;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`TimeGrid` and `ResourceTimeline` accept the same prop; `ResourceTimeline` also
|
|
140
|
+
passes the lane's `resource`. The preview geometry stays on the UI thread, and
|
|
141
|
+
the content is clipped to it and hidden from screen readers.
|
|
142
|
+
A cancelled gesture clears the preview without calling `onCreateEvent`.
|
|
143
|
+
|
|
81
144
|
## Styling with Tailwind
|
|
82
145
|
|
|
83
146
|
Every styleable part is a named slot that accepts a class (resolved by a Tailwind runtime such as [uniwind](https://docs.uniwind.dev) or NativeWind) and/or a style override. A classed slot drops its built-in themed styles, so your classes own the look:
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { SharedValue } from "react-native-reanimated";
|
|
4
|
-
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
4
|
+
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
5
5
|
import { AccessibilityActionEvent, AccessibilityActionInfo, ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
6
|
-
//#region src/theme.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The full set of colours, text styles and metrics the calendar paints with.
|
|
9
8
|
* Supply a `Partial<CalendarTheme>` to `<Calendar theme={...} />`; missing keys
|
|
@@ -109,8 +108,6 @@ type PartialCalendarTheme = {
|
|
|
109
108
|
declare const CalendarThemeProvider: import("react").Provider<CalendarTheme>;
|
|
110
109
|
/** Read the active {@link CalendarTheme} from context. Useful inside custom renderers. */
|
|
111
110
|
declare const useCalendarTheme: () => CalendarTheme;
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/types.d.ts
|
|
114
111
|
/**
|
|
115
112
|
* Called when an event is dragged (moved or resized) to new start/end times.
|
|
116
113
|
* Return `false` to reject the drop — the event snaps back to where it started
|
|
@@ -184,8 +181,6 @@ type RenderEventArgs<T = unknown> = {
|
|
|
184
181
|
* (`flex: 1`); the calendar positions and sizes the wrapping box for you.
|
|
185
182
|
*/
|
|
186
183
|
type RenderEvent<T = unknown> = ComponentType<RenderEventArgs<T>>;
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/utils/slots.d.ts
|
|
189
184
|
/**
|
|
190
185
|
* The style shapes a slot can resolve to. A slot carries the style type of the
|
|
191
186
|
* element it is spread on, because React Native's style types stop being
|
|
@@ -222,8 +217,6 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
222
217
|
style: StyleProp<Style>;
|
|
223
218
|
className?: string;
|
|
224
219
|
}
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/components/MonthView.d.ts
|
|
227
220
|
/**
|
|
228
221
|
* The styleable parts of {@link MonthView}. Mirrors the dom renderer's slot
|
|
229
222
|
* names where the structure matches; `dayBadgeText` is native-only (React
|
|
@@ -249,7 +242,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
249
242
|
chipHeight?: number;
|
|
250
243
|
/** Vertical gap between chip rows in pixels (default 2). */
|
|
251
244
|
chipGap?: number;
|
|
252
|
-
weekStartsOn: WeekStartsOn;
|
|
245
|
+
weekStartsOn: WeekStartsOn$1;
|
|
253
246
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
254
247
|
hiddenDays?: number[];
|
|
255
248
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
@@ -355,7 +348,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
355
348
|
*/
|
|
356
349
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
357
350
|
};
|
|
358
|
-
declare function MonthViewInner<T>({ date,
|
|
351
|
+
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
359
352
|
/**
|
|
360
353
|
* A single month rendered as a 7-column grid of day cells, each showing its
|
|
361
354
|
* event chips with a "+N more" overflow. Render it on its own for a static
|
|
@@ -373,8 +366,6 @@ declare function MonthViewInner<T>({ date, events, maxVisibleEventCount, chipHei
|
|
|
373
366
|
* ```
|
|
374
367
|
*/
|
|
375
368
|
declare const MonthView: typeof MonthViewInner;
|
|
376
|
-
//#endregion
|
|
377
|
-
//#region src/components/MonthPager.d.ts
|
|
378
369
|
/** Props for {@link MonthPager}, the horizontally swipeable month carousel. */
|
|
379
370
|
type MonthPagerProps<T> = {
|
|
380
371
|
date: Date;
|
|
@@ -384,7 +375,7 @@ type MonthPagerProps<T> = {
|
|
|
384
375
|
chipHeight?: number;
|
|
385
376
|
/** Gap between month chip rows in pixels (default 2). */
|
|
386
377
|
chipGap?: number;
|
|
387
|
-
weekStartsOn: WeekStartsOn;
|
|
378
|
+
weekStartsOn: WeekStartsOn$1;
|
|
388
379
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
389
380
|
hiddenDays?: number[];
|
|
390
381
|
weekdayFormat?: WeekdayFormat;
|
|
@@ -443,7 +434,7 @@ type MonthPagerProps<T> = {
|
|
|
443
434
|
/** Replace the default date badge in each day cell. Receives the day. */
|
|
444
435
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
445
436
|
} & SlotStyleProps<MonthViewSlot>;
|
|
446
|
-
declare function MonthPagerInner<T>({
|
|
437
|
+
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
447
438
|
/**
|
|
448
439
|
* A horizontally swipeable month carousel. Swipe left/right to page between
|
|
449
440
|
* months; the committed month is reported through `onChangeDate`. It is the
|
|
@@ -463,8 +454,6 @@ declare function MonthPagerInner<T>({ date, events, maxVisibleEventCount, chipHe
|
|
|
463
454
|
* ```
|
|
464
455
|
*/
|
|
465
456
|
declare const MonthPager: typeof MonthPagerInner;
|
|
466
|
-
//#endregion
|
|
467
|
-
//#region src/components/MonthList.d.ts
|
|
468
457
|
/** The styleable parts of {@link MonthList}: the same slots as {@link MonthView}. */
|
|
469
458
|
type MonthListSlot = MonthViewSlot;
|
|
470
459
|
/** Props for {@link MonthList}, the vertically scrolling list of months. */
|
|
@@ -473,7 +462,7 @@ type MonthListProps<T> = {
|
|
|
473
462
|
date: Date;
|
|
474
463
|
/** Events to render in the grids. Omit for an events-free date picker. */
|
|
475
464
|
events?: CalendarEvent$1<T>[];
|
|
476
|
-
weekStartsOn: WeekStartsOn;
|
|
465
|
+
weekStartsOn: WeekStartsOn$1;
|
|
477
466
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
478
467
|
weekdayFormat?: WeekdayFormat;
|
|
479
468
|
/**
|
|
@@ -558,8 +547,6 @@ declare function MonthListInner<T>({ date, events, weekStartsOn, weekdayFormat,
|
|
|
558
547
|
* ```
|
|
559
548
|
*/
|
|
560
549
|
declare const MonthList: typeof MonthListInner;
|
|
561
|
-
//#endregion
|
|
562
|
-
//#region src/components/DefaultMonthEvent.d.ts
|
|
563
550
|
/**
|
|
564
551
|
* A lightweight event chip for the month grid and the date picker: the same
|
|
565
552
|
* titled box as {@link DefaultEvent} but with no Reanimated dependency (it drops
|
|
@@ -568,5 +555,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
568
555
|
* Reanimated.
|
|
569
556
|
*/
|
|
570
557
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
571
|
-
|
|
572
|
-
export { WeekStartsOn as A, ICalendarEvent as C, RenderEventArgs as D, RenderEvent as E, darkTheme as F, defaultTheme as I, mergeTheme as L, CalendarTheme as M, CalendarThemeProvider as N, ScrollToTimeOptions as O, PartialCalendarTheme as P, useCalendarTheme as R, EventKeyExtractor as S, RecurrenceRule as T, CalendarMode$1 as _, MonthPager as a, EventDragHandler as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, WeekdayFormat$1 as j, TimeGridMode as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, EventAccessibilityLabelContext as v, RecurrenceFrequency as w, EventDragStartHandler as x, EventAccessibilityLabeler$1 as y };
|
|
558
|
+
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency as T, CalendarMode$1 as _, MonthPager as a, EventAccessibilityLabeler$1 as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, WeekStartsOn$1 as j, ScrollToTimeOptions as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, CreateGhostArgs$1 as v, ICalendarEvent as w, EventDragHandler as x, EventAccessibilityLabelContext as y, useCalendarTheme as z };
|
|
@@ -2,8 +2,7 @@ import { Locale } from "date-fns";
|
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { AccessibilityActionEvent, AccessibilityActionInfo, ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
4
|
import { SharedValue } from "react-native-reanimated";
|
|
5
|
-
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
6
|
-
//#region src/theme.d.ts
|
|
5
|
+
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
7
6
|
/**
|
|
8
7
|
* The full set of colours, text styles and metrics the calendar paints with.
|
|
9
8
|
* Supply a `Partial<CalendarTheme>` to `<Calendar theme={...} />`; missing keys
|
|
@@ -109,8 +108,6 @@ type PartialCalendarTheme = {
|
|
|
109
108
|
declare const CalendarThemeProvider: import("react").Provider<CalendarTheme>;
|
|
110
109
|
/** Read the active {@link CalendarTheme} from context. Useful inside custom renderers. */
|
|
111
110
|
declare const useCalendarTheme: () => CalendarTheme;
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/types.d.ts
|
|
114
111
|
/**
|
|
115
112
|
* Called when an event is dragged (moved or resized) to new start/end times.
|
|
116
113
|
* Return `false` to reject the drop — the event snaps back to where it started
|
|
@@ -184,8 +181,6 @@ type RenderEventArgs<T = unknown> = {
|
|
|
184
181
|
* (`flex: 1`); the calendar positions and sizes the wrapping box for you.
|
|
185
182
|
*/
|
|
186
183
|
type RenderEvent<T = unknown> = ComponentType<RenderEventArgs<T>>;
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/utils/slots.d.ts
|
|
189
184
|
/**
|
|
190
185
|
* The style shapes a slot can resolve to. A slot carries the style type of the
|
|
191
186
|
* element it is spread on, because React Native's style types stop being
|
|
@@ -222,8 +217,6 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
222
217
|
style: StyleProp<Style>;
|
|
223
218
|
className?: string;
|
|
224
219
|
}
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/components/MonthView.d.ts
|
|
227
220
|
/**
|
|
228
221
|
* The styleable parts of {@link MonthView}. Mirrors the dom renderer's slot
|
|
229
222
|
* names where the structure matches; `dayBadgeText` is native-only (React
|
|
@@ -249,7 +242,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
249
242
|
chipHeight?: number;
|
|
250
243
|
/** Vertical gap between chip rows in pixels (default 2). */
|
|
251
244
|
chipGap?: number;
|
|
252
|
-
weekStartsOn: WeekStartsOn;
|
|
245
|
+
weekStartsOn: WeekStartsOn$1;
|
|
253
246
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
254
247
|
hiddenDays?: number[];
|
|
255
248
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
@@ -355,7 +348,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
355
348
|
*/
|
|
356
349
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
357
350
|
};
|
|
358
|
-
declare function MonthViewInner<T>({ date,
|
|
351
|
+
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
359
352
|
/**
|
|
360
353
|
* A single month rendered as a 7-column grid of day cells, each showing its
|
|
361
354
|
* event chips with a "+N more" overflow. Render it on its own for a static
|
|
@@ -373,8 +366,6 @@ declare function MonthViewInner<T>({ date, events, maxVisibleEventCount, chipHei
|
|
|
373
366
|
* ```
|
|
374
367
|
*/
|
|
375
368
|
declare const MonthView: typeof MonthViewInner;
|
|
376
|
-
//#endregion
|
|
377
|
-
//#region src/components/MonthPager.d.ts
|
|
378
369
|
/** Props for {@link MonthPager}, the horizontally swipeable month carousel. */
|
|
379
370
|
type MonthPagerProps<T> = {
|
|
380
371
|
date: Date;
|
|
@@ -384,7 +375,7 @@ type MonthPagerProps<T> = {
|
|
|
384
375
|
chipHeight?: number;
|
|
385
376
|
/** Gap between month chip rows in pixels (default 2). */
|
|
386
377
|
chipGap?: number;
|
|
387
|
-
weekStartsOn: WeekStartsOn;
|
|
378
|
+
weekStartsOn: WeekStartsOn$1;
|
|
388
379
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
389
380
|
hiddenDays?: number[];
|
|
390
381
|
weekdayFormat?: WeekdayFormat;
|
|
@@ -443,7 +434,7 @@ type MonthPagerProps<T> = {
|
|
|
443
434
|
/** Replace the default date badge in each day cell. Receives the day. */
|
|
444
435
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
445
436
|
} & SlotStyleProps<MonthViewSlot>;
|
|
446
|
-
declare function MonthPagerInner<T>({
|
|
437
|
+
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
447
438
|
/**
|
|
448
439
|
* A horizontally swipeable month carousel. Swipe left/right to page between
|
|
449
440
|
* months; the committed month is reported through `onChangeDate`. It is the
|
|
@@ -463,8 +454,6 @@ declare function MonthPagerInner<T>({ date, events, maxVisibleEventCount, chipHe
|
|
|
463
454
|
* ```
|
|
464
455
|
*/
|
|
465
456
|
declare const MonthPager: typeof MonthPagerInner;
|
|
466
|
-
//#endregion
|
|
467
|
-
//#region src/components/MonthList.d.ts
|
|
468
457
|
/** The styleable parts of {@link MonthList}: the same slots as {@link MonthView}. */
|
|
469
458
|
type MonthListSlot = MonthViewSlot;
|
|
470
459
|
/** Props for {@link MonthList}, the vertically scrolling list of months. */
|
|
@@ -473,7 +462,7 @@ type MonthListProps<T> = {
|
|
|
473
462
|
date: Date;
|
|
474
463
|
/** Events to render in the grids. Omit for an events-free date picker. */
|
|
475
464
|
events?: CalendarEvent$1<T>[];
|
|
476
|
-
weekStartsOn: WeekStartsOn;
|
|
465
|
+
weekStartsOn: WeekStartsOn$1;
|
|
477
466
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
478
467
|
weekdayFormat?: WeekdayFormat;
|
|
479
468
|
/**
|
|
@@ -558,8 +547,6 @@ declare function MonthListInner<T>({ date, events, weekStartsOn, weekdayFormat,
|
|
|
558
547
|
* ```
|
|
559
548
|
*/
|
|
560
549
|
declare const MonthList: typeof MonthListInner;
|
|
561
|
-
//#endregion
|
|
562
|
-
//#region src/components/DefaultMonthEvent.d.ts
|
|
563
550
|
/**
|
|
564
551
|
* A lightweight event chip for the month grid and the date picker: the same
|
|
565
552
|
* titled box as {@link DefaultEvent} but with no Reanimated dependency (it drops
|
|
@@ -568,5 +555,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
568
555
|
* Reanimated.
|
|
569
556
|
*/
|
|
570
557
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
571
|
-
|
|
572
|
-
export { WeekStartsOn as A, ICalendarEvent as C, RenderEventArgs as D, RenderEvent as E, darkTheme as F, defaultTheme as I, mergeTheme as L, CalendarTheme as M, CalendarThemeProvider as N, ScrollToTimeOptions as O, PartialCalendarTheme as P, useCalendarTheme as R, EventKeyExtractor as S, RecurrenceRule as T, CalendarMode$1 as _, MonthPager as a, EventDragHandler as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, WeekdayFormat$1 as j, TimeGridMode as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, EventAccessibilityLabelContext as v, RecurrenceFrequency as w, EventDragStartHandler as x, EventAccessibilityLabeler$1 as y };
|
|
558
|
+
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency as T, CalendarMode$1 as _, MonthPager as a, EventAccessibilityLabeler$1 as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, WeekStartsOn$1 as j, ScrollToTimeOptions as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, CreateGhostArgs$1 as v, ICalendarEvent as w, EventDragHandler as x, EventAccessibilityLabelContext as y, useCalendarTheme as z };
|