@dayflow/core 3.0.1 → 3.1.1
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 +49 -0
- package/dist/index.d.ts +202 -69
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +138 -132
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# DayFlow
|
|
2
|
+
|
|
3
|
+
**English** | [中文](README.zh.md) | [日本語](README.ja.md) | [Getting Started & Contributing](CONTRIBUTING.md)
|
|
4
|
+
|
|
5
|
+
A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple
|
|
6
|
+
views, and plugin architecture.
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@dayflow/core)
|
|
9
|
+
[](https://github.com/dayflow-js/dayflow/pulls)
|
|
10
|
+
[](https://github.com/dayflow-js/dayflow/blob/main/LICENSE)
|
|
11
|
+
[](https://discord.gg/9vdFZKJqBb)
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### Monthly, Weekly, Daily and Various View Types
|
|
16
|
+
|
|
17
|
+
| Monthly | Weekly |
|
|
18
|
+
| --------------------------------------- | -------------------------------------- |
|
|
19
|
+
|  |  |
|
|
20
|
+
|
|
21
|
+
| Daily | Event Stack Level |
|
|
22
|
+
| ------------------------------------- | ---------------------------------------- |
|
|
23
|
+
|  |  |
|
|
24
|
+
|
|
25
|
+
### Default Panel (with multiple Event Detail Panel options available)
|
|
26
|
+
|
|
27
|
+
| Detail Popup | Detail Dialog |
|
|
28
|
+
| ----------------------------------- | ------------------------------------ |
|
|
29
|
+
|  |  |
|
|
30
|
+
|
|
31
|
+
### Easy to resize and drag
|
|
32
|
+
|
|
33
|
+
https://github.com/user-attachments/assets/726a5232-35a8-4fe3-8e7b-4de07c455353
|
|
34
|
+
|
|
35
|
+
https://github.com/user-attachments/assets/957317e5-02d8-4419-a74b-62b7d191e347
|
|
36
|
+
|
|
37
|
+
## Contributing
|
|
38
|
+
|
|
39
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
40
|
+
|
|
41
|
+
## Bug Reports
|
|
42
|
+
|
|
43
|
+
If you find a bug, please file an issue on [GitHub Issues](https://github.com/dayflow-js/dayflow/issues).
|
|
44
|
+
|
|
45
|
+
## Support
|
|
46
|
+
|
|
47
|
+
For questions and support, please open an issue on GitHub or go to discord.
|
|
48
|
+
|
|
49
|
+
---
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Temporal } from 'temporal-polyfill';
|
|
2
2
|
import * as preact from 'preact';
|
|
3
|
-
import { ComponentChildren, RefObject } from 'preact';
|
|
3
|
+
import { ComponentChildren, RefObject, h } from 'preact';
|
|
4
|
+
import * as preact_compat from 'preact/compat';
|
|
5
|
+
export { createPortal } from 'preact/compat';
|
|
6
|
+
import { BlossomColorPickerOptions } from '@dayflow/blossom-color-picker';
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Calendar event interface (using Temporal API)
|
|
@@ -186,9 +189,17 @@ declare class CalendarRegistry {
|
|
|
186
189
|
*/
|
|
187
190
|
validate(calendar: Partial<CalendarType>): string[];
|
|
188
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Get calendar colors for a specific hex color
|
|
194
|
+
* Tries to match with default calendar types, otherwise generates generic colors
|
|
195
|
+
*/
|
|
196
|
+
declare function getCalendarColorsForHex(hex: string): {
|
|
197
|
+
colors: CalendarColors;
|
|
198
|
+
darkColors?: CalendarColors;
|
|
199
|
+
};
|
|
189
200
|
|
|
190
201
|
type LocaleCode = string;
|
|
191
|
-
type TranslationKey = 'allDay' | 'noEvents' | 'more' | 'eventTitle' | 'dateRange' | 'timeRange' | 'note' | 'addNotePlaceholder' | 'setAsAllDay' | 'setAsTimed' | 'delete' | 'confirm' | 'cancel' | 'today' | 'day' | 'week' | 'month' | 'year' | 'newEvent' | 'newAllDayEvent' | 'newCalendarEvent' | 'newAllDayCalendarEvent' | 'save' | 'deleteCalendar' | 'deleteCalendarMessage' | 'merge' | 'confirmDeleteTitle' | 'confirmDeleteMessage' | 'mergeConfirmTitle' | 'mergeConfirmMessage' | 'expandSidebar' | 'collapseSidebar' | 'calendars' | 'createCalendar' | 'calendarNamePlaceholder' | 'customColor' | 'create' | 'calendarOptions' | 'untitled' | 'search' | 'noResults' | 'calendar' | 'starts' | 'ends' | 'notes' | 'titlePlaceholder' | 'notesPlaceholder' | 'editEvent' | 'done' | 'quickCreateEvent' | 'quickCreatePlaceholder' | 'noSuggestions' | 'newCalendar' | 'refreshAll' | 'tomorrow' | 'importCalendar' | 'exportCalendar' | 'addSchedule' | 'importCalendarMessage' | 'ok' | 'cut' | 'copy' | 'pasteHere' | 'eventSummary';
|
|
202
|
+
type TranslationKey = 'allDay' | 'noEvents' | 'more' | 'eventTitle' | 'dateRange' | 'timeRange' | 'note' | 'addNotePlaceholder' | 'setAsAllDay' | 'setAsTimed' | 'delete' | 'confirm' | 'cancel' | 'today' | 'day' | 'week' | 'month' | 'year' | 'newEvent' | 'newAllDayEvent' | 'newCalendarEvent' | 'newAllDayCalendarEvent' | 'save' | 'deleteCalendar' | 'deleteCalendarMessage' | 'merge' | 'confirmDeleteTitle' | 'confirmDeleteMessage' | 'mergeConfirmTitle' | 'mergeConfirmMessage' | 'expandSidebar' | 'collapseSidebar' | 'calendars' | 'createCalendar' | 'calendarNamePlaceholder' | 'customColor' | 'create' | 'calendarOptions' | 'untitled' | 'search' | 'noResults' | 'calendar' | 'starts' | 'ends' | 'notes' | 'titlePlaceholder' | 'notesPlaceholder' | 'editEvent' | 'viewEvent' | 'done' | 'quickCreateEvent' | 'quickCreatePlaceholder' | 'noSuggestions' | 'newCalendar' | 'refreshAll' | 'tomorrow' | 'importCalendar' | 'exportCalendar' | 'addSchedule' | 'importCalendarMessage' | 'ok' | 'cut' | 'copy' | 'pasteHere' | 'eventSummary';
|
|
192
203
|
type LocaleDict = Partial<Record<TranslationKey, string>>;
|
|
193
204
|
type LocaleMessages = Partial<Record<TranslationKey, string>>;
|
|
194
205
|
interface Locale {
|
|
@@ -206,6 +217,8 @@ interface MobileEventProps {
|
|
|
206
217
|
onClose: () => void;
|
|
207
218
|
/** Callback to save the event (creates or updates) */
|
|
208
219
|
onSave: (event: Event) => void;
|
|
220
|
+
/** Callback to delete an existing event by id */
|
|
221
|
+
onEventDelete?: (id: string) => void;
|
|
209
222
|
/** Current event data (newly created template or existing event) */
|
|
210
223
|
draftEvent: Event | null;
|
|
211
224
|
/** The ICalendarApp instance providing built-in services */
|
|
@@ -248,29 +261,47 @@ interface CalendarView {
|
|
|
248
261
|
component: TComponent;
|
|
249
262
|
config?: Record<string, unknown>;
|
|
250
263
|
}
|
|
264
|
+
type RangeChangeReason = 'initial' | 'navigation' | 'viewChange' | 'scroll';
|
|
265
|
+
type EventChange = {
|
|
266
|
+
type: 'create';
|
|
267
|
+
event: Event;
|
|
268
|
+
} | {
|
|
269
|
+
type: 'update';
|
|
270
|
+
before: Event;
|
|
271
|
+
after: Event;
|
|
272
|
+
} | {
|
|
273
|
+
type: 'delete';
|
|
274
|
+
event: Event;
|
|
275
|
+
};
|
|
251
276
|
/**
|
|
252
277
|
* Calendar callbacks interface
|
|
253
278
|
* Defines calendar event callback functions
|
|
254
279
|
*/
|
|
255
280
|
interface CalendarCallbacks {
|
|
281
|
+
onEventBatchChange?: (changes: EventChange[]) => void | Promise<void>;
|
|
256
282
|
onViewChange?: (view: ViewType) => void | Promise<void>;
|
|
257
283
|
onEventCreate?: (event: Event) => void | Promise<void>;
|
|
258
284
|
onEventUpdate?: (event: Event) => void | Promise<void>;
|
|
259
285
|
onEventDelete?: (eventId: string) => void | Promise<void>;
|
|
260
286
|
onDateChange?: (date: Date) => void | Promise<void>;
|
|
261
287
|
onRender?: () => void | Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* @deprecated This method is retained for backward compatibility and will be removed in future releases. Use ``onVisibleRangeChange`` instead.
|
|
290
|
+
*/
|
|
262
291
|
onVisibleMonthChange?: (date: Date) => void | Promise<void>;
|
|
292
|
+
onVisibleRangeChange?: (start: Date, end: Date, reason: RangeChangeReason) => void | Promise<void>;
|
|
263
293
|
onCalendarUpdate?: (calendar: CalendarType) => void | Promise<void>;
|
|
264
294
|
onCalendarCreate?: (calendar: CalendarType) => void | Promise<void>;
|
|
265
295
|
onCalendarDelete?: (calendarId: string) => void | Promise<void>;
|
|
266
296
|
onCalendarMerge?: (sourceId: string, targetId: string) => void | Promise<void>;
|
|
267
297
|
onEventClick?: (event: Event) => void | Promise<void>;
|
|
268
298
|
onMoreEventsClick?: (date: Date) => void | Promise<void>;
|
|
299
|
+
onDismissUI?: () => void | Promise<void>;
|
|
269
300
|
}
|
|
270
301
|
interface CreateCalendarDialogProps {
|
|
271
302
|
onClose: () => void;
|
|
272
303
|
onCreate: (calendar: CalendarType) => void;
|
|
273
|
-
colorPickerMode?: '
|
|
304
|
+
colorPickerMode?: 'default' | 'custom';
|
|
274
305
|
}
|
|
275
306
|
interface CalendarHeaderProps {
|
|
276
307
|
calendar: ICalendarApp;
|
|
@@ -285,38 +316,6 @@ interface CalendarHeaderProps {
|
|
|
285
316
|
/** Left safe area padding (px) to avoid overlapping with traffic light buttons in macMode */
|
|
286
317
|
safeAreaLeft?: number;
|
|
287
318
|
}
|
|
288
|
-
/**
|
|
289
|
-
* Sidebar render props
|
|
290
|
-
*/
|
|
291
|
-
interface CalendarSidebarRenderProps {
|
|
292
|
-
app: ICalendarApp;
|
|
293
|
-
calendars: CalendarType[];
|
|
294
|
-
toggleCalendarVisibility: (calendarId: string, visible: boolean) => void;
|
|
295
|
-
toggleAll: (visible: boolean) => void;
|
|
296
|
-
isCollapsed: boolean;
|
|
297
|
-
setCollapsed: (collapsed: boolean) => void;
|
|
298
|
-
renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode;
|
|
299
|
-
createCalendarMode?: 'inline' | 'modal';
|
|
300
|
-
renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode;
|
|
301
|
-
editingCalendarId?: string | null;
|
|
302
|
-
setEditingCalendarId?: (id: string | null) => void;
|
|
303
|
-
onCreateCalendar?: () => void;
|
|
304
|
-
colorPickerMode?: 'blossom' | 'default';
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Sidebar config
|
|
308
|
-
*/
|
|
309
|
-
interface SidebarConfig {
|
|
310
|
-
enabled?: boolean;
|
|
311
|
-
width?: number | string;
|
|
312
|
-
initialCollapsed?: boolean;
|
|
313
|
-
render?: (props: CalendarSidebarRenderProps) => TNode;
|
|
314
|
-
renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode;
|
|
315
|
-
createCalendarMode?: 'inline' | 'modal';
|
|
316
|
-
renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode;
|
|
317
|
-
/** Color picker mode: 'blossom' for BlossomColorPicker, 'default' for react-color */
|
|
318
|
-
colorPickerMode?: 'blossom' | 'default';
|
|
319
|
-
}
|
|
320
319
|
/**
|
|
321
320
|
* Calendar application configuration
|
|
322
321
|
* Used to initialize CalendarApp
|
|
@@ -332,7 +331,6 @@ interface CalendarAppConfig {
|
|
|
332
331
|
calendars?: CalendarType[];
|
|
333
332
|
defaultCalendar?: string;
|
|
334
333
|
theme?: ThemeConfig;
|
|
335
|
-
useSidebar?: boolean | SidebarConfig;
|
|
336
334
|
useEventDetailDialog?: boolean;
|
|
337
335
|
useCalendarHeader?: boolean | ((props: CalendarHeaderProps) => TNode);
|
|
338
336
|
customMobileEventRenderer?: MobileEventRenderer;
|
|
@@ -357,9 +355,9 @@ interface CalendarAppState {
|
|
|
357
355
|
plugins: Map<string, CalendarPlugin>;
|
|
358
356
|
views: Map<ViewType, CalendarView>;
|
|
359
357
|
switcherMode?: ViewSwitcherMode;
|
|
360
|
-
sidebar?: SidebarConfig;
|
|
361
358
|
locale: string | Locale;
|
|
362
359
|
highlightedEventId?: string | null;
|
|
360
|
+
selectedEventId?: string | null;
|
|
363
361
|
readOnly: boolean | ReadOnlyConfig;
|
|
364
362
|
}
|
|
365
363
|
/**
|
|
@@ -396,6 +394,7 @@ interface ICalendarApp {
|
|
|
396
394
|
onEventClick: (event: Event) => void;
|
|
397
395
|
onMoreEventsClick: (date: Date) => void;
|
|
398
396
|
highlightEvent: (eventId: string | null) => void;
|
|
397
|
+
selectEvent: (eventId: string | null) => void;
|
|
399
398
|
getCalendars: () => CalendarType[];
|
|
400
399
|
reorderCalendars: (fromIndex: number, toIndex: number) => void;
|
|
401
400
|
setCalendarVisibility: (calendarId: string, visible: boolean) => void;
|
|
@@ -406,9 +405,10 @@ interface ICalendarApp {
|
|
|
406
405
|
mergeCalendars: (sourceId: string, targetId: string) => void;
|
|
407
406
|
setVisibleMonth: (date: Date) => void;
|
|
408
407
|
getVisibleMonth: () => Date;
|
|
408
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
409
|
+
dismissUI: () => void;
|
|
409
410
|
getPlugin: <T = unknown>(name: string) => T | undefined;
|
|
410
411
|
hasPlugin: (name: string) => boolean;
|
|
411
|
-
getSidebarConfig: () => SidebarConfig;
|
|
412
412
|
getCalendarHeaderConfig: () => boolean | ((props: CalendarHeaderProps) => TNode);
|
|
413
413
|
triggerRender: () => void;
|
|
414
414
|
getCalendarRegistry: () => CalendarRegistry;
|
|
@@ -456,7 +456,7 @@ interface UseCalendarAppReturn {
|
|
|
456
456
|
highlightEvent: (eventId: string | null) => void;
|
|
457
457
|
setVisibleMonth: (date: Date) => void;
|
|
458
458
|
getVisibleMonth: () => Date;
|
|
459
|
-
|
|
459
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
460
460
|
readOnlyConfig: ReadOnlyConfig;
|
|
461
461
|
}
|
|
462
462
|
/**
|
|
@@ -909,6 +909,7 @@ interface UseVirtualMonthScrollReturn {
|
|
|
909
909
|
currentMonth: string;
|
|
910
910
|
currentYear: number;
|
|
911
911
|
isScrolling: boolean;
|
|
912
|
+
isNavigating: boolean;
|
|
912
913
|
virtualData: {
|
|
913
914
|
totalHeight: number;
|
|
914
915
|
visibleItems: VirtualWeekItem[];
|
|
@@ -1282,7 +1283,7 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1282
1283
|
state: CalendarAppState;
|
|
1283
1284
|
private callbacks;
|
|
1284
1285
|
private calendarRegistry;
|
|
1285
|
-
private
|
|
1286
|
+
private store;
|
|
1286
1287
|
private visibleMonth;
|
|
1287
1288
|
private useEventDetailDialog;
|
|
1288
1289
|
private useCalendarHeader;
|
|
@@ -1293,6 +1294,7 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1293
1294
|
private pendingSnapshot;
|
|
1294
1295
|
private readonly MAX_UNDO_STACK;
|
|
1295
1296
|
constructor(config: CalendarAppConfig);
|
|
1297
|
+
private setupStoreListeners;
|
|
1296
1298
|
private resolveLocale;
|
|
1297
1299
|
subscribe: (listener: (app: ICalendarApp) => void) => (() => void);
|
|
1298
1300
|
private notify;
|
|
@@ -1306,6 +1308,8 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1306
1308
|
private isInternalEditable;
|
|
1307
1309
|
changeView: (view: ViewType) => void;
|
|
1308
1310
|
getCurrentView: () => CalendarView;
|
|
1311
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
1312
|
+
handleVisibleRangeChange: (reason: RangeChangeReason) => void;
|
|
1309
1313
|
setCurrentDate: (date: Date) => void;
|
|
1310
1314
|
getCurrentDate: () => Date;
|
|
1311
1315
|
setVisibleMonth: (date: Date) => void;
|
|
@@ -1329,6 +1333,8 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1329
1333
|
onEventClick: (event: Event) => void;
|
|
1330
1334
|
onMoreEventsClick: (date: Date) => void;
|
|
1331
1335
|
highlightEvent: (eventId: string | null) => void;
|
|
1336
|
+
selectEvent: (eventId: string | null) => void;
|
|
1337
|
+
dismissUI: () => void;
|
|
1332
1338
|
getEvents: () => Event[];
|
|
1333
1339
|
getCalendars: () => CalendarType[];
|
|
1334
1340
|
reorderCalendars: (fromIndex: number, toIndex: number) => void;
|
|
@@ -1338,7 +1344,6 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1338
1344
|
createCalendar: (calendar: CalendarType) => void;
|
|
1339
1345
|
deleteCalendar: (id: string) => void;
|
|
1340
1346
|
mergeCalendars: (sourceId: string, targetId: string) => void;
|
|
1341
|
-
getSidebarConfig: () => SidebarConfig;
|
|
1342
1347
|
getCalendarHeaderConfig: () => boolean | ((props: any) => TNode);
|
|
1343
1348
|
private installPlugin;
|
|
1344
1349
|
getPlugin: <T = unknown>(name: string) => T | undefined;
|
|
@@ -1385,6 +1390,7 @@ declare class CustomRenderingStore {
|
|
|
1385
1390
|
private renderings;
|
|
1386
1391
|
private overrides;
|
|
1387
1392
|
private listeners;
|
|
1393
|
+
constructor(initialOverrides?: string[]);
|
|
1388
1394
|
/**
|
|
1389
1395
|
* Register a new custom rendering placeholder.
|
|
1390
1396
|
* Called by the ContentSlot Preact component.
|
|
@@ -1417,7 +1423,9 @@ declare class CalendarRenderer {
|
|
|
1417
1423
|
private customRenderingStore;
|
|
1418
1424
|
private unsubscribe;
|
|
1419
1425
|
private renderRequested;
|
|
1420
|
-
|
|
1426
|
+
private extraProps;
|
|
1427
|
+
constructor(app: ICalendarApp, initialOverrides?: string[]);
|
|
1428
|
+
setProps(props: Record<string, any>): void;
|
|
1421
1429
|
private requestRender;
|
|
1422
1430
|
/**
|
|
1423
1431
|
* Mount the calendar to a DOM container.
|
|
@@ -1869,7 +1877,7 @@ declare function dateToPlainDateTime(date: Date): Temporal.PlainDateTime;
|
|
|
1869
1877
|
/**
|
|
1870
1878
|
* Convert Date to ZonedDateTime (for timezone-aware events)
|
|
1871
1879
|
*/
|
|
1872
|
-
declare function dateToZonedDateTime(date: Date, timeZone
|
|
1880
|
+
declare function dateToZonedDateTime(date: Date, timeZone?: string): Temporal.ZonedDateTime;
|
|
1873
1881
|
/**
|
|
1874
1882
|
* Convert PlainDateTime to Date
|
|
1875
1883
|
*/
|
|
@@ -2277,6 +2285,15 @@ declare const groupSearchResults: (results: CalendarSearchEvent[], today: Date)
|
|
|
2277
2285
|
events: CalendarSearchEvent[];
|
|
2278
2286
|
}>;
|
|
2279
2287
|
|
|
2288
|
+
declare class ClipboardStore {
|
|
2289
|
+
private lastCopiedEvent;
|
|
2290
|
+
setEvent(event: Event): void;
|
|
2291
|
+
getEvent(): Event | null;
|
|
2292
|
+
hasEvent(): boolean;
|
|
2293
|
+
clear(): void;
|
|
2294
|
+
}
|
|
2295
|
+
declare const clipboardStore: ClipboardStore;
|
|
2296
|
+
|
|
2280
2297
|
/**
|
|
2281
2298
|
* ICS (iCalendar) Types
|
|
2282
2299
|
*
|
|
@@ -2486,28 +2503,19 @@ declare const getMonthLabels: (locale: string, format?: "long" | "short" | "narr
|
|
|
2486
2503
|
|
|
2487
2504
|
declare const en: Locale;
|
|
2488
2505
|
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
declare const
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
declare
|
|
2502
|
-
en: Locale;
|
|
2503
|
-
zh: Locale;
|
|
2504
|
-
ja: Locale;
|
|
2505
|
-
ko: Locale;
|
|
2506
|
-
fr: Locale;
|
|
2507
|
-
de: Locale;
|
|
2508
|
-
es: Locale;
|
|
2509
|
-
};
|
|
2510
|
-
type SupportedLang = keyof typeof LOCALES;
|
|
2506
|
+
/**
|
|
2507
|
+
* Global locale registry for the core library.
|
|
2508
|
+
* Default includes English.
|
|
2509
|
+
*/
|
|
2510
|
+
declare const LOCALES: Record<string, Locale>;
|
|
2511
|
+
type SupportedLang = string;
|
|
2512
|
+
/**
|
|
2513
|
+
* Registers a new locale in the global registry.
|
|
2514
|
+
* This allows plugins to provide additional translations.
|
|
2515
|
+
*
|
|
2516
|
+
* @param locale The locale object to register
|
|
2517
|
+
*/
|
|
2518
|
+
declare function registerLocale(locale: Locale): void;
|
|
2511
2519
|
|
|
2512
2520
|
/**
|
|
2513
2521
|
* Normalizes a locale string to a supported language code.
|
|
@@ -2533,6 +2541,13 @@ declare const LocaleContext: preact.Context<LocaleContextValue>;
|
|
|
2533
2541
|
*/
|
|
2534
2542
|
declare function useLocale(): LocaleContextValue;
|
|
2535
2543
|
|
|
2544
|
+
interface LocaleProviderProps {
|
|
2545
|
+
locale?: LocaleCode | Locale;
|
|
2546
|
+
messages?: LocaleMessages;
|
|
2547
|
+
children?: any;
|
|
2548
|
+
}
|
|
2549
|
+
declare const LocaleProvider: ({ locale, messages, children, }: LocaleProviderProps) => preact.JSX.Element;
|
|
2550
|
+
|
|
2536
2551
|
declare const createDayView: ViewFactory<DayViewConfig>;
|
|
2537
2552
|
|
|
2538
2553
|
declare const createWeekView: ViewFactory<WeekViewConfig>;
|
|
@@ -2547,9 +2562,127 @@ declare function createStandardViews(config?: {
|
|
|
2547
2562
|
month?: Partial<MonthViewConfig>;
|
|
2548
2563
|
}): CalendarView[];
|
|
2549
2564
|
|
|
2550
|
-
declare function createDragPlugin(config?: Partial<DragPluginConfig>): CalendarPlugin;
|
|
2551
|
-
|
|
2552
2565
|
declare function createEventsPlugin(config?: EventsPluginConfig): CalendarPlugin;
|
|
2553
2566
|
|
|
2554
|
-
|
|
2555
|
-
|
|
2567
|
+
type DragForViewFn = (app: ICalendarApp, options: DragHookOptions) => DragHookReturn;
|
|
2568
|
+
declare function registerDragImplementation(fn: DragForViewFn): void;
|
|
2569
|
+
declare function useDragForView(app: ICalendarApp, options: DragHookOptions): DragHookReturn;
|
|
2570
|
+
|
|
2571
|
+
interface SidebarBridgeReturn {
|
|
2572
|
+
enabled: boolean;
|
|
2573
|
+
width: string;
|
|
2574
|
+
isCollapsed: boolean;
|
|
2575
|
+
toggleCollapsed: () => void;
|
|
2576
|
+
miniWidth: string;
|
|
2577
|
+
content: TNode | null;
|
|
2578
|
+
extraContent: TNode | null;
|
|
2579
|
+
safeAreaLeft: number;
|
|
2580
|
+
}
|
|
2581
|
+
type SidebarBridgeFn = (app: ICalendarApp) => SidebarBridgeReturn;
|
|
2582
|
+
declare function registerSidebarImplementation(fn: SidebarBridgeFn): void;
|
|
2583
|
+
declare function useSidebarBridge(app: ICalendarApp): SidebarBridgeReturn;
|
|
2584
|
+
|
|
2585
|
+
interface ContextMenuProps {
|
|
2586
|
+
x: number;
|
|
2587
|
+
y: number;
|
|
2588
|
+
onClose: () => void;
|
|
2589
|
+
children: any;
|
|
2590
|
+
className?: string;
|
|
2591
|
+
}
|
|
2592
|
+
declare const ContextMenu: preact.FunctionalComponent<preact_compat.PropsWithoutRef<ContextMenuProps> & {
|
|
2593
|
+
ref?: preact.Ref<HTMLDivElement> | undefined;
|
|
2594
|
+
}>;
|
|
2595
|
+
declare const ContextMenuItem: ({ onClick, children, icon, danger, disabled, }: {
|
|
2596
|
+
onClick: () => void;
|
|
2597
|
+
children: any;
|
|
2598
|
+
icon?: any;
|
|
2599
|
+
danger?: boolean;
|
|
2600
|
+
disabled?: boolean;
|
|
2601
|
+
}) => h.JSX.Element;
|
|
2602
|
+
declare const ContextMenuSeparator: () => h.JSX.Element;
|
|
2603
|
+
declare const ContextMenuLabel: any;
|
|
2604
|
+
declare const ContextMenuColorPicker: ({ selectedColor, onSelect, onCustomColor, }: {
|
|
2605
|
+
selectedColor?: string;
|
|
2606
|
+
onSelect: (color: string) => void;
|
|
2607
|
+
onCustomColor?: () => void;
|
|
2608
|
+
}) => h.JSX.Element;
|
|
2609
|
+
|
|
2610
|
+
interface BlossomColorPickerProps extends Partial<BlossomColorPickerOptions> {
|
|
2611
|
+
className?: string;
|
|
2612
|
+
}
|
|
2613
|
+
declare const BlossomColorPicker: (props: BlossomColorPickerProps) => preact.JSX.Element;
|
|
2614
|
+
|
|
2615
|
+
interface DefaultColorPickerProps {
|
|
2616
|
+
color: string;
|
|
2617
|
+
onChange: (color: {
|
|
2618
|
+
hex: string;
|
|
2619
|
+
}, isPending?: boolean) => void;
|
|
2620
|
+
onClose?: () => void;
|
|
2621
|
+
[key: string]: any;
|
|
2622
|
+
}
|
|
2623
|
+
declare const DefaultColorPicker: ({ color, onChange, onClose, }: DefaultColorPickerProps) => preact.JSX.Element;
|
|
2624
|
+
|
|
2625
|
+
interface MiniCalendarProps {
|
|
2626
|
+
visibleMonth: Date;
|
|
2627
|
+
currentDate: Date;
|
|
2628
|
+
showHeader?: boolean;
|
|
2629
|
+
onMonthChange: (offset: number) => void;
|
|
2630
|
+
onDateSelect: (date: Date) => void;
|
|
2631
|
+
locale?: string;
|
|
2632
|
+
}
|
|
2633
|
+
declare const MiniCalendar: ({ visibleMonth, currentDate, showHeader, onMonthChange, onDateSelect, }: MiniCalendarProps) => preact.JSX.Element;
|
|
2634
|
+
|
|
2635
|
+
declare const CreateCalendarDialog: ({ onClose, onCreate, colorPickerMode, }: CreateCalendarDialogProps) => preact.VNode<any> | null;
|
|
2636
|
+
|
|
2637
|
+
interface ContentSlotProps {
|
|
2638
|
+
generatorName: string;
|
|
2639
|
+
generatorArgs?: any;
|
|
2640
|
+
defaultContent?: any;
|
|
2641
|
+
store?: any;
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Preact component: Creates a placeholder <div> and registers it with CustomRenderingStore.
|
|
2645
|
+
* If a framework adapter (React/Vue) is present, it will portal its content into this <div>.
|
|
2646
|
+
* Otherwise, it displays defaultContent.
|
|
2647
|
+
*/
|
|
2648
|
+
declare function ContentSlot({ generatorName, generatorArgs, defaultContent, store: propStore, }: ContentSlotProps): preact.JSX.Element;
|
|
2649
|
+
|
|
2650
|
+
interface IconProps {
|
|
2651
|
+
className?: string;
|
|
2652
|
+
width?: number;
|
|
2653
|
+
height?: number;
|
|
2654
|
+
}
|
|
2655
|
+
declare const ChevronRight: ({ className, width, height, }: IconProps) => preact.JSX.Element;
|
|
2656
|
+
declare const Plus: ({ className, width, height }: IconProps) => preact.JSX.Element;
|
|
2657
|
+
declare const Check: ({ className, width, height }: IconProps) => preact.JSX.Element;
|
|
2658
|
+
declare const ChevronsUpDown: ({ className, width, height, }: IconProps) => preact.JSX.Element;
|
|
2659
|
+
declare const PanelRightClose: ({ className, width, height, }: IconProps) => preact.JSX.Element;
|
|
2660
|
+
declare const PanelRightOpen: ({ className, width, height, }: IconProps) => preact.JSX.Element;
|
|
2661
|
+
|
|
2662
|
+
/**
|
|
2663
|
+
* Cancel button
|
|
2664
|
+
*/
|
|
2665
|
+
declare const cancelButton = "rounded-md bg-background border border-border px-3 py-2 text-xs font-medium text-gray-700 dark:text-gray-300 hover:bg-(--hover)";
|
|
2666
|
+
/**
|
|
2667
|
+
* Calendar picker dropdown (for selecting calendar for an event)
|
|
2668
|
+
*/
|
|
2669
|
+
declare const calendarPickerDropdown = "bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 overflow-hidden transition-all duration-200 origin-top-right animate-in fade-in zoom-in-95";
|
|
2670
|
+
/**
|
|
2671
|
+
* Sidebar container
|
|
2672
|
+
*/
|
|
2673
|
+
declare const sidebarContainer = "df-sidebar flex h-full flex-col border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-900";
|
|
2674
|
+
/**
|
|
2675
|
+
* Sidebar header
|
|
2676
|
+
*/
|
|
2677
|
+
declare const sidebarHeader = "df-sidebar-header flex items-center px-2 py-1";
|
|
2678
|
+
/**
|
|
2679
|
+
* Sidebar header toggle button
|
|
2680
|
+
*/
|
|
2681
|
+
declare const sidebarHeaderToggle = "df-sidebar-header-toggle flex h-8 w-8 items-center justify-center rounded hover:bg-gray-100 dark:hover:bg-slate-800";
|
|
2682
|
+
/**
|
|
2683
|
+
* Sidebar header title
|
|
2684
|
+
*/
|
|
2685
|
+
declare const sidebarHeaderTitle = "df-sidebar-header-title text-sm font-semibold text-gray-700 dark:text-gray-200";
|
|
2686
|
+
|
|
2687
|
+
export { BlossomColorPicker, CalendarApp, CalendarRegistry, CalendarRenderer, Check, ChevronRight, ChevronsUpDown, ContentSlot, ContextMenu, ContextMenuColorPicker, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, CreateCalendarDialog, CustomRenderingStore, DefaultColorPicker, LAYOUT_CONFIG, LOCALES, LocaleContext, LocaleProvider, MiniCalendar, PanelRightClose, PanelRightOpen, Plus, TIME_STEP, VIRTUAL_MONTH_SCROLL_CONFIG, ViewType, WeekDataCache, addDays, buildParseRegExp, calculateDayIndex, calendarPickerDropdown, cancelButton, capitalize, clipboardStore, conditionalTheme, convertDateEvent, convertDateEventWithTimeZone, createAllDayEvent, createDateWithHour, createDayView, createEvent, createEventWithDate, createEventWithRealDate, createEvents, createEventsPlugin, createMonthView, createStandardViews, createTemporalWithHour, createTimedEvent, createTimezoneEvent, createTimezoneEvents, createWeekView, createYearView, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, daysBetween, daysDifference, downloadICS, en, extractHourFromDate, extractHourFromTemporal, formatDate, formatDateConsistent, formatDateToICSTimestamp, formatEventTimeRange, formatICSDate, formatMonthYear, formatTemporal, formatTime, generateDayData, generateICS, generateUniKey, generateWeekData, generateWeekRange, generateWeeksData, getAllDayEventsForDay, getCalendarColorsForHex, getCurrentWeekDates, getDateByDayIndex, getDateObj, getDayIndexByDate, getEndOfDay, getEndOfTemporal, getEventBgColor, getEventEndHour, getEventTextColor, getEventsForDay, getEventsForWeek, getIntlLabel, getLineColor, getMonthLabels, getMonthYearOfWeek, getPlainDate, getSearchHeaderInfo, getSelectedBgColor, getStartOfDay, getStartOfTemporal, getTestEvents, getWeekDaysLabels, getWeekRange, getZoneId, groupSearchResults, importICSFile, isDate, isDeepEqual, isEventEqual, isEventInWeek, isMultiDayEvent, isMultiDayTemporalEvent, isPlainDate, isPlainDateTime, isSameDay, isSamePlainDate, isSameTemporal, isValidLocale, isZonedDateTime, mergeClasses, mergeFormatTemplate, monthNames, normalizeCssWidth, normalizeDate, normalizeLocale, normalizeToZoned, now, pad, parseICS, parseICSDate, parseTemporalString, plainDateTimeToDate, plainDateToDate, recalculateEventDays, registerDragImplementation, registerLocale, registerSidebarImplementation, resolveAppliedTheme, roundToTimeStep, scrollbarTakesSpace, setHourInTemporal, shortMonthNames, sidebarContainer, sidebarHeader, sidebarHeaderTitle, sidebarHeaderToggle, t, temporalToDate, themeClasses, themeCn, today, updateEventDateAndDay, updateEventWithRealDate, useDragForView, useLocale, useSidebarBridge, weekDays, weekDaysFullName, zonedDateTimeToDate };
|
|
2688
|
+
export type { BalanceStrategy, BaseViewProps, CalendarAppConfig, CalendarAppState, CalendarCallbacks, CalendarColors, CalendarConfig, CalendarHeaderProps, CalendarPlugin, CalendarType, CalendarView, CalendarsConfig, CreateCalendarDialogProps, CreateEventParams, CreateTimezoneEventParams, CustomRendering, DayData, DayViewConfig, DayViewProps, DragConfig, DragHookOptions, DragHookReturn, DragIndicatorProps, DragIndicatorRenderer, DragIntegrationProps, DragPluginConfig, DragRef, DragService, Event, EventChange, EventDetailContentProps, EventDetailContentRenderer, EventDetailDialogProps, EventDetailDialogRenderer, EventDetailPanelProps, EventDetailPanelRenderer, EventDetailPosition, EventGroup, EventLayout, EventRelations, EventsPluginConfig, EventsService, ICSDateParams, ICSExportOptions, ICSImportOptions, ICSImportResult, ICSParseError, ICSVEvent, ICalendarApp, Locale, LocaleCode, LocaleContextValue, LocaleDict, LocaleMessages, LocaleProviderProps, MobileEventProps, MobileEventRenderer, Mode, MonthDragState, MonthEventDragState, MonthViewConfig, MonthViewProps, NestedLayer, RangeChangeReason, ReadOnlyConfig, SidebarBridgeReturn, SpecialLayoutRule, SubtreeAnalysis, SupportedLang, TComponent, TNode, ThemeColors, ThemeConfig, ThemeMode, TransferOperation, TranslationKey, UnifiedDragRef, UseCalendarAppReturn, UseCalendarReturn, UseDragCommonReturn, UseDragHandlersParams, UseDragHandlersReturn, UseDragManagerReturn, UseDragStateReturn, UseMonthDragParams, UseMonthDragReturn, UseVirtualMonthScrollProps, UseVirtualMonthScrollReturn, UseVirtualScrollProps, UseVirtualScrollReturn, UseWeekDayDragParams, UseWeekDayDragReturn, ViewAdapterProps, ViewFactory, ViewFactoryConfig, VirtualItem, VirtualScrollIntegrationProps, VirtualWeekItem, WeekDayDragState, WeekViewConfig, WeekViewProps, WeeksData, YearViewConfig, YearViewProps, useDragProps, useDragReturn };
|