@mantine-vue/schedule 3.2.0 → 3.3.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 +755 -236
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +756 -238
- package/esm/index.mjs.map +1 -1
- package/lib/component-props.d.ts +15 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +6 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +8 -2
- package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +3 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +3 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +6 -0
- package/lib/components/Schedule/Schedule.types.d.ts +2 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +3 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.types.d.ts +24 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue.d.ts +15 -0
- package/lib/components/ScheduleBackgroundEvent/index.d.ts +1 -0
- package/lib/components/WeekView/get-week-view-events/find-available-column.d.ts +6 -3
- package/lib/components/YearView/YearView.d.ts +1 -0
- package/lib/components/YearView/YearView.types.d.ts +14 -1
- package/lib/components/YearView/YearView.vue.d.ts +9 -2
- package/lib/components/use-slot-drop-target.d.ts +4 -0
- package/lib/hooks/use-event-resize.d.ts +1 -0
- package/lib/hooks/use-horizontal-event-resize.d.ts +1 -0
- package/lib/index.d.mts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/types.d.ts +1 -1
- package/lib/utils/calculate-drop-time/calculate-drop-time.d.ts +11 -1
- package/package.json +4 -4
- package/styles.css +523 -370
- package/styles.layer.css +523 -370
package/lib/component-props.d.ts
CHANGED
|
@@ -98,6 +98,11 @@ export interface BaseViewOwnProps {
|
|
|
98
98
|
* @default 2000
|
|
99
99
|
*/
|
|
100
100
|
recurrenceExpansionLimit?: number;
|
|
101
|
+
/**
|
|
102
|
+
* If set, background events can be focused and clicked. Has no effect in static mode.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
withInteractiveBackgroundEvents?: boolean;
|
|
101
106
|
}
|
|
102
107
|
/**
|
|
103
108
|
* Props shared by the views that lay events out on a time axis. Not a component of its own:
|
|
@@ -116,6 +121,16 @@ export interface TimeViewOwnProps extends BaseViewOwnProps {
|
|
|
116
121
|
endTime?: string;
|
|
117
122
|
/** Length of one time slot in minutes. */
|
|
118
123
|
intervalMinutes?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Snap interval used when events are dragged, independent of `intervalMinutes`.
|
|
126
|
+
* Falls back to `intervalMinutes` when unset.
|
|
127
|
+
*/
|
|
128
|
+
eventDragInterval?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Snap interval used when events are resized, independent of `intervalMinutes`.
|
|
131
|
+
* Falls back to `intervalMinutes` when unset.
|
|
132
|
+
*/
|
|
133
|
+
eventResizeInterval?: number;
|
|
119
134
|
/**
|
|
120
135
|
* Format of the time slot labels.
|
|
121
136
|
* @default 'HH:mm'
|
|
@@ -127,6 +127,10 @@ export interface ResourcesDayViewOwnProps extends StylesApiProps<ResourcesDayVie
|
|
|
127
127
|
* @default 60
|
|
128
128
|
*/
|
|
129
129
|
intervalMinutes?: number;
|
|
130
|
+
/** Snap interval used when events are dragged, independent of `intervalMinutes`. */
|
|
131
|
+
eventDragInterval?: number;
|
|
132
|
+
/** Snap interval used when events are resized, independent of `intervalMinutes`. */
|
|
133
|
+
eventResizeInterval?: number;
|
|
130
134
|
/**
|
|
131
135
|
* Format of the time column labels.
|
|
132
136
|
* @default 'HH:mm'
|
|
@@ -214,6 +218,8 @@ export interface ResourcesDayViewOwnProps extends StylesApiProps<ResourcesDayVie
|
|
|
214
218
|
* precedence over the prop.
|
|
215
219
|
*/
|
|
216
220
|
renderEvent?: RenderEvent;
|
|
221
|
+
/** If set, background events can be focused and clicked. */
|
|
222
|
+
withInteractiveBackgroundEvents?: boolean;
|
|
217
223
|
/**
|
|
218
224
|
* Replaces the label of every resource row. Can also be set with the `resourceLabel` slot,
|
|
219
225
|
* which takes precedence over the prop.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import type { EventSlots, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
|
|
4
|
+
import type { EventSlots, EventDropData, ForwardedProps, NativeButtonProps, RenderEvent, RenderEventBody } from '../../component-props';
|
|
5
5
|
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
6
|
import type { DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup, ScheduleViewLevel } from '../../types';
|
|
7
7
|
import type { MoreEventsEmits, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents.types';
|
|
@@ -10,7 +10,7 @@ import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/Schedu
|
|
|
10
10
|
import type { MonthYearSelectEmits, MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect.types';
|
|
11
11
|
import type { ViewSelectEmits, ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect.types';
|
|
12
12
|
import type { ResourceExternalDropData, ResourceSlotDragEndData, ResourceViewDropData } from '../ResourcesDayView/ResourcesDayView.types';
|
|
13
|
-
export type ResourcesMonthViewOwnStylesNames = 'resourcesMonthView' | 'resourcesMonthViewRoot' | 'resourcesMonthViewInner' | 'resourcesMonthViewScrollArea' | 'resourcesMonthViewDayLabelsRow' | 'resourcesMonthViewDayLabel' | 'resourcesMonthViewDayLabelWeekday' | 'resourcesMonthViewDayLabelNumber' | 'resourcesMonthViewCorner' | 'resourcesMonthViewResourceLabel' | 'resourcesMonthViewRow' | 'resourcesMonthViewRowSlots' | 'resourcesMonthViewCell' | 'resourcesMonthViewGroupColumn' | 'resourcesMonthViewGroupColumnEmpty';
|
|
13
|
+
export type ResourcesMonthViewOwnStylesNames = 'resourcesMonthView' | 'resourcesMonthViewRoot' | 'resourcesMonthViewInner' | 'resourcesMonthViewScrollArea' | 'resourcesMonthViewDayLabelsRow' | 'resourcesMonthViewDayLabel' | 'resourcesMonthViewDayLabelWeekday' | 'resourcesMonthViewDayLabelNumber' | 'resourcesMonthViewCorner' | 'resourcesMonthViewResourceLabel' | 'resourcesMonthViewRow' | 'resourcesMonthViewRowSlots' | 'resourcesMonthViewCell' | 'resourcesMonthViewEventWrapper' | 'resourcesMonthViewResizeHandle' | 'resourcesMonthViewGroupColumn' | 'resourcesMonthViewGroupColumnEmpty';
|
|
14
14
|
/**
|
|
15
15
|
* `ResourcesMonthView` forwards `classNames` and `styles` to the components it renders, so
|
|
16
16
|
* their selectors are part of its Styles API.
|
|
@@ -166,6 +166,10 @@ export interface ResourcesMonthViewOwnProps extends StylesApiProps<ResourcesMont
|
|
|
166
166
|
* @default () => true
|
|
167
167
|
*/
|
|
168
168
|
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
169
|
+
/** If set, event start and end edges can be dragged across day cells. @default false */
|
|
170
|
+
withEventResize?: boolean;
|
|
171
|
+
/** Returns whether the given event may be resized. @default () => true */
|
|
172
|
+
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
169
173
|
/**
|
|
170
174
|
* If set, items dragged in from outside the schedule can be dropped on a day cell, which emits
|
|
171
175
|
* `externalEventDrop`. Enabling event drag and drop turns this on as well.
|
|
@@ -221,6 +225,8 @@ export interface ResourcesMonthViewEmits {
|
|
|
221
225
|
slotDragEnd: [data: ResourceSlotDragEndData];
|
|
222
226
|
/** Emitted when an item from outside the schedule is dropped. */
|
|
223
227
|
externalEventDrop: [data: ResourceExternalDropData];
|
|
228
|
+
/** Emitted when an event resize gesture completes. */
|
|
229
|
+
eventResize: [data: EventDropData];
|
|
224
230
|
}
|
|
225
231
|
export type ResourcesMonthViewFactory = Factory<{
|
|
226
232
|
props: Omit<ResourcesMonthViewProps, 'rootRef'>;
|
|
@@ -13,6 +13,7 @@ declare const defaultProps: {
|
|
|
13
13
|
mode: "default";
|
|
14
14
|
maxEventsPerTimeSlot: number;
|
|
15
15
|
recurrenceExpansionLimit: number;
|
|
16
|
+
withEventResize: false;
|
|
16
17
|
};
|
|
17
18
|
/** View levels the header offers – a resource schedule has no year view. */
|
|
18
19
|
declare const RESOURCE_VIEWS: readonly ["day", "week", "month"];
|
|
@@ -34,6 +35,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
34
35
|
eventDrop: (data: import("../ResourcesDayView").ResourceViewDropData) => any;
|
|
35
36
|
slotDragEnd: (data: import("../ResourcesDayView").ResourceSlotDragEndData) => any;
|
|
36
37
|
externalEventDrop: (data: import("../ResourcesDayView").ResourceExternalDropData) => any;
|
|
38
|
+
eventResize: (data: import("../..").EventDropData) => any;
|
|
37
39
|
}, string, import("vue").PublicProps, Readonly<ResourcesMonthViewOwnProps> & Readonly<{
|
|
38
40
|
onDateChange?: ((date: string) => any) | undefined;
|
|
39
41
|
onDayClick?: ((data: import("./ResourcesMonthView.types").ResourcesMonthViewDayClickData) => any) | undefined;
|
|
@@ -44,6 +46,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Resour
|
|
|
44
46
|
onEventDrop?: ((data: import("../ResourcesDayView").ResourceViewDropData) => any) | undefined;
|
|
45
47
|
onSlotDragEnd?: ((data: import("../ResourcesDayView").ResourceSlotDragEndData) => any) | undefined;
|
|
46
48
|
onExternalEventDrop?: ((data: import("../ResourcesDayView").ResourceExternalDropData) => any) | undefined;
|
|
49
|
+
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
47
50
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesMonthViewSlots>;
|
|
48
51
|
type __VLS_WithSlots<T, S> = T & {
|
|
49
52
|
new (): {
|
|
@@ -13,7 +13,7 @@ export type ResourcesScheduleOwnStylesNames = 'root';
|
|
|
13
13
|
/** `ResourcesSchedule` forwards `classNames` and `styles` to the view it renders. */
|
|
14
14
|
export type ResourcesScheduleStylesNames = ResourcesScheduleOwnStylesNames | ResourcesDayViewStylesNames | ResourcesWeekViewStylesNames | ResourcesMonthViewStylesNames;
|
|
15
15
|
/** Props `ResourcesSchedule` sets on every view itself, so a view-specific object cannot. */
|
|
16
|
-
type ResourcesScheduleCommonProps = 'date' | 'onDateChange' | 'resources' | 'events' | 'locale' | 'radius' | 'labels' | 'renderEventBody' | 'renderResourceLabel' | 'withEventsDragAndDrop' | 'onEventDrop' | 'canDragEvent' | 'onEventDragStart' | 'onEventDragEnd' | 'onTimeSlotClick' | 'onEventClick' | 'onDayClick' | 'withDragSlotSelect' | 'onSlotDragEnd' | 'onViewChange' | 'mode' | 'onExternalEventDrop' | 'withEventResize' | 'onEventResize' | 'canResizeEvent' | 'recurrenceExpansionLimit' | 'classNames' | 'styles' | 'unstyled' | 'rootRef';
|
|
16
|
+
type ResourcesScheduleCommonProps = 'date' | 'onDateChange' | 'resources' | 'events' | 'locale' | 'radius' | 'labels' | 'renderEventBody' | 'renderResourceLabel' | 'withEventsDragAndDrop' | 'onEventDrop' | 'canDragEvent' | 'onEventDragStart' | 'onEventDragEnd' | 'onTimeSlotClick' | 'onEventClick' | 'onDayClick' | 'withDragSlotSelect' | 'onSlotDragEnd' | 'onViewChange' | 'mode' | 'onExternalEventDrop' | 'withEventResize' | 'onEventResize' | 'canResizeEvent' | 'recurrenceExpansionLimit' | 'withInteractiveBackgroundEvents' | 'classNames' | 'styles' | 'unstyled' | 'rootRef';
|
|
17
17
|
/** View-specific props, with the ones the schedule owns removed. */
|
|
18
18
|
export type ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;
|
|
19
19
|
export interface ResourcesScheduleSlots extends EventSlots {
|
|
@@ -106,6 +106,8 @@ export interface ResourcesScheduleOwnProps extends StylesApiProps<ResourcesSched
|
|
|
106
106
|
* @default () => true
|
|
107
107
|
*/
|
|
108
108
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
109
|
+
/** If set, background events can be focused and clicked in day and week views. */
|
|
110
|
+
withInteractiveBackgroundEvents?: boolean;
|
|
109
111
|
/**
|
|
110
112
|
* Maximum number of instances generated per recurring series.
|
|
111
113
|
* @default 2000
|
|
@@ -106,6 +106,10 @@ export interface ResourcesWeekViewOwnProps extends StylesApiProps<ResourcesWeekV
|
|
|
106
106
|
* @default 60
|
|
107
107
|
*/
|
|
108
108
|
intervalMinutes?: number;
|
|
109
|
+
/** Snap interval used when events are dragged, independent of `intervalMinutes`. */
|
|
110
|
+
eventDragInterval?: number;
|
|
111
|
+
/** Snap interval used when events are resized, independent of `intervalMinutes`. */
|
|
112
|
+
eventResizeInterval?: number;
|
|
109
113
|
/**
|
|
110
114
|
* Format of the time column labels.
|
|
111
115
|
* @default 'HH:mm'
|
|
@@ -195,6 +199,8 @@ export interface ResourcesWeekViewOwnProps extends StylesApiProps<ResourcesWeekV
|
|
|
195
199
|
* precedence over the prop.
|
|
196
200
|
*/
|
|
197
201
|
renderEvent?: RenderEvent;
|
|
202
|
+
/** If set, background events can be focused and clicked. */
|
|
203
|
+
withInteractiveBackgroundEvents?: boolean;
|
|
198
204
|
/**
|
|
199
205
|
* Replaces the label of every resource row. Can also be set with the `resourceLabel` slot,
|
|
200
206
|
* which takes precedence over the prop.
|
|
@@ -88,6 +88,8 @@ export interface ScheduleOwnProps extends StylesApiProps<ScheduleFactory> {
|
|
|
88
88
|
* @default () => true
|
|
89
89
|
*/
|
|
90
90
|
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
91
|
+
/** If set, background events can be focused and clicked in day, week and month views. */
|
|
92
|
+
withInteractiveBackgroundEvents?: boolean;
|
|
91
93
|
/**
|
|
92
94
|
* Maximum number of instances generated per recurring series.
|
|
93
95
|
* @default 2000
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import ScheduleBackgroundEvent from './ScheduleBackgroundEvent.vue';
|
|
2
|
+
export { ScheduleBackgroundEvent };
|
|
3
|
+
export type { ScheduleBackgroundEventEmits, ScheduleBackgroundEventOwnProps, ScheduleBackgroundEventProps, ScheduleBackgroundEventSlots, } from './ScheduleBackgroundEvent.types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
import type { BoxProps } from '@mantine-vue/core';
|
|
3
|
+
import type { RenderEvent, RenderEventBody } from '../../component-props';
|
|
4
|
+
import type { ScheduleEventData } from '../../types';
|
|
5
|
+
export interface ScheduleBackgroundEventOwnProps {
|
|
6
|
+
/** Background event to display. */
|
|
7
|
+
event: ScheduleEventData;
|
|
8
|
+
/** If set, the root is a button and the event can be clicked. @default false */
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
/** Function to fully customize event rendering. */
|
|
11
|
+
renderEvent?: RenderEvent;
|
|
12
|
+
/** Function to customize event body. */
|
|
13
|
+
renderEventBody?: RenderEventBody;
|
|
14
|
+
}
|
|
15
|
+
export interface ScheduleBackgroundEventProps extends Omit<BoxProps, keyof ScheduleBackgroundEventOwnProps>, ScheduleBackgroundEventOwnProps {
|
|
16
|
+
}
|
|
17
|
+
export interface ScheduleBackgroundEventEmits {
|
|
18
|
+
eventClick: [event: ScheduleEventData, nativeEvent: MouseEvent];
|
|
19
|
+
}
|
|
20
|
+
export interface ScheduleBackgroundEventSlots {
|
|
21
|
+
default?: (props: {
|
|
22
|
+
event: ScheduleEventData;
|
|
23
|
+
}) => VNodeChild;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ScheduleBackgroundEventOwnProps, ScheduleBackgroundEventSlots } from './ScheduleBackgroundEvent.types';
|
|
2
|
+
type __VLS_Slots = ScheduleBackgroundEventSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<ScheduleBackgroundEventOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
eventClick: (event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<ScheduleBackgroundEventOwnProps> & Readonly<{
|
|
6
|
+
onEventClick?: ((event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ScheduleBackgroundEvent';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ScheduleEventData } from '../../../types';
|
|
2
|
+
export interface ColumnEvent {
|
|
3
|
+
event: ScheduleEventData;
|
|
4
|
+
allDay: boolean;
|
|
5
|
+
}
|
|
2
6
|
interface FindAvailableColumnInput {
|
|
3
|
-
columns: Map<string,
|
|
7
|
+
columns: Map<string, ColumnEvent[]>;
|
|
4
8
|
event: ScheduleEventData;
|
|
5
9
|
allDay: boolean;
|
|
6
|
-
allWeekDays: DateStringValue[];
|
|
7
10
|
}
|
|
8
11
|
export declare function findAvailableColumn(input: FindAvailableColumnInput): number;
|
|
9
12
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const YearView: import("@mantine-vue/core").MantineComponent<{
|
|
2
2
|
props: Omit<import("./YearView.types").YearViewProps, "rootRef">;
|
|
3
3
|
emits: import("./YearView.types").YearViewEmits;
|
|
4
|
+
slots: import("./YearView.types").YearViewSlots;
|
|
4
5
|
ref: HTMLDivElement;
|
|
5
6
|
element: "div";
|
|
6
7
|
stylesNames: import("./YearView.types").YearViewStylesNames;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
1
2
|
import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
2
3
|
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
3
4
|
import type { BaseViewEmits, BaseViewOwnProps, ForwardedProps, NativeButtonProps } from '../../component-props';
|
|
4
|
-
import type { DateLabelFormat, DateStringValue, DayOfWeek } from '../../types';
|
|
5
|
+
import type { DateLabelFormat, DateStringValue, DayOfWeek, ScheduleEventData } from '../../types';
|
|
5
6
|
import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
6
7
|
import type { MonthYearSelectEmits, MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect.types';
|
|
7
8
|
export type YearViewOwnStylesNames = 'yearView' | 'yearViewMonths' | 'yearViewMonth' | 'yearViewMonthCaption' | 'yearViewWeekdays' | 'yearViewWeekday' | 'yearViewWeekdaysCorner' | 'yearViewWeek' | 'yearViewWeekNumber' | 'yearViewDay' | 'yearViewDayIndicators' | 'yearViewDayIndicator';
|
|
@@ -30,6 +31,8 @@ export interface YearViewOwnProps extends BaseViewOwnProps, StylesApiProps<YearV
|
|
|
30
31
|
* @default [0, 6]
|
|
31
32
|
*/
|
|
32
33
|
weekendDays?: DayOfWeek[];
|
|
34
|
+
/** If set, weekend columns are displayed. @default true */
|
|
35
|
+
withWeekendDays?: boolean;
|
|
33
36
|
/**
|
|
34
37
|
* If set, week numbers are displayed in the first column of each month.
|
|
35
38
|
* @default false
|
|
@@ -62,11 +65,20 @@ export interface YearViewOwnProps extends BaseViewOwnProps, StylesApiProps<YearV
|
|
|
62
65
|
monthsListFormat?: DateLabelFormat;
|
|
63
66
|
/** Returns extra props for the control of the given day. */
|
|
64
67
|
getDayProps?: (date: DateStringValue) => NativeButtonProps;
|
|
68
|
+
/** Replaces the content of a day cell. Default event indicators are omitted when set. */
|
|
69
|
+
renderDay?: (date: DateStringValue, events: ScheduleEventData[]) => VNodeChild;
|
|
65
70
|
/** Returns extra props for the control of the week that starts on the given day. */
|
|
66
71
|
getWeekNumberProps?: (weekStartDate: DateStringValue) => NativeButtonProps;
|
|
67
72
|
/** Props passed to the year select in the header. */
|
|
68
73
|
monthYearSelectProps?: ForwardedProps<MonthYearSelectProps, MonthYearSelectEmits>;
|
|
69
74
|
}
|
|
75
|
+
export interface YearViewSlots {
|
|
76
|
+
/** Replaces the content of a day cell. */
|
|
77
|
+
day?: (props: {
|
|
78
|
+
date: DateStringValue;
|
|
79
|
+
events: ScheduleEventData[];
|
|
80
|
+
}) => VNodeChild;
|
|
81
|
+
}
|
|
70
82
|
export interface YearViewProps extends Omit<BoxProps, keyof YearViewOwnProps>, YearViewOwnProps {
|
|
71
83
|
}
|
|
72
84
|
export interface YearViewEmits extends BaseViewEmits {
|
|
@@ -80,6 +92,7 @@ export interface YearViewEmits extends BaseViewEmits {
|
|
|
80
92
|
export type YearViewFactory = Factory<{
|
|
81
93
|
props: Omit<YearViewProps, 'rootRef'>;
|
|
82
94
|
emits: YearViewEmits;
|
|
95
|
+
slots: YearViewSlots;
|
|
83
96
|
ref: HTMLDivElement;
|
|
84
97
|
element: 'div';
|
|
85
98
|
stylesNames: YearViewStylesNames;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ScheduleEventData } from '../../types';
|
|
2
|
+
import type { YearViewSlots } from './YearView.types';
|
|
2
3
|
import type { YearViewOwnProps } from './YearView.types';
|
|
3
4
|
declare const defaultProps: {
|
|
4
5
|
mode: "default";
|
|
@@ -7,6 +8,7 @@ declare const defaultProps: {
|
|
|
7
8
|
firstDayOfWeek: 1;
|
|
8
9
|
weekdayFormat: string;
|
|
9
10
|
weekendDays: (0 | 6)[];
|
|
11
|
+
withWeekendDays: true;
|
|
10
12
|
withWeekDays: true;
|
|
11
13
|
highlightToday: true;
|
|
12
14
|
withOutsideDays: true;
|
|
@@ -18,7 +20,7 @@ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, pr
|
|
|
18
20
|
export { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS };
|
|
19
21
|
declare const _default: typeof __VLS_export;
|
|
20
22
|
export default _default;
|
|
21
|
-
declare const __VLS_export: import("vue").DefineComponent<YearViewOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<YearViewOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
24
|
dateChange: (date: string) => any;
|
|
23
25
|
dayClick: (date: string, nativeEvent: MouseEvent) => any;
|
|
24
26
|
eventClick: (event: ScheduleEventData, nativeEvent: MouseEvent) => any;
|
|
@@ -32,4 +34,9 @@ declare const __VLS_export: import("vue").DefineComponent<YearViewOwnProps, {},
|
|
|
32
34
|
onViewChange?: ((view: import("../..").ScheduleViewLevel) => any) | undefined;
|
|
33
35
|
onWeekNumberClick?: ((date: string, nativeEvent: MouseEvent) => any) | undefined;
|
|
34
36
|
onMonthClick?: ((month: string) => any) | undefined;
|
|
35
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, YearViewSlots>;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -10,6 +10,10 @@ export interface ResolveSlotInput {
|
|
|
10
10
|
container: HTMLElement | null | undefined;
|
|
11
11
|
date: DateStringValue;
|
|
12
12
|
intervals: SlotDropInterval[];
|
|
13
|
+
intervalMinutes?: number;
|
|
14
|
+
dragIntervalMinutes?: number;
|
|
15
|
+
startTime?: string;
|
|
16
|
+
endTime?: string;
|
|
13
17
|
}
|
|
14
18
|
export interface ResolvedSlotDrop {
|
|
15
19
|
slotIndex: number;
|
|
@@ -16,6 +16,7 @@ export interface UseEventResizeInput {
|
|
|
16
16
|
startTime: () => string;
|
|
17
17
|
endTime: () => string;
|
|
18
18
|
intervalMinutes: () => number;
|
|
19
|
+
resizeIntervalMinutes?: () => number | undefined;
|
|
19
20
|
onEventResize: (data: EventDropData) => void;
|
|
20
21
|
canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined;
|
|
21
22
|
}
|
|
@@ -21,6 +21,7 @@ export declare function useHorizontalEventResize(input: {
|
|
|
21
21
|
startTime: () => string;
|
|
22
22
|
endTime: () => string;
|
|
23
23
|
intervalMinutes: () => number;
|
|
24
|
+
resizeIntervalMinutes?: () => number | undefined;
|
|
24
25
|
onEventResize: (data: EventDropData) => void;
|
|
25
26
|
canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined;
|
|
26
27
|
}): {
|
package/lib/index.d.mts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './components/ResourcesWeekView';
|
|
|
13
13
|
export * from './components/ResourcesMonthView';
|
|
14
14
|
export * from './components/ResourcesSchedule';
|
|
15
15
|
export * from './components/ScheduleEvent';
|
|
16
|
+
export * from './components/ScheduleBackgroundEvent';
|
|
16
17
|
export * from './components/ScheduleHeader';
|
|
17
18
|
export * from './components/CurrentTimeIndicator';
|
|
18
19
|
export * from './components/MoreEvents';
|
package/lib/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './components/ResourcesWeekView';
|
|
|
13
13
|
export * from './components/ResourcesMonthView';
|
|
14
14
|
export * from './components/ResourcesSchedule';
|
|
15
15
|
export * from './components/ScheduleEvent';
|
|
16
|
+
export * from './components/ScheduleBackgroundEvent';
|
|
16
17
|
export * from './components/ScheduleHeader';
|
|
17
18
|
export * from './components/CurrentTimeIndicator';
|
|
18
19
|
export * from './components/MoreEvents';
|
package/lib/types.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ interface ScheduleEventBase<Payload extends EventPayload = EventPayload> {
|
|
|
63
63
|
color: MantineColor;
|
|
64
64
|
/** Event variant, default is `'light'` */
|
|
65
65
|
variant?: 'filled' | 'light';
|
|
66
|
-
/** Event display mode. Background events render
|
|
66
|
+
/** Event display mode. Background events render behind regular events and are non-interactive unless the view enables interactive background events. @default 'default' */
|
|
67
67
|
display?: 'default' | 'background';
|
|
68
68
|
/** Additional event data, defined by the user, not used internally by the library */
|
|
69
69
|
payload?: Payload;
|
|
@@ -12,6 +12,16 @@ export interface CalculateDropTimeInput {
|
|
|
12
12
|
slotHeight?: number;
|
|
13
13
|
/** Minutes per slot */
|
|
14
14
|
intervalMinutes?: number;
|
|
15
|
+
/** Pointer offset along the time axis within the target slot, in px. */
|
|
16
|
+
slotOffset?: number;
|
|
17
|
+
/** Size of the target slot along the time axis, in px. */
|
|
18
|
+
slotSize?: number;
|
|
19
|
+
/** Snap step for the resulting start time, in minutes. */
|
|
20
|
+
dragIntervalMinutes?: number;
|
|
21
|
+
/** Start time boundary of the schedule in HH:mm:ss format. */
|
|
22
|
+
startTime?: string;
|
|
23
|
+
/** End time boundary of the schedule in HH:mm:ss format. */
|
|
24
|
+
endTime?: string;
|
|
15
25
|
}
|
|
16
26
|
export interface CalculateDropTimeResult {
|
|
17
27
|
/** New start date/time for the event */
|
|
@@ -19,4 +29,4 @@ export interface CalculateDropTimeResult {
|
|
|
19
29
|
/** New end date/time for the event */
|
|
20
30
|
end: Date;
|
|
21
31
|
}
|
|
22
|
-
export declare function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset, slotHeight, intervalMinutes, }: CalculateDropTimeInput): CalculateDropTimeResult;
|
|
32
|
+
export declare function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset, slotHeight, intervalMinutes, slotOffset, slotSize, dragIntervalMinutes, startTime, endTime, }: CalculateDropTimeInput): CalculateDropTimeResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine-vue/schedule",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Vue schedule and calendar components equivalent to @mantine/schedule",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"vue": "^3.5.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@mantine-vue/core": "3.
|
|
48
|
-
"@mantine-vue/dates": "3.
|
|
49
|
-
"@mantine-vue/hooks": "3.
|
|
47
|
+
"@mantine-vue/core": "3.3.0",
|
|
48
|
+
"@mantine-vue/dates": "3.3.0",
|
|
49
|
+
"@mantine-vue/hooks": "3.3.0",
|
|
50
50
|
"dayjs": ">=1.0.0",
|
|
51
51
|
"vue": "^3.5.0"
|
|
52
52
|
}
|