@openui5/sap.m 1.136.1 → 1.138.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 (513) hide show
  1. package/REUSE.toml +0 -28
  2. package/THIRDPARTY.txt +1 -25
  3. package/package.json +4 -4
  4. package/src/sap/m/.library +1 -1
  5. package/src/sap/m/AccButton.js +1 -1
  6. package/src/sap/m/ActionListItem.js +1 -1
  7. package/src/sap/m/ActionSelect.js +1 -1
  8. package/src/sap/m/ActionSheet.js +1 -1
  9. package/src/sap/m/ActionTile.js +3 -2
  10. package/src/sap/m/ActionTileContent.js +1 -1
  11. package/src/sap/m/AdditionalTextButton.js +1 -1
  12. package/src/sap/m/App.js +1 -1
  13. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  14. package/src/sap/m/Avatar.js +3 -3
  15. package/src/sap/m/Bar.js +1 -1
  16. package/src/sap/m/BarInPageEnabler.js +5 -6
  17. package/src/sap/m/Breadcrumbs.js +1 -1
  18. package/src/sap/m/BusyDialog.js +1 -1
  19. package/src/sap/m/BusyIndicator.js +1 -1
  20. package/src/sap/m/Button.js +1 -1
  21. package/src/sap/m/Carousel.js +1 -1
  22. package/src/sap/m/CarouselLayout.js +1 -1
  23. package/src/sap/m/CheckBox.js +1 -1
  24. package/src/sap/m/ColorPalette.js +1 -1
  25. package/src/sap/m/ColorPalettePopover.js +1 -1
  26. package/src/sap/m/ColorPaletteRenderer.js +2 -1
  27. package/src/sap/m/Column.js +1 -1
  28. package/src/sap/m/ColumnHeaderPopover.js +1 -1
  29. package/src/sap/m/ColumnListItem.js +6 -7
  30. package/src/sap/m/ColumnListItemRenderer.js +10 -0
  31. package/src/sap/m/ColumnPopoverActionItem.js +1 -1
  32. package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
  33. package/src/sap/m/ColumnPopoverItem.js +1 -1
  34. package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
  35. package/src/sap/m/ColumnPopoverSortItem.js +1 -1
  36. package/src/sap/m/ComboBox.js +1 -1
  37. package/src/sap/m/ComboBoxBase.js +1 -1
  38. package/src/sap/m/ComboBoxBaseRenderer.js +1 -9
  39. package/src/sap/m/ComboBoxTextField.js +1 -1
  40. package/src/sap/m/ContentConfig.js +1 -1
  41. package/src/sap/m/CustomListItem.js +1 -1
  42. package/src/sap/m/CustomTile.js +1 -1
  43. package/src/sap/m/CustomTreeItem.js +1 -1
  44. package/src/sap/m/DatePicker.js +1 -21
  45. package/src/sap/m/DateRangeSelection.js +4 -3
  46. package/src/sap/m/DateTimeField.js +1 -1
  47. package/src/sap/m/DateTimeInput.js +1 -1
  48. package/src/sap/m/DateTimePicker.js +1 -1
  49. package/src/sap/m/Dialog.js +5 -1
  50. package/src/sap/m/DialogRenderer.js +14 -6
  51. package/src/sap/m/DisplayListItem.js +1 -1
  52. package/src/sap/m/DraftIndicator.js +1 -1
  53. package/src/sap/m/DynamicDate.js +1 -1
  54. package/src/sap/m/DynamicDateOption.js +1 -1
  55. package/src/sap/m/DynamicDateRange.js +1 -1
  56. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  57. package/src/sap/m/ExpandableText.js +1 -1
  58. package/src/sap/m/FacetFilter.js +1 -1
  59. package/src/sap/m/FacetFilterItem.js +1 -1
  60. package/src/sap/m/FacetFilterList.js +1 -1
  61. package/src/sap/m/FeedContent.js +1 -1
  62. package/src/sap/m/FeedInput.js +1 -1
  63. package/src/sap/m/FeedListItem.js +11 -9
  64. package/src/sap/m/FeedListItemAction.js +5 -19
  65. package/src/sap/m/Fiori20Adapter.js +2 -2
  66. package/src/sap/m/FlexBox.js +1 -1
  67. package/src/sap/m/FlexItemData.js +1 -1
  68. package/src/sap/m/FormattedText.js +1 -1
  69. package/src/sap/m/GenericTag.js +1 -1
  70. package/src/sap/m/GenericTile.js +27 -10
  71. package/src/sap/m/GroupHeaderListItem.js +6 -2
  72. package/src/sap/m/GrowingList.js +1 -1
  73. package/src/sap/m/HBox.js +1 -1
  74. package/src/sap/m/HeaderContainer.js +1 -1
  75. package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
  76. package/src/sap/m/IconTabBar.js +1 -1
  77. package/src/sap/m/IconTabBarSelectList.js +1 -1
  78. package/src/sap/m/IconTabFilter.js +9 -1
  79. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  80. package/src/sap/m/IconTabHeader.js +58 -54
  81. package/src/sap/m/IconTabSeparator.js +1 -1
  82. package/src/sap/m/IllustratedMessage.js +48 -10
  83. package/src/sap/m/Illustration.js +9 -2
  84. package/src/sap/m/IllustrationRenderer.js +14 -7
  85. package/src/sap/m/Image.js +1 -1
  86. package/src/sap/m/ImageContent.js +1 -1
  87. package/src/sap/m/Input.js +1 -1
  88. package/src/sap/m/InputBase.js +1 -1
  89. package/src/sap/m/InputListItem.js +1 -1
  90. package/src/sap/m/InputRenderer.js +1 -14
  91. package/src/sap/m/Label.js +1 -1
  92. package/src/sap/m/LightBox.js +1 -1
  93. package/src/sap/m/LightBoxItem.js +1 -1
  94. package/src/sap/m/Link.js +1 -26
  95. package/src/sap/m/LinkRenderer.js +4 -3
  96. package/src/sap/m/LinkTileContent.js +1 -1
  97. package/src/sap/m/List.js +2 -2
  98. package/src/sap/m/ListBase.js +43 -2
  99. package/src/sap/m/ListBaseRenderer.js +3 -1
  100. package/src/sap/m/ListItemAction.js +189 -0
  101. package/src/sap/m/ListItemActionBase.js +52 -0
  102. package/src/sap/m/ListItemBase.js +88 -17
  103. package/src/sap/m/ListItemBaseRenderer.js +34 -3
  104. package/src/sap/m/MaskEnabler.js +1 -1
  105. package/src/sap/m/MaskInput.js +1 -1
  106. package/src/sap/m/MaskInputRule.js +1 -1
  107. package/src/sap/m/Menu.js +385 -882
  108. package/src/sap/m/MenuButton.js +17 -78
  109. package/src/sap/m/MenuItem.js +459 -300
  110. package/src/sap/m/MenuItemGroup.js +9 -353
  111. package/src/sap/m/MenuItemRenderer.js +220 -0
  112. package/src/sap/m/MenuListItem.js +1 -1
  113. package/src/sap/m/MenuWrapper.js +686 -0
  114. package/src/sap/m/MenuWrapperRenderer.js +123 -0
  115. package/src/sap/m/MessageBox.js +2 -2
  116. package/src/sap/m/MessageItem.js +1 -1
  117. package/src/sap/m/MessageListItem.js +1 -1
  118. package/src/sap/m/MessagePage.js +1 -1
  119. package/src/sap/m/MessagePopover.js +1 -1
  120. package/src/sap/m/MessagePopoverItem.js +1 -1
  121. package/src/sap/m/MessageStrip.js +3 -2
  122. package/src/sap/m/MessageToast.js +8 -6
  123. package/src/sap/m/MessageView.js +1 -1
  124. package/src/sap/m/MultiComboBox.js +1 -1
  125. package/src/sap/m/MultiComboBoxRenderer.js +1 -9
  126. package/src/sap/m/MultiEditField.js +1 -1
  127. package/src/sap/m/MultiInput.js +4 -2
  128. package/src/sap/m/NavContainer.js +1 -1
  129. package/src/sap/m/NewsContent.js +1 -1
  130. package/src/sap/m/NotificationList.js +1 -1
  131. package/src/sap/m/NotificationListBase.js +9 -4
  132. package/src/sap/m/NotificationListGroup.js +1 -1
  133. package/src/sap/m/NotificationListItem.js +12 -1
  134. package/src/sap/m/NumericContent.js +1 -1
  135. package/src/sap/m/NumericInput.js +3 -3
  136. package/src/sap/m/ObjectAttribute.js +1 -1
  137. package/src/sap/m/ObjectHeader.js +1 -1
  138. package/src/sap/m/ObjectIdentifier.js +1 -1
  139. package/src/sap/m/ObjectListItem.js +1 -1
  140. package/src/sap/m/ObjectMarker.js +5 -2
  141. package/src/sap/m/ObjectNumber.js +1 -1
  142. package/src/sap/m/ObjectStatus.js +1 -1
  143. package/src/sap/m/OverflowToolbar.js +1 -1
  144. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  145. package/src/sap/m/OverflowToolbarButton.js +1 -1
  146. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  147. package/src/sap/m/OverflowToolbarMenuButton.js +1 -1
  148. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  149. package/src/sap/m/P13nAnyFilterItem.js +1 -1
  150. package/src/sap/m/P13nColumnsItem.js +1 -1
  151. package/src/sap/m/P13nColumnsPanel.js +1 -1
  152. package/src/sap/m/P13nConditionPanel.js +1 -1
  153. package/src/sap/m/P13nDialog.js +1 -1
  154. package/src/sap/m/P13nDimMeasureItem.js +1 -1
  155. package/src/sap/m/P13nDimMeasurePanel.js +1 -1
  156. package/src/sap/m/P13nFilterItem.js +1 -1
  157. package/src/sap/m/P13nFilterPanel.js +1 -1
  158. package/src/sap/m/P13nGroupItem.js +1 -1
  159. package/src/sap/m/P13nGroupPanel.js +1 -1
  160. package/src/sap/m/P13nItem.js +1 -1
  161. package/src/sap/m/P13nPanel.js +1 -1
  162. package/src/sap/m/P13nSelectionItem.js +1 -1
  163. package/src/sap/m/P13nSelectionPanel.js +1 -1
  164. package/src/sap/m/P13nSortItem.js +1 -1
  165. package/src/sap/m/P13nSortPanel.js +1 -1
  166. package/src/sap/m/PDFViewer.js +1 -1
  167. package/src/sap/m/Page.js +6 -33
  168. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  169. package/src/sap/m/PageRenderer.js +3 -1
  170. package/src/sap/m/PagingButton.js +1 -1
  171. package/src/sap/m/Panel.js +1 -1
  172. package/src/sap/m/PlanningCalendar.js +12 -8
  173. package/src/sap/m/PlanningCalendarHeader.js +1 -1
  174. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  175. package/src/sap/m/PlanningCalendarRow.js +1 -1
  176. package/src/sap/m/PlanningCalendarView.js +1 -1
  177. package/src/sap/m/Popover.js +8 -1
  178. package/src/sap/m/PopoverRenderer.js +1 -1
  179. package/src/sap/m/ProgressIndicator.js +2 -4
  180. package/src/sap/m/PullToRefresh.js +1 -1
  181. package/src/sap/m/QuickView.js +1 -1
  182. package/src/sap/m/QuickViewBase.js +1 -1
  183. package/src/sap/m/QuickViewCard.js +1 -1
  184. package/src/sap/m/QuickViewGroup.js +1 -1
  185. package/src/sap/m/QuickViewGroupElement.js +1 -1
  186. package/src/sap/m/QuickViewPage.js +1 -1
  187. package/src/sap/m/RadioButton.js +1 -1
  188. package/src/sap/m/RadioButtonGroup.js +1 -1
  189. package/src/sap/m/RangeSlider.js +1 -1
  190. package/src/sap/m/RatingIndicator.js +1 -1
  191. package/src/sap/m/ResponsivePopover.js +1 -1
  192. package/src/sap/m/ResponsiveScale.js +1 -1
  193. package/src/sap/m/ScrollBar.js +1 -1
  194. package/src/sap/m/ScrollContainer.js +1 -1
  195. package/src/sap/m/SearchField.js +1 -1
  196. package/src/sap/m/SegmentedButton.js +1 -1
  197. package/src/sap/m/SegmentedButtonItem.js +1 -1
  198. package/src/sap/m/Select.js +1 -1
  199. package/src/sap/m/SelectDialog.js +1 -1
  200. package/src/sap/m/SelectDialogBase.js +1 -1
  201. package/src/sap/m/SelectList.js +1 -1
  202. package/src/sap/m/SelectionDetails.js +1 -1
  203. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  204. package/src/sap/m/SelectionDetailsItem.js +1 -1
  205. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  206. package/src/sap/m/Shell.js +1 -1
  207. package/src/sap/m/SimpleFixFlex.js +1 -1
  208. package/src/sap/m/SinglePlanningCalendar.js +14 -3
  209. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  210. package/src/sap/m/SinglePlanningCalendarGrid.js +19 -1
  211. package/src/sap/m/SinglePlanningCalendarGridRenderer.js +17 -16
  212. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  213. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  214. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  215. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  216. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  217. package/src/sap/m/SlideTile.js +1 -1
  218. package/src/sap/m/Slider.js +1 -1
  219. package/src/sap/m/SliderTooltip.js +1 -1
  220. package/src/sap/m/SliderTooltipBase.js +1 -1
  221. package/src/sap/m/SliderTooltipContainer.js +1 -1
  222. package/src/sap/m/SplitApp.js +6 -2
  223. package/src/sap/m/SplitButton.js +1 -1
  224. package/src/sap/m/SplitContainer.js +1 -1
  225. package/src/sap/m/StandardDynamicDateOption.js +1 -1
  226. package/src/sap/m/StandardListItem.js +1 -1
  227. package/src/sap/m/StandardTile.js +1 -1
  228. package/src/sap/m/StandardTreeItem.js +1 -1
  229. package/src/sap/m/StepInput.js +6 -1
  230. package/src/sap/m/Suggest.js +3 -1
  231. package/src/sap/m/SuggestionItem.js +1 -1
  232. package/src/sap/m/SuggestionsPopover.js +1 -1
  233. package/src/sap/m/Switch.js +19 -3
  234. package/src/sap/m/TabContainer.js +1 -1
  235. package/src/sap/m/TabContainerItem.js +1 -1
  236. package/src/sap/m/TabStrip.js +9 -3
  237. package/src/sap/m/TabStripItem.js +1 -1
  238. package/src/sap/m/Table.js +21 -27
  239. package/src/sap/m/TablePersoController.js +1 -1
  240. package/src/sap/m/TablePersoDialog.js +1 -1
  241. package/src/sap/m/TablePersoProvider.js +1 -1
  242. package/src/sap/m/TableRenderer.js +11 -3
  243. package/src/sap/m/TableSelectDialog.js +1 -1
  244. package/src/sap/m/Text.js +1 -1
  245. package/src/sap/m/TextArea.js +1 -1
  246. package/src/sap/m/Tile.js +1 -1
  247. package/src/sap/m/TileContainer.js +1 -1
  248. package/src/sap/m/TileContent.js +1 -1
  249. package/src/sap/m/TileInfo.js +1 -1
  250. package/src/sap/m/TileRenderer.js +2 -2
  251. package/src/sap/m/TimePicker.js +1 -1
  252. package/src/sap/m/TimePickerClock.js +1 -1
  253. package/src/sap/m/TimePickerClocks.js +1 -1
  254. package/src/sap/m/TimePickerInputs.js +1 -1
  255. package/src/sap/m/TimePickerInternals.js +1 -1
  256. package/src/sap/m/TimePickerSlider.js +1 -1
  257. package/src/sap/m/TimePickerSliders.js +1 -1
  258. package/src/sap/m/Title.js +1 -1
  259. package/src/sap/m/TitlePropagationSupport.js +1 -1
  260. package/src/sap/m/ToggleButton.js +1 -1
  261. package/src/sap/m/Token.js +1 -1
  262. package/src/sap/m/Tokenizer.js +36 -1
  263. package/src/sap/m/TokenizerRenderer.js +2 -2
  264. package/src/sap/m/Toolbar.js +1 -1
  265. package/src/sap/m/ToolbarLayoutData.js +1 -1
  266. package/src/sap/m/ToolbarSeparator.js +1 -1
  267. package/src/sap/m/ToolbarSpacer.js +1 -1
  268. package/src/sap/m/Tree.js +1 -1
  269. package/src/sap/m/TreeItemBase.js +1 -1
  270. package/src/sap/m/UploadCollection.js +1 -1
  271. package/src/sap/m/UploadCollectionItem.js +1 -1
  272. package/src/sap/m/UploadCollectionParameter.js +1 -1
  273. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  274. package/src/sap/m/VBox.js +1 -1
  275. package/src/sap/m/ValueStateHeader.js +1 -1
  276. package/src/sap/m/VariantManagement.js +1 -1
  277. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  278. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  279. package/src/sap/m/ViewSettingsDialog.js +17 -3
  280. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  281. package/src/sap/m/ViewSettingsItem.js +1 -1
  282. package/src/sap/m/VisibleItem.js +1 -1
  283. package/src/sap/m/WheelSlider.js +1 -1
  284. package/src/sap/m/WheelSliderContainer.js +1 -1
  285. package/src/sap/m/Wizard.js +17 -1
  286. package/src/sap/m/WizardProgressNavigator.js +1 -1
  287. package/src/sap/m/WizardStep.js +9 -6
  288. package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
  289. package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
  290. package/src/sap/m/changeHandler/CombineButtons.js +1 -1
  291. package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
  292. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
  293. package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
  294. package/src/sap/m/designtime/ListItemBase.designtime.js +5 -0
  295. package/src/sap/m/designtime/messagebundle_de.properties +4 -4
  296. package/src/sap/m/i18n/interaction_ar.xml +175 -0
  297. package/src/sap/m/i18n/interaction_bg.xml +175 -0
  298. package/src/sap/m/i18n/interaction_ca.xml +175 -0
  299. package/src/sap/m/i18n/interaction_cnr.xml +175 -0
  300. package/src/sap/m/i18n/interaction_cs.xml +175 -0
  301. package/src/sap/m/i18n/interaction_cy.xml +175 -0
  302. package/src/sap/m/i18n/interaction_da.xml +175 -0
  303. package/src/sap/m/i18n/interaction_de.xml +175 -0
  304. package/src/sap/m/i18n/interaction_el.xml +175 -0
  305. package/src/sap/m/i18n/interaction_en.xml +175 -0
  306. package/src/sap/m/i18n/interaction_en_GB.xml +175 -0
  307. package/src/sap/m/i18n/interaction_en_US_saprigi.xml +175 -0
  308. package/src/sap/m/i18n/interaction_es.xml +175 -0
  309. package/src/sap/m/i18n/interaction_es_MX.xml +175 -0
  310. package/src/sap/m/i18n/interaction_et.xml +175 -0
  311. package/src/sap/m/i18n/interaction_fi.xml +175 -0
  312. package/src/sap/m/i18n/interaction_fr.xml +175 -0
  313. package/src/sap/m/i18n/interaction_fr_CA.xml +175 -0
  314. package/src/sap/m/i18n/interaction_hi.xml +175 -0
  315. package/src/sap/m/i18n/interaction_hr.xml +175 -0
  316. package/src/sap/m/i18n/interaction_hu.xml +175 -0
  317. package/src/sap/m/i18n/interaction_id.xml +175 -0
  318. package/src/sap/m/i18n/interaction_it.xml +175 -0
  319. package/src/sap/m/i18n/interaction_iw.xml +175 -0
  320. package/src/sap/m/i18n/interaction_ja.xml +175 -0
  321. package/src/sap/m/i18n/interaction_kk.xml +175 -0
  322. package/src/sap/m/i18n/interaction_ko.xml +175 -0
  323. package/src/sap/m/i18n/interaction_lt.xml +175 -0
  324. package/src/sap/m/i18n/interaction_lv.xml +175 -0
  325. package/src/sap/m/i18n/interaction_mk.xml +175 -0
  326. package/src/sap/m/i18n/interaction_ms.xml +175 -0
  327. package/src/sap/m/i18n/interaction_nl.xml +175 -0
  328. package/src/sap/m/i18n/interaction_no.xml +175 -0
  329. package/src/sap/m/i18n/interaction_pl.xml +175 -0
  330. package/src/sap/m/i18n/interaction_pt.xml +175 -0
  331. package/src/sap/m/i18n/interaction_pt_PT.xml +175 -0
  332. package/src/sap/m/i18n/interaction_ro.xml +175 -0
  333. package/src/sap/m/i18n/interaction_ru.xml +175 -0
  334. package/src/sap/m/i18n/interaction_sh.xml +175 -0
  335. package/src/sap/m/i18n/interaction_sk.xml +175 -0
  336. package/src/sap/m/i18n/interaction_sl.xml +175 -0
  337. package/src/sap/m/i18n/interaction_sr.xml +175 -0
  338. package/src/sap/m/i18n/interaction_sv.xml +175 -0
  339. package/src/sap/m/i18n/interaction_th.xml +175 -0
  340. package/src/sap/m/i18n/interaction_tr.xml +175 -0
  341. package/src/sap/m/i18n/interaction_uk.xml +175 -0
  342. package/src/sap/m/i18n/interaction_vi.xml +175 -0
  343. package/src/sap/m/i18n/interaction_zh_CN.xml +175 -0
  344. package/src/sap/m/i18n/interaction_zh_TW.xml +175 -0
  345. package/src/sap/m/library.js +84 -8
  346. package/src/sap/m/messagebundle.properties +47 -14
  347. package/src/sap/m/messagebundle_ar.properties +52 -18
  348. package/src/sap/m/messagebundle_bg.properties +45 -11
  349. package/src/sap/m/messagebundle_ca.properties +49 -15
  350. package/src/sap/m/messagebundle_cnr.properties +48 -14
  351. package/src/sap/m/messagebundle_cs.properties +46 -12
  352. package/src/sap/m/messagebundle_cy.properties +43 -9
  353. package/src/sap/m/messagebundle_da.properties +45 -11
  354. package/src/sap/m/messagebundle_de.properties +48 -14
  355. package/src/sap/m/messagebundle_el.properties +48 -14
  356. package/src/sap/m/messagebundle_en.properties +50 -16
  357. package/src/sap/m/messagebundle_en_GB.properties +52 -18
  358. package/src/sap/m/messagebundle_en_US_saprigi.properties +57 -15
  359. package/src/sap/m/messagebundle_es.properties +114 -80
  360. package/src/sap/m/messagebundle_es_MX.properties +51 -17
  361. package/src/sap/m/messagebundle_et.properties +43 -9
  362. package/src/sap/m/messagebundle_fi.properties +44 -10
  363. package/src/sap/m/messagebundle_fr.properties +52 -18
  364. package/src/sap/m/messagebundle_fr_CA.properties +47 -13
  365. package/src/sap/m/messagebundle_hi.properties +47 -13
  366. package/src/sap/m/messagebundle_hr.properties +46 -12
  367. package/src/sap/m/messagebundle_hu.properties +46 -12
  368. package/src/sap/m/messagebundle_id.properties +75 -41
  369. package/src/sap/m/messagebundle_it.properties +52 -18
  370. package/src/sap/m/messagebundle_iw.properties +47 -13
  371. package/src/sap/m/messagebundle_ja.properties +45 -11
  372. package/src/sap/m/messagebundle_kk.properties +47 -13
  373. package/src/sap/m/messagebundle_ko.properties +47 -13
  374. package/src/sap/m/messagebundle_lt.properties +46 -12
  375. package/src/sap/m/messagebundle_lv.properties +50 -16
  376. package/src/sap/m/messagebundle_mk.properties +46 -12
  377. package/src/sap/m/messagebundle_ms.properties +49 -15
  378. package/src/sap/m/messagebundle_nl.properties +47 -13
  379. package/src/sap/m/messagebundle_no.properties +47 -13
  380. package/src/sap/m/messagebundle_pl.properties +50 -16
  381. package/src/sap/m/messagebundle_pt.properties +49 -15
  382. package/src/sap/m/messagebundle_pt_PT.properties +47 -13
  383. package/src/sap/m/messagebundle_ro.properties +47 -13
  384. package/src/sap/m/messagebundle_ru.properties +48 -14
  385. package/src/sap/m/messagebundle_sh.properties +48 -14
  386. package/src/sap/m/messagebundle_sk.properties +46 -12
  387. package/src/sap/m/messagebundle_sl.properties +49 -15
  388. package/src/sap/m/messagebundle_sr.properties +48 -14
  389. package/src/sap/m/messagebundle_sv.properties +46 -12
  390. package/src/sap/m/messagebundle_th.properties +47 -13
  391. package/src/sap/m/messagebundle_tr.properties +46 -12
  392. package/src/sap/m/messagebundle_uk.properties +50 -16
  393. package/src/sap/m/messagebundle_vi.properties +49 -15
  394. package/src/sap/m/messagebundle_zh_CN.properties +47 -13
  395. package/src/sap/m/messagebundle_zh_TW.properties +49 -15
  396. package/src/sap/m/p13n/AbstractContainer.js +2 -2
  397. package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
  398. package/src/sap/m/p13n/BasePanel.js +1 -1
  399. package/src/sap/m/p13n/Container.js +1 -1
  400. package/src/sap/m/p13n/Engine.js +7 -5
  401. package/src/sap/m/p13n/FilterController.js +1 -1
  402. package/src/sap/m/p13n/FilterPanel.js +1 -1
  403. package/src/sap/m/p13n/GroupController.js +1 -1
  404. package/src/sap/m/p13n/GroupPanel.js +1 -1
  405. package/src/sap/m/p13n/MessageStrip.js +1 -1
  406. package/src/sap/m/p13n/Popup.js +3 -1
  407. package/src/sap/m/p13n/QueryPanel.js +10 -6
  408. package/src/sap/m/p13n/SelectionController.js +1 -1
  409. package/src/sap/m/p13n/SelectionPanel.js +32 -41
  410. package/src/sap/m/p13n/SortController.js +1 -1
  411. package/src/sap/m/p13n/SortPanel.js +1 -1
  412. package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +3 -4
  413. package/src/sap/m/p13n/modules/StateHandlerRegistry.js +7 -5
  414. package/src/sap/m/p13n/modules/UIManager.js +1 -1
  415. package/src/sap/m/plugins/CellSelector.js +4 -3
  416. package/src/sap/m/plugins/ColumnAIAction.js +1 -1
  417. package/src/sap/m/plugins/ColumnResizer.js +28 -4
  418. package/src/sap/m/plugins/ContextMenuSetting.js +1 -1
  419. package/src/sap/m/plugins/CopyProvider.js +1 -1
  420. package/src/sap/m/plugins/DataStateIndicator.js +1 -1
  421. package/src/sap/m/plugins/PasteProvider.js +1 -1
  422. package/src/sap/m/plugins/PluginBase.js +1 -1
  423. package/src/sap/m/plugins/UploadSetwithTable.js +25 -17
  424. package/src/sap/m/routing/Target.js +52 -8
  425. package/src/sap/m/routing/Targets.js +58 -11
  426. package/src/sap/m/semantic/AddAction.js +1 -1
  427. package/src/sap/m/semantic/CancelAction.js +1 -1
  428. package/src/sap/m/semantic/DeleteAction.js +1 -1
  429. package/src/sap/m/semantic/DetailPage.js +1 -1
  430. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  431. package/src/sap/m/semantic/EditAction.js +1 -1
  432. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  433. package/src/sap/m/semantic/FilterAction.js +1 -1
  434. package/src/sap/m/semantic/FilterSelect.js +1 -1
  435. package/src/sap/m/semantic/FlagAction.js +1 -1
  436. package/src/sap/m/semantic/ForwardAction.js +1 -1
  437. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  438. package/src/sap/m/semantic/GroupAction.js +1 -1
  439. package/src/sap/m/semantic/GroupSelect.js +1 -1
  440. package/src/sap/m/semantic/MainAction.js +1 -1
  441. package/src/sap/m/semantic/MasterPage.js +1 -1
  442. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  443. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  444. package/src/sap/m/semantic/NegativeAction.js +1 -1
  445. package/src/sap/m/semantic/OpenInAction.js +1 -1
  446. package/src/sap/m/semantic/PositiveAction.js +1 -1
  447. package/src/sap/m/semantic/PrintAction.js +1 -1
  448. package/src/sap/m/semantic/SaveAction.js +1 -1
  449. package/src/sap/m/semantic/Segment.js +1 -1
  450. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  451. package/src/sap/m/semantic/SemanticButton.js +1 -1
  452. package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
  453. package/src/sap/m/semantic/SemanticControl.js +1 -1
  454. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
  455. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
  456. package/src/sap/m/semantic/SemanticPage.js +1 -1
  457. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  458. package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
  459. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  460. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  461. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  462. package/src/sap/m/semantic/ShareMenu.js +1 -1
  463. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  464. package/src/sap/m/semantic/SortAction.js +1 -1
  465. package/src/sap/m/semantic/SortSelect.js +1 -1
  466. package/src/sap/m/table/ColumnWidthController.js +1 -1
  467. package/src/sap/m/table/Util.js +1 -1
  468. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  469. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  470. package/src/sap/m/table/columnmenu/Item.js +1 -1
  471. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  472. package/src/sap/m/table/columnmenu/Menu.js +3 -3
  473. package/src/sap/m/table/columnmenu/MenuBase.js +1 -1
  474. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  475. package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
  476. package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
  477. package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
  478. package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
  479. package/src/sap/m/table/columnmenu/QuickResize.js +142 -0
  480. package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
  481. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
  482. package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
  483. package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
  484. package/src/sap/m/themes/base/Button.less +36 -13
  485. package/src/sap/m/themes/base/ColumnListItem.less +11 -0
  486. package/src/sap/m/themes/base/DynamicDateRange.less +6 -2
  487. package/src/sap/m/themes/base/IconTabBar.less +1 -0
  488. package/src/sap/m/themes/base/Link.less +1 -0
  489. package/src/sap/m/themes/base/ListBase.less +1 -0
  490. package/src/sap/m/themes/base/ListItemBase.less +22 -10
  491. package/src/sap/m/themes/base/Menu.less +329 -12
  492. package/src/sap/m/themes/base/Page.less +5 -4
  493. package/src/sap/m/themes/base/Panel.less +7 -2
  494. package/src/sap/m/themes/base/PlanningCalendar.less +37 -0
  495. package/src/sap/m/themes/base/RatingIndicator.less +7 -2
  496. package/src/sap/m/themes/base/Table.less +42 -11
  497. package/src/sap/m/themes/base/Wizard.less +14 -43
  498. package/src/sap/m/themes/base/illustrations/sapIllus-Dot-BeforeSearch.svg +2 -2
  499. package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoEntries.svg +2 -2
  500. package/src/sap/m/themes/base/illustrations/sapIllus-Dot-SignOut.svg +10 -17
  501. package/src/sap/m/upload/ActionsPlaceholder.js +1 -1
  502. package/src/sap/m/upload/Column.js +1 -1
  503. package/src/sap/m/upload/FilePreviewDialog.js +1 -1
  504. package/src/sap/m/upload/UploadItem.js +1 -1
  505. package/src/sap/m/upload/UploadItemConfiguration.js +1 -1
  506. package/src/sap/m/upload/UploadSet.js +1 -1
  507. package/src/sap/m/upload/UploadSetItem.js +1 -1
  508. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
  509. package/src/sap/m/upload/Uploader.js +2 -2
  510. package/src/sap/m/upload/UploaderHttpRequestMethod.js +2 -2
  511. package/src/sap/m/upload/UploaderTableItem.js +3 -3
  512. package/src/sap/m/routing/async/Target.js +0 -60
  513. package/src/sap/m/routing/async/Targets.js +0 -60
package/src/sap/m/Menu.js CHANGED
@@ -6,62 +6,46 @@
6
6
 
7
7
  // Provides control sap.m.Menu.
8
8
  sap.ui.define([
9
- './library',
9
+ 'sap/m/library',
10
10
  'sap/ui/core/library',
11
11
  'sap/ui/core/Control',
12
- './Button',
13
- './Dialog',
14
- './NavContainer',
15
- './List',
16
- './Page',
17
- './MenuListItem',
18
- './MenuItem',
19
- "sap/ui/core/Lib",
20
- 'sap/ui/unified/Menu',
21
- 'sap/ui/unified/MenuItem',
22
- 'sap/ui/unified/MenuItemGroup',
12
+ 'sap/m/ResponsivePopover',
13
+ 'sap/m/Button',
14
+ 'sap/m/Bar',
15
+ 'sap/m/Title',
16
+ 'sap/m/MenuItem',
17
+ 'sap/m/MenuWrapper',
18
+ 'sap/ui/core/Lib',
23
19
  'sap/ui/Device',
20
+ "sap/ui/core/InvisibleText",
24
21
  'sap/ui/core/EnabledPropagator',
25
- "sap/ui/thirdparty/jquery",
26
- "sap/ui/core/Popup",
27
- "sap/ui/base/ManagedObject",
28
- "sap/ui/core/Element"
22
+ 'sap/base/i18n/Localization',
23
+ 'sap/base/Log'
29
24
  ],
30
25
  function(
31
26
  library,
32
27
  coreLibrary,
33
28
  Control,
29
+ ResponsivePopover,
34
30
  Button,
35
- Dialog,
36
- NavContainer,
37
- List,
38
- Page,
39
- MenuListItem,
31
+ Bar,
32
+ Title,
40
33
  MenuItem,
41
- Library,
42
- UfdMenu,
43
- UfdMenuItem,
44
- UfdMenuItemGroup,
34
+ MenuWrapper,
35
+ Lib,
45
36
  Device,
37
+ InvisibleText,
46
38
  EnabledPropagator,
47
- jQuery,
48
- Popup,
49
- ManagedObject,
50
- Element
39
+ Localization,
40
+ Log
51
41
  ) {
52
42
  "use strict";
53
43
 
54
- // shortcut for sap.ui.core.Popup.Dock
55
- var Dock = Popup.Dock;
44
+ // Shortcut for sap.m.PlacementType
45
+ const PlacementType = library.PlacementType;
56
46
 
57
- // shortcut for sap.m.ListType
58
- var ListType = library.ListType;
59
-
60
- // shortcut for sap.m.ListMode
61
- var ListMode = library.ListMode;
62
-
63
- // shortcut for sap.ui.core.ItemSelectionMode
64
- var ItemSelectionMode = coreLibrary.ItemSelectionMode;
47
+ // Shortcut for sap.ui.core.ItemSelectionMode
48
+ const ItemSelectionMode = coreLibrary.ItemSelectionMode;
65
49
 
66
50
  /**
67
51
  * Constructor for a new Menu.
@@ -73,23 +57,17 @@ sap.ui.define([
73
57
  * The <code>sap.m.Menu</code> control represents a hierarchical menu.
74
58
  * When opened on mobile devices it occupies the whole screen.
75
59
  *
76
- * <b>Note:</b> The application developer should add dependency to <code>sap.ui.unified</code> library
77
- * on application level to ensure that the library is loaded before the module dependencies will be required.
78
- * If the <code>sap.ui.unified</code> library is not loaded in advance, this
79
- * could lead to CSP compliance issues and adds an additional waiting time.
80
- * To prevent this, ensure that the <code>sap.ui.unified</code> library is loaded in advance.
81
- *
82
60
  * @extends sap.ui.core.Control
83
61
  * @implements sap.ui.core.IContextMenu
84
62
  *
85
63
  * @author SAP SE
86
- * @version 1.136.1
64
+ * @version 1.138.0
87
65
  *
88
66
  * @constructor
89
67
  * @public
90
68
  * @alias sap.m.Menu
91
69
  */
92
- var Menu = Control.extend("sap.m.Menu", /** @lends sap.m.Menu.prototype */ {
70
+ const Menu = Control.extend("sap.m.Menu", /** @lends sap.m.Menu.prototype */ {
93
71
  metadata : {
94
72
  interfaces: [
95
73
  "sap.ui.core.IContextMenu"
@@ -103,20 +81,22 @@ sap.ui.define([
103
81
  },
104
82
  defaultAggregation: "items",
105
83
  aggregations: {
84
+
106
85
  /**
107
86
  * Defines the items contained within this control.
108
87
  */
109
- items: { type: "sap.m.IMenuItem", multiple: true, singularName: "item", bindable: "bindable", defaultClass: MenuItem },
88
+ items: { type: "sap.m.IMenuItem", multiple: true, singularName: "item", bindable: "bindable", defaultClass: MenuItem, forwarding: { idSuffix: "-menuWrapper", aggregation: "items" } },
110
89
 
111
90
  /**
112
- * Internal aggregation that contains the inner <code>sap.m.Dialog</code> for mobile.
91
+ * Internal Menu Wrapper control
113
92
  */
114
- _dialog: { type: "sap.m.Dialog", multiple: false, visibility: "hidden" },
93
+ _menuWrapper: { type: "sap.m.MenuWrapper", multiple: false, visibility: "hidden" },
115
94
 
116
95
  /**
117
- * Internal aggregation that contains the inner <code>sap.ui.unified.Menu</code> for desktop and tablet.
96
+ * Internal aggregation that contains the inner <code>sap.m.ResponsivePopover</code> for mobile.
118
97
  */
119
- _menu: { type: "sap.ui.unified.Menu", multiple: false, visibility: "hidden" }
98
+ _popover: { type: "sap.m.ResponsivePopover", multiple: false, visibility: "hidden" }
99
+
120
100
  },
121
101
  events: {
122
102
  /**
@@ -127,7 +107,7 @@ sap.ui.define([
127
107
  /**
128
108
  * The <code>MenuItem</code> which was selected.
129
109
  */
130
- item : {type : "sap.m.MenuItem" }
110
+ item : {type : "sap.m.IMenuItem" }
131
111
  }
132
112
  },
133
113
 
@@ -142,616 +122,376 @@ sap.ui.define([
142
122
  * @since 1.131
143
123
  */
144
124
  beforeClose : {
145
- allowPreventDefault : true
125
+ allowPreventDefault : true,
126
+ parameters: {
127
+ /**
128
+ * The <code>MenuItem</code> which was selected (if any).
129
+ * @since 1.136.0
130
+ */
131
+ item : {type : "sap.m.IMenuItem" }
132
+ }
146
133
  }
147
134
 
148
135
  }
149
136
  },
150
- renderer: null // this is a popup control without a renderer
137
+ renderer: null // this is a ResponsivePopover control without a renderer
151
138
  });
152
139
 
153
140
  EnabledPropagator.call(Menu.prototype);
154
141
 
155
-
156
- /**
157
- * Unified Menu items ID prefix.
158
- *
159
- * @type {string}
160
- */
161
- Menu.UNIFIED_MENU_ITEMS_ID_SUFFIX = '-unifiedmenu';
162
-
163
- /**
164
- * Map of all available properties in the sap.ui.unified.MenuItem.
165
- * Needed when syncs between sap.m.MenuItem and unified.MenuItem are performed.
166
- * @type {Object<string,Object>}
167
- * @private
168
- */
169
- Menu.UNFIFIED_MENU_ITEMS_PROPS = UfdMenuItem.getMetadata().getAllProperties();
170
-
171
- /**
172
- * List items ID prefix.
173
- *
174
- * @type {string}
175
- */
176
- Menu.LIST_ITEMS_ID_SUFFIX = '-menuinnerlist';
177
-
178
-
179
- /**
180
- * Map of all available properties in the sap.m.MenuListItem
181
- * Needed when syncs between sap.m.MenuItem and sap.m.MenuListItem are performed.
182
- * @type {Object<string,Object>}
183
- * @private
184
- */
185
- Menu.MENU_LIST_ITEMS_PROPS = MenuListItem.getMetadata().getAllProperties();
186
-
187
142
  /**
188
143
  * Initializes the control.
144
+ *
189
145
  * @public
190
146
  */
191
147
  Menu.prototype.init = function() {
192
- if (Device.system.phone) {
193
- this._initDialog();
194
- }
195
- this._bIsInitialized = false;
196
- // attach event handlers responsible for keeping sap.m.MenuItem and sap.ui.unified.MenuItem, sap.m.MenuListItem instances at sync
197
- this.attachEvent("propertyChanged", this._onPropertyChanged, this);
198
- this.attachEvent("aggregationChanged", this._onAggregationChanged, this);
148
+ const oMenuWrapper = this._createMenuWrapper(),
149
+ oPopover = this._createPopover();
150
+
151
+ oMenuWrapper.attachClosePopover(this.close, this);
152
+ oMenuWrapper.attachCloseItemSubmenu(this._collectSubmenusToClose, this);
153
+ oMenuWrapper.attachItemSelected(this._handleItemSelected, this);
154
+ oPopover.attachAfterClose(this._menuClosed, this);
155
+
156
+ this._aSubmenusToClose = [];
157
+ this._openDuration = Device.system.phone ? null : 0;
199
158
  };
200
159
 
201
- /**
160
+ /**
202
161
  * Called from parent if the control is destroyed.
203
162
  */
204
163
  Menu.prototype.exit = function() {
205
- var oMenu = this._getMenu(),
206
- oPopup = oMenu && oMenu.getPopup(),
207
- oDialog = this._getDialog();
208
-
209
- if (this._navContainerId) {
210
- this._navContainerId = null;
211
- }
212
- if (this._bIsInitialized) {
213
- this._bIsInitialized = null;
214
- }
164
+ const oMenuWrapper = this._getMenuWrapper(),
165
+ oPopover = this._getPopover();
215
166
 
216
- if (oPopup) {
217
- oPopup.detachClosed(this._menuClosed, this);
218
- oMenu.detachBeforeClose(this._handleVisualParentClose, this);
219
- }
167
+ oMenuWrapper.detachClosePopover(this.close, this);
168
+ oMenuWrapper.detachCloseItemSubmenu(this._collectSubmenusToClose, this);
169
+ oMenuWrapper.detachItemSelected(this._handleItemSelected, this);
170
+ oPopover.detachAfterClose(this._menuClosed, this);
220
171
 
221
- if (oDialog) {
222
- oDialog.detachBeforeClose(this._handleVisualParentClose, this);
223
- }
224
- };
225
-
226
- Menu.prototype.invalidate = function() {
227
- //the parent control is most probably the menu opener, so do not invalidate it,
228
- //let it do it's own changes when the menu is open
172
+ oMenuWrapper.destroy();
173
+ oPopover.destroy();
229
174
  };
230
175
 
231
176
  /**
232
- * Sets the title of the <code>Menu</code>.
177
+ * Sets the title of the <code>Menu</code> in mobile view.
178
+ *
233
179
  * @param {string} sTitle The new title of the <code>Menu</code>
234
180
  * @returns {this} <code>this</code> to allow method chaining
235
181
  * @public
236
182
  */
237
183
  Menu.prototype.setTitle = function(sTitle) {
238
- var oNavContainer = this._getNavContainer();
184
+ const oPopover = this._getPopover(),
185
+ oMenuWrapper = this._getMenuWrapper(),
186
+ oHeader = oPopover.getCustomHeader();
239
187
 
240
- this.setProperty("title", sTitle, true);
241
-
242
- if (oNavContainer && oNavContainer.getPages().length) {
243
- oNavContainer.getPages()[0].setTitle(sTitle);
188
+ // set the text of the Title of the ResponsivePopover, which is located in the custom header's Bar contentMiddle aggregation
189
+ if (oHeader) {
190
+ oMenuWrapper.setTitle(sTitle);
191
+ // the Title is the only elemnet in the contentMiddle aggregation of the Bar we create as custom header
192
+ // so we can safely set the text of the first element
193
+ oHeader.getContentMiddle()[0].setText(sTitle);
244
194
  }
245
195
 
196
+ this.setProperty("title", sTitle, true);
197
+
246
198
  return this;
247
199
  };
248
200
 
249
201
  /**
250
202
  * Opens the <code>Menu</code> next to the given control.
203
+ *
251
204
  * @param {sap.ui.core.Control} oControl The control that defines the position for the menu
252
- * @param {boolean} bWithKeyboard Whether the menu is opened with a shortcut or not
253
- * @param {sap.ui.core.Popup.Dock} [sDockMy=sap.ui.core.Popup.Dock.BeginTop] The reference docking location
254
- * of the <code>Menu</code> for positioning the menu on the screen
255
- * @param {sap.ui.core.Popup.Dock} [sDockAt=sap.ui.core.Popup.Dock.BeginBottom] The <code>oControl</code>
256
- * reference docking location for positioning the menu on the screen
257
- * @param {string} [sOffset="0 -2"] The offset relative to the docking point,
258
- * specified as a string with space-separated pixel values (e.g. "0 10" to move the popup 10 pixels to the right).
259
- * If the docking of both "my" and "at" is RTL-sensitive ("begin" or "end"), this offset is automatically mirrored in the RTL case as well.
205
+ * @returns {this} <code>this</code> to allow method chaining
260
206
  * @public
261
207
  */
262
- Menu.prototype.openBy = function(oControl, bWithKeyboard, sDockMy, sDockAt, sOffset) {
263
- if (Device.system.phone) {
264
- this._openDialog();
265
- } else {
266
- if (!this._bIsInitialized) {
267
- this._initAllMenuItems();
268
- this._bIsInitialized = true;
269
- }
270
-
271
- if (!sDockMy) {
272
- sDockMy = Dock.BeginTop;
273
- }
274
- if (!sDockAt) {
275
- sDockAt = Dock.BeginBottom;
276
- }
277
- if (!sOffset) {
278
- sOffset = "0 -2";
279
- }
280
- this._getMenu().open(bWithKeyboard, oControl, sDockMy, sDockAt, oControl, sOffset);
208
+ Menu.prototype.openBy = function(oControl) {
209
+ const oPopover = this._getPopover();
210
+ if (!oControl) {
211
+ oControl = document.body;
281
212
  }
282
- };
213
+ oPopover._getPopup().setDurations(this._openDuration, 0);
214
+ oPopover.openBy(oControl);
283
215
 
284
- /**
285
- * Closes the <code>Menu</code>.
286
- * @public
287
- */
288
- Menu.prototype.close = function() {
289
- if (Device.system.phone) {
290
- this._getDialog() && this._getDialog().close();
291
- } else {
292
- this._getVisualParent() && this._getVisualParent().close();
293
- }
216
+ return this;
294
217
  };
295
218
 
296
219
  /**
297
- * Returns whether the <code>Menu</code> is currently open.
298
- * @returns {boolean} true if menu is open
220
+ * Closes the <code>Menu</code> if the <code>beforeClose</code> event isn`t prevented.
221
+ *
222
+ * @param {sap.ui.base.Event} oEvent closePopover event
223
+ * @returns {this} <code>this</code> to allow method chaining
299
224
  * @public
300
225
  */
301
- Menu.prototype.isOpen = function() {
302
- if (Device.system.phone) {
303
- return this._getDialog() && this._getDialog().isOpen();
304
- } else {
305
- return this._getVisualParent() && this._getVisualParent().isOpen();
226
+ Menu.prototype.close = function(oEvent) {
227
+ const oEventParameters = oEvent ? oEvent.getParameters() : {},
228
+ oBeforeCloseParameters = {},
229
+ oPopover = this._getPopover();
230
+
231
+ if (oEventParameters["origin"]) {
232
+ oBeforeCloseParameters["item"] = oEventParameters["origin"];
233
+ }
234
+ this._refreshSubmenusToClose();
235
+ if (oPopover && this.fireBeforeClose(oBeforeCloseParameters)) {
236
+ this._closeSubmenuPopovers();
237
+ oPopover._getPopup().setDurations(this._openDuration, 0);
238
+ oPopover.close();
306
239
  }
240
+
241
+ return this;
307
242
  };
308
243
 
309
244
  /**
310
- * Creates the dialog that contains the actual menu for mobile.
245
+ * Captures the itemSelected event fired by the menu wrapper and fires the itemSelected event of the menu.
246
+ *
247
+ * @param {sap.ui.base.Event} oEvent itemSelected event fired by the menu wrapper
311
248
  * @private
312
249
  */
313
- Menu.prototype._initDialog = function() {
314
- var oDialog = new Dialog({
315
- showHeader: false,
316
- stretch: true,
317
- content: this._initNavContainer(),
318
- buttons: [
319
- this._initCloseButton()
320
- ]
321
- });
322
- oDialog.addStyleClass("sapMRespMenuDialog");
323
- // remove padding for the menu on phone
324
- oDialog.addStyleClass("sapUiNoContentPadding");
325
- this.setAggregation("_dialog", oDialog, true);
326
- oDialog.attachAfterClose(this._menuClosed, this);
327
- oDialog.attachBeforeClose(this._handleVisualParentClose, this);
250
+ Menu.prototype._handleItemSelected = function(oEvent) {
251
+ oEvent.cancelBubble();
252
+ this.fireItemSelected({item: oEvent.getParameter("item")});
328
253
  };
329
254
 
330
255
  /**
331
- * Gets the internal dialog.
332
- * @returns {sap.m.Dialog} The internal _dialog aggregation
256
+ * Refreshes the list of submenus that should be closed by checking if any are still open.
257
+ *
333
258
  * @private
334
259
  */
335
- Menu.prototype._getDialog = function() {
336
- return this.getAggregation("_dialog");
260
+ Menu.prototype._refreshSubmenusToClose = function() {
261
+ this._aSubmenusToClose = this._aSubmenusToClose.filter((oItem) => oItem._getPopover().isOpen());
337
262
  };
338
263
 
339
264
  /**
340
- * Opens the internal dialog.
265
+ * Closes the submenus of the <code>Menu</code> that are still open.
266
+ *
341
267
  * @private
342
268
  */
343
- Menu.prototype._openDialog = function() {
344
- if (!this._bIsInitialized) {
345
- this._initAllPages();
346
- this._bIsInitialized = true;
269
+ Menu.prototype._closeSubmenuPopovers = function() {
270
+ while (this._aSubmenusToClose.length) {
271
+ this._aSubmenusToClose.pop()._closeSubmenu();
347
272
  }
348
-
349
- //reset to first page
350
- this._getNavContainer().to(this._getNavContainer().getPages()[0]);
351
- this._getDialog().open();
352
- };
353
-
354
- Menu.prototype._initAllMenuItems = function() {
355
- this._initMenuForItems(this.getItems());
356
273
  };
357
274
 
358
275
  /**
359
- * Allows for any custom function to be called back when accessibility attributes
360
- * of underlying menu are about to be rendered.
361
- * The function is called once per MenuItem
276
+ * Returns whether the <code>Menu</code> is currently open.
362
277
  *
363
- * @param {function} fn The callback function
364
- * @private
365
- * @ui5-restricted ObjectPageLayoutABHelper
366
- * @returns {void}
278
+ * @returns {boolean} true if menu is open
279
+ * @public
367
280
  */
368
- Menu.prototype._setCustomEnhanceAccStateFunction = function(fn) {
369
- this._fnEnhanceUnifiedMenuAccState = fn;
281
+ Menu.prototype.isOpen = function() {
282
+ return this._getPopover().isOpen();
370
283
  };
371
284
 
372
- Menu.prototype._initMenuForItems = function(aItems, oParentMenuItem) {
373
- var oMenu = new UfdMenu();
374
-
375
- oMenu.attachBeforeClose(this._handleVisualParentClose, this);
376
- oMenu._setCustomEnhanceAccStateFunction(this._fnEnhanceUnifiedMenuAccState);
377
- oMenu.isCozy = this._isMenuCozy.bind(this, oMenu);
285
+ /**
286
+ * Provides a DOM reference ID for the menu container.
287
+ * @returns {string} The DOM reference ID for the menu container
288
+ */
289
+ Menu.prototype.getDomRefId = function() {
290
+ const oPopoverDomRef = this._getPopover().getDomRef();
291
+ return oPopoverDomRef ? oPopoverDomRef.id : "";
292
+ };
378
293
 
379
- // Keep in mind that we are adding the style class to sap.m.Menu as the CustomStyleClassSupport is sync
380
- // in a Mimic mode so only styles added to sap.m.Menu will be applied.
381
- this.addStyleClass('sapMMenu');
294
+ /**
295
+ * Opens the menu as a context menu.
296
+ *
297
+ * @param {jQuery.Event | object} oEvent The event object or an object containing offsetX, offsetY
298
+ * values and left, top values for the element's position
299
+ * @param {sap.ui.core.Element|HTMLElement} oOpenerRef The reference of the opener
300
+ * @public
301
+ */
302
+ Menu.prototype.openAsContextMenu = function(oEvent, oOpenerRef) {
303
+ const oPopover = this._getPopover(),
304
+ bPageCoordinates = oEvent && oEvent.pageX !== undefined && oEvent.pageY !== undefined,
305
+ bOffsetCoordinates = !bPageCoordinates && !oOpenerRef && oEvent.offsetX !== undefined && oEvent.offsetY !== undefined,
306
+ oOriginalEvent = oEvent && oEvent.originalEvent;
307
+ let oOpenerDomRef = oOpenerRef && oOpenerRef.getDomRef ? oOpenerRef.getDomRef() : oOpenerRef,
308
+ oPointerElement = document.getElementById("sapMMenuContextMenuPointer"),
309
+ oPointerParent = document.body,
310
+ oPointerSibling = null,
311
+ iX = 0,
312
+ iY = 0;
313
+
314
+ oPopover._getPopup().setDurations(this._openDuration, 0);
315
+
316
+ // explicitly close the popover if it is already open
317
+ if (oPopover.isOpen()) {
318
+ oPopover.close();
319
+ }
320
+
321
+ // on mobile devices, the popover is opened by the ResponsivePopover control on fullscreen,
322
+ // there's no need to use opener or do some positioning
323
+ if (Device.system.phone) {
324
+ oPopover.openBy();
325
+ return;
326
+ }
382
327
 
383
- // Every new menu style class properties should be a reference to the control style class properties.
384
- // This is needed because every menu level has a new popup like DOM structure in the static area and it's
385
- // a sibling and not a child of the previous menu. Keep in mind that if the sap.m.Menu introduces a renderer
386
- // in the future this must not be propagated like this not to pollute the control itself with classes
387
- // from the children.
388
- oMenu.aCustomStyleClasses = this.aCustomStyleClasses;
389
- oMenu.mCustomStyleClassMap = this.mCustomStyleClassMap;
328
+ // if the opener reference is not provided, we try to get it from the event
329
+ if (!oOpenerRef && !bOffsetCoordinates) {
330
+ oOpenerDomRef = oEvent.srcControl ? oEvent.srcControl.getDomRef() : null;
390
331
 
391
- aItems.forEach(function(oItem) {
392
- if (this._isMenuItemGroup(oItem)) {
393
- this._addVisualMenuItemGroupFromItemsGroup(oItem, oMenu);
394
- } else {
395
- this._addVisualMenuItemFromItem(oItem, oMenu);
332
+ if (!oOpenerDomRef) {
333
+ oOpenerDomRef = oOriginalEvent && oOriginalEvent.currentTarget ? oOriginalEvent.currentTarget : null;
396
334
  }
397
- }.bind(this));
335
+ }
398
336
 
399
- if (oParentMenuItem) {
400
- oParentMenuItem.setSubmenu(oMenu);
401
- } else {
402
- oMenu.getPopup().attachClosed(this._menuClosed, this);
403
- this.setAggregation('_menu', oMenu, true);
337
+ // remove previously existing pointer element
338
+ if (oPointerElement) {
339
+ oPointerElement.remove();
404
340
  }
405
341
 
406
- oMenu.attachItemSelect(this._handleMenuItemSelect, this);
407
- };
342
+ // create a new pointer element
343
+ oPointerElement = document.createElement("div");
344
+ oPointerElement.id = "sapMMenuContextMenuPointer";
345
+ oPointerElement.className = "sapMMenuContextMenuPointer";
408
346
 
409
- Menu.prototype._handleVisualParentClose = function(oEvent) {
410
- if (!this.fireBeforeClose()) {
411
- oEvent.preventDefault();
412
- }
413
- };
347
+ const oOpenerData = oOpenerDomRef ? oOpenerDomRef.getBoundingClientRect() : null;
414
348
 
415
- Menu.prototype._menuClosed = function() {
416
- this.fireClosed();
417
- };
349
+ if (oOriginalEvent && bPageCoordinates) {
350
+ const iPageX = oOriginalEvent.pageX || oOriginalEvent.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft);
351
+ const iPageY = oOriginalEvent.pageY || oOriginalEvent.clientY + (document.documentElement.scrollTop || document.body.scrollTop);
418
352
 
419
- Menu.prototype._getMenu = function() {
420
- return this.getAggregation("_menu");
421
- };
353
+ if (oOpenerDomRef.tagName.toLowerCase() === "tr") {
354
+ oPointerParent = oOpenerDomRef.firstChild ? oOpenerDomRef.firstChild : oOpenerDomRef;
355
+ oPointerSibling = oPointerParent.firstChild ? oPointerParent.firstChild : null;
356
+ } else {
357
+ oPointerParent = oOpenerDomRef;
358
+ oPointerSibling = oOpenerDomRef.firstChild ? oOpenerDomRef.firstChild : null;
359
+ }
422
360
 
423
- Menu.prototype._initCloseButton = function() {
424
- var oRB = Library.getResourceBundleFor("sap.m");
361
+ iX = (iPageX - oOpenerData.left - window.scrollX);
362
+ iY = (iPageY - oOpenerData.top - window.scrollY);
425
363
 
426
- return new Button({
427
- text: oRB.getText("MENU_CLOSE"),
428
- press: fnBtnClosePressHandler.bind(this)
429
- });
430
- };
364
+ if (Localization.getRTL()) {
365
+ iX = document.body.clientWidth - iX;
366
+ }
431
367
 
432
- function fnBtnClosePressHandler() {
433
- this._getDialog().close();
434
- }
368
+ } else if (bOffsetCoordinates) {
369
+ // if the coordinates are provided, we create a pointer element at the specified position
370
+ iX = oEvent.offsetX;
371
+ iY = oEvent.offsetY;
372
+ }
435
373
 
436
- Menu.prototype._initNavContainer = function() {
437
- var oNavContainer = new NavContainer();
438
- this._navContainerId = oNavContainer.getId();
439
- return oNavContainer;
374
+ oPointerParent.insertBefore(oPointerElement, oPointerSibling);
375
+ oPointerElement.style.insetInlineStart = `${iX}px`;
376
+ oPointerElement.style.insetBlockStart = `${iY}px`;
377
+ oPointerElement.setAttribute("aria-hidden", "true");
378
+
379
+ oPopover.openBy(oPointerElement);
380
+ oPopover.attachAfterClose(this._onContextMenuClose, this);
440
381
  };
441
382
 
442
383
  /**
443
- * Gets the internal <code>sap.m.NavContainer</code> for mobile.
444
- * @returns {sap.m.NavContainer} The sap.m.NavContainer
384
+ * Removes the pointer element from the DOM when the context menu is closed.
445
385
  * @private
446
386
  */
447
- Menu.prototype._getNavContainer = function() {
448
- return Element.getElementById(this._navContainerId);
449
- };
387
+ Menu.prototype._onContextMenuClose = function() {
388
+ const oPointerElement = document.getElementById("sapMMenuContextMenuPointer"),
389
+ oPopover = this._getPopover();
450
390
 
451
- Menu.prototype._initAllPages = function() {
452
- this._initPageForParent(this);
391
+ oPointerElement && oPointerElement.remove();
392
+ oPopover.detachAfterClose(this._onContextMenuClose, this);
453
393
  };
454
394
 
455
- Menu.prototype._initPageForParent = function(oParent) {
456
- var aItems = oParent.getItems(),
457
- isRootPage = oParent instanceof Menu,
458
- sPageTitle = isRootPage ? oParent.getTitle() : oParent.getText(),
459
- oList = new List({
460
- mode: ListMode.None
461
- }),
462
- oPage = new Page({
463
- title: sPageTitle,
464
- showNavButton: !isRootPage,
465
- content: oList
466
- });
467
-
468
- if (!isRootPage) {
469
- this._setBackButtonTooltipForPageWithParent(oParent, oPage);
470
- }
471
-
472
- oPage.attachNavButtonPress(function() {
473
- this._getNavContainer().back();
474
- }, this);
475
-
476
- this._getNavContainer().addPage(oPage);
477
-
478
- aItems.forEach(function(oItem) {
479
- this._addListItemFromItem(oItem, oPage);
480
- }, this);
481
-
482
- this._updateListInset(oList);
483
-
484
- oList.attachEvent("itemPress", this._handleListItemPress, this);
395
+ /**
396
+ * Override mutator public methods for CustomStyleClassSupport so it's properly propagated to the popover.
397
+ * Keep in mind we don't overwrite <code>hasStyleClass</code> method - we are only propagating the state.
398
+ * We don't mimic the popover custom style class support.
399
+ *
400
+ * @override
401
+ */
402
+ ["addStyleClass", "removeStyleClass", "toggleStyleClass"].forEach(function (sMethodName) {
403
+ Menu.prototype[sMethodName] = function (sClass, bSuppressInvalidate) {
404
+ const oPopover = this._getPopover();
485
405
 
486
- return oPage;
487
- };
406
+ this._getMenuWrapper()._processStyleClasses(sClass, sMethodName);
488
407
 
489
- Menu.prototype._handleListItemPress = function(oEvent) {
490
- var oListItem = oEvent.getParameter("listItem"),
491
- oMenuItem = Element.getElementById(oListItem.getMenuItem()),
492
- pageId = oMenuItem._getItems().length ? oMenuItem._getVisualChild() : null,
493
- bSelected = !oListItem.getProperty("selected");
494
-
495
- if (pageId) {
496
- this._getNavContainer().to(pageId);
497
- } else {
498
- this._getDialog().close();
499
- if (oListItem._getItemSelectionMode() !== ItemSelectionMode.None) {
500
- oListItem.setSelected(bSelected);
501
- oMenuItem.setSelected(bSelected);
408
+ Control.prototype[sMethodName].apply(this, arguments);
409
+ if (sMethodName !== "toggleStyleClass" && oPopover) {
410
+ oPopover[sMethodName].apply(oPopover, arguments);
502
411
  }
503
412
 
504
- this.fireItemSelected({ item: oMenuItem });
505
- }
506
- oMenuItem.firePress();
507
- };
413
+ return this;
414
+ };
415
+ });
508
416
 
509
417
  /**
510
- * Sets an ARIA tooltip for a back button of a page.
511
- * @param {object} oParent The parent item for the page
512
- * @param {object} oPage The page
513
- * @private
418
+ * Returns an array containing the selected menu items.
419
+ * <b>Note:</b> Only items with <code>selected</code> property set that are members of <code>MenuItemGroup</code> with <code>ItemSelectionMode</code> property
420
+ * set to {@link sap.ui.core.ItemSelectionMode.SingleSelect} or {@link sap.ui.unified.ItemSelectionMode.MultiSelect}> are taken into account.
421
+ *
422
+ * @since 1.127.0
423
+ * @public
424
+ * @returns {Array} Array of all selected items
514
425
  */
515
- Menu.prototype._setBackButtonTooltipForPageWithParent = function(oParent, oPage) {
516
- var oParentParent = oParent.getParent(),
517
- oRb = Library.getResourceBundleFor("sap.m"),
518
- sParentPageTitle;
519
-
520
- sParentPageTitle = oParentParent instanceof Menu ? oParentParent.getTitle() : oParentParent.getText();
521
- sParentPageTitle = oRb.getText("MENU_PAGE_BACK_BUTTON") + " " + sParentPageTitle;
522
- oPage.setNavButtonTooltip(sParentPageTitle);
426
+ Menu.prototype.getSelectedItems = function() {
427
+ return this._getItems().filter((oItem) => oItem.getSelected && oItem.getSelected() && oItem._getItemSelectionMode() !== ItemSelectionMode.None);
523
428
  };
524
429
 
525
430
  /**
526
- * Checks if an item is a MenuItemGroup or not.
527
- * @param {sap.m.IMenuItem} oItem The item to be checked
528
- * @returns {boolean} Whether the item is a MenuItemGroup or not
431
+ * Collects the items which submenus should be closed if necessary.
432
+ *
433
+ * @param {sap.ui.base.Event} oEvent closeItemSubmenu event
529
434
  * @private
530
435
  */
531
- Menu.prototype._isMenuItemGroup = function(oItem) {
532
- return !!oItem.getItemSelectionMode;
533
- };
436
+ Menu.prototype._collectSubmenusToClose = function(oEvent) {
437
+ const oItem = oEvent.getParameter("item");
534
438
 
535
- Menu.prototype._createMenuListItemFromItem = function(oItem) {
536
- var sMenuListItemId = this._generateListItemId(oItem.getId()),
537
- oListItem = Element.getElementById(sMenuListItemId),
538
- oItemGroup = Element.getElementById(oItem.getAssociation("_group"));
439
+ this._refreshSubmenusToClose();
539
440
 
540
- if (oListItem) {
541
- return oListItem;
441
+ // check if the submenu is already in the list
442
+ if (this._aSubmenusToClose.indexOf(oItem) === -1) {
443
+ this._aSubmenusToClose.push(oItem);
542
444
  }
543
-
544
- oListItem = new MenuListItem({
545
- id : sMenuListItemId,
546
- type: oItem.getEnabled() ? ListType.Active : ListType.Inactive,
547
- icon: oItem.getIcon(),
548
- title: this._handleSettingsValue(oItem.getText()),
549
- selected: oItem.getSelected(),
550
- startsSection: oItem.getStartsSection(),
551
- menuItem: oItem,
552
- tooltip: this._handleSettingsValue(oItem.getTooltip()),
553
- visible: oItem.getVisible(),
554
- enabled: oItem.getEnabled()
555
- });
556
-
557
- oListItem.setAssociation("_group", oItemGroup);
558
-
559
- oItem.aDelegates.forEach(function(oDelegateObject) {
560
- oListItem.addEventDelegate(oDelegateObject.oDelegate, oDelegateObject.vThis);
561
- });
562
-
563
- return oListItem;
564
445
  };
565
446
 
566
- Menu.prototype._createVisualMenuItemFromItem = function(oItem) {
567
- var sUfdMenuItemId = this._generateUnifiedMenuItemId(oItem.getId()),
568
- oUfdMenuItem = Element.getElementById(sUfdMenuItemId),
569
- aCustomData = oItem.getCustomData(),
570
- aEndContent = oItem.getEndContent();
571
-
572
- if (oUfdMenuItem) {
573
- return oUfdMenuItem;
574
- }
575
-
576
- oUfdMenuItem = new UfdMenuItem({
577
- id: sUfdMenuItemId,
578
- icon: oItem.getIcon(),
579
- text: this._handleSettingsValue(oItem.getText()),
580
- selected: oItem.getSelected(),
581
- shortcutText: this._handleSettingsValue(oItem.getShortcutText()),
582
- startsSection: oItem.getStartsSection(),
583
- tooltip: this._handleSettingsValue(oItem.getTooltip()),
584
- visible: oItem.getVisible(),
585
- enabled: oItem.getEnabled()
586
- });
587
-
588
- for (var i = 0; i < aCustomData.length; i++) {
589
- oItem._addCustomData(oUfdMenuItem, aCustomData[i]);
590
- }
591
-
592
- aEndContent.forEach((oEndContent) => {
593
- oItem._addEndContent(oUfdMenuItem, oEndContent);
594
- });
595
-
596
- oItem.aDelegates.forEach(function(oDelegateObject) {
597
- oUfdMenuItem.addEventDelegate(oDelegateObject.oDelegate, oDelegateObject.vThis);
598
- });
599
-
600
- return oUfdMenuItem;
601
- };
602
-
603
- Menu.prototype._addVisualMenuItemFromItem = function(oItem, oMenuOrGroup, iIndex) {
604
- var oMenuItem = this._createVisualMenuItemFromItem(oItem),
605
- oMenuParent = this._isMenuItemGroup(oMenuOrGroup) ? oMenuOrGroup.getParent() : oMenuOrGroup,
606
- aItemItems = oItem.getItems(),
607
- oFirstItem;
608
-
609
- oItem._setVisualParent(oMenuParent);
610
- oItem._setVisualControl(oMenuItem);
611
-
612
- if (aItemItems.length) {
613
- oFirstItem = aItemItems[0];
614
- if (this._isMenuItemGroup(oFirstItem)) {
615
- var aGroupItems = oFirstItem.getItems();
616
- oFirstItem = aGroupItems.length ? aGroupItems[0] : null;
617
- }
618
- this._initMenuForItems(aItemItems, oMenuItem);
619
- oFirstItem && oItem._setVisualChild(oFirstItem._getVisualParent());
620
- }
621
-
622
- iIndex === undefined ? oMenuOrGroup.addItem(oMenuItem) : oMenuOrGroup.insertItem(oMenuItem, iIndex);
623
- };
624
-
625
- Menu.prototype._createVisualMenuItemGroupFromItemsGroup = function(oGroup) {
626
- var sUfdMenuItemGroupId = this._generateUnifiedMenuItemId(oGroup.getId()),
627
- oUfdMenuItemGroup = Element.getElementById(sUfdMenuItemGroupId),
628
- aCustomData = oGroup.getCustomData();
629
-
630
- if (oUfdMenuItemGroup) {
631
- return oUfdMenuItemGroup;
632
- }
633
-
634
- oUfdMenuItemGroup = new UfdMenuItemGroup({
635
- id: sUfdMenuItemGroupId,
636
- itemSelectionMode: oGroup.getItemSelectionMode()
637
- });
638
-
639
- oGroup._setVisualControl(oUfdMenuItemGroup);
640
- oGroup._setParentMenu(this);
641
-
642
- for (var i = 0; i < aCustomData.length; i++) {
643
- oGroup._addCustomData(oUfdMenuItemGroup, aCustomData[i]);
644
- }
645
-
646
- return oUfdMenuItemGroup;
647
- };
648
-
649
- Menu.prototype._addVisualMenuItemGroupFromItemsGroup = function(oGroup, oMenu, iIndex) {
650
- var oMenuItemGroup = this._createVisualMenuItemGroupFromItemsGroup(oGroup),
651
- aItems = oGroup.getItems();
652
-
653
- iIndex === undefined ? oMenu.addItem(oMenuItemGroup) : oMenu.insertItem(oMenuItemGroup, iIndex);
654
-
655
- for (var i = 0; i < aItems.length; i++) {
656
- this._addVisualMenuItemFromItem(aItems[i], oMenuItemGroup);
657
- }
658
-
447
+ /**
448
+ * Allows for any custom function to be called back when accessibility attributes
449
+ * of underlying menu are about to be rendered.
450
+ * The function is called once per MenuItem
451
+ *
452
+ * @param {function} fn The callback function
453
+ * @private
454
+ * @ui5-restricted ObjectPageLayoutABHelper
455
+ * @returns {void}
456
+ */
457
+ Menu.prototype._setCustomEnhanceAccStateFunction = function(fn) {
458
+ this._fnEnhanceUnifiedMenuAccState = fn;
659
459
  };
660
460
 
661
- Menu.prototype._addListItemFromItem = function(oItem, oPage, iIndex) {
662
- var aItemItems = oItem.getItems(),
663
- bItemIsGroup = this._isMenuItemGroup(oItem),
664
- oFirstItem;
665
-
666
- if (bItemIsGroup) {
667
- oItem._setParentMenu(this);
668
- oItem.getItems().forEach((oItem) => {
669
- this._addListItemFromItem(oItem, oPage, iIndex);
670
- if (iIndex !== undefined) {
671
- iIndex++;
672
- }
673
- });
674
- return;
675
- }
676
-
677
- var oMenuListItem = this._createMenuListItemFromItem(oItem),
678
- oList = oPage.getContent()[0];
461
+ Menu.prototype._menuClosed = function(oEvent) {
462
+ const oOpener = oEvent && oEvent.getParameter("openBy");
679
463
 
680
- oItem._setVisualParent(oPage);
681
- oItem._setVisualControl(oMenuListItem);
464
+ this.fireClosed();
682
465
 
683
- if (aItemItems.length) {
684
- this._initPageForParent(oItem);
685
- oFirstItem = aItemItems[0];
686
- if (this._isMenuItemGroup(oFirstItem)) {
687
- aItemItems = oFirstItem.getItems();
688
- oFirstItem = aItemItems.length ? aItemItems[0] : null;
689
- }
690
- if (oFirstItem) {
691
- oItem._setVisualChild(oFirstItem._getVisualParent());
466
+ if (oOpener) {
467
+ try {
468
+ oOpener.focus();
469
+ } catch (e) {
470
+ Log.warning("Menu.close cannot restore the focus on opener " + oOpener + ", " + e);
692
471
  }
693
472
  }
694
-
695
- if (iIndex === undefined) {
696
- oList.addItem(oMenuListItem);
697
- } else {
698
- oList.insertItem(oMenuListItem, iIndex);
699
- }
700
-
701
- oList.invalidate();
702
473
  };
703
474
 
704
475
  /**
705
- * Connects an instance of sap.ui.unified.MenuItem for given sap.m.MenuItem.
706
- * The sap.ui.unified.MenuItem is rendered to the end-user.
707
- * If there is an instance of sap.ui.unified.MenuItem already connected, this method does nothing.
708
- * @param {sap.m.MenuItem} oItem the item to assign a visual item for
709
- * @param {sap.ui.core.Control} oControl the container control
710
- * @param {int} iIndex the index of the given item inside the aggregation <items>
476
+ * Checks if an item is a MenuItemGroup or not.
477
+ *
478
+ * @param {sap.m.IMenuItem} oItem The item to be checked
479
+ * @returns {boolean} Whether the item is a MenuItemGroup or not
711
480
  * @private
712
481
  */
713
- Menu.prototype._connectVisualItem = function(oItem, oControl, iIndex) {
714
- if (!oControl || (Element.getElementById(oItem._getVisualControl()) && oControl.indexOfItem(oItem) !== -1)) {
715
- return;
716
- }
717
-
718
- if (Device.system.phone) {
719
- this._addListItemFromItem(oItem, oControl, iIndex);
720
- var oList = oControl.getContent()[0];
721
- this._updateListInset(oList);
722
- } else { //desktop & tablet
723
- this._addVisualMenuItemFromItem(oItem, oControl, iIndex);
724
- }
725
- };
726
-
727
- Menu.prototype._updateListInset = function(oList) {
728
- var bHasIcons = false,
729
- sInsetClass = "sapMListIcons",
730
- aItems = oList.getItems();
731
-
732
- for (var i = 0; i < aItems.length; i++) {
733
- if (aItems[i].getIcon()) {
734
- bHasIcons = true;
735
- break;
736
- }
737
- }
738
-
739
- if (bHasIcons) {
740
- oList.addStyleClass(sInsetClass);
741
- } else {
742
- oList.removeStyleClass(sInsetClass);
743
- }
482
+ Menu.prototype._isMenuItemGroup = function(oItem) {
483
+ return !!oItem.getItemSelectionMode;
744
484
  };
745
485
 
746
486
  /**
747
487
  * Returns list of items stored in <code>items</code> aggregation. If there are group items,
748
488
  * the items of the group are returned instead of their group item.
749
489
  *
750
- * @returns {sap.ui.unified.MenuItem} List of all menu items
490
+ * @returns {sap.m.MenuItem} List of all menu items
751
491
  * @private
752
492
  */
753
493
  Menu.prototype._getItems = function() {
754
- var aItems = [];
494
+ const aItems = [];
755
495
 
756
496
  const findItems = (aItemItems) => {
757
497
  aItemItems.forEach((oItem) => {
@@ -768,409 +508,172 @@ sap.ui.define([
768
508
  return aItems;
769
509
  };
770
510
 
771
- Menu.prototype._handleMenuItemSelect = function(oEvent) {
772
- var oUnfdItem = oEvent.getParameter("item"),
773
- oMenuItem;
774
-
775
- if (!oUnfdItem) {
776
- return;
777
- }
778
-
779
- oMenuItem = this._findMenuItemByUnfdMenuItem(oUnfdItem);
780
-
781
- oMenuItem.setSelected(oUnfdItem.getSelected());
782
-
783
-
784
- if (oMenuItem && !oMenuItem._getItems().length) {
785
- this.fireItemSelected({item: oMenuItem});
786
- }
787
- if (oMenuItem) {
788
- oMenuItem.firePress();
789
- }
790
- };
791
-
792
- Menu.prototype._generateListItemId = function (sMenuItemId) {
793
- return sMenuItemId + Menu.LIST_ITEMS_ID_SUFFIX;
794
- };
795
-
796
- Menu.prototype._generateUnifiedMenuItemId = function (sMenuItemId) {
797
- return sMenuItemId + Menu.UNIFIED_MENU_ITEMS_ID_SUFFIX;
798
- };
799
-
800
- Menu.prototype._findMenuItemByUnfdMenuItem = function(oUnfdMenuItem) {
801
- var sId = oUnfdMenuItem.getId().slice(0, -Menu.UNIFIED_MENU_ITEMS_ID_SUFFIX.length);
802
- return Element.getElementById(sId);
803
- };
511
+ /* ResponsivePopover and MenuWrapper functionality */
804
512
 
805
513
  /**
806
- * Checks whether the <code>Menu</code> should run with cozy design.
807
- * This function must only be called on the root menu (<code>getRootMenu</code>) to get proper results.
808
- * @param {object} oMenu The <code>Menu</code> which is checked
809
- * @returns {boolean} If the <code>Menu</code> should run with cozy design
514
+ * Creates the internal MenuWrapper control.
515
+ * @param {boolean} bIsSubmenu Whether the menu in this wrapper is a submenu or not
516
+ * @returns {sap.m.MenuWrapper} The created MenuWrapper
810
517
  * @private
811
518
  */
812
- Menu.prototype._isMenuCozy = function(oMenu) {
813
- if (!oMenu.bCozySupported) {
814
- return false;
815
- }
816
-
817
- if (oMenu.hasStyleClass("sapUiSizeCozy")) {
818
- return true;
819
- }
820
-
821
- if (checkCozyMode(oMenu.oOpenerRef)) {
822
- return true;
823
- }
824
-
825
- return false;
519
+ Menu.prototype._createMenuWrapper = function(bIsSubmenu) {
520
+ const oMenuWrapper = new MenuWrapper(this.getId() + "-menuWrapper", { isSubmenu: bIsSubmenu });
521
+ this.setAggregation("_menuWrapper", oMenuWrapper, true);
522
+ return oMenuWrapper;
826
523
  };
827
524
 
828
- function checkCozyMode(oRef) {
829
- if (!oRef) {
830
- return false;
831
- }
832
- oRef = oRef.$ ? oRef.$() : jQuery(oRef);
833
- var $ClosestParent = oRef.closest(".sapUiSizeCompact,.sapUiSizeCondensed,.sapUiSizeCozy");
834
- return (!$ClosestParent.hasClass("sapUiSizeCompact") && !$ClosestParent.hasClass("sapUiSizeCondensed"))
835
- || $ClosestParent.hasClass("sapUiSizeCozy");
836
- }
837
-
838
- Menu.prototype.addAggregation = function(sAggregationName, oObject, bSuppressInvalidate) {
839
- Control.prototype.addAggregation.apply(this, arguments);
840
-
841
- if (sAggregationName === "items") {
842
- this._connectVisualItem(oObject, this._getVisualParent());
843
- }
844
-
845
- return this;
846
- };
847
-
848
- Menu.prototype.insertAggregation = function(sAggregationName, oObject, iIndex, bSuppressInvalidate) {
849
- Control.prototype.insertAggregation.apply(this, arguments);
850
-
851
- if (sAggregationName === "items") {
852
- this._connectVisualItem(oObject, this._getVisualParent(), iIndex);
853
- }
854
-
855
- return this;
856
- };
857
-
858
- Menu.prototype.removeAggregation = function(sAggregationName, vObject, bSuppressInvalidate) {
859
- var oItem = Control.prototype.removeAggregation.apply(this, arguments);
860
-
861
- if (sAggregationName === "items") {
862
- this._removeVisualItem(oItem);
863
- }
864
-
865
- return oItem;
866
- };
867
-
868
- Menu.prototype.removeAllAggregation = function(sAggregationName, bSuppressInvalidate) {
869
- var aItems = Control.prototype.removeAllAggregation.apply(this, arguments);
525
+ /**
526
+ * Creates the ResponsivePopover that contains the actual menu.
527
+ * @returns {sap.m.ResponsivePopover} The created ResponsivePopover
528
+ * @private
529
+ */
530
+ Menu.prototype._createPopover = function() {
531
+ let oPopover = this._getPopover();
870
532
 
871
- if (sAggregationName === "items") {
872
- for (var i = 0; i < aItems.length; i++) {
873
- this._removeVisualItem(aItems[i]);
874
- }
533
+ if (oPopover) {
534
+ return oPopover;
875
535
  }
876
536
 
877
- return aItems;
878
- };
879
-
880
- Menu.prototype._removeVisualItem = function(oItem, oParentItem) {
881
- var oVisualItem = Element.getElementById(oItem._getVisualControl()),
882
- vMenuOrList;
883
-
884
- if (oVisualItem) {
885
- vMenuOrList = oVisualItem.getParent();
886
- vMenuOrList.removeItem(oVisualItem);
887
-
888
- if (Device.system.phone) {
889
- this._removeSubPageForItem(oItem);
537
+ const sDialogAccessibleNameId = Device.system.phone
538
+ ? `${this.getId()}-title`
539
+ : InvisibleText.getStaticId("sap.m", "MENU_POPOVER_ACCESSIBLE_NAME");
890
540
 
891
- //if this is the last item in the page, remove the page
892
- if (vMenuOrList.getItems().length === 0) {
893
- // now we need to update its parent list item - no to render its arrow and reset its visual child ref
894
- if (oParentItem) {
895
- oParentItem._setVisualChild(null);
896
- Element.getElementById(oParentItem._getVisualControl()).invalidate();
897
- }
898
- }
541
+ const oMenuWrapper = this._getMenuWrapper(),
542
+ bRTL = Localization.getRTL(),
543
+ bIsSubmenu = oMenuWrapper.getIsSubmenu(),
544
+ iOffsetXCorrection = bRTL ? 4 : -4;
899
545
 
900
- if (vMenuOrList) { //if it is not destroyed already in the statement above
901
- vMenuOrList.invalidate();
902
- }
903
- }
904
- }
905
- };
546
+ oPopover = new ResponsivePopover(this.getId() + "-rp", {
547
+ placement: this._getPopoverPlacement(),
548
+ showHeader: false,
549
+ showArrow: false,
550
+ showCloseButton: false,
551
+ verticalScrolling: true,
552
+ horizontalScrolling: false,
553
+ offsetX: bIsSubmenu ? iOffsetXCorrection : 1,
554
+ offsetY: bIsSubmenu ? 4 : 1,
555
+ content: oMenuWrapper,
556
+ ariaLabelledBy: [sDialogAccessibleNameId]
557
+ });
558
+ oPopover.addStyleClass("sapMMenu");
906
559
 
907
- Menu.prototype.destroyAggregation = function(sAggregationName, bSuppressInvalidate) {
908
- if (sAggregationName === "items") {
909
- for (var i = 0; i < this.getItems().length; i++) {
910
- this._removeVisualItem(this.getItems()[i]);
911
- }
912
- }
560
+ this.setAggregation("_popover", oPopover, true);
913
561
 
914
- return Control.prototype.destroyAggregation.apply(this, arguments);
915
- };
562
+ if (Device.system.phone) {
563
+ oPopover.setShowHeader(true);
564
+ oPopover.setEndButton(this._createCloseButton());
565
+ oPopover.setCustomHeader(this._createHeaderBar());
566
+ } else if (bIsSubmenu) {
567
+ oPopover.getAggregation("_popup")._adaptPositionParams = function() {
568
+ this._marginTop = 0;
569
+ this._marginLeft = 0;
570
+ this._marginRight = 0;
571
+ this._marginBottom = 0;
916
572
 
917
- Menu.prototype._removeSubPageForItem = function(oItem, bSkipChildren) {
918
- var oSubMenuPage;
573
+ this._arrowOffset = 0;
574
+ this._offsets = ["0 0", "0 0", "0 0", "0 0"];
919
575
 
920
- if (!bSkipChildren) {
921
- for (var i = 0; i < oItem.getItems().length; i++) {
922
- this._removeSubPageForItem(oItem.getItems()[i]);
923
- }
576
+ this._myPositions = ["begin bottom", "begin top", "begin top", "end top"];
577
+ this._atPositions = ["begin top", "end top", "begin bottom", "begin top"];
578
+ };
924
579
  }
925
580
 
926
- if (oItem._getVisualChild()) {
927
- oSubMenuPage = Element.getElementById(oItem._getVisualChild());
928
- if (this._getNavContainer() && oSubMenuPage) {
929
- this._getNavContainer().removePage(oSubMenuPage);
930
- }
931
- !!oSubMenuPage && oSubMenuPage.destroy();
932
- }
933
- };
581
+ // this override is needed to fix the issue with the popover position flip
582
+ oPopover._oControl._getDocHeight = () => window.innerHeight + window.scrollY;
934
583
 
935
- Menu.prototype._getVisualParent = function() {
936
- var oNavContainer = this._getNavContainer(),
937
- oMenu = this._getMenu();
938
-
939
- if (oNavContainer && oNavContainer.getPages().length) { //mobile
940
- return oNavContainer.getPages()[0];
941
- } else {
942
- return oMenu;
943
- }
584
+ return oPopover;
944
585
  };
945
586
 
946
587
  /**
947
- * Handle the event of changing any property of any menu items and sub-items.
948
- * @param {object} oEvent The event data object
949
- * @private
588
+ * Creates the back button for the Responsive Popover in mobile view.
589
+ * @returns {sap.m.Button} The back button
950
590
  */
951
- Menu.prototype._onPropertyChanged = function (oEvent) {
952
- oEvent.cancelBubble();
953
- var sPropertyKey = oEvent.getParameter("propertyKey"),
954
- oPropertyValue = oEvent.getParameter("propertyValue"),
955
- mTargetMenuItemProps = Device.system.phone ? Menu.MENU_LIST_ITEMS_PROPS : Menu.UNFIFIED_MENU_ITEMS_PROPS,
956
- fnGenerateTargetItemId = Device.system.phone ? this._generateListItemId : this._generateUnifiedMenuItemId,
957
- sTargetItemId, oTargetItem;
958
-
959
- if (Device.system.phone && sPropertyKey === 'text') {
960
- sPropertyKey = 'title';
961
- }
962
-
963
- if (!mTargetMenuItemProps[sPropertyKey]) {
964
- return;
965
- }
966
- sTargetItemId = fnGenerateTargetItemId(oEvent.getSource().getId());
967
- oTargetItem = Element.getElementById(sTargetItemId);
968
-
969
- if (oTargetItem) {
970
- // Private aggregations are not going to get cloned if ManagedObject.prototype.clone method gets called.
971
- // This would mean that it is possible to not have a sap.ui.unified.Menu instance and the corresponding
972
- // sap.ui.unified.MenuItem instances at that point in time.
973
- oTargetItem.setProperty(sPropertyKey, oPropertyValue);
974
- if (Device.system.phone && this._getDialog().isOpen()) {
975
- this._getDialog().close();
591
+ Menu.prototype._createBackButton = function() {
592
+ return new Button(this.getId() + "-backbutton", {
593
+ icon : "sap-icon://nav-back",
594
+ press : (oEvent) => {
595
+ this._getMenuWrapper().fireClosePopover();
976
596
  }
977
- }
978
- };
979
-
980
- /**
981
- * Handle the event of changing any aggregation of any menu items and sub-items.
982
- * @param {object} oEvent The event data object
983
- * @private
984
- */
985
- Menu.prototype._onAggregationChanged = function(oEvent) {
986
- oEvent.cancelBubble();
987
- var sAggregationname = oEvent.getParameter("aggregationName");
988
-
989
- switch (sAggregationname) {
990
- case 'items':
991
- this._onItemsAggregationChanged(oEvent);
992
- break;
993
- case 'tooltip':
994
- this._onTooltipAggregationChanged(oEvent);
995
- break;
996
- default:
997
- }
597
+ });
998
598
  };
999
599
 
1000
600
  /**
1001
- * Handle the event of changing the "tooltip" aggregation of any menu items and sub-items.
1002
- * @param {object} oEvent The event data object
1003
- * @private
601
+ * Creates the custom header bar for the Responsive Popover in mobile view.
602
+ * @returns {sap.m.Bar} The header bar
1004
603
  */
1005
- Menu.prototype._onTooltipAggregationChanged = function(oEvent) {
1006
- var sVisualItemId = oEvent.getSource()._getVisualControl(),
1007
- methodName = oEvent.getParameter("methodName"),
1008
- methodParams = oEvent.getParameter("methodParams"),
1009
- oVisualItem;
604
+ Menu.prototype._createHeaderBar = function() {
605
+ const oMenuWrapper = this._getMenuWrapper(),
606
+ oHeaderBar = new Bar({
607
+ contentMiddle: new Title(this.getId() + "-title", { text: oMenuWrapper.getTitle() })
608
+ }),
609
+ bIsSubmenu = this._getMenuWrapper().getIsSubmenu();
1010
610
 
1011
- if (!sVisualItemId) {
1012
- return;
611
+ if (bIsSubmenu) {
612
+ oHeaderBar.addContentLeft(this._createBackButton());
1013
613
  }
1014
614
 
1015
- oVisualItem = Element.getElementById(sVisualItemId);
1016
-
1017
- if (methodName === "set") {
1018
- oVisualItem.setTooltip(methodParams.item);
1019
- }
1020
- if (methodName === "destroy") {
1021
- oVisualItem.destroyTooltip();
1022
- }
615
+ return oHeaderBar;
1023
616
  };
1024
617
 
1025
618
  /**
1026
- * Handle the event of changing the "items" aggregation of any menu items and sub-items.
1027
- * @param {object} oEvent The event data object
1028
- * @private
619
+ * Creates the close button for the Responsive Popover for mobile view.
620
+ * @returns {sap.m.Button} The close button
1029
621
  */
1030
- Menu.prototype._onItemsAggregationChanged = function(oEvent) {
1031
- var oItem = oEvent.getSource(),
1032
- methodName = oEvent.getParameter("methodName"),
1033
- methodParams = oEvent.getParameter("methodParams"),
1034
- iInsertIndex;
1035
-
1036
- if (methodName === "add" || methodName === "insert") {
1037
- if (methodName === "insert") {
1038
- iInsertIndex = methodParams.index;
1039
- }
1040
- this._addOrInsertItem(oItem, methodParams.item, iInsertIndex);
1041
- }
1042
- if (methodName === "remove") {
1043
- this._removeVisualItem(methodParams.item, oItem);
1044
- }
1045
- if (methodName === "removeall") {
1046
- for (var i = 0; i < methodParams.items.length; i++) {
1047
- this._removeVisualItem(methodParams.items[i], oItem);
1048
- }
1049
- }
1050
- if (methodName === "destroy") {
1051
- this._destroyItem(oItem);
1052
- }
1053
- };
622
+ Menu.prototype._createCloseButton = function() {
623
+ const oRB = Lib.getResourceBundleFor("sap.m");
1054
624
 
1055
- Menu.prototype._addOrInsertItem = function(oParentItem, oNewItem, iInsertIndex) {
1056
- var oLI;
1057
-
1058
- if (oParentItem._getVisualChild()) { //this is not the first sub-item that is added
1059
- this._connectVisualItem(oNewItem, Element.getElementById(oParentItem._getVisualChild()), iInsertIndex);
1060
- } else {
1061
- if (Device.system.phone) {
1062
- this._initPageForParent(oParentItem);
1063
- oParentItem._setVisualChild(oParentItem.getItems()[0]._getVisualParent());
1064
- oLI = Element.getElementById(oParentItem._getVisualControl());
1065
- oLI && oLI.invalidate();
1066
- } else {
1067
- this._initMenuForItems(oParentItem.getItems(), Element.getElementById(oParentItem._getVisualControl()));
1068
- oParentItem._setVisualChild(oParentItem._getItems()[0]._getVisualParent());
625
+ return new Button({
626
+ text: oRB.getText("MENU_CLOSE"),
627
+ press: () => {
628
+ this._getMenuWrapper().fireClosePopover({ bubbleToRoot: true });
1069
629
  }
1070
- }
1071
- };
1072
-
1073
- Menu.prototype._destroyItem = function(oItem) {
1074
- //destroy is handled recursively from the item itself (managed object)
1075
- //so here we receive multiple aggregationChanged events, each one for a separate item
1076
-
1077
- //in the time we re-render the visual item, it's menuitem still has its subitems, so remove the ref for a while
1078
- var oVisualItem = Element.getElementById(oItem._getVisualControl());
1079
- if (oVisualItem && oVisualItem.setMenuItem) {
1080
- oVisualItem.setMenuItem(null);
1081
- }
1082
-
1083
- this._removeSubPageForItem(oItem, true);
1084
-
1085
- // now we need to update its parent list item - no to render its arrow and reset its visual child ref
1086
- oItem._setVisualChild(null);
1087
-
1088
- if (oVisualItem && oVisualItem.setMenuItem) {
1089
- oVisualItem.invalidate();
1090
- oVisualItem.setMenuItem(oItem);
1091
- }
630
+ });
1092
631
  };
1093
632
 
1094
633
  /**
1095
- * Provides a DOM reference ID of the menu container.
1096
- * @returns {string} The DOM reference ID of the menu container
634
+ * Gets the internal MenuWrapper control.
635
+ * @returns {sap.m.MenuWrapper} The internal _menuWrapper aggregation
636
+ * @private
1097
637
  */
1098
- Menu.prototype.getDomRefId = function() {
1099
- if (Device.system.phone) {
1100
- return this._getDialog().getId();
1101
- } else {
1102
- return this._getMenu().getId();
1103
- }
638
+ Menu.prototype._getMenuWrapper = function() {
639
+ const oPopover = this._getPopover();
640
+ return oPopover ? oPopover.getContent()[0] : this.getAggregation("_menuWrapper");
1104
641
  };
1105
642
 
1106
643
  /**
1107
- * Opens the menu as a context menu.
1108
- * @param {jQuery.Event | object} oEvent The event object or an object containing offsetX, offsetY
1109
- * values and left, top values of the element's position
1110
- * @param {sap.ui.core.Element|HTMLElement} oOpenerRef The reference of the opener
1111
- * @public
644
+ * Gets the internal ResponsivePopover.
645
+ * @private
646
+ * @returns {sap.m.ResponsivePopover} The internal _popover aggregation
1112
647
  */
1113
- Menu.prototype.openAsContextMenu = function(oEvent, oOpenerRef) {
1114
-
1115
- if (Device.system.phone) {
1116
- this._openDialog();
1117
- } else {
1118
- if (!this._bIsInitialized) {
1119
- this._initAllMenuItems();
1120
- this._bIsInitialized = true;
1121
- }
1122
-
1123
- this._getMenu().openAsContextMenu(oEvent, oOpenerRef);
1124
- }
648
+ Menu.prototype._getPopover = function() {
649
+ return this.getAggregation("_popover");
1125
650
  };
1126
651
 
1127
652
  /**
1128
- * Override mutator public methods for CustomStyleClassSupport so it's properly propagated to the dialog.
1129
- * Keep in mind we don't overwrite <code>hasStyleClass</code> method - we are only propagating the state
1130
- * we don't mimic the dialog custom style class support.
1131
- * @override
1132
- */
1133
- ["addStyleClass", "removeStyleClass", "toggleStyleClass"].forEach(function (sMethodName) {
1134
- Menu.prototype[sMethodName] = function (sClass, bSuppressInvalidate) {
1135
- var oDialog = this._getDialog();
653
+ * Gets the placement type for the popover depending of LTR/RTL setting.
654
+ * @private
655
+ * @returns {sap.m.PlacementType} the placement type of the popover
656
+ */
657
+ Menu.prototype._getPopoverPlacement = function() {
658
+ const bIsSubmenu = this._getMenuWrapper().getIsSubmenu();
1136
659
 
1137
- Control.prototype[sMethodName].apply(this, arguments);
1138
- if (oDialog) {
1139
- oDialog[sMethodName].apply(oDialog, arguments);
1140
- }
660
+ if (bIsSubmenu) {
661
+ const bRTL = Localization.getRTL(),
662
+ sPlacement = bRTL ? PlacementType.HorizontalPreferredLeft : PlacementType.HorizontalPreferredRight;
1141
663
 
1142
- return this;
1143
- };
1144
- });
664
+ return sPlacement;
665
+ }
1145
666
 
1146
- /**
1147
- * Returns an array containing the selected menu items.
1148
- * <b>Note:</b> Only items with <code>selected</code> property set that are members of <code>MenuItemGroup</code> with <code>ItemSelectionMode</code> property
1149
- * set to {@link sap.ui.core.ItemSelectionMode.SingleSelect} or {@link sap.ui.unified.ItemSelectionMode.MultiSelect}> are taken into account.
1150
- * @since 1.127.0
1151
- * @public
1152
- * @returns {Array} Array of all selected items
1153
- */
1154
- Menu.prototype.getSelectedItems = function() {
1155
- return this._getItems().filter((oItem) => oItem.getSelected && oItem.getSelected() && oItem._getItemSelectionMode() !== ItemSelectionMode.None);
667
+ return PlacementType.VerticalPreferredBottom;
1156
668
  };
1157
669
 
1158
670
  /**
1159
- * Checks if the given property value is binding value and if not escapes it
1160
- * @param {string} sValue property value to be checked
671
+ * Set extra content to the popover.
1161
672
  * @private
1162
- * @returns {string} handled value
673
+ * @param {HTMLElement} oDomRef the DOM ref to be added as extra content to the popover
1163
674
  */
1164
- Menu.prototype._handleSettingsValue = function(sValue) {
1165
- if (typeof sValue !== "string") {
1166
- return sValue;
1167
- }
1168
- try {
1169
- ManagedObject.bindingParser(sValue);
1170
- return sValue;
1171
- } catch {
1172
- return ManagedObject.escapeSettingsValue(sValue);
1173
- }
675
+ Menu.prototype._setExtraContent = function(oDomRef) {
676
+ this._getPopover()._getPopup().setExtraContent([oDomRef]);
1174
677
  };
1175
678
 
1176
679
  return Menu;