@mantine-vue/schedule 3.2.0 → 3.4.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/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
2
|
import isoWeek from "dayjs/plugin/isoWeek.js";
|
|
3
3
|
import * as rruleAll from "rrule";
|
|
4
|
-
import { AccordionChevron, Box, Modal, NativeSelect, Popover, ScrollArea, Text, UnstyledButton, createScopedKeydownHandler, createVarsResolver, factory, getThemeColor, useDirection, useProps, useSafeMantineTheme, useStyles } from "@mantine-vue/core";
|
|
4
|
+
import { AccordionChevron, Box, Modal, NativeSelect, Popover, ScrollArea, Text, UnstyledButton, createScopedKeydownHandler, createVarsResolver, factory, getThemeColor, useDirection, useMantineTheme, useProps, useSafeMantineTheme, useStyles } from "@mantine-vue/core";
|
|
5
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
6
6
|
import { useUncontrolled } from "@mantine-vue/hooks";
|
|
7
7
|
//#region src/labels.ts
|
|
@@ -338,12 +338,24 @@ function sortEvents(events) {
|
|
|
338
338
|
}
|
|
339
339
|
//#endregion
|
|
340
340
|
//#region src/utils/is-events-overlap/is-events-overlap.ts
|
|
341
|
+
var timestampsCache = /* @__PURE__ */ new WeakMap();
|
|
342
|
+
function getTimestamps(event) {
|
|
343
|
+
const cached = timestampsCache.get(event);
|
|
344
|
+
if (cached && cached.start === event.start && cached.end === event.end) return cached;
|
|
345
|
+
const next = {
|
|
346
|
+
start: event.start,
|
|
347
|
+
end: event.end,
|
|
348
|
+
startTimestamp: dayjs(event.start).valueOf(),
|
|
349
|
+
endTimestamp: dayjs(event.end).valueOf()
|
|
350
|
+
};
|
|
351
|
+
timestampsCache.set(event, next);
|
|
352
|
+
return next;
|
|
353
|
+
}
|
|
341
354
|
/** Returns true if two events overlap in time */
|
|
342
355
|
function isEventsOverlap(event1, event2) {
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
return start1 < dayjs(event2.end).valueOf() && start2 < end1;
|
|
356
|
+
const first = getTimestamps(event1);
|
|
357
|
+
const second = getTimestamps(event2);
|
|
358
|
+
return first.startTimestamp < second.endTimestamp && second.startTimestamp < first.endTimestamp;
|
|
347
359
|
}
|
|
348
360
|
//#endregion
|
|
349
361
|
//#region src/utils/get-visible-events/get-visible-events.ts
|
|
@@ -437,13 +449,33 @@ function getDayPosition({ event, startTime = "00:00:00", endTime = "23:59:59", i
|
|
|
437
449
|
}
|
|
438
450
|
//#endregion
|
|
439
451
|
//#region src/utils/calculate-drop-time/calculate-drop-time.ts
|
|
440
|
-
function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset = 0, slotHeight = 64, intervalMinutes = 15 }) {
|
|
452
|
+
function calculateDropTime({ draggedEvent, targetDate, targetSlotTime, mouseYOffset = 0, slotHeight = 64, intervalMinutes = 15, slotOffset, slotSize, dragIntervalMinutes, startTime, endTime }) {
|
|
441
453
|
const eventDuration = dayjs(draggedEvent.end).diff(dayjs(draggedEvent.start), "millisecond");
|
|
442
454
|
const parsedTime = parseTimeString(targetSlotTime);
|
|
443
|
-
const
|
|
455
|
+
const targetDay = dayjs(targetDate).startOf("day");
|
|
456
|
+
const baseTargetTime = targetDay.hour(parsedTime.hours).minute(parsedTime.minutes).second(0);
|
|
444
457
|
let finalTargetTime = baseTargetTime;
|
|
445
|
-
|
|
446
|
-
|
|
458
|
+
const offset = slotOffset ?? mouseYOffset;
|
|
459
|
+
const size = slotSize ?? slotHeight;
|
|
460
|
+
if (dragIntervalMinutes != null) {
|
|
461
|
+
const clampedDrag = clampIntervalMinutes(dragIntervalMinutes);
|
|
462
|
+
const gridInterval = clampIntervalMinutes(intervalMinutes);
|
|
463
|
+
const rawStartMinutes = parsedTime.hours * 60 + parsedTime.minutes + (size > 0 ? offset / size : 0) * gridInterval;
|
|
464
|
+
let snappedStartMinutes = Math.round(rawStartMinutes / clampedDrag) * clampedDrag;
|
|
465
|
+
const parsedEnd = endTime ? parseTimeString(endTime) : null;
|
|
466
|
+
const parsedStart = startTime ? parseTimeString(startTime) : null;
|
|
467
|
+
const maxStart = parsedEnd ? Math.floor((parsedEnd.hours * 60 + parsedEnd.minutes - 1) / clampedDrag) * clampedDrag : null;
|
|
468
|
+
const minStart = parsedStart ? Math.ceil((parsedStart.hours * 60 + parsedStart.minutes) / clampedDrag) * clampedDrag : null;
|
|
469
|
+
if (minStart !== null && maxStart !== null && minStart > maxStart) snappedStartMinutes = parsedStart.hours * 60 + parsedStart.minutes;
|
|
470
|
+
else {
|
|
471
|
+
if (maxStart !== null) snappedStartMinutes = Math.min(snappedStartMinutes, maxStart);
|
|
472
|
+
if (minStart !== null) snappedStartMinutes = Math.max(snappedStartMinutes, minStart);
|
|
473
|
+
}
|
|
474
|
+
const dayOffset = Math.floor(snappedStartMinutes / 1440);
|
|
475
|
+
const minutesInDay = snappedStartMinutes - dayOffset * 1440;
|
|
476
|
+
finalTargetTime = targetDay.add(dayOffset, "day").hour(Math.floor(minutesInDay / 60)).minute(minutesInDay % 60).second(0);
|
|
477
|
+
} else if (offset > 0 && size > 0) {
|
|
478
|
+
const offsetRatio = offset / size;
|
|
447
479
|
const offsetMinutes = Math.round(offsetRatio * intervalMinutes);
|
|
448
480
|
finalTargetTime = baseTargetTime.add(offsetMinutes, "minute");
|
|
449
481
|
}
|
|
@@ -519,6 +551,18 @@ function getExdateSet(recurrence) {
|
|
|
519
551
|
const values = recurrence.exdate.map((value) => dayjs(value)).filter((value) => value.isValid()).map((value) => value.format("YYYY-MM-DD HH:mm:ss"));
|
|
520
552
|
return new Set(values);
|
|
521
553
|
}
|
|
554
|
+
function toWallClockDate(value) {
|
|
555
|
+
return new Date(Date.UTC(value.year(), value.month(), value.date(), value.hour(), value.minute(), value.second(), value.millisecond()));
|
|
556
|
+
}
|
|
557
|
+
function fromWallClockDate(value) {
|
|
558
|
+
const result = new Date(2e3, 0, 1, 12);
|
|
559
|
+
result.setFullYear(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate());
|
|
560
|
+
result.setHours(value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
|
|
561
|
+
return dayjs(result);
|
|
562
|
+
}
|
|
563
|
+
function getWallClockDurationMs(start, end) {
|
|
564
|
+
return toWallClockDate(end).getTime() - toWallClockDate(start).getTime();
|
|
565
|
+
}
|
|
522
566
|
function getRRuleString(rule) {
|
|
523
567
|
const normalized = rule.trim();
|
|
524
568
|
if (!normalized.includes("\n")) return normalized.startsWith("RRULE:") ? normalized.replace(/^RRULE:/, "") : normalized;
|
|
@@ -530,10 +574,10 @@ function getOccurrenceStartsInRange(event, rangeStart, rangeEnd, expansionLimit,
|
|
|
530
574
|
if (!dtstart.isValid() || !event.recurrence) return [];
|
|
531
575
|
try {
|
|
532
576
|
const options = RRule.parseString(getRRuleString(event.recurrence.rrule));
|
|
533
|
-
options.dtstart = dtstart
|
|
577
|
+
options.dtstart = toWallClockDate(dtstart);
|
|
534
578
|
const rule = new RRule(options);
|
|
535
|
-
const searchStart = rangeStart.
|
|
536
|
-
return rule.between(searchStart, rangeEnd
|
|
579
|
+
const searchStart = new Date(toWallClockDate(rangeStart).getTime() - Math.max(0, durationMs));
|
|
580
|
+
return rule.between(searchStart, toWallClockDate(rangeEnd), true).slice(0, expansionLimit);
|
|
537
581
|
} catch {
|
|
538
582
|
return [];
|
|
539
583
|
}
|
|
@@ -544,8 +588,7 @@ function isEventInRange(event, rangeStart, rangeEnd) {
|
|
|
544
588
|
if (!start.isValid() || !end.isValid()) return false;
|
|
545
589
|
return overlapsRange(start, end, rangeStart, rangeEnd);
|
|
546
590
|
}
|
|
547
|
-
function createGeneratedInstance(event, occurrenceStart,
|
|
548
|
-
const occurrenceEnd = occurrenceStart.add(durationMs, "millisecond");
|
|
591
|
+
function createGeneratedInstance(event, occurrenceStart, occurrenceEnd) {
|
|
549
592
|
const recurrenceId = occurrenceStart.format("YYYY-MM-DD HH:mm:ss");
|
|
550
593
|
const { recurrence: _recurrence, ...eventWithoutRecurrence } = event;
|
|
551
594
|
return {
|
|
@@ -591,11 +634,12 @@ function expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit =
|
|
|
591
634
|
const eventStart = dayjs(event.recurrence?.dtstart || event.start);
|
|
592
635
|
const eventEnd = dayjs(event.end);
|
|
593
636
|
if (!eventStart.isValid() || !eventEnd.isValid()) continue;
|
|
594
|
-
const durationMs =
|
|
637
|
+
const durationMs = getWallClockDurationMs(dayjs(event.start), eventEnd);
|
|
595
638
|
if (durationMs < 0) continue;
|
|
596
639
|
const exdate = getExdateSet(event.recurrence);
|
|
597
640
|
const starts = getOccurrenceStartsInRange(event, start, end, expansionLimit, durationMs);
|
|
598
|
-
for (const
|
|
641
|
+
for (const wallClockStart of starts) {
|
|
642
|
+
const occurrenceStart = fromWallClockDate(wallClockStart);
|
|
599
643
|
const recurrenceId = occurrenceStart.format("YYYY-MM-DD HH:mm:ss");
|
|
600
644
|
if (exdate.has(recurrenceId)) continue;
|
|
601
645
|
const overrideKey = getRecurrenceKey(event.id, recurrenceId);
|
|
@@ -607,7 +651,7 @@ function expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit =
|
|
|
607
651
|
}
|
|
608
652
|
continue;
|
|
609
653
|
}
|
|
610
|
-
const generated = createGeneratedInstance(event, occurrenceStart, durationMs);
|
|
654
|
+
const generated = createGeneratedInstance(event, occurrenceStart, fromWallClockDate(new Date(wallClockStart.getTime() + durationMs)));
|
|
611
655
|
if (overlapsRange(dayjs(generated.start), dayjs(generated.end), start, end)) output.push(validateEvent(generated));
|
|
612
656
|
}
|
|
613
657
|
}
|
|
@@ -931,7 +975,7 @@ function useEventResize(input) {
|
|
|
931
975
|
const parsedEndTime = parseTimeString(input.endTime());
|
|
932
976
|
const startMinutes = parsedStartTime.hours * 60 + parsedStartTime.minutes;
|
|
933
977
|
const endMinutes = parsedEndTime.hours * 60 + parsedEndTime.minutes;
|
|
934
|
-
const intervalMinutes = clampIntervalMinutes(input.intervalMinutes());
|
|
978
|
+
const intervalMinutes = clampIntervalMinutes(input.resizeIntervalMinutes?.() ?? input.intervalMinutes());
|
|
935
979
|
const literalRange = endMinutes - startMinutes;
|
|
936
980
|
const totalMinutes = Math.ceil(literalRange / intervalMinutes) * intervalMinutes;
|
|
937
981
|
resizeState.value = {
|
|
@@ -1554,6 +1598,90 @@ var MoreEvents = factory(/* @__PURE__ */ defineComponent({
|
|
|
1554
1598
|
}
|
|
1555
1599
|
}), { classes: MoreEvents_module_default });
|
|
1556
1600
|
//#endregion
|
|
1601
|
+
//#region src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue
|
|
1602
|
+
var ScheduleBackgroundEvent_default = /* @__PURE__ */ defineComponent({
|
|
1603
|
+
name: "ScheduleBackgroundEvent",
|
|
1604
|
+
inheritAttrs: false,
|
|
1605
|
+
__name: "ScheduleBackgroundEvent",
|
|
1606
|
+
props: {
|
|
1607
|
+
event: {},
|
|
1608
|
+
interactive: {
|
|
1609
|
+
type: Boolean,
|
|
1610
|
+
default: false
|
|
1611
|
+
},
|
|
1612
|
+
renderEvent: {
|
|
1613
|
+
type: Function,
|
|
1614
|
+
default: void 0
|
|
1615
|
+
},
|
|
1616
|
+
renderEventBody: {
|
|
1617
|
+
type: Function,
|
|
1618
|
+
default: void 0
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
emits: ["eventClick"],
|
|
1622
|
+
setup(__props, { emit: __emit }) {
|
|
1623
|
+
const props = __props;
|
|
1624
|
+
const emit = __emit;
|
|
1625
|
+
const attrs = useAttrs();
|
|
1626
|
+
const slots = useSlots();
|
|
1627
|
+
const theme = useMantineTheme();
|
|
1628
|
+
const dragPassthrough = ref(false);
|
|
1629
|
+
const resetDragPassthrough = () => {
|
|
1630
|
+
dragPassthrough.value = false;
|
|
1631
|
+
};
|
|
1632
|
+
const enableDragPassthrough = () => {
|
|
1633
|
+
if (!props.interactive || dragPassthrough.value) return;
|
|
1634
|
+
dragPassthrough.value = true;
|
|
1635
|
+
document.addEventListener("dragend", resetDragPassthrough, { once: true });
|
|
1636
|
+
document.addEventListener("drop", resetDragPassthrough, { once: true });
|
|
1637
|
+
document.addEventListener("pointermove", resetDragPassthrough, { once: true });
|
|
1638
|
+
};
|
|
1639
|
+
onBeforeUnmount(() => {
|
|
1640
|
+
document.removeEventListener("dragend", resetDragPassthrough);
|
|
1641
|
+
document.removeEventListener("drop", resetDragPassthrough);
|
|
1642
|
+
document.removeEventListener("pointermove", resetDragPassthrough);
|
|
1643
|
+
});
|
|
1644
|
+
const rootProps = computed(() => {
|
|
1645
|
+
const colors = theme.value.variantColorResolver({
|
|
1646
|
+
color: props.event.color || theme.value.primaryColor,
|
|
1647
|
+
theme: theme.value,
|
|
1648
|
+
variant: "light",
|
|
1649
|
+
autoContrast: true
|
|
1650
|
+
});
|
|
1651
|
+
const style = [attrs.style, {
|
|
1652
|
+
"--bg-event-bg": colors.background,
|
|
1653
|
+
"--bg-event-color": colors.color,
|
|
1654
|
+
"--bg-event-hover": colors.hover,
|
|
1655
|
+
...dragPassthrough.value ? { pointerEvents: "none" } : {}
|
|
1656
|
+
}];
|
|
1657
|
+
return {
|
|
1658
|
+
...attrs,
|
|
1659
|
+
style,
|
|
1660
|
+
mod: [attrs.mod, { interactive: props.interactive }],
|
|
1661
|
+
...props.interactive ? {
|
|
1662
|
+
"data-event-id": props.event.id,
|
|
1663
|
+
title: props.event.title,
|
|
1664
|
+
onClick: (event) => emit("eventClick", props.event, event),
|
|
1665
|
+
onDragenter: enableDragPassthrough,
|
|
1666
|
+
onDragover: enableDragPassthrough
|
|
1667
|
+
} : {}
|
|
1668
|
+
};
|
|
1669
|
+
});
|
|
1670
|
+
const content = () => slots.default?.({ event: props.event }) ?? props.renderEventBody?.(props.event) ?? props.event.title;
|
|
1671
|
+
const render = () => {
|
|
1672
|
+
const component = props.interactive ? UnstyledButton : Box;
|
|
1673
|
+
if (props.renderEvent) return props.renderEvent(props.event, {
|
|
1674
|
+
...rootProps.value,
|
|
1675
|
+
children: content()
|
|
1676
|
+
});
|
|
1677
|
+
return h(component, rootProps.value, { default: content });
|
|
1678
|
+
};
|
|
1679
|
+
return (_ctx, _cache) => {
|
|
1680
|
+
return openBlock(), createBlock(render);
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
//#endregion
|
|
1557
1685
|
//#region src/components/ScheduleHeader/ScheduleHeader.context.ts
|
|
1558
1686
|
var ScheduleHeaderLabelsKey = Symbol("mantine-schedule-header-labels");
|
|
1559
1687
|
/**
|
|
@@ -2487,6 +2615,23 @@ function resolveSlotIndex({ container, intervals }, clientY, eventTarget) {
|
|
|
2487
2615
|
return clientY >= rect.top && clientY <= rect.bottom;
|
|
2488
2616
|
});
|
|
2489
2617
|
}
|
|
2618
|
+
function resolveTarget(input, slotIndex, clientY) {
|
|
2619
|
+
const interval = input.intervals[slotIndex];
|
|
2620
|
+
if (!interval) return void 0;
|
|
2621
|
+
if (input.dragIntervalMinutes == null) return `${input.date} ${interval.startTime}`;
|
|
2622
|
+
const rect = (input.container?.querySelectorAll("[data-time-slot-index]"))?.[slotIndex]?.getBoundingClientRect();
|
|
2623
|
+
const parsed = parseTimeString(interval.startTime);
|
|
2624
|
+
const gridInterval = clampIntervalMinutes(input.intervalMinutes ?? 15);
|
|
2625
|
+
const dragInterval = clampIntervalMinutes(input.dragIntervalMinutes);
|
|
2626
|
+
const offsetRatio = rect && rect.height > 0 ? (clientY - rect.top) / rect.height : 0;
|
|
2627
|
+
let minutes = Math.round((parsed.hours * 60 + parsed.minutes + offsetRatio * gridInterval) / dragInterval) * dragInterval;
|
|
2628
|
+
const start = input.startTime ? parseTimeString(input.startTime) : null;
|
|
2629
|
+
const end = input.endTime ? parseTimeString(input.endTime) : null;
|
|
2630
|
+
const min = start ? Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval : 0;
|
|
2631
|
+
const max = end ? Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval : 1439;
|
|
2632
|
+
minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, minutes));
|
|
2633
|
+
return `${input.date} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
2634
|
+
}
|
|
2490
2635
|
/**
|
|
2491
2636
|
* Tracks the time slot a drag is hovering over.
|
|
2492
2637
|
*
|
|
@@ -2533,10 +2678,10 @@ function useSlotDropTarget() {
|
|
|
2533
2678
|
drop: (nativeEvent, input) => {
|
|
2534
2679
|
const slotIndex = resolveSlotIndex(input, nativeEvent.clientY, nativeEvent.target instanceof Element ? nativeEvent.target : null);
|
|
2535
2680
|
reset();
|
|
2536
|
-
const
|
|
2537
|
-
return
|
|
2681
|
+
const target = resolveTarget(input, slotIndex, nativeEvent.clientY);
|
|
2682
|
+
return target ? {
|
|
2538
2683
|
slotIndex,
|
|
2539
|
-
target
|
|
2684
|
+
target
|
|
2540
2685
|
} : void 0;
|
|
2541
2686
|
},
|
|
2542
2687
|
reset
|
|
@@ -2727,17 +2872,17 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
|
|
|
2727
2872
|
};
|
|
2728
2873
|
}
|
|
2729
2874
|
var DayView_module_default = {
|
|
2730
|
-
dayView: "
|
|
2731
|
-
dayViewScrollArea: "
|
|
2732
|
-
dayViewInner: "
|
|
2733
|
-
dayViewTimeSlots: "
|
|
2734
|
-
dayViewSlot: "
|
|
2735
|
-
dayViewSlotLabels: "
|
|
2736
|
-
dayViewSlotLabel: "
|
|
2737
|
-
dayViewSlots: "
|
|
2738
|
-
dayViewBackgroundEvent: "
|
|
2739
|
-
dayViewAllDay: "
|
|
2740
|
-
dayViewAllDayEvents: "
|
|
2875
|
+
dayView: "_dayView_1nebu_1",
|
|
2876
|
+
dayViewScrollArea: "_dayViewScrollArea_1nebu_22",
|
|
2877
|
+
dayViewInner: "_dayViewInner_1nebu_32",
|
|
2878
|
+
dayViewTimeSlots: "_dayViewTimeSlots_1nebu_36",
|
|
2879
|
+
dayViewSlot: "_dayViewSlot_1nebu_39",
|
|
2880
|
+
dayViewSlotLabels: "_dayViewSlotLabels_1nebu_44",
|
|
2881
|
+
dayViewSlotLabel: "_dayViewSlotLabel_1nebu_44",
|
|
2882
|
+
dayViewSlots: "_dayViewSlots_1nebu_74",
|
|
2883
|
+
dayViewBackgroundEvent: "_dayViewBackgroundEvent_1nebu_178",
|
|
2884
|
+
dayViewAllDay: "_dayViewAllDay_1nebu_201",
|
|
2885
|
+
dayViewAllDayEvents: "_dayViewAllDayEvents_1nebu_206"
|
|
2741
2886
|
};
|
|
2742
2887
|
//#endregion
|
|
2743
2888
|
//#region src/components/DayView/DayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -2783,6 +2928,8 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
2783
2928
|
scrollAreaProps: { default: void 0 },
|
|
2784
2929
|
startTime: { default: void 0 },
|
|
2785
2930
|
endTime: { default: void 0 },
|
|
2931
|
+
eventDragInterval: { default: void 0 },
|
|
2932
|
+
eventResizeInterval: { default: void 0 },
|
|
2786
2933
|
slotLabelFormat: {
|
|
2787
2934
|
type: [String, Function],
|
|
2788
2935
|
default: void 0
|
|
@@ -2838,6 +2985,10 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
2838
2985
|
default: void 0
|
|
2839
2986
|
},
|
|
2840
2987
|
recurrenceExpansionLimit: { default: void 0 },
|
|
2988
|
+
withInteractiveBackgroundEvents: {
|
|
2989
|
+
type: Boolean,
|
|
2990
|
+
default: void 0
|
|
2991
|
+
},
|
|
2841
2992
|
classNames: { default: void 0 },
|
|
2842
2993
|
styles: { default: void 0 },
|
|
2843
2994
|
vars: { default: void 0 },
|
|
@@ -2924,6 +3075,7 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
2924
3075
|
startTime: () => props.startTime,
|
|
2925
3076
|
endTime: () => props.endTime,
|
|
2926
3077
|
intervalMinutes: () => props.intervalMinutes,
|
|
3078
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
2927
3079
|
onEventResize: (data) => emit("eventResize", data),
|
|
2928
3080
|
canResizeEvent: () => props.canResizeEvent
|
|
2929
3081
|
});
|
|
@@ -2989,7 +3141,11 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
2989
3141
|
const dropInput = () => ({
|
|
2990
3142
|
container: timeSlotsContainer.value,
|
|
2991
3143
|
date: datePart.value,
|
|
2992
|
-
intervals: intervals.value
|
|
3144
|
+
intervals: intervals.value,
|
|
3145
|
+
intervalMinutes: props.intervalMinutes,
|
|
3146
|
+
dragIntervalMinutes: props.eventDragInterval,
|
|
3147
|
+
startTime: props.startTime,
|
|
3148
|
+
endTime: props.endTime
|
|
2993
3149
|
});
|
|
2994
3150
|
const handleGridDragOver = (nativeEvent) => slotDropTarget.dragOver(nativeEvent, dropInput());
|
|
2995
3151
|
const handleGridDragLeave = (nativeEvent) => slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value);
|
|
@@ -3101,7 +3257,21 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
3101
3257
|
}, 1040);
|
|
3102
3258
|
}), 128))], 16), createElementVNode("div", normalizeProps(guardReactiveProps(unref(getStyles)("dayViewSlots"))), [unref(props).withAllDaySlot ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(getStyles)("dayViewAllDay"))), [
|
|
3103
3259
|
(openBlock(true), createElementBlock(Fragment, null, renderList(dayEvents.value.backgroundAllDayEvents, (event) => {
|
|
3104
|
-
return openBlock(),
|
|
3260
|
+
return openBlock(), createBlock(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
3261
|
+
key: event.id,
|
|
3262
|
+
event,
|
|
3263
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
3264
|
+
}, { ref_for: true }, {
|
|
3265
|
+
...eventRenderers.value,
|
|
3266
|
+
...unref(staticStyles)("dayViewBackgroundEvent")
|
|
3267
|
+
}, {
|
|
3268
|
+
style: {
|
|
3269
|
+
top: 0,
|
|
3270
|
+
height: "100%",
|
|
3271
|
+
width: "100%"
|
|
3272
|
+
},
|
|
3273
|
+
onEventClick: clickEvent
|
|
3274
|
+
}), null, 16, ["event", "interactive"]);
|
|
3105
3275
|
}), 128)),
|
|
3106
3276
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(getStyles)("dayViewAllDayEvents"))), [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleAllDayEvents.value, (event) => {
|
|
3107
3277
|
return openBlock(), createBlock(unref(ScheduleEvent), mergeProps({
|
|
@@ -3163,7 +3333,21 @@ var DayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
3163
3333
|
onDrop: _cache[7] || (_cache[7] = ($event) => withDragHandlers.value ? handleGridDrop($event) : void 0)
|
|
3164
3334
|
}), [
|
|
3165
3335
|
(openBlock(true), createElementBlock(Fragment, null, renderList(dayEvents.value.backgroundTimedEvents, (event) => {
|
|
3166
|
-
return openBlock(),
|
|
3336
|
+
return openBlock(), createBlock(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
3337
|
+
key: event.id,
|
|
3338
|
+
event,
|
|
3339
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
3340
|
+
}, { ref_for: true }, {
|
|
3341
|
+
...eventRenderers.value,
|
|
3342
|
+
...unref(staticStyles)("dayViewBackgroundEvent")
|
|
3343
|
+
}, {
|
|
3344
|
+
style: backgroundEventStyle(event.position),
|
|
3345
|
+
onEventClick: clickEvent
|
|
3346
|
+
}), null, 16, [
|
|
3347
|
+
"event",
|
|
3348
|
+
"interactive",
|
|
3349
|
+
"style"
|
|
3350
|
+
]);
|
|
3167
3351
|
}), 128)),
|
|
3168
3352
|
(openBlock(true), createElementBlock(Fragment, null, renderList(dayEvents.value.regularEvents, (event) => {
|
|
3169
3353
|
return openBlock(), createBlock(unref(ScheduleEvent), mergeProps({
|
|
@@ -3401,6 +3585,7 @@ var MobileMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
3401
3585
|
default: void 0
|
|
3402
3586
|
},
|
|
3403
3587
|
recurrenceExpansionLimit: { default: void 0 },
|
|
3588
|
+
withInteractiveBackgroundEvents: { type: Boolean },
|
|
3404
3589
|
classNames: { default: void 0 },
|
|
3405
3590
|
styles: { default: void 0 },
|
|
3406
3591
|
vars: { default: void 0 },
|
|
@@ -3930,16 +4115,16 @@ function getRenderableMonthEventSegments({ events, groupedByDay, maxEventsPerDay
|
|
|
3930
4115
|
});
|
|
3931
4116
|
}
|
|
3932
4117
|
var MonthView_module_default = {
|
|
3933
|
-
monthView: "
|
|
3934
|
-
monthViewWeekdays: "
|
|
3935
|
-
monthViewWeek: "
|
|
3936
|
-
monthViewWeekNumber: "
|
|
3937
|
-
monthViewWeekday: "
|
|
3938
|
-
monthViewWeekdaysCorner: "
|
|
3939
|
-
monthViewDay: "
|
|
3940
|
-
monthViewDayLabel: "
|
|
3941
|
-
monthViewBackgroundEvent: "
|
|
3942
|
-
monthViewEvents: "
|
|
4118
|
+
monthView: "_monthView_hbhp2_1",
|
|
4119
|
+
monthViewWeekdays: "_monthViewWeekdays_hbhp2_21",
|
|
4120
|
+
monthViewWeek: "_monthViewWeek_hbhp2_21",
|
|
4121
|
+
monthViewWeekNumber: "_monthViewWeekNumber_hbhp2_31",
|
|
4122
|
+
monthViewWeekday: "_monthViewWeekday_hbhp2_21",
|
|
4123
|
+
monthViewWeekdaysCorner: "_monthViewWeekdaysCorner_hbhp2_107",
|
|
4124
|
+
monthViewDay: "_monthViewDay_hbhp2_114",
|
|
4125
|
+
monthViewDayLabel: "_monthViewDayLabel_hbhp2_255",
|
|
4126
|
+
monthViewBackgroundEvent: "_monthViewBackgroundEvent_hbhp2_271",
|
|
4127
|
+
monthViewEvents: "_monthViewEvents_hbhp2_296"
|
|
3943
4128
|
};
|
|
3944
4129
|
//#endregion
|
|
3945
4130
|
//#region src/components/MonthView/MonthView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -4050,6 +4235,10 @@ var MonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
4050
4235
|
default: void 0
|
|
4051
4236
|
},
|
|
4052
4237
|
recurrenceExpansionLimit: { default: void 0 },
|
|
4238
|
+
withInteractiveBackgroundEvents: {
|
|
4239
|
+
type: Boolean,
|
|
4240
|
+
default: void 0
|
|
4241
|
+
},
|
|
4053
4242
|
classNames: { default: void 0 },
|
|
4054
4243
|
styles: { default: void 0 },
|
|
4055
4244
|
vars: { default: void 0 },
|
|
@@ -4220,6 +4409,10 @@ var MonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
4220
4409
|
width: `${position.width}%`,
|
|
4221
4410
|
top: `${28 + position.row * 22}px`
|
|
4222
4411
|
});
|
|
4412
|
+
const backgroundSegmentStyle = (position) => ({
|
|
4413
|
+
insetInlineStart: `calc(${position.startOffset}% + 2px)`,
|
|
4414
|
+
width: `calc(${position.width}% - 3px)`
|
|
4415
|
+
});
|
|
4223
4416
|
const isDraggableEvent = (event) => !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true);
|
|
4224
4417
|
return (_ctx, _cache) => {
|
|
4225
4418
|
return openBlock(), createBlock(unref(Box), mergeProps({
|
|
@@ -4336,7 +4529,23 @@ var MonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
4336
4529
|
"mode"
|
|
4337
4530
|
])) : createCommentVNode("", true)], 16, _hoisted_1$5);
|
|
4338
4531
|
}), 128)),
|
|
4339
|
-
createElementVNode("div", mergeProps({ ref_for: true }, unref(getStyles)("monthViewEvents")), [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
4532
|
+
createElementVNode("div", mergeProps({ ref_for: true }, unref(getStyles)("monthViewEvents")), [(openBlock(true), createElementBlock(Fragment, null, renderList(grouped.value.backgroundByWeek[String(weekIndex)] || [], (event) => {
|
|
4533
|
+
return openBlock(), createBlock(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
4534
|
+
key: `background-${event.id}-${weekIndex}`,
|
|
4535
|
+
event,
|
|
4536
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
4537
|
+
}, { ref_for: true }, {
|
|
4538
|
+
...eventRenderers.value,
|
|
4539
|
+
...unref(staticStyles)("monthViewBackgroundEvent")
|
|
4540
|
+
}, {
|
|
4541
|
+
style: backgroundSegmentStyle(event.position),
|
|
4542
|
+
onEventClick: clickEvent
|
|
4543
|
+
}), null, 16, [
|
|
4544
|
+
"event",
|
|
4545
|
+
"interactive",
|
|
4546
|
+
"style"
|
|
4547
|
+
]);
|
|
4548
|
+
}), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(weekSegments.value[weekIndex], (segment) => {
|
|
4340
4549
|
return openBlock(), createBlock(unref(ScheduleEvent), mergeProps({
|
|
4341
4550
|
key: segment.key,
|
|
4342
4551
|
event: segment.event,
|
|
@@ -4478,17 +4687,13 @@ function calculateRegularEventOverlaps(events) {
|
|
|
4478
4687
|
}
|
|
4479
4688
|
//#endregion
|
|
4480
4689
|
//#region src/components/WeekView/get-week-view-events/find-available-column.ts
|
|
4481
|
-
function columnHasConflict({ columns, columnIndex, event, allDay
|
|
4690
|
+
function columnHasConflict({ columns, columnIndex, event, allDay }) {
|
|
4482
4691
|
const columnKey = `col-${columnIndex}`;
|
|
4483
4692
|
if (!columns.has(columnKey)) return false;
|
|
4484
|
-
return columns.get(columnKey).some((
|
|
4485
|
-
const
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
}));
|
|
4489
|
-
const hasTimeConflict = isEventsOverlap(e, event);
|
|
4490
|
-
if (allDay && eAllDay) return hasTimeConflict;
|
|
4491
|
-
if (allDay || eAllDay) return false;
|
|
4693
|
+
return columns.get(columnKey).some((columnEvent) => {
|
|
4694
|
+
const hasTimeConflict = isEventsOverlap(columnEvent.event, event);
|
|
4695
|
+
if (allDay && columnEvent.allDay) return hasTimeConflict;
|
|
4696
|
+
if (allDay || columnEvent.allDay) return false;
|
|
4492
4697
|
return hasTimeConflict;
|
|
4493
4698
|
});
|
|
4494
4699
|
}
|
|
@@ -4622,12 +4827,14 @@ function getWeekPositionedEvents({ date, events, startTime, endTime, intervalMin
|
|
|
4622
4827
|
const column = findAvailableColumn({
|
|
4623
4828
|
columns: columnMap,
|
|
4624
4829
|
event,
|
|
4625
|
-
allDay
|
|
4626
|
-
allWeekDays: weekDays
|
|
4830
|
+
allDay
|
|
4627
4831
|
});
|
|
4628
4832
|
const columnKey = `col-${column}`;
|
|
4629
4833
|
if (!columnMap.has(columnKey)) columnMap.set(columnKey, []);
|
|
4630
|
-
columnMap.get(columnKey).push(
|
|
4834
|
+
columnMap.get(columnKey).push({
|
|
4835
|
+
event,
|
|
4836
|
+
allDay: isActuallyAllDay
|
|
4837
|
+
});
|
|
4631
4838
|
const verticalPosition = allDay ? {
|
|
4632
4839
|
top: 0,
|
|
4633
4840
|
height: 100
|
|
@@ -4713,27 +4920,27 @@ function getWeekViewEvents(input) {
|
|
|
4713
4920
|
});
|
|
4714
4921
|
}
|
|
4715
4922
|
var WeekView_module_default = {
|
|
4716
|
-
weekView: "
|
|
4717
|
-
weekViewRoot: "
|
|
4718
|
-
weekViewInner: "
|
|
4719
|
-
weekViewScrollArea: "
|
|
4720
|
-
weekViewHeader: "
|
|
4721
|
-
weekViewCorner: "
|
|
4722
|
-
weekViewSlotLabels: "
|
|
4723
|
-
weekViewSlotLabel: "
|
|
4724
|
-
weekViewDay: "
|
|
4725
|
-
weekViewDayLabel: "
|
|
4726
|
-
weekViewDayNumber: "
|
|
4727
|
-
weekViewDayWeekday: "
|
|
4728
|
-
weekViewBackgroundEvent: "
|
|
4729
|
-
weekViewDaySlots: "
|
|
4730
|
-
weekViewDaySlot: "
|
|
4731
|
-
weekViewWeekLabel: "
|
|
4732
|
-
weekViewWeekNumber: "
|
|
4733
|
-
weekViewAllDaySlots: "
|
|
4734
|
-
weekViewAllDaySlotsLabel: "
|
|
4735
|
-
weekViewAllDaySlotsEvents: "
|
|
4736
|
-
weekViewAllDaySlotsList: "
|
|
4923
|
+
weekView: "_weekView_1f3zt_1",
|
|
4924
|
+
weekViewRoot: "_weekViewRoot_1f3zt_22",
|
|
4925
|
+
weekViewInner: "_weekViewInner_1f3zt_30",
|
|
4926
|
+
weekViewScrollArea: "_weekViewScrollArea_1f3zt_36",
|
|
4927
|
+
weekViewHeader: "_weekViewHeader_1f3zt_42",
|
|
4928
|
+
weekViewCorner: "_weekViewCorner_1f3zt_57",
|
|
4929
|
+
weekViewSlotLabels: "_weekViewSlotLabels_1f3zt_68",
|
|
4930
|
+
weekViewSlotLabel: "_weekViewSlotLabel_1f3zt_68",
|
|
4931
|
+
weekViewDay: "_weekViewDay_1f3zt_95",
|
|
4932
|
+
weekViewDayLabel: "_weekViewDayLabel_1f3zt_100",
|
|
4933
|
+
weekViewDayNumber: "_weekViewDayNumber_1f3zt_138",
|
|
4934
|
+
weekViewDayWeekday: "_weekViewDayWeekday_1f3zt_154",
|
|
4935
|
+
weekViewBackgroundEvent: "_weekViewBackgroundEvent_1f3zt_160",
|
|
4936
|
+
weekViewDaySlots: "_weekViewDaySlots_1f3zt_183",
|
|
4937
|
+
weekViewDaySlot: "_weekViewDaySlot_1f3zt_183",
|
|
4938
|
+
weekViewWeekLabel: "_weekViewWeekLabel_1f3zt_281",
|
|
4939
|
+
weekViewWeekNumber: "_weekViewWeekNumber_1f3zt_287",
|
|
4940
|
+
weekViewAllDaySlots: "_weekViewAllDaySlots_1f3zt_293",
|
|
4941
|
+
weekViewAllDaySlotsLabel: "_weekViewAllDaySlotsLabel_1f3zt_298",
|
|
4942
|
+
weekViewAllDaySlotsEvents: "_weekViewAllDaySlotsEvents_1f3zt_305",
|
|
4943
|
+
weekViewAllDaySlotsList: "_weekViewAllDaySlotsList_1f3zt_312"
|
|
4737
4944
|
};
|
|
4738
4945
|
//#endregion
|
|
4739
4946
|
//#region src/components/WeekView/WeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -4825,6 +5032,8 @@ var WeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
4825
5032
|
scrollAreaProps: { default: void 0 },
|
|
4826
5033
|
startTime: { default: void 0 },
|
|
4827
5034
|
endTime: { default: void 0 },
|
|
5035
|
+
eventDragInterval: { default: void 0 },
|
|
5036
|
+
eventResizeInterval: { default: void 0 },
|
|
4828
5037
|
slotLabelFormat: {
|
|
4829
5038
|
type: [String, Function],
|
|
4830
5039
|
default: void 0
|
|
@@ -4876,6 +5085,10 @@ var WeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
4876
5085
|
default: void 0
|
|
4877
5086
|
},
|
|
4878
5087
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5088
|
+
withInteractiveBackgroundEvents: {
|
|
5089
|
+
type: Boolean,
|
|
5090
|
+
default: void 0
|
|
5091
|
+
},
|
|
4879
5092
|
classNames: { default: void 0 },
|
|
4880
5093
|
styles: { default: void 0 },
|
|
4881
5094
|
vars: { default: void 0 },
|
|
@@ -5020,6 +5233,7 @@ var WeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5020
5233
|
startTime: () => props.startTime,
|
|
5021
5234
|
endTime: () => props.endTime,
|
|
5022
5235
|
intervalMinutes: () => props.intervalMinutes,
|
|
5236
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
5023
5237
|
onEventResize: (data) => emit("eventResize", data),
|
|
5024
5238
|
canResizeEvent: () => props.canResizeEvent
|
|
5025
5239
|
});
|
|
@@ -5121,7 +5335,11 @@ var WeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5121
5335
|
const dropInput = (date) => ({
|
|
5122
5336
|
container: daySlotsContainers.get(date),
|
|
5123
5337
|
date: dayjs(date).format("YYYY-MM-DD"),
|
|
5124
|
-
intervals: intervals.value
|
|
5338
|
+
intervals: intervals.value,
|
|
5339
|
+
intervalMinutes: props.intervalMinutes,
|
|
5340
|
+
dragIntervalMinutes: props.eventDragInterval,
|
|
5341
|
+
startTime: props.startTime,
|
|
5342
|
+
endTime: props.endTime
|
|
5125
5343
|
});
|
|
5126
5344
|
const handleDayDragOver = (nativeEvent, date) => slotDropTarget.dragOver(nativeEvent, dropInput(date));
|
|
5127
5345
|
const handleDayDragLeave = (nativeEvent, date) => slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date));
|
|
@@ -5355,7 +5573,21 @@ var WeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5355
5573
|
]);
|
|
5356
5574
|
}), 128)),
|
|
5357
5575
|
(openBlock(true), createElementBlock(Fragment, null, renderList(grouped.value.backgroundEvents[column.date] || [], (event) => {
|
|
5358
|
-
return openBlock(),
|
|
5576
|
+
return openBlock(), createBlock(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
5577
|
+
key: `background-${event.id}`,
|
|
5578
|
+
event,
|
|
5579
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
5580
|
+
}, { ref_for: true }, {
|
|
5581
|
+
...eventRenderers.value,
|
|
5582
|
+
...unref(staticStyles)("weekViewBackgroundEvent")
|
|
5583
|
+
}, {
|
|
5584
|
+
style: backgroundEventStyle(event.position),
|
|
5585
|
+
onEventClick: clickEvent
|
|
5586
|
+
}), null, 16, [
|
|
5587
|
+
"event",
|
|
5588
|
+
"interactive",
|
|
5589
|
+
"style"
|
|
5590
|
+
]);
|
|
5359
5591
|
}), 128)),
|
|
5360
5592
|
(openBlock(true), createElementBlock(Fragment, null, renderList(grouped.value.regularEvents[column.date] || [], (event) => {
|
|
5361
5593
|
return openBlock(), createBlock(unref(ScheduleEvent), mergeProps({
|
|
@@ -5433,18 +5665,18 @@ function getYearViewEvents({ date, events }) {
|
|
|
5433
5665
|
return groupedEvents;
|
|
5434
5666
|
}
|
|
5435
5667
|
var YearView_module_default = {
|
|
5436
|
-
yearView: "
|
|
5437
|
-
yearViewMonths: "
|
|
5438
|
-
yearViewMonth: "
|
|
5439
|
-
yearViewWeekdays: "
|
|
5440
|
-
yearViewWeek: "
|
|
5441
|
-
yearViewWeekNumber: "
|
|
5442
|
-
yearViewWeekday: "
|
|
5443
|
-
yearViewWeekdaysCorner: "
|
|
5444
|
-
yearViewDay: "
|
|
5445
|
-
yearViewMonthCaption: "
|
|
5446
|
-
yearViewDayIndicators: "
|
|
5447
|
-
yearViewDayIndicator: "
|
|
5668
|
+
yearView: "_yearView_1ww3l_1",
|
|
5669
|
+
yearViewMonths: "_yearViewMonths_1ww3l_16",
|
|
5670
|
+
yearViewMonth: "_yearViewMonth_1ww3l_16",
|
|
5671
|
+
yearViewWeekdays: "_yearViewWeekdays_1ww3l_93",
|
|
5672
|
+
yearViewWeek: "_yearViewWeek_1ww3l_93",
|
|
5673
|
+
yearViewWeekNumber: "_yearViewWeekNumber_1ww3l_101",
|
|
5674
|
+
yearViewWeekday: "_yearViewWeekday_1ww3l_93",
|
|
5675
|
+
yearViewWeekdaysCorner: "_yearViewWeekdaysCorner_1ww3l_156",
|
|
5676
|
+
yearViewDay: "_yearViewDay_1ww3l_160",
|
|
5677
|
+
yearViewMonthCaption: "_yearViewMonthCaption_1ww3l_220",
|
|
5678
|
+
yearViewDayIndicators: "_yearViewDayIndicators_1ww3l_246",
|
|
5679
|
+
yearViewDayIndicator: "_yearViewDayIndicator_1ww3l_246"
|
|
5448
5680
|
};
|
|
5449
5681
|
//#endregion
|
|
5450
5682
|
//#region src/components/YearView/YearView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -5456,6 +5688,7 @@ var defaultProps$5 = {
|
|
|
5456
5688
|
firstDayOfWeek: 1,
|
|
5457
5689
|
weekdayFormat: "dd",
|
|
5458
5690
|
weekendDays: [0, 6],
|
|
5691
|
+
withWeekendDays: true,
|
|
5459
5692
|
withWeekDays: true,
|
|
5460
5693
|
highlightToday: true,
|
|
5461
5694
|
withOutsideDays: true,
|
|
@@ -5475,6 +5708,10 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5475
5708
|
default: void 0
|
|
5476
5709
|
},
|
|
5477
5710
|
weekendDays: { default: void 0 },
|
|
5711
|
+
withWeekendDays: {
|
|
5712
|
+
type: Boolean,
|
|
5713
|
+
default: void 0
|
|
5714
|
+
},
|
|
5478
5715
|
withWeekNumbers: { type: Boolean },
|
|
5479
5716
|
withWeekDays: {
|
|
5480
5717
|
type: Boolean,
|
|
@@ -5500,6 +5737,10 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5500
5737
|
type: Function,
|
|
5501
5738
|
default: void 0
|
|
5502
5739
|
},
|
|
5740
|
+
renderDay: {
|
|
5741
|
+
type: Function,
|
|
5742
|
+
default: void 0
|
|
5743
|
+
},
|
|
5503
5744
|
getWeekNumberProps: {
|
|
5504
5745
|
type: Function,
|
|
5505
5746
|
default: void 0
|
|
@@ -5528,6 +5769,7 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5528
5769
|
default: void 0
|
|
5529
5770
|
},
|
|
5530
5771
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5772
|
+
withInteractiveBackgroundEvents: { type: Boolean },
|
|
5531
5773
|
classNames: { default: void 0 },
|
|
5532
5774
|
styles: { default: void 0 },
|
|
5533
5775
|
vars: { default: void 0 },
|
|
@@ -5585,7 +5827,13 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5585
5827
|
locale: props.locale || "en",
|
|
5586
5828
|
format: props.weekdayFormat,
|
|
5587
5829
|
firstDayOfWeek: props.firstDayOfWeek
|
|
5588
|
-
}));
|
|
5830
|
+
}).filter((_, index) => !hiddenWeekendColumns.value.has(index)));
|
|
5831
|
+
const hiddenWeekendColumns = computed(() => {
|
|
5832
|
+
if (props.withWeekendDays !== false) return /* @__PURE__ */ new Set();
|
|
5833
|
+
return new Set(Array.from({ length: 7 }, (_, index) => index).filter((index) => props.weekendDays.includes((props.firstDayOfWeek + index) % 7)));
|
|
5834
|
+
});
|
|
5835
|
+
const columnsCount = computed(() => 7 - hiddenWeekendColumns.value.size);
|
|
5836
|
+
const visibleWeek = (week) => props.withWeekendDays === false ? week.filter((date) => !props.weekendDays.includes(dayjs(date).day())) : week;
|
|
5589
5837
|
/**
|
|
5590
5838
|
* Every month with the grid offset its cells start at, so a single roving tabindex can walk
|
|
5591
5839
|
* the whole year rather than restarting in each month.
|
|
@@ -5605,11 +5853,11 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5605
5853
|
weeks,
|
|
5606
5854
|
offset
|
|
5607
5855
|
};
|
|
5608
|
-
offset += weeks.length *
|
|
5856
|
+
offset += weeks.length * columnsCount.value;
|
|
5609
5857
|
return entry;
|
|
5610
5858
|
});
|
|
5611
5859
|
});
|
|
5612
|
-
const totalYearGridCells = computed(() => months.value.reduce((total, { weeks }) => total + weeks.length *
|
|
5860
|
+
const totalYearGridCells = computed(() => months.value.reduce((total, { weeks }) => total + weeks.length * columnsCount.value, 0));
|
|
5613
5861
|
const headerControl = computed(() => ({ monthYearSelect: {
|
|
5614
5862
|
locale: props.locale,
|
|
5615
5863
|
yearValue: year.value.year(),
|
|
@@ -5622,13 +5870,13 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5622
5870
|
const dayProps = (date) => props.getDayProps?.(toDateString(date)) ?? {};
|
|
5623
5871
|
const weekNumberProps = (weekStart) => props.getWeekNumberProps?.(toDateString(weekStart)) ?? {};
|
|
5624
5872
|
const isOutside = (date, month) => !dayjs(date).isSame(month, "month");
|
|
5625
|
-
const dayEvents = (date) =>
|
|
5873
|
+
const dayEvents = (date) => eventsByDay.value[dayjs(date).format("YYYY-MM-DD")] || [];
|
|
5626
5874
|
const indicatorStyle = (event) => ({ background: `var(--mantine-color-${event.color}-6, ${event.color})` });
|
|
5627
5875
|
const handleDayKeydown = (nativeEvent, gridIndex) => {
|
|
5628
5876
|
handleGridKeydown({
|
|
5629
5877
|
event: nativeEvent,
|
|
5630
5878
|
index: gridIndex,
|
|
5631
|
-
columns:
|
|
5879
|
+
columns: columnsCount.value,
|
|
5632
5880
|
total: totalYearGridCells.value,
|
|
5633
5881
|
getControl: (index) => {
|
|
5634
5882
|
const control = yearGrid.value?.querySelector(`[data-year-grid-index="${index}"]`) ?? null;
|
|
@@ -5637,10 +5885,17 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5637
5885
|
});
|
|
5638
5886
|
};
|
|
5639
5887
|
return (_ctx, _cache) => {
|
|
5640
|
-
return openBlock(), createBlock(unref(Box),
|
|
5888
|
+
return openBlock(), createBlock(unref(Box), mergeProps({
|
|
5641
5889
|
...unref(attrs),
|
|
5642
5890
|
...unref(getStyles)("yearView")
|
|
5643
|
-
}
|
|
5891
|
+
}, {
|
|
5892
|
+
style: [
|
|
5893
|
+
unref(getStyles)("yearView").style,
|
|
5894
|
+
{ "--year-view-columns": columnsCount.value },
|
|
5895
|
+
unref(attrs).style
|
|
5896
|
+
],
|
|
5897
|
+
"data-without-weekend-days": hiddenWeekendColumns.value.size > 0 || void 0
|
|
5898
|
+
}), {
|
|
5644
5899
|
default: withCtx(() => [unref(props).withHeader ? (openBlock(), createBlock(unref(ScheduleHeaderBase), mergeProps({
|
|
5645
5900
|
key: 0,
|
|
5646
5901
|
view: "year",
|
|
@@ -5694,7 +5949,7 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5694
5949
|
}, { onClick: ($event) => emit("weekNumberClick", unref(toDateString)(week[0]), $event) }), {
|
|
5695
5950
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(getWeekNumber)(week)), 1)]),
|
|
5696
5951
|
_: 2
|
|
5697
|
-
}, 1040, ["onClick"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(week, (date, dayIndex) => {
|
|
5952
|
+
}, 1040, ["onClick"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleWeek(week), (date, dayIndex) => {
|
|
5698
5953
|
return openBlock(), createElementBlock(Fragment, { key: unref(toDateString)(date) }, [isOutside(date, month) && !unref(props).withOutsideDays ? (openBlock(), createElementBlock("div", mergeProps({
|
|
5699
5954
|
key: 0,
|
|
5700
5955
|
ref_for: true
|
|
@@ -5706,7 +5961,7 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5706
5961
|
...unref(getStyles)("yearViewDay", { className: dayProps(date).class })
|
|
5707
5962
|
}, {
|
|
5708
5963
|
disabled: isStatic.value,
|
|
5709
|
-
"data-year-grid-index": offset + weekIndex *
|
|
5964
|
+
"data-year-grid-index": offset + weekIndex * columnsCount.value + dayIndex,
|
|
5710
5965
|
"data-outside": isOutside(date, month) || void 0,
|
|
5711
5966
|
"data-weekend": unref(props).weekendDays.includes(unref(dayjs)(date).day()) || void 0,
|
|
5712
5967
|
"data-today": unref(props).highlightToday && unref(dayjs)(date).isSame(unref(dayjs)(), "day") || void 0,
|
|
@@ -5716,15 +5971,18 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5716
5971
|
format: "MMMM D, YYYY"
|
|
5717
5972
|
}),
|
|
5718
5973
|
tabindex: isStatic.value || isOutside(date, month) ? -1 : unref(dayjs)(date).date() === 1 ? 0 : -1,
|
|
5719
|
-
onKeydown: ($event) => isStatic.value ? void 0 : handleDayKeydown($event, offset + weekIndex *
|
|
5974
|
+
onKeydown: ($event) => isStatic.value ? void 0 : handleDayKeydown($event, offset + weekIndex * columnsCount.value + dayIndex),
|
|
5720
5975
|
onClick: ($event) => emit("dayClick", unref(toDateString)(date), $event)
|
|
5721
5976
|
}), {
|
|
5722
|
-
default: withCtx(() => [
|
|
5977
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "day", {
|
|
5978
|
+
date: unref(toDateString)(date),
|
|
5979
|
+
events: dayEvents(date)
|
|
5980
|
+
}, () => [unref(props).renderDay ? (openBlock(), createBlock(resolveDynamicComponent(() => unref(props).renderDay(unref(toDateString)(date), dayEvents(date))), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(unref(dayjs)(date).date()) + " ", 1), dayEvents(date).length ? (openBlock(), createElementBlock("span", mergeProps({
|
|
5723
5981
|
key: 0,
|
|
5724
5982
|
ref_for: true
|
|
5725
|
-
}, unref(getStyles)("yearViewDayIndicators")), [(openBlock(true), createElementBlock(Fragment, null, renderList(dayEvents(date), (event) => {
|
|
5983
|
+
}, unref(getStyles)("yearViewDayIndicators")), [(openBlock(true), createElementBlock(Fragment, null, renderList(dayEvents(date).slice(0, 3), (event) => {
|
|
5726
5984
|
return openBlock(), createElementBlock("span", mergeProps({ key: event.id }, { ref_for: true }, unref(getStyles)("yearViewDayIndicator"), { style: indicatorStyle(event) }), null, 16);
|
|
5727
|
-
}), 128))], 16)) : createCommentVNode("", true)]),
|
|
5985
|
+
}), 128))], 16)) : createCommentVNode("", true)], 64))])]),
|
|
5728
5986
|
_: 2
|
|
5729
5987
|
}, 1040, [
|
|
5730
5988
|
"disabled",
|
|
@@ -5741,8 +5999,8 @@ var YearView = factory(/* @__PURE__ */ defineComponent({
|
|
|
5741
5999
|
}), 128))
|
|
5742
6000
|
], 16, _hoisted_1$3);
|
|
5743
6001
|
}), 128))], 16)]),
|
|
5744
|
-
_:
|
|
5745
|
-
}, 16);
|
|
6002
|
+
_: 3
|
|
6003
|
+
}, 16, ["style", "data-without-weekend-days"]);
|
|
5746
6004
|
};
|
|
5747
6005
|
}
|
|
5748
6006
|
}), {
|
|
@@ -5794,6 +6052,10 @@ var Schedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
5794
6052
|
type: Function,
|
|
5795
6053
|
default: void 0
|
|
5796
6054
|
},
|
|
6055
|
+
withInteractiveBackgroundEvents: {
|
|
6056
|
+
type: Boolean,
|
|
6057
|
+
default: void 0
|
|
6058
|
+
},
|
|
5797
6059
|
recurrenceExpansionLimit: { default: void 0 },
|
|
5798
6060
|
layout: { default: void 0 },
|
|
5799
6061
|
dayViewProps: { default: void 0 },
|
|
@@ -5880,6 +6142,7 @@ var Schedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
5880
6142
|
withExternalEventDrop: props.withExternalEventDrop,
|
|
5881
6143
|
withEventResize: props.withEventResize,
|
|
5882
6144
|
canResizeEvent: props.canResizeEvent,
|
|
6145
|
+
withInteractiveBackgroundEvents: props.mode === "static" ? false : props.withInteractiveBackgroundEvents,
|
|
5883
6146
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
5884
6147
|
...eventRenderers.value,
|
|
5885
6148
|
...stylesApi.value
|
|
@@ -5979,7 +6242,7 @@ function useHorizontalEventResize(input) {
|
|
|
5979
6242
|
const end = parseTimeString(input.endTime());
|
|
5980
6243
|
const startMinutes = start.hours * 60 + start.minutes;
|
|
5981
6244
|
const literalRange = end.hours * 60 + end.minutes - startMinutes;
|
|
5982
|
-
const interval = clampIntervalMinutes(input.intervalMinutes());
|
|
6245
|
+
const interval = clampIntervalMinutes(input.resizeIntervalMinutes?.() ?? input.intervalMinutes());
|
|
5983
6246
|
const total = Math.ceil(literalRange / interval) * interval;
|
|
5984
6247
|
return {
|
|
5985
6248
|
startMinutes,
|
|
@@ -6185,27 +6448,27 @@ function getResourcesDayViewEvents({ events, resources, date, startTime, endTime
|
|
|
6185
6448
|
return result;
|
|
6186
6449
|
}
|
|
6187
6450
|
var ResourcesDayView_module_default = {
|
|
6188
|
-
resourcesDayView: "
|
|
6189
|
-
resourcesDayViewRoot: "
|
|
6190
|
-
resourcesDayViewScrollArea: "
|
|
6191
|
-
resourcesDayViewInner: "
|
|
6192
|
-
resourcesDayViewTimeLabelsRow: "
|
|
6193
|
-
resourcesDayViewCorner: "
|
|
6194
|
-
resourcesDayViewTimeLabel: "
|
|
6195
|
-
resourcesDayViewRow: "
|
|
6196
|
-
resourcesDayViewResourceLabel: "
|
|
6197
|
-
resourcesDayViewGroupColumn: "
|
|
6198
|
-
resourcesDayViewGroupColumnEmpty: "
|
|
6199
|
-
resourcesDayViewRowSlots: "
|
|
6200
|
-
resourcesDayViewRowSlot: "
|
|
6201
|
-
resourcesDayViewCurrentTimeIndicator: "
|
|
6202
|
-
resourcesDayViewCurrentTimeIndicatorLine: "
|
|
6203
|
-
resourcesDayViewCurrentTimeIndicatorThumb: "
|
|
6204
|
-
resourcesDayViewCurrentTimeIndicatorTimeBubble: "
|
|
6205
|
-
resourcesDayViewBackgroundEvent: "
|
|
6206
|
-
resourcesDayViewAllDayEvent: "
|
|
6207
|
-
resourcesDayViewEventWrapper: "
|
|
6208
|
-
resourcesDayViewResizeHandle: "
|
|
6451
|
+
resourcesDayView: "_resourcesDayView_wmj51_1",
|
|
6452
|
+
resourcesDayViewRoot: "_resourcesDayViewRoot_wmj51_22",
|
|
6453
|
+
resourcesDayViewScrollArea: "_resourcesDayViewScrollArea_wmj51_30",
|
|
6454
|
+
resourcesDayViewInner: "_resourcesDayViewInner_wmj51_39",
|
|
6455
|
+
resourcesDayViewTimeLabelsRow: "_resourcesDayViewTimeLabelsRow_wmj51_44",
|
|
6456
|
+
resourcesDayViewCorner: "_resourcesDayViewCorner_wmj51_57",
|
|
6457
|
+
resourcesDayViewTimeLabel: "_resourcesDayViewTimeLabel_wmj51_44",
|
|
6458
|
+
resourcesDayViewRow: "_resourcesDayViewRow_wmj51_96",
|
|
6459
|
+
resourcesDayViewResourceLabel: "_resourcesDayViewResourceLabel_wmj51_100",
|
|
6460
|
+
resourcesDayViewGroupColumn: "_resourcesDayViewGroupColumn_wmj51_124",
|
|
6461
|
+
resourcesDayViewGroupColumnEmpty: "_resourcesDayViewGroupColumnEmpty_wmj51_125",
|
|
6462
|
+
resourcesDayViewRowSlots: "_resourcesDayViewRowSlots_wmj51_153",
|
|
6463
|
+
resourcesDayViewRowSlot: "_resourcesDayViewRowSlot_wmj51_153",
|
|
6464
|
+
resourcesDayViewCurrentTimeIndicator: "_resourcesDayViewCurrentTimeIndicator_wmj51_231",
|
|
6465
|
+
resourcesDayViewCurrentTimeIndicatorLine: "_resourcesDayViewCurrentTimeIndicatorLine_wmj51_243",
|
|
6466
|
+
resourcesDayViewCurrentTimeIndicatorThumb: "_resourcesDayViewCurrentTimeIndicatorThumb_wmj51_249",
|
|
6467
|
+
resourcesDayViewCurrentTimeIndicatorTimeBubble: "_resourcesDayViewCurrentTimeIndicatorTimeBubble_wmj51_259",
|
|
6468
|
+
resourcesDayViewBackgroundEvent: "_resourcesDayViewBackgroundEvent_wmj51_278",
|
|
6469
|
+
resourcesDayViewAllDayEvent: "_resourcesDayViewAllDayEvent_wmj51_300",
|
|
6470
|
+
resourcesDayViewEventWrapper: "_resourcesDayViewEventWrapper_wmj51_306",
|
|
6471
|
+
resourcesDayViewResizeHandle: "_resourcesDayViewResizeHandle_wmj51_310"
|
|
6209
6472
|
};
|
|
6210
6473
|
//#endregion
|
|
6211
6474
|
//#region src/components/ResourcesDayView/ResourcesDayView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -6256,6 +6519,8 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6256
6519
|
startTime: { default: void 0 },
|
|
6257
6520
|
endTime: { default: void 0 },
|
|
6258
6521
|
intervalMinutes: { default: void 0 },
|
|
6522
|
+
eventDragInterval: { default: void 0 },
|
|
6523
|
+
eventResizeInterval: { default: void 0 },
|
|
6259
6524
|
slotLabelFormat: {
|
|
6260
6525
|
type: [String, Function],
|
|
6261
6526
|
default: void 0
|
|
@@ -6303,6 +6568,10 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6303
6568
|
type: Function,
|
|
6304
6569
|
default: void 0
|
|
6305
6570
|
},
|
|
6571
|
+
withInteractiveBackgroundEvents: {
|
|
6572
|
+
type: Boolean,
|
|
6573
|
+
default: void 0
|
|
6574
|
+
},
|
|
6306
6575
|
renderResourceLabel: {
|
|
6307
6576
|
type: Function,
|
|
6308
6577
|
default: void 0
|
|
@@ -6459,6 +6728,7 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6459
6728
|
startTime: () => props.startTime,
|
|
6460
6729
|
endTime: () => props.endTime,
|
|
6461
6730
|
intervalMinutes: () => props.intervalMinutes,
|
|
6731
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
6462
6732
|
onEventResize: (data) => emit("eventResize", data),
|
|
6463
6733
|
canResizeEvent: () => props.canResizeEvent
|
|
6464
6734
|
});
|
|
@@ -6490,9 +6760,8 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6490
6760
|
nativeEvent.preventDefault();
|
|
6491
6761
|
resolveDropTarget.cancel();
|
|
6492
6762
|
setDropTarget(null);
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
const target = `${date.value} ${interval.startTime}`;
|
|
6763
|
+
if (!intervals.value[slotIndex]) return;
|
|
6764
|
+
const target = getSnappedDropTarget(nativeEvent, slotIndex);
|
|
6496
6765
|
const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer);
|
|
6497
6766
|
if (event) emit("eventDrop", {
|
|
6498
6767
|
...moveEventTo(event, target),
|
|
@@ -6504,6 +6773,22 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6504
6773
|
resourceId
|
|
6505
6774
|
});
|
|
6506
6775
|
};
|
|
6776
|
+
const getSnappedDropTarget = (nativeEvent, slotIndex) => {
|
|
6777
|
+
const interval = intervals.value[slotIndex];
|
|
6778
|
+
if (!interval || props.eventDragInterval == null) return `${date.value} ${interval?.startTime ?? "00:00:00"}`;
|
|
6779
|
+
const rect = (nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null)?.getBoundingClientRect();
|
|
6780
|
+
const slotSize = rect && rect.width > 0 ? rect.width / intervals.value.length : 0;
|
|
6781
|
+
const slotOffset = rect ? nativeEvent.clientX - rect.left - slotIndex * slotSize : 0;
|
|
6782
|
+
const parsed = parseTimeString(interval.startTime);
|
|
6783
|
+
const dragInterval = clampIntervalMinutes(props.eventDragInterval);
|
|
6784
|
+
const raw = parsed.hours * 60 + parsed.minutes + (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes;
|
|
6785
|
+
const start = parseTimeString(props.startTime);
|
|
6786
|
+
const end = parseTimeString(props.endTime);
|
|
6787
|
+
const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval;
|
|
6788
|
+
const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval;
|
|
6789
|
+
const minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval));
|
|
6790
|
+
return `${date.value} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
6791
|
+
};
|
|
6507
6792
|
const setDropTarget = (next) => {
|
|
6508
6793
|
const current = dropTarget.value;
|
|
6509
6794
|
if (current === next) return;
|
|
@@ -6762,10 +7047,20 @@ var ResourcesDayView = factory(/* @__PURE__ */ defineComponent({
|
|
|
6762
7047
|
return renderSlot(_ctx.$slots, "backgroundEvent", {
|
|
6763
7048
|
key: `bg-${event.id}`,
|
|
6764
7049
|
event
|
|
6765
|
-
}, () => [createVNode(unref(
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
},
|
|
7050
|
+
}, () => [createVNode(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
7051
|
+
event,
|
|
7052
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
7053
|
+
}, { ref_for: true }, {
|
|
7054
|
+
...eventRenderers.value,
|
|
7055
|
+
...unref(getStyles)("resourcesDayViewBackgroundEvent")
|
|
7056
|
+
}, {
|
|
7057
|
+
style: backgroundEventStyle(event),
|
|
7058
|
+
onEventClick: clickEvent
|
|
7059
|
+
}), null, 16, [
|
|
7060
|
+
"event",
|
|
7061
|
+
"interactive",
|
|
7062
|
+
"style"
|
|
7063
|
+
])]);
|
|
6769
7064
|
}), 128)),
|
|
6770
7065
|
(openBlock(true), createElementBlock(Fragment, null, renderList(allDayEvents(resource.id), (event, index) => {
|
|
6771
7066
|
return openBlock(), createBlock(unref(Box), mergeProps({
|
|
@@ -7013,31 +7308,31 @@ function getResourcesWeekViewEvents({ events, resources, weekdays, startTime, en
|
|
|
7013
7308
|
};
|
|
7014
7309
|
}
|
|
7015
7310
|
var ResourcesWeekView_module_default = {
|
|
7016
|
-
resourcesWeekView: "
|
|
7017
|
-
resourcesWeekViewRoot: "
|
|
7018
|
-
resourcesWeekViewScrollArea: "
|
|
7019
|
-
resourcesWeekViewInner: "
|
|
7020
|
-
resourcesWeekViewHeaderRows: "
|
|
7021
|
-
resourcesWeekViewCorner: "
|
|
7022
|
-
resourcesWeekViewHeaderContent: "
|
|
7023
|
-
resourcesWeekViewDayLabelsRow: "
|
|
7024
|
-
resourcesWeekViewDayLabel: "
|
|
7025
|
-
resourcesWeekViewTimeLabelsRow: "
|
|
7026
|
-
resourcesWeekViewTimeLabel: "
|
|
7027
|
-
resourcesWeekViewRow: "
|
|
7028
|
-
resourcesWeekViewResourceLabel: "
|
|
7029
|
-
resourcesWeekViewGroupColumn: "
|
|
7030
|
-
resourcesWeekViewGroupColumnEmpty: "
|
|
7031
|
-
resourcesWeekViewRowSlots: "
|
|
7032
|
-
resourcesWeekViewRowSlot: "
|
|
7033
|
-
resourcesWeekViewBackgroundEvent: "
|
|
7034
|
-
resourcesWeekViewAllDayEvent: "
|
|
7035
|
-
resourcesWeekViewEventWrapper: "
|
|
7036
|
-
resourcesWeekViewResizeHandle: "
|
|
7037
|
-
resourcesWeekViewCurrentTimeIndicator: "
|
|
7038
|
-
resourcesWeekViewCurrentTimeIndicatorLine: "
|
|
7039
|
-
resourcesWeekViewCurrentTimeIndicatorThumb: "
|
|
7040
|
-
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "
|
|
7311
|
+
resourcesWeekView: "_resourcesWeekView_1komm_1",
|
|
7312
|
+
resourcesWeekViewRoot: "_resourcesWeekViewRoot_1komm_19",
|
|
7313
|
+
resourcesWeekViewScrollArea: "_resourcesWeekViewScrollArea_1komm_26",
|
|
7314
|
+
resourcesWeekViewInner: "_resourcesWeekViewInner_1komm_34",
|
|
7315
|
+
resourcesWeekViewHeaderRows: "_resourcesWeekViewHeaderRows_1komm_39",
|
|
7316
|
+
resourcesWeekViewCorner: "_resourcesWeekViewCorner_1komm_48",
|
|
7317
|
+
resourcesWeekViewHeaderContent: "_resourcesWeekViewHeaderContent_1komm_63",
|
|
7318
|
+
resourcesWeekViewDayLabelsRow: "_resourcesWeekViewDayLabelsRow_1komm_67",
|
|
7319
|
+
resourcesWeekViewDayLabel: "_resourcesWeekViewDayLabel_1komm_67",
|
|
7320
|
+
resourcesWeekViewTimeLabelsRow: "_resourcesWeekViewTimeLabelsRow_1komm_94",
|
|
7321
|
+
resourcesWeekViewTimeLabel: "_resourcesWeekViewTimeLabel_1komm_94",
|
|
7322
|
+
resourcesWeekViewRow: "_resourcesWeekViewRow_1komm_121",
|
|
7323
|
+
resourcesWeekViewResourceLabel: "_resourcesWeekViewResourceLabel_1komm_125",
|
|
7324
|
+
resourcesWeekViewGroupColumn: "_resourcesWeekViewGroupColumn_1komm_149",
|
|
7325
|
+
resourcesWeekViewGroupColumnEmpty: "_resourcesWeekViewGroupColumnEmpty_1komm_150",
|
|
7326
|
+
resourcesWeekViewRowSlots: "_resourcesWeekViewRowSlots_1komm_178",
|
|
7327
|
+
resourcesWeekViewRowSlot: "_resourcesWeekViewRowSlot_1komm_178",
|
|
7328
|
+
resourcesWeekViewBackgroundEvent: "_resourcesWeekViewBackgroundEvent_1komm_250",
|
|
7329
|
+
resourcesWeekViewAllDayEvent: "_resourcesWeekViewAllDayEvent_1komm_272",
|
|
7330
|
+
resourcesWeekViewEventWrapper: "_resourcesWeekViewEventWrapper_1komm_277",
|
|
7331
|
+
resourcesWeekViewResizeHandle: "_resourcesWeekViewResizeHandle_1komm_281",
|
|
7332
|
+
resourcesWeekViewCurrentTimeIndicator: "_resourcesWeekViewCurrentTimeIndicator_1komm_322",
|
|
7333
|
+
resourcesWeekViewCurrentTimeIndicatorLine: "_resourcesWeekViewCurrentTimeIndicatorLine_1komm_334",
|
|
7334
|
+
resourcesWeekViewCurrentTimeIndicatorThumb: "_resourcesWeekViewCurrentTimeIndicatorThumb_1komm_340",
|
|
7335
|
+
resourcesWeekViewCurrentTimeIndicatorTimeBubble: "_resourcesWeekViewCurrentTimeIndicatorTimeBubble_1komm_350"
|
|
7041
7336
|
};
|
|
7042
7337
|
//#endregion
|
|
7043
7338
|
//#region src/components/ResourcesWeekView/ResourcesWeekView.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -7093,6 +7388,8 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7093
7388
|
startTime: { default: void 0 },
|
|
7094
7389
|
endTime: { default: void 0 },
|
|
7095
7390
|
intervalMinutes: { default: void 0 },
|
|
7391
|
+
eventDragInterval: { default: void 0 },
|
|
7392
|
+
eventResizeInterval: { default: void 0 },
|
|
7096
7393
|
slotLabelFormat: {
|
|
7097
7394
|
type: [String, Function],
|
|
7098
7395
|
default: void 0
|
|
@@ -7144,6 +7441,10 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7144
7441
|
type: Function,
|
|
7145
7442
|
default: void 0
|
|
7146
7443
|
},
|
|
7444
|
+
withInteractiveBackgroundEvents: {
|
|
7445
|
+
type: Boolean,
|
|
7446
|
+
default: void 0
|
|
7447
|
+
},
|
|
7147
7448
|
renderResourceLabel: {
|
|
7148
7449
|
type: Function,
|
|
7149
7450
|
default: void 0
|
|
@@ -7326,6 +7627,7 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7326
7627
|
startTime: () => props.startTime,
|
|
7327
7628
|
endTime: () => props.endTime,
|
|
7328
7629
|
intervalMinutes: () => props.intervalMinutes,
|
|
7630
|
+
resizeIntervalMinutes: () => props.eventResizeInterval,
|
|
7329
7631
|
onEventResize: (data) => emit("eventResize", data),
|
|
7330
7632
|
canResizeEvent: () => props.canResizeEvent
|
|
7331
7633
|
});
|
|
@@ -7367,7 +7669,7 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7367
7669
|
const day = weekdays.value[Math.floor(flatIndex / count)];
|
|
7368
7670
|
const interval = intervals.value[flatIndex % count];
|
|
7369
7671
|
if (!day || !interval) return;
|
|
7370
|
-
const target =
|
|
7672
|
+
const target = getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime);
|
|
7371
7673
|
const event = getDropEvent(props.events, nativeEvent.dataTransfer);
|
|
7372
7674
|
if (event) emit("eventDrop", {
|
|
7373
7675
|
...moveEventTo(event, target),
|
|
@@ -7379,6 +7681,22 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7379
7681
|
resourceId
|
|
7380
7682
|
});
|
|
7381
7683
|
};
|
|
7684
|
+
const getSnappedDropTarget = (nativeEvent, day, flatIndex, slotStartTime) => {
|
|
7685
|
+
if (props.eventDragInterval == null) return `${day} ${slotStartTime}`;
|
|
7686
|
+
const rect = (nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null)?.getBoundingClientRect();
|
|
7687
|
+
const totalSlots = slotsPerDay.value * dayCount.value;
|
|
7688
|
+
const slotSize = rect && rect.width > 0 ? rect.width / totalSlots : 0;
|
|
7689
|
+
const slotOffset = rect ? nativeEvent.clientX - rect.left - flatIndex * slotSize : 0;
|
|
7690
|
+
const parsed = parseTimeString(slotStartTime);
|
|
7691
|
+
const dragInterval = clampIntervalMinutes(props.eventDragInterval);
|
|
7692
|
+
const raw = parsed.hours * 60 + parsed.minutes + (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes;
|
|
7693
|
+
const start = parseTimeString(props.startTime);
|
|
7694
|
+
const end = parseTimeString(props.endTime);
|
|
7695
|
+
const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval;
|
|
7696
|
+
const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval;
|
|
7697
|
+
const minutes = min > max ? start.hours * 60 + start.minutes : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval));
|
|
7698
|
+
return `${day} ${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}:00`;
|
|
7699
|
+
};
|
|
7382
7700
|
const setDropTarget = (next) => {
|
|
7383
7701
|
const current = dropTarget.value;
|
|
7384
7702
|
if (current === next) return;
|
|
@@ -7681,10 +7999,20 @@ var ResourcesWeekView = factory(/* @__PURE__ */ defineComponent({
|
|
|
7681
7999
|
key: `bg-${entry.day}-${entry.event.id}`,
|
|
7682
8000
|
event: entry.event,
|
|
7683
8001
|
date: entry.day
|
|
7684
|
-
}, () => [createVNode(unref(
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
},
|
|
8002
|
+
}, () => [createVNode(unref(ScheduleBackgroundEvent_default), mergeProps({
|
|
8003
|
+
event: entry.event,
|
|
8004
|
+
interactive: Boolean(unref(props).withInteractiveBackgroundEvents) && !isStatic.value
|
|
8005
|
+
}, { ref_for: true }, {
|
|
8006
|
+
...eventRenderers.value,
|
|
8007
|
+
...unref(getStyles)("resourcesWeekViewBackgroundEvent")
|
|
8008
|
+
}, {
|
|
8009
|
+
style: backgroundEventStyle(entry.event, entry.dayIndex),
|
|
8010
|
+
onEventClick: clickEvent
|
|
8011
|
+
}), null, 16, [
|
|
8012
|
+
"event",
|
|
8013
|
+
"interactive",
|
|
8014
|
+
"style"
|
|
8015
|
+
])]);
|
|
7688
8016
|
}), 128)),
|
|
7689
8017
|
(openBlock(true), createElementBlock(Fragment, null, renderList(allDayBars(resource.id), (bar) => {
|
|
7690
8018
|
return openBlock(), createBlock(unref(Box), mergeProps({
|
|
@@ -7949,27 +8277,33 @@ function getResourcesMonthViewLayout({ days, events, resourceId, maxRows }) {
|
|
|
7949
8277
|
};
|
|
7950
8278
|
}
|
|
7951
8279
|
var ResourcesMonthView_module_default = {
|
|
7952
|
-
resourcesMonthView: "
|
|
7953
|
-
resourcesMonthViewRoot: "
|
|
7954
|
-
resourcesMonthViewScrollArea: "
|
|
7955
|
-
resourcesMonthViewInner: "
|
|
7956
|
-
resourcesMonthViewDayLabelsRow: "
|
|
7957
|
-
resourcesMonthViewCorner: "
|
|
7958
|
-
resourcesMonthViewDayLabel: "
|
|
7959
|
-
resourcesMonthViewDayLabelWeekday: "
|
|
7960
|
-
resourcesMonthViewDayLabelNumber: "
|
|
7961
|
-
resourcesMonthViewRow: "
|
|
7962
|
-
resourcesMonthViewResourceLabel: "
|
|
7963
|
-
resourcesMonthViewGroupColumn: "
|
|
7964
|
-
resourcesMonthViewGroupColumnEmpty: "
|
|
7965
|
-
resourcesMonthViewRowSlots: "
|
|
7966
|
-
resourcesMonthViewCell: "
|
|
8280
|
+
resourcesMonthView: "_resourcesMonthView_uqbdi_1",
|
|
8281
|
+
resourcesMonthViewRoot: "_resourcesMonthViewRoot_uqbdi_17",
|
|
8282
|
+
resourcesMonthViewScrollArea: "_resourcesMonthViewScrollArea_uqbdi_24",
|
|
8283
|
+
resourcesMonthViewInner: "_resourcesMonthViewInner_uqbdi_33",
|
|
8284
|
+
resourcesMonthViewDayLabelsRow: "_resourcesMonthViewDayLabelsRow_uqbdi_37",
|
|
8285
|
+
resourcesMonthViewCorner: "_resourcesMonthViewCorner_uqbdi_46",
|
|
8286
|
+
resourcesMonthViewDayLabel: "_resourcesMonthViewDayLabel_uqbdi_37",
|
|
8287
|
+
resourcesMonthViewDayLabelWeekday: "_resourcesMonthViewDayLabelWeekday_uqbdi_85",
|
|
8288
|
+
resourcesMonthViewDayLabelNumber: "_resourcesMonthViewDayLabelNumber_uqbdi_92",
|
|
8289
|
+
resourcesMonthViewRow: "_resourcesMonthViewRow_uqbdi_97",
|
|
8290
|
+
resourcesMonthViewResourceLabel: "_resourcesMonthViewResourceLabel_uqbdi_101",
|
|
8291
|
+
resourcesMonthViewGroupColumn: "_resourcesMonthViewGroupColumn_uqbdi_120",
|
|
8292
|
+
resourcesMonthViewGroupColumnEmpty: "_resourcesMonthViewGroupColumnEmpty_uqbdi_121",
|
|
8293
|
+
resourcesMonthViewRowSlots: "_resourcesMonthViewRowSlots_uqbdi_149",
|
|
8294
|
+
resourcesMonthViewCell: "_resourcesMonthViewCell_uqbdi_154",
|
|
8295
|
+
resourcesMonthViewEventWrapper: "_resourcesMonthViewEventWrapper_uqbdi_230",
|
|
8296
|
+
resourcesMonthViewResizeHandle: "_resourcesMonthViewResizeHandle_uqbdi_231"
|
|
7967
8297
|
};
|
|
7968
8298
|
//#endregion
|
|
7969
8299
|
//#region src/components/ResourcesMonthView/ResourcesMonthView.vue?vue&type=script&setup=true&lang.ts
|
|
7970
8300
|
var _hoisted_1 = ["data-weekend", "data-today"];
|
|
7971
8301
|
var _hoisted_2 = ["data-has-groups"];
|
|
7972
8302
|
var _hoisted_3 = ["onDragover", "onDrop"];
|
|
8303
|
+
var _hoisted_4 = ["data-active", "onPointerdown"];
|
|
8304
|
+
var _hoisted_5 = ["data-active", "onPointerdown"];
|
|
8305
|
+
var _hoisted_6 = ["data-active", "onPointerdown"];
|
|
8306
|
+
var _hoisted_7 = ["data-active", "onPointerdown"];
|
|
7973
8307
|
var defaultProps$1 = {
|
|
7974
8308
|
weekdayFormat: "ddd",
|
|
7975
8309
|
weekendDays: [0, 6],
|
|
@@ -7981,7 +8315,8 @@ var defaultProps$1 = {
|
|
|
7981
8315
|
groupLabelWidth: 80,
|
|
7982
8316
|
mode: "default",
|
|
7983
8317
|
maxEventsPerTimeSlot: 2,
|
|
7984
|
-
recurrenceExpansionLimit: 2e3
|
|
8318
|
+
recurrenceExpansionLimit: 2e3,
|
|
8319
|
+
withEventResize: false
|
|
7985
8320
|
};
|
|
7986
8321
|
/** View levels the header offers – a resource schedule has no year view. */
|
|
7987
8322
|
var RESOURCE_VIEWS = [
|
|
@@ -8059,6 +8394,14 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8059
8394
|
type: Function,
|
|
8060
8395
|
default: void 0
|
|
8061
8396
|
},
|
|
8397
|
+
withEventResize: {
|
|
8398
|
+
type: Boolean,
|
|
8399
|
+
default: void 0
|
|
8400
|
+
},
|
|
8401
|
+
canResizeEvent: {
|
|
8402
|
+
type: Function,
|
|
8403
|
+
default: void 0
|
|
8404
|
+
},
|
|
8062
8405
|
withExternalEventDrop: { type: Boolean },
|
|
8063
8406
|
withDragSlotSelect: { type: Boolean },
|
|
8064
8407
|
labels: { default: void 0 },
|
|
@@ -8081,7 +8424,8 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8081
8424
|
"eventDragStart",
|
|
8082
8425
|
"eventDragEnd",
|
|
8083
8426
|
"slotDragEnd",
|
|
8084
|
-
"externalEventDrop"
|
|
8427
|
+
"externalEventDrop",
|
|
8428
|
+
"eventResize"
|
|
8085
8429
|
],
|
|
8086
8430
|
setup(__props, { emit: __emit }) {
|
|
8087
8431
|
const rawProps = __props;
|
|
@@ -8089,6 +8433,7 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8089
8433
|
const slots = useSlots();
|
|
8090
8434
|
const attrs = useAttrs();
|
|
8091
8435
|
const props = useProps("ResourcesMonthView", defaultProps$1, rawProps);
|
|
8436
|
+
const theme = useSafeMantineTheme();
|
|
8092
8437
|
const getStyles = useStyles({
|
|
8093
8438
|
name: "ResourcesMonthView",
|
|
8094
8439
|
props,
|
|
@@ -8138,9 +8483,19 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8138
8483
|
rangeEnd: month.value.endOf("month").toDate(),
|
|
8139
8484
|
expansionLimit: props.recurrenceExpansionLimit
|
|
8140
8485
|
}));
|
|
8486
|
+
const resizeState = shallowRef(null);
|
|
8487
|
+
let justResized = false;
|
|
8488
|
+
const effectiveEvents = computed(() => {
|
|
8489
|
+
const state = resizeState.value;
|
|
8490
|
+
return state ? expandedEvents.value.map((event) => event.id === state.event.id ? {
|
|
8491
|
+
...event,
|
|
8492
|
+
start: state.start,
|
|
8493
|
+
end: state.end
|
|
8494
|
+
} : event) : expandedEvents.value;
|
|
8495
|
+
});
|
|
8141
8496
|
const rowLayouts = computed(() => ordered.value.orderedResources.map((resource) => getResourcesMonthViewLayout({
|
|
8142
8497
|
days: days.value,
|
|
8143
|
-
events:
|
|
8498
|
+
events: effectiveEvents.value,
|
|
8144
8499
|
resourceId: resource.id,
|
|
8145
8500
|
maxRows: maxRows.value
|
|
8146
8501
|
})));
|
|
@@ -8310,6 +8665,106 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8310
8665
|
emit("eventDragStart", event);
|
|
8311
8666
|
};
|
|
8312
8667
|
const dragEnd = () => dragState.endEventDrag();
|
|
8668
|
+
const isResizableEvent = (event) => Boolean(props.withEventResize) && !isStatic.value && event.display !== "background" && (props.canResizeEvent?.(event) ?? true);
|
|
8669
|
+
const isResizingEvent = (event) => resizeState.value?.event.id === event.id;
|
|
8670
|
+
const calculateResizeDates = (event, edge, targetDay) => {
|
|
8671
|
+
const originalStart = dayjs(event.start);
|
|
8672
|
+
const originalEnd = dayjs(event.end);
|
|
8673
|
+
const target = dayjs(targetDay).startOf("day");
|
|
8674
|
+
const endAtMidnight = originalEnd.hour() === 0 && originalEnd.minute() === 0 && originalEnd.second() === 0;
|
|
8675
|
+
const endDay = endAtMidnight ? originalEnd.subtract(1, "day").startOf("day") : originalEnd.startOf("day");
|
|
8676
|
+
const withTime = (day, source) => day.startOf("day").hour(source.hour()).minute(source.minute()).second(source.second());
|
|
8677
|
+
if (edge === "start") {
|
|
8678
|
+
let start = withTime(target.isAfter(endDay) ? endDay : target, originalStart);
|
|
8679
|
+
if (!start.isBefore(originalEnd)) start = start.subtract(1, "day");
|
|
8680
|
+
return {
|
|
8681
|
+
start: start.format("YYYY-MM-DD HH:mm:ss"),
|
|
8682
|
+
end: originalEnd.format("YYYY-MM-DD HH:mm:ss")
|
|
8683
|
+
};
|
|
8684
|
+
}
|
|
8685
|
+
const day = target.isBefore(originalStart.startOf("day")) ? originalStart.startOf("day") : target;
|
|
8686
|
+
let end = endAtMidnight ? day.add(1, "day").startOf("day") : withTime(day, originalEnd);
|
|
8687
|
+
if (!end.isAfter(originalStart)) end = end.add(1, "day");
|
|
8688
|
+
return {
|
|
8689
|
+
start: originalStart.format("YYYY-MM-DD HH:mm:ss"),
|
|
8690
|
+
end: end.format("YYYY-MM-DD HH:mm:ss")
|
|
8691
|
+
};
|
|
8692
|
+
};
|
|
8693
|
+
const handleResizeMove = (event) => {
|
|
8694
|
+
const state = resizeState.value;
|
|
8695
|
+
if (!state) return;
|
|
8696
|
+
const dayIndex = (controls[state.resourceIndex] ?? []).findIndex((cell) => {
|
|
8697
|
+
if (!cell) return false;
|
|
8698
|
+
const rect = cell.getBoundingClientRect();
|
|
8699
|
+
return event.clientX >= rect.left && event.clientX <= rect.right;
|
|
8700
|
+
});
|
|
8701
|
+
if (dayIndex < 0 || dayIndex === state.dayIndex || !days.value[dayIndex]) return;
|
|
8702
|
+
resizeState.value = {
|
|
8703
|
+
...state,
|
|
8704
|
+
...calculateResizeDates(state.event, state.edge, days.value[dayIndex]),
|
|
8705
|
+
dayIndex
|
|
8706
|
+
};
|
|
8707
|
+
};
|
|
8708
|
+
const stopResizeListeners = () => {
|
|
8709
|
+
document.removeEventListener("pointermove", handleResizeMove);
|
|
8710
|
+
document.removeEventListener("pointerup", handleResizeEnd);
|
|
8711
|
+
document.removeEventListener("pointercancel", handleResizeCancel);
|
|
8712
|
+
};
|
|
8713
|
+
const finishResize = (emitChange) => {
|
|
8714
|
+
const state = resizeState.value;
|
|
8715
|
+
stopResizeListeners();
|
|
8716
|
+
resizeState.value = null;
|
|
8717
|
+
if (emitChange && state && (state.start !== state.originalStart || state.end !== state.originalEnd)) emit("eventResize", {
|
|
8718
|
+
eventId: state.event.id,
|
|
8719
|
+
newStart: state.start,
|
|
8720
|
+
newEnd: state.end,
|
|
8721
|
+
event: state.event
|
|
8722
|
+
});
|
|
8723
|
+
justResized = true;
|
|
8724
|
+
requestAnimationFrame(() => justResized = false);
|
|
8725
|
+
};
|
|
8726
|
+
function handleResizeEnd() {
|
|
8727
|
+
finishResize(true);
|
|
8728
|
+
}
|
|
8729
|
+
function handleResizeCancel() {
|
|
8730
|
+
finishResize(false);
|
|
8731
|
+
}
|
|
8732
|
+
const handleResizeStart = (event, edge, resourceIndex, pointerEvent) => {
|
|
8733
|
+
if (!isResizableEvent(event)) return;
|
|
8734
|
+
pointerEvent.preventDefault();
|
|
8735
|
+
pointerEvent.stopPropagation();
|
|
8736
|
+
const start = dayjs(event.start).format("YYYY-MM-DD HH:mm:ss");
|
|
8737
|
+
const end = dayjs(event.end).format("YYYY-MM-DD HH:mm:ss");
|
|
8738
|
+
resizeState.value = {
|
|
8739
|
+
event,
|
|
8740
|
+
edge,
|
|
8741
|
+
resourceIndex,
|
|
8742
|
+
originalStart: start,
|
|
8743
|
+
originalEnd: end,
|
|
8744
|
+
start,
|
|
8745
|
+
end,
|
|
8746
|
+
dayIndex: -1
|
|
8747
|
+
};
|
|
8748
|
+
document.addEventListener("pointermove", handleResizeMove);
|
|
8749
|
+
document.addEventListener("pointerup", handleResizeEnd);
|
|
8750
|
+
document.addEventListener("pointercancel", handleResizeCancel);
|
|
8751
|
+
};
|
|
8752
|
+
onBeforeUnmount(stopResizeListeners);
|
|
8753
|
+
const emitEventClick = (event, nativeEvent) => {
|
|
8754
|
+
if (!isStatic.value && !justResized) emit("eventClick", event, nativeEvent);
|
|
8755
|
+
};
|
|
8756
|
+
const eventWrapperStyle = (event, style) => {
|
|
8757
|
+
const colors = theme.value.variantColorResolver({
|
|
8758
|
+
color: event.color || theme.value.primaryColor,
|
|
8759
|
+
theme: theme.value,
|
|
8760
|
+
variant: event.variant || "light",
|
|
8761
|
+
autoContrast: true
|
|
8762
|
+
});
|
|
8763
|
+
return {
|
|
8764
|
+
...style,
|
|
8765
|
+
"--event-color": colors.color
|
|
8766
|
+
};
|
|
8767
|
+
};
|
|
8313
8768
|
const changeDate = (value) => emit("dateChange", value);
|
|
8314
8769
|
const changeView = (view) => emit("viewChange", view);
|
|
8315
8770
|
return (_ctx, _cache) => {
|
|
@@ -8318,7 +8773,8 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8318
8773
|
...unref(getStyles)("resourcesMonthView")
|
|
8319
8774
|
}, {
|
|
8320
8775
|
"root-ref": setRootElement,
|
|
8321
|
-
"data-event-interaction": dropTarget.value ? true : void 0
|
|
8776
|
+
"data-event-interaction": dropTarget.value || resizeState.value ? true : void 0,
|
|
8777
|
+
"data-resizing": resizeState.value ? true : void 0
|
|
8322
8778
|
}), {
|
|
8323
8779
|
default: withCtx(() => [unref(props).withHeader ? renderSlot(_ctx.$slots, "header", {
|
|
8324
8780
|
key: 0,
|
|
@@ -8404,58 +8860,112 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8404
8860
|
onDrop: ($event) => withDragHandlers.value ? handleRowDrop($event, resource, resourceIndex) : void 0
|
|
8405
8861
|
}), [
|
|
8406
8862
|
(openBlock(true), createElementBlock(Fragment, null, renderList(singleDayEvents(resourceIndex), (entry) => {
|
|
8407
|
-
return openBlock(), createBlock(unref(
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8863
|
+
return openBlock(), createBlock(unref(Box), mergeProps({ key: `${entry.event.id}-${entry.dayIndex}` }, { ref_for: true }, unref(getStyles)("resourcesMonthViewEventWrapper"), {
|
|
8864
|
+
style: eventWrapperStyle(entry.event, singleEventStyle(entry)),
|
|
8865
|
+
"data-resizing": isResizingEvent(entry.event) || void 0
|
|
8866
|
+
}), {
|
|
8867
|
+
default: withCtx(() => [
|
|
8868
|
+
createVNode(unref(ScheduleEvent), mergeProps({
|
|
8869
|
+
event: entry.event,
|
|
8870
|
+
"auto-size": "",
|
|
8871
|
+
nowrap: "",
|
|
8872
|
+
radius: unref(props).radius,
|
|
8873
|
+
mode: unref(props).mode,
|
|
8874
|
+
draggable: isDraggableEvent(entry.event),
|
|
8875
|
+
"is-resizing": isResizingEvent(entry.event),
|
|
8876
|
+
style: {
|
|
8877
|
+
"width": "100%",
|
|
8878
|
+
"height": "100%"
|
|
8879
|
+
}
|
|
8880
|
+
}, { ref_for: true }, {
|
|
8881
|
+
...eventRenderers.value,
|
|
8882
|
+
...stylesApi.value
|
|
8883
|
+
}, {
|
|
8884
|
+
onEventDragStart: dragStart,
|
|
8885
|
+
onEventDragEnd: dragEnd,
|
|
8886
|
+
onClick: ($event) => emitEventClick(entry.event, $event)
|
|
8887
|
+
}), null, 16, [
|
|
8888
|
+
"event",
|
|
8889
|
+
"radius",
|
|
8890
|
+
"mode",
|
|
8891
|
+
"draggable",
|
|
8892
|
+
"is-resizing",
|
|
8893
|
+
"onClick"
|
|
8894
|
+
]),
|
|
8895
|
+
isResizableEvent(entry.event) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
8896
|
+
key: 0,
|
|
8897
|
+
ref_for: true
|
|
8898
|
+
}, unref(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8899
|
+
"data-edge": "start",
|
|
8900
|
+
"data-active": isResizingEvent(entry.event) && resizeState.value?.edge === "start" || void 0,
|
|
8901
|
+
onPointerdown: ($event) => handleResizeStart(entry.event, "start", resourceIndex, $event)
|
|
8902
|
+
}), null, 16, _hoisted_4)) : createCommentVNode("", true),
|
|
8903
|
+
isResizableEvent(entry.event) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
8904
|
+
key: 1,
|
|
8905
|
+
ref_for: true
|
|
8906
|
+
}, unref(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8907
|
+
"data-edge": "end",
|
|
8908
|
+
"data-active": isResizingEvent(entry.event) && resizeState.value?.edge === "end" || void 0,
|
|
8909
|
+
onPointerdown: ($event) => handleResizeStart(entry.event, "end", resourceIndex, $event)
|
|
8910
|
+
}), null, 16, _hoisted_5)) : createCommentVNode("", true)
|
|
8911
|
+
]),
|
|
8912
|
+
_: 2
|
|
8913
|
+
}, 1040, ["style", "data-resizing"]);
|
|
8431
8914
|
}), 128)),
|
|
8432
8915
|
(openBlock(true), createElementBlock(Fragment, null, renderList(rowLayouts.value[resourceIndex].segments, (segment) => {
|
|
8433
|
-
return openBlock(), createBlock(unref(
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8916
|
+
return openBlock(), createBlock(unref(Box), mergeProps({ key: `${segment.event.id}-${segment.start}` }, { ref_for: true }, unref(getStyles)("resourcesMonthViewEventWrapper"), {
|
|
8917
|
+
style: eventWrapperStyle(segment.event, segmentStyle(segment)),
|
|
8918
|
+
"data-resizing": isResizingEvent(segment.event) || void 0
|
|
8919
|
+
}), {
|
|
8920
|
+
default: withCtx(() => [
|
|
8921
|
+
createVNode(unref(ScheduleEvent), mergeProps({
|
|
8922
|
+
event: segment.event,
|
|
8923
|
+
hanging: segment.hanging,
|
|
8924
|
+
"auto-size": "",
|
|
8925
|
+
nowrap: "",
|
|
8926
|
+
radius: unref(props).radius,
|
|
8927
|
+
mode: unref(props).mode,
|
|
8928
|
+
draggable: isDraggableEvent(segment.event),
|
|
8929
|
+
"is-resizing": isResizingEvent(segment.event),
|
|
8930
|
+
style: {
|
|
8931
|
+
"width": "100%",
|
|
8932
|
+
"height": "100%"
|
|
8933
|
+
}
|
|
8934
|
+
}, { ref_for: true }, {
|
|
8935
|
+
...eventRenderers.value,
|
|
8936
|
+
...stylesApi.value
|
|
8937
|
+
}, {
|
|
8938
|
+
onEventDragStart: dragStart,
|
|
8939
|
+
onEventDragEnd: dragEnd,
|
|
8940
|
+
onClick: ($event) => emitEventClick(segment.event, $event)
|
|
8941
|
+
}), null, 16, [
|
|
8942
|
+
"event",
|
|
8943
|
+
"hanging",
|
|
8944
|
+
"radius",
|
|
8945
|
+
"mode",
|
|
8946
|
+
"draggable",
|
|
8947
|
+
"is-resizing",
|
|
8948
|
+
"onClick"
|
|
8949
|
+
]),
|
|
8950
|
+
isResizableEvent(segment.event) && segment.hanging !== "start" && segment.hanging !== "both" ? (openBlock(), createElementBlock("div", mergeProps({
|
|
8951
|
+
key: 0,
|
|
8952
|
+
ref_for: true
|
|
8953
|
+
}, unref(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8954
|
+
"data-edge": "start",
|
|
8955
|
+
"data-active": isResizingEvent(segment.event) && resizeState.value?.edge === "start" || void 0,
|
|
8956
|
+
onPointerdown: ($event) => handleResizeStart(segment.event, "start", resourceIndex, $event)
|
|
8957
|
+
}), null, 16, _hoisted_6)) : createCommentVNode("", true),
|
|
8958
|
+
isResizableEvent(segment.event) && segment.hanging !== "end" && segment.hanging !== "both" ? (openBlock(), createElementBlock("div", mergeProps({
|
|
8959
|
+
key: 1,
|
|
8960
|
+
ref_for: true
|
|
8961
|
+
}, unref(getStyles)("resourcesMonthViewResizeHandle"), {
|
|
8962
|
+
"data-edge": "end",
|
|
8963
|
+
"data-active": isResizingEvent(segment.event) && resizeState.value?.edge === "end" || void 0,
|
|
8964
|
+
onPointerdown: ($event) => handleResizeStart(segment.event, "end", resourceIndex, $event)
|
|
8965
|
+
}), null, 16, _hoisted_7)) : createCommentVNode("", true)
|
|
8966
|
+
]),
|
|
8967
|
+
_: 2
|
|
8968
|
+
}, 1040, ["style", "data-resizing"]);
|
|
8459
8969
|
}), 128)),
|
|
8460
8970
|
(openBlock(true), createElementBlock(Fragment, null, renderList(cellsWithHiddenEvents(resourceIndex), (entry) => {
|
|
8461
8971
|
return renderSlot(_ctx.$slots, "moreEvents", {
|
|
@@ -8536,7 +9046,7 @@ var ResourcesMonthView = factory(/* @__PURE__ */ defineComponent({
|
|
|
8536
9046
|
_: 3
|
|
8537
9047
|
}, 16)]),
|
|
8538
9048
|
_: 3
|
|
8539
|
-
}, 16, ["data-event-interaction"]);
|
|
9049
|
+
}, 16, ["data-event-interaction", "data-resizing"]);
|
|
8540
9050
|
};
|
|
8541
9051
|
}
|
|
8542
9052
|
}), {
|
|
@@ -8588,6 +9098,10 @@ var ResourcesSchedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
8588
9098
|
type: Function,
|
|
8589
9099
|
default: void 0
|
|
8590
9100
|
},
|
|
9101
|
+
withInteractiveBackgroundEvents: {
|
|
9102
|
+
type: Boolean,
|
|
9103
|
+
default: void 0
|
|
9104
|
+
},
|
|
8591
9105
|
recurrenceExpansionLimit: { default: void 0 },
|
|
8592
9106
|
dayViewProps: { default: void 0 },
|
|
8593
9107
|
weekViewProps: { default: void 0 },
|
|
@@ -8674,6 +9188,7 @@ var ResourcesSchedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
8674
9188
|
canDragEvent: props.canDragEvent,
|
|
8675
9189
|
withDragSlotSelect: props.withDragSlotSelect,
|
|
8676
9190
|
recurrenceExpansionLimit: props.recurrenceExpansionLimit,
|
|
9191
|
+
withInteractiveBackgroundEvents: isStatic.value ? false : props.withInteractiveBackgroundEvents,
|
|
8677
9192
|
onDateChange: setCurrentDate,
|
|
8678
9193
|
onViewChange: changeView,
|
|
8679
9194
|
onEventDrop: (data) => emit("eventDrop", data),
|
|
@@ -8707,6 +9222,9 @@ var ResourcesSchedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
8707
9222
|
};
|
|
8708
9223
|
case "month": return {
|
|
8709
9224
|
...sharedProps.value,
|
|
9225
|
+
withEventResize: isStatic.value ? false : props.withEventResize,
|
|
9226
|
+
canResizeEvent: props.canResizeEvent,
|
|
9227
|
+
onEventResize: (data) => emit("eventResize", data),
|
|
8710
9228
|
onDayClick: (data) => emit("dayClick", data),
|
|
8711
9229
|
...props.monthViewProps
|
|
8712
9230
|
};
|
|
@@ -8745,6 +9263,6 @@ var ResourcesSchedule = factory(/* @__PURE__ */ defineComponent({
|
|
|
8745
9263
|
}
|
|
8746
9264
|
}), { classes: ResourcesSchedule_module_default });
|
|
8747
9265
|
//#endregion
|
|
8748
|
-
export { CurrentTimeIndicator, DEFAULT_SCHEDULE_LABELS, DayView, DragContext, HeaderControl, MobileMonthView, MonthView, MonthYearSelect, MoreEvents, ResourcesDayView, ResourcesMonthView, ResourcesSchedule, ResourcesWeekView, Schedule, ScheduleEvent, ScheduleHeader, ScheduleHeaderBase, ScheduleHeaderNext, ScheduleHeaderPrevious, ScheduleHeaderToday, ViewSelect, WeekView, YearView, calculateDropTime, calculateMonthDropDate, clampIntervalMinutes, compareMonthEvents, createHeaderNavigation, expandRecurringEvents, formatDate, getBusinessHoursMod, getCurrentTimePosition, getDayPosition, getDayPositionedEvents, getDayTimeIntervals, getDayViewEvents, getEndOfWeek, getGroupToResourceIdMap, getLabel, getMonthDays, getMonthPositionedEvents, getMonthRange, getMonthViewEvents, getMonthsByQuarter, getMonthsList, getOrderedResources, getOverlapClusters, getRenderableMonthEventSegments, getResourcesDayViewEvents, getResourcesMonthViewLayout, getResourcesWeekViewEvents, getStartOfWeek, getVisibleEvents, getWeekDays, getWeekLabel, getWeekNumber, getWeekPositionedEvents, getWeekViewEvents, getWeekdaysNames, getYearsList, handleResourcesGridKeyDown, isAfterMinDate, isAllDayEvent, isBeforeMaxDate, isEventInTimeRange, isEventsOverlap, isInTimeRange, isMultiDayEvent, isMultidayEvent, isSameMonth, isWithinWeek, nextWeek, parseTimeString, previousWeek, provideDragContext, provideScheduleDragState, sortEvents, toDateString, toTimeString, useDragContext, useScheduleHeaderLabels, validateEvent };
|
|
9266
|
+
export { CurrentTimeIndicator, DEFAULT_SCHEDULE_LABELS, DayView, DragContext, HeaderControl, MobileMonthView, MonthView, MonthYearSelect, MoreEvents, ResourcesDayView, ResourcesMonthView, ResourcesSchedule, ResourcesWeekView, Schedule, ScheduleBackgroundEvent_default as ScheduleBackgroundEvent, ScheduleEvent, ScheduleHeader, ScheduleHeaderBase, ScheduleHeaderNext, ScheduleHeaderPrevious, ScheduleHeaderToday, ViewSelect, WeekView, YearView, calculateDropTime, calculateMonthDropDate, clampIntervalMinutes, compareMonthEvents, createHeaderNavigation, expandRecurringEvents, formatDate, getBusinessHoursMod, getCurrentTimePosition, getDayPosition, getDayPositionedEvents, getDayTimeIntervals, getDayViewEvents, getEndOfWeek, getGroupToResourceIdMap, getLabel, getMonthDays, getMonthPositionedEvents, getMonthRange, getMonthViewEvents, getMonthsByQuarter, getMonthsList, getOrderedResources, getOverlapClusters, getRenderableMonthEventSegments, getResourcesDayViewEvents, getResourcesMonthViewLayout, getResourcesWeekViewEvents, getStartOfWeek, getVisibleEvents, getWeekDays, getWeekLabel, getWeekNumber, getWeekPositionedEvents, getWeekViewEvents, getWeekdaysNames, getYearsList, handleResourcesGridKeyDown, isAfterMinDate, isAllDayEvent, isBeforeMaxDate, isEventInTimeRange, isEventsOverlap, isInTimeRange, isMultiDayEvent, isMultidayEvent, isSameMonth, isWithinWeek, nextWeek, parseTimeString, previousWeek, provideDragContext, provideScheduleDragState, sortEvents, toDateString, toTimeString, useDragContext, useScheduleHeaderLabels, validateEvent };
|
|
8749
9267
|
|
|
8750
9268
|
//# sourceMappingURL=index.mjs.map
|