@colijnit/product 1.9.5 → 2.9.0

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 (66) hide show
  1. package/app/components/product-additional-info/product-additional-info.component.d.ts +4 -3
  2. package/app/components/product-external-source/product-external-source.component.d.ts +30 -0
  3. package/app/components/product-external-source/product-external-source.module.d.ts +2 -0
  4. package/app/components/product-page/product-page.component.d.ts +4 -0
  5. package/app/components/product-page/product-page.module.d.ts +2 -0
  6. package/app/ione-product.component.d.ts +1 -3
  7. package/app/model/{settings.d.ts → productSettings.d.ts} +3 -2
  8. package/app/pipe/pipe.module.d.ts +2 -0
  9. package/app/service/product-connector-adapter.service.d.ts +8 -2
  10. package/app/service/product-connector.service.d.ts +10 -5
  11. package/app/service/product-settings.service.d.ts +3 -3
  12. package/bundles/colijnit-product.umd.js +1476 -1262
  13. package/bundles/colijnit-product.umd.js.map +1 -1
  14. package/bundles/colijnit-product.umd.min.js +2 -2
  15. package/bundles/colijnit-product.umd.min.js.map +1 -1
  16. package/colijnit-product.d.ts +29 -28
  17. package/colijnit-product.metadata.json +1 -1
  18. package/esm2015/app/components/product-additional-info/product-additional-info.component.js +23 -16
  19. package/esm2015/app/components/product-addtocart/product-addtocart.component.js +2 -2
  20. package/esm2015/app/components/product-delivery/product-delivery.component.js +1 -2
  21. package/esm2015/app/components/product-external-source/product-external-source.component.js +123 -0
  22. package/esm2015/app/components/product-external-source/product-external-source.module.js +23 -0
  23. package/esm2015/app/components/product-page/product-page.component.js +45 -15
  24. package/esm2015/app/components/product-page/product-page.module.js +66 -0
  25. package/esm2015/app/ione-product.component.js +38 -19
  26. package/esm2015/app/ione-product.module.js +8 -61
  27. package/esm2015/app/model/productSettings.js +16 -0
  28. package/esm2015/app/pipe/pipe.module.js +20 -0
  29. package/esm2015/app/product-version.js +3 -3
  30. package/esm2015/app/service/dictionary.service.js +1 -1
  31. package/esm2015/app/service/product-connector-adapter.service.js +34 -9
  32. package/esm2015/app/service/product-connector.service.js +33 -35
  33. package/esm2015/app/service/product-event.service.js +2 -6
  34. package/esm2015/app/service/product-settings.service.js +13 -74
  35. package/esm2015/colijnit-product.js +30 -29
  36. package/esm2015/public_api.js +3 -1
  37. package/esm5/app/components/product-additional-info/product-additional-info.component.js +43 -24
  38. package/esm5/app/components/product-addtocart/product-addtocart.component.js +2 -2
  39. package/esm5/app/components/product-delivery/product-delivery.component.js +1 -2
  40. package/esm5/app/components/product-external-source/product-external-source.component.js +126 -0
  41. package/esm5/app/components/product-external-source/product-external-source.module.js +26 -0
  42. package/esm5/app/components/product-page/product-page.component.js +49 -15
  43. package/esm5/app/components/product-page/product-page.module.js +69 -0
  44. package/esm5/app/ione-product.component.js +47 -20
  45. package/esm5/app/ione-product.module.js +8 -61
  46. package/esm5/app/model/productSettings.js +18 -0
  47. package/esm5/app/pipe/pipe.module.js +23 -0
  48. package/esm5/app/product-version.js +3 -3
  49. package/esm5/app/service/dictionary.service.js +1 -1
  50. package/esm5/app/service/product-connector-adapter.service.js +61 -10
  51. package/esm5/app/service/product-connector.service.js +65 -52
  52. package/esm5/app/service/product-event.service.js +2 -6
  53. package/esm5/app/service/product-settings.service.js +14 -74
  54. package/esm5/colijnit-product.js +30 -29
  55. package/esm5/public_api.js +3 -1
  56. package/fesm2015/colijnit-product.js +1189 -1043
  57. package/fesm2015/colijnit-product.js.map +1 -1
  58. package/fesm5/colijnit-product.js +1447 -1234
  59. package/fesm5/colijnit-product.js.map +1 -1
  60. package/package.json +5 -4
  61. package/public_api.d.ts +2 -0
  62. package/app/service/product-module.service.d.ts +0 -9
  63. package/esm2015/app/model/settings.js +0 -15
  64. package/esm2015/app/service/product-module.service.js +0 -39
  65. package/esm5/app/model/settings.js +0 -17
  66. package/esm5/app/service/product-module.service.js +0 -50
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document'), 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('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/platform-browser'), require('@angular/animations'), require('@colijnit/articleapi/build/model/configurator-statistics-environment'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document', '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', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/platform-browser', '@angular/animations', '@colijnit/articleapi/build/model/configurator-statistics-environment', '@angular/common'], factory) :
4
- (global = global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.corecomponents, global.coDocument, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.ng.common.http, global.stringUtils, global.ng.platformBrowser, global.ng.animations, global.configuratorStatisticsEnvironment, global.ng.common));
5
- }(this, (function (exports, core, corecomponents, coDocument, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, http, stringUtils, platformBrowser, animations, configuratorStatisticsEnvironment, common) { '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('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/animations'), require('@colijnit/mainapi/build/model/co-document'), require('@colijnit/corecomponents'), 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', '@angular/animations', '@colijnit/mainapi/build/model/co-document', '@colijnit/corecomponents', '@colijnit/articleapi/build/model/configurator-statistics-environment'], factory) :
4
+ (global = 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, global.ng.animations, global.coDocument, global.corecomponents, global.configuratorStatisticsEnvironment));
5
+ }(this, (function (exports, core, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, http, stringUtils, common, platformBrowser, animations, coDocument, corecomponents, configuratorStatisticsEnvironment) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -228,28 +228,94 @@
228
228
  function Version() {
229
229
  this.name = "@colijnit/product";
230
230
  this.description = "Product detail page project for iOne";
231
- this.symVer = "1.9.5";
232
- this.publishDate = "21-6-2023 11:47:53";
231
+ this.symVer = "2.9.0";
232
+ this.publishDate = "7-9-2023 15:18:44";
233
233
  }
234
234
  return Version;
235
235
  }());
236
236
 
237
- var ProductDescriptionComponent = /** @class */ (function () {
238
- function ProductDescriptionComponent() {
237
+ var JsonUtilsService = /** @class */ (function () {
238
+ function JsonUtilsService() {
239
239
  }
240
- ProductDescriptionComponent.prototype.ngOnInit = function () {
240
+ JsonUtilsService.prototype.readJsonFile = function (filePath) {
241
+ return __awaiter(this, void 0, void 0, function () {
242
+ var response, e_1;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0:
246
+ _a.trys.push([0, 2, , 3]);
247
+ return [4 /*yield*/, fetch(filePath)];
248
+ case 1:
249
+ response = _a.sent();
250
+ if (!response.ok) {
251
+ return [2 /*return*/, null];
252
+ }
253
+ else {
254
+ return [2 /*return*/, response.json()];
255
+ }
256
+ return [3 /*break*/, 3];
257
+ case 2:
258
+ e_1 = _a.sent();
259
+ console.error('Error getting file:', e_1.message);
260
+ return [2 /*return*/, ''];
261
+ case 3: return [2 /*return*/];
262
+ }
263
+ });
264
+ });
241
265
  };
242
- __decorate([
243
- core.Input()
244
- ], ProductDescriptionComponent.prototype, "article", void 0);
245
- ProductDescriptionComponent = __decorate([
246
- core.Component({
247
- selector: 'app-product-description',
248
- template: "<div class=\"pd-title-wrapper\">\n <span class=\"pd-description\" [textContent]=\"article?.descriptionRetail\" *ngIf=\"article?.descriptionRetail\"></span>\n <span class=\"pd-sku\" [textContent]=\"article?.articleNr\" *ngIf=\"article?.articleNr\"></span>\n</div>\n",
249
- styles: [":host{display:block}.pd-title-wrapper{margin:20px 0 0}.pd-description{color:#22313c;font-size:25px;font-weight:700;width:100%;display:block}.pd-sku{color:#5b6875;font-size:16px}@media screen and (max-width:650px){.pd-description{font-size:21px}.pd-sku{font-size:13px}}"]
266
+ JsonUtilsService.ɵprov = core.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
267
+ JsonUtilsService = __decorate([
268
+ core.Injectable({
269
+ providedIn: 'root'
250
270
  })
251
- ], ProductDescriptionComponent);
252
- return ProductDescriptionComponent;
271
+ ], JsonUtilsService);
272
+ return JsonUtilsService;
273
+ }());
274
+
275
+ var SettingsOptions = /** @class */ (function () {
276
+ function SettingsOptions() {
277
+ this.showStockStatus = false;
278
+ this.showZoomButton = false;
279
+ this.showTagFilter = false;
280
+ this.showAsConfigured = false;
281
+ this.inlineAnswers = false;
282
+ this.showArButton = false;
283
+ this.arEnabled = false;
284
+ this.vrEnabled = false;
285
+ }
286
+ return SettingsOptions;
287
+ }());
288
+
289
+ var RenderModes;
290
+ (function (RenderModes) {
291
+ RenderModes["RenderRoom"] = "render_room";
292
+ RenderModes["RenderShop"] = "render_shop";
293
+ RenderModes["RenderIone"] = "render_ione";
294
+ })(RenderModes || (RenderModes = {}));
295
+
296
+ var RenderParameters = /** @class */ (function () {
297
+ function RenderParameters() {
298
+ this.host = "";
299
+ this.port = 0;
300
+ this.secure = false;
301
+ this.renderMode = RenderModes.RenderShop;
302
+ }
303
+ return RenderParameters;
304
+ }());
305
+
306
+ var ProductSettings = /** @class */ (function () {
307
+ function ProductSettings() {
308
+ this.session = undefined;
309
+ this.useGroups = true;
310
+ this.useRenders = false;
311
+ this.useLoginEncryption = true;
312
+ this.createWebOrder = true;
313
+ this.useMatch = false;
314
+ this.currencySymbol = '€';
315
+ this.options = new SettingsOptions();
316
+ this.renderParameters = new RenderParameters();
317
+ }
318
+ return ProductSettings;
253
319
  }());
254
320
 
255
321
  // Sole responsibility is simply to wrap around a colijn.Connector to create a stable inner interface to the library in a 1:1 method way.
@@ -263,14 +329,46 @@
263
329
  this.articleConnector.showLoader.unsubscribe();
264
330
  };
265
331
  ProductConnectorAdapterService.prototype.initConnector = function (options) {
266
- var _this = this;
267
- this.articleConnector = new articles.Articles(options);
268
- options.session = this.articleConnector.session;
269
- this.articleConnector.showLoader.subscribe(function (value) { return _this.showLoader.next(value); });
332
+ return __awaiter(this, void 0, void 0, function () {
333
+ var _this = this;
334
+ return __generator(this, function (_a) {
335
+ switch (_a.label) {
336
+ case 0:
337
+ this.articleConnector = new articles.Articles(options);
338
+ return [4 /*yield*/, this.articleConnector.connect()];
339
+ case 1:
340
+ _a.sent();
341
+ this.transactionConnector = new transaction.Transaction(options);
342
+ this.articleConnector.showLoader.subscribe(function (value) { return _this.showLoader.next(value); });
343
+ return [2 /*return*/];
344
+ }
345
+ });
346
+ });
270
347
  };
271
348
  ProductConnectorAdapterService.prototype.setInstance = function (instanceId) {
272
349
  // this.articleConnector.setInstanceToConfigure(instanceId, false);
273
350
  };
351
+ ProductConnectorAdapterService.prototype.getProductBundleSettings = function (url, upId) {
352
+ return __awaiter(this, void 0, void 0, function () {
353
+ var tempSettings, tempMainConnector, response;
354
+ return __generator(this, function (_a) {
355
+ switch (_a.label) {
356
+ case 0:
357
+ tempSettings = new ProductSettings();
358
+ tempSettings.url = url;
359
+ tempSettings.schema = upId.toString();
360
+ tempMainConnector = new mainapi.MainApi(tempSettings);
361
+ return [4 /*yield*/, tempMainConnector.getPublicParams(upId)];
362
+ case 1:
363
+ response = _a.sent();
364
+ if (response) {
365
+ return [2 /*return*/, response.productSettings];
366
+ }
367
+ return [2 /*return*/, ""];
368
+ }
369
+ });
370
+ });
371
+ };
274
372
  ProductConnectorAdapterService.prototype.getDeliveryPrognosis = function (goodId, branchNr) {
275
373
  return __awaiter(this, void 0, void 0, function () {
276
374
  var deliveryPrognosis;
@@ -429,51 +527,30 @@
429
527
  });
430
528
  });
431
529
  };
432
- ProductConnectorAdapterService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductConnectorAdapterService_Factory() { return new ProductConnectorAdapterService(); }, token: ProductConnectorAdapterService, providedIn: "root" });
433
- ProductConnectorAdapterService = __decorate([
434
- core.Injectable({
435
- providedIn: 'root'
436
- })
437
- ], ProductConnectorAdapterService);
438
- return ProductConnectorAdapterService;
439
- }());
440
-
441
- var JsonUtilsService = /** @class */ (function () {
442
- function JsonUtilsService() {
443
- }
444
- JsonUtilsService.prototype.readJsonFile = function (filePath) {
530
+ ProductConnectorAdapterService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
445
531
  return __awaiter(this, void 0, void 0, function () {
446
- var response, e_1;
447
532
  return __generator(this, function (_a) {
448
533
  switch (_a.label) {
449
- case 0:
450
- _a.trys.push([0, 2, , 3]);
451
- return [4 /*yield*/, fetch(filePath)];
452
- case 1:
453
- response = _a.sent();
454
- if (!response.ok) {
455
- return [2 /*return*/, null];
456
- }
457
- else {
458
- return [2 /*return*/, response.json()];
459
- }
460
- return [3 /*break*/, 3];
461
- case 2:
462
- e_1 = _a.sent();
463
- console.error('Error getting file:', e_1.message);
464
- return [2 /*return*/, ''];
465
- case 3: return [2 /*return*/];
534
+ case 0: return [4 /*yield*/, this.transactionConnector.addWebSessionTransactionLine(sku, quantity)];
535
+ case 1: return [2 /*return*/, _a.sent()];
466
536
  }
467
537
  });
468
538
  });
469
539
  };
470
- JsonUtilsService.ɵprov = core.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
471
- JsonUtilsService = __decorate([
472
- core.Injectable({
473
- providedIn: 'root'
474
- })
475
- ], JsonUtilsService);
476
- return JsonUtilsService;
540
+ ProductConnectorAdapterService.prototype.getWebTransaction = function () {
541
+ return __awaiter(this, void 0, void 0, function () {
542
+ return __generator(this, function (_a) {
543
+ switch (_a.label) {
544
+ case 0: return [4 /*yield*/, this.transactionConnector.getWebSessionSalesOrder()];
545
+ case 1: return [2 /*return*/, _a.sent()];
546
+ }
547
+ });
548
+ });
549
+ };
550
+ ProductConnectorAdapterService = __decorate([
551
+ core.Injectable()
552
+ ], ProductConnectorAdapterService);
553
+ return ProductConnectorAdapterService;
477
554
  }());
478
555
 
479
556
  var LanguageCode;
@@ -634,51 +711,6 @@
634
711
  return DictionaryService;
635
712
  }());
636
713
 
637
- var SettingsOptions = /** @class */ (function () {
638
- function SettingsOptions() {
639
- this.showStockStatus = false;
640
- this.showZoomButton = false;
641
- this.showTagFilter = false;
642
- this.showAsConfigured = false;
643
- this.inlineAnswers = false;
644
- this.showArButton = false;
645
- this.arEnabled = false;
646
- this.vrEnabled = false;
647
- }
648
- return SettingsOptions;
649
- }());
650
-
651
- var RenderModes;
652
- (function (RenderModes) {
653
- RenderModes["RenderRoom"] = "render_room";
654
- RenderModes["RenderShop"] = "render_shop";
655
- RenderModes["RenderIone"] = "render_ione";
656
- })(RenderModes || (RenderModes = {}));
657
-
658
- var RenderParameters = /** @class */ (function () {
659
- function RenderParameters() {
660
- this.host = "";
661
- this.port = 0;
662
- this.secure = false;
663
- this.renderMode = RenderModes.RenderShop;
664
- }
665
- return RenderParameters;
666
- }());
667
-
668
- var Settings = /** @class */ (function () {
669
- function Settings() {
670
- this.session = undefined;
671
- this.useGroups = true;
672
- this.useRenders = false;
673
- this.useEncryption = true;
674
- this.useMatch = false;
675
- this.currencySymbol = '€';
676
- this.options = new SettingsOptions();
677
- this.renderParameters = new RenderParameters();
678
- }
679
- return Settings;
680
- }());
681
-
682
714
  var ProductSettingsService = /** @class */ (function () {
683
715
  function ProductSettingsService(_jsonUtilsService, _dictionaryService) {
684
716
  this._jsonUtilsService = _jsonUtilsService;
@@ -706,13 +738,13 @@
706
738
  case 1:
707
739
  jsonSettings = _a.sent();
708
740
  if (jsonSettings) {
709
- this.settings = Object.assign(new Settings(), jsonSettings);
741
+ this.settings = Object.assign(new ProductSettings(), jsonSettings);
710
742
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
711
743
  this.settingsFinished();
712
744
  }
713
745
  return [3 /*break*/, 3];
714
746
  case 2:
715
- this.settings = Object.assign(new Settings(), settings);
747
+ this.settings = Object.assign(new ProductSettings(), settings);
716
748
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
717
749
  this.settingsFinished();
718
750
  _a.label = 3;
@@ -723,52 +755,19 @@
723
755
  };
724
756
  ProductSettingsService.prototype.createSettingsFromObject = function (obj) {
725
757
  return __awaiter(this, void 0, void 0, function () {
758
+ var ownOptions, ownRenderParameters;
726
759
  return __generator(this, function (_a) {
727
760
  if (!this.settings) {
728
- this.settings = new Settings();
729
- }
730
- if (obj.hasOwnProperty('url')) {
731
- this.settings.url = obj['url'];
732
- this._dictionaryService.rootUrl = this.settings.url.replace('/ajaxservice', '');
733
- }
734
- if (obj.hasOwnProperty('schema')) {
735
- this.settings.schema = obj['schema'];
736
- }
737
- if (obj.hasOwnProperty('version')) {
738
- this.settings.version = obj['version'];
739
- }
740
- if (obj.hasOwnProperty('branch')) {
741
- this.settings.branch = obj['branch'];
742
- }
743
- if (obj.hasOwnProperty('currency')) {
744
- this.settings.currency = obj['currency'];
745
- }
746
- if (obj.hasOwnProperty('client')) {
747
- this.settings.client = obj['client'];
748
- }
749
- if (obj.hasOwnProperty('languageCode')) {
750
- this.settings.languageCode = obj['languageCode'];
751
- }
752
- if (obj.hasOwnProperty('username')) {
753
- this.settings.username = obj['username'];
761
+ this.settings = new ProductSettings();
754
762
  }
755
- if (obj.hasOwnProperty('password')) {
756
- this.settings.password = obj['password'];
763
+ ownOptions = Object.assign({}, this.settings.options);
764
+ ownRenderParameters = Object.assign({}, this.settings.renderParameters);
765
+ this.settings = Object.assign({}, this.settings, obj);
766
+ if (obj.renderParameters) {
767
+ this.settings.renderParameters = Object.assign({}, ownRenderParameters, obj.renderParameters);
757
768
  }
758
- if (obj.hasOwnProperty('timeoutInMs')) {
759
- this.settings.timeoutInMs = obj['timeoutInMs'];
760
- }
761
- if (obj.hasOwnProperty('session')) {
762
- this.settings.session = obj['session'];
763
- }
764
- if (obj.hasOwnProperty('useGroups')) {
765
- this.settings.useGroups = obj['useGroups'];
766
- }
767
- if (obj.hasOwnProperty('useEncryption')) {
768
- this.settings.useEncryption = obj['useEncryption'];
769
- }
770
- if (obj.hasOwnProperty('useMatch')) {
771
- this.settings.useMatch = obj['useMatch'];
769
+ if (obj.options) {
770
+ this.settings.options = Object.assign({}, ownOptions, obj.options);
772
771
  }
773
772
  if (obj.hasOwnProperty('assetPath')) {
774
773
  this.settings.assetPath = obj['assetPath'];
@@ -783,27 +782,6 @@
783
782
  this.settings.threeDAssetPath += '/';
784
783
  }
785
784
  }
786
- if (obj.hasOwnProperty('currencySymbol')) {
787
- this.settings.currencySymbol = obj['currencySymbol'];
788
- }
789
- if (obj.hasOwnProperty('gtm')) {
790
- this.settings.gtm = obj['gtm'];
791
- }
792
- if (obj.hasOwnProperty('assetIndex')) {
793
- this.settings.assetIndex = obj['assetIndex'];
794
- }
795
- if (obj.hasOwnProperty('lightPresetsIndex')) {
796
- this.settings.lightPresetsIndex = obj['lightPresetsIndex'];
797
- }
798
- if (obj.hasOwnProperty('additionalTranslationFile')) {
799
- this.settings.additionalTranslationFile = obj['additionalTranslationFile'];
800
- }
801
- if (obj.hasOwnProperty('options')) {
802
- this.settings.options = obj['options'];
803
- }
804
- if (obj.hasOwnProperty('renderParameters')) {
805
- this.settings.renderParameters = obj['renderParameters'];
806
- }
807
785
  this.settingsFinished();
808
786
  return [2 /*return*/];
809
787
  });
@@ -826,19 +804,16 @@
826
804
  { type: JsonUtilsService },
827
805
  { type: DictionaryService }
828
806
  ]; };
829
- ProductSettingsService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductSettingsService_Factory() { return new ProductSettingsService(core.ɵɵinject(JsonUtilsService), core.ɵɵinject(DictionaryService)); }, token: ProductSettingsService, providedIn: "root" });
830
807
  ProductSettingsService = __decorate([
831
- core.Injectable({
832
- providedIn: 'root'
833
- })
808
+ core.Injectable()
834
809
  ], ProductSettingsService);
835
810
  return ProductSettingsService;
836
811
  }());
