@mantine-vue/schedule 3.1.0 → 3.2.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.
Files changed (80) hide show
  1. package/cjs/index.cjs +6101 -3638
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +6045 -3632
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/component-props.d.ts +181 -214
  6. package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +8 -114
  7. package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.types.d.ts +89 -0
  8. package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.vue.d.ts +20 -0
  9. package/lib/components/DayView/DayView.d.ts +10 -212
  10. package/lib/components/DayView/DayView.types.d.ts +65 -0
  11. package/lib/components/DayView/DayView.vue.d.ts +51 -0
  12. package/lib/components/DragContext/DragContext.d.ts +43 -5
  13. package/lib/components/MobileMonthView/MobileMonthView.d.ts +10 -171
  14. package/lib/components/MobileMonthView/MobileMonthView.types.d.ts +110 -0
  15. package/lib/components/MobileMonthView/MobileMonthView.vue.d.ts +44 -0
  16. package/lib/components/MonthView/MonthView.d.ts +10 -174
  17. package/lib/components/MonthView/MonthView.types.d.ts +125 -0
  18. package/lib/components/MonthView/MonthView.vue.d.ts +56 -0
  19. package/lib/components/MoreEvents/MoreEvents.d.ts +9 -65
  20. package/lib/components/MoreEvents/MoreEvents.types.d.ts +62 -0
  21. package/lib/components/MoreEvents/MoreEvents.vue.d.ts +23 -0
  22. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +10 -346
  23. package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +308 -0
  24. package/lib/components/ResourcesDayView/ResourcesDayView.vue.d.ts +53 -0
  25. package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +10 -279
  26. package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +233 -0
  27. package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +52 -0
  28. package/lib/components/ResourcesMonthView/get-resources-month-view-layout/get-resources-month-view-layout.d.ts +54 -0
  29. package/lib/components/ResourcesMonthView/index.d.ts +1 -0
  30. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +9 -201
  31. package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +159 -0
  32. package/lib/components/ResourcesSchedule/ResourcesSchedule.vue.d.ts +44 -0
  33. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +10 -412
  34. package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +314 -0
  35. package/lib/components/ResourcesWeekView/ResourcesWeekView.vue.d.ts +58 -0
  36. package/lib/components/Schedule/Schedule.d.ts +9 -134
  37. package/lib/components/Schedule/Schedule.types.d.ts +153 -0
  38. package/lib/components/Schedule/Schedule.vue.d.ts +50 -0
  39. package/lib/components/ScheduleEvent/ScheduleEvent.d.ts +11 -88
  40. package/lib/components/ScheduleEvent/ScheduleEvent.types.d.ts +109 -0
  41. package/lib/components/ScheduleEvent/ScheduleEvent.vue.d.ts +24 -0
  42. package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.d.ts +36 -0
  43. package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.types.d.ts +44 -0
  44. package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.vue.d.ts +14 -0
  45. package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue.d.ts +11 -0
  46. package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue.d.ts +11 -0
  47. package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue.d.ts +11 -0
  48. package/lib/components/ScheduleHeader/HeaderControl/index.d.ts +1 -2
  49. package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.d.ts +8 -0
  50. package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.types.d.ts +70 -0
  51. package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue.d.ts +21 -0
  52. package/lib/components/ScheduleHeader/MonthYearSelect/index.d.ts +1 -2
  53. package/lib/components/ScheduleHeader/ScheduleHeader.context.d.ts +12 -0
  54. package/lib/components/ScheduleHeader/ScheduleHeader.d.ts +20 -364
  55. package/lib/components/ScheduleHeader/ScheduleHeader.types.d.ts +28 -0
  56. package/lib/components/ScheduleHeader/ScheduleHeader.vue.d.ts +11 -0
  57. package/lib/components/ScheduleHeader/ScheduleHeaderBase.d.ts +37 -75
  58. package/lib/components/ScheduleHeader/ScheduleHeaderBase.types.d.ts +54 -0
  59. package/lib/components/ScheduleHeader/ScheduleHeaderBase.vue.d.ts +21 -0
  60. package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.d.ts +8 -0
  61. package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.types.d.ts +39 -0
  62. package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.vue.d.ts +16 -0
  63. package/lib/components/ScheduleHeader/ViewSelect/index.d.ts +1 -2
  64. package/lib/components/ScheduleHeader/index.d.ts +4 -0
  65. package/lib/components/WeekView/WeekView.d.ts +10 -294
  66. package/lib/components/WeekView/WeekView.types.d.ts +129 -0
  67. package/lib/components/WeekView/WeekView.vue.d.ts +60 -0
  68. package/lib/components/YearView/YearView.d.ts +9 -151
  69. package/lib/components/YearView/YearView.types.d.ts +87 -0
  70. package/lib/components/YearView/YearView.vue.d.ts +35 -0
  71. package/lib/components/shared.d.ts +71 -141
  72. package/lib/components/use-slot-drag-select.d.ts +7 -9
  73. package/lib/components/use-slot-drop-target.d.ts +38 -0
  74. package/lib/hooks/use-event-resize.d.ts +1 -1
  75. package/lib/hooks/use-horizontal-event-resize.d.ts +2 -156
  76. package/lib/index.d.mts +1 -0
  77. package/lib/index.d.ts +1 -0
  78. package/package.json +4 -4
  79. package/styles.css +44 -54
  80. package/styles.layer.css +44 -54
@@ -0,0 +1,23 @@
1
+ import type { ScheduleEventData } from '../../types';
2
+ import type { MoreEventsOwnProps } from './MoreEvents.types';
3
+ declare const defaultProps: {
4
+ readonly dropdownType: "popover";
5
+ readonly mode: "default";
6
+ };
7
+ /** Pulls the popover back over the control it replaces, so the list covers the day cell. */
8
+ declare const POPOVER_OFFSET = -46;
9
+ export { defaultProps, POPOVER_OFFSET };
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MoreEventsOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ dropdownClose: () => any;
14
+ eventClick: (event: ScheduleEventData, nativeEvent: MouseEvent) => any;
15
+ }, string, import("vue").PublicProps, Readonly<MoreEventsOwnProps> & Readonly<{
16
+ onDropdownClose?: (() => any) | undefined;
17
+ onEventClick?: ((event: ScheduleEventData, nativeEvent: MouseEvent) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("../..").EventSlots>;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -1,346 +1,10 @@
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
- withHeader: boolean;
328
- startTime: string;
329
- endTime: string;
330
- intervalMinutes: number;
331
- businessHours: [string, string];
332
- highlightBusinessHours: 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;
1
+ export declare const ResourcesDayView: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./ResourcesDayView.types").ResourcesDayViewProps, "rootRef">;
3
+ slots: import("./ResourcesDayView.types").ResourcesDayViewSlots;
4
+ emits: import("./ResourcesDayView.types").ResourcesDayViewEmits;
5
+ ref: HTMLDivElement;
6
+ element: "div";
7
+ stylesNames: import("./ResourcesDayView.types").ResourcesDayViewStylesNames;
8
+ vars: import("./ResourcesDayView.types").ResourcesDayViewCssVariables;
9
+ }>;
10
+ export type { ResourceExternalDropData, ResourceSlotDragEndData, ResourceTimeSlotClickData, ResourceViewDropData, ResourcesDayViewCssVariables, ResourcesDayViewEmits, ResourcesDayViewFactory, ResourcesDayViewOwnProps, ResourcesDayViewOwnStylesNames, ResourcesDayViewProps, ResourcesDayViewSlots, ResourcesDayViewStylesNames, } from './ResourcesDayView.types';
@@ -0,0 +1,308 @@
1
+ import type { CSSProperties, VNodeChild } from 'vue';
2
+ import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
3
+ import type { StylesApiProps } from '@mantine-vue/core/styles-api';
4
+ import type { EventDropData, EventSlots, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
5
+ import type { ScheduleLabelsOverride } from '../../labels';
6
+ import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
7
+ import type { BusinessHoursValue } from '../../utils';
8
+ import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
9
+ import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
10
+ import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
11
+ import type { ViewSelectEmits, ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect.types';
12
+ export type ResourcesDayViewOwnStylesNames = 'resourcesDayView' | 'resourcesDayViewRoot' | 'resourcesDayViewInner' | 'resourcesDayViewScrollArea' | 'resourcesDayViewTimeLabelsRow' | 'resourcesDayViewTimeLabel' | 'resourcesDayViewCorner' | 'resourcesDayViewResourceLabel' | 'resourcesDayViewRow' | 'resourcesDayViewRowSlot' | 'resourcesDayViewRowSlots' | 'resourcesDayViewBackgroundEvent' | 'resourcesDayViewAllDayEvent' | 'resourcesDayViewEventWrapper' | 'resourcesDayViewResizeHandle' | 'resourcesDayViewGroupColumn' | 'resourcesDayViewGroupColumnEmpty' | 'resourcesDayViewCurrentTimeIndicator' | 'resourcesDayViewCurrentTimeIndicatorLine' | 'resourcesDayViewCurrentTimeIndicatorThumb' | 'resourcesDayViewCurrentTimeIndicatorTimeBubble';
13
+ /**
14
+ * `ResourcesDayView` forwards `classNames` and `styles` to the components it renders, so
15
+ * their selectors are part of its Styles API.
16
+ */
17
+ export type ResourcesDayViewStylesNames = ResourcesDayViewOwnStylesNames | MoreEventsStylesNames | ScheduleEventStylesNames | CombinedScheduleHeaderStylesNames;
18
+ export type ResourcesDayViewCssVariables = {
19
+ resourcesDayView: '--resources-day-view-radius' | '--resources-day-view-slot-width' | '--resources-day-view-row-height' | '--resources-day-view-group-label-width';
20
+ };
21
+ /** Payload of the drop events of the resource views, extended with the target resource. */
22
+ export interface ResourceViewDropData extends EventDropData {
23
+ /** Resource the event was dropped on. */
24
+ resourceId?: string | number;
25
+ }
26
+ /** Payload of the `timeSlotClick` event of the resource views. */
27
+ export interface ResourceTimeSlotClickData {
28
+ /** Start datetime of the clicked slot, `YYYY-MM-DD HH:mm:ss`. */
29
+ slotStart: DateTimeStringValue;
30
+ /** End datetime of the clicked slot, `YYYY-MM-DD HH:mm:ss`. */
31
+ slotEnd: DateTimeStringValue;
32
+ /** Originating DOM event. */
33
+ nativeEvent: MouseEvent;
34
+ /** Resource the slot belongs to. */
35
+ resourceId?: string | number;
36
+ }
37
+ /** Payload of the `slotDragEnd` event of the resource views. */
38
+ export interface ResourceSlotDragEndData {
39
+ /** Start of the selected range. */
40
+ rangeStart: DateTimeStringValue;
41
+ /** End of the selected range. */
42
+ rangeEnd: DateTimeStringValue;
43
+ /** Resource the range belongs to. */
44
+ resourceId?: string | number;
45
+ }
46
+ /** Payload of the `externalEventDrop` event of the resource views. */
47
+ export interface ResourceExternalDropData {
48
+ /** Payload of the native drag. */
49
+ dataTransfer: DataTransfer;
50
+ /** Datetime the item was dropped on, `YYYY-MM-DD HH:mm:ss`. */
51
+ dropDateTime: DateTimeStringValue;
52
+ /** Resource the item was dropped on. */
53
+ resourceId?: string | number;
54
+ }
55
+ export interface ResourcesDayViewSlots extends EventSlots {
56
+ /** Replaces the navigation header. */
57
+ header?: (props: {
58
+ date: DateStringValue;
59
+ label: VNodeChild;
60
+ }) => VNodeChild;
61
+ /** Content of the top-left corner of the grid. */
62
+ corner?: (props: {
63
+ resources: ScheduleResourceData[];
64
+ }) => VNodeChild;
65
+ /** Replaces the label of a time column. */
66
+ timeLabel?: (props: {
67
+ label: VNodeChild;
68
+ startTime: string;
69
+ endTime: string;
70
+ }) => VNodeChild;
71
+ /** Replaces the label of a resource row. Takes precedence over `renderResourceLabel`. */
72
+ resourceLabel?: (props: {
73
+ resource: ScheduleResourceData;
74
+ }) => VNodeChild;
75
+ /** Replaces the label of a resource group. Takes precedence over `renderGroupLabel`. */
76
+ groupLabel?: (props: {
77
+ group: ScheduleResourceGroup;
78
+ }) => VNodeChild;
79
+ /** Content rendered inside every time slot. */
80
+ timeSlot?: (props: {
81
+ resource: ScheduleResourceData;
82
+ startTime: string;
83
+ endTime: string;
84
+ }) => VNodeChild;
85
+ /** Replaces a background event. */
86
+ backgroundEvent?: (props: {
87
+ event: ScheduleEventData;
88
+ }) => VNodeChild;
89
+ /** Replaces an all-day event bar. */
90
+ allDayEvent?: (props: {
91
+ event: ScheduleEventData;
92
+ }) => VNodeChild;
93
+ /** Replaces the "more events" control of an overlap cluster. */
94
+ moreEvents?: (props: {
95
+ events: ScheduleEventData[];
96
+ hiddenCount: number;
97
+ }) => VNodeChild;
98
+ /** Replaces the current time indicator. */
99
+ currentTimeIndicator?: (props: {
100
+ time: VNodeChild;
101
+ offset: number;
102
+ }) => VNodeChild;
103
+ }
104
+ /**
105
+ * Props declared by `ResourcesDayView` itself. See `ResourcesDayViewProps` for the full
106
+ * public type.
107
+ */
108
+ export interface ResourcesDayViewOwnProps extends StylesApiProps<ResourcesDayViewFactory> {
109
+ /** Day displayed by the view. Accepts anything `dayjs` understands. */
110
+ date: Date | DateStringValue;
111
+ /** Resources rendered as rows, in the given order. */
112
+ resources: ScheduleResourceData[];
113
+ /** Groups the resources are bucketed into, rendered as a leading column. */
114
+ groups?: ScheduleResourceGroup[];
115
+ /**
116
+ * First visible time of the day, `HH:mm:ss`.
117
+ * @default '00:00:00'
118
+ */
119
+ startTime?: string;
120
+ /**
121
+ * Last visible time of the day, `HH:mm:ss`.
122
+ * @default '23:59:59'
123
+ */
124
+ endTime?: string;
125
+ /**
126
+ * Length of one time slot in minutes.
127
+ * @default 60
128
+ */
129
+ intervalMinutes?: number;
130
+ /**
131
+ * Format of the time column labels.
132
+ * @default 'HH:mm'
133
+ */
134
+ slotLabelFormat?: DateLabelFormat;
135
+ /** Key of `theme.radius` or any valid CSS value to set `border-radius`. */
136
+ radius?: string | number;
137
+ /** Time the view scrolls to on the initial render, `HH:mm:ss`. */
138
+ startScrollTime?: string;
139
+ /** Props passed to the `ScrollArea` that wraps the grid. */
140
+ scrollAreaProps?: ForwardedProps<ScrollAreaProps>;
141
+ /**
142
+ * Locale passed down to `dayjs` when formatting labels.
143
+ * @default 'en'
144
+ */
145
+ locale?: string;
146
+ /** If set, a line marking the current time is displayed. */
147
+ withCurrentTimeIndicator?: boolean;
148
+ /**
149
+ * If set, the current time indicator carries a bubble with the current time.
150
+ * @default true
151
+ */
152
+ withCurrentTimeBubble?: boolean;
153
+ /**
154
+ * Returns the current time, called on every render. Use it to render the indicator in
155
+ * another timezone.
156
+ * @default () => dayjs()
157
+ */
158
+ getCurrentTime?: () => AnyDateValue;
159
+ /**
160
+ * If set, the navigation header is rendered above the grid.
161
+ * @default true
162
+ */
163
+ withHeader?: boolean;
164
+ /** Props passed to the previous control of the header. */
165
+ previousControlProps?: NativeButtonProps;
166
+ /** Props passed to the next control of the header. */
167
+ nextControlProps?: NativeButtonProps;
168
+ /** Props passed to the today control of the header. */
169
+ todayControlProps?: NativeButtonProps;
170
+ /** Props passed to the view select of the header. */
171
+ viewSelectProps?: ForwardedProps<ViewSelectProps, ViewSelectEmits>;
172
+ /**
173
+ * Format of the date shown in the header.
174
+ * @default 'MMMM D, YYYY'
175
+ */
176
+ headerFormat?: DateLabelFormat;
177
+ /** Events rendered by the view. */
178
+ events?: ScheduleEventData[];
179
+ /**
180
+ * Width of one time column.
181
+ * @default 80
182
+ */
183
+ slotWidth?: CSSProperties['width'];
184
+ /**
185
+ * Height of one resource row.
186
+ * @default 64
187
+ */
188
+ rowHeight?: CSSProperties['height'];
189
+ /**
190
+ * Width of the group column.
191
+ * @default 80
192
+ */
193
+ groupLabelWidth?: CSSProperties['width'];
194
+ /** Overrides for the built-in labels, used for i18n and accessible names. */
195
+ labels?: ScheduleLabelsOverride;
196
+ /**
197
+ * If set, business hours are highlighted.
198
+ * @default false
199
+ */
200
+ highlightBusinessHours?: boolean;
201
+ /**
202
+ * Business hours as an `HH:mm:ss` range shared by every day, or a record keyed by day of
203
+ * the week (`0` – Sunday) for per-day ranges.
204
+ * @default ['09:00:00', '17:00:00']
205
+ */
206
+ businessHours?: BusinessHoursValue;
207
+ /**
208
+ * Replaces the body of every event. Can also be set with the `eventBody` slot,
209
+ * which takes precedence over the prop.
210
+ */
211
+ renderEventBody?: RenderEventBody;
212
+ /**
213
+ * Replaces every event entirely. Can also be set with the `event` slot, which takes
214
+ * precedence over the prop.
215
+ */
216
+ renderEvent?: RenderEvent;
217
+ /**
218
+ * Replaces the label of every resource row. Can also be set with the `resourceLabel` slot,
219
+ * which takes precedence over the prop.
220
+ */
221
+ renderResourceLabel?: (resource: ScheduleResourceData) => VNodeChild;
222
+ /**
223
+ * Replaces the label of every resource group. Can also be set with the `groupLabel` slot,
224
+ * which takes precedence over the prop.
225
+ */
226
+ renderGroupLabel?: (group: ScheduleResourceGroup) => VNodeChild;
227
+ /**
228
+ * If set, events can be dragged onto another slot or resource.
229
+ * @default false
230
+ */
231
+ withEventsDragAndDrop?: boolean;
232
+ /**
233
+ * Returns whether the given event may be dragged.
234
+ * @default () => true
235
+ */
236
+ canDragEvent?: (event: ScheduleEventData) => boolean;
237
+ /**
238
+ * If set, items dragged in from outside the schedule can be dropped on a slot, which emits
239
+ * `externalEventDrop`. Enabling event drag and drop turns this on as well.
240
+ * @default false
241
+ */
242
+ withExternalEventDrop?: boolean;
243
+ /**
244
+ * If set, dragging across time slots selects a range.
245
+ * @default false
246
+ */
247
+ withDragSlotSelect?: boolean;
248
+ /**
249
+ * Interaction mode. `static` disables every event and slot interaction.
250
+ * @default 'default'
251
+ */
252
+ mode?: ScheduleMode;
253
+ /**
254
+ * If set, events can be resized by dragging their edges.
255
+ * @default false
256
+ */
257
+ withEventResize?: boolean;
258
+ /**
259
+ * Returns whether the given event may be resized.
260
+ * @default () => true
261
+ */
262
+ canResizeEvent?: (event: ScheduleEventData) => boolean;
263
+ /**
264
+ * Maximum number of instances generated per recurring series.
265
+ * @default 2000
266
+ */
267
+ recurrenceExpansionLimit?: number;
268
+ /**
269
+ * Number of overlapping events shown per slot before the rest collapse into a "more" control.
270
+ * @default 2
271
+ */
272
+ maxEventsPerTimeSlot?: number;
273
+ /** Props passed to the `MoreEvents` control of an overlap cluster. */
274
+ moreEventsProps?: ForwardedProps<MoreEventsProps, MoreEventsEmits>;
275
+ }
276
+ export interface ResourcesDayViewProps extends Omit<BoxProps, keyof ResourcesDayViewOwnProps>, ResourcesDayViewOwnProps {
277
+ }
278
+ export interface ResourcesDayViewEmits {
279
+ /** Emitted when the view navigates to another date. */
280
+ dateChange: [date: DateStringValue];
281
+ /** Emitted when the header view select picks another view level. */
282
+ viewChange: [view: ScheduleViewLevel];
283
+ /** Emitted when an event is clicked. */
284
+ eventClick: [event: ScheduleEventData, nativeEvent: MouseEvent];
285
+ /** Emitted when an event is dropped. */
286
+ eventDrop: [data: ResourceViewDropData];
287
+ /** Emitted when a drag of an event starts. */
288
+ eventDragStart: [event: ScheduleEventData];
289
+ /** Emitted when a drag of an event ends. */
290
+ eventDragEnd: [];
291
+ /** Emitted when a time slot is clicked. */
292
+ timeSlotClick: [data: ResourceTimeSlotClickData];
293
+ /** Emitted when a slot range is selected by dragging. */
294
+ slotDragEnd: [data: ResourceSlotDragEndData];
295
+ /** Emitted when an item from outside the schedule is dropped. */
296
+ externalEventDrop: [data: ResourceExternalDropData];
297
+ /** Emitted when an event is resized. */
298
+ eventResize: [data: EventDropData];
299
+ }
300
+ export type ResourcesDayViewFactory = Factory<{
301
+ props: Omit<ResourcesDayViewProps, 'rootRef'>;
302
+ slots: ResourcesDayViewSlots;
303
+ emits: ResourcesDayViewEmits;
304
+ ref: HTMLDivElement;
305
+ element: 'div';
306
+ stylesNames: ResourcesDayViewStylesNames;
307
+ vars: ResourcesDayViewCssVariables;
308
+ }>;