@openui5/sap.ui.rta 1.108.2 → 1.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +16 -16
- package/THIRDPARTY.txt +2 -2
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +2 -2
- package/src/sap/ui/rta/Client.js +2 -2
- package/src/sap/ui/rta/RuntimeAuthoring.js +240 -191
- package/src/sap/ui/rta/Utils.js +40 -19
- package/src/sap/ui/rta/api/startAdaptation.js +1 -1
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
- package/src/sap/ui/rta/appVariant/Feature.js +2 -8
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
- package/src/sap/ui/rta/appVariant/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +2 -2
- package/src/sap/ui/rta/command/AddProperty.js +2 -2
- package/src/sap/ui/rta/command/AddXML.js +3 -3
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +3 -3
- package/src/sap/ui/rta/command/BaseCommand.js +2 -2
- package/src/sap/ui/rta/command/BindProperty.js +2 -2
- package/src/sap/ui/rta/command/Combine.js +2 -2
- package/src/sap/ui/rta/command/CommandFactory.js +2 -2
- package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +5 -3
- package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +15 -15
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +11 -4
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +42 -10
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +2 -2
- package/src/sap/ui/rta/command/FlexCommand.js +18 -16
- package/src/sap/ui/rta/command/LREPSerializer.js +27 -17
- package/src/sap/ui/rta/command/LocalReset.js +2 -2
- package/src/sap/ui/rta/command/Move.js +2 -2
- package/src/sap/ui/rta/command/Property.js +2 -2
- package/src/sap/ui/rta/command/Remove.js +2 -2
- package/src/sap/ui/rta/command/Rename.js +2 -2
- package/src/sap/ui/rta/command/Resize.js +2 -2
- package/src/sap/ui/rta/command/Reveal.js +2 -2
- package/src/sap/ui/rta/command/Settings.js +2 -2
- package/src/sap/ui/rta/command/Split.js +2 -2
- package/src/sap/ui/rta/command/Stack.js +11 -3
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -3
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +28 -6
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +2 -2
- package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +28 -19
- package/src/sap/ui/rta/library.js +3 -3
- package/src/sap/ui/rta/messagebundle.properties +65 -17
- package/src/sap/ui/rta/messagebundle_ar.properties +32 -8
- package/src/sap/ui/rta/messagebundle_bg.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ca.properties +32 -8
- package/src/sap/ui/rta/messagebundle_cs.properties +32 -8
- package/src/sap/ui/rta/messagebundle_cy.properties +31 -7
- package/src/sap/ui/rta/messagebundle_da.properties +31 -7
- package/src/sap/ui/rta/messagebundle_de.properties +31 -7
- package/src/sap/ui/rta/messagebundle_el.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_GB.properties +32 -8
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +31 -7
- package/src/sap/ui/rta/messagebundle_es.properties +31 -7
- package/src/sap/ui/rta/messagebundle_es_MX.properties +31 -7
- package/src/sap/ui/rta/messagebundle_et.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fi.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fr.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hi.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hr.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hu.properties +31 -7
- package/src/sap/ui/rta/messagebundle_id.properties +32 -8
- package/src/sap/ui/rta/messagebundle_it.properties +32 -8
- package/src/sap/ui/rta/messagebundle_iw.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ja.properties +32 -8
- package/src/sap/ui/rta/messagebundle_kk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ko.properties +31 -7
- package/src/sap/ui/rta/messagebundle_lt.properties +31 -7
- package/src/sap/ui/rta/messagebundle_lv.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ms.properties +32 -8
- package/src/sap/ui/rta/messagebundle_nl.properties +31 -7
- package/src/sap/ui/rta/messagebundle_no.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pl.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pt.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ro.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ru.properties +32 -8
- package/src/sap/ui/rta/messagebundle_sh.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sl.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sv.properties +32 -8
- package/src/sap/ui/rta/messagebundle_th.properties +33 -9
- package/src/sap/ui/rta/messagebundle_tr.properties +31 -7
- package/src/sap/ui/rta/messagebundle_uk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_vi.properties +32 -8
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +32 -8
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -8
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +2 -2
- package/src/sap/ui/rta/plugin/CompVariant.js +107 -29
- package/src/sap/ui/rta/plugin/ControlVariant.js +118 -50
- package/src/sap/ui/rta/plugin/CreateContainer.js +2 -2
- package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
- package/src/sap/ui/rta/plugin/DragDrop.js +4 -4
- package/src/sap/ui/rta/plugin/EasyAdd.js +30 -21
- package/src/sap/ui/rta/plugin/EasyRemove.js +13 -11
- package/src/sap/ui/rta/plugin/LocalReset.js +6 -4
- package/src/sap/ui/rta/plugin/Plugin.js +50 -13
- package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
- package/src/sap/ui/rta/plugin/Remove.js +2 -2
- package/src/sap/ui/rta/plugin/Rename.js +2 -2
- package/src/sap/ui/rta/plugin/RenameHandler.js +29 -19
- package/src/sap/ui/rta/plugin/Resize.js +2 -2
- package/src/sap/ui/rta/plugin/Selection.js +7 -14
- package/src/sap/ui/rta/plugin/Settings.js +2 -2
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +17 -16
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +28 -7
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +5 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +7 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +4 -4
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +2 -2
- package/src/sap/ui/rta/service/ControllerExtension.js +3 -3
- package/src/sap/ui/rta/service/Outline.js +2 -2
- package/src/sap/ui/rta/service/Property.js +2 -2
- package/src/sap/ui/rta/service/Receiver.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +2 -2
- package/src/sap/ui/rta/service/SupportTools.js +2 -2
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +26 -9
- package/src/sap/ui/rta/themes/base/library.source.less +1 -1
- package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +82 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +35 -90
- package/src/sap/ui/rta/toolbar/Adaptation.js +83 -27
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +4 -4
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +11 -10
- package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +263 -0
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +149 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +185 -0
- package/src/sap/ui/rta/toolbar/contextBased/{SaveAsContextBasedAdaptationDialog.fragment.xml → SaveAsAdaptationDialog.fragment.xml} +19 -15
- package/src/sap/ui/rta/toolbar/translation/Translation.js +2 -2
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +4 -4
- package/src/sap/ui/rta/util/Animation.js +5 -9
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +2 -2
- package/src/sap/ui/rta/util/PopupManager.js +2 -2
- package/src/sap/ui/rta/util/ReloadManager.js +2 -2
- package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
- package/src/sap/ui/rta/util/StylesLoader.js +1 -1
- package/src/sap/ui/rta/util/UrlParser.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +4 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +11 -10
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +28 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +110 -72
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +1 -1
- package/src/sap/ui/rta/util/showMessageBox.js +1 -1
- package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
- package/src/sap/ui/rta/util/validateStableIds.js +1 -1
- package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +0 -76
- package/src/sap/ui/rta/appContexts/Component.js +0 -31
- package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +0 -323
- package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +0 -22
- package/src/sap/ui/rta/appContexts/i18n/i18n.properties +0 -47
- package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +0 -23
- package/src/sap/ui/rta/appContexts/index.html +0 -25
- package/src/sap/ui/rta/appContexts/manifest.json +0 -52
- package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +0 -76
- package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +0 -103
- package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +0 -76
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +0 -124
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -14,10 +14,12 @@ sap.ui.define([
|
|
|
14
14
|
"sap/ui/dt/Util",
|
|
15
15
|
"sap/ui/fl/Utils",
|
|
16
16
|
"sap/ui/fl/Layer",
|
|
17
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
17
18
|
"sap/ui/fl/variants/VariantManagement",
|
|
18
19
|
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
19
20
|
"sap/ui/base/ManagedObject",
|
|
20
|
-
"sap/base/Log"
|
|
21
|
+
"sap/base/Log",
|
|
22
|
+
"sap/m/MessageBox"
|
|
21
23
|
], function(
|
|
22
24
|
Plugin,
|
|
23
25
|
RenameHandler,
|
|
@@ -28,10 +30,12 @@ sap.ui.define([
|
|
|
28
30
|
DtUtil,
|
|
29
31
|
flUtils,
|
|
30
32
|
Layer,
|
|
33
|
+
ControlVariantApplyAPI,
|
|
31
34
|
VariantManagement,
|
|
32
35
|
ContextSharingAPI,
|
|
33
36
|
ManagedObject,
|
|
34
|
-
Log
|
|
37
|
+
Log,
|
|
38
|
+
MessageBox
|
|
35
39
|
) {
|
|
36
40
|
"use strict";
|
|
37
41
|
|
|
@@ -43,7 +47,7 @@ sap.ui.define([
|
|
|
43
47
|
* @class The ControlVariant allows propagation of variantManagement key
|
|
44
48
|
* @extends sap.ui.rta.plugin.Plugin
|
|
45
49
|
* @author SAP SE
|
|
46
|
-
* @version 1.
|
|
50
|
+
* @version 1.110.0
|
|
47
51
|
* @constructor
|
|
48
52
|
* @private
|
|
49
53
|
* @since 1.50
|
|
@@ -75,6 +79,28 @@ sap.ui.define([
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
|
|
82
|
+
function getCommandForSave(oOverlay) {
|
|
83
|
+
var oElement = oOverlay.getElement();
|
|
84
|
+
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
85
|
+
var oModel = this._getVariantModel(oElement);
|
|
86
|
+
var sVariantManagementReference = oOverlay.getVariantManagement();
|
|
87
|
+
|
|
88
|
+
return this.getCommandFactory().getCommandFor(oElement, "save", {
|
|
89
|
+
model: oModel
|
|
90
|
+
}, oDesignTimeMetadata, sVariantManagementReference);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function getCommandForSwitch(oOverlay, sNewVariantReference, sCurrentVariantReference, bDiscardVariantContent) {
|
|
94
|
+
var oElement = oOverlay.getElement();
|
|
95
|
+
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
96
|
+
|
|
97
|
+
return this.getCommandFactory().getCommandFor(oElement, "switch", {
|
|
98
|
+
targetVariantReference: sNewVariantReference,
|
|
99
|
+
sourceVariantReference: sCurrentVariantReference,
|
|
100
|
+
discardVariantContent: bDiscardVariantContent
|
|
101
|
+
}, oDesignTimeMetadata);
|
|
102
|
+
}
|
|
103
|
+
|
|
78
104
|
/**
|
|
79
105
|
* Registers an overlay.
|
|
80
106
|
*
|
|
@@ -123,7 +149,7 @@ sap.ui.define([
|
|
|
123
149
|
}
|
|
124
150
|
};
|
|
125
151
|
|
|
126
|
-
ControlVariant.prototype._isPersonalizationMode = function
|
|
152
|
+
ControlVariant.prototype._isPersonalizationMode = function() {
|
|
127
153
|
return this.getCommandFactory().getFlexSettings().layer === Layer.USER;
|
|
128
154
|
};
|
|
129
155
|
|
|
@@ -180,7 +206,7 @@ sap.ui.define([
|
|
|
180
206
|
|
|
181
207
|
ControlVariant.prototype._getVariantModel = function(oElement) {
|
|
182
208
|
var oAppComponent = flUtils.getAppComponentForControl(oElement);
|
|
183
|
-
return oAppComponent ? oAppComponent.getModel(
|
|
209
|
+
return oAppComponent ? oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName()) : undefined;
|
|
184
210
|
};
|
|
185
211
|
|
|
186
212
|
/**
|
|
@@ -195,7 +221,7 @@ sap.ui.define([
|
|
|
195
221
|
return this._isVariantManagementControl(oOverlay) && this.hasStableId(oOverlay);
|
|
196
222
|
};
|
|
197
223
|
|
|
198
|
-
ControlVariant.prototype._isVariantManagementControl = function
|
|
224
|
+
ControlVariant.prototype._isVariantManagementControl = function(oOverlay) {
|
|
199
225
|
var oElement = oOverlay.getElement();
|
|
200
226
|
var vAssociationElement = oElement.getAssociation("for");
|
|
201
227
|
return !!(vAssociationElement && oElement instanceof VariantManagement);
|
|
@@ -207,7 +233,7 @@ sap.ui.define([
|
|
|
207
233
|
* @return {boolean} <code>true</code> if available
|
|
208
234
|
* @public
|
|
209
235
|
*/
|
|
210
|
-
ControlVariant.prototype.isVariantSwitchAvailable = function
|
|
236
|
+
ControlVariant.prototype.isVariantSwitchAvailable = function(oElementOverlay) {
|
|
211
237
|
return this._isVariantManagementControl(oElementOverlay);
|
|
212
238
|
};
|
|
213
239
|
|
|
@@ -217,7 +243,7 @@ sap.ui.define([
|
|
|
217
243
|
* @return {boolean} <code>true</code> if enabled
|
|
218
244
|
* @public
|
|
219
245
|
*/
|
|
220
|
-
ControlVariant.prototype.isVariantSwitchEnabled = function
|
|
246
|
+
ControlVariant.prototype.isVariantSwitchEnabled = function(aElementOverlays) {
|
|
221
247
|
var oElementOverlay = aElementOverlays[0];
|
|
222
248
|
var aVariants = [];
|
|
223
249
|
if (this._isVariantManagementControl(oElementOverlay)) {
|
|
@@ -244,7 +270,7 @@ sap.ui.define([
|
|
|
244
270
|
/**
|
|
245
271
|
* @override
|
|
246
272
|
*/
|
|
247
|
-
ControlVariant.prototype.setDesignTime = function
|
|
273
|
+
ControlVariant.prototype.setDesignTime = function(oDesignTime) {
|
|
248
274
|
RenameHandler._setDesignTime.call(this, oDesignTime);
|
|
249
275
|
};
|
|
250
276
|
|
|
@@ -255,7 +281,7 @@ sap.ui.define([
|
|
|
255
281
|
* @return {boolean} <code>true</code> if available
|
|
256
282
|
* @public
|
|
257
283
|
*/
|
|
258
|
-
ControlVariant.prototype.isRenameAvailable = function
|
|
284
|
+
ControlVariant.prototype.isRenameAvailable = function(oElementOverlay) {
|
|
259
285
|
return this._isVariantManagementControl(oElementOverlay);
|
|
260
286
|
};
|
|
261
287
|
|
|
@@ -265,7 +291,7 @@ sap.ui.define([
|
|
|
265
291
|
* @return {boolean} <code>true</code> if available
|
|
266
292
|
* @public
|
|
267
293
|
*/
|
|
268
|
-
ControlVariant.prototype.isRenameEnabled = function
|
|
294
|
+
ControlVariant.prototype.isRenameEnabled = function(aElementOverlays) {
|
|
269
295
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
270
296
|
};
|
|
271
297
|
|
|
@@ -275,7 +301,7 @@ sap.ui.define([
|
|
|
275
301
|
* @return {boolean} <code>true</code> if available
|
|
276
302
|
* @public
|
|
277
303
|
*/
|
|
278
|
-
ControlVariant.prototype.isVariantSaveAvailable = function
|
|
304
|
+
ControlVariant.prototype.isVariantSaveAvailable = function(oElementOverlay) {
|
|
279
305
|
return this._isVariantManagementControl(oElementOverlay);
|
|
280
306
|
};
|
|
281
307
|
|
|
@@ -285,7 +311,7 @@ sap.ui.define([
|
|
|
285
311
|
* @return {boolean} <code>true</code> if available
|
|
286
312
|
* @public
|
|
287
313
|
*/
|
|
288
|
-
ControlVariant.prototype.isVariantSaveEnabled = function
|
|
314
|
+
ControlVariant.prototype.isVariantSaveEnabled = function(aElementOverlays) {
|
|
289
315
|
var oOverlay = aElementOverlays[0];
|
|
290
316
|
var oElement = oOverlay.getElement();
|
|
291
317
|
var oModel = this._getVariantModel(oElement);
|
|
@@ -299,7 +325,7 @@ sap.ui.define([
|
|
|
299
325
|
* @return {boolean} <code>true</code> if available
|
|
300
326
|
* @public
|
|
301
327
|
*/
|
|
302
|
-
ControlVariant.prototype.isVariantSaveAsAvailable = function
|
|
328
|
+
ControlVariant.prototype.isVariantSaveAsAvailable = function(oElementOverlay) {
|
|
303
329
|
return this._isVariantManagementControl(oElementOverlay);
|
|
304
330
|
};
|
|
305
331
|
|
|
@@ -309,7 +335,7 @@ sap.ui.define([
|
|
|
309
335
|
* @return {boolean} <code>true</code> if available
|
|
310
336
|
* @public
|
|
311
337
|
*/
|
|
312
|
-
ControlVariant.prototype.isVariantSaveAsEnabled = function
|
|
338
|
+
ControlVariant.prototype.isVariantSaveAsEnabled = function(aElementOverlays) {
|
|
313
339
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
314
340
|
};
|
|
315
341
|
|
|
@@ -319,7 +345,7 @@ sap.ui.define([
|
|
|
319
345
|
* @return {boolean} <code>true</code> if available
|
|
320
346
|
* @public
|
|
321
347
|
*/
|
|
322
|
-
ControlVariant.prototype.isVariantConfigureAvailable = function
|
|
348
|
+
ControlVariant.prototype.isVariantConfigureAvailable = function(oElementOverlay) {
|
|
323
349
|
return this._isVariantManagementControl(oElementOverlay);
|
|
324
350
|
};
|
|
325
351
|
|
|
@@ -329,7 +355,7 @@ sap.ui.define([
|
|
|
329
355
|
* @return {boolean} <code>true</code> if available
|
|
330
356
|
* @public
|
|
331
357
|
*/
|
|
332
|
-
ControlVariant.prototype.isVariantConfigureEnabled = function
|
|
358
|
+
ControlVariant.prototype.isVariantConfigureEnabled = function(aElementOverlays) {
|
|
333
359
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
334
360
|
};
|
|
335
361
|
|
|
@@ -342,23 +368,72 @@ sap.ui.define([
|
|
|
342
368
|
* @public
|
|
343
369
|
*/
|
|
344
370
|
ControlVariant.prototype.switchVariant = function(oTargetOverlay, sNewVariantReference, sCurrentVariantReference) {
|
|
345
|
-
var oDesignTimeMetadata = oTargetOverlay.getDesignTimeMetadata();
|
|
346
371
|
var oTargetElement = oTargetOverlay.getElement();
|
|
372
|
+
var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
347
373
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
374
|
+
function onDirtySwitchWarningClose(sAction) {
|
|
375
|
+
if (sAction === MessageBox.Action.CANCEL) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
352
378
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
379
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE")) {
|
|
380
|
+
var oCompositeCommand;
|
|
381
|
+
this.getCommandFactory().getCommandFor(oTargetElement, "composite")
|
|
382
|
+
.then(function(_oCompositeCommand) {
|
|
383
|
+
oCompositeCommand = _oCompositeCommand;
|
|
384
|
+
return getCommandForSave.call(this, oTargetOverlay);
|
|
385
|
+
}.bind(this))
|
|
386
|
+
.then(function(oSaveCommand) {
|
|
387
|
+
oCompositeCommand.addCommand(oSaveCommand);
|
|
388
|
+
return getCommandForSwitch.call(this, oTargetOverlay, sNewVariantReference, sCurrentVariantReference);
|
|
389
|
+
}.bind(this))
|
|
390
|
+
.then(function(oSwitchCommand) {
|
|
391
|
+
oCompositeCommand.addCommand(oSwitchCommand);
|
|
392
|
+
this.fireElementModified({
|
|
393
|
+
command: oCompositeCommand
|
|
394
|
+
});
|
|
395
|
+
}.bind(this));
|
|
396
|
+
}
|
|
358
397
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
398
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD")) {
|
|
399
|
+
getCommandForSwitch.call(
|
|
400
|
+
this,
|
|
401
|
+
oTargetOverlay,
|
|
402
|
+
sNewVariantReference,
|
|
403
|
+
sCurrentVariantReference,
|
|
404
|
+
true // discard variant content
|
|
405
|
+
)
|
|
406
|
+
.then(function(oSwitchCommand) {
|
|
407
|
+
this.fireElementModified({
|
|
408
|
+
command: oSwitchCommand
|
|
409
|
+
});
|
|
410
|
+
}.bind(this));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (oTargetElement.getModified()) {
|
|
415
|
+
MessageBox.warning(oLibraryBundle.getText("MSG_CHANGE_MODIFIED_VARIANT"), {
|
|
416
|
+
onClose: onDirtySwitchWarningClose.bind(this),
|
|
417
|
+
actions: [
|
|
418
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
419
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD"),
|
|
420
|
+
MessageBox.Action.CANCEL
|
|
421
|
+
],
|
|
422
|
+
emphasizedAction: oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
423
|
+
styleClass: Utils.getRtaStyleClassName()
|
|
424
|
+
});
|
|
425
|
+
} else {
|
|
426
|
+
getCommandForSwitch.call(this, oTargetOverlay, sNewVariantReference, sCurrentVariantReference)
|
|
427
|
+
.then(function(oSwitchCommand) {
|
|
428
|
+
this.fireElementModified({
|
|
429
|
+
command: oSwitchCommand
|
|
430
|
+
});
|
|
431
|
+
}.bind(this))
|
|
432
|
+
|
|
433
|
+
.catch(function(oMessage) {
|
|
434
|
+
throw DtUtil.createError("ControlVariant#switchVariant", oMessage, "sap.ui.rta");
|
|
435
|
+
});
|
|
436
|
+
}
|
|
362
437
|
};
|
|
363
438
|
|
|
364
439
|
/**
|
|
@@ -366,7 +441,7 @@ sap.ui.define([
|
|
|
366
441
|
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
367
442
|
* @public
|
|
368
443
|
*/
|
|
369
|
-
ControlVariant.prototype.renameVariant = function
|
|
444
|
+
ControlVariant.prototype.renameVariant = function(aElementOverlays) {
|
|
370
445
|
this.startEdit(aElementOverlays[0]);
|
|
371
446
|
};
|
|
372
447
|
|
|
@@ -379,20 +454,13 @@ sap.ui.define([
|
|
|
379
454
|
});
|
|
380
455
|
};
|
|
381
456
|
|
|
382
|
-
ControlVariant.prototype.stopEdit = function
|
|
457
|
+
ControlVariant.prototype.stopEdit = function(bRestoreFocus) {
|
|
383
458
|
RenameHandler._stopEdit.call(this, bRestoreFocus, "plugin.ControlVariant.stopEdit");
|
|
384
459
|
};
|
|
385
460
|
|
|
386
|
-
ControlVariant.prototype.createSaveCommand = function
|
|
461
|
+
ControlVariant.prototype.createSaveCommand = function(aElementOverlays) {
|
|
387
462
|
var oOverlay = aElementOverlays[0];
|
|
388
|
-
|
|
389
|
-
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
390
|
-
var oModel = this._getVariantModel(oElement);
|
|
391
|
-
var sVariantManagementReference = oOverlay.getVariantManagement();
|
|
392
|
-
|
|
393
|
-
return this.getCommandFactory().getCommandFor(oElement, "save", {
|
|
394
|
-
model: oModel
|
|
395
|
-
}, oDesignTimeMetadata, sVariantManagementReference)
|
|
463
|
+
return getCommandForSave.call(this, oOverlay)
|
|
396
464
|
.then(function(oSaveCommand) {
|
|
397
465
|
this.fireElementModified({
|
|
398
466
|
command: oSaveCommand
|
|
@@ -400,7 +468,7 @@ sap.ui.define([
|
|
|
400
468
|
}.bind(this));
|
|
401
469
|
};
|
|
402
470
|
|
|
403
|
-
ControlVariant.prototype.createSaveAsCommand = function
|
|
471
|
+
ControlVariant.prototype.createSaveAsCommand = function(aElementOverlays) {
|
|
404
472
|
var oOverlay = aElementOverlays[0];
|
|
405
473
|
var oElement = oOverlay.getElement();
|
|
406
474
|
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
@@ -450,7 +518,7 @@ sap.ui.define([
|
|
|
450
518
|
* @returns {object} setTitle command
|
|
451
519
|
* @private
|
|
452
520
|
*/
|
|
453
|
-
ControlVariant.prototype._createSetTitleCommand = function
|
|
521
|
+
ControlVariant.prototype._createSetTitleCommand = function(mPropertyBag) {
|
|
454
522
|
this._$oEditableControlDomRef.text(mPropertyBag.text);
|
|
455
523
|
|
|
456
524
|
return this.getCommandFactory().getCommandFor(mPropertyBag.element, "setTitle", {
|
|
@@ -468,15 +536,15 @@ sap.ui.define([
|
|
|
468
536
|
* @param {string} sValueStateText value state text that needs to be set
|
|
469
537
|
* @private
|
|
470
538
|
*/
|
|
471
|
-
ControlVariant.prototype._prepareOverlayForValueState = function
|
|
539
|
+
ControlVariant.prototype._prepareOverlayForValueState = function(oOverlay, sValueStateText) {
|
|
472
540
|
//Prepare VariantManagement control overlay for valueStateMessage
|
|
473
|
-
oOverlay.getValueState = function
|
|
541
|
+
oOverlay.getValueState = function() {
|
|
474
542
|
return "Error";
|
|
475
543
|
};
|
|
476
|
-
oOverlay.getValueStateText = function
|
|
544
|
+
oOverlay.getValueStateText = function() {
|
|
477
545
|
return sValueStateText;
|
|
478
546
|
};
|
|
479
|
-
oOverlay.getDomRefForValueStateMessage = function
|
|
547
|
+
oOverlay.getDomRefForValueStateMessage = function() {
|
|
480
548
|
return this.$();
|
|
481
549
|
};
|
|
482
550
|
};
|
|
@@ -487,7 +555,7 @@ sap.ui.define([
|
|
|
487
555
|
* @returns {Promise} Resolving when the dialog is closed and the command is created
|
|
488
556
|
* @public
|
|
489
557
|
*/
|
|
490
|
-
ControlVariant.prototype.configureVariants = function
|
|
558
|
+
ControlVariant.prototype.configureVariants = function(aElementOverlays) {
|
|
491
559
|
var oElementOverlay = aElementOverlays[0];
|
|
492
560
|
var oVariantManagementControl = oElementOverlay.getElement();
|
|
493
561
|
var sVariantManagementReference = oElementOverlay.getVariantManagement();
|
|
@@ -536,7 +604,7 @@ sap.ui.define([
|
|
|
536
604
|
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
537
605
|
* @return {object[]} - array containing the items with required data
|
|
538
606
|
*/
|
|
539
|
-
ControlVariant.prototype.getMenuItems = function
|
|
607
|
+
ControlVariant.prototype.getMenuItems = function(aElementOverlays) {
|
|
540
608
|
var oElementOverlay = aElementOverlays[0];
|
|
541
609
|
var aMenuItems = [];
|
|
542
610
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The CreateContainer allows trigger CreateContainer operations on the overlay
|
|
26
26
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.110.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ function(
|
|
|
31
31
|
* @extends sap.ui.dt.plugin.CutPaste
|
|
32
32
|
*
|
|
33
33
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
34
|
+
* @version 1.110.0
|
|
35
35
|
*
|
|
36
36
|
* @constructor
|
|
37
37
|
* @private
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ function(
|
|
|
33
33
|
* @extends sap.ui.dt.plugin.ControlDragDrop
|
|
34
34
|
*
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.110.0
|
|
37
37
|
*
|
|
38
38
|
* @constructor
|
|
39
39
|
* @private
|
|
@@ -121,7 +121,7 @@ function(
|
|
|
121
121
|
oOverlay.setSelected(false);
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
oOverlay
|
|
124
|
+
oOverlay.getDomRef().classList.add("sapUiRtaOverlayPlaceholder");
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
/**
|
|
@@ -138,7 +138,7 @@ function(
|
|
|
138
138
|
command: oCommand
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
-
oOverlay
|
|
141
|
+
oOverlay.getDomRef().classList.remove("sapUiRtaOverlayPlaceholder");
|
|
142
142
|
oOverlay.setSelected(true);
|
|
143
143
|
oOverlay.focus();
|
|
144
144
|
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin",
|
|
9
9
|
"sap/ui/dt/OverlayRegistry",
|
|
10
|
-
"sap/m/Button"
|
|
11
|
-
"sap/ui/thirdparty/jquery"
|
|
10
|
+
"sap/m/Button"
|
|
12
11
|
], function(
|
|
13
12
|
AdditionalElementsPlugin,
|
|
14
13
|
OverlayRegistry,
|
|
15
|
-
Button
|
|
16
|
-
jQuery
|
|
14
|
+
Button
|
|
17
15
|
) {
|
|
18
16
|
"use strict";
|
|
19
17
|
|
|
@@ -25,7 +23,7 @@ sap.ui.define([
|
|
|
25
23
|
* @class The EasyAdd Plugin adds an Icon to an Overlay, which allows to trigger add operations directly
|
|
26
24
|
* @extends sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin
|
|
27
25
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
26
|
+
* @version 1.110.0
|
|
29
27
|
* @constructor
|
|
30
28
|
* @private
|
|
31
29
|
* @since 1.48
|
|
@@ -54,7 +52,9 @@ sap.ui.define([
|
|
|
54
52
|
oControl.addStyleClass("sapUiRtaMarginBottom");
|
|
55
53
|
} else if (oControl.getMetadata().getName() === "sap.uxap.ObjectPageLayout" && this.hasStableId(oOverlay)) {
|
|
56
54
|
oOverlay.addStyleClass("sapUiRtaPersAddTop");
|
|
57
|
-
oControl
|
|
55
|
+
oControl.getDomRef().querySelectorAll("[id*='sectionsContainer']").forEach(function(oNode) {
|
|
56
|
+
oNode.classList.add("sapUiRtaPaddingTop");
|
|
57
|
+
});
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
var onAddPressed = function(bOverlayIsSibling, oOverlay, iIndex) {
|
|
@@ -82,14 +82,16 @@ sap.ui.define([
|
|
|
82
82
|
}.bind(this);
|
|
83
83
|
|
|
84
84
|
if (oOverlay.hasStyleClass("sapUiRtaPersAdd")) {
|
|
85
|
-
var
|
|
85
|
+
var aChildren = Array.from(oOverlay.getDomRef().querySelectorAll(":scope > .sapUiRtaPersAddIconOuter"));
|
|
86
|
+
var bAddButton = oOverlay.hasStyleClass("sapUiRtaPersAdd") && aChildren.length === 0;
|
|
86
87
|
if (bAddButton) {
|
|
87
|
-
fnAddButton(oOverlay, oOverlay
|
|
88
|
+
fnAddButton(oOverlay, oOverlay.getDomRef(), true, oOverlay.getDesignTimeMetadata().getName().singular);
|
|
88
89
|
}
|
|
89
90
|
} else if (oOverlay.hasStyleClass("sapUiRtaPersAddTop")) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
var aChildren = Array.from(oOverlay.getAggregationOverlay("sections").getDomRef().querySelectorAll(":scope > .sapUiRtaPersAddIconOuter"));
|
|
92
|
+
if (aChildren.length === 0) {
|
|
93
|
+
var oSectionsOverlayDOM = oOverlay.getAggregationOverlay("sections").getDomRef();
|
|
94
|
+
fnAddButton(oOverlay, oSectionsOverlayDOM, false, oOverlay.getDesignTimeMetadata().getAggregation("sections").childNames.singular, 0);
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -112,7 +114,9 @@ sap.ui.define([
|
|
|
112
114
|
oControl.removeStyleClass("sapUiRtaMarginBottom");
|
|
113
115
|
} else if (oControl.getMetadata().getName() === "sap.uxap.ObjectPageLayout") {
|
|
114
116
|
oOverlay.removeStyleClass("sapUiRtaPersAddTop");
|
|
115
|
-
oControl
|
|
117
|
+
oControl.getDomRef().querySelectorAll("[id*='sectionsContainer']").forEach(function(oNode) {
|
|
118
|
+
oNode.classList.remove("sapUiRtaPaddingTop");
|
|
119
|
+
});
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
AdditionalElementsPlugin.prototype.deregisterElementOverlay.apply(this, arguments);
|
|
@@ -133,7 +137,9 @@ sap.ui.define([
|
|
|
133
137
|
if (bIsLayout) {
|
|
134
138
|
var oLayout = oOverlay.getElement();
|
|
135
139
|
oLayout.attachEventOnce("onAfterRenderingDOMReady", function() {
|
|
136
|
-
oLayout
|
|
140
|
+
oLayout.getDomRef().querySelectorAll("[id*='sectionsContainer']").forEach(function(oNode) {
|
|
141
|
+
oNode.classList.add("sapUiRtaPaddingTop");
|
|
142
|
+
});
|
|
137
143
|
});
|
|
138
144
|
}
|
|
139
145
|
}
|
|
@@ -154,18 +160,21 @@ sap.ui.define([
|
|
|
154
160
|
var oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
155
161
|
|
|
156
162
|
var sId = oOverlay.getId() + "-AddButton";
|
|
157
|
-
var oHtmlButtonOuter =
|
|
163
|
+
var oHtmlButtonOuter = document.createElement("div");
|
|
164
|
+
oHtmlButtonOuter.classList.add("sapUiRtaPersAddIconOuter");
|
|
165
|
+
oHtmlButtonOuter.setAttribute("draggable", "true");
|
|
166
|
+
oHtmlButtonOuter.setAttribute("tabindex", -1);
|
|
158
167
|
oOverlay._oAddButton = new Button(sId, {
|
|
159
168
|
text: oTextResources.getText("CTX_ADD_ELEMENTS", sControlName),
|
|
160
169
|
icon: "sap-icon://add",
|
|
161
170
|
enabled: bIsEditable
|
|
162
171
|
})
|
|
163
|
-
.placeAt(oHtmlButtonOuter
|
|
172
|
+
.placeAt(oHtmlButtonOuter)
|
|
164
173
|
.attachBrowserEvent('click', fnCallback)
|
|
165
174
|
.attachBrowserEvent('tap', fnCallback);
|
|
166
175
|
oOverlayDom.append(oHtmlButtonOuter);
|
|
167
176
|
|
|
168
|
-
oHtmlButtonOuter
|
|
177
|
+
oHtmlButtonOuter.addEventListener("mouseover", function(oEvent) {
|
|
169
178
|
oEvent.stopPropagation();
|
|
170
179
|
var oOverlay = oEvent.fromElement ? OverlayRegistry.getOverlay(oEvent.fromElement.id) : null;
|
|
171
180
|
if (oOverlay && oOverlay.getMetadata().getName() === "sap.ui.dt.ElementOverlay") {
|
|
@@ -174,7 +183,7 @@ sap.ui.define([
|
|
|
174
183
|
}
|
|
175
184
|
});
|
|
176
185
|
|
|
177
|
-
oHtmlButtonOuter
|
|
186
|
+
oHtmlButtonOuter.addEventListener("mouseleave", function(oEvent) {
|
|
178
187
|
oEvent.stopPropagation();
|
|
179
188
|
var oOverlay = oEvent.toElement ? OverlayRegistry.getOverlay(oEvent.toElement.id) : null;
|
|
180
189
|
if (oOverlay && oOverlay.getMetadata().getName() === "sap.ui.dt.ElementOverlay") {
|
|
@@ -185,16 +194,16 @@ sap.ui.define([
|
|
|
185
194
|
}
|
|
186
195
|
});
|
|
187
196
|
|
|
188
|
-
oHtmlButtonOuter
|
|
197
|
+
oHtmlButtonOuter.addEventListener("click", function(oEvent) {
|
|
189
198
|
oEvent.stopPropagation();
|
|
190
199
|
});
|
|
191
200
|
|
|
192
|
-
oHtmlButtonOuter
|
|
201
|
+
oHtmlButtonOuter.addEventListener("contextmenu", function(oEvent) {
|
|
193
202
|
oEvent.stopPropagation();
|
|
194
203
|
oEvent.preventDefault();
|
|
195
204
|
});
|
|
196
205
|
|
|
197
|
-
oHtmlButtonOuter
|
|
206
|
+
oHtmlButtonOuter.addEventListener("dragstart", function(oEvent) {
|
|
198
207
|
oEvent.stopPropagation();
|
|
199
208
|
oEvent.preventDefault();
|
|
200
209
|
});
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/rta/plugin/Remove",
|
|
9
|
-
"sap/m/Button"
|
|
10
|
-
"sap/ui/thirdparty/jquery"
|
|
9
|
+
"sap/m/Button"
|
|
11
10
|
], function(
|
|
12
11
|
Remove,
|
|
13
|
-
Button
|
|
14
|
-
jQuery
|
|
12
|
+
Button
|
|
15
13
|
) {
|
|
16
14
|
"use strict";
|
|
17
15
|
|
|
@@ -23,7 +21,7 @@ sap.ui.define([
|
|
|
23
21
|
* @class The EasyRemove Plugin adds an Icon to an Overlay, which allows to trigger remove operations directly
|
|
24
22
|
* @extends sap.ui.rta.plugin.Remove
|
|
25
23
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
24
|
+
* @version 1.110.0
|
|
27
25
|
* @constructor
|
|
28
26
|
* @private
|
|
29
27
|
* @since 1.48
|
|
@@ -51,6 +49,7 @@ sap.ui.define([
|
|
|
51
49
|
oOverlay.addStyleClass("sapUiRtaPersDelete");
|
|
52
50
|
}
|
|
53
51
|
|
|
52
|
+
//TODO: check this, this makes no sense; length is always 0
|
|
54
53
|
if (oOverlay.hasStyleClass("sapUiRtaPersDelete") && oOverlay.$().children(".sapUiRtaPersDeleteClick").length <= 0) {
|
|
55
54
|
var onDeletePressed = function(oOverlay) {
|
|
56
55
|
this.handler([oOverlay]);
|
|
@@ -93,18 +92,21 @@ sap.ui.define([
|
|
|
93
92
|
EasyRemove.prototype._addButton = function(oOverlay) {
|
|
94
93
|
var bEnabled = this.isEnabled([oOverlay]);
|
|
95
94
|
var sId = oOverlay.getId() + "-DeleteIcon";
|
|
96
|
-
var oHtmlIconWrapper =
|
|
97
|
-
|
|
95
|
+
var oHtmlIconWrapper = document.createElement("div");
|
|
96
|
+
oHtmlIconWrapper.classList.add("sapUiRtaPersDeleteClick");
|
|
97
|
+
oHtmlIconWrapper.setAttribute("draggable", "true");
|
|
98
|
+
var oHtmlIconOuter = document.createElement("div");
|
|
99
|
+
oHtmlIconOuter.classList.add("sapUiRtaPersDeleteIconOuter");
|
|
98
100
|
|
|
99
101
|
oOverlay._oDeleteButton = new Button(sId, {
|
|
100
102
|
icon: "sap-icon://less",
|
|
101
103
|
tooltip: sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta").getText("CTX_REMOVE"),
|
|
102
104
|
enabled: bEnabled
|
|
103
|
-
}).placeAt(oHtmlIconOuter
|
|
105
|
+
}).placeAt(oHtmlIconOuter);
|
|
104
106
|
oHtmlIconWrapper.append(oHtmlIconOuter);
|
|
105
|
-
oOverlay
|
|
107
|
+
oOverlay.getDomRef().append(oHtmlIconWrapper);
|
|
106
108
|
|
|
107
|
-
oHtmlIconWrapper
|
|
109
|
+
oHtmlIconWrapper.addEventListener("dragstart", function(oEvent) {
|
|
108
110
|
oEvent.stopPropagation();
|
|
109
111
|
oEvent.preventDefault();
|
|
110
112
|
});
|