@rs-pk/asset-management 1.0.22 → 1.0.24
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/README.md +24 -24
- package/bundles/rs-pk-asset-management.umd.js +6444 -6327
- package/bundles/rs-pk-asset-management.umd.js.map +1 -1
- package/bundles/rs-pk-asset-management.umd.min.js +2 -2
- package/bundles/rs-pk-asset-management.umd.min.js.map +1 -1
- package/esm2015/lib/asset-management.component.js +164 -152
- package/esm2015/lib/asset-management.module.js +178 -179
- package/esm2015/lib/asset-management.service.js +45 -45
- package/esm2015/lib/components/partial/add-folder-dialog/add-folder-dialog.component.js +146 -146
- package/esm2015/lib/components/partial/asset-dialog/asset-dialog.component.js +398 -395
- package/esm2015/lib/components/partial/asset-item/asset-item.component.js +316 -299
- package/esm2015/lib/components/partial/asset-list/asset-list.component.js +285 -273
- package/esm2015/lib/components/partial/asset-management-dialog/asset-management-dialog.component.js +123 -109
- package/esm2015/lib/components/partial/asset-wrapper/asset-wrapper.component.js +119 -100
- package/esm2015/lib/components/partial/breadcrumb/breadcrumb.component.js +121 -121
- package/esm2015/lib/components/partial/delete-dialog/delete-dialog.component.js +139 -139
- package/esm2015/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +151 -151
- package/esm2015/lib/components/partial/file-item/file-item.component.js +181 -181
- package/esm2015/lib/components/partial/file-list/file-list.component.js +73 -73
- package/esm2015/lib/components/partial/folder-item/folder-item.component.js +126 -114
- package/esm2015/lib/components/partial/folder-list/folder-list.component.js +81 -69
- package/esm2015/lib/components/partial/node-details/node-details.component.js +417 -403
- package/esm2015/lib/components/partial/node-tree/node-tree.component.js +330 -330
- package/esm2015/lib/components/partial/search-box/search-box.component.js +158 -158
- package/esm2015/lib/components/partial/sort-items/sort-items.component.js +99 -99
- package/esm2015/lib/components/partial/upload-dialog/upload-dialog.component.js +141 -141
- package/esm2015/lib/components/partial/upload-file/upload-file.component.js +85 -85
- package/esm2015/lib/components/ui/drag-to-resize/drag-to-resize.component.js +96 -96
- package/esm2015/lib/components/ui/input-file/input-file.component.js +49 -49
- package/esm2015/lib/components/ui/modal/modal.component.js +34 -34
- package/esm2015/lib/components/ui/search-not-found/search-not-found.component.js +41 -41
- package/esm2015/lib/configs/admin.config.js +22 -22
- package/esm2015/lib/contanst/data-image.js +20 -20
- package/esm2015/lib/contanst/index.js +6 -6
- package/esm2015/lib/datasources/index.js +6 -6
- package/esm2015/lib/datasources/node-tree.datasource.js +179 -179
- package/esm2015/lib/directives/dialogTrigger.directive.js +47 -47
- package/esm2015/lib/directives/directives.module.js +20 -20
- package/esm2015/lib/directives/dnd.directive.js +57 -57
- package/esm2015/lib/models/asset-file.model.js +57 -57
- package/esm2015/lib/models/asset.model.js +149 -149
- package/esm2015/lib/models/file-type.enum.js +11 -11
- package/esm2015/lib/models/file.model.js +91 -91
- package/esm2015/lib/models/index.js +12 -12
- package/esm2015/lib/models/node-tree.model.js +32 -32
- package/esm2015/lib/models/sort.enum.js +23 -23
- package/esm2015/lib/pipes/datetime.pipe.js +79 -79
- package/esm2015/lib/pipes/file-size.pipe.js +54 -54
- package/esm2015/lib/services/asset.service.js +229 -229
- package/esm2015/lib/services/base.service.js +49 -49
- package/esm2015/lib/services/env-config.service.js +18 -18
- package/esm2015/lib/services/file.service.js +106 -106
- package/esm2015/lib/services/index.js +11 -11
- package/esm2015/lib/services/node-tree.service.js +212 -212
- package/esm2015/lib/services/upload-assets.service.js +178 -178
- package/esm2015/lib/store/actions.action.js +125 -125
- package/esm2015/lib/store/index.js +7 -7
- package/esm2015/lib/store/reducer.js +115 -115
- package/esm2015/public-api.js +34 -34
- package/esm2015/rs-pk-asset-management.js +16 -16
- package/esm5/lib/asset-management.component.js +179 -167
- package/esm5/lib/asset-management.module.js +179 -180
- package/esm5/lib/asset-management.service.js +54 -54
- package/esm5/lib/components/partial/add-folder-dialog/add-folder-dialog.component.js +164 -164
- package/esm5/lib/components/partial/asset-dialog/asset-dialog.component.js +440 -437
- package/esm5/lib/components/partial/asset-item/asset-item.component.js +350 -333
- package/esm5/lib/components/partial/asset-list/asset-list.component.js +318 -306
- package/esm5/lib/components/partial/asset-management-dialog/asset-management-dialog.component.js +138 -124
- package/esm5/lib/components/partial/asset-wrapper/asset-wrapper.component.js +137 -115
- package/esm5/lib/components/partial/breadcrumb/breadcrumb.component.js +143 -143
- package/esm5/lib/components/partial/delete-dialog/delete-dialog.component.js +154 -154
- package/esm5/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +169 -169
- package/esm5/lib/components/partial/file-item/file-item.component.js +206 -206
- package/esm5/lib/components/partial/file-list/file-list.component.js +93 -93
- package/esm5/lib/components/partial/folder-item/folder-item.component.js +138 -126
- package/esm5/lib/components/partial/folder-list/folder-list.component.js +94 -82
- package/esm5/lib/components/partial/node-details/node-details.component.js +458 -444
- package/esm5/lib/components/partial/node-tree/node-tree.component.js +413 -413
- package/esm5/lib/components/partial/search-box/search-box.component.js +184 -184
- package/esm5/lib/components/partial/sort-items/sort-items.component.js +107 -107
- package/esm5/lib/components/partial/upload-dialog/upload-dialog.component.js +156 -156
- package/esm5/lib/components/partial/upload-file/upload-file.component.js +102 -102
- package/esm5/lib/components/ui/drag-to-resize/drag-to-resize.component.js +117 -117
- package/esm5/lib/components/ui/input-file/input-file.component.js +55 -55
- package/esm5/lib/components/ui/modal/modal.component.js +39 -39
- package/esm5/lib/components/ui/search-not-found/search-not-found.component.js +43 -43
- package/esm5/lib/configs/admin.config.js +22 -22
- package/esm5/lib/contanst/data-image.js +20 -20
- package/esm5/lib/contanst/index.js +6 -6
- package/esm5/lib/datasources/index.js +6 -6
- package/esm5/lib/datasources/node-tree.datasource.js +239 -239
- package/esm5/lib/directives/dialogTrigger.directive.js +53 -53
- package/esm5/lib/directives/directives.module.js +25 -25
- package/esm5/lib/directives/dnd.directive.js +80 -80
- package/esm5/lib/models/asset-file.model.js +69 -69
- package/esm5/lib/models/asset.model.js +168 -168
- package/esm5/lib/models/file-type.enum.js +11 -11
- package/esm5/lib/models/file.model.js +99 -99
- package/esm5/lib/models/index.js +12 -12
- package/esm5/lib/models/node-tree.model.js +37 -37
- package/esm5/lib/models/sort.enum.js +23 -23
- package/esm5/lib/pipes/datetime.pipe.js +83 -83
- package/esm5/lib/pipes/file-size.pipe.js +63 -63
- package/esm5/lib/services/asset.service.js +279 -279
- package/esm5/lib/services/base.service.js +57 -57
- package/esm5/lib/services/env-config.service.js +18 -18
- package/esm5/lib/services/file.service.js +127 -127
- package/esm5/lib/services/index.js +11 -11
- package/esm5/lib/services/node-tree.service.js +278 -278
- package/esm5/lib/services/upload-assets.service.js +207 -207
- package/esm5/lib/store/actions.action.js +143 -143
- package/esm5/lib/store/index.js +7 -7
- package/esm5/lib/store/reducer.js +116 -116
- package/esm5/public-api.js +34 -34
- package/esm5/rs-pk-asset-management.js +16 -16
- package/fesm2015/rs-pk-asset-management.js +5642 -5528
- package/fesm2015/rs-pk-asset-management.js.map +1 -1
- package/fesm5/rs-pk-asset-management.js +6448 -6331
- package/fesm5/rs-pk-asset-management.js.map +1 -1
- package/lib/asset-management.component.d.ts +25 -22
- package/lib/asset-management.module.d.ts +5 -5
- package/lib/asset-management.service.d.ts +7 -7
- package/lib/components/partial/add-folder-dialog/add-folder-dialog.component.d.ts +27 -27
- package/lib/components/partial/asset-dialog/asset-dialog.component.d.ts +65 -60
- package/lib/components/partial/asset-item/asset-item.component.d.ts +40 -37
- package/lib/components/partial/asset-list/asset-list.component.d.ts +27 -24
- package/lib/components/partial/asset-management-dialog/asset-management-dialog.component.d.ts +20 -17
- package/lib/components/partial/asset-wrapper/asset-wrapper.component.d.ts +23 -19
- package/lib/components/partial/breadcrumb/breadcrumb.component.d.ts +18 -18
- package/lib/components/partial/delete-dialog/delete-dialog.component.d.ts +24 -24
- package/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.d.ts +28 -28
- package/lib/components/partial/file-item/file-item.component.d.ts +36 -36
- package/lib/components/partial/file-list/file-list.component.d.ts +15 -15
- package/lib/components/partial/folder-item/folder-item.component.d.ts +17 -14
- package/lib/components/partial/folder-list/folder-list.component.d.ts +14 -11
- package/lib/components/partial/node-details/node-details.component.d.ts +32 -29
- package/lib/components/partial/node-tree/node-tree.component.d.ts +34 -34
- package/lib/components/partial/search-box/search-box.component.d.ts +18 -18
- package/lib/components/partial/sort-items/sort-items.component.d.ts +21 -21
- package/lib/components/partial/upload-dialog/upload-dialog.component.d.ts +25 -25
- package/lib/components/partial/upload-file/upload-file.component.d.ts +16 -16
- package/lib/components/ui/drag-to-resize/drag-to-resize.component.d.ts +15 -15
- package/lib/components/ui/input-file/input-file.component.d.ts +9 -9
- package/lib/components/ui/modal/modal.component.d.ts +7 -7
- package/lib/components/ui/search-not-found/search-not-found.component.d.ts +8 -8
- package/lib/configs/admin.config.d.ts +3 -3
- package/lib/contanst/data-image.d.ts +6 -6
- package/lib/contanst/index.d.ts +1 -1
- package/lib/datasources/index.d.ts +1 -1
- package/lib/datasources/node-tree.datasource.d.ts +24 -24
- package/lib/directives/dialogTrigger.directive.d.ts +7 -7
- package/lib/directives/directives.module.d.ts +5 -5
- package/lib/directives/dnd.directive.d.ts +7 -7
- package/lib/models/asset-file.model.d.ts +26 -26
- package/lib/models/asset.model.d.ts +68 -68
- package/lib/models/file-type.enum.d.ts +4 -4
- package/lib/models/file.model.d.ts +41 -41
- package/lib/models/index.d.ts +7 -7
- package/lib/models/node-tree.model.d.ts +9 -9
- package/lib/models/sort.enum.d.ts +9 -9
- package/lib/pipes/datetime.pipe.d.ts +13 -13
- package/lib/pipes/file-size.pipe.d.ts +5 -5
- package/lib/services/asset.service.d.ts +36 -36
- package/lib/services/base.service.d.ts +20 -20
- package/lib/services/env-config.service.d.ts +7 -7
- package/lib/services/file.service.d.ts +13 -13
- package/lib/services/index.d.ts +6 -6
- package/lib/services/node-tree.service.d.ts +24 -24
- package/lib/services/upload-assets.service.d.ts +34 -34
- package/lib/store/actions.action.d.ts +51 -51
- package/lib/store/index.d.ts +2 -2
- package/lib/store/reducer.d.ts +18 -18
- package/package.json +1 -1
- package/public-api.d.ts +26 -26
- package/rs-pk-asset-management.d.ts +12 -12
- package/rs-pk-asset-management.metadata.json +1 -1
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, Inject } from '@angular/core';
|
|
7
|
-
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
|
8
|
-
import { takeUntil } from 'rxjs/operators';
|
|
9
|
-
import { Subject } from 'rxjs';
|
|
10
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
11
|
-
import { UploadAssetsService } from '../../../services/upload-assets.service';
|
|
12
|
-
/**
|
|
13
|
-
* @record
|
|
14
|
-
*/
|
|
15
|
-
function IData() { }
|
|
16
|
-
if (false) {
|
|
17
|
-
/** @type {?} */
|
|
18
|
-
IData.prototype.currentAssetId;
|
|
19
|
-
/** @type {?|undefined} */
|
|
20
|
-
IData.prototype.fileType;
|
|
21
|
-
/** @type {?|undefined} */
|
|
22
|
-
IData.prototype.maxSize;
|
|
23
|
-
}
|
|
24
|
-
var UploadDialogComponent = /** @class */ (function () {
|
|
25
|
-
function UploadDialogComponent(data, dialogRef, changeDetectorRef, uploadAssetsService) {
|
|
26
|
-
this.data = data;
|
|
27
|
-
this.dialogRef = dialogRef;
|
|
28
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
29
|
-
this.uploadAssetsService = uploadAssetsService;
|
|
30
|
-
this.isLoading = false;
|
|
31
|
-
this.disabled = true;
|
|
32
|
-
this.destroy$ = new Subject();
|
|
33
|
-
if (this.data.fileType) {
|
|
34
|
-
this.uploadAssetsService.supportedTypes =
|
|
35
|
-
this.data.fileType === 'Image'
|
|
36
|
-
? tslib_1.__spread(this.uploadAssetsService.imageExtension) : tslib_1.__spread(this.uploadAssetsService.documentExtension);
|
|
37
|
-
}
|
|
38
|
-
if (this.data.maxSize) {
|
|
39
|
-
this.uploadAssetsService.supportedSize = this.data.maxSize * 1024 * 1024;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
45
|
-
UploadDialogComponent.prototype.ngOnInit = /**
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
|
-
function () {
|
|
49
|
-
var _this = this;
|
|
50
|
-
this.uploadAssetsService
|
|
51
|
-
.getErrorObs()
|
|
52
|
-
.pipe(takeUntil(this.destroy$))
|
|
53
|
-
.subscribe((/**
|
|
54
|
-
* @param {?} error
|
|
55
|
-
* @return {?}
|
|
56
|
-
*/
|
|
57
|
-
function (error) {
|
|
58
|
-
_this.disabled = error;
|
|
59
|
-
_this.changeDetectorRef.detectChanges();
|
|
60
|
-
}));
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @param {?} hasError
|
|
64
|
-
* @return {?}
|
|
65
|
-
*/
|
|
66
|
-
UploadDialogComponent.prototype.onValidate = /**
|
|
67
|
-
* @param {?} hasError
|
|
68
|
-
* @return {?}
|
|
69
|
-
*/
|
|
70
|
-
function (hasError) {
|
|
71
|
-
this.disabled = hasError;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* @return {?}
|
|
75
|
-
*/
|
|
76
|
-
UploadDialogComponent.prototype.uploadFiles = /**
|
|
77
|
-
* @return {?}
|
|
78
|
-
*/
|
|
79
|
-
function () {
|
|
80
|
-
var _this = this;
|
|
81
|
-
this.isLoading = true;
|
|
82
|
-
this.uploadAssetsService
|
|
83
|
-
.uploadMultipleAssets(this.data.currentAssetId)
|
|
84
|
-
.pipe(takeUntil(this.destroy$))
|
|
85
|
-
.subscribe((/**
|
|
86
|
-
* @param {?} res
|
|
87
|
-
* @return {?}
|
|
88
|
-
*/
|
|
89
|
-
function (res) {
|
|
90
|
-
if (res) {
|
|
91
|
-
_this.closeDialog(true);
|
|
92
|
-
}
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* @param {?=} res
|
|
97
|
-
* @return {?}
|
|
98
|
-
*/
|
|
99
|
-
UploadDialogComponent.prototype.closeDialog = /**
|
|
100
|
-
* @param {?=} res
|
|
101
|
-
* @return {?}
|
|
102
|
-
*/
|
|
103
|
-
function (res) {
|
|
104
|
-
this.dialogRef.close(res);
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* @return {?}
|
|
108
|
-
*/
|
|
109
|
-
UploadDialogComponent.prototype.ngOnDestroy = /**
|
|
110
|
-
* @return {?}
|
|
111
|
-
*/
|
|
112
|
-
function () {
|
|
113
|
-
this.destroy$.next(true);
|
|
114
|
-
this.destroy$.complete();
|
|
115
|
-
};
|
|
116
|
-
UploadDialogComponent.decorators = [
|
|
117
|
-
{ type: Component, args: [{
|
|
118
|
-
selector: 'lib-upload-dialog',
|
|
119
|
-
template: "<lib-modal heading=\"Add new assets\">\n <ng-container content>\n <lib-upload-file\n *ngIf=\"!uploadAssetsService?.getFiles?.length\"\n (revalidate)=\"onValidate($event)\"\n ></lib-upload-file>\n <lib-file-list\n *ngIf=\"uploadAssetsService?.getFiles?.length\"\n (revalidate)=\"onValidate($event)\"\n ></lib-file-list>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n class=\"upload__action\"\n [class.loading]=\"isLoading\"\n mat-raised-button\n color=\"primary\"\n (click)=\"uploadFiles()\"\n [disabled]=\"disabled || isLoading\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Upload</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
120
|
-
providers: [UploadAssetsService],
|
|
121
|
-
styles: [":host::ng-deep{display:block;width:1200px;max-width:100%;font-size:14px;line-height:16px;color:#979797;letter-spacing:.15px}:host::ng-deep .mat-dialog-title{position:relative;margin-bottom:0;padding-bottom:24px;color:#000}:host::ng-deep .mat-dialog-actions{justify-content:flex-end;padding:24px 0 0}:host::ng-deep .upload__action{min-width:100px}:host::ng-deep .upload__action.loading{padding:0 5px}:host::ng-deep .upload__action.loading .mat-button-wrapper{display:flex;width:100%;justify-content:center;align-items:center}:host::ng-deep .upload__action.loading .mat-spinner{margin-right:10px}"]
|
|
122
|
-
}] }
|
|
123
|
-
];
|
|
124
|
-
/** @nocollapse */
|
|
125
|
-
UploadDialogComponent.ctorParameters = function () { return [
|
|
126
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
127
|
-
{ type: MatDialogRef },
|
|
128
|
-
{ type: ChangeDetectorRef },
|
|
129
|
-
{ type: UploadAssetsService }
|
|
130
|
-
]; };
|
|
131
|
-
return UploadDialogComponent;
|
|
132
|
-
}());
|
|
133
|
-
export { UploadDialogComponent };
|
|
134
|
-
if (false) {
|
|
135
|
-
/** @type {?} */
|
|
136
|
-
UploadDialogComponent.prototype.isLoading;
|
|
137
|
-
/** @type {?} */
|
|
138
|
-
UploadDialogComponent.prototype.disabled;
|
|
139
|
-
/**
|
|
140
|
-
* @type {?}
|
|
141
|
-
* @private
|
|
142
|
-
*/
|
|
143
|
-
UploadDialogComponent.prototype.destroy$;
|
|
144
|
-
/** @type {?} */
|
|
145
|
-
UploadDialogComponent.prototype.data;
|
|
146
|
-
/** @type {?} */
|
|
147
|
-
UploadDialogComponent.prototype.dialogRef;
|
|
148
|
-
/**
|
|
149
|
-
* @type {?}
|
|
150
|
-
* @private
|
|
151
|
-
*/
|
|
152
|
-
UploadDialogComponent.prototype.changeDetectorRef;
|
|
153
|
-
/** @type {?} */
|
|
154
|
-
UploadDialogComponent.prototype.uploadAssetsService;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview added by tsickle
|
|
3
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
+
*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, Inject } from '@angular/core';
|
|
7
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
|
8
|
+
import { takeUntil } from 'rxjs/operators';
|
|
9
|
+
import { Subject } from 'rxjs';
|
|
10
|
+
import { ChangeDetectorRef } from '@angular/core';
|
|
11
|
+
import { UploadAssetsService } from '../../../services/upload-assets.service';
|
|
12
|
+
/**
|
|
13
|
+
* @record
|
|
14
|
+
*/
|
|
15
|
+
function IData() { }
|
|
16
|
+
if (false) {
|
|
17
|
+
/** @type {?} */
|
|
18
|
+
IData.prototype.currentAssetId;
|
|
19
|
+
/** @type {?|undefined} */
|
|
20
|
+
IData.prototype.fileType;
|
|
21
|
+
/** @type {?|undefined} */
|
|
22
|
+
IData.prototype.maxSize;
|
|
23
|
+
}
|
|
24
|
+
var UploadDialogComponent = /** @class */ (function () {
|
|
25
|
+
function UploadDialogComponent(data, dialogRef, changeDetectorRef, uploadAssetsService) {
|
|
26
|
+
this.data = data;
|
|
27
|
+
this.dialogRef = dialogRef;
|
|
28
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
29
|
+
this.uploadAssetsService = uploadAssetsService;
|
|
30
|
+
this.isLoading = false;
|
|
31
|
+
this.disabled = true;
|
|
32
|
+
this.destroy$ = new Subject();
|
|
33
|
+
if (this.data.fileType) {
|
|
34
|
+
this.uploadAssetsService.supportedTypes =
|
|
35
|
+
this.data.fileType === 'Image'
|
|
36
|
+
? tslib_1.__spread(this.uploadAssetsService.imageExtension) : tslib_1.__spread(this.uploadAssetsService.documentExtension);
|
|
37
|
+
}
|
|
38
|
+
if (this.data.maxSize) {
|
|
39
|
+
this.uploadAssetsService.supportedSize = this.data.maxSize * 1024 * 1024;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @return {?}
|
|
44
|
+
*/
|
|
45
|
+
UploadDialogComponent.prototype.ngOnInit = /**
|
|
46
|
+
* @return {?}
|
|
47
|
+
*/
|
|
48
|
+
function () {
|
|
49
|
+
var _this = this;
|
|
50
|
+
this.uploadAssetsService
|
|
51
|
+
.getErrorObs()
|
|
52
|
+
.pipe(takeUntil(this.destroy$))
|
|
53
|
+
.subscribe((/**
|
|
54
|
+
* @param {?} error
|
|
55
|
+
* @return {?}
|
|
56
|
+
*/
|
|
57
|
+
function (error) {
|
|
58
|
+
_this.disabled = error;
|
|
59
|
+
_this.changeDetectorRef.detectChanges();
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @param {?} hasError
|
|
64
|
+
* @return {?}
|
|
65
|
+
*/
|
|
66
|
+
UploadDialogComponent.prototype.onValidate = /**
|
|
67
|
+
* @param {?} hasError
|
|
68
|
+
* @return {?}
|
|
69
|
+
*/
|
|
70
|
+
function (hasError) {
|
|
71
|
+
this.disabled = hasError;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @return {?}
|
|
75
|
+
*/
|
|
76
|
+
UploadDialogComponent.prototype.uploadFiles = /**
|
|
77
|
+
* @return {?}
|
|
78
|
+
*/
|
|
79
|
+
function () {
|
|
80
|
+
var _this = this;
|
|
81
|
+
this.isLoading = true;
|
|
82
|
+
this.uploadAssetsService
|
|
83
|
+
.uploadMultipleAssets(this.data.currentAssetId)
|
|
84
|
+
.pipe(takeUntil(this.destroy$))
|
|
85
|
+
.subscribe((/**
|
|
86
|
+
* @param {?} res
|
|
87
|
+
* @return {?}
|
|
88
|
+
*/
|
|
89
|
+
function (res) {
|
|
90
|
+
if (res) {
|
|
91
|
+
_this.closeDialog(true);
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @param {?=} res
|
|
97
|
+
* @return {?}
|
|
98
|
+
*/
|
|
99
|
+
UploadDialogComponent.prototype.closeDialog = /**
|
|
100
|
+
* @param {?=} res
|
|
101
|
+
* @return {?}
|
|
102
|
+
*/
|
|
103
|
+
function (res) {
|
|
104
|
+
this.dialogRef.close(res);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* @return {?}
|
|
108
|
+
*/
|
|
109
|
+
UploadDialogComponent.prototype.ngOnDestroy = /**
|
|
110
|
+
* @return {?}
|
|
111
|
+
*/
|
|
112
|
+
function () {
|
|
113
|
+
this.destroy$.next(true);
|
|
114
|
+
this.destroy$.complete();
|
|
115
|
+
};
|
|
116
|
+
UploadDialogComponent.decorators = [
|
|
117
|
+
{ type: Component, args: [{
|
|
118
|
+
selector: 'lib-upload-dialog',
|
|
119
|
+
template: "<lib-modal heading=\"Add new assets\">\r\n <ng-container content>\r\n <lib-upload-file\r\n *ngIf=\"!uploadAssetsService?.getFiles?.length\"\r\n (revalidate)=\"onValidate($event)\"\r\n ></lib-upload-file>\r\n <lib-file-list\r\n *ngIf=\"uploadAssetsService?.getFiles?.length\"\r\n (revalidate)=\"onValidate($event)\"\r\n ></lib-file-list>\r\n </ng-container>\r\n <ng-container actions>\r\n <button mat-raised-button mat-dialog-close>Cancel</button>\r\n <button\r\n class=\"upload__action\"\r\n [class.loading]=\"isLoading\"\r\n mat-raised-button\r\n color=\"primary\"\r\n (click)=\"uploadFiles()\"\r\n [disabled]=\"disabled || isLoading\"\r\n >\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner [diameter]=\"20\"></mat-spinner>\r\n </ng-container>\r\n <span>Upload</span>\r\n </button>\r\n </ng-container>\r\n</lib-modal>\r\n",
|
|
120
|
+
providers: [UploadAssetsService],
|
|
121
|
+
styles: [":host::ng-deep{display:block;width:1200px;max-width:100%;font-size:14px;line-height:16px;color:#979797;letter-spacing:.15px}:host::ng-deep .mat-dialog-title{position:relative;margin-bottom:0;padding-bottom:24px;color:#000}:host::ng-deep .mat-dialog-actions{justify-content:flex-end;padding:24px 0 0}:host::ng-deep .upload__action{min-width:100px}:host::ng-deep .upload__action.loading{padding:0 5px}:host::ng-deep .upload__action.loading .mat-button-wrapper{display:flex;width:100%;justify-content:center;align-items:center}:host::ng-deep .upload__action.loading .mat-spinner{margin-right:10px}"]
|
|
122
|
+
}] }
|
|
123
|
+
];
|
|
124
|
+
/** @nocollapse */
|
|
125
|
+
UploadDialogComponent.ctorParameters = function () { return [
|
|
126
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
127
|
+
{ type: MatDialogRef },
|
|
128
|
+
{ type: ChangeDetectorRef },
|
|
129
|
+
{ type: UploadAssetsService }
|
|
130
|
+
]; };
|
|
131
|
+
return UploadDialogComponent;
|
|
132
|
+
}());
|
|
133
|
+
export { UploadDialogComponent };
|
|
134
|
+
if (false) {
|
|
135
|
+
/** @type {?} */
|
|
136
|
+
UploadDialogComponent.prototype.isLoading;
|
|
137
|
+
/** @type {?} */
|
|
138
|
+
UploadDialogComponent.prototype.disabled;
|
|
139
|
+
/**
|
|
140
|
+
* @type {?}
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
UploadDialogComponent.prototype.destroy$;
|
|
144
|
+
/** @type {?} */
|
|
145
|
+
UploadDialogComponent.prototype.data;
|
|
146
|
+
/** @type {?} */
|
|
147
|
+
UploadDialogComponent.prototype.dialogRef;
|
|
148
|
+
/**
|
|
149
|
+
* @type {?}
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
UploadDialogComponent.prototype.changeDetectorRef;
|
|
153
|
+
/** @type {?} */
|
|
154
|
+
UploadDialogComponent.prototype.uploadAssetsService;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBsb2FkLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AcnMtcGsvYXNzZXQtbWFuYWdlbWVudC8iLC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V0ZWN0b3JSZWYuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICB9KTtcclxuICB9XHJcblxyXG4gIG9uVmFsaWRhdGUoaGFzRXJyb3I6IGJvb2xlYW4pIHtcclxuICAgIHRoaXMuZGlzYWJsZWQgPSBoYXNFcnJvcjtcclxuICB9XHJcblxyXG4gIHVwbG9hZEZpbGVzKCkge1xyXG4gICAgdGhpcy5pc0xvYWRpbmcgPSB0cnVlO1xyXG4gICAgdGhpcy51cGxvYWRBc3NldHNTZXJ2aWNlXHJcbiAgICAgIC51cGxvYWRNdWx0aXBsZUFzc2V0cyh0aGlzLmRhdGEuY3VycmVudEFzc2V0SWQpXHJcbiAgICAgIC5waXBlKHRha2VVbnRpbCh0aGlzLmRlc3Ryb3kkKSlcclxuICAgICAgLnN1YnNjcmliZShyZXMgPT4ge1xyXG4gICAgICAgIGlmIChyZXMpIHtcclxuICAgICAgICAgIHRoaXMuY2xvc2VEaWFsb2codHJ1ZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICB9KTtcclxuICB9XHJcblxyXG4gIGNsb3NlRGlhbG9nKHJlcz86IGJvb2xlYW4pIHtcclxuICAgIHRoaXMuZGlhbG9nUmVmLmNsb3NlKHJlcyk7XHJcbiAgfVxyXG5cclxuICBuZ09uRGVzdHJveSgpOiB2b2lkIHtcclxuICAgIHRoaXMuZGVzdHJveSQubmV4dCh0cnVlKTtcclxuICAgIHRoaXMuZGVzdHJveSQuY29tcGxldGUoKTtcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, Output, EventEmitter } from '@angular/core';
|
|
7
|
-
import { UploadAssetsService } from '../../../services/upload-assets.service';
|
|
8
|
-
import { imageDefault } from '../../../contanst';
|
|
9
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
10
|
-
var UploadFileComponent = /** @class */ (function () {
|
|
11
|
-
function UploadFileComponent(domSanitizer, uploadAssetsService) {
|
|
12
|
-
this.domSanitizer = domSanitizer;
|
|
13
|
-
this.uploadAssetsService = uploadAssetsService;
|
|
14
|
-
this.base64Image = this.domSanitizer.bypassSecurityTrustUrl(imageDefault);
|
|
15
|
-
this.revalidate = new EventEmitter();
|
|
16
|
-
this.isDragging = false;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @return {?}
|
|
20
|
-
*/
|
|
21
|
-
UploadFileComponent.prototype.ngOnInit = /**
|
|
22
|
-
* @return {?}
|
|
23
|
-
*/
|
|
24
|
-
function () { };
|
|
25
|
-
/**
|
|
26
|
-
* @param {?} newFiles
|
|
27
|
-
* @return {?}
|
|
28
|
-
*/
|
|
29
|
-
UploadFileComponent.prototype.onFileChange = /**
|
|
30
|
-
* @param {?} newFiles
|
|
31
|
-
* @return {?}
|
|
32
|
-
*/
|
|
33
|
-
function (newFiles) {
|
|
34
|
-
this.isDragging = false;
|
|
35
|
-
var files = this.uploadAssetsService.getFiles;
|
|
36
|
-
this.uploadAssetsService.setFiles = tslib_1.__spread(files, newFiles);
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @return {?}
|
|
40
|
-
*/
|
|
41
|
-
UploadFileComponent.prototype.onEmitError = /**
|
|
42
|
-
* @return {?}
|
|
43
|
-
*/
|
|
44
|
-
function () {
|
|
45
|
-
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* @param {?} _event
|
|
49
|
-
* @return {?}
|
|
50
|
-
*/
|
|
51
|
-
UploadFileComponent.prototype.onDragover = /**
|
|
52
|
-
* @param {?} _event
|
|
53
|
-
* @return {?}
|
|
54
|
-
*/
|
|
55
|
-
function (_event) {
|
|
56
|
-
this.isDragging = true;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* @param {?} _event
|
|
60
|
-
* @return {?}
|
|
61
|
-
*/
|
|
62
|
-
UploadFileComponent.prototype.onDragleave = /**
|
|
63
|
-
* @param {?} _event
|
|
64
|
-
* @return {?}
|
|
65
|
-
*/
|
|
66
|
-
function (_event) {
|
|
67
|
-
this.isDragging = false;
|
|
68
|
-
};
|
|
69
|
-
UploadFileComponent.decorators = [
|
|
70
|
-
{ type: Component, args: [{
|
|
71
|
-
selector: 'lib-upload-file',
|
|
72
|
-
template: "<div\n class=\"upload-file__wrapper\"\n [class.dragging]=\"isDragging\"\n libDnDFile\n (imageDropped)=\"onFileChange($event)\"\n (dragover)=\"onDragover($event)\"\n (dragleave)=\"onDragleave($event)\"\n>\n <div>\n <img [src]=\"base64Image\" />\n <div class=\"upload-file__label\">Drag and drop here or</div>\n </div>\n <lib-input-file\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\n (onFileChange)=\"onFileChange($event)\"\n color=\"primary\"\n >\n <span>Browse files</span>\n </lib-input-file>\n</div>\n",
|
|
73
|
-
styles: [":host::ng-deep .upload-file__wrapper{margin-top:30px;margin-bottom:30px;min-height:300px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;border:1px dashed #017eff;border-radius:10px;box-sizing:border-box}:host::ng-deep .upload-file__wrapper lib-input-file{margin-top:30px}:host::ng-deep .upload-file__wrapper.dragging{background-color:#f5fcff}:host::ng-deep .upload-file__label{margin-top:30px;font-size:24px}:host::ng-deep .upload-file lib-file-item{margin-bottom:20px}:host::ng-deep .upload-file__upload{cursor:pointer}"]
|
|
74
|
-
}] }
|
|
75
|
-
];
|
|
76
|
-
/** @nocollapse */
|
|
77
|
-
UploadFileComponent.ctorParameters = function () { return [
|
|
78
|
-
{ type: DomSanitizer },
|
|
79
|
-
{ type: UploadAssetsService }
|
|
80
|
-
]; };
|
|
81
|
-
UploadFileComponent.propDecorators = {
|
|
82
|
-
revalidate: [{ type: Output }]
|
|
83
|
-
};
|
|
84
|
-
return UploadFileComponent;
|
|
85
|
-
}());
|
|
86
|
-
export { UploadFileComponent };
|
|
87
|
-
if (false) {
|
|
88
|
-
/** @type {?} */
|
|
89
|
-
UploadFileComponent.prototype.base64Image;
|
|
90
|
-
/** @type {?} */
|
|
91
|
-
UploadFileComponent.prototype.revalidate;
|
|
92
|
-
/** @type {?} */
|
|
93
|
-
UploadFileComponent.prototype.isDragging;
|
|
94
|
-
/**
|
|
95
|
-
* @type {?}
|
|
96
|
-
* @private
|
|
97
|
-
*/
|
|
98
|
-
UploadFileComponent.prototype.domSanitizer;
|
|
99
|
-
/** @type {?} */
|
|
100
|
-
UploadFileComponent.prototype.uploadAssetsService;
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview added by tsickle
|
|
3
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
+
*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, Output, EventEmitter } from '@angular/core';
|
|
7
|
+
import { UploadAssetsService } from '../../../services/upload-assets.service';
|
|
8
|
+
import { imageDefault } from '../../../contanst';
|
|
9
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
10
|
+
var UploadFileComponent = /** @class */ (function () {
|
|
11
|
+
function UploadFileComponent(domSanitizer, uploadAssetsService) {
|
|
12
|
+
this.domSanitizer = domSanitizer;
|
|
13
|
+
this.uploadAssetsService = uploadAssetsService;
|
|
14
|
+
this.base64Image = this.domSanitizer.bypassSecurityTrustUrl(imageDefault);
|
|
15
|
+
this.revalidate = new EventEmitter();
|
|
16
|
+
this.isDragging = false;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @return {?}
|
|
20
|
+
*/
|
|
21
|
+
UploadFileComponent.prototype.ngOnInit = /**
|
|
22
|
+
* @return {?}
|
|
23
|
+
*/
|
|
24
|
+
function () { };
|
|
25
|
+
/**
|
|
26
|
+
* @param {?} newFiles
|
|
27
|
+
* @return {?}
|
|
28
|
+
*/
|
|
29
|
+
UploadFileComponent.prototype.onFileChange = /**
|
|
30
|
+
* @param {?} newFiles
|
|
31
|
+
* @return {?}
|
|
32
|
+
*/
|
|
33
|
+
function (newFiles) {
|
|
34
|
+
this.isDragging = false;
|
|
35
|
+
var files = this.uploadAssetsService.getFiles;
|
|
36
|
+
this.uploadAssetsService.setFiles = tslib_1.__spread(files, newFiles);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @return {?}
|
|
40
|
+
*/
|
|
41
|
+
UploadFileComponent.prototype.onEmitError = /**
|
|
42
|
+
* @return {?}
|
|
43
|
+
*/
|
|
44
|
+
function () {
|
|
45
|
+
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @param {?} _event
|
|
49
|
+
* @return {?}
|
|
50
|
+
*/
|
|
51
|
+
UploadFileComponent.prototype.onDragover = /**
|
|
52
|
+
* @param {?} _event
|
|
53
|
+
* @return {?}
|
|
54
|
+
*/
|
|
55
|
+
function (_event) {
|
|
56
|
+
this.isDragging = true;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @param {?} _event
|
|
60
|
+
* @return {?}
|
|
61
|
+
*/
|
|
62
|
+
UploadFileComponent.prototype.onDragleave = /**
|
|
63
|
+
* @param {?} _event
|
|
64
|
+
* @return {?}
|
|
65
|
+
*/
|
|
66
|
+
function (_event) {
|
|
67
|
+
this.isDragging = false;
|
|
68
|
+
};
|
|
69
|
+
UploadFileComponent.decorators = [
|
|
70
|
+
{ type: Component, args: [{
|
|
71
|
+
selector: 'lib-upload-file',
|
|
72
|
+
template: "<div\r\n class=\"upload-file__wrapper\"\r\n [class.dragging]=\"isDragging\"\r\n libDnDFile\r\n (imageDropped)=\"onFileChange($event)\"\r\n (dragover)=\"onDragover($event)\"\r\n (dragleave)=\"onDragleave($event)\"\r\n>\r\n <div>\r\n <img [src]=\"base64Image\" />\r\n <div class=\"upload-file__label\">Drag and drop here or</div>\r\n </div>\r\n <lib-input-file\r\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\r\n (onFileChange)=\"onFileChange($event)\"\r\n color=\"primary\"\r\n >\r\n <span>Browse files</span>\r\n </lib-input-file>\r\n</div>\r\n",
|
|
73
|
+
styles: [":host::ng-deep .upload-file__wrapper{margin-top:30px;margin-bottom:30px;min-height:300px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;border:1px dashed #017eff;border-radius:10px;box-sizing:border-box}:host::ng-deep .upload-file__wrapper lib-input-file{margin-top:30px}:host::ng-deep .upload-file__wrapper.dragging{background-color:#f5fcff}:host::ng-deep .upload-file__label{margin-top:30px;font-size:24px}:host::ng-deep .upload-file lib-file-item{margin-bottom:20px}:host::ng-deep .upload-file__upload{cursor:pointer}"]
|
|
74
|
+
}] }
|
|
75
|
+
];
|
|
76
|
+
/** @nocollapse */
|
|
77
|
+
UploadFileComponent.ctorParameters = function () { return [
|
|
78
|
+
{ type: DomSanitizer },
|
|
79
|
+
{ type: UploadAssetsService }
|
|
80
|
+
]; };
|
|
81
|
+
UploadFileComponent.propDecorators = {
|
|
82
|
+
revalidate: [{ type: Output }]
|
|
83
|
+
};
|
|
84
|
+
return UploadFileComponent;
|
|
85
|
+
}());
|
|
86
|
+
export { UploadFileComponent };
|
|
87
|
+
if (false) {
|
|
88
|
+
/** @type {?} */
|
|
89
|
+
UploadFileComponent.prototype.base64Image;
|
|
90
|
+
/** @type {?} */
|
|
91
|
+
UploadFileComponent.prototype.revalidate;
|
|
92
|
+
/** @type {?} */
|
|
93
|
+
UploadFileComponent.prototype.isDragging;
|
|
94
|
+
/**
|
|
95
|
+
* @type {?}
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
UploadFileComponent.prototype.domSanitizer;
|
|
99
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