calendarkit-prov2 2.0.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/LICENSE +21 -0
- package/README.md +272 -0
- package/dist/calendarkit.css +64 -0
- package/dist/index.d.mts +320 -0
- package/dist/index.d.ts +320 -0
- package/dist/index.js +4687 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4661 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +95 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Locale } from 'date-fns';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
type LanguageCode = 'tr' | 'en' | 'fr' | 'de' | 'es' | 'it' | 'pt' | 'ar' | 'zh' | 'ja' | 'ko' | 'ru' | 'nl' | 'pl' | 'sv';
|
|
6
|
+
declare const LANGUAGE_META: Record<LanguageCode, {
|
|
7
|
+
native: string;
|
|
8
|
+
english: string;
|
|
9
|
+
flag: string;
|
|
10
|
+
rtl?: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
declare const LOCALES: Record<LanguageCode, CalendarTranslations>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the full translation object for a given language code,
|
|
15
|
+
* merged with any custom override translations.
|
|
16
|
+
*/
|
|
17
|
+
declare function getTranslations(language?: LanguageCode, overrides?: Partial<CalendarTranslations>): CalendarTranslations;
|
|
18
|
+
|
|
19
|
+
type ViewType = 'month' | 'week' | 'day' | 'agenda' | 'resource';
|
|
20
|
+
/**
|
|
21
|
+
* A fully custom view that extends the built-in views (month/week/day/agenda).
|
|
22
|
+
* - Appears as a button in the header's view switcher (after built-in views)
|
|
23
|
+
* - Also listed vertically in the sidebar's İşlemler section
|
|
24
|
+
* - When active, its component replaces the main calendar area
|
|
25
|
+
*/
|
|
26
|
+
interface CustomView {
|
|
27
|
+
/** Unique identifier — must not collide with built-in ViewType values. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Short label shown in the header button and sidebar list. */
|
|
30
|
+
label: string;
|
|
31
|
+
/** Optional icon for the header button and sidebar row. */
|
|
32
|
+
icon?: React.ReactNode;
|
|
33
|
+
/** The React node rendered in the main content area when this view is selected. */
|
|
34
|
+
component: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A single custom navigation item shown in the Scheduler sidebar.
|
|
38
|
+
* Clicking it replaces the main calendar area with the provided component.
|
|
39
|
+
*/
|
|
40
|
+
interface SidebarMenuItem {
|
|
41
|
+
/** Unique key used to track which menu is active. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** Display label shown in the sidebar. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Optional icon rendered before the label. Any React node (e.g. a Lucide icon). */
|
|
46
|
+
icon?: React.ReactNode;
|
|
47
|
+
/** The component rendered in the main area when this menu item is selected. */
|
|
48
|
+
component: React.ReactNode;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface EventAttachment {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
url?: string;
|
|
55
|
+
type: 'file' | 'link' | 'image';
|
|
56
|
+
size?: string;
|
|
57
|
+
}
|
|
58
|
+
interface EventReminder {
|
|
59
|
+
id: string;
|
|
60
|
+
type: 'notification' | 'email';
|
|
61
|
+
time: number;
|
|
62
|
+
label?: string;
|
|
63
|
+
}
|
|
64
|
+
interface CalendarEvent {
|
|
65
|
+
id: string;
|
|
66
|
+
title: string;
|
|
67
|
+
start: Date;
|
|
68
|
+
end: Date;
|
|
69
|
+
description?: string;
|
|
70
|
+
color?: string;
|
|
71
|
+
allDay?: boolean;
|
|
72
|
+
calendarId?: string;
|
|
73
|
+
resourceId?: string;
|
|
74
|
+
type?: string;
|
|
75
|
+
icon?: string;
|
|
76
|
+
attachments?: EventAttachment[];
|
|
77
|
+
guests?: string[];
|
|
78
|
+
reminders?: EventReminder[];
|
|
79
|
+
recurrence?: {
|
|
80
|
+
freq: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
|
81
|
+
interval?: number;
|
|
82
|
+
count?: number;
|
|
83
|
+
until?: Date;
|
|
84
|
+
byweekday?: number[];
|
|
85
|
+
};
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
interface EventType {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
color?: string;
|
|
92
|
+
icon?: React.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
interface Resource {
|
|
95
|
+
id: string;
|
|
96
|
+
label: string;
|
|
97
|
+
color?: string;
|
|
98
|
+
avatar?: string;
|
|
99
|
+
}
|
|
100
|
+
interface ThemeColors {
|
|
101
|
+
primary?: string;
|
|
102
|
+
secondary?: string;
|
|
103
|
+
background?: string;
|
|
104
|
+
foreground?: string;
|
|
105
|
+
border?: string;
|
|
106
|
+
muted?: string;
|
|
107
|
+
accent?: string;
|
|
108
|
+
}
|
|
109
|
+
interface CalendarTheme {
|
|
110
|
+
colors?: ThemeColors;
|
|
111
|
+
fontFamily?: string;
|
|
112
|
+
borderRadius?: string;
|
|
113
|
+
}
|
|
114
|
+
/** Full set of translation strings used across all components. */
|
|
115
|
+
interface CalendarTranslations {
|
|
116
|
+
today: string;
|
|
117
|
+
month: string;
|
|
118
|
+
week: string;
|
|
119
|
+
day: string;
|
|
120
|
+
agenda: string;
|
|
121
|
+
resource: string;
|
|
122
|
+
create: string;
|
|
123
|
+
createEvent: string;
|
|
124
|
+
editEvent: string;
|
|
125
|
+
newEvent: string;
|
|
126
|
+
saveChanges: string;
|
|
127
|
+
delete: string;
|
|
128
|
+
save: string;
|
|
129
|
+
cancel: string;
|
|
130
|
+
edit: string;
|
|
131
|
+
duplicate: string;
|
|
132
|
+
close: string;
|
|
133
|
+
moreOptions: string;
|
|
134
|
+
addAttachment: string;
|
|
135
|
+
addReminder: string;
|
|
136
|
+
title: string;
|
|
137
|
+
addTitle: string;
|
|
138
|
+
start: string;
|
|
139
|
+
end: string;
|
|
140
|
+
allDay: string;
|
|
141
|
+
description: string;
|
|
142
|
+
descriptionAndAttachments: string;
|
|
143
|
+
addDescription: string;
|
|
144
|
+
location: string;
|
|
145
|
+
addLocation: string;
|
|
146
|
+
locationHelpText: string;
|
|
147
|
+
notes: string;
|
|
148
|
+
repeat: string;
|
|
149
|
+
noRepeat: string;
|
|
150
|
+
doesNotRepeat: string;
|
|
151
|
+
daily: string;
|
|
152
|
+
weekly: string;
|
|
153
|
+
monthly: string;
|
|
154
|
+
yearly: string;
|
|
155
|
+
repeatFor: string;
|
|
156
|
+
times: string;
|
|
157
|
+
until: string;
|
|
158
|
+
endRepeat: string;
|
|
159
|
+
never: string;
|
|
160
|
+
afterOccurrences: string;
|
|
161
|
+
onDate: string;
|
|
162
|
+
selectCalendar: string;
|
|
163
|
+
selectType: string;
|
|
164
|
+
calendar: string;
|
|
165
|
+
calendars: string;
|
|
166
|
+
event: string;
|
|
167
|
+
task: string;
|
|
168
|
+
appointmentSchedule: string;
|
|
169
|
+
new: string;
|
|
170
|
+
guests: string;
|
|
171
|
+
addGuests: string;
|
|
172
|
+
guest: string;
|
|
173
|
+
guestCount: string;
|
|
174
|
+
guestsCount: string;
|
|
175
|
+
guestAdded: string;
|
|
176
|
+
guestsAdded: string;
|
|
177
|
+
whosJoining: string;
|
|
178
|
+
suggestedTimes: string;
|
|
179
|
+
viewSuggestions: string;
|
|
180
|
+
whereWillItBe: string;
|
|
181
|
+
dateAndTime: string;
|
|
182
|
+
reminders: string;
|
|
183
|
+
dragAndDrop: string;
|
|
184
|
+
attachments: string;
|
|
185
|
+
reminderAtTime: string;
|
|
186
|
+
reminder5min: string;
|
|
187
|
+
reminder10min: string;
|
|
188
|
+
reminder15min: string;
|
|
189
|
+
reminder30min: string;
|
|
190
|
+
reminder1hour: string;
|
|
191
|
+
reminder2hours: string;
|
|
192
|
+
reminder1day: string;
|
|
193
|
+
reminder2days: string;
|
|
194
|
+
reminder1week: string;
|
|
195
|
+
tomorrow: string;
|
|
196
|
+
eventCount: string;
|
|
197
|
+
eventsCount: string;
|
|
198
|
+
timezone: string;
|
|
199
|
+
localTime: string;
|
|
200
|
+
search: string;
|
|
201
|
+
allTypes: string;
|
|
202
|
+
noTitle: string;
|
|
203
|
+
copy: string;
|
|
204
|
+
clickToOpenInMaps: string;
|
|
205
|
+
}
|
|
206
|
+
interface CalendarProps {
|
|
207
|
+
events?: CalendarEvent[];
|
|
208
|
+
/** Partial override translations merged on top of the selected language. */
|
|
209
|
+
translations?: Partial<CalendarTranslations>;
|
|
210
|
+
view?: ViewType;
|
|
211
|
+
onViewChange?: (view: ViewType) => void;
|
|
212
|
+
date?: Date;
|
|
213
|
+
onDateChange?: (date: Date) => void;
|
|
214
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
215
|
+
onEventDrop?: (event: CalendarEvent, start: Date, end: Date) => void;
|
|
216
|
+
onEventResize?: (event: CalendarEvent, start: Date, end: Date) => void;
|
|
217
|
+
onEventCreate?: (event: Partial<CalendarEvent>) => void;
|
|
218
|
+
onEventUpdate?: (event: CalendarEvent) => void;
|
|
219
|
+
onEventDelete?: (eventId: string) => void;
|
|
220
|
+
theme?: CalendarTheme;
|
|
221
|
+
locale?: Locale;
|
|
222
|
+
timezone?: string;
|
|
223
|
+
onTimezoneChange?: (timezone: string) => void;
|
|
224
|
+
className?: string;
|
|
225
|
+
readOnly?: boolean;
|
|
226
|
+
calendars?: {
|
|
227
|
+
id: string;
|
|
228
|
+
label: string;
|
|
229
|
+
color?: string;
|
|
230
|
+
active?: boolean;
|
|
231
|
+
}[];
|
|
232
|
+
resources?: Resource[];
|
|
233
|
+
eventTypes?: EventType[];
|
|
234
|
+
onCalendarToggle?: (calendarId: string, active: boolean) => void;
|
|
235
|
+
isLoading?: boolean;
|
|
236
|
+
isDarkMode?: boolean;
|
|
237
|
+
onThemeToggle?: () => void;
|
|
238
|
+
hideViewSwitcher?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Hour (0–23) the Day and Week views initially scroll to on mount.
|
|
241
|
+
* Defaults to 8 (08:00 AM).
|
|
242
|
+
*/
|
|
243
|
+
initialScrollHour?: number;
|
|
244
|
+
/**
|
|
245
|
+
* When true, the time axis is reversed: 23:00 appears at the top,
|
|
246
|
+
* 00:00 at the bottom. Defaults to false.
|
|
247
|
+
*/
|
|
248
|
+
reverseTime?: boolean;
|
|
249
|
+
/** BCP 47 language code. Defaults to 'tr' (Turkish). */
|
|
250
|
+
language?: LanguageCode;
|
|
251
|
+
onLanguageChange?: (lang: LanguageCode) => void;
|
|
252
|
+
/**
|
|
253
|
+
* Replace the default event form/modal with a fully custom component.
|
|
254
|
+
* Receives open state, the event being edited, and save/delete handlers.
|
|
255
|
+
*/
|
|
256
|
+
renderEventForm?: (props: {
|
|
257
|
+
isOpen: boolean;
|
|
258
|
+
onClose: () => void;
|
|
259
|
+
event?: CalendarEvent | null;
|
|
260
|
+
initialDate?: Date;
|
|
261
|
+
onSave: (event: Partial<CalendarEvent>) => void;
|
|
262
|
+
onDelete?: (eventId: string) => void;
|
|
263
|
+
}) => React.ReactNode;
|
|
264
|
+
/**
|
|
265
|
+
* Replace the default CalendarHeader bar with a fully custom component.
|
|
266
|
+
* All navigation state and handlers are forwarded so you have full control.
|
|
267
|
+
*/
|
|
268
|
+
renderHeader?: (props: {
|
|
269
|
+
currentDate: Date;
|
|
270
|
+
view: ViewType;
|
|
271
|
+
onPrev: () => void;
|
|
272
|
+
onNext: () => void;
|
|
273
|
+
onToday: () => void;
|
|
274
|
+
onViewChange: (view: ViewType) => void;
|
|
275
|
+
translations: CalendarTranslations;
|
|
276
|
+
language: LanguageCode;
|
|
277
|
+
onLanguageChange?: (lang: LanguageCode) => void;
|
|
278
|
+
isDarkMode?: boolean;
|
|
279
|
+
onThemeToggle?: () => void;
|
|
280
|
+
}) => React.ReactNode;
|
|
281
|
+
/**
|
|
282
|
+
* Replace the default MiniCalendar in the sidebar with a custom component.
|
|
283
|
+
* Receives the currently selected date and date/view change handlers.
|
|
284
|
+
*/
|
|
285
|
+
renderMiniCalendar?: (props: {
|
|
286
|
+
currentDate: Date;
|
|
287
|
+
onDateChange: (date: Date) => void;
|
|
288
|
+
onViewChange?: (view: ViewType) => void;
|
|
289
|
+
}) => React.ReactNode;
|
|
290
|
+
/**
|
|
291
|
+
* Replace the default empty-state shown in the Agenda view with a custom component.
|
|
292
|
+
* Receives the current view type and the create-event handler.
|
|
293
|
+
*/
|
|
294
|
+
renderEmptyState?: (props: {
|
|
295
|
+
view: ViewType;
|
|
296
|
+
onCreateEvent?: () => void;
|
|
297
|
+
}) => React.ReactNode;
|
|
298
|
+
/**
|
|
299
|
+
* Custom navigation items rendered in the sidebar.
|
|
300
|
+
* Clicking an item replaces the main calendar area with its `component`.
|
|
301
|
+
* The calendar itself is always accessible via the view switcher in the header.
|
|
302
|
+
*/
|
|
303
|
+
sidebarMenus?: SidebarMenuItem[];
|
|
304
|
+
/**
|
|
305
|
+
* Additional views that extend the built-in ones (month / week / day / agenda).
|
|
306
|
+
* Each custom view:
|
|
307
|
+
* • Gets a button in the header's view switcher (after the built-in ones)
|
|
308
|
+
* • Is also listed vertically inside the sidebar's İşlemler section
|
|
309
|
+
* • Renders its `component` in the main content area when selected
|
|
310
|
+
*/
|
|
311
|
+
customViews?: CustomView[];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
315
|
+
|
|
316
|
+
declare const Scheduler: React.FC<CalendarProps>;
|
|
317
|
+
/** Primary export — backward-compatible alias for v1 `@calendarkit/react` consumers. */
|
|
318
|
+
declare const ProScheduler: React.FC<CalendarProps>;
|
|
319
|
+
|
|
320
|
+
export { type CalendarEvent, type CalendarProps, type CalendarTheme, type CalendarTranslations, type CustomView, type EventAttachment, type EventReminder, type EventType, LANGUAGE_META, LOCALES, type LanguageCode, ProScheduler, type CalendarProps as ProSchedulerProps, type Resource, Scheduler, type SidebarMenuItem, type ThemeColors, type ViewType, cn, getTranslations };
|