@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.
@@ -1490,7 +1490,9 @@ var UploadAssetsService = /** @class */ (function () {
1490
1490
  for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
1491
1491
  var file = files_1_1.value;
1492
1492
  /** @type {?} */
1493
- var ext = file.type.indexOf('svg') > -1 ? '.svg' : "." + file.type.split('/')[1];
1493
+ var nameSplit = file.name.split('.');
1494
+ /** @type {?} */
1495
+ var ext = "." + nameSplit.splice(nameSplit.length - 1, 1)[0];
1494
1496
  /** @type {?} */
1495
1497
  var originName = file.name;
1496
1498
  /** @type {?} */
@@ -2306,10 +2308,9 @@ var FileItemComponent = /** @class */ (function () {
2306
2308
  var _b = this.uploadAssetService, supportedTypes = _b.supportedTypes, supportedSize = _b.supportedSize;
2307
2309
  /** @type {?} */
2308
2310
  var nameSplit = file.name.split('.');
2309
- nameSplit.splice(nameSplit.length - 1, 1);
2311
+ this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
2310
2312
  this.dataFile.name = nameSplit.join('.');
2311
2313
  this.dataFile.size = file.size;
2312
- this.dataFile.ext = file.type.split('/')[1];
2313
2314
  this.dataFile.errors = {
2314
2315
  ext: supportedTypes.indexOf("." + this.dataFile.ext) < 0,
2315
2316
  size: supportedSize < this.dataFile.size,
@@ -2365,7 +2366,7 @@ var FileItemComponent = /** @class */ (function () {
2365
2366
  FileItemComponent.decorators = [
2366
2367
  { type: Component, args: [{
2367
2368
  selector: 'lib-file-item',
2368
- 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 Type of file: <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",
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",
2369
2370
  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}"]
2370
2371
  }] }
2371
2372
  ];
@@ -3746,7 +3747,8 @@ if (false) {
3746
3747
  IData$4.prototype.name;
3747
3748
  }
3748
3749
  var AssetDialogComponent = /** @class */ (function () {
3749
- function AssetDialogComponent(dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
3750
+ function AssetDialogComponent(_env, dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
3751
+ this._env = _env;
3750
3752
  this.dialog = dialog;
3751
3753
  this.data = data;
3752
3754
  this.dialogRef = dialogRef;
@@ -3775,7 +3777,7 @@ var AssetDialogComponent = /** @class */ (function () {
3775
3777
  * @return {?}
3776
3778
  */
3777
3779
  function () {
3778
- this.linkDownload = "https://sandboxunitedapi.relationshop.net/V6/Asset2/api/File/Download/" + this.data.assetId;
3780
+ this.linkDownload = this._env.asset2Url + "/File/Download/" + this.data.assetId;
3779
3781
  this.getAssetDetail();
3780
3782
  };
3781
3783
  Object.defineProperty(AssetDialogComponent.prototype, "disabled", {
@@ -4053,6 +4055,7 @@ var AssetDialogComponent = /** @class */ (function () {
4053
4055
  ];
4054
4056
  /** @nocollapse */
4055
4057
  AssetDialogComponent.ctorParameters = function () { return [
4058
+ { type: undefined, decorators: [{ type: Inject, args: [AM_CONFIG,] }] },
4056
4059
  { type: MatDialog },
4057
4060
  { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
4058
4061
  { type: MatDialogRef },
@@ -4101,6 +4104,11 @@ if (false) {
4101
4104
  AssetDialogComponent.prototype.isUpdating;
4102
4105
  /** @type {?} */
4103
4106
  AssetDialogComponent.prototype.fileType;
4107
+ /**
4108
+ * @type {?}
4109
+ * @private
4110
+ */
4111
+ AssetDialogComponent.prototype._env;
4104
4112
  /**
4105
4113
  * @type {?}
4106
4114
  * @private