@crystaldesign/web-planner-logic 25.9.0-beta.9 → 25.9.0-rc.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.
- package/build/cjs/{DivaBoxPlanner-dc41f5c0.js → DivaBoxPlanner-1364c551.js} +289 -9
- package/build/cjs/{DivaStandardPlanner-d05e9154.js → DivaStandardPlanner-e6e39978.js} +12 -2
- package/build/cjs/{DoorPlanner-27136ffd.js → DoorPlanner-10e97f07.js} +1 -1
- package/build/cjs/{Host3DSignalR-cd790a0d.js → Host3DSignalR-eea7d1d4.js} +1 -1
- package/build/cjs/{LiviqueWWSHandler-8b1c0a07.js → LiviqueWWSHandler-17894cd1.js} +1 -1
- package/build/cjs/{PfisterWWSHandler-1847b578.js → PfisterWWSHandler-4058e465.js} +1 -1
- package/build/cjs/{PlannerHandler2D-97704bc7.js → PlannerHandler2D-41d9d0cf.js} +1 -1
- package/build/cjs/{SeriousBasketHandler-ead333a9.js → SeriousBasketHandler-c8e698e9.js} +1 -1
- package/build/cjs/{ShelfPlanner-00e95b92.js → ShelfPlanner-33014e25.js} +1 -1
- package/build/cjs/{StandardWWSHandler-4dce0fd6.js → StandardWWSHandler-faeb77e7.js} +1 -1
- package/build/cjs/{index-0ed3e63b.js → index-f1e5aa56.js} +265 -97
- package/build/cjs/index.js +1 -1
- package/build/esm/{DivaBoxPlanner-08ebde1b.js → DivaBoxPlanner-fcf19f4c.js} +289 -9
- package/build/esm/{DivaStandardPlanner-f922ae56.js → DivaStandardPlanner-5221526b.js} +12 -2
- package/build/esm/{DoorPlanner-89fc6a04.js → DoorPlanner-27fa5a55.js} +1 -1
- package/build/esm/{Host3DSignalR-3663de55.js → Host3DSignalR-e85d1c87.js} +1 -1
- package/build/esm/{LiviqueWWSHandler-1aa314d6.js → LiviqueWWSHandler-494ad9a9.js} +1 -1
- package/build/esm/{PfisterWWSHandler-d9700837.js → PfisterWWSHandler-39c3f3e2.js} +1 -1
- package/build/esm/{PlannerHandler2D-5744bdb6.js → PlannerHandler2D-1a23208c.js} +1 -1
- package/build/esm/{SeriousBasketHandler-9dcb8252.js → SeriousBasketHandler-51aa34db.js} +1 -1
- package/build/esm/{ShelfPlanner-e2b62508.js → ShelfPlanner-9f2c145d.js} +1 -1
- package/build/esm/{StandardWWSHandler-79914298.js → StandardWWSHandler-6d93ce48.js} +1 -1
- package/build/esm/{index-58c290c0.js → index-51b98cbc.js} +265 -97
- package/build/esm/index.js +1 -1
- package/build/types/web-planner-logic/src/index.d.ts +1 -0
- package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts +4 -0
- package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/CatalogPlannerArticleViewDataType.d.ts +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/CatalogPlannerArticleViewDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/PlannedArticleViewDataType.d.ts +24 -0
- package/build/types/web-planner-logic/src/interface/Articles/PlannedArticleViewDataType.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/interface/ConfiguratorStructureDataType.d.ts +1 -1
- package/build/types/web-planner-logic/src/interface/ConfiguratorStructureDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/OptionTypes/ArticleOptionValueView.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/OptionTypes/ArticleOptionValueView.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Planner/IDivaPlanner.d.ts +2 -1
- package/build/types/web-planner-logic/src/interface/Planner/IDivaPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts +1 -1
- package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +2 -1
- 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.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts +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/DivaConfigTreeHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +15 -5
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerGrid.d.ts +6 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerGrid.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts +2 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +2 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +2 -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/Rendering/PlannerHandler3D.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +5 -2
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.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.map +1 -1
- package/build/types/web-planner-logic/src/model/Planner/BoxPlannerData.d.ts +2 -2
- package/build/types/web-planner-logic/src/model/Planner/BoxPlannerData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Planner/PlannerInteractionData.d.ts +78 -0
- package/build/types/web-planner-logic/src/model/Planner/PlannerInteractionData.d.ts.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-f1e5aa56.js');
|
|
6
6
|
require('@babel/runtime/helpers/slicedToArray');
|
|
7
7
|
require('@babel/runtime/helpers/asyncToGenerator');
|
|
8
8
|
require('@babel/runtime/helpers/classCallCheck');
|
|
@@ -3,10 +3,10 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
3
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
-
import { c as Vector2, V as Vector3, B as BoundingBox } from './index-
|
|
6
|
+
import { c as Vector2, V as Vector3, B as BoundingBox } from './index-51b98cbc.js';
|
|
7
7
|
import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
9
|
-
import { d as dockingPointHandlerInst, P as PlannerElementData, h as handler2D } from './PlannerHandler2D-
|
|
9
|
+
import { d as dockingPointHandlerInst, P as PlannerElementData, h as handler2D } from './PlannerHandler2D-1a23208c.js';
|
|
10
10
|
import '@babel/runtime/helpers/slicedToArray';
|
|
11
11
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import 'axios';
|
|
@@ -1915,6 +1915,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1915
1915
|
//DivaUtils.LOG.log("Update Box Planner Logic. SetOptionDoShow: elementID: " + elementId + "; Option: " + option);
|
|
1916
1916
|
|
|
1917
1917
|
var curOptVisibilityInfo = this.constructionRules.optionsVisibilityInfo[option];
|
|
1918
|
+
if (!curOptVisibilityInfo) return;
|
|
1918
1919
|
//curArticle[option].val = curOptVisibilityInfo.doShow;
|
|
1919
1920
|
//curArticle[option].doShow = "1";
|
|
1920
1921
|
if (curOptVisibilityInfo.doShow != undefined) {
|
|
@@ -1947,8 +1948,9 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1947
1948
|
var _optionHandler$get3, _this$hideOptionsForC2;
|
|
1948
1949
|
// LOG.log("Update Box Planner Logic. SetOptionDoHide: elementId: " + elementId + "; Option: " + option);
|
|
1949
1950
|
var curOptVisibilityInfo = this.constructionRules.optionsVisibilityInfo[option];
|
|
1951
|
+
if (!curOptVisibilityInfo) return;
|
|
1950
1952
|
if (!optionHandler.has(elementId)) optionHandler.set(elementId, new Map());
|
|
1951
|
-
(_optionHandler$get3 = optionHandler.get(elementId)) === null || _optionHandler$get3 === void 0 || _optionHandler$get3.set(option, curOptVisibilityInfo.doHide);
|
|
1953
|
+
(_optionHandler$get3 = optionHandler.get(elementId)) === null || _optionHandler$get3 === void 0 || _optionHandler$get3.set(option, curOptVisibilityInfo === null || curOptVisibilityInfo === void 0 ? void 0 : curOptVisibilityInfo.doHide);
|
|
1952
1954
|
if (!this.hideOptionsForConstruction.has(elementId)) this.hideOptionsForConstruction.set(elementId, []);
|
|
1953
1955
|
(_this$hideOptionsForC2 = this.hideOptionsForConstruction.get(elementId)) === null || _this$hideOptionsForC2 === void 0 || _this$hideOptionsForC2.push(option);
|
|
1954
1956
|
}
|
|
@@ -2597,6 +2599,27 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2597
2599
|
}
|
|
2598
2600
|
return undefined;
|
|
2599
2601
|
}
|
|
2602
|
+
}, {
|
|
2603
|
+
key: "correctOptionsInfluencedByDimensions",
|
|
2604
|
+
value: function correctOptionsInfluencedByDimensions(boxPlannerGrid, optionHandler) {
|
|
2605
|
+
var _this2 = this;
|
|
2606
|
+
if (!this.constructionRules.optionsInfluencedByDimensions) return;
|
|
2607
|
+
var boxPlannerSize = boxPlannerGrid.getSizeOfWholeSet(false);
|
|
2608
|
+
var allElements = boxPlannerGrid.getAllElementsInFrontGrid();
|
|
2609
|
+
this.constructionRules.optionsInfluencedByDimensions.forEach(function (dimRule) {
|
|
2610
|
+
var isOver = false;
|
|
2611
|
+
if (dimRule.dimension.toLower() == 'height' && boxPlannerSize.y >= dimRule.dimensionLimit) isOver = true;
|
|
2612
|
+
if (dimRule.dimension.toLower() == 'width' && boxPlannerSize.x >= dimRule.dimensionLimit) isOver = true;
|
|
2613
|
+
if (dimRule.dimension.toLower() == 'depth' && boxPlannerSize.z >= dimRule.dimensionLimit) isOver = true;
|
|
2614
|
+
allElements.forEach(function (element) {
|
|
2615
|
+
if (isOver) {
|
|
2616
|
+
if (dimRule.higherLimit.toLower() == 'doshow') _this2.setOptionDoShow(element.ElementId, dimRule.option, optionHandler);else if (dimRule.higherLimit.toLower() == 'dohide') _this2.setOptionDoHide(element.ElementId, dimRule.option, optionHandler);
|
|
2617
|
+
} else {
|
|
2618
|
+
if (dimRule.lowerLimit.toLower() == 'doshow') _this2.setOptionDoShow(element.ElementId, dimRule.option, optionHandler);else if (dimRule.lowerLimit.toLower() == 'dohide') _this2.setOptionDoHide(element.ElementId, dimRule.option, optionHandler);
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2600
2623
|
}, {
|
|
2601
2624
|
key: "correctLadder",
|
|
2602
2625
|
value: function correctLadder(boxPlannerGrid, optionHandler) {
|
|
@@ -2654,6 +2677,26 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2654
2677
|
}
|
|
2655
2678
|
}
|
|
2656
2679
|
}
|
|
2680
|
+
}, {
|
|
2681
|
+
key: "correctCoverPlate",
|
|
2682
|
+
value: function correctCoverPlate(boxPlannerGrid, optionHandler) {
|
|
2683
|
+
var _this3 = this;
|
|
2684
|
+
if (!this.constructionRules.coverPlateRule) return;
|
|
2685
|
+
if (this.constructionRules.coverPlateRule.onHighestElementsOnly) return; // System4 not handled by this logic yet
|
|
2686
|
+
|
|
2687
|
+
var elementsPerSeries = boxPlannerGrid.getHighestElementsPerSeries();
|
|
2688
|
+
elementsPerSeries.forEach(function (serie) {
|
|
2689
|
+
var seriesWidth = 0;
|
|
2690
|
+
serie.forEach(function (element) {
|
|
2691
|
+
var _element$Width;
|
|
2692
|
+
return seriesWidth += (_element$Width = element.Width) !== null && _element$Width !== void 0 ? _element$Width : 0;
|
|
2693
|
+
});
|
|
2694
|
+
var opv = _this3.constructionRules.seriesWidthToPlateOpv.find(function (stp) {
|
|
2695
|
+
return stp.limit > seriesWidth;
|
|
2696
|
+
});
|
|
2697
|
+
_this3.setOptionValue(serie[0].ElementId, _this3.constructionRules.optABD, opv, optionHandler);
|
|
2698
|
+
});
|
|
2699
|
+
}
|
|
2657
2700
|
|
|
2658
2701
|
//Diese Funktion korrigiert alle Optionen, die auf einer Serie von Artikeln bestehen . Beispiel Abdeckplatte: Hier muss man alle horizontale zusammenhängende Elemente finden, die ganz oben sind.
|
|
2659
2702
|
//
|
|
@@ -3010,6 +3053,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
3010
3053
|
this.correctBottom(boxPlannerGrid, optionHandler, false);
|
|
3011
3054
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) this.correctBottom(boxPlannerGrid, optionHandler, true);
|
|
3012
3055
|
this.correctSeries(boxPlannerGrid, optionHandler);
|
|
3056
|
+
this.correctCoverPlate(boxPlannerGrid, optionHandler);
|
|
3013
3057
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
3014
3058
|
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
3015
3059
|
this.correctSimpleOpt(i, j, boxPlannerGrid, optionHandler, false);
|
|
@@ -3037,6 +3081,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
3037
3081
|
}
|
|
3038
3082
|
}
|
|
3039
3083
|
this.correctLadder(boxPlannerGrid, optionHandler);
|
|
3084
|
+
this.correctOptionsInfluencedByDimensions(boxPlannerGrid, optionHandler);
|
|
3040
3085
|
this.partlistHelper.calculateKnots(boxPlannerGrid, optionHandler);
|
|
3041
3086
|
this.partlistHelper.calculateRahmen(boxPlannerGrid, optionHandler);
|
|
3042
3087
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
@@ -3045,13 +3090,13 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
3045
3090
|
}
|
|
3046
3091
|
}
|
|
3047
3092
|
doChangeRetailArticleNumbers = this.doChangeRetailArticleNumbers(boxPlannerGrid, optionHandler);
|
|
3048
|
-
_context.next =
|
|
3093
|
+
_context.next = 27;
|
|
3049
3094
|
return this.updateCfgValuesByPlanner(optionHandler, undefined, this.constructionRules.partlistRules.bundleRules, doChangeRetailArticleNumbers);
|
|
3050
|
-
case
|
|
3095
|
+
case 27:
|
|
3051
3096
|
LOG$2.debug('BoxPlanner updateOptionLogic - Duration after setting Option Values of all Articles: ' + (new Date().getTime() - startTime));
|
|
3052
3097
|
LOG$2.debug('BoxPlanner updateOptionLogic - Duration after setting updating configurator: ' + (new Date().getTime() - startTime));
|
|
3053
3098
|
return _context.abrupt("return", resultMessage);
|
|
3054
|
-
case
|
|
3099
|
+
case 30:
|
|
3055
3100
|
case "end":
|
|
3056
3101
|
return _context.stop();
|
|
3057
3102
|
}
|
|
@@ -3964,6 +4009,27 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3964
4009
|
return new Vector3(width, height, depth);
|
|
3965
4010
|
}
|
|
3966
4011
|
|
|
4012
|
+
/*
|
|
4013
|
+
Returns an Array with all Highest Elements in which is an Array of the connected side Elements.
|
|
4014
|
+
Used for cover Plate Rule, to know on which elements
|
|
4015
|
+
*Only for frontgrid
|
|
4016
|
+
*/
|
|
4017
|
+
}, {
|
|
4018
|
+
key: "getHighestElementsPerSeries",
|
|
4019
|
+
value: function getHighestElementsPerSeries() {
|
|
4020
|
+
if (this.hasActiveBackside) throw new Error('this function is doesnt implement the backside logic (yet)');
|
|
4021
|
+
var result = [];
|
|
4022
|
+
var lastHeight = -1;
|
|
4023
|
+
for (var idx = 0; idx < this.getColumnCount(); idx++) {
|
|
4024
|
+
var height = this.getRowCount(idx, false);
|
|
4025
|
+
if (height == lastHeight) {
|
|
4026
|
+
result[result.length].push(this.getPlannerElementAtGridPos(idx, height - 1, false));
|
|
4027
|
+
}
|
|
4028
|
+
lastHeight = height;
|
|
4029
|
+
}
|
|
4030
|
+
return result;
|
|
4031
|
+
}
|
|
4032
|
+
|
|
3967
4033
|
/**
|
|
3968
4034
|
* Returns all other elements in the grid that are in the same row as the elementId from the parameter. It only returns the elements on along the startRowIndex
|
|
3969
4035
|
* Excample:
|
|
@@ -4663,10 +4729,9 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
4663
4729
|
for (var i = 0; i < allElements.length; i++) {
|
|
4664
4730
|
var element = allElements[i];
|
|
4665
4731
|
var elementCells = this.getCellsInGridByElementId(element.getElementId());
|
|
4666
|
-
elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4667
4732
|
var elementLocation = this.createLocationInformation(element, elementCells.backside, elementCells.cells, elementCells.startColIndex, elementCells.startRowIndex, elementCells.colCount, elementCells.rowCount);
|
|
4668
4733
|
var planningLeftLocation = this.getFreePlanningLocation(element.getElementId(), 'LEFT');
|
|
4669
|
-
var
|
|
4734
|
+
var planningRightLocation = this.getFreePlanningLocation(element.getElementId(), 'RIGHT');
|
|
4670
4735
|
var planningTopLocation = this.getFreePlanningLocation(element.getElementId(), 'TOP');
|
|
4671
4736
|
var hasTopElements = this.getElementHasTopElement(element.getElementId());
|
|
4672
4737
|
var moveLocations = [];
|
|
@@ -4680,7 +4745,7 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
4680
4745
|
availablePlanningLocations: {
|
|
4681
4746
|
availableBoxPlannerCellsLeft: planningLeftLocation,
|
|
4682
4747
|
availableBoxPlannerCellsTop: planningTopLocation,
|
|
4683
|
-
availableBoxPlannerCellsRight:
|
|
4748
|
+
availableBoxPlannerCellsRight: planningRightLocation
|
|
4684
4749
|
},
|
|
4685
4750
|
availableMovingLocations: moveLocations
|
|
4686
4751
|
};
|
|
@@ -4688,6 +4753,216 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
4688
4753
|
}
|
|
4689
4754
|
return plannerInteractionInfo;
|
|
4690
4755
|
}
|
|
4756
|
+
}, {
|
|
4757
|
+
key: "getGeneralPlanningState",
|
|
4758
|
+
value: function getGeneralPlanningState(selectedElementId) {
|
|
4759
|
+
var matrix = [];
|
|
4760
|
+
var selectedElement = undefined;
|
|
4761
|
+
var plannedElements = Array.from(this.plannerElements.values()).map(function (p) {
|
|
4762
|
+
return {
|
|
4763
|
+
basketId: p.getBasketId(),
|
|
4764
|
+
elementId: p.getElementId(),
|
|
4765
|
+
articleCodex: p.getArticleCodex(),
|
|
4766
|
+
size: {
|
|
4767
|
+
width: p.getWidth(),
|
|
4768
|
+
height: p.getHeight(),
|
|
4769
|
+
depth: p.getDepth()
|
|
4770
|
+
},
|
|
4771
|
+
area: {
|
|
4772
|
+
fromX: undefined,
|
|
4773
|
+
toX: undefined,
|
|
4774
|
+
fromY: undefined,
|
|
4775
|
+
toY: undefined
|
|
4776
|
+
}
|
|
4777
|
+
};
|
|
4778
|
+
});
|
|
4779
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
4780
|
+
matrix.push([]);
|
|
4781
|
+
var frontGridRow = this.frontGrid[i];
|
|
4782
|
+
var _loop = function _loop() {
|
|
4783
|
+
var cell = frontGridRow[j];
|
|
4784
|
+
if (cell) {
|
|
4785
|
+
var plannedElement = plannedElements.find(function (p) {
|
|
4786
|
+
return p.elementId === cell.plannerElementId;
|
|
4787
|
+
});
|
|
4788
|
+
if (plannedElement) {
|
|
4789
|
+
if (plannedElement.area.fromX === undefined || plannedElement.area.fromX > cell.index.x) plannedElement.area.fromX = cell.index.x;
|
|
4790
|
+
if (plannedElement.area.toX === undefined || plannedElement.area.toX < cell.index.x) plannedElement.area.toX = cell.index.x;
|
|
4791
|
+
if (plannedElement.area.fromY === undefined || plannedElement.area.fromY > cell.index.y) plannedElement.area.fromY = cell.index.y;
|
|
4792
|
+
if (plannedElement.area.toY === undefined || plannedElement.area.toY < cell.index.y) plannedElement.area.toY = cell.index.y;
|
|
4793
|
+
}
|
|
4794
|
+
matrix[i].push({
|
|
4795
|
+
index: cell.index,
|
|
4796
|
+
plannedElement: plannedElement
|
|
4797
|
+
});
|
|
4798
|
+
}
|
|
4799
|
+
};
|
|
4800
|
+
for (var j = 0; j < frontGridRow.length; j++) {
|
|
4801
|
+
_loop();
|
|
4802
|
+
}
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4805
|
+
// Fill matrix rows to equal length
|
|
4806
|
+
var maxLength = Math.max.apply(Math, _toConsumableArray(matrix.map(function (row) {
|
|
4807
|
+
return row.length;
|
|
4808
|
+
})));
|
|
4809
|
+
matrix.forEach(function (row) {
|
|
4810
|
+
while (row.length < maxLength) {
|
|
4811
|
+
var _row$;
|
|
4812
|
+
var lastCell = row[row.length - 1];
|
|
4813
|
+
var newY = lastCell ? lastCell.index.y + 1 : 0;
|
|
4814
|
+
row.push({
|
|
4815
|
+
index: new Vector2(((_row$ = row[0]) === null || _row$ === void 0 ? void 0 : _row$.index.x) || 0, newY),
|
|
4816
|
+
plannedElement: undefined
|
|
4817
|
+
});
|
|
4818
|
+
}
|
|
4819
|
+
});
|
|
4820
|
+
var selectedPlannedElement = selectedElementId ? plannedElements.find(function (p) {
|
|
4821
|
+
return p.elementId === selectedElementId;
|
|
4822
|
+
}) : undefined;
|
|
4823
|
+
if (selectedPlannedElement) {
|
|
4824
|
+
//add the free let planningLeftLocation = this.getFreePlanningLocation(element.getElementId(), 'LEFT');
|
|
4825
|
+
var planningLeftLocation = this.getFreePlanningLocation(selectedPlannedElement.elementId, 'LEFT');
|
|
4826
|
+
var planningRightLocation = this.getFreePlanningLocation(selectedPlannedElement.elementId, 'RIGHT');
|
|
4827
|
+
var planningTopLocation = this.getFreePlanningLocation(selectedPlannedElement.elementId, 'TOP');
|
|
4828
|
+
var fixedPositionRules = [];
|
|
4829
|
+
if (planningLeftLocation) {
|
|
4830
|
+
this.addFreeCellsToMatrix(matrix, planningLeftLocation.cells, fixedPositionRules);
|
|
4831
|
+
}
|
|
4832
|
+
if (planningRightLocation) {
|
|
4833
|
+
this.addFreeCellsToMatrix(matrix, planningRightLocation.cells, fixedPositionRules);
|
|
4834
|
+
}
|
|
4835
|
+
if (planningTopLocation) {
|
|
4836
|
+
this.addFreeCellsToMatrix(matrix, planningTopLocation.cells, fixedPositionRules);
|
|
4837
|
+
}
|
|
4838
|
+
selectedElement = {
|
|
4839
|
+
articleCodex: selectedPlannedElement.articleCodex,
|
|
4840
|
+
size: selectedPlannedElement.size,
|
|
4841
|
+
gridSpace: {
|
|
4842
|
+
rows: selectedPlannedElement.area.toY - selectedPlannedElement.area.fromY + 1,
|
|
4843
|
+
colums: selectedPlannedElement.area.toX - selectedPlannedElement.area.fromX + 1
|
|
4844
|
+
},
|
|
4845
|
+
rules: fixedPositionRules,
|
|
4846
|
+
elementId: selectedElementId
|
|
4847
|
+
};
|
|
4848
|
+
}
|
|
4849
|
+
return {
|
|
4850
|
+
grids: [{
|
|
4851
|
+
index: 0,
|
|
4852
|
+
// boxplanner usecase grid index always 0
|
|
4853
|
+
rowSizes: this.getRowSizes(matrix, selectedElement),
|
|
4854
|
+
columnSizes: this.getColumnSizes(matrix, selectedElement),
|
|
4855
|
+
matrix: matrix
|
|
4856
|
+
}],
|
|
4857
|
+
selectedElement: selectedElement
|
|
4858
|
+
};
|
|
4859
|
+
}
|
|
4860
|
+
}, {
|
|
4861
|
+
key: "getRowSizes",
|
|
4862
|
+
value: function getRowSizes(matrix, selectedElement) {
|
|
4863
|
+
if (this.getForceSingleCellPerElement()) {
|
|
4864
|
+
//system 4 useacse
|
|
4865
|
+
var totalColCount = matrix[0].length;
|
|
4866
|
+
var colSizes = Array(totalColCount).fill(-1);
|
|
4867
|
+
var _loop2 = function _loop2(i) {
|
|
4868
|
+
var _matrix$find;
|
|
4869
|
+
var cell = (_matrix$find = matrix.find(function (row) {
|
|
4870
|
+
return row[i].plannedElement;
|
|
4871
|
+
})) === null || _matrix$find === void 0 ? void 0 : _matrix$find[i];
|
|
4872
|
+
if (cell !== null && cell !== void 0 && cell.plannedElement) {
|
|
4873
|
+
colSizes[i] = cell.plannedElement.size.height;
|
|
4874
|
+
} else if (selectedElement) {
|
|
4875
|
+
colSizes[i] = selectedElement.size.height;
|
|
4876
|
+
}
|
|
4877
|
+
if (!colSizes.includes(-1)) return 1; // break
|
|
4878
|
+
};
|
|
4879
|
+
for (var i = 0; i < totalColCount; i++) {
|
|
4880
|
+
if (_loop2(i)) break;
|
|
4881
|
+
}
|
|
4882
|
+
if (colSizes.includes(-1)) throw new Error('Column sizes are not set');
|
|
4883
|
+
return colSizes;
|
|
4884
|
+
} else {
|
|
4885
|
+
//setup usecase need to be a constant value
|
|
4886
|
+
return 15;
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
}, {
|
|
4890
|
+
key: "getColumnSizes",
|
|
4891
|
+
value: function getColumnSizes(matrix, selectedElement) {
|
|
4892
|
+
if (this.getForceSingleCellPerElement()) {
|
|
4893
|
+
//system 4 useacse
|
|
4894
|
+
var totalRowsCount = matrix.length;
|
|
4895
|
+
var rowRowSizes = Array(totalRowsCount).fill(-1);
|
|
4896
|
+
for (var i = 0; i < totalRowsCount; i++) {
|
|
4897
|
+
var row = matrix[i];
|
|
4898
|
+
var cell = row.find(function (cell) {
|
|
4899
|
+
return cell.plannedElement;
|
|
4900
|
+
});
|
|
4901
|
+
if (cell !== null && cell !== void 0 && cell.plannedElement) {
|
|
4902
|
+
rowRowSizes[i] = cell.plannedElement.size.width;
|
|
4903
|
+
} else if (selectedElement) {
|
|
4904
|
+
rowRowSizes[i] = selectedElement.size.width;
|
|
4905
|
+
}
|
|
4906
|
+
if (!rowRowSizes.includes(-1)) break;
|
|
4907
|
+
}
|
|
4908
|
+
if (rowRowSizes.includes(-1)) throw new Error('Row sizes are not set');
|
|
4909
|
+
return rowRowSizes;
|
|
4910
|
+
} else {
|
|
4911
|
+
//setup usecase need to be a constant value
|
|
4912
|
+
return 15;
|
|
4913
|
+
}
|
|
4914
|
+
}
|
|
4915
|
+
}, {
|
|
4916
|
+
key: "addFreeCellsToMatrix",
|
|
4917
|
+
value: function addFreeCellsToMatrix(matrix, cells, fixedPositionRules) {
|
|
4918
|
+
cells.forEach(function (cell) {
|
|
4919
|
+
var x = cell.index.x;
|
|
4920
|
+
var y = cell.index.y;
|
|
4921
|
+
var row = matrix.find(function (row) {
|
|
4922
|
+
return row.find(function (cell) {
|
|
4923
|
+
return cell.index.x === x;
|
|
4924
|
+
});
|
|
4925
|
+
});
|
|
4926
|
+
if (!row) {
|
|
4927
|
+
var newColumn = [];
|
|
4928
|
+
for (var i = 0; i < matrix[0].length; i++) {
|
|
4929
|
+
newColumn.push({
|
|
4930
|
+
index: new Vector2(x, i),
|
|
4931
|
+
plannedElement: undefined
|
|
4932
|
+
});
|
|
4933
|
+
}
|
|
4934
|
+
if (matrix[0][0].index.x > x) matrix.unshift(newColumn);else matrix.push(newColumn);
|
|
4935
|
+
}
|
|
4936
|
+
var column = matrix.find(function (row) {
|
|
4937
|
+
return row.find(function (cell) {
|
|
4938
|
+
return cell.index.y === y;
|
|
4939
|
+
});
|
|
4940
|
+
});
|
|
4941
|
+
if (!column) {
|
|
4942
|
+
matrix.map(function (row) {
|
|
4943
|
+
var _row$2;
|
|
4944
|
+
return row.push({
|
|
4945
|
+
index: new Vector2(((_row$2 = row[0]) === null || _row$2 === void 0 ? void 0 : _row$2.index.x) || 0, y),
|
|
4946
|
+
plannedElement: undefined
|
|
4947
|
+
});
|
|
4948
|
+
});
|
|
4949
|
+
}
|
|
4950
|
+
});
|
|
4951
|
+
fixedPositionRules.push({
|
|
4952
|
+
type: 'FixedPositon',
|
|
4953
|
+
grids: [{
|
|
4954
|
+
gridIndex: 0,
|
|
4955
|
+
places: [{
|
|
4956
|
+
lowestX: Math.min.apply(Math, _toConsumableArray(cells.map(function (cell) {
|
|
4957
|
+
return cell.index.x;
|
|
4958
|
+
}))),
|
|
4959
|
+
lowestY: Math.min.apply(Math, _toConsumableArray(cells.map(function (cell) {
|
|
4960
|
+
return cell.index.y;
|
|
4961
|
+
})))
|
|
4962
|
+
}]
|
|
4963
|
+
}]
|
|
4964
|
+
});
|
|
4965
|
+
}
|
|
4691
4966
|
}]);
|
|
4692
4967
|
}();
|
|
4693
4968
|
|
|
@@ -5560,6 +5835,11 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
5560
5835
|
value: function getPlannerInteractionInformation() {
|
|
5561
5836
|
return this.boxPlannerGrid.getPlannerInteractionInformation();
|
|
5562
5837
|
}
|
|
5838
|
+
}, {
|
|
5839
|
+
key: "getGeneralPlanningState",
|
|
5840
|
+
value: function getGeneralPlanningState(selectedElementId) {
|
|
5841
|
+
return this.boxPlannerGrid.getGeneralPlanningState(selectedElementId);
|
|
5842
|
+
}
|
|
5563
5843
|
}]);
|
|
5564
5844
|
}();
|
|
5565
5845
|
_defineProperty(DivaBoxPlanner, "plannerType", 'BOX');
|
|
@@ -3,8 +3,8 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
3
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
-
import { V as Vector3, c as Vector2, B as BoundingBox } from './index-
|
|
7
|
-
import { d as dockingPointHandlerInst, h as handler2D, P as PlannerElementData } from './PlannerHandler2D-
|
|
6
|
+
import { V as Vector3, c as Vector2, B as BoundingBox } from './index-51b98cbc.js';
|
|
7
|
+
import { d as dockingPointHandlerInst, h as handler2D, P as PlannerElementData } from './PlannerHandler2D-1a23208c.js';
|
|
8
8
|
import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
|
|
9
9
|
import '@babel/runtime/helpers/slicedToArray';
|
|
10
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -1827,6 +1827,16 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
|
|
|
1827
1827
|
boxPlannerInteractionInformationPerElement: new Map()
|
|
1828
1828
|
};
|
|
1829
1829
|
}
|
|
1830
|
+
}, {
|
|
1831
|
+
key: "getGeneralPlanningState",
|
|
1832
|
+
value: function getGeneralPlanningState(selectedElementId) {
|
|
1833
|
+
LOG.error(new DivaError('The function getGeneralPlanningState is not implemented yet for standard planner. Dont call it or ask roadmap when its its turn', {
|
|
1834
|
+
code: 'WC_0012'
|
|
1835
|
+
}));
|
|
1836
|
+
return {
|
|
1837
|
+
grids: []
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1830
1840
|
}]);
|
|
1831
1841
|
}();
|
|
1832
1842
|
_defineProperty(DivaStandardPlanner, "plannerType", 'STD');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
2
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
-
import './index-
|
|
4
|
+
import './index-51b98cbc.js';
|
|
5
5
|
import DivaUtils from '@crystaldesign/diva-utils';
|
|
6
6
|
import '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
@@ -3,7 +3,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
3
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
-
import { R as Rendering, H as HQRenderScript } from './index-
|
|
6
|
+
import { R as Rendering, H as HQRenderScript } from './index-51b98cbc.js';
|
|
7
7
|
import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
|
|
8
8
|
import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
|
|
9
9
|
import io from 'socket.io-client';
|
|
@@ -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-51b98cbc.js';
|
|
4
4
|
import '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
6
6
|
import '@babel/runtime/helpers/defineProperty';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
2
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
-
import { a as articleHandlerInstance } from './index-
|
|
3
|
+
import { a as articleHandlerInstance } from './index-51b98cbc.js';
|
|
4
4
|
import { SAPOrderLineData } from '@crystaldesign/basket-model';
|
|
5
5
|
import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
|
|
6
6
|
import '@babel/runtime/helpers/slicedToArray';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
2
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
-
import { c as Vector2, V as Vector3, D as DockingPoint } from './index-
|
|
4
|
+
import { c as Vector2, V as Vector3, D as DockingPoint } from './index-51b98cbc.js';
|
|
5
5
|
import DivaUtils, { md5, DivaError } from '@crystaldesign/diva-utils';
|
|
6
6
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
7
7
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
2
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
-
import { s as summaryHandlerInstance } from './index-
|
|
4
|
+
import { s as summaryHandlerInstance } from './index-51b98cbc.js';
|
|
5
5
|
import DivaUtils from '@crystaldesign/diva-utils';
|
|
6
6
|
import '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
@@ -4,7 +4,7 @@ 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, b as setHandlerInstance, a as articleHandlerInstance } from './index-
|
|
7
|
+
import { G as Grid, b as setHandlerInstance, a as articleHandlerInstance } from './index-51b98cbc.js';
|
|
8
8
|
import DivaUtils from '@crystaldesign/diva-utils';
|
|
9
9
|
import '@babel/runtime/helpers/slicedToArray';
|
|
10
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -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-51b98cbc.js';
|
|
4
4
|
import '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
6
6
|
import '@babel/runtime/helpers/defineProperty';
|