@energycap/components 0.39.4 → 0.39.5-ECAP-23220-bc-file-upload-dialog.20240111-1135
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/esm2020/lib/controls/file-upload/file-upload.component.mjs +76 -27
- package/fesm2015/energycap-components.mjs +74 -23
- package/fesm2015/energycap-components.mjs.map +1 -1
- package/fesm2020/energycap-components.mjs +69 -22
- package/fesm2020/energycap-components.mjs.map +1 -1
- package/lib/controls/file-upload/file-upload.component.d.ts +30 -1
- package/package.json +1 -1
- package/src/assets/locales/en_US.json +3 -1
@@ -35,6 +35,30 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
|
|
35
35
|
* and set the file name and contents to the formModel, otherwise on failure it'll do nothing.
|
36
36
|
*/
|
37
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>;
|
44
|
+
/**
|
45
|
+
* Optional display type that controls whether the file input textbox is displayed or
|
46
|
+
* simply a button the user clicks to launch the OS file storage dialog.
|
47
|
+
* Default: file
|
48
|
+
*/
|
49
|
+
displayType?: 'file' | 'button';
|
50
|
+
/**
|
51
|
+
* When display type is set to button this property will control the button label
|
52
|
+
*/
|
53
|
+
buttonLabel?: string;
|
54
|
+
/**
|
55
|
+
* When display type is set to button this property will control the button type
|
56
|
+
*/
|
57
|
+
buttonType?: string;
|
58
|
+
/**
|
59
|
+
* Optional property to control whether the user can select multiple files
|
60
|
+
*/
|
61
|
+
multiSelect?: boolean;
|
38
62
|
fileInput?: ElementRef;
|
39
63
|
/** Property bound to the file input to filter what file types are shown in the dialog */
|
40
64
|
fileTypeAccept: string | undefined;
|
@@ -68,6 +92,11 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
|
|
68
92
|
* @param onFileSelectedResult
|
69
93
|
*/
|
70
94
|
private patchFileResult;
|
95
|
+
/** Maps the files to an array of File objects and sends them along
|
96
|
+
* to the derived onMultipleFileSelected method in the hosting component
|
97
|
+
*/
|
98
|
+
private handleMultipleFiles;
|
99
|
+
private readFile;
|
71
100
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
|
72
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ec-file-upload", never, { "placeholder": "placeholder"; "fileType": "fileType"; "fileOutput": "fileOutput"; "customExtensions": "customExtensions"; "onFileSelected": "onFileSelected"; }, {}, never, never, false, never>;
|
101
|
+
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"; "buttonType": "buttonType"; "multiSelect": "multiSelect"; }, {}, never, never, false, never>;
|
73
102
|
}
|
package/package.json
CHANGED
@@ -41,5 +41,7 @@
|
|
41
41
|
"ClearSelection_TC": "Clear Selection",
|
42
42
|
"ItemPickerNoItemsSelected_SC": "No {{itemName}} selected. Select from the available {{itemName}} list.",
|
43
43
|
"Done_TC": "Done",
|
44
|
-
"LearnMore_SC": "Learn more"
|
44
|
+
"LearnMore_SC": "Learn more",
|
45
|
+
"SelectZipFiles_ELS": "Select ZIP files...",
|
46
|
+
"Browse_TC": "Browse"
|
45
47
|
}
|