cmat 0.0.84 → 0.0.85
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/fesm2022/cmat-components-custom-formly.mjs +1 -2
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +23 -10
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat.mjs +24 -12
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +16 -16
- package/types/cmat-components-upload.d.ts +49 -51
- package/types/cmat.d.ts +36 -38
|
@@ -136,6 +136,10 @@ class CmatUploadComponent {
|
|
|
136
136
|
get fileType() {
|
|
137
137
|
return CmatUtilsService.getFileType(this.file.type);
|
|
138
138
|
}
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
140
|
+
get fileSize() {
|
|
141
|
+
return Number(this.file.size);
|
|
142
|
+
}
|
|
139
143
|
ngOnInit() {
|
|
140
144
|
if (this.autoUpload && this.id === null) {
|
|
141
145
|
this.upload();
|
|
@@ -150,12 +154,13 @@ class CmatUploadComponent {
|
|
|
150
154
|
fileCategory: this.fileCategory,
|
|
151
155
|
isPublic: this.isPublic,
|
|
152
156
|
filePath: this.filePath,
|
|
153
|
-
fileType:
|
|
154
|
-
data: this.
|
|
157
|
+
fileType: this.fileType,
|
|
158
|
+
data: this._file
|
|
155
159
|
};
|
|
156
|
-
fileModel.fileType = this.fileType;
|
|
157
160
|
const formData = new FormData();
|
|
158
|
-
|
|
161
|
+
if (this._file.data) {
|
|
162
|
+
formData.set(this.fileAlias, this._file.data, this._file.fileName);
|
|
163
|
+
}
|
|
159
164
|
formData.append('fileInfo', JSON.stringify(fileModel));
|
|
160
165
|
this._fileService.uploadFile(formData).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
|
|
161
166
|
if (event.type === HttpEventType.UploadProgress && typeof event.total === 'number') {
|
|
@@ -187,11 +192,11 @@ class CmatUploadComponent {
|
|
|
187
192
|
this.removeEvent.emit(this);
|
|
188
193
|
}
|
|
189
194
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
190
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadComponent, isStandalone: true, selector: "cmat-upload", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", editMode: "editMode", autoUpload: "autoUpload", id: "id", file: "file" }, outputs: { removeEvent: "removeEvent", uploadEvent: "uploadEvent" }, exportAs: ["cmatUpload"], ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\"
|
|
195
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadComponent, isStandalone: true, selector: "cmat-upload", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", editMode: "editMode", autoUpload: "autoUpload", id: "id", file: "file" }, outputs: { removeEvent: "removeEvent", uploadEvent: "uploadEvent" }, exportAs: ["cmatUpload"], ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\" [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{fileSize |\r\n cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i3$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: CmatBytesPipe, name: "cmatBytes" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
191
196
|
}
|
|
192
197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadComponent, decorators: [{
|
|
193
198
|
type: Component,
|
|
194
|
-
args: [{ selector: 'cmat-upload', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUpload', imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe, NgClass], template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\"
|
|
199
|
+
args: [{ selector: 'cmat-upload', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUpload', imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe, NgClass], template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\" [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{fileSize |\r\n cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>" }]
|
|
195
200
|
}], propDecorators: { fileAlias: [{
|
|
196
201
|
type: Input
|
|
197
202
|
}], filePath: [{
|
|
@@ -231,6 +236,7 @@ class CmatUploadQueueComponent {
|
|
|
231
236
|
this.outputFilesDataEvent = new EventEmitter();
|
|
232
237
|
this.id = 'cmatupload-' + crypto.randomUUID().slice(0, 8);
|
|
233
238
|
this.isHandSet = signal(false, ...(ngDevMode ? [{ debugName: "isHandSet" }] : /* istanbul ignore next */ []));
|
|
239
|
+
this.fileDataSource = signal([], ...(ngDevMode ? [{ debugName: "fileDataSource" }] : /* istanbul ignore next */ []));
|
|
234
240
|
this._cmatMediaWatcherService = inject(CmatMediaWatcherService);
|
|
235
241
|
this._elementRef = inject(ElementRef);
|
|
236
242
|
this._destroyRef = inject(DestroyRef);
|
|
@@ -254,6 +260,11 @@ class CmatUploadQueueComponent {
|
|
|
254
260
|
onDropOver(event) {
|
|
255
261
|
event.preventDefault();
|
|
256
262
|
}
|
|
263
|
+
ngOnChanges(changes) {
|
|
264
|
+
if (changes['filesData']) {
|
|
265
|
+
this.fileDataSource.set(this.filesData);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
257
268
|
ngAfterViewInit() {
|
|
258
269
|
const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);
|
|
259
270
|
if (!(fileUpload instanceof HTMLInputElement)) {
|
|
@@ -280,11 +291,12 @@ class CmatUploadQueueComponent {
|
|
|
280
291
|
this.filesData = [...this.filesData, file];
|
|
281
292
|
this.fileUploads.first.remove();
|
|
282
293
|
}
|
|
294
|
+
this.fileDataSource.set(this.filesData);
|
|
283
295
|
}
|
|
284
296
|
upload(event) {
|
|
285
|
-
|
|
286
|
-
this.outputUploadIdEvent.emit(uploadId ?? '');
|
|
297
|
+
this.outputUploadIdEvent.emit(event.id ?? '');
|
|
287
298
|
this.outputFilesDataEvent.emit(this.filesData);
|
|
299
|
+
this.fileDataSource.set(this.filesData);
|
|
288
300
|
}
|
|
289
301
|
remove(event) {
|
|
290
302
|
if (this.filesData) {
|
|
@@ -295,6 +307,7 @@ class CmatUploadQueueComponent {
|
|
|
295
307
|
this.outputRemoveIdEvent.emit(event.file.id);
|
|
296
308
|
}
|
|
297
309
|
this.outputFilesDataEvent.emit(this.filesData);
|
|
310
|
+
this.fileDataSource.set(this.filesData);
|
|
298
311
|
}
|
|
299
312
|
}
|
|
300
313
|
}
|
|
@@ -325,11 +338,11 @@ class CmatUploadQueueComponent {
|
|
|
325
338
|
});
|
|
326
339
|
}
|
|
327
340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadQueueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
328
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadQueueComponent, isStandalone: true, selector: "cmat-upload-queue", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", required: "required", autoUpload: "autoUpload", multiple: "multiple", accept: "accept", title: "title", editMode: "editMode", filesData: "filesData" }, outputs: { outputRemoveIdEvent: "outputRemoveIdEvent", outputUploadIdEvent: "outputUploadIdEvent", outputFilesDataEvent: "outputFilesDataEvent" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDropOver($event)" } }, viewQueries: [{ propertyName: "fileUploads", predicate: i0.forwardRef(() => CmatUploadComponent), descendants: true }], exportAs: ["cmatUploadQueue"], ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(
|
|
341
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadQueueComponent, isStandalone: true, selector: "cmat-upload-queue", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", required: "required", autoUpload: "autoUpload", multiple: "multiple", accept: "accept", title: "title", editMode: "editMode", filesData: "filesData" }, outputs: { outputRemoveIdEvent: "outputRemoveIdEvent", outputUploadIdEvent: "outputUploadIdEvent", outputFilesDataEvent: "outputFilesDataEvent" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDropOver($event)" } }, viewQueries: [{ propertyName: "fileUploads", predicate: i0.forwardRef(() => CmatUploadComponent), descendants: true }], exportAs: ["cmatUploadQueue"], usesOnChanges: true, ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">\u4E0A\u4F20\u5168\u90E8</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">\u5220\u9664\u5168\u90E8</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of fileDataSource(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n", dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: CmatUploadComponent, selector: "cmat-upload", inputs: ["fileAlias", "filePath", "fileCategory", "isPublic", "editMode", "autoUpload", "id", "file"], outputs: ["removeEvent", "uploadEvent"], exportAs: ["cmatUpload"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
329
342
|
}
|
|
330
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadQueueComponent, decorators: [{
|
|
331
344
|
type: Component,
|
|
332
|
-
args: [{ selector: 'cmat-upload-queue', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUploadQueue', imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent], template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(
|
|
345
|
+
args: [{ selector: 'cmat-upload-queue', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUploadQueue', imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent], template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">\u4E0A\u4F20\u5168\u90E8</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">\u5220\u9664\u5168\u90E8</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of fileDataSource(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n" }]
|
|
333
346
|
}], ctorParameters: () => [], propDecorators: { fileUploads: [{
|
|
334
347
|
type: ViewChildren,
|
|
335
348
|
args: [forwardRef(() => CmatUploadComponent)]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-upload.mjs","sources":["../../../projects/cmat/components/upload/files.util.service.ts","../../../projects/cmat/components/upload/upload.component.ts","../../../projects/cmat/components/upload/upload.component.html","../../../projects/cmat/components/upload/upload-queue/upload-queue.component.ts","../../../projects/cmat/components/upload/upload-queue/upload-queue.component.html","../../../projects/cmat/components/upload/cmat-components-upload.ts"],"sourcesContent":["import { HttpClient, HttpEvent, HttpResponse } from '@angular/common/http';\r\nimport { DestroyRef, Injectable, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { IUrlStateConfig, CmatUrlStateConfigService } from 'cmat/services/config';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { Observable, catchError, map, tap } from 'rxjs';\r\nimport { FileListModel } from './files.type';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatFilesUtilService {\r\n private _http = inject(HttpClient);\r\n private _urlStateConfigService = inject(CmatUrlStateConfigService);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n private _config: IUrlStateConfig;\r\n\r\n constructor() {\r\n this._urlStateConfigService.config$\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((config: IUrlStateConfig) => {\r\n this._config = config;\r\n });\r\n }\r\n\r\n downloadFile(fileId: string, isStream: boolean = true): Observable<HttpResponse<Blob>> {\r\n return this._http.get(`${this._config.fileUrl}/download/${fileId}`, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders(fileId),\r\n observe: 'response',\r\n reportProgress: true,\r\n responseType: 'blob',\r\n params: {\r\n isStream\r\n }\r\n },).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n downloadFileZip(fileIds?: string[]): Observable<HttpResponse<Blob>> {\r\n return this._http.post(`${this._config.fileUrl}/download`, fileIds, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileZip'),\r\n observe: 'response',\r\n reportProgress: true,\r\n responseType: 'blob',\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n uploadFile(file: FormData): Observable<HttpEvent<Record<string, unknown>>> {\r\n return this._http.post<Record<string, unknown>>(`${this._config.fileUrl}/upload`, file, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files'),\r\n observe: 'events',\r\n reportProgress: true,\r\n responseType: 'json'\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n uploadFileToProcessed(file: FormData): Observable<HttpEvent<Record<string, unknown>>> {\r\n return this._http.post<Record<string, unknown>>(`${this._config.fileUrl}/upload/finish`, file, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files'),\r\n observe: 'events',\r\n reportProgress: true,\r\n responseType: 'json'\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n switchPublic(fileId: string, isPublic: boolean): Observable<Record<string, unknown>> {\r\n return this._http.patch<Record<string, unknown>>(`${this._config.fileUrl}/switch-public/${fileId}`, {\r\n id: fileId,\r\n isPublic\r\n }, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files-switch-public')\r\n }).pipe(\r\n catchError((err): Observable<never> => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n\r\n deleteFile(fileId: string): Observable<Record<string, unknown>> {\r\n return this._http.delete<Record<string, unknown>>(`${this._config.fileUrl}/${fileId}`, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders(fileId)\r\n }).pipe(\r\n catchError((err): Observable<never> => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n\r\n getFileList(queryData: object, pageIndex: number = -1, pageSize: number = -1): Observable<FileListModel> {\r\n if (this._config.enableDataProtect) {\r\n return this._http.post(`${this._config.fileUrl}/${pageIndex}/${pageSize}`,\r\n CmatUtilsService.getEncryptData(JSON.stringify(queryData)),\r\n {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileList'),\r\n responseType: 'text'\r\n }\r\n )\r\n .pipe(\r\n map((res: string): FileListModel => JSON.parse(CmatUtilsService.getDecryptData(res)) as FileListModel),\r\n catchError(err => CmatUtilsService.handleError(err))\r\n );\r\n } else {\r\n return this._http.post<FileListModel>(`${this._config.fileUrl}/${pageIndex}/${pageSize}`, queryData, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileList'),\r\n responseType: 'json'\r\n })\r\n .pipe(\r\n tap((res: FileListModel) => res),\r\n catchError(err => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n }\r\n}","import { NgClass } from '@angular/common';\r\nimport { HttpEvent, HttpEventType, HttpResponse } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewEncapsulation,\r\n inject,\r\n signal,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { CmatBytesPipe } from 'cmat/pipes/bytes';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { saveAs } from 'file-saver-es';\r\nimport { FileModel } from './files.type';\r\nimport { CmatFilesUtilService } from './files.util.service';\r\n\r\ntype UploadFile = File & { id?: string | null };\r\n\r\n@Component({\r\n selector: 'cmat-upload',\r\n templateUrl: './upload.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatUpload',\r\n imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe, NgClass]\r\n})\r\nexport class CmatUploadComponent implements OnInit {\r\n @Input()\r\n fileAlias: string = 'fileData';\r\n\r\n @Input()\r\n filePath: string = '';\r\n\r\n @Input()\r\n fileCategory: string = '';\r\n\r\n @Input()\r\n isPublic: boolean = false;\r\n\r\n @Input()\r\n editMode: boolean = false;\r\n\r\n @Input() autoUpload = true;\r\n\r\n @Input()\r\n id: string | null = null;\r\n\r\n @Output() removeEvent = new EventEmitter<CmatUploadComponent>();\r\n @Output() uploadEvent = new EventEmitter<UploadFile>();\r\n\r\n readonly progressPercentage = signal(0);\r\n readonly loaded = signal(0);\r\n readonly total = signal(0);\r\n readonly isUploading = signal(false);\r\n\r\n private _fileService = inject(CmatFilesUtilService);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n private _file: UploadFile;\r\n\r\n @Input()\r\n get file(): UploadFile {\r\n return this._file;\r\n }\r\n set file(file: UploadFile) {\r\n this._file = file;\r\n this.total.set(this._file.size);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get fileType(): 'csv' | 'gif' | 'word' | 'excel' | 'jpg' | 'outlook' | 'pdf' | 'png' | 'ppt' | 'file' | 'text' | 'video' | 'zip' {\r\n return CmatUtilsService.getFileType(this.file.type);\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.autoUpload && this.id === null) {\r\n this.upload();\r\n }\r\n }\r\n\r\n\r\n upload(): void {\r\n this.isUploading.set(true);\r\n const fileModel = {\r\n id: null,\r\n fileName: this.file.name,\r\n length: this.file.size,\r\n fileCategory: this.fileCategory,\r\n isPublic: this.isPublic,\r\n filePath: this.filePath,\r\n fileType: 'file',\r\n data: this.file\r\n } as FileModel;\r\n\r\n fileModel.fileType = this.fileType;\r\n\r\n const formData = new FormData();\r\n\r\n formData.set('fileData', this._file, this._file.name);\r\n formData.append('fileInfo', JSON.stringify(fileModel));\r\n\r\n this._fileService.uploadFile(formData).pipe(\r\n takeUntilDestroyed(this._destroyRef)\r\n ).subscribe((event: HttpEvent<Record<string, unknown>>) => {\r\n if (event.type === HttpEventType.UploadProgress && typeof event.total === 'number') {\r\n this.progressPercentage.set(Math.floor(event.loaded * 100 / event.total));\r\n this.loaded.set(event.loaded);\r\n this.total.set(event.total);\r\n }\r\n if (event.type === HttpEventType.Response) {\r\n const fileId = typeof event.body?.id === 'string' ? event.body.id : undefined;\r\n if (!fileId) {\r\n this.isUploading.set(false);\r\n return;\r\n }\r\n\r\n this.id = fileId;\r\n this.file.id = fileId;\r\n\r\n this.isUploading.set(false);\r\n\r\n this.uploadEvent.emit(this.file);\r\n }\r\n });\r\n }\r\n\r\n download(): void {\r\n if (!this.id) return;\r\n this._fileService.downloadFile(this.id).pipe(\r\n takeUntilDestroyed(this._destroyRef)\r\n ).subscribe((file: HttpResponse<Blob>) => {\r\n saveAs(new Blob([file.body ?? new Blob()], { type: 'text/plain;charset=utf-8' }), this.file.name);\r\n });\r\n }\r\n\r\n remove(): void {\r\n this.removeEvent.emit(this);\r\n }\r\n}","<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\"\r\n [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{file.size | cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>\r\n","import { AfterViewInit, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, EventEmitter, HostListener, Input, Output, QueryList, ViewChildren, ViewEncapsulation, forwardRef, inject, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { CmatMediaWatcherService } from 'cmat/services/media-watcher';\r\nimport { CmatUploadComponent } from '../upload.component';\r\n\r\nexport type UploadQueueFile = File & { id?: string | null };\r\n\r\n@Component({\r\n selector: 'cmat-upload-queue',\r\n templateUrl: './upload-queue.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatUploadQueue',\r\n imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent]\r\n})\r\nexport class CmatUploadQueueComponent implements AfterViewInit {\r\n @ViewChildren(forwardRef(() => CmatUploadComponent)) fileUploads: QueryList<CmatUploadComponent>;\r\n @Input()\r\n fileAlias: string = 'fileData';\r\n\r\n @Input()\r\n filePath: string = '';\r\n @Input()\r\n fileCategory: string;\r\n\r\n @Input()\r\n isPublic: boolean = false;\r\n\r\n @Input()\r\n required: boolean = false;\r\n\r\n @Input()\r\n autoUpload: boolean = true;\r\n\r\n @Input() multiple: boolean = true;\r\n @Input() accept: string = '';\r\n @Input() title: string = '附件';\r\n @Input() editMode: boolean = false;\r\n @Input()\r\n filesData: UploadQueueFile[] = [];\r\n\r\n @Output() outputRemoveIdEvent = new EventEmitter<string>();\r\n @Output() outputUploadIdEvent = new EventEmitter<string>();\r\n @Output() outputFilesDataEvent = new EventEmitter<UploadQueueFile[]>();\r\n\r\n public id = 'cmatupload-' + crypto.randomUUID().slice(0, 8);\r\n\r\n readonly isHandSet = signal(false);\r\n\r\n private _cmatMediaWatcherService = inject(CmatMediaWatcherService);\r\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n\r\n constructor() {\r\n this._cmatMediaWatcherService.onMediaChange$\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe(({ matchingAliases }): void => {\r\n this.isHandSet.set(!matchingAliases.includes('lg'));\r\n });\r\n }\r\n\r\n @HostListener('drop', ['$event'])\r\n onDrop(event: DragEvent): void {\r\n const files = event.dataTransfer?.files;\r\n\r\n if (!files) return;\r\n\r\n for (const file of files) {\r\n if (this.accept?.includes(file.type))\r\n this.add(file);\r\n }\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n\r\n @HostListener('dragover', ['$event'])\r\n onDropOver(event: DragEvent): void {\r\n event.preventDefault();\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);\r\n\r\n if (!(fileUpload instanceof HTMLInputElement)) {\r\n return;\r\n }\r\n\r\n fileUpload.onchange = (): void => {\r\n for (let index = 0; index < (fileUpload.files?.length ?? 0); index++) {\r\n const file = fileUpload.files![index];\r\n this.add(file);\r\n }\r\n };\r\n }\r\n\r\n add(file: UploadQueueFile): void {\r\n if (!this.isFileTypeAccepted(file.type)) {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(this.filesData)) {\r\n this.filesData = [];\r\n }\r\n\r\n if (!(!this.multiple && this.filesData.length > 0)) {\r\n this.filesData = [...this.filesData, file];\r\n } else if (this.fileUploads.first.id === null) {\r\n this.filesData = [...this.filesData, file];\r\n this.fileUploads.first.remove();\r\n }\r\n\r\n }\r\n\r\n upload(event: CmatUploadComponent | UploadQueueFile): void {\r\n const uploadId = event instanceof CmatUploadComponent ? event.id : event.id;\r\n this.outputUploadIdEvent.emit(uploadId ?? '');\r\n\r\n this.outputFilesDataEvent.emit(this.filesData);\r\n }\r\n\r\n remove(event: CmatUploadComponent): void {\r\n if (this.filesData) {\r\n const index = this.filesData.findIndex((j): boolean => j === event.file);\r\n if (index > -1) {\r\n this.filesData.splice(index, 1);\r\n if (event.file.id) {\r\n this.outputRemoveIdEvent.emit(event.file.id);\r\n }\r\n\r\n this.outputFilesDataEvent.emit(this.filesData);\r\n }\r\n\r\n }\r\n }\r\n\r\n uploadAll(): void {\r\n this.fileUploads.forEach((fileUpload): void => {\r\n if (fileUpload.id === null) {\r\n fileUpload.upload();\r\n }\r\n });\r\n\r\n }\r\n\r\n removeAll(): void {\r\n this.fileUploads.forEach((fileUpload): void => { fileUpload.remove() });\r\n }\r\n\r\n choose(): void {\r\n this._elementRef.nativeElement.querySelector(`#${this.id}`)?.dispatchEvent(new MouseEvent('click'));\r\n }\r\n\r\n private isFileTypeAccepted(fileType: string): boolean {\r\n if (!this.accept || this.accept === '') {\r\n return true;\r\n }\r\n\r\n const acceptedTypes = this.accept.split(',').map(type => type.trim());\r\n\r\n return acceptedTypes.some((type): boolean => {\r\n if (type.endsWith('/*')) {\r\n const prefix = type.slice(0, -1);\r\n return fileType.startsWith(prefix);\r\n }\r\n return fileType === type;\r\n });\r\n }\r\n}","<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">选择</span>\r\n </button>\r\n @if(filesData&&multiple&&filesData.length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">上传全部</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">删除全部</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(filesData&&multiple&&filesData.length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of filesData; track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i3","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAWa,oBAAoB,CAAA;AAO7B,IAAA,WAAA,GAAA;AANQ,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAC1B,QAAA,IAAA,CAAA,sBAAsB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACjD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QAK7C,IAAI,CAAC,sBAAsB,CAAC;AACvB,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;AACzC,aAAA,SAAS,CAAC,CAAC,MAAuB,KAAI;AACnC,YAAA,IAAI,CAAC,OAAO,GAAG,MAAM;AACzB,QAAA,CAAC,CAAC;IACV;AAEA,I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A,CAAA,aAAA,EAAA,QAAA,EAAA,sFAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,oLAAE,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,UAAA,EAAA,cAAA,EAAA,UAAA,EAAA,UAAA,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAElF,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBARpC,SAAS;+BACI,mBAAmB,EAAA,aAAA,EAEd,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,iBAAiB,WAClB,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,m7FAAA,EAAA;;sBAG3F,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,CAAC,MAAM,mBAAmB,CAAC;;sBAClD;;sBAGA;;sBAEA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAGA;;sBACA;;sBACA;;sBAmBA,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;sBAc/B,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;;AEhFxC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-upload.mjs","sources":["../../../projects/cmat/components/upload/files.util.service.ts","../../../projects/cmat/components/upload/upload.component.ts","../../../projects/cmat/components/upload/upload.component.html","../../../projects/cmat/components/upload/upload-queue/upload-queue.component.ts","../../../projects/cmat/components/upload/upload-queue/upload-queue.component.html","../../../projects/cmat/components/upload/cmat-components-upload.ts"],"sourcesContent":["import { HttpClient, HttpEvent, HttpResponse } from '@angular/common/http';\r\nimport { DestroyRef, Injectable, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { IUrlStateConfig, CmatUrlStateConfigService } from 'cmat/services/config';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { Observable, catchError, map, tap } from 'rxjs';\r\nimport { FileListModel } from './files.type';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatFilesUtilService {\r\n private _http = inject(HttpClient);\r\n private _urlStateConfigService = inject(CmatUrlStateConfigService);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n private _config: IUrlStateConfig;\r\n\r\n constructor() {\r\n this._urlStateConfigService.config$\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((config: IUrlStateConfig) => {\r\n this._config = config;\r\n });\r\n }\r\n\r\n downloadFile(fileId: string, isStream: boolean = true): Observable<HttpResponse<Blob>> {\r\n return this._http.get(`${this._config.fileUrl}/download/${fileId}`, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders(fileId),\r\n observe: 'response',\r\n reportProgress: true,\r\n responseType: 'blob',\r\n params: {\r\n isStream\r\n }\r\n },).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n downloadFileZip(fileIds?: string[]): Observable<HttpResponse<Blob>> {\r\n return this._http.post(`${this._config.fileUrl}/download`, fileIds, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileZip'),\r\n observe: 'response',\r\n reportProgress: true,\r\n responseType: 'blob',\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n uploadFile(file: FormData): Observable<HttpEvent<Record<string, unknown>>> {\r\n return this._http.post<Record<string, unknown>>(`${this._config.fileUrl}/upload`, file, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files'),\r\n observe: 'events',\r\n reportProgress: true,\r\n responseType: 'json'\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n uploadFileToProcessed(file: FormData): Observable<HttpEvent<Record<string, unknown>>> {\r\n return this._http.post<Record<string, unknown>>(`${this._config.fileUrl}/upload/finish`, file, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files'),\r\n observe: 'events',\r\n reportProgress: true,\r\n responseType: 'json'\r\n }).pipe(\r\n catchError(CmatUtilsService.handleError));\r\n }\r\n\r\n switchPublic(fileId: string, isPublic: boolean): Observable<Record<string, unknown>> {\r\n return this._http.patch<Record<string, unknown>>(`${this._config.fileUrl}/switch-public/${fileId}`, {\r\n id: fileId,\r\n isPublic\r\n }, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('files-switch-public')\r\n }).pipe(\r\n catchError((err): Observable<never> => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n\r\n deleteFile(fileId: string): Observable<Record<string, unknown>> {\r\n return this._http.delete<Record<string, unknown>>(`${this._config.fileUrl}/${fileId}`, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders(fileId)\r\n }).pipe(\r\n catchError((err): Observable<never> => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n\r\n getFileList(queryData: object, pageIndex: number = -1, pageSize: number = -1): Observable<FileListModel> {\r\n if (this._config.enableDataProtect) {\r\n return this._http.post(`${this._config.fileUrl}/${pageIndex}/${pageSize}`,\r\n CmatUtilsService.getEncryptData(JSON.stringify(queryData)),\r\n {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileList'),\r\n responseType: 'text'\r\n }\r\n )\r\n .pipe(\r\n map((res: string): FileListModel => JSON.parse(CmatUtilsService.getDecryptData(res)) as FileListModel),\r\n catchError(err => CmatUtilsService.handleError(err))\r\n );\r\n } else {\r\n return this._http.post<FileListModel>(`${this._config.fileUrl}/${pageIndex}/${pageSize}`, queryData, {\r\n headers: CmatUtilsService.getRequestCryptoHeaders('fileList'),\r\n responseType: 'json'\r\n })\r\n .pipe(\r\n tap((res: FileListModel) => res),\r\n catchError(err => CmatUtilsService.handleError(err))\r\n );\r\n }\r\n }\r\n}","import { NgClass } from '@angular/common';\r\nimport { HttpEvent, HttpEventType, HttpResponse } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewEncapsulation,\r\n inject,\r\n signal,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { CmatBytesPipe } from 'cmat/pipes/bytes';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { saveAs } from 'file-saver-es';\r\nimport { FileModel } from './files.type';\r\nimport { CmatFilesUtilService } from './files.util.service';\r\n\r\n@Component({\r\n selector: 'cmat-upload',\r\n templateUrl: './upload.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatUpload',\r\n imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe, NgClass]\r\n})\r\nexport class CmatUploadComponent implements OnInit {\r\n @Input()\r\n fileAlias: string = 'fileData';\r\n\r\n @Input()\r\n filePath: string = '';\r\n\r\n @Input()\r\n fileCategory: string = '';\r\n\r\n @Input()\r\n isPublic: boolean = false;\r\n\r\n @Input()\r\n editMode: boolean = false;\r\n\r\n @Input() autoUpload = true;\r\n\r\n @Input()\r\n id: string | null = null;\r\n\r\n @Output() removeEvent = new EventEmitter<CmatUploadComponent>();\r\n @Output() uploadEvent = new EventEmitter<FileModel>();\r\n\r\n readonly progressPercentage = signal(0);\r\n readonly loaded = signal(0);\r\n readonly total = signal(0);\r\n readonly isUploading = signal(false);\r\n\r\n private _fileService = inject(CmatFilesUtilService);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n private _file: FileModel;\r\n\r\n @Input()\r\n get file(): FileModel {\r\n return this._file;\r\n }\r\n\r\n set file(file: FileModel) {\r\n this._file = file;\r\n this.total.set(this._file.size as number);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get fileType(): 'csv' | 'gif' | 'word' | 'excel' | 'jpg' | 'outlook' | 'pdf' | 'png' | 'ppt' | 'file' | 'text' | 'video' | 'zip' {\r\n return CmatUtilsService.getFileType(this.file.type as string);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n get fileSize(): number {\r\n return Number(this.file.size);\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.autoUpload && this.id === null) {\r\n this.upload();\r\n }\r\n }\r\n\r\n\r\n upload(): void {\r\n this.isUploading.set(true);\r\n const fileModel = {\r\n id: null,\r\n fileName: this.file.name,\r\n length: this.file.size,\r\n fileCategory: this.fileCategory,\r\n isPublic: this.isPublic,\r\n filePath: this.filePath,\r\n fileType: this.fileType,\r\n data: this._file\r\n } as FileModel;\r\n\r\n\r\n const formData = new FormData();\r\n\r\n if (this._file.data) {\r\n formData.set(this.fileAlias, this._file.data as Blob, this._file.fileName);\r\n }\r\n\r\n formData.append('fileInfo', JSON.stringify(fileModel));\r\n\r\n this._fileService.uploadFile(formData).pipe(\r\n takeUntilDestroyed(this._destroyRef)\r\n ).subscribe((event: HttpEvent<Record<string, unknown>>) => {\r\n if (event.type === HttpEventType.UploadProgress && typeof event.total === 'number') {\r\n this.progressPercentage.set(Math.floor(event.loaded * 100 / event.total));\r\n this.loaded.set(event.loaded);\r\n this.total.set(event.total);\r\n }\r\n if (event.type === HttpEventType.Response) {\r\n const fileId = typeof event.body?.id === 'string' ? event.body.id : undefined;\r\n if (!fileId) {\r\n this.isUploading.set(false);\r\n return;\r\n }\r\n\r\n this.id = fileId;\r\n this.file.id = fileId;\r\n\r\n this.isUploading.set(false);\r\n\r\n this.uploadEvent.emit(this.file);\r\n }\r\n });\r\n }\r\n\r\n download(): void {\r\n if (!this.id) return;\r\n this._fileService.downloadFile(this.id).pipe(\r\n takeUntilDestroyed(this._destroyRef)\r\n ).subscribe((file: HttpResponse<Blob>) => {\r\n saveAs(new Blob([file.body ?? new Blob()], { type: 'text/plain;charset=utf-8' }), this.file.name as string);\r\n });\r\n }\r\n\r\n remove(): void {\r\n this.removeEvent.emit(this);\r\n }\r\n}","<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\" [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{fileSize |\r\n cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>","import { AfterViewInit, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output, QueryList, SimpleChanges, ViewChildren, ViewEncapsulation, forwardRef, inject, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { CmatMediaWatcherService } from 'cmat/services/media-watcher';\r\nimport { FileModel } from '../files.type';\r\nimport { CmatUploadComponent } from '../upload.component';\r\n\r\n@Component({\r\n selector: 'cmat-upload-queue',\r\n templateUrl: './upload-queue.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatUploadQueue',\r\n imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent]\r\n})\r\nexport class CmatUploadQueueComponent implements AfterViewInit, OnChanges {\r\n @ViewChildren(forwardRef(() => CmatUploadComponent)) fileUploads: QueryList<CmatUploadComponent>;\r\n @Input()\r\n fileAlias: string = 'fileData';\r\n\r\n @Input()\r\n filePath: string = '';\r\n @Input()\r\n fileCategory: string;\r\n\r\n @Input()\r\n isPublic: boolean = false;\r\n\r\n @Input()\r\n required: boolean = false;\r\n\r\n @Input()\r\n autoUpload: boolean = true;\r\n\r\n @Input() multiple: boolean = true;\r\n @Input() accept: string = '';\r\n @Input() title: string = '附件';\r\n @Input() editMode: boolean = false;\r\n @Input()\r\n filesData: FileModel[] = [];\r\n\r\n @Output() outputRemoveIdEvent = new EventEmitter<string>();\r\n @Output() outputUploadIdEvent = new EventEmitter<string>();\r\n @Output() outputFilesDataEvent = new EventEmitter<FileModel[]>();\r\n\r\n public id = 'cmatupload-' + crypto.randomUUID().slice(0, 8);\r\n\r\n readonly isHandSet = signal(false);\r\n readonly fileDataSource = signal<FileModel[]>([]);\r\n\r\n private _cmatMediaWatcherService = inject(CmatMediaWatcherService);\r\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n\r\n constructor() {\r\n this._cmatMediaWatcherService.onMediaChange$\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe(({ matchingAliases }): void => {\r\n this.isHandSet.set(!matchingAliases.includes('lg'));\r\n });\r\n }\r\n\r\n @HostListener('drop', ['$event'])\r\n onDrop(event: DragEvent): void {\r\n const files = event.dataTransfer?.files;\r\n\r\n if (!files) return;\r\n\r\n for (const file of files) {\r\n if (this.accept?.includes(file.type))\r\n this.add(file);\r\n }\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n\r\n @HostListener('dragover', ['$event'])\r\n onDropOver(event: DragEvent): void {\r\n event.preventDefault();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['filesData']) {\r\n this.fileDataSource.set(this.filesData);\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);\r\n\r\n if (!(fileUpload instanceof HTMLInputElement)) {\r\n return;\r\n }\r\n\r\n fileUpload.onchange = (): void => {\r\n for (let index = 0; index < (fileUpload.files?.length ?? 0); index++) {\r\n const file = fileUpload.files![index];\r\n this.add(file);\r\n }\r\n };\r\n }\r\n\r\n add(file: File): void {\r\n if (!this.isFileTypeAccepted(file.type)) {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(this.filesData)) {\r\n this.filesData = [];\r\n }\r\n\r\n if (!(!this.multiple && this.filesData.length > 0)) {\r\n this.filesData = [...this.filesData, file] as FileModel[];\r\n } else if (this.fileUploads.first.id === null) {\r\n this.filesData = [...this.filesData, file] as FileModel[];\r\n this.fileUploads.first.remove();\r\n }\r\n\r\n this.fileDataSource.set(this.filesData);\r\n }\r\n\r\n upload(event: FileModel): void {\r\n this.outputUploadIdEvent.emit(event.id ?? '');\r\n\r\n this.outputFilesDataEvent.emit(this.filesData);\r\n\r\n this.fileDataSource.set(this.filesData);\r\n }\r\n\r\n remove(event: CmatUploadComponent): void {\r\n if (this.filesData) {\r\n const index = this.filesData.findIndex((j): boolean => j === event.file);\r\n if (index > -1) {\r\n this.filesData.splice(index, 1);\r\n if (event.file.id) {\r\n this.outputRemoveIdEvent.emit(event.file.id);\r\n }\r\n\r\n this.outputFilesDataEvent.emit(this.filesData);\r\n\r\n this.fileDataSource.set(this.filesData);\r\n }\r\n\r\n }\r\n }\r\n\r\n uploadAll(): void {\r\n this.fileUploads.forEach((fileUpload): void => {\r\n if (fileUpload.id === null) {\r\n fileUpload.upload();\r\n }\r\n });\r\n\r\n }\r\n\r\n removeAll(): void {\r\n this.fileUploads.forEach((fileUpload): void => { fileUpload.remove() });\r\n }\r\n\r\n choose(): void {\r\n this._elementRef.nativeElement.querySelector(`#${this.id}`)?.dispatchEvent(new MouseEvent('click'));\r\n }\r\n\r\n private isFileTypeAccepted(fileType: string): boolean {\r\n if (!this.accept || this.accept === '') {\r\n return true;\r\n }\r\n\r\n const acceptedTypes = this.accept.split(',').map(type => type.trim());\r\n\r\n return acceptedTypes.some((type): boolean => {\r\n if (type.endsWith('/*')) {\r\n const prefix = type.slice(0, -1);\r\n return fileType.startsWith(prefix);\r\n }\r\n return fileType === type;\r\n });\r\n }\r\n}","<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">选择</span>\r\n </button>\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">上传全部</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">删除全部</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of fileDataSource(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i3","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAWa,oBAAoB,CAAA;AAO7B,IAAA,WAAA,GAAA;AANQ,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAC1B,QAAA,IAAA,CAAA,sBAAsB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACjD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QAK7C,IAAI,CAAC,sBAAsB,CAAC;AACvB,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;AACzC,aAAA,SAAS,CAAC,CAAC,MAAuB,KAAI;AACnC,YAAA,IAAI,CAAC,OAAO,GAAG,MAAM;AACzB,QAAA,CAAC,CAAC;IACV;AAEA,IAAA,YAAY,CAAC,MAAc,EAAE,QAAA,GAAoB,IAAI,EAAA;AACjD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA,UAAA,EAAa,MAAM,EAAE,EAAE;AAChE,YAAA,OAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC;AACzD,YAAA,OAAO,EAAE,UAAU;AACnB,YAAA,cAAc,EAAE,IAAI;AACpB,YAAA,YAAY,EAAE,MAAM;AACpB,YAAA,MAAM,EAAE;gBACJ;AACH;SACJ,CAAE,CAAC,IAAI,CACJ,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACjD;AAEA,IAAA,eAAe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879
|
isPublic: false,
|
|
3880
3880
|
fileCategory: 'Quill',
|
|
3881
3881
|
filePath: this.props.filePath,
|
|
3882
|
-
fileType:
|
|
3882
|
+
fileType: CmatUtilsService$1.getFileType(file.type),
|
|
3883
3883
|
data: file
|
|
3884
3884
|
};
|
|
3885
|
-
fileModel.fileType = CmatUtilsService$1.getFileType(file.type);
|
|
3886
3885
|
const formData = new FormData();
|
|
3887
3886
|
formData.set('fileData', file, file.name);
|
|
3888
3887
|
formData.append('fileInfo', JSON.stringify(fileModel));
|
|
@@ -15834,6 +15833,10 @@ class CmatUploadComponent {
|
|
|
15834
15833
|
get fileType() {
|
|
15835
15834
|
return CmatUtilsService$1.getFileType(this.file.type);
|
|
15836
15835
|
}
|
|
15836
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
15837
|
+
get fileSize() {
|
|
15838
|
+
return Number(this.file.size);
|
|
15839
|
+
}
|
|
15837
15840
|
ngOnInit() {
|
|
15838
15841
|
if (this.autoUpload && this.id === null) {
|
|
15839
15842
|
this.upload();
|
|
@@ -15848,12 +15851,13 @@ class CmatUploadComponent {
|
|
|
15848
15851
|
fileCategory: this.fileCategory,
|
|
15849
15852
|
isPublic: this.isPublic,
|
|
15850
15853
|
filePath: this.filePath,
|
|
15851
|
-
fileType:
|
|
15852
|
-
data: this.
|
|
15854
|
+
fileType: this.fileType,
|
|
15855
|
+
data: this._file
|
|
15853
15856
|
};
|
|
15854
|
-
fileModel.fileType = this.fileType;
|
|
15855
15857
|
const formData = new FormData();
|
|
15856
|
-
|
|
15858
|
+
if (this._file.data) {
|
|
15859
|
+
formData.set(this.fileAlias, this._file.data, this._file.fileName);
|
|
15860
|
+
}
|
|
15857
15861
|
formData.append('fileInfo', JSON.stringify(fileModel));
|
|
15858
15862
|
this._fileService.uploadFile(formData).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
|
|
15859
15863
|
if (event.type === HttpEventType.UploadProgress && typeof event.total === 'number') {
|
|
@@ -15885,11 +15889,11 @@ class CmatUploadComponent {
|
|
|
15885
15889
|
this.removeEvent.emit(this);
|
|
15886
15890
|
}
|
|
15887
15891
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15888
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadComponent, isStandalone: true, selector: "cmat-upload", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", editMode: "editMode", autoUpload: "autoUpload", id: "id", file: "file" }, outputs: { removeEvent: "removeEvent", uploadEvent: "uploadEvent" }, exportAs: ["cmatUpload"], ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\"
|
|
15892
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadComponent, isStandalone: true, selector: "cmat-upload", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", editMode: "editMode", autoUpload: "autoUpload", id: "id", file: "file" }, outputs: { removeEvent: "removeEvent", uploadEvent: "uploadEvent" }, exportAs: ["cmatUpload"], ngImport: i0, template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\" [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{fileSize |\r\n cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1$g.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1$b.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: CmatBytesPipe$1, name: "cmatBytes" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
15889
15893
|
}
|
|
15890
15894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadComponent, decorators: [{
|
|
15891
15895
|
type: Component,
|
|
15892
|
-
args: [{ selector: 'cmat-upload', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUpload', imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe$1, NgClass], template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\"
|
|
15896
|
+
args: [{ selector: 'cmat-upload', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUpload', imports: [MatButtonModule, MatIconModule, MatProgressBarModule, MatTooltipModule, CmatBytesPipe$1, NgClass], template: "<div class=\"flex flex-col\">\r\n <div class=\"flex flex-row items-center\">\r\n <span class=\"flex items-center px-1\">\r\n <mat-icon class=\"icon-size-6 text-hint\" [svgIcon]=\"fileType\"></mat-icon>\r\n </span>\r\n <span matTooltip=\"{{file.name}}\"\r\n class=\"text-sm flex flex-auto whitespace-nowrap overflow-x-hidden text-ellipsis\">{{file.name}}({{fileSize |\r\n cmatBytes}})</span>\r\n <span class=\"flex flex-row gap-1 print:hidden\">\r\n @if(id===null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" [ngClass]=\"{'disabled' : isUploading()}\"\r\n (click)=\"upload()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(id!==null){\r\n <button matIconButton color=\"primary\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"download()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'mat_outline:file_download'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n @if(editMode){\r\n <button matIconButton color=\"warn\" class=\"w-8 min-h-8 h-8 max-w-8\" (click)=\"remove()\">\r\n <mat-icon class=\"icon-size-5\" [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if(id===null){\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-sm block whitespace-nowrap overflow-x-hidden text-ellipsis\">\r\n <span>{{progressPercentage()}}%</span><span> {{loaded() | cmatBytes}} of {{total() | cmatBytes}}</span>\r\n </div>\r\n }\r\n</div>" }]
|
|
15893
15897
|
}], propDecorators: { fileAlias: [{
|
|
15894
15898
|
type: Input
|
|
15895
15899
|
}], filePath: [{
|
|
@@ -15929,6 +15933,7 @@ class CmatUploadQueueComponent {
|
|
|
15929
15933
|
this.outputFilesDataEvent = new EventEmitter();
|
|
15930
15934
|
this.id = 'cmatupload-' + crypto.randomUUID().slice(0, 8);
|
|
15931
15935
|
this.isHandSet = signal(false, ...(ngDevMode ? [{ debugName: "isHandSet" }] : /* istanbul ignore next */ []));
|
|
15936
|
+
this.fileDataSource = signal([], ...(ngDevMode ? [{ debugName: "fileDataSource" }] : /* istanbul ignore next */ []));
|
|
15932
15937
|
this._cmatMediaWatcherService = inject(CmatMediaWatcherService$1);
|
|
15933
15938
|
this._elementRef = inject(ElementRef);
|
|
15934
15939
|
this._destroyRef = inject(DestroyRef);
|
|
@@ -15952,6 +15957,11 @@ class CmatUploadQueueComponent {
|
|
|
15952
15957
|
onDropOver(event) {
|
|
15953
15958
|
event.preventDefault();
|
|
15954
15959
|
}
|
|
15960
|
+
ngOnChanges(changes) {
|
|
15961
|
+
if (changes['filesData']) {
|
|
15962
|
+
this.fileDataSource.set(this.filesData);
|
|
15963
|
+
}
|
|
15964
|
+
}
|
|
15955
15965
|
ngAfterViewInit() {
|
|
15956
15966
|
const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);
|
|
15957
15967
|
if (!(fileUpload instanceof HTMLInputElement)) {
|
|
@@ -15978,11 +15988,12 @@ class CmatUploadQueueComponent {
|
|
|
15978
15988
|
this.filesData = [...this.filesData, file];
|
|
15979
15989
|
this.fileUploads.first.remove();
|
|
15980
15990
|
}
|
|
15991
|
+
this.fileDataSource.set(this.filesData);
|
|
15981
15992
|
}
|
|
15982
15993
|
upload(event) {
|
|
15983
|
-
|
|
15984
|
-
this.outputUploadIdEvent.emit(uploadId ?? '');
|
|
15994
|
+
this.outputUploadIdEvent.emit(event.id ?? '');
|
|
15985
15995
|
this.outputFilesDataEvent.emit(this.filesData);
|
|
15996
|
+
this.fileDataSource.set(this.filesData);
|
|
15986
15997
|
}
|
|
15987
15998
|
remove(event) {
|
|
15988
15999
|
if (this.filesData) {
|
|
@@ -15993,6 +16004,7 @@ class CmatUploadQueueComponent {
|
|
|
15993
16004
|
this.outputRemoveIdEvent.emit(event.file.id);
|
|
15994
16005
|
}
|
|
15995
16006
|
this.outputFilesDataEvent.emit(this.filesData);
|
|
16007
|
+
this.fileDataSource.set(this.filesData);
|
|
15996
16008
|
}
|
|
15997
16009
|
}
|
|
15998
16010
|
}
|
|
@@ -16023,11 +16035,11 @@ class CmatUploadQueueComponent {
|
|
|
16023
16035
|
});
|
|
16024
16036
|
}
|
|
16025
16037
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadQueueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16026
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadQueueComponent, isStandalone: true, selector: "cmat-upload-queue", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", required: "required", autoUpload: "autoUpload", multiple: "multiple", accept: "accept", title: "title", editMode: "editMode", filesData: "filesData" }, outputs: { outputRemoveIdEvent: "outputRemoveIdEvent", outputUploadIdEvent: "outputUploadIdEvent", outputFilesDataEvent: "outputFilesDataEvent" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDropOver($event)" } }, viewQueries: [{ propertyName: "fileUploads", predicate: i0.forwardRef(() => CmatUploadComponent), descendants: true }], exportAs: ["cmatUploadQueue"], ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(
|
|
16038
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatUploadQueueComponent, isStandalone: true, selector: "cmat-upload-queue", inputs: { fileAlias: "fileAlias", filePath: "filePath", fileCategory: "fileCategory", isPublic: "isPublic", required: "required", autoUpload: "autoUpload", multiple: "multiple", accept: "accept", title: "title", editMode: "editMode", filesData: "filesData" }, outputs: { outputRemoveIdEvent: "outputRemoveIdEvent", outputUploadIdEvent: "outputUploadIdEvent", outputFilesDataEvent: "outputFilesDataEvent" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDropOver($event)" } }, viewQueries: [{ propertyName: "fileUploads", predicate: i0.forwardRef(() => CmatUploadComponent), descendants: true }], exportAs: ["cmatUploadQueue"], usesOnChanges: true, ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">\u4E0A\u4F20\u5168\u90E8</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">\u5220\u9664\u5168\u90E8</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of fileDataSource(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n", dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i1$6.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$6.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: CmatUploadComponent, selector: "cmat-upload", inputs: ["fileAlias", "filePath", "fileCategory", "isPublic", "editMode", "autoUpload", "id", "file"], outputs: ["removeEvent", "uploadEvent"], exportAs: ["cmatUpload"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
16027
16039
|
}
|
|
16028
16040
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatUploadQueueComponent, decorators: [{
|
|
16029
16041
|
type: Component,
|
|
16030
|
-
args: [{ selector: 'cmat-upload-queue', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUploadQueue', imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent], template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(
|
|
16042
|
+
args: [{ selector: 'cmat-upload-queue', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatUploadQueue', imports: [MatCardModule, MatListModule, MatButtonModule, MatIconModule, CmatUploadComponent], template: "<mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <legend class=\"text-lg\">\r\n {{title}}\r\n @if(required){\r\n <span>*</span>\r\n }\r\n </legend>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" />\r\n\r\n @if(editMode){\r\n <mat-card-actions class=\"flex flex-row gap-1 print:hidden\">\r\n @if(!isHandSet()){\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">\u9009\u62E9</span>\r\n </button>\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">\u4E0A\u4F20\u5168\u90E8</span></button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">\u5220\u9664\u5168\u90E8</span></button>\r\n }\r\n }@else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if(autoUpload){\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if(fileDataSource()&&multiple&&fileDataSource().length > 0){\r\n @if(!autoUpload){\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\"><mat-icon\r\n [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon></button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\"><mat-icon\r\n [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon></button>\r\n }\r\n }\r\n </mat-card-actions>\r\n }\r\n\r\n <mat-card-content>\r\n <mat-list class=\"border-t\">\r\n @for (file of fileDataSource(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias\" [filePath]=\"filePath\" [fileCategory]=\"fileCategory\"\r\n [autoUpload]=\"autoUpload\" [editMode]=\"editMode\" [file]=\"file\" [id]=\"file.id||null\" [isPublic]=\"isPublic\"\r\n (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-card-content>\r\n</mat-card>\r\n" }]
|
|
16031
16043
|
}], ctorParameters: () => [], propDecorators: { fileUploads: [{
|
|
16032
16044
|
type: ViewChildren,
|
|
16033
16045
|
args: [forwardRef(() => CmatUploadComponent)]
|