@energycap/components 0.39.4-ECAP-23220-bc-file-upload-dialog.20231220-1435 → 0.39.4-ECAP-23220-bc-file-upload-dialog.20231221-0959

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.
@@ -34,7 +34,13 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
34
34
  * setting the formModel with the file information. If the promise resolves it will continue
35
35
  * and set the file name and contents to the formModel, otherwise on failure it'll do nothing.
36
36
  */
37
- onFileSelected?: (files: File | File[]) => Promise<any>;
37
+ onFileSelected?: (file: File) => Promise<any>;
38
+ /**
39
+ * Optional callback supported for when the hosting page needs to process multiple files
40
+ * We simply map the FileList to an array of File objects and pass that array to the
41
+ * callback and let the hosting page handle the processing
42
+ */
43
+ onMultipleFilesSelected?: (files: File[]) => Promise<any>;
38
44
  /**
39
45
  * Optional display type that controls whether the file input textbox is displayed or
40
46
  * simply a button the user clicks to launch the OS file storage dialog.
@@ -82,9 +88,11 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
82
88
  * @param onFileSelectedResult
83
89
  */
84
90
  private patchFileResult;
85
- private clearFormModel;
91
+ /** Maps the files to an array of File objects and sends them along
92
+ * to the derived onMultipleFileSelected method in the hosting component
93
+ */
86
94
  private handleMultipleFiles;
87
95
  private readFile;
88
96
  static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
89
- static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ec-file-upload", never, { "placeholder": "placeholder"; "fileType": "fileType"; "fileOutput": "fileOutput"; "customExtensions": "customExtensions"; "onFileSelected": "onFileSelected"; "displayType": "displayType"; "buttonLabel": "buttonLabel"; "multiSelect": "multiSelect"; }, {}, never, never, false, never>;
97
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ec-file-upload", never, { "placeholder": "placeholder"; "fileType": "fileType"; "fileOutput": "fileOutput"; "customExtensions": "customExtensions"; "onFileSelected": "onFileSelected"; "onMultipleFilesSelected": "onMultipleFilesSelected"; "displayType": "displayType"; "buttonLabel": "buttonLabel"; "multiSelect": "multiSelect"; }, {}, never, never, false, never>;
90
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.39.4-ECAP-23220-bc-file-upload-dialog.20231220-1435",
3
+ "version": "0.39.4-ECAP-23220-bc-file-upload-dialog.20231221-0959",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },