@colijnit/product 256.1.9 → 256.1.11

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;
@@ -36,9 +29,8 @@ export declare class IoneProductComponent implements OnInit, OnChanges, OnDestro
36
29
  showHD: boolean;
37
30
  private _settings;
38
31
  private _subs;
39
- constructor(_dictionary: DictionaryService, _jsonUtils: JsonUtilsService, _ione: ProductConnectorService, _changeDetector: ChangeDetectorRef, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
32
+ constructor(_appEventService: ProductEventService, _settingsService: ProductSettingsService);
40
33
  ngOnInit(): Promise<void>;
41
- ngOnChanges(changes: SimpleChanges): void;
42
34
  ngOnDestroy(): void;
43
35
  private _handleAnswerInfoReceived;
44
36
  private _handleAddToCart;
@@ -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 = "256.1.9";
35
- this.publishDate = "4/16/2025, 3:51:46 PM";
34
+ this.symVer = "256.1.11";
35
+ this.publishDate = "16-6-2025 09:03:05";
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() {
@@ -890,6 +851,44 @@
890
851
  { type: ProductEventService }
891
852
  ]; };
892
853
 
854
+ var JsonUtilsService = /** @class */ (function () {
855
+ function JsonUtilsService() {
856
+ }
857
+ JsonUtilsService.prototype.readJsonFile = function (filePath) {
858
+ return __awaiter(this, void 0, void 0, function () {
859
+ var response, e_1;
860
+ return __generator(this, function (_a) {
861
+ switch (_a.label) {
862
+ case 0:
863
+ _a.trys.push([0, 2, , 3]);
864
+ return [4 /*yield*/, fetch(filePath)];
865
+ case 1:
866
+ response = _a.sent();
867
+ if (!response.ok) {
868
+ return [2 /*return*/, null];
869
+ }
870
+ else {
871
+ return [2 /*return*/, response.json()];
872
+ }
873
+ return [3 /*break*/, 3];
874
+ case 2:
875
+ e_1 = _a.sent();
876
+ console.error('Error getting file:', e_1.message);
877
+ return [2 /*return*/, ''];
878
+ case 3: return [2 /*return*/];
879
+ }
880
+ });
881
+ });
882
+ };
883
+ return JsonUtilsService;
884
+ }());
885
+ JsonUtilsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
886
+ JsonUtilsService.decorators = [
887
+ { type: i0.Injectable, args: [{
888
+ providedIn: 'root'
889
+ },] }
890
+ ];
891
+
893
892
  var LanguageCode;
894
893
  (function (LanguageCode) {
895
894
  LanguageCode["Dutch"] = "nl-NL";
@@ -1326,7 +1325,7 @@
1326
1325
  ]; };
1327
1326
 
1328
1327
  var IoneProductComponent = /** @class */ (function () {
1329
- function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
1328
+ function IoneProductComponent(_appEventService, _settingsService) {
1330
1329
  var _this = this;
1331
1330
  // this.sku = 'CF-HILL';
1332
1331
  // this.sku = 'CF-ALMADA';
@@ -1340,10 +1339,6 @@
1340
1339
  // this.sku = '104';
1341
1340
  // this.sku = "70000107";
1342
1341
  // this.sku = "grover";
1343
- this._dictionary = _dictionary;
1344
- this._jsonUtils = _jsonUtils;
1345
- this._ione = _ione;
1346
- this._changeDetector = _changeDetector;
1347
1342
  this._appEventService = _appEventService;
1348
1343
  this._settingsService = _settingsService;
1349
1344
  this.handleAddArticleInternally = true;
@@ -1358,9 +1353,7 @@
1358
1353
  this.settingsLoaded = false;
1359
1354
  this.showHD = false;
1360
1355
  this._subs = [];
1361
- this._subs.push(
1362
- // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
1363
- this._appEventService.onAddToCart.subscribe(function (data) {
1356
+ this._subs.push(this._appEventService.onAddToCart.subscribe(function (data) {
1364
1357
  _this._handleAddToCart(data);
1365
1358
  }), 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._settingsService.settingsLoaded.subscribe(function (loaded) {
1366
1359
  _this.settingsLoaded = loaded;
@@ -1398,9 +1391,6 @@
1398
1391
  });
1399
1392
  });
1400
1393
  };
1401
- IoneProductComponent.prototype.ngOnChanges = function (changes) {
1402
- this._changeDetector.detectChanges();
1403
- };
1404
1394
  IoneProductComponent.prototype.ngOnDestroy = function () {
1405
1395
  this._subs.forEach(function (s) { return s.unsubscribe(); });
1406
1396
  };
@@ -1424,15 +1414,17 @@
1424
1414
  { type: i0.Component, args: [{
1425
1415
  selector: 'app-ione-product',
1426
1416
  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 ",
1417
+ providers: [
1418
+ ProductSettingsService,
1419
+ ProductConnectorService,
1420
+ ProductEventService,
1421
+ ProductConnectorAdapterService
1422
+ ],
1427
1423
  encapsulation: i0.ViewEncapsulation.Emulated,
1428
1424
  styles: [""]
1429
1425
  },] }
1430
1426
  ];
1431
1427
  IoneProductComponent.ctorParameters = function () { return [
1432
- { type: DictionaryService },
1433
- { type: JsonUtilsService },
1434
- { type: ProductConnectorService },
1435
- { type: i0.ChangeDetectorRef },
1436
1428
  { type: ProductEventService },
1437
1429
  { type: ProductSettingsService }
1438
1430
  ]; };
@@ -2058,6 +2050,7 @@
2058
2050
  var resizeCanvas = document.createElement('canvas');
2059
2051
  var resizeCanvasContext = resizeCanvas.getContext('2d');
2060
2052
  var resizeImage = document.createElement('img');
2053
+ resizeImage.crossOrigin = 'anonymous';
2061
2054
  resizeImage.onload = function () { return __awaiter(_this, void 0, void 0, function () {
2062
2055
  var originalWidth, originalHeight, aspectRatio, newWidth, newHeight, imageWidth, resizedSource;
2063
2056
  return __generator(this, function (_a) {
@@ -3862,12 +3855,6 @@
3862
3855
  ],
3863
3856
  bootstrap: [
3864
3857
  IoneProductComponent
3865
- ],
3866
- providers: [
3867
- ProductSettingsService,
3868
- ProductConnectorService,
3869
- ProductEventService,
3870
- ProductConnectorAdapterService
3871
3858
  ]
3872
3859
  },] }
3873
3860
  ];