@colijnit/product 259.1.3 → 259.1.4

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.
@@ -1,9 +1,14 @@
1
1
  import { ArticleListObject } from '@colijnit/articleapi/build/model/article-list-object';
2
2
  import { ProductConnectorService } from '../../service/product-connector.service';
3
3
  import { ProductEventService } from '../../service/product-event.service';
4
- import { ProductConnectorAdapterService } from "../../service/product-connector-adapter.service";
5
- import { ProductSettingsService } from "../../service/product-settings.service";
4
+ import { ProductConnectorAdapterService } from '../../service/product-connector-adapter.service';
5
+ import { ProductSettingsService } from '../../service/product-settings.service';
6
6
  import { ExternalSource } from '@colijnit/articleapi/build/model/external-source.bo';
7
+ export declare class ArticleViewModel {
8
+ article: ArticleListObject;
9
+ imageData: string;
10
+ constructor(article: ArticleListObject, imageData?: string);
11
+ }
7
12
  export declare class ProductRelatedComponent {
8
13
  private _iOne;
9
14
  private _appEventService;
@@ -16,7 +21,7 @@ export declare class ProductRelatedComponent {
16
21
  createFrozenArticle: boolean;
17
22
  set articles(value: ArticleListObject[]);
18
23
  get articles(): ArticleListObject[];
19
- imageData: string;
24
+ articleViewModels: ArticleViewModel[];
20
25
  private _articles;
21
26
  constructor(_iOne: ProductConnectorService, _appEventService: ProductEventService, _productConnectorAdapterService: ProductConnectorAdapterService, _settingsService: ProductSettingsService);
22
27
  handleContentClick(article: ArticleListObject): void;
@@ -31,8 +31,8 @@
31
31
  function Version() {
32
32
  this.name = "@colijnit/product";
33
33
  this.description = "Product detail page project for iOne";
34
- this.symVer = "259.1.3";
35
- this.publishDate = "29-9-2025 15:45:45";
34
+ this.symVer = "259.1.4";
35
+ this.publishDate = "7-1-2026 17:40:44";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -2785,6 +2785,15 @@
2785
2785
  },] }
2786
2786
  ];
2787
2787
 
2788
+ var ArticleViewModel = /** @class */ (function () {
2789
+ function ArticleViewModel(article, imageData) {
2790
+ this.article = article;
2791
+ if (imageData) {
2792
+ this.imageData = imageData;
2793
+ }
2794
+ }
2795
+ return ArticleViewModel;
2796
+ }());
2788
2797
  var ProductRelatedComponent = /** @class */ (function () {
2789
2798
  function ProductRelatedComponent(_iOne, _appEventService, _productConnectorAdapterService, _settingsService) {
2790
2799
  this._iOne = _iOne;
@@ -2793,7 +2802,7 @@
2793
2802
  this._settingsService = _settingsService;
2794
2803
  this.isSmallModus = true;
2795
2804
  this.createFrozenArticle = true;
2796
- this.imageData = '';
2805
+ this.articleViewModels = [];
2797
2806
  this._articles = [];
2798
2807
  }
2799
2808
  Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
@@ -2815,6 +2824,8 @@
2815
2824
  else {
2816
2825
  this._articles = value;
2817
2826
  }
2827
+ this.articleViewModels.length = 0;
2828
+ this._articles.forEach(function (a) { return _this.articleViewModels.push(new ArticleViewModel(a)); });
2818
2829
  this._loadImages();
2819
2830
  }
2820
2831
  },
@@ -2874,29 +2885,24 @@
2874
2885
  });
2875
2886
  };
