@dayflow/core 1.0.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +325 -90
- package/README.md +319 -78
- package/README.zh.md +324 -89
- package/dist/components/common/CalendarHeader.d.ts +4 -0
- package/dist/components/common/ColorPicker.d.ts +1 -0
- package/dist/components/common/DefaultEventDetailPanel.d.ts +1 -1
- package/dist/components/common/MobileEventDrawer.d.ts +12 -0
- package/dist/components/common/MobileSearchDialog.d.ts +14 -0
- package/dist/components/common/QuickCreateEventPopup.d.ts +10 -0
- package/dist/components/common/SearchDrawer.d.ts +13 -0
- package/dist/components/common/SearchResultsList.d.ts +11 -0
- package/dist/components/common/ViewHeader.d.ts +0 -2
- package/dist/components/mobileEventDrawer/DefaultMobileEventDrawer.d.ts +3 -0
- package/dist/components/mobileEventDrawer/components/Switch.d.ts +7 -0
- package/dist/components/mobileEventDrawer/components/TimePickerWheel.d.ts +7 -0
- package/dist/components/mobileEventDrawer/index.d.ts +3 -0
- package/dist/components/monthView/MultiDayEvent.d.ts +7 -2
- package/dist/components/monthView/WeekComponent.d.ts +5 -3
- package/dist/components/monthView/util.d.ts +1 -1
- package/dist/components/search/MobileSearchDialog.d.ts +14 -0
- package/dist/components/search/SearchDrawer.d.ts +13 -0
- package/dist/components/search/SearchResultsList.d.ts +11 -0
- package/dist/components/sidebar/components/CalendarList.d.ts +2 -0
- package/dist/components/sidebar/components/SidebarHeader.d.ts +0 -1
- package/dist/components/weekView/CalendarEvent.d.ts +7 -2
- package/dist/core/CalendarApp.d.ts +15 -1
- package/dist/core/DayFlowCalendar.d.ts +3 -0
- package/dist/hooks/virtualScroll/useVirtualMonthScroll.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/locale/types.d.ts +1 -1
- package/dist/styles/classNames.d.ts +9 -9
- package/dist/styles.css +464 -32
- package/dist/types/core.d.ts +38 -0
- package/dist/types/dragIndicator.d.ts +5 -3
- package/dist/types/event.d.ts +2 -0
- package/dist/types/hook.d.ts +7 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mobileEvent.d.ts +21 -0
- package/dist/types/monthView.d.ts +1 -0
- package/dist/types/plugin.d.ts +6 -4
- package/dist/types/search.d.ts +35 -0
- package/dist/utils/compareUtils.d.ts +5 -0
- package/dist/utils/eventUtils.d.ts +7 -0
- package/dist/utils/helpers.d.ts +2 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/searchUtils.d.ts +35 -0
- package/dist/views/MonthView.d.ts +0 -2
- package/dist/views/WeekView.d.ts +0 -2
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarSearchEvent } from '../../types/search';
|
|
3
|
+
interface MobileSearchDialogProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
keyword: string;
|
|
7
|
+
onSearchChange: (value: string) => void;
|
|
8
|
+
results: CalendarSearchEvent[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
onResultClick?: (event: CalendarSearchEvent) => void;
|
|
11
|
+
emptyText?: string | Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
declare const MobileSearchDialog: React.FC<MobileSearchDialogProps>;
|
|
14
|
+
export default MobileSearchDialog;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarSearchEvent } from '../../types/search';
|
|
3
|
+
interface SearchDrawerProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
results: CalendarSearchEvent[];
|
|
8
|
+
keyword: string;
|
|
9
|
+
onResultClick?: (event: CalendarSearchEvent) => void;
|
|
10
|
+
emptyText?: string | Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
declare const SearchDrawer: React.FC<SearchDrawerProps>;
|
|
13
|
+
export default SearchDrawer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarSearchEvent } from '../../types/search';
|
|
3
|
+
interface SearchResultsListProps {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
results: CalendarSearchEvent[];
|
|
6
|
+
keyword: string;
|
|
7
|
+
onResultClick?: (event: CalendarSearchEvent) => void;
|
|
8
|
+
emptyText?: string | Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
declare const SearchResultsList: React.FC<SearchResultsListProps>;
|
|
11
|
+
export default SearchResultsList;
|
|
@@ -9,6 +9,8 @@ interface CalendarListProps {
|
|
|
9
9
|
editingId: string | null;
|
|
10
10
|
setEditingId: (id: string | null) => void;
|
|
11
11
|
activeContextMenuCalendarId?: string | null;
|
|
12
|
+
isDraggable?: boolean;
|
|
13
|
+
isEditable?: boolean;
|
|
12
14
|
}
|
|
13
15
|
export declare const CalendarList: React.FC<CalendarListProps>;
|
|
14
16
|
export {};
|
|
@@ -20,12 +20,13 @@ interface CalendarEventProps {
|
|
|
20
20
|
newlyCreatedEventId?: string | null;
|
|
21
21
|
selectedEventId?: string | null;
|
|
22
22
|
detailPanelEventId?: string | null;
|
|
23
|
-
onMoveStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, event: Event) => void;
|
|
24
|
-
onResizeStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, event: Event, direction: string) => void;
|
|
23
|
+
onMoveStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>, event: Event) => void;
|
|
24
|
+
onResizeStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>, event: Event, direction: string) => void;
|
|
25
25
|
onEventUpdate: (updatedEvent: Event) => void;
|
|
26
26
|
onEventDelete: (eventId: string) => void;
|
|
27
27
|
onDetailPanelOpen?: () => void;
|
|
28
28
|
onEventSelect?: (eventId: string | null) => void;
|
|
29
|
+
onEventLongPress?: (eventId: string) => void;
|
|
29
30
|
onDetailPanelToggle?: (eventId: string | null) => void;
|
|
30
31
|
/** Custom event detail content component (content only, will be wrapped in default panel) */
|
|
31
32
|
customDetailPanelContent?: EventDetailContentRenderer;
|
|
@@ -40,6 +41,10 @@ interface CalendarEventProps {
|
|
|
40
41
|
dayIndex?: number;
|
|
41
42
|
};
|
|
42
43
|
app?: CalendarApp;
|
|
44
|
+
/** Whether the current view is in mobile mode */
|
|
45
|
+
isMobile?: boolean;
|
|
46
|
+
/** Force enable touch interactions regardless of isMobile */
|
|
47
|
+
enableTouch?: boolean;
|
|
43
48
|
}
|
|
44
49
|
declare const CalendarEvent: React.FC<CalendarEventProps>;
|
|
45
50
|
export default CalendarEvent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CalendarApp as ICalendarApp, CalendarAppConfig, CalendarAppState, CalendarView, ViewType, SidebarConfig, CalendarType } from '../types';
|
|
2
|
+
import { CalendarApp as ICalendarApp, CalendarAppConfig, CalendarAppState, CalendarView, ViewType, SidebarConfig, CalendarType, MobileEventRenderer, ReadOnlyConfig } from '../types';
|
|
3
3
|
import { Event } from '../types';
|
|
4
4
|
import { CalendarRegistry } from './calendarRegistry';
|
|
5
5
|
import { ThemeMode } from '../types/calendarTypes';
|
|
@@ -10,9 +10,17 @@ export declare class CalendarApp implements ICalendarApp {
|
|
|
10
10
|
private sidebarConfig;
|
|
11
11
|
private visibleMonth;
|
|
12
12
|
private useEventDetailDialog;
|
|
13
|
+
private useCalendarHeader;
|
|
14
|
+
private customMobileEventRenderer?;
|
|
13
15
|
private themeChangeListeners;
|
|
14
16
|
constructor(config: CalendarAppConfig);
|
|
15
17
|
private resolveLocale;
|
|
18
|
+
getReadOnlyConfig: () => ReadOnlyConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Helper to check if the calendar is in any form of read-only mode.
|
|
21
|
+
* If readOnly config is present, it's considered non-editable.
|
|
22
|
+
*/
|
|
23
|
+
private isInternalEditable;
|
|
16
24
|
changeView: (view: ViewType) => void;
|
|
17
25
|
getCurrentView: () => CalendarView;
|
|
18
26
|
setCurrentDate: (date: Date) => void;
|
|
@@ -27,6 +35,9 @@ export declare class CalendarApp implements ICalendarApp {
|
|
|
27
35
|
updateEvent: (id: string, eventUpdate: Partial<Event>, isPending?: boolean) => void;
|
|
28
36
|
deleteEvent: (id: string) => void;
|
|
29
37
|
getAllEvents: () => Event[];
|
|
38
|
+
onEventClick: (event: Event) => void;
|
|
39
|
+
onMoreEventsClick: (date: Date) => void;
|
|
40
|
+
highlightEvent: (eventId: string | null) => void;
|
|
30
41
|
getEvents: () => Event[];
|
|
31
42
|
getCalendars: () => CalendarType[];
|
|
32
43
|
reorderCalendars: (fromIndex: number, toIndex: number) => void;
|
|
@@ -37,6 +48,7 @@ export declare class CalendarApp implements ICalendarApp {
|
|
|
37
48
|
deleteCalendar: (id: string) => void;
|
|
38
49
|
mergeCalendars: (sourceId: string, targetId: string) => void;
|
|
39
50
|
getSidebarConfig: () => SidebarConfig;
|
|
51
|
+
getCalendarHeaderConfig: () => boolean | ((props: any) => React.ReactNode);
|
|
40
52
|
private installPlugin;
|
|
41
53
|
getPlugin: <T = unknown>(name: string) => T | undefined;
|
|
42
54
|
hasPlugin: (name: string) => boolean;
|
|
@@ -47,6 +59,8 @@ export declare class CalendarApp implements ICalendarApp {
|
|
|
47
59
|
triggerRender: () => void;
|
|
48
60
|
getCalendarRegistry: () => CalendarRegistry;
|
|
49
61
|
getUseEventDetailDialog: () => boolean;
|
|
62
|
+
getCustomMobileEventRenderer: () => MobileEventRenderer | undefined;
|
|
63
|
+
updateConfig: (config: Partial<CalendarAppConfig>) => void;
|
|
50
64
|
/**
|
|
51
65
|
* Set theme mode
|
|
52
66
|
* @param mode - Theme mode ('light', 'dark', or 'auto')
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EventDetailContentRenderer, EventDetailDialogRenderer, UseCalendarAppReturn } from '../types';
|
|
3
|
+
import { CalendarSearchProps } from '../types/search';
|
|
3
4
|
import { LocaleMessages } from '../locale/types';
|
|
4
5
|
interface DayFlowCalendarProps {
|
|
5
6
|
calendar: UseCalendarAppReturn;
|
|
@@ -12,6 +13,8 @@ interface DayFlowCalendarProps {
|
|
|
12
13
|
meta?: Record<string, any>;
|
|
13
14
|
/** Custom localization messages to override defaults */
|
|
14
15
|
customMessages?: LocaleMessages;
|
|
16
|
+
/** Search configuration */
|
|
17
|
+
search?: CalendarSearchProps;
|
|
15
18
|
}
|
|
16
19
|
export declare const DayFlowCalendar: React.FC<DayFlowCalendarProps>;
|
|
17
20
|
export default DayFlowCalendar;
|
|
@@ -4,4 +4,4 @@ export declare const useResponsiveMonthConfig: () => {
|
|
|
4
4
|
screenSize: "mobile" | "tablet" | "desktop";
|
|
5
5
|
weeksPerView: number;
|
|
6
6
|
};
|
|
7
|
-
export declare const useVirtualMonthScroll: ({ currentDate, weekHeight, onCurrentMonthChange, initialWeeksToLoad, locale, }: UseVirtualMonthScrollProps) => UseVirtualMonthScrollReturn;
|
|
7
|
+
export declare const useVirtualMonthScroll: ({ currentDate, weekHeight, onCurrentMonthChange, initialWeeksToLoad, locale, isEnabled, }: UseVirtualMonthScrollProps) => UseVirtualMonthScrollReturn;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,4 +34,6 @@ export type { DragIndicatorProps, DragIndicatorRenderer, } from './types/dragInd
|
|
|
34
34
|
export type { EventsService, EventsPluginConfig, DragService, DragPluginConfig, DragHookOptions, DragHookReturn, } from './types/plugin';
|
|
35
35
|
export type { BaseViewProps, ViewFactory, ViewAdapterProps, } from './types/factory';
|
|
36
36
|
export type { EventDetailPosition, EventDetailPanelProps, EventDetailPanelRenderer, EventDetailContentProps, EventDetailContentRenderer, EventDetailDialogProps, EventDetailDialogRenderer, } from './types/eventDetail';
|
|
37
|
+
export type { CalendarSearchProps, CalendarSearchEvent, } from './types/search';
|
|
38
|
+
export type { MobileEventProps, MobileEventRenderer, } from './types/mobileEvent';
|
|
37
39
|
export { ViewType } from './types';
|