@rs-pk/asset-management 1.0.23 → 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 -6326
- 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 -178
- 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 -179
- 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 -5527
- package/fesm2015/rs-pk-asset-management.js.map +1 -1
- package/fesm5/rs-pk-asset-management.js +6448 -6330
- 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,154 +1,154 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import { Component, Inject } from '@angular/core';
|
|
6
|
-
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
7
|
-
import { takeUntil } from 'rxjs/operators';
|
|
8
|
-
import { Subject } from 'rxjs';
|
|
9
|
-
import { FileService } from '../../../services/file.service';
|
|
10
|
-
import { AssetService } from '../../../services/asset.service';
|
|
11
|
-
/**
|
|
12
|
-
* @record
|
|
13
|
-
*/
|
|
14
|
-
function IData() { }
|
|
15
|
-
if (false) {
|
|
16
|
-
/** @type {?} */
|
|
17
|
-
IData.prototype.type;
|
|
18
|
-
/** @type {?} */
|
|
19
|
-
IData.prototype.ids;
|
|
20
|
-
/** @type {?|undefined} */
|
|
21
|
-
IData.prototype.name;
|
|
22
|
-
}
|
|
23
|
-
var DeleteDialogComponent = /** @class */ (function () {
|
|
24
|
-
function DeleteDialogComponent(data, dialogRef, fileService, assetService) {
|
|
25
|
-
this.data = data;
|
|
26
|
-
this.dialogRef = dialogRef;
|
|
27
|
-
this.fileService = fileService;
|
|
28
|
-
this.assetService = assetService;
|
|
29
|
-
this.isLoading = false;
|
|
30
|
-
this.destroy$ = new Subject();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @return {?}
|
|
34
|
-
*/
|
|
35
|
-
DeleteDialogComponent.prototype.ngOnInit = /**
|
|
36
|
-
* @return {?}
|
|
37
|
-
*/
|
|
38
|
-
function () { };
|
|
39
|
-
/**
|
|
40
|
-
* @return {?}
|
|
41
|
-
*/
|
|
42
|
-
DeleteDialogComponent.prototype.delete = /**
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
45
|
-
function () {
|
|
46
|
-
var _this = this;
|
|
47
|
-
this.isLoading = true;
|
|
48
|
-
this.fileService
|
|
49
|
-
.deleteFile(this.data.ids)
|
|
50
|
-
.pipe(takeUntil(this.destroy$))
|
|
51
|
-
.subscribe((/**
|
|
52
|
-
* @param {?} _res
|
|
53
|
-
* @return {?}
|
|
54
|
-
*/
|
|
55
|
-
function (_res) {
|
|
56
|
-
_this.handleAssetPaging();
|
|
57
|
-
_this.isLoading = false;
|
|
58
|
-
_this.closeDialog(true);
|
|
59
|
-
}), (/**
|
|
60
|
-
* @param {?} _err
|
|
61
|
-
* @return {?}
|
|
62
|
-
*/
|
|
63
|
-
function (_err) {
|
|
64
|
-
_this.isLoading = false;
|
|
65
|
-
console.log('deleted fail', _err);
|
|
66
|
-
}));
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* @private
|
|
70
|
-
* @return {?}
|
|
71
|
-
*/
|
|
72
|
-
DeleteDialogComponent.prototype.handleAssetPaging = /**
|
|
73
|
-
* @private
|
|
74
|
-
* @return {?}
|
|
75
|
-
*/
|
|
76
|
-
function () {
|
|
77
|
-
var _this = this;
|
|
78
|
-
this.assetService
|
|
79
|
-
.getAssetList()
|
|
80
|
-
.pipe(takeUntil(this.destroy$))
|
|
81
|
-
.subscribe((/**
|
|
82
|
-
* @param {?} assets
|
|
83
|
-
* @return {?}
|
|
84
|
-
*/
|
|
85
|
-
function (assets) {
|
|
86
|
-
if (assets &&
|
|
87
|
-
assets.length === _this.data.ids.length &&
|
|
88
|
-
_this.assetService.pageIndex > 0) {
|
|
89
|
-
_this.assetService.pageIndex--;
|
|
90
|
-
}
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* @param {?=} res
|
|
95
|
-
* @return {?}
|
|
96
|
-
*/
|
|
97
|
-
DeleteDialogComponent.prototype.closeDialog = /**
|
|
98
|
-
* @param {?=} res
|
|
99
|
-
* @return {?}
|
|
100
|
-
*/
|
|
101
|
-
function (res) {
|
|
102
|
-
this.dialogRef.close(res);
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* @return {?}
|
|
106
|
-
*/
|
|
107
|
-
DeleteDialogComponent.prototype.ngOnDestroy = /**
|
|
108
|
-
* @return {?}
|
|
109
|
-
*/
|
|
110
|
-
function () {
|
|
111
|
-
this.destroy$.next(true);
|
|
112
|
-
this.destroy$.complete();
|
|
113
|
-
};
|
|
114
|
-
DeleteDialogComponent.decorators = [
|
|
115
|
-
{ type: Component, args: [{
|
|
116
|
-
selector: 'lib-delete-dialog',
|
|
117
|
-
template: "<ng-container *ngIf=\"data?.type === 'folder'\">\n <lib-modal heading=\"Delete folder\">\n <ng-container content>\n <div>\n Are you sure you want to delete folder{{ ' ' }}\n <strong class=\"file__name\">{{ data.name }}</strong\n >?\n </div>\n </ng-container>\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\n </lib-modal>\n</ng-container>\n\n<ng-container *ngIf=\"data?.type === 'file'\">\n <lib-modal heading=\"Delete file\">\n <ng-container content>\n <div>\n Are you sure you want to delete file{{ ' ' }}\n <strong class=\"file__name\">{{ ' ' }}{{ data.name }}</strong\n >?\n </div>\n </ng-container>\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\n </lib-modal>\n</ng-container>\n\n<ng-container *ngIf=\"data?.type === 'files'\">\n <lib-modal heading=\"Delete files\">\n <ng-container content>\n <div>\n Are you sure you want to delete\n <strong *ngIf=\"data?.ids?.length > 1; else singular\"\n >{{ data?.ids?.length }} files</strong\n >\n <ng-template #singular>\n <strong>{{ data?.ids?.length }} file</strong> </ng-template\n >?\n </div>\n </ng-container>\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\n </lib-modal>\n</ng-container>\n\n<ng-template #deleteAction>\n <button mat-raised-button mat-dialog-close>No</button>\n <button\n mat-raised-button\n color=\"warn\"\n (click)=\"delete()\"\n class=\"file__button delete__action\"\n [class.loading]=\"isLoading\"\n [disabled]=\"isLoading\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Yes</span>\n </button>\n</ng-template>\n",
|
|
118
|
-
styles: [""]
|
|
119
|
-
}] }
|
|
120
|
-
];
|
|
121
|
-
/** @nocollapse */
|
|
122
|
-
DeleteDialogComponent.ctorParameters = function () { return [
|
|
123
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
124
|
-
{ type: MatDialogRef },
|
|
125
|
-
{ type: FileService },
|
|
126
|
-
{ type: AssetService }
|
|
127
|
-
]; };
|
|
128
|
-
return DeleteDialogComponent;
|
|
129
|
-
}());
|
|
130
|
-
export { DeleteDialogComponent };
|
|
131
|
-
if (false) {
|
|
132
|
-
/** @type {?} */
|
|
133
|
-
DeleteDialogComponent.prototype.isLoading;
|
|
134
|
-
/**
|
|
135
|
-
* @type {?}
|
|
136
|
-
* @private
|
|
137
|
-
*/
|
|
138
|
-
DeleteDialogComponent.prototype.destroy$;
|
|
139
|
-
/** @type {?} */
|
|
140
|
-
DeleteDialogComponent.prototype.data;
|
|
141
|
-
/** @type {?} */
|
|
142
|
-
DeleteDialogComponent.prototype.dialogRef;
|
|
143
|
-
/**
|
|
144
|
-
* @type {?}
|
|
145
|
-
* @private
|
|
146
|
-
*/
|
|
147
|
-
DeleteDialogComponent.prototype.fileService;
|
|
148
|
-
/**
|
|
149
|
-
* @type {?}
|
|
150
|
-
* @private
|
|
151
|
-
*/
|
|
152
|
-
DeleteDialogComponent.prototype.assetService;
|
|
153
|
-
}
|
|
154
|
-
//# 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 { Component, Inject } from '@angular/core';
|
|
6
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
7
|
+
import { takeUntil } from 'rxjs/operators';
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
|
+
import { FileService } from '../../../services/file.service';
|
|
10
|
+
import { AssetService } from '../../../services/asset.service';
|
|
11
|
+
/**
|
|
12
|
+
* @record
|
|
13
|
+
*/
|
|
14
|
+
function IData() { }
|
|
15
|
+
if (false) {
|
|
16
|
+
/** @type {?} */
|
|
17
|
+
IData.prototype.type;
|
|
18
|
+
/** @type {?} */
|
|
19
|
+
IData.prototype.ids;
|
|
20
|
+
/** @type {?|undefined} */
|
|
21
|
+
IData.prototype.name;
|
|
22
|
+
}
|
|
23
|
+
var DeleteDialogComponent = /** @class */ (function () {
|
|
24
|
+
function DeleteDialogComponent(data, dialogRef, fileService, assetService) {
|
|
25
|
+
this.data = data;
|
|
26
|
+
this.dialogRef = dialogRef;
|
|
27
|
+
this.fileService = fileService;
|
|
28
|
+
this.assetService = assetService;
|
|
29
|
+
this.isLoading = false;
|
|
30
|
+
this.destroy$ = new Subject();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @return {?}
|
|
34
|
+
*/
|
|
35
|
+
DeleteDialogComponent.prototype.ngOnInit = /**
|
|
36
|
+
* @return {?}
|
|
37
|
+
*/
|
|
38
|
+
function () { };
|
|
39
|
+
/**
|
|
40
|
+
* @return {?}
|
|
41
|
+
*/
|
|
42
|
+
DeleteDialogComponent.prototype.delete = /**
|
|
43
|
+
* @return {?}
|
|
44
|
+
*/
|
|
45
|
+
function () {
|
|
46
|
+
var _this = this;
|
|
47
|
+
this.isLoading = true;
|
|
48
|
+
this.fileService
|
|
49
|
+
.deleteFile(this.data.ids)
|
|
50
|
+
.pipe(takeUntil(this.destroy$))
|
|
51
|
+
.subscribe((/**
|
|
52
|
+
* @param {?} _res
|
|
53
|
+
* @return {?}
|
|
54
|
+
*/
|
|
55
|
+
function (_res) {
|
|
56
|
+
_this.handleAssetPaging();
|
|
57
|
+
_this.isLoading = false;
|
|
58
|
+
_this.closeDialog(true);
|
|
59
|
+
}), (/**
|
|
60
|
+
* @param {?} _err
|
|
61
|
+
* @return {?}
|
|
62
|
+
*/
|
|
63
|
+
function (_err) {
|
|
64
|
+
_this.isLoading = false;
|
|
65
|
+
console.log('deleted fail', _err);
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
* @return {?}
|
|
71
|
+
*/
|
|
72
|
+
DeleteDialogComponent.prototype.handleAssetPaging = /**
|
|
73
|
+
* @private
|
|
74
|
+
* @return {?}
|
|
75
|
+
*/
|
|
76
|
+
function () {
|
|
77
|
+
var _this = this;
|
|
78
|
+
this.assetService
|
|
79
|
+
.getAssetList()
|
|
80
|
+
.pipe(takeUntil(this.destroy$))
|
|
81
|
+
.subscribe((/**
|
|
82
|
+
* @param {?} assets
|
|
83
|
+
* @return {?}
|
|
84
|
+
*/
|
|
85
|
+
function (assets) {
|
|
86
|
+
if (assets &&
|
|
87
|
+
assets.length === _this.data.ids.length &&
|
|
88
|
+
_this.assetService.pageIndex > 0) {
|
|
89
|
+
_this.assetService.pageIndex--;
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* @param {?=} res
|
|
95
|
+
* @return {?}
|
|
96
|
+
*/
|
|
97
|
+
DeleteDialogComponent.prototype.closeDialog = /**
|
|
98
|
+
* @param {?=} res
|
|
99
|
+
* @return {?}
|
|
100
|
+
*/
|
|
101
|
+
function (res) {
|
|
102
|
+
this.dialogRef.close(res);
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @return {?}
|
|
106
|
+
*/
|
|
107
|
+
DeleteDialogComponent.prototype.ngOnDestroy = /**
|
|
108
|
+
* @return {?}
|
|
109
|
+
*/
|
|
110
|
+
function () {
|
|
111
|
+
this.destroy$.next(true);
|
|
112
|
+
this.destroy$.complete();
|
|
113
|
+
};
|
|
114
|
+
DeleteDialogComponent.decorators = [
|
|
115
|
+
{ type: Component, args: [{
|
|
116
|
+
selector: 'lib-delete-dialog',
|
|
117
|
+
template: "<ng-container *ngIf=\"data?.type === 'folder'\">\r\n <lib-modal heading=\"Delete folder\">\r\n <ng-container content>\r\n <div>\r\n Are you sure you want to delete folder{{ ' ' }}\r\n <strong class=\"file__name\">{{ data.name }}</strong\r\n >?\r\n </div>\r\n </ng-container>\r\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\r\n </lib-modal>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"data?.type === 'file'\">\r\n <lib-modal heading=\"Delete file\">\r\n <ng-container content>\r\n <div>\r\n Are you sure you want to delete file{{ ' ' }}\r\n <strong class=\"file__name\">{{ ' ' }}{{ data.name }}</strong\r\n >?\r\n </div>\r\n </ng-container>\r\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\r\n </lib-modal>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"data?.type === 'files'\">\r\n <lib-modal heading=\"Delete files\">\r\n <ng-container content>\r\n <div>\r\n Are you sure you want to delete\r\n <strong *ngIf=\"data?.ids?.length > 1; else singular\"\r\n >{{ data?.ids?.length }} files</strong\r\n >\r\n <ng-template #singular>\r\n <strong>{{ data?.ids?.length }} file</strong> </ng-template\r\n >?\r\n </div>\r\n </ng-container>\r\n <ng-container actions *ngTemplateOutlet=\"deleteAction\"></ng-container>\r\n </lib-modal>\r\n</ng-container>\r\n\r\n<ng-template #deleteAction>\r\n <button mat-raised-button mat-dialog-close>No</button>\r\n <button\r\n mat-raised-button\r\n color=\"warn\"\r\n (click)=\"delete()\"\r\n class=\"file__button delete__action\"\r\n [class.loading]=\"isLoading\"\r\n [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>Yes</span>\r\n </button>\r\n</ng-template>\r\n",
|
|
118
|
+
styles: [""]
|
|
119
|
+
}] }
|
|
120
|
+
];
|
|
121
|
+
/** @nocollapse */
|
|
122
|
+
DeleteDialogComponent.ctorParameters = function () { return [
|
|
123
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
124
|
+
{ type: MatDialogRef },
|
|
125
|
+
{ type: FileService },
|
|
126
|
+
{ type: AssetService }
|
|
127
|
+
]; };
|
|
128
|
+
return DeleteDialogComponent;
|
|
129
|
+
}());
|
|
130
|
+
export { DeleteDialogComponent };
|
|
131
|
+
if (false) {
|
|
132
|
+
/** @type {?} */
|
|
133
|
+
DeleteDialogComponent.prototype.isLoading;
|
|
134
|
+
/**
|
|
135
|
+
* @type {?}
|
|
136
|
+
* @private
|
|
137
|
+
*/
|
|
138
|
+
DeleteDialogComponent.prototype.destroy$;
|
|
139
|
+
/** @type {?} */
|
|
140
|
+
DeleteDialogComponent.prototype.data;
|
|
141
|
+
/** @type {?} */
|
|
142
|
+
DeleteDialogComponent.prototype.dialogRef;
|
|
143
|
+
/**
|
|
144
|
+
* @type {?}
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
DeleteDialogComponent.prototype.fileService;
|
|
148
|
+
/**
|
|
149
|
+
* @type {?}
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
DeleteDialogComponent.prototype.assetService;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsZXRlLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AcnMtcGsvYXNzZXQtbWFuYWdlbWVudC8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL3BhcnRpYWwvZGVsZXRlLWRpYWxvZy9kZWxldGUtZGlhbG9nLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10s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