@colijnit/corecomponents_v12 255.1.11 → 255.1.13
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/bundles/colijnit-corecomponents_v12.umd.js +376 -17
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/calendar/calendar-template.component.js +6 -4
- package/esm2015/lib/components/hour-scheduling/components/hour-scheduling-test-object/hour-scheduling-test-object.component.js +2 -2
- package/esm2015/lib/components/hour-scheduling/hour-scheduling.component.js +24 -12
- package/esm2015/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/hour-scheduling-expandable-template.component.js +55 -0
- package/esm2015/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.component.js +316 -0
- package/esm2015/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.module.js +25 -0
- package/esm2015/lib/components/input-number-picker/input-number-picker.component.js +2 -1
- package/esm2015/lib/core/enum/core-components-icon.enum.js +1 -1
- package/esm2015/lib/core/enum/filterItem-mode.enum.js +3 -3
- package/esm2015/public-api.js +5 -1
- package/fesm2015/colijnit-corecomponents_v12.js +420 -17
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/hour-scheduling/components/hour-scheduling-test-object/style/_layout.scss +2 -0
- package/lib/components/hour-scheduling/components/hour-scheduling-test-object/style/_theme.scss +2 -2
- package/lib/components/hour-scheduling/hour-scheduling.component.d.ts +4 -3
- package/lib/components/hour-scheduling/style/_layout.scss +2 -0
- package/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/hour-scheduling-expandable-template.component.d.ts +10 -0
- package/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/style/_layout.scss +4 -0
- package/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/style/_material-definition.scss +0 -0
- package/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/style/_theme.scss +4 -0
- package/lib/components/hour-scheduling-expandable/components/hour-scheduling-expandable-template/style/material.scss +4 -0
- package/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.component.d.ts +76 -0
- package/lib/components/hour-scheduling-expandable/hour-scheduling-expandable.module.d.ts +2 -0
- package/lib/components/hour-scheduling-expandable/style/_layout.scss +103 -0
- package/lib/components/hour-scheduling-expandable/style/_material-definition.scss +0 -0
- package/lib/components/hour-scheduling-expandable/style/_theme.scss +4 -0
- package/lib/components/hour-scheduling-expandable/style/material.scss +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -5184,13 +5184,13 @@ IconCollapseHandleModule.decorators = [
|
|
|
5184
5184
|
var FilterItemMode;
|
|
5185
5185
|
(function (FilterItemMode) {
|
|
5186
5186
|
//This mode makes the Filter display a multi select list
|
|
5187
|
-
// Input will be passed along directly as a string with the following syntax: "
|
|
5187
|
+
// Input will be passed along directly as a string with the following syntax: "?='choice 1', ?='choice2'"
|
|
5188
5188
|
FilterItemMode["Filterlist"] = "filterlist";
|
|
5189
5189
|
//This mode makes the Filter display a single select list
|
|
5190
5190
|
// Input will be passed along directly as a simple string.
|
|
5191
5191
|
FilterItemMode["SingleSelectList"] = "singleSelectList";
|
|
5192
5192
|
//This mode makes the Filter display a multi select list
|
|
5193
|
-
// Input will be passed along directly as a simple
|
|
5193
|
+
// Input will be passed along directly as a simple collection of strings.
|
|
5194
5194
|
FilterItemMode["SelectListWithStringCollectionOutput"] = "selectListWithStringCollectionOutput";
|
|
5195
5195
|
//This mode makes the Filter display a multi select list
|
|
5196
5196
|
// Available choices will need to have their identifying value be a number. The summation of all these numbers will be passed along.
|
|
@@ -6459,9 +6459,11 @@ class CalendarTemplateComponent {
|
|
|
6459
6459
|
this.showYearSelection = true;
|
|
6460
6460
|
}
|
|
6461
6461
|
selectDate(day) {
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6462
|
+
if (day) {
|
|
6463
|
+
this.selectedDate = day;
|
|
6464
|
+
this._fillDatesBetweenSelected();
|
|
6465
|
+
this.dateSelected.emit(new Date(this.selectedDate));
|
|
6466
|
+
}
|
|
6465
6467
|
}
|
|
6466
6468
|
selectMonth(month) {
|
|
6467
6469
|
this.showSelectedMonth = month;
|
|
@@ -7467,6 +7469,7 @@ InputNumberPickerComponent.decorators = [
|
|
|
7467
7469
|
[readonly]="readonly"
|
|
7468
7470
|
[disabled]="disabled"
|
|
7469
7471
|
[required]="required"
|
|
7472
|
+
[placeholder]="label"
|
|
7470
7473
|
(ngModelChange)="handleChangeModel($event)"
|
|
7471
7474
|
(keydown)="handleInputKeyDown($event)"
|
|
7472
7475
|
(blur)="handleBlur()"/>
|
|
@@ -13687,10 +13690,10 @@ ColorSequenceService.decorators = [
|
|
|
13687
13690
|
];
|
|
13688
13691
|
|
|
13689
13692
|
class HourSchedulingComponent {
|
|
13690
|
-
constructor(cdRef, datePipe) {
|
|
13693
|
+
constructor(cdRef, datePipe, zone) {
|
|
13691
13694
|
this.cdRef = cdRef;
|
|
13692
13695
|
this.datePipe = datePipe;
|
|
13693
|
-
this.
|
|
13696
|
+
this.zone = zone;
|
|
13694
13697
|
this.hourLabels = [];
|
|
13695
13698
|
this.scheduledObjects = {};
|
|
13696
13699
|
this.activeHour = null;
|
|
@@ -13699,14 +13702,15 @@ class HourSchedulingComponent {
|
|
|
13699
13702
|
this.customTemplateUsed = false;
|
|
13700
13703
|
this.timeChangeEvent = new EventEmitter();
|
|
13701
13704
|
this.newObjectPlanEvent = new EventEmitter();
|
|
13702
|
-
|
|
13705
|
+
this.showClass = true;
|
|
13706
|
+
document.addEventListener('click', () => this.onDocumentClick);
|
|
13703
13707
|
}
|
|
13704
13708
|
ngOnInit() {
|
|
13705
13709
|
this.generateTimeBlocks();
|
|
13706
13710
|
this.generateScheduledObjects();
|
|
13707
13711
|
}
|
|
13708
13712
|
ngOnDestroy() {
|
|
13709
|
-
document.removeEventListener('click', this.onDocumentClick
|
|
13713
|
+
document.removeEventListener('click', () => this.onDocumentClick);
|
|
13710
13714
|
}
|
|
13711
13715
|
generateTimeBlocks() {
|
|
13712
13716
|
let startUnix = !this.childProp ? this.dateToUnixEpoch(new Date(this.schedule[this.startTimeProp])) : this.dateToUnixEpoch(new Date(this.schedule[this.childProp][this.startTimeProp]));
|
|
@@ -13751,12 +13755,21 @@ class HourSchedulingComponent {
|
|
|
13751
13755
|
}
|
|
13752
13756
|
onDragOver(event) {
|
|
13753
13757
|
event.preventDefault();
|
|
13754
|
-
|
|
13755
|
-
|
|
13758
|
+
event.stopPropagation();
|
|
13759
|
+
this.zone.runOutsideAngular(() => {
|
|
13760
|
+
const currentTarget = event.currentTarget;
|
|
13761
|
+
if (!currentTarget.classList.contains('drag-over')) {
|
|
13762
|
+
currentTarget.classList.add('drag-over');
|
|
13763
|
+
}
|
|
13764
|
+
});
|
|
13756
13765
|
}
|
|
13757
13766
|
onDragLeave(event) {
|
|
13758
|
-
|
|
13759
|
-
|
|
13767
|
+
event.preventDefault();
|
|
13768
|
+
event.stopPropagation();
|
|
13769
|
+
this.zone.runOutsideAngular(() => {
|
|
13770
|
+
const currentTarget = event.currentTarget;
|
|
13771
|
+
currentTarget.classList.remove('drag-over');
|
|
13772
|
+
});
|
|
13760
13773
|
}
|
|
13761
13774
|
onDrop(event, hour) {
|
|
13762
13775
|
event.preventDefault();
|
|
@@ -13927,12 +13940,14 @@ HourSchedulingComponent.decorators = [
|
|
|
13927
13940
|
</div>
|
|
13928
13941
|
</div>
|
|
13929
13942
|
`,
|
|
13943
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13930
13944
|
encapsulation: ViewEncapsulation.None
|
|
13931
13945
|
},] }
|
|
13932
13946
|
];
|
|
13933
13947
|
HourSchedulingComponent.ctorParameters = () => [
|
|
13934
13948
|
{ type: ChangeDetectorRef },
|
|
13935
|
-
{ type: DatePipe }
|
|
13949
|
+
{ type: DatePipe },
|
|
13950
|
+
{ type: NgZone }
|
|
13936
13951
|
];
|
|
13937
13952
|
HourSchedulingComponent.propDecorators = {
|
|
13938
13953
|
schedule: [{ type: Input }],
|
|
@@ -13945,7 +13960,375 @@ HourSchedulingComponent.propDecorators = {
|
|
|
13945
13960
|
idProp: [{ type: Input }],
|
|
13946
13961
|
timeChangeEvent: [{ type: Output }],
|
|
13947
13962
|
newObjectPlanEvent: [{ type: Output }],
|
|
13948
|
-
|
|
13963
|
+
showClass: [{ type: HostBinding, args: ['class.co-hour-scheduling',] }]
|
|
13964
|
+
};
|
|
13965
|
+
|
|
13966
|
+
class HourSchedulingExpandableComponent {
|
|
13967
|
+
constructor(cdRef, datePipe, eRef) {
|
|
13968
|
+
this.cdRef = cdRef;
|
|
13969
|
+
this.datePipe = datePipe;
|
|
13970
|
+
this.eRef = eRef;
|
|
13971
|
+
this.hourLabels = [];
|
|
13972
|
+
this.scheduledObjects = [];
|
|
13973
|
+
this.resizing = false;
|
|
13974
|
+
this.currentResizingObject = null;
|
|
13975
|
+
this.currentDraggingObject = null;
|
|
13976
|
+
this.MIN_HEIGHT = 30;
|
|
13977
|
+
this._schedule = {};
|
|
13978
|
+
this.timeChangeEvent = new EventEmitter();
|
|
13979
|
+
this.newObjectPlanEvent = new EventEmitter();
|
|
13980
|
+
this.showClass = true;
|
|
13981
|
+
}
|
|
13982
|
+
set schedule(value) {
|
|
13983
|
+
if (value && value !== this._schedule) {
|
|
13984
|
+
this.renderObjects();
|
|
13985
|
+
}
|
|
13986
|
+
this._schedule = value;
|
|
13987
|
+
}
|
|
13988
|
+
get schedule() {
|
|
13989
|
+
return this._schedule;
|
|
13990
|
+
}
|
|
13991
|
+
onResize(event) {
|
|
13992
|
+
event.target.innerWidth;
|
|
13993
|
+
}
|
|
13994
|
+
clickOut(event) {
|
|
13995
|
+
if (!this.eRef.nativeElement.contains(event.target)) {
|
|
13996
|
+
this.handleDeselectAll();
|
|
13997
|
+
}
|
|
13998
|
+
}
|
|
13999
|
+
ngOnInit() {
|
|
14000
|
+
this.generateTimeBlocks();
|
|
14001
|
+
if (this.schedule) {
|
|
14002
|
+
this.renderObjects();
|
|
14003
|
+
}
|
|
14004
|
+
this._calculateSchedulingObjectProperties();
|
|
14005
|
+
}
|
|
14006
|
+
// Calculate properties for each scheduled object to determine resizer visibility
|
|
14007
|
+
_calculateSchedulingObjectProperties() {
|
|
14008
|
+
const scheduleStart = this.convertDateToEuropean(this.schedule[this.childProp][this.startTimeProp]);
|
|
14009
|
+
const scheduleEnd = this.convertDateToEuropean(this.schedule[this.childProp][this.endTimeProp]);
|
|
14010
|
+
this.scheduledObjects.forEach(obj => {
|
|
14011
|
+
obj.showTopResizer = this.timeDifference(scheduleStart, obj.start) > 0; // Show top resizer if the start time differs
|
|
14012
|
+
obj.showBottomResizer = this.timeDifference(scheduleEnd, obj.end) > 0; // Show bottom resizer if the end time differs
|
|
14013
|
+
});
|
|
14014
|
+
}
|
|
14015
|
+
// Find the next object in the scheduledObjects list
|
|
14016
|
+
_findNextObject(currentObject) {
|
|
14017
|
+
const currentIndex = this.scheduledObjects.indexOf(currentObject);
|
|
14018
|
+
if (currentIndex >= 0 && currentIndex < this.scheduledObjects.length - 1) {
|
|
14019
|
+
return this.scheduledObjects[currentIndex + 1]; // The next object in the list
|
|
14020
|
+
}
|
|
14021
|
+
return null; // No next object (it's the last one)
|
|
14022
|
+
}
|
|
14023
|
+
// Find the previous object in the scheduledObjects list
|
|
14024
|
+
_findPreviousObject(currentObject) {
|
|
14025
|
+
const currentIndex = this.scheduledObjects.indexOf(currentObject);
|
|
14026
|
+
if (currentIndex > 0) {
|
|
14027
|
+
return this.scheduledObjects[currentIndex - 1]; // The previous object in the list
|
|
14028
|
+
}
|
|
14029
|
+
return null; // No previous object (it's the first one)
|
|
14030
|
+
}
|
|
14031
|
+
renderObjects() {
|
|
14032
|
+
if (this.schedule) {
|
|
14033
|
+
if (this.scheduledObjects.length > 1) {
|
|
14034
|
+
this.scheduledObjects = [];
|
|
14035
|
+
}
|
|
14036
|
+
let objects = this.schedule[this.objectsProp];
|
|
14037
|
+
let schedulingObjects = [];
|
|
14038
|
+
if (objects && objects.length > 0) {
|
|
14039
|
+
objects.forEach(object => {
|
|
14040
|
+
let topDifference = this.timeDifference(this.schedule[this.childProp][this.startTimeProp], object[this.startTimeProp]);
|
|
14041
|
+
schedulingObjects.push({
|
|
14042
|
+
title: object['title'],
|
|
14043
|
+
subTitle: object['subTitle'],
|
|
14044
|
+
start: this.convertDateToEuropean(object[this.startTimeProp]),
|
|
14045
|
+
end: this.convertDateToEuropean(object[this.endTimeProp]),
|
|
14046
|
+
id: object[this.idProp],
|
|
14047
|
+
height: this.timeDifference(object[this.startTimeProp], object[this.endTimeProp]),
|
|
14048
|
+
top: topDifference,
|
|
14049
|
+
selected: false
|
|
14050
|
+
});
|
|
14051
|
+
});
|
|
14052
|
+
}
|
|
14053
|
+
this.scheduledObjects = schedulingObjects;
|
|
14054
|
+
}
|
|
14055
|
+
}
|
|
14056
|
+
onSelectBlock(obj) {
|
|
14057
|
+
this.scheduledObjects.filter(obj => obj.selected).forEach(selectedObj => {
|
|
14058
|
+
selectedObj.selected = false;
|
|
14059
|
+
});
|
|
14060
|
+
obj.selected = true;
|
|
14061
|
+
this.currentResizingObject = obj;
|
|
14062
|
+
}
|
|
14063
|
+
onDragStartCustom(obj) {
|
|
14064
|
+
this.currentDraggingObject = obj;
|
|
14065
|
+
}
|
|
14066
|
+
handleDrop(dragEvent, hour) {
|
|
14067
|
+
if (this.currentDraggingObject) {
|
|
14068
|
+
//The order was scheduled and needs to be moved
|
|
14069
|
+
let start = this.currentDraggingObject.start;
|
|
14070
|
+
let hourSplit = hour.split(":");
|
|
14071
|
+
start.setHours(parseInt(hourSplit[0]));
|
|
14072
|
+
start.setMinutes(parseInt(hourSplit[1]));
|
|
14073
|
+
let scheduledObject = this.scheduledObjects.find(scheduledObject => scheduledObject.id === this.currentDraggingObject.id);
|
|
14074
|
+
scheduledObject.start = start;
|
|
14075
|
+
let originalObject = this.schedule[this.objectsProp].find((object) => object[this.idProp] === this.currentDraggingObject.id);
|
|
14076
|
+
originalObject[this.startTimeProp] = start;
|
|
14077
|
+
let end = this.addMinutes(originalObject[this.startTimeProp], this.currentDraggingObject.height);
|
|
14078
|
+
originalObject[this.endTimeProp] = end;
|
|
14079
|
+
scheduledObject.end = end;
|
|
14080
|
+
scheduledObject.top = this.timeDifference(this.schedule[this.childProp][this.startTimeProp], scheduledObject.start);
|
|
14081
|
+
scheduledObject.height = this.timeDifference(scheduledObject.start, scheduledObject.end);
|
|
14082
|
+
this.timeChangeEvent.emit(originalObject);
|
|
14083
|
+
this.currentDraggingObject = undefined;
|
|
14084
|
+
}
|
|
14085
|
+
else {
|
|
14086
|
+
let parsed = this.tryParseJSONObject(dragEvent.dataTransfer.getData("text"));
|
|
14087
|
+
if (!parsed) {
|
|
14088
|
+
this.newObjectPlanEvent.emit({ currentHour: hour, data: parsed.toString() });
|
|
14089
|
+
}
|
|
14090
|
+
}
|
|
14091
|
+
}
|
|
14092
|
+
allowDrop(event, hour) {
|
|
14093
|
+
event.preventDefault();
|
|
14094
|
+
event.stopPropagation();
|
|
14095
|
+
if (this.currentDraggingObject) {
|
|
14096
|
+
let newStartDate = this.convertDateToEuropean(this.currentDraggingObject.start);
|
|
14097
|
+
let hourSplit = hour.split(":");
|
|
14098
|
+
newStartDate.setHours(parseInt(hourSplit[0]));
|
|
14099
|
+
newStartDate.setHours(parseInt(hourSplit[1]));
|
|
14100
|
+
if (this.scheduledObjects.find((scheduledObject) => scheduledObject.start === newStartDate)) {
|
|
14101
|
+
return false;
|
|
14102
|
+
}
|
|
14103
|
+
else {
|
|
14104
|
+
return true;
|
|
14105
|
+
}
|
|
14106
|
+
}
|
|
14107
|
+
}
|
|
14108
|
+
// Triggered when resizing starts
|
|
14109
|
+
onResizeStart(event, obj, direction) {
|
|
14110
|
+
this.resizing = true;
|
|
14111
|
+
this.resizeDirection = direction;
|
|
14112
|
+
this.currentResizingObject = obj;
|
|
14113
|
+
this.initialY = event.clientY;
|
|
14114
|
+
this.initialHeight = obj.height || 0;
|
|
14115
|
+
this.initialTop = obj.top || 0;
|
|
14116
|
+
// Listen to mousemove and mouseup events globally
|
|
14117
|
+
document.addEventListener('mousemove', this.onResizing.bind(this));
|
|
14118
|
+
document.addEventListener('mouseup', this.onResizeEnd.bind(this));
|
|
14119
|
+
}
|
|
14120
|
+
// Handle resizing with snapping to 30px increments and minimum height restriction
|
|
14121
|
+
onResizing(event) {
|
|
14122
|
+
if (!this.resizing || !this.currentResizingObject)
|
|
14123
|
+
return;
|
|
14124
|
+
const deltaY = event.clientY - this.initialY;
|
|
14125
|
+
const snappedDeltaY = Math.round(deltaY / 30) * 30;
|
|
14126
|
+
if (this.resizeDirection === 'bottom') {
|
|
14127
|
+
const nextObject = this._findNextObject(this.currentResizingObject);
|
|
14128
|
+
const maxHeight = nextObject ? nextObject.top - this.currentResizingObject.top : Infinity;
|
|
14129
|
+
// Block expanding beyond the next object and shrinking below 30px
|
|
14130
|
+
const newHeight = Math.max(this.initialHeight + snappedDeltaY, this.MIN_HEIGHT);
|
|
14131
|
+
this.currentResizingObject.height = Math.min(newHeight, maxHeight);
|
|
14132
|
+
}
|
|
14133
|
+
else if (this.resizeDirection === 'top') {
|
|
14134
|
+
const previousObject = this._findPreviousObject(this.currentResizingObject);
|
|
14135
|
+
const minTop = previousObject ? previousObject.top + previousObject.height : 0;
|
|
14136
|
+
const newHeight = Math.max(this.initialHeight - snappedDeltaY, this.MIN_HEIGHT);
|
|
14137
|
+
const newTop = this.initialTop + (this.initialHeight - newHeight);
|
|
14138
|
+
// Block moving above the previous object's bottom and shrinking below MIN_HEIGHT
|
|
14139
|
+
if (newHeight >= this.MIN_HEIGHT && newTop >= minTop) {
|
|
14140
|
+
this.currentResizingObject.top = newTop;
|
|
14141
|
+
this.currentResizingObject.height = newHeight;
|
|
14142
|
+
}
|
|
14143
|
+
}
|
|
14144
|
+
// Ensure change detection happens
|
|
14145
|
+
this.cdRef.detectChanges();
|
|
14146
|
+
}
|
|
14147
|
+
// Triggered when resizing ends
|
|
14148
|
+
onResizeEnd(event) {
|
|
14149
|
+
let object = this.currentResizingObject;
|
|
14150
|
+
if (object && object.selected) {
|
|
14151
|
+
let originalObject = this.schedule[this.objectsProp].find((scheduledObject) => scheduledObject[this.idProp] === object.id);
|
|
14152
|
+
if (originalObject) {
|
|
14153
|
+
// Start date calculation first
|
|
14154
|
+
originalObject[this.startTimeProp] = this.addMinutes(this.convertDateToEuropean(this.schedule[this.childProp][this.startTimeProp]), object.top);
|
|
14155
|
+
// Then end date calculation based on the height of the object
|
|
14156
|
+
originalObject[this.endTimeProp] = this.addMinutes(this.convertDateToEuropean(originalObject[this.startTimeProp]), object.height);
|
|
14157
|
+
}
|
|
14158
|
+
this.timeChangeEvent.emit(originalObject);
|
|
14159
|
+
this.resizing = false;
|
|
14160
|
+
this.currentResizingObject.selected = false;
|
|
14161
|
+
this.currentResizingObject = null;
|
|
14162
|
+
}
|
|
14163
|
+
// Remove global event listeners
|
|
14164
|
+
document.removeEventListener('mousemove', this.onResizing.bind(this));
|
|
14165
|
+
document.removeEventListener('mouseup', this.onResizeEnd.bind(this));
|
|
14166
|
+
}
|
|
14167
|
+
timeDifference(date1, date2) {
|
|
14168
|
+
let difference = this.convertDateToEuropean(date1).getTime() / 1000 - this.convertDateToEuropean(date2).getTime() / 1000;
|
|
14169
|
+
return Math.abs(difference / 60);
|
|
14170
|
+
}
|
|
14171
|
+
generateTimeBlocks() {
|
|
14172
|
+
let startUnix = !this.childProp ? this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.startTimeProp])) : this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.childProp][this.startTimeProp]));
|
|
14173
|
+
let endUnix = !this.childProp ? this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.endTimeProp])) : this.dateToUnixEpoch(this.convertDateToEuropean(this.schedule[this.childProp][this.endTimeProp]));
|
|
14174
|
+
let interval = 60 * 60;
|
|
14175
|
+
for (let hourCount = startUnix; hourCount <= endUnix; hourCount += interval) {
|
|
14176
|
+
let hour = new Date(hourCount * 1000);
|
|
14177
|
+
let hourString = `${hour.getHours()}:${hour.getMinutes() === 0 ? '00' : hour.getMinutes()}`;
|
|
14178
|
+
this.hourLabels.push(hourString);
|
|
14179
|
+
}
|
|
14180
|
+
}
|
|
14181
|
+
dateToUnixEpoch(date) {
|
|
14182
|
+
return Math.floor(date.getTime()) / 1000;
|
|
14183
|
+
}
|
|
14184
|
+
addMinutes(date, minutes) {
|
|
14185
|
+
return new Date(date.getTime() + minutes * 60000);
|
|
14186
|
+
}
|
|
14187
|
+
tryParseJSONObject(jsonString) {
|
|
14188
|
+
try {
|
|
14189
|
+
let o = JSON.parse(jsonString);
|
|
14190
|
+
if (o && typeof o === "object") {
|
|
14191
|
+
return o;
|
|
14192
|
+
}
|
|
14193
|
+
}
|
|
14194
|
+
catch (e) {
|
|
14195
|
+
}
|
|
14196
|
+
return false;
|
|
14197
|
+
}
|
|
14198
|
+
addHalfHour(hour) {
|
|
14199
|
+
let split = hour.split(":");
|
|
14200
|
+
split[1] = "30";
|
|
14201
|
+
return split.join(':');
|
|
14202
|
+
}
|
|
14203
|
+
convertTZ(date, tzString) {
|
|
14204
|
+
return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", { timeZone: tzString }));
|
|
14205
|
+
}
|
|
14206
|
+
convertDateToEuropean(date) {
|
|
14207
|
+
return this.convertTZ(date, 'Europe/Amsterdam');
|
|
14208
|
+
}
|
|
14209
|
+
handleDeselectAll() {
|
|
14210
|
+
this.scheduledObjects.forEach((scheduledObject) => {
|
|
14211
|
+
if (scheduledObject.selected) {
|
|
14212
|
+
scheduledObject.selected = false;
|
|
14213
|
+
}
|
|
14214
|
+
});
|
|
14215
|
+
}
|
|
14216
|
+
}
|
|
14217
|
+
HourSchedulingExpandableComponent.decorators = [
|
|
14218
|
+
{ type: Component, args: [{
|
|
14219
|
+
selector: 'co-hour-scheduling-expandable',
|
|
14220
|
+
template: `
|
|
14221
|
+
<div class="wrapper">
|
|
14222
|
+
<div class="time-block" *ngFor="let hour of hourLabels">
|
|
14223
|
+
<div class="hour-label"><span [textContent]="hour"></span></div>
|
|
14224
|
+
|
|
14225
|
+
<div class="object-display">
|
|
14226
|
+
<div class="first-half-hour object-half" (dragover)="allowDrop($event, hour)"
|
|
14227
|
+
(drop)="handleDrop($event, hour)">
|
|
14228
|
+
</div>
|
|
14229
|
+
|
|
14230
|
+
<div class="second-half-hour object-half" (dragover)="allowDrop($event, addHalfHour(hour))"
|
|
14231
|
+
(drop)="handleDrop($event, addHalfHour(hour))">
|
|
14232
|
+
</div>
|
|
14233
|
+
</div>
|
|
14234
|
+
</div>
|
|
14235
|
+
|
|
14236
|
+
<div class="scheduled-objects" >
|
|
14237
|
+
<ng-container>
|
|
14238
|
+
<ng-template
|
|
14239
|
+
[ngTemplateOutlet]="customTemplate"
|
|
14240
|
+
[ngTemplateOutletContext]="{
|
|
14241
|
+
objects: scheduledObjects,
|
|
14242
|
+
onSelectBlock: this.onSelectBlock.bind(this),
|
|
14243
|
+
onResizeStart: this.onResizeStart.bind(this),
|
|
14244
|
+
onDragStartCustom: this.onDragStartCustom.bind(this)
|
|
14245
|
+
|
|
14246
|
+
}"
|
|
14247
|
+
>
|
|
14248
|
+
<ng-content></ng-content>
|
|
14249
|
+
</ng-template>
|
|
14250
|
+
</ng-container>
|
|
14251
|
+
</div>
|
|
14252
|
+
|
|
14253
|
+
</div>
|
|
14254
|
+
|
|
14255
|
+
`,
|
|
14256
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14257
|
+
encapsulation: ViewEncapsulation.None
|
|
14258
|
+
},] }
|
|
14259
|
+
];
|
|
14260
|
+
HourSchedulingExpandableComponent.ctorParameters = () => [
|
|
14261
|
+
{ type: ChangeDetectorRef },
|
|
14262
|
+
{ type: DatePipe },
|
|
14263
|
+
{ type: ElementRef }
|
|
14264
|
+
];
|
|
14265
|
+
HourSchedulingExpandableComponent.propDecorators = {
|
|
14266
|
+
schedule: [{ type: Input }],
|
|
14267
|
+
startTimeProp: [{ type: Input }],
|
|
14268
|
+
endTimeProp: [{ type: Input }],
|
|
14269
|
+
objectsProp: [{ type: Input }],
|
|
14270
|
+
childProp: [{ type: Input }],
|
|
14271
|
+
customTemplate: [{ type: Input }],
|
|
14272
|
+
idProp: [{ type: Input }],
|
|
14273
|
+
timeChangeEvent: [{ type: Output }],
|
|
14274
|
+
newObjectPlanEvent: [{ type: Output }],
|
|
14275
|
+
showClass: [{ type: HostBinding, args: ['class.co-hour-scheduling-expandable',] }],
|
|
14276
|
+
onResize: [{ type: HostListener, args: ['window:resize', ['$event'],] }],
|
|
14277
|
+
clickOut: [{ type: HostListener, args: ['document:click', ['$event'],] }]
|
|
14278
|
+
};
|
|
14279
|
+
|
|
14280
|
+
class HourSchedulingExpandableTemplateComponent {
|
|
14281
|
+
constructor() {
|
|
14282
|
+
this.objects = [];
|
|
14283
|
+
}
|
|
14284
|
+
showClass() {
|
|
14285
|
+
return true;
|
|
14286
|
+
}
|
|
14287
|
+
onExpandableDragStart(event, obj, onDragStartCustom) {
|
|
14288
|
+
onDragStartCustom === null || onDragStartCustom === void 0 ? void 0 : onDragStartCustom.call(obj);
|
|
14289
|
+
event.dataTransfer.setData("text", JSON.stringify({ obj }));
|
|
14290
|
+
}
|
|
14291
|
+
}
|
|
14292
|
+
HourSchedulingExpandableTemplateComponent.decorators = [
|
|
14293
|
+
{ type: Component, args: [{
|
|
14294
|
+
selector: "co-hour-scheduling-expandable-template",
|
|
14295
|
+
template: `
|
|
14296
|
+
<div
|
|
14297
|
+
*ngFor="let obj of objects"
|
|
14298
|
+
[class]="'custom-scheduled-object'"
|
|
14299
|
+
[class.selected]="obj['selected']"
|
|
14300
|
+
[draggable]="!obj['selected']"
|
|
14301
|
+
[style.--height]="obj['height'] + 'px'"
|
|
14302
|
+
[style.--top]="obj['top'] + 'px'"
|
|
14303
|
+
(click)="onSelectBlock(obj)"
|
|
14304
|
+
(dragstart)="onExpandableDragStart($event, obj, onDragStartCustom(obj) )">
|
|
14305
|
+
|
|
14306
|
+
<div
|
|
14307
|
+
*ngIf="obj['selected'] && obj['showTopResizer']"
|
|
14308
|
+
class="top-resizer"
|
|
14309
|
+
(mousedown)="onResizeStart($event, obj, 'top')"></div>
|
|
14310
|
+
<ng-template
|
|
14311
|
+
[ngTemplateOutlet]="objectTemplate"
|
|
14312
|
+
[ngTemplateOutletContext]="{
|
|
14313
|
+
object: obj
|
|
14314
|
+
}"
|
|
14315
|
+
>
|
|
14316
|
+
</ng-template>
|
|
14317
|
+
<div *ngIf="obj['selected'] && obj['showBottomResizer']"
|
|
14318
|
+
class="bottom-resizer"
|
|
14319
|
+
(mousedown)="onResizeStart($event, obj, 'bottom')"></div>
|
|
14320
|
+
</div>
|
|
14321
|
+
`,
|
|
14322
|
+
encapsulation: ViewEncapsulation.None
|
|
14323
|
+
},] }
|
|
14324
|
+
];
|
|
14325
|
+
HourSchedulingExpandableTemplateComponent.propDecorators = {
|
|
14326
|
+
objectTemplate: [{ type: Input }],
|
|
14327
|
+
objects: [{ type: Input }],
|
|
14328
|
+
onDragStartCustom: [{ type: Input }],
|
|
14329
|
+
onResizeStart: [{ type: Input }],
|
|
14330
|
+
onSelectBlock: [{ type: Input }],
|
|
14331
|
+
showClass: [{ type: HostBinding, args: ["class.co-hour-scheduling-expandable-template",] }]
|
|
13949
14332
|
};
|
|
13950
14333
|
|
|
13951
14334
|
class HourSchedulingTestObjectComponent {
|
|
@@ -13964,7 +14347,7 @@ HourSchedulingTestObjectComponent.decorators = [
|
|
|
13964
14347
|
},] }
|
|
13965
14348
|
];
|
|
13966
14349
|
HourSchedulingTestObjectComponent.propDecorators = {
|
|
13967
|
-
showClass: [{ type: HostBinding, args: ["class.co-test-object",] }],
|
|
14350
|
+
showClass: [{ type: HostBinding, args: ["class.co-hour-scheduling-test-object",] }],
|
|
13968
14351
|
title: [{ type: Input }],
|
|
13969
14352
|
subTitle: [{ type: Input }]
|
|
13970
14353
|
};
|
|
@@ -13988,6 +14371,26 @@ HourSchedulingComponentModule.decorators = [
|
|
|
13988
14371
|
},] }
|
|
13989
14372
|
];
|
|
13990
14373
|
|
|
14374
|
+
class HourSchedulingExpandableComponentModule {
|
|
14375
|
+
}
|
|
14376
|
+
HourSchedulingExpandableComponentModule.decorators = [
|
|
14377
|
+
{ type: NgModule, args: [{
|
|
14378
|
+
imports: [
|
|
14379
|
+
CommonModule,
|
|
14380
|
+
HourSchedulingComponentModule,
|
|
14381
|
+
],
|
|
14382
|
+
declarations: [
|
|
14383
|
+
HourSchedulingExpandableComponent,
|
|
14384
|
+
HourSchedulingExpandableTemplateComponent
|
|
14385
|
+
],
|
|
14386
|
+
exports: [
|
|
14387
|
+
HourSchedulingExpandableComponent,
|
|
14388
|
+
HourSchedulingExpandableTemplateComponent
|
|
14389
|
+
],
|
|
14390
|
+
providers: [DatePipe]
|
|
14391
|
+
},] }
|
|
14392
|
+
];
|
|
14393
|
+
|
|
13991
14394
|
/*
|
|
13992
14395
|
* Public API Surface of corecomponents
|
|
13993
14396
|
*/
|
|
@@ -13996,5 +14399,5 @@ HourSchedulingComponentModule.decorators = [
|
|
|
13996
14399
|
* Generated bundle index. Do not edit.
|
|
13997
14400
|
*/
|
|
13998
14401
|
|
|
13999
|
-
export { ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayModule, ClickoutsideModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, DoubleCalendarComponent, DoubleCalendarModule, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityModule, OrientationOfDirection, OverlayModule, OverlayService, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, SimpleGridColumnDirective, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog, InputBoolean as ɵa, RippleModule as ɵb, PaginationService as ɵba, PaginatePipe as ɵbb, SimpleGridCellComponent as ɵbc, ListOfValuesMultiselectPopupComponent as ɵbd, ConfirmationDialogComponent as ɵbe, DialogBaseComponent as ɵbf, CoreDynamicComponentService as ɵbg, PrependPipeModule as ɵbh, PrependPipe as ɵbi, CheckmarkOverlayComponent as ɵbj, ScannerService as ɵbk, TooltipModule as ɵbl, TooltipComponent as ɵbm, TooltipDirective as ɵbn, HourSchedulingTestObjectComponent as ɵbo, MD_RIPPLE_GLOBAL_OPTIONS as ɵc, CoRippleDirective as ɵd, CoViewportRulerService as ɵe, CoScrollDispatcherService as ɵf, CoScrollableDirective as ɵg, StopClickModule as ɵh, StopClickDirective as ɵi, BaseModule as ɵj, AppendPipeModule as ɵk, AppendPipe as ɵl, ValidationErrorModule as ɵm, OverlayDirective as ɵn, OverlayParentDirective as ɵo, CoreLocalizePipe as ɵp, CoreDictionaryService as ɵq, ValidationErrorComponent as ɵr, CommitButtonsModule as ɵs, CommitButtonsComponent as ɵt, ClickOutsideDirective as ɵu, ClickOutsideMasterService as ɵv, CalendarTemplateComponent as ɵw, PopupShowerService as ɵx, BaseSimpleGridComponent as ɵy, ObserveVisibilityDirective as ɵz };
|
|
14402
|
+
export { ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayModule, ClickoutsideModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, DoubleCalendarComponent, DoubleCalendarModule, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, HourSchedulingExpandableComponent, HourSchedulingExpandableComponentModule, HourSchedulingExpandableTemplateComponent, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityModule, OrientationOfDirection, OverlayModule, OverlayService, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, SimpleGridColumnDirective, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog, InputBoolean as ɵa, RippleModule as ɵb, PaginationService as ɵba, PaginatePipe as ɵbb, SimpleGridCellComponent as ɵbc, ListOfValuesMultiselectPopupComponent as ɵbd, ConfirmationDialogComponent as ɵbe, DialogBaseComponent as ɵbf, CoreDynamicComponentService as ɵbg, PrependPipeModule as ɵbh, PrependPipe as ɵbi, CheckmarkOverlayComponent as ɵbj, ScannerService as ɵbk, TooltipModule as ɵbl, TooltipComponent as ɵbm, TooltipDirective as ɵbn, HourSchedulingTestObjectComponent as ɵbo, MD_RIPPLE_GLOBAL_OPTIONS as ɵc, CoRippleDirective as ɵd, CoViewportRulerService as ɵe, CoScrollDispatcherService as ɵf, CoScrollableDirective as ɵg, StopClickModule as ɵh, StopClickDirective as ɵi, BaseModule as ɵj, AppendPipeModule as ɵk, AppendPipe as ɵl, ValidationErrorModule as ɵm, OverlayDirective as ɵn, OverlayParentDirective as ɵo, CoreLocalizePipe as ɵp, CoreDictionaryService as ɵq, ValidationErrorComponent as ɵr, CommitButtonsModule as ɵs, CommitButtonsComponent as ɵt, ClickOutsideDirective as ɵu, ClickOutsideMasterService as ɵv, CalendarTemplateComponent as ɵw, PopupShowerService as ɵx, BaseSimpleGridComponent as ɵy, ObserveVisibilityDirective as ɵz };
|
|
14000
14403
|
//# sourceMappingURL=colijnit-corecomponents_v12.js.map
|