@colijnit/corecomponents_v12 255.1.13 → 255.1.15

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.
@@ -14323,9 +14323,8 @@
14323
14323
  };
14324
14324
 
14325
14325
  var HourSchedulingExpandableComponent = /** @class */ (function () {
14326
- function HourSchedulingExpandableComponent(cdRef, datePipe, eRef) {
14326
+ function HourSchedulingExpandableComponent(cdRef, eRef) {
14327
14327
  this.cdRef = cdRef;
14328
- this.datePipe = datePipe;
14329
14328
  this.eRef = eRef;
14330
14329
  this.hourLabels = [];
14331
14330
  this.scheduledObjects = [];
@@ -14336,6 +14335,7 @@
14336
14335
  this._schedule = {};
14337
14336
  this.timeChangeEvent = new i0.EventEmitter();
14338
14337
  this.newObjectPlanEvent = new i0.EventEmitter();
14338
+ this.moveBetweenCalendarsEvent = new i0.EventEmitter();
14339
14339
  this.showClass = true;
14340
14340
  }
14341
14341
  Object.defineProperty(HourSchedulingExpandableComponent.prototype, "schedule", {
@@ -14364,18 +14364,8 @@
14364
14364
  if (this.schedule) {
14365
14365
  this.renderObjects();
14366
14366
  }
14367
- this._calculateSchedulingObjectProperties();
14368
14367
  };
14369
14368
  // Calculate properties for each scheduled object to determine resizer visibility
14370
- HourSchedulingExpandableComponent.prototype._calculateSchedulingObjectProperties = function () {
14371
- var _this = this;
14372
- var scheduleStart = this.convertDateToEuropean(this.schedule[this.childProp][this.startTimeProp]);
14373
- var scheduleEnd = this.convertDateToEuropean(this.schedule[this.childProp][this.endTimeProp]);
14374
- this.scheduledObjects.forEach(function (obj) {
14375
- obj.showTopResizer = _this.timeDifference(scheduleStart, obj.start) > 0; // Show top resizer if the start time differs
14376
- obj.showBottomResizer = _this.timeDifference(scheduleEnd, obj.end) > 0; // Show bottom resizer if the end time differs
14377
- });
14378
- };
14379
14369
  // Find the next object in the scheduledObjects list
14380
14370
  HourSchedulingExpandableComponent.prototype._findNextObject = function (currentObject) {
14381
14371
  var currentIndex = this.scheduledObjects.indexOf(currentObject);
@@ -14416,13 +14406,19 @@
14416
14406
  });
14417
14407
  }
14418
14408
  this.scheduledObjects = schedulingObjects_1;
14409
+ this.cdRef.markForCheck();
14410
+ this.cdRef.detectChanges();
14419
14411
  }
14420
14412
  };
14421
14413
  HourSchedulingExpandableComponent.prototype.onSelectBlock = function (obj) {
14422
- this.scheduledObjects.filter(function (obj) { return obj.selected; }).forEach(function (selectedObj) {
14423
- selectedObj.selected = false;
14424
- });
14425
- obj.selected = true;
14414
+ obj.selected = !obj.selected;
14415
+ if (obj.selected) {
14416
+ this.scheduledObjects.forEach(function (scheduledObject) {
14417
+ if (scheduledObject.selected && scheduledObject !== obj) {
14418
+ scheduledObject.selected = false;
14419
+ }
14420
+ });
14421
+ }
14426
14422
  this.currentResizingObject = obj;
14427
14423
  };
14428
14424
  HourSchedulingExpandableComponent.prototype.onDragStartCustom = function (obj) {
@@ -14452,7 +14448,9 @@
14452
14448
  var parsed = this.tryParseJSONObject(dragEvent.dataTransfer.getData("text"));
14453
14449
  if (!parsed) {
14454
14450
  this.newObjectPlanEvent.emit({ currentHour: hour, data: parsed.toString() });
14451
+ return;
14455
14452
  }
14453
+ this.moveBetweenCalendarsEvent.emit({ hour: hour, data: parsed });
14456
14454
  }
14457
14455
  };
14458
14456
  HourSchedulingExpandableComponent.prototype.allowDrop = function (event, hour) {
@@ -14592,7 +14590,6 @@
14592
14590
  ];
14593
14591
  HourSchedulingExpandableComponent.ctorParameters = function () { return [
14594
14592
  { type: i0.ChangeDetectorRef },
14595
- { type: common.DatePipe },
14596
14593
  { type: i0.ElementRef }
14597
14594
  ]; };
14598
14595
  HourSchedulingExpandableComponent.propDecorators = {
@@ -14605,6 +14602,7 @@
14605
14602
  idProp: [{ type: i0.Input }],
14606
14603
  timeChangeEvent: [{ type: i0.Output }],
14607
14604
  newObjectPlanEvent: [{ type: i0.Output }],
14605
+ moveBetweenCalendarsEvent: [{ type: i0.Output }],
14608
14606
  showClass: [{ type: i0.HostBinding, args: ['class.co-hour-scheduling-expandable',] }],
14609
14607
  onResize: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }],
14610
14608
  clickOut: [{ type: i0.HostListener, args: ['document:click', ['$event'],] }]
@@ -14626,7 +14624,7 @@
14626
14624
  HourSchedulingExpandableTemplateComponent.decorators = [
14627
14625
  { type: i0.Component, args: [{
14628
14626
  selector: "co-hour-scheduling-expandable-template",
14629
- template: "\n <div\n *ngFor=\"let obj of objects\"\n [class]=\"'custom-scheduled-object'\"\n [class.selected]=\"obj['selected']\"\n [draggable]=\"!obj['selected']\"\n [style.--height]=\"obj['height'] + 'px'\"\n [style.--top]=\"obj['top'] + 'px'\"\n (click)=\"onSelectBlock(obj)\"\n (dragstart)=\"onExpandableDragStart($event, obj, onDragStartCustom(obj) )\">\n\n <div\n *ngIf=\"obj['selected'] && obj['showTopResizer']\"\n class=\"top-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'top')\"></div>\n <ng-template\n [ngTemplateOutlet]=\"objectTemplate\"\n [ngTemplateOutletContext]=\"{\n object: obj\n }\"\n >\n </ng-template>\n <div *ngIf=\"obj['selected'] && obj['showBottomResizer']\"\n class=\"bottom-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'bottom')\"></div>\n </div>\n ",
14627
+ template: "\n <div\n *ngFor=\"let obj of objects\"\n [class]=\"'custom-scheduled-object'\"\n [class.selected]=\"obj['selected']\"\n [draggable]=\"!obj['selected']\"\n [style.--height]=\"obj['height'] + 'px'\"\n [style.--top]=\"obj['top'] + 'px'\"\n (click)=\"onSelectBlock(obj)\"\n (dragstart)=\"onExpandableDragStart($event, obj, onDragStartCustom(obj) )\">\n\n <div\n *ngIf=\"obj['selected']\"\n class=\"top-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'top')\"></div>\n <ng-template\n [ngTemplateOutlet]=\"objectTemplate\"\n [ngTemplateOutletContext]=\"{\n object: obj\n }\"\n >\n </ng-template>\n <div *ngIf=\"obj['selected']\"\n class=\"bottom-resizer\"\n (mousedown)=\"onResizeStart($event, obj, 'bottom')\"></div>\n </div>\n ",
14630
14628
  encapsulation: i0.ViewEncapsulation.None
14631
14629
  },] }
14632
14630
  ];