@openui5/sap.ui.rta 1.111.0 → 1.112.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 (151) hide show
  1. package/package.json +6 -6
  2. package/src/sap/ui/rta/.library +1 -1
  3. package/src/sap/ui/rta/Client.js +1 -1
  4. package/src/sap/ui/rta/RuntimeAuthoring.js +41 -14
  5. package/src/sap/ui/rta/Utils.js +1 -1
  6. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  7. package/src/sap/ui/rta/command/AddIFrame.js +5 -1
  8. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  9. package/src/sap/ui/rta/command/AddXML.js +1 -1
  10. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  11. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  12. package/src/sap/ui/rta/command/BaseCommand.js +9 -1
  13. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  14. package/src/sap/ui/rta/command/Combine.js +1 -1
  15. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  16. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  17. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  18. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  19. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSwitch.js +5 -2
  22. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  23. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  24. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  25. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  26. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  27. package/src/sap/ui/rta/command/Move.js +1 -1
  28. package/src/sap/ui/rta/command/Property.js +1 -1
  29. package/src/sap/ui/rta/command/Remove.js +1 -1
  30. package/src/sap/ui/rta/command/Rename.js +1 -1
  31. package/src/sap/ui/rta/command/Resize.js +1 -1
  32. package/src/sap/ui/rta/command/Reveal.js +1 -1
  33. package/src/sap/ui/rta/command/Settings.js +1 -1
  34. package/src/sap/ui/rta/command/Split.js +1 -1
  35. package/src/sap/ui/rta/command/Stack.js +22 -1
  36. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  37. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  38. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  39. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +5 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  41. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  42. package/src/sap/ui/rta/library.js +2 -2
  43. package/src/sap/ui/rta/messagebundle.properties +18 -0
  44. package/src/sap/ui/rta/messagebundle_ar.properties +13 -1
  45. package/src/sap/ui/rta/messagebundle_bg.properties +13 -1
  46. package/src/sap/ui/rta/messagebundle_ca.properties +13 -1
  47. package/src/sap/ui/rta/messagebundle_cs.properties +13 -1
  48. package/src/sap/ui/rta/messagebundle_cy.properties +13 -1
  49. package/src/sap/ui/rta/messagebundle_da.properties +13 -1
  50. package/src/sap/ui/rta/messagebundle_de.properties +13 -1
  51. package/src/sap/ui/rta/messagebundle_el.properties +13 -1
  52. package/src/sap/ui/rta/messagebundle_en.properties +13 -1
  53. package/src/sap/ui/rta/messagebundle_en_GB.properties +13 -1
  54. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
  55. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
  56. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +13 -1
  57. package/src/sap/ui/rta/messagebundle_es.properties +13 -1
  58. package/src/sap/ui/rta/messagebundle_es_MX.properties +13 -1
  59. package/src/sap/ui/rta/messagebundle_et.properties +13 -1
  60. package/src/sap/ui/rta/messagebundle_fi.properties +13 -1
  61. package/src/sap/ui/rta/messagebundle_fr.properties +13 -1
  62. package/src/sap/ui/rta/messagebundle_fr_CA.properties +14 -2
  63. package/src/sap/ui/rta/messagebundle_hi.properties +13 -1
  64. package/src/sap/ui/rta/messagebundle_hr.properties +13 -1
  65. package/src/sap/ui/rta/messagebundle_hu.properties +13 -1
  66. package/src/sap/ui/rta/messagebundle_id.properties +13 -1
  67. package/src/sap/ui/rta/messagebundle_it.properties +13 -1
  68. package/src/sap/ui/rta/messagebundle_iw.properties +13 -1
  69. package/src/sap/ui/rta/messagebundle_ja.properties +13 -1
  70. package/src/sap/ui/rta/messagebundle_kk.properties +13 -1
  71. package/src/sap/ui/rta/messagebundle_ko.properties +13 -1
  72. package/src/sap/ui/rta/messagebundle_lt.properties +13 -1
  73. package/src/sap/ui/rta/messagebundle_lv.properties +13 -1
  74. package/src/sap/ui/rta/messagebundle_ms.properties +13 -1
  75. package/src/sap/ui/rta/messagebundle_nl.properties +13 -1
  76. package/src/sap/ui/rta/messagebundle_no.properties +13 -1
  77. package/src/sap/ui/rta/messagebundle_pl.properties +13 -1
  78. package/src/sap/ui/rta/messagebundle_pt.properties +14 -2
  79. package/src/sap/ui/rta/messagebundle_pt_PT.properties +13 -1
  80. package/src/sap/ui/rta/messagebundle_ro.properties +13 -1
  81. package/src/sap/ui/rta/messagebundle_ru.properties +13 -1
  82. package/src/sap/ui/rta/messagebundle_sh.properties +13 -1
  83. package/src/sap/ui/rta/messagebundle_sk.properties +13 -1
  84. package/src/sap/ui/rta/messagebundle_sl.properties +13 -1
  85. package/src/sap/ui/rta/messagebundle_sv.properties +13 -1
  86. package/src/sap/ui/rta/messagebundle_th.properties +13 -1
  87. package/src/sap/ui/rta/messagebundle_tr.properties +13 -1
  88. package/src/sap/ui/rta/messagebundle_uk.properties +13 -1
  89. package/src/sap/ui/rta/messagebundle_vi.properties +13 -1
  90. package/src/sap/ui/rta/messagebundle_zh_CN.properties +13 -1
  91. package/src/sap/ui/rta/messagebundle_zh_TW.properties +13 -1
  92. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  93. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  94. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  95. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  96. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  97. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  98. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  99. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  100. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  101. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  102. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  103. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  104. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  105. package/src/sap/ui/rta/plugin/Rename.js +15 -11
  106. package/src/sap/ui/rta/plugin/RenameHandler.js +6 -56
  107. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  108. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  109. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  110. package/src/sap/ui/rta/plugin/Split.js +1 -1
  111. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  112. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  113. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  114. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  117. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +13 -6
  118. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +73 -48
  119. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +16 -14
  120. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +34 -3
  121. package/src/sap/ui/rta/service/Action.js +1 -1
  122. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  123. package/src/sap/ui/rta/service/Outline.js +1 -1
  124. package/src/sap/ui/rta/service/Property.js +1 -1
  125. package/src/sap/ui/rta/service/Selection.js +1 -1
  126. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  127. package/src/sap/ui/rta/themes/base/AddIFrame.less +9 -0
  128. package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +19 -21
  129. package/src/sap/ui/rta/themes/base/Toolbar.base.less +1 -1
  130. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +30 -22
  131. package/src/sap/ui/rta/toolbar/Adaptation.js +118 -66
  132. package/src/sap/ui/rta/toolbar/Base.js +6 -2
  133. package/src/sap/ui/rta/toolbar/Fiori.js +49 -10
  134. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  135. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  136. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  137. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  138. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +16 -6
  139. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +17 -0
  140. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  141. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  142. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  143. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  144. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  145. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  146. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  147. package/src/sap/ui/rta/util/UrlParser.js +14 -7
  148. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  149. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +8 -5
  150. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +15 -10
  151. package/src/sap/ui/rta/util/validateText.js +71 -0
@@ -5,10 +5,8 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "require",
9
8
  "sap/ui/core/Fragment",
10
9
  "sap/ui/core/Popup",
11
- "sap/ui/core/IconPool",
12
10
  "sap/ui/fl/write/api/Version",
13
11
  "sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
14
12
  "sap/ui/rta/toolbar/contextBased/ManageAdaptations",
@@ -17,13 +15,10 @@ sap.ui.define([
17
15
  "sap/ui/rta/appVariant/Feature",
18
16
  "sap/ui/rta/toolbar/Base",
19
17
  "sap/ui/rta/Utils",
20
- "sap/ui/Device",
21
18
  "./AdaptationRenderer"
22
19
  ], function(
23
- require,
24
20
  Fragment,
25
21
  Popup,
26
- IconPool,
27
22
  Version,
28
23
  SaveAsAdaptation,
29
24
  ManageAdaptations,
@@ -32,7 +27,6 @@ sap.ui.define([
32
27
  AppVariantFeature,
33
28
  Base,
34
29
  Utils,
35
- Device,
36
30
  AdaptationRenderer
37
31
  ) {
38
32
  "use strict";
@@ -45,7 +39,7 @@ sap.ui.define([
45
39
  * @extends sap.ui.rta.toolbar.Base
46
40
  *
47
41
  * @author SAP SE
48
- * @version 1.111.0
42
+ * @version 1.112.0
49
43
  *
50
44
  * @constructor
51
45
  * @private
@@ -77,57 +71,131 @@ sap.ui.define([
77
71
  }
78
72
  });
79
73
 
80
- Adaptation.modes = {
81
- MOBILE: "sapUiRtaToolbarMobile",
82
- TABLET: "sapUiRtaToolbarTablet",
83
- DESKTOP: "sapUiRtaToolbarDesktop"
84
- };
74
+ Adaptation.LEFT_SECTION = "toolbarIconAndDraftSection";
75
+ Adaptation.MIDDLE_SECTION = "toolbarSwitcherSection";
76
+ Adaptation.RIGHT_SECTION = "toolbarActionsSection";
85
77
 
86
- var DEVICE_SET = "sapUiRtaToolbar";
78
+ // Size of three icons + spacing in pixels
79
+ var SWITCHER_ICON_WIDTH = 124;
87
80
 
88
81
  Adaptation.prototype.init = function() {
89
- this._pFragmentLoaded = Base.prototype.init.apply(this, arguments).then(function() {
90
- if (!Device.media.hasRangeSet(DEVICE_SET)) {
91
- Device.media.initRangeSet(DEVICE_SET, [900, 1200], "px", [Adaptation.modes.MOBILE, Adaptation.modes.TABLET, Adaptation.modes.DESKTOP]);
92
- }
93
- Device.media.attachHandler(this._onSizeChanged, this, DEVICE_SET);
82
+ this._mSizeLimits = {
83
+ switchToIcons: undefined
84
+ };
85
+ this._pFragmentLoaded = Base.prototype.init.apply(this, arguments)
86
+ .then(function() {
87
+ this._onResize = this._onResize.bind(this);
88
+ window.addEventListener("resize", this._onResize);
89
+ this._aIntersectionObservers = [];
90
+ }.bind(this));
91
+ };
92
+
93
+ Adaptation.prototype._calculateWindowWidth = function(aEntries) {
94
+ var iSectionWidth = aEntries[0].intersectionRect.width;
95
+ return (iSectionWidth * 2) + this._iSwitcherToolbarWidth + 80/*toolbar padding*/;
96
+ };
97
+
98
+ Adaptation.prototype.onFragmentLoaded = function() {
99
+ return this._pFragmentLoaded;
100
+ };
101
+
102
+ Adaptation.prototype.exit = function() {
103
+ window.removeEventListener("resize", this._onResize);
104
+ this._aIntersectionObservers.forEach(function(oInstersectionObserver) {
105
+ oInstersectionObserver.disconnect();
106
+ });
107
+ Base.prototype.exit.apply(this, arguments);
108
+ };
109
+
110
+ Adaptation.prototype._restoreHiddenElements = function() {
111
+ delete this._iOnResizeAnimationFrame;
112
+ // Restore texts when window gets wide enough again
113
+ if (window.innerWidth > this._mSizeLimits.switchToIcons) {
114
+ this._switchToTexts();
115
+ delete this._mSizeLimits.switchToIcons;
116
+ }
117
+ };
118
+
119
+ Adaptation.prototype._onResize = function () {
120
+ if (this._iOnResizeAnimationFrame) {
121
+ window.cancelAnimationFrame(this._iOnResizeAnimationFrame);
122
+ }
123
+ this._iOnResizeAnimationFrame = window.requestAnimationFrame(this._restoreHiddenElements.bind(this));
124
+ };
125
+
126
+ Adaptation.prototype.initialAdjustToolbarSectionWidths = function() {
127
+ var nModeSwitcherWidth = this.getControl("modeSwitcher").getDomRef().getBoundingClientRect().width;
128
+ // Size of switcher with texts depends on language; needs to be calculated on start
129
+ this._iSwitcherToolbarWidthWithTexts = nModeSwitcherWidth + 16;
130
+ this._iSwitcherToolbarWidth = this._iSwitcherToolbarWidthWithTexts;
131
+ this.adjustToolbarSectionWidths();
132
+ };
133
+
134
+ Adaptation.prototype.adjustToolbarSectionWidths = function() {
135
+ // The middle section (switcher) is used as base for the other calculations
136
+ this.getControl(Adaptation.MIDDLE_SECTION).setWidth((this._iSwitcherToolbarWidth) + "px");
137
+ [Adaptation.LEFT_SECTION, Adaptation.RIGHT_SECTION].forEach(function(sSectionName) {
138
+ this.getControl(sSectionName).getDomRef().style.setProperty(
139
+ "width",
140
+ "calc(50% - " + Math.ceil(this._iSwitcherToolbarWidth / 2) + "px)",
141
+ "important"
142
+ );
94
143
  }.bind(this));
144
+ };
95
145
 
96
- IconPool.registerFont({
97
- collectionName: "BusinessSuiteInAppSymbols",
98
- fontFamily: "BusinessSuiteInAppSymbols",
99
- fontURI: require.toUrl("sap/ushell/themes/base/fonts/"),
100
- lazy: true
146
+ // The intersection observers check if the sections are being overlapped (visibility < 100%)
147
+ // to adjust the toolbar appearance, like changing the mode switcher buttons to icons-only
148
+ Adaptation.prototype._observeIntersections = function() {
149
+ this._aIntersectionObservers.forEach(function(oInstersectionObserver) {
150
+ oInstersectionObserver.disconnect();
101
151
  });
152
+ [Adaptation.LEFT_SECTION, Adaptation.RIGHT_SECTION].forEach(function(sSectionName) {
153
+ var oIntersectionObserver = this._createIntersectionObserver(sSectionName);
154
+ this._observeToolbarIntersection(sSectionName, oIntersectionObserver);
155
+ this._aIntersectionObservers.push(oIntersectionObserver);
156
+ }.bind(this));
102
157
  };
103
158
 
104
- Adaptation.prototype._hideElementsOnIntersection = function(aEntries) {
159
+ // Parameter sSectionName is used by the Fiori toolbar method
160
+ Adaptation.prototype._hideElementsOnIntersection = function(sSectionName, aEntries) {
105
161
  if (aEntries[0].intersectionRatio === 0) {
106
- this._observeActionToolbarIntersection();
162
+ this.adjustToolbarSectionWidths();
163
+ this._observeIntersections();
107
164
  return;
108
165
  }
109
- // Actions toolbar is no longer fully visible
166
+
167
+ // Section is no longer fully visible
110
168
  if (aEntries[0].intersectionRatio < 1) {
111
169
  if (!this._mSizeLimits.switchToIcons) {
112
- var iHiddenWidth = aEntries[0].boundingClientRect.width - aEntries[0].intersectionRect.width;
113
- this._mSizeLimits.switchToIcons = window.innerWidth + iHiddenWidth;
170
+ this._mSizeLimits.switchToIcons = this._calculateWindowWidth(aEntries);
114
171
  this._switchToIcons();
115
172
  }
116
173
  }
117
174
  };
118
175
 
119
- Adaptation.prototype.onFragmentLoaded = function() {
120
- return this._pFragmentLoaded;
176
+ Adaptation.prototype._createIntersectionObserver = function(sSectionName) {
177
+ return new IntersectionObserver(
178
+ this._hideElementsOnIntersection.bind(this, sSectionName),
179
+ {
180
+ threshold: 1,
181
+ root: this.getControl(sSectionName).getDomRef()
182
+ }
183
+ );
121
184
  };
122
185
 
123
- Adaptation.prototype.exit = function() {
124
- Device.media.detachHandler(this._onSizeChanged, this, DEVICE_SET);
125
- Base.prototype.exit.apply(this, arguments);
186
+ Adaptation.prototype._observeToolbarIntersection = function(sSectionName, oInstersectionObserver) {
187
+ var oHBox = this.getControl(sSectionName);
188
+ oHBox.getItems().map(function(oItem) {
189
+ var oItemDomRef = oItem.getDomRef();
190
+ oInstersectionObserver.observe(oItemDomRef);
191
+ });
126
192
  };
127
193
 
128
194
  Adaptation.prototype.show = function() {
129
- this._onSizeChanged(Device.media.getCurrentRange(DEVICE_SET), true);
130
- return Base.prototype.show.apply(this, arguments);
195
+ return Base.prototype.show.call(this, this.initialAdjustToolbarSectionWidths.bind(this))
196
+ .then(function() {
197
+ this._observeIntersections();
198
+ }.bind(this));
131
199
  };
132
200
 
133
201
  function setButtonProperties(sButtonName, sIcon, sTextKey, sToolTipKey) {
@@ -195,47 +263,21 @@ sap.ui.define([
195
263
  };
196
264
 
197
265
  Adaptation.prototype._switchToIcons = function() {
198
- var oIconBox = this.getControl("iconBox");
199
- var oIconSpacer = this.getControl("iconSpacer");
200
-
201
- oIconBox.setVisible(false);
202
- oIconSpacer.setVisible(false);
203
266
  this._showButtonIcon("adaptationSwitcherButton", "sap-icon://wrench", "BTN_ADAPTATION");
204
267
  this._showButtonIcon("navigationSwitcherButton", "sap-icon://explorer", "BTN_NAVIGATION");
205
268
  this._showButtonIcon("visualizationSwitcherButton", "sap-icon://show", "BTN_VISUALIZATION");
269
+
270
+ this._iSwitcherToolbarWidth = SWITCHER_ICON_WIDTH;
271
+ this.adjustToolbarSectionWidths();
206
272
  };
207
273
 
208
274
  Adaptation.prototype._switchToTexts = function () {
209
- var oIconBox = this.getControl("iconBox");
210
- var oIconSpacer = this.getControl("iconSpacer");
211
-
212
- oIconBox.setVisible(true);
213
- oIconSpacer.setVisible(true);
214
275
  this._showButtonText("adaptationSwitcherButton", "BTN_ADAPTATION");
215
276
  this._showButtonText("navigationSwitcherButton", "BTN_NAVIGATION");
216
277
  this._showButtonText("visualizationSwitcherButton", "BTN_VISUALIZATION");
217
- };
218
278
 
219
- Adaptation.prototype._onSizeChanged = function(mParams, bInitial) {
220
- if (mParams) {
221
- var sMode = mParams.name;
222
- this.sMode = sMode;
223
-
224
- switch (sMode) {
225
- case Adaptation.modes.MOBILE:
226
- this._switchToIcons();
227
- break;
228
- case Adaptation.modes.TABLET:
229
- case Adaptation.modes.DESKTOP:
230
- // this is already defined in the view
231
- if (!bInitial) {
232
- this._switchToTexts();
233
- }
234
- break;
235
- default:
236
- // no default
237
- }
238
- }
279
+ this._iSwitcherToolbarWidth = this._iSwitcherToolbarWidthWithTexts;
280
+ this.adjustToolbarSectionWidths();
239
281
  };
240
282
 
241
283
  /**
@@ -317,5 +359,15 @@ sap.ui.define([
317
359
  return oControl;
318
360
  };
319
361
 
362
+ /**
363
+ * @inheritDoc
364
+ */
365
+ Adaptation.prototype.hide = function() {
366
+ this._aIntersectionObservers.forEach(function(oInstersectionObserver) {
367
+ oInstersectionObserver.disconnect();
368
+ });
369
+ return Base.prototype.hide.apply(this, arguments);
370
+ };
371
+
320
372
  return Adaptation;
321
373
  });
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @extends sap.m.HBox
28
28
  *
29
29
  * @author SAP SE
30
- * @version 1.111.0
30
+ * @version 1.112.0
31
31
  *
32
32
  * @constructor
33
33
  * @private
@@ -184,10 +184,11 @@ sap.ui.define([
184
184
 
185
185
  /**
186
186
  * Makes the Toolbar visible
187
+ * @param {function} fnAdjustToolbarCallback - Called before the animation is triggered, e.g. for initial width calculations
187
188
  * @returns {Promise} A Promise which resolves after animation has been completed
188
189
  * @public
189
190
  */
190
- Base.prototype.show = function() {
191
+ Base.prototype.show = function(fnAdjustToolbarCallback) {
191
192
  // 1) create Promise and wait until DomRef is available
192
193
  return new Promise(function (fnResolve) {
193
194
  var oDelegate = {
@@ -202,6 +203,9 @@ sap.ui.define([
202
203
  }.bind(this))
203
204
  // 2) animate DomRef
204
205
  .then(function () {
206
+ if (fnAdjustToolbarCallback && typeof fnAdjustToolbarCallback === "function") {
207
+ fnAdjustToolbarCallback();
208
+ }
205
209
  return this.animation
206
210
  ? Animation.waitTransition(this.getDomRef(), this.addStyleClass.bind(this, "is_visible"))
207
211
  : Promise.resolve();
@@ -32,7 +32,7 @@ function(
32
32
  * @extends sap.ui.rta.toolbar.Adaptation
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.111.0
35
+ * @version 1.112.0
36
36
  *
37
37
  * @constructor
38
38
  * @private
@@ -76,7 +76,8 @@ function(
76
76
  this._checkLogoSize(oLogo, iWidth, iHeight);
77
77
  }
78
78
 
79
- this.getControl("iconSpacer").setWidth("10%");
79
+ this.getControl("iconSpacer").setWidth("8px");
80
+ this._iLogoWidth = iWidth + 8;
80
81
 
81
82
  // first control is the left HBox
82
83
  this.getControl("iconBox").addItem(
@@ -91,13 +92,13 @@ function(
91
92
  }.bind(this));
92
93
  };
93
94
 
95
+ /**
96
+ * @inheritDoc
97
+ */
94
98
  Fiori.prototype.hide = function () {
95
99
  return Adaptation.prototype.hide.apply(this, arguments)
96
100
  .then(function () {
97
- //TODO: this._oFioriHeader should never be empty here
98
- if (this._oFioriHeader) {
99
- this._oFioriHeader.removeStyleClass(FIORI_HIDDEN_CLASS);
100
- }
101
+ this._oFioriHeader.removeStyleClass(FIORI_HIDDEN_CLASS);
101
102
  }.bind(this));
102
103
  };
103
104
 
@@ -114,13 +115,51 @@ function(
114
115
  }
115
116
  };
116
117
 
118
+ Fiori.prototype._restoreHiddenElements = function() {
119
+ if (this._iLogoVisibilityLimit && window.innerWidth > this._iLogoVisibilityLimit) {
120
+ this._setLogoVisibility(true);
121
+ delete this._iLogoVisibilityLimit;
122
+ }
123
+ Adaptation.prototype._restoreHiddenElements.apply(this);
124
+ };
125
+
126
+ Fiori.prototype._hideElementsOnIntersection = function(sSectionName, aEntries) {
127
+ var bWiderThanLogo;
128
+
129
+ if (aEntries[0].intersectionRatio === 0) {
130
+ this.adjustToolbarSectionWidths();
131
+ this._observeIntersections();
132
+ return;
133
+ }
134
+ if (aEntries[0].intersectionRatio < 1) {
135
+ if (
136
+ !this._iLogoVisibilityLimit
137
+ && sSectionName === Adaptation.LEFT_SECTION
138
+ ) {
139
+ var iHiddenWidth = aEntries[0].boundingClientRect.width - aEntries[0].intersectionRect.width;
140
+ bWiderThanLogo = iHiddenWidth > this._iLogoWidth;
141
+ this._iLogoVisibilityLimit = this._calculateWindowWidth(aEntries);
142
+ this._setLogoVisibility(false);
143
+ if (bWiderThanLogo) {
144
+ Adaptation.prototype._hideElementsOnIntersection.apply(this, arguments);
145
+ }
146
+ return;
147
+ }
148
+ }
149
+ Adaptation.prototype._hideElementsOnIntersection.apply(this, arguments);
150
+ };
151
+
152
+ Fiori.prototype._setLogoVisibility = function(bVisible) {
153
+ var oIconBox = this.getControl("iconBox");
154
+ var oIconSpacer = this.getControl("iconSpacer");
155
+ oIconBox.setVisible(bVisible);
156
+ oIconSpacer.setVisible(bVisible);
157
+ };
158
+
117
159
  Fiori.prototype.destroy = function () {
118
- // In case of destroy() without normal hide() call.
160
+ // In case of destroy() without normal hide() call
119
161
  this._oFioriHeader.removeStyleClass(FIORI_HIDDEN_CLASS);
120
162
 
121
- delete this._oRenderer;
122
- delete this._oFioriHeader;
123
-
124
163
  Adaptation.prototype.destroy.apply(this, arguments);
125
164
  };
126
165
 
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.111.0
23
+ * @version 1.112.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @extends sap.m.OverflowToolbarButton
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.111.0
26
+ * @version 1.112.0
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -22,7 +22,7 @@ function(
22
22
  * @extends sap.ui.rta.toolbar.Base
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.111.0
25
+ * @version 1.112.0
26
26
  *
27
27
  * @constructor
28
28
  * @private
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.111.0
23
+ * @version 1.112.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -15,7 +15,8 @@ sap.ui.define([
15
15
  "sap/ui/rta/Utils",
16
16
  "sap/ui/model/Filter",
17
17
  "sap/ui/model/FilterOperator",
18
- "sap/ui/model/json/JSONModel"
18
+ "sap/ui/model/json/JSONModel",
19
+ "sap/ui/core/date/UI5Date"
19
20
  ],
20
21
  function(
21
22
  Log,
@@ -27,7 +28,8 @@ function(
27
28
  Utils,
28
29
  Filter,
29
30
  FilterOperator,
30
- JSONModel
31
+ JSONModel,
32
+ UI5Date
31
33
  ) {
32
34
  "use strict";
33
35
 
@@ -67,6 +69,7 @@ function(
67
69
  controller: {
68
70
  formatContextColumnCell: formatContextColumnCell.bind(this),
69
71
  formatContextColumnTooltip: formatContextColumnTooltip.bind(this),
72
+ formatCreatedChangedOnColumnCell: formatCreatedChangedOnColumnCell.bind(this),
70
73
  onLiveSearch: onLiveSearch.bind(this),
71
74
  moveUp: moveUp.bind(this),
72
75
  moveDown: moveDown.bind(this),
@@ -78,10 +81,6 @@ function(
78
81
  this._oManageAdaptationDialog = oDialog;
79
82
  oDialog.addStyleClass(Utils.getRtaStyleClassName());
80
83
  this.getToolbar().addDependent(this._oManageAdaptationDialog);
81
- // TODO: discuss how to set width, height etc. when we finish implementing this dialog
82
- oDialog.setContentWidth("650px");
83
- oDialog.setContentHeight("450px");
84
- oDialog.setHorizontalScrolling(false);
85
84
  }.bind(this));
86
85
  } else {
87
86
  setEnabledPropertyOfMoveButton.call(this, false);
@@ -120,6 +119,17 @@ function(
120
119
  return aRoles.join("\n");
121
120
  }
122
121
 
122
+ function formatCreatedChangedOnColumnCell(sModifiedBy, sModifiedDate) {
123
+ var oUi5Date = UI5Date.getInstance(sModifiedDate);
124
+ var oOptions = {
125
+ year: "numeric",
126
+ month: "short",
127
+ day: "numeric"
128
+ };
129
+ var sLanguage = sap.ui.getCore().getConfiguration().getLanguage();
130
+ return sModifiedBy + "\n" + oUi5Date.toLocaleDateString(sLanguage, oOptions);
131
+ }
132
+
123
133
  function onSelectionChange(oEvent) {
124
134
  if (oEvent.getParameter("selected") === true) {
125
135
  this._oControlConfigurationModel.setProperty("/isTableItemSelected", true);
@@ -5,6 +5,9 @@
5
5
  <Dialog
6
6
  resizable="true"
7
7
  draggable="true"
8
+ contentWidth="830px"
9
+ contentHeight="450px"
10
+ setHorizontalScrolling="false"
8
11
  title="{i18n>MANAGE_ADAPTATIONS_DIALOG_HEADER}">
9
12
  <Table id="manageAdaptationsTable"
10
13
  showNoData="false"
@@ -52,6 +55,18 @@
52
55
  hAlign="Left">
53
56
  <Text text="{i18n>CLM_HEADER_CONTEXT}" />
54
57
  </Column>
58
+ <Column minScreenWidth="tablet"
59
+ demandPopin="true"
60
+ popinDisplay="Inline"
61
+ hAlign="Left">
62
+ <Text text="{i18n>CLM_HEADER_ADAPTATIONS_CREATED_ON}" />
63
+ </Column>
64
+ <Column minScreenWidth="tablet"
65
+ demandPopin="true"
66
+ popinDisplay="Inline"
67
+ hAlign="Left">
68
+ <Text text="{i18n>CLM_HEADER_ADAPTATIONS_CHANGED_ON}" />
69
+ </Column>
55
70
  <Column width="7rem"
56
71
  minScreenWidth="tablet"
57
72
  demandPopin="true"
@@ -80,6 +95,8 @@
80
95
  </CustomListItem>
81
96
  <Text text="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnCell'}"
82
97
  tooltip="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnTooltip'}" />
98
+ <Text text="{ parts: ['contextBased>createdBy', 'contextBased>createdAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
99
+ <Text text="{ parts: ['contextBased>changedBy', 'contextBased>changedAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
83
100
  <MenuButton text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}">
84
101
  <menu>
85
102
  <Menu itemSelected="onMenuAction">
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class
39
39
  *
40
40
  * @author SAP SE
41
- * @version 1.111.0
41
+ * @version 1.112.0
42
42
  *
43
43
  * @constructor
44
44
  * @private
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @class
50
50
  *
51
51
  * @author SAP SE
52
- * @version 1.111.0
52
+ * @version 1.112.0
53
53
  *
54
54
  * @constructor
55
55
  * @private
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @class
37
37
  *
38
38
  * @author SAP SE
39
- * @version 1.111.0
39
+ * @version 1.112.0
40
40
  *
41
41
  * @constructor
42
42
  * @private
@@ -68,7 +68,7 @@ sap.ui.define([
68
68
  * Constructor for a new sap.ui.rta.util.PluginManager
69
69
  * @extends sap.ui.base.ManagedObject
70
70
  * @author SAP SE
71
- * @version 1.111.0
71
+ * @version 1.112.0
72
72
  * @constructor
73
73
  * @private
74
74
  * @since 1.86
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  * Constructor for a new sap.ui.rta.util.PopupManager
43
43
  * @extends sap.ui.base.ManagedObject
44
44
  * @author SAP SE
45
- * @version 1.111.0
45
+ * @version 1.112.0
46
46
  * @constructor
47
47
  * @private
48
48
  * @since 1.48
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @namespace sap.ui.rta.util.ReloadManager
31
31
  * @alias sap.ui.rta.util.ReloadManager
32
32
  * @since 1.104
33
- * @version 1.111.0
33
+ * @version 1.112.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -19,7 +19,7 @@ function(
19
19
  *
20
20
  * @extends sap.ui.core.EventBus
21
21
  * @author SAP SE
22
- * @version 1.111.0
22
+ * @version 1.112.0
23
23
  * @private
24
24
  * @since 1.56.0
25
25
  * @alias sap.ui.rta.util.ServiceEventBus
@@ -18,21 +18,28 @@ sap.ui.define([], function() {
18
18
  return module.getParams()[sParamName];
19
19
  };
20
20
 
21
- module.getParams = function () {
22
- return document.location.search
23
- .replace(/^\?/, '')
24
- .split('&')
21
+ /**
22
+ * Get URL parameters object from the url or given url string
23
+ * @param {string} [sUrl] - Url parameter string notation starting with ? and following key value pair
24
+ * @returns {object} Object with key value pairs of given parameters
25
+ */
26
+ module.getParams = function (sUrl) {
27
+ sUrl = (sUrl || sUrl === "") ? sUrl : document.location.search;
28
+ return sUrl
29
+ .replace(/^\?/, "")
30
+ .split("&")
25
31
  .reduce(function (mParams, sParam) {
26
- var aParts = sParam.split('='); //split on key/value
32
+ var aParts = sParam.split("="); //split on key/value
27
33
  var sValue = aParts[1];
28
34
 
29
35
  switch (sValue) {
30
- case 'true':
36
+ case "true":
31
37
  sValue = true;
32
38
  break;
33
- case 'false':
39
+ case "false":
34
40
  sValue = false;
35
41
  break;
42
+ default: break;
36
43
  }
37
44
 
38
45
  mParams[aParts[0]] = sValue;
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
41
41
  * @author SAP SE
42
42
  * @since 1.84.0
43
- * @version 1.111.0
43
+ * @version 1.112.0
44
44
  * @private
45
45
  */
46
46
  var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {