chrv-components 1.9.26 → 1.9.28
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.
|
Binary file
|
|
@@ -554,7 +554,7 @@ class ChrBaseInputComponent {
|
|
|
554
554
|
// observable is subscribed to and set the value to said null.
|
|
555
555
|
skip(1), debounceTime(this.debounceTime ?? 200), distinctUntilChanged())
|
|
556
556
|
.subscribe((res) => {
|
|
557
|
-
this.value = res;
|
|
557
|
+
//this.value = res;
|
|
558
558
|
this.onChange(res);
|
|
559
559
|
this.valueChanges.emit(res);
|
|
560
560
|
});
|
|
@@ -998,9 +998,12 @@ class ChrDateInputComponent extends ChrBaseInputComponent {
|
|
|
998
998
|
super(ngControl);
|
|
999
999
|
this.datePipe = datePipe;
|
|
1000
1000
|
this.onInputChange = (value) => {
|
|
1001
|
+
//console.log(`[DateInput] StringDate: `, value);
|
|
1001
1002
|
const date = this.parseDate(value);
|
|
1003
|
+
//console.log(`[DateInput] ParsedDate: `, date);
|
|
1002
1004
|
if (date != null)
|
|
1003
1005
|
this.value = this.dateToString(date);
|
|
1006
|
+
// Si la date est invalide, on envoie le null, sinon on envoie l'objet date
|
|
1004
1007
|
this.onValueChange(date);
|
|
1005
1008
|
};
|
|
1006
1009
|
this.parseDate = (event) => {
|
|
@@ -1008,7 +1011,7 @@ class ChrDateInputComponent extends ChrBaseInputComponent {
|
|
|
1008
1011
|
this.value = event;
|
|
1009
1012
|
// On essaie de la convertir en date
|
|
1010
1013
|
const date = new Date(Date.parse(event));
|
|
1011
|
-
// Si la date est valide, on
|
|
1014
|
+
// Si la date est valide, on retourne la date, sinon null.
|
|
1012
1015
|
if (date instanceof Date && !isNaN(date))
|
|
1013
1016
|
return date;
|
|
1014
1017
|
else
|
|
@@ -1218,6 +1221,7 @@ class ChrFileInputComponent extends ChrBaseInputComponent {
|
|
|
1218
1221
|
if (file === null || file === undefined)
|
|
1219
1222
|
return;
|
|
1220
1223
|
this.fileService.fileToBase64(file).subscribe((res) => {
|
|
1224
|
+
this.value = `${res.name}.${res.extension}`;
|
|
1221
1225
|
this.onValueChange(res);
|
|
1222
1226
|
});
|
|
1223
1227
|
};
|
|
@@ -1400,7 +1404,8 @@ class ChrFormComponent {
|
|
|
1400
1404
|
*/
|
|
1401
1405
|
this.setValue = (key, value) => {
|
|
1402
1406
|
if (this.formControls[key] === undefined) {
|
|
1403
|
-
|
|
1407
|
+
//console.log('[Form] Could not find control with the following name: ', key);
|
|
1408
|
+
return;
|
|
1404
1409
|
}
|
|
1405
1410
|
this.formControls[key].setValue(value, {
|
|
1406
1411
|
emitEvent: false,
|
|
@@ -1472,7 +1477,8 @@ class ChrFormComponent {
|
|
|
1472
1477
|
};
|
|
1473
1478
|
this.setValue$ = (key, value) => {
|
|
1474
1479
|
if (this.formControls[key] === undefined) {
|
|
1475
|
-
|
|
1480
|
+
//console.log('[Form] Could not find control with the following name: ', key);
|
|
1481
|
+
return;
|
|
1476
1482
|
}
|
|
1477
1483
|
this.formControls[key].patchValue(value);
|
|
1478
1484
|
this.formControls[key].markAsTouched();
|