@colijnit/product 257.1.6 → 257.1.8

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,18 +1,11 @@
1
- import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { JsonUtilsService } from './utils/json-utils.service';
3
- import { ProductConnectorService } from './service/product-connector.service';
4
- import { DictionaryService } from './service/dictionary.service';
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
5
2
  import { ProductEventService } from './service/product-event.service';
6
3
  import { ArticleListObject } from '@colijnit/articleapi/build/model/article-list-object';
7
4
  import { ProductSettingsService } from './service/product-settings.service';
8
5
  import { Selection } from '@colijnit/articleapi/build/model/selection';
9
6
  import { ArticleQuickSel } from '@colijnit/articleapi/build/model/article-quick-sel';
10
7
  import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/article-list-object-extended.bo';
11
- export declare class IoneProductComponent implements OnInit, OnChanges, OnDestroy {
12
- private _dictionary;
13
- private _jsonUtils;
14
- private _ione;
15
- private _changeDetector;
8
+ export declare class IoneProductComponent implements OnInit, OnDestroy {
16
9
  private _appEventService;
17
10
  private _settingsService;
18
11
  sku: string;
@@ -37,9 +30,8 @@ export declare class IoneProductComponent implements OnInit, OnChanges, OnDestro
37
30
  showHD: boolean;
38
31
  private _settings;
39
32
  private _subs;
40
- constructor(_dictionary: DictionaryService, _jsonUtils: JsonUtilsService, _ione: ProductConnectorService, _changeDetector: ChangeDetectorRef, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
33
+ constructor(_appEventService: ProductEventService, _settingsService: ProductSettingsService);
41
34
  ngOnInit(): Promise<void>;
42
- ngOnChanges(changes: SimpleChanges): void;
43
35
  ngOnDestroy(): void;
44
36
  private _handleAnswerInfoReceived;
45
37
  private _handleAnswersAvailable;
@@ -1,20 +1,10 @@
1
1
  import { SettingsOptions } from './settings-options';
2
2
  import { RenderParameters } from './render-parameters';
3
- import { LanguageCode } from '@colijnit/ioneconnector/build/enum/language-code.enum';
4
- export declare class ProductSettings {
5
- url: string;
6
- schema: string;
7
- version: string;
8
- branch: string;
3
+ import { Options } from '@colijnit/ioneconnector/build/model/options';
4
+ export declare class ProductSettings extends Options {
9
5
  currency: number;
10
- username: string;
11
- password: string;
12
6
  session: any;
13
- useGroups: boolean;
14
- useRenders: boolean;
15
- useLoginEncryption: boolean;
16
7
  createWebOrder: boolean;
17
- useMatch: boolean;
18
8
  assetPath: string;
19
9
  assetIndex: string;
20
10
  currencySymbol: string;
@@ -23,8 +13,6 @@ export declare class ProductSettings {
23
13
  additionalTranslationFile: string;
24
14
  gtm: string;
25
15
  client: string;
26
- timeoutInMs: number;
27
- languageCode: LanguageCode;
28
16
  options: SettingsOptions;
29
17
  renderParameters: RenderParameters;
30
18
  }
@@ -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 = "257.1.6";
35
- this.publishDate = "17-3-2025 08:31:39";
34
+ this.symVer = "257.1.8";
35
+ this.publishDate = "27-5-2025 10:30:02";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -514,44 +514,6 @@
514
514
  __disposeResources: __disposeResources,
515
515
  };
516
516
 
517
- var JsonUtilsService = /** @class */ (function () {
518
- function JsonUtilsService() {
519
- }
520
- JsonUtilsService.prototype.readJsonFile = function (filePath) {
521
- return __awaiter(this, void 0, void 0, function () {
522
- var response, e_1;
523
- return __generator(this, function (_a) {
524
- switch (_a.label) {
525
- case 0:
526
- _a.trys.push([0, 2, , 3]);
527
- return [4 /*yield*/, fetch(filePath)];
528
- case 1:
529
- response = _a.sent();
530
- if (!response.ok) {
531
- return [2 /*return*/, null];
532
- }
533
- else {
534
- return [2 /*return*/, response.json()];
535
- }
536
- return [3 /*break*/, 3];
537
- case 2:
538
- e_1 = _a.sent();
539
- console.error('Error getting file:', e_1.message);
540
- return [2 /*return*/, ''];
541
- case 3: return [2 /*return*/];
542
- }
543
- });
544
- });
545
- };
546
- return JsonUtilsService;
547
- }());
548
- JsonUtilsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
549
- JsonUtilsService.decorators = [
550
- { type: i0.Injectable, args: [{
551
- providedIn: 'root'
552
- },] }
553
- ];
554
-
555
517
  var SettingsOptions = /** @class */ (function () {
556
518
  function SettingsOptions() {
557
519
  this.showStockStatus = false;
@@ -583,20 +545,19 @@
583
545
  return RenderParameters;
584
546
  }());
585
547
 
586
- var ProductSettings = /** @class */ (function () {
548
+ var ProductSettings = /** @class */ (function (_super) {
549
+ __extends(ProductSettings, _super);
587
550
  function ProductSettings() {
588
- this.session = undefined;
589
- this.useGroups = true;
590
- this.useRenders = false;
591
- this.useLoginEncryption = true;
592
- this.createWebOrder = true;
593
- this.useMatch = false;
594
- this.currencySymbol = '€';
595
- this.options = new SettingsOptions();
596
- this.renderParameters = new RenderParameters();
551
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
552
+ _this.session = undefined;
553
+ _this.createWebOrder = true;
554
+ _this.currencySymbol = '€';
555
+ _this.options = new SettingsOptions();
556
+ _this.renderParameters = new RenderParameters();
557
+ return _this;
597
558
  }
598
559
  return ProductSettings;
599
- }());
560
+ }(options.Options));
600
561
 
601
562
  var ProductEventService = /** @class */ (function () {
602
563
  function ProductEventService() {
@@ -891,6 +852,44 @@
891
852
  { type: ProductEventService }
892
853
  ]; };
893
854
 
855
+ var JsonUtilsService = /** @class */ (function () {
856
+ function JsonUtilsService() {
857
+ }
858
+ JsonUtilsService.prototype.readJsonFile = function (filePath) {
859
+ return __awaiter(this, void 0, void 0, function () {
860
+ var response, e_1;
861
+ return __generator(this, function (_a) {
862
+ switch (_a.label) {
863
+ case 0:
864
+ _a.trys.push([0, 2, , 3]);
865
+ return [4 /*yield*/, fetch(filePath)];
866
+ case 1:
867
+ response = _a.sent();
868
+ if (!response.ok) {
869
+ return [2 /*return*/, null];
870
+ }
871
+ else {
872
+ return [2 /*return*/, response.json()];
873
+ }
874
+ return [3 /*break*/, 3];
875
+ case 2:
876
+ e_1 = _a.sent();
877
+ console.error('Error getting file:', e_1.message);
878
+ return [2 /*return*/, ''];
879
+ case 3: return [2 /*return*/];
880
+ }
881
+ });
882
+ });
883
+ };
884
+ return JsonUtilsService;
885
+ }());
886
+ JsonUtilsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
887
+ JsonUtilsService.decorators = [
888
+ { type: i0.Injectable, args: [{
889
+ providedIn: 'root'
890
+ },] }
891
+ ];
892
+
894
893
  var LanguageCode;
895
894
  (function (LanguageCode) {
896
895
  LanguageCode["Dutch"] = "nl-NL";
@@ -1327,7 +1326,7 @@
1327
1326
  ]; };
1328
1327
 
1329
1328
  var IoneProductComponent = /** @class */ (function () {
1330
- function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
1329
+ function IoneProductComponent(_appEventService, _settingsService) {
1331
1330
  var _this = this;
1332
1331
  // this.sku = 'CF-HILL';
1333
1332
  // this.sku = 'CF-ALMADA';
@@ -1341,10 +1340,6 @@
1341
1340
  // this.sku = '104';
1342
1341
  // this.sku = "70000107";
1343
1342
  // this.sku = "grover";
1344
- this._dictionary = _dictionary;
1345
- this._jsonUtils = _jsonUtils;
1346
- this._ione = _ione;
1347
- this._changeDetector = _changeDetector;
1348
1343
  this._appEventService = _appEventService;
1349
1344
  this._settingsService = _settingsService;
1350
1345
  this.handleAddArticleInternally = true;
@@ -1360,9 +1355,7 @@
1360
1355
  this.settingsLoaded = false;
1361
1356
  this.showHD = false;
1362
1357
  this._subs = [];
1363
- this._subs.push(
1364
- // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
1365
- this._appEventService.onAddToCart.subscribe(function (data) {
1358
+ this._subs.push(this._appEventService.onAddToCart.subscribe(function (data) {
1366
1359
  _this._handleAddToCart(data);
1367
1360
  }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.onAddToQuote.emit(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.onAlternativeClick.emit(article); }), this._appEventService.onArticleInfoReceived.subscribe(function (info) { return _this._handleAnswerInfoReceived(info); }), this._appEventService.onArticleReceived.subscribe(function (article) { return _this.onArticleReceived.emit(article); }), this._appEventService.onSelectionsReceived.subscribe(function (selections) { return _this.onSelectionsReceived.emit(selections); }), this._appEventService.onAnswersAvailable.subscribe(function (answers) { return _this._handleAnswersAvailable(answers); }), this._settingsService.settingsLoaded.subscribe(function (loaded) {
1368
1361
  _this.settingsLoaded = loaded;
@@ -1400,9 +1393,6 @@
1400
1393
  });
1401
1394
  });
1402
1395
  };
1403
- IoneProductComponent.prototype.ngOnChanges = function (changes) {
1404
- this._changeDetector.detectChanges();
1405
- };
1406
1396
  IoneProductComponent.prototype.ngOnDestroy = function () {
1407
1397
  this._subs.forEach(function (s) { return s.unsubscribe(); });
1408
1398
  };
@@ -1429,15 +1419,17 @@
1429
1419
  { type: i0.Component, args: [{
1430
1420
  selector: 'app-ione-product',
1431
1421
  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 ",
1422
+ providers: [
1423
+ ProductSettingsService,
1424
+ ProductConnectorService,
1425
+ ProductEventService,
1426
+ ProductConnectorAdapterService
1427
+ ],
1432
1428
  encapsulation: i0.ViewEncapsulation.Emulated,
1433
1429
  styles: [""]
1434
1430
  },] }
1435
1431
  ];
1436
1432
  IoneProductComponent.ctorParameters = function () { return [
1437
- { type: DictionaryService },
1438
- { type: JsonUtilsService },
1439
- { type: ProductConnectorService },
1440
- { type: i0.ChangeDetectorRef },
1441
1433
  { type: ProductEventService },
1442
1434
  { type: ProductSettingsService }
1443
1435
  ]; };
@@ -2100,6 +2092,7 @@
2100
2092
  resizedSource = resizeCanvas.toDataURL('image/jpeg');
2101
2093
  imageViewModel.source = this._domSanitizer.bypassSecurityTrustUrl(resizedSource);
2102
2094
  imageViewModel.originalSource = source;
2095
+ this._changeDetector.detectChanges();
2103
2096
  return [2 /*return*/];
2104
2097
  });
2105
2098
  }); };
@@ -3881,12 +3874,6 @@
3881
3874
  ],
3882
3875
  bootstrap: [
3883
3876
  IoneProductComponent
3884
- ],
3885
- providers: [
3886
- ProductSettingsService,
3887
- ProductConnectorService,
3888
- ProductEventService,
3889
- ProductConnectorAdapterService
3890
3877
  ]
3891
3878
  },] }
3892
3879
  ];