@crystaldesign/web-planner-logic 26.13.0-beta.3 → 26.13.0-beta.31
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
|
@@ -4,14 +4,15 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
4
4
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
5
5
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
6
6
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
7
|
-
import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-
|
|
7
|
+
import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-8d311c4b.js';
|
|
8
8
|
import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
|
|
9
9
|
import '@babel/runtime/helpers/slicedToArray';
|
|
10
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
11
|
import 'axios';
|
|
12
|
+
import '@babel/runtime/helpers/typeof';
|
|
13
|
+
import '@babel/runtime/helpers/toArray';
|
|
12
14
|
import '@crystaldesign/planner-2d-core';
|
|
13
15
|
import '@crystaldesign/basket-model';
|
|
14
|
-
import '@babel/runtime/helpers/typeof';
|
|
15
16
|
import 'fast-xml-parser';
|
|
16
17
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
17
18
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
@@ -20,9 +21,14 @@ import '@babel/runtime/helpers/wrapNativeSuper';
|
|
|
20
21
|
import '@crystaldesign/basket-handler';
|
|
21
22
|
import 'socket.io-client';
|
|
22
23
|
|
|
24
|
+
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; } } }; }
|
|
25
|
+
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; } }
|
|
26
|
+
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; }
|
|
23
27
|
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; }
|
|
24
28
|
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(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; }
|
|
25
29
|
var LOG = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
|
|
30
|
+
|
|
31
|
+
/** Values the parents pass on to their accessoires with their global options, per basketId of the accessoire. */
|
|
26
32
|
var ShelfPlanner = /*#__PURE__*/function () {
|
|
27
33
|
function ShelfPlanner(data, article) {
|
|
28
34
|
_classCallCheck(this, ShelfPlanner);
|
|
@@ -115,6 +121,16 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* True when an accessoire with this codex can be planned for free on this shelf (an initAcc with noPrice, eg the first
|
|
127
|
+
* Kleiderstange of a Jutzler element).
|
|
128
|
+
*/
|
|
129
|
+
}, {
|
|
130
|
+
key: "canBeFree",
|
|
131
|
+
value: function canBeFree(articleCodex) {
|
|
132
|
+
return this.freeArticlesPossible[articleCodex] !== undefined;
|
|
133
|
+
}
|
|
118
134
|
}, {
|
|
119
135
|
key: "IsVisible",
|
|
120
136
|
get: function get() {
|
|
@@ -350,7 +366,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
350
366
|
}, {
|
|
351
367
|
key: "stashAccessoiresOfGrid",
|
|
352
368
|
value: function stashAccessoiresOfGrid(gridIndex, ruleIndex) {
|
|
353
|
-
var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex]);
|
|
369
|
+
var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex], this.valuesPassedOnByParents());
|
|
354
370
|
if (!stashedAccessoires.length) return;
|
|
355
371
|
this.stashedAccessoires[this.stashKey(gridIndex, ruleIndex)] = stashedAccessoires;
|
|
356
372
|
}
|
|
@@ -365,12 +381,15 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
365
381
|
/**
|
|
366
382
|
* Collects an accessoire of every cell it starts in, including the accessoires of the accessoire itself
|
|
367
383
|
* (eg the drawers of an EINBAU), because those get deleted with their parent as well.
|
|
384
|
+
* @param parentInheritedValues values the parents of the article pass on to the accessoires, per basketId
|
|
368
385
|
*/
|
|
369
386
|
}, {
|
|
370
387
|
key: "collectAccessoiresToStash",
|
|
371
|
-
value: function collectAccessoiresToStash(grid) {
|
|
388
|
+
value: function collectAccessoiresToStash(grid, parentInheritedValues) {
|
|
372
389
|
var stashedAccessoires = [];
|
|
390
|
+
var inheritedValues = ShelfPlanner.addValuesPassedOnBy(this.article, parentInheritedValues);
|
|
373
391
|
for (var i = 0; i < grid.Cells.length; i++) {
|
|
392
|
+
var _inheritedValues$acce;
|
|
374
393
|
var cell = grid.Cells[i];
|
|
375
394
|
var accessoire = cell.Article;
|
|
376
395
|
if (cell.InUse !== i || !accessoire) continue;
|
|
@@ -381,7 +400,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
381
400
|
for (var j = 0; j < ((_accessoireShelfPlann = accessoireShelfPlanner === null || accessoireShelfPlanner === void 0 ? void 0 : accessoireShelfPlanner.grids.length) !== null && _accessoireShelfPlann !== void 0 ? _accessoireShelfPlann : 0); j++) {
|
|
382
401
|
var _accessoireShelfPlann;
|
|
383
402
|
var accessoireGrid = accessoireShelfPlanner.grids[j];
|
|
384
|
-
var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid);
|
|
403
|
+
var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid, inheritedValues);
|
|
385
404
|
if (accessoiresOfGrid.length) {
|
|
386
405
|
accessoires[accessoireGrid.ShelfIndex] = {
|
|
387
406
|
ruleIndex: accessoireGrid.CurrentLoadedRuleIndex,
|
|
@@ -389,27 +408,59 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
389
408
|
};
|
|
390
409
|
}
|
|
391
410
|
}
|
|
411
|
+
|
|
412
|
+
//a value the accessoire only took over from the parent is not remembered: placed again, the accessoire takes over the
|
|
413
|
+
//parent's value of that time, the parent may have changed it in between
|
|
414
|
+
var variantValues = accessoire.VariantValues;
|
|
415
|
+
var inherited = (_inheritedValues$acce = inheritedValues[accessoire.basketId]) !== null && _inheritedValues$acce !== void 0 ? _inheritedValues$acce : {};
|
|
416
|
+
for (var _i5 = 0, _Object$keys = Object.keys(inherited); _i5 < _Object$keys.length; _i5++) {
|
|
417
|
+
var codex = _Object$keys[_i5];
|
|
418
|
+
if (variantValues[codex] === inherited[codex]) delete variantValues[codex];
|
|
419
|
+
}
|
|
392
420
|
stashedAccessoires.push({
|
|
393
421
|
articleCodex: accessoire.articleCodex,
|
|
394
422
|
cellIndex: i,
|
|
395
423
|
noMove: cell.NoMove,
|
|
396
424
|
noDelete: cell.NoDelete,
|
|
397
425
|
quantity: accessoire.quantity,
|
|
398
|
-
variantValues:
|
|
426
|
+
variantValues: variantValues,
|
|
427
|
+
inheritedValues: inherited,
|
|
399
428
|
accessoires: accessoires
|
|
400
429
|
});
|
|
401
430
|
}
|
|
402
431
|
return stashedAccessoires;
|
|
403
432
|
}
|
|
404
433
|
|
|
434
|
+
/**
|
|
435
|
+
* The values the parents of the article pass on to their accessoires right now, per basketId. A stash can start at an
|
|
436
|
+
* accessoire that is a shelf itself (eg an EINBAU whose own grid gets rebuilt), its accessoires inherit the values of
|
|
437
|
+
* all its parents as well (eg the cabinet colour).
|
|
438
|
+
*/
|
|
439
|
+
}, {
|
|
440
|
+
key: "valuesPassedOnByParents",
|
|
441
|
+
value: function valuesPassedOnByParents() {
|
|
442
|
+
var parents = [];
|
|
443
|
+
for (var parent = this.article.accessoireParentArticle; parent; parent = parent.accessoireParentArticle) parents.unshift(parent);
|
|
444
|
+
return parents.reduce(function (inheritedValues, parent) {
|
|
445
|
+
return ShelfPlanner.addValuesPassedOnBy(parent, inheritedValues);
|
|
446
|
+
}, {});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Adds the values the article passes on to its accessoires with its global options right now (eg the gardenhouse colour of
|
|
451
|
+
* the door) on top of the ones its parents pass on (eg the cabinet colour of the drawers in an EINBAU).
|
|
452
|
+
* @param parentInheritedValues values the parents of the article pass on, per basketId
|
|
453
|
+
* @returns the values passed on per basketId, a new object
|
|
454
|
+
*/
|
|
455
|
+
}, {
|
|
456
|
+
key: "placeStashedAccessoiresOfGrid",
|
|
457
|
+
value: (
|
|
405
458
|
/**
|
|
406
459
|
* Places the accessoires remembered for the rule entry the grid runs now back into their cells.
|
|
407
460
|
* @param gridIndex grid that became active again
|
|
408
461
|
* @returns how many accessoires were placed - 0 means the grid is still empty and needs its initAcc
|
|
409
462
|
*/
|
|
410
|
-
|
|
411
|
-
key: "placeStashedAccessoiresOfGrid",
|
|
412
|
-
value: (function () {
|
|
463
|
+
function () {
|
|
413
464
|
var _placeStashedAccessoiresOfGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(gridIndex) {
|
|
414
465
|
var stashKey, stashedAccessoires;
|
|
415
466
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -497,7 +548,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
497
548
|
key: "placeStashedAccessoiresInGrid",
|
|
498
549
|
value: (function () {
|
|
499
550
|
var _placeStashedAccessoiresInGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(gridIndex, stashedAccessoires) {
|
|
500
|
-
var placedAccessoires, grid, i, stashed, result, fitResult, accessoire;
|
|
551
|
+
var placedAccessoires, grid, i, stashed, result, fitResult, accessoire, variantValues;
|
|
501
552
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
502
553
|
while (1) switch (_context5.prev = _context5.next) {
|
|
503
554
|
case 0:
|
|
@@ -512,7 +563,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
512
563
|
i = 0;
|
|
513
564
|
case 5:
|
|
514
565
|
if (!(i < stashedAccessoires.length)) {
|
|
515
|
-
_context5.next =
|
|
566
|
+
_context5.next = 29;
|
|
516
567
|
break;
|
|
517
568
|
}
|
|
518
569
|
stashed = stashedAccessoires[i];
|
|
@@ -543,30 +594,31 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
543
594
|
parentBasketId: this.article.basketId
|
|
544
595
|
}
|
|
545
596
|
}));
|
|
546
|
-
return _context5.abrupt("continue",
|
|
597
|
+
return _context5.abrupt("continue", 26);
|
|
547
598
|
case 17:
|
|
548
599
|
accessoire.quantity = stashed.quantity;
|
|
549
600
|
placedAccessoires++;
|
|
550
|
-
|
|
551
|
-
|
|
601
|
+
variantValues = this.valuesToPlaceAgain(stashed, accessoire);
|
|
602
|
+
if (!Object.keys(variantValues).length) {
|
|
603
|
+
_context5.next = 23;
|
|
552
604
|
break;
|
|
553
605
|
}
|
|
554
|
-
_context5.next =
|
|
555
|
-
return articleHandlerInstance.updateCfgValues(accessoire,
|
|
556
|
-
case
|
|
606
|
+
_context5.next = 23;
|
|
607
|
+
return articleHandlerInstance.updateCfgValues(accessoire, variantValues, {});
|
|
608
|
+
case 23:
|
|
557
609
|
if (!accessoire.shelfPlanner) {
|
|
558
|
-
_context5.next =
|
|
610
|
+
_context5.next = 26;
|
|
559
611
|
break;
|
|
560
612
|
}
|
|
561
|
-
_context5.next =
|
|
613
|
+
_context5.next = 26;
|
|
562
614
|
return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires);
|
|
563
|
-
case
|
|
615
|
+
case 26:
|
|
564
616
|
i++;
|
|
565
617
|
_context5.next = 5;
|
|
566
618
|
break;
|
|
567
|
-
case 28:
|
|
568
|
-
return _context5.abrupt("return", placedAccessoires);
|
|
569
619
|
case 29:
|
|
620
|
+
return _context5.abrupt("return", placedAccessoires);
|
|
621
|
+
case 30:
|
|
570
622
|
case "end":
|
|
571
623
|
return _context5.stop();
|
|
572
624
|
}
|
|
@@ -577,11 +629,42 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
577
629
|
}
|
|
578
630
|
return placeStashedAccessoiresInGrid;
|
|
579
631
|
}()
|
|
632
|
+
/**
|
|
633
|
+
* The remembered values of a stashed accessoire to set on the accessoire that was placed for it. A value of its own (eg an
|
|
634
|
+
* anthracite door) does not come back when the parent passes on another value than at stash time (eg the gardenhouse turned
|
|
635
|
+
* dark grey): an accessoire that stays in place takes over the parent's new value as well (updateAccessoriesFromGlobalOption).
|
|
636
|
+
* @param accessoire the accessoire placed for the stashed one, the values the parents pass on to it now are looked up by its basketId
|
|
637
|
+
*/
|
|
638
|
+
)
|
|
639
|
+
}, {
|
|
640
|
+
key: "valuesToPlaceAgain",
|
|
641
|
+
value: function valuesToPlaceAgain(stashed, accessoire) {
|
|
642
|
+
var _ShelfPlanner$addValu;
|
|
643
|
+
var variantValues = _objectSpread({}, stashed.variantValues);
|
|
644
|
+
var ownInheritableCodices = Object.keys(stashed.inheritedValues).filter(function (codex) {
|
|
645
|
+
return codex in variantValues;
|
|
646
|
+
});
|
|
647
|
+
if (!ownInheritableCodices.length) return variantValues;
|
|
648
|
+
var inheritedNow = (_ShelfPlanner$addValu = ShelfPlanner.addValuesPassedOnBy(this.article, this.valuesPassedOnByParents())[accessoire.basketId]) !== null && _ShelfPlanner$addValu !== void 0 ? _ShelfPlanner$addValu : {};
|
|
649
|
+
var _iterator = _createForOfIteratorHelper(ownInheritableCodices),
|
|
650
|
+
_step;
|
|
651
|
+
try {
|
|
652
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
653
|
+
var codex = _step.value;
|
|
654
|
+
if (inheritedNow[codex] !== undefined && inheritedNow[codex] !== stashed.inheritedValues[codex]) delete variantValues[codex];
|
|
655
|
+
}
|
|
656
|
+
} catch (err) {
|
|
657
|
+
_iterator.e(err);
|
|
658
|
+
} finally {
|
|
659
|
+
_iterator.f();
|
|
660
|
+
}
|
|
661
|
+
return variantValues;
|
|
662
|
+
}
|
|
663
|
+
|
|
580
664
|
/**
|
|
581
665
|
* runs through the InitAccArr and initialized all the accessoires eg: Kleiderstange gets placed
|
|
582
666
|
* 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
|
|
583
667
|
*/
|
|
584
|
-
)
|
|
585
668
|
}, {
|
|
586
669
|
key: "initAccList",
|
|
587
670
|
value: (function () {
|
|
@@ -711,7 +794,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
711
794
|
key: "triggerVisibility",
|
|
712
795
|
value: function () {
|
|
713
796
|
var _triggerVisibility = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(gridGroup) {
|
|
714
|
-
var toCleanOptions, toUpdateOptions, i, grid,
|
|
797
|
+
var toCleanOptions, toUpdateOptions, i, grid, _i6, option, visitOptionState;
|
|
715
798
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
716
799
|
while (1) switch (_context7.prev = _context7.next) {
|
|
717
800
|
case 0:
|
|
@@ -747,13 +830,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
747
830
|
_context7.next = 3;
|
|
748
831
|
break;
|
|
749
832
|
case 13:
|
|
750
|
-
|
|
833
|
+
_i6 = 0;
|
|
751
834
|
case 14:
|
|
752
|
-
if (!(
|
|
835
|
+
if (!(_i6 < [].concat(toUpdateOptions, toCleanOptions).length)) {
|
|
753
836
|
_context7.next = 23;
|
|
754
837
|
break;
|
|
755
838
|
}
|
|
756
|
-
option = [].concat(toUpdateOptions, toCleanOptions)[
|
|
839
|
+
option = [].concat(toUpdateOptions, toCleanOptions)[_i6];
|
|
757
840
|
visitOptionState = this.article.getArticleOptionState((!this.article.CatalogData.isIDMFormat ? 'OPT' : '') + option);
|
|
758
841
|
if (!visitOptionState) {
|
|
759
842
|
_context7.next = 20;
|
|
@@ -762,7 +845,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
762
845
|
_context7.next = 20;
|
|
763
846
|
return articleHandlerInstance.updateOption(this.article, visitOptionState.optionCodex, toUpdateOptions.includes(option) ? 'OPVMIT' : 'OPVOHNE');
|
|
764
847
|
case 20:
|
|
765
|
-
|
|
848
|
+
_i6++;
|
|
766
849
|
_context7.next = 14;
|
|
767
850
|
break;
|
|
768
851
|
case 23:
|
|
@@ -986,7 +1069,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
986
1069
|
key: "handleDeleteTakePlaceOnOtherGrids",
|
|
987
1070
|
value: (function () {
|
|
988
1071
|
var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(gridIndex, cellIndex, accessoire) {
|
|
989
|
-
var i, _cell$Article, cell,
|
|
1072
|
+
var i, _cell$Article, cell, _i7, _cell$Article2, _cell, _i8;
|
|
990
1073
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
991
1074
|
while (1) switch (_context10.prev = _context10.next) {
|
|
992
1075
|
case 0:
|
|
@@ -1005,8 +1088,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1005
1088
|
}
|
|
1006
1089
|
}
|
|
1007
1090
|
if (accessoire.shelfHeightBelow) {
|
|
1008
|
-
for (
|
|
1009
|
-
_cell = this.grids[gridIndex].Cells[cellIndex - (
|
|
1091
|
+
for (_i7 = 0; _i7 < accessoire.shelfHeightBelow; _i7++) {
|
|
1092
|
+
_cell = this.grids[gridIndex].Cells[cellIndex - (_i7 + 1)];
|
|
1010
1093
|
if ((_cell === null || _cell === void 0 || (_cell$Article2 = _cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
|
|
1011
1094
|
_cell.ClearInUse();
|
|
1012
1095
|
}
|
|
@@ -1016,22 +1099,22 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1016
1099
|
_context10.next = 14;
|
|
1017
1100
|
break;
|
|
1018
1101
|
}
|
|
1019
|
-
|
|
1102
|
+
_i8 = 0;
|
|
1020
1103
|
case 6:
|
|
1021
|
-
if (!(
|
|
1104
|
+
if (!(_i8 < this.grids.length)) {
|
|
1022
1105
|
_context10.next = 14;
|
|
1023
1106
|
break;
|
|
1024
1107
|
}
|
|
1025
|
-
if (!(
|
|
1108
|
+
if (!(_i8 === gridIndex)) {
|
|
1026
1109
|
_context10.next = 9;
|
|
1027
1110
|
break;
|
|
1028
1111
|
}
|
|
1029
1112
|
return _context10.abrupt("continue", 11);
|
|
1030
1113
|
case 9:
|
|
1031
1114
|
_context10.next = 11;
|
|
1032
|
-
return this.grids[
|
|
1115
|
+
return this.grids[_i8].deleteAccessoireInCells(cellIndex);
|
|
1033
1116
|
case 11:
|
|
1034
|
-
|
|
1117
|
+
_i8++;
|
|
1035
1118
|
_context10.next = 6;
|
|
1036
1119
|
break;
|
|
1037
1120
|
case 14:
|
|
@@ -1576,6 +1659,24 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1576
1659
|
}
|
|
1577
1660
|
return undefined;
|
|
1578
1661
|
}
|
|
1662
|
+
}], [{
|
|
1663
|
+
key: "addValuesPassedOnBy",
|
|
1664
|
+
value: function addValuesPassedOnBy(article, parentInheritedValues) {
|
|
1665
|
+
var globalValues = {};
|
|
1666
|
+
for (var _i9 = 0, _Object$keys2 = Object.keys(article.getGlobalOptions()); _i9 < _Object$keys2.length; _i9++) {
|
|
1667
|
+
var _article$getArticleOp;
|
|
1668
|
+
var opt = _Object$keys2[_i9];
|
|
1669
|
+
var valCodex = (_article$getArticleOp = article.getArticleOptionState(opt)) === null || _article$getArticleOp === void 0 ? void 0 : _article$getArticleOp.valCodex;
|
|
1670
|
+
if (valCodex) globalValues[opt] = valCodex;
|
|
1671
|
+
}
|
|
1672
|
+
var inheritedValues = _objectSpread({}, parentInheritedValues);
|
|
1673
|
+
var ownInheritedValues = article.getAccessoriesToChangeFromGlobalOption(globalValues);
|
|
1674
|
+
for (var _i10 = 0, _Object$keys3 = Object.keys(ownInheritedValues); _i10 < _Object$keys3.length; _i10++) {
|
|
1675
|
+
var _basketId = _Object$keys3[_i10];
|
|
1676
|
+
inheritedValues[_basketId] = _objectSpread(_objectSpread({}, inheritedValues[_basketId]), ownInheritedValues[_basketId].variantValues);
|
|
1677
|
+
}
|
|
1678
|
+
return inheritedValues;
|
|
1679
|
+
}
|
|
1579
1680
|
}]);
|
|
1580
1681
|
}();
|
|
1581
1682
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
2
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
-
import './index-
|
|
3
|
+
import './index-8d311c4b.js';
|
|
4
4
|
import '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
6
6
|
import '@babel/runtime/helpers/defineProperty';
|
|
@@ -9,9 +9,10 @@ import '@babel/runtime/helpers/objectWithoutProperties';
|
|
|
9
9
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
10
10
|
import 'axios';
|
|
11
11
|
import '@crystaldesign/diva-utils';
|
|
12
|
+
import '@babel/runtime/helpers/typeof';
|
|
13
|
+
import '@babel/runtime/helpers/toArray';
|
|
12
14
|
import '@crystaldesign/planner-2d-core';
|
|
13
15
|
import '@crystaldesign/basket-model';
|
|
14
|
-
import '@babel/runtime/helpers/typeof';
|
|
15
16
|
import 'fast-xml-parser';
|
|
16
17
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
17
18
|
import '@babel/runtime/helpers/getPrototypeOf';
|