@sapui5/sap.fe.core 1.99.0 → 1.101.1
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 +6 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AnnotationHelper.js +43 -92
- package/src/sap/fe/core/AnnotationHelper.ts +43 -107
- package/src/sap/fe/core/AppComponent.js +381 -399
- package/src/sap/fe/core/AppComponent.ts +397 -0
- package/src/sap/fe/core/AppStateHandler.js +131 -162
- package/src/sap/fe/core/AppStateHandler.ts +2 -2
- package/src/sap/fe/core/BaseController.js +82 -58
- package/src/sap/fe/core/BaseController.ts +67 -0
- package/src/sap/fe/core/CommonUtils.js +179 -31
- package/src/sap/fe/core/CommonUtils.ts +295 -125
- package/src/sap/fe/core/ExtensionAPI.js +279 -274
- package/src/sap/fe/core/ExtensionAPI.ts +242 -0
- package/src/sap/fe/core/PageController.js +158 -29
- package/src/sap/fe/core/PageController.ts +65 -37
- package/src/sap/fe/core/RouterProxy.js +700 -750
- package/src/sap/fe/core/RouterProxy.ts +47 -31
- package/src/sap/fe/core/Synchronization.js +21 -31
- package/src/sap/fe/core/TemplateComponent.js +193 -118
- package/src/sap/fe/core/TemplateComponent.ts +104 -109
- package/src/sap/fe/core/TemplateModel.js +24 -44
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/TransactionHelper.js +1368 -1369
- package/src/sap/fe/core/TransactionHelper.ts +201 -171
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +324 -220
- package/src/sap/fe/core/actions/draft.ts +209 -133
- package/src/sap/fe/core/actions/messageHandling.js +79 -48
- package/src/sap/fe/core/actions/messageHandling.ts +113 -83
- package/src/sap/fe/core/actions/operations.js +37 -18
- package/src/sap/fe/core/actions/operations.ts +51 -20
- package/src/sap/fe/core/actions/sticky.js +17 -4
- package/src/sap/fe/core/actions/sticky.ts +21 -4
- 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 +707 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -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/controllerextensions/EditFlow.js +1854 -1669
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +716 -779
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1056 -1005
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -532
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +221 -244
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
- package/src/sap/fe/core/controllerextensions/PageReady.ts +57 -53
- package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
- package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
- package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +230 -268
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +68 -68
- package/src/sap/fe/core/controllerextensions/ViewState.js +774 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- 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 +92 -68
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +165 -79
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +167 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +163 -122
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +212 -141
- package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
- package/src/sap/fe/core/controls/FileWrapper.js +313 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
- package/src/sap/fe/core/controls/FilterBar.js +197 -159
- package/src/sap/fe/core/controls/FilterBar.ts +148 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +100 -39
- package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +147 -115
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +300 -265
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +185 -140
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +75 -74
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -379
- package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
- package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -2
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
- package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
- package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
- package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
- package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
- package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
- package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
- package/src/sap/fe/core/converters/controls/Common/Form.js +6 -6
- package/src/sap/fe/core/converters/controls/Common/Form.ts +7 -3
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +326 -86
- package/src/sap/fe/core/converters/controls/Common/Table.ts +384 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +120 -55
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +158 -98
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +206 -223
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +263 -287
- 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 +5 -2
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- 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 +51 -27
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +42 -25
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +91 -65
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- 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 +53 -2
- package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
- 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 +80 -55
- package/src/sap/fe/core/fpm/Component.ts +43 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
- package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
- package/src/sap/fe/core/helpers/ClassSupport.js +307 -166
- package/src/sap/fe/core/helpers/ClassSupport.ts +348 -155
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js +735 -684
- package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +53 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +46 -0
- 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 +7 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +7 -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 +1 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
- 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 +425 -451
- package/src/sap/fe/core/library.support.js +22 -33
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -4
- package/src/sap/fe/core/messagebundle.properties +45 -13
- package/src/sap/fe/core/messagebundle_ar.properties +29 -7
- package/src/sap/fe/core/messagebundle_bg.properties +29 -7
- package/src/sap/fe/core/messagebundle_ca.properties +29 -7
- package/src/sap/fe/core/messagebundle_cs.properties +29 -7
- package/src/sap/fe/core/messagebundle_cy.properties +29 -7
- package/src/sap/fe/core/messagebundle_da.properties +29 -7
- package/src/sap/fe/core/messagebundle_de.properties +29 -7
- package/src/sap/fe/core/messagebundle_el.properties +29 -7
- package/src/sap/fe/core/messagebundle_en.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +29 -7
- package/src/sap/fe/core/messagebundle_es.properties +29 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +29 -7
- package/src/sap/fe/core/messagebundle_et.properties +29 -7
- package/src/sap/fe/core/messagebundle_fi.properties +30 -8
- package/src/sap/fe/core/messagebundle_fr.properties +31 -9
- package/src/sap/fe/core/messagebundle_fr_CA.properties +31 -9
- package/src/sap/fe/core/messagebundle_hi.properties +29 -7
- package/src/sap/fe/core/messagebundle_hr.properties +29 -7
- package/src/sap/fe/core/messagebundle_hu.properties +29 -7
- package/src/sap/fe/core/messagebundle_id.properties +29 -7
- package/src/sap/fe/core/messagebundle_it.properties +29 -7
- package/src/sap/fe/core/messagebundle_iw.properties +29 -7
- package/src/sap/fe/core/messagebundle_ja.properties +28 -6
- package/src/sap/fe/core/messagebundle_kk.properties +29 -7
- package/src/sap/fe/core/messagebundle_ko.properties +29 -7
- package/src/sap/fe/core/messagebundle_lt.properties +29 -7
- package/src/sap/fe/core/messagebundle_lv.properties +30 -8
- package/src/sap/fe/core/messagebundle_ms.properties +29 -7
- package/src/sap/fe/core/messagebundle_nl.properties +29 -7
- package/src/sap/fe/core/messagebundle_no.properties +29 -7
- package/src/sap/fe/core/messagebundle_pl.properties +29 -7
- package/src/sap/fe/core/messagebundle_pt.properties +30 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +29 -7
- package/src/sap/fe/core/messagebundle_ro.properties +29 -7
- package/src/sap/fe/core/messagebundle_ru.properties +29 -7
- package/src/sap/fe/core/messagebundle_sh.properties +29 -7
- package/src/sap/fe/core/messagebundle_sk.properties +29 -7
- package/src/sap/fe/core/messagebundle_sl.properties +29 -7
- package/src/sap/fe/core/messagebundle_sv.properties +30 -8
- package/src/sap/fe/core/messagebundle_th.properties +28 -6
- package/src/sap/fe/core/messagebundle_tr.properties +32 -10
- package/src/sap/fe/core/messagebundle_uk.properties +29 -7
- package/src/sap/fe/core/messagebundle_vi.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +29 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +158 -196
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +5 -6
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +287 -342
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +11 -14
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +70 -105
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +6 -3
- package/src/sap/fe/core/services/RoutingServiceFactory.js +796 -820
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +62 -53
- package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
- package/src/sap/fe/core/services/ShellServicesFactory.ts +33 -33
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +570 -595
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +23 -4
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +357 -389
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +25 -29
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +7 -4
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -4
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
- package/src/sap/fe/core/templating/FilterHelper.js +25 -32
- package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
- package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
- package/src/sap/fe/core/templating/UIFormatters.js +150 -44
- package/src/sap/fe/core/templating/UIFormatters.ts +165 -67
- 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/controllerextensions/ControllerExtensionMetadata.js +0 -75
|
@@ -1,243 +1,436 @@
|
|
|
1
|
-
import
|
|
1
|
+
import merge from "sap/base/util/merge";
|
|
2
2
|
import ObjectPath from "sap/base/util/ObjectPath";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
import uid from "sap/base/util/uid";
|
|
4
|
+
import UI5Event from "sap/ui/base/Event";
|
|
5
|
+
import Metadata from "sap/ui/base/Metadata";
|
|
6
|
+
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
|
|
7
|
+
import ControllerMetadata from "sap/ui/core/mvc/ControllerMetadata";
|
|
8
|
+
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
9
|
+
|
|
10
|
+
type OverrideDefinition = Record<string, Function>;
|
|
11
|
+
type UI5ControllerMethodDefinition = {
|
|
12
|
+
overrideExecution?: OverrideExecution;
|
|
13
|
+
public?: boolean;
|
|
14
|
+
final?: boolean;
|
|
15
|
+
};
|
|
16
|
+
type UI5PropertyMetadata = {
|
|
17
|
+
type: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
group?: string;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
};
|
|
22
|
+
type UI5AggregationMetadata = {
|
|
23
|
+
type: string;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
isDefault?: boolean;
|
|
26
|
+
singularName?: string;
|
|
27
|
+
visibility?: string;
|
|
28
|
+
};
|
|
29
|
+
type UI5AssociationMetadata = {
|
|
30
|
+
type: string;
|
|
31
|
+
multiple?: boolean;
|
|
32
|
+
singularName?: string;
|
|
33
|
+
};
|
|
34
|
+
type UI5ControlMetadataDefinition = {
|
|
35
|
+
defaultAggregation?: string;
|
|
36
|
+
controllerExtensions: Record<string, typeof ControllerExtension | Function>;
|
|
37
|
+
properties: Record<string, UI5PropertyMetadata>;
|
|
38
|
+
macroContexts: Record<string, UI5PropertyMetadata>;
|
|
39
|
+
aggregations: Record<string, UI5AggregationMetadata>;
|
|
40
|
+
associations: Record<string, UI5AssociationMetadata>;
|
|
41
|
+
methods: Record<string, UI5ControllerMethodDefinition>;
|
|
42
|
+
events: Record<string, {}>;
|
|
43
|
+
interfaces: string[];
|
|
44
|
+
};
|
|
45
|
+
type UI5Controller = {
|
|
46
|
+
override?: { extension?: Record<string, OverrideDefinition> } & {
|
|
47
|
+
[k: string]: Function;
|
|
48
|
+
};
|
|
49
|
+
metadata?: UI5ControlMetadataDefinition;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type UI5Control = {
|
|
53
|
+
metadata?: UI5ControlMetadataDefinition;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type UI5APIControl = UI5Control & {
|
|
57
|
+
getAPI(event: UI5Event): UI5APIControl;
|
|
58
|
+
[k: string]: Function;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type ControlPropertyNames<T> = {
|
|
62
|
+
[K in keyof T]: T[K] extends Function ? never : K;
|
|
63
|
+
}[keyof T];
|
|
64
|
+
export type PropertiesOf<T> = Partial<Pick<T, ControlPropertyNames<T>>>;
|
|
65
|
+
export type EnhanceWithUI5<T> = T & {
|
|
66
|
+
// Add all the getXXX method, might add too much as i'm not filtering on actual properties actually...
|
|
67
|
+
[P in keyof T as `get${Capitalize<string & P>}`]: () => T[P];
|
|
68
|
+
};
|
|
69
|
+
const ensureMetadata = function (target: UI5Controller) {
|
|
70
|
+
target.metadata = merge(
|
|
71
|
+
{
|
|
72
|
+
controllerExtensions: {},
|
|
73
|
+
properties: {},
|
|
74
|
+
macroContexts: {},
|
|
75
|
+
aggregations: {},
|
|
76
|
+
associations: {},
|
|
77
|
+
methods: {},
|
|
78
|
+
events: {},
|
|
79
|
+
interfaces: []
|
|
80
|
+
},
|
|
81
|
+
target.metadata || {}
|
|
82
|
+
) as UI5ControlMetadataDefinition;
|
|
20
83
|
return target.metadata;
|
|
21
84
|
};
|
|
22
|
-
|
|
23
|
-
|
|
85
|
+
|
|
86
|
+
/* #region CONTROLLER EXTENSIONS */
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Defines that the following method is an override for the method name with the same name in the specific controller extension or base implementation.
|
|
90
|
+
*
|
|
91
|
+
* @param extensionName The name of the extension that will be overriden
|
|
92
|
+
* @returns The decorated method
|
|
93
|
+
*/
|
|
94
|
+
export function methodOverride(extensionName?: string): MethodDecorator {
|
|
95
|
+
return function (target: UI5Controller, propertyKey) {
|
|
24
96
|
if (!target.override) {
|
|
25
97
|
target.override = {};
|
|
26
98
|
}
|
|
27
99
|
let currentTarget = target.override;
|
|
28
|
-
if (
|
|
100
|
+
if (extensionName) {
|
|
29
101
|
if (!currentTarget.extension) {
|
|
30
102
|
currentTarget.extension = {};
|
|
31
103
|
}
|
|
32
|
-
if (!currentTarget.extension[
|
|
33
|
-
currentTarget.extension[
|
|
104
|
+
if (!currentTarget.extension[extensionName]) {
|
|
105
|
+
currentTarget.extension[extensionName] = {};
|
|
34
106
|
}
|
|
35
|
-
currentTarget = currentTarget.extension[
|
|
107
|
+
currentTarget = currentTarget.extension[extensionName];
|
|
36
108
|
}
|
|
37
|
-
currentTarget[propertyKey] = target[propertyKey];
|
|
109
|
+
currentTarget[propertyKey.toString()] = (target as any)[propertyKey.toString()];
|
|
38
110
|
};
|
|
39
111
|
}
|
|
40
|
-
|
|
41
|
-
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Defines that the method can be extended by other controller extension based on the defined overrideExecutionType.
|
|
115
|
+
*
|
|
116
|
+
* @param overrideExecutionType The OverrideExecution defining when the override should run (Before / After / Instead)
|
|
117
|
+
* @returns The decorated method
|
|
118
|
+
*/
|
|
119
|
+
export function extensible(overrideExecutionType?: OverrideExecution): MethodDecorator {
|
|
120
|
+
return function (target: UI5Controller, propertyKey) {
|
|
42
121
|
const metadata = ensureMetadata(target);
|
|
43
|
-
if (!metadata.methods[propertyKey]) {
|
|
44
|
-
metadata.methods[propertyKey] = {};
|
|
122
|
+
if (!metadata.methods[propertyKey.toString()]) {
|
|
123
|
+
metadata.methods[propertyKey.toString()] = {};
|
|
45
124
|
}
|
|
46
|
-
metadata.methods[propertyKey].overrideExecution =
|
|
125
|
+
metadata.methods[propertyKey.toString()].overrideExecution = overrideExecutionType;
|
|
47
126
|
};
|
|
48
127
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Defines that the method will be publicly available for controller extension usage.
|
|
131
|
+
*
|
|
132
|
+
* @returns The decorated method
|
|
133
|
+
*/
|
|
134
|
+
export function publicExtension(): MethodDecorator {
|
|
135
|
+
return function (target: UI5Controller, propertyKey, descriptor): void {
|
|
136
|
+
const metadata = ensureMetadata(target);
|
|
137
|
+
descriptor.enumerable = true;
|
|
138
|
+
if (!metadata.methods[propertyKey.toString()]) {
|
|
139
|
+
metadata.methods[propertyKey.toString()] = {};
|
|
140
|
+
}
|
|
141
|
+
metadata.methods[propertyKey.toString()].public = true;
|
|
142
|
+
};
|
|
55
143
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Defines that the method will be only available for internal usage of the controller extension.
|
|
146
|
+
*
|
|
147
|
+
* @returns The decorated method
|
|
148
|
+
*/
|
|
149
|
+
export function privateExtension(): MethodDecorator {
|
|
150
|
+
return function (target: UI5Controller, propertyKey, descriptor) {
|
|
151
|
+
const metadata = ensureMetadata(target);
|
|
152
|
+
descriptor.enumerable = true;
|
|
153
|
+
if (!metadata.methods[propertyKey.toString()]) {
|
|
154
|
+
metadata.methods[propertyKey.toString()] = {};
|
|
155
|
+
}
|
|
156
|
+
metadata.methods[propertyKey.toString()].public = false;
|
|
157
|
+
};
|
|
62
158
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Defines that the method cannot be further extended by other controller extension.
|
|
161
|
+
*
|
|
162
|
+
* @returns The decorated method
|
|
163
|
+
*/
|
|
164
|
+
export function finalExtension(): MethodDecorator {
|
|
165
|
+
return function (target: UI5Controller, propertyKey, descriptor) {
|
|
166
|
+
const metadata = ensureMetadata(target);
|
|
167
|
+
descriptor.enumerable = true;
|
|
168
|
+
if (!metadata.methods[propertyKey.toString()]) {
|
|
169
|
+
metadata.methods[propertyKey.toString()] = {};
|
|
170
|
+
}
|
|
171
|
+
metadata.methods[propertyKey.toString()].final = true;
|
|
172
|
+
};
|
|
69
173
|
}
|
|
70
174
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Defines that we are going to use instantiate a controller extension under the following variable name.
|
|
177
|
+
*
|
|
178
|
+
* @param extensionClass The controller extension that will be instantiated
|
|
179
|
+
* @returns The decorated property
|
|
180
|
+
*/
|
|
181
|
+
export function usingExtension(extensionClass: typeof ControllerExtension | Function): PropertyDecorator {
|
|
182
|
+
return function (target: UI5Controller, propertyKey: string, propertyDescriptor: TypedPropertyDescriptor<any>) {
|
|
183
|
+
const metadata = ensureMetadata(target);
|
|
184
|
+
delete (propertyDescriptor as any).initializer;
|
|
185
|
+
metadata.controllerExtensions[propertyKey.toString()] = extensionClass;
|
|
186
|
+
return propertyDescriptor;
|
|
187
|
+
} as any; // This is technically an accessor decorator, but somehow the compiler doesn't like it if i declare it as such.
|
|
76
188
|
}
|
|
77
189
|
|
|
78
|
-
|
|
79
|
-
target.constructor[propertykey] = function(...args: any[]) {
|
|
80
|
-
const currentTarget = target.constructor.getAPI(args[0] as UI5Event);
|
|
81
|
-
currentTarget[propertykey](...args);
|
|
82
|
-
};
|
|
83
|
-
}
|
|
190
|
+
/* #endregion */
|
|
84
191
|
|
|
85
|
-
|
|
86
|
-
|
|
192
|
+
/* #region CONTROL */
|
|
193
|
+
/**
|
|
194
|
+
* Indicates that the property shall be declared as an event on the control metadata.
|
|
195
|
+
*
|
|
196
|
+
* @returns The decorated property
|
|
197
|
+
*/
|
|
198
|
+
export function event(): PropertyDecorator {
|
|
199
|
+
return function (target: UI5Control, eventKey) {
|
|
200
|
+
const metadata = ensureMetadata(target);
|
|
201
|
+
if (!metadata.events[eventKey.toString()]) {
|
|
202
|
+
metadata.events[eventKey.toString()] = {};
|
|
203
|
+
}
|
|
204
|
+
};
|
|
87
205
|
}
|
|
88
206
|
|
|
89
|
-
|
|
90
|
-
|
|
207
|
+
/**
|
|
208
|
+
* Defines the following property in the control metatada.
|
|
209
|
+
*
|
|
210
|
+
* @param ui5PropertyMetadata The property definition
|
|
211
|
+
* @returns The decorated property.
|
|
212
|
+
*/
|
|
213
|
+
export function property(ui5PropertyMetadata: UI5PropertyMetadata): PropertyDecorator {
|
|
214
|
+
return function (target: UI5Control, propertyKey: string, propertyDescriptor: TypedPropertyDescriptor<any>) {
|
|
91
215
|
const metadata = ensureMetadata(target);
|
|
92
|
-
if (oPropertyParams?.macroContext) {
|
|
93
|
-
if (!metadata.macroContexts[propertyKey]) {
|
|
94
|
-
metadata.macroContexts[propertyKey] = oPropertyParams;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
216
|
if (!metadata.properties[propertyKey]) {
|
|
98
|
-
metadata.properties[propertyKey] =
|
|
217
|
+
metadata.properties[propertyKey] = ui5PropertyMetadata;
|
|
99
218
|
}
|
|
100
219
|
delete propertyDescriptor.writable;
|
|
101
220
|
delete (propertyDescriptor as any).initializer;
|
|
102
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
103
|
-
return this.setProperty(propertyKey, v);
|
|
104
|
-
};
|
|
105
|
-
(propertyDescriptor as any).get = function() {
|
|
106
|
-
return this.getProperty(propertyKey);
|
|
107
|
-
};
|
|
108
221
|
|
|
109
222
|
return propertyDescriptor;
|
|
110
|
-
};
|
|
223
|
+
} as any; // This is technically an accessor decorator, but somehow the compiler doesn't like it if i declare it as such.;
|
|
111
224
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Defines and configure the following aggregation in the control metatada.
|
|
227
|
+
*
|
|
228
|
+
* @param ui5AggregationMetadata The aggregation definition
|
|
229
|
+
* @returns The decorated property.
|
|
230
|
+
*/
|
|
231
|
+
export function aggregation(ui5AggregationMetadata: UI5AggregationMetadata): PropertyDecorator {
|
|
232
|
+
return function (target: UI5Control, propertyKey: string, propertyDescriptor: TypedPropertyDescriptor<any>) {
|
|
115
233
|
const metadata = ensureMetadata(target);
|
|
234
|
+
if (ui5AggregationMetadata.multiple === undefined) {
|
|
235
|
+
// UI5 defaults this to true but this is just weird...
|
|
236
|
+
ui5AggregationMetadata.multiple = false;
|
|
237
|
+
}
|
|
116
238
|
if (!metadata.aggregations[propertyKey]) {
|
|
117
|
-
metadata.aggregations[propertyKey] =
|
|
239
|
+
metadata.aggregations[propertyKey] = ui5AggregationMetadata;
|
|
118
240
|
}
|
|
119
|
-
if (
|
|
241
|
+
if (ui5AggregationMetadata.isDefault) {
|
|
120
242
|
metadata.defaultAggregation = propertyKey;
|
|
121
243
|
}
|
|
122
244
|
delete propertyDescriptor.writable;
|
|
123
245
|
delete (propertyDescriptor as any).initializer;
|
|
124
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
125
|
-
return this.setAggregation(propertyKey, v);
|
|
126
|
-
};
|
|
127
|
-
(propertyDescriptor as any).get = function() {
|
|
128
|
-
return this.getAggregation(propertyKey);
|
|
129
|
-
};
|
|
130
246
|
|
|
131
247
|
return propertyDescriptor;
|
|
132
|
-
};
|
|
248
|
+
} as any; // This is technically an accessor decorator, but somehow the compiler doesn't like it if i declare it as such.;
|
|
133
249
|
}
|
|
134
250
|
|
|
135
|
-
|
|
136
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Defines and configure the following association in the control metatada.
|
|
253
|
+
*
|
|
254
|
+
* @param ui5AssociationMetadata The definition of the association.
|
|
255
|
+
* @returns The decorated property
|
|
256
|
+
*/
|
|
257
|
+
export function association(ui5AssociationMetadata: UI5AssociationMetadata): PropertyDecorator {
|
|
258
|
+
return function (target: UI5Control, propertyKey: string, propertyDescriptor: TypedPropertyDescriptor<any>) {
|
|
137
259
|
const metadata = ensureMetadata(target);
|
|
138
260
|
if (!metadata.associations[propertyKey]) {
|
|
139
|
-
metadata.associations[propertyKey] =
|
|
261
|
+
metadata.associations[propertyKey] = ui5AssociationMetadata;
|
|
140
262
|
}
|
|
141
263
|
delete propertyDescriptor.writable;
|
|
142
264
|
delete (propertyDescriptor as any).initializer;
|
|
143
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
144
|
-
return this.setAggregation(propertyKey, v);
|
|
145
|
-
};
|
|
146
|
-
(propertyDescriptor as any).get = function() {
|
|
147
|
-
return this.getAggregation(propertyKey);
|
|
148
|
-
};
|
|
149
265
|
|
|
150
266
|
return propertyDescriptor;
|
|
151
|
-
};
|
|
267
|
+
} as any; // This is technically an accessor decorator, but somehow the compiler doesn't like it if i declare it as such.;
|
|
152
268
|
}
|
|
153
|
-
type ControlPropertyNames<T> = {
|
|
154
|
-
[K in keyof T]: T[K] extends Function ? never : K;
|
|
155
|
-
}[keyof T];
|
|
156
|
-
export type PropertiesOf<T> = Partial<Pick<T, ControlPropertyNames<T>>>;
|
|
157
269
|
|
|
158
270
|
/**
|
|
159
|
-
*
|
|
271
|
+
* Defines in the metadata that this control implements a specific interface.
|
|
160
272
|
*
|
|
161
|
-
* @param
|
|
162
|
-
* @
|
|
163
|
-
* @class
|
|
273
|
+
* @param interfaceName The name of the implemented interface
|
|
274
|
+
* @returns The decorated method
|
|
164
275
|
*/
|
|
165
|
-
export function
|
|
166
|
-
return function(
|
|
167
|
-
|
|
168
|
-
constructor.prototype.metadata = {};
|
|
169
|
-
}
|
|
276
|
+
export function implementInterface(interfaceName: string): PropertyDecorator {
|
|
277
|
+
return function (target: UI5Control) {
|
|
278
|
+
const metadata = ensureMetadata(target);
|
|
170
279
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
constructor.prototype.metadata.interfaces.push("sap.ui.core.IFormContent");
|
|
175
|
-
(constructor as any).isDependentBound = isDependentBound;
|
|
176
|
-
if (!constructor.prototype.renderer) {
|
|
177
|
-
constructor.prototype.renderer = {
|
|
178
|
-
apiVersion: 2,
|
|
179
|
-
render: function(oRm: RenderManager, oControl: any) {
|
|
180
|
-
oRm.renderControl(oControl.getContent());
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
280
|
+
metadata.interfaces.push(interfaceName);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
184
283
|
|
|
185
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Indicates that the following method should also be exposed statically so we can call it from the XML.
|
|
286
|
+
*
|
|
287
|
+
* @returns The decorated method
|
|
288
|
+
*/
|
|
289
|
+
export function xmlEventHandler(): MethodDecorator {
|
|
290
|
+
return function (target: UI5Control, propertykey) {
|
|
291
|
+
const currentConstructor: UI5APIControl = target.constructor as unknown as UI5APIControl;
|
|
292
|
+
currentConstructor[propertykey.toString()] = function (...args: any[]) {
|
|
293
|
+
const currentTarget = currentConstructor.getAPI(args[0] as UI5Event);
|
|
294
|
+
currentTarget[propertykey.toString()](...args);
|
|
295
|
+
};
|
|
186
296
|
};
|
|
187
297
|
}
|
|
188
|
-
|
|
189
|
-
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Indicates that the following class should define a ui5 control of the specified name.
|
|
301
|
+
*
|
|
302
|
+
* @param sTarget The fully qualified name of the macro API
|
|
303
|
+
* @param metadataDefinition Inline metadata definition
|
|
304
|
+
* @class
|
|
305
|
+
*/
|
|
306
|
+
export function defineUI5Class(sTarget: string, metadataDefinition?: any): ClassDecorator {
|
|
307
|
+
return function (constructor: Function) {
|
|
190
308
|
if (!constructor.prototype.metadata) {
|
|
191
309
|
constructor.prototype.metadata = {};
|
|
192
310
|
}
|
|
193
|
-
if (metadataDefinition
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
constructor.prototype.metadata.events = metadataDefinition.events;
|
|
311
|
+
if (metadataDefinition) {
|
|
312
|
+
for (const key in metadataDefinition) {
|
|
313
|
+
constructor.prototype.metadata[key] = metadataDefinition[key as keyof UI5ControlMetadataDefinition];
|
|
314
|
+
}
|
|
198
315
|
}
|
|
199
|
-
|
|
316
|
+
return registerUI5Metadata(constructor, sTarget, constructor.prototype);
|
|
200
317
|
};
|
|
201
318
|
}
|
|
202
319
|
|
|
203
|
-
|
|
320
|
+
/**
|
|
321
|
+
* Internal heavy lifting that will take care of creating the class property for ui5 to use.
|
|
322
|
+
*
|
|
323
|
+
* @param clazz The class prototype
|
|
324
|
+
* @param name The name of the class to create
|
|
325
|
+
* @param inObj The metadata object
|
|
326
|
+
* @returns The metadata class
|
|
327
|
+
*/
|
|
328
|
+
function registerUI5Metadata(clazz: any, name: string, inObj: any): any {
|
|
329
|
+
if (clazz.getMetadata && clazz.getMetadata().isA("sap.ui.core.mvc.ControllerExtension")) {
|
|
330
|
+
Object.getOwnPropertyNames(inObj).forEach((objName) => {
|
|
331
|
+
const descriptor = Object.getOwnPropertyDescriptor(inObj, objName);
|
|
332
|
+
if (descriptor && !descriptor.enumerable) {
|
|
333
|
+
descriptor.enumerable = true;
|
|
334
|
+
// Log.error(`Property ${objName} from ${name} should be decorated as public`);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
204
338
|
const obj: any = {};
|
|
205
339
|
obj.metadata = inObj.metadata || {};
|
|
206
340
|
obj.override = inObj.override;
|
|
207
341
|
obj.constructor = clazz;
|
|
208
|
-
obj.metadata.baseType = Object.getPrototypeOf(clazz.prototype)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
342
|
+
obj.metadata.baseType = Object.getPrototypeOf(clazz.prototype).getMetadata().getName();
|
|
343
|
+
|
|
344
|
+
if (clazz?.getMetadata()?.getStereotype() === "control") {
|
|
345
|
+
const rendererDefinition = inObj.renderer || clazz.renderer || clazz.render;
|
|
346
|
+
obj.renderer = { apiVersion: 2 };
|
|
347
|
+
if (typeof rendererDefinition === "function") {
|
|
348
|
+
obj.renderer.render = rendererDefinition;
|
|
349
|
+
} else if (rendererDefinition != undefined) {
|
|
350
|
+
obj.renderer = rendererDefinition;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
212
353
|
obj.metadata.interfaces = inObj.metadata?.interfaces || clazz.metadata?.interfaces;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
354
|
+
Object.keys(clazz.prototype).forEach((key) => {
|
|
355
|
+
if (key !== "metadata") {
|
|
356
|
+
try {
|
|
357
|
+
obj[key] = clazz.prototype[key];
|
|
358
|
+
} catch (e) {
|
|
359
|
+
//console.log(e);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
if (obj.metadata?.controllerExtensions && Object.keys(obj.metadata.controllerExtensions).length > 0) {
|
|
364
|
+
for (const cExtName in obj.metadata.controllerExtensions) {
|
|
365
|
+
obj[cExtName] = obj.metadata.controllerExtensions[cExtName];
|
|
366
|
+
}
|
|
218
367
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const fnInit = clazz.prototype.init;
|
|
223
|
-
clazz.prototype.init = function(...args: any[]) {
|
|
368
|
+
const output = clazz.extend(name, obj);
|
|
369
|
+
const fnInit = output.prototype.init;
|
|
370
|
+
output.prototype.init = function (...args: any[]) {
|
|
224
371
|
fnInit && fnInit.apply(this, args);
|
|
372
|
+
this.metadata = obj.metadata;
|
|
373
|
+
|
|
225
374
|
if (obj.metadata.properties) {
|
|
226
375
|
const aPropertyKeys = Object.keys(obj.metadata.properties);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
376
|
+
aPropertyKeys.forEach((propertyKey) => {
|
|
377
|
+
Object.defineProperty(this, propertyKey, {
|
|
378
|
+
configurable: true,
|
|
379
|
+
set: (v: any) => {
|
|
380
|
+
return this.setProperty(propertyKey, v);
|
|
381
|
+
},
|
|
382
|
+
get: () => {
|
|
383
|
+
return this.getProperty(propertyKey);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
const aAggregationKeys = Object.keys(obj.metadata.aggregations);
|
|
388
|
+
aAggregationKeys.forEach((aggregationKey) => {
|
|
389
|
+
Object.defineProperty(this, aggregationKey, {
|
|
390
|
+
configurable: true,
|
|
391
|
+
set: (v: any) => {
|
|
392
|
+
return this.setAggregation(aggregationKey, v);
|
|
393
|
+
},
|
|
394
|
+
get: () => {
|
|
395
|
+
const aggregationContent = this.getAggregation(aggregationKey);
|
|
396
|
+
if (obj.metadata.aggregations[aggregationKey].multiple) {
|
|
397
|
+
return aggregationContent || [];
|
|
398
|
+
} else {
|
|
399
|
+
return aggregationContent;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
const aAssociationKeys = Object.keys(obj.metadata.associations);
|
|
405
|
+
aAssociationKeys.forEach((associationKey) => {
|
|
406
|
+
Object.defineProperty(this, associationKey, {
|
|
231
407
|
configurable: true,
|
|
232
408
|
set: (v: any) => {
|
|
233
|
-
return
|
|
409
|
+
return this.setAssociation(associationKey, v);
|
|
234
410
|
},
|
|
235
411
|
get: () => {
|
|
236
|
-
|
|
412
|
+
const aggregationContent = this.getAssociation(associationKey);
|
|
413
|
+
if (obj.metadata.associations[associationKey].multiple) {
|
|
414
|
+
return aggregationContent || [];
|
|
415
|
+
} else {
|
|
416
|
+
return aggregationContent;
|
|
417
|
+
}
|
|
237
418
|
}
|
|
238
419
|
});
|
|
239
420
|
});
|
|
240
421
|
}
|
|
241
422
|
};
|
|
242
|
-
|
|
423
|
+
clazz.override = function (oExtension: any) {
|
|
424
|
+
const pol = {};
|
|
425
|
+
(pol as any).constructor = function (...args: any[]) {
|
|
426
|
+
return clazz.apply(this, args as any);
|
|
427
|
+
};
|
|
428
|
+
const oClass = (Metadata as any).createClass(clazz, "anonymousExtension~" + uid(), pol, ControllerMetadata);
|
|
429
|
+
oClass.getMetadata()._staticOverride = oExtension;
|
|
430
|
+
oClass.getMetadata()._override = (clazz.getMetadata() as any)._override;
|
|
431
|
+
return oClass;
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
ObjectPath.set(name, output);
|
|
435
|
+
return output;
|
|
243
436
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
sap.ui.define(["sap/ui/base/BindingParser"], function (BindingParser) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
var _exports = {};
|
|
9
|
+
|
|
8
10
|
function getObject(oObject, sPath) {
|
|
9
11
|
if (!oObject) {
|
|
10
12
|
return null;
|
|
@@ -58,8 +60,7 @@ sap.ui.define(["sap/ui/base/BindingParser"], function (BindingParser) {
|
|
|
58
60
|
return sAnnotationPath;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
63
|
+
_exports.resolveDynamicExpression = resolveDynamicExpression;
|
|
64
|
+
return _exports;
|
|
64
65
|
}, false);
|
|
65
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
66
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR5bmFtaWNBbm5vdGF0aW9uUGF0aEhlbHBlci50cyJdLCJuYW1lcyI6WyJnZXRPYmplY3QiLCJvT2JqZWN0Iiwic1BhdGgiLCJzUGF0aFNwbGl0Iiwic3BsaXQiLCJsZW5ndGgiLCJzcGxpY2UiLCJqb2luIiwicmVzb2x2ZUR5bmFtaWNFeHByZXNzaW9uIiwic0Fubm90YXRpb25QYXRoIiwib01ldGFNb2RlbCIsImluZGV4T2YiLCJmaXJzdEJyYWNrZXQiLCJzU3RhYmxlQnJhY2tldCIsInN1YnN0ciIsInNSZXN0IiwibGFzdEJyYWNrZXQiLCJhVmFsdWUiLCJvRXhwcmVzc2lvbiIsIkJpbmRpbmdQYXJzZXIiLCJwYXJzZUV4cHJlc3Npb24iLCJBcnJheSIsImlzQXJyYXkiLCJyZXN1bHQiLCJwYXJ0cyIsInBhdGgiLCJpIiwiYkZvdW5kIiwib09iamVjdFZhbHVlIiwiYlJlc3VsdCIsImZvcm1hdHRlciJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7O0FBQUEsV0FBU0EsU0FBVCxDQUFtQkMsT0FBbkIsRUFBaUNDLEtBQWpDLEVBQWtEO0FBQ2pELFFBQUksQ0FBQ0QsT0FBTCxFQUFjO0FBQ2IsYUFBTyxJQUFQO0FBQ0E7O0FBQ0QsUUFBTUUsVUFBVSxHQUFHRCxLQUFLLENBQUNFLEtBQU4sQ0FBWSxHQUFaLENBQW5COztBQUNBLFFBQUlELFVBQVUsQ0FBQ0UsTUFBWCxLQUFzQixDQUExQixFQUE2QjtBQUM1QixhQUFPSixPQUFPLENBQUNDLEtBQUQsQ0FBZDtBQUNBLEtBRkQs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oYkZvdW5kKSB7XG5cdFx0XHRcdHNBbm5vdGF0aW9uUGF0aCA9IHJlc29sdmVEeW5hbWljRXhwcmVzc2lvbihzU3RhYmxlQnJhY2tldCArIChpIC0gMSkgKyBzUmVzdC5zdWJzdHIobGFzdEJyYWNrZXQgKyAxKSwgb01ldGFNb2RlbCk7XG5cdFx0XHR9XG5cdFx0fVxuXHR9XG5cdHJldHVybiBzQW5ub3RhdGlvblBhdGg7XG59XG4iXX0=
|
|
@@ -18,7 +18,7 @@ function getObject(oObject: any, sPath: any): any {
|
|
|
18
18
|
* @param oMetaModel
|
|
19
19
|
* @returns {string} The non dynamic version of the annotation path
|
|
20
20
|
*/
|
|
21
|
-
function resolveDynamicExpression(sAnnotationPath: any, oMetaModel: any) {
|
|
21
|
+
export function resolveDynamicExpression(sAnnotationPath: any, oMetaModel: any) {
|
|
22
22
|
if (sAnnotationPath.indexOf("[") !== -1) {
|
|
23
23
|
const firstBracket = sAnnotationPath.indexOf("[");
|
|
24
24
|
const sStableBracket = sAnnotationPath.substr(0, firstBracket);
|
|
@@ -50,7 +50,3 @@ function resolveDynamicExpression(sAnnotationPath: any, oMetaModel: any) {
|
|
|
50
50
|
}
|
|
51
51
|
return sAnnotationPath;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
export default {
|
|
55
|
-
resolveDynamicExpression: resolveDynamicExpression
|
|
56
|
-
};
|