@crystaldesign/web-planner-logic 26.12.0-beta.9 → 26.13.0-beta.1

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.
Files changed (112) hide show
  1. package/build/cjs/{DivaBoxPlanner-fe9a6f30.js → DivaBoxPlanner-5e930cef.js} +3 -3
  2. package/build/cjs/{DivaStandardPlanner-cec12683.js → DivaStandardPlanner-9b10f74c.js} +13 -9
  3. package/build/cjs/{DoorPlanner-4cd5b7af.js → DoorPlanner-3c74f8e1.js} +2 -2
  4. package/build/cjs/{Host3DSignalR-2d2aff4d.js → Host3DSignalR-2ba0c49a.js} +2 -2
  5. package/build/cjs/{LiviqueWWSHandler-390f5a87.js → LiviqueWWSHandler-a4230440.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-a0415f81.js → PfisterWWSHandler-2d41405a.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-125c6e26.js → PlannerHandler2D-97dff60d.js} +32 -287
  8. package/build/cjs/{SeriousBasketHandler-63bda08b.js → SeriousBasketHandler-a5c22844.js} +7 -25
  9. package/build/cjs/{ShelfPlanner-364467bf.js → ShelfPlanner-b30f8c39.js} +105 -77
  10. package/build/cjs/{StandardWWSHandler-42a1b294.js → StandardWWSHandler-40c2a2e8.js} +2 -2
  11. package/build/cjs/{index-de644684.js → index-70f9ba19.js} +2722 -1696
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-b273b119.js → DivaBoxPlanner-87010599.js} +3 -3
  14. package/build/esm/{DivaStandardPlanner-3f121fa7.js → DivaStandardPlanner-f5f47d3b.js} +13 -9
  15. package/build/esm/{DoorPlanner-39f70636.js → DoorPlanner-fb5b9eb2.js} +2 -2
  16. package/build/esm/{Host3DSignalR-04417d51.js → Host3DSignalR-d316eb88.js} +2 -2
  17. package/build/esm/{LiviqueWWSHandler-63115663.js → LiviqueWWSHandler-2a135ba1.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-649e67e3.js → PfisterWWSHandler-e7d55634.js} +2 -2
  19. package/build/esm/PlannerHandler2D-288e724b.js +273 -0
  20. package/build/esm/{SeriousBasketHandler-023d626c.js → SeriousBasketHandler-60cbf854.js} +7 -25
  21. package/build/esm/{ShelfPlanner-dff465f0.js → ShelfPlanner-f3a02665.js} +105 -77
  22. package/build/esm/{StandardWWSHandler-44506b3a.js → StandardWWSHandler-eb1ba4cf.js} +2 -2
  23. package/build/esm/{index-111ce9ad.js → index-9eba9def.js} +2722 -1697
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/headless/headlessSession.d.ts +20 -0
  26. package/build/types/web-planner-logic/src/headless/headlessSession.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/AccessoireItemType.d.ts +4 -0
  28. package/build/types/web-planner-logic/src/interface/Articles/AccessoireItemType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/ConfiguratorStructureDataType.d.ts +1 -0
  30. package/build/types/web-planner-logic/src/interface/ConfiguratorStructureDataType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  32. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts +4 -0
  34. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/IDM/PriceFeatureGroup.d.ts +1 -21
  36. package/build/types/web-planner-logic/src/interface/IDM/PriceFeatureGroup.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +5 -5
  38. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts +10 -0
  40. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/Planner/PlannerDataType.d.ts +2 -0
  42. package/build/types/web-planner-logic/src/interface/Planner/PlannerDataType.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +8 -2
  44. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts +1 -0
  46. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +7 -2
  48. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  49. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts +10 -3
  50. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
  51. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +7 -8
  52. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
  53. package/build/types/web-planner-logic/src/logic/Article/mandatoryAccessories.d.ts +4 -0
  54. package/build/types/web-planner-logic/src/logic/Article/mandatoryAccessories.d.ts.map +1 -0
  55. package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts +5 -0
  56. package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts.map +1 -0
  57. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +2 -2
  58. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +0 -8
  60. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts +5 -2
  62. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts +9 -1
  64. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +6 -3
  66. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +7 -1
  68. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +1 -1
  70. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  71. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  72. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/PlannerHandler2D.d.ts.map +1 -1
  73. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts +13 -2
  74. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts.map +1 -1
  75. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +2 -1
  76. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  77. package/build/types/web-planner-logic/src/model/Articles/Article/CatalogArticleData.d.ts.map +1 -1
  78. package/build/types/web-planner-logic/src/model/Articles/Article/DivaCatalogArticle.d.ts.map +1 -1
  79. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts +16 -1
  80. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
  81. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts +6 -0
  82. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts.map +1 -1
  83. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +1 -0
  84. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  85. package/build/types/web-planner-logic/src/model/Catalog/DivaCatalogData.d.ts.map +1 -1
  86. package/build/types/web-planner-logic/src/model/Catalog/IDMCatalogData.d.ts.map +1 -1
  87. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +4 -4
  88. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
  89. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts +2 -1
  90. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts.map +1 -1
  91. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +4 -4
  92. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
  93. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts +4 -1
  94. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
  95. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts +5 -2
  96. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
  97. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts +3 -3
  98. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -1
  99. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts +7 -2
  100. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts.map +1 -1
  101. package/build/types/web-planner-logic/src/test/accessorySvgSwapDocking.test.d.ts +2 -0
  102. package/build/types/web-planner-logic/src/test/accessorySvgSwapDocking.test.d.ts.map +1 -0
  103. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts +2 -0
  104. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts.map +1 -0
  105. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts +2 -0
  106. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts.map +1 -0
  107. package/build/types/web-planner-logic/src/test/idmMeasureUnit.test.d.ts +2 -0
  108. package/build/types/web-planner-logic/src/test/idmMeasureUnit.test.d.ts.map +1 -0
  109. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts +1 -1
  110. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts.map +1 -1
  111. package/package.json +3 -3
  112. package/build/esm/PlannerHandler2D-15b3d672.js +0 -526
@@ -3,7 +3,7 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var index = require('./index-de644684.js');
6
+ var index = require('./index-70f9ba19.js');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
9
9
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -11,6 +11,7 @@ require('@babel/runtime/regenerator');
11
11
  require('@babel/runtime/helpers/objectWithoutProperties');
12
12
  require('@babel/runtime/helpers/toConsumableArray');
13
13
  require('axios');
14
+ require('@crystaldesign/planner-2d-core');
14
15
  require('@crystaldesign/basket-model');
15
16
  require('@babel/runtime/helpers/typeof');
16
17
  require('fast-xml-parser');
@@ -20,7 +21,6 @@ require('@babel/runtime/helpers/inherits');
20
21
  require('@babel/runtime/helpers/wrapNativeSuper');
21
22
  require('@crystaldesign/basket-handler');
22
23
  require('socket.io-client');
23
- require('@crystaldesign/planner-2d-core');
24
24
 
25
25
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
26
 
@@ -79,7 +79,7 @@ var StandardWWSHandler = /*#__PURE__*/function () {
79
79
  var posNr = 1;
80
80
  for (var iKey in articles) {
81
81
  var article = articles[iKey];
82
- var partlistArticles = this.getPartlistComponents(article);
82
+ var partlistArticles = index.summaryHandlerInstance.getPartlistComponents(article);
83
83
  var partlistArticlesWithTabGroup = [];
84
84
  groupedPartlistArticles.push({
85
85
  article: article,
@@ -172,7 +172,7 @@ var StandardWWSHandler = /*#__PURE__*/function () {
172
172
  var _item$FormattedOption, _item$FormattedOption2, _this$getFormattedOpt;
173
173
  return item.Name == partListArticle.name && item.ArticleNr == partListArticle.configArticleCodex && ((_item$FormattedOption = item.FormattedOptions) === null || _item$FormattedOption === void 0 ? void 0 : _item$FormattedOption[0]) && ((_item$FormattedOption2 = item.FormattedOptions) === null || _item$FormattedOption2 === void 0 ? void 0 : _item$FormattedOption2[0].Title) == ((_this$getFormattedOpt = _this.getFormattedOptions(partListArticle, optionArticle, [], '', usedOptionCodexes)) === null || _this$getFormattedOpt === void 0 ? void 0 : _this$getFormattedOpt[0].Title);
174
174
  });
175
- var unitPrice = _this.unitPrice(partListArticle);
175
+ var unitPrice = index.summaryHandlerInstance.getPartlistUnitPrice(partListArticle);
176
176
  if (fountEntry) {
177
177
  fountEntry.Quantity = fountEntry.Quantity + partListArticle.quantity;
178
178
  fountEntry.FormattedPrice = DivaUtils__default["default"].formatPrice(unitPrice * fountEntry.Quantity);
@@ -260,26 +260,6 @@ var StandardWWSHandler = /*#__PURE__*/function () {
260
260
  };
261
261
  }
262
262
 
263
- /**
264
- * Components at any partlist depth. Articles that only bundle further components without a price of their own (IDM
265
- * "Hülsen") are left out, also when the current configuration loads none of their components (e.g. no mattress chosen):
266
- * an empty Hülse is not a part. A partlist parent with a price of its own stays a part, so its price is not lost.
267
- */
268
- }, {
269
- key: "getPartlistComponents",
270
- value: function getPartlistComponents(article) {
271
- return Object.values(article.getRecursivePartlistArticles()).filter(function (partlistArticle) {
272
- return !partlistArticle.hasPartlistArticle || partlistArticle.mainPrice > 0;
273
- });
274
- }
275
-
276
- /** Unit price of a part: a partlist parent contributes only its own price, its components are listed themselves. */
277
- }, {
278
- key: "unitPrice",
279
- value: function unitPrice(partListArticle) {
280
- return partListArticle.hasPartlistArticle ? partListArticle.mainPrice : partListArticle.price;
281
- }
282
-
283
263
  /**
284
264
  * The first emitted option flagged with IS_MAIN_COLOR is the main color of the part list; without one, the first emitted
285
265
  * OPTBE_BOX option (API2 fallback) is. Decided after all lines exist, so only options that really appear can be chosen.
@@ -372,11 +352,13 @@ var StandardWWSHandler = /*#__PURE__*/function () {
372
352
  colorCodices.push(coloCodex);
373
353
  //IDM has no group name on the value itself: there the Bezugsgruppe is its own feature, merged into this one only for the view
374
354
  var groupName = (_optionState$val$grou = (_optionState$val = optionState.val) === null || _optionState$val === void 0 ? void 0 : _optionState$val.groupName) !== null && _optionState$val$grou !== void 0 ? _optionState$val$grou : (_article$getMergesToO = article.getMergesToOPGParentOps(optionState.optionCodex)) === null || _article$getMergesToO === void 0 ? void 0 : _article$getMergesToO.valName;
355
+ // API2 carries the fabric number as VCodex; IDM values have none, there the option key is the fabric number ("0_227_1" → "0-227-1")
356
+ var codex = optionState.vCodex && optionState.vCodex !== optionState.valName ? optionState.vCodex : article.CatalogData.isIDMFormat ? index.summaryHandlerInstance.getDisplayCodex(optionState) : '';
375
357
  var formattedOption = {
376
358
  PosNr: finalPosNr,
377
359
  Text: (groupName ? groupName + ' ' : '') + optionState.valName,
378
360
  Title: optionState.optionOrigName,
379
- Codex: optionState.vCodex && optionState.vCodex !== optionState.valName ? optionState.vCodex : '',
361
+ Codex: codex,
380
362
  IsMainColor: false
381
363
  };
382
364
  formattedOptions.push(formattedOption);
@@ -6,11 +6,12 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
6
6
  var _createClass = require('@babel/runtime/helpers/createClass');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
9
- var index = require('./index-de644684.js');
9
+ var index = require('./index-70f9ba19.js');
10
10
  var DivaUtils = require('@crystaldesign/diva-utils');
11
11
  require('@babel/runtime/helpers/slicedToArray');
12
12
  require('@babel/runtime/helpers/objectWithoutProperties');
13
13
  require('axios');
14
+ require('@crystaldesign/planner-2d-core');
14
15
  require('@crystaldesign/basket-model');
15
16
  require('@babel/runtime/helpers/typeof');
16
17
  require('fast-xml-parser');
@@ -20,7 +21,6 @@ require('@babel/runtime/helpers/inherits');
20
21
  require('@babel/runtime/helpers/wrapNativeSuper');
21
22
  require('@crystaldesign/basket-handler');
22
23
  require('socket.io-client');
23
- require('@crystaldesign/planner-2d-core');
24
24
 
25
25
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
26
 
@@ -65,9 +65,6 @@ var ShelfPlanner = /*#__PURE__*/function () {
65
65
  //true until the shelfaccessoires saved in the basket were restored into the cells (see restoreShelfAccessoires in the DivaSetHandler).
66
66
  //until then no initAcc may be placed, they would occupy the cells of the saved accessoires
67
67
  _defineProperty__default["default"](this, "restorePending", void 0);
68
- //accessoires of grids that were switched off by a grid rule, per gridIndex. They get placed again when the grid
69
- //becomes active again - eg a shelf that is configured from 100cm to 50cm and back keeps its accessoires
70
- _defineProperty__default["default"](this, "stashedAccessoires", {});
71
68
  /**
72
69
  * Debug trail of shelf-planner mutations (the shelf equivalent of the box
73
70
  * planner's constructionDebugStack): one entry per visibility flip, grid
@@ -77,6 +74,10 @@ var ShelfPlanner = /*#__PURE__*/function () {
77
74
  */
78
75
  _defineProperty__default["default"](this, "shelfDebugStack", []);
79
76
  _defineProperty__default["default"](this, "shelfDebugSeq", 0);
77
+ //accessoires of grids that were cleared by a grid rule, per gridIndex and the HeightGridCellCountOnRule entry the grid
78
+ //ran as. They get placed again when the grid becomes active again under the same entry - eg a shelf that is configured
79
+ //from 100cm to 50cm and back keeps its accessoires. A grid that comes back under another entry starts with that entry's initAcc
80
+ _defineProperty__default["default"](this, "stashedAccessoires", {});
80
81
  this.article = article;
81
82
  this.restorePending = !!article.shelfPlanData;
82
83
  this.disableCellsByElement = data.DisableCells;
@@ -201,27 +202,30 @@ var ShelfPlanner = /*#__PURE__*/function () {
201
202
  key: "onConfigChanged",
202
203
  value: (function () {
203
204
  var _onConfigChanged = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(variantValues) {
204
- var newHeightSet, gridsTodos, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
205
+ var newHeightSet, gridsTodos, ruleIndexesBefore, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
205
206
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
206
207
  while (1) switch (_context2.prev = _context2.next) {
207
208
  case 0:
208
209
  newHeightSet = false;
209
- gridsTodos = [];
210
+ gridsTodos = []; //onConfigChanged moves a grid to its new rule entry, the stash needs the entry the accessoires were planned under
211
+ ruleIndexesBefore = this.grids.map(function (grid) {
212
+ return grid.CurrentLoadedRuleIndex;
213
+ });
210
214
  for (i = 0; i < this.grids.length; i++) {
211
215
  gridsTodos.push(this.grids[i].onConfigChanged());
212
216
  }
213
217
  _i = 0;
214
- case 4:
218
+ case 5:
215
219
  if (!(_i < gridsTodos.length)) {
216
- _context2.next = 13;
220
+ _context2.next = 14;
217
221
  break;
218
222
  }
219
223
  if (gridsTodos[_i].length) {
220
- _context2.next = 7;
224
+ _context2.next = 8;
221
225
  break;
222
226
  }
223
- return _context2.abrupt("continue", 10);
224
- case 7:
227
+ return _context2.abrupt("continue", 11);
228
+ case 8:
225
229
  grid = this.grids[_i];
226
230
  if (gridsTodos[_i].includes('disableGridRule')) this.logShelfDebug({
227
231
  phase: 'configChanged',
@@ -235,44 +239,44 @@ var ShelfPlanner = /*#__PURE__*/function () {
235
239
  gridIndex: grid.ShelfIndex,
236
240
  detail: 'HeightGridCellCountOnRule match changed — grid rebuilt (cell count / placeable accessories can change), its accessories are deleted'
237
241
  });
238
- case 10:
242
+ case 11:
239
243
  _i++;
240
- _context2.next = 4;
244
+ _context2.next = 5;
241
245
  break;
242
- case 13:
243
- _i2 = 0;
244
246
  case 14:
247
+ _i2 = 0;
248
+ case 15:
245
249
  if (!(_i2 < gridsTodos.length)) {
246
- _context2.next = 23;
250
+ _context2.next = 24;
247
251
  break;
248
252
  }
249
253
  if (gridsTodos[_i2].length) {
250
- _context2.next = 17;
254
+ _context2.next = 18;
251
255
  break;
252
256
  }
253
- return _context2.abrupt("continue", 20);
254
- case 17:
257
+ return _context2.abrupt("continue", 21);
258
+ case 18:
255
259
  //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
256
- this.stashAccessoiresOfGrid(_i2);
257
- _context2.next = 20;
260
+ this.stashAccessoiresOfGrid(_i2, ruleIndexesBefore[_i2]);
261
+ _context2.next = 21;
258
262
  return this.grids[_i2].deleteAllAccOfGrid();
259
- case 20:
263
+ case 21:
260
264
  _i2++;
261
- _context2.next = 14;
265
+ _context2.next = 15;
262
266
  break;
263
- case 23:
264
- _i3 = 0;
265
267
  case 24:
268
+ _i3 = 0;
269
+ case 25:
266
270
  if (!(_i3 < gridsTodos.length)) {
267
- _context2.next = 40;
271
+ _context2.next = 41;
268
272
  break;
269
273
  }
270
274
  if (gridsTodos[_i3].length) {
271
- _context2.next = 27;
275
+ _context2.next = 28;
272
276
  break;
273
277
  }
274
- return _context2.abrupt("continue", 37);
275
- case 27:
278
+ return _context2.abrupt("continue", 38);
279
+ case 28:
276
280
  if (gridsTodos[_i3].includes('heightGridRule')) {
277
281
  this.creatNewGrid(_i3);
278
282
  newHeightSet = true;
@@ -280,58 +284,58 @@ var ShelfPlanner = /*#__PURE__*/function () {
280
284
  //read the grid after a possible recreate, the replaced one is not the grid that gets filled
281
285
  _grid = this.grids[_i3];
282
286
  if (!((gridsTodos[_i3].includes('heightGridRule') || gridsTodos[_i3].includes('disableGridRule')) && !_grid.DisabledByRule)) {
283
- _context2.next = 37;
287
+ _context2.next = 38;
284
288
  break;
285
289
  }
286
290
  if (!this.restorePending) {
287
- _context2.next = 32;
291
+ _context2.next = 33;
288
292
  break;
289
293
  }
290
- return _context2.abrupt("continue", 37);
291
- case 32:
292
- _context2.next = 34;
294
+ return _context2.abrupt("continue", 38);
295
+ case 33:
296
+ _context2.next = 35;
293
297
  return this.placeStashedAccessoiresOfGrid(_i3);
294
- case 34:
298
+ case 35:
295
299
  if (_context2.sent) {
296
- _context2.next = 37;
300
+ _context2.next = 38;
297
301
  break;
298
302
  }
299
- _context2.next = 37;
303
+ _context2.next = 38;
300
304
  return this.initAccList(_i3);
301
- case 37:
305
+ case 38:
302
306
  _i3++;
303
- _context2.next = 24;
307
+ _context2.next = 25;
304
308
  break;
305
- case 40:
309
+ case 41:
306
310
  if (!(!newHeightSet && Object.keys(variantValues).length)) {
307
- _context2.next = 51;
311
+ _context2.next = 52;
308
312
  break;
309
313
  }
310
314
  grids = this.activeGrids;
311
315
  _i4 = 0;
312
- case 43:
316
+ case 44:
313
317
  if (!(_i4 < grids.length)) {
314
- _context2.next = 51;
318
+ _context2.next = 52;
315
319
  break;
316
320
  }
317
321
  _grid2 = grids[_i4];
318
322
  if (!((_grid2$DisableCellsBy = _grid2.DisableCellsByMeasures) !== null && _grid2$DisableCellsBy !== void 0 && _grid2$DisableCellsBy.options.find(function (o) {
319
323
  return Object.keys(variantValues).includes('OPT' + o.opt);
320
324
  }) || !!_grid2.disableCellsByRules)) {
321
- _context2.next = 48;
325
+ _context2.next = 49;
322
326
  break;
323
327
  }
324
328
  newHeightSet = true;
325
- return _context2.abrupt("break", 51);
326
- case 48:
329
+ return _context2.abrupt("break", 52);
330
+ case 49:
327
331
  _i4++;
328
- _context2.next = 43;
332
+ _context2.next = 44;
329
333
  break;
330
- case 51:
334
+ case 52:
331
335
  if (newHeightSet) {
332
336
  this.updateDisabledCells();
333
337
  }
334
- case 52:
338
+ case 53:
335
339
  case "end":
336
340
  return _context2.stop();
337
341
  }
@@ -350,16 +354,24 @@ var ShelfPlanner = /*#__PURE__*/function () {
350
354
  }
351
355
 
352
356
  /**
353
- * Remembers the accessoires of a grid that is about to be cleared because a grid rule switched it off.
357
+ * Remembers the accessoires of a grid that is about to be cleared because a grid rule switched it off or rebuilt it.
354
358
  * An empty grid never overwrites an existing memory, so the accessoires survive further configuration changes.
355
359
  * @param gridIndex grid that gets cleared
360
+ * @param ruleIndex HeightGridCellCountOnRule entry the grid ran as while the accessoires were planned
356
361
  */
357
362
  }, {
358
363
  key: "stashAccessoiresOfGrid",
359
- value: function stashAccessoiresOfGrid(gridIndex) {
364
+ value: function stashAccessoiresOfGrid(gridIndex, ruleIndex) {
360
365
  var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex]);
361
366
  if (!stashedAccessoires.length) return;
362
- this.stashedAccessoires[gridIndex] = stashedAccessoires;
367
+ this.stashedAccessoires[this.stashKey(gridIndex, ruleIndex)] = stashedAccessoires;
368
+ }
369
+
370
+ /** The memory is per grid and per HeightGridCellCountOnRule entry, false when the grid runs without a matching entry. */
371
+ }, {
372
+ key: "stashKey",
373
+ value: function stashKey(gridIndex, ruleIndex) {
374
+ return gridIndex + '#' + ruleIndex;
363
375
  }
364
376
 
365
377
  /**
@@ -382,7 +394,12 @@ var ShelfPlanner = /*#__PURE__*/function () {
382
394
  var _accessoireShelfPlann;
383
395
  var accessoireGrid = accessoireShelfPlanner.grids[j];
384
396
  var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid);
385
- if (accessoiresOfGrid.length) accessoires[accessoireGrid.ShelfIndex] = accessoiresOfGrid;
397
+ if (accessoiresOfGrid.length) {
398
+ accessoires[accessoireGrid.ShelfIndex] = {
399
+ ruleIndex: accessoireGrid.CurrentLoadedRuleIndex,
400
+ accessoires: accessoiresOfGrid
401
+ };
402
+ }
386
403
  }
387
404
  stashedAccessoires.push({
388
405
  articleCodex: accessoire.articleCodex,
@@ -398,7 +415,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
398
415
  }
399
416
 
400
417
  /**
401
- * Places the remembered accessoires of a grid back into their cells.
418
+ * Places the accessoires remembered for the rule entry the grid runs now back into their cells.
402
419
  * @param gridIndex grid that became active again
403
420
  * @returns how many accessoires were placed - 0 means the grid is still empty and needs its initAcc
404
421
  */
@@ -406,24 +423,26 @@ var ShelfPlanner = /*#__PURE__*/function () {
406
423
  key: "placeStashedAccessoiresOfGrid",
407
424
  value: (function () {
408
425
  var _placeStashedAccessoiresOfGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(gridIndex) {
409
- var stashedAccessoires;
426
+ var stashKey, stashedAccessoires;
410
427
  return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
411
428
  while (1) switch (_context3.prev = _context3.next) {
412
429
  case 0:
413
- stashedAccessoires = this.stashedAccessoires[gridIndex];
430
+ //a recreated grid already runs its new rule entry, only accessoires planned under that entry belong into it
431
+ stashKey = this.stashKey(gridIndex, this.grids[gridIndex].CurrentLoadedRuleIndex);
432
+ stashedAccessoires = this.stashedAccessoires[stashKey];
414
433
  if (stashedAccessoires !== null && stashedAccessoires !== void 0 && stashedAccessoires.length) {
415
- _context3.next = 3;
434
+ _context3.next = 4;
416
435
  break;
417
436
  }
418
437
  return _context3.abrupt("return", 0);
419
- case 3:
438
+ case 4:
420
439
  //remove it first, a reconfiguration triggered by placing them must not place them a second time
421
- delete this.stashedAccessoires[gridIndex];
422
- _context3.next = 6;
440
+ delete this.stashedAccessoires[stashKey];
441
+ _context3.next = 7;
423
442
  return this.placeStashedAccessoiresInGrid(gridIndex, stashedAccessoires);
424
- case 6:
425
- return _context3.abrupt("return", _context3.sent);
426
443
  case 7:
444
+ return _context3.abrupt("return", _context3.sent);
445
+ case 8:
427
446
  case "end":
428
447
  return _context3.stop();
429
448
  }
@@ -438,7 +457,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
438
457
  key: "placeStashedAccessoiresByGrid",
439
458
  value: (function () {
440
459
  var _placeStashedAccessoiresByGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(stashedAccessoires) {
441
- var gridIndexes, i, _this$getGridByIndex, gridIndex;
460
+ var gridIndexes, i, gridIndex, grid, stashed;
442
461
  return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
443
462
  while (1) switch (_context4.prev = _context4.next) {
444
463
  case 0:
@@ -446,27 +465,36 @@ var ShelfPlanner = /*#__PURE__*/function () {
446
465
  i = 0;
447
466
  case 2:
448
467
  if (!(i < gridIndexes.length)) {
449
- _context4.next = 14;
468
+ _context4.next = 18;
450
469
  break;
451
470
  }
452
- gridIndex = Number(gridIndexes[i]); //the accessoire was created new, so its initAcc are already placed in the cells the remembered accessoires need
453
- _context4.next = 6;
454
- return (_this$getGridByIndex = this.getGridByIndex(gridIndex)) === null || _this$getGridByIndex === void 0 ? void 0 : _this$getGridByIndex.deleteAllAccOfGrid();
455
- case 6:
456
- _context4.next = 8;
457
- return this.placeStashedAccessoiresInGrid(gridIndex, stashedAccessoires[gridIndex]);
471
+ gridIndex = Number(gridIndexes[i]);
472
+ grid = this.getGridByIndex(gridIndex);
473
+ stashed = stashedAccessoires[gridIndex]; //the accessoire was created new, its grids run their own rule entry with that entry's initAcc in place. A grid that
474
+ //runs another entry than the remembered accessoires were planned under keeps them
475
+ if (!(!grid || grid.CurrentLoadedRuleIndex !== stashed.ruleIndex)) {
476
+ _context4.next = 8;
477
+ break;
478
+ }
479
+ return _context4.abrupt("continue", 15);
458
480
  case 8:
481
+ _context4.next = 10;
482
+ return grid.deleteAllAccOfGrid();
483
+ case 10:
484
+ _context4.next = 12;
485
+ return this.placeStashedAccessoiresInGrid(gridIndex, stashed.accessoires);
486
+ case 12:
459
487
  if (_context4.sent) {
460
- _context4.next = 11;
488
+ _context4.next = 15;
461
489
  break;
462
490
  }
463
- _context4.next = 11;
491
+ _context4.next = 15;
464
492
  return this.initAccList(gridIndex);
465
- case 11:
493
+ case 15:
466
494
  i++;
467
495
  _context4.next = 2;
468
496
  break;
469
- case 14:
497
+ case 18:
470
498
  case "end":
471
499
  return _context4.stop();
472
500
  }
@@ -1528,8 +1556,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
1528
1556
  }, {
1529
1557
  key: "getCellIndexOfBasketId",
1530
1558
  value: function getCellIndexOfBasketId(gridIndex, basketId) {
1531
- var _this$getGridByIndex2;
1532
- return (_this$getGridByIndex2 = this.getGridByIndex(gridIndex)) === null || _this$getGridByIndex2 === void 0 ? void 0 : _this$getGridByIndex2.getIndexOfBasketId(basketId);
1559
+ var _this$getGridByIndex;
1560
+ return (_this$getGridByIndex = this.getGridByIndex(gridIndex)) === null || _this$getGridByIndex === void 0 ? void 0 : _this$getGridByIndex.getIndexOfBasketId(basketId);
1533
1561
  }
1534
1562
  }, {
1535
1563
  key: "allGrids",
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- require('./index-de644684.js');
5
+ require('./index-70f9ba19.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/defineProperty');
@@ -11,6 +11,7 @@ require('@babel/runtime/helpers/objectWithoutProperties');
11
11
  require('@babel/runtime/helpers/toConsumableArray');
12
12
  require('axios');
13
13
  require('@crystaldesign/diva-utils');
14
+ require('@crystaldesign/planner-2d-core');
14
15
  require('@crystaldesign/basket-model');
15
16
  require('@babel/runtime/helpers/typeof');
16
17
  require('fast-xml-parser');
@@ -20,7 +21,6 @@ require('@babel/runtime/helpers/inherits');
20
21
  require('@babel/runtime/helpers/wrapNativeSuper');
21
22
  require('@crystaldesign/basket-handler');
22
23
  require('socket.io-client');
23
- require('@crystaldesign/planner-2d-core');
24
24
 
25
25
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
26