@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,164 +1,164 @@
|
|
|
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 { FormBuilder, FormControl, Validators, } from '@angular/forms';
|
|
7
|
-
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
8
|
-
import { Subject } from 'rxjs';
|
|
9
|
-
import { takeUntil } from 'rxjs/operators';
|
|
10
|
-
import { FileService } from '../../../services/file.service';
|
|
11
|
-
/**
|
|
12
|
-
* @record
|
|
13
|
-
*/
|
|
14
|
-
function IData() { }
|
|
15
|
-
if (false) {
|
|
16
|
-
/** @type {?} */
|
|
17
|
-
IData.prototype.currentAssetId;
|
|
18
|
-
}
|
|
19
|
-
var AddFolderDialogComponent = /** @class */ (function () {
|
|
20
|
-
function AddFolderDialogComponent(fb, data, dialogRef, fileService) {
|
|
21
|
-
this.fb = fb;
|
|
22
|
-
this.data = data;
|
|
23
|
-
this.dialogRef = dialogRef;
|
|
24
|
-
this.fileService = fileService;
|
|
25
|
-
this.isLoading = false;
|
|
26
|
-
this.errorMessage = '';
|
|
27
|
-
this.value = '';
|
|
28
|
-
this.destroy$ = new Subject();
|
|
29
|
-
this.form = new FormControl();
|
|
30
|
-
this.formGroup = this.fb.group({
|
|
31
|
-
name: ['', [
|
|
32
|
-
Validators.maxLength(200),
|
|
33
|
-
Validators.required
|
|
34
|
-
]],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @return {?}
|
|
39
|
-
*/
|
|
40
|
-
AddFolderDialogComponent.prototype.ngOnInit = /**
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
function () { };
|
|
44
|
-
Object.defineProperty(AddFolderDialogComponent.prototype, "disabled", {
|
|
45
|
-
get: /**
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
|
-
function () {
|
|
49
|
-
var name = this.formGroup.controls.name.value;
|
|
50
|
-
return !name || !!this.errorMessage || this.isLoading;
|
|
51
|
-
},
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
/**
|
|
56
|
-
* @param {?} _event
|
|
57
|
-
* @return {?}
|
|
58
|
-
*/
|
|
59
|
-
AddFolderDialogComponent.prototype.onChange = /**
|
|
60
|
-
* @param {?} _event
|
|
61
|
-
* @return {?}
|
|
62
|
-
*/
|
|
63
|
-
function (_event) {
|
|
64
|
-
this.errorMessage = '';
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* @return {?}
|
|
68
|
-
*/
|
|
69
|
-
AddFolderDialogComponent.prototype.addFolder = /**
|
|
70
|
-
* @return {?}
|
|
71
|
-
*/
|
|
72
|
-
function () {
|
|
73
|
-
var _this = this;
|
|
74
|
-
var name = this.formGroup.controls.name.value;
|
|
75
|
-
this.isLoading = true;
|
|
76
|
-
this.fileService
|
|
77
|
-
.addFolder({
|
|
78
|
-
parentAssetId: this.data.currentAssetId,
|
|
79
|
-
folderName: name.trim(),
|
|
80
|
-
})
|
|
81
|
-
.pipe(takeUntil(this.destroy$))
|
|
82
|
-
.subscribe((/**
|
|
83
|
-
* @param {?} _res
|
|
84
|
-
* @return {?}
|
|
85
|
-
*/
|
|
86
|
-
function (_res) { return _this.closeDialog(true); }), (/**
|
|
87
|
-
* @param {?} err
|
|
88
|
-
* @return {?}
|
|
89
|
-
*/
|
|
90
|
-
function (err) {
|
|
91
|
-
_this.isLoading = false;
|
|
92
|
-
_this.errorMessage = err.ResponseMessage;
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* @param {?=} res
|
|
97
|
-
* @return {?}
|
|
98
|
-
*/
|
|
99
|
-
AddFolderDialogComponent.prototype.closeDialog = /**
|
|
100
|
-
* @param {?=} res
|
|
101
|
-
* @return {?}
|
|
102
|
-
*/
|
|
103
|
-
function (res) {
|
|
104
|
-
this.dialogRef.close(res);
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* @return {?}
|
|
108
|
-
*/
|
|
109
|
-
AddFolderDialogComponent.prototype.ngOnDestroy = /**
|
|
110
|
-
* @return {?}
|
|
111
|
-
*/
|
|
112
|
-
function () {
|
|
113
|
-
this.destroy$.next(true);
|
|
114
|
-
this.destroy$.complete();
|
|
115
|
-
};
|
|
116
|
-
AddFolderDialogComponent.decorators = [
|
|
117
|
-
{ type: Component, args: [{
|
|
118
|
-
selector: 'lib-add-folder-dialog',
|
|
119
|
-
template: "<lib-modal heading=\"Add a folder\">\n <ng-container content>\n <form (ngSubmit)=\"addFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n (input)=\"onChange($event)\"\n matInput\n placeholder=\"Enter your folder name\"\n autocomplete=\"off\"\n required\n pattern=\".*\\S+.*\"\n formControlName=\"name\"\n />\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.maxlength\">\n The character limit is 200 characters\n </mat-error>\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n </form>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"addFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || !formGroup?.valid\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Add</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
120
|
-
styles: [":host::ng-deep .mat-dialog-title{padding-bottom:0!important}:host::ng-deep form{position:relative}:host::ng-deep form .mat-error{margin-top:0;position:absolute;left:0;bottom:-20px;line-height:15px;font-size:13px}:host::ng-deep .mat-dialog-content{padding-top:24px;padding-bottom:24px}:host::ng-deep .mat-dialog-actions{padding-top:5px}"]
|
|
121
|
-
}] }
|
|
122
|
-
];
|
|
123
|
-
/** @nocollapse */
|
|
124
|
-
AddFolderDialogComponent.ctorParameters = function () { return [
|
|
125
|
-
{ type: FormBuilder },
|
|
126
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
127
|
-
{ type: MatDialogRef },
|
|
128
|
-
{ type: FileService }
|
|
129
|
-
]; };
|
|
130
|
-
return AddFolderDialogComponent;
|
|
131
|
-
}());
|
|
132
|
-
export { AddFolderDialogComponent };
|
|
133
|
-
if (false) {
|
|
134
|
-
/** @type {?} */
|
|
135
|
-
AddFolderDialogComponent.prototype.isLoading;
|
|
136
|
-
/** @type {?} */
|
|
137
|
-
AddFolderDialogComponent.prototype.errorMessage;
|
|
138
|
-
/** @type {?} */
|
|
139
|
-
AddFolderDialogComponent.prototype.value;
|
|
140
|
-
/**
|
|
141
|
-
* @type {?}
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
|
-
AddFolderDialogComponent.prototype.destroy$;
|
|
145
|
-
/** @type {?} */
|
|
146
|
-
AddFolderDialogComponent.prototype.formGroup;
|
|
147
|
-
/** @type {?} */
|
|
148
|
-
AddFolderDialogComponent.prototype.form;
|
|
149
|
-
/**
|
|
150
|
-
* @type {?}
|
|
151
|
-
* @private
|
|
152
|
-
*/
|
|
153
|
-
AddFolderDialogComponent.prototype.fb;
|
|
154
|
-
/** @type {?} */
|
|
155
|
-
AddFolderDialogComponent.prototype.data;
|
|
156
|
-
/** @type {?} */
|
|
157
|
-
AddFolderDialogComponent.prototype.dialogRef;
|
|
158
|
-
/**
|
|
159
|
-
* @type {?}
|
|
160
|
-
* @private
|
|
161
|
-
*/
|
|
162
|
-
AddFolderDialogComponent.prototype.fileService;
|
|
163
|
-
}
|
|
164
|
-
//# 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 { FormBuilder, FormControl, Validators, } from '@angular/forms';
|
|
7
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
|
+
import { takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { FileService } from '../../../services/file.service';
|
|
11
|
+
/**
|
|
12
|
+
* @record
|
|
13
|
+
*/
|
|
14
|
+
function IData() { }
|
|
15
|
+
if (false) {
|
|
16
|
+
/** @type {?} */
|
|
17
|
+
IData.prototype.currentAssetId;
|
|
18
|
+
}
|
|
19
|
+
var AddFolderDialogComponent = /** @class */ (function () {
|
|
20
|
+
function AddFolderDialogComponent(fb, data, dialogRef, fileService) {
|
|
21
|
+
this.fb = fb;
|
|
22
|
+
this.data = data;
|
|
23
|
+
this.dialogRef = dialogRef;
|
|
24
|
+
this.fileService = fileService;
|
|
25
|
+
this.isLoading = false;
|
|
26
|
+
this.errorMessage = '';
|
|
27
|
+
this.value = '';
|
|
28
|
+
this.destroy$ = new Subject();
|
|
29
|
+
this.form = new FormControl();
|
|
30
|
+
this.formGroup = this.fb.group({
|
|
31
|
+
name: ['', [
|
|
32
|
+
Validators.maxLength(200),
|
|
33
|
+
Validators.required
|
|
34
|
+
]],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @return {?}
|
|
39
|
+
*/
|
|
40
|
+
AddFolderDialogComponent.prototype.ngOnInit = /**
|
|
41
|
+
* @return {?}
|
|
42
|
+
*/
|
|
43
|
+
function () { };
|
|
44
|
+
Object.defineProperty(AddFolderDialogComponent.prototype, "disabled", {
|
|
45
|
+
get: /**
|
|
46
|
+
* @return {?}
|
|
47
|
+
*/
|
|
48
|
+
function () {
|
|
49
|
+
var name = this.formGroup.controls.name.value;
|
|
50
|
+
return !name || !!this.errorMessage || this.isLoading;
|
|
51
|
+
},
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @param {?} _event
|
|
57
|
+
* @return {?}
|
|
58
|
+
*/
|
|
59
|
+
AddFolderDialogComponent.prototype.onChange = /**
|
|
60
|
+
* @param {?} _event
|
|
61
|
+
* @return {?}
|
|
62
|
+
*/
|
|
63
|
+
function (_event) {
|
|
64
|
+
this.errorMessage = '';
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @return {?}
|
|
68
|
+
*/
|
|
69
|
+
AddFolderDialogComponent.prototype.addFolder = /**
|
|
70
|
+
* @return {?}
|
|
71
|
+
*/
|
|
72
|
+
function () {
|
|
73
|
+
var _this = this;
|
|
74
|
+
var name = this.formGroup.controls.name.value;
|
|
75
|
+
this.isLoading = true;
|
|
76
|
+
this.fileService
|
|
77
|
+
.addFolder({
|
|
78
|
+
parentAssetId: this.data.currentAssetId,
|
|
79
|
+
folderName: name.trim(),
|
|
80
|
+
})
|
|
81
|
+
.pipe(takeUntil(this.destroy$))
|
|
82
|
+
.subscribe((/**
|
|
83
|
+
* @param {?} _res
|
|
84
|
+
* @return {?}
|
|
85
|
+
*/
|
|
86
|
+
function (_res) { return _this.closeDialog(true); }), (/**
|
|
87
|
+
* @param {?} err
|
|
88
|
+
* @return {?}
|
|
89
|
+
*/
|
|
90
|
+
function (err) {
|
|
91
|
+
_this.isLoading = false;
|
|
92
|
+
_this.errorMessage = err.ResponseMessage;
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @param {?=} res
|
|
97
|
+
* @return {?}
|
|
98
|
+
*/
|
|
99
|
+
AddFolderDialogComponent.prototype.closeDialog = /**
|
|
100
|
+
* @param {?=} res
|
|
101
|
+
* @return {?}
|
|
102
|
+
*/
|
|
103
|
+
function (res) {
|
|
104
|
+
this.dialogRef.close(res);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* @return {?}
|
|
108
|
+
*/
|
|
109
|
+
AddFolderDialogComponent.prototype.ngOnDestroy = /**
|
|
110
|
+
* @return {?}
|
|
111
|
+
*/
|
|
112
|
+
function () {
|
|
113
|
+
this.destroy$.next(true);
|
|
114
|
+
this.destroy$.complete();
|
|
115
|
+
};
|
|
116
|
+
AddFolderDialogComponent.decorators = [
|
|
117
|
+
{ type: Component, args: [{
|
|
118
|
+
selector: 'lib-add-folder-dialog',
|
|
119
|
+
template: "<lib-modal heading=\"Add a folder\">\r\n <ng-container content>\r\n <form (ngSubmit)=\"addFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\r\n <input\r\n (input)=\"onChange($event)\"\r\n matInput\r\n placeholder=\"Enter your folder name\"\r\n autocomplete=\"off\"\r\n required\r\n pattern=\".*\\S+.*\"\r\n formControlName=\"name\"\r\n />\r\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\r\n This field does not allow only whitespace\r\n </mat-error>\r\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.maxlength\">\r\n The character limit is 200 characters\r\n </mat-error>\r\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\r\n </form>\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 mat-raised-button\r\n color=\"primary\"\r\n (click)=\"addFolder()\"\r\n [class.loading]=\"isLoading\"\r\n [disabled]=\"disabled || !formGroup?.valid\"\r\n >\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner [diameter]=\"20\"></mat-spinner>\r\n </ng-container>\r\n <span>Add</span>\r\n </button>\r\n </ng-container>\r\n</lib-modal>\r\n",
|
|
120
|
+
styles: [":host::ng-deep .mat-dialog-title{padding-bottom:0!important}:host::ng-deep form{position:relative}:host::ng-deep form .mat-error{margin-top:0;position:absolute;left:0;bottom:-20px;line-height:15px;font-size:13px}:host::ng-deep .mat-dialog-content{padding-top:24px;padding-bottom:24px}:host::ng-deep .mat-dialog-actions{padding-top:5px}"]
|
|
121
|
+
}] }
|
|
122
|
+
];
|
|
123
|
+
/** @nocollapse */
|
|
124
|
+
AddFolderDialogComponent.ctorParameters = function () { return [
|
|
125
|
+
{ type: FormBuilder },
|
|
126
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
127
|
+
{ type: MatDialogRef },
|
|
128
|
+
{ type: FileService }
|
|
129
|
+
]; };
|
|
130
|
+
return AddFolderDialogComponent;
|
|
131
|
+
}());
|
|
132
|
+
export { AddFolderDialogComponent };
|
|
133
|
+
if (false) {
|
|
134
|
+
/** @type {?} */
|
|
135
|
+
AddFolderDialogComponent.prototype.isLoading;
|
|
136
|
+
/** @type {?} */
|
|
137
|
+
AddFolderDialogComponent.prototype.errorMessage;
|
|
138
|
+
/** @type {?} */
|
|
139
|
+
AddFolderDialogComponent.prototype.value;
|
|
140
|
+
/**
|
|
141
|
+
* @type {?}
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
AddFolderDialogComponent.prototype.destroy$;
|
|
145
|
+
/** @type {?} */
|
|
146
|
+
AddFolderDialogComponent.prototype.formGroup;
|
|
147
|
+
/** @type {?} */
|
|
148
|
+
AddFolderDialogComponent.prototype.form;
|
|
149
|
+
/**
|
|
150
|
+
* @type {?}
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
AddFolderDialogComponent.prototype.fb;
|
|
154
|
+
/** @type {?} */
|
|
155
|
+
AddFolderDialogComponent.prototype.data;
|
|
156
|
+
/** @type {?} */
|
|
157
|
+
AddFolderDialogComponent.prototype.dialogRef;
|
|
158
|
+
/**
|
|
159
|
+
* @type {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