@colijnit/corecomponents_v12 261.20.3 → 261.20.4

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.
@@ -18657,7 +18657,7 @@ class ScreenConfigurationDirective {
18657
18657
  this._setHostVisible(myCfgObj.immediatelyVisible());
18658
18658
  if (!this.screenConfigNativeElement) {
18659
18659
  this.hostComponent.required = this.hostComponent.required || myCfgObj.isRequired();
18660
- this.hostComponent.readonly = this.hostComponent.forceReadonly || this._moduleInReadonlyMode() || myCfgObj.isReadonly();
18660
+ this.hostComponent.readonly = this._moduleInReadonlyMode() || myCfgObj.isReadonly();
18661
18661
  this.hostComponent.decimals = myCfgObj.scale;
18662
18662
  this.hostComponent.maxLength = myCfgObj.maxLength;
18663
18663
  this.hostComponent.defaultValue = myCfgObj.defaultValue;
@@ -19335,11 +19335,13 @@ class HourSchedulingExpandableComponent {
19335
19335
  currentDraggingObject = null;
19336
19336
  MIN_HEIGHT = 30;
19337
19337
  _schedule = {};
19338
+ _onMouseMove = (e) => this.onResizing(e);
19339
+ _onMouseUp = (e) => this.onResizeEnd(e);
19338
19340
  set schedule(value) {
19339
- if (value && value !== this._schedule) {
19341
+ this._schedule = value;
19342
+ if (this._schedule) {
19340
19343
  this.renderObjects();
19341
19344
  }
19342
- this._schedule = value;
19343
19345
  }
19344
19346
  get schedule() {
19345
19347
  return this._schedule;
@@ -19476,14 +19478,10 @@ class HourSchedulingExpandableComponent {
19476
19478
  if (this.currentDraggingObject) {
19477
19479
  let newStartDate = this.convertDateToEuropean(this.currentDraggingObject.start);
19478
19480
  let hourSplit = hour.split(":");
19479
- newStartDate.setHours(parseInt(hourSplit[0]));
19480
- newStartDate.setHours(parseInt(hourSplit[1]));
19481
- if (this.scheduledObjects.find((scheduledObject) => scheduledObject.start === newStartDate)) {
19482
- return false;
19483
- }
19484
- else {
19485
- return true;
19486
- }
19481
+ newStartDate.setHours(parseInt(hourSplit[0], 10));
19482
+ newStartDate.setMinutes(parseInt(hourSplit[1], 10));
19483
+ const t = newStartDate.getTime();
19484
+ return !this.scheduledObjects.some(o => o.start?.getTime() === t);
19487
19485
  }
19488
19486
  }
19489
19487
  handleDragLeave(event) {
@@ -19501,8 +19499,8 @@ class HourSchedulingExpandableComponent {
19501
19499
  this.initialHeight = obj.height || 0;
19502
19500
  this.initialTop = obj.top || 0;
19503
19501
  // Listen to mousemove and mouseup events globally
19504
- document.addEventListener('mousemove', this.onResizing.bind(this));
19505
- document.addEventListener('mouseup', this.onResizeEnd.bind(this));
19502
+ document.addEventListener("mousemove", this._onMouseMove);
19503
+ document.addEventListener("mouseup", this._onMouseUp);
19506
19504
  }
19507
19505
  // Handle resizing with snapping to 30px increments and minimum height restriction
19508
19506
  onResizing(event) {
@@ -19547,9 +19545,8 @@ class HourSchedulingExpandableComponent {
19547
19545
  this.currentResizingObject.selected = false;
19548
19546
  this.currentResizingObject = null;
19549
19547
  }
19550
- // Remove global event listeners
19551
- document.removeEventListener('mousemove', this.onResizing.bind(this));
19552
- document.removeEventListener('mouseup', this.onResizeEnd.bind(this));
19548
+ document.removeEventListener("mousemove", this._onMouseMove);
19549
+ document.removeEventListener("mouseup", this._onMouseUp);
19553
19550
  }
19554
19551
  timeDifference(date1, date2) {
19555
19552
  let difference = this.convertDateToEuropean(date1).getTime() / 1000 - this.convertDateToEuropean(date2).getTime() / 1000;
@@ -19601,90 +19598,92 @@ class HourSchedulingExpandableComponent {
19601
19598
  });
19602
19599
  }
19603
19600
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HourSchedulingExpandableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
19604
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: HourSchedulingExpandableComponent, isStandalone: false, selector: "co-hour-scheduling-expandable", inputs: { schedule: "schedule", startTimeProp: "startTimeProp", endTimeProp: "endTimeProp", objectsProp: "objectsProp", childProp: "childProp", customTemplate: "customTemplate", idProp: "idProp" }, outputs: { timeChangeEvent: "timeChangeEvent", newObjectPlanEvent: "newObjectPlanEvent", moveBetweenCalendarsEvent: "moveBetweenCalendarsEvent" }, host: { listeners: { "window:resize": "onResize($event)", "document:click": "clickOut($event)" }, properties: { "class.co-hour-scheduling-expandable": "this.showClass" } }, ngImport: i0, template: `
19605
- <div class="wrapper">
19606
- @for (hour of hourLabels; track hour) {
19607
- <div class="time-block">
19608
- <div class="hour-label"><span [textContent]="hour"></span></div>
19609
- <div class="object-display">
19610
- <div class="first-half-hour object-half"
19611
- (dragover)="allowDrop($event, hour)"
19612
- (dragleave)="handleDragLeave($event)"
19613
- (drop)="handleDrop($event, hour)">
19614
- </div>
19615
- <div class="second-half-hour object-half"
19616
- (dragover)="allowDrop($event, addHalfHour(hour))"
19617
- (dragleave)="handleDragLeave($event)"
19618
- (drop)="handleDrop($event, addHalfHour(hour))">
19619
- </div>
19620
- </div>
19621
- </div>
19622
- }
19623
-
19624
- <div class="scheduled-objects" >
19625
- <ng-container>
19626
- <ng-template
19627
- [ngTemplateOutlet]="customTemplate"
19601
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: HourSchedulingExpandableComponent, isStandalone: false, selector: "co-hour-scheduling-expandable", inputs: { schedule: "schedule", startTimeProp: "startTimeProp", endTimeProp: "endTimeProp", objectsProp: "objectsProp", childProp: "childProp", customTemplate: "customTemplate", idProp: "idProp" }, outputs: { timeChangeEvent: "timeChangeEvent", newObjectPlanEvent: "newObjectPlanEvent", moveBetweenCalendarsEvent: "moveBetweenCalendarsEvent" }, host: { listeners: { "window:resize": "onResize($event)", "document:click": "clickOut($event)" }, properties: { "class.co-hour-scheduling-expandable": "this.showClass" } }, ngImport: i0, template: `
19602
+ <div class="wrapper">
19603
+ @for (hour of hourLabels; track hour) {
19604
+ <div class="time-block">
19605
+ <div class="hour-label"><span [textContent]="hour"></span></div>
19606
+ <div class="object-display">
19607
+ <div class="first-half-hour object-half"
19608
+ (dragover)="allowDrop($event, hour)"
19609
+ (dragleave)="handleDragLeave($event)"
19610
+ (drop)="handleDrop($event, hour)">
19611
+ </div>
19612
+ <div class="second-half-hour object-half"
19613
+ (dragover)="allowDrop($event, addHalfHour(hour))"
19614
+ (dragleave)="handleDragLeave($event)"
19615
+ (drop)="handleDrop($event, addHalfHour(hour))">
19616
+ </div>
19617
+ </div>
19618
+ </div>
19619
+ }
19620
+
19621
+ <div class="scheduled-objects" >
19622
+ <ng-container>
19623
+ <ng-template
19624
+ [ngTemplateOutlet]="customTemplate"
19628
19625
  [ngTemplateOutletContext]="{
19629
19626
  objects: scheduledObjects,
19630
19627
  onSelectBlock: this.onSelectBlock.bind(this),
19631
19628
  onResizeStart: this.onResizeStart.bind(this),
19629
+ onResizeEnd: this.onResizeEnd.bind(this),
19632
19630
  onDragStartCustom: this.onDragStartCustom.bind(this)
19633
19631
 
19634
19632
  }"
19635
- >
19636
- <ng-content></ng-content>
19637
- </ng-template>
19638
- </ng-container>
19639
- </div>
19640
-
19641
- </div>
19642
-
19633
+ >
19634
+ <ng-content></ng-content>
19635
+ </ng-template>
19636
+ </ng-container>
19637
+ </div>
19638
+
19639
+ </div>
19640
+
19643
19641
  `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
19644
19642
  }
19645
19643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HourSchedulingExpandableComponent, decorators: [{
19646
19644
  type: Component,
19647
19645
  args: [{
19648
19646
  selector: 'co-hour-scheduling-expandable',
19649
- template: `
19650
- <div class="wrapper">
19651
- @for (hour of hourLabels; track hour) {
19652
- <div class="time-block">
19653
- <div class="hour-label"><span [textContent]="hour"></span></div>
19654
- <div class="object-display">
19655
- <div class="first-half-hour object-half"
19656
- (dragover)="allowDrop($event, hour)"
19657
- (dragleave)="handleDragLeave($event)"
19658
- (drop)="handleDrop($event, hour)">
19659
- </div>
19660
- <div class="second-half-hour object-half"
19661
- (dragover)="allowDrop($event, addHalfHour(hour))"
19662
- (dragleave)="handleDragLeave($event)"
19663
- (drop)="handleDrop($event, addHalfHour(hour))">
19664
- </div>
19665
- </div>
19666
- </div>
19667
- }
19668
-
19669
- <div class="scheduled-objects" >
19670
- <ng-container>
19671
- <ng-template
19672
- [ngTemplateOutlet]="customTemplate"
19647
+ template: `
19648
+ <div class="wrapper">
19649
+ @for (hour of hourLabels; track hour) {
19650
+ <div class="time-block">
19651
+ <div class="hour-label"><span [textContent]="hour"></span></div>
19652
+ <div class="object-display">
19653
+ <div class="first-half-hour object-half"
19654
+ (dragover)="allowDrop($event, hour)"
19655
+ (dragleave)="handleDragLeave($event)"
19656
+ (drop)="handleDrop($event, hour)">
19657
+ </div>
19658
+ <div class="second-half-hour object-half"
19659
+ (dragover)="allowDrop($event, addHalfHour(hour))"
19660
+ (dragleave)="handleDragLeave($event)"
19661
+ (drop)="handleDrop($event, addHalfHour(hour))">
19662
+ </div>
19663
+ </div>
19664
+ </div>
19665
+ }
19666
+
19667
+ <div class="scheduled-objects" >
19668
+ <ng-container>
19669
+ <ng-template
19670
+ [ngTemplateOutlet]="customTemplate"
19673
19671
  [ngTemplateOutletContext]="{
19674
19672
  objects: scheduledObjects,
19675
19673
  onSelectBlock: this.onSelectBlock.bind(this),
19676
19674
  onResizeStart: this.onResizeStart.bind(this),
19675
+ onResizeEnd: this.onResizeEnd.bind(this),
19677
19676
  onDragStartCustom: this.onDragStartCustom.bind(this)
19678
19677
 
19679
19678
  }"
19680
- >
19681
- <ng-content></ng-content>
19682
- </ng-template>
19683
- </ng-container>
19684
- </div>
19685
-
19686
- </div>
19687
-
19679
+ >
19680
+ <ng-content></ng-content>
19681
+ </ng-template>
19682
+ </ng-container>
19683
+ </div>
19684
+
19685
+ </div>
19686
+
19688
19687
  `,
19689
19688
  changeDetection: ChangeDetectionStrategy.OnPush,
19690
19689
  encapsulation: ViewEncapsulation.None,
@@ -19740,11 +19739,9 @@ class HourSchedulingExpandableTemplateComponent {
19740
19739
  showClass() {
19741
19740
  return true;
19742
19741
  }
19743
- onExpandableDragStart(event, obj, onDragStartCustom) {
19744
- event.dataTransfer.setData('text', JSON.stringify({ obj }));
19745
- if (onDragStartCustom) {
19746
- onDragStartCustom?.call(obj);
19747
- }
19742
+ onExpandableDragStart(event, obj) {
19743
+ event.dataTransfer?.setData("text", JSON.stringify(obj));
19744
+ this.onDragStartCustom?.(obj);
19748
19745
  }
19749
19746
  calculateLeftAndWidthOfObjects() {
19750
19747
  const layoutData = new Array(this._objects.length);
@@ -19789,76 +19786,66 @@ class HourSchedulingExpandableTemplateComponent {
19789
19786
  return layoutData;
19790
19787
  }
19791
19788
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HourSchedulingExpandableTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19792
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: HourSchedulingExpandableTemplateComponent, isStandalone: false, selector: "co-hour-scheduling-expandable-template", inputs: { objectTemplate: "objectTemplate", objects: "objects", onDragStartCustom: "onDragStartCustom", onResizeStart: "onResizeStart", onSelectBlock: "onSelectBlock", startTimeProp: "startTimeProp", endTimeProp: "endTimeProp" }, host: { properties: { "class.co-hour-scheduling-expandable-template": "this.showClass" } }, ngImport: i0, template: `
19793
-
19794
- @for (obj of objects; track obj) {
19795
- <div
19796
- [class]="'custom-scheduled-object'"
19797
- [class.selected]="obj.selected"
19798
- [draggable]="!obj.selected"
19799
- [style.--height]="obj.height + 'px'"
19800
- [style.--top]="obj.top + 'px'"
19801
- [style.--left]="layouts[objects.indexOf(obj)].leftPercent + '%'"
19802
- [style.--width]="layouts[objects.indexOf(obj)].widthPercent + '%'"
19803
- (click)="onSelectBlock(obj)"
19804
- (dragstart)="onExpandableDragStart($event, obj, onDragStartCustom(obj) )">
19805
- @if (obj.selected) {
19806
- <div
19807
- class="top-resizer"
19808
- (mousedown)="onResizeStart($event, obj, 'top')"></div>
19809
- }
19810
- <ng-template
19811
- [ngTemplateOutlet]="objectTemplate"
19812
- [ngTemplateOutletContext]="{
19813
- object: obj
19814
- }"
19815
- >
19816
- </ng-template>
19817
- @if (obj.selected) {
19818
- <div
19819
- class="bottom-resizer"
19820
- (mousedown)="onResizeStart($event, obj, 'bottom')"></div>
19821
- }
19822
- </div>
19823
- }
19789
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: HourSchedulingExpandableTemplateComponent, isStandalone: false, selector: "co-hour-scheduling-expandable-template", inputs: { objectTemplate: "objectTemplate", objects: "objects", onDragStartCustom: "onDragStartCustom", onResizeStart: "onResizeStart", onSelectBlock: "onSelectBlock", startTimeProp: "startTimeProp", endTimeProp: "endTimeProp" }, host: { properties: { "class.co-hour-scheduling-expandable-template": "this.showClass" } }, ngImport: i0, template: `
19790
+
19791
+ @for (obj of objects; track obj.id; let i = $index) {
19792
+ <div
19793
+ class="custom-scheduled-object"
19794
+ [class.selected]="obj.selected"
19795
+ [draggable]="!obj.selected"
19796
+ [style.--height]="obj.height + 'px'"
19797
+ [style.--top]="obj.top + 'px'"
19798
+ [style.--left]="layouts[i]?.leftPercent + '%'"
19799
+ [style.--width]="layouts[i]?.widthPercent + '%'"
19800
+ (click)="onSelectBlock(obj)"
19801
+ (dragstart)="onExpandableDragStart($event, obj)">
19802
+ @if (obj.selected) {
19803
+ <div class="top-resizer" (mousedown)="onResizeStart($event, obj, 'top')"></div>
19804
+ }
19805
+
19806
+ <ng-template
19807
+ [ngTemplateOutlet]="objectTemplate"
19808
+ [ngTemplateOutletContext]="{object: obj}">
19809
+ </ng-template>
19810
+
19811
+ @if (obj.selected) {
19812
+ <div class="bottom-resizer" (mousedown)="onResizeStart($event, obj, 'bottom')"></div>
19813
+ }
19814
+ </div>
19815
+ }
19824
19816
  `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
19825
19817
  }
19826
19818
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HourSchedulingExpandableTemplateComponent, decorators: [{
19827
19819
  type: Component,
19828
19820
  args: [{
19829
19821
  selector: 'co-hour-scheduling-expandable-template',
19830
- template: `
19831
-
19832
- @for (obj of objects; track obj) {
19833
- <div
19834
- [class]="'custom-scheduled-object'"
19835
- [class.selected]="obj.selected"
19836
- [draggable]="!obj.selected"
19837
- [style.--height]="obj.height + 'px'"
19838
- [style.--top]="obj.top + 'px'"
19839
- [style.--left]="layouts[objects.indexOf(obj)].leftPercent + '%'"
19840
- [style.--width]="layouts[objects.indexOf(obj)].widthPercent + '%'"
19841
- (click)="onSelectBlock(obj)"
19842
- (dragstart)="onExpandableDragStart($event, obj, onDragStartCustom(obj) )">
19843
- @if (obj.selected) {
19844
- <div
19845
- class="top-resizer"
19846
- (mousedown)="onResizeStart($event, obj, 'top')"></div>
19847
- }
19848
- <ng-template
19849
- [ngTemplateOutlet]="objectTemplate"
19850
- [ngTemplateOutletContext]="{
19851
- object: obj
19852
- }"
19853
- >
19854
- </ng-template>
19855
- @if (obj.selected) {
19856
- <div
19857
- class="bottom-resizer"
19858
- (mousedown)="onResizeStart($event, obj, 'bottom')"></div>
19859
- }
19860
- </div>
19861
- }
19822
+ template: `
19823
+
19824
+ @for (obj of objects; track obj.id; let i = $index) {
19825
+ <div
19826
+ class="custom-scheduled-object"
19827
+ [class.selected]="obj.selected"
19828
+ [draggable]="!obj.selected"
19829
+ [style.--height]="obj.height + 'px'"
19830
+ [style.--top]="obj.top + 'px'"
19831
+ [style.--left]="layouts[i]?.leftPercent + '%'"
19832
+ [style.--width]="layouts[i]?.widthPercent + '%'"
19833
+ (click)="onSelectBlock(obj)"
19834
+ (dragstart)="onExpandableDragStart($event, obj)">
19835
+ @if (obj.selected) {
19836
+ <div class="top-resizer" (mousedown)="onResizeStart($event, obj, 'top')"></div>
19837
+ }
19838
+
19839
+ <ng-template
19840
+ [ngTemplateOutlet]="objectTemplate"
19841
+ [ngTemplateOutletContext]="{object: obj}">
19842
+ </ng-template>
19843
+
19844
+ @if (obj.selected) {
19845
+ <div class="bottom-resizer" (mousedown)="onResizeStart($event, obj, 'bottom')"></div>
19846
+ }
19847
+ </div>
19848
+ }
19862
19849
  `,
19863
19850
  encapsulation: ViewEncapsulation.None,
19864
19851
  standalone: false