2876
2887
  ProductRelatedComponent.prototype._loadImages = function () {
2877
- var _this = this;
2878
- this._articles.forEach(function (a) { return __awaiter(_this, void 0, void 0, function () {
2879
- var imageContent;
2888
+ return __awaiter(this, void 0, void 0, function () {
2889
+ var _this = this;
2880
2890
  return __generator(this, function (_a) {
2881
- switch (_a.label) {
2882
- case 0:
2883
- if (!a.image) return [3 /*break*/, 2];
2884
- return [4 /*yield*/, this._iOne.getImageForCoDocument(a.image, false)];
2885
- case 1:
2886
- imageContent = _a.sent();
2887
- this.imageData = imageContent.image;
2888
- _a.label = 2;
2889
- case 2: return [2 /*return*/];
2890
- }
2891
+ this.articleViewModels.forEach(function (avm) {
2892
+ if (avm.article.image) {
2893
+ _this._iOne.getImageForCoDocument(avm.article.image, false).then(function (imageContent) { return avm.imageData = imageContent.image; });
2894
+ }
2895
+ });
2896
+ return [2 /*return*/];
2891
2897
  });
2892
- }); });
2898
+ });
2893
2899
  };
2894
2900
  return ProductRelatedComponent;
2895
2901
  }());
2896
2902
  ProductRelatedComponent.decorators = [
2897
2903
  { type: i0.Component, args: [{
2898
2904
  selector: 'app-product-related',
2899
- template: "\n <div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let article of articles\">\n <co-article-tile\n [imageData]=\"imageData\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [hasCartButton]=\"true\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n (cartButtonClick)=\"handleAddToCartClick(article)\"\n (configureButtonClick)=\"handleContentClick(article)\"\n (threeDButtonClick)=\"handleThreeDButtonClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n </div>\n ",
2905
+ template: "\n <div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let articleViewModel of articleViewModels\">\n <co-article-tile \n [imageData]=\"articleViewModel.imageData\"\n [description]=\"articleViewModel.article.description\"\n [price]=\"articleViewModel.article.price\"\n [level]=\"articleViewModel.article.stockStatus\"\n [hasCartButton]=\"true\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"articleViewModel.article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(articleViewModel.article)\"\n (cartButtonClick)=\"handleAddToCartClick(articleViewModel.article)\"\n (configureButtonClick)=\"handleContentClick(articleViewModel.article)\"\n (threeDButtonClick)=\"handleThreeDButtonClick(articleViewModel.article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n </div>\n ",
2900
2906
  styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row;flex:1;min-width:25%}.article-wrapper ::ng-deep co-tile{transition:all .14s ease-out;border:1px solid transparent;padding:10px 20px;display:flex;flex-direction:column;color:#171721;justify-content:space-between}.article-wrapper ::ng-deep co-tile .price{display:block}.article-wrapper ::ng-deep co-tile .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;height:30px}.article-wrapper ::ng-deep co-tile .tile-bottom{display:flex;flex-direction:column;grid-gap:5px;gap:5px}.article-wrapper ::ng-deep co-tile:hover{border:1px solid #DCE4EA}.article-wrapper ::ng-deep co-tile .tile-extra-bottom co-button co-icon{width:24px;height:24px}.article-wrapper ::ng-deep co-tile .tile-extra-bottom co-button co-icon svg [fill]{fill:#fff}.article-wrapper ::ng-deep co-tile.small{max-width:189px;width:100%;height:100%;cursor:pointer}.article-wrapper ::ng-deep co-tile.small:hover .tile-bottom .left-buttons{margin:0!important}.article-wrapper ::ng-deep co-tile.small .tile-wrapper{outline:none!important;padding-bottom:0;overflow:hidden;grid-gap:10px;gap:10px;display:flex;flex-direction:column}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-extra-bottom ::ng-deep co-button.card-button.mini{pointer-events:all;padding:0!important;font-size:0;width:42px;height:42px;text-align:center;margin:0;border-radius:100%;background:#3E7EFF;cursor:pointer;place-content:center;color:#fff}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-extra-bottom ::ng-deep co-button.card-button.mini ::ng-deep co-icon{width:30px;height:30px}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom{outline:none!important;background:transparent!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}\n"]
2901
2907
  },] }
2902
2908
  ];