@openui5/sap.f 1.108.2 → 1.110.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 (187) hide show
  1. package/.reuse/dep5 +16 -16
  2. package/THIRDPARTY.txt +2 -2
  3. package/package.json +4 -4
  4. package/src/sap/f/.library +2 -2
  5. package/src/sap/f/Avatar.js +2 -2
  6. package/src/sap/f/AvatarGroup.js +2 -2
  7. package/src/sap/f/AvatarGroupItem.js +2 -2
  8. package/src/sap/f/AvatarGroupItemRenderer.js +1 -1
  9. package/src/sap/f/AvatarGroupRenderer.js +3 -6
  10. package/src/sap/f/CalendarAppointmentInCard.js +2 -2
  11. package/src/sap/f/CalendarInCard.js +2 -2
  12. package/src/sap/f/CalendarInCardRenderer.js +1 -1
  13. package/src/sap/f/Card.js +2 -2
  14. package/src/sap/f/CardBase.js +22 -7
  15. package/src/sap/f/CardRenderer.js +1 -1
  16. package/src/sap/f/DynamicPage.js +4 -32
  17. package/src/sap/f/DynamicPageAccessibleLandmarkInfo.js +2 -2
  18. package/src/sap/f/DynamicPageHeader.js +4 -4
  19. package/src/sap/f/DynamicPageHeaderRenderer.js +1 -1
  20. package/src/sap/f/DynamicPageRenderer.js +1 -1
  21. package/src/sap/f/DynamicPageTitle.js +7 -7
  22. package/src/sap/f/DynamicPageTitleRenderer.js +1 -1
  23. package/src/sap/f/FlexibleColumnLayout.js +4 -4
  24. package/src/sap/f/FlexibleColumnLayoutAccessibleLandmarkInfo.js +2 -2
  25. package/src/sap/f/FlexibleColumnLayoutRenderer.js +1 -1
  26. package/src/sap/f/FlexibleColumnLayoutSemanticHelper.js +6 -6
  27. package/src/sap/f/GridContainer.js +41 -18
  28. package/src/sap/f/GridContainerItemLayoutData.js +2 -2
  29. package/src/sap/f/GridContainerRenderer.js +9 -5
  30. package/src/sap/f/GridContainerSettings.js +3 -3
  31. package/src/sap/f/GridContainerUtils.js +5 -5
  32. package/src/sap/f/GridList.js +2 -2
  33. package/src/sap/f/GridListItem.js +2 -2
  34. package/src/sap/f/GridListItemRenderer.js +1 -1
  35. package/src/sap/f/GridListRenderer.js +1 -1
  36. package/src/sap/f/GridNavigationMatrix.js +3 -3
  37. package/src/sap/f/IllustratedMessage.js +2 -2
  38. package/src/sap/f/Illustration.js +2 -2
  39. package/src/sap/f/IllustrationPool.js +1 -1
  40. package/src/sap/f/PlanningCalendarInCardLegend.js +2 -2
  41. package/src/sap/f/PlanningCalendarInCardLegendRenderer.js +1 -1
  42. package/src/sap/f/ProductSwitch.js +2 -50
  43. package/src/sap/f/ProductSwitchItem.js +2 -2
  44. package/src/sap/f/ProductSwitchItemRenderer.js +1 -2
  45. package/src/sap/f/ProductSwitchRenderer.js +1 -1
  46. package/src/sap/f/SearchManager.js +2 -2
  47. package/src/sap/f/ShellBar.js +6 -6
  48. package/src/sap/f/ShellBarRenderer.js +1 -1
  49. package/src/sap/f/SidePanel.js +397 -87
  50. package/src/sap/f/SidePanelItem.js +2 -3
  51. package/src/sap/f/SidePanelRenderer.js +63 -20
  52. package/src/sap/f/cards/BaseHeader.js +12 -21
  53. package/src/sap/f/cards/Header.js +3 -3
  54. package/src/sap/f/cards/HeaderRenderer.js +12 -16
  55. package/src/sap/f/cards/NumericHeader.js +12 -4
  56. package/src/sap/f/cards/NumericHeaderRenderer.js +11 -15
  57. package/src/sap/f/cards/NumericIndicators.js +11 -3
  58. package/src/sap/f/cards/NumericIndicatorsRenderer.js +7 -4
  59. package/src/sap/f/cards/NumericSideIndicator.js +2 -2
  60. package/src/sap/f/cards/NumericSideIndicatorRenderer.js +1 -1
  61. package/src/sap/f/cards/loading/AnalyticalPlaceholder.js +2 -2
  62. package/src/sap/f/cards/loading/CalendarPlaceholder.js +5 -6
  63. package/src/sap/f/cards/loading/GenericPlaceholder.js +2 -2
  64. package/src/sap/f/cards/loading/ListPlaceholder.js +6 -6
  65. package/src/sap/f/cards/loading/ObjectPlaceholder.js +2 -2
  66. package/src/sap/f/cards/loading/TablePlaceholder.js +6 -6
  67. package/src/sap/f/cards/loading/TimelinePlaceholder.js +7 -7
  68. package/src/sap/f/changeHandler/MoveDynamicPageTitleActions.js +2 -2
  69. package/src/sap/f/delegate/GridContainerItemNavigation.js +20 -42
  70. package/src/sap/f/delegate/GridItemNavigation.js +8 -18
  71. package/src/sap/f/designtime/Avatar.designtime.js +1 -1
  72. package/src/sap/f/designtime/DynamicPage.designtime.js +1 -1
  73. package/src/sap/f/designtime/DynamicPageHeader.designtime.js +1 -1
  74. package/src/sap/f/designtime/DynamicPageTitle.designtime.js +1 -1
  75. package/src/sap/f/designtime/SemanticPage.designtime.js +1 -1
  76. package/src/sap/f/designtime/library.designtime.js +1 -1
  77. package/src/sap/f/dnd/GridDragOver.js +11 -5
  78. package/src/sap/f/dnd/GridDropInfo.js +43 -4
  79. package/src/sap/f/dnd/GridKeyboardDragAndDrop.js +1 -1
  80. package/src/sap/f/flexibility/Avatar.flexibility.js +1 -1
  81. package/src/sap/f/flexibility/DynamicPageTitle.flexibility.js +1 -1
  82. package/src/sap/f/library.js +3 -3
  83. package/src/sap/f/library.support.js +1 -1
  84. package/src/sap/f/messagebundle.properties +11 -0
  85. package/src/sap/f/messagebundle_ar.properties +7 -0
  86. package/src/sap/f/messagebundle_bg.properties +7 -0
  87. package/src/sap/f/messagebundle_ca.properties +7 -0
  88. package/src/sap/f/messagebundle_cs.properties +16 -9
  89. package/src/sap/f/messagebundle_cy.properties +7 -0
  90. package/src/sap/f/messagebundle_da.properties +7 -0
  91. package/src/sap/f/messagebundle_de.properties +7 -0
  92. package/src/sap/f/messagebundle_el.properties +7 -0
  93. package/src/sap/f/messagebundle_en.properties +7 -0
  94. package/src/sap/f/messagebundle_en_GB.properties +7 -0
  95. package/src/sap/f/messagebundle_en_US_sappsd.properties +7 -0
  96. package/src/sap/f/messagebundle_en_US_saprigi.properties +7 -0
  97. package/src/sap/f/messagebundle_en_US_saptrc.properties +7 -0
  98. package/src/sap/f/messagebundle_es.properties +7 -0
  99. package/src/sap/f/messagebundle_es_MX.properties +7 -0
  100. package/src/sap/f/messagebundle_et.properties +7 -0
  101. package/src/sap/f/messagebundle_fi.properties +7 -0
  102. package/src/sap/f/messagebundle_fr.properties +7 -0
  103. package/src/sap/f/messagebundle_fr_CA.properties +7 -0
  104. package/src/sap/f/messagebundle_hi.properties +7 -0
  105. package/src/sap/f/messagebundle_hr.properties +8 -1
  106. package/src/sap/f/messagebundle_hu.properties +7 -0
  107. package/src/sap/f/messagebundle_id.properties +7 -0
  108. package/src/sap/f/messagebundle_it.properties +7 -0
  109. package/src/sap/f/messagebundle_iw.properties +7 -0
  110. package/src/sap/f/messagebundle_ja.properties +7 -0
  111. package/src/sap/f/messagebundle_kk.properties +7 -0
  112. package/src/sap/f/messagebundle_ko.properties +7 -0
  113. package/src/sap/f/messagebundle_lt.properties +7 -0
  114. package/src/sap/f/messagebundle_lv.properties +7 -0
  115. package/src/sap/f/messagebundle_ms.properties +7 -0
  116. package/src/sap/f/messagebundle_nl.properties +7 -0
  117. package/src/sap/f/messagebundle_no.properties +7 -0
  118. package/src/sap/f/messagebundle_pl.properties +7 -0
  119. package/src/sap/f/messagebundle_pt.properties +7 -0
  120. package/src/sap/f/messagebundle_pt_PT.properties +7 -0
  121. package/src/sap/f/messagebundle_ro.properties +7 -0
  122. package/src/sap/f/messagebundle_ru.properties +7 -0
  123. package/src/sap/f/messagebundle_sh.properties +7 -0
  124. package/src/sap/f/messagebundle_sk.properties +7 -0
  125. package/src/sap/f/messagebundle_sl.properties +7 -0
  126. package/src/sap/f/messagebundle_sv.properties +7 -0
  127. package/src/sap/f/messagebundle_th.properties +7 -0
  128. package/src/sap/f/messagebundle_tr.properties +7 -0
  129. package/src/sap/f/messagebundle_uk.properties +7 -0
  130. package/src/sap/f/messagebundle_vi.properties +7 -0
  131. package/src/sap/f/messagebundle_zh_CN.properties +7 -0
  132. package/src/sap/f/messagebundle_zh_TW.properties +7 -0
  133. package/src/sap/f/routing/Router.js +1 -1
  134. package/src/sap/f/routing/Target.js +1 -1
  135. package/src/sap/f/routing/TargetHandler.js +1 -1
  136. package/src/sap/f/routing/Targets.js +1 -1
  137. package/src/sap/f/routing/async/Target.js +1 -1
  138. package/src/sap/f/routing/async/Targets.js +1 -1
  139. package/src/sap/f/rules/Avatar.support.js +1 -1
  140. package/src/sap/f/rules/DynamicPage.support.js +1 -1
  141. package/src/sap/f/semantic/AddAction.js +2 -2
  142. package/src/sap/f/semantic/CloseAction.js +2 -2
  143. package/src/sap/f/semantic/CopyAction.js +2 -2
  144. package/src/sap/f/semantic/DeleteAction.js +2 -2
  145. package/src/sap/f/semantic/DiscussInJamAction.js +2 -2
  146. package/src/sap/f/semantic/EditAction.js +2 -2
  147. package/src/sap/f/semantic/ExitFullScreenAction.js +2 -2
  148. package/src/sap/f/semantic/FavoriteAction.js +2 -2
  149. package/src/sap/f/semantic/FlagAction.js +2 -2
  150. package/src/sap/f/semantic/FooterMainAction.js +2 -2
  151. package/src/sap/f/semantic/FullScreenAction.js +2 -2
  152. package/src/sap/f/semantic/MainAction.js +2 -2
  153. package/src/sap/f/semantic/MessagesIndicator.js +2 -2
  154. package/src/sap/f/semantic/NegativeAction.js +2 -2
  155. package/src/sap/f/semantic/PositiveAction.js +2 -2
  156. package/src/sap/f/semantic/PrintAction.js +2 -2
  157. package/src/sap/f/semantic/SemanticButton.js +2 -2
  158. package/src/sap/f/semantic/SemanticConfiguration.js +4 -8
  159. package/src/sap/f/semantic/SemanticContainer.js +1 -1
  160. package/src/sap/f/semantic/SemanticControl.js +2 -2
  161. package/src/sap/f/semantic/SemanticFooter.js +1 -1
  162. package/src/sap/f/semantic/SemanticPage.js +6 -6
  163. package/src/sap/f/semantic/SemanticPageRenderer.js +1 -1
  164. package/src/sap/f/semantic/SemanticShareMenu.js +1 -1
  165. package/src/sap/f/semantic/SemanticTitle.js +1 -1
  166. package/src/sap/f/semantic/SemanticToggleButton.js +2 -2
  167. package/src/sap/f/semantic/SendEmailAction.js +2 -2
  168. package/src/sap/f/semantic/SendMessageAction.js +2 -2
  169. package/src/sap/f/semantic/ShareInJamAction.js +2 -2
  170. package/src/sap/f/semantic/TitleMainAction.js +2 -2
  171. package/src/sap/f/shellBar/Accessibility.js +1 -1
  172. package/src/sap/f/shellBar/AdditionalContentSupport.js +2 -2
  173. package/src/sap/f/shellBar/CoPilot.js +2 -2
  174. package/src/sap/f/shellBar/CoPilotRenderer.js +12 -7
  175. package/src/sap/f/shellBar/ControlSpacer.js +2 -2
  176. package/src/sap/f/shellBar/ControlSpacerRenderer.js +1 -1
  177. package/src/sap/f/shellBar/Factory.js +1 -1
  178. package/src/sap/f/shellBar/ResponsiveHandler.js +1 -1
  179. package/src/sap/f/shellBar/Search.js +2 -2
  180. package/src/sap/f/shellBar/SearchRenderer.js +1 -1
  181. package/src/sap/f/themes/base/DynamicPage.less +4 -1
  182. package/src/sap/f/themes/base/FlexibleColumnLayout.less +1 -1
  183. package/src/sap/f/themes/base/GridList.less +4 -0
  184. package/src/sap/f/themes/base/ShellBar.less +6 -0
  185. package/src/sap/f/themes/base/SidePanel.less +189 -29
  186. package/src/sap/f/themes/base/library.source.less +1 -1
  187. package/src/sap/f/themes/sap_hcb/library.source.less +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * OpenUI5
3
- * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
3
+ * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
@@ -10,6 +10,7 @@ sap.ui.define([
10
10
  "sap/ui/core/Control",
11
11
  "sap/ui/core/Core",
12
12
  "sap/ui/core/Icon",
13
+ "sap/ui/core/Popup",
13
14
  "sap/ui/core/ResizeHandler",
14
15
  "sap/ui/core/delegate/ScrollEnablement",
15
16
  'sap/ui/core/delegate/ItemNavigation',
@@ -30,6 +31,7 @@ sap.ui.define([
30
31
  Control,
31
32
  Core,
32
33
  Icon,
34
+ Popup,
33
35
  ResizeHandler,
34
36
  ScrollEnablement,
35
37
  ItemNavigation,
@@ -52,6 +54,17 @@ sap.ui.define([
52
54
  var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.f"),
53
55
  InvisibleMessageMode = coreLibrary.InvisibleMessageMode;
54
56
 
57
+ // Resize positions
58
+ var SIDE_PANEL_POSITION_MIN_WIDTH = 0, // Minimum width
59
+ SIDE_PANEL_POSITION_INITIAL = 1, // Initial width
60
+ SIDE_PANEL_POSITION_MAX_WIDTH = 2; // Maximum width
61
+
62
+ // Split breakpoint
63
+ var SIDE_PANEL_SPLIT_BREAKPOINT = 560;
64
+ // When there is an action item chosen and the width of the expanded side panel is less or equal to this value,
65
+ // the expanded action bar takes the whole width and hides the side content, otherwise the action bar takes
66
+ // 20rem (its default width), and the rest of the side panel width is taken by the expanded side content.
67
+
55
68
  /**
56
69
  * Constructor for a new <code>SidePanel</code>.
57
70
  *
@@ -63,14 +76,14 @@ sap.ui.define([
63
76
  * <h3>Overview</h3>
64
77
  *
65
78
  * <code>SidePanel</code> is a layout control that allows primary and additional content to be
66
- * displayed by clicking/tapping the action items from its action bar.
79
+ * displayed by choosing the action items from its action bar.
67
80
  *
68
81
  * <h3>Usage</h3>
69
82
  *
70
83
  * Action bar with action items have two states - collapsed and expanded. In collapsed state
71
84
  * only icons are displayed, and in expanded state both icons and titles are displayed.
72
85
  *
73
- * Each action item can have a content and click/tap on action item toggles the display of its content.
86
+ * Each action item can have a content and choose an action item toggles the display of its content.
74
87
  * The content can be added to the action item's <code>content</code> aggregation, or can be added or
75
88
  * changed later.
76
89
  *
@@ -91,13 +104,7 @@ sap.ui.define([
91
104
  * action items, an overflow icon is displayed, and it toggles ON/OFF an overflow menu with the rest
92
105
  * of the action items that are not visible at the moment.
93
106
  *
94
- * Screen width > 1440 px
95
- *
96
- * <ul><li>When expanded, the side content shrinks the main content.</li></ul>
97
- *
98
- * Screen width <= 1440 px
99
- *
100
- * <ul><li>When expanded, the side content is placed over the main content.</li></ul>
107
+ * When expanded, the side content shrinks the main content.
101
108
  *
102
109
  * <b>On mobile device</b>
103
110
  *
@@ -105,6 +112,14 @@ sap.ui.define([
105
112
  * display, and when expanded, the side content is displayed above the action bar. If there is not enough
106
113
  * room for all action items, the action bar can be swiped to access the rest of the action items.
107
114
  *
115
+ * <h3>Resizing</h3>
116
+ *
117
+ * Resizing functionality only affects desktop or tablet devices.
118
+ *
119
+ * By setting the <code>sidePanelResizable</code> property, the expanded side panel can be resized
120
+ * by mouse (by drag or by double click on resize splitter), by keyboard or by choosing one of three predefined positions
121
+ * in the side panel's context menu (min, max and default widths)
122
+ *
108
123
  * <h3>Keyboard shortcuts</h3>
109
124
  *
110
125
  * <ul>
@@ -117,16 +132,26 @@ sap.ui.define([
117
132
  * <li>[Esc] - Close the opened side content panel and set focus back to main content</li>
118
133
  * </ul>
119
134
  *
135
+ * If the side panel's <code>sidePanelResizable</code> property is set, there is an action item chosen, and the resize splitter is focused:
136
+ *
137
+ * <ul>
138
+ * <li>[Home] - set the expanded side panel width to the minimum value defined in <code>sidePanelMinWidth</code> property</li>
139
+ * <li>[End] - set the expanded side panel width to the maximum value defined in <code>sidePanelMaxWidth</code> property</li>
140
+ * <li>[Enter] - set the expanded side panel width to the default value defined in <code>sidePanelWidth</code> property</li>
141
+ * <li>[Shift]+[F10] or [Context menu] - show the resize context menu</li>
142
+ * <li>[Arrow Left] / [Arrow Right] - increase/decrease the width of the expanded side panel with the regular step</li>
143
+ * <li>[Shift] + [Arrow Left] / [Arrow Right] - increase/decrease the width of the expanded side panel with the larger step</li>
144
+ * </ul>
145
+ *
120
146
  * @extends sap.ui.core.Control
121
147
  *
122
148
  * @author SAP SE
123
- * @version 1.108.2
149
+ * @version 1.110.0
124
150
  *
125
151
  * @constructor
126
152
  * @public
127
153
  * @since 1.107
128
154
  * @alias sap.f.SidePanel
129
- * @experimental Since 1.107. This class is experimental and provides only limited functionality. Also the API might be changed in future.
130
155
  * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
131
156
  */
132
157
  var SidePanel = Control.extend("sap.f.SidePanel", {
@@ -143,6 +168,13 @@ sap.ui.define([
143
168
  */
144
169
  ariaLabel: {type: "string", group: "Accessibility", defaultValue: "Side Panel" },
145
170
 
171
+ /**
172
+ * Determines whether the side panel is resizable or fixed.
173
+ * <b>Note:</b> setting this property only affects desktop or tablet devices.
174
+ * @since: 1.109
175
+ */
176
+ sidePanelResizable: {type: "boolean", group: "Appearance", defaultValue: false},
177
+
146
178
  /**
147
179
  * Determines the side panel width (Side Content width + Action Bar width).
148
180
  * <b>Note:</b> if the width is given in percent(%), it is calculated as given percent from the Side Panel parent container width,
@@ -154,17 +186,33 @@ sap.ui.define([
154
186
  * Determines the minimum side panel width (Side Content width + Action Bar width).
155
187
  * <b>Note:</b> if the width is given in percent(%), it is calculated as given percent from the Side Panel parent container width,
156
188
  * otherwise it's calculated in absolute units.
157
- * @private
189
+ * @since 1.109.0
158
190
  */
159
- sidePanelMinWidth: { type: "sap.ui.core.CSSSize", group: "Appearance", defaultValue: "10%", visibility: "hidden" },
191
+ sidePanelMinWidth: { type: "sap.ui.core.CSSSize", group: "Appearance", defaultValue: "15rem"},
160
192
 
161
193
  /**
162
194
  * Determines the maximum side panel width (Side Content width + Action Bar width).
163
195
  * <b>Note:</b> if the width is given in percent(%), it is calculated as given percent from the Side Panel parent container width,
164
196
  * otherwise it's calculated in absolute units.
165
- * @private
197
+ * @since 1.109.0
166
198
  */
167
- sidePanelMaxWidth: { type: "sap.ui.core.CSSSize", group: "Appearance", defaultValue: "90%", visibility: "hidden" },
199
+ sidePanelMaxWidth: { type: "sap.ui.core.CSSSize", group: "Appearance", defaultValue: "90%"},
200
+
201
+ /**
202
+ * Determines the step (in pixels) when changing the width of the side panel with the keyboard.
203
+ * <b>Note:</b> the width can be changed by this step with <code>Left Arrow</code> and <code>Right Arrow</code>
204
+ * keys when the resize splitter is focused.
205
+ * @since 1.109.0
206
+ */
207
+ sidePanelResizeStep: { type: "int", group: "Appearance", defaultValue: 10},
208
+
209
+ /**
210
+ * Determines the large step (in pixels) when changing the width of the side panel with the keyboard.
211
+ * <b>Note:</b> the width can be changed by large step with <code>Shift + Left Arrow</code> and
212
+ * <code>Shift + Right Arrow</code> keys when the resize splitter is focused.
213
+ * @since 1.109.0
214
+ */
215
+ sidePanelResizeLargerStep: { type: "int", group: "Appearance", defaultValue: 100},
168
216
 
169
217
  /**
170
218
  * Determines whether the side content is visible or hidden.
@@ -203,7 +251,13 @@ sap.ui.define([
203
251
  /**
204
252
  * Overflow menu. It displays action items that don't fit in the available height of the side panel.
205
253
  */
206
- _overflowMenu: { type: "sap.m.Menu", multiple: false, visibility: "hidden"}
254
+ _overflowMenu: { type: "sap.m.Menu", multiple: false, visibility: "hidden"},
255
+
256
+ /**
257
+ * Context menu. It displays predefined options for side panel resize.
258
+ */
259
+ _contextMenu: { type: "sap.m.Menu", multiple: false, visibility: "hidden"}
260
+
207
261
  },
208
262
  associations: {
209
263
  /**
@@ -237,7 +291,8 @@ sap.ui.define([
237
291
  }
238
292
  }
239
293
  }
240
- }
294
+ },
295
+ renderer: SidePanelRenderer
241
296
  });
242
297
 
243
298
  SidePanel.prototype.init = function() {
@@ -270,11 +325,19 @@ sap.ui.define([
270
325
  this.setAggregation("_overflowMenu", oMenu);
271
326
  }
272
327
 
273
- this._onResizeRef = this._onResize.bind(this);
274
- this._onMainScroll = this._handleScroll.bind(this);
328
+ this._fnOnResizeRef = this._onResize.bind(this);
329
+ this._fnOnMainScroll = this._handleScroll.bind(this);
330
+ this._fnOnMainFocusOut = this._onMainFocusOut.bind(this);
331
+ this._fnOnTouchStart = this._onTouchStart.bind(this);
332
+ this._fnOnTouchEnd = this._onTouchEnd.bind(this);
333
+ this._fnOnTouchMove = this._onTouchMove.bind(this);
334
+ this._fnOnDblClick = this._onDblClick.bind(this);
275
335
 
276
336
  this._iLastScrollPosition = 0;
277
337
 
338
+ this._iSidePanelPosition = SIDE_PANEL_POSITION_INITIAL; // possible values: SIDE_PANEL_POSITION_MIN_WIDTH/SIDE_PANEL_POSITION_INITIAL/SIDE_PANEL_POSITION_MAX_WIDTH
339
+ this._bShouldAttachGlobalHandlers = true; // flag for attachment of "global" event handlers (on whole Side Panel control)
340
+
278
341
  this._iVisibleItems = 0; // how many action items can fit in the available height of the action bar
279
342
  this._bOverflowMenuOpened = false; // whether the overflow menu is opened or not
280
343
  this._mOverflowItemsMap = {}; // map of the items placed in overflow menu in format {menu item Id: SidePanelItem}
@@ -286,6 +349,24 @@ sap.ui.define([
286
349
  this._detachResizeHandlers();
287
350
  this._detachScrollHandler();
288
351
  this._detachMainFocusOutHandler();
352
+ this._detachResizableHandlers();
353
+ };
354
+
355
+ /**
356
+ * Override <code>sidePanelWidth</code> property setter.
357
+ *
358
+ * Sets the width of the side panel.
359
+ *
360
+ * @param {sap.ui.core.CSSSize} oWidth width of the side panel.
361
+ * @returns {this} this for method chaining
362
+ */
363
+ SidePanel.prototype.setSidePanelWidth = function(oWidth) {
364
+ this.setProperty("sidePanelWidth", oWidth);
365
+ if (this.getDomRef()) {
366
+ this._sSidePanelWidth = this._getSidePanelWidth();
367
+ }
368
+
369
+ return this;
289
370
  };
290
371
 
291
372
  /**
@@ -334,9 +415,9 @@ sap.ui.define([
334
415
 
335
416
  this._detachResizeHandlers();
336
417
  this._attachResizeHandlers();
337
-
338
418
  this._detachScrollHandler();
339
419
  this._detachMainFocusOutHandler();
420
+ this._detachResizableHandlers();
340
421
 
341
422
  this._oInvisibleMessage = InvisibleMessage.getInstance();
342
423
  };
@@ -345,22 +426,22 @@ sap.ui.define([
345
426
  var oArrowButton = this._isSingleItem() && this.getActionBarExpanded()
346
427
  ? this.getAggregation("_closeButton")
347
428
  : this.getAggregation("_arrowButton"),
348
- oDomRef;
429
+ oArrowDomRef;
349
430
 
350
431
  if (!Device.system.phone) {
351
- oDomRef = oArrowButton.getDomRef();
352
- oDomRef && oDomRef.setAttribute("aria-expanded", this.getActionBarExpanded() ? "true" : "false");
432
+ oArrowDomRef = oArrowButton.getDomRef();
433
+ oArrowDomRef && oArrowDomRef.setAttribute("aria-expanded", this.getActionBarExpanded() ? "true" : "false");
353
434
  }
354
435
 
355
436
  !this._getSideContentExpanded() && this._attachScrollHandler();
356
-
357
437
  this._attachMainFocusOutHandler();
438
+ this._attachResizableHandlers();
358
439
 
359
440
  if (!Device.system.phone) {
360
441
  if (!this._isSingleItem() && this._iVisibleItems > 0) {
361
442
  this._initItemNavigation();
362
443
  }
363
- if (this.getActionBarExpanded() || this._getSideContentExpanded()) {
444
+ if (this._getSideContentExpanded()) {
364
445
  this.getItems().length && this._fixSidePanelWidth();
365
446
  }
366
447
  } else {
@@ -369,14 +450,32 @@ sap.ui.define([
369
450
  }
370
451
  }
371
452
 
453
+ if (!this._sSidePanelWidth) {
454
+ this._sSidePanelWidth = this._getSidePanelWidth();
455
+ }
456
+ };
457
+
458
+ SidePanel.prototype.oncontextmenu = function(oEvent) {
459
+ var bSplitterFocused = document.activeElement === this.getDomRef().querySelector(".sapFSPSplitterBar");
460
+
461
+ if (bSplitterFocused || oEvent.target.closest(".sapFSPSide.sapFSPResizable")) {
462
+ // show the resize context menu only if there is a keyboard call ([Shift]+[F10] or [Context menu] keys)
463
+ // from focused splitter bar or right click somewhere within the side panel
464
+ oEvent.preventDefault();
465
+ if (bSplitterFocused){
466
+ this._bContextMenuFromSplitter = true;
467
+ }
468
+ this._showResizeContextMenu(oEvent);
469
+ }
372
470
  };
373
471
 
374
472
  SidePanel.prototype.onkeydown = function(oEvent) {
375
473
  var oTarget = oEvent.target,
376
- oActionBarDom = this.$().find(".sapFSPActionBar")[0],
474
+ oActionBarDom = this.getDomRef().querySelector(".sapFSPActionBarList"),
377
475
  bSideContentExpanded = this._getSideContentExpanded(),
378
476
  bSideExpanded = this.getActionBarExpanded() || bSideContentExpanded,
379
- bCtrlOrCmd = oEvent.ctrlKey || oEvent.metaKey;
477
+ bCtrlOrCmd = oEvent.ctrlKey || oEvent.metaKey,
478
+ bSplitterFocused = document.activeElement === this.getDomRef().querySelector(".sapFSPSplitterBar");
380
479
 
381
480
  if (bCtrlOrCmd && oEvent.which === KeyCodes.ARROW_LEFT) {
382
481
  oEvent.preventDefault();
@@ -404,6 +503,32 @@ sap.ui.define([
404
503
  this.setActionBarExpanded(false);
405
504
  this._closeSideContent();
406
505
  this._focusMain();
506
+ } else if (bSplitterFocused) {
507
+ // resize splitter keyboard handling
508
+ switch (oEvent.which) {
509
+ case KeyCodes.ENTER:
510
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_INITIAL);
511
+ break;
512
+ case KeyCodes.END:
513
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_MAX_WIDTH);
514
+ break;
515
+ case KeyCodes.HOME:
516
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_MIN_WIDTH);
517
+ break;
518
+ case KeyCodes.ARROW_LEFT:
519
+ this._moveSidePanelResizePositionWith(oEvent.shiftKey ? this.getSidePanelResizeLargerStep() : this.getSidePanelResizeStep());
520
+ break;
521
+ case KeyCodes.ARROW_RIGHT:
522
+ this._moveSidePanelResizePositionWith(oEvent.shiftKey ? -this.getSidePanelResizeLargerStep() : -this.getSidePanelResizeStep());
523
+ break;
524
+ case KeyCodes.F10:
525
+ if (oEvent.shiftKey) {
526
+ oEvent.preventDefault();
527
+ this._bContextMenuFromSplitter = true;
528
+ this._showResizeContextMenu(oEvent);
529
+ }
530
+ break;
531
+ }
407
532
  }
408
533
 
409
534
  if (!containsOrEquals(oActionBarDom, oTarget) || oTarget === oActionBarDom) {
@@ -424,7 +549,7 @@ sap.ui.define([
424
549
 
425
550
  SidePanel.prototype.onkeyup = function(oEvent) {
426
551
  var oTarget = oEvent.target,
427
- oActionBarDom = this.$().find(".sapFSPActionBar")[0];
552
+ oActionBarDom = this.getDomRef().querySelector(".sapFSPActionBarList");
428
553
 
429
554
  if (!containsOrEquals(oActionBarDom, oTarget) || oTarget === oActionBarDom) {
430
555
  return;
@@ -438,7 +563,7 @@ sap.ui.define([
438
563
  SidePanel.prototype.ontap = function(oEvent) {
439
564
  var oItemDom,
440
565
  oTarget = oEvent.target,
441
- oActionBarDom = this.$().find(".sapFSPActionBar")[0];
566
+ oActionBarDom = this.getDomRef().querySelector(".sapFSPActionBarList");
442
567
 
443
568
  if (!containsOrEquals(oActionBarDom, oTarget) || oTarget === oActionBarDom) {
444
569
  return;
@@ -478,6 +603,44 @@ sap.ui.define([
478
603
 
479
604
  // Private methods
480
605
 
606
+ SidePanel.prototype._getContextMenu = function() {
607
+ var oContextMenu = this.getAggregation("_contextMenu");
608
+
609
+ if (!oContextMenu) {
610
+ oContextMenu = new Menu({
611
+ items: [
612
+ new MenuItem({
613
+ text: oResourceBundle.getText("SIDEPANEL_CONTEXTMENU_MAXIMUM_WIDTH"),
614
+ press: function() {
615
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_MAX_WIDTH);
616
+ }.bind(this)
617
+ }),
618
+ new MenuItem({
619
+ text: oResourceBundle.getText("SIDEPANEL_CONTEXTMENU_MINIMUM_WIDTH"),
620
+ press: function() {
621
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_MIN_WIDTH);
622
+ }.bind(this)
623
+ }),
624
+ new MenuItem({
625
+ text: oResourceBundle.getText("SIDEPANEL_CONTEXTMENU_DEFAULT_WIDTH"),
626
+ press: function() {
627
+ this._setSidePanelResizePosition(SIDE_PANEL_POSITION_INITIAL);
628
+ }.bind(this)
629
+ })
630
+ ],
631
+ closed: function(oEvent) {
632
+ if (this._bContextMenuFromSplitter) {
633
+ this._bContextMenuFromSplitter = false;
634
+ this.getDomRef().querySelector(".sapFSPSplitterBar").focus();
635
+ }
636
+ }.bind(this)
637
+ });
638
+ this.setAggregation("_contextMenu", oContextMenu);
639
+ }
640
+
641
+ return oContextMenu;
642
+ };
643
+
481
644
  SidePanel.prototype._getSideContentExpanded = function() {
482
645
  return this.getProperty("sideContentExpanded");
483
646
  };
@@ -643,7 +806,7 @@ sap.ui.define([
643
806
  };
644
807
 
645
808
  SidePanel.prototype._attachResizeHandlers = function () {
646
- this._iResizeHandlerId = ResizeHandler.register(this, this._onResizeRef);
809
+ this._iResizeHandlerId = ResizeHandler.register(this, this._fnOnResizeRef);
647
810
  };
648
811
 
649
812
  SidePanel.prototype._detachResizeHandlers = function () {
@@ -660,55 +823,66 @@ sap.ui.define([
660
823
 
661
824
  var iCurrentWidth = oEvent.size.width,
662
825
  bSingleItem = this._isSingleItem(),
663
- oStyle = window.getComputedStyle(this.$().find(".sapFSPActionBar")[0]),
826
+ oDomRef = this.getDomRef(),
827
+ oStyle = window.getComputedStyle(oDomRef.querySelector(".sapFSPActionBarList")),
664
828
  iItemsGap = parseInt(oStyle.gap),
665
829
  iMarginBottom = parseInt(oStyle.marginBottom),
666
830
  iMarginTop = parseInt(oStyle.marginTop),
667
- oFirstItem = this.$().find(".sapFSPOverflowItem")[0],
831
+ oFirstItem = oDomRef.querySelector(".sapFSPOverflowItem"),
668
832
  iItemsHeight = oFirstItem && oFirstItem.clientHeight,
669
- iActionBarHeight,
670
- iCurrentWidth;
671
-
672
- if (iCurrentWidth < 1440 && (this._iPreviousWidth === undefined || this._iPreviousWidth >= 1440)) {
673
- this.addStyleClass("sapFSPSizeMedium");
674
- } else if (iCurrentWidth >= 1440 && (this._iPreviousWidth === undefined || this._iPreviousWidth < 1440)) {
675
- this.removeStyleClass("sapFSPSizeMedium");
676
- }
833
+ iActionBarHeight;
677
834
 
678
835
  this._iPreviousWidth = iCurrentWidth;
679
836
 
680
- if (!Device.system.phone) {
681
- if (!bSingleItem) {
682
- iActionBarHeight = this.$().find(".sapFSPSideInner")[0].clientHeight - iMarginBottom - iMarginTop;
683
- this._iVisibleItems = parseInt((iActionBarHeight + iItemsGap) / (iItemsHeight + iItemsGap));
684
- this._initItemNavigation();
685
- }
686
- if (this.getActionBarExpanded() || this._getSideContentExpanded()) {
687
- this._fixSidePanelWidth();
688
- }
837
+ if (Device.system.phone) {
838
+ return;
839
+ }
840
+
841
+ if (!bSingleItem) {
842
+ iActionBarHeight = oDomRef.querySelector(".sapFSPSideInner").clientHeight - iMarginBottom - iMarginTop;
843
+ this._iVisibleItems = parseInt((iActionBarHeight + iItemsGap) / (iItemsHeight + iItemsGap));
844
+ this._initItemNavigation();
845
+ }
846
+ if (this._getSideContentExpanded()) {
847
+ this._fixSidePanelWidth();
689
848
  }
690
849
  };
691
850
 
692
851
  SidePanel.prototype._fixSidePanelWidth = function() {
693
- var oSide = this.getDomRef().querySelector(".sapFSPSide"),
694
- oSideInner = this.getDomRef().querySelector(".sapFSPSideInner"),
852
+ var oDomRef = this.getDomRef(),
853
+ oSide = oDomRef.querySelector(".sapFSPSide"),
695
854
  iControlWidth = this._getControlWidth(),
696
- iSidePanelWidth = parseInt(window.getComputedStyle(oSideInner).width),
697
- bResizeSidePanel = iControlWidth < iSidePanelWidth; // doesn't work stable
855
+ iSidePanelWidth = parseInt(window.getComputedStyle(oSide).width),
856
+ bResizeSidePanel = iControlWidth < iSidePanelWidth;
857
+
858
+ oSide.style.width = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelWidth();
859
+ oSide.style.minWidth = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelMinWidth();
860
+ oSide.style.maxWidth = this._getSidePanelMaxWidth();
861
+
862
+ this._updateSplitViewClass(oSide);
863
+ this.getSidePanelResizable() && this._updateAriaValues();
864
+ };
698
865
 
699
- if (!this.hasStyleClass("sapFSPSizeMedium")) {
700
- oSide.style.width = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelWidth();
701
- oSide.style.minWidth = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelMinWidth();
702
- oSide.style.maxWidth = this._getSidePanelMaxWidth();
866
+ SidePanel.prototype._updateSplitViewClass = function(oSide) {
867
+ var iSidePanelWidth = parseInt(window.getComputedStyle(oSide).width);
868
+
869
+ if (iSidePanelWidth > SIDE_PANEL_SPLIT_BREAKPOINT) {
870
+ oSide.classList.add("sapFSPSplitView");
703
871
  } else {
704
- oSide.style.width = "";
705
- oSide.style.minWidth = "";
706
- oSide.style.maxWidth = "";
872
+ oSide.classList.contains("sapFSPSplitView") && this.setActionBarExpanded(false);
873
+ oSide.classList.remove("sapFSPSplitView");
707
874
  }
875
+ };
876
+
877
+ SidePanel.prototype._updateAriaValues = function() {
878
+ var oDomRef = this.getDomRef(),
879
+ oSplitter = oDomRef.querySelector(".sapFSPSplitterBar"),
880
+ iControlWidth = this._getControlWidth(),
881
+ iSidePanelWidth = parseInt(window.getComputedStyle(oDomRef.querySelector(".sapFSPSide")).width);
708
882
 
709
- oSideInner.style.width = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelWidth();
710
- oSideInner.style.minWidth = bResizeSidePanel ? iControlWidth + "px" : this._getSidePanelMinWidth();
711
- oSideInner.style.maxWidth = this._getSidePanelMaxWidth();
883
+ oSplitter.setAttribute("aria-valuenow", Math.round(iSidePanelWidth / iControlWidth * 100));
884
+ oSplitter.setAttribute("aria-valuemin", Math.round(parseInt(window.getComputedStyle(oDomRef.querySelector(".sapFSPMinWidth")).width) / iControlWidth * 100));
885
+ oSplitter.setAttribute("aria-valuemax", Math.round(parseInt(window.getComputedStyle(oDomRef.querySelector(".sapFSPMaxWidth")).width) / iControlWidth * 100));
712
886
  };
713
887
 
714
888
  SidePanel.prototype._setOverflowItemSelection = function(bState) {
@@ -742,6 +916,10 @@ sap.ui.define([
742
916
  return oResourceBundle.getText("SIDEPANEL_CONTENT_ARIA_LABEL");
743
917
  };
744
918
 
919
+ SidePanel.prototype._getSplitterTitle = function () {
920
+ return oResourceBundle.getText("SIDEPANEL_RESIZE_SPLITTER_TITLE");
921
+ };
922
+
745
923
  SidePanel.prototype._toggleItemSelection = function(oItem) {
746
924
  var oNewSelectedItem,
747
925
  oSelectedItem = this.getSelectedItem(),
@@ -815,7 +993,7 @@ sap.ui.define([
815
993
  this._setOverflowItemSelection(true);
816
994
  setTimeout(function() {
817
995
  var bNoMenu = !oOverflowMenu.getAggregation("_menu");
818
- oOverflowMenu.openBy(oDomRef, false, sap.ui.core.Popup.Dock.BeginBottom, sap.ui.core.Popup.Dock.EndBottom, "3 0");
996
+ oOverflowMenu.openBy(oDomRef, false, Popup.Dock.BeginBottom, Popup.Dock.EndBottom, "3 0");
819
997
  oOverflowMenu._getMenu().getPopup().setExtraContent([this.getAggregation("_overflowItem")]);
820
998
  bNoMenu && oOverflowMenu.getAggregation("_menu").addEventDelegate(oDelegate);
821
999
  }.bind(this), 0);
@@ -836,10 +1014,6 @@ sap.ui.define([
836
1014
  }
837
1015
  };
838
1016
 
839
- SidePanel.prototype._isSideContentExpanded = function() {
840
- return (Device.system.phone || (!this.getActionBarExpanded() || this._isSingleItem())) && this._getSideContentExpanded();
841
- };
842
-
843
1017
  SidePanel.prototype._getSelectedItem = function() {
844
1018
  return Core.byId(this.getSelectedItem());
845
1019
  };
@@ -890,11 +1064,13 @@ sap.ui.define([
890
1064
  oOverflowItem = this.getAggregation("_overflowItem");
891
1065
 
892
1066
  this._bAnnounceSelected = false;
893
- // set proper focus
894
- if (this.$().find("#" + oSelectedItem.getId()).css("display") === "none") {
895
- oOverflowItem && oOverflowItem.focus();
896
- } else {
897
- oSelectedItem && oSelectedItem.focus();
1067
+ if (!this._isSingleItem()) {
1068
+ // set proper focus
1069
+ if (this.getDomRef().querySelector("#" + oSelectedItem.getId()).style.display === "none") {
1070
+ oOverflowItem && oOverflowItem.focus();
1071
+ } else {
1072
+ oSelectedItem && oSelectedItem.focus();
1073
+ }
898
1074
  }
899
1075
  this._closeSideContent();
900
1076
  }.bind(this)
@@ -911,7 +1087,7 @@ sap.ui.define([
911
1087
  return;
912
1088
  }
913
1089
 
914
- this.$().find(".sapFSPMain")[0].addEventListener('scroll', this._onMainScroll);
1090
+ this.getDomRef().querySelector(".sapFSPMain").addEventListener('scroll', this._fnOnMainScroll);
915
1091
  };
916
1092
 
917
1093
  SidePanel.prototype._detachScrollHandler = function() {
@@ -919,7 +1095,7 @@ sap.ui.define([
919
1095
  return;
920
1096
  }
921
1097
 
922
- this.$().find(".sapFSPMain")[0].removeEventListener('scroll', this._onMainScroll);
1098
+ this.getDomRef().querySelector(".sapFSPMain").removeEventListener('scroll', this._fnOnMainScroll);
923
1099
  };
924
1100
 
925
1101
  SidePanel.prototype._closeOverflowMenu = function() {
@@ -932,14 +1108,14 @@ sap.ui.define([
932
1108
  SidePanel.prototype._attachMainFocusOutHandler = function() {
933
1109
  if (!Device.system.phone) {
934
1110
  var oDomRef = this.getDomRef();
935
- oDomRef && oDomRef.querySelector(".sapFSPMain").addEventListener("focusout", this._onMainFocusOut.bind(this), false);
1111
+ oDomRef && oDomRef.querySelector(".sapFSPMain").addEventListener("focusout", this._fnOnMainFocusOut, false);
936
1112
  }
937
1113
  };
938
1114
 
939
1115
  SidePanel.prototype._detachMainFocusOutHandler = function() {
940
1116
  if (!Device.system.phone) {
941
1117
  var oDomRef = this.getDomRef();
942
- oDomRef && oDomRef.querySelector(".sapFSPMain").removeEventListener("focusout", this._onMainFocusOut.bind(this), false);
1118
+ oDomRef && oDomRef.querySelector(".sapFSPMain").removeEventListener("focusout", this._fnOnMainFocusOut, false);
943
1119
  }
944
1120
  };
945
1121
 
@@ -976,7 +1152,7 @@ sap.ui.define([
976
1152
  * @private
977
1153
  */
978
1154
  SidePanel.prototype._handleGroupNavigation = function(oEvent, bShiftKey) {
979
- var oEventF6 = jQuery.Event("keydown");
1155
+ var oEventF6 = new jQuery.Event("keydown");
980
1156
 
981
1157
  this.$().trigger("focus");
982
1158
 
@@ -991,17 +1167,21 @@ sap.ui.define([
991
1167
  return this.getItems().length === 1;
992
1168
  };
993
1169
 
994
- SidePanel.prototype._calculatePixelWidth = function(sWidth) {
995
- sWidth = sWidth.replace(/\s/g, '');
996
- if (sWidth.slice(-1) === "%") {
997
- sWidth = parseInt(this._getControlWidth() * parseFloat(sWidth) / 100) + "px";
1170
+ SidePanel.prototype._calculatePixelWidth = function(vWidth) {
1171
+ if (typeof vWidth === "string") {
1172
+ vWidth = vWidth.replace(/\s/g, '');
1173
+ if (vWidth.slice(-1) === "%") {
1174
+ vWidth = parseInt(this._getControlWidth() * parseFloat(vWidth) / 100) + "px";
1175
+ }
1176
+ } else {
1177
+ vWidth = vWidth.toString() + "px";
998
1178
  }
999
1179
 
1000
- return sWidth;
1180
+ return vWidth;
1001
1181
  };
1002
1182
 
1003
1183
  SidePanel.prototype._getControlWidth = function() {
1004
- return parseInt(this.$().css("width"));
1184
+ return parseInt(window.getComputedStyle(this.getDomRef()).width);
1005
1185
  };
1006
1186
 
1007
1187
  SidePanel.prototype._getSidePanelWidth = function() {
@@ -1009,11 +1189,141 @@ sap.ui.define([
1009
1189
  };
1010
1190
 
1011
1191
  SidePanel.prototype._getSidePanelMinWidth = function() {
1012
- return this._calculatePixelWidth(this.getProperty("sidePanelMinWidth"));
1192
+ return this._calculatePixelWidth(this.getSidePanelMinWidth());
1013
1193
  };
1014
1194
 
1015
1195
  SidePanel.prototype._getSidePanelMaxWidth = function() {
1016
- return this._calculatePixelWidth(this.getProperty("sidePanelMaxWidth"));
1196
+ return this._calculatePixelWidth(this.getSidePanelMaxWidth());
1197
+ };
1198
+
1199
+ // Side Panel resizable-related methods
1200
+
1201
+ SidePanel.prototype._isResizable = function() {
1202
+ return this.getSidePanelResizable() && !Device.system.phone && (this.getActionBarExpanded() || this._getSideContentExpanded());
1203
+ };
1204
+
1205
+ SidePanel.prototype._attachResizableHandlers = function() {
1206
+ var oDomRef = this.getDomRef(),
1207
+ oSplitter = oDomRef && oDomRef.querySelector(".sapFSPSplitterBar");
1208
+
1209
+ if (!oSplitter) {
1210
+ return;
1211
+ }
1212
+
1213
+ if (Device.system.combi || Device.system.phone || Device.system.tablet) {
1214
+ // Attach touch events
1215
+ oSplitter.addEventListener("touchstart", this._fnOnTouchStart);
1216
+ oSplitter.addEventListener("touchend", this._fnOnTouchEnd);
1217
+ oSplitter.addEventListener("touchmove", this._fnOnTouchMove);
1218
+ }
1219
+ if (Device.system.desktop || Device.system.combi) {
1220
+ // Attach mouse events
1221
+ oSplitter.addEventListener("dblclick", this._fnOnDblClick);
1222
+ oSplitter.addEventListener("mousedown", this._fnOnTouchStart);
1223
+ oDomRef.addEventListener("mouseup", this._fnOnTouchEnd);
1224
+ oDomRef.addEventListener("mousemove", this._fnOnTouchMove);
1225
+ }
1226
+ };
1227
+
1228
+ SidePanel.prototype._detachResizableHandlers = function() {
1229
+ var oDomRef = this.getDomRef(),
1230
+ oSplitter = oDomRef && oDomRef.querySelector(".sapFSPSplitterBar");
1231
+
1232
+ if (!oSplitter) {
1233
+ return;
1234
+ }
1235
+
1236
+ if (Device.system.combi || Device.system.phone || Device.system.tablet) {
1237
+ // Detach touch events
1238
+ oSplitter.removeEventListener("touchstart", this._fnOnTouchStart);
1239
+ oSplitter.removeEventListener("touchend", this._fnOnTouchEnd);
1240
+ oSplitter.removeEventListener("touchmove", this._fnOnTouchMove);
1241
+ }
1242
+ if (Device.system.desktop || Device.system.combi) {
1243
+ // Detach mouse events
1244
+ oSplitter.removeEventListener("dblclick", this._fnOnDblClick);
1245
+ oSplitter.removeEventListener("mousedown", this._fnOnTouchStart);
1246
+ oDomRef.removeEventListener("mouseup", this._fnOnTouchEnd);
1247
+ oDomRef.removeEventListener("mousemove", this._fnOnTouchMove);
1248
+ }
1249
+
1250
+ };
1251
+
1252
+ SidePanel.prototype._onTouchStart = function(oEvent) {
1253
+ oEvent.preventDefault();
1254
+ this.getDomRef().querySelector(".sapFSPSplitterBar").classList.add("sapFSPSplitterActive");
1255
+ this._bResizeStarted = true;
1256
+ this._iStartPositionX = oEvent.touches ? oEvent.touches[0].pageX : oEvent.pageX;
1257
+ };
1258
+
1259
+ SidePanel.prototype._onTouchEnd = function(oEvent) {
1260
+ var oDomRef = this.getDomRef(),
1261
+ oSplitter = oDomRef && oDomRef.querySelector(".sapFSPSplitterBar");
1262
+
1263
+ this._bResizeStarted && oEvent.preventDefault();
1264
+ this._bResizeStarted = false;
1265
+
1266
+ oSplitter && oSplitter.classList.remove("sapFSPSplitterActive");
1267
+ };
1268
+
1269
+ SidePanel.prototype._onTouchMove = function(oEvent) {
1270
+ if (!this._bResizeStarted) {
1271
+ return;
1272
+ }
1273
+
1274
+ var iCurrentPositionX = oEvent.touches ? oEvent.touches[0].pageX : oEvent.pageX,
1275
+ iDeltaX = this._iStartPositionX - iCurrentPositionX,
1276
+ oSide = this.getDomRef().querySelector(".sapFSPSide"),
1277
+ iSidePanelWidth = parseInt(window.getComputedStyle(oSide)['width']);
1278
+
1279
+ oEvent.preventDefault();
1280
+
1281
+ if (iSidePanelWidth) {
1282
+ iSidePanelWidth += iDeltaX;
1283
+ this.setProperty("sidePanelWidth", iSidePanelWidth + "px", true);
1284
+ oSide.style.width = iSidePanelWidth + "px";
1285
+ this._iStartPositionX = iCurrentPositionX;
1286
+ this._updateSplitViewClass(oSide);
1287
+ this._updateAriaValues();
1288
+ }
1289
+ };
1290
+
1291
+ SidePanel.prototype._onDblClick = function(oEvent) {
1292
+ oEvent.preventDefault();
1293
+ this._iSidePanelPosition++;
1294
+ if (this._iSidePanelPosition > SIDE_PANEL_POSITION_MAX_WIDTH) {
1295
+ this._iSidePanelPosition = SIDE_PANEL_POSITION_MIN_WIDTH;
1296
+ }
1297
+ this._setSidePanelResizePosition(this._iSidePanelPosition);
1298
+ };
1299
+
1300
+ SidePanel.prototype._setSidePanelResizePosition = function(iResizePosition) {
1301
+ var aPositions = [
1302
+ this._getSidePanelMinWidth(),
1303
+ this._sSidePanelWidth,
1304
+ this._getSidePanelMaxWidth()
1305
+ ];
1306
+
1307
+ this.setProperty("sidePanelWidth", aPositions[iResizePosition], true);
1308
+ this._fixSidePanelWidth();
1309
+ };
1310
+
1311
+ SidePanel.prototype._moveSidePanelResizePositionWith = function(iStep) {
1312
+ var oSide = this.getDomRef().querySelector(".sapFSPSide"),
1313
+ iSidePanelWidth = parseInt(window.getComputedStyle(oSide)['width']);
1314
+
1315
+ if (iStep && iSidePanelWidth) {
1316
+ iSidePanelWidth += iStep;
1317
+ this.setProperty("sidePanelWidth", iSidePanelWidth + "px", true);
1318
+ oSide.style.width = iSidePanelWidth + "px";
1319
+ this._updateAriaValues();
1320
+ }
1321
+ };
1322
+
1323
+ SidePanel.prototype._showResizeContextMenu = function(oEvent) {
1324
+ var oContextMenu = this._getContextMenu();
1325
+
1326
+ (this._bContextMenuFromSplitter && oContextMenu.openBy(this.getDomRef().querySelector(".sapFSPSplitterBarGrip"))) || oContextMenu.openAsContextMenu(oEvent, this);
1017
1327
  };
1018
1328
 
1019
1329
  return SidePanel;