@sapui5/sap.ui.vbm 1.98.0 → 1.101.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ui.vbm",
3
- "version": "1.98.0",
3
+ "version": "1.101.0",
4
4
  "description": "SAPUI5 Library sap.ui.vbm",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -3,7 +3,7 @@
3
3
  <name>sap.ui.vbm</name>
4
4
  <vendor>SAP SE</vendor>
5
5
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved</copyright>
6
- <version>1.98.0</version>
6
+ <version>1.101.0</version>
7
7
 
8
8
  <documentation>SAP UI library: sap.ui.vbm</documentation>
9
9
 
@@ -36,6 +36,13 @@
36
36
  <exclude name="sap.ui.vbm.js." />
37
37
  <exclude name="sap.ui.vbm.lib." />
38
38
  </jscoverage>
39
+
40
+ <packaging xmlns="http://www.sap.com/ui5/buildext/packaging" version="2.0" >
41
+ <all-in-one>
42
+ <exclude name="sap/ui/vbm/adapter3d/thirdparty/" />
43
+ </all-in-one>
44
+ </packaging>
45
+
39
46
  <documentation xmlns="http://www.sap.com/ui5/buildext/documentation"
40
47
  indexUrl="../../../../test-resources/sap/ui/vbm/demokit/docuindex.json"
41
48
  resolve="lib"
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @param {string} [sId] id for the new control, generated automatically if no id is given
23
23
  * @param {object} [mSettings] initial settings for the new object
24
24
  * @author SAP SE
25
- * @version 1.98.0
25
+ * @version 1.101.0
26
26
  * @extends sap.ui.core.Element
27
27
  * @constructor
28
28
  * @public
