@mantine-vue/schedule 3.0.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.
- package/cjs/index.cjs +6101 -3638
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +6045 -3632
- package/esm/index.mjs.map +1 -1
- package/lib/component-props.d.ts +181 -214
- package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +8 -114
- package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.types.d.ts +89 -0
- package/lib/components/CurrentTimeIndicator/CurrentTimeIndicator.vue.d.ts +20 -0
- package/lib/components/DayView/DayView.d.ts +10 -212
- package/lib/components/DayView/DayView.types.d.ts +65 -0
- package/lib/components/DayView/DayView.vue.d.ts +51 -0
- package/lib/components/DragContext/DragContext.d.ts +43 -5
- package/lib/components/MobileMonthView/MobileMonthView.d.ts +10 -171
- package/lib/components/MobileMonthView/MobileMonthView.types.d.ts +110 -0
- package/lib/components/MobileMonthView/MobileMonthView.vue.d.ts +44 -0
- package/lib/components/MonthView/MonthView.d.ts +10 -174
- package/lib/components/MonthView/MonthView.types.d.ts +125 -0
- package/lib/components/MonthView/MonthView.vue.d.ts +56 -0
- package/lib/components/MoreEvents/MoreEvents.d.ts +9 -65
- package/lib/components/MoreEvents/MoreEvents.types.d.ts +62 -0
- package/lib/components/MoreEvents/MoreEvents.vue.d.ts +23 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +10 -346
- package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +308 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.vue.d.ts +53 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +10 -279
- package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +233 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +52 -0
- package/lib/components/ResourcesMonthView/get-resources-month-view-layout/get-resources-month-view-layout.d.ts +54 -0
- package/lib/components/ResourcesMonthView/index.d.ts +1 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +9 -201
- package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +159 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.vue.d.ts +44 -0
- package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +10 -412
- package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +314 -0
- package/lib/components/ResourcesWeekView/ResourcesWeekView.vue.d.ts +58 -0
- package/lib/components/Schedule/Schedule.d.ts +9 -134
- package/lib/components/Schedule/Schedule.types.d.ts +153 -0
- package/lib/components/Schedule/Schedule.vue.d.ts +50 -0
- package/lib/components/ScheduleEvent/ScheduleEvent.d.ts +11 -88
- package/lib/components/ScheduleEvent/ScheduleEvent.types.d.ts +109 -0
- package/lib/components/ScheduleEvent/ScheduleEvent.vue.d.ts +24 -0
- package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.d.ts +36 -0
- package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.types.d.ts +44 -0
- package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.vue.d.ts +14 -0
- package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue.d.ts +11 -0
- package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue.d.ts +11 -0
- package/lib/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue.d.ts +11 -0
- package/lib/components/ScheduleHeader/HeaderControl/index.d.ts +1 -2
- package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.d.ts +8 -0
- package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.types.d.ts +70 -0
- package/lib/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue.d.ts +21 -0
- package/lib/components/ScheduleHeader/MonthYearSelect/index.d.ts +1 -2
- package/lib/components/ScheduleHeader/ScheduleHeader.context.d.ts +12 -0
- package/lib/components/ScheduleHeader/ScheduleHeader.d.ts +20 -364
- package/lib/components/ScheduleHeader/ScheduleHeader.types.d.ts +28 -0
- package/lib/components/ScheduleHeader/ScheduleHeader.vue.d.ts +11 -0
- package/lib/components/ScheduleHeader/ScheduleHeaderBase.d.ts +37 -75
- package/lib/components/ScheduleHeader/ScheduleHeaderBase.types.d.ts +54 -0
- package/lib/components/ScheduleHeader/ScheduleHeaderBase.vue.d.ts +21 -0
- package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.d.ts +8 -0
- package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.types.d.ts +39 -0
- package/lib/components/ScheduleHeader/ViewSelect/ViewSelect.vue.d.ts +16 -0
- package/lib/components/ScheduleHeader/ViewSelect/index.d.ts +1 -2
- package/lib/components/ScheduleHeader/index.d.ts +4 -0
- package/lib/components/WeekView/WeekView.d.ts +10 -294
- package/lib/components/WeekView/WeekView.types.d.ts +129 -0
- package/lib/components/WeekView/WeekView.vue.d.ts +60 -0
- package/lib/components/YearView/YearView.d.ts +9 -151
- package/lib/components/YearView/YearView.types.d.ts +87 -0
- package/lib/components/YearView/YearView.vue.d.ts +35 -0
- package/lib/components/shared.d.ts +71 -141
- package/lib/components/use-slot-drag-select.d.ts +7 -9
- package/lib/components/use-slot-drop-target.d.ts +38 -0
- package/lib/hooks/use-event-resize.d.ts +1 -1
- package/lib/hooks/use-horizontal-event-resize.d.ts +2 -156
- package/lib/index.d.mts +1 -0
- package/lib/index.d.ts +1 -0
- package/package.json +4 -4
- package/styles.css +44 -54
- package/styles.layer.css +44 -54
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DateStringValue, ScheduleEventData } from '../../../types';
|
|
2
|
+
/** One day cell of a resource row: the events that fit, and how many did not. */
|
|
3
|
+
export interface ResourcesMonthViewCellLayout {
|
|
4
|
+
/** Events that fit into the cell, with the row they occupy. */
|
|
5
|
+
visible: Array<{
|
|
6
|
+
event: ScheduleEventData;
|
|
7
|
+
row: number;
|
|
8
|
+
}>;
|
|
9
|
+
/** Number of events that did not fit. */
|
|
10
|
+
hiddenCount: number;
|
|
11
|
+
}
|
|
12
|
+
/** A multi-day event bar spanning a run of consecutive day columns on one row. */
|
|
13
|
+
export interface ResourcesMonthViewSegment {
|
|
14
|
+
event: ScheduleEventData;
|
|
15
|
+
/** Index of the first day column the bar covers. */
|
|
16
|
+
start: number;
|
|
17
|
+
/** Index of the last day column the bar covers. */
|
|
18
|
+
end: number;
|
|
19
|
+
/** Row the bar occupies inside the cells it covers. */
|
|
20
|
+
row: number;
|
|
21
|
+
/** Which ends of the bar continue outside the displayed month. */
|
|
22
|
+
hanging: 'start' | 'end' | 'both' | 'none';
|
|
23
|
+
/** Whether any covered cell also hides events, which shortens the bar. */
|
|
24
|
+
hidden: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ResourcesMonthViewRowLayout {
|
|
27
|
+
/** Events of the resource per day column, sorted the way they are laid out. */
|
|
28
|
+
eventsByDay: ScheduleEventData[][];
|
|
29
|
+
/** Layout of every day cell of the row. */
|
|
30
|
+
layouts: ResourcesMonthViewCellLayout[];
|
|
31
|
+
/** Multi-day bars of the row. */
|
|
32
|
+
segments: ResourcesMonthViewSegment[];
|
|
33
|
+
}
|
|
34
|
+
export interface GetResourcesMonthViewLayoutInput {
|
|
35
|
+
/** Day columns of the month, `YYYY-MM-DD`. */
|
|
36
|
+
days: DateStringValue[];
|
|
37
|
+
/** Events already expanded for the displayed month. */
|
|
38
|
+
events: ScheduleEventData[] | undefined;
|
|
39
|
+
/** Resource the row belongs to. */
|
|
40
|
+
resourceId: string | number;
|
|
41
|
+
/** Number of event rows a cell can show before the rest collapse into a "more" control. */
|
|
42
|
+
maxRows: number;
|
|
43
|
+
}
|
|
44
|
+
/** An event is multi-day when it ends on a later calendar day than it starts. */
|
|
45
|
+
export declare function isMultiDayEvent(event: ScheduleEventData): boolean;
|
|
46
|
+
/** Longer events come first, then earlier ones, so bars stack predictably. */
|
|
47
|
+
export declare function compareMonthEvents(a: ScheduleEventData, b: ScheduleEventData): number;
|
|
48
|
+
/**
|
|
49
|
+
* Lays out one resource row of the month grid.
|
|
50
|
+
*
|
|
51
|
+
* Each event keeps the row it was given on the previous day whenever that row is still free,
|
|
52
|
+
* so a multi-day event forms an unbroken bar instead of stepping between rows.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getResourcesMonthViewLayout({ days, events, resourceId, maxRows, }: GetResourcesMonthViewLayoutInput): ResourcesMonthViewRowLayout;
|
|
@@ -1,201 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
export type
|
|
10
|
-
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';
|
|
11
|
-
/** View-specific props with the shared/common props removed */
|
|
12
|
-
export type ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;
|
|
13
|
-
export interface ResourcesScheduleProps {
|
|
14
|
-
/** List of resources to display */
|
|
15
|
-
resources: ScheduleResourceData[];
|
|
16
|
-
/** Current date to display (controlled) */
|
|
17
|
-
date?: Date | DateStringValue;
|
|
18
|
-
/** Default date (uncontrolled) */
|
|
19
|
-
defaultDate?: Date | DateStringValue;
|
|
20
|
-
/** Called when date changes via navigation */
|
|
21
|
-
onDateChange?: (date: DateStringValue) => void;
|
|
22
|
-
/** Current view level (controlled) */
|
|
23
|
-
view?: ResourcesScheduleViewLevel;
|
|
24
|
-
/** Default view level (uncontrolled) @default 'day' */
|
|
25
|
-
defaultView?: ResourcesScheduleViewLevel;
|
|
26
|
-
/** Called when view level changes */
|
|
27
|
-
onViewChange?: (view: ResourcesScheduleViewLevel) => void;
|
|
28
|
-
/** Events to display across all views */
|
|
29
|
-
events?: ScheduleEventData[];
|
|
30
|
-
/** Locale for date formatting */
|
|
31
|
-
locale?: string;
|
|
32
|
-
/** Key of theme.radius or any valid CSS value to set border-radius */
|
|
33
|
-
radius?: string | number;
|
|
34
|
-
/** Labels override for i18n */
|
|
35
|
-
labels?: ScheduleLabelsOverride;
|
|
36
|
-
/** Custom event body renderer */
|
|
37
|
-
renderEventBody?: RenderEventBody;
|
|
38
|
-
/** Custom resource label renderer */
|
|
39
|
-
renderResourceLabel?: (resource: ScheduleResourceData) => VNodeChild;
|
|
40
|
-
/** Enable drag and drop for events @default false */
|
|
41
|
-
withEventsDragAndDrop?: boolean;
|
|
42
|
-
/** Called when event is dropped */
|
|
43
|
-
onEventDrop?: ResourcesDayViewProps['onEventDrop'];
|
|
44
|
-
/** Function to determine if event can be dragged */
|
|
45
|
-
canDragEvent?: ResourcesDayViewProps['canDragEvent'];
|
|
46
|
-
/** Called when any event drag starts */
|
|
47
|
-
onEventDragStart?: ResourcesDayViewProps['onEventDragStart'];
|
|
48
|
-
/** Called when any event drag ends */
|
|
49
|
-
onEventDragEnd?: ResourcesDayViewProps['onEventDragEnd'];
|
|
50
|
-
/** Called when time slot is clicked (day/week views) */
|
|
51
|
-
onTimeSlotClick?: ResourcesDayViewProps['onTimeSlotClick'];
|
|
52
|
-
/** Called when day is clicked in month view */
|
|
53
|
-
onDayClick?: ResourcesMonthViewProps['onDayClick'];
|
|
54
|
-
/** Called when event is clicked */
|
|
55
|
-
onEventClick?: ResourcesDayViewProps['onEventClick'];
|
|
56
|
-
/** If set, enables drag-to-select slot ranges @default false */
|
|
57
|
-
withDragSlotSelect?: boolean;
|
|
58
|
-
/** Called when a slot range is selected by dragging */
|
|
59
|
-
onSlotDragEnd?: ResourcesDayViewProps['onSlotDragEnd'];
|
|
60
|
-
/** Interaction mode @default 'default' */
|
|
61
|
-
mode?: ScheduleMode;
|
|
62
|
-
/** Called when an external item is dropped onto the schedule */
|
|
63
|
-
onExternalEventDrop?: ResourcesDayViewProps['onExternalEventDrop'];
|
|
64
|
-
/** If true, events can be resized (day/week views) @default false */
|
|
65
|
-
withEventResize?: boolean;
|
|
66
|
-
/** Called when event is resized */
|
|
67
|
-
onEventResize?: ResourcesDayViewProps['onEventResize'];
|
|
68
|
-
/** Function to determine if event can be resized */
|
|
69
|
-
canResizeEvent?: ResourcesDayViewProps['canResizeEvent'];
|
|
70
|
-
/** Max number of generated recurring instances @default 2000 */
|
|
71
|
-
recurrenceExpansionLimit?: number;
|
|
72
|
-
/** Props specific to ResourcesDayView */
|
|
73
|
-
dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;
|
|
74
|
-
/** Props specific to ResourcesWeekView */
|
|
75
|
-
weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;
|
|
76
|
-
/** Props specific to ResourcesMonthView */
|
|
77
|
-
monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;
|
|
78
|
-
}
|
|
79
|
-
export interface ResourcesScheduleSlots {
|
|
80
|
-
/** Scoped alternative to the `renderResourceLabel` prop */
|
|
81
|
-
resourceLabel?: (props: {
|
|
82
|
-
resource: ScheduleResourceData;
|
|
83
|
-
}) => VNodeChild;
|
|
84
|
-
/** Scoped alternative to the `renderGroupLabel` view prop */
|
|
85
|
-
groupLabel?: (props: {
|
|
86
|
-
group: ScheduleResourceGroup;
|
|
87
|
-
}) => VNodeChild;
|
|
88
|
-
/** Content rendered in the top-left corner of the grid */
|
|
89
|
-
corner?: (props: {
|
|
90
|
-
resources: ScheduleResourceData[];
|
|
91
|
-
}) => VNodeChild;
|
|
92
|
-
/** Scoped alternative to the `renderEventBody` prop */
|
|
93
|
-
eventBody?: (props: {
|
|
94
|
-
event: ScheduleEventData;
|
|
95
|
-
}) => VNodeChild;
|
|
96
|
-
/** Scoped alternative to the `renderEvent` view prop */
|
|
97
|
-
event?: (props: Record<string, unknown> & {
|
|
98
|
-
event: ScheduleEventData;
|
|
99
|
-
}) => VNodeChild;
|
|
100
|
-
}
|
|
101
|
-
export declare const ResourcesSchedule: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
102
|
-
resources: {
|
|
103
|
-
type: PropType<ScheduleResourceData[]>;
|
|
104
|
-
required: true;
|
|
105
|
-
};
|
|
106
|
-
date: PropType<Date | DateStringValue>;
|
|
107
|
-
defaultDate: PropType<Date | DateStringValue>;
|
|
108
|
-
onDateChange: PropType<(date: DateStringValue) => void>;
|
|
109
|
-
view: PropType<ResourcesScheduleViewLevel>;
|
|
110
|
-
defaultView: {
|
|
111
|
-
type: PropType<ResourcesScheduleViewLevel>;
|
|
112
|
-
default: string;
|
|
113
|
-
};
|
|
114
|
-
onViewChange: PropType<(view: ResourcesScheduleViewLevel) => void>;
|
|
115
|
-
events: PropType<ScheduleEventData[]>;
|
|
116
|
-
locale: StringConstructor;
|
|
117
|
-
radius: PropType<string | number>;
|
|
118
|
-
labels: PropType<ScheduleLabelsOverride>;
|
|
119
|
-
renderEventBody: PropType<RenderEventBody>;
|
|
120
|
-
renderResourceLabel: PropType<ResourcesScheduleProps["renderResourceLabel"]>;
|
|
121
|
-
withEventsDragAndDrop: BooleanConstructor;
|
|
122
|
-
onEventDrop: PropType<ResourcesScheduleProps["onEventDrop"]>;
|
|
123
|
-
canDragEvent: PropType<ResourcesScheduleProps["canDragEvent"]>;
|
|
124
|
-
onEventDragStart: PropType<ResourcesScheduleProps["onEventDragStart"]>;
|
|
125
|
-
onEventDragEnd: PropType<ResourcesScheduleProps["onEventDragEnd"]>;
|
|
126
|
-
onTimeSlotClick: PropType<ResourcesScheduleProps["onTimeSlotClick"]>;
|
|
127
|
-
onDayClick: PropType<ResourcesScheduleProps["onDayClick"]>;
|
|
128
|
-
onEventClick: PropType<ResourcesScheduleProps["onEventClick"]>;
|
|
129
|
-
withDragSlotSelect: BooleanConstructor;
|
|
130
|
-
onSlotDragEnd: PropType<ResourcesScheduleProps["onSlotDragEnd"]>;
|
|
131
|
-
mode: {
|
|
132
|
-
type: PropType<ScheduleMode>;
|
|
133
|
-
default: string;
|
|
134
|
-
};
|
|
135
|
-
onExternalEventDrop: PropType<ResourcesScheduleProps["onExternalEventDrop"]>;
|
|
136
|
-
withEventResize: BooleanConstructor;
|
|
137
|
-
onEventResize: PropType<ResourcesScheduleProps["onEventResize"]>;
|
|
138
|
-
canResizeEvent: PropType<ResourcesScheduleProps["canResizeEvent"]>;
|
|
139
|
-
recurrenceExpansionLimit: {
|
|
140
|
-
type: NumberConstructor;
|
|
141
|
-
default: number;
|
|
142
|
-
};
|
|
143
|
-
dayViewProps: PropType<ResourcesScheduleViewProps<ResourcesDayViewProps>>;
|
|
144
|
-
weekViewProps: PropType<ResourcesScheduleViewProps<ResourcesWeekViewProps>>;
|
|
145
|
-
monthViewProps: PropType<ResourcesScheduleViewProps<ResourcesMonthViewProps>>;
|
|
146
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
147
|
-
[key: string]: any;
|
|
148
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
-
resources: {
|
|
150
|
-
type: PropType<ScheduleResourceData[]>;
|
|
151
|
-
required: true;
|
|
152
|
-
};
|
|
153
|
-
date: PropType<Date | DateStringValue>;
|
|
154
|
-
defaultDate: PropType<Date | DateStringValue>;
|
|
155
|
-
onDateChange: PropType<(date: DateStringValue) => void>;
|
|
156
|
-
view: PropType<ResourcesScheduleViewLevel>;
|
|
157
|
-
defaultView: {
|
|
158
|
-
type: PropType<ResourcesScheduleViewLevel>;
|
|
159
|
-
default: string;
|
|
160
|
-
};
|
|
161
|
-
onViewChange: PropType<(view: ResourcesScheduleViewLevel) => void>;
|
|
162
|
-
events: PropType<ScheduleEventData[]>;
|
|
163
|
-
locale: StringConstructor;
|
|
164
|
-
radius: PropType<string | number>;
|
|
165
|
-
labels: PropType<ScheduleLabelsOverride>;
|
|
166
|
-
renderEventBody: PropType<RenderEventBody>;
|
|
167
|
-
renderResourceLabel: PropType<ResourcesScheduleProps["renderResourceLabel"]>;
|
|
168
|
-
withEventsDragAndDrop: BooleanConstructor;
|
|
169
|
-
onEventDrop: PropType<ResourcesScheduleProps["onEventDrop"]>;
|
|
170
|
-
canDragEvent: PropType<ResourcesScheduleProps["canDragEvent"]>;
|
|
171
|
-
onEventDragStart: PropType<ResourcesScheduleProps["onEventDragStart"]>;
|
|
172
|
-
onEventDragEnd: PropType<ResourcesScheduleProps["onEventDragEnd"]>;
|
|
173
|
-
onTimeSlotClick: PropType<ResourcesScheduleProps["onTimeSlotClick"]>;
|
|
174
|
-
onDayClick: PropType<ResourcesScheduleProps["onDayClick"]>;
|
|
175
|
-
onEventClick: PropType<ResourcesScheduleProps["onEventClick"]>;
|
|
176
|
-
withDragSlotSelect: BooleanConstructor;
|
|
177
|
-
onSlotDragEnd: PropType<ResourcesScheduleProps["onSlotDragEnd"]>;
|
|
178
|
-
mode: {
|
|
179
|
-
type: PropType<ScheduleMode>;
|
|
180
|
-
default: string;
|
|
181
|
-
};
|
|
182
|
-
onExternalEventDrop: PropType<ResourcesScheduleProps["onExternalEventDrop"]>;
|
|
183
|
-
withEventResize: BooleanConstructor;
|
|
184
|
-
onEventResize: PropType<ResourcesScheduleProps["onEventResize"]>;
|
|
185
|
-
canResizeEvent: PropType<ResourcesScheduleProps["canResizeEvent"]>;
|
|
186
|
-
recurrenceExpansionLimit: {
|
|
187
|
-
type: NumberConstructor;
|
|
188
|
-
default: number;
|
|
189
|
-
};
|
|
190
|
-
dayViewProps: PropType<ResourcesScheduleViewProps<ResourcesDayViewProps>>;
|
|
191
|
-
weekViewProps: PropType<ResourcesScheduleViewProps<ResourcesWeekViewProps>>;
|
|
192
|
-
monthViewProps: PropType<ResourcesScheduleViewProps<ResourcesMonthViewProps>>;
|
|
193
|
-
}>> & Readonly<{}>, {
|
|
194
|
-
mode: ScheduleMode;
|
|
195
|
-
recurrenceExpansionLimit: number;
|
|
196
|
-
defaultView: ResourcesScheduleViewLevel;
|
|
197
|
-
withEventsDragAndDrop: boolean;
|
|
198
|
-
withDragSlotSelect: boolean;
|
|
199
|
-
withEventResize: boolean;
|
|
200
|
-
}, SlotsType<ResourcesScheduleSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
201
|
-
export {};
|
|
1
|
+
export declare const ResourcesSchedule: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./ResourcesSchedule.types").ResourcesScheduleProps, "rootRef">;
|
|
3
|
+
slots: import("./ResourcesSchedule.types").ResourcesScheduleSlots;
|
|
4
|
+
emits: import("./ResourcesSchedule.types").ResourcesScheduleEmits;
|
|
5
|
+
ref: HTMLDivElement;
|
|
6
|
+
element: "div";
|
|
7
|
+
stylesNames: import("./ResourcesSchedule.types").ResourcesScheduleStylesNames;
|
|
8
|
+
}>;
|
|
9
|
+
export type { ResourcesScheduleEmits, ResourcesScheduleFactory, ResourcesScheduleOwnProps, ResourcesScheduleOwnStylesNames, ResourcesScheduleProps, ResourcesScheduleSlots, ResourcesScheduleStylesNames, ResourcesScheduleViewLevel, ResourcesScheduleViewProps, } from './ResourcesSchedule.types';
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
3
|
+
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
4
|
+
import type { EventDropData, EventSlots, RenderEventBody } from '../../component-props';
|
|
5
|
+
import type { ScheduleLabelsOverride } from '../../labels';
|
|
6
|
+
import type { DateStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';
|
|
7
|
+
import type { ResourceExternalDropData, ResourceSlotDragEndData, ResourceTimeSlotClickData, ResourceViewDropData, ResourcesDayViewProps, ResourcesDayViewStylesNames } from '../ResourcesDayView/ResourcesDayView.types';
|
|
8
|
+
import type { ResourcesMonthViewDayClickData, ResourcesMonthViewProps, ResourcesMonthViewStylesNames } from '../ResourcesMonthView/ResourcesMonthView.types';
|
|
9
|
+
import type { ResourcesWeekViewProps, ResourcesWeekViewStylesNames } from '../ResourcesWeekView/ResourcesWeekView.types';
|
|
10
|
+
/** View levels `ResourcesSchedule` can switch between. */
|
|
11
|
+
export type ResourcesScheduleViewLevel = 'day' | 'week' | 'month';
|
|
12
|
+
export type ResourcesScheduleOwnStylesNames = 'root';
|
|
13
|
+
/** `ResourcesSchedule` forwards `classNames` and `styles` to the view it renders. */
|
|
14
|
+
export type ResourcesScheduleStylesNames = ResourcesScheduleOwnStylesNames | ResourcesDayViewStylesNames | ResourcesWeekViewStylesNames | ResourcesMonthViewStylesNames;
|
|
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';
|
|
17
|
+
/** View-specific props, with the ones the schedule owns removed. */
|
|
18
|
+
export type ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;
|
|
19
|
+
export interface ResourcesScheduleSlots extends EventSlots {
|
|
20
|
+
/** Replaces the label of every resource row. Takes precedence over `renderResourceLabel`. */
|
|
21
|
+
resourceLabel?: (props: {
|
|
22
|
+
resource: ScheduleResourceData;
|
|
23
|
+
}) => VNodeChild;
|
|
24
|
+
/** Replaces the label of every resource group. */
|
|
25
|
+
groupLabel?: (props: {
|
|
26
|
+
group: ScheduleResourceGroup;
|
|
27
|
+
}) => VNodeChild;
|
|
28
|
+
/** Content of the top-left corner of the grid. */
|
|
29
|
+
corner?: (props: {
|
|
30
|
+
resources: ScheduleResourceData[];
|
|
31
|
+
}) => VNodeChild;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props declared by `ResourcesSchedule` itself. See `ResourcesScheduleProps` for the full
|
|
35
|
+
* public type.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResourcesScheduleOwnProps extends StylesApiProps<ResourcesScheduleFactory> {
|
|
38
|
+
/** Resources rendered as rows, in the given order. */
|
|
39
|
+
resources: ScheduleResourceData[];
|
|
40
|
+
/** Date displayed by the active view, bound with `v-model:date`. */
|
|
41
|
+
date?: Date | DateStringValue;
|
|
42
|
+
/** Date displayed on the first render when `date` is not set. @default today */
|
|
43
|
+
defaultDate?: Date | DateStringValue;
|
|
44
|
+
/** Active view level, bound with `v-model:view`. */
|
|
45
|
+
view?: ResourcesScheduleViewLevel;
|
|
46
|
+
/**
|
|
47
|
+
* View level shown on the first render when `view` is not set.
|
|
48
|
+
* @default 'day'
|
|
49
|
+
*/
|
|
50
|
+
defaultView?: ResourcesScheduleViewLevel;
|
|
51
|
+
/** Events rendered by the active view. */
|
|
52
|
+
events?: ScheduleEventData[];
|
|
53
|
+
/**
|
|
54
|
+
* Locale passed down to `dayjs` when formatting labels.
|
|
55
|
+
* @default 'en'
|
|
56
|
+
*/
|
|
57
|
+
locale?: string;
|
|
58
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius`. */
|
|
59
|
+
radius?: string | number;
|
|
60
|
+
/** Overrides for the built-in labels, used for i18n and accessible names. */
|
|
61
|
+
labels?: ScheduleLabelsOverride;
|
|
62
|
+
/**
|
|
63
|
+
* Replaces the body of every event. Can also be set with the `eventBody` slot,
|
|
64
|
+
* which takes precedence over the prop.
|
|
65
|
+
*/
|
|
66
|
+
renderEventBody?: RenderEventBody;
|
|
67
|
+
/**
|
|
68
|
+
* Replaces the label of every resource row. Can also be set with the `resourceLabel` slot,
|
|
69
|
+
* which takes precedence over the prop.
|
|
70
|
+
*/
|
|
71
|
+
renderResourceLabel?: (resource: ScheduleResourceData) => VNodeChild;
|
|
72
|
+
/**
|
|
73
|
+
* If set, events can be dragged onto another slot or resource.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
withEventsDragAndDrop?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Returns whether the given event may be dragged.
|
|
79
|
+
* @default () => true
|
|
80
|
+
*/
|
|
81
|
+
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
82
|
+
/**
|
|
83
|
+
* If set, items dragged in from outside the schedule can be dropped on a slot or day cell, which emits
|
|
84
|
+
* `externalEventDrop`. Enabling event drag and drop turns this on as well.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
withExternalEventDrop?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* If set, dragging across slots or day cells selects a range.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
withDragSlotSelect?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Interaction mode. `static` disables every event and slot interaction, and turns
|
|
95
|
+
* dragging and resizing off regardless of the other props.
|
|
96
|
+
* @default 'default'
|
|
97
|
+
*/
|
|
98
|
+
mode?: ScheduleMode;
|
|
99
|
+
/**
|
|
100
|
+
* If set, events can be resized in the day and week views.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
withEventResize?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Returns whether the given event may be resized.
|
|
106
|
+
* @default () => true
|
|
107
|
+
*/
|
|
108
|
+
canResizeEvent?: (event: ScheduleEventData) => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum number of instances generated per recurring series.
|
|
111
|
+
* @default 2000
|
|
112
|
+
*/
|
|
113
|
+
recurrenceExpansionLimit?: number;
|
|
114
|
+
/** Props passed to `ResourcesDayView`. */
|
|
115
|
+
dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;
|
|
116
|
+
/** Props passed to `ResourcesWeekView`. */
|
|
117
|
+
weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;
|
|
118
|
+
/** Props passed to `ResourcesMonthView`. */
|
|
119
|
+
monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;
|
|
120
|
+
}
|
|
121
|
+
export interface ResourcesScheduleProps extends Omit<BoxProps, keyof ResourcesScheduleOwnProps>, ResourcesScheduleOwnProps {
|
|
122
|
+
}
|
|
123
|
+
export interface ResourcesScheduleEmits {
|
|
124
|
+
/** Emitted when the active view navigates to another date, bound with `v-model:date`. */
|
|
125
|
+
'update:date': [date: DateStringValue];
|
|
126
|
+
/** Emitted when another view level is selected, bound with `v-model:view`. */
|
|
127
|
+
'update:view': [view: ResourcesScheduleViewLevel];
|
|
128
|
+
/** Emitted when the active view navigates to another date. */
|
|
129
|
+
dateChange: [date: DateStringValue];
|
|
130
|
+
/** Emitted when another view level is selected. */
|
|
131
|
+
viewChange: [view: ResourcesScheduleViewLevel];
|
|
132
|
+
/** Emitted when an event is clicked. */
|
|
133
|
+
eventClick: [event: ScheduleEventData, nativeEvent: MouseEvent];
|
|
134
|
+
/** Emitted when an event is dropped. */
|
|
135
|
+
eventDrop: [data: ResourceViewDropData];
|
|
136
|
+
/** Emitted when a drag of an event starts. */
|
|
137
|
+
eventDragStart: [event: ScheduleEventData];
|
|
138
|
+
/** Emitted when a drag of an event ends. */
|
|
139
|
+
eventDragEnd: [];
|
|
140
|
+
/** Emitted when a time slot is clicked in the day or week view. */
|
|
141
|
+
timeSlotClick: [data: ResourceTimeSlotClickData];
|
|
142
|
+
/** Emitted when a day cell is clicked in the month view. */
|
|
143
|
+
dayClick: [data: ResourcesMonthViewDayClickData];
|
|
144
|
+
/** Emitted when a range is selected by dragging. */
|
|
145
|
+
slotDragEnd: [data: ResourceSlotDragEndData];
|
|
146
|
+
/** Emitted when an item from outside the schedule is dropped. */
|
|
147
|
+
externalEventDrop: [data: ResourceExternalDropData];
|
|
148
|
+
/** Emitted when an event is resized. */
|
|
149
|
+
eventResize: [data: EventDropData];
|
|
150
|
+
}
|
|
151
|
+
export type ResourcesScheduleFactory = Factory<{
|
|
152
|
+
props: Omit<ResourcesScheduleProps, 'rootRef'>;
|
|
153
|
+
slots: ResourcesScheduleSlots;
|
|
154
|
+
emits: ResourcesScheduleEmits;
|
|
155
|
+
ref: HTMLDivElement;
|
|
156
|
+
element: 'div';
|
|
157
|
+
stylesNames: ResourcesScheduleStylesNames;
|
|
158
|
+
}>;
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ResourcesScheduleSlots, ResourcesScheduleViewLevel } from './ResourcesSchedule.types';
|
|
2
|
+
import type { ResourcesScheduleOwnProps } from './ResourcesSchedule.types';
|
|
3
|
+
declare const defaultProps: {
|
|
4
|
+
defaultView: "day";
|
|
5
|
+
mode: "default";
|
|
6
|
+
recurrenceExpansionLimit: number;
|
|
7
|
+
};
|
|
8
|
+
export { defaultProps };
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ResourcesScheduleOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:date": (date: string) => any;
|
|
13
|
+
dateChange: (date: string) => any;
|
|
14
|
+
dayClick: (data: import("../ResourcesMonthView").ResourcesMonthViewDayClickData) => any;
|
|
15
|
+
eventDragStart: (event: import("../..").ScheduleEventData) => any;
|
|
16
|
+
eventDragEnd: () => any;
|
|
17
|
+
eventClick: (event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any;
|
|
18
|
+
viewChange: (view: ResourcesScheduleViewLevel) => any;
|
|
19
|
+
eventDrop: (data: import("../ResourcesDayView").ResourceViewDropData) => any;
|
|
20
|
+
timeSlotClick: (data: import("../ResourcesDayView").ResourceTimeSlotClickData) => any;
|
|
21
|
+
slotDragEnd: (data: import("../ResourcesDayView").ResourceSlotDragEndData) => any;
|
|
22
|
+
externalEventDrop: (data: import("../ResourcesDayView").ResourceExternalDropData) => any;
|
|
23
|
+
eventResize: (data: import("../..").EventDropData) => any;
|
|
24
|
+
"update:view": (view: ResourcesScheduleViewLevel) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<ResourcesScheduleOwnProps> & Readonly<{
|
|
26
|
+
"onUpdate:date"?: ((date: string) => any) | undefined;
|
|
27
|
+
onDateChange?: ((date: string) => any) | undefined;
|
|
28
|
+
onDayClick?: ((data: import("../ResourcesMonthView").ResourcesMonthViewDayClickData) => any) | undefined;
|
|
29
|
+
onEventDragStart?: ((event: import("../..").ScheduleEventData) => any) | undefined;
|
|
30
|
+
onEventDragEnd?: (() => any) | undefined;
|
|
31
|
+
onEventClick?: ((event: import("../..").ScheduleEventData, nativeEvent: MouseEvent) => any) | undefined;
|
|
32
|
+
onViewChange?: ((view: ResourcesScheduleViewLevel) => any) | undefined;
|
|
33
|
+
onEventDrop?: ((data: import("../ResourcesDayView").ResourceViewDropData) => any) | undefined;
|
|
34
|
+
onTimeSlotClick?: ((data: import("../ResourcesDayView").ResourceTimeSlotClickData) => any) | undefined;
|
|
35
|
+
onSlotDragEnd?: ((data: import("../ResourcesDayView").ResourceSlotDragEndData) => any) | undefined;
|
|
36
|
+
onExternalEventDrop?: ((data: import("../ResourcesDayView").ResourceExternalDropData) => any) | undefined;
|
|
37
|
+
onEventResize?: ((data: import("../..").EventDropData) => any) | undefined;
|
|
38
|
+
"onUpdate:view"?: ((view: ResourcesScheduleViewLevel) => any) | undefined;
|
|
39
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ResourcesScheduleSlots>;
|
|
40
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|