@mantine-vue/schedule 2.1.0 → 2.2.1
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/cjs/index.cjs +2228 -1
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +2220 -3
- package/esm/index.mjs.map +1 -1
- package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +346 -0
- package/lib/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.d.ts +2 -0
- package/lib/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.d.ts +15 -0
- package/lib/components/ResourcesDayView/index.d.ts +3 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +279 -0
- package/lib/components/ResourcesMonthView/index.d.ts +1 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +201 -0
- package/lib/components/ResourcesSchedule/index.d.ts +1 -0
- package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +412 -0
- package/lib/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.d.ts +21 -0
- package/lib/components/ResourcesWeekView/index.d.ts +2 -0
- package/lib/hooks/use-horizontal-event-resize.d.ts +200 -0
- package/lib/index.d.mts +4 -0
- package/lib/index.d.ts +4 -0
- package/lib/labels.d.ts +3 -0
- package/lib/types.d.ts +15 -0
- package/lib/utils/get-group-to-resource-id-map/get-group-to-resource-id-map.d.ts +2 -0
- package/lib/utils/get-ordered-resources/get-ordered-resources.d.ts +17 -0
- package/lib/utils/handle-resources-grid-key-down/handle-resources-grid-key-down.d.ts +8 -0
- package/lib/utils/index.d.ts +5 -0
- package/package.json +4 -4
- package/styles.css +933 -0
- package/styles.layer.css +933 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { type CSSProperties, type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
|
+
import type { EventDropData, NativeButtonProps, RenderEvent, RenderEventBody, ViewSelectProps } from '../../component-props';
|
|
3
|
+
import { type ScheduleLabelsOverride } from '../../labels';
|
|
4
|
+
import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
5
|
+
import classes from './ResourcesDayView.module.css';
|
|
6
|
+
export interface ResourceViewDropData extends EventDropData {
|
|
7
|
+
resourceId?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export interface ResourcesDayViewProps {
|
|
10
|
+
date: Date | string;
|
|
11
|
+
onDateChange?: (value: DateStringValue) => void;
|
|
12
|
+
resources: ScheduleResourceData[];
|
|
13
|
+
startTime?: string;
|
|
14
|
+
endTime?: string;
|
|
15
|
+
intervalMinutes?: number;
|
|
16
|
+
slotLabelFormat?: DateLabelFormat;
|
|
17
|
+
radius?: string | number;
|
|
18
|
+
startScrollTime?: string;
|
|
19
|
+
scrollAreaProps?: Record<string, unknown>;
|
|
20
|
+
locale?: string;
|
|
21
|
+
withCurrentTimeIndicator?: boolean;
|
|
22
|
+
withCurrentTimeBubble?: boolean;
|
|
23
|
+
getCurrentTime?: () => AnyDateValue;
|
|
24
|
+
withHeader?: boolean;
|
|
25
|
+
onViewChange?: (view: ScheduleViewLevel) => void;
|
|
26
|
+
previousControlProps?: NativeButtonProps;
|
|
27
|
+
nextControlProps?: NativeButtonProps;
|
|
28
|
+
todayControlProps?: NativeButtonProps;
|
|
29
|
+
viewSelectProps?: Partial<ViewSelectProps>;
|
|
30
|
+
headerFormat?: DateLabelFormat;
|
|
31
|
+
events?: ScheduleEventData[];
|
|
32
|
+
slotWidth?: CSSProperties['width'];
|
|
33
|
+
rowHeight?: CSSProperties['height'];
|
|
34
|
+
labels?: ScheduleLabelsOverride;
|
|
35
|
+
highlightBusinessHours?: boolean;
|
|
36
|
+
businessHours?: [string, string];
|
|
37
|
+
renderEventBody?: RenderEventBody;
|
|
38
|
+
renderEvent?: RenderEvent;
|
|
39
|
+
renderResourceLabel?: (resource: ScheduleResourceData) => VNodeChild;
|
|
40
|
+
groups?: ScheduleResourceGroup[];
|
|
41
|
+
renderGroupLabel?: (group: ScheduleResourceGroup) => VNodeChild;
|
|
42
|
+
groupLabelWidth?: CSSProperties['width'];
|
|
43
|
+
withEventsDragAndDrop?: boolean;
|
|
44
|
+
onEventDrop?: (data: ResourceViewDropData) => void;
|
|
45
|
+
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
46
|
+
onEventDragStart?: (event: ScheduleEventData) => void;
|
|
47
|
+
onEventDragEnd?: () => void;
|
|
48
|
+
onTimeSlotClick?: (data: {
|
|
49
|
+
slotStart: DateTimeStringValue;
|
|
50
|
+
slotEnd: DateTimeStringValue;
|
|
51
|
+
nativeEvent: MouseEvent;
|
|
52
|
+
resourceId?: string | number;
|
|
53
|
+
}) => void;
|
|
54
|
+
onEventClick?: (event: ScheduleEventData, nativeEvent: MouseEvent) => void;
|
|
55
|
+
withDragSlotSelect?: boolean;
|
|
56
|
+
onSlotDragEnd?: (data: {
|
|
57
|
+
rangeStart: DateTimeStringValue;
|
|
58
|
+
rangeEnd: DateTimeStringValue;
|
|
59
|
+
resourceId?: string | number;
|
|
60
|
+
}) => void;
|
|
61
|
+
mode?: ScheduleMode;
|
|
62
|
+
onExternalEventDrop?: (data: {
|
|
63
|
+
dataTransfer: DataTransfer;
|
|
64
|
+
dropDateTime: DateTimeStringValue;
|
|
65
|
+
resourceId?: string | number;
|
|
66
|
+
}) => void;
|
|
67
|
+
withEventResize?: boolean;
|
|
68
|
+
onEventResize?: (data: EventDropData) => void;
|
|
69
|
+
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
70
|
+
recurrenceExpansionLimit?: number;
|
|
71
|
+
maxEventsPerTimeSlot?: number;
|
|
72
|
+
moreEventsProps?: Record<string, unknown>;
|
|
73
|
+
}
|
|
74
|
+
export interface ResourcesDayViewSlots {
|
|
75
|
+
header?: (props: {
|
|
76
|
+
date: DateStringValue;
|
|
77
|
+
label: VNodeChild;
|
|
78
|
+
}) => VNodeChild;
|
|
79
|
+
corner?: (props: {
|
|
80
|
+
resources: ScheduleResourceData[];
|
|
81
|
+
}) => VNodeChild;
|
|
82
|
+
timeLabel?: (props: {
|
|
83
|
+
label: VNodeChild;
|
|
84
|
+
startTime: string;
|
|
85
|
+
endTime: string;
|
|
86
|
+
}) => VNodeChild;
|
|
87
|
+
resourceLabel?: (props: {
|
|
88
|
+
resource: ScheduleResourceData;
|
|
89
|
+
}) => VNodeChild;
|
|
90
|
+
groupLabel?: (props: {
|
|
91
|
+
group: ScheduleResourceGroup;
|
|
92
|
+
}) => VNodeChild;
|
|
93
|
+
timeSlot?: (props: {
|
|
94
|
+
resource: ScheduleResourceData;
|
|
95
|
+
startTime: string;
|
|
96
|
+
endTime: string;
|
|
97
|
+
}) => VNodeChild;
|
|
98
|
+
backgroundEvent?: (props: {
|
|
99
|
+
event: ScheduleEventData;
|
|
100
|
+
}) => VNodeChild;
|
|
101
|
+
allDayEvent?: (props: {
|
|
102
|
+
event: ScheduleEventData;
|
|
103
|
+
}) => VNodeChild;
|
|
104
|
+
eventBody?: (props: {
|
|
105
|
+
event: ScheduleEventData;
|
|
106
|
+
}) => VNodeChild;
|
|
107
|
+
event?: (props: Record<string, unknown> & {
|
|
108
|
+
event: ScheduleEventData;
|
|
109
|
+
}) => VNodeChild;
|
|
110
|
+
moreEvents?: (props: {
|
|
111
|
+
events: ScheduleEventData[];
|
|
112
|
+
hiddenCount: number;
|
|
113
|
+
}) => VNodeChild;
|
|
114
|
+
currentTimeIndicator?: (props: {
|
|
115
|
+
time: VNodeChild;
|
|
116
|
+
offset: number;
|
|
117
|
+
}) => VNodeChild;
|
|
118
|
+
}
|
|
119
|
+
export declare const ResourcesDayView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
120
|
+
date: {
|
|
121
|
+
type: PropType<Date | string>;
|
|
122
|
+
required: true;
|
|
123
|
+
};
|
|
124
|
+
onDateChange: PropType<ResourcesDayViewProps["onDateChange"]>;
|
|
125
|
+
resources: {
|
|
126
|
+
type: PropType<ScheduleResourceData[]>;
|
|
127
|
+
required: true;
|
|
128
|
+
};
|
|
129
|
+
startTime: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
endTime: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
intervalMinutes: {
|
|
138
|
+
type: NumberConstructor;
|
|
139
|
+
default: number;
|
|
140
|
+
};
|
|
141
|
+
slotLabelFormat: {
|
|
142
|
+
type: PropType<DateLabelFormat>;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
145
|
+
radius: PropType<string | number>;
|
|
146
|
+
startScrollTime: StringConstructor;
|
|
147
|
+
scrollAreaProps: PropType<Record<string, unknown>>;
|
|
148
|
+
locale: StringConstructor;
|
|
149
|
+
withCurrentTimeIndicator: {
|
|
150
|
+
type: BooleanConstructor;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
153
|
+
withCurrentTimeBubble: {
|
|
154
|
+
type: BooleanConstructor;
|
|
155
|
+
default: boolean;
|
|
156
|
+
};
|
|
157
|
+
getCurrentTime: PropType<() => AnyDateValue>;
|
|
158
|
+
withHeader: {
|
|
159
|
+
type: BooleanConstructor;
|
|
160
|
+
default: boolean;
|
|
161
|
+
};
|
|
162
|
+
onViewChange: PropType<ResourcesDayViewProps["onViewChange"]>;
|
|
163
|
+
previousControlProps: PropType<NativeButtonProps>;
|
|
164
|
+
nextControlProps: PropType<NativeButtonProps>;
|
|
165
|
+
todayControlProps: PropType<NativeButtonProps>;
|
|
166
|
+
viewSelectProps: PropType<Partial<ViewSelectProps>>;
|
|
167
|
+
headerFormat: {
|
|
168
|
+
type: PropType<DateLabelFormat>;
|
|
169
|
+
default: string;
|
|
170
|
+
};
|
|
171
|
+
events: PropType<ScheduleEventData[]>;
|
|
172
|
+
slotWidth: {
|
|
173
|
+
type: PropType<CSSProperties["width"]>;
|
|
174
|
+
default: number;
|
|
175
|
+
};
|
|
176
|
+
rowHeight: {
|
|
177
|
+
type: PropType<CSSProperties["height"]>;
|
|
178
|
+
default: number;
|
|
179
|
+
};
|
|
180
|
+
labels: PropType<ScheduleLabelsOverride>;
|
|
181
|
+
highlightBusinessHours: BooleanConstructor;
|
|
182
|
+
businessHours: {
|
|
183
|
+
type: PropType<[string, string]>;
|
|
184
|
+
default: () => string[];
|
|
185
|
+
};
|
|
186
|
+
renderEventBody: PropType<RenderEventBody>;
|
|
187
|
+
renderEvent: PropType<RenderEvent>;
|
|
188
|
+
renderResourceLabel: PropType<ResourcesDayViewProps["renderResourceLabel"]>;
|
|
189
|
+
groups: PropType<ScheduleResourceGroup[]>;
|
|
190
|
+
renderGroupLabel: PropType<ResourcesDayViewProps["renderGroupLabel"]>;
|
|
191
|
+
groupLabelWidth: {
|
|
192
|
+
type: PropType<CSSProperties["width"]>;
|
|
193
|
+
default: number;
|
|
194
|
+
};
|
|
195
|
+
withEventsDragAndDrop: BooleanConstructor;
|
|
196
|
+
onEventDrop: PropType<ResourcesDayViewProps["onEventDrop"]>;
|
|
197
|
+
canDragEvent: PropType<ResourcesDayViewProps["canDragEvent"]>;
|
|
198
|
+
onEventDragStart: PropType<ResourcesDayViewProps["onEventDragStart"]>;
|
|
199
|
+
onEventDragEnd: PropType<ResourcesDayViewProps["onEventDragEnd"]>;
|
|
200
|
+
onTimeSlotClick: PropType<ResourcesDayViewProps["onTimeSlotClick"]>;
|
|
201
|
+
onEventClick: PropType<ResourcesDayViewProps["onEventClick"]>;
|
|
202
|
+
withDragSlotSelect: BooleanConstructor;
|
|
203
|
+
onSlotDragEnd: PropType<ResourcesDayViewProps["onSlotDragEnd"]>;
|
|
204
|
+
mode: {
|
|
205
|
+
type: PropType<ScheduleMode>;
|
|
206
|
+
default: string;
|
|
207
|
+
};
|
|
208
|
+
onExternalEventDrop: PropType<ResourcesDayViewProps["onExternalEventDrop"]>;
|
|
209
|
+
withEventResize: BooleanConstructor;
|
|
210
|
+
onEventResize: PropType<ResourcesDayViewProps["onEventResize"]>;
|
|
211
|
+
canResizeEvent: PropType<ResourcesDayViewProps["canResizeEvent"]>;
|
|
212
|
+
recurrenceExpansionLimit: {
|
|
213
|
+
type: NumberConstructor;
|
|
214
|
+
default: number;
|
|
215
|
+
};
|
|
216
|
+
maxEventsPerTimeSlot: {
|
|
217
|
+
type: NumberConstructor;
|
|
218
|
+
default: number;
|
|
219
|
+
};
|
|
220
|
+
moreEventsProps: PropType<Record<string, unknown>>;
|
|
221
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
222
|
+
[key: string]: any;
|
|
223
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
224
|
+
date: {
|
|
225
|
+
type: PropType<Date | string>;
|
|
226
|
+
required: true;
|
|
227
|
+
};
|
|
228
|
+
onDateChange: PropType<ResourcesDayViewProps["onDateChange"]>;
|
|
229
|
+
resources: {
|
|
230
|
+
type: PropType<ScheduleResourceData[]>;
|
|
231
|
+
required: true;
|
|
232
|
+
};
|
|
233
|
+
startTime: {
|
|
234
|
+
type: StringConstructor;
|
|
235
|
+
default: string;
|
|
236
|
+
};
|
|
237
|
+
endTime: {
|
|
238
|
+
type: StringConstructor;
|
|
239
|
+
default: string;
|
|
240
|
+
};
|
|
241
|
+
intervalMinutes: {
|
|
242
|
+
type: NumberConstructor;
|
|
243
|
+
default: number;
|
|
244
|
+
};
|
|
245
|
+
slotLabelFormat: {
|
|
246
|
+
type: PropType<DateLabelFormat>;
|
|
247
|
+
default: string;
|
|
248
|
+
};
|
|
249
|
+
radius: PropType<string | number>;
|
|
250
|
+
startScrollTime: StringConstructor;
|
|
251
|
+
scrollAreaProps: PropType<Record<string, unknown>>;
|
|
252
|
+
locale: StringConstructor;
|
|
253
|
+
withCurrentTimeIndicator: {
|
|
254
|
+
type: BooleanConstructor;
|
|
255
|
+
default: undefined;
|
|
256
|
+
};
|
|
257
|
+
withCurrentTimeBubble: {
|
|
258
|
+
type: BooleanConstructor;
|
|
259
|
+
default: boolean;
|
|
260
|
+
};
|
|
261
|
+
getCurrentTime: PropType<() => AnyDateValue>;
|
|
262
|
+
withHeader: {
|
|
263
|
+
type: BooleanConstructor;
|
|
264
|
+
default: boolean;
|
|
265
|
+
};
|
|
266
|
+
onViewChange: PropType<ResourcesDayViewProps["onViewChange"]>;
|
|
267
|
+
previousControlProps: PropType<NativeButtonProps>;
|
|
268
|
+
nextControlProps: PropType<NativeButtonProps>;
|
|
269
|
+
todayControlProps: PropType<NativeButtonProps>;
|
|
270
|
+
viewSelectProps: PropType<Partial<ViewSelectProps>>;
|
|
271
|
+
headerFormat: {
|
|
272
|
+
type: PropType<DateLabelFormat>;
|
|
273
|
+
default: string;
|
|
274
|
+
};
|
|
275
|
+
events: PropType<ScheduleEventData[]>;
|
|
276
|
+
slotWidth: {
|
|
277
|
+
type: PropType<CSSProperties["width"]>;
|
|
278
|
+
default: number;
|
|
279
|
+
};
|
|
280
|
+
rowHeight: {
|
|
281
|
+
type: PropType<CSSProperties["height"]>;
|
|
282
|
+
default: number;
|
|
283
|
+
};
|
|
284
|
+
labels: PropType<ScheduleLabelsOverride>;
|
|
285
|
+
highlightBusinessHours: BooleanConstructor;
|
|
286
|
+
businessHours: {
|
|
287
|
+
type: PropType<[string, string]>;
|
|
288
|
+
default: () => string[];
|
|
289
|
+
};
|
|
290
|
+
renderEventBody: PropType<RenderEventBody>;
|
|
291
|
+
renderEvent: PropType<RenderEvent>;
|
|
292
|
+
renderResourceLabel: PropType<ResourcesDayViewProps["renderResourceLabel"]>;
|
|
293
|
+
groups: PropType<ScheduleResourceGroup[]>;
|
|
294
|
+
renderGroupLabel: PropType<ResourcesDayViewProps["renderGroupLabel"]>;
|
|
295
|
+
groupLabelWidth: {
|
|
296
|
+
type: PropType<CSSProperties["width"]>;
|
|
297
|
+
default: number;
|
|
298
|
+
};
|
|
299
|
+
withEventsDragAndDrop: BooleanConstructor;
|
|
300
|
+
onEventDrop: PropType<ResourcesDayViewProps["onEventDrop"]>;
|
|
301
|
+
canDragEvent: PropType<ResourcesDayViewProps["canDragEvent"]>;
|
|
302
|
+
onEventDragStart: PropType<ResourcesDayViewProps["onEventDragStart"]>;
|
|
303
|
+
onEventDragEnd: PropType<ResourcesDayViewProps["onEventDragEnd"]>;
|
|
304
|
+
onTimeSlotClick: PropType<ResourcesDayViewProps["onTimeSlotClick"]>;
|
|
305
|
+
onEventClick: PropType<ResourcesDayViewProps["onEventClick"]>;
|
|
306
|
+
withDragSlotSelect: BooleanConstructor;
|
|
307
|
+
onSlotDragEnd: PropType<ResourcesDayViewProps["onSlotDragEnd"]>;
|
|
308
|
+
mode: {
|
|
309
|
+
type: PropType<ScheduleMode>;
|
|
310
|
+
default: string;
|
|
311
|
+
};
|
|
312
|
+
onExternalEventDrop: PropType<ResourcesDayViewProps["onExternalEventDrop"]>;
|
|
313
|
+
withEventResize: BooleanConstructor;
|
|
314
|
+
onEventResize: PropType<ResourcesDayViewProps["onEventResize"]>;
|
|
315
|
+
canResizeEvent: PropType<ResourcesDayViewProps["canResizeEvent"]>;
|
|
316
|
+
recurrenceExpansionLimit: {
|
|
317
|
+
type: NumberConstructor;
|
|
318
|
+
default: number;
|
|
319
|
+
};
|
|
320
|
+
maxEventsPerTimeSlot: {
|
|
321
|
+
type: NumberConstructor;
|
|
322
|
+
default: number;
|
|
323
|
+
};
|
|
324
|
+
moreEventsProps: PropType<Record<string, unknown>>;
|
|
325
|
+
}>> & Readonly<{}>, {
|
|
326
|
+
mode: ScheduleMode;
|
|
327
|
+
startTime: string;
|
|
328
|
+
endTime: string;
|
|
329
|
+
intervalMinutes: number;
|
|
330
|
+
businessHours: [string, string];
|
|
331
|
+
highlightBusinessHours: boolean;
|
|
332
|
+
withHeader: boolean;
|
|
333
|
+
recurrenceExpansionLimit: number;
|
|
334
|
+
withEventsDragAndDrop: boolean;
|
|
335
|
+
withDragSlotSelect: boolean;
|
|
336
|
+
withEventResize: boolean;
|
|
337
|
+
headerFormat: DateLabelFormat;
|
|
338
|
+
slotLabelFormat: DateLabelFormat;
|
|
339
|
+
withCurrentTimeIndicator: boolean;
|
|
340
|
+
withCurrentTimeBubble: boolean;
|
|
341
|
+
slotWidth: import("csstype").Property.Width<string | number> | undefined;
|
|
342
|
+
rowHeight: import("csstype").Property.Height<string | number> | undefined;
|
|
343
|
+
groupLabelWidth: import("csstype").Property.Width<string | number> | undefined;
|
|
344
|
+
maxEventsPerTimeSlot: number;
|
|
345
|
+
}, SlotsType<ResourcesDayViewSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
346
|
+
export type ResourcesDayViewStylesNames = keyof typeof classes;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnyDateValue, DayPositionedEventData, ScheduleEventData, ScheduleResourceData } from '../../../types';
|
|
2
|
+
export interface ResourcesDayViewEventsResult {
|
|
3
|
+
regularEvents: Record<string | number, DayPositionedEventData[]>;
|
|
4
|
+
allDayEvents: Record<string | number, DayPositionedEventData[]>;
|
|
5
|
+
backgroundTimedEvents: Record<string | number, DayPositionedEventData[]>;
|
|
6
|
+
backgroundAllDayEvents: Record<string | number, DayPositionedEventData[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare function getResourcesDayViewEvents({ events, resources, date, startTime, endTime, intervalMinutes, }: {
|
|
9
|
+
events: ScheduleEventData[] | undefined;
|
|
10
|
+
resources: ScheduleResourceData[];
|
|
11
|
+
date: AnyDateValue;
|
|
12
|
+
startTime?: string;
|
|
13
|
+
endTime?: string;
|
|
14
|
+
intervalMinutes?: number;
|
|
15
|
+
}): ResourcesDayViewEventsResult;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { type CSSProperties, type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
|
+
import type { MonthYearSelectProps, NativeButtonProps, RenderEvent, RenderEventBody, ViewSelectProps } from '../../component-props';
|
|
3
|
+
import { type ScheduleLabelsOverride } from '../../labels';
|
|
4
|
+
import type { DateLabelFormat, DateStringValue, DateTimeStringValue, DayOfWeek, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
5
|
+
import type { ResourceViewDropData } from '../ResourcesDayView/ResourcesDayView';
|
|
6
|
+
import classes from './ResourcesMonthView.module.css';
|
|
7
|
+
export interface ResourcesMonthViewProps {
|
|
8
|
+
date: Date | string;
|
|
9
|
+
onDateChange?: (value: DateStringValue) => void;
|
|
10
|
+
resources: ScheduleResourceData[];
|
|
11
|
+
locale?: string;
|
|
12
|
+
weekdayFormat?: DateLabelFormat;
|
|
13
|
+
weekendDays?: DayOfWeek[];
|
|
14
|
+
withWeekendDays?: boolean;
|
|
15
|
+
startScrollDate?: string;
|
|
16
|
+
onDayClick?: (data: {
|
|
17
|
+
date: DateStringValue;
|
|
18
|
+
nativeEvent: MouseEvent;
|
|
19
|
+
resourceId?: string | number;
|
|
20
|
+
}) => void;
|
|
21
|
+
highlightToday?: boolean;
|
|
22
|
+
radius?: string | number;
|
|
23
|
+
withHeader?: boolean;
|
|
24
|
+
monthYearSelectProps?: Partial<MonthYearSelectProps>;
|
|
25
|
+
onViewChange?: (view: ScheduleViewLevel) => void;
|
|
26
|
+
previousControlProps?: NativeButtonProps;
|
|
27
|
+
nextControlProps?: NativeButtonProps;
|
|
28
|
+
todayControlProps?: NativeButtonProps;
|
|
29
|
+
viewSelectProps?: Partial<ViewSelectProps>;
|
|
30
|
+
events?: ScheduleEventData[];
|
|
31
|
+
dayWidth?: CSSProperties['width'];
|
|
32
|
+
rowHeight?: CSSProperties['height'];
|
|
33
|
+
renderEventBody?: RenderEventBody;
|
|
34
|
+
renderEvent?: RenderEvent;
|
|
35
|
+
renderResourceLabel?: (resource: ScheduleResourceData) => VNodeChild;
|
|
36
|
+
groups?: ScheduleResourceGroup[];
|
|
37
|
+
renderGroupLabel?: (group: ScheduleResourceGroup) => VNodeChild;
|
|
38
|
+
groupLabelWidth?: CSSProperties['width'];
|
|
39
|
+
withEventsDragAndDrop?: boolean;
|
|
40
|
+
onEventDrop?: (data: ResourceViewDropData) => void;
|
|
41
|
+
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
42
|
+
onEventDragStart?: (event: ScheduleEventData) => void;
|
|
43
|
+
onEventDragEnd?: () => void;
|
|
44
|
+
onEventClick?: (event: ScheduleEventData, nativeEvent: MouseEvent) => void;
|
|
45
|
+
withDragSlotSelect?: boolean;
|
|
46
|
+
onSlotDragEnd?: (data: {
|
|
47
|
+
rangeStart: DateTimeStringValue;
|
|
48
|
+
rangeEnd: DateTimeStringValue;
|
|
49
|
+
resourceId?: string | number;
|
|
50
|
+
}) => void;
|
|
51
|
+
labels?: ScheduleLabelsOverride;
|
|
52
|
+
mode?: ScheduleMode;
|
|
53
|
+
scrollAreaProps?: Record<string, unknown>;
|
|
54
|
+
onExternalEventDrop?: (data: {
|
|
55
|
+
dataTransfer: DataTransfer;
|
|
56
|
+
dropDateTime: DateTimeStringValue;
|
|
57
|
+
resourceId?: string | number;
|
|
58
|
+
}) => void;
|
|
59
|
+
maxEventsPerTimeSlot?: number;
|
|
60
|
+
moreEventsProps?: Record<string, unknown>;
|
|
61
|
+
recurrenceExpansionLimit?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ResourcesMonthViewSlots {
|
|
64
|
+
header?: (props: {
|
|
65
|
+
month: DateStringValue;
|
|
66
|
+
}) => VNodeChild;
|
|
67
|
+
corner?: (props: {
|
|
68
|
+
resources: ScheduleResourceData[];
|
|
69
|
+
}) => VNodeChild;
|
|
70
|
+
dayLabel?: (props: {
|
|
71
|
+
date: DateStringValue;
|
|
72
|
+
weekday: VNodeChild;
|
|
73
|
+
day: number;
|
|
74
|
+
}) => VNodeChild;
|
|
75
|
+
resourceLabel?: (props: {
|
|
76
|
+
resource: ScheduleResourceData;
|
|
77
|
+
}) => VNodeChild;
|
|
78
|
+
groupLabel?: (props: {
|
|
79
|
+
group: ScheduleResourceGroup;
|
|
80
|
+
}) => VNodeChild;
|
|
81
|
+
dayCell?: (props: {
|
|
82
|
+
resource: ScheduleResourceData;
|
|
83
|
+
date: DateStringValue;
|
|
84
|
+
}) => VNodeChild;
|
|
85
|
+
eventBody?: (props: {
|
|
86
|
+
event: ScheduleEventData;
|
|
87
|
+
}) => VNodeChild;
|
|
88
|
+
event?: (props: Record<string, unknown> & {
|
|
89
|
+
event: ScheduleEventData;
|
|
90
|
+
}) => VNodeChild;
|
|
91
|
+
moreEvents?: (props: {
|
|
92
|
+
events: ScheduleEventData[];
|
|
93
|
+
hiddenCount: number;
|
|
94
|
+
resource: ScheduleResourceData;
|
|
95
|
+
date: DateStringValue;
|
|
96
|
+
}) => VNodeChild;
|
|
97
|
+
}
|
|
98
|
+
export declare const ResourcesMonthView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
99
|
+
date: {
|
|
100
|
+
type: PropType<Date | string>;
|
|
101
|
+
required: true;
|
|
102
|
+
};
|
|
103
|
+
onDateChange: PropType<ResourcesMonthViewProps["onDateChange"]>;
|
|
104
|
+
resources: {
|
|
105
|
+
type: PropType<ScheduleResourceData[]>;
|
|
106
|
+
required: true;
|
|
107
|
+
};
|
|
108
|
+
locale: StringConstructor;
|
|
109
|
+
weekdayFormat: {
|
|
110
|
+
type: PropType<DateLabelFormat>;
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
113
|
+
weekendDays: {
|
|
114
|
+
type: PropType<DayOfWeek[]>;
|
|
115
|
+
default: () => number[];
|
|
116
|
+
};
|
|
117
|
+
withWeekendDays: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: boolean;
|
|
120
|
+
};
|
|
121
|
+
startScrollDate: StringConstructor;
|
|
122
|
+
onDayClick: PropType<ResourcesMonthViewProps["onDayClick"]>;
|
|
123
|
+
highlightToday: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
default: boolean;
|
|
126
|
+
};
|
|
127
|
+
radius: PropType<string | number>;
|
|
128
|
+
withHeader: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: boolean;
|
|
131
|
+
};
|
|
132
|
+
monthYearSelectProps: PropType<Partial<MonthYearSelectProps>>;
|
|
133
|
+
onViewChange: PropType<ResourcesMonthViewProps["onViewChange"]>;
|
|
134
|
+
previousControlProps: PropType<NativeButtonProps>;
|
|
135
|
+
nextControlProps: PropType<NativeButtonProps>;
|
|
136
|
+
todayControlProps: PropType<NativeButtonProps>;
|
|
137
|
+
viewSelectProps: PropType<Partial<ViewSelectProps>>;
|
|
138
|
+
events: PropType<ScheduleEventData[]>;
|
|
139
|
+
dayWidth: {
|
|
140
|
+
type: PropType<CSSProperties["width"]>;
|
|
141
|
+
default: number;
|
|
142
|
+
};
|
|
143
|
+
rowHeight: {
|
|
144
|
+
type: PropType<CSSProperties["height"]>;
|
|
145
|
+
default: number;
|
|
146
|
+
};
|
|
147
|
+
renderEventBody: PropType<RenderEventBody>;
|
|
148
|
+
renderEvent: PropType<RenderEvent>;
|
|
149
|
+
renderResourceLabel: PropType<ResourcesMonthViewProps["renderResourceLabel"]>;
|
|
150
|
+
groups: PropType<ScheduleResourceGroup[]>;
|
|
151
|
+
renderGroupLabel: PropType<ResourcesMonthViewProps["renderGroupLabel"]>;
|
|
152
|
+
groupLabelWidth: {
|
|
153
|
+
type: PropType<CSSProperties["width"]>;
|
|
154
|
+
default: number;
|
|
155
|
+
};
|
|
156
|
+
withEventsDragAndDrop: BooleanConstructor;
|
|
157
|
+
onEventDrop: PropType<ResourcesMonthViewProps["onEventDrop"]>;
|
|
158
|
+
canDragEvent: PropType<ResourcesMonthViewProps["canDragEvent"]>;
|
|
159
|
+
onEventDragStart: PropType<ResourcesMonthViewProps["onEventDragStart"]>;
|
|
160
|
+
onEventDragEnd: PropType<ResourcesMonthViewProps["onEventDragEnd"]>;
|
|
161
|
+
onEventClick: PropType<ResourcesMonthViewProps["onEventClick"]>;
|
|
162
|
+
withDragSlotSelect: BooleanConstructor;
|
|
163
|
+
onSlotDragEnd: PropType<ResourcesMonthViewProps["onSlotDragEnd"]>;
|
|
164
|
+
labels: PropType<ScheduleLabelsOverride>;
|
|
165
|
+
mode: {
|
|
166
|
+
type: PropType<ScheduleMode>;
|
|
167
|
+
default: string;
|
|
168
|
+
};
|
|
169
|
+
scrollAreaProps: PropType<Record<string, unknown>>;
|
|
170
|
+
onExternalEventDrop: PropType<ResourcesMonthViewProps["onExternalEventDrop"]>;
|
|
171
|
+
maxEventsPerTimeSlot: {
|
|
172
|
+
type: NumberConstructor;
|
|
173
|
+
default: number;
|
|
174
|
+
};
|
|
175
|
+
moreEventsProps: PropType<Record<string, unknown>>;
|
|
176
|
+
recurrenceExpansionLimit: {
|
|
177
|
+
type: NumberConstructor;
|
|
178
|
+
default: number;
|
|
179
|
+
};
|
|
180
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
183
|
+
date: {
|
|
184
|
+
type: PropType<Date | string>;
|
|
185
|
+
required: true;
|
|
186
|
+
};
|
|
187
|
+
onDateChange: PropType<ResourcesMonthViewProps["onDateChange"]>;
|
|
188
|
+
resources: {
|
|
189
|
+
type: PropType<ScheduleResourceData[]>;
|
|
190
|
+
required: true;
|
|
191
|
+
};
|
|
192
|
+
locale: StringConstructor;
|
|
193
|
+
weekdayFormat: {
|
|
194
|
+
type: PropType<DateLabelFormat>;
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
197
|
+
weekendDays: {
|
|
198
|
+
type: PropType<DayOfWeek[]>;
|
|
199
|
+
default: () => number[];
|
|
200
|
+
};
|
|
201
|
+
withWeekendDays: {
|
|
202
|
+
type: BooleanConstructor;
|
|
203
|
+
default: boolean;
|
|
204
|
+
};
|
|
205
|
+
startScrollDate: StringConstructor;
|
|
206
|
+
onDayClick: PropType<ResourcesMonthViewProps["onDayClick"]>;
|
|
207
|
+
highlightToday: {
|
|
208
|
+
type: BooleanConstructor;
|
|
209
|
+
default: boolean;
|
|
210
|
+
};
|
|
211
|
+
radius: PropType<string | number>;
|
|
212
|
+
withHeader: {
|
|
213
|
+
type: BooleanConstructor;
|
|
214
|
+
default: boolean;
|
|
215
|
+
};
|
|
216
|
+
monthYearSelectProps: PropType<Partial<MonthYearSelectProps>>;
|
|
217
|
+
onViewChange: PropType<ResourcesMonthViewProps["onViewChange"]>;
|
|
218
|
+
previousControlProps: PropType<NativeButtonProps>;
|
|
219
|
+
nextControlProps: PropType<NativeButtonProps>;
|
|
220
|
+
todayControlProps: PropType<NativeButtonProps>;
|
|
221
|
+
viewSelectProps: PropType<Partial<ViewSelectProps>>;
|
|
222
|
+
events: PropType<ScheduleEventData[]>;
|
|
223
|
+
dayWidth: {
|
|
224
|
+
type: PropType<CSSProperties["width"]>;
|
|
225
|
+
default: number;
|
|
226
|
+
};
|
|
227
|
+
rowHeight: {
|
|
228
|
+
type: PropType<CSSProperties["height"]>;
|
|
229
|
+
default: number;
|
|
230
|
+
};
|
|
231
|
+
renderEventBody: PropType<RenderEventBody>;
|
|
232
|
+
renderEvent: PropType<RenderEvent>;
|
|
233
|
+
renderResourceLabel: PropType<ResourcesMonthViewProps["renderResourceLabel"]>;
|
|
234
|
+
groups: PropType<ScheduleResourceGroup[]>;
|
|
235
|
+
renderGroupLabel: PropType<ResourcesMonthViewProps["renderGroupLabel"]>;
|
|
236
|
+
groupLabelWidth: {
|
|
237
|
+
type: PropType<CSSProperties["width"]>;
|
|
238
|
+
default: number;
|
|
239
|
+
};
|
|
240
|
+
withEventsDragAndDrop: BooleanConstructor;
|
|
241
|
+
onEventDrop: PropType<ResourcesMonthViewProps["onEventDrop"]>;
|
|
242
|
+
canDragEvent: PropType<ResourcesMonthViewProps["canDragEvent"]>;
|
|
243
|
+
onEventDragStart: PropType<ResourcesMonthViewProps["onEventDragStart"]>;
|
|
244
|
+
onEventDragEnd: PropType<ResourcesMonthViewProps["onEventDragEnd"]>;
|
|
245
|
+
onEventClick: PropType<ResourcesMonthViewProps["onEventClick"]>;
|
|
246
|
+
withDragSlotSelect: BooleanConstructor;
|
|
247
|
+
onSlotDragEnd: PropType<ResourcesMonthViewProps["onSlotDragEnd"]>;
|
|
248
|
+
labels: PropType<ScheduleLabelsOverride>;
|
|
249
|
+
mode: {
|
|
250
|
+
type: PropType<ScheduleMode>;
|
|
251
|
+
default: string;
|
|
252
|
+
};
|
|
253
|
+
scrollAreaProps: PropType<Record<string, unknown>>;
|
|
254
|
+
onExternalEventDrop: PropType<ResourcesMonthViewProps["onExternalEventDrop"]>;
|
|
255
|
+
maxEventsPerTimeSlot: {
|
|
256
|
+
type: NumberConstructor;
|
|
257
|
+
default: number;
|
|
258
|
+
};
|
|
259
|
+
moreEventsProps: PropType<Record<string, unknown>>;
|
|
260
|
+
recurrenceExpansionLimit: {
|
|
261
|
+
type: NumberConstructor;
|
|
262
|
+
default: number;
|
|
263
|
+
};
|
|
264
|
+
}>> & Readonly<{}>, {
|
|
265
|
+
mode: ScheduleMode;
|
|
266
|
+
weekendDays: DayOfWeek[];
|
|
267
|
+
highlightToday: boolean;
|
|
268
|
+
weekdayFormat: DateLabelFormat;
|
|
269
|
+
withWeekendDays: boolean;
|
|
270
|
+
withHeader: boolean;
|
|
271
|
+
recurrenceExpansionLimit: number;
|
|
272
|
+
withEventsDragAndDrop: boolean;
|
|
273
|
+
withDragSlotSelect: boolean;
|
|
274
|
+
rowHeight: import("csstype").Property.Height<string | number> | undefined;
|
|
275
|
+
groupLabelWidth: import("csstype").Property.Width<string | number> | undefined;
|
|
276
|
+
maxEventsPerTimeSlot: number;
|
|
277
|
+
dayWidth: import("csstype").Property.Width<string | number> | undefined;
|
|
278
|
+
}, SlotsType<ResourcesMonthViewSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
279
|
+
export type ResourcesMonthViewStylesNames = keyof typeof classes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ResourcesMonthView';
|