@crystaldesign/real-time-viewer 24.10.0-beta.2 → 24.10.0-beta.21

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.
@@ -312,12 +312,12 @@ function getGridControls(scene, element, selected, elements, selectMesh) {
312
312
  };
313
313
  var register = function register(basketId, gridIdx, shelfIdx, accessoireBasketId) {
314
314
  var _onGridMoveOut = function onGridMoveOut() {
315
- var _curGrid2, _scene$activeCamera2;
315
+ var _curGrid2, _curGrid3, _scene$activeCamera2;
316
316
  element === null || element === void 0 || element.removeEventListener('pointermove', onGridMove, false);
317
317
  element === null || element === void 0 || element.removeEventListener('pointerup', _onGridMoveOut, false);
318
- _curGrid = scene.getMeshByName(_curGrid.name);
318
+ _curGrid = scene.getMeshByName((_curGrid2 = _curGrid) === null || _curGrid2 === void 0 ? void 0 : _curGrid2.name);
319
319
  if (!_curGrid) return;
320
- var _ref2 = gridStore.getDataFromGridName((_curGrid2 = _curGrid) === null || _curGrid2 === void 0 ? void 0 : _curGrid2.name, _curGrid.metadata.elementId),
320
+ var _ref2 = gridStore.getDataFromGridName((_curGrid3 = _curGrid) === null || _curGrid3 === void 0 ? void 0 : _curGrid3.name, _curGrid.metadata.elementId),
321
321
  curBasketId = _ref2.parentBasketId,
322
322
  curShelfIdx = _ref2.shelfIdx,
323
323
  curGridIdx = _ref2.gridIdx,
@@ -356,7 +356,7 @@ function Grids () {
356
356
  function setupPreviewGrids(allGrids, plannedPlacesOnGrids, freePlacesOnGrids) {
357
357
  deleteAllGrids();
358
358
  _plannedPlaceOnGrids = plannedPlacesOnGrids;
359
- if (gridStore.selectedGrid && ((freePlacesOnGrids === null || freePlacesOnGrids === void 0 ? void 0 : freePlacesOnGrids[0]) == undefined || !Tags.GetTags(gridStore.selectedGrid).includes('ac:' + freePlacesOnGrids[0].articleCodex))) {
359
+ if (gridStore.selectedGrid && (freePlacesOnGrids === null || freePlacesOnGrids === void 0 ? void 0 : freePlacesOnGrids[0]) != undefined && !Tags.GetTags(gridStore.selectedGrid).includes('ac:' + freePlacesOnGrids[0].articleCodex)) {
360
360
  gridStore.deselectGrids(false);
361
361
  }
362
362
  var _loop = function _loop() {
@@ -367,40 +367,41 @@ function Grids () {
367
367
  var gridsForElement = allGrids.find(function (allGrid) {
368
368
  return allGrid.elementId == plannedPlaceOnGrid.elementId;
369
369
  });
370
- if (!Object.values(freePlaceOnGrid.grids).find(function (g) {
370
+ if (Object.values(freePlaceOnGrid.grids).find(function (g) {
371
371
  return g.freeCells.length > 0;
372
- })) return 1; // continue
373
- if (!gridsForElement) throw new Error('Could not find grids for element with id: ' + gridsForElement);
374
- var accessorie = gridsForElement.accessories.find(function (a) {
375
- return a.artNr == accessorie3DName;
376
- });
377
- if (!accessorie) throw new Error('Could not find accessorie with name: ' + accessorie3DName);
378
- var geo = accessorie.geo;
379
- var geoSize = new Vector3(geo.geoSize.x, geo.geoSize.y, geo.geoSize.z);
380
- var bboxSize = new Vector3(geo.geoBboxSize.x, geo.geoBboxSize.y, geo.geoBboxSize.z);
381
- var rulePosition = new Vector3(geo.rulePosition.x, geo.rulePosition.y, geo.rulePosition.z);
382
- var geoPosition = new Vector3(geo.geoPosition.x, geo.geoPosition.y, geo.geoPosition.z);
383
- var _loop2 = function _loop2() {
384
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
385
- gridName = _Object$entries$_i[0],
386
- freeGrid = _Object$entries$_i[1];
387
- var grid = gridsForElement.grids.find(function (grid) {
388
- return grid.gridName == gridName;
372
+ })) {
373
+ if (!gridsForElement) throw new Error('Could not find grids for element with id: ' + gridsForElement);
374
+ var accessorie = gridsForElement.accessories.find(function (a) {
375
+ return a.artNr == accessorie3DName;
389
376
  });
390
- if (!grid) throw new Error('Could not find grid with name: ' + gridName);
391
- for (var shelfIdx = 0; shelfIdx < grid.count; shelfIdx++) {
392
- if (!freeGrid.freeCells.includes(shelfIdx)) continue;
393
- createGrid({
394
- grid: grid,
395
- bboxSize: bboxSize,
396
- geoSize: geoSize,
397
- rulePosition: rulePosition,
398
- geoPosition: geoPosition
399
- }, freePlaceOnGrid.elementId, shelfIdx, freeGrid.idx, true, false, false, freePlaceOnGrid.articleCodex);
377
+ if (!accessorie) throw new Error('Could not find accessorie with name: ' + accessorie3DName);
378
+ var geo = accessorie.geo;
379
+ var geoSize = new Vector3(geo.geoSize.x, geo.geoSize.y, geo.geoSize.z);
380
+ var bboxSize = new Vector3(geo.geoBboxSize.x, geo.geoBboxSize.y, geo.geoBboxSize.z);
381
+ var rulePosition = new Vector3(geo.rulePosition.x, geo.rulePosition.y, geo.rulePosition.z);
382
+ var geoPosition = new Vector3(geo.geoPosition.x, geo.geoPosition.y, geo.geoPosition.z);
383
+ var _loop2 = function _loop2() {
384
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
385
+ gridName = _Object$entries$_i[0],
386
+ freeGrid = _Object$entries$_i[1];
387
+ var grid = gridsForElement.grids.find(function (grid) {
388
+ return grid.gridName == gridName;
389
+ });
390
+ if (!grid) throw new Error('Could not find grid with name: ' + gridName);
391
+ for (var shelfIdx = 0; shelfIdx < grid.count; shelfIdx++) {
392
+ if (!freeGrid.freeCells.includes(shelfIdx)) continue;
393
+ createGrid({
394
+ grid: grid,
395
+ bboxSize: bboxSize,
396
+ geoSize: geoSize,
397
+ rulePosition: rulePosition,
398
+ geoPosition: geoPosition
399
+ }, freePlaceOnGrid.elementId, shelfIdx, freeGrid.idx, true, false, false, freePlaceOnGrid.articleCodex);
400
+ }
401
+ };
402
+ for (var _i = 0, _Object$entries = Object.entries(freePlaceOnGrid.grids); _i < _Object$entries.length; _i++) {
403
+ _loop2();
400
404
  }
401
- };
402
- for (var _i = 0, _Object$entries = Object.entries(freePlaceOnGrid.grids); _i < _Object$entries.length; _i++) {
403
- _loop2();
404
405
  }
405
406
  }
406
407
  if (plannedPlaceOnGrid) {
@@ -456,7 +457,7 @@ function Grids () {
456
457
  }
457
458
  };
458
459
  for (var idx = 0; idx < plannedPlacesOnGrids.length; idx++) {
459
- if (_loop()) continue;
460
+ _loop();
460
461
  }
461
462
  }
462
463
  function createGrid(data, elementId, shelfIdx, gridIdx, isFree, noDelete, noMove, articleCodex) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,qBAiPxD;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;CACrG;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,OAAO,EAAE,EACnB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI;yBA+CvG,MAAM,WAAW,MAAM,YAAY,MAAM,sBAAsB,MAAM;EA6BlG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,qBAiPxD;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;CACrG;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,OAAO,EAAE,EACnB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI;yBA+CvG,MAAM,WAAW,MAAM,YAAY,MAAM,sBAAsB,MAAM;EA4BlG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/grids/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAKnD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAG7D,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAQ,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO;kCAUyB,QAAQ,EAAE,wBAAwB,oBAAoB,EAAE,sBAAsB,iBAAiB,EAAE;wBA0L3G,IAAI;;EAwBhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/grids/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAKnD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAG7D,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAQ,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO;kCAUyB,QAAQ,EAAE,wBAAwB,oBAAoB,EAAE,sBAAsB,iBAAiB,EAAE;wBA2L3G,IAAI;;EAwBhC"}