@mantine-vue/schedule 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.cjs +755 -236
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +756 -238
- package/esm/index.mjs.map +1 -1
- package/lib/component-props.d.ts +15 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +6 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +8 -2
- package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +3 -0
- package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +3 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +6 -0
- package/lib/components/Schedule/Schedule.types.d.ts +2 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +3 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.types.d.ts +24 -0
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue.d.ts +15 -0
- package/lib/components/ScheduleBackgroundEvent/index.d.ts +1 -0
- package/lib/components/WeekView/get-week-view-events/find-available-column.d.ts +6 -3
- package/lib/components/YearView/YearView.d.ts +1 -0
- package/lib/components/YearView/YearView.types.d.ts +14 -1
- package/lib/components/YearView/YearView.vue.d.ts +9 -2
- package/lib/components/use-slot-drop-target.d.ts +4 -0
- package/lib/hooks/use-event-resize.d.ts +1 -0
- package/lib/hooks/use-horizontal-event-resize.d.ts +1 -0
- package/lib/index.d.mts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/types.d.ts +1 -1
- package/lib/utils/calculate-drop-time/calculate-drop-time.d.ts +11 -1
- package/package.json +4 -4
- package/styles.css +523 -370
- package/styles.layer.css +523 -370
package/cjs/index.cjs
CHANGED
|
@@ -364,12 +364,24 @@ function sortEvents(events) {
|
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/utils/is-events-overlap/is-events-overlap.ts
|
|
367
|
+
var timestampsCache = /* @__PURE__ */ new WeakMap();
|
|
368
|
+
function getTimestamps(event) {
|
|
369
|
+
const cached = timestampsCache.get(event);
|
|
370
|
+
if (cached && cached.start === event.start && cached.end === event.end) return cached;
|
|
371
|
+
const next = {
|
|
372
|
+
start: event.start,
|
|
373
|
+
end: event.end,
|
|
374
|
+
startTimestamp: (0, dayjs.default)(event.start).valueOf(),
|
|
375
|
+
endTimestamp: (0, dayjs.default)(event.end).valueOf()
|
|
376
|
+
};
|
|
377
|
+
timestampsCache.set(event, next);
|
|
378
|
+
return next;
|
|
379
|
+
}
|
|
367
380
|
/** Returns true if two events overlap in time */
|
|
368
381
|
function isEventsOverlap(event1, event2) {
|
|
369
|
-
const
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
return start1 < (0, dayjs.default)(event2.end).valueOf() && start2 < end1;
|
|
382
|
+
const first = getTimestamps(event1);
|
|
383
|
+
const second = getTimestamps(event2);
|
|
384
|
+
return first.startTimestamp < second.endTimestamp && second.startTimestamp < first.endTimestamp;
|
|
373
385
|
}
|
|
374
386
|
//#endregion
|
|
375
387
|
//#region src/utils/get-visible-events/get-visible-events.ts
|
|
@@ -463,13 +475,33 @@ function getDayPosition({ event, startTime = "00:00:00", endTime = "23:59:59", i
|
|
|
463
475
|
}
|
|
464
476
|
//#endregion
|
|
465
477
|
//#region src/utils/calculate-drop-time/calculate-drop-time.ts
|
|
466
|
-
function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset = 0, slotHeight = 64, intervalMinutes = 15 }) {
|
|
478
|
+
function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset = 0, slotHeight = 64, intervalMinutes = 15, slotOffset, slotSize, dragIntervalMinutes, startTime, endTime }) {
|
|
467
479
|
const eventDuration = (0, dayjs.default)(draggedEvent.end).diff((0, dayjs.default)(draggedEvent.start), "millisecond");
|
|
468
480
|
const parsedTime = parseTimeString(targetSlotTime);
|
|
469
|
-
const
|
|
481
|
+
const targetDay = (0, dayjs.default)(targetDate).startOf("day");
|
|
482
|
+
const baseTargetTime = targetDay.hour(parsedTime.hours).minute(parsedTime.minutes).second(0);
|
|
470
483
|
let finalTargetTime = baseTargetTime;
|
|
471
|
-
|
|
472
|
-
|
|
484
|
+
const offset = slotOffset ?? mouseYOffset;
|
|
485
|
+
const size = slotSize ?? slotHeight;
|
|
486
|
+
if (dragIntervalMinutes != null) {
|
|
487
|
+
const clampedDrag = clampIntervalMinutes(dragIntervalMinutes);
|
|
488
|
+
const gridInterval = clampIntervalMinutes(intervalMinutes);
|
|
489
|
+
const rawStartMinutes = parsedTime.hours * 60 + parsedTime.minutes + (size > 0 ? offset / size : 0) * gridInterval;
|
|
490
|
+
let snappedStartMinutes = Math.round(rawStartMinutes / clampedDrag) * clampedDrag;
|
|
491
|
+
const parsedEnd = endTime ? parseTimeString(endTime) : null;
|
|
492
|
+
const parsedStart = startTime ? parseTimeString(startTime) : null;
|
|
493
|
+
const maxStart = parsedEnd ? Math.floor((parsedEnd.hours * 60 + parsedEnd.minutes - 1) / clampedDrag) * clampedDrag : null;
|
|
494
|
+
const minStart = parsedStart ? Math.ceil((parsedStart.hours * 60 + parsedStart.minutes) / clampedDrag) * clampedDrag : null;
|
|
495
|
+
if (minStart !== null && maxStart !== null && minStart > maxStart) snappedStartMinutes = parsedStart.hours * 60 + parsedStart.minutes;
|
|
496
|
+
else {
|
|
497
|
+
if (maxStart !== null) snappedStartMinutes = Math.min(snappedStartMinutes, maxStart);
|
|
498
|
+
if (minStart !== null) snappedStartMinutes = Math.max(snappedStartMinutes, minStart);
|
|
499
|
+
}
|
|
500
|
+
const dayOffset = Math.floor(snappedStartMinutes / 1440);
|
|
501
|
+
const minutesInDay = snappedStartMinutes - dayOffset * 1440;
|
|
502
|
+
finalTargetTime = targetDay.add(dayOffset, "day").hour(Math.floor(minutesInDay / 60)).minute(minutesInDay % 60).second(0);
|
|
503
|
+
} else if (offset > 0 && size > 0) {
|
|
504
|
+
const offsetRatio = offset / size;
|
|
473
505
|
const offsetMinutes = Math.round(offsetRatio * intervalMinutes);
|
|
474
506
|
finalTargetTime = baseTargetTime.add(offsetMinutes, "minute");
|
|
475
507
|
}
|
|
@@ -545,6 +577,18 @@ function getExdateSet(recurrence) {
|
|
|
545
577
|
const values = recurrence.exdate.map((value) => (0, dayjs.default)(value)).filter((value) => value.isValid()).map((value) => value.format("YYYY-MM-DD HH:mm:ss"));
|
|
546
578
|
return new Set(values);
|
|
547
579
|
}
|
|
580
|
+
function toWallClockDate(value) {
|
|
581
|
+
return new Date(Date.UTC(value.year(), value.month(), value.date(), value.hour(), value.minute(), value.second(), value.millisecond()));
|
|
582
|
+
}
|
|
583
|
+
function fromWallClockDate(value) {
|
|
584
|
+
const result = new Date(2e3, 0, 1, 12);
|
|
585
|
+
result.setFullYear(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate());
|
|
586
|
+
result.setHours(value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
|
|
587
|
+
return (0, dayjs.default)(result);
|
|
588
|
+
}
|
|
589
|
+
function getWallClockDurationMs(start, end) {
|
|
590
|
+
return toWallClockDate(end).getTime() - toWallClockDate(start).getTime();
|
|
591
|
+
}
|
|
548
592
|
function getRRuleString(rule) {
|
|
549
593
|
const normalized = rule.trim();
|
|
550
594
|
if (!normalized.includes("\n")) return normalized.startsWith("RRULE:") ? normalized.replace(/^RRULE:/, "") : normalized;
|
|
@@ -556,10 +600,10 @@ function getOccurrenceStartsInRange(event, rangeStart, rangeEnd, expansionLimit,
|
|
|
556
600
|
if (!dtstart.isValid() || !event.recurrence) return [];
|
|
557
601
|
try {
|
|
558
602
|
const options = RRule.parseString(getRRuleString(event.recurrence.rrule));
|
|
559
|
-
options.dtstart = dtstart
|
|
603
|
+
options.dtstart = toWallClockDate(dtstart);
|
|
560
604
|
const rule = new RRule(options);
|
|
561
|
-
const searchStart = rangeStart.
|
|
562
|
-
return rule.between(searchStart, rangeEnd
|
|
605
|
+
const searchStart = new Date(toWallClockDate(rangeStart).getTime() - Math.max(0, durationMs));
|
|
606
|
+
return rule.between(searchStart, toWallClockDate(rangeEnd), true).slice(0, expansionLimit);
|
|
563
607
|
} catch {
|
|
564
608
|
return [];
|
|
565
609
|
}
|
|
@@ -570,8 +614,7 @@ function isEventInRange(event, rangeStart, rangeEnd) {
|
|
|
570
614
|
if (!start.isValid() || !end.isValid()) return false;
|
|
571
615
|
return overlapsRange(start, end, rangeStart, rangeEnd);
|
|
572
616
|
}
|
|
573
|
-
function createGeneratedInstance(event, occurrenceStart,
|
|
574
|
-
const occurrenceEnd = occurrenceStart.add(durationMs, "millisecond");
|
|
617
|
+
function createGeneratedInstance(event, occurrenceStart, occurrenceEnd) {
|
|
575
618
|
const recurrenceId = occurrenceStart.format("YYYY-MM-DD HH:mm:ss");
|
|
576
619
|
const { recurrence: _recurrence, ...eventWithoutRecurrence } = event;
|
|
577
620
|
return {
|
|
@@ -617,11 +660,12 @@ function expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit =
|
|
|
617
660
|
const eventStart = (0, dayjs.default)(event.recurrence?.dtstart || event.start);
|
|
618
661
|
const eventEnd = (0, dayjs.default)(event.end);
|
|
619
662
|
if (!eventStart.isValid() || !eventEnd.isValid()) continue;
|
|
620
|
-
const durationMs =
|
|
663
|
+
const durationMs = getWallClockDurationMs((0, dayjs.default)(event.start), eventEnd);
|
|
621
664
|
if (durationMs < 0) continue;
|
|
622
665
|
const exdate = getExdateSet(event.recurrence);
|
|
623
666
|
const starts = getOccurrenceStartsInRange(event, start, end, expansionLimit, durationMs);
|
|
624
|
-
for (const
|
|
667
|
+
for (const wallClockStart of starts) {
|
|
668
|
+
const occurrenceStart = fromWallClockDate(wallClockStart);
|
|
625
669
|
const recurrenceId = occurrenceStart.format("YYYY-MM-DD HH:mm:ss");
|
|
626
670
|
if (exdate.has(recurrenceId)) continue;
|
|
627
671
|
const overrideKey = getRecurrenceKey(event.id, recurrenceId);
|
|
@@ -633,7 +677,7 @@ function expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit =
|
|
|
633
677
|
}
|
|
634
678
|
continue;
|
|
635
679
|
}
|
|
636
|
-
const generated = createGeneratedInstance(event, occurrenceStart, durationMs);
|
|
680
|
+
const generated = createGeneratedInstance(event, occurrenceStart, fromWallClockDate(new Date(wallClockStart.getTime() + durationMs)));
|
|
637
681
|
if (overlapsRange((0, dayjs.default)(generated.start), (0, dayjs.default)(generated.end), start, end)) output.push(validateEvent(generated));
|
|
638
682
|
}
|
|
639
683
|
}
|
|
@@ -957,7 +1001,7 @@ function useEventResize(input) {
|
|
|
957
1001
|
const parsedEndTime = parseTimeString(input.endTime());
|
|
958
1002
|
const startMinutes = parsedStartTime.hours * 60 + parsedStartTime.minutes;
|
|
959
1003
|
const endMinutes = parsedEndTime.hours * 60 + parsedEndTime.minutes;
|
|
960
|
-
const intervalMinutes = clampIntervalMinutes(input.intervalMinutes());
|
|
1004
|
+
const intervalMinutes = clampIntervalMinutes(input.resizeIntervalMinutes?.() ?? input.intervalMinutes());
|
|
961
1005
|
const literalRange = endMinutes - startMinutes;
|
|
962
1006
|
const totalMinutes = Math.ceil(literalRange / intervalMinutes) * intervalMinutes;
|
|
963
1007
|
resizeState.value = {
|
|
@@ -1589,6 +1633,90 @@ var MoreEvents_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1589
1633
|
//#region src/components/MoreEvents/MoreEvents.ts
|
|
1590
1634
|
var MoreEvents = (0, _mantine_vue_core.factory)(MoreEvents_default, { classes: MoreEvents_module_default });
|
|
1591
1635
|
//#endregion
|
|
1636
|
+
//#region src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue
|
|
1637
|
+
var ScheduleBackgroundEvent_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
1638
|
+
name: "ScheduleBackgroundEvent",
|
|
1639
|
+
inheritAttrs: false,
|
|
1640
|
+
__name: "ScheduleBackgroundEvent",
|
|
1641
|
+
props: {
|
|
1642
|
+
event: {},
|
|
1643
|
+
interactive: {
|
|
1644
|
+
type: Boolean,
|
|
1645
|
+
default: false
|
|
1646
|
+
},
|
|
1647
|
+
renderEvent: {
|
|
1648
|
+
type: Function,
|
|
1649
|
+
default: void 0
|
|
1650
|
+
},
|
|
1651
|
+
renderEventBody: {
|
|
1652
|
+
type: Function,
|
|
1653
|
+
default: void 0
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
emits: ["eventClick"],
|
|
1657
|
+
setup(__props, { emit: __emit }) {
|
|
1658
|
+
const props = __props;
|
|
1659
|
+
const emit = __emit;
|
|
1660
|
+
const attrs = (0, vue.useAttrs)();
|
|
1661
|
+
const slots = (0, vue.useSlots)();
|
|
1662
|
+
const theme = (0, _mantine_vue_core.useMantineTheme)();
|
|
1663
|
+
const dragPassthrough = (0, vue.ref)(false);
|
|
1664
|
+
const resetDragPassthrough = () => {
|
|
1665
|
+
dragPassthrough.value = false;
|
|
1666
|
+
};
|
|
1667
|
+
const enableDragPassthrough = () => {
|
|
1668
|
+
if (!props.interactive || dragPassthrough.value) return;
|
|
1669
|
+
dragPassthrough.value = true;
|
|
1670
|
+
document.addEventListener("dragend", resetDragPassthrough, { once: true });
|
|
1671
|
+
document.addEventListener("drop", resetDragPassthrough, { once: true });
|
|
1672
|
+
document.addEventListener("pointermove", resetDragPassthrough, { once: true });
|
|
1673
|
+
};
|
|
1674
|
+
(0, vue.onBeforeUnmount)(() => {
|
|
1675
|
+
document.removeEventListener("dragend", resetDragPassthrough);
|
|
1676
|
+
document.removeEventListener("drop", resetDragPassthrough);
|
|
1677
|
+
document.removeEventListener("pointermove", resetDragPassthrough);
|
|
1678
|
+
});
|
|
1679
|
+
const rootProps = (0, vue.computed)(() => {
|
|
1680
|
+
const colors = theme.value.variantColorResolver({
|
|
1681
|
+
color: props.event.color || theme.value.primaryColor,
|
|
1682
|
+
theme: theme.value,
|
|
1683
|
+
variant: "light",
|
|
1684
|
+
autoContrast: true
|
|
1685
|
+
});
|
|
1686
|
+
const style = [attrs.style, {
|
|
1687
|
+
"--bg-event-bg": colors.background,
|
|
1688
|
+
"--bg-event-color": colors.color,
|
|
1689
|
+
"--bg-event-hover": colors.hover,
|
|
1690
|
+
...dragPassthrough.value ? { pointerEvents: "none" } : {}
|
|
1691
|
+
}];
|
|
1692
|
+
return {
|
|
1693
|
+
...attrs,
|
|
1694
|
+
style,
|
|
1695
|
+
mod: [attrs.mod, { interactive: props.interactive }],
|
|
1696
|
+
...props.interactive ? {
|
|
1697
|
+
"data-event-id": props.event.id,
|
|
1698
|
+
title: props.event.title,
|
|
1699
|
+
onClick: (event) => emit("eventClick", props.event, event),
|
|
1700
|
+
onDragenter: enableDragPassthrough,
|
|
1701
|
+
onDragover: enableDragPassthrough
|
|
1702
|
+
} : {}
|
|
1703
|
+
};
|
|
1704
|
+
});
|
|
1705
|
+
const content = () => slots.default?.({ event: props.event }) ?? props.renderEventBody?.(props.event) ?? props.event.title;
|
|
1706
|
+
const render = () => {
|
|
1707
|
+
const component = props.interactive ? _mantine_vue_core.UnstyledButton : _mantine_vue_core.Box;
|
|
1708
|
+
if (props.renderEvent) return props.renderEvent(props.event, {
|
|
1709
|
+
...rootProps.value,
|
|
1710
|
+
children: content()
|
|
1711
|
+
});
|
|
1712
|
+
return (0, vue.h)(component, rootProps.value, { default: content });
|
|
1713
|
+
};
|
|
1714
|
+
return (_ctx, _cache) => {
|
|
1715
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(render);
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
});
|
|
1719
|
+
//#endregion
|
|
1592
1720
|
//#region src/components/ScheduleHeader/ScheduleHeader.context.ts
|
|
1593
1721
|
var ScheduleHeaderLabelsKey = Symbol("mantine-schedule-header-labels");
|
|
1594
1722
|
/**
|
|
@@ -2528,6 +2656,23 @@ function resolveSlotIndex({ container, intervals }, clientY, eventTarget) {
|
|
|
2528
2656
|
return clientY >= rect.top && clientY <= rect.bottom;
|
|
2529
2657
|
});
|
|
2530
2658
|
}
|
|
2659
|
+
function resolveTarget(input, slotIndex, clientY) {
|
|
2660
|
+
const interval = input.intervals[slotIndex];
|
|
2661
|
+
if (!interval) return void 0;
|
|
2662
|
+
if (input.dragIntervalMinutes == null) return `${input.date} ${interval.startTime}`;
|
|
2663
|
+
const rect = (input.container?.querySelectorAll("[data-time-slot-index]"))?.[slotIndex]?.getBoundingClientRect();
|
|
2664
|
+
const parsed = parseTimeString(interval.startTime);
|
|
2665
|
+
const gridInterval = clampIntervalMinutes(input.intervalMinutes ?? 15);
|
|
2666
|
+
const dragInterval = clampIntervalMinutes(input.dragIntervalMinutes);
|
|
2667
|
+
const offsetRatio = rect && rect.height > 0 ? (clientY - rect.top) / rect.height : 0;
|
|
2668
|
+
let minutes = Math.round((parsed.hours * 60 + parsed.minutes + offsetRatio * gridInterval) / dragInterval) * dragInterval;
|
|
2669
|
+
const start = input.startTime ? parseTimeString(input.startTime) : null;
|
|
2670
|
+
const end = input.endTime ? parseTimeString(input.endTime) : null;
|
|
2671
|
+
const min = start ? Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval : 0;
|
|
2672
|
+
const max = end ? Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval : 1439;
|
|
2673
|
+
minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, minutes));
|
|
2674
|
+
return `${input.date} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
2675
|
+
}
|
|
2531
2676
|
/**
|
|
2532
2677
|
* Tracks the time slot a drag is hovering over.
|
|
2533
2678
|
*
|
|
@@ -2574,10 +2719,10 @@ function useSlotDropTarget() {
|
|
|
2574
2719
|
drop: (nativeEvent, input) => {
|
|
2575
2720
|
const slotIndex = resolveSlotIndex(input, nativeEvent.clientY, nativeEvent.target instanceof Element ? nativeEvent.target : null);
|
|
2576
2721
|
reset();
|
|
2577
|
-
const
|
|
2578
|
-
return
|
|
2722
|
+
const target = resolveTarget(input, slotIndex, nativeEvent.clientY);
|
|
2723
|
+
return target ? {
|
|
2579
2724
|
slotIndex,
|
|
2580
|
-
target
|
|
2725
|
+
target
|
|
2581
2726
|
} : void 0;
|
|
2582
2727
|
},
|
|
2583
2728
|
reset
|
|
@@ -2768,17 +2913,17 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
|
|
|
2768
2913
|
};
|
|
2769
2914
|
}
|
|
2770
2915
|
var DayView_module_default = {
|
|
2771
|
-
dayView: "
|
|
2772
|
-
dayViewScrollArea: "
|
|
2773
|
-
dayViewInner: "
|
|
2774
|
-
dayViewTimeSlots: "
|
|
2775
|
-
dayViewSlot: "
|
|
2776
|
-
dayViewSlotLabels: "
|
|
2777
|
-
dayViewSlotLabel: "
|
|
2778
|
-
dayViewSlots: "
|
|
2779
|
-
dayViewBackgroundEvent: "
|
|
2780
|
-
dayViewAllDay: "
|
|
2781
|
-
dayViewAllDayEvents: "
|
|
2916
|
+
dayView: "_dayView_1nebu_1",
|
|
2917
|
+
dayViewScrollArea: "_dayViewScrollArea_1nebu_22",
|
|
2918
|
+
dayViewInner: "_dayViewInner_1nebu_32",
|
|
2919
|
+
dayViewTimeSlots: "_dayViewTimeSlots_1nebu_36",
|
|
2920
|
+
dayViewSlot: "_dayViewSlot_1nebu_39",
|
|
2921
|
+
dayViewSlotLabels: "_dayViewSlotLabels_1nebu_44",
|
|
2922
|
+
dayViewSlotLabel: "_dayViewSlotLabel_1nebu_44",
|
|
2923
|
+
dayViewSlots: "_dayViewSlots_1nebu_74",
|
|
2924
|
+
dayViewBackgroundEvent: "_dayViewBackgroundEvent_1nebu_178",
|
|
2925
|
+
dayViewAllDay: "_dayViewAllDay_1nebu_201",
|
|
2926
|
+
dayViewAllDayEvents: "_dayViewAllDayEvents_1nebu_206"
|
|
2782
2927
|
};
|
|
2783
2928
|
//#endregion
|
|
2784
2929
|
//#region src/components/DayView/DayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -2824,6 +2969,8 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2824
2969
|
scrollAreaProps: { default: void 0 },
|
|
2825
2970
|
startTime: { default: void 0 },
|
|
2826
2971
|
endTime: { default: void 0 },
|
|
2972
|
+
eventDragInterval: { default: void 0 },
|
|
2973
|
+
eventResizeInterval: { default: void 0 },
|
|
2827
2974
|
slotLabelFormat: {
|
|
2828
2975
|
type: [String, Function],
|
|
2829
2976
|
default: void 0
|
|
@@ -2879,6 +3026,10 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2879
3026
|
default: void 0
|
|
2880
3027
|
},
|
|
2881
3028
|
recurrenceExpansionLimit: { default: void 0 },
|
|
3029
|
+
withInteractiveBackgroundEvents: {
|
|
3030
|
+
type: Boolean,
|
|
3031
|
+
default: void 0
|
|
3032
|
+
},
|
|
2882
3033
|
classNames: { default: void 0 },
|
|
2883
3034
|
styles: { default: void 0 },
|
|
2884
3035
|
vars: { default: void 0 },
|
|
@@ -2965,6 +3116,7 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2965
3116
|
startTime: () => props.startTime,
|
|
2966
3117
|
endTime: () => props.endTime,
|
|
2967
3118
|
intervalMinutes: () => props.intervalMinutes,
|
|
3119
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
2968
3120
|
onEventResize: (data) => emit("eventResize", data),
|
|
2969
3121
|
canResizeEvent: () => props.canResizeEvent
|
|
2970
3122
|
});
|
|
@@ -3030,7 +3182,11 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3030
3182
|
const dropInput = () => ({
|
|
3031
3183
|
container: timeSlotsContainer.value,
|
|
3032
3184
|
date: datePart.value,
|
|
3033
|
-
intervals: intervals.value
|
|
3185
|
+
intervals: intervals.value,
|
|
3186
|
+
intervalMinutes: props.intervalMinutes,
|
|
3187
|
+
dragIntervalMinutes: props.eventDragInterval,
|
|
3188
|
+
startTime: props.startTime,
|
|
3189
|
+
endTime: props.endTime
|
|
3034
3190
|
});
|
|
3035
3191
|
const handleGridDragOver = (nativeEvent) => slotDropTarget.dragOver(nativeEvent, dropInput());
|
|
3036
3192
|
const handleGridDragLeave = (nativeEvent) => slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value);
|
|
@@ -3142,7 +3298,21 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3142
3298
|
}, 1040);
|
|
3143
3299
|
}), 128))], 16), (0, vue.createElementVNode)("div", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(getStyles)("dayViewSlots"))), [(0, vue.unref)(props).withAllDaySlot ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 0 }, (0, vue.unref)(getStyles)("dayViewAllDay"))), [
|
|
3144
3300
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents.value.backgroundAllDayEvents, (event) => {
|
|
3145
|
-
return (0, vue.openBlock)(), (0, vue.
|
|
3301
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
3302
|
+
key: event.id,
|
|
3303
|
+
event,
|
|
3304
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
3305
|
+
}, { ref_for: true }, {
|
|
3306
|
+
...eventRenderers.value,
|
|
3307
|
+
...(0, vue.unref)(staticStyles)("dayViewBackgroundEvent")
|
|
3308
|
+
}, {
|
|
3309
|
+
style: {
|
|
3310
|
+
top: 0,
|
|
3311
|
+
height: "100%",
|
|
3312
|
+
width: "100%"
|
|
3313
|
+
},
|
|
3314
|
+
onEventClick: clickEvent
|
|
3315
|
+
}), null, 16, ["event", "interactive"]);
|
|
3146
3316
|
}), 128)),
|
|
3147
3317
|
(0, vue.createElementVNode)("div", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(getStyles)("dayViewAllDayEvents"))), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(visibleAllDayEvents.value, (event) => {
|
|
3148
3318
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
@@ -3204,7 +3374,21 @@ var DayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3204
3374
|
onDrop: _cache[7] || (_cache[7] = ($event) => withDragHandlers.value ? handleGridDrop($event) : void 0)
|
|
3205
3375
|
}), [
|
|
3206
3376
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents.value.backgroundTimedEvents, (event) => {
|
|
3207
|
-
return (0, vue.openBlock)(), (0, vue.
|
|
3377
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
3378
|
+
key: event.id,
|
|
3379
|
+
event,
|
|
3380
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
3381
|
+
}, { ref_for: true }, {
|
|
3382
|
+
...eventRenderers.value,
|
|
3383
|
+
...(0, vue.unref)(staticStyles)("dayViewBackgroundEvent")
|
|
3384
|
+
}, {
|
|
3385
|
+
style: backgroundEventStyle(event.position),
|
|
3386
|
+
onEventClick: clickEvent
|
|
3387
|
+
}), null, 16, [
|
|
3388
|
+
"event",
|
|
3389
|
+
"interactive",
|
|
3390
|
+
"style"
|
|
3391
|
+
]);
|
|
3208
3392
|
}), 128)),
|
|
3209
3393
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents.value.regularEvents, (event) => {
|
|
3210
3394
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
@@ -3445,6 +3629,7 @@ var MobileMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3445
3629
|
default: void 0
|
|
3446
3630
|
},
|
|
3447
3631
|
recurrenceExpansionLimit: { default: void 0 },
|
|
3632
|
+
withInteractiveBackgroundEvents: { type: Boolean },
|
|
3448
3633
|
classNames: { default: void 0 },
|
|
3449
3634
|
styles: { default: void 0 },
|
|
3450
3635
|
vars: { default: void 0 },
|
|
@@ -3977,16 +4162,16 @@ function getRenderableMonthEventSegments({ events, groupedByDay, maxEventsPerDay
|
|
|
3977
4162
|
});
|
|
3978
4163
|
}
|
|
3979
4164
|
var MonthView_module_default = {
|
|
3980
|
-
monthView: "
|
|
3981
|
-
monthViewWeekdays: "
|
|
3982
|
-
monthViewWeek: "
|
|
3983
|
-
monthViewWeekNumber: "
|
|
3984
|
-
monthViewWeekday: "
|
|
3985
|
-
monthViewWeekdaysCorner: "
|
|
3986
|
-
monthViewDay: "
|
|
3987
|
-
monthViewDayLabel: "
|
|
3988
|
-
monthViewBackgroundEvent: "
|
|
3989
|
-
monthViewEvents: "
|
|
4165
|
+
monthView: "_monthView_hbhp2_1",
|
|
4166
|
+
monthViewWeekdays: "_monthViewWeekdays_hbhp2_21",
|
|
4167
|
+
monthViewWeek: "_monthViewWeek_hbhp2_21",
|
|
4168
|
+
monthViewWeekNumber: "_monthViewWeekNumber_hbhp2_31",
|
|
4169
|
+
monthViewWeekday: "_monthViewWeekday_hbhp2_21",
|
|
4170
|
+
monthViewWeekdaysCorner: "_monthViewWeekdaysCorner_hbhp2_107",
|
|
4171
|
+
monthViewDay: "_monthViewDay_hbhp2_114",
|
|
4172
|
+
monthViewDayLabel: "_monthViewDayLabel_hbhp2_255",
|
|
4173
|
+
monthViewBackgroundEvent: "_monthViewBackgroundEvent_hbhp2_271",
|
|
4174
|
+
monthViewEvents: "_monthViewEvents_hbhp2_296"
|
|
3990
4175
|
};
|
|
3991
4176
|
//#endregion
|
|
3992
4177
|
//#region src/components/MonthView/MonthView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -4097,6 +4282,10 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4097
4282
|
default: void 0
|
|
4098
4283
|
},
|
|
4099
4284
|
recurrenceExpansionLimit: { default: void 0 },
|
|
4285
|
+
withInteractiveBackgroundEvents: {
|
|
4286
|
+
type: Boolean,
|
|
4287
|
+
default: void 0
|
|
4288
|
+
},
|
|
4100
4289
|
classNames: { default: void 0 },
|
|
4101
4290
|
styles: { default: void 0 },
|
|
4102
4291
|
vars: { default: void 0 },
|
|
@@ -4267,6 +4456,10 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4267
4456
|
width: `${position.width}%`,
|
|
4268
4457
|
top: `${28 + position.row * 22}px`
|
|
4269
4458
|
});
|
|
4459
|
+
const backgroundSegmentStyle = (position) => ({
|
|
4460
|
+
insetInlineStart: `calc(${position.startOffset}% + 2px)`,
|
|
4461
|
+
width: `calc(${position.width}% - 3px)`
|
|
4462
|
+
});
|
|
4270
4463
|
const isDraggableEvent = (event) => !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true);
|
|
4271
4464
|
return (_ctx, _cache) => {
|
|
4272
4465
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
|
|
@@ -4383,7 +4576,23 @@ var MonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4383
4576
|
"mode"
|
|
4384
4577
|
])) : (0, vue.createCommentVNode)("", true)], 16, _hoisted_1$5);
|
|
4385
4578
|
}), 128)),
|
|
4386
|
-
(0, vue.createElementVNode)("div", (0, vue.mergeProps)({ ref_for: true }, (0, vue.unref)(getStyles)("monthViewEvents")), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(
|
|
4579
|
+
(0, vue.createElementVNode)("div", (0, vue.mergeProps)({ ref_for: true }, (0, vue.unref)(getStyles)("monthViewEvents")), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(grouped.value.backgroundByWeek[String(weekIndex)] || [], (event) => {
|
|
4580
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
4581
|
+
key: `background-${event.id}-${weekIndex}`,
|
|
4582
|
+
event,
|
|
4583
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
4584
|
+
}, { ref_for: true }, {
|
|
4585
|
+
...eventRenderers.value,
|
|
4586
|
+
...(0, vue.unref)(staticStyles)("monthViewBackgroundEvent")
|
|
4587
|
+
}, {
|
|
4588
|
+
style: backgroundSegmentStyle(event.position),
|
|
4589
|
+
onEventClick: clickEvent
|
|
4590
|
+
}), null, 16, [
|
|
4591
|
+
"event",
|
|
4592
|
+
"interactive",
|
|
4593
|
+
"style"
|
|
4594
|
+
]);
|
|
4595
|
+
}), 128)), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(weekSegments.value[weekIndex], (segment) => {
|
|
4387
4596
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
4388
4597
|
key: segment.key,
|
|
4389
4598
|
event: segment.event,
|
|
@@ -4528,17 +4737,13 @@ function calculateRegularEventOverlaps(events) {
|
|
|
4528
4737
|
}
|
|
4529
4738
|
//#endregion
|
|
4530
4739
|
//#region src/components/WeekView/get-week-view-events/find-available-column.ts
|
|
4531
|
-
function columnHasConflict({ columns, columnIndex, event, allDay
|
|
4740
|
+
function columnHasConflict({ columns, columnIndex, event, allDay }) {
|
|
4532
4741
|
const columnKey = `col-${columnIndex}`;
|
|
4533
4742
|
if (!columns.has(columnKey)) return false;
|
|
4534
|
-
return columns.get(columnKey).some((
|
|
4535
|
-
const
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
}));
|
|
4539
|
-
const hasTimeConflict = isEventsOverlap(e, event);
|
|
4540
|
-
if (allDay && eAllDay) return hasTimeConflict;
|
|
4541
|
-
if (allDay || eAllDay) return false;
|
|
4743
|
+
return columns.get(columnKey).some((columnEvent) => {
|
|
4744
|
+
const hasTimeConflict = isEventsOverlap(columnEvent.event, event);
|
|
4745
|
+
if (allDay && columnEvent.allDay) return hasTimeConflict;
|
|
4746
|
+
if (allDay || columnEvent.allDay) return false;
|
|
4542
4747
|
return hasTimeConflict;
|
|
4543
4748
|
});
|
|
4544
4749
|
}
|
|
@@ -4672,12 +4877,14 @@ function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMin
|
|
|
4672
4877
|
const column = findAvailableColumn({
|
|
4673
4878
|
columns: columnMap,
|
|
4674
4879
|
event,
|
|
4675
|
-
allDay
|
|
4676
|
-
allWeekDays: weekDays
|
|
4880
|
+
allDay
|
|
4677
4881
|
});
|
|
4678
4882
|
const columnKey = `col-${column}`;
|
|
4679
4883
|
if (!columnMap.has(columnKey)) columnMap.set(columnKey, []);
|
|
4680
|
-
columnMap.get(columnKey).push(
|
|
4884
|
+
columnMap.get(columnKey).push({
|
|
4885
|
+
event,
|
|
4886
|
+
allDay: isActuallyAllDay
|
|
4887
|
+
});
|
|
4681
4888
|
const verticalPosition = allDay ? {
|
|
4682
4889
|
top: 0,
|
|
4683
4890
|
height: 100
|
|
@@ -4763,27 +4970,27 @@ function getWeekViewEvents(input) {
|
|
|
4763
4970
|
});
|
|
4764
4971
|
}
|
|
4765
4972
|
var WeekView_module_default = {
|
|
4766
|
-
weekView: "
|
|
4767
|
-
weekViewRoot: "
|
|
4768
|
-
weekViewInner: "
|
|
4769
|
-
weekViewScrollArea: "
|
|
4770
|
-
weekViewHeader: "
|
|
4771
|
-
weekViewCorner: "
|
|
4772
|
-
weekViewSlotLabels: "
|
|
4773
|
-
weekViewSlotLabel: "
|
|
4774
|
-
weekViewDay: "
|
|
4775
|
-
weekViewDayLabel: "
|
|
4776
|
-
weekViewDayNumber: "
|
|
4777
|
-
weekViewDayWeekday: "
|
|
4778
|
-
weekViewBackgroundEvent: "
|
|
4779
|
-
weekViewDaySlots: "
|
|
4780
|
-
weekViewDaySlot: "
|
|
4781
|
-
weekViewWeekLabel: "
|
|
4782
|
-
weekViewWeekNumber: "
|
|
4783
|
-
weekViewAllDaySlots: "
|
|
4784
|
-
weekViewAllDaySlotsLabel: "
|
|
4785
|
-
weekViewAllDaySlotsEvents: "
|
|
4786
|
-
weekViewAllDaySlotsList: "
|
|
4973
|
+
weekView: "_weekView_1f3zt_1",
|
|
4974
|
+
weekViewRoot: "_weekViewRoot_1f3zt_22",
|
|
4975
|
+
weekViewInner: "_weekViewInner_1f3zt_30",
|
|
4976
|
+
weekViewScrollArea: "_weekViewScrollArea_1f3zt_36",
|
|
4977
|
+
weekViewHeader: "_weekViewHeader_1f3zt_42",
|
|
4978
|
+
weekViewCorner: "_weekViewCorner_1f3zt_57",
|
|
4979
|
+
weekViewSlotLabels: "_weekViewSlotLabels_1f3zt_68",
|
|
4980
|
+
weekViewSlotLabel: "_weekViewSlotLabel_1f3zt_68",
|
|
4981
|
+
weekViewDay: "_weekViewDay_1f3zt_95",
|
|
4982
|
+
weekViewDayLabel: "_weekViewDayLabel_1f3zt_100",
|
|
4983
|
+
weekViewDayNumber: "_weekViewDayNumber_1f3zt_138",
|
|
4984
|
+
weekViewDayWeekday: "_weekViewDayWeekday_1f3zt_154",
|
|
4985
|
+
weekViewBackgroundEvent: "_weekViewBackgroundEvent_1f3zt_160",
|
|
4986
|
+
weekViewDaySlots: "_weekViewDaySlots_1f3zt_183",
|
|
4987
|
+
weekViewDaySlot: "_weekViewDaySlot_1f3zt_183",
|
|
4988
|
+
weekViewWeekLabel: "_weekViewWeekLabel_1f3zt_281",
|
|
4989
|
+
weekViewWeekNumber: "_weekViewWeekNumber_1f3zt_287",
|
|
4990
|
+
weekViewAllDaySlots: "_weekViewAllDaySlots_1f3zt_293",
|
|
4991
|
+
weekViewAllDaySlotsLabel: "_weekViewAllDaySlotsLabel_1f3zt_298",
|
|
4992
|
+
weekViewAllDaySlotsEvents: "_weekViewAllDaySlotsEvents_1f3zt_305",
|
|
4993
|
+
weekViewAllDaySlotsList: "_weekViewAllDaySlotsList_1f3zt_312"
|
|
4787
4994
|
};
|
|
4788
4995
|
//#endregion
|
|
4789
4996
|
//#region src/components/WeekView/WeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -4875,6 +5082,8 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4875
5082
|
scrollAreaProps: { default: void 0 },
|
|
4876
5083
|
startTime: { default: void 0 },
|
|
4877
5084
|
endTime: { default: void 0 },
|
|
5085
|
+
eventDragInterval: { default: void 0 },
|
|
5086
|
+
eventResizeInterval: { default: void 0 },
|
|
4878
5087
|
slotLabelFormat: {
|
|
4879
5088
|
type: [String, Function],
|
|
4880
5089
|
default: void 0
|
|
@@ -4926,6 +5135,10 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4926
5135
|
default: void 0
|
|
4927
5136
|
},
|
|
4928
5137
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5138
|
+
withInteractiveBackgroundEvents: {
|
|
5139
|
+
type: Boolean,
|
|
5140
|
+
default: void 0
|
|
5141
|
+
},
|
|
4929
5142
|
classNames: { default: void 0 },
|
|
4930
5143
|
styles: { default: void 0 },
|
|
4931
5144
|
vars: { default: void 0 },
|
|
@@ -5070,6 +5283,7 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5070
5283
|
startTime: () => props.startTime,
|
|
5071
5284
|
endTime: () => props.endTime,
|
|
5072
5285
|
intervalMinutes: () => props.intervalMinutes,
|
|
5286
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
5073
5287
|
onEventResize: (data) => emit("eventResize", data),
|
|
5074
5288
|
canResizeEvent: () => props.canResizeEvent
|
|
5075
5289
|
});
|
|
@@ -5171,7 +5385,11 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5171
5385
|
const dropInput = (date) => ({
|
|
5172
5386
|
container: daySlotsContainers.get(date),
|
|
5173
5387
|
date: (0, dayjs.default)(date).format("YYYY-MM-DD"),
|
|
5174
|
-
intervals: intervals.value
|
|
5388
|
+
intervals: intervals.value,
|
|
5389
|
+
intervalMinutes: props.intervalMinutes,
|
|
5390
|
+
dragIntervalMinutes: props.eventDragInterval,
|
|
5391
|
+
startTime: props.startTime,
|
|
5392
|
+
endTime: props.endTime
|
|
5175
5393
|
});
|
|
5176
5394
|
const handleDayDragOver = (nativeEvent, date) => slotDropTarget.dragOver(nativeEvent, dropInput(date));
|
|
5177
5395
|
const handleDayDragLeave = (nativeEvent, date) => slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date));
|
|
@@ -5405,7 +5623,21 @@ var WeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5405
5623
|
]);
|
|
5406
5624
|
}), 128)),
|
|
5407
5625
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(grouped.value.backgroundEvents[column.date] || [], (event) => {
|
|
5408
|
-
return (0, vue.openBlock)(), (0, vue.
|
|
5626
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
5627
|
+
key: `background-${event.id}`,
|
|
5628
|
+
event,
|
|
5629
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
5630
|
+
}, { ref_for: true }, {
|
|
5631
|
+
...eventRenderers.value,
|
|
5632
|
+
...(0, vue.unref)(staticStyles)("weekViewBackgroundEvent")
|
|
5633
|
+
}, {
|
|
5634
|
+
style: backgroundEventStyle(event.position),
|
|
5635
|
+
onEventClick: clickEvent
|
|
5636
|
+
}), null, 16, [
|
|
5637
|
+
"event",
|
|
5638
|
+
"interactive",
|
|
5639
|
+
"style"
|
|
5640
|
+
]);
|
|
5409
5641
|
}), 128)),
|
|
5410
5642
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(grouped.value.regularEvents[column.date] || [], (event) => {
|
|
5411
5643
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
@@ -5486,18 +5718,18 @@ function getYearViewEvents({ date, events }) {
|
|
|
5486
5718
|
return groupedEvents;
|
|
5487
5719
|
}
|
|
5488
5720
|
var YearView_module_default = {
|
|
5489
|
-
yearView: "
|
|
5490
|
-
yearViewMonths: "
|
|
5491
|
-
yearViewMonth: "
|
|
5492
|
-
yearViewWeekdays: "
|
|
5493
|
-
yearViewWeek: "
|
|
5494
|
-
yearViewWeekNumber: "
|
|
5495
|
-
yearViewWeekday: "
|
|
5496
|
-
yearViewWeekdaysCorner: "
|
|
5497
|
-
yearViewDay: "
|
|
5498
|
-
yearViewMonthCaption: "
|
|
5499
|
-
yearViewDayIndicators: "
|
|
5500
|
-
yearViewDayIndicator: "
|
|
5721
|
+
yearView: "_yearView_1ww3l_1",
|
|
5722
|
+
yearViewMonths: "_yearViewMonths_1ww3l_16",
|
|
5723
|
+
yearViewMonth: "_yearViewMonth_1ww3l_16",
|
|
5724
|
+
yearViewWeekdays: "_yearViewWeekdays_1ww3l_93",
|
|
5725
|
+
yearViewWeek: "_yearViewWeek_1ww3l_93",
|
|
5726
|
+
yearViewWeekNumber: "_yearViewWeekNumber_1ww3l_101",
|
|
5727
|
+
yearViewWeekday: "_yearViewWeekday_1ww3l_93",
|
|
5728
|
+
yearViewWeekdaysCorner: "_yearViewWeekdaysCorner_1ww3l_156",
|
|
5729
|
+
yearViewDay: "_yearViewDay_1ww3l_160",
|
|
5730
|
+
yearViewMonthCaption: "_yearViewMonthCaption_1ww3l_220",
|
|
5731
|
+
yearViewDayIndicators: "_yearViewDayIndicators_1ww3l_246",
|
|
5732
|
+
yearViewDayIndicator: "_yearViewDayIndicator_1ww3l_246"
|
|
5501
5733
|
};
|
|
5502
5734
|
//#endregion
|
|
5503
5735
|
//#region src/components/YearView/YearView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -5509,6 +5741,7 @@ var defaultProps$5 = {
|
|
|
5509
5741
|
firstDayOfWeek: 1,
|
|
5510
5742
|
weekdayFormat: "dd",
|
|
5511
5743
|
weekendDays: [0, 6],
|
|
5744
|
+
withWeekendDays: true,
|
|
5512
5745
|
withWeekDays: true,
|
|
5513
5746
|
highlightToday: true,
|
|
5514
5747
|
withOutsideDays: true,
|
|
@@ -5528,6 +5761,10 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5528
5761
|
default: void 0
|
|
5529
5762
|
},
|
|
5530
5763
|
weekendDays: { default: void 0 },
|
|
5764
|
+
withWeekendDays: {
|
|
5765
|
+
type: Boolean,
|
|
5766
|
+
default: void 0
|
|
5767
|
+
},
|
|
5531
5768
|
withWeekNumbers: { type: Boolean },
|
|
5532
5769
|
withWeekDays: {
|
|
5533
5770
|
type: Boolean,
|
|
@@ -5553,6 +5790,10 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5553
5790
|
type: Function,
|
|
5554
5791
|
default: void 0
|
|
5555
5792
|
},
|
|
5793
|
+
renderDay: {
|
|
5794
|
+
type: Function,
|
|
5795
|
+
default: void 0
|
|
5796
|
+
},
|
|
5556
5797
|
getWeekNumberProps: {
|
|
5557
5798
|
type: Function,
|
|
5558
5799
|
default: void 0
|
|
@@ -5581,6 +5822,7 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5581
5822
|
default: void 0
|
|
5582
5823
|
},
|
|
5583
5824
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5825
|
+
withInteractiveBackgroundEvents: { type: Boolean },
|
|
5584
5826
|
classNames: { default: void 0 },
|
|
5585
5827
|
styles: { default: void 0 },
|
|
5586
5828
|
vars: { default: void 0 },
|
|
@@ -5638,7 +5880,13 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5638
5880
|
locale: props.locale || "en",
|
|
5639
5881
|
format: props.weekdayFormat,
|
|
5640
5882
|
firstDayOfWeek: props.firstDayOfWeek
|
|
5641
|
-
}));
|
|
5883
|
+
}).filter((_, index) => !hiddenWeekendColumns.value.has(index)));
|
|
5884
|
+
const hiddenWeekendColumns = (0, vue.computed)(() => {
|
|
5885
|
+
if (props.withWeekendDays !== false) return /* @__PURE__ */ new Set();
|
|
5886
|
+
return new Set(Array.from({ length: 7 }, (_, index) => index).filter((index) => props.weekendDays.includes((props.firstDayOfWeek + index) % 7)));
|
|
5887
|
+
});
|
|
5888
|
+
const columnsCount = (0, vue.computed)(() => 7 - hiddenWeekendColumns.value.size);
|
|
5889
|
+
const visibleWeek = (week) => props.withWeekendDays === false ? week.filter((date) => !props.weekendDays.includes((0, dayjs.default)(date).day())) : week;
|
|
5642
5890
|
/**
|
|
5643
5891
|
* Every month with the grid offset its cells start at, so a single roving tabindex can walk
|
|
5644
5892
|
* the whole year rather than restarting in each month.
|
|
@@ -5658,11 +5906,11 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5658
5906
|
weeks,
|
|
5659
5907
|
offset
|
|
5660
5908
|
};
|
|
5661
|
-
offset += weeks.length *
|
|
5909
|
+
offset += weeks.length * columnsCount.value;
|
|
5662
5910
|
return entry;
|
|
5663
5911
|
});
|
|
5664
5912
|
});
|
|
5665
|
-
const totalYearGridCells = (0, vue.computed)(() => months.value.reduce((total, { weeks }) => total + weeks.length *
|
|
5913
|
+
const totalYearGridCells = (0, vue.computed)(() => months.value.reduce((total, { weeks }) => total + weeks.length * columnsCount.value, 0));
|
|
5666
5914
|
const headerControl = (0, vue.computed)(() => ({ monthYearSelect: {
|
|
5667
5915
|
locale: props.locale,
|
|
5668
5916
|
yearValue: year.value.year(),
|
|
@@ -5675,13 +5923,13 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5675
5923
|
const dayProps = (date) => props.getDayProps?.(toDateString(date)) ?? {};
|
|
5676
5924
|
const weekNumberProps = (weekStart) => props.getWeekNumberProps?.(toDateString(weekStart)) ?? {};
|
|
5677
5925
|
const isOutside = (date, month) => !(0, dayjs.default)(date).isSame(month, "month");
|
|
5678
|
-
const dayEvents = (date) =>
|
|
5926
|
+
const dayEvents = (date) => eventsByDay.value[(0, dayjs.default)(date).format("YYYY-MM-DD")] || [];
|
|
5679
5927
|
const indicatorStyle = (event) => ({ background: `var(--mantine-color-${event.color}-6, ${event.color})` });
|
|
5680
5928
|
const handleDayKeydown = (nativeEvent, gridIndex) => {
|
|
5681
5929
|
handleGridKeydown({
|
|
5682
5930
|
event: nativeEvent,
|
|
5683
5931
|
index: gridIndex,
|
|
5684
|
-
columns:
|
|
5932
|
+
columns: columnsCount.value,
|
|
5685
5933
|
total: totalYearGridCells.value,
|
|
5686
5934
|
getControl: (index) => {
|
|
5687
5935
|
const control = yearGrid.value?.querySelector(`[data-year-grid-index="${index}"]`) ?? null;
|
|
@@ -5690,10 +5938,17 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5690
5938
|
});
|
|
5691
5939
|
};
|
|
5692
5940
|
return (_ctx, _cache) => {
|
|
5693
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.
|
|
5941
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
|
|
5694
5942
|
...(0, vue.unref)(attrs),
|
|
5695
5943
|
...(0, vue.unref)(getStyles)("yearView")
|
|
5696
|
-
}
|
|
5944
|
+
}, {
|
|
5945
|
+
style: [
|
|
5946
|
+
(0, vue.unref)(getStyles)("yearView").style,
|
|
5947
|
+
{ "--year-view-columns": columnsCount.value },
|
|
5948
|
+
(0, vue.unref)(attrs).style
|
|
5949
|
+
],
|
|
5950
|
+
"data-without-weekend-days": hiddenWeekendColumns.value.size > 0 || void 0
|
|
5951
|
+
}), {
|
|
5697
5952
|
default: (0, vue.withCtx)(() => [(0, vue.unref)(props).withHeader ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ScheduleHeaderBase), (0, vue.mergeProps)({
|
|
5698
5953
|
key: 0,
|
|
5699
5954
|
view: "year",
|
|
@@ -5747,7 +6002,7 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5747
6002
|
}, { onClick: ($event) => emit("weekNumberClick", (0, vue.unref)(toDateString)(week[0]), $event) }), {
|
|
5748
6003
|
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(getWeekNumber)(week)), 1)]),
|
|
5749
6004
|
_: 2
|
|
5750
|
-
}, 1040, ["onClick"])) : (0, vue.createCommentVNode)("", true), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(week, (date, dayIndex) => {
|
|
6005
|
+
}, 1040, ["onClick"])) : (0, vue.createCommentVNode)("", true), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(visibleWeek(week), (date, dayIndex) => {
|
|
5751
6006
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: (0, vue.unref)(toDateString)(date) }, [isOutside(date, month) && !(0, vue.unref)(props).withOutsideDays ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
5752
6007
|
key: 0,
|
|
5753
6008
|
ref_for: true
|
|
@@ -5759,7 +6014,7 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5759
6014
|
...(0, vue.unref)(getStyles)("yearViewDay", { className: dayProps(date).class })
|
|
5760
6015
|
}, {
|
|
5761
6016
|
disabled: isStatic.value,
|
|
5762
|
-
"data-year-grid-index": offset + weekIndex *
|
|
6017
|
+
"data-year-grid-index": offset + weekIndex * columnsCount.value + dayIndex,
|
|
5763
6018
|
"data-outside": isOutside(date, month) || void 0,
|
|
5764
6019
|
"data-weekend": (0, vue.unref)(props).weekendDays.includes((0, vue.unref)(dayjs.default)(date).day()) || void 0,
|
|
5765
6020
|
"data-today": (0, vue.unref)(props).highlightToday && (0, vue.unref)(dayjs.default)(date).isSame((0, vue.unref)(dayjs.default)(), "day") || void 0,
|
|
@@ -5769,15 +6024,18 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5769
6024
|
format: "MMMM D, YYYY"
|
|
5770
6025
|
}),
|
|
5771
6026
|
tabindex: isStatic.value || isOutside(date, month) ? -1 : (0, vue.unref)(dayjs.default)(date).date() === 1 ? 0 : -1,
|
|
5772
|
-
onKeydown: ($event) => isStatic.value ? void 0 : handleDayKeydown($event, offset + weekIndex *
|
|
6027
|
+
onKeydown: ($event) => isStatic.value ? void 0 : handleDayKeydown($event, offset + weekIndex * columnsCount.value + dayIndex),
|
|
5773
6028
|
onClick: ($event) => emit("dayClick", (0, vue.unref)(toDateString)(date), $event)
|
|
5774
6029
|
}), {
|
|
5775
|
-
default: (0, vue.withCtx)(() => [(0, vue.
|
|
6030
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "day", {
|
|
6031
|
+
date: (0, vue.unref)(toDateString)(date),
|
|
6032
|
+
events: dayEvents(date)
|
|
6033
|
+
}, () => [(0, vue.unref)(props).renderDay ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(() => (0, vue.unref)(props).renderDay((0, vue.unref)(toDateString)(date), dayEvents(date))), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(dayjs.default)(date).date()) + " ", 1), dayEvents(date).length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", (0, vue.mergeProps)({
|
|
5776
6034
|
key: 0,
|
|
5777
6035
|
ref_for: true
|
|
5778
|
-
}, (0, vue.unref)(getStyles)("yearViewDayIndicators")), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents(date), (event) => {
|
|
6036
|
+
}, (0, vue.unref)(getStyles)("yearViewDayIndicators")), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dayEvents(date).slice(0, 3), (event) => {
|
|
5779
6037
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", (0, vue.mergeProps)({ key: event.id }, { ref_for: true }, (0, vue.unref)(getStyles)("yearViewDayIndicator"), { style: indicatorStyle(event) }), null, 16);
|
|
5780
|
-
}), 128))], 16)) : (0, vue.createCommentVNode)("", true)]),
|
|
6038
|
+
}), 128))], 16)) : (0, vue.createCommentVNode)("", true)], 64))])]),
|
|
5781
6039
|
_: 2
|
|
5782
6040
|
}, 1040, [
|
|
5783
6041
|
"disabled",
|
|
@@ -5794,8 +6052,8 @@ var YearView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5794
6052
|
}), 128))
|
|
5795
6053
|
], 16, _hoisted_1$3);
|
|
5796
6054
|
}), 128))], 16)]),
|
|
5797
|
-
_:
|
|
5798
|
-
}, 16);
|
|
6055
|
+
_: 3
|
|
6056
|
+
}, 16, ["style", "data-without-weekend-days"]);
|
|
5799
6057
|
};
|
|
5800
6058
|
}
|
|
5801
6059
|
});
|
|
@@ -5850,6 +6108,10 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5850
6108
|
type: Function,
|
|
5851
6109
|
default: void 0
|
|
5852
6110
|
},
|
|
6111
|
+
withInteractiveBackgroundEvents: {
|
|
6112
|
+
type: Boolean,
|
|
6113
|
+
default: void 0
|
|
6114
|
+
},
|
|
5853
6115
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5854
6116
|
layout: { default: void 0 },
|
|
5855
6117
|
dayViewProps: { default: void 0 },
|
|
@@ -5936,6 +6198,7 @@ var Schedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5936
6198
|
withExternalEventDrop: props.withExternalEventDrop,
|
|
5937
6199
|
withEventResize: props.withEventResize,
|
|
5938
6200
|
canResizeEvent: props.canResizeEvent,
|
|
6201
|
+
withInteractiveBackgroundEvents: props.mode === "static" ? false : props.withInteractiveBackgroundEvents,
|
|
5939
6202
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
5940
6203
|
...eventRenderers.value,
|
|
5941
6204
|
...stylesApi.value
|
|
@@ -6038,7 +6301,7 @@ function useHorizontalEventResize(input) {
|
|
|
6038
6301
|
const end = parseTimeString(input.endTime());
|
|
6039
6302
|
const startMinutes = start.hours * 60 + start.minutes;
|
|
6040
6303
|
const literalRange = end.hours * 60 + end.minutes - startMinutes;
|
|
6041
|
-
const interval = clampIntervalMinutes(input.intervalMinutes());
|
|
6304
|
+
const interval = clampIntervalMinutes(input.resizeIntervalMinutes?.() ?? input.intervalMinutes());
|
|
6042
6305
|
const total = Math.ceil(literalRange / interval) * interval;
|
|
6043
6306
|
return {
|
|
6044
6307
|
startMinutes,
|
|
@@ -6244,27 +6507,27 @@ function getResourcesDayViewEvents({ events, resources, date, startTime, endTime
|
|
|
6244
6507
|
return result;
|
|
6245
6508
|
}
|
|
6246
6509
|
var ResourcesDayView_module_default = {
|
|
6247
|
-
resourcesDayView: "
|
|
6248
|
-
resourcesDayViewRoot: "
|
|
6249
|
-
resourcesDayViewScrollArea: "
|
|
6250
|
-
resourcesDayViewInner: "
|
|
6251
|
-
resourcesDayViewTimeLabelsRow: "
|
|
6252
|
-
resourcesDayViewCorner: "
|
|
6253
|
-
resourcesDayViewTimeLabel: "
|
|
6254
|
-
resourcesDayViewRow: "
|
|
6255
|
-
resourcesDayViewResourceLabel: "
|
|
6256
|
-
resourcesDayViewGroupColumn: "
|
|
6257
|
-
resourcesDayViewGroupColumnEmpty: "
|
|
6258
|
-
resourcesDayViewRowSlots: "
|
|
6259
|
-
resourcesDayViewRowSlot: "
|
|
6260
|
-
resourcesDayViewCurrentTimeIndicator: "
|
|
6261
|
-
resourcesDayViewCurrentTimeIndicatorLine: "
|
|
6262
|
-
resourcesDayViewCurrentTimeIndicatorThumb: "
|
|
6263
|
-
resourcesDayViewCurrentTimeIndicatorTimeBubble: "
|
|
6264
|
-
resourcesDayViewBackgroundEvent: "
|
|
6265
|
-
resourcesDayViewAllDayEvent: "
|
|
6266
|
-
resourcesDayViewEventWrapper: "
|
|
6267
|
-
resourcesDayViewResizeHandle: "
|
|
6510
|
+
resourcesDayView: "_resourcesDayView_wmj51_1",
|
|
6511
|
+
resourcesDayViewRoot: "_resourcesDayViewRoot_wmj51_22",
|
|
6512
|
+
resourcesDayViewScrollArea: "_resourcesDayViewScrollArea_wmj51_30",
|
|
6513
|
+
resourcesDayViewInner: "_resourcesDayViewInner_wmj51_39",
|
|
6514
|
+
resourcesDayViewTimeLabelsRow: "_resourcesDayViewTimeLabelsRow_wmj51_44",
|
|
6515
|
+
resourcesDayViewCorner: "_resourcesDayViewCorner_wmj51_57",
|
|
6516
|
+
resourcesDayViewTimeLabel: "_resourcesDayViewTimeLabel_wmj51_44",
|
|
6517
|
+
resourcesDayViewRow: "_resourcesDayViewRow_wmj51_96",
|
|
6518
|
+
resourcesDayViewResourceLabel: "_resourcesDayViewResourceLabel_wmj51_100",
|
|
6519
|
+
resourcesDayViewGroupColumn: "_resourcesDayViewGroupColumn_wmj51_124",
|
|
6520
|
+
resourcesDayViewGroupColumnEmpty: "_resourcesDayViewGroupColumnEmpty_wmj51_125",
|
|
6521
|
+
resourcesDayViewRowSlots: "_resourcesDayViewRowSlots_wmj51_153",
|
|
6522
|
+
resourcesDayViewRowSlot: "_resourcesDayViewRowSlot_wmj51_153",
|
|
6523
|
+
resourcesDayViewCurrentTimeIndicator: "_resourcesDayViewCurrentTimeIndicator_wmj51_231",
|
|
6524
|
+
resourcesDayViewCurrentTimeIndicatorLine: "_resourcesDayViewCurrentTimeIndicatorLine_wmj51_243",
|
|
6525
|
+
resourcesDayViewCurrentTimeIndicatorThumb: "_resourcesDayViewCurrentTimeIndicatorThumb_wmj51_249",
|
|
6526
|
+
resourcesDayViewCurrentTimeIndicatorTimeBubble: "_resourcesDayViewCurrentTimeIndicatorTimeBubble_wmj51_259",
|
|
6527
|
+
resourcesDayViewBackgroundEvent: "_resourcesDayViewBackgroundEvent_wmj51_278",
|
|
6528
|
+
resourcesDayViewAllDayEvent: "_resourcesDayViewAllDayEvent_wmj51_300",
|
|
6529
|
+
resourcesDayViewEventWrapper: "_resourcesDayViewEventWrapper_wmj51_306",
|
|
6530
|
+
resourcesDayViewResizeHandle: "_resourcesDayViewResizeHandle_wmj51_310"
|
|
6268
6531
|
};
|
|
6269
6532
|
//#endregion
|
|
6270
6533
|
//#region src/components/ResourcesDayView/ResourcesDayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -6315,6 +6578,8 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6315
6578
|
startTime: { default: void 0 },
|
|
6316
6579
|
endTime: { default: void 0 },
|
|
6317
6580
|
intervalMinutes: { default: void 0 },
|
|
6581
|
+
eventDragInterval: { default: void 0 },
|
|
6582
|
+
eventResizeInterval: { default: void 0 },
|
|
6318
6583
|
slotLabelFormat: {
|
|
6319
6584
|
type: [String, Function],
|
|
6320
6585
|
default: void 0
|
|
@@ -6362,6 +6627,10 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6362
6627
|
type: Function,
|
|
6363
6628
|
default: void 0
|
|
6364
6629
|
},
|
|
6630
|
+
withInteractiveBackgroundEvents: {
|
|
6631
|
+
type: Boolean,
|
|
6632
|
+
default: void 0
|
|
6633
|
+
},
|
|
6365
6634
|
renderResourceLabel: {
|
|
6366
6635
|
type: Function,
|
|
6367
6636
|
default: void 0
|
|
@@ -6518,6 +6787,7 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6518
6787
|
startTime: () => props.startTime,
|
|
6519
6788
|
endTime: () => props.endTime,
|
|
6520
6789
|
intervalMinutes: () => props.intervalMinutes,
|
|
6790
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
6521
6791
|
onEventResize: (data) => emit("eventResize", data),
|
|
6522
6792
|
canResizeEvent: () => props.canResizeEvent
|
|
6523
6793
|
});
|
|
@@ -6549,9 +6819,8 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6549
6819
|
nativeEvent.preventDefault();
|
|
6550
6820
|
resolveDropTarget.cancel();
|
|
6551
6821
|
setDropTarget(null);
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
const target = `${date.value} ${interval.startTime}`;
|
|
6822
|
+
if (!intervals.value[slotIndex]) return;
|
|
6823
|
+
const target = getSnappedDropTarget(nativeEvent, slotIndex);
|
|
6555
6824
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
6556
6825
|
if (event) emit("eventDrop", {
|
|
6557
6826
|
...moveEventTo(event, target),
|
|
@@ -6563,6 +6832,22 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6563
6832
|
resourceId
|
|
6564
6833
|
});
|
|
6565
6834
|
};
|
|
6835
|
+
const getSnappedDropTarget = (nativeEvent, slotIndex) => {
|
|
6836
|
+
const interval = intervals.value[slotIndex];
|
|
6837
|
+
if (!interval || props.eventDragInterval == null) return `${date.value} ${interval?.startTime ?? "00:00:00"}`;
|
|
6838
|
+
const rect = (nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null)?.getBoundingClientRect();
|
|
6839
|
+
const slotSize = rect && rect.width > 0 ? rect.width / intervals.value.length : 0;
|
|
6840
|
+
const slotOffset = rect ? nativeEvent.clientX - rect.left - slotIndex * slotSize : 0;
|
|
6841
|
+
const parsed = parseTimeString(interval.startTime);
|
|
6842
|
+
const dragInterval = clampIntervalMinutes(props.eventDragInterval);
|
|
6843
|
+
const raw = parsed.hours * 60 + parsed.minutes + (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes;
|
|
6844
|
+
const start = parseTimeString(props.startTime);
|
|
6845
|
+
const end = parseTimeString(props.endTime);
|
|
6846
|
+
const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval;
|
|
6847
|
+
const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval;
|
|
6848
|
+
const minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval));
|
|
6849
|
+
return `${date.value} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
6850
|
+
};
|
|
6566
6851
|
const setDropTarget = (next) => {
|
|
6567
6852
|
const current = dropTarget.value;
|
|
6568
6853
|
if (current === next) return;
|
|
@@ -6821,10 +7106,20 @@ var ResourcesDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6821
7106
|
return (0, vue.renderSlot)(_ctx.$slots, "backgroundEvent", {
|
|
6822
7107
|
key: `bg-${event.id}`,
|
|
6823
7108
|
event
|
|
6824
|
-
}, () => [(0, vue.createVNode)((0, vue.unref)(
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
},
|
|
7109
|
+
}, () => [(0, vue.createVNode)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
7110
|
+
event,
|
|
7111
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
7112
|
+
}, { ref_for: true }, {
|
|
7113
|
+
...eventRenderers.value,
|
|
7114
|
+
...(0, vue.unref)(getStyles)("resourcesDayViewBackgroundEvent")
|
|
7115
|
+
}, {
|
|
7116
|
+
style: backgroundEventStyle(event),
|
|
7117
|
+
onEventClick: clickEvent
|
|
7118
|
+
}), null, 16, [
|
|
7119
|
+
"event",
|
|
7120
|
+
"interactive",
|
|
7121
|
+
"style"
|
|
7122
|
+
])]);
|
|
6828
7123
|
}), 128)),
|
|
6829
7124
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayEvents(resource.id), (event, index) => {
|
|
6830
7125
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
|
|
@@ -7075,31 +7370,31 @@ function getResourcesWeekViewEvents({ events, resources, weekdays, startTime, en
|
|
|
7075
7370
|
};
|
|
7076
7371
|
}
|
|
7077
7372
|
var ResourcesWeekView_module_default = {
|
|
7078
|
-
resourcesWeekView: "
|
|
7079
|
-
resourcesWeekViewRoot: "
|
|
7080
|
-
resourcesWeekViewScrollArea: "
|
|
7081
|
-
resourcesWeekViewInner: "
|
|
7082
|
-
resourcesWeekViewHeaderRows: "
|
|
7083
|
-
resourcesWeekViewCorner: "
|
|
7084
|
-
resourcesWeekViewHeaderContent: "
|
|
7085
|
-
resourcesWeekViewDayLabelsRow: "
|
|
7086
|
-
resourcesWeekViewDayLabel: "
|
|
7087
|
-
resourcesWeekViewTimeLabelsRow: "
|
|
7088
|
-
resourcesWeekViewTimeLabel: "
|
|
7089
|
-
resourcesWeekViewRow: "
|
|
7090
|
-
resourcesWeekViewResourceLabel: "
|
|
7091
|
-
resourcesWeekViewGroupColumn: "
|
|
7092
|
-
resourcesWeekViewGroupColumnEmpty: "
|
|
7093
|
-
resourcesWeekViewRowSlots: "
|
|
7094
|
-
resourcesWeekViewRowSlot: "
|
|
7095
|
-
resourcesWeekViewBackgroundEvent: "
|
|
7096
|
-
resourcesWeekViewAllDayEvent: "
|
|
7097
|
-
resourcesWeekViewEventWrapper: "
|
|
7098
|
-
resourcesWeekViewResizeHandle: "
|
|
7099
|
-
resourcesWeekViewCurrentTimeIndicator: "
|
|
7100
|
-
resourcesWeekViewCurrentTimeIndicatorLine: "
|
|
7101
|
-
resourcesWeekViewCurrentTimeIndicatorThumb: "
|
|
7102
|
-
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "
|
|
7373
|
+
resourcesWeekView: "_resourcesWeekView_1komm_1",
|
|
7374
|
+
resourcesWeekViewRoot: "_resourcesWeekViewRoot_1komm_19",
|
|
7375
|
+
resourcesWeekViewScrollArea: "_resourcesWeekViewScrollArea_1komm_26",
|
|
7376
|
+
resourcesWeekViewInner: "_resourcesWeekViewInner_1komm_34",
|
|
7377
|
+
resourcesWeekViewHeaderRows: "_resourcesWeekViewHeaderRows_1komm_39",
|
|
7378
|
+
resourcesWeekViewCorner: "_resourcesWeekViewCorner_1komm_48",
|
|
7379
|
+
resourcesWeekViewHeaderContent: "_resourcesWeekViewHeaderContent_1komm_63",
|
|
7380
|
+
resourcesWeekViewDayLabelsRow: "_resourcesWeekViewDayLabelsRow_1komm_67",
|
|
7381
|
+
resourcesWeekViewDayLabel: "_resourcesWeekViewDayLabel_1komm_67",
|
|
7382
|
+
resourcesWeekViewTimeLabelsRow: "_resourcesWeekViewTimeLabelsRow_1komm_94",
|
|
7383
|
+
resourcesWeekViewTimeLabel: "_resourcesWeekViewTimeLabel_1komm_94",
|
|
7384
|
+
resourcesWeekViewRow: "_resourcesWeekViewRow_1komm_121",
|
|
7385
|
+
resourcesWeekViewResourceLabel: "_resourcesWeekViewResourceLabel_1komm_125",
|
|
7386
|
+
resourcesWeekViewGroupColumn: "_resourcesWeekViewGroupColumn_1komm_149",
|
|
7387
|
+
resourcesWeekViewGroupColumnEmpty: "_resourcesWeekViewGroupColumnEmpty_1komm_150",
|
|
7388
|
+
resourcesWeekViewRowSlots: "_resourcesWeekViewRowSlots_1komm_178",
|
|
7389
|
+
resourcesWeekViewRowSlot: "_resourcesWeekViewRowSlot_1komm_178",
|
|
7390
|
+
resourcesWeekViewBackgroundEvent: "_resourcesWeekViewBackgroundEvent_1komm_250",
|
|
7391
|
+
resourcesWeekViewAllDayEvent: "_resourcesWeekViewAllDayEvent_1komm_272",
|
|
7392
|
+
resourcesWeekViewEventWrapper: "_resourcesWeekViewEventWrapper_1komm_277",
|
|
7393
|
+
resourcesWeekViewResizeHandle: "_resourcesWeekViewResizeHandle_1komm_281",
|
|
7394
|
+
resourcesWeekViewCurrentTimeIndicator: "_resourcesWeekViewCurrentTimeIndicator_1komm_322",
|
|
7395
|
+
resourcesWeekViewCurrentTimeIndicatorLine: "_resourcesWeekViewCurrentTimeIndicatorLine_1komm_334",
|
|
7396
|
+
resourcesWeekViewCurrentTimeIndicatorThumb: "_resourcesWeekViewCurrentTimeIndicatorThumb_1komm_340",
|
|
7397
|
+
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "_resourcesWeekViewCurrentTimeIndicatorTimeBubble_1komm_350"
|
|
7103
7398
|
};
|
|
7104
7399
|
//#endregion
|
|
7105
7400
|
//#region src/components/ResourcesWeekView/ResourcesWeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -7155,6 +7450,8 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7155
7450
|
startTime: { default: void 0 },
|
|
7156
7451
|
endTime: { default: void 0 },
|
|
7157
7452
|
intervalMinutes: { default: void 0 },
|
|
7453
|
+
eventDragInterval: { default: void 0 },
|
|
7454
|
+
eventResizeInterval: { default: void 0 },
|
|
7158
7455
|
slotLabelFormat: {
|
|
7159
7456
|
type: [String, Function],
|
|
7160
7457
|
default: void 0
|
|
@@ -7206,6 +7503,10 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7206
7503
|
type: Function,
|
|
7207
7504
|
default: void 0
|
|
7208
7505
|
},
|
|
7506
|
+
withInteractiveBackgroundEvents: {
|
|
7507
|
+
type: Boolean,
|
|
7508
|
+
default: void 0
|
|
7509
|
+
},
|
|
7209
7510
|
renderResourceLabel: {
|
|
7210
7511
|
type: Function,
|
|
7211
7512
|
default: void 0
|
|
@@ -7388,6 +7689,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7388
7689
|
startTime: () => props.startTime,
|
|
7389
7690
|
endTime: () => props.endTime,
|
|
7390
7691
|
intervalMinutes: () => props.intervalMinutes,
|
|
7692
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
7391
7693
|
onEventResize: (data) => emit("eventResize", data),
|
|
7392
7694
|
canResizeEvent: () => props.canResizeEvent
|
|
7393
7695
|
});
|
|
@@ -7429,7 +7731,7 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7429
7731
|
const day = weekdays.value[Math.floor(flatIndex / count)];
|
|
7430
7732
|
const interval = intervals.value[flatIndex % count];
|
|
7431
7733
|
if (!day || !interval) return;
|
|
7432
|
-
const target =
|
|
7734
|
+
const target = getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime);
|
|
7433
7735
|
const event = getDropEvent(props.events, nativeEvent.dataTransfer);
|
|
7434
7736
|
if (event) emit("eventDrop", {
|
|
7435
7737
|
...moveEventTo(event, target),
|
|
@@ -7441,6 +7743,22 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7441
7743
|
resourceId
|
|
7442
7744
|
});
|
|
7443
7745
|
};
|
|
7746
|
+
const getSnappedDropTarget = (nativeEvent, day, flatIndex, slotStartTime) => {
|
|
7747
|
+
if (props.eventDragInterval == null) return `${day} ${slotStartTime}`;
|
|
7748
|
+
const rect = (nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null)?.getBoundingClientRect();
|
|
7749
|
+
const totalSlots = slotsPerDay.value * dayCount.value;
|
|
7750
|
+
const slotSize = rect && rect.width > 0 ? rect.width / totalSlots : 0;
|
|
7751
|
+
const slotOffset = rect ? nativeEvent.clientX - rect.left - flatIndex * slotSize : 0;
|
|
7752
|
+
const parsed = parseTimeString(slotStartTime);
|
|
7753
|
+
const dragInterval = clampIntervalMinutes(props.eventDragInterval);
|
|
7754
|
+
const raw = parsed.hours * 60 + parsed.minutes + (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes;
|
|
7755
|
+
const start = parseTimeString(props.startTime);
|
|
7756
|
+
const end = parseTimeString(props.endTime);
|
|
7757
|
+
const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval;
|
|
7758
|
+
const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval;
|
|
7759
|
+
const minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval));
|
|
7760
|
+
return `${day} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
7761
|
+
};
|
|
7444
7762
|
const setDropTarget = (next) => {
|
|
7445
7763
|
const current = dropTarget.value;
|
|
7446
7764
|
if (current === next) return;
|
|
@@ -7743,10 +8061,20 @@ var ResourcesWeekView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
7743
8061
|
key: `bg-${entry.day}-${entry.event.id}`,
|
|
7744
8062
|
event: entry.event,
|
|
7745
8063
|
date: entry.day
|
|
7746
|
-
}, () => [(0, vue.createVNode)((0, vue.unref)(
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
},
|
|
8064
|
+
}, () => [(0, vue.createVNode)((0, vue.unref)(ScheduleBackgroundEvent_default), (0, vue.mergeProps)({
|
|
8065
|
+
event: entry.event,
|
|
8066
|
+
interactive: Boolean((0, vue.unref)(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
8067
|
+
}, { ref_for: true }, {
|
|
8068
|
+
...eventRenderers.value,
|
|
8069
|
+
...(0, vue.unref)(getStyles)("resourcesWeekViewBackgroundEvent")
|
|
8070
|
+
}, {
|
|
8071
|
+
style: backgroundEventStyle(entry.event, entry.dayIndex),
|
|
8072
|
+
onEventClick: clickEvent
|
|
8073
|
+
}), null, 16, [
|
|
8074
|
+
"event",
|
|
8075
|
+
"interactive",
|
|
8076
|
+
"style"
|
|
8077
|
+
])]);
|
|
7750
8078
|
}), 128)),
|
|
7751
8079
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayBars(resource.id), (bar) => {
|
|
7752
8080
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
|
|
@@ -8014,27 +8342,33 @@ function getResourcesMonthViewLayout({ days, events, resourceId, maxRows }) {
|
|
|
8014
8342
|
};
|
|
8015
8343
|
}
|
|
8016
8344
|
var ResourcesMonthView_module_default = {
|
|
8017
|
-
resourcesMonthView: "
|
|
8018
|
-
resourcesMonthViewRoot: "
|
|
8019
|
-
resourcesMonthViewScrollArea: "
|
|
8020
|
-
resourcesMonthViewInner: "
|
|
8021
|
-
resourcesMonthViewDayLabelsRow: "
|
|
8022
|
-
resourcesMonthViewCorner: "
|
|
8023
|
-
resourcesMonthViewDayLabel: "
|
|
8024
|
-
resourcesMonthViewDayLabelWeekday: "
|
|
8025
|
-
resourcesMonthViewDayLabelNumber: "
|
|
8026
|
-
resourcesMonthViewRow: "
|
|
8027
|
-
resourcesMonthViewResourceLabel: "
|
|
8028
|
-
resourcesMonthViewGroupColumn: "
|
|
8029
|
-
resourcesMonthViewGroupColumnEmpty: "
|
|
8030
|
-
resourcesMonthViewRowSlots: "
|
|
8031
|
-
resourcesMonthViewCell: "
|
|
8345
|
+
resourcesMonthView: "_resourcesMonthView_uqbdi_1",
|
|
8346
|
+
resourcesMonthViewRoot: "_resourcesMonthViewRoot_uqbdi_17",
|
|
8347
|
+
resourcesMonthViewScrollArea: "_resourcesMonthViewScrollArea_uqbdi_24",
|
|
8348
|
+
resourcesMonthViewInner: "_resourcesMonthViewInner_uqbdi_33",
|
|
8349
|
+
resourcesMonthViewDayLabelsRow: "_resourcesMonthViewDayLabelsRow_uqbdi_37",
|
|
8350
|
+
resourcesMonthViewCorner: "_resourcesMonthViewCorner_uqbdi_46",
|
|
8351
|
+
resourcesMonthViewDayLabel: "_resourcesMonthViewDayLabel_uqbdi_37",
|
|
8352
|
+
resourcesMonthViewDayLabelWeekday: "_resourcesMonthViewDayLabelWeekday_uqbdi_85",
|
|
8353
|
+
resourcesMonthViewDayLabelNumber: "_resourcesMonthViewDayLabelNumber_uqbdi_92",
|
|
8354
|
+
resourcesMonthViewRow: "_resourcesMonthViewRow_uqbdi_97",
|
|
8355
|
+
resourcesMonthViewResourceLabel: "_resourcesMonthViewResourceLabel_uqbdi_101",
|
|
8356
|
+
resourcesMonthViewGroupColumn: "_resourcesMonthViewGroupColumn_uqbdi_120",
|
|
8357
|
+
resourcesMonthViewGroupColumnEmpty: "_resourcesMonthViewGroupColumnEmpty_uqbdi_121",
|
|
8358
|
+
resourcesMonthViewRowSlots: "_resourcesMonthViewRowSlots_uqbdi_149",
|
|
8359
|
+
resourcesMonthViewCell: "_resourcesMonthViewCell_uqbdi_154",
|
|
8360
|
+
resourcesMonthViewEventWrapper: "_resourcesMonthViewEventWrapper_uqbdi_230",
|
|
8361
|
+
resourcesMonthViewResizeHandle: "_resourcesMonthViewResizeHandle_uqbdi_231"
|
|
8032
8362
|
};
|
|
8033
8363
|
//#endregion
|
|
8034
8364
|
//#region src/components/ResourcesMonthView/ResourcesMonthView.vue?vue&type=script&setup=true&lang.ts
|
|
8035
8365
|
var _hoisted_1 = ["data-weekend", "data-today"];
|
|
8036
8366
|
var _hoisted_2 = ["data-has-groups"];
|
|
8037
8367
|
var _hoisted_3 = ["onDragover", "onDrop"];
|
|
8368
|
+
var _hoisted_4 = ["data-active", "onPointerdown"];
|
|
8369
|
+
var _hoisted_5 = ["data-active", "onPointerdown"];
|
|
8370
|
+
var _hoisted_6 = ["data-active", "onPointerdown"];
|
|
8371
|
+
var _hoisted_7 = ["data-active", "onPointerdown"];
|
|
8038
8372
|
var defaultProps$1 = {
|
|
8039
8373
|
weekdayFormat: "ddd",
|
|
8040
8374
|
weekendDays: [0, 6],
|
|
@@ -8046,7 +8380,8 @@ var defaultProps$1 = {
|
|
|
8046
8380
|
groupLabelWidth: 80,
|
|
8047
8381
|
mode: "default",
|
|
8048
8382
|
maxEventsPerTimeSlot: 2,
|
|
8049
|
-
recurrenceExpansionLimit: 2e3
|
|
8383
|
+
recurrenceExpansionLimit: 2e3,
|
|
8384
|
+
withEventResize: false
|
|
8050
8385
|
};
|
|
8051
8386
|
/** View levels the header offers – a resource schedule has no year view. */
|
|
8052
8387
|
var RESOURCE_VIEWS = [
|
|
@@ -8124,6 +8459,14 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8124
8459
|
type: Function,
|
|
8125
8460
|
default: void 0
|
|
8126
8461
|
},
|
|
8462
|
+
withEventResize: {
|
|
8463
|
+
type: Boolean,
|
|
8464
|
+
default: void 0
|
|
8465
|
+
},
|
|
8466
|
+
canResizeEvent: {
|
|
8467
|
+
type: Function,
|
|
8468
|
+
default: void 0
|
|
8469
|
+
},
|
|
8127
8470
|
withExternalEventDrop: { type: Boolean },
|
|
8128
8471
|
withDragSlotSelect: { type: Boolean },
|
|
8129
8472
|
labels: { default: void 0 },
|
|
@@ -8146,7 +8489,8 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8146
8489
|
"eventDragStart",
|
|
8147
8490
|
"eventDragEnd",
|
|
8148
8491
|
"slotDragEnd",
|
|
8149
|
-
"externalEventDrop"
|
|
8492
|
+
"externalEventDrop",
|
|
8493
|
+
"eventResize"
|
|
8150
8494
|
],
|
|
8151
8495
|
setup(__props, { emit: __emit }) {
|
|
8152
8496
|
const rawProps = __props;
|
|
@@ -8154,6 +8498,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8154
8498
|
const slots = (0, vue.useSlots)();
|
|
8155
8499
|
const attrs = (0, vue.useAttrs)();
|
|
8156
8500
|
const props = (0, _mantine_vue_core.useProps)("ResourcesMonthView", defaultProps$1, rawProps);
|
|
8501
|
+
const theme = (0, _mantine_vue_core.useSafeMantineTheme)();
|
|
8157
8502
|
const getStyles = (0, _mantine_vue_core.useStyles)({
|
|
8158
8503
|
name: "ResourcesMonthView",
|
|
8159
8504
|
props,
|
|
@@ -8203,9 +8548,19 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8203
8548
|
rangeEnd: month.value.endOf("month").toDate(),
|
|
8204
8549
|
expansionLimit: props.recurrenceExpansionLimit
|
|
8205
8550
|
}));
|
|
8551
|
+
const resizeState = (0, vue.shallowRef)(null);
|
|
8552
|
+
let justResized = false;
|
|
8553
|
+
const effectiveEvents = (0, vue.computed)(() => {
|
|
8554
|
+
const state = resizeState.value;
|
|
8555
|
+
return state ? expandedEvents.value.map((event) => event.id === state.event.id ? {
|
|
8556
|
+
...event,
|
|
8557
|
+
start: state.start,
|
|
8558
|
+
end: state.end
|
|
8559
|
+
} : event) : expandedEvents.value;
|
|
8560
|
+
});
|
|
8206
8561
|
const rowLayouts = (0, vue.computed)(() => ordered.value.orderedResources.map((resource) => getResourcesMonthViewLayout({
|
|
8207
8562
|
days: days.value,
|
|
8208
|
-
events:
|
|
8563
|
+
events: effectiveEvents.value,
|
|
8209
8564
|
resourceId: resource.id,
|
|
8210
8565
|
maxRows: maxRows.value
|
|
8211
8566
|
})));
|
|
@@ -8375,6 +8730,106 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8375
8730
|
emit("eventDragStart", event);
|
|
8376
8731
|
};
|
|
8377
8732
|
const dragEnd = () => dragState.endEventDrag();
|
|
8733
|
+
const isResizableEvent = (event) => Boolean(props.withEventResize) && !isStatic.value && event.display !== "background" && (props.canResizeEvent?.(event) ?? true);
|
|
8734
|
+
const isResizingEvent = (event) => resizeState.value?.event.id === event.id;
|
|
8735
|
+
const calculateResizeDates = (event, edge, targetDay) => {
|
|
8736
|
+
const originalStart = (0, dayjs.default)(event.start);
|
|
8737
|
+
const originalEnd = (0, dayjs.default)(event.end);
|
|
8738
|
+
const target = (0, dayjs.default)(targetDay).startOf("day");
|
|
8739
|
+
const endAtMidnight = originalEnd.hour() === 0 && originalEnd.minute() === 0 && originalEnd.second() === 0;
|
|
8740
|
+
const endDay = endAtMidnight ? originalEnd.subtract(1, "day").startOf("day") : originalEnd.startOf("day");
|
|
8741
|
+
const withTime = (day, source) => day.startOf("day").hour(source.hour()).minute(source.minute()).second(source.second());
|
|
8742
|
+
if (edge === "start") {
|
|
8743
|
+
let start = withTime(target.isAfter(endDay) ? endDay : target, originalStart);
|
|
8744
|
+
if (!start.isBefore(originalEnd)) start = start.subtract(1, "day");
|
|
8745
|
+
return {
|
|
8746
|
+
start: start.format("YYYY-MM-DD HH:mm:ss"),
|
|
8747
|
+
end: originalEnd.format("YYYY-MM-DD HH:mm:ss")
|
|
8748
|
+
};
|
|
8749
|
+
}
|
|
8750
|
+
const day = target.isBefore(originalStart.startOf("day")) ? originalStart.startOf("day") : target;
|
|
8751
|
+
let end = endAtMidnight ? day.add(1, "day").startOf("day") : withTime(day, originalEnd);
|
|
8752
|
+
if (!end.isAfter(originalStart)) end = end.add(1, "day");
|
|
8753
|
+
return {
|
|
8754
|
+
start: originalStart.format("YYYY-MM-DD HH:mm:ss"),
|
|
8755
|
+
end: end.format("YYYY-MM-DD HH:mm:ss")
|
|
8756
|
+
};
|
|
8757
|
+
};
|
|
8758
|
+
const handleResizeMove = (event) => {
|
|
8759
|
+
const state = resizeState.value;
|
|
8760
|
+
if (!state) return;
|
|
8761
|
+
const dayIndex = (controls[state.resourceIndex] ?? []).findIndex((cell) => {
|
|
8762
|
+
if (!cell) return false;
|
|
8763
|
+
const rect = cell.getBoundingClientRect();
|
|
8764
|
+
return event.clientX >= rect.left && event.clientX <= rect.right;
|
|
8765
|
+
});
|
|
8766
|
+
if (dayIndex < 0 || dayIndex === state.dayIndex || !days.value[dayIndex]) return;
|
|
8767
|
+
resizeState.value = {
|
|
8768
|
+
...state,
|
|
8769
|
+
...calculateResizeDates(state.event, state.edge, days.value[dayIndex]),
|
|
8770
|
+
dayIndex
|
|
8771
|
+
};
|
|
8772
|
+
};
|
|
8773
|
+
const stopResizeListeners = () => {
|
|
8774
|
+
document.removeEventListener("pointermove", handleResizeMove);
|
|
8775
|
+
document.removeEventListener("pointerup", handleResizeEnd);
|
|
8776
|
+
document.removeEventListener("pointercancel", handleResizeCancel);
|
|
8777
|
+
};
|
|
8778
|
+
const finishResize = (emitChange) => {
|
|
8779
|
+
const state = resizeState.value;
|
|
8780
|
+
stopResizeListeners();
|
|
8781
|
+
resizeState.value = null;
|
|
8782
|
+
if (emitChange && state && (state.start !== state.originalStart || state.end !== state.originalEnd)) emit("eventResize", {
|
|
8783
|
+
eventId: state.event.id,
|
|
8784
|
+
newStart: state.start,
|
|
8785
|
+
newEnd: state.end,
|
|
8786
|
+
event: state.event
|
|
8787
|
+
});
|
|
8788
|
+
justResized = true;
|
|
8789
|
+
requestAnimationFrame(() => justResized = false);
|
|
8790
|
+
};
|
|
8791
|
+
function handleResizeEnd() {
|
|
8792
|
+
finishResize(true);
|
|
8793
|
+
}
|
|
8794
|
+
function handleResizeCancel() {
|
|
8795
|
+
finishResize(false);
|
|
8796
|
+
}
|
|
8797
|
+
const handleResizeStart = (event, edge, resourceIndex, pointerEvent) => {
|
|
8798
|
+
if (!isResizableEvent(event)) return;
|
|
8799
|
+
pointerEvent.preventDefault();
|
|
8800
|
+
pointerEvent.stopPropagation();
|
|
8801
|
+
const start = (0, dayjs.default)(event.start).format("YYYY-MM-DD HH:mm:ss");
|
|
8802
|
+
const end = (0, dayjs.default)(event.end).format("YYYY-MM-DD HH:mm:ss");
|
|
8803
|
+
resizeState.value = {
|
|
8804
|
+
event,
|
|
8805
|
+
edge,
|
|
8806
|
+
resourceIndex,
|
|
8807
|
+
originalStart: start,
|
|
8808
|
+
originalEnd: end,
|
|
8809
|
+
start,
|
|
8810
|
+
end,
|
|
8811
|
+
dayIndex: -1
|
|
8812
|
+
};
|
|
8813
|
+
document.addEventListener("pointermove", handleResizeMove);
|
|
8814
|
+
document.addEventListener("pointerup", handleResizeEnd);
|
|
8815
|
+
document.addEventListener("pointercancel", handleResizeCancel);
|
|
8816
|
+
};
|
|
8817
|
+
(0, vue.onBeforeUnmount)(stopResizeListeners);
|
|
8818
|
+
const emitEventClick = (event, nativeEvent) => {
|
|
8819
|
+
if (!isStatic.value && !justResized) emit("eventClick", event, nativeEvent);
|
|
8820
|
+
};
|
|
8821
|
+
const eventWrapperStyle = (event, style) => {
|
|
8822
|
+
const colors = theme.value.variantColorResolver({
|
|
8823
|
+
color: event.color || theme.value.primaryColor,
|
|
8824
|
+
theme: theme.value,
|
|
8825
|
+
variant: event.variant || "light",
|
|
8826
|
+
autoContrast: true
|
|
8827
|
+
});
|
|
8828
|
+
return {
|
|
8829
|
+
...style,
|
|
8830
|
+
"--event-color": colors.color
|
|
8831
|
+
};
|
|
8832
|
+
};
|
|
8378
8833
|
const changeDate = (value) => emit("dateChange", value);
|
|
8379
8834
|
const changeView = (view) => emit("viewChange", view);
|
|
8380
8835
|
return (_ctx, _cache) => {
|
|
@@ -8383,7 +8838,8 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8383
8838
|
...(0, vue.unref)(getStyles)("resourcesMonthView")
|
|
8384
8839
|
}, {
|
|
8385
8840
|
"root-ref": setRootElement,
|
|
8386
|
-
"data-event-interaction": dropTarget.value ? true : void 0
|
|
8841
|
+
"data-event-interaction": dropTarget.value || resizeState.value ? true : void 0,
|
|
8842
|
+
"data-resizing": resizeState.value ? true : void 0
|
|
8387
8843
|
}), {
|
|
8388
8844
|
default: (0, vue.withCtx)(() => [(0, vue.unref)(props).withHeader ? (0, vue.renderSlot)(_ctx.$slots, "header", {
|
|
8389
8845
|
key: 0,
|
|
@@ -8469,58 +8925,112 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8469
8925
|
onDrop: ($event) => withDragHandlers.value ? handleRowDrop($event, resource, resourceIndex) : void 0
|
|
8470
8926
|
}), [
|
|
8471
8927
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(singleDayEvents(resourceIndex), (entry) => {
|
|
8472
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8928
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({ key: `${entry.event.id}-${entry.dayIndex}` }, { ref_for: true }, (0, vue.unref)(getStyles)("resourcesMonthViewEventWrapper"), {
|
|
8929
|
+
style: eventWrapperStyle(entry.event, singleEventStyle(entry)),
|
|
8930
|
+
"data-resizing": isResizingEvent(entry.event) || void 0
|
|
8931
|
+
}), {
|
|
8932
|
+
default: (0, vue.withCtx)(() => [
|
|
8933
|
+
(0, vue.createVNode)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
8934
|
+
event: entry.event,
|
|
8935
|
+
"auto-size": "",
|
|
8936
|
+
nowrap: "",
|
|
8937
|
+
radius: (0, vue.unref)(props).radius,
|
|
8938
|
+
mode: (0, vue.unref)(props).mode,
|
|
8939
|
+
draggable: isDraggableEvent(entry.event),
|
|
8940
|
+
"is-resizing": isResizingEvent(entry.event),
|
|
8941
|
+
style: {
|
|
8942
|
+
"width": "100%",
|
|
8943
|
+
"height": "100%"
|
|
8944
|
+
}
|
|
8945
|
+
}, { ref_for: true }, {
|
|
8946
|
+
...eventRenderers.value,
|
|
8947
|
+
...stylesApi.value
|
|
8948
|
+
}, {
|
|
8949
|
+
onEventDragStart: dragStart,
|
|
8950
|
+
onEventDragEnd: dragEnd,
|
|
8951
|
+
onClick: ($event) => emitEventClick(entry.event, $event)
|
|
8952
|
+
}), null, 16, [
|
|
8953
|
+
"event",
|
|
8954
|
+
"radius",
|
|
8955
|
+
"mode",
|
|
8956
|
+
"draggable",
|
|
8957
|
+
"is-resizing",
|
|
8958
|
+
"onClick"
|
|
8959
|
+
]),
|
|
8960
|
+
isResizableEvent(entry.event) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
8961
|
+
key: 0,
|
|
8962
|
+
ref_for: true
|
|
8963
|
+
}, (0, vue.unref)(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8964
|
+
"data-edge": "start",
|
|
8965
|
+
"data-active": isResizingEvent(entry.event) && resizeState.value?.edge === "start" || void 0,
|
|
8966
|
+
onPointerdown: ($event) => handleResizeStart(entry.event, "start", resourceIndex, $event)
|
|
8967
|
+
}), null, 16, _hoisted_4)) : (0, vue.createCommentVNode)("", true),
|
|
8968
|
+
isResizableEvent(entry.event) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
8969
|
+
key: 1,
|
|
8970
|
+
ref_for: true
|
|
8971
|
+
}, (0, vue.unref)(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8972
|
+
"data-edge": "end",
|
|
8973
|
+
"data-active": isResizingEvent(entry.event) && resizeState.value?.edge === "end" || void 0,
|
|
8974
|
+
onPointerdown: ($event) => handleResizeStart(entry.event, "end", resourceIndex, $event)
|
|
8975
|
+
}), null, 16, _hoisted_5)) : (0, vue.createCommentVNode)("", true)
|
|
8976
|
+
]),
|
|
8977
|
+
_: 2
|
|
8978
|
+
}, 1040, ["style", "data-resizing"]);
|
|
8496
8979
|
}), 128)),
|
|
8497
8980
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(rowLayouts.value[resourceIndex].segments, (segment) => {
|
|
8498
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8981
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({ key: `${segment.event.id}-${segment.start}` }, { ref_for: true }, (0, vue.unref)(getStyles)("resourcesMonthViewEventWrapper"), {
|
|
8982
|
+
style: eventWrapperStyle(segment.event, segmentStyle(segment)),
|
|
8983
|
+
"data-resizing": isResizingEvent(segment.event) || void 0
|
|
8984
|
+
}), {
|
|
8985
|
+
default: (0, vue.withCtx)(() => [
|
|
8986
|
+
(0, vue.createVNode)((0, vue.unref)(ScheduleEvent), (0, vue.mergeProps)({
|
|
8987
|
+
event: segment.event,
|
|
8988
|
+
hanging: segment.hanging,
|
|
8989
|
+
"auto-size": "",
|
|
8990
|
+
nowrap: "",
|
|
8991
|
+
radius: (0, vue.unref)(props).radius,
|
|
8992
|
+
mode: (0, vue.unref)(props).mode,
|
|
8993
|
+
draggable: isDraggableEvent(segment.event),
|
|
8994
|
+
"is-resizing": isResizingEvent(segment.event),
|
|
8995
|
+
style: {
|
|
8996
|
+
"width": "100%",
|
|
8997
|
+
"height": "100%"
|
|
8998
|
+
}
|
|
8999
|
+
}, { ref_for: true }, {
|
|
9000
|
+
...eventRenderers.value,
|
|
9001
|
+
...stylesApi.value
|
|
9002
|
+
}, {
|
|
9003
|
+
onEventDragStart: dragStart,
|
|
9004
|
+
onEventDragEnd: dragEnd,
|
|
9005
|
+
onClick: ($event) => emitEventClick(segment.event, $event)
|
|
9006
|
+
}), null, 16, [
|
|
9007
|
+
"event",
|
|
9008
|
+
"hanging",
|
|
9009
|
+
"radius",
|
|
9010
|
+
"mode",
|
|
9011
|
+
"draggable",
|
|
9012
|
+
"is-resizing",
|
|
9013
|
+
"onClick"
|
|
9014
|
+
]),
|
|
9015
|
+
isResizableEvent(segment.event) && segment.hanging !== "start" && segment.hanging !== "both" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
9016
|
+
key: 0,
|
|
9017
|
+
ref_for: true
|
|
9018
|
+
}, (0, vue.unref)(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
9019
|
+
"data-edge": "start",
|
|
9020
|
+
"data-active": isResizingEvent(segment.event) && resizeState.value?.edge === "start" || void 0,
|
|
9021
|
+
onPointerdown: ($event) => handleResizeStart(segment.event, "start", resourceIndex, $event)
|
|
9022
|
+
}), null, 16, _hoisted_6)) : (0, vue.createCommentVNode)("", true),
|
|
9023
|
+
isResizableEvent(segment.event) && segment.hanging !== "end" && segment.hanging !== "both" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
|
|
9024
|
+
key: 1,
|
|
9025
|
+
ref_for: true
|
|
9026
|
+
}, (0, vue.unref)(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
9027
|
+
"data-edge": "end",
|
|
9028
|
+
"data-active": isResizingEvent(segment.event) && resizeState.value?.edge === "end" || void 0,
|
|
9029
|
+
onPointerdown: ($event) => handleResizeStart(segment.event, "end", resourceIndex, $event)
|
|
9030
|
+
}), null, 16, _hoisted_7)) : (0, vue.createCommentVNode)("", true)
|
|
9031
|
+
]),
|
|
9032
|
+
_: 2
|
|
9033
|
+
}, 1040, ["style", "data-resizing"]);
|
|
8524
9034
|
}), 128)),
|
|
8525
9035
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(cellsWithHiddenEvents(resourceIndex), (entry) => {
|
|
8526
9036
|
return (0, vue.renderSlot)(_ctx.$slots, "moreEvents", {
|
|
@@ -8601,7 +9111,7 @@ var ResourcesMonthView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8601
9111
|
_: 3
|
|
8602
9112
|
}, 16)]),
|
|
8603
9113
|
_: 3
|
|
8604
|
-
}, 16, ["data-event-interaction"]);
|
|
9114
|
+
}, 16, ["data-event-interaction", "data-resizing"]);
|
|
8605
9115
|
};
|
|
8606
9116
|
}
|
|
8607
9117
|
});
|
|
@@ -8656,6 +9166,10 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8656
9166
|
type: Function,
|
|
8657
9167
|
default: void 0
|
|
8658
9168
|
},
|
|
9169
|
+
withInteractiveBackgroundEvents: {
|
|
9170
|
+
type: Boolean,
|
|
9171
|
+
default: void 0
|
|
9172
|
+
},
|
|
8659
9173
|
recurrenceExpansionLimit: { default: void 0 },
|
|
8660
9174
|
dayViewProps: { default: void 0 },
|
|
8661
9175
|
weekViewProps: { default: void 0 },
|
|
@@ -8742,6 +9256,7 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8742
9256
|
canDragEvent: props.canDragEvent,
|
|
8743
9257
|
withDragSlotSelect: props.withDragSlotSelect,
|
|
8744
9258
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
9259
|
+
withInteractiveBackgroundEvents: isStatic.value ? false : props.withInteractiveBackgroundEvents,
|
|
8745
9260
|
onDateChange: setCurrentDate,
|
|
8746
9261
|
onViewChange: changeView,
|
|
8747
9262
|
onEventDrop: (data) => emit("eventDrop", data),
|
|
@@ -8775,6 +9290,9 @@ var ResourcesSchedule_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8775
9290
|
};
|
|
8776
9291
|
case "month": return {
|
|
8777
9292
|
...sharedProps.value,
|
|
9293
|
+
withEventResize: isStatic.value ? false : props.withEventResize,
|
|
9294
|
+
canResizeEvent: props.canResizeEvent,
|
|
9295
|
+
onEventResize: (data) => emit("eventResize", data),
|
|
8778
9296
|
onDayClick: (data) => emit("dayClick", data),
|
|
8779
9297
|
...props.monthViewProps
|
|
8780
9298
|
};
|
|
@@ -8830,6 +9348,7 @@ exports.ResourcesMonthView = ResourcesMonthView;
|
|
|
8830
9348
|
exports.ResourcesSchedule = ResourcesSchedule;
|
|
8831
9349
|
exports.ResourcesWeekView = ResourcesWeekView;
|
|
8832
9350
|
exports.Schedule = Schedule;
|
|
9351
|
+
exports.ScheduleBackgroundEvent = ScheduleBackgroundEvent_default;
|
|
8833
9352
|
exports.ScheduleEvent = ScheduleEvent;
|
|
8834
9353
|
exports.ScheduleHeader = ScheduleHeader;
|
|
8835
9354
|
exports.ScheduleHeaderBase = ScheduleHeaderBase;
|