@colijnit/product 256.1.3 → 257.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectorRef, Input, Output, Renderer2, ViewChild, ElementRef, Pipe, NgModule, HostListener, HostBinding, SecurityContext, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Injectable, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectorRef, Input, Output, Renderer2, ViewChild, ElementRef, Pipe, NgModule, HostListener, HostBinding, SecurityContext, CUSTOM_ELEMENTS_SCHEMA, Inject, PLATFORM_ID, NO_ERRORS_SCHEMA } from '@angular/core';
3
3
  import { __awaiter } from 'tslib';
4
4
  import { Subject, BehaviorSubject } from 'rxjs';
5
5
  import { Options } from '@colijnit/ioneconnector/build/model/options';
@@ -16,7 +16,7 @@ import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/arti
16
16
  import * as i1 from '@angular/common/http';
17
17
  import { HttpClient } from '@angular/common/http';
18
18
  import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
19
- import { CommonModule } from '@angular/common';
19
+ import { CommonModule, isPlatformBrowser } from '@angular/common';
20
20
  import { trigger, state, style, transition, animate } from '@angular/animations';
21
21
  import * as i1$1 from '@angular/platform-browser';
22
22
  import { DomSanitizer } from '@angular/platform-browser';
@@ -30,8 +30,8 @@ class Version {
30
30
  constructor() {
31
31
  this.name = "@colijnit/product";
32
32
  this.description = "Product detail page project for iOne";
33
- this.symVer = "256.1.3";
34
- this.publishDate = "20-11-2024 10:30:57";
33
+ this.symVer = "257.1.0";
34
+ this.publishDate = "1/14/2025, 12:10:32 PM";
35
35
  }
36
36
  }
37
37
 
