@sapui5/sap.fe.core 1.100.0 → 1.102.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/package.json +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
1
2
|
import Log from "sap/base/Log";
|
|
2
|
-
import
|
|
3
|
-
import Synchronization from "sap/fe/core/Synchronization";
|
|
4
|
-
import URI from "sap/ui/thirdparty/URI";
|
|
3
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
4
|
+
import Synchronization from "sap/fe/core/helpers/Synchronization";
|
|
5
5
|
import { IShellServices } from "sap/fe/core/services/ShellServicesFactory";
|
|
6
|
+
import BaseObject from "sap/ui/base/Object";
|
|
7
|
+
import Core from "sap/ui/core/Core";
|
|
6
8
|
import Router from "sap/ui/core/routing/Router";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
+
import URI from "sap/ui/thirdparty/URI";
|
|
10
|
+
import { CoreEx } from "types/extension_types";
|
|
9
11
|
|
|
10
12
|
const enumState = {
|
|
11
13
|
EQUAL: 0,
|
|
@@ -27,7 +29,7 @@ const enumURLParams = {
|
|
|
27
29
|
function createGuardFromHash(sGuardHash: string) {
|
|
28
30
|
return {
|
|
29
31
|
_guardHash: sGuardHash.replace(/\?[^\?]*$/, ""), // Remove query part
|
|
30
|
-
check: function(sHash: any) {
|
|
32
|
+
check: function (sHash: any) {
|
|
31
33
|
return sHash.indexOf(this._guardHash) === 0;
|
|
32
34
|
}
|
|
33
35
|
};
|
|
@@ -77,7 +79,7 @@ function setAppStateInHash(sHash: any, sAppStateKey: any) {
|
|
|
77
79
|
return sNewHash;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
@
|
|
82
|
+
@defineUI5Class("sap.fe.core.RouterProxy")
|
|
81
83
|
class RouterProxy extends BaseObject {
|
|
82
84
|
bIsRebuildHistoryRunning = false;
|
|
83
85
|
bIsComputingTitleHierachy = false;
|
|
@@ -89,7 +91,6 @@ class RouterProxy extends BaseObject {
|
|
|
89
91
|
_fnHashGuard!: Function;
|
|
90
92
|
_bDisableOnHashChange!: boolean;
|
|
91
93
|
_bIgnoreRestore!: boolean;
|
|
92
|
-
_bCleanedRestore!: boolean;
|
|
93
94
|
_bForceFocus!: boolean;
|
|
94
95
|
_oRouter!: Router;
|
|
95
96
|
_oManagedHistory!: any[];
|
|
@@ -99,6 +100,7 @@ class RouterProxy extends BaseObject {
|
|
|
99
100
|
_bActivateRouteMatchSynchro: boolean = false;
|
|
100
101
|
_bApplyRestore: boolean = false;
|
|
101
102
|
_bDelayedRebuild: boolean = false;
|
|
103
|
+
_pathMappings: { oldPath: string; newPath: string }[] = [];
|
|
102
104
|
|
|
103
105
|
init(oAppComponent: any, isfclEnabled: boolean) {
|
|
104
106
|
// Save the name of the app (including startup parameters) for rebuilding full hashes later
|
|
@@ -127,14 +129,13 @@ class RouterProxy extends BaseObject {
|
|
|
127
129
|
this._fnBlockingNavFilter = this._blockingNavigationFilter.bind(this);
|
|
128
130
|
this._oShellServices.registerNavigationFilter(this._fnBlockingNavFilter);
|
|
129
131
|
})
|
|
130
|
-
.catch(function(oError: any) {
|
|
132
|
+
.catch(function (oError: any) {
|
|
131
133
|
Log.error("Cannot retrieve the shell services", oError);
|
|
132
134
|
});
|
|
133
135
|
this._fnHashGuard = this.hashGuard.bind(this);
|
|
134
136
|
window.addEventListener("popstate", this._fnHashGuard as any);
|
|
135
137
|
this._bDisableOnHashChange = false;
|
|
136
138
|
this._bIgnoreRestore = false;
|
|
137
|
-
this._bCleanedRestore = false;
|
|
138
139
|
this._bForceFocus = true; // Trigger the focus mechanism for the first view displayed by the app
|
|
139
140
|
}
|
|
140
141
|
|
|
@@ -207,7 +208,7 @@ class RouterProxy extends BaseObject {
|
|
|
207
208
|
bDisablePreservationCache?: boolean,
|
|
208
209
|
bForceFocus?: boolean,
|
|
209
210
|
bPreserveShellBackNavigationHandler?: boolean
|
|
210
|
-
) {
|
|
211
|
+
): Promise<boolean> {
|
|
211
212
|
if (bPreserveShellBackNavigationHandler !== false) {
|
|
212
213
|
this._oShellServices.setBackNavigation();
|
|
213
214
|
}
|
|
@@ -224,7 +225,7 @@ class RouterProxy extends BaseObject {
|
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
|
|
227
|
-
_internalNavToHash(sHash: any, bPreserveHistory: any, bDisablePreservationCache: any, bForceFocus?: boolean) {
|
|
228
|
+
_internalNavToHash(sHash: any, bPreserveHistory: any, bDisablePreservationCache: any, bForceFocus?: boolean): Promise<boolean> {
|
|
228
229
|
// Add the app state in the hash if needed
|
|
229
230
|
if (this.fclEnabled && this.sIAppStateKey && !findAppStateInHash(sHash)) {
|
|
230
231
|
sHash = setAppStateInHash(sHash, this.sIAppStateKey);
|
|
@@ -232,7 +233,7 @@ class RouterProxy extends BaseObject {
|
|
|
232
233
|
|
|
233
234
|
if (!this.checkHashWithGuard(sHash)) {
|
|
234
235
|
if (!this.oResourceBundle) {
|
|
235
|
-
this.oResourceBundle =
|
|
236
|
+
this.oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
// We have to use a confirm here for UI consistency reasons, as with some scenarios
|
|
@@ -254,7 +255,7 @@ class RouterProxy extends BaseObject {
|
|
|
254
255
|
this._bForceFocus =
|
|
255
256
|
bForceFocus ||
|
|
256
257
|
(aCurrentHashKeys.length < oNewState.keys.length &&
|
|
257
|
-
aCurrentHashKeys.every(function(key: any, index: any) {
|
|
258
|
+
aCurrentHashKeys.every(function (key: any, index: any) {
|
|
258
259
|
return key === oNewState.keys[index];
|
|
259
260
|
}));
|
|
260
261
|
}
|
|
@@ -363,9 +364,11 @@ class RouterProxy extends BaseObject {
|
|
|
363
364
|
* Sets the last state as a guard.
|
|
364
365
|
* Each future navigation will be checked against this guard, and a confirmation dialog will
|
|
365
366
|
* be displayed before the navigation crosses the guard (i.e. goes to an ancestor of the guard).
|
|
367
|
+
*
|
|
368
|
+
* @param sHash The hash for the guard
|
|
366
369
|
*/
|
|
367
|
-
setNavigationGuard() {
|
|
368
|
-
this._oNavigationGuard = createGuardFromHash(
|
|
370
|
+
setNavigationGuard(sHash: string) {
|
|
371
|
+
this._oNavigationGuard = createGuardFromHash(sHash);
|
|
369
372
|
this.bIsGuardCrossAllowed = false;
|
|
370
373
|
}
|
|
371
374
|
|
|
@@ -438,7 +441,7 @@ class RouterProxy extends BaseObject {
|
|
|
438
441
|
const aTokens = sHashNoParams.split("/");
|
|
439
442
|
const aKeys: any[] = [];
|
|
440
443
|
|
|
441
|
-
aTokens.forEach(function(sToken: any) {
|
|
444
|
+
aTokens.forEach(function (sToken: any) {
|
|
442
445
|
const regexKey = /[^\(\)]+\([^\(\)]+\)/; // abc(def)
|
|
443
446
|
if (regexKey.test(sToken)) {
|
|
444
447
|
aKeys.push(sToken.split("(")[0]);
|
|
@@ -630,10 +633,10 @@ class RouterProxy extends BaseObject {
|
|
|
630
633
|
* @ui5-restricted
|
|
631
634
|
* @final
|
|
632
635
|
*/
|
|
633
|
-
_rebuildBrowserHistory(oHistoryAction: any, bRebuildOnly: boolean) {
|
|
636
|
+
_rebuildBrowserHistory(oHistoryAction: any, bRebuildOnly: boolean): Promise<boolean> {
|
|
634
637
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
635
638
|
const that = this;
|
|
636
|
-
return new Promise(resolve => {
|
|
639
|
+
return new Promise((resolve) => {
|
|
637
640
|
this.bIsRebuildHistoryRunning = true;
|
|
638
641
|
const oTargetState = this._oManagedHistory[this._oManagedHistory.length - 1],
|
|
639
642
|
newLevel = this._oManagedHistory.length - 1;
|
|
@@ -647,7 +650,7 @@ class RouterProxy extends BaseObject {
|
|
|
647
650
|
history.replaceState(Object.assign({ feLevel: newLevel }, history.state), "");
|
|
648
651
|
|
|
649
652
|
if (bRebuildOnly) {
|
|
650
|
-
setTimeout(function() {
|
|
653
|
+
setTimeout(function () {
|
|
651
654
|
// Timeout to let 'hashchange' event be processed before by the HashChanger, so that
|
|
652
655
|
// onRouteMatched notification isn't raised
|
|
653
656
|
that._enableEventOnHashChange(true);
|
|
@@ -661,7 +664,7 @@ class RouterProxy extends BaseObject {
|
|
|
661
664
|
// Async callbacks when navigating back, in order to let all notifications and events get processed
|
|
662
665
|
function backReplaceAsync() {
|
|
663
666
|
window.removeEventListener("popstate", backReplaceAsync);
|
|
664
|
-
setTimeout(function() {
|
|
667
|
+
setTimeout(function () {
|
|
665
668
|
// Timeout to let 'hashchange' event be processed before by the HashChanger
|
|
666
669
|
replaceAsync();
|
|
667
670
|
}, 0);
|
|
@@ -713,25 +716,38 @@ class RouterProxy extends BaseObject {
|
|
|
713
716
|
return this._oManagedHistory[this._oManagedHistory.length - 1];
|
|
714
717
|
}
|
|
715
718
|
|
|
719
|
+
setPathMapping(mappings: { oldPath: string; newPath: string }[]) {
|
|
720
|
+
this._pathMappings = mappings.filter((mapping) => {
|
|
721
|
+
return mapping.oldPath !== mapping.newPath;
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
716
725
|
hashGuard() {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
return;
|
|
720
|
-
}
|
|
721
|
-
const sHash = window.location.hash;
|
|
726
|
+
let sHash = window.location.hash;
|
|
727
|
+
|
|
722
728
|
if (sHash.indexOf("restoreHistory=true") !== -1) {
|
|
723
729
|
this._bApplyRestore = true;
|
|
724
730
|
} else if (!this.bIsRebuildHistoryRunning) {
|
|
725
|
-
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
731
|
+
// Check if the hash needs to be changed (this happens in FCL when switching b/w edit and read-only with 3 columns open)
|
|
732
|
+
const mapping = this._pathMappings.find((m) => {
|
|
733
|
+
return sHash.indexOf(m.oldPath) >= 0;
|
|
734
|
+
});
|
|
735
|
+
if (mapping) {
|
|
736
|
+
// Replace the current hash
|
|
737
|
+
sHash = sHash.replace(mapping.oldPath, mapping.newPath);
|
|
738
|
+
history.replaceState(Object.assign({}, history.state), "", sHash);
|
|
739
|
+
} else {
|
|
740
|
+
const aHashSplit = sHash.split("&/");
|
|
741
|
+
const sAppHash = aHashSplit[1] ? aHashSplit[1] : "";
|
|
742
|
+
if (this.checkHashWithGuard(sAppHash)) {
|
|
743
|
+
this._bDelayedRebuild = true;
|
|
744
|
+
const oNewState = this._extractStateFromHash(sAppHash);
|
|
745
|
+
this._pushNewState(oNewState, false, false, true);
|
|
746
|
+
|
|
747
|
+
setTimeout(() => {
|
|
748
|
+
this._bDelayedRebuild = false;
|
|
749
|
+
}, 0);
|
|
750
|
+
}
|
|
735
751
|
}
|
|
736
752
|
}
|
|
737
753
|
}
|
|
@@ -18,27 +18,27 @@
|
|
|
18
18
|
Property: 'sap/fe/core/templating/PropertyFormatters'
|
|
19
19
|
}"
|
|
20
20
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
<form:SimpleForm binding="{$Parameter}">
|
|
22
|
+
<template:repeat list="{action>$Parameter}" var="parameter">
|
|
23
|
+
<template:with path="parameter>" helper="COMMON.gotoActionParameter" var="actionParameter">
|
|
24
|
+
<!-- In case of bound actions the first parameter shall be ignored -->
|
|
25
|
+
<template:if test="{= !${action>$IsBound} || ${parameter>$Name} !== ${action>$Parameter/0/$Name} }">
|
|
26
|
+
<Label
|
|
27
27
|
unittest:id="ActionParameterDialogLabelExpressionTest"
|
|
28
28
|
text="{= ${actionParameter>@com.sap.vocabularies.Common.v1.Label} ? ${actionParameter>@com.sap.vocabularies.Common.v1.Label} : ${parameter>$Name}}"
|
|
29
29
|
/>
|
|
30
|
-
|
|
30
|
+
<!-- TODOs:
|
|
31
31
|
edit mode, can there be also field control?
|
|
32
32
|
value help
|
|
33
33
|
additional value? (= text annotation)
|
|
34
34
|
text arrangement?
|
|
35
35
|
multipleLines?
|
|
36
36
|
-->
|
|
37
|
-
|
|
37
|
+
<!-- TODO: use new value helper -->
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
<template:if test="{= !${parameter>$isCollection} }">
|
|
40
40
|
<template:then>
|
|
41
|
-
|
|
41
|
+
<!--The payload of FieldBaseDelegate is used to control the fallback feature 'retrieveTextFromValueList' -->
|
|
42
42
|
<mdc:Field
|
|
43
43
|
delegate="{name:'sap/fe/macros/FieldBaseDelegate', payload:{retrieveTextFromValueList:true}}"
|
|
44
44
|
unittest:id="ActionParameterDialogFieldExpressionTest"
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
required="{= FIELD.isRequired(${actionParameter>@@FIELD.fieldControl}, 'Editable')}"
|
|
52
52
|
change="{= '.handleChange($event, \'' + ${parameter>$Name} + '\')' }"
|
|
53
53
|
fieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"
|
|
54
|
-
visible="{actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility}"
|
|
54
|
+
visible="{= (${actionParameter>$Name} === 'ResultIsActiveEntity') ? false : ${actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility} }"
|
|
55
55
|
>
|
|
56
|
-
|
|
56
|
+
<core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" />
|
|
57
57
|
</mdc:Field>
|
|
58
58
|
</template:then>
|
|
59
59
|
<template:else>
|
|
@@ -70,13 +70,16 @@
|
|
|
70
70
|
fieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"
|
|
71
71
|
visible="{actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility}"
|
|
72
72
|
>
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
<mdcField:MultiValueFieldItem
|
|
74
|
+
key="{path: 'mvfview>Key', type:'sap.ui.model.type.String'}"
|
|
75
|
+
description="{mvfview>Desc}"
|
|
76
|
+
/>
|
|
77
|
+
<core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" />
|
|
75
78
|
</mdc:MultiValueField>
|
|
76
79
|
</template:else>
|
|
77
|
-
</template:if>
|
|
78
80
|
</template:if>
|
|
79
|
-
</template:
|
|
80
|
-
</template:
|
|
81
|
-
</
|
|
81
|
+
</template:if>
|
|
82
|
+
</template:with>
|
|
83
|
+
</template:repeat>
|
|
84
|
+
</form:SimpleForm>
|
|
82
85
|
</core:FragmentDefinition>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["sap/ui/base/ManagedObject"], function (ManagedObject) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @class
|
|
10
|
+
* A custom element to evaluate the value of Binding.
|
|
11
|
+
*
|
|
12
|
+
* @name sap.fe.core.controls.Any
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
*/
|
|
15
|
+
var Any = ManagedObject.extend("sap.fe.core.controls.Any", {
|
|
16
|
+
metadata: {
|
|
17
|
+
properties: {
|
|
18
|
+
any: "any"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
updateProperty: function () {
|
|
22
|
+
// Avoid Promise processing in ManagedObject and set Promise as value directly
|
|
23
|
+
this.setAny(this.getBindingInfo("any").binding.getExternalValue());
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return Any;
|
|
27
|
+
}, false);
|
|
28
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFueS50cyJdLCJuYW1lcyI6WyJBbnkiLCJNYW5hZ2VkT2JqZWN0IiwiZXh0ZW5kIiwibWV0YWRhdGEiLCJwcm9wZXJ0aWVzIiwiYW55IiwidXBkYXRlUHJvcGVydHkiLCJzZXRBbnkiLCJnZXRCaW5kaW5nSW5mbyIsImJpbmRpbmciLCJnZXRFeHRlcm5hbFZhbHVlIl0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7O0FBUUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFNQSxHQUFHLEdBQUdDLGFBQWEsQ0F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m9wZXJ0aWVzOiB7XG5cdFx0XHRhbnk6IFwiYW55XCJcblx0XHR9XG5cdH0sXG5cdHVwZGF0ZVByb3BlcnR5OiBmdW5jdGlvbiAodGhpczogQW55VHlwZSkge1xuXHRcdC8vIEF2b2lkIFByb21pc2UgcHJvY2Vzc2luZyBpbiBNYW5hZ2VkT2JqZWN0IGFuZCBzZXQgUHJvbWlzZSBhcyB2YWx1ZSBkaXJlY3RseVxuXHRcdHRoaXMuc2V0QW55KCh0aGlzLmdldEJpbmRpbmdJbmZvKFwiYW55XCIpIGFzIGFueSkuYmluZGluZy5nZXRFeHRlcm5hbFZhbHVlKCkpO1xuXHR9XG59KTtcblxuZXhwb3J0IGRlZmF1bHQgQW55IGFzIGFueTtcbiJdfQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ManagedObject from "sap/ui/base/ManagedObject";
|
|
2
|
+
|
|
3
|
+
export type AnyType = ManagedObject & {
|
|
4
|
+
mBindingInfos: object;
|
|
5
|
+
getAny(): any;
|
|
6
|
+
setAny(value: any): void;
|
|
7
|
+
getBindingInfo(property: string): object;
|
|
8
|
+
extend(sName: string, sExtension: any): AnyType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @class
|
|
13
|
+
* A custom element to evaluate the value of Binding.
|
|
14
|
+
*
|
|
15
|
+
* @name sap.fe.core.controls.Any
|
|
16
|
+
* @hideconstructor
|
|
17
|
+
*/
|
|
18
|
+
const Any = ManagedObject.extend("sap.fe.core.controls.Any", {
|
|
19
|
+
metadata: {
|
|
20
|
+
properties: {
|
|
21
|
+
any: "any"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
updateProperty: function (this: AnyType) {
|
|
25
|
+
// Avoid Promise processing in ManagedObject and set Promise as value directly
|
|
26
|
+
this.setAny((this.getBindingInfo("any") as any).binding.getExternalValue());
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default Any as any;
|
|
@@ -2,13 +2,32 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/ui/core/CommandExecution", "sap/
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/fe/core/helpers/ClassSupport", "sap/ui/core/CommandExecution", "sap/ui/core/Component", "sap/ui/core/Element", "sap/ui/core/Shortcut"], function (Log, ClassSupport, CommandExecution, Component, Element, Shortcut) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var _dec, _class;
|
|
9
|
+
|
|
10
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
11
|
+
|
|
12
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
16
|
+
var CustomCommandExecution = (_dec = defineUI5Class("sap.fe.core.controls.CommandExecution"), _dec(_class = /*#__PURE__*/function (_CommandExecution) {
|
|
17
|
+
_inheritsLoose(CustomCommandExecution, _CommandExecution);
|
|
18
|
+
|
|
19
|
+
function CustomCommandExecution() {
|
|
20
|
+
return _CommandExecution.apply(this, arguments) || this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _proto = CustomCommandExecution.prototype;
|
|
24
|
+
|
|
25
|
+
_proto.setParent = function setParent(oParent) {
|
|
26
|
+
var aExcludedSingleKey = ["escape"]; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
|
|
29
|
+
_CommandExecution.prototype.setParent.call(this, oParent);
|
|
30
|
+
|
|
12
31
|
var aCommands = oParent.data("sap.ui.core.Shortcut");
|
|
13
32
|
|
|
14
33
|
if (Array.isArray(aCommands) && aCommands.length > 0) {
|
|
@@ -39,8 +58,9 @@ sap.ui.define(["sap/ui/core/CommandExecution", "sap/base/Log", "sap/ui/core/Elem
|
|
|
39
58
|
|
|
40
59
|
return this;
|
|
41
60
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_proto.destroy = function destroy(bSuppressInvalidate) {
|
|
44
64
|
var oParent = this.getParent();
|
|
45
65
|
|
|
46
66
|
if (oParent) {
|
|
@@ -54,19 +74,33 @@ sap.ui.define(["sap/ui/core/CommandExecution", "sap/base/Log", "sap/ui/core/Elem
|
|
|
54
74
|
}
|
|
55
75
|
|
|
56
76
|
Element.prototype.destroy.apply(this, [bSuppressInvalidate]);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
_proto.setVisible = function setVisible(bValue) {
|
|
80
|
+
var oCommand,
|
|
81
|
+
oParentControl = this.getParent(),
|
|
82
|
+
oComponent = Component.getOwnerComponentFor(this.getParent());
|
|
83
|
+
|
|
84
|
+
while (!oComponent && oParentControl && oParentControl.getParent()) {
|
|
85
|
+
oComponent = Component.getOwnerComponentFor(oParentControl);
|
|
86
|
+
oParentControl = oParentControl.getParent();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (oComponent) {
|
|
90
|
+
oCommand = oComponent.getCommand(this.getCommand());
|
|
91
|
+
}
|
|
62
92
|
|
|
63
93
|
if (oCommand) {
|
|
64
|
-
|
|
94
|
+
_CommandExecution.prototype.setVisible.call(this, bValue);
|
|
65
95
|
} else {
|
|
66
96
|
Log.info("There is no shortcut definition registered in the manifest for the command : " + this.getCommand());
|
|
67
97
|
}
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
|
|
99
|
+
return this;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return CustomCommandExecution;
|
|
103
|
+
}(CommandExecution)) || _class);
|
|
70
104
|
return CustomCommandExecution;
|
|
71
105
|
}, false);
|
|
72
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
106
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbW1hbmRFeGVjdXRpb24udHMiXSwibmFtZXMiOlsiQ3VzdG9tQ29tbWFuZEV4ZWN1dGlvbiIsImRlZmluZVVJNUNsYXNzIiwic2V0UGFyZW50Iiwib1BhcmVudCIsImFFeGNsdWRlZFNpbmdsZUtleSIsImFDb21tYW5kcyIsImRhdGEiLCJBcnJheSIsImlzQXJyYXkiLCJsZW5ndGgiLCJvQ29tbWFuZCIsIm9TaG9ydGN1dCIsInNob3J0Y3V0U3BlYyIsImluZGV4T2YiLCJrZXkiLCJhZGREZWxlZ2F0ZSIsIm9FdmVudCIsInRvTG93ZXJDYXNlIiwic0VsZW1lbnQiLCJ0YXJnZXQiLCJ0YWdOYW1lIiwidW5kZWZpbmVkIiwic2V0TWFya2VkIiwiZGVzdHJveSIsImJTdXBwcmVzc0ludmFsaWRhdGUiLCJnZXRQYXJlbnQiLCJfZ2V0Q29tbWFuZEluZm8iLCJTaG9ydGN1dCIsInVucmVnaXN0ZXIiLCJzaG9ydGN1dCIsIl9jbGVhbnVwQ29udGV4dCIsIkVsZW1lbnQiLCJwcm90b3R5cGUiLCJhcHBseSIsInNldFZpc2libGUiLCJiVmFsdWUiLCJvUGFyZW50Q29udHJvbCIsIm9Db21wb25lbnQiLCJDb21wb25lbnQiLCJnZXRPd25lckNvbXBvbmVudEZvciIsImdldENvbW1hbmQiLCJMb2ciLCJpbmZvIiwiQ29tbWFuZEV4ZWN1dGlvbiJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7O01BTU1BLHNCLFdBREx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kZWZpbml0aW9uIHJlZ2lzdGVyZWQgaW4gdGhlIG1hbmlmZXN0IGZvciB0aGUgY29tbWFuZCA6IFwiICsgdGhpcy5nZXRDb21tYW5kKCkpO1xuXHRcdH1cblx0XHRyZXR1cm4gdGhpcztcblx0fVxufVxuaW50ZXJmYWNlIEN1c3RvbUNvbW1hbmRFeGVjdXRpb24ge1xuXHRfZ2V0Q29tbWFuZEluZm8oKTogYW55O1xuXHRfY2xlYW51cENvbnRleHQob1BhcmVudDogYW55KTogdm9pZDtcbn1cbmV4cG9ydCBkZWZhdWx0IEN1c3RvbUNvbW1hbmRFeGVjdXRpb247XG4iXX0=
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import CommandExecution from "sap/ui/core/CommandExecution";
|
|
2
1
|
import Log from "sap/base/Log";
|
|
2
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
3
|
+
import CommandExecution from "sap/ui/core/CommandExecution";
|
|
4
|
+
import Component from "sap/ui/core/Component";
|
|
3
5
|
import Element from "sap/ui/core/Element";
|
|
4
6
|
import Shortcut from "sap/ui/core/Shortcut";
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_cleanupContext(oParent: any): void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.CommandExecution", {
|
|
13
|
-
setParent: function(oParent: any) {
|
|
8
|
+
@defineUI5Class("sap.fe.core.controls.CommandExecution")
|
|
9
|
+
class CustomCommandExecution extends CommandExecution {
|
|
10
|
+
setParent(oParent: any) {
|
|
14
11
|
const aExcludedSingleKey = ["escape"];
|
|
15
|
-
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
super.setParent(oParent);
|
|
16
15
|
const aCommands = oParent.data("sap.ui.core.Shortcut");
|
|
17
16
|
if (Array.isArray(aCommands) && aCommands.length > 0) {
|
|
18
17
|
const oCommand = oParent.data("sap.ui.core.Shortcut")[aCommands.length - 1],
|
|
@@ -27,7 +26,7 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
27
26
|
// Need to disable ShortCut when user press single shortcut key into an input
|
|
28
27
|
oParent.addDelegate(
|
|
29
28
|
{
|
|
30
|
-
"onkeydown": function(oEvent: any) {
|
|
29
|
+
"onkeydown": function (oEvent: any) {
|
|
31
30
|
if (aExcludedSingleKey.indexOf(oEvent.key.toLowerCase()) > -1) {
|
|
32
31
|
const sElement = oEvent.target ? oEvent.target.tagName.toLowerCase() : undefined;
|
|
33
32
|
if (sElement === "input") {
|
|
@@ -43,9 +42,9 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
43
42
|
}
|
|
44
43
|
return this;
|
|
45
44
|
}
|
|
46
|
-
}
|
|
45
|
+
}
|
|
47
46
|
|
|
48
|
-
destroy
|
|
47
|
+
destroy(bSuppressInvalidate: boolean) {
|
|
49
48
|
const oParent = this.getParent();
|
|
50
49
|
if (oParent) {
|
|
51
50
|
const oCommand = this._getCommandInfo();
|
|
@@ -55,18 +54,28 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
55
54
|
this._cleanupContext(oParent);
|
|
56
55
|
}
|
|
57
56
|
Element.prototype.destroy.apply(this, [bSuppressInvalidate]);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
}
|
|
58
|
+
setVisible(bValue: boolean) {
|
|
59
|
+
let oCommand,
|
|
60
|
+
oParentControl = this.getParent(),
|
|
61
|
+
oComponent: any = Component.getOwnerComponentFor(this.getParent());
|
|
62
|
+
while (!oComponent && oParentControl && oParentControl.getParent()) {
|
|
63
|
+
oComponent = Component.getOwnerComponentFor(oParentControl);
|
|
64
|
+
oParentControl = oParentControl.getParent();
|
|
65
|
+
}
|
|
66
|
+
if (oComponent) {
|
|
67
|
+
oCommand = oComponent.getCommand(this.getCommand());
|
|
68
|
+
}
|
|
64
69
|
if (oCommand) {
|
|
65
|
-
|
|
70
|
+
super.setVisible(bValue);
|
|
66
71
|
} else {
|
|
67
72
|
Log.info("There is no shortcut definition registered in the manifest for the command : " + this.getCommand());
|
|
68
73
|
}
|
|
74
|
+
return this;
|
|
69
75
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
76
|
+
}
|
|
77
|
+
interface CustomCommandExecution {
|
|
78
|
+
_getCommandInfo(): any;
|
|
79
|
+
_cleanupContext(oParent: any): void;
|
|
80
|
+
}
|
|
72
81
|
export default CustomCommandExecution;
|