@rs-pk/asset-management 1.0.17 → 1.0.19

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.
Files changed (34) hide show
  1. package/bundles/rs-pk-asset-management.umd.js +29 -8
  2. package/bundles/rs-pk-asset-management.umd.js.map +1 -1
  3. package/bundles/rs-pk-asset-management.umd.min.js +2 -2
  4. package/bundles/rs-pk-asset-management.umd.min.js.map +1 -1
  5. package/esm2015/lib/asset-management.component.js +6 -1
  6. package/esm2015/lib/components/partial/asset-dialog/asset-dialog.component.js +16 -9
  7. package/esm2015/lib/components/partial/asset-item/asset-item.component.js +1 -1
  8. package/esm2015/lib/components/partial/asset-management-dialog/asset-management-dialog.component.js +2 -1
  9. package/esm2015/lib/components/partial/node-details/node-details.component.js +2 -1
  10. package/esm2015/lib/components/partial/upload-dialog/upload-dialog.component.js +6 -1
  11. package/esm2015/lib/models/asset.model.js +3 -1
  12. package/esm2015/lib/services/asset.service.js +3 -1
  13. package/esm2015/lib/services/upload-assets.service.js +1 -1
  14. package/esm5/lib/asset-management.component.js +6 -1
  15. package/esm5/lib/components/partial/asset-dialog/asset-dialog.component.js +14 -8
  16. package/esm5/lib/components/partial/asset-item/asset-item.component.js +1 -1
  17. package/esm5/lib/components/partial/asset-management-dialog/asset-management-dialog.component.js +2 -1
  18. package/esm5/lib/components/partial/node-details/node-details.component.js +2 -1
  19. package/esm5/lib/components/partial/upload-dialog/upload-dialog.component.js +6 -1
  20. package/esm5/lib/models/asset.model.js +3 -1
  21. package/esm5/lib/services/asset.service.js +3 -1
  22. package/esm5/lib/services/upload-assets.service.js +1 -1
  23. package/fesm2015/rs-pk-asset-management.js +31 -9
  24. package/fesm2015/rs-pk-asset-management.js.map +1 -1
  25. package/fesm5/rs-pk-asset-management.js +29 -8
  26. package/fesm5/rs-pk-asset-management.js.map +1 -1
  27. package/lib/asset-management.component.d.ts +1 -0
  28. package/lib/components/partial/asset-dialog/asset-dialog.component.d.ts +4 -2
  29. package/lib/components/partial/upload-dialog/upload-dialog.component.d.ts +1 -0
  30. package/lib/models/asset.model.d.ts +1 -0
  31. package/lib/services/asset.service.d.ts +1 -0
  32. package/lib/services/upload-assets.service.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/rs-pk-asset-management.metadata.json +1 -1
@@ -160,6 +160,8 @@ if (false) {
160
160
  DialogConfig.prototype.limit;
161
161
  /** @type {?} */
162
162
  DialogConfig.prototype.allowedType;
163
+ /** @type {?} */
164
+ DialogConfig.prototype.maxSize;
163
165
  }
164
166
 
165
167
  /**
@@ -642,6 +644,8 @@ if (false) {
642
644
  AssetService.prototype.sortOrder;
643
645
  /** @type {?} */
644
646
  AssetService.prototype.dialogConfig;
647
+ /** @type {?} */
648
+ AssetService.prototype.maxSize;
645
649
  /**
646
650
  * @type {?}
647
651
  * @private
@@ -1488,6 +1492,7 @@ class AssetManagementDialogComponent {
1488
1492
  return;
1489
1493
  }
1490
1494
  this.assetService.dialogConfig = data;
1495
+ this.assetService.maxSize = data.maxSize;
1491
1496
  }
1492
1497
  /**
1493
1498
  * @return {?}
@@ -1552,6 +1557,7 @@ class AssetManagementComponent {
1552
1557
  * @return {?}
1553
1558
  */
1554
1559
  ngOnInit() {
1560
+ this.assetService.maxSize = this.maxSize;
1555
1561
  initialReducer(this.svc.getDispatcher());
1556
1562
  this.bindSubscriber();
1557
1563
  }
