@dayflow/core 2.0.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2555 -39
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +2128 -3113
- package/package.json +14 -24
- package/LICENSE +0 -21
- package/README.ja.md +0 -47
- package/README.md +0 -49
- package/README.zh.md +0 -47
- package/dist/components/calendarEvent/components/AllDayContent.d.ts +0 -9
- package/dist/components/calendarEvent/components/MonthAllDayContent.d.ts +0 -8
- package/dist/components/calendarEvent/components/MonthRegularContent.d.ts +0 -11
- package/dist/components/calendarEvent/components/RegularEventContent.d.ts +0 -20
- package/dist/components/calendarEvent/index.d.ts +0 -4
- package/dist/components/calendarEvent/types.d.ts +0 -49
- package/dist/components/common/CalendarHeader.d.ts +0 -4
- package/dist/components/common/CalendarPicker.d.ts +0 -19
- package/dist/components/common/ColorPicker.d.ts +0 -19
- package/dist/components/common/ContextMenu.d.ts +0 -25
- package/dist/components/common/CreateCalendarDialog.d.ts +0 -3
- package/dist/components/common/DefaultEventDetailDialog.d.ts +0 -12
- package/dist/components/common/DefaultEventDetailPanel.d.ts +0 -11
- package/dist/components/common/EventDetailPanelWithContent.d.ts +0 -11
- package/dist/components/common/MiniCalendar.d.ts +0 -11
- package/dist/components/common/QuickCreateEventPopup.d.ts +0 -10
- package/dist/components/common/TodayBox.d.ts +0 -7
- package/dist/components/common/ViewHeader.d.ts +0 -33
- package/dist/components/common/ViewSwitcher.d.ts +0 -8
- package/dist/components/dayView/DayContent.d.ts +0 -55
- package/dist/components/dayView/RightPanel.d.ts +0 -16
- package/dist/components/dayView/util.d.ts +0 -8
- package/dist/components/eventLayout/constants.d.ts +0 -8
- package/dist/components/eventLayout/index.d.ts +0 -129
- package/dist/components/eventLayout/types.d.ts +0 -23
- package/dist/components/eventLayout/utils.d.ts +0 -5
- package/dist/components/mobileEventDrawer/DefaultMobileEventDrawer.d.ts +0 -3
- package/dist/components/mobileEventDrawer/components/Switch.d.ts +0 -7
- package/dist/components/mobileEventDrawer/components/TimePickerWheel.d.ts +0 -7
- package/dist/components/mobileEventDrawer/index.d.ts +0 -3
- package/dist/components/monthView/MonthDragIndicator.d.ts +0 -12
- package/dist/components/monthView/MultiDayEvent.d.ts +0 -31
- package/dist/components/monthView/WeekComponent.d.ts +0 -53
- package/dist/components/monthView/util.d.ts +0 -11
- package/dist/components/rangePicker/components/CalendarGrid.d.ts +0 -13
- package/dist/components/rangePicker/components/CalendarHeader.d.ts +0 -11
- package/dist/components/rangePicker/components/RangePickerPanel.d.ts +0 -25
- package/dist/components/rangePicker/components/TimeSelector.d.ts +0 -21
- package/dist/components/rangePicker/constants.d.ts +0 -5
- package/dist/components/rangePicker/index.d.ts +0 -4
- package/dist/components/rangePicker/types.d.ts +0 -23
- package/dist/components/rangePicker/utils.d.ts +0 -2
- package/dist/components/search/MobileSearchDialog.d.ts +0 -14
- package/dist/components/search/SearchDrawer.d.ts +0 -13
- package/dist/components/search/SearchResultsList.d.ts +0 -11
- package/dist/components/sidebar/DefaultCalendarSidebar.d.ts +0 -4
- package/dist/components/sidebar/components/CalendarList.d.ts +0 -16
- package/dist/components/sidebar/components/DeleteCalendarDialog.d.ts +0 -14
- package/dist/components/sidebar/components/ImportCalendarDialog.d.ts +0 -11
- package/dist/components/sidebar/components/MergeCalendarDialog.d.ts +0 -9
- package/dist/components/sidebar/components/MergeMenuItem.d.ts +0 -9
- package/dist/components/sidebar/components/SidebarHeader.d.ts +0 -7
- package/dist/components/weekView/AllDayRow.d.ts +0 -49
- package/dist/components/weekView/DragIndicator/DefaultDragIndicator.d.ts +0 -2
- package/dist/components/weekView/DragIndicator/DragIndicatorComponent.d.ts +0 -7
- package/dist/components/weekView/TimeGrid.d.ts +0 -52
- package/dist/components/weekView/util.d.ts +0 -9
- package/dist/components/yearView/DefaultYearView.d.ts +0 -11
- package/dist/components/yearView/FixedWeekYearView.d.ts +0 -14
- package/dist/components/yearView/YearDayCell.d.ts +0 -12
- package/dist/components/yearView/YearMultiDayEvent.d.ts +0 -23
- package/dist/components/yearView/YearRowComponent.d.ts +0 -27
- package/dist/components/yearView/utils.d.ts +0 -19
- package/dist/contexts/ThemeContext.d.ts +0 -38
- package/dist/core/CalendarApp.d.ts +0 -85
- package/dist/core/DayFlowCalendar.d.ts +0 -20
- package/dist/core/calendarRegistry.d.ts +0 -121
- package/dist/core/config.d.ts +0 -60
- package/dist/core/index.d.ts +0 -6
- package/dist/core/useCalendarApp.d.ts +0 -2
- package/dist/factories/ViewAdapter.d.ts +0 -4
- package/dist/factories/createDayView.d.ts +0 -3
- package/dist/factories/createMonthView.d.ts +0 -3
- package/dist/factories/createWeekView.d.ts +0 -3
- package/dist/factories/createYearView.d.ts +0 -3
- package/dist/factories/index.d.ts +0 -10
- package/dist/hooks/drag/index.d.ts +0 -7
- package/dist/hooks/drag/useDrag.d.ts +0 -2
- package/dist/hooks/drag/useDragCommon.d.ts +0 -2
- package/dist/hooks/drag/useDragHandlers.d.ts +0 -2
- package/dist/hooks/drag/useDragManager.d.ts +0 -2
- package/dist/hooks/drag/useDragState.d.ts +0 -2
- package/dist/hooks/drag/useMonthDrag.d.ts +0 -2
- package/dist/hooks/drag/useWeekDayDrag.d.ts +0 -2
- package/dist/hooks/useCalendarDrop.d.ts +0 -20
- package/dist/hooks/virtualScroll/index.d.ts +0 -2
- package/dist/hooks/virtualScroll/useVirtualMonthScroll.d.ts +0 -7
- package/dist/hooks/virtualScroll/useVirtualScroll.d.ts +0 -48
- package/dist/locale/LocaleContext.d.ts +0 -10
- package/dist/locale/LocaleProvider.d.ts +0 -8
- package/dist/locale/index.d.ts +0 -7
- package/dist/locale/intl.d.ts +0 -16
- package/dist/locale/locales/de.d.ts +0 -3
- package/dist/locale/locales/en.d.ts +0 -3
- package/dist/locale/locales/es.d.ts +0 -3
- package/dist/locale/locales/fr.d.ts +0 -3
- package/dist/locale/locales/index.d.ts +0 -18
- package/dist/locale/locales/ja.d.ts +0 -3
- package/dist/locale/locales/ko.d.ts +0 -3
- package/dist/locale/locales/zh.d.ts +0 -3
- package/dist/locale/translator.d.ts +0 -9
- package/dist/locale/types.d.ts +0 -8
- package/dist/locale/useLocale.d.ts +0 -5
- package/dist/locale/utils.d.ts +0 -10
- package/dist/plugins/dragPlugin.d.ts +0 -5
- package/dist/plugins/eventsPlugin.d.ts +0 -3
- package/dist/plugins/index.d.ts +0 -6
- package/dist/setupTests.d.ts +0 -1
- package/dist/styles/classNames.d.ts +0 -381
- package/dist/types/calendar.d.ts +0 -26
- package/dist/types/calendarTypes.d.ts +0 -68
- package/dist/types/config.d.ts +0 -19
- package/dist/types/core.d.ts +0 -265
- package/dist/types/dragIndicator.d.ts +0 -160
- package/dist/types/event.d.ts +0 -18
- package/dist/types/eventDetail.d.ts +0 -74
- package/dist/types/factory.d.ts +0 -155
- package/dist/types/hook.d.ts +0 -103
- package/dist/types/index.d.ts +0 -13
- package/dist/types/layout.d.ts +0 -113
- package/dist/types/mobileEvent.d.ts +0 -21
- package/dist/types/monthView.d.ts +0 -65
- package/dist/types/plugin.d.ts +0 -80
- package/dist/types/search.d.ts +0 -35
- package/dist/utils/calendarDataUtils.d.ts +0 -83
- package/dist/utils/colorUtils.d.ts +0 -27
- package/dist/utils/compareUtils.d.ts +0 -5
- package/dist/utils/dateConstants.d.ts +0 -22
- package/dist/utils/dateFormat.d.ts +0 -15
- package/dist/utils/dateRangeUtils.d.ts +0 -24
- package/dist/utils/dateTimeUtils.d.ts +0 -49
- package/dist/utils/eventHelpers.d.ts +0 -143
- package/dist/utils/eventUtils.d.ts +0 -115
- package/dist/utils/helpers.d.ts +0 -27
- package/dist/utils/ics/icsDateUtils.d.ts +0 -37
- package/dist/utils/ics/icsGenerator.d.ts +0 -23
- package/dist/utils/ics/icsParser.d.ts +0 -15
- package/dist/utils/ics/index.d.ts +0 -16
- package/dist/utils/ics/types.d.ts +0 -91
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/logger.d.ts +0 -15
- package/dist/utils/rangePicker.d.ts +0 -8
- package/dist/utils/searchUtils.d.ts +0 -35
- package/dist/utils/styleUtils.d.ts +0 -24
- package/dist/utils/temporal.d.ts +0 -100
- package/dist/utils/temporalTypeGuards.d.ts +0 -63
- package/dist/utils/testDataUtils.d.ts +0 -14
- package/dist/utils/themeUtils.d.ts +0 -93
- package/dist/utils/throttle.d.ts +0 -11
- package/dist/utils/timeUtils.d.ts +0 -38
- package/dist/utils/utilityFunctions.d.ts +0 -11
- package/dist/views/DayView.d.ts +0 -13
- package/dist/views/MonthView.d.ts +0 -11
- package/dist/views/WeekView.d.ts +0 -11
- package/dist/views/YearView.d.ts +0 -12
package/dist/types/hook.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Root } from 'react-dom/client';
|
|
3
|
-
import { Event } from './event';
|
|
4
|
-
import { EventLayout } from './layout';
|
|
5
|
-
import { UnifiedDragRef, MonthDragState, WeekDayDragState, useDragProps } from './dragIndicator';
|
|
6
|
-
/**
|
|
7
|
-
* Virtual scroll item interface (YearView)
|
|
8
|
-
*/
|
|
9
|
-
export interface VirtualItem {
|
|
10
|
-
index: number;
|
|
11
|
-
year: number;
|
|
12
|
-
top: number;
|
|
13
|
-
height: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Virtual scroll Hook parameters interface (YearView)
|
|
17
|
-
*/
|
|
18
|
-
export interface UseVirtualScrollProps {
|
|
19
|
-
currentDate: Date;
|
|
20
|
-
yearHeight: number;
|
|
21
|
-
onCurrentYearChange?: (year: number) => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Virtual scroll Hook return value interface (YearView)
|
|
25
|
-
*/
|
|
26
|
-
export interface UseVirtualScrollReturn {
|
|
27
|
-
scrollTop: number;
|
|
28
|
-
containerHeight: number;
|
|
29
|
-
currentYear: number;
|
|
30
|
-
isScrolling: boolean;
|
|
31
|
-
virtualData: {
|
|
32
|
-
totalHeight: number;
|
|
33
|
-
visibleItems: VirtualItem[];
|
|
34
|
-
};
|
|
35
|
-
scrollElementRef: React.RefObject<HTMLDivElement>;
|
|
36
|
-
handleScroll: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
37
|
-
scrollToYear: (targetYear: number, smooth?: boolean) => void;
|
|
38
|
-
handlePreviousYear: () => void;
|
|
39
|
-
handleNextYear: () => void;
|
|
40
|
-
handleToday: () => void;
|
|
41
|
-
setScrollTop: React.Dispatch<React.SetStateAction<number>>;
|
|
42
|
-
setContainerHeight: React.Dispatch<React.SetStateAction<number>>;
|
|
43
|
-
setCurrentYear: React.Dispatch<React.SetStateAction<number>>;
|
|
44
|
-
setIsScrolling: React.Dispatch<React.SetStateAction<boolean>>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Drag state Hook return value
|
|
48
|
-
*/
|
|
49
|
-
export interface UseDragStateReturn {
|
|
50
|
-
dragRef: React.MutableRefObject<UnifiedDragRef>;
|
|
51
|
-
currentDragRef: React.MutableRefObject<{
|
|
52
|
-
x: number;
|
|
53
|
-
y: number;
|
|
54
|
-
}>;
|
|
55
|
-
dragState: MonthDragState | WeekDayDragState;
|
|
56
|
-
setDragState: React.Dispatch<React.SetStateAction<MonthDragState | WeekDayDragState>>;
|
|
57
|
-
resetDragState: () => void;
|
|
58
|
-
throttledSetEvents: (updateFunc: (events: Event[]) => Event[], dragState?: string) => void;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Drag common utilities Hook return value
|
|
62
|
-
*/
|
|
63
|
-
export interface UseDragCommonReturn {
|
|
64
|
-
pixelYToHour: (y: number) => number;
|
|
65
|
-
getColumnDayIndex: (x: number) => number;
|
|
66
|
-
checkIfInAllDayArea: (clientY: number) => boolean;
|
|
67
|
-
handleDirectScroll: (clientY: number) => void;
|
|
68
|
-
daysDifference: (date1: Date, date2: Date) => number;
|
|
69
|
-
addDaysToDate: (date: Date, days: number) => Date;
|
|
70
|
-
getTargetDateFromPosition: (clientX: number, clientY: number) => Date | null;
|
|
71
|
-
ONE_DAY_MS: number;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Drag management Hook return value
|
|
75
|
-
*/
|
|
76
|
-
export interface UseDragManagerReturn {
|
|
77
|
-
dragIndicatorRef: React.RefObject<HTMLDivElement | null>;
|
|
78
|
-
reactRootRef: React.RefObject<Root | null>;
|
|
79
|
-
removeDragIndicator: () => void;
|
|
80
|
-
createDragIndicator: (drag: UnifiedDragRef, color?: string, title?: string, layout?: EventLayout | null, sourceElement?: HTMLElement) => void;
|
|
81
|
-
updateDragIndicator: (...args: (number | boolean | EventLayout | null | undefined)[]) => void;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Drag handler Hook return value
|
|
85
|
-
*/
|
|
86
|
-
export interface UseDragHandlersReturn {
|
|
87
|
-
handleDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
88
|
-
handleDragEnd: (e: MouseEvent | TouchEvent) => void;
|
|
89
|
-
handleCreateStart: (e: React.MouseEvent | React.TouchEvent, ...args: (Date | number)[]) => void;
|
|
90
|
-
handleMoveStart: (e: React.MouseEvent | React.TouchEvent, event: Event) => void;
|
|
91
|
-
handleResizeStart: (e: React.MouseEvent | React.TouchEvent, event: Event, direction: string) => void;
|
|
92
|
-
handleUniversalDragMove: (e: MouseEvent | TouchEvent) => void;
|
|
93
|
-
handleUniversalDragEnd: (e?: MouseEvent | TouchEvent) => void;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Drag handler Hook parameters
|
|
97
|
-
*/
|
|
98
|
-
export interface UseDragHandlersParams {
|
|
99
|
-
options: useDragProps;
|
|
100
|
-
common: UseDragCommonReturn;
|
|
101
|
-
state: UseDragStateReturn;
|
|
102
|
-
manager: UseDragManagerReturn;
|
|
103
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export * from './calendar';
|
|
3
|
-
export * from './event';
|
|
4
|
-
export * from './layout';
|
|
5
|
-
export * from './dragIndicator';
|
|
6
|
-
export * from './monthView';
|
|
7
|
-
export * from './factory';
|
|
8
|
-
export * from './plugin';
|
|
9
|
-
export * from './config';
|
|
10
|
-
export * from './hook';
|
|
11
|
-
export * from './eventDetail';
|
|
12
|
-
export * from './mobileEvent';
|
|
13
|
-
export * from './calendarTypes';
|
package/dist/types/layout.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Event } from './event';
|
|
2
|
-
/**
|
|
3
|
-
* Event layout configuration constants
|
|
4
|
-
* Controls visual presentation of events in the calendar
|
|
5
|
-
*/
|
|
6
|
-
export declare const LAYOUT_CONFIG: {
|
|
7
|
-
readonly INDENT_STEP: 2;
|
|
8
|
-
readonly MIN_WIDTH: 25;
|
|
9
|
-
readonly MARGIN_BETWEEN: 2;
|
|
10
|
-
readonly CONTAINER_WIDTH: 320;
|
|
11
|
-
readonly OVERLAP_THRESHOLD: 0.25;
|
|
12
|
-
readonly EDGE_MARGIN: 3;
|
|
13
|
-
readonly MAX_LOAD_IMBALANCE: 0;
|
|
14
|
-
readonly REBALANCE_THRESHOLD: 2;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Event layout interface
|
|
18
|
-
* Defines position and styling of events in the UI
|
|
19
|
-
*/
|
|
20
|
-
export interface EventLayout {
|
|
21
|
-
id: string;
|
|
22
|
-
left: number;
|
|
23
|
-
width: number;
|
|
24
|
-
zIndex: number;
|
|
25
|
-
level: number;
|
|
26
|
-
isPrimary: boolean;
|
|
27
|
-
indentOffset: number;
|
|
28
|
-
importance: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Nested layer interface
|
|
32
|
-
* Represents hierarchical relationships of events
|
|
33
|
-
*/
|
|
34
|
-
export interface NestedLayer {
|
|
35
|
-
events: Event[];
|
|
36
|
-
level: number;
|
|
37
|
-
parentEvent?: Event;
|
|
38
|
-
timeSlot?: {
|
|
39
|
-
start: number;
|
|
40
|
-
end: number;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Event group interface
|
|
45
|
-
* Represents a group of related events and their nested structure
|
|
46
|
-
*/
|
|
47
|
-
export interface EventGroup {
|
|
48
|
-
events: Event[];
|
|
49
|
-
startHour: number;
|
|
50
|
-
endHour: number;
|
|
51
|
-
primaryEvent?: Event;
|
|
52
|
-
nestedStructure: NestedLayer[];
|
|
53
|
-
specialLayoutRules?: SpecialLayoutRule[];
|
|
54
|
-
originalBranchMap?: Map<string, Event>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Event relationship information interface
|
|
58
|
-
* Describes relationships of events in nested structures
|
|
59
|
-
*/
|
|
60
|
-
export interface EventRelations {
|
|
61
|
-
directChildren: Event[];
|
|
62
|
-
allDescendants: Event[];
|
|
63
|
-
directParent: Event | null;
|
|
64
|
-
layer: NestedLayer | null;
|
|
65
|
-
subtreeSize: number;
|
|
66
|
-
isLeaf: boolean;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Subtree analysis interface
|
|
70
|
-
* Used to analyze structural information of event trees
|
|
71
|
-
*/
|
|
72
|
-
export interface SubtreeAnalysis {
|
|
73
|
-
rootEvent: Event;
|
|
74
|
-
allDescendants: Event[];
|
|
75
|
-
timeSpan: {
|
|
76
|
-
start: number;
|
|
77
|
-
end: number;
|
|
78
|
-
duration: number;
|
|
79
|
-
};
|
|
80
|
-
descendantCount: number;
|
|
81
|
-
maxDepth: number;
|
|
82
|
-
branchPath: Event[];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Balance strategy interface
|
|
86
|
-
* Used for balance algorithms to optimize event layouts
|
|
87
|
-
*/
|
|
88
|
-
export interface BalanceStrategy {
|
|
89
|
-
type: 'count_balance' | 'timespan_balance';
|
|
90
|
-
transfers: TransferOperation[];
|
|
91
|
-
specialLayoutRules: SpecialLayoutRule[];
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Transfer operation interface
|
|
95
|
-
* Describes movement of events in layout optimization
|
|
96
|
-
*/
|
|
97
|
-
export interface TransferOperation {
|
|
98
|
-
event: Event;
|
|
99
|
-
fromParent: Event;
|
|
100
|
-
toParent: Event;
|
|
101
|
-
reason: string;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Special layout rule interface
|
|
105
|
-
* Defines layout constraints for specific events
|
|
106
|
-
*/
|
|
107
|
-
export interface SpecialLayoutRule {
|
|
108
|
-
eventId: string;
|
|
109
|
-
layoutType: 'align_with_ancestor' | 'full_width' | 'full_width_from_level' | 'align_with_sibling';
|
|
110
|
-
referenceEvent?: Event;
|
|
111
|
-
targetLevel?: number;
|
|
112
|
-
reason?: string;
|
|
113
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Event } from './event';
|
|
2
|
-
import { CalendarApp } from './core';
|
|
3
|
-
/**
|
|
4
|
-
* Mobile event drawer/dialog Props
|
|
5
|
-
*/
|
|
6
|
-
export interface MobileEventProps {
|
|
7
|
-
/** Whether the drawer/dialog is open */
|
|
8
|
-
isOpen: boolean;
|
|
9
|
-
/** Callback to close the drawer/dialog */
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
/** Callback to save the event (creates or updates) */
|
|
12
|
-
onSave: (event: Event) => void;
|
|
13
|
-
/** Current event data (newly created template or existing event) */
|
|
14
|
-
draftEvent: Event | null;
|
|
15
|
-
/** The CalendarApp instance providing built-in services */
|
|
16
|
-
app: CalendarApp;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Custom mobile event renderer (Drawer or Dialog)
|
|
20
|
-
*/
|
|
21
|
-
export type MobileEventRenderer = React.ComponentType<MobileEventProps>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { WeeksData } from '.';
|
|
2
|
-
export interface UseVirtualMonthScrollProps {
|
|
3
|
-
currentDate: Date;
|
|
4
|
-
weekHeight: number;
|
|
5
|
-
onCurrentMonthChange?: (month: string, year: number) => void;
|
|
6
|
-
initialWeeksToLoad?: number;
|
|
7
|
-
locale?: string;
|
|
8
|
-
isEnabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface UseVirtualMonthScrollReturn {
|
|
11
|
-
scrollTop: number;
|
|
12
|
-
containerHeight: number;
|
|
13
|
-
currentMonth: string;
|
|
14
|
-
currentYear: number;
|
|
15
|
-
isScrolling: boolean;
|
|
16
|
-
virtualData: {
|
|
17
|
-
totalHeight: number;
|
|
18
|
-
visibleItems: VirtualWeekItem[];
|
|
19
|
-
displayStartIndex: number;
|
|
20
|
-
};
|
|
21
|
-
scrollElementRef: React.RefObject<HTMLDivElement>;
|
|
22
|
-
handleScroll: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
23
|
-
scrollToDate: (targetDate: Date, smooth?: boolean) => void;
|
|
24
|
-
handlePreviousMonth: () => void;
|
|
25
|
-
handleNextMonth: () => void;
|
|
26
|
-
handleToday: () => void;
|
|
27
|
-
setScrollTop: React.Dispatch<React.SetStateAction<number>>;
|
|
28
|
-
setContainerHeight: React.Dispatch<React.SetStateAction<number>>;
|
|
29
|
-
setCurrentMonth: React.Dispatch<React.SetStateAction<string>>;
|
|
30
|
-
setCurrentYear: React.Dispatch<React.SetStateAction<number>>;
|
|
31
|
-
setIsScrolling: React.Dispatch<React.SetStateAction<boolean>>;
|
|
32
|
-
cache: WeekDataCache;
|
|
33
|
-
scrollElementRefCallback: (element: HTMLDivElement | null) => void;
|
|
34
|
-
weeksData: WeeksData[];
|
|
35
|
-
}
|
|
36
|
-
export declare const VIRTUAL_MONTH_SCROLL_CONFIG: {
|
|
37
|
-
readonly OVERSCAN: 6;
|
|
38
|
-
readonly BUFFER_SIZE: 100;
|
|
39
|
-
readonly MIN_YEAR: 1900;
|
|
40
|
-
readonly MAX_YEAR: 2200;
|
|
41
|
-
readonly SCROLL_THROTTLE: 8;
|
|
42
|
-
readonly SCROLL_DEBOUNCE: 150;
|
|
43
|
-
readonly CACHE_CLEANUP_THRESHOLD: 200;
|
|
44
|
-
readonly MOBILE_WEEK_HEIGHT: 80;
|
|
45
|
-
readonly TABLET_WEEK_HEIGHT: 90;
|
|
46
|
-
readonly WEEK_HEIGHT: 119;
|
|
47
|
-
};
|
|
48
|
-
export interface VirtualWeekItem {
|
|
49
|
-
index: number;
|
|
50
|
-
weekData: WeeksData;
|
|
51
|
-
top: number;
|
|
52
|
-
height: number;
|
|
53
|
-
}
|
|
54
|
-
export declare class WeekDataCache {
|
|
55
|
-
private cache;
|
|
56
|
-
private accessOrder;
|
|
57
|
-
private maxSize;
|
|
58
|
-
constructor(maxSize?: number);
|
|
59
|
-
private getKey;
|
|
60
|
-
get(weekStartDate: Date): WeeksData | undefined;
|
|
61
|
-
set(weekStartDate: Date, data: WeeksData): void;
|
|
62
|
-
private updateAccessOrder;
|
|
63
|
-
getSize(): number;
|
|
64
|
-
clear(): void;
|
|
65
|
-
}
|
package/dist/types/plugin.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Event } from './event';
|
|
3
|
-
import { EventLayout } from './layout';
|
|
4
|
-
import { ViewType } from './core';
|
|
5
|
-
import { MonthDragState, WeekDayDragState } from './dragIndicator';
|
|
6
|
-
import { DragConfig } from './config';
|
|
7
|
-
/**
|
|
8
|
-
* Events service interface
|
|
9
|
-
* Provides various event management functions
|
|
10
|
-
*/
|
|
11
|
-
export interface EventsService {
|
|
12
|
-
getAll: () => Event[];
|
|
13
|
-
getById: (id: string) => Event | undefined;
|
|
14
|
-
add: (event: Event) => void;
|
|
15
|
-
update: (id: string, updates: Partial<Event>) => Event;
|
|
16
|
-
delete: (id: string) => void;
|
|
17
|
-
getByDate: (date: Date) => Event[];
|
|
18
|
-
getByDateRange: (startDate: Date, endDate: Date) => Event[];
|
|
19
|
-
getByDay: (dayIndex: number, weekStart: Date) => Event[];
|
|
20
|
-
getAllDayEvents: (dayIndex: number, events: Event[]) => Event[];
|
|
21
|
-
recalculateEventDays: (events: Event[], weekStart: Date) => Event[];
|
|
22
|
-
validateEvent: (event: Partial<Event>) => string[];
|
|
23
|
-
filterEvents: (events: Event[], filter: (event: Event) => boolean) => Event[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Events plugin configuration
|
|
27
|
-
*/
|
|
28
|
-
export interface EventsPluginConfig {
|
|
29
|
-
enableAutoRecalculate?: boolean;
|
|
30
|
-
enableValidation?: boolean;
|
|
31
|
-
defaultEvents?: Event[];
|
|
32
|
-
maxEventsPerDay?: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Drag Hook options
|
|
36
|
-
*/
|
|
37
|
-
export interface DragHookOptions extends Partial<DragConfig> {
|
|
38
|
-
calendarRef: React.RefObject<HTMLDivElement | null>;
|
|
39
|
-
allDayRowRef?: React.RefObject<HTMLDivElement | null>;
|
|
40
|
-
viewType: ViewType;
|
|
41
|
-
onEventsUpdate: (updateFunc: (events: Event[]) => Event[], isResizing?: boolean) => void;
|
|
42
|
-
onEventCreate: (event: Event) => void;
|
|
43
|
-
onEventEdit: (event: Event) => void;
|
|
44
|
-
currentWeekStart: Date;
|
|
45
|
-
events: Event[];
|
|
46
|
-
calculateNewEventLayout?: (dayIndex: number, startHour: number, endHour: number) => EventLayout | null;
|
|
47
|
-
calculateDragLayout?: (event: Event, targetDay: number, targetStartHour: number, targetEndHour: number) => EventLayout | null;
|
|
48
|
-
isMobile?: boolean;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Drag Hook return value
|
|
52
|
-
*/
|
|
53
|
-
export interface DragHookReturn {
|
|
54
|
-
handleMoveStart?: (e: React.MouseEvent | React.TouchEvent, event: Event) => void;
|
|
55
|
-
handleCreateStart?: (e: React.MouseEvent | React.TouchEvent, ...args: (Date | number)[]) => void;
|
|
56
|
-
handleResizeStart?: (e: React.MouseEvent | React.TouchEvent, event: Event, direction: string) => void;
|
|
57
|
-
handleCreateAllDayEvent?: (e: React.MouseEvent, dayIndex: number) => void;
|
|
58
|
-
dragState: MonthDragState | WeekDayDragState;
|
|
59
|
-
isDragging: boolean;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Drag plugin configuration
|
|
63
|
-
*/
|
|
64
|
-
export interface DragPluginConfig {
|
|
65
|
-
enableDrag: boolean;
|
|
66
|
-
enableResize: boolean;
|
|
67
|
-
enableCreate: boolean;
|
|
68
|
-
enableAllDayCreate: boolean;
|
|
69
|
-
supportedViews: ViewType[];
|
|
70
|
-
[key: string]: unknown;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Drag service interface
|
|
74
|
-
* Provides drag capability for views
|
|
75
|
-
*/
|
|
76
|
-
export interface DragService {
|
|
77
|
-
getConfig: () => DragPluginConfig;
|
|
78
|
-
updateConfig: (updates: Partial<DragPluginConfig>) => void;
|
|
79
|
-
isViewSupported: (viewType: ViewType) => boolean;
|
|
80
|
-
}
|
package/dist/types/search.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Event } from './event';
|
|
2
|
-
export type CalendarSearchEvent = Event & {
|
|
3
|
-
color?: string;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
};
|
|
6
|
-
export interface CalendarSearchProps {
|
|
7
|
-
/**
|
|
8
|
-
* Debounce delay in ms
|
|
9
|
-
* @default 300
|
|
10
|
-
*/
|
|
11
|
-
debounceDelay?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Async search method
|
|
14
|
-
*/
|
|
15
|
-
onSearch?: (keyword: string) => Promise<CalendarSearchEvent[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Custom search logic (takes over completely)
|
|
18
|
-
*/
|
|
19
|
-
customSearch?: (params: {
|
|
20
|
-
keyword: string;
|
|
21
|
-
events: CalendarSearchEvent[];
|
|
22
|
-
}) => CalendarSearchEvent[];
|
|
23
|
-
/**
|
|
24
|
-
* Search state callback
|
|
25
|
-
*/
|
|
26
|
-
onSearchStateChange?: (state: {
|
|
27
|
-
keyword: string;
|
|
28
|
-
loading: boolean;
|
|
29
|
-
results: CalendarSearchEvent[];
|
|
30
|
-
}) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Empty result text
|
|
33
|
-
*/
|
|
34
|
-
emptyText?: string | Record<string, string>;
|
|
35
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calendar Data Generation Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for generating calendar data structures
|
|
5
|
-
* including days, weeks, and month/year metadata.
|
|
6
|
-
*/
|
|
7
|
-
import { DayData, WeeksData } from '../types';
|
|
8
|
-
/**
|
|
9
|
-
* Generate day data object from a date
|
|
10
|
-
* @param date Date to generate data for
|
|
11
|
-
* @returns Day data with date, day, month, year, and isToday flag
|
|
12
|
-
*/
|
|
13
|
-
export declare const generateDayData: (date: string | number | Date) => {
|
|
14
|
-
date: Date;
|
|
15
|
-
day: number;
|
|
16
|
-
month: number;
|
|
17
|
-
year: number;
|
|
18
|
-
monthName: string;
|
|
19
|
-
shortMonthName: string;
|
|
20
|
-
isToday: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Generate week data (7 days starting from given date)
|
|
24
|
-
* @param startDate Week start date
|
|
25
|
-
* @returns Week data with days array, startDate, and monthYear
|
|
26
|
-
*/
|
|
27
|
-
export declare const generateWeekData: (startDate: string | number | Date) => {
|
|
28
|
-
days: {
|
|
29
|
-
date: Date;
|
|
30
|
-
day: number;
|
|
31
|
-
month: number;
|
|
32
|
-
year: number;
|
|
33
|
-
monthName: string;
|
|
34
|
-
shortMonthName: string;
|
|
35
|
-
isToday: boolean;
|
|
36
|
-
}[];
|
|
37
|
-
startDate: Date;
|
|
38
|
-
monthYear: {
|
|
39
|
-
month: string;
|
|
40
|
-
monthIndex: number;
|
|
41
|
-
year: number;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Determine which month and year a week belongs to (based on majority of days)
|
|
46
|
-
* @param days Array of day data
|
|
47
|
-
* @returns Month name, month index, and year
|
|
48
|
-
*/
|
|
49
|
-
export declare const getMonthYearOfWeek: (days: DayData[]) => {
|
|
50
|
-
month: string;
|
|
51
|
-
monthIndex: number;
|
|
52
|
-
year: number;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Generate weeks data around a central date
|
|
56
|
-
* @param centralDate Central date for range
|
|
57
|
-
* @param monthsToLoad Number of months to load (default: 3)
|
|
58
|
-
* @returns Array of week data
|
|
59
|
-
*/
|
|
60
|
-
export declare const generateWeeksData: (centralDate: Date, monthsToLoad?: number) => {
|
|
61
|
-
days: {
|
|
62
|
-
date: Date;
|
|
63
|
-
day: number;
|
|
64
|
-
month: number;
|
|
65
|
-
year: number;
|
|
66
|
-
monthName: string;
|
|
67
|
-
shortMonthName: string;
|
|
68
|
-
isToday: boolean;
|
|
69
|
-
}[];
|
|
70
|
-
startDate: Date;
|
|
71
|
-
monthYear: {
|
|
72
|
-
month: string;
|
|
73
|
-
monthIndex: number;
|
|
74
|
-
year: number;
|
|
75
|
-
};
|
|
76
|
-
}[];
|
|
77
|
-
/**
|
|
78
|
-
* Generate week range around a center date
|
|
79
|
-
* @param centerDate Center date for range
|
|
80
|
-
* @param totalWeeks Total number of weeks to generate
|
|
81
|
-
* @returns Array of weeks data
|
|
82
|
-
*/
|
|
83
|
-
export declare function generateWeekRange(centerDate: Date, totalWeeks: number): WeeksData[];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for resolving event colors using the calendar registry.
|
|
5
|
-
* All color functions return actual color values (not CSS classes) for inline styles.
|
|
6
|
-
*/
|
|
7
|
-
import { CalendarRegistry } from '../core/calendarRegistry';
|
|
8
|
-
/**
|
|
9
|
-
* Get event background color (actual color value, not CSS class)
|
|
10
|
-
* Use this for inline styles
|
|
11
|
-
*/
|
|
12
|
-
export declare const getEventBgColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Get event text color (actual color value, not CSS class)
|
|
15
|
-
* Use this for inline styles
|
|
16
|
-
*/
|
|
17
|
-
export declare const getEventTextColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
|
|
18
|
-
/**
|
|
19
|
-
* Get selected background color
|
|
20
|
-
* Now uses the calendar registry for color resolution
|
|
21
|
-
*/
|
|
22
|
-
export declare const getSelectedBgColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
|
|
23
|
-
/**
|
|
24
|
-
* Get line color
|
|
25
|
-
* Now uses the calendar registry for color resolution
|
|
26
|
-
*/
|
|
27
|
-
export declare const getLineColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date Constants
|
|
3
|
-
*
|
|
4
|
-
* This module provides constant arrays for day and month names in various formats.
|
|
5
|
-
* Used throughout the application for displaying date information.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Week day abbreviations (Mon-Sun)
|
|
9
|
-
*/
|
|
10
|
-
export declare const weekDays: string[];
|
|
11
|
-
/**
|
|
12
|
-
* Full week day names (Monday-Sunday)
|
|
13
|
-
*/
|
|
14
|
-
export declare const weekDaysFullName: string[];
|
|
15
|
-
/**
|
|
16
|
-
* Full month names (January-December)
|
|
17
|
-
*/
|
|
18
|
-
export declare const monthNames: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Month abbreviations (Jan-Dec)
|
|
21
|
-
*/
|
|
22
|
-
export declare const shortMonthNames: string[];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Temporal } from 'temporal-polyfill';
|
|
2
|
-
/**
|
|
3
|
-
* Format date to DD/MM/YYYY format
|
|
4
|
-
* Ensures consistent server and client rendering
|
|
5
|
-
*/
|
|
6
|
-
export declare const formatDateConsistent: (date?: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => string;
|
|
7
|
-
/**
|
|
8
|
-
* Format month and year to consistent format
|
|
9
|
-
*/
|
|
10
|
-
export declare const formatMonthYear: (date: Date) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Format date to "DD MMM YYYY" format (e.g., "15 Jan 2025")
|
|
13
|
-
* Used for event detail display
|
|
14
|
-
*/
|
|
15
|
-
export declare const formatDate: (temporal: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date Range Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for calculating date ranges, particularly
|
|
5
|
-
* for week-based operations (Monday-Sunday).
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Get the Monday-Sunday range for a given date
|
|
9
|
-
* @param date Input date
|
|
10
|
-
* @returns Object with monday and sunday dates
|
|
11
|
-
*/
|
|
12
|
-
export declare const getWeekRange: (date: Date) => {
|
|
13
|
-
monday: Date;
|
|
14
|
-
sunday: Date;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Get current week dates (Monday-Sunday) with today indicator
|
|
18
|
-
* @returns Array of 7 date objects with date, month, and isToday flag
|
|
19
|
-
*/
|
|
20
|
-
export declare const getCurrentWeekDates: () => {
|
|
21
|
-
date: number;
|
|
22
|
-
month: string;
|
|
23
|
-
isToday: boolean;
|
|
24
|
-
}[];
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date and Time Conversion Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for converting between Date and Temporal API objects,
|
|
5
|
-
* extracting time components, and performing date comparisons.
|
|
6
|
-
*
|
|
7
|
-
* All functions support both legacy Date objects and modern Temporal API types
|
|
8
|
-
* for backward compatibility and future-proofing.
|
|
9
|
-
*/
|
|
10
|
-
import { Temporal } from 'temporal-polyfill';
|
|
11
|
-
/**
|
|
12
|
-
* Extract hour number from Date or Temporal object (with decimal for minutes, e.g., 14.5 = 14:30)
|
|
13
|
-
* @param dateTime Date or Temporal object
|
|
14
|
-
* @returns Hour number (0-24, supports decimals)
|
|
15
|
-
*/
|
|
16
|
-
export declare const extractHourFromDate: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => number;
|
|
17
|
-
/**
|
|
18
|
-
* Create a new date-time object based on given date but set to specified hour
|
|
19
|
-
* @param baseDateTime Base date-time
|
|
20
|
-
* @param hour Hour number (supports decimals, e.g., 14.5 = 14:30)
|
|
21
|
-
* @returns Date or Temporal (PlainDateTime or ZonedDateTime)
|
|
22
|
-
*/
|
|
23
|
-
export declare const createDateWithHour: (baseDateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, hour: number) => Date | Temporal.PlainDateTime | Temporal.ZonedDateTime;
|
|
24
|
-
/**
|
|
25
|
-
* Get start of day (00:00:00.000)
|
|
26
|
-
* @param dateTime Date-time
|
|
27
|
-
* @returns Start of day
|
|
28
|
-
*/
|
|
29
|
-
export declare const getStartOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => Date | Temporal.ZonedDateTime;
|
|
30
|
-
/**
|
|
31
|
-
* Get end of day (23:59:59.999)
|
|
32
|
-
* @param dateTime Date-time
|
|
33
|
-
* @returns End of day
|
|
34
|
-
*/
|
|
35
|
-
export declare const getEndOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => Date | Temporal.ZonedDateTime;
|
|
36
|
-
/**
|
|
37
|
-
* Check if two dates are on the same day
|
|
38
|
-
* @param date1 Date 1
|
|
39
|
-
* @param date2 Date 2
|
|
40
|
-
* @returns Whether they are the same day
|
|
41
|
-
*/
|
|
42
|
-
export declare const isSameDay: (date1: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, date2: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Check if event spans multiple days
|
|
45
|
-
* @param start Start time
|
|
46
|
-
* @param end End time
|
|
47
|
-
* @returns Whether it's a multi-day event
|
|
48
|
-
*/
|
|
49
|
-
export declare const isMultiDayEvent: (start: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, end: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => boolean;
|