@colijnit/product 256.1.3 → 256.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/components/product-external-source/product-external-source.component.d.ts +18 -0
- package/app/components/product-hd/product-hd.component.d.ts +25 -0
- package/app/components/product-hd/product-hd.module.d.ts +2 -0
- package/app/ione-product.component.d.ts +1 -0
- package/app/service/product-script-loader.service.d.ts +9 -0
- package/bundles/colijnit-product.umd.js +341 -34
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.d.ts +3 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/components/product-external-source/product-external-source.component.js +87 -20
- package/esm2015/app/components/product-external-source/product-external-source.module.js +4 -2
- package/esm2015/app/components/product-hd/product-hd.component.js +124 -0
- package/esm2015/app/components/product-hd/product-hd.module.js +23 -0
- package/esm2015/app/ione-product.component.js +4 -2
- package/esm2015/app/ione-product.module.js +14 -6
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-script-loader.service.js +68 -0
- package/esm2015/colijnit-product.js +4 -1
- package/fesm2015/colijnit-product.js +326 -44
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +3 -3
- package/colijnit-product-256.1.2.tgz +0 -0
|
@@ -6,6 +6,8 @@ import { ArticleListObject } from '@colijnit/articleapi/build/model/article-list
|
|
|
6
6
|
import { ProductEventService } from '../../service/product-event.service';
|
|
7
7
|
import { CatalogDefinition } from '@colijnit/articleapi/build/model/catalog-definition.bo';
|
|
8
8
|
import { ExternalSourceArticleAddInterface } from '@colijnit/articleapi/build/interface/external-source-article-add.interface';
|
|
9
|
+
import { ExternalCatalogStartupInfo } from '@colijnit/articleapi/build/model/external-catalog-startup-info';
|
|
10
|
+
import { ExternalSourceParameter } from '@colijnit/articleapi/build/model/external-source-parameter.bo';
|
|
9
11
|
export declare class ProductExternalSourceComponent implements OnInit, OnDestroy {
|
|
10
12
|
private _sanitizer;
|
|
11
13
|
private _productConnectorService;
|
|
@@ -14,20 +16,36 @@ export declare class ProductExternalSourceComponent implements OnInit, OnDestroy
|
|
|
14
16
|
catalogDefinition: CatalogDefinition;
|
|
15
17
|
set externalSource(value: ExternalSource);
|
|
16
18
|
get externalSource(): ExternalSource;
|
|
19
|
+
set externalCatalogStartupInfo(value: ExternalCatalogStartupInfo);
|
|
20
|
+
get externalCatalogStartupInfo(): ExternalCatalogStartupInfo;
|
|
17
21
|
options: {};
|
|
18
22
|
addToCart: EventEmitter<ExternalSourceArticleAddInterface>;
|
|
19
23
|
addToQuote: EventEmitter<ExternalSourceArticleAddInterface>;
|
|
20
24
|
alternativeClick: EventEmitter<ArticleListObject>;
|
|
25
|
+
configuratorFinished: EventEmitter<string>;
|
|
21
26
|
showClass(): boolean;
|
|
22
27
|
showProduct: boolean;
|
|
28
|
+
showConfigurator: boolean;
|
|
29
|
+
showSource: boolean;
|
|
23
30
|
safeUrl: SafeResourceUrl;
|
|
24
31
|
loaded: boolean;
|
|
25
32
|
externalUrl: string;
|
|
26
33
|
externalSettings: any;
|
|
34
|
+
token: string;
|
|
35
|
+
variant: string;
|
|
36
|
+
urlParams: ExternalSourceParameter[];
|
|
27
37
|
private _externalSource;
|
|
38
|
+
private _externalCatalogStartupInfo;
|
|
28
39
|
private _subs;
|
|
29
40
|
constructor(_sanitizer: DomSanitizer, _productConnectorService: ProductConnectorService, _appEventService: ProductEventService);
|
|
30
41
|
ngOnInit(): void;
|
|
31
42
|
ngOnDestroy(): void;
|
|
43
|
+
handleConfigurationFinished(variantString: string): void;
|
|
32
44
|
private _prepareExternalSource;
|
|
45
|
+
private _prepareCatFarm;
|
|
46
|
+
private _prepareConfigurator;
|
|
47
|
+
private _prepareSource;
|
|
48
|
+
private switchToProduct;
|
|
49
|
+
private switchToConfigurator;
|
|
50
|
+
private switchToSource;
|
|
33
51
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
|
|
2
|
+
import { ProductScriptLoaderService } from '../../service/product-script-loader.service';
|
|
3
|
+
import { ExternalSourceParameter } from '@colijnit/articleapi/build/model/external-source-parameter.bo';
|
|
4
|
+
export declare class ProductHdComponent implements OnDestroy {
|
|
5
|
+
private _scriptLoader;
|
|
6
|
+
private _renderer;
|
|
7
|
+
set content(child: any);
|
|
8
|
+
set sku(value: string);
|
|
9
|
+
get sku(): string;
|
|
10
|
+
token: string;
|
|
11
|
+
variant: string;
|
|
12
|
+
urlParams: ExternalSourceParameter[];
|
|
13
|
+
configuratorFinished: EventEmitter<string>;
|
|
14
|
+
configurationError: EventEmitter<any>;
|
|
15
|
+
showClass: boolean;
|
|
16
|
+
hdeConfigurator: ElementRef;
|
|
17
|
+
private _sku;
|
|
18
|
+
constructor(_scriptLoader: ProductScriptLoaderService, _renderer: Renderer2);
|
|
19
|
+
ngOnDestroy(): void;
|
|
20
|
+
handleConfigurationFinished(event: CustomEvent): void;
|
|
21
|
+
handleError(event: CustomEvent): void;
|
|
22
|
+
private _prepareAttributes;
|
|
23
|
+
private _prepareConfiguratorUrls;
|
|
24
|
+
private _loadTheScripts;
|
|
25
|
+
}
|
|
@@ -33,6 +33,7 @@ export declare class IoneProductComponent implements OnInit, OnChanges, OnDestro
|
|
|
33
33
|
onAddToQuote: EventEmitter<string>;
|
|
34
34
|
openStockEvent: EventEmitter<void>;
|
|
35
35
|
settingsLoaded: boolean;
|
|
36
|
+
showHD: boolean;
|
|
36
37
|
private _settings;
|
|
37
38
|
private _subs;
|
|
38
39
|
constructor(_dictionary: DictionaryService, _jsonUtils: JsonUtilsService, _ione: ProductConnectorService, _changeDetector: ChangeDetectorRef, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Renderer2 } from '@angular/core';
|
|
2
|
+
export declare class ProductScriptLoaderService {
|
|
3
|
+
private platformId;
|
|
4
|
+
private _scriptsOrLinksElements;
|
|
5
|
+
constructor(platformId: any);
|
|
6
|
+
loadScript(url: string, renderer: Renderer2): Promise<void>;
|
|
7
|
+
unloadScripts(renderer: Renderer2): void;
|
|
8
|
+
addStyleSheet(url: string, renderer: Renderer2): Promise<void>;
|
|
9
|
+
}
|
|
@@ -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 = "256.1.
|
|
35
|
-
this.publishDate = "
|
|
34
|
+
this.symVer = "256.1.5";
|
|
35
|
+
this.publishDate = "8-2-2025 23:16:14";
|
|
36
36
|
}
|
|
37
37
|
return Version;
|
|
38
38
|
}());
|
|
@@ -1323,6 +1323,7 @@
|
|
|
1323
1323
|
this.onAddToQuote = new i0.EventEmitter();
|
|
1324
1324
|
this.openStockEvent = new i0.EventEmitter();
|
|
1325
1325
|
this.settingsLoaded = false;
|
|
1326
|
+
this.showHD = false;
|
|
1326
1327
|
this._subs = [];
|
|
1327
1328
|
this._subs.push(
|
|
1328
1329
|
// this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
|
|
@@ -1389,7 +1390,7 @@
|
|
|
1389
1390
|
IoneProductComponent.decorators = [
|
|
1390
1391
|
{ type: i0.Component, args: [{
|
|
1391
1392
|
selector: 'app-ione-product',
|
|
1392
|
-
template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n [createFrozenArticle]=\"handleAddArticleInternally\"\n [isReturn]=\"isReturn\"\n (openStockEvent)=\"openStock()\"\n [sku]=\"sku\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n ></app-product-page>\n\n ",
|
|
1393
|
+
template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n [createFrozenArticle]=\"handleAddArticleInternally\"\n [isReturn]=\"isReturn\"\n (openStockEvent)=\"openStock()\"\n [sku]=\"sku\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n ></app-product-page>\n<!-- <co-button [label]=\"'click'\" (click)=\"showHD = !showHD\"></co-button>\n <co-product-hd [sku]=\"'657946ca-e1e1-41fd-7ae0-08dbf7df0cef'\" *ngIf=\"showHD\"></co-product-hd>-->\n ",
|
|
1393
1394
|
encapsulation: i0.ViewEncapsulation.Emulated,
|
|
1394
1395
|
styles: [""]
|
|
1395
1396
|
},] }
|
|
@@ -3302,33 +3303,227 @@
|
|
|
3302
3303
|
},] }
|
|
3303
3304
|
];
|
|
3304
3305
|
|
|
3305
|
-
var
|
|
3306
|
-
function
|
|
3306
|
+
var ProductScriptLoaderService = /** @class */ (function () {
|
|
3307
|
+
function ProductScriptLoaderService(platformId) {
|
|
3308
|
+
this.platformId = platformId;
|
|
3309
|
+
this._scriptsOrLinksElements = [];
|
|
3307
3310
|
}
|
|
3308
|
-
|
|
3311
|
+
ProductScriptLoaderService.prototype.loadScript = function (url, renderer) {
|
|
3312
|
+
var _this = this;
|
|
3313
|
+
return new Promise(function (resolve, reject) {
|
|
3314
|
+
if (!common.isPlatformBrowser(_this.platformId)) {
|
|
3315
|
+
reject('Not in browser environment');
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
var existingScript = document.getElementById(url);
|
|
3319
|
+
if (existingScript) {
|
|
3320
|
+
resolve(); // Script already loaded
|
|
3321
|
+
return;
|
|
3322
|
+
}
|
|
3323
|
+
var script = renderer.createElement('script');
|
|
3324
|
+
script.id = url;
|
|
3325
|
+
script.src = url;
|
|
3326
|
+
script.type = 'text/javascript';
|
|
3327
|
+
script.async = true;
|
|
3328
|
+
script.onload = function () { return resolve(); };
|
|
3329
|
+
script.onerror = function (error) { return reject("Error loading script: " + url); };
|
|
3330
|
+
renderer.appendChild(document.head, script);
|
|
3331
|
+
_this._scriptsOrLinksElements.push(script);
|
|
3332
|
+
});
|
|
3333
|
+
};
|
|
3334
|
+
ProductScriptLoaderService.prototype.unloadScripts = function (renderer) {
|
|
3335
|
+
for (var i = this._scriptsOrLinksElements.length - 1; i >= 0; i--) {
|
|
3336
|
+
renderer.removeChild(document.head, this._scriptsOrLinksElements[i]);
|
|
3337
|
+
this._scriptsOrLinksElements.pop();
|
|
3338
|
+
}
|
|
3339
|
+
};
|
|
3340
|
+
ProductScriptLoaderService.prototype.addStyleSheet = function (url, renderer) {
|
|
3341
|
+
var _this = this;
|
|
3342
|
+
return new Promise(function (resolve, reject) {
|
|
3343
|
+
if (!common.isPlatformBrowser(_this.platformId)) {
|
|
3344
|
+
reject('Not in browser environment');
|
|
3345
|
+
return;
|
|
3346
|
+
}
|
|
3347
|
+
var existingStyleSheet = document.getElementById(url);
|
|
3348
|
+
if (existingStyleSheet) {
|
|
3349
|
+
resolve(); // Script already loaded
|
|
3350
|
+
return;
|
|
3351
|
+
}
|
|
3352
|
+
var link = renderer.createElement('link');
|
|
3353
|
+
link.id = url;
|
|
3354
|
+
link.href = url;
|
|
3355
|
+
link.rel = 'stylesheet';
|
|
3356
|
+
link.onload = function () { return resolve(); };
|
|
3357
|
+
link.onerror = function (error) { return reject("Error loading styleSheet: " + url); };
|
|
3358
|
+
renderer.appendChild(document.head, link);
|
|
3359
|
+
_this._scriptsOrLinksElements.push(link);
|
|
3360
|
+
});
|
|
3361
|
+
};
|
|
3362
|
+
return ProductScriptLoaderService;
|
|
3309
3363
|
}());
|
|
3310
|
-
|
|
3364
|
+
ProductScriptLoaderService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ProductScriptLoaderService_Factory() { return new ProductScriptLoaderService(i0__namespace.ɵɵinject(i0__namespace.PLATFORM_ID)); }, token: ProductScriptLoaderService, providedIn: "root" });
|
|
3365
|
+
ProductScriptLoaderService.decorators = [
|
|
3366
|
+
{ type: i0.Injectable, args: [{
|
|
3367
|
+
providedIn: 'root'
|
|
3368
|
+
},] }
|
|
3369
|
+
];
|
|
3370
|
+
ProductScriptLoaderService.ctorParameters = function () { return [
|
|
3371
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
|
3372
|
+
]; };
|
|
3373
|
+
|
|
3374
|
+
var ProductHdComponent = /** @class */ (function () {
|
|
3375
|
+
function ProductHdComponent(_scriptLoader, _renderer) {
|
|
3376
|
+
this._scriptLoader = _scriptLoader;
|
|
3377
|
+
this._renderer = _renderer;
|
|
3378
|
+
this.variant = '';
|
|
3379
|
+
this.urlParams = [];
|
|
3380
|
+
this.configuratorFinished = new i0.EventEmitter();
|
|
3381
|
+
this.configurationError = new i0.EventEmitter();
|
|
3382
|
+
this.showClass = true;
|
|
3383
|
+
}
|
|
3384
|
+
Object.defineProperty(ProductHdComponent.prototype, "content", {
|
|
3385
|
+
set: function (child) {
|
|
3386
|
+
this.hdeConfigurator = child;
|
|
3387
|
+
this._prepareAttributes();
|
|
3388
|
+
},
|
|
3389
|
+
enumerable: false,
|
|
3390
|
+
configurable: true
|
|
3391
|
+
});
|
|
3392
|
+
Object.defineProperty(ProductHdComponent.prototype, "sku", {
|
|
3393
|
+
get: function () {
|
|
3394
|
+
return this._sku;
|
|
3395
|
+
},
|
|
3396
|
+
set: function (value) {
|
|
3397
|
+
this._sku = value;
|
|
3398
|
+
this._prepareAttributes();
|
|
3399
|
+
},
|
|
3400
|
+
enumerable: false,
|
|
3401
|
+
configurable: true
|
|
3402
|
+
});
|
|
3403
|
+
ProductHdComponent.prototype.ngOnDestroy = function () {
|
|
3404
|
+
this._scriptLoader.unloadScripts(this._renderer);
|
|
3405
|
+
};
|
|
3406
|
+
ProductHdComponent.prototype.handleConfigurationFinished = function (event) {
|
|
3407
|
+
if (event.detail.variant && typeof event.detail.variant === 'string') {
|
|
3408
|
+
this.configuratorFinished.emit(event.detail.variant);
|
|
3409
|
+
}
|
|
3410
|
+
else {
|
|
3411
|
+
this.configuratorFinished.emit(this.variant);
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
ProductHdComponent.prototype.handleError = function (event) {
|
|
3415
|
+
this.configurationError.emit(event.detail.status);
|
|
3416
|
+
};
|
|
3417
|
+
ProductHdComponent.prototype._prepareAttributes = function () {
|
|
3418
|
+
if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.urlParams && this.token && (this.sku || this.variant)) {
|
|
3419
|
+
//for local testing please turn off for packing and publishing!
|
|
3420
|
+
//this.prepareTestingUrlparams();
|
|
3421
|
+
this._prepareConfiguratorUrls();
|
|
3422
|
+
this.hdeConfigurator.nativeElement.setAttribute('bearerToken', this.token);
|
|
3423
|
+
if (this._sku) {
|
|
3424
|
+
this.hdeConfigurator.nativeElement.setAttribute('data-productId', this._sku);
|
|
3425
|
+
}
|
|
3426
|
+
if (this.variant) {
|
|
3427
|
+
this.hdeConfigurator.nativeElement.setAttribute('data-productVariantId', this.variant);
|
|
3428
|
+
}
|
|
3429
|
+
this._loadTheScripts();
|
|
3430
|
+
}
|
|
3431
|
+
};
|
|
3432
|
+
//set necessary references to configurator.
|
|
3433
|
+
ProductHdComponent.prototype._prepareConfiguratorUrls = function () {
|
|
3434
|
+
//fetch the setting from the external source
|
|
3435
|
+
var apiurl = this.urlParams.find(function (item) { return item.key === 'apiurl'; }).value;
|
|
3436
|
+
var productVariantCommandApiUrl = this.urlParams.find(function (item) { return item.key === 'productVariantCommandApiUrl'; }).value;
|
|
3437
|
+
var productVariantQueryApiUrl = this.urlParams.find(function (item) { return item.key === 'productVariantQueryApiUrl'; }).value;
|
|
3438
|
+
var localizationApiUrl = this.urlParams.find(function (item) { return item.key === 'localizationApiUrl'; }).value;
|
|
3439
|
+
//apply to configurator
|
|
3440
|
+
this.hdeConfigurator.nativeElement.setAttribute('apiurl', apiurl);
|
|
3441
|
+
this.hdeConfigurator.nativeElement.setAttribute('productVariantCommandApiUrl', productVariantCommandApiUrl);
|
|
3442
|
+
this.hdeConfigurator.nativeElement.setAttribute('productVariantQueryApiUrl', productVariantQueryApiUrl);
|
|
3443
|
+
this.hdeConfigurator.nativeElement.setAttribute('localizationApiUrl', localizationApiUrl);
|
|
3444
|
+
};
|
|
3445
|
+
// load external scripts into client
|
|
3446
|
+
ProductHdComponent.prototype._loadTheScripts = function () {
|
|
3447
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3448
|
+
var headerUrls, headerArray, i, styles, stylesArray, j;
|
|
3449
|
+
return __generator(this, function (_a) {
|
|
3450
|
+
switch (_a.label) {
|
|
3451
|
+
case 0:
|
|
3452
|
+
headerUrls = this.urlParams.find(function (item) { return item.key === 'header'; }).value;
|
|
3453
|
+
headerArray = headerUrls.replace(/\s+/g, '').split(',');
|
|
3454
|
+
i = 0;
|
|
3455
|
+
_a.label = 1;
|
|
3456
|
+
case 1:
|
|
3457
|
+
if (!(i < headerArray.length)) return [3 /*break*/, 4];
|
|
3458
|
+
return [4 /*yield*/, this._scriptLoader.loadScript(headerArray[i], this._renderer).catch(function (error) { return console.error(error); })];
|
|
3459
|
+
case 2:
|
|
3460
|
+
_a.sent();
|
|
3461
|
+
_a.label = 3;
|
|
3462
|
+
case 3:
|
|
3463
|
+
i++;
|
|
3464
|
+
return [3 /*break*/, 1];
|
|
3465
|
+
case 4:
|
|
3466
|
+
styles = this.urlParams.find(function (item) { return item.key === 'stylesheet'; }).value;
|
|
3467
|
+
stylesArray = styles.replace(/\s+/g, '').split(',');
|
|
3468
|
+
j = 0;
|
|
3469
|
+
_a.label = 5;
|
|
3470
|
+
case 5:
|
|
3471
|
+
if (!(j < stylesArray.length)) return [3 /*break*/, 8];
|
|
3472
|
+
return [4 /*yield*/, this._scriptLoader.addStyleSheet(stylesArray[j], this._renderer)];
|
|
3473
|
+
case 6:
|
|
3474
|
+
_a.sent();
|
|
3475
|
+
_a.label = 7;
|
|
3476
|
+
case 7:
|
|
3477
|
+
j++;
|
|
3478
|
+
return [3 /*break*/, 5];
|
|
3479
|
+
case 8: return [2 /*return*/];
|
|
3480
|
+
}
|
|
3481
|
+
});
|
|
3482
|
+
});
|
|
3483
|
+
};
|
|
3484
|
+
return ProductHdComponent;
|
|
3485
|
+
}());
|
|
3486
|
+
ProductHdComponent.decorators = [
|
|
3487
|
+
{ type: i0.Component, args: [{
|
|
3488
|
+
selector: 'co-product-hd',
|
|
3489
|
+
template: "\n <hde-configurator #hdeConfigurator\n language=\"nl\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
|
|
3490
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
3491
|
+
},] }
|
|
3492
|
+
];
|
|
3493
|
+
ProductHdComponent.ctorParameters = function () { return [
|
|
3494
|
+
{ type: ProductScriptLoaderService },
|
|
3495
|
+
{ type: i0.Renderer2 }
|
|
3496
|
+
]; };
|
|
3497
|
+
ProductHdComponent.propDecorators = {
|
|
3498
|
+
content: [{ type: i0.ViewChild, args: ['hdeConfigurator', { read: i0.ElementRef },] }],
|
|
3499
|
+
sku: [{ type: i0.Input }],
|
|
3500
|
+
token: [{ type: i0.Input }],
|
|
3501
|
+
variant: [{ type: i0.Input }],
|
|
3502
|
+
urlParams: [{ type: i0.Input }],
|
|
3503
|
+
configuratorFinished: [{ type: i0.Output }],
|
|
3504
|
+
configurationError: [{ type: i0.Output }],
|
|
3505
|
+
showClass: [{ type: i0.HostBinding, args: ['class.co-product-hd',] }]
|
|
3506
|
+
};
|
|
3507
|
+
|
|
3508
|
+
var ProductHdModule = /** @class */ (function () {
|
|
3509
|
+
function ProductHdModule() {
|
|
3510
|
+
}
|
|
3511
|
+
return ProductHdModule;
|
|
3512
|
+
}());
|
|
3513
|
+
ProductHdModule.decorators = [
|
|
3311
3514
|
{ type: i0.NgModule, args: [{
|
|
3312
3515
|
imports: [
|
|
3313
|
-
|
|
3314
|
-
common.CommonModule,
|
|
3315
|
-
ProductPageModule,
|
|
3316
|
-
corecomponents_v12.LoaderModule
|
|
3516
|
+
common.CommonModule
|
|
3317
3517
|
],
|
|
3318
3518
|
declarations: [
|
|
3319
|
-
|
|
3519
|
+
ProductHdComponent
|
|
3320
3520
|
],
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
bootstrap: [
|
|
3325
|
-
IoneProductComponent
|
|
3521
|
+
schemas: [
|
|
3522
|
+
i0.CUSTOM_ELEMENTS_SCHEMA,
|
|
3523
|
+
i0.NO_ERRORS_SCHEMA
|
|
3326
3524
|
],
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
ProductConnectorService,
|
|
3330
|
-
ProductEventService,
|
|
3331
|
-
ProductConnectorAdapterService
|
|
3525
|
+
exports: [
|
|
3526
|
+
ProductHdComponent
|
|
3332
3527
|
]
|
|
3333
3528
|
},] }
|
|
3334
3529
|
];
|
|
@@ -3341,9 +3536,15 @@
|
|
|
3341
3536
|
this.addToCart = new i0.EventEmitter();
|
|
3342
3537
|
this.addToQuote = new i0.EventEmitter();
|
|
3343
3538
|
this.alternativeClick = new i0.EventEmitter();
|
|
3539
|
+
this.configuratorFinished = new i0.EventEmitter();
|
|
3344
3540
|
this.showProduct = false;
|
|
3541
|
+
this.showConfigurator = false;
|
|
3542
|
+
this.showSource = false;
|
|
3345
3543
|
this.loaded = false;
|
|
3346
3544
|
this.externalSettings = {};
|
|
3545
|
+
this.token = ""; //= "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTczMjIwMjg5NSwiaXNzIjoiaHR0cHM6Ly9ibXNpZGVudGl0eS1hY2NlcHRhbmNlLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjpbImNhdGFsb2dxdWVyeWFwaSIsImNvbmZpZ3VyYXRvcmFwaSIsInByb2R1Y3R2YXJpYW50Y29tbWFuZGFwaSIsInByb2R1Y3R2YXJpYW50cXVlcnlhcGkiXSwiY2xpZW50X2lkIjoiaW1wZXJzb25hdGlvbi5jbGllbnQiLCJzd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Byb2R1Y3RwcmljZS5zZXR0aW5ncy5yZWFkIiwic2VsbGVyLnByb2R1Y3RwcmljZS5zZXR0aW5ncy53cml0ZSIsImNvbmZpZ3VyYXRvci5wdXJjaGFzZXByaWNlLnJlYWQiLCJzdG9jay5mYWJyaWMucmVhZCJdLCJuYW1lIjoiUm9iaW4iLCJmYW1pbHlfbmFtZSI6ImRlIFdpbnRlciAoQ29saWpuLUlUKSIsInJvbGUiOlsic2VsbGVyIiwiZGVhbGVyX21hbmFnZXIiXSwiaWF0IjoxNzMyMTk5Mjk1LCJzY29wZSI6WyJjYXRhbG9ncXVlcnlhcGkiLCJjb25maWd1cmF0b3JhcGkiLCJwcm9kdWN0dmFyaWFudGNvbW1hbmRhcGkiLCJwcm9kdWN0dmFyaWFudHF1ZXJ5YXBpIl0sImFtciI6WyJpbXBlcnNvbmF0aW9uIl19.rbguVPnkXXDzsM6QKgXulhrF41jIjCuGDV13ig1GC8MewLCJ7wA038OSwT26sx2mCexjvuGYt45YScfPwfTkDy3ErPmHRods64X1dJWZnf-23NTP2iI32K_1vMZH5GOGbMzuFtbKAFQv4hgFAxoyWqFVWyJvuOtQcWyZStROyPHwjAnpnj-x1cVQpOhbO-kQUFvy_VUrPpF3aYVCcO2cFirQTXR6kxSGcYGGcsPY-_eiAd93UdG2EM6xLAocDLaFV72CQI6XEs0WQG1f4SqvH52v3OTkgWBLgYV35gpyIe0-2nazGL0R8pTNuDqrOb7OGmuTRMoTIiRi67-wTxx8cQ";
|
|
3546
|
+
this.variant = "";
|
|
3547
|
+
this.urlParams = [];
|
|
3347
3548
|
this._subs = [];
|
|
3348
3549
|
}
|
|
3349
3550
|
Object.defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
|
|
@@ -3358,6 +3559,21 @@
|
|
|
3358
3559
|
enumerable: false,
|
|
3359
3560
|
configurable: true
|
|
3360
3561
|
});
|
|
3562
|
+
Object.defineProperty(ProductExternalSourceComponent.prototype, "externalCatalogStartupInfo", {
|
|
3563
|
+
get: function () {
|
|
3564
|
+
return this._externalCatalogStartupInfo;
|
|
3565
|
+
},
|
|
3566
|
+
set: function (value) {
|
|
3567
|
+
if (value) {
|
|
3568
|
+
this._externalCatalogStartupInfo = value;
|
|
3569
|
+
this.externalSource = value.externalSource;
|
|
3570
|
+
this.loaded = false;
|
|
3571
|
+
this._prepareExternalSource();
|
|
3572
|
+
}
|
|
3573
|
+
},
|
|
3574
|
+
enumerable: false,
|
|
3575
|
+
configurable: true
|
|
3576
|
+
});
|
|
3361
3577
|
ProductExternalSourceComponent.prototype.showClass = function () {
|
|
3362
3578
|
return true;
|
|
3363
3579
|
};
|
|
@@ -3382,9 +3598,11 @@
|
|
|
3382
3598
|
ProductExternalSourceComponent.prototype.ngOnDestroy = function () {
|
|
3383
3599
|
this._subs.forEach(function (s) { return s.unsubscribe(); });
|
|
3384
3600
|
};
|
|
3601
|
+
ProductExternalSourceComponent.prototype.handleConfigurationFinished = function (variantString) {
|
|
3602
|
+
this.configuratorFinished.emit(variantString);
|
|
3603
|
+
};
|
|
3385
3604
|
ProductExternalSourceComponent.prototype._prepareExternalSource = function () {
|
|
3386
3605
|
return __awaiter(this, void 0, void 0, function () {
|
|
3387
|
-
var bundleSettings;
|
|
3388
3606
|
return __generator(this, function (_a) {
|
|
3389
3607
|
switch (_a.label) {
|
|
3390
3608
|
case 0:
|
|
@@ -3394,7 +3612,29 @@
|
|
|
3394
3612
|
this.externalUrl = undefined;
|
|
3395
3613
|
this.externalSettings = {};
|
|
3396
3614
|
if (!(this.externalSource.type === 'CATF')) return [3 /*break*/, 2];
|
|
3397
|
-
return [4 /*yield*/, this.
|
|
3615
|
+
return [4 /*yield*/, this._prepareCatFarm()];
|
|
3616
|
+
case 1:
|
|
3617
|
+
_a.sent();
|
|
3618
|
+
return [3 /*break*/, 3];
|
|
3619
|
+
case 2:
|
|
3620
|
+
if (this.externalSource.type === 'HTDL') {
|
|
3621
|
+
this._prepareConfigurator();
|
|
3622
|
+
}
|
|
3623
|
+
else {
|
|
3624
|
+
this._prepareSource();
|
|
3625
|
+
}
|
|
3626
|
+
_a.label = 3;
|
|
3627
|
+
case 3: return [2 /*return*/];
|
|
3628
|
+
}
|
|
3629
|
+
});
|
|
3630
|
+
});
|
|
3631
|
+
};
|
|
3632
|
+
ProductExternalSourceComponent.prototype._prepareCatFarm = function () {
|
|
3633
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3634
|
+
var bundleSettings;
|
|
3635
|
+
return __generator(this, function (_a) {
|
|
3636
|
+
switch (_a.label) {
|
|
3637
|
+
case 0: return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
|
|
3398
3638
|
case 1:
|
|
3399
3639
|
bundleSettings = _a.sent();
|
|
3400
3640
|
this.externalSettings = JSON.parse(bundleSettings);
|
|
@@ -3409,26 +3649,50 @@
|
|
|
3409
3649
|
this.externalSettings.password = this.externalSource.password;
|
|
3410
3650
|
}
|
|
3411
3651
|
// finally show the catalog
|
|
3412
|
-
this.
|
|
3413
|
-
return [3 /*break*/, 3];
|
|
3414
|
-
case 2:
|
|
3415
|
-
this.externalUrl = this.externalSource.url;
|
|
3416
|
-
this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
|
|
3417
|
-
this.showProduct = false;
|
|
3418
|
-
_a.label = 3;
|
|
3419
|
-
case 3:
|
|
3652
|
+
this.switchToProduct();
|
|
3420
3653
|
this.loaded = true;
|
|
3421
3654
|
return [2 /*return*/];
|
|
3422
3655
|
}
|
|
3423
3656
|
});
|
|
3424
3657
|
});
|
|
3425
3658
|
};
|
|
3659
|
+
ProductExternalSourceComponent.prototype._prepareConfigurator = function () {
|
|
3660
|
+
if (this.externalCatalogStartupInfo) {
|
|
3661
|
+
this.token = this.externalCatalogStartupInfo.token;
|
|
3662
|
+
this.sku = this.externalCatalogStartupInfo.externalGoodId;
|
|
3663
|
+
this.variant = this.externalCatalogStartupInfo.flattenedGoodId;
|
|
3664
|
+
this.urlParams = this.externalCatalogStartupInfo.externalSource.parameters;
|
|
3665
|
+
this.switchToConfigurator();
|
|
3666
|
+
this.loaded = true;
|
|
3667
|
+
}
|
|
3668
|
+
};
|
|
3669
|
+
ProductExternalSourceComponent.prototype._prepareSource = function () {
|
|
3670
|
+
this.externalUrl = this.externalSource.url;
|
|
3671
|
+
this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
|
|
3672
|
+
this.switchToSource();
|
|
3673
|
+
this.loaded = true;
|
|
3674
|
+
};
|
|
3675
|
+
ProductExternalSourceComponent.prototype.switchToProduct = function () {
|
|
3676
|
+
this.showProduct = true;
|
|
3677
|
+
this.showConfigurator = false;
|
|
3678
|
+
this.showSource = false;
|
|
3679
|
+
};
|
|
3680
|
+
ProductExternalSourceComponent.prototype.switchToConfigurator = function () {
|
|
3681
|
+
this.showProduct = false;
|
|
3682
|
+
this.showConfigurator = true;
|
|
3683
|
+
this.showSource = false;
|
|
3684
|
+
};
|
|
3685
|
+
ProductExternalSourceComponent.prototype.switchToSource = function () {
|
|
3686
|
+
this.showProduct = false;
|
|
3687
|
+
this.showConfigurator = false;
|
|
3688
|
+
this.showSource = true;
|
|
3689
|
+
};
|
|
3426
3690
|
return ProductExternalSourceComponent;
|
|
3427
3691
|
}());
|
|
3428
3692
|
ProductExternalSourceComponent.decorators = [
|
|
3429
3693
|
{ type: i0.Component, args: [{
|
|
3430
3694
|
selector: 'co-product-external-source',
|
|
3431
|
-
template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"
|
|
3695
|
+
template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"showSource\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n <ng-container *ngIf=\"showConfigurator\">\n <co-product-hd width=\"100%\" height=\"100%\"\n [sku]=\"sku\"\n [variant]=\"variant\"\n [token]=\"token\"\n [urlParams]=\"urlParams\"\n (configuratorFinished)=\"handleConfigurationFinished($event)\"></co-product-hd>\n </ng-container>\n </ng-container>\n ",
|
|
3432
3696
|
providers: [
|
|
3433
3697
|
ProductSettingsService,
|
|
3434
3698
|
ProductConnectorAdapterService,
|
|
@@ -3446,10 +3710,12 @@
|
|
|
3446
3710
|
sku: [{ type: i0.Input }],
|
|
3447
3711
|
catalogDefinition: [{ type: i0.Input }],
|
|
3448
3712
|
externalSource: [{ type: i0.Input }],
|
|
3713
|
+
externalCatalogStartupInfo: [{ type: i0.Input }],
|
|
3449
3714
|
options: [{ type: i0.Input }],
|
|
3450
3715
|
addToCart: [{ type: i0.Output }],
|
|
3451
3716
|
addToQuote: [{ type: i0.Output }],
|
|
3452
3717
|
alternativeClick: [{ type: i0.Output }],
|
|
3718
|
+
configuratorFinished: [{ type: i0.Output }],
|
|
3453
3719
|
showClass: [{ type: i0.HostBinding, args: ['class.co-product-external-source',] }]
|
|
3454
3720
|
};
|
|
3455
3721
|
|
|
@@ -3462,7 +3728,8 @@
|
|
|
3462
3728
|
{ type: i0.NgModule, args: [{
|
|
3463
3729
|
imports: [
|
|
3464
3730
|
common.CommonModule,
|
|
3465
|
-
ProductPageModule
|
|
3731
|
+
ProductPageModule,
|
|
3732
|
+
ProductHdModule
|
|
3466
3733
|
],
|
|
3467
3734
|
declarations: [
|
|
3468
3735
|
ProductExternalSourceComponent
|
|
@@ -3473,6 +3740,43 @@
|
|
|
3473
3740
|
},] }
|
|
3474
3741
|
];
|
|
3475
3742
|
|
|
3743
|
+
var IoneProductModule = /** @class */ (function () {
|
|
3744
|
+
function IoneProductModule() {
|
|
3745
|
+
}
|
|
3746
|
+
return IoneProductModule;
|
|
3747
|
+
}());
|
|
3748
|
+
IoneProductModule.decorators = [
|
|
3749
|
+
{ type: i0.NgModule, args: [{
|
|
3750
|
+
imports: [
|
|
3751
|
+
//BrowserAnimationsModule,
|
|
3752
|
+
common.CommonModule,
|
|
3753
|
+
ProductPageModule,
|
|
3754
|
+
ProductHdModule,
|
|
3755
|
+
ProductExternalSourceModule,
|
|
3756
|
+
corecomponents_v12.ButtonModule
|
|
3757
|
+
],
|
|
3758
|
+
declarations: [
|
|
3759
|
+
IoneProductComponent
|
|
3760
|
+
],
|
|
3761
|
+
exports: [
|
|
3762
|
+
IoneProductComponent
|
|
3763
|
+
],
|
|
3764
|
+
schemas: [
|
|
3765
|
+
i0.CUSTOM_ELEMENTS_SCHEMA,
|
|
3766
|
+
i0.NO_ERRORS_SCHEMA
|
|
3767
|
+
],
|
|
3768
|
+
bootstrap: [
|
|
3769
|
+
IoneProductComponent
|
|
3770
|
+
],
|
|
3771
|
+
providers: [
|
|
3772
|
+
ProductSettingsService,
|
|
3773
|
+
ProductConnectorService,
|
|
3774
|
+
ProductEventService,
|
|
3775
|
+
ProductConnectorAdapterService
|
|
3776
|
+
]
|
|
3777
|
+
},] }
|
|
3778
|
+
];
|
|
3779
|
+
|
|
3476
3780
|
/**
|
|
3477
3781
|
* Generated bundle index. Do not edit.
|
|
3478
3782
|
*/
|
|
@@ -3501,6 +3805,9 @@
|
|
|
3501
3805
|
exports["ɵbk"] = ProductDialogModule;
|
|
3502
3806
|
exports["ɵbl"] = ProductDialogComponent;
|
|
3503
3807
|
exports["ɵbm"] = ProductPageComponent;
|
|
3808
|
+
exports["ɵbn"] = ProductHdModule;
|
|
3809
|
+
exports["ɵbo"] = ProductHdComponent;
|
|
3810
|
+
exports["ɵbp"] = ProductScriptLoaderService;
|
|
3504
3811
|
exports["ɵc"] = PipeModule;
|
|
3505
3812
|
exports["ɵd"] = LocalizePipe;
|
|
3506
3813
|
exports["ɵe"] = DictionaryService;
|