@openui5/sap.uxap 1.92.0 → 1.95.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/.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
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.12
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
@@ -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
@@ -376,7 +370,7 @@ License: Unicode-DFS-2015
376
370
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Unicode-DFS-2015.txt
377
371
  Contained in: src/sap.ui.integration/src/sap/ui/integration/thirdparty/webcomponents/Unicode-Data-Files-LICENSE.txt
378
372
 
379
- Component: Adaptive Cards, version: 1.2.3
373
+ Component: Adaptive Cards, version: 2.9.0
380
374
  Copyright: 2017 Microsoft
381
375
  License: MIT
382
376
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.uxap",
3
- "version": "1.92.0",
3
+ "version": "1.95.0",
4
4
  "description": "OpenUI5 UI Library sap.uxap",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,9 +14,9 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.f": "1.92.0",
18
- "@openui5/sap.m": "1.92.0",
19
- "@openui5/sap.ui.core": "1.92.0",
20
- "@openui5/sap.ui.layout": "1.92.0"
17
+ "@openui5/sap.f": "1.95.0",
18
+ "@openui5/sap.m": "1.95.0",
19
+ "@openui5/sap.ui.core": "1.95.0",
20
+ "@openui5/sap.ui.layout": "1.95.0"
21
21
  }
22
22
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  <name>sap.uxap</name>
5
5
  <vendor>SAP SE</vendor>
6
- <version>1.92.0</version>
6
+ <version>1.95.0</version>
7
7
  <copyright>OpenUI5
8
8
  * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
9
9
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
@@ -624,7 +624,7 @@ sap.ui.define([
624
624
 
625
625
  if (this._iCurrentScrollTimeout) {
626
626
  clearTimeout(this._iCurrentScrollTimeout);
627
- jQuery(document.getElementById(this.getId() + "-scroll")).parent().stop(true, false);
627
+ this.$("scroll").parent().stop(true, false);
628
628
  }
629
629
 
630
630
  this._iCurrentScrollTimeout = setTimeout(function () {
@@ -829,7 +829,7 @@ sap.ui.define([
829
829
  * Determines whether the <code>sap.uxap.BlockBase</code> should be loaded lazily.
830
830
  * There are 3 prerequisites - lazy loading sould be enabled, the block should not be connected
831
831
  * and the block is used whithin <code>sap.uxap.ObjectPageSubSection</code>
832
- * @returns {Boolean}
832
+ * @returns {boolean}
833
833
  * @private
834
834
  */
835
835
  BlockBase.prototype._shouldLazyLoad = function () {
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @class
23
23
  * @author SAP SE
24
- * @version 1.92.0
24
+ * @version 1.95.0
25
25
  * @since 1.26
26
26
  * @alias sap.uxap.BlockBaseMetadata
27
27
  * @extends sap.ui.core.ElementMetadata
@@ -22,7 +22,7 @@ sap.ui.define(['sap/ui/core/Element', './library'],
22
22
  * @extends sap.ui.core.Element
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.92.0
25
+ * @version 1.95.0
26
26
  *
27
27
  * @constructor
28
28
  * @public
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  * @implements sap.uxap.IHeaderContent
42
42
  *
43
43
  * @author SAP SE
44
- * @version 1.92.0
44
+ * @version 1.95.0
45
45
  *
46
46
  * @constructor
47
47
  * @public
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  * @implements sap.uxap.IHeaderTitle
43
43
  *
44
44
  * @author SAP SE
45
- * @version 1.92.0
45
+ * @version 1.95.0
46
46
  *
47
47
  * @constructor
48
48
  * @public
@@ -289,6 +289,29 @@ sap.ui.define([
289
289
  */
290
290
  headerContentPinnable: {type: "boolean", group: "Behavior", defaultValue: true},
291
291
 
292
+ /**
293
+ * Determines whether the <code>sap.uxap.ObjectPageDynamicHeaderContent</code> is pinned.
294
+ *
295
+ * The property can be changed explicitly with its setter or in the occurrence of
296
+ * the following user interactions:
297
+ * <ul>
298
+ * <li>Toggling the pin/unpin button of <code>sap.uxap.ObjectPageDynamicHeaderContent</code></li>
299
+ * <li>Snapping the <code>sap.uxap.ObjectPageDynamicHeaderContent</code> by explicitly clicking on
300
+ * the <code>sap.uxap.ObjectPageDynamicHeaderTitle</code></li>
301
+ * </ul>
302
+ *
303
+ * <b>Note: </b> The property will only apply if the following rules are currently in use:
304
+ * <ul>
305
+ * <li>An instance of <code>sap.uxap.ObjectPageDynamicHeaderTitle</code> is used for the <code>headerTitle</code> aggregation.</li>
306
+ * <li>The <code>headerContentPinnable</code> property is <code>true</code></li>
307
+ * <li>The <code>sap.uxap.ObjectPageDynamicHeaderContent</code> is expanded</li>
308
+ * <li>The <code>preserveHeaderStateOnScroll</code> property or the rules for it to work are <code>false</code></li>
309
+ * </ul>
310
+ *
311
+ * @since 1.93
312
+ */
313
+ headerContentPinned: {type: "boolean", group: "Behavior", defaultValue: false},
314
+
292
315
  /**
293
316
  * Determines whether the user can switch between the expanded/collapsed states of the
294
317
  * <code>sap.uxap.ObjectPageDynamicHeaderContent</code> by clicking on the <code>sap.uxap.ObjectPageDynamicHeaderTitle</code>.
@@ -396,6 +419,21 @@ sap.ui.define([
396
419
  },
397
420
  events: {
398
421
 
422
+ /**
423
+ * The event is fired when the <code>headerContentPinned</code> property is changed via user interaction.
424
+ *
425
+ * @since 1.93
426
+ */
427
+ headerContentPinnedStateChange: {
428
+ parameters: {
429
+
430
+ /**
431
+ * False or True values indicate the new pinned property value.
432
+ */
433
+ pinned: {type: "boolean"}
434
+ }
435
+ },
436
+
399
437
  /**
400
438
  * The event is fired when the Anchor bar is switched from moving to fixed or the other way round.
401
439
  */
@@ -796,16 +834,16 @@ sap.ui.define([
796
834
  *
797
835
  * (2) If the <code>bAppendHeaderToContent</code> is <code>false</code>, then the
798
836
  * snapping is done by ensuring the header content is not visible using <code>display:none</code>
799
- *
837
+ * @param {boolean} bUserInteraction - indicates if snapping was caused by user interaction (scroll, collapse button press, etc.)
800
838
  * @private
801
839
  */
802
- ObjectPageLayout.prototype._snapHeader = function (bAppendHeaderToContent) {
840
+ ObjectPageLayout.prototype._snapHeader = function (bAppendHeaderToContent, bUserInteraction) {
803
841
 
804
842
  var bIsPageTop,
805
843
  oHeaderContent = this._getHeaderContent();
806
844
 
807
845
  if (oHeaderContent && oHeaderContent.supportsPinUnpin() && this._bPinned) {
808
- this._unPin();
846
+ this._unPin(bUserInteraction);
809
847
  oHeaderContent.getAggregation("_pinButton").setPressed(false);
810
848
  bAppendHeaderToContent = true;
811
849
  }
@@ -895,7 +933,7 @@ sap.ui.define([
895
933
  bAppendHeaderToContent = !this._shouldPreserveHeaderInTitleArea() &&
896
934
  (!this._bAllContentFitsContainer || this._headerBiggerThanAllowedToBeExpandedInTitleArea());
897
935
  // the <code>bAppendHeaderToContent</code> parameter determines if the header should snap *with* or *without* scroll
898
- this._snapHeader(bAppendHeaderToContent);
936
+ this._snapHeader(bAppendHeaderToContent, true);
899
937
  }
900
938
 
901
939
  this.getHeaderTitle()._getFocusSpan().trigger("focus");
@@ -1136,6 +1174,7 @@ sap.ui.define([
1136
1174
 
1137
1175
  if (oHeaderContent && oHeaderContent.supportsPinUnpin()) {
1138
1176
  this.$().toggleClass("sapUxAPObjectPageLayoutHeaderPinnable", oHeaderContent.getPinnable());
1177
+ this._updatePinButtonState();
1139
1178
  }
1140
1179
 
1141
1180
  if (oFooter) {
@@ -1193,7 +1232,7 @@ sap.ui.define([
1193
1232
 
1194
1233
  this._setSectionsFocusValues();
1195
1234
 
1196
- if (this._preserveHeaderStateOnScroll()) {
1235
+ if (this.getPreserveHeaderStateOnScroll()) {
1197
1236
  this._overridePreserveHeaderStateOnScroll();
1198
1237
  }
1199
1238
 
@@ -1225,7 +1264,7 @@ sap.ui.define([
1225
1264
  * (to avoid a problem with scrollbar appearing for a small instance
1226
1265
  * while we snap/unsnap header)
1227
1266
  * @private
1228
- * @param {Boolean} bEnable used to supress scrolling
1267
+ * @param {boolean} bEnable used to supress scrolling
1229
1268
  */
1230
1269
  ObjectPageLayout.prototype._toggleScrolling = function (bEnable) {
1231
1270
  if (this._$opWrapper.length) {
@@ -1526,17 +1565,17 @@ sap.ui.define([
1526
1565
  };
1527
1566
 
1528
1567
  ObjectPageLayout.prototype._cacheDomElements = function () {
1529
- this._$footerWrapper = jQuery(document.getElementById(this.getId() + "-footerWrapper"));
1530
- this._$titleArea = jQuery(document.getElementById(this.getId() + "-headerTitle"));
1531
- this._$anchorBar = jQuery(document.getElementById(this.getId() + "-anchorBar"));
1532
- this._$stickyAnchorBar = jQuery(document.getElementById(this.getId() + "-stickyAnchorBar"));
1533
- this._$opWrapper = jQuery(document.getElementById(this.getId() + "-opwrapper"));
1534
- this._$spacer = jQuery(document.getElementById(this.getId() + "-spacer"));
1535
- this._$headerContent = jQuery(document.getElementById(this.getId() + "-headerContent"));
1536
- this._$stickyHeaderContent = jQuery(document.getElementById(this.getId() + "-stickyHeaderContent"));
1537
- this._$contentContainer = jQuery(document.getElementById(this.getId() + "-scroll"));
1538
- this._$sectionsContainer = jQuery(document.getElementById(this.getId() + "-sectionsContainer"));
1539
- this._$skipFastGroupAnchor = jQuery(document.getElementById(this.getId() + "-skipFastGroupAnchor"));
1568
+ this._$footerWrapper = this.$("footerWrapper");
1569
+ this._$titleArea = this.$("headerTitle");
1570
+ this._$anchorBar = this.$("anchorBar");
1571
+ this._$stickyAnchorBar = this.$("stickyAnchorBar");
1572
+ this._$opWrapper = this.$("opwrapper");
1573
+ this._$spacer = this.$("spacer");
1574
+ this._$headerContent = this.$("headerContent");
1575
+ this._$stickyHeaderContent = this.$("stickyHeaderContent");
1576
+ this._$contentContainer = this.$("scroll");
1577
+ this._$sectionsContainer = this.$("sectionsContainer");
1578
+ this._$skipFastGroupAnchor = this.$("skipFastGroupAnchor");
1540
1579
 
1541
1580
  // BCP 1870201875: explicitly set the latest scrollContainer dom ref
1542
1581
  // (as the scroller obtains the latest scrollContainer dom ref in a LATER hook, which fails in conditions detailed in BCP 1870201875)
@@ -1919,7 +1958,7 @@ sap.ui.define([
1919
1958
  /**
1920
1959
  * Schedules for execution a layout adjustment task.
1921
1960
  * This task is throttled by default (unless the bImmediate parameter is specified).
1922
- * @param {Boolean} bImmediate - whether the task should be executed immediately, rather than throttled
1961
+ * @param {boolean} bImmediate - whether the task should be executed immediately, rather than throttled
1923
1962
  * @returns {Promise} - promise that will be resolved upon the task execution
1924
1963
  * @since 1.44
1925
1964
  * @private
@@ -2058,7 +2097,6 @@ sap.ui.define([
2058
2097
  this._oSectionInfo[oSectionBase.getId()] = {
2059
2098
  $dom: [],
2060
2099
  positionTop: 0,
2061
- positionTopMobile: 0,
2062
2100
  buttonId: "",
2063
2101
  isSection: (oSectionBase instanceof ObjectPageSection),
2064
2102
  sectionReference: oSectionBase
@@ -2263,9 +2301,7 @@ sap.ui.define([
2263
2301
 
2264
2302
  ObjectPageLayout.prototype._computeScrollPosition = function (oTargetSection) {
2265
2303
 
2266
- var bFirstLevel = oTargetSection && (oTargetSection instanceof ObjectPageSection),
2267
- sId = oTargetSection.getId(),
2268
- iScrollTo = this._bMobileScenario || bFirstLevel ? this._oSectionInfo[sId].positionTopMobile : this._oSectionInfo[sId].positionTop,
2304
+ var iScrollTo = this._oSectionInfo[oTargetSection.getId()].positionTop,
2269
2305
  bExpandedMode = !this._bStickyAnchorBar;
2270
2306
 
2271
2307
  if (bExpandedMode && this._isFirstVisibleSectionBase(oTargetSection)) { // preserve expanded header if no need to stick
@@ -2467,7 +2503,7 @@ sap.ui.define([
2467
2503
  sPreviousSubSectionId,
2468
2504
  sPreviousSectionId,
2469
2505
  bAllowScrollSectionToTop,
2470
- bStickyTitleMode = !this._bHeaderExpanded,
2506
+ bStickyTitleMode = this._bHeaderInTitleArea || !this._bHeaderExpanded,
2471
2507
  bIsFirstVisibleSubSection,
2472
2508
  bParentIsFirstVisibleSection,
2473
2509
  bIsFullscreenSection,
@@ -2488,12 +2524,13 @@ sap.ui.define([
2488
2524
 
2489
2525
  this.iFooterHeight = this._getFooterHeight();
2490
2526
 
2491
- var iSubSectionIndex = -1;
2527
+ var iSubSectionIndex = -1,
2528
+ iSectionsContainerOffsetTop = this._$sectionsContainer.position().top;
2492
2529
 
2493
2530
  this._aSectionBases.forEach(function (oSectionBase) {
2494
2531
  var oInfo = this._oSectionInfo[oSectionBase.getId()],
2495
2532
  $this = oSectionBase.$(),
2496
- $mobileAnchor,
2533
+ oSection,
2497
2534
  bPromoted = false;
2498
2535
 
2499
2536
  if (!oInfo /* sectionBase is visible */ || !$this.length) {
@@ -2513,29 +2550,18 @@ sap.ui.define([
2513
2550
  //the amount of scrolling required is the distance between their position().top and the bottom of the anchorBar
2514
2551
  oInfo.positionTop = Math.ceil(realTop);
2515
2552
 
2516
- //the amount of scrolling required for the mobile scenario
2517
- //we want to navigate just below its title
2518
- //as of UX specs Oct 7, 2014
2519
- if (oInfo.isSection) {
2520
- $mobileAnchor = oSectionBase.$("header");
2521
- } else {
2522
- $mobileAnchor = oSectionBase.$("headerTitle");
2523
- }
2524
-
2525
- bPromoted = $mobileAnchor.length === 0;
2526
-
2527
- //calculate the mobile position
2528
- if (!bPromoted) {
2529
- oInfo.positionTopMobile =
2530
- Math.ceil(library.Utilities.getChildPosition($mobileAnchor, this._$contentContainer).top)
2531
- + $mobileAnchor.outerHeight();
2532
- } else {
2533
- //title wasn't found (=first section, hidden title, promoted subsection), scroll to the same position as desktop
2534
- oInfo.positionTopMobile = oInfo.positionTop;
2553
+ if (!oInfo.isSection && (oSection = oSectionBase.getParent())) {
2554
+ // a promoted subSection borrows the title of its parent section
2555
+ bPromoted = oSectionBase._getTitleDomId() === oSection.getId() + "-title";
2556
+ if (bPromoted) {
2557
+ // the scrollTop required to scroll to a promoted subsection
2558
+ // is the top of the parent section (UX rule)
2559
+ var parentRealTop = oSection.$().position().top;
2560
+ oInfo.positionTop = Math.ceil(parentRealTop);
2561
+ }
2535
2562
  }
2536
2563
 
2537
2564
  if (!this._bStickyAnchorBar && !this._bHeaderInTitleArea) { // in sticky mode the anchor bar is not part of the content
2538
- oInfo.positionTopMobile -= this.iAnchorBarHeight;
2539
2565
  oInfo.positionTop -= this.iAnchorBarHeight;
2540
2566
  }
2541
2567
 
@@ -2583,7 +2609,7 @@ sap.ui.define([
2583
2609
  bIsFirstVisibleSubSection = bParentIsFirstVisibleSection && (iSubSectionIndex === 0); /* index of *visible* subSections is first */
2584
2610
  bIsFullscreenSection = oSectionBase.hasStyleClass(ObjectPageSubSection.FIT_CONTAINER_CLASS);
2585
2611
 
2586
- oSectionBase._setHeight(this._computeSubSectionHeight(bIsFirstVisibleSubSection, bIsFullscreenSection, oInfo.positionTop));
2612
+ oSectionBase._setHeight(this._computeSubSectionHeight(bIsFirstVisibleSubSection, bIsFullscreenSection, Math.ceil(realTop), iSectionsContainerOffsetTop));
2587
2613
  }
2588
2614
 
2589
2615
  }, this);
@@ -2643,7 +2669,7 @@ sap.ui.define([
2643
2669
  return true; // return success flag
2644
2670
  };
2645
2671
 
2646
- ObjectPageLayout.prototype._computeSubSectionHeight = function(bFirstVisibleSubSection, bFullscreenSection, iSubSectionOffsetTop) {
2672
+ ObjectPageLayout.prototype._computeSubSectionHeight = function(bFirstVisibleSubSection, bFullscreenSection, iSubSectionOffsetTop, iSectionsContainerOffsetTop) {
2647
2673
 
2648
2674
  var iSectionsContainerHeight,
2649
2675
  iRemainingSectionContentHeight;
@@ -2656,22 +2682,20 @@ sap.ui.define([
2656
2682
  // depends on the position of the section in the sections list
2657
2683
  // 1) first visible is initially displayed in container with *expanded* header
2658
2684
  // => obtain container height when *expanded* header
2659
- // 2) non-first visible is displayed in container with *snapped* header
2685
+ // 2) non-first visible is always displayed in container with *snapped* header
2660
2686
  // (because by the time we scroll to show the section, the header is already snapped)
2661
2687
  // => obtain container height when *snapped* header
2662
2688
  var bIsHeaderExpanded = (this._bAllContentFitsContainer) ? this._bHeaderExpanded : bFirstVisibleSubSection;
2663
2689
 
2664
2690
 
2665
2691
  // size the section to have the full height of its container
2666
- iSectionsContainerHeight = this._getSectionsContainerHeight(!bIsHeaderExpanded);
2692
+ iSectionsContainerHeight = this._getSectionsContainerHeight(bIsHeaderExpanded);
2667
2693
 
2668
2694
 
2669
2695
  if (this._bAllContentFitsContainer) {
2670
- // if we have a single fullscreen subsection [that takes the entire height of the sections container]
2671
- // => then the only *other* content in the sections container [besides the subSection]
2672
- // is the title of its parent section and the footer space
2673
- // => subtract the above heights from the subSection height to *avoid having a scrollbar*
2674
- iRemainingSectionContentHeight = (iSubSectionOffsetTop - this.iHeaderContentHeight /*- this.iAnchorBarHeight*/) + this.iFooterHeight;
2696
+ // if we have a single fullscreen subsection [that takes the entire available height within the sections container]
2697
+ // => subtract the heights above and bellow the subSection to *avoid having a scrollbar*
2698
+ iRemainingSectionContentHeight = (iSubSectionOffsetTop - iSectionsContainerOffsetTop) + this.iFooterHeight;
2675
2699
  iSectionsContainerHeight -= iRemainingSectionContentHeight;
2676
2700
  }
2677
2701
 
@@ -2743,10 +2767,11 @@ sap.ui.define([
2743
2767
  return this.getDomRef().getBoundingClientRect().height - this._getStickyAreaHeight(bIsStickyMode);
2744
2768
  };
2745
2769
 
2746
- ObjectPageLayout.prototype._getSectionsContainerHeight = function(bIsStickyMode) {
2770
+ ObjectPageLayout.prototype._getSectionsContainerHeight = function(bIsHeaderExpanded) {
2747
2771
 
2748
- var iScrollContainerHeight = this._getScrollableViewportHeight(bIsStickyMode);
2749
- if (!bIsStickyMode) {
2772
+ var bIsStickyMode = !bIsHeaderExpanded,
2773
+ iScrollContainerHeight = this._getScrollableViewportHeight(bIsStickyMode);
2774
+ if (!bIsStickyMode && !this._bHeaderInTitleArea) {
2750
2775
  // for expanded mode, subtract the heights of headerContent and anchorBar
2751
2776
  // as they are also part of the scrollable content when *expanded* header,
2752
2777
  // but we need the height of the *sections area bellow* them
@@ -2756,13 +2781,14 @@ sap.ui.define([
2756
2781
  };
2757
2782
 
2758
2783
  ObjectPageLayout.prototype._getSectionPositionTop = function(oSectionBase, bShouldStick) {
2759
- var iPosition = Math.ceil(library.Utilities.getChildPosition(oSectionBase.$(), this._$contentContainer).top);
2784
+ var iCachedPosition = this._oSectionInfo[oSectionBase.getId()].positionTop;
2760
2785
 
2761
- if (!this._bStickyAnchorBar && !this._bHeaderInTitleArea && bShouldStick) { // in sticky mode the anchor bar is not part of the content
2762
- iPosition -= this.iAnchorBarHeight;
2786
+ // in expanded mode the anchorBar is still part of the content
2787
+ if (!this._bStickyAnchorBar && !this._bHeaderInTitleArea) {
2788
+ iCachedPosition += this.iAnchorBarHeight;
2763
2789
  }
2764
2790
 
2765
- return iPosition;
2791
+ return iCachedPosition;
2766
2792
  };
2767
2793
 
2768
2794
  ObjectPageLayout.prototype._getSectionPositionBottom = function(oSectionBase, bShouldStick) {
@@ -2798,8 +2824,8 @@ sap.ui.define([
2798
2824
 
2799
2825
  /**
2800
2826
  * Determines if the <code>ObjectPageLayout</code> should set <code>ObjectPageSectionBase</code> internal <code>titleLevel</code>.
2801
- * @param {Object} oSectionBase <code>ObjectPageSectionBase</code> instance
2802
- * @returns {Boolean}
2827
+ * @param {sap.uxap.ObjectPageSectionBase} oSectionBase <code>ObjectPageSectionBase</code> instance
2828
+ * @returns {boolean}
2803
2829
  * @since 1.44
2804
2830
  * @private
2805
2831
  */
@@ -2839,11 +2865,6 @@ sap.ui.define([
2839
2865
  //therefore we need to create enough space below the last subsection to get it displayed on top = the spacer
2840
2866
  //the "top" is just below the sticky header + anchorBar, therefore we just need enough space to get the last subsection below these elements
2841
2867
  iSpacerHeight = iScrollableViewportHeight - iLastVisibleHeight;
2842
-
2843
- //take into account that we may need to scroll down to the positionMobile, thus we need to make sure we have enough space at the bottom
2844
- if (this._bMobileScenario) {
2845
- iSpacerHeight += (this._oSectionInfo[oLastVisibleSubSection.getId()].positionTopMobile - this._oSectionInfo[oLastVisibleSubSection.getId()].positionTop);
2846
- }
2847
2868
  } else {
2848
2869
  iSpacerHeight = 0;
2849
2870
  }
@@ -2987,7 +3008,7 @@ sap.ui.define([
2987
3008
  return;
2988
3009
  }
2989
3010
 
2990
- if (this._preserveHeaderStateOnScroll()) {
3011
+ if (this.getPreserveHeaderStateOnScroll()) {
2991
3012
  this._overridePreserveHeaderStateOnScroll();
2992
3013
  }
2993
3014
 
@@ -3272,12 +3293,12 @@ sap.ui.define([
3272
3293
  if (iScrollTop === 0) {
3273
3294
  // if we have arrow from the title inside the ContentHeader and the ContentHeader isn't scrolled we have to put higher z-index to the ContentHeader
3274
3295
  // otherwise part of the arrow is cut off
3275
- jQuery(document.getElementById(this.getId() + "-scroll")).css("z-index", "1000");
3296
+ this.$("scroll").css("z-index", "1000");
3276
3297
  bScrolled = false;
3277
3298
  } else if (!bScrolled) {
3278
3299
  bScrolled = true;
3279
3300
  // and we have to "reset" the z-index it when we start scrolling
3280
- jQuery(document.getElementById(this.getId() + "-scroll")).css("z-index", "0");
3301
+ this.$("scroll").css("z-index", "0");
3281
3302
  }
3282
3303
  }
3283
3304
  };
@@ -4339,10 +4360,6 @@ sap.ui.define([
4339
4360
  && this.getAlwaysShowContentHeader();
4340
4361
  };
4341
4362
 
4342
- ObjectPageLayout.prototype._shouldOverridePreserveHeaderStateOnScroll = function () {
4343
- return !Device.system.desktop && this._headerBiggerThanAllowedToBeFixed();
4344
- };
4345
-
4346
4363
  ObjectPageLayout.prototype._headerBiggerThanAllowedToBeFixed = function () {
4347
4364
  var iControlHeight = this._getOwnHeight();
4348
4365
 
@@ -4380,9 +4397,9 @@ sap.ui.define([
4380
4397
 
4381
4398
  ObjectPageLayout.prototype._onPinUnpinButtonPress = function () {
4382
4399
  if (this._bPinned) {
4383
- this._unPin();
4400
+ this._unPin(true);
4384
4401
  } else {
4385
- this._pin();
4402
+ this._pin(true);
4386
4403
  this._restorePinButtonFocus();
4387
4404
  }
4388
4405
  };
@@ -4399,14 +4416,16 @@ sap.ui.define([
4399
4416
  }
4400
4417
  };
4401
4418
 
4402
- ObjectPageLayout.prototype._pin = function () {
4403
- var $oObjectPage = this.$();
4404
-
4419
+ ObjectPageLayout.prototype._pin = function (bUserInteraction) {
4405
4420
  if (this._bPinned) {
4406
4421
  return;
4407
4422
  }
4408
4423
 
4409
4424
  this._bPinned = true;
4425
+ if (bUserInteraction) {
4426
+ this.setProperty("headerContentPinned", true, true);
4427
+ this.fireEvent("headerContentPinnedStateChange", {pinned: true});
4428
+ }
4410
4429
  this._toggleHeaderTitle(true /* expand */);
4411
4430
  this._moveAnchorBarToTitleArea();
4412
4431
  this._moveHeaderToTitleArea();
@@ -4414,23 +4433,38 @@ sap.ui.define([
4414
4433
  this._requestAdjustLayout();
4415
4434
  this._updateToggleHeaderVisualIndicators();
4416
4435
 
4417
- if (exists($oObjectPage)) {
4418
- $oObjectPage.addClass("sapUxAPObjectPageLayoutHeaderPinned");
4419
- }
4436
+ this.addStyleClass("sapUxAPObjectPageLayoutHeaderPinned");
4420
4437
  };
4421
4438
 
4422
- ObjectPageLayout.prototype._unPin = function () {
4423
- var $oObjectPage = this.$();
4424
-
4439
+ ObjectPageLayout.prototype._unPin = function (bUserInteraction) {
4425
4440
  if (!this._bPinned) {
4426
4441
  return;
4427
4442
  }
4428
4443
 
4429
4444
  this._bPinned = false;
4445
+ if (bUserInteraction) {
4446
+ this.setProperty("headerContentPinned", false, true);
4447
+ this.fireEvent("headerContentPinnedStateChange", {pinned: false});
4448
+ }
4430
4449
  this._updateToggleHeaderVisualIndicators();
4431
4450
 
4432
- if (exists($oObjectPage)) {
4433
- $oObjectPage.removeClass("sapUxAPObjectPageLayoutHeaderPinned");
4451
+ this.removeStyleClass("sapUxAPObjectPageLayoutHeaderPinned");
4452
+ };
4453
+
4454
+ ObjectPageLayout.prototype._isHeaderPinnable = function () {
4455
+ var oHeader = this._getHeaderContent();
4456
+ return oHeader && oHeader.getPinnable()
4457
+ && this._bHeaderExpanded
4458
+ && !this.getPreserveHeaderStateOnScroll();
4459
+ };
4460
+
4461
+ ObjectPageLayout.prototype._updatePinButtonState = function() {
4462
+ var bShouldPin = this.getHeaderContentPinned() && this._isHeaderPinnable();
4463
+ this._getHeaderContent()._togglePinButton(bShouldPin);
4464
+ if (bShouldPin) {
4465
+ this._pin();
4466
+ } else {
4467
+ this._unPin();
4434
4468
  }
4435
4469
  };
4436
4470
 
@@ -4451,13 +4485,15 @@ sap.ui.define([
4451
4485
  * @private
4452
4486
  */
4453
4487
  ObjectPageLayout.prototype._overridePreserveHeaderStateOnScroll = function () {
4454
- if (!this._shouldOverridePreserveHeaderStateOnScroll()) {
4455
- this._bHeaderBiggerThanAllowedHeight = false;
4488
+ var bOldValue = this._bHeaderBiggerThanAllowedHeight, bChange;
4489
+
4490
+ this._bHeaderBiggerThanAllowedHeight = this._headerBiggerThanAllowedToBeFixed();
4491
+ bChange = bOldValue !== this._bHeaderBiggerThanAllowedHeight;
4492
+
4493
+ if (!this._bHeaderBiggerThanAllowedHeight || !bChange) {
4456
4494
  return;
4457
4495
  }
4458
4496
 
4459
- this._bHeaderBiggerThanAllowedHeight = true;
4460
-
4461
4497
  //move the header to content
4462
4498
  if (this._bHeaderExpanded) {
4463
4499
  this._moveAnchorBarToContentArea();
@@ -4883,4 +4919,4 @@ sap.ui.define([
4883
4919
  }
4884
4920
 
4885
4921
  return ObjectPageLayout;
4886
- });
4922
+ });
@@ -16,8 +16,9 @@ sap.ui.define([
16
16
  "sap/m/MenuButton",
17
17
  "sap/m/Menu",
18
18
  "sap/m/MenuItem",
19
- "sap/ui/core/IconPool"
20
- ], function (jQuery, BaseObject, Core, CustomData, Configuration, ManagedObjectObserver, AnchorBar, Button, MenuButton, Menu, MenuItem, IconPool) {
19
+ "sap/ui/core/IconPool",
20
+ "sap/ui/core/InvisibleText"
21
+ ], function (jQuery, BaseObject, Core, CustomData, Configuration, ManagedObjectObserver, AnchorBar, Button, MenuButton, Menu, MenuItem, IconPool, InvisibleText) {
21
22
  "use strict";
22
23
 
23
24
  var ABHelper = BaseObject.extend("sap.uxap._helpers.AB", {
@@ -145,7 +146,8 @@ sap.ui.define([
145
146
  sButtonTitle,
146
147
  sButtonIcon,
147
148
  oMenuItem,
148
- oCustomButton;
149
+ oCustomButton,
150
+ sSplitButtonDescInvsibleTextId = InvisibleText.getStaticId("sap.m", "SPLIT_BUTTON_DESCRIPTION");
149
151
 
150
152
  //tablet & desktop mechanism
151
153
  if (oAnchorBar && this.getObjectPageLayout().getShowAnchorBar()) {
@@ -180,6 +182,13 @@ sap.ui.define([
180
182
  mAriaProps.role = "option";
181
183
  mAriaProps.setsize = oContent.length;
182
184
  mAriaProps.posinset = iIndex + 1;
185
+
186
+ mAriaProps.labelledby = mAriaProps.labelledby
187
+ .split(" ")
188
+ .filter(function (sId) {
189
+ return sId !== sSplitButtonDescInvsibleTextId;
190
+ })
191
+ .join(" ");
183
192
  }
184
193
  };
185
194
 
@@ -37,7 +37,7 @@ sap.ui.define([
37
37
  * @extends sap.ui.core.Element
38
38
  *
39
39
  * @author SAP SE
40
- * @version 1.92.0
40
+ * @version 1.95.0
41
41
  *
42
42
  * @constructor
43
43
  * @public
@@ -147,7 +147,7 @@ sap.ui.define([
147
147
  ObjectPageSection.prototype._updateImportance = function (oCurrentMedia) {
148
148
  var oObjectPage = this._getObjectPageLayout(),
149
149
  sImportanceLevelToHide = this._getImportanceLevelToHide(oCurrentMedia),
150
- oHeaderDOM = this.bOutput && document.getElementById(this.getId() + "-header");
150
+ oHeaderDOM = this.bOutput && this.getDomRef("header");
151
151
 
152
152
  this.getSubSections().forEach(function (oSubSection) {
153
153
  oSubSection._applyImportanceRules(sImportanceLevelToHide);
@@ -201,7 +201,7 @@ sap.ui.define([
201
201
  /**
202
202
  * Determines if the <code>ObjectPageSection</code> title is visible.
203
203
  * @private
204
- * @returns {Boolean}
204
+ * @returns {boolean}
205
205
  */
206
206
  ObjectPageSection.prototype._isTitleVisible = function () {
207
207
  return (this.getShowTitle() && this._getInternalTitleVisible())
@@ -437,7 +437,7 @@ sap.ui.define([
437
437
  * for the current screen size.
438
438
  *
439
439
  * @private
440
- * @returns {Boolean}
440
+ * @returns {boolean}
441
441
  */
442
442
  ObjectPageSectionBase.prototype._getIsHidden = function () {
443
443
  return this._isHidden;
@@ -361,7 +361,6 @@ sap.ui.define([
361
361
  return;
362
362
  }
363
363
 
364
- this._getGrid().removeAllContent();
365
364
  this._applyLayout(oObjectPageLayout);
366
365
  };
367
366
 
@@ -513,7 +512,7 @@ sap.ui.define([
513
512
  return;
514
513
  }
515
514
 
516
- this._$spacer = jQuery(document.getElementById(oObjectPageLayout.getId() + "-spacer"));
515
+ this._$spacer = oObjectPageLayout.$("spacer");
517
516
 
518
517
  if (this._bShouldFocusSeeMoreLessButton) {
519
518
  this._bShouldFocusSeeMoreLessButton = false;
@@ -541,6 +540,7 @@ sap.ui.define([
541
540
  ObjectPageSubSection.prototype._applyLayout = function (oLayoutProvider) {
542
541
  var aVisibleBlocks,
543
542
  oGrid = this._getGrid(),
543
+ oGridContent = oGrid.getAggregation("content"),
544
544
  sCurrentMode = this.getMode(),
545
545
  sLayout = oLayoutProvider.getSubSectionLayout(),
546
546
  oLayoutConfig = this._calculateLayoutConfiguration(sLayout, oLayoutProvider),
@@ -562,7 +562,11 @@ sap.ui.define([
562
562
  try {
563
563
  aVisibleBlocks.forEach(function (oBlock) {
564
564
  this._setBlockMode(oBlock, sCurrentMode);
565
- oGrid.addAggregation("content", oBlock, true); // this is always called onBeforeRendering so suppress invalidate
565
+
566
+ // Add Block to Grid content only if it's not already added
567
+ if (!oGridContent || (oGridContent && oGridContent.indexOf(oBlock) < 0)) {
568
+ oGrid.addAggregation("content", oBlock, true); // this is always called onBeforeRendering so suppress invalidate
569
+ }
566
570
  }, this);
567
571
  } catch (sError) {
568
572
  Log.error("ObjectPageSubSection :: error while building layout " + sLayout + ": " + sError);
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @constructor
26
26
  * @alias sap.uxap.changeHandler.AddIFrameObjectPageLayout
27
27
  * @author SAP SE
28
- * @version 1.92.0
28
+ * @version 1.95.0
29
29
  * @since 1.75
30
30
  * @experimental Since 1.75
31
31
  */
@@ -38,6 +38,7 @@ sap.ui.define([
38
38
  * @param {sap.ui.core.Control} oControl - Control that matches the change selector for applying the change
39
39
  * @param {object} mPropertyBag - Map of properties
40
40
  * @param {object} mPropertyBag.modifier - Modifier for the controls
41
+ * @returns {Promise} Promise resolving when the change is successfully applied
41
42
  * @ui5-restricted sap.uxap
42
43
  */
43
44
  AddIFrameObjectPageLayout.applyChange = function(oChange, oControl, mPropertyBag) {
@@ -45,7 +46,8 @@ sap.ui.define([
45
46
  var oChangeDefinition = oChange.getDefinition();
46
47
  var sAggregationName = oChangeDefinition.content.targetAggregation;
47
48
  if (sAggregationName !== "sections") {
48
- return BaseAddIFrame.applyChange(oChange, oControl, mPropertyBag);
49
+ return Promise.resolve()
50
+ .then(BaseAddIFrame.applyChange.bind(BaseAddIFrame, oChange, oControl, mPropertyBag));
49
51
  }
50
52
  // Create a section, sub section and insert the IFrame
51
53
  var oView = mPropertyBag.view;
@@ -53,26 +55,40 @@ sap.ui.define([
53
55
  var oBaseSelector = oChangeDefinition.content.selector;
54
56
  var sDefaultTitle = sap.ui.getCore().getLibraryResourceBundle("sap.uxap").getText("SECTION_TITLE_FOR_IFRAME");
55
57
 
56
- var oOPSection = oModifier.createControl("sap.uxap.ObjectPageSection", oComponent, oView, oBaseSelector, {
57
- title: sDefaultTitle
58
- }, false);
59
-
60
- var oOPSubSectionSelector = Object.create(oBaseSelector);
61
- oOPSubSectionSelector.id += "-subSection";
62
- var oOPSubSection = oModifier.createControl("sap.uxap.ObjectPageSubSection", oComponent, oView, oOPSubSectionSelector, {
63
- title: sDefaultTitle
64
- }, false);
65
- oModifier.insertAggregation(oOPSection, "subSections", oOPSubSection, 0, oView);
66
-
67
- var oIFrameSelector = Object.create(oBaseSelector);
68
- oIFrameSelector.id += "-iframe";
69
- var oIFrame = createIFrame(oChange, mPropertyBag, oIFrameSelector);
70
- oModifier.insertAggregation(oOPSubSection, "blocks", oIFrame, 0, oView);
71
-
72
- var iIndex = getTargetAggregationIndex(oChange, oControl, mPropertyBag);
73
- oModifier.insertAggregation(oControl, "sections", oOPSection, iIndex, oView);
74
-
75
- oChange.setRevertData([oModifier.getId(oOPSection)]);
58
+ var oOPSection;
59
+ var oOPSubSection;
60
+ return Promise.resolve()
61
+ .then(oModifier.createControl.bind(oModifier, "sap.uxap.ObjectPageSection", oComponent, oView, oBaseSelector, {
62
+ title: sDefaultTitle
63
+ }, false)
64
+ )
65
+ .then(function(oOPSectionLocal) {
66
+ oOPSection = oOPSectionLocal;
67
+ var oOPSubSectionSelector = Object.create(oBaseSelector);
68
+ oOPSubSectionSelector.id += "-subSection";
69
+ return oModifier.createControl("sap.uxap.ObjectPageSubSection", oComponent, oView, oOPSubSectionSelector, {
70
+ title: sDefaultTitle
71
+ }, false);
72
+ })
73
+ .then(function(oOPSubSectionLocal) {
74
+ oOPSubSection = oOPSubSectionLocal;
75
+ return oModifier.insertAggregation(oOPSection, "subSections", oOPSubSection, 0, oView);
76
+ })
77
+ .then(function () {
78
+ var oIFrameSelector = Object.create(oBaseSelector);
79
+ oIFrameSelector.id += "-iframe";
80
+ return createIFrame(oChange, mPropertyBag, oIFrameSelector);
81
+ })
82
+ .then(function(oIFrame) {
83
+ return oModifier.insertAggregation(oOPSubSection, "blocks", oIFrame, 0, oView);
84
+ })
85
+ .then(getTargetAggregationIndex.bind(null, oChange, oControl, mPropertyBag))
86
+ .then(function(iIndex) {
87
+ return oModifier.insertAggregation(oControl, "sections", oOPSection, iIndex, oView);
88
+ })
89
+ .then(function () {
90
+ oChange.setRevertData([oModifier.getId(oOPSection)]);
91
+ });
76
92
  };
77
93
 
78
94
  return AddIFrameObjectPageLayout;
@@ -13,7 +13,7 @@ sap.ui.define(["sap/ui/fl/changeHandler/MoveControls", "sap/ui/core/Core", "sap/
13
13
  * @constructor
14
14
  * @alias sap.uxap.changeHandler.MoveObjectPageSection
15
15
  * @author SAP SE
16
- * @version 1.92.0
16
+ * @version 1.95.0
17
17
  * @experimental Since 1.54
18
18
  */
19
19
 
@@ -59,14 +59,16 @@ sap.ui.define(["sap/ui/fl/changeHandler/MoveControls", "sap/ui/core/Core", "sap/
59
59
  MoveObjectPageSection.completeChangeContent = function (oChange, mSpecificChangeInfo, mPropertyBag) {
60
60
  var oSourceControl = Core.byId(mSpecificChangeInfo.source.id),
61
61
  oTargetControl = Core.byId(mSpecificChangeInfo.target.id);
62
-
62
+ var oPromise = Promise.resolve();
63
63
  if (oSourceControl.isA("sap.uxap.AnchorBar")
64
64
  && oTargetControl.isA("sap.uxap.AnchorBar")
65
65
  ) {
66
- this._mapAnchorsToSections(mSpecificChangeInfo, mPropertyBag);
66
+ oPromise = oPromise.then(this._mapAnchorsToSections.bind(this, mSpecificChangeInfo, mPropertyBag));
67
67
  }
68
68
 
69
- return MoveControls.completeChangeContent.apply(this, arguments);
69
+ return oPromise.then(function(){
70
+ return MoveControls.completeChangeContent.apply(this, arguments[0]);
71
+ }.bind(this, arguments));
70
72
  };
71
73
 
72
74
  /**
@@ -78,36 +80,47 @@ sap.ui.define(["sap/ui/fl/changeHandler/MoveControls", "sap/ui/core/Core", "sap/
78
80
  * @private
79
81
  */
80
82
  MoveObjectPageSection._mapAnchorsToSections = function (mSpecificChangeInfo, mPropertyBag) {
81
- var oSection, oSectionParentInfo,
82
- oModifier = mPropertyBag.modifier,
83
- oLayout = oModifier.bySelector(mSpecificChangeInfo.selector, mPropertyBag.appComponent, mPropertyBag.view),
84
- aAnchoredSections = oLayout._getVisibleSections(); // sections that have anchors
85
-
86
- function getSectionForAnchor(sAnchorId) {
87
- var oAnchor = Core.byId(sAnchorId),
88
- sSectionId = oAnchor.data("sectionId");
89
- return Core.byId(sSectionId);
90
- }
91
-
92
- mSpecificChangeInfo.movedElements.forEach(function(oElement) {
93
- // adjust target index as invisible sections are not part of the anchor bar;
94
- var oSectionAtTargetIndex = aAnchoredSections[oElement.targetIndex];
95
- oElement.targetIndex = oModifier.findIndexInParentAggregation(oSectionAtTargetIndex);
96
-
97
- // replace the anchorBar with the section
98
- oSection = getSectionForAnchor(oElement.id);
99
- if (!oSection || !oSection.getParent()) {
100
- throw new Error("Cannot map anchor to section");
101
- }
102
- oSectionParentInfo = {
103
- id: oSection.getParent().getId(),
104
- aggregation: oSection.sParentAggregationName
105
- };
106
- oElement.id = oSection.getId();
107
- });
108
-
109
- merge(mSpecificChangeInfo.source, oSectionParentInfo);
110
- merge(mSpecificChangeInfo.target, oSectionParentInfo);
83
+ return Promise.resolve()
84
+ .then(function() {
85
+ var oSection, oSectionParentInfo;
86
+ var oModifier = mPropertyBag.modifier;
87
+ var oLayout = oModifier.bySelector(mSpecificChangeInfo.selector, mPropertyBag.appComponent, mPropertyBag.view);
88
+ var aAnchoredSections = oLayout._getVisibleSections(); // sections that have anchors
89
+
90
+ function getSectionForAnchor(sAnchorId) {
91
+ var oAnchor = Core.byId(sAnchorId),
92
+ sSectionId = oAnchor.data("sectionId");
93
+ return Core.byId(sSectionId);
94
+ }
95
+ var aPromiseArray = [];
96
+ mSpecificChangeInfo.movedElements.forEach(function(oElement) {
97
+ // adjust target index as invisible sections are not part of the anchor bar;
98
+ var oSectionAtTargetIndex = aAnchoredSections[oElement.targetIndex];
99
+ var oPromise = Promise.resolve()
100
+ .then(function(){
101
+ return oModifier.findIndexInParentAggregation(oSectionAtTargetIndex);
102
+ })
103
+ .then(function(iTargetIndex){
104
+ oElement.targetIndex = iTargetIndex;
105
+ // replace the anchorBar with the section
106
+ oSection = getSectionForAnchor(oElement.id);
107
+ if (!oSection || !oSection.getParent()) {
108
+ throw new Error("Cannot map anchor to section");
109
+ }
110
+ oSectionParentInfo = {
111
+ id: oSection.getParent().getId(),
112
+ aggregation: oSection.sParentAggregationName
113
+ };
114
+ oElement.id = oSection.getId();
115
+ });
116
+ aPromiseArray.push(oPromise);
117
+ });
118
+ return Promise.all(aPromiseArray)
119
+ .then(function(){
120
+ merge(mSpecificChangeInfo.source, oSectionParentInfo);
121
+ merge(mSpecificChangeInfo.target, oSectionParentInfo);
122
+ });
123
+ });
111
124
  };
112
125
 
113
126
  return MoveObjectPageSection;
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * @constructor
22
22
  * @alias sap.uxap.changeHandler.RenameObjectPageSection
23
23
  * @author SAP SE
24
- * @version 1.92.0
24
+ * @version 1.95.0
25
25
  * @experimental Since 1.50
26
26
  */
27
27
 
@@ -34,57 +34,75 @@ sap.ui.define([
34
34
  var RenameObjectPageSection = BaseRename.createRenameChangeHandler(mRenameSettings);
35
35
 
36
36
  RenameObjectPageSection._getControlForRename = function (oControl, oModifier) {
37
- var aSubSections = oModifier.getAggregation(oControl, "subSections");
38
- // due to specific logic in the Object Page Layout, the title of the Section is
39
- // taken from its SubSection in case it is only one no matter if the Section has title itself.
40
- if (aSubSections
41
- && aSubSections.length === 1
42
- && (oModifier.getPropertyBindingOrProperty(aSubSections[0], "title"))
43
- && oModifier.getProperty(oModifier.getParent(oControl), "subSectionLayout") === "TitleOnTop"
44
- ) {
45
- return aSubSections[0];
46
- }
47
- return oControl;
37
+ var aSubSections;
38
+ return Promise.resolve()
39
+ .then(function() {
40
+ return oModifier.getAggregation(oControl, "subSections");
41
+ })
42
+ .then(function(aSubSectionsLocal) {
43
+ aSubSections = aSubSectionsLocal;
44
+ return Promise.all([oModifier.getPropertyBindingOrProperty(aSubSections[0], "title"),
45
+ oModifier.getProperty(oModifier.getParent(oControl), "subSectionLayout")]);
46
+ })
47
+ .then(function(aProperties) {
48
+ // due to specific logic in the Object Page Layout, the title of the Section is
49
+ // taken from its SubSection in case it is only one no matter if the Section has title itself.
50
+
51
+ if (aSubSections
52
+ && aSubSections.length === 1
53
+ && aProperties[0]
54
+ && aProperties[1] === "TitleOnTop"
55
+ ) {
56
+ return aSubSections[0];
57
+ }
58
+ return oControl;
59
+ });
48
60
  };
49
61
 
50
62
  RenameObjectPageSection.applyChange = function (oChange, oControl, mPropertyBag) {
51
- var oModifier = mPropertyBag.modifier,
52
- sPropertyName = mRenameSettings.propertyName,
53
- oChangeDefinition = oChange.getDefinition(),
54
- sText = oChangeDefinition.texts[mRenameSettings.changePropertyName],
55
- sValue = sText.value,
56
- oControlToBeRenamed = RenameObjectPageSection._getControlForRename(oControl, oModifier);
57
-
58
- if (typeof sValue === "string" && sValue.trim() === "") {
59
- throw new Error("Change cannot be applied as ObjectPageSubSection's title cannot be empty: ["
60
- + oChangeDefinition.layer + "]" + oChangeDefinition.namespace + "/" + oChangeDefinition.fileName + "." + oChangeDefinition.fileType);
61
- }
62
-
63
- if (oChangeDefinition.texts && sText && typeof (sValue) === "string") {
64
- oChange.setRevertData(oModifier.getPropertyBindingOrProperty(oControlToBeRenamed, sPropertyName));
65
- oModifier.setPropertyBindingOrProperty(oControlToBeRenamed, sPropertyName, sValue);
63
+ var oModifier = mPropertyBag.modifier;
64
+ var sPropertyName = mRenameSettings.propertyName;
65
+ var oChangeDefinition = oChange.getDefinition();
66
+ var sText = oChangeDefinition.texts[mRenameSettings.changePropertyName];
67
+ var sValue = sText.value;
68
+ return RenameObjectPageSection._getControlForRename(oControl, oModifier)
69
+ .then(function(oControlToBeRenamed) {
70
+ if (typeof sValue === "string" && sValue.trim() === "") {
71
+ throw new Error("Change cannot be applied as ObjectPageSubSection's title cannot be empty: ["
72
+ + oChangeDefinition.layer + "]" + oChangeDefinition.namespace + "/" + oChangeDefinition.fileName + "." + oChangeDefinition.fileType);
73
+ }
66
74
 
67
- return true;
68
- } else {
69
- Log.error("Change does not contain sufficient information to be applied: [" + oChangeDefinition.layer + "]" + oChangeDefinition.namespace + "/" + oChangeDefinition.fileName + "." + oChangeDefinition.fileType);
70
- //however subsequent changes should be applied
71
- }
75
+ if (oChangeDefinition.texts && sText && typeof (sValue) === "string") {
76
+ return Promise.resolve()
77
+ .then(function(){
78
+ return oModifier.getPropertyBindingOrProperty(oControlToBeRenamed, sPropertyName);
79
+ })
80
+ .then(function(oBindingOrProperty) {
81
+ oChange.setRevertData(oBindingOrProperty);
82
+ oModifier.setPropertyBindingOrProperty(oControlToBeRenamed, sPropertyName, sValue);
83
+ return true;
84
+ });
85
+ } else {
86
+ Log.error("Change does not contain sufficient information to be applied: [" + oChangeDefinition.layer + "]" + oChangeDefinition.namespace + "/" + oChangeDefinition.fileName + "." + oChangeDefinition.fileType);
87
+ //however subsequent changes should be applied
88
+ }
89
+ });
72
90
  };
73
91
 
74
92
  RenameObjectPageSection.revertChange = function (oChange, oControl, mPropertyBag) {
75
93
  var vOldText = oChange.getRevertData(),
76
94
  oModifier = mPropertyBag.modifier,
77
- oControlToBeReverted = RenameObjectPageSection._getControlForRename(oControl, oModifier),
78
95
  sPropertyName = mRenameSettings.propertyName;
79
-
80
- if (vOldText || vOldText === "") {
81
- oModifier.setPropertyBindingOrProperty(oControlToBeReverted, sPropertyName, vOldText);
82
- oChange.resetRevertData();
83
-
84
- return true;
85
- } else {
86
- Log.error("Change doesn't contain sufficient information to be reverted. Most Likely the Change didn't go through applyChange.");
87
- }
96
+ return RenameObjectPageSection._getControlForRename(oControl, oModifier)
97
+ .then(function(oControlToBeReverted){
98
+ if (vOldText || vOldText === "") {
99
+ oModifier.setPropertyBindingOrProperty(oControlToBeReverted, sPropertyName, vOldText);
100
+ oChange.resetRevertData();
101
+ return true;
102
+ } else {
103
+ Log.error("Change doesn't contain sufficient information to be reverted. Most Likely the Change didn't go through applyChange.");
104
+ }
105
+ });
88
106
  };
89
107
 
90
108
 
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @namespace
25
25
  * @name sap.uxap
26
26
  * @author SAP SE
27
- * @version 1.92.0
27
+ * @version 1.95.0
28
28
  * @since 1.36
29
29
  * @public
30
30
  */
@@ -69,7 +69,7 @@ sap.ui.define([
69
69
  "sap.uxap.ObjectPageHeaderLayoutData",
70
70
  "sap.uxap.ObjectPageLazyLoader"
71
71
  ],
72
- version: "1.92.0",
72
+ version: "1.95.0",
73
73
  extensions: {
74
74
  flChangeHandlers: {
75
75
  "sap.uxap.ObjectPageHeader": "sap/uxap/flexibility/ObjectPageHeader",
@@ -5,7 +5,7 @@ SHOW_LESS=Weniger anzeigen
5
5
 
6
6
  ANCHOR_BAR_ARIA_LABEL=Anker
7
7
 
8
- ANCHOR_BAR_ARIA_LABEL_DESC=Position aktivieren, um zum Abschnitt auf der Seite zu springen
8
+ ANCHOR_BAR_ARIA_LABEL_DESC=Element aktivieren, um zum Abschnitt auf der Seite zu springen
9
9
 
10
10
  ANCHOR_BAR_OVERFLOW=Mehr
11
11