837
812
 
838
813
  // Holds all iONE backend related state and methods for a running HomeDecorator. To be used anywhere internally.
839
814
  var ProductConnectorService = /** @class */ (function () {
840
- function ProductConnectorService(connector, _settingsService) {
841
- this.connector = connector;
815
+ function ProductConnectorService(_adapterService, _settingsService) {
816
+ this._adapterService = _adapterService;
842
817
  this._settingsService = _settingsService;
843
818
  this.controllerInitialized = new rxjs.BehaviorSubject(false);
844
819
  this._initializing = false;
@@ -856,57 +831,61 @@
856
831
  ProductConnectorService.prototype.ngOnDestroy = function () {
857
832
  this.subs.forEach(function (sub) { return sub.unsubscribe(); });
858
833
  };
859
- ProductConnectorService.prototype.initDefaultDevelopTestConnection = function () {
834
+ ProductConnectorService.prototype.initConnection = function () {
860
835
  return __awaiter(this, void 0, void 0, function () {
861
- var settings;
836
+ var settings, e_1;
862
837
  return __generator(this, function (_a) {
863
- if (this._initialized || this._initializing) {
864
- return [2 /*return*/];
865
- }
866
- this._initializing = true;
867
- try {
868
- settings = this._settingsService.settings;
869
- if (!settings) {
870
- throw Error('Settings are not defined!');
871
- }
872
- this.connectorOptions.url = settings.url;
873
- this.connectorOptions.schema = settings.schema;
874
- this.connectorOptions.version = settings.version;
875
- this.connectorOptions.branch = settings.branch;
876
- this.connectorOptions.username = settings.username;
877
- this.connectorOptions.password = settings.password;
878
- this.connectorOptions.session = settings.session;
879
- this.connectorOptions.currencyId = settings.currency;
880
- this.connectorOptions.useGroups = settings.useGroups;
881
- this.connectorOptions.useRenders = settings.useRenders;
882
- this.connectorOptions.useLoginEncryption = settings.useEncryption;
883
- this.connectorOptions.languageCode = settings.languageCode;
884
- this.connector.initConnector(this.connectorOptions);
885
- this._settingsService.settings.session = this.connectorOptions.session;
886
- this.controllerInitialized.next(true);
887
- this._initialized = true;
888
- this._initializing = false;
889
- }
890
- catch (e) {
891
- this._initializing = false;
838
+ switch (_a.label) {
839
+ case 0:
840
+ if (this._initialized || this._initializing) {
841
+ return [2 /*return*/];
842
+ }
843
+ this._initializing = true;
844
+ _a.label = 1;
845
+ case 1:
846
+ _a.trys.push([1, 3, , 4]);
847
+ settings = this._settingsService.settings;
848
+ if (!settings) {
849
+ throw Error('Settings are not defined!');
850
+ }
851
+ this.connectorOptions = Object.assign(new options.Options(), settings);
852
+ return [4 /*yield*/, this._adapterService.initConnector(this.connectorOptions)];
853
+ case 2:
854
+ _a.sent();
855
+ this.controllerInitialized.next(true);
856
+ this._initialized = true;
857
+ this._initializing = false;
858
+ return [3 /*break*/, 4];
859
+ case 3:
860
+ e_1 = _a.sent();
861
+ this._initializing = false;
862
+ return [3 /*break*/, 4];
863
+ case 4: return [2 /*return*/];
892
864
  }
893
- return [2 /*return*/];
865
+ });
866
+ });
867
+ };
868
+ ProductConnectorService.prototype.getProductBundleSettings = function (url, upId) {
869
+ return __awaiter(this, void 0, void 0, function () {
870
+ return __generator(this, function (_a) {
871
+ return [2 /*return*/, this._adapterService.getProductBundleSettings(url, upId)];
894
872
  });
895
873
  });
896
874
  };
897
875
  ProductConnectorService.prototype.setInstance = function (instanceId) {
898
- this.connector.setInstance(instanceId);
876
+ this._instanceId = instanceId;
877
+ this._adapterService.setInstance(instanceId);
899
878
  };
900
879
  ProductConnectorService.prototype.getFullArticle = function (sku) {
901
880
  return __awaiter(this, void 0, void 0, function () {
902
881
  var goodId;
903
882
  return __generator(this, function (_a) {
904
883
  switch (_a.label) {
905
- case 0: return [4 /*yield*/, this.connector.getGoodIdFromArticleNr(sku)];
884
+ case 0: return [4 /*yield*/, this._adapterService.getGoodIdFromArticleNr(sku)];
906
885
  case 1:
907
886
  goodId = _a.sent();
908
887
  if (goodId) {
909
- return [2 /*return*/, this.connector.getArticleFullObject(goodId)];
888
+ return [2 /*return*/, this._adapterService.getArticleFullObject(goodId)];
910
889
  }
911
890
  return [2 /*return*/, null];
912
891
  }
@@ -915,27 +894,42 @@
915
894
  };
916
895
  ProductConnectorService.prototype.getDocumentContent = function (docId, thumbnail) {
917
896
  if (thumbnail === void 0) { thumbnail = true; }
918
- return this.connector.getDocumentContent(docId, thumbnail);
897
+ return this._adapterService.getDocumentContent(docId, thumbnail);
919
898
  };
920
899
  ProductConnectorService.prototype.getDeliveryPrognosis = function (goodId) {
921
- return this.connector.getDeliveryPrognosis(goodId);
900
+ return this._adapterService.getDeliveryPrognosis(goodId);
922
901
  };
923
902
  ProductConnectorService.prototype.getSelectorDeliveryDate = function () {
924
903
  return __awaiter(this, void 0, void 0, function () {
925
904
  return __generator(this, function (_a) {
926
- return [2 /*return*/, this.connector.getSelectorDeliveryDate()];
905
+ return [2 /*return*/, this._adapterService.getSelectorDeliveryDate()];
927
906
  });
928
907
  });
929
908
  };
930
909
  ProductConnectorService.prototype.getDeliveryDate2 = function (goodId) {
931
- return this.connector.getDeliveryDate2(goodId);
910
+ return this._adapterService.getDeliveryDate2(goodId);
932
911
  };
933
912
  ProductConnectorService.prototype.getSuperArticle = function (id) {
934
- return this.connector.getSuperArticle(id);
913
+ return this._adapterService.getSuperArticle(id);
935
914
  };
936
- ProductConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics) {
915
+ ProductConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, configuratorStatistics) {
937
916
  if (showLoader === void 0) { showLoader = true; }
938
- return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics);
917
+ return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, this._instanceId, configuratorStatistics);
918
+ };
919
+ ProductConnectorService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
920
+ return __awaiter(this, void 0, void 0, function () {
921
+ return __generator(this, function (_a) {
922
+ switch (_a.label) {
923
+ case 0: return [4 /*yield*/, this._adapterService.addWebSessionTransactionLine(sku, quantity)];
924
+ case 1: return [2 /*return*/, _a.sent()];
925
+ }
926
+ });
927
+ });
928
+ };
929
+ ProductConnectorService.prototype.getWebTransaction = function () {
930
+ this._adapterService.getWebTransaction().then(function (response) {
931
+ console.log(response);
932
+ });
939
933
  };
940
934
  ProductConnectorService.prototype.onShowLoaderChange = function (showLoader) {
941
935
  this._shouldShowLoader = showLoader;
@@ -944,11 +938,8 @@
944
938
  { type: ProductConnectorAdapterService },
945
939
  { type: ProductSettingsService }
946
940
  ]; };
947
- ProductConnectorService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductConnectorService_Factory() { return new ProductConnectorService(core.ɵɵinject(ProductConnectorAdapterService), core.ɵɵinject(ProductSettingsService)); }, token: ProductConnectorService, providedIn: "root" });
948
941
  ProductConnectorService = __decorate([
949
- core.Injectable({
950
- providedIn: 'root'
951
- })
942
+ core.Injectable()
952
943
  ], ProductConnectorService);
953
944
  return ProductConnectorService;
954
945
  }());
@@ -968,7 +959,6 @@
968
959
  this.onArticleInfoReceived = new rxjs.Subject();
969
960
  this.onUpdateProductInfoTab = new rxjs.Subject();
970
961
  }
971
- ProductEventService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductEventService_Factory() { return new ProductEventService(); }, token: ProductEventService, providedIn: "root" });
972
962
  __decorate([
973
963
  core.Output()
974
964
  ], ProductEventService.prototype, "onAddToCart", void 0);
@@ -983,14 +973,321 @@
983
973
  ], ProductEventService.prototype, "onForceRenderImage", void 0);
984
974
  ProductEventService = __decorate([
985
975
  core.Directive(),
986
- core.Injectable({
987
- providedIn: 'root'
988
- })
976
+ core.Injectable()
989
977
  ], ProductEventService);
990
978
  return ProductEventService;
991
979
  }());
992
980
 
993
- /** AUTO GENERATED FILE. DO NOT CHANGE.. **/
981
+ var IoneProductComponent = /** @class */ (function () {
982
+ function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
983
+ // this.sku = 'CF-HILL';
984
+ // this.sku = 'CF-ALMADA';
985
+ // this.sku = 'CF-39904ANT';
986
+ // this.sku = 'CF-22346001';
987
+ // this.sku = '104';
988
+ // this.sku = '1000561986';
989
+ // this.sku = '1000567768';
990
+ // this.sku = '1000234793';
991
+ // this.sku = '1066';
992
+ // this.sku = '104';
993
+ var _this = this;
994
+ this._dictionary = _dictionary;
995
+ this._jsonUtils = _jsonUtils;
996
+ this._ione = _ione;
997
+ this._changeDetector = _changeDetector;
998
+ this._appEventService = _appEventService;
999
+ this._settingsService = _settingsService;
1000
+ this.onAddToCart = new core.EventEmitter();
1001
+ this.forceRenderImage = new core.EventEmitter();
1002
+ this.onAlternativeClick = new core.EventEmitter();
1003
+ this.onArticleInfoReceived = new core.EventEmitter();
1004
+ this.onArticleReceived = new core.EventEmitter();
1005
+ this.onSelectionsReceived = new core.EventEmitter();
1006
+ this.onAddToQuote = new core.EventEmitter();
1007
+ this._subs = [];
1008
+ // this.sku = "70000107";
1009
+ this._subs.push(
1010
+ // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
1011
+ this._appEventService.onAddToCart.subscribe(function (json) {
1012
+ _this._handleAddToCart(json);
1013
+ }), 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); }));
1014
+ }
1015
+ Object.defineProperty(IoneProductComponent.prototype, "settings", {
1016
+ get: function () {
1017
+ return this._settings;
1018
+ },
1019
+ set: function (value) {
1020
+ if (value) {
1021
+ var settings = void 0;
1022
+ if (typeof value === 'string') {
1023
+ settings = JSON.parse(value);
1024
+ }
1025
+ else {
1026
+ settings = value;
1027
+ }
1028
+ this._settingsService.createSettingsFromObject(settings);
1029
+ // this._initConnection(settings);
1030
+ }
1031
+ },
1032
+ enumerable: true,
1033
+ configurable: true
1034
+ });
1035
+ IoneProductComponent.prototype.ngOnChanges = function (changes) {
1036
+ this._changeDetector.detectChanges();
1037
+ };
1038
+ IoneProductComponent.prototype.ngOnDestroy = function () {
1039
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
1040
+ };
1041
+ IoneProductComponent.prototype._handleAnswerInfoReceived = function (info) {
1042
+ this.onArticleInfoReceived.next(info);
1043
+ };
1044
+ IoneProductComponent.prototype._handleAddToCart = function (json) {
1045
+ return __awaiter(this, void 0, void 0, function () {
1046
+ var articleTreeData, i, good, subArticle;
1047
+ return __generator(this, function (_a) {
1048
+ switch (_a.label) {
1049
+ case 0:
1050
+ if (!this._settingsService.settings.createWebOrder) return [3 /*break*/, 7];
1051
+ if (!json) return [3 /*break*/, 7];
1052
+ articleTreeData = JSON.parse(json);
1053
+ if (!(articleTreeData.articleTree && articleTreeData.articleTree.article)) return [3 /*break*/, 7];
1054
+ if (!(articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
1055
+ articleTreeData.articleTree.compositeGoods.length > 0 && articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles))) return [3 /*break*/, 5];
1056
+ i = 0;
1057
+ _a.label = 1;
1058
+ case 1:
1059
+ if (!(i < articleTreeData.articleTree.compositeGoods.length - 1)) return [3 /*break*/, 4];
1060
+ good = articleTreeData.articleTree.compositeGoods[i];
1061
+ subArticle = articleTreeData.articleTree.subArticles[i];
1062
+ return [4 /*yield*/, this._ione.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity)];
1063
+ case 2:
1064
+ _a.sent();
1065
+ _a.label = 3;
1066
+ case 3:
1067
+ i++;
1068
+ return [3 /*break*/, 1];
1069
+ case 4: return [3 /*break*/, 7];
1070
+ case 5: return [4 /*yield*/, this._ione.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1)];
1071
+ case 6:
1072
+ _a.sent();
1073
+ _a.label = 7;
1074
+ case 7:
1075
+ this.onAddToCart.emit(json);
1076
+ return [2 /*return*/];
1077
+ }
1078
+ });
1079
+ });
1080
+ };
1081
+ IoneProductComponent.ctorParameters = function () { return [
1082
+ { type: DictionaryService },
1083
+ { type: JsonUtilsService },
1084
+ { type: ProductConnectorService },
1085
+ { type: core.ChangeDetectorRef },
1086
+ { type: ProductEventService },
1087
+ { type: ProductSettingsService }
1088
+ ]; };
1089
+ __decorate([
1090
+ core.Input()
1091
+ ], IoneProductComponent.prototype, "sku", void 0);
1092
+ __decorate([
1093
+ core.Input()
1094
+ ], IoneProductComponent.prototype, "settings", null);
1095
+ __decorate([
1096
+ core.Output()
1097
+ ], IoneProductComponent.prototype, "onAddToCart", void 0);
1098
+ __decorate([
1099
+ core.Output()
1100
+ ], IoneProductComponent.prototype, "forceRenderImage", void 0);
1101
+ __decorate([
1102
+ core.Output()
1103
+ ], IoneProductComponent.prototype, "onAlternativeClick", void 0);
1104
+ __decorate([
1105
+ core.Output()
1106
+ ], IoneProductComponent.prototype, "onArticleInfoReceived", void 0);
1107
+ __decorate([
1108
+ core.Output()
1109
+ ], IoneProductComponent.prototype, "onArticleReceived", void 0);
1110
+ __decorate([
1111
+ core.Output()
1112
+ ], IoneProductComponent.prototype, "onSelectionsReceived", void 0);
1113
+ __decorate([
1114
+ core.Output()
1115
+ ], IoneProductComponent.prototype, "onAddToQuote", void 0);
1116
+ IoneProductComponent = __decorate([
1117
+ core.Component({
1118
+ selector: 'app-ione-product',
1119
+ template: "\n <app-product-page [sku]=\"sku\"\n ></app-product-page>\n ",
1120
+ providers: [
1121
+ ProductEventService,
1122
+ ProductSettingsService,
1123
+ ProductConnectorAdapterService,
1124
+ ProductConnectorService
1125
+ ],
1126
+ encapsulation: core.ViewEncapsulation.Emulated,
1127
+ styles: [""]
1128
+ })
1129
+ ], IoneProductComponent);
1130
+ return IoneProductComponent;
1131
+ }());
1132
+
1133
+ var ProductInitializerService = /** @class */ (function () {
1134
+ function ProductInitializerService(_settingsService) {
1135
+ this._settingsService = _settingsService;
1136
+ }
1137
+ ProductInitializerService.prototype.initializeApp = function () {
1138
+ return __awaiter(this, void 0, void 0, function () {
1139
+ return __generator(this, function (_a) {
1140
+ return [2 /*return*/, this._settingsService.initializeSettings()];
1141
+ });
1142
+ });
1143
+ };
1144
+ ProductInitializerService.ctorParameters = function () { return [
1145
+ { type: ProductSettingsService }
1146
+ ]; };
1147
+ ProductInitializerService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductInitializerService_Factory() { return new ProductInitializerService(core.ɵɵinject(ProductSettingsService)); }, token: ProductInitializerService, providedIn: "root" });
1148
+ ProductInitializerService = __decorate([
1149
+ core.Injectable({
1150
+ providedIn: 'root',
1151
+ })
1152
+ ], ProductInitializerService);
1153
+ return ProductInitializerService;
1154
+ }());
1155
+
1156
+ var ProductExternalSourceComponent = /** @class */ (function () {
1157
+ function ProductExternalSourceComponent(_sanitizer, _productConnectorService, _appEventService) {
1158
+ this._sanitizer = _sanitizer;
1159
+ this._productConnectorService = _productConnectorService;
1160
+ this._appEventService = _appEventService;
1161
+ this.addToCart = new core.EventEmitter();
1162
+ this.addToQuote = new core.EventEmitter();
1163
+ this.alternativeClick = new core.EventEmitter();
1164
+ this.showProduct = false;
1165
+ this.loaded = false;
1166
+ this.externalSettings = {};
1167
+ this._subs = [];
1168
+ }
1169
+ Object.defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
1170
+ get: function () {
1171
+ return this._externalSource;
1172
+ },
1173
+ set: function (value) {
1174
+ this._externalSource = value;
1175
+ this.loaded = false;
1176
+ this._prepareExternalSource();
1177
+ },
1178
+ enumerable: true,
1179
+ configurable: true
1180
+ });
1181
+ ProductExternalSourceComponent.prototype.showClass = function () {
1182
+ return true;
1183
+ };
1184
+ ProductExternalSourceComponent.prototype.ngOnInit = function () {
1185
+ var _this = this;
1186
+ this._subs.push(this._appEventService.onAddToCart.subscribe(function (json) { return _this.addToCart.next(json); }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.addToQuote.next(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.alternativeClick.next(article); }));
1187
+ };
1188
+ ProductExternalSourceComponent.prototype.ngOnDestroy = function () {
1189
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
1190
+ };
1191
+ ProductExternalSourceComponent.prototype._prepareExternalSource = function () {
1192
+ return __awaiter(this, void 0, void 0, function () {
1193
+ var bundleSettings;
1194
+ return __generator(this, function (_a) {
1195
+ switch (_a.label) {
1196
+ case 0:
1197
+ if (!this._externalSource) {
1198
+ return [2 /*return*/];
1199
+ }
1200
+ this.externalUrl = undefined;
1201
+ this.externalSettings = {};
1202
+ if (!(this.externalSource.type === 'CATF')) return [3 /*break*/, 2];
1203
+ return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
1204
+ case 1:
1205
+ bundleSettings = _a.sent();
1206
+ this.externalSettings = JSON.parse(bundleSettings);
1207
+ if (this.options) {
1208
+ this.externalSettings.options = this.options;
1209
+ }
1210
+ // this.externalSettings.assetPath = "https://cdn1.colijn-it.nl/content43";
1211
+ // this.externalSettings.threeDAssetPath = "https://cdn1.colijn-it.nl/content43";
1212
+ if (this.externalSource.username && this.externalSource.password) {
1213
+ this.externalSettings.useLoginEncryption = true;
1214
+ this.externalSettings.username = this.externalSource.username;
1215
+ this.externalSettings.password = this.externalSource.password;
1216
+ }
1217
+ // finally show the catalog
1218
+ this.showProduct = true;
1219
+ return [3 /*break*/, 3];
1220
+ case 2:
1221
+ this.externalUrl = this.externalSource.url;
1222
+ this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
1223
+ this.showProduct = false;
1224
+ _a.label = 3;
1225
+ case 3:
1226
+ this.loaded = true;
1227
+ return [2 /*return*/];
1228
+ }
1229
+ });
1230
+ });
1231
+ };
1232
+ ProductExternalSourceComponent.ctorParameters = function () { return [
1233
+ { type: platformBrowser.DomSanitizer },
1234
+ { type: ProductConnectorService },
1235
+ { type: ProductEventService }
1236
+ ]; };
1237
+ __decorate([
1238
+ core.Input()
1239
+ ], ProductExternalSourceComponent.prototype, "sku", void 0);
1240
+ __decorate([
1241
+ core.Input()
1242
+ ], ProductExternalSourceComponent.prototype, "externalSource", null);
1243
+ __decorate([
1244
+ core.Input()
1245
+ ], ProductExternalSourceComponent.prototype, "options", void 0);
1246
+ __decorate([
1247
+ core.Output()
1248
+ ], ProductExternalSourceComponent.prototype, "addToCart", void 0);
1249
+ __decorate([
1250
+ core.Output()
1251
+ ], ProductExternalSourceComponent.prototype, "addToQuote", void 0);
1252
+ __decorate([
1253
+ core.Output()
1254
+ ], ProductExternalSourceComponent.prototype, "alternativeClick", void 0);
1255
+ __decorate([
1256
+ core.HostBinding('class.co-product-external-source')
1257
+ ], ProductExternalSourceComponent.prototype, "showClass", null);
1258
+ ProductExternalSourceComponent = __decorate([
1259
+ core.Component({
1260
+ selector: 'co-product-external-source',
1261
+ template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"!showProduct\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n </ng-container>\n ",
1262
+ providers: [
1263
+ ProductEventService,
1264
+ ProductSettingsService,
1265
+ ProductConnectorAdapterService,
1266
+ ProductConnectorService
1267
+ ],
1268
+ encapsulation: core.ViewEncapsulation.None
1269
+ })
1270
+ ], ProductExternalSourceComponent);
1271
+ return ProductExternalSourceComponent;
1272
+ }());
1273
+
1274
+ var StockAndDelivery = /** @class */ (function () {
1275
+ function StockAndDelivery(stock, deliveryDescription) {
1276
+ this.stock = 0;
1277
+ this.stock = stock;
1278
+ this.deliveryDescription = deliveryDescription;
1279
+ }
1280
+ return StockAndDelivery;
1281
+ }());
1282
+
1283
+ var SelectorType;
1284
+ (function (SelectorType) {
1285
+ SelectorType["TwoD"] = "2D";
1286
+ SelectorType["ThreeD"] = "3D";
1287
+ SelectorType["Omni"] = "Omni";
1288
+ })(SelectorType || (SelectorType = {}));
1289
+
1290
+ /** AUTO GENERATED FILE. DO NOT CHANGE.. **/
994
1291
  var IconEnum;
995
1292
  (function (IconEnum) {
996
1293
  IconEnum["AddToCartDrop"] = "add_to_cart_drop";
@@ -1067,211 +1364,34 @@
1067
1364
  return IconCacheService;
1068
1365
  }());
1069
1366
 
1070
- var ImageCarouselComponent = /** @class */ (function () {
1071
- function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer, iconCache) {
1367
+ var ProductPageComponent = /** @class */ (function () {
1368
+ function ProductPageComponent(_ione, _renderer, _changeDetector, iconCache, settingsService, appEventService) {
1072
1369
  var _this = this;
1073
1370
  this._ione = _ione;
1074
- this._appEventService = _appEventService;
1371
+ this._renderer = _renderer;
1075
1372
  this._changeDetector = _changeDetector;
1076
- this._domSanitizer = _domSanitizer;
1077
1373
  this.iconCache = iconCache;
1078
- this.icons = IconEnum;
1079
- this.showLoader = false;
1080
- this.showRefresh = false;
1081
- this.resizing = false;
1082
- this._currentIndex = 0;
1083
- this._images = [];
1374
+ this.settingsService = settingsService;
1375
+ this.appEventService = appEventService;
1376
+ this.icon = IconEnum;
1377
+ this.configurable = false;
1378
+ this.threeD = false;
1379
+ this.show2D = true;
1380
+ this.show3D = false;
1381
+ this.configuring = false;
1382
+ this.fullscreenAnimationEnd = false;
1383
+ this.settingsLoaded = false;
1384
+ this._fullScreen = false;
1084
1385
  this._subs = [];
1085
- this._subs.push(this._appEventService.onRenderStarted.subscribe(function () {
1086
- _this.showLoader = true;
1087
- }), this._appEventService.onDraftRenderImageReceived.subscribe(function (url) {
1088
- if (_this._images[0] instanceof coDocument.CoDocument) {
1089
- _this._images.unshift(url);
1090
- }
1091
- else {
1092
- _this._images[0] = url;
1386
+ this._subs.push(this.appEventService.onForceRenderImage.subscribe(function (x) {
1387
+ if (_this.selections.nativeElement) {
1388
+ _this.selections.nativeElement.forceRenderImage();
1093
1389
  }
1094
- _this.showLoader = false;
1390
+ }), this.settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }), this._ione.controllerInitialized.subscribe(function (initialized) {
1391
+ _this.settingsLoaded = initialized;
1095
1392
  }));
1096
1393
  }
1097
- Object.defineProperty(ImageCarouselComponent.prototype, "images", {
1098
- get: function () {
1099
- return this._images;
1100
- },
1101
- set: function (value) {
1102
- if (value && value.length > 0) {
1103
- this._images = value;
1104
- this._loadImages();
1105
- this._changeDetector.detectChanges();
1106
- }
1107
- },
1108
- enumerable: true,
1109
- configurable: true
1110
- });
1111
- ImageCarouselComponent.prototype.handleWindowResize = function () {
1112
- var _this = this;
1113
- this.resizing = true;
1114
- this._scrollCarouselToIndex();
1115
- clearTimeout(this._resizeTimer);
1116
- this._resizeTimer = setTimeout(function () {
1117
- _this.resizing = false;
1118
- }, 200);
1119
- };
1120
- ImageCarouselComponent.prototype.gotoNextSlide = function () {
1121
- this.currentIndex++;
1122
- };
1123
- ImageCarouselComponent.prototype.gotoPrevSlide = function () {
1124
- this.currentIndex--;
1125
- };
1126
- ImageCarouselComponent.prototype.isCurrentIndex = function (index) {
1127
- return this.currentIndex === index;
1128
- };
1129
- Object.defineProperty(ImageCarouselComponent.prototype, "currentIndex", {
1130
- get: function () {
1131
- return this._currentIndex;
1132
- },
1133
- set: function (value) {
1134
- this._currentIndex = value;
1135
- this._scrollCarouselToIndex();
1136
- },
1137
- enumerable: true,
1138
- configurable: true
1139
- });
1140
- ImageCarouselComponent.prototype.ngOnInit = function () {
1141
- };
1142
- ImageCarouselComponent.prototype.ngOnDestroy = function () {
1143
- this.carousel = undefined;
1144
- this._subs.forEach(function (s) { return s.unsubscribe(); });
1145
- };
1146
- ImageCarouselComponent.prototype.handleThumbClick = function (index) {
1147
- this.currentIndex = index;
1148
- };
1149
- ImageCarouselComponent.prototype.onForceRenderImage = function () {
1150
- this._appEventService.onForceRenderImage.next();
1151
- };
1152
- ImageCarouselComponent.prototype.getImageSrc = function (image) {
1153
- var source = '';
1154
- if (image instanceof coDocument.CoDocument) {
1155
- if (image.filePath) {
1156
- source = image.filePath;
1157
- }
1158
- else {
1159
- source = image.documentBodyAsDataUri;
1160
- }
1161
- }
1162
- else if (image.detail !== undefined) {
1163
- source = image.detail;
1164
- }
1165
- return this._domSanitizer.bypassSecurityTrustUrl(source);
1166
- };
1167
- ImageCarouselComponent.prototype._loadImages = function () {
1168
- var _this = this;
1169
- if (this._images) {
1170
- this._images.forEach(function (i) {
1171
- if (!i.documentBody && !i.filePath) {
1172
- _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
1173
- if (content) {
1174
- i.documentBody = content.documentContent;
1175
- }
1176
- });
1177
- }
1178
- });
1179
- }
1180
- };
1181
- ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
1182
- if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
1183
- var movePx = this.currentIndex * this.carousel.nativeElement.clientWidth;
1184
- if (this.carousel && this.carousel.nativeElement) {
1185
- this.carousel.nativeElement.scrollLeft = movePx;
1186
- // this.carousel.nativeElement.scrollTo({
1187
- // left: movePx,
1188
- // behavior: 'smooth'
1189
- // });
1190
- }
1191
- }
1192
- };
1193
- ImageCarouselComponent.ctorParameters = function () { return [
1194
- { type: ProductConnectorService },
1195
- { type: ProductEventService },
1196
- { type: core.ChangeDetectorRef },
1197
- { type: platformBrowser.DomSanitizer },
1198
- { type: IconCacheService }
1199
- ]; };
1200
- __decorate([
1201
- core.ViewChild('carousel', { read: core.ElementRef })
1202
- ], ImageCarouselComponent.prototype, "carousel", void 0);
1203
- __decorate([
1204
- core.Input()
1205
- ], ImageCarouselComponent.prototype, "showRefresh", void 0);
1206
- __decorate([
1207
- core.Input()
1208
- ], ImageCarouselComponent.prototype, "images", null);
1209
- __decorate([
1210
- core.HostListener('window:resize')
1211
- ], ImageCarouselComponent.prototype, "handleWindowResize", null);
1212
- __decorate([
1213
- core.HostListener('swipeleft')
1214
- ], ImageCarouselComponent.prototype, "gotoNextSlide", null);
1215
- __decorate([
1216
- core.HostListener('swiperight')
1217
- ], ImageCarouselComponent.prototype, "gotoPrevSlide", null);
1218
- __decorate([
1219
- core.HostBinding('class.resizing')
1220
- ], ImageCarouselComponent.prototype, "resizing", void 0);
1221
- ImageCarouselComponent = __decorate([
1222
- core.Component({
1223
- selector: 'app-image-carousel',
1224
- template: "<div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"images[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\">\n <img [src]=\"getImageSrc(images[0])\">\n </div>\n <div *ngFor=\"let image of images.slice(1); let index = index\" class=\"carousel-item\" [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\">\n <img [src]=\"getImageSrc(image)\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"images && images.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"images && images.length > 1\">\n <div *ngFor=\"let image of images; let index = index\" class=\"carousel-thumb\" [class.active]=\"index === currentIndex\">\n <img [src]=\"getImageSrc(image)\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n</div>\n",
1225
- styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:.2s;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}@media screen and (max-width:650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1226
- })
1227
- ], ImageCarouselComponent);
1228
- return ImageCarouselComponent;
1229
- }());
1230
-
1231
- var StockAndDelivery = /** @class */ (function () {
1232
- function StockAndDelivery(stock, deliveryDescription) {
1233
- this.stock = 0;
1234
- this.stock = stock;
1235
- this.deliveryDescription = deliveryDescription;
1236
- }
1237
- return StockAndDelivery;
1238
- }());
1239
-
1240
- var SelectorType;
1241
- (function (SelectorType) {
1242
- SelectorType["TwoD"] = "2D";
1243
- SelectorType["ThreeD"] = "3D";
1244
- SelectorType["Omni"] = "Omni";
1245
- })(SelectorType || (SelectorType = {}));
1246
-
1247
- var ProductPageComponent = /** @class */ (function () {
1248
- function ProductPageComponent(_ione, _renderer, _changeDetector, iconCache, settingsService, appEventService) {
1249
- var _this = this;
1250
- this._ione = _ione;
1251
- this._renderer = _renderer;
1252
- this._changeDetector = _changeDetector;
1253
- this.iconCache = iconCache;
1254
- this.settingsService = settingsService;
1255
- this.appEventService = appEventService;
1256
- this.icon = IconEnum;
1257
- this.configurable = false;
1258
- this.threeD = false;
1259
- this.show2D = true;
1260
- this.show3D = false;
1261
- this.configuring = false;
1262
- this.fullscreenAnimationEnd = false;
1263
- this.settingsLoaded = false;
1264
- this._fullScreen = false;
1265
- this._subs = [];
1266
- this._subs.push(this.appEventService.onForceRenderImage.subscribe(function (x) {
1267
- if (_this.selections.nativeElement) {
1268
- _this.selections.nativeElement.forceRenderImage();
1269
- }
1270
- }), this.settingsService.settingsLoaded.subscribe(function (loaded) {
1271
- _this.settingsLoaded = loaded;
1272
- }));
1273
- }
1274
- Object.defineProperty(ProductPageComponent.prototype, "sku", {
1394
+ Object.defineProperty(ProductPageComponent.prototype, "sku", {
1275
1395
  get: function () {
1276
1396
  return this._sku;
1277
1397
  },
@@ -1290,6 +1410,23 @@
1290
1410
  enumerable: true,
1291
1411
  configurable: true
1292
1412
  });
1413
+ Object.defineProperty(ProductPageComponent.prototype, "settings", {
1414
+ get: function () {
1415
+ return this._settings;
1416
+ },
1417
+ set: function (value) {
1418
+ if (value) {
1419
+ if (typeof value === 'string') {
1420
+ this._settings = JSON.parse(value);
1421
+ }
1422
+ else {
1423
+ this._settings = value;
1424
+ }
1425
+ }
1426
+ },
1427
+ enumerable: true,
1428
+ configurable: true
1429
+ });
1293
1430
  Object.defineProperty(ProductPageComponent.prototype, "fullScreen", {
1294
1431
  get: function () {
1295
1432
  return this._fullScreen;
@@ -1326,6 +1463,13 @@
1326
1463
  configurable: true
1327
1464
  });
1328
1465
  ProductPageComponent.prototype.ngOnInit = function () {
1466
+ if (this._settings) {
1467
+ this.settingsService.settings = undefined;
1468
+ this.settingsService.createSettingsFromObject(this._settings);
1469
+ }
1470
+ else {
1471
+ this._settings = this.settingsService.settings;
1472
+ }
1329
1473
  };
1330
1474
  ProductPageComponent.prototype.ngAfterViewInit = function () {
1331
1475
  };
@@ -1350,6 +1494,11 @@
1350
1494
  ProductPageComponent.prototype.showFullScreen = function () {
1351
1495
  this.fullScreen = !this.fullScreen;
1352
1496
  };
1497
+ ProductPageComponent.prototype._handleSettingsLoaded = function (loaded) {
1498
+ if (loaded) {
1499
+ this._ione.initConnection();
1500
+ }
1501
+ };
1353
1502
  ProductPageComponent.prototype._getArticle = function () {
1354
1503
  return __awaiter(this, void 0, void 0, function () {
1355
1504
  var _this = this;
@@ -1363,18 +1512,20 @@
1363
1512
  if (init) {
1364
1513
  this._ione.getFullArticle(this._sku).then(function (article) {
1365
1514
  _this.article = article;
1366
- _this.configurable = _this.article.goodType === 'B';
1367
- if (_this.configurable) {
1368
- _this.currentView = SelectorType.TwoD;
1369
- }
1370
- _this.threeD = _this.article.is3D;
1371
- _this.selectorType = _this.article.selectorTypeCustomer;
1372
- _this._ione.getDeliveryPrognosis(_this.article.goodId).then(function (stockInfo) {
1373
- var stockAndDelivery = stockInfo;
1374
- _this.stockAndDelivery = new StockAndDelivery(0, stockAndDelivery.returnValue ? stockAndDelivery.returnValue : ' ');
1515
+ if (_this.article) {
1516
+ _this.configurable = _this.article.goodType === 'B';
1517
+ if (_this.configurable) {
1518
+ _this.currentView = SelectorType.TwoD;
1519
+ }
1520
+ _this.threeD = _this.article.is3D;
1521
+ _this.selectorType = _this.article.selectorTypeCustomer;
1522
+ _this._ione.getDeliveryPrognosis(_this.article.goodId).then(function (stockInfo) {
1523
+ var stockAndDelivery = stockInfo;
1524
+ _this.stockAndDelivery = new StockAndDelivery(0, stockAndDelivery.returnValue ? stockAndDelivery.returnValue : ' ');
1525
+ _this._changeDetector.detectChanges();
1526
+ });
1375
1527
  _this._changeDetector.detectChanges();
1376
- });
1377
- _this._changeDetector.detectChanges();
1528
+ }
1378
1529
  });
1379
1530
  }
1380
1531
  return [2 /*return*/];
@@ -1404,10 +1555,13 @@
1404
1555
  __decorate([
1405
1556
  core.Input()
1406
1557
  ], ProductPageComponent.prototype, "sku", null);
1558
+ __decorate([
1559
+ core.Input()
1560
+ ], ProductPageComponent.prototype, "settings", null);
1407
1561
  ProductPageComponent = __decorate([
1408
1562
  core.Component({
1409
1563
  selector: 'app-product-page',
1410
- template: "<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]=\"settingsService.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\" [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",
1564
+ 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\" [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",
1411
1565
  animations: [
1412
1566
  animations.trigger('toggleFullScreen', [
1413
1567
  animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
@@ -1446,203 +1600,231 @@
1446
1600
  return ProductPageComponent;
1447
1601
  }());
1448
1602
 
1449
- var ProductDocumentsComponent = /** @class */ (function () {
1450
- function ProductDocumentsComponent(iconCache) {
1451
- this.iconCache = iconCache;
1452
- this.icon = IconEnum;
1453
- this.showLabel = false;
1454
- this.documents = [];
1603
+ var ProductSelectorTypeComponent = /** @class */ (function () {
1604
+ function ProductSelectorTypeComponent(_iconCache, _changeDetector) {
1605
+ this._iconCache = _iconCache;
1606
+ this._changeDetector = _changeDetector;
1607
+ this.type = SelectorType;
1608
+ this.icons = IconEnum;
1609
+ this.onIconClick = new core.EventEmitter();
1610
+ this.currentTypeChange = new core.EventEmitter();
1611
+ this.twoDIcon = this._iconCache.getIcon(this.icons.TwoD);
1612
+ this.threeDIcon = this._iconCache.getIcon(this.icons.ThreeD);
1455
1613
  }
1456
- ProductDocumentsComponent.ctorParameters = function () { return [
1457
- { type: IconCacheService }
1614
+ ProductSelectorTypeComponent.prototype.ngOnInit = function () {
1615
+ };
1616
+ ProductSelectorTypeComponent.prototype.handleIconClick = function (type) {
1617
+ this.currentType = type;
1618
+ this.currentTypeChange.next(this.currentType);
1619
+ this.onIconClick.next(this.currentType);
1620
+ this._changeDetector.detectChanges();
1621
+ };
1622
+ ProductSelectorTypeComponent.ctorParameters = function () { return [
1623
+ { type: IconCacheService },
1624
+ { type: core.ChangeDetectorRef }
1458
1625
  ]; };
1459
1626
  __decorate([
1460
1627
  core.Input()
1461
- ], ProductDocumentsComponent.prototype, "showLabel", void 0);
1628
+ ], ProductSelectorTypeComponent.prototype, "show2D", void 0);
1462
1629
  __decorate([
1463
1630
  core.Input()
1464
- ], ProductDocumentsComponent.prototype, "documents", void 0);
1465
- ProductDocumentsComponent = __decorate([
1631
+ ], ProductSelectorTypeComponent.prototype, "show3D", void 0);
1632
+ __decorate([
1633
+ core.Input()
1634
+ ], ProductSelectorTypeComponent.prototype, "currentType", void 0);
1635
+ __decorate([
1636
+ core.Output()
1637
+ ], ProductSelectorTypeComponent.prototype, "onIconClick", void 0);
1638
+ __decorate([
1639
+ core.Output()
1640
+ ], ProductSelectorTypeComponent.prototype, "currentTypeChange", void 0);
1641
+ ProductSelectorTypeComponent = __decorate([
1466
1642
  core.Component({
1467
- selector: 'app-product-documents',
1468
- template: "<app-header *ngIf=\"showLabel\" [label]=\"'DOCUMENTS' | localize\" [amount]=\"documents?.length\"></app-header>\n<div *ngIf=\"documents && documents.length > 0\">\n <co-files-upload [documents]=\"documents\" [canAdd]=\"false\" readonly></co-files-upload>\n</div>\n",
1469
- styles: [":host{display:block}::ng-deep co-files-upload{flex-direction:column!important;width:100%}::ng-deep co-file-upload{margin:0!important;border-bottom:1px solid #f6f5f4}::ng-deep co-file-upload:first-child{border-top:1px solid #f6f5f4}::ng-deep co-files-upload .files-upload-wrapper{flex-direction:column!important;width:100%}::ng-deep co-file-upload co-tile{max-width:100%!important;width:100%;position:relative}::ng-deep co-file-upload co-tile:hover{box-shadow:none!important}::ng-deep co-file-upload co-tile:hover .tile-extra-bottom{background-color:#f6f5f4!important}::ng-deep co-file-upload co-tile .tile-wrapper{position:absolute!important;left:0;top:0;width:100%;height:100%;z-index:2;opacity:0;box-sizing:border-box}::ng-deep co-file-upload co-tile .tile-wrapper .image{position:absolute!important;left:0;top:0;width:100%!important;height:100%!important;cursor:pointer}::ng-deep co-file-upload co-tile .tile-extra-bottom{outline:0!important;border:none!important;background:url(../../../assets/icons/download.svg) left 6px center/36px auto no-repeat!important;line-height:20px;padding:20px 20px 20px 60px!important;margin:0!important}::ng-deep co-file-upload co-tile .tile-extra-bottom .main{padding:0!important}"]
1643
+ selector: 'app-product-selector-type',
1644
+ template: "<div *ngIf=\"show2D || show3D\" class=\"show-in\" [textContent]=\"'SHOW_IN' | localize\"></div>\n<co-icon *ngIf=\"show2D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.TwoD\"\n [iconData]=\"twoDIcon\"\n (click)=\"handleIconClick(type.TwoD)\"\n></co-icon>\n<co-icon *ngIf=\"show3D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.ThreeD\"\n [iconData]=\"threeDIcon\"\n (click)=\"handleIconClick(type.ThreeD)\"\n></co-icon>\n",
1645
+ styles: [":host{display:flex;flex-direction:row;align-items:center}:host .show-in{display:none}:host>:not(:last-child){margin-right:10px}::ng-deep co-icon.selector-type-icon{box-shadow:inset 0 0 0 1px #22313c;border-radius:50%;background:0 0;height:34px;width:34px;cursor:pointer}::ng-deep co-icon.selector-type-icon.active{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}::ng-deep co-icon.selector-type-icon.active [fill]{fill:#fff}"]
1470
1646
  })
1471
- ], ProductDocumentsComponent);
1472
- return ProductDocumentsComponent;
1647
+ ], ProductSelectorTypeComponent);
1648
+ return ProductSelectorTypeComponent;
1473
1649
  }());
1474
1650
 
1475
- var ProductRelatedComponent = /** @class */ (function () {
1476
- function ProductRelatedComponent(_iOne, _appEventService) {
1477
- this._iOne = _iOne;
1478
- this._appEventService = _appEventService;
1479
- this.isSmallModus = true;
1480
- this._articles = [];
1651
+ var ImageCarouselComponent = /** @class */ (function () {
1652
+ function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer, iconCache) {
1653
+ var _this = this;
1654
+ this._ione = _ione;
1655
+ this._appEventService = _appEventService;
1656
+ this._changeDetector = _changeDetector;
1657
+ this._domSanitizer = _domSanitizer;
1658
+ this.iconCache = iconCache;
1659
+ this.icons = IconEnum;
1660
+ this.showLoader = false;
1661
+ this.showRefresh = false;
1662
+ this.resizing = false;
1663
+ this._currentIndex = 0;
1664
+ this._images = [];
1665
+ this._subs = [];
1666
+ this._subs.push(this._appEventService.onRenderStarted.subscribe(function () {
1667
+ _this.showLoader = true;
1668
+ }), this._appEventService.onDraftRenderImageReceived.subscribe(function (url) {
1669
+ if (_this._images[0] instanceof coDocument.CoDocument) {
1670
+ _this._images.unshift(url);
1671
+ }
1672
+ else {
1673
+ _this._images[0] = url;
1674
+ }
1675
+ _this.showLoader = false;
1676
+ }));
1481
1677
  }
1482
- Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
1678
+ Object.defineProperty(ImageCarouselComponent.prototype, "images", {
1483
1679
  get: function () {
1484
- return this._articles;
1680
+ return this._images;
1485
1681
  },
1486
1682
  set: function (value) {
1487
- var _this = this;
1488
- if (value) {
1489
- if (this.refType && this.refType !== undefined) {
1490
- if (value.length > 0) {
1491
- value.forEach(function (x) {
1492
- if (x.refType === _this.refType) {
1493
- _this._articles.push(x);
1494
- }
1495
- });
1496
- }
1497
- }
1498
- else {
1499
- this._articles = value;
1500
- }
1683
+ if (value && value.length > 0) {
1684
+ this._images = value;
1501
1685
  this._loadImages();
1686
+ this._changeDetector.detectChanges();
1502
1687
  }
1503
1688
  },
1504
1689
  enumerable: true,
1505
1690
  configurable: true
1506
1691
  });
1507
- ProductRelatedComponent.prototype.handleContentClick = function (article) {
1508
- this._appEventService.onAlternativeClick.next(article);
1692
+ ImageCarouselComponent.prototype.handleWindowResize = function () {
1693
+ var _this = this;
1694
+ this.resizing = true;
1695
+ this._scrollCarouselToIndex();
1696
+ clearTimeout(this._resizeTimer);
1697
+ this._resizeTimer = setTimeout(function () {
1698
+ _this.resizing = false;
1699
+ }, 200);
1509
1700
  };
1510
- ProductRelatedComponent.prototype._loadImages = function () {
1701
+ ImageCarouselComponent.prototype.gotoNextSlide = function () {
1702
+ this.currentIndex++;
1703
+ };
1704
+ ImageCarouselComponent.prototype.gotoPrevSlide = function () {
1705
+ this.currentIndex--;
1706
+ };
1707
+ ImageCarouselComponent.prototype.isCurrentIndex = function (index) {
1708
+ return this.currentIndex === index;
1709
+ };
1710
+ Object.defineProperty(ImageCarouselComponent.prototype, "currentIndex", {
1711
+ get: function () {
1712
+ return this._currentIndex;
1713
+ },
1714
+ set: function (value) {
1715
+ this._currentIndex = value;
1716
+ this._scrollCarouselToIndex();
1717
+ },
1718
+ enumerable: true,
1719
+ configurable: true
1720
+ });
1721
+ ImageCarouselComponent.prototype.ngOnInit = function () {
1722
+ };
1723
+ ImageCarouselComponent.prototype.ngOnDestroy = function () {
1724
+ this.carousel = undefined;
1725
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
1726
+ };
1727
+ ImageCarouselComponent.prototype.handleThumbClick = function (index) {
1728
+ this.currentIndex = index;
1729
+ };
1730
+ ImageCarouselComponent.prototype.onForceRenderImage = function () {
1731
+ this._appEventService.onForceRenderImage.next();
1732
+ };
1733
+ ImageCarouselComponent.prototype.getImageSrc = function (image) {
1734
+ var source = '';
1735
+ if (image instanceof coDocument.CoDocument) {
1736
+ if (image.filePath) {
1737
+ source = image.filePath;
1738
+ }
1739
+ else {
1740
+ source = image.documentBodyAsDataUri;
1741
+ }
1742
+ }
1743
+ else if (image.detail !== undefined) {
1744
+ source = image.detail;
1745
+ }
1746
+ return this._domSanitizer.bypassSecurityTrustUrl(source);
1747
+ };
1748
+ ImageCarouselComponent.prototype._loadImages = function () {
1511
1749
  var _this = this;
1512
- this._articles.forEach(function (a) {
1513
- if (!a.image.documentBody) {
1514
- _this._iOne.getDocumentContent(a.image.documentId).then(function (content) {
1515
- if (content) {
1516
- a.image.documentBody = content.documentContent;
1517
- }
1518
- });
1750
+ if (this._images) {
1751
+ this._images.forEach(function (i) {
1752
+ if (!i.documentBody && !i.filePath) {
1753
+ _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
1754
+ if (content) {
1755
+ i.documentBody = content.documentContent;
1756
+ }
1757
+ });
1758
+ }
1759
+ });
1760
+ }
1761
+ };
1762
+ ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
1763
+ if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
1764
+ var movePx = this.currentIndex * this.carousel.nativeElement.clientWidth;
1765
+ if (this.carousel && this.carousel.nativeElement) {
1766
+ this.carousel.nativeElement.scrollLeft = movePx;
1767
+ // this.carousel.nativeElement.scrollTo({
1768
+ // left: movePx,
1769
+ // behavior: 'smooth'
1770
+ // });
1519
1771
  }
1520
- });
1772
+ }
1521
1773
  };
1522
- ProductRelatedComponent.ctorParameters = function () { return [
1774
+ ImageCarouselComponent.ctorParameters = function () { return [
1523
1775
  { type: ProductConnectorService },
1524
- { type: ProductEventService }
1776
+ { type: ProductEventService },
1777
+ { type: core.ChangeDetectorRef },
1778
+ { type: platformBrowser.DomSanitizer },
1779
+ { type: IconCacheService }
1525
1780
  ]; };
1526
1781
  __decorate([
1527
- core.Input()
1528
- ], ProductRelatedComponent.prototype, "refType", void 0);
1782
+ core.ViewChild('carousel', { read: core.ElementRef })
1783
+ ], ImageCarouselComponent.prototype, "carousel", void 0);
1529
1784
  __decorate([
1530
1785
  core.Input()
1531
- ], ProductRelatedComponent.prototype, "label", void 0);
1786
+ ], ImageCarouselComponent.prototype, "showRefresh", void 0);
1532
1787
  __decorate([
1533
1788
  core.Input()
1534
- ], ProductRelatedComponent.prototype, "isSmallModus", void 0);
1789
+ ], ImageCarouselComponent.prototype, "images", null);
1535
1790
  __decorate([
1536
- core.Input()
1537
- ], ProductRelatedComponent.prototype, "articles", null);
1538
- ProductRelatedComponent = __decorate([
1539
- core.Component({
1540
- selector: 'app-product-related',
1541
- template: "<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]=\"article.image.documentBodyAsDataUri\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n</div>\n",
1542
- styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row}.article-wrapper ::ng-deep co-tile.small{min-width:189px;max-width:189px;height:100%}.article-wrapper ::ng-deep co-tile.small:hover{box-shadow:none;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:0!important;padding-bottom:0;overflow:hidden}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons{position:absolute;top:0;right:0;margin:0 -32px 0 0;align-items:flex-end;transition:.2s ease-in-out}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini{width:30px;height:30px;transform:none;border-radius:4px;margin:0 0 5px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::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:0!important;background:0 0!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}"]
1543
- })
1544
- ], ProductRelatedComponent);
1545
- return ProductRelatedComponent;
1546
- }());
1547
-
1548
- var HeaderComponent = /** @class */ (function () {
1549
- function HeaderComponent() {
1550
- }
1551
- HeaderComponent.prototype.ngOnInit = function () {
1552
- };
1791
+ core.HostListener('window:resize')
1792
+ ], ImageCarouselComponent.prototype, "handleWindowResize", null);
1553
1793
  __decorate([
1554
- core.Input()
1555
- ], HeaderComponent.prototype, "label", void 0);
1794
+ core.HostListener('swipeleft')
1795
+ ], ImageCarouselComponent.prototype, "gotoNextSlide", null);
1556
1796
  __decorate([
1557
- core.Input()
1558
- ], HeaderComponent.prototype, "amount", void 0);
1559
- HeaderComponent = __decorate([
1797
+ core.HostListener('swiperight')
1798
+ ], ImageCarouselComponent.prototype, "gotoPrevSlide", null);
1799
+ __decorate([
1800
+ core.HostBinding('class.resizing')
1801
+ ], ImageCarouselComponent.prototype, "resizing", void 0);
1802
+ ImageCarouselComponent = __decorate([
1560
1803
  core.Component({
1561
- selector: 'app-header',
1562
- template: "<ng-container *ngIf=\"label\">\n <div class=\"header-wrapper\">\n <h3 [textContent]=\"label\"></h3>\n <span *ngIf=\"amount\" class=\"amount\" [textContent]=\"'(' + amount + ')'\"></span>\n </div>\n</ng-container>\n",
1563
- styles: [".header-wrapper{display:flex;flex-direction:row;align-items:center}.header-wrapper .amount{margin-left:5px}"]
1804
+ selector: 'app-image-carousel',
1805
+ template: "<div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"images[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\">\n <img [src]=\"getImageSrc(images[0])\">\n </div>\n <div *ngFor=\"let image of images.slice(1); let index = index\" class=\"carousel-item\" [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\">\n <img [src]=\"getImageSrc(image)\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"images && images.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"images && images.length > 1\">\n <div *ngFor=\"let image of images; let index = index\" class=\"carousel-thumb\" [class.active]=\"index === currentIndex\">\n <img [src]=\"getImageSrc(image)\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n</div>\n",
1806
+ styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:.2s;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}@media screen and (max-width:650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1564
1807
  })
1565
- ], HeaderComponent);
1566
- return HeaderComponent;
1808
+ ], ImageCarouselComponent);
1809
+ return ImageCarouselComponent;
1567
1810
  }());
1568
1811
 
1569
- var TabType;
1570
- (function (TabType) {
1571
- TabType["Additional"] = "additional";
1572
- TabType["Properties"] = "properties";
1573
- })(TabType || (TabType = {}));
1574
- var ProductInfoComponent = /** @class */ (function () {
1575
- function ProductInfoComponent() {
1576
- this.tabType = TabType;
1577
- this.currentTab = TabType.Additional;
1812
+ var ProductDescriptionComponent = /** @class */ (function () {
1813
+ function ProductDescriptionComponent() {
1578
1814
  }
1579
- ProductInfoComponent.prototype.ngOnInit = function () {
1580
- };
1581
- ProductInfoComponent.prototype.switchTab = function (tab) {
1582
- this.currentTab = tab;
1815
+ ProductDescriptionComponent.prototype.ngOnInit = function () {
1583
1816
  };
1584
1817
  __decorate([
1585
1818
  core.Input()
1586
- ], ProductInfoComponent.prototype, "article", void 0);
1587
- ProductInfoComponent = __decorate([
1819
+ ], ProductDescriptionComponent.prototype, "article", void 0);
1820
+ ProductDescriptionComponent = __decorate([
1588
1821
  core.Component({
1589
- selector: 'app-product-info',
1590
- template: "<div>\n <div class=\"info-wrapper\">\n <div class=\"info-navigation\">\n <span [textContent]=\"'ADDITIONAL_DATA' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Additional\" (mouseup)=\"switchTab(tabType.Additional)\"></span>\n <span [textContent]=\"'PROPERTIES' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Properties\" (mouseup)=\"switchTab(tabType.Properties)\"></span>\n </div>\n <ng-container [ngSwitch]=\"currentTab\" class=\"content\">\n <div *ngSwitchCase=\"tabType.Additional\" @showContent>\n <app-product-additional-info\n [article]=\"article\"\n ></app-product-additional-info>\n </div>\n <div *ngSwitchCase=\"tabType.Properties\" @showContent>\n <app-product-properties [article]=\"article\"></app-product-properties>\n </div>\n </ng-container>\n </div>\n</div>\n",
1591
- animations: [
1592
- animations.trigger('showContent', [
1593
- animations.state('void', animations.style({ 'opacity': '0' })),
1594
- animations.state('*', animations.style({ 'opacity': '1' })),
1595
- animations.transition('void => *', animations.animate('200ms 100ms ease-in-out')),
1596
- ])
1597
- ],
1598
- styles: [".info-navigation{margin:30px 0}.info-navigation .navigator:not(:last-child){margin-right:30px}.navigator{font-size:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.navigator.selected{color:#2b60a7}"]
1599
- })
1600
- ], ProductInfoComponent);
1601
- return ProductInfoComponent;
1602
- }());
1603
-
1604
- var ProductModuleService = /** @class */ (function () {
1605
- function ProductModuleService(_iOneConnectorService) {
1606
- this._iOneConnectorService = _iOneConnectorService;
1607
- this._superArticles = new Map();
1608
- }
1609
- ProductModuleService.prototype.getArticle = function (id) {
1610
- return __awaiter(this, void 0, void 0, function () {
1611
- return __generator(this, function (_a) {
1612
- switch (_a.label) {
1613
- case 0: return [4 /*yield*/, this._getArticle(id)];
1614
- case 1: return [2 /*return*/, _a.sent()];
1615
- }
1616
- });
1617
- });
1618
- };
1619
- ProductModuleService.prototype._getArticle = function (id) {
1620
- return __awaiter(this, void 0, void 0, function () {
1621
- var mainArticle;
1622
- return __generator(this, function (_a) {
1623
- switch (_a.label) {
1624
- case 0:
1625
- if (!this._superArticles.has(id)) return [3 /*break*/, 1];
1626
- return [2 /*return*/, this._superArticles.get(id)];
1627
- case 1: return [4 /*yield*/, this._iOneConnectorService.getSuperArticle(id)];
1628
- case 2:
1629
- mainArticle = _a.sent();
1630
- this._superArticles.set(id, mainArticle);
1631
- return [2 /*return*/, mainArticle];
1632
- }
1633
- });
1634
- });
1635
- };
1636
- ProductModuleService.ctorParameters = function () { return [
1637
- { type: ProductConnectorService }
1638
- ]; };
1639
- ProductModuleService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductModuleService_Factory() { return new ProductModuleService(core.ɵɵinject(ProductConnectorService)); }, token: ProductModuleService, providedIn: "root" });
1640
- ProductModuleService = __decorate([
1641
- core.Injectable({
1642
- providedIn: 'root'
1822
+ selector: 'app-product-description',
1823
+ template: "<div class=\"pd-title-wrapper\">\n <span class=\"pd-description\" [textContent]=\"article?.descriptionRetail\" *ngIf=\"article?.descriptionRetail\"></span>\n <span class=\"pd-sku\" [textContent]=\"article?.articleNr\" *ngIf=\"article?.articleNr\"></span>\n</div>\n",
1824
+ styles: [":host{display:block}.pd-title-wrapper{margin:20px 0 0}.pd-description{color:#22313c;font-size:25px;font-weight:700;width:100%;display:block}.pd-sku{color:#5b6875;font-size:16px}@media screen and (max-width:650px){.pd-description{font-size:21px}.pd-sku{font-size:13px}}"]
1643
1825
  })
1644
- ], ProductModuleService);
1645
- return ProductModuleService;
1826
+ ], ProductDescriptionComponent);
1827
+ return ProductDescriptionComponent;
1646
1828
  }());
1647
1829
 
1648
1830
  var BitUtils = /** @class */ (function () {
@@ -1666,248 +1848,326 @@
1666
1848
  return BitUtils;
1667
1849
  }());
1668
1850
 
1669
- var ProductAdditionalInfoComponent = /** @class */ (function () {
1670
- function ProductAdditionalInfoComponent(_sanitizer, _moduleService, _changeDetector) {
1671
- this._sanitizer = _sanitizer;
1672
- this._moduleService = _moduleService;
1673
- this._changeDetector = _changeDetector;
1674
- this.showLabel = false;
1675
- this.textParts = [];
1851
+ var ProductAdditionalDescriptionComponent = /** @class */ (function () {
1852
+ function ProductAdditionalDescriptionComponent(_appEventService) {
1853
+ this._appEventService = _appEventService;
1676
1854
  }
1677
- Object.defineProperty(ProductAdditionalInfoComponent.prototype, "article", {
1855
+ Object.defineProperty(ProductAdditionalDescriptionComponent.prototype, "article", {
1678
1856
  get: function () {
1679
1857
  return this._article;
1680
1858
  },
1681
1859
  set: function (value) {
1682
- var _this = this;
1683
- if (value) {
1684
- this._article = value;
1685
- this._buildInfo().then(function () {
1686
- _this._changeDetector.detectChanges();
1687
- });
1860
+ this._article = value;
1861
+ if (this._article) {
1862
+ this.description = this.article.additionalDescription;
1863
+ this._prepareDescription();
1688
1864
  }
1689
1865
  },
1690
1866
  enumerable: true,
1691
1867
  configurable: true
1692
1868
  });
1693
- ProductAdditionalInfoComponent.prototype.ngOnInit = function () {
1869
+ ProductAdditionalDescriptionComponent.prototype.ngOnInit = function () {
1694
1870
  };
1695
- ProductAdditionalInfoComponent.prototype._getTextsSuperArticle = function () {
1871
+ ProductAdditionalDescriptionComponent.prototype.onReadMore = function () {
1872
+ this._appEventService.onUpdateProductInfoTab.next(0);
1873
+ };
1874
+ ProductAdditionalDescriptionComponent.prototype._prepareDescription = function () {
1696
1875
  var _this = this;
1697
- return new Promise(function (resolve, reject) {
1698
- var texts = [];
1699
- if (_this.article.superArticleNr) {
1700
- _this._moduleService.getArticle(_this.article.superArticleNr).then(function (mainArticle) {
1701
- mainArticle.texts.forEach(function (txt) {
1702
- if (BitUtils.IsFullDescription(txt.publication)) {
1703
- var safeTxt = _this._sanitizer.sanitize(core.SecurityContext.HTML, txt.text);
1704
- texts.push(safeTxt);
1705
- }
1706
- });
1707
- resolve(texts);
1708
- }).catch(function () {
1709
- resolve([]);
1710
- });
1876
+ this.description = '';
1877
+ if (this.article.texts && this.article.texts.length > 0) {
1878
+ this.article.texts.forEach(function (txt) {
1879
+ if (BitUtils.IsShortDescription(txt.publication)) {
1880
+ _this.description += txt.text;
1881
+ }
1882
+ });
1883
+ this.description = this.description.replace(/<[^>]*>?/gm, '');
1884
+ if (this.description.length > 250) {
1885
+ this.description = this.description.substr(0, 250) + ' [..]';
1886
+ }
1887
+ }
1888
+ };
1889
+ ProductAdditionalDescriptionComponent.ctorParameters = function () { return [
1890
+ { type: ProductEventService }
1891
+ ]; };
1892
+ __decorate([
1893
+ core.Input()
1894
+ ], ProductAdditionalDescriptionComponent.prototype, "article", null);
1895
+ ProductAdditionalDescriptionComponent = __decorate([
1896
+ core.Component({
1897
+ selector: 'app-product-additional-description',
1898
+ template: "<ng-container *ngIf=\"description !== ''\">\n <div class=\"pd-additional-description\">\n <p [innerHTML]=\"description\"></p>\n <button class=\"pd-read-more-btn\" [textContent]=\"'READ_MORE' | localize\" (click)=\"onReadMore()\"></button>\n </div>\n</ng-container>\n",
1899
+ styles: [":host{display:block;padding-top:0!important}:host :focus{outline:0!important}:host .pd-additional-description{line-height:190%;color:#22313c;font-size:13px}:host .pd-read-more-btn{color:#2b60a7;border:none;background:0 0;cursor:pointer;text-decoration:underline;font-family:iOneMontserrat}:host .pd-read-more-btn:hover{color:#74b77f}@media screen and (max-width:650px){:host .pd-additional-description{font-size:12px}}"]
1900
+ })
1901
+ ], ProductAdditionalDescriptionComponent);
1902
+ return ProductAdditionalDescriptionComponent;
1903
+ }());
1904
+
1905
+ var ProductPriceComponent = /** @class */ (function () {
1906
+ function ProductPriceComponent(_changeDetector) {
1907
+ this._changeDetector = _changeDetector;
1908
+ this.showFromPrice = false;
1909
+ this._configurable = false;
1910
+ }
1911
+ Object.defineProperty(ProductPriceComponent.prototype, "pricing", {
1912
+ get: function () {
1913
+ return this._pricing;
1914
+ },
1915
+ set: function (value) {
1916
+ this._pricing = value;
1917
+ this._setPrices();
1918
+ },
1919
+ enumerable: true,
1920
+ configurable: true
1921
+ });
1922
+ Object.defineProperty(ProductPriceComponent.prototype, "configurable", {
1923
+ set: function (value) {
1924
+ this._configurable = value;
1925
+ this._setPrices();
1926
+ },
1927
+ enumerable: true,
1928
+ configurable: true
1929
+ });
1930
+ ProductPriceComponent.prototype.ngOnInit = function () {
1931
+ };
1932
+ ProductPriceComponent.prototype._setPrices = function () {
1933
+ if (this._pricing) {
1934
+ this.valutaSign = this._getSign(this._pricing.retailCurrency);
1935
+ if (this._configurable) {
1936
+ this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
1937
+ this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
1938
+ this.toPrice = undefined;
1711
1939
  }
1712
1940
  else {
1713
- resolve(texts);
1941
+ this.fromPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
1942
+ this.fromLabel = this._pricing.retailSuggestedPrice ? 'Was' : 'PRICE';
1943
+ this.toPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailBasePrice : undefined;
1944
+ this.toLabel = this._pricing.retailSuggestedPrice ? 'IS_NOW' : '';
1714
1945
  }
1715
- });
1946
+ this._changeDetector.detectChanges();
1947
+ }
1716
1948
  };
1717
- ProductAdditionalInfoComponent.prototype._prepareArticleTexts = function () {
1949
+ ProductPriceComponent.prototype._getSign = function (currency) {
1950
+ switch (currency) {
1951
+ case 'EUR':
1952
+ return '€';
1953
+ default:
1954
+ return '€';
1955
+ }
1956
+ };
1957
+ ProductPriceComponent.ctorParameters = function () { return [
1958
+ { type: core.ChangeDetectorRef }
1959
+ ]; };
1960
+ __decorate([
1961
+ core.Input()
1962
+ ], ProductPriceComponent.prototype, "pricing", null);
1963
+ __decorate([
1964
+ core.Input()
1965
+ ], ProductPriceComponent.prototype, "configurable", null);
1966
+ ProductPriceComponent = __decorate([
1967
+ core.Component({
1968
+ selector: 'app-product-price',
1969
+ template: "<div *ngIf=\"toPrice\">\n <div class=\"price-wrapper\" *ngIf=\"fromPrice > toPrice\">\n <div class=\"from-price-label\" [textContent]=\"fromLabel | localize\"></div>\n <div class=\"from-price\" [textContent]=\"fromPrice | priceDisplay\"></div>\n </div>\n <div class=\"price-wrapper\">\n <div class=\"to-price-label\" [textContent]=\"toLabel | localize\"></div>\n <div class=\"to-price\" [textContent]=\"toPrice | priceDisplay\"></div>\n </div>\n</div>\n",
1970
+ styles: [":host{display:flex;flex-direction:column}.price-wrapper{width:100%;font-size:15px;margin:0 0 5px;display:inline-block}.price-wrapper:last-child{margin:0}.from-price-label,.to-price-label{color:#5b6875;display:none}.from-price{font-size:16px;font-weight:700;text-decoration:line-through;color:#5b6875}.to-price{font-size:25px;font-weight:700;color:#74b77f}@media screen and (max-width:650px){.from-price{font-size:13px}.to-price{font-size:21px}}"]
1971
+ })
1972
+ ], ProductPriceComponent);
1973
+ return ProductPriceComponent;
1974
+ }());
1975
+
1976
+ var ProductAddtocartComponent = /** @class */ (function () {
1977
+ function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
1978
+ this.iconCache = iconCache;
1979
+ this._ioneControllerService = _ioneControllerService;
1980
+ this._appEventService = _appEventService;
1981
+ this._settingsService = _settingsService;
1982
+ this.icon = IconEnum;
1983
+ this.configurable = false;
1984
+ this.configuring = false;
1985
+ this.fullscreen = false;
1986
+ this.startConfiguration = new core.EventEmitter();
1987
+ this.addToCartClick = new core.EventEmitter();
1988
+ this.addToQuoteClick = new core.EventEmitter();
1989
+ this.showQuoteButton = false;
1990
+ this._quantity = 1;
1991
+ }
1992
+ Object.defineProperty(ProductAddtocartComponent.prototype, "quantity", {
1993
+ get: function () {
1994
+ return this._quantity;
1995
+ },
1996
+ set: function (value) {
1997
+ this._quantity = Math.max(1, value);
1998
+ },
1999
+ enumerable: true,
2000
+ configurable: true
2001
+ });
2002
+ ProductAddtocartComponent.prototype.ngOnInit = function () {
2003
+ };
2004
+ ProductAddtocartComponent.prototype.ngOnDestroy = function () {
2005
+ this.addToCartButton = undefined;
2006
+ };
2007
+ ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
1718
2008
  return __awaiter(this, void 0, void 0, function () {
1719
- var texts;
1720
- var _a;
1721
- var _this = this;
1722
- return __generator(this, function (_b) {
1723
- switch (_b.label) {
1724
- case 0: return [4 /*yield*/, this._getTextsSuperArticle()];
2009
+ var _a, _b;
2010
+ return __generator(this, function (_c) {
2011
+ switch (_c.label) {
2012
+ case 0:
2013
+ _b = (_a = this._appEventService.onAddToCart).next;
2014
+ return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
1725
2015
  case 1:
1726
- texts = _b.sent();
1727
- if (texts.length > 0) {
1728
- (_a = this.textParts).push.apply(_a, __spread(texts));
1729
- }
1730
- if (this.article.texts) {
1731
- this.article.texts.forEach(function (txt) {
1732
- if (BitUtils.IsFullDescription(txt.publication)) {
1733
- var safeTxt = _this._sanitizer.sanitize(core.SecurityContext.HTML, txt.text);
1734
- _this.textParts.push(safeTxt);
1735
- }
1736
- });
1737
- }
2016
+ _b.apply(_a, [_c.sent()]);
2017
+ return [2 /*return*/];
2018
+ }
2019
+ });
2020
+ });
2021
+ };
2022
+ ProductAddtocartComponent.prototype.handleAddToQuoteClick = function (quantity) {
2023
+ return __awaiter(this, void 0, void 0, function () {
2024
+ var _a, _b;
2025
+ return __generator(this, function (_c) {
2026
+ switch (_c.label) {
2027
+ case 0:
2028
+ _b = (_a = this._appEventService.onAddToQuote).next;
2029
+ return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2030
+ case 1:
2031
+ _b.apply(_a, [_c.sent()]);
1738
2032
  return [2 /*return*/];
1739
2033
  }
1740
2034
  });
1741
2035
  });
1742
2036
  };
1743
- ProductAdditionalInfoComponent.prototype._buildInfo = function () {
2037
+ ProductAddtocartComponent.prototype._getJSONFromArticleObject = function (article) {
1744
2038
  return __awaiter(this, void 0, void 0, function () {
2039
+ var configuratorStatistics;
1745
2040
  return __generator(this, function (_a) {
1746
2041
  switch (_a.label) {
1747
2042
  case 0:
1748
- this.textParts.length = 0;
1749
- return [4 /*yield*/, this._prepareArticleTexts()];
1750
- case 1:
1751
- _a.sent();
1752
- if (this.textParts.length === 0) {
1753
- if (this.article.additionalDescription) {
1754
- this.textParts.push(this.article.additionalDescription);
1755
- }
1756
- else if (this.article.description) {
1757
- this.textParts.push(this.article.description);
1758
- }
1759
- }
1760
- return [2 /*return*/];
2043
+ configuratorStatistics = new configuratorStatisticsEnvironment.ConfiguratorStatisticsEnvironment();
2044
+ configuratorStatistics.userType = 'iOneProductPage';
2045
+ configuratorStatistics.transactionType = 'Sales';
2046
+ configuratorStatistics.actionDomain = 'bundle';
2047
+ configuratorStatistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
2048
+ configuratorStatistics.webHost = window.location.host;
2049
+ configuratorStatistics.bundleHost = window.location.host;
2050
+ return [4 /*yield*/, this._ioneControllerService.getJsonArticleFlatTree(article.article.goodId, article.article.goodType, article.quantity, true, configuratorStatistics)];
2051
+ case 1: return [2 /*return*/, _a.sent()];
1761
2052
  }
1762
2053
  });
1763
2054
  });
1764
2055
  };
1765
- ProductAdditionalInfoComponent.ctorParameters = function () { return [
1766
- { type: platformBrowser.DomSanitizer },
1767
- { type: ProductModuleService },
1768
- { type: core.ChangeDetectorRef }
2056
+ ProductAddtocartComponent.ctorParameters = function () { return [
2057
+ { type: IconCacheService },
2058
+ { type: ProductConnectorService },
2059
+ { type: ProductEventService },
2060
+ { type: ProductSettingsService }
1769
2061
  ]; };
2062
+ __decorate([
2063
+ core.ViewChild('addtocartbutton', { read: core.ElementRef })
2064
+ ], ProductAddtocartComponent.prototype, "addToCartButton", void 0);
1770
2065
  __decorate([
1771
2066
  core.Input()
1772
- ], ProductAdditionalInfoComponent.prototype, "article", null);
2067
+ ], ProductAddtocartComponent.prototype, "article", void 0);
1773
2068
  __decorate([
1774
2069
  core.Input()
1775
- ], ProductAdditionalInfoComponent.prototype, "showLabel", void 0);
1776
- ProductAdditionalInfoComponent = __decorate([
1777
- core.Component({
1778
- selector: 'app-product-additional-info',
1779
- template: "<h3 *ngIf=\"showLabel\" [textContent]=\"'ADDITIONAL_DATA' | localize\"></h3>\n<ng-container *ngIf=\"textParts && textParts.length > 0\">\n <div class=\"additional-info-parts\" *ngFor=\"let text of textParts\" [innerHTML]=\"text\"></div>\n</ng-container>\n",
1780
- styles: [":host{display:block}:host .additional-info-parts{margin-bottom:20px;line-height:190%;color:#22313c;font-size:13px}:host ::ng-deep p{line-height:190%;margin:15px 0}:host ::ng-deep font{font-family:iOneMontserrat}:host .additional-info-parts>:first-child{margin-top:0}:host .additional-info-parts>:last-child{margin-bottom:0}"]
1781
- })
1782
- ], ProductAdditionalInfoComponent);
1783
- return ProductAdditionalInfoComponent;
1784
- }());
1785
-
1786
- var propertyMap = new Map([
1787
- ['articleNr', 'ARTICLE_NUMBER'],
1788
- ['catExtra', 'CATEGORY'],
1789
- ['catType', 'CATEGORY_TYPE'],
1790
- ['description', 'DESCRIPTION'],
1791
- ['material', 'MATERIAL'],
1792
- ['title', 'TITLE'],
1793
- ['turnOverGroup', 'TURNOVERGROUP'],
1794
- ['height', 'HEIGHT'],
1795
- ['width', 'WIDTH']
1796
- ]);
1797
- var ProductPropertiesComponent = /** @class */ (function () {
1798
- function ProductPropertiesComponent() {
1799
- this.showLabel = false;
1800
- this.properties = [];
1801
- }
1802
- Object.defineProperty(ProductPropertiesComponent.prototype, "article", {
1803
- get: function () {
1804
- return this._article;
1805
- },
1806
- set: function (value) {
1807
- this._article = value;
1808
- this._prepareProperties();
1809
- },
1810
- enumerable: true,
1811
- configurable: true
1812
- });
1813
- ProductPropertiesComponent.prototype.ngOnInit = function () {
1814
- };
1815
- ProductPropertiesComponent.prototype._prepareProperties = function () {
1816
- var _this = this;
1817
- this.properties.length = 0;
1818
- if (!this._article) {
1819
- return;
1820
- }
1821
- propertyMap.forEach(function (value, key) {
1822
- if (_this.article.hasOwnProperty(key)) {
1823
- _this.properties.push({ key: value, value: _this.article[key] });
1824
- }
1825
- });
1826
- };
2070
+ ], ProductAddtocartComponent.prototype, "configurable", void 0);
1827
2071
  __decorate([
1828
2072
  core.Input()
1829
- ], ProductPropertiesComponent.prototype, "article", null);
2073
+ ], ProductAddtocartComponent.prototype, "configuring", void 0);
1830
2074
  __decorate([
2075
+ core.HostBinding('class.full-screen'),
1831
2076
  core.Input()
1832
- ], ProductPropertiesComponent.prototype, "showLabel", void 0);
1833
- ProductPropertiesComponent = __decorate([
2077
+ ], ProductAddtocartComponent.prototype, "fullscreen", void 0);
2078
+ __decorate([
2079
+ core.Input()
2080
+ ], ProductAddtocartComponent.prototype, "quantity", null);
2081
+ __decorate([
2082
+ core.Output()
2083
+ ], ProductAddtocartComponent.prototype, "startConfiguration", void 0);
2084
+ __decorate([
2085
+ core.Output()
2086
+ ], ProductAddtocartComponent.prototype, "addToCartClick", void 0);
2087
+ __decorate([
2088
+ core.Output()
2089
+ ], ProductAddtocartComponent.prototype, "addToQuoteClick", void 0);
2090
+ ProductAddtocartComponent = __decorate([
1834
2091
  core.Component({
1835
- selector: 'app-product-properties',
1836
- template: "<div class=\"article-properties-wrapper\">\n <h3 *ngIf=\"showLabel\" [textContent]=\"'PROPERTIES' | localize\"></h3>\n <ng-container *ngFor=\"let property of properties\">\n <div class=\"article-property\">\n <div class=\"article-property-key\" [textContent]=\"property.key | localize\"></div>\n <div class=\"article-property-value\" [textContent]=\"property.value\"></div>\n </div>\n </ng-container>\n</div>\n",
1837
- styles: [":host{display:block}.article-properties-wrapper{display:flex;flex-direction:column}.article-property{display:flex;flex-direction:row;border-bottom:1px solid #f6f5f4;padding:11px 0;font-size:13px}.article-property:first-child{border-top:1px solid #f6f5f4}.article-property-key{flex-basis:200px;flex-shrink:0;color:#5b6875}@media screen and (max-width:450px){.article-property-key{flex-basis:130px}}"]
1838
- })
1839
- ], ProductPropertiesComponent);
1840
- return ProductPropertiesComponent;
1841
- }());
1842
-
1843
- var LocalizePipe = /** @class */ (function () {
1844
- function LocalizePipe(_dictionaryService) {
1845
- this._dictionaryService = _dictionaryService;
1846
- }
1847
- LocalizePipe.prototype.transform = function (value, upperCaseFirst, replace) {
1848
- var _a;
1849
- if (upperCaseFirst === void 0) { upperCaseFirst = true; }
1850
- if (replace === void 0) { replace = []; }
1851
- if (!value) {
1852
- return '';
1853
- }
1854
- replace = replace ? replace : [];
1855
- if (!Array.isArray(replace)) {
1856
- replace = [replace];
1857
- }
1858
- return (_a = this._dictionaryService).get.apply(_a, __spread([value, upperCaseFirst], replace));
1859
- };
1860
- LocalizePipe.ctorParameters = function () { return [
1861
- { type: DictionaryService }
1862
- ]; };
1863
- LocalizePipe = __decorate([
1864
- core.Pipe({
1865
- name: 'localize'
2092
+ selector: 'app-product-addtocart',
2093
+ template: "<div class=\"atc-wrapper\">\n <co-number-picker *ngIf=\"!configurable && !configuring\" class=\"quantity-select\" [(model)]=\"quantity\" [min]=\"1\" horizontal></co-number-picker>\n <div class=\"button-wrapper\">\n <co-button class=\"configure-button\" *ngIf=\"configurable\"\n [iconData]=\"iconCache.getIcon(icon.MagicWand)\"\n [label]=\"'CONFIGURE' | localize\"\n (onClick)=\"startConfiguration.emit()\"\n ></co-button>\n <co-button #addtocartbutton class=\"cart-button\" *ngIf=\"!configurable\"\n [iconData]=\"iconCache.getIcon(icon.AddToCartDrop)\"\n [label]=\"'SHOPPING_CART_IN' | localize\"\n (onClick)=\"handleAddToCartClick(quantity)\"\n ></co-button>\n <co-button class=\"cart-button quote\" *ngIf=\"!configurable && showQuoteButton\"\n [iconData]=\"iconCache.getIcon(icon.Quote)\"\n [label]=\"'QUOTATION' | localize\"\n (onClick)=\"handleAddToQuoteClick(quantity)\"\n ></co-button>\n </div>\n</div>\n",
2094
+ styles: [":host{display:flex;flex-direction:column}:host :not(:last-child){margin-bottom:5px}:host .atc-wrapper{display:flex;flex-direction:row;align-items:baseline}:host .atc-wrapper .quantity-select{margin-right:5px}:host.full-screen .cart-button{position:fixed;right:20px;bottom:20px;z-index:3}::ng-deep co-number-picker{max-width:100px;border:2px solid #f6f5f4;border-radius:5px}::ng-deep co-number-picker ::ng-deep co-input-text{height:50px!important;border:none!important;width:50px!important}::ng-deep co-number-picker ::ng-deep co-input-text:after{display:none}::ng-deep co-number-picker ::ng-deep co-input-text.focused{box-shadow:none!important;border:none!important;background:0 0!important}::ng-deep co-number-picker ::ng-deep co-input-text .clear-icon{display:none}::ng-deep co-number-picker ::ng-deep co-input-text input{width:100%;text-align:center}::ng-deep co-number-picker ::ng-deep co-button{justify-content:center;padding:0!important;margin:0!important;height:50px!important;background-color:transparent!important}::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon [fill]{fill:#22313c!important}.button-wrapper ::ng-deep co-button{height:50px;max-width:300px;justify-content:center;font-size:15px;border-radius:5px!important;cursor:pointer;padding:0 20px!important}.button-wrapper ::ng-deep co-button:hover{background:#74b77f}::ng-deep co-button.cart-button{border-radius:5px}::ng-deep co-button.cart-button.quote{background:#7292b6}"]
1866
2095
  })
1867
- // A pipe for localizing string values in view templates.
1868
- ], LocalizePipe);
1869
- return LocalizePipe;
2096
+ ], ProductAddtocartComponent);
2097
+ return ProductAddtocartComponent;
1870
2098
  }());
1871
2099
 
1872
- var ProductDeliveryComponent = /** @class */ (function () {
1873
- function ProductDeliveryComponent(_localizePipe, _iOne, _iconCache) {
1874
- this._localizePipe = _localizePipe;
2100
+ var ProductRelatedComponent = /** @class */ (function () {
2101
+ function ProductRelatedComponent(_iOne, _appEventService) {
1875
2102
  this._iOne = _iOne;
1876
- this._iconCache = _iconCache;
1877
- this.icon = IconEnum;
1878
- this.iconData = this._iconCache.getIcon(this.icon.Truck);
2103
+ this._appEventService = _appEventService;
2104
+ this.isSmallModus = true;
2105
+ this._articles = [];
1879
2106
  }
1880
- Object.defineProperty(ProductDeliveryComponent.prototype, "stockAndDelivery", {
2107
+ Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
2108
+ get: function () {
2109
+ return this._articles;
2110
+ },
1881
2111
  set: function (value) {
2112
+ var _this = this;
1882
2113
  if (value) {
1883
- this.deliveryDescription = value.deliveryDescription;
1884
- if (this.deliveryDescription.length > 0 && this.deliveryDescription[0] === ' ') {
1885
- this.deliveryDescription = this._localizePipe.transform('ASK_FOR_INFORMATION');
2114
+ if (this.refType && this.refType !== undefined) {
2115
+ if (value.length > 0) {
2116
+ value.forEach(function (x) {
2117
+ if (x.refType === _this.refType) {
2118
+ _this._articles.push(x);
2119
+ }
2120
+ });
2121
+ }
2122
+ }
2123
+ else {
2124
+ this._articles = value;
1886
2125
  }
2126
+ this._loadImages();
1887
2127
  }
1888
2128
  },
1889
2129
  enumerable: true,
1890
2130
  configurable: true
1891
2131
  });
1892
- ProductDeliveryComponent.prototype.ngOnInit = function () {
2132
+ ProductRelatedComponent.prototype.handleContentClick = function (article) {
2133
+ this._appEventService.onAlternativeClick.next(article);
1893
2134
  };
1894
- ProductDeliveryComponent.ctorParameters = function () { return [
1895
- { type: LocalizePipe },
2135
+ ProductRelatedComponent.prototype._loadImages = function () {
2136
+ var _this = this;
2137
+ this._articles.forEach(function (a) {
2138
+ if (!a.image.documentBody) {
2139
+ _this._iOne.getDocumentContent(a.image.documentId).then(function (content) {
2140
+ if (content) {
2141
+ a.image.documentBody = content.documentContent;
2142
+ }
2143
+ });
2144
+ }
2145
+ });
2146
+ };
2147
+ ProductRelatedComponent.ctorParameters = function () { return [
1896
2148
  { type: ProductConnectorService },
1897
- { type: IconCacheService }
2149
+ { type: ProductEventService }
1898
2150
  ]; };
1899
2151
  __decorate([
1900
2152
  core.Input()
1901
- ], ProductDeliveryComponent.prototype, "stockAndDelivery", null);
1902
- ProductDeliveryComponent = __decorate([
2153
+ ], ProductRelatedComponent.prototype, "refType", void 0);
2154
+ __decorate([
2155
+ core.Input()
2156
+ ], ProductRelatedComponent.prototype, "label", void 0);
2157
+ __decorate([
2158
+ core.Input()
2159
+ ], ProductRelatedComponent.prototype, "isSmallModus", void 0);
2160
+ __decorate([
2161
+ core.Input()
2162
+ ], ProductRelatedComponent.prototype, "articles", null);
2163
+ ProductRelatedComponent = __decorate([
1903
2164
  core.Component({
1904
- selector: 'app-product-delivery',
1905
- template: "<!--<app-header [label]=\"'DELIVERY_TIME_PERIOD' | localize\"></app-header>-->\n<div class=\"product-delivery-wrapper\">\n <co-icon class=\"delivery-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-delivery-fields\">\n <div class=\"pp-default-label\" [textContent]=\"'DELIVERY_TIME_PERIOD' | localize\"></div>\n <div class=\"pp-default-description\" [textContent]=\"deliveryDescription | date:'dd MMMM yyyy'\"></div>\n </div>\n</div>\n",
1906
- providers: [LocalizePipe],
1907
- styles: [":host{display:block}.product-delivery-wrapper{display:flex;flex-direction:row;align-items:center;border-bottom:1px solid #f6f5f4;padding:20px 15px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:40px;height:37px}.product-delivery-wrapper .product-delivery-fields{display:flex;flex-direction:column}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:14px;margin:0}@media screen and (max-width:400px){.product-delivery-wrapper{padding:15px 0 15px 10px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:32px;height:28px}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:13px}}"]
2165
+ selector: 'app-product-related',
2166
+ template: "<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]=\"article.image.documentBodyAsDataUri\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n</div>\n",
2167
+ styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row}.article-wrapper ::ng-deep co-tile.small{min-width:189px;max-width:189px;height:100%}.article-wrapper ::ng-deep co-tile.small:hover{box-shadow:none;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:0!important;padding-bottom:0;overflow:hidden}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons{position:absolute;top:0;right:0;margin:0 -32px 0 0;align-items:flex-end;transition:.2s ease-in-out}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini{width:30px;height:30px;transform:none;border-radius:4px;margin:0 0 5px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::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:0!important;background:0 0!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}"]
1908
2168
  })
1909
- ], ProductDeliveryComponent);
1910
- return ProductDeliveryComponent;
2169
+ ], ProductRelatedComponent);
2170
+ return ProductRelatedComponent;
1911
2171
  }());
1912
2172
 
1913
2173
  var ProductStockComponent = /** @class */ (function () {
@@ -1941,616 +2201,567 @@
1941
2201
  template: "<!--<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\">\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",
1942
2202
  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}.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}.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}}"]
1943
2203
  })
1944
- ], ProductStockComponent);
1945
- return ProductStockComponent;
2204
+ ], ProductStockComponent);
2205
+ return ProductStockComponent;
2206
+ }());
2207
+
2208
+ var LocalizePipe = /** @class */ (function () {
2209
+ function LocalizePipe(_dictionaryService) {
2210
+ this._dictionaryService = _dictionaryService;
2211
+ }
2212
+ LocalizePipe.prototype.transform = function (value, upperCaseFirst, replace) {
2213
+ var _a;
2214
+ if (upperCaseFirst === void 0) { upperCaseFirst = true; }
2215
+ if (replace === void 0) { replace = []; }
2216
+ if (!value) {
2217
+ return '';
2218
+ }
2219
+ replace = replace ? replace : [];
2220
+ if (!Array.isArray(replace)) {
2221
+ replace = [replace];
2222
+ }
2223
+ return (_a = this._dictionaryService).get.apply(_a, __spread([value, upperCaseFirst], replace));
2224
+ };
2225
+ LocalizePipe.ctorParameters = function () { return [
2226
+ { type: DictionaryService }
2227
+ ]; };
2228
+ LocalizePipe = __decorate([
2229
+ core.Pipe({
2230
+ name: 'localize'
2231
+ })
2232
+ // A pipe for localizing string values in view templates.
2233
+ ], LocalizePipe);
2234
+ return LocalizePipe;
1946
2235
  }());
1947
2236
 
1948
- var ProductSymbolsComponent = /** @class */ (function () {
1949
- function ProductSymbolsComponent() {
1950
- this.symbolStrings = [];
2237
+ var ProductDeliveryComponent = /** @class */ (function () {
2238
+ function ProductDeliveryComponent(_localizePipe, _iOne, _iconCache) {
2239
+ this._localizePipe = _localizePipe;
2240
+ this._iOne = _iOne;
2241
+ this._iconCache = _iconCache;
2242
+ this.icon = IconEnum;
2243
+ this.iconData = this._iconCache.getIcon(this.icon.Truck);
1951
2244
  }
1952
- Object.defineProperty(ProductSymbolsComponent.prototype, "symbols", {
1953
- get: function () {
1954
- return this._symbols;
1955
- },
2245
+ Object.defineProperty(ProductDeliveryComponent.prototype, "stockAndDelivery", {
1956
2246
  set: function (value) {
1957
- this._symbols = value;
1958
- if (this._symbols && this._symbols.hasOwnProperty('fontCode')) {
1959
- this._className = this._symbols['fontCode'] === 'VLOER' ? 'floor' : (this._className === 'WAS' ? 'ginetex' : '');
1960
- }
1961
- if (this._symbols && this._symbols.hasOwnProperty('symbolString')) {
1962
- for (var i = 0; i < this._symbols['symbolString'].length; i++) {
1963
- this.symbolStrings.push(this._symbols['symbolString'][i]);
2247
+ if (value) {
2248
+ this.deliveryDescription = value.deliveryDescription;
2249
+ if (this.deliveryDescription.length > 0 && this.deliveryDescription[0] === ' ') {
2250
+ this.deliveryDescription = this._localizePipe.transform('ASK_FOR_INFORMATION');
1964
2251
  }
1965
2252
  }
1966
2253
  },
1967
2254
  enumerable: true,
1968
2255
  configurable: true
1969
2256
  });
1970
- ProductSymbolsComponent.prototype.ngOnInit = function () {
2257
+ ProductDeliveryComponent.prototype.ngOnInit = function () {
1971
2258
  };
2259
+ ProductDeliveryComponent.ctorParameters = function () { return [
2260
+ { type: LocalizePipe },
2261
+ { type: ProductConnectorService },
2262
+ { type: IconCacheService }
2263
+ ]; };
1972
2264
  __decorate([
1973
2265
  core.Input()
1974
- ], ProductSymbolsComponent.prototype, "symbols", null);
1975
- __decorate([
1976
- core.HostBinding('class')
1977
- ], ProductSymbolsComponent.prototype, "_className", void 0);
1978
- ProductSymbolsComponent = __decorate([
2266
+ ], ProductDeliveryComponent.prototype, "stockAndDelivery", null);
2267
+ ProductDeliveryComponent = __decorate([
1979
2268
  core.Component({
1980
- selector: 'app-product-symbols',
1981
- template: "<div *ngIf=\"symbols && symbols.length > 0\">\n <app-header [label]=\"'SYMBOLS' | localize\" [amount]=\"symbols?.length\"></app-header>\n <co-scroll-container>\n <co-tile small noImagePlaceholder *ngFor=\"let symbol of symbolStrings\">\n <ng-container tile-over-image>\n <div class=\"symbol\" [textContent]=\"symbol\"></div>\n </ng-container>\n <ng-container tile-extra-bottom-content>\n <div class=\"symbol-name\" [textContent]=\"'Wat moet hier?'\"></div>\n </ng-container>\n </co-tile>\n </co-scroll-container>\n</div>\n",
1982
- styles: [":host{display:block}:host.floor .symbol{font-family:iOneFloorsymbols}:host.ginetex .symbol{font-family:iOneGinetexsymbols}.symbol{font-size:100px}"]
2269
+ selector: 'app-product-delivery',
2270
+ template: "<!--<app-header [label]=\"'DELIVERY_TIME_PERIOD' | localize\"></app-header>-->\n<div class=\"product-delivery-wrapper\">\n <co-icon class=\"delivery-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-delivery-fields\">\n <div class=\"pp-default-label\" [textContent]=\"'DELIVERY_TIME_PERIOD' | localize\"></div>\n <div class=\"pp-default-description\" [textContent]=\"deliveryDescription | date:'dd MMMM yyyy'\"></div>\n </div>\n</div>\n",
2271
+ styles: [":host{display:block}.product-delivery-wrapper{display:flex;flex-direction:row;align-items:center;border-bottom:1px solid #f6f5f4;padding:20px 15px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:40px;height:37px}.product-delivery-wrapper .product-delivery-fields{display:flex;flex-direction:column}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:14px;margin:0}@media screen and (max-width:400px){.product-delivery-wrapper{padding:15px 0 15px 10px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:32px;height:28px}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:13px}}"]
1983
2272
  })
1984
- ], ProductSymbolsComponent);
1985
- return ProductSymbolsComponent;
2273
+ ], ProductDeliveryComponent);
2274
+ return ProductDeliveryComponent;
1986
2275
  }());
1987
2276
 
1988
- var ProductPriceComponent = /** @class */ (function () {
1989
- function ProductPriceComponent(_changeDetector) {
1990
- this._changeDetector = _changeDetector;
1991
- this.showFromPrice = false;
1992
- this._configurable = false;
2277
+ var ProductInfoTabsComponent = /** @class */ (function () {
2278
+ function ProductInfoTabsComponent(_appEventService) {
2279
+ var _this = this;
2280
+ this._appEventService = _appEventService;
2281
+ this.activeTabHeight = 0;
2282
+ this.tabs = [];
2283
+ this._subs = [];
2284
+ this._subs.push(this._appEventService.onUpdateProductInfoTab.subscribe(function (index) {
2285
+ _this.updateTab(index);
2286
+ _this.tabContent.nativeElement.scrollIntoView({ behavior: 'smooth' });
2287
+ }));
1993
2288
  }
1994
- Object.defineProperty(ProductPriceComponent.prototype, "pricing", {
1995
- get: function () {
1996
- return this._pricing;
1997
- },
1998
- set: function (value) {
1999
- this._pricing = value;
2000
- this._setPrices();
2001
- },
2002
- enumerable: true,
2003
- configurable: true
2004
- });
2005
- Object.defineProperty(ProductPriceComponent.prototype, "configurable", {
2289
+ Object.defineProperty(ProductInfoTabsComponent.prototype, "article", {
2006
2290
  set: function (value) {
2007
- this._configurable = value;
2008
- this._setPrices();
2291
+ if (value) {
2292
+ this.articleObject = value;
2293
+ this._setupTabs();
2294
+ this.updateTab(0);
2295
+ }
2009
2296
  },
2010
2297
  enumerable: true,
2011
2298
  configurable: true
2012
2299
  });
2013
- ProductPriceComponent.prototype.ngOnInit = function () {
2300
+ ProductInfoTabsComponent.prototype.ngOnDestroy = function () {
2301
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
2014
2302
  };
2015
- ProductPriceComponent.prototype._setPrices = function () {
2016
- if (this._pricing) {
2017
- this.valutaSign = this._getSign(this._pricing.retailCurrency);
2018
- if (this._configurable) {
2019
- this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
2020
- this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
2021
- this.toPrice = undefined;
2022
- }
2023
- else {
2024
- this.fromPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
2025
- this.fromLabel = this._pricing.retailSuggestedPrice ? 'Was' : 'PRICE';
2026
- this.toPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailBasePrice : undefined;
2027
- this.toLabel = this._pricing.retailSuggestedPrice ? 'IS_NOW' : '';
2303
+ ProductInfoTabsComponent.prototype.updateTab = function (tabIndex) {
2304
+ this.activeTab = tabIndex;
2305
+ this.updateHeight(tabIndex);
2306
+ };
2307
+ ProductInfoTabsComponent.prototype.updateHeight = function (tabIndex) {
2308
+ if (this.tabContent.nativeElement.children.length > 0) {
2309
+ if (this.tabContent.nativeElement.children[tabIndex] !== undefined) {
2310
+ this.activeTabHeight = this.tabContent.nativeElement.children[tabIndex].offsetHeight;
2028
2311
  }
2029
- this._changeDetector.detectChanges();
2030
2312
  }
2031
2313
  };
2032
- ProductPriceComponent.prototype._getSign = function (currency) {
2033
- switch (currency) {
2034
- case 'EUR':
2035
- return '€';
2036
- default:
2037
- return '€';
2314
+ ProductInfoTabsComponent.prototype._setupTabs = function () {
2315
+ this.tabs.push({ title: 'DESCRIPTION' });
2316
+ this.tabs.push({ title: 'FEATURES' });
2317
+ if (this.articleObject.documents !== undefined && this.articleObject.documents.length > 0) {
2318
+ this.tabs.push({ title: 'DOWNLOADS' });
2319
+ }
2320
+ if (this.articleObject.symbols !== undefined && this.articleObject.symbols.length > 0) {
2321
+ this.tabs.push({ title: 'SYMBOLS' });
2038
2322
  }
2039
2323
  };
2040
- ProductPriceComponent.ctorParameters = function () { return [
2041
- { type: core.ChangeDetectorRef }
2324
+ ProductInfoTabsComponent.ctorParameters = function () { return [
2325
+ { type: ProductEventService }
2042
2326
  ]; };
2043
2327
  __decorate([
2044
- core.Input()
2045
- ], ProductPriceComponent.prototype, "pricing", null);
2328
+ core.ViewChild('tabContent')
2329
+ ], ProductInfoTabsComponent.prototype, "tabContent", void 0);
2046
2330
  __decorate([
2047
2331
  core.Input()
2048
- ], ProductPriceComponent.prototype, "configurable", null);
2049
- ProductPriceComponent = __decorate([
2332
+ ], ProductInfoTabsComponent.prototype, "article", null);
2333
+ ProductInfoTabsComponent = __decorate([
2050
2334
  core.Component({
2051
- selector: 'app-product-price',
2052
- template: "<div *ngIf=\"toPrice\">\n <div class=\"price-wrapper\" *ngIf=\"fromPrice > toPrice\">\n <div class=\"from-price-label\" [textContent]=\"fromLabel | localize\"></div>\n <div class=\"from-price\" [textContent]=\"fromPrice | priceDisplay\"></div>\n </div>\n <div class=\"price-wrapper\">\n <div class=\"to-price-label\" [textContent]=\"toLabel | localize\"></div>\n <div class=\"to-price\" [textContent]=\"toPrice | priceDisplay\"></div>\n </div>\n</div>\n",
2053
- styles: [":host{display:flex;flex-direction:column}.price-wrapper{width:100%;font-size:15px;margin:0 0 5px;display:inline-block}.price-wrapper:last-child{margin:0}.from-price-label,.to-price-label{color:#5b6875;display:none}.from-price{font-size:16px;font-weight:700;text-decoration:line-through;color:#5b6875}.to-price{font-size:25px;font-weight:700;color:#74b77f}@media screen and (max-width:650px){.from-price{font-size:13px}.to-price{font-size:21px}}"]
2335
+ selector: 'app-product-info-tabs',
2336
+ template: "<div class=\"tab-container\">\r\n <div class=\"tab-header\">\r\n <button *ngFor=\"let tab of tabs; let i = index\" class=\"tab-header-button\" [class.active]=\"activeTab === i\" [textContent]=\"tab.title | localize\" (click)=\"updateTab(i)\"></button>\r\n </div>\r\n <div class=\"tab-content\" #tabContent [style.height.px]=\"(activeTabHeight > 0 ? activeTabHeight : '')\">\r\n <div class=\"tab-content-item\" *ngFor=\"let tab of tabs; let i = index\" [class.active]=\"activeTab === i\">\r\n <ng-container *ngIf=\"i === 0\">\r\n <app-product-additional-info class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-additional-info>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 1\">\r\n <app-product-properties class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-properties>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 2\">\r\n <app-product-documents [showLabel]=\"false\" class=\"\" *ngIf=\"articleObject?.documents && articleObject?.documents.length > 0\" [documents]=\"articleObject?.documents\"></app-product-documents>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 3\">\r\n <app-product-symbols class=\"\" *ngIf=\"articleObject?.symbols && articleObject?.symbols.length > 0\" [symbols]=\"articleObject?.symbols\"></app-product-symbols>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n",
2337
+ styles: [":focus{outline:0}:host .tab-header{border-bottom:3px solid #f6f5f4;margin:0 0 30px}:host .tab-header .tab-header-button{background:0 0;border:none;border-bottom:3px solid transparent;line-height:20px;padding:15px 20px;cursor:pointer;font-family:iOneMontserrat;color:#22313c;font-weight:700;margin:0 0 -3px;opacity:.5}:host .tab-header .tab-header-button:hover{opacity:1}:host .tab-header .tab-header-button.active{opacity:1;border-color:#74b77f}:host .tab-content{padding:0 20px 30px;margin:0 0 20px;border-bottom:2px solid #f6f5f4;transition:.2s ease-in-out;position:relative}:host .tab-content .tab-content-item{opacity:0;position:absolute;left:0;top:0;visibility:hidden;width:100%}:host .tab-content .tab-content-item.active{opacity:1;visibility:visible;position:static}@media screen and (max-width:650px){:host .tab-content{padding:0 10px 15px}}@media screen and (max-width:450px){:host .tab-header{display:flex}:host .tab-header .tab-header-button{width:100%;padding:10px;font-size:11px}}"]
2054
2338
  })
2055
- ], ProductPriceComponent);
2056
- return ProductPriceComponent;
2339
+ ], ProductInfoTabsComponent);
2340
+ return ProductInfoTabsComponent;
2057
2341
  }());
2058
2342
 
2059
- var ProductAddtocartComponent = /** @class */ (function () {
2060
- function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
2343
+ var PipeModule = /** @class */ (function () {
2344
+ function PipeModule() {
2345
+ }
2346
+ PipeModule = __decorate([
2347
+ core.NgModule({
2348
+ exports: [
2349
+ LocalizePipe
2350
+ ],
2351
+ declarations: [
2352
+ LocalizePipe
2353
+ ],
2354
+ providers: [
2355
+ LocalizePipe
2356
+ ]
2357
+ })
2358
+ ], PipeModule);
2359
+ return PipeModule;
2360
+ }());
2361
+
2362
+ var ProductDocumentsComponent = /** @class */ (function () {
2363
+ function ProductDocumentsComponent(iconCache) {
2061
2364
  this.iconCache = iconCache;
2062
- this._ioneControllerService = _ioneControllerService;
2063
- this._appEventService = _appEventService;
2064
- this._settingsService = _settingsService;
2065
2365
  this.icon = IconEnum;
2066
- this.configurable = false;
2067
- this.configuring = false;
2068
- this.fullscreen = false;
2069
- this.startConfiguration = new core.EventEmitter();
2070
- this.addToCartClick = new core.EventEmitter();
2071
- this.addToQuoteClick = new core.EventEmitter();
2072
- this.showQuoteButton = false;
2073
- this._quantity = 1;
2366
+ this.showLabel = false;
2367
+ this.documents = [];
2074
2368
  }
2075
- Object.defineProperty(ProductAddtocartComponent.prototype, "quantity", {
2076
- get: function () {
2077
- return this._quantity;
2078
- },
2079
- set: function (value) {
2080
- this._quantity = Math.max(1, value);
2081
- },
2082
- enumerable: true,
2083
- configurable: true
2084
- });
2085
- ProductAddtocartComponent.prototype.ngOnInit = function () {
2086
- };
2087
- ProductAddtocartComponent.prototype.ngOnDestroy = function () {
2088
- this.addToCartButton = undefined;
2089
- };
2090
- ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
2091
- return __awaiter(this, void 0, void 0, function () {
2092
- var _a, _b;
2093
- return __generator(this, function (_c) {
2094
- switch (_c.label) {
2095
- case 0:
2096
- _b = (_a = this._appEventService.onAddToCart).next;
2097
- return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2098
- case 1:
2099
- _b.apply(_a, [_c.sent()]);
2100
- return [2 /*return*/];
2101
- }
2102
- });
2103
- });
2104
- };
2105
- ProductAddtocartComponent.prototype.handleAddToQuoteClick = function (quantity) {
2106
- return __awaiter(this, void 0, void 0, function () {
2107
- var _a, _b;
2108
- return __generator(this, function (_c) {
2109
- switch (_c.label) {
2110
- case 0:
2111
- _b = (_a = this._appEventService.onAddToQuote).next;
2112
- return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2113
- case 1:
2114
- _b.apply(_a, [_c.sent()]);
2115
- return [2 /*return*/];
2116
- }
2117
- });
2118
- });
2119
- };
2120
- ProductAddtocartComponent.prototype._getJSONFromArticleObject = function (article) {
2121
- return __awaiter(this, void 0, void 0, function () {
2122
- var configuratorStatistics;
2123
- return __generator(this, function (_a) {
2124
- switch (_a.label) {
2125
- case 0:
2126
- configuratorStatistics = new configuratorStatisticsEnvironment.ConfiguratorStatisticsEnvironment();
2127
- configuratorStatistics.userType = 'iOneProductPage';
2128
- configuratorStatistics.transactionType = 'Sales';
2129
- configuratorStatistics.actionDomain = 'bundle';
2130
- configuratorStatistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
2131
- configuratorStatistics.webHost = window.location.host;
2132
- configuratorStatistics.bundleHost = window.location.host;
2133
- return [4 /*yield*/, this._ioneControllerService.getJsonArticleFlatTree(article.article.goodId, article.article.goodType, article.quantity, true, undefined, configuratorStatistics)];
2134
- case 1: return [2 /*return*/, _a.sent()];
2135
- }
2136
- });
2137
- });
2138
- };
2139
- ProductAddtocartComponent.ctorParameters = function () { return [
2140
- { type: IconCacheService },
2141
- { type: ProductConnectorService },
2142
- { type: ProductEventService },
2143
- { type: ProductSettingsService }
2144
- ]; };
2145
- __decorate([
2146
- core.ViewChild('addtocartbutton', { read: core.ElementRef })
2147
- ], ProductAddtocartComponent.prototype, "addToCartButton", void 0);
2148
- __decorate([
2149
- core.Input()
2150
- ], ProductAddtocartComponent.prototype, "article", void 0);
2369
+ ProductDocumentsComponent.ctorParameters = function () { return [
2370
+ { type: IconCacheService }
2371
+ ]; };
2151
2372
  __decorate([
2152
2373
  core.Input()
2153
- ], ProductAddtocartComponent.prototype, "configurable", void 0);
2374
+ ], ProductDocumentsComponent.prototype, "showLabel", void 0);
2154
2375
  __decorate([
2155
2376
  core.Input()
2156
- ], ProductAddtocartComponent.prototype, "configuring", void 0);
2377
+ ], ProductDocumentsComponent.prototype, "documents", void 0);
2378
+ ProductDocumentsComponent = __decorate([
2379
+ core.Component({
2380
+ selector: 'app-product-documents',
2381
+ template: "<app-header *ngIf=\"showLabel\" [label]=\"'DOCUMENTS' | localize\" [amount]=\"documents?.length\"></app-header>\n<div *ngIf=\"documents && documents.length > 0\">\n <co-files-upload [documents]=\"documents\" [canAdd]=\"false\" readonly></co-files-upload>\n</div>\n",
2382
+ styles: [":host{display:block}::ng-deep co-files-upload{flex-direction:column!important;width:100%}::ng-deep co-file-upload{margin:0!important;border-bottom:1px solid #f6f5f4}::ng-deep co-file-upload:first-child{border-top:1px solid #f6f5f4}::ng-deep co-files-upload .files-upload-wrapper{flex-direction:column!important;width:100%}::ng-deep co-file-upload co-tile{max-width:100%!important;width:100%;position:relative}::ng-deep co-file-upload co-tile:hover{box-shadow:none!important}::ng-deep co-file-upload co-tile:hover .tile-extra-bottom{background-color:#f6f5f4!important}::ng-deep co-file-upload co-tile .tile-wrapper{position:absolute!important;left:0;top:0;width:100%;height:100%;z-index:2;opacity:0;box-sizing:border-box}::ng-deep co-file-upload co-tile .tile-wrapper .image{position:absolute!important;left:0;top:0;width:100%!important;height:100%!important;cursor:pointer}::ng-deep co-file-upload co-tile .tile-extra-bottom{outline:0!important;border:none!important;background:url(../../../assets/icons/download.svg) left 6px center/36px auto no-repeat!important;line-height:20px;padding:20px 20px 20px 60px!important;margin:0!important}::ng-deep co-file-upload co-tile .tile-extra-bottom .main{padding:0!important}"]
2383
+ })
2384
+ ], ProductDocumentsComponent);
2385
+ return ProductDocumentsComponent;
2386
+ }());
2387
+
2388
+ var HeaderComponent = /** @class */ (function () {
2389
+ function HeaderComponent() {
2390
+ }
2391
+ HeaderComponent.prototype.ngOnInit = function () {
2392
+ };
2157
2393
  __decorate([
2158
- core.HostBinding('class.full-screen'),
2159
2394
  core.Input()
2160
- ], ProductAddtocartComponent.prototype, "fullscreen", void 0);
2395
+ ], HeaderComponent.prototype, "label", void 0);
2161
2396
  __decorate([
2162
2397
  core.Input()
2163
- ], ProductAddtocartComponent.prototype, "quantity", null);
2164
- __decorate([
2165
- core.Output()
2166
- ], ProductAddtocartComponent.prototype, "startConfiguration", void 0);
2167
- __decorate([
2168
- core.Output()
2169
- ], ProductAddtocartComponent.prototype, "addToCartClick", void 0);
2170
- __decorate([
2171
- core.Output()
2172
- ], ProductAddtocartComponent.prototype, "addToQuoteClick", void 0);
2173
- ProductAddtocartComponent = __decorate([
2398
+ ], HeaderComponent.prototype, "amount", void 0);
2399
+ HeaderComponent = __decorate([
2174
2400
  core.Component({
2175
- selector: 'app-product-addtocart',
2176
- template: "<div class=\"atc-wrapper\">\n <co-number-picker *ngIf=\"!configurable && !configuring\" class=\"quantity-select\" [(model)]=\"quantity\" [min]=\"1\" horizontal></co-number-picker>\n <div class=\"button-wrapper\">\n <co-button class=\"configure-button\" *ngIf=\"configurable\"\n [iconData]=\"iconCache.getIcon(icon.MagicWand)\"\n [label]=\"'CONFIGURE' | localize\"\n (onClick)=\"startConfiguration.emit()\"\n ></co-button>\n <co-button #addtocartbutton class=\"cart-button\" *ngIf=\"!configurable\"\n [iconData]=\"iconCache.getIcon(icon.AddToCartDrop)\"\n [label]=\"'SHOPPING_CART_IN' | localize\"\n (onClick)=\"handleAddToCartClick(quantity)\"\n ></co-button>\n <co-button class=\"cart-button quote\" *ngIf=\"!configurable && showQuoteButton\"\n [iconData]=\"iconCache.getIcon(icon.Quote)\"\n [label]=\"'QUOTATION' | localize\"\n (onClick)=\"handleAddToQuoteClick(quantity)\"\n ></co-button>\n </div>\n</div>\n",
2177
- styles: [":host{display:flex;flex-direction:column}:host :not(:last-child){margin-bottom:5px}:host .atc-wrapper{display:flex;flex-direction:row;align-items:baseline}:host .atc-wrapper .quantity-select{margin-right:5px}:host.full-screen .cart-button{position:fixed;right:20px;bottom:20px;z-index:3}::ng-deep co-number-picker{max-width:100px;border:2px solid #f6f5f4;border-radius:5px}::ng-deep co-number-picker ::ng-deep co-input-text{height:50px!important;border:none!important;width:50px!important}::ng-deep co-number-picker ::ng-deep co-input-text:after{display:none}::ng-deep co-number-picker ::ng-deep co-input-text.focused{box-shadow:none!important;border:none!important;background:0 0!important}::ng-deep co-number-picker ::ng-deep co-input-text .clear-icon{display:none}::ng-deep co-number-picker ::ng-deep co-input-text input{width:100%;text-align:center}::ng-deep co-number-picker ::ng-deep co-button{justify-content:center;padding:0!important;margin:0!important;height:50px!important;background-color:transparent!important}::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon [fill]{fill:#22313c!important}.button-wrapper ::ng-deep co-button{height:50px;max-width:300px;justify-content:center;font-size:15px;border-radius:5px!important;cursor:pointer;padding:0 20px!important}.button-wrapper ::ng-deep co-button:hover{background:#74b77f}::ng-deep co-button.cart-button{border-radius:5px}::ng-deep co-button.cart-button.quote{background:#7292b6}"]
2401
+ selector: 'app-header',
2402
+ template: "<ng-container *ngIf=\"label\">\n <div class=\"header-wrapper\">\n <h3 [textContent]=\"label\"></h3>\n <span *ngIf=\"amount\" class=\"amount\" [textContent]=\"'(' + amount + ')'\"></span>\n </div>\n</ng-container>\n",
2403
+ styles: [".header-wrapper{display:flex;flex-direction:row;align-items:center}.header-wrapper .amount{margin-left:5px}"]
2178
2404
  })
2179
- ], ProductAddtocartComponent);
2180
- return ProductAddtocartComponent;
2405
+ ], HeaderComponent);
2406
+ return HeaderComponent;
2181
2407
  }());
2182
2408
 
2183
- var ProductSelectorTypeComponent = /** @class */ (function () {
2184
- function ProductSelectorTypeComponent(_iconCache, _changeDetector) {
2185
- this._iconCache = _iconCache;
2186
- this._changeDetector = _changeDetector;
2187
- this.type = SelectorType;
2188
- this.icons = IconEnum;
2189
- this.onIconClick = new core.EventEmitter();
2190
- this.currentTypeChange = new core.EventEmitter();
2191
- this.twoDIcon = this._iconCache.getIcon(this.icons.TwoD);
2192
- this.threeDIcon = this._iconCache.getIcon(this.icons.ThreeD);
2409
+ var TabType;
2410
+ (function (TabType) {
2411
+ TabType["Additional"] = "additional";
2412
+ TabType["Properties"] = "properties";
2413
+ })(TabType || (TabType = {}));
2414
+ var ProductInfoComponent = /** @class */ (function () {
2415
+ function ProductInfoComponent() {
2416
+ this.tabType = TabType;
2417
+ this.currentTab = TabType.Additional;
2193
2418
  }
2194
- ProductSelectorTypeComponent.prototype.ngOnInit = function () {
2419
+ ProductInfoComponent.prototype.ngOnInit = function () {
2195
2420
  };
2196
- ProductSelectorTypeComponent.prototype.handleIconClick = function (type) {
2197
- this.currentType = type;
2198
- this.currentTypeChange.next(this.currentType);
2199
- this.onIconClick.next(this.currentType);
2200
- this._changeDetector.detectChanges();
2421
+ ProductInfoComponent.prototype.switchTab = function (tab) {
2422
+ this.currentTab = tab;
2201
2423
  };
2202
- ProductSelectorTypeComponent.ctorParameters = function () { return [
2203
- { type: IconCacheService },
2204
- { type: core.ChangeDetectorRef }
2205
- ]; };
2206
2424
  __decorate([
2207
2425
  core.Input()
2208
- ], ProductSelectorTypeComponent.prototype, "show2D", void 0);
2209
- __decorate([
2210
- core.Input()
2211
- ], ProductSelectorTypeComponent.prototype, "show3D", void 0);
2212
- __decorate([
2213
- core.Input()
2214
- ], ProductSelectorTypeComponent.prototype, "currentType", void 0);
2215
- __decorate([
2216
- core.Output()
2217
- ], ProductSelectorTypeComponent.prototype, "onIconClick", void 0);
2218
- __decorate([
2219
- core.Output()
2220
- ], ProductSelectorTypeComponent.prototype, "currentTypeChange", void 0);
2221
- ProductSelectorTypeComponent = __decorate([
2426
+ ], ProductInfoComponent.prototype, "article", void 0);
2427
+ ProductInfoComponent = __decorate([
2222
2428
  core.Component({
2223
- selector: 'app-product-selector-type',
2224
- template: "<div *ngIf=\"show2D || show3D\" class=\"show-in\" [textContent]=\"'SHOW_IN' | localize\"></div>\n<co-icon *ngIf=\"show2D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.TwoD\"\n [iconData]=\"twoDIcon\"\n (click)=\"handleIconClick(type.TwoD)\"\n></co-icon>\n<co-icon *ngIf=\"show3D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.ThreeD\"\n [iconData]=\"threeDIcon\"\n (click)=\"handleIconClick(type.ThreeD)\"\n></co-icon>\n",
2225
- styles: [":host{display:flex;flex-direction:row;align-items:center}:host .show-in{display:none}:host>:not(:last-child){margin-right:10px}::ng-deep co-icon.selector-type-icon{box-shadow:inset 0 0 0 1px #22313c;border-radius:50%;background:0 0;height:34px;width:34px;cursor:pointer}::ng-deep co-icon.selector-type-icon.active{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}::ng-deep co-icon.selector-type-icon.active [fill]{fill:#fff}"]
2429
+ selector: 'app-product-info',
2430
+ template: "<div>\n <div class=\"info-wrapper\">\n <div class=\"info-navigation\">\n <span [textContent]=\"'ADDITIONAL_DATA' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Additional\" (mouseup)=\"switchTab(tabType.Additional)\"></span>\n <span [textContent]=\"'PROPERTIES' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Properties\" (mouseup)=\"switchTab(tabType.Properties)\"></span>\n </div>\n <ng-container [ngSwitch]=\"currentTab\" class=\"content\">\n <div *ngSwitchCase=\"tabType.Additional\" @showContent>\n <app-product-additional-info\n [article]=\"article\"\n ></app-product-additional-info>\n </div>\n <div *ngSwitchCase=\"tabType.Properties\" @showContent>\n <app-product-properties [article]=\"article\"></app-product-properties>\n </div>\n </ng-container>\n </div>\n</div>\n",
2431
+ animations: [
2432
+ animations.trigger('showContent', [
2433
+ animations.state('void', animations.style({ 'opacity': '0' })),
2434
+ animations.state('*', animations.style({ 'opacity': '1' })),
2435
+ animations.transition('void => *', animations.animate('200ms 100ms ease-in-out')),
2436
+ ])
2437
+ ],
2438
+ styles: [".info-navigation{margin:30px 0}.info-navigation .navigator:not(:last-child){margin-right:30px}.navigator{font-size:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.navigator.selected{color:#2b60a7}"]
2226
2439
  })
2227
- ], ProductSelectorTypeComponent);
2228
- return ProductSelectorTypeComponent;
2440
+ ], ProductInfoComponent);
2441
+ return ProductInfoComponent;
2229
2442
  }());
2230
2443
 
2231
- var IoneProductComponent = /** @class */ (function () {
2232
- function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
2233
- // this.sku = 'CF-HILL';
2234
- // this.sku = 'CF-ALMADA';
2235
- // this.sku = 'CF-39904ANT';
2236
- // this.sku = 'CF-22346001';
2237
- // this.sku = '104';
2238
- // this.sku = '1000561986';
2239
- // this.sku = '1000234793';
2240
- // this.sku = '1066';
2241
- // this.sku = '104';
2242
- var _this = this;
2243
- this._dictionary = _dictionary;
2244
- this._jsonUtils = _jsonUtils;
2245
- this._ione = _ione;
2444
+ var ProductAdditionalInfoComponent = /** @class */ (function () {
2445
+ function ProductAdditionalInfoComponent(_sanitizer, _connectorService, _changeDetector) {
2446
+ this._sanitizer = _sanitizer;
2447
+ this._connectorService = _connectorService;
2246
2448
  this._changeDetector = _changeDetector;
2247
- this._appEventService = _appEventService;
2248
- this._settingsService = _settingsService;
2249
- this.onAddToCart = new core.EventEmitter();
2250
- this.forceRenderImage = new core.EventEmitter();
2251
- this.onAlternativeClick = new core.EventEmitter();
2252
- this.onArticleInfoReceived = new core.EventEmitter();
2253
- this.onArticleReceived = new core.EventEmitter();
2254
- this.onSelectionsReceived = new core.EventEmitter();
2255
- this.onAddToQuote = new core.EventEmitter();
2256
- this.upAndLoaded = false;
2257
- this._subs = [];
2258
- this._subs.push(this._settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }),
2259
- // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
2260
- this._appEventService.onAddToCart.subscribe(function (json) { return _this.onAddToCart.emit(json); }), 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); }));
2449
+ this.showLabel = false;
2450
+ this.textParts = [];
2451
+ this._superArticles = new Map();
2261
2452
  }
2262
- Object.defineProperty(IoneProductComponent.prototype, "settings", {
2453
+ Object.defineProperty(ProductAdditionalInfoComponent.prototype, "article", {
2263
2454
  get: function () {
2264
- return this._settings;
2455
+ return this._article;
2265
2456
  },
2266
2457
  set: function (value) {
2458
+ var _this = this;
2267
2459
  if (value) {
2268
- var settings = void 0;
2269
- if (typeof value === 'string') {
2270
- settings = JSON.parse(value);
2271
- }
2272
- else {
2273
- settings = value;
2274
- }
2275
- this._settingsService.createSettingsFromObject(settings);
2276
- // this._initConnection(settings);
2460
+ this._article = value;
2461
+ this._buildInfo().then(function () {
2462
+ _this._changeDetector.detectChanges();
2463
+ });
2277
2464
  }
2278
2465
  },
2279
2466
  enumerable: true,
2280
2467
  configurable: true
2281
2468
  });
2282
- IoneProductComponent.prototype.ngOnChanges = function (changes) {
2283
- this._changeDetector.detectChanges();
2284
- };
2285
- IoneProductComponent.prototype.ngOnDestroy = function () {
2286
- this._subs.forEach(function (s) { return s.unsubscribe(); });
2287
- };
2288
- IoneProductComponent.prototype._handleSettingsLoaded = function (loaded) {
2289
- if (loaded) {
2290
- this.upAndLoaded = true;
2291
- this._initConnection();
2292
- }
2469
+ ProductAdditionalInfoComponent.prototype.ngOnInit = function () {
2293
2470
  };
2294
- IoneProductComponent.prototype._handleAnswerInfoReceived = function (info) {
2295
- this.onArticleInfoReceived.next(info);
2471
+ ProductAdditionalInfoComponent.prototype._getTextsSuperArticle = function () {
2472
+ return __awaiter(this, void 0, void 0, function () {
2473
+ var _this = this;
2474
+ return __generator(this, function (_a) {
2475
+ return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
2476
+ var texts, mainArticle;
2477
+ var _this = this;
2478
+ return __generator(this, function (_a) {
2479
+ switch (_a.label) {
2480
+ case 0:
2481
+ texts = [];
2482
+ if (!this.article.superArticleNr) return [3 /*break*/, 4];
2483
+ mainArticle = void 0;
2484
+ if (!this._superArticles.has(this.article.superArticleNr)) return [3 /*break*/, 1];
2485
+ mainArticle = this._superArticles.get(this.article.superArticleNr);
2486
+ return [3 /*break*/, 3];
2487
+ case 1: return [4 /*yield*/, this._connectorService.getSuperArticle(this.article.superArticleNr)];
2488
+ case 2:
2489
+ mainArticle = _a.sent();
2490
+ this._superArticles.set(this.article.superArticleNr, mainArticle);
2491
+ _a.label = 3;
2492
+ case 3:
2493
+ mainArticle.texts.forEach(function (txt) {
2494
+ if (BitUtils.IsFullDescription(txt.publication)) {
2495
+ var safeTxt = _this._sanitizer.sanitize(core.SecurityContext.HTML, txt.text);
2496
+ texts.push(safeTxt);
2497
+ }
2498
+ });
2499
+ resolve(texts);
2500
+ return [3 /*break*/, 5];
2501
+ case 4:
2502
+ resolve(texts);
2503
+ _a.label = 5;
2504
+ case 5: return [2 /*return*/];
2505
+ }
2506
+ });
2507
+ }); })];
2508
+ });
2509
+ });
2296
2510
  };
2297
- // we need to prepare the settings before we can use it for the 3d configurator bundle
2298
- IoneProductComponent.prototype._initConnection = function () {
2511
+ ProductAdditionalInfoComponent.prototype._prepareArticleTexts = function () {
2299
2512
  return __awaiter(this, void 0, void 0, function () {
2513
+ var texts;
2514
+ var _a;
2300
2515
  var _this = this;
2516
+ return __generator(this, function (_b) {
2517
+ switch (_b.label) {
2518
+ case 0: return [4 /*yield*/, this._getTextsSuperArticle()];
2519
+ case 1:
2520
+ texts = _b.sent();
2521
+ if (texts.length > 0) {
2522
+ (_a = this.textParts).push.apply(_a, __spread(texts));
2523
+ }
2524
+ if (this.article.texts) {
2525
+ this.article.texts.forEach(function (txt) {
2526
+ if (BitUtils.IsFullDescription(txt.publication)) {
2527
+ var safeTxt = _this._sanitizer.sanitize(core.SecurityContext.HTML, txt.text);
2528
+ _this.textParts.push(safeTxt);
2529
+ }
2530
+ });
2531
+ }
2532
+ return [2 /*return*/];
2533
+ }
2534
+ });
2535
+ });
2536
+ };
2537
+ ProductAdditionalInfoComponent.prototype._buildInfo = function () {
2538
+ return __awaiter(this, void 0, void 0, function () {
2301
2539
  return __generator(this, function (_a) {
2302
- this._ione.initDefaultDevelopTestConnection();
2303
- // settingsToUse.session = this._ione.connector.connector.session;
2304
- setTimeout(function () {
2305
- _this._changeDetector.detectChanges();
2306
- });
2307
- return [2 /*return*/];
2540
+ switch (_a.label) {
2541
+ case 0:
2542
+ this.textParts.length = 0;
2543
+ return [4 /*yield*/, this._prepareArticleTexts()];
2544
+ case 1:
2545
+ _a.sent();
2546
+ if (this.textParts.length === 0) {
2547
+ if (this.article.additionalDescription) {
2548
+ this.textParts.push(this.article.additionalDescription);
2549
+ }
2550
+ else if (this.article.description) {
2551
+ this.textParts.push(this.article.description);
2552
+ }
2553
+ }
2554
+ return [2 /*return*/];
2555
+ }
2308
2556
  });
2309
2557
  });
2310
2558
  };
2311
- IoneProductComponent.ctorParameters = function () { return [
2312
- { type: DictionaryService },
2313
- { type: JsonUtilsService },
2314
- { type: ProductConnectorService },
2315
- { type: core.ChangeDetectorRef },
2316
- { type: ProductEventService },
2317
- { type: ProductSettingsService }
2318
- ]; };
2319
- __decorate([
2320
- core.Input()
2321
- ], IoneProductComponent.prototype, "sku", void 0);
2322
- __decorate([
2323
- core.Input()
2324
- ], IoneProductComponent.prototype, "settings", null);
2325
- __decorate([
2326
- core.Output()
2327
- ], IoneProductComponent.prototype, "onAddToCart", void 0);
2328
- __decorate([
2329
- core.Output()
2330
- ], IoneProductComponent.prototype, "forceRenderImage", void 0);
2331
- __decorate([
2332
- core.Output()
2333
- ], IoneProductComponent.prototype, "onAlternativeClick", void 0);
2334
- __decorate([
2335
- core.Output()
2336
- ], IoneProductComponent.prototype, "onArticleInfoReceived", void 0);
2337
- __decorate([
2338
- core.Output()
2339
- ], IoneProductComponent.prototype, "onArticleReceived", void 0);
2559
+ ProductAdditionalInfoComponent.ctorParameters = function () { return [
2560
+ { type: platformBrowser.DomSanitizer },
2561
+ { type: ProductConnectorService },
2562
+ { type: core.ChangeDetectorRef }
2563
+ ]; };
2340
2564
  __decorate([
2341
- core.Output()
2342
- ], IoneProductComponent.prototype, "onSelectionsReceived", void 0);
2565
+ core.Input()
2566
+ ], ProductAdditionalInfoComponent.prototype, "article", null);
2343
2567
  __decorate([
2344
- core.Output()
2345
- ], IoneProductComponent.prototype, "onAddToQuote", void 0);
2346
- IoneProductComponent = __decorate([
2568
+ core.Input()
2569
+ ], ProductAdditionalInfoComponent.prototype, "showLabel", void 0);
2570
+ ProductAdditionalInfoComponent = __decorate([
2347
2571
  core.Component({
2348
- selector: 'app-ione-product',
2349
- template: "<app-product-page *ngIf=\"upAndLoaded\" [sku]=\"sku\"\n></app-product-page>\n",
2350
- encapsulation: core.ViewEncapsulation.Emulated,
2351
- styles: [""]
2572
+ selector: 'app-product-additional-info',
2573
+ template: "<h3 *ngIf=\"showLabel\" [textContent]=\"'ADDITIONAL_DATA' | localize\"></h3>\n<ng-container *ngIf=\"textParts && textParts.length > 0\">\n <div class=\"additional-info-parts\" *ngFor=\"let text of textParts\" [innerHTML]=\"text\"></div>\n</ng-container>\n",
2574
+ styles: [":host{display:block}:host .additional-info-parts{margin-bottom:20px;line-height:190%;color:#22313c;font-size:13px}:host ::ng-deep p{line-height:190%;margin:15px 0}:host ::ng-deep font{font-family:iOneMontserrat}:host .additional-info-parts>:first-child{margin-top:0}:host .additional-info-parts>:last-child{margin-bottom:0}"]
2352
2575
  })
2353
- ], IoneProductComponent);
2354
- return IoneProductComponent;
2576
+ ], ProductAdditionalInfoComponent);
2577
+ return ProductAdditionalInfoComponent;
2355
2578
  }());
2356
2579
 
2357
- var ProductAdditionalDescriptionComponent = /** @class */ (function () {
2358
- function ProductAdditionalDescriptionComponent(_appEventService) {
2359
- this._appEventService = _appEventService;
2580
+ var propertyMap = new Map([
2581
+ ['articleNr', 'ARTICLE_NUMBER'],
2582
+ ['catExtra', 'CATEGORY'],
2583
+ ['catType', 'CATEGORY_TYPE'],
2584
+ ['description', 'DESCRIPTION'],
2585
+ ['material', 'MATERIAL'],
2586
+ ['title', 'TITLE'],
2587
+ ['turnOverGroup', 'TURNOVERGROUP'],
2588
+ ['height', 'HEIGHT'],
2589
+ ['width', 'WIDTH']
2590
+ ]);
2591
+ var ProductPropertiesComponent = /** @class */ (function () {
2592
+ function ProductPropertiesComponent() {
2593
+ this.showLabel = false;
2594
+ this.properties = [];
2360
2595
  }
2361
- Object.defineProperty(ProductAdditionalDescriptionComponent.prototype, "article", {
2596
+ Object.defineProperty(ProductPropertiesComponent.prototype, "article", {
2362
2597
  get: function () {
2363
2598
  return this._article;
2364
2599
  },
2365
2600
  set: function (value) {
2366
2601
  this._article = value;
2367
- if (this._article) {
2368
- this.description = this.article.additionalDescription;
2369
- this._prepareDescription();
2370
- }
2602
+ this._prepareProperties();
2371
2603
  },
2372
2604
  enumerable: true,
2373
2605
  configurable: true
2374
2606
  });
2375
- ProductAdditionalDescriptionComponent.prototype.ngOnInit = function () {
2376
- };
2377
- ProductAdditionalDescriptionComponent.prototype.onReadMore = function () {
2378
- this._appEventService.onUpdateProductInfoTab.next(0);
2607
+ ProductPropertiesComponent.prototype.ngOnInit = function () {
2379
2608
  };
2380
- ProductAdditionalDescriptionComponent.prototype._prepareDescription = function () {
2609
+ ProductPropertiesComponent.prototype._prepareProperties = function () {
2381
2610
  var _this = this;
2382
- this.description = '';
2383
- if (this.article.texts && this.article.texts.length > 0) {
2384
- this.article.texts.forEach(function (txt) {
2385
- if (BitUtils.IsShortDescription(txt.publication)) {
2386
- _this.description += txt.text;
2387
- }
2388
- });
2389
- this.description = this.description.replace(/<[^>]*>?/gm, '');
2390
- if (this.description.length > 250) {
2391
- this.description = this.description.substr(0, 250) + ' [..]';
2392
- }
2611
+ this.properties.length = 0;
2612
+ if (!this._article) {
2613
+ return;
2393
2614
  }
2615
+ propertyMap.forEach(function (value, key) {
2616
+ if (_this.article.hasOwnProperty(key)) {
2617
+ _this.properties.push({ key: value, value: _this.article[key] });
2618
+ }
2619
+ });
2394
2620
  };
2395
- ProductAdditionalDescriptionComponent.ctorParameters = function () { return [
2396
- { type: ProductEventService }
2397
- ]; };
2398
2621
  __decorate([
2399
2622
  core.Input()
2400
- ], ProductAdditionalDescriptionComponent.prototype, "article", null);
2401
- ProductAdditionalDescriptionComponent = __decorate([
2623
+ ], ProductPropertiesComponent.prototype, "article", null);
2624
+ __decorate([
2625
+ core.Input()
2626
+ ], ProductPropertiesComponent.prototype, "showLabel", void 0);
2627
+ ProductPropertiesComponent = __decorate([
2402
2628
  core.Component({
2403
- selector: 'app-product-additional-description',
2404
- template: "<ng-container *ngIf=\"description !== ''\">\n <div class=\"pd-additional-description\">\n <p [innerHTML]=\"description\"></p>\n <button class=\"pd-read-more-btn\" [textContent]=\"'READ_MORE' | localize\" (click)=\"onReadMore()\"></button>\n </div>\n</ng-container>\n",
2405
- styles: [":host{display:block;padding-top:0!important}:host :focus{outline:0!important}:host .pd-additional-description{line-height:190%;color:#22313c;font-size:13px}:host .pd-read-more-btn{color:#2b60a7;border:none;background:0 0;cursor:pointer;text-decoration:underline;font-family:iOneMontserrat}:host .pd-read-more-btn:hover{color:#74b77f}@media screen and (max-width:650px){:host .pd-additional-description{font-size:12px}}"]
2629
+ selector: 'app-product-properties',
2630
+ template: "<div class=\"article-properties-wrapper\">\n <h3 *ngIf=\"showLabel\" [textContent]=\"'PROPERTIES' | localize\"></h3>\n <ng-container *ngFor=\"let property of properties\">\n <div class=\"article-property\">\n <div class=\"article-property-key\" [textContent]=\"property.key | localize\"></div>\n <div class=\"article-property-value\" [textContent]=\"property.value\"></div>\n </div>\n </ng-container>\n</div>\n",
2631
+ styles: [":host{display:block}.article-properties-wrapper{display:flex;flex-direction:column}.article-property{display:flex;flex-direction:row;border-bottom:1px solid #f6f5f4;padding:11px 0;font-size:13px}.article-property:first-child{border-top:1px solid #f6f5f4}.article-property-key{flex-basis:200px;flex-shrink:0;color:#5b6875}@media screen and (max-width:450px){.article-property-key{flex-basis:130px}}"]
2406
2632
  })
2407
- ], ProductAdditionalDescriptionComponent);
2408
- return ProductAdditionalDescriptionComponent;
2633
+ ], ProductPropertiesComponent);
2634
+ return ProductPropertiesComponent;
2409
2635
  }());
2410
2636
 
2411
- var ProductInfoTabsComponent = /** @class */ (function () {
2412
- function ProductInfoTabsComponent(_appEventService) {
2413
- var _this = this;
2414
- this._appEventService = _appEventService;
2415
- this.activeTabHeight = 0;
2416
- this.tabs = [];
2417
- this._subs = [];
2418
- this._subs.push(this._appEventService.onUpdateProductInfoTab.subscribe(function (index) {
2419
- _this.updateTab(index);
2420
- _this.tabContent.nativeElement.scrollIntoView({ behavior: 'smooth' });
2421
- }));
2637
+ var ProductSymbolsComponent = /** @class */ (function () {
2638
+ function ProductSymbolsComponent() {
2639
+ this.symbolStrings = [];
2422
2640
  }
2423
- Object.defineProperty(ProductInfoTabsComponent.prototype, "article", {
2641
+ Object.defineProperty(ProductSymbolsComponent.prototype, "symbols", {
2642
+ get: function () {
2643
+ return this._symbols;
2644
+ },
2424
2645
  set: function (value) {
2425
- if (value) {
2426
- this.articleObject = value;
2427
- this._setupTabs();
2428
- this.updateTab(0);
2646
+ this._symbols = value;
2647
+ if (this._symbols && this._symbols.hasOwnProperty('fontCode')) {
2648
+ this._className = this._symbols['fontCode'] === 'VLOER' ? 'floor' : (this._className === 'WAS' ? 'ginetex' : '');
2649
+ }
2650
+ if (this._symbols && this._symbols.hasOwnProperty('symbolString')) {
2651
+ for (var i = 0; i < this._symbols['symbolString'].length; i++) {
2652
+ this.symbolStrings.push(this._symbols['symbolString'][i]);
2653
+ }
2429
2654
  }
2430
2655
  },
2431
2656
  enumerable: true,
2432
2657
  configurable: true
2433
2658
  });
2434
- ProductInfoTabsComponent.prototype.ngOnDestroy = function () {
2435
- this._subs.forEach(function (s) { return s.unsubscribe(); });
2436
- };
2437
- ProductInfoTabsComponent.prototype.updateTab = function (tabIndex) {
2438
- this.activeTab = tabIndex;
2439
- this.updateHeight(tabIndex);
2440
- };
2441
- ProductInfoTabsComponent.prototype.updateHeight = function (tabIndex) {
2442
- if (this.tabContent.nativeElement.children.length > 0) {
2443
- if (this.tabContent.nativeElement.children[tabIndex] !== undefined) {
2444
- this.activeTabHeight = this.tabContent.nativeElement.children[tabIndex].offsetHeight;
2445
- }
2446
- }
2447
- };
2448
- ProductInfoTabsComponent.prototype._setupTabs = function () {
2449
- this.tabs.push({ title: 'DESCRIPTION' });
2450
- this.tabs.push({ title: 'FEATURES' });
2451
- if (this.articleObject.documents !== undefined && this.articleObject.documents.length > 0) {
2452
- this.tabs.push({ title: 'DOWNLOADS' });
2453
- }
2454
- if (this.articleObject.symbols !== undefined && this.articleObject.symbols.length > 0) {
2455
- this.tabs.push({ title: 'SYMBOLS' });
2456
- }
2659
+ ProductSymbolsComponent.prototype.ngOnInit = function () {
2457
2660
  };
2458
- ProductInfoTabsComponent.ctorParameters = function () { return [
2459
- { type: ProductEventService }
2460
- ]; };
2461
- __decorate([
2462
- core.ViewChild('tabContent')
2463
- ], ProductInfoTabsComponent.prototype, "tabContent", void 0);
2464
2661
  __decorate([
2465
2662
  core.Input()
2466
- ], ProductInfoTabsComponent.prototype, "article", null);
2467
- ProductInfoTabsComponent = __decorate([
2663
+ ], ProductSymbolsComponent.prototype, "symbols", null);
2664
+ __decorate([
2665
+ core.HostBinding('class')
2666
+ ], ProductSymbolsComponent.prototype, "_className", void 0);
2667
+ ProductSymbolsComponent = __decorate([
2468
2668
  core.Component({
2469
- selector: 'app-product-info-tabs',
2470
- template: "<div class=\"tab-container\">\r\n <div class=\"tab-header\">\r\n <button *ngFor=\"let tab of tabs; let i = index\" class=\"tab-header-button\" [class.active]=\"activeTab === i\" [textContent]=\"tab.title | localize\" (click)=\"updateTab(i)\"></button>\r\n </div>\r\n <div class=\"tab-content\" #tabContent [style.height.px]=\"(activeTabHeight > 0 ? activeTabHeight : '')\">\r\n <div class=\"tab-content-item\" *ngFor=\"let tab of tabs; let i = index\" [class.active]=\"activeTab === i\">\r\n <ng-container *ngIf=\"i === 0\">\r\n <app-product-additional-info class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-additional-info>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 1\">\r\n <app-product-properties class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-properties>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 2\">\r\n <app-product-documents [showLabel]=\"false\" class=\"\" *ngIf=\"articleObject?.documents && articleObject?.documents.length > 0\" [documents]=\"articleObject?.documents\"></app-product-documents>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 3\">\r\n <app-product-symbols class=\"\" *ngIf=\"articleObject?.symbols && articleObject?.symbols.length > 0\" [symbols]=\"articleObject?.symbols\"></app-product-symbols>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n",
2471
- styles: [":focus{outline:0}:host .tab-header{border-bottom:3px solid #f6f5f4;margin:0 0 30px}:host .tab-header .tab-header-button{background:0 0;border:none;border-bottom:3px solid transparent;line-height:20px;padding:15px 20px;cursor:pointer;font-family:iOneMontserrat;color:#22313c;font-weight:700;margin:0 0 -3px;opacity:.5}:host .tab-header .tab-header-button:hover{opacity:1}:host .tab-header .tab-header-button.active{opacity:1;border-color:#74b77f}:host .tab-content{padding:0 20px 30px;margin:0 0 20px;border-bottom:2px solid #f6f5f4;transition:.2s ease-in-out;position:relative}:host .tab-content .tab-content-item{opacity:0;position:absolute;left:0;top:0;visibility:hidden;width:100%}:host .tab-content .tab-content-item.active{opacity:1;visibility:visible;position:static}@media screen and (max-width:650px){:host .tab-content{padding:0 10px 15px}}@media screen and (max-width:450px){:host .tab-header{display:flex}:host .tab-header .tab-header-button{width:100%;padding:10px;font-size:11px}}"]
2472
- })
2473
- ], ProductInfoTabsComponent);
2474
- return ProductInfoTabsComponent;
2475
- }());
2476
-
2477
- var ProductInitializerService = /** @class */ (function () {
2478
- function ProductInitializerService(_settingsService) {
2479
- this._settingsService = _settingsService;
2480
- }
2481
- ProductInitializerService.prototype.initializeApp = function () {
2482
- return __awaiter(this, void 0, void 0, function () {
2483
- return __generator(this, function (_a) {
2484
- return [2 /*return*/, this._settingsService.initializeSettings()];
2485
- });
2486
- });
2487
- };
2488
- ProductInitializerService.ctorParameters = function () { return [
2489
- { type: ProductSettingsService }
2490
- ]; };
2491
- ProductInitializerService.ɵprov = core.ɵɵdefineInjectable({ factory: function ProductInitializerService_Factory() { return new ProductInitializerService(core.ɵɵinject(ProductSettingsService)); }, token: ProductInitializerService, providedIn: "root" });
2492
- ProductInitializerService = __decorate([
2493
- core.Injectable({
2494
- providedIn: 'root',
2669
+ selector: 'app-product-symbols',
2670
+ template: "<div *ngIf=\"symbols && symbols.length > 0\">\n <app-header [label]=\"'SYMBOLS' | localize\" [amount]=\"symbols?.length\"></app-header>\n <co-scroll-container>\n <co-tile small noImagePlaceholder *ngFor=\"let symbol of symbolStrings\">\n <ng-container tile-over-image>\n <div class=\"symbol\" [textContent]=\"symbol\"></div>\n </ng-container>\n <ng-container tile-extra-bottom-content>\n <div class=\"symbol-name\" [textContent]=\"'Wat moet hier?'\"></div>\n </ng-container>\n </co-tile>\n </co-scroll-container>\n</div>\n",
2671
+ styles: [":host{display:block}:host.floor .symbol{font-family:iOneFloorsymbols}:host.ginetex .symbol{font-family:iOneGinetexsymbols}.symbol{font-size:100px}"]
2495
2672
  })
2496
- ], ProductInitializerService);
2497
- return ProductInitializerService;
2673
+ ], ProductSymbolsComponent);
2674
+ return ProductSymbolsComponent;
2498
2675
  }());
2499
2676
 
2500
- function initializeApp(context) {
2501
- var x = function () { return context.initializeApp(); };
2502
- return x;
2503
- }
2504
- var IoneProductModule = /** @class */ (function () {
2505
- function IoneProductModule() {
2677
+ var ProductPageModule = /** @class */ (function () {
2678
+ function ProductPageModule() {
2506
2679
  }
2507
- IoneProductModule = __decorate([
2680
+ ProductPageModule = __decorate([
2508
2681
  core.NgModule({
2509
2682
  imports: [
2510
- // BrowserAnimationsModule,
2511
2683
  common.CommonModule,
2512
- corecomponents.ButtonModule,
2513
2684
  corecomponents.IconModule,
2685
+ corecomponents.LoaderModule,
2686
+ PipeModule,
2514
2687
  corecomponents.NumberPickerModule,
2688
+ corecomponents.ButtonModule,
2689
+ corecomponents.PriceDisplayPipeModule,
2515
2690
  corecomponents.InputTextModule,
2516
2691
  corecomponents.FilesUploadModule,
2517
- corecomponents.LoaderModule,
2518
2692
  corecomponents.ScrollContainerModule,
2519
2693
  corecomponents.TileModule,
2520
2694
  corecomponents.LevelIndicatorModule,
2521
- corecomponents.PriceDisplayPipeModule,
2522
- corecomponents.ArticleTileModule
2695
+ corecomponents.ArticleTileModule,
2523
2696
  ],
2524
2697
  schemas: [core.CUSTOM_ELEMENTS_SCHEMA],
2525
2698
  declarations: [
2526
- IoneProductComponent,
2527
2699
  ProductPageComponent,
2700
+ ProductSelectorTypeComponent,
2528
2701
  ImageCarouselComponent,
2529
2702
  ProductDescriptionComponent,
2530
- ProductDocumentsComponent,
2703
+ ProductAdditionalDescriptionComponent,
2704
+ ProductPriceComponent,
2705
+ ProductAddtocartComponent,
2531
2706
  ProductRelatedComponent,
2707
+ ProductStockComponent,
2708
+ ProductDeliveryComponent,
2709
+ ProductInfoTabsComponent,
2710
+ ProductDocumentsComponent,
2532
2711
  HeaderComponent,
2533
2712
  ProductInfoComponent,
2534
2713
  ProductAdditionalInfoComponent,
2535
2714
  ProductPropertiesComponent,
2536
- ProductDeliveryComponent,
2537
- ProductStockComponent,
2538
- ProductSymbolsComponent,
2539
- ProductPriceComponent,
2540
- ProductAddtocartComponent,
2541
- ProductInfoTabsComponent,
2542
- LocalizePipe,
2543
- ProductSelectorTypeComponent,
2544
- ProductAdditionalDescriptionComponent
2715
+ ProductSymbolsComponent
2716
+ ],
2717
+ exports: [ProductPageComponent]
2718
+ })
2719
+ ], ProductPageModule);
2720
+ return ProductPageModule;
2721
+ }());
2722
+
2723
+ var ProductExternalSourceModule = /** @class */ (function () {
2724
+ function ProductExternalSourceModule() {
2725
+ }
2726
+ ProductExternalSourceModule = __decorate([
2727
+ core.NgModule({
2728
+ imports: [
2729
+ common.CommonModule,
2730
+ ProductPageModule
2731
+ ],
2732
+ declarations: [
2733
+ ProductExternalSourceComponent
2734
+ ],
2735
+ exports: [
2736
+ ProductExternalSourceComponent
2737
+ ]
2738
+ })
2739
+ ], ProductExternalSourceModule);
2740
+ return ProductExternalSourceModule;
2741
+ }());
2742
+
2743
+ function initializeApp(context) {
2744
+ var x = function () { return context.initializeApp(); };
2745
+ return x;
2746
+ }
2747
+ var IoneProductModule = /** @class */ (function () {
2748
+ function IoneProductModule() {
2749
+ }
2750
+ IoneProductModule = __decorate([
2751
+ core.NgModule({
2752
+ imports: [
2753
+ // BrowserAnimationsModule,
2754
+ common.CommonModule,
2755
+ ProductExternalSourceModule,
2756
+ ProductPageModule
2757
+ ],
2758
+ declarations: [
2759
+ IoneProductComponent
2545
2760
  ],
2546
2761
  entryComponents: [
2547
2762
  IoneProductComponent
2548
2763
  ],
2549
2764
  providers: [
2550
- ProductSettingsService,
2551
- ProductConnectorService,
2552
- ProductConnectorAdapterService,
2553
- IconCacheService,
2554
2765
  {
2555
2766
  provide: core.APP_INITIALIZER,
2556
2767
  useFactory: initializeApp,
@@ -2568,36 +2779,39 @@
2568
2779
  }());
2569
2780
 
2570
2781
  exports.IoneProductModule = IoneProductModule;
2782
+ exports.ProductExternalSourceComponent = ProductExternalSourceComponent;
2783
+ exports.ProductExternalSourceModule = ProductExternalSourceModule;
2571
2784
  exports.Version = Version;
2572
2785
  exports.initializeApp = initializeApp;
2573
- exports.ɵa = IoneProductComponent;
2574
- exports.ɵb = DictionaryService;
2575
- exports.ɵba = ProductAdditionalDescriptionComponent;
2576
- exports.ɵbb = ProductInitializerService;
2577
- exports.ɵc = JsonUtilsService;
2578
- exports.ɵd = ProductConnectorService;
2579
- exports.ɵe = ProductConnectorAdapterService;
2580
- exports.ɵf = ProductSettingsService;
2581
- exports.ɵg = ProductEventService;
2582
- exports.ɵh = ProductPageComponent;
2583
- exports.ɵi = IconCacheService;
2584
- exports.ɵj = ImageCarouselComponent;
2585
- exports.ɵk = ProductDescriptionComponent;
2586
- exports.ɵl = ProductDocumentsComponent;
2587
- exports.ɵm = ProductRelatedComponent;
2588
- exports.ɵn = HeaderComponent;
2589
- exports.ɵo = ProductInfoComponent;
2590
- exports.ɵp = ProductAdditionalInfoComponent;
2591
- exports.ɵq = ProductModuleService;
2592
- exports.ɵr = ProductPropertiesComponent;
2593
- exports.ɵs = ProductDeliveryComponent;
2594
- exports.ɵt = LocalizePipe;
2595
- exports.ɵu = ProductStockComponent;
2596
- exports.ɵv = ProductSymbolsComponent;
2597
- exports.ɵw = ProductPriceComponent;
2598
- exports.ɵx = ProductAddtocartComponent;
2599
- exports.ɵy = ProductInfoTabsComponent;
2600
- exports.ɵz = ProductSelectorTypeComponent;
2786
+ exports.ɵa = ProductPageModule;
2787
+ exports.ɵb = PipeModule;
2788
+ exports.ɵba = ProductSymbolsComponent;
2789
+ exports.ɵbb = IoneProductComponent;
2790
+ exports.ɵbc = ProductInitializerService;
2791
+ exports.ɵc = LocalizePipe;
2792
+ exports.ɵd = DictionaryService;
2793
+ exports.ɵe = JsonUtilsService;
2794
+ exports.ɵf = ProductPageComponent;
2795
+ exports.ɵg = ProductConnectorService;
2796
+ exports.ɵh = ProductConnectorAdapterService;
2797
+ exports.ɵi = ProductSettingsService;
2798
+ exports.ɵj = IconCacheService;
2799
+ exports.ɵk = ProductEventService;
2800
+ exports.ɵl = ProductSelectorTypeComponent;
2801
+ exports.ɵm = ImageCarouselComponent;
2802
+ exports.ɵn = ProductDescriptionComponent;
2803
+ exports.ɵo = ProductAdditionalDescriptionComponent;
2804
+ exports.ɵp = ProductPriceComponent;
2805
+ exports.ɵq = ProductAddtocartComponent;
2806
+ exports.ɵr = ProductRelatedComponent;
2807
+ exports.ɵs = ProductStockComponent;
2808
+ exports.ɵt = ProductDeliveryComponent;
2809
+ exports.ɵu = ProductInfoTabsComponent;
2810
+ exports.ɵv = ProductDocumentsComponent;
2811
+ exports.ɵw = HeaderComponent;
2812
+ exports.ɵx = ProductInfoComponent;
2813
+ exports.ɵy = ProductAdditionalInfoComponent;
2814
+ exports.ɵz = ProductPropertiesComponent;
2601
2815
 
2602
2816
  Object.defineProperty(exports, '__esModule', { value: true });
2603
2817