@colijnit/product 256.1.3 → 256.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/product-external-source/product-external-source.component.d.ts +16 -0
- package/app/components/product-hd/product-hd.component.d.ts +22 -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 +312 -34
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product-256.1.3.tgz +0 -0
- 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 +82 -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 +99 -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 +296 -44
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -1
- package/colijnit-product-256.1.2.tgz +0 -0
|
@@ -6,6 +6,7 @@ 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';
|
|
9
10
|
export declare class ProductExternalSourceComponent implements OnInit, OnDestroy {
|
|
10
11
|
private _sanitizer;
|
|
11
12
|
private _productConnectorService;
|
|
@@ -14,20 +15,35 @@ export declare class ProductExternalSourceComponent implements OnInit, OnDestroy
|
|
|
14
15
|
catalogDefinition: CatalogDefinition;
|
|
15
16
|
set externalSource(value: ExternalSource);
|
|
16
17
|
get externalSource(): ExternalSource;
|
|
18
|
+
set externalCatalogStartupInfo(value: ExternalCatalogStartupInfo);
|
|
19
|
+
get externalCatalogStartupInfo(): ExternalCatalogStartupInfo;
|
|
17
20
|
options: {};
|
|
18
21
|
addToCart: EventEmitter<ExternalSourceArticleAddInterface>;
|
|
19
22
|
addToQuote: EventEmitter<ExternalSourceArticleAddInterface>;
|
|
20
23
|
alternativeClick: EventEmitter<ArticleListObject>;
|
|
24
|
+
configuratorFinished: EventEmitter<string>;
|
|
21
25
|
showClass(): boolean;
|
|
22
26
|
showProduct: boolean;
|
|
27
|
+
showConfigurator: boolean;
|
|
28
|
+
showSource: boolean;
|
|
23
29
|
safeUrl: SafeResourceUrl;
|
|
24
30
|
loaded: boolean;
|
|
25
31
|
externalUrl: string;
|
|
26
32
|
externalSettings: any;
|
|
33
|
+
token: string;
|
|
34
|
+
variant: string;
|
|
27
35
|
private _externalSource;
|
|
36
|
+
private _externalCatalogStartupInfo;
|
|
28
37
|
private _subs;
|
|
29
38
|
constructor(_sanitizer: DomSanitizer, _productConnectorService: ProductConnectorService, _appEventService: ProductEventService);
|
|
30
39
|
ngOnInit(): void;
|
|
31
40
|
ngOnDestroy(): void;
|
|
41
|
+
handleConfigurationFinished(variantString: string): void;
|
|
32
42
|
private _prepareExternalSource;
|
|
43
|
+
private _prepareCatFarm;
|
|
44
|
+
private _prepareConfigurator;
|
|
45
|
+
private _prepareSource;
|
|
46
|
+
private switchToProduct;
|
|
47
|
+
private switchToConfigurator;
|
|
48
|
+
private switchToSource;
|
|
33
49
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
|
|
2
|
+
import { ProductScriptLoaderService } from '../../service/product-script-loader.service';
|
|
3
|
+
export declare class ProductHdComponent implements OnDestroy {
|
|
4
|
+
private _scriptLoader;
|
|
5
|
+
private _renderer;
|
|
6
|
+
set content(child: any);
|
|
7
|
+
set sku(value: string);
|
|
8
|
+
get sku(): string;
|
|
9
|
+
token: string;
|
|
10
|
+
variant: string;
|
|
11
|
+
configuratorFinished: EventEmitter<string>;
|
|
12
|
+
configurationError: EventEmitter<any>;
|
|
13
|
+
showClass: boolean;
|
|
14
|
+
hdeConfigurator: ElementRef;
|
|
15
|
+
private _sku;
|
|
16
|
+
constructor(_scriptLoader: ProductScriptLoaderService, _renderer: Renderer2);
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
handleConfigurationFinished(event: CustomEvent): void;
|
|
19
|
+
handleError(event: CustomEvent): void;
|
|
20
|
+
private _prepareAttributes;
|
|
21
|
+
private _loadTheScripts;
|
|
22
|
+
}
|
|
@@ -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.4";
|
|
35
|
+
this.publishDate = "22-1-2025 20:45:30";
|
|
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,202 @@
|
|
|
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.configuratorFinished = new i0.EventEmitter();
|
|
3380
|
+
this.configurationError = new i0.EventEmitter();
|
|
3381
|
+
this.showClass = true;
|
|
3382
|
+
}
|
|
3383
|
+
Object.defineProperty(ProductHdComponent.prototype, "content", {
|
|
3384
|
+
set: function (child) {
|
|
3385
|
+
this.hdeConfigurator = child;
|
|
3386
|
+
this._prepareAttributes();
|
|
3387
|
+
},
|
|
3388
|
+
enumerable: false,
|
|
3389
|
+
configurable: true
|
|
3390
|
+
});
|
|
3391
|
+
Object.defineProperty(ProductHdComponent.prototype, "sku", {
|
|
3392
|
+
get: function () {
|
|
3393
|
+
return this._sku;
|
|
3394
|
+
},
|
|
3395
|
+
set: function (value) {
|
|
3396
|
+
this._sku = value;
|
|
3397
|
+
this._prepareAttributes();
|
|
3398
|
+
},
|
|
3399
|
+
enumerable: false,
|
|
3400
|
+
configurable: true
|
|
3401
|
+
});
|
|
3402
|
+
ProductHdComponent.prototype.ngOnDestroy = function () {
|
|
3403
|
+
this._scriptLoader.unloadScripts(this._renderer);
|
|
3404
|
+
};
|
|
3405
|
+
ProductHdComponent.prototype.handleConfigurationFinished = function (event) {
|
|
3406
|
+
if (event.detail.variant && typeof event.detail.variant === 'string') {
|
|
3407
|
+
this.configuratorFinished.emit(event.detail.variant);
|
|
3408
|
+
}
|
|
3409
|
+
else {
|
|
3410
|
+
this.configuratorFinished.emit(this.variant);
|
|
3411
|
+
}
|
|
3412
|
+
};
|
|
3413
|
+
ProductHdComponent.prototype.handleError = function (event) {
|
|
3414
|
+
this.configurationError.emit(event.detail.status);
|
|
3415
|
+
};
|
|
3416
|
+
ProductHdComponent.prototype._prepareAttributes = function () {
|
|
3417
|
+
if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.token && (this.sku || this.variant)) {
|
|
3418
|
+
this.hdeConfigurator.nativeElement.setAttribute('bearerToken', this.token);
|
|
3419
|
+
if (this._sku) {
|
|
3420
|
+
this.hdeConfigurator.nativeElement.setAttribute('data-productId', this._sku);
|
|
3421
|
+
}
|
|
3422
|
+
if (this.variant) {
|
|
3423
|
+
this.hdeConfigurator.nativeElement.setAttribute('data-productVariantId', this.variant);
|
|
3424
|
+
}
|
|
3425
|
+
this._loadTheScripts();
|
|
3426
|
+
}
|
|
3427
|
+
};
|
|
3428
|
+
// load external scripts
|
|
3429
|
+
ProductHdComponent.prototype._loadTheScripts = function () {
|
|
3430
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3431
|
+
var scripts, i;
|
|
3432
|
+
return __generator(this, function (_a) {
|
|
3433
|
+
switch (_a.label) {
|
|
3434
|
+
case 0:
|
|
3435
|
+
scripts = [
|
|
3436
|
+
// hard-coded for now, should come from the external source
|
|
3437
|
+
'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/polyfills.js',
|
|
3438
|
+
'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/runtime.js',
|
|
3439
|
+
'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/main.js'
|
|
3440
|
+
];
|
|
3441
|
+
i = 0;
|
|
3442
|
+
_a.label = 1;
|
|
3443
|
+
case 1:
|
|
3444
|
+
if (!(i < scripts.length)) return [3 /*break*/, 4];
|
|
3445
|
+
return [4 /*yield*/, this._scriptLoader.loadScript(scripts[i], this._renderer).catch(function (error) { return console.error(error); })];
|
|
3446
|
+
case 2:
|
|
3447
|
+
_a.sent();
|
|
3448
|
+
_a.label = 3;
|
|
3449
|
+
case 3:
|
|
3450
|
+
i++;
|
|
3451
|
+
return [3 /*break*/, 1];
|
|
3452
|
+
case 4: return [4 /*yield*/, this._scriptLoader.addStyleSheet('https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/styles.css', this._renderer)];
|
|
3453
|
+
case 5:
|
|
3454
|
+
_a.sent();
|
|
3455
|
+
return [2 /*return*/];
|
|
3456
|
+
}
|
|
3457
|
+
});
|
|
3458
|
+
});
|
|
3459
|
+
};
|
|
3460
|
+
return ProductHdComponent;
|
|
3461
|
+
}());
|
|
3462
|
+
ProductHdComponent.decorators = [
|
|
3463
|
+
{ type: i0.Component, args: [{
|
|
3464
|
+
selector: 'co-product-hd',
|
|
3465
|
+
template: "\n <hde-configurator #hdeConfigurator\n apiurl=\"https://bmsproductconfigurator-acceptance.azurewebsites.net/api/configurator/\"\n productVariantCommandApiUrl=\"https://bmsproductvariantcommand-acceptance.azurewebsites.net/\"\n productVariantQueryApiUrl=\"https://bmsproductvariantquery-acceptance.azurewebsites.net/\"\n language=\"nl\"\n localizationApiUrl=\"https://hde-cdn.azureedge.net/libs/BMS.DST.Localization/\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
|
|
3466
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
3467
|
+
},] }
|
|
3468
|
+
];
|
|
3469
|
+
ProductHdComponent.ctorParameters = function () { return [
|
|
3470
|
+
{ type: ProductScriptLoaderService },
|
|
3471
|
+
{ type: i0.Renderer2 }
|
|
3472
|
+
]; };
|
|
3473
|
+
ProductHdComponent.propDecorators = {
|
|
3474
|
+
content: [{ type: i0.ViewChild, args: ['hdeConfigurator', { read: i0.ElementRef },] }],
|
|
3475
|
+
sku: [{ type: i0.Input }],
|
|
3476
|
+
token: [{ type: i0.Input }],
|
|
3477
|
+
variant: [{ type: i0.Input }],
|
|
3478
|
+
configuratorFinished: [{ type: i0.Output }],
|
|
3479
|
+
configurationError: [{ type: i0.Output }],
|
|
3480
|
+
showClass: [{ type: i0.HostBinding, args: ['class.co-product-hd',] }]
|
|
3481
|
+
};
|
|
3482
|
+
|
|
3483
|
+
var ProductHdModule = /** @class */ (function () {
|
|
3484
|
+
function ProductHdModule() {
|
|
3485
|
+
}
|
|
3486
|
+
return ProductHdModule;
|
|
3487
|
+
}());
|
|
3488
|
+
ProductHdModule.decorators = [
|
|
3311
3489
|
{ type: i0.NgModule, args: [{
|
|
3312
3490
|
imports: [
|
|
3313
|
-
|
|
3314
|
-
common.CommonModule,
|
|
3315
|
-
ProductPageModule,
|
|
3316
|
-
corecomponents_v12.LoaderModule
|
|
3491
|
+
common.CommonModule
|
|
3317
3492
|
],
|
|
3318
3493
|
declarations: [
|
|
3319
|
-
|
|
3320
|
-
],
|
|
3321
|
-
exports: [
|
|
3322
|
-
IoneProductComponent
|
|
3494
|
+
ProductHdComponent
|
|
3323
3495
|
],
|
|
3324
|
-
|
|
3325
|
-
|
|
3496
|
+
schemas: [
|
|
3497
|
+
i0.CUSTOM_ELEMENTS_SCHEMA,
|
|
3498
|
+
i0.NO_ERRORS_SCHEMA
|
|
3326
3499
|
],
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
ProductConnectorService,
|
|
3330
|
-
ProductEventService,
|
|
3331
|
-
ProductConnectorAdapterService
|
|
3500
|
+
exports: [
|
|
3501
|
+
ProductHdComponent
|
|
3332
3502
|
]
|
|
3333
3503
|
},] }
|
|
3334
3504
|
];
|
|
@@ -3341,9 +3511,14 @@
|
|
|
3341
3511
|
this.addToCart = new i0.EventEmitter();
|
|
3342
3512
|
this.addToQuote = new i0.EventEmitter();
|
|
3343
3513
|
this.alternativeClick = new i0.EventEmitter();
|
|
3514
|
+
this.configuratorFinished = new i0.EventEmitter();
|
|
3344
3515
|
this.showProduct = false;
|
|
3516
|
+
this.showConfigurator = false;
|
|
3517
|
+
this.showSource = false;
|
|
3345
3518
|
this.loaded = false;
|
|
3346
3519
|
this.externalSettings = {};
|
|
3520
|
+
this.token = ""; //= "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTczMjIwMjg5NSwiaXNzIjoiaHR0cHM6Ly9ibXNpZGVudGl0eS1hY2NlcHRhbmNlLmF6d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defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
|
|
@@ -3358,6 +3533,19 @@
|
|
|
3358
3533
|
enumerable: false,
|
|
3359
3534
|
configurable: true
|
|
3360
3535
|
});
|
|
3536
|
+
Object.defineProperty(ProductExternalSourceComponent.prototype, "externalCatalogStartupInfo", {
|
|
3537
|
+
get: function () {
|
|
3538
|
+
return this._externalCatalogStartupInfo;
|
|
3539
|
+
},
|
|
3540
|
+
set: function (value) {
|
|
3541
|
+
this._externalCatalogStartupInfo = value;
|
|
3542
|
+
this.externalSource = value.externalSource;
|
|
3543
|
+
this.loaded = false;
|
|
3544
|
+
this._prepareExternalSource();
|
|
3545
|
+
},
|
|
3546
|
+
enumerable: false,
|
|
3547
|
+
configurable: true
|
|
3548
|
+
});
|
|
3361
3549
|
ProductExternalSourceComponent.prototype.showClass = function () {
|
|
3362
3550
|
return true;
|
|
3363
3551
|
};
|
|
@@ -3382,9 +3570,11 @@
|
|
|
3382
3570
|
ProductExternalSourceComponent.prototype.ngOnDestroy = function () {
|
|
3383
3571
|
this._subs.forEach(function (s) { return s.unsubscribe(); });
|
|
3384
3572
|
};
|
|
3573
|
+
ProductExternalSourceComponent.prototype.handleConfigurationFinished = function (variantString) {
|
|
3574
|
+
this.configuratorFinished.emit(variantString);
|
|
3575
|
+
};
|
|
3385
3576
|
ProductExternalSourceComponent.prototype._prepareExternalSource = function () {
|
|
3386
3577
|
return __awaiter(this, void 0, void 0, function () {
|
|
3387
|
-
var bundleSettings;
|
|
3388
3578
|
return __generator(this, function (_a) {
|
|
3389
3579
|
switch (_a.label) {
|
|
3390
3580
|
case 0:
|
|
@@ -3394,7 +3584,29 @@
|
|
|
3394
3584
|
this.externalUrl = undefined;
|
|
3395
3585
|
this.externalSettings = {};
|
|
3396
3586
|
if (!(this.externalSource.type === 'CATF')) return [3 /*break*/, 2];
|
|
3397
|
-
return [4 /*yield*/, this.
|
|
3587
|
+
return [4 /*yield*/, this._prepareCatFarm()];
|
|
3588
|
+
case 1:
|
|
3589
|
+
_a.sent();
|
|
3590
|
+
return [3 /*break*/, 3];
|
|
3591
|
+
case 2:
|
|
3592
|
+
if (this.externalSource.type === 'HTDL') {
|
|
3593
|
+
this._prepareConfigurator();
|
|
3594
|
+
}
|
|
3595
|
+
else {
|
|
3596
|
+
this._prepareSource();
|
|
3597
|
+
}
|
|
3598
|
+
_a.label = 3;
|
|
3599
|
+
case 3: return [2 /*return*/];
|
|
3600
|
+
}
|
|
3601
|
+
});
|
|
3602
|
+
});
|
|
3603
|
+
};
|
|
3604
|
+
ProductExternalSourceComponent.prototype._prepareCatFarm = function () {
|
|
3605
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3606
|
+
var bundleSettings;
|
|
3607
|
+
return __generator(this, function (_a) {
|
|
3608
|
+
switch (_a.label) {
|
|
3609
|
+
case 0: return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
|
|
3398
3610
|
case 1:
|
|
3399
3611
|
bundleSettings = _a.sent();
|
|
3400
3612
|
this.externalSettings = JSON.parse(bundleSettings);
|
|
@@ -3409,26 +3621,49 @@
|
|
|
3409
3621
|
this.externalSettings.password = this.externalSource.password;
|
|
3410
3622
|
}
|
|
3411
3623
|
// 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:
|
|
3624
|
+
this.switchToProduct();
|
|
3420
3625
|
this.loaded = true;
|
|
3421
3626
|
return [2 /*return*/];
|
|
3422
3627
|
}
|
|
3423
3628
|
});
|
|
3424
3629
|
});
|
|
3425
3630
|
};
|
|
3631
|
+
ProductExternalSourceComponent.prototype._prepareConfigurator = function () {
|
|
3632
|
+
if (this.externalCatalogStartupInfo) {
|
|
3633
|
+
this.token = this.externalCatalogStartupInfo.token;
|
|
3634
|
+
this.sku = this.externalCatalogStartupInfo.externalGoodId;
|
|
3635
|
+
this.variant = this.externalCatalogStartupInfo.flattenedGoodId;
|
|
3636
|
+
this.switchToConfigurator();
|
|
3637
|
+
this.loaded = true;
|
|
3638
|
+
}
|
|
3639
|
+
};
|
|
3640
|
+
ProductExternalSourceComponent.prototype._prepareSource = function () {
|
|
3641
|
+
this.externalUrl = this.externalSource.url;
|
|
3642
|
+
this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
|
|
3643
|
+
this.switchToSource();
|
|
3644
|
+
this.loaded = true;
|
|
3645
|
+
};
|
|
3646
|
+
ProductExternalSourceComponent.prototype.switchToProduct = function () {
|
|
3647
|
+
this.showProduct = true;
|
|
3648
|
+
this.showConfigurator = false;
|
|
3649
|
+
this.showSource = false;
|
|
3650
|
+
};
|
|
3651
|
+
ProductExternalSourceComponent.prototype.switchToConfigurator = function () {
|
|
3652
|
+
this.showProduct = false;
|
|
3653
|
+
this.showConfigurator = true;
|
|
3654
|
+
this.showSource = false;
|
|
3655
|
+
};
|
|
3656
|
+
ProductExternalSourceComponent.prototype.switchToSource = function () {
|
|
3657
|
+
this.showProduct = false;
|
|
3658
|
+
this.showConfigurator = false;
|
|
3659
|
+
this.showSource = true;
|
|
3660
|
+
};
|
|
3426
3661
|
return ProductExternalSourceComponent;
|
|
3427
3662
|
}());
|
|
3428
3663
|
ProductExternalSourceComponent.decorators = [
|
|
3429
3664
|
{ type: i0.Component, args: [{
|
|
3430
3665
|
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=\"
|
|
3666
|
+
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 (configuratorFinished)=\"handleConfigurationFinished($event)\"></co-product-hd>\n </ng-container>\n </ng-container>\n ",
|
|
3432
3667
|
providers: [
|
|
3433
3668
|
ProductSettingsService,
|
|
3434
3669
|
ProductConnectorAdapterService,
|
|
@@ -3446,10 +3681,12 @@
|
|
|
3446
3681
|
sku: [{ type: i0.Input }],
|
|
3447
3682
|
catalogDefinition: [{ type: i0.Input }],
|
|
3448
3683
|
externalSource: [{ type: i0.Input }],
|
|
3684
|
+
externalCatalogStartupInfo: [{ type: i0.Input }],
|
|
3449
3685
|
options: [{ type: i0.Input }],
|
|
3450
3686
|
addToCart: [{ type: i0.Output }],
|
|
3451
3687
|
addToQuote: [{ type: i0.Output }],
|
|
3452
3688
|
alternativeClick: [{ type: i0.Output }],
|
|
3689
|
+
configuratorFinished: [{ type: i0.Output }],
|
|
3453
3690
|
showClass: [{ type: i0.HostBinding, args: ['class.co-product-external-source',] }]
|
|
3454
3691
|
};
|
|
3455
3692
|
|
|
@@ -3462,7 +3699,8 @@
|
|
|
3462
3699
|
{ type: i0.NgModule, args: [{
|
|
3463
3700
|
imports: [
|
|
3464
3701
|
common.CommonModule,
|
|
3465
|
-
ProductPageModule
|
|
3702
|
+
ProductPageModule,
|
|
3703
|
+
ProductHdModule
|
|
3466
3704
|
],
|
|
3467
3705
|
declarations: [
|
|
3468
3706
|
ProductExternalSourceComponent
|
|
@@ -3473,6 +3711,43 @@
|
|
|
3473
3711
|
},] }
|
|
3474
3712
|
];
|
|
3475
3713
|
|
|
3714
|
+
var IoneProductModule = /** @class */ (function () {
|
|
3715
|
+
function IoneProductModule() {
|
|
3716
|
+
}
|
|
3717
|
+
return IoneProductModule;
|
|
3718
|
+
}());
|
|
3719
|
+
IoneProductModule.decorators = [
|
|
3720
|
+
{ type: i0.NgModule, args: [{
|
|
3721
|
+
imports: [
|
|
3722
|
+
//BrowserAnimationsModule,
|
|
3723
|
+
common.CommonModule,
|
|
3724
|
+
ProductPageModule,
|
|
3725
|
+
ProductHdModule,
|
|
3726
|
+
ProductExternalSourceModule,
|
|
3727
|
+
corecomponents_v12.ButtonModule
|
|
3728
|
+
],
|
|
3729
|
+
declarations: [
|
|
3730
|
+
IoneProductComponent
|
|
3731
|
+
],
|
|
3732
|
+
exports: [
|
|
3733
|
+
IoneProductComponent
|
|
3734
|
+
],
|
|
3735
|
+
schemas: [
|
|
3736
|
+
i0.CUSTOM_ELEMENTS_SCHEMA,
|
|
3737
|
+
i0.NO_ERRORS_SCHEMA
|
|
3738
|
+
],
|
|
3739
|
+
bootstrap: [
|
|
3740
|
+
IoneProductComponent
|
|
3741
|
+
],
|
|
3742
|
+
providers: [
|
|
3743
|
+
ProductSettingsService,
|
|
3744
|
+
ProductConnectorService,
|
|
3745
|
+
ProductEventService,
|
|
3746
|
+
ProductConnectorAdapterService
|
|
3747
|
+
]
|
|
3748
|
+
},] }
|
|
3749
|
+
];
|
|
3750
|
+
|
|
3476
3751
|
/**
|
|
3477
3752
|
* Generated bundle index. Do not edit.
|
|
3478
3753
|
*/
|
|
@@ -3501,6 +3776,9 @@
|
|
|
3501
3776
|
exports["ɵbk"] = ProductDialogModule;
|
|
3502
3777
|
exports["ɵbl"] = ProductDialogComponent;
|
|
3503
3778
|
exports["ɵbm"] = ProductPageComponent;
|
|
3779
|
+
exports["ɵbn"] = ProductHdModule;
|
|
3780
|
+
exports["ɵbo"] = ProductHdComponent;
|
|
3781
|
+
exports["ɵbp"] = ProductScriptLoaderService;
|
|
3504
3782
|
exports["ɵc"] = PipeModule;
|
|
3505
3783
|
exports["ɵd"] = LocalizePipe;
|
|
3506
3784
|
exports["ɵe"] = DictionaryService;
|