@@ -1590,6 +1596,7 @@ class AssetManagementComponent {
1590
1596
  const config = {
1591
1597
  limit: this.limit,
1592
1598
  allowedType: this.allowedType,
1599
+ maxSize: this.maxSize
1593
1600
  };
1594
1601
  /** @type {?} */
1595
1602
  const dialogRef = this.dialog.open(AssetManagementDialogComponent, {
@@ -1636,6 +1643,7 @@ AssetManagementComponent.propDecorators = {
1636
1643
  isDialog: [{ type: Input }],
1637
1644
  limit: [{ type: Input }],
1638
1645
  allowedType: [{ type: Input }],
1646
+ maxSize: [{ type: Input }],
1639
1647
  assetChange: [{ type: Output }]
1640
1648
  };
1641
1649
  if (false) {
@@ -1646,6 +1654,8 @@ if (false) {
1646
1654
  /** @type {?} */
1647
1655
  AssetManagementComponent.prototype.allowedType;
1648
1656
  /** @type {?} */
1657
+ AssetManagementComponent.prototype.maxSize;
1658
+ /** @type {?} */
1649
1659
  AssetManagementComponent.prototype.assetChange;
1650
1660
  /**
1651
1661
  * @type {?}
@@ -2686,6 +2696,8 @@ if (false) {
2686
2696
  IData$3.prototype.currentAssetId;
2687
2697
  /** @type {?|undefined} */
2688
2698
  IData$3.prototype.fileType;
2699
+ /** @type {?|undefined} */
2700
+ IData$3.prototype.maxSize;
2689
2701
  }
2690
2702
  class UploadDialogComponent {
2691
2703
  /**
@@ -2708,6 +2720,9 @@ class UploadDialogComponent {
2708
2720
  ? [...this.uploadAssetsService.imageExtension]
2709
2721
  : [...this.uploadAssetsService.documentExtension];
2710
2722
  }
2723
+ if (this.data.maxSize) {
2724
+ this.uploadAssetsService.supportedSize = this.data.maxSize * 1024 * 1024;
2725
+ }
2711
2726
  }
2712
2727
  /**
2713
2728
  * @return {?}
@@ -3279,18 +3294,20 @@ class AssetDialogComponent {
3279
3294
  * @param {?} data
3280
3295
  * @param {?} dialogRef
3281
3296
  * @param {?} fileSize
3282
- * @param {?} assetService
3297
+ * @param {?} uploadAssetsService
3298
+ * @param {?} assetsService
3283
3299
  * @param {?} fileService
3284
3300
  * @param {?} domSanitizer
3285
3301
  * @param {?} svc
3286
3302
  */
3287
- constructor(_env, dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
3303
+ constructor(_env, dialog, data, dialogRef, fileSize, uploadAssetsService, assetsService, fileService, domSanitizer, svc) {
3288
3304
  this._env = _env;
3289
3305
  this.dialog = dialog;
3290
3306
  this.data = data;
3291
3307
  this.dialogRef = dialogRef;
3292
3308
  this.fileSize = fileSize;
3293
- this.assetService = assetService;
3309
+ this.uploadAssetsService = uploadAssetsService;
3310
+ this.assetsService = assetsService;
3294
3311
  this.fileService = fileService;
3295
3312
  this.domSanitizer = domSanitizer;
3296
3313
  this.svc = svc;
@@ -3315,6 +3332,7 @@ class AssetDialogComponent {
3315
3332
  * @return {?}
3316
3333
  */
3317
3334
  ngOnInit() {
3335
+ this.uploadAssetsService.supportedSize = this.assetsService.maxSize * 1024 * 1024;
3318
3336
  this.linkDownload = `${this._env.asset2Url}/File/Download/${this.data.assetId}`;
3319
3337
  this.getAssetDetail();
3320
3338
  }
@@ -3457,13 +3475,13 @@ class AssetDialogComponent {
3457
3475
  const errors = [];
3458
3476
  if (this.acceptTypes.indexOf(ext) < 0) {
3459
3477
  /** @type {?} */
3460
- const extError = `${this.assetService.messageErrors.replace} ${this.acceptTypes.join(', ')}`;
3478
+ const extError = `${this.uploadAssetsService.messageErrors.replace} ${this.acceptTypes.join(', ')}`;
3461
3479
  errors.push(extError);
3462
3480
  }
3463
- if (this.assetService.supportedSize < file.size) {
3481
+ if (this.uploadAssetsService.supportedSize < file.size) {
3464
3482
  /** @type {?} */
3465
- const maxSize = this.fileSize.transform(this.assetService.supportedSize, 0);
3466
- errors.push(`${this.assetService.messageErrors.size} ${maxSize}`);
3483
+ const maxSize = this.fileSize.transform(this.uploadAssetsService.supportedSize, 0);
3484
+ errors.push(`${this.uploadAssetsService.messageErrors.size} ${maxSize}`);
3467
3485
  }
3468
3486
  if (errors.length) {
3469
3487
  this.replaceMessage = errors.join('<br/>');
@@ -3552,6 +3570,7 @@ AssetDialogComponent.ctorParameters = () => [
3552
3570
  { type: MatDialogRef },
3553
3571
  { type: FileSizePipe },
3554
3572
  { type: UploadAssetsService },
3573
+ { type: AssetService },
3555
3574
  { type: FileService },
3556
3575
  { type: DomSanitizer },
3557
3576
  { type: AssetManagementService }
@@ -3613,7 +3632,9 @@ if (false) {
3613
3632
  */
3614
3633
  AssetDialogComponent.prototype.fileSize;
3615
3634
  /** @type {?} */
3616
- AssetDialogComponent.prototype.assetService;
3635
+ AssetDialogComponent.prototype.uploadAssetsService;
3636
+ /** @type {?} */
3637
+ AssetDialogComponent.prototype.assetsService;
3617
3638
  /**
3618
3639
  * @type {?}
3619
3640
  * @private
@@ -3737,7 +3758,7 @@ AssetItemComponent.decorators = [
3737
3758
  { type: Component, args: [{
3738
3759
  selector: 'lib-asset-item',
3739
3760
  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]=\"base64PNG[asset.Extension]\" [alt]=\"asset.OriginalFileName\" [ngClass]=\"asset.Extension\" />\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",
3740
- 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 0 8px rgba(0,0,0,.17),0 0 0 rgba(0,0,0,.06)}: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.csv,:host::ng-deep .asset-wrapper .asset-content__body img.pdf,:host::ng-deep .asset-wrapper .asset-content__body img.zip{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}"]
3761
+ 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 0 8px rgba(0,0,0,.17),0 0 0 rgba(0,0,0,.06)}: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{display:block;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.csv,:host::ng-deep .asset-wrapper .asset-content__body img.pdf,:host::ng-deep .asset-wrapper .asset-content__body img.zip{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}"]
3741
3762
  }] }
3742
3763
  ];
3743
3764
  /** @nocollapse */
@@ -4898,6 +4919,7 @@ class NodeDetailsComponent {
4898
4919
  data: {
4899
4920
  currentAssetId: this.currentFolder.AssetId,
4900
4921
  fileType: this.assetService.dialogConfig.allowedType,
4922
+ maxSize: this.assetService.maxSize
4901
4923
  },
4902
4924
  panelClass: 'lib-dialog--medium',
4903
4925
  });