@openui5/sap.ui.dt 1.94.0 → 1.97.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.
Files changed (50) hide show
  1. package/.reuse/dep5 +12 -12
  2. package/THIRDPARTY.txt +21 -17
  3. package/package.json +2 -2
  4. package/src/sap/ui/dt/.library +1 -1
  5. package/src/sap/ui/dt/AggregationDesignTimeMetadata.js +1 -1
  6. package/src/sap/ui/dt/AggregationOverlay.js +1 -1
  7. package/src/sap/ui/dt/ControlObserver.js +1 -1
  8. package/src/sap/ui/dt/DOMUtil.js +7 -6
  9. package/src/sap/ui/dt/DesignTime.js +43 -15
  10. package/src/sap/ui/dt/DesignTimeMetadata.js +1 -1
  11. package/src/sap/ui/dt/ElementDesignTimeMetadata.js +5 -3
  12. package/src/sap/ui/dt/ElementOverlay.js +11 -2
  13. package/src/sap/ui/dt/ElementUtil.js +74 -39
  14. package/src/sap/ui/dt/ManagedObjectObserver.js +2 -1
  15. package/src/sap/ui/dt/MetadataPropagationUtil.js +6 -6
  16. package/src/sap/ui/dt/MutationObserver.js +1 -1
  17. package/src/sap/ui/dt/Overlay.js +16 -17
  18. package/src/sap/ui/dt/OverlayRegistry.js +2 -3
  19. package/src/sap/ui/dt/OverlayUtil.js +4 -4
  20. package/src/sap/ui/dt/Plugin.js +1 -1
  21. package/src/sap/ui/dt/ScrollbarSynchronizer.js +1 -1
  22. package/src/sap/ui/dt/SelectionManager.js +1 -1
  23. package/src/sap/ui/dt/SelectionMode.js +1 -1
  24. package/src/sap/ui/dt/TaskManager.js +1 -1
  25. package/src/sap/ui/dt/TaskRunner.js +1 -1
  26. package/src/sap/ui/dt/Util.js +1 -5
  27. package/src/sap/ui/dt/enablement/ElementEnablementTest.js +2 -3
  28. package/src/sap/ui/dt/enablement/Test.js +25 -24
  29. package/src/sap/ui/dt/enablement/Util.js +9 -9
  30. package/src/sap/ui/dt/enablement/libraryTest.js +1 -1
  31. package/src/sap/ui/dt/enablement/report/LibraryReport.js +1 -1
  32. package/src/sap/ui/dt/enablement/report/QUnitReport.js +2 -3
  33. package/src/sap/ui/dt/enablement/report/Statistic.js +1 -1
  34. package/src/sap/ui/dt/enablement/report/StatisticRenderer.js +1 -1
  35. package/src/sap/ui/dt/enablement/report/Table.js +2 -3
  36. package/src/sap/ui/dt/enablement/report/TableRenderer.js +1 -1
  37. package/src/sap/ui/dt/library.js +2 -2
  38. package/src/sap/ui/dt/plugin/ContextMenu.js +127 -377
  39. package/src/sap/ui/dt/plugin/ControlDragDrop.js +1 -1
  40. package/src/sap/ui/dt/plugin/CutPaste.js +1 -1
  41. package/src/sap/ui/dt/plugin/DragDrop.js +19 -18
  42. package/src/sap/ui/dt/plugin/ElementMover.js +41 -43
  43. package/src/sap/ui/dt/plugin/MouseSelection.js +1 -1
  44. package/src/sap/ui/dt/plugin/TabHandling.js +1 -1
  45. package/src/sap/ui/dt/plugin/ToolHooks.js +1 -1
  46. package/src/sap/ui/dt/themes/base/ContextMenu.less +104 -75
  47. package/src/sap/ui/dt/util/ZIndexManager.js +1 -1
  48. package/src/sap/ui/dt/util/_createPromise.js +6 -4
  49. package/ui5.yaml +4 -1
  50. package/src/sap/ui/dt/ContextMenuControl.js +0 -929
package/.reuse/dep5 CHANGED
@@ -309,7 +309,7 @@ License: MIT
309
309
  Comment: these files belong to: lodash
310
310
 
311
311
  Files: src/sap.ui.core/src/sap/ui/thirdparty/hyphenopoly/*
312
- Copyright: 2018 Mathias Nater
312
+ Copyright: 2021 Mathias Nater
313
313
  License: MIT
314
314
  Comment: these files belong to: Hyphenopoly
315
315
 
@@ -347,11 +347,6 @@ Copyright: 2013 Ariya Hidayat and other contributors
347
347
  License: BSD-2-Clause
348
348
  Comment: these files belong to: Esprima
349
349
 
350
- Files: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/*
351
- Copyright: 2006 Google Inc.
352
- License: Apache-2.0
353
- Comment: these files belong to: google-code-prettify
354
-
355
350
  Files: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/highlight.js/*
356
351
  Copyright: 2006-2020, Ivan Sagalaev
357
352
  License: BSD-3-Clause
@@ -405,6 +400,11 @@ Copyright: 2014 Vitaly Puzrin, Alex Kocharin
405
400
  License: MIT
406
401
  Comment: these files belong to: Markdown-it
407
402
 
403
+ Files: src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/thirdparty/ajv/ajv.min.js
404
+ Copyright: 2015-2017 Evgeny Poberezkin
405
+ License: MIT
406
+ Comment: these files belong to: ajv
407
+
408
408
 
409
409
  # Library: sap.ui.mdc:
410
410
 
@@ -418,7 +418,7 @@ Comment: these files contain content from SAP and BooleanExpressionEvaluator: Bo
418
418
 
419
419
  # Library: sap.ui.webc.common:
420
420
 
421
- Files: src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/base/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/theme-base/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/localization/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-tnt/*.*
421
+ Files: src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/base/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/theming/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/localization/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-tnt/*.* src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-business-suite/*.*
422
422
  Copyright: SAP
423
423
  License: Apache-2.0
424
424
  Comment: these files belong to: UI5 Web Components
@@ -452,11 +452,6 @@ Copyright: 2009-2014, Alexis Sellier <self@cloudhead.net>
452
452
  License: Apache-2.0
453
453
  Comment: these files belong to: LESS
454
454
 
455
- Files: ../test/sap/ui/integration/demokit/cardExplorer/webapp/thirdparty/ajv/ajv.min.js
456
- Copyright: 2015-2017 Evgeny Poberezkin
457
- License: MIT
458
- Comment: these files belong to: ajv
459
-
460
455
  Files: lib/jsdoc/ui5/plugin.js
461
456
  Copyright:
462
457
  2009-2021 SAP SE or an SAP affiliate company and OpenUI5 contributors
@@ -464,3 +459,8 @@ Copyright:
464
459
  License: Apache-2.0
465
460
  Comment: these files contain content from SAP and JSDoc 3: plugin.js is overall written by SAP, but contains code taken from JSDoc 3.6.7 (see the respective comments)
466
461
 
462
+ Files: src/sap.ui.core/src/sap/ui/core/themes/base/base.less src/themelib_sap_belize/src/sap/ui/core/themes/*/base.less src/themelib_sap_fiori_3/src/sap/ui/core/themes/*/base.less src/themelib_sap_horizon/src/sap/ui/core/themes/*/base.less
463
+ Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
464
+ License: Apache-2.0
465
+ Comment: these files belong to: SAP Theming Base Content
466
+
package/THIRDPARTY.txt CHANGED
@@ -6,7 +6,7 @@ The full text of all referenced licenses is appended at the end of this file.
6
6
 
7
7
  Library: sap.ui.codeeditor:
8
8
 
9
- Component: Ace (Ajax.org Cloud9 Editor), version: 1.4.4
9
+ Component: Ace (Ajax.org Cloud9 Editor), version: 1.4.13
10
10
  Copyright: 2010, Ajax.org B.V.
11
11
  License: BSD-3-Clause
12
12
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
@@ -197,7 +197,7 @@ License: BSD-3-Clause
197
197
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
198
198
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
199
199
 
200
- Component: URI.js, version: 1.19.6
200
+ Component: URI.js, version: 1.19.7
201
201
  Copyright: Rodney Rehm
202
202
  License: MIT
203
203
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
@@ -279,8 +279,8 @@ License: MIT
279
279
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
280
280
  Contained in: src/sap.ui.core/src/sap/ui/base/util/restricted/_/lodash.custom.js
281
281
 
282
- Component: Hyphenopoly, version: 2.4.0
283
- Copyright: 2018 Mathias Nater
282
+ Component: Hyphenopoly, version: 3.4.0
283
+ Copyright: 2021 Mathias Nater
284
284
  License: MIT
285
285
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
286
286
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/hyphenopoly/*
@@ -324,12 +324,6 @@ License: BSD-2-Clause
324
324
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-2-Clause.txt
325
325
  Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/esprima.js
326
326
 
327
- Component: google-code-prettify, version: 20130304
328
- Copyright: 2006 Google Inc.
329
- License: Apache-2.0
330
- License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
331
- Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/*
332
-
333
327
  Component: highlight.js, version: 10.4.1
334
328
  Copyright: 2006-2020, Ivan Sagalaev
335
329
  License: BSD-3-Clause
@@ -395,6 +389,12 @@ License: MIT
395
389
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
396
390
  Contained in: src/sap.ui.integration/src/sap/ui/integration/thirdparty/markdown-it.js
397
391
 
392
+ Component: ajv, version: 6.12.3
393
+ Copyright: 2015-2017 Evgeny Poberezkin
394
+ License: MIT
395
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
396
+ Contained in: src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/thirdparty/ajv/ajv.min.js
397
+
398
398
 
399
399
  Library: sap.ui.mdc:
400
400
 
@@ -412,10 +412,11 @@ Copyright: SAP
412
412
  License: Apache-2.0
413
413
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
414
414
  Contained in: src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/base/*.*
415
- src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/theme-base/*.*
415
+ src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/theming/*.*
416
416
  src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/localization/*.*
417
417
  src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons/*.*
418
418
  src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-tnt/*.*
419
+ src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-business-suite/*.*
419
420
 
420
421
  Component: lit-html, version: 1.4.1
421
422
  Copyright: Google LLC
@@ -450,18 +451,21 @@ License: Apache-2.0
450
451
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
451
452
  Contained in: src/testsuite-utils/src/main/resources/META-INF/less/less.js
452
453
 
453
- Component: ajv, version: 6.12.3
454
- Copyright: 2015-2017 Evgeny Poberezkin
455
- License: MIT
456
- License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
457
- Contained in: ../test/sap/ui/integration/demokit/cardExplorer/webapp/thirdparty/ajv/ajv.min.js
458
-
459
454
  Component: JSDoc 3, version: 3.6.7
460
455
  Copyright: 2011-present Michael Mathews micmath@gmail.com and the contributors to JSDoc
461
456
  License: Apache-2.0
462
457
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
463
458
  Contained in: lib/jsdoc/ui5/plugin.js
464
459
 
460
+ Component: SAP Theming Base Content, version: 11.1.34
461
+ Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
462
+ License: Apache-2.0
463
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
464
+ Contained in: src/sap.ui.core/src/sap/ui/core/themes/base/base.less
465
+ src/themelib_sap_belize/src/sap/ui/core/themes/*/base.less
466
+ src/themelib_sap_fiori_3/src/sap/ui/core/themes/*/base.less
467
+ src/themelib_sap_horizon/src/sap/ui/core/themes/*/base.less
468
+
465
469
 
466
470
  ALL LICENSE TEXTS:
467
471
  ==================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.dt",
3
- "version": "1.94.0",
3
+ "version": "1.97.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.dt",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,6 +14,6 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.ui.core": "1.94.0"
17
+ "@openui5/sap.ui.core": "1.97.0"
18
18
  }
19
19
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.94.0</version>
9
+ <version>1.97.0</version>
10
10
 
11
11
  <documentation>SAP UI library: sap.ui.dt (by SAP, Author)</documentation>
12
12
 
@@ -23,7 +23,7 @@ function (
23
23
  * @extends sap.ui.dt.DesignTimeMetadata
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.94.0
26
+ * @version 1.97.0
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -35,7 +35,7 @@ function(
35
35
  * @extends sap.ui.dt.Overlay
36
36
  *
37
37
  * @author SAP SE
38
- * @version 1.94.0
38
+ * @version 1.97.0
39
39
  *
40
40
  * @constructor
41
41
  * @private
@@ -22,7 +22,7 @@ function(ManagedObjectObserver) {
22
22
  * @extends sap.ui.dt.ManagedObjectObserver
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.94.0
25
+ * @version 1.97.0
26
26
  *
27
27
  * @constructor
28
28
  * @private
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * Utility functionality for DOM
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.94.0
26
+ * @version 1.97.0
27
27
  *
28
28
  * @private
29
29
  * @static
@@ -173,8 +173,8 @@ sap.ui.define([
173
173
 
174
174
  /**
175
175
  * Checks whether DOM Element has vertical or horizontal scrollbar
176
- * @param oDomRef {HTMLElement} - DOM Element
177
- * @returns {boolean}
176
+ * @param {HTMLElement} oDomRef - DOM element
177
+ * @returns {boolean} <code>true</code> if the DOM element has a scrollbar
178
178
  */
179
179
  DOMUtil.hasScrollBar = function(oDomRef) {
180
180
  return DOMUtil.hasVerticalScrollBar(oDomRef) || DOMUtil.hasHorizontalScrollBar(oDomRef);
@@ -217,7 +217,8 @@ sap.ui.define([
217
217
 
218
218
 
219
219
  /**
220
- * @param {HTMLElement} oDomRef
220
+ * @param {HTMLElement} oDomRef - DOM element
221
+ * @returns {object} Object with overflowX and overflowY
221
222
  */
222
223
  DOMUtil.getOverflows = function(oDomRef) {
223
224
  var $DomRef = jQuery(oDomRef);
@@ -438,8 +439,8 @@ sap.ui.define([
438
439
  /**
439
440
  * Check whether the target node is a descendant of a node referenced by id
440
441
  * @param {string} sId - ID of a potential parent node
441
- * @param oTargetNode - Node to look for in a potential parent node
442
- * @returns {boolean} - true if a potential parent contains the target node
442
+ * @param {HTMLElement} oTargetNode - Node to look for in a potential parent node
443
+ * @returns {boolean} <code>true</code> if a potential parent contains the target node
443
444
  */
444
445
  DOMUtil.contains = function (sId, oTargetNode) {
445
446
  var oNode = document.getElementById(sId);
@@ -25,7 +25,9 @@ sap.ui.define([
25
25
  "sap/ui/dt/SelectionMode",
26
26
  "sap/base/util/includes",
27
27
  "sap/ui/dt/DesignTimeStatus",
28
- "sap/base/util/restricted/_curry"
28
+ "sap/base/util/restricted/_curry",
29
+ "sap/base/util/restricted/_difference",
30
+ "sap/base/util/isEmptyObject"
29
31
  ],
30
32
  function (
31
33
  ManagedObject,
@@ -48,7 +50,9 @@ function (
48
50
  SelectionMode,
49
51
  includes,
50
52
  DesignTimeStatus,
51
- _curry
53
+ _curry,
54
+ _difference,
55
+ isEmptyObject
52
56
  ) {
53
57
  "use strict";
54
58
 
@@ -64,7 +68,7 @@ function (
64
68
  * @extends sap.ui.base.ManagedObject
65
69
  *
66
70
  * @author SAP SE
67
- * @version 1.94.0
71
+ * @version 1.97.0
68
72
  *
69
73
  * @constructor
70
74
  * @private
@@ -702,6 +706,7 @@ function (
702
706
  * @property {boolean} [root="true"] - Proxy for "isRoot" property of sap.ui.dt.ElementOverlay constructor
703
707
  * @property {object} [parentMetadata] - Map with metadata from the parent
704
708
  * @property {boolean} [visible] - Proxy for "visible" property of sap.ui.dt.ElementOverlay constructor
709
+ * @property {boolean} [isTemplate] - Marker that overlay is part of template
705
710
  * @private
706
711
  */
707
712
 
@@ -747,7 +752,7 @@ function (
747
752
  .then(
748
753
  // Fulfilled
749
754
  function (oElementOverlay) {
750
- return this._createChildren(oElementOverlay, mParams.parentMetadata)
755
+ return this._createChildren(oElementOverlay, mParams)
751
756
  .then(function () {
752
757
  // Remove overlay promise from the map only when it is "officially" available
753
758
  // and registered everywhere (OverlayRegistry, Plugins, etc)
@@ -929,24 +934,45 @@ function (
929
934
  }
930
935
 
931
936
  /**
932
- * Create children for specified ElementOverlay
937
+ * Creates children for specified ElementOverlay.
933
938
  * @param {sap.ui.dt.ElementOverlay} oElementOverlay - ElementOverlay to create children for
934
- * @param {object} [mParentAggregationMetadata] - Since children are being created for certain aggregation, this is an aggregation metadata.
935
- * @returns {Promise} - resolves when whole hierarchy of children for specified ElementOverlay is created
939
+ * @param {object} mParams - Property bag
940
+ * @param {object} [mParams.parentMetadata] - Parent aggregation metadata
941
+ * @param {boolean} [mParams.isTemplate] - Whether the overlay is part of an aggregation binding template
942
+ * @returns {Promise} Resolves when whole hierarchy of children for specified ElementOverlay is created
936
943
  * @private
937
944
  */
938
- DesignTime.prototype._createChildren = function (oElementOverlay, mParentAggregationMetadata) {
945
+ DesignTime.prototype._createChildren = function (oElementOverlay, mParams) {
939
946
  var aAggregationNames = oElementOverlay.getAggregationNames();
947
+ var mParentAggregationMetadata = mParams.parentMetadata;
940
948
  var mAggregationBindingTemplates = getAggregationBindingTemplates(oElementOverlay, aAggregationNames);
941
949
  var aTemplateAggregationNames = Object.keys(mAggregationBindingTemplates);
942
- return Promise.all([
943
- this._createChildrenOverlays(oElementOverlay, mParentAggregationMetadata, aTemplateAggregationNames, mAggregationBindingTemplates),
944
- this._createChildrenOverlays(oElementOverlay, mParentAggregationMetadata, aAggregationNames)
945
- ]);
950
+
951
+ // Consider each aggregation binding template which is not nested inside an existing template structure as a root template
952
+ // Separate root templates and their children from the instances of the root template as well as all nested template instances
953
+ var bEncounteredTemplate = mParams.isTemplate !== undefined;
954
+ var bHasTemplateAggregation = !isEmptyObject(mAggregationBindingTemplates);
955
+ var bIsRootTemplate = bHasTemplateAggregation && !bEncounteredTemplate;
956
+ var bIsTemplate = bIsRootTemplate ? true : mParams.isTemplate;
957
+ // Whether cloned instances are nested deeply in the root template structure
958
+ var bIsCloneInsideTemplate = bIsRootTemplate ? false : mParams.isTemplate;
959
+
960
+ // Avoid creating aggregation overlays for cloned template instances inside the template structure
961
+ if (bHasTemplateAggregation && bIsTemplate && !bIsRootTemplate) {
962
+ aAggregationNames = _difference(aAggregationNames, aTemplateAggregationNames);
963
+ }
964
+
965
+ return this._createChildrenOverlays(oElementOverlay, mParentAggregationMetadata, aTemplateAggregationNames, bIsTemplate, mAggregationBindingTemplates)
966
+ .then(this._createChildrenOverlays.bind(this, oElementOverlay, mParentAggregationMetadata, aAggregationNames, bIsCloneInsideTemplate));
946
967
  };
947
968
 
948
- DesignTime.prototype._createChildrenOverlays = function (oElementOverlay, mParentAggregationMetadata, aAggregationNames, mAggregationBindingTemplates) {
949
- var bIsTemplateAggregation = !!mAggregationBindingTemplates;
969
+ DesignTime.prototype._createChildrenOverlays = function (oElementOverlay, mParentAggregationMetadata, aAggregationNames, bIsTemplate, mAggregationBindingTemplates) {
970
+ var bIsTemplateAggregation = !isEmptyObject(mAggregationBindingTemplates);
971
+ // Nested template inside a clone of another template
972
+ if (bIsTemplateAggregation && !bIsTemplate) {
973
+ return Promise.resolve();
974
+ }
975
+
950
976
  return Promise.all(
951
977
  aAggregationNames.map(function (sAggregationName) {
952
978
  var oElement = oElementOverlay.getElement();
@@ -975,7 +1001,8 @@ function (
975
1001
  return this.createOverlay({
976
1002
  element: oElement,
977
1003
  root: false,
978
- parentMetadata: mAggregationMetadata
1004
+ parentMetadata: mAggregationMetadata,
1005
+ isTemplate: bIsTemplate
979
1006
  })
980
1007
  // If creation of one of the children is aborted, we still continue our execution
981
1008
  .catch(function (oError) {
@@ -989,6 +1016,7 @@ function (
989
1016
  if (
990
1017
  oChildElementOverlay instanceof ElementOverlay
991
1018
  && !oChildElementOverlay.bIsDestroyed
1019
+ && !oChildElementOverlay.getParent()
992
1020
  ) {
993
1021
  oAggregationOverlay.addChild(oChildElementOverlay, true);
994
1022
  }
@@ -46,7 +46,7 @@ function(
46
46
  * @extends sap.ui.base.ManagedObject
47
47
  *
48
48
  * @author SAP SE
49
- * @version 1.94.0
49
+ * @version 1.97.0
50
50
  *
51
51
  * @constructor
52
52
  * @private
@@ -9,8 +9,7 @@ sap.ui.define([
9
9
  "sap/ui/dt/DesignTimeMetadata",
10
10
  "sap/ui/dt/AggregationDesignTimeMetadata",
11
11
  "sap/ui/dt/ElementUtil"
12
- ],
13
- function(
12
+ ], function(
14
13
  DesignTimeMetadata,
15
14
  AggregationDesignTimeMetadata,
16
15
  ElementUtil
@@ -28,7 +27,7 @@ function(
28
27
  * @extends sap.ui.dt.DesignTimeMetadata
29
28
  *
30
29
  * @author SAP SE
31
- * @version 1.94.0
30
+ * @version 1.97.0
32
31
  *
33
32
  * @constructor
34
33
  * @private
@@ -252,6 +251,9 @@ function(
252
251
  /**
253
252
  * Returns the scroll containers or an empty array
254
253
  *
254
+ * @param {object} oElement - Element
255
+ * @param {boolean} bInvalidate - Indicates if the scroll container should be invalidated first
256
+ * @param {function} fnUpdateFunction - Function to be called for update
255
257
  * @return {array} scrollContainers or empty array
256
258
  * @public
257
259
  */
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  * @extends sap.ui.dt.Overlay
56
56
  *
57
57
  * @author SAP SE
58
- * @version 1.94.0
58
+ * @version 1.97.0
59
59
  *
60
60
  * @constructor
61
61
  * @private
@@ -124,6 +124,13 @@ sap.ui.define([
124
124
  },
125
125
  metadataScope: {
126
126
  type: "string"
127
+ },
128
+ /**
129
+ * Whether the next KeyUp event on the overlay should be ignored (e.g. for Rename)
130
+ */
131
+ ignoreEnterKeyUpOnce: {
132
+ type: "boolean",
133
+ defaultValue: false
127
134
  }
128
135
  },
129
136
  events: {
@@ -414,6 +421,7 @@ sap.ui.define([
414
421
 
415
422
  /**
416
423
  * Sorts children DOM Nodes in their visual order
424
+ * @param {object} oContainer - Container object whose children should be sorted
417
425
  * @private
418
426
  */
419
427
  ElementOverlay.prototype._sortChildren = function(oContainer) {
@@ -566,7 +574,8 @@ sap.ui.define([
566
574
 
567
575
  /**
568
576
  * Gets information about scroll containers from DesignTime metadata
569
- * @returns {object[]} - returns an array with scroll containers description
577
+ * @param {boolean} bInvalidate - Indicates if the scroll container should be invalidated first
578
+ * @returns {object[]} Array with the scroll container's description
570
579
  */
571
580
  ElementOverlay.prototype.getScrollContainers = function (bInvalidate) {
572
581
  return this.getDesignTimeMetadata().getScrollContainers(this.getElement(), bInvalidate, this._updateScrollContainer.bind(this));
@@ -9,15 +9,16 @@ sap.ui.define([
9
9
  "sap/ui/thirdparty/jquery",
10
10
  "sap/ui/base/Object",
11
11
  "sap/ui/dt/Util",
12
+ "sap/ui/dt/DOMUtil",
12
13
  "sap/ui/core/Element",
13
14
  "sap/ui/core/Component",
14
15
  "sap/base/util/isPlainObject",
15
16
  "sap/ui/core/UIArea"
16
- ],
17
- function(
17
+ ], function(
18
18
  jQuery,
19
19
  BaseObject,
20
20
  Util,
21
+ DOMUtil,
21
22
  Element,
22
23
  Component,
23
24
  isPlainObject,
@@ -31,7 +32,7 @@ function(
31
32
  * @class Utility functionality to work with elements, e.g. iterate through aggregations, find parents, ...
32
33
  *
33
34
  * @author SAP SE
34
- * @version 1.94.0
35
+ * @version 1.97.0
35
36
  *
36
37
  * @private
37
38
  * @static
@@ -55,9 +56,6 @@ function(
55
56
  }, this);
56
57
  };
57
58
 
58
- /**
59
- *
60
- */
61
59
  ElementUtil.getElementInstance = function(vElement) {
62
60
  if (typeof vElement === "string") {
63
61
  var oElement = sap.ui.getCore().byId(vElement);
@@ -66,9 +64,6 @@ function(
66
64
  return vElement;
67
65
  };
68
66
 
69
- /**
70
- *
71
- */
72
67
  ElementUtil.hasAncestor = function(oElement, oAncestor) {
73
68
  oAncestor = this.fixComponentContainerElement(oAncestor);
74
69
  var oFixedParent;
@@ -86,17 +81,11 @@ function(
86
81
  return !!oElement;
87
82
  };
88
83
 
89
- /**
90
- *
91
- */
92
84
  ElementUtil.getClosestElementForNode = function(oNode) {
93
85
  var $ClosestElement = jQuery(oNode).closest("[data-sap-ui]");
94
86
  return $ClosestElement.length ? sap.ui.getCore().byId($ClosestElement.attr("data-sap-ui")) : undefined;
95
87
  };
96
88
 
97
- /**
98
- *
99
- */
100
89
  ElementUtil.fixComponentParent = function(oElement) {
101
90
  if (BaseObject.isA(oElement, "sap.ui.core.UIComponent")) {
102
91
  var oComponentContainer = oElement.oContainer;
@@ -108,9 +97,6 @@ function(
108
97
  }
109
98
  };
110
99
 
111
- /**
112
- *
113
- */
114
100
  ElementUtil.fixComponentContainerElement = function(oElement) {
115
101
  if (BaseObject.isA(oElement, "sap.ui.core.ComponentContainer")) {
116
102
  // This happens when the compontentContainer has not been rendered yet
@@ -122,9 +108,6 @@ function(
122
108
  return oElement;
123
109
  };
124
110
 
125
- /**
126
- *
127
- */
128
111
  ElementUtil.getDomRef = function(oElement) {
129
112
  if (oElement) {
130
113
  var oDomRef;
@@ -138,9 +121,6 @@ function(
138
121
  }
139
122
  };
140
123
 
141
- /**
142
- *
143
- */
144
124
  ElementUtil.findAllSiblingsInContainer = function(oElement, oContainer) {
145
125
  var oParent = oElement && oElement.getParent();
146
126
  if (!oParent) {
@@ -209,9 +189,6 @@ function(
209
189
  return this.getAggregation(oParent, sAggregationName).indexOf(oElement);
210
190
  };
211
191
 
212
- /**
213
- *
214
- */
215
192
  ElementUtil.addAggregation = function(oParent, sAggregationName, oElement) {
216
193
  if (this.hasAncestor(oParent, oElement)) {
217
194
  throw new Error("Trying to add an element to itself or its successors");
@@ -224,9 +201,6 @@ function(
224
201
  }
225
202
  };
226
203
 
227
- /**
228
- *
229
- */
230
204
  ElementUtil.removeAggregation = function(oParent, sAggregationName, oElement, bSuppressInvalidate) {
231
205
  var sAggregationRemoveMutator = this.getAggregationAccessors(oParent, sAggregationName).remove;
232
206
  if (sAggregationRemoveMutator) {
@@ -236,9 +210,6 @@ function(
236
210
  }
237
211
  };
238
212
 
239
- /**
240
- *
241
- */
242
213
  ElementUtil.insertAggregation = function(oParent, sAggregationName, oElement, iIndex) {
243
214
  if (this.hasAncestor(oParent, oElement)) {
244
215
  throw new Error("Trying to add an element to itself or its successors");
@@ -263,9 +234,6 @@ function(
263
234
  }
264
235
  };
265
236
 
266
- /**
267
- *
268
- */
269
237
  ElementUtil.isValidForAggregation = function(oParent, sAggregationName, oElement) {
270
238
  var oAggregationMetadata = oParent.getMetadata().getAggregation(sAggregationName);
271
239
 
@@ -327,9 +295,6 @@ function(
327
295
  }, this);
328
296
  };
329
297
 
330
- /**
331
- *
332
- */
333
298
  ElementUtil.hasInterface = function(oElement, sInterface) {
334
299
  var aInterfaces = oElement.getMetadata().getInterfaces();
335
300
  return aInterfaces.indexOf(sInterface) !== -1;
@@ -355,6 +320,27 @@ function(
355
320
  return true;
356
321
  };
357
322
 
323
+ /**
324
+ * Checks whether specified Element is a direct template clone (e.g. the list items of a sap.m.ListItem)
325
+ *
326
+ * @param {sap.ui.base.Object} oObject - Object for validation
327
+ * @returns {boolean} <code>true</code> if object is a direct clone of the template
328
+ */
329
+ ElementUtil.isElementDirectTemplateChild = function (oObject) {
330
+ var mLocationInTemplate = ElementUtil.getAggregationInformation(oObject);
331
+
332
+ if (mLocationInTemplate.templateId) {
333
+ var sTemplateId = ElementUtil.extractTemplateId(mLocationInTemplate);
334
+
335
+ // If the stack only has one element, this element is a direct child of the template aggregation
336
+ if (sTemplateId && mLocationInTemplate.stack.length === 1) {
337
+ return true;
338
+ }
339
+ }
340
+
341
+ return false;
342
+ };
343
+
358
344
  /**
359
345
  * Checks whether specified Element is a valid ManagedObject. The allowed objects must be
360
346
  * descendants of sap.ui.core.Element or sap.ui.core.Component classes.
@@ -548,5 +534,54 @@ function(
548
534
  return iTargetIndex;
549
535
  };
550
536
 
537
+ /**
538
+ * Checks if an aggregation is valid for an element being moved
539
+ *
540
+ * @param {sap.ui.dt.AggregationOverlay} oAggregationOverlay - Aggregation overlay to be checked for target zone
541
+ * @param {sap.ui.dt.ElementOverlay} oMovedOverlay - Overlay being moved
542
+ * @param {boolean} bOverlayNotInDom - Flag defining if overlay is not in DOM
543
+ * @returns {Promise.<boolean>} Resolved promise with <code>true</code> if the aggregation overlay is a valid target zone for the overlay
544
+ */
545
+ ElementUtil.checkTargetZone = function(oAggregationOverlay, oMovedOverlay, bOverlayNotInDom) {
546
+ var oGeometry = oAggregationOverlay.getGeometry();
547
+ var bGeometryVisible = oGeometry && oGeometry.size.height > 0 && oGeometry.size.width > 0;
548
+ var oParentElement = oAggregationOverlay.getElement();
549
+
550
+ var oMovedElement = oMovedOverlay.getElement();
551
+ var sAggregationName = oAggregationOverlay.getAggregationName();
552
+ if (!oMovedElement || !ElementUtil.isValidForAggregation(oParentElement, sAggregationName, oMovedElement)) {
553
+ return Promise.resolve(false);
554
+ }
555
+
556
+ // checks related to visibility
557
+ function fnCheckAggregationOverlayVisibility(oAggregationOverlay, oParentElement) {
558
+ // this function can get called on overlay registration, when there are no overlays in dom yet. In this case, DOMUtil.isVisible is always false.
559
+ var oAggregationOverlayDomRef = oAggregationOverlay.getDomRef();
560
+ var bAggregationOverlayVisibility = DOMUtil.isVisible(oAggregationOverlayDomRef);
561
+
562
+ // if there is no aggregation overlay domRef available the further check for domRef of the corresponding element is not required
563
+ if (!oAggregationOverlayDomRef) {
564
+ return bAggregationOverlayVisibility;
565
+ }
566
+ // additional check for corresponding element DomRef visibiltiy required for target zone checks during navigation mode.
567
+ // during navigation mode the domRef of valid overlays is given and the offsetWidth is 0. Therefor we need to check the visibility of the corresponding element additionally
568
+ var oParentElementDomRef = oParentElement && oParentElement.getDomRef && oParentElement.getDomRef();
569
+ var bAggregationElementVisibility = oParentElementDomRef ? DOMUtil.isVisible(oParentElementDomRef) : true;
570
+ return bAggregationOverlayVisibility || bAggregationElementVisibility;
571
+ }
572
+
573
+ if (
574
+ (bOverlayNotInDom && !bGeometryVisible)
575
+ || !bOverlayNotInDom && !fnCheckAggregationOverlayVisibility(oAggregationOverlay, oParentElement)
576
+ || !(oParentElement && oParentElement.getVisible && oParentElement.getVisible())
577
+ // an aggregation can still have visible = true even if it has been removed from its parent
578
+ || !oParentElement.getParent()
579
+ ) {
580
+ return Promise.resolve(false);
581
+ }
582
+
583
+ return Promise.resolve(true);
584
+ };
585
+
551
586
  return ElementUtil;
552
587
  }, /* bExport= */true);