@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
|
@@ -5,27 +5,52 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/i18n/Localization",
|
|
8
9
|
'sap/base/util/array/diff',
|
|
9
10
|
'sap/ui/base/Object',
|
|
10
11
|
'sap/base/util/merge',
|
|
11
12
|
'sap/base/util/deepEqual',
|
|
12
13
|
'sap/m/p13n/SelectionPanel',
|
|
13
14
|
'sap/m/p13n/modules/xConfigAPI',
|
|
14
|
-
|
|
15
|
+
"sap/ui/core/Locale",
|
|
16
|
+
"sap/ui/core/Lib",
|
|
15
17
|
'sap/ui/core/mvc/View'
|
|
16
|
-
],
|
|
18
|
+
], (
|
|
19
|
+
Localization,
|
|
20
|
+
diff,
|
|
21
|
+
BaseObject,
|
|
22
|
+
merge,
|
|
23
|
+
deepEqual,
|
|
24
|
+
SelectionPanel,
|
|
25
|
+
xConfigAPI,
|
|
26
|
+
Locale,
|
|
27
|
+
Library,
|
|
28
|
+
View
|
|
29
|
+
) => {
|
|
17
30
|
"use strict";
|
|
18
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Personalization <code>SelectionState</code> object type. This object describes the state processed by this controller when accessing it through the {@link sap.m.p13n.Engine Engine}.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
* @typedef {object} sap.m.p13n.SelectionState
|
|
37
|
+
* @property {string} key The key for the group state
|
|
38
|
+
* @property {boolean} [visible] Defines whether the item is selected (if a selection state is provided, it's selected automatically)
|
|
39
|
+
* @property {int} [index] Describes the index of the selection item
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
|
|
19
43
|
/**
|
|
20
44
|
* Constructor for a new <code>SelectionController</code>.
|
|
21
45
|
*
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {object} [mSettings] Initial settings for the new control
|
|
46
|
+
* @param {object} mSettings Initial settings for the new controller
|
|
24
47
|
* @param {sap.ui.core.Control} mSettings.control The control instance that is personalized by this controller
|
|
25
48
|
* @param {function} [mSettings.getKeyForItem] By default the SelectionController tries to identify the existing item through the
|
|
26
49
|
* key by checking if there is an existing item with this id. This behaviour can be overruled by implementing this method which will
|
|
27
50
|
* provide the according item of the <code>targetAggregation</code> to return the according key associated to this item.
|
|
28
51
|
* @param {string} mSettings.targetAggregation The name of the aggregation that is now managed by this controller
|
|
52
|
+
* @param {string} [mSettings.persistenceIdentifier] If multiple <code>SelectionController</code> controls exist for a personalization use case, the <code>persistenceIdentifier</code> property must be added to uniquely identify a <code>SelectionController</code> control
|
|
53
|
+
* @param {sap.m.p13n.MetadataHelper} [mSettings.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.
|
|
29
54
|
*
|
|
30
55
|
* @class
|
|
31
56
|
* The <code>SelectionController</code> entity serves as a base class to create control-specific personalization implementations.
|
|
@@ -33,16 +58,18 @@ sap.ui.define([
|
|
|
33
58
|
* @extends sap.ui.base.Object
|
|
34
59
|
*
|
|
35
60
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
61
|
+
* @version 1.121.0
|
|
37
62
|
*
|
|
38
63
|
* @public
|
|
39
64
|
* @alias sap.m.p13n.SelectionController
|
|
40
65
|
*/
|
|
41
|
-
|
|
66
|
+
const SelectionController = BaseObject.extend("sap.m.p13n.SelectionController", {
|
|
42
67
|
constructor: function(mSettings) {
|
|
43
68
|
BaseObject.call(this);
|
|
44
69
|
|
|
45
70
|
this._oAdaptationControl = mSettings.control;
|
|
71
|
+
this._sPersistenceIdentifier = mSettings.persistenceIdentifier ? mSettings.persistenceIdentifier : null;
|
|
72
|
+
this._oMetadataHelper = mSettings.helper ? mSettings.helper : null;
|
|
46
73
|
|
|
47
74
|
/**
|
|
48
75
|
* The 'stableKeys' can be provided in the constructor to exclude the keys from the p13n UI, while still respecting them in the
|
|
@@ -66,16 +93,32 @@ sap.ui.define([
|
|
|
66
93
|
}
|
|
67
94
|
});
|
|
68
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Gets defined <code>persistenceIdentifier</code> of the controller.
|
|
98
|
+
* @returns {string|null} String if <code>_sPersistenceIdentifier</code> is defined, otherwise null.
|
|
99
|
+
*/
|
|
100
|
+
SelectionController.prototype.getPersistenceIdentifier = function() {
|
|
101
|
+
return this._sPersistenceIdentifier;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Gets defined {@link sap.m.p13n.MetadataHelper MetadataHelper} of the controller.
|
|
106
|
+
* @returns {sap.m.p13n.MetadataHelper|null} Instance of {@link sap.m.p13n.MetadataHelper} if defined, otherwise null.
|
|
107
|
+
*/
|
|
108
|
+
SelectionController.prototype.getMetadataHelper = function() {
|
|
109
|
+
return this._oMetadataHelper;
|
|
110
|
+
};
|
|
111
|
+
|
|
69
112
|
/**
|
|
70
113
|
* The control that is being personalized via this controller.
|
|
71
114
|
*
|
|
72
115
|
* @returns {sap.ui.mdc.Control} The control which is being adapted.
|
|
73
116
|
*/
|
|
74
|
-
SelectionController.prototype.getAdaptationControl = function(){
|
|
117
|
+
SelectionController.prototype.getAdaptationControl = function() {
|
|
75
118
|
return this._oAdaptationControl;
|
|
76
119
|
};
|
|
77
120
|
|
|
78
|
-
SelectionController.prototype.getTargetAggregation = function(){
|
|
121
|
+
SelectionController.prototype.getTargetAggregation = function() {
|
|
79
122
|
return this._sTargetAggregation;
|
|
80
123
|
};
|
|
81
124
|
|
|
@@ -85,7 +128,7 @@ sap.ui.define([
|
|
|
85
128
|
*
|
|
86
129
|
* @returns {object} A map of legal change types.
|
|
87
130
|
*/
|
|
88
|
-
SelectionController.prototype.getChangeOperations =
|
|
131
|
+
SelectionController.prototype.getChangeOperations = () => {
|
|
89
132
|
return {
|
|
90
133
|
add: "addItem",
|
|
91
134
|
remove: "removeItem",
|
|
@@ -93,7 +136,7 @@ sap.ui.define([
|
|
|
93
136
|
};
|
|
94
137
|
};
|
|
95
138
|
|
|
96
|
-
|
|
139
|
+
/**
|
|
97
140
|
* Defines which control(s) are considered for the reset.
|
|
98
141
|
*
|
|
99
142
|
* @returns {sap.ui.core.Control | sap.ui.core.Control[]}
|
|
@@ -102,7 +145,7 @@ sap.ui.define([
|
|
|
102
145
|
return this._oAdaptationControl;
|
|
103
146
|
};
|
|
104
147
|
|
|
105
|
-
SelectionController.prototype.sanityCheck =
|
|
148
|
+
SelectionController.prototype.sanityCheck = (oState) => {
|
|
106
149
|
return oState;
|
|
107
150
|
};
|
|
108
151
|
|
|
@@ -112,14 +155,14 @@ sap.ui.define([
|
|
|
112
155
|
* @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
|
|
113
156
|
* @returns {sap.ui.core.Control|string|Promise} The control which is going to be used in the p13n container.
|
|
114
157
|
*/
|
|
115
|
-
SelectionController.prototype.initAdaptationUI = function(oPropertyHelper){
|
|
116
|
-
|
|
158
|
+
SelectionController.prototype.initAdaptationUI = function(oPropertyHelper) {
|
|
159
|
+
const oAdaptationData = this.mixInfoAndState(oPropertyHelper);
|
|
117
160
|
this._oPanel = this.createUI(oAdaptationData);
|
|
118
161
|
return Promise.resolve(this._oPanel);
|
|
119
162
|
};
|
|
120
163
|
|
|
121
164
|
SelectionController.prototype.createUI = function(oAdaptationData) {
|
|
122
|
-
|
|
165
|
+
const oSelectionPanel = new SelectionPanel({
|
|
123
166
|
showHeader: true,
|
|
124
167
|
enableCount: true
|
|
125
168
|
});
|
|
@@ -127,7 +170,7 @@ sap.ui.define([
|
|
|
127
170
|
return oSelectionPanel.setP13nData(oAdaptationData.items);
|
|
128
171
|
};
|
|
129
172
|
|
|
130
|
-
|
|
173
|
+
const getViewForControl = (oControl) => {
|
|
131
174
|
if (oControl instanceof View) {
|
|
132
175
|
return oControl;
|
|
133
176
|
}
|
|
@@ -138,28 +181,31 @@ sap.ui.define([
|
|
|
138
181
|
}
|
|
139
182
|
};
|
|
140
183
|
|
|
141
|
-
SelectionController.prototype.getCurrentState = function(){
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
184
|
+
SelectionController.prototype.getCurrentState = function() {
|
|
185
|
+
const aState = [],
|
|
186
|
+
aAggregationItems = this.getAdaptationControl().getAggregation(this.getTargetAggregation()) || [];
|
|
187
|
+
const oView = getViewForControl(this.getAdaptationControl());
|
|
188
|
+
aAggregationItems.forEach((oItem, iIndex) => {
|
|
189
|
+
const sId = oView ? oView.getLocalId(oItem.getId()) : oItem.getId();
|
|
190
|
+
const vRelevant = this._fSelector ? this._fSelector(oItem) : oItem.getVisible();
|
|
147
191
|
if (vRelevant) {
|
|
148
192
|
aState.push({
|
|
149
193
|
key: typeof vRelevant === "boolean" ? sId : vRelevant
|
|
150
194
|
});
|
|
151
195
|
}
|
|
152
|
-
}
|
|
196
|
+
});
|
|
153
197
|
|
|
154
|
-
|
|
155
|
-
|
|
198
|
+
const oXConfig = xConfigAPI.readConfig(this.getAdaptationControl()) || {};
|
|
199
|
+
const oItemXConfig = oXConfig.hasOwnProperty("aggregations") ? oXConfig.aggregations[this._sTargetAggregation] : {};
|
|
156
200
|
|
|
157
|
-
for (
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
201
|
+
for (const sKey in oItemXConfig) {
|
|
202
|
+
const aStateKeys = aState.map((o) => {
|
|
203
|
+
return o.key;
|
|
204
|
+
});
|
|
205
|
+
let iCurrentIndex = aStateKeys.indexOf(sKey);
|
|
206
|
+
const iNewIndex = oItemXConfig[sKey].position;
|
|
207
|
+
const bVisible = oItemXConfig[sKey].visible !== false;
|
|
208
|
+
const bReordered = iNewIndex !== undefined;
|
|
163
209
|
|
|
164
210
|
if (bVisible && iCurrentIndex === -1) {
|
|
165
211
|
aState.push({
|
|
@@ -168,7 +214,7 @@ sap.ui.define([
|
|
|
168
214
|
}
|
|
169
215
|
|
|
170
216
|
if (bVisible && bReordered && aState.length > 0) {
|
|
171
|
-
|
|
217
|
+
const oItem = aState.splice(iCurrentIndex, 1)[0];
|
|
172
218
|
aState.splice(iNewIndex, 0, oItem);
|
|
173
219
|
iCurrentIndex = iNewIndex;
|
|
174
220
|
}
|
|
@@ -180,34 +226,33 @@ sap.ui.define([
|
|
|
180
226
|
return aState;
|
|
181
227
|
};
|
|
182
228
|
|
|
183
|
-
SelectionController.prototype.getStateKey =
|
|
229
|
+
SelectionController.prototype.getStateKey = () => {
|
|
184
230
|
return "items";
|
|
185
231
|
};
|
|
186
232
|
|
|
187
233
|
SelectionController.prototype.getDelta = function(mPropertyBag) {
|
|
188
|
-
|
|
189
|
-
var aNewStatePrepared;
|
|
234
|
+
const sPresenceAttribute = this._getPresenceAttribute(mPropertyBag.externalAppliance);
|
|
190
235
|
|
|
191
|
-
|
|
236
|
+
const fnFilterUnselected = (oItem) => {
|
|
192
237
|
return oItem.hasOwnProperty(sPresenceAttribute) && oItem[sPresenceAttribute] === false ? false : true;
|
|
193
238
|
};
|
|
194
|
-
aNewStatePrepared = mPropertyBag.applyAbsolute
|
|
195
|
-
|
|
239
|
+
const aNewStatePrepared = mPropertyBag.applyAbsolute ?
|
|
240
|
+
mPropertyBag.changedState.filter(fnFilterUnselected) :
|
|
196
241
|
this._getFilledArray(mPropertyBag.existingState, mPropertyBag.changedState, sPresenceAttribute).filter(fnFilterUnselected);
|
|
197
242
|
|
|
198
|
-
this._aStableKeys.forEach(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
243
|
+
this._aStableKeys.forEach((sKey, iIndex) => {
|
|
244
|
+
const mExistingState = this.arrayToMap(this.getCurrentState());
|
|
245
|
+
const mNewState = this.arrayToMap(aNewStatePrepared);
|
|
246
|
+
const iStableIndex = mExistingState[sKey] || (iIndex - 1);
|
|
202
247
|
|
|
203
248
|
if (!mNewState.hasOwnProperty(sKey)) {
|
|
204
|
-
aNewStatePrepared.splice(iStableIndex, 0,mExistingState[sKey]);
|
|
249
|
+
aNewStatePrepared.splice(iStableIndex, 0, mExistingState[sKey]);
|
|
205
250
|
}
|
|
206
|
-
}
|
|
251
|
+
});
|
|
207
252
|
mPropertyBag.changedState = aNewStatePrepared;
|
|
208
253
|
|
|
209
254
|
//Example: Dialog Ok --> don't trigger unnecessary flex change processing
|
|
210
|
-
if (deepEqual(mPropertyBag.existingState, aNewStatePrepared)){
|
|
255
|
+
if (deepEqual(mPropertyBag.existingState, aNewStatePrepared)) {
|
|
211
256
|
return [];
|
|
212
257
|
} else {
|
|
213
258
|
return this.getArrayDeltaChanges(mPropertyBag);
|
|
@@ -216,62 +261,64 @@ sap.ui.define([
|
|
|
216
261
|
};
|
|
217
262
|
|
|
218
263
|
/**
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
264
|
+
* Generates a set of changes based on the given arrays for a specified control
|
|
265
|
+
*
|
|
266
|
+
* @param {object} mDeltaInfo Map containing the necessary information to calculate the diff as change objects
|
|
267
|
+
* @param {array} mDeltaInfo.existingState An array describing the control state before a adaptation
|
|
268
|
+
* @param {array} mDeltaInfo.changedState An array describing the control state after a certain adaptation
|
|
269
|
+
* @param {object} mDeltaInfo.control Control instance which is being used to generate the changes
|
|
270
|
+
* @param {object} mDeltaInfo.changeOperations Map containing the changeOperations for the given Control instance
|
|
271
|
+
* @param {string} mDeltaInfo.changeOperations.add Name of the control specific 'add' changehandler
|
|
272
|
+
* @param {string} mDeltaInfo.changeOperations.remove Name of the control specific 'remove' changehandler
|
|
273
|
+
* @param {string} [mDeltaInfo.changeOperations.move] Name of the control specific 'move' changehandler
|
|
274
|
+
* @param {string} [mDeltaInfo.generator] Name of the change generator (E.g. the namespace of the UI creating the change object)
|
|
275
|
+
*
|
|
276
|
+
* @returns {array} Array containing the delta based created changes
|
|
277
|
+
*/
|
|
233
278
|
SelectionController.prototype.getArrayDeltaChanges = function(mDeltaInfo) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
279
|
+
const aExistingArray = mDeltaInfo.existingState;
|
|
280
|
+
const aChangedArray = mDeltaInfo.changedState;
|
|
281
|
+
const oControl = mDeltaInfo.control;
|
|
282
|
+
const sInsertOperation = mDeltaInfo.changeOperations.add;
|
|
283
|
+
const sRemoveOperation = mDeltaInfo.changeOperations.remove;
|
|
284
|
+
const sMoveOperation = mDeltaInfo.changeOperations.move;
|
|
285
|
+
const aDeltaAttributes = mDeltaInfo.deltaAttributes || [];
|
|
241
286
|
|
|
242
|
-
|
|
243
|
-
|
|
287
|
+
const mDeleteInsert = this._calculateDeleteInserts(aExistingArray, aChangedArray, aDeltaAttributes);
|
|
288
|
+
let aChanges = this._createAddRemoveChanges(mDeleteInsert.deletes, oControl, sRemoveOperation, aDeltaAttributes);
|
|
244
289
|
|
|
245
290
|
if (sMoveOperation) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
291
|
+
const aExistingArrayWithoutDeletes = this._removeItems(aExistingArray, mDeleteInsert.deletes);
|
|
292
|
+
const aChangedArrayWithoutInserts = this._removeItems(aChangedArray, mDeleteInsert.inserts);
|
|
293
|
+
const aMoveChanges = this._createMoveChanges(aExistingArrayWithoutDeletes, aChangedArrayWithoutInserts, oControl, sMoveOperation, aDeltaAttributes);
|
|
249
294
|
aChanges = aChanges.concat(aMoveChanges);
|
|
250
295
|
}
|
|
251
296
|
|
|
252
|
-
|
|
297
|
+
const aInsertChanges = this._createAddRemoveChanges(mDeleteInsert.inserts, oControl, sInsertOperation, aDeltaAttributes);
|
|
253
298
|
aChanges = aChanges.concat(aInsertChanges);
|
|
254
299
|
|
|
255
300
|
return aChanges;
|
|
256
301
|
};
|
|
257
302
|
|
|
258
303
|
SelectionController.prototype._createMoveChanges = function(aExistingItems, aChangedItems, oControl, sOperation, aDeltaAttributes) {
|
|
259
|
-
|
|
304
|
+
let sKey;
|
|
305
|
+
let nIndex;
|
|
306
|
+
let oItem;
|
|
307
|
+
const aChanges = [];
|
|
260
308
|
|
|
261
309
|
if (aExistingItems.length === aChangedItems.length) {
|
|
262
310
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
aDeltaAttributes.forEach(
|
|
311
|
+
const fnSymbol = (o) => {
|
|
312
|
+
let sDiff = "";
|
|
313
|
+
aDeltaAttributes.forEach((sAttribute) => {
|
|
266
314
|
sDiff = sDiff + o[sAttribute];
|
|
267
315
|
});
|
|
268
316
|
return sDiff;
|
|
269
317
|
};
|
|
270
318
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
for (var i = 0; i < aDiff.length; i++) {
|
|
319
|
+
const aDiff = diff(aExistingItems, aChangedItems, fnSymbol);
|
|
320
|
+
const aDeleted = [];
|
|
321
|
+
for (let i = 0; i < aDiff.length; i++) {
|
|
275
322
|
if (aDiff[i].type === "delete") {
|
|
276
323
|
oItem = aExistingItems[aDiff[i].index];
|
|
277
324
|
aDeleted.push(oItem);
|
|
@@ -280,14 +327,14 @@ sap.ui.define([
|
|
|
280
327
|
|
|
281
328
|
nIndex = aDiff[i].index;
|
|
282
329
|
// eslint-disable-next-line no-loop-func
|
|
283
|
-
aDeleted.forEach(
|
|
330
|
+
aDeleted.forEach((oItem) => {
|
|
284
331
|
if (sKey != oItem.key) {
|
|
285
|
-
|
|
332
|
+
const nDelIndex = this._indexOfByKeyName(aExistingItems, oItem.key || oItem.name);
|
|
286
333
|
if (nDelIndex < aDiff[i].index) {
|
|
287
334
|
nIndex++;
|
|
288
335
|
}
|
|
289
336
|
}
|
|
290
|
-
}
|
|
337
|
+
});
|
|
291
338
|
// eslint-enable-next-line no-loop-func
|
|
292
339
|
aChanges.push(this._createMoveChange(sKey, Math.min(nIndex, aChangedItems.length), sOperation, oControl));
|
|
293
340
|
}
|
|
@@ -297,91 +344,91 @@ sap.ui.define([
|
|
|
297
344
|
return aChanges;
|
|
298
345
|
};
|
|
299
346
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
for (i = 0; i < aTarget.length; i++) {
|
|
358
|
-
sKey = aTarget[i].key || aTarget[i].name;
|
|
359
|
-
if (this._indexOfByKeyName(aSource, sKey) === -1) {
|
|
360
|
-
oItem = merge({}, aTarget[i]);
|
|
361
|
-
oItem.index = i;
|
|
362
|
-
mDeleteInserts.inserts.push(oItem);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
return mDeleteInserts;
|
|
367
|
-
};
|
|
368
|
-
SelectionController.prototype._verifyDeltaAttributes = function (oSource, oTarget, aDeltaAttributes) {
|
|
369
|
-
var bReturn = false;
|
|
370
|
-
|
|
371
|
-
aDeltaAttributes.some(function(sAttr) {
|
|
372
|
-
if (!oSource.hasOwnProperty(sAttr) && oTarget.hasOwnProperty(sAttr) ||
|
|
373
|
-
oSource.hasOwnProperty(sAttr) && !oTarget.hasOwnProperty(sAttr) ||
|
|
374
|
-
(oSource[sAttr] != oTarget[sAttr]) ) {
|
|
375
|
-
bReturn = true;
|
|
347
|
+
SelectionController.prototype._createAddRemoveChanges = function(aItems, oControl, sOperation, aDeltaAttributes) {
|
|
348
|
+
const aChanges = [];
|
|
349
|
+
for (let i = 0; i < aItems.length; i++) {
|
|
350
|
+
aChanges.push(this._createAddRemoveChange(oControl, sOperation, this._getChangeContent(aItems[i], aDeltaAttributes)));
|
|
351
|
+
}
|
|
352
|
+
return aChanges;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
SelectionController.prototype._removeItems = function(aTarget, aItems) {
|
|
356
|
+
let sKey;
|
|
357
|
+
const aResultingTarget = [];
|
|
358
|
+
|
|
359
|
+
for (let i = 0; i < aTarget.length; i++) {
|
|
360
|
+
sKey = aTarget[i].key || aTarget[i].name;
|
|
361
|
+
if (this._indexOfByKeyName(aItems, sKey) === -1) {
|
|
362
|
+
aResultingTarget.push(aTarget[i]);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return aResultingTarget;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
SelectionController.prototype._indexOfByKeyName = (aArray, sKey) => {
|
|
370
|
+
let nIndex = -1;
|
|
371
|
+
aArray.some((oItem, nIdx) => {
|
|
372
|
+
if ((oItem.key === sKey) || (oItem.name === sKey)) {
|
|
373
|
+
nIndex = nIdx;
|
|
374
|
+
}
|
|
375
|
+
return (nIndex != -1);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
return nIndex;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
SelectionController.prototype._calculateDeleteInserts = function(aSource, aTarget, aDeltaAttributes) {
|
|
382
|
+
let i, sKey, oItem, nIdx;
|
|
383
|
+
const mDeleteInserts = {
|
|
384
|
+
deletes: [],
|
|
385
|
+
inserts: []
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
for (i = 0; i < aSource.length; i++) {
|
|
389
|
+
sKey = aSource[i].key || aSource[i].name;
|
|
390
|
+
nIdx = this._indexOfByKeyName(aTarget, sKey);
|
|
391
|
+
if (nIdx === -1) {
|
|
392
|
+
oItem = merge({}, aSource[i]);
|
|
393
|
+
mDeleteInserts.deletes.push(oItem);
|
|
394
|
+
} else if (aDeltaAttributes.length) {
|
|
395
|
+
if (this._verifyDeltaAttributes(aSource[i], aTarget[nIdx], aDeltaAttributes)) {
|
|
396
|
+
mDeleteInserts.deletes.push(aSource[i]);
|
|
397
|
+
|
|
398
|
+
oItem = merge({}, aTarget[nIdx]);
|
|
399
|
+
oItem.index = nIdx;
|
|
400
|
+
mDeleteInserts.inserts.push(oItem);
|
|
376
401
|
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
for (i = 0; i < aTarget.length; i++) {
|
|
405
|
+
sKey = aTarget[i].key || aTarget[i].name;
|
|
406
|
+
if (this._indexOfByKeyName(aSource, sKey) === -1) {
|
|
407
|
+
oItem = merge({}, aTarget[i]);
|
|
408
|
+
oItem.index = i;
|
|
409
|
+
mDeleteInserts.inserts.push(oItem);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
377
412
|
|
|
378
|
-
|
|
413
|
+
return mDeleteInserts;
|
|
414
|
+
};
|
|
415
|
+
SelectionController.prototype._verifyDeltaAttributes = (oSource, oTarget, aDeltaAttributes) => {
|
|
416
|
+
let bReturn = false;
|
|
417
|
+
|
|
418
|
+
aDeltaAttributes.some((sAttr) => {
|
|
419
|
+
if (!oSource.hasOwnProperty(sAttr) && oTarget.hasOwnProperty(sAttr) ||
|
|
420
|
+
oSource.hasOwnProperty(sAttr) && !oTarget.hasOwnProperty(sAttr) ||
|
|
421
|
+
(oSource[sAttr] != oTarget[sAttr])) {
|
|
422
|
+
bReturn = true;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return bReturn;
|
|
379
426
|
});
|
|
380
427
|
return bReturn;
|
|
381
428
|
|
|
382
429
|
};
|
|
383
430
|
|
|
384
|
-
|
|
431
|
+
/**
|
|
385
432
|
* Method which reduces a propertyinfo map to changecontent relevant attributes.
|
|
386
433
|
* <b>Note:</b> This method determines the attributes stored in the changeContent.
|
|
387
434
|
*
|
|
@@ -390,17 +437,17 @@ sap.ui.define([
|
|
|
390
437
|
*
|
|
391
438
|
* @returns {object} Object containing reduced content
|
|
392
439
|
*/
|
|
393
|
-
SelectionController.prototype._getChangeContent =
|
|
440
|
+
SelectionController.prototype._getChangeContent = (oProperty, aDeltaAttributes) => {
|
|
394
441
|
|
|
395
|
-
|
|
442
|
+
const oChangeContent = {};
|
|
396
443
|
|
|
397
444
|
// Index
|
|
398
445
|
if (oProperty.hasOwnProperty("index") && oProperty.index >= 0) {
|
|
399
446
|
oChangeContent.index = oProperty.index;
|
|
400
447
|
}
|
|
401
448
|
|
|
402
|
-
aDeltaAttributes.forEach(
|
|
403
|
-
if (oProperty.hasOwnProperty(sAttribute)){
|
|
449
|
+
aDeltaAttributes.forEach((sAttribute) => {
|
|
450
|
+
if (oProperty.hasOwnProperty(sAttribute)) {
|
|
404
451
|
oChangeContent[sAttribute] = oProperty[sAttribute];
|
|
405
452
|
}
|
|
406
453
|
});
|
|
@@ -408,17 +455,23 @@ sap.ui.define([
|
|
|
408
455
|
return oChangeContent;
|
|
409
456
|
};
|
|
410
457
|
|
|
411
|
-
SelectionController.prototype._createAddRemoveChange = function(oControl, sOperation, oContent){
|
|
458
|
+
SelectionController.prototype._createAddRemoveChange = function(oControl, sOperation, oContent) {
|
|
412
459
|
|
|
413
|
-
|
|
460
|
+
const oChangeContent = oContent;
|
|
414
461
|
|
|
415
462
|
if (sOperation.indexOf("set") !== 0) {
|
|
416
463
|
oChangeContent.value = (sOperation == this.getChangeOperations()["add"]);
|
|
417
464
|
}
|
|
418
465
|
|
|
419
|
-
|
|
466
|
+
if (this.getTargetAggregation()) {
|
|
467
|
+
oChangeContent.targetAggregation = this.getTargetAggregation();
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (this._sPersistenceIdentifier) {
|
|
471
|
+
oChangeContent.persistenceIdentifier = this._sPersistenceIdentifier;
|
|
472
|
+
}
|
|
420
473
|
|
|
421
|
-
|
|
474
|
+
const oAddRemoveChange = {
|
|
422
475
|
selectorElement: oControl,
|
|
423
476
|
changeSpecificData: {
|
|
424
477
|
changeType: sOperation,
|
|
@@ -428,21 +481,27 @@ sap.ui.define([
|
|
|
428
481
|
return oAddRemoveChange;
|
|
429
482
|
};
|
|
430
483
|
|
|
431
|
-
SelectionController.prototype._createMoveChange = function(sPropertykey, iNewIndex, sMoveOperation, oControl){
|
|
432
|
-
|
|
484
|
+
SelectionController.prototype._createMoveChange = function(sPropertykey, iNewIndex, sMoveOperation, oControl) {
|
|
485
|
+
const oContent = {
|
|
486
|
+
key: sPropertykey,
|
|
487
|
+
targetAggregation: this.getTargetAggregation(),
|
|
488
|
+
index: iNewIndex
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
if (this._sPersistenceIdentifier) {
|
|
492
|
+
oContent.persistenceIdentifier = this._sPersistenceIdentifier;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const oMoveChange = {
|
|
433
496
|
selectorElement: oControl,
|
|
434
497
|
changeSpecificData: {
|
|
435
498
|
changeType: sMoveOperation,
|
|
436
|
-
content:
|
|
437
|
-
key: sPropertykey,
|
|
438
|
-
targetAggregation: this.getTargetAggregation(),
|
|
439
|
-
index: iNewIndex
|
|
440
|
-
}
|
|
499
|
+
content: oContent
|
|
441
500
|
}
|
|
442
501
|
};
|
|
443
502
|
return oMoveChange;
|
|
444
503
|
};
|
|
445
|
-
SelectionController.prototype._getPresenceAttribute =
|
|
504
|
+
SelectionController.prototype._getPresenceAttribute = (bexternalAppliance) => {
|
|
446
505
|
return "visible";
|
|
447
506
|
};
|
|
448
507
|
|
|
@@ -452,7 +511,7 @@ sap.ui.define([
|
|
|
452
511
|
*
|
|
453
512
|
* @returns {Promise} A Promise that should resolve with an array of additional changes.
|
|
454
513
|
*/
|
|
455
|
-
SelectionController.prototype.getBeforeApply =
|
|
514
|
+
SelectionController.prototype.getBeforeApply = () => {
|
|
456
515
|
return Promise.resolve();
|
|
457
516
|
};
|
|
458
517
|
|
|
@@ -464,22 +523,24 @@ sap.ui.define([
|
|
|
464
523
|
*/
|
|
465
524
|
SelectionController.prototype.mixInfoAndState = function(oPropertyHelper) {
|
|
466
525
|
|
|
467
|
-
|
|
468
|
-
|
|
526
|
+
const aItemState = this.getCurrentState();
|
|
527
|
+
const mItemState = this.arrayToMap(aItemState);
|
|
469
528
|
|
|
470
|
-
|
|
471
|
-
|
|
529
|
+
const oP13nData = this.prepareAdaptationData(oPropertyHelper, (mItem, oProperty) => {
|
|
530
|
+
const oExisting = mItemState[oProperty.name || oProperty.key];
|
|
472
531
|
mItem.visible = !!oExisting;
|
|
473
|
-
mItem.position =
|
|
532
|
+
mItem.position = oExisting ? oExisting.position : -1;
|
|
474
533
|
return !(oProperty.visible === false || (this._aStableKeys.indexOf(oProperty.name || oProperty.key) > -1));
|
|
475
|
-
}
|
|
534
|
+
});
|
|
476
535
|
|
|
477
536
|
this.sortP13nData({
|
|
478
537
|
visible: "visible",
|
|
479
538
|
position: "position"
|
|
480
539
|
}, oP13nData.items);
|
|
481
540
|
|
|
482
|
-
oP13nData.items.forEach(
|
|
541
|
+
oP13nData.items.forEach((oItem) => {
|
|
542
|
+
delete oItem.position;
|
|
543
|
+
});
|
|
483
544
|
return oP13nData;
|
|
484
545
|
};
|
|
485
546
|
|
|
@@ -501,62 +562,64 @@ sap.ui.define([
|
|
|
501
562
|
SelectionController.prototype.update = function(oPropertyHelper) {
|
|
502
563
|
if (this._oPanel) {
|
|
503
564
|
if (!this._oPanel.isDestroyed()) {
|
|
504
|
-
|
|
565
|
+
const oAdaptationData = this.mixInfoAndState(oPropertyHelper);
|
|
505
566
|
this._oPanel.setP13nData(oAdaptationData.items);
|
|
506
567
|
}
|
|
507
|
-
} else if (this._oAdaptationModel){
|
|
568
|
+
} else if (this._oAdaptationModel) {
|
|
508
569
|
//'setData' causes unnecessary rerendering in some cases
|
|
509
|
-
|
|
570
|
+
const oP13nData = this.mixInfoAndState(oPropertyHelper);
|
|
510
571
|
this._oAdaptationModel.setProperty("/items", oP13nData.items);
|
|
511
572
|
this._oAdaptationModel.setProperty("/itemsGrouped", oP13nData.itemsGrouped);
|
|
512
573
|
}
|
|
513
574
|
};
|
|
514
575
|
|
|
515
576
|
SelectionController.prototype._getFilledArray = function(aPreviousItems, aNewItems, sRemoveProperty) {
|
|
516
|
-
|
|
517
|
-
|
|
577
|
+
const aNewItemsPrepared = merge([], aPreviousItems);
|
|
578
|
+
const aNewItemState = merge([], aNewItems);
|
|
518
579
|
|
|
519
|
-
aNewItemState.forEach(
|
|
520
|
-
|
|
521
|
-
|
|
580
|
+
aNewItemState.forEach((oItem) => {
|
|
581
|
+
const mExistingItems = this.arrayToMap(aNewItemsPrepared);
|
|
582
|
+
const oExistingItem = mExistingItems[oItem.key];
|
|
522
583
|
if (!oItem.hasOwnProperty(sRemoveProperty) || oItem[sRemoveProperty]) {
|
|
523
|
-
|
|
524
|
-
if (oExistingItem){//move if it exists
|
|
584
|
+
let iNewPosition = oItem.position;
|
|
585
|
+
if (oExistingItem) { //move if it exists
|
|
525
586
|
// do not reorder it in case it exists and no position is provided
|
|
526
|
-
iNewPosition = iNewPosition > -1
|
|
527
|
-
|
|
587
|
+
iNewPosition = iNewPosition > -1 ? iNewPosition : oExistingItem.position;
|
|
588
|
+
const iOldPosition = oExistingItem.position;
|
|
528
589
|
aNewItemsPrepared.splice(iNewPosition, 0, aNewItemsPrepared.splice(iOldPosition, 1)[0]);
|
|
529
|
-
} else {//add if it does not exist the item will be inserted at the end
|
|
590
|
+
} else { //add if it does not exist the item will be inserted at the end
|
|
530
591
|
iNewPosition = iNewPosition > -1 ? iNewPosition : aNewItemsPrepared.length;
|
|
531
592
|
aNewItemsPrepared.splice(iNewPosition, 0, oItem);
|
|
532
593
|
}
|
|
533
|
-
aNewItemsPrepared[iNewPosition] = oItem
|
|
534
|
-
} else if (oExistingItem) {//check if exists before delete
|
|
594
|
+
aNewItemsPrepared[iNewPosition] = oItem; //overwrite existing item with new item (for correct values such as 'descending')
|
|
595
|
+
} else if (oExistingItem) { //check if exists before delete
|
|
535
596
|
aNewItemsPrepared[oExistingItem.position][sRemoveProperty] = false;
|
|
536
597
|
}
|
|
537
|
-
}
|
|
598
|
+
});
|
|
538
599
|
|
|
539
600
|
return aNewItemsPrepared;
|
|
540
601
|
};
|
|
541
602
|
|
|
542
603
|
SelectionController.prototype.getPropertySetterChanges = function(mDeltaInfo) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
604
|
+
const oControl = mDeltaInfo.control;
|
|
605
|
+
const aExistingState = mDeltaInfo.existingState;
|
|
606
|
+
const aChangedState = mDeltaInfo.changedState;
|
|
607
|
+
const sOperation = mDeltaInfo.operation;
|
|
608
|
+
const sSetAttribute = mDeltaInfo.deltaAttribute;
|
|
548
609
|
|
|
549
|
-
|
|
610
|
+
const aSetterChanges = [];
|
|
550
611
|
|
|
551
|
-
aChangedState.forEach(
|
|
612
|
+
aChangedState.forEach((oItem) => {
|
|
552
613
|
//check if the provided state item holds the value to check for
|
|
553
614
|
if (oItem.hasOwnProperty(sSetAttribute)) {
|
|
554
|
-
|
|
615
|
+
const oExistingItem = aExistingState.find((oExisting) => {
|
|
616
|
+
return oExisting.name == oItem.name;
|
|
617
|
+
});
|
|
555
618
|
|
|
556
619
|
//compare to identify delta (only create a change if really necessary)
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
620
|
+
const vOldValue = oExistingItem && oExistingItem.hasOwnProperty(sSetAttribute) && oExistingItem[sSetAttribute];
|
|
621
|
+
const vNewValue = oItem[sSetAttribute];
|
|
622
|
+
const bValueChanged = vOldValue !== vNewValue;
|
|
560
623
|
if (bValueChanged) {
|
|
561
624
|
aSetterChanges.push(this._createAddRemoveChange(oControl, sOperation, {
|
|
562
625
|
[oItem.hasOwnProperty("key") ? "key" : "name"]: oItem.key || oItem.name,
|
|
@@ -565,18 +628,18 @@ sap.ui.define([
|
|
|
565
628
|
}));
|
|
566
629
|
}
|
|
567
630
|
}
|
|
568
|
-
}
|
|
631
|
+
});
|
|
569
632
|
|
|
570
633
|
return aSetterChanges;
|
|
571
634
|
};
|
|
572
635
|
|
|
573
636
|
SelectionController.prototype.changesToState = function(aChanges) {
|
|
574
637
|
|
|
575
|
-
|
|
638
|
+
const aState = [];
|
|
576
639
|
|
|
577
|
-
aChanges.forEach(
|
|
578
|
-
|
|
579
|
-
|
|
640
|
+
aChanges.forEach((oChange) => {
|
|
641
|
+
const oStateDiffContent = merge({}, oChange.changeSpecificData.content);
|
|
642
|
+
const iIndex = oStateDiffContent.index;
|
|
580
643
|
delete oStateDiffContent.index;
|
|
581
644
|
|
|
582
645
|
//set the position in case its explicitly provided and different to the current position
|
|
@@ -590,26 +653,28 @@ sap.ui.define([
|
|
|
590
653
|
}
|
|
591
654
|
|
|
592
655
|
aState.push(oStateDiffContent);
|
|
593
|
-
}
|
|
656
|
+
});
|
|
594
657
|
|
|
595
658
|
return aState;
|
|
596
659
|
};
|
|
597
660
|
|
|
598
661
|
SelectionController.prototype.prepareAdaptationData = function(oPropertyHelper, fnEnhace, bGroupData) {
|
|
599
662
|
|
|
600
|
-
|
|
601
|
-
|
|
663
|
+
const aItems = [];
|
|
664
|
+
const mItemsGrouped = bGroupData ? {} : null;
|
|
602
665
|
|
|
603
|
-
|
|
666
|
+
const bEnhance = fnEnhace instanceof Function;
|
|
604
667
|
|
|
605
|
-
|
|
668
|
+
const oControllerHelper = this.getMetadataHelper();
|
|
669
|
+
const oHelper = oControllerHelper ? oControllerHelper : oPropertyHelper;
|
|
670
|
+
oHelper.getProperties().forEach((oProperty) => {
|
|
606
671
|
|
|
607
|
-
|
|
672
|
+
const mItem = {};
|
|
608
673
|
mItem.key = oProperty.name || oProperty.key;
|
|
609
674
|
mItem.name = oProperty.name || oProperty.key;
|
|
610
675
|
|
|
611
676
|
if (bEnhance) {
|
|
612
|
-
|
|
677
|
+
const bIsValid = fnEnhace(mItem, oProperty);
|
|
613
678
|
if (!bIsValid) {
|
|
614
679
|
return;
|
|
615
680
|
}
|
|
@@ -629,7 +694,7 @@ sap.ui.define([
|
|
|
629
694
|
|
|
630
695
|
});
|
|
631
696
|
|
|
632
|
-
|
|
697
|
+
const oAdaptationData = {
|
|
633
698
|
items: aItems
|
|
634
699
|
};
|
|
635
700
|
|
|
@@ -643,33 +708,33 @@ sap.ui.define([
|
|
|
643
708
|
|
|
644
709
|
|
|
645
710
|
SelectionController.prototype._buildGroupStructure = function(mItemsGrouped) {
|
|
646
|
-
|
|
647
|
-
Object.keys(mItemsGrouped).forEach(
|
|
711
|
+
const aGroupedItems = [];
|
|
712
|
+
Object.keys(mItemsGrouped).forEach((sGroupKey) => {
|
|
648
713
|
this.sortP13nData("generic", mItemsGrouped[sGroupKey]);
|
|
649
714
|
aGroupedItems.push({
|
|
650
715
|
group: sGroupKey,
|
|
651
|
-
groupLabel: mItemsGrouped[sGroupKey][0].groupLabel ||
|
|
716
|
+
groupLabel: mItemsGrouped[sGroupKey][0].groupLabel || Library.getResourceBundleFor("sap.m").getText("p13n.BASIC_DEFAULT_GROUP"), //Grouplabel might not be necessarily be propagated to every item
|
|
652
717
|
groupVisible: true,
|
|
653
718
|
items: mItemsGrouped[sGroupKey]
|
|
654
719
|
});
|
|
655
|
-
}
|
|
720
|
+
});
|
|
656
721
|
return aGroupedItems;
|
|
657
722
|
|
|
658
723
|
};
|
|
659
724
|
|
|
660
|
-
SelectionController.prototype.sortP13nData =
|
|
725
|
+
SelectionController.prototype.sortP13nData = (oSorting, aItems) => {
|
|
661
726
|
|
|
662
|
-
|
|
727
|
+
const mP13nTypeSorting = oSorting;
|
|
663
728
|
|
|
664
|
-
|
|
665
|
-
|
|
729
|
+
const sPositionAttribute = mP13nTypeSorting.position;
|
|
730
|
+
const sSelectedAttribute = mP13nTypeSorting.visible;
|
|
666
731
|
|
|
667
|
-
|
|
732
|
+
const sLocale = new Locale(Localization.getLanguageTag()).toString();
|
|
668
733
|
|
|
669
|
-
|
|
734
|
+
const oCollator = window.Intl.Collator(sLocale, {});
|
|
670
735
|
|
|
671
736
|
// group selected / unselected --> sort alphabetically in each group
|
|
672
|
-
aItems.sort(
|
|
737
|
+
aItems.sort((mField1, mField2) => {
|
|
673
738
|
if (mField1[sSelectedAttribute] && mField2[sSelectedAttribute]) {
|
|
674
739
|
return (mField1[sPositionAttribute] || 0) - (mField2[sPositionAttribute] || 0);
|
|
675
740
|
} else if (mField1[sSelectedAttribute]) {
|
|
@@ -682,8 +747,8 @@ sap.ui.define([
|
|
|
682
747
|
});
|
|
683
748
|
};
|
|
684
749
|
|
|
685
|
-
SelectionController.prototype.arrayToMap =
|
|
686
|
-
return aArray.reduce(
|
|
750
|
+
SelectionController.prototype.arrayToMap = (aArray) => {
|
|
751
|
+
return aArray.reduce((mMap, oProp, iIndex) => {
|
|
687
752
|
mMap[oProp.key] = oProp;
|
|
688
753
|
mMap[oProp.key].position = iIndex;
|
|
689
754
|
return mMap;
|