@@ -965,7 +965,14 @@ sap.ui.define([
965
965
  this._handler = this._adapter._getKeyboardHandler(this.name);
966
966
  break;
967
967
  default:
968
- return false;
968
+ if (this.refEvent && this.name) {
969
+ //register for event on map that we don't explicitly handle using its legacy name as its refevent name is unlikely to propagate
970
+ Log.info("No UI5 event found to attach action to. Falling through to default vbi event handling.", this.name, thisModule);
971
+ this._event = this.name;
972
+ } else {
973
+ Log.error("Action invalid. No refEvent or name supplied.", this, thisModule);
974
+ return false;
975
+ }
969
976
  }
970
977
  this._target.attachEvent(this._event, this._handler, this._listener);
971
978
  this._target.invalidate(); // neccessary evil, to force recreation of VO on VBI level, otherwise VO on GeoMap level updated but not on VBI level
@@ -1503,6 +1510,14 @@ sap.ui.define([
1503
1510
  var oParameters = event.getParameters();
1504
1511
  var oEventData = oParameters.data ? oParameters.data : oParameters;
1505
1512
 
1513
+ //If no event object then fire submit with original data
1514
+ if (oEventData.Action && !oEventData.Action.object) {
1515
+ this.fireSubmit({
1516
+ data: JSON.stringify(oEventData)
1517
+ });
1518
+ return;
1519
+ }
1520
+
1506
1521
  if (oEventData.Action.object.startsWith(this._map().getId())) {
1507
1522
  oEventData.Action.object = oEventData.Action.object.substr(this._map().getId().length + 1)
1508
1523
  }
@@ -1624,7 +1639,7 @@ sap.ui.define([
1624
1639
  }
1625
1640
  }, this);
1626
1641
 
1627
- this.fireSubmit({
1642
+ this.fireSubmit({
1628
1643
  data: JSON.stringify(oEventData)
1629
1644
  });
1630
1645
  }
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  "./adapter3d/thirdparty/three",
24
24
  "sap/base/Log",
25
25
  "jquery.sap.global",
26
- "./library"
26
+ "./library"
27
27
  ], function(Element, Observer, Menu, MenuItem, Popover, Viewport, ObjectFactory, Parser, SceneBuilder, Utilities, HBox, VBox, Link, Button, Text, Image, THREE, Log, jQuery, library) {
28
28
  "use strict";
29
29
 
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  * @param {string} [sId] id for the new control, generated automatically if no id is given
42
42
  * @param {object} [mSettings] initial settings for the new object
43
43
  * @author SAP SE
44
- * @version 1.98.0
44
+ * @version 1.101.0
45
45
  * @extends sap.ui.core.Element
46
46
  * @constructor
47
47
  * @public
@@ -153,7 +153,7 @@ sap.ui.define([
153
153
  this.toAdd.clear();
154
154
  this.toUpdate.clear();
155
155
  this.toRemove.clear();
156
- }
156
+ }
157
157
  },
158
158
 
159
159
  // Each queue contains a list of scenes to add, update or remove.
@@ -216,7 +216,7 @@ sap.ui.define([
216
216
  anchor: undefined, // anchor DOM element to display responsive popover
217
217
  pending: undefined // pending popover, if viewport has not been rendered yet
218
218
  };
219
-
219
+
220
220
  this._raycaster = new THREE.Raycaster();
221
221
  };
222
222
 
@@ -384,7 +384,7 @@ sap.ui.define([
384
384
  that._context.voQueues.clear();
385
385
  that._context.sceneQueues.clear();
386
386
  that._context.windowQueues.clear();
387
-
387
+
388
388
  // scene has changed -> adjust camera clipping planes
389
389
  that._viewport._resetBBox();
390
390
  that._viewport._updateCamera();
@@ -720,6 +720,13 @@ sap.ui.define([
720
720
  };
721
721
 
722
722
  Adapter3D.prototype._genericEventHandler = function(name, event) {
723
+ // special handling section for hardcoded keys
724
+ // 'h' button pressed -> change camera to 'home' (initial) view
725
+ if (event.keyCode == 72) {
726
+ this._viewport.applyCameraHome(false); // no fly-to animation needed here
727
+ return;
728
+ }
729
+
723
730
  var instance = event.instance;
724
731
  var groupId = instance ? instance.voGroup.id : event.voGroupId;
725
732
  var actionDefinition = sap.ui.vbm.findInArray(this._context.actions, function(action) { return action.refVO === groupId && action.refEvent === name; });
@@ -741,40 +748,32 @@ sap.ui.define([
741
748
  };
742
749
 
743
750
  if (actionDefinition.name === "KEY_PRESS") {
744
- // special handling for 'h' button pressed -> change camera to home view
745
- if (event.keyCode == 72) {
746
- this._viewport.applyCameraHome(false); // no fly-to animation needed here
747
- //this._sceneBuilder._polygonHandler._executeTest(); // TODO
751
+ if (["Shift", "Control", "Alt", "Meta"].indexOf(event.key) !== -1 || [16, 17, 18, 91].indexOf(event.code) !== -1) {
752
+ return;
753
+ } else {
754
+ param.push(
755
+ {
756
+ "name": "code",
757
+ "#": event.keyCode
758
+ },
759
+ {
760
+ "name": "shift",
761
+ "#": event.shiftKey
762
+ },
763
+ {
764
+ "name": "ctrl",
765
+ "#": event.ctrlKey
766
+ },
767
+ {
768
+ "name": "alt",
769
+ "#": event.altKey
770
+ },
771
+ {
772
+ "name": "meta",
773
+ "#": event.metaKey
774
+ }
775
+ );
748
776
  }
749
- if (event.key == "Shift" || event.code == 16 ||
750
- event.key == "Control" || event.code == 17 ||
751
- event.key == "Alt" || event.code == 18 ||
752
- event.key == "Meta" || event.code == 91) {
753
- return;
754
- } else {
755
- param.push(
756
- {
757
- "name": "code",
758
- "#": event.keyCode
759
- },
760
- {
761
- "name": "shift",
762
- "#": event.shiftKey
763
- },
764
- {
765
- "name": "ctrl",
766
- "#": event.ctrlKey
767
- },
768
- {
769
- "name": "alt",
770
- "#": event.altKey
771
- },
772
- {
773
- "name": "meta",
774
- "#": event.metaKey
775
- }
776
- );
777
- }
778
777
  } else if (event && event.cursor) {
779
778
  param.push(
780
779
  {
@@ -821,22 +820,25 @@ sap.ui.define([
821
820
  }
822
821
 
823
822
  if (instance && name === "Click" && event.selectionChanges) {
823
+ var dataType = instance.voGroup.datasource, obj;
824
+ var keyAlias = Utilities.getAttributeAlias(this._context, dataType, instance.voGroup.keyAttributeName);
825
+
824
826
  payload.Data = {
825
827
  Merge: {
826
828
  N: [
827
829
  {
828
830
  name: instance.voGroup.datasource,
829
831
  E: event.selectionChanges.selected.map(function(instance) {
830
- return {
831
- K: instance ? instance.id : "",
832
- "VB:s": "true"
833
- };
834
- }).concat(event.selectionChanges.deselected.map(function(instance) {
835
- return {
836
- K: instance ? instance.id : "",
837
- "VB:s": "false"
838
- };
839
- }))
832
+ obj = {};
833
+ obj[keyAlias] = instance.id || "";
834
+ obj["VB:s"] = "true";
835
+ return obj;
836
+ }).concat(event.selectionChanges.deselected.map(function(instance) {
837
+ obj = {};
838
+ obj[keyAlias] = instance.id || "";
839
+ obj["VB:s"] = "false";
840
+ return obj;
841
+ }))
840
842
  }
841
843
  ]
842
844
  }
@@ -917,7 +919,7 @@ sap.ui.define([
917
919
 
918
920
  if (instance !== this._hoverInstance) {
919
921
  clearTimeout(this._hoverTimeOutId);
920
-
922
+
921
923
  this._hoverTimeOutId = setTimeout(function() {
922
924
  this._propogateHoverChange(event);
923
925
  this._hoverTimeOutId = undefined;
@@ -948,7 +950,7 @@ sap.ui.define([
948
950
 
949
951
  var rect = this._viewport.getDomRef().getBoundingClientRect();
950
952
  var normalizedXY = new THREE.Vector2(p.x / rect.width * 2 - 1, -p.y / rect.height * 2 + 1);
951
-
953
+
952
954
  this._raycaster.layers.set(0); // test objects from layer #0 only
953
955
  this._raycaster.setFromCamera(normalizedXY, camera);
954
956
  var intersects = this._raycaster.intersectObjects(scene.children, true);
@@ -961,7 +963,7 @@ sap.ui.define([
961
963
  } else {
962
964
  instance = info.object._sapInstance;
963
965
  }
964
-
966
+
965
967
  return {
966
968
  info: info,
967
969
  point: info.point,
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @public
25
25
  * @author SAP SE
26
- * @version 1.98.0
26
+ * @version 1.101.0
27
27
  * @extends sap.ui.core.Control
28
28
  * @alias sap.ui.vbm.Viewport
29
29
  */
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  *
30
30
  * @private
31
31
  * @author SAP SE
32
- * @version 1.98.0
32
+ * @version 1.101.0
33
33
  * @alias sap.ui.vbm.adapter3d.ModelHandler
34
34
  */
35
35
  var ModelHandler = BaseObject.extend("sap.ui.vbm.adapter3d.ModelHandler", /** @lends sap.ui.vbm.adapter3d.ModelHandler.prototype */ {
@@ -377,7 +377,7 @@ sap.ui.define([
377
377
  *
378
378
  * @private
379
379
  * @author SAP SE
380
- * @version 1.98.0
380
+ * @version 1.101.0
381
381
  * @alias sap.ui.vbm.adapter3d.ObjectFactory
382
382
  */
383
383
  var ObjectFactory = BaseObject.extend("sap.ui.vbm.adapter3d.ObjectFactory", /** @lends sap.ui.vbm.adapter3d.ObjectFactory.prototype */ {});
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  *
33
33
  * @private
34
34
  * @author SAP SE
35
- * @version 1.98.0
35
+ * @version 1.101.0
36
36
  * @alias sap.ui.vbm.adapter3d.PolygonHandler
37
37
  */
38
38
  var PolygonHandler = BaseObject.extend("sap.ui.vbm.adapter3d.PolygonHandler", /** @lends sap.ui.vbm.adapter3d.PolygonHandler.prototype */ {
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  *
47
47
  * @private
48
48
  * @author SAP SE
49
- * @version 1.98.0
49
+ * @version 1.101.0
50
50
  * @alias sap.ui.vbm.adapter3d.SceneBuilder
51
51
  */
52
52
  var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
@@ -906,6 +906,7 @@ sap.ui.define([
906
906
  material = material || new THREE.MeshPhongMaterial({
907
907
  specular: 0x444444,
908
908
  shininess: 0,
909
+ opacity: 0.99,
909
910
  transparent: true,
910
911
  depthTest: true,
911
912
  depthWrite: false,
@@ -925,6 +926,7 @@ sap.ui.define([
925
926
 
926
927
  var geometry = new THREE.DecalGeometry(target, origin, this._decalHelper.rotation, size);
927
928
  instance.object3D = new THREE.Mesh(geometry, material);
929
+ instance.object3D.renderOrder = 100;
928
930
  instance.object3D.matrixAutoUpdate = false;
929
931
  instance.object3D.layers.set(1); // put it to layer #1 to disable hit test
930
932
  this._scene.add(instance.object3D);
@@ -213,11 +213,11 @@ sap.ui.define([
213
213
  var color = Utilities.toColor(source);
214
214
  var selected = Utilities.toBoolean(instance["VB:s"]);
215
215
 
216
- if (selected) {
216
+ if (selected) {
217
217
  // if direct color -> override current, if delta color -> apply on top
218
218
  var selectDelta = Utilities.isColorDelta(instance.selectColor);
219
219
  var selectColor = selectDelta ? Utilities.toColorDelta(instance.selectColor) : Utilities.toColor(instance.selectColor);
220
-
220
+
221
221
  if (selectDelta) {
222
222
  Utilities.applyDeltaHLS(color.rgb, selectColor.hls);
223
223
  color.opacity = Utilities.clamp(color.opacity * selectColor.opacity, 0.0, 1.0);
@@ -230,7 +230,7 @@ sap.ui.define([
230
230
  // if direct color -> override current, if delta color -> apply on top
231
231
  var hotDelta = Utilities.isColorDelta(instance.hotDeltaColor);
232
232
  var hotColor = hotDelta ? Utilities.toColorDelta(instance.hotDeltaColor) : Utilities.toColor(instance.hotDeltaColor);
233
-
233
+
234
234
  if (hotDelta) {
235
235
  Utilities.applyDeltaHLS(color.rgb, hotColor.hls);
236
236
  color.opacity = Utilities.clamp(color.opacity * hotColor.opacity, 0.0, 1.0);
@@ -305,7 +305,7 @@ sap.ui.define([
305
305
  }
306
306
  material.transparent = material.opacity < 1;
307
307
  });
308
- });
308
+ });
309
309
  });
310
310
  };
311
311
 
@@ -350,7 +350,7 @@ sap.ui.define([
350
350
  Utilities.getInstanceTransform = function(instance, position, rotation, scale, bbox) {
351
351
  Utilities.toVector3(instance.pos, position);
352
352
  Utilities.toVector3(instance.scale, scale);
353
-
353
+
354
354
  var rot = Utilities.toVector3(instance.rot);
355
355
  rotation.set(degToRad(rot.x), degToRad(rot.y), degToRad(rot.z), "YXZ");
356
356
 
@@ -427,7 +427,7 @@ sap.ui.define([
427
427
  Utilities.propertyAdded = function(instance, property) {
428
428
  return instance[property] && !instance._last[property];
429
429
  };
430
-
430
+
431
431
  Utilities.propertyRemoved = function(instance, property) {
432
432
  return !instance[property] && instance._last[property];
433
433
  };
@@ -458,7 +458,7 @@ sap.ui.define([
458
458
  /**
459
459
  * Normalize the object. Implementation replicates Visual Business ActiveX implementation of object(s) normalization.
460
460
  * The node is centered and then scaled uniformly so that vertex coordinates fit into the 3D box defined as range [(-1, -1, -1), (+1, +1, +1)].
461
- *
461
+ *
462
462
  * @param {THREE.Object3D} root The node to normalize.
463
463
  * @param {THREE.Matrix4} [matrix] Copy transformation into matrix or apply to root directly.
464
464
  * @param {THREE.Box3} [bbox] Copy bounding box into it.
@@ -491,13 +491,13 @@ sap.ui.define([
491
491
 
492
492
  if (bbox) {
493
493
  bbox.copy(box);
494
- }
495
-
494
+ }
495
+
496
496
  var m1 = new Matrix4().makeScale(scaleFactor, scaleFactor, scaleFactor);
497
497
  var m2 = new Matrix4().makeTranslation(-center.x, -center.y, -center.z);
498
498
 
499
499
  root.updateMatrix(); // make sure local TM is up to date
500
-
500
+
501
501
  m1.multiply(m2);
502
502
  m1.multiply(root.matrix);
503
503
 
@@ -510,7 +510,7 @@ sap.ui.define([
510
510
 
511
511
  /**
512
512
  * Clone material(s). Material can be single object or array of materials.
513
- *
513
+ *
514
514
  * @param {THREE.Material|THREE.Material[]} material Material(s) to clone.
515
515
  * @return {THREE.Material|THREE.Material[]} Cloned material(s).
516
516
  */
@@ -526,5 +526,29 @@ sap.ui.define([
526
526
  return material;
527
527
  };
528
528
 
529
+ /**
530
+ * Function returns alias for the specified Attribute within DataType.
531
+ * Only top level data types are checked, nested data types are ignored.
532
+ *
533
+ * @param {object} context The Context which holds all definitions and populated data
534
+ * @param {string} dataType The DataType name for the given attribute
535
+ * @param {string} attribute The Attribute name
536
+ * @returns {string} String alias of an attribute or undefined if not found
537
+ */
538
+ Utilities.getAttributeAlias = function(context, dataType, attribute) {
539
+ for (var i = 0; i < context.dataTypes.length; ++i) {
540
+ var type = context.dataTypes[i];
541
+ if (type.name === dataType) {
542
+ for (var j = 0; j < type.attributes.length; ++j) {
543
+ var attr = type.attributes[j];
544
+ if (attr.name === attribute) {
545
+ return attr.alias;
546
+ }
547
+ }
548
+ }
549
+ }
550
+ return undefined;
551
+ };
552
+
529
553
  return Utilities;
530
554
  });
@@ -56,7 +56,7 @@ sap.ui.define([
56
56
  *
57
57
  * @private
58
58
  * @author SAP SE
59
- * @version 1.98.0
59
+ * @version 1.101.0
60
60
  * @alias sap.ui.vbm.adapter3d.VBIJSONParser
61
61
  */
62
62
  var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {