chrv-components 1.10.43 → 1.10.44
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
|
|
@@ -15,7 +15,7 @@ import * as i1$3 from '@angular/forms';
|
|
|
15
15
|
import { NG_VALIDATORS, Validators, FormControl, ReactiveFormsModule, FormsModule, FormGroup } from '@angular/forms';
|
|
16
16
|
import * as i2$1 from '@angular/material/autocomplete';
|
|
17
17
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
18
|
-
import { Observable, map, BehaviorSubject, skip, debounceTime, distinctUntilChanged, Subject, startWith, from, mergeMap, toArray, timer,
|
|
18
|
+
import { Observable, map, BehaviorSubject, skip, debounceTime, distinctUntilChanged, Subject, startWith, from, mergeMap, toArray, timer, of, catchError, forkJoin, take, skipWhile, tap, finalize as finalize$1 } from 'rxjs';
|
|
19
19
|
import * as i3$1 from '@angular/material/core';
|
|
20
20
|
import { MatOption } from '@angular/material/core';
|
|
21
21
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
@@ -1941,21 +1941,14 @@ class ChrFileInputComponent extends ChrBaseInputComponent {
|
|
|
1941
1941
|
this.valueDisplay = '';
|
|
1942
1942
|
this.onValueChange(null);
|
|
1943
1943
|
}
|
|
1944
|
+
let obs;
|
|
1944
1945
|
for (const file of files) {
|
|
1945
1946
|
if (this.base64) {
|
|
1946
1947
|
// Convert the file to base64 using the fileservice
|
|
1947
|
-
|
|
1948
|
+
obs = this.fileService.toBase64WithProgress({
|
|
1948
1949
|
file: file,
|
|
1949
1950
|
url: window.URL.createObjectURL(file),
|
|
1950
1951
|
});
|
|
1951
|
-
// Add to the file list with the progress percentage
|
|
1952
|
-
this.files = [...this.files, obs];
|
|
1953
|
-
filesAsync.push(obs);
|
|
1954
|
-
// Catch conversion error for display
|
|
1955
|
-
obs.pipe(catchError((err, source) => {
|
|
1956
|
-
this.toastService.setWarning(`Une erreur s'est produite pendant la conversion du fichier ${file.name} `);
|
|
1957
|
-
return err;
|
|
1958
|
-
}));
|
|
1959
1952
|
}
|
|
1960
1953
|
else {
|
|
1961
1954
|
const fil = file;
|
|
@@ -1964,7 +1957,7 @@ class ChrFileInputComponent extends ChrBaseInputComponent {
|
|
|
1964
1957
|
file.file.name.slice(0, indexOfExtension),
|
|
1965
1958
|
file.file.name.slice(indexOfExtension + 1),
|
|
1966
1959
|
];
|
|
1967
|
-
|
|
1960
|
+
obs = of({
|
|
1968
1961
|
progress: 100,
|
|
1969
1962
|
file: {
|
|
1970
1963
|
data: null,
|
|
@@ -1974,6 +1967,14 @@ class ChrFileInputComponent extends ChrBaseInputComponent {
|
|
|
1974
1967
|
},
|
|
1975
1968
|
});
|
|
1976
1969
|
}
|
|
1970
|
+
// Add to the file list with the progress percentage
|
|
1971
|
+
this.files = [...this.files, obs];
|
|
1972
|
+
filesAsync.push(obs);
|
|
1973
|
+
// Catch conversion error for display
|
|
1974
|
+
obs.pipe(catchError((err, source) => {
|
|
1975
|
+
this.toastService.setWarning(`Une erreur s'est produite pendant la conversion du fichier ${file.name} `);
|
|
1976
|
+
return err;
|
|
1977
|
+
}));
|
|
1977
1978
|
}
|
|
1978
1979
|
forkJoin(filesAsync)
|
|
1979
1980
|
.pipe(take(1))
|