@schedule-x/resize
Advanced tools
Comparing version 1.14.0 to 1.15.0
@@ -80,2 +80,12 @@ 'use strict'; | ||
const updateEventsList = ($app, calendarEvent, oldEventEnd, newEventEnd) => { | ||
const rrule = calendarEvent._getForeignProperties().rrule; | ||
calendarEvent.end = newEventEnd; | ||
if (rrule && $app.config.plugins.eventRecurrence) { | ||
$app.config.plugins.eventRecurrence.updateRecurrenceOnResize(calendarEvent.id, oldEventEnd, newEventEnd); | ||
return; | ||
} | ||
$app.calendarEvents.list.value = [...$app.calendarEvents.list.value]; | ||
}; | ||
class TimeGridEventResizer { | ||
@@ -159,2 +169,3 @@ constructor($app, calendarEvent, initialY, CHANGE_THRESHOLD_IN_TIME_POINTS, dayBoundariesDateTime) { | ||
setNewTimeForEventEnd(pointsToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addTimePointsToDateTime(this.originalEventEnd, pointsToAdd); | ||
@@ -164,10 +175,4 @@ if (newEnd > this.dayBoundariesDateTime.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -261,2 +266,3 @@ | ||
setNewTimeForEventEnd(daysToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addDays(this.originalEventEnd, daysToAdd); | ||
@@ -268,10 +274,4 @@ if (newEnd > this.$app.calendarState.range.value.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -278,0 +278,0 @@ |
@@ -245,2 +245,3 @@ import { Signal } from "@preact/signals"; | ||
updateRecurrenceDND(eventId: EventId, oldEventStart: string, newEventStart: string): void; | ||
updateRecurrenceOnResize(eventId: EventId, oldEventEnd: string, newEventEnd: string): void; | ||
eventsFacade: EventsFacade; | ||
@@ -247,0 +248,0 @@ } |
@@ -80,2 +80,12 @@ 'use strict'; | ||
const updateEventsList = ($app, calendarEvent, oldEventEnd, newEventEnd) => { | ||
const rrule = calendarEvent._getForeignProperties().rrule; | ||
calendarEvent.end = newEventEnd; | ||
if (rrule && $app.config.plugins.eventRecurrence) { | ||
$app.config.plugins.eventRecurrence.updateRecurrenceOnResize(calendarEvent.id, oldEventEnd, newEventEnd); | ||
return; | ||
} | ||
$app.calendarEvents.list.value = [...$app.calendarEvents.list.value]; | ||
}; | ||
class TimeGridEventResizer { | ||
@@ -159,2 +169,3 @@ constructor($app, calendarEvent, initialY, CHANGE_THRESHOLD_IN_TIME_POINTS, dayBoundariesDateTime) { | ||
setNewTimeForEventEnd(pointsToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addTimePointsToDateTime(this.originalEventEnd, pointsToAdd); | ||
@@ -164,10 +175,4 @@ if (newEnd > this.dayBoundariesDateTime.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -261,2 +266,3 @@ | ||
setNewTimeForEventEnd(daysToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addDays(this.originalEventEnd, daysToAdd); | ||
@@ -268,10 +274,4 @@ if (newEnd > this.$app.calendarState.range.value.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -278,0 +278,0 @@ |
@@ -245,2 +245,3 @@ import { Signal } from "@preact/signals"; | ||
updateRecurrenceDND(eventId: EventId, oldEventStart: string, newEventStart: string): void; | ||
updateRecurrenceOnResize(eventId: EventId, oldEventEnd: string, newEventEnd: string): void; | ||
eventsFacade: EventsFacade; | ||
@@ -247,0 +248,0 @@ } |
@@ -78,2 +78,12 @@ const getTimePointsPerPixel = ($app) => { | ||
const updateEventsList = ($app, calendarEvent, oldEventEnd, newEventEnd) => { | ||
const rrule = calendarEvent._getForeignProperties().rrule; | ||
calendarEvent.end = newEventEnd; | ||
if (rrule && $app.config.plugins.eventRecurrence) { | ||
$app.config.plugins.eventRecurrence.updateRecurrenceOnResize(calendarEvent.id, oldEventEnd, newEventEnd); | ||
return; | ||
} | ||
$app.calendarEvents.list.value = [...$app.calendarEvents.list.value]; | ||
}; | ||
class TimeGridEventResizer { | ||
@@ -157,2 +167,3 @@ constructor($app, calendarEvent, initialY, CHANGE_THRESHOLD_IN_TIME_POINTS, dayBoundariesDateTime) { | ||
setNewTimeForEventEnd(pointsToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addTimePointsToDateTime(this.originalEventEnd, pointsToAdd); | ||
@@ -162,10 +173,4 @@ if (newEnd > this.dayBoundariesDateTime.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -259,2 +264,3 @@ | ||
setNewTimeForEventEnd(daysToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addDays(this.originalEventEnd, daysToAdd); | ||
@@ -266,10 +272,4 @@ if (newEnd > this.$app.calendarState.range.value.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -276,0 +276,0 @@ |
@@ -245,2 +245,3 @@ import { Signal } from "@preact/signals"; | ||
updateRecurrenceDND(eventId: EventId, oldEventStart: string, newEventStart: string): void; | ||
updateRecurrenceOnResize(eventId: EventId, oldEventEnd: string, newEventEnd: string): void; | ||
eventsFacade: EventsFacade; | ||
@@ -247,0 +248,0 @@ } |
@@ -84,2 +84,12 @@ (function (global, factory) { | ||
const updateEventsList = ($app, calendarEvent, oldEventEnd, newEventEnd) => { | ||
const rrule = calendarEvent._getForeignProperties().rrule; | ||
calendarEvent.end = newEventEnd; | ||
if (rrule && $app.config.plugins.eventRecurrence) { | ||
$app.config.plugins.eventRecurrence.updateRecurrenceOnResize(calendarEvent.id, oldEventEnd, newEventEnd); | ||
return; | ||
} | ||
$app.calendarEvents.list.value = [...$app.calendarEvents.list.value]; | ||
}; | ||
class TimeGridEventResizer { | ||
@@ -163,2 +173,3 @@ constructor($app, calendarEvent, initialY, CHANGE_THRESHOLD_IN_TIME_POINTS, dayBoundariesDateTime) { | ||
setNewTimeForEventEnd(pointsToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addTimePointsToDateTime(this.originalEventEnd, pointsToAdd); | ||
@@ -168,10 +179,4 @@ if (newEnd > this.dayBoundariesDateTime.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -265,2 +270,3 @@ | ||
setNewTimeForEventEnd(daysToAdd) { | ||
const endBeforeUpdate = this.calendarEvent.end; | ||
const newEnd = addDays(this.originalEventEnd, daysToAdd); | ||
@@ -272,10 +278,4 @@ if (newEnd > this.$app.calendarState.range.value.end || | ||
return; | ||
this.calendarEvent.end = newEnd; | ||
this.updateEventsList(); | ||
updateEventsList(this.$app, this.calendarEvent, endBeforeUpdate, newEnd); | ||
} | ||
updateEventsList() { | ||
this.$app.calendarEvents.list.value = [ | ||
...this.$app.calendarEvents.list.value, | ||
]; | ||
} | ||
} | ||
@@ -282,0 +282,0 @@ |
{ | ||
"name": "@schedule-x/resize", | ||
"version": "1.14.0", | ||
"version": "1.15.0", | ||
"description": "Resize events in the Schedule-X calendar", | ||
@@ -29,3 +29,3 @@ "author": { | ||
"homepage": "https://schedule-x.dev", | ||
"gitHead": "2f31c4e27ac38dc8e6babeac66c5bc5a32200960" | ||
"gitHead": "9d90f92f440074e90c25a295b4f9e61f4bda7657" | ||
} |
78594
2123