@sapui5/sap.fe.core 1.102.2 → 1.104.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 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +73 -30
- package/src/sap/fe/core/AppComponent.ts +65 -43
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- 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 +227 -126
- package/src/sap/fe/core/CommonUtils.ts +240 -163
- 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/BuildingBlock.js +181 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
- 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 +101 -74
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
- 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 +9 -9
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -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 +170 -139
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- 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 +200 -131
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- 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 +11 -10
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- 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 +190 -141
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
- 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 +71 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
- 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 +7 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +15 -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 +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- 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 +52 -61
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
- 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 +64 -35
- package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
- 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 +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- 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 +26 -33
- 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 +30 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
- package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
- package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
- package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
- 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 +65 -59
- 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 +77 -73
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- 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 +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -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 -5
- 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 +55 -42
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
- 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 +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -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 +1832 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -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 +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- 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/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- 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 +39 -63
- package/src/sap/fe/core/messagebundle_ar.properties +25 -39
- package/src/sap/fe/core/messagebundle_bg.properties +25 -39
- package/src/sap/fe/core/messagebundle_ca.properties +25 -39
- package/src/sap/fe/core/messagebundle_cs.properties +25 -39
- package/src/sap/fe/core/messagebundle_cy.properties +25 -39
- package/src/sap/fe/core/messagebundle_da.properties +25 -39
- package/src/sap/fe/core/messagebundle_de.properties +25 -39
- package/src/sap/fe/core/messagebundle_el.properties +26 -40
- package/src/sap/fe/core/messagebundle_en.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
- package/src/sap/fe/core/messagebundle_es.properties +27 -41
- package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
- package/src/sap/fe/core/messagebundle_et.properties +25 -39
- package/src/sap/fe/core/messagebundle_fi.properties +25 -39
- package/src/sap/fe/core/messagebundle_fr.properties +26 -40
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
- package/src/sap/fe/core/messagebundle_hi.properties +25 -39
- package/src/sap/fe/core/messagebundle_hr.properties +25 -39
- package/src/sap/fe/core/messagebundle_hu.properties +25 -39
- package/src/sap/fe/core/messagebundle_id.properties +25 -39
- package/src/sap/fe/core/messagebundle_it.properties +41 -55
- package/src/sap/fe/core/messagebundle_iw.properties +25 -39
- package/src/sap/fe/core/messagebundle_ja.properties +25 -39
- package/src/sap/fe/core/messagebundle_kk.properties +25 -39
- package/src/sap/fe/core/messagebundle_ko.properties +30 -44
- package/src/sap/fe/core/messagebundle_lt.properties +25 -39
- package/src/sap/fe/core/messagebundle_lv.properties +25 -39
- package/src/sap/fe/core/messagebundle_ms.properties +25 -39
- package/src/sap/fe/core/messagebundle_nl.properties +27 -41
- package/src/sap/fe/core/messagebundle_no.properties +25 -39
- package/src/sap/fe/core/messagebundle_pl.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
- package/src/sap/fe/core/messagebundle_ro.properties +25 -39
- package/src/sap/fe/core/messagebundle_ru.properties +25 -39
- package/src/sap/fe/core/messagebundle_sh.properties +25 -39
- package/src/sap/fe/core/messagebundle_sk.properties +25 -39
- package/src/sap/fe/core/messagebundle_sl.properties +25 -39
- package/src/sap/fe/core/messagebundle_sv.properties +25 -39
- package/src/sap/fe/core/messagebundle_th.properties +25 -39
- package/src/sap/fe/core/messagebundle_tr.properties +25 -39
- package/src/sap/fe/core/messagebundle_uk.properties +25 -39
- package/src/sap/fe/core/messagebundle_vi.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
- 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 +97 -69
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
- 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 +61 -49
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- 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 +92 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -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 +224 -198
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
- 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 +16 -15
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- 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 +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- 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,8 @@ 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
|
+
isCollection: param.$isCollection ?? false,
|
|
795
|
+
name: param.$Name,
|
|
789
796
|
type: param.$Type
|
|
790
797
|
};
|
|
791
798
|
})
|
|
@@ -794,14 +801,14 @@ function prepareAction(actionName: string, actionRawData: MetaModelAction, names
|
|
|
794
801
|
export function prepareEntityTypes(
|
|
795
802
|
oMetaModel: ODataMetaModel,
|
|
796
803
|
oCapabilities: EnvironmentCapabilities = DefaultEnvironmentCapabilities
|
|
797
|
-
):
|
|
804
|
+
): RawMetadata {
|
|
798
805
|
const oMetaModelData = oMetaModel.getObject("/$");
|
|
799
806
|
const annotationLists: Record<string, AnnotationList> = {};
|
|
800
|
-
const entityTypes:
|
|
801
|
-
const entitySets:
|
|
802
|
-
const singletons:
|
|
803
|
-
const complexTypes:
|
|
804
|
-
const typeDefinitions:
|
|
807
|
+
const entityTypes: RawEntityType[] = [];
|
|
808
|
+
const entitySets: RawEntitySet[] = [];
|
|
809
|
+
const singletons: RawSingleton[] = [];
|
|
810
|
+
const complexTypes: RawComplexType[] = [];
|
|
811
|
+
const typeDefinitions: RawTypeDefinition[] = [];
|
|
805
812
|
const entityContainerName = oMetaModelData.$EntityContainer;
|
|
806
813
|
let namespace = "";
|
|
807
814
|
const schemaKeys = Object.keys(oMetaModelData).filter((metamodelKey) => oMetaModelData[metamodelKey].$kind === "Schema");
|
|
@@ -873,10 +880,15 @@ export function prepareEntityTypes(
|
|
|
873
880
|
}
|
|
874
881
|
});
|
|
875
882
|
|
|
876
|
-
let entityContainer:
|
|
883
|
+
let entityContainer: RawEntityContainer = {
|
|
884
|
+
_type: "EntityContainer",
|
|
885
|
+
name: "",
|
|
886
|
+
fullyQualifiedName: ""
|
|
887
|
+
};
|
|
877
888
|
if (entityContainerName) {
|
|
878
889
|
entityContainer = {
|
|
879
|
-
|
|
890
|
+
_type: "EntityContainer",
|
|
891
|
+
name: entityContainerName.replace(`${namespace}.`, ""),
|
|
880
892
|
fullyQualifiedName: entityContainerName
|
|
881
893
|
};
|
|
882
894
|
}
|
|
@@ -892,13 +904,13 @@ export function prepareEntityTypes(
|
|
|
892
904
|
}
|
|
893
905
|
});
|
|
894
906
|
|
|
895
|
-
const actions:
|
|
907
|
+
const actions: RawAction[] = Object.keys(oMetaModelData)
|
|
896
908
|
.filter((key) => {
|
|
897
909
|
return Array.isArray(oMetaModelData[key]) && oMetaModelData[key].length > 0 && oMetaModelData[key][0].$kind === "Action";
|
|
898
910
|
})
|
|
899
|
-
.reduce((outActions:
|
|
900
|
-
const
|
|
901
|
-
|
|
911
|
+
.reduce((outActions: RawAction[], actionName) => {
|
|
912
|
+
const innerActions = oMetaModelData[actionName];
|
|
913
|
+
innerActions.forEach((action: MetaModelAction) => {
|
|
902
914
|
outActions.push(prepareAction(actionName, action, namespace, entityContainerName));
|
|
903
915
|
});
|
|
904
916
|
return outActions;
|
|
@@ -935,26 +947,34 @@ export function prepareEntityTypes(
|
|
|
935
947
|
};
|
|
936
948
|
}
|
|
937
949
|
|
|
938
|
-
const mMetaModelMap: Record<string,
|
|
950
|
+
const mMetaModelMap: Record<string, ConvertedMetadata> = {};
|
|
939
951
|
|
|
940
952
|
/**
|
|
941
953
|
* Convert the ODataMetaModel into another format that allow for easy manipulation of the annotations.
|
|
942
954
|
*
|
|
943
|
-
* @param
|
|
955
|
+
* @param oMetaModel The ODataMetaModel
|
|
944
956
|
* @param oCapabilities The current capabilities
|
|
945
|
-
* @returns
|
|
957
|
+
* @returns An object containing object-like annotations
|
|
946
958
|
*/
|
|
947
|
-
export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities):
|
|
959
|
+
export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities): ConvertedMetadata {
|
|
948
960
|
const sMetaModelId = (oMetaModel as any).id;
|
|
949
961
|
if (!mMetaModelMap.hasOwnProperty(sMetaModelId)) {
|
|
950
962
|
const parsedOutput = prepareEntityTypes(oMetaModel, oCapabilities);
|
|
951
963
|
try {
|
|
952
|
-
mMetaModelMap[sMetaModelId] = AnnotationConverter.
|
|
964
|
+
mMetaModelMap[sMetaModelId] = AnnotationConverter.convert(parsedOutput);
|
|
953
965
|
} catch (oError) {
|
|
954
966
|
throw new Error(oError as any);
|
|
955
967
|
}
|
|
956
968
|
}
|
|
957
|
-
return mMetaModelMap[sMetaModelId] as any as
|
|
969
|
+
return mMetaModelMap[sMetaModelId] as any as ConvertedMetadata;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
export function getConvertedTypes(oContext: Context) {
|
|
973
|
+
const oMetaModel = oContext.getModel() as unknown as ODataMetaModel;
|
|
974
|
+
if (!oMetaModel.isA("sap.ui.model.odata.v4.ODataMetaModel")) {
|
|
975
|
+
throw new Error("This should only be called on a ODataMetaModel");
|
|
976
|
+
}
|
|
977
|
+
return convertTypes(oMetaModel);
|
|
958
978
|
}
|
|
959
979
|
|
|
960
980
|
export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
|
|
@@ -962,17 +982,23 @@ export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
|
|
|
962
982
|
}
|
|
963
983
|
|
|
964
984
|
export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisitedObjects: boolean = false): any {
|
|
965
|
-
const
|
|
985
|
+
const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
|
|
966
986
|
const sPath = oMetaModelContext.getPath();
|
|
967
987
|
|
|
968
988
|
const aPathSplit = sPath.split("/");
|
|
969
|
-
let
|
|
970
|
-
|
|
971
|
-
)
|
|
989
|
+
let firstPart = aPathSplit[1];
|
|
990
|
+
let beginIndex = 2;
|
|
991
|
+
if (oConvertedMetadata.entityContainer.fullyQualifiedName === firstPart) {
|
|
992
|
+
firstPart = aPathSplit[2];
|
|
993
|
+
beginIndex++;
|
|
994
|
+
}
|
|
995
|
+
let targetEntitySet: EntitySet | Singleton = oConvertedMetadata.entitySets.find(
|
|
996
|
+
(entitySet) => entitySet.name === firstPart
|
|
997
|
+
) as EntitySet;
|
|
972
998
|
if (!targetEntitySet) {
|
|
973
|
-
targetEntitySet =
|
|
999
|
+
targetEntitySet = oConvertedMetadata.singletons.find((singleton) => singleton.name === firstPart) as Singleton;
|
|
974
1000
|
}
|
|
975
|
-
let relativePath = aPathSplit.slice(
|
|
1001
|
+
let relativePath = aPathSplit.slice(beginIndex).join("/");
|
|
976
1002
|
|
|
977
1003
|
const localObjects: any[] = [targetEntitySet];
|
|
978
1004
|
while (relativePath && relativePath.length > 0 && relativePath.startsWith("$NavigationPropertyBinding")) {
|
|
@@ -1041,10 +1067,9 @@ export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisi
|
|
|
1041
1067
|
const action = actions[relativeSplit[0]];
|
|
1042
1068
|
if (relativeSplit[1] && action.parameters) {
|
|
1043
1069
|
const parameterName = relativeSplit[1];
|
|
1044
|
-
|
|
1045
|
-
return parameter.fullyQualifiedName.endsWith(
|
|
1070
|
+
return action.parameters.find((parameter) => {
|
|
1071
|
+
return parameter.fullyQualifiedName.endsWith(`/${parameterName}`);
|
|
1046
1072
|
});
|
|
1047
|
-
return targetParameter;
|
|
1048
1073
|
} else if (relativePath.length === 1) {
|
|
1049
1074
|
return action;
|
|
1050
1075
|
}
|
|
@@ -1072,18 +1097,18 @@ export type ResolvedTarget = {
|
|
|
1072
1097
|
};
|
|
1073
1098
|
|
|
1074
1099
|
export function getInvolvedDataModelObjects(oMetaModelContext: Context, oEntitySetMetaModelContext?: Context): DataModelObjectPath {
|
|
1075
|
-
const
|
|
1100
|
+
const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
|
|
1076
1101
|
const metaModelContext = convertMetaModelContext(oMetaModelContext, true);
|
|
1077
1102
|
let targetEntitySetLocation;
|
|
1078
1103
|
if (oEntitySetMetaModelContext && oEntitySetMetaModelContext.getPath() !== "/") {
|
|
1079
1104
|
targetEntitySetLocation = getInvolvedDataModelObjects(oEntitySetMetaModelContext);
|
|
1080
1105
|
}
|
|
1081
|
-
return getInvolvedDataModelObjectFromPath(metaModelContext,
|
|
1106
|
+
return getInvolvedDataModelObjectFromPath(metaModelContext, oConvertedMetadata, targetEntitySetLocation);
|
|
1082
1107
|
}
|
|
1083
1108
|
|
|
1084
1109
|
export function getInvolvedDataModelObjectFromPath(
|
|
1085
1110
|
metaModelContext: ResolvedTarget,
|
|
1086
|
-
convertedTypes:
|
|
1111
|
+
convertedTypes: ConvertedMetadata,
|
|
1087
1112
|
targetEntitySetLocation?: DataModelObjectPath
|
|
1088
1113
|
): DataModelObjectPath {
|
|
1089
1114
|
const dataModelObjects = metaModelContext.visitedObjects.filter(
|
|
@@ -1092,11 +1117,11 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1092
1117
|
if (metaModelContext.target && metaModelContext.target.hasOwnProperty("_type") && metaModelContext.target._type !== "EntityType") {
|
|
1093
1118
|
dataModelObjects.push(metaModelContext.target);
|
|
1094
1119
|
}
|
|
1095
|
-
const navigationProperties:
|
|
1096
|
-
const rootEntitySet:
|
|
1120
|
+
const navigationProperties: NavigationProperty[] = [];
|
|
1121
|
+
const rootEntitySet: EntitySet = dataModelObjects[0] as EntitySet;
|
|
1097
1122
|
// currentEntitySet can be undefined.
|
|
1098
|
-
let currentEntitySet:
|
|
1099
|
-
let currentEntityType:
|
|
1123
|
+
let currentEntitySet: EntitySet | undefined = rootEntitySet;
|
|
1124
|
+
let currentEntityType: EntityType = rootEntitySet.entityType;
|
|
1100
1125
|
let i = 1;
|
|
1101
1126
|
let currentObject;
|
|
1102
1127
|
let navigatedPaths = [];
|
|
@@ -1104,17 +1129,17 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1104
1129
|
currentObject = dataModelObjects[i++];
|
|
1105
1130
|
if (currentObject._type === "NavigationProperty") {
|
|
1106
1131
|
navigatedPaths.push(currentObject.name);
|
|
1107
|
-
navigationProperties.push(currentObject as
|
|
1108
|
-
currentEntityType = (currentObject as
|
|
1132
|
+
navigationProperties.push(currentObject as NavigationProperty);
|
|
1133
|
+
currentEntityType = (currentObject as NavigationProperty).targetType;
|
|
1109
1134
|
if (currentEntitySet && currentEntitySet.navigationPropertyBinding.hasOwnProperty(navigatedPaths.join("/"))) {
|
|
1110
|
-
currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name];
|
|
1135
|
+
currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name] as EntitySet;
|
|
1111
1136
|
navigatedPaths = [];
|
|
1112
1137
|
} else {
|
|
1113
1138
|
currentEntitySet = undefined;
|
|
1114
1139
|
}
|
|
1115
1140
|
}
|
|
1116
1141
|
if (currentObject._type === "EntitySet") {
|
|
1117
|
-
currentEntitySet = currentObject as
|
|
1142
|
+
currentEntitySet = currentObject as EntitySet;
|
|
1118
1143
|
currentEntityType = currentEntitySet.entityType;
|
|
1119
1144
|
}
|
|
1120
1145
|
}
|
|
@@ -1129,7 +1154,7 @@ export function getInvolvedDataModelObjectFromPath(
|
|
|
1129
1154
|
targetEntitySetLocation.startingEntitySet = rootEntitySet;
|
|
1130
1155
|
targetEntitySetLocation.navigationProperties = requiredDataModelObjects
|
|
1131
1156
|
.filter((object: any) => object._type === "NavigationProperty")
|
|
1132
|
-
.concat(targetEntitySetLocation.navigationProperties) as
|
|
1157
|
+
.concat(targetEntitySetLocation.navigationProperties) as NavigationProperty[];
|
|
1133
1158
|
}
|
|
1134
1159
|
}
|
|
1135
1160
|
const outDataModelPath = {
|