@crystaldesign/basket-model 24.11.4-rc.0 → 24.12.0-alpha.19

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.
@@ -79,85 +79,93 @@ var GroupsData = /*#__PURE__*/_createClass__default["default"](function GroupsDa
79
79
  this.Group = new GroupData(json);
80
80
  });
81
81
 
82
- var VariantItemData = /*#__PURE__*/_createClass__default["default"](function VariantItemData(json) {
83
- _classCallCheck__default["default"](this, VariantItemData);
84
- _defineProperty__default["default"](this, "BasketID", void 0);
85
- _defineProperty__default["default"](this, "OPT", void 0);
86
- // OptionCodex
87
- _defineProperty__default["default"](this, "OPTName", void 0);
88
- // Name der Option
89
- _defineProperty__default["default"](this, "OPTName_locales", void 0);
90
- _defineProperty__default["default"](this, "TabGroup", void 0);
91
- // TabGroup in welches sich die Option befindet
92
- _defineProperty__default["default"](this, "TabGroup_locales", void 0);
93
- _defineProperty__default["default"](this, "OPV", void 0);
94
- // OptionValue Codex
95
- _defineProperty__default["default"](this, "vOPV", void 0);
96
- // Benutzerfreudliche OptionValue Codex (IDM) welcher im Frontend angezeigt werden soll
97
- _defineProperty__default["default"](this, "OPVName", void 0);
98
- _defineProperty__default["default"](this, "OPVName_locales", void 0);
99
- _defineProperty__default["default"](this, "OPVImage", void 0);
100
- _defineProperty__default["default"](this, "OPVHexVal", void 0);
101
- _defineProperty__default["default"](this, "SinglePrice", void 0);
102
- // Aufpreis / Basepreis der option
103
- _defineProperty__default["default"](this, "AddPercentage", void 0);
104
- // Prozentueller Aufpreis der Option
105
- _defineProperty__default["default"](this, "ShowOPVAsArticleNr", void 0);
106
- _defineProperty__default["default"](this, "SendToSAP", void 0);
107
- _defineProperty__default["default"](this, "ArticlePlaceholder", void 0);
108
- _defineProperty__default["default"](this, "HideInOrderText", void 0);
109
- _defineProperty__default["default"](this, "Hidden", void 0);
110
- _defineProperty__default["default"](this, "IsDescribingState", void 0);
111
- // If true it means this option does not change the Product but just the state like if an Ombrella is opened or closed
112
- _defineProperty__default["default"](this, "FreeText", void 0);
113
- _defineProperty__default["default"](this, "FreeTextLang", void 0);
114
- _defineProperty__default["default"](this, "MeasureValue", void 0);
115
- _defineProperty__default["default"](this, "MeasureUnit", void 0);
116
- _defineProperty__default["default"](this, "isFreeText", void 0);
117
- _defineProperty__default["default"](this, "isMeasureValue", void 0);
118
- //public OPTEAN?: string = ""; // BARCode der Artikel / deprected
119
- //public OPVEAN?: string = "";
120
- //public FirstTime?: string = "";
121
- _defineProperty__default["default"](this, "AddPrice", void 0);
122
- _defineProperty__default["default"](this, "AddPriceFormatted", void 0);
123
- _defineProperty__default["default"](this, "PriceUnit", void 0);
124
- _defineProperty__default["default"](this, "PriceID", void 0);
125
- _defineProperty__default["default"](this, "OCD", void 0);
126
- _defineProperty__default["default"](this, "OptionOCD", void 0);
127
- this.BasketID = json.BasketID;
128
- this.OPT = json.OPTCodex;
129
- this.OPV = json.OPVCodex;
130
- this.OPTName = json.OPTName;
131
- this.OPTName_locales = json.OPTName_locales;
132
- this.TabGroup = json.TabGroup;
133
- this.TabGroup_locales = json.TabGroup_locales;
134
- this.vOPV = json.vOPV;
135
- this.OPVName = json.OPVName;
136
- this.OPVName_locales = json.OPVName_locales;
137
- this.OPVImage = json.OPVImage;
138
- this.OPVHexVal = json.OPVHexVal;
139
- this.FreeText = json.FreeText;
140
- this.SinglePrice = json.SinglePrice;
141
- this.AddPercentage = json.AddPercentage;
142
- this.IsDescribingState = json.IsDescribingState;
143
- this.SendToSAP = json.SendToSAP;
144
- this.ArticlePlaceholder = json.ArticlePlaceholder;
145
- this.HideInOrderText = json.HideInOrderText;
146
- this.Hidden = json.Hidden;
147
- this.ShowOPVAsArticleNr = json.ShowOPVAsArticleNr;
148
- this.AddPrice = json.AddPrice;
149
- if (this.AddPrice) this.AddPriceFormatted = json.AddPriceFormatted;
150
- this.PriceUnit = json.PriceUnit;
151
- this.PriceID = json.PriceID;
152
- this.FreeText = json.FreeText;
153
- this.MeasureValue = json.MeasureValue;
154
- this.MeasureUnit = json.MeasureUnit;
155
- this.isFreeText = json.isFreeText;
156
- this.isMeasureValue = json.isMeasureValue;
157
- this.OCD = json.OCD;
158
- this.OptionOCD = json.OptionOCD;
159
- this.FreeTextLang = json.FreeTextLang;
160
- });
82
+ var VariantItemData = /*#__PURE__*/function () {
83
+ function VariantItemData(json) {
84
+ _classCallCheck__default["default"](this, VariantItemData);
85
+ _defineProperty__default["default"](this, "BasketID", void 0);
86
+ _defineProperty__default["default"](this, "OPT", void 0);
87
+ // OptionCodex
88
+ _defineProperty__default["default"](this, "OPTName", void 0);
89
+ // Name der Option
90
+ _defineProperty__default["default"](this, "OPTName_locales", void 0);
91
+ _defineProperty__default["default"](this, "TabGroup", void 0);
92
+ // TabGroup in welches sich die Option befindet
93
+ _defineProperty__default["default"](this, "TabGroup_locales", void 0);
94
+ _defineProperty__default["default"](this, "OPV", void 0);
95
+ // OptionValue Codex
96
+ _defineProperty__default["default"](this, "vOPV", void 0);
97
+ // Benutzerfreudliche OptionValue Codex (IDM) welcher im Frontend angezeigt werden soll
98
+ _defineProperty__default["default"](this, "OPVName", void 0);
99
+ _defineProperty__default["default"](this, "OPVName_locales", void 0);
100
+ _defineProperty__default["default"](this, "OPVImage", void 0);
101
+ _defineProperty__default["default"](this, "OPVHexVal", void 0);
102
+ _defineProperty__default["default"](this, "SinglePrice", void 0);
103
+ // Aufpreis / Basepreis der option
104
+ _defineProperty__default["default"](this, "AddPercentage", void 0);
105
+ // Prozentueller Aufpreis der Option
106
+ _defineProperty__default["default"](this, "ShowOPVAsArticleNr", void 0);
107
+ _defineProperty__default["default"](this, "SendToSAP", void 0);
108
+ _defineProperty__default["default"](this, "ArticlePlaceholder", void 0);
109
+ _defineProperty__default["default"](this, "HideInOrderText", void 0);
110
+ _defineProperty__default["default"](this, "Hidden", void 0);
111
+ _defineProperty__default["default"](this, "IsDescribingState", void 0);
112
+ // If true it means this option does not change the Product but just the state like if an Ombrella is opened or closed
113
+ _defineProperty__default["default"](this, "FreeText", void 0);
114
+ _defineProperty__default["default"](this, "FreeTextLang", void 0);
115
+ _defineProperty__default["default"](this, "MeasureValue", void 0);
116
+ _defineProperty__default["default"](this, "MeasureUnit", void 0);
117
+ _defineProperty__default["default"](this, "isFreeText", void 0);
118
+ _defineProperty__default["default"](this, "isMeasureValue", void 0);
119
+ //public OPTEAN?: string = ""; // BARCode der Artikel / deprected
120
+ //public OPVEAN?: string = "";
121
+ //public FirstTime?: string = "";
122
+ _defineProperty__default["default"](this, "AddPrice", void 0);
123
+ _defineProperty__default["default"](this, "AddPriceFormatted", void 0);
124
+ _defineProperty__default["default"](this, "PriceUnit", void 0);
125
+ _defineProperty__default["default"](this, "PriceID", void 0);
126
+ _defineProperty__default["default"](this, "OCD", void 0);
127
+ _defineProperty__default["default"](this, "OptionOCD", void 0);
128
+ this.BasketID = json.BasketID;
129
+ this.OPT = json.OPT;
130
+ this.OPV = json.OPV;
131
+ this.OPTName = json.OPTName;
132
+ this.OPTName_locales = json.OPTName_locales;
133
+ this.TabGroup = json.TabGroup;
134
+ this.TabGroup_locales = json.TabGroup_locales;
135
+ this.vOPV = json.vOPV;
136
+ this.OPVName = json.OPVName;
137
+ this.OPVName_locales = json.OPVName_locales;
138
+ this.OPVImage = json.OPVImage;
139
+ this.OPVHexVal = json.OPVHexVal;
140
+ this.FreeText = json.FreeText;
141
+ this.SinglePrice = json.SinglePrice;
142
+ this.AddPercentage = json.AddPercentage;
143
+ this.IsDescribingState = json.IsDescribingState;
144
+ this.SendToSAP = json.SendToSAP;
145
+ this.ArticlePlaceholder = json.ArticlePlaceholder;
146
+ this.HideInOrderText = json.HideInOrderText;
147
+ this.Hidden = json.Hidden;
148
+ this.ShowOPVAsArticleNr = json.ShowOPVAsArticleNr;
149
+ this.AddPrice = json.AddPrice;
150
+ if (this.AddPrice) this.AddPriceFormatted = json.AddPriceFormatted;
151
+ this.PriceUnit = json.PriceUnit;
152
+ this.PriceID = json.PriceID;
153
+ this.FreeText = json.FreeText;
154
+ this.MeasureValue = json.MeasureValue;
155
+ this.MeasureUnit = json.MeasureUnit;
156
+ this.isFreeText = json.isFreeText;
157
+ this.isMeasureValue = json.isMeasureValue;
158
+ this.OCD = json.OCD;
159
+ this.OptionOCD = json.OptionOCD;
160
+ this.FreeTextLang = json.FreeTextLang;
161
+ }
162
+ return _createClass__default["default"](VariantItemData, [{
163
+ key: "getStringForHash",
164
+ value: function getStringForHash() {
165
+ return this.OPT + '_' + this.OPV + (this.MeasureValue !== undefined ? '_' + this.MeasureValue : '') + (this.FreeText !== undefined ? '_' + this.FreeText : '');
166
+ }
167
+ }]);
168
+ }();
161
169
 
162
170
  function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
163
171
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -245,9 +253,6 @@ var OrderLineData = /*#__PURE__*/function () {
245
253
  // Partlistartikel werden nicht übernommen sondern beim laden von hauptartikel neu berechnet
246
254
  _defineProperty__default["default"](this, "PartlistArticleInvisibility", void 0);
247
255
  _defineProperty__default["default"](this, "HasPartlistArticle", void 0);
248
- _defineProperty__default["default"](this, "IsBoxPlannerArticle", void 0);
249
- // EK Text wird bei diesen Artikeln zusammengefasst falls ArtikelCodex und Description übereinstimmen
250
- //public IsPlannerElement: boolean;
251
256
  _defineProperty__default["default"](this, "NoPrice", void 0);
252
257
  // UseCase Jutzler Kleiderstange darf pro elemen eine gratis sein
253
258
  _defineProperty__default["default"](this, "dontAddToFinalOrderLine", void 0);
@@ -313,15 +318,12 @@ var OrderLineData = /*#__PURE__*/function () {
313
318
  this.RuleDesc = json.RuleDesc;
314
319
  this.Image = json.Image;
315
320
  this.SendToSAP = json.SendToSAP;
316
- if (json.VariantBasketData) {
317
- var variantBasketDatas = JSON.parse(decodeURIComponent(json.VariantBasketData).replace(/@/g, '"'));
318
- this.VariantBasketDatas = [];
319
- for (var i = 0; i < variantBasketDatas.length; i++) {
320
- this.VariantBasketDatas.push(new VariantItemData(variantBasketDatas[i])); //: VariantItemData[] = [];
321
- }
322
- }
323
321
  if (json.VariantBasketDatas) {
324
- this.VariantBasketDatas = json.VariantBasketDatas;
322
+ var newVariants = [];
323
+ for (var i = 0; i < json.VariantBasketDatas.length; i++) {
324
+ newVariants.push(new VariantItemData(json.VariantBasketDatas[i]));
325
+ }
326
+ this.VariantBasketDatas = newVariants;
325
327
  }
326
328
  if (json.ConfigPriceDatas) this.ConfigPriceDatas = json.ConfigPriceDatas;
327
329
  this.ArticlePlaceholder = json.ArticlePlaceholder;
@@ -346,8 +348,6 @@ var OrderLineData = /*#__PURE__*/function () {
346
348
  this.UserDataString = json.UserDataString;
347
349
  this.IsPartlistArticle = json.IsPartlistArticle == true;
348
350
  this.HasPartlistArticle = json.HasPartlistArticle == true;
349
- //this.IsPlannerElement = json.IsPlannerElement;
350
- this.IsBoxPlannerArticle = json.IsBoxPlannerArticle == true;
351
351
  this.NoPrice = json.NoPrice == true;
352
352
  this.ShelfPlandata = json.ShelfPlandata != '%7B%7D' ? json.ShelfPlandata : undefined;
353
353
  this.RetailArticleNr = json.RetailArticleNr;
@@ -413,7 +413,12 @@ var OrderLineData = /*#__PURE__*/function () {
413
413
  var ret = {};
414
414
  if (!this.VariantBasketDatas) this.VariantBasketDatas = [];
415
415
  for (var i = 0; i < this.VariantBasketDatas.length; i++) {
416
- ret['OPT' + this.VariantBasketDatas[i].OPT] = 'OPV' + this.VariantBasketDatas[i].OPV;
416
+ var v = this.VariantBasketDatas[i];
417
+ ret['OPT' + v.OPT] = 'OPV' + v.OPV;
418
+ if (v.MeasureValue || v.FreeText) {
419
+ var _ref;
420
+ ret['OPT' + v.OPT + '_val'] = (_ref = v.MeasureValue || v.FreeText) === null || _ref === void 0 ? void 0 : _ref.toString();
421
+ }
417
422
  }
418
423
  return ret;
419
424
  }
@@ -429,10 +434,10 @@ var OrderLineData = /*#__PURE__*/function () {
429
434
  return false;
430
435
  }
431
436
 
432
- /**
433
- *
434
- * @param t i18n translation instance
435
- * @returns general Article description
437
+ /**
438
+ *
439
+ * @param t i18n translation instance
440
+ * @returns general Article description
436
441
  */
437
442
  }, {
438
443
  key: "getArticleInfoText",
@@ -462,11 +467,11 @@ var OrderLineData = /*#__PURE__*/function () {
462
467
  variant.OPVName + (variant.MeasureValue ? ': ' + variant.MeasureValue + ' ' + variant.MeasureUnit : '') + (variant.vOPV ? ' (' + variant.vOPV + ')' : '') + (/*Variant price*/
463
468
  !config.hidePrices && (_this$ConfigPriceData4 = _this.ConfigPriceDatas) !== null && _this$ConfigPriceData4 !== void 0 && _this$ConfigPriceData4.AdditionalPrices ? _this.ConfigPriceDatas.AdditionalPrices.map(function (item) {
464
469
  if (item.OPT == variant.OPT) {
465
- for (var _i = 0; _i < _this.VariantBasketDatas.length; _i++) {
466
- if (_this.VariantBasketDatas[_i].OPT == variant.OPT && _this.VariantBasketDatas[_i].AddPercentage != undefined) {
470
+ for (var _i2 = 0; _i2 < _this.VariantBasketDatas.length; _i2++) {
471
+ if (_this.VariantBasketDatas[_i2].OPT == variant.OPT && _this.VariantBasketDatas[_i2].AddPercentage != undefined) {
467
472
  if (addPercentagePrinted) return '';
468
473
  addPercentagePrinted = true;
469
- return '(+' + _this.VariantBasketDatas[_i].AddPercentage + '%)';
474
+ return '(+' + _this.VariantBasketDatas[_i2].AddPercentage + '%)';
470
475
  }
471
476
  }
472
477
  return DivaUtils__default["default"].formatPrice(item.Price, priceFormat) + (item.PriceUnit ? item.PriceUnit : '');
@@ -480,6 +485,41 @@ var OrderLineData = /*#__PURE__*/function () {
480
485
  !config.hideTotalPrices && this.CalcPrice ? t('basket.priceOverview.table.sum') + ': ' + DivaUtils__default["default"].formatPrice(this.CalcPrice, priceFormat) + ' \n' : '')
481
486
  );
482
487
  }
488
+ }, {
489
+ key: "getHash",
490
+ value: function getHash() {
491
+ var _this$VariantBasketDa2, _this$VariantBasketDa3;
492
+ return DivaUtils.md5(this.CatalogCodex + '_' + this.ArticleCodex + '_' + this.Quantity + '_' + ((_this$VariantBasketDa2 = (_this$VariantBasketDa3 = this.VariantBasketDatas) === null || _this$VariantBasketDa3 === void 0 || (_this$VariantBasketDa3 = _this$VariantBasketDa3.filter(function (v) {
493
+ return !v.IsDescribingState;
494
+ })) === null || _this$VariantBasketDa3 === void 0 ? void 0 : _this$VariantBasketDa3.map(function (v) {
495
+ return v.getStringForHash();
496
+ })) !== null && _this$VariantBasketDa2 !== void 0 ? _this$VariantBasketDa2 : []).join());
497
+ }
498
+ }, {
499
+ key: "getTinyVariantBasketDatas",
500
+ value: function getTinyVariantBasketDatas() {
501
+ var _this$VariantBasketDa4, _this$VariantBasketDa5, _this$VariantBasketDa6, _this$VariantBasketDa7;
502
+ return [].concat(_toConsumableArray__default["default"]((_this$VariantBasketDa4 = (_this$VariantBasketDa5 = this.VariantBasketDatas) === null || _this$VariantBasketDa5 === void 0 ? void 0 : _this$VariantBasketDa5.map(function (v) {
503
+ return {
504
+ OPT: v.OPT,
505
+ OPV: v.OPV,
506
+ OCD: v.OCD,
507
+ OptionOCD: v.OptionOCD,
508
+ IsDescribingState: v.IsDescribingState
509
+ };
510
+ })) !== null && _this$VariantBasketDa4 !== void 0 ? _this$VariantBasketDa4 : []), _toConsumableArray__default["default"]((_this$VariantBasketDa6 = (_this$VariantBasketDa7 = this.VariantBasketDatas) === null || _this$VariantBasketDa7 === void 0 || (_this$VariantBasketDa7 = _this$VariantBasketDa7.filter(function (v) {
511
+ return v.MeasureValue || v.FreeText;
512
+ })) === null || _this$VariantBasketDa7 === void 0 ? void 0 : _this$VariantBasketDa7.map(function (v) {
513
+ var _ref2;
514
+ return {
515
+ OPT: v.OPT + '_val',
516
+ OPV: (_ref2 = v.MeasureValue || v.FreeText) === null || _ref2 === void 0 ? void 0 : _ref2.toString(),
517
+ OCD: v.OCD,
518
+ OptionOCD: v.OptionOCD,
519
+ IsDescribingState: v.IsDescribingState
520
+ };
521
+ })) !== null && _this$VariantBasketDa6 !== void 0 ? _this$VariantBasketDa6 : []));
522
+ }
483
523
  }, {
484
524
  key: "getAsJson",
485
525
  value: function getAsJson() {
@@ -540,8 +580,6 @@ var OrderSetData = /*#__PURE__*/function () {
540
580
  // EK-Text / wird beim Speichern Clientseitig nicht gefüllt
541
581
  _defineProperty__default["default"](this, "SetOrderText_locales", void 0);
542
582
  _defineProperty__default["default"](this, "OrderLines", []);
543
- _defineProperty__default["default"](this, "MainPosNr", void 0);
544
- // PosNr des Sets (Reihungsnummer)
545
583
  _defineProperty__default["default"](this, "Description", void 0);
546
584
  // Checkout
547
585
  _defineProperty__default["default"](this, "UserSetDataString", void 0);
@@ -580,6 +618,7 @@ var OrderSetData = /*#__PURE__*/function () {
580
618
  _defineProperty__default["default"](this, "CatalogListAccountGUID", void 0);
581
619
  // get AccountGUID von der Kollektion
582
620
  _defineProperty__default["default"](this, "ConfigVariants", void 0);
621
+ _defineProperty__default["default"](this, "TinyVariantBaskets", void 0);
583
622
  _defineProperty__default["default"](this, "Weight", void 0);
584
623
  _defineProperty__default["default"](this, "WeightUnit", void 0);
585
624
  _defineProperty__default["default"](this, "Volume", void 0);
@@ -599,6 +638,7 @@ var OrderSetData = /*#__PURE__*/function () {
599
638
  _defineProperty__default["default"](this, "SupplierILN", void 0);
600
639
  _defineProperty__default["default"](this, "SupplierCatalogName", void 0);
601
640
  _defineProperty__default["default"](this, "Favorites", void 0);
641
+ _defineProperty__default["default"](this, "Variant", void 0);
602
642
  _defineProperty__default["default"](this, "MetaData", void 0);
603
643
  _defineProperty__default["default"](this, "MetaData_locales", void 0);
604
644
  _defineProperty__default["default"](this, "AdditionalCatalogPrice", void 0);
@@ -626,6 +666,7 @@ var OrderSetData = /*#__PURE__*/function () {
626
666
  this.SetOrderText_locales = json.SetOrderText_locales;
627
667
  this.Set2DImage = json.Set2DImage;
628
668
  this.Favorites = json.Favorites;
669
+ this.Variant = json.Variant;
629
670
  this.ConfigVariants = json.ConfigVariants;
630
671
  this.VariantDescription = json.VariantDescription;
631
672
  this.VariantDescription_locales = json.VariantDescription_locales;
@@ -636,7 +677,6 @@ var OrderSetData = /*#__PURE__*/function () {
636
677
  this.OrigZKATNr = json.OrigZKATNr && json.OrigZKATNr != '' ? json.OrigZKATNr : ZKATNr;
637
678
  this.SetArticleNr = json.SetArticleNr && json.SetArticleNr != '' ? json.SetArticleNr : SetArticleNr;
638
679
  this.SetArticleNrPrefix = json.SetArticleNrPrefix && json.SetArticleNrPrefix != '' ? json.SetArticleNrPrefix : SetArticleNrPrefix;
639
- this.MainPosNr = json.MainPosNr;
640
680
  this.Description = json.Description;
641
681
  this.UserSetDataString = json.UserSetDataString;
642
682
  this.BasketModelDesc = json.BasketModelDesc;
@@ -655,6 +695,7 @@ var OrderSetData = /*#__PURE__*/function () {
655
695
  this.BruttoSetPrice = json.BruttoSetPrice;
656
696
  this.CatalogLastUpdate = json.CatalogLastUpdate;
657
697
  this.CatalogValidTo = json.CatalogValidTo;
698
+ this.TinyVariantBaskets = json.TinyVariantBaskets;
658
699
  this.ModelCodex = json.ModelCodex;
659
700
  this.ModelCatalogCodex = json.ModelCatalogCodex;
660
701
  this.GroupType = json.GroupType;
@@ -683,8 +724,8 @@ var OrderSetData = /*#__PURE__*/function () {
683
724
  }
684
725
  }
685
726
  this.OfflineData = json.OfflineData;
686
- if (json.SummaryInfo) for (var _i = 0; _i < json.SummaryInfo.length; _i++) {
687
- this.SummaryInfo.push(new GroupsData(json.SummaryInfo[_i].Group));
727
+ if (json.SummaryInfo) for (var _i2 = 0; _i2 < json.SummaryInfo.length; _i2++) {
728
+ this.SummaryInfo.push(new GroupsData(json.SummaryInfo[_i2].Group));
688
729
  }
689
730
  }
690
731
  return _createClass__default["default"](OrderSetData, [{
@@ -711,8 +752,8 @@ var OrderSetData = /*#__PURE__*/function () {
711
752
  basketIdsMap[orderline.BasketID] = DivaUtils.nanoid();
712
753
  orderline.BasketID = basketIdsMap[orderline.BasketID];
713
754
  }
714
- for (var _i2 = 0; _i2 < this.OrderLines.length; _i2++) {
715
- var _orderline = this.OrderLines[_i2];
755
+ for (var _i4 = 0; _i4 < this.OrderLines.length; _i4++) {
756
+ var _orderline = this.OrderLines[_i4];
716
757
  if (_orderline.RelatedToBasketID) {
717
758
  _orderline.RelatedToBasketID = basketIdsMap[_orderline.RelatedToBasketID];
718
759
  }
@@ -725,8 +766,8 @@ var OrderSetData = /*#__PURE__*/function () {
725
766
  this.SetPlanData = DivaUtils__default["default"].encodeBase64(setPlanData);
726
767
  }
727
768
 
728
- /**
729
- * get the docking point infos of all orderlines of the set
769
+ /**
770
+ * get the docking point infos of all orderlines of the set
730
771
  */
731
772
  }, {
732
773
  key: "getDockingPointInfo",
@@ -836,8 +877,8 @@ var _generateEKTextOfBasket = (function (basket, withoutPrices) {
836
877
  }
837
878
  }
838
879
  };
839
- for (var _i = 0; _i < orderlines.length; _i++) {
840
- _loop2(_i);
880
+ for (var _i2 = 0; _i2 < orderlines.length; _i2++) {
881
+ _loop2(_i2);
841
882
  }
842
883
  var notUsedOls = ols.filter(function (ol) {
843
884
  return ol.IsPartlistArticle && !usedOrderLines.includes(ol);
@@ -1011,11 +1052,11 @@ var processNonPartlistOrderlines = function processNonPartlistOrderlines(basket,
1011
1052
  }
1012
1053
 
1013
1054
  /* Activate when base prices and additional prices should be displayed. */
1014
- /*if (orderLine.ConfigPriceDatas?.BasePrice && !withoutPrices) {
1015
- sapOrderLineText += appendToTheRight(mLength + 1, ' ');
1016
- sapOrderLineText += appendToTheRight(artikelLength, 'Basispreis');
1017
- sapOrderLineText += appendToTheLeft(preisLength - 6, formatPrice(orderLine.ConfigPriceDatas?.BasePrice.toString() ?? '0'));
1018
- sapOrderLineText += newLine + newLine;
1055
+ /*if (orderLine.ConfigPriceDatas?.BasePrice && !withoutPrices) {
1056
+ sapOrderLineText += appendToTheRight(mLength + 1, ' ');
1057
+ sapOrderLineText += appendToTheRight(artikelLength, 'Basispreis');
1058
+ sapOrderLineText += appendToTheLeft(preisLength - 6, formatPrice(orderLine.ConfigPriceDatas?.BasePrice.toString() ?? '0'));
1059
+ sapOrderLineText += newLine + newLine;
1019
1060
  }*/
1020
1061
  /* -------------------------------------------------------------------- */
1021
1062
 
@@ -1163,12 +1204,12 @@ var addVariants = function addVariants(articleLength, orderLine, articleLength2R
1163
1204
  variantDataText += writeOtherLines(vbLines, startPositionArticle2Row /*additionalPrice ? true : false*/);
1164
1205
 
1165
1206
  /* Activate when base prices and additional prices should be displayed. */
1166
- /*if (additionalPrice && false) {
1167
- variantDataText += appendToTheLeft(
1168
- preisLength + (artikelLength - vbLines[vbLines.length - 1].length) - 5,
1169
- formatPrice(additionalPrice?.Price.toString() ?? '0'),
1170
- );
1171
- variantDataText += newLine;
1207
+ /*if (additionalPrice && false) {
1208
+ variantDataText += appendToTheLeft(
1209
+ preisLength + (artikelLength - vbLines[vbLines.length - 1].length) - 5,
1210
+ formatPrice(additionalPrice?.Price.toString() ?? '0'),
1211
+ );
1212
+ variantDataText += newLine;
1172
1213
  }*/
1173
1214
  }
1174
1215
  return variantDataText;
@@ -1410,8 +1451,8 @@ var BasketData = /*#__PURE__*/function () {
1410
1451
  this.PartListGroups = json.PartListGroups;
1411
1452
  this.AdditionalPrices = json.AdditionalPrices;
1412
1453
  if (json.Discounts) {
1413
- for (var _i = 0; _i < json.Discounts.length; _i++) {
1414
- var discount = json.Discounts[_i];
1454
+ for (var _i2 = 0; _i2 < json.Discounts.length; _i2++) {
1455
+ var discount = json.Discounts[_i2];
1415
1456
  if (discount === 0 || (discount === null || discount === void 0 ? void 0 : discount.fixDiscount) === 0 && !discount.isPercentage) continue;
1416
1457
  this._discounts.push({
1417
1458
  fixDiscount: discount.fixDiscount,
@@ -1910,9 +1951,6 @@ var BasketData = /*#__PURE__*/function () {
1910
1951
  key: "concatOrderSets",
1911
1952
  value: function concatOrderSets(orderSets) {
1912
1953
  this.OrderSets = orderSets.concat(this.OrderSets);
1913
- for (var i = 0; i < this.OrderSets.length; i++) {
1914
- this.OrderSets[i].MainPosNr = i + 1;
1915
- }
1916
1954
  }
1917
1955
  }, {
1918
1956
  key: "convertToBaseConfiguration",
@@ -1934,11 +1972,93 @@ var BasketData = /*#__PURE__*/function () {
1934
1972
  value: function getEKText(withoutPrices) {
1935
1973
  return _generateEKTextOfBasket(this, withoutPrices).OrderSets[0].SetOrderText;
1936
1974
  }
1975
+ }, {
1976
+ key: "getProductBasketData",
1977
+ value: function getProductBasketData(variantId) {
1978
+ var _this2 = this;
1979
+ var tinyBasket = {
1980
+ SetPlannerInfos: this.SetPlannerInfos,
1981
+ DivaNr: this.DivaNr,
1982
+ VariantID: variantId,
1983
+ OrderSets: this.OrderSets.map(function (set) {
1984
+ return {
1985
+ AccountGUID: set.AccountGUID,
1986
+ CatalogCodex: set.CatalogCodex,
1987
+ CatalogGUID: set.CatalogGUID,
1988
+ SetHash: set.SetHash,
1989
+ SetImage: set.SetImage,
1990
+ SetID: set.SetID,
1991
+ SetPlanData: set.SetPlanData,
1992
+ SupplierGUID: set.SupplierGUID,
1993
+ Favorites: set.Favorites,
1994
+ HQRenderScript: set.HQRenderScript,
1995
+ Diva3DProject: _this2.Diva3DProject,
1996
+ Variant: set.Variant,
1997
+ OrderLines: set.OrderLines.filter(function (ol) {
1998
+ return !ol.IsPartlistArticle;
1999
+ }).map(function (ol) {
2000
+ var _ol$CatalogCodex;
2001
+ return {
2002
+ ArticleCodex: ol.ArticleCodex,
2003
+ BasketID: ol.BasketID,
2004
+ CatalogCodex: (_ol$CatalogCodex = ol.CatalogCodex) !== null && _ol$CatalogCodex !== void 0 ? _ol$CatalogCodex : set.CatalogCodex,
2005
+ ElementID: ol.ElementID,
2006
+ PosNr: ol.PosNr,
2007
+ Quantity: ol.Quantity,
2008
+ NoPrice: ol.NoPrice ? true : undefined,
2009
+ RelatedToBasketID: ol.RelatedToBasketID,
2010
+ ShelfPlandata: ol.ShelfPlandata,
2011
+ ArticleHash: ol.getHash(),
2012
+ VariantBasketDatas: ol.getTinyVariantBasketDatas()
2013
+ };
2014
+ })
2015
+ };
2016
+ })
2017
+ };
2018
+ if (variantId !== undefined) {
2019
+ var _this$OrderSets$0$Con, _tinyBasket$OrderSets;
2020
+ var configVariant = (_this$OrderSets$0$Con = this.OrderSets[0].ConfigVariants) === null || _this$OrderSets$0$Con === void 0 ? void 0 : _this$OrderSets$0$Con.find(function (v) {
2021
+ return v.VariantID === variantId;
2022
+ });
2023
+ if (!configVariant) throw new Error('variantId ' + variantId + ' not found in basketData. Something went wrong');
2024
+ tinyBasket.OrderSets[0].Variant = configVariant.Variant;
2025
+ tinyBasket.OrderSets[0].Diva3DProject = configVariant.Diva3DProject;
2026
+ tinyBasket.OrderSets[0].Favorites = {
2027
+ VariantValues: {}
2028
+ };
2029
+ tinyBasket.OrderSets[0].SetHash = configVariant.SetHash;
2030
+ tinyBasket.OrderSets[0].SetPlanData = configVariant.SetPlanData;
2031
+ tinyBasket.OrderSets[0].HQRenderScript = configVariant.HQRenderScript;
2032
+ var ol = (_tinyBasket$OrderSets = tinyBasket.OrderSets[0].OrderLines) !== null && _tinyBasket$OrderSets !== void 0 ? _tinyBasket$OrderSets : [];
2033
+ ol.forEach(function (variantOrderline) {
2034
+ var _configVariant$SetVar, _olvd$VariantValues;
2035
+ var olvd = (_configVariant$SetVar = configVariant.SetVariantData) === null || _configVariant$SetVar === void 0 ? void 0 : _configVariant$SetVar[variantOrderline.BasketID];
2036
+ if (!olvd) throw new Error('BaksetId: ' + variantOrderline.BasketID + ' of oderlines not fount in configVariants for Variant: ' + variantId);
2037
+ (_olvd$VariantValues = olvd.VariantValues) === null || _olvd$VariantValues === void 0 || _olvd$VariantValues.forEach(function (variant) {
2038
+ var _variantOrderline$Var;
2039
+ var olVariant = (_variantOrderline$Var = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var === void 0 ? void 0 : _variantOrderline$Var.find(function (vb) {
2040
+ return vb.OPT === variant.OPT;
2041
+ });
2042
+ if (!olVariant && variant.OptionOCD) {
2043
+ var _variantOrderline$Var2;
2044
+ olVariant = (_variantOrderline$Var2 = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var2 === void 0 ? void 0 : _variantOrderline$Var2.find(function (vb) {
2045
+ return vb.OPT.endsWith(variant.OptionOCD.substring(3));
2046
+ });
2047
+ }
2048
+ if (olVariant) {
2049
+ olVariant.OPT = variant.OPT;
2050
+ olVariant.OPV = variant.OPV;
2051
+ }
2052
+ });
2053
+ });
2054
+ }
2055
+ return tinyBasket;
2056
+ }
1937
2057
  }]);
1938
2058
  }();
1939
2059
 
1940
2060
  //ArtkelVarianten der Favoriten Obsolet? weil sie bereits separat gespeichert werden
1941
- var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function ConfigVariantData(VariantID, SetName, SetName_locales, SetImage, hqRenderScript, Diva3DProject, VariantDescription, SetArticleNr, SetPrice, SetHash, SetQuantity, VariantBasketData, SetVariantData, Variant, SummaryInfo, SetPlanData, Set2DImage, BBox, BruttoSetPrice, EkSetPrice, EkCurrency, MetaData, MetaData_locales, VariantDescription_locales, SetOrderText, SetOrderText_locales) {
2061
+ var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function ConfigVariantData(VariantID, SetName, SetName_locales, SetImage, hqRenderScript, Diva3DProject, VariantDescription, SetArticleNr, SetPrice, SetHash, SetQuantity, VariantBasketDatas, SetVariantData, Variant, SummaryInfo, SetPlanData, Set2DImage, BBox, BruttoSetPrice, EkSetPrice, EkCurrency, MetaData, MetaData_locales, VariantDescription_locales, SetOrderText, SetOrderText_locales) {
1942
2062
  _classCallCheck__default["default"](this, ConfigVariantData);
1943
2063
  _defineProperty__default["default"](this, "VariantID", void 0);
1944
2064
  _defineProperty__default["default"](this, "SetName", void 0);
@@ -1978,7 +2098,7 @@ var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function C
1978
2098
  this.SetPrice = SetPrice;
1979
2099
  this.SetHash = SetHash;
1980
2100
  this.SetQuantity = SetQuantity;
1981
- this.VariantBasketDatas = VariantBasketData;
2101
+ this.VariantBasketDatas = VariantBasketDatas;
1982
2102
  this.SetVariantData = SetVariantData;
1983
2103
  this.Variant = Variant;
1984
2104
  this.SummaryInfo = SummaryInfo;
@@ -2164,8 +2284,8 @@ var Favorites = /*#__PURE__*/_createClass__default["default"](function Favorites
2164
2284
  _classCallCheck__default["default"](this, Favorites);
2165
2285
  _defineProperty__default["default"](this, "VariantValues", {});
2166
2286
  });
2167
- var Favorit = /*#__PURE__*/_createClass__default["default"](function Favorit(optionCodex, optionValueCodex, targetArticles, optionName, optionValueName, optionValueImage) {
2168
- _classCallCheck__default["default"](this, Favorit);
2287
+ var Favorite = /*#__PURE__*/_createClass__default["default"](function Favorite(optionCodex, optionValueCodex, targetArticles, optionName, optionValueName, optionValueImage) {
2288
+ _classCallCheck__default["default"](this, Favorite);
2169
2289
  _defineProperty__default["default"](this, "optionCodex", void 0);
2170
2290
  _defineProperty__default["default"](this, "targetArticles", void 0);
2171
2291
  _defineProperty__default["default"](this, "optionName", void 0);
@@ -2195,7 +2315,7 @@ var ProductOrderLine = /*#__PURE__*/_createClass__default["default"](function Pr
2195
2315
  exports.BasketData = BasketData;
2196
2316
  exports.CompactOrderLineData = CompactOrderLine;
2197
2317
  exports.ConfigVariantData = ConfigVariantData;
2198
- exports.Favorit = Favorit;
2318
+ exports.Favorite = Favorite;
2199
2319
  exports.Favorites = Favorites;
2200
2320
  exports.GroupData = GroupData;
2201
2321
  exports.GroupsData = GroupsData;