@dbg-riskit/angular-file 16.0.0 → 16.0.2
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/lib/abstract.file.download.directive.mjs +3 -9
- package/esm2022/lib/abstract.file.upload.component.mjs +39 -29
- package/esm2022/lib/binary.file.upload.component.mjs +3 -4
- package/esm2022/lib/binary.file.upload.service.mjs +3 -3
- package/esm2022/lib/csv.file.download.directive.mjs +5 -8
- package/esm2022/lib/csv.file.upload.component.mjs +3 -6
- package/esm2022/lib/csv.file.upload.service.mjs +3 -3
- package/esm2022/lib/download.menu.component.mjs +7 -9
- package/esm2022/lib/file.download.directive.mjs +3 -6
- package/esm2022/lib/file.module.mjs +6 -6
- package/esm2022/lib/file.size.pipe.mjs +5 -6
- package/esm2022/lib/text.file.upload.component.mjs +3 -4
- package/esm2022/lib/text.file.upload.service.mjs +3 -3
- package/fesm2022/dbg-riskit-angular-file.mjs +73 -83
- package/fesm2022/dbg-riskit-angular-file.mjs.map +1 -1
- package/lib/abstract.file.upload.component.d.ts +5 -2
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, Directive, Input, EventEmitter, Output, ViewChild, Injectable, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
2
|
+
import { Pipe, Directive, Input, EventEmitter, ElementRef, Output, ViewChild, Injectable, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@dbg-riskit/angular-view';
|
|
4
4
|
import { BaseComponent, CommonViewModule } from '@dbg-riskit/angular-view';
|
|
5
5
|
import * as i3 from '@dbg-riskit/common';
|
|
@@ -10,17 +10,17 @@ import { takeUntil, take, map, tap, filter, catchError, finalize, first, switchM
|
|
|
10
10
|
import * as i2 from '@angular/common';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
12
|
import * as i3$1 from '@angular/material/button';
|
|
13
|
+
import { MatAnchor } from '@angular/material/button';
|
|
13
14
|
import * as i4 from '@angular/material/icon';
|
|
14
15
|
import * as i3$2 from '@angular/material/menu';
|
|
15
16
|
import * as i4$1 from '@angular/material/tooltip';
|
|
16
17
|
import { LoggingModule } from '@dbg-riskit/angular-logging';
|
|
17
18
|
|
|
18
19
|
class FileSizePipe {
|
|
19
|
-
decimalPipe;
|
|
20
|
-
base = 1024;
|
|
21
|
-
powerSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
22
20
|
constructor(decimalPipe) {
|
|
23
21
|
this.decimalPipe = decimalPipe;
|
|
22
|
+
this.base = 1024;
|
|
23
|
+
this.powerSuffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
24
24
|
}
|
|
25
25
|
transform(value) {
|
|
26
26
|
if (value == null) {
|
|
@@ -39,8 +39,8 @@ class FileSizePipe {
|
|
|
39
39
|
const suffix = this.powerSuffixes[power];
|
|
40
40
|
return suffix ? `${formatted}${suffix}` : formatted;
|
|
41
41
|
}
|
|
42
|
-
static
|
|
43
|
-
static
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSizePipe, deps: [{ token: i2.DecimalPipe }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
43
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FileSizePipe, name: "riskFileSize" }); }
|
|
44
44
|
}
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSizePipe, decorators: [{
|
|
46
46
|
type: Pipe,
|
|
@@ -48,12 +48,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
48
48
|
}], ctorParameters: function () { return [{ type: i2.DecimalPipe }]; } });
|
|
49
49
|
|
|
50
50
|
class AbstractFileDownloadDirective extends BaseComponent {
|
|
51
|
-
elementRef;
|
|
52
|
-
dialogService;
|
|
53
|
-
fileSizePipe;
|
|
54
|
-
logger;
|
|
55
|
-
disabled;
|
|
56
|
-
data;
|
|
57
51
|
constructor(elementRef, dialogService, fileSizePipe, logger) {
|
|
58
52
|
super();
|
|
59
53
|
this.elementRef = elementRef;
|
|
@@ -173,8 +167,8 @@ class AbstractFileDownloadDirective extends BaseComponent {
|
|
|
173
167
|
createBlob(data, contentType) {
|
|
174
168
|
return new Blob(data, contentType);
|
|
175
169
|
}
|
|
176
|
-
static
|
|
177
|
-
static
|
|
170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractFileDownloadDirective, deps: [{ token: i0.ElementRef }, { token: i1.DialogService }, { token: FileSizePipe }, { token: i3.Logger }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
171
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AbstractFileDownloadDirective, inputs: { disabled: "disabled" }, usesInheritance: true, ngImport: i0 }); }
|
|
178
172
|
}
|
|
179
173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractFileDownloadDirective, decorators: [{
|
|
180
174
|
type: Directive
|
|
@@ -183,41 +177,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
183
177
|
}] } });
|
|
184
178
|
|
|
185
179
|
class AbstractFileUploadComponent extends BaseComponent {
|
|
186
|
-
renderer;
|
|
187
|
-
error = new EventEmitter(true);
|
|
188
|
-
label;
|
|
189
|
-
accept;
|
|
190
|
-
multiple = true;
|
|
191
|
-
filesLoaded = new EventEmitter(true);
|
|
192
|
-
fileInput;
|
|
193
|
-
wrapper;
|
|
194
|
-
fileInputHidden = false;
|
|
195
|
-
raised = true;
|
|
196
|
-
color = 'primary';
|
|
197
|
-
icon;
|
|
198
|
-
disabled = false;
|
|
199
180
|
constructor(renderer) {
|
|
200
181
|
super();
|
|
201
182
|
this.renderer = renderer;
|
|
183
|
+
this.error = new EventEmitter(true);
|
|
184
|
+
this.multiple = true;
|
|
185
|
+
this.filesLoaded = new EventEmitter(true);
|
|
186
|
+
this.offset = 0;
|
|
187
|
+
this.fileInputHidden = false;
|
|
188
|
+
this.raised = true;
|
|
189
|
+
this.color = 'primary';
|
|
190
|
+
this.disabled = false;
|
|
191
|
+
}
|
|
192
|
+
ngAfterViewInit() {
|
|
193
|
+
this.offset = this.wrapper.nativeElement.getBoundingClientRect().left
|
|
194
|
+
- this.anchor.nativeElement.getBoundingClientRect().left
|
|
195
|
+
+ (this.wrapper.nativeElement.getBoundingClientRect().width / 2);
|
|
202
196
|
}
|
|
203
197
|
move(event) {
|
|
204
|
-
if (this.fileInput && event.target !== this.fileInput.nativeElement) {
|
|
205
|
-
|
|
198
|
+
if (this.fileInput && event.target !== this.fileInput.nativeElement && this.anchor) {
|
|
199
|
+
const diff = event.target?.getBoundingClientRect().left
|
|
200
|
+
- event.currentTarget?.getBoundingClientRect().left
|
|
201
|
+
- this.offset;
|
|
202
|
+
this.renderer.setStyle(this.wrapper.nativeElement, 'left', `${event.offsetX + diff}px`);
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
205
|
handleFiles(fileList) {
|
|
209
206
|
// Check for the various File API support.
|
|
210
207
|
if ('FileReader' in window) {
|
|
211
|
-
this.readFiles(fileList).pipe(takeUntil(this.destroyed), first()).subscribe(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
208
|
+
this.readFiles(fileList).pipe(takeUntil(this.destroyed), first()).subscribe({
|
|
209
|
+
next: (files) => {
|
|
210
|
+
this.filesLoaded.emit(files);
|
|
211
|
+
this.resetInputField();
|
|
212
|
+
},
|
|
213
|
+
error: (error) => {
|
|
214
|
+
this.error.emit({
|
|
215
|
+
message: toString(error),
|
|
216
|
+
errorType: ErrorType.ERROR,
|
|
217
|
+
status: 0
|
|
218
|
+
});
|
|
219
|
+
this.resetInputField();
|
|
220
|
+
}
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
@@ -236,8 +236,8 @@ class AbstractFileUploadComponent extends BaseComponent {
|
|
|
236
236
|
this.fileInputHidden = false;
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
static
|
|
240
|
-
static
|
|
239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractFileUploadComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
240
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AbstractFileUploadComponent, inputs: { label: "label", accept: "accept", multiple: "multiple", raised: "raised", color: "color", icon: "icon", disabled: "disabled" }, outputs: { error: "error", filesLoaded: "filesLoaded" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: MatAnchor, descendants: true, read: ElementRef }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }], usesInheritance: true, ngImport: i0 }); }
|
|
241
241
|
}
|
|
242
242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractFileUploadComponent, decorators: [{
|
|
243
243
|
type: Directive
|
|
@@ -251,6 +251,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
251
251
|
type: Input
|
|
252
252
|
}], filesLoaded: [{
|
|
253
253
|
type: Output
|
|
254
|
+
}], anchor: [{
|
|
255
|
+
type: ViewChild,
|
|
256
|
+
args: [MatAnchor, { read: ElementRef }]
|
|
254
257
|
}], fileInput: [{
|
|
255
258
|
type: ViewChild,
|
|
256
259
|
args: ['fileInput']
|
|
@@ -297,15 +300,14 @@ class BinaryFileUploadService {
|
|
|
297
300
|
}
|
|
298
301
|
return forkJoin(fileOservables);
|
|
299
302
|
}
|
|
300
|
-
static
|
|
301
|
-
static
|
|
303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BinaryFileUploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
304
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BinaryFileUploadService }); }
|
|
302
305
|
}
|
|
303
306
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BinaryFileUploadService, decorators: [{
|
|
304
307
|
type: Injectable
|
|
305
308
|
}] });
|
|
306
309
|
|
|
307
310
|
class BinaryFileUploadComponent extends AbstractFileUploadComponent {
|
|
308
|
-
fileUploadService;
|
|
309
311
|
constructor(fileUploadService, renderer) {
|
|
310
312
|
super(renderer);
|
|
311
313
|
this.fileUploadService = fileUploadService;
|
|
@@ -313,8 +315,8 @@ class BinaryFileUploadComponent extends AbstractFileUploadComponent {
|
|
|
313
315
|
readFiles(fileList) {
|
|
314
316
|
return this.fileUploadService.readFiles(fileList);
|
|
315
317
|
}
|
|
316
|
-
static
|
|
317
|
-
static
|
|
318
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BinaryFileUploadComponent, deps: [{ token: BinaryFileUploadService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BinaryFileUploadComponent, selector: "risk-binary-file-upload", host: { properties: { "class.risk-binary-file-upload": "true" } }, usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"raised; else notRaised\"\n mat-raised-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n</a>\n<ng-template #notRaised>\n <a mat-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n </a>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:inline-block}a{overflow:hidden}a .risk-file-upload-input-wrapper{width:30px;height:36px;margin-left:-15px;top:0;left:0;position:absolute;overflow:hidden;cursor:pointer;z-index:1}a .risk-file-upload-input-wrapper input{position:absolute;display:block;cursor:pointer;height:36px;font-size:36px;top:0;right:0;outline:0 none;opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
318
320
|
}
|
|
319
321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BinaryFileUploadComponent, decorators: [{
|
|
320
322
|
type: Component,
|
|
@@ -324,14 +326,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
324
326
|
}], ctorParameters: function () { return [{ type: BinaryFileUploadService }, { type: i0.Renderer2 }]; } });
|
|
325
327
|
|
|
326
328
|
class CSVFileDownloadDirective extends AbstractFileDownloadDirective {
|
|
327
|
-
dateFormatter;
|
|
328
|
-
columns;
|
|
329
|
-
data;
|
|
330
|
-
filename = 'data.csv';
|
|
331
|
-
crlfLineEnding = false;
|
|
332
329
|
constructor(dateFormatter, elementRef, dialogService, fileSizePipe, logger) {
|
|
333
330
|
super(elementRef, dialogService, fileSizePipe, logger);
|
|
334
331
|
this.dateFormatter = dateFormatter;
|
|
332
|
+
this.filename = 'data.csv';
|
|
333
|
+
this.crlfLineEnding = false;
|
|
335
334
|
}
|
|
336
335
|
mapToFile(data) {
|
|
337
336
|
let csvFile = '';
|
|
@@ -376,8 +375,8 @@ class CSVFileDownloadDirective extends AbstractFileDownloadDirective {
|
|
|
376
375
|
}
|
|
377
376
|
return '\n';
|
|
378
377
|
}
|
|
379
|
-
static
|
|
380
|
-
static
|
|
378
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileDownloadDirective, deps: [{ token: i1.DateFormatter }, { token: i0.ElementRef }, { token: i1.DialogService }, { token: FileSizePipe }, { token: i3.Logger }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
379
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CSVFileDownloadDirective, selector: "[risk-csv-download]", inputs: { columns: ["risk-csv-download-columns", "columns"], data: ["risk-csv-download", "data"], filename: ["risk-csv-download-filename", "filename"], crlfLineEnding: ["risk-csv-download-crlf", "crlfLineEnding"] }, host: { listeners: { "click": "download()" }, properties: { "class.risk-csv-download": "true" } }, usesInheritance: true, ngImport: i0 }); }
|
|
381
380
|
}
|
|
382
381
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileDownloadDirective, decorators: [{
|
|
383
382
|
type: Directive,
|
|
@@ -500,17 +499,14 @@ class CSVFileUploadService {
|
|
|
500
499
|
}
|
|
501
500
|
};
|
|
502
501
|
}
|
|
503
|
-
static
|
|
504
|
-
static
|
|
502
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileUploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
503
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileUploadService }); }
|
|
505
504
|
}
|
|
506
505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileUploadService, decorators: [{
|
|
507
506
|
type: Injectable
|
|
508
507
|
}] });
|
|
509
508
|
|
|
510
509
|
class CSVFileUploadComponent extends AbstractFileUploadComponent {
|
|
511
|
-
fileUploadService;
|
|
512
|
-
validator;
|
|
513
|
-
nameMapper;
|
|
514
510
|
constructor(fileUploadService, renderer) {
|
|
515
511
|
super(renderer);
|
|
516
512
|
this.fileUploadService = fileUploadService;
|
|
@@ -534,8 +530,8 @@ class CSVFileUploadComponent extends AbstractFileUploadComponent {
|
|
|
534
530
|
}
|
|
535
531
|
}));
|
|
536
532
|
}
|
|
537
|
-
static
|
|
538
|
-
static
|
|
533
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileUploadComponent, deps: [{ token: CSVFileUploadService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
534
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CSVFileUploadComponent, selector: "risk-csv-file-upload", inputs: { validator: "validator", nameMapper: "nameMapper" }, host: { properties: { "class.risk-csv-file-upload": "true" } }, usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"raised; else notRaised\"\n mat-raised-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n</a>\n<ng-template #notRaised>\n <a mat-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n </a>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:inline-block}a{overflow:hidden}a .risk-file-upload-input-wrapper{width:30px;height:36px;margin-left:-15px;top:0;left:0;position:absolute;overflow:hidden;cursor:pointer;z-index:1}a .risk-file-upload-input-wrapper input{position:absolute;display:block;cursor:pointer;height:36px;font-size:36px;top:0;right:0;outline:0 none;opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
539
535
|
}
|
|
540
536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVFileUploadComponent, decorators: [{
|
|
541
537
|
type: Component,
|
|
@@ -578,15 +574,14 @@ class TextFileUploadService {
|
|
|
578
574
|
}
|
|
579
575
|
return forkJoin(fileOservables);
|
|
580
576
|
}
|
|
581
|
-
static
|
|
582
|
-
static
|
|
577
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextFileUploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
578
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextFileUploadService }); }
|
|
583
579
|
}
|
|
584
580
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextFileUploadService, decorators: [{
|
|
585
581
|
type: Injectable
|
|
586
582
|
}] });
|
|
587
583
|
|
|
588
584
|
class TextFileUploadComponent extends AbstractFileUploadComponent {
|
|
589
|
-
fileUploadService;
|
|
590
585
|
constructor(fileUploadService, renderer) {
|
|
591
586
|
super(renderer);
|
|
592
587
|
this.fileUploadService = fileUploadService;
|
|
@@ -595,8 +590,8 @@ class TextFileUploadComponent extends AbstractFileUploadComponent {
|
|
|
595
590
|
return this.fileUploadService
|
|
596
591
|
.readFiles(fileList);
|
|
597
592
|
}
|
|
598
|
-
static
|
|
599
|
-
static
|
|
593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextFileUploadComponent, deps: [{ token: TextFileUploadService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
594
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TextFileUploadComponent, selector: "risk-text-file-upload", host: { properties: { "class.risk-text-file-upload": "true" } }, usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"raised; else notRaised\"\n mat-raised-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n</a>\n<ng-template #notRaised>\n <a mat-button\n [disabled]=\"disabled\"\n [color]=\"color\"\n (mousemove)=\"move($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n <div #wrapper\n class=\"risk-file-upload-input-wrapper\">\n <input *ngIf=\"!fileInputHidden\" type=\"file\"\n id=\"fileInput\"\n #fileInput\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n title=\"\"\n (change)=\"handleFiles($event.target.files)\"\n [accept]=\"accept\">\n </div>\n </a>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:inline-block}a{overflow:hidden}a .risk-file-upload-input-wrapper{width:30px;height:36px;margin-left:-15px;top:0;left:0;position:absolute;overflow:hidden;cursor:pointer;z-index:1}a .risk-file-upload-input-wrapper input{position:absolute;display:block;cursor:pointer;height:36px;font-size:36px;top:0;right:0;outline:0 none;opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
600
595
|
}
|
|
601
596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextFileUploadComponent, decorators: [{
|
|
602
597
|
type: Component,
|
|
@@ -606,14 +601,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
606
601
|
}], ctorParameters: function () { return [{ type: TextFileUploadService }, { type: i0.Renderer2 }]; } });
|
|
607
602
|
|
|
608
603
|
class CSVDownloadMenuComponent {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
filename;
|
|
615
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVDownloadMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
616
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CSVDownloadMenuComponent, selector: "risk-download-menu", inputs: { menuLabel: "menuLabel", menuTooltip: "menuTooltip", columns: "columns", data: "data", disabled: "disabled", filename: "filename" }, host: { properties: { "class.risk-download-menu": "true" } }, ngImport: i0, template: "<mat-menu #downloadMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <a mat-menu-item\n [risk-csv-download]=\"data\"\n [risk-csv-download-columns]=\"columns\"\n [risk-csv-download-filename]=\"filename\"\n [risk-csv-download-crlf]=\"true\">\n As CSV file (Windows)\n </a>\n <a mat-menu-item\n [risk-csv-download]=\"data\"\n [risk-csv-download-columns]=\"columns\"\n [risk-csv-download-filename]=\"filename\">\n As CSV file (Unix)\n </a>\n</mat-menu>\n\n<button mat-button\n #menu=\"matMenuTrigger\"\n [disabled]=\"disabled\"\n [matMenuTriggerFor]=\"downloadMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n [matTooltip]=\"menuTooltip\">\n <mat-icon>file_download</mat-icon>\n {{ menuLabel }}\n</button>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:inline-block}\n"], dependencies: [{ kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: CSVFileDownloadDirective, selector: "[risk-csv-download]", inputs: ["risk-csv-download-columns", "risk-csv-download", "risk-csv-download-filename", "risk-csv-download-crlf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
604
|
+
constructor() {
|
|
605
|
+
this.menuLabel = 'Download';
|
|
606
|
+
this.disabled = false;
|
|
607
|
+
}
|
|
608
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVDownloadMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
609
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CSVDownloadMenuComponent, selector: "risk-download-menu", inputs: { menuLabel: "menuLabel", menuTooltip: "menuTooltip", columns: "columns", data: "data", disabled: "disabled", filename: "filename" }, host: { properties: { "class.risk-download-menu": "true" } }, ngImport: i0, template: "<mat-menu #downloadMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <a mat-menu-item\n [risk-csv-download]=\"data\"\n [risk-csv-download-columns]=\"columns\"\n [risk-csv-download-filename]=\"filename\"\n [risk-csv-download-crlf]=\"true\">\n As CSV file (Windows)\n </a>\n <a mat-menu-item\n [risk-csv-download]=\"data\"\n [risk-csv-download-columns]=\"columns\"\n [risk-csv-download-filename]=\"filename\">\n As CSV file (Unix)\n </a>\n</mat-menu>\n\n<button mat-button\n #menu=\"matMenuTrigger\"\n [disabled]=\"disabled\"\n [matMenuTriggerFor]=\"downloadMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n [matTooltip]=\"menuTooltip\">\n <mat-icon>file_download</mat-icon>\n {{ menuLabel }}\n</button>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:inline-block}\n"], dependencies: [{ kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: CSVFileDownloadDirective, selector: "[risk-csv-download]", inputs: ["risk-csv-download-columns", "risk-csv-download", "risk-csv-download-filename", "risk-csv-download-crlf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
617
610
|
}
|
|
618
611
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CSVDownloadMenuComponent, decorators: [{
|
|
619
612
|
type: Component,
|
|
@@ -635,9 +628,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
635
628
|
}] } });
|
|
636
629
|
|
|
637
630
|
class FileDownloadDirective extends AbstractFileDownloadDirective {
|
|
638
|
-
data;
|
|
639
|
-
contentType;
|
|
640
|
-
filename;
|
|
641
631
|
constructor(elementRef, dialogService, fileSizePipe, logger) {
|
|
642
632
|
super(elementRef, dialogService, fileSizePipe, logger);
|
|
643
633
|
}
|
|
@@ -661,8 +651,8 @@ class FileDownloadDirective extends AbstractFileDownloadDirective {
|
|
|
661
651
|
filename
|
|
662
652
|
};
|
|
663
653
|
}
|
|
664
|
-
static
|
|
665
|
-
static
|
|
654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDownloadDirective, deps: [{ token: i0.ElementRef }, { token: i1.DialogService }, { token: FileSizePipe }, { token: i3.Logger }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
655
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FileDownloadDirective, selector: "[risk-download]", inputs: { data: ["risk-download", "data"], contentType: ["risk-download-content-type", "contentType"], filename: ["risk-download-filename", "filename"] }, host: { listeners: { "click": "download()" }, properties: { "class.risk-download": "true" } }, usesInheritance: true, ngImport: i0 }); }
|
|
666
656
|
}
|
|
667
657
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDownloadDirective, decorators: [{
|
|
668
658
|
type: Directive,
|
|
@@ -685,8 +675,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
685
675
|
}] } });
|
|
686
676
|
|
|
687
677
|
class FileModule {
|
|
688
|
-
static
|
|
689
|
-
static
|
|
678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
679
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FileModule, declarations: [BinaryFileUploadComponent,
|
|
690
680
|
CSVFileUploadComponent,
|
|
691
681
|
TextFileUploadComponent,
|
|
692
682
|
CSVFileDownloadDirective,
|
|
@@ -700,15 +690,15 @@ class FileModule {
|
|
|
700
690
|
CSVFileDownloadDirective,
|
|
701
691
|
CSVDownloadMenuComponent,
|
|
702
692
|
FileDownloadDirective,
|
|
703
|
-
FileSizePipe] });
|
|
704
|
-
static
|
|
693
|
+
FileSizePipe] }); }
|
|
694
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModule, providers: [
|
|
705
695
|
BinaryFileUploadService,
|
|
706
696
|
CSVFileUploadService,
|
|
707
697
|
TextFileUploadService,
|
|
708
698
|
FileSizePipe
|
|
709
699
|
], imports: [CommonModule,
|
|
710
700
|
CommonViewModule,
|
|
711
|
-
LoggingModule] });
|
|
701
|
+
LoggingModule] }); }
|
|
712
702
|
}
|
|
713
703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModule, decorators: [{
|
|
714
704
|
type: NgModule,
|