@openui5/sap.m 1.120.6 → 1.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +23 -21
- package/THIRDPARTY.txt +6 -43
- package/package.json +4 -4
- package/src/sap/m/.library +18 -2
- package/src/sap/m/AccButton.js +1 -1
- package/src/sap/m/ActionListItem.js +1 -1
- package/src/sap/m/ActionSelect.js +11 -11
- package/src/sap/m/ActionSheet.js +12 -8
- package/src/sap/m/ActionSheetRenderer.js +4 -4
- package/src/sap/m/ActionTile.js +7 -1
- package/src/sap/m/ActionTileContent.js +86 -7
- package/src/sap/m/ActionTileContentRenderer.js +4 -41
- package/src/sap/m/AdditionalTextButton.js +1 -1
- package/src/sap/m/App.js +1 -1
- package/src/sap/m/AssociativeOverflowToolbar.js +6 -6
- package/src/sap/m/Avatar.js +32 -14
- package/src/sap/m/Bar.js +5 -5
- package/src/sap/m/BarRenderer.js +3 -3
- package/src/sap/m/Breadcrumbs.js +12 -4
- package/src/sap/m/BreadcrumbsRenderer.js +1 -1
- package/src/sap/m/BusyDialog.js +19 -33
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +8 -8
- package/src/sap/m/ButtonRenderer.js +0 -4
- package/src/sap/m/Carousel.js +53 -25
- package/src/sap/m/CarouselLayout.js +14 -3
- package/src/sap/m/CarouselRenderer.js +4 -4
- package/src/sap/m/CheckBox.js +46 -5
- package/src/sap/m/CheckBoxRenderer.js +10 -3
- package/src/sap/m/ColorPalette.js +4 -2
- package/src/sap/m/ColorPalettePopover.js +5 -3
- package/src/sap/m/ColorPaletteRenderer.js +3 -3
- package/src/sap/m/Column.js +3 -4
- package/src/sap/m/ColumnHeaderPopover.js +1 -1
- package/src/sap/m/ColumnListItem.js +59 -20
- package/src/sap/m/ColumnListItemRenderer.js +8 -9
- 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 +6 -6
- package/src/sap/m/ComboBox.js +16 -9
- package/src/sap/m/ComboBoxBase.js +10 -9
- package/src/sap/m/ComboBoxTextField.js +6 -4
- package/src/sap/m/ContentConfig.js +142 -0
- 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 +19 -18
- package/src/sap/m/DatePickerRenderer.js +3 -3
- package/src/sap/m/DateRangeSelection.js +16 -13
- package/src/sap/m/DateRangeSelectionRenderer.js +3 -3
- package/src/sap/m/DateTimeField.js +17 -9
- package/src/sap/m/DateTimeInput.js +6 -4
- package/src/sap/m/DateTimePicker.js +39 -30
- package/src/sap/m/DateTimePickerRenderer.js +4 -2
- package/src/sap/m/Dialog.js +21 -9
- package/src/sap/m/DialogRenderer.js +10 -3
- package/src/sap/m/DisplayListItem.js +1 -1
- package/src/sap/m/DraftIndicator.js +5 -5
- package/src/sap/m/DynamicDate.js +5 -3
- package/src/sap/m/DynamicDateFormat.js +7 -6
- package/src/sap/m/DynamicDateOption.js +10 -5
- package/src/sap/m/DynamicDateRange.js +56 -43
- package/src/sap/m/DynamicDateUtil.js +3 -3
- package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
- package/src/sap/m/ExpandableText.js +5 -9
- package/src/sap/m/ExpandableTextRenderer.js +3 -3
- package/src/sap/m/FacetFilter.js +17 -8
- package/src/sap/m/FacetFilterItem.js +1 -1
- package/src/sap/m/FacetFilterList.js +7 -7
- package/src/sap/m/FacetFilterRenderer.js +4 -4
- package/src/sap/m/FeedContent.js +1 -1
- package/src/sap/m/FeedInput.js +1 -1
- package/src/sap/m/FeedListItem.js +4 -4
- package/src/sap/m/FeedListItemAction.js +1 -1
- package/src/sap/m/FeedListItemRenderer.js +3 -3
- package/src/sap/m/Fiori20Adapter.js +9 -9
- package/src/sap/m/FlexBox.js +2 -2
- package/src/sap/m/FlexItemData.js +17 -17
- package/src/sap/m/FormattedText.js +7 -6
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTagRenderer.js +5 -5
- package/src/sap/m/GenericTile.js +102 -14
- package/src/sap/m/GenericTileLineModeRenderer.js +3 -3
- package/src/sap/m/GenericTileRenderer.js +3 -3
- package/src/sap/m/GroupHeaderListItem.js +1 -1
- package/src/sap/m/GroupHeaderListItemRenderer.js +3 -3
- package/src/sap/m/GrowingEnablement.js +7 -6
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +5 -5
- package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
- package/src/sap/m/IconTabBar.js +4 -4
- package/src/sap/m/IconTabBarDragAndDropUtil.js +5 -5
- package/src/sap/m/IconTabBarSelectList.js +2 -2
- package/src/sap/m/IconTabFilter.js +27 -15
- package/src/sap/m/IconTabFilterExpandButtonBadge.js +4 -4
- package/src/sap/m/IconTabHeader.js +61 -28
- package/src/sap/m/IconTabHeaderRenderer.js +5 -5
- package/src/sap/m/IconTabSeparator.js +7 -7
- package/src/sap/m/IllustratedMessage.js +8 -6
- package/src/sap/m/IllustratedMessageType.js +12 -0
- package/src/sap/m/Illustration.js +4 -4
- package/src/sap/m/IllustrationPool.js +3 -3
- package/src/sap/m/Image.js +6 -3
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +65 -36
- package/src/sap/m/InputBase.js +33 -8
- package/src/sap/m/InputBaseRenderer.js +3 -3
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/InputRenderer.js +5 -6
- package/src/sap/m/Label.js +6 -6
- package/src/sap/m/LightBox.js +4 -4
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +30 -6
- package/src/sap/m/LinkRenderer.js +4 -4
- package/src/sap/m/LinkTileContent.js +1 -1
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +43 -24
- package/src/sap/m/ListItemBase.js +7 -6
- package/src/sap/m/ListItemBaseRenderer.js +3 -0
- package/src/sap/m/MaskEnabler.js +8 -6
- package/src/sap/m/MaskInput.js +1 -1
- package/src/sap/m/MaskInputRenderer.js +2 -2
- package/src/sap/m/MaskInputRule.js +1 -1
- package/src/sap/m/Menu.js +19 -17
- package/src/sap/m/MenuButton.js +8 -6
- package/src/sap/m/MenuItem.js +9 -9
- package/src/sap/m/MenuListItem.js +5 -4
- package/src/sap/m/MessageBox.js +5 -3
- package/src/sap/m/MessageItem.js +1 -1
- package/src/sap/m/MessageListItem.js +4 -3
- package/src/sap/m/MessagePage.js +4 -2
- package/src/sap/m/MessagePopover.js +9 -6
- package/src/sap/m/MessagePopoverItem.js +1 -1
- package/src/sap/m/MessageStrip.js +9 -7
- package/src/sap/m/MessageStripRenderer.js +5 -2
- package/src/sap/m/MessageStripUtilities.js +6 -4
- package/src/sap/m/MessageToast.js +8 -7
- package/src/sap/m/MessageView.js +29 -6
- package/src/sap/m/MessageViewRenderer.js +2 -2
- package/src/sap/m/MultiComboBox.js +36 -17
- package/src/sap/m/MultiComboBoxRenderer.js +4 -4
- package/src/sap/m/MultiEditField.js +4 -4
- package/src/sap/m/MultiInput.js +66 -19
- package/src/sap/m/MultiInputRenderer.js +3 -3
- package/src/sap/m/NavContainer.js +14 -9
- package/src/sap/m/NewsContent.js +1 -1
- package/src/sap/m/NotificationList.js +1 -1
- package/src/sap/m/NotificationListBase.js +4 -4
- package/src/sap/m/NotificationListGroup.js +4 -4
- package/src/sap/m/NotificationListItem.js +4 -4
- package/src/sap/m/NumericContent.js +6 -6
- package/src/sap/m/NumericInput.js +1 -1
- package/src/sap/m/NumericInputRenderer.js +6 -6
- package/src/sap/m/ObjectAttribute.js +7 -6
- package/src/sap/m/ObjectAttributeRenderer.js +3 -3
- package/src/sap/m/ObjectHeader.js +15 -11
- package/src/sap/m/ObjectHeaderRenderer.js +4 -4
- package/src/sap/m/ObjectIdentifier.js +37 -8
- package/src/sap/m/ObjectIdentifierRenderer.js +3 -3
- package/src/sap/m/ObjectListItem.js +4 -4
- package/src/sap/m/ObjectMarker.js +6 -4
- package/src/sap/m/ObjectNumber.js +4 -3
- package/src/sap/m/ObjectNumberRenderer.js +6 -6
- package/src/sap/m/ObjectStatus.js +28 -22
- package/src/sap/m/ObjectStatusRenderer.js +26 -20
- package/src/sap/m/OverflowToolbar.js +2 -2
- package/src/sap/m/OverflowToolbarAssociativePopover.js +3 -3
- package/src/sap/m/OverflowToolbarButton.js +1 -1
- package/src/sap/m/OverflowToolbarLayoutData.js +2 -2
- 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 +33 -11
- package/src/sap/m/P13nConditionPanel.js +6 -4
- package/src/sap/m/P13nDialog.js +27 -13
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +18 -12
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +71 -49
- package/src/sap/m/P13nGroupItem.js +1 -1
- package/src/sap/m/P13nGroupPanel.js +5 -4
- 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 +28 -7
- package/src/sap/m/P13nSortItem.js +1 -1
- package/src/sap/m/P13nSortPanel.js +6 -5
- package/src/sap/m/PDFViewer.js +3 -6
- package/src/sap/m/Page.js +4 -8
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PagingButton.js +5 -4
- package/src/sap/m/Panel.js +10 -5
- package/src/sap/m/PlanningCalendar.js +160 -109
- package/src/sap/m/PlanningCalendarHeader.js +9 -7
- package/src/sap/m/PlanningCalendarLegend.js +5 -5
- package/src/sap/m/PlanningCalendarRow.js +26 -15
- package/src/sap/m/PlanningCalendarView.js +1 -4
- package/src/sap/m/Popover.js +19 -21
- package/src/sap/m/PopoverRenderer.js +4 -4
- package/src/sap/m/ProgressIndicator.js +15 -13
- package/src/sap/m/ProgressIndicatorRenderer.js +3 -4
- package/src/sap/m/PullToRefresh.js +4 -3
- 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/QuickViewCardRenderer.js +3 -3
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +29 -17
- package/src/sap/m/RadioButton.js +4 -4
- package/src/sap/m/RadioButtonGroup.js +38 -5
- package/src/sap/m/RadioButtonGroupRenderer.js +4 -4
- package/src/sap/m/RadioButtonRenderer.js +3 -3
- package/src/sap/m/RangeSlider.js +9 -7
- package/src/sap/m/RangeSliderRenderer.js +2 -2
- package/src/sap/m/RatingIndicator.js +7 -6
- package/src/sap/m/RatingIndicatorRenderer.js +4 -4
- package/src/sap/m/ResponsivePopover.js +1 -3
- package/src/sap/m/ResponsiveScale.js +1 -1
- package/src/sap/m/ScrollBar.js +3 -3
- package/src/sap/m/ScrollContainer.js +6 -6
- package/src/sap/m/SearchField.js +1 -1
- package/src/sap/m/SegmentedButton.js +7 -5
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +30 -16
- package/src/sap/m/SelectDialog.js +5 -3
- package/src/sap/m/SelectDialogBase.js +6 -6
- package/src/sap/m/SelectList.js +6 -6
- package/src/sap/m/SelectionDetails.js +7 -3
- 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 +4 -4
- package/src/sap/m/ShellRenderer.js +3 -2
- package/src/sap/m/SimpleFixFlex.js +1 -1
- package/src/sap/m/SinglePlanningCalendar.js +41 -9
- package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarGrid.js +122 -54
- package/src/sap/m/SinglePlanningCalendarGridRenderer.js +22 -20
- package/src/sap/m/SinglePlanningCalendarMonthGrid.js +315 -61
- package/src/sap/m/SinglePlanningCalendarMonthGridRenderer.js +88 -35
- package/src/sap/m/SinglePlanningCalendarMonthView.js +3 -4
- package/src/sap/m/SinglePlanningCalendarView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWeekView.js +5 -5
- package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +6 -5
- package/src/sap/m/SlideTile.js +6 -6
- package/src/sap/m/SlideTileRenderer.js +1 -3
- package/src/sap/m/Slider.js +38 -11
- package/src/sap/m/SliderRenderer.js +4 -4
- package/src/sap/m/SliderTooltip.js +4 -4
- package/src/sap/m/SliderTooltipBase.js +1 -1
- package/src/sap/m/SliderTooltipContainer.js +10 -8
- package/src/sap/m/SliderTooltipRenderer.js +3 -3
- package/src/sap/m/SplitApp.js +2 -1
- package/src/sap/m/SplitButton.js +5 -3
- package/src/sap/m/SplitContainer.js +20 -11
- package/src/sap/m/StandardDynamicDateOption.js +16 -12
- package/src/sap/m/StandardListItem.js +4 -3
- package/src/sap/m/StandardListItemRenderer.js +3 -3
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +6 -4
- package/src/sap/m/Suggest.js +5 -5
- package/src/sap/m/SuggestionItem.js +1 -1
- package/src/sap/m/SuggestionsList.js +9 -7
- package/src/sap/m/SuggestionsListRenderer.js +2 -2
- package/src/sap/m/SuggestionsPopover.js +1 -1
- package/src/sap/m/Switch.js +13 -11
- package/src/sap/m/SwitchRenderer.js +3 -3
- package/src/sap/m/TabContainer.js +9 -6
- package/src/sap/m/TabContainerItem.js +5 -8
- package/src/sap/m/TabStrip.js +23 -12
- package/src/sap/m/TabStripItem.js +7 -10
- package/src/sap/m/TabStripRenderer.js +2 -2
- package/src/sap/m/Table.js +4 -5
- package/src/sap/m/TablePersoController.js +10 -8
- package/src/sap/m/TablePersoDialog.js +19 -16
- package/src/sap/m/TablePersoProvider.js +1 -1
- package/src/sap/m/TableRenderer.js +4 -4
- package/src/sap/m/TableSelectDialog.js +5 -3
- package/src/sap/m/Text.js +36 -39
- package/src/sap/m/TextArea.js +5 -3
- package/src/sap/m/TextRenderer.js +2 -7
- package/src/sap/m/Tile.js +1 -1
- package/src/sap/m/TileAttribute.js +64 -0
- package/src/sap/m/TileAttributeRenderer.js +70 -0
- package/src/sap/m/TileContainer.js +10 -8
- package/src/sap/m/TileContent.js +8 -4
- package/src/sap/m/TileRenderer.js +3 -3
- package/src/sap/m/TimePicker.js +24 -19
- package/src/sap/m/TimePickerClock.js +4 -3
- package/src/sap/m/TimePickerClocks.js +1 -1
- package/src/sap/m/TimePickerInputs.js +1 -1
- package/src/sap/m/TimePickerInternals.js +12 -10
- package/src/sap/m/TimePickerSlider.js +9 -7
- package/src/sap/m/TimePickerSliders.js +17 -13
- package/src/sap/m/TimePickerSlidersRenderer.js +3 -3
- package/src/sap/m/Title.js +5 -4
- package/src/sap/m/TitlePropagationSupport.js +4 -4
- package/src/sap/m/ToggleButton.js +4 -3
- package/src/sap/m/Token.js +6 -6
- package/src/sap/m/Tokenizer.js +16 -10
- package/src/sap/m/Toolbar.js +4 -4
- 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 +4 -2
- package/src/sap/m/TreeItemBase.js +4 -3
- package/src/sap/m/TreeItemBaseRenderer.js +3 -3
- package/src/sap/m/UploadCollection.js +28 -24
- 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 +5 -5
- package/src/sap/m/VariantItem.js +8 -3
- package/src/sap/m/VariantManagement.js +112 -33
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +34 -21
- package/src/sap/m/ViewSettingsFilterItem.js +1 -1
- package/src/sap/m/ViewSettingsItem.js +9 -2
- package/src/sap/m/VisibleItem.js +1 -1
- package/src/sap/m/WheelSlider.js +4 -3
- package/src/sap/m/WheelSliderContainer.js +1 -1
- package/src/sap/m/WheelSliderContainerRenderer.js +3 -3
- package/src/sap/m/Wizard.js +17 -15
- package/src/sap/m/WizardProgressNavigator.js +18 -2
- package/src/sap/m/WizardProgressNavigatorRenderer.js +9 -5
- package/src/sap/m/WizardRenderer.js +6 -4
- package/src/sap/m/WizardStep.js +9 -11
- package/src/sap/m/changeHandler/AddTableColumn.js +3 -7
- package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
- package/src/sap/m/changeHandler/CombineButtons.js +4 -4
- package/src/sap/m/changeHandler/MoveTableColumns.js +3 -2
- package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
- package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
- package/src/sap/m/delegate/ValueStateMessage.js +3 -3
- package/src/sap/m/designtime/IconTabBar.designtime.js +3 -2
- package/src/sap/m/designtime/Link.designtime.js +4 -4
- package/src/sap/m/designtime/MenuButton.designtime.js +3 -0
- package/src/sap/m/designtime/ObjectIdentifier.designtime.js +0 -4
- package/src/sap/m/designtime/messagebundle_en_US_saprigi.properties +91 -91
- package/src/sap/m/flexibility/EngineFlex.js +14 -8
- package/src/sap/m/flexibility/MenuButton.flexibility.js +1 -0
- package/src/sap/m/inputUtils/SuggestionsPopoverPopoverMixin.js +4 -4
- package/src/sap/m/library.js +181 -59
- package/src/sap/m/messagebundle.properties +113 -90
- package/src/sap/m/messagebundle_ar.properties +16 -10
- package/src/sap/m/messagebundle_bg.properties +19 -13
- package/src/sap/m/messagebundle_ca.properties +16 -10
- package/src/sap/m/messagebundle_cnr.properties +21 -15
- package/src/sap/m/messagebundle_cs.properties +16 -10
- package/src/sap/m/messagebundle_cy.properties +19 -13
- package/src/sap/m/messagebundle_da.properties +14 -8
- package/src/sap/m/messagebundle_de.properties +12 -6
- package/src/sap/m/messagebundle_el.properties +27 -21
- package/src/sap/m/messagebundle_en.properties +1164 -22
- package/src/sap/m/messagebundle_en_GB.properties +23 -17
- package/src/sap/m/messagebundle_en_US_saprigi.properties +34 -22
- package/src/sap/m/messagebundle_es.properties +19 -13
- package/src/sap/m/messagebundle_es_MX.properties +18 -12
- package/src/sap/m/messagebundle_et.properties +14 -8
- package/src/sap/m/messagebundle_fi.properties +21 -15
- package/src/sap/m/messagebundle_fr.properties +15 -9
- package/src/sap/m/messagebundle_fr_CA.properties +11 -5
- package/src/sap/m/messagebundle_hi.properties +24 -18
- package/src/sap/m/messagebundle_hr.properties +15 -9
- package/src/sap/m/messagebundle_hu.properties +20 -14
- package/src/sap/m/messagebundle_id.properties +15 -9
- package/src/sap/m/messagebundle_it.properties +17 -11
- package/src/sap/m/messagebundle_iw.properties +13 -7
- package/src/sap/m/messagebundle_ja.properties +23 -17
- package/src/sap/m/messagebundle_kk.properties +14 -8
- package/src/sap/m/messagebundle_ko.properties +18 -12
- package/src/sap/m/messagebundle_lt.properties +17 -11
- package/src/sap/m/messagebundle_lv.properties +26 -20
- package/src/sap/m/messagebundle_mk.properties +20 -14
- package/src/sap/m/messagebundle_ms.properties +13 -7
- package/src/sap/m/messagebundle_nl.properties +16 -10
- package/src/sap/m/messagebundle_no.properties +15 -9
- package/src/sap/m/messagebundle_pl.properties +16 -10
- package/src/sap/m/messagebundle_pt.properties +16 -10
- package/src/sap/m/messagebundle_pt_PT.properties +13 -7
- package/src/sap/m/messagebundle_ro.properties +13 -7
- package/src/sap/m/messagebundle_ru.properties +15 -9
- package/src/sap/m/messagebundle_sh.properties +21 -15
- package/src/sap/m/messagebundle_sk.properties +13 -7
- package/src/sap/m/messagebundle_sl.properties +14 -8
- package/src/sap/m/messagebundle_sr.properties +21 -15
- package/src/sap/m/messagebundle_sv.properties +15 -9
- package/src/sap/m/messagebundle_th.properties +12 -6
- package/src/sap/m/messagebundle_tr.properties +15 -9
- package/src/sap/m/messagebundle_uk.properties +15 -9
- package/src/sap/m/messagebundle_vi.properties +16 -10
- package/src/sap/m/messagebundle_zh_CN.properties +12 -6
- package/src/sap/m/messagebundle_zh_TW.properties +12 -6
- package/src/sap/m/p13n/.eslintrc.json +19 -0
- package/src/sap/m/p13n/AbstractContainer.js +43 -29
- package/src/sap/m/p13n/AbstractContainerItem.js +8 -8
- package/src/sap/m/p13n/BasePanel.js +123 -76
- package/src/sap/m/p13n/Container.js +80 -50
- package/src/sap/m/p13n/Engine.js +331 -294
- package/src/sap/m/p13n/FilterController.js +335 -0
- package/src/sap/m/p13n/FilterPanel.js +291 -0
- package/src/sap/m/p13n/FlexUtil.js +23 -21
- package/src/sap/m/p13n/GroupController.js +97 -85
- package/src/sap/m/p13n/GroupPanel.js +30 -25
- package/src/sap/m/p13n/MetadataHelper.js +65 -21
- package/src/sap/m/p13n/PersistenceProvider.js +11 -9
- package/src/sap/m/p13n/Popup.js +63 -45
- package/src/sap/m/p13n/QueryPanel.js +117 -93
- package/src/sap/m/p13n/SelectionController.js +302 -237
- package/src/sap/m/p13n/SelectionPanel.js +117 -83
- package/src/sap/m/p13n/SortController.js +100 -89
- package/src/sap/m/p13n/SortPanel.js +46 -31
- package/src/sap/m/p13n/enums/PersistenceMode.js +57 -0
- package/src/sap/m/p13n/{enum → enums}/ProcessingStrategy.js +10 -8
- package/src/sap/m/p13n/handler/xConfigHandler.js +175 -161
- package/src/sap/m/p13n/modification/FlexModificationHandler.js +151 -133
- package/src/sap/m/p13n/modification/LocalStorageModificationHandler.js +28 -28
- package/src/sap/m/p13n/modification/ModificationHandler.js +15 -15
- package/src/sap/m/p13n/modules/AdaptationProvider.js +7 -7
- package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +20 -18
- package/src/sap/m/p13n/modules/StateHandlerRegistry.js +7 -7
- package/src/sap/m/p13n/modules/UIManager.js +119 -117
- package/src/sap/m/p13n/modules/xConfigAPI.js +74 -68
- package/src/sap/m/plugins/CellSelector.js +142 -26
- package/src/sap/m/plugins/ColumnResizer.js +12 -17
- package/src/sap/m/plugins/ContextMenuSetting.js +155 -0
- package/src/sap/m/plugins/CopyProvider.js +170 -110
- package/src/sap/m/plugins/DataStateIndicator.js +9 -6
- package/src/sap/m/plugins/PasteProvider.js +18 -10
- package/src/sap/m/plugins/PluginBase.js +39 -15
- 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 +3 -3
- 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 +3 -3
- package/src/sap/m/semantic/MessagesIndicator.js +1 -1
- package/src/sap/m/semantic/MultiSelectAction.js +3 -3
- 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 +7 -5
- 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 +4 -2
- 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 +6 -12
- 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 +2 -3
- package/src/sap/m/table/Util.js +67 -40
- 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 +5 -5
- package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
- package/src/sap/m/table/columnmenu/Menu.js +14 -21
- 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 +7 -5
- package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSort.js +6 -4
- package/src/sap/m/table/columnmenu/QuickSortItem.js +6 -4
- package/src/sap/m/table/columnmenu/QuickTotal.js +7 -5
- package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
- package/src/sap/m/themes/base/ActionSheet.less +10 -3
- package/src/sap/m/themes/base/ActionTile.less +7 -4
- package/src/sap/m/themes/base/Carousel.less +1 -1
- package/src/sap/m/themes/base/ContextMenuSetting.less +3 -0
- package/src/sap/m/themes/base/IconTabBar.less +2 -2
- package/src/sap/m/themes/base/Label.less +2 -1
- package/src/sap/m/themes/base/Link.less +1 -1
- package/src/sap/m/themes/base/ListItemBase.less +1 -1
- package/src/sap/m/themes/base/MenuButton.less +2 -2
- package/src/sap/m/themes/base/MessageView.less +6 -0
- package/src/sap/m/themes/base/MultiComboBox.less +7 -4
- package/src/sap/m/themes/base/NumericContent.less +2 -2
- package/src/sap/m/themes/base/ObjectListItem.less +1 -1
- package/src/sap/m/themes/base/ObjectNumber.less +4 -4
- package/src/sap/m/themes/base/ObjectStatus.less +263 -160
- package/src/sap/m/themes/base/Panel.less +18 -4
- package/src/sap/m/themes/base/Popover.less +5 -0
- package/src/sap/m/themes/base/SinglePlanningCalendarMonthGrid.less +21 -0
- package/src/sap/m/themes/base/StandardListItem.less +1 -1
- package/src/sap/m/themes/base/SuggestionItem.less +6 -0
- package/src/sap/m/themes/base/Table.less +0 -5
- package/src/sap/m/themes/base/TablePersoDialog.less +4 -2
- package/src/sap/m/themes/base/Text.less +2 -1
- package/src/sap/m/themes/base/UploadCollection.less +2 -2
- package/src/sap/m/themes/base/UploadSet.less +55 -0
- package/src/sap/m/themes/base/VariantManagement.less +2 -1
- package/src/sap/m/themes/base/illustrations/sapIllus-Dialog-NewMail.svg +27 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dialog-SignOut.svg +24 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NewMail.svg +9 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-SignOut.svg +12 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Scene-NewMail.svg +59 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Scene-SignOut.svg +113 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Spot-NewMail.svg +27 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Spot-SignOut.svg +23 -0
- package/src/sap/m/themes/base/library.source.less +2 -1
- 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 +5 -5
- package/src/sap/m/upload/FilterPanel.js +5 -3
- package/src/sap/m/upload/UploadSet.js +122 -61
- package/src/sap/m/upload/UploadSetItem.js +31 -7
- package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
- package/src/sap/m/upload/UploadSetwithTable.js +7 -6
- package/src/sap/m/upload/UploadSetwithTableItem.js +5 -5
- package/src/sap/m/upload/UploaderTableItem.js +1 -1
- package/src/sap/m/upload/p13n/PersManager.js +4 -2
- package/src/sap/m/upload/p13n/mediator/BaseMediator.js +1 -1
- package/src/sap/m/upload/p13n/mediator/ColumnsMediator.js +5 -4
- package/src/sap/m/upload/p13n/mediator/FilterMediator.js +5 -2
- package/src/sap/m/upload/p13n/mediator/GroupMediator.js +5 -4
- package/src/sap/m/upload/p13n/mediator/SortMediator.js +5 -4
- package/src/sap/m/upload/p13n/modules/PersPopupManager.js +3 -3
- package/LICENSES/BSD-2-Clause.txt +0 -22
- package/src/sap/m/CustomAttribute.js +0 -53
- package/src/sap/m/p13n/enum/PersistenceMode.js +0 -55
package/src/sap/m/p13n/Engine.js
CHANGED
|
@@ -12,24 +12,39 @@ sap.ui.define([
|
|
|
12
12
|
"sap/m/MessageStrip",
|
|
13
13
|
"sap/ui/core/library",
|
|
14
14
|
"sap/ui/core/Element",
|
|
15
|
+
"sap/ui/core/ElementRegistry",
|
|
15
16
|
"sap/m/p13n/modules/DefaultProviderRegistry",
|
|
16
17
|
"sap/m/p13n/modules/UIManager",
|
|
17
18
|
"sap/m/p13n/modules/StateHandlerRegistry",
|
|
18
19
|
"sap/m/p13n/modules/xConfigAPI",
|
|
19
|
-
"sap/m/p13n/
|
|
20
|
-
],
|
|
20
|
+
"sap/m/p13n/enums/ProcessingStrategy"
|
|
21
|
+
], (
|
|
22
|
+
AdaptationProvider,
|
|
23
|
+
merge,
|
|
24
|
+
Log,
|
|
25
|
+
FlexModificationHandler,
|
|
26
|
+
MessageStrip,
|
|
27
|
+
coreLibrary,
|
|
28
|
+
Element,
|
|
29
|
+
ElementRegistry,
|
|
30
|
+
DefaultProviderRegistry,
|
|
31
|
+
UIManager,
|
|
32
|
+
StateHandlerRegistry,
|
|
33
|
+
xConfigAPI,
|
|
34
|
+
ProcessingStrategy
|
|
35
|
+
) => {
|
|
21
36
|
"use strict";
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
const ERROR_INSTANCING = "Engine: This class is a singleton. Please use the getInstance() method instead.";
|
|
24
39
|
|
|
25
40
|
//Shortcut to 'MessageType'
|
|
26
|
-
|
|
41
|
+
const MessageType = coreLibrary.MessageType;
|
|
27
42
|
|
|
28
43
|
/*global WeakMap */
|
|
29
|
-
|
|
44
|
+
const _mRegistry = new WeakMap();
|
|
30
45
|
|
|
31
46
|
//Singleton storage
|
|
32
|
-
|
|
47
|
+
let oEngine;
|
|
33
48
|
|
|
34
49
|
/**
|
|
35
50
|
*
|
|
@@ -57,12 +72,12 @@ sap.ui.define([
|
|
|
57
72
|
* @alias sap.m.p13n.Engine
|
|
58
73
|
* @extends sap.m.p13n.modules.AdaptationProvider
|
|
59
74
|
* @author SAP SE
|
|
60
|
-
* @version 1.
|
|
75
|
+
* @version 1.121.0
|
|
61
76
|
* @public
|
|
62
77
|
* @since 1.104
|
|
63
78
|
*/
|
|
64
|
-
|
|
65
|
-
constructor: function
|
|
79
|
+
const Engine = AdaptationProvider.extend("sap.m.p13n.Engine", {
|
|
80
|
+
constructor: function() {
|
|
66
81
|
AdaptationProvider.call(this);
|
|
67
82
|
|
|
68
83
|
if (oEngine) {
|
|
@@ -91,12 +106,6 @@ sap.ui.define([
|
|
|
91
106
|
* @public
|
|
92
107
|
*/
|
|
93
108
|
|
|
94
|
-
/**
|
|
95
|
-
* @namespace
|
|
96
|
-
* @name sap.m.p13n.MetadataHelper
|
|
97
|
-
* @public
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
109
|
/**
|
|
101
110
|
*
|
|
102
111
|
* The central registration for personalization functionality.
|
|
@@ -105,7 +114,7 @@ sap.ui.define([
|
|
|
105
114
|
* methods that always expect a control instance as parameter. Only registered control instances can be used for personalization through the <code>Engine</code>.
|
|
106
115
|
* @public
|
|
107
116
|
* @typedef {object} sap.m.p13n.EngineRegistrationConfig
|
|
108
|
-
* @property {sap.m.p13n.MetadataHelper} helper The <code>{@link sap.m.p13n.
|
|
117
|
+
* @property {sap.m.p13n.MetadataHelper} helper The <code>{@link sap.m.p13n.MetadataHelper MetadataHelper}</code> to provide metadata-specific information. It may be used to define more granular information for the selection of items.
|
|
109
118
|
* @property {Object<string,sap.m.p13n.SelectionController>} controller A map of arbitrary keys that contain a controller instance as value. The key must be unique and needs to be provided for later access when using <code>Engine</code> functionality specific for one controller type.
|
|
110
119
|
*/
|
|
111
120
|
|
|
@@ -135,13 +144,13 @@ sap.ui.define([
|
|
|
135
144
|
* }
|
|
136
145
|
* }
|
|
137
146
|
*/
|
|
138
|
-
Engine.prototype.register = function
|
|
147
|
+
Engine.prototype.register = function(oControl, oConfig) {
|
|
139
148
|
|
|
140
|
-
if (!oConfig.hasOwnProperty("controller")/* || Object.keys(oConfig.controller).length < 1*/) {
|
|
149
|
+
if (!oConfig.hasOwnProperty("controller") /* || Object.keys(oConfig.controller).length < 1*/) {
|
|
141
150
|
throw new Error("Please provide at least a configuration 'controller' containing a map of key-value pairs (key + Controller class) in order to register adaptation.");
|
|
142
151
|
}
|
|
143
152
|
|
|
144
|
-
|
|
153
|
+
let oRegistryEntry = this._getRegistryEntry(oControl);
|
|
145
154
|
|
|
146
155
|
if (oRegistryEntry) {
|
|
147
156
|
this.deregister(oControl);
|
|
@@ -149,11 +158,11 @@ sap.ui.define([
|
|
|
149
158
|
|
|
150
159
|
oRegistryEntry = this._createRegistryEntry(oControl, oConfig);
|
|
151
160
|
|
|
152
|
-
|
|
161
|
+
const aControllerKeys = Object.keys(oConfig.controller);
|
|
153
162
|
|
|
154
|
-
aControllerKeys.forEach(
|
|
163
|
+
aControllerKeys.forEach((sKey) => {
|
|
155
164
|
|
|
156
|
-
|
|
165
|
+
const oSubController = oConfig.controller[sKey];
|
|
157
166
|
|
|
158
167
|
if (!this.getController(oControl, sKey)) {
|
|
159
168
|
if (this._aRegistry.indexOf(oControl.getId()) < 0) {
|
|
@@ -163,10 +172,10 @@ sap.ui.define([
|
|
|
163
172
|
this.addController(oSubController, sKey);
|
|
164
173
|
}
|
|
165
174
|
|
|
166
|
-
}
|
|
175
|
+
});
|
|
167
176
|
|
|
168
177
|
//In case the control is marked as modified, the state change event is triggered once initially to apply the default state
|
|
169
|
-
|
|
178
|
+
const oXConfig = oControl.getCustomData().find((oCustomData) => oCustomData.getKey() == "xConfig");
|
|
170
179
|
if (oXConfig && JSON.parse((oXConfig.getValue()).replace(/\\/g, ''))?.modified) {
|
|
171
180
|
this.fireStateChange(oControl);
|
|
172
181
|
}
|
|
@@ -183,12 +192,12 @@ sap.ui.define([
|
|
|
183
192
|
*
|
|
184
193
|
* @param {sap.ui.core.Control} oControl The registered control instance
|
|
185
194
|
*/
|
|
186
|
-
Engine.prototype.deregister = function
|
|
187
|
-
|
|
195
|
+
Engine.prototype.deregister = function(oControl) {
|
|
196
|
+
const oRegistryEntry = this._getRegistryEntry(oControl);
|
|
188
197
|
|
|
189
198
|
//destroy subcontroller
|
|
190
|
-
Object.keys(oRegistryEntry.controller).forEach(
|
|
191
|
-
|
|
199
|
+
Object.keys(oRegistryEntry.controller).forEach((sKey) => {
|
|
200
|
+
const oController = oRegistryEntry.controller[sKey];
|
|
192
201
|
oController.destroy();
|
|
193
202
|
|
|
194
203
|
delete oRegistryEntry.controller[sKey];
|
|
@@ -198,7 +207,7 @@ sap.ui.define([
|
|
|
198
207
|
_mRegistry.delete(oControl);
|
|
199
208
|
|
|
200
209
|
//Remove the control from the array to maintain debugging
|
|
201
|
-
|
|
210
|
+
const iControlIndex = this._aRegistry.indexOf(oControl.getId());
|
|
202
211
|
this._aRegistry.splice(iControlIndex, 1);
|
|
203
212
|
};
|
|
204
213
|
|
|
@@ -219,14 +228,17 @@ sap.ui.define([
|
|
|
219
228
|
*
|
|
220
229
|
* @returns {Promise<sap.m.p13n.Popup>} Promise resolving in the <code>sap.m.p13n.Popup</code> instance
|
|
221
230
|
*/
|
|
222
|
-
Engine.prototype.show = function
|
|
223
|
-
return this.hasChanges(oControl)
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
Engine.prototype.show = function(oControl, vPanelKeys, mSettings) {
|
|
232
|
+
return this.hasChanges(oControl, vPanelKeys)
|
|
233
|
+
.catch((oError) => {
|
|
234
|
+
return false;
|
|
235
|
+
})
|
|
236
|
+
.then((enableReset) => {
|
|
237
|
+
return this.uimanager.show(oControl, vPanelKeys, {
|
|
238
|
+
...mSettings,
|
|
239
|
+
enableReset
|
|
240
|
+
});
|
|
241
|
+
});
|
|
230
242
|
};
|
|
231
243
|
|
|
232
244
|
/**
|
|
@@ -238,7 +250,7 @@ sap.ui.define([
|
|
|
238
250
|
* @param {function(sap.ui.base.Event):void} fnStateEventHandler The handler function to call when the event occurs
|
|
239
251
|
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
240
252
|
*/
|
|
241
|
-
Engine.prototype.attachStateChange = function
|
|
253
|
+
Engine.prototype.attachStateChange = function(fnStateEventHandler) {
|
|
242
254
|
return this.stateHandlerRegistry.attachChange(fnStateEventHandler);
|
|
243
255
|
};
|
|
244
256
|
|
|
@@ -251,7 +263,7 @@ sap.ui.define([
|
|
|
251
263
|
* @param {function(sap.ui.base.Event):void} fnStateEventHandler The handler function to detach from the event
|
|
252
264
|
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
253
265
|
*/
|
|
254
|
-
Engine.prototype.detachStateChange = function
|
|
266
|
+
Engine.prototype.detachStateChange = function(fnStateEventHandler) {
|
|
255
267
|
return this.stateHandlerRegistry.detachChange(fnStateEventHandler);
|
|
256
268
|
};
|
|
257
269
|
|
|
@@ -259,20 +271,38 @@ sap.ui.define([
|
|
|
259
271
|
* Check if there are changes for a given control instance
|
|
260
272
|
*
|
|
261
273
|
* @private
|
|
262
|
-
|
|
263
|
-
|
|
274
|
+
* @ui5-restricted sap.m, sap.ui.mdc
|
|
275
|
+
*
|
|
264
276
|
* @param {sap.ui.core.Control} control The control instance
|
|
265
277
|
* @param {string} key The affected controller key
|
|
266
278
|
* @returns {Promise<boolean>} A Promise that resolves if the given control instance has applied changes
|
|
267
279
|
*/
|
|
268
280
|
Engine.prototype.hasChanges = function(control, key) {
|
|
269
|
-
const
|
|
281
|
+
const oChangeOperations = this.getController(control, key)?.getChangeOperations();
|
|
270
282
|
let changeTypes;
|
|
271
|
-
if (
|
|
272
|
-
changeTypes =
|
|
283
|
+
if (oChangeOperations) {
|
|
284
|
+
changeTypes = [];
|
|
285
|
+
Object.values(oChangeOperations).forEach((vChangeOperation) => {
|
|
286
|
+
if (Array.isArray(vChangeOperation)) {
|
|
287
|
+
changeTypes = changeTypes.concat(vChangeOperation);
|
|
288
|
+
} else {
|
|
289
|
+
changeTypes.push(vChangeOperation);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
273
292
|
}
|
|
274
|
-
|
|
275
|
-
|
|
293
|
+
let selectors = [];
|
|
294
|
+
if (this.getController(control, key)?.getSelectorsForHasChanges) {
|
|
295
|
+
selectors = selectors.concat(this.getController(control, key).getSelectorsForHasChanges());
|
|
296
|
+
} else {
|
|
297
|
+
selectors.push(control);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const oModificationSetting = this._determineModification(control);
|
|
301
|
+
return this.getModificationHandler(control).hasChanges({
|
|
302
|
+
selector: control,
|
|
303
|
+
selectors,
|
|
304
|
+
changeTypes
|
|
305
|
+
}, oModificationSetting?.payload).then((enableReset) => {
|
|
276
306
|
return enableReset;
|
|
277
307
|
});
|
|
278
308
|
};
|
|
@@ -287,7 +317,7 @@ sap.ui.define([
|
|
|
287
317
|
*
|
|
288
318
|
* @returns {Promise<null>} A Promise resolving once the reset is completed
|
|
289
319
|
*/
|
|
290
|
-
Engine.prototype.reset = function
|
|
320
|
+
Engine.prototype.reset = function(oControl, aKeys) {
|
|
291
321
|
|
|
292
322
|
if (aKeys === undefined) {
|
|
293
323
|
aKeys = this.getRegisteredControllers(oControl);
|
|
@@ -295,36 +325,35 @@ sap.ui.define([
|
|
|
295
325
|
|
|
296
326
|
aKeys = aKeys instanceof Array ? aKeys : [aKeys];
|
|
297
327
|
|
|
298
|
-
|
|
328
|
+
let aSelectors = [];
|
|
299
329
|
|
|
300
|
-
aKeys.forEach(
|
|
330
|
+
aKeys.forEach((sKey) => {
|
|
301
331
|
aSelectors = aSelectors.concat(this.getController(oControl, sKey).getSelectorForReset());
|
|
302
|
-
}
|
|
332
|
+
});
|
|
303
333
|
|
|
304
|
-
|
|
334
|
+
const oResetConfig = {
|
|
305
335
|
selectors: aSelectors,
|
|
306
336
|
selector: oControl
|
|
307
337
|
};
|
|
308
338
|
|
|
309
339
|
if (aKeys) {
|
|
310
|
-
|
|
311
|
-
aKeys.forEach(
|
|
340
|
+
let aChangeTypes = [];
|
|
341
|
+
aKeys.forEach((sKey) => {
|
|
312
342
|
aChangeTypes = aChangeTypes.concat(Object.values(this.getController(oControl, sKey).getChangeOperations()));
|
|
313
|
-
}
|
|
314
|
-
oResetConfig.changeTypes = [].concat
|
|
343
|
+
});
|
|
344
|
+
oResetConfig.changeTypes = [].concat(...aChangeTypes);
|
|
315
345
|
}
|
|
316
346
|
|
|
317
|
-
|
|
318
|
-
return oModificationSetting.handler.reset(oResetConfig, oModificationSetting.payload).then(
|
|
319
|
-
this.stateHandlerRegistry.fireChange(oControl);
|
|
347
|
+
const oModificationSetting = this._determineModification(oControl);
|
|
348
|
+
return oModificationSetting.handler.reset(oResetConfig, oModificationSetting.payload).then(() => {
|
|
320
349
|
//Re-Init housekeeping after update
|
|
321
|
-
return this.initAdaptation(oControl, aKeys).then(
|
|
322
|
-
aKeys.forEach(
|
|
323
|
-
|
|
350
|
+
return this.initAdaptation(oControl, aKeys).then((oPropertyHelper) => {
|
|
351
|
+
aKeys.forEach((sKey) => {
|
|
352
|
+
const oController = this.getController(oControl, sKey);
|
|
324
353
|
oController.update(oPropertyHelper);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
});
|
|
328
357
|
};
|
|
329
358
|
|
|
330
359
|
/**
|
|
@@ -367,7 +396,7 @@ sap.ui.define([
|
|
|
367
396
|
* },
|
|
368
397
|
* {
|
|
369
398
|
* key: "key2",
|
|
370
|
-
* grouped: false //Removes
|
|
399
|
+
* grouped: false //Removes grouping status for key2
|
|
371
400
|
* },{
|
|
372
401
|
* key: "key3",
|
|
373
402
|
* position: 2 //Reorders current grouping position in the array
|
|
@@ -379,12 +408,13 @@ sap.ui.define([
|
|
|
379
408
|
*
|
|
380
409
|
* @returns {Promise<sap.m.p13n.State>} A Promise resolving after the state has been applied
|
|
381
410
|
*/
|
|
382
|
-
Engine.prototype.applyState = function
|
|
411
|
+
Engine.prototype.applyState = function(oControl, oState) {
|
|
383
412
|
|
|
384
413
|
//Call retrieve only to ensure that the control is initialized and enabled for modification
|
|
385
|
-
return this.retrieveState(oControl).then(
|
|
386
|
-
|
|
387
|
-
|
|
414
|
+
return this.retrieveState(oControl).then((oCurrentState) => {
|
|
415
|
+
const aStatePromise = [];
|
|
416
|
+
let aChanges = [];
|
|
417
|
+
let mInfoState = {};
|
|
388
418
|
|
|
389
419
|
if (oControl.validateState instanceof Function) {
|
|
390
420
|
mInfoState = oControl.validateState(this.externalizeKeys(oControl, oState));
|
|
@@ -394,10 +424,9 @@ sap.ui.define([
|
|
|
394
424
|
Log.error(mInfoState.message);
|
|
395
425
|
}
|
|
396
426
|
|
|
397
|
-
|
|
398
|
-
aKeys.forEach(
|
|
399
|
-
|
|
400
|
-
var oController = this.getController(oControl, sControllerKey);
|
|
427
|
+
const aKeys = Object.keys(oState);
|
|
428
|
+
aKeys.forEach((sControllerKey) => {
|
|
429
|
+
const oController = this.getController(oControl, sControllerKey);
|
|
401
430
|
|
|
402
431
|
if (!oController) {
|
|
403
432
|
//In case no controller can be found, skip change creation & appliance
|
|
@@ -405,7 +434,7 @@ sap.ui.define([
|
|
|
405
434
|
return;
|
|
406
435
|
}
|
|
407
436
|
|
|
408
|
-
|
|
437
|
+
const oStatePromise = this.createChanges({
|
|
409
438
|
control: oControl,
|
|
410
439
|
key: sControllerKey,
|
|
411
440
|
state: oController.sanityCheck(oState[sControllerKey]),
|
|
@@ -414,24 +443,23 @@ sap.ui.define([
|
|
|
414
443
|
});
|
|
415
444
|
|
|
416
445
|
aStatePromise.push(oStatePromise);
|
|
417
|
-
}
|
|
446
|
+
});
|
|
418
447
|
|
|
419
|
-
return Promise.all(aStatePromise).then(
|
|
420
|
-
|
|
448
|
+
return Promise.all(aStatePromise).then((aRawChanges) => {
|
|
449
|
+
const mChangeMap = {};
|
|
421
450
|
|
|
422
|
-
aRawChanges.forEach(
|
|
451
|
+
aRawChanges.forEach((aSpecificChanges, iIndex) => {
|
|
423
452
|
|
|
424
453
|
if (aSpecificChanges && aSpecificChanges.length > 0) {
|
|
425
454
|
aChanges = aChanges.concat(aSpecificChanges);
|
|
426
|
-
|
|
455
|
+
const sKey = aKeys[iIndex];
|
|
427
456
|
mChangeMap[sKey] = aSpecificChanges;
|
|
428
457
|
}
|
|
429
458
|
});
|
|
430
459
|
|
|
431
460
|
return this._processChanges(oControl, mChangeMap);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
}.bind(this));
|
|
461
|
+
});
|
|
462
|
+
});
|
|
435
463
|
};
|
|
436
464
|
|
|
437
465
|
/**
|
|
@@ -447,16 +475,16 @@ sap.ui.define([
|
|
|
447
475
|
*
|
|
448
476
|
* @returns {Promise<sap.m.p13n.State>} A Promise resolving in the current control state
|
|
449
477
|
*/
|
|
450
|
-
Engine.prototype.retrieveState = function
|
|
478
|
+
Engine.prototype.retrieveState = function(oControl) {
|
|
451
479
|
|
|
452
480
|
//ensure that the control has been initialized
|
|
453
|
-
return this.checkControlInitialized(oControl).then(
|
|
481
|
+
return this.checkControlInitialized(oControl).then(() => {
|
|
454
482
|
|
|
455
483
|
//ensure that all changes have been applied
|
|
456
|
-
return Engine.getInstance().waitForChanges(oControl).then(
|
|
484
|
+
return Engine.getInstance().waitForChanges(oControl).then(() => {
|
|
457
485
|
|
|
458
|
-
|
|
459
|
-
Engine.getInstance().getRegisteredControllers(oControl).forEach(
|
|
486
|
+
const oRetrievedState = {};
|
|
487
|
+
Engine.getInstance().getRegisteredControllers(oControl).forEach((sKey) => {
|
|
460
488
|
oRetrievedState[sKey] = Engine.getInstance().getController(oControl, sKey).getCurrentState(true);
|
|
461
489
|
});
|
|
462
490
|
|
|
@@ -475,19 +503,19 @@ sap.ui.define([
|
|
|
475
503
|
* @param {sap.ui.core.Control} vControl The registered control instance
|
|
476
504
|
* @param {sap.m.p13n.modification.ModificationHandler} oModificationHandler The modification handler object
|
|
477
505
|
*/
|
|
478
|
-
Engine.prototype._setModificationHandler = function
|
|
506
|
+
Engine.prototype._setModificationHandler = function(vControl, oModificationHandler) {
|
|
479
507
|
if (!oModificationHandler.isA("sap.m.p13n.modification.ModificationHandler")) {
|
|
480
508
|
throw new Error("Only sap.m.p13n.modification.ModificationHandler derivations are allowed for modification");
|
|
481
509
|
}
|
|
482
|
-
|
|
510
|
+
const oModificationSetting = this._determineModification(vControl); //check and calculate modification basics
|
|
483
511
|
oModificationSetting.handler = oModificationHandler;
|
|
484
512
|
this._getRegistryEntry(vControl).modification = oModificationSetting;
|
|
485
513
|
};
|
|
486
514
|
|
|
487
|
-
Engine.prototype._addToQueue = function
|
|
488
|
-
|
|
515
|
+
Engine.prototype._addToQueue = function(oControl, fTask) {
|
|
516
|
+
const oRegistryEntry = this._getRegistryEntry(oControl);
|
|
489
517
|
|
|
490
|
-
|
|
518
|
+
const fCleanupPromiseQueue = (pOriginalPromise) => {
|
|
491
519
|
if (oRegistryEntry.pendingModification === pOriginalPromise) {
|
|
492
520
|
oRegistryEntry.pendingModification = null;
|
|
493
521
|
}
|
|
@@ -521,62 +549,66 @@ sap.ui.define([
|
|
|
521
549
|
*
|
|
522
550
|
* @returns {Promise} A Promise resolving in the related delta changes
|
|
523
551
|
*/
|
|
524
|
-
Engine.prototype.createChanges = function
|
|
552
|
+
Engine.prototype.createChanges = function(mDiffParameters) {
|
|
525
553
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
554
|
+
const oControl = Engine.getControlInstance(mDiffParameters.control);
|
|
555
|
+
const sKey = mDiffParameters.key;
|
|
556
|
+
const vNewState = mDiffParameters.state;
|
|
557
|
+
const bSuppressCallback = !!mDiffParameters.suppressAppliance;
|
|
530
558
|
|
|
531
559
|
if (!sKey || !mDiffParameters.control || !vNewState) {
|
|
532
560
|
return Promise.resolve([]);
|
|
533
561
|
}
|
|
534
562
|
|
|
535
|
-
|
|
536
|
-
return this.initAdaptation(oControl, sKey).then(
|
|
563
|
+
const fDeltaHandling = () => {
|
|
564
|
+
return this.initAdaptation(oControl, sKey).then(() => {
|
|
537
565
|
return vNewState;
|
|
538
566
|
})
|
|
539
|
-
.then(
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
567
|
+
.then((aNewState) => {
|
|
568
|
+
|
|
569
|
+
const oController = this.getController(oControl, sKey);
|
|
570
|
+
const mChangeOperations = oController.getChangeOperations();
|
|
571
|
+
|
|
572
|
+
const oRegistryEntry = this._getRegistryEntry(oControl);
|
|
573
|
+
const oCurrentState = oController.getCurrentState();
|
|
574
|
+
const oPriorState = merge(oCurrentState instanceof Array ? [] : {}, oCurrentState);
|
|
575
|
+
|
|
576
|
+
const oControllerHelper = oController.getMetadataHelper();
|
|
577
|
+
const oHelper = oControllerHelper ? oControllerHelper : oRegistryEntry.helper;
|
|
578
|
+
const oPropertyInfo = oHelper.getProperties().map((a) => {
|
|
579
|
+
return {
|
|
580
|
+
key: a.key,
|
|
581
|
+
name: a.name
|
|
582
|
+
};
|
|
583
|
+
});
|
|
547
584
|
|
|
548
|
-
|
|
585
|
+
const mDeltaConfig = {
|
|
549
586
|
existingState: mDiffParameters.stateBefore || oPriorState,
|
|
550
587
|
applyAbsolute: mDiffParameters.applyAbsolute,
|
|
551
588
|
changedState: aNewState,
|
|
552
589
|
control: oController.getAdaptationControl(),
|
|
553
590
|
changeOperations: mChangeOperations,
|
|
554
591
|
deltaAttributes: ["key"],
|
|
555
|
-
propertyInfo:
|
|
556
|
-
return {
|
|
557
|
-
key: a.key,
|
|
558
|
-
name: a.name
|
|
559
|
-
};
|
|
560
|
-
})
|
|
592
|
+
propertyInfo: oPropertyInfo
|
|
561
593
|
};
|
|
562
594
|
|
|
563
595
|
//Only execute change calculation in case there is a difference (--> example: press 'Ok' without a difference)
|
|
564
|
-
|
|
596
|
+
const aChanges = oController.getDelta(mDeltaConfig);
|
|
565
597
|
|
|
566
598
|
if (!bSuppressCallback) {
|
|
567
|
-
|
|
599
|
+
const mChangeMap = {};
|
|
568
600
|
mChangeMap[sKey] = aChanges;
|
|
569
601
|
return this._processChanges(oControl, mChangeMap)
|
|
570
|
-
.then(
|
|
602
|
+
.then(() => {
|
|
571
603
|
return aChanges;
|
|
572
604
|
});
|
|
573
605
|
}
|
|
574
606
|
|
|
575
607
|
return aChanges || [];
|
|
576
608
|
|
|
577
|
-
}
|
|
609
|
+
});
|
|
578
610
|
|
|
579
|
-
}
|
|
611
|
+
};
|
|
580
612
|
|
|
581
613
|
return this._addToQueue(oControl, fDeltaHandling);
|
|
582
614
|
};
|
|
@@ -590,11 +622,11 @@ sap.ui.define([
|
|
|
590
622
|
* @param {sap.ui.core.Control} oControl The related control instance
|
|
591
623
|
* @returns {Promise} A Promise resolving after all pending modifications have been applied
|
|
592
624
|
*/
|
|
593
|
-
Engine.prototype.waitForChanges = function
|
|
594
|
-
|
|
595
|
-
|
|
625
|
+
Engine.prototype.waitForChanges = function(oControl) {
|
|
626
|
+
const oModificationSetting = this._determineModification(oControl);
|
|
627
|
+
const oRegistryEntry = this._getRegistryEntry(oControl);
|
|
596
628
|
return oRegistryEntry && oRegistryEntry.pendingModification ? oRegistryEntry.pendingModification : Promise.resolve()
|
|
597
|
-
.then(
|
|
629
|
+
.then(() => {
|
|
598
630
|
return oModificationSetting.handler.waitForChanges({
|
|
599
631
|
element: oControl
|
|
600
632
|
}, oModificationSetting.payload);
|
|
@@ -609,17 +641,17 @@ sap.ui.define([
|
|
|
609
641
|
*
|
|
610
642
|
* @returns {Promise} A Promise resolving in a Boolean that determines whether the requirements for the persistence layer are met
|
|
611
643
|
*/
|
|
612
|
-
Engine.prototype.isModificationSupported = function
|
|
613
|
-
|
|
644
|
+
Engine.prototype.isModificationSupported = function(oControl) {
|
|
645
|
+
const oModificationSetting = this._determineModification(oControl);
|
|
614
646
|
return oModificationSetting.handler.isModificationSupported({
|
|
615
647
|
element: oControl
|
|
616
648
|
}, oModificationSetting.payload);
|
|
617
649
|
};
|
|
618
650
|
|
|
619
|
-
Engine.prototype.fireStateChange = function
|
|
620
|
-
return this.retrieveState(oControl).then(
|
|
651
|
+
Engine.prototype.fireStateChange = function(oControl) {
|
|
652
|
+
return this.retrieveState(oControl).then((oState) => {
|
|
621
653
|
this.stateHandlerRegistry.fireChange(oControl, oState);
|
|
622
|
-
}
|
|
654
|
+
});
|
|
623
655
|
};
|
|
624
656
|
|
|
625
657
|
/**
|
|
@@ -630,24 +662,19 @@ sap.ui.define([
|
|
|
630
662
|
* @param {object} mChanges A map of keys and arrays, every controller will provide an array of changes
|
|
631
663
|
* @returns {Promise} The change appliance <code>Promise</code>
|
|
632
664
|
*/
|
|
633
|
-
Engine.prototype._processChanges = function
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
665
|
+
Engine.prototype._processChanges = function(vControl, mChanges) {
|
|
666
|
+
let aChanges = [];
|
|
667
|
+
const aKeys = Object.keys(mChanges);
|
|
668
|
+
const oDiff = {};
|
|
637
669
|
|
|
638
|
-
aKeys.forEach(
|
|
670
|
+
aKeys.forEach((sKey) => {
|
|
639
671
|
oDiff[sKey] = this.getController(vControl, sKey).changesToState(mChanges[sKey]);
|
|
640
672
|
aChanges = aChanges.concat(mChanges[sKey]);
|
|
641
|
-
}
|
|
673
|
+
});
|
|
642
674
|
|
|
643
675
|
if (aChanges instanceof Array && aChanges.length > 0) {
|
|
644
|
-
|
|
645
|
-
return oModificationSetting.handler.processChanges(aChanges, oModificationSetting.payload)
|
|
646
|
-
.then(function (aChanges) {
|
|
647
|
-
var oControl = Engine.getControlInstance(vControl);
|
|
648
|
-
this.fireStateChange(oControl);
|
|
649
|
-
return aChanges;
|
|
650
|
-
}.bind(this));
|
|
676
|
+
const oModificationSetting = this._determineModification(vControl);
|
|
677
|
+
return oModificationSetting.handler.processChanges(aChanges, oModificationSetting.payload);
|
|
651
678
|
} else {
|
|
652
679
|
return Promise.resolve([]);
|
|
653
680
|
}
|
|
@@ -667,26 +694,26 @@ sap.ui.define([
|
|
|
667
694
|
*
|
|
668
695
|
* @returns {Promise} A Promise resolving in the set of changes to be created during UI adaptation at runtime
|
|
669
696
|
*/
|
|
670
|
-
Engine.prototype.getRTASettingsActionHandler = function
|
|
697
|
+
Engine.prototype.getRTASettingsActionHandler = function(oControl, mPropertyBag, aKeys) {
|
|
671
698
|
|
|
672
|
-
|
|
699
|
+
let fResolveRTA;
|
|
673
700
|
|
|
674
701
|
//var aVMs = this.hasForReference(oControl, "sap.ui.fl.variants.VariantManagement");
|
|
675
702
|
// TODO: clarify if we need this error handling / what to do with the Link if we want to keep it
|
|
676
|
-
|
|
703
|
+
const aPVs = this.hasForReference(oControl, "sap.m.p13n.PersistenceProvider");
|
|
677
704
|
|
|
678
705
|
if (aPVs.length > 0 && !oControl.isA("sap.ui.mdc.link.Panel")) {
|
|
679
706
|
return Promise.reject("Please do not use a PeristenceProvider in RTA.");
|
|
680
707
|
}
|
|
681
708
|
|
|
682
|
-
|
|
683
|
-
|
|
709
|
+
const oOriginalModifHandler = this.getModificationHandler(oControl);
|
|
710
|
+
const oTemporaryRTAHandler = new FlexModificationHandler();
|
|
684
711
|
|
|
685
|
-
|
|
712
|
+
const oRTAPromise = new Promise((resolve, reject) => {
|
|
686
713
|
fResolveRTA = resolve;
|
|
687
714
|
});
|
|
688
715
|
|
|
689
|
-
oTemporaryRTAHandler.processChanges =
|
|
716
|
+
oTemporaryRTAHandler.processChanges = (aChanges) => {
|
|
690
717
|
fResolveRTA(aChanges);
|
|
691
718
|
return Promise.resolve(aChanges);
|
|
692
719
|
};
|
|
@@ -695,8 +722,8 @@ sap.ui.define([
|
|
|
695
722
|
|
|
696
723
|
this.uimanager.show(oControl, aKeys, {
|
|
697
724
|
showReset: false
|
|
698
|
-
}).then(
|
|
699
|
-
|
|
725
|
+
}).then((oContainer) => {
|
|
726
|
+
const oCustomHeader = oContainer.getCustomHeader();
|
|
700
727
|
if (oCustomHeader) {
|
|
701
728
|
oCustomHeader.getContentRight()[0].setVisible(false);
|
|
702
729
|
}
|
|
@@ -706,10 +733,10 @@ sap.ui.define([
|
|
|
706
733
|
}
|
|
707
734
|
});
|
|
708
735
|
|
|
709
|
-
oRTAPromise.then(
|
|
736
|
+
oRTAPromise.then(() => {
|
|
710
737
|
this._setModificationHandler(oControl, oOriginalModifHandler);
|
|
711
738
|
oTemporaryRTAHandler.destroy();
|
|
712
|
-
}
|
|
739
|
+
});
|
|
713
740
|
|
|
714
741
|
return oRTAPromise;
|
|
715
742
|
|
|
@@ -731,14 +758,15 @@ sap.ui.define([
|
|
|
731
758
|
* @param {object} [mEnhanceConfig.propertyBag] Optional property bag for the <code>ModificationHandler</code>
|
|
732
759
|
* @returns {Promise} Promise resolving when the xConfig is successfully enhanced
|
|
733
760
|
*/
|
|
734
|
-
Engine.prototype.enhanceXConfig = function
|
|
761
|
+
Engine.prototype.enhanceXConfig = function(vControl, mEnhanceConfig) {
|
|
735
762
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
mEnhanceConfig.
|
|
763
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
764
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
765
|
+
const sPersistenceIdentifier = mEnhanceConfig && mEnhanceConfig.value && mEnhanceConfig.value.controllerKey ? mEnhanceConfig.value.controllerKey : undefined;
|
|
766
|
+
mEnhanceConfig.currentState = Engine.getInstance().getController(oControl, mEnhanceConfig.changeType, sPersistenceIdentifier)?.getCurrentState();
|
|
739
767
|
|
|
740
768
|
return xConfigAPI.enhanceConfig(oControl, mEnhanceConfig)
|
|
741
|
-
.then(
|
|
769
|
+
.then((oConfig) => {
|
|
742
770
|
if (oRegistryEntry) {
|
|
743
771
|
//to simplify debugging
|
|
744
772
|
oRegistryEntry.xConfig = oConfig;
|
|
@@ -759,9 +787,9 @@ sap.ui.define([
|
|
|
759
787
|
* @returns {Promise<object>|object}
|
|
760
788
|
* A <code>Promise</code> that resolves with the configuration. The xConfig itself if it is already available, or <code>null</code> if there is no xConfig
|
|
761
789
|
*/
|
|
762
|
-
Engine.prototype.readXConfig =
|
|
790
|
+
Engine.prototype.readXConfig = (vControl, mEnhanceConfig) => {
|
|
763
791
|
|
|
764
|
-
|
|
792
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
765
793
|
return xConfigAPI.readConfig(oControl, mEnhanceConfig) || {};
|
|
766
794
|
};
|
|
767
795
|
|
|
@@ -775,14 +803,14 @@ sap.ui.define([
|
|
|
775
803
|
* @param {object} oInternalState The internal state
|
|
776
804
|
* @returns {object} The externalized state
|
|
777
805
|
*/
|
|
778
|
-
Engine.prototype.externalizeKeys = function
|
|
779
|
-
|
|
780
|
-
Object.keys(oInternalState).forEach(
|
|
781
|
-
|
|
806
|
+
Engine.prototype.externalizeKeys = function(vControl, oInternalState) {
|
|
807
|
+
const oExternalState = {};
|
|
808
|
+
Object.keys(oInternalState).forEach((sInternalKey) => {
|
|
809
|
+
const oController = this.getController(Engine.getControlInstance(vControl), sInternalKey);
|
|
782
810
|
if (oController) {
|
|
783
811
|
oExternalState[oController.getStateKey()] = oInternalState[sInternalKey];
|
|
784
812
|
}
|
|
785
|
-
}
|
|
813
|
+
});
|
|
786
814
|
return oExternalState;
|
|
787
815
|
};
|
|
788
816
|
|
|
@@ -796,56 +824,58 @@ sap.ui.define([
|
|
|
796
824
|
* @param {object} oExternalState The external state
|
|
797
825
|
* @returns {object} The internalized state
|
|
798
826
|
*/
|
|
799
|
-
Engine.prototype.internalizeKeys = function
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
827
|
+
Engine.prototype.internalizeKeys = function(vControl, oExternalState) {
|
|
828
|
+
const aControllerKeys = this.getRegisteredControllers(vControl),
|
|
829
|
+
oInternalState = {};
|
|
830
|
+
aControllerKeys.forEach((sInternalRegistryKey) => {
|
|
831
|
+
const sExternalStateKey = this.getController(vControl, sInternalRegistryKey).getStateKey();
|
|
803
832
|
if (oExternalState.hasOwnProperty(sExternalStateKey)) {
|
|
804
833
|
oInternalState[sInternalRegistryKey] = oExternalState[sExternalStateKey];
|
|
805
834
|
}
|
|
806
|
-
}
|
|
835
|
+
});
|
|
807
836
|
return oInternalState;
|
|
808
837
|
};
|
|
809
838
|
|
|
810
|
-
Engine.prototype.diffState = function
|
|
839
|
+
Engine.prototype.diffState = function(oControl, oOld, oNew) {
|
|
811
840
|
|
|
812
|
-
|
|
841
|
+
const aDiffCreation = [],
|
|
842
|
+
oDiffState = {};
|
|
813
843
|
oOld = merge({}, oOld);
|
|
814
844
|
oNew = merge({}, oNew);
|
|
815
845
|
|
|
816
|
-
Object.keys(oNew).forEach(
|
|
846
|
+
Object.keys(oNew).forEach((sKey) => {
|
|
817
847
|
aDiffCreation.push(this.createChanges({
|
|
818
848
|
control: oControl,
|
|
819
849
|
stateBefore: oOld[sKey],
|
|
820
|
-
state: oNew[sKey],
|
|
850
|
+
state: this.getController(oControl, sKey).sanityCheck(oNew[sKey]),
|
|
821
851
|
applyAbsolute: ProcessingStrategy.FullReplace,
|
|
822
852
|
key: sKey,
|
|
823
853
|
suppressAppliance: true
|
|
824
854
|
}));
|
|
825
|
-
}
|
|
855
|
+
});
|
|
826
856
|
return Promise.all(aDiffCreation)
|
|
827
|
-
.then(
|
|
828
|
-
Object.keys(oNew).forEach(
|
|
857
|
+
.then((aChanges) => {
|
|
858
|
+
Object.keys(oNew).forEach((sKey, i) => {
|
|
829
859
|
|
|
830
860
|
if (oNew[sKey]) {
|
|
831
|
-
|
|
861
|
+
const aState = this.getController(oControl, sKey).changesToState(aChanges[i], oOld[sKey], oNew[sKey]);
|
|
832
862
|
oDiffState[sKey] = aState;
|
|
833
863
|
}
|
|
834
|
-
}
|
|
864
|
+
});
|
|
835
865
|
|
|
836
866
|
return oDiffState;
|
|
837
867
|
|
|
838
|
-
}
|
|
868
|
+
});
|
|
839
869
|
};
|
|
840
870
|
|
|
841
|
-
Engine.prototype.checkControlInitialized =
|
|
842
|
-
|
|
843
|
-
|
|
871
|
+
Engine.prototype.checkControlInitialized = (vControl) => {
|
|
872
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
873
|
+
const pInitialize = oControl.initialized instanceof Function ? oControl.initialized() : Promise.resolve();
|
|
844
874
|
return pInitialize || Promise.resolve();
|
|
845
875
|
};
|
|
846
876
|
|
|
847
|
-
Engine.prototype.checkPropertyHelperInitialized =
|
|
848
|
-
|
|
877
|
+
Engine.prototype.checkPropertyHelperInitialized = (vControl) => {
|
|
878
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
849
879
|
return oControl.initPropertyHelper instanceof Function ? oControl.initPropertyHelper() : Promise.resolve();
|
|
850
880
|
};
|
|
851
881
|
|
|
@@ -860,21 +890,21 @@ sap.ui.define([
|
|
|
860
890
|
*
|
|
861
891
|
* @returns {Promise} A Promise resolving after the adaptation housekeeping has been initialized
|
|
862
892
|
*/
|
|
863
|
-
Engine.prototype.initAdaptation = function
|
|
893
|
+
Engine.prototype.initAdaptation = function(vControl, aKeys) {
|
|
864
894
|
this.verifyController(vControl, aKeys);
|
|
865
895
|
|
|
866
896
|
//1) Cache property helper
|
|
867
|
-
|
|
868
|
-
|
|
897
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
898
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
869
899
|
|
|
870
900
|
if (oRegistryEntry.helper) {
|
|
871
901
|
return Promise.resolve(oRegistryEntry.helper);
|
|
872
902
|
}
|
|
873
903
|
|
|
874
|
-
return this.checkPropertyHelperInitialized(oControl).then(
|
|
904
|
+
return this.checkPropertyHelperInitialized(oControl).then((oPropertyHelper) => {
|
|
875
905
|
oRegistryEntry.helper = oPropertyHelper;
|
|
876
906
|
return oPropertyHelper;
|
|
877
|
-
},
|
|
907
|
+
}, (sHelperError) => {
|
|
878
908
|
throw new Error(sHelperError);
|
|
879
909
|
});
|
|
880
910
|
|
|
@@ -889,8 +919,8 @@ sap.ui.define([
|
|
|
889
919
|
* @param {string} sKey The key that defines the later access to the controller instance.
|
|
890
920
|
* @param {object} oPreConfig A predefined configuration
|
|
891
921
|
*/
|
|
892
|
-
Engine.prototype.addController = function
|
|
893
|
-
|
|
922
|
+
Engine.prototype.addController = function(oController, sKey, oPreConfig) {
|
|
923
|
+
const oRegistryEntry = this._getRegistryEntry(oController.getAdaptationControl(), oPreConfig);
|
|
894
924
|
oRegistryEntry.controller[sKey] = oController;
|
|
895
925
|
};
|
|
896
926
|
|
|
@@ -900,27 +930,34 @@ sap.ui.define([
|
|
|
900
930
|
*
|
|
901
931
|
* @param {sap.ui.core.Control} vControl The registered Control instance.
|
|
902
932
|
* @param {string} sKey The key/changeType for which the controller has been registered.
|
|
933
|
+
* @param {string} [sPersistenceIdentifier] The key defined for the controller. Should be used if <code>sKey</code> represents the changeType.
|
|
903
934
|
*
|
|
904
935
|
* @returns {sap.m.p13n.SelectionController} The controller instance
|
|
905
936
|
*/
|
|
906
|
-
Engine.prototype.getController = function
|
|
907
|
-
|
|
937
|
+
Engine.prototype.getController = function(vControl, sKey, sPersistenceIdentifier) {
|
|
938
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
939
|
+
let oController;
|
|
908
940
|
if (oRegistryEntry && oRegistryEntry.controller.hasOwnProperty(sKey)) {
|
|
909
941
|
oController = oRegistryEntry.controller[sKey];
|
|
910
942
|
}
|
|
911
943
|
|
|
912
|
-
if (
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
944
|
+
if (oController) {
|
|
945
|
+
return oController;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
this.getRegisteredControllers(vControl).forEach((sController) => {
|
|
949
|
+
const oRegisteredController = this.getController(vControl, sController);
|
|
950
|
+
if (oRegisteredController) {
|
|
951
|
+
Object.keys(oRegisteredController.getChangeOperations()).forEach((sOperationType) => {
|
|
952
|
+
if (oRegisteredController.getChangeOperations()[sOperationType] === sKey) {
|
|
953
|
+
if (!sPersistenceIdentifier || sPersistenceIdentifier === oRegisteredController.getPersistenceIdentifier()) {
|
|
918
954
|
oController = oRegisteredController;
|
|
919
955
|
}
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
}
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
|
|
924
961
|
return oController;
|
|
925
962
|
};
|
|
926
963
|
|
|
@@ -930,15 +967,15 @@ sap.ui.define([
|
|
|
930
967
|
* @param {sap.ui.core.Control} vControl The registered Control instance.
|
|
931
968
|
* @param {string|array} vKey A key as string or an array of keys
|
|
932
969
|
*/
|
|
933
|
-
Engine.prototype.verifyController = function
|
|
934
|
-
|
|
970
|
+
Engine.prototype.verifyController = function(vControl, vKey) {
|
|
971
|
+
const aKeys = vKey instanceof Array ? vKey : [vKey];
|
|
935
972
|
|
|
936
|
-
aKeys.forEach(
|
|
973
|
+
aKeys.forEach((sKey) => {
|
|
937
974
|
if (!this.getController(vControl, sKey)) {
|
|
938
|
-
|
|
975
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
939
976
|
throw new Error("No controller registered yet for " + oControl.getId() + " and key: " + sKey);
|
|
940
977
|
}
|
|
941
|
-
}
|
|
978
|
+
});
|
|
942
979
|
|
|
943
980
|
};
|
|
944
981
|
|
|
@@ -951,26 +988,27 @@ sap.ui.define([
|
|
|
951
988
|
*
|
|
952
989
|
* @returns {object} The requested UI settings of the control instance and provided keys
|
|
953
990
|
*/
|
|
954
|
-
Engine.prototype.getUISettings = function
|
|
955
|
-
|
|
991
|
+
Engine.prototype.getUISettings = function(vControl, vKeys) {
|
|
992
|
+
const aKeys = Array.isArray(vKeys) ? vKeys : [vKeys];
|
|
956
993
|
this.verifyController(vControl, aKeys);
|
|
957
|
-
|
|
958
|
-
|
|
994
|
+
const oPropertyHelper = this._getRegistryEntry(vControl).helper;
|
|
995
|
+
const mUiSettings = {},
|
|
996
|
+
aPanelCreation = [];
|
|
959
997
|
|
|
960
|
-
aKeys.forEach(
|
|
961
|
-
|
|
962
|
-
|
|
998
|
+
aKeys.forEach((sKey) => {
|
|
999
|
+
const oController = this.getController(vControl, sKey);
|
|
1000
|
+
const pAdaptationUI = oController.initAdaptationUI(oPropertyHelper);
|
|
963
1001
|
|
|
964
1002
|
//Check faceless controller implementations and skip them
|
|
965
1003
|
if (pAdaptationUI instanceof Promise) {
|
|
966
1004
|
aPanelCreation.push(pAdaptationUI);
|
|
967
1005
|
}
|
|
968
|
-
}
|
|
1006
|
+
});
|
|
969
1007
|
|
|
970
1008
|
return Promise.all(aPanelCreation)
|
|
971
|
-
.then(
|
|
972
|
-
aPanels.forEach(
|
|
973
|
-
|
|
1009
|
+
.then((aPanels) => {
|
|
1010
|
+
aPanels.forEach((oPanel, iIndex) => {
|
|
1011
|
+
const sKey = aKeys[iIndex];
|
|
974
1012
|
mUiSettings[sKey] = {
|
|
975
1013
|
panel: oPanel
|
|
976
1014
|
};
|
|
@@ -988,8 +1026,8 @@ sap.ui.define([
|
|
|
988
1026
|
* @param {string|sap.ui.core.Control} vControl The control ID or instance
|
|
989
1027
|
* @returns {boolean} true if modification settings were already determined
|
|
990
1028
|
*/
|
|
991
|
-
Engine.prototype.isRegistered = function
|
|
992
|
-
|
|
1029
|
+
Engine.prototype.isRegistered = function(vControl) {
|
|
1030
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
993
1031
|
return !!oRegistryEntry;
|
|
994
1032
|
};
|
|
995
1033
|
|
|
@@ -999,10 +1037,10 @@ sap.ui.define([
|
|
|
999
1037
|
* @private
|
|
1000
1038
|
*
|
|
1001
1039
|
* @param {sap.ui.core.Control} vControl The registered Control instance
|
|
1002
|
-
|
|
1040
|
+
* @returns {boolean} true if modification settings were already determined
|
|
1003
1041
|
*/
|
|
1004
|
-
Engine.prototype.isRegisteredForModification = function
|
|
1005
|
-
|
|
1042
|
+
Engine.prototype.isRegisteredForModification = function(vControl) {
|
|
1043
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1006
1044
|
return oRegistryEntry && !!oRegistryEntry.modification;
|
|
1007
1045
|
};
|
|
1008
1046
|
|
|
@@ -1012,8 +1050,8 @@ sap.ui.define([
|
|
|
1012
1050
|
* @param {string|sap.ui.core.Control} vControl The control ID or instance
|
|
1013
1051
|
* @returns {array} An array of all registered controller instances
|
|
1014
1052
|
*/
|
|
1015
|
-
Engine.prototype.getRegisteredControllers = function
|
|
1016
|
-
|
|
1053
|
+
Engine.prototype.getRegisteredControllers = function(vControl) {
|
|
1054
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1017
1055
|
return oRegistryEntry ? Object.keys(oRegistryEntry.controller) : [];
|
|
1018
1056
|
};
|
|
1019
1057
|
/**
|
|
@@ -1024,9 +1062,9 @@ sap.ui.define([
|
|
|
1024
1062
|
*
|
|
1025
1063
|
* @returns {object} The related registry entry
|
|
1026
1064
|
*/
|
|
1027
|
-
Engine.prototype._getRegistryEntry =
|
|
1065
|
+
Engine.prototype._getRegistryEntry = (vControl) => {
|
|
1028
1066
|
|
|
1029
|
-
|
|
1067
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
1030
1068
|
return _mRegistry.get(oControl);
|
|
1031
1069
|
|
|
1032
1070
|
};
|
|
@@ -1040,8 +1078,8 @@ sap.ui.define([
|
|
|
1040
1078
|
* @param {string|sap.ui.core.Control} vControl The control id or instance
|
|
1041
1079
|
* @returns {object} The related ModificationHandler.
|
|
1042
1080
|
*/
|
|
1043
|
-
Engine.prototype.getModificationHandler = function
|
|
1044
|
-
|
|
1081
|
+
Engine.prototype.getModificationHandler = function(vControl) {
|
|
1082
|
+
const oModificationSetting = this._determineModification(vControl);
|
|
1045
1083
|
|
|
1046
1084
|
//This method might also be retrieved by non-registered Controls (such as FilterBarBase) - the default should always be Flex.
|
|
1047
1085
|
return oModificationSetting.handler;
|
|
@@ -1056,9 +1094,9 @@ sap.ui.define([
|
|
|
1056
1094
|
* @param {object} oPreConfig A predefined configuration
|
|
1057
1095
|
* @returns {object} The related registry entry
|
|
1058
1096
|
*/
|
|
1059
|
-
Engine.prototype._createRegistryEntry =
|
|
1097
|
+
Engine.prototype._createRegistryEntry = (vControl, oPreConfig) => {
|
|
1060
1098
|
|
|
1061
|
-
|
|
1099
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
1062
1100
|
|
|
1063
1101
|
if (!_mRegistry.has(oControl)) {
|
|
1064
1102
|
|
|
@@ -1083,29 +1121,30 @@ sap.ui.define([
|
|
|
1083
1121
|
return _mRegistry.get(oControl);
|
|
1084
1122
|
};
|
|
1085
1123
|
|
|
1086
|
-
Engine.prototype.trace = function
|
|
1087
|
-
|
|
1088
|
-
this.getRegisteredControllers(vControl).forEach(
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
Object.keys(mChangeOperations).forEach(
|
|
1124
|
+
Engine.prototype.trace = function(vControl, oChange) {
|
|
1125
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1126
|
+
this.getRegisteredControllers(vControl).forEach((sKey) => {
|
|
1127
|
+
const oController = this.getController(vControl, sKey);
|
|
1128
|
+
const mChangeOperations = oController.getChangeOperations();
|
|
1129
|
+
Object.keys(mChangeOperations).forEach((sType) => {
|
|
1092
1130
|
if (mChangeOperations[sType] === oChange.changeSpecificData.changeType) {
|
|
1093
1131
|
oRegistryEntry.pendingAppliance[sKey] = [].concat(oRegistryEntry.pendingAppliance[sKey] || []).concat(oChange);
|
|
1094
1132
|
}
|
|
1095
1133
|
});
|
|
1096
|
-
}
|
|
1134
|
+
});
|
|
1097
1135
|
};
|
|
1098
1136
|
|
|
1099
|
-
Engine.prototype.getTrace = function
|
|
1100
|
-
|
|
1137
|
+
Engine.prototype.getTrace = function(vControl, oChange) {
|
|
1138
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1139
|
+
let oTrace;
|
|
1101
1140
|
if (oRegistryEntry) {
|
|
1102
1141
|
oTrace = Object.keys(oRegistryEntry.pendingAppliance);
|
|
1103
1142
|
}
|
|
1104
1143
|
return oTrace;
|
|
1105
1144
|
};
|
|
1106
1145
|
|
|
1107
|
-
Engine.prototype.clearTrace = function
|
|
1108
|
-
|
|
1146
|
+
Engine.prototype.clearTrace = function(vControl, oChange) {
|
|
1147
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1109
1148
|
if (oRegistryEntry) {
|
|
1110
1149
|
oRegistryEntry.pendingAppliance = {};
|
|
1111
1150
|
}
|
|
@@ -1118,22 +1157,22 @@ sap.ui.define([
|
|
|
1118
1157
|
* @param {string|sap.ui.core.Control} vControl The control id or instance
|
|
1119
1158
|
* @returns {object} The related modification registry entry
|
|
1120
1159
|
*/
|
|
1121
|
-
Engine.prototype._determineModification = function
|
|
1160
|
+
Engine.prototype._determineModification = function(vControl) {
|
|
1122
1161
|
|
|
1123
|
-
|
|
1162
|
+
const oRegistryEntry = this._getRegistryEntry(vControl);
|
|
1124
1163
|
|
|
1125
1164
|
//Modification setting is only calculated once per control instance
|
|
1126
1165
|
if (oRegistryEntry && oRegistryEntry.modification) {
|
|
1127
1166
|
return oRegistryEntry.modification;
|
|
1128
1167
|
}
|
|
1129
1168
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1169
|
+
const aPPResults = this.hasForReference(vControl, "sap.m.p13n.PersistenceProvider").concat(this.hasForReference(vControl, "sap.ui.mdc.p13n.PersistenceProvider"));
|
|
1170
|
+
const aVMResults = this.hasForReference(vControl, "sap.ui.fl.variants.VariantManagement");
|
|
1132
1171
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1172
|
+
const aPersistenceProvider = aPPResults.length ? aPPResults : undefined;
|
|
1173
|
+
const sHandlerMode = aPersistenceProvider ? aPersistenceProvider[0].getMode() : "Standard";
|
|
1135
1174
|
|
|
1136
|
-
|
|
1175
|
+
const oModificationSetting = {
|
|
1137
1176
|
handler: FlexModificationHandler.getInstance(),
|
|
1138
1177
|
payload: {
|
|
1139
1178
|
hasVM: aVMResults && aVMResults.length > 0,
|
|
@@ -1149,14 +1188,14 @@ sap.ui.define([
|
|
|
1149
1188
|
return oModificationSetting;
|
|
1150
1189
|
};
|
|
1151
1190
|
|
|
1152
|
-
Engine.prototype.hasForReference =
|
|
1153
|
-
|
|
1154
|
-
|
|
1191
|
+
Engine.prototype.hasForReference = (vControl, sControlType) => {
|
|
1192
|
+
const sControlId = vControl && vControl.getId ? vControl.getId() : vControl;
|
|
1193
|
+
const aResults = ElementRegistry.filter((oElement) => {
|
|
1155
1194
|
if (!oElement.isA(sControlType)) {
|
|
1156
1195
|
return false;
|
|
1157
1196
|
}
|
|
1158
|
-
|
|
1159
|
-
for (
|
|
1197
|
+
const aFor = oElement.getFor instanceof Function ? oElement.getFor() : [];
|
|
1198
|
+
for (let n = 0; n < aFor.length; n++) {
|
|
1160
1199
|
if (aFor[n] === sControlId || oEngine.hasControlAncestorWithId(sControlId, aFor[n])) {
|
|
1161
1200
|
return true;
|
|
1162
1201
|
}
|
|
@@ -1175,14 +1214,14 @@ sap.ui.define([
|
|
|
1175
1214
|
*
|
|
1176
1215
|
* @returns {boolean} Returns whether an related ancestor could be found.
|
|
1177
1216
|
*/
|
|
1178
|
-
Engine.prototype.hasControlAncestorWithId =
|
|
1179
|
-
|
|
1217
|
+
Engine.prototype.hasControlAncestorWithId = (sControlId, sAncestorControlId) => {
|
|
1218
|
+
let oControl;
|
|
1180
1219
|
|
|
1181
1220
|
if (sControlId === sAncestorControlId) {
|
|
1182
1221
|
return true;
|
|
1183
1222
|
}
|
|
1184
1223
|
|
|
1185
|
-
oControl =
|
|
1224
|
+
oControl = Element.getElementById(sControlId);
|
|
1186
1225
|
while (oControl) {
|
|
1187
1226
|
if (oControl.getId() === sAncestorControlId) {
|
|
1188
1227
|
return true;
|
|
@@ -1208,8 +1247,8 @@ sap.ui.define([
|
|
|
1208
1247
|
* @param {string|sap.ui.core.Control} vControl The control ID or instance
|
|
1209
1248
|
* @returns {sap.ui.core.Control} The control instance
|
|
1210
1249
|
*/
|
|
1211
|
-
Engine.getControlInstance =
|
|
1212
|
-
return typeof vControl == "string" ?
|
|
1250
|
+
Engine.getControlInstance = (vControl) => {
|
|
1251
|
+
return typeof vControl == "string" ? Element.getElementById(vControl) : vControl;
|
|
1213
1252
|
};
|
|
1214
1253
|
|
|
1215
1254
|
/**
|
|
@@ -1222,7 +1261,7 @@ sap.ui.define([
|
|
|
1222
1261
|
*
|
|
1223
1262
|
* @returns {boolean} The related flag is the Control has an open P13n container
|
|
1224
1263
|
*/
|
|
1225
|
-
Engine.prototype.hasActiveP13n = function
|
|
1264
|
+
Engine.prototype.hasActiveP13n = function(vControl) {
|
|
1226
1265
|
return !!this._getRegistryEntry(vControl).activeP13n;
|
|
1227
1266
|
};
|
|
1228
1267
|
|
|
@@ -1237,7 +1276,7 @@ sap.ui.define([
|
|
|
1237
1276
|
* @param {string} sKey The registered key to get the corresponding controller.
|
|
1238
1277
|
* @param {boolean} bModified Determines whether changes have been triggered while the dialog has been opened
|
|
1239
1278
|
*/
|
|
1240
|
-
Engine.prototype.setActiveP13n = function
|
|
1279
|
+
Engine.prototype.setActiveP13n = function(vControl, sKey, bModified) {
|
|
1241
1280
|
this._getRegistryEntry(vControl).activeP13n = sKey ? {
|
|
1242
1281
|
usedControllers: sKey,
|
|
1243
1282
|
modified: bModified
|
|
@@ -1255,15 +1294,15 @@ sap.ui.define([
|
|
|
1255
1294
|
* @param {string} sKey The registered key to get the corresponding controller.
|
|
1256
1295
|
* @param {sap.ui.core.Control} oP13nUI The adaptation UI displayed in the container (e.g. BasePanel derivation).
|
|
1257
1296
|
*/
|
|
1258
|
-
Engine.prototype.validateP13n = function
|
|
1259
|
-
|
|
1260
|
-
|
|
1297
|
+
Engine.prototype.validateP13n = function(vControl, sKey, oP13nUI) {
|
|
1298
|
+
const oController = this.getController(vControl, sKey);
|
|
1299
|
+
const oControl = Engine.getControlInstance(vControl);
|
|
1261
1300
|
|
|
1262
1301
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1302
|
+
const mControllers = this._getRegistryEntry(vControl).controller;
|
|
1303
|
+
const oTheoreticalState = {};
|
|
1265
1304
|
|
|
1266
|
-
Object.keys(mControllers).forEach(
|
|
1305
|
+
Object.keys(mControllers).forEach((sControllerKey) => {
|
|
1267
1306
|
oTheoreticalState[sControllerKey] = mControllers[sControllerKey].getCurrentState();
|
|
1268
1307
|
});
|
|
1269
1308
|
|
|
@@ -1271,14 +1310,14 @@ sap.ui.define([
|
|
|
1271
1310
|
if (oController && oController.model2State instanceof Function) {
|
|
1272
1311
|
oTheoreticalState[sKey] = oController.model2State();
|
|
1273
1312
|
|
|
1274
|
-
|
|
1313
|
+
let mInfoState = {
|
|
1275
1314
|
validation: MessageType.None
|
|
1276
1315
|
};
|
|
1277
1316
|
if (oControl.validateState instanceof Function) {
|
|
1278
1317
|
mInfoState = oControl.validateState(this.externalizeKeys(oControl, oTheoreticalState), sKey);
|
|
1279
1318
|
}
|
|
1280
1319
|
|
|
1281
|
-
|
|
1320
|
+
let oMessageStrip;
|
|
1282
1321
|
|
|
1283
1322
|
if (mInfoState.validation !== MessageType.None) {
|
|
1284
1323
|
oMessageStrip = new MessageStrip({
|
|
@@ -1304,28 +1343,28 @@ sap.ui.define([
|
|
|
1304
1343
|
* @param {string[]} aKeys An array of keys
|
|
1305
1344
|
* @returns {Promise} A Promise resolving after all p13n changes have been calculated and processed
|
|
1306
1345
|
*/
|
|
1307
|
-
Engine.prototype.handleP13n = function
|
|
1346
|
+
Engine.prototype.handleP13n = function(oControl, aKeys) {
|
|
1308
1347
|
|
|
1309
|
-
|
|
1348
|
+
const pChanges = [];
|
|
1310
1349
|
|
|
1311
|
-
aKeys.forEach(
|
|
1350
|
+
aKeys.forEach((sControllerKey) => {
|
|
1312
1351
|
|
|
1313
|
-
|
|
1352
|
+
const oController = this.getController(oControl, sControllerKey);
|
|
1314
1353
|
|
|
1315
|
-
|
|
1354
|
+
const vP13nData = oController.getP13nData();
|
|
1316
1355
|
if (vP13nData) {
|
|
1317
|
-
|
|
1356
|
+
const p = this.createChanges({
|
|
1318
1357
|
control: oControl,
|
|
1319
1358
|
key: sControllerKey,
|
|
1320
1359
|
state: vP13nData,
|
|
1321
1360
|
suppressAppliance: true,
|
|
1322
1361
|
applyAbsolute: true
|
|
1323
1362
|
})
|
|
1324
|
-
.then(
|
|
1363
|
+
.then((aItemChanges) => {
|
|
1325
1364
|
|
|
1326
|
-
return oController.getBeforeApply().then(
|
|
1365
|
+
return oController.getBeforeApply().then((aChanges) => {
|
|
1327
1366
|
|
|
1328
|
-
|
|
1367
|
+
const aComulatedChanges = aChanges ? aChanges.concat(aItemChanges) : aItemChanges;
|
|
1329
1368
|
return aComulatedChanges;
|
|
1330
1369
|
|
|
1331
1370
|
});
|
|
@@ -1334,15 +1373,15 @@ sap.ui.define([
|
|
|
1334
1373
|
pChanges.push(p);
|
|
1335
1374
|
}
|
|
1336
1375
|
|
|
1337
|
-
}
|
|
1376
|
+
});
|
|
1338
1377
|
|
|
1339
|
-
return Promise.all(pChanges).then(
|
|
1378
|
+
return Promise.all(pChanges).then((aChangeMatrix) => {
|
|
1340
1379
|
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
aChangeMatrix.forEach(
|
|
1380
|
+
let aApplyChanges = [];
|
|
1381
|
+
const mChangeMap = {};
|
|
1382
|
+
aChangeMatrix.forEach((aTypeChanges, iIndex) => {
|
|
1344
1383
|
aApplyChanges = aApplyChanges.concat(aTypeChanges);
|
|
1345
|
-
|
|
1384
|
+
const sKey = aKeys[iIndex];
|
|
1346
1385
|
mChangeMap[sKey] = aTypeChanges;
|
|
1347
1386
|
});
|
|
1348
1387
|
|
|
@@ -1356,12 +1395,11 @@ sap.ui.define([
|
|
|
1356
1395
|
/**
|
|
1357
1396
|
* This method is the central point of access to the Engine Singleton.
|
|
1358
1397
|
*
|
|
1359
|
-
* @
|
|
1360
|
-
* @ui5-restricted sap.m, sap.ui.mdc
|
|
1398
|
+
* @public
|
|
1361
1399
|
*
|
|
1362
1400
|
* @returns {sap.m.p13n.Engine} The Engine instance
|
|
1363
1401
|
*/
|
|
1364
|
-
Engine.getInstance =
|
|
1402
|
+
Engine.getInstance = () => {
|
|
1365
1403
|
if (!oEngine) {
|
|
1366
1404
|
oEngine = new Engine();
|
|
1367
1405
|
}
|
|
@@ -1374,15 +1412,15 @@ sap.ui.define([
|
|
|
1374
1412
|
* @private
|
|
1375
1413
|
* @returns {object} The Engine registry object
|
|
1376
1414
|
*/
|
|
1377
|
-
Engine.prototype._getRegistry = function
|
|
1378
|
-
|
|
1415
|
+
Engine.prototype._getRegistry = function() {
|
|
1416
|
+
const oRegistry = {
|
|
1379
1417
|
stateHandlerRegistry: this.stateHandlerRegistry,
|
|
1380
1418
|
defaultProviderRegistry: this.defaultProviderRegistry,
|
|
1381
1419
|
controlRegistry: {}
|
|
1382
1420
|
};
|
|
1383
1421
|
|
|
1384
|
-
this._aRegistry.forEach(
|
|
1385
|
-
|
|
1422
|
+
this._aRegistry.forEach((sKey) => {
|
|
1423
|
+
const oControl = Element.getElementById(sKey);
|
|
1386
1424
|
oRegistry.controlRegistry[sKey] = _mRegistry.get(oControl);
|
|
1387
1425
|
});
|
|
1388
1426
|
|
|
@@ -1393,7 +1431,7 @@ sap.ui.define([
|
|
|
1393
1431
|
* @override
|
|
1394
1432
|
* @inheritDoc
|
|
1395
1433
|
*/
|
|
1396
|
-
Engine.prototype.destroy = function
|
|
1434
|
+
Engine.prototype.destroy = function() {
|
|
1397
1435
|
AdaptationProvider.prototype.destroy.apply(this, arguments);
|
|
1398
1436
|
oEngine = null;
|
|
1399
1437
|
this._aRegistry = null;
|
|
@@ -1405,6 +1443,5 @@ sap.ui.define([
|
|
|
1405
1443
|
this.uimanager.destroy();
|
|
1406
1444
|
this.uimanager = null;
|
|
1407
1445
|
};
|
|
1408
|
-
|
|
1409
1446
|
return Engine;
|
|
1410
1447
|
});
|