@rs-pk/asset-management 1.0.11 → 1.0.12
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 +14 -6
- 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/asset-dialog/asset-dialog.component.js +12 -3
- package/esm2015/lib/components/partial/file-item/file-item.component.js +3 -4
- package/esm2015/lib/services/upload-assets.service.js +4 -2
- package/esm5/lib/components/partial/asset-dialog/asset-dialog.component.js +11 -3
- package/esm5/lib/components/partial/file-item/file-item.component.js +3 -4
- package/esm5/lib/services/upload-assets.service.js +4 -2
- package/fesm2015/rs-pk-asset-management.js +15 -6
- package/fesm2015/rs-pk-asset-management.js.map +1 -1
- package/fesm5/rs-pk-asset-management.js +14 -6
- package/fesm5/rs-pk-asset-management.js.map +1 -1
- package/lib/components/partial/asset-dialog/asset-dialog.component.d.ts +2 -1
- package/package.json +1 -1
- package/rs-pk-asset-management.metadata.json +1 -1
|
@@ -1686,7 +1686,9 @@
|
|
|
1686
1686
|
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
1687
1687
|
var file = files_1_1.value;
|
|
1688
1688
|
/** @type {?} */
|
|
1689
|
-
var
|
|
1689
|
+
var nameSplit = file.name.split('.');
|
|
1690
|
+
/** @type {?} */
|
|
1691
|
+
var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1690
1692
|
/** @type {?} */
|
|
1691
1693
|
var originName = file.name;
|
|
1692
1694
|
/** @type {?} */
|
|
@@ -2502,10 +2504,9 @@
|
|
|
2502
2504
|
var _b = this.uploadAssetService, supportedTypes = _b.supportedTypes, supportedSize = _b.supportedSize;
|
|
2503
2505
|
/** @type {?} */
|
|
2504
2506
|
var nameSplit = file.name.split('.');
|
|
2505
|
-
nameSplit.splice(nameSplit.length - 1, 1);
|
|
2507
|
+
this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
2506
2508
|
this.dataFile.name = nameSplit.join('.');
|
|
2507
2509
|
this.dataFile.size = file.size;
|
|
2508
|
-
this.dataFile.ext = file.type.split('/')[1];
|
|
2509
2510
|
this.dataFile.errors = {
|
|
2510
2511
|
ext: supportedTypes.indexOf("." + this.dataFile.ext) < 0,
|
|
2511
2512
|
size: supportedSize < this.dataFile.size,
|
|
@@ -2561,7 +2562,7 @@
|
|
|
2561
2562
|
FileItemComponent.decorators = [
|
|
2562
2563
|
{ type: core.Component, args: [{
|
|
2563
2564
|
selector: 'lib-file-item',
|
|
2564
|
-
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
|
|
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",
|
|
2565
2566
|
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}"]
|
|
2566
2567
|
}] }
|
|
2567
2568
|
];
|
|
@@ -3942,7 +3943,8 @@
|
|
|
3942
3943
|
IData$4.prototype.name;
|
|
3943
3944
|
}
|
|
3944
3945
|
var AssetDialogComponent = /** @class */ (function () {
|
|
3945
|
-
function AssetDialogComponent(dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
|
|
3946
|
+
function AssetDialogComponent(_env, dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
|
|
3947
|
+
this._env = _env;
|
|
3946
3948
|
this.dialog = dialog;
|
|
3947
3949
|
this.data = data;
|
|
3948
3950
|
this.dialogRef = dialogRef;
|
|
@@ -3971,7 +3973,7 @@
|
|
|
3971
3973
|
* @return {?}
|
|
3972
3974
|
*/
|
|
3973
3975
|
function () {
|
|
3974
|
-
this.linkDownload =
|
|
3976
|
+
this.linkDownload = this._env.asset2Url + "/File/Download/" + this.data.assetId;
|
|
3975
3977
|
this.getAssetDetail();
|
|
3976
3978
|
};
|
|
3977
3979
|
Object.defineProperty(AssetDialogComponent.prototype, "disabled", {
|
|
@@ -4249,6 +4251,7 @@
|
|
|
4249
4251
|
];
|
|
4250
4252
|
/** @nocollapse */
|
|
4251
4253
|
AssetDialogComponent.ctorParameters = function () { return [
|
|
4254
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [AM_CONFIG,] }] },
|
|
4252
4255
|
{ type: dialog.MatDialog },
|
|
4253
4256
|
{ type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
|
|
4254
4257
|
{ type: dialog.MatDialogRef },
|
|
@@ -4297,6 +4300,11 @@
|
|
|
4297
4300
|
AssetDialogComponent.prototype.isUpdating;
|
|
4298
4301
|
/** @type {?} */
|
|
4299
4302
|
AssetDialogComponent.prototype.fileType;
|
|
4303
|
+
/**
|
|
4304
|
+
* @type {?}
|
|
4305
|
+
* @private
|
|
4306
|
+
*/
|
|
4307
|
+
AssetDialogComponent.prototype._env;
|
|
4300
4308
|
/**
|
|
4301
4309
|
* @type {?}
|
|
4302
4310
|
* @private
|