@sapui5/sap.fe.core 1.102.2 → 1.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +73 -30
- package/src/sap/fe/core/AppComponent.ts +65 -43
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +227 -126
- package/src/sap/fe/core/CommonUtils.ts +240 -163
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +170 -139
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +7 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
- package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
- package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
- package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
- package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +39 -63
- package/src/sap/fe/core/messagebundle_ar.properties +25 -39
- package/src/sap/fe/core/messagebundle_bg.properties +25 -39
- package/src/sap/fe/core/messagebundle_ca.properties +25 -39
- package/src/sap/fe/core/messagebundle_cs.properties +25 -39
- package/src/sap/fe/core/messagebundle_cy.properties +25 -39
- package/src/sap/fe/core/messagebundle_da.properties +25 -39
- package/src/sap/fe/core/messagebundle_de.properties +25 -39
- package/src/sap/fe/core/messagebundle_el.properties +26 -40
- package/src/sap/fe/core/messagebundle_en.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
- package/src/sap/fe/core/messagebundle_es.properties +27 -41
- package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
- package/src/sap/fe/core/messagebundle_et.properties +25 -39
- package/src/sap/fe/core/messagebundle_fi.properties +25 -39
- package/src/sap/fe/core/messagebundle_fr.properties +26 -40
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
- package/src/sap/fe/core/messagebundle_hi.properties +25 -39
- package/src/sap/fe/core/messagebundle_hr.properties +25 -39
- package/src/sap/fe/core/messagebundle_hu.properties +25 -39
- package/src/sap/fe/core/messagebundle_id.properties +25 -39
- package/src/sap/fe/core/messagebundle_it.properties +41 -55
- package/src/sap/fe/core/messagebundle_iw.properties +25 -39
- package/src/sap/fe/core/messagebundle_ja.properties +25 -39
- package/src/sap/fe/core/messagebundle_kk.properties +25 -39
- package/src/sap/fe/core/messagebundle_ko.properties +30 -44
- package/src/sap/fe/core/messagebundle_lt.properties +25 -39
- package/src/sap/fe/core/messagebundle_lv.properties +25 -39
- package/src/sap/fe/core/messagebundle_ms.properties +25 -39
- package/src/sap/fe/core/messagebundle_nl.properties +27 -41
- package/src/sap/fe/core/messagebundle_no.properties +25 -39
- package/src/sap/fe/core/messagebundle_pl.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
- package/src/sap/fe/core/messagebundle_ro.properties +25 -39
- package/src/sap/fe/core/messagebundle_ru.properties +25 -39
- package/src/sap/fe/core/messagebundle_sh.properties +25 -39
- package/src/sap/fe/core/messagebundle_sk.properties +25 -39
- package/src/sap/fe/core/messagebundle_sl.properties +25 -39
- package/src/sap/fe/core/messagebundle_sv.properties +25 -39
- package/src/sap/fe/core/messagebundle_th.properties +25 -39
- package/src/sap/fe/core/messagebundle_tr.properties +25 -39
- package/src/sap/fe/core/messagebundle_uk.properties +25 -39
- package/src/sap/fe/core/messagebundle_vi.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +16 -15
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { NavigationProperty, Property } from "@sap-ux/
|
|
2
|
-
import { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types";
|
|
3
|
-
import {
|
|
4
|
-
import { UIAnnotationTypes } from "@sap-ux/vocabularies-types/types/generated/UI";
|
|
1
|
+
import type { NavigationProperty, PathAnnotationExpression, Property } from "@sap-ux/vocabularies-types";
|
|
2
|
+
import type { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types/vocabularies/UI";
|
|
3
|
+
import { UIAnnotationTypes } from "@sap-ux/vocabularies-types/vocabularies/UI";
|
|
5
4
|
import { singletonPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
6
5
|
import { convertMetaModelContext, getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
|
|
7
6
|
import valueFormatters from "sap/fe/core/formatters/ValueFormatter";
|
|
7
|
+
import type { BindingToolkitExpression, CompiledBindingToolkitExpression, PathInModelExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
8
8
|
import {
|
|
9
9
|
addTypeInformation,
|
|
10
10
|
and,
|
|
11
|
-
|
|
12
|
-
bindingExpression,
|
|
13
|
-
BindingExpression,
|
|
14
|
-
BindingExpressionExpression,
|
|
15
|
-
compileBinding,
|
|
11
|
+
compileExpression,
|
|
16
12
|
constant,
|
|
17
13
|
equal,
|
|
18
|
-
Expression,
|
|
19
|
-
ExpressionOrPrimitive,
|
|
20
14
|
formatResult,
|
|
15
|
+
getExpressionFromAnnotation,
|
|
21
16
|
ifElse,
|
|
22
17
|
isConstant,
|
|
23
18
|
isTruthy,
|
|
24
19
|
not,
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
notEqual,
|
|
21
|
+
or,
|
|
22
|
+
pathInModel
|
|
23
|
+
} from "sap/fe/core/helpers/BindingToolkit";
|
|
27
24
|
import {
|
|
28
25
|
DataModelObjectPath,
|
|
26
|
+
getContextRelativeTargetObjectPath,
|
|
29
27
|
getPathRelativeLocation,
|
|
30
28
|
getTargetObjectPath,
|
|
31
29
|
isPathUpdatable
|
|
@@ -47,7 +45,7 @@ import {
|
|
|
47
45
|
isPathExpression,
|
|
48
46
|
isProperty
|
|
49
47
|
} from "sap/fe/core/templating/PropertyHelper";
|
|
50
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
48
|
+
import type Context from "sap/ui/model/odata/v4/Context";
|
|
51
49
|
|
|
52
50
|
// Import-export method used by the converter to use them in the templating through the UIFormatters.
|
|
53
51
|
export type DisplayMode = DisplayModeFormatter.DisplayMode;
|
|
@@ -90,28 +88,41 @@ export type configType = {
|
|
|
90
88
|
export const getDisplayMode = function (oDataModelObjectPath: DataModelObjectPath): DisplayMode {
|
|
91
89
|
return DisplayModeFormatter.getDisplayMode(oDataModelObjectPath.targetObject, oDataModelObjectPath);
|
|
92
90
|
};
|
|
93
|
-
|
|
91
|
+
export const getEditableExpressionAsObject = function (
|
|
92
|
+
oPropertyPath: PropertyOrPath<Property>,
|
|
93
|
+
oDataFieldConverted: any = null,
|
|
94
|
+
oDataModelObjectPath: DataModelObjectPath,
|
|
95
|
+
isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
|
|
96
|
+
): BindingToolkitExpression<boolean> {
|
|
97
|
+
return getEditableExpression(
|
|
98
|
+
oPropertyPath,
|
|
99
|
+
oDataFieldConverted,
|
|
100
|
+
oDataModelObjectPath,
|
|
101
|
+
true,
|
|
102
|
+
isEditable
|
|
103
|
+
) as BindingToolkitExpression<boolean>;
|
|
104
|
+
};
|
|
94
105
|
/**
|
|
95
106
|
* Create the expression to generate an "editable" boolean value.
|
|
96
107
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @returns
|
|
108
|
+
* @param oPropertyPath The input property
|
|
109
|
+
* @param oDataFieldConverted The DataFieldConverted object to read the fieldControl annotation
|
|
110
|
+
* @param oDataModelObjectPath The path to this property object
|
|
111
|
+
* @param bAsObject Whether or not this should be returned as an object or a binding string
|
|
112
|
+
* @param isEditable Whether or not UI.IsEditable be considered.
|
|
113
|
+
* @returns The binding expression used to determine if a property is editable or not
|
|
103
114
|
*/
|
|
104
115
|
export const getEditableExpression = function (
|
|
105
116
|
oPropertyPath: PropertyOrPath<Property>,
|
|
106
117
|
oDataFieldConverted: any = null,
|
|
107
118
|
oDataModelObjectPath: DataModelObjectPath,
|
|
108
119
|
bAsObject: boolean = false,
|
|
109
|
-
isEditable:
|
|
110
|
-
):
|
|
120
|
+
isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
|
|
121
|
+
): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
|
|
111
122
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
112
|
-
return
|
|
123
|
+
return compileExpression(false);
|
|
113
124
|
}
|
|
114
|
-
let dataFieldEditableExpression:
|
|
125
|
+
let dataFieldEditableExpression: BindingToolkitExpression<boolean> = constant(true);
|
|
115
126
|
if (oDataFieldConverted !== null) {
|
|
116
127
|
dataFieldEditableExpression = ifElse(isNonEditableExpression(oDataFieldConverted), false, isEditable);
|
|
117
128
|
}
|
|
@@ -146,38 +157,46 @@ export const getEditableExpression = function (
|
|
|
146
157
|
if (bAsObject) {
|
|
147
158
|
return and(editableExpression, dataFieldEditableExpression);
|
|
148
159
|
}
|
|
149
|
-
return
|
|
160
|
+
return compileExpression(and(editableExpression, dataFieldEditableExpression));
|
|
150
161
|
};
|
|
151
162
|
|
|
152
|
-
export const getCollaborationExpression = function (
|
|
163
|
+
export const getCollaborationExpression = function (
|
|
164
|
+
dataModelObjectPath: DataModelObjectPath,
|
|
165
|
+
formatter: any
|
|
166
|
+
): BindingToolkitExpression<any> {
|
|
153
167
|
const objectPath = getTargetObjectPath(dataModelObjectPath);
|
|
154
|
-
const activityExpression =
|
|
168
|
+
const activityExpression = pathInModel(`/collaboration/activities${objectPath}`, "internal");
|
|
155
169
|
const keys = dataModelObjectPath?.targetEntityType?.keys;
|
|
156
|
-
const keysExpressions:
|
|
170
|
+
const keysExpressions: BindingToolkitExpression<any>[] = [];
|
|
157
171
|
keys?.forEach(function (key) {
|
|
158
|
-
const keyExpression =
|
|
172
|
+
const keyExpression = pathInModel(key.name);
|
|
159
173
|
keysExpressions.push(keyExpression);
|
|
160
174
|
});
|
|
161
175
|
return formatResult([activityExpression, ...keysExpressions], formatter);
|
|
162
176
|
};
|
|
163
|
-
|
|
177
|
+
export const getEnabledExpressionAsObject = function (
|
|
178
|
+
oPropertyPath: PropertyOrPath<Property>,
|
|
179
|
+
oDataFieldConverted?: any
|
|
180
|
+
): BindingToolkitExpression<boolean> {
|
|
181
|
+
return getEnabledExpression(oPropertyPath, oDataFieldConverted, true) as BindingToolkitExpression<boolean>;
|
|
182
|
+
};
|
|
164
183
|
/**
|
|
165
184
|
* Create the expression to generate an "enabled" boolean value.
|
|
166
185
|
*
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @returns
|
|
186
|
+
* @param oPropertyPath The input property
|
|
187
|
+
* @param oDataFieldConverted The DataFieldConverted Object to read the fieldControl annotation
|
|
188
|
+
* @param bAsObject Whether or not this should be returned as an object or a binding string
|
|
189
|
+
* @returns The binding expression to determine if a property is enabled or not
|
|
171
190
|
*/
|
|
172
191
|
export const getEnabledExpression = function (
|
|
173
192
|
oPropertyPath: PropertyOrPath<Property>,
|
|
174
193
|
oDataFieldConverted?: any,
|
|
175
194
|
bAsObject: boolean = false
|
|
176
|
-
):
|
|
195
|
+
): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
|
|
177
196
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
178
|
-
return
|
|
197
|
+
return compileExpression(true);
|
|
179
198
|
}
|
|
180
|
-
let dataFieldEnabledExpression:
|
|
199
|
+
let dataFieldEnabledExpression: BindingToolkitExpression<boolean> = constant(true);
|
|
181
200
|
if (oDataFieldConverted !== null) {
|
|
182
201
|
dataFieldEnabledExpression = ifElse(isDisabledExpression(oDataFieldConverted), false, true);
|
|
183
202
|
}
|
|
@@ -189,19 +208,19 @@ export const getEnabledExpression = function (
|
|
|
189
208
|
if (bAsObject) {
|
|
190
209
|
return and(enabledExpression, dataFieldEnabledExpression);
|
|
191
210
|
}
|
|
192
|
-
return
|
|
211
|
+
return compileExpression(and(enabledExpression, dataFieldEnabledExpression));
|
|
193
212
|
};
|
|
194
213
|
|
|
195
214
|
/**
|
|
196
215
|
* Create the expression to generate an "editMode" enum value.
|
|
197
216
|
*
|
|
198
|
-
* @param
|
|
199
|
-
* @param
|
|
200
|
-
* @param
|
|
201
|
-
* @param
|
|
202
|
-
* @param
|
|
203
|
-
* @param
|
|
204
|
-
* @returns
|
|
217
|
+
* @param oPropertyPath The input property
|
|
218
|
+
* @param oDataModelObjectPath The list of data model objects that are involved to reach that property
|
|
219
|
+
* @param bMeasureReadOnly Whether we should set UoM / currency field mode to read only
|
|
220
|
+
* @param bAsObject Whether we should return this as an expression or as a string
|
|
221
|
+
* @param oDataFieldConverted The dataField object
|
|
222
|
+
* @param isEditable Whether or not UI.IsEditable be considered.
|
|
223
|
+
* @returns The binding expression representing the current property edit mode, compliant with the MDC Field definition of editMode.
|
|
205
224
|
*/
|
|
206
225
|
export const getEditMode = function (
|
|
207
226
|
oPropertyPath: PropertyOrPath<Property>,
|
|
@@ -209,8 +228,8 @@ export const getEditMode = function (
|
|
|
209
228
|
bMeasureReadOnly: boolean = false,
|
|
210
229
|
bAsObject: boolean = false,
|
|
211
230
|
oDataFieldConverted: any = null,
|
|
212
|
-
isEditable:
|
|
213
|
-
):
|
|
231
|
+
isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
|
|
232
|
+
): CompiledBindingToolkitExpression | BindingToolkitExpression<string> {
|
|
214
233
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
215
234
|
return "Display";
|
|
216
235
|
}
|
|
@@ -221,22 +240,17 @@ export const getEditMode = function (
|
|
|
221
240
|
// If there is an associated unit, and it has a field control also use consider the following
|
|
222
241
|
// if the unit field control is readonly -> EditableReadOnly
|
|
223
242
|
// otherwise -> Editable
|
|
224
|
-
const editableExpression =
|
|
225
|
-
oPropertyPath,
|
|
226
|
-
oDataFieldConverted,
|
|
227
|
-
oDataModelObjectPath,
|
|
228
|
-
true,
|
|
229
|
-
isEditable
|
|
230
|
-
) as ExpressionOrPrimitive<boolean>;
|
|
243
|
+
const editableExpression = getEditableExpressionAsObject(oPropertyPath, oDataFieldConverted, oDataModelObjectPath, isEditable);
|
|
231
244
|
|
|
232
|
-
const enabledExpression =
|
|
245
|
+
const enabledExpression = getEnabledExpressionAsObject(oPropertyPath, oDataFieldConverted);
|
|
233
246
|
const associatedCurrencyProperty = getAssociatedCurrencyProperty(oProperty);
|
|
234
247
|
const unitProperty = associatedCurrencyProperty || getAssociatedUnitProperty(oProperty);
|
|
235
|
-
let resultExpression:
|
|
248
|
+
let resultExpression: BindingToolkitExpression<string> = constant("Editable");
|
|
236
249
|
if (unitProperty) {
|
|
250
|
+
const isUnitReadOnly = isReadOnlyExpression(unitProperty);
|
|
237
251
|
resultExpression = ifElse(
|
|
238
|
-
or(
|
|
239
|
-
"EditableReadOnly",
|
|
252
|
+
or(isUnitReadOnly, isComputed(unitProperty), bMeasureReadOnly),
|
|
253
|
+
ifElse(!isConstant(isUnitReadOnly) && isUnitReadOnly, "EditableReadOnly", "EditableDisplay"),
|
|
240
254
|
"Editable"
|
|
241
255
|
);
|
|
242
256
|
}
|
|
@@ -256,54 +270,57 @@ export const getEditMode = function (
|
|
|
256
270
|
if (bAsObject) {
|
|
257
271
|
return editModeExpression;
|
|
258
272
|
}
|
|
259
|
-
return
|
|
273
|
+
return compileExpression(editModeExpression);
|
|
260
274
|
};
|
|
261
275
|
|
|
262
|
-
export const hasValidAnalyticalCurrencyOrUnit = function (
|
|
276
|
+
export const hasValidAnalyticalCurrencyOrUnit = function (
|
|
277
|
+
oPropertyDataModelObjectPath: DataModelObjectPath
|
|
278
|
+
): CompiledBindingToolkitExpression {
|
|
263
279
|
const oPropertyDefinition = oPropertyDataModelObjectPath.targetObject as Property;
|
|
264
280
|
const currency = oPropertyDefinition.annotations?.Measures?.ISOCurrency;
|
|
265
281
|
const measure = currency ? currency : oPropertyDefinition.annotations?.Measures?.Unit;
|
|
266
282
|
if (measure) {
|
|
267
|
-
return
|
|
283
|
+
return compileExpression(or(isTruthy(getExpressionFromAnnotation(measure) as BindingToolkitExpression<string>), not(UI.IsTotal)));
|
|
268
284
|
} else {
|
|
269
|
-
return
|
|
285
|
+
return compileExpression(constant(true));
|
|
270
286
|
}
|
|
271
287
|
};
|
|
272
288
|
|
|
273
289
|
export const ifUnitEditable = function (
|
|
274
290
|
oPropertyPath: PropertyOrPath<Property>,
|
|
275
|
-
sEditableValue:
|
|
276
|
-
sNonEditableValue:
|
|
277
|
-
):
|
|
291
|
+
sEditableValue: BindingToolkitExpression<string> | string,
|
|
292
|
+
sNonEditableValue: BindingToolkitExpression<string> | string
|
|
293
|
+
): CompiledBindingToolkitExpression {
|
|
278
294
|
const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
|
|
279
295
|
const unitProperty = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
|
|
280
296
|
if (!unitProperty) {
|
|
281
|
-
return
|
|
297
|
+
return compileExpression(sNonEditableValue);
|
|
282
298
|
}
|
|
283
|
-
const
|
|
284
|
-
|
|
299
|
+
const isUnitReadOnly = isReadOnlyExpression(unitProperty);
|
|
300
|
+
const editableExpression = and(or(!isConstant(isUnitReadOnly), not(isUnitReadOnly)), not(isComputed(unitProperty)));
|
|
301
|
+
return compileExpression(ifElse(editableExpression, sEditableValue, sNonEditableValue));
|
|
285
302
|
};
|
|
286
303
|
|
|
287
304
|
export const getFieldDisplay = function (
|
|
288
305
|
oPropertyPath: PropertyOrPath<Property>,
|
|
289
306
|
sTargetDisplayMode: string,
|
|
290
|
-
oComputedEditMode:
|
|
291
|
-
):
|
|
307
|
+
oComputedEditMode: BindingToolkitExpression<string>
|
|
308
|
+
): CompiledBindingToolkitExpression {
|
|
292
309
|
const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
|
|
293
310
|
|
|
294
311
|
return hasValueHelp(oProperty)
|
|
295
|
-
?
|
|
296
|
-
:
|
|
312
|
+
? compileExpression(sTargetDisplayMode)
|
|
313
|
+
: compileExpression(ifElse(equal(oComputedEditMode, "Editable"), "Value", sTargetDisplayMode));
|
|
297
314
|
};
|
|
298
315
|
|
|
299
316
|
export const formatWithTypeInformation = function (
|
|
300
317
|
oProperty: Property,
|
|
301
|
-
propertyBindingExpression:
|
|
318
|
+
propertyBindingExpression: BindingToolkitExpression<string>,
|
|
302
319
|
ignoreConstraints?: boolean
|
|
303
|
-
):
|
|
304
|
-
const outExpression:
|
|
320
|
+
): BindingToolkitExpression<string> {
|
|
321
|
+
const outExpression: PathInModelExpression<any> = propertyBindingExpression as PathInModelExpression<any>;
|
|
305
322
|
if (oProperty._type === "Property") {
|
|
306
|
-
const oTargetMapping = EDM_TYPE_MAPPING[
|
|
323
|
+
const oTargetMapping = EDM_TYPE_MAPPING[oProperty.type];
|
|
307
324
|
if (oTargetMapping) {
|
|
308
325
|
outExpression.type = oTargetMapping.type;
|
|
309
326
|
if (oTargetMapping.constraints && !ignoreConstraints) {
|
|
@@ -403,7 +420,7 @@ export const getTypeConfig = function (oProperty: Property | DataFieldAbstractTy
|
|
|
403
420
|
isDigitSequence:
|
|
404
421
|
propertyTypeConfig.type === "sap.ui.model.odata.type.String" &&
|
|
405
422
|
oTargetMapping.constraints?.["@com.sap.vocabularies.Common.v1.IsDigitSequence"] &&
|
|
406
|
-
|
|
423
|
+
oProperty.annotations?.Common?.IsDigitSequence
|
|
407
424
|
? true
|
|
408
425
|
: undefined,
|
|
409
426
|
V4: oTargetMapping.constraints?.$V4 ? true : undefined
|
|
@@ -427,9 +444,10 @@ export const getTypeConfig = function (oProperty: Property | DataFieldAbstractTy
|
|
|
427
444
|
|
|
428
445
|
export const getBindingWithUnitOrCurrency = function (
|
|
429
446
|
oPropertyDataModelPath: DataModelObjectPath,
|
|
430
|
-
propertyBindingExpression:
|
|
431
|
-
ignoreUnitConstraint?: boolean
|
|
432
|
-
|
|
447
|
+
propertyBindingExpression: BindingToolkitExpression<string>,
|
|
448
|
+
ignoreUnitConstraint?: boolean,
|
|
449
|
+
formatOptions?: any
|
|
450
|
+
): BindingToolkitExpression<string> {
|
|
433
451
|
const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
|
|
434
452
|
let unit = oPropertyDefinition.annotations?.Measures?.Unit;
|
|
435
453
|
const relativeLocation = getPathRelativeLocation(
|
|
@@ -441,24 +459,57 @@ export const getBindingWithUnitOrCurrency = function (
|
|
|
441
459
|
return formatResult([propertyBindingExpression], valueFormatters.formatWithPercentage);
|
|
442
460
|
}
|
|
443
461
|
const complexType = unit ? "sap.ui.model.odata.type.Unit" : "sap.ui.model.odata.type.Currency";
|
|
444
|
-
unit = unit ? unit : oPropertyDefinition.annotations?.Measures?.ISOCurrency;
|
|
462
|
+
unit = unit ? unit : (oPropertyDefinition.annotations?.Measures?.ISOCurrency as any);
|
|
445
463
|
const unitBindingExpression = (unit as any).$target
|
|
446
464
|
? formatWithTypeInformation(
|
|
447
465
|
(unit as any).$target,
|
|
448
|
-
|
|
466
|
+
getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>,
|
|
449
467
|
ignoreUnitConstraint
|
|
450
468
|
)
|
|
451
|
-
: (
|
|
469
|
+
: (getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>);
|
|
452
470
|
|
|
453
|
-
return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType);
|
|
471
|
+
return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType, undefined, formatOptions);
|
|
454
472
|
};
|
|
455
473
|
|
|
474
|
+
export const getBindingForUnitOrCurrency = function (
|
|
475
|
+
oPropertyDataModelPath: DataModelObjectPath
|
|
476
|
+
): BindingToolkitExpression<string> | string {
|
|
477
|
+
const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
|
|
478
|
+
|
|
479
|
+
let unit = oPropertyDefinition.annotations?.Measures?.Unit;
|
|
480
|
+
if (unit?.toString() === "%") {
|
|
481
|
+
return constant("%");
|
|
482
|
+
}
|
|
483
|
+
const relativeLocation = getPathRelativeLocation(
|
|
484
|
+
oPropertyDataModelPath.contextLocation,
|
|
485
|
+
oPropertyDataModelPath.navigationProperties
|
|
486
|
+
).map((np) => np.name);
|
|
487
|
+
|
|
488
|
+
const complexType = unit ? "sap.ui.model.odata.type.Unit" : "sap.ui.model.odata.type.Currency";
|
|
489
|
+
unit = unit ? unit : (oPropertyDefinition.annotations?.Measures?.ISOCurrency as any);
|
|
490
|
+
const unitBindingExpression = (unit as any).$target
|
|
491
|
+
? formatWithTypeInformation(
|
|
492
|
+
(unit as any).$target,
|
|
493
|
+
getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>
|
|
494
|
+
)
|
|
495
|
+
: (getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>);
|
|
496
|
+
|
|
497
|
+
let propertyBindingExpression = pathInModel(
|
|
498
|
+
getContextRelativeTargetObjectPath(oPropertyDataModelPath)
|
|
499
|
+
) as BindingToolkitExpression<string>;
|
|
500
|
+
propertyBindingExpression = formatWithTypeInformation(oPropertyDefinition, propertyBindingExpression, true);
|
|
501
|
+
return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType, undefined, {
|
|
502
|
+
parseKeepsEmptyString: true,
|
|
503
|
+
emptyString: "",
|
|
504
|
+
showNumber: false
|
|
505
|
+
});
|
|
506
|
+
};
|
|
456
507
|
export const getBindingWithTimezone = function (
|
|
457
508
|
oPropertyDataModelPath: DataModelObjectPath,
|
|
458
|
-
propertyBindingExpression:
|
|
509
|
+
propertyBindingExpression: BindingToolkitExpression<string>,
|
|
459
510
|
ignoreUnitConstraint?: boolean,
|
|
460
511
|
hideTimezoneForEmptyValues?: boolean
|
|
461
|
-
):
|
|
512
|
+
): BindingToolkitExpression<string> {
|
|
462
513
|
const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
|
|
463
514
|
const timezone = oPropertyDefinition.annotations?.Common?.Timezone;
|
|
464
515
|
const relativeLocation = getPathRelativeLocation(
|
|
@@ -471,10 +522,10 @@ export const getBindingWithTimezone = function (
|
|
|
471
522
|
const unitBindingExpression = (timezone as any).$target
|
|
472
523
|
? formatWithTypeInformation(
|
|
473
524
|
(timezone as any).$target,
|
|
474
|
-
|
|
525
|
+
getExpressionFromAnnotation(timezone, relativeLocation) as BindingToolkitExpression<string>,
|
|
475
526
|
ignoreUnitConstraint
|
|
476
527
|
)
|
|
477
|
-
: (
|
|
528
|
+
: (getExpressionFromAnnotation(timezone, relativeLocation) as BindingToolkitExpression<string>);
|
|
478
529
|
let formatOptions;
|
|
479
530
|
if (hideTimezoneForEmptyValues) {
|
|
480
531
|
formatOptions = {
|
|
@@ -485,19 +536,19 @@ export const getBindingWithTimezone = function (
|
|
|
485
536
|
};
|
|
486
537
|
|
|
487
538
|
export const getAlignmentExpression = function (
|
|
488
|
-
oComputedEditMode:
|
|
539
|
+
oComputedEditMode: BindingToolkitExpression<string>,
|
|
489
540
|
sAlignDisplay: string = "Begin",
|
|
490
541
|
sAlignEdit: string = "Begin"
|
|
491
|
-
):
|
|
492
|
-
return
|
|
542
|
+
): CompiledBindingToolkitExpression | BindingToolkitExpression<string> {
|
|
543
|
+
return compileExpression(ifElse(equal(oComputedEditMode, "Display"), sAlignDisplay, sAlignEdit));
|
|
493
544
|
};
|
|
494
545
|
|
|
495
546
|
/**
|
|
496
547
|
* Formatter helper to retrieve the converterContext from the metamodel context.
|
|
497
548
|
*
|
|
498
|
-
* @param
|
|
499
|
-
* @param
|
|
500
|
-
* @returns
|
|
549
|
+
* @param oContext The original metamodel context
|
|
550
|
+
* @param oInterface The current templating context
|
|
551
|
+
* @returns The ConverterContext representing that object
|
|
501
552
|
*/
|
|
502
553
|
export const getConverterContext = function (oContext: MetaModelContext, oInterface: ComputedAnnotationInterface): object | null {
|
|
503
554
|
if (oInterface && oInterface.context) {
|
|
@@ -510,9 +561,9 @@ getConverterContext.requiresIContext = true;
|
|
|
510
561
|
/**
|
|
511
562
|
* Formatter helper to retrieve the data model objects that are involved from the metamodel context.
|
|
512
563
|
*
|
|
513
|
-
* @param
|
|
514
|
-
* @param
|
|
515
|
-
* @returns
|
|
564
|
+
* @param oContext The original ODataMetaModel context
|
|
565
|
+
* @param oInterface The current templating context
|
|
566
|
+
* @returns An array of entitysets and navproperties that are involved to get to a specific object in the metamodel
|
|
516
567
|
*/
|
|
517
568
|
export const getDataModelObjectPath = function (
|
|
518
569
|
oContext: MetaModelContext,
|
|
@@ -525,16 +576,6 @@ export const getDataModelObjectPath = function (
|
|
|
525
576
|
};
|
|
526
577
|
getDataModelObjectPath.requiresIContext = true;
|
|
527
578
|
|
|
528
|
-
/**
|
|
529
|
-
* Retrieves the expressionBinding created out of a binding expression.
|
|
530
|
-
*
|
|
531
|
-
* @param {Expression<any>} expression The expression which needs to be compiled
|
|
532
|
-
* @returns {BindingExpression<string>} The expression-binding string
|
|
533
|
-
*/
|
|
534
|
-
export const getExpressionBinding = function (expression: Expression<any>): BindingExpression<string> {
|
|
535
|
-
return compileBinding(expression);
|
|
536
|
-
};
|
|
537
|
-
|
|
538
579
|
export const isCollectionField = function (oDataModelPath: DataModelObjectPath): boolean {
|
|
539
580
|
if (oDataModelPath.navigationProperties?.length) {
|
|
540
581
|
const hasOneToManyNavigation =
|
|
@@ -558,39 +599,71 @@ export const isCollectionField = function (oDataModelPath: DataModelObjectPath):
|
|
|
558
599
|
}
|
|
559
600
|
return false;
|
|
560
601
|
};
|
|
561
|
-
|
|
602
|
+
export const getRequiredExpressionAsObject = function (
|
|
603
|
+
oPropertyPath: PropertyOrPath<Property>,
|
|
604
|
+
oDataFieldConverted?: any,
|
|
605
|
+
forceEditMode: boolean = false
|
|
606
|
+
): BindingToolkitExpression<boolean> {
|
|
607
|
+
return getRequiredExpression(oPropertyPath, oDataFieldConverted, forceEditMode, true) as BindingToolkitExpression<boolean>;
|
|
608
|
+
};
|
|
562
609
|
export const getRequiredExpression = function (
|
|
563
610
|
oPropertyPath: PropertyOrPath<Property>,
|
|
564
611
|
oDataFieldConverted?: any,
|
|
565
612
|
forceEditMode: boolean = false,
|
|
566
|
-
bAsObject: boolean = false
|
|
567
|
-
|
|
613
|
+
bAsObject: boolean = false,
|
|
614
|
+
oRequiredProperties: any = {}
|
|
615
|
+
): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
|
|
616
|
+
let returnExpression: BindingToolkitExpression<boolean>;
|
|
617
|
+
const aRequiredPropertiesFromInsertRestrictions = oRequiredProperties.requiredPropertiesFromInsertRestrictions || [];
|
|
618
|
+
const aRequiredPropertiesFromUpdateRestrictions = oRequiredProperties.requiredPropertiesFromUpdateRestrictions || [];
|
|
568
619
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
620
|
+
returnExpression = constant(false);
|
|
621
|
+
} else {
|
|
622
|
+
let dataFieldRequiredExpression: BindingToolkitExpression<boolean> = constant(true);
|
|
623
|
+
if (oDataFieldConverted !== null) {
|
|
624
|
+
dataFieldRequiredExpression = isRequiredExpression(oDataFieldConverted);
|
|
625
|
+
}
|
|
626
|
+
let requiredPropertyFromInsertRestrictionsExpression: BindingToolkitExpression<boolean> = constant(false);
|
|
627
|
+
let requiredPropertyFromUpdateRestrictionsExpression: BindingToolkitExpression<boolean> = constant(false);
|
|
628
|
+
|
|
629
|
+
const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
|
|
630
|
+
// Enablement depends on the field control expression
|
|
631
|
+
// If the Field control is statically in Inapplicable (disabled) -> not enabled
|
|
632
|
+
const requiredExpression = isRequiredExpression(oProperty);
|
|
633
|
+
const editMode = forceEditMode || UI.IsEditable;
|
|
634
|
+
if (
|
|
635
|
+
aRequiredPropertiesFromInsertRestrictions.length &&
|
|
636
|
+
aRequiredPropertiesFromInsertRestrictions.includes((oPropertyPath as any).name)
|
|
637
|
+
) {
|
|
638
|
+
requiredPropertyFromInsertRestrictionsExpression = and(constant(true), UI.IsCreateMode);
|
|
639
|
+
}
|
|
640
|
+
if (
|
|
641
|
+
aRequiredPropertiesFromUpdateRestrictions.length &&
|
|
642
|
+
aRequiredPropertiesFromUpdateRestrictions.includes((oPropertyPath as any).name)
|
|
643
|
+
) {
|
|
644
|
+
requiredPropertyFromUpdateRestrictionsExpression = and(constant(true), notEqual(UI.IsCreateMode, true));
|
|
645
|
+
}
|
|
646
|
+
returnExpression = or(
|
|
647
|
+
and(or(requiredExpression, dataFieldRequiredExpression), editMode),
|
|
648
|
+
requiredPropertyFromInsertRestrictionsExpression,
|
|
649
|
+
requiredPropertyFromUpdateRestrictionsExpression
|
|
650
|
+
);
|
|
575
651
|
}
|
|
576
652
|
|
|
577
|
-
const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
|
|
578
|
-
// Enablement depends on the field control expression
|
|
579
|
-
// If the Field control is statically in Inapplicable (disabled) -> not enabled
|
|
580
|
-
const requiredExpression = isRequiredExpression(oProperty);
|
|
581
|
-
const editMode = forceEditMode || UI.IsEditable;
|
|
582
653
|
if (bAsObject) {
|
|
583
|
-
return
|
|
654
|
+
return returnExpression;
|
|
584
655
|
}
|
|
585
|
-
return
|
|
656
|
+
return compileExpression(returnExpression);
|
|
586
657
|
};
|
|
587
658
|
|
|
588
|
-
export const getRequiredExpressionForConnectedDataField = function (
|
|
659
|
+
export const getRequiredExpressionForConnectedDataField = function (
|
|
660
|
+
dataFieldObjectPath: DataModelObjectPath
|
|
661
|
+
): CompiledBindingToolkitExpression {
|
|
589
662
|
const data = dataFieldObjectPath?.targetObject?.$target?.Data;
|
|
590
663
|
const keys: Array<string> = Object.keys(data);
|
|
591
664
|
const dataFields = [];
|
|
592
665
|
let propertyPath;
|
|
593
|
-
const isRequiredExpressions: (
|
|
666
|
+
const isRequiredExpressions: (CompiledBindingToolkitExpression | BindingToolkitExpression<boolean>)[] | undefined = [];
|
|
594
667
|
for (const key of keys) {
|
|
595
668
|
if (data[key]["$Type"] && data[key]["$Type"].indexOf("DataField") > -1) {
|
|
596
669
|
dataFields.push(data[key]);
|
|
@@ -624,8 +697,9 @@ export const getRequiredExpressionForConnectedDataField = function (dataFieldObj
|
|
|
624
697
|
}
|
|
625
698
|
}
|
|
626
699
|
break;
|
|
700
|
+
// no default
|
|
627
701
|
}
|
|
628
|
-
isRequiredExpressions.push(
|
|
702
|
+
isRequiredExpressions.push(getRequiredExpressionAsObject(propertyPath, dataField, false));
|
|
629
703
|
}
|
|
630
|
-
return
|
|
704
|
+
return compileExpression(or(...(isRequiredExpressions as BindingToolkitExpression<boolean>[])));
|
|
631
705
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
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/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/model/ValidateException"
|
|
5
|
+
sap.ui.define(["sap/fe/core/helpers/ClassSupport", "sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/model/ValidateException"], function (ClassSupport, Core, ODataStringType, ValidateException) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
var _dec, _class;
|
|
@@ -35,4 +35,4 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/mod
|
|
|
35
35
|
}(ODataStringType)) || _class);
|
|
36
36
|
return EmailType;
|
|
37
37
|
}, false);
|
|
38
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
38
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkVtYWlsLnRzIl0sIm5hbWVzIjpbImVtYWlsVzNDUmVnZXhwIiwiRW1haWxUeXBlIiwiZGVmaW5lVUk1Q2xhc3MiLCJ2YWxpZGF0ZVZhbHVlIiwic1ZhbHVlIiwidGVzdCIsIlZhbGlkYXRlRXhjZXB0aW9uIiwiQ29yZSIsImdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZSIsImdldFRleHQiLCJPRGF0YVN0cmluZ1R5cGUiXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7OztBQUlBLE1BQU1BLGNBQWMsR0FBRyxxRUFBdkI7TUFFTUMsUyxXQURMQyxjQUFjLENBQUMsd0JBQUQsQzs7Ozs7Ozs7O1dBRWRDLGEsR0FBQSx1QkFBY0MsTUFBZCxFQUE4QjtBQUM3QixVQUFJLENBQUNKLGNBQWMsQ0FBQ0ssSUFBZixDQUFvQkQsTUFBcEIsQ0FBTCxFQUFrQztBQUNqQyxjQUFNLElBQUlFLGlCQUFKLENBQXVCQyxJQUFELENBQWlCQyx3QkFBakIsQ0FBMEMsYUFBMUMsRUFBeURDLE9BQXpELENBQWlFLDJCQUFqRSxDQUF0QixDQUFOO0FBQ0E7O0FBQ0QsaUNBQU1OLGFBQU4sWUFBb0JDLE1BQXBCO0FBQ0EsSzs7O0lBTnNCTSxlO1NBUVRULFMiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlZmluZVVJNUNsYXNzIH0gZnJvbSBcInNhcC9mZS9jb3JlL2hlbHBlcnMvQ2xhc3NTdXBwb3J0XCI7XG5pbXBvcnQgQ29yZSBmcm9tIFwic2FwL3VpL2NvcmUvQ29yZVwiO1xuaW1wb3J0IE9EYXRhU3RyaW5nVHlwZSBmcm9tIFwic2FwL3VpL21vZGVsL29kYXRhL3R5cGUvU3RyaW5nXCI7XG5pbXBvcnQgVmFsaWRhdGVFeGNlcHRpb24gZnJvbSBcInNhcC91aS9tb2RlbC9WYWxpZGF0ZUV4Y2VwdGlvblwiO1xuaW1wb3J0IHR5cGUgeyBDb3JlRXggfSBmcm9tIFwidHlwZXMvZXh0ZW5zaW9uX3R5cGVzXCI7XG5cbmNvbnN0IGVtYWlsVzNDUmVnZXhwID0gL15bYS16QS1aMC05LiEjJCUm4oCZKisvPT9eX2B7fH1+LV0rQFthLXpBLVowLTktXSsoPzouW2EtekEtWjAtOS1dKykqJC87XG5AZGVmaW5lVUk1Q2xhc3MoXCJzYXAuZmUuY29yZS50eXBlLkVtYWlsXCIpXG5jbGFzcyBFbWFpbFR5cGUgZXh0ZW5kcyBPRGF0YVN0cmluZ1R5cGUge1xuXHR2YWxpZGF0ZVZhbHVlKHNWYWx1ZTogc3RyaW5nKSB7XG5cdFx0aWYgKCFlbWFpbFczQ1JlZ2V4cC50ZXN0KHNWYWx1ZSkpIHtcblx0XHRcdHRocm93IG5ldyBWYWxpZGF0ZUV4Y2VwdGlvbigoQ29yZSBhcyBDb3JlRXgpLmdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZShcInNhcC5mZS5jb3JlXCIpLmdldFRleHQoXCJUX0VNQUlMVFlQRV9JTlZBTElEX1ZBTFVFXCIpKTtcblx0XHR9XG5cdFx0c3VwZXIudmFsaWRhdGVWYWx1ZShzVmFsdWUpO1xuXHR9XG59XG5leHBvcnQgZGVmYXVsdCBFbWFpbFR5cGU7XG4iXX0=
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
1
2
|
import Core from "sap/ui/core/Core";
|
|
2
3
|
import ODataStringType from "sap/ui/model/odata/type/String";
|
|
3
|
-
import { CoreEx } from "types/extension_types";
|
|
4
4
|
import ValidateException from "sap/ui/model/ValidateException";
|
|
5
|
-
import {
|
|
5
|
+
import type { CoreEx } from "types/extension_types";
|
|
6
6
|
|
|
7
7
|
const emailW3CRegexp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
|
|
8
8
|
@defineUI5Class("sap.fe.core.type.Email")
|