@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
|
@@ -1,151 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type: PropType<DateLabelFormat>;
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
|
-
weekendDays: {
|
|
14
|
-
type: PropType<DayOfWeek[]>;
|
|
15
|
-
default: () => number[];
|
|
16
|
-
};
|
|
17
|
-
withWeekNumbers: BooleanConstructor;
|
|
18
|
-
withWeekDays: {
|
|
19
|
-
type: BooleanConstructor;
|
|
20
|
-
default: boolean;
|
|
21
|
-
};
|
|
22
|
-
consistentWeeks: BooleanConstructor;
|
|
23
|
-
highlightToday: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
withOutsideDays: {
|
|
28
|
-
type: BooleanConstructor;
|
|
29
|
-
default: boolean;
|
|
30
|
-
};
|
|
31
|
-
monthsListFormat: {
|
|
32
|
-
type: PropType<DateLabelFormat>;
|
|
33
|
-
default: string;
|
|
34
|
-
};
|
|
35
|
-
getDayProps: PropType<YearViewProps["getDayProps"]>;
|
|
36
|
-
getWeekNumberProps: PropType<YearViewProps["getWeekNumberProps"]>;
|
|
37
|
-
onDayClick: PropType<YearViewProps["onDayClick"]>;
|
|
38
|
-
onMonthClick: PropType<YearViewProps["onMonthClick"]>;
|
|
39
|
-
onWeekNumberClick: PropType<YearViewProps["onWeekNumberClick"]>;
|
|
40
|
-
date: {
|
|
41
|
-
type: PropType<Date | import("../..").DateStringValue>;
|
|
42
|
-
required: boolean;
|
|
43
|
-
};
|
|
44
|
-
onDateChange: PropType<(date: import("../..").DateStringValue) => void>;
|
|
45
|
-
events: PropType<ScheduleEventData[]>;
|
|
46
|
-
locale: StringConstructor;
|
|
47
|
-
radius: PropType<string | number>;
|
|
48
|
-
labels: ObjectConstructor;
|
|
49
|
-
mode: {
|
|
50
|
-
type: PropType<import("../..").ScheduleMode>;
|
|
51
|
-
default: string;
|
|
52
|
-
};
|
|
53
|
-
withHeader: {
|
|
54
|
-
type: BooleanConstructor;
|
|
55
|
-
default: boolean;
|
|
56
|
-
};
|
|
57
|
-
onViewChange: PropType<(view: import("../..").ScheduleViewLevel) => void>;
|
|
58
|
-
previousControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
59
|
-
nextControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
60
|
-
todayControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
61
|
-
viewSelectProps: ObjectConstructor;
|
|
62
|
-
renderEventBody: PropType<import("../ScheduleEvent").RenderEventBody>;
|
|
63
|
-
renderEvent: PropType<import("../ScheduleEvent").RenderEvent>;
|
|
64
|
-
onEventClick: PropType<(event: ScheduleEventData, nativeEvent: MouseEvent) => void>;
|
|
65
|
-
recurrenceExpansionLimit: {
|
|
66
|
-
type: NumberConstructor;
|
|
67
|
-
default: number;
|
|
68
|
-
};
|
|
69
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
72
|
-
firstDayOfWeek: {
|
|
73
|
-
type: PropType<DayOfWeek>;
|
|
74
|
-
default: number;
|
|
75
|
-
};
|
|
76
|
-
weekdayFormat: {
|
|
77
|
-
type: PropType<DateLabelFormat>;
|
|
78
|
-
default: string;
|
|
79
|
-
};
|
|
80
|
-
weekendDays: {
|
|
81
|
-
type: PropType<DayOfWeek[]>;
|
|
82
|
-
default: () => number[];
|
|
83
|
-
};
|
|
84
|
-
withWeekNumbers: BooleanConstructor;
|
|
85
|
-
withWeekDays: {
|
|
86
|
-
type: BooleanConstructor;
|
|
87
|
-
default: boolean;
|
|
88
|
-
};
|
|
89
|
-
consistentWeeks: BooleanConstructor;
|
|
90
|
-
highlightToday: {
|
|
91
|
-
type: BooleanConstructor;
|
|
92
|
-
default: boolean;
|
|
93
|
-
};
|
|
94
|
-
withOutsideDays: {
|
|
95
|
-
type: BooleanConstructor;
|
|
96
|
-
default: boolean;
|
|
97
|
-
};
|
|
98
|
-
monthsListFormat: {
|
|
99
|
-
type: PropType<DateLabelFormat>;
|
|
100
|
-
default: string;
|
|
101
|
-
};
|
|
102
|
-
getDayProps: PropType<YearViewProps["getDayProps"]>;
|
|
103
|
-
getWeekNumberProps: PropType<YearViewProps["getWeekNumberProps"]>;
|
|
104
|
-
onDayClick: PropType<YearViewProps["onDayClick"]>;
|
|
105
|
-
onMonthClick: PropType<YearViewProps["onMonthClick"]>;
|
|
106
|
-
onWeekNumberClick: PropType<YearViewProps["onWeekNumberClick"]>;
|
|
107
|
-
date: {
|
|
108
|
-
type: PropType<Date | import("../..").DateStringValue>;
|
|
109
|
-
required: boolean;
|
|
110
|
-
};
|
|
111
|
-
onDateChange: PropType<(date: import("../..").DateStringValue) => void>;
|
|
112
|
-
events: PropType<ScheduleEventData[]>;
|
|
113
|
-
locale: StringConstructor;
|
|
114
|
-
radius: PropType<string | number>;
|
|
115
|
-
labels: ObjectConstructor;
|
|
116
|
-
mode: {
|
|
117
|
-
type: PropType<import("../..").ScheduleMode>;
|
|
118
|
-
default: string;
|
|
119
|
-
};
|
|
120
|
-
withHeader: {
|
|
121
|
-
type: BooleanConstructor;
|
|
122
|
-
default: boolean;
|
|
123
|
-
};
|
|
124
|
-
onViewChange: PropType<(view: import("../..").ScheduleViewLevel) => void>;
|
|
125
|
-
previousControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
126
|
-
nextControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
127
|
-
todayControlProps: PropType<import("../../component-props").NativeButtonProps>;
|
|
128
|
-
viewSelectProps: ObjectConstructor;
|
|
129
|
-
renderEventBody: PropType<import("../ScheduleEvent").RenderEventBody>;
|
|
130
|
-
renderEvent: PropType<import("../ScheduleEvent").RenderEvent>;
|
|
131
|
-
onEventClick: PropType<(event: ScheduleEventData, nativeEvent: MouseEvent) => void>;
|
|
132
|
-
recurrenceExpansionLimit: {
|
|
133
|
-
type: NumberConstructor;
|
|
134
|
-
default: number;
|
|
135
|
-
};
|
|
136
|
-
}>> & Readonly<{}>, {
|
|
137
|
-
mode: import("../..").ScheduleMode;
|
|
138
|
-
firstDayOfWeek: DayOfWeek;
|
|
139
|
-
weekendDays: DayOfWeek[];
|
|
140
|
-
consistentWeeks: boolean;
|
|
141
|
-
highlightToday: boolean;
|
|
142
|
-
withWeekNumbers: boolean;
|
|
143
|
-
weekdayFormat: DateLabelFormat;
|
|
144
|
-
monthsListFormat: DateLabelFormat;
|
|
145
|
-
withOutsideDays: boolean;
|
|
146
|
-
withHeader: boolean;
|
|
147
|
-
recurrenceExpansionLimit: number;
|
|
148
|
-
withWeekDays: boolean;
|
|
149
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
150
|
-
export type { YearViewProps };
|
|
151
|
-
export type YearViewStylesNames = 'yearView' | 'yearViewMonths' | 'yearViewMonth' | 'yearViewWeekdays' | 'yearViewWeek' | 'yearViewWeekNumber' | 'yearViewWeekday' | 'yearViewWeekdaysCorner' | 'yearViewDay' | 'yearViewMonthCaption' | 'yearViewDayIndicators' | 'yearViewDayIndicator';
|
|
1
|
+
export declare const YearView: import("@mantine-vue/core").MantineComponent<{
|
|
2
|
+
props: Omit<import("./YearView.types").YearViewProps, "rootRef">;
|
|
3
|
+
emits: import("./YearView.types").YearViewEmits;
|
|
4
|
+
ref: HTMLDivElement;
|
|
5
|
+
element: "div";
|
|
6
|
+
stylesNames: import("./YearView.types").YearViewStylesNames;
|
|
7
|
+
vars: import("./YearView.types").YearViewCssVariables;
|
|
8
|
+
}>;
|
|
9
|
+
export type { YearViewCssVariables, YearViewEmits, YearViewFactory, YearViewOwnProps, YearViewOwnStylesNames, YearViewProps, YearViewStylesNames, } from './YearView.types';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { BoxProps, Factory } from '@mantine-vue/core';
|
|
2
|
+
import type { StylesApiProps } from '@mantine-vue/core/styles-api';
|
|
3
|
+
import type { BaseViewEmits, BaseViewOwnProps, ForwardedProps, NativeButtonProps } from '../../component-props';
|
|
4
|
+
import type { DateLabelFormat, DateStringValue, DayOfWeek } from '../../types';
|
|
5
|
+
import type { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader.types';
|
|
6
|
+
import type { MonthYearSelectEmits, MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect.types';
|
|
7
|
+
export type YearViewOwnStylesNames = 'yearView' | 'yearViewMonths' | 'yearViewMonth' | 'yearViewMonthCaption' | 'yearViewWeekdays' | 'yearViewWeekday' | 'yearViewWeekdaysCorner' | 'yearViewWeek' | 'yearViewWeekNumber' | 'yearViewDay' | 'yearViewDayIndicators' | 'yearViewDayIndicator';
|
|
8
|
+
/**
|
|
9
|
+
* `YearView` forwards `classNames` and `styles` to the header it renders, so the header
|
|
10
|
+
* selectors are part of its Styles API.
|
|
11
|
+
*/
|
|
12
|
+
export type YearViewStylesNames = YearViewOwnStylesNames | CombinedScheduleHeaderStylesNames;
|
|
13
|
+
export type YearViewCssVariables = {
|
|
14
|
+
yearView: '--year-view-radius';
|
|
15
|
+
};
|
|
16
|
+
/** Props declared by `YearView` itself. See `YearViewProps` for the full public type. */
|
|
17
|
+
export interface YearViewOwnProps extends BaseViewOwnProps, StylesApiProps<YearViewFactory> {
|
|
18
|
+
/**
|
|
19
|
+
* Day the week starts on, `0` – Sunday.
|
|
20
|
+
* @default 1
|
|
21
|
+
*/
|
|
22
|
+
firstDayOfWeek?: DayOfWeek;
|
|
23
|
+
/**
|
|
24
|
+
* Format of the weekday names above each month.
|
|
25
|
+
* @default 'dd'
|
|
26
|
+
*/
|
|
27
|
+
weekdayFormat?: DateLabelFormat;
|
|
28
|
+
/**
|
|
29
|
+
* Days marked as weekend, `0` – Sunday.
|
|
30
|
+
* @default [0, 6]
|
|
31
|
+
*/
|
|
32
|
+
weekendDays?: DayOfWeek[];
|
|
33
|
+
/**
|
|
34
|
+
* If set, week numbers are displayed in the first column of each month.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
withWeekNumbers?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If set, weekday names are displayed above each month.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
withWeekDays?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If set, every month renders six weeks so the grids all have the same height.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
consistentWeeks?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If set, today is highlighted.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
highlightToday?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* If set, days of the neighbouring months are rendered.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
withOutsideDays?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Format of the month captions.
|
|
60
|
+
* @default 'MMMM'
|
|
61
|
+
*/
|
|
62
|
+
monthsListFormat?: DateLabelFormat;
|
|
63
|
+
/** Returns extra props for the control of the given day. */
|
|
64
|
+
getDayProps?: (date: DateStringValue) => NativeButtonProps;
|
|
65
|
+
/** Returns extra props for the control of the week that starts on the given day. */
|
|
66
|
+
getWeekNumberProps?: (weekStartDate: DateStringValue) => NativeButtonProps;
|
|
67
|
+
/** Props passed to the year select in the header. */
|
|
68
|
+
monthYearSelectProps?: ForwardedProps<MonthYearSelectProps, MonthYearSelectEmits>;
|
|
69
|
+
}
|
|
70
|
+
export interface YearViewProps extends Omit<BoxProps, keyof YearViewOwnProps>, YearViewOwnProps {
|
|
71
|
+
}
|
|
72
|
+
export interface YearViewEmits extends BaseViewEmits {
|
|
73
|
+
/** Emitted when a day is clicked. */
|
|
74
|
+
dayClick: [date: DateStringValue, nativeEvent: MouseEvent];
|
|
75
|
+
/** Emitted when a month caption is clicked. */
|
|
76
|
+
monthClick: [month: DateStringValue];
|
|
77
|
+
/** Emitted when a week number is clicked. */
|
|
78
|
+
weekNumberClick: [date: DateStringValue, nativeEvent: MouseEvent];
|
|
79
|
+
}
|
|
80
|
+
export type YearViewFactory = Factory<{
|
|
81
|
+
props: Omit<YearViewProps, 'rootRef'>;
|
|
82
|
+
emits: YearViewEmits;
|
|
83
|
+
ref: HTMLDivElement;
|
|
84
|
+
element: 'div';
|
|
85
|
+
stylesNames: YearViewStylesNames;
|
|
86
|
+
vars: YearViewCssVariables;
|
|
87
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ScheduleEventData } from '../../types';
|
|
2
|
+
import type { YearViewOwnProps } from './YearView.types';
|
|
3
|
+
declare const defaultProps: {
|
|
4
|
+
mode: "default";
|
|
5
|
+
withHeader: true;
|
|
6
|
+
recurrenceExpansionLimit: number;
|
|
7
|
+
firstDayOfWeek: 1;
|
|
8
|
+
weekdayFormat: string;
|
|
9
|
+
weekendDays: (0 | 6)[];
|
|
10
|
+
withWeekDays: true;
|
|
11
|
+
highlightToday: true;
|
|
12
|
+
withOutsideDays: true;
|
|
13
|
+
monthsListFormat: string;
|
|
14
|
+
};
|
|
15
|
+
declare const COLUMNS = 7;
|
|
16
|
+
declare const MAX_DAY_INDICATORS = 3;
|
|
17
|
+
declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
|
|
18
|
+
export { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS };
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<YearViewOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
dateChange: (date: string) => any;
|
|
23
|
+
dayClick: (date: string, nativeEvent: MouseEvent) => any;
|
|
24
|
+
eventClick: (event: ScheduleEventData, nativeEvent: MouseEvent) => any;
|
|
25
|
+
viewChange: (view: import("../..").ScheduleViewLevel) => any;
|
|
26
|
+
weekNumberClick: (date: string, nativeEvent: MouseEvent) => any;
|
|
27
|
+
monthClick: (month: string) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<YearViewOwnProps> & Readonly<{
|
|
29
|
+
onDateChange?: ((date: string) => any) | undefined;
|
|
30
|
+
onDayClick?: ((date: string, nativeEvent: MouseEvent) => any) | undefined;
|
|
31
|
+
onEventClick?: ((event: ScheduleEventData, nativeEvent: MouseEvent) => any) | undefined;
|
|
32
|
+
onViewChange?: ((view: import("../..").ScheduleViewLevel) => any) | undefined;
|
|
33
|
+
onWeekNumberClick?: ((date: string, nativeEvent: MouseEvent) => any) | undefined;
|
|
34
|
+
onMonthClick?: ((month: string) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,151 +1,81 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onDateChange: PropType<(date: DateStringValue) => void>;
|
|
12
|
-
events: PropType<ScheduleEventData[]>;
|
|
13
|
-
locale: StringConstructor;
|
|
14
|
-
radius: PropType<string | number>;
|
|
15
|
-
labels: ObjectConstructor;
|
|
16
|
-
mode: {
|
|
17
|
-
type: PropType<ScheduleMode>;
|
|
18
|
-
default: string;
|
|
19
|
-
};
|
|
20
|
-
withHeader: {
|
|
21
|
-
type: BooleanConstructor;
|
|
22
|
-
default: boolean;
|
|
23
|
-
};
|
|
24
|
-
onViewChange: PropType<(view: ScheduleViewLevel) => void>;
|
|
25
|
-
previousControlProps: PropType<NativeButtonProps>;
|
|
26
|
-
nextControlProps: PropType<NativeButtonProps>;
|
|
27
|
-
todayControlProps: PropType<NativeButtonProps>;
|
|
28
|
-
viewSelectProps: ObjectConstructor;
|
|
29
|
-
renderEventBody: PropType<RenderEventBody>;
|
|
30
|
-
renderEvent: PropType<RenderEvent>;
|
|
31
|
-
onEventClick: PropType<(event: ScheduleEventData, nativeEvent: MouseEvent) => void>;
|
|
32
|
-
recurrenceExpansionLimit: {
|
|
33
|
-
type: NumberConstructor;
|
|
34
|
-
default: number;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export declare const timeViewProps: {
|
|
38
|
-
startTime: {
|
|
39
|
-
type: StringConstructor;
|
|
40
|
-
default: string;
|
|
41
|
-
};
|
|
42
|
-
endTime: {
|
|
43
|
-
type: StringConstructor;
|
|
44
|
-
default: string;
|
|
45
|
-
};
|
|
46
|
-
intervalMinutes: {
|
|
47
|
-
type: NumberConstructor;
|
|
48
|
-
default: number;
|
|
49
|
-
};
|
|
50
|
-
slotLabelFormat: {
|
|
51
|
-
type: PropType<DateLabelFormat>;
|
|
52
|
-
default: string;
|
|
53
|
-
};
|
|
54
|
-
withCurrentTimeIndicator: {
|
|
55
|
-
type: BooleanConstructor;
|
|
56
|
-
default: undefined;
|
|
57
|
-
};
|
|
58
|
-
withCurrentTimeBubble: {
|
|
59
|
-
type: BooleanConstructor;
|
|
60
|
-
default: boolean;
|
|
61
|
-
};
|
|
62
|
-
getCurrentTime: PropType<() => AnyDateValue>;
|
|
63
|
-
slotHeight: {
|
|
64
|
-
type: PropType<CSSProperties["height"]>;
|
|
65
|
-
default: number;
|
|
66
|
-
};
|
|
67
|
-
highlightBusinessHours: BooleanConstructor;
|
|
68
|
-
businessHours: PropType<BusinessHoursValue>;
|
|
69
|
-
withEventsDragAndDrop: BooleanConstructor;
|
|
70
|
-
onEventDrop: PropType<(data: EventDropData) => void>;
|
|
71
|
-
canDragEvent: PropType<(event: ScheduleEventData) => boolean>;
|
|
72
|
-
onEventDragStart: PropType<(event: ScheduleEventData) => void>;
|
|
73
|
-
onEventDragEnd: PropType<() => void>;
|
|
74
|
-
onTimeSlotClick: PropType<(data: TimeSlotClickData) => void>;
|
|
75
|
-
onAllDaySlotClick: PropType<(date: DateStringValue, nativeEvent: MouseEvent) => void>;
|
|
76
|
-
withDragSlotSelect: BooleanConstructor;
|
|
77
|
-
onSlotDragEnd: FunctionConstructor;
|
|
78
|
-
startScrollTime: StringConstructor;
|
|
79
|
-
onExternalEventDrop: FunctionConstructor;
|
|
80
|
-
withEventResize: BooleanConstructor;
|
|
81
|
-
onEventResize: PropType<(data: EventDropData) => void>;
|
|
82
|
-
canResizeEvent: PropType<(event: ScheduleEventData) => boolean>;
|
|
83
|
-
date: {
|
|
84
|
-
type: PropType<Date | DateStringValue>;
|
|
85
|
-
required: boolean;
|
|
86
|
-
};
|
|
87
|
-
onDateChange: PropType<(date: DateStringValue) => void>;
|
|
88
|
-
events: PropType<ScheduleEventData[]>;
|
|
89
|
-
locale: StringConstructor;
|
|
90
|
-
radius: PropType<string | number>;
|
|
91
|
-
labels: ObjectConstructor;
|
|
92
|
-
mode: {
|
|
93
|
-
type: PropType<ScheduleMode>;
|
|
94
|
-
default: string;
|
|
95
|
-
};
|
|
96
|
-
withHeader: {
|
|
97
|
-
type: BooleanConstructor;
|
|
98
|
-
default: boolean;
|
|
99
|
-
};
|
|
100
|
-
onViewChange: PropType<(view: ScheduleViewLevel) => void>;
|
|
101
|
-
previousControlProps: PropType<NativeButtonProps>;
|
|
102
|
-
nextControlProps: PropType<NativeButtonProps>;
|
|
103
|
-
todayControlProps: PropType<NativeButtonProps>;
|
|
104
|
-
viewSelectProps: ObjectConstructor;
|
|
105
|
-
renderEventBody: PropType<RenderEventBody>;
|
|
106
|
-
renderEvent: PropType<RenderEvent>;
|
|
107
|
-
onEventClick: PropType<(event: ScheduleEventData, nativeEvent: MouseEvent) => void>;
|
|
108
|
-
recurrenceExpansionLimit: {
|
|
109
|
-
type: NumberConstructor;
|
|
110
|
-
default: number;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
2
|
+
import type { EventSlots, RenderEvent, RenderEventBody } from '../component-props';
|
|
3
|
+
import type { DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a schedule `radius` prop to a CSS value.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not `getRadius` from the core package: this accepts any CSS length
|
|
8
|
+
* (`12px`, `1em`, `clamp(...)`) alongside the `theme.radius` keys, and treats a plain
|
|
9
|
+
* number as pixels rather than rem.
|
|
10
|
+
*/
|
|
113
11
|
export declare function resolveScheduleRadius(radius: string | number | undefined): string | undefined;
|
|
12
|
+
/** A callback coalesced to one animation frame, with the pending frame cancellable. */
|
|
13
|
+
export interface RafThrottled<Args extends unknown[]> {
|
|
14
|
+
(...args: Args): void;
|
|
15
|
+
/** Drops the pending frame. Call this the moment the gesture ends. */
|
|
16
|
+
cancel: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Runs `callback` at most once per animation frame with the most recent arguments.
|
|
20
|
+
*
|
|
21
|
+
* Pointer and drag events fire far faster than the browser paints. Handling every one of them
|
|
22
|
+
* means the schedule reads layout and re-renders several times per frame, which makes the drag
|
|
23
|
+
* fall behind the pointer and keep catching up after it has stopped. Coalescing to one frame
|
|
24
|
+
* keeps the work bounded, and `cancel` guarantees nothing lands after the drop.
|
|
25
|
+
*/
|
|
26
|
+
export declare function rafThrottle<Args extends unknown[]>(callback: (...args: Args) => void): RafThrottled<Args>;
|
|
27
|
+
/**
|
|
28
|
+
* Styles produced by `getStyles` for one selector. `any` matches the core signature: the value
|
|
29
|
+
* is spread onto an element, where `class` and `style` accept every shape Vue supports.
|
|
30
|
+
*/
|
|
31
|
+
export type SelectorStyles = {
|
|
32
|
+
class: any;
|
|
33
|
+
style: any;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Memoizes `getStyles(selector)` for selectors that take no per-element options.
|
|
37
|
+
*
|
|
38
|
+
* A view renders the same selector for hundreds of slots, and every `getStyles` call rebuilds
|
|
39
|
+
* the class list and merges the resolved styles and CSS variables. Wrapping each selector in a
|
|
40
|
+
* `computed` turns that into one evaluation per selector per change of the theme or the props,
|
|
41
|
+
* instead of one per element per render — which is what a drag re-render is made of.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useStaticStyles<Selector extends string>(getStyles: (selector: Selector) => SelectorStyles): (selector: Selector) => SelectorStyles;
|
|
44
|
+
/** Converts a `slotHeight` / `rowHeight` style prop to a CSS length. */
|
|
45
|
+
export declare function cssSize(value: string | number | undefined): string | undefined;
|
|
114
46
|
export declare function getExpandedEvents(events: ScheduleEventData[] | undefined, rangeStart: Date | string, rangeEnd: Date | string, expansionLimit: number): ScheduleEventData[];
|
|
115
47
|
export declare function formatLabel(date: Date | string, locale: string | undefined, format: DateLabelFormat): string;
|
|
116
|
-
/**
|
|
117
|
-
export interface
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}) => VNodeChild;
|
|
121
|
-
event?: (props: Record<string, unknown> & {
|
|
122
|
-
event: ScheduleEventData;
|
|
123
|
-
}) => VNodeChild;
|
|
48
|
+
/** The `renderEvent` / `renderEventBody` pair a view hands down to `ScheduleEvent`. */
|
|
49
|
+
export interface EventRenderers {
|
|
50
|
+
renderEvent?: RenderEvent;
|
|
51
|
+
renderEventBody?: RenderEventBody;
|
|
124
52
|
}
|
|
125
53
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
54
|
+
* Folds the `event` / `eventBody` scoped slots into the equivalent render props, so a view
|
|
55
|
+
* forwards a single object down to every `ScheduleEvent` it renders instead of re-declaring
|
|
56
|
+
* the slots at each call site. Slots win over props, matching the rest of the library.
|
|
129
57
|
*/
|
|
130
|
-
export declare function
|
|
131
|
-
|
|
132
|
-
withEventsDragAndDrop?: boolean;
|
|
133
|
-
canDragEvent?: (event: ScheduleEventData) => boolean;
|
|
134
|
-
onEventDragStart?: (event: ScheduleEventData) => void;
|
|
135
|
-
onEventDragEnd?: () => void;
|
|
136
|
-
}, extra?: Record<string, unknown>, slots?: EventSlots): VNodeChild;
|
|
58
|
+
export declare function resolveEventRenderers(props: EventRenderers, slots: EventSlots): EventRenderers;
|
|
59
|
+
/** Reads the event referenced by a native drag payload, if the drag started inside a schedule. */
|
|
137
60
|
export declare function getDropEvent(events: ScheduleEventData[] | undefined, transfer: DataTransfer | null): ScheduleEventData | undefined;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Attribute the views put on their `ScrollArea` viewport so they can find it again without
|
|
63
|
+
* depending on Mantine static classes, which a consumer can turn off.
|
|
64
|
+
*/
|
|
65
|
+
export declare const SCROLL_VIEWPORT_ATTRIBUTE = "data-schedule-viewport";
|
|
66
|
+
/** Props spread onto the viewport of a view's `ScrollArea`. */
|
|
67
|
+
export declare const scheduleViewportProps: {
|
|
68
|
+
"data-schedule-viewport": string;
|
|
69
|
+
};
|
|
70
|
+
/** Finds the `ScrollArea` viewport that contains `node`. */
|
|
71
|
+
export declare function getScrollAreaViewport(node: HTMLElement | null | undefined): HTMLElement | null;
|
|
72
|
+
/**
|
|
73
|
+
* Scrolls the viewport around `target` so that `target` sits at its start.
|
|
74
|
+
*
|
|
75
|
+
* The second pass runs a frame later because a `ScrollArea` viewport is still being laid out
|
|
76
|
+
* on the tick it mounts, so the first offsets it reports are not final.
|
|
77
|
+
*/
|
|
78
|
+
export declare function scrollSlotIntoView(target: HTMLElement | null | undefined, axis?: 'x' | 'y'): void;
|
|
149
79
|
export declare function moveEventTo(event: ScheduleEventData, newStart: dayjs.ConfigType): {
|
|
150
80
|
eventId: string | number;
|
|
151
81
|
newStart: DateTimeStringValue;
|
|
@@ -158,4 +88,4 @@ export declare function moveEventToAllDay(event: ScheduleEventData, date: dayjs.
|
|
|
158
88
|
newEnd: DateTimeStringValue;
|
|
159
89
|
event: ScheduleEventData;
|
|
160
90
|
};
|
|
161
|
-
export declare function todayString():
|
|
91
|
+
export declare function todayString(): DateStringValue;
|
|
@@ -5,23 +5,21 @@ interface SelectedRange {
|
|
|
5
5
|
end: number;
|
|
6
6
|
}
|
|
7
7
|
export interface UseSlotDragSelectInput {
|
|
8
|
-
/** Whether slot drag selection is enabled */
|
|
9
8
|
enabled: () => boolean;
|
|
10
|
-
|
|
11
|
-
onDragEnd?: () => ((startIndex: number, endIndex: number, group: string) => void) | undefined;
|
|
9
|
+
onDragEnd?: (startIndex: number, endIndex: number, group: string) => void;
|
|
12
10
|
}
|
|
13
11
|
export interface SlotDragSelect {
|
|
14
|
-
/** Begin a slot selection at the given index/group */
|
|
15
12
|
handleSlotPointerDown: (event: PointerEvent, index: number, group: string) => void;
|
|
16
|
-
/** Whether the slot at index within group is currently selected */
|
|
17
13
|
isSlotSelected: (index: number, group: string) => boolean;
|
|
18
|
-
/** Whether a slot drag selection is currently in progress */
|
|
19
14
|
isDragging: () => boolean;
|
|
20
15
|
}
|
|
21
16
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
17
|
+
* Slot drag-selection shared by the day, week and month views. It tracks a selected range as the
|
|
18
|
+
* pointer moves across elements carrying `data-drag-slot-index` / `data-drag-slot-group`.
|
|
19
|
+
*
|
|
20
|
+
* Hit testing goes through `elementsFromPoint`, which reads layout, so it is coalesced to one
|
|
21
|
+
* animation frame: a fast pointer would otherwise queue up more hit tests and re-renders than the
|
|
22
|
+
* browser can paint, and the selection would keep growing after the pointer stopped.
|
|
25
23
|
*/
|
|
26
24
|
export declare function useSlotDragSelect(input: UseSlotDragSelectInput): SlotDragSelect;
|
|
27
25
|
export type SelectedRangeRef = Ref<SelectedRange | null>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DateStringValue, DateTimeStringValue } from '../types';
|
|
2
|
+
export interface SlotDropTarget {
|
|
3
|
+
date: DateStringValue;
|
|
4
|
+
slotIndex: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SlotDropInterval {
|
|
7
|
+
startTime: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ResolveSlotInput {
|
|
10
|
+
container: HTMLElement | null | undefined;
|
|
11
|
+
date: DateStringValue;
|
|
12
|
+
intervals: SlotDropInterval[];
|
|
13
|
+
}
|
|
14
|
+
export interface ResolvedSlotDrop {
|
|
15
|
+
slotIndex: number;
|
|
16
|
+
target: DateTimeStringValue;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tracks the time slot a drag is hovering over.
|
|
20
|
+
*
|
|
21
|
+
* `dragover` fires many times per frame and the fallback that measures slots reads layout, so
|
|
22
|
+
* resolving the target on every event makes the highlight lag behind the pointer and keep
|
|
23
|
+
* catching up after it stops. The resolution is therefore coalesced to one animation frame, the
|
|
24
|
+
* state is only written when the slot actually changes, and any pending frame is dropped as soon
|
|
25
|
+
* as the drag leaves or the drop happens — so nothing lands after the fact.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useSlotDropTarget(): {
|
|
28
|
+
dropTarget: import("vue").ShallowRef<SlotDropTarget | null, SlotDropTarget | null>;
|
|
29
|
+
isTarget: (date: DateStringValue, slotIndex: number) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Accepts the drag and schedules the target update. `preventDefault` and `dropEffect` run
|
|
32
|
+
* synchronously because the browser reads them as the handler returns.
|
|
33
|
+
*/
|
|
34
|
+
dragOver: (nativeEvent: DragEvent, input: ResolveSlotInput) => void;
|
|
35
|
+
dragLeave: (nativeEvent: DragEvent, container: HTMLElement | null | undefined) => void;
|
|
36
|
+
drop: (nativeEvent: DragEvent, input: ResolveSlotInput) => ResolvedSlotDrop | undefined;
|
|
37
|
+
reset: () => void;
|
|
38
|
+
};
|
|
@@ -16,7 +16,7 @@ export interface UseEventResizeInput {
|
|
|
16
16
|
startTime: () => string;
|
|
17
17
|
endTime: () => string;
|
|
18
18
|
intervalMinutes: () => number;
|
|
19
|
-
onEventResize: (
|
|
19
|
+
onEventResize: (data: EventDropData) => void;
|
|
20
20
|
canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined;
|
|
21
21
|
}
|
|
22
22
|
export declare function useEventResize(input: UseEventResizeInput): {
|