@colijnit/product 12.0.3 → 12.0.5

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 (25) hide show
  1. package/app/components/product-addtocart/product-addtocart.component.d.ts +1 -0
  2. package/app/components/product-external-source/product-external-source.component.d.ts +5 -1
  3. package/app/components/product-page/product-page.component.d.ts +1 -0
  4. package/app/components/product-stock/product-stock.component.d.ts +9 -7
  5. package/app/ione-product.component.d.ts +6 -1
  6. package/app/service/product-connector-adapter.service.d.ts +4 -3
  7. package/app/service/product-connector.service.d.ts +4 -3
  8. package/app/service/product-event.service.d.ts +5 -1
  9. package/bundles/colijnit-product.umd.js +113 -102
  10. package/bundles/colijnit-product.umd.js.map +1 -1
  11. package/colijnit-product.metadata.json +1 -1
  12. package/esm2015/app/components/product-addtocart/product-addtocart.component.js +10 -2
  13. package/esm2015/app/components/product-external-source/product-external-source.component.js +1 -1
  14. package/esm2015/app/components/product-page/product-page.component.js +4 -2
  15. package/esm2015/app/components/product-stock/product-stock.component.js +30 -10
  16. package/esm2015/app/ione-product.component.js +11 -36
  17. package/esm2015/app/ione-product.module.js +7 -3
  18. package/esm2015/app/product-version.js +3 -3
  19. package/esm2015/app/service/product-connector-adapter.service.js +26 -8
  20. package/esm2015/app/service/product-connector.service.js +9 -8
  21. package/esm2015/app/service/product-event.service.js +1 -1
  22. package/esm2015/assets/dictionary/text.properties.js +3 -1
  23. package/fesm2015/colijnit-product.js +92 -63
  24. package/fesm2015/colijnit-product.js.map +1 -1
  25. package/package.json +3 -3
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@colijnit/ioneconnector/build/model/options'), require('@colijnit/articleapi/build/model/article-full-object'), require('@colijnit/articleapi/build/model/super-article'), require('@colijnit/articleapi/build/articles'), require('@colijnit/articleapi/build/model/delivery-prognosis'), require('@colijnit/articleapi/build/model/document-content'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@colijnit/transactionapi/build/transaction'), require('@colijnit/mainapi'), require('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/platform-browser/animations'), require('@angular/animations'), require('@angular/platform-browser'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document'), require('@colijnit/articleapi/build/model/configurator-statistics-environment')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@colijnit/ioneconnector/build/model/options', '@colijnit/articleapi/build/model/article-full-object', '@colijnit/articleapi/build/model/super-article', '@colijnit/articleapi/build/articles', '@colijnit/articleapi/build/model/delivery-prognosis', '@colijnit/articleapi/build/model/document-content', '@colijnit/ioneconnector/build/service/business-object-factory', '@colijnit/transactionapi/build/transaction', '@colijnit/mainapi', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/common', '@angular/platform-browser/animations', '@angular/animations', '@angular/platform-browser', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document', '@colijnit/articleapi/build/model/configurator-statistics-environment'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.transaction, global.mainapi, global.ng.common.http, global.stringUtils, global.ng.common, global.ng.platformBrowser.animations, global.ng.animations, global.ng.platformBrowser, global.corecomponents, global.coDocument, global.configuratorStatisticsEnvironment));
5
- })(this, (function (exports, i0, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, i1, stringUtils, common, animations$1, animations, i1$1, corecomponents, coDocument, configuratorStatisticsEnvironment) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@colijnit/ioneconnector/build/model/options'), require('@colijnit/articleapi/build/model/article-full-object'), require('@colijnit/articleapi/build/model/super-article'), require('@colijnit/articleapi/build/articles'), require('@colijnit/articleapi/build/model/delivery-prognosis'), require('@colijnit/articleapi/build/model/document-content'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@colijnit/transactionapi/build/transaction'), require('@colijnit/mainapi'), require('@colijnit/transactionapi/build/model/transaction-info-response.bo'), require('@colijnit/articleapi/build/model/article-extended.bo'), require('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/animations'), require('@angular/platform-browser'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document'), require('@colijnit/articleapi/build/model/configurator-statistics-environment')) :
3
+ typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@colijnit/ioneconnector/build/model/options', '@colijnit/articleapi/build/model/article-full-object', '@colijnit/articleapi/build/model/super-article', '@colijnit/articleapi/build/articles', '@colijnit/articleapi/build/model/delivery-prognosis', '@colijnit/articleapi/build/model/document-content', '@colijnit/ioneconnector/build/service/business-object-factory', '@colijnit/transactionapi/build/transaction', '@colijnit/mainapi', '@colijnit/transactionapi/build/model/transaction-info-response.bo', '@colijnit/articleapi/build/model/article-extended.bo', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/common', '@angular/animations', '@angular/platform-browser', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document', '@colijnit/articleapi/build/model/configurator-statistics-environment'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.transaction, global.mainapi, global.transactionInfoResponse_bo, global.articleExtended_bo, global.ng.common.http, global.stringUtils, global.ng.common, global.ng.animations, global.ng.platformBrowser, global.corecomponents, global.coDocument, global.configuratorStatisticsEnvironment));
5
+ })(this, (function (exports, i0, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, transactionInfoResponse_bo, articleExtended_bo, i1, stringUtils, common, animations, i1$1, corecomponents, coDocument, configuratorStatisticsEnvironment) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -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 = "12.0.3";
35
- this.publishDate = "14-10-2023 14:22:44";
34
+ this.symVer = "12.0.5";
35
+ this.publishDate = "30-11-2023 11:58:33";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -636,6 +636,11 @@
636
636
  });
