@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
|
@@ -1522,8 +1522,7 @@
|
|
|
1522
1522
|
this.dialog = dialog;
|
|
1523
1523
|
this._api = _api;
|
|
1524
1524
|
this.files = [];
|
|
1525
|
-
this.
|
|
1526
|
-
this.errorsMap = {};
|
|
1525
|
+
this.fileNames = [];
|
|
1527
1526
|
this.supportedSize = 10 * 1024 * 1024; // 10MB
|
|
1528
1527
|
// 10MB
|
|
1529
1528
|
this.documentExtension = ['.pdf'];
|
|
@@ -1540,6 +1539,7 @@
|
|
|
1540
1539
|
size: "File size should be upto",
|
|
1541
1540
|
ext: "Only supported file extension:",
|
|
1542
1541
|
replace: "The replacement file should be the same extension with old one:",
|
|
1542
|
+
maxLength: "The character limit is 200 characters",
|
|
1543
1543
|
};
|
|
1544
1544
|
this.errorObs$ = new rxjs.BehaviorSubject(true);
|
|
1545
1545
|
this.baseUrl = this._env.asset2Url;
|
|
@@ -1585,54 +1585,18 @@
|
|
|
1585
1585
|
enumerable: true,
|
|
1586
1586
|
configurable: true
|
|
1587
1587
|
});
|
|
1588
|
-
Object.defineProperty(UploadAssetsService.prototype, "nameFiles", {
|
|
1589
|
-
get: /**
|
|
1590
|
-
* @return {?}
|
|
1591
|
-
*/
|
|
1592
|
-
function () {
|
|
1593
|
-
return this.namesMap;
|
|
1594
|
-
},
|
|
1595
|
-
enumerable: true,
|
|
1596
|
-
configurable: true
|
|
1597
|
-
});
|
|
1598
|
-
Object.defineProperty(UploadAssetsService.prototype, "newName", {
|
|
1599
|
-
set: /**
|
|
1600
|
-
* @param {?} newName
|
|
1601
|
-
* @return {?}
|
|
1602
|
-
*/
|
|
1603
|
-
function (newName) {
|
|
1604
|
-
this.namesMap = __assign({}, this.namesMap, newName);
|
|
1605
|
-
},
|
|
1606
|
-
enumerable: true,
|
|
1607
|
-
configurable: true
|
|
1608
|
-
});
|
|
1609
1588
|
Object.defineProperty(UploadAssetsService.prototype, "errorFiles", {
|
|
1610
1589
|
get: /**
|
|
1611
1590
|
* @return {?}
|
|
1612
1591
|
*/
|
|
1613
1592
|
function () {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
* @param {?} newError
|
|
1622
|
-
* @return {?}
|
|
1623
|
-
*/
|
|
1624
|
-
function (newError) {
|
|
1625
|
-
this.errorsMap = __assign({}, this.errorsMap, newError);
|
|
1626
|
-
},
|
|
1627
|
-
enumerable: true,
|
|
1628
|
-
configurable: true
|
|
1629
|
-
});
|
|
1630
|
-
Object.defineProperty(UploadAssetsService.prototype, "fileErrors", {
|
|
1631
|
-
get: /**
|
|
1632
|
-
* @return {?}
|
|
1633
|
-
*/
|
|
1634
|
-
function () {
|
|
1635
|
-
return this.errorsMap;
|
|
1593
|
+
/** @type {?} */
|
|
1594
|
+
var invalidFiles = this.fileNames.filter((/**
|
|
1595
|
+
* @param {?} file
|
|
1596
|
+
* @return {?}
|
|
1597
|
+
*/
|
|
1598
|
+
function (file) { return !file.valid; }));
|
|
1599
|
+
return this.fileNames.length && invalidFiles.length > 0;
|
|
1636
1600
|
},
|
|
1637
1601
|
enumerable: true,
|
|
1638
1602
|
configurable: true
|
|
@@ -1642,30 +1606,26 @@
|
|
|
1642
1606
|
* @return {?}
|
|
1643
1607
|
*/
|
|
1644
1608
|
function () {
|
|
1645
|
-
return
|
|
1609
|
+
return this.fileNames.filter((/**
|
|
1610
|
+
* @param {?} file
|
|
1611
|
+
* @return {?}
|
|
1612
|
+
*/
|
|
1613
|
+
function (file) { return !file.valid; })).length;
|
|
1646
1614
|
},
|
|
1647
1615
|
enumerable: true,
|
|
1648
1616
|
configurable: true
|
|
1649
1617
|
});
|
|
1650
1618
|
/**
|
|
1651
|
-
* @param {?} fileName
|
|
1652
1619
|
* @param {?} index
|
|
1653
1620
|
* @return {?}
|
|
1654
1621
|
*/
|
|
1655
1622
|
UploadAssetsService.prototype.deleteFile = /**
|
|
1656
|
-
* @param {?} fileName
|
|
1657
1623
|
* @param {?} index
|
|
1658
1624
|
* @return {?}
|
|
1659
1625
|
*/
|
|
1660
|
-
function (
|
|
1661
|
-
this.files
|
|
1662
|
-
|
|
1663
|
-
* @param {?} i
|
|
1664
|
-
* @return {?}
|
|
1665
|
-
*/
|
|
1666
|
-
function (_file, i) { return i !== index; }));
|
|
1667
|
-
delete this.namesMap[fileName];
|
|
1668
|
-
delete this.errorsMap[fileName];
|
|
1626
|
+
function (index) {
|
|
1627
|
+
this.files.splice(index, 1);
|
|
1628
|
+
this.fileNames.splice(index, 1);
|
|
1669
1629
|
};
|
|
1670
1630
|
/**
|
|
1671
1631
|
* @param {?} parentAssetId
|
|
@@ -1676,34 +1636,23 @@
|
|
|
1676
1636
|
* @return {?}
|
|
1677
1637
|
*/
|
|
1678
1638
|
function (parentAssetId) {
|
|
1679
|
-
var
|
|
1680
|
-
|
|
1639
|
+
var files = this.files;
|
|
1640
|
+
/** @type {?} */
|
|
1641
|
+
var fileNames = this.fileNames.map((/**
|
|
1642
|
+
* @param {?} file
|
|
1643
|
+
* @return {?}
|
|
1644
|
+
*/
|
|
1645
|
+
function (file) { return file.name; }));
|
|
1681
1646
|
/** @type {?} */
|
|
1682
1647
|
var formData = new FormData();
|
|
1683
1648
|
formData.append('parentAssetId', parentAssetId);
|
|
1684
1649
|
formData.append('companyId', '732DA8D2-04EC-4BE0-A168-63EE0DCF50D8');
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1692
|
-
/** @type {?} */
|
|
1693
|
-
var originName = file.name;
|
|
1694
|
-
/** @type {?} */
|
|
1695
|
-
var fileName = namesMap[originName]
|
|
1696
|
-
? "" + namesMap[originName] + ext
|
|
1697
|
-
: originName;
|
|
1698
|
-
formData.append('files', file, fileName);
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1702
|
-
finally {
|
|
1703
|
-
try {
|
|
1704
|
-
if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);
|
|
1705
|
-
}
|
|
1706
|
-
finally { if (e_1) throw e_1.error; }
|
|
1650
|
+
for (var i = 0; i < files.length; i++) {
|
|
1651
|
+
/** @type {?} */
|
|
1652
|
+
var nameSplit = files[i].name.split('.');
|
|
1653
|
+
/** @type {?} */
|
|
1654
|
+
var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1655
|
+
formData.append('files', files[i], "" + fileNames[i] + ext);
|
|
1707
1656
|
}
|
|
1708
1657
|
return this._api.post(this.baseUrl + "/File/Upload", formData);
|
|
1709
1658
|
};
|
|
@@ -1724,16 +1673,8 @@
|
|
|
1724
1673
|
* @private
|
|
1725
1674
|
*/
|
|
1726
1675
|
UploadAssetsService.prototype.files;
|
|
1727
|
-
/**
|
|
1728
|
-
|
|
1729
|
-
* @private
|
|
1730
|
-
*/
|
|
1731
|
-
UploadAssetsService.prototype.namesMap;
|
|
1732
|
-
/**
|
|
1733
|
-
* @type {?}
|
|
1734
|
-
* @private
|
|
1735
|
-
*/
|
|
1736
|
-
UploadAssetsService.prototype.errorsMap;
|
|
1676
|
+
/** @type {?} */
|
|
1677
|
+
UploadAssetsService.prototype.fileNames;
|
|
1737
1678
|
/** @type {?} */
|
|
1738
1679
|
UploadAssetsService.prototype.supportedSize;
|
|
1739
1680
|
/** @type {?} */
|
|
@@ -2474,6 +2415,7 @@
|
|
|
2474
2415
|
ext: '',
|
|
2475
2416
|
data: null,
|
|
2476
2417
|
errors: {
|
|
2418
|
+
maxLength: false,
|
|
2477
2419
|
ext: false,
|
|
2478
2420
|
size: false,
|
|
2479
2421
|
},
|
|
@@ -2486,40 +2428,67 @@
|
|
|
2486
2428
|
* @return {?}
|
|
2487
2429
|
*/
|
|
2488
2430
|
function () {
|
|
2489
|
-
this.
|
|
2431
|
+
this.initDataFile();
|
|
2490
2432
|
};
|
|
2491
2433
|
/**
|
|
2492
2434
|
* @private
|
|
2493
|
-
* @param {?} file
|
|
2494
2435
|
* @return {?}
|
|
2495
2436
|
*/
|
|
2496
|
-
FileItemComponent.prototype.
|
|
2437
|
+
FileItemComponent.prototype.initDataFile = /**
|
|
2497
2438
|
* @private
|
|
2498
|
-
* @param {?} file
|
|
2499
2439
|
* @return {?}
|
|
2500
2440
|
*/
|
|
2501
|
-
function (
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2441
|
+
function () {
|
|
2442
|
+
this.setDetailsFile();
|
|
2443
|
+
this.setErrorFile();
|
|
2444
|
+
};
|
|
2445
|
+
/**
|
|
2446
|
+
* @private
|
|
2447
|
+
* @return {?}
|
|
2448
|
+
*/
|
|
2449
|
+
FileItemComponent.prototype.setDetailsFile = /**
|
|
2450
|
+
* @private
|
|
2451
|
+
* @return {?}
|
|
2452
|
+
*/
|
|
2453
|
+
function () {
|
|
2454
|
+
var _a = this.file, name = _a.name, size = _a.size;
|
|
2455
|
+
var files = this.uploadAssetService.getFiles;
|
|
2505
2456
|
/** @type {?} */
|
|
2506
|
-
var
|
|
2457
|
+
var names = files.filter((/**
|
|
2458
|
+
* @param {?} file
|
|
2459
|
+
* @return {?}
|
|
2460
|
+
*/
|
|
2461
|
+
function (file) { return file.name === name; }));
|
|
2462
|
+
/** @type {?} */
|
|
2463
|
+
var nameSplit = name.split('.');
|
|
2464
|
+
if (names.length > 1) {
|
|
2465
|
+
nameSplit[0] = nameSplit[0] + "(" + (names.length - 1) + ")";
|
|
2466
|
+
}
|
|
2507
2467
|
this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
2508
2468
|
this.dataFile.name = nameSplit.join('.');
|
|
2509
|
-
this.dataFile.size =
|
|
2469
|
+
this.dataFile.size = size;
|
|
2470
|
+
};
|
|
2471
|
+
/**
|
|
2472
|
+
* @private
|
|
2473
|
+
* @return {?}
|
|
2474
|
+
*/
|
|
2475
|
+
FileItemComponent.prototype.setErrorFile = /**
|
|
2476
|
+
* @private
|
|
2477
|
+
* @return {?}
|
|
2478
|
+
*/
|
|
2479
|
+
function () {
|
|
2480
|
+
var _this = this;
|
|
2481
|
+
var _a = this.uploadAssetService, supportedTypes = _a.supportedTypes, supportedSize = _a.supportedSize, fileNames = _a.fileNames;
|
|
2482
|
+
var _b = this.dataFile, name = _b.name, extFile = _b.ext, sizeFile = _b.size;
|
|
2510
2483
|
this.dataFile.errors = {
|
|
2511
|
-
|
|
2512
|
-
|
|
2484
|
+
maxLength: name.length + extFile.length > 199,
|
|
2485
|
+
ext: supportedTypes.indexOf("." + extFile) < 0,
|
|
2486
|
+
size: supportedSize < sizeFile,
|
|
2513
2487
|
};
|
|
2514
|
-
|
|
2515
|
-
if (ext || size) {
|
|
2516
|
-
this.uploadAssetService.errors = (_a = {}, _a[file.name] = true, _a);
|
|
2517
|
-
this.checkError.emit();
|
|
2518
|
-
}
|
|
2519
|
-
if (file.type.indexOf('image') > -1) {
|
|
2488
|
+
if (this.file.type.indexOf('image') > -1) {
|
|
2520
2489
|
/** @type {?} */
|
|
2521
2490
|
var reader = new FileReader();
|
|
2522
|
-
reader.readAsDataURL(file);
|
|
2491
|
+
reader.readAsDataURL(this.file);
|
|
2523
2492
|
reader.onload = (/**
|
|
2524
2493
|
* @param {?} readerEvent
|
|
2525
2494
|
* @return {?}
|
|
@@ -2536,8 +2505,24 @@
|
|
|
2536
2505
|
});
|
|
2537
2506
|
});
|
|
2538
2507
|
}
|
|
2508
|
+
fileNames.push({
|
|
2509
|
+
name: name,
|
|
2510
|
+
valid: this.checkErrors()
|
|
2511
|
+
});
|
|
2539
2512
|
this.uploadAssetService.setErrorObs(this.uploadAssetService.errorFiles);
|
|
2540
2513
|
};
|
|
2514
|
+
/**
|
|
2515
|
+
* @private
|
|
2516
|
+
* @return {?}
|
|
2517
|
+
*/
|
|
2518
|
+
FileItemComponent.prototype.checkErrors = /**
|
|
2519
|
+
* @private
|
|
2520
|
+
* @return {?}
|
|
2521
|
+
*/
|
|
2522
|
+
function () {
|
|
2523
|
+
var _a = this.dataFile.errors, ext = _a.ext, size = _a.size, maxLength = _a.maxLength;
|
|
2524
|
+
return (ext || size || maxLength) ? false : true;
|
|
2525
|
+
};
|
|
2541
2526
|
/**
|
|
2542
2527
|
* @param {?} event
|
|
2543
2528
|
* @return {?}
|
|
@@ -2548,7 +2533,12 @@
|
|
|
2548
2533
|
*/
|
|
2549
2534
|
function (event) {
|
|
2550
2535
|
this.dataFile.name = ((/** @type {?} */ (event.target))).value.trim();
|
|
2551
|
-
this.
|
|
2536
|
+
var _a = this.dataFile, name = _a.name, ext = _a.ext;
|
|
2537
|
+
this.dataFile.errors.maxLength = name.length + ext.length > 199;
|
|
2538
|
+
this.fileChange.emit({
|
|
2539
|
+
name: this.dataFile.name,
|
|
2540
|
+
valid: this.checkErrors()
|
|
2541
|
+
});
|
|
2552
2542
|
};
|
|
2553
2543
|
/**
|
|
2554
2544
|
* @return {?}
|
|
@@ -2562,7 +2552,7 @@
|
|
|
2562
2552
|
FileItemComponent.decorators = [
|
|
2563
2553
|
{ type: core.Component, args: [{
|
|
2564
2554
|
selector: 'lib-file-item',
|
|
2565
|
-
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",
|
|
2555
|
+
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",
|
|
2566
2556
|
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}"]
|
|
2567
2557
|
}] }
|
|
2568
2558
|
];
|
|
@@ -2631,32 +2621,32 @@
|
|
|
2631
2621
|
((/** @type {?} */ (document.getElementById('file-import')))).value = '';
|
|
2632
2622
|
};
|
|
2633
2623
|
/**
|
|
2634
|
-
* @param {?} fileName
|
|
2635
2624
|
* @param {?} index
|
|
2636
2625
|
* @return {?}
|
|
2637
2626
|
*/
|
|
2638
2627
|
FileListComponent.prototype.onDelFile = /**
|
|
2639
|
-
* @param {?} fileName
|
|
2640
2628
|
* @param {?} index
|
|
2641
2629
|
* @return {?}
|
|
2642
2630
|
*/
|
|
2643
|
-
function (
|
|
2644
|
-
this.uploadAssetsService.deleteFile(
|
|
2631
|
+
function (index) {
|
|
2632
|
+
this.uploadAssetsService.deleteFile(index);
|
|
2645
2633
|
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2646
2634
|
};
|
|
2647
2635
|
/**
|
|
2648
|
-
* @param {?}
|
|
2649
|
-
* @param {?}
|
|
2636
|
+
* @param {?} __0
|
|
2637
|
+
* @param {?} index
|
|
2650
2638
|
* @return {?}
|
|
2651
2639
|
*/
|
|
2652
2640
|
FileListComponent.prototype.onChangeName = /**
|
|
2653
|
-
* @param {?}
|
|
2654
|
-
* @param {?}
|
|
2641
|
+
* @param {?} __0
|
|
2642
|
+
* @param {?} index
|
|
2655
2643
|
* @return {?}
|
|
2656
2644
|
*/
|
|
2657
|
-
function (
|
|
2658
|
-
var _a;
|
|
2659
|
-
this.uploadAssetsService.
|
|
2645
|
+
function (_a, index) {
|
|
2646
|
+
var name = _a.name, valid = _a.valid;
|
|
2647
|
+
var fileNames = this.uploadAssetsService.fileNames;
|
|
2648
|
+
fileNames[index] = { name: name, valid: valid };
|
|
2649
|
+
this.uploadAssetsService.setErrorObs(this.uploadAssetsService.errorFiles);
|
|
2660
2650
|
};
|
|
2661
2651
|
/**
|
|
2662
2652
|
* @return {?}
|
|
@@ -2670,7 +2660,7 @@
|
|
|
2670
2660
|
FileListComponent.decorators = [
|
|
2671
2661
|
{ type: core.Component, args: [{
|
|
2672
2662
|
selector: 'lib-file-list',
|
|
2673
|
-
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(
|
|
2663
|
+
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",
|
|
2674
2664
|
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}"]
|
|
2675
2665
|
}] }
|
|
2676
2666
|
];
|
|
@@ -2709,34 +2699,6 @@
|
|
|
2709
2699
|
* @return {?}
|
|
2710
2700
|
*/
|
|
2711
2701
|
function () { };
|
|
2712
|
-
/**
|
|
2713
|
-
* @param {?} fileName
|
|
2714
|
-
* @param {?} index
|
|
2715
|
-
* @return {?}
|
|
2716
|
-
*/
|
|
2717
|
-
UploadFileComponent.prototype.onDelFile = /**
|
|
2718
|
-
* @param {?} fileName
|
|
2719
|
-
* @param {?} index
|
|
2720
|
-
* @return {?}
|
|
2721
|
-
*/
|
|
2722
|
-
function (fileName, index) {
|
|
2723
|
-
this.uploadAssetsService.deleteFile(fileName, index);
|
|
2724
|
-
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2725
|
-
};
|
|
2726
|
-
/**
|
|
2727
|
-
* @param {?} newName
|
|
2728
|
-
* @param {?} originName
|
|
2729
|
-
* @return {?}
|
|
2730
|
-
*/
|
|
2731
|
-
UploadFileComponent.prototype.onChangeName = /**
|
|
2732
|
-
* @param {?} newName
|
|
2733
|
-
* @param {?} originName
|
|
2734
|
-
* @return {?}
|
|
2735
|
-
*/
|
|
2736
|
-
function (newName, originName) {
|
|
2737
|
-
var _a;
|
|
2738
|
-
this.uploadAssetsService.newName = (_a = {}, _a[originName] = newName, _a);
|
|
2739
|
-
};
|
|
2740
2702
|
/**
|
|
2741
2703
|
* @param {?} newFiles
|
|
2742
2704
|
* @return {?}
|
|
@@ -2838,7 +2800,10 @@
|
|
|
2838
2800
|
this.destroy$ = new rxjs.Subject();
|
|
2839
2801
|
this.form = new forms.FormControl();
|
|
2840
2802
|
this.formGroup = this.fb.group({
|
|
2841
|
-
name: ['',
|
|
2803
|
+
name: ['', [
|
|
2804
|
+
forms.Validators.maxLength(200),
|
|
2805
|
+
forms.Validators.required
|
|
2806
|
+
]],
|
|
2842
2807
|
});
|
|
2843
2808
|
}
|
|
2844
2809
|
/**
|
|
@@ -2923,7 +2888,7 @@
|
|
|
2923
2888
|
AddFolderDialogComponent.decorators = [
|
|
2924
2889
|
{ type: core.Component, args: [{
|
|
2925
2890
|
selector: 'lib-add-folder-dialog',
|
|
2926
|
-
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?.
|
|
2891
|
+
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",
|
|
2927
2892
|
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}"]
|
|
2928
2893
|
}] }
|
|
2929
2894
|
];
|
|
@@ -2994,7 +2959,10 @@
|
|
|
2994
2959
|
this.destroy$ = new rxjs.Subject();
|
|
2995
2960
|
this.form = new forms.FormControl();
|
|
2996
2961
|
this.formGroup = this.fb.group({
|
|
2997
|
-
name: [this.data.name,
|
|
2962
|
+
name: [this.data.name, [
|
|
2963
|
+
forms.Validators.maxLength(200),
|
|
2964
|
+
forms.Validators.required
|
|
2965
|
+
]],
|
|
2998
2966
|
});
|
|
2999
2967
|
}
|
|
3000
2968
|
/**
|
|
@@ -3082,7 +3050,7 @@
|
|
|
3082
3050
|
EditFolderDialogComponent.decorators = [
|
|
3083
3051
|
{ type: core.Component, args: [{
|
|
3084
3052
|
selector: 'lib-edit-folder-dialog',
|
|
3085
|
-
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",
|
|
3053
|
+
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",
|
|
3086
3054
|
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}"]
|
|
3087
3055
|
}] }
|
|
3088
3056
|
];
|
|
@@ -3982,6 +3950,7 @@
|
|
|
3982
3950
|
*/
|
|
3983
3951
|
function () {
|
|
3984
3952
|
return (!this.fileName.length ||
|
|
3953
|
+
this.fileName.length + this.assetDetails.Extension.length > 199 || // limit 200
|
|
3985
3954
|
!!this.errorMessage ||
|
|
3986
3955
|
this.patternError ||
|
|
3987
3956
|
this.isUpdating);
|
|
@@ -4244,7 +4213,7 @@
|
|
|
4244
4213
|
AssetDialogComponent.decorators = [
|
|
4245
4214
|
{ type: core.Component, args: [{
|
|
4246
4215
|
selector: 'lib-asset-dialog',
|
|
4247
|
-
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",
|
|
4216
|
+
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",
|
|
4248
4217
|
providers: [FileSizePipe],
|
|
4249
4218
|
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}"]
|
|
4250
4219
|
}] }
|
|
@@ -4455,8 +4424,8 @@
|
|
|
4455
4424
|
AssetItemComponent.decorators = [
|
|
4456
4425
|
{ type: core.Component, args: [{
|
|
4457
4426
|
selector: 'lib-asset-item',
|
|
4458
|
-
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
|
|
4459
|
-
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}"]
|
|
4427
|
+
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",
|
|
4428
|
+
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}"]
|
|
4460
4429
|
}] }
|
|
4461
4430
|
];
|
|
4462
4431
|
/** @nocollapse */
|