@sapui5/sap.fe.core 1.102.0 → 1.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +62 -26
- package/src/sap/fe/core/AppComponent.ts +56 -40
- package/src/sap/fe/core/AppStateHandler.js +10 -10
- package/src/sap/fe/core/AppStateHandler.ts +9 -9
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +236 -109
- package/src/sap/fe/core/CommonUtils.ts +252 -136
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +31 -26
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +8 -8
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +22 -22
- package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +65 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +6 -6
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +184 -137
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -44
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +2 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +11 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +47 -47
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +50 -32
- package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -34
- package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -26
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
- package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
- package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +64 -57
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +73 -72
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +14 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +281 -254
- package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +49 -35
- package/src/sap/fe/core/messagebundle_ar.properties +13 -5
- package/src/sap/fe/core/messagebundle_bg.properties +13 -5
- package/src/sap/fe/core/messagebundle_ca.properties +13 -5
- package/src/sap/fe/core/messagebundle_cs.properties +13 -5
- package/src/sap/fe/core/messagebundle_cy.properties +14 -6
- package/src/sap/fe/core/messagebundle_da.properties +13 -5
- package/src/sap/fe/core/messagebundle_de.properties +15 -7
- package/src/sap/fe/core/messagebundle_el.properties +14 -6
- package/src/sap/fe/core/messagebundle_en.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
- package/src/sap/fe/core/messagebundle_es.properties +13 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
- package/src/sap/fe/core/messagebundle_et.properties +13 -5
- package/src/sap/fe/core/messagebundle_fi.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
- package/src/sap/fe/core/messagebundle_hi.properties +14 -6
- package/src/sap/fe/core/messagebundle_hr.properties +14 -6
- package/src/sap/fe/core/messagebundle_hu.properties +13 -5
- package/src/sap/fe/core/messagebundle_id.properties +13 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -25
- package/src/sap/fe/core/messagebundle_iw.properties +13 -5
- package/src/sap/fe/core/messagebundle_ja.properties +14 -6
- package/src/sap/fe/core/messagebundle_kk.properties +13 -5
- package/src/sap/fe/core/messagebundle_ko.properties +13 -5
- package/src/sap/fe/core/messagebundle_lt.properties +13 -5
- package/src/sap/fe/core/messagebundle_lv.properties +14 -6
- package/src/sap/fe/core/messagebundle_ms.properties +13 -5
- package/src/sap/fe/core/messagebundle_nl.properties +13 -5
- package/src/sap/fe/core/messagebundle_no.properties +13 -5
- package/src/sap/fe/core/messagebundle_pl.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
- package/src/sap/fe/core/messagebundle_ro.properties +13 -5
- package/src/sap/fe/core/messagebundle_ru.properties +13 -5
- package/src/sap/fe/core/messagebundle_sh.properties +13 -5
- package/src/sap/fe/core/messagebundle_sk.properties +13 -5
- package/src/sap/fe/core/messagebundle_sl.properties +17 -9
- package/src/sap/fe/core/messagebundle_sv.properties +14 -6
- package/src/sap/fe/core/messagebundle_th.properties +13 -5
- package/src/sap/fe/core/messagebundle_tr.properties +13 -5
- package/src/sap/fe/core/messagebundle_uk.properties +13 -5
- package/src/sap/fe/core/messagebundle_vi.properties +13 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +53 -44
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +72 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +20 -15
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +10 -9
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +148 -93
- package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { EntityType } from "@sap-ux/
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { compileBinding } from "sap/fe/core/helpers/BindingExpression";
|
|
6
|
-
import { checkFilterExpressionRestrictions } from "sap/fe/core/templating/DataModelPathHelper";
|
|
1
|
+
import type { AnnotationTerm, EntityType } from "@sap-ux/vocabularies-types";
|
|
2
|
+
import type { CustomAggregate } from "@sap-ux/vocabularies-types/vocabularies/Aggregation";
|
|
3
|
+
import type { NavigationPropertyRestrictionTypes } from "@sap-ux/vocabularies-types/vocabularies/Capabilities";
|
|
4
|
+
import type ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
7
5
|
import { AggregationHelper } from "sap/fe/core/converters/helpers/Aggregation";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { IssueCategory, IssueSeverity, IssueType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
7
|
+
import type { FilterFieldManifestConfiguration } from "sap/fe/core/converters/ManifestSettings";
|
|
8
|
+
import { compileExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
9
|
+
import { checkFilterExpressionRestrictions } from "sap/fe/core/templating/DataModelPathHelper";
|
|
10
|
+
import { getIsRequired, isPropertyFilterable } from "sap/fe/core/templating/FilterTemplating";
|
|
12
11
|
|
|
13
12
|
export type VisualFilters = {
|
|
14
13
|
dimensionPath?: string;
|
|
@@ -30,12 +29,13 @@ export type VisualFilters = {
|
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Checks that measures and dimensions of the visual filter chart can be aggregated and grouped.
|
|
32
|
+
*
|
|
33
33
|
* @param converterContext The converter context
|
|
34
34
|
* @param chartAnnotation The chart annotation
|
|
35
35
|
* @param aggregationHelper The aggregation helper
|
|
36
|
-
* @returns
|
|
36
|
+
* @returns `true` if the measure can be grouped and aggregated
|
|
37
37
|
*/
|
|
38
|
-
const _checkVFAggregation = function(
|
|
38
|
+
const _checkVFAggregation = function (
|
|
39
39
|
converterContext: ConverterContext,
|
|
40
40
|
chartAnnotation: any,
|
|
41
41
|
aggregationHelper: any
|
|
@@ -47,14 +47,14 @@ const _checkVFAggregation = function(
|
|
|
47
47
|
const aTransAggregations = aggregationHelper.getTransAggregations();
|
|
48
48
|
|
|
49
49
|
if (
|
|
50
|
-
customAggregates.some(function(custAgg: AnnotationTerm<CustomAggregate>) {
|
|
50
|
+
customAggregates.some(function (custAgg: AnnotationTerm<CustomAggregate>) {
|
|
51
51
|
return custAgg.qualifier === sMeasure;
|
|
52
52
|
})
|
|
53
53
|
) {
|
|
54
54
|
sMeasurePath = sMeasure;
|
|
55
55
|
} else if (aTransAggregations && aTransAggregations[0]) {
|
|
56
56
|
const aAggregations = aTransAggregations[0];
|
|
57
|
-
aAggregations.some(function(oAggregate: any) {
|
|
57
|
+
aAggregations.some(function (oAggregate: any) {
|
|
58
58
|
if (oAggregate.Name === sMeasure) {
|
|
59
59
|
sMeasurePath = oAggregate?.AggregatableProperty.value;
|
|
60
60
|
}
|
|
@@ -81,11 +81,12 @@ const _checkVFAggregation = function(
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Method to get the visual filters object for a property.
|
|
84
|
+
*
|
|
84
85
|
* @param entityType The converter context
|
|
85
86
|
* @param converterContext The chart annotation
|
|
86
87
|
* @param sPropertyPath The aggregation helper
|
|
87
88
|
* @param FilterFields The aggregation helper
|
|
88
|
-
* @returns
|
|
89
|
+
* @returns The visual filters
|
|
89
90
|
*/
|
|
90
91
|
export function getVisualFilters(
|
|
91
92
|
entityType: EntityType,
|
|
@@ -98,13 +99,13 @@ export function getVisualFilters(
|
|
|
98
99
|
if (oVisualFilter?.visualFilter?.valueList) {
|
|
99
100
|
const oVFPath = oVisualFilter?.visualFilter?.valueList;
|
|
100
101
|
const annotationQualifierSplit = oVFPath.split("#");
|
|
101
|
-
const qualifierVL = annotationQualifierSplit.length > 1 ?
|
|
102
|
+
const qualifierVL = annotationQualifierSplit.length > 1 ? `ValueList#${annotationQualifierSplit[1]}` : annotationQualifierSplit[0];
|
|
102
103
|
const property = entityType.resolvePath(sPropertyPath);
|
|
103
104
|
const valueList: any = property?.annotations?.Common[qualifierVL];
|
|
104
105
|
if (valueList) {
|
|
105
106
|
const collectionPath = valueList?.CollectionPath;
|
|
106
107
|
let collectionPathConverterContext = converterContext.getConverterContextFor(
|
|
107
|
-
|
|
108
|
+
`/${collectionPath || converterContext.getEntitySet()?.name}`
|
|
108
109
|
);
|
|
109
110
|
const valueListParams = valueList?.Parameters;
|
|
110
111
|
let outParameter: any;
|
|
@@ -116,12 +117,12 @@ export function getVisualFilters(
|
|
|
116
117
|
}
|
|
117
118
|
const parameterEntityType = collectionPathConverterContext.getParameterEntityType();
|
|
118
119
|
aParameters = parameterEntityType
|
|
119
|
-
? parameterEntityType.keys.map(function(key) {
|
|
120
|
+
? parameterEntityType.keys.map(function (key) {
|
|
120
121
|
return key.name;
|
|
121
122
|
})
|
|
122
123
|
: [];
|
|
123
124
|
if (converterContext.getContextPath() === collectionPathConverterContext.getContextPath()) {
|
|
124
|
-
aParameters.forEach(function(parameter: any) {
|
|
125
|
+
aParameters.forEach(function (parameter: any) {
|
|
125
126
|
inParameters.push({
|
|
126
127
|
localDataProperty: parameter,
|
|
127
128
|
valueListProperty: parameter
|
|
@@ -130,8 +131,8 @@ export function getVisualFilters(
|
|
|
130
131
|
}
|
|
131
132
|
if (valueListParams) {
|
|
132
133
|
for (const valueListParam of valueListParams) {
|
|
133
|
-
const localDataProperty =
|
|
134
|
-
const valueListProperty =
|
|
134
|
+
const localDataProperty = valueListParam.LocalDataProperty?.value;
|
|
135
|
+
const valueListProperty = valueListParam.ValueListProperty;
|
|
135
136
|
if (
|
|
136
137
|
(valueListParam?.$Type === "com.sap.vocabularies.Common.v1.ValueListParameterInOut" ||
|
|
137
138
|
valueListParam?.$Type === "com.sap.vocabularies.Common.v1.ValueListParameterOut") &&
|
|
@@ -155,8 +156,8 @@ export function getVisualFilters(
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
if (inParameters && inParameters.length) {
|
|
158
|
-
inParameters.forEach(function(oInParameter: any) {
|
|
159
|
-
const mainEntitySetInMappingAllowedExpression =
|
|
159
|
+
inParameters.forEach(function (oInParameter: any) {
|
|
160
|
+
const mainEntitySetInMappingAllowedExpression = compileExpression(
|
|
160
161
|
checkFilterExpressionRestrictions(
|
|
161
162
|
converterContext
|
|
162
163
|
.getConverterContextFor(converterContext.getAbsoluteAnnotationPath(oInParameter?.localDataProperty))
|
|
@@ -164,7 +165,7 @@ export function getVisualFilters(
|
|
|
164
165
|
["SingleValue"]
|
|
165
166
|
)
|
|
166
167
|
);
|
|
167
|
-
const valueListEntitySetInMappingAllowedExpression =
|
|
168
|
+
const valueListEntitySetInMappingAllowedExpression = compileExpression(
|
|
168
169
|
checkFilterExpressionRestrictions(
|
|
169
170
|
collectionPathConverterContext
|
|
170
171
|
.getConverterContextFor(
|
|
@@ -175,23 +176,22 @@ export function getVisualFilters(
|
|
|
175
176
|
)
|
|
176
177
|
);
|
|
177
178
|
if (valueListEntitySetInMappingAllowedExpression === "true" && mainEntitySetInMappingAllowedExpression === "false") {
|
|
178
|
-
throw new Error(
|
|
179
|
-
"FilterRestrictions of " + sPropertyPath + " in MainEntitySet and ValueListEntitySet are different"
|
|
180
|
-
);
|
|
179
|
+
throw new Error(`FilterRestrictions of ${sPropertyPath} in MainEntitySet and ValueListEntitySet are different`);
|
|
181
180
|
}
|
|
182
181
|
});
|
|
183
182
|
}
|
|
184
183
|
const pvQualifier = valueList?.PresentationVariantQualifier;
|
|
185
184
|
const svQualifier = valueList?.SelectionVariantQualifier;
|
|
186
|
-
const pvAnnotation: any = collectionPathConverterContext?.getEntityTypeAnnotation(
|
|
187
|
-
|
|
185
|
+
const pvAnnotation: any = collectionPathConverterContext?.getEntityTypeAnnotation(
|
|
186
|
+
`@UI.PresentationVariant#${pvQualifier}`
|
|
187
|
+
)?.annotation;
|
|
188
188
|
const aggregationHelper = new AggregationHelper(collectionPathConverterContext.getEntityType(), collectionPathConverterContext);
|
|
189
189
|
if (!aggregationHelper.isAnalyticsSupported()) {
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (pvAnnotation) {
|
|
193
193
|
const aVisualizations = pvAnnotation?.Visualizations;
|
|
194
|
-
const contextPath =
|
|
194
|
+
const contextPath = `/${valueList?.CollectionPath}` || `/${collectionPathConverterContext?.getEntitySet()?.name}`;
|
|
195
195
|
visualFilter.contextPath = contextPath;
|
|
196
196
|
let chartAnnotation;
|
|
197
197
|
for (const visualization of aVisualizations) {
|
|
@@ -210,17 +210,18 @@ export function getVisualFilters(
|
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
const bDimensionHidden: boolean = chartAnnotation?.$target?.Dimensions[0]?.$target?.annotations?.UI?.Hidden?.valueOf();
|
|
213
|
-
const bDimensionHiddenFilter: boolean =
|
|
213
|
+
const bDimensionHiddenFilter: boolean =
|
|
214
|
+
chartAnnotation?.$target?.Dimensions[0]?.$target?.annotations?.UI?.HiddenFilter?.valueOf();
|
|
214
215
|
if (bDimensionHidden === true || bDimensionHiddenFilter === true) {
|
|
215
216
|
return;
|
|
216
217
|
} else if (aVisualizations && aVisualizations.length) {
|
|
217
218
|
visualFilter.chartAnnotation = chartAnnotation
|
|
218
219
|
? collectionPathConverterContext?.getAbsoluteAnnotationPath(
|
|
219
|
-
chartAnnotation.fullyQualifiedName
|
|
220
|
+
`${chartAnnotation.fullyQualifiedName}/$AnnotationPath/`
|
|
220
221
|
)
|
|
221
222
|
: undefined;
|
|
222
223
|
visualFilter.presentationAnnotation = pvAnnotation
|
|
223
|
-
? collectionPathConverterContext?.getAbsoluteAnnotationPath(pvAnnotation.fullyQualifiedName
|
|
224
|
+
? collectionPathConverterContext?.getAbsoluteAnnotationPath(`${pvAnnotation.fullyQualifiedName}/`)
|
|
224
225
|
: undefined;
|
|
225
226
|
visualFilter.outParameter = outParameter?.LocalDataProperty?.value;
|
|
226
227
|
visualFilter.inParameters = inParameters;
|
|
@@ -231,7 +232,7 @@ export function getVisualFilters(
|
|
|
231
232
|
["SingleRange", "MultiRange"]
|
|
232
233
|
);
|
|
233
234
|
|
|
234
|
-
if (
|
|
235
|
+
if (compileExpression(bIsRange) === "true") {
|
|
235
236
|
throw new Error("Range AllowedExpression is not supported for visual filters");
|
|
236
237
|
}
|
|
237
238
|
|
|
@@ -241,23 +242,25 @@ export function getVisualFilters(
|
|
|
241
242
|
.getDataModelObjectPath(),
|
|
242
243
|
["SingleValue"]
|
|
243
244
|
);
|
|
244
|
-
visualFilter.multipleSelectionAllowed =
|
|
245
|
+
visualFilter.multipleSelectionAllowed = compileExpression(!bIsMainEntitySetSingleSelection.value) as any;
|
|
245
246
|
visualFilter.required = getIsRequired(converterContext, sPropertyPath);
|
|
246
247
|
let svAnnotation: any;
|
|
247
248
|
if (svQualifier) {
|
|
248
|
-
svAnnotation = collectionPathConverterContext?.getEntityTypeAnnotation(
|
|
249
|
-
|
|
249
|
+
svAnnotation = collectionPathConverterContext?.getEntityTypeAnnotation(
|
|
250
|
+
`@UI.SelectionVariant#${svQualifier}`
|
|
251
|
+
)?.annotation;
|
|
250
252
|
visualFilter.selectionVariantAnnotation = svAnnotation
|
|
251
|
-
? collectionPathConverterContext?.getAbsoluteAnnotationPath(svAnnotation.fullyQualifiedName
|
|
253
|
+
? collectionPathConverterContext?.getAbsoluteAnnotationPath(`${svAnnotation.fullyQualifiedName}/`)
|
|
252
254
|
: undefined;
|
|
253
255
|
}
|
|
254
256
|
let requiredProperties = [];
|
|
255
257
|
if (parameterEntityType) {
|
|
256
258
|
const sEntitySet = collectionPath.split("/")[0];
|
|
257
259
|
const sNavigationProperty = collectionPath.split("/")[1];
|
|
258
|
-
const oEntitySetConverterContext = converterContext.getConverterContextFor(
|
|
259
|
-
const aRestrictedProperties =
|
|
260
|
-
?.annotations?.Capabilities
|
|
260
|
+
const oEntitySetConverterContext = converterContext.getConverterContextFor(`/${sEntitySet}`);
|
|
261
|
+
const aRestrictedProperties =
|
|
262
|
+
oEntitySetConverterContext?.getDataModelObjectPath().startingEntitySet?.annotations?.Capabilities
|
|
263
|
+
?.NavigationRestrictions?.RestrictedProperties;
|
|
261
264
|
const oRestrictedProperty = aRestrictedProperties?.find(
|
|
262
265
|
(restrictedNavProp: NavigationPropertyRestrictionTypes) => {
|
|
263
266
|
if (restrictedNavProp.NavigationProperty?.type === "NavigationPropertyPath") {
|
|
@@ -272,7 +275,7 @@ export function getVisualFilters(
|
|
|
272
275
|
}
|
|
273
276
|
let requiredPropertyPaths: Array<object> = [];
|
|
274
277
|
if (requiredProperties?.length) {
|
|
275
|
-
requiredProperties.forEach(function(oRequireProperty: any) {
|
|
278
|
+
requiredProperties.forEach(function (oRequireProperty: any) {
|
|
276
279
|
requiredPropertyPaths.push(oRequireProperty.value);
|
|
277
280
|
});
|
|
278
281
|
}
|
|
@@ -290,7 +293,7 @@ export function getVisualFilters(
|
|
|
290
293
|
selectOptions = selectOptions.concat(parameterOptions);
|
|
291
294
|
requiredPropertyPaths = requiredPropertyPaths.sort();
|
|
292
295
|
selectOptions = selectOptions.sort();
|
|
293
|
-
visualFilter.showOverlayInitially = requiredPropertyPaths.some(function(sPath) {
|
|
296
|
+
visualFilter.showOverlayInitially = requiredPropertyPaths.some(function (sPath) {
|
|
294
297
|
return selectOptions.indexOf(sPath) === -1;
|
|
295
298
|
});
|
|
296
299
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/fe/core/helpers/
|
|
5
|
+
sap.ui.define(["sap/fe/core/helpers/BindingToolkit"], function (BindingToolkit) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
var _exports = {};
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var getExpressionFromAnnotation = BindingToolkit.getExpressionFromAnnotation;
|
|
10
|
+
var compileExpression = BindingToolkit.compileExpression;
|
|
11
11
|
|
|
12
12
|
var AvatarShape;
|
|
13
13
|
|
|
@@ -32,10 +32,10 @@ sap.ui.define(["sap/fe/core/helpers/BindingExpression"], function (BindingExpres
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (headerInfo.ImageUrl && headerInfo.TypeImageUrl) {
|
|
35
|
-
return
|
|
35
|
+
return compileExpression(getExpressionFromAnnotation(headerInfo.TypeImageUrl));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return
|
|
38
|
+
return compileExpression(isNaturalPerson(converterContext) ? "sap-icon://person-placeholder" : "sap-icon://product");
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
var getSource = function (converterContext) {
|
|
@@ -47,7 +47,7 @@ sap.ui.define(["sap/fe/core/helpers/BindingExpression"], function (BindingExpres
|
|
|
47
47
|
return undefined;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
return
|
|
50
|
+
return compileExpression(getExpressionFromAnnotation(headerInfo.ImageUrl || headerInfo.TypeImageUrl));
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
var getAvatar = function (converterContext) {
|
|
@@ -62,13 +62,13 @@ sap.ui.define(["sap/fe/core/helpers/BindingExpression"], function (BindingExpres
|
|
|
62
62
|
|
|
63
63
|
return {
|
|
64
64
|
src: getSource(converterContext),
|
|
65
|
-
initials:
|
|
65
|
+
initials: compileExpression(getExpressionFromAnnotation((headerInfo === null || headerInfo === void 0 ? void 0 : headerInfo.Initials) || "")),
|
|
66
66
|
fallbackIcon: getFallBackIcon(converterContext),
|
|
67
|
-
displayShape:
|
|
67
|
+
displayShape: compileExpression(isNaturalPerson(converterContext) ? AvatarShape.Circle : AvatarShape.Square)
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
_exports.getAvatar = getAvatar;
|
|
72
72
|
return _exports;
|
|
73
73
|
}, false);
|
|
74
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
74
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkF2YXRhci50cyJdLCJuYW1lcyI6WyJBdmF0YXJTaGFwZSIsImlzTmF0dXJhbFBlcnNvbiIsImNvbnZlcnRlckNvbnRleHQiLCJnZXRFbnRpdHlUeXBlIiwiYW5ub3RhdGlvbnMiLCJDb21tb24iLCJJc05hdHVyYWxQZXJzb24iLCJ2YWx1ZU9mIiwiZ2V0RmFsbEJhY2tJY29uIiwiaGVhZGVySW5mbyIsIlVJIiwiSGVhZGVySW5mbyIsIkltYWdlVXJsIiwiVHlwZUltYWdlVXJsIiwidW5kZWZpbmVkIiwiY29tcGlsZUV4cHJlc3Npb24iLCJnZXRFeHByZXNzaW9uRnJvbUFubm90YXRpb24iLCJnZXRTb3VyY2UiLCJnZXRBdmF0YXIiLCJvU291cmNlIiwiSW5pdGlhbHMiLCJzcmMiLCJpbml0aWFscyIsImZhbGxiYWNrSWNvbiIsImRpc3BsYXlTaGFwZSIsIkNpcmNsZSIsIlNxdWFyZSJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7Ozs7TUFDS0EsVzs7YUFBQUEsVztBQUFBQSxJQUFBQSxXO0FBQUFBLElBQUFBLFc7S0FBQUEsVyxLQUFBQSxXOztBQVlMLE1BQU1DLGVBQWUsR0FBRyxVQUF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UuU3F1YXJlKVxuXHR9O1xufTtcbiJdfQ==
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { CompiledBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
2
|
+
import { compileExpression, getExpressionFromAnnotation } from "sap/fe/core/helpers/BindingToolkit";
|
|
3
|
+
import type ConverterContext from "../../ConverterContext";
|
|
3
4
|
enum AvatarShape {
|
|
4
5
|
Circle = "Circle",
|
|
5
6
|
Square = "Square"
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export type Avatar = {
|
|
9
|
-
src?:
|
|
10
|
-
initials:
|
|
11
|
-
fallbackIcon?:
|
|
12
|
-
displayShape:
|
|
10
|
+
src?: CompiledBindingToolkitExpression;
|
|
11
|
+
initials: CompiledBindingToolkitExpression;
|
|
12
|
+
fallbackIcon?: CompiledBindingToolkitExpression;
|
|
13
|
+
displayShape: CompiledBindingToolkitExpression;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const isNaturalPerson = (converterContext: ConverterContext): Boolean => {
|
|
16
17
|
return converterContext.getEntityType().annotations.Common?.IsNaturalPerson?.valueOf() === true;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
const getFallBackIcon = (converterContext: ConverterContext):
|
|
20
|
+
const getFallBackIcon = (converterContext: ConverterContext): CompiledBindingToolkitExpression | undefined => {
|
|
20
21
|
const headerInfo = converterContext.getEntityType().annotations?.UI?.HeaderInfo;
|
|
21
22
|
if (!headerInfo || (headerInfo && !headerInfo.ImageUrl && !headerInfo.TypeImageUrl)) {
|
|
22
23
|
return undefined;
|
|
23
24
|
}
|
|
24
25
|
if (headerInfo.ImageUrl && headerInfo.TypeImageUrl) {
|
|
25
|
-
return
|
|
26
|
+
return compileExpression(getExpressionFromAnnotation(headerInfo.TypeImageUrl));
|
|
26
27
|
}
|
|
27
|
-
return
|
|
28
|
+
return compileExpression(isNaturalPerson(converterContext) ? "sap-icon://person-placeholder" : "sap-icon://product");
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
const getSource = (converterContext: ConverterContext):
|
|
31
|
+
const getSource = (converterContext: ConverterContext): CompiledBindingToolkitExpression | undefined => {
|
|
31
32
|
const headerInfo = converterContext.getEntityType().annotations?.UI?.HeaderInfo;
|
|
32
33
|
if (!headerInfo || !(headerInfo.ImageUrl || headerInfo.TypeImageUrl)) {
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
35
|
-
return
|
|
36
|
+
return compileExpression(getExpressionFromAnnotation(headerInfo.ImageUrl || headerInfo.TypeImageUrl));
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export const getAvatar = (converterContext: ConverterContext): Avatar | undefined => {
|
|
@@ -43,8 +44,8 @@ export const getAvatar = (converterContext: ConverterContext): Avatar | undefine
|
|
|
43
44
|
}
|
|
44
45
|
return {
|
|
45
46
|
src: getSource(converterContext),
|
|
46
|
-
initials:
|
|
47
|
+
initials: compileExpression(getExpressionFromAnnotation(headerInfo?.Initials || "")),
|
|
47
48
|
fallbackIcon: getFallBackIcon(converterContext),
|
|
48
|
-
displayShape:
|
|
49
|
+
displayShape: compileExpression(isNaturalPerson(converterContext) ? AvatarShape.Circle : AvatarShape.Square)
|
|
49
50
|
};
|
|
50
51
|
};
|