@ifsworld/granite-components 14.1.2 → 14.2.1
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/esm2022/carousel/lib/carousel.component.mjs +2 -2
- package/esm2022/file-upload/ifsworld-granite-components-file-upload.mjs +5 -0
- package/esm2022/file-upload/index.mjs +3 -0
- package/esm2022/{lib/file-upload → file-upload/lib}/directives/file-drag-and-drop.directive.mjs +1 -1
- package/esm2022/file-upload/lib/file-upload.component.mjs +182 -0
- package/esm2022/file-upload/lib/file-upload.constants.mjs +45 -0
- package/esm2022/file-upload/lib/file-upload.module.mjs +32 -0
- package/esm2022/{lib/file-upload → file-upload/lib}/file-upload.utils.mjs +1 -1
- package/esm2022/index.mjs +1 -3
- package/esm2022/lib/input-field/input-field.component.mjs +10 -2
- package/fesm2022/ifsworld-granite-components-carousel.mjs +2 -2
- package/fesm2022/ifsworld-granite-components-carousel.mjs.map +1 -1
- package/fesm2022/ifsworld-granite-components-file-upload.mjs +370 -0
- package/fesm2022/ifsworld-granite-components-file-upload.mjs.map +1 -0
- package/fesm2022/ifsworld-granite-components.mjs +10 -331
- package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
- package/file-upload/README.md +3 -0
- package/file-upload/index.d.ts +2 -0
- package/{lib/file-upload → file-upload/lib}/file-upload.component.d.ts +6 -3
- package/{lib/file-upload → file-upload/lib}/file-upload.constants.d.ts +3 -0
- package/{lib/file-upload → file-upload/lib}/file-upload.module.d.ts +3 -3
- package/index.d.ts +0 -2
- package/lib/input-field/input-field.component.d.ts +2 -0
- package/package.json +7 -1
- package/esm2022/lib/file-upload/file-upload.component.mjs +0 -175
- package/esm2022/lib/file-upload/file-upload.constants.mjs +0 -38
- package/esm2022/lib/file-upload/file-upload.module.mjs +0 -21
- /package/{lib/file-upload → file-upload/lib}/directives/file-drag-and-drop.directive.d.ts +0 -0
- /package/{lib/file-upload → file-upload/lib}/file-upload.utils.d.ts +0 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Directive, HostBinding, Input, Output, HostListener, ElementRef, Component, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
6
|
+
import * as i2 from '@ifsworld/granite-components';
|
|
7
|
+
import { GraniteButtonModule, GraniteIconModule } from '@ifsworld/granite-components';
|
|
8
|
+
import * as i3 from '@ifsworld/granite-components/carousel';
|
|
9
|
+
import { GraniteCarouselModule } from '@ifsworld/granite-components/carousel';
|
|
10
|
+
|
|
11
|
+
const fileSizes = [
|
|
12
|
+
'Bytes',
|
|
13
|
+
'KB',
|
|
14
|
+
'MB',
|
|
15
|
+
'GB',
|
|
16
|
+
'TB',
|
|
17
|
+
'PB',
|
|
18
|
+
'EB',
|
|
19
|
+
'ZB',
|
|
20
|
+
'YB',
|
|
21
|
+
];
|
|
22
|
+
var FileUploadStatus;
|
|
23
|
+
(function (FileUploadStatus) {
|
|
24
|
+
FileUploadStatus["NotStarted"] = "NotStarted";
|
|
25
|
+
FileUploadStatus["InProgress"] = "InProgress";
|
|
26
|
+
FileUploadStatus["Completed"] = "Completed";
|
|
27
|
+
FileUploadStatus["Failed"] = "Failed";
|
|
28
|
+
FileUploadStatus["Cancelled"] = "Cancelled";
|
|
29
|
+
})(FileUploadStatus || (FileUploadStatus = {}));
|
|
30
|
+
var FilUploadErrorTypes;
|
|
31
|
+
(function (FilUploadErrorTypes) {
|
|
32
|
+
FilUploadErrorTypes["ExtensionNotSupported"] = "ExtensionNotSupported";
|
|
33
|
+
FilUploadErrorTypes["MultipleFilesNotSupported"] = "MultipleFilesNotSupported";
|
|
34
|
+
})(FilUploadErrorTypes || (FilUploadErrorTypes = {}));
|
|
35
|
+
const DEFAULT_MULTI_FILE_SUPPORT = false;
|
|
36
|
+
const DEFAULT_ACCEPT_TYPE = '*.*';
|
|
37
|
+
const DEFAULT_UPLOAD_TITLE = 'Upload Files';
|
|
38
|
+
const DEFAULT_UPLOAD_ICON = 'icon-upload';
|
|
39
|
+
const DEFAULT_FILE_BROWSE_BUTTON_ICON = 'icon-folder-alt';
|
|
40
|
+
const DEFAULT_DROPZONE_TEXT = 'Drop here or';
|
|
41
|
+
const DEFAULT_BROWSE_BUTTON_TEXT = 'Browse';
|
|
42
|
+
const DEFAULT_DROP_PLACEHOLDER_TEXT = 'Drop files here';
|
|
43
|
+
const DEFAULT_DROPZONE_HINT = '';
|
|
44
|
+
const DEFAULT_REMOVE_BUTTON_TEXT = 'Remove';
|
|
45
|
+
const DEFAULT_UPLOAD_BUTTON_TEXT = 'Upload Files';
|
|
46
|
+
const DEFAULT_RETRY_BUTTON_TEXT = 'Retry';
|
|
47
|
+
const DEFAULT_CANCEL_BUTTON_TEXT = 'Cancel';
|
|
48
|
+
const DEFAULT_RESPONSIVE_OPTIONS = [
|
|
49
|
+
{ breakpoint: '1200px', numVisible: 4, numScroll: 1 },
|
|
50
|
+
{ breakpoint: '992px', numVisible: 3, numScroll: 1 },
|
|
51
|
+
{ breakpoint: '768px', numVisible: 2, numScroll: 1 },
|
|
52
|
+
{ breakpoint: '576px', numVisible: 1, numScroll: 1 },
|
|
53
|
+
];
|
|
54
|
+
const DEFAULT_VISIBLE_FILES = 10;
|
|
55
|
+
|
|
56
|
+
function validFileTypes(mimeTypesStringToCheck, files) {
|
|
57
|
+
const supportedFileMimeTypes = mimeTypesStringToCheck
|
|
58
|
+
.split(',')
|
|
59
|
+
.map((ext) => ext.trim());
|
|
60
|
+
if (!files || files.length === 0) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return files.every((file) => {
|
|
64
|
+
const fileType = file['type'];
|
|
65
|
+
return fileType && supportedFileMimeTypes.includes(fileType);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class GraniteFileDragAndDropDirective {
|
|
70
|
+
constructor() {
|
|
71
|
+
this.currentFiles = [];
|
|
72
|
+
this.droppedFiles = new EventEmitter();
|
|
73
|
+
this.isFileOver = new EventEmitter();
|
|
74
|
+
this.fileUploadValidation = new EventEmitter();
|
|
75
|
+
}
|
|
76
|
+
onDragOver(event) {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
event.stopPropagation();
|
|
79
|
+
const transferFiles = event.dataTransfer?.items ?? [];
|
|
80
|
+
if (!validFileTypes(this.accept, Array.from(transferFiles))) {
|
|
81
|
+
this.fileBrowseError = true;
|
|
82
|
+
this.fileUploadValidation.emit({
|
|
83
|
+
isError: this.fileBrowseError,
|
|
84
|
+
type: FilUploadErrorTypes.ExtensionNotSupported,
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!this.multiFileUploadEnabled &&
|
|
89
|
+
(transferFiles.length > 1 || this.currentFiles.length >= 1)) {
|
|
90
|
+
this.fileBrowseError = true;
|
|
91
|
+
this.fileUploadValidation.emit({
|
|
92
|
+
isError: this.fileBrowseError,
|
|
93
|
+
type: FilUploadErrorTypes.MultipleFilesNotSupported,
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.fileOver = true;
|
|
98
|
+
this.isFileOver.emit(this.fileOver);
|
|
99
|
+
}
|
|
100
|
+
onDragLeave(event) {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
event.stopPropagation();
|
|
103
|
+
this.fileOver = false;
|
|
104
|
+
this.fileBrowseError = false;
|
|
105
|
+
this.fileUploadValidation.emit({ isError: false, type: null });
|
|
106
|
+
this.isFileOver.emit(this.fileOver);
|
|
107
|
+
}
|
|
108
|
+
onDrop(event) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
event.stopPropagation();
|
|
111
|
+
if (this.fileBrowseError) {
|
|
112
|
+
this.fileBrowseError = false;
|
|
113
|
+
this.fileUploadValidation.emit({
|
|
114
|
+
isError: this.fileBrowseError,
|
|
115
|
+
type: null,
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.currentFiles = [
|
|
120
|
+
...this.currentFiles,
|
|
121
|
+
...Array.from(event.dataTransfer.files),
|
|
122
|
+
];
|
|
123
|
+
this.fileOver = false;
|
|
124
|
+
this.isFileOver.emit(this.fileOver);
|
|
125
|
+
if (this.currentFiles.length > 0) {
|
|
126
|
+
this.droppedFiles.emit(this.currentFiles);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileDragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
130
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: GraniteFileDragAndDropDirective, selector: "[graniteFileDragAndDrop]", inputs: { multiFileUploadEnabled: "multiFileUploadEnabled", accept: "accept", currentFiles: "currentFiles" }, outputs: { droppedFiles: "droppedFiles", isFileOver: "isFileOver", fileUploadValidation: "fileUploadValidation" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "class.file-over": "this.fileOver", "class.file-error": "this.fileBrowseError" } }, exportAs: ["graniteFileDragAndDrop"], ngImport: i0 }); }
|
|
131
|
+
}
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileDragAndDropDirective, decorators: [{
|
|
133
|
+
type: Directive,
|
|
134
|
+
args: [{
|
|
135
|
+
selector: '[graniteFileDragAndDrop]',
|
|
136
|
+
exportAs: 'graniteFileDragAndDrop',
|
|
137
|
+
}]
|
|
138
|
+
}], propDecorators: { fileOver: [{
|
|
139
|
+
type: HostBinding,
|
|
140
|
+
args: ['class.file-over']
|
|
141
|
+
}], fileBrowseError: [{
|
|
142
|
+
type: HostBinding,
|
|
143
|
+
args: ['class.file-error']
|
|
144
|
+
}], multiFileUploadEnabled: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], accept: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], currentFiles: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], droppedFiles: [{
|
|
151
|
+
type: Output
|
|
152
|
+
}], isFileOver: [{
|
|
153
|
+
type: Output
|
|
154
|
+
}], fileUploadValidation: [{
|
|
155
|
+
type: Output
|
|
156
|
+
}], onDragOver: [{
|
|
157
|
+
type: HostListener,
|
|
158
|
+
args: ['dragover', ['$event']]
|
|
159
|
+
}], onDragLeave: [{
|
|
160
|
+
type: HostListener,
|
|
161
|
+
args: ['dragleave', ['$event']]
|
|
162
|
+
}], onDrop: [{
|
|
163
|
+
type: HostListener,
|
|
164
|
+
args: ['drop', ['$event']]
|
|
165
|
+
}] } });
|
|
166
|
+
|
|
167
|
+
class GraniteFileUploadComponent {
|
|
168
|
+
constructor() {
|
|
169
|
+
this.accept = DEFAULT_ACCEPT_TYPE;
|
|
170
|
+
this.uploadTitle = DEFAULT_UPLOAD_TITLE;
|
|
171
|
+
this.uploadIcon = DEFAULT_UPLOAD_ICON;
|
|
172
|
+
this.browseIcon = DEFAULT_FILE_BROWSE_BUTTON_ICON;
|
|
173
|
+
this.dropZoneText = DEFAULT_DROPZONE_TEXT;
|
|
174
|
+
this.browseButtonText = DEFAULT_BROWSE_BUTTON_TEXT;
|
|
175
|
+
this.dropPlaceholderText = DEFAULT_DROP_PLACEHOLDER_TEXT;
|
|
176
|
+
this.dropZoneHint = DEFAULT_DROPZONE_HINT;
|
|
177
|
+
this.removeButtonText = DEFAULT_REMOVE_BUTTON_TEXT;
|
|
178
|
+
this.uploadButtonText = DEFAULT_UPLOAD_BUTTON_TEXT;
|
|
179
|
+
this.retryButtonText = DEFAULT_RETRY_BUTTON_TEXT;
|
|
180
|
+
this.cancelButtonText = DEFAULT_CANCEL_BUTTON_TEXT;
|
|
181
|
+
this.multiFileUpload = DEFAULT_MULTI_FILE_SUPPORT;
|
|
182
|
+
this.responsiveOptions = DEFAULT_RESPONSIVE_OPTIONS;
|
|
183
|
+
this.browseOrDragFiles = new EventEmitter();
|
|
184
|
+
this.removeFiles = new EventEmitter();
|
|
185
|
+
this.filesUpload = new EventEmitter();
|
|
186
|
+
this.fileUploadValidation = new EventEmitter();
|
|
187
|
+
this.selectedFiles = [];
|
|
188
|
+
this.previewReadyFiles = [];
|
|
189
|
+
this.isFileOnDropzone = false;
|
|
190
|
+
this.FileUploadStatus = FileUploadStatus;
|
|
191
|
+
this.fileError = false;
|
|
192
|
+
this.numVisible = DEFAULT_VISIBLE_FILES;
|
|
193
|
+
this._uploadStatus = FileUploadStatus.NotStarted;
|
|
194
|
+
this._autoUpload = true;
|
|
195
|
+
}
|
|
196
|
+
get uploadStatus() {
|
|
197
|
+
return this._uploadStatus;
|
|
198
|
+
}
|
|
199
|
+
set uploadStatus(status) {
|
|
200
|
+
this._uploadStatus = status;
|
|
201
|
+
}
|
|
202
|
+
get autoUpload() {
|
|
203
|
+
return this._autoUpload;
|
|
204
|
+
}
|
|
205
|
+
set autoUpload(value) {
|
|
206
|
+
this._autoUpload = coerceBooleanProperty(value);
|
|
207
|
+
}
|
|
208
|
+
fileBrowseHandler(event) {
|
|
209
|
+
const target = event.target;
|
|
210
|
+
const files = Array.from(target.files);
|
|
211
|
+
if (!validFileTypes(this.accept, files)) {
|
|
212
|
+
this.fileUploadValidation.emit({
|
|
213
|
+
isError: true,
|
|
214
|
+
type: FilUploadErrorTypes.ExtensionNotSupported,
|
|
215
|
+
});
|
|
216
|
+
this.fileDropRef.nativeElement.value = null;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.selectedFiles = [...this.selectedFiles, ...files];
|
|
220
|
+
this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);
|
|
221
|
+
this.browseOrDragFiles.emit(this.previewReadyFiles);
|
|
222
|
+
}
|
|
223
|
+
fileRemoveHandler(fileToRemove) {
|
|
224
|
+
const index = this.previewReadyFiles.findIndex((file) => file.imageUrl === fileToRemove.imageUrl &&
|
|
225
|
+
file.file?.name === fileToRemove.file?.name &&
|
|
226
|
+
file.readableSize === fileToRemove.readableSize);
|
|
227
|
+
this.selectedFiles.splice(index, 1);
|
|
228
|
+
this.previewReadyFiles.splice(index, 1);
|
|
229
|
+
if (this.selectedFiles.length === 0 &&
|
|
230
|
+
this.previewReadyFiles.length === 0) {
|
|
231
|
+
this.fileDropRef.nativeElement.value = null;
|
|
232
|
+
this.uploadStatus = FileUploadStatus.NotStarted;
|
|
233
|
+
}
|
|
234
|
+
this.removeFiles.emit(this.previewReadyFiles);
|
|
235
|
+
}
|
|
236
|
+
onFilesDropHandler(files) {
|
|
237
|
+
if (!this.multiFileUpload &&
|
|
238
|
+
(this.selectedFiles.length === 1 || files.length !== 1)) {
|
|
239
|
+
this.fileError = true;
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
this.selectedFiles = files;
|
|
243
|
+
this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);
|
|
244
|
+
this.browseOrDragFiles.emit(this.previewReadyFiles);
|
|
245
|
+
}
|
|
246
|
+
onFileOverDropzone(isFileOver) {
|
|
247
|
+
this.isFileOnDropzone = isFileOver;
|
|
248
|
+
}
|
|
249
|
+
onFileDropError(validation) {
|
|
250
|
+
this.fileError = validation.isError;
|
|
251
|
+
this.fileDropErrorType = validation.type;
|
|
252
|
+
}
|
|
253
|
+
prepareSelectedFiles(files) {
|
|
254
|
+
return files.map((file) => ({
|
|
255
|
+
file,
|
|
256
|
+
readableSize: this.formatBytesToReadableSize(file.size, 2),
|
|
257
|
+
imageUrl: file.type.startsWith('image/')
|
|
258
|
+
? URL.createObjectURL(file)
|
|
259
|
+
: null,
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
uploadFiles() {
|
|
263
|
+
this.filesUpload.emit();
|
|
264
|
+
}
|
|
265
|
+
retryUpload() {
|
|
266
|
+
this.filesUpload.emit();
|
|
267
|
+
}
|
|
268
|
+
cancelUpload() {
|
|
269
|
+
this.resetFileUpload();
|
|
270
|
+
this.removeFiles.emit(this.previewReadyFiles);
|
|
271
|
+
}
|
|
272
|
+
resetFileUpload() {
|
|
273
|
+
this.fileDropRef.nativeElement.value = null;
|
|
274
|
+
this.fileError = false;
|
|
275
|
+
this.fileDropErrorType = '';
|
|
276
|
+
this.selectedFiles = [];
|
|
277
|
+
this.previewReadyFiles = [];
|
|
278
|
+
this.uploadStatus = FileUploadStatus.NotStarted;
|
|
279
|
+
}
|
|
280
|
+
formatBytesToReadableSize(bytes, decimals) {
|
|
281
|
+
if (bytes === 0) {
|
|
282
|
+
return `0 ${fileSizes[0]}`;
|
|
283
|
+
}
|
|
284
|
+
const bytesPerKB = 1024;
|
|
285
|
+
const decimalPoints = decimals <= 0 ? 0 : decimals || 2;
|
|
286
|
+
const exp = Math.floor(Math.log(bytes) / Math.log(bytesPerKB));
|
|
287
|
+
return `${parseFloat((bytes / Math.pow(bytesPerKB, exp)).toFixed(decimalPoints))} ${fileSizes[exp]}`;
|
|
288
|
+
}
|
|
289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
290
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GraniteFileUploadComponent, selector: "granite-file-upload", inputs: { accept: "accept", uploadTitle: "uploadTitle", uploadIcon: "uploadIcon", browseIcon: "browseIcon", dropZoneText: "dropZoneText", browseButtonText: "browseButtonText", dropPlaceholderText: "dropPlaceholderText", dropZoneHint: "dropZoneHint", removeButtonText: "removeButtonText", uploadButtonText: "uploadButtonText", retryButtonText: "retryButtonText", cancelButtonText: "cancelButtonText", multiFileUpload: "multiFileUpload", responsiveOptions: "responsiveOptions", uploadStatus: "uploadStatus", autoUpload: "autoUpload" }, outputs: { browseOrDragFiles: "browseOrDragFiles", removeFiles: "removeFiles", filesUpload: "filesUpload", fileUploadValidation: "fileUploadValidation" }, viewQueries: [{ propertyName: "fileDropRef", first: true, predicate: ["fileDropRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"file-upload-wrapper\">\n <h2 class=\"file-upload-title\">{{ uploadTitle }}</h2>\n <div\n class=\"file-dropzone\"\n [ngClass]=\"{ 'upload-failed': uploadStatus === FileUploadStatus.Failed }\"\n graniteFileDragAndDrop\n (droppedFiles)=\"onFilesDropHandler($event)\"\n (isFileOver)=\"onFileOverDropzone($event)\"\n (fileUploadValidation)=\"onFileDropError($event)\"\n [multiFileUploadEnabled]=\"multiFileUpload\"\n [accept]=\"accept\"\n [currentFiles]=\"selectedFiles\"\n >\n <input\n class=\"file-input\"\n #fileDropRef\n type=\"file\"\n title=\"fileUpload\"\n (change)=\"fileBrowseHandler($event)\"\n [multiple]=\"multiFileUpload\"\n [accept]=\"accept\"\n />\n <div class=\"file-upload-body\">\n @if (!isFileOnDropzone && !fileError) {\n @switch (previewReadyFiles.length) {\n @case (0) {\n <div class=\"file-upload-browse\">\n <granite-icon\n class=\"file-upload-icon\"\n [fontIcon]=\"uploadIcon\"\n ></granite-icon>\n <div class=\"file-selection\">\n <h2 class=\"file-upload-body-text\">{{ dropZoneText }}</h2>\n <button\n class=\"file-select-button\"\n graniteButton\n (click)=\"fileDropRef.click()\"\n >\n <granite-icon\n class=\"browse-button-icon\"\n [fontIcon]=\"browseIcon\"\n ></granite-icon>\n <div class=\"browse-button-text\">{{ browseButtonText }}</div>\n </button>\n </div>\n <p *ngIf=\"dropZoneHint\" class=\"file-upload-hint\">\n {{ dropZoneHint }}\n </p>\n </div>\n }\n @case (1) {\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewReadyFiles[0] }\n \"\n ></ng-container>\n }\n @default {\n <granite-carousel\n [items]=\"previewReadyFiles\"\n [numVisible]=\"numVisible\"\n [responsiveOptions]=\"responsiveOptions\"\n >\n <ng-template let-previewFile #itemTemplate>\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewFile }\n \"\n ></ng-container>\n </ng-template>\n </granite-carousel>\n }\n }\n } @else {\n <p class=\"drop-area-placeholder\">\n {{ dropPlaceholderText }}\n </p>\n }\n </div>\n </div>\n <div class=\"file-upload-footer\">\n <div class=\"footer-container\" *ngIf=\"previewReadyFiles.length > 0\">\n <button\n *ngIf=\"!autoUpload && uploadStatus === FileUploadStatus.NotStarted\"\n granitePrimaryButton\n (click)=\"uploadFiles()\"\n >\n {{ uploadButtonText }}\n </button>\n <ng-container *ngIf=\"uploadStatus === FileUploadStatus.Failed\">\n <button graniteButton (click)=\"cancelUpload()\">\n {{ cancelButtonText }}\n </button>\n <button\n class=\"retry-upload-button\"\n granitePrimaryButton\n (click)=\"retryUpload()\"\n >\n {{ retryButtonText }}\n </button>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #uploadingOverlay>\n <div class=\"file-preview-overlay\"></div>\n <div class=\"loading-container\">\n <div class=\"uploading-spinner\"></div>\n </div>\n</ng-template>\n\n<ng-template #uploadFailedOverlay>\n <div class=\"file-preview-overlay\"></div>\n</ng-template>\n\n<ng-template #filePreviewTemplate let-previewFile=\"previewFile\">\n <div class=\"file-preview-container\">\n @if (previewFile?.imageUrl) {\n <a\n class=\"file-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n [href]=\"previewFile?.imageUrl\"\n target=\"_blank\"\n >\n <div class=\"file-preview-holder\">\n <img\n role=\"presentation\"\n [src]=\"previewFile?.imageUrl\"\n [alt]=\"previewFile?.file?.name\"\n />\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.Failed\"\n [ngTemplateOutlet]=\"uploadFailedOverlay\"\n >\n </ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </a>\n } @else {\n <div\n class=\"document-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n >\n <div class=\"document-preview-holder\">\n <granite-icon\n class=\"document-file-preview\"\n [class.upload-failed]=\"uploadStatus === FileUploadStatus.Failed\"\n [fontIcon]=\"'icon-document-alt'\"\n ></granite-icon>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </div>\n }\n <button\n graniteButton\n *ngIf=\"\n [FileUploadStatus.Completed, FileUploadStatus.NotStarted].includes(\n uploadStatus\n )\n \"\n (click)=\"fileRemoveHandler(previewFile)\"\n >\n {{ removeButtonText }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{width:100%}.file-upload-wrapper{display:flex;flex-direction:column;background-color:var(--granite-color-background);box-shadow:var(--granite-shadow-s);height:100%;width:100%}.file-upload-wrapper .file-upload-title{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-medium);font-weight:var(--granite-font-weight-bold);line-height:var(--granite-line-height-base-rem);color:var(--granite-color-text-weak);margin:0;padding:var(--granite-spacing-8) calc(var(--granite-spacing-16) * .813)}.file-upload-wrapper .file-dropzone{display:flex;flex-direction:column;border-width:var(--granite-border-width-focus);border-style:dashed;border-color:var(--granite-color-background-selected);border-radius:var(--granite-radius-m);margin:var(--granite-spacing-8);height:100%}.file-upload-wrapper .file-dropzone.upload-failed{border-color:var(--granite-color-categorical-4)}.file-upload-wrapper .file-dropzone.file-error{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-failure);border-color:var(--granite-color-state-error);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-error .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone.file-over{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-info);border-color:var(--granite-color-background-active);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-over .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone .file-input{opacity:0;position:absolute;width:0}.file-upload-wrapper .file-dropzone .file-upload-body{display:flex;align-items:center;justify-content:center;height:100%}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse{display:flex;flex-direction:column;gap:var(--granite-spacing-4);justify-content:center;align-items:center;padding:0 var(--granite-spacing-16)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-icon{font-size:var(--granite-font-size-display-small);color:var(--granite-color-text)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection{display:flex;justify-content:space-between;align-items:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-upload-body-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;width:100%;margin-inline-end:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button{display:flex;justify-content:space-between;align-items:center;color:var(--granite-color-text-link);padding-top:calc(var(--granite-spacing-24) / 4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-icon{font-size:var(--granite-font-size-body);color:var(--granite-color-text-link);margin-inline-end:var(--granite-spacing-4);padding:0}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-flowing) / 2);margin-top:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-text{color:var(--granite-color-text-inverse)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-hint{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * 1.125);text-align:center;color:var(--granite-color-text-hint);margin:calc(var(--granite-spacing-base-rem) * .625) 0 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container{display:flex;flex-direction:column;align-items:center;width:100%;max-height:100%;padding:calc(var(--granite-spacing-base-rem) * .375)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link{display:flex;flex-direction:column;align-items:center;max-width:50%;padding:0 var(--granite-spacing-8);text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-size{text-decoration:underline}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder{display:flex;justify-content:center;align-items:flex-end;position:relative;width:80px;height:114px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder img{width:100%;height:100%;object-fit:cover;object-position:center;filter:brightness(250%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .file-preview-overlay{position:absolute;top:0;inset-inline-start:0;width:100%;height:100%;pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .loading-container{position:absolute;top:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .loading-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-preview-holder img{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-preview-holder .file-preview-overlay{background-color:var(--granite-color-signal-failure);opacity:.2}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-size{color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-preview-holder img,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-preview-holder .file-preview-overlay,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-size{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text-link);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:calc(var(--granite-spacing-base-rem) * .375) 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * .625);color:var(--granite-color-text-link);margin:0 0 calc(var(--granite-spacing-base-rem) * .875)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link{display:flex;flex-direction:column;align-items:center;max-width:50%;padding:0 var(--granite-spacing-8);text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder{display:flex;justify-content:center;align-items:flex-end;position:relative;width:60px;height:60px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .document-file-preview{font-size:calc(var(--granite-font-size-body) * 3);color:var(--granite-color-text-hint);padding:calc(var(--granite-spacing-4) * 3) 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .document-file-preview.upload-failed{color:var(--granite-color-background-failure)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .loading-container{position:absolute;top:50%;inset-inline-start:50%;transform:translate(-50%,-10%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .loading-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .document-preview-holder .file-preview-overlay{background-color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .file-size{color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .document-preview-holder .document-file-preview,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .document-preview-holder .file-preview-overlay,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .file-size{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text-weak);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:calc(var(--granite-spacing-base-rem) * .375) 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * .625);color:var(--granite-color-text-week);margin:0 0 calc(var(--granite-spacing-base-rem) * .875)}.file-upload-wrapper .file-upload-footer{margin-inline:var(--granite-spacing-8);margin-bottom:var(--granite-spacing-8)}.file-upload-wrapper .file-upload-footer .footer-container{display:flex;justify-content:flex-end;align-items:center}.file-upload-wrapper .file-upload-footer .footer-container .retry-upload-button{margin-inline-start:var(--granite-spacing-8)}@keyframes loading-keyframe{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.GraniteButtonComponent, selector: "button[graniteButton], button[granitePrimaryButton], button[graniteFlatButton], button[graniteToolbarButton] ", inputs: ["disabled", "toggled"], exportAs: ["graniteButton"] }, { kind: "component", type: i2.GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }, { kind: "component", type: i3.GraniteCarouselComponent, selector: "granite-carousel", inputs: ["items", "responsiveOptions", "numVisible", "numScroll", "circular", "prevButtonAriaLabel", "nextButtonAriaLabel"] }, { kind: "directive", type: GraniteFileDragAndDropDirective, selector: "[graniteFileDragAndDrop]", inputs: ["multiFileUploadEnabled", "accept", "currentFiles"], outputs: ["droppedFiles", "isFileOver", "fileUploadValidation"], exportAs: ["graniteFileDragAndDrop"] }] }); }
|
|
291
|
+
}
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadComponent, decorators: [{
|
|
293
|
+
type: Component,
|
|
294
|
+
args: [{ selector: 'granite-file-upload', template: "<div class=\"file-upload-wrapper\">\n <h2 class=\"file-upload-title\">{{ uploadTitle }}</h2>\n <div\n class=\"file-dropzone\"\n [ngClass]=\"{ 'upload-failed': uploadStatus === FileUploadStatus.Failed }\"\n graniteFileDragAndDrop\n (droppedFiles)=\"onFilesDropHandler($event)\"\n (isFileOver)=\"onFileOverDropzone($event)\"\n (fileUploadValidation)=\"onFileDropError($event)\"\n [multiFileUploadEnabled]=\"multiFileUpload\"\n [accept]=\"accept\"\n [currentFiles]=\"selectedFiles\"\n >\n <input\n class=\"file-input\"\n #fileDropRef\n type=\"file\"\n title=\"fileUpload\"\n (change)=\"fileBrowseHandler($event)\"\n [multiple]=\"multiFileUpload\"\n [accept]=\"accept\"\n />\n <div class=\"file-upload-body\">\n @if (!isFileOnDropzone && !fileError) {\n @switch (previewReadyFiles.length) {\n @case (0) {\n <div class=\"file-upload-browse\">\n <granite-icon\n class=\"file-upload-icon\"\n [fontIcon]=\"uploadIcon\"\n ></granite-icon>\n <div class=\"file-selection\">\n <h2 class=\"file-upload-body-text\">{{ dropZoneText }}</h2>\n <button\n class=\"file-select-button\"\n graniteButton\n (click)=\"fileDropRef.click()\"\n >\n <granite-icon\n class=\"browse-button-icon\"\n [fontIcon]=\"browseIcon\"\n ></granite-icon>\n <div class=\"browse-button-text\">{{ browseButtonText }}</div>\n </button>\n </div>\n <p *ngIf=\"dropZoneHint\" class=\"file-upload-hint\">\n {{ dropZoneHint }}\n </p>\n </div>\n }\n @case (1) {\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewReadyFiles[0] }\n \"\n ></ng-container>\n }\n @default {\n <granite-carousel\n [items]=\"previewReadyFiles\"\n [numVisible]=\"numVisible\"\n [responsiveOptions]=\"responsiveOptions\"\n >\n <ng-template let-previewFile #itemTemplate>\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewFile }\n \"\n ></ng-container>\n </ng-template>\n </granite-carousel>\n }\n }\n } @else {\n <p class=\"drop-area-placeholder\">\n {{ dropPlaceholderText }}\n </p>\n }\n </div>\n </div>\n <div class=\"file-upload-footer\">\n <div class=\"footer-container\" *ngIf=\"previewReadyFiles.length > 0\">\n <button\n *ngIf=\"!autoUpload && uploadStatus === FileUploadStatus.NotStarted\"\n granitePrimaryButton\n (click)=\"uploadFiles()\"\n >\n {{ uploadButtonText }}\n </button>\n <ng-container *ngIf=\"uploadStatus === FileUploadStatus.Failed\">\n <button graniteButton (click)=\"cancelUpload()\">\n {{ cancelButtonText }}\n </button>\n <button\n class=\"retry-upload-button\"\n granitePrimaryButton\n (click)=\"retryUpload()\"\n >\n {{ retryButtonText }}\n </button>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #uploadingOverlay>\n <div class=\"file-preview-overlay\"></div>\n <div class=\"loading-container\">\n <div class=\"uploading-spinner\"></div>\n </div>\n</ng-template>\n\n<ng-template #uploadFailedOverlay>\n <div class=\"file-preview-overlay\"></div>\n</ng-template>\n\n<ng-template #filePreviewTemplate let-previewFile=\"previewFile\">\n <div class=\"file-preview-container\">\n @if (previewFile?.imageUrl) {\n <a\n class=\"file-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n [href]=\"previewFile?.imageUrl\"\n target=\"_blank\"\n >\n <div class=\"file-preview-holder\">\n <img\n role=\"presentation\"\n [src]=\"previewFile?.imageUrl\"\n [alt]=\"previewFile?.file?.name\"\n />\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.Failed\"\n [ngTemplateOutlet]=\"uploadFailedOverlay\"\n >\n </ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </a>\n } @else {\n <div\n class=\"document-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n >\n <div class=\"document-preview-holder\">\n <granite-icon\n class=\"document-file-preview\"\n [class.upload-failed]=\"uploadStatus === FileUploadStatus.Failed\"\n [fontIcon]=\"'icon-document-alt'\"\n ></granite-icon>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </div>\n }\n <button\n graniteButton\n *ngIf=\"\n [FileUploadStatus.Completed, FileUploadStatus.NotStarted].includes(\n uploadStatus\n )\n \"\n (click)=\"fileRemoveHandler(previewFile)\"\n >\n {{ removeButtonText }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{width:100%}.file-upload-wrapper{display:flex;flex-direction:column;background-color:var(--granite-color-background);box-shadow:var(--granite-shadow-s);height:100%;width:100%}.file-upload-wrapper .file-upload-title{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-medium);font-weight:var(--granite-font-weight-bold);line-height:var(--granite-line-height-base-rem);color:var(--granite-color-text-weak);margin:0;padding:var(--granite-spacing-8) calc(var(--granite-spacing-16) * .813)}.file-upload-wrapper .file-dropzone{display:flex;flex-direction:column;border-width:var(--granite-border-width-focus);border-style:dashed;border-color:var(--granite-color-background-selected);border-radius:var(--granite-radius-m);margin:var(--granite-spacing-8);height:100%}.file-upload-wrapper .file-dropzone.upload-failed{border-color:var(--granite-color-categorical-4)}.file-upload-wrapper .file-dropzone.file-error{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-failure);border-color:var(--granite-color-state-error);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-error .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone.file-over{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-info);border-color:var(--granite-color-background-active);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-over .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone .file-input{opacity:0;position:absolute;width:0}.file-upload-wrapper .file-dropzone .file-upload-body{display:flex;align-items:center;justify-content:center;height:100%}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse{display:flex;flex-direction:column;gap:var(--granite-spacing-4);justify-content:center;align-items:center;padding:0 var(--granite-spacing-16)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-icon{font-size:var(--granite-font-size-display-small);color:var(--granite-color-text)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection{display:flex;justify-content:space-between;align-items:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-upload-body-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;width:100%;margin-inline-end:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button{display:flex;justify-content:space-between;align-items:center;color:var(--granite-color-text-link);padding-top:calc(var(--granite-spacing-24) / 4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-icon{font-size:var(--granite-font-size-body);color:var(--granite-color-text-link);margin-inline-end:var(--granite-spacing-4);padding:0}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-flowing) / 2);margin-top:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-text{color:var(--granite-color-text-inverse)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-hint{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * 1.125);text-align:center;color:var(--granite-color-text-hint);margin:calc(var(--granite-spacing-base-rem) * .625) 0 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container{display:flex;flex-direction:column;align-items:center;width:100%;max-height:100%;padding:calc(var(--granite-spacing-base-rem) * .375)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link{display:flex;flex-direction:column;align-items:center;max-width:50%;padding:0 var(--granite-spacing-8);text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-size{text-decoration:underline}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder{display:flex;justify-content:center;align-items:flex-end;position:relative;width:80px;height:114px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder img{width:100%;height:100%;object-fit:cover;object-position:center;filter:brightness(250%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .file-preview-overlay{position:absolute;top:0;inset-inline-start:0;width:100%;height:100%;pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .loading-container{position:absolute;top:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder .loading-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-preview-holder img{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-preview-holder .file-preview-overlay{background-color:var(--granite-color-signal-failure);opacity:.2}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed .file-size{color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-preview-holder img,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-preview-holder .file-preview-overlay,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress .file-size{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text-link);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:calc(var(--granite-spacing-base-rem) * .375) 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * .625);color:var(--granite-color-text-link);margin:0 0 calc(var(--granite-spacing-base-rem) * .875)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link{display:flex;flex-direction:column;align-items:center;max-width:50%;padding:0 var(--granite-spacing-8);text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder{display:flex;justify-content:center;align-items:flex-end;position:relative;width:60px;height:60px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .document-file-preview{font-size:calc(var(--granite-font-size-body) * 3);color:var(--granite-color-text-hint);padding:calc(var(--granite-spacing-4) * 3) 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .document-file-preview.upload-failed{color:var(--granite-color-background-failure)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .loading-container{position:absolute;top:50%;inset-inline-start:50%;transform:translate(-50%,-10%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .document-preview-holder .loading-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .document-preview-holder .file-preview-overlay{background-color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.upload-failed .file-size{color:var(--granite-color-signal-failure);opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress{pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .document-preview-holder .document-file-preview,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .document-preview-holder .file-preview-overlay,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link.uploading-in-progress .file-size{opacity:.4}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text-weak);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:calc(var(--granite-spacing-base-rem) * .375) 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .document-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-base-rem) * .625);color:var(--granite-color-text-week);margin:0 0 calc(var(--granite-spacing-base-rem) * .875)}.file-upload-wrapper .file-upload-footer{margin-inline:var(--granite-spacing-8);margin-bottom:var(--granite-spacing-8)}.file-upload-wrapper .file-upload-footer .footer-container{display:flex;justify-content:flex-end;align-items:center}.file-upload-wrapper .file-upload-footer .footer-container .retry-upload-button{margin-inline-start:var(--granite-spacing-8)}@keyframes loading-keyframe{to{transform:rotate(360deg)}}\n"] }]
|
|
295
|
+
}], propDecorators: { fileDropRef: [{
|
|
296
|
+
type: ViewChild,
|
|
297
|
+
args: ['fileDropRef', { read: ElementRef }]
|
|
298
|
+
}], accept: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], uploadTitle: [{
|
|
301
|
+
type: Input
|
|
302
|
+
}], uploadIcon: [{
|
|
303
|
+
type: Input
|
|
304
|
+
}], browseIcon: [{
|
|
305
|
+
type: Input
|
|
306
|
+
}], dropZoneText: [{
|
|
307
|
+
type: Input
|
|
308
|
+
}], browseButtonText: [{
|
|
309
|
+
type: Input
|
|
310
|
+
}], dropPlaceholderText: [{
|
|
311
|
+
type: Input
|
|
312
|
+
}], dropZoneHint: [{
|
|
313
|
+
type: Input
|
|
314
|
+
}], removeButtonText: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], uploadButtonText: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], retryButtonText: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], cancelButtonText: [{
|
|
321
|
+
type: Input
|
|
322
|
+
}], multiFileUpload: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], responsiveOptions: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], browseOrDragFiles: [{
|
|
327
|
+
type: Output
|
|
328
|
+
}], removeFiles: [{
|
|
329
|
+
type: Output
|
|
330
|
+
}], filesUpload: [{
|
|
331
|
+
type: Output
|
|
332
|
+
}], fileUploadValidation: [{
|
|
333
|
+
type: Output
|
|
334
|
+
}], uploadStatus: [{
|
|
335
|
+
type: Input
|
|
336
|
+
}], autoUpload: [{
|
|
337
|
+
type: Input
|
|
338
|
+
}] } });
|
|
339
|
+
|
|
340
|
+
class GraniteFileUploadModule {
|
|
341
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
342
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadModule, declarations: [GraniteFileUploadComponent, GraniteFileDragAndDropDirective], imports: [CommonModule,
|
|
343
|
+
GraniteButtonModule,
|
|
344
|
+
GraniteIconModule,
|
|
345
|
+
GraniteCarouselModule], exports: [GraniteFileUploadComponent] }); }
|
|
346
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadModule, imports: [CommonModule,
|
|
347
|
+
GraniteButtonModule,
|
|
348
|
+
GraniteIconModule,
|
|
349
|
+
GraniteCarouselModule] }); }
|
|
350
|
+
}
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GraniteFileUploadModule, decorators: [{
|
|
352
|
+
type: NgModule,
|
|
353
|
+
args: [{
|
|
354
|
+
declarations: [GraniteFileUploadComponent, GraniteFileDragAndDropDirective],
|
|
355
|
+
exports: [GraniteFileUploadComponent],
|
|
356
|
+
imports: [
|
|
357
|
+
CommonModule,
|
|
358
|
+
GraniteButtonModule,
|
|
359
|
+
GraniteIconModule,
|
|
360
|
+
GraniteCarouselModule,
|
|
361
|
+
],
|
|
362
|
+
}]
|
|
363
|
+
}] });
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Generated bundle index. Do not edit.
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
export { GraniteFileUploadComponent, GraniteFileUploadModule };
|
|
370
|
+
//# sourceMappingURL=ifsworld-granite-components-file-upload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifsworld-granite-components-file-upload.mjs","sources":["../../../../libs/granite-components/file-upload/src/lib/file-upload.constants.ts","../../../../libs/granite-components/file-upload/src/lib/file-upload.utils.ts","../../../../libs/granite-components/file-upload/src/lib/directives/file-drag-and-drop.directive.ts","../../../../libs/granite-components/file-upload/src/lib/file-upload.component.ts","../../../../libs/granite-components/file-upload/src/lib/file-upload.component.html","../../../../libs/granite-components/file-upload/src/lib/file-upload.module.ts","../../../../libs/granite-components/file-upload/src/ifsworld-granite-components-file-upload.ts"],"sourcesContent":["import { CarouselResponsiveOptions } from 'primeng/carousel';\n\nexport interface SelectedFile {\n file: File;\n readableSize?: string;\n imageUrl?: string;\n}\n\nexport interface FileUploadError {\n isError: boolean;\n type: FilUploadErrorTypes;\n}\n\nexport const fileSizes: string[] = [\n 'Bytes',\n 'KB',\n 'MB',\n 'GB',\n 'TB',\n 'PB',\n 'EB',\n 'ZB',\n 'YB',\n];\n\nexport enum FileUploadStatus {\n NotStarted = 'NotStarted',\n InProgress = 'InProgress',\n Completed = 'Completed',\n Failed = 'Failed',\n Cancelled = 'Cancelled',\n}\n\nexport enum FilUploadErrorTypes {\n ExtensionNotSupported = 'ExtensionNotSupported',\n MultipleFilesNotSupported = 'MultipleFilesNotSupported',\n}\n\nexport const DEFAULT_MULTI_FILE_SUPPORT = false;\nexport const DEFAULT_ACCEPT_TYPE: string = '*.*';\nexport const DEFAULT_UPLOAD_TITLE: string = 'Upload Files';\nexport const DEFAULT_UPLOAD_ICON: string = 'icon-upload';\nexport const DEFAULT_FILE_BROWSE_BUTTON_ICON: string = 'icon-folder-alt';\nexport const DEFAULT_DROPZONE_TEXT: string = 'Drop here or';\nexport const DEFAULT_BROWSE_BUTTON_TEXT: string = 'Browse';\nexport const DEFAULT_DROP_PLACEHOLDER_TEXT: string = 'Drop files here';\nexport const DEFAULT_DROPZONE_HINT: string = '';\nexport const DEFAULT_REMOVE_BUTTON_TEXT: string = 'Remove';\nexport const DEFAULT_UPLOAD_BUTTON_TEXT: string = 'Upload Files';\nexport const DEFAULT_RETRY_BUTTON_TEXT: string = 'Retry';\nexport const DEFAULT_CANCEL_BUTTON_TEXT: string = 'Cancel';\nexport const DEFAULT_RESPONSIVE_OPTIONS: CarouselResponsiveOptions[] = [\n { breakpoint: '1200px', numVisible: 4, numScroll: 1 },\n { breakpoint: '992px', numVisible: 3, numScroll: 1 },\n { breakpoint: '768px', numVisible: 2, numScroll: 1 },\n { breakpoint: '576px', numVisible: 1, numScroll: 1 },\n];\nexport const DEFAULT_VISIBLE_FILES: number = 10;\n","export function validFileTypes<T>(\n mimeTypesStringToCheck: string,\n files: T[]\n): boolean {\n const supportedFileMimeTypes = mimeTypesStringToCheck\n .split(',')\n .map((ext) => ext.trim());\n\n if (!files || files.length === 0) {\n return false;\n }\n\n return files.every((file: T) => {\n const fileType = file['type'];\n return fileType && supportedFileMimeTypes.includes(fileType);\n });\n}\n","import {\n Directive,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\nimport { FileUploadError, FilUploadErrorTypes } from '../file-upload.constants';\nimport { validFileTypes } from '../file-upload.utils';\n\n@Directive({\n selector: '[graniteFileDragAndDrop]',\n exportAs: 'graniteFileDragAndDrop',\n})\nexport class GraniteFileDragAndDropDirective {\n @HostBinding('class.file-over')\n fileOver: boolean;\n\n @HostBinding('class.file-error')\n fileBrowseError: boolean;\n\n @Input()\n multiFileUploadEnabled: boolean;\n\n @Input()\n accept: string;\n\n @Input()\n currentFiles: File[] = [];\n\n @Output()\n droppedFiles: EventEmitter<File[]> = new EventEmitter<File[]>();\n\n @Output()\n isFileOver: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n fileUploadValidation: EventEmitter<FileUploadError> =\n new EventEmitter<FileUploadError>();\n\n @HostListener('dragover', ['$event'])\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const transferFiles = event.dataTransfer?.items ?? [];\n\n if (!validFileTypes(this.accept, Array.from(transferFiles))) {\n this.fileBrowseError = true;\n this.fileUploadValidation.emit({\n isError: this.fileBrowseError,\n type: FilUploadErrorTypes.ExtensionNotSupported,\n });\n return;\n }\n\n if (\n !this.multiFileUploadEnabled &&\n (transferFiles.length > 1 || this.currentFiles.length >= 1)\n ) {\n this.fileBrowseError = true;\n this.fileUploadValidation.emit({\n isError: this.fileBrowseError,\n type: FilUploadErrorTypes.MultipleFilesNotSupported,\n });\n return;\n }\n\n this.fileOver = true;\n this.isFileOver.emit(this.fileOver);\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n this.fileOver = false;\n this.fileBrowseError = false;\n this.fileUploadValidation.emit({ isError: false, type: null });\n this.isFileOver.emit(this.fileOver);\n }\n\n @HostListener('drop', ['$event'])\n onDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.fileBrowseError) {\n this.fileBrowseError = false;\n this.fileUploadValidation.emit({\n isError: this.fileBrowseError,\n type: null,\n });\n return;\n }\n\n this.currentFiles = [\n ...this.currentFiles,\n ...Array.from(event.dataTransfer.files),\n ];\n\n this.fileOver = false;\n this.isFileOver.emit(this.fileOver);\n\n if (this.currentFiles.length > 0) {\n this.droppedFiles.emit(this.currentFiles);\n }\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {\n DEFAULT_BROWSE_BUTTON_TEXT,\n DEFAULT_CANCEL_BUTTON_TEXT,\n DEFAULT_DROP_PLACEHOLDER_TEXT,\n DEFAULT_DROPZONE_HINT,\n DEFAULT_DROPZONE_TEXT,\n DEFAULT_FILE_BROWSE_BUTTON_ICON,\n DEFAULT_ACCEPT_TYPE,\n DEFAULT_MULTI_FILE_SUPPORT,\n DEFAULT_REMOVE_BUTTON_TEXT,\n DEFAULT_RETRY_BUTTON_TEXT,\n DEFAULT_UPLOAD_BUTTON_TEXT,\n DEFAULT_UPLOAD_ICON,\n DEFAULT_UPLOAD_TITLE,\n fileSizes,\n FileUploadError,\n FileUploadStatus,\n FilUploadErrorTypes,\n SelectedFile,\n DEFAULT_RESPONSIVE_OPTIONS,\n DEFAULT_VISIBLE_FILES,\n} from './file-upload.constants';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { validFileTypes } from './file-upload.utils';\nimport { CarouselResponsiveOptions } from 'primeng/carousel';\n\n@Component({\n selector: 'granite-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n})\nexport class GraniteFileUploadComponent {\n @ViewChild('fileDropRef', { read: ElementRef })\n fileDropRef!: ElementRef<HTMLInputElement>;\n\n @Input()\n accept: string = DEFAULT_ACCEPT_TYPE;\n\n @Input()\n uploadTitle: string = DEFAULT_UPLOAD_TITLE;\n\n @Input()\n uploadIcon: string = DEFAULT_UPLOAD_ICON;\n\n @Input()\n browseIcon: string = DEFAULT_FILE_BROWSE_BUTTON_ICON;\n\n @Input()\n dropZoneText: string = DEFAULT_DROPZONE_TEXT;\n\n @Input()\n browseButtonText: string = DEFAULT_BROWSE_BUTTON_TEXT;\n\n @Input()\n dropPlaceholderText: string = DEFAULT_DROP_PLACEHOLDER_TEXT;\n\n @Input()\n dropZoneHint: string = DEFAULT_DROPZONE_HINT;\n\n @Input()\n removeButtonText: string = DEFAULT_REMOVE_BUTTON_TEXT;\n\n @Input()\n uploadButtonText: string = DEFAULT_UPLOAD_BUTTON_TEXT;\n\n @Input()\n retryButtonText: string = DEFAULT_RETRY_BUTTON_TEXT;\n\n @Input()\n cancelButtonText: string = DEFAULT_CANCEL_BUTTON_TEXT;\n\n @Input()\n multiFileUpload: boolean = DEFAULT_MULTI_FILE_SUPPORT;\n\n @Input()\n responsiveOptions: CarouselResponsiveOptions[] = DEFAULT_RESPONSIVE_OPTIONS;\n\n @Output()\n browseOrDragFiles: EventEmitter<SelectedFile[]> = new EventEmitter<\n SelectedFile[]\n >();\n\n @Output()\n removeFiles: EventEmitter<SelectedFile[]> = new EventEmitter<\n SelectedFile[]\n >();\n\n @Output()\n filesUpload: EventEmitter<void> = new EventEmitter<void>();\n\n @Output()\n fileUploadValidation: EventEmitter<FileUploadError> =\n new EventEmitter<FileUploadError>();\n\n selectedFiles: File[] = [];\n previewReadyFiles: SelectedFile[] = [];\n isFileOnDropzone: boolean = false;\n FileUploadStatus = FileUploadStatus;\n fileError: boolean = false;\n fileDropErrorType: string;\n numVisible: number = DEFAULT_VISIBLE_FILES;\n\n protected _uploadStatus: FileUploadStatus = FileUploadStatus.NotStarted;\n\n @Input()\n get uploadStatus(): FileUploadStatus {\n return this._uploadStatus;\n }\n\n set uploadStatus(status: FileUploadStatus) {\n this._uploadStatus = status;\n }\n\n protected _autoUpload: boolean = true;\n\n @Input()\n get autoUpload(): boolean {\n return this._autoUpload;\n }\n\n set autoUpload(value: boolean) {\n this._autoUpload = coerceBooleanProperty(value);\n }\n\n fileBrowseHandler(event: Event): void {\n const target = event.target as HTMLInputElement;\n const files: File[] = Array.from(target.files);\n\n if (!validFileTypes(this.accept, files)) {\n this.fileUploadValidation.emit({\n isError: true,\n type: FilUploadErrorTypes.ExtensionNotSupported,\n });\n this.fileDropRef.nativeElement.value = null;\n return;\n }\n\n this.selectedFiles = [...this.selectedFiles, ...files];\n this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);\n this.browseOrDragFiles.emit(this.previewReadyFiles);\n }\n\n fileRemoveHandler(fileToRemove: SelectedFile): void {\n const index = this.previewReadyFiles.findIndex(\n (file) =>\n file.imageUrl === fileToRemove.imageUrl &&\n file.file?.name === fileToRemove.file?.name &&\n file.readableSize === fileToRemove.readableSize\n );\n this.selectedFiles.splice(index, 1);\n this.previewReadyFiles.splice(index, 1);\n\n if (\n this.selectedFiles.length === 0 &&\n this.previewReadyFiles.length === 0\n ) {\n this.fileDropRef.nativeElement.value = null;\n this.uploadStatus = FileUploadStatus.NotStarted;\n }\n\n this.removeFiles.emit(this.previewReadyFiles);\n }\n\n onFilesDropHandler(files: File[]): void {\n if (\n !this.multiFileUpload &&\n (this.selectedFiles.length === 1 || files.length !== 1)\n ) {\n this.fileError = true;\n return;\n }\n\n this.selectedFiles = files;\n\n this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);\n this.browseOrDragFiles.emit(this.previewReadyFiles);\n }\n\n onFileOverDropzone(isFileOver: boolean): void {\n this.isFileOnDropzone = isFileOver;\n }\n\n onFileDropError(validation: FileUploadError): void {\n this.fileError = validation.isError;\n this.fileDropErrorType = validation.type;\n }\n\n prepareSelectedFiles(files: File[]): SelectedFile[] {\n return files.map((file: File) => ({\n file,\n readableSize: this.formatBytesToReadableSize(file.size, 2),\n imageUrl: file.type.startsWith('image/')\n ? URL.createObjectURL(file)\n : null,\n }));\n }\n\n uploadFiles(): void {\n this.filesUpload.emit();\n }\n\n retryUpload(): void {\n this.filesUpload.emit();\n }\n\n cancelUpload(): void {\n this.resetFileUpload();\n this.removeFiles.emit(this.previewReadyFiles);\n }\n\n resetFileUpload(): void {\n this.fileDropRef.nativeElement.value = null;\n this.fileError = false;\n this.fileDropErrorType = '';\n this.selectedFiles = [];\n this.previewReadyFiles = [];\n this.uploadStatus = FileUploadStatus.NotStarted;\n }\n\n formatBytesToReadableSize(bytes: number, decimals: number): string {\n if (bytes === 0) {\n return `0 ${fileSizes[0]}`;\n }\n\n const bytesPerKB = 1024;\n const decimalPoints = decimals <= 0 ? 0 : decimals || 2;\n const exp = Math.floor(Math.log(bytes) / Math.log(bytesPerKB));\n return `${parseFloat(\n (bytes / Math.pow(bytesPerKB, exp)).toFixed(decimalPoints)\n )} ${fileSizes[exp]}`;\n }\n}\n","<div class=\"file-upload-wrapper\">\n <h2 class=\"file-upload-title\">{{ uploadTitle }}</h2>\n <div\n class=\"file-dropzone\"\n [ngClass]=\"{ 'upload-failed': uploadStatus === FileUploadStatus.Failed }\"\n graniteFileDragAndDrop\n (droppedFiles)=\"onFilesDropHandler($event)\"\n (isFileOver)=\"onFileOverDropzone($event)\"\n (fileUploadValidation)=\"onFileDropError($event)\"\n [multiFileUploadEnabled]=\"multiFileUpload\"\n [accept]=\"accept\"\n [currentFiles]=\"selectedFiles\"\n >\n <input\n class=\"file-input\"\n #fileDropRef\n type=\"file\"\n title=\"fileUpload\"\n (change)=\"fileBrowseHandler($event)\"\n [multiple]=\"multiFileUpload\"\n [accept]=\"accept\"\n />\n <div class=\"file-upload-body\">\n @if (!isFileOnDropzone && !fileError) {\n @switch (previewReadyFiles.length) {\n @case (0) {\n <div class=\"file-upload-browse\">\n <granite-icon\n class=\"file-upload-icon\"\n [fontIcon]=\"uploadIcon\"\n ></granite-icon>\n <div class=\"file-selection\">\n <h2 class=\"file-upload-body-text\">{{ dropZoneText }}</h2>\n <button\n class=\"file-select-button\"\n graniteButton\n (click)=\"fileDropRef.click()\"\n >\n <granite-icon\n class=\"browse-button-icon\"\n [fontIcon]=\"browseIcon\"\n ></granite-icon>\n <div class=\"browse-button-text\">{{ browseButtonText }}</div>\n </button>\n </div>\n <p *ngIf=\"dropZoneHint\" class=\"file-upload-hint\">\n {{ dropZoneHint }}\n </p>\n </div>\n }\n @case (1) {\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewReadyFiles[0] }\n \"\n ></ng-container>\n }\n @default {\n <granite-carousel\n [items]=\"previewReadyFiles\"\n [numVisible]=\"numVisible\"\n [responsiveOptions]=\"responsiveOptions\"\n >\n <ng-template let-previewFile #itemTemplate>\n <ng-container\n *ngTemplateOutlet=\"\n filePreviewTemplate;\n context: { previewFile: previewFile }\n \"\n ></ng-container>\n </ng-template>\n </granite-carousel>\n }\n }\n } @else {\n <p class=\"drop-area-placeholder\">\n {{ dropPlaceholderText }}\n </p>\n }\n </div>\n </div>\n <div class=\"file-upload-footer\">\n <div class=\"footer-container\" *ngIf=\"previewReadyFiles.length > 0\">\n <button\n *ngIf=\"!autoUpload && uploadStatus === FileUploadStatus.NotStarted\"\n granitePrimaryButton\n (click)=\"uploadFiles()\"\n >\n {{ uploadButtonText }}\n </button>\n <ng-container *ngIf=\"uploadStatus === FileUploadStatus.Failed\">\n <button graniteButton (click)=\"cancelUpload()\">\n {{ cancelButtonText }}\n </button>\n <button\n class=\"retry-upload-button\"\n granitePrimaryButton\n (click)=\"retryUpload()\"\n >\n {{ retryButtonText }}\n </button>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #uploadingOverlay>\n <div class=\"file-preview-overlay\"></div>\n <div class=\"loading-container\">\n <div class=\"uploading-spinner\"></div>\n </div>\n</ng-template>\n\n<ng-template #uploadFailedOverlay>\n <div class=\"file-preview-overlay\"></div>\n</ng-template>\n\n<ng-template #filePreviewTemplate let-previewFile=\"previewFile\">\n <div class=\"file-preview-container\">\n @if (previewFile?.imageUrl) {\n <a\n class=\"file-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n [href]=\"previewFile?.imageUrl\"\n target=\"_blank\"\n >\n <div class=\"file-preview-holder\">\n <img\n role=\"presentation\"\n [src]=\"previewFile?.imageUrl\"\n [alt]=\"previewFile?.file?.name\"\n />\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.Failed\"\n [ngTemplateOutlet]=\"uploadFailedOverlay\"\n >\n </ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </a>\n } @else {\n <div\n class=\"document-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress': uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n >\n <div class=\"document-preview-holder\">\n <granite-icon\n class=\"document-file-preview\"\n [class.upload-failed]=\"uploadStatus === FileUploadStatus.Failed\"\n [fontIcon]=\"'icon-document-alt'\"\n ></granite-icon>\n <ng-container\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n [ngTemplateOutlet]=\"uploadingOverlay\"\n ></ng-container>\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </div>\n }\n <button\n graniteButton\n *ngIf=\"\n [FileUploadStatus.Completed, FileUploadStatus.NotStarted].includes(\n uploadStatus\n )\n \"\n (click)=\"fileRemoveHandler(previewFile)\"\n >\n {{ removeButtonText }}\n </button>\n </div>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { GraniteFileUploadComponent } from './file-upload.component';\nimport { GraniteFileDragAndDropDirective } from './directives/file-drag-and-drop.directive';\nimport { GraniteCarouselModule } from '@ifsworld/granite-components/carousel';\nimport {\n GraniteButtonModule,\n GraniteIconModule,\n} from '@ifsworld/granite-components';\n\n@NgModule({\n declarations: [GraniteFileUploadComponent, GraniteFileDragAndDropDirective],\n exports: [GraniteFileUploadComponent],\n imports: [\n CommonModule,\n GraniteButtonModule,\n GraniteIconModule,\n GraniteCarouselModule,\n ],\n})\nexport class GraniteFileUploadModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i4.GraniteFileDragAndDropDirective"],"mappings":";;;;;;;;;;AAaO,MAAM,SAAS,GAAa;IACjC,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,IAAY,gBAMX,CAAA;AAND,CAAA,UAAY,gBAAgB,EAAA;AAC1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