637
637
  });
638
638
  };
639
+ ProductConnectorAdapterService.prototype.convertArticleFullObjectToArticleExtended = function (article) {
640
+ if (article) {
641
+ return this._boFactory.makeWithRawBackendData(articleExtended_bo.ArticleExtended, article);
642
+ }
643
+ };
639
644
  ProductConnectorAdapterService.prototype.getDeliveryPrognosis = function (goodId, branchNr) {
640
645
  return __awaiter(this, void 0, void 0, function () {
641
646
  var deliveryPrognosis;
@@ -671,6 +676,25 @@
671
676
  });
672
677
  });
673
678
  };
679
+ ProductConnectorAdapterService.prototype.getArtStockStatus = function (goodId) {
680
+ return __awaiter(this, void 0, void 0, function () {
681
+ var response;
682
+ return __generator(this, function (_a) {
683
+ switch (_a.label) {
684
+ case 0: return [4 /*yield*/, this.articleConnector.getArtStockStatus(goodId)];
685
+ case 1:
686
+ response = _a.sent();
687
+ if (response && response.validationResult && response.validationResult.success) {
688
+ return [2 /*return*/, response.resultObject];
689
+ }
690
+ else {
691
+ return [2 /*return*/, null];
692
+ }
693
+ return [2 /*return*/];
694
+ }
695
+ });
696
+ });
697
+ };
674
698
  ProductConnectorAdapterService.prototype.getDeliveryDate2 = function (goodId) {
675
699
  return __awaiter(this, void 0, void 0, function () {
676
700
  var response;
@@ -794,22 +818,19 @@
794
818
  });
795
819
  });
796
820
  };
797
- ProductConnectorAdapterService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
798
- return __awaiter(this, void 0, void 0, function () {
799
- return __generator(this, function (_a) {
800
- switch (_a.label) {
801
- case 0: return [4 /*yield*/, this.transactionConnector.addWebSessionTransactionLine(sku, quantity)];
802
- case 1: return [2 /*return*/, _a.sent()];
803
- }
804
- });
805
- });
806
- };
807
- ProductConnectorAdapterService.prototype.getWebTransaction = function () {
821
+ ProductConnectorAdapterService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
808
822
  return __awaiter(this, void 0, void 0, function () {
823
+ var response, infoResponse;
809
824
  return __generator(this, function (_a) {
810
825
  switch (_a.label) {
811
- case 0: return [4 /*yield*/, this.transactionConnector.getWebSessionSalesOrder()];
812
- case 1: return [2 /*return*/, _a.sent()];
826
+ case 0: return [4 /*yield*/, this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity)];
827
+ case 1:
828
+ response = _a.sent();
829
+ if (response && response.validationResult && response.validationResult.success) {
830
+ infoResponse = this._boFactory.makeWithRawBackendData(transactionInfoResponse_bo.TransactionInfoResponse, response.resultObject);
831
+ return [2 /*return*/, infoResponse.transactionInfo.uuid];
832
+ }
833
+ return [2 /*return*/, ""];
813
834
  }
814
835
  });
815
836
  });
