@dayflow/core 3.1.2 → 3.2.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 +42 -13
- package/dist/index.d.ts +480 -294
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +89 -1
- package/package.json +43 -42
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
import { Temporal } from 'temporal-polyfill';
|
|
2
1
|
import * as preact from 'preact';
|
|
3
|
-
import { ComponentChildren,
|
|
2
|
+
import { ComponentChildren, AnyComponent, h, RefObject, JSX } from 'preact';
|
|
3
|
+
import { Temporal } from 'temporal-polyfill';
|
|
4
4
|
import * as preact_compat from 'preact/compat';
|
|
5
5
|
export { createPortal } from 'preact/compat';
|
|
6
6
|
import { BlossomColorPickerOptions } from '@dayflow/blossom-color-picker';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Calendar event interface (using Temporal API)
|
|
10
|
-
* Unified event data structure supporting single-day, cross-day, and all-day events
|
|
11
|
-
*/
|
|
12
|
-
interface Event {
|
|
13
|
-
id: string;
|
|
14
|
-
title: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
start: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
17
|
-
end: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
18
|
-
allDay?: boolean;
|
|
19
|
-
icon?: boolean | ComponentChildren;
|
|
20
|
-
calendarId?: string;
|
|
21
|
-
meta?: Record<string, any>;
|
|
22
|
-
day?: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
8
|
type ViewSwitcherMode = 'buttons' | 'select';
|
|
26
9
|
|
|
27
10
|
/**
|
|
@@ -183,11 +166,11 @@ declare class CalendarRegistry {
|
|
|
183
166
|
/**
|
|
184
167
|
* Check if the current theme is dark
|
|
185
168
|
*/
|
|
186
|
-
private isDarkTheme;
|
|
169
|
+
private static isDarkTheme;
|
|
187
170
|
/**
|
|
188
171
|
* Validate calendar configuration
|
|
189
172
|
*/
|
|
190
|
-
validate(calendar: Partial<CalendarType>): string[];
|
|
173
|
+
static validate(calendar: Partial<CalendarType>): string[];
|
|
191
174
|
}
|
|
192
175
|
/**
|
|
193
176
|
* Get calendar colors for a specific hex color
|
|
@@ -208,31 +191,30 @@ interface Locale {
|
|
|
208
191
|
}
|
|
209
192
|
|
|
210
193
|
/**
|
|
211
|
-
*
|
|
194
|
+
* Calendar event interface (using Temporal API)
|
|
195
|
+
* Unified event data structure supporting single-day, cross-day, and all-day events
|
|
212
196
|
*/
|
|
213
|
-
interface
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/** The ICalendarApp instance providing built-in services */
|
|
225
|
-
app: ICalendarApp;
|
|
197
|
+
interface Event {
|
|
198
|
+
id: string;
|
|
199
|
+
title: string;
|
|
200
|
+
description?: string;
|
|
201
|
+
start: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
202
|
+
end: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
203
|
+
allDay?: boolean;
|
|
204
|
+
icon?: boolean | ComponentChildren;
|
|
205
|
+
calendarId?: string;
|
|
206
|
+
meta?: Record<string, unknown>;
|
|
207
|
+
day?: number;
|
|
226
208
|
}
|
|
227
|
-
/**
|
|
228
|
-
* Custom mobile event renderer (Drawer or Dialog)
|
|
229
|
-
*/
|
|
230
|
-
type MobileEventRenderer = any;
|
|
231
209
|
|
|
232
210
|
/** Generic type for framework-specific components */
|
|
233
|
-
type TComponent = any
|
|
211
|
+
type TComponent = AnyComponent<any, any>;
|
|
234
212
|
/** Generic type for framework-specific nodes/elements */
|
|
235
|
-
type TNode =
|
|
213
|
+
type TNode = ComponentChildren;
|
|
214
|
+
/**
|
|
215
|
+
* Custom mobile event renderer (Drawer or Dialog)
|
|
216
|
+
*/
|
|
217
|
+
type MobileEventRenderer = AnyComponent<any, any>;
|
|
236
218
|
/**
|
|
237
219
|
* View type enum
|
|
238
220
|
*/
|
|
@@ -306,7 +288,7 @@ interface CreateCalendarDialogProps {
|
|
|
306
288
|
interface CalendarHeaderProps {
|
|
307
289
|
calendar: ICalendarApp;
|
|
308
290
|
switcherMode?: ViewSwitcherMode;
|
|
309
|
-
onAddCalendar?: (e:
|
|
291
|
+
onAddCalendar?: (e: h.JSX.TargetedMouseEvent<HTMLElement> | h.JSX.TargetedTouchEvent<HTMLElement>) => void;
|
|
310
292
|
onSearchChange?: (value: string) => void;
|
|
311
293
|
/** Triggered when search icon is clicked (typically on mobile) */
|
|
312
294
|
onSearchClick?: () => void;
|
|
@@ -385,9 +367,9 @@ interface ICalendarApp {
|
|
|
385
367
|
updates: Partial<Event>;
|
|
386
368
|
}>;
|
|
387
369
|
delete?: string[];
|
|
388
|
-
}, isPending?: boolean) => void;
|
|
370
|
+
}, isPending?: boolean, source?: 'drag' | 'resize') => void;
|
|
389
371
|
addEvent: (event: Event) => void;
|
|
390
|
-
updateEvent: (id: string, event: Partial<Event>, isPending?: boolean) => void;
|
|
372
|
+
updateEvent: (id: string, event: Partial<Event>, isPending?: boolean, source?: 'drag' | 'resize') => void;
|
|
391
373
|
deleteEvent: (id: string) => void;
|
|
392
374
|
getEvents: () => Event[];
|
|
393
375
|
getAllEvents: () => Event[];
|
|
@@ -436,11 +418,11 @@ interface UseCalendarAppReturn {
|
|
|
436
418
|
updates: Partial<Event>;
|
|
437
419
|
}>;
|
|
438
420
|
delete?: string[];
|
|
439
|
-
}, isPending?: boolean) => void;
|
|
421
|
+
}, isPending?: boolean, source?: 'drag' | 'resize') => void;
|
|
440
422
|
changeView: (view: ViewType) => void;
|
|
441
423
|
setCurrentDate: (date: Date) => void;
|
|
442
424
|
addEvent: (event: Event) => void;
|
|
443
|
-
updateEvent: (id: string, event: Partial<Event>, isPending?: boolean) => void;
|
|
425
|
+
updateEvent: (id: string, event: Partial<Event>, isPending?: boolean, source?: 'drag' | 'resize') => void;
|
|
444
426
|
deleteEvent: (id: string) => void;
|
|
445
427
|
goToToday: () => void;
|
|
446
428
|
goToPrevious: () => void;
|
|
@@ -640,104 +622,6 @@ interface SpecialLayoutRule {
|
|
|
640
622
|
reason?: string;
|
|
641
623
|
}
|
|
642
624
|
|
|
643
|
-
/**
|
|
644
|
-
* Virtual scroll item interface (YearView)
|
|
645
|
-
*/
|
|
646
|
-
interface VirtualItem {
|
|
647
|
-
index: number;
|
|
648
|
-
year: number;
|
|
649
|
-
top: number;
|
|
650
|
-
height: number;
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Virtual scroll Hook parameters interface (YearView)
|
|
654
|
-
*/
|
|
655
|
-
interface UseVirtualScrollProps {
|
|
656
|
-
currentDate: Date;
|
|
657
|
-
yearHeight: number;
|
|
658
|
-
onCurrentYearChange?: (year: number) => void;
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Virtual scroll Hook return value interface (YearView)
|
|
662
|
-
*/
|
|
663
|
-
interface UseVirtualScrollReturn {
|
|
664
|
-
scrollTop: number;
|
|
665
|
-
containerHeight: number;
|
|
666
|
-
currentYear: number;
|
|
667
|
-
isScrolling: boolean;
|
|
668
|
-
virtualData: {
|
|
669
|
-
totalHeight: number;
|
|
670
|
-
visibleItems: VirtualItem[];
|
|
671
|
-
};
|
|
672
|
-
scrollElementRef: any;
|
|
673
|
-
handleScroll: (e: any) => void;
|
|
674
|
-
scrollToYear: (targetYear: number, smooth?: boolean) => void;
|
|
675
|
-
handlePreviousYear: () => void;
|
|
676
|
-
handleNextYear: () => void;
|
|
677
|
-
handleToday: () => void;
|
|
678
|
-
setScrollTop: (val: number | ((prev: number) => number)) => void;
|
|
679
|
-
setContainerHeight: (val: number | ((prev: number) => number)) => void;
|
|
680
|
-
setCurrentYear: (val: number | ((prev: number) => number)) => void;
|
|
681
|
-
setIsScrolling: (val: boolean | ((prev: boolean) => boolean)) => void;
|
|
682
|
-
}
|
|
683
|
-
/**
|
|
684
|
-
* Drag state Hook return value
|
|
685
|
-
*/
|
|
686
|
-
interface UseDragStateReturn {
|
|
687
|
-
dragRef: RefObject<UnifiedDragRef>;
|
|
688
|
-
currentDragRef: RefObject<{
|
|
689
|
-
x: number;
|
|
690
|
-
y: number;
|
|
691
|
-
}>;
|
|
692
|
-
dragState: MonthDragState | WeekDayDragState;
|
|
693
|
-
setDragState: (val: MonthDragState | WeekDayDragState | ((prev: MonthDragState | WeekDayDragState) => MonthDragState | WeekDayDragState)) => void;
|
|
694
|
-
resetDragState: () => void;
|
|
695
|
-
throttledSetEvents: (updateFunc: (events: Event[]) => Event[], dragState?: string) => void;
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Drag common utilities Hook return value
|
|
699
|
-
*/
|
|
700
|
-
interface UseDragCommonReturn {
|
|
701
|
-
pixelYToHour: (y: number) => number;
|
|
702
|
-
getColumnDayIndex: (x: number) => number;
|
|
703
|
-
checkIfInAllDayArea: (clientY: number) => boolean;
|
|
704
|
-
handleDirectScroll: (clientY: number) => void;
|
|
705
|
-
daysDifference: (date1: Date, date2: Date) => number;
|
|
706
|
-
addDaysToDate: (date: Date, days: number) => Date;
|
|
707
|
-
getTargetDateFromPosition: (clientX: number, clientY: number) => Date | null;
|
|
708
|
-
ONE_DAY_MS: number;
|
|
709
|
-
}
|
|
710
|
-
/**
|
|
711
|
-
* Drag management Hook return value
|
|
712
|
-
*/
|
|
713
|
-
interface UseDragManagerReturn {
|
|
714
|
-
dragIndicatorRef: RefObject<HTMLDivElement | null>;
|
|
715
|
-
removeDragIndicator: () => void;
|
|
716
|
-
createDragIndicator: (drag: UnifiedDragRef, color?: string, title?: string, layout?: EventLayout | null, sourceElement?: HTMLElement) => void;
|
|
717
|
-
updateDragIndicator: (...args: (number | boolean | EventLayout | null | undefined)[]) => void;
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Drag handler Hook return value
|
|
721
|
-
*/
|
|
722
|
-
interface UseDragHandlersReturn {
|
|
723
|
-
handleDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
724
|
-
handleDragEnd: (e: MouseEvent | TouchEvent) => void;
|
|
725
|
-
handleCreateStart: (e: any | any, ...args: (Date | number)[]) => void;
|
|
726
|
-
handleMoveStart: (e: any | any, event: Event) => void;
|
|
727
|
-
handleResizeStart: (e: any | any, event: Event, direction: string) => void;
|
|
728
|
-
handleUniversalDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
729
|
-
handleUniversalDragEnd: (e?: MouseEvent | TouchEvent) => void;
|
|
730
|
-
}
|
|
731
|
-
/**
|
|
732
|
-
* Drag handler Hook parameters
|
|
733
|
-
*/
|
|
734
|
-
interface UseDragHandlersParams {
|
|
735
|
-
options: useDragProps;
|
|
736
|
-
common: UseDragCommonReturn;
|
|
737
|
-
state: UseDragStateReturn;
|
|
738
|
-
manager: UseDragManagerReturn;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
625
|
/**
|
|
742
626
|
* Drag mode type
|
|
743
627
|
*/
|
|
@@ -792,15 +676,16 @@ interface DragIndicatorProps {
|
|
|
792
676
|
isMobile?: boolean;
|
|
793
677
|
}
|
|
794
678
|
interface DragIndicatorRenderer {
|
|
795
|
-
renderAllDayContent: (props: DragIndicatorProps) =>
|
|
796
|
-
renderRegularContent: (props: DragIndicatorProps) =>
|
|
797
|
-
renderDefaultContent: (props: DragIndicatorProps) =>
|
|
679
|
+
renderAllDayContent: (props: DragIndicatorProps) => ComponentChildren;
|
|
680
|
+
renderRegularContent: (props: DragIndicatorProps) => ComponentChildren;
|
|
681
|
+
renderDefaultContent: (props: DragIndicatorProps) => ComponentChildren;
|
|
798
682
|
}
|
|
799
683
|
interface UnifiedDragRef extends DragRef {
|
|
800
684
|
targetDate?: Date | null;
|
|
801
685
|
originalDate?: Date | null;
|
|
802
686
|
originalEvent?: Event | null;
|
|
803
687
|
dragOffset?: number;
|
|
688
|
+
dragOffsetY?: number;
|
|
804
689
|
originalStartDate?: Date | null;
|
|
805
690
|
originalEndDate?: Date | null;
|
|
806
691
|
eventDate?: Date;
|
|
@@ -823,9 +708,11 @@ interface UnifiedDragRef extends DragRef {
|
|
|
823
708
|
title?: string;
|
|
824
709
|
}
|
|
825
710
|
interface useDragProps extends Partial<DragConfig> {
|
|
826
|
-
calendarRef:
|
|
827
|
-
allDayRowRef?:
|
|
828
|
-
|
|
711
|
+
calendarRef: RefObject<HTMLDivElement>;
|
|
712
|
+
allDayRowRef?: RefObject<HTMLDivElement>;
|
|
713
|
+
timeGridRef?: RefObject<HTMLDivElement>;
|
|
714
|
+
viewType: ViewType;
|
|
715
|
+
onEventsUpdate: (updateFunc: (events: Event[]) => Event[], isResizing?: boolean, source?: 'drag' | 'resize') => void;
|
|
829
716
|
onEventCreate: (event: Event) => void;
|
|
830
717
|
onEventEdit?: (event: Event) => void;
|
|
831
718
|
calculateNewEventLayout?: (dayIndex: number, startHour: number, endHour: number) => EventLayout | null;
|
|
@@ -835,6 +722,8 @@ interface useDragProps extends Partial<DragConfig> {
|
|
|
835
722
|
renderer?: DragIndicatorRenderer;
|
|
836
723
|
app?: ICalendarApp;
|
|
837
724
|
isMobile?: boolean;
|
|
725
|
+
gridWidth?: string;
|
|
726
|
+
displayDays?: number;
|
|
838
727
|
}
|
|
839
728
|
type MonthDragState = {
|
|
840
729
|
active: boolean;
|
|
@@ -857,10 +746,10 @@ interface useDragReturn {
|
|
|
857
746
|
createDragIndicator: (drag: UnifiedDragRef, color?: string, title?: string, layout?: EventLayout | null, sourceElement?: HTMLElement) => void;
|
|
858
747
|
updateDragIndicator: (...args: (number | boolean | EventLayout | null | undefined)[]) => void;
|
|
859
748
|
removeDragIndicator: () => void;
|
|
860
|
-
handleCreateAllDayEvent?: (e:
|
|
861
|
-
handleCreateStart: (e:
|
|
862
|
-
handleMoveStart: (e:
|
|
863
|
-
handleResizeStart: (e:
|
|
749
|
+
handleCreateAllDayEvent?: (e: MouseEvent | TouchEvent, dayIndex: number) => void;
|
|
750
|
+
handleCreateStart: (e: MouseEvent | TouchEvent, ...args: (Date | number)[]) => void;
|
|
751
|
+
handleMoveStart: (e: MouseEvent | TouchEvent, event: Event) => void;
|
|
752
|
+
handleResizeStart: (e: MouseEvent | TouchEvent, event: Event, direction: string) => void;
|
|
864
753
|
dragState: MonthDragState | WeekDayDragState;
|
|
865
754
|
isDragging: boolean;
|
|
866
755
|
pixelYToHour?: (y: number) => number;
|
|
@@ -870,6 +759,63 @@ interface useDragReturn {
|
|
|
870
759
|
* Month view event drag state (alias for MonthDragState, maintains backward compatibility)
|
|
871
760
|
*/
|
|
872
761
|
type MonthEventDragState = MonthDragState;
|
|
762
|
+
/**
|
|
763
|
+
* Drag state Hook return value
|
|
764
|
+
*/
|
|
765
|
+
interface UseDragStateReturn {
|
|
766
|
+
dragRef: RefObject<UnifiedDragRef>;
|
|
767
|
+
currentDragRef: RefObject<{
|
|
768
|
+
x: number;
|
|
769
|
+
y: number;
|
|
770
|
+
}>;
|
|
771
|
+
dragState: MonthDragState | WeekDayDragState;
|
|
772
|
+
setDragState: (val: MonthDragState | WeekDayDragState | ((prev: MonthDragState | WeekDayDragState) => MonthDragState | WeekDayDragState)) => void;
|
|
773
|
+
resetDragState: () => void;
|
|
774
|
+
throttledSetEvents: (updateFunc: (events: Event[]) => Event[], dragState?: string) => void;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Drag common utilities Hook return value
|
|
778
|
+
*/
|
|
779
|
+
interface UseDragCommonReturn {
|
|
780
|
+
pixelYToHour: (y: number) => number;
|
|
781
|
+
getColumnDayIndex: (x: number) => number;
|
|
782
|
+
checkIfInAllDayArea: (clientY: number) => boolean;
|
|
783
|
+
handleDirectScroll: (clientY: number) => void;
|
|
784
|
+
daysDifference: (date1: Date, date2: Date) => number;
|
|
785
|
+
addDaysToDate: (date: Date, days: number) => Date;
|
|
786
|
+
getTargetDateFromPosition: (clientX: number, clientY: number) => Date | null;
|
|
787
|
+
ONE_DAY_MS: number;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Drag management Hook return value
|
|
791
|
+
*/
|
|
792
|
+
interface UseDragManagerReturn {
|
|
793
|
+
dragIndicatorRef: RefObject<HTMLDivElement | null>;
|
|
794
|
+
removeDragIndicator: () => void;
|
|
795
|
+
createDragIndicator: (drag: UnifiedDragRef, color?: string, title?: string, layout?: EventLayout | null, sourceElement?: HTMLElement) => void;
|
|
796
|
+
updateDragIndicator: (...args: (number | boolean | EventLayout | null | undefined)[]) => void;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Drag handler Hook return value
|
|
800
|
+
*/
|
|
801
|
+
interface UseDragHandlersReturn {
|
|
802
|
+
handleDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
803
|
+
handleDragEnd: (e: MouseEvent | TouchEvent) => void;
|
|
804
|
+
handleCreateStart: (e: MouseEvent | TouchEvent, ...args: (Date | number)[]) => void;
|
|
805
|
+
handleMoveStart: (e: MouseEvent | TouchEvent, event: Event) => void;
|
|
806
|
+
handleResizeStart: (e: MouseEvent | TouchEvent, event: Event, direction: string) => void;
|
|
807
|
+
handleUniversalDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
808
|
+
handleUniversalDragEnd: (e?: MouseEvent | TouchEvent) => void;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Drag handler Hook parameters
|
|
812
|
+
*/
|
|
813
|
+
interface UseDragHandlersParams {
|
|
814
|
+
options: useDragProps;
|
|
815
|
+
common: UseDragCommonReturn;
|
|
816
|
+
state: UseDragStateReturn;
|
|
817
|
+
manager: UseDragManagerReturn;
|
|
818
|
+
}
|
|
873
819
|
interface UseMonthDragReturn {
|
|
874
820
|
daysDifference: (date1: Date, date2: Date) => number;
|
|
875
821
|
addDaysToDate: (date: Date, days: number) => Date;
|
|
@@ -882,7 +828,7 @@ interface UseMonthDragParams {
|
|
|
882
828
|
manager: UseDragManagerReturn;
|
|
883
829
|
}
|
|
884
830
|
interface UseWeekDayDragReturn {
|
|
885
|
-
handleCreateAllDayEvent: (e:
|
|
831
|
+
handleCreateAllDayEvent: (e: MouseEvent | TouchEvent, dayIndex: number) => void;
|
|
886
832
|
pixelYToHour: (y: number) => number;
|
|
887
833
|
getColumnDayIndex: (x: number) => number;
|
|
888
834
|
}
|
|
@@ -901,6 +847,7 @@ interface UseVirtualMonthScrollProps {
|
|
|
901
847
|
onCurrentMonthChange?: (month: string, year: number) => void;
|
|
902
848
|
initialWeeksToLoad?: number;
|
|
903
849
|
locale?: string;
|
|
850
|
+
startOfWeek?: number;
|
|
904
851
|
isEnabled?: boolean;
|
|
905
852
|
}
|
|
906
853
|
interface UseVirtualMonthScrollReturn {
|
|
@@ -915,17 +862,17 @@ interface UseVirtualMonthScrollReturn {
|
|
|
915
862
|
visibleItems: VirtualWeekItem[];
|
|
916
863
|
displayStartIndex: number;
|
|
917
864
|
};
|
|
918
|
-
scrollElementRef:
|
|
919
|
-
handleScroll: (e:
|
|
865
|
+
scrollElementRef: RefObject<HTMLDivElement>;
|
|
866
|
+
handleScroll: (e: JSX.TargetedEvent<HTMLDivElement, globalThis.Event>) => void;
|
|
920
867
|
scrollToDate: (targetDate: Date, smooth?: boolean) => void;
|
|
921
868
|
handlePreviousMonth: () => void;
|
|
922
869
|
handleNextMonth: () => void;
|
|
923
870
|
handleToday: () => void;
|
|
924
|
-
setScrollTop:
|
|
925
|
-
setContainerHeight:
|
|
926
|
-
setCurrentMonth:
|
|
927
|
-
setCurrentYear:
|
|
928
|
-
setIsScrolling:
|
|
871
|
+
setScrollTop: (val: number | ((prev: number) => number)) => void;
|
|
872
|
+
setContainerHeight: (val: number | ((prev: number) => number)) => void;
|
|
873
|
+
setCurrentMonth: (val: string | ((prev: string) => string)) => void;
|
|
874
|
+
setCurrentYear: (val: number | ((prev: number) => number)) => void;
|
|
875
|
+
setIsScrolling: (val: boolean | ((prev: boolean) => boolean)) => void;
|
|
929
876
|
cache: WeekDataCache;
|
|
930
877
|
scrollElementRefCallback: (element: HTMLDivElement | null) => void;
|
|
931
878
|
weeksData: WeeksData[];
|
|
@@ -953,7 +900,7 @@ declare class WeekDataCache {
|
|
|
953
900
|
private accessOrder;
|
|
954
901
|
private maxSize;
|
|
955
902
|
constructor(maxSize?: number);
|
|
956
|
-
private getKey;
|
|
903
|
+
private static getKey;
|
|
957
904
|
get(weekStartDate: Date): WeeksData | undefined;
|
|
958
905
|
set(weekStartDate: Date, data: WeeksData): void;
|
|
959
906
|
private updateAccessOrder;
|
|
@@ -970,15 +917,15 @@ interface EventDetailPanelProps {
|
|
|
970
917
|
/** Panel position information */
|
|
971
918
|
position: EventDetailPosition;
|
|
972
919
|
/** Panel DOM reference */
|
|
973
|
-
panelRef:
|
|
920
|
+
panelRef: RefObject<HTMLDivElement>;
|
|
974
921
|
/** Whether the event is all-day */
|
|
975
922
|
isAllDay: boolean;
|
|
976
923
|
/** Event visibility state */
|
|
977
924
|
eventVisibility: 'visible' | 'sticky-top' | 'sticky-bottom';
|
|
978
925
|
/** Calendar container reference */
|
|
979
|
-
calendarRef:
|
|
926
|
+
calendarRef: RefObject<HTMLDivElement>;
|
|
980
927
|
/** Selected event element reference */
|
|
981
|
-
selectedEventElementRef:
|
|
928
|
+
selectedEventElementRef: RefObject<HTMLElement | null>;
|
|
982
929
|
/** Event update callback */
|
|
983
930
|
onEventUpdate: (updatedEvent: Event) => void;
|
|
984
931
|
/** Event delete callback */
|
|
@@ -989,7 +936,7 @@ interface EventDetailPanelProps {
|
|
|
989
936
|
/**
|
|
990
937
|
* Custom event detail panel renderer (full panel including positioning and styling)
|
|
991
938
|
*/
|
|
992
|
-
type EventDetailPanelRenderer = any
|
|
939
|
+
type EventDetailPanelRenderer = AnyComponent<EventDetailPanelProps, any>;
|
|
993
940
|
/**
|
|
994
941
|
* Event detail content Props (excluding panel container, content only)
|
|
995
942
|
*/
|
|
@@ -1004,11 +951,12 @@ interface EventDetailContentProps {
|
|
|
1004
951
|
onEventDelete: (eventId: string) => void;
|
|
1005
952
|
/** Close panel callback (optional) */
|
|
1006
953
|
onClose?: () => void;
|
|
954
|
+
app?: ICalendarApp;
|
|
1007
955
|
}
|
|
1008
956
|
/**
|
|
1009
957
|
* Custom event detail content renderer (content only, will be wrapped in default panel)
|
|
1010
958
|
*/
|
|
1011
|
-
type EventDetailContentRenderer = any
|
|
959
|
+
type EventDetailContentRenderer = AnyComponent<EventDetailContentProps, any>;
|
|
1012
960
|
/**
|
|
1013
961
|
* Event detail dialog Props
|
|
1014
962
|
*/
|
|
@@ -1030,13 +978,146 @@ interface EventDetailDialogProps {
|
|
|
1030
978
|
/**
|
|
1031
979
|
* Custom event detail dialog renderer (Dialog/Modal mode)
|
|
1032
980
|
*/
|
|
1033
|
-
type EventDetailDialogRenderer = any
|
|
981
|
+
type EventDetailDialogRenderer = AnyComponent<EventDetailDialogProps, any>;
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Common IANA TimeZone identifiers.
|
|
985
|
+
* This enum provides a convenient way for users to specify secondary timezones
|
|
986
|
+
* without having to look up the exact Temporal/Intl TimeZone strings.
|
|
987
|
+
*/
|
|
988
|
+
declare enum TimeZone {
|
|
989
|
+
UTC = "UTC",
|
|
990
|
+
NEW_YORK = "America/New_York",
|
|
991
|
+
CHICAGO = "America/Chicago",
|
|
992
|
+
DENVER = "America/Denver",
|
|
993
|
+
LOS_ANGELES = "America/Los_Angeles",
|
|
994
|
+
TORONTO = "America/Toronto",
|
|
995
|
+
VANCOUVER = "America/Vancouver",
|
|
996
|
+
PHOENIX = "America/Phoenix",
|
|
997
|
+
ANCHORAGE = "America/Anchorage",
|
|
998
|
+
HONOLULU = "Pacific/Honolulu",
|
|
999
|
+
MEXICO_CITY = "America/Mexico_City",
|
|
1000
|
+
WINNIPEG = "America/Winnipeg",
|
|
1001
|
+
HALIFAX = "America/Halifax",
|
|
1002
|
+
ST_JOHNS = "America/St_Johns",
|
|
1003
|
+
DETROIT = "America/Detroit",
|
|
1004
|
+
MIAMI = "America/Miami",
|
|
1005
|
+
SEATTLE = "America/Los_Angeles",
|
|
1006
|
+
ATLANTA = "America/New_York",
|
|
1007
|
+
DALLAS = "America/Chicago",
|
|
1008
|
+
HOUSTON = "America/Chicago",
|
|
1009
|
+
LAS_VEGAS = "America/Los_Angeles",
|
|
1010
|
+
SAN_FRANCISCO = "America/Los_Angeles",
|
|
1011
|
+
LONDON = "Europe/London",
|
|
1012
|
+
PARIS = "Europe/Paris",
|
|
1013
|
+
BERLIN = "Europe/Berlin",
|
|
1014
|
+
MADRID = "Europe/Madrid",
|
|
1015
|
+
ROME = "Europe/Rome",
|
|
1016
|
+
AMSTERDAM = "Europe/Amsterdam",
|
|
1017
|
+
ZURICH = "Europe/Zurich",
|
|
1018
|
+
STOCKHOLM = "Europe/Stockholm",
|
|
1019
|
+
OSLO = "Europe/Oslo",
|
|
1020
|
+
COPENHAGEN = "Europe/Copenhagen",
|
|
1021
|
+
MOSCOW = "Europe/Moscow",
|
|
1022
|
+
ISTANBUL = "Europe/Istanbul",
|
|
1023
|
+
DUBLIN = "Europe/Dublin",
|
|
1024
|
+
LISBON = "Europe/Lisbon",
|
|
1025
|
+
PRAGUE = "Europe/Prague",
|
|
1026
|
+
VIENNA = "Europe/Vienna",
|
|
1027
|
+
WARSAW = "Europe/Warsaw",
|
|
1028
|
+
BRUSSELS = "Europe/Brussels",
|
|
1029
|
+
ATHENS = "Europe/Athens",
|
|
1030
|
+
BUCHAREST = "Europe/Bucharest",
|
|
1031
|
+
HELSINKI = "Europe/Helsinki",
|
|
1032
|
+
KYIV = "Europe/Kyiv",
|
|
1033
|
+
BUDAPEST = "Europe/Budapest",
|
|
1034
|
+
BELGRADE = "Europe/Belgrade",
|
|
1035
|
+
LUXEMBOURG = "Europe/Luxembourg",
|
|
1036
|
+
MONACO = "Europe/Monaco",
|
|
1037
|
+
REYKJAVIK = "Atlantic/Reykjavik",
|
|
1038
|
+
TOKYO = "Asia/Tokyo",
|
|
1039
|
+
SHANGHAI = "Asia/Shanghai",
|
|
1040
|
+
BEIJING = "Asia/Shanghai",
|
|
1041
|
+
HONG_KONG = "Asia/Hong_Kong",
|
|
1042
|
+
TAIPEI = "Asia/Taipei",
|
|
1043
|
+
SEOUL = "Asia/Seoul",
|
|
1044
|
+
SINGAPORE = "Asia/Singapore",
|
|
1045
|
+
HANOI = "Asia/Ho_Chi_Minh",
|
|
1046
|
+
BANGKOK = "Asia/Bangkok",
|
|
1047
|
+
JAKARTA = "Asia/Jakarta",
|
|
1048
|
+
KUALA_LUMPUR = "Asia/Kuala_Lumpur",
|
|
1049
|
+
MANILA = "Asia/Manila",
|
|
1050
|
+
DUBAI = "Asia/Dubai",
|
|
1051
|
+
KOLKATA = "Asia/Kolkata",
|
|
1052
|
+
MUMBAI = "Asia/Kolkata",
|
|
1053
|
+
RIYADH = "Asia/Riyadh",
|
|
1054
|
+
TEHRAN = "Asia/Tehran",
|
|
1055
|
+
JERUSALEM = "Asia/Jerusalem",
|
|
1056
|
+
TEL_AVIV = "Asia/Tel_Aviv",
|
|
1057
|
+
BAGHDAD = "Asia/Baghdad",
|
|
1058
|
+
DHAKA = "Asia/Dhaka",
|
|
1059
|
+
KARA_CHI = "Asia/Karachi",
|
|
1060
|
+
KABUL = "Asia/Kabul",
|
|
1061
|
+
KATHMANDU = "Asia/Kathmandu",
|
|
1062
|
+
COLOMBO = "Asia/Colombo",
|
|
1063
|
+
TASHKENT = "Asia/Tashkent",
|
|
1064
|
+
ALMATY = "Asia/Almaty",
|
|
1065
|
+
PHNOM_PENH = "Asia/Phnom_Penh",
|
|
1066
|
+
VIENTIANE = "Asia/Vientiane",
|
|
1067
|
+
MUSCAT = "Asia/Muscat",
|
|
1068
|
+
SYDNEY = "Australia/Sydney",
|
|
1069
|
+
MELBOURNE = "Australia/Melbourne",
|
|
1070
|
+
BRISBANE = "Australia/Brisbane",
|
|
1071
|
+
PERTH = "Australia/Perth",
|
|
1072
|
+
ADELAIDE = "Australia/Adelaide",
|
|
1073
|
+
DARWIN = "Australia/Darwin",
|
|
1074
|
+
HOBART = "Australia/Hobart",
|
|
1075
|
+
AUCKLAND = "Pacific/Auckland",
|
|
1076
|
+
FIJI = "Pacific/Fiji",
|
|
1077
|
+
GUAM = "Pacific/Guam",
|
|
1078
|
+
NOUMEA = "Pacific/Noumea",
|
|
1079
|
+
PAGO_PAGO = "Pacific/Pago_Pago",
|
|
1080
|
+
PORT_MORESBY = "Pacific/Port_Moresby",
|
|
1081
|
+
SAO_PAULO = "America/Sao_Paulo",
|
|
1082
|
+
RIO_DE_JANEIRO = "America/Sao_Paulo",
|
|
1083
|
+
BUENOS_AIRES = "America/Argentina/Buenos_Aires",
|
|
1084
|
+
SANTIAGO = "America/Santiago",
|
|
1085
|
+
LIMA = "America/Lima",
|
|
1086
|
+
BOGOTA = "America/Bogota",
|
|
1087
|
+
CARACAS = "America/Caracas",
|
|
1088
|
+
LA_PAZ = "America/La_Paz",
|
|
1089
|
+
MONTEVIDEO = "America/Montevideo",
|
|
1090
|
+
QUITO = "America/Quito",
|
|
1091
|
+
ASUNCION = "America/Asuncion",
|
|
1092
|
+
GEORGETOWN = "America/Guyana",
|
|
1093
|
+
CAIRO = "Africa/Cairo",
|
|
1094
|
+
JOHANNESBURG = "Africa/Johannesburg",
|
|
1095
|
+
LAGOS = "Africa/Lagos",
|
|
1096
|
+
NAIROBI = "Africa/Nairobi",
|
|
1097
|
+
CASABLANCA = "Africa/Casablanca",
|
|
1098
|
+
ALGIERS = "Africa/Algiers",
|
|
1099
|
+
TUNIS = "Africa/Tunis",
|
|
1100
|
+
ADDIS_ABABA = "Africa/Addis_Ababa",
|
|
1101
|
+
ACCRA = "Africa/Accra",
|
|
1102
|
+
DAKAR = "Africa/Dakar",
|
|
1103
|
+
LUANDA = "Africa/Luanda",
|
|
1104
|
+
ANTANANARIVO = "Indian/Antananarivo",
|
|
1105
|
+
KINSHASA = "Africa/Kinshasa",
|
|
1106
|
+
DAR_ES_SALAAM = "Africa/Dar_es_Salaam",
|
|
1107
|
+
MCMURDO = "Antarctica/McMurdo",
|
|
1108
|
+
CASEY = "Antarctica/Casey"
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Type helper for secondaryTimeZone configuration
|
|
1112
|
+
* Allows using either the TimeZone enum or a raw IANA string.
|
|
1113
|
+
*/
|
|
1114
|
+
type TimeZoneValue = TimeZone | string;
|
|
1034
1115
|
|
|
1035
1116
|
/**
|
|
1036
1117
|
* Common Props interface for view components
|
|
1037
1118
|
* Base properties for all view components
|
|
1038
1119
|
*/
|
|
1039
|
-
interface BaseViewProps<TConfig =
|
|
1120
|
+
interface BaseViewProps<TConfig = unknown> {
|
|
1040
1121
|
app: ICalendarApp;
|
|
1041
1122
|
currentDate?: Date;
|
|
1042
1123
|
currentView?: ViewType;
|
|
@@ -1053,57 +1134,44 @@ interface BaseViewProps<TConfig = any> {
|
|
|
1053
1134
|
onDetailPanelToggle?: (eventId: string | null) => void;
|
|
1054
1135
|
customDetailPanelContent?: EventDetailContentRenderer;
|
|
1055
1136
|
customEventDetailDialog?: EventDetailDialogRenderer;
|
|
1056
|
-
calendarRef:
|
|
1137
|
+
calendarRef: RefObject<HTMLDivElement>;
|
|
1057
1138
|
switcherMode?: ViewSwitcherMode;
|
|
1058
|
-
meta?: Record<string,
|
|
1139
|
+
meta?: Record<string, unknown>;
|
|
1059
1140
|
}
|
|
1060
1141
|
/**
|
|
1061
1142
|
* Day view specific Props
|
|
1062
1143
|
*/
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1144
|
+
type DayViewProps = BaseViewProps<DayViewConfig>;
|
|
1065
1145
|
/**
|
|
1066
1146
|
* Week view specific Props
|
|
1067
1147
|
*/
|
|
1068
|
-
|
|
1069
|
-
}
|
|
1148
|
+
type WeekViewProps = BaseViewProps<WeekViewConfig>;
|
|
1070
1149
|
/**
|
|
1071
1150
|
* Month view specific Props
|
|
1072
1151
|
*/
|
|
1073
|
-
|
|
1074
|
-
}
|
|
1152
|
+
type MonthViewProps = BaseViewProps<MonthViewConfig>;
|
|
1075
1153
|
/**
|
|
1076
1154
|
* Year view specific Props
|
|
1077
1155
|
*/
|
|
1078
|
-
|
|
1079
|
-
}
|
|
1156
|
+
type YearViewProps = BaseViewProps<YearViewConfig>;
|
|
1080
1157
|
/**
|
|
1081
1158
|
* View factory configuration interface
|
|
1082
1159
|
* Base configuration for creating views
|
|
1083
1160
|
*/
|
|
1084
1161
|
interface ViewFactoryConfig {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
virtualScrollConfig?: Record<string, any>;
|
|
1091
|
-
viewConfig?: Record<string, any>;
|
|
1162
|
+
hourHeight?: number;
|
|
1163
|
+
firstHour?: number;
|
|
1164
|
+
lastHour?: number;
|
|
1165
|
+
allDayHeight?: number;
|
|
1166
|
+
timeFormat?: '12h' | '24h';
|
|
1092
1167
|
}
|
|
1093
1168
|
/**
|
|
1094
1169
|
* Day view factory configuration
|
|
1095
1170
|
*/
|
|
1096
1171
|
interface DayViewConfig extends ViewFactoryConfig {
|
|
1097
|
-
showMiniCalendar?: boolean;
|
|
1098
1172
|
showAllDay?: boolean;
|
|
1099
1173
|
scrollToCurrentTime?: boolean;
|
|
1100
|
-
|
|
1101
|
-
firstHour?: number;
|
|
1102
|
-
lastHour?: number;
|
|
1103
|
-
HOUR_HEIGHT?: number;
|
|
1104
|
-
FIRST_HOUR?: number;
|
|
1105
|
-
LAST_HOUR?: number;
|
|
1106
|
-
ALL_DAY_HEIGHT?: number;
|
|
1174
|
+
secondaryTimeZone?: TimeZoneValue;
|
|
1107
1175
|
}
|
|
1108
1176
|
/**
|
|
1109
1177
|
* Week view factory configuration
|
|
@@ -1113,32 +1181,23 @@ interface WeekViewConfig extends ViewFactoryConfig {
|
|
|
1113
1181
|
showAllDay?: boolean;
|
|
1114
1182
|
startOfWeek?: number;
|
|
1115
1183
|
scrollToCurrentTime?: boolean;
|
|
1116
|
-
|
|
1117
|
-
firstHour?: number;
|
|
1118
|
-
lastHour?: number;
|
|
1119
|
-
HOUR_HEIGHT?: number;
|
|
1120
|
-
FIRST_HOUR?: number;
|
|
1121
|
-
LAST_HOUR?: number;
|
|
1122
|
-
ALL_DAY_HEIGHT?: number;
|
|
1184
|
+
secondaryTimeZone?: TimeZoneValue;
|
|
1123
1185
|
}
|
|
1124
1186
|
/**
|
|
1125
1187
|
* Month view factory configuration
|
|
1126
1188
|
*/
|
|
1127
1189
|
interface MonthViewConfig extends ViewFactoryConfig {
|
|
1128
|
-
showOtherMonth?: boolean;
|
|
1129
|
-
weekHeight?: number;
|
|
1130
1190
|
showWeekNumbers?: boolean;
|
|
1131
|
-
|
|
1132
|
-
|
|
1191
|
+
showMonthIndicator?: boolean;
|
|
1192
|
+
startOfWeek?: number;
|
|
1133
1193
|
}
|
|
1134
1194
|
/**
|
|
1135
1195
|
* Year view factory configuration
|
|
1136
1196
|
*/
|
|
1137
1197
|
interface YearViewConfig extends ViewFactoryConfig {
|
|
1138
|
-
enableVirtualScroll?: boolean;
|
|
1139
|
-
showDebugInfo?: boolean;
|
|
1140
1198
|
mode?: 'year-canvas' | 'fixed-week';
|
|
1141
1199
|
showTimedEventsInYearView?: boolean;
|
|
1200
|
+
startOfWeek?: number;
|
|
1142
1201
|
}
|
|
1143
1202
|
/**
|
|
1144
1203
|
* View adapter Props
|
|
@@ -1146,7 +1205,7 @@ interface YearViewConfig extends ViewFactoryConfig {
|
|
|
1146
1205
|
*/
|
|
1147
1206
|
interface ViewAdapterProps extends BaseViewProps {
|
|
1148
1207
|
viewType: ViewType;
|
|
1149
|
-
originalComponent: any
|
|
1208
|
+
originalComponent: AnyComponent<any, any>;
|
|
1150
1209
|
config: ViewFactoryConfig;
|
|
1151
1210
|
className?: string;
|
|
1152
1211
|
}
|
|
@@ -1157,8 +1216,8 @@ interface ViewAdapterProps extends BaseViewProps {
|
|
|
1157
1216
|
interface DragIntegrationProps {
|
|
1158
1217
|
app: ICalendarApp;
|
|
1159
1218
|
viewType: ViewType;
|
|
1160
|
-
calendarRef:
|
|
1161
|
-
allDayRowRef?:
|
|
1219
|
+
calendarRef: RefObject<HTMLDivElement>;
|
|
1220
|
+
allDayRowRef?: RefObject<HTMLDivElement>;
|
|
1162
1221
|
events: Event[];
|
|
1163
1222
|
onEventsUpdate: (updateFunc: (events: Event[]) => Event[]) => void;
|
|
1164
1223
|
onEventCreate: (event: Event) => void;
|
|
@@ -1235,10 +1294,10 @@ interface EventsPluginConfig {
|
|
|
1235
1294
|
* Drag Hook options
|
|
1236
1295
|
*/
|
|
1237
1296
|
interface DragHookOptions extends Partial<DragConfig> {
|
|
1238
|
-
calendarRef:
|
|
1239
|
-
allDayRowRef?:
|
|
1297
|
+
calendarRef: unknown;
|
|
1298
|
+
allDayRowRef?: unknown;
|
|
1240
1299
|
viewType: ViewType;
|
|
1241
|
-
onEventsUpdate: (updateFunc: (events: Event[]) => Event[], isResizing?: boolean) => void;
|
|
1300
|
+
onEventsUpdate: (updateFunc: (events: Event[]) => Event[], isResizing?: boolean, source?: 'drag' | 'resize') => void;
|
|
1242
1301
|
onEventCreate: (event: Event) => void;
|
|
1243
1302
|
onEventEdit: (event: Event) => void;
|
|
1244
1303
|
currentWeekStart: Date;
|
|
@@ -1246,15 +1305,18 @@ interface DragHookOptions extends Partial<DragConfig> {
|
|
|
1246
1305
|
calculateNewEventLayout?: (dayIndex: number, startHour: number, endHour: number) => EventLayout | null;
|
|
1247
1306
|
calculateDragLayout?: (event: Event, targetDay: number, targetStartHour: number, targetEndHour: number) => EventLayout | null;
|
|
1248
1307
|
isMobile?: boolean;
|
|
1308
|
+
timeGridRef?: unknown;
|
|
1309
|
+
gridWidth?: string;
|
|
1310
|
+
displayDays?: number;
|
|
1249
1311
|
}
|
|
1250
1312
|
/**
|
|
1251
1313
|
* Drag Hook return value
|
|
1252
1314
|
*/
|
|
1253
1315
|
interface DragHookReturn {
|
|
1254
|
-
handleMoveStart?: (e:
|
|
1255
|
-
handleCreateStart?: (e:
|
|
1256
|
-
handleResizeStart?: (e:
|
|
1257
|
-
handleCreateAllDayEvent?: (e:
|
|
1316
|
+
handleMoveStart?: (e: unknown, event: Event) => void;
|
|
1317
|
+
handleCreateStart?: (e: unknown, ...args: (Date | number)[]) => void;
|
|
1318
|
+
handleResizeStart?: (e: unknown, event: Event, direction: string) => void;
|
|
1319
|
+
handleCreateAllDayEvent?: (e: unknown, dayIndex: number) => void;
|
|
1258
1320
|
dragState: MonthDragState | WeekDayDragState;
|
|
1259
1321
|
isDragging: boolean;
|
|
1260
1322
|
}
|
|
@@ -1267,6 +1329,8 @@ interface DragPluginConfig {
|
|
|
1267
1329
|
enableCreate: boolean;
|
|
1268
1330
|
enableAllDayCreate: boolean;
|
|
1269
1331
|
supportedViews: ViewType[];
|
|
1332
|
+
onEventDrop?: (updatedEvent: Event, originalEvent: Event) => void | Promise<void>;
|
|
1333
|
+
onEventResize?: (updatedEvent: Event, originalEvent: Event) => void | Promise<void>;
|
|
1270
1334
|
[key: string]: unknown;
|
|
1271
1335
|
}
|
|
1272
1336
|
/**
|
|
@@ -1279,6 +1343,71 @@ interface DragService {
|
|
|
1279
1343
|
isViewSupported: (viewType: ViewType) => boolean;
|
|
1280
1344
|
}
|
|
1281
1345
|
|
|
1346
|
+
/**
|
|
1347
|
+
* Virtual scroll item interface (YearView)
|
|
1348
|
+
*/
|
|
1349
|
+
interface VirtualItem {
|
|
1350
|
+
index: number;
|
|
1351
|
+
year: number;
|
|
1352
|
+
top: number;
|
|
1353
|
+
height: number;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Virtual scroll Hook parameters interface (YearView)
|
|
1357
|
+
*/
|
|
1358
|
+
interface UseVirtualScrollProps {
|
|
1359
|
+
currentDate: Date;
|
|
1360
|
+
yearHeight: number;
|
|
1361
|
+
onCurrentYearChange?: (year: number) => void;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Virtual scroll item interface (YearView)
|
|
1366
|
+
*/
|
|
1367
|
+
/**
|
|
1368
|
+
* Virtual scroll Hook return value interface (YearView)
|
|
1369
|
+
*/
|
|
1370
|
+
interface UseVirtualScrollReturn {
|
|
1371
|
+
scrollTop: number;
|
|
1372
|
+
containerHeight: number;
|
|
1373
|
+
currentYear: number;
|
|
1374
|
+
isScrolling: boolean;
|
|
1375
|
+
virtualData: {
|
|
1376
|
+
totalHeight: number;
|
|
1377
|
+
visibleItems: VirtualItem[];
|
|
1378
|
+
};
|
|
1379
|
+
scrollElementRef: RefObject<HTMLDivElement>;
|
|
1380
|
+
handleScroll: (e: JSX.TargetedEvent<HTMLDivElement, globalThis.Event>) => void;
|
|
1381
|
+
scrollToYear: (targetYear: number, smooth?: boolean) => void;
|
|
1382
|
+
handlePreviousYear: () => void;
|
|
1383
|
+
handleNextYear: () => void;
|
|
1384
|
+
handleToday: () => void;
|
|
1385
|
+
setScrollTop: (val: number | ((prev: number) => number)) => void;
|
|
1386
|
+
setContainerHeight: (val: number | ((prev: number) => number)) => void;
|
|
1387
|
+
setCurrentYear: (val: number | ((prev: number) => number)) => void;
|
|
1388
|
+
setIsScrolling: (val: boolean | ((prev: boolean) => boolean)) => void;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Mobile event drawer/dialog Props
|
|
1393
|
+
*/
|
|
1394
|
+
interface MobileEventProps {
|
|
1395
|
+
/** Whether the drawer/dialog is open */
|
|
1396
|
+
isOpen: boolean;
|
|
1397
|
+
/** Callback to close the drawer/dialog */
|
|
1398
|
+
onClose: () => void;
|
|
1399
|
+
/** Callback to save the event (creates or updates) */
|
|
1400
|
+
onSave: (event: Event) => void;
|
|
1401
|
+
/** Callback to delete an existing event by id */
|
|
1402
|
+
onEventDelete?: (id: string) => void;
|
|
1403
|
+
/** Current event data (newly created template or existing event) */
|
|
1404
|
+
draftEvent: Event | null;
|
|
1405
|
+
/** The ICalendarApp instance providing built-in services */
|
|
1406
|
+
app: ICalendarApp;
|
|
1407
|
+
/** Time format for event display */
|
|
1408
|
+
timeFormat?: '12h' | '24h';
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1282
1411
|
declare class CalendarApp implements ICalendarApp {
|
|
1283
1412
|
state: CalendarAppState;
|
|
1284
1413
|
private callbacks;
|
|
@@ -1292,10 +1421,11 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1292
1421
|
private listeners;
|
|
1293
1422
|
private undoStack;
|
|
1294
1423
|
private pendingSnapshot;
|
|
1424
|
+
private pendingChangeSource;
|
|
1295
1425
|
private readonly MAX_UNDO_STACK;
|
|
1296
1426
|
constructor(config: CalendarAppConfig);
|
|
1297
1427
|
private setupStoreListeners;
|
|
1298
|
-
private resolveLocale;
|
|
1428
|
+
private static resolveLocale;
|
|
1299
1429
|
subscribe: (listener: (app: ICalendarApp) => void) => (() => void);
|
|
1300
1430
|
private notify;
|
|
1301
1431
|
private pushToUndo;
|
|
@@ -1325,9 +1455,9 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1325
1455
|
updates: Partial<Event>;
|
|
1326
1456
|
}>;
|
|
1327
1457
|
delete?: string[];
|
|
1328
|
-
}, isPending?: boolean) => void;
|
|
1458
|
+
}, isPending?: boolean, source?: "drag" | "resize") => void;
|
|
1329
1459
|
addEvent: (event: Event) => void;
|
|
1330
|
-
updateEvent: (id: string, eventUpdate: Partial<Event>, isPending?: boolean) => void;
|
|
1460
|
+
updateEvent: (id: string, eventUpdate: Partial<Event>, isPending?: boolean, source?: "drag" | "resize") => void;
|
|
1331
1461
|
deleteEvent: (id: string) => void;
|
|
1332
1462
|
getAllEvents: () => Event[];
|
|
1333
1463
|
onEventClick: (event: Event) => void;
|
|
@@ -1344,7 +1474,7 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1344
1474
|
createCalendar: (calendar: CalendarType) => void;
|
|
1345
1475
|
deleteCalendar: (id: string) => void;
|
|
1346
1476
|
mergeCalendars: (sourceId: string, targetId: string) => void;
|
|
1347
|
-
getCalendarHeaderConfig: () => boolean | ((props:
|
|
1477
|
+
getCalendarHeaderConfig: () => boolean | ((props: CalendarHeaderProps) => TNode);
|
|
1348
1478
|
private installPlugin;
|
|
1349
1479
|
getPlugin: <T = unknown>(name: string) => T | undefined;
|
|
1350
1480
|
hasPlugin: (name: string) => boolean;
|
|
@@ -1383,7 +1513,7 @@ interface CustomRendering {
|
|
|
1383
1513
|
id: string;
|
|
1384
1514
|
containerEl: HTMLElement;
|
|
1385
1515
|
generatorName: string;
|
|
1386
|
-
generatorArgs:
|
|
1516
|
+
generatorArgs: unknown;
|
|
1387
1517
|
}
|
|
1388
1518
|
type CustomRenderingListener = (map: Map<string, CustomRendering>) => void;
|
|
1389
1519
|
declare class CustomRenderingStore {
|
|
@@ -1425,7 +1555,7 @@ declare class CalendarRenderer {
|
|
|
1425
1555
|
private renderRequested;
|
|
1426
1556
|
private extraProps;
|
|
1427
1557
|
constructor(app: ICalendarApp, initialOverrides?: string[]);
|
|
1428
|
-
setProps(props: Record<string,
|
|
1558
|
+
setProps(props: Record<string, unknown>): void;
|
|
1429
1559
|
private requestRender;
|
|
1430
1560
|
/**
|
|
1431
1561
|
* Mount the calendar to a DOM container.
|
|
@@ -1474,6 +1604,12 @@ declare const getStartOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.Pla
|
|
|
1474
1604
|
* @returns End of day
|
|
1475
1605
|
*/
|
|
1476
1606
|
declare const getEndOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => Date | Temporal.ZonedDateTime;
|
|
1607
|
+
/**
|
|
1608
|
+
* Get the ISO week number for a given date
|
|
1609
|
+
* @param date Date object
|
|
1610
|
+
* @returns Week number (1-53)
|
|
1611
|
+
*/
|
|
1612
|
+
declare const getWeekNumber: (date: Date) => number;
|
|
1477
1613
|
/**
|
|
1478
1614
|
* Check if two dates are on the same day
|
|
1479
1615
|
* @param date1 Date 1
|
|
@@ -1529,18 +1665,29 @@ declare const getLineColor: (calendarIdOrColor: string, registry?: CalendarRegis
|
|
|
1529
1665
|
*/
|
|
1530
1666
|
declare const TIME_STEP = 0.25;
|
|
1531
1667
|
/**
|
|
1532
|
-
* Format hours and minutes to HH:MM format
|
|
1668
|
+
* Format hours and minutes to HH:MM format or 12h format (e.g. 1AM)
|
|
1533
1669
|
* @param hours Hour number (supports decimals, e.g., 14.5 = 14:30)
|
|
1534
1670
|
* @param minutes Optional minutes (if not provided, extracted from decimal hours)
|
|
1535
|
-
* @
|
|
1671
|
+
* @param format Time format ('12h' or '24h', defaults to '24h')
|
|
1672
|
+
* @param showUnits Whether to show AM/PM for 12h format (defaults to true)
|
|
1673
|
+
* @returns Formatted time string (e.g., "14:30" or "2PM")
|
|
1536
1674
|
*/
|
|
1537
|
-
declare const formatTime: (hours: number, minutes?: number) => string;
|
|
1675
|
+
declare const formatTime: (hours: number, minutes?: number, format?: "12h" | "24h", showUnits?: boolean) => string;
|
|
1676
|
+
/**
|
|
1677
|
+
* Get event end hour (handles cross-day events less than 24 hours)
|
|
1678
|
+
* When an event ends exactly at midnight of the next day and duration is less than 24 hours,
|
|
1679
|
+
* it should be treated as 24:00 of the current day in week/day views to avoid displaying as next day 00:00.
|
|
1680
|
+
* @param event Event object
|
|
1681
|
+
* @returns End hour (0-24)
|
|
1682
|
+
*/
|
|
1683
|
+
declare const getEventEndHour: (event: Event) => number;
|
|
1538
1684
|
/**
|
|
1539
1685
|
* Format event time range as a string
|
|
1540
1686
|
* @param event Event object
|
|
1687
|
+
* @param format Time format ('12h' or '24h', defaults to '24h')
|
|
1541
1688
|
* @returns Formatted time range (e.g., "14:00 - 16:00" or "All day")
|
|
1542
1689
|
*/
|
|
1543
|
-
declare const formatEventTimeRange: (event: Event) => string;
|
|
1690
|
+
declare const formatEventTimeRange: (event: Event, format?: "12h" | "24h") => string;
|
|
1544
1691
|
/**
|
|
1545
1692
|
* Round hour to nearest time step
|
|
1546
1693
|
* @param hour Hour number
|
|
@@ -1548,13 +1695,27 @@ declare const formatEventTimeRange: (event: Event) => string;
|
|
|
1548
1695
|
*/
|
|
1549
1696
|
declare const roundToTimeStep: (hour: number) => number;
|
|
1550
1697
|
/**
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
* @param
|
|
1555
|
-
* @
|
|
1698
|
+
* Generate secondary timezone time labels for each primary time slot.
|
|
1699
|
+
* Uses Temporal to correctly handle DST and timezone conversions.
|
|
1700
|
+
*
|
|
1701
|
+
* @param timeSlots Primary time slots array
|
|
1702
|
+
* @param secondaryTimeZone Secondary IANA timezone identifier
|
|
1703
|
+
* @param timeFormat Time format ('12h' or '24h')
|
|
1704
|
+
* @param referenceDate Reference date used for DST-accurate conversion (defaults to today)
|
|
1705
|
+
* @returns Array of formatted time strings for the secondary timezone
|
|
1706
|
+
*/
|
|
1707
|
+
declare const generateSecondaryTimeSlots: (timeSlots: Array<{
|
|
1708
|
+
hour: number;
|
|
1709
|
+
label: string;
|
|
1710
|
+
}>, secondaryTimeZone: TimeZoneValue, timeFormat?: "12h" | "24h", referenceDate?: Date) => string[];
|
|
1711
|
+
/**
|
|
1712
|
+
* Get a short display label for a timezone, e.g. "CST" or "GMT+8".
|
|
1713
|
+
*
|
|
1714
|
+
* @param timeZone IANA timezone identifier
|
|
1715
|
+
* @param date Reference date for DST-aware abbreviation (defaults to today)
|
|
1716
|
+
* @returns Short timezone label
|
|
1556
1717
|
*/
|
|
1557
|
-
declare const
|
|
1718
|
+
declare const getTimezoneDisplayLabel: (timeZone: TimeZoneValue, date?: Date) => string;
|
|
1558
1719
|
|
|
1559
1720
|
/**
|
|
1560
1721
|
* Date Constants
|
|
@@ -1586,19 +1747,21 @@ declare const shortMonthNames: string[];
|
|
|
1586
1747
|
* for week-based operations (Monday-Sunday).
|
|
1587
1748
|
*/
|
|
1588
1749
|
/**
|
|
1589
|
-
* Get the
|
|
1750
|
+
* Get the week range for a given date
|
|
1590
1751
|
* @param date Input date
|
|
1591
|
-
* @
|
|
1752
|
+
* @param startOfWeek Week start day (0: Sunday, 1: Monday, etc.)
|
|
1753
|
+
* @returns Object with monday and sunday dates (monday and sunday here are just start/end of week)
|
|
1592
1754
|
*/
|
|
1593
|
-
declare const getWeekRange: (date: Date) => {
|
|
1755
|
+
declare const getWeekRange: (date: Date, startOfWeek?: number) => {
|
|
1594
1756
|
monday: Date;
|
|
1595
1757
|
sunday: Date;
|
|
1596
1758
|
};
|
|
1597
1759
|
/**
|
|
1598
|
-
* Get current week dates
|
|
1760
|
+
* Get current week dates with today indicator
|
|
1761
|
+
* @param startOfWeek Week start day (0: Sun, 1: Mon, etc.)
|
|
1599
1762
|
* @returns Array of 7 date objects with date, month, and isToday flag
|
|
1600
1763
|
*/
|
|
1601
|
-
declare const getCurrentWeekDates: () => {
|
|
1764
|
+
declare const getCurrentWeekDates: (startOfWeek?: number) => {
|
|
1602
1765
|
date: number;
|
|
1603
1766
|
month: string;
|
|
1604
1767
|
isToday: boolean;
|
|
@@ -1625,6 +1788,16 @@ declare const generateDayData: (date: string | number | Date) => {
|
|
|
1625
1788
|
shortMonthName: string;
|
|
1626
1789
|
isToday: boolean;
|
|
1627
1790
|
};
|
|
1791
|
+
/**
|
|
1792
|
+
* Determine which month and year a week belongs to (based on majority of days)
|
|
1793
|
+
* @param days Array of day data
|
|
1794
|
+
* @returns Month name, month index, and year
|
|
1795
|
+
*/
|
|
1796
|
+
declare const getMonthYearOfWeek: (days: DayData[]) => {
|
|
1797
|
+
month: string;
|
|
1798
|
+
monthIndex: number;
|
|
1799
|
+
year: number;
|
|
1800
|
+
};
|
|
1628
1801
|
/**
|
|
1629
1802
|
* Generate week data (7 days starting from given date)
|
|
1630
1803
|
* @param startDate Week start date
|
|
@@ -1647,16 +1820,6 @@ declare const generateWeekData: (startDate: string | number | Date) => {
|
|
|
1647
1820
|
year: number;
|
|
1648
1821
|
};
|
|
1649
1822
|
};
|
|
1650
|
-
/**
|
|
1651
|
-
* Determine which month and year a week belongs to (based on majority of days)
|
|
1652
|
-
* @param days Array of day data
|
|
1653
|
-
* @returns Month name, month index, and year
|
|
1654
|
-
*/
|
|
1655
|
-
declare const getMonthYearOfWeek: (days: DayData[]) => {
|
|
1656
|
-
month: string;
|
|
1657
|
-
monthIndex: number;
|
|
1658
|
-
year: number;
|
|
1659
|
-
};
|
|
1660
1823
|
/**
|
|
1661
1824
|
* Generate weeks data around a central date
|
|
1662
1825
|
* @param centralDate Central date for range
|
|
@@ -1684,9 +1847,10 @@ declare const generateWeeksData: (centralDate: Date, monthsToLoad?: number) => {
|
|
|
1684
1847
|
* Generate week range around a center date
|
|
1685
1848
|
* @param centerDate Center date for range
|
|
1686
1849
|
* @param totalWeeks Total number of weeks to generate
|
|
1850
|
+
* @param startOfWeek Week start day (0: Sunday, 1: Monday, etc.)
|
|
1687
1851
|
* @returns Array of weeks data
|
|
1688
1852
|
*/
|
|
1689
|
-
declare function generateWeekRange(centerDate: Date, totalWeeks: number): WeeksData[];
|
|
1853
|
+
declare function generateWeekRange(centerDate: Date, totalWeeks: number, startOfWeek?: number): WeeksData[];
|
|
1690
1854
|
|
|
1691
1855
|
/**
|
|
1692
1856
|
* Event Utilities
|
|
@@ -1786,13 +1950,33 @@ declare const createEventWithRealDate: (eventData: Omit<Event, "start" | "end">,
|
|
|
1786
1950
|
* @returns Updated event
|
|
1787
1951
|
*/
|
|
1788
1952
|
declare const updateEventWithRealDate: (event: Event, newDayIndex: number, weekStart: Date) => Event;
|
|
1953
|
+
/**
|
|
1954
|
+
* Create event with PlainDateTime (default for local events)
|
|
1955
|
+
* This is the recommended function for creating events without timezone complexity
|
|
1956
|
+
*/
|
|
1957
|
+
declare const createEventWithPlainDateTime: (eventData: Omit<Event, "start" | "end">, weekStart: Date) => Event;
|
|
1958
|
+
/**
|
|
1959
|
+
* Create event with ZonedDateTime (for timezone-aware events)
|
|
1960
|
+
* Use when explicit timezone control is needed
|
|
1961
|
+
*/
|
|
1962
|
+
declare const createEventWithZonedDateTime: (eventData: Omit<Event, "start" | "end">, weekStart: Date, timeZone: string) => Event;
|
|
1789
1963
|
/**
|
|
1790
1964
|
* Compare two events for equality
|
|
1791
1965
|
* @param event1 First event
|
|
1792
1966
|
* @param event2 Second event
|
|
1793
1967
|
* @returns Whether events are equal in content
|
|
1794
1968
|
*/
|
|
1795
|
-
declare const
|
|
1969
|
+
declare const isEventDeepEqual: (event1: Event | null, event2: Event | null) => boolean;
|
|
1970
|
+
/**
|
|
1971
|
+
* Check if event's primary fields (start, end, title) have changed.
|
|
1972
|
+
* This is commonly used to determine if an event update should be persisted
|
|
1973
|
+
* after a drag or resize operation.
|
|
1974
|
+
*
|
|
1975
|
+
* @param oldEvent Original event
|
|
1976
|
+
* @param newEvent Updated event
|
|
1977
|
+
* @returns Whether primary fields have changed
|
|
1978
|
+
*/
|
|
1979
|
+
declare const hasEventChanged: (oldEvent: Event, newEvent: Event) => boolean;
|
|
1796
1980
|
|
|
1797
1981
|
/**
|
|
1798
1982
|
* Test Data Generation Utilities
|
|
@@ -1825,7 +2009,7 @@ declare function generateUniKey(): string;
|
|
|
1825
2009
|
* Performs a deep comparison between two values to determine if they are equivalent.
|
|
1826
2010
|
* Supports primitives, Date objects, and plain objects/arrays.
|
|
1827
2011
|
*/
|
|
1828
|
-
declare function isDeepEqual(a:
|
|
2012
|
+
declare function isDeepEqual(a: unknown, b: unknown): boolean;
|
|
1829
2013
|
|
|
1830
2014
|
/**
|
|
1831
2015
|
* Format date to DD/MM/YYYY format
|
|
@@ -1852,15 +2036,15 @@ declare const formatDate: (temporal: Temporal.PlainDate | Temporal.PlainDateTime
|
|
|
1852
2036
|
/**
|
|
1853
2037
|
* Check if temporal is PlainDate (date only, no time)
|
|
1854
2038
|
*/
|
|
1855
|
-
declare function isPlainDate(temporal:
|
|
2039
|
+
declare function isPlainDate(temporal: unknown): temporal is Temporal.PlainDate;
|
|
1856
2040
|
/**
|
|
1857
2041
|
* Check if temporal is PlainDateTime (date + time, no timezone)
|
|
1858
2042
|
*/
|
|
1859
|
-
declare function isPlainDateTime(temporal:
|
|
2043
|
+
declare function isPlainDateTime(temporal: unknown): temporal is Temporal.PlainDateTime;
|
|
1860
2044
|
/**
|
|
1861
2045
|
* Check if temporal is ZonedDateTime (date + time + timezone)
|
|
1862
2046
|
*/
|
|
1863
|
-
declare function isZonedDateTime(temporal:
|
|
2047
|
+
declare function isZonedDateTime(temporal: unknown): temporal is Temporal.ZonedDateTime;
|
|
1864
2048
|
/**
|
|
1865
2049
|
* Convert any Temporal type or Date to Date (for internal processing)
|
|
1866
2050
|
* Handles all three Temporal types and native Date uniformly
|
|
@@ -1897,14 +2081,14 @@ declare function extractHourFromTemporal(temporal: Temporal.PlainDate | Temporal
|
|
|
1897
2081
|
* @param hour Hour with decimals (e.g., 14.5 = 14:30)
|
|
1898
2082
|
*/
|
|
1899
2083
|
declare function setHourInTemporal(temporal: Temporal.PlainDateTime | Temporal.ZonedDateTime, hour: number): Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
1900
|
-
/**
|
|
1901
|
-
* Check if two Temporal objects represent the same day
|
|
1902
|
-
*/
|
|
1903
|
-
declare function isSameTemporal(t1: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | Date, t2: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | Date): boolean;
|
|
1904
2084
|
/**
|
|
1905
2085
|
* Get PlainDate from any Temporal type or Date
|
|
1906
2086
|
*/
|
|
1907
2087
|
declare function getPlainDate(temporal: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | Date): Temporal.PlainDate;
|
|
2088
|
+
/**
|
|
2089
|
+
* Check if two Temporal objects represent the same day
|
|
2090
|
+
*/
|
|
2091
|
+
declare function isSameTemporal(t1: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | Date, t2: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | Date): boolean;
|
|
1908
2092
|
|
|
1909
2093
|
/**
|
|
1910
2094
|
* Temporal API utility functions
|
|
@@ -1914,7 +2098,7 @@ declare function getPlainDate(temporal: Temporal.PlainDate | Temporal.PlainDateT
|
|
|
1914
2098
|
/**
|
|
1915
2099
|
* Check if value is Date object
|
|
1916
2100
|
*/
|
|
1917
|
-
declare function isDate(value:
|
|
2101
|
+
declare function isDate(value: unknown): value is Date;
|
|
1918
2102
|
/**
|
|
1919
2103
|
* Convert Temporal.ZonedDateTime to Date
|
|
1920
2104
|
* @param zdt Temporal.ZonedDateTime
|
|
@@ -2125,7 +2309,7 @@ interface CreateEventParams {
|
|
|
2125
2309
|
end: Date | Temporal.PlainDate | Temporal.PlainDateTime;
|
|
2126
2310
|
allDay?: boolean;
|
|
2127
2311
|
calendarId?: string;
|
|
2128
|
-
meta?: Record<string,
|
|
2312
|
+
meta?: Record<string, unknown>;
|
|
2129
2313
|
}
|
|
2130
2314
|
/**
|
|
2131
2315
|
* Timezone event creation parameters
|
|
@@ -2139,7 +2323,7 @@ interface CreateTimezoneEventParams {
|
|
|
2139
2323
|
end: Date | Temporal.ZonedDateTime;
|
|
2140
2324
|
timeZone: string;
|
|
2141
2325
|
calendarId?: string;
|
|
2142
|
-
meta?: Record<string,
|
|
2326
|
+
meta?: Record<string, unknown>;
|
|
2143
2327
|
}
|
|
2144
2328
|
/**
|
|
2145
2329
|
* Create local event (recommended for most use cases)
|
|
@@ -2234,7 +2418,7 @@ declare function createTimedEvent(id: string, title: string, start: Date, end: D
|
|
|
2234
2418
|
declare function convertDateEvent(id: string, title: string, startDate: Date, endDate: Date, allDay?: boolean, options?: {
|
|
2235
2419
|
description?: string;
|
|
2236
2420
|
calendarId?: string;
|
|
2237
|
-
meta?: Record<string,
|
|
2421
|
+
meta?: Record<string, unknown>;
|
|
2238
2422
|
}): Event;
|
|
2239
2423
|
/**
|
|
2240
2424
|
* Convert legacy Date-based event to timezone-aware event
|
|
@@ -2243,12 +2427,12 @@ declare function convertDateEvent(id: string, title: string, startDate: Date, en
|
|
|
2243
2427
|
declare function convertDateEventWithTimeZone(id: string, title: string, startDate: Date, endDate: Date, timeZone: string, options?: {
|
|
2244
2428
|
description?: string;
|
|
2245
2429
|
calendarId?: string;
|
|
2246
|
-
meta?: Record<string,
|
|
2430
|
+
meta?: Record<string, unknown>;
|
|
2247
2431
|
}): Event;
|
|
2248
2432
|
|
|
2249
2433
|
type CalendarSearchEvent = Event & {
|
|
2250
2434
|
color?: string;
|
|
2251
|
-
[key: string]:
|
|
2435
|
+
[key: string]: unknown;
|
|
2252
2436
|
};
|
|
2253
2437
|
|
|
2254
2438
|
/**
|
|
@@ -2256,7 +2440,7 @@ type CalendarSearchEvent = Event & {
|
|
|
2256
2440
|
* @param dateInput Date, string, or Temporal object
|
|
2257
2441
|
* @returns Date object
|
|
2258
2442
|
*/
|
|
2259
|
-
declare const getDateObj: (dateInput:
|
|
2443
|
+
declare const getDateObj: (dateInput: unknown) => Date;
|
|
2260
2444
|
/**
|
|
2261
2445
|
* Helper to normalize date (reset time to 00:00:00)
|
|
2262
2446
|
* @param date Date object
|
|
@@ -2271,7 +2455,7 @@ declare const normalizeDate: (date: Date) => Date;
|
|
|
2271
2455
|
* @param t Translation function
|
|
2272
2456
|
* @returns Object with title and colorClass
|
|
2273
2457
|
*/
|
|
2274
|
-
declare const getSearchHeaderInfo: (groupDate: Date, today: Date, locale: string, t: (key:
|
|
2458
|
+
declare const getSearchHeaderInfo: (groupDate: Date, today: Date, locale: string, t: (key: TranslationKey) => string) => {
|
|
2275
2459
|
title: string;
|
|
2276
2460
|
colorClass: string;
|
|
2277
2461
|
};
|
|
@@ -2388,17 +2572,9 @@ interface ICSParseError {
|
|
|
2388
2572
|
}
|
|
2389
2573
|
|
|
2390
2574
|
/**
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2393
|
-
* Convert between ICS date formats (RFC 5545) and Temporal API types.
|
|
2394
|
-
*
|
|
2395
|
-
* ICS Date Formats:
|
|
2396
|
-
* 1. DATE (all-day): YYYYMMDD (e.g., 20250115)
|
|
2397
|
-
* 2. DATE-TIME (local): YYYYMMDDTHHMMSS (e.g., 20250115T143000)
|
|
2398
|
-
* 3. DATE-TIME (UTC): YYYYMMDDTHHMMSSZ (e.g., 20250115T143000Z)
|
|
2399
|
-
* 4. DATE-TIME (with TZID): DTSTART;TZID=America/New_York:20250115T143000
|
|
2575
|
+
* Pad number to 2 digits
|
|
2400
2576
|
*/
|
|
2401
|
-
|
|
2577
|
+
declare function pad2(num: number | string): string;
|
|
2402
2578
|
/**
|
|
2403
2579
|
* Parse ICS date string to Temporal type
|
|
2404
2580
|
*
|
|
@@ -2423,6 +2599,14 @@ declare function formatICSDate(temporal: Temporal.PlainDate | Temporal.PlainDate
|
|
|
2423
2599
|
* Format a Date to ICS timestamp (UTC format for DTSTAMP)
|
|
2424
2600
|
*/
|
|
2425
2601
|
declare function formatDateToICSTimestamp(date: Date): string;
|
|
2602
|
+
declare function escapeICSValue(value: string): string;
|
|
2603
|
+
declare function unescapeICSValue(value: string): string;
|
|
2604
|
+
declare function foldLine(line: string): string;
|
|
2605
|
+
declare function formatProperty(name: string, value: string, params?: Record<string, string>): string;
|
|
2606
|
+
declare function generateVEvent(event: Event): string[];
|
|
2607
|
+
declare function extractVEvents(lines: string[]): string[][];
|
|
2608
|
+
declare function parseVEventLines(lines: string[]): ICSVEvent;
|
|
2609
|
+
declare function convertToDayFlowEvent(icsEvent: ICSVEvent, options: ICSImportOptions): Event;
|
|
2426
2610
|
|
|
2427
2611
|
/**
|
|
2428
2612
|
* ICS Parser
|
|
@@ -2494,9 +2678,9 @@ declare function getIntlLabel(key: 'today' | 'day' | 'week' | 'month' | 'year',
|
|
|
2494
2678
|
*/
|
|
2495
2679
|
declare function capitalize(str: string): string;
|
|
2496
2680
|
/**
|
|
2497
|
-
* Get localized weekday labels (
|
|
2681
|
+
* Get localized weekday labels starting from startOfWeek (0: Sun, 1: Mon, etc.)
|
|
2498
2682
|
*/
|
|
2499
|
-
declare const getWeekDaysLabels: (locale: string, format?: "long" | "short" | "narrow") => string[];
|
|
2683
|
+
declare const getWeekDaysLabels: (locale: string, format?: "long" | "short" | "narrow", startOfWeek?: number) => string[];
|
|
2500
2684
|
/**
|
|
2501
2685
|
* Get localized month labels
|
|
2502
2686
|
*/
|
|
@@ -2531,7 +2715,7 @@ declare function isValidLocale(locale: string): boolean;
|
|
|
2531
2715
|
interface LocaleContextValue {
|
|
2532
2716
|
locale: LocaleCode;
|
|
2533
2717
|
t: (key: TranslationKey, vars?: Record<string, string>) => string;
|
|
2534
|
-
getWeekDaysLabels: (locale: string, format?: 'long' | 'short' | 'narrow') => string[];
|
|
2718
|
+
getWeekDaysLabels: (locale: string, format?: 'long' | 'short' | 'narrow', startOfWeek?: number) => string[];
|
|
2535
2719
|
getMonthLabels: (locale: string, format?: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit') => string[];
|
|
2536
2720
|
isDefault?: boolean;
|
|
2537
2721
|
}
|
|
@@ -2545,7 +2729,7 @@ declare function useLocale(): LocaleContextValue;
|
|
|
2545
2729
|
interface LocaleProviderProps {
|
|
2546
2730
|
locale?: LocaleCode | Locale;
|
|
2547
2731
|
messages?: LocaleMessages;
|
|
2548
|
-
children?:
|
|
2732
|
+
children?: ComponentChildren;
|
|
2549
2733
|
}
|
|
2550
2734
|
declare const LocaleProvider: ({ locale, messages, children, }: LocaleProviderProps) => preact.JSX.Element;
|
|
2551
2735
|
|
|
@@ -2587,7 +2771,7 @@ interface ContextMenuProps {
|
|
|
2587
2771
|
x: number;
|
|
2588
2772
|
y: number;
|
|
2589
2773
|
onClose: () => void;
|
|
2590
|
-
children:
|
|
2774
|
+
children: ComponentChildren;
|
|
2591
2775
|
className?: string;
|
|
2592
2776
|
}
|
|
2593
2777
|
declare const ContextMenu: preact.FunctionalComponent<preact_compat.PropsWithoutRef<ContextMenuProps> & {
|
|
@@ -2595,18 +2779,20 @@ declare const ContextMenu: preact.FunctionalComponent<preact_compat.PropsWithout
|
|
|
2595
2779
|
}>;
|
|
2596
2780
|
declare const ContextMenuItem: ({ onClick, children, icon, danger, disabled, }: {
|
|
2597
2781
|
onClick: () => void;
|
|
2598
|
-
children:
|
|
2599
|
-
icon?:
|
|
2782
|
+
children: ComponentChildren;
|
|
2783
|
+
icon?: ComponentChildren;
|
|
2600
2784
|
danger?: boolean;
|
|
2601
2785
|
disabled?: boolean;
|
|
2602
|
-
}) =>
|
|
2603
|
-
declare const ContextMenuSeparator: () =>
|
|
2604
|
-
declare const ContextMenuLabel:
|
|
2786
|
+
}) => preact.JSX.Element;
|
|
2787
|
+
declare const ContextMenuSeparator: () => preact.JSX.Element;
|
|
2788
|
+
declare const ContextMenuLabel: ({ children, }: {
|
|
2789
|
+
children: ComponentChildren;
|
|
2790
|
+
}) => preact.JSX.Element;
|
|
2605
2791
|
declare const ContextMenuColorPicker: ({ selectedColor, onSelect, onCustomColor, }: {
|
|
2606
2792
|
selectedColor?: string;
|
|
2607
2793
|
onSelect: (color: string) => void;
|
|
2608
2794
|
onCustomColor?: () => void;
|
|
2609
|
-
}) =>
|
|
2795
|
+
}) => preact.JSX.Element;
|
|
2610
2796
|
|
|
2611
2797
|
interface BlossomColorPickerProps extends Partial<BlossomColorPickerOptions> {
|
|
2612
2798
|
className?: string;
|
|
@@ -2619,7 +2805,7 @@ interface DefaultColorPickerProps {
|
|
|
2619
2805
|
hex: string;
|
|
2620
2806
|
}, isPending?: boolean) => void;
|
|
2621
2807
|
onClose?: () => void;
|
|
2622
|
-
[key: string]:
|
|
2808
|
+
[key: string]: unknown;
|
|
2623
2809
|
}
|
|
2624
2810
|
declare const DefaultColorPicker: ({ color, onChange, onClose, }: DefaultColorPickerProps) => preact.JSX.Element;
|
|
2625
2811
|
|
|
@@ -2637,9 +2823,9 @@ declare const CreateCalendarDialog: ({ onClose, onCreate, colorPickerMode, }: Cr
|
|
|
2637
2823
|
|
|
2638
2824
|
interface ContentSlotProps {
|
|
2639
2825
|
generatorName: string;
|
|
2640
|
-
generatorArgs?:
|
|
2641
|
-
defaultContent?:
|
|
2642
|
-
store?:
|
|
2826
|
+
generatorArgs?: unknown;
|
|
2827
|
+
defaultContent?: ComponentChildren;
|
|
2828
|
+
store?: CustomRenderingStore | null;
|
|
2643
2829
|
}
|
|
2644
2830
|
/**
|
|
2645
2831
|
* Preact component: Creates a placeholder <div> and registers it with CustomRenderingStore.
|
|
@@ -2685,5 +2871,5 @@ declare const sidebarHeaderToggle = "df-sidebar-header-toggle flex h-8 w-8 items
|
|
|
2685
2871
|
*/
|
|
2686
2872
|
declare const sidebarHeaderTitle = "df-sidebar-header-title text-sm font-semibold text-gray-700 dark:text-gray-200";
|
|
2687
2873
|
|
|
2688
|
-
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,
|
|
2689
|
-
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 };
|
|
2874
|
+
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, TimeZone, VIRTUAL_MONTH_SCROLL_CONFIG, ViewType, WeekDataCache, addDays, buildParseRegExp, calculateDayIndex, calendarPickerDropdown, cancelButton, capitalize, clipboardStore, conditionalTheme, convertDateEvent, convertDateEventWithTimeZone, convertToDayFlowEvent, createAllDayEvent, createDateWithHour, createDayView, createEvent, createEventWithDate, createEventWithPlainDateTime, createEventWithRealDate, createEventWithZonedDateTime, createEvents, createEventsPlugin, createMonthView, createStandardViews, createTemporalWithHour, createTimedEvent, createTimezoneEvent, createTimezoneEvents, createWeekView, createYearView, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, daysBetween, daysDifference, downloadICS, en, escapeICSValue, extractHourFromDate, extractHourFromTemporal, extractVEvents, foldLine, formatDate, formatDateConsistent, formatDateToICSTimestamp, formatEventTimeRange, formatICSDate, formatMonthYear, formatProperty, formatTemporal, formatTime, generateDayData, generateICS, generateSecondaryTimeSlots, generateUniKey, generateVEvent, 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, getTimezoneDisplayLabel, getWeekDaysLabels, getWeekNumber, getWeekRange, getZoneId, groupSearchResults, hasEventChanged, importICSFile, isDate, isDeepEqual, isEventDeepEqual, isEventInWeek, isMultiDayEvent, isMultiDayTemporalEvent, isPlainDate, isPlainDateTime, isSameDay, isSamePlainDate, isSameTemporal, isValidLocale, isZonedDateTime, mergeClasses, mergeFormatTemplate, monthNames, normalizeCssWidth, normalizeDate, normalizeLocale, normalizeToZoned, now, pad, pad2, parseICS, parseICSDate, parseTemporalString, parseVEventLines, plainDateTimeToDate, plainDateToDate, recalculateEventDays, registerDragImplementation, registerLocale, registerSidebarImplementation, resolveAppliedTheme, roundToTimeStep, scrollbarTakesSpace, setHourInTemporal, shortMonthNames, sidebarContainer, sidebarHeader, sidebarHeaderTitle, sidebarHeaderToggle, t, temporalToDate, themeClasses, themeCn, today, unescapeICSValue, updateEventDateAndDay, updateEventWithRealDate, useDragForView, useLocale, useSidebarBridge, weekDays, weekDaysFullName, zonedDateTimeToDate };
|
|
2875
|
+
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, TimeZoneValue, 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 };
|