sa2kit 1.6.5 → 1.6.6
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/auth/index.d.mts +11 -1
- package/dist/auth/index.d.ts +11 -1
- package/dist/auth/index.js +9 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +9 -1
- package/dist/auth/index.mjs.map +1 -1
- package/dist/calendar/index.d.mts +497 -611
- package/dist/calendar/index.d.ts +497 -611
- package/dist/calendar/index.js +4104 -4088
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +4092 -4075
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/calendar/routes/index.js +21 -21
- package/dist/calendar/routes/index.mjs +1 -1
- package/dist/calendar/server.d.mts +3 -8
- package/dist/calendar/server.d.ts +3 -8
- package/dist/calendar/server.js +14 -14
- package/dist/calendar/server.js.map +1 -1
- package/dist/calendar/server.mjs +3 -3
- package/dist/calendar/server.mjs.map +1 -1
- package/dist/{chunk-OCIJT5VO.mjs → chunk-6WXOA4BE.mjs} +3 -7
- package/dist/chunk-6WXOA4BE.mjs.map +1 -0
- package/dist/{chunk-FJU3NA6B.js → chunk-AXP7KROR.js} +3 -7
- package/dist/chunk-AXP7KROR.js.map +1 -0
- package/dist/{chunk-NRYHBGU6.js → chunk-IEA55H3G.js} +5 -5
- package/dist/chunk-IEA55H3G.js.map +1 -0
- package/dist/{chunk-KFDEOLDH.mjs → chunk-R2F4BXUU.mjs} +5 -5
- package/dist/chunk-R2F4BXUU.mjs.map +1 -0
- package/dist/index.d.mts +96 -103
- package/dist/index.d.ts +96 -103
- package/dist/index.js +433 -466
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +371 -402
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-FJU3NA6B.js.map +0 -1
- package/dist/chunk-KFDEOLDH.mjs.map +0 -1
- package/dist/chunk-NRYHBGU6.js.map +0 -1
- package/dist/chunk-OCIJT5VO.mjs.map +0 -1
package/dist/calendar/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DragStartEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
|
|
2
1
|
import React__default from 'react';
|
|
2
|
+
import { DragStartEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 日历模块类型定义
|
|
@@ -461,175 +461,6 @@ interface EventListProps {
|
|
|
461
461
|
className?: string;
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
-
interface UseEventsReturn {
|
|
465
|
-
events: CalendarEvent[];
|
|
466
|
-
loading: boolean;
|
|
467
|
-
error?: string;
|
|
468
|
-
createEvent: (eventData: EventFormData) => Promise<CalendarEvent>;
|
|
469
|
-
updateEvent: (eventId: number, eventData: Partial<EventFormData>) => Promise<CalendarEvent>;
|
|
470
|
-
deleteEvent: (eventId: number, deleteAll?: boolean) => Promise<void>;
|
|
471
|
-
batchDeleteEvents: (eventIds: number[]) => Promise<void>;
|
|
472
|
-
fetchEvents: (startDate: Date, endDate: Date) => Promise<void>;
|
|
473
|
-
clearError: () => void;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* 事件管理 Hook
|
|
477
|
-
*
|
|
478
|
-
* 提供事件的状态管理和CRUD操作
|
|
479
|
-
*/
|
|
480
|
-
declare function useEvents(): UseEventsReturn;
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* 事件类型服务
|
|
484
|
-
*
|
|
485
|
-
* 负责处理不同类型事件的创建逻辑:
|
|
486
|
-
* 1. 单次事件 (Single Event)
|
|
487
|
-
* 2. 多天事件 (Multi-day Event)
|
|
488
|
-
* 3. 重复事件 (Recurring Event)
|
|
489
|
-
*/
|
|
490
|
-
declare enum EventType {
|
|
491
|
-
SINGLE = "single",// 单次事件
|
|
492
|
-
MULTI_DAY = "multi_day",// 多天事件(跨越多个日期的单个事件)
|
|
493
|
-
RECURRING = "recurring"
|
|
494
|
-
}
|
|
495
|
-
declare enum RecurrencePattern {
|
|
496
|
-
DAILY = "daily",
|
|
497
|
-
WEEKLY = "weekly",
|
|
498
|
-
MONTHLY = "monthly",
|
|
499
|
-
YEARLY = "yearly",
|
|
500
|
-
CUSTOM = "custom"
|
|
501
|
-
}
|
|
502
|
-
interface BaseEventData {
|
|
503
|
-
title: string;
|
|
504
|
-
description?: string;
|
|
505
|
-
location?: string;
|
|
506
|
-
color: string;
|
|
507
|
-
priority: string;
|
|
508
|
-
allDay: boolean;
|
|
509
|
-
}
|
|
510
|
-
interface SingleEventData extends BaseEventData {
|
|
511
|
-
type: EventType.SINGLE;
|
|
512
|
-
startTime: Date;
|
|
513
|
-
endTime: Date;
|
|
514
|
-
}
|
|
515
|
-
interface MultiDayEventData extends BaseEventData {
|
|
516
|
-
type: EventType.MULTI_DAY;
|
|
517
|
-
startDate: Date;
|
|
518
|
-
endDate: Date;
|
|
519
|
-
startTime?: string;
|
|
520
|
-
endTime?: string;
|
|
521
|
-
}
|
|
522
|
-
interface RecurringEventData extends BaseEventData {
|
|
523
|
-
type: EventType.RECURRING;
|
|
524
|
-
startDate: Date;
|
|
525
|
-
startTime: Date;
|
|
526
|
-
endTime: Date;
|
|
527
|
-
recurrence: {
|
|
528
|
-
pattern: RecurrencePattern;
|
|
529
|
-
interval: number;
|
|
530
|
-
endDate?: Date;
|
|
531
|
-
count?: number;
|
|
532
|
-
daysOfWeek?: number[];
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
type EventData = SingleEventData | MultiDayEventData | RecurringEventData;
|
|
536
|
-
interface GeneratedEvent {
|
|
537
|
-
title: string;
|
|
538
|
-
description?: string;
|
|
539
|
-
startTime: Date;
|
|
540
|
-
endTime: Date;
|
|
541
|
-
location?: string;
|
|
542
|
-
color: string;
|
|
543
|
-
priority: string;
|
|
544
|
-
allDay: boolean;
|
|
545
|
-
eventType: EventType;
|
|
546
|
-
parentEventId?: string;
|
|
547
|
-
instanceDate?: string;
|
|
548
|
-
isMultiDayPart?: boolean;
|
|
549
|
-
isRecurringInstance?: boolean;
|
|
550
|
-
}
|
|
551
|
-
declare class EventTypeService {
|
|
552
|
-
/**
|
|
553
|
-
* 根据事件数据生成实际的事件实例
|
|
554
|
-
*/
|
|
555
|
-
static generateEventInstances(eventData: EventData, viewStartDate: Date, viewEndDate: Date, parentEventId?: string): GeneratedEvent[];
|
|
556
|
-
/**
|
|
557
|
-
* 生成单次事件
|
|
558
|
-
*/
|
|
559
|
-
private static generateSingleEvent;
|
|
560
|
-
/**
|
|
561
|
-
* 生成多天事件实例
|
|
562
|
-
* 例:21-23号的会议 -> 创建3个事件实例,每个代表一天
|
|
563
|
-
*/
|
|
564
|
-
private static generateMultiDayEvents;
|
|
565
|
-
/**
|
|
566
|
-
* 生成重复事件实例
|
|
567
|
-
*/
|
|
568
|
-
private static generateRecurringEvents;
|
|
569
|
-
/**
|
|
570
|
-
* 计算下一次重复的日期
|
|
571
|
-
*/
|
|
572
|
-
private static getNextRecurrenceDate;
|
|
573
|
-
/**
|
|
574
|
-
* 格式化日期为字符串 (YYYY-MM-DD)
|
|
575
|
-
*/
|
|
576
|
-
private static formatDateString;
|
|
577
|
-
/**
|
|
578
|
-
* 验证事件数据
|
|
579
|
-
*/
|
|
580
|
-
static validateEventData(eventData: EventData): string[];
|
|
581
|
-
private static validateSingleEvent;
|
|
582
|
-
private static validateMultiDayEvent;
|
|
583
|
-
private static validateRecurringEvent;
|
|
584
|
-
/**
|
|
585
|
-
* 获取事件类型的描述文本
|
|
586
|
-
*/
|
|
587
|
-
static getEventTypeDescription(eventData: EventData): string;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
interface UseEnhancedEventsReturn {
|
|
591
|
-
events: CalendarEvent[];
|
|
592
|
-
loading: boolean;
|
|
593
|
-
error?: string;
|
|
594
|
-
createEvent: (eventData: EventFormData) => Promise<CalendarEvent>;
|
|
595
|
-
createEnhancedEvent: (eventData: EventData) => Promise<CalendarEvent[]>;
|
|
596
|
-
updateEvent: (eventId: number, eventData: Partial<EventFormData>) => Promise<CalendarEvent>;
|
|
597
|
-
updateEventTime: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>;
|
|
598
|
-
deleteEvent: (eventId: number, deleteAll?: boolean) => Promise<void>;
|
|
599
|
-
batchDeleteEvents: (eventIds: number[]) => Promise<void>;
|
|
600
|
-
fetchEvents: (startDate: Date, endDate: Date) => Promise<void>;
|
|
601
|
-
clearError: () => void;
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* 增强版事件管理 Hook
|
|
605
|
-
*
|
|
606
|
-
* 支持新的事件类型系统:单次事件、多天事件、重复事件
|
|
607
|
-
*/
|
|
608
|
-
declare function useEnhancedEvents(): UseEnhancedEventsReturn;
|
|
609
|
-
|
|
610
|
-
interface DragState {
|
|
611
|
-
isDragging: boolean;
|
|
612
|
-
draggedEvent: CalendarEvent | null;
|
|
613
|
-
dragOverDate: Date | null;
|
|
614
|
-
previewTime: string | null;
|
|
615
|
-
}
|
|
616
|
-
interface UseEventDragReturn {
|
|
617
|
-
dragState: DragState;
|
|
618
|
-
handleDragStart: (event: DragStartEvent) => void;
|
|
619
|
-
handleDragOver: (event: DragOverEvent) => void;
|
|
620
|
-
handleDragEnd: (event: DragEndEvent) => void;
|
|
621
|
-
resetDragState: () => void;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* 事件拖拽Hook
|
|
625
|
-
*
|
|
626
|
-
* 提供事件拖拽功能,支持:
|
|
627
|
-
* - 拖拽事件到不同日期
|
|
628
|
-
* - 拖拽时显示预览信息
|
|
629
|
-
* - 拖拽状态管理
|
|
630
|
-
*/
|
|
631
|
-
declare function useEventDrag(events: CalendarEvent[], onEventUpdate: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>): UseEventDragReturn;
|
|
632
|
-
|
|
633
464
|
/**
|
|
634
465
|
* 日历日期工具函数
|
|
635
466
|
*
|
|
@@ -762,550 +593,605 @@ declare function isValidDate(date: any): date is Date;
|
|
|
762
593
|
*/
|
|
763
594
|
declare function cloneDate(date: Date): Date;
|
|
764
595
|
|
|
596
|
+
interface CalendarPageProps {
|
|
597
|
+
/** 当前登录用户信息 */
|
|
598
|
+
user?: {
|
|
599
|
+
id: number;
|
|
600
|
+
name?: string;
|
|
601
|
+
[key: string]: any;
|
|
602
|
+
} | null;
|
|
603
|
+
/** 是否已认证 */
|
|
604
|
+
isAuthenticated?: boolean;
|
|
605
|
+
/** 触发登录的回调 */
|
|
606
|
+
onShowLogin?: () => void;
|
|
607
|
+
/** 自定义页头操作区域(例如用户菜单) */
|
|
608
|
+
headerActions?: React__default.ReactNode;
|
|
609
|
+
}
|
|
765
610
|
/**
|
|
766
|
-
*
|
|
611
|
+
* 基础日历页面组件
|
|
612
|
+
*
|
|
613
|
+
* 这是一个简化版本的日历页面,用于在实验田中展示基本功能
|
|
614
|
+
* 包含了基本的月历视图和事件显示
|
|
767
615
|
*/
|
|
768
|
-
declare
|
|
616
|
+
declare function CalendarPage({ user, isAuthenticated, onShowLogin, headerActions }: CalendarPageProps): React__default.JSX.Element;
|
|
617
|
+
|
|
618
|
+
interface EventDetailPageProps {
|
|
619
|
+
eventId: number;
|
|
620
|
+
onBack?: () => void;
|
|
621
|
+
onEdit?: (event: CalendarEvent) => void;
|
|
622
|
+
onDelete?: (eventId: number) => void;
|
|
623
|
+
}
|
|
624
|
+
declare const EventDetailPage: React__default.FC<EventDetailPageProps>;
|
|
625
|
+
|
|
626
|
+
interface EventFormProps {
|
|
627
|
+
/** 初始事件数据(编辑模式) */
|
|
628
|
+
initialData?: Partial<EventFormData>;
|
|
629
|
+
/** 是否为编辑模式 */
|
|
630
|
+
isEdit?: boolean;
|
|
631
|
+
/** 表单提交回调 */
|
|
632
|
+
onSubmit: (data: EventFormData) => void;
|
|
633
|
+
/** 取消回调 */
|
|
634
|
+
onCancel: () => void;
|
|
635
|
+
/** 是否正在加载 */
|
|
636
|
+
loading?: boolean;
|
|
637
|
+
}
|
|
769
638
|
/**
|
|
770
|
-
*
|
|
639
|
+
* 事件表单组件
|
|
640
|
+
*
|
|
641
|
+
* 用于创建和编辑日历事件的表单组件
|
|
642
|
+
* 支持基本信息、重复规则、提醒设置等功能
|
|
771
643
|
*/
|
|
772
|
-
declare
|
|
773
|
-
declare const useDeviceType: () => {
|
|
774
|
-
isMobile: boolean;
|
|
775
|
-
dragSupported: boolean;
|
|
776
|
-
};
|
|
644
|
+
declare function EventForm({ initialData, isEdit, onSubmit, onCancel, loading }: EventFormProps): React__default.JSX.Element;
|
|
777
645
|
|
|
778
|
-
interface
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
weekOfMonth?: number;
|
|
646
|
+
interface EventModalProps {
|
|
647
|
+
isOpen: boolean;
|
|
648
|
+
onClose: () => void;
|
|
649
|
+
onSave: (eventData: CreateEventRequest | UpdateEventRequest) => Promise<void>;
|
|
650
|
+
onDelete?: (eventId: number) => Promise<void>;
|
|
651
|
+
event?: CalendarEvent | null;
|
|
652
|
+
initialDate?: Date;
|
|
786
653
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
654
|
+
declare const EventModal: React__default.FC<EventModalProps>;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* 事件列表组件
|
|
658
|
+
* 支持列表/网格显示模式、排序、批量选择和批量删除
|
|
659
|
+
*/
|
|
660
|
+
declare function EventList({ events, config, onConfigChange, onEventClick, onEventEdit, onEventDelete, onBatchDelete, enableBatchActions, loading, className }: EventListProps): React__default.JSX.Element;
|
|
661
|
+
|
|
662
|
+
interface EventSearchProps {
|
|
663
|
+
events: CalendarEvent[];
|
|
664
|
+
onFiltered: (filteredEvents: CalendarEvent[]) => void;
|
|
665
|
+
className?: string;
|
|
799
666
|
}
|
|
800
|
-
declare
|
|
801
|
-
|
|
802
|
-
|
|
667
|
+
declare const EventSearch: React__default.FC<EventSearchProps>;
|
|
668
|
+
|
|
669
|
+
interface DraggableEventProps {
|
|
670
|
+
event: CalendarEvent;
|
|
671
|
+
isDragging?: boolean;
|
|
672
|
+
className?: string;
|
|
673
|
+
onClick?: () => void;
|
|
674
|
+
children?: React__default.ReactNode;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* 可拖拽的事件组件
|
|
678
|
+
*
|
|
679
|
+
* 功能特性:
|
|
680
|
+
* - 支持拖拽移动事件(桌面端)
|
|
681
|
+
* - 移动端禁用拖拽功能
|
|
682
|
+
* - 拖拽时显示半透明效果
|
|
683
|
+
* - 保持原有的点击功能
|
|
684
|
+
* - 响应式设计
|
|
685
|
+
*/
|
|
686
|
+
declare const DraggableEvent: React__default.FC<DraggableEventProps>;
|
|
687
|
+
|
|
688
|
+
interface DroppableCalendarCellProps {
|
|
689
|
+
date: Date;
|
|
690
|
+
events: CalendarEvent[];
|
|
691
|
+
isCurrentMonth: boolean;
|
|
692
|
+
isSelected?: boolean;
|
|
693
|
+
dragOverPreview?: string | null;
|
|
694
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
695
|
+
onDateClick?: (date: Date) => void;
|
|
696
|
+
className?: string;
|
|
697
|
+
disableDrop?: boolean;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* 可放置的日历单元格组件
|
|
701
|
+
*
|
|
702
|
+
* 功能特性:
|
|
703
|
+
* - 支持拖拽事件到此日期
|
|
704
|
+
* - 显示当前日期的所有事件
|
|
705
|
+
* - 拖拽悬停时显示预览
|
|
706
|
+
* - 响应式设计
|
|
707
|
+
*/
|
|
708
|
+
declare const DroppableCalendarCell: React__default.FC<DroppableCalendarCellProps>;
|
|
709
|
+
|
|
710
|
+
interface DraggableMonthViewProps {
|
|
711
|
+
events: CalendarEvent[];
|
|
712
|
+
currentDate: Date;
|
|
713
|
+
onDateChange: (date: Date) => void;
|
|
714
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
715
|
+
onDateClick?: (date: Date) => void;
|
|
716
|
+
onEventUpdate: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>;
|
|
717
|
+
className?: string;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* 支持拖拽的月视图组件
|
|
721
|
+
*
|
|
722
|
+
* 功能特性:
|
|
723
|
+
* - 完整的月视图日历
|
|
724
|
+
* - 事件拖拽功能(桌面端)
|
|
725
|
+
* - 移动端禁用拖拽,优化触摸体验
|
|
726
|
+
* - 拖拽预览和反馈
|
|
727
|
+
* - 月份导航
|
|
728
|
+
* - 响应式设计
|
|
729
|
+
*/
|
|
730
|
+
declare const DraggableMonthView: React__default.FC<DraggableMonthViewProps>;
|
|
731
|
+
|
|
732
|
+
interface UseEventsReturn {
|
|
733
|
+
events: CalendarEvent[];
|
|
734
|
+
loading: boolean;
|
|
735
|
+
error?: string;
|
|
736
|
+
createEvent: (eventData: EventFormData) => Promise<CalendarEvent>;
|
|
737
|
+
updateEvent: (eventId: number, eventData: Partial<EventFormData>) => Promise<CalendarEvent>;
|
|
738
|
+
deleteEvent: (eventId: number, deleteAll?: boolean) => Promise<void>;
|
|
739
|
+
batchDeleteEvents: (eventIds: number[]) => Promise<void>;
|
|
740
|
+
fetchEvents: (startDate: Date, endDate: Date) => Promise<void>;
|
|
741
|
+
clearError: () => void;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* 事件管理 Hook
|
|
745
|
+
*
|
|
746
|
+
* 提供事件的状态管理和CRUD操作
|
|
747
|
+
*/
|
|
748
|
+
declare function useEvents(): UseEventsReturn;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* 事件类型服务
|
|
752
|
+
*
|
|
753
|
+
* 负责处理不同类型事件的创建逻辑:
|
|
754
|
+
* 1. 单次事件 (Single Event)
|
|
755
|
+
* 2. 多天事件 (Multi-day Event)
|
|
756
|
+
* 3. 重复事件 (Recurring Event)
|
|
757
|
+
*/
|
|
758
|
+
declare enum EventType {
|
|
759
|
+
SINGLE = "single",// 单次事件
|
|
760
|
+
MULTI_DAY = "multi_day",// 多天事件(跨越多个日期的单个事件)
|
|
761
|
+
RECURRING = "recurring"
|
|
762
|
+
}
|
|
763
|
+
declare enum RecurrencePattern {
|
|
764
|
+
DAILY = "daily",
|
|
765
|
+
WEEKLY = "weekly",
|
|
766
|
+
MONTHLY = "monthly",
|
|
767
|
+
YEARLY = "yearly",
|
|
768
|
+
CUSTOM = "custom"
|
|
769
|
+
}
|
|
770
|
+
interface BaseEventData {
|
|
771
|
+
title: string;
|
|
772
|
+
description?: string;
|
|
773
|
+
location?: string;
|
|
774
|
+
color: string;
|
|
775
|
+
priority: string;
|
|
776
|
+
allDay: boolean;
|
|
777
|
+
}
|
|
778
|
+
interface SingleEventData extends BaseEventData {
|
|
779
|
+
type: EventType.SINGLE;
|
|
780
|
+
startTime: Date;
|
|
781
|
+
endTime: Date;
|
|
782
|
+
}
|
|
783
|
+
interface MultiDayEventData extends BaseEventData {
|
|
784
|
+
type: EventType.MULTI_DAY;
|
|
785
|
+
startDate: Date;
|
|
786
|
+
endDate: Date;
|
|
787
|
+
startTime?: string;
|
|
788
|
+
endTime?: string;
|
|
789
|
+
}
|
|
790
|
+
interface RecurringEventData extends BaseEventData {
|
|
791
|
+
type: EventType.RECURRING;
|
|
792
|
+
startDate: Date;
|
|
793
|
+
startTime: Date;
|
|
794
|
+
endTime: Date;
|
|
795
|
+
recurrence: {
|
|
796
|
+
pattern: RecurrencePattern;
|
|
797
|
+
interval: number;
|
|
798
|
+
endDate?: Date;
|
|
799
|
+
count?: number;
|
|
800
|
+
daysOfWeek?: number[];
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
type EventData = SingleEventData | MultiDayEventData | RecurringEventData;
|
|
804
|
+
interface GeneratedEvent {
|
|
805
|
+
title: string;
|
|
806
|
+
description?: string;
|
|
807
|
+
startTime: Date;
|
|
808
|
+
endTime: Date;
|
|
809
|
+
location?: string;
|
|
810
|
+
color: string;
|
|
811
|
+
priority: string;
|
|
812
|
+
allDay: boolean;
|
|
813
|
+
eventType: EventType;
|
|
814
|
+
parentEventId?: string;
|
|
815
|
+
instanceDate?: string;
|
|
816
|
+
isMultiDayPart?: boolean;
|
|
817
|
+
isRecurringInstance?: boolean;
|
|
818
|
+
}
|
|
819
|
+
declare class EventTypeService {
|
|
820
|
+
/**
|
|
821
|
+
* 根据事件数据生成实际的事件实例
|
|
803
822
|
*/
|
|
804
|
-
static
|
|
805
|
-
title: string;
|
|
806
|
-
description?: string;
|
|
807
|
-
startTime: string;
|
|
808
|
-
endTime: string;
|
|
809
|
-
location?: string;
|
|
810
|
-
color?: string;
|
|
811
|
-
priority?: string;
|
|
812
|
-
allDay: boolean;
|
|
813
|
-
}, rule: RecurrenceRule, startDate: Date, endDate: Date, eventId?: string): RecurringEventInstance[];
|
|
823
|
+
static generateEventInstances(eventData: EventData, viewStartDate: Date, viewEndDate: Date, parentEventId?: string): GeneratedEvent[];
|
|
814
824
|
/**
|
|
815
|
-
*
|
|
825
|
+
* 生成单次事件
|
|
816
826
|
*/
|
|
817
|
-
private static
|
|
827
|
+
private static generateSingleEvent;
|
|
818
828
|
/**
|
|
819
|
-
*
|
|
829
|
+
* 生成多天事件实例
|
|
830
|
+
* 例:21-23号的会议 -> 创建3个事件实例,每个代表一天
|
|
820
831
|
*/
|
|
821
|
-
private static
|
|
832
|
+
private static generateMultiDayEvents;
|
|
822
833
|
/**
|
|
823
|
-
*
|
|
834
|
+
* 生成重复事件实例
|
|
824
835
|
*/
|
|
825
|
-
static
|
|
836
|
+
private static generateRecurringEvents;
|
|
826
837
|
/**
|
|
827
|
-
*
|
|
838
|
+
* 计算下一次重复的日期
|
|
828
839
|
*/
|
|
829
|
-
static
|
|
830
|
-
recurrenceType?: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
831
|
-
recurrenceInterval?: number;
|
|
832
|
-
recurrenceEndDate?: string;
|
|
833
|
-
recurrenceCount?: number;
|
|
834
|
-
}): RecurrenceRule | null;
|
|
840
|
+
private static getNextRecurrenceDate;
|
|
835
841
|
/**
|
|
836
|
-
*
|
|
842
|
+
* 格式化日期为字符串 (YYYY-MM-DD)
|
|
837
843
|
*/
|
|
838
|
-
static
|
|
844
|
+
private static formatDateString;
|
|
845
|
+
/**
|
|
846
|
+
* 验证事件数据
|
|
847
|
+
*/
|
|
848
|
+
static validateEventData(eventData: EventData): string[];
|
|
849
|
+
private static validateSingleEvent;
|
|
850
|
+
private static validateMultiDayEvent;
|
|
851
|
+
private static validateRecurringEvent;
|
|
852
|
+
/**
|
|
853
|
+
* 获取事件类型的描述文本
|
|
854
|
+
*/
|
|
855
|
+
static getEventTypeDescription(eventData: EventData): string;
|
|
839
856
|
}
|
|
840
857
|
|
|
841
|
-
interface
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
858
|
+
interface UseEnhancedEventsReturn {
|
|
859
|
+
events: CalendarEvent[];
|
|
860
|
+
loading: boolean;
|
|
861
|
+
error?: string;
|
|
862
|
+
createEvent: (eventData: EventFormData) => Promise<CalendarEvent>;
|
|
863
|
+
createEnhancedEvent: (eventData: EventData) => Promise<CalendarEvent[]>;
|
|
864
|
+
updateEvent: (eventId: number, eventData: Partial<EventFormData>) => Promise<CalendarEvent>;
|
|
865
|
+
updateEventTime: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>;
|
|
866
|
+
deleteEvent: (eventId: number, deleteAll?: boolean) => Promise<void>;
|
|
867
|
+
batchDeleteEvents: (eventIds: number[]) => Promise<void>;
|
|
868
|
+
fetchEvents: (startDate: Date, endDate: Date) => Promise<void>;
|
|
869
|
+
clearError: () => void;
|
|
845
870
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
871
|
+
/**
|
|
872
|
+
* 增强版事件管理 Hook
|
|
873
|
+
*
|
|
874
|
+
* 支持新的事件类型系统:单次事件、多天事件、重复事件
|
|
875
|
+
*/
|
|
876
|
+
declare function useEnhancedEvents(): UseEnhancedEventsReturn;
|
|
877
|
+
|
|
878
|
+
interface DragState {
|
|
879
|
+
isDragging: boolean;
|
|
880
|
+
draggedEvent: CalendarEvent | null;
|
|
881
|
+
dragOverDate: Date | null;
|
|
882
|
+
previewTime: string | null;
|
|
853
883
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
884
|
+
interface UseEventDragReturn {
|
|
885
|
+
dragState: DragState;
|
|
886
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
887
|
+
handleDragOver: (event: DragOverEvent) => void;
|
|
888
|
+
handleDragEnd: (event: DragEndEvent) => void;
|
|
889
|
+
resetDragState: () => void;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* 事件拖拽Hook
|
|
893
|
+
*
|
|
894
|
+
* 提供事件拖拽功能,支持:
|
|
895
|
+
* - 拖拽事件到不同日期
|
|
896
|
+
* - 拖拽时显示预览信息
|
|
897
|
+
* - 拖拽状态管理
|
|
898
|
+
*/
|
|
899
|
+
declare function useEventDrag(events: CalendarEvent[], onEventUpdate: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>): UseEventDragReturn;
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* 日历导出服务
|
|
903
|
+
*
|
|
904
|
+
* 提供日历事件的导出功能,支持多种格式:
|
|
905
|
+
* - iCal (.ics) 格式
|
|
906
|
+
* - JSON 格式
|
|
907
|
+
* - CSV 格式
|
|
908
|
+
*/
|
|
909
|
+
|
|
910
|
+
interface ExportOptions {
|
|
911
|
+
format: 'ical' | 'json' | 'csv';
|
|
912
|
+
dateRange?: {
|
|
913
|
+
start: Date;
|
|
914
|
+
end: Date;
|
|
915
|
+
};
|
|
916
|
+
includeCompleted?: boolean;
|
|
917
|
+
}
|
|
918
|
+
declare class CalendarExportService {
|
|
857
919
|
/**
|
|
858
|
-
*
|
|
920
|
+
* 导出事件到指定格式
|
|
859
921
|
*/
|
|
860
|
-
static
|
|
922
|
+
static exportEvents(events: CalendarEvent[], options: ExportOptions): Promise<string>;
|
|
861
923
|
/**
|
|
862
|
-
*
|
|
924
|
+
* 导出为 iCal (.ics) 格式
|
|
863
925
|
*/
|
|
864
|
-
static
|
|
926
|
+
private static exportToICal;
|
|
865
927
|
/**
|
|
866
|
-
*
|
|
928
|
+
* 导出为 JSON 格式
|
|
867
929
|
*/
|
|
868
|
-
static
|
|
930
|
+
private static exportToJSON;
|
|
869
931
|
/**
|
|
870
|
-
*
|
|
932
|
+
* 导出为 CSV 格式
|
|
871
933
|
*/
|
|
872
|
-
static
|
|
934
|
+
private static exportToCSV;
|
|
873
935
|
/**
|
|
874
|
-
*
|
|
936
|
+
* 下载导出的文件
|
|
875
937
|
*/
|
|
876
|
-
|
|
938
|
+
static downloadFile(content: string, filename: string, mimeType: string): void;
|
|
877
939
|
/**
|
|
878
|
-
*
|
|
940
|
+
* 获导出方法的便捷函数
|
|
879
941
|
*/
|
|
880
|
-
|
|
942
|
+
static exportAndDownload(events: CalendarEvent[], options: ExportOptions, filename?: string): Promise<void>;
|
|
881
943
|
/**
|
|
882
|
-
*
|
|
944
|
+
* 格式化日期时间为 iCal 格式
|
|
883
945
|
*/
|
|
884
|
-
private static
|
|
946
|
+
private static formatDateTimeToICal;
|
|
885
947
|
/**
|
|
886
|
-
*
|
|
948
|
+
* 转义 iCal 文本
|
|
887
949
|
*/
|
|
888
|
-
private static
|
|
950
|
+
private static escapeICalText;
|
|
889
951
|
/**
|
|
890
|
-
*
|
|
952
|
+
* 转义 CSV 字段
|
|
891
953
|
*/
|
|
892
|
-
private static
|
|
954
|
+
private static escapeCSVField;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* 日历导入服务
|
|
959
|
+
*
|
|
960
|
+
* 提供日历事件的导入功能,支持多种格式:
|
|
961
|
+
* - iCal (.ics) 格式
|
|
962
|
+
* - JSON 格式
|
|
963
|
+
* - CSV 格式
|
|
964
|
+
*/
|
|
965
|
+
|
|
966
|
+
interface ImportOptions {
|
|
967
|
+
format: 'ical' | 'json' | 'csv';
|
|
968
|
+
overwriteExisting?: boolean;
|
|
969
|
+
validateEvents?: boolean;
|
|
970
|
+
}
|
|
971
|
+
interface ImportResult {
|
|
972
|
+
success: boolean;
|
|
973
|
+
importedCount: number;
|
|
974
|
+
errors: string[];
|
|
975
|
+
events: CreateEventRequest[];
|
|
976
|
+
}
|
|
977
|
+
declare class CalendarImportService {
|
|
893
978
|
/**
|
|
894
|
-
*
|
|
979
|
+
* 从文件导入事件
|
|
895
980
|
*/
|
|
896
|
-
|
|
981
|
+
static importFromFile(file: File, options: ImportOptions): Promise<ImportResult>;
|
|
897
982
|
/**
|
|
898
|
-
*
|
|
983
|
+
* 从内容字符串导入事件
|
|
899
984
|
*/
|
|
900
|
-
|
|
985
|
+
static importFromContent(content: string, options: ImportOptions): Promise<ImportResult>;
|
|
901
986
|
/**
|
|
902
|
-
*
|
|
987
|
+
* 读取文件内容
|
|
903
988
|
*/
|
|
904
|
-
private static
|
|
989
|
+
private static readFileContent;
|
|
905
990
|
/**
|
|
906
|
-
*
|
|
991
|
+
* 解析 iCal 内容
|
|
907
992
|
*/
|
|
908
|
-
static
|
|
993
|
+
private static parseICalContent;
|
|
909
994
|
/**
|
|
910
|
-
*
|
|
995
|
+
* 解析 JSON 内容
|
|
911
996
|
*/
|
|
912
|
-
static
|
|
997
|
+
private static parseJSONContent;
|
|
913
998
|
/**
|
|
914
|
-
*
|
|
999
|
+
* 解析 CSV 内容
|
|
915
1000
|
*/
|
|
916
|
-
static
|
|
1001
|
+
private static parseCSVContent;
|
|
917
1002
|
/**
|
|
918
|
-
*
|
|
1003
|
+
* 解析 CSV 行
|
|
919
1004
|
*/
|
|
920
|
-
static
|
|
1005
|
+
private static parseCSVLine;
|
|
1006
|
+
/**
|
|
1007
|
+
* 验证和过滤事件
|
|
1008
|
+
*/
|
|
1009
|
+
private static validateAndFilterEvents;
|
|
1010
|
+
/**
|
|
1011
|
+
* 解析 iCal 日期时间
|
|
1012
|
+
*/
|
|
1013
|
+
private static parseICalDateTime;
|
|
1014
|
+
/**
|
|
1015
|
+
* 反转义 iCal 文本
|
|
1016
|
+
*/
|
|
1017
|
+
private static unescapeICalText;
|
|
1018
|
+
/**
|
|
1019
|
+
* 映射 iCal 优先级
|
|
1020
|
+
*/
|
|
1021
|
+
private static mapICalPriority;
|
|
921
1022
|
}
|
|
922
1023
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
interface ExportOptions {
|
|
933
|
-
format: 'ical' | 'json' | 'csv';
|
|
934
|
-
dateRange?: {
|
|
935
|
-
start: Date;
|
|
936
|
-
end: Date;
|
|
937
|
-
};
|
|
938
|
-
includeCompleted?: boolean;
|
|
1024
|
+
interface RecurrenceRule {
|
|
1025
|
+
type: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
1026
|
+
interval: number;
|
|
1027
|
+
endDate?: string;
|
|
1028
|
+
count?: number;
|
|
1029
|
+
daysOfWeek?: number[];
|
|
1030
|
+
dayOfMonth?: number;
|
|
1031
|
+
weekOfMonth?: number;
|
|
939
1032
|
}
|
|
940
|
-
|
|
1033
|
+
interface RecurringEventInstance {
|
|
1034
|
+
startTime: string;
|
|
1035
|
+
endTime: string;
|
|
1036
|
+
title: string;
|
|
1037
|
+
description?: string;
|
|
1038
|
+
location?: string;
|
|
1039
|
+
color?: string;
|
|
1040
|
+
priority?: string;
|
|
1041
|
+
allDay: boolean;
|
|
1042
|
+
isRecurringInstance: boolean;
|
|
1043
|
+
recurrenceId?: string;
|
|
1044
|
+
instanceDate: string;
|
|
1045
|
+
}
|
|
1046
|
+
declare class RecurrenceService {
|
|
941
1047
|
/**
|
|
942
|
-
*
|
|
1048
|
+
* 根据重复规则生成事件实例
|
|
943
1049
|
*/
|
|
944
|
-
static
|
|
1050
|
+
static generateRecurringInstances(baseEvent: {
|
|
1051
|
+
title: string;
|
|
1052
|
+
description?: string;
|
|
1053
|
+
startTime: string;
|
|
1054
|
+
endTime: string;
|
|
1055
|
+
location?: string;
|
|
1056
|
+
color?: string;
|
|
1057
|
+
priority?: string;
|
|
1058
|
+
allDay: boolean;
|
|
1059
|
+
}, rule: RecurrenceRule, startDate: Date, endDate: Date, eventId?: string): RecurringEventInstance[];
|
|
945
1060
|
/**
|
|
946
|
-
*
|
|
1061
|
+
* 判断是否应该在指定日期生成实例
|
|
947
1062
|
*/
|
|
948
|
-
private static
|
|
1063
|
+
private static shouldGenerateInstance;
|
|
949
1064
|
/**
|
|
950
|
-
*
|
|
1065
|
+
* 获取下一个重复事件的日期
|
|
951
1066
|
*/
|
|
952
|
-
private static
|
|
1067
|
+
private static getNextOccurrence;
|
|
1068
|
+
/**
|
|
1069
|
+
* 验证重复规则
|
|
1070
|
+
*/
|
|
1071
|
+
static validateRecurrenceRule(rule: RecurrenceRule): string[];
|
|
1072
|
+
/**
|
|
1073
|
+
* 将表单数据转换为重复规则
|
|
1074
|
+
*/
|
|
1075
|
+
static formDataToRecurrenceRule(formData: {
|
|
1076
|
+
recurrenceType?: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
1077
|
+
recurrenceInterval?: number;
|
|
1078
|
+
recurrenceEndDate?: string;
|
|
1079
|
+
recurrenceCount?: number;
|
|
1080
|
+
}): RecurrenceRule | null;
|
|
953
1081
|
/**
|
|
954
|
-
*
|
|
1082
|
+
* 描述重复规则的文本
|
|
955
1083
|
*/
|
|
956
|
-
|
|
1084
|
+
static describeRecurrenceRule(rule: RecurrenceRule): string;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
interface ReminderConfig {
|
|
1088
|
+
minutes: number;
|
|
1089
|
+
type: 'browser' | 'email' | 'sms' | 'sound';
|
|
1090
|
+
enabled: boolean;
|
|
1091
|
+
}
|
|
1092
|
+
interface ScheduledReminder {
|
|
1093
|
+
id: string;
|
|
1094
|
+
eventId: number;
|
|
1095
|
+
eventTitle: string;
|
|
1096
|
+
reminderTime: Date;
|
|
1097
|
+
config: ReminderConfig;
|
|
1098
|
+
status: 'pending' | 'sent' | 'failed';
|
|
1099
|
+
}
|
|
1100
|
+
declare class ReminderService {
|
|
1101
|
+
private static reminders;
|
|
1102
|
+
private static notificationPermission;
|
|
957
1103
|
/**
|
|
958
|
-
*
|
|
1104
|
+
* 初始化提醒服务
|
|
959
1105
|
*/
|
|
960
|
-
static
|
|
1106
|
+
static initialize(): Promise<void>;
|
|
961
1107
|
/**
|
|
962
|
-
*
|
|
1108
|
+
* 为事件创建提醒
|
|
963
1109
|
*/
|
|
964
|
-
static
|
|
1110
|
+
static createReminder(event: CalendarEvent, reminderMinutes: number, reminderType?: 'browser' | 'email' | 'sms' | 'sound'): string;
|
|
965
1111
|
/**
|
|
966
|
-
*
|
|
1112
|
+
* 删除提醒
|
|
967
1113
|
*/
|
|
968
|
-
|
|
1114
|
+
static deleteReminder(reminderId: string): boolean;
|
|
969
1115
|
/**
|
|
970
|
-
*
|
|
1116
|
+
* 删除事件的所有提醒
|
|
971
1117
|
*/
|
|
972
|
-
|
|
1118
|
+
static deleteEventReminders(eventId: number): void;
|
|
973
1119
|
/**
|
|
974
|
-
*
|
|
1120
|
+
* 检查并触发到期的提醒
|
|
975
1121
|
*/
|
|
976
|
-
private static
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* 日历导入服务
|
|
981
|
-
*
|
|
982
|
-
* 提供日历事件的导入功能,支持多种格式:
|
|
983
|
-
* - iCal (.ics) 格式
|
|
984
|
-
* - JSON 格式
|
|
985
|
-
* - CSV 格式
|
|
986
|
-
*/
|
|
987
|
-
|
|
988
|
-
interface ImportOptions {
|
|
989
|
-
format: 'ical' | 'json' | 'csv';
|
|
990
|
-
overwriteExisting?: boolean;
|
|
991
|
-
validateEvents?: boolean;
|
|
992
|
-
}
|
|
993
|
-
interface ImportResult {
|
|
994
|
-
success: boolean;
|
|
995
|
-
importedCount: number;
|
|
996
|
-
errors: string[];
|
|
997
|
-
events: CreateEventRequest[];
|
|
998
|
-
}
|
|
999
|
-
declare class CalendarImportService {
|
|
1122
|
+
private static checkPendingReminders;
|
|
1000
1123
|
/**
|
|
1001
|
-
*
|
|
1124
|
+
* 触发提醒
|
|
1002
1125
|
*/
|
|
1003
|
-
static
|
|
1126
|
+
private static triggerReminder;
|
|
1004
1127
|
/**
|
|
1005
|
-
*
|
|
1128
|
+
* 发送浏览器通知
|
|
1006
1129
|
*/
|
|
1007
|
-
static
|
|
1130
|
+
private static sendBrowserNotification;
|
|
1008
1131
|
/**
|
|
1009
|
-
*
|
|
1132
|
+
* 发送邮件提醒
|
|
1010
1133
|
*/
|
|
1011
|
-
private static
|
|
1134
|
+
private static sendEmailReminder;
|
|
1012
1135
|
/**
|
|
1013
|
-
*
|
|
1136
|
+
* 发送短信提醒
|
|
1014
1137
|
*/
|
|
1015
|
-
private static
|
|
1138
|
+
private static sendSmsReminder;
|
|
1016
1139
|
/**
|
|
1017
|
-
*
|
|
1140
|
+
* 播放声音提醒
|
|
1018
1141
|
*/
|
|
1019
|
-
private static
|
|
1142
|
+
private static playSoundReminder;
|
|
1020
1143
|
/**
|
|
1021
|
-
*
|
|
1144
|
+
* 显示视觉提醒
|
|
1022
1145
|
*/
|
|
1023
|
-
private static
|
|
1146
|
+
private static showVisualAlert;
|
|
1024
1147
|
/**
|
|
1025
|
-
*
|
|
1148
|
+
* 获取时间描述文本
|
|
1026
1149
|
*/
|
|
1027
|
-
private static
|
|
1150
|
+
private static getTimeText;
|
|
1028
1151
|
/**
|
|
1029
|
-
*
|
|
1152
|
+
* 获取所有提醒
|
|
1030
1153
|
*/
|
|
1031
|
-
|
|
1154
|
+
static getAllReminders(): ScheduledReminder[];
|
|
1032
1155
|
/**
|
|
1033
|
-
*
|
|
1156
|
+
* 获取事件的提醒
|
|
1034
1157
|
*/
|
|
1035
|
-
|
|
1158
|
+
static getEventReminders(eventId: number): ScheduledReminder[];
|
|
1036
1159
|
/**
|
|
1037
|
-
*
|
|
1160
|
+
* 智能推荐提醒时间
|
|
1038
1161
|
*/
|
|
1039
|
-
|
|
1162
|
+
static getSmartReminderSuggestions(event: CalendarEvent): number[];
|
|
1040
1163
|
/**
|
|
1041
|
-
*
|
|
1164
|
+
* 批量创建智能提醒
|
|
1042
1165
|
*/
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
interface CalendarPageProps {
|
|
1047
|
-
/** 当前登录用户信息 */
|
|
1048
|
-
user?: {
|
|
1049
|
-
id: number;
|
|
1050
|
-
name?: string;
|
|
1051
|
-
[key: string]: any;
|
|
1052
|
-
} | null;
|
|
1053
|
-
/** 是否已认证 */
|
|
1054
|
-
isAuthenticated?: boolean;
|
|
1055
|
-
/** 触发登录的回调 */
|
|
1056
|
-
onShowLogin?: () => void;
|
|
1057
|
-
/** 自定义页头操作区域(例如用户菜单) */
|
|
1058
|
-
headerActions?: React__default.ReactNode;
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* 基础日历页面组件
|
|
1062
|
-
*
|
|
1063
|
-
* 这是一个简化版本的日历页面,用于在实验田中展示基本功能
|
|
1064
|
-
* 包含了基本的月历视图和事件显示
|
|
1065
|
-
*/
|
|
1066
|
-
declare function CalendarPage({ user: propUser, isAuthenticated: propIsAuthenticated, onShowLogin, headerActions }: CalendarPageProps): React__default.JSX.Element;
|
|
1067
|
-
|
|
1068
|
-
interface EventDetailPageProps {
|
|
1069
|
-
eventId: number;
|
|
1070
|
-
onBack?: () => void;
|
|
1071
|
-
onEdit?: (event: CalendarEvent) => void;
|
|
1072
|
-
onDelete?: (eventId: number) => void;
|
|
1166
|
+
static createSmartReminders(event: CalendarEvent): string[];
|
|
1073
1167
|
}
|
|
1074
|
-
declare const EventDetailPage: React__default.FC<EventDetailPageProps>;
|
|
1075
1168
|
|
|
1076
|
-
interface EventFormProps {
|
|
1077
|
-
/** 初始事件数据(编辑模式) */
|
|
1078
|
-
initialData?: Partial<EventFormData>;
|
|
1079
|
-
/** 是否为编辑模式 */
|
|
1080
|
-
isEdit?: boolean;
|
|
1081
|
-
/** 表单提交回调 */
|
|
1082
|
-
onSubmit: (data: EventFormData) => void;
|
|
1083
|
-
/** 取消回调 */
|
|
1084
|
-
onCancel: () => void;
|
|
1085
|
-
/** 是否正在加载 */
|
|
1086
|
-
loading?: boolean;
|
|
1087
|
-
}
|
|
1088
1169
|
/**
|
|
1089
|
-
*
|
|
1170
|
+
* Calendar 模块 - 主入口文件
|
|
1090
1171
|
*
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
*/
|
|
1100
|
-
declare function EventList({ events, config, onConfigChange, onEventClick, onEventEdit, onEventDelete, onBatchDelete, enableBatchActions, loading, className }: EventListProps): React__default.JSX.Element;
|
|
1101
|
-
|
|
1102
|
-
interface EventModalProps {
|
|
1103
|
-
isOpen: boolean;
|
|
1104
|
-
onClose: () => void;
|
|
1105
|
-
onSave: (eventData: CreateEventRequest | UpdateEventRequest) => Promise<void>;
|
|
1106
|
-
onDelete?: (eventId: number) => Promise<void>;
|
|
1107
|
-
event?: CalendarEvent | null;
|
|
1108
|
-
initialDate?: Date;
|
|
1109
|
-
}
|
|
1110
|
-
declare const EventModal: React__default.FC<EventModalProps>;
|
|
1111
|
-
|
|
1112
|
-
declare const COLOR_THEMES: {
|
|
1113
|
-
default: {
|
|
1114
|
-
name: string;
|
|
1115
|
-
colors: {
|
|
1116
|
-
primary: string;
|
|
1117
|
-
secondary: string;
|
|
1118
|
-
accent: string;
|
|
1119
|
-
danger: string;
|
|
1120
|
-
purple: string;
|
|
1121
|
-
pink: string;
|
|
1122
|
-
indigo: string;
|
|
1123
|
-
teal: string;
|
|
1124
|
-
};
|
|
1125
|
-
background: {
|
|
1126
|
-
calendar: string;
|
|
1127
|
-
cell: string;
|
|
1128
|
-
today: string;
|
|
1129
|
-
weekend: string;
|
|
1130
|
-
otherMonth: string;
|
|
1131
|
-
};
|
|
1132
|
-
border: {
|
|
1133
|
-
calendar: string;
|
|
1134
|
-
cell: string;
|
|
1135
|
-
today: string;
|
|
1136
|
-
};
|
|
1137
|
-
text: {
|
|
1138
|
-
primary: string;
|
|
1139
|
-
secondary: string;
|
|
1140
|
-
today: string;
|
|
1141
|
-
weekend: string;
|
|
1142
|
-
otherMonth: string;
|
|
1143
|
-
};
|
|
1144
|
-
};
|
|
1145
|
-
dark: {
|
|
1146
|
-
name: string;
|
|
1147
|
-
colors: {
|
|
1148
|
-
primary: string;
|
|
1149
|
-
secondary: string;
|
|
1150
|
-
accent: string;
|
|
1151
|
-
danger: string;
|
|
1152
|
-
purple: string;
|
|
1153
|
-
pink: string;
|
|
1154
|
-
indigo: string;
|
|
1155
|
-
teal: string;
|
|
1156
|
-
};
|
|
1157
|
-
background: {
|
|
1158
|
-
calendar: string;
|
|
1159
|
-
cell: string;
|
|
1160
|
-
today: string;
|
|
1161
|
-
weekend: string;
|
|
1162
|
-
otherMonth: string;
|
|
1163
|
-
};
|
|
1164
|
-
border: {
|
|
1165
|
-
calendar: string;
|
|
1166
|
-
cell: string;
|
|
1167
|
-
today: string;
|
|
1168
|
-
};
|
|
1169
|
-
text: {
|
|
1170
|
-
primary: string;
|
|
1171
|
-
secondary: string;
|
|
1172
|
-
today: string;
|
|
1173
|
-
weekend: string;
|
|
1174
|
-
otherMonth: string;
|
|
1175
|
-
};
|
|
1176
|
-
};
|
|
1177
|
-
colorful: {
|
|
1178
|
-
name: string;
|
|
1179
|
-
colors: {
|
|
1180
|
-
primary: string;
|
|
1181
|
-
secondary: string;
|
|
1182
|
-
accent: string;
|
|
1183
|
-
danger: string;
|
|
1184
|
-
purple: string;
|
|
1185
|
-
pink: string;
|
|
1186
|
-
indigo: string;
|
|
1187
|
-
teal: string;
|
|
1188
|
-
};
|
|
1189
|
-
background: {
|
|
1190
|
-
calendar: string;
|
|
1191
|
-
cell: string;
|
|
1192
|
-
today: string;
|
|
1193
|
-
weekend: string;
|
|
1194
|
-
otherMonth: string;
|
|
1195
|
-
};
|
|
1196
|
-
border: {
|
|
1197
|
-
calendar: string;
|
|
1198
|
-
cell: string;
|
|
1199
|
-
today: string;
|
|
1200
|
-
};
|
|
1201
|
-
text: {
|
|
1202
|
-
primary: string;
|
|
1203
|
-
secondary: string;
|
|
1204
|
-
today: string;
|
|
1205
|
-
weekend: string;
|
|
1206
|
-
otherMonth: string;
|
|
1207
|
-
};
|
|
1208
|
-
};
|
|
1209
|
-
};
|
|
1210
|
-
interface CalendarSettingsProps {
|
|
1211
|
-
onSettingsChange?: (settings: CalendarSettingsData) => void;
|
|
1212
|
-
}
|
|
1213
|
-
interface CalendarSettingsData {
|
|
1214
|
-
theme: keyof typeof COLOR_THEMES;
|
|
1215
|
-
customColors?: {
|
|
1216
|
-
[key: string]: string;
|
|
1217
|
-
};
|
|
1218
|
-
weekStartsOn: number;
|
|
1219
|
-
timeFormat: '12h' | '24h';
|
|
1220
|
-
language: string;
|
|
1221
|
-
showWeekNumbers: boolean;
|
|
1222
|
-
showLunarCalendar: boolean;
|
|
1223
|
-
defaultEventDuration: number;
|
|
1224
|
-
workingHours: {
|
|
1225
|
-
start: string;
|
|
1226
|
-
end: string;
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
declare function CalendarSettings({ onSettingsChange }: CalendarSettingsProps): React__default.JSX.Element;
|
|
1230
|
-
|
|
1231
|
-
interface ImprovedEventModalProps {
|
|
1232
|
-
isOpen: boolean;
|
|
1233
|
-
onClose: () => void;
|
|
1234
|
-
onSave: (eventData: EventData) => Promise<void>;
|
|
1235
|
-
onDelete?: (eventId: number) => Promise<void>;
|
|
1236
|
-
event?: CalendarEvent | null;
|
|
1237
|
-
initialDate?: Date;
|
|
1238
|
-
}
|
|
1239
|
-
declare const ImprovedEventModal: React__default.FC<ImprovedEventModalProps>;
|
|
1240
|
-
|
|
1241
|
-
interface EventSearchProps {
|
|
1242
|
-
events: CalendarEvent[];
|
|
1243
|
-
onFiltered: (filteredEvents: CalendarEvent[]) => void;
|
|
1244
|
-
className?: string;
|
|
1245
|
-
}
|
|
1246
|
-
declare const EventSearch: React__default.FC<EventSearchProps>;
|
|
1247
|
-
|
|
1248
|
-
interface DraggableMonthViewProps {
|
|
1249
|
-
events: CalendarEvent[];
|
|
1250
|
-
currentDate: Date;
|
|
1251
|
-
onDateChange: (date: Date) => void;
|
|
1252
|
-
onEventClick?: (event: CalendarEvent) => void;
|
|
1253
|
-
onDateClick?: (date: Date) => void;
|
|
1254
|
-
onEventUpdate: (eventId: number, newStartTime: Date, newEndTime: Date) => Promise<void>;
|
|
1255
|
-
className?: string;
|
|
1256
|
-
}
|
|
1257
|
-
/**
|
|
1258
|
-
* 支持拖拽的月视图组件
|
|
1172
|
+
* 这是一个完整的日历应用模块,提供了从前端组件到后端API的完整解决方案。
|
|
1173
|
+
* 主要功能包括:
|
|
1174
|
+
* - 日历视图(月视图、周视图、日视图)
|
|
1175
|
+
* - 事件管理(创建、编辑、删除)
|
|
1176
|
+
* - 重复事件支持
|
|
1177
|
+
* - 提醒功能
|
|
1178
|
+
* - 用户配置管理
|
|
1179
|
+
* - 事件分享功能
|
|
1259
1180
|
*
|
|
1260
|
-
*
|
|
1261
|
-
* -
|
|
1262
|
-
* -
|
|
1263
|
-
* -
|
|
1264
|
-
* -
|
|
1265
|
-
* - 月份导航
|
|
1266
|
-
* - 响应式设计
|
|
1267
|
-
*/
|
|
1268
|
-
declare const DraggableMonthView: React__default.FC<DraggableMonthViewProps>;
|
|
1269
|
-
|
|
1270
|
-
interface DraggableEventProps {
|
|
1271
|
-
event: CalendarEvent;
|
|
1272
|
-
isDragging?: boolean;
|
|
1273
|
-
className?: string;
|
|
1274
|
-
onClick?: () => void;
|
|
1275
|
-
children?: React__default.ReactNode;
|
|
1276
|
-
}
|
|
1277
|
-
/**
|
|
1278
|
-
* 可拖拽的事件组件
|
|
1181
|
+
* 架构特点:
|
|
1182
|
+
* - 前后端分离,支持服务端渲染
|
|
1183
|
+
* - 模块化设计,便于维护和扩展
|
|
1184
|
+
* - TypeScript严格类型检查
|
|
1185
|
+
* - TailwindCSS响应式设计
|
|
1279
1186
|
*
|
|
1280
|
-
*
|
|
1281
|
-
* -
|
|
1282
|
-
* - 移动端禁用拖拽功能
|
|
1283
|
-
* - 拖拽时显示半透明效果
|
|
1284
|
-
* - 保持原有的点击功能
|
|
1285
|
-
* - 响应式设计
|
|
1187
|
+
* @version 1.0.0
|
|
1188
|
+
* @author Profile-v1 Team
|
|
1286
1189
|
*/
|
|
1287
|
-
|
|
1190
|
+
/** 基础数据类型 */
|
|
1288
1191
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
isSelected?: boolean;
|
|
1294
|
-
dragOverPreview?: string | null;
|
|
1295
|
-
onEventClick?: (event: CalendarEvent) => void;
|
|
1296
|
-
onDateClick?: (date: Date) => void;
|
|
1297
|
-
className?: string;
|
|
1298
|
-
disableDrop?: boolean;
|
|
1299
|
-
}
|
|
1300
|
-
/**
|
|
1301
|
-
* 可放置的日历单元格组件
|
|
1302
|
-
*
|
|
1303
|
-
* 功能特性:
|
|
1304
|
-
* - 支持拖拽事件到此日期
|
|
1305
|
-
* - 显示当前日期的所有事件
|
|
1306
|
-
* - 拖拽悬停时显示预览
|
|
1307
|
-
* - 响应式设计
|
|
1308
|
-
*/
|
|
1309
|
-
declare const DroppableCalendarCell: React__default.FC<DroppableCalendarCellProps>;
|
|
1192
|
+
/** 模块版本号 */
|
|
1193
|
+
declare const CALENDAR_MODULE_VERSION = "1.0.0";
|
|
1194
|
+
/** 模块名称标识 */
|
|
1195
|
+
declare const CALENDAR_MODULE_NAME = "sa2kit/calendar";
|
|
1310
1196
|
|
|
1311
|
-
export { type ApiResponse, type
|
|
1197
|
+
export { type ApiResponse, type BaseEventData, CALENDAR_MODULE_NAME, CALENDAR_MODULE_VERSION, type CalendarActions, type CalendarCell, type CalendarConfig, type CalendarEvent, CalendarExportService, CalendarImportService, CalendarPage, type CalendarState, type CalendarViewProps, CalendarViewType, type CreateEventRequest, type DateRange, type DeleteEventRequest, type DragState, DraggableEvent, DraggableMonthView, DroppableCalendarCell, type EventCardProps, EventColor, type EventData, EventDetailPage, EventForm, type EventFormData, type EventFormProps$1 as EventFormProps, EventList, type EventListConfig, EventListDisplayMode, type EventListFilter, type EventListProps, type EventListSort, EventModal, type EventModalProps$1 as EventModalProps, EventPriority, type EventResponse, EventSearch, EventSortField, EventType, EventTypeService, type EventsResponse, type ExportOptions, type GeneratedEvent, type GetEventsRequest, type CalendarDbService as ICalendarDbService, type CalendarService as ICalendarService, type ImportOptions, type ImportResult, type MiniCalendarProps, type MultiDayEventData, type RecurrenceFormData, RecurrencePattern, type RecurrenceRule$1 as RecurrenceRule, type RecurrenceRule as RecurrenceRuleType, RecurrenceService, RecurrenceType, type RecurringEventData, type RecurringEventInstance, type Reminder, type ReminderConfig, type ReminderFormData, ReminderService, ReminderStatus, ReminderType, type ScheduledReminder, type SingleEventData, SortDirection, type TimeSlot, type UpdateEventRequest, type UseCalendarReturn, type UseEnhancedEventsReturn, type UseEventDragReturn, type UseEventsReturn$1 as UseEventsReturn, addDays, addMonths, addWeeks, addYears, cloneDate, formatDate, formatDateTime, formatTime, generateTimeSlots, getDayEnd, getDayStart, getDaysDifference, getMonthEnd, getMonthName, getMonthStart, getMonthViewDates, getRelativeTime, getWeekEnd, getWeekStart, getWeekViewDates, getWeekdayName, isSameDay, isSameMonth, isSameWeek, isToday, isValidDate, isWeekend, isWorkingHour, parseDate, toLocalISOString, useEnhancedEvents, useEventDrag, useEvents };
|