@@ -721,7 +721,9 @@ IoneProductComponent.decorators = [
721
721
  [sku]="sku"
722
722
  [showRelatedProductsPopup]="showRelatedProductsPopup"
723
723
  ></app-product-page>
724
-
724
+ <!--
725
+ <co-product-hd [sku]="'8f108aa9-f6cb-4d86-7826-08d87757dac1'"></co-product-hd>
726
+ -->
725
727
  `,
726
728
  encapsulation: ViewEncapsulation.Emulated,
727
729
  styles: [""]
@@ -2613,6 +2615,165 @@ ProductPageModule.decorators = [
2613
2615
  },] }
2614
2616
  ];
2615
2617
 
2618
+ class ProductScriptLoaderService {
2619
+ constructor(platformId) {
2620
+ this.platformId = platformId;
2621
+ }
2622
+ loadScript(url, renderer) {
2623
+ return new Promise((resolve, reject) => {
2624
+ if (!isPlatformBrowser(this.platformId)) {
2625
+ reject('Not in browser environment');
2626
+ return;
2627
+ }
2628
+ const existingScript = document.getElementById(url);
2629
+ if (existingScript) {
2630
+ resolve(); // Script already loaded
2631
+ return;
2632
+ }
2633
+ const script = renderer.createElement('script');
2634
+ script.id = url;
2635
+ script.src = url;
2636
+ script.type = 'text/javascript';
2637
+ script.async = true;
2638
+ script.onload = () => resolve();
2639
+ script.onerror = (error) => reject(`Error loading script: ${url}`);
2640
+ renderer.appendChild(document.head, script);
2641
+ });
2642
+ }
2643
+ addStyleSheet(url, renderer) {
2644
+ return new Promise((resolve, reject) => {
2645
+ if (!isPlatformBrowser(this.platformId)) {
2646
+ reject('Not in browser environment');
2647
+ return;
2648
+ }
2649
+ const existingStyleSheet = document.getElementById(url);
2650
+ if (existingStyleSheet) {
2651
+ resolve(); // Script already loaded
2652
+ return;
2653
+ }
2654
+ const link = renderer.createElement('link');
2655
+ link.id = url;
2656
+ link.href = url;
2657
+ link.rel = 'stylesheet';
2658
+ link.onload = () => resolve();
2659
+ link.onerror = (error) => reject(`Error loading styleSheet: ${url}`);
2660
+ renderer.appendChild(document.head, link);
2661
+ });
2662
+ }
2663
+ }
2664
+ ProductScriptLoaderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductScriptLoaderService_Factory() { return new ProductScriptLoaderService(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: ProductScriptLoaderService, providedIn: "root" });
2665
+ ProductScriptLoaderService.decorators = [
2666
+ { type: Injectable, args: [{
2667
+ providedIn: 'root'
2668
+ },] }
2669
+ ];
2670
+ ProductScriptLoaderService.ctorParameters = () => [
2671
+ { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
2672
+ ];
2673
+
2674
+ class ProductHdComponent {
2675
+ constructor(_scriptLoader, _renderer) {
2676
+ this._scriptLoader = _scriptLoader;
2677
+ this._renderer = _renderer;
2678
+ this.showClass = true;
2679
+ this.token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTczMjIwMjg5NSwiaXNzIjoiaHR0cHM6Ly9ibXNpZGVudGl0eS1hY2NlcHRhbmNlLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjpbImNhdGFsb2dxdWVyeWFwaSIsImNvbmZpZ3VyYXRvcmFwaSIsInByb2R1Y3R2YXJpYW50Y29tbWFuZGFwaSIsInByb2R1Y3R2YXJpYW50cXVlcnlhcGkiXSwiY2xpZW50X2lkIjoiaW1wZXJzb25hdGlvbi5jbGllbnQiLCJzdWIiOiIwOTMwZDI4Mi05NGU4LTQ5MGEtOGI2NC1mYTk1YmIyYzE1ODIiLCJhdXRoX3RpbWUiOjE3MzIxOTkyOTUsImlkcCI6ImxvY2FsIiwiZW52aXJvbm1lbnQiOiJNU0wiLCJzZWxsZXIiOiJTRTAwMDA5NiIsInNlbGxlcmd1aWQiOiIxMDk1MWJjNS1hZmMzLTQ1MGEtNmVkMS0wOGQ4NDNlNmE5OTQiLCJwZXJtaXNzaW9uIjpbInNhbGVzLmV4cG9ydHRlbXBsYXRlcy5yZWFkIiwiZG9jdW1lbnRsaWJyYXJ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bG9ncXVlcnlhcGkiLCJjb25maWd1cmF0b3JhcGkiLCJwcm9kdWN0dmFyaWFudGNvbW1hbmRhcGkiLCJwcm9kdWN0dmFyaWFudHF1ZXJ5YXBpIl0sImFtciI6WyJpbXBlcnNvbmF0aW9uIl19.rbguVPnkXXDzsM6QKgXulhrF41jIjCuGDV13ig1GC8MewLCJ7wA038OSwT26sx2mCexjvuGYt45YScfPwfTkDy3ErPmHRods64X1dJWZnf-23NTP2iI32K_1vMZH5GOGbMzuFtbKAFQv4hgFAxoyWqFVWyJvuOtQcWyZStROyPHwjAnpnj-x1cVQpOhbO-kQUFvy_VUrPpF3aYVCcO2cFirQTXR6kxSGcYGGcsPY-_eiAd93UdG2EM6xLAocDLaFV72CQI6XEs0WQG1f4SqvH52v3OTkgWBLgYV35gpyIe0-2nazGL0R8pTNuDqrOb7OGmuTRMoTIiRi67-wTxx8cQ";
2680
+ this.variant = "";
2681
+ }
2682
+ set content(child) {
2683
+ this.hdeConfigurator = child;
2684
+ this._prepareAttributes();
2685
+ }
2686
+ set sku(value) {
2687
+ this._sku = value;
2688
+ this._prepareAttributes();
2689
+ }
2690
+ get sku() {
2691
+ return this._sku;
2692
+ }
2693
+ handleConfigurationFinished(event) {
2694
+ console.log(event.detail);
2695
+ }
2696
+ handleError(event) {
2697
+ console.error(event.detail);
2698
+ }
2699
+ _prepareAttributes() {
2700
+ if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.token && (this.sku || this.variant)) {
2701
+ this.hdeConfigurator.nativeElement.setAttribute('bearerToken', this.token);
2702
+ if (this._sku) {
2703
+ this.hdeConfigurator.nativeElement.setAttribute('data-productId', this._sku);
2704
+ }
2705
+ if (this.variant) {
2706
+ this.hdeConfigurator.nativeElement.setAttribute('data-productVariantId', this.variant);
2707
+ }
2708
+ this._loadTheScripts();
2709
+ }
2710
+ }
2711
+ // load external scripts
2712
+ _loadTheScripts() {
2713
+ return __awaiter(this, void 0, void 0, function* () {
2714
+ const scripts = [
2715
+ // hard-coded for now, should come from the external source
2716
+ 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/polyfills.js',
2717
+ 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/runtime.js',
2718
+ 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/main.js'
2719
+ ];
2720
+ for (let i = 0; i < scripts.length; i++) {
2721
+ yield this._scriptLoader.loadScript(scripts[i], this._renderer).catch((error) => console.error(error));
2722
+ }
2723
+ yield this._scriptLoader.addStyleSheet("https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/styles.css", this._renderer);
2724
+ });
2725
+ }
2726
+ }
2727
+ ProductHdComponent.decorators = [
2728
+ { type: Component, args: [{
2729
+ selector: 'co-product-hd',
2730
+ template: `
2731
+ <hde-configurator #hdeConfigurator
2732
+ apiurl="https://bmsproductconfigurator-acceptance.azurewebsites.net/api/configurator/"
2733
+ productVariantCommandApiUrl="https://bmsproductvariantcommand-acceptance.azurewebsites.net/"
2734
+ productVariantQueryApiUrl="https://bmsproductvariantquery-acceptance.azurewebsites.net/"
2735
+ language="nl"
2736
+ localizationApiUrl="https://hde-cdn.azureedge.net/libs/BMS.DST.Localization/"
2737
+ localizationFileExtension=".json"
2738
+ (configurationFinished)="handleConfigurationFinished($event)"
2739
+ (configurationFailed)="handleError($event)"
2740
+ >
2741
+ <hde-progress-bar></hde-progress-bar>
2742
+ </hde-configurator>
2743
+ `,
2744
+ encapsulation: ViewEncapsulation.None
2745
+ },] }
2746
+ ];
2747
+ ProductHdComponent.ctorParameters = () => [
2748
+ { type: ProductScriptLoaderService },
2749
+ { type: Renderer2 }
2750
+ ];
2751
+ ProductHdComponent.propDecorators = {
2752
+ content: [{ type: ViewChild, args: ['hdeConfigurator', { read: ElementRef },] }],
2753
+ sku: [{ type: Input }],
2754
+ showClass: [{ type: HostBinding, args: ['class.co-product-hd',] }]
2755
+ };
2756
+
2757
+ class ProductHdModule {
2758
+ }
2759
+ ProductHdModule.decorators = [
2760
+ { type: NgModule, args: [{
2761
+ imports: [
2762
+ CommonModule
2763
+ ],
2764
+ declarations: [
2765
+ ProductHdComponent
2766
+ ],
2767
+ schemas: [
2768
+ CUSTOM_ELEMENTS_SCHEMA,
2769
+ NO_ERRORS_SCHEMA
2770
+ ],
2771
+ exports: [
2772
+ ProductHdComponent
2773
+ ]
2774
+ },] }
2775
+ ];
2776
+
2616
2777
  class IoneProductModule {
2617
2778
  }
2618
2779
  IoneProductModule.decorators = [
@@ -2621,7 +2782,7 @@ IoneProductModule.decorators = [
2621
2782
  // BrowserAnimationsModule,
2622
2783
  CommonModule,
2623
2784
  ProductPageModule,
2624
- LoaderModule$1
2785
+ ProductHdModule
2625
2786
  ],
2626
2787
  declarations: [
2627
2788
  IoneProductComponent
@@ -2629,6 +2790,10 @@ IoneProductModule.decorators = [
2629
2790
  exports: [
2630
2791
  IoneProductComponent
2631
2792
  ],
2793
+ schemas: [
2794
+ CUSTOM_ELEMENTS_SCHEMA,
2795
+ NO_ERRORS_SCHEMA
2796
+ ],
2632
2797
  bootstrap: [
2633
2798
  IoneProductComponent
2634
2799
  ],
@@ -2780,5 +2945,5 @@ ProductExternalSourceModule.decorators = [
2780
2945
  * Generated bundle index. Do not edit.
2781
2946
  */
2782
2947
 
2783
- export { IoneProductComponent, IoneProductModule, ProductConnectorAdapterService, ProductConnectorService, ProductEventService, ProductExternalSourceComponent, ProductExternalSourceModule, ProductSettingsService, Version, ProductPageModule as ɵa, ProductSelectorTypeModule as ɵb, ProductInfoTabsModule as ɵba, ProductAdditionalInfoModule as ɵbb, ProductAdditionalInfoComponent as ɵbc, ProductPropertiesModule as ɵbd, ProductPropertiesComponent as ɵbe, ProductDocumentModule as ɵbf, ProductDocumentsComponent as ɵbg, ProductSymbolsModule as ɵbh, ProductSymbolsComponent as ɵbi, ProductInfoTabsComponent as ɵbj, ProductDialogModule as ɵbk, ProductDialogComponent as ɵbl, ProductPageComponent as ɵbm, PipeModule as ɵc, LocalizePipe as ɵd, DictionaryService as ɵe, JsonUtilsService as ɵf, ProductSelectorTypeComponent as ɵg, IconCacheService as ɵh, ImageCarouselModule as ɵi, ImageCarouselComponent as ɵj, ProductDescriptionModule as ɵk, ProductDescriptionComponent as ɵl, ProductAdditionalDescriptionModule as ɵm, ProductAdditionalDescriptionComponent as ɵn, ProductPriceModule as ɵo, ProductPriceComponent as ɵp, ProductAddtocartModule as ɵq, ProductAddtocartComponent as ɵr, ProductRelatedModule as ɵs, HeaderModule as ɵt, HeaderComponent as ɵu, ProductRelatedComponent as ɵv, ProductStockModule as ɵw, ProductStockComponent as ɵx, ProductDeliveryModule as ɵy, ProductDeliveryComponent as ɵz };
2948
+ export { IoneProductComponent, IoneProductModule, ProductConnectorAdapterService, ProductConnectorService, ProductEventService, ProductExternalSourceComponent, ProductExternalSourceModule, ProductSettingsService, Version, ProductPageModule as ɵa, ProductSelectorTypeModule as ɵb, ProductInfoTabsModule as ɵba, ProductAdditionalInfoModule as ɵbb, ProductAdditionalInfoComponent as ɵbc, ProductPropertiesModule as ɵbd, ProductPropertiesComponent as ɵbe, ProductDocumentModule as ɵbf, ProductDocumentsComponent as ɵbg, ProductSymbolsModule as ɵbh, ProductSymbolsComponent as ɵbi, ProductInfoTabsComponent as ɵbj, ProductDialogModule as ɵbk, ProductDialogComponent as ɵbl, ProductPageComponent as ɵbm, ProductHdModule as ɵbn, ProductHdComponent as ɵbo, ProductScriptLoaderService as ɵbp, PipeModule as ɵc, LocalizePipe as ɵd, DictionaryService as ɵe, JsonUtilsService as ɵf, ProductSelectorTypeComponent as ɵg, IconCacheService as ɵh, ImageCarouselModule as ɵi, ImageCarouselComponent as ɵj, ProductDescriptionModule as ɵk, ProductDescriptionComponent as ɵl, ProductAdditionalDescriptionModule as ɵm, ProductAdditionalDescriptionComponent as ɵn, ProductPriceModule as ɵo, ProductPriceComponent as ɵp, ProductAddtocartModule as ɵq, ProductAddtocartComponent as ɵr, ProductRelatedModule as ɵs, HeaderModule as ɵt, HeaderComponent as ɵu, ProductRelatedComponent as ɵv, ProductStockModule as ɵw, ProductStockComponent as ɵx, ProductDeliveryModule as ɵy, ProductDeliveryComponent as ɵz };
2784
2949
  //# sourceMappingURL=colijnit-product.js.map