@energycap/components 0.39.22 → 0.39.24-ECAP-26526-file-upload-validation-fix.20240910-1016

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.
@@ -80,6 +80,13 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
80
80
  * Optional property to control whether the user can select multiple files
81
81
  */
82
82
  multiSelect?: boolean;
83
+ /**
84
+ * When true, the onFileSelected callback will not be called if the form is invalid.
85
+ * This is useful when the file needs to be validated before it can be uploaded.
86
+ * For server-side validation, leave this as false and use the onFileSelected callback
87
+ * to upload the file and handle any errors thrown by the API.
88
+ */
89
+ validateBeforeUpload: boolean;
83
90
  fileInput?: ElementRef;
84
91
  /** Property bound to the file input to filter what file types are shown in the dialog */
85
92
  fileTypeAccept: string | undefined;
@@ -113,5 +120,5 @@ export declare class FileUploadComponent extends FormControlBase implements OnIn
113
120
  private handleMultipleFiles;
114
121
  private readFile;
115
122
  static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
116
- static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ec-file-upload", never, { "formModel": "formModel"; "placeholder": "placeholder"; "fileType": "fileType"; "fileOutput": "fileOutput"; "customExtensions": "customExtensions"; "onFileSelected": "onFileSelected"; "onMultipleFilesSelected": "onMultipleFilesSelected"; "displayType": "displayType"; "buttonLabel": "buttonLabel"; "buttonType": "buttonType"; "multiSelect": "multiSelect"; }, {}, never, never, false, never>;
123
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ec-file-upload", never, { "formModel": "formModel"; "placeholder": "placeholder"; "fileType": "fileType"; "fileOutput": "fileOutput"; "customExtensions": "customExtensions"; "onFileSelected": "onFileSelected"; "onMultipleFilesSelected": "onMultipleFilesSelected"; "displayType": "displayType"; "buttonLabel": "buttonLabel"; "buttonType": "buttonType"; "multiSelect": "multiSelect"; "validateBeforeUpload": "validateBeforeUpload"; }, {}, never, never, false, never>;
117
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.39.22",
3
+ "version": "0.39.24-ECAP-26526-file-upload-validation-fix.20240910-1016",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
@@ -0,0 +1,6 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="32" height="32" rx="4" fill="white"/>
3
+ <path d="M16.817 28C20.5622 28 23.9052 26.2838 26.1041 23.6022L24.1376 22.2078C22.3767 24.2816 19.7577 25.6045 16.817 25.6045C11.5164 25.5955 7.21697 21.2961 7.21697 15.9955C7.21697 14.4939 7.57451 13.0726 8.19127 11.8034L6.20691 10.3911C5.322 12.0626 4.8125 13.9754 4.8125 15.9955C4.8125 22.6279 10.1935 28 16.817 28Z" fill="#162F3B"/>
4
+ <path d="M16.8169 6.39553C19.7488 6.39553 22.3767 7.71844 24.1376 9.79218L26.1041 8.39777C23.9052 5.7162 20.5622 4 16.8169 4C13.0717 4 9.73761 5.70726 7.52979 8.38883L9.49627 9.78324C11.2661 7.7095 13.8851 6.39553 16.8169 6.39553Z" fill="#51B51C"/>
5
+ <path d="M25.5052 13.8503H21.5812L20.446 16.076L16.7544 8.83575L12.0795 18.8291H10.2829L9.39795 20.8045H13.456L16.9868 13.457L20.3745 20.5721L22.7611 15.8257H24.6114L25.5052 13.8503Z" fill="#51B51C"/>
6
+ </svg>