@colijnit/corecomponents_v12 300.1.6 → 300.1.7

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.
@@ -20022,6 +20022,7 @@ class HourSchedulingExpandableComponent {
20022
20022
  this._schedule = value;
20023
20023
  if (this._schedule) {
20024
20024
  this.renderObjects();
20025
+ this.generateTimeBlocks();
20025
20026
  }
20026
20027
  }
20027
20028
  get schedule() {
@@ -20152,6 +20153,10 @@ class HourSchedulingExpandableComponent {
20152
20153
  }
20153
20154
  }
20154
20155
  this.layouts = this.calculateLeftAndWidthOfObjects();
20156
+ const event = dragEvent.target;
20157
+ if (event.classList.contains('drag-over')) {
20158
+ event.classList.remove('drag-over');
20159
+ }
20155
20160
  }
20156
20161
  allowDrop(event, hour) {
20157
20162
  event.preventDefault();
@@ -20239,12 +20244,19 @@ class HourSchedulingExpandableComponent {
20239
20244
  return Math.abs(difference / 60);
20240
20245
  }
20241
20246
  generateTimeBlocks() {
20242
- let startUnix = !this.childProp ? this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.startTimeProp])) : this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.childProp][this.startTimeProp]));
20243
- let endUnix = !this.childProp ? this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.endTimeProp])) : this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.childProp][this.endTimeProp]));
20244
- let interval = 60 * 60;
20247
+ this.hourLabels = [];
20248
+ const schedule = this.childProp
20249
+ ? this.schedule[this.childProp]
20250
+ : this.schedule;
20251
+ if (!schedule || !schedule[this.startTimeProp] || !schedule[this.endTimeProp]) {
20252
+ return;
20253
+ }
20254
+ const startUnix = this.dateToUnixEpoch(this.convertDateToEuropean(schedule[this.startTimeProp]));
20255
+ const endUnix = this.dateToUnixEpoch(this.convertDateToEuropean(schedule[this.endTimeProp]));
20256
+ const interval = 60 * 60;
20245
20257
  for (let hourCount = startUnix; hourCount <= endUnix; hourCount += interval) {
20246
- let hour = new Date(hourCount * 1000);
20247
- let hourString = `${hour.getHours()}:${hour.getMinutes() === 0 ? '00' : hour.getMinutes()}`;
20258
+ const hour = new Date(hourCount * 1000);
20259
+ const hourString = `${hour.getHours()}:${hour.getMinutes() === 0 ? "00" : hour.getMinutes()}`;
20248
20260
  this.hourLabels.push(hourString);
20249
20261
  }
20250
20262
  }