chrv-components 1.10.46 → 1.10.47

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
@@ -1934,10 +1934,10 @@ class ChrFileInputComponent extends ChrBaseInputComponent {
1934
1934
  this.errors = null;
1935
1935
  this.files = [];
1936
1936
  this.onFileChange = (event) => {
1937
- console.log(`[FileInput] (change) -> `, event);
1937
+ //console.log(`[FileInput] (change) -> `, event);
1938
1938
  this.files = [];
1939
1939
  const files = event.target.files;
1940
- console.log(`[FileInput] (change): target -> `, files);
1940
+ //console.log(`[FileInput] (change): target -> `, files);
1941
1941
  const filesAsync = [];
1942
1942
  if (files.length <= 0) {
1943
1943
  this.valueDisplay = '';
@@ -2370,8 +2370,19 @@ class ChrFormComponent {
2370
2370
  };
2371
2371
  this.toFormData = () => {
2372
2372
  const data = new FormData();
2373
- for (const key in this.model)
2374
- data.append(key, this.model[key]);
2373
+ for (const key in this.model) {
2374
+ if (this.flattenedControls[key].type === 'file' &&
2375
+ this.flattenedControls[key].base64 === false) {
2376
+ if (this.flattenedControls[key].multiple === true) {
2377
+ for (const file of this.model[key])
2378
+ data.append(key, file.file);
2379
+ }
2380
+ else
2381
+ data.append(key, this.model[key].file);
2382
+ }
2383
+ else
2384
+ data.append(key, this.model[key]);
2385
+ }
2375
2386
  return data;
2376
2387
  };
2377
2388
  this.get = (control) => {