@@ -847,6 +868,7 @@
847
868
  "HEIGHT": "Hoogte",
848
869
  "MATERIAL": "Materiaal",
849
870
  "PRODUCT_IN_STOCK": "Op voorraad",
871
+ "PRODUCT_LIMITED_STOCK": "Beperkt op voorraad",
850
872
  "PRODUCT_NOT_IN_STOCK": "Niet op voorraad",
851
873
  "PROPERTIES": "Eigenschappen",
852
874
  "QUOTATION": "Quotatie",
@@ -876,6 +898,7 @@
876
898
  "HEIGHT": "Höhe",
877
899
  "MATERIAL": "Material",
878
900
  "PRODUCT_IN_STOCK": "Auf lager",
901
+ "PRODUCT_LIMITED_STOCK": "Begrentzt auf lager",
879
902
  "PRODUCT_NOT_IN_STOCK": "Nicht auf lager",
880
903
  "PROPERTIES": "Eigenschaften",
881
904
  "QUOTATION": "Angebot",
@@ -1149,6 +1172,9 @@
1149
1172
  this._instanceId = instanceId;
1150
1173
  this._adapterService.setInstance(instanceId);
1151
1174
  };
1175
+ ProductConnectorService.prototype.convertArticleFullObjectToArticleExtended = function (article) {
1176
+ return this._adapterService.convertArticleFullObjectToArticleExtended(article);
1177
+ };
1152
1178
  ProductConnectorService.prototype.getFullArticle = function (sku) {
1153
1179
  return __awaiter(this, void 0, void 0, function () {
1154
1180
  var goodId;
@@ -1179,6 +1205,9 @@
1179
1205
  });
1180
1206
  });
1181
1207
  };
1208
+ ProductConnectorService.prototype.getArtStockStatus = function (goodId) {
1209
+ return this._adapterService.getArtStockStatus(goodId);
1210
+ };
1182
1211
  ProductConnectorService.prototype.getDeliveryDate2 = function (goodId) {
1183
1212
  return this._adapterService.getDeliveryDate2(goodId);
1184
1213
  };
@@ -1189,21 +1218,16 @@
1189
1218
  if (showLoader === void 0) { showLoader = true; }
1190
1219
  return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, this._instanceId, configuratorStatistics);
1191
1220
  };
1192
- ProductConnectorService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
1221
+ ProductConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
1193
1222
  return __awaiter(this, void 0, void 0, function () {
1194
1223
  return __generator(this, function (_a) {
1195
1224
  switch (_a.label) {
1196
- case 0: return [4 /*yield*/, this._adapterService.addWebSessionTransactionLine(sku, quantity)];
1225
+ case 0: return [4 /*yield*/, this._adapterService.addWebSessionTransactionLine(transactionUuid, sku, quantity)];
1197
1226
  case 1: return [2 /*return*/, _a.sent()];
1198
1227
  }
1199
1228
  });
1200
1229
  });
1201
1230
  };
1202
- ProductConnectorService.prototype.getWebTransaction = function () {
1203
- this._adapterService.getWebTransaction().then(function (response) {
1204
- console.log(response);
1205
- });
1206
- };
1207
1231
  ProductConnectorService.prototype.onShowLoaderChange = function (showLoader) {
1208
1232
  this._shouldShowLoader = showLoader;
1209
1233
  };
@@ -1258,12 +1282,15 @@
1258
1282
  // this.sku = '1000234793';
1259
1283
  // this.sku = '1066';
1260
1284
  // this.sku = '104';
1285
+ // this.sku = "70000107";
1286
+ // this.sku = "grover";
1261
1287
  this._dictionary = _dictionary;
1262
1288
  this._jsonUtils = _jsonUtils;
1263
1289
  this._ione = _ione;
1264
1290
  this._changeDetector = _changeDetector;
1265
1291
  this._appEventService = _appEventService;
1266
1292
  this._settingsService = _settingsService;
1293
+ this.handleAddArticleInternally = true;
1267
1294
  this.onAddToCart = new i0.EventEmitter();
1268
1295
  this.forceRenderImage = new i0.EventEmitter();
1269
1296
  this.onAlternativeClick = new i0.EventEmitter();
@@ -1274,11 +1301,10 @@
1274
1301
  this.openStockEvent = new i0.EventEmitter();
1275
1302
  this.settingsLoaded = false;
1276
1303
  this._subs = [];
1277
- // this.sku = "70000107";
1278
1304
  this._subs.push(
1279
1305
  // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
1280
- this._appEventService.onAddToCart.subscribe(function (json) {
1281
- _this._handleAddToCart(json);
1306
+ this._appEventService.onAddToCart.subscribe(function (data) {
1307
+ _this._handleAddToCart(data);
1282
1308
  }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.onAddToQuote.emit(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.onAlternativeClick.emit(article); }), this._appEventService.onArticleInfoReceived.subscribe(function (info) { return _this._handleAnswerInfoReceived(info); }), this._appEventService.onArticleReceived.subscribe(function (article) { return _this.onArticleReceived.emit(article); }), this._appEventService.onSelectionsReceived.subscribe(function (selections) { return _this.onSelectionsReceived.emit(selections); }), this._settingsService.settingsLoaded.subscribe(function (loaded) {
1283
1309
  _this.settingsLoaded = loaded;
1284
1310
  }));
@@ -1304,7 +1330,7 @@
1304
1330
  return __awaiter(this, void 0, void 0, function () {
1305
1331
  return __generator(this, function (_a) {
1306
1332
  switch (_a.label) {
1307
- case 0: return [4 /*yield*/, this._settingsService.initializeSettings(this._settings !== undefined)];
1333
+ case 0: return [4 /*yield*/, this._settingsService.initializeSettings(this._settings === undefined)];
1308
1334
  case 1:
1309
1335
  _a.sent();
1310
1336
  if (this._settings) {
@@ -1324,58 +1350,11 @@
1324
1350
  IoneProductComponent.prototype._handleAnswerInfoReceived = function (info) {
1325
1351
  this.onArticleInfoReceived.next(info);
1326
1352
  };
1327
- IoneProductComponent.prototype._handleAddToCart = function (json) {
1353
+ IoneProductComponent.prototype._handleAddToCart = function (data) {
1328
1354
  return __awaiter(this, void 0, void 0, function () {
1329
- var articleTreeData, compositeGoods, _loop_1, this_1, i;
1330
1355
  return __generator(this, function (_a) {
1331
- switch (_a.label) {
1332
- case 0:
1333
- if (!this._settingsService.settings.createWebOrder) return [3 /*break*/, 7];
1334
- if (!json) return [3 /*break*/, 7];
1335
- articleTreeData = JSON.parse(json);
1336
- if (!(articleTreeData.articleTree && articleTreeData.articleTree.article)) return [3 /*break*/, 7];
1337
- if (!(articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
1338
- articleTreeData.articleTree.compositeGoods.length > 0 &&
1339
- articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles))) return [3 /*break*/, 5];
1340
- compositeGoods = articleTreeData.articleTree.compositeGoods;
1341
- compositeGoods.sort(function (a, b) { return a.versionNumber < b.versionNumber ? -1 : 1; });
1342
- _loop_1 = function (i) {
1343
- var good, subArticle;
1344
- return __generator(this, function (_b) {
1345
- switch (_b.label) {
1346
- case 0:
1347
- good = compositeGoods[i];
1348
- subArticle = articleTreeData.articleTree.subArticles.find(function (s) { return s.goodId === good.memberGoodId; });
1349
- if (!subArticle) return [3 /*break*/, 2];
1350
- return [4 /*yield*/, this_1._ione.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity)];
1351
- case 1:
1352
- _b.sent();
1353
- _b.label = 2;
1354
- case 2: return [2 /*return*/];
1355
- }
1356
- });
1357
- };
1358
- this_1 = this;
1359
- i = 0;
1360
- _a.label = 1;
1361
- case 1:
1362
- if (!(i < compositeGoods.length)) return [3 /*break*/, 4];
1363
- return [5 /*yield**/, _loop_1(i)];
1364
- case 2:
1365
- _a.sent();
1366
- _a.label = 3;
1367
- case 3:
1368
- i++;
1369
- return [3 /*break*/, 1];
1370
- case 4: return [3 /*break*/, 7];
1371
- case 5: return [4 /*yield*/, this._ione.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1)];
1372
- case 6:
1373
- _a.sent();
1374
- _a.label = 7;
1375
- case 7:
1376
- this.onAddToCart.emit(json);
1377
- return [2 /*return*/];
1378
- }
1356
+ this.onAddToCart.emit(data);
1357
+ return [2 /*return*/];
1379
1358
  });
1380
1359
  });
1381
1360
  };
@@ -1387,12 +1366,7 @@
1387
1366
  IoneProductComponent.decorators = [
1388
1367
  { type: i0.Component, args: [{
1389
1368
  selector: 'app-ione-product',
1390
- template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n (openStockEvent)=\"openStock()\" [sku]=\"sku\"\n ></app-product-page>\n ",
1391
- providers: [
1392
- ProductEventService,
1393
- ProductConnectorAdapterService,
1394
- ProductConnectorService
1395
- ],
1369
+ template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n [createFrozenArticle]=\"handleAddArticleInternally\"\n (openStockEvent)=\"openStock()\" [sku]=\"sku\"\n ></app-product-page>\n ",
1396
1370
  encapsulation: i0.ViewEncapsulation.Emulated,
1397
1371
  styles: [""]
1398
1372
  },] }
@@ -1408,6 +1382,7 @@
1408
1382
  IoneProductComponent.propDecorators = {
1409
1383
  sku: [{ type: i0.Input }],
1410
1384
  settings: [{ type: i0.Input }],
1385
+ handleAddArticleInternally: [{ type: i0.Input }],
1411
1386
  onAddToCart: [{ type: i0.Output }],
1412
1387
  forceRenderImage: [{ type: i0.Output }],
1413
1388
  onAlternativeClick: [{ type: i0.Output }],
@@ -1521,6 +1496,7 @@
1521
1496
  this.settingsService = settingsService;
1522
1497
  this.appEventService = appEventService;
1523
1498
  this.icon = IconEnum;
1499
+ this.createFrozenArticle = true;
1524
1500
  this.openStockEvent = new i0.EventEmitter();
1525
1501
  this.configurable = false;
1526
1502
  this.threeD = false;
@@ -1691,7 +1667,7 @@
1691
1667
  ProductPageComponent.decorators = [
1692
1668
  { type: i0.Component, args: [{
1693
1669
  selector: 'app-product-page',
1694
- template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" (openStockEvent)=\"openStock()\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"1\" [label]=\"'RELATED_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"4\" [isSmallModus]=\"false\" [label]=\"'ALTERNATIVE_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n",
1670
+ template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"1\" [label]=\"'RELATED_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"4\" [isSmallModus]=\"false\" [label]=\"'ALTERNATIVE_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n",
1695
1671
  animations: [
1696
1672
  animations.trigger('toggleFullScreen', [
1697
1673
  animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
@@ -1741,6 +1717,7 @@
1741
1717
  fullscreenbutton: [{ type: i0.ViewChild, args: ['fullscreenbutton', { read: i0.ElementRef },] }],
1742
1718
  sku: [{ type: i0.Input }],
1743
1719
  settings: [{ type: i0.Input }],
1720
+ createFrozenArticle: [{ type: i0.Input }],
1744
1721
  openStockEvent: [{ type: i0.Output }]
1745
1722
  };
1746
1723
 
@@ -2257,6 +2234,7 @@
2257
2234
  this._appEventService = _appEventService;
2258
2235
  this._settingsService = _settingsService;
2259
2236
  this.icon = IconEnum;
2237
+ this.createFrozenArticle = true;
2260
2238
  this.configurable = false;
2261
2239
  this.configuring = false;
2262
2240
  this.fullscreen = false;
@@ -2283,15 +2261,22 @@
2283
2261
  };
2284
2262
  ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
2285
2263
  return __awaiter(this, void 0, void 0, function () {
2286
- var _a, _b;
2287
- return __generator(this, function (_c) {
2288
- switch (_c.label) {
2264
+ var _a, _b, _c, article;
2265
+ return __generator(this, function (_d) {
2266
+ switch (_d.label) {
2289
2267
  case 0:
2268
+ if (!this.createFrozenArticle) return [3 /*break*/, 2];
2290
2269
  _b = (_a = this._appEventService.onAddToCart).next;
2270
+ _c = {};
2291
2271
  return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2292
2272
  case 1:
2293
- _b.apply(_a, [_c.sent()]);
2294
- return [2 /*return*/];
2273
+ _b.apply(_a, [(_c.article = _d.sent(), _c.quantity = quantity, _c)]);
2274
+ return [3 /*break*/, 3];
2275
+ case 2:
2276
+ article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
2277
+ this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
2278
+ _d.label = 3;
2279
+ case 3: return [2 /*return*/];
2295
2280
  }
2296
2281
  });
2297
2282
  });
@@ -2348,6 +2333,7 @@
2348
2333
  ProductAddtocartComponent.propDecorators = {
2349
2334
  addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],
2350
2335
  article: [{ type: i0.Input }],
2336
+ createFrozenArticle: [{ type: i0.Input }],
2351
2337
  configurable: [{ type: i0.Input }],
2352
2338
  configuring: [{ type: i0.Input }],
2353
2339
  fullscreen: [{ type: i0.HostBinding, args: ['class.full-screen',] }, { type: i0.Input }],
@@ -2513,29 +2499,51 @@
2513
2499
  this._iconCache = _iconCache;
2514
2500
  this.icon = IconEnum;
2515
2501
  this.openStockEvent = new i0.EventEmitter();
2502
+ this.inStock = false;
2516
2503
  this.iconData = this._iconCache.getIcon(this.icon.Warehouse);
2517
2504
  }
2518
- Object.defineProperty(ProductStockComponent.prototype, "stockAndDelivery", {
2505
+ Object.defineProperty(ProductStockComponent.prototype, "goodId", {
2506
+ get: function () {
2507
+ return this._goodId;
2508
+ },
2519
2509
  set: function (value) {
2520
- if (value) {
2521
- this.numberInStock = value.stock;
2522
- }
2510
+ this._goodId = value;
2511
+ this._getStockStatus();
2523
2512
  },
2524
2513
  enumerable: false,
2525
2514
  configurable: true
2526
2515
  });
2527
- ProductStockComponent.prototype.ngOnInit = function () {
2528
- };
2529
2516
  ProductStockComponent.prototype.openStock = function () {
2530
2517
  this.openStockEvent.emit();
2531
2518
  };
2519
+ ProductStockComponent.prototype._getStockStatus = function () {
2520
+ var _this = this;
2521
+ if (this.goodId) {
2522
+ this._iOne.getArtStockStatus(this.goodId).then(function (result) {
2523
+ switch (result) {
2524
+ case 1: // niet op voorraad
2525
+ _this.stockLabel = 'PRODUCT_LIMITED_STOCK';
2526
+ _this.inStock = true;
2527
+ break;
2528
+ case 2:
2529
+ _this.stockLabel = 'PRODUCT_IN_STOCK';
2530
+ _this.inStock = true;
2531
+ break;
2532
+ default:
2533
+ _this.stockLabel = 'PRODUCT_NOT_IN_STOCK';
2534
+ _this.inStock = false;
2535
+ break;
2536
+ }
2537
+ });
2538
+ }
2539
+ };
2532
2540
  return ProductStockComponent;
2533
2541
  }());
2534
2542
  ProductStockComponent.decorators = [
2535
2543
  { type: i0.Component, args: [{
2536
2544
  selector: 'app-product-stock',
2537
- template: "\n <!--<app-header [label]=\"'STOCK' | localize\"></app-header>-->\n <!--<co-level-indicator [model]=\"'medium'\"></co-level-indicator>-->\n <div class=\"product-stock-wrapper\">\n <co-icon class=\"stock-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-stock-fields\" (click)=\"openStock()\">\n <div class=\"pp-default-label in-stock\" [textContent]=\"'PRODUCT_IN_STOCK' | localize\" *ngIf=\"numberInStock > 0\"></div>\n <div class=\"pp-default-label not-in-stock\" [textContent]=\"'PRODUCT_NOT_IN_STOCK' | localize\" *ngIf=\"!(numberInStock > 0)\"></div>\n </div>\n </div>\n ",
2538
- styles: [":host{display:block}.product-stock-wrapper{display:flex;flex-direction:row;align-items:center;border-top:1px solid #f6f5f4;border-bottom:1px solid #f6f5f4;padding:20px 15px;cursor:pointer}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:40px;height:37px}.product-stock-wrapper .product-stock-fields{display:flex;flex-direction:row}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:14px;margin:0;color:#2b60a7;text-decoration:underline}.product-stock-wrapper .product-stock-fields .pp-default-label:after{content:\"\";width:10px;height:10px;border-radius:10px;background:#74B77F;display:inline-block;margin:0 0 0 15px}.product-stock-wrapper .product-stock-fields .pp-default-label.not-in-stock:after{background:#f15152}@media screen and (max-width: 400px){.product-stock-wrapper{padding:15px 0 15px 10px}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:32px;height:28px}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:13px}}\n"]
2545
+ template: "\n <!--<app-header [label]=\"'STOCK' | localize\"></app-header>-->\n <!--<co-level-indicator [model]=\"'medium'\"></co-level-indicator>-->\n <div class=\"product-stock-wrapper\">\n <co-icon class=\"stock-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-stock-fields\" (click)=\"openStock()\">\n <div class=\"pp-default-label\" [class.in-stock]=\"inStock\" [textContent]=\"stockLabel | localize\"></div>\n </div>\n </div>\n ",
2546
+ styles: [":host{display:block}.product-stock-wrapper{display:flex;flex-direction:row;align-items:center;border-top:1px solid #f6f5f4;border-bottom:1px solid #f6f5f4;padding:20px 15px;cursor:pointer}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:40px;height:37px}.product-stock-wrapper .product-stock-fields{display:flex;flex-direction:row}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:14px;margin:0;color:#2b60a7;text-decoration:underline}.product-stock-wrapper .product-stock-fields .pp-default-label:after{content:\"\";width:10px;height:10px;border-radius:10px;background:#f15152;display:inline-block;margin:0 0 0 15px}.product-stock-wrapper .product-stock-fields .pp-default-label.in-stock:after{background:#74B77F}@media screen and (max-width: 400px){.product-stock-wrapper{padding:15px 0 15px 10px}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:32px;height:28px}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:13px}}\n"]
2539
2547
  },] }
2540
2548
  ];
2541
2549
  ProductStockComponent.ctorParameters = function () { return [
@@ -2543,7 +2551,7 @@
2543
2551
  { type: IconCacheService }
2544
2552
  ]; };
2545
2553
  ProductStockComponent.propDecorators = {
2546
- stockAndDelivery: [{ type: i0.Input }],
2554
+ goodId: [{ type: i0.Input }],
2547
2555
  openStockEvent: [{ type: i0.Output }]
2548
2556
  };
2549
2557
 
@@ -3095,7 +3103,7 @@
3095
3103
  IoneProductModule.decorators = [
3096
3104
  { type: i0.NgModule, args: [{
3097
3105
  imports: [
3098
- animations$1.BrowserAnimationsModule,
3106
+ // BrowserAnimationsModule,
3099
3107
  common.CommonModule,
3100
3108
  ProductPageModule
3101
3109
  ],
@@ -3107,6 +3115,9 @@
3107
3115
  ],
3108
3116
  bootstrap: [
3109
3117
  IoneProductComponent
3118
+ ],
3119
+ providers: [
3120
+ ProductSettingsService
3110
3121
  ]
3111
3122
  },] }
3112
3123
  ];