@openui5/sap.ui.dt 1.108.0 → 1.109.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/THIRDPARTY.txt +1 -1
- package/package.json +2 -2
- package/src/sap/ui/dt/.library +1 -1
- package/src/sap/ui/dt/AggregationDesignTimeMetadata.js +1 -1
- package/src/sap/ui/dt/AggregationOverlay.js +14 -9
- package/src/sap/ui/dt/ControlObserver.js +1 -1
- package/src/sap/ui/dt/DOMUtil.js +61 -96
- package/src/sap/ui/dt/DesignTime.js +1 -1
- package/src/sap/ui/dt/DesignTimeMetadata.js +1 -1
- package/src/sap/ui/dt/ElementDesignTimeMetadata.js +1 -1
- package/src/sap/ui/dt/ElementOverlay.js +1 -1
- package/src/sap/ui/dt/ElementUtil.js +3 -5
- package/src/sap/ui/dt/ManagedObjectObserver.js +1 -1
- package/src/sap/ui/dt/MetadataPropagationUtil.js +1 -1
- package/src/sap/ui/dt/MutationObserver.js +1 -1
- package/src/sap/ui/dt/Overlay.js +1 -1
- package/src/sap/ui/dt/OverlayRegistry.js +3 -3
- package/src/sap/ui/dt/OverlayUtil.js +1 -1
- package/src/sap/ui/dt/Plugin.js +1 -1
- package/src/sap/ui/dt/ScrollbarSynchronizer.js +1 -1
- package/src/sap/ui/dt/SelectionManager.js +1 -1
- package/src/sap/ui/dt/SelectionMode.js +1 -1
- package/src/sap/ui/dt/TaskManager.js +1 -1
- package/src/sap/ui/dt/TaskRunner.js +1 -1
- package/src/sap/ui/dt/Util.js +1 -14
- package/src/sap/ui/dt/enablement/ElementEnablementTest.js +9 -10
- package/src/sap/ui/dt/enablement/Test.js +1 -1
- package/src/sap/ui/dt/enablement/Util.js +1 -1
- package/src/sap/ui/dt/enablement/report/LibraryReport.js +1 -1
- package/src/sap/ui/dt/enablement/report/QUnitReport.js +1 -1
- package/src/sap/ui/dt/enablement/report/Statistic.js +1 -1
- package/src/sap/ui/dt/enablement/report/StatisticRenderer.js +1 -1
- package/src/sap/ui/dt/enablement/report/Table.js +1 -1
- package/src/sap/ui/dt/enablement/report/TableRenderer.js +1 -1
- package/src/sap/ui/dt/library.js +2 -2
- package/src/sap/ui/dt/plugin/ContextMenu.js +1 -1
- package/src/sap/ui/dt/plugin/ControlDragDrop.js +1 -1
- package/src/sap/ui/dt/plugin/CutPaste.js +1 -1
- package/src/sap/ui/dt/plugin/DragDrop.js +26 -34
- package/src/sap/ui/dt/plugin/ElementMover.js +1 -1
- package/src/sap/ui/dt/plugin/MouseSelection.js +1 -1
- package/src/sap/ui/dt/plugin/TabHandling.js +8 -12
- package/src/sap/ui/dt/plugin/ToolHooks.js +1 -1
- package/src/sap/ui/dt/themes/base/ContextMenu.less +1 -0
- package/src/sap/ui/dt/util/ZIndexManager.js +1 -1
package/THIRDPARTY.txt
CHANGED
|
@@ -478,7 +478,7 @@ License: Apache-2.0
|
|
|
478
478
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
479
479
|
Contained in: lib/jsdoc/ui5/plugin.js
|
|
480
480
|
|
|
481
|
-
Component: SAP Theming Base Content, version: 11.1.
|
|
481
|
+
Component: SAP Theming Base Content, version: 11.1.44
|
|
482
482
|
Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
|
|
483
483
|
License: Apache-2.0
|
|
484
484
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.dt",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.109.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.
|
|
17
|
+
"@openui5/sap.ui.core": "1.109.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/src/sap/ui/dt/.library
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.109.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAP UI library: sap.ui.dt (by SAP, Author)</documentation>
|
|
12
12
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
// Provides class sap.ui.dt.AggregationOverlay.
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"sap/ui/thirdparty/jquery",
|
|
10
9
|
"sap/ui/dt/Overlay",
|
|
11
10
|
"sap/ui/dt/ElementUtil",
|
|
12
11
|
"sap/ui/dt/OverlayUtil",
|
|
@@ -14,7 +13,6 @@ sap.ui.define([
|
|
|
14
13
|
"sap/base/util/merge"
|
|
15
14
|
],
|
|
16
15
|
function(
|
|
17
|
-
jQuery,
|
|
18
16
|
Overlay,
|
|
19
17
|
ElementUtil,
|
|
20
18
|
OverlayUtil,
|
|
@@ -35,7 +33,7 @@ function(
|
|
|
35
33
|
* @extends sap.ui.dt.Overlay
|
|
36
34
|
*
|
|
37
35
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
36
|
+
* @version 1.109.0
|
|
39
37
|
*
|
|
40
38
|
* @constructor
|
|
41
39
|
* @private
|
|
@@ -145,24 +143,31 @@ function(
|
|
|
145
143
|
if (this.isRendered()) {
|
|
146
144
|
var iPositionInDom = this._getChildIndex(oChild);
|
|
147
145
|
var bChildRendered = oChild.isRendered();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
|
|
147
|
+
if (!bChildRendered) {
|
|
148
|
+
var oRenderResult = oChild.render(true);
|
|
149
|
+
//TODO: change when renderer does not return jquery object any more!
|
|
150
|
+
oRenderResult = oRenderResult.jquery ? oRenderResult.get(0) : oRenderResult;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var oChildDOM = bChildRendered ? oChild.getDomRef() : oRenderResult;
|
|
154
|
+
var aChildren = this.getChildrenDomRef().children;
|
|
155
|
+
var iCurrentPosition = [].indexOf.call(aChildren, oChildDOM);
|
|
151
156
|
var iInsertIndex;
|
|
152
157
|
|
|
153
158
|
if (iCurrentPosition !== iPositionInDom) {
|
|
154
159
|
if (iPositionInDom > 0) {
|
|
155
160
|
iInsertIndex = iCurrentPosition > -1 && iCurrentPosition < iPositionInDom ? iPositionInDom : iPositionInDom - 1;
|
|
156
|
-
|
|
161
|
+
aChildren[iInsertIndex].after(oChildDOM);
|
|
157
162
|
} else {
|
|
158
163
|
iInsertIndex = iPositionInDom; // === 0
|
|
159
|
-
|
|
164
|
+
this.getChildrenDomRef().prepend(oChildDOM);
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
if (!bChildRendered) {
|
|
164
169
|
oChild.fireAfterRendering({
|
|
165
|
-
domRef:
|
|
170
|
+
domRef: oChildDOM
|
|
166
171
|
});
|
|
167
172
|
}
|
|
168
173
|
}
|
package/src/sap/ui/dt/DOMUtil.js
CHANGED
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
*
|
|
24
24
|
* @namespace
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.109.0
|
|
27
27
|
*
|
|
28
28
|
* @private
|
|
29
29
|
* @since 1.30
|
|
@@ -33,6 +33,21 @@ sap.ui.define([
|
|
|
33
33
|
|
|
34
34
|
var DOMUtil = {};
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Returns the offset for an element
|
|
38
|
+
* Replaces the jQuery method offset
|
|
39
|
+
* @param {HTMLElement} oElement - Element
|
|
40
|
+
* @returns {PositionObject} the calculated offset containing left and top values
|
|
41
|
+
*/
|
|
42
|
+
DOMUtil.getOffset = function(oElement) {
|
|
43
|
+
var oBox = oElement.getBoundingClientRect();
|
|
44
|
+
var oDocElement = document.documentElement;
|
|
45
|
+
return {
|
|
46
|
+
top: oBox.top + window.scrollY - oDocElement.clientTop,
|
|
47
|
+
left: oBox.left + window.scrollX - oDocElement.clientLeft
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
36
51
|
DOMUtil.getSize = function(oDomRef) {
|
|
37
52
|
var oClientRec = oDomRef.getBoundingClientRect();
|
|
38
53
|
return {
|
|
@@ -58,10 +73,10 @@ sap.ui.define([
|
|
|
58
73
|
* @returns {PositionObject} the calculated offset containing left and top values
|
|
59
74
|
*/
|
|
60
75
|
DOMUtil.getOffsetFromParent = function(oGeometry, oParent) {
|
|
61
|
-
var
|
|
62
|
-
var iScrollTop = $Parent ? $Parent.scrollTop() : null;
|
|
76
|
+
var iScrollTop = oParent ? oParent.scrollTop : null;
|
|
63
77
|
var iScrollLeft = oParent ? DOMUtil.getScrollLeft(oParent) : null;
|
|
64
|
-
|
|
78
|
+
|
|
79
|
+
var mParentOffset = oParent ? this.getOffset(oParent) : null;
|
|
65
80
|
|
|
66
81
|
var mOffset = {
|
|
67
82
|
left: oGeometry.position.left,
|
|
@@ -74,9 +89,9 @@ sap.ui.define([
|
|
|
74
89
|
}
|
|
75
90
|
|
|
76
91
|
if (Configuration.getRTL()) {
|
|
77
|
-
var iParentWidth =
|
|
92
|
+
var iParentWidth = oParent ? oParent.offsetWidth : window.innerWidth;
|
|
78
93
|
//TODO: Workaround - remove when bug in Safari (issue 336512063) is solved
|
|
79
|
-
if (Device.browser.safari && !Device.browser.mobile && DOMUtil.hasVerticalScrollBar(
|
|
94
|
+
if (Device.browser.safari && !Device.browser.mobile && DOMUtil.hasVerticalScrollBar(oParent)) {
|
|
80
95
|
mOffset.left -= DOMUtil.getScrollbarWidth();
|
|
81
96
|
}
|
|
82
97
|
// Workaround end
|
|
@@ -99,7 +114,7 @@ sap.ui.define([
|
|
|
99
114
|
!Configuration.getRTL()
|
|
100
115
|
|| !DOMUtil.hasHorizontalScrollBar(oElement)
|
|
101
116
|
) {
|
|
102
|
-
return
|
|
117
|
+
return oElement.scrollLeft;
|
|
103
118
|
}
|
|
104
119
|
|
|
105
120
|
var iScrollLeftRTL = jQuery(oElement).scrollLeftRTL();
|
|
@@ -154,9 +169,8 @@ sap.ui.define([
|
|
|
154
169
|
* @returns {boolean} <code>true</code> if vertical scrollbar is available on DOM Element.
|
|
155
170
|
*/
|
|
156
171
|
DOMUtil.hasVerticalScrollBar = function(oDomRef) {
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
return bOverflowYScroll && $DomRef.get(0).scrollHeight > DOMUtil._getElementHeight(oDomRef);
|
|
172
|
+
var bOverflowYScroll = window.getComputedStyle(oDomRef)["overflow-y"] === "auto" || window.getComputedStyle(oDomRef)["overflow-y"] === "scroll";
|
|
173
|
+
return bOverflowYScroll && oDomRef.scrollHeight > DOMUtil._getElementHeight(oDomRef);
|
|
160
174
|
};
|
|
161
175
|
|
|
162
176
|
/**
|
|
@@ -165,9 +179,8 @@ sap.ui.define([
|
|
|
165
179
|
* @returns {boolean} <code>true</code> if horizontal scrollbar is available on DOM Element
|
|
166
180
|
*/
|
|
167
181
|
DOMUtil.hasHorizontalScrollBar = function (oDomRef) {
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
return bOverflowXScroll && $DomRef.get(0).scrollWidth > DOMUtil._getElementWidth(oDomRef);
|
|
182
|
+
var bOverflowXScroll = window.getComputedStyle(oDomRef)["overflow-x"] === "auto" || window.getComputedStyle(oDomRef)["overflow-x"] === "scroll";
|
|
183
|
+
return bOverflowXScroll && oDomRef.scrollWidth > DOMUtil._getElementWidth(oDomRef);
|
|
171
184
|
};
|
|
172
185
|
|
|
173
186
|
/**
|
|
@@ -186,24 +199,22 @@ sap.ui.define([
|
|
|
186
199
|
DOMUtil.getScrollbarWidth = function() {
|
|
187
200
|
if (typeof DOMUtil.getScrollbarWidth._cache === 'undefined') {
|
|
188
201
|
// add outer div
|
|
189
|
-
var oOuter =
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var iWidthNoScroll = oOuter.width();
|
|
199
|
-
oOuter.css('overflow', 'scroll');
|
|
202
|
+
var oOuter = document.createElement("div");
|
|
203
|
+
oOuter.style.position = "absolute";
|
|
204
|
+
oOuter.style.top = "-9999px";
|
|
205
|
+
oOuter.style.left = "-9999px";
|
|
206
|
+
oOuter.style.width = "100px";
|
|
207
|
+
document.body.append(oOuter);
|
|
208
|
+
|
|
209
|
+
var iWidthNoScroll = oOuter.offsetWidth;
|
|
210
|
+
oOuter.style.overflow = "scroll";
|
|
200
211
|
|
|
201
212
|
// add inner div
|
|
202
|
-
var oInner =
|
|
203
|
-
|
|
204
|
-
|
|
213
|
+
var oInner = document.createElement("div");
|
|
214
|
+
oInner.style.width = "100%";
|
|
215
|
+
oOuter.append(oInner);
|
|
205
216
|
|
|
206
|
-
var iWidthWithScroll = oInner.
|
|
217
|
+
var iWidthWithScroll = oInner.offsetWidth;
|
|
207
218
|
|
|
208
219
|
// clean up
|
|
209
220
|
oOuter.remove();
|
|
@@ -220,20 +231,18 @@ sap.ui.define([
|
|
|
220
231
|
* @returns {object} Object with overflowX and overflowY
|
|
221
232
|
*/
|
|
222
233
|
DOMUtil.getOverflows = function(oDomRef) {
|
|
223
|
-
var $DomRef = jQuery(oDomRef);
|
|
224
|
-
|
|
225
234
|
return {
|
|
226
|
-
overflowX:
|
|
227
|
-
overflowY:
|
|
235
|
+
overflowX: window.getComputedStyle(oDomRef)["overflow-x"],
|
|
236
|
+
overflowY: window.getComputedStyle(oDomRef)["overflow-y"]
|
|
228
237
|
};
|
|
229
238
|
};
|
|
230
239
|
|
|
231
240
|
DOMUtil.getGeometry = function(oDomRef, bUseWindowOffset) {
|
|
232
241
|
if (oDomRef) {
|
|
233
|
-
var oOffset =
|
|
242
|
+
var oOffset = this.getOffset(oDomRef);
|
|
234
243
|
if (bUseWindowOffset) {
|
|
235
|
-
oOffset.left = oOffset.left -
|
|
236
|
-
oOffset.top = oOffset.top -
|
|
244
|
+
oOffset.left = oOffset.left - window.scrollX;
|
|
245
|
+
oOffset.top = oOffset.top - window.scrollY;
|
|
237
246
|
}
|
|
238
247
|
|
|
239
248
|
return {
|
|
@@ -246,19 +255,17 @@ sap.ui.define([
|
|
|
246
255
|
};
|
|
247
256
|
|
|
248
257
|
DOMUtil.syncScroll = function(oSourceDom, oTargetDom) {
|
|
249
|
-
var
|
|
250
|
-
var
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
var $source = jQuery(oSourceDom);
|
|
254
|
-
var oSourceScrollTop = $source.scrollTop();
|
|
255
|
-
var oSourceScrollLeft = $source.scrollLeft();
|
|
258
|
+
var oTargetScrollTop = oTargetDom.scrollTop;
|
|
259
|
+
var oTargetScrollLeft = oTargetDom.scrollLeft;
|
|
260
|
+
var oSourceScrollTop = oSourceDom.scrollTop;
|
|
261
|
+
var oSourceScrollLeft = oSourceDom.scrollLeft;
|
|
256
262
|
|
|
257
263
|
if (oSourceScrollTop !== oTargetScrollTop) {
|
|
258
|
-
|
|
264
|
+
oTargetDom.scrollTop = oSourceScrollTop;
|
|
259
265
|
}
|
|
266
|
+
|
|
260
267
|
if (oSourceScrollLeft !== oTargetScrollLeft) {
|
|
261
|
-
|
|
268
|
+
oTargetDom.scrollLeft = oSourceScrollLeft;
|
|
262
269
|
}
|
|
263
270
|
};
|
|
264
271
|
|
|
@@ -379,8 +386,6 @@ sap.ui.define([
|
|
|
379
386
|
};
|
|
380
387
|
|
|
381
388
|
DOMUtil.copyComputedStyle = function(oSrc, oDest) {
|
|
382
|
-
oSrc = jQuery(oSrc).get(0);
|
|
383
|
-
oDest = jQuery(oDest).get(0);
|
|
384
389
|
var mStyles = window.getComputedStyle(oSrc);
|
|
385
390
|
|
|
386
391
|
if (mStyles.getPropertyValue("display") === "none") {
|
|
@@ -395,32 +400,27 @@ sap.ui.define([
|
|
|
395
400
|
};
|
|
396
401
|
|
|
397
402
|
DOMUtil.copyComputedStyles = function(oSrc, oDest) {
|
|
398
|
-
oSrc = jQuery(oSrc).get(0);
|
|
399
|
-
oDest = jQuery(oDest).get(0);
|
|
400
|
-
|
|
401
403
|
for (var i = 0; i < oSrc.children.length; i++) {
|
|
402
404
|
this.copyComputedStyles(oSrc.children[i], oDest.children[i]);
|
|
403
405
|
}
|
|
404
406
|
|
|
405
407
|
// we shouldn't copy classes because they can affect styling
|
|
406
|
-
|
|
408
|
+
oDest.removeAttribute("class");
|
|
407
409
|
// remove all special attributes, which can affect app behaviour
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
oDest.setAttribute("id", "");
|
|
411
|
+
oDest.setAttribute("role", "");
|
|
412
|
+
oDest.setAttribute("data-sap-ui", "");
|
|
413
|
+
oDest.setAttribute("for", "");
|
|
414
|
+
oDest.setAttribute("tabindex", -1);
|
|
412
415
|
|
|
413
|
-
jQuery(oDest).attr("tabindex", -1);
|
|
414
416
|
this.copyComputedStyle(oSrc, oDest);
|
|
415
417
|
};
|
|
416
418
|
|
|
417
419
|
DOMUtil.cloneDOMAndStyles = function(oNode, oTarget) {
|
|
418
|
-
oNode = jQuery(oNode).get(0);
|
|
419
|
-
|
|
420
420
|
var oCopy = oNode.cloneNode(true);
|
|
421
421
|
this.copyComputedStyles(oNode, oCopy);
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
oTarget.append(oCopy);
|
|
424
424
|
};
|
|
425
425
|
|
|
426
426
|
/**
|
|
@@ -441,46 +441,11 @@ sap.ui.define([
|
|
|
441
441
|
*/
|
|
442
442
|
DOMUtil.appendChild = function (oTargetNode, oChildNode) {
|
|
443
443
|
var iScrollTop = oChildNode.scrollTop;
|
|
444
|
-
var iScrollLeft =
|
|
444
|
+
var iScrollLeft = oChildNode.scrollLeft;
|
|
445
445
|
oTargetNode.appendChild(oChildNode);
|
|
446
446
|
oChildNode.scrollTop = iScrollTop;
|
|
447
|
-
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Set the Focus to the DOM Element without scrolling
|
|
452
|
-
* @param {HTMLElement} oTargetNode - Target node to whom focus should be set
|
|
453
|
-
*/
|
|
454
|
-
DOMUtil.focusWithoutScrolling = function (oTargetNode) {
|
|
455
|
-
// Only for Newer Devices
|
|
456
|
-
if (Device.browser.name !== "ie") {
|
|
457
|
-
oTargetNode.focus({preventScroll: true});
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
var aScrollHierarchy = [];
|
|
462
|
-
var oParentNode = oTargetNode.parentNode;
|
|
463
|
-
|
|
464
|
-
while (oParentNode) {
|
|
465
|
-
aScrollHierarchy.push([oParentNode, jQuery(oParentNode).scrollLeft(), oParentNode.scrollTop]);
|
|
466
|
-
oParentNode = oParentNode.parentNode;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
oTargetNode.focus();
|
|
470
|
-
|
|
471
|
-
aScrollHierarchy.forEach(function (oItem) {
|
|
472
|
-
var oElementNode = oItem[0];
|
|
473
|
-
|
|
474
|
-
// Check first to avoid triggering unnecessary `scroll` events
|
|
475
|
-
if (jQuery(oElementNode).scrollLeft() !== oItem[1]) {
|
|
476
|
-
jQuery(oElementNode).scrollLeft(oItem[1]);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
if (oElementNode.scrollTop !== oItem[2]) {
|
|
480
|
-
oElementNode.scrollTop = oItem[2];
|
|
481
|
-
}
|
|
482
|
-
});
|
|
447
|
+
oChildNode.scrollLeft = iScrollLeft;
|
|
483
448
|
};
|
|
484
449
|
|
|
485
450
|
return DOMUtil;
|
|
486
|
-
}, /* bExport= */ true);
|
|
451
|
+
}, /* bExport= */ true);
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
// Provides object sap.ui.dt.ElementUtil.
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"sap/ui/thirdparty/jquery",
|
|
10
9
|
"sap/ui/base/Object",
|
|
11
10
|
"sap/ui/dt/Util",
|
|
12
11
|
"sap/ui/dt/DOMUtil",
|
|
@@ -15,7 +14,6 @@ sap.ui.define([
|
|
|
15
14
|
"sap/base/util/isPlainObject",
|
|
16
15
|
"sap/ui/core/UIArea"
|
|
17
16
|
], function(
|
|
18
|
-
jQuery,
|
|
19
17
|
BaseObject,
|
|
20
18
|
Util,
|
|
21
19
|
DOMUtil,
|
|
@@ -31,7 +29,7 @@ sap.ui.define([
|
|
|
31
29
|
*
|
|
32
30
|
* @namespace
|
|
33
31
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
32
|
+
* @version 1.109.0
|
|
35
33
|
*
|
|
36
34
|
* @private
|
|
37
35
|
* @since 1.30
|
|
@@ -80,8 +78,8 @@ sap.ui.define([
|
|
|
80
78
|
};
|
|
81
79
|
|
|
82
80
|
ElementUtil.getClosestElementForNode = function(oNode) {
|
|
83
|
-
var
|
|
84
|
-
return
|
|
81
|
+
var oClosestElement = oNode.closest("[data-sap-ui]");
|
|
82
|
+
return oClosestElement ? sap.ui.getCore().byId(oClosestElement.getAttribute("data-sap-ui")) : undefined;
|
|
85
83
|
};
|
|
86
84
|
|
|
87
85
|
ElementUtil.fixComponentParent = function(oElement) {
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The ManagedObjectObserver observes changes of a ManagedObject and propagates them via events.
|
|
26
26
|
* @extends sap.ui.base.ManagedObject
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.109.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.30
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @class The MutationObserver observes changes of a ManagedObject and propagates them via events.
|
|
31
31
|
* @extends sap.ui.base.ManagedObject
|
|
32
32
|
* @author SAP SE
|
|
33
|
-
* @version 1.
|
|
33
|
+
* @version 1.109.0
|
|
34
34
|
* @constructor
|
|
35
35
|
* @private
|
|
36
36
|
* @since 1.30
|
package/src/sap/ui/dt/Overlay.js
CHANGED
|
@@ -23,7 +23,7 @@ function(
|
|
|
23
23
|
*
|
|
24
24
|
* @namespace
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.109.0
|
|
27
27
|
*
|
|
28
28
|
* @private
|
|
29
29
|
* @since 1.30
|
|
@@ -56,7 +56,7 @@ function(
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
OverlayRegistry.getOverlays = function () {
|
|
59
|
-
return
|
|
59
|
+
return Object.values(mOverlays);
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -117,4 +117,4 @@ function(
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
return OverlayRegistry;
|
|
120
|
-
}, /* bExport= */ true);
|
|
120
|
+
}, /* bExport= */ true);
|
package/src/sap/ui/dt/Plugin.js
CHANGED
|
@@ -16,7 +16,7 @@ sap.ui.define(function() {
|
|
|
16
16
|
* @namespace
|
|
17
17
|
* @name sap.ui.dt.SelectionMode
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.109.0
|
|
20
20
|
* @experimental This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
21
21
|
* @private
|
|
22
22
|
*/
|
package/src/sap/ui/dt/Util.js
CHANGED
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/thirdparty/jquery",
|
|
9
8
|
"sap/ui/Device",
|
|
10
9
|
"sap/ui/base/ManagedObject",
|
|
11
10
|
"sap/ui/dt/DesignTimeStatus"
|
|
12
11
|
], function(
|
|
13
|
-
jQuery,
|
|
14
12
|
Device,
|
|
15
13
|
ManagedObject,
|
|
16
14
|
DesignTimeStatus
|
|
@@ -22,7 +20,7 @@ sap.ui.define([
|
|
|
22
20
|
*
|
|
23
21
|
* @namespace
|
|
24
22
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
23
|
+
* @version 1.109.0
|
|
26
24
|
*
|
|
27
25
|
* @private
|
|
28
26
|
* @since 1.54
|
|
@@ -176,17 +174,6 @@ sap.ui.define([
|
|
|
176
174
|
});
|
|
177
175
|
};
|
|
178
176
|
|
|
179
|
-
/**
|
|
180
|
-
* Gets values of specified object
|
|
181
|
-
* @param {object} mObject - Any plain JavaScript object
|
|
182
|
-
* @return {array.<*>} - An array of values of specified object
|
|
183
|
-
*/
|
|
184
|
-
Util.objectValues = function (mObject) {
|
|
185
|
-
return jQuery.map(mObject, function(vValue) {
|
|
186
|
-
return vValue;
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
|
|
190
177
|
/**
|
|
191
178
|
* Checks if specified value is an integer
|
|
192
179
|
* @param {*} vValue - Any value
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/thirdparty/jquery",
|
|
9
8
|
"sap/ui/dt/enablement/Test",
|
|
10
9
|
"sap/ui/dt/DesignTime",
|
|
11
10
|
"sap/ui/dt/enablement/Util",
|
|
@@ -14,7 +13,6 @@ sap.ui.define([
|
|
|
14
13
|
"sap/ui/qunit/utils/waitForThemeApplied",
|
|
15
14
|
"sap/ui/thirdparty/sinon-4"
|
|
16
15
|
], function(
|
|
17
|
-
jQuery,
|
|
18
16
|
Test,
|
|
19
17
|
DesignTime,
|
|
20
18
|
EnablementUtil,
|
|
@@ -37,7 +35,7 @@ sap.ui.define([
|
|
|
37
35
|
* @extends sap.ui.dt.test.Test
|
|
38
36
|
*
|
|
39
37
|
* @author SAP SE
|
|
40
|
-
* @version 1.
|
|
38
|
+
* @version 1.109.0
|
|
41
39
|
*
|
|
42
40
|
* @constructor
|
|
43
41
|
* @private
|
|
@@ -162,13 +160,14 @@ sap.ui.define([
|
|
|
162
160
|
* @private
|
|
163
161
|
*/
|
|
164
162
|
ElementEnablementTest.prototype._getTestArea = function() {
|
|
165
|
-
if (!this.
|
|
166
|
-
this.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
if (!this._oTestAreaDomRef) {
|
|
164
|
+
this._oTestAreaDomRef = document.createElement("div");
|
|
165
|
+
this._oTestAreaDomRef.id = this.getId() + "--testArea";
|
|
166
|
+
this._oTestAreaDomRef.style.height = "500px";
|
|
167
|
+
this._oTestAreaDomRef.style.width = "1000px";
|
|
168
|
+
document.body.append(this._oTestAreaDomRef);
|
|
170
169
|
}
|
|
171
|
-
return this.
|
|
170
|
+
return this._oTestAreaDomRef;
|
|
172
171
|
};
|
|
173
172
|
|
|
174
173
|
|
|
@@ -192,7 +191,7 @@ sap.ui.define([
|
|
|
192
191
|
|
|
193
192
|
if (!this._bNoRenderer) {
|
|
194
193
|
try {
|
|
195
|
-
this._oElement.placeAt(this._getTestArea()
|
|
194
|
+
this._oElement.placeAt(this._getTestArea());
|
|
196
195
|
sap.ui.getCore().applyChanges();
|
|
197
196
|
} catch (oError) {
|
|
198
197
|
this._bErrorDuringRendering = true;
|
package/src/sap/ui/dt/library.js
CHANGED
|
@@ -23,14 +23,14 @@ function (
|
|
|
23
23
|
* @namespace
|
|
24
24
|
* @alias sap.ui.dt
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.109.0
|
|
27
27
|
* @since 1.30
|
|
28
28
|
* @experimental This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
29
29
|
* @private
|
|
30
30
|
*/
|
|
31
31
|
var thisLib = sap.ui.getCore().initLibrary({
|
|
32
32
|
name: "sap.ui.dt",
|
|
33
|
-
version: "1.
|
|
33
|
+
version: "1.109.0",
|
|
34
34
|
dependencies: ["sap.ui.core"],
|
|
35
35
|
types: [
|
|
36
36
|
"sap.ui.dt.SelectionMode"
|
|
@@ -34,7 +34,7 @@ sap.ui.define([
|
|
|
34
34
|
* @class The ContextMenu registers event handler to open the context menu. Menu entries can dynamically be added
|
|
35
35
|
* @extends sap.ui.dt.Plugin
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.109.0
|
|
38
38
|
* @constructor
|
|
39
39
|
* @private
|
|
40
40
|
* @since 1.53
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @class The ControlDragDrop enables D&D functionality for the overlays based on aggregation types
|
|
27
27
|
* @extends sap.ui.dt.plugin.DragDrop
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.109.0
|
|
30
30
|
* @constructor
|
|
31
31
|
* @private
|
|
32
32
|
* @since 1.30
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @class The CutPaste enables Cut & Paste functionality for the overlays based on aggregation types
|
|
34
34
|
* @extends sap.ui.dt.Plugin
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.109.0
|
|
37
37
|
* @constructor
|
|
38
38
|
* @private
|
|
39
39
|
* @since 1.34
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
* @extends sap.ui.dt.Plugin
|
|
37
37
|
*
|
|
38
38
|
* @author SAP SE
|
|
39
|
-
* @version 1.
|
|
39
|
+
* @version 1.109.0
|
|
40
40
|
*
|
|
41
41
|
* @constructor
|
|
42
42
|
* @private
|
|
@@ -103,8 +103,6 @@ sap.ui.define([
|
|
|
103
103
|
* @param {sap.ui.dt.Overlay} oOverlay - Overlay which should be registered
|
|
104
104
|
*/
|
|
105
105
|
DragDrop.prototype.registerElementOverlay = function(oOverlay) {
|
|
106
|
-
// this._checkMovable(oOverlay);
|
|
107
|
-
|
|
108
106
|
oOverlay.attachEvent("movableChange", this._onMovableChange, this);
|
|
109
107
|
|
|
110
108
|
if (oOverlay.isMovable()) {
|
|
@@ -148,7 +146,7 @@ sap.ui.define([
|
|
|
148
146
|
|
|
149
147
|
if (!Device.browser.webkit) {
|
|
150
148
|
this._removeDragScrollHandler(oAggregationOverlay);
|
|
151
|
-
this._clearScrollIntervalFor(oAggregationOverlay
|
|
149
|
+
this._clearScrollIntervalFor(oAggregationOverlay.getDomRef().getAttribute("id"));
|
|
152
150
|
}
|
|
153
151
|
};
|
|
154
152
|
|
|
@@ -243,15 +241,6 @@ sap.ui.define([
|
|
|
243
241
|
*/
|
|
244
242
|
DragDrop.prototype.onAggregationDrop = function() { };
|
|
245
243
|
|
|
246
|
-
/**
|
|
247
|
-
* @private
|
|
248
|
-
*/
|
|
249
|
-
DragDrop.prototype._checkMovable = function(oOverlay) {
|
|
250
|
-
if (oOverlay.isMovable() || DOMUtil.getDraggable(oOverlay.$()) !== undefined) {
|
|
251
|
-
DOMUtil.setDraggable(oOverlay.$(), oOverlay.isMovable());
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
244
|
/**
|
|
256
245
|
* @private
|
|
257
246
|
*/
|
|
@@ -434,18 +423,18 @@ sap.ui.define([
|
|
|
434
423
|
DragDrop.prototype.showGhost = function(oOverlay, oEvent) {
|
|
435
424
|
if (oEvent && oEvent.originalEvent && oEvent.originalEvent.dataTransfer) {
|
|
436
425
|
if (oEvent.originalEvent.dataTransfer.setDragImage) {
|
|
437
|
-
this.
|
|
426
|
+
this._oGhost = this.createGhost(oOverlay, oEvent);
|
|
438
427
|
|
|
439
428
|
// ghost should be visible to set it as dragImage
|
|
440
|
-
|
|
429
|
+
document.getElementById("overlay-container").append(this._oGhost);
|
|
441
430
|
// if ghost will be removed without timeout, setDragImage won't work
|
|
442
431
|
setTimeout(function() {
|
|
443
432
|
this._removeGhost();
|
|
444
433
|
}.bind(this), 0);
|
|
445
434
|
oEvent.originalEvent.dataTransfer.setDragImage(
|
|
446
|
-
this.
|
|
447
|
-
oEvent.originalEvent.pageX - oOverlay
|
|
448
|
-
oEvent.originalEvent.pageY - oOverlay
|
|
435
|
+
this._oGhost,
|
|
436
|
+
oEvent.originalEvent.pageX - DOMUtil.getOffset(oOverlay.getDomRef()).left,
|
|
437
|
+
oEvent.originalEvent.pageY - DOMUtil.getOffset(oOverlay.getDomRef()).top
|
|
449
438
|
);
|
|
450
439
|
}
|
|
451
440
|
}
|
|
@@ -456,16 +445,16 @@ sap.ui.define([
|
|
|
456
445
|
*/
|
|
457
446
|
DragDrop.prototype._removeGhost = function() {
|
|
458
447
|
this.removeGhost();
|
|
459
|
-
delete this.
|
|
448
|
+
delete this._oGhost;
|
|
460
449
|
};
|
|
461
450
|
|
|
462
451
|
/**
|
|
463
452
|
* @protected
|
|
464
453
|
*/
|
|
465
454
|
DragDrop.prototype.removeGhost = function() {
|
|
466
|
-
var
|
|
467
|
-
if (
|
|
468
|
-
|
|
455
|
+
var oGhost = this.getGhost();
|
|
456
|
+
if (oGhost) {
|
|
457
|
+
oGhost.remove();
|
|
469
458
|
}
|
|
470
459
|
};
|
|
471
460
|
|
|
@@ -476,39 +465,42 @@ sap.ui.define([
|
|
|
476
465
|
*/
|
|
477
466
|
DragDrop.prototype.createGhost = function(oOverlay) {
|
|
478
467
|
var $GhostDom = oOverlay.getAssociatedDomRef();
|
|
479
|
-
var
|
|
468
|
+
var oGhost;
|
|
480
469
|
if (!$GhostDom) {
|
|
481
470
|
$GhostDom = this._getAssociatedDomCopy(oOverlay);
|
|
482
|
-
|
|
471
|
+
oGhost = $GhostDom.get(0);
|
|
483
472
|
} else {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
DOMUtil.cloneDOMAndStyles(oNode,
|
|
473
|
+
oGhost = document.createElement("div");
|
|
474
|
+
[].slice.call($GhostDom).forEach(function(oNode) {
|
|
475
|
+
DOMUtil.cloneDOMAndStyles(oNode, oGhost);
|
|
487
476
|
});
|
|
488
477
|
}
|
|
489
478
|
|
|
490
|
-
var
|
|
491
|
-
|
|
479
|
+
var oGhostWrapper = document.createElement("div");
|
|
480
|
+
oGhostWrapper.classList.add("sapUiDtDragGhostWrapper");
|
|
481
|
+
oGhost.classList.add("sapUiDtDragGhost");
|
|
482
|
+
oGhostWrapper.append(oGhost);
|
|
483
|
+
return oGhostWrapper;
|
|
492
484
|
};
|
|
493
485
|
|
|
494
486
|
/**
|
|
495
487
|
* @private
|
|
496
488
|
*/
|
|
497
489
|
DragDrop.prototype._getAssociatedDomCopy = function(oOverlay) {
|
|
498
|
-
var
|
|
490
|
+
var oDomCopy = document.createElement("div");
|
|
499
491
|
|
|
500
492
|
oOverlay.getAggregationOverlays().forEach(function(oAggregationOverlay) {
|
|
501
493
|
oAggregationOverlay.getChildren().forEach(function(oChildOverlay) {
|
|
502
494
|
var oChildDom = oChildOverlay.getAssociatedDomRef();
|
|
503
495
|
if (oChildDom) {
|
|
504
|
-
DOMUtil.cloneDOMAndStyles(oChildDom,
|
|
496
|
+
DOMUtil.cloneDOMAndStyles(oChildDom, oDomCopy);
|
|
505
497
|
} else {
|
|
506
|
-
DOMUtil.cloneDOMAndStyles(this._getAssociatedDomCopy(oChildOverlay),
|
|
498
|
+
DOMUtil.cloneDOMAndStyles(this._getAssociatedDomCopy(oChildOverlay).get(0), oDomCopy);
|
|
507
499
|
}
|
|
508
500
|
}, this);
|
|
509
501
|
}, this);
|
|
510
502
|
|
|
511
|
-
return
|
|
503
|
+
return jQuery(oDomCopy);
|
|
512
504
|
};
|
|
513
505
|
|
|
514
506
|
/**
|
|
@@ -516,7 +508,7 @@ sap.ui.define([
|
|
|
516
508
|
* @return {jQuery} jQuery ghost object
|
|
517
509
|
*/
|
|
518
510
|
DragDrop.prototype.getGhost = function() {
|
|
519
|
-
return this.
|
|
511
|
+
return this._oGhost;
|
|
520
512
|
};
|
|
521
513
|
|
|
522
514
|
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @class The ElementMover enables movement of UI5 elements based on aggregation types, which can be used by drag and
|
|
31
31
|
* drop or cut and paste behavior.
|
|
32
32
|
* @author SAP SE
|
|
33
|
-
* @version 1.
|
|
33
|
+
* @version 1.109.0
|
|
34
34
|
* @constructor
|
|
35
35
|
* @private
|
|
36
36
|
* @since 1.34
|
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/thirdparty/jquery",
|
|
9
8
|
"sap/ui/dt/Plugin",
|
|
10
9
|
"sap/ui/dt/Overlay",
|
|
11
|
-
"sap/ui/dt/OverlayRegistry"
|
|
12
|
-
// jQuery custom selectors ":focusable"
|
|
13
|
-
"sap/ui/dom/jquery/Selectors"
|
|
10
|
+
"sap/ui/dt/OverlayRegistry"
|
|
14
11
|
], function(
|
|
15
|
-
jQuery,
|
|
16
12
|
Plugin,
|
|
17
13
|
Overlay,
|
|
18
14
|
OverlayRegistry
|
|
@@ -27,7 +23,7 @@ sap.ui.define([
|
|
|
27
23
|
* @class The TabHandling plugin adjusts the tabindex for the elements.
|
|
28
24
|
* @extends sap.ui.dt.Plugin
|
|
29
25
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
26
|
+
* @version 1.109.0
|
|
31
27
|
* @constructor
|
|
32
28
|
* @private
|
|
33
29
|
* @since 1.38
|
|
@@ -99,9 +95,9 @@ sap.ui.define([
|
|
|
99
95
|
TabHandling.prototype.removeOverlayTabIndex = function() {
|
|
100
96
|
var aRootOverlays = this._getRootOverlays();
|
|
101
97
|
aRootOverlays.forEach(function(oRootOverlay) {
|
|
102
|
-
var
|
|
103
|
-
if (
|
|
104
|
-
|
|
98
|
+
var oRootDomRef = oRootOverlay.getDomRef();
|
|
99
|
+
if (oRootDomRef) {
|
|
100
|
+
oRootDomRef.querySelectorAll("[tabindex]:not([tabindex='-1'])").forEach(function(oNode) {
|
|
105
101
|
oNode.setAttribute("data-sap-ui-overlay-tabindex", oNode.tabIndex);
|
|
106
102
|
oNode.setAttribute("tabindex", -1);
|
|
107
103
|
});
|
|
@@ -121,7 +117,7 @@ sap.ui.define([
|
|
|
121
117
|
* Restore the tab indices of all elements of the DOM tree
|
|
122
118
|
*/
|
|
123
119
|
TabHandling.prototype.restoreTabIndex = function() {
|
|
124
|
-
|
|
120
|
+
document.querySelectorAll("[data-sap-ui-dt-tabindex]").forEach(function(oNode) {
|
|
125
121
|
oNode.setAttribute("tabindex", oNode.getAttribute("data-sap-ui-dt-tabindex"));
|
|
126
122
|
oNode.removeAttribute("data-sap-ui-dt-tabindex");
|
|
127
123
|
});
|
|
@@ -131,7 +127,7 @@ sap.ui.define([
|
|
|
131
127
|
* Restore the tab indices of all Overlays of the DOM tree
|
|
132
128
|
*/
|
|
133
129
|
TabHandling.prototype.restoreOverlayTabIndex = function() {
|
|
134
|
-
|
|
130
|
+
document.querySelectorAll("[data-sap-ui-overlay-tabindex]").forEach(function(oNode) {
|
|
135
131
|
oNode.setAttribute("tabindex", oNode.getAttribute("data-sap-ui-overlay-tabindex"));
|
|
136
132
|
oNode.removeAttribute("data-sap-ui-overlay-tabindex");
|
|
137
133
|
});
|
|
@@ -147,4 +143,4 @@ sap.ui.define([
|
|
|
147
143
|
};
|
|
148
144
|
|
|
149
145
|
return TabHandling;
|
|
150
|
-
});
|
|
146
|
+
});
|