@sapui5/sap.fe.core 1.102.0 → 1.103.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 +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +62 -26
- package/src/sap/fe/core/AppComponent.ts +56 -40
- package/src/sap/fe/core/AppStateHandler.js +10 -10
- package/src/sap/fe/core/AppStateHandler.ts +9 -9
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +236 -109
- package/src/sap/fe/core/CommonUtils.ts +252 -136
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +31 -26
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +8 -8
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +22 -22
- package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +65 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +6 -6
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +184 -137
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -44
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +2 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +11 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +47 -47
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +50 -32
- package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -34
- package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -26
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
- package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
- package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +64 -57
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +73 -72
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +14 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +281 -254
- package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +49 -35
- package/src/sap/fe/core/messagebundle_ar.properties +13 -5
- package/src/sap/fe/core/messagebundle_bg.properties +13 -5
- package/src/sap/fe/core/messagebundle_ca.properties +13 -5
- package/src/sap/fe/core/messagebundle_cs.properties +13 -5
- package/src/sap/fe/core/messagebundle_cy.properties +14 -6
- package/src/sap/fe/core/messagebundle_da.properties +13 -5
- package/src/sap/fe/core/messagebundle_de.properties +15 -7
- package/src/sap/fe/core/messagebundle_el.properties +14 -6
- package/src/sap/fe/core/messagebundle_en.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
- package/src/sap/fe/core/messagebundle_es.properties +13 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
- package/src/sap/fe/core/messagebundle_et.properties +13 -5
- package/src/sap/fe/core/messagebundle_fi.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
- package/src/sap/fe/core/messagebundle_hi.properties +14 -6
- package/src/sap/fe/core/messagebundle_hr.properties +14 -6
- package/src/sap/fe/core/messagebundle_hu.properties +13 -5
- package/src/sap/fe/core/messagebundle_id.properties +13 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -25
- package/src/sap/fe/core/messagebundle_iw.properties +13 -5
- package/src/sap/fe/core/messagebundle_ja.properties +14 -6
- package/src/sap/fe/core/messagebundle_kk.properties +13 -5
- package/src/sap/fe/core/messagebundle_ko.properties +13 -5
- package/src/sap/fe/core/messagebundle_lt.properties +13 -5
- package/src/sap/fe/core/messagebundle_lv.properties +14 -6
- package/src/sap/fe/core/messagebundle_ms.properties +13 -5
- package/src/sap/fe/core/messagebundle_nl.properties +13 -5
- package/src/sap/fe/core/messagebundle_no.properties +13 -5
- package/src/sap/fe/core/messagebundle_pl.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
- package/src/sap/fe/core/messagebundle_ro.properties +13 -5
- package/src/sap/fe/core/messagebundle_ru.properties +13 -5
- package/src/sap/fe/core/messagebundle_sh.properties +13 -5
- package/src/sap/fe/core/messagebundle_sk.properties +13 -5
- package/src/sap/fe/core/messagebundle_sl.properties +17 -9
- package/src/sap/fe/core/messagebundle_sv.properties +14 -6
- package/src/sap/fe/core/messagebundle_th.properties +13 -5
- package/src/sap/fe/core/messagebundle_tr.properties +13 -5
- package/src/sap/fe/core/messagebundle_uk.properties +13 -5
- package/src/sap/fe/core/messagebundle_vi.properties +13 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +53 -44
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +72 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +20 -15
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +10 -9
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +148 -93
- package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Annotation, AnnotationList, AnnotationRecord, Expression, ParserOutput } from "@sap-ux/vocabularies-types";
|
|
9
|
-
import {
|
|
10
|
-
Action,
|
|
11
|
-
ComplexType,
|
|
12
|
-
EntityContainer,
|
|
1
|
+
// This file is retrieved from @sap-ux/annotation-converter, shared code with tool suite
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
Annotation,
|
|
5
|
+
AnnotationList,
|
|
6
|
+
AnnotationRecord,
|
|
7
|
+
ConvertedMetadata,
|
|
13
8
|
EntitySet,
|
|
14
9
|
EntityType,
|
|
10
|
+
Expression,
|
|
11
|
+
NavigationProperty,
|
|
15
12
|
Property,
|
|
13
|
+
RawAction,
|
|
14
|
+
RawComplexType,
|
|
15
|
+
RawEntityContainer,
|
|
16
|
+
RawEntitySet,
|
|
17
|
+
RawEntityType,
|
|
18
|
+
RawMetadata,
|
|
19
|
+
RawProperty,
|
|
20
|
+
RawSingleton,
|
|
21
|
+
RawTypeDefinition,
|
|
22
|
+
RawV4NavigationProperty,
|
|
16
23
|
Reference,
|
|
17
24
|
ReferentialConstraint,
|
|
18
|
-
Singleton
|
|
19
|
-
|
|
20
|
-
V4NavigationProperty
|
|
21
|
-
} from "@sap-ux/vocabularies-types/dist/Parser";
|
|
22
|
-
// This file is retrieved from @sap-ux/annotation-converter, shared code with tool suite
|
|
25
|
+
Singleton
|
|
26
|
+
} from "@sap-ux/vocabularies-types";
|
|
23
27
|
import { AnnotationConverter } from "sap/fe/core/converters/common";
|
|
24
|
-
import { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
25
|
-
import Context from "sap/ui/model/Context";
|
|
26
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
28
|
+
import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
29
|
+
import type Context from "sap/ui/model/Context";
|
|
30
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
27
31
|
import { generate } from "../helpers/StableIdHelper";
|
|
28
32
|
|
|
29
33
|
const VOCABULARY_ALIAS: any = {
|
|
@@ -80,7 +84,7 @@ function parsePropertyValue(
|
|
|
80
84
|
oCapabilities: EnvironmentCapabilities
|
|
81
85
|
): any {
|
|
82
86
|
let value;
|
|
83
|
-
const currentPropertyTarget: string = currentTarget
|
|
87
|
+
const currentPropertyTarget: string = `${currentTarget}/${propertyKey}`;
|
|
84
88
|
const typeOfAnnotation = typeof annotationObject;
|
|
85
89
|
if (annotationObject === null) {
|
|
86
90
|
value = { type: "Null", Null: null };
|
|
@@ -96,7 +100,7 @@ function parsePropertyValue(
|
|
|
96
100
|
Collection: annotationObject.map((subAnnotationObject, subAnnotationObjectIndex) =>
|
|
97
101
|
parseAnnotationObject(
|
|
98
102
|
subAnnotationObject,
|
|
99
|
-
currentPropertyTarget
|
|
103
|
+
`${currentPropertyTarget}/${subAnnotationObjectIndex}`,
|
|
100
104
|
annotationsLists,
|
|
101
105
|
oCapabilities
|
|
102
106
|
)
|
|
@@ -180,7 +184,7 @@ function parsePropertyValue(
|
|
|
180
184
|
} else if (annotationObject.$EnumMember !== undefined) {
|
|
181
185
|
value = {
|
|
182
186
|
type: "EnumMember",
|
|
183
|
-
EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0])
|
|
187
|
+
EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
|
|
184
188
|
};
|
|
185
189
|
} else if (annotationObject.$Type) {
|
|
186
190
|
value = {
|
|
@@ -208,7 +212,7 @@ function mapNameToAlias(annotationName: string): string {
|
|
|
208
212
|
pathPart += "@";
|
|
209
213
|
}
|
|
210
214
|
const lastDot = annoPart.lastIndexOf(".");
|
|
211
|
-
return pathPart + VOCABULARY_ALIAS[annoPart.substr(0, lastDot)]
|
|
215
|
+
return `${pathPart + VOCABULARY_ALIAS[annoPart.substr(0, lastDot)]}.${annoPart.substr(lastDot + 1)}`;
|
|
212
216
|
}
|
|
213
217
|
function parseAnnotationObject(
|
|
214
218
|
annotationObject: any,
|
|
@@ -264,50 +268,50 @@ function parseAnnotationObject(
|
|
|
264
268
|
} else if (annotationObject.$EnumMember !== undefined) {
|
|
265
269
|
parsedAnnotationObject = {
|
|
266
270
|
type: "EnumMember",
|
|
267
|
-
EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0])
|
|
271
|
+
EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
|
|
268
272
|
};
|
|
269
273
|
} else if (Array.isArray(annotationObject)) {
|
|
270
|
-
const parsedAnnotationCollection = parsedAnnotationObject
|
|
274
|
+
const parsedAnnotationCollection = parsedAnnotationObject;
|
|
271
275
|
parsedAnnotationCollection.collection = annotationObject.map((subAnnotationObject, subAnnotationIndex) =>
|
|
272
|
-
parseAnnotationObject(subAnnotationObject, currentObjectTarget
|
|
276
|
+
parseAnnotationObject(subAnnotationObject, `${currentObjectTarget}/${subAnnotationIndex}`, annotationsLists, oCapabilities)
|
|
273
277
|
);
|
|
274
278
|
if (annotationObject.length > 0) {
|
|
275
279
|
if (annotationObject[0].hasOwnProperty("$PropertyPath")) {
|
|
276
|
-
|
|
280
|
+
parsedAnnotationCollection.collection.type = "PropertyPath";
|
|
277
281
|
} else if (annotationObject[0].hasOwnProperty("$Path")) {
|
|
278
|
-
|
|
282
|
+
parsedAnnotationCollection.collection.type = "Path";
|
|
279
283
|
} else if (annotationObject[0].hasOwnProperty("$NavigationPropertyPath")) {
|
|
280
|
-
|
|
284
|
+
parsedAnnotationCollection.collection.type = "NavigationPropertyPath";
|
|
281
285
|
} else if (annotationObject[0].hasOwnProperty("$AnnotationPath")) {
|
|
282
|
-
|
|
286
|
+
parsedAnnotationCollection.collection.type = "AnnotationPath";
|
|
283
287
|
} else if (annotationObject[0].hasOwnProperty("$Type")) {
|
|
284
|
-
|
|
288
|
+
parsedAnnotationCollection.collection.type = "Record";
|
|
285
289
|
} else if (annotationObject[0].hasOwnProperty("$If")) {
|
|
286
|
-
|
|
290
|
+
parsedAnnotationCollection.collection.type = "If";
|
|
287
291
|
} else if (annotationObject[0].hasOwnProperty("$And")) {
|
|
288
|
-
|
|
292
|
+
parsedAnnotationCollection.collection.type = "And";
|
|
289
293
|
} else if (annotationObject[0].hasOwnProperty("$Or")) {
|
|
290
|
-
|
|
294
|
+
parsedAnnotationCollection.collection.type = "Or";
|
|
291
295
|
} else if (annotationObject[0].hasOwnProperty("$Eq")) {
|
|
292
|
-
|
|
296
|
+
parsedAnnotationCollection.collection.type = "Eq";
|
|
293
297
|
} else if (annotationObject[0].hasOwnProperty("$Ne")) {
|
|
294
|
-
|
|
298
|
+
parsedAnnotationCollection.collection.type = "Ne";
|
|
295
299
|
} else if (annotationObject[0].hasOwnProperty("$Not")) {
|
|
296
|
-
|
|
300
|
+
parsedAnnotationCollection.collection.type = "Not";
|
|
297
301
|
} else if (annotationObject[0].hasOwnProperty("$Gt")) {
|
|
298
|
-
|
|
302
|
+
parsedAnnotationCollection.collection.type = "Gt";
|
|
299
303
|
} else if (annotationObject[0].hasOwnProperty("$Ge")) {
|
|
300
|
-
|
|
304
|
+
parsedAnnotationCollection.collection.type = "Ge";
|
|
301
305
|
} else if (annotationObject[0].hasOwnProperty("$Lt")) {
|
|
302
|
-
|
|
306
|
+
parsedAnnotationCollection.collection.type = "Lt";
|
|
303
307
|
} else if (annotationObject[0].hasOwnProperty("$Le")) {
|
|
304
|
-
|
|
308
|
+
parsedAnnotationCollection.collection.type = "Le";
|
|
305
309
|
} else if (annotationObject[0].hasOwnProperty("$Apply")) {
|
|
306
|
-
|
|
310
|
+
parsedAnnotationCollection.collection.type = "Apply";
|
|
307
311
|
} else if (typeof annotationObject[0] === "object") {
|
|
308
|
-
|
|
312
|
+
parsedAnnotationCollection.collection.type = "Record";
|
|
309
313
|
} else {
|
|
310
|
-
|
|
314
|
+
parsedAnnotationCollection.collection.type = "String";
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
317
|
} else {
|
|
@@ -446,7 +450,7 @@ function createAnnotationLists(
|
|
|
446
450
|
const annotationOfAnnotationSplit = annotationKey.split("@");
|
|
447
451
|
if (annotationOfAnnotationSplit.length > 2) {
|
|
448
452
|
currentOutAnnotationObject = getOrCreateAnnotationList(
|
|
449
|
-
annotationTarget
|
|
453
|
+
`${annotationTarget}@${annotationOfAnnotationSplit[1]}`,
|
|
450
454
|
annotationLists
|
|
451
455
|
);
|
|
452
456
|
annotationKey = annotationOfAnnotationSplit[2];
|
|
@@ -462,9 +466,9 @@ function createAnnotationLists(
|
|
|
462
466
|
term: `${annotationKey}`,
|
|
463
467
|
qualifier: qualifier
|
|
464
468
|
};
|
|
465
|
-
let currentAnnotationTarget = annotationTarget
|
|
469
|
+
let currentAnnotationTarget = `${annotationTarget}@${parsedAnnotationObject.term}`;
|
|
466
470
|
if (qualifier) {
|
|
467
|
-
currentAnnotationTarget +=
|
|
471
|
+
currentAnnotationTarget += `#${qualifier}`;
|
|
468
472
|
}
|
|
469
473
|
let isCollection = false;
|
|
470
474
|
const typeofAnnotation = typeof annotationObject;
|
|
@@ -510,55 +514,55 @@ function createAnnotationLists(
|
|
|
510
514
|
} else if (annotationObject.$EnumMember !== undefined) {
|
|
511
515
|
parsedAnnotationObject.value = {
|
|
512
516
|
type: "EnumMember",
|
|
513
|
-
EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0])
|
|
517
|
+
EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
|
|
514
518
|
};
|
|
515
519
|
} else if (Array.isArray(annotationObject)) {
|
|
516
520
|
isCollection = true;
|
|
517
521
|
parsedAnnotationObject.collection = annotationObject.map((subAnnotationObject, subAnnotationIndex) =>
|
|
518
522
|
parseAnnotationObject(
|
|
519
523
|
subAnnotationObject,
|
|
520
|
-
currentAnnotationTarget
|
|
524
|
+
`${currentAnnotationTarget}/${subAnnotationIndex}`,
|
|
521
525
|
annotationLists,
|
|
522
526
|
oCapabilities
|
|
523
527
|
)
|
|
524
528
|
);
|
|
525
529
|
if (annotationObject.length > 0) {
|
|
526
530
|
if (annotationObject[0].hasOwnProperty("$PropertyPath")) {
|
|
527
|
-
|
|
531
|
+
parsedAnnotationObject.collection.type = "PropertyPath";
|
|
528
532
|
} else if (annotationObject[0].hasOwnProperty("$Path")) {
|
|
529
|
-
|
|
533
|
+
parsedAnnotationObject.collection.type = "Path";
|
|
530
534
|
} else if (annotationObject[0].hasOwnProperty("$NavigationPropertyPath")) {
|
|
531
|
-
|
|
535
|
+
parsedAnnotationObject.collection.type = "NavigationPropertyPath";
|
|
532
536
|
} else if (annotationObject[0].hasOwnProperty("$AnnotationPath")) {
|
|
533
|
-
|
|
537
|
+
parsedAnnotationObject.collection.type = "AnnotationPath";
|
|
534
538
|
} else if (annotationObject[0].hasOwnProperty("$Type")) {
|
|
535
|
-
|
|
539
|
+
parsedAnnotationObject.collection.type = "Record";
|
|
536
540
|
} else if (annotationObject[0].hasOwnProperty("$If")) {
|
|
537
|
-
|
|
541
|
+
parsedAnnotationObject.collection.type = "If";
|
|
538
542
|
} else if (annotationObject[0].hasOwnProperty("$Or")) {
|
|
539
|
-
|
|
543
|
+
parsedAnnotationObject.collection.type = "Or";
|
|
540
544
|
} else if (annotationObject[0].hasOwnProperty("$Eq")) {
|
|
541
|
-
|
|
545
|
+
parsedAnnotationObject.collection.type = "Eq";
|
|
542
546
|
} else if (annotationObject[0].hasOwnProperty("$Ne")) {
|
|
543
|
-
|
|
547
|
+
parsedAnnotationObject.collection.type = "Ne";
|
|
544
548
|
} else if (annotationObject[0].hasOwnProperty("$Not")) {
|
|
545
|
-
|
|
549
|
+
parsedAnnotationObject.collection.type = "Not";
|
|
546
550
|
} else if (annotationObject[0].hasOwnProperty("$Gt")) {
|
|
547
|
-
|
|
551
|
+
parsedAnnotationObject.collection.type = "Gt";
|
|
548
552
|
} else if (annotationObject[0].hasOwnProperty("$Ge")) {
|
|
549
|
-
|
|
553
|
+
parsedAnnotationObject.collection.type = "Ge";
|
|
550
554
|
} else if (annotationObject[0].hasOwnProperty("$Lt")) {
|
|
551
|
-
|
|
555
|
+
parsedAnnotationObject.collection.type = "Lt";
|
|
552
556
|
} else if (annotationObject[0].hasOwnProperty("$Le")) {
|
|
553
|
-
|
|
557
|
+
parsedAnnotationObject.collection.type = "Le";
|
|
554
558
|
} else if (annotationObject[0].hasOwnProperty("$And")) {
|
|
555
|
-
|
|
559
|
+
parsedAnnotationObject.collection.type = "And";
|
|
556
560
|
} else if (annotationObject[0].hasOwnProperty("$Apply")) {
|
|
557
|
-
|
|
561
|
+
parsedAnnotationObject.collection.type = "Apply";
|
|
558
562
|
} else if (typeof annotationObject[0] === "object") {
|
|
559
|
-
|
|
563
|
+
parsedAnnotationObject.collection.type = "Record";
|
|
560
564
|
} else {
|
|
561
|
-
|
|
565
|
+
parsedAnnotationObject.collection.type = "String";
|
|
562
566
|
}
|
|
563
567
|
}
|
|
564
568
|
} else {
|
|
@@ -599,8 +603,8 @@ function createAnnotationLists(
|
|
|
599
603
|
}
|
|
600
604
|
}
|
|
601
605
|
|
|
602
|
-
function prepareProperty(propertyDefinition: any, entityTypeObject:
|
|
603
|
-
const propertyObject:
|
|
606
|
+
function prepareProperty(propertyDefinition: any, entityTypeObject: RawEntityType | RawComplexType, propertyName: string): RawProperty {
|
|
607
|
+
const propertyObject: RawProperty = {
|
|
604
608
|
_type: "Property",
|
|
605
609
|
name: propertyName,
|
|
606
610
|
fullyQualifiedName: `${entityTypeObject.fullyQualifiedName}/${propertyName}`,
|
|
@@ -615,9 +619,9 @@ function prepareProperty(propertyDefinition: any, entityTypeObject: EntityType |
|
|
|
615
619
|
|
|
616
620
|
function prepareNavigationProperty(
|
|
617
621
|
navPropertyDefinition: any,
|
|
618
|
-
entityTypeObject:
|
|
622
|
+
entityTypeObject: RawEntityType | RawComplexType,
|
|
619
623
|
navPropertyName: string
|
|
620
|
-
):
|
|
624
|
+
): RawV4NavigationProperty {
|
|
621
625
|
let referentialConstraint: ReferentialConstraint[] = [];
|
|
622
626
|
if (navPropertyDefinition.$ReferentialConstraint) {
|
|
623
627
|
referentialConstraint = Object.keys(navPropertyDefinition.$ReferentialConstraint).map((sourcePropertyName) => {
|
|
@@ -629,7 +633,7 @@ function prepareNavigationProperty(
|
|
|
629
633
|
};
|
|
630
634
|
});
|
|
631
635
|
}
|
|
632
|
-
const navigationProperty:
|
|
636
|
+
const navigationProperty: RawV4NavigationProperty = {
|
|
633
637
|
_type: "NavigationProperty",
|
|
634
638
|
name: navPropertyName,
|
|
635
639
|
fullyQualifiedName: `${entityTypeObject.fullyQualifiedName}/${navPropertyName}`,
|
|
@@ -643,8 +647,8 @@ function prepareNavigationProperty(
|
|
|
643
647
|
return navigationProperty;
|
|
644
648
|
}
|
|
645
649
|
|
|
646
|
-
function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entityContainerName: string):
|
|
647
|
-
const entitySetObject:
|
|
650
|
+
function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entityContainerName: string): RawEntitySet {
|
|
651
|
+
const entitySetObject: RawEntitySet = {
|
|
648
652
|
_type: "EntitySet",
|
|
649
653
|
name: entitySetName,
|
|
650
654
|
navigationPropertyBinding: {},
|
|
@@ -654,31 +658,31 @@ function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entit
|
|
|
654
658
|
return entitySetObject;
|
|
655
659
|
}
|
|
656
660
|
|
|
657
|
-
function prepareSingleton(singletonDefinition: any, singletonName: string, entityContainerName: string):
|
|
661
|
+
function prepareSingleton(singletonDefinition: any, singletonName: string, entityContainerName: string): RawSingleton {
|
|
658
662
|
return {
|
|
659
663
|
_type: "Singleton",
|
|
660
664
|
name: singletonName,
|
|
661
665
|
navigationPropertyBinding: {},
|
|
662
|
-
|
|
666
|
+
entityTypeName: singletonDefinition.$Type,
|
|
663
667
|
fullyQualifiedName: `${entityContainerName}/${singletonName}`,
|
|
664
668
|
nullable: true
|
|
665
|
-
}
|
|
669
|
+
};
|
|
666
670
|
}
|
|
667
671
|
|
|
668
|
-
function prepareTypeDefinition(typeDefinition: any, typeName: string, namespace: string):
|
|
669
|
-
const typeObject:
|
|
672
|
+
function prepareTypeDefinition(typeDefinition: any, typeName: string, namespace: string): RawTypeDefinition {
|
|
673
|
+
const typeObject: RawTypeDefinition = {
|
|
670
674
|
_type: "TypeDefinition",
|
|
671
|
-
name: typeName.replace(namespace
|
|
675
|
+
name: typeName.replace(`${namespace}.`, ""),
|
|
672
676
|
fullyQualifiedName: typeName,
|
|
673
677
|
underlyingType: typeDefinition.$UnderlyingType
|
|
674
678
|
};
|
|
675
679
|
return typeObject;
|
|
676
680
|
}
|
|
677
681
|
|
|
678
|
-
function prepareComplexType(complexTypeDefinition: any, complexTypeName: string, namespace: string):
|
|
679
|
-
const complexTypeObject:
|
|
682
|
+
function prepareComplexType(complexTypeDefinition: any, complexTypeName: string, namespace: string): RawComplexType {
|
|
683
|
+
const complexTypeObject: RawComplexType = {
|
|
680
684
|
_type: "ComplexType",
|
|
681
|
-
name: complexTypeName.replace(namespace
|
|
685
|
+
name: complexTypeName.replace(`${namespace}.`, ""),
|
|
682
686
|
fullyQualifiedName: complexTypeName,
|
|
683
687
|
properties: [],
|
|
684
688
|
navigationProperties: []
|
|
@@ -717,16 +721,17 @@ function prepareEntityKeys(entityTypeDefinition: any, oMetaModelData: any): any
|
|
|
717
721
|
return entityTypeDefinition.$Key || []; //handling of entity types without key as well as basetype
|
|
718
722
|
}
|
|
719
723
|
|
|
720
|
-
function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, namespace: string, metaModelData: any):
|
|
724
|
+
function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, namespace: string, metaModelData: any): RawEntityType {
|
|
721
725
|
const entityKeys: any = prepareEntityKeys(entityTypeDefinition, metaModelData);
|
|
722
726
|
|
|
723
|
-
const entityTypeObject:
|
|
727
|
+
const entityTypeObject: RawEntityType = {
|
|
724
728
|
_type: "EntityType",
|
|
725
|
-
name: entityTypeName.replace(namespace
|
|
729
|
+
name: entityTypeName.replace(`${namespace}.`, ""),
|
|
726
730
|
fullyQualifiedName: entityTypeName,
|
|
727
731
|
keys: [],
|
|
728
732
|
entityProperties: [],
|
|
729
|
-
navigationProperties: []
|
|
733
|
+
navigationProperties: [],
|
|
734
|
+
actions: {}
|
|
730
735
|
};
|
|
731
736
|
|
|
732
737
|
const entityProperties = Object.keys(entityTypeDefinition)
|
|
@@ -750,14 +755,14 @@ function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, na
|
|
|
750
755
|
});
|
|
751
756
|
|
|
752
757
|
entityTypeObject.keys = entityKeys
|
|
753
|
-
.map((entityKey: string) => entityProperties.find((property:
|
|
758
|
+
.map((entityKey: string) => entityProperties.find((property: RawProperty) => property.name === entityKey))
|
|
754
759
|
.filter((property: Property) => property !== undefined);
|
|
755
760
|
entityTypeObject.entityProperties = entityProperties;
|
|
756
761
|
entityTypeObject.navigationProperties = navigationProperties;
|
|
757
762
|
|
|
758
763
|
return entityTypeObject;
|
|
759
764
|
}
|
|
760
|
-
function prepareAction(actionName: string, actionRawData: MetaModelAction, namespace: string, entityContainerName: string):
|
|
765
|
+
function prepareAction(actionName: string, actionRawData: MetaModelAction, namespace: string, entityContainerName: string): RawAction {
|
|
761
766
|
let actionEntityType: string = "";
|
|
762
767
|
let actionFQN = `${actionName}`;
|
|
763
768
|
const actionShortName = actionName.substr(namespace.length + 1);
|
|
@@ -786,6 +791,7 @@ function prepareAction(actionName: string, actionRawData: MetaModelAction, names
|
|
|
786
791
|
_type: "ActionParameter",
|
|
787
792
|
isEntitySet: param.$Type === actionRawData.$EntitySetPath,
|
|
788
793
|
fullyQualifiedName: `${actionFQN}/${param.$Name}`,
|
|
794
|
+
name: param.$Name,
|
|
789
795
|
type: param.$Type
|
|
790
796
|
};
|
|
791
797
|
})
|
|
@@ -794,14 +800,14 @@ function prepareAction(actionName: string, actionRawData: MetaModelAction, names
|
|
|
794
800
|
export function prepareEntityTypes(
|
|
795
801
|
oMetaModel: ODataMetaModel,
|
|
796
802
|
oCapabilities: EnvironmentCapabilities = DefaultEnvironmentCapabilities
|
|
797
|
-
):
|
|
803
|
+
): RawMetadata {
|
|
798
804
|
const oMetaModelData = oMetaModel.getObject("/$");
|
|
799
805
|
const annotationLists: Record<string, AnnotationList> = {};
|
|
800
|
-
const entityTypes:
|
|
801
|
-
const entitySets:
|
|
802
|
-
const singletons:
|
|
803
|
-
const complexTypes:
|
|
804
|
-
const typeDefinitions:
|
|
806
|
+
const entityTypes: RawEntityType[] = [];
|
|
807
|
+
const entitySets: RawEntitySet[] = [];
|
|
808
|
+
const singletons: RawSingleton[] = [];
|
|
809
|
+
const complexTypes: RawComplexType[] = [];
|
|
810
|
+
const typeDefinitions: RawTypeDefinition[] = [];
|
|
805
811
|
const entityContainerName = oMetaModelData.$EntityContainer;
|
|
806
812
|
let namespace = "";
|
|
807
813
|
const schemaKeys = Object.keys(oMetaModelData).filter((metamodelKey) => oMetaModelData[metamodelKey].$kind === "Schema");
|
|
@@ -873,10 +879,15 @@ export function prepareEntityTypes(
|
|
|
873
879
|
}
|
|
874
880
|
});
|
|
875
881
|
|
|
876
|
-
let entityContainer:
|
|
882
|
+
let entityContainer: RawEntityContainer = {
|
|
883
|
+
_type: "EntityContainer",
|
|
884
|
+
name: "",
|
|
885
|
+
fullyQualifiedName: ""
|
|
886
|
+
};
|
|
877
887
|
if (entityContainerName) {
|
|
878
888
|
entityContainer = {
|
|
879
|
-
|
|
889
|
+
_type: "EntityContainer",
|
|
890
|
+
name: entityContainerName.replace(`${namespace}.`, ""),
|
|
880
891
|
fullyQualifiedName: entityContainerName
|
|
881
892
|
};
|
|
882
893
|
}
|
|
@@ -892,13 +903,13 @@ export function prepareEntityTypes(
|
|
|
892
903
|
}
|
|
893
904
|
});
|
|
894
905
|
|
|
895
|
-
const actions:
|
|
906
|
+
const actions: RawAction[] = Object.keys(oMetaModelData)
|
|
896
907
|
.filter((key) => {
|
|
897
908
|
return Array.isArray(oMetaModelData[key]) && oMetaModelData[key].length > 0 && oMetaModelData[key][0].$kind === "Action";
|
|
898
909
|
})
|
|
899
|
-
.reduce((outActions:
|
|
900
|
-
const
|
|
901
|
-
|
|
910
|
+
.reduce((outActions: RawAction[], actionName) => {
|
|
911
|
+
const innerActions = oMetaModelData[actionName];
|
|
912
|
+
innerActions.forEach((action: MetaModelAction) => {
|
|
902
913
|
outActions.push(prepareAction(actionName, action, namespace, entityContainerName));
|
|
903
914
|
});
|
|
904
915
|
return outActions;
|
|
@@ -935,26 +946,34 @@ export function prepareEntityTypes(
|
|
|
935
946
|
};
|
|
936
947
|
}
|
|
937
948
|
|
|
938
|
-
const mMetaModelMap: Record<string,
|
|
949
|
+
const mMetaModelMap: Record<string, ConvertedMetadata> = {};
|
|
939
950
|
|
|
940
951
|
/**
|
|
941
952
|
* Convert the ODataMetaModel into another format that allow for easy manipulation of the annotations.
|
|
942
953
|
*
|
|
943
|
-
* @param
|
|
954
|
+
* @param oMetaModel The ODataMetaModel
|
|
944
955
|
* @param oCapabilities The current capabilities
|
|
945
|
-
* @returns
|
|
956
|
+
* @returns An object containing object-like annotations
|
|
946
957
|
*/
|
|
947
|
-
export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities):
|
|
958
|
+
export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities): ConvertedMetadata {
|
|
948
959
|
const sMetaModelId = (oMetaModel as any).id;
|
|
949
960
|
if (!mMetaModelMap.hasOwnProperty(sMetaModelId)) {
|
|
950
961
|
const parsedOutput = prepareEntityTypes(oMetaModel, oCapabilities);
|
|
951
962
|
try {
|
|
952
|
-
mMetaModelMap[sMetaModelId] = AnnotationConverter.
|
|
963
|
+
mMetaModelMap[sMetaModelId] = AnnotationConverter.convert(parsedOutput);
|
|
953
964
|
} catch (oError) {
|
|
954
965
|
throw new Error(oError as any);
|
|
955
966
|
}
|
|
956
967
|
}
|
|
957
|
-
return mMetaModelMap[sMetaModelId] as any as
|
|
968
|
+
return mMetaModelMap[sMetaModelId] as any as ConvertedMetadata;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export function getConvertedTypes(oContext: Context) {
|
|
972
|
+
const oMetaModel = oContext.getModel() as unknown as ODataMetaModel;
|
|
973
|
+
if (!oMetaModel.isA("sap.ui.model.odata.v4.ODataMetaModel")) {
|
|
974
|
+
throw new Error("This should only be called on a ODataMetaModel");
|
|
975
|
+
}
|
|
976
|
+
return convertTypes(oMetaModel);
|
|
958
977
|
}
|
|
959
978
|
|
|
960
979
|
export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
|
|
@@ -962,15 +981,15 @@ export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
|
|
|
962
981
|
}
|
|
963
982
|
|
|
964
983
|
export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisitedObjects: boolean = false): any {
|
|
965
|
-
const
|
|
984
|
+
const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
|
|
966
985
|
const sPath = oMetaModelContext.getPath();
|
|
967
986
|
|
|
968
987
|
const aPathSplit = sPath.split("/");
|
|
969
|
-
let targetEntitySet:
|
|
988
|
+
let targetEntitySet: EntitySet | Singleton = oConvertedMetadata.entitySets.find(
|
|
970
989
|
(entitySet) => entitySet.name === aPathSplit[1]
|
|
971
|
-
) as
|
|
990
|
+
) as EntitySet;
|
|
972
991
|
if (!targetEntitySet) {
|
|
973
|
-
targetEntitySet =
|
|
992
|
+
targetEntitySet = oConvertedMetadata.singletons.find((singleton) => singleton.name === aPathSplit[1]) as Singleton;
|
|
974
993
|
}
|
|
975
994
|
let relativePath = aPathSplit.slice(2).join("/");
|
|
976
995
|
|
|
@@ -1041,10 +1060,9 @@ export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisi
|
|
|
1041
1060
|
const action = actions[relativeSplit[0]];
|
|
1042
1061
|
if (relativeSplit[1] && action.parameters) {
|
|
1043
1062
|
const parameterName = relativeSplit[1];
|
|
1044
|
-
|
|
1045
|
-
return parameter.fullyQualifiedName.endsWith(
|
|
1063
|
+
return action.parameters.find((parameter) => {
|
|
1064
|
+
return parameter.fullyQualifiedName.endsWith(`/${parameterName}`);
|
|
1046
1065
|
});
|
|
1047
|
-
return targetParameter;
|
|
1048
1066
|
} else if (relativePath.length === 1) {
|
|
1049
1067
|
return action;
|
|
1050
1068
|
}
|
|
@@ -1072,18 +1090,18 @@ export type ResolvedTarget = {
|
|
|
1072
1090
|
};
|
|
1073
1091
|
|
|
1074
1092
|
export function getInvolvedDataModelObjects(oMetaModelContext: Context, oEntitySetMetaModelContext?: Context): DataModelObjectPath {
|
|
1075
|
-
const
|
|
1093
|
+
const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
|
|
1076
1094
|
const metaModelContext = convertMetaModelContext(oMetaModelContext, true);
|
|
1077
1095
|
let targetEntitySetLocation;
|
|
1078
1096
|
if (oEntitySetMetaModelContext && oEntitySetMetaModelContext.getPath() !== "/") {
|
|
1079
1097
|
targetEntitySetLocation = getInvolvedDataModelObjects(oEntitySetMetaModelContext);
|
|
1080
1098
|
}
|
|
1081
|
-
return getInvolvedDataModelObjectFromPath(metaModelContext,
|
|
1099
|
+
return getInvolvedDataModelObjectFromPath(metaModelContext, oConvertedMetadata, targetEntitySetLocation);
|
|
1082
1100
|
}
|
|
1083
1101
|
|
|
1084
1102
|
export function getInvolvedDataModelObjectFromPath(
|
|
1085
1103
|
metaModelContext: ResolvedTarget,
|
|
1086
|
-
convertedTypes:
|
|
1104
|
+
convertedTypes: ConvertedMetadata,
|
|
1087
1105
|
targetEntitySetLocation?: DataModelObjectPath
|
|
1088
1106
|
): DataModelObjectPath {
|
|
1089
1107
|
const dataModelObjects = metaModelContext.visitedObjects.filter(
|
|
@@ -1092,11 +1110,11 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1092
1110
|
if (metaModelContext.target && metaModelContext.target.hasOwnProperty("_type") && metaModelContext.target._type !== "EntityType") {
|
|
1093
1111
|
dataModelObjects.push(metaModelContext.target);
|
|
1094
1112
|
}
|
|
1095
|
-
const navigationProperties:
|
|
1096
|
-
const rootEntitySet:
|
|
1113
|
+
const navigationProperties: NavigationProperty[] = [];
|
|
1114
|
+
const rootEntitySet: EntitySet = dataModelObjects[0] as EntitySet;
|
|
1097
1115
|
// currentEntitySet can be undefined.
|
|
1098
|
-
let currentEntitySet:
|
|
1099
|
-
let currentEntityType:
|
|
1116
|
+
let currentEntitySet: EntitySet | undefined = rootEntitySet;
|
|
1117
|
+
let currentEntityType: EntityType = rootEntitySet.entityType;
|
|
1100
1118
|
let i = 1;
|
|
1101
1119
|
let currentObject;
|
|
1102
1120
|
let navigatedPaths = [];
|
|
@@ -1104,17 +1122,17 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1104
1122
|
currentObject = dataModelObjects[i++];
|
|
1105
1123
|
if (currentObject._type === "NavigationProperty") {
|
|
1106
1124
|
navigatedPaths.push(currentObject.name);
|
|
1107
|
-
navigationProperties.push(currentObject as
|
|
1108
|
-
currentEntityType = (currentObject as
|
|
1125
|
+
navigationProperties.push(currentObject as NavigationProperty);
|
|
1126
|
+
currentEntityType = (currentObject as NavigationProperty).targetType;
|
|
1109
1127
|
if (currentEntitySet && currentEntitySet.navigationPropertyBinding.hasOwnProperty(navigatedPaths.join("/"))) {
|
|
1110
|
-
currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name];
|
|
1128
|
+
currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name] as EntitySet;
|
|
1111
1129
|
navigatedPaths = [];
|
|
1112
1130
|
} else {
|
|
1113
1131
|
currentEntitySet = undefined;
|
|
1114
1132
|
}
|
|
1115
1133
|
}
|
|
1116
1134
|
if (currentObject._type === "EntitySet") {
|
|
1117
|
-
currentEntitySet = currentObject as
|
|
1135
|
+
currentEntitySet = currentObject as EntitySet;
|
|
1118
1136
|
currentEntityType = currentEntitySet.entityType;
|
|
1119
1137
|
}
|
|
1120
1138
|
}
|
|
@@ -1129,7 +1147,7 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1129
1147
|
targetEntitySetLocation.startingEntitySet = rootEntitySet;
|
|
1130
1148
|
targetEntitySetLocation.navigationProperties = requiredDataModelObjects
|
|
1131
1149
|
.filter((object: any) => object._type === "NavigationProperty")
|
|
1132
|
-
.concat(targetEntitySetLocation.navigationProperties) as
|
|
1150
|
+
.concat(targetEntitySetLocation.navigationProperties) as NavigationProperty[];
|
|
1133
1151
|
}
|
|
1134
1152
|
}
|
|
1135
1153
|
const outDataModelPath = {
|