@rs-pk/asset-management 1.0.13 → 1.0.14
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/bundles/rs-pk-asset-management.umd.js +128 -159
- 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/components/partial/add-folder-dialog/add-folder-dialog.component.js +6 -3
- package/esm2015/lib/components/partial/asset-dialog/asset-dialog.component.js +3 -2
- package/esm2015/lib/components/partial/asset-item/asset-item.component.js +3 -3
- package/esm2015/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +6 -3
- package/esm2015/lib/components/partial/file-item/file-item.component.js +57 -18
- package/esm2015/lib/components/partial/file-list/file-list.component.js +10 -9
- package/esm2015/lib/components/partial/upload-file/upload-file.component.js +1 -18
- package/esm2015/lib/services/upload-assets.service.js +30 -61
- package/esm5/lib/components/partial/add-folder-dialog/add-folder-dialog.component.js +6 -3
- package/esm5/lib/components/partial/asset-dialog/asset-dialog.component.js +3 -2
- package/esm5/lib/components/partial/asset-item/asset-item.component.js +3 -3
- package/esm5/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +6 -3
- package/esm5/lib/components/partial/file-item/file-item.component.js +71 -22
- package/esm5/lib/components/partial/file-list/file-list.component.js +13 -13
- package/esm5/lib/components/partial/upload-file/upload-file.component.js +1 -29
- package/esm5/lib/services/upload-assets.service.js +33 -92
- package/fesm2015/rs-pk-asset-management.js +108 -109
- package/fesm2015/rs-pk-asset-management.js.map +1 -1
- package/fesm5/rs-pk-asset-management.js +129 -160
- package/fesm5/rs-pk-asset-management.js.map +1 -1
- package/lib/components/partial/file-item/file-item.component.d.ts +7 -3
- package/lib/components/partial/file-list/file-list.component.d.ts +5 -2
- package/lib/components/partial/upload-file/upload-file.component.d.ts +0 -2
- package/lib/services/upload-assets.service.d.ts +5 -15
- package/package.json +1 -1
- package/rs-pk-asset-management.metadata.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __extends, __assign, __spread, __awaiter, __generator,
|
|
1
|
+
import { __extends, __assign, __spread, __awaiter, __generator, __read } from 'tslib';
|
|
2
2
|
import { InjectionToken, Injectable, Inject, ɵɵdefineInjectable, Component, EventEmitter, Input, Output, Directive, HostListener, NgModule, ChangeDetectorRef, ViewChild, Pipe, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { FormControl, Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -1326,8 +1326,7 @@ var UploadAssetsService = /** @class */ (function () {
|
|
|
1326
1326
|
this.dialog = dialog;
|
|
1327
1327
|
this._api = _api;
|
|
1328
1328
|
this.files = [];
|
|
1329
|
-
this.
|
|
1330
|
-
this.errorsMap = {};
|
|
1329
|
+
this.fileNames = [];
|
|
1331
1330
|
this.supportedSize = 10 * 1024 * 1024; // 10MB
|
|
1332
1331
|
// 10MB
|
|
1333
1332
|
this.documentExtension = ['.pdf'];
|
|
@@ -1344,6 +1343,7 @@ var UploadAssetsService = /** @class */ (function () {
|
|
|
1344
1343
|
size: "File size should be upto",
|
|
1345
1344
|
ext: "Only supported file extension:",
|
|
1346
1345
|
replace: "The replacement file should be the same extension with old one:",
|
|
1346
|
+
maxLength: "The character limit is 200 characters",
|
|
1347
1347
|
};
|
|
1348
1348
|
this.errorObs$ = new BehaviorSubject(true);
|
|
1349
1349
|
this.baseUrl = this._env.asset2Url;
|
|
@@ -1389,54 +1389,18 @@ var UploadAssetsService = /** @class */ (function () {
|
|
|
1389
1389
|
enumerable: true,
|
|
1390
1390
|
configurable: true
|
|
1391
1391
|
});
|
|
1392
|
-
Object.defineProperty(UploadAssetsService.prototype, "nameFiles", {
|
|
1393
|
-
get: /**
|
|
1394
|
-
* @return {?}
|
|
1395
|
-
*/
|
|
1396
|
-
function () {
|
|
1397
|
-
return this.namesMap;
|
|
1398
|
-
},
|
|
1399
|
-
enumerable: true,
|
|
1400
|
-
configurable: true
|
|
1401
|
-
});
|
|
1402
|
-
Object.defineProperty(UploadAssetsService.prototype, "newName", {
|
|
1403
|
-
set: /**
|
|
1404
|
-
* @param {?} newName
|
|
1405
|
-
* @return {?}
|
|
1406
|
-
*/
|
|
1407
|
-
function (newName) {
|
|
1408
|
-
this.namesMap = __assign({}, this.namesMap, newName);
|
|
1409
|
-
},
|
|
1410
|
-
enumerable: true,
|
|
1411
|
-
configurable: true
|
|
1412
|
-
});
|
|
1413
1392
|
Object.defineProperty(UploadAssetsService.prototype, "errorFiles", {
|
|
1414
1393
|
get: /**
|
|
1415
1394
|
* @return {?}
|
|
1416
1395
|
*/
|
|
1417
1396
|
function () {
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
* @param {?} newError
|
|
1426
|
-
* @return {?}
|
|
1427
|
-
*/
|
|
1428
|
-
function (newError) {
|
|
1429
|
-
this.errorsMap = __assign({}, this.errorsMap, newError);
|
|
1430
|
-
},
|
|
1431
|
-
enumerable: true,
|
|
1432
|
-
configurable: true
|
|
1433
|
-
});
|
|
1434
|
-
Object.defineProperty(UploadAssetsService.prototype, "fileErrors", {
|
|
1435
|
-
get: /**
|
|
1436
|
-
* @return {?}
|
|
1437
|
-
*/
|
|
1438
|
-
function () {
|
|
1439
|
-
return this.errorsMap;
|
|
1397
|
+
/** @type {?} */
|
|
1398
|
+
var invalidFiles = this.fileNames.filter((/**
|
|
1399
|
+
* @param {?} file
|
|
1400
|
+
* @return {?}
|
|
1401
|
+
*/
|
|
1402
|
+
function (file) { return !file.valid; }));
|
|
1403
|
+
return this.fileNames.length && invalidFiles.length > 0;
|
|
1440
1404
|
},
|
|
1441
1405
|
enumerable: true,
|
|
1442
1406
|
configurable: true
|
|
@@ -1446,30 +1410,26 @@ var UploadAssetsService = /** @class */ (function () {
|
|
|
1446
1410
|
* @return {?}
|
|
1447
1411
|
*/
|
|
1448
1412
|
function () {
|
|
1449
|
-
return
|
|
1413
|
+
return this.fileNames.filter((/**
|
|
1414
|
+
* @param {?} file
|
|
1415
|
+
* @return {?}
|
|
1416
|
+
*/
|
|
1417
|
+
function (file) { return !file.valid; })).length;
|
|
1450
1418
|
},
|
|
1451
1419
|
enumerable: true,
|
|
1452
1420
|
configurable: true
|
|
1453
1421
|
});
|
|
1454
1422
|
/**
|
|
1455
|
-
* @param {?} fileName
|
|
1456
1423
|
* @param {?} index
|
|
1457
1424
|
* @return {?}
|
|
1458
1425
|
*/
|
|
1459
1426
|
UploadAssetsService.prototype.deleteFile = /**
|
|
1460
|
-
* @param {?} fileName
|
|
1461
1427
|
* @param {?} index
|
|
1462
1428
|
* @return {?}
|
|
1463
1429
|
*/
|
|
1464
|
-
function (
|
|
1465
|
-
this.files
|
|
1466
|
-
|
|
1467
|
-
* @param {?} i
|
|
1468
|
-
* @return {?}
|
|
1469
|
-
*/
|
|
1470
|
-
function (_file, i) { return i !== index; }));
|
|
1471
|
-
delete this.namesMap[fileName];
|
|
1472
|
-
delete this.errorsMap[fileName];
|
|
1430
|
+
function (index) {
|
|
1431
|
+
this.files.splice(index, 1);
|
|
1432
|
+
this.fileNames.splice(index, 1);
|
|
1473
1433
|
};
|
|
1474
1434
|
/**
|
|
1475
1435
|
* @param {?} parentAssetId
|
|
@@ -1480,34 +1440,23 @@ var UploadAssetsService = /** @class */ (function () {
|
|
|
1480
1440
|
* @return {?}
|
|
1481
1441
|
*/
|
|
1482
1442
|
function (parentAssetId) {
|
|
1483
|
-
var
|
|
1484
|
-
|
|
1443
|
+
var files = this.files;
|
|
1444
|
+
/** @type {?} */
|
|
1445
|
+
var fileNames = this.fileNames.map((/**
|
|
1446
|
+
* @param {?} file
|
|
1447
|
+
* @return {?}
|
|
1448
|
+
*/
|
|
1449
|
+
function (file) { return file.name; }));
|
|
1485
1450
|
/** @type {?} */
|
|
1486
1451
|
var formData = new FormData();
|
|
1487
1452
|
formData.append('parentAssetId', parentAssetId);
|
|
1488
1453
|
formData.append('companyId', '732DA8D2-04EC-4BE0-A168-63EE0DCF50D8');
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1496
|
-
/** @type {?} */
|
|
1497
|
-
var originName = file.name;
|
|
1498
|
-
/** @type {?} */
|
|
1499
|
-
var fileName = namesMap[originName]
|
|
1500
|
-
? "" + namesMap[originName] + ext
|
|
1501
|
-
: originName;
|
|
1502
|
-
formData.append('files', file, fileName);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1506
|
-
finally {
|
|
1507
|
-
try {
|
|
1508
|
-
if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);
|
|
1509
|
-
}
|
|
1510
|
-
finally { if (e_1) throw e_1.error; }
|
|
1454
|
+
for (var i = 0; i < files.length; i++) {
|
|
1455
|
+
/** @type {?} */
|
|
1456
|
+
var nameSplit = files[i].name.split('.');
|
|
1457
|
+
/** @type {?} */
|
|
1458
|
+
var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1459
|
+
formData.append('files', files[i], "" + fileNames[i] + ext);
|
|
1511
1460
|
}
|
|
1512
1461
|
return this._api.post(this.baseUrl + "/File/Upload", formData);
|
|
1513
1462
|
};
|
|
@@ -1528,16 +1477,8 @@ if (false) {
|
|
|
1528
1477
|
* @private
|
|
1529
1478
|
*/
|
|
1530
1479
|
UploadAssetsService.prototype.files;
|
|
1531
|
-
/**
|
|
1532
|
-
|
|
1533
|
-
* @private
|
|
1534
|
-
*/
|
|
1535
|
-
UploadAssetsService.prototype.namesMap;
|
|
1536
|
-
/**
|
|
1537
|
-
* @type {?}
|
|
1538
|
-
* @private
|
|
1539
|
-
*/
|
|
1540
|
-
UploadAssetsService.prototype.errorsMap;
|
|
1480
|
+
/** @type {?} */
|
|
1481
|
+
UploadAssetsService.prototype.fileNames;
|
|
1541
1482
|
/** @type {?} */
|
|
1542
1483
|
UploadAssetsService.prototype.supportedSize;
|
|
1543
1484
|
/** @type {?} */
|
|
@@ -2278,6 +2219,7 @@ var FileItemComponent = /** @class */ (function () {
|
|
|
2278
2219
|
ext: '',
|
|
2279
2220
|
data: null,
|
|
2280
2221
|
errors: {
|
|
2222
|
+
maxLength: false,
|
|
2281
2223
|
ext: false,
|
|
2282
2224
|
size: false,
|
|
2283
2225
|
},
|
|
@@ -2290,40 +2232,67 @@ var FileItemComponent = /** @class */ (function () {
|
|
|
2290
2232
|
* @return {?}
|
|
2291
2233
|
*/
|
|
2292
2234
|
function () {
|
|
2293
|
-
this.
|
|
2235
|
+
this.initDataFile();
|
|
2294
2236
|
};
|
|
2295
2237
|
/**
|
|
2296
2238
|
* @private
|
|
2297
|
-
* @param {?} file
|
|
2298
2239
|
* @return {?}
|
|
2299
2240
|
*/
|
|
2300
|
-
FileItemComponent.prototype.
|
|
2241
|
+
FileItemComponent.prototype.initDataFile = /**
|
|
2301
2242
|
* @private
|
|
2302
|
-
* @param {?} file
|
|
2303
2243
|
* @return {?}
|
|
2304
2244
|
*/
|
|
2305
|
-
function (
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2245
|
+
function () {
|
|
2246
|
+
this.setDetailsFile();
|
|
2247
|
+
this.setErrorFile();
|
|
2248
|
+
};
|
|
2249
|
+
/**
|
|
2250
|
+
* @private
|
|
2251
|
+
* @return {?}
|
|
2252
|
+
*/
|
|
2253
|
+
FileItemComponent.prototype.setDetailsFile = /**
|
|
2254
|
+
* @private
|
|
2255
|
+
* @return {?}
|
|
2256
|
+
*/
|
|
2257
|
+
function () {
|
|
2258
|
+
var _a = this.file, name = _a.name, size = _a.size;
|
|
2259
|
+
var files = this.uploadAssetService.getFiles;
|
|
2309
2260
|
/** @type {?} */
|
|
2310
|
-
var
|
|
2261
|
+
var names = files.filter((/**
|
|
2262
|
+
* @param {?} file
|
|
2263
|
+
* @return {?}
|
|
2264
|
+
*/
|
|
2265
|
+
function (file) { return file.name === name; }));
|
|
2266
|
+
/** @type {?} */
|
|
2267
|
+
var nameSplit = name.split('.');
|
|
2268
|
+
if (names.length > 1) {
|
|
2269
|
+
nameSplit[0] = nameSplit[0] + "(" + (names.length - 1) + ")";
|
|
2270
|
+
}
|
|
2311
2271
|
this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
2312
2272
|
this.dataFile.name = nameSplit.join('.');
|
|
2313
|
-
this.dataFile.size =
|
|
2273
|
+
this.dataFile.size = size;
|
|
2274
|
+
};
|
|
2275
|
+
/**
|
|
2276
|
+
* @private
|
|
2277
|
+
* @return {?}
|
|
2278
|
+
*/
|
|
2279
|
+
FileItemComponent.prototype.setErrorFile = /**
|
|
2280
|
+
* @private
|
|
2281
|
+
* @return {?}
|
|
2282
|
+
*/
|
|
2283
|
+
function () {
|
|
2284
|
+
var _this = this;
|
|
2285
|
+
var _a = this.uploadAssetService, supportedTypes = _a.supportedTypes, supportedSize = _a.supportedSize, fileNames = _a.fileNames;
|
|
2286
|
+
var _b = this.dataFile, name = _b.name, extFile = _b.ext, sizeFile = _b.size;
|
|
2314
2287
|
this.dataFile.errors = {
|
|
2315
|
-
|
|
2316
|
-
|
|
2288
|
+
maxLength: name.length + extFile.length > 199,
|
|
2289
|
+
ext: supportedTypes.indexOf("." + extFile) < 0,
|
|
2290
|
+
size: supportedSize < sizeFile,
|
|
2317
2291
|
};
|
|
2318
|
-
|
|
2319
|
-
if (ext || size) {
|
|
2320
|
-
this.uploadAssetService.errors = (_a = {}, _a[file.name] = true, _a);
|
|
2321
|
-
this.checkError.emit();
|
|
2322
|
-
}
|
|
2323
|
-
if (file.type.indexOf('image') > -1) {
|
|
2292
|
+
if (this.file.type.indexOf('image') > -1) {
|
|
2324
2293
|
/** @type {?} */
|
|
2325
2294
|
var reader = new FileReader();
|
|
2326
|
-
reader.readAsDataURL(file);
|
|
2295
|
+
reader.readAsDataURL(this.file);
|
|
2327
2296
|
reader.onload = (/**
|
|
2328
2297
|
* @param {?} readerEvent
|
|
2329
2298
|
* @return {?}
|
|
@@ -2340,8 +2309,24 @@ var FileItemComponent = /** @class */ (function () {
|
|
|
2340
2309
|
});
|
|
2341
2310
|
});
|
|
2342
2311
|
}
|
|
2312
|
+
fileNames.push({
|
|
2313
|
+
name: name,
|
|
2314
|
+
valid: this.checkErrors()
|
|
2315
|
+
});
|
|
2343
2316
|
this.uploadAssetService.setErrorObs(this.uploadAssetService.errorFiles);
|
|
2344
2317
|
};
|
|
2318
|
+
/**
|
|
2319
|
+
* @private
|
|
2320
|
+
* @return {?}
|
|
2321
|
+
*/
|
|
2322
|
+
FileItemComponent.prototype.checkErrors = /**
|
|
2323
|
+
* @private
|
|
2324
|
+
* @return {?}
|
|
2325
|
+
*/
|
|
2326
|
+
function () {
|
|
2327
|
+
var _a = this.dataFile.errors, ext = _a.ext, size = _a.size, maxLength = _a.maxLength;
|
|
2328
|
+
return (ext || size || maxLength) ? false : true;
|
|
2329
|
+
};
|
|
2345
2330
|
/**
|
|
2346
2331
|
* @param {?} event
|
|
2347
2332
|
* @return {?}
|
|
@@ -2352,7 +2337,12 @@ var FileItemComponent = /** @class */ (function () {
|
|
|
2352
2337
|
*/
|
|
2353
2338
|
function (event) {
|
|
2354
2339
|
this.dataFile.name = ((/** @type {?} */ (event.target))).value.trim();
|
|
2355
|
-
this.
|
|
2340
|
+
var _a = this.dataFile, name = _a.name, ext = _a.ext;
|
|
2341
|
+
this.dataFile.errors.maxLength = name.length + ext.length > 199;
|
|
2342
|
+
this.fileChange.emit({
|
|
2343
|
+
name: this.dataFile.name,
|
|
2344
|
+
valid: this.checkErrors()
|
|
2345
|
+
});
|
|
2356
2346
|
};
|
|
2357
2347
|
/**
|
|
2358
2348
|
* @return {?}
|
|
@@ -2366,7 +2356,7 @@ var FileItemComponent = /** @class */ (function () {
|
|
|
2366
2356
|
FileItemComponent.decorators = [
|
|
2367
2357
|
{ type: Component, args: [{
|
|
2368
2358
|
selector: 'lib-file-item',
|
|
2369
|
-
template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Extension: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
|
|
2359
|
+
template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Extension: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n <div *ngIf=\"dataFile.errors.maxLength\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['maxLength'] }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
|
|
2370
2360
|
styles: [":host::ng-deep{padding:10px 5%;display:flex;justify-content:space-between;align-items:center;background-color:#f9f9f9;border-radius:10px}:host::ng-deep .file-item__img{display:flex;justify-content:center;align-items:center;width:250px;height:150px;border-radius:10px}:host::ng-deep .file-item__img img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}:host::ng-deep .file-item__img img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .file-item__img mat-icon{font-size:100px;width:auto;height:auto}:host::ng-deep .file-item__content{flex:1;padding-left:5%;padding-right:5%}:host::ng-deep .file-item__content--name{width:100%;padding:10px;border:1px solid #d8d8d8;border-radius:5px}:host::ng-deep .file-item__content--info{margin-top:10px;display:flex}:host::ng-deep .file-item__content--info__item:not(:last-child){margin-right:50px}:host::ng-deep .file-item__content--info__item span{color:#000;text-transform:uppercase}:host::ng-deep .file-item__error{margin-top:10px;color:#f44336}:host::ng-deep .file-item__action{color:#f44336;cursor:pointer}"]
|
|
2371
2361
|
}] }
|
|
2372
2362
|
];
|
|
@@ -2435,32 +2425,32 @@ var FileListComponent = /** @class */ (function () {
|
|
|
2435
2425
|
((/** @type {?} */ (document.getElementById('file-import')))).value = '';
|
|
2436
2426
|
};
|
|
2437
2427
|
/**
|
|
2438
|
-
* @param {?} fileName
|
|
2439
2428
|
* @param {?} index
|
|
2440
2429
|
* @return {?}
|
|
2441
2430
|
*/
|
|
2442
2431
|
FileListComponent.prototype.onDelFile = /**
|
|
2443
|
-
* @param {?} fileName
|
|
2444
2432
|
* @param {?} index
|
|
2445
2433
|
* @return {?}
|
|
2446
2434
|
*/
|
|
2447
|
-
function (
|
|
2448
|
-
this.uploadAssetsService.deleteFile(
|
|
2435
|
+
function (index) {
|
|
2436
|
+
this.uploadAssetsService.deleteFile(index);
|
|
2449
2437
|
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2450
2438
|
};
|
|
2451
2439
|
/**
|
|
2452
|
-
* @param {?}
|
|
2453
|
-
* @param {?}
|
|
2440
|
+
* @param {?} __0
|
|
2441
|
+
* @param {?} index
|
|
2454
2442
|
* @return {?}
|
|
2455
2443
|
*/
|
|
2456
2444
|
FileListComponent.prototype.onChangeName = /**
|
|
2457
|
-
* @param {?}
|
|
2458
|
-
* @param {?}
|
|
2445
|
+
* @param {?} __0
|
|
2446
|
+
* @param {?} index
|
|
2459
2447
|
* @return {?}
|
|
2460
2448
|
*/
|
|
2461
|
-
function (
|
|
2462
|
-
var _a;
|
|
2463
|
-
this.uploadAssetsService.
|
|
2449
|
+
function (_a, index) {
|
|
2450
|
+
var name = _a.name, valid = _a.valid;
|
|
2451
|
+
var fileNames = this.uploadAssetsService.fileNames;
|
|
2452
|
+
fileNames[index] = { name: name, valid: valid };
|
|
2453
|
+
this.uploadAssetsService.setErrorObs(this.uploadAssetsService.errorFiles);
|
|
2464
2454
|
};
|
|
2465
2455
|
/**
|
|
2466
2456
|
* @return {?}
|
|
@@ -2474,7 +2464,7 @@ var FileListComponent = /** @class */ (function () {
|
|
|
2474
2464
|
FileListComponent.decorators = [
|
|
2475
2465
|
{ type: Component, args: [{
|
|
2476
2466
|
selector: 'lib-file-list',
|
|
2477
|
-
template: "<div class=\"file-list__heading\">\n <div class=\"file-list__info\">\n <h4 class=\"file-list__info--title\">\n <span *ngIf=\"!uploadAssetsService.errorLength\">\n {{\n uploadAssetsService?.getFiles?.length -\n uploadAssetsService.errorLength\n }}\n {{ uploadAssetsService?.getFiles?.length > 1 ? 'assets' : 'asset' }}\n ready to upload\n </span>\n <span *ngIf=\"uploadAssetsService.errorLength\">\n {{ uploadAssetsService.errorLength }}\n {{ uploadAssetsService.errorLength > 1 ? 'assets' : 'asset' }}\n invalid, please remove it before upload</span\n >\n </h4>\n <div class=\"file-list__info--desc\">\n Manage the assets before adding them to the Media Library\n </div>\n </div>\n <lib-input-file\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\n (onFileChange)=\"onFileChange($event)\"\n color=\"primary\"\n >\n <span>Add new assets</span>\n </lib-input-file>\n</div>\n<div class=\"file-list\">\n <lib-file-item\n *ngFor=\"let file of uploadAssetsService?.getFiles; let i = index\"\n [file]=\"file\"\n (checkError)=\"onEmitError()\"\n (fileRemove)=\"onDelFile(
|
|
2467
|
+
template: "<div class=\"file-list__heading\">\n <div class=\"file-list__info\">\n <h4 class=\"file-list__info--title\">\n <span *ngIf=\"!uploadAssetsService.errorLength\">\n {{\n uploadAssetsService?.getFiles?.length -\n uploadAssetsService.errorLength\n }}\n {{ uploadAssetsService?.getFiles?.length > 1 ? 'assets' : 'asset' }}\n ready to upload\n </span>\n <span *ngIf=\"uploadAssetsService.errorLength\">\n {{ uploadAssetsService.errorLength }}\n {{ uploadAssetsService.errorLength > 1 ? 'assets' : 'asset' }}\n invalid, please remove it before upload</span\n >\n </h4>\n <div class=\"file-list__info--desc\">\n Manage the assets before adding them to the Media Library\n </div>\n </div>\n <lib-input-file\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\n (onFileChange)=\"onFileChange($event)\"\n color=\"primary\"\n >\n <span>Add new assets</span>\n </lib-input-file>\n</div>\n<div class=\"file-list\">\n <lib-file-item\n *ngFor=\"let file of uploadAssetsService?.getFiles; let i = index\"\n [file]=\"file\"\n (checkError)=\"onEmitError()\"\n (fileRemove)=\"onDelFile(i)\"\n (fileChange)=\"onChangeName($event, i)\"\n ></lib-file-item>\n</div>\n",
|
|
2478
2468
|
styles: [":host::ng-deep .file-list{padding-top:15px}:host::ng-deep .file-list__heading{display:flex;justify-content:space-between;align-items:center;padding-top:15px;padding-bottom:15px;position:-webkit-sticky;position:sticky;top:0;background-color:#fff}:host::ng-deep .file-list__info--title{font-size:16px;margin-bottom:5px;color:#000}:host::ng-deep lib-file-item{margin-bottom:20px}"]
|
|
2479
2469
|
}] }
|
|
2480
2470
|
];
|
|
@@ -2513,34 +2503,6 @@ var UploadFileComponent = /** @class */ (function () {
|
|
|
2513
2503
|
* @return {?}
|
|
2514
2504
|
*/
|
|
2515
2505
|
function () { };
|
|
2516
|
-
/**
|
|
2517
|
-
* @param {?} fileName
|
|
2518
|
-
* @param {?} index
|
|
2519
|
-
* @return {?}
|
|
2520
|
-
*/
|
|
2521
|
-
UploadFileComponent.prototype.onDelFile = /**
|
|
2522
|
-
* @param {?} fileName
|
|
2523
|
-
* @param {?} index
|
|
2524
|
-
* @return {?}
|
|
2525
|
-
*/
|
|
2526
|
-
function (fileName, index) {
|
|
2527
|
-
this.uploadAssetsService.deleteFile(fileName, index);
|
|
2528
|
-
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2529
|
-
};
|
|
2530
|
-
/**
|
|
2531
|
-
* @param {?} newName
|
|
2532
|
-
* @param {?} originName
|
|
2533
|
-
* @return {?}
|
|
2534
|
-
*/
|
|
2535
|
-
UploadFileComponent.prototype.onChangeName = /**
|
|
2536
|
-
* @param {?} newName
|
|
2537
|
-
* @param {?} originName
|
|
2538
|
-
* @return {?}
|
|
2539
|
-
*/
|
|
2540
|
-
function (newName, originName) {
|
|
2541
|
-
var _a;
|
|
2542
|
-
this.uploadAssetsService.newName = (_a = {}, _a[originName] = newName, _a);
|
|
2543
|
-
};
|
|
2544
2506
|
/**
|
|
2545
2507
|
* @param {?} newFiles
|
|
2546
2508
|
* @return {?}
|
|
@@ -2642,7 +2604,10 @@ var AddFolderDialogComponent = /** @class */ (function () {
|
|
|
2642
2604
|
this.destroy$ = new Subject();
|
|
2643
2605
|
this.form = new FormControl();
|
|
2644
2606
|
this.formGroup = this.fb.group({
|
|
2645
|
-
name: ['',
|
|
2607
|
+
name: ['', [
|
|
2608
|
+
Validators.maxLength(200),
|
|
2609
|
+
Validators.required
|
|
2610
|
+
]],
|
|
2646
2611
|
});
|
|
2647
2612
|
}
|
|
2648
2613
|
/**
|
|
@@ -2727,7 +2692,7 @@ var AddFolderDialogComponent = /** @class */ (function () {
|
|
|
2727
2692
|
AddFolderDialogComponent.decorators = [
|
|
2728
2693
|
{ type: Component, args: [{
|
|
2729
2694
|
selector: 'lib-add-folder-dialog',
|
|
2730
|
-
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=\"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?.
|
|
2695
|
+
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",
|
|
2731
2696
|
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}"]
|
|
2732
2697
|
}] }
|
|
2733
2698
|
];
|
|
@@ -2798,7 +2763,10 @@ var EditFolderDialogComponent = /** @class */ (function () {
|
|
|
2798
2763
|
this.destroy$ = new Subject();
|
|
2799
2764
|
this.form = new FormControl();
|
|
2800
2765
|
this.formGroup = this.fb.group({
|
|
2801
|
-
name: [this.data.name,
|
|
2766
|
+
name: [this.data.name, [
|
|
2767
|
+
Validators.maxLength(200),
|
|
2768
|
+
Validators.required
|
|
2769
|
+
]],
|
|
2802
2770
|
});
|
|
2803
2771
|
}
|
|
2804
2772
|
/**
|
|
@@ -2886,7 +2854,7 @@ var EditFolderDialogComponent = /** @class */ (function () {
|
|
|
2886
2854
|
EditFolderDialogComponent.decorators = [
|
|
2887
2855
|
{ type: Component, args: [{
|
|
2888
2856
|
selector: 'lib-edit-folder-dialog',
|
|
2889
|
-
template: "<lib-modal heading=\"Rename folder\">\n <ng-container content>\n <form (ngSubmit)=\"editFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n matInput\n required\n autocomplete=\"off\"\n formControlName=\"name\"\n (input)=\"onChange($event)\"\n placeholder=\"Enter your folder name\"\n pattern=\".*\\S+.*\"\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=\"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)=\"editFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || formGroup?.controls?.name?.errors?.pattern\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
2857
|
+
template: "<lib-modal heading=\"Rename folder\">\n <ng-container content>\n <form (ngSubmit)=\"editFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n matInput\n required\n autocomplete=\"off\"\n formControlName=\"name\"\n (input)=\"onChange($event)\"\n placeholder=\"Enter your folder name\"\n pattern=\".*\\S+.*\"\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)=\"editFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || formGroup?.controls?.name?.errors?.pattern\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
2890
2858
|
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}"]
|
|
2891
2859
|
}] }
|
|
2892
2860
|
];
|
|
@@ -3786,6 +3754,7 @@ var AssetDialogComponent = /** @class */ (function () {
|
|
|
3786
3754
|
*/
|
|
3787
3755
|
function () {
|
|
3788
3756
|
return (!this.fileName.length ||
|
|
3757
|
+
this.fileName.length + this.assetDetails.Extension.length > 199 || // limit 200
|
|
3789
3758
|
!!this.errorMessage ||
|
|
3790
3759
|
this.patternError ||
|
|
3791
3760
|
this.isUpdating);
|
|
@@ -4048,7 +4017,7 @@ var AssetDialogComponent = /** @class */ (function () {
|
|
|
4048
4017
|
AssetDialogComponent.decorators = [
|
|
4049
4018
|
{ type: Component, args: [{
|
|
4050
4019
|
selector: 'lib-asset-dialog',
|
|
4051
|
-
template: "<lib-modal\n [heading]=\"assetDetails?.OriginalFileNameWithoutExtension || data?.name\"\n>\n <ng-container content>\n <div *ngIf=\"isLoading; else contentAsset\" class=\"file-details__loading\">\n <div>\n <mat-spinner></mat-spinner>\n </div>\n </div>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n class=\"update__action\"\n [class.loading]=\"isUpdating\"\n mat-raised-button\n color=\"primary\"\n (click)=\"updateAsset()\"\n [disabled]=\"disabled\"\n >\n <ng-container *ngIf=\"isUpdating\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n<ng-template #contentAsset>\n <div class=\"file-details__item\">\n <div class=\"file-details__image\">\n <div class=\"file-details__image--heading\">\n <mat-error\n *ngIf=\"replaceMessage\"\n [innerHTML]=\"replaceMessage\"\n ></mat-error>\n <div class=\"file-details__action\">\n <lib-input-file\n matTooltip=\"Replace\"\n [acceptTypes]=\"acceptTypes.join(', ')\"\n (onFileChange)=\"replaceAsset($event)\"\n [multiple]=\"false\"\n >\n <mat-icon class=\"icon-sync\">sync</mat-icon>\n </lib-input-file>\n <a [href]=\"linkDownload\" matTooltip=\"Download\" mat-raised-button>\n <mat-icon class=\"icon-download\">get_app</mat-icon>\n </a>\n <button matTooltip=\"Delete\" mat-raised-button (click)=\"deleteAsset()\">\n <mat-icon class=\"icon-delete\">delete_outline</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"file-details__img\">\n <ng-container\n *ngIf=\"\n assetDetails?.FileType === fileType.DOCUMENT ||\n assetDetails?.FileType === fileType.IMAGE;\n else defaultFile\n \"\n >\n <img\n [class.image]=\"assetDetails?.FileType === fileType.IMAGE\"\n [src]=\"\n assetDetails?.FileType === fileType.IMAGE\n ? assetDetails?.UrlDetail\n : base64Pdf\n \"\n [alt]=\"assetDetails?.FilePath\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n </div>\n </div>\n </div>\n <div class=\"file-details__item\">\n <div class=\"file-details__info\">\n <div class=\"file-details__info--name\">\n <div class=\"file-details__label\">File name</div>\n <input\n class=\"file-details__input\"\n matInput\n placeholder=\"Enter your folder name\"\n [value]=\"fileName\"\n required\n (input)=\"onChangeName($event)\"\n />\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n <mat-error *ngIf=\"patternError\">\n This field does not allow only whitespace\n </mat-error>\n </div>\n <div class=\"file-details__info--description\">\n <div class=\"file-details__label\">Description</div>\n <textarea\n class=\"file-details__textarea custom-scrollbar\"\n matInput\n placeholder=\"Enter description\"\n [value]=\"description\"\n (input)=\"onChangeDescription($event)\"\n maxlength=\"200\"\n rows=\"3\"\n >\n </textarea>\n </div>\n\n <div class=\"file-details__info--details\">\n <div class=\"file-details__info--size\">\n <div class=\"file-details__label\">Size</div>\n <div>{{ assetDetails?.Size }}</div>\n </div>\n <div class=\"file-details__info--ext\">\n <div class=\"file-details__label\">Extension</div>\n <div>{{ assetDetails?.Extension }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Created date</div>\n <div>{{ assetDetails?.CreatedDate | localDate }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Updated date</div>\n <div>\n {{ assetDetails?.ModifiedDate | localDate }}\n </div>\n </div>\n <div\n *ngIf=\"\n assetDetails?.FileType === fileType.IMAGE &&\n assetDetails?.Extension !== 'svg'\n \"\n class=\"file-details__info--dimension\"\n >\n <div class=\"file-details__label\">Dimensions</div>\n <div>{{ assetDetails?.Width }}x{{ assetDetails?.Height }}</div>\n </div>\n </div>\n <div class=\"file-details__link\">\n <div class=\"file-details__label\">Public Url</div>\n <div class=\"break-word\">\n <span>{{ assetDetails?.CloudUrl }} </span>\n <mat-icon matTooltip=\"Copy\" (click)=\"copyText(assetDetails?.CloudUrl)\"\n >content_copy</mat-icon\n >\n </div>\n </div>\n <span class=\"file-details__copy\" [class.visible]=\"isCopied\">Copied!</span>\n </div>\n </div>\n</ng-template>\n",
|
|
4020
|
+
template: "<lib-modal\n [heading]=\"assetDetails?.OriginalFileNameWithoutExtension || data?.name\"\n>\n <ng-container content>\n <div *ngIf=\"isLoading; else contentAsset\" class=\"file-details__loading\">\n <div>\n <mat-spinner></mat-spinner>\n </div>\n </div>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n class=\"update__action\"\n [class.loading]=\"isUpdating\"\n mat-raised-button\n color=\"primary\"\n (click)=\"updateAsset()\"\n [disabled]=\"disabled\"\n >\n <ng-container *ngIf=\"isUpdating\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n<ng-template #contentAsset>\n <div class=\"file-details__item\">\n <div class=\"file-details__image\">\n <div class=\"file-details__image--heading\">\n <mat-error\n *ngIf=\"replaceMessage\"\n [innerHTML]=\"replaceMessage\"\n ></mat-error>\n <div class=\"file-details__action\">\n <lib-input-file\n matTooltip=\"Replace\"\n [acceptTypes]=\"acceptTypes.join(', ')\"\n (onFileChange)=\"replaceAsset($event)\"\n [multiple]=\"false\"\n >\n <mat-icon class=\"icon-sync\">sync</mat-icon>\n </lib-input-file>\n <a [href]=\"linkDownload\" matTooltip=\"Download\" mat-raised-button>\n <mat-icon class=\"icon-download\">get_app</mat-icon>\n </a>\n <button matTooltip=\"Delete\" mat-raised-button (click)=\"deleteAsset()\">\n <mat-icon class=\"icon-delete\">delete_outline</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"file-details__img\">\n <ng-container\n *ngIf=\"\n assetDetails?.FileType === fileType.DOCUMENT ||\n assetDetails?.FileType === fileType.IMAGE;\n else defaultFile\n \"\n >\n <img\n [class.image]=\"assetDetails?.FileType === fileType.IMAGE\"\n [src]=\"\n assetDetails?.FileType === fileType.IMAGE\n ? assetDetails?.UrlDetail\n : base64Pdf\n \"\n [alt]=\"assetDetails?.FilePath\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n </div>\n </div>\n </div>\n <div class=\"file-details__item\">\n <div class=\"file-details__info\">\n <div class=\"file-details__info--name\">\n <div class=\"file-details__label\">File name</div>\n <input\n class=\"file-details__input\"\n matInput\n placeholder=\"Enter your folder name\"\n [value]=\"fileName\"\n required\n (input)=\"onChangeName($event)\"\n />\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n <mat-error *ngIf=\"patternError\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"fileName?.length + assetDetails.Extension.length > 199\">\n The character limit is 200 characters\n </mat-error>\n </div>\n <div class=\"file-details__info--description\">\n <div class=\"file-details__label\">Description</div>\n <textarea\n class=\"file-details__textarea custom-scrollbar\"\n matInput\n placeholder=\"Enter description\"\n [value]=\"description\"\n (input)=\"onChangeDescription($event)\"\n maxlength=\"200\"\n rows=\"3\"\n >\n </textarea>\n </div>\n\n <div class=\"file-details__info--details\">\n <div class=\"file-details__info--size\">\n <div class=\"file-details__label\">Size</div>\n <div>{{ assetDetails?.Size }}</div>\n </div>\n <div class=\"file-details__info--ext\">\n <div class=\"file-details__label\">Extension</div>\n <div>{{ assetDetails?.Extension }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Created date</div>\n <div>{{ assetDetails?.CreatedDate | localDate }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Updated date</div>\n <div>\n {{ assetDetails?.ModifiedDate | localDate }}\n </div>\n </div>\n <div\n *ngIf=\"\n assetDetails?.FileType === fileType.IMAGE &&\n assetDetails?.Extension !== 'svg'\n \"\n class=\"file-details__info--dimension\"\n >\n <div class=\"file-details__label\">Dimensions</div>\n <div>{{ assetDetails?.Width }}x{{ assetDetails?.Height }}</div>\n </div>\n </div>\n <div class=\"file-details__link\">\n <div class=\"file-details__label\">Public Url</div>\n <div class=\"break-word\">\n <span>{{ assetDetails?.CloudUrl }} </span>\n <mat-icon matTooltip=\"Copy\" (click)=\"copyText(assetDetails?.CloudUrl)\"\n >content_copy</mat-icon\n >\n </div>\n </div>\n <span class=\"file-details__copy\" [class.visible]=\"isCopied\">Copied!</span>\n </div>\n </div>\n</ng-template>\n",
|
|
4052
4021
|
providers: [FileSizePipe],
|
|
4053
4022
|
styles: [":host::ng-deep .mat-dialog-content{position:relative;display:flex;flex:1;justify-content:space-between;align-items:flex-start;font-size:14px;line-height:24px;color:#000;min-height:400px}:host::ng-deep .file-details__loading{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1}:host::ng-deep .file-details__item{width:50%;padding:20px 10px;position:relative}:host::ng-deep .file-details__image{padding:20px;background:#f9f9f9;border:1px solid #e0e0e0;border-radius:10px}:host::ng-deep .file-details__image--heading{display:flex;justify-content:flex-end}:host::ng-deep .file-details__image--heading .mat-error{flex:1;margin-top:0}:host::ng-deep .file-details__action{margin-bottom:20px}:host::ng-deep .file-details__action>*{margin-left:10px}:host::ng-deep .file-details__action .mat-button-base{padding:0;min-width:40px}:host::ng-deep .file-details__action .icon-download,:host::ng-deep .file-details__action .icon-sync{color:#979797}:host::ng-deep .file-details__action .icon-delete{color:#f44336}:host::ng-deep .file-details__img{position:relative;padding-bottom:66.66%;text-align:center}:host::ng-deep .file-details__img img{max-width:100%;max-height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .file-details__img img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .file-details__img mat-icon{font-size:100px;width:auto;height:auto}:host::ng-deep .file-details__info{position:relative}:host::ng-deep .file-details__info--name{padding-bottom:20px;position:relative}:host::ng-deep .file-details__info--name .mat-error{margin-top:0;position:absolute;left:0;bottom:0;font-size:13px;line-height:20px}:host::ng-deep .file-details__info--description{padding-bottom:10px}:host::ng-deep .file-details__info--details{display:flex;flex-wrap:wrap;flex:1}:host::ng-deep .file-details__info--details>*{width:50%;margin-top:10px}:host::ng-deep .file-details__input,:host::ng-deep .file-details__textarea{margin-top:7px}:host::ng-deep .file-details__link{margin-top:15px}:host::ng-deep .file-details__link .mat-icon{font-size:16px;cursor:pointer}:host::ng-deep .file-details__label{color:#979797}:host::ng-deep .file-details__copy{opacity:0;position:absolute;top:50%;left:50%;background-color:rgba(0,0,0,.5);color:#fff;padding:15px;border-radius:5px;transform:translate(-50%,-50%)}:host::ng-deep .file-details__copy.visible{opacity:1}:host::ng-deep .update__action{min-width:100px}:host::ng-deep .update__action.loading{padding:0 5px}:host::ng-deep .update__action.loading .mat-button-wrapper{display:flex;width:100%;justify-content:center;align-items:center}:host::ng-deep .update__action.loading .mat-spinner{margin-right:10px}:host::ng-deep .break-word{word-break:break-word}"]
|
|
4054
4023
|
}] }
|
|
@@ -4259,8 +4228,8 @@ var AssetItemComponent = /** @class */ (function () {
|
|
|
4259
4228
|
AssetItemComponent.decorators = [
|
|
4260
4229
|
{ type: Component, args: [{
|
|
4261
4230
|
selector: 'lib-asset-item',
|
|
4262
|
-
template: "<div class=\"asset-wrapper\">\n <div class=\"asset-content\">\n <div class=\"asset-content__header\">\n <button class=\"asset-content__header--button\" mat-raised-button>\n <mat-checkbox\n class=\"checkbox\"\n [checked]=\"checkSelectedAsset\"\n
|
|
4263
|
-
styles: [":host::ng-deep .asset-wrapper{padding:5px}:host::ng-deep .asset-wrapper .asset-content{overflow:hidden;position:relative;border-radius:10px;border:1px solid #d8d8d8;font-size:14px;transition:.3s cubic-bezier(.25,.8,.25,1)}:host::ng-deep .asset-wrapper .asset-content:hover{box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}:host::ng-deep .asset-wrapper .asset-content__header{position:absolute;z-index:1;top:0;left:0;width:100%;display:flex;justify-content:space-between;padding:14px}:host::ng-deep .asset-wrapper .asset-content__header--button{width:30px;height:30px;min-width:30px;display:flex;align-items:center;justify-content:center;text-align:center;color:rgba(0,0,0,.65);background:rgba(255,255,255,.6)}:host::ng-deep .asset-wrapper .asset-content__header--button:hover{background:#fff}:host::ng-deep .asset-wrapper .asset-content__header--button.edit-button{transition:.3s cubic-bezier(.25,.8,.25,1);opacity:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-icon{font-size:22px}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox{display:flex;align-items:center}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout{margin:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout .mat-checkbox-frame{color:#767676}:host::ng-deep .asset-wrapper .asset-content__body{padding-bottom:66.66%;background:#f1f1f1;position:relative}:host::ng-deep .asset-wrapper .asset-content__body img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .asset-wrapper .asset-content__body img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .asset-wrapper .asset-content__body img.pdf{width:75%;height:75%}:host::ng-deep .asset-wrapper .asset-content__footer{display:flex;align-items:center;justify-content:space-between;padding:5px 8px}:host::ng-deep .asset-wrapper .asset-content__footer--info{max-width:calc(100% - 50px)}:host::ng-deep .asset-wrapper .asset-content__footer--info p{margin:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host::ng-deep .asset-wrapper .asset-content__footer--info .info{font-size:12px;color:#979797}:host::ng-deep .asset-wrapper .asset-content__footer--info .info .extension{text-transform:uppercase}:host::ng-deep .asset-wrapper .asset-content__footer--info.file-type__document{max-width:calc(100% - 70px)}:host::ng-deep .asset-wrapper .asset-content__footer--file-type{border-radius:5px;background-color:#d8d8d8;padding:2px 6px;font-size:12px}:host::ng-deep .asset-wrapper .asset-content:hover .edit-button{opacity:1!important}"]
|
|
4231
|
+
template: "<div class=\"asset-wrapper\">\n <div class=\"asset-content\">\n <div class=\"asset-content__header\">\n <button class=\"asset-content__header--button\" mat-raised-button (click)=\"onChange()\">\n <mat-checkbox\n class=\"checkbox\"\n [checked]=\"checkSelectedAsset\"\n ></mat-checkbox>\n </button>\n <button\n class=\"asset-content__header--button edit-button\"\n mat-raised-button\n (click)=\"editAsset()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n </div>\n <div class=\"asset-content__body\">\n <ng-container [ngSwitch]=\"asset.FileType\">\n <ng-container *ngSwitchCase=\"fileType.IMAGE\">\n <img\n class=\"image\"\n [src]=\"asset.UrlThumbnail\"\n [alt]=\"asset.OriginalFileName\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"fileType.DOCUMENT\">\n <img [src]=\"base64Pdf\" [alt]=\"asset.OriginalFileName\" class=\"pdf\" />\n </ng-container>\n </ng-container>\n </div>\n <div class=\"asset-content__footer\">\n <div\n class=\"asset-content__footer--info\"\n [ngClass]=\"{\n 'file-type__document': asset.FileType === fileType.DOCUMENT\n }\"\n >\n <p\n class=\"name\"\n [matTooltip]=\"asset.OriginalFileNameWithoutExtension\"\n matTooltipClass=\"width-auto\"\n >\n {{ asset.OriginalFileNameWithoutExtension }}\n </p>\n <p class=\"info\">\n <span class=\"extension\">{{ asset.Extension }}</span>\n <span\n *ngIf=\"\n asset.FileType === fileType.IMAGE && asset?.Extension !== 'svg'\n \"\n >\n - {{ asset.Width }}x{{ asset.Height }}</span\n >\n <span *ngIf=\"asset.Size\"> - {{ asset.Size }}</span>\n </p>\n </div>\n <div class=\"asset-content__footer--file-type\">\n <span>{{ asset.FileType }}</span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
4232
|
+
styles: [":host::ng-deep .asset-wrapper{padding:5px}:host::ng-deep .asset-wrapper .asset-content{overflow:hidden;position:relative;border-radius:10px;border:1px solid #d8d8d8;font-size:14px;transition:.3s cubic-bezier(.25,.8,.25,1)}:host::ng-deep .asset-wrapper .asset-content:hover{box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}:host::ng-deep .asset-wrapper .asset-content__header{position:absolute;z-index:1;top:0;left:0;width:100%;display:flex;justify-content:space-between;padding:14px}:host::ng-deep .asset-wrapper .asset-content__header--button{width:30px;height:30px;min-width:30px;display:flex;align-items:center;justify-content:center;text-align:center;color:rgba(0,0,0,.65);background:rgba(255,255,255,.6)}:host::ng-deep .asset-wrapper .asset-content__header--button:hover{background:#fff}:host::ng-deep .asset-wrapper .asset-content__header--button.edit-button{transition:.3s cubic-bezier(.25,.8,.25,1);opacity:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-icon{font-size:22px}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox{pointer-events:none;display:flex;align-items:center}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout{margin:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout .mat-checkbox-frame{color:#767676}:host::ng-deep .asset-wrapper .asset-content__body{padding-bottom:66.66%;background:#f1f1f1;position:relative}:host::ng-deep .asset-wrapper .asset-content__body img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .asset-wrapper .asset-content__body img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .asset-wrapper .asset-content__body img.pdf{width:75%;height:75%}:host::ng-deep .asset-wrapper .asset-content__footer{display:flex;align-items:center;justify-content:space-between;padding:5px 8px}:host::ng-deep .asset-wrapper .asset-content__footer--info{max-width:calc(100% - 50px)}:host::ng-deep .asset-wrapper .asset-content__footer--info p{margin:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host::ng-deep .asset-wrapper .asset-content__footer--info .info{font-size:12px;color:#979797}:host::ng-deep .asset-wrapper .asset-content__footer--info .info .extension{text-transform:uppercase}:host::ng-deep .asset-wrapper .asset-content__footer--info.file-type__document{max-width:calc(100% - 70px)}:host::ng-deep .asset-wrapper .asset-content__footer--file-type{border-radius:5px;background-color:#d8d8d8;padding:2px 6px;font-size:12px}:host::ng-deep .asset-wrapper .asset-content:hover .edit-button{opacity:1!important}"]
|
|
4264
4233
|
}] }
|
|
4265
4234
|
];
|
|
4266
4235
|
/** @nocollapse */
|