@colijnit/product 258.1.4 → 258.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/bundle/service/local-storage.service.d.ts +14 -0
- package/app/components/product-addtocart/product-addtocart.component.d.ts +1 -4
- package/app/ione-product.component.d.ts +6 -1
- package/app/service/product-connector-adapter.service.d.ts +0 -1
- package/app/service/product-connector.service.d.ts +0 -1
- package/bundles/colijnit-product.umd.js +566 -524
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.d.ts +1 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/bundle/service/local-storage.service.js +37 -0
- package/esm2015/app/components/product-addtocart/product-addtocart.component.js +6 -24
- package/esm2015/app/components/product-page/product-page.component.js +3 -4
- package/esm2015/app/ione-product.component.js +36 -5
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-connector-adapter.service.js +1 -9
- package/esm2015/app/service/product-connector.service.js +1 -4
- package/esm2015/colijnit-product.js +2 -1
- package/fesm2015/colijnit-product.js +287 -251
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.
|
|
5
|
-
})(this, (function (exports, i0, rxjs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@colijnit/ioneconnector/build/model/options'), require('@colijnit/articleapi/build/model/article-full-object'), require('@colijnit/articleapi/build/model/super-article'), require('@colijnit/articleapi/build/articles'), require('@colijnit/articleapi/build/model/delivery-prognosis'), require('@colijnit/articleapi/build/model/document-content'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@colijnit/transactionapi/build/transaction'), require('@colijnit/mainapi'), require('@colijnit/transactionapi/build/model/transaction-info-response.bo'), require('@colijnit/articleapi/build/model/article-list-object-extended.bo'), require('@angular/common/http'), require('@colijnit/ioneconnector/build/utils/string-utils'), require('@angular/common'), require('@angular/animations'), require('@angular/platform-browser'), require('@colijnit/corecomponents'), require('@colijnit/mainapi/build/model/co-document'), require('@colijnit/articleapi/build/model/configurator-statistics-environment'), require('@colijnit/corecomponents_v12')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@colijnit/product', ['exports', '@angular/core', 'rxjs', '@colijnit/ioneconnector/build/model/options', '@colijnit/articleapi/build/model/article-full-object', '@colijnit/articleapi/build/model/super-article', '@colijnit/articleapi/build/articles', '@colijnit/articleapi/build/model/delivery-prognosis', '@colijnit/articleapi/build/model/document-content', '@colijnit/ioneconnector/build/service/business-object-factory', '@colijnit/transactionapi/build/transaction', '@colijnit/mainapi', '@colijnit/transactionapi/build/model/transaction-info-response.bo', '@colijnit/articleapi/build/model/article-list-object-extended.bo', '@angular/common/http', '@colijnit/ioneconnector/build/utils/string-utils', '@angular/common', '@angular/animations', '@angular/platform-browser', '@colijnit/corecomponents', '@colijnit/mainapi/build/model/co-document', '@colijnit/articleapi/build/model/configurator-statistics-environment', '@colijnit/corecomponents_v12'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.product = {}), global.ng.core, global.rxjs, global.options, global.articleFullObject, global.superArticle, global.articles, global.deliveryPrognosis, global.documentContent, global.businessObjectFactory, global.transaction, global.mainapi, global.transactionInfoResponse_bo, global.articleListObjectExtended_bo, global.ng.common.http, global.stringUtils, global.ng.common, global.ng.animations, global.ng.platformBrowser, global.corecomponents, global.coDocument, global.configuratorStatisticsEnvironment, global.corecomponents_v12));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, options, articleFullObject, superArticle, articles, deliveryPrognosis, documentContent, businessObjectFactory, transaction, mainapi, transactionInfoResponse_bo, articleListObjectExtended_bo, i1, stringUtils, common, animations, i1$1, corecomponents, coDocument, configuratorStatisticsEnvironment, corecomponents_v12) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
function Version() {
|
|
32
32
|
this.name = "@colijnit/product";
|
|
33
33
|
this.description = "Product detail page project for iOne";
|
|
34
|
-
this.symVer = "258.1.
|
|
35
|
-
this.publishDate = "
|
|
34
|
+
this.symVer = "258.1.5";
|
|
35
|
+
this.publishDate = "9-7-2025 14:07:55";
|
|
36
36
|
}
|
|
37
37
|
return Version;
|
|
38
38
|
}());
|
|
@@ -514,265 +514,6 @@
|
|
|
514
514
|
__disposeResources: __disposeResources,
|
|
515
515
|
};
|
|
516
516
|
|
|
517
|
-
var ProductEventService = /** @class */ (function () {
|
|
518
|
-
function ProductEventService() {
|
|
519
|
-
this.onAddToCart = new rxjs.Subject();
|
|
520
|
-
this.onAlternativeClick = new rxjs.Subject();
|
|
521
|
-
this.onAddToQuote = new rxjs.Subject();
|
|
522
|
-
this.onForceRenderImage = new rxjs.Subject();
|
|
523
|
-
this.onArticleReceived = new rxjs.Subject();
|
|
524
|
-
this.onSelectionsReceived = new rxjs.Subject();
|
|
525
|
-
this.onImageReceived = new rxjs.Subject();
|
|
526
|
-
this.onRenderStarted = new rxjs.Subject();
|
|
527
|
-
this.onRenderImageReceived = new rxjs.Subject();
|
|
528
|
-
this.onDraftRenderImageReceived = new rxjs.Subject();
|
|
529
|
-
this.onArticleInfoReceived = new rxjs.Subject();
|
|
530
|
-
this.onAnswersAvailable = new rxjs.Subject();
|
|
531
|
-
this.onReadyToRender = new rxjs.Subject();
|
|
532
|
-
this.onUpdateProductInfoTab = new rxjs.Subject();
|
|
533
|
-
this.errorMessage = new rxjs.Subject();
|
|
534
|
-
this.onGetRenderForRenderCarousel = new rxjs.Subject();
|
|
535
|
-
}
|
|
536
|
-
return ProductEventService;
|
|
537
|
-
}());
|
|
538
|
-
ProductEventService.decorators = [
|
|
539
|
-
{ type: i0.Directive },
|
|
540
|
-
{ type: i0.Injectable }
|
|
541
|
-
];
|
|
542
|
-
|
|
543
|
-
var JsonUtilsService = /** @class */ (function () {
|
|
544
|
-
function JsonUtilsService() {
|
|
545
|
-
}
|
|
546
|
-
JsonUtilsService.prototype.readJsonFile = function (filePath) {
|
|
547
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
548
|
-
var response, e_1;
|
|
549
|
-
return __generator(this, function (_a) {
|
|
550
|
-
switch (_a.label) {
|
|
551
|
-
case 0:
|
|
552
|
-
_a.trys.push([0, 2, , 3]);
|
|
553
|
-
return [4 /*yield*/, fetch(filePath)];
|
|
554
|
-
case 1:
|
|
555
|
-
response = _a.sent();
|
|
556
|
-
if (!response.ok) {
|
|
557
|
-
return [2 /*return*/, null];
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
return [2 /*return*/, response.json()];
|
|
561
|
-
}
|
|
562
|
-
return [3 /*break*/, 3];
|
|
563
|
-
case 2:
|
|
564
|
-
e_1 = _a.sent();
|
|
565
|
-
console.error('Error getting file:', e_1.message);
|
|
566
|
-
return [2 /*return*/, ''];
|
|
567
|
-
case 3: return [2 /*return*/];
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
});
|
|
571
|
-
};
|
|
572
|
-
return JsonUtilsService;
|
|
573
|
-
}());
|
|
574
|
-
JsonUtilsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
|
|
575
|
-
JsonUtilsService.decorators = [
|
|
576
|
-
{ type: i0.Injectable, args: [{
|
|
577
|
-
providedIn: 'root'
|
|
578
|
-
},] }
|
|
579
|
-
];
|
|
580
|
-
|
|
581
|
-
var LanguageCode;
|
|
582
|
-
(function (LanguageCode) {
|
|
583
|
-
LanguageCode["Dutch"] = "nl-NL";
|
|
584
|
-
LanguageCode["English"] = "en-GB";
|
|
585
|
-
LanguageCode["German"] = "de-DE";
|
|
586
|
-
LanguageCode["French"] = "fr-FR";
|
|
587
|
-
})(LanguageCode || (LanguageCode = {}));
|
|
588
|
-
|
|
589
|
-
var Dictionary = /** @class */ (function () {
|
|
590
|
-
function Dictionary() {
|
|
591
|
-
this.strings = {
|
|
592
|
-
"en": {
|
|
593
|
-
"ADDITIONAL_DATA": "Additional information",
|
|
594
|
-
"ALTERNATIVE_PRODUCTS": "Alternative products",
|
|
595
|
-
"ARTICLE_NUMBER": "Productnumber",
|
|
596
|
-
"AS_CONFIGURED": "As configured",
|
|
597
|
-
"CATEGORY": "Category",
|
|
598
|
-
"CATEGORY_TYPE": "Category type",
|
|
599
|
-
"CONFIGURE": "Configure",
|
|
600
|
-
"DELIVERY_TIME_PERIOD": "Delivery time",
|
|
601
|
-
"DESCRIPTION": "Description",
|
|
602
|
-
"DOCUMENTS": "Documents",
|
|
603
|
-
"DOWNLOADS": "Downloads",
|
|
604
|
-
"FEATURES": "Features",
|
|
605
|
-
"HEIGHT": "Height",
|
|
606
|
-
"MATERIAL": "Material",
|
|
607
|
-
"PRODUCT_IN_STOCK": "In stock",
|
|
608
|
-
"PRODUCT_LIMITED_STOCK": "Limited stock",
|
|
609
|
-
"PRODUCT_NOT_IN_STOCK": "Not in stock",
|
|
610
|
-
"PROPERTIES": "Characteristics",
|
|
611
|
-
"QUOTATION": "Quotation",
|
|
612
|
-
"READ_MORE": "Read more",
|
|
613
|
-
"RELATED_PRODUCTS": "Related products",
|
|
614
|
-
"SHOPPING_CART_IN": "In Shopping Cart",
|
|
615
|
-
"SHOW_IN": "Show in",
|
|
616
|
-
"STOCK": "Stock",
|
|
617
|
-
"SYMBOLS": "Symbols",
|
|
618
|
-
"TITLE": "Title",
|
|
619
|
-
"TURNOVERGROUP": "Turnover group",
|
|
620
|
-
"VARIANTS": "Variations",
|
|
621
|
-
"WIDTH": "Width",
|
|
622
|
-
"SUGGESTION": "Suggestion",
|
|
623
|
-
},
|
|
624
|
-
"nl": {
|
|
625
|
-
"ADDITIONAL_DATA": "Extra informatie",
|
|
626
|
-
"ALTERNATIVE_PRODUCTS": "Alternatieve producten",
|
|
627
|
-
"ARTICLE_NUMBER": "Artikel nummer",
|
|
628
|
-
"AS_CONFIGURED": "Zoals samengesteld",
|
|
629
|
-
"CATEGORY": "Categorie",
|
|
630
|
-
"CATEGORY_TYPE": "Categorie type",
|
|
631
|
-
"CONFIGURE": "Configureren",
|
|
632
|
-
"DELIVERY_TIME_PERIOD": "Levertijd",
|
|
633
|
-
"DESCRIPTION": "Omschrijving",
|
|
634
|
-
"DOCUMENTS": "Documenten",
|
|
635
|
-
"DOWNLOADS": "Downloads",
|
|
636
|
-
"FEATURES": "Kenmerken",
|
|
637
|
-
"HEIGHT": "Hoogte",
|
|
638
|
-
"MATERIAL": "Materiaal",
|
|
639
|
-
"PRODUCT_IN_STOCK": "Op voorraad",
|
|
640
|
-
"PRODUCT_LIMITED_STOCK": "Beperkt op voorraad",
|
|
641
|
-
"PRODUCT_NOT_IN_STOCK": "Niet op voorraad",
|
|
642
|
-
"PROPERTIES": "Eigenschappen",
|
|
643
|
-
"QUOTATION": "Quotatie",
|
|
644
|
-
"READ_MORE": "Lees meer",
|
|
645
|
-
"RELATED_PRODUCTS": "Gerelateerde producten",
|
|
646
|
-
"SHOPPING_CART_IN": "In winkelwagen",
|
|
647
|
-
"SHOW_IN": "Laat zien",
|
|
648
|
-
"STOCK": "Voorraad",
|
|
649
|
-
"SYMBOLS": "Symbolen",
|
|
650
|
-
"TITLE": "Titel",
|
|
651
|
-
"TURNOVERGROUP": "Omzetgroep",
|
|
652
|
-
"VARIANTS": "Varianten",
|
|
653
|
-
"WIDTH": "Breedte",
|
|
654
|
-
"SUGGESTION": "Suggesties bij",
|
|
655
|
-
},
|
|
656
|
-
"de": {
|
|
657
|
-
"ADDITIONAL_DATA": "Extra informatie",
|
|
658
|
-
"ALTERNATIVE_PRODUCTS": "Alternative Produkte",
|
|
659
|
-
"ARTICLE_NUMBER": "Artikelnummer",
|
|
660
|
-
"CATEGORY": "Kategorie",
|
|
661
|
-
"CATEGORY_TYPE": "Kategorietype",
|
|
662
|
-
"CONFIGURE": "Konfigurieren",
|
|
663
|
-
"DELIVERY_TIME_PERIOD": "Lieferzeit",
|
|
664
|
-
"DESCRIPTION": "Beschreibung",
|
|
665
|
-
"DOCUMENTS": "Dateien",
|
|
666
|
-
"DOWNLOADS": "Downloads",
|
|
667
|
-
"FEATURES": "Eigenschaften",
|
|
668
|
-
"HEIGHT": "Höhe",
|
|
669
|
-
"MATERIAL": "Material",
|
|
670
|
-
"PRODUCT_IN_STOCK": "Auf lager",
|
|
671
|
-
"PRODUCT_LIMITED_STOCK": "Begrentzt auf lager",
|
|
672
|
-
"PRODUCT_NOT_IN_STOCK": "Nicht auf lager",
|
|
673
|
-
"PROPERTIES": "Eigenschaften",
|
|
674
|
-
"QUOTATION": "Angebot",
|
|
675
|
-
"READ_MORE": "Lesen Sie mehr",
|
|
676
|
-
"RELATED_PRODUCTS": "Verwandte Produkte",
|
|
677
|
-
"SHOPPING_CART_IN": "Im Einkaufswagen",
|
|
678
|
-
"SHOW_IN": "Zeigen",
|
|
679
|
-
"STOCK": "Vorrat",
|
|
680
|
-
"SYMBOLS": "Symbole",
|
|
681
|
-
"TITLE": "Titulatur",
|
|
682
|
-
"TURNOVERGROUP": "Umsatzgruppe",
|
|
683
|
-
"VARIANTS": "Varianten",
|
|
684
|
-
"WIDTH": "Breite",
|
|
685
|
-
"SUGGESTION": "Suggesties bij",
|
|
686
|
-
}
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
return Dictionary;
|
|
690
|
-
}());
|
|
691
|
-
|
|
692
|
-
// The localization service, providing peers with text translation functionality.
|
|
693
|
-
var DictionaryService = /** @class */ (function () {
|
|
694
|
-
function DictionaryService(_http, _jsonUtils) {
|
|
695
|
-
this._http = _http;
|
|
696
|
-
this._jsonUtils = _jsonUtils;
|
|
697
|
-
this.dictionaryUrl = 'js/browser/res/dictionary/';
|
|
698
|
-
// private _dictionaryPromise: Map<LanguageCode, Promise<{ [key: string]: string }>> = new Map<LanguageCode, Promise<{ [key: string]: string }>>();
|
|
699
|
-
this._dictionaries = new Map();
|
|
700
|
-
// Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
|
|
701
|
-
this._placeholder = '|~';
|
|
702
|
-
}
|
|
703
|
-
Object.defineProperty(DictionaryService.prototype, "language", {
|
|
704
|
-
get: function () {
|
|
705
|
-
return this._language;
|
|
706
|
-
},
|
|
707
|
-
enumerable: false,
|
|
708
|
-
configurable: true
|
|
709
|
-
});
|
|
710
|
-
Object.defineProperty(DictionaryService.prototype, "rootUrl", {
|
|
711
|
-
set: function (value) {
|
|
712
|
-
this._rootUrl = value;
|
|
713
|
-
this._dictBasePath = this._rootUrl + '/' + this.dictionaryUrl;
|
|
714
|
-
},
|
|
715
|
-
enumerable: false,
|
|
716
|
-
configurable: true
|
|
717
|
-
});
|
|
718
|
-
// Loads the dictionary for given language in memory.
|
|
719
|
-
DictionaryService.prototype.setDictionary = function (language) {
|
|
720
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
721
|
-
var dictionary;
|
|
722
|
-
return __generator(this, function (_a) {
|
|
723
|
-
this._language = language || LanguageCode.Dutch;
|
|
724
|
-
if (!this._dictionaries.has(this._language)) {
|
|
725
|
-
dictionary = new Dictionary();
|
|
726
|
-
if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
|
|
727
|
-
this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
return [2 /*return*/];
|
|
731
|
-
});
|
|
732
|
-
});
|
|
733
|
-
};
|
|
734
|
-
/**
|
|
735
|
-
* Returns the localized text for the given dictionary key.
|
|
736
|
-
* @param {string} key
|
|
737
|
-
* @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
|
|
738
|
-
* @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
|
|
739
|
-
* @returns {string} The translated text for given dictionary key
|
|
740
|
-
*/
|
|
741
|
-
DictionaryService.prototype.get = function (key, upperCaseFirst) {
|
|
742
|
-
if (upperCaseFirst === void 0) { upperCaseFirst = true; }
|
|
743
|
-
var replacementTexts = [];
|
|
744
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
745
|
-
replacementTexts[_i - 2] = arguments[_i];
|
|
746
|
-
}
|
|
747
|
-
if (!stringUtils.StringUtils.IsStringWithLength(key)) {
|
|
748
|
-
return key || '';
|
|
749
|
-
}
|
|
750
|
-
var text = this._dictionaries.get(this.language)[key];
|
|
751
|
-
text = stringUtils.StringUtils.IsStringWithLength(text) ? text : key;
|
|
752
|
-
if (upperCaseFirst) {
|
|
753
|
-
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
754
|
-
}
|
|
755
|
-
else {
|
|
756
|
-
text = text.charAt(0).toLowerCase() + text.slice(1);
|
|
757
|
-
}
|
|
758
|
-
if (replacementTexts.length > 0) {
|
|
759
|
-
text = stringUtils.StringUtils.ReplaceOccurrencesIn.apply(stringUtils.StringUtils, __spreadArray([text, this._placeholder], __read(replacementTexts)));
|
|
760
|
-
}
|
|
761
|
-
return text;
|
|
762
|
-
};
|
|
763
|
-
return DictionaryService;
|
|
764
|
-
}());
|
|
765
|
-
DictionaryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(JsonUtilsService)); }, token: DictionaryService, providedIn: "root" });
|
|
766
|
-
DictionaryService.decorators = [
|
|
767
|
-
{ type: i0.Injectable, args: [{
|
|
768
|
-
providedIn: 'root'
|
|
769
|
-
},] }
|
|
770
|
-
];
|
|
771
|
-
DictionaryService.ctorParameters = function () { return [
|
|
772
|
-
{ type: i1.HttpClient },
|
|
773
|
-
{ type: JsonUtilsService }
|
|
774
|
-
]; };
|
|
775
|
-
|
|
776
517
|
var SettingsOptions = /** @class */ (function () {
|
|
777
518
|
function SettingsOptions() {
|
|
778
519
|
this.showStockStatus = false;
|
|
@@ -818,109 +559,31 @@
|
|
|
818
559
|
return ProductSettings;
|
|
819
560
|
}(options.Options));
|
|
820
561
|
|
|
821
|
-
var
|
|
822
|
-
function
|
|
823
|
-
this.
|
|
824
|
-
this.
|
|
825
|
-
this.
|
|
562
|
+
var ProductEventService = /** @class */ (function () {
|
|
563
|
+
function ProductEventService() {
|
|
564
|
+
this.onAddToCart = new rxjs.Subject();
|
|
565
|
+
this.onAlternativeClick = new rxjs.Subject();
|
|
566
|
+
this.onAddToQuote = new rxjs.Subject();
|
|
567
|
+
this.onForceRenderImage = new rxjs.Subject();
|
|
568
|
+
this.onArticleReceived = new rxjs.Subject();
|
|
569
|
+
this.onSelectionsReceived = new rxjs.Subject();
|
|
570
|
+
this.onImageReceived = new rxjs.Subject();
|
|
571
|
+
this.onRenderStarted = new rxjs.Subject();
|
|
572
|
+
this.onRenderImageReceived = new rxjs.Subject();
|
|
573
|
+
this.onDraftRenderImageReceived = new rxjs.Subject();
|
|
574
|
+
this.onArticleInfoReceived = new rxjs.Subject();
|
|
575
|
+
this.onAnswersAvailable = new rxjs.Subject();
|
|
576
|
+
this.onReadyToRender = new rxjs.Subject();
|
|
577
|
+
this.onUpdateProductInfoTab = new rxjs.Subject();
|
|
578
|
+
this.errorMessage = new rxjs.Subject();
|
|
579
|
+
this.onGetRenderForRenderCarousel = new rxjs.Subject();
|
|
826
580
|
}
|
|
827
|
-
|
|
828
|
-
get: function () {
|
|
829
|
-
return this._settings;
|
|
830
|
-
},
|
|
831
|
-
set: function (value) {
|
|
832
|
-
this._settings = value;
|
|
833
|
-
},
|
|
834
|
-
enumerable: false,
|
|
835
|
-
configurable: true
|
|
836
|
-
});
|
|
837
|
-
ProductSettingsService.prototype.initializeSettings = function (finish) {
|
|
838
|
-
if (finish === void 0) { finish = true; }
|
|
839
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
840
|
-
var jsonSettings;
|
|
841
|
-
return __generator(this, function (_a) {
|
|
842
|
-
switch (_a.label) {
|
|
843
|
-
case 0:
|
|
844
|
-
if (!(typeof settings === 'undefined')) return [3 /*break*/, 2];
|
|
845
|
-
return [4 /*yield*/, this._jsonUtilsService.readJsonFile('product-settings.json')];
|
|
846
|
-
case 1:
|
|
847
|
-
jsonSettings = _a.sent();
|
|
848
|
-
if (jsonSettings) {
|
|
849
|
-
this.settings = Object.assign(new ProductSettings(), jsonSettings);
|
|
850
|
-
this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
|
|
851
|
-
if (finish) {
|
|
852
|
-
this.settingsFinished();
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
return [3 /*break*/, 3];
|
|
856
|
-
case 2:
|
|
857
|
-
this.settings = Object.assign(new ProductSettings(), settings);
|
|
858
|
-
this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
|
|
859
|
-
if (finish) {
|
|
860
|
-
this.settingsFinished();
|
|
861
|
-
}
|
|
862
|
-
_a.label = 3;
|
|
863
|
-
case 3: return [2 /*return*/];
|
|
864
|
-
}
|
|
865
|
-
});
|
|
866
|
-
});
|
|
867
|
-
};
|
|
868
|
-
ProductSettingsService.prototype.createSettingsFromObject = function (obj) {
|
|
869
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
870
|
-
var ownOptions, ownRenderParameters;
|
|
871
|
-
return __generator(this, function (_a) {
|
|
872
|
-
if (!this.settings) {
|
|
873
|
-
this.settings = new ProductSettings();
|
|
874
|
-
}
|
|
875
|
-
ownOptions = Object.assign({}, this.settings.options);
|
|
876
|
-
ownRenderParameters = Object.assign({}, this.settings.renderParameters);
|
|
877
|
-
this.settings = Object.assign({}, this.settings, obj);
|
|
878
|
-
if (obj.renderParameters) {
|
|
879
|
-
this.settings.renderParameters = Object.assign({}, ownRenderParameters, obj.renderParameters);
|
|
880
|
-
}
|
|
881
|
-
if (obj.options) {
|
|
882
|
-
this.settings.options = Object.assign({}, ownOptions, obj.options);
|
|
883
|
-
}
|
|
884
|
-
if (obj.hasOwnProperty('assetPath')) {
|
|
885
|
-
this.settings.assetPath = obj['assetPath'];
|
|
886
|
-
if (this.settings.assetPath[this.settings.assetPath.length - 1] !== '/') {
|
|
887
|
-
this.settings.assetPath += '/';
|
|
888
|
-
}
|
|
889
|
-
this.settings.threeDAssetPath = this.settings.assetPath;
|
|
890
|
-
}
|
|
891
|
-
if (obj.hasOwnProperty('threeDAssetPath')) {
|
|
892
|
-
this.settings.threeDAssetPath = obj['threeDAssetPath'];
|
|
893
|
-
if (this.settings.threeDAssetPath[this.settings.threeDAssetPath.length - 1] !== '/') {
|
|
894
|
-
this.settings.threeDAssetPath += '/';
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
this.settingsFinished();
|
|
898
|
-
return [2 /*return*/];
|
|
899
|
-
});
|
|
900
|
-
});
|
|
901
|
-
};
|
|
902
|
-
ProductSettingsService.prototype.settingsFinished = function () {
|
|
903
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
904
|
-
return __generator(this, function (_a) {
|
|
905
|
-
switch (_a.label) {
|
|
906
|
-
case 0: return [4 /*yield*/, this._dictionaryService.setDictionary(this.settings.languageCode)];
|
|
907
|
-
case 1:
|
|
908
|
-
_a.sent();
|
|
909
|
-
this.settingsLoaded.next(true);
|
|
910
|
-
return [2 /*return*/];
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
});
|
|
914
|
-
};
|
|
915
|
-
return ProductSettingsService;
|
|
581
|
+
return ProductEventService;
|
|
916
582
|
}());
|
|
917
|
-
|
|
583
|
+
ProductEventService.decorators = [
|
|
584
|
+
{ type: i0.Directive },
|
|
918
585
|
{ type: i0.Injectable }
|
|
919
|
-
];
|
|
920
|
-
ProductSettingsService.ctorParameters = function () { return [
|
|
921
|
-
{ type: JsonUtilsService },
|
|
922
|
-
{ type: DictionaryService }
|
|
923
|
-
]; };
|
|
586
|
+
];
|
|
924
587
|
|
|
925
588
|
// 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.
|
|
926
589
|
// Only to be used by the IOneControllerService.
|
|
@@ -982,32 +645,121 @@
|
|
|
982
645
|
return this._boFactory.makeWithRawBackendData(articleListObjectExtended_bo.ArticleListObjectExtended, article);
|
|
983
646
|
}
|
|
984
647
|
};
|
|
985
|
-
ProductConnectorAdapterService.prototype.getDeliveryPrognosis = function (goodId, branchNr) {
|
|
648
|
+
ProductConnectorAdapterService.prototype.getDeliveryPrognosis = function (goodId, branchNr) {
|
|
649
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
650
|
+
var deliveryPrognosis;
|
|
651
|
+
return __generator(this, function (_a) {
|
|
652
|
+
switch (_a.label) {
|
|
653
|
+
case 0: return [4 /*yield*/, this.getSelectorDeliveryDate()];
|
|
654
|
+
case 1:
|
|
655
|
+
deliveryPrognosis = _a.sent();
|
|
656
|
+
if (!deliveryPrognosis || !deliveryPrognosis.returnValue) {
|
|
657
|
+
return [2 /*return*/, this.getDeliveryDate2(goodId)];
|
|
658
|
+
}
|
|
659
|
+
return [2 /*return*/, deliveryPrognosis];
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
ProductConnectorAdapterService.prototype.getSelectorDeliveryDate = function () {
|
|
665
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
666
|
+
var response;
|
|
667
|
+
return __generator(this, function (_a) {
|
|
668
|
+
switch (_a.label) {
|
|
669
|
+
case 0: return [4 /*yield*/, this.articleConnector.getSelectorDeliveryDate()];
|
|
670
|
+
case 1:
|
|
671
|
+
response = _a.sent();
|
|
672
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
673
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(deliveryPrognosis.DeliveryPrognosis, response.resultObject)];
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
return [2 /*return*/, null];
|
|
677
|
+
}
|
|
678
|
+
return [2 /*return*/];
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
ProductConnectorAdapterService.prototype.getArtStockStatus = function (goodId) {
|
|
684
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
685
|
+
var response;
|
|
686
|
+
return __generator(this, function (_a) {
|
|
687
|
+
switch (_a.label) {
|
|
688
|
+
case 0: return [4 /*yield*/, this.articleConnector.getArtStockStatus(goodId)];
|
|
689
|
+
case 1:
|
|
690
|
+
response = _a.sent();
|
|
691
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
692
|
+
return [2 /*return*/, response.resultObject];
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
return [2 /*return*/, null];
|
|
696
|
+
}
|
|
697
|
+
return [2 /*return*/];
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
ProductConnectorAdapterService.prototype.getDeliveryDate2 = function (goodId) {
|
|
703
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
704
|
+
var response;
|
|
705
|
+
return __generator(this, function (_a) {
|
|
706
|
+
switch (_a.label) {
|
|
707
|
+
case 0: return [4 /*yield*/, this.articleConnector.getDeliveryDate2(goodId)];
|
|
708
|
+
case 1:
|
|
709
|
+
response = _a.sent();
|
|
710
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
711
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(deliveryPrognosis.DeliveryPrognosis, response.resultObject)];
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
return [2 /*return*/, null];
|
|
715
|
+
}
|
|
716
|
+
return [2 /*return*/];
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
};
|
|
721
|
+
ProductConnectorAdapterService.prototype.getJsonConfiguredArticles = function (configuratorStatistics) {
|
|
722
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
723
|
+
var response;
|
|
724
|
+
return __generator(this, function (_a) {
|
|
725
|
+
switch (_a.label) {
|
|
726
|
+
case 0: return [4 /*yield*/, this.articleConnector.getJsonConfiguredArticles(configuratorStatistics)];
|
|
727
|
+
case 1:
|
|
728
|
+
response = _a.sent();
|
|
729
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
730
|
+
return [2 /*return*/, response.resultObject];
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
return [2 /*return*/, ''];
|
|
734
|
+
}
|
|
735
|
+
return [2 /*return*/];
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
});
|
|
739
|
+
};
|
|
740
|
+
ProductConnectorAdapterService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics) {
|
|
741
|
+
if (externalSource === void 0) { externalSource = false; }
|
|
742
|
+
if (showLoader === void 0) { showLoader = true; }
|
|
986
743
|
return __awaiter(this, void 0, void 0, function () {
|
|
987
|
-
var
|
|
744
|
+
var _this = this;
|
|
988
745
|
return __generator(this, function (_a) {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
if (!deliveryPrognosis || !deliveryPrognosis.returnValue) {
|
|
994
|
-
return [2 /*return*/, this.getDeliveryDate2(goodId)];
|
|
995
|
-
}
|
|
996
|
-
return [2 /*return*/, deliveryPrognosis];
|
|
997
|
-
}
|
|
746
|
+
return [2 /*return*/, this.articleConnector.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics).catch(function (messages) {
|
|
747
|
+
_this._eventService.errorMessage.next(messages);
|
|
748
|
+
return null;
|
|
749
|
+
})];
|
|
998
750
|
});
|
|
999
751
|
});
|
|
1000
752
|
};
|
|
1001
|
-
ProductConnectorAdapterService.prototype.
|
|
753
|
+
ProductConnectorAdapterService.prototype.getGoodIdFromArticleNr = function (sku) {
|
|
1002
754
|
return __awaiter(this, void 0, void 0, function () {
|
|
1003
755
|
var response;
|
|
1004
756
|
return __generator(this, function (_a) {
|
|
1005
757
|
switch (_a.label) {
|
|
1006
|
-
case 0: return [4 /*yield*/, this.articleConnector.
|
|
758
|
+
case 0: return [4 /*yield*/, this.articleConnector.getGoodIdFromArticleNr(sku)];
|
|
1007
759
|
case 1:
|
|
1008
760
|
response = _a.sent();
|
|
1009
761
|
if (response && response.validationResult && response.validationResult.success) {
|
|
1010
|
-
return [2 /*return*/,
|
|
762
|
+
return [2 /*return*/, response.resultObject];
|
|
1011
763
|
}
|
|
1012
764
|
else {
|
|
1013
765
|
return [2 /*return*/, null];
|
|
@@ -1017,16 +769,17 @@
|
|
|
1017
769
|
});
|
|
1018
770
|
});
|
|
1019
771
|
};
|
|
1020
|
-
ProductConnectorAdapterService.prototype.
|
|
772
|
+
ProductConnectorAdapterService.prototype.getArticleFullObject = function (goodId, showLoader) {
|
|
773
|
+
if (showLoader === void 0) { showLoader = true; }
|
|
1021
774
|
return __awaiter(this, void 0, void 0, function () {
|
|
1022
775
|
var response;
|
|
1023
776
|
return __generator(this, function (_a) {
|
|
1024
777
|
switch (_a.label) {
|
|
1025
|
-
case 0: return [4 /*yield*/, this.articleConnector.
|
|
778
|
+
case 0: return [4 /*yield*/, this.articleConnector.getArticleFullObject(goodId, showLoader)];
|
|
1026
779
|
case 1:
|
|
1027
780
|
response = _a.sent();
|
|
1028
781
|
if (response && response.validationResult && response.validationResult.success) {
|
|
1029
|
-
return [2 /*return*/, response.resultObject];
|
|
782
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(articleFullObject.ArticleFullObject, response.resultObject)];
|
|
1030
783
|
}
|
|
1031
784
|
else {
|
|
1032
785
|
return [2 /*return*/, null];
|
|
@@ -1036,16 +789,16 @@
|
|
|
1036
789
|
});
|
|
1037
790
|
});
|
|
1038
791
|
};
|
|
1039
|
-
ProductConnectorAdapterService.prototype.
|
|
792
|
+
ProductConnectorAdapterService.prototype.getSuperArticle = function (id, branch) {
|
|
1040
793
|
return __awaiter(this, void 0, void 0, function () {
|
|
1041
794
|
var response;
|
|
1042
795
|
return __generator(this, function (_a) {
|
|
1043
796
|
switch (_a.label) {
|
|
1044
|
-
case 0: return [4 /*yield*/, this.articleConnector.
|
|
797
|
+
case 0: return [4 /*yield*/, this.articleConnector.getSuperArticleQuickSel(id, branch)];
|
|
1045
798
|
case 1:
|
|
1046
799
|
response = _a.sent();
|
|
1047
800
|
if (response && response.validationResult && response.validationResult.success) {
|
|
1048
|
-
return [2 /*return*/, this._boFactory.makeWithRawBackendData(
|
|
801
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(superArticle.SuperArticle, response.resultObject)];
|
|
1049
802
|
}
|
|
1050
803
|
else {
|
|
1051
804
|
return [2 /*return*/, null];
|
|
@@ -1055,151 +808,387 @@
|
|
|
1055
808
|
});
|
|
1056
809
|
});
|
|
1057
810
|
};
|
|
1058
|
-
ProductConnectorAdapterService.prototype.
|
|
811
|
+
ProductConnectorAdapterService.prototype.getDocumentContent = function (docId, thumbnail) {
|
|
812
|
+
if (thumbnail === void 0) { thumbnail = true; }
|
|
1059
813
|
return __awaiter(this, void 0, void 0, function () {
|
|
1060
814
|
var response;
|
|
1061
815
|
return __generator(this, function (_a) {
|
|
1062
816
|
switch (_a.label) {
|
|
1063
|
-
case 0: return [4 /*yield*/, this.articleConnector.
|
|
817
|
+
case 0: return [4 /*yield*/, this.articleConnector.getDocumentContent(docId, thumbnail)];
|
|
1064
818
|
case 1:
|
|
1065
819
|
response = _a.sent();
|
|
1066
820
|
if (response && response.validationResult && response.validationResult.success) {
|
|
1067
|
-
return [2 /*return*/, response.resultObject];
|
|
821
|
+
return [2 /*return*/, this._boFactory.makeWithRawBackendData(documentContent.DocumentContent, response.resultObject)];
|
|
1068
822
|
}
|
|
1069
823
|
else {
|
|
1070
|
-
return [2 /*return*/,
|
|
824
|
+
return [2 /*return*/, null];
|
|
1071
825
|
}
|
|
1072
826
|
return [2 /*return*/];
|
|
1073
827
|
}
|
|
1074
828
|
});
|
|
1075
829
|
});
|
|
1076
830
|
};
|
|
1077
|
-
ProductConnectorAdapterService.prototype.
|
|
1078
|
-
if (externalSource === void 0) { externalSource = false; }
|
|
1079
|
-
if (showLoader === void 0) { showLoader = true; }
|
|
831
|
+
ProductConnectorAdapterService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
|
|
1080
832
|
return __awaiter(this, void 0, void 0, function () {
|
|
1081
|
-
var
|
|
833
|
+
var response, infoResponse;
|
|
1082
834
|
return __generator(this, function (_a) {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
835
|
+
switch (_a.label) {
|
|
836
|
+
case 0: return [4 /*yield*/, this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity)];
|
|
837
|
+
case 1:
|
|
838
|
+
response = _a.sent();
|
|
839
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
840
|
+
infoResponse = this._boFactory.makeWithRawBackendData(transactionInfoResponse_bo.TransactionInfoResponse, response.resultObject);
|
|
841
|
+
return [2 /*return*/, infoResponse.transactionInfo.uuid];
|
|
842
|
+
}
|
|
843
|
+
return [2 /*return*/, ""];
|
|
844
|
+
}
|
|
1087
845
|
});
|
|
1088
846
|
});
|
|
1089
847
|
};
|
|
1090
|
-
ProductConnectorAdapterService
|
|
848
|
+
return ProductConnectorAdapterService;
|
|
849
|
+
}());
|
|
850
|
+
ProductConnectorAdapterService.decorators = [
|
|
851
|
+
{ type: i0.Injectable }
|
|
852
|
+
];
|
|
853
|
+
ProductConnectorAdapterService.ctorParameters = function () { return [
|
|
854
|
+
{ type: ProductEventService }
|
|
855
|
+
]; };
|
|
856
|
+
|
|
857
|
+
var JsonUtilsService = /** @class */ (function () {
|
|
858
|
+
function JsonUtilsService() {
|
|
859
|
+
}
|
|
860
|
+
JsonUtilsService.prototype.readJsonFile = function (filePath) {
|
|
1091
861
|
return __awaiter(this, void 0, void 0, function () {
|
|
1092
|
-
var
|
|
862
|
+
var response, e_1;
|
|
1093
863
|
return __generator(this, function (_a) {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
864
|
+
switch (_a.label) {
|
|
865
|
+
case 0:
|
|
866
|
+
_a.trys.push([0, 2, , 3]);
|
|
867
|
+
return [4 /*yield*/, fetch(filePath)];
|
|
868
|
+
case 1:
|
|
869
|
+
response = _a.sent();
|
|
870
|
+
if (!response.ok) {
|
|
871
|
+
return [2 /*return*/, null];
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
return [2 /*return*/, response.json()];
|
|
875
|
+
}
|
|
876
|
+
return [3 /*break*/, 3];
|
|
877
|
+
case 2:
|
|
878
|
+
e_1 = _a.sent();
|
|
879
|
+
console.error('Error getting file:', e_1.message);
|
|
880
|
+
return [2 /*return*/, ''];
|
|
881
|
+
case 3: return [2 /*return*/];
|
|
882
|
+
}
|
|
1098
883
|
});
|
|
1099
884
|
});
|
|
1100
885
|
};
|
|
1101
|
-
|
|
886
|
+
return JsonUtilsService;
|
|
887
|
+
}());
|
|
888
|
+
JsonUtilsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
|
|
889
|
+
JsonUtilsService.decorators = [
|
|
890
|
+
{ type: i0.Injectable, args: [{
|
|
891
|
+
providedIn: 'root'
|
|
892
|
+
},] }
|
|
893
|
+
];
|
|
894
|
+
|
|
895
|
+
var LanguageCode;
|
|
896
|
+
(function (LanguageCode) {
|
|
897
|
+
LanguageCode["Dutch"] = "nl-NL";
|
|
898
|
+
LanguageCode["English"] = "en-GB";
|
|
899
|
+
LanguageCode["German"] = "de-DE";
|
|
900
|
+
LanguageCode["French"] = "fr-FR";
|
|
901
|
+
})(LanguageCode || (LanguageCode = {}));
|
|
902
|
+
|
|
903
|
+
var Dictionary = /** @class */ (function () {
|
|
904
|
+
function Dictionary() {
|
|
905
|
+
this.strings = {
|
|
906
|
+
"en": {
|
|
907
|
+
"ADDITIONAL_DATA": "Additional information",
|
|
908
|
+
"ALTERNATIVE_PRODUCTS": "Alternative products",
|
|
909
|
+
"ARTICLE_NUMBER": "Productnumber",
|
|
910
|
+
"AS_CONFIGURED": "As configured",
|
|
911
|
+
"CATEGORY": "Category",
|
|
912
|
+
"CATEGORY_TYPE": "Category type",
|
|
913
|
+
"CONFIGURE": "Configure",
|
|
914
|
+
"DELIVERY_TIME_PERIOD": "Delivery time",
|
|
915
|
+
"DESCRIPTION": "Description",
|
|
916
|
+
"DOCUMENTS": "Documents",
|
|
917
|
+
"DOWNLOADS": "Downloads",
|
|
918
|
+
"FEATURES": "Features",
|
|
919
|
+
"HEIGHT": "Height",
|
|
920
|
+
"MATERIAL": "Material",
|
|
921
|
+
"PRODUCT_IN_STOCK": "In stock",
|
|
922
|
+
"PRODUCT_LIMITED_STOCK": "Limited stock",
|
|
923
|
+
"PRODUCT_NOT_IN_STOCK": "Not in stock",
|
|
924
|
+
"PROPERTIES": "Characteristics",
|
|
925
|
+
"QUOTATION": "Quotation",
|
|
926
|
+
"READ_MORE": "Read more",
|
|
927
|
+
"RELATED_PRODUCTS": "Related products",
|
|
928
|
+
"SHOPPING_CART_IN": "In Shopping Cart",
|
|
929
|
+
"SHOW_IN": "Show in",
|
|
930
|
+
"STOCK": "Stock",
|
|
931
|
+
"SYMBOLS": "Symbols",
|
|
932
|
+
"TITLE": "Title",
|
|
933
|
+
"TURNOVERGROUP": "Turnover group",
|
|
934
|
+
"VARIANTS": "Variations",
|
|
935
|
+
"WIDTH": "Width",
|
|
936
|
+
"SUGGESTION": "Suggestion",
|
|
937
|
+
},
|
|
938
|
+
"nl": {
|
|
939
|
+
"ADDITIONAL_DATA": "Extra informatie",
|
|
940
|
+
"ALTERNATIVE_PRODUCTS": "Alternatieve producten",
|
|
941
|
+
"ARTICLE_NUMBER": "Artikel nummer",
|
|
942
|
+
"AS_CONFIGURED": "Zoals samengesteld",
|
|
943
|
+
"CATEGORY": "Categorie",
|
|
944
|
+
"CATEGORY_TYPE": "Categorie type",
|
|
945
|
+
"CONFIGURE": "Configureren",
|
|
946
|
+
"DELIVERY_TIME_PERIOD": "Levertijd",
|
|
947
|
+
"DESCRIPTION": "Omschrijving",
|
|
948
|
+
"DOCUMENTS": "Documenten",
|
|
949
|
+
"DOWNLOADS": "Downloads",
|
|
950
|
+
"FEATURES": "Kenmerken",
|
|
951
|
+
"HEIGHT": "Hoogte",
|
|
952
|
+
"MATERIAL": "Materiaal",
|
|
953
|
+
"PRODUCT_IN_STOCK": "Op voorraad",
|
|
954
|
+
"PRODUCT_LIMITED_STOCK": "Beperkt op voorraad",
|
|
955
|
+
"PRODUCT_NOT_IN_STOCK": "Niet op voorraad",
|
|
956
|
+
"PROPERTIES": "Eigenschappen",
|
|
957
|
+
"QUOTATION": "Quotatie",
|
|
958
|
+
"READ_MORE": "Lees meer",
|
|
959
|
+
"RELATED_PRODUCTS": "Gerelateerde producten",
|
|
960
|
+
"SHOPPING_CART_IN": "In winkelwagen",
|
|
961
|
+
"SHOW_IN": "Laat zien",
|
|
962
|
+
"STOCK": "Voorraad",
|
|
963
|
+
"SYMBOLS": "Symbolen",
|
|
964
|
+
"TITLE": "Titel",
|
|
965
|
+
"TURNOVERGROUP": "Omzetgroep",
|
|
966
|
+
"VARIANTS": "Varianten",
|
|
967
|
+
"WIDTH": "Breedte",
|
|
968
|
+
"SUGGESTION": "Suggesties bij",
|
|
969
|
+
},
|
|
970
|
+
"de": {
|
|
971
|
+
"ADDITIONAL_DATA": "Extra informatie",
|
|
972
|
+
"ALTERNATIVE_PRODUCTS": "Alternative Produkte",
|
|
973
|
+
"ARTICLE_NUMBER": "Artikelnummer",
|
|
974
|
+
"CATEGORY": "Kategorie",
|
|
975
|
+
"CATEGORY_TYPE": "Kategorietype",
|
|
976
|
+
"CONFIGURE": "Konfigurieren",
|
|
977
|
+
"DELIVERY_TIME_PERIOD": "Lieferzeit",
|
|
978
|
+
"DESCRIPTION": "Beschreibung",
|
|
979
|
+
"DOCUMENTS": "Dateien",
|
|
980
|
+
"DOWNLOADS": "Downloads",
|
|
981
|
+
"FEATURES": "Eigenschaften",
|
|
982
|
+
"HEIGHT": "Höhe",
|
|
983
|
+
"MATERIAL": "Material",
|
|
984
|
+
"PRODUCT_IN_STOCK": "Auf lager",
|
|
985
|
+
"PRODUCT_LIMITED_STOCK": "Begrentzt auf lager",
|
|
986
|
+
"PRODUCT_NOT_IN_STOCK": "Nicht auf lager",
|
|
987
|
+
"PROPERTIES": "Eigenschaften",
|
|
988
|
+
"QUOTATION": "Angebot",
|
|
989
|
+
"READ_MORE": "Lesen Sie mehr",
|
|
990
|
+
"RELATED_PRODUCTS": "Verwandte Produkte",
|
|
991
|
+
"SHOPPING_CART_IN": "Im Einkaufswagen",
|
|
992
|
+
"SHOW_IN": "Zeigen",
|
|
993
|
+
"STOCK": "Vorrat",
|
|
994
|
+
"SYMBOLS": "Symbole",
|
|
995
|
+
"TITLE": "Titulatur",
|
|
996
|
+
"TURNOVERGROUP": "Umsatzgruppe",
|
|
997
|
+
"VARIANTS": "Varianten",
|
|
998
|
+
"WIDTH": "Breite",
|
|
999
|
+
"SUGGESTION": "Suggesties bij",
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
return Dictionary;
|
|
1004
|
+
}());
|
|
1005
|
+
|
|
1006
|
+
// The localization service, providing peers with text translation functionality.
|
|
1007
|
+
var DictionaryService = /** @class */ (function () {
|
|
1008
|
+
function DictionaryService(_http, _jsonUtils) {
|
|
1009
|
+
this._http = _http;
|
|
1010
|
+
this._jsonUtils = _jsonUtils;
|
|
1011
|
+
this.dictionaryUrl = 'js/browser/res/dictionary/';
|
|
1012
|
+
// private _dictionaryPromise: Map<LanguageCode, Promise<{ [key: string]: string }>> = new Map<LanguageCode, Promise<{ [key: string]: string }>>();
|
|
1013
|
+
this._dictionaries = new Map();
|
|
1014
|
+
// Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
|
|
1015
|
+
this._placeholder = '|~';
|
|
1016
|
+
}
|
|
1017
|
+
Object.defineProperty(DictionaryService.prototype, "language", {
|
|
1018
|
+
get: function () {
|
|
1019
|
+
return this._language;
|
|
1020
|
+
},
|
|
1021
|
+
enumerable: false,
|
|
1022
|
+
configurable: true
|
|
1023
|
+
});
|
|
1024
|
+
Object.defineProperty(DictionaryService.prototype, "rootUrl", {
|
|
1025
|
+
set: function (value) {
|
|
1026
|
+
this._rootUrl = value;
|
|
1027
|
+
this._dictBasePath = this._rootUrl + '/' + this.dictionaryUrl;
|
|
1028
|
+
},
|
|
1029
|
+
enumerable: false,
|
|
1030
|
+
configurable: true
|
|
1031
|
+
});
|
|
1032
|
+
// Loads the dictionary for given language in memory.
|
|
1033
|
+
DictionaryService.prototype.setDictionary = function (language) {
|
|
1102
1034
|
return __awaiter(this, void 0, void 0, function () {
|
|
1103
|
-
var
|
|
1035
|
+
var dictionary;
|
|
1104
1036
|
return __generator(this, function (_a) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
else {
|
|
1113
|
-
return [2 /*return*/, null];
|
|
1114
|
-
}
|
|
1115
|
-
return [2 /*return*/];
|
|
1037
|
+
this._language = language || LanguageCode.Dutch;
|
|
1038
|
+
if (!this._dictionaries.has(this._language)) {
|
|
1039
|
+
dictionary = new Dictionary();
|
|
1040
|
+
if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
|
|
1041
|
+
this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
|
|
1042
|
+
}
|
|
1116
1043
|
}
|
|
1044
|
+
return [2 /*return*/];
|
|
1117
1045
|
});
|
|
1118
1046
|
});
|
|
1119
1047
|
};
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1048
|
+
/**
|
|
1049
|
+
* Returns the localized text for the given dictionary key.
|
|
1050
|
+
* @param {string} key
|
|
1051
|
+
* @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
|
|
1052
|
+
* @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
|
|
1053
|
+
* @returns {string} The translated text for given dictionary key
|
|
1054
|
+
*/
|
|
1055
|
+
DictionaryService.prototype.get = function (key, upperCaseFirst) {
|
|
1056
|
+
if (upperCaseFirst === void 0) { upperCaseFirst = true; }
|
|
1057
|
+
var replacementTexts = [];
|
|
1058
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1059
|
+
replacementTexts[_i - 2] = arguments[_i];
|
|
1060
|
+
}
|
|
1061
|
+
if (!stringUtils.StringUtils.IsStringWithLength(key)) {
|
|
1062
|
+
return key || '';
|
|
1063
|
+
}
|
|
1064
|
+
var text = this._dictionaries.get(this.language)[key];
|
|
1065
|
+
text = stringUtils.StringUtils.IsStringWithLength(text) ? text : key;
|
|
1066
|
+
if (upperCaseFirst) {
|
|
1067
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
text = text.charAt(0).toLowerCase() + text.slice(1);
|
|
1071
|
+
}
|
|
1072
|
+
if (replacementTexts.length > 0) {
|
|
1073
|
+
text = stringUtils.StringUtils.ReplaceOccurrencesIn.apply(stringUtils.StringUtils, __spreadArray([text, this._placeholder], __read(replacementTexts)));
|
|
1074
|
+
}
|
|
1075
|
+
return text;
|
|
1139
1076
|
};
|
|
1140
|
-
|
|
1077
|
+
return DictionaryService;
|
|
1078
|
+
}());
|
|
1079
|
+
DictionaryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(JsonUtilsService)); }, token: DictionaryService, providedIn: "root" });
|
|
1080
|
+
DictionaryService.decorators = [
|
|
1081
|
+
{ type: i0.Injectable, args: [{
|
|
1082
|
+
providedIn: 'root'
|
|
1083
|
+
},] }
|
|
1084
|
+
];
|
|
1085
|
+
DictionaryService.ctorParameters = function () { return [
|
|
1086
|
+
{ type: i1.HttpClient },
|
|
1087
|
+
{ type: JsonUtilsService }
|
|
1088
|
+
]; };
|
|
1089
|
+
|
|
1090
|
+
var ProductSettingsService = /** @class */ (function () {
|
|
1091
|
+
function ProductSettingsService(_jsonUtilsService, _dictionaryService) {
|
|
1092
|
+
this._jsonUtilsService = _jsonUtilsService;
|
|
1093
|
+
this._dictionaryService = _dictionaryService;
|
|
1094
|
+
this.settingsLoaded = new rxjs.BehaviorSubject(false);
|
|
1095
|
+
}
|
|
1096
|
+
Object.defineProperty(ProductSettingsService.prototype, "settings", {
|
|
1097
|
+
get: function () {
|
|
1098
|
+
return this._settings;
|
|
1099
|
+
},
|
|
1100
|
+
set: function (value) {
|
|
1101
|
+
this._settings = value;
|
|
1102
|
+
},
|
|
1103
|
+
enumerable: false,
|
|
1104
|
+
configurable: true
|
|
1105
|
+
});
|
|
1106
|
+
ProductSettingsService.prototype.initializeSettings = function (finish) {
|
|
1107
|
+
if (finish === void 0) { finish = true; }
|
|
1141
1108
|
return __awaiter(this, void 0, void 0, function () {
|
|
1142
|
-
var
|
|
1109
|
+
var jsonSettings;
|
|
1143
1110
|
return __generator(this, function (_a) {
|
|
1144
1111
|
switch (_a.label) {
|
|
1145
|
-
case 0:
|
|
1112
|
+
case 0:
|
|
1113
|
+
if (!(typeof settings === 'undefined')) return [3 /*break*/, 2];
|
|
1114
|
+
return [4 /*yield*/, this._jsonUtilsService.readJsonFile('product-settings.json')];
|
|
1146
1115
|
case 1:
|
|
1147
|
-
|
|
1148
|
-
if (
|
|
1149
|
-
|
|
1116
|
+
jsonSettings = _a.sent();
|
|
1117
|
+
if (jsonSettings) {
|
|
1118
|
+
this.settings = Object.assign(new ProductSettings(), jsonSettings);
|
|
1119
|
+
this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
|
|
1120
|
+
if (finish) {
|
|
1121
|
+
this.settingsFinished();
|
|
1122
|
+
}
|
|
1150
1123
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1124
|
+
return [3 /*break*/, 3];
|
|
1125
|
+
case 2:
|
|
1126
|
+
this.settings = Object.assign(new ProductSettings(), settings);
|
|
1127
|
+
this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
|
|
1128
|
+
if (finish) {
|
|
1129
|
+
this.settingsFinished();
|
|
1153
1130
|
}
|
|
1154
|
-
|
|
1131
|
+
_a.label = 3;
|
|
1132
|
+
case 3: return [2 /*return*/];
|
|
1155
1133
|
}
|
|
1156
1134
|
});
|
|
1157
1135
|
});
|
|
1158
1136
|
};
|
|
1159
|
-
|
|
1160
|
-
if (thumbnail === void 0) { thumbnail = true; }
|
|
1137
|
+
ProductSettingsService.prototype.createSettingsFromObject = function (obj) {
|
|
1161
1138
|
return __awaiter(this, void 0, void 0, function () {
|
|
1162
|
-
var
|
|
1139
|
+
var ownOptions, ownRenderParameters;
|
|
1163
1140
|
return __generator(this, function (_a) {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1141
|
+
if (!this.settings) {
|
|
1142
|
+
this.settings = new ProductSettings();
|
|
1143
|
+
}
|
|
1144
|
+
ownOptions = Object.assign({}, this.settings.options);
|
|
1145
|
+
ownRenderParameters = Object.assign({}, this.settings.renderParameters);
|
|
1146
|
+
this.settings = Object.assign({}, this.settings, obj);
|
|
1147
|
+
if (obj.renderParameters) {
|
|
1148
|
+
this.settings.renderParameters = Object.assign({}, ownRenderParameters, obj.renderParameters);
|
|
1149
|
+
}
|
|
1150
|
+
if (obj.options) {
|
|
1151
|
+
this.settings.options = Object.assign({}, ownOptions, obj.options);
|
|
1152
|
+
}
|
|
1153
|
+
if (obj.hasOwnProperty('assetPath')) {
|
|
1154
|
+
this.settings.assetPath = obj['assetPath'];
|
|
1155
|
+
if (this.settings.assetPath[this.settings.assetPath.length - 1] !== '/') {
|
|
1156
|
+
this.settings.assetPath += '/';
|
|
1157
|
+
}
|
|
1158
|
+
this.settings.threeDAssetPath = this.settings.assetPath;
|
|
1159
|
+
}
|
|
1160
|
+
if (obj.hasOwnProperty('threeDAssetPath')) {
|
|
1161
|
+
this.settings.threeDAssetPath = obj['threeDAssetPath'];
|
|
1162
|
+
if (this.settings.threeDAssetPath[this.settings.threeDAssetPath.length - 1] !== '/') {
|
|
1163
|
+
this.settings.threeDAssetPath += '/';
|
|
1164
|
+
}
|
|
1175
1165
|
}
|
|
1166
|
+
this.settingsFinished();
|
|
1167
|
+
return [2 /*return*/];
|
|
1176
1168
|
});
|
|
1177
1169
|
});
|
|
1178
1170
|
};
|
|
1179
|
-
|
|
1171
|
+
ProductSettingsService.prototype.settingsFinished = function () {
|
|
1180
1172
|
return __awaiter(this, void 0, void 0, function () {
|
|
1181
|
-
var response, infoResponse;
|
|
1182
1173
|
return __generator(this, function (_a) {
|
|
1183
1174
|
switch (_a.label) {
|
|
1184
|
-
case 0: return [4 /*yield*/, this.
|
|
1175
|
+
case 0: return [4 /*yield*/, this._dictionaryService.setDictionary(this.settings.languageCode)];
|
|
1185
1176
|
case 1:
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
return [2 /*return*/, infoResponse.transactionInfo.uuid];
|
|
1190
|
-
}
|
|
1191
|
-
return [2 /*return*/, ""];
|
|
1177
|
+
_a.sent();
|
|
1178
|
+
this.settingsLoaded.next(true);
|
|
1179
|
+
return [2 /*return*/];
|
|
1192
1180
|
}
|
|
1193
1181
|
});
|
|
1194
1182
|
});
|
|
1195
1183
|
};
|
|
1196
|
-
return
|
|
1184
|
+
return ProductSettingsService;
|
|
1197
1185
|
}());
|
|
1198
|
-
|
|
1186
|
+
ProductSettingsService.decorators = [
|
|
1199
1187
|
{ type: i0.Injectable }
|
|
1200
1188
|
];
|
|
1201
|
-
|
|
1202
|
-
{ type:
|
|
1189
|
+
ProductSettingsService.ctorParameters = function () { return [
|
|
1190
|
+
{ type: JsonUtilsService },
|
|
1191
|
+
{ type: DictionaryService }
|
|
1203
1192
|
]; };
|
|
1204
1193
|
|
|
1205
1194
|
// Holds all iONE backend related state and methods for a running HomeDecorator. To be used anywhere internally.
|
|
@@ -1315,10 +1304,6 @@
|
|
|
1315
1304
|
if (showLoader === void 0) { showLoader = true; }
|
|
1316
1305
|
return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, this._instanceId, configuratorStatistics);
|
|
1317
1306
|
};
|
|
1318
|
-
ProductConnectorService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
|
|
1319
|
-
if (showLoader === void 0) { showLoader = true; }
|
|
1320
|
-
return this._adapterService.getGeneratedArtDirectly(goodId, showLoader);
|
|
1321
|
-
};
|
|
1322
1307
|
ProductConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
|
|
1323
1308
|
return __awaiter(this, void 0, void 0, function () {
|
|
1324
1309
|
return __generator(this, function (_a) {
|
|
@@ -1342,8 +1327,51 @@
|
|
|
1342
1327
|
{ type: ProductSettingsService }
|
|
1343
1328
|
]; };
|
|
1344
1329
|
|
|
1330
|
+
var RootStorageObject = /** @class */ (function () {
|
|
1331
|
+
function RootStorageObject() {
|
|
1332
|
+
}
|
|
1333
|
+
return RootStorageObject;
|
|
1334
|
+
}());
|
|
1335
|
+
var LocalStorageService = /** @class */ (function () {
|
|
1336
|
+
function LocalStorageService() {
|
|
1337
|
+
this.storage = localStorage;
|
|
1338
|
+
this._appRoot = "web-order";
|
|
1339
|
+
this._storageObj = new RootStorageObject();
|
|
1340
|
+
this._initLocalStorageObj();
|
|
1341
|
+
}
|
|
1342
|
+
LocalStorageService.prototype.save = function () {
|
|
1343
|
+
this.storage.setItem(this._appRoot, JSON.stringify(this._storageObj));
|
|
1344
|
+
};
|
|
1345
|
+
LocalStorageService.prototype.clear = function () {
|
|
1346
|
+
this.storage.clear();
|
|
1347
|
+
};
|
|
1348
|
+
Object.defineProperty(LocalStorageService.prototype, "id", {
|
|
1349
|
+
get: function () {
|
|
1350
|
+
return this._storageObj ? this._storageObj.id : "";
|
|
1351
|
+
},
|
|
1352
|
+
set: function (id) {
|
|
1353
|
+
this._storageObj.id = id;
|
|
1354
|
+
this.save();
|
|
1355
|
+
},
|
|
1356
|
+
enumerable: false,
|
|
1357
|
+
configurable: true
|
|
1358
|
+
});
|
|
1359
|
+
LocalStorageService.prototype._initLocalStorageObj = function () {
|
|
1360
|
+
this._storageObj = JSON.parse(this.storage.getItem(this._appRoot)) || this._storageObj;
|
|
1361
|
+
this.save();
|
|
1362
|
+
};
|
|
1363
|
+
return LocalStorageService;
|
|
1364
|
+
}());
|
|
1365
|
+
LocalStorageService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalStorageService_Factory() { return new LocalStorageService(); }, token: LocalStorageService, providedIn: "root" });
|
|
1366
|
+
LocalStorageService.decorators = [
|
|
1367
|
+
{ type: i0.Injectable, args: [{
|
|
1368
|
+
providedIn: 'root'
|
|
1369
|
+
},] }
|
|
1370
|
+
];
|
|
1371
|
+
LocalStorageService.ctorParameters = function () { return []; };
|
|
1372
|
+
|
|
1345
1373
|
var IoneProductComponent = /** @class */ (function () {
|
|
1346
|
-
function IoneProductComponent(_appEventService, _settingsService) {
|
|
1374
|
+
function IoneProductComponent(_appEventService, _settingsService, _productConnectorService, _localStorageService) {
|
|
1347
1375
|
var _this = this;
|
|
1348
1376
|
// this.sku = 'CF-HILL';
|
|
1349
1377
|
// this.sku = 'CF-ALMADA';
|
|
@@ -1362,8 +1390,11 @@
|
|
|
1362
1390
|
// this.sku = "1000612725";
|
|
1363
1391
|
this._appEventService = _appEventService;
|
|
1364
1392
|
this._settingsService = _settingsService;
|
|
1393
|
+
this._productConnectorService = _productConnectorService;
|
|
1394
|
+
this._localStorageService = _localStorageService;
|
|
1365
1395
|
this.enableRenderCarousel = false;
|
|
1366
1396
|
this.handleAddArticleInternally = true;
|
|
1397
|
+
this.handleAddToCartInternally = false;
|
|
1367
1398
|
this.onAddToCart = new i0.EventEmitter();
|
|
1368
1399
|
this.forceRenderImage = new i0.EventEmitter();
|
|
1369
1400
|
this.getRenderForRenderCarousel = new i0.EventEmitter();
|
|
@@ -1426,9 +1457,41 @@
|
|
|
1426
1457
|
};
|
|
1427
1458
|
IoneProductComponent.prototype._handleAddToCart = function (data) {
|
|
1428
1459
|
return __awaiter(this, void 0, void 0, function () {
|
|
1460
|
+
var article, transactionId, transactionId;
|
|
1429
1461
|
return __generator(this, function (_a) {
|
|
1430
|
-
|
|
1431
|
-
|
|
1462
|
+
switch (_a.label) {
|
|
1463
|
+
case 0:
|
|
1464
|
+
if (!this.handleAddToCartInternally) return [3 /*break*/, 7];
|
|
1465
|
+
if (!(data && data.article)) return [3 /*break*/, 6];
|
|
1466
|
+
if (!(typeof data.article === 'string')) return [3 /*break*/, 3];
|
|
1467
|
+
article = JSON.parse(data.article);
|
|
1468
|
+
if (!(article.selectorData && article.selectorData.compositions)) return [3 /*break*/, 2];
|
|
1469
|
+
return [4 /*yield*/, this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, article.selectorData.compositions[0].compositionArticleNo, data.quantity)];
|
|
1470
|
+
case 1:
|
|
1471
|
+
transactionId = _a.sent();
|
|
1472
|
+
if (transactionId) {
|
|
1473
|
+
this._localStorageService.id = transactionId;
|
|
1474
|
+
}
|
|
1475
|
+
_a.label = 2;
|
|
1476
|
+
case 2: return [3 /*break*/, 5];
|
|
1477
|
+
case 3:
|
|
1478
|
+
if (!data.article.hasOwnProperty('articleNr')) return [3 /*break*/, 5];
|
|
1479
|
+
return [4 /*yield*/, this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, data.article['articleNr'], data.quantity)];
|
|
1480
|
+
case 4:
|
|
1481
|
+
transactionId = _a.sent();
|
|
1482
|
+
if (transactionId) {
|
|
1483
|
+
this._localStorageService.id = transactionId;
|
|
1484
|
+
}
|
|
1485
|
+
_a.label = 5;
|
|
1486
|
+
case 5:
|
|
1487
|
+
this.onAddToCart.next(data);
|
|
1488
|
+
_a.label = 6;
|
|
1489
|
+
case 6: return [3 /*break*/, 8];
|
|
1490
|
+
case 7:
|
|
1491
|
+
this.onAddToCart.emit(data);
|
|
1492
|
+
_a.label = 8;
|
|
1493
|
+
case 8: return [2 /*return*/];
|
|
1494
|
+
}
|
|
1432
1495
|
});
|
|
1433
1496
|
});
|
|
1434
1497
|
};
|
|
@@ -1453,7 +1516,9 @@
|
|
|
1453
1516
|
];
|
|
1454
1517
|
IoneProductComponent.ctorParameters = function () { return [
|
|
1455
1518
|
{ type: ProductEventService },
|
|
1456
|
-
{ type: ProductSettingsService }
|
|
1519
|
+
{ type: ProductSettingsService },
|
|
1520
|
+
{ type: ProductConnectorService },
|
|
1521
|
+
{ type: LocalStorageService }
|
|
1457
1522
|
]; };
|
|
1458
1523
|
IoneProductComponent.propDecorators = {
|
|
1459
1524
|
sku: [{ type: i0.Input }],
|
|
@@ -1462,6 +1527,7 @@
|
|
|
1462
1527
|
enableRenderCarousel: [{ type: i0.Input }],
|
|
1463
1528
|
settings: [{ type: i0.Input }],
|
|
1464
1529
|
handleAddArticleInternally: [{ type: i0.Input }],
|
|
1530
|
+
handleAddToCartInternally: [{ type: i0.Input }],
|
|
1465
1531
|
onAddToCart: [{ type: i0.Output }],
|
|
1466
1532
|
forceRenderImage: [{ type: i0.Output }],
|
|
1467
1533
|
getRenderForRenderCarousel: [{ type: i0.Output }],
|
|
@@ -1742,8 +1808,7 @@
|
|
|
1742
1808
|
this._ione.getFullArticle(this._sku).then(function (article) {
|
|
1743
1809
|
_this.article = article;
|
|
1744
1810
|
if (_this.article) {
|
|
1745
|
-
_this.configurable = _this.article.goodType === 'B'
|
|
1746
|
-
// this.configurable = this.article.goodType === 'B';
|
|
1811
|
+
_this.configurable = _this.article.goodType === 'B';
|
|
1747
1812
|
if (_this.configurable) {
|
|
1748
1813
|
_this.showAddToCart = false;
|
|
1749
1814
|
_this.currentView = SelectorType.TwoD;
|
|
@@ -1781,7 +1846,7 @@
|
|
|
1781
1846
|
ProductPageComponent.decorators = [
|
|
1782
1847
|
{ type: i0.Component, args: [{
|
|
1783
1848
|
selector: 'app-product-page',
|
|
1784
|
-
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\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded
|
|
1849
|
+
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\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator\r\n #configurator\r\n 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\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\"\r\n [class.show-selections]=\"configuring\"\r\n [@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 (onAnswersAvailable)=\"appEventService.onAnswersAvailable.next($event.detail)\"\r\n (onReadyToRender)=\"appEventService.onReadyToRender.next($event.detail)\"\r\n (onRenderImageReceived)=\"appEventService.onRenderImageReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n (showRelatedPopup)=\"handlePopUpChange($event)\"\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 [showAddToCart]=\"showAddToCart\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\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 [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n [label]=\"'RELATED_PRODUCTS' | localize\">\r\n </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\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"4\"\r\n [isSmallModus]=\"false\"\r\n [label]=\"'ALTERNATIVE_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"showRelatedProductsPopup\">\r\n <co-product-dialog\r\n [mainArticle]=\"article\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n (closeRelatedPopup)=\"handlePopUpChange($event)\"\r\n >\r\n </co-product-dialog>\r\n\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\r\n\r\n </div>\r\n</ng-container>\r\n",
|
|
1785
1850
|
animations: [
|
|
1786
1851
|
animations.trigger('toggleFullScreen', [
|
|
1787
1852
|
animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
|
|
@@ -2422,12 +2487,11 @@
|
|
|
2422
2487
|
];
|
|
2423
2488
|
|
|
2424
2489
|
var ProductAddtocartComponent = /** @class */ (function () {
|
|
2425
|
-
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService
|
|
2490
|
+
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
|
|
2426
2491
|
this.iconCache = iconCache;
|
|
2427
2492
|
this._ioneControllerService = _ioneControllerService;
|
|
2428
2493
|
this._appEventService = _appEventService;
|
|
2429
2494
|
this._settingsService = _settingsService;
|
|
2430
|
-
this._productConnectorAdapterService = _productConnectorAdapterService;
|
|
2431
2495
|
this.icon = IconEnum;
|
|
2432
2496
|
this.createFrozenArticle = true;
|
|
2433
2497
|
this.configurable = false;
|
|
@@ -2469,52 +2533,40 @@
|
|
|
2469
2533
|
};
|
|
2470
2534
|
ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
|
|
2471
2535
|
return __awaiter(this, void 0, void 0, function () {
|
|
2472
|
-
var article,
|
|
2536
|
+
var article, article, article;
|
|
2473
2537
|
return __generator(this, function (_a) {
|
|
2474
2538
|
switch (_a.label) {
|
|
2475
2539
|
case 0:
|
|
2476
|
-
if (!this.createFrozenArticle) return [3 /*break*/,
|
|
2477
|
-
if (!(this.article.goodType === 'B')) return [3 /*break*/,
|
|
2478
|
-
if (!this.article.isConfigurable) return [3 /*break*/, 2];
|
|
2540
|
+
if (!this.createFrozenArticle) return [3 /*break*/, 7];
|
|
2541
|
+
if (!(this.article.goodType === 'B')) return [3 /*break*/, 2];
|
|
2479
2542
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2480
2543
|
case 1:
|
|
2481
2544
|
article = _a.sent();
|
|
2482
2545
|
if (article) {
|
|
2483
2546
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2484
2547
|
}
|
|
2485
|
-
return [3 /*break*/,
|
|
2486
|
-
case 2:
|
|
2487
|
-
case 3:
|
|
2488
|
-
generatedGoodId = _a.sent();
|
|
2489
|
-
if (!generatedGoodId) return [3 /*break*/, 5];
|
|
2490
|
-
return [4 /*yield*/, this._productConnectorAdapterService.getArticleFullObject(generatedGoodId, true)];
|
|
2491
|
-
case 4:
|
|
2492
|
-
articleFull = _a.sent();
|
|
2493
|
-
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(articleFull);
|
|
2494
|
-
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2495
|
-
_a.label = 5;
|
|
2496
|
-
case 5: return [3 /*break*/, 10];
|
|
2497
|
-
case 6:
|
|
2548
|
+
return [3 /*break*/, 6];
|
|
2549
|
+
case 2:
|
|
2498
2550
|
article = void 0;
|
|
2499
|
-
if (!!!this.externalSource) return [3 /*break*/,
|
|
2551
|
+
if (!!!this.externalSource) return [3 /*break*/, 4];
|
|
2500
2552
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2501
|
-
case
|
|
2553
|
+
case 3:
|
|
2502
2554
|
article = _a.sent();
|
|
2503
|
-
return [3 /*break*/,
|
|
2504
|
-
case
|
|
2555
|
+
return [3 /*break*/, 5];
|
|
2556
|
+
case 4:
|
|
2505
2557
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2506
|
-
_a.label =
|
|
2507
|
-
case
|
|
2558
|
+
_a.label = 5;
|
|
2559
|
+
case 5:
|
|
2508
2560
|
if (article) {
|
|
2509
2561
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2510
2562
|
}
|
|
2511
|
-
_a.label =
|
|
2512
|
-
case
|
|
2513
|
-
case
|
|
2563
|
+
_a.label = 6;
|
|
2564
|
+
case 6: return [3 /*break*/, 8];
|
|
2565
|
+
case 7:
|
|
2514
2566
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2515
2567
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2516
|
-
_a.label =
|
|
2517
|
-
case
|
|
2568
|
+
_a.label = 8;
|
|
2569
|
+
case 8: return [2 /*return*/];
|
|
2518
2570
|
}
|
|
2519
2571
|
});
|
|
2520
2572
|
});
|
|
@@ -2553,16 +2605,6 @@
|
|
|
2553
2605
|
});
|
|
2554
2606
|
});
|
|
2555
2607
|
};
|
|
2556
|
-
ProductAddtocartComponent.prototype._getGeneratedArtDirectly = function (goodId) {
|
|
2557
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2558
|
-
return __generator(this, function (_a) {
|
|
2559
|
-
switch (_a.label) {
|
|
2560
|
-
case 0: return [4 /*yield*/, this._ioneControllerService.getGeneratedArtDirectly(goodId, true)];
|
|
2561
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
});
|
|
2565
|
-
};
|
|
2566
2608
|
return ProductAddtocartComponent;
|
|
2567
2609
|
}());
|
|
2568
2610
|
ProductAddtocartComponent.decorators = [
|
|
@@ -2576,8 +2618,7 @@
|
|
|
2576
2618
|
{ type: IconCacheService },
|
|
2577
2619
|
{ type: ProductConnectorService },
|
|
2578
2620
|
{ type: ProductEventService },
|
|
2579
|
-
{ type: ProductSettingsService }
|
|
2580
|
-
{ type: ProductConnectorAdapterService }
|
|
2621
|
+
{ type: ProductSettingsService }
|
|
2581
2622
|
]; };
|
|
2582
2623
|
ProductAddtocartComponent.propDecorators = {
|
|
2583
2624
|
addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],
|
|
@@ -4106,6 +4147,7 @@
|
|
|
4106
4147
|
exports["ɵbp"] = ProductHdModule;
|
|
4107
4148
|
exports["ɵbq"] = ProductHdComponent;
|
|
4108
4149
|
exports["ɵbr"] = ProductScriptLoaderService;
|
|
4150
|
+
exports["ɵbs"] = LocalStorageService;
|
|
4109
4151
|
exports["ɵc"] = PipeModule;
|
|
4110
4152
|
exports["ɵd"] = LocalizePipe;
|
|
4111
4153
|
exports["ɵe"] = DictionaryService;
|