@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.
- package/REUSE.toml +0 -28
- package/THIRDPARTY.txt +1 -25
- package/package.json +4 -4
- package/src/sap/m/.library +1 -1
- package/src/sap/m/AccButton.js +1 -1
- package/src/sap/m/ActionListItem.js +1 -1
- package/src/sap/m/ActionSelect.js +1 -1
- package/src/sap/m/ActionSheet.js +1 -1
- package/src/sap/m/ActionTile.js +3 -2
- package/src/sap/m/ActionTileContent.js +1 -1
- package/src/sap/m/AdditionalTextButton.js +1 -1
- package/src/sap/m/App.js +1 -1
- package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
- package/src/sap/m/Avatar.js +3 -3
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/BarInPageEnabler.js +5 -6
- package/src/sap/m/Breadcrumbs.js +1 -1
- package/src/sap/m/BusyDialog.js +1 -1
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +1 -1
- package/src/sap/m/Carousel.js +1 -1
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CheckBox.js +1 -1
- package/src/sap/m/ColorPalette.js +1 -1
- package/src/sap/m/ColorPalettePopover.js +1 -1
- package/src/sap/m/ColorPaletteRenderer.js +2 -1
- package/src/sap/m/Column.js +1 -1
- package/src/sap/m/ColumnHeaderPopover.js +1 -1
- package/src/sap/m/ColumnListItem.js +6 -7
- package/src/sap/m/ColumnListItemRenderer.js +10 -0
- package/src/sap/m/ColumnPopoverActionItem.js +1 -1
- package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
- package/src/sap/m/ColumnPopoverItem.js +1 -1
- package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
- package/src/sap/m/ColumnPopoverSortItem.js +1 -1
- package/src/sap/m/ComboBox.js +1 -1
- package/src/sap/m/ComboBoxBase.js +1 -1
- package/src/sap/m/ComboBoxBaseRenderer.js +1 -9
- package/src/sap/m/ComboBoxTextField.js +1 -1
- package/src/sap/m/ContentConfig.js +1 -1
- package/src/sap/m/CustomListItem.js +1 -1
- package/src/sap/m/CustomTile.js +1 -1
- package/src/sap/m/CustomTreeItem.js +1 -1
- package/src/sap/m/DatePicker.js +1 -21
- package/src/sap/m/DateRangeSelection.js +4 -3
- package/src/sap/m/DateTimeField.js +1 -1
- package/src/sap/m/DateTimeInput.js +1 -1
- package/src/sap/m/DateTimePicker.js +1 -1
- package/src/sap/m/Dialog.js +5 -1
- package/src/sap/m/DialogRenderer.js +14 -6
- package/src/sap/m/DisplayListItem.js +1 -1
- package/src/sap/m/DraftIndicator.js +1 -1
- package/src/sap/m/DynamicDate.js +1 -1
- package/src/sap/m/DynamicDateOption.js +1 -1
- package/src/sap/m/DynamicDateRange.js +1 -1
- package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
- package/src/sap/m/ExpandableText.js +1 -1
- package/src/sap/m/FacetFilter.js +1 -1
- package/src/sap/m/FacetFilterItem.js +1 -1
- package/src/sap/m/FacetFilterList.js +1 -1
- package/src/sap/m/FeedContent.js +1 -1
- package/src/sap/m/FeedInput.js +1 -1
- package/src/sap/m/FeedListItem.js +11 -9
- package/src/sap/m/FeedListItemAction.js +5 -19
- package/src/sap/m/Fiori20Adapter.js +2 -2
- package/src/sap/m/FlexBox.js +1 -1
- package/src/sap/m/FlexItemData.js +1 -1
- package/src/sap/m/FormattedText.js +1 -1
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTile.js +27 -10
- package/src/sap/m/GroupHeaderListItem.js +6 -2
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +1 -1
- package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
- package/src/sap/m/IconTabBar.js +1 -1
- package/src/sap/m/IconTabBarSelectList.js +1 -1
- package/src/sap/m/IconTabFilter.js +9 -1
- package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
- package/src/sap/m/IconTabHeader.js +58 -54
- package/src/sap/m/IconTabSeparator.js +1 -1
- package/src/sap/m/IllustratedMessage.js +48 -10
- package/src/sap/m/Illustration.js +9 -2
- package/src/sap/m/IllustrationRenderer.js +14 -7
- package/src/sap/m/Image.js +1 -1
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +1 -1
- package/src/sap/m/InputBase.js +1 -1
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/InputRenderer.js +1 -14
- package/src/sap/m/Label.js +1 -1
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +1 -26
- package/src/sap/m/LinkRenderer.js +4 -3
- package/src/sap/m/LinkTileContent.js +1 -1
- package/src/sap/m/List.js +2 -2
- package/src/sap/m/ListBase.js +43 -2
- package/src/sap/m/ListBaseRenderer.js +3 -1
- package/src/sap/m/ListItemAction.js +189 -0
- package/src/sap/m/ListItemActionBase.js +52 -0
- package/src/sap/m/ListItemBase.js +88 -17
- package/src/sap/m/ListItemBaseRenderer.js +34 -3
- package/src/sap/m/MaskEnabler.js +1 -1
- package/src/sap/m/MaskInput.js +1 -1
- package/src/sap/m/MaskInputRule.js +1 -1
- package/src/sap/m/Menu.js +385 -882
- package/src/sap/m/MenuButton.js +17 -78
- package/src/sap/m/MenuItem.js +459 -300
- package/src/sap/m/MenuItemGroup.js +9 -353
- package/src/sap/m/MenuItemRenderer.js +220 -0
- package/src/sap/m/MenuListItem.js +1 -1
- package/src/sap/m/MenuWrapper.js +686 -0
- package/src/sap/m/MenuWrapperRenderer.js +123 -0
- package/src/sap/m/MessageBox.js +2 -2
- package/src/sap/m/MessageItem.js +1 -1
- package/src/sap/m/MessageListItem.js +1 -1
- package/src/sap/m/MessagePage.js +1 -1
- package/src/sap/m/MessagePopover.js +1 -1
- package/src/sap/m/MessagePopoverItem.js +1 -1
- package/src/sap/m/MessageStrip.js +3 -2
- package/src/sap/m/MessageToast.js +8 -6
- package/src/sap/m/MessageView.js +1 -1
- package/src/sap/m/MultiComboBox.js +1 -1
- package/src/sap/m/MultiComboBoxRenderer.js +1 -9
- package/src/sap/m/MultiEditField.js +1 -1
- package/src/sap/m/MultiInput.js +4 -2
- package/src/sap/m/NavContainer.js +1 -1
- package/src/sap/m/NewsContent.js +1 -1
- package/src/sap/m/NotificationList.js +1 -1
- package/src/sap/m/NotificationListBase.js +9 -4
- package/src/sap/m/NotificationListGroup.js +1 -1
- package/src/sap/m/NotificationListItem.js +12 -1
- package/src/sap/m/NumericContent.js +1 -1
- package/src/sap/m/NumericInput.js +3 -3
- package/src/sap/m/ObjectAttribute.js +1 -1
- package/src/sap/m/ObjectHeader.js +1 -1
- package/src/sap/m/ObjectIdentifier.js +1 -1
- package/src/sap/m/ObjectListItem.js +1 -1
- package/src/sap/m/ObjectMarker.js +5 -2
- package/src/sap/m/ObjectNumber.js +1 -1
- package/src/sap/m/ObjectStatus.js +1 -1
- package/src/sap/m/OverflowToolbar.js +1 -1
- package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
- package/src/sap/m/OverflowToolbarButton.js +1 -1
- package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
- package/src/sap/m/OverflowToolbarMenuButton.js +1 -1
- package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/P13nAnyFilterItem.js +1 -1
- package/src/sap/m/P13nColumnsItem.js +1 -1
- package/src/sap/m/P13nColumnsPanel.js +1 -1
- package/src/sap/m/P13nConditionPanel.js +1 -1
- package/src/sap/m/P13nDialog.js +1 -1
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +1 -1
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +1 -1
- package/src/sap/m/P13nGroupItem.js +1 -1
- package/src/sap/m/P13nGroupPanel.js +1 -1
- package/src/sap/m/P13nItem.js +1 -1
- package/src/sap/m/P13nPanel.js +1 -1
- package/src/sap/m/P13nSelectionItem.js +1 -1
- package/src/sap/m/P13nSelectionPanel.js +1 -1
- package/src/sap/m/P13nSortItem.js +1 -1
- package/src/sap/m/P13nSortPanel.js +1 -1
- package/src/sap/m/PDFViewer.js +1 -1
- package/src/sap/m/Page.js +6 -33
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PageRenderer.js +3 -1
- package/src/sap/m/PagingButton.js +1 -1
- package/src/sap/m/Panel.js +1 -1
- package/src/sap/m/PlanningCalendar.js +12 -8
- package/src/sap/m/PlanningCalendarHeader.js +1 -1
- package/src/sap/m/PlanningCalendarLegend.js +1 -1
- package/src/sap/m/PlanningCalendarRow.js +1 -1
- package/src/sap/m/PlanningCalendarView.js +1 -1
- package/src/sap/m/Popover.js +8 -1
- package/src/sap/m/PopoverRenderer.js +1 -1
- package/src/sap/m/ProgressIndicator.js +2 -4
- package/src/sap/m/PullToRefresh.js +1 -1
- package/src/sap/m/QuickView.js +1 -1
- package/src/sap/m/QuickViewBase.js +1 -1
- package/src/sap/m/QuickViewCard.js +1 -1
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +1 -1
- package/src/sap/m/RadioButton.js +1 -1
- package/src/sap/m/RadioButtonGroup.js +1 -1
- package/src/sap/m/RangeSlider.js +1 -1
- package/src/sap/m/RatingIndicator.js +1 -1
- package/src/sap/m/ResponsivePopover.js +1 -1
- package/src/sap/m/ResponsiveScale.js +1 -1
- package/src/sap/m/ScrollBar.js +1 -1
- package/src/sap/m/ScrollContainer.js +1 -1
- package/src/sap/m/SearchField.js +1 -1
- package/src/sap/m/SegmentedButton.js +1 -1
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +1 -1
- package/src/sap/m/SelectDialog.js +1 -1
- package/src/sap/m/SelectDialogBase.js +1 -1
- package/src/sap/m/SelectList.js +1 -1
- package/src/sap/m/SelectionDetails.js +1 -1
- package/src/sap/m/SelectionDetailsFacade.js +2 -2
- package/src/sap/m/SelectionDetailsItem.js +1 -1
- package/src/sap/m/SelectionDetailsItemLine.js +1 -1
- package/src/sap/m/Shell.js +1 -1
- package/src/sap/m/SimpleFixFlex.js +1 -1
- package/src/sap/m/SinglePlanningCalendar.js +14 -3
- package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarGrid.js +19 -1
- package/src/sap/m/SinglePlanningCalendarGridRenderer.js +17 -16
- package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
- package/src/sap/m/SlideTile.js +1 -1
- package/src/sap/m/Slider.js +1 -1
- package/src/sap/m/SliderTooltip.js +1 -1
- package/src/sap/m/SliderTooltipBase.js +1 -1
- package/src/sap/m/SliderTooltipContainer.js +1 -1
- package/src/sap/m/SplitApp.js +6 -2
- package/src/sap/m/SplitButton.js +1 -1
- package/src/sap/m/SplitContainer.js +1 -1
- package/src/sap/m/StandardDynamicDateOption.js +1 -1
- package/src/sap/m/StandardListItem.js +1 -1
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +6 -1
- package/src/sap/m/Suggest.js +3 -1
- package/src/sap/m/SuggestionItem.js +1 -1
- package/src/sap/m/SuggestionsPopover.js +1 -1
- package/src/sap/m/Switch.js +19 -3
- package/src/sap/m/TabContainer.js +1 -1
- package/src/sap/m/TabContainerItem.js +1 -1
- package/src/sap/m/TabStrip.js +9 -3
- package/src/sap/m/TabStripItem.js +1 -1
- package/src/sap/m/Table.js +21 -27
- package/src/sap/m/TablePersoController.js +1 -1
- package/src/sap/m/TablePersoDialog.js +1 -1
- package/src/sap/m/TablePersoProvider.js +1 -1
- package/src/sap/m/TableRenderer.js +11 -3
- package/src/sap/m/TableSelectDialog.js +1 -1
- package/src/sap/m/Text.js +1 -1
- package/src/sap/m/TextArea.js +1 -1
- package/src/sap/m/Tile.js +1 -1
- package/src/sap/m/TileContainer.js +1 -1
- package/src/sap/m/TileContent.js +1 -1
- package/src/sap/m/TileInfo.js +1 -1
- package/src/sap/m/TileRenderer.js +2 -2
- package/src/sap/m/TimePicker.js +1 -1
- package/src/sap/m/TimePickerClock.js +1 -1
- package/src/sap/m/TimePickerClocks.js +1 -1
- package/src/sap/m/TimePickerInputs.js +1 -1
- package/src/sap/m/TimePickerInternals.js +1 -1
- package/src/sap/m/TimePickerSlider.js +1 -1
- package/src/sap/m/TimePickerSliders.js +1 -1
- package/src/sap/m/Title.js +1 -1
- package/src/sap/m/TitlePropagationSupport.js +1 -1
- package/src/sap/m/ToggleButton.js +1 -1
- package/src/sap/m/Token.js +1 -1
- package/src/sap/m/Tokenizer.js +36 -1
- package/src/sap/m/TokenizerRenderer.js +2 -2
- package/src/sap/m/Toolbar.js +1 -1
- package/src/sap/m/ToolbarLayoutData.js +1 -1
- package/src/sap/m/ToolbarSeparator.js +1 -1
- package/src/sap/m/ToolbarSpacer.js +1 -1
- package/src/sap/m/Tree.js +1 -1
- package/src/sap/m/TreeItemBase.js +1 -1
- package/src/sap/m/UploadCollection.js +1 -1
- package/src/sap/m/UploadCollectionItem.js +1 -1
- package/src/sap/m/UploadCollectionParameter.js +1 -1
- package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
- package/src/sap/m/VBox.js +1 -1
- package/src/sap/m/ValueStateHeader.js +1 -1
- package/src/sap/m/VariantManagement.js +1 -1
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +17 -3
- package/src/sap/m/ViewSettingsFilterItem.js +1 -1
- package/src/sap/m/ViewSettingsItem.js +1 -1
- package/src/sap/m/VisibleItem.js +1 -1
- package/src/sap/m/WheelSlider.js +1 -1
- package/src/sap/m/WheelSliderContainer.js +1 -1
- package/src/sap/m/Wizard.js +17 -1
- package/src/sap/m/WizardProgressNavigator.js +1 -1
- package/src/sap/m/WizardStep.js +9 -6
- package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
- package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
- package/src/sap/m/changeHandler/CombineButtons.js +1 -1
- package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
- package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
- package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
- package/src/sap/m/designtime/ListItemBase.designtime.js +5 -0
- package/src/sap/m/designtime/messagebundle_de.properties +4 -4
- package/src/sap/m/i18n/interaction_ar.xml +175 -0
- package/src/sap/m/i18n/interaction_bg.xml +175 -0
- package/src/sap/m/i18n/interaction_ca.xml +175 -0
- package/src/sap/m/i18n/interaction_cnr.xml +175 -0
- package/src/sap/m/i18n/interaction_cs.xml +175 -0
- package/src/sap/m/i18n/interaction_cy.xml +175 -0
- package/src/sap/m/i18n/interaction_da.xml +175 -0
- package/src/sap/m/i18n/interaction_de.xml +175 -0
- package/src/sap/m/i18n/interaction_el.xml +175 -0
- package/src/sap/m/i18n/interaction_en.xml +175 -0
- package/src/sap/m/i18n/interaction_en_GB.xml +175 -0
- package/src/sap/m/i18n/interaction_en_US_saprigi.xml +175 -0
- package/src/sap/m/i18n/interaction_es.xml +175 -0
- package/src/sap/m/i18n/interaction_es_MX.xml +175 -0
- package/src/sap/m/i18n/interaction_et.xml +175 -0
- package/src/sap/m/i18n/interaction_fi.xml +175 -0
- package/src/sap/m/i18n/interaction_fr.xml +175 -0
- package/src/sap/m/i18n/interaction_fr_CA.xml +175 -0
- package/src/sap/m/i18n/interaction_hi.xml +175 -0
- package/src/sap/m/i18n/interaction_hr.xml +175 -0
- package/src/sap/m/i18n/interaction_hu.xml +175 -0
- package/src/sap/m/i18n/interaction_id.xml +175 -0
- package/src/sap/m/i18n/interaction_it.xml +175 -0
- package/src/sap/m/i18n/interaction_iw.xml +175 -0
- package/src/sap/m/i18n/interaction_ja.xml +175 -0
- package/src/sap/m/i18n/interaction_kk.xml +175 -0
- package/src/sap/m/i18n/interaction_ko.xml +175 -0
- package/src/sap/m/i18n/interaction_lt.xml +175 -0
- package/src/sap/m/i18n/interaction_lv.xml +175 -0
- package/src/sap/m/i18n/interaction_mk.xml +175 -0
- package/src/sap/m/i18n/interaction_ms.xml +175 -0
- package/src/sap/m/i18n/interaction_nl.xml +175 -0
- package/src/sap/m/i18n/interaction_no.xml +175 -0
- package/src/sap/m/i18n/interaction_pl.xml +175 -0
- package/src/sap/m/i18n/interaction_pt.xml +175 -0
- package/src/sap/m/i18n/interaction_pt_PT.xml +175 -0
- package/src/sap/m/i18n/interaction_ro.xml +175 -0
- package/src/sap/m/i18n/interaction_ru.xml +175 -0
- package/src/sap/m/i18n/interaction_sh.xml +175 -0
- package/src/sap/m/i18n/interaction_sk.xml +175 -0
- package/src/sap/m/i18n/interaction_sl.xml +175 -0
- package/src/sap/m/i18n/interaction_sr.xml +175 -0
- package/src/sap/m/i18n/interaction_sv.xml +175 -0
- package/src/sap/m/i18n/interaction_th.xml +175 -0
- package/src/sap/m/i18n/interaction_tr.xml +175 -0
- package/src/sap/m/i18n/interaction_uk.xml +175 -0
- package/src/sap/m/i18n/interaction_vi.xml +175 -0
- package/src/sap/m/i18n/interaction_zh_CN.xml +175 -0
- package/src/sap/m/i18n/interaction_zh_TW.xml +175 -0
- package/src/sap/m/library.js +84 -8
- package/src/sap/m/messagebundle.properties +47 -14
- package/src/sap/m/messagebundle_ar.properties +52 -18
- package/src/sap/m/messagebundle_bg.properties +45 -11
- package/src/sap/m/messagebundle_ca.properties +49 -15
- package/src/sap/m/messagebundle_cnr.properties +48 -14
- package/src/sap/m/messagebundle_cs.properties +46 -12
- package/src/sap/m/messagebundle_cy.properties +43 -9
- package/src/sap/m/messagebundle_da.properties +45 -11
- package/src/sap/m/messagebundle_de.properties +48 -14
- package/src/sap/m/messagebundle_el.properties +48 -14
- package/src/sap/m/messagebundle_en.properties +50 -16
- package/src/sap/m/messagebundle_en_GB.properties +52 -18
- package/src/sap/m/messagebundle_en_US_saprigi.properties +57 -15
- package/src/sap/m/messagebundle_es.properties +114 -80
- package/src/sap/m/messagebundle_es_MX.properties +51 -17
- package/src/sap/m/messagebundle_et.properties +43 -9
- package/src/sap/m/messagebundle_fi.properties +44 -10
- package/src/sap/m/messagebundle_fr.properties +52 -18
- package/src/sap/m/messagebundle_fr_CA.properties +47 -13
- package/src/sap/m/messagebundle_hi.properties +47 -13
- package/src/sap/m/messagebundle_hr.properties +46 -12
- package/src/sap/m/messagebundle_hu.properties +46 -12
- package/src/sap/m/messagebundle_id.properties +75 -41
- package/src/sap/m/messagebundle_it.properties +52 -18
- package/src/sap/m/messagebundle_iw.properties +47 -13
- package/src/sap/m/messagebundle_ja.properties +45 -11
- package/src/sap/m/messagebundle_kk.properties +47 -13
- package/src/sap/m/messagebundle_ko.properties +47 -13
- package/src/sap/m/messagebundle_lt.properties +46 -12
- package/src/sap/m/messagebundle_lv.properties +50 -16
- package/src/sap/m/messagebundle_mk.properties +46 -12
- package/src/sap/m/messagebundle_ms.properties +49 -15
- package/src/sap/m/messagebundle_nl.properties +47 -13
- package/src/sap/m/messagebundle_no.properties +47 -13
- package/src/sap/m/messagebundle_pl.properties +50 -16
- package/src/sap/m/messagebundle_pt.properties +49 -15
- package/src/sap/m/messagebundle_pt_PT.properties +47 -13
- package/src/sap/m/messagebundle_ro.properties +47 -13
- package/src/sap/m/messagebundle_ru.properties +48 -14
- package/src/sap/m/messagebundle_sh.properties +48 -14
- package/src/sap/m/messagebundle_sk.properties +46 -12
- package/src/sap/m/messagebundle_sl.properties +49 -15
- package/src/sap/m/messagebundle_sr.properties +48 -14
- package/src/sap/m/messagebundle_sv.properties +46 -12
- package/src/sap/m/messagebundle_th.properties +47 -13
- package/src/sap/m/messagebundle_tr.properties +46 -12
- package/src/sap/m/messagebundle_uk.properties +50 -16
- package/src/sap/m/messagebundle_vi.properties +49 -15
- package/src/sap/m/messagebundle_zh_CN.properties +47 -13
- package/src/sap/m/messagebundle_zh_TW.properties +49 -15
- package/src/sap/m/p13n/AbstractContainer.js +2 -2
- package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
- package/src/sap/m/p13n/BasePanel.js +1 -1
- package/src/sap/m/p13n/Container.js +1 -1
- package/src/sap/m/p13n/Engine.js +7 -5
- package/src/sap/m/p13n/FilterController.js +1 -1
- package/src/sap/m/p13n/FilterPanel.js +1 -1
- package/src/sap/m/p13n/GroupController.js +1 -1
- package/src/sap/m/p13n/GroupPanel.js +1 -1
- package/src/sap/m/p13n/MessageStrip.js +1 -1
- package/src/sap/m/p13n/Popup.js +3 -1
- package/src/sap/m/p13n/QueryPanel.js +10 -6
- package/src/sap/m/p13n/SelectionController.js +1 -1
- package/src/sap/m/p13n/SelectionPanel.js +32 -41
- package/src/sap/m/p13n/SortController.js +1 -1
- package/src/sap/m/p13n/SortPanel.js +1 -1
- package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +3 -4
- package/src/sap/m/p13n/modules/StateHandlerRegistry.js +7 -5
- package/src/sap/m/p13n/modules/UIManager.js +1 -1
- package/src/sap/m/plugins/CellSelector.js +4 -3
- package/src/sap/m/plugins/ColumnAIAction.js +1 -1
- package/src/sap/m/plugins/ColumnResizer.js +28 -4
- package/src/sap/m/plugins/ContextMenuSetting.js +1 -1
- package/src/sap/m/plugins/CopyProvider.js +1 -1
- package/src/sap/m/plugins/DataStateIndicator.js +1 -1
- package/src/sap/m/plugins/PasteProvider.js +1 -1
- package/src/sap/m/plugins/PluginBase.js +1 -1
- package/src/sap/m/plugins/UploadSetwithTable.js +25 -17
- package/src/sap/m/routing/Target.js +52 -8
- package/src/sap/m/routing/Targets.js +58 -11
- package/src/sap/m/semantic/AddAction.js +1 -1
- package/src/sap/m/semantic/CancelAction.js +1 -1
- package/src/sap/m/semantic/DeleteAction.js +1 -1
- package/src/sap/m/semantic/DetailPage.js +1 -1
- package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/m/semantic/EditAction.js +1 -1
- package/src/sap/m/semantic/FavoriteAction.js +1 -1
- package/src/sap/m/semantic/FilterAction.js +1 -1
- package/src/sap/m/semantic/FilterSelect.js +1 -1
- package/src/sap/m/semantic/FlagAction.js +1 -1
- package/src/sap/m/semantic/ForwardAction.js +1 -1
- package/src/sap/m/semantic/FullscreenPage.js +1 -1
- package/src/sap/m/semantic/GroupAction.js +1 -1
- package/src/sap/m/semantic/GroupSelect.js +1 -1
- package/src/sap/m/semantic/MainAction.js +1 -1
- package/src/sap/m/semantic/MasterPage.js +1 -1
- package/src/sap/m/semantic/MessagesIndicator.js +1 -1
- package/src/sap/m/semantic/MultiSelectAction.js +1 -1
- package/src/sap/m/semantic/NegativeAction.js +1 -1
- package/src/sap/m/semantic/OpenInAction.js +1 -1
- package/src/sap/m/semantic/PositiveAction.js +1 -1
- package/src/sap/m/semantic/PrintAction.js +1 -1
- package/src/sap/m/semantic/SaveAction.js +1 -1
- package/src/sap/m/semantic/Segment.js +1 -1
- package/src/sap/m/semantic/SegmentedContainer.js +1 -1
- package/src/sap/m/semantic/SemanticButton.js +1 -1
- package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
- package/src/sap/m/semantic/SemanticControl.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/semantic/SemanticPage.js +1 -1
- package/src/sap/m/semantic/SemanticSelect.js +1 -1
- package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/m/semantic/SendEmailAction.js +1 -1
- package/src/sap/m/semantic/SendMessageAction.js +1 -1
- package/src/sap/m/semantic/ShareInJamAction.js +1 -1
- package/src/sap/m/semantic/ShareMenu.js +1 -1
- package/src/sap/m/semantic/ShareMenuPage.js +1 -1
- package/src/sap/m/semantic/SortAction.js +1 -1
- package/src/sap/m/semantic/SortSelect.js +1 -1
- package/src/sap/m/table/ColumnWidthController.js +1 -1
- package/src/sap/m/table/Util.js +1 -1
- package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/Entry.js +1 -1
- package/src/sap/m/table/columnmenu/Item.js +1 -1
- package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
- package/src/sap/m/table/columnmenu/Menu.js +3 -3
- package/src/sap/m/table/columnmenu/MenuBase.js +1 -1
- package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickResize.js +142 -0
- package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
- package/src/sap/m/themes/base/Button.less +36 -13
- package/src/sap/m/themes/base/ColumnListItem.less +11 -0
- package/src/sap/m/themes/base/DynamicDateRange.less +6 -2
- package/src/sap/m/themes/base/IconTabBar.less +1 -0
- package/src/sap/m/themes/base/Link.less +1 -0
- package/src/sap/m/themes/base/ListBase.less +1 -0
- package/src/sap/m/themes/base/ListItemBase.less +22 -10
- package/src/sap/m/themes/base/Menu.less +329 -12
- package/src/sap/m/themes/base/Page.less +5 -4
- package/src/sap/m/themes/base/Panel.less +7 -2
- package/src/sap/m/themes/base/PlanningCalendar.less +37 -0
- package/src/sap/m/themes/base/RatingIndicator.less +7 -2
- package/src/sap/m/themes/base/Table.less +42 -11
- package/src/sap/m/themes/base/Wizard.less +14 -43
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-BeforeSearch.svg +2 -2
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoEntries.svg +2 -2
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-SignOut.svg +10 -17
- package/src/sap/m/upload/ActionsPlaceholder.js +1 -1
- package/src/sap/m/upload/Column.js +1 -1
- package/src/sap/m/upload/FilePreviewDialog.js +1 -1
- package/src/sap/m/upload/UploadItem.js +1 -1
- package/src/sap/m/upload/UploadItemConfiguration.js +1 -1
- package/src/sap/m/upload/UploadSet.js +1 -1
- package/src/sap/m/upload/UploadSetItem.js +1 -1
- package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
- package/src/sap/m/upload/Uploader.js +2 -2
- package/src/sap/m/upload/UploaderHttpRequestMethod.js +2 -2
- package/src/sap/m/upload/UploaderTableItem.js +3 -3
- package/src/sap/m/routing/async/Target.js +0 -60
- 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
|
-
'
|
|
9
|
+
'sap/m/library',
|
|
10
10
|
'sap/ui/core/library',
|
|
11
11
|
'sap/ui/core/Control',
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
List,
|
|
38
|
-
Page,
|
|
39
|
-
MenuListItem,
|
|
31
|
+
Bar,
|
|
32
|
+
Title,
|
|
40
33
|
MenuItem,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
UfdMenuItem,
|
|
44
|
-
UfdMenuItemGroup,
|
|
34
|
+
MenuWrapper,
|
|
35
|
+
Lib,
|
|
45
36
|
Device,
|
|
37
|
+
InvisibleText,
|
|
46
38
|
EnabledPropagator,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ManagedObject,
|
|
50
|
-
Element
|
|
39
|
+
Localization,
|
|
40
|
+
Log
|
|
51
41
|
) {
|
|
52
42
|
"use strict";
|
|
53
43
|
|
|
54
|
-
//
|
|
55
|
-
|
|
44
|
+
// Shortcut for sap.m.PlacementType
|
|
45
|
+
const PlacementType = library.PlacementType;
|
|
56
46
|
|
|
57
|
-
//
|
|
58
|
-
|
|
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.
|
|
64
|
+
* @version 1.138.0
|
|
87
65
|
*
|
|
88
66
|
* @constructor
|
|
89
67
|
* @public
|
|
90
68
|
* @alias sap.m.Menu
|
|
91
69
|
*/
|
|
92
|
-
|
|
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
|
|
91
|
+
* Internal Menu Wrapper control
|
|
113
92
|
*/
|
|
114
|
-
|
|
93
|
+
_menuWrapper: { type: "sap.m.MenuWrapper", multiple: false, visibility: "hidden" },
|
|
115
94
|
|
|
116
95
|
/**
|
|
117
|
-
* Internal aggregation that contains the inner <code>sap.
|
|
96
|
+
* Internal aggregation that contains the inner <code>sap.m.ResponsivePopover</code> for mobile.
|
|
118
97
|
*/
|
|
119
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
193
|
-
this.
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
206
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
222
|
-
|
|
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
|
-
|
|
184
|
+
const oPopover = this._getPopover(),
|
|
185
|
+
oMenuWrapper = this._getMenuWrapper(),
|
|
186
|
+
oHeader = oPopover.getCustomHeader();
|
|
239
187
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
* @
|
|
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
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
*
|
|
298
|
-
*
|
|
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.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
*
|
|
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.
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
*
|
|
332
|
-
*
|
|
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.
|
|
336
|
-
|
|
260
|
+
Menu.prototype._refreshSubmenusToClose = function() {
|
|
261
|
+
this._aSubmenusToClose = this._aSubmenusToClose.filter((oItem) => oItem._getPopover().isOpen());
|
|
337
262
|
};
|
|
338
263
|
|
|
339
264
|
/**
|
|
340
|
-
*
|
|
265
|
+
* Closes the submenus of the <code>Menu</code> that are still open.
|
|
266
|
+
*
|
|
341
267
|
* @private
|
|
342
268
|
*/
|
|
343
|
-
Menu.prototype.
|
|
344
|
-
|
|
345
|
-
this.
|
|
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
|
-
*
|
|
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
|
-
* @
|
|
364
|
-
* @
|
|
365
|
-
* @ui5-restricted ObjectPageLayoutABHelper
|
|
366
|
-
* @returns {void}
|
|
278
|
+
* @returns {boolean} true if menu is open
|
|
279
|
+
* @public
|
|
367
280
|
*/
|
|
368
|
-
Menu.prototype.
|
|
369
|
-
this.
|
|
281
|
+
Menu.prototype.isOpen = function() {
|
|
282
|
+
return this._getPopover().isOpen();
|
|
370
283
|
};
|
|
371
284
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
//
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
392
|
-
|
|
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
|
-
}
|
|
335
|
+
}
|
|
398
336
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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
|
-
|
|
407
|
-
|
|
342
|
+
// create a new pointer element
|
|
343
|
+
oPointerElement = document.createElement("div");
|
|
344
|
+
oPointerElement.id = "sapMMenuContextMenuPointer";
|
|
345
|
+
oPointerElement.className = "sapMMenuContextMenuPointer";
|
|
408
346
|
|
|
409
|
-
|
|
410
|
-
if (!this.fireBeforeClose()) {
|
|
411
|
-
oEvent.preventDefault();
|
|
412
|
-
}
|
|
413
|
-
};
|
|
347
|
+
const oOpenerData = oOpenerDomRef ? oOpenerDomRef.getBoundingClientRect() : null;
|
|
414
348
|
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
420
|
-
|
|
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
|
-
|
|
424
|
-
|
|
361
|
+
iX = (iPageX - oOpenerData.left - window.scrollX);
|
|
362
|
+
iY = (iPageY - oOpenerData.top - window.scrollY);
|
|
425
363
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
});
|
|
430
|
-
};
|
|
364
|
+
if (Localization.getRTL()) {
|
|
365
|
+
iX = document.body.clientWidth - iX;
|
|
366
|
+
}
|
|
431
367
|
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
*
|
|
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.
|
|
448
|
-
|
|
449
|
-
|
|
387
|
+
Menu.prototype._onContextMenuClose = function() {
|
|
388
|
+
const oPointerElement = document.getElementById("sapMMenuContextMenuPointer"),
|
|
389
|
+
oPopover = this._getPopover();
|
|
450
390
|
|
|
451
|
-
|
|
452
|
-
|
|
391
|
+
oPointerElement && oPointerElement.remove();
|
|
392
|
+
oPopover.detachAfterClose(this._onContextMenuClose, this);
|
|
453
393
|
};
|
|
454
394
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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
|
-
|
|
487
|
-
};
|
|
406
|
+
this._getMenuWrapper()._processStyleClasses(sClass, sMethodName);
|
|
488
407
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
};
|
|
413
|
+
return this;
|
|
414
|
+
};
|
|
415
|
+
});
|
|
508
416
|
|
|
509
417
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
* @
|
|
513
|
-
*
|
|
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.
|
|
516
|
-
|
|
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
|
-
*
|
|
527
|
-
*
|
|
528
|
-
* @
|
|
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.
|
|
532
|
-
|
|
533
|
-
};
|
|
436
|
+
Menu.prototype._collectSubmenusToClose = function(oEvent) {
|
|
437
|
+
const oItem = oEvent.getParameter("item");
|
|
534
438
|
|
|
535
|
-
|
|
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
|
|
541
|
-
|
|
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
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
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
|
-
|
|
662
|
-
|
|
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
|
-
|
|
681
|
-
oItem._setVisualControl(oMenuListItem);
|
|
464
|
+
this.fireClosed();
|
|
682
465
|
|
|
683
|
-
if (
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
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
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* @
|
|
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.
|
|
714
|
-
|
|
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.
|
|
490
|
+
* @returns {sap.m.MenuItem} List of all menu items
|
|
751
491
|
* @private
|
|
752
492
|
*/
|
|
753
493
|
Menu.prototype._getItems = function() {
|
|
754
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
807
|
-
*
|
|
808
|
-
* @
|
|
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.
|
|
813
|
-
|
|
814
|
-
|
|
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
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
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 (
|
|
872
|
-
|
|
873
|
-
this._removeVisualItem(aItems[i]);
|
|
874
|
-
}
|
|
533
|
+
if (oPopover) {
|
|
534
|
+
return oPopover;
|
|
875
535
|
}
|
|
876
536
|
|
|
877
|
-
|
|
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
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
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
|
-
|
|
901
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
918
|
-
|
|
573
|
+
this._arrowOffset = 0;
|
|
574
|
+
this._offsets = ["0 0", "0 0", "0 0", "0 0"];
|
|
919
575
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
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
|
-
|
|
927
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
948
|
-
* @
|
|
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.
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
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
|
-
*
|
|
1002
|
-
* @
|
|
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.
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
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 (
|
|
1012
|
-
|
|
611
|
+
if (bIsSubmenu) {
|
|
612
|
+
oHeaderBar.addContentLeft(this._createBackButton());
|
|
1013
613
|
}
|
|
1014
614
|
|
|
1015
|
-
|
|
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
|
-
*
|
|
1027
|
-
* @
|
|
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.
|
|
1031
|
-
|
|
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
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
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
|
-
*
|
|
1096
|
-
* @returns {
|
|
634
|
+
* Gets the internal MenuWrapper control.
|
|
635
|
+
* @returns {sap.m.MenuWrapper} The internal _menuWrapper aggregation
|
|
636
|
+
* @private
|
|
1097
637
|
*/
|
|
1098
|
-
Menu.prototype.
|
|
1099
|
-
|
|
1100
|
-
|
|
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
|
-
*
|
|
1108
|
-
* @
|
|
1109
|
-
*
|
|
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.
|
|
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
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
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
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
}
|
|
660
|
+
if (bIsSubmenu) {
|
|
661
|
+
const bRTL = Localization.getRTL(),
|
|
662
|
+
sPlacement = bRTL ? PlacementType.HorizontalPreferredLeft : PlacementType.HorizontalPreferredRight;
|
|
1141
663
|
|
|
1142
|
-
return
|
|
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
|
-
*
|
|
1160
|
-
* @param {string} sValue property value to be checked
|
|
671
|
+
* Set extra content to the popover.
|
|
1161
672
|
* @private
|
|
1162
|
-
* @
|
|
673
|
+
* @param {HTMLElement} oDomRef the DOM ref to be added as extra content to the popover
|
|
1163
674
|
*/
|
|
1164
|
-
Menu.prototype.
|
|
1165
|
-
|
|
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;
|