@mantine-vue/schedule 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.cjs +1146 -262
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +1145 -263
- package/esm/index.mjs.map +1 -1
- package/lib/component-props.d.ts +13 -2
- package/lib/components/DayView/DayView.types.d.ts +7 -3
- package/lib/components/DayView/DayView.vue.d.ts +2 -0
- package/lib/components/DayView/get-day-view-events/get-day-positioned-events.d.ts +4 -2
- package/lib/components/DayView/get-day-view-events/get-day-view-events.d.ts +3 -2
- package/lib/components/MonthView/MonthView.types.d.ts +9 -1
- package/lib/components/MonthView/MonthView.vue.d.ts +2 -0
- package/lib/components/MonthView/get-month-view-events/reserve-row.d.ts +7 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +10 -1
- package/lib/components/ResourcesDayView/ResourcesDayView.vue.d.ts +2 -0
- package/lib/components/ResourcesDayView/index.d.ts +0 -1
- package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +10 -1
- package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +2 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +10 -1
- package/lib/components/ResourcesSchedule/ResourcesSchedule.vue.d.ts +2 -0
- package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +10 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.vue.d.ts +2 -0
- package/lib/components/Schedule/Schedule.types.d.ts +12 -2
- package/lib/components/Schedule/Schedule.vue.d.ts +2 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.types.d.ts +12 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue.d.ts +2 -0
- package/lib/components/WeekView/WeekView.types.d.ts +7 -3
- package/lib/components/WeekView/WeekView.vue.d.ts +2 -0
- package/lib/components/WeekView/get-week-view-events/get-week-positioned-events.d.ts +4 -2
- package/lib/hooks/use-event-resize.d.ts +10 -2
- package/lib/hooks/use-horizontal-event-resize.d.ts +9 -1
- package/lib/hooks/validate-event-resize.d.ts +26 -0
- package/lib/types.d.ts +40 -0
- package/lib/utils/apply-cascade-layout/apply-cascade-layout.d.ts +5 -0
- package/lib/utils/get-overlap-clusters/get-overlap-clusters.d.ts +2 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/is-event-placement-allowed/is-event-placement-allowed.d.ts +13 -0
- package/package.json +4 -4
- package/styles.css +711 -379
- package/styles.layer.css +711 -379
- package/lib/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.d.ts +0 -2
package/lib/component-props.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { CSSProperties, HTMLAttributes, VNodeChild } from 'vue';
|
|
|
2
2
|
import type { EmitsToProps } from '@mantine-vue/core';
|
|
3
3
|
import type { ViewSelectEmits, ViewSelectProps } from './components/ScheduleHeader/ViewSelect/ViewSelect.types';
|
|
4
4
|
import type { ScheduleLabelsOverride } from './labels';
|
|
5
|
-
import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleViewLevel } from './types';
|
|
5
|
+
import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, PreventEventOverlap, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, ScheduleEventData, ScheduleEventPlacementRejectedData, ScheduleMode, ScheduleViewLevel } from './types';
|
|
6
6
|
import type { BusinessHoursValue } from './utils';
|
|
7
7
|
/**
|
|
8
8
|
* Native attributes accepted by the header controls and the other button-like elements
|
|
@@ -99,7 +99,8 @@ export interface BaseViewOwnProps {
|
|
|
99
99
|
*/
|
|
100
100
|
recurrenceExpansionLimit?: number;
|
|
101
101
|
/**
|
|
102
|
-
* If set, background events can be focused and clicked.
|
|
102
|
+
* If set, background events can be focused and clicked. Combined with event resize, timed
|
|
103
|
+
* background events can also be resized. Has no effect in static mode.
|
|
103
104
|
* @default false
|
|
104
105
|
*/
|
|
105
106
|
withInteractiveBackgroundEvents?: boolean;
|
|
@@ -176,6 +177,12 @@ export interface TimeViewOwnProps extends BaseViewOwnProps {
|
|
|
176
177
|
* @default () => true
|
|
177
178
|
*/
|
|
178
179
|
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
180
|
+
/** Returns false to reject a candidate internal event drop. */
|
|
181
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
182
|
+
/** Returns false to reject a candidate external drop. */
|
|
183
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
184
|
+
/** Rejects drops that overlap other events. */
|
|
185
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
179
186
|
/**
|
|
180
187
|
* If set, dragging across time slots selects a range.
|
|
181
188
|
* @default false
|
|
@@ -199,6 +206,8 @@ export interface TimeViewOwnProps extends BaseViewOwnProps {
|
|
|
199
206
|
* @default () => true
|
|
200
207
|
*/
|
|
201
208
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
209
|
+
/** Returns false to reject a candidate resize. */
|
|
210
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
202
211
|
}
|
|
203
212
|
/**
|
|
204
213
|
* Events emitted by every schedule view. Not a component of its own: `DayViewEmits`,
|
|
@@ -233,6 +242,8 @@ export interface TimeViewEmits extends BaseViewEmits {
|
|
|
233
242
|
externalEventDrop: [dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue];
|
|
234
243
|
/** Emitted when an event is resized. */
|
|
235
244
|
eventResize: [data: EventDropData];
|
|
245
|
+
/** Emitted when a drop or resize is rejected. */
|
|
246
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
236
247
|
}
|
|
237
248
|
/** Scoped slots that mirror the `renderEvent` and `renderEventBody` props. */
|
|
238
249
|
export interface EventSlots {
|
|
@@ -2,13 +2,13 @@ import type { CSSProperties } from 'vue';
|
|
|
2
2
|
import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventSlots, ForwardedProps, TimeViewEmits, TimeViewOwnProps } from '../../component-props';
|
|
5
|
-
import type { DateLabelFormat } from '../../types';
|
|
5
|
+
import type { DateLabelFormat, ScheduleEventOverlapMode } from '../../types';
|
|
6
6
|
import type { CurrentTimeIndicatorStylesNames } from '../CurrentTimeIndicator/CurrentTimeIndicator.types';
|
|
7
7
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
8
8
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
9
9
|
import type { CombinedScheduleHeaderStylesNames, ScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
10
10
|
import type { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect.types';
|
|
11
|
-
export type DayViewOwnStylesNames = 'dayView' | 'dayViewInner' | 'dayViewScrollArea' | 'dayViewAllDay' | 'dayViewAllDayEvents' | 'dayViewSlot' | 'dayViewSlots' | 'dayViewTimeSlots' | 'dayViewSlotLabel' | 'dayViewSlotLabels' | 'dayViewBackgroundEvent';
|
|
11
|
+
export type DayViewOwnStylesNames = 'dayView' | 'dayViewInner' | 'dayViewScrollArea' | 'dayViewAllDay' | 'dayViewAllDayEvents' | 'dayViewSlot' | 'dayViewSlots' | 'dayViewTimeSlots' | 'dayViewSlotLabel' | 'dayViewSlotLabels' | 'dayViewBackgroundEvent' | 'dayViewBackgroundEventResizeHandle';
|
|
12
12
|
/**
|
|
13
13
|
* `DayView` forwards `classNames` and `styles` to the components it renders, so their
|
|
14
14
|
* selectors are part of its Styles API. The month/year select is excluded because the day
|
|
@@ -16,11 +16,15 @@ export type DayViewOwnStylesNames = 'dayView' | 'dayViewInner' | 'dayViewScrollA
|
|
|
16
16
|
*/
|
|
17
17
|
export type DayViewStylesNames = DayViewOwnStylesNames | MoreEventsStylesNames | ScheduleEventStylesNames | Exclude<CombinedScheduleHeaderStylesNames, MonthYearSelectStylesNames> | CurrentTimeIndicatorStylesNames | ScheduleHeaderStylesNames;
|
|
18
18
|
export type DayViewCssVariables = {
|
|
19
|
-
dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height';
|
|
19
|
+
dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height' | '--event-raise-delay' | '--event-z-index' | '--event-z-index-raised';
|
|
20
20
|
};
|
|
21
21
|
export type DayViewSlots = EventSlots;
|
|
22
22
|
/** Props declared by `DayView` itself. See `DayViewProps` for the full public type. */
|
|
23
23
|
export interface DayViewOwnProps extends TimeViewOwnProps, StylesApiProps<DayViewFactory> {
|
|
24
|
+
/** Determines how overlapping events are laid out. @default 'columns' */
|
|
25
|
+
eventOverlapMode?: ScheduleEventOverlapMode;
|
|
26
|
+
/** Time in ms before a hovered cascade event is raised above covering events. @default 600 */
|
|
27
|
+
eventOverlapRaiseDelay?: number;
|
|
24
28
|
/**
|
|
25
29
|
* Length of one time slot in minutes.
|
|
26
30
|
* @default 15
|
|
@@ -31,6 +31,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DayVie
|
|
|
31
31
|
slotDragEnd: (rangeStart: string, rangeEnd: string) => any;
|
|
32
32
|
externalEventDrop: (dataTransfer: DataTransfer, dropDateTime: string) => any;
|
|
33
33
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
34
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
34
35
|
}, string, import("vue").PublicProps, Readonly<DayViewOwnProps> & Readonly<{
|
|
35
36
|
onDateChange?: ((date: string) => any) | undefined;
|
|
36
37
|
onEventDragStart?: ((event: ScheduleEventData) => any) | undefined;
|
|
@@ -43,6 +44,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DayVie
|
|
|
43
44
|
onSlotDragEnd?: ((rangeStart: string, rangeEnd: string) => any) | undefined;
|
|
44
45
|
onExternalEventDrop?: ((dataTransfer: DataTransfer, dropDateTime: string) => any) | undefined;
|
|
45
46
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
47
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
46
48
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("../..").EventSlots>;
|
|
47
49
|
type __VLS_WithSlots<T, S> = T & {
|
|
48
50
|
new (): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types';
|
|
1
|
+
import { AnyDateValue, DayPositionedEventData, ScheduleEventData, ScheduleEventOverlapMode } from '../../../types';
|
|
2
2
|
interface GetDayPositionedEventsInput {
|
|
3
3
|
/** Date at which events are positioned, used to check if events are all-day */
|
|
4
4
|
date: AnyDateValue;
|
|
@@ -10,6 +10,8 @@ interface GetDayPositionedEventsInput {
|
|
|
10
10
|
endTime?: string;
|
|
11
11
|
/** Number of minutes per time slot, used to align the canvas to whole slots */
|
|
12
12
|
intervalMinutes?: number;
|
|
13
|
+
/** Determines how overlapping events are laid out. @default 'columns' */
|
|
14
|
+
eventOverlapMode?: ScheduleEventOverlapMode;
|
|
13
15
|
}
|
|
14
|
-
export declare function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date, }: GetDayPositionedEventsInput): DayPositionedEventData[];
|
|
16
|
+
export declare function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date, eventOverlapMode, }: GetDayPositionedEventsInput): DayPositionedEventData[];
|
|
15
17
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types';
|
|
1
|
+
import { AnyDateValue, DayPositionedEventData, ScheduleEventData, ScheduleEventOverlapMode } from '../../../types';
|
|
2
2
|
interface GetDayViewEventsInput {
|
|
3
3
|
events: ScheduleEventData[] | undefined;
|
|
4
4
|
date: AnyDateValue;
|
|
5
5
|
startTime?: string;
|
|
6
6
|
endTime?: string;
|
|
7
7
|
intervalMinutes?: number;
|
|
8
|
+
eventOverlapMode?: ScheduleEventOverlapMode;
|
|
8
9
|
}
|
|
9
|
-
export declare function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes, }: GetDayViewEventsInput): {
|
|
10
|
+
export declare function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes, eventOverlapMode, }: GetDayViewEventsInput): {
|
|
10
11
|
allDayEvents: DayPositionedEventData[];
|
|
11
12
|
regularEvents: DayPositionedEventData[];
|
|
12
13
|
backgroundTimedEvents: DayPositionedEventData[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
2
2
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
3
3
|
import type { BaseViewEmits, BaseViewOwnProps, EventDropData, EventSlots, ForwardedProps, NativeButtonProps } from '../../component-props';
|
|
4
|
-
import type { DateLabelFormat, DateStringValue, DateTimeStringValue, DayOfWeek, ScheduleEventData } from '../../types';
|
|
4
|
+
import type { DateLabelFormat, DateStringValue, DateTimeStringValue, DayOfWeek, ScheduleEventData, ScheduleEventPlacementRejectedData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, PreventEventOverlap } from '../../types';
|
|
5
5
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
6
6
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
7
7
|
import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
@@ -78,6 +78,12 @@ export interface MonthViewOwnProps extends BaseViewOwnProps, StylesApiProps<Mont
|
|
|
78
78
|
* @default () => true
|
|
79
79
|
*/
|
|
80
80
|
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
81
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
82
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
83
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
84
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
85
|
+
/** If set, drops that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging to compute live feedback, it must be pure and cheap. @default false */
|
|
86
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
81
87
|
/**
|
|
82
88
|
* If set, items dragged in from outside the schedule can be dropped on a day, which emits
|
|
83
89
|
* `externalEventDrop`. Enabling event drag and drop turns this on as well.
|
|
@@ -113,6 +119,8 @@ export interface MonthViewEmits extends BaseViewEmits {
|
|
|
113
119
|
externalEventDrop: [dataTransfer: DataTransfer, date: DateStringValue];
|
|
114
120
|
/** Emitted when a day range is selected by dragging. */
|
|
115
121
|
slotDragEnd: [rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue];
|
|
122
|
+
/** Emitted when a drop is rejected. */
|
|
123
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
116
124
|
}
|
|
117
125
|
export type MonthViewFactory = Factory<{
|
|
118
126
|
props: Omit<MonthViewProps, 'rootRef'>;
|
|
@@ -36,6 +36,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MonthV
|
|
|
36
36
|
eventDrop: (data: import("../..").EventDropData) => any;
|
|
37
37
|
slotDragEnd: (rangeStart: string, rangeEnd: string) => any;
|
|
38
38
|
externalEventDrop: (dataTransfer: DataTransfer, date: string) => any;
|
|
39
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
39
40
|
weekNumberClick: (date: string, nativeEvent: MouseEvent) => any;
|
|
40
41
|
}, string, import("vue").PublicProps, Readonly<MonthViewOwnProps> & Readonly<{
|
|
41
42
|
onDateChange?: ((date: string) => any) | undefined;
|
|
@@ -47,6 +48,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MonthV
|
|
|
47
48
|
onEventDrop?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
48
49
|
onSlotDragEnd?: ((rangeStart: string, rangeEnd: string) => any) | undefined;
|
|
49
50
|
onExternalEventDrop?: ((dataTransfer: DataTransfer, date: string) => any) | undefined;
|
|
51
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
50
52
|
onWeekNumberClick?: ((date: string, nativeEvent: MouseEvent) => any) | undefined;
|
|
51
53
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("../..").EventSlots>;
|
|
52
54
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -3,7 +3,7 @@ import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventDropData, EventSlots, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
-
import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
6
|
+
import type { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, ScheduleEventPlacementRejectedData, PreventEventOverlap, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
7
7
|
import type { BusinessHoursValue } from '../../utils';
|
|
8
8
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
9
9
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
@@ -266,6 +266,14 @@ export interface ResourcesDayViewOwnProps extends StylesApiProps<ResourcesDayVie
|
|
|
266
266
|
* @default () => true
|
|
267
267
|
*/
|
|
268
268
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
269
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
270
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
271
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
272
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
273
|
+
/** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */
|
|
274
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
275
|
+
/** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */
|
|
276
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
269
277
|
/**
|
|
270
278
|
* Maximum number of instances generated per recurring series.
|
|
271
279
|
* @default 2000
|
|
@@ -302,6 +310,7 @@ export interface ResourcesDayViewEmits {
|
|
|
302
310
|
externalEventDrop: [data: ResourceExternalDropData];
|
|
303
311
|
/** Emitted when an event is resized. */
|
|
304
312
|
eventResize: [data: EventDropData];
|
|
313
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
305
314
|
}
|
|
306
315
|
export type ResourcesDayViewFactory = Factory<{
|
|
307
316
|
props: Omit<ResourcesDayViewProps, 'rootRef'>;
|
|
@@ -34,6 +34,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
34
34
|
slotDragEnd: (data: import("./ResourcesDayView.types").ResourceSlotDragEndData) => any;
|
|
35
35
|
externalEventDrop: (data: import("./ResourcesDayView.types").ResourceExternalDropData) => any;
|
|
36
36
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
37
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
37
38
|
}, string, import("vue").PublicProps, Readonly<ResourcesDayViewOwnProps> & Readonly<{
|
|
38
39
|
onDateChange?: ((date: string) => any) | undefined;
|
|
39
40
|
onEventDragStart?: ((event: ScheduleEventData) => any) | undefined;
|
|
@@ -45,6 +46,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
45
46
|
onSlotDragEnd?: ((data: import("./ResourcesDayView.types").ResourceSlotDragEndData) => any) | undefined;
|
|
46
47
|
onExternalEventDrop?: ((data: import("./ResourcesDayView.types").ResourceExternalDropData) => any) | undefined;
|
|
47
48
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
49
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
48
50
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesDayViewSlots>;
|
|
49
51
|
type __VLS_WithSlots<T, S> = T & {
|
|
50
52
|
new (): {
|
|
@@ -3,7 +3,7 @@ import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventSlots, EventDropData, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
-
import type { DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
6
|
+
import type { DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, ScheduleEventPlacementRejectedData, PreventEventOverlap, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
7
7
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
8
8
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
9
9
|
import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
@@ -170,6 +170,14 @@ export interface ResourcesMonthViewOwnProps extends StylesApiProps<ResourcesMont
|
|
|
170
170
|
withEventResize?: boolean;
|
|
171
171
|
/** Returns whether the given event may be resized. @default () => true */
|
|
172
172
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
173
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
174
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
175
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
176
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
177
|
+
/** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */
|
|
178
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
179
|
+
/** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */
|
|
180
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
173
181
|
/**
|
|
174
182
|
* If set, items dragged in from outside the schedule can be dropped on a day cell, which emits
|
|
175
183
|
* `externalEventDrop`. Enabling event drag and drop turns this on as well.
|
|
@@ -227,6 +235,7 @@ export interface ResourcesMonthViewEmits {
|
|
|
227
235
|
externalEventDrop: [data: ResourceExternalDropData];
|
|
228
236
|
/** Emitted when an event resize gesture completes. */
|
|
229
237
|
eventResize: [data: EventDropData];
|
|
238
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
230
239
|
}
|
|
231
240
|
export type ResourcesMonthViewFactory = Factory<{
|
|
232
241
|
props: Omit<ResourcesMonthViewProps, 'rootRef'>;
|
|
@@ -36,6 +36,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
36
36
|
slotDragEnd: (data: import("../ResourcesDayView").ResourceSlotDragEndData) => any;
|
|
37
37
|
externalEventDrop: (data: import("../ResourcesDayView").ResourceExternalDropData) => any;
|
|
38
38
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
39
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
39
40
|
}, string, import("vue").PublicProps, Readonly<ResourcesMonthViewOwnProps> & Readonly<{
|
|
40
41
|
onDateChange?: ((date: string) => any) | undefined;
|
|
41
42
|
onDayClick?: ((data: import("./ResourcesMonthView.types").ResourcesMonthViewDayClickData) => any) | undefined;
|
|
@@ -47,6 +48,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
47
48
|
onSlotDragEnd?: ((data: import("../ResourcesDayView").ResourceSlotDragEndData) => any) | undefined;
|
|
48
49
|
onExternalEventDrop?: ((data: import("../ResourcesDayView").ResourceExternalDropData) => any) | undefined;
|
|
49
50
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
51
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
50
52
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesMonthViewSlots>;
|
|
51
53
|
type __VLS_WithSlots<T, S> = T & {
|
|
52
54
|
new (): {
|
|
@@ -3,7 +3,7 @@ import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventDropData, EventSlots, RenderEventBody } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
-
import type { DateStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';
|
|
6
|
+
import type { DateStringValue, ScheduleEventData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, ScheduleEventPlacementRejectedData, PreventEventOverlap, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';
|
|
7
7
|
import type { ResourceExternalDropData, ResourceSlotDragEndData, ResourceTimeSlotClickData, ResourceViewDropData, ResourcesDayViewProps, ResourcesDayViewStylesNames } from '../ResourcesDayView/ResourcesDayView.types';
|
|
8
8
|
import type { ResourcesMonthViewDayClickData, ResourcesMonthViewProps, ResourcesMonthViewStylesNames } from '../ResourcesMonthView/ResourcesMonthView.types';
|
|
9
9
|
import type { ResourcesWeekViewProps, ResourcesWeekViewStylesNames } from '../ResourcesWeekView/ResourcesWeekView.types';
|
|
@@ -106,6 +106,14 @@ export interface ResourcesScheduleOwnProps extends StylesApiProps<ResourcesSched
|
|
|
106
106
|
* @default () => true
|
|
107
107
|
*/
|
|
108
108
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
109
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
110
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
111
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
112
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
113
|
+
/** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */
|
|
114
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
115
|
+
/** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */
|
|
116
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
109
117
|
/** If set, background events can be focused and clicked in day and week views. */
|
|
110
118
|
withInteractiveBackgroundEvents?: boolean;
|
|
111
119
|
/**
|
|
@@ -149,6 +157,7 @@ export interface ResourcesScheduleEmits {
|
|
|
149
157
|
externalEventDrop: [data: ResourceExternalDropData];
|
|
150
158
|
/** Emitted when an event is resized. */
|
|
151
159
|
eventResize: [data: EventDropData];
|
|
160
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
152
161
|
}
|
|
153
162
|
export type ResourcesScheduleFactory = Factory<{
|
|
154
163
|
props: Omit<ResourcesScheduleProps, 'rootRef'>;
|
|
@@ -21,6 +21,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
21
21
|
slotDragEnd: (data: import("../ResourcesDayView").ResourceSlotDragEndData) => any;
|
|
22
22
|
externalEventDrop: (data: import("../ResourcesDayView").ResourceExternalDropData) => any;
|
|
23
23
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
24
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
24
25
|
"update:view": (view: ResourcesScheduleViewLevel) => any;
|
|
25
26
|
}, string, import("vue").PublicProps, Readonly<ResourcesScheduleOwnProps> & Readonly<{
|
|
26
27
|
"onUpdate:date"?: ((date: string) => any) | undefined;
|
|
@@ -35,6 +36,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
35
36
|
onSlotDragEnd?: ((data: import("../ResourcesDayView").ResourceSlotDragEndData) => any) | undefined;
|
|
36
37
|
onExternalEventDrop?: ((data: import("../ResourcesDayView").ResourceExternalDropData) => any) | undefined;
|
|
37
38
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
39
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
38
40
|
"onUpdate:view"?: ((view: ResourcesScheduleViewLevel) => any) | undefined;
|
|
39
41
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesScheduleSlots>;
|
|
40
42
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -3,7 +3,7 @@ import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventDropData, EventSlots, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
-
import type { AnyDateValue, DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
6
|
+
import type { AnyDateValue, DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, ScheduleEventPlacementRejectedData, PreventEventOverlap, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
7
7
|
import type { BusinessHoursValue } from '../../utils';
|
|
8
8
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
9
9
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
@@ -247,6 +247,14 @@ export interface ResourcesWeekViewOwnProps extends StylesApiProps<ResourcesWeekV
|
|
|
247
247
|
* @default () => true
|
|
248
248
|
*/
|
|
249
249
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
250
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
251
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
252
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
253
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
254
|
+
/** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */
|
|
255
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
256
|
+
/** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */
|
|
257
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
250
258
|
/**
|
|
251
259
|
* Maximum number of instances generated per recurring series.
|
|
252
260
|
* @default 2000
|
|
@@ -308,6 +316,7 @@ export interface ResourcesWeekViewEmits {
|
|
|
308
316
|
externalEventDrop: [data: ResourceExternalDropData];
|
|
309
317
|
/** Emitted when an event is resized. */
|
|
310
318
|
eventResize: [data: EventDropData];
|
|
319
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
311
320
|
}
|
|
312
321
|
export type ResourcesWeekViewFactory = Factory<{
|
|
313
322
|
props: Omit<ResourcesWeekViewProps, 'rootRef'>;
|
|
@@ -39,6 +39,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
39
39
|
slotDragEnd: (data: import("../ResourcesDayView").ResourceSlotDragEndData) => any;
|
|
40
40
|
externalEventDrop: (data: import("../ResourcesDayView").ResourceExternalDropData) => any;
|
|
41
41
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
42
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
42
43
|
}, string, import("vue").PublicProps, Readonly<ResourcesWeekViewOwnProps> & Readonly<{
|
|
43
44
|
onDateChange?: ((date: string) => any) | undefined;
|
|
44
45
|
onEventDragStart?: ((event: ScheduleEventData) => any) | undefined;
|
|
@@ -50,6 +51,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
50
51
|
onSlotDragEnd?: ((data: import("../ResourcesDayView").ResourceSlotDragEndData) => any) | undefined;
|
|
51
52
|
onExternalEventDrop?: ((data: import("../ResourcesDayView").ResourceExternalDropData) => any) | undefined;
|
|
52
53
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
54
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
53
55
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesWeekViewSlots>;
|
|
54
56
|
type __VLS_WithSlots<T, S> = T & {
|
|
55
57
|
new (): {
|
|
@@ -3,7 +3,7 @@ import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventDropData, EventSlots, ForwardedProps, RenderEventBody, TimeSlotClickData } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
-
import type { DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleViewLevel } from '../../types';
|
|
6
|
+
import type { DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleEventPlacementRejectedData, ScheduleCanDropEventData, ScheduleCanDropExternalEventData, ScheduleCanResizeEventToData, PreventEventOverlap, ScheduleMode, ScheduleViewLevel } from '../../types';
|
|
7
7
|
import type { DayViewEmits, DayViewProps, DayViewStylesNames } from '../DayView/DayView.types';
|
|
8
8
|
import type { MobileMonthViewHeaderPayload, MobileMonthViewEmits, MobileMonthViewProps, MobileMonthViewStylesNames } from '../MobileMonthView/MobileMonthView.types';
|
|
9
9
|
import type { MonthViewEmits, MonthViewProps, MonthViewStylesNames } from '../MonthView/MonthView.types';
|
|
@@ -88,7 +88,15 @@ export interface ScheduleOwnProps extends StylesApiProps<ScheduleFactory> {
|
|
|
88
88
|
* @default () => true
|
|
89
89
|
*/
|
|
90
90
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
91
|
-
/**
|
|
91
|
+
/** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */
|
|
92
|
+
canDropEvent?: (data: ScheduleCanDropEventData) => boolean;
|
|
93
|
+
/** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */
|
|
94
|
+
canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;
|
|
95
|
+
/** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */
|
|
96
|
+
canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;
|
|
97
|
+
/** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */
|
|
98
|
+
preventEventOverlap?: PreventEventOverlap;
|
|
99
|
+
/** If set, background events can be focused and clicked. Combined with event resize, timed background events in day and week views can also be resized. */
|
|
92
100
|
withInteractiveBackgroundEvents?: boolean;
|
|
93
101
|
/**
|
|
94
102
|
* Maximum number of instances generated per recurring series.
|
|
@@ -144,6 +152,8 @@ export interface ScheduleEmits {
|
|
|
144
152
|
externalEventDrop: [dataTransfer: DataTransfer, dateTime: DateTimeStringValue];
|
|
145
153
|
/** Emitted when an event is resized. */
|
|
146
154
|
eventResize: [data: EventDropData];
|
|
155
|
+
/** Emitted when a drop or resize is rejected. */
|
|
156
|
+
eventPlacementRejected: [data: ScheduleEventPlacementRejectedData];
|
|
147
157
|
}
|
|
148
158
|
export type ScheduleFactory = Factory<{
|
|
149
159
|
props: Omit<ScheduleProps, 'rootRef'>;
|
|
@@ -24,6 +24,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Schedu
|
|
|
24
24
|
slotDragEnd: (rangeStart: string, rangeEnd: string) => any;
|
|
25
25
|
externalEventDrop: (dataTransfer: DataTransfer, dateTime: string) => any;
|
|
26
26
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
27
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
27
28
|
monthClick: (month: string) => any;
|
|
28
29
|
"update:view": (view: ScheduleViewLevel) => any;
|
|
29
30
|
}, string, import("vue").PublicProps, Readonly<ScheduleOwnProps> & Readonly<{
|
|
@@ -40,6 +41,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Schedu
|
|
|
40
41
|
onSlotDragEnd?: ((rangeStart: string, rangeEnd: string) => any) | undefined;
|
|
41
42
|
onExternalEventDrop?: ((dataTransfer: DataTransfer, dateTime: string) => any) | undefined;
|
|
42
43
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
44
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
43
45
|
onMonthClick?: ((month: string) => any) | undefined;
|
|
44
46
|
"onUpdate:view"?: ((view: ScheduleViewLevel) => any) | undefined;
|
|
45
47
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScheduleSlots>;
|
|
@@ -2,6 +2,7 @@ import type { VNodeChild } from 'vue';
|
|
|
2
2
|
import type { BoxProps } from '@mantine-vue/core';
|
|
3
3
|
import type { RenderEvent, RenderEventBody } from '../../component-props';
|
|
4
4
|
import type { ScheduleEventData } from '../../types';
|
|
5
|
+
export type ScheduleBackgroundEventResizeEdge = 'top' | 'bottom' | 'start' | 'end';
|
|
5
6
|
export interface ScheduleBackgroundEventOwnProps {
|
|
6
7
|
/** Background event to display. */
|
|
7
8
|
event: ScheduleEventData;
|
|
@@ -11,11 +12,22 @@ export interface ScheduleBackgroundEventOwnProps {
|
|
|
11
12
|
renderEvent?: RenderEvent;
|
|
12
13
|
/** Function to customize event body. */
|
|
13
14
|
renderEventBody?: RenderEventBody;
|
|
15
|
+
/** If set, resize handles are rendered on both edges. */
|
|
16
|
+
withResize?: boolean;
|
|
17
|
+
/** Axis along which the event is resized. @default 'vertical' */
|
|
18
|
+
resizeAxis?: 'vertical' | 'horizontal';
|
|
19
|
+
/** Props passed to both resize handles. */
|
|
20
|
+
resizeHandleProps?: Record<string, any>;
|
|
21
|
+
/** Whether this event is currently being resized. */
|
|
22
|
+
isResizing?: boolean;
|
|
23
|
+
/** Edge currently being dragged. */
|
|
24
|
+
activeResizeEdge?: ScheduleBackgroundEventResizeEdge | null;
|
|
14
25
|
}
|
|
15
26
|
export interface ScheduleBackgroundEventProps extends Omit<BoxProps, keyof ScheduleBackgroundEventOwnProps>, ScheduleBackgroundEventOwnProps {
|
|
16
27
|
}
|
|
17
28
|
export interface ScheduleBackgroundEventEmits {
|
|
18
29
|
eventClick: [event: ScheduleEventData, nativeEvent: MouseEvent];
|
|
30
|
+
resizeStart: [edge: ScheduleBackgroundEventResizeEdge, nativeEvent: PointerEvent];
|
|
19
31
|
}
|
|
20
32
|
export interface ScheduleBackgroundEventSlots {
|
|
21
33
|
default?: (props: {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ScheduleBackgroundEventOwnProps, ScheduleBackgroundEventSlots } from './ScheduleBackgroundEvent.types';
|
|
2
2
|
type __VLS_Slots = ScheduleBackgroundEventSlots;
|
|
3
3
|
declare const __VLS_base: import("vue").DefineComponent<ScheduleBackgroundEventOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
resizeStart: (edge: import("./ScheduleBackgroundEvent.types").ScheduleBackgroundEventResizeEdge, nativeEvent: PointerEvent) => any;
|
|
4
5
|
eventClick: (event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any;
|
|
5
6
|
}, string, import("vue").PublicProps, Readonly<ScheduleBackgroundEventOwnProps> & Readonly<{
|
|
7
|
+
onResizeStart?: ((edge: import("./ScheduleBackgroundEvent.types").ScheduleBackgroundEventResizeEdge, nativeEvent: PointerEvent) => any) | undefined;
|
|
6
8
|
onEventClick?: ((event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any) | undefined;
|
|
7
9
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,18 +2,18 @@ import type { CSSProperties, VNodeChild } from 'vue';
|
|
|
2
2
|
import type { BoxProps, Factory, ScrollAreaProps } from '@mantine-vue/core';
|
|
3
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
4
|
import type { EventSlots, ForwardedProps, TimeViewEmits, TimeViewOwnProps } from '../../component-props';
|
|
5
|
-
import type { DateLabelFormat, DateStringValue, DayOfWeek } from '../../types';
|
|
5
|
+
import type { DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventOverlapMode } from '../../types';
|
|
6
6
|
import type { CurrentTimeIndicatorStylesNames } from '../CurrentTimeIndicator/CurrentTimeIndicator.types';
|
|
7
7
|
import type { ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent.types';
|
|
8
8
|
import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
9
|
-
export type WeekViewOwnStylesNames = 'weekView' | 'weekViewRoot' | 'weekViewHeader' | 'weekViewInner' | 'weekViewAllDaySlotsEvents' | 'weekViewAllDaySlots' | 'weekViewAllDaySlotsList' | 'weekViewAllDaySlotsLabel' | 'weekViewScrollArea' | 'weekViewCorner' | 'weekViewSlotLabels' | 'weekViewSlotLabel' | 'weekViewDayLabel' | 'weekViewDayWeekday' | 'weekViewDay' | 'weekViewDayNumber' | 'weekViewDaySlot' | 'weekViewDaySlots' | 'weekViewWeekLabel' | 'weekViewWeekNumber' | 'weekViewBackgroundEvent';
|
|
9
|
+
export type WeekViewOwnStylesNames = 'weekView' | 'weekViewRoot' | 'weekViewHeader' | 'weekViewInner' | 'weekViewAllDaySlotsEvents' | 'weekViewAllDaySlots' | 'weekViewAllDaySlotsList' | 'weekViewAllDaySlotsLabel' | 'weekViewScrollArea' | 'weekViewCorner' | 'weekViewSlotLabels' | 'weekViewSlotLabel' | 'weekViewDayLabel' | 'weekViewDayWeekday' | 'weekViewDay' | 'weekViewDayNumber' | 'weekViewDaySlot' | 'weekViewDaySlots' | 'weekViewWeekLabel' | 'weekViewWeekNumber' | 'weekViewBackgroundEvent' | 'weekViewBackgroundEventResizeHandle';
|
|
10
10
|
/**
|
|
11
11
|
* `WeekView` forwards `classNames` and `styles` to the components it renders, so their
|
|
12
12
|
* selectors are part of its Styles API.
|
|
13
13
|
*/
|
|
14
14
|
export type WeekViewStylesNames = WeekViewOwnStylesNames | ScheduleEventStylesNames | CurrentTimeIndicatorStylesNames | CombinedScheduleHeaderStylesNames;
|
|
15
15
|
export type WeekViewCssVariables = {
|
|
16
|
-
weekView: '--week-view-radius' | '--week-view-slot-height' | '--week-view-all-day-slots-height';
|
|
16
|
+
weekView: '--week-view-radius' | '--week-view-slot-height' | '--week-view-all-day-slots-height' | '--event-raise-delay' | '--event-z-index' | '--event-z-index-raised';
|
|
17
17
|
};
|
|
18
18
|
/** Range covered by the label shown in the week header. */
|
|
19
19
|
export interface WeekLabelPayload {
|
|
@@ -31,6 +31,10 @@ export interface WeekViewSlots extends EventSlots {
|
|
|
31
31
|
}
|
|
32
32
|
/** Props declared by `WeekView` itself. See `WeekViewProps` for the full public type. */
|
|
33
33
|
export interface WeekViewOwnProps extends TimeViewOwnProps, StylesApiProps<WeekViewFactory> {
|
|
34
|
+
/** Determines how overlapping events are laid out. @default 'columns' */
|
|
35
|
+
eventOverlapMode?: ScheduleEventOverlapMode;
|
|
36
|
+
/** Time in ms before a hovered cascade event is raised above covering events. @default 600 */
|
|
37
|
+
eventOverlapRaiseDelay?: number;
|
|
34
38
|
/**
|
|
35
39
|
* Length of one time slot in minutes.
|
|
36
40
|
* @default 60
|
|
@@ -40,6 +40,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WeekVi
|
|
|
40
40
|
slotDragEnd: (rangeStart: string, rangeEnd: string) => any;
|
|
41
41
|
externalEventDrop: (dataTransfer: DataTransfer, dropDateTime: string) => any;
|
|
42
42
|
eventResize: (data: import("../..").EventDropData) => any;
|
|
43
|
+
eventPlacementRejected: (data: import("../..").ScheduleEventPlacementRejectedData) => any;
|
|
43
44
|
}, string, import("vue").PublicProps, Readonly<WeekViewOwnProps> & Readonly<{
|
|
44
45
|
onDateChange?: ((date: string) => any) | undefined;
|
|
45
46
|
onEventDragStart?: ((event: ScheduleEventData) => any) | undefined;
|
|
@@ -52,6 +53,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<WeekVi
|
|
|
52
53
|
onSlotDragEnd?: ((rangeStart: string, rangeEnd: string) => any) | undefined;
|
|
53
54
|
onExternalEventDrop?: ((dataTransfer: DataTransfer, dropDateTime: string) => any) | undefined;
|
|
54
55
|
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
56
|
+
onEventPlacementRejected?: ((data: import("../..").ScheduleEventPlacementRejectedData) => any) | undefined;
|
|
55
57
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, WeekViewSlots>;
|
|
56
58
|
type __VLS_WithSlots<T, S> = T & {
|
|
57
59
|
new (): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyDateValue, DateStringValue, DayOfWeek, ScheduleEventData, WeekPositionedEventData } from '../../../types';
|
|
1
|
+
import { AnyDateValue, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleEventOverlapMode, WeekPositionedEventData } from '../../../types';
|
|
2
2
|
export interface GetWeekPositionedEventsInput {
|
|
3
3
|
/** Date (week start) at which events are positioned, used to check if events are all-day */
|
|
4
4
|
date: AnyDateValue;
|
|
@@ -16,6 +16,8 @@ export interface GetWeekPositionedEventsInput {
|
|
|
16
16
|
weekendDays?: DayOfWeek[];
|
|
17
17
|
/** If set to false, weekend days are hidden @default true */
|
|
18
18
|
withWeekendDays?: boolean;
|
|
19
|
+
/** Determines how overlapping events are laid out. @default 'columns' */
|
|
20
|
+
eventOverlapMode?: ScheduleEventOverlapMode;
|
|
19
21
|
}
|
|
20
22
|
/** Events grouped by week day date (YYYY-MM-DD 00:00:00) and by columns */
|
|
21
23
|
export interface GroupedWeekEvents {
|
|
@@ -23,4 +25,4 @@ export interface GroupedWeekEvents {
|
|
|
23
25
|
regularEvents: Record<DateStringValue, WeekPositionedEventData[]>;
|
|
24
26
|
backgroundEvents: Record<DateStringValue, WeekPositionedEventData[]>;
|
|
25
27
|
}
|
|
26
|
-
export declare function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMinutes, firstDayOfWeek, weekendDays, withWeekendDays, }: GetWeekPositionedEventsInput): GroupedWeekEvents;
|
|
28
|
+
export declare function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMinutes, firstDayOfWeek, weekendDays, withWeekendDays, eventOverlapMode, }: GetWeekPositionedEventsInput): GroupedWeekEvents;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventDropData } from '../component-props';
|
|
2
|
-
import type { ScheduleEventData, ScheduleMode } from '../types';
|
|
2
|
+
import type { PreventEventOverlap, ScheduleCanResizeEventToData, ScheduleEventData, ScheduleEventPlacementRejectedData, ScheduleMode } from '../types';
|
|
3
3
|
type ResizeEdge = 'top' | 'bottom';
|
|
4
4
|
interface HandleResizeStartInput {
|
|
5
5
|
event: ScheduleEventData;
|
|
@@ -19,14 +19,22 @@ export interface UseEventResizeInput {
|
|
|
19
19
|
resizeIntervalMinutes?: () => number | undefined;
|
|
20
20
|
onEventResize: (data: EventDropData) => void;
|
|
21
21
|
canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined;
|
|
22
|
+
withBackgroundEvents?: () => boolean;
|
|
23
|
+
events?: () => ScheduleEventData[];
|
|
24
|
+
preventEventOverlap?: () => PreventEventOverlap | undefined;
|
|
25
|
+
canResizeEventTo?: () => ((data: ScheduleCanResizeEventToData) => boolean) | undefined;
|
|
26
|
+
onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;
|
|
22
27
|
}
|
|
23
28
|
export declare function useEventResize(input: UseEventResizeInput): {
|
|
24
29
|
handleResizeStart: ({ event, edge, container, originalTop, originalHeight, eventDate, pointerEvent, }: HandleResizeStartInput) => void;
|
|
25
|
-
|
|
30
|
+
isResizing: import("vue").ComputedRef<boolean>;
|
|
31
|
+
resizingEventId: import("vue").ComputedRef<string | number | null>;
|
|
32
|
+
getResizePosition: (eventId: string | number, eventDate?: string) => {
|
|
26
33
|
top: number;
|
|
27
34
|
height: number;
|
|
28
35
|
} | null;
|
|
29
36
|
isResizableEvent: (event: ScheduleEventData) => boolean;
|
|
30
37
|
wasResizing: () => boolean;
|
|
38
|
+
resizeValid: import("vue").ComputedRef<boolean>;
|
|
31
39
|
};
|
|
32
40
|
export {};
|