@mantine-vue/schedule 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.cjs +1146 -262
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +1145 -263
- package/esm/index.mjs.map +1 -1
- package/lib/component-props.d.ts +13 -2
- package/lib/components/DayView/DayView.types.d.ts +7 -3
- package/lib/components/DayView/DayView.vue.d.ts +2 -0
- package/lib/components/DayView/get-day-view-events/get-day-positioned-events.d.ts +4 -2
- package/lib/components/DayView/get-day-view-events/get-day-view-events.d.ts +3 -2
- package/lib/components/MonthView/MonthView.types.d.ts +9 -1
- package/lib/components/MonthView/MonthView.vue.d.ts +2 -0
- package/lib/components/MonthView/get-month-view-events/reserve-row.d.ts +7 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +10 -1
- package/lib/components/ResourcesDayView/ResourcesDayView.vue.d.ts +2 -0
- package/lib/components/ResourcesDayView/index.d.ts +0 -1
- package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +10 -1
- package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +2 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +10 -1
- package/lib/components/ResourcesSchedule/ResourcesSchedule.vue.d.ts +2 -0
- package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +10 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.vue.d.ts +2 -0
- package/lib/components/Schedule/Schedule.types.d.ts +12 -2
- package/lib/components/Schedule/Schedule.vue.d.ts +2 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.types.d.ts +12 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue.d.ts +2 -0
- package/lib/components/WeekView/WeekView.types.d.ts +7 -3
- package/lib/components/WeekView/WeekView.vue.d.ts +2 -0
- package/lib/components/WeekView/get-week-view-events/get-week-positioned-events.d.ts +4 -2
- package/lib/hooks/use-event-resize.d.ts +10 -2
- package/lib/hooks/use-horizontal-event-resize.d.ts +9 -1
- package/lib/hooks/validate-event-resize.d.ts +26 -0
- package/lib/types.d.ts +40 -0
- package/lib/utils/apply-cascade-layout/apply-cascade-layout.d.ts +5 -0
- package/lib/utils/get-overlap-clusters/get-overlap-clusters.d.ts +2 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/is-event-placement-allowed/is-event-placement-allowed.d.ts +13 -0
- package/package.json +4 -4
- package/styles.css +711 -379
- package/styles.layer.css +711 -379
- package/lib/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.d.ts +0 -2
package/cjs/index.cjs
CHANGED
|
@@ -384,6 +384,45 @@ function isEventsOverlap(event1, event2) {
|
|
|
384
384
|
return first.startTimestamp < second.endTimestamp && second.startTimestamp < first.endTimestamp;
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
387
|
+
//#region src/utils/is-event-placement-allowed/is-event-placement-allowed.ts
|
|
388
|
+
function isSameEvent(event, other) {
|
|
389
|
+
if (event.id === other.id) return true;
|
|
390
|
+
const eventSeriesId = event.recurringEventId ?? event.recurringInstance?.recurringEventId;
|
|
391
|
+
const otherSeriesId = other.recurringEventId ?? other.recurringInstance?.recurringEventId;
|
|
392
|
+
const eventOccurrenceId = event.recurrenceId ?? event.recurringInstance?.recurrenceId;
|
|
393
|
+
const otherOccurrenceId = other.recurrenceId ?? other.recurringInstance?.recurrenceId;
|
|
394
|
+
return eventSeriesId !== void 0 && eventSeriesId === otherSeriesId && eventOccurrenceId !== void 0 && eventOccurrenceId === otherOccurrenceId;
|
|
395
|
+
}
|
|
396
|
+
var isMidnight = (value) => value.hour() === 0 && value.minute() === 0 && value.second() === 0;
|
|
397
|
+
function spansWholeDays(event) {
|
|
398
|
+
const start = (0, dayjs.default)(event.start);
|
|
399
|
+
const end = (0, dayjs.default)(event.end);
|
|
400
|
+
return isMidnight(start) && (isMidnight(end) || end.hour() === 23 && end.minute() === 59 && end.second() === 59);
|
|
401
|
+
}
|
|
402
|
+
function isEventPlacementAllowed({ event, start, end, events, preventEventOverlap, resourceId }) {
|
|
403
|
+
if (!preventEventOverlap) return {
|
|
404
|
+
allowed: true,
|
|
405
|
+
conflicts: []
|
|
406
|
+
};
|
|
407
|
+
const candidate = {
|
|
408
|
+
...event,
|
|
409
|
+
start,
|
|
410
|
+
end,
|
|
411
|
+
...resourceId !== void 0 ? { resourceId } : {}
|
|
412
|
+
};
|
|
413
|
+
const allDay = spansWholeDays(candidate);
|
|
414
|
+
const conflicts = events.filter((other) => {
|
|
415
|
+
if (other.display === "background" || isSameEvent(event, other)) return false;
|
|
416
|
+
if (resourceId !== void 0 && other.resourceId !== resourceId) return false;
|
|
417
|
+
if (spansWholeDays(other) !== allDay || !isEventsOverlap(other, candidate)) return false;
|
|
418
|
+
return typeof preventEventOverlap === "function" ? preventEventOverlap(other, candidate) : true;
|
|
419
|
+
});
|
|
420
|
+
return {
|
|
421
|
+
allowed: conflicts.length === 0,
|
|
422
|
+
conflicts
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
//#endregion
|
|
387
426
|
//#region src/utils/get-visible-events/get-visible-events.ts
|
|
388
427
|
function getVisibleEvents({ maxEvents, totalEvents }) {
|
|
389
428
|
if (totalEvents <= maxEvents) return {
|
|
@@ -420,8 +459,9 @@ function isEventInTimeRange({ event, startTime, endTime }) {
|
|
|
420
459
|
const timeWindowEndMinutes = endHour * 60 + endMinute;
|
|
421
460
|
const eventStart = (0, dayjs.default)(event.start);
|
|
422
461
|
const eventEnd = (0, dayjs.default)(event.end);
|
|
462
|
+
const endsAtNextDayStart = eventEnd.isSame(eventStart.startOf("day").add(1, "day"), "second");
|
|
423
463
|
const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
424
|
-
return !(eventEnd.hour() * 60 + eventEnd.minute() <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);
|
|
464
|
+
return !((endsAtNextDayStart ? 1440 : eventEnd.hour() * 60 + eventEnd.minute()) <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);
|
|
425
465
|
}
|
|
426
466
|
//#endregion
|
|
427
467
|
//#region src/utils/is-within-week/is-within-week.ts
|
|
@@ -688,6 +728,43 @@ function expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit =
|
|
|
688
728
|
return output;
|
|
689
729
|
}
|
|
690
730
|
//#endregion
|
|
731
|
+
//#region src/utils/get-overlap-clusters/get-overlap-clusters.ts
|
|
732
|
+
function getOverlapClusters(events) {
|
|
733
|
+
const clusters = [];
|
|
734
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
735
|
+
for (let i = 0; i < events.length; i++) {
|
|
736
|
+
if (assigned.has(i)) continue;
|
|
737
|
+
const cluster = [events[i]];
|
|
738
|
+
assigned.add(i);
|
|
739
|
+
let j = 0;
|
|
740
|
+
while (j < cluster.length) {
|
|
741
|
+
for (let k = 0; k < events.length; k++) if (!assigned.has(k) && isEventsOverlap(cluster[j], events[k])) {
|
|
742
|
+
cluster.push(events[k]);
|
|
743
|
+
assigned.add(k);
|
|
744
|
+
}
|
|
745
|
+
j += 1;
|
|
746
|
+
}
|
|
747
|
+
clusters.push(cluster);
|
|
748
|
+
}
|
|
749
|
+
return clusters;
|
|
750
|
+
}
|
|
751
|
+
//#endregion
|
|
752
|
+
//#region src/utils/apply-cascade-layout/apply-cascade-layout.ts
|
|
753
|
+
var BASE_STEP = 20;
|
|
754
|
+
var MIN_TOP_WIDTH = 60;
|
|
755
|
+
function applyCascadeLayout(events) {
|
|
756
|
+
const timedEvents = events.filter((event) => !event.position.allDay);
|
|
757
|
+
for (const cluster of getOverlapClusters(timedEvents)) {
|
|
758
|
+
const columns = Math.max(...cluster.map((event) => event.position.column)) + 1;
|
|
759
|
+
const step = columns > 1 ? Math.min(BASE_STEP, (100 - MIN_TOP_WIDTH) / (columns - 1)) : 0;
|
|
760
|
+
for (const event of cluster) {
|
|
761
|
+
event.position.overlaps = columns;
|
|
762
|
+
event.position.offset = event.position.column * step;
|
|
763
|
+
event.position.width = 100 - event.position.offset;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
//#endregion
|
|
691
768
|
//#region src/utils/get-ordered-resources/get-ordered-resources.ts
|
|
692
769
|
function getOrderedResources(resources, groups) {
|
|
693
770
|
if (!groups?.length) return {
|
|
@@ -918,9 +995,42 @@ function moveEventToAllDay(event, date) {
|
|
|
918
995
|
};
|
|
919
996
|
}
|
|
920
997
|
//#endregion
|
|
998
|
+
//#region src/hooks/validate-event-resize.ts
|
|
999
|
+
function validateEventResize({ event, start, end, edge, events = [], preventEventOverlap, canResizeEventTo, resourceId }) {
|
|
1000
|
+
const { allowed, conflicts } = isEventPlacementAllowed({
|
|
1001
|
+
event,
|
|
1002
|
+
start,
|
|
1003
|
+
end,
|
|
1004
|
+
events,
|
|
1005
|
+
preventEventOverlap,
|
|
1006
|
+
resourceId
|
|
1007
|
+
});
|
|
1008
|
+
if (!allowed) return {
|
|
1009
|
+
valid: false,
|
|
1010
|
+
conflicts,
|
|
1011
|
+
reason: "overlap"
|
|
1012
|
+
};
|
|
1013
|
+
if (canResizeEventTo?.({
|
|
1014
|
+
event,
|
|
1015
|
+
start,
|
|
1016
|
+
end,
|
|
1017
|
+
edge
|
|
1018
|
+
}) === false) return {
|
|
1019
|
+
valid: false,
|
|
1020
|
+
conflicts: [],
|
|
1021
|
+
reason: "rejected"
|
|
1022
|
+
};
|
|
1023
|
+
return {
|
|
1024
|
+
valid: true,
|
|
1025
|
+
conflicts: [],
|
|
1026
|
+
reason: null
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
//#endregion
|
|
921
1030
|
//#region src/hooks/use-event-resize.ts
|
|
922
1031
|
function useEventResize(input) {
|
|
923
1032
|
const resizeState = (0, vue.shallowRef)(null);
|
|
1033
|
+
const resizeValid = (0, vue.shallowRef)(true);
|
|
924
1034
|
let justResized = false;
|
|
925
1035
|
let savedUserSelect = null;
|
|
926
1036
|
const clampAndSnap = (minutes, state) => {
|
|
@@ -962,6 +1072,18 @@ function useEventResize(input) {
|
|
|
962
1072
|
currentTop,
|
|
963
1073
|
currentHeight
|
|
964
1074
|
};
|
|
1075
|
+
const next = resizeState.value;
|
|
1076
|
+
const start = next.edge === "top" ? percentToDateTime(next.currentTop, next.eventDate, next) : next.originalStart;
|
|
1077
|
+
const end = next.edge === "bottom" ? percentToDateTime(next.currentTop + next.currentHeight, next.eventDate, next) : next.originalEnd;
|
|
1078
|
+
resizeValid.value = validateEventResize({
|
|
1079
|
+
event: next.event,
|
|
1080
|
+
start,
|
|
1081
|
+
end,
|
|
1082
|
+
edge: next.edge === "top" ? "start" : "end",
|
|
1083
|
+
events: input.events?.() ?? [],
|
|
1084
|
+
preventEventOverlap: input.preventEventOverlap?.(),
|
|
1085
|
+
canResizeEventTo: input.canResizeEventTo?.()
|
|
1086
|
+
}).valid;
|
|
965
1087
|
});
|
|
966
1088
|
const trackPointer = (event) => handlePointerMove(event.clientY);
|
|
967
1089
|
const removeDocumentListeners = () => {
|
|
@@ -979,14 +1101,34 @@ function useEventResize(input) {
|
|
|
979
1101
|
if (state && (state.currentTop !== state.originalTop || state.currentHeight !== state.originalHeight)) {
|
|
980
1102
|
const newStart = state.edge === "top" ? percentToDateTime(state.currentTop, state.eventDate, state) : state.originalStart;
|
|
981
1103
|
const newEnd = state.edge === "bottom" ? percentToDateTime(state.currentTop + state.currentHeight, state.eventDate, state) : state.originalEnd;
|
|
982
|
-
|
|
1104
|
+
const edge = state.edge === "top" ? "start" : "end";
|
|
1105
|
+
const validation = validateEventResize({
|
|
1106
|
+
event: state.event,
|
|
1107
|
+
start: newStart,
|
|
1108
|
+
end: newEnd,
|
|
1109
|
+
edge,
|
|
1110
|
+
events: input.events?.() ?? [],
|
|
1111
|
+
preventEventOverlap: input.preventEventOverlap?.(),
|
|
1112
|
+
canResizeEventTo: input.canResizeEventTo?.()
|
|
1113
|
+
});
|
|
1114
|
+
if (validation.valid) input.onEventResize({
|
|
983
1115
|
eventId: state.eventId,
|
|
984
1116
|
newStart,
|
|
985
1117
|
newEnd,
|
|
986
1118
|
event: state.event
|
|
987
1119
|
});
|
|
1120
|
+
else input.onEventPlacementRejected?.({
|
|
1121
|
+
action: "resize",
|
|
1122
|
+
event: state.event,
|
|
1123
|
+
start: newStart,
|
|
1124
|
+
end: newEnd,
|
|
1125
|
+
edge,
|
|
1126
|
+
conflicts: validation.conflicts,
|
|
1127
|
+
reason: validation.reason
|
|
1128
|
+
});
|
|
988
1129
|
}
|
|
989
1130
|
resizeState.value = null;
|
|
1131
|
+
resizeValid.value = true;
|
|
990
1132
|
removeDocumentListeners();
|
|
991
1133
|
justResized = true;
|
|
992
1134
|
requestAnimationFrame(() => {
|
|
@@ -1022,25 +1164,29 @@ function useEventResize(input) {
|
|
|
1022
1164
|
intervalMinutes,
|
|
1023
1165
|
minHeightPercent: intervalMinutes / totalMinutes * 100
|
|
1024
1166
|
};
|
|
1167
|
+
resizeValid.value = true;
|
|
1025
1168
|
savedUserSelect = document.body.style.userSelect;
|
|
1026
1169
|
document.body.style.userSelect = "none";
|
|
1027
1170
|
document.addEventListener("pointermove", trackPointer);
|
|
1028
1171
|
document.addEventListener("pointerup", handlePointerUp);
|
|
1029
1172
|
};
|
|
1030
|
-
const getResizePosition = (eventId) => {
|
|
1173
|
+
const getResizePosition = (eventId, eventDate) => {
|
|
1031
1174
|
const state = resizeState.value;
|
|
1032
|
-
return state?.eventId === eventId ? {
|
|
1175
|
+
return state?.eventId === eventId && (eventDate === void 0 || state.eventDate === eventDate) ? {
|
|
1033
1176
|
top: state.currentTop,
|
|
1034
1177
|
height: state.currentHeight
|
|
1035
1178
|
} : null;
|
|
1036
1179
|
};
|
|
1037
|
-
const isResizableEvent = (event) => input.enabled() && input.mode() !== "static" && event.display !== "background" && (input.canResizeEvent()?.(event) ?? true);
|
|
1180
|
+
const isResizableEvent = (event) => input.enabled() && input.mode() !== "static" && (event.display !== "background" || input.withBackgroundEvents?.() === true) && (input.canResizeEvent()?.(event) ?? true);
|
|
1038
1181
|
(0, vue.onBeforeUnmount)(removeDocumentListeners);
|
|
1039
1182
|
return {
|
|
1040
1183
|
handleResizeStart,
|
|
1184
|
+
isResizing: (0, vue.computed)(() => resizeState.value !== null),
|
|
1185
|
+
resizingEventId: (0, vue.computed)(() => resizeState.value?.eventId ?? null),
|
|
1041
1186
|
getResizePosition,
|
|
1042
1187
|
isResizableEvent,
|
|
1043
|
-
wasResizing: () => justResized
|
|
1188
|
+
wasResizing: () => justResized,
|
|
1189
|
+
resizeValid: (0, vue.computed)(() => resizeValid.value)
|
|
1044
1190
|
};
|
|
1045
1191
|
}
|
|
1046
1192
|
var CurrentTimeIndicator_module_default = {
|
|
@@ -1263,9 +1409,9 @@ function provideScheduleDragState(input = {}) {
|
|
|
1263
1409
|
};
|
|
1264
1410
|
}
|
|
1265
1411
|
var ScheduleEvent_module_default = {
|
|
1266
|
-
event: "
|
|
1267
|
-
eventInner: "
|
|
1268
|
-
eventResizeHandle: "
|
|
1412
|
+
event: "_event_iymqv_1",
|
|
1413
|
+
eventInner: "_eventInner_iymqv_14",
|
|
1414
|
+
eventResizeHandle: "_eventResizeHandle_iymqv_215"
|
|
1269
1415
|
};
|
|
1270
1416
|
//#endregion
|
|
1271
1417
|
//#region src/components/ScheduleEvent/ScheduleEvent.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1651,9 +1797,20 @@ var ScheduleBackgroundEvent_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1651
1797
|
renderEventBody: {
|
|
1652
1798
|
type: Function,
|
|
1653
1799
|
default: void 0
|
|
1654
|
-
}
|
|
1800
|
+
},
|
|
1801
|
+
withResize: {
|
|
1802
|
+
type: Boolean,
|
|
1803
|
+
default: false
|
|
1804
|
+
},
|
|
1805
|
+
resizeAxis: { default: "vertical" },
|
|
1806
|
+
resizeHandleProps: {},
|
|
1807
|
+
isResizing: {
|
|
1808
|
+
type: Boolean,
|
|
1809
|
+
default: false
|
|
1810
|
+
},
|
|
1811
|
+
activeResizeEdge: { default: void 0 }
|
|
1655
1812
|
},
|
|
1656
|
-
emits: ["eventClick"],
|
|
1813
|
+
emits: ["eventClick", "resizeStart"],
|
|
1657
1814
|
setup(__props, { emit: __emit }) {
|
|
1658
1815
|
const props = __props;
|
|
1659
1816
|
const emit = __emit;
|
|
@@ -1692,7 +1849,11 @@ var ScheduleBackgroundEvent_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1692
1849
|
return {
|
|
1693
1850
|
...attrs,
|
|
1694
1851
|
style,
|
|
1695
|
-
mod: [attrs.mod, {
|
|
1852
|
+
mod: [attrs.mod, {
|
|
1853
|
+
interactive: props.interactive,
|
|
1854
|
+
resizable: props.withResize,
|
|
1855
|
+
resizing: props.isResizing
|
|
1856
|
+
}],
|
|
1696
1857
|
...props.interactive ? {
|
|
1697
1858
|
"data-event-id": props.event.id,
|
|
1698
1859
|
title: props.event.title,
|
|
@@ -1702,7 +1863,17 @@ var ScheduleBackgroundEvent_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1702
1863
|
} : {}
|
|
1703
1864
|
};
|
|
1704
1865
|
});
|
|
1705
|
-
const content = () =>
|
|
1866
|
+
const content = () => {
|
|
1867
|
+
const body = slots.default?.({ event: props.event }) ?? props.renderEventBody?.(props.event) ?? props.event.title;
|
|
1868
|
+
const edges = props.resizeAxis === "horizontal" ? ["start", "end"] : ["top", "bottom"];
|
|
1869
|
+
return props.withResize ? [...edges.map((edge) => (0, vue.h)(_mantine_vue_core.Box, {
|
|
1870
|
+
...props.resizeHandleProps,
|
|
1871
|
+
key: edge,
|
|
1872
|
+
mod: { edge },
|
|
1873
|
+
"data-active": props.isResizing && props.activeResizeEdge === edge ? true : void 0,
|
|
1874
|
+
onPointerdown: (event) => emit("resizeStart", edge, event)
|
|
1875
|
+
})), body] : body;
|
|
1876
|
+
};
|
|
1706
1877
|
const render = () => {
|
|
1707
1878
|
const component = props.interactive ? _mantine_vue_core.UnstyledButton : _mantine_vue_core.Box;
|
|
1708
1879
|
if (props.renderEvent) return props.renderEvent(props.event, {
|
|
@@ -2742,7 +2913,7 @@ function columnHasConflict$1({ columns, columnIndex, event, allDay, date }) {
|
|
|
2742
2913
|
return hasTimeConflict;
|
|
2743
2914
|
});
|
|
2744
2915
|
}
|
|
2745
|
-
function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date }) {
|
|
2916
|
+
function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date, eventOverlapMode = "columns" }) {
|
|
2746
2917
|
const columns = [];
|
|
2747
2918
|
const positioned = [];
|
|
2748
2919
|
const sorted = sortEvents(events);
|
|
@@ -2782,14 +2953,18 @@ function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, d
|
|
|
2782
2953
|
}
|
|
2783
2954
|
});
|
|
2784
2955
|
}
|
|
2956
|
+
for (const positionedEvent of positioned) if (positionedEvent.position.allDay) {
|
|
2957
|
+
positionedEvent.position.overlaps = 1;
|
|
2958
|
+
positionedEvent.position.width = 100;
|
|
2959
|
+
positionedEvent.position.offset = 0;
|
|
2960
|
+
}
|
|
2961
|
+
if (eventOverlapMode === "cascade") {
|
|
2962
|
+
applyCascadeLayout(positioned);
|
|
2963
|
+
return positioned;
|
|
2964
|
+
}
|
|
2785
2965
|
for (const positionedEvent of positioned) {
|
|
2786
2966
|
const { allDay, column } = positionedEvent.position;
|
|
2787
|
-
if (allDay)
|
|
2788
|
-
positionedEvent.position.overlaps = 1;
|
|
2789
|
-
positionedEvent.position.width = 100;
|
|
2790
|
-
positionedEvent.position.offset = 0;
|
|
2791
|
-
continue;
|
|
2792
|
-
}
|
|
2967
|
+
if (allDay) continue;
|
|
2793
2968
|
const directlyOverlapping = [];
|
|
2794
2969
|
for (const otherEvent of positioned) {
|
|
2795
2970
|
if (otherEvent === positionedEvent || otherEvent.position.allDay) continue;
|
|
@@ -2815,7 +2990,7 @@ function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, d
|
|
|
2815
2990
|
}
|
|
2816
2991
|
//#endregion
|
|
2817
2992
|
//#region src/components/DayView/get-day-view-events/get-day-view-events.ts
|
|
2818
|
-
function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes }) {
|
|
2993
|
+
function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes, eventOverlapMode }) {
|
|
2819
2994
|
if (events === void 0) return {
|
|
2820
2995
|
allDayEvents: [],
|
|
2821
2996
|
regularEvents: [],
|
|
@@ -2850,7 +3025,8 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
|
|
|
2850
3025
|
startTime,
|
|
2851
3026
|
endTime,
|
|
2852
3027
|
intervalMinutes,
|
|
2853
|
-
date
|
|
3028
|
+
date,
|
|
3029
|
+
eventOverlapMode
|
|
2854
3030
|
});
|
|
2855
3031
|
const allDayEvents = [];
|
|
2856
3032
|
const regularEvents = [];
|
|
@@ -2913,17 +3089,19 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
|
|
|
2913
3089
|
};
|
|
2914
3090
|
}
|
|
2915
3091
|
var DayView_module_default = {
|
|
2916
|
-
dayView: "
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
3092
|
+
dayView: "_dayView_18224_1",
|
|
3093
|
+
dayViewDragPreview: "_dayViewDragPreview_18224_13",
|
|
3094
|
+
dayViewScrollArea: "_dayViewScrollArea_18224_31",
|
|
3095
|
+
dayViewInner: "_dayViewInner_18224_41",
|
|
3096
|
+
dayViewTimeSlots: "_dayViewTimeSlots_18224_45",
|
|
3097
|
+
dayViewSlot: "_dayViewSlot_18224_48",
|
|
3098
|
+
dayViewSlotLabels: "_dayViewSlotLabels_18224_53",
|
|
3099
|
+
dayViewSlotLabel: "_dayViewSlotLabel_18224_53",
|
|
3100
|
+
dayViewSlots: "_dayViewSlots_18224_83",
|
|
3101
|
+
dayViewBackgroundEvent: "_dayViewBackgroundEvent_18224_196",
|
|
3102
|
+
dayViewBackgroundEventResizeHandle: "_dayViewBackgroundEventResizeHandle_18224_225",
|
|
3103
|
+
dayViewAllDay: "_dayViewAllDay_18224_272",
|
|
3104
|
+
dayViewAllDayEvents: "_dayViewAllDayEvents_18224_277"
|
|
2927
3105
|
};
|
|
2928
3106
|
//#endregion
|
|
2929
3107
|
//#region src/components/DayView/DayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -2954,6 +3132,8 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2954
3132
|
inheritAttrs: false,
|
|
2955
3133
|
__name: "DayView",
|
|
2956
3134
|
props: {
|
|
3135
|
+
eventOverlapMode: { default: "columns" },
|
|
3136
|
+
eventOverlapRaiseDelay: { default: 600 },
|
|
2957
3137
|
intervalMinutes: { default: void 0 },
|
|
2958
3138
|
headerFormat: {
|
|
2959
3139
|
type: [String, Function],
|
|
@@ -2995,6 +3175,9 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2995
3175
|
type: Function,
|
|
2996
3176
|
default: void 0
|
|
2997
3177
|
},
|
|
3178
|
+
canDropEvent: {},
|
|
3179
|
+
canDropExternalEvent: {},
|
|
3180
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
2998
3181
|
withDragSlotSelect: { type: Boolean },
|
|
2999
3182
|
withExternalEventDrop: { type: Boolean },
|
|
3000
3183
|
startScrollTime: { default: void 0 },
|
|
@@ -3003,6 +3186,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3003
3186
|
type: Function,
|
|
3004
3187
|
default: void 0
|
|
3005
3188
|
},
|
|
3189
|
+
canResizeEventTo: {},
|
|
3006
3190
|
date: {},
|
|
3007
3191
|
events: { default: void 0 },
|
|
3008
3192
|
locale: { default: void 0 },
|
|
@@ -3044,6 +3228,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3044
3228
|
"slotDragEnd",
|
|
3045
3229
|
"externalEventDrop",
|
|
3046
3230
|
"eventResize",
|
|
3231
|
+
"eventPlacementRejected",
|
|
3047
3232
|
"dateChange",
|
|
3048
3233
|
"viewChange",
|
|
3049
3234
|
"eventClick"
|
|
@@ -3084,6 +3269,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3084
3269
|
const eventRenderers = (0, vue.computed)(() => resolveEventRenderers(props, slots));
|
|
3085
3270
|
const timeSlotsContainer = (0, vue.ref)(null);
|
|
3086
3271
|
const slotDropTarget = useSlotDropTarget();
|
|
3272
|
+
const dropDataTransfer = (0, vue.shallowRef)(null);
|
|
3087
3273
|
const date = (0, vue.computed)(() => toDateString(props.date));
|
|
3088
3274
|
const datePart = (0, vue.computed)(() => (0, dayjs.default)(date.value).format("YYYY-MM-DD"));
|
|
3089
3275
|
const now = (0, vue.computed)(() => (0, dayjs.default)(props.getCurrentTime?.() ?? (0, dayjs.default)()));
|
|
@@ -3095,7 +3281,8 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3095
3281
|
date: date.value,
|
|
3096
3282
|
startTime: props.startTime,
|
|
3097
3283
|
endTime: props.endTime,
|
|
3098
|
-
intervalMinutes: props.intervalMinutes
|
|
3284
|
+
intervalMinutes: props.intervalMinutes,
|
|
3285
|
+
eventOverlapMode: props.eventOverlapMode
|
|
3099
3286
|
}));
|
|
3100
3287
|
const intervals = (0, vue.computed)(() => getDayTimeIntervals({
|
|
3101
3288
|
startTime: props.startTime,
|
|
@@ -3118,7 +3305,12 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3118
3305
|
intervalMinutes: () => props.intervalMinutes,
|
|
3119
3306
|
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
3120
3307
|
onEventResize: (data) => emit("eventResize", data),
|
|
3121
|
-
canResizeEvent: () => props.canResizeEvent
|
|
3308
|
+
canResizeEvent: () => props.canResizeEvent,
|
|
3309
|
+
events: () => expandedEvents.value,
|
|
3310
|
+
preventEventOverlap: () => props.preventEventOverlap,
|
|
3311
|
+
canResizeEventTo: () => props.canResizeEventTo,
|
|
3312
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data),
|
|
3313
|
+
withBackgroundEvents: () => Boolean(props.withInteractiveBackgroundEvents)
|
|
3122
3314
|
});
|
|
3123
3315
|
const slotDragSelect = useSlotDragSelect({
|
|
3124
3316
|
enabled: () => withSlotSelect.value,
|
|
@@ -3140,9 +3332,35 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3140
3332
|
isSlotDragging: () => slotDragSelect.isDragging(),
|
|
3141
3333
|
onDragEnd: () => {
|
|
3142
3334
|
slotDropTarget.reset();
|
|
3335
|
+
dropDataTransfer.value = null;
|
|
3143
3336
|
emit("eventDragEnd");
|
|
3144
3337
|
}
|
|
3145
3338
|
});
|
|
3339
|
+
const dropValid = (0, vue.computed)(() => {
|
|
3340
|
+
const target = slotDropTarget.dropTarget.value;
|
|
3341
|
+
const interval = target && intervals.value[target.slotIndex];
|
|
3342
|
+
if (!target || !interval) return true;
|
|
3343
|
+
const start = `${target.date} ${interval.startTime}`;
|
|
3344
|
+
const event = dragState.draggedEvent.value;
|
|
3345
|
+
if (event) {
|
|
3346
|
+
const next = moveEventTo(event, start);
|
|
3347
|
+
return isEventPlacementAllowed({
|
|
3348
|
+
event,
|
|
3349
|
+
start: next.newStart,
|
|
3350
|
+
end: next.newEnd,
|
|
3351
|
+
events: expandedEvents.value,
|
|
3352
|
+
preventEventOverlap: props.preventEventOverlap
|
|
3353
|
+
}).allowed && props.canDropEvent?.({
|
|
3354
|
+
event,
|
|
3355
|
+
start: next.newStart,
|
|
3356
|
+
end: next.newEnd
|
|
3357
|
+
}) !== false;
|
|
3358
|
+
}
|
|
3359
|
+
return dropDataTransfer.value ? props.canDropExternalEvent?.({
|
|
3360
|
+
dataTransfer: dropDataTransfer.value,
|
|
3361
|
+
start
|
|
3362
|
+
}) !== false : true;
|
|
3363
|
+
});
|
|
3146
3364
|
(0, vue.onMounted)(async () => {
|
|
3147
3365
|
if (!props.startScrollTime) return;
|
|
3148
3366
|
await (0, vue.nextTick)();
|
|
@@ -3160,14 +3378,79 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3160
3378
|
const emitDrop = (nativeEvent, target) => {
|
|
3161
3379
|
nativeEvent.preventDefault();
|
|
3162
3380
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
3163
|
-
if (event)
|
|
3164
|
-
|
|
3381
|
+
if (event) {
|
|
3382
|
+
const next = moveEventTo(event, target);
|
|
3383
|
+
const validation = isEventPlacementAllowed({
|
|
3384
|
+
event,
|
|
3385
|
+
start: next.newStart,
|
|
3386
|
+
end: next.newEnd,
|
|
3387
|
+
events: expandedEvents.value,
|
|
3388
|
+
preventEventOverlap: props.preventEventOverlap
|
|
3389
|
+
});
|
|
3390
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
3391
|
+
event,
|
|
3392
|
+
start: next.newStart,
|
|
3393
|
+
end: next.newEnd
|
|
3394
|
+
}) !== false) emit("eventDrop", next);
|
|
3395
|
+
else emit("eventPlacementRejected", {
|
|
3396
|
+
action: "drop",
|
|
3397
|
+
event,
|
|
3398
|
+
start: next.newStart,
|
|
3399
|
+
end: next.newEnd,
|
|
3400
|
+
conflicts: validation.conflicts,
|
|
3401
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
3402
|
+
});
|
|
3403
|
+
} else if (nativeEvent.dataTransfer) if (props.canDropExternalEvent?.({
|
|
3404
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
3405
|
+
start: target
|
|
3406
|
+
}) !== false) emit("externalEventDrop", nativeEvent.dataTransfer, target);
|
|
3407
|
+
else emit("eventPlacementRejected", {
|
|
3408
|
+
action: "external-drop",
|
|
3409
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
3410
|
+
start: target,
|
|
3411
|
+
conflicts: [],
|
|
3412
|
+
reason: "rejected"
|
|
3413
|
+
});
|
|
3165
3414
|
};
|
|
3166
3415
|
const emitAllDayDrop = (nativeEvent) => {
|
|
3167
3416
|
nativeEvent.preventDefault();
|
|
3168
3417
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
3169
|
-
if (event)
|
|
3170
|
-
|
|
3418
|
+
if (event) {
|
|
3419
|
+
const next = moveEventToAllDay(event, datePart.value);
|
|
3420
|
+
const validation = isEventPlacementAllowed({
|
|
3421
|
+
event,
|
|
3422
|
+
start: next.newStart,
|
|
3423
|
+
end: next.newEnd,
|
|
3424
|
+
events: expandedEvents.value,
|
|
3425
|
+
preventEventOverlap: props.preventEventOverlap
|
|
3426
|
+
});
|
|
3427
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
3428
|
+
event,
|
|
3429
|
+
start: next.newStart,
|
|
3430
|
+
end: next.newEnd
|
|
3431
|
+
}) !== false) emit("eventDrop", next);
|
|
3432
|
+
else emit("eventPlacementRejected", {
|
|
3433
|
+
action: "drop",
|
|
3434
|
+
event,
|
|
3435
|
+
start: next.newStart,
|
|
3436
|
+
end: next.newEnd,
|
|
3437
|
+
conflicts: validation.conflicts,
|
|
3438
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
3439
|
+
});
|
|
3440
|
+
} else if (nativeEvent.dataTransfer) {
|
|
3441
|
+
const target = `${datePart.value} 00:00:00`;
|
|
3442
|
+
if (props.canDropExternalEvent?.({
|
|
3443
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
3444
|
+
start: target
|
|
3445
|
+
}) !== false) emit("externalEventDrop", nativeEvent.dataTransfer, target);
|
|
3446
|
+
else emit("eventPlacementRejected", {
|
|
3447
|
+
action: "external-drop",
|
|
3448
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
3449
|
+
start: target,
|
|
3450
|
+
conflicts: [],
|
|
3451
|
+
reason: "rejected"
|
|
3452
|
+
});
|
|
3453
|
+
}
|
|
3171
3454
|
};
|
|
3172
3455
|
const clickAllDaySlot = (nativeEvent) => emit("allDaySlotClick", date.value, nativeEvent);
|
|
3173
3456
|
const clickTimeSlot = (slotIndex, nativeEvent) => {
|
|
@@ -3188,10 +3471,14 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3188
3471
|
startTime: props.startTime,
|
|
3189
3472
|
endTime: props.endTime
|
|
3190
3473
|
});
|
|
3191
|
-
const handleGridDragOver = (nativeEvent) =>
|
|
3474
|
+
const handleGridDragOver = (nativeEvent) => {
|
|
3475
|
+
dropDataTransfer.value = nativeEvent.dataTransfer;
|
|
3476
|
+
slotDropTarget.dragOver(nativeEvent, dropInput());
|
|
3477
|
+
};
|
|
3192
3478
|
const handleGridDragLeave = (nativeEvent) => slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value);
|
|
3193
3479
|
const handleGridDrop = (nativeEvent) => {
|
|
3194
3480
|
const target = slotDropTarget.drop(nativeEvent, dropInput());
|
|
3481
|
+
dropDataTransfer.value = null;
|
|
3195
3482
|
if (target) emitDrop(nativeEvent, target.target);
|
|
3196
3483
|
};
|
|
3197
3484
|
const handleSlotKeydown = (nativeEvent, index) => {
|
|
@@ -3209,11 +3496,16 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3209
3496
|
"business-hours": false,
|
|
3210
3497
|
"non-business-hours": false
|
|
3211
3498
|
}));
|
|
3212
|
-
const backgroundEventStyle = (
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3499
|
+
const backgroundEventStyle = (event) => {
|
|
3500
|
+
const resizePosition = eventResize.getResizePosition(event.id);
|
|
3501
|
+
const top = resizePosition?.top ?? event.position.top;
|
|
3502
|
+
const height = resizePosition?.height ?? event.position.height;
|
|
3503
|
+
return {
|
|
3504
|
+
top: `${top}%`,
|
|
3505
|
+
bottom: `${100 - top - height}%`,
|
|
3506
|
+
minHeight: "1px"
|
|
3507
|
+
};
|
|
3508
|
+
};
|
|
3217
3509
|
const regularEventStyle = (event) => {
|
|
3218
3510
|
const resizePosition = eventResize.getResizePosition(event.id);
|
|
3219
3511
|
const top = resizePosition?.top ?? event.position.top;
|
|
@@ -3224,7 +3516,9 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3224
3516
|
bottom: `${100 - top - height}%`,
|
|
3225
3517
|
minHeight: "1px",
|
|
3226
3518
|
width: `${event.position.width}%`,
|
|
3227
|
-
insetInlineStart: `${event.position.offset}
|
|
3519
|
+
insetInlineStart: `${event.position.offset}%`,
|
|
3520
|
+
"--event-z-index": event.position.column + 3,
|
|
3521
|
+
"--event-z-index-raised": event.position.overlaps + 3
|
|
3228
3522
|
};
|
|
3229
3523
|
};
|
|
3230
3524
|
const startEventResize = (event, edge, pointerEvent) => {
|
|
@@ -3247,10 +3541,14 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3247
3541
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
|
|
3248
3542
|
...(0, vue.unref)(attrs),
|
|
3249
3543
|
...(0, vue.unref)(getStyles)("dayView")
|
|
3250
|
-
}, {
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3544
|
+
}, {
|
|
3545
|
+
mod: [{
|
|
3546
|
+
static: isStatic.value,
|
|
3547
|
+
"slot-dragging": (0, vue.unref)(slotDragSelect).isDragging()
|
|
3548
|
+
}, (0, vue.unref)(attrs).mod],
|
|
3549
|
+
"data-event-interaction": (0, vue.unref)(eventResize).isResizing.value || void 0,
|
|
3550
|
+
style: { "--event-raise-delay": `${(0, vue.unref)(props).eventOverlapRaiseDelay}ms` }
|
|
3551
|
+
}), {
|
|
3254
3552
|
default: (0, vue.withCtx)(() => [(0, vue.unref)(props).withHeader ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleHeaderBase), (0, vue.mergeProps)({
|
|
3255
3553
|
key: 0,
|
|
3256
3554
|
view: "day",
|
|
@@ -3382,12 +3680,20 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3382
3680
|
...eventRenderers.value,
|
|
3383
3681
|
...(0, vue.unref)(staticStyles)("dayViewBackgroundEvent")
|
|
3384
3682
|
}, {
|
|
3385
|
-
style: backgroundEventStyle(event
|
|
3386
|
-
|
|
3683
|
+
style: backgroundEventStyle(event),
|
|
3684
|
+
"with-resize": (0, vue.unref)(eventResize).isResizableEvent(event),
|
|
3685
|
+
"is-resizing": (0, vue.unref)(eventResize).getResizePosition(event.id) !== null,
|
|
3686
|
+
"resize-handle-props": (0, vue.unref)(staticStyles)("dayViewBackgroundEventResizeHandle"),
|
|
3687
|
+
onEventClick: clickResizableEvent,
|
|
3688
|
+
onResizeStart: (edge, pointerEvent) => startEventResize(event, edge, pointerEvent)
|
|
3387
3689
|
}), null, 16, [
|
|
3388
3690
|
"event",
|
|
3389
3691
|
"interactive",
|
|
3390
|
-
"style"
|
|
3692
|
+
"style",
|
|
3693
|
+
"with-resize",
|
|
3694
|
+
"is-resizing",
|
|
3695
|
+
"resize-handle-props",
|
|
3696
|
+
"onResizeStart"
|
|
3391
3697
|
]);
|
|
3392
3698
|
}), 128)),
|
|
3393
3699
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents.value.regularEvents, (event) => {
|
|
@@ -3396,6 +3702,10 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3396
3702
|
event,
|
|
3397
3703
|
"auto-size": "",
|
|
3398
3704
|
mode: (0, vue.unref)(props).mode,
|
|
3705
|
+
mod: {
|
|
3706
|
+
cascade: (0, vue.unref)(props).eventOverlapMode === "cascade",
|
|
3707
|
+
invalid: (0, vue.unref)(eventResize).getResizePosition(event.id) !== null && !(0, vue.unref)(eventResize).resizeValid.value
|
|
3708
|
+
},
|
|
3399
3709
|
style: regularEventStyle(event),
|
|
3400
3710
|
draggable: !isStatic.value && (0, vue.unref)(props).withEventsDragAndDrop === true && ((0, vue.unref)(props).canDragEvent?.(event) ?? true),
|
|
3401
3711
|
"with-resize": (0, vue.unref)(eventResize).isResizableEvent(event),
|
|
@@ -3411,6 +3721,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3411
3721
|
}), null, 16, [
|
|
3412
3722
|
"event",
|
|
3413
3723
|
"mode",
|
|
3724
|
+
"mod",
|
|
3414
3725
|
"style",
|
|
3415
3726
|
"draggable",
|
|
3416
3727
|
"with-resize",
|
|
@@ -3454,6 +3765,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3454
3765
|
"hour-start": slot.isHourStart,
|
|
3455
3766
|
static: isStatic.value,
|
|
3456
3767
|
"drop-target": (0, vue.unref)(slotDropTarget).isTarget(datePart.value, index),
|
|
3768
|
+
invalid: (0, vue.unref)(slotDropTarget).isTarget(datePart.value, index) && !dropValid.value,
|
|
3457
3769
|
"drag-selected": (0, vue.unref)(slotDragSelect).isSlotSelected(index, datePart.value),
|
|
3458
3770
|
"business-hours": businessHoursMods.value[index]["business-hours"],
|
|
3459
3771
|
"non-business-hours": businessHoursMods.value[index]["non-business-hours"]
|
|
@@ -3483,7 +3795,11 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3483
3795
|
_: 1
|
|
3484
3796
|
}, 16, ["viewport-props"])]),
|
|
3485
3797
|
_: 1
|
|
3486
|
-
}, 16, [
|
|
3798
|
+
}, 16, [
|
|
3799
|
+
"mod",
|
|
3800
|
+
"data-event-interaction",
|
|
3801
|
+
"style"
|
|
3802
|
+
]);
|
|
3487
3803
|
};
|
|
3488
3804
|
}
|
|
3489
3805
|
});
|
|
@@ -3495,10 +3811,16 @@ var DayView = (0, _mantine_vue_core.factory)(DayView_default, {
|
|
|
3495
3811
|
});
|
|
3496
3812
|
//#endregion
|
|
3497
3813
|
//#region src/components/MobileMonthView/get-mobile-month-view-events.ts
|
|
3814
|
+
function getEventEndDay(event) {
|
|
3815
|
+
const startDay = (0, dayjs.default)(event.start).startOf("day");
|
|
3816
|
+
const end = (0, dayjs.default)(event.end);
|
|
3817
|
+
const endDay = end.hour() === 0 && end.minute() === 0 && end.second() === 0 ? end.startOf("day").subtract(1, "day") : end.startOf("day");
|
|
3818
|
+
return endDay.isBefore(startDay) ? startDay : endDay;
|
|
3819
|
+
}
|
|
3498
3820
|
function groupEventByDate$1(event, groupedEvents) {
|
|
3499
3821
|
if (isMultidayEvent(event)) {
|
|
3500
3822
|
const startDate = (0, dayjs.default)(event.start).startOf("day");
|
|
3501
|
-
const endDate = (
|
|
3823
|
+
const endDate = getEventEndDay(event);
|
|
3502
3824
|
for (let date = startDate; date.isBefore(endDate) || date.isSame(endDate); date = date.add(1, "day")) {
|
|
3503
3825
|
const dateKey = date.format("YYYY-MM-DD");
|
|
3504
3826
|
if (!groupedEvents[dateKey]) groupedEvents[dateKey] = [];
|
|
@@ -3514,9 +3836,11 @@ function getMobileMonthViewEvents({ date, events }) {
|
|
|
3514
3836
|
const groupedEvents = {};
|
|
3515
3837
|
if (events === void 0) return groupedEvents;
|
|
3516
3838
|
const ids = /* @__PURE__ */ new Set();
|
|
3839
|
+
const monthStart = (0, dayjs.default)(date).startOf("month");
|
|
3840
|
+
const monthEnd = (0, dayjs.default)(date).endOf("month");
|
|
3517
3841
|
for (const event of events) {
|
|
3518
3842
|
if (event.display === "background") continue;
|
|
3519
|
-
if ((0, dayjs.default)(event.start).
|
|
3843
|
+
if (!getEventEndDay(event).isBefore(monthStart, "day") && !(0, dayjs.default)(event.start).isAfter(monthEnd, "day")) {
|
|
3520
3844
|
groupEventByDate$1(validateEvent(event), groupedEvents);
|
|
3521
3845
|
if (!ids.has(event.id)) ids.add(event.id);
|
|
3522
3846
|
else throw new Error(`[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`);
|
|
@@ -3903,17 +4227,6 @@ function calculateEventPositionInWeek({ eventStart, eventEnd, weekStart, weekEnd
|
|
|
3903
4227
|
};
|
|
3904
4228
|
}
|
|
3905
4229
|
//#endregion
|
|
3906
|
-
//#region src/components/MonthView/get-month-view-events/find-available-row.ts
|
|
3907
|
-
function findAvailableRow({ existingEvents, startDayIndex, daysSpanned, weekStart }) {
|
|
3908
|
-
let row = 0;
|
|
3909
|
-
for (const existing of existingEvents) {
|
|
3910
|
-
const existingStart = (0, dayjs.default)(existing.start).startOf("day");
|
|
3911
|
-
const existingDayIndex = (existingStart.isBefore(weekStart) || existingStart.isSame(weekStart, "day") ? weekStart : existingStart).diff(weekStart, "day");
|
|
3912
|
-
if (existingDayIndex + (existing.position?.width || 0) / 100 * 7 > startDayIndex && existingDayIndex < startDayIndex + daysSpanned) row = Math.max(row, (existing.position?.row || 0) + 1);
|
|
3913
|
-
}
|
|
3914
|
-
return row;
|
|
3915
|
-
}
|
|
3916
|
-
//#endregion
|
|
3917
4230
|
//#region src/components/MonthView/get-month-view-events/get-weeks-in-range.ts
|
|
3918
4231
|
function getWeeksInRange({ rangeStart, rangeEnd, firstDayOfWeek }) {
|
|
3919
4232
|
const weeks = [];
|
|
@@ -3938,6 +4251,14 @@ function getWeeksInRange({ rangeStart, rangeEnd, firstDayOfWeek }) {
|
|
|
3938
4251
|
};
|
|
3939
4252
|
}
|
|
3940
4253
|
//#endregion
|
|
4254
|
+
//#region src/components/MonthView/get-month-view-events/reserve-row.ts
|
|
4255
|
+
function reserveRow({ nextRowByDay, startDayIndex, daysSpanned }) {
|
|
4256
|
+
const endDayIndex = startDayIndex + daysSpanned;
|
|
4257
|
+
const row = Math.max(...nextRowByDay.slice(startDayIndex, endDayIndex));
|
|
4258
|
+
nextRowByDay.fill(row + 1, startDayIndex, endDayIndex);
|
|
4259
|
+
return row;
|
|
4260
|
+
}
|
|
4261
|
+
//#endregion
|
|
3941
4262
|
//#region src/components/MonthView/get-month-view-events/get-month-positioned-events.ts
|
|
3942
4263
|
function getMonthPositionedEvents({ date, events, firstDayOfWeek = 1, range }) {
|
|
3943
4264
|
const groupedByWeek = {};
|
|
@@ -3948,6 +4269,11 @@ function getMonthPositionedEvents({ date, events, firstDayOfWeek = 1, range }) {
|
|
|
3948
4269
|
rangeEnd: range ? (0, dayjs.default)(range.end) : (0, dayjs.default)(date).startOf("month").endOf("month"),
|
|
3949
4270
|
firstDayOfWeek
|
|
3950
4271
|
});
|
|
4272
|
+
const weekStates = weeks.map((week) => ({
|
|
4273
|
+
weekStart: (0, dayjs.default)(week[0]).startOf("day"),
|
|
4274
|
+
weekEnd: (0, dayjs.default)(week[6]).endOf("day"),
|
|
4275
|
+
nextRowByDay: Array.from({ length: 7 }).fill(0)
|
|
4276
|
+
}));
|
|
3951
4277
|
for (let i = 0; i < weeks.length; i++) {
|
|
3952
4278
|
groupedByWeek[i.toString()] = [];
|
|
3953
4279
|
backgroundByWeek[i.toString()] = [];
|
|
@@ -3958,9 +4284,7 @@ function getMonthPositionedEvents({ date, events, firstDayOfWeek = 1, range }) {
|
|
|
3958
4284
|
const eventEnd = rawEnd.hour() === 0 && rawEnd.minute() === 0 && rawEnd.second() === 0 ? rawEnd.startOf("day").subtract(1, "day") : rawEnd.startOf("day");
|
|
3959
4285
|
const isMultiday = eventEnd.isAfter(eventStart);
|
|
3960
4286
|
for (let weekIdx = 0; weekIdx < weeks.length; weekIdx++) {
|
|
3961
|
-
const
|
|
3962
|
-
const weekStart = (0, dayjs.default)(week[0]).startOf("day");
|
|
3963
|
-
const weekEnd = (0, dayjs.default)(week[6]).endOf("day");
|
|
4287
|
+
const { weekStart, weekEnd, nextRowByDay } = weekStates[weekIdx];
|
|
3964
4288
|
if ((eventStart.isBefore(weekEnd) || eventStart.isSame(weekEnd, "day")) && (eventEnd.isAfter(weekStart) || eventEnd.isSame(weekStart, "day"))) {
|
|
3965
4289
|
const { startDayIndex, daysSpanned, startOffset, width, hanging } = calculateEventPositionInWeek({
|
|
3966
4290
|
eventStart,
|
|
@@ -3982,11 +4306,10 @@ function getMonthPositionedEvents({ date, events, firstDayOfWeek = 1, range }) {
|
|
|
3982
4306
|
});
|
|
3983
4307
|
continue;
|
|
3984
4308
|
}
|
|
3985
|
-
const row =
|
|
3986
|
-
|
|
4309
|
+
const row = reserveRow({
|
|
4310
|
+
nextRowByDay,
|
|
3987
4311
|
startDayIndex,
|
|
3988
|
-
daysSpanned
|
|
3989
|
-
weekStart
|
|
4312
|
+
daysSpanned
|
|
3990
4313
|
});
|
|
3991
4314
|
const positionedEvent = {
|
|
3992
4315
|
...event,
|
|
@@ -4162,16 +4485,16 @@ function getRenderableMonthEventSegments({ events, groupedByDay, maxEventsPerDay
|
|
|
4162
4485
|
});
|
|
4163
4486
|
}
|
|
4164
4487
|
var MonthView_module_default = {
|
|
4165
|
-
monthView: "
|
|
4166
|
-
monthViewWeekdays: "
|
|
4167
|
-
monthViewWeek: "
|
|
4168
|
-
monthViewWeekNumber: "
|
|
4169
|
-
monthViewWeekday: "
|
|
4170
|
-
monthViewWeekdaysCorner: "
|
|
4171
|
-
monthViewDay: "
|
|
4172
|
-
monthViewDayLabel: "
|
|
4173
|
-
monthViewBackgroundEvent: "
|
|
4174
|
-
monthViewEvents: "
|
|
4488
|
+
monthView: "_monthView_98v2r_1",
|
|
4489
|
+
monthViewWeekdays: "_monthViewWeekdays_98v2r_21",
|
|
4490
|
+
monthViewWeek: "_monthViewWeek_98v2r_21",
|
|
4491
|
+
monthViewWeekNumber: "_monthViewWeekNumber_98v2r_31",
|
|
4492
|
+
monthViewWeekday: "_monthViewWeekday_98v2r_21",
|
|
4493
|
+
monthViewWeekdaysCorner: "_monthViewWeekdaysCorner_98v2r_107",
|
|
4494
|
+
monthViewDay: "_monthViewDay_98v2r_114",
|
|
4495
|
+
monthViewDayLabel: "_monthViewDayLabel_98v2r_264",
|
|
4496
|
+
monthViewBackgroundEvent: "_monthViewBackgroundEvent_98v2r_280",
|
|
4497
|
+
monthViewEvents: "_monthViewEvents_98v2r_305"
|
|
4175
4498
|
};
|
|
4176
4499
|
//#endregion
|
|
4177
4500
|
//#region src/components/MonthView/MonthView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -4180,6 +4503,7 @@ var _hoisted_1$5 = [
|
|
|
4180
4503
|
"data-weekend",
|
|
4181
4504
|
"data-static",
|
|
4182
4505
|
"data-drop-target",
|
|
4506
|
+
"data-invalid",
|
|
4183
4507
|
"data-drag-selected",
|
|
4184
4508
|
"data-drag-slot-index",
|
|
4185
4509
|
"data-drag-slot-group",
|
|
@@ -4254,6 +4578,9 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4254
4578
|
type: Function,
|
|
4255
4579
|
default: void 0
|
|
4256
4580
|
},
|
|
4581
|
+
canDropEvent: {},
|
|
4582
|
+
canDropExternalEvent: {},
|
|
4583
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
4257
4584
|
withExternalEventDrop: { type: Boolean },
|
|
4258
4585
|
withDragSlotSelect: { type: Boolean },
|
|
4259
4586
|
monthYearSelectProps: { default: void 0 },
|
|
@@ -4299,6 +4626,7 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4299
4626
|
"eventDragEnd",
|
|
4300
4627
|
"externalEventDrop",
|
|
4301
4628
|
"slotDragEnd",
|
|
4629
|
+
"eventPlacementRejected",
|
|
4302
4630
|
"dateChange",
|
|
4303
4631
|
"viewChange",
|
|
4304
4632
|
"eventClick"
|
|
@@ -4339,6 +4667,7 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4339
4667
|
const eventRenderers = (0, vue.computed)(() => resolveEventRenderers(props, slots));
|
|
4340
4668
|
const monthGrid = (0, vue.ref)(null);
|
|
4341
4669
|
const dropTarget = (0, vue.shallowRef)(null);
|
|
4670
|
+
const dropValid = (0, vue.ref)(true);
|
|
4342
4671
|
const isStatic = (0, vue.computed)(() => props.mode === "static");
|
|
4343
4672
|
const month = (0, vue.computed)(() => (0, dayjs.default)(props.date).startOf("month"));
|
|
4344
4673
|
const maxEventsPerDay = (0, vue.computed)(() => clampMaxEvents(props.maxEventsPerDay));
|
|
@@ -4429,7 +4758,29 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4429
4758
|
const handleDragOver = (nativeEvent, date) => {
|
|
4430
4759
|
nativeEvent.preventDefault();
|
|
4431
4760
|
if (nativeEvent.dataTransfer) nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes("application/json") ? "move" : "copy";
|
|
4432
|
-
|
|
4761
|
+
const target = toDateString(date);
|
|
4762
|
+
const dragged = dragState.draggedEvent.value;
|
|
4763
|
+
if (dragged) {
|
|
4764
|
+
const next = moveEventTo(dragged, target);
|
|
4765
|
+
dropValid.value = isEventPlacementAllowed({
|
|
4766
|
+
event: dragged,
|
|
4767
|
+
start: next.newStart,
|
|
4768
|
+
end: next.newEnd,
|
|
4769
|
+
events: expandedEvents.value,
|
|
4770
|
+
preventEventOverlap: props.preventEventOverlap
|
|
4771
|
+
}).allowed && props.canDropEvent?.({
|
|
4772
|
+
event: dragged,
|
|
4773
|
+
start: next.newStart,
|
|
4774
|
+
end: next.newEnd
|
|
4775
|
+
}) !== false;
|
|
4776
|
+
} else if (nativeEvent.dataTransfer) {
|
|
4777
|
+
const start = `${target} 00:00:00`;
|
|
4778
|
+
dropValid.value = props.canDropExternalEvent?.({
|
|
4779
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
4780
|
+
start
|
|
4781
|
+
}) !== false;
|
|
4782
|
+
}
|
|
4783
|
+
highlightDay(target);
|
|
4433
4784
|
};
|
|
4434
4785
|
const handleDragLeave = (nativeEvent) => {
|
|
4435
4786
|
if (!(nativeEvent.relatedTarget instanceof Node) || !monthGrid.value?.contains(nativeEvent.relatedTarget)) {
|
|
@@ -4441,14 +4792,48 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4441
4792
|
nativeEvent.preventDefault();
|
|
4442
4793
|
highlightDay.cancel();
|
|
4443
4794
|
setDropTarget(null);
|
|
4795
|
+
dropValid.value = true;
|
|
4444
4796
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
4445
4797
|
if (event) {
|
|
4446
4798
|
const { start } = calculateMonthDropDate({
|
|
4447
4799
|
draggedEvent: event,
|
|
4448
4800
|
targetDay: toDateString(date)
|
|
4449
4801
|
});
|
|
4450
|
-
|
|
4451
|
-
|
|
4802
|
+
const next = moveEventTo(event, start);
|
|
4803
|
+
const validation = isEventPlacementAllowed({
|
|
4804
|
+
event,
|
|
4805
|
+
start: next.newStart,
|
|
4806
|
+
end: next.newEnd,
|
|
4807
|
+
events: expandedEvents.value,
|
|
4808
|
+
preventEventOverlap: props.preventEventOverlap
|
|
4809
|
+
});
|
|
4810
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
4811
|
+
event,
|
|
4812
|
+
start: next.newStart,
|
|
4813
|
+
end: next.newEnd
|
|
4814
|
+
}) !== false) emit("eventDrop", next);
|
|
4815
|
+
else emit("eventPlacementRejected", {
|
|
4816
|
+
action: "drop",
|
|
4817
|
+
event,
|
|
4818
|
+
start: next.newStart,
|
|
4819
|
+
end: next.newEnd,
|
|
4820
|
+
conflicts: validation.conflicts,
|
|
4821
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
4822
|
+
});
|
|
4823
|
+
} else if (nativeEvent.dataTransfer) {
|
|
4824
|
+
const start = `${toDateString(date)} 00:00:00`;
|
|
4825
|
+
if (props.canDropExternalEvent?.({
|
|
4826
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
4827
|
+
start
|
|
4828
|
+
}) !== false) emit("externalEventDrop", nativeEvent.dataTransfer, toDateString(date));
|
|
4829
|
+
else emit("eventPlacementRejected", {
|
|
4830
|
+
action: "external-drop",
|
|
4831
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
4832
|
+
start,
|
|
4833
|
+
conflicts: [],
|
|
4834
|
+
reason: "rejected"
|
|
4835
|
+
});
|
|
4836
|
+
}
|
|
4452
4837
|
};
|
|
4453
4838
|
const segmentStyle = (position) => ({
|
|
4454
4839
|
position: "absolute",
|
|
@@ -4522,6 +4907,7 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4522
4907
|
"data-weekend": (0, vue.unref)(props).weekendDays.includes((0, vue.unref)(dayjs.default)(date).day()) || void 0,
|
|
4523
4908
|
"data-static": isStatic.value || void 0,
|
|
4524
4909
|
"data-drop-target": dropTarget.value === (0, vue.unref)(toDateString)(date) || void 0,
|
|
4910
|
+
"data-invalid": dropTarget.value === (0, vue.unref)(toDateString)(date) && !dropValid.value || void 0,
|
|
4525
4911
|
"data-drag-selected": (0, vue.unref)(slotDragSelect).isSlotSelected(weekIndex * 7 + dayIndex, "month") || void 0,
|
|
4526
4912
|
"data-drag-slot-index": withSlotSelect.value ? weekIndex * 7 + dayIndex : void 0,
|
|
4527
4913
|
"data-drag-slot-group": withSlotSelect.value ? MONTH_SLOT_GROUP : void 0,
|
|
@@ -4776,7 +5162,7 @@ function getHangingStatus({ eventStartDate, actualEndDate, weekDays }) {
|
|
|
4776
5162
|
}
|
|
4777
5163
|
//#endregion
|
|
4778
5164
|
//#region src/components/WeekView/get-week-view-events/get-week-positioned-events.ts
|
|
4779
|
-
function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMinutes, firstDayOfWeek = 1, weekendDays = [0, 6], withWeekendDays = true }) {
|
|
5165
|
+
function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMinutes, firstDayOfWeek = 1, weekendDays = [0, 6], withWeekendDays = true, eventOverlapMode = "columns" }) {
|
|
4780
5166
|
const weekDays = getWeekDays({
|
|
4781
5167
|
week: date,
|
|
4782
5168
|
firstDayOfWeek,
|
|
@@ -4935,7 +5321,8 @@ function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMin
|
|
|
4935
5321
|
});
|
|
4936
5322
|
}
|
|
4937
5323
|
}
|
|
4938
|
-
for (const day of weekDays)
|
|
5324
|
+
for (const day of weekDays) if (eventOverlapMode === "cascade") applyCascadeLayout(grouped.regularEvents[day]);
|
|
5325
|
+
else calculateRegularEventOverlaps(grouped.regularEvents[day]);
|
|
4939
5326
|
if (grouped.allDayEvents.length > 0) {
|
|
4940
5327
|
const eventRows = assignEventRows(grouped.allDayEvents);
|
|
4941
5328
|
const assignedRows = /* @__PURE__ */ new Set();
|
|
@@ -4970,27 +5357,29 @@ function getWeekViewEvents(input) {
|
|
|
4970
5357
|
});
|
|
4971
5358
|
}
|
|
4972
5359
|
var WeekView_module_default = {
|
|
4973
|
-
weekView: "
|
|
4974
|
-
weekViewRoot: "
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
5360
|
+
weekView: "_weekView_1ttnb_1",
|
|
5361
|
+
weekViewRoot: "_weekViewRoot_1ttnb_22",
|
|
5362
|
+
weekViewDragPreview: "_weekViewDragPreview_1ttnb_33",
|
|
5363
|
+
weekViewInner: "_weekViewInner_1ttnb_39",
|
|
5364
|
+
weekViewScrollArea: "_weekViewScrollArea_1ttnb_45",
|
|
5365
|
+
weekViewHeader: "_weekViewHeader_1ttnb_51",
|
|
5366
|
+
weekViewCorner: "_weekViewCorner_1ttnb_66",
|
|
5367
|
+
weekViewSlotLabels: "_weekViewSlotLabels_1ttnb_77",
|
|
5368
|
+
weekViewSlotLabel: "_weekViewSlotLabel_1ttnb_77",
|
|
5369
|
+
weekViewDay: "_weekViewDay_1ttnb_104",
|
|
5370
|
+
weekViewDayLabel: "_weekViewDayLabel_1ttnb_109",
|
|
5371
|
+
weekViewDayNumber: "_weekViewDayNumber_1ttnb_147",
|
|
5372
|
+
weekViewDayWeekday: "_weekViewDayWeekday_1ttnb_163",
|
|
5373
|
+
weekViewBackgroundEvent: "_weekViewBackgroundEvent_1ttnb_169",
|
|
5374
|
+
weekViewBackgroundEventResizeHandle: "_weekViewBackgroundEventResizeHandle_1ttnb_198",
|
|
5375
|
+
weekViewDaySlots: "_weekViewDaySlots_1ttnb_246",
|
|
5376
|
+
weekViewDaySlot: "_weekViewDaySlot_1ttnb_246",
|
|
5377
|
+
weekViewWeekLabel: "_weekViewWeekLabel_1ttnb_353",
|
|
5378
|
+
weekViewWeekNumber: "_weekViewWeekNumber_1ttnb_359",
|
|
5379
|
+
weekViewAllDaySlots: "_weekViewAllDaySlots_1ttnb_365",
|
|
5380
|
+
weekViewAllDaySlotsLabel: "_weekViewAllDaySlotsLabel_1ttnb_370",
|
|
5381
|
+
weekViewAllDaySlotsEvents: "_weekViewAllDaySlotsEvents_1ttnb_377",
|
|
5382
|
+
weekViewAllDaySlotsList: "_weekViewAllDaySlotsList_1ttnb_384"
|
|
4994
5383
|
};
|
|
4995
5384
|
//#endregion
|
|
4996
5385
|
//#region src/components/WeekView/WeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -5033,6 +5422,8 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5033
5422
|
inheritAttrs: false,
|
|
5034
5423
|
__name: "WeekView",
|
|
5035
5424
|
props: {
|
|
5425
|
+
eventOverlapMode: { default: "columns" },
|
|
5426
|
+
eventOverlapRaiseDelay: { default: 600 },
|
|
5036
5427
|
intervalMinutes: { default: void 0 },
|
|
5037
5428
|
withCurrentTimeIndicator: {
|
|
5038
5429
|
type: Boolean,
|
|
@@ -5104,6 +5495,9 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5104
5495
|
type: Function,
|
|
5105
5496
|
default: void 0
|
|
5106
5497
|
},
|
|
5498
|
+
canDropEvent: {},
|
|
5499
|
+
canDropExternalEvent: {},
|
|
5500
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
5107
5501
|
withDragSlotSelect: { type: Boolean },
|
|
5108
5502
|
withExternalEventDrop: { type: Boolean },
|
|
5109
5503
|
startScrollTime: { default: void 0 },
|
|
@@ -5112,6 +5506,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5112
5506
|
type: Function,
|
|
5113
5507
|
default: void 0
|
|
5114
5508
|
},
|
|
5509
|
+
canResizeEventTo: {},
|
|
5115
5510
|
date: {},
|
|
5116
5511
|
events: { default: void 0 },
|
|
5117
5512
|
locale: { default: void 0 },
|
|
@@ -5153,6 +5548,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5153
5548
|
"slotDragEnd",
|
|
5154
5549
|
"externalEventDrop",
|
|
5155
5550
|
"eventResize",
|
|
5551
|
+
"eventPlacementRejected",
|
|
5156
5552
|
"dateChange",
|
|
5157
5553
|
"viewChange",
|
|
5158
5554
|
"eventClick"
|
|
@@ -5197,6 +5593,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5197
5593
|
};
|
|
5198
5594
|
const daySlotsContainers = /* @__PURE__ */ new Map();
|
|
5199
5595
|
const slotDropTarget = useSlotDropTarget();
|
|
5596
|
+
const dropDataTransfer = (0, vue.shallowRef)(null);
|
|
5200
5597
|
const isStatic = (0, vue.computed)(() => props.mode === "static");
|
|
5201
5598
|
/** The plural names are the deprecated aliases; the canonical prop wins when both are set. */
|
|
5202
5599
|
const withWeekNumber = (0, vue.computed)(() => props.withWeekNumbers ?? props.withWeekNumber);
|
|
@@ -5221,7 +5618,8 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5221
5618
|
intervalMinutes: props.intervalMinutes,
|
|
5222
5619
|
firstDayOfWeek: props.firstDayOfWeek,
|
|
5223
5620
|
weekendDays: props.weekendDays,
|
|
5224
|
-
withWeekendDays: props.withWeekendDays
|
|
5621
|
+
withWeekendDays: props.withWeekendDays,
|
|
5622
|
+
eventOverlapMode: props.eventOverlapMode
|
|
5225
5623
|
}));
|
|
5226
5624
|
const intervals = (0, vue.computed)(() => getDayTimeIntervals({
|
|
5227
5625
|
startTime: props.startTime,
|
|
@@ -5238,7 +5636,8 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5238
5636
|
}));
|
|
5239
5637
|
const rootVars = (0, vue.computed)(() => ({
|
|
5240
5638
|
"--number-of-days": String(days.value.length),
|
|
5241
|
-
"--indicator-offset-index": currentWeekdayIndex.value === -1 ? void 0 : String(currentWeekdayIndex.value + 1)
|
|
5639
|
+
"--indicator-offset-index": currentWeekdayIndex.value === -1 ? void 0 : String(currentWeekdayIndex.value + 1),
|
|
5640
|
+
"--event-raise-delay": `${props.eventOverlapRaiseDelay}ms`
|
|
5242
5641
|
}));
|
|
5243
5642
|
/**
|
|
5244
5643
|
* Everything the template needs per day column.
|
|
@@ -5285,7 +5684,12 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5285
5684
|
intervalMinutes: () => props.intervalMinutes,
|
|
5286
5685
|
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
5287
5686
|
onEventResize: (data) => emit("eventResize", data),
|
|
5288
|
-
canResizeEvent: () => props.canResizeEvent
|
|
5687
|
+
canResizeEvent: () => props.canResizeEvent,
|
|
5688
|
+
events: () => expandedEvents.value,
|
|
5689
|
+
preventEventOverlap: () => props.preventEventOverlap,
|
|
5690
|
+
canResizeEventTo: () => props.canResizeEventTo,
|
|
5691
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data),
|
|
5692
|
+
withBackgroundEvents: () => Boolean(props.withInteractiveBackgroundEvents)
|
|
5289
5693
|
});
|
|
5290
5694
|
const slotDragSelect = useSlotDragSelect({
|
|
5291
5695
|
enabled: () => withSlotSelect.value,
|
|
@@ -5316,9 +5720,35 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5316
5720
|
isSlotDragging: () => slotDragSelect.isDragging(),
|
|
5317
5721
|
onDragEnd: () => {
|
|
5318
5722
|
slotDropTarget.reset();
|
|
5723
|
+
dropDataTransfer.value = null;
|
|
5319
5724
|
emit("eventDragEnd");
|
|
5320
5725
|
}
|
|
5321
5726
|
});
|
|
5727
|
+
const dropValid = (0, vue.computed)(() => {
|
|
5728
|
+
const target = slotDropTarget.dropTarget.value;
|
|
5729
|
+
const interval = target && intervals.value[target.slotIndex];
|
|
5730
|
+
if (!target || !interval) return true;
|
|
5731
|
+
const start = `${target.date} ${interval.startTime}`;
|
|
5732
|
+
const event = dragState.draggedEvent.value;
|
|
5733
|
+
if (event) {
|
|
5734
|
+
const next = moveEventTo(event, start);
|
|
5735
|
+
return isEventPlacementAllowed({
|
|
5736
|
+
event,
|
|
5737
|
+
start: next.newStart,
|
|
5738
|
+
end: next.newEnd,
|
|
5739
|
+
events: expandedEvents.value,
|
|
5740
|
+
preventEventOverlap: props.preventEventOverlap
|
|
5741
|
+
}).allowed && props.canDropEvent?.({
|
|
5742
|
+
event,
|
|
5743
|
+
start: next.newStart,
|
|
5744
|
+
end: next.newEnd
|
|
5745
|
+
}) !== false;
|
|
5746
|
+
}
|
|
5747
|
+
return dropDataTransfer.value ? props.canDropExternalEvent?.({
|
|
5748
|
+
dataTransfer: dropDataTransfer.value,
|
|
5749
|
+
start
|
|
5750
|
+
}) !== false : true;
|
|
5751
|
+
});
|
|
5322
5752
|
const clickEvent = (event, nativeEvent) => emit("eventClick", event, nativeEvent);
|
|
5323
5753
|
const dragStart = (event) => {
|
|
5324
5754
|
dragState.startEventDrag(event);
|
|
@@ -5372,15 +5802,80 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5372
5802
|
const emitDrop = (nativeEvent, target) => {
|
|
5373
5803
|
nativeEvent.preventDefault();
|
|
5374
5804
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
5375
|
-
if (event)
|
|
5376
|
-
|
|
5805
|
+
if (event) {
|
|
5806
|
+
const next = moveEventTo(event, target);
|
|
5807
|
+
const validation = isEventPlacementAllowed({
|
|
5808
|
+
event,
|
|
5809
|
+
start: next.newStart,
|
|
5810
|
+
end: next.newEnd,
|
|
5811
|
+
events: expandedEvents.value,
|
|
5812
|
+
preventEventOverlap: props.preventEventOverlap
|
|
5813
|
+
});
|
|
5814
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
5815
|
+
event,
|
|
5816
|
+
start: next.newStart,
|
|
5817
|
+
end: next.newEnd
|
|
5818
|
+
}) !== false) emit("eventDrop", next);
|
|
5819
|
+
else emit("eventPlacementRejected", {
|
|
5820
|
+
action: "drop",
|
|
5821
|
+
event,
|
|
5822
|
+
start: next.newStart,
|
|
5823
|
+
end: next.newEnd,
|
|
5824
|
+
conflicts: validation.conflicts,
|
|
5825
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
5826
|
+
});
|
|
5827
|
+
} else if (nativeEvent.dataTransfer) if (props.canDropExternalEvent?.({
|
|
5828
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
5829
|
+
start: target
|
|
5830
|
+
}) !== false) emit("externalEventDrop", nativeEvent.dataTransfer, target);
|
|
5831
|
+
else emit("eventPlacementRejected", {
|
|
5832
|
+
action: "external-drop",
|
|
5833
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
5834
|
+
start: target,
|
|
5835
|
+
conflicts: [],
|
|
5836
|
+
reason: "rejected"
|
|
5837
|
+
});
|
|
5377
5838
|
};
|
|
5378
5839
|
const emitAllDayDrop = (nativeEvent, date) => {
|
|
5379
5840
|
nativeEvent.preventDefault();
|
|
5380
5841
|
const dayKey = (0, dayjs.default)(date).format("YYYY-MM-DD");
|
|
5381
5842
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
5382
|
-
if (event)
|
|
5383
|
-
|
|
5843
|
+
if (event) {
|
|
5844
|
+
const next = moveEventToAllDay(event, dayKey);
|
|
5845
|
+
const validation = isEventPlacementAllowed({
|
|
5846
|
+
event,
|
|
5847
|
+
start: next.newStart,
|
|
5848
|
+
end: next.newEnd,
|
|
5849
|
+
events: expandedEvents.value,
|
|
5850
|
+
preventEventOverlap: props.preventEventOverlap
|
|
5851
|
+
});
|
|
5852
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
5853
|
+
event,
|
|
5854
|
+
start: next.newStart,
|
|
5855
|
+
end: next.newEnd
|
|
5856
|
+
}) !== false) emit("eventDrop", next);
|
|
5857
|
+
else emit("eventPlacementRejected", {
|
|
5858
|
+
action: "drop",
|
|
5859
|
+
event,
|
|
5860
|
+
start: next.newStart,
|
|
5861
|
+
end: next.newEnd,
|
|
5862
|
+
conflicts: validation.conflicts,
|
|
5863
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
5864
|
+
});
|
|
5865
|
+
} else if (nativeEvent.dataTransfer) {
|
|
5866
|
+
const target = `${dayKey} 00:00:00`;
|
|
5867
|
+
if (props.canDropExternalEvent?.({
|
|
5868
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
5869
|
+
start: target
|
|
5870
|
+
}) !== false) emit("externalEventDrop", nativeEvent.dataTransfer, target);
|
|
5871
|
+
else emit("eventPlacementRejected", {
|
|
5872
|
+
action: "external-drop",
|
|
5873
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
5874
|
+
start: target,
|
|
5875
|
+
conflicts: [],
|
|
5876
|
+
reason: "rejected"
|
|
5877
|
+
});
|
|
5878
|
+
}
|
|
5384
5879
|
};
|
|
5385
5880
|
const dropInput = (date) => ({
|
|
5386
5881
|
container: daySlotsContainers.get(date),
|
|
@@ -5391,10 +5886,14 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5391
5886
|
startTime: props.startTime,
|
|
5392
5887
|
endTime: props.endTime
|
|
5393
5888
|
});
|
|
5394
|
-
const handleDayDragOver = (nativeEvent, date) =>
|
|
5889
|
+
const handleDayDragOver = (nativeEvent, date) => {
|
|
5890
|
+
dropDataTransfer.value = nativeEvent.dataTransfer;
|
|
5891
|
+
slotDropTarget.dragOver(nativeEvent, dropInput(date));
|
|
5892
|
+
};
|
|
5395
5893
|
const handleDayDragLeave = (nativeEvent, date) => slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date));
|
|
5396
5894
|
const handleDayDrop = (nativeEvent, date) => {
|
|
5397
5895
|
const target = slotDropTarget.drop(nativeEvent, dropInput(date));
|
|
5896
|
+
dropDataTransfer.value = null;
|
|
5398
5897
|
if (target) emitDrop(nativeEvent, target.target);
|
|
5399
5898
|
};
|
|
5400
5899
|
const allDayEventStyle = (position) => ({
|
|
@@ -5403,12 +5902,17 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5403
5902
|
width: `${position.width}%`,
|
|
5404
5903
|
top: `${position.row * 22}px`
|
|
5405
5904
|
});
|
|
5406
|
-
const backgroundEventStyle = (
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5905
|
+
const backgroundEventStyle = (event, date) => {
|
|
5906
|
+
const resizePosition = eventResize.getResizePosition(event.id, (0, dayjs.default)(date).format("YYYY-MM-DD"));
|
|
5907
|
+
const top = resizePosition?.top ?? event.position.top;
|
|
5908
|
+
const height = resizePosition?.height ?? event.position.height;
|
|
5909
|
+
return {
|
|
5910
|
+
top: `${top}%`,
|
|
5911
|
+
bottom: `${100 - top - height}%`,
|
|
5912
|
+
minHeight: "1px",
|
|
5913
|
+
width: "100%"
|
|
5914
|
+
};
|
|
5915
|
+
};
|
|
5412
5916
|
const regularEventStyle = (event) => {
|
|
5413
5917
|
const resizePosition = eventResize.getResizePosition(event.id);
|
|
5414
5918
|
const top = resizePosition?.top ?? event.position.top;
|
|
@@ -5419,7 +5923,9 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5419
5923
|
bottom: `${100 - top - height}%`,
|
|
5420
5924
|
minHeight: "1px",
|
|
5421
5925
|
width: `${event.position.width}%`,
|
|
5422
|
-
insetInlineStart: `${event.position.offset}
|
|
5926
|
+
insetInlineStart: `${event.position.offset}%`,
|
|
5927
|
+
"--event-z-index": event.position.column + 3,
|
|
5928
|
+
"--event-z-index-raised": event.position.overlaps + 3
|
|
5423
5929
|
};
|
|
5424
5930
|
};
|
|
5425
5931
|
const startEventResize = (event, date, edge, pointerEvent) => {
|
|
@@ -5469,7 +5975,10 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5469
5975
|
"next-control-props",
|
|
5470
5976
|
"today-control-props",
|
|
5471
5977
|
"view-select-props"
|
|
5472
|
-
])) : (0, vue.createCommentVNode)("", true), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({ "root-ref": setWeekRoot }, (0, vue.unref)(getStyles)("weekViewRoot", { style: rootVars.value }), {
|
|
5978
|
+
])) : (0, vue.createCommentVNode)("", true), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({ "root-ref": setWeekRoot }, (0, vue.unref)(getStyles)("weekViewRoot", { style: rootVars.value }), {
|
|
5979
|
+
mod: { "with-weekends": (0, vue.unref)(props).withWeekendDays },
|
|
5980
|
+
"data-event-interaction": (0, vue.unref)(eventResize).isResizing.value || void 0
|
|
5981
|
+
}), {
|
|
5473
5982
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.ScrollArea).Autosize, (0, vue.mergeProps)({ "scrollbar-size": 4 }, {
|
|
5474
5983
|
...(0, vue.unref)(props).scrollAreaProps,
|
|
5475
5984
|
...(0, vue.unref)(getStyles)("weekViewScrollArea")
|
|
@@ -5595,6 +6104,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5595
6104
|
"data-drag-slot-index": withSlotSelect.value ? slotIndex : void 0,
|
|
5596
6105
|
"data-drag-slot-group": withSlotSelect.value ? column.key : void 0,
|
|
5597
6106
|
"data-drop-target": (0, vue.unref)(slotDropTarget).isTarget(column.key, slotIndex) || void 0,
|
|
6107
|
+
"data-invalid": (0, vue.unref)(slotDropTarget).isTarget(column.key, slotIndex) && !dropValid.value ? true : void 0,
|
|
5598
6108
|
"data-drag-selected": (0, vue.unref)(slotDragSelect).isSlotSelected(slotIndex, column.key) || void 0,
|
|
5599
6109
|
"data-business-hours": businessHoursMods.value[dayIndex][slotIndex]["business-hours"] || void 0,
|
|
5600
6110
|
"data-non-business-hours": businessHoursMods.value[dayIndex][slotIndex]["non-business-hours"] || void 0,
|
|
@@ -5611,6 +6121,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5611
6121
|
"data-drag-slot-index",
|
|
5612
6122
|
"data-drag-slot-group",
|
|
5613
6123
|
"data-drop-target",
|
|
6124
|
+
"data-invalid",
|
|
5614
6125
|
"data-drag-selected",
|
|
5615
6126
|
"data-business-hours",
|
|
5616
6127
|
"data-non-business-hours",
|
|
@@ -5631,12 +6142,20 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5631
6142
|
...eventRenderers.value,
|
|
5632
6143
|
...(0, vue.unref)(staticStyles)("weekViewBackgroundEvent")
|
|
5633
6144
|
}, {
|
|
5634
|
-
style: backgroundEventStyle(event.
|
|
5635
|
-
|
|
6145
|
+
style: backgroundEventStyle(event, column.date),
|
|
6146
|
+
"with-resize": (0, vue.unref)(eventResize).isResizableEvent(event) && !event.position.allDay,
|
|
6147
|
+
"is-resizing": (0, vue.unref)(eventResize).getResizePosition(event.id, column.date) !== null,
|
|
6148
|
+
"resize-handle-props": (0, vue.unref)(staticStyles)("weekViewBackgroundEventResizeHandle"),
|
|
6149
|
+
onEventClick: clickResizableEvent,
|
|
6150
|
+
onResizeStart: (edge, pointerEvent) => startEventResize(event, column.date, edge, pointerEvent)
|
|
5636
6151
|
}), null, 16, [
|
|
5637
6152
|
"event",
|
|
5638
6153
|
"interactive",
|
|
5639
|
-
"style"
|
|
6154
|
+
"style",
|
|
6155
|
+
"with-resize",
|
|
6156
|
+
"is-resizing",
|
|
6157
|
+
"resize-handle-props",
|
|
6158
|
+
"onResizeStart"
|
|
5640
6159
|
]);
|
|
5641
6160
|
}), 128)),
|
|
5642
6161
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(grouped.value.regularEvents[column.date] || [], (event) => {
|
|
@@ -5645,6 +6164,10 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5645
6164
|
event,
|
|
5646
6165
|
"auto-size": "",
|
|
5647
6166
|
mode: (0, vue.unref)(props).mode,
|
|
6167
|
+
mod: {
|
|
6168
|
+
cascade: (0, vue.unref)(props).eventOverlapMode === "cascade",
|
|
6169
|
+
invalid: (0, vue.unref)(eventResize).getResizePosition(event.id) !== null && !(0, vue.unref)(eventResize).resizeValid.value
|
|
6170
|
+
},
|
|
5648
6171
|
style: regularEventStyle(event),
|
|
5649
6172
|
draggable: isDraggableEvent(event),
|
|
5650
6173
|
"with-resize": (0, vue.unref)(eventResize).isResizableEvent(event),
|
|
@@ -5660,6 +6183,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5660
6183
|
}), null, 16, [
|
|
5661
6184
|
"event",
|
|
5662
6185
|
"mode",
|
|
6186
|
+
"mod",
|
|
5663
6187
|
"style",
|
|
5664
6188
|
"draggable",
|
|
5665
6189
|
"with-resize",
|
|
@@ -5677,7 +6201,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5677
6201
|
_: 1
|
|
5678
6202
|
}, 16, ["viewport-props"])]),
|
|
5679
6203
|
_: 1
|
|
5680
|
-
}, 16, ["mod"])]),
|
|
6204
|
+
}, 16, ["mod", "data-event-interaction"])]),
|
|
5681
6205
|
_: 1
|
|
5682
6206
|
}, 16, ["mod"]);
|
|
5683
6207
|
};
|
|
@@ -6108,6 +6632,22 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6108
6632
|
type: Function,
|
|
6109
6633
|
default: void 0
|
|
6110
6634
|
},
|
|
6635
|
+
canDropEvent: {
|
|
6636
|
+
type: Function,
|
|
6637
|
+
default: void 0
|
|
6638
|
+
},
|
|
6639
|
+
canDropExternalEvent: {
|
|
6640
|
+
type: Function,
|
|
6641
|
+
default: void 0
|
|
6642
|
+
},
|
|
6643
|
+
canResizeEventTo: {
|
|
6644
|
+
type: Function,
|
|
6645
|
+
default: void 0
|
|
6646
|
+
},
|
|
6647
|
+
preventEventOverlap: {
|
|
6648
|
+
type: [Boolean, Function],
|
|
6649
|
+
default: void 0
|
|
6650
|
+
},
|
|
6111
6651
|
withInteractiveBackgroundEvents: {
|
|
6112
6652
|
type: Boolean,
|
|
6113
6653
|
default: void 0
|
|
@@ -6139,7 +6679,8 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6139
6679
|
"monthClick",
|
|
6140
6680
|
"slotDragEnd",
|
|
6141
6681
|
"externalEventDrop",
|
|
6142
|
-
"eventResize"
|
|
6682
|
+
"eventResize",
|
|
6683
|
+
"eventPlacementRejected"
|
|
6143
6684
|
],
|
|
6144
6685
|
setup(__props, { emit: __emit }) {
|
|
6145
6686
|
const rawProps = __props;
|
|
@@ -6198,6 +6739,10 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6198
6739
|
withExternalEventDrop: props.withExternalEventDrop,
|
|
6199
6740
|
withEventResize: props.withEventResize,
|
|
6200
6741
|
canResizeEvent: props.canResizeEvent,
|
|
6742
|
+
canDropEvent: props.canDropEvent,
|
|
6743
|
+
canDropExternalEvent: props.canDropExternalEvent,
|
|
6744
|
+
canResizeEventTo: props.canResizeEventTo,
|
|
6745
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
6201
6746
|
withInteractiveBackgroundEvents: props.mode === "static" ? false : props.withInteractiveBackgroundEvents,
|
|
6202
6747
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
6203
6748
|
...eventRenderers.value,
|
|
@@ -6221,7 +6766,8 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6221
6766
|
onMonthClick: (month) => emit("monthClick", month),
|
|
6222
6767
|
onSlotDragEnd: (rangeStart, rangeEnd) => emit("slotDragEnd", rangeStart, rangeEnd),
|
|
6223
6768
|
onExternalEventDrop: (dataTransfer, dateTime) => emit("externalEventDrop", dataTransfer, dateTime),
|
|
6224
|
-
onEventResize: (data) => emit("eventResize", data)
|
|
6769
|
+
onEventResize: (data) => emit("eventResize", data),
|
|
6770
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data)
|
|
6225
6771
|
};
|
|
6226
6772
|
const views = {
|
|
6227
6773
|
day: DayView,
|
|
@@ -6294,6 +6840,7 @@ var Schedule = (0, _mantine_vue_core.factory)(Schedule_default, { classes: Sched
|
|
|
6294
6840
|
//#region src/hooks/use-horizontal-event-resize.ts
|
|
6295
6841
|
function useHorizontalEventResize(input) {
|
|
6296
6842
|
const state = (0, vue.shallowRef)(null);
|
|
6843
|
+
const resizeValid = (0, vue.ref)(true);
|
|
6297
6844
|
let justResized = false;
|
|
6298
6845
|
let savedUserSelect = "";
|
|
6299
6846
|
const metrics = () => {
|
|
@@ -6338,6 +6885,18 @@ function useHorizontalEventResize(input) {
|
|
|
6338
6885
|
current.currentWidth = right - current.currentLeft;
|
|
6339
6886
|
}
|
|
6340
6887
|
state.value = { ...current };
|
|
6888
|
+
const start = current.edge === "start" ? toDateTime(current.currentLeft, current.eventDate) : current.originalStart;
|
|
6889
|
+
const end = current.edge === "end" ? toDateTime(current.currentLeft + current.currentWidth, current.eventDate) : current.originalEnd;
|
|
6890
|
+
resizeValid.value = validateEventResize({
|
|
6891
|
+
event: current.event,
|
|
6892
|
+
start,
|
|
6893
|
+
end,
|
|
6894
|
+
edge: current.edge,
|
|
6895
|
+
events: input.events?.() ?? [],
|
|
6896
|
+
preventEventOverlap: input.preventEventOverlap?.(),
|
|
6897
|
+
canResizeEventTo: input.canResizeEventTo?.(),
|
|
6898
|
+
resourceId: current.event.resourceId
|
|
6899
|
+
}).valid;
|
|
6341
6900
|
});
|
|
6342
6901
|
const trackPointer = (event) => move(event.clientX);
|
|
6343
6902
|
const cleanup = () => {
|
|
@@ -6349,13 +6908,37 @@ function useHorizontalEventResize(input) {
|
|
|
6349
6908
|
const finish = () => {
|
|
6350
6909
|
move.cancel();
|
|
6351
6910
|
const current = state.value;
|
|
6352
|
-
if (current && (current.currentLeft !== current.originalLeft || current.currentWidth !== current.originalWidth))
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6911
|
+
if (current && (current.currentLeft !== current.originalLeft || current.currentWidth !== current.originalWidth)) {
|
|
6912
|
+
const start = current.edge === "start" ? toDateTime(current.currentLeft, current.eventDate) : current.originalStart;
|
|
6913
|
+
const end = current.edge === "end" ? toDateTime(current.currentLeft + current.currentWidth, current.eventDate) : current.originalEnd;
|
|
6914
|
+
const validation = validateEventResize({
|
|
6915
|
+
event: current.event,
|
|
6916
|
+
start,
|
|
6917
|
+
end,
|
|
6918
|
+
edge: current.edge,
|
|
6919
|
+
events: input.events?.() ?? [],
|
|
6920
|
+
preventEventOverlap: input.preventEventOverlap?.(),
|
|
6921
|
+
canResizeEventTo: input.canResizeEventTo?.(),
|
|
6922
|
+
resourceId: current.event.resourceId
|
|
6923
|
+
});
|
|
6924
|
+
if (validation.valid) input.onEventResize({
|
|
6925
|
+
eventId: current.event.id,
|
|
6926
|
+
newStart: start,
|
|
6927
|
+
newEnd: end,
|
|
6928
|
+
event: current.event
|
|
6929
|
+
});
|
|
6930
|
+
else input.onEventPlacementRejected?.({
|
|
6931
|
+
action: "resize",
|
|
6932
|
+
event: current.event,
|
|
6933
|
+
start,
|
|
6934
|
+
end,
|
|
6935
|
+
edge: current.edge,
|
|
6936
|
+
conflicts: validation.conflicts,
|
|
6937
|
+
reason: validation.reason
|
|
6938
|
+
});
|
|
6939
|
+
}
|
|
6358
6940
|
state.value = null;
|
|
6941
|
+
resizeValid.value = true;
|
|
6359
6942
|
cleanup();
|
|
6360
6943
|
justResized = true;
|
|
6361
6944
|
requestAnimationFrame(() => justResized = false);
|
|
@@ -6373,6 +6956,7 @@ function useHorizontalEventResize(input) {
|
|
|
6373
6956
|
dayIndex: params.dayIndex ?? 0,
|
|
6374
6957
|
dayCount: params.dayCount ?? 1
|
|
6375
6958
|
};
|
|
6959
|
+
resizeValid.value = true;
|
|
6376
6960
|
savedUserSelect = document.body.style.userSelect;
|
|
6377
6961
|
document.body.style.userSelect = "none";
|
|
6378
6962
|
document.addEventListener("pointermove", trackPointer);
|
|
@@ -6381,35 +6965,20 @@ function useHorizontalEventResize(input) {
|
|
|
6381
6965
|
(0, vue.onBeforeUnmount)(cleanup);
|
|
6382
6966
|
return {
|
|
6383
6967
|
state,
|
|
6968
|
+
resizeValid,
|
|
6969
|
+
get resizingEdge() {
|
|
6970
|
+
return state.value?.edge ?? null;
|
|
6971
|
+
},
|
|
6384
6972
|
handleResizeStart,
|
|
6385
|
-
getResizePosition: (id) => state.value?.event.id === id ? {
|
|
6973
|
+
getResizePosition: (id, eventDate) => state.value?.event.id === id && (eventDate === void 0 || state.value.eventDate === eventDate) ? {
|
|
6386
6974
|
left: state.value.currentLeft,
|
|
6387
6975
|
width: state.value.currentWidth
|
|
6388
6976
|
} : null,
|
|
6389
|
-
isResizableEvent: (event) => input.enabled() && input.mode() !== "static" && event.display !== "background" && (input.canResizeEvent()?.(event) ?? true),
|
|
6977
|
+
isResizableEvent: (event) => input.enabled() && input.mode() !== "static" && (event.display !== "background" || input.withBackgroundEvents?.() === true) && (input.canResizeEvent()?.(event) ?? true),
|
|
6390
6978
|
wasResizing: () => justResized
|
|
6391
6979
|
};
|
|
6392
6980
|
}
|
|
6393
6981
|
//#endregion
|
|
6394
|
-
//#region src/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.ts
|
|
6395
|
-
function getOverlapClusters(events) {
|
|
6396
|
-
const sorted = [...events].sort((a, b) => a.position.top - b.position.top);
|
|
6397
|
-
const clusters = [];
|
|
6398
|
-
let current = [];
|
|
6399
|
-
let end = -1;
|
|
6400
|
-
sorted.forEach((event) => {
|
|
6401
|
-
if (current.length && event.position.top >= end) {
|
|
6402
|
-
clusters.push(current);
|
|
6403
|
-
current = [];
|
|
6404
|
-
end = -1;
|
|
6405
|
-
}
|
|
6406
|
-
current.push(event);
|
|
6407
|
-
end = Math.max(end, event.position.top + event.position.height);
|
|
6408
|
-
});
|
|
6409
|
-
if (current.length) clusters.push(current);
|
|
6410
|
-
return clusters;
|
|
6411
|
-
}
|
|
6412
|
-
//#endregion
|
|
6413
6982
|
//#region src/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.ts
|
|
6414
6983
|
function getResourcesDayViewEvents({ events, resources, date, startTime, endTime, intervalMinutes }) {
|
|
6415
6984
|
const result = {
|
|
@@ -6507,27 +7076,27 @@ function getResourcesDayViewEvents({ events, resources, date, startTime, endTime
|
|
|
6507
7076
|
return result;
|
|
6508
7077
|
}
|
|
6509
7078
|
var ResourcesDayView_module_default = {
|
|
6510
|
-
resourcesDayView: "
|
|
6511
|
-
resourcesDayViewRoot: "
|
|
6512
|
-
resourcesDayViewScrollArea: "
|
|
6513
|
-
resourcesDayViewInner: "
|
|
6514
|
-
resourcesDayViewTimeLabelsRow: "
|
|
6515
|
-
resourcesDayViewCorner: "
|
|
6516
|
-
resourcesDayViewTimeLabel: "
|
|
6517
|
-
resourcesDayViewRow: "
|
|
6518
|
-
resourcesDayViewResourceLabel: "
|
|
6519
|
-
resourcesDayViewGroupColumn: "
|
|
6520
|
-
resourcesDayViewGroupColumnEmpty: "
|
|
6521
|
-
resourcesDayViewRowSlots: "
|
|
6522
|
-
resourcesDayViewRowSlot: "
|
|
6523
|
-
resourcesDayViewCurrentTimeIndicator: "
|
|
6524
|
-
resourcesDayViewCurrentTimeIndicatorLine: "
|
|
6525
|
-
resourcesDayViewCurrentTimeIndicatorThumb: "
|
|
6526
|
-
resourcesDayViewCurrentTimeIndicatorTimeBubble: "
|
|
6527
|
-
resourcesDayViewBackgroundEvent: "
|
|
6528
|
-
resourcesDayViewAllDayEvent: "
|
|
6529
|
-
resourcesDayViewEventWrapper: "
|
|
6530
|
-
resourcesDayViewResizeHandle: "
|
|
7079
|
+
resourcesDayView: "_resourcesDayView_1ak2d_1",
|
|
7080
|
+
resourcesDayViewRoot: "_resourcesDayViewRoot_1ak2d_22",
|
|
7081
|
+
resourcesDayViewScrollArea: "_resourcesDayViewScrollArea_1ak2d_30",
|
|
7082
|
+
resourcesDayViewInner: "_resourcesDayViewInner_1ak2d_39",
|
|
7083
|
+
resourcesDayViewTimeLabelsRow: "_resourcesDayViewTimeLabelsRow_1ak2d_44",
|
|
7084
|
+
resourcesDayViewCorner: "_resourcesDayViewCorner_1ak2d_57",
|
|
7085
|
+
resourcesDayViewTimeLabel: "_resourcesDayViewTimeLabel_1ak2d_44",
|
|
7086
|
+
resourcesDayViewRow: "_resourcesDayViewRow_1ak2d_96",
|
|
7087
|
+
resourcesDayViewResourceLabel: "_resourcesDayViewResourceLabel_1ak2d_100",
|
|
7088
|
+
resourcesDayViewGroupColumn: "_resourcesDayViewGroupColumn_1ak2d_124",
|
|
7089
|
+
resourcesDayViewGroupColumnEmpty: "_resourcesDayViewGroupColumnEmpty_1ak2d_125",
|
|
7090
|
+
resourcesDayViewRowSlots: "_resourcesDayViewRowSlots_1ak2d_153",
|
|
7091
|
+
resourcesDayViewRowSlot: "_resourcesDayViewRowSlot_1ak2d_153",
|
|
7092
|
+
resourcesDayViewCurrentTimeIndicator: "_resourcesDayViewCurrentTimeIndicator_1ak2d_240",
|
|
7093
|
+
resourcesDayViewCurrentTimeIndicatorLine: "_resourcesDayViewCurrentTimeIndicatorLine_1ak2d_252",
|
|
7094
|
+
resourcesDayViewCurrentTimeIndicatorThumb: "_resourcesDayViewCurrentTimeIndicatorThumb_1ak2d_258",
|
|
7095
|
+
resourcesDayViewCurrentTimeIndicatorTimeBubble: "_resourcesDayViewCurrentTimeIndicatorTimeBubble_1ak2d_268",
|
|
7096
|
+
resourcesDayViewBackgroundEvent: "_resourcesDayViewBackgroundEvent_1ak2d_287",
|
|
7097
|
+
resourcesDayViewAllDayEvent: "_resourcesDayViewAllDayEvent_1ak2d_315",
|
|
7098
|
+
resourcesDayViewEventWrapper: "_resourcesDayViewEventWrapper_1ak2d_321",
|
|
7099
|
+
resourcesDayViewResizeHandle: "_resourcesDayViewResizeHandle_1ak2d_325"
|
|
6531
7100
|
};
|
|
6532
7101
|
//#endregion
|
|
6533
7102
|
//#region src/components/ResourcesDayView/ResourcesDayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -6652,6 +7221,10 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6652
7221
|
type: Function,
|
|
6653
7222
|
default: void 0
|
|
6654
7223
|
},
|
|
7224
|
+
canDropEvent: {},
|
|
7225
|
+
canDropExternalEvent: {},
|
|
7226
|
+
canResizeEventTo: {},
|
|
7227
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
6655
7228
|
recurrenceExpansionLimit: { default: void 0 },
|
|
6656
7229
|
maxEventsPerTimeSlot: { default: void 0 },
|
|
6657
7230
|
moreEventsProps: { default: void 0 },
|
|
@@ -6670,7 +7243,8 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6670
7243
|
"timeSlotClick",
|
|
6671
7244
|
"slotDragEnd",
|
|
6672
7245
|
"externalEventDrop",
|
|
6673
|
-
"eventResize"
|
|
7246
|
+
"eventResize",
|
|
7247
|
+
"eventPlacementRejected"
|
|
6674
7248
|
],
|
|
6675
7249
|
setup(__props, { emit: __emit }) {
|
|
6676
7250
|
const rawProps = __props;
|
|
@@ -6714,6 +7288,7 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6714
7288
|
rootElement.value = node instanceof HTMLElement ? node : null;
|
|
6715
7289
|
};
|
|
6716
7290
|
const dropTarget = (0, vue.shallowRef)(null);
|
|
7291
|
+
const dropValid = (0, vue.ref)(true);
|
|
6717
7292
|
const scrolled = (0, vue.ref)(false);
|
|
6718
7293
|
const scrolledX = (0, vue.ref)(false);
|
|
6719
7294
|
const isStatic = (0, vue.computed)(() => props.mode === "static");
|
|
@@ -6789,7 +7364,12 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6789
7364
|
intervalMinutes: () => props.intervalMinutes,
|
|
6790
7365
|
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
6791
7366
|
onEventResize: (data) => emit("eventResize", data),
|
|
6792
|
-
canResizeEvent: () => props.canResizeEvent
|
|
7367
|
+
canResizeEvent: () => props.canResizeEvent,
|
|
7368
|
+
events: () => expandedEvents.value,
|
|
7369
|
+
preventEventOverlap: () => props.preventEventOverlap,
|
|
7370
|
+
canResizeEventTo: () => props.canResizeEventTo,
|
|
7371
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data),
|
|
7372
|
+
withBackgroundEvents: () => Boolean(props.withInteractiveBackgroundEvents)
|
|
6793
7373
|
});
|
|
6794
7374
|
(0, vue.onMounted)(async () => {
|
|
6795
7375
|
if (!props.startScrollTime) return;
|
|
@@ -6822,15 +7402,51 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6822
7402
|
if (!intervals.value[slotIndex]) return;
|
|
6823
7403
|
const target = getSnappedDropTarget(nativeEvent, slotIndex);
|
|
6824
7404
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
6825
|
-
if (event)
|
|
6826
|
-
|
|
7405
|
+
if (event) {
|
|
7406
|
+
const next = moveEventTo(event, target);
|
|
7407
|
+
const validation = isEventPlacementAllowed({
|
|
7408
|
+
event,
|
|
7409
|
+
start: next.newStart,
|
|
7410
|
+
end: next.newEnd,
|
|
7411
|
+
events: expandedEvents.value,
|
|
7412
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
7413
|
+
resourceId
|
|
7414
|
+
});
|
|
7415
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
7416
|
+
event,
|
|
7417
|
+
start: next.newStart,
|
|
7418
|
+
end: next.newEnd,
|
|
7419
|
+
resourceId
|
|
7420
|
+
}) !== false) emit("eventDrop", {
|
|
7421
|
+
...next,
|
|
7422
|
+
resourceId
|
|
7423
|
+
});
|
|
7424
|
+
else emit("eventPlacementRejected", {
|
|
7425
|
+
action: "drop",
|
|
7426
|
+
event,
|
|
7427
|
+
start: next.newStart,
|
|
7428
|
+
end: next.newEnd,
|
|
7429
|
+
resourceId,
|
|
7430
|
+
conflicts: validation.conflicts,
|
|
7431
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
7432
|
+
});
|
|
7433
|
+
} else if (nativeEvent.dataTransfer) if (props.canDropExternalEvent?.({
|
|
7434
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
7435
|
+
start: target,
|
|
6827
7436
|
resourceId
|
|
6828
|
-
})
|
|
6829
|
-
else if (nativeEvent.dataTransfer) emit("externalEventDrop", {
|
|
7437
|
+
}) !== false) emit("externalEventDrop", {
|
|
6830
7438
|
dataTransfer: nativeEvent.dataTransfer,
|
|
6831
7439
|
dropDateTime: target,
|
|
6832
7440
|
resourceId
|
|
6833
7441
|
});
|
|
7442
|
+
else emit("eventPlacementRejected", {
|
|
7443
|
+
action: "external-drop",
|
|
7444
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
7445
|
+
start: target,
|
|
7446
|
+
resourceId,
|
|
7447
|
+
conflicts: [],
|
|
7448
|
+
reason: "rejected"
|
|
7449
|
+
});
|
|
6834
7450
|
};
|
|
6835
7451
|
const getSnappedDropTarget = (nativeEvent, slotIndex) => {
|
|
6836
7452
|
const interval = intervals.value[slotIndex];
|
|
@@ -6861,6 +7477,28 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6861
7477
|
*/
|
|
6862
7478
|
const resolveDropTarget = rafThrottle((nativeEvent, resourceId, resourceIndex) => {
|
|
6863
7479
|
const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex);
|
|
7480
|
+
const target = slotIndex < 0 ? null : getSnappedDropTarget(nativeEvent, slotIndex);
|
|
7481
|
+
const event = dragState.draggedEvent.value;
|
|
7482
|
+
if (target && event) {
|
|
7483
|
+
const next = moveEventTo(event, target);
|
|
7484
|
+
dropValid.value = isEventPlacementAllowed({
|
|
7485
|
+
event,
|
|
7486
|
+
start: next.newStart,
|
|
7487
|
+
end: next.newEnd,
|
|
7488
|
+
events: expandedEvents.value,
|
|
7489
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
7490
|
+
resourceId
|
|
7491
|
+
}).allowed && props.canDropEvent?.({
|
|
7492
|
+
event,
|
|
7493
|
+
start: next.newStart,
|
|
7494
|
+
end: next.newEnd,
|
|
7495
|
+
resourceId
|
|
7496
|
+
}) !== false;
|
|
7497
|
+
} else if (target && nativeEvent.dataTransfer) dropValid.value = props.canDropExternalEvent?.({
|
|
7498
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
7499
|
+
start: target,
|
|
7500
|
+
resourceId
|
|
7501
|
+
}) !== false;
|
|
6864
7502
|
setDropTarget(slotIndex < 0 ? null : {
|
|
6865
7503
|
resourceId,
|
|
6866
7504
|
slotIndex
|
|
@@ -6888,6 +7526,9 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6888
7526
|
const groupInfo = (resourceIndex) => hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : void 0;
|
|
6889
7527
|
const backgroundEvents = (resourceId) => [...positioned.value.backgroundTimedEvents[resourceId] || [], ...positioned.value.backgroundAllDayEvents[resourceId] || []];
|
|
6890
7528
|
const backgroundEventStyle = (event) => {
|
|
7529
|
+
const resizePosition = resize.getResizePosition(event.id);
|
|
7530
|
+
const left = resizePosition?.left ?? event.position.top;
|
|
7531
|
+
const width = resizePosition?.width ?? event.position.height;
|
|
6891
7532
|
const colors = theme.value.variantColorResolver({
|
|
6892
7533
|
color: event.color || theme.value.primaryColor,
|
|
6893
7534
|
theme: theme.value,
|
|
@@ -6895,8 +7536,8 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6895
7536
|
autoContrast: true
|
|
6896
7537
|
});
|
|
6897
7538
|
return {
|
|
6898
|
-
left: `${
|
|
6899
|
-
right: `${100 -
|
|
7539
|
+
left: `${left}%`,
|
|
7540
|
+
right: `${100 - left - width}%`,
|
|
6900
7541
|
minWidth: "1px",
|
|
6901
7542
|
top: 0,
|
|
6902
7543
|
height: "100%",
|
|
@@ -7114,11 +7755,22 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7114
7755
|
...(0, vue.unref)(getStyles)("resourcesDayViewBackgroundEvent")
|
|
7115
7756
|
}, {
|
|
7116
7757
|
style: backgroundEventStyle(event),
|
|
7117
|
-
|
|
7758
|
+
"with-resize": (0, vue.unref)(resize).isResizableEvent(event) && !event.position.allDay,
|
|
7759
|
+
"resize-axis": "horizontal",
|
|
7760
|
+
"is-resizing": (0, vue.unref)(resize).getResizePosition(event.id) !== null,
|
|
7761
|
+
"active-resize-edge": (0, vue.unref)(resize).resizingEdge,
|
|
7762
|
+
"resize-handle-props": (0, vue.unref)(staticStyles)("resourcesDayViewResizeHandle"),
|
|
7763
|
+
onEventClick: clickEvent,
|
|
7764
|
+
onResizeStart: (edge, pointerEvent) => startResize(event, resourceIndex, edge, pointerEvent)
|
|
7118
7765
|
}), null, 16, [
|
|
7119
7766
|
"event",
|
|
7120
7767
|
"interactive",
|
|
7121
|
-
"style"
|
|
7768
|
+
"style",
|
|
7769
|
+
"with-resize",
|
|
7770
|
+
"is-resizing",
|
|
7771
|
+
"active-resize-edge",
|
|
7772
|
+
"resize-handle-props",
|
|
7773
|
+
"onResizeStart"
|
|
7122
7774
|
])]);
|
|
7123
7775
|
}), 128)),
|
|
7124
7776
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayEvents(resource.id), (event, index) => {
|
|
@@ -7160,7 +7812,8 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7160
7812
|
style: {
|
|
7161
7813
|
width: "100%",
|
|
7162
7814
|
height: "100%"
|
|
7163
|
-
}
|
|
7815
|
+
},
|
|
7816
|
+
mod: { invalid: (0, vue.unref)(resize).getResizePosition(event.id) !== null && !(0, vue.unref)(resize).resizeValid.value }
|
|
7164
7817
|
}, { ref_for: true }, {
|
|
7165
7818
|
...eventRenderers.value,
|
|
7166
7819
|
...stylesApi.value
|
|
@@ -7173,6 +7826,7 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7173
7826
|
"radius",
|
|
7174
7827
|
"mode",
|
|
7175
7828
|
"draggable",
|
|
7829
|
+
"mod",
|
|
7176
7830
|
"onClick"
|
|
7177
7831
|
]), (0, vue.unref)(resize).isResizableEvent(event) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, (0, vue.renderList)(["start", "end"], (edge) => {
|
|
7178
7832
|
return (0, vue.createElementVNode)("div", (0, vue.mergeProps)({ key: edge }, { ref_for: true }, (0, vue.unref)(staticStyles)("resourcesDayViewResizeHandle"), {
|
|
@@ -7218,6 +7872,7 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7218
7872
|
"data-business-hours": businessHoursMods.value[slotIndex]["business-hours"] || void 0,
|
|
7219
7873
|
"data-non-business-hours": businessHoursMods.value[slotIndex]["non-business-hours"] || void 0,
|
|
7220
7874
|
"data-drop-target": dropTarget.value?.resourceId === resource.id && dropTarget.value.slotIndex === slotIndex || void 0,
|
|
7875
|
+
"data-invalid": dropTarget.value?.resourceId === resource.id && dropTarget.value.slotIndex === slotIndex && !dropValid.value || void 0,
|
|
7221
7876
|
"data-drag-selected": (0, vue.unref)(slotSelect).isSlotSelected(slotIndex, String(resource.id)) || void 0,
|
|
7222
7877
|
"data-static": isStatic.value || void 0,
|
|
7223
7878
|
"data-drag-slot-index": (0, vue.unref)(props).withDragSlotSelect ? slotIndex : void 0,
|
|
@@ -7248,6 +7903,7 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7248
7903
|
"data-business-hours",
|
|
7249
7904
|
"data-non-business-hours",
|
|
7250
7905
|
"data-drop-target",
|
|
7906
|
+
"data-invalid",
|
|
7251
7907
|
"data-drag-selected",
|
|
7252
7908
|
"data-static",
|
|
7253
7909
|
"data-drag-slot-index",
|
|
@@ -7370,31 +8026,31 @@ function getResourcesWeekViewEvents({ events, resources, weekdays, startTime, en
|
|
|
7370
8026
|
};
|
|
7371
8027
|
}
|
|
7372
8028
|
var ResourcesWeekView_module_default = {
|
|
7373
|
-
resourcesWeekView: "
|
|
7374
|
-
resourcesWeekViewRoot: "
|
|
7375
|
-
resourcesWeekViewScrollArea: "
|
|
7376
|
-
resourcesWeekViewInner: "
|
|
7377
|
-
resourcesWeekViewHeaderRows: "
|
|
7378
|
-
resourcesWeekViewCorner: "
|
|
7379
|
-
resourcesWeekViewHeaderContent: "
|
|
7380
|
-
resourcesWeekViewDayLabelsRow: "
|
|
7381
|
-
resourcesWeekViewDayLabel: "
|
|
7382
|
-
resourcesWeekViewTimeLabelsRow: "
|
|
7383
|
-
resourcesWeekViewTimeLabel: "
|
|
7384
|
-
resourcesWeekViewRow: "
|
|
7385
|
-
resourcesWeekViewResourceLabel: "
|
|
7386
|
-
resourcesWeekViewGroupColumn: "
|
|
7387
|
-
resourcesWeekViewGroupColumnEmpty: "
|
|
7388
|
-
resourcesWeekViewRowSlots: "
|
|
7389
|
-
resourcesWeekViewRowSlot: "
|
|
7390
|
-
resourcesWeekViewBackgroundEvent: "
|
|
7391
|
-
resourcesWeekViewAllDayEvent: "
|
|
7392
|
-
resourcesWeekViewEventWrapper: "
|
|
7393
|
-
resourcesWeekViewResizeHandle: "
|
|
7394
|
-
resourcesWeekViewCurrentTimeIndicator: "
|
|
7395
|
-
resourcesWeekViewCurrentTimeIndicatorLine: "
|
|
7396
|
-
resourcesWeekViewCurrentTimeIndicatorThumb: "
|
|
7397
|
-
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "
|
|
8029
|
+
resourcesWeekView: "_resourcesWeekView_1g2tz_1",
|
|
8030
|
+
resourcesWeekViewRoot: "_resourcesWeekViewRoot_1g2tz_19",
|
|
8031
|
+
resourcesWeekViewScrollArea: "_resourcesWeekViewScrollArea_1g2tz_26",
|
|
8032
|
+
resourcesWeekViewInner: "_resourcesWeekViewInner_1g2tz_34",
|
|
8033
|
+
resourcesWeekViewHeaderRows: "_resourcesWeekViewHeaderRows_1g2tz_39",
|
|
8034
|
+
resourcesWeekViewCorner: "_resourcesWeekViewCorner_1g2tz_48",
|
|
8035
|
+
resourcesWeekViewHeaderContent: "_resourcesWeekViewHeaderContent_1g2tz_63",
|
|
8036
|
+
resourcesWeekViewDayLabelsRow: "_resourcesWeekViewDayLabelsRow_1g2tz_67",
|
|
8037
|
+
resourcesWeekViewDayLabel: "_resourcesWeekViewDayLabel_1g2tz_67",
|
|
8038
|
+
resourcesWeekViewTimeLabelsRow: "_resourcesWeekViewTimeLabelsRow_1g2tz_94",
|
|
8039
|
+
resourcesWeekViewTimeLabel: "_resourcesWeekViewTimeLabel_1g2tz_94",
|
|
8040
|
+
resourcesWeekViewRow: "_resourcesWeekViewRow_1g2tz_121",
|
|
8041
|
+
resourcesWeekViewResourceLabel: "_resourcesWeekViewResourceLabel_1g2tz_125",
|
|
8042
|
+
resourcesWeekViewGroupColumn: "_resourcesWeekViewGroupColumn_1g2tz_149",
|
|
8043
|
+
resourcesWeekViewGroupColumnEmpty: "_resourcesWeekViewGroupColumnEmpty_1g2tz_150",
|
|
8044
|
+
resourcesWeekViewRowSlots: "_resourcesWeekViewRowSlots_1g2tz_178",
|
|
8045
|
+
resourcesWeekViewRowSlot: "_resourcesWeekViewRowSlot_1g2tz_178",
|
|
8046
|
+
resourcesWeekViewBackgroundEvent: "_resourcesWeekViewBackgroundEvent_1g2tz_259",
|
|
8047
|
+
resourcesWeekViewAllDayEvent: "_resourcesWeekViewAllDayEvent_1g2tz_287",
|
|
8048
|
+
resourcesWeekViewEventWrapper: "_resourcesWeekViewEventWrapper_1g2tz_292",
|
|
8049
|
+
resourcesWeekViewResizeHandle: "_resourcesWeekViewResizeHandle_1g2tz_296",
|
|
8050
|
+
resourcesWeekViewCurrentTimeIndicator: "_resourcesWeekViewCurrentTimeIndicator_1g2tz_373",
|
|
8051
|
+
resourcesWeekViewCurrentTimeIndicatorLine: "_resourcesWeekViewCurrentTimeIndicatorLine_1g2tz_385",
|
|
8052
|
+
resourcesWeekViewCurrentTimeIndicatorThumb: "_resourcesWeekViewCurrentTimeIndicatorThumb_1g2tz_391",
|
|
8053
|
+
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "_resourcesWeekViewCurrentTimeIndicatorTimeBubble_1g2tz_401"
|
|
7398
8054
|
};
|
|
7399
8055
|
//#endregion
|
|
7400
8056
|
//#region src/components/ResourcesWeekView/ResourcesWeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -7528,6 +8184,10 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7528
8184
|
type: Function,
|
|
7529
8185
|
default: void 0
|
|
7530
8186
|
},
|
|
8187
|
+
canDropEvent: {},
|
|
8188
|
+
canDropExternalEvent: {},
|
|
8189
|
+
canResizeEventTo: {},
|
|
8190
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
7531
8191
|
recurrenceExpansionLimit: { default: void 0 },
|
|
7532
8192
|
maxEventsPerTimeSlot: { default: void 0 },
|
|
7533
8193
|
moreEventsProps: { default: void 0 },
|
|
@@ -7560,7 +8220,8 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7560
8220
|
"timeSlotClick",
|
|
7561
8221
|
"slotDragEnd",
|
|
7562
8222
|
"externalEventDrop",
|
|
7563
|
-
"eventResize"
|
|
8223
|
+
"eventResize",
|
|
8224
|
+
"eventPlacementRejected"
|
|
7564
8225
|
],
|
|
7565
8226
|
setup(__props, { emit: __emit }) {
|
|
7566
8227
|
const rawProps = __props;
|
|
@@ -7604,6 +8265,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7604
8265
|
rootElement.value = node instanceof HTMLElement ? node : null;
|
|
7605
8266
|
};
|
|
7606
8267
|
const dropTarget = (0, vue.shallowRef)(null);
|
|
8268
|
+
const dropValid = (0, vue.ref)(true);
|
|
7607
8269
|
const scrolledX = (0, vue.ref)(false);
|
|
7608
8270
|
const isStatic = (0, vue.computed)(() => props.mode === "static");
|
|
7609
8271
|
const intervals = (0, vue.computed)(() => getDayTimeIntervals({
|
|
@@ -7691,7 +8353,12 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7691
8353
|
intervalMinutes: () => props.intervalMinutes,
|
|
7692
8354
|
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
7693
8355
|
onEventResize: (data) => emit("eventResize", data),
|
|
7694
|
-
canResizeEvent: () => props.canResizeEvent
|
|
8356
|
+
canResizeEvent: () => props.canResizeEvent,
|
|
8357
|
+
events: () => props.events ?? [],
|
|
8358
|
+
preventEventOverlap: () => props.preventEventOverlap,
|
|
8359
|
+
canResizeEventTo: () => props.canResizeEventTo,
|
|
8360
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data),
|
|
8361
|
+
withBackgroundEvents: () => Boolean(props.withInteractiveBackgroundEvents)
|
|
7695
8362
|
});
|
|
7696
8363
|
(0, vue.onMounted)(async () => {
|
|
7697
8364
|
if (!props.startScrollDateTime) return;
|
|
@@ -7733,15 +8400,51 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7733
8400
|
if (!day || !interval) return;
|
|
7734
8401
|
const target = getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime);
|
|
7735
8402
|
const event = getDropEvent(props.events, nativeEvent.dataTransfer);
|
|
7736
|
-
if (event)
|
|
7737
|
-
|
|
8403
|
+
if (event) {
|
|
8404
|
+
const next = moveEventTo(event, target);
|
|
8405
|
+
const validation = isEventPlacementAllowed({
|
|
8406
|
+
event,
|
|
8407
|
+
start: next.newStart,
|
|
8408
|
+
end: next.newEnd,
|
|
8409
|
+
events: props.events ?? [],
|
|
8410
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
8411
|
+
resourceId
|
|
8412
|
+
});
|
|
8413
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
8414
|
+
event,
|
|
8415
|
+
start: next.newStart,
|
|
8416
|
+
end: next.newEnd,
|
|
8417
|
+
resourceId
|
|
8418
|
+
}) !== false) emit("eventDrop", {
|
|
8419
|
+
...next,
|
|
8420
|
+
resourceId
|
|
8421
|
+
});
|
|
8422
|
+
else emit("eventPlacementRejected", {
|
|
8423
|
+
action: "drop",
|
|
8424
|
+
event,
|
|
8425
|
+
start: next.newStart,
|
|
8426
|
+
end: next.newEnd,
|
|
8427
|
+
resourceId,
|
|
8428
|
+
conflicts: validation.conflicts,
|
|
8429
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
8430
|
+
});
|
|
8431
|
+
} else if (nativeEvent.dataTransfer) if (props.canDropExternalEvent?.({
|
|
8432
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
8433
|
+
start: target,
|
|
7738
8434
|
resourceId
|
|
7739
|
-
})
|
|
7740
|
-
else if (nativeEvent.dataTransfer) emit("externalEventDrop", {
|
|
8435
|
+
}) !== false) emit("externalEventDrop", {
|
|
7741
8436
|
dataTransfer: nativeEvent.dataTransfer,
|
|
7742
8437
|
dropDateTime: target,
|
|
7743
8438
|
resourceId
|
|
7744
8439
|
});
|
|
8440
|
+
else emit("eventPlacementRejected", {
|
|
8441
|
+
action: "external-drop",
|
|
8442
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
8443
|
+
start: target,
|
|
8444
|
+
resourceId,
|
|
8445
|
+
conflicts: [],
|
|
8446
|
+
reason: "rejected"
|
|
8447
|
+
});
|
|
7745
8448
|
};
|
|
7746
8449
|
const getSnappedDropTarget = (nativeEvent, day, flatIndex, slotStartTime) => {
|
|
7747
8450
|
if (props.eventDragInterval == null) return `${day} ${slotStartTime}`;
|
|
@@ -7772,6 +8475,31 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7772
8475
|
*/
|
|
7773
8476
|
const resolveDropTarget = rafThrottle((nativeEvent, resourceId, resourceIndex) => {
|
|
7774
8477
|
const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex);
|
|
8478
|
+
const count = slotsPerDay.value;
|
|
8479
|
+
const day = weekdays.value[Math.floor(flatIndex / count)];
|
|
8480
|
+
const interval = intervals.value[flatIndex % count];
|
|
8481
|
+
const target = flatIndex >= 0 && day && interval ? getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime) : null;
|
|
8482
|
+
const event = dragState.draggedEvent.value;
|
|
8483
|
+
if (target && event) {
|
|
8484
|
+
const next = moveEventTo(event, target);
|
|
8485
|
+
dropValid.value = isEventPlacementAllowed({
|
|
8486
|
+
event,
|
|
8487
|
+
start: next.newStart,
|
|
8488
|
+
end: next.newEnd,
|
|
8489
|
+
events: props.events ?? [],
|
|
8490
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
8491
|
+
resourceId
|
|
8492
|
+
}).allowed && props.canDropEvent?.({
|
|
8493
|
+
event,
|
|
8494
|
+
start: next.newStart,
|
|
8495
|
+
end: next.newEnd,
|
|
8496
|
+
resourceId
|
|
8497
|
+
}) !== false;
|
|
8498
|
+
} else if (target && nativeEvent.dataTransfer) dropValid.value = props.canDropExternalEvent?.({
|
|
8499
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
8500
|
+
start: target,
|
|
8501
|
+
resourceId
|
|
8502
|
+
}) !== false;
|
|
7775
8503
|
setDropTarget(flatIndex < 0 ? null : {
|
|
7776
8504
|
resourceId,
|
|
7777
8505
|
flatIndex
|
|
@@ -7807,7 +8535,10 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7807
8535
|
dayIndex
|
|
7808
8536
|
}));
|
|
7809
8537
|
});
|
|
7810
|
-
const backgroundEventStyle = (event, dayIndex) => {
|
|
8538
|
+
const backgroundEventStyle = (event, day, dayIndex) => {
|
|
8539
|
+
const resizePosition = resize.getResizePosition(event.id, day);
|
|
8540
|
+
const left = resizePosition?.left ?? event.position.top;
|
|
8541
|
+
const width = resizePosition?.width ?? event.position.height;
|
|
7811
8542
|
const colors = theme.value.variantColorResolver({
|
|
7812
8543
|
color: event.color || theme.value.primaryColor,
|
|
7813
8544
|
theme: theme.value,
|
|
@@ -7815,8 +8546,8 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7815
8546
|
autoContrast: true
|
|
7816
8547
|
});
|
|
7817
8548
|
return {
|
|
7818
|
-
left: `${dayOffset(dayIndex) +
|
|
7819
|
-
right: `${100 - dayOffset(dayIndex) - (
|
|
8549
|
+
left: `${dayOffset(dayIndex) + left / 100 * dayWidth.value}%`,
|
|
8550
|
+
right: `${100 - dayOffset(dayIndex) - (left + width) / 100 * dayWidth.value}%`,
|
|
7820
8551
|
minWidth: "1px",
|
|
7821
8552
|
top: 0,
|
|
7822
8553
|
height: "100%",
|
|
@@ -8068,12 +8799,23 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8068
8799
|
...eventRenderers.value,
|
|
8069
8800
|
...(0, vue.unref)(getStyles)("resourcesWeekViewBackgroundEvent")
|
|
8070
8801
|
}, {
|
|
8071
|
-
style: backgroundEventStyle(entry.event, entry.dayIndex),
|
|
8072
|
-
|
|
8802
|
+
style: backgroundEventStyle(entry.event, entry.day, entry.dayIndex),
|
|
8803
|
+
"with-resize": (0, vue.unref)(resize).isResizableEvent(entry.event) && !entry.event.position.allDay,
|
|
8804
|
+
"resize-axis": "horizontal",
|
|
8805
|
+
"is-resizing": (0, vue.unref)(resize).getResizePosition(entry.event.id, entry.day) !== null,
|
|
8806
|
+
"active-resize-edge": (0, vue.unref)(resize).resizingEdge,
|
|
8807
|
+
"resize-handle-props": (0, vue.unref)(staticStyles)("resourcesWeekViewResizeHandle"),
|
|
8808
|
+
onEventClick: clickEvent,
|
|
8809
|
+
onResizeStart: (edge, pointerEvent) => startResize(entry.event, entry.day, entry.dayIndex, resourceIndex, edge, pointerEvent)
|
|
8073
8810
|
}), null, 16, [
|
|
8074
8811
|
"event",
|
|
8075
8812
|
"interactive",
|
|
8076
|
-
"style"
|
|
8813
|
+
"style",
|
|
8814
|
+
"with-resize",
|
|
8815
|
+
"is-resizing",
|
|
8816
|
+
"active-resize-edge",
|
|
8817
|
+
"resize-handle-props",
|
|
8818
|
+
"onResizeStart"
|
|
8077
8819
|
])]);
|
|
8078
8820
|
}), 128)),
|
|
8079
8821
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayBars(resource.id), (bar) => {
|
|
@@ -8119,7 +8861,8 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8119
8861
|
style: {
|
|
8120
8862
|
width: "100%",
|
|
8121
8863
|
height: "100%"
|
|
8122
|
-
}
|
|
8864
|
+
},
|
|
8865
|
+
mod: { invalid: (0, vue.unref)(resize).getResizePosition(entry.event.id) !== null && !(0, vue.unref)(resize).resizeValid.value }
|
|
8123
8866
|
}, { ref_for: true }, {
|
|
8124
8867
|
...eventRenderers.value,
|
|
8125
8868
|
...stylesApi.value
|
|
@@ -8132,6 +8875,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8132
8875
|
"radius",
|
|
8133
8876
|
"mode",
|
|
8134
8877
|
"draggable",
|
|
8878
|
+
"mod",
|
|
8135
8879
|
"onClick"
|
|
8136
8880
|
]), (0, vue.unref)(resize).isResizableEvent(entry.event) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, (0, vue.renderList)(["start", "end"], (edge) => {
|
|
8137
8881
|
return (0, vue.createElementVNode)("div", (0, vue.mergeProps)({ key: edge }, { ref_for: true }, (0, vue.unref)(staticStyles)("resourcesWeekViewResizeHandle"), {
|
|
@@ -8179,6 +8923,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8179
8923
|
"data-business-hours": businessHoursMods.value[dayIndex][slotIndex]["business-hours"] || void 0,
|
|
8180
8924
|
"data-non-business-hours": businessHoursMods.value[dayIndex][slotIndex]["non-business-hours"] || void 0,
|
|
8181
8925
|
"data-drop-target": dropTarget.value?.resourceId === resource.id && dropTarget.value.flatIndex === dayIndex * slotsPerDay.value + slotIndex || void 0,
|
|
8926
|
+
"data-invalid": dropTarget.value?.resourceId === resource.id && dropTarget.value.flatIndex === dayIndex * slotsPerDay.value + slotIndex && !dropValid.value || void 0,
|
|
8182
8927
|
"data-drag-selected": (0, vue.unref)(slotSelect).isSlotSelected(dayIndex * slotsPerDay.value + slotIndex, String(resource.id)) || void 0,
|
|
8183
8928
|
"data-static": isStatic.value || void 0,
|
|
8184
8929
|
"data-drag-slot-index": (0, vue.unref)(props).withDragSlotSelect ? dayIndex * slotsPerDay.value + slotIndex : void 0,
|
|
@@ -8210,6 +8955,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8210
8955
|
"data-business-hours",
|
|
8211
8956
|
"data-non-business-hours",
|
|
8212
8957
|
"data-drop-target",
|
|
8958
|
+
"data-invalid",
|
|
8213
8959
|
"data-drag-selected",
|
|
8214
8960
|
"data-static",
|
|
8215
8961
|
"data-drag-slot-index",
|
|
@@ -8342,23 +9088,23 @@ function getResourcesMonthViewLayout({ days, events, resourceId, maxRows }) {
|
|
|
8342
9088
|
};
|
|
8343
9089
|
}
|
|
8344
9090
|
var ResourcesMonthView_module_default = {
|
|
8345
|
-
resourcesMonthView: "
|
|
8346
|
-
resourcesMonthViewRoot: "
|
|
8347
|
-
resourcesMonthViewScrollArea: "
|
|
8348
|
-
resourcesMonthViewInner: "
|
|
8349
|
-
resourcesMonthViewDayLabelsRow: "
|
|
8350
|
-
resourcesMonthViewCorner: "
|
|
8351
|
-
resourcesMonthViewDayLabel: "
|
|
8352
|
-
resourcesMonthViewDayLabelWeekday: "
|
|
8353
|
-
resourcesMonthViewDayLabelNumber: "
|
|
8354
|
-
resourcesMonthViewRow: "
|
|
8355
|
-
resourcesMonthViewResourceLabel: "
|
|
8356
|
-
resourcesMonthViewGroupColumn: "
|
|
8357
|
-
resourcesMonthViewGroupColumnEmpty: "
|
|
8358
|
-
resourcesMonthViewRowSlots: "
|
|
8359
|
-
resourcesMonthViewCell: "
|
|
8360
|
-
resourcesMonthViewEventWrapper: "
|
|
8361
|
-
resourcesMonthViewResizeHandle: "
|
|
9091
|
+
resourcesMonthView: "_resourcesMonthView_1rka1_1",
|
|
9092
|
+
resourcesMonthViewRoot: "_resourcesMonthViewRoot_1rka1_17",
|
|
9093
|
+
resourcesMonthViewScrollArea: "_resourcesMonthViewScrollArea_1rka1_24",
|
|
9094
|
+
resourcesMonthViewInner: "_resourcesMonthViewInner_1rka1_33",
|
|
9095
|
+
resourcesMonthViewDayLabelsRow: "_resourcesMonthViewDayLabelsRow_1rka1_37",
|
|
9096
|
+
resourcesMonthViewCorner: "_resourcesMonthViewCorner_1rka1_46",
|
|
9097
|
+
resourcesMonthViewDayLabel: "_resourcesMonthViewDayLabel_1rka1_37",
|
|
9098
|
+
resourcesMonthViewDayLabelWeekday: "_resourcesMonthViewDayLabelWeekday_1rka1_85",
|
|
9099
|
+
resourcesMonthViewDayLabelNumber: "_resourcesMonthViewDayLabelNumber_1rka1_92",
|
|
9100
|
+
resourcesMonthViewRow: "_resourcesMonthViewRow_1rka1_97",
|
|
9101
|
+
resourcesMonthViewResourceLabel: "_resourcesMonthViewResourceLabel_1rka1_101",
|
|
9102
|
+
resourcesMonthViewGroupColumn: "_resourcesMonthViewGroupColumn_1rka1_120",
|
|
9103
|
+
resourcesMonthViewGroupColumnEmpty: "_resourcesMonthViewGroupColumnEmpty_1rka1_121",
|
|
9104
|
+
resourcesMonthViewRowSlots: "_resourcesMonthViewRowSlots_1rka1_149",
|
|
9105
|
+
resourcesMonthViewCell: "_resourcesMonthViewCell_1rka1_154",
|
|
9106
|
+
resourcesMonthViewEventWrapper: "_resourcesMonthViewEventWrapper_1rka1_239",
|
|
9107
|
+
resourcesMonthViewResizeHandle: "_resourcesMonthViewResizeHandle_1rka1_240"
|
|
8362
9108
|
};
|
|
8363
9109
|
//#endregion
|
|
8364
9110
|
//#region src/components/ResourcesMonthView/ResourcesMonthView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -8467,6 +9213,10 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8467
9213
|
type: Function,
|
|
8468
9214
|
default: void 0
|
|
8469
9215
|
},
|
|
9216
|
+
canDropEvent: {},
|
|
9217
|
+
canDropExternalEvent: {},
|
|
9218
|
+
canResizeEventTo: {},
|
|
9219
|
+
preventEventOverlap: { type: [Boolean, Function] },
|
|
8470
9220
|
withExternalEventDrop: { type: Boolean },
|
|
8471
9221
|
withDragSlotSelect: { type: Boolean },
|
|
8472
9222
|
labels: { default: void 0 },
|
|
@@ -8490,7 +9240,8 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8490
9240
|
"eventDragEnd",
|
|
8491
9241
|
"slotDragEnd",
|
|
8492
9242
|
"externalEventDrop",
|
|
8493
|
-
"eventResize"
|
|
9243
|
+
"eventResize",
|
|
9244
|
+
"eventPlacementRejected"
|
|
8494
9245
|
],
|
|
8495
9246
|
setup(__props, { emit: __emit }) {
|
|
8496
9247
|
const rawProps = __props;
|
|
@@ -8534,6 +9285,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8534
9285
|
rootElement.value = node instanceof HTMLElement ? node : null;
|
|
8535
9286
|
};
|
|
8536
9287
|
const dropTarget = (0, vue.shallowRef)(null);
|
|
9288
|
+
const dropValid = (0, vue.ref)(true);
|
|
8537
9289
|
const isStatic = (0, vue.computed)(() => props.mode === "static");
|
|
8538
9290
|
const month = (0, vue.computed)(() => (0, dayjs.default)(props.date).startOf("month"));
|
|
8539
9291
|
const monthString = (0, vue.computed)(() => month.value.format("YYYY-MM-DD"));
|
|
@@ -8549,6 +9301,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8549
9301
|
expansionLimit: props.recurrenceExpansionLimit
|
|
8550
9302
|
}));
|
|
8551
9303
|
const resizeState = (0, vue.shallowRef)(null);
|
|
9304
|
+
const resizeValid = (0, vue.ref)(true);
|
|
8552
9305
|
let justResized = false;
|
|
8553
9306
|
const effectiveEvents = (0, vue.computed)(() => {
|
|
8554
9307
|
const state = resizeState.value;
|
|
@@ -8621,18 +9374,57 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8621
9374
|
draggedEvent: dragged,
|
|
8622
9375
|
targetDay: day
|
|
8623
9376
|
});
|
|
8624
|
-
|
|
9377
|
+
const start = (0, dayjs.default)(next.start).format("YYYY-MM-DD HH:mm:ss");
|
|
9378
|
+
const end = (0, dayjs.default)(next.end).format("YYYY-MM-DD HH:mm:ss");
|
|
9379
|
+
const validation = isEventPlacementAllowed({
|
|
9380
|
+
event: dragged,
|
|
9381
|
+
start,
|
|
9382
|
+
end,
|
|
9383
|
+
events: expandedEvents.value,
|
|
9384
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
9385
|
+
resourceId
|
|
9386
|
+
});
|
|
9387
|
+
if (validation.allowed && props.canDropEvent?.({
|
|
9388
|
+
event: dragged,
|
|
9389
|
+
start,
|
|
9390
|
+
end,
|
|
9391
|
+
resourceId
|
|
9392
|
+
}) !== false) emit("eventDrop", {
|
|
8625
9393
|
eventId: dragged.id,
|
|
8626
|
-
newStart:
|
|
8627
|
-
newEnd:
|
|
9394
|
+
newStart: start,
|
|
9395
|
+
newEnd: end,
|
|
8628
9396
|
event: dragged,
|
|
8629
9397
|
resourceId
|
|
8630
9398
|
});
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
9399
|
+
else emit("eventPlacementRejected", {
|
|
9400
|
+
action: "drop",
|
|
9401
|
+
event: dragged,
|
|
9402
|
+
start,
|
|
9403
|
+
end,
|
|
9404
|
+
resourceId,
|
|
9405
|
+
conflicts: validation.conflicts,
|
|
9406
|
+
reason: validation.allowed ? "rejected" : "overlap"
|
|
9407
|
+
});
|
|
9408
|
+
} else if (nativeEvent.dataTransfer) {
|
|
9409
|
+
const start = `${day} 00:00:00`;
|
|
9410
|
+
if (props.canDropExternalEvent?.({
|
|
9411
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
9412
|
+
start,
|
|
9413
|
+
resourceId
|
|
9414
|
+
}) !== false) emit("externalEventDrop", {
|
|
9415
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
9416
|
+
dropDateTime: start,
|
|
9417
|
+
resourceId
|
|
9418
|
+
});
|
|
9419
|
+
else emit("eventPlacementRejected", {
|
|
9420
|
+
action: "external-drop",
|
|
9421
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
9422
|
+
start,
|
|
9423
|
+
resourceId,
|
|
9424
|
+
conflicts: [],
|
|
9425
|
+
reason: "rejected"
|
|
9426
|
+
});
|
|
9427
|
+
}
|
|
8636
9428
|
};
|
|
8637
9429
|
const setDropTarget = (next) => {
|
|
8638
9430
|
const current = dropTarget.value;
|
|
@@ -8647,6 +9439,36 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8647
9439
|
*/
|
|
8648
9440
|
const resolveDropTarget = rafThrottle((nativeEvent, resourceId, resourceIndex) => {
|
|
8649
9441
|
const dayIndex = indexAtPoint(nativeEvent, resourceIndex);
|
|
9442
|
+
const day = days.value[dayIndex];
|
|
9443
|
+
const dragged = dragState.draggedEvent.value;
|
|
9444
|
+
if (day && dragged) {
|
|
9445
|
+
const next = calculateMonthDropDate({
|
|
9446
|
+
draggedEvent: dragged,
|
|
9447
|
+
targetDay: day
|
|
9448
|
+
});
|
|
9449
|
+
const start = (0, dayjs.default)(next.start).format("YYYY-MM-DD HH:mm:ss");
|
|
9450
|
+
const end = (0, dayjs.default)(next.end).format("YYYY-MM-DD HH:mm:ss");
|
|
9451
|
+
dropValid.value = isEventPlacementAllowed({
|
|
9452
|
+
event: dragged,
|
|
9453
|
+
start,
|
|
9454
|
+
end,
|
|
9455
|
+
events: expandedEvents.value,
|
|
9456
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
9457
|
+
resourceId
|
|
9458
|
+
}).allowed && props.canDropEvent?.({
|
|
9459
|
+
event: dragged,
|
|
9460
|
+
start,
|
|
9461
|
+
end,
|
|
9462
|
+
resourceId
|
|
9463
|
+
}) !== false;
|
|
9464
|
+
} else if (day && nativeEvent.dataTransfer) {
|
|
9465
|
+
const start = `${day} 00:00:00`;
|
|
9466
|
+
dropValid.value = props.canDropExternalEvent?.({
|
|
9467
|
+
dataTransfer: nativeEvent.dataTransfer,
|
|
9468
|
+
start,
|
|
9469
|
+
resourceId
|
|
9470
|
+
}) !== false;
|
|
9471
|
+
}
|
|
8650
9472
|
setDropTarget(dayIndex < 0 ? null : {
|
|
8651
9473
|
resourceId,
|
|
8652
9474
|
dayIndex
|
|
@@ -8769,6 +9591,16 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8769
9591
|
...calculateResizeDates(state.event, state.edge, days.value[dayIndex]),
|
|
8770
9592
|
dayIndex
|
|
8771
9593
|
};
|
|
9594
|
+
resizeValid.value = validateEventResize({
|
|
9595
|
+
event: state.event,
|
|
9596
|
+
start: resizeState.value.start,
|
|
9597
|
+
end: resizeState.value.end,
|
|
9598
|
+
edge: state.edge,
|
|
9599
|
+
events: expandedEvents.value,
|
|
9600
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
9601
|
+
canResizeEventTo: props.canResizeEventTo,
|
|
9602
|
+
resourceId: state.event.resourceId
|
|
9603
|
+
}).valid;
|
|
8772
9604
|
};
|
|
8773
9605
|
const stopResizeListeners = () => {
|
|
8774
9606
|
document.removeEventListener("pointermove", handleResizeMove);
|
|
@@ -8779,12 +9611,33 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8779
9611
|
const state = resizeState.value;
|
|
8780
9612
|
stopResizeListeners();
|
|
8781
9613
|
resizeState.value = null;
|
|
8782
|
-
if (emitChange && state && (state.start !== state.originalStart || state.end !== state.originalEnd))
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
9614
|
+
if (emitChange && state && (state.start !== state.originalStart || state.end !== state.originalEnd)) {
|
|
9615
|
+
const validation = validateEventResize({
|
|
9616
|
+
event: state.event,
|
|
9617
|
+
start: state.start,
|
|
9618
|
+
end: state.end,
|
|
9619
|
+
edge: state.edge,
|
|
9620
|
+
events: expandedEvents.value,
|
|
9621
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
9622
|
+
canResizeEventTo: props.canResizeEventTo,
|
|
9623
|
+
resourceId: state.event.resourceId
|
|
9624
|
+
});
|
|
9625
|
+
if (validation.valid) emit("eventResize", {
|
|
9626
|
+
eventId: state.event.id,
|
|
9627
|
+
newStart: state.start,
|
|
9628
|
+
newEnd: state.end,
|
|
9629
|
+
event: state.event
|
|
9630
|
+
});
|
|
9631
|
+
else emit("eventPlacementRejected", {
|
|
9632
|
+
action: "resize",
|
|
9633
|
+
event: state.event,
|
|
9634
|
+
start: state.start,
|
|
9635
|
+
end: state.end,
|
|
9636
|
+
edge: state.edge,
|
|
9637
|
+
conflicts: validation.conflicts,
|
|
9638
|
+
reason: validation.reason
|
|
9639
|
+
});
|
|
9640
|
+
}
|
|
8788
9641
|
justResized = true;
|
|
8789
9642
|
requestAnimationFrame(() => justResized = false);
|
|
8790
9643
|
};
|
|
@@ -8810,6 +9663,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8810
9663
|
end,
|
|
8811
9664
|
dayIndex: -1
|
|
8812
9665
|
};
|
|
9666
|
+
resizeValid.value = true;
|
|
8813
9667
|
document.addEventListener("pointermove", handleResizeMove);
|
|
8814
9668
|
document.addEventListener("pointerup", handleResizeEnd);
|
|
8815
9669
|
document.addEventListener("pointercancel", handleResizeCancel);
|
|
@@ -8938,6 +9792,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8938
9792
|
mode: (0, vue.unref)(props).mode,
|
|
8939
9793
|
draggable: isDraggableEvent(entry.event),
|
|
8940
9794
|
"is-resizing": isResizingEvent(entry.event),
|
|
9795
|
+
mod: { invalid: isResizingEvent(entry.event) && !resizeValid.value },
|
|
8941
9796
|
style: {
|
|
8942
9797
|
"width": "100%",
|
|
8943
9798
|
"height": "100%"
|
|
@@ -8955,6 +9810,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8955
9810
|
"mode",
|
|
8956
9811
|
"draggable",
|
|
8957
9812
|
"is-resizing",
|
|
9813
|
+
"mod",
|
|
8958
9814
|
"onClick"
|
|
8959
9815
|
]),
|
|
8960
9816
|
isResizableEvent(entry.event) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
@@ -8992,6 +9848,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8992
9848
|
mode: (0, vue.unref)(props).mode,
|
|
8993
9849
|
draggable: isDraggableEvent(segment.event),
|
|
8994
9850
|
"is-resizing": isResizingEvent(segment.event),
|
|
9851
|
+
mod: { invalid: isResizingEvent(segment.event) && !resizeValid.value },
|
|
8995
9852
|
style: {
|
|
8996
9853
|
"width": "100%",
|
|
8997
9854
|
"height": "100%"
|
|
@@ -9010,6 +9867,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9010
9867
|
"mode",
|
|
9011
9868
|
"draggable",
|
|
9012
9869
|
"is-resizing",
|
|
9870
|
+
"mod",
|
|
9013
9871
|
"onClick"
|
|
9014
9872
|
]),
|
|
9015
9873
|
isResizableEvent(segment.event) && segment.hanging !== "start" && segment.hanging !== "both" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
@@ -9065,6 +9923,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9065
9923
|
}, { ref_for: true }, (0, vue.unref)(staticStyles)("resourcesMonthViewCell"), {
|
|
9066
9924
|
"data-weekend": (0, vue.unref)(props).weekendDays.includes((0, vue.unref)(dayjs.default)(day).day()) || void 0,
|
|
9067
9925
|
"data-drop-target": dropTarget.value?.resourceId === resource.id && dropTarget.value.dayIndex === dayIndex || void 0,
|
|
9926
|
+
"data-invalid": dropTarget.value?.resourceId === resource.id && dropTarget.value.dayIndex === dayIndex && !dropValid.value || void 0,
|
|
9068
9927
|
"data-drag-selected": (0, vue.unref)(slotSelect).isSlotSelected(dayIndex, String(resource.id)) || void 0,
|
|
9069
9928
|
"data-static": isStatic.value || void 0,
|
|
9070
9929
|
"data-drag-slot-index": (0, vue.unref)(props).withDragSlotSelect ? dayIndex : void 0,
|
|
@@ -9092,6 +9951,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9092
9951
|
}, 1040, [
|
|
9093
9952
|
"data-weekend",
|
|
9094
9953
|
"data-drop-target",
|
|
9954
|
+
"data-invalid",
|
|
9095
9955
|
"data-drag-selected",
|
|
9096
9956
|
"data-static",
|
|
9097
9957
|
"data-drag-slot-index",
|
|
@@ -9166,6 +10026,22 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9166
10026
|
type: Function,
|
|
9167
10027
|
default: void 0
|
|
9168
10028
|
},
|
|
10029
|
+
canDropEvent: {
|
|
10030
|
+
type: Function,
|
|
10031
|
+
default: void 0
|
|
10032
|
+
},
|
|
10033
|
+
canDropExternalEvent: {
|
|
10034
|
+
type: Function,
|
|
10035
|
+
default: void 0
|
|
10036
|
+
},
|
|
10037
|
+
canResizeEventTo: {
|
|
10038
|
+
type: Function,
|
|
10039
|
+
default: void 0
|
|
10040
|
+
},
|
|
10041
|
+
preventEventOverlap: {
|
|
10042
|
+
type: [Boolean, Function],
|
|
10043
|
+
default: void 0
|
|
10044
|
+
},
|
|
9169
10045
|
withInteractiveBackgroundEvents: {
|
|
9170
10046
|
type: Boolean,
|
|
9171
10047
|
default: void 0
|
|
@@ -9192,7 +10068,8 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9192
10068
|
"dayClick",
|
|
9193
10069
|
"slotDragEnd",
|
|
9194
10070
|
"externalEventDrop",
|
|
9195
|
-
"eventResize"
|
|
10071
|
+
"eventResize",
|
|
10072
|
+
"eventPlacementRejected"
|
|
9196
10073
|
],
|
|
9197
10074
|
setup(__props, { emit: __emit }) {
|
|
9198
10075
|
const rawProps = __props;
|
|
@@ -9254,6 +10131,9 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9254
10131
|
renderResourceLabel: props.renderResourceLabel,
|
|
9255
10132
|
withEventsDragAndDrop: isStatic.value ? false : props.withEventsDragAndDrop,
|
|
9256
10133
|
canDragEvent: props.canDragEvent,
|
|
10134
|
+
canDropEvent: props.canDropEvent,
|
|
10135
|
+
canDropExternalEvent: props.canDropExternalEvent,
|
|
10136
|
+
preventEventOverlap: props.preventEventOverlap,
|
|
9257
10137
|
withDragSlotSelect: props.withDragSlotSelect,
|
|
9258
10138
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
9259
10139
|
withInteractiveBackgroundEvents: isStatic.value ? false : props.withInteractiveBackgroundEvents,
|
|
@@ -9265,6 +10145,7 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9265
10145
|
onEventClick: (event, nativeEvent) => emit("eventClick", event, nativeEvent),
|
|
9266
10146
|
onSlotDragEnd: (data) => emit("slotDragEnd", data),
|
|
9267
10147
|
onExternalEventDrop: (data) => emit("externalEventDrop", data),
|
|
10148
|
+
onEventPlacementRejected: (data) => emit("eventPlacementRejected", data),
|
|
9268
10149
|
...eventRenderers.value,
|
|
9269
10150
|
...stylesApi.value
|
|
9270
10151
|
}));
|
|
@@ -9272,6 +10153,7 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9272
10153
|
onTimeSlotClick: (data) => emit("timeSlotClick", data),
|
|
9273
10154
|
withEventResize: isStatic.value ? false : props.withEventResize,
|
|
9274
10155
|
canResizeEvent: props.canResizeEvent,
|
|
10156
|
+
canResizeEventTo: props.canResizeEventTo,
|
|
9275
10157
|
onEventResize: (data) => emit("eventResize", data)
|
|
9276
10158
|
}));
|
|
9277
10159
|
const activeView = (0, vue.computed)(() => {
|
|
@@ -9358,6 +10240,7 @@ exports.ScheduleHeaderToday = ScheduleHeaderToday;
|
|
|
9358
10240
|
exports.ViewSelect = ViewSelect;
|
|
9359
10241
|
exports.WeekView = WeekView;
|
|
9360
10242
|
exports.YearView = YearView;
|
|
10243
|
+
exports.applyCascadeLayout = applyCascadeLayout;
|
|
9361
10244
|
exports.calculateDropTime = calculateDropTime;
|
|
9362
10245
|
exports.calculateMonthDropDate = calculateMonthDropDate;
|
|
9363
10246
|
exports.clampIntervalMinutes = clampIntervalMinutes;
|
|
@@ -9400,6 +10283,7 @@ exports.isAfterMinDate = isAfterMinDate;
|
|
|
9400
10283
|
exports.isAllDayEvent = isAllDayEvent;
|
|
9401
10284
|
exports.isBeforeMaxDate = isBeforeMaxDate;
|
|
9402
10285
|
exports.isEventInTimeRange = isEventInTimeRange;
|
|
10286
|
+
exports.isEventPlacementAllowed = isEventPlacementAllowed;
|
|
9403
10287
|
exports.isEventsOverlap = isEventsOverlap;
|
|
9404
10288
|
exports.isInTimeRange = isInTimeRange;
|
|
9405
10289
|
exports.isMultiDayEvent = isMultiDayEvent;
|