UNPKG

6.41 kBTypeScriptView Raw
1
2import * as _fullcalendar_common from '@fullcalendar/common';
3import { Splitter, DateSpan, EventDef, DateMarker, Duration, DateEnv, PositionCache, DateProfile, DateComponent, ViewProps, RefObject, VNode, ChunkContentCallbackArgs, createElement, CssDimValue, DateProfileGenerator, DayTableModel, Seg, DateRange, EventStore, EventUiHash, EventInteractionState, Slicer, ScrollRequest, Hit, DayTableCell, EventSegUiInteractionState } from '@fullcalendar/common';
4
5declare class AllDaySplitter extends Splitter {
6 getKeyInfo(): {
7 allDay: {};
8 timed: {};
9 };
10 getKeysForDateSpan(dateSpan: DateSpan): string[];
11 getKeysForEventDef(eventDef: EventDef): string[];
12}
13
14interface TimeSlatMeta {
15 date: DateMarker;
16 time: Duration;
17 key: string;
18 isoTimeStr: string;
19 isLabeled: boolean;
20}
21declare function buildSlatMetas(slotMinTime: Duration, slotMaxTime: Duration, explicitLabelInterval: Duration | null, slotDuration: Duration, dateEnv: DateEnv): TimeSlatMeta[];
22
23declare class TimeColsSlatsCoords {
24 positions: PositionCache;
25 private dateProfile;
26 private slotDuration;
27 constructor(positions: PositionCache, dateProfile: DateProfile, slotDuration: Duration);
28 safeComputeTop(date: DateMarker): number;
29 computeDateTop(when: DateMarker, startOfDayDate?: DateMarker): number;
30 computeTimeTop(duration: Duration): number;
31}
32
33interface TimeColsViewState {
34 slatCoords: TimeColsSlatsCoords | null;
35}
36declare abstract class TimeColsView extends DateComponent<ViewProps, TimeColsViewState> {
37 protected allDaySplitter: AllDaySplitter;
38 protected headerElRef: RefObject<HTMLTableCellElement>;
39 private rootElRef;
40 private scrollerElRef;
41 state: {
42 slatCoords: any;
43 };
44 renderSimpleLayout(headerRowContent: VNode | null, allDayContent: ((contentArg: ChunkContentCallbackArgs) => VNode) | null, timeContent: ((contentArg: ChunkContentCallbackArgs) => VNode) | null): createElement.JSX.Element;
45 renderHScrollLayout(headerRowContent: VNode | null, allDayContent: ((contentArg: ChunkContentCallbackArgs) => VNode) | null, timeContent: ((contentArg: ChunkContentCallbackArgs) => VNode) | null, colCnt: number, dayMinWidth: number, slatMetas: TimeSlatMeta[], slatCoords: TimeColsSlatsCoords | null): createElement.JSX.Element;
46 handleScrollTopRequest: (scrollTop: number) => void;
47 getAllDayMaxEventProps(): {
48 dayMaxEvents: number | boolean;
49 dayMaxEventRows: number | false;
50 };
51 renderHeadAxis: (rowKey: 'day' | string, frameHeight?: CssDimValue) => createElement.JSX.Element;
52 renderTableRowAxis: (rowHeight?: number) => createElement.JSX.Element;
53 handleSlatCoords: (slatCoords: TimeColsSlatsCoords) => void;
54}
55
56declare class DayTimeColsView extends TimeColsView {
57 private buildTimeColsModel;
58 private buildSlatMetas;
59 render(): createElement.JSX.Element;
60}
61declare function buildTimeColsModel(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): DayTableModel;
62
63interface TimeColsSeg extends Seg {
64 col: number;
65 start: DateMarker;
66 end: DateMarker;
67}
68
69interface DayTimeColsProps {
70 dateProfile: DateProfile;
71 dayTableModel: DayTableModel;
72 axis: boolean;
73 slotDuration: Duration;
74 slatMetas: TimeSlatMeta[];
75 businessHours: EventStore;
76 eventStore: EventStore;
77 eventUiBases: EventUiHash;
78 dateSelection: DateSpan | null;
79 eventSelection: string;
80 eventDrag: EventInteractionState | null;
81 eventResize: EventInteractionState | null;
82 tableColGroupNode: VNode;
83 tableMinWidth: CssDimValue;
84 clientWidth: number | null;
85 clientHeight: number | null;
86 expandRows: boolean;
87 onScrollTopRequest?: (scrollTop: number) => void;
88 forPrint: boolean;
89 onSlatCoords?: (slatCoords: TimeColsSlatsCoords) => void;
90}
91declare class DayTimeCols extends DateComponent<DayTimeColsProps> {
92 private buildDayRanges;
93 private slicer;
94 private timeColsRef;
95 render(): createElement.JSX.Element;
96}
97declare function buildDayRanges(dayTableModel: DayTableModel, dateProfile: DateProfile, dateEnv: DateEnv): DateRange[];
98
99declare class DayTimeColsSlicer extends Slicer<TimeColsSeg, [DateRange[]]> {
100 sliceRange(range: DateRange, dayRanges: DateRange[]): TimeColsSeg[];
101}
102
103declare const OPTION_REFINERS: {
104 allDaySlot: BooleanConstructor;
105};
106
107declare type ExtraOptionRefiners = typeof OPTION_REFINERS;
108declare module '@fullcalendar/common' {
109 interface BaseOptionRefiners extends ExtraOptionRefiners {
110 }
111}
112
113
114interface TimeColsProps {
115 cells: DayTableCell[];
116 dateProfile: DateProfile;
117 slotDuration: Duration;
118 nowDate: DateMarker;
119 todayRange: DateRange;
120 businessHourSegs: TimeColsSeg[];
121 bgEventSegs: TimeColsSeg[];
122 fgEventSegs: TimeColsSeg[];
123 dateSelectionSegs: TimeColsSeg[];
124 eventSelection: string;
125 eventDrag: EventSegUiInteractionState | null;
126 eventResize: EventSegUiInteractionState | null;
127 tableColGroupNode: VNode;
128 tableMinWidth: CssDimValue;
129 clientWidth: number | null;
130 clientHeight: number | null;
131 expandRows: boolean;
132 nowIndicatorSegs: TimeColsSeg[];
133 onScrollTopRequest?: (scrollTop: number) => void;
134 forPrint: boolean;
135 axis: boolean;
136 slatMetas: TimeSlatMeta[];
137 onSlatCoords?: (slatCoords: TimeColsSlatsCoords) => void;
138 isHitComboAllowed?: (hit0: Hit, hit1: Hit) => boolean;
139}
140interface TimeColsState {
141 slatCoords: TimeColsSlatsCoords | null;
142}
143declare class TimeCols extends DateComponent<TimeColsProps, TimeColsState> {
144 private processSlotOptions;
145 private scrollResponder;
146 private colCoords;
147 state: {
148 slatCoords: any;
149 };
150 render(): createElement.JSX.Element;
151 handleRootEl: (el: HTMLElement | null) => void;
152 componentDidMount(): void;
153 componentDidUpdate(prevProps: TimeColsProps): void;
154 componentWillUnmount(): void;
155 handleScrollRequest: (request: ScrollRequest) => boolean;
156 handleColCoords: (colCoords: PositionCache | null) => void;
157 handleSlatCoords: (slatCoords: TimeColsSlatsCoords | null) => void;
158 queryHit(positionLeft: number, positionTop: number): Hit;
159}
160
161declare const _default: _fullcalendar_common.PluginDef;
162
163
164export default _default;
165export { DayTimeCols, DayTimeColsSlicer, DayTimeColsView, TimeCols, TimeColsSeg, TimeColsSlatsCoords, TimeColsView, TimeSlatMeta, buildDayRanges, buildSlatMetas, buildTimeColsModel };