@colijnit/corecomponents_v12 255.1.9 → 255.1.10
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 +13 -11
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/hour-scheduling/hour-scheduling.component.js +15 -13
- package/fesm2015/colijnit-corecomponents_v12.js +13 -11
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/hour-scheduling/hour-scheduling.component.d.ts +9 -8
- package/package.json +1 -1
|
@@ -14117,23 +14117,24 @@
|
|
|
14117
14117
|
];
|
|
14118
14118
|
|
|
14119
14119
|
var HourSchedulingComponent = /** @class */ (function () {
|
|
14120
|
-
function HourSchedulingComponent(cdRef,
|
|
14120
|
+
function HourSchedulingComponent(cdRef, datePipe) {
|
|
14121
14121
|
this.cdRef = cdRef;
|
|
14122
|
-
this.
|
|
14122
|
+
this.datePipe = datePipe;
|
|
14123
14123
|
this.showClass = true;
|
|
14124
|
-
this.customTemplateUsed = false;
|
|
14125
14124
|
this.hours = [];
|
|
14126
14125
|
this.scheduledObjects = {};
|
|
14127
14126
|
this.draggedObject = null;
|
|
14127
|
+
this.customTemplateUsed = false;
|
|
14128
|
+
this.timeChangeEvent = new i0.EventEmitter();
|
|
14128
14129
|
}
|
|
14129
14130
|
HourSchedulingComponent.prototype.ngOnInit = function () {
|
|
14130
14131
|
if (!this.childProp) {
|
|
14131
|
-
this.startTime = parseInt(this.
|
|
14132
|
-
this.endTime = parseInt(this.
|
|
14132
|
+
this.startTime = parseInt(this.datePipe.transform(new Date(this.schedule[this.startTimeProp]).toISOString(), 'H:mm'));
|
|
14133
|
+
this.endTime = parseInt(this.datePipe.transform(new Date(this.schedule[this.endTimeProp]).toISOString(), 'H:mm'));
|
|
14133
14134
|
}
|
|
14134
14135
|
else {
|
|
14135
|
-
this.startTime = parseInt(this.
|
|
14136
|
-
this.endTime = parseInt(this.
|
|
14136
|
+
this.startTime = parseInt(this.datePipe.transform(new Date(this.schedule[this.childProp][this.startTimeProp]).toISOString(), 'H:mm'));
|
|
14137
|
+
this.endTime = parseInt(this.datePipe.transform(new Date(this.schedule[this.childProp][this.endTimeProp]).toISOString(), 'H:mm'));
|
|
14137
14138
|
}
|
|
14138
14139
|
this.generateTimeBlocks();
|
|
14139
14140
|
};
|
|
@@ -14185,8 +14186,7 @@
|
|
|
14185
14186
|
// Get the unique identifier value from the object using the `idProp`
|
|
14186
14187
|
var objId = data.obj[this.idProp];
|
|
14187
14188
|
// Ensure we create a new object to avoid mutation issues
|
|
14188
|
-
var updatedObject = Object.assign(Object.assign({}, data.obj), {
|
|
14189
|
-
var updatedObject2 = Object.assign(Object.assign({}, data.obj), (_a = {}, _a[this.startTimeProp] = this.createDate(newStartHour), _a[this.endTimeProp] = this.createDate(newEndHour), _a));
|
|
14189
|
+
var updatedObject = Object.assign(Object.assign({}, data.obj), (_a = {}, _a[this.startTimeProp] = this.createDate(newStartHour), _a[this.endTimeProp] = this.createDate(newEndHour), _a));
|
|
14190
14190
|
// Remove the object from its old hour block using its unique id
|
|
14191
14191
|
var originalHourBlock = this.formatHour(originalStartHour);
|
|
14192
14192
|
this.scheduledObjects[originalHourBlock] = this.scheduledObjects[originalHourBlock].filter(function (o) { return o[_this.idProp] !== objId; });
|
|
@@ -14195,14 +14195,15 @@
|
|
|
14195
14195
|
if (!this.scheduledObjects[newHourBlock]) {
|
|
14196
14196
|
this.scheduledObjects[newHourBlock] = [];
|
|
14197
14197
|
}
|
|
14198
|
-
this.scheduledObjects[newHourBlock].push(
|
|
14198
|
+
this.scheduledObjects[newHourBlock].push(updatedObject);
|
|
14199
14199
|
// Clear the dragged object
|
|
14200
14200
|
this.draggedObject = null;
|
|
14201
|
+
this.timeChangeEvent.emit(updatedObject);
|
|
14201
14202
|
// Trigger change detection to update the view
|
|
14202
14203
|
this.cdRef.detectChanges();
|
|
14203
14204
|
};
|
|
14204
14205
|
HourSchedulingComponent.prototype.convertToHourNotation = function (date) {
|
|
14205
|
-
return parseInt(this.
|
|
14206
|
+
return parseInt(this.datePipe.transform(new Date(date).toISOString(), 'H:mm'));
|
|
14206
14207
|
};
|
|
14207
14208
|
HourSchedulingComponent.prototype.createDate = function (hours) {
|
|
14208
14209
|
var date = new Date();
|
|
@@ -14232,6 +14233,7 @@
|
|
|
14232
14233
|
customTemplate: [{ type: i0.Input }],
|
|
14233
14234
|
customTemplateUsed: [{ type: i0.Input }],
|
|
14234
14235
|
idProp: [{ type: i0.Input }],
|
|
14236
|
+
timeChangeEvent: [{ type: i0.Output }],
|
|
14235
14237
|
generateTimeBlocks: [{ type: i0.HostBinding, args: ['class.co-hour-scheduling',] }]
|
|
14236
14238
|
};
|
|
14237
14239
|
|