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