@crystaldesign/web-planner-logic 26.13.0-beta.3 → 26.13.0-beta.30
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.
- package/build/cjs/{DivaBoxPlanner-09506958.js → DivaBoxPlanner-f9f577b0.js} +4 -3
- package/build/cjs/{DivaStandardPlanner-3afaa9dc.js → DivaStandardPlanner-fd71c557.js} +52 -42
- package/build/cjs/{DoorPlanner-b7dc9d75.js → DoorPlanner-1e941d6e.js} +3 -2
- package/build/cjs/{Host3DSignalR-af1273a3.js → Host3DSignalR-7aa4d347.js} +63 -19
- package/build/cjs/{LiviqueWWSHandler-f90e47e8.js → LiviqueWWSHandler-c8f83739.js} +3 -2
- package/build/cjs/{PfisterWWSHandler-44e98549.js → PfisterWWSHandler-d3fd59c5.js} +3 -2
- package/build/cjs/{PlannerHandler2D-8655bcdb.js → PlannerHandler2D-e6d1cebc.js} +1 -1
- package/build/cjs/{SeriousBasketHandler-da58bfd5.js → SeriousBasketHandler-c8abdb16.js} +3 -2
- package/build/cjs/{ShelfPlanner-fa17b8ac.js → ShelfPlanner-173ee746.js} +137 -36
- package/build/cjs/{StandardWWSHandler-84ff60ba.js → StandardWWSHandler-e31f5446.js} +3 -2
- package/build/cjs/{index-0075f2cf.js → index-76d3a1ec.js} +1856 -1217
- package/build/cjs/index.js +3 -7
- package/build/esm/{DivaBoxPlanner-f98e012b.js → DivaBoxPlanner-086b4c02.js} +4 -3
- package/build/esm/{DivaStandardPlanner-9436f998.js → DivaStandardPlanner-9864a9dd.js} +52 -42
- package/build/esm/{DoorPlanner-5725f710.js → DoorPlanner-d29bc13e.js} +3 -2
- package/build/esm/{Host3DSignalR-d160a5ff.js → Host3DSignalR-dbe6624e.js} +63 -19
- package/build/esm/{LiviqueWWSHandler-1bef5d2e.js → LiviqueWWSHandler-60691979.js} +3 -2
- package/build/esm/{PfisterWWSHandler-967a27ec.js → PfisterWWSHandler-1fe8accd.js} +3 -2
- package/build/esm/{PlannerHandler2D-00b50d01.js → PlannerHandler2D-88b9a108.js} +1 -1
- package/build/esm/{SeriousBasketHandler-7563dbf3.js → SeriousBasketHandler-0a3966d6.js} +3 -2
- package/build/esm/{ShelfPlanner-58042ac8.js → ShelfPlanner-614b7281.js} +137 -36
- package/build/esm/{StandardWWSHandler-25e8eec4.js → StandardWWSHandler-12b16709.js} +3 -2
- package/build/esm/{index-6188684c.js → index-8d311c4b.js} +1856 -1213
- package/build/esm/index.js +3 -2
- package/build/types/web-planner-logic/src/index.d.ts +1 -7
- package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/AdditionalModelInfos.d.ts +4 -2
- package/build/types/web-planner-logic/src/interface/AdditionalModelInfos.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/AccessoireItemType.d.ts +6 -2
- package/build/types/web-planner-logic/src/interface/Articles/AccessoireItemType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts +2 -3
- package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Planner/IDM3DTranslation.d.ts +20 -0
- package/build/types/web-planner-logic/src/interface/Planner/IDM3DTranslation.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +3 -0
- package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +1 -1
- package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +30 -0
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts +5 -0
- package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +8 -0
- package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/mandatoryAccessories.d.ts +3 -1
- package/build/types/web-planner-logic/src/logic/Article/mandatoryAccessories.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +26 -0
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +5 -1
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts +33 -0
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/Host3DSignalR.d.ts +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/Host3DSignalR.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +4 -0
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Articles/Article/CatalogArticleData.d.ts +1 -0
- package/build/types/web-planner-logic/src/model/Articles/Article/CatalogArticleData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Articles/Article/DivaCatalogArticle.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +1 -0
- package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Catalog/DivaCatalogData.d.ts +3 -0
- package/build/types/web-planner-logic/src/model/Catalog/DivaCatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Catalog/IDMCatalogData.d.ts +4 -2
- package/build/types/web-planner-logic/src/model/Catalog/IDMCatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +2 -3
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts +12 -0
- package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts +23 -11
- package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts +1 -34
- package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Properties/propertyValues.d.ts +42 -0
- package/build/types/web-planner-logic/src/model/Properties/propertyValues.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/bundleRulesOwnPartlist.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/bundleRulesOwnPartlist.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/classificationRepairFreeText.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/classificationRepairFreeText.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/decisionFeatureRefOp.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/decisionFeatureRefOp.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/getConfigStepKeyOfAccessoire.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/getConfigStepKeyOfAccessoire.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/host3DSignalRReconnect.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/host3DSignalRReconnect.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/orderNumberTemplates.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/orderNumberTemplates.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/partlistChangeReevaluatesOptionTree.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/partlistChangeReevaluatesOptionTree.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/plannerElementHeightChange.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/plannerElementHeightChange.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/plannerHandler3DRoomListQueue.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/plannerHandler3DRoomListQueue.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/propertyParsers.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/propertyParsers.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/propertyValues.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/propertyValues.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/shelfStashInheritedOptions.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/shelfStashInheritedOptions.test.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -6,14 +6,15 @@ 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-
|
|
9
|
+
var index = require('./index-76d3a1ec.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('@babel/runtime/helpers/typeof');
|
|
15
|
+
require('@babel/runtime/helpers/toArray');
|
|
14
16
|
require('@crystaldesign/planner-2d-core');
|
|
15
17
|
require('@crystaldesign/basket-model');
|
|
16
|
-
require('@babel/runtime/helpers/typeof');
|
|
17
18
|
require('fast-xml-parser');
|
|
18
19
|
require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
19
20
|
require('@babel/runtime/helpers/getPrototypeOf');
|
|
@@ -32,9 +33,14 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
32
33
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
33
34
|
var DivaUtils__default = /*#__PURE__*/_interopDefaultLegacy(DivaUtils);
|
|
34
35
|
|
|
36
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
37
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
38
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
35
39
|
function ownKeys(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; }
|
|
36
40
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
41
|
var LOG = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
|
|
42
|
+
|
|
43
|
+
/** Values the parents pass on to their accessoires with their global options, per basketId of the accessoire. */
|
|
38
44
|
var ShelfPlanner = /*#__PURE__*/function () {
|
|
39
45
|
function ShelfPlanner(data, article) {
|
|
40
46
|
_classCallCheck__default["default"](this, ShelfPlanner);
|
|
@@ -127,6 +133,16 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* True when an accessoire with this codex can be planned for free on this shelf (an initAcc with noPrice, eg the first
|
|
139
|
+
* Kleiderstange of a Jutzler element).
|
|
140
|
+
*/
|
|
141
|
+
}, {
|
|
142
|
+
key: "canBeFree",
|
|
143
|
+
value: function canBeFree(articleCodex) {
|
|
144
|
+
return this.freeArticlesPossible[articleCodex] !== undefined;
|
|
145
|
+
}
|
|
130
146
|
}, {
|
|
131
147
|
key: "IsVisible",
|
|
132
148
|
get: function get() {
|
|
@@ -362,7 +378,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
362
378
|
}, {
|
|
363
379
|
key: "stashAccessoiresOfGrid",
|
|
364
380
|
value: function stashAccessoiresOfGrid(gridIndex, ruleIndex) {
|
|
365
|
-
var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex]);
|
|
381
|
+
var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex], this.valuesPassedOnByParents());
|
|
366
382
|
if (!stashedAccessoires.length) return;
|
|
367
383
|
this.stashedAccessoires[this.stashKey(gridIndex, ruleIndex)] = stashedAccessoires;
|
|
368
384
|
}
|
|
@@ -377,12 +393,15 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
377
393
|
/**
|
|
378
394
|
* Collects an accessoire of every cell it starts in, including the accessoires of the accessoire itself
|
|
379
395
|
* (eg the drawers of an EINBAU), because those get deleted with their parent as well.
|
|
396
|
+
* @param parentInheritedValues values the parents of the article pass on to the accessoires, per basketId
|
|
380
397
|
*/
|
|
381
398
|
}, {
|
|
382
399
|
key: "collectAccessoiresToStash",
|
|
383
|
-
value: function collectAccessoiresToStash(grid) {
|
|
400
|
+
value: function collectAccessoiresToStash(grid, parentInheritedValues) {
|
|
384
401
|
var stashedAccessoires = [];
|
|
402
|
+
var inheritedValues = ShelfPlanner.addValuesPassedOnBy(this.article, parentInheritedValues);
|
|
385
403
|
for (var i = 0; i < grid.Cells.length; i++) {
|
|
404
|
+
var _inheritedValues$acce;
|
|
386
405
|
var cell = grid.Cells[i];
|
|
387
406
|
var accessoire = cell.Article;
|
|
388
407
|
if (cell.InUse !== i || !accessoire) continue;
|
|
@@ -393,7 +412,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
393
412
|
for (var j = 0; j < ((_accessoireShelfPlann = accessoireShelfPlanner === null || accessoireShelfPlanner === void 0 ? void 0 : accessoireShelfPlanner.grids.length) !== null && _accessoireShelfPlann !== void 0 ? _accessoireShelfPlann : 0); j++) {
|
|
394
413
|
var _accessoireShelfPlann;
|
|
395
414
|
var accessoireGrid = accessoireShelfPlanner.grids[j];
|
|
396
|
-
var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid);
|
|
415
|
+
var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid, inheritedValues);
|
|
397
416
|
if (accessoiresOfGrid.length) {
|
|
398
417
|
accessoires[accessoireGrid.ShelfIndex] = {
|
|
399
418
|
ruleIndex: accessoireGrid.CurrentLoadedRuleIndex,
|
|
@@ -401,27 +420,59 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
401
420
|
};
|
|
402
421
|
}
|
|
403
422
|
}
|
|
423
|
+
|
|
424
|
+
//a value the accessoire only took over from the parent is not remembered: placed again, the accessoire takes over the
|
|
425
|
+
//parent's value of that time, the parent may have changed it in between
|
|
426
|
+
var variantValues = accessoire.VariantValues;
|
|
427
|
+
var inherited = (_inheritedValues$acce = inheritedValues[accessoire.basketId]) !== null && _inheritedValues$acce !== void 0 ? _inheritedValues$acce : {};
|
|
428
|
+
for (var _i5 = 0, _Object$keys = Object.keys(inherited); _i5 < _Object$keys.length; _i5++) {
|
|
429
|
+
var codex = _Object$keys[_i5];
|
|
430
|
+
if (variantValues[codex] === inherited[codex]) delete variantValues[codex];
|
|
431
|
+
}
|
|
404
432
|
stashedAccessoires.push({
|
|
405
433
|
articleCodex: accessoire.articleCodex,
|
|
406
434
|
cellIndex: i,
|
|
407
435
|
noMove: cell.NoMove,
|
|
408
436
|
noDelete: cell.NoDelete,
|
|
409
437
|
quantity: accessoire.quantity,
|
|
410
|
-
variantValues:
|
|
438
|
+
variantValues: variantValues,
|
|
439
|
+
inheritedValues: inherited,
|
|
411
440
|
accessoires: accessoires
|
|
412
441
|
});
|
|
413
442
|
}
|
|
414
443
|
return stashedAccessoires;
|
|
415
444
|
}
|
|
416
445
|
|
|
446
|
+
/**
|
|
447
|
+
* The values the parents of the article pass on to their accessoires right now, per basketId. A stash can start at an
|
|
448
|
+
* accessoire that is a shelf itself (eg an EINBAU whose own grid gets rebuilt), its accessoires inherit the values of
|
|
449
|
+
* all its parents as well (eg the cabinet colour).
|
|
450
|
+
*/
|
|
451
|
+
}, {
|
|
452
|
+
key: "valuesPassedOnByParents",
|
|
453
|
+
value: function valuesPassedOnByParents() {
|
|
454
|
+
var parents = [];
|
|
455
|
+
for (var parent = this.article.accessoireParentArticle; parent; parent = parent.accessoireParentArticle) parents.unshift(parent);
|
|
456
|
+
return parents.reduce(function (inheritedValues, parent) {
|
|
457
|
+
return ShelfPlanner.addValuesPassedOnBy(parent, inheritedValues);
|
|
458
|
+
}, {});
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Adds the values the article passes on to its accessoires with its global options right now (eg the gardenhouse colour of
|
|
463
|
+
* the door) on top of the ones its parents pass on (eg the cabinet colour of the drawers in an EINBAU).
|
|
464
|
+
* @param parentInheritedValues values the parents of the article pass on, per basketId
|
|
465
|
+
* @returns the values passed on per basketId, a new object
|
|
466
|
+
*/
|
|
467
|
+
}, {
|
|
468
|
+
key: "placeStashedAccessoiresOfGrid",
|
|
469
|
+
value: (
|
|
417
470
|
/**
|
|
418
471
|
* Places the accessoires remembered for the rule entry the grid runs now back into their cells.
|
|
419
472
|
* @param gridIndex grid that became active again
|
|
420
473
|
* @returns how many accessoires were placed - 0 means the grid is still empty and needs its initAcc
|
|
421
474
|
*/
|
|
422
|
-
|
|
423
|
-
key: "placeStashedAccessoiresOfGrid",
|
|
424
|
-
value: (function () {
|
|
475
|
+
function () {
|
|
425
476
|
var _placeStashedAccessoiresOfGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(gridIndex) {
|
|
426
477
|
var stashKey, stashedAccessoires;
|
|
427
478
|
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
|
|
@@ -509,7 +560,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
509
560
|
key: "placeStashedAccessoiresInGrid",
|
|
510
561
|
value: (function () {
|
|
511
562
|
var _placeStashedAccessoiresInGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(gridIndex, stashedAccessoires) {
|
|
512
|
-
var placedAccessoires, grid, i, stashed, result, fitResult, accessoire;
|
|
563
|
+
var placedAccessoires, grid, i, stashed, result, fitResult, accessoire, variantValues;
|
|
513
564
|
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
|
|
514
565
|
while (1) switch (_context5.prev = _context5.next) {
|
|
515
566
|
case 0:
|
|
@@ -524,7 +575,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
524
575
|
i = 0;
|
|
525
576
|
case 5:
|
|
526
577
|
if (!(i < stashedAccessoires.length)) {
|
|
527
|
-
_context5.next =
|
|
578
|
+
_context5.next = 29;
|
|
528
579
|
break;
|
|
529
580
|
}
|
|
530
581
|
stashed = stashedAccessoires[i];
|
|
@@ -555,30 +606,31 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
555
606
|
parentBasketId: this.article.basketId
|
|
556
607
|
}
|
|
557
608
|
}));
|
|
558
|
-
return _context5.abrupt("continue",
|
|
609
|
+
return _context5.abrupt("continue", 26);
|
|
559
610
|
case 17:
|
|
560
611
|
accessoire.quantity = stashed.quantity;
|
|
561
612
|
placedAccessoires++;
|
|
562
|
-
|
|
563
|
-
|
|
613
|
+
variantValues = this.valuesToPlaceAgain(stashed, accessoire);
|
|
614
|
+
if (!Object.keys(variantValues).length) {
|
|
615
|
+
_context5.next = 23;
|
|
564
616
|
break;
|
|
565
617
|
}
|
|
566
|
-
_context5.next =
|
|
567
|
-
return index.articleHandlerInstance.updateCfgValues(accessoire,
|
|
568
|
-
case
|
|
618
|
+
_context5.next = 23;
|
|
619
|
+
return index.articleHandlerInstance.updateCfgValues(accessoire, variantValues, {});
|
|
620
|
+
case 23:
|
|
569
621
|
if (!accessoire.shelfPlanner) {
|
|
570
|
-
_context5.next =
|
|
622
|
+
_context5.next = 26;
|
|
571
623
|
break;
|
|
572
624
|
}
|
|
573
|
-
_context5.next =
|
|
625
|
+
_context5.next = 26;
|
|
574
626
|
return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires);
|
|
575
|
-
case
|
|
627
|
+
case 26:
|
|
576
628
|
i++;
|
|
577
629
|
_context5.next = 5;
|
|
578
630
|
break;
|
|
579
|
-
case 28:
|
|
580
|
-
return _context5.abrupt("return", placedAccessoires);
|
|
581
631
|
case 29:
|
|
632
|
+
return _context5.abrupt("return", placedAccessoires);
|
|
633
|
+
case 30:
|
|
582
634
|
case "end":
|
|
583
635
|
return _context5.stop();
|
|
584
636
|
}
|
|
@@ -589,11 +641,42 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
589
641
|
}
|
|
590
642
|
return placeStashedAccessoiresInGrid;
|
|
591
643
|
}()
|
|
644
|
+
/**
|
|
645
|
+
* The remembered values of a stashed accessoire to set on the accessoire that was placed for it. A value of its own (eg an
|
|
646
|
+
* anthracite door) does not come back when the parent passes on another value than at stash time (eg the gardenhouse turned
|
|
647
|
+
* dark grey): an accessoire that stays in place takes over the parent's new value as well (updateAccessoriesFromGlobalOption).
|
|
648
|
+
* @param accessoire the accessoire placed for the stashed one, the values the parents pass on to it now are looked up by its basketId
|
|
649
|
+
*/
|
|
650
|
+
)
|
|
651
|
+
}, {
|
|
652
|
+
key: "valuesToPlaceAgain",
|
|
653
|
+
value: function valuesToPlaceAgain(stashed, accessoire) {
|
|
654
|
+
var _ShelfPlanner$addValu;
|
|
655
|
+
var variantValues = _objectSpread({}, stashed.variantValues);
|
|
656
|
+
var ownInheritableCodices = Object.keys(stashed.inheritedValues).filter(function (codex) {
|
|
657
|
+
return codex in variantValues;
|
|
658
|
+
});
|
|
659
|
+
if (!ownInheritableCodices.length) return variantValues;
|
|
660
|
+
var inheritedNow = (_ShelfPlanner$addValu = ShelfPlanner.addValuesPassedOnBy(this.article, this.valuesPassedOnByParents())[accessoire.basketId]) !== null && _ShelfPlanner$addValu !== void 0 ? _ShelfPlanner$addValu : {};
|
|
661
|
+
var _iterator = _createForOfIteratorHelper(ownInheritableCodices),
|
|
662
|
+
_step;
|
|
663
|
+
try {
|
|
664
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
665
|
+
var codex = _step.value;
|
|
666
|
+
if (inheritedNow[codex] !== undefined && inheritedNow[codex] !== stashed.inheritedValues[codex]) delete variantValues[codex];
|
|
667
|
+
}
|
|
668
|
+
} catch (err) {
|
|
669
|
+
_iterator.e(err);
|
|
670
|
+
} finally {
|
|
671
|
+
_iterator.f();
|
|
672
|
+
}
|
|
673
|
+
return variantValues;
|
|
674
|
+
}
|
|
675
|
+
|
|
592
676
|
/**
|
|
593
677
|
* runs through the InitAccArr and initialized all the accessoires eg: Kleiderstange gets placed
|
|
594
678
|
* if the replaceFromParent == true it removed the same article from the parent shelfplanner if one is found eg: Kleiderstange gets removed from schrank when the T-Sück gets initialized
|
|
595
679
|
*/
|
|
596
|
-
)
|
|
597
680
|
}, {
|
|
598
681
|
key: "initAccList",
|
|
599
682
|
value: (function () {
|
|
@@ -723,7 +806,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
723
806
|
key: "triggerVisibility",
|
|
724
807
|
value: function () {
|
|
725
808
|
var _triggerVisibility = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(gridGroup) {
|
|
726
|
-
var toCleanOptions, toUpdateOptions, i, grid,
|
|
809
|
+
var toCleanOptions, toUpdateOptions, i, grid, _i6, option, visitOptionState;
|
|
727
810
|
return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
|
|
728
811
|
while (1) switch (_context7.prev = _context7.next) {
|
|
729
812
|
case 0:
|
|
@@ -759,13 +842,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
759
842
|
_context7.next = 3;
|
|
760
843
|
break;
|
|
761
844
|
case 13:
|
|
762
|
-
|
|
845
|
+
_i6 = 0;
|
|
763
846
|
case 14:
|
|
764
|
-
if (!(
|
|
847
|
+
if (!(_i6 < [].concat(toUpdateOptions, toCleanOptions).length)) {
|
|
765
848
|
_context7.next = 23;
|
|
766
849
|
break;
|
|
767
850
|
}
|
|
768
|
-
option = [].concat(toUpdateOptions, toCleanOptions)[
|
|
851
|
+
option = [].concat(toUpdateOptions, toCleanOptions)[_i6];
|
|
769
852
|
visitOptionState = this.article.getArticleOptionState((!this.article.CatalogData.isIDMFormat ? 'OPT' : '') + option);
|
|
770
853
|
if (!visitOptionState) {
|
|
771
854
|
_context7.next = 20;
|
|
@@ -774,7 +857,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
774
857
|
_context7.next = 20;
|
|
775
858
|
return index.articleHandlerInstance.updateOption(this.article, visitOptionState.optionCodex, toUpdateOptions.includes(option) ? 'OPVMIT' : 'OPVOHNE');
|
|
776
859
|
case 20:
|
|
777
|
-
|
|
860
|
+
_i6++;
|
|
778
861
|
_context7.next = 14;
|
|
779
862
|
break;
|
|
780
863
|
case 23:
|
|
@@ -998,7 +1081,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
998
1081
|
key: "handleDeleteTakePlaceOnOtherGrids",
|
|
999
1082
|
value: (function () {
|
|
1000
1083
|
var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(gridIndex, cellIndex, accessoire) {
|
|
1001
|
-
var i, _cell$Article, cell,
|
|
1084
|
+
var i, _cell$Article, cell, _i7, _cell$Article2, _cell, _i8;
|
|
1002
1085
|
return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
|
|
1003
1086
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1004
1087
|
case 0:
|
|
@@ -1017,8 +1100,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1017
1100
|
}
|
|
1018
1101
|
}
|
|
1019
1102
|
if (accessoire.shelfHeightBelow) {
|
|
1020
|
-
for (
|
|
1021
|
-
_cell = this.grids[gridIndex].Cells[cellIndex - (
|
|
1103
|
+
for (_i7 = 0; _i7 < accessoire.shelfHeightBelow; _i7++) {
|
|
1104
|
+
_cell = this.grids[gridIndex].Cells[cellIndex - (_i7 + 1)];
|
|
1022
1105
|
if ((_cell === null || _cell === void 0 || (_cell$Article2 = _cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
|
|
1023
1106
|
_cell.ClearInUse();
|
|
1024
1107
|
}
|
|
@@ -1028,22 +1111,22 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1028
1111
|
_context10.next = 14;
|
|
1029
1112
|
break;
|
|
1030
1113
|
}
|
|
1031
|
-
|
|
1114
|
+
_i8 = 0;
|
|
1032
1115
|
case 6:
|
|
1033
|
-
if (!(
|
|
1116
|
+
if (!(_i8 < this.grids.length)) {
|
|
1034
1117
|
_context10.next = 14;
|
|
1035
1118
|
break;
|
|
1036
1119
|
}
|
|
1037
|
-
if (!(
|
|
1120
|
+
if (!(_i8 === gridIndex)) {
|
|
1038
1121
|
_context10.next = 9;
|
|
1039
1122
|
break;
|
|
1040
1123
|
}
|
|
1041
1124
|
return _context10.abrupt("continue", 11);
|
|
1042
1125
|
case 9:
|
|
1043
1126
|
_context10.next = 11;
|
|
1044
|
-
return this.grids[
|
|
1127
|
+
return this.grids[_i8].deleteAccessoireInCells(cellIndex);
|
|
1045
1128
|
case 11:
|
|
1046
|
-
|
|
1129
|
+
_i8++;
|
|
1047
1130
|
_context10.next = 6;
|
|
1048
1131
|
break;
|
|
1049
1132
|
case 14:
|
|
@@ -1588,6 +1671,24 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1588
1671
|
}
|
|
1589
1672
|
return undefined;
|
|
1590
1673
|
}
|
|
1674
|
+
}], [{
|
|
1675
|
+
key: "addValuesPassedOnBy",
|
|
1676
|
+
value: function addValuesPassedOnBy(article, parentInheritedValues) {
|
|
1677
|
+
var globalValues = {};
|
|
1678
|
+
for (var _i9 = 0, _Object$keys2 = Object.keys(article.getGlobalOptions()); _i9 < _Object$keys2.length; _i9++) {
|
|
1679
|
+
var _article$getArticleOp;
|
|
1680
|
+
var opt = _Object$keys2[_i9];
|
|
1681
|
+
var valCodex = (_article$getArticleOp = article.getArticleOptionState(opt)) === null || _article$getArticleOp === void 0 ? void 0 : _article$getArticleOp.valCodex;
|
|
1682
|
+
if (valCodex) globalValues[opt] = valCodex;
|
|
1683
|
+
}
|
|
1684
|
+
var inheritedValues = _objectSpread({}, parentInheritedValues);
|
|
1685
|
+
var ownInheritedValues = article.getAccessoriesToChangeFromGlobalOption(globalValues);
|
|
1686
|
+
for (var _i10 = 0, _Object$keys3 = Object.keys(ownInheritedValues); _i10 < _Object$keys3.length; _i10++) {
|
|
1687
|
+
var _basketId = _Object$keys3[_i10];
|
|
1688
|
+
inheritedValues[_basketId] = _objectSpread(_objectSpread({}, inheritedValues[_basketId]), ownInheritedValues[_basketId].variantValues);
|
|
1689
|
+
}
|
|
1690
|
+
return inheritedValues;
|
|
1691
|
+
}
|
|
1591
1692
|
}]);
|
|
1592
1693
|
}();
|
|
1593
1694
|
|
|
@@ -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-
|
|
5
|
+
require('./index-76d3a1ec.js');
|
|
6
6
|
require('@babel/runtime/helpers/slicedToArray');
|
|
7
7
|
require('@babel/runtime/helpers/asyncToGenerator');
|
|
8
8
|
require('@babel/runtime/helpers/defineProperty');
|
|
@@ -11,9 +11,10 @@ require('@babel/runtime/helpers/objectWithoutProperties');
|
|
|
11
11
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
12
12
|
require('axios');
|
|
13
13
|
require('@crystaldesign/diva-utils');
|
|
14
|
+
require('@babel/runtime/helpers/typeof');
|
|
15
|
+
require('@babel/runtime/helpers/toArray');
|
|
14
16
|
require('@crystaldesign/planner-2d-core');
|
|
15
17
|
require('@crystaldesign/basket-model');
|
|
16
|
-
require('@babel/runtime/helpers/typeof');
|
|
17
18
|
require('fast-xml-parser');
|
|
18
19
|
require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
19
20
|
require('@babel/runtime/helpers/getPrototypeOf');
|