@sapui5/sap.fe.core 1.100.0 → 1.102.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 +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NavigationProperty, Property } from "@sap-ux/annotation-converter";
|
|
2
|
+
import { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types";
|
|
3
|
+
import { PathAnnotationExpression } from "@sap-ux/vocabularies-types/types/Edm";
|
|
4
|
+
import { UIAnnotationTypes } from "@sap-ux/vocabularies-types/types/generated/UI";
|
|
5
|
+
import { singletonPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
2
6
|
import { convertMetaModelContext, getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
|
|
7
|
+
import valueFormatters from "sap/fe/core/formatters/ValueFormatter";
|
|
3
8
|
import {
|
|
4
9
|
addTypeInformation,
|
|
5
10
|
and,
|
|
@@ -19,10 +24,22 @@ import {
|
|
|
19
24
|
not,
|
|
20
25
|
or
|
|
21
26
|
} from "sap/fe/core/helpers/BindingExpression";
|
|
22
|
-
import { singletonPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
23
27
|
import {
|
|
24
|
-
|
|
28
|
+
DataModelObjectPath,
|
|
29
|
+
getPathRelativeLocation,
|
|
30
|
+
getTargetObjectPath,
|
|
31
|
+
isPathUpdatable
|
|
32
|
+
} from "sap/fe/core/templating/DataModelPathHelper";
|
|
33
|
+
import * as DisplayModeFormatter from "sap/fe/core/templating/DisplayModeFormatter";
|
|
34
|
+
import {
|
|
35
|
+
isDisabledExpression,
|
|
36
|
+
isNonEditableExpression,
|
|
37
|
+
isReadOnlyExpression,
|
|
38
|
+
isRequiredExpression
|
|
39
|
+
} from "sap/fe/core/templating/FieldControlHelper";
|
|
40
|
+
import {
|
|
25
41
|
getAssociatedCurrencyProperty,
|
|
42
|
+
getAssociatedUnitProperty,
|
|
26
43
|
hasValueHelp,
|
|
27
44
|
isComputed,
|
|
28
45
|
isImmutable,
|
|
@@ -30,27 +47,11 @@ import {
|
|
|
30
47
|
isPathExpression,
|
|
31
48
|
isProperty
|
|
32
49
|
} from "sap/fe/core/templating/PropertyHelper";
|
|
33
|
-
import
|
|
34
|
-
import { PathAnnotationExpression } from "@sap-ux/vocabularies-types/types/Edm";
|
|
35
|
-
import {
|
|
36
|
-
DataModelObjectPath,
|
|
37
|
-
isPathUpdatable,
|
|
38
|
-
getPathRelativeLocation,
|
|
39
|
-
getTargetObjectPath
|
|
40
|
-
} from "sap/fe/core/templating/DataModelPathHelper";
|
|
41
|
-
import {
|
|
42
|
-
isReadOnlyExpression,
|
|
43
|
-
isNonEditableExpression,
|
|
44
|
-
isDisabledExpression,
|
|
45
|
-
isRequiredExpression
|
|
46
|
-
} from "sap/fe/core/templating/FieldControlHelper";
|
|
47
|
-
import valueFormatters from "sap/fe/core/formatters/ValueFormatter";
|
|
48
|
-
import { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types";
|
|
49
|
-
import * as DisplayModeFormatter from "sap/fe/core/templating/DisplayModeFormatter";
|
|
50
|
+
import Context from "sap/ui/model/odata/v4/Context";
|
|
50
51
|
|
|
51
52
|
// Import-export method used by the converter to use them in the templating through the UIFormatters.
|
|
52
53
|
export type DisplayMode = DisplayModeFormatter.DisplayMode;
|
|
53
|
-
|
|
54
|
+
|
|
54
55
|
export const EDM_TYPE_MAPPING = DisplayModeFormatter.EDM_TYPE_MAPPING;
|
|
55
56
|
|
|
56
57
|
export type PropertyOrPath<P> = string | P | PathAnnotationExpression<P>;
|
|
@@ -59,8 +60,8 @@ export type MetaModelContext = {
|
|
|
59
60
|
};
|
|
60
61
|
export type ComputedAnnotationInterface = {
|
|
61
62
|
context: Context;
|
|
62
|
-
arguments
|
|
63
|
-
$$valueAsPromise
|
|
63
|
+
arguments?: any[];
|
|
64
|
+
$$valueAsPromise?: boolean;
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
export type configTypeConstraints = {
|
|
@@ -71,6 +72,7 @@ export type configTypeConstraints = {
|
|
|
71
72
|
minimum?: string;
|
|
72
73
|
maximum?: string;
|
|
73
74
|
isDigitSequence?: boolean;
|
|
75
|
+
V4?: boolean;
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
export type configTypeformatOptions = {
|
|
@@ -85,6 +87,10 @@ export type configType = {
|
|
|
85
87
|
formatOptions: configTypeformatOptions;
|
|
86
88
|
};
|
|
87
89
|
|
|
90
|
+
export const getDisplayMode = function (oDataModelObjectPath: DataModelObjectPath): DisplayMode {
|
|
91
|
+
return DisplayModeFormatter.getDisplayMode(oDataModelObjectPath.targetObject, oDataModelObjectPath);
|
|
92
|
+
};
|
|
93
|
+
|
|
88
94
|
/**
|
|
89
95
|
* Create the expression to generate an "editable" boolean value.
|
|
90
96
|
*
|
|
@@ -92,20 +98,22 @@ export type configType = {
|
|
|
92
98
|
* @param {object} oDataFieldConverted The DataFieldConverted object to read the fieldControl annotation
|
|
93
99
|
* @param {DataModelObjectPath} oDataModelObjectPath The path to this property object
|
|
94
100
|
* @param {boolean} bAsObject Whether or not this should be returned as an object or a binding string
|
|
101
|
+
* @param {boolean} isEditable Whether or not UI.IsEditable be considered.
|
|
95
102
|
* @returns {string} The binding expression used to determine if a property is editable or not
|
|
96
103
|
*/
|
|
97
|
-
export const getEditableExpression = function(
|
|
104
|
+
export const getEditableExpression = function (
|
|
98
105
|
oPropertyPath: PropertyOrPath<Property>,
|
|
99
106
|
oDataFieldConverted: any = null,
|
|
100
107
|
oDataModelObjectPath: DataModelObjectPath,
|
|
101
|
-
bAsObject: boolean = false
|
|
108
|
+
bAsObject: boolean = false,
|
|
109
|
+
isEditable: ExpressionOrPrimitive<boolean> = UI.IsEditable
|
|
102
110
|
): BindingExpression<boolean> | ExpressionOrPrimitive<boolean> {
|
|
103
111
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
104
112
|
return compileBinding(false);
|
|
105
113
|
}
|
|
106
114
|
let dataFieldEditableExpression: BindingExpression<boolean> | ExpressionOrPrimitive<boolean> = true;
|
|
107
115
|
if (oDataFieldConverted !== null) {
|
|
108
|
-
dataFieldEditableExpression = ifElse(isNonEditableExpression(oDataFieldConverted), false,
|
|
116
|
+
dataFieldEditableExpression = ifElse(isNonEditableExpression(oDataFieldConverted), false, isEditable);
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
|
|
@@ -133,7 +141,7 @@ export const getEditableExpression = function(
|
|
|
133
141
|
isNonEditableExpression(oProperty)
|
|
134
142
|
),
|
|
135
143
|
ifElse(or(isComputed(oProperty), isNonEditableExpression(oProperty)), false, UI.IsTransientBinding),
|
|
136
|
-
|
|
144
|
+
isEditable
|
|
137
145
|
);
|
|
138
146
|
if (bAsObject) {
|
|
139
147
|
return and(editableExpression, dataFieldEditableExpression);
|
|
@@ -141,12 +149,12 @@ export const getEditableExpression = function(
|
|
|
141
149
|
return compileBinding(and(editableExpression, dataFieldEditableExpression));
|
|
142
150
|
};
|
|
143
151
|
|
|
144
|
-
export const getCollaborationExpression = function(dataModelObjectPath: DataModelObjectPath, formatter: any): BindingExpression<any> {
|
|
152
|
+
export const getCollaborationExpression = function (dataModelObjectPath: DataModelObjectPath, formatter: any): BindingExpression<any> {
|
|
145
153
|
const objectPath = getTargetObjectPath(dataModelObjectPath);
|
|
146
154
|
const activityExpression = bindingExpression("/collaboration/activities" + objectPath, "internal");
|
|
147
155
|
const keys = dataModelObjectPath?.targetEntityType?.keys;
|
|
148
156
|
const keysExpressions: BindingExpressionExpression<any>[] = [];
|
|
149
|
-
keys?.forEach(function(key) {
|
|
157
|
+
keys?.forEach(function (key) {
|
|
150
158
|
const keyExpression = bindingExpression(key.name) as BindingExpressionExpression<any>;
|
|
151
159
|
keysExpressions.push(keyExpression);
|
|
152
160
|
});
|
|
@@ -161,7 +169,7 @@ export const getCollaborationExpression = function(dataModelObjectPath: DataMode
|
|
|
161
169
|
* @param {boolean} bAsObject Whether or not this should be returned as an object or a binding string
|
|
162
170
|
* @returns {string} The binding expression to determine if a property is enabled or not
|
|
163
171
|
*/
|
|
164
|
-
export const getEnabledExpression = function(
|
|
172
|
+
export const getEnabledExpression = function (
|
|
165
173
|
oPropertyPath: PropertyOrPath<Property>,
|
|
166
174
|
oDataFieldConverted?: any,
|
|
167
175
|
bAsObject: boolean = false
|
|
@@ -192,14 +200,16 @@ export const getEnabledExpression = function(
|
|
|
192
200
|
* @param {boolean} bMeasureReadOnly Whether we should set UoM / currency field mode to read only
|
|
193
201
|
* @param {boolean} bAsObject Whether we should return this as an expression or as a string
|
|
194
202
|
* @param {object} oDataFieldConverted The dataField object
|
|
203
|
+
* @param {boolean} isEditable Whether or not UI.IsEditable be considered.
|
|
195
204
|
* @returns {BindingExpression<string> | ExpressionOrPrimitive<string>} The binding expression representing the current property edit mode, compliant with the MDC Field definition of editMode.
|
|
196
205
|
*/
|
|
197
|
-
export const getEditMode = function(
|
|
206
|
+
export const getEditMode = function (
|
|
198
207
|
oPropertyPath: PropertyOrPath<Property>,
|
|
199
208
|
oDataModelObjectPath: DataModelObjectPath,
|
|
200
209
|
bMeasureReadOnly: boolean = false,
|
|
201
210
|
bAsObject: boolean = false,
|
|
202
|
-
oDataFieldConverted: any = null
|
|
211
|
+
oDataFieldConverted: any = null,
|
|
212
|
+
isEditable: ExpressionOrPrimitive<boolean> = UI.IsEditable
|
|
203
213
|
): BindingExpression<string> | ExpressionOrPrimitive<string> {
|
|
204
214
|
if (!oPropertyPath || typeof oPropertyPath === "string") {
|
|
205
215
|
return "Display";
|
|
@@ -215,7 +225,8 @@ export const getEditMode = function(
|
|
|
215
225
|
oPropertyPath,
|
|
216
226
|
oDataFieldConverted,
|
|
217
227
|
oDataModelObjectPath,
|
|
218
|
-
true
|
|
228
|
+
true,
|
|
229
|
+
isEditable
|
|
219
230
|
) as ExpressionOrPrimitive<boolean>;
|
|
220
231
|
|
|
221
232
|
const enabledExpression = getEnabledExpression(oPropertyPath, oDataFieldConverted, true) as ExpressionOrPrimitive<boolean>;
|
|
@@ -238,9 +249,9 @@ export const getEditMode = function(
|
|
|
238
249
|
ifElse(
|
|
239
250
|
editableExpression,
|
|
240
251
|
resultExpression,
|
|
241
|
-
ifElse(and(!isConstant(readOnlyExpression) && readOnlyExpression,
|
|
252
|
+
ifElse(and(!isConstant(readOnlyExpression) && readOnlyExpression, isEditable), "ReadOnly", "Display")
|
|
242
253
|
),
|
|
243
|
-
ifElse(
|
|
254
|
+
ifElse(isEditable, "Disabled", "Display")
|
|
244
255
|
);
|
|
245
256
|
if (bAsObject) {
|
|
246
257
|
return editModeExpression;
|
|
@@ -248,7 +259,7 @@ export const getEditMode = function(
|
|
|
248
259
|
return compileBinding(editModeExpression);
|
|
249
260
|
};
|
|
250
261
|
|
|
251
|
-
export const hasValidAnalyticalCurrencyOrUnit = function(oPropertyDataModelObjectPath: DataModelObjectPath): BindingExpression<string> {
|
|
262
|
+
export const hasValidAnalyticalCurrencyOrUnit = function (oPropertyDataModelObjectPath: DataModelObjectPath): BindingExpression<string> {
|
|
252
263
|
const oPropertyDefinition = oPropertyDataModelObjectPath.targetObject as Property;
|
|
253
264
|
const currency = oPropertyDefinition.annotations?.Measures?.ISOCurrency;
|
|
254
265
|
const measure = currency ? currency : oPropertyDefinition.annotations?.Measures?.Unit;
|
|
@@ -259,7 +270,7 @@ export const hasValidAnalyticalCurrencyOrUnit = function(oPropertyDataModelObjec
|
|
|
259
270
|
}
|
|
260
271
|
};
|
|
261
272
|
|
|
262
|
-
export const ifUnitEditable = function(
|
|
273
|
+
export const ifUnitEditable = function (
|
|
263
274
|
oPropertyPath: PropertyOrPath<Property>,
|
|
264
275
|
sEditableValue: ExpressionOrPrimitive<string>,
|
|
265
276
|
sNonEditableValue: ExpressionOrPrimitive<string>
|
|
@@ -273,7 +284,7 @@ export const ifUnitEditable = function(
|
|
|
273
284
|
return compileBinding(ifElse(editableExpression, sEditableValue, sNonEditableValue));
|
|
274
285
|
};
|
|
275
286
|
|
|
276
|
-
export const getFieldDisplay = function(
|
|
287
|
+
export const getFieldDisplay = function (
|
|
277
288
|
oPropertyPath: PropertyOrPath<Property>,
|
|
278
289
|
sTargetDisplayMode: string,
|
|
279
290
|
oComputedEditMode: ExpressionOrPrimitive<string>
|
|
@@ -285,7 +296,7 @@ export const getFieldDisplay = function(
|
|
|
285
296
|
: compileBinding(ifElse(equal(oComputedEditMode, "Editable"), "Value", sTargetDisplayMode));
|
|
286
297
|
};
|
|
287
298
|
|
|
288
|
-
export const formatWithTypeInformation = function(
|
|
299
|
+
export const formatWithTypeInformation = function (
|
|
289
300
|
oProperty: Property,
|
|
290
301
|
propertyBindingExpression: Expression<string>,
|
|
291
302
|
ignoreConstraints?: boolean
|
|
@@ -306,7 +317,7 @@ export const formatWithTypeInformation = function(
|
|
|
306
317
|
if (oTargetMapping.constraints.$MaxLength && oProperty.maxLength !== undefined) {
|
|
307
318
|
outExpression.constraints.maxLength = oProperty.maxLength;
|
|
308
319
|
}
|
|
309
|
-
if (
|
|
320
|
+
if (oProperty.nullable === false) {
|
|
310
321
|
outExpression.constraints.nullable = oProperty.nullable;
|
|
311
322
|
}
|
|
312
323
|
if (
|
|
@@ -323,6 +334,9 @@ export const formatWithTypeInformation = function(
|
|
|
323
334
|
) {
|
|
324
335
|
outExpression.constraints.maximum = `${oProperty.annotations.Validation.Maximum}`;
|
|
325
336
|
}
|
|
337
|
+
} else if (oProperty.nullable === false) {
|
|
338
|
+
outExpression.constraints = {};
|
|
339
|
+
outExpression.constraints.nullable = oProperty.nullable;
|
|
326
340
|
}
|
|
327
341
|
if (outExpression?.type?.indexOf("sap.ui.model.odata.type.Int") === 0) {
|
|
328
342
|
if (!outExpression.formatOptions) {
|
|
@@ -355,12 +369,15 @@ export const formatWithTypeInformation = function(
|
|
|
355
369
|
emptyString: ""
|
|
356
370
|
});
|
|
357
371
|
}
|
|
372
|
+
if (outExpression?.type?.indexOf("sap.ui.model.odata.type.DateTimeOffset") === 0) {
|
|
373
|
+
outExpression.constraints.V4 = true;
|
|
374
|
+
}
|
|
358
375
|
}
|
|
359
376
|
}
|
|
360
377
|
return outExpression;
|
|
361
378
|
};
|
|
362
379
|
|
|
363
|
-
export const getTypeConfig = function(oProperty: Property | DataFieldAbstractTypes, dataType: string | undefined): any {
|
|
380
|
+
export const getTypeConfig = function (oProperty: Property | DataFieldAbstractTypes, dataType: string | undefined): any {
|
|
364
381
|
const oTargetMapping = EDM_TYPE_MAPPING[(oProperty as Property)?.type] || (dataType ? EDM_TYPE_MAPPING[dataType] : undefined);
|
|
365
382
|
const propertyTypeConfig: configType = {
|
|
366
383
|
type: oTargetMapping.type,
|
|
@@ -388,7 +405,8 @@ export const getTypeConfig = function(oProperty: Property | DataFieldAbstractTyp
|
|
|
388
405
|
oTargetMapping.constraints?.["@com.sap.vocabularies.Common.v1.IsDigitSequence"] &&
|
|
389
406
|
(oProperty as Property).annotations?.Common?.IsDigitSequence
|
|
390
407
|
? true
|
|
391
|
-
: undefined
|
|
408
|
+
: undefined,
|
|
409
|
+
V4: oTargetMapping.constraints?.$V4 ? true : undefined
|
|
392
410
|
};
|
|
393
411
|
}
|
|
394
412
|
propertyTypeConfig.formatOptions = {
|
|
@@ -407,7 +425,7 @@ export const getTypeConfig = function(oProperty: Property | DataFieldAbstractTyp
|
|
|
407
425
|
return propertyTypeConfig;
|
|
408
426
|
};
|
|
409
427
|
|
|
410
|
-
export const getBindingWithUnitOrCurrency = function(
|
|
428
|
+
export const getBindingWithUnitOrCurrency = function (
|
|
411
429
|
oPropertyDataModelPath: DataModelObjectPath,
|
|
412
430
|
propertyBindingExpression: Expression<string>,
|
|
413
431
|
ignoreUnitConstraint?: boolean
|
|
@@ -417,7 +435,7 @@ export const getBindingWithUnitOrCurrency = function(
|
|
|
417
435
|
const relativeLocation = getPathRelativeLocation(
|
|
418
436
|
oPropertyDataModelPath.contextLocation,
|
|
419
437
|
oPropertyDataModelPath.navigationProperties
|
|
420
|
-
).map(np => np.name);
|
|
438
|
+
).map((np) => np.name);
|
|
421
439
|
propertyBindingExpression = formatWithTypeInformation(oPropertyDefinition, propertyBindingExpression);
|
|
422
440
|
if (unit?.toString() === "%") {
|
|
423
441
|
return formatResult([propertyBindingExpression], valueFormatters.formatWithPercentage);
|
|
@@ -435,7 +453,38 @@ export const getBindingWithUnitOrCurrency = function(
|
|
|
435
453
|
return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType);
|
|
436
454
|
};
|
|
437
455
|
|
|
438
|
-
export const
|
|
456
|
+
export const getBindingWithTimezone = function (
|
|
457
|
+
oPropertyDataModelPath: DataModelObjectPath,
|
|
458
|
+
propertyBindingExpression: Expression<string>,
|
|
459
|
+
ignoreUnitConstraint?: boolean,
|
|
460
|
+
hideTimezoneForEmptyValues?: boolean
|
|
461
|
+
): Expression<string> {
|
|
462
|
+
const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
|
|
463
|
+
const timezone = oPropertyDefinition.annotations?.Common?.Timezone;
|
|
464
|
+
const relativeLocation = getPathRelativeLocation(
|
|
465
|
+
oPropertyDataModelPath.contextLocation,
|
|
466
|
+
oPropertyDataModelPath.navigationProperties
|
|
467
|
+
).map((np) => np.name);
|
|
468
|
+
propertyBindingExpression = formatWithTypeInformation(oPropertyDefinition, propertyBindingExpression);
|
|
469
|
+
|
|
470
|
+
const complexType = "sap.fe.core.type.DateTimeWithTimezone";
|
|
471
|
+
const unitBindingExpression = (timezone as any).$target
|
|
472
|
+
? formatWithTypeInformation(
|
|
473
|
+
(timezone as any).$target,
|
|
474
|
+
annotationExpression(timezone, relativeLocation) as Expression<string>,
|
|
475
|
+
ignoreUnitConstraint
|
|
476
|
+
)
|
|
477
|
+
: (annotationExpression(timezone, relativeLocation) as Expression<string>);
|
|
478
|
+
let formatOptions;
|
|
479
|
+
if (hideTimezoneForEmptyValues) {
|
|
480
|
+
formatOptions = {
|
|
481
|
+
showTimezoneForEmptyValues: false
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType, undefined, formatOptions);
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
export const getAlignmentExpression = function (
|
|
439
488
|
oComputedEditMode: Expression<string>,
|
|
440
489
|
sAlignDisplay: string = "Begin",
|
|
441
490
|
sAlignEdit: string = "Begin"
|
|
@@ -450,7 +499,7 @@ export const getAlignmentExpression = function(
|
|
|
450
499
|
* @param {ComputedAnnotationInterface} oInterface The current templating context
|
|
451
500
|
* @returns {object} The ConverterContext representing that object
|
|
452
501
|
*/
|
|
453
|
-
export const getConverterContext = function(oContext: MetaModelContext, oInterface: ComputedAnnotationInterface): object | null {
|
|
502
|
+
export const getConverterContext = function (oContext: MetaModelContext, oInterface: ComputedAnnotationInterface): object | null {
|
|
454
503
|
if (oInterface && oInterface.context) {
|
|
455
504
|
return convertMetaModelContext(oInterface.context);
|
|
456
505
|
}
|
|
@@ -465,7 +514,7 @@ getConverterContext.requiresIContext = true;
|
|
|
465
514
|
* @param {ComputedAnnotationInterface} oInterface The current templating context
|
|
466
515
|
* @returns {object[]} An array of entitysets and navproperties that are involved to get to a specific object in the metamodel
|
|
467
516
|
*/
|
|
468
|
-
export const getDataModelObjectPath = function(
|
|
517
|
+
export const getDataModelObjectPath = function (
|
|
469
518
|
oContext: MetaModelContext,
|
|
470
519
|
oInterface: ComputedAnnotationInterface
|
|
471
520
|
): DataModelObjectPath | null {
|
|
@@ -482,11 +531,11 @@ getDataModelObjectPath.requiresIContext = true;
|
|
|
482
531
|
* @param {Expression<any>} expression The expression which needs to be compiled
|
|
483
532
|
* @returns {BindingExpression<string>} The expression-binding string
|
|
484
533
|
*/
|
|
485
|
-
export const getExpressionBinding = function(expression: Expression<any>): BindingExpression<string> {
|
|
534
|
+
export const getExpressionBinding = function (expression: Expression<any>): BindingExpression<string> {
|
|
486
535
|
return compileBinding(expression);
|
|
487
536
|
};
|
|
488
537
|
|
|
489
|
-
export const isCollectionField = function(oDataModelPath: DataModelObjectPath): boolean {
|
|
538
|
+
export const isCollectionField = function (oDataModelPath: DataModelObjectPath): boolean {
|
|
490
539
|
if (oDataModelPath.navigationProperties?.length) {
|
|
491
540
|
const hasOneToManyNavigation =
|
|
492
541
|
oDataModelPath?.navigationProperties.findIndex((oNav: NavigationProperty) => {
|
|
@@ -510,7 +559,7 @@ export const isCollectionField = function(oDataModelPath: DataModelObjectPath):
|
|
|
510
559
|
return false;
|
|
511
560
|
};
|
|
512
561
|
|
|
513
|
-
export const getRequiredExpression = function(
|
|
562
|
+
export const getRequiredExpression = function (
|
|
514
563
|
oPropertyPath: PropertyOrPath<Property>,
|
|
515
564
|
oDataFieldConverted?: any,
|
|
516
565
|
forceEditMode: boolean = false,
|
|
@@ -535,3 +584,48 @@ export const getRequiredExpression = function(
|
|
|
535
584
|
}
|
|
536
585
|
return compileBinding(and(or(requiredExpression, dataFieldRequiredExpression), editMode));
|
|
537
586
|
};
|
|
587
|
+
|
|
588
|
+
export const getRequiredExpressionForConnectedDataField = function (dataFieldObjectPath: DataModelObjectPath): BindingExpression<string> {
|
|
589
|
+
const data = dataFieldObjectPath?.targetObject?.$target?.Data;
|
|
590
|
+
const keys: Array<string> = Object.keys(data);
|
|
591
|
+
const dataFields = [];
|
|
592
|
+
let propertyPath;
|
|
593
|
+
const isRequiredExpressions: (BindingExpression<boolean> | ExpressionOrPrimitive<boolean>)[] | undefined = [];
|
|
594
|
+
for (const key of keys) {
|
|
595
|
+
if (data[key]["$Type"] && data[key]["$Type"].indexOf("DataField") > -1) {
|
|
596
|
+
dataFields.push(data[key]);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
for (const dataField of dataFields) {
|
|
600
|
+
switch (dataField.$Type) {
|
|
601
|
+
case UIAnnotationTypes.DataField:
|
|
602
|
+
case UIAnnotationTypes.DataFieldWithNavigationPath:
|
|
603
|
+
case UIAnnotationTypes.DataFieldWithUrl:
|
|
604
|
+
case UIAnnotationTypes.DataFieldWithIntentBasedNavigation:
|
|
605
|
+
case UIAnnotationTypes.DataFieldWithAction:
|
|
606
|
+
if (typeof dataField.Value === "object") {
|
|
607
|
+
propertyPath = dataField.Value.$target;
|
|
608
|
+
}
|
|
609
|
+
break;
|
|
610
|
+
case UIAnnotationTypes.DataFieldForAnnotation:
|
|
611
|
+
if (dataField.Target.$target) {
|
|
612
|
+
if (
|
|
613
|
+
dataField.Target.$target.$Type === UIAnnotationTypes.DataField ||
|
|
614
|
+
dataField.Target.$target.$Type === UIAnnotationTypes.DataPointType
|
|
615
|
+
) {
|
|
616
|
+
if (typeof dataField.Target.$target.Value === "object") {
|
|
617
|
+
propertyPath = dataField.Target.$target.Value.$target;
|
|
618
|
+
}
|
|
619
|
+
} else {
|
|
620
|
+
if (typeof dataField.Target === "object") {
|
|
621
|
+
propertyPath = dataField.Target.$target;
|
|
622
|
+
}
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
isRequiredExpressions.push(getRequiredExpression(propertyPath, dataField, false, true));
|
|
629
|
+
}
|
|
630
|
+
return compileBinding(or(...(isRequiredExpressions as ExpressionOrPrimitive<boolean>[])));
|
|
631
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["sap/fe/core/helpers/ClassSupport", "sap/ui/model/odata/type/DateTimeWithTimezone"], function (ClassSupport, _DateTimeWithTimezone) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var _dec, _class;
|
|
9
|
+
|
|
10
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
11
|
+
|
|
12
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
16
|
+
var DateTimeWithTimezone = (_dec = defineUI5Class("sap.fe.core.type.DateTimeWithTimezone"), _dec(_class = /*#__PURE__*/function (_DateTimeWithTimezone2) {
|
|
17
|
+
_inheritsLoose(DateTimeWithTimezone, _DateTimeWithTimezone2);
|
|
18
|
+
|
|
19
|
+
function DateTimeWithTimezone(oFormatOptions, oConstraints) {
|
|
20
|
+
var _oFormatOptions$showT;
|
|
21
|
+
|
|
22
|
+
var _this;
|
|
23
|
+
|
|
24
|
+
_this = _DateTimeWithTimezone2.call(this, oFormatOptions, oConstraints) || this;
|
|
25
|
+
_this.bShowTimezoneForEmptyValues = (_oFormatOptions$showT = oFormatOptions === null || oFormatOptions === void 0 ? void 0 : oFormatOptions.showTimezoneForEmptyValues) !== null && _oFormatOptions$showT !== void 0 ? _oFormatOptions$showT : true;
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var _proto = DateTimeWithTimezone.prototype;
|
|
30
|
+
|
|
31
|
+
_proto.formatValue = function formatValue(aValues, sTargetType) {
|
|
32
|
+
var oTimestamp = aValues && aValues[0];
|
|
33
|
+
|
|
34
|
+
if (oTimestamp === undefined || // data is not yet available
|
|
35
|
+
// if time zone is not shown falsy timestamps cannot be formatted -> return null
|
|
36
|
+
!oTimestamp && !this.bShowTimezoneForEmptyValues) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return _DateTimeWithTimezone2.prototype.formatValue.call(this, aValues, sTargetType);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return DateTimeWithTimezone;
|
|
44
|
+
}(_DateTimeWithTimezone)) || _class);
|
|
45
|
+
return DateTimeWithTimezone;
|
|
46
|
+
}, false);
|
|
47
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRhdGVUaW1lV2l0aFRpbWV6b25lLnRzIl0sIm5hbWVzIjpbIkRhdGVUaW1lV2l0aFRpbWV6b25lIiwiZGVmaW5lVUk1Q2xhc3MiLCJvRm9ybWF0T3B0aW9ucyIsIm9Db25zdHJhaW50cyIsImJTaG93VGltZXpvbmVGb3JFbXB0eVZhbHVlcyIsInNob3dUaW1lem9uZUZvckVtcHR5VmFsdWVzIiwiZm9ybWF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VsdCBEYXRlVGltZVdpdGhUaW1lem9uZTtcbiJdfQ==
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
2
|
+
import _DateTimeWithTimezone from "sap/ui/model/odata/type/DateTimeWithTimezone";
|
|
3
|
+
|
|
4
|
+
@defineUI5Class("sap.fe.core.type.DateTimeWithTimezone")
|
|
5
|
+
class DateTimeWithTimezone extends _DateTimeWithTimezone {
|
|
6
|
+
private bShowTimezoneForEmptyValues: boolean;
|
|
7
|
+
constructor(oFormatOptions?: any, oConstraints?: any) {
|
|
8
|
+
super(oFormatOptions, oConstraints);
|
|
9
|
+
this.bShowTimezoneForEmptyValues = oFormatOptions?.showTimezoneForEmptyValues ?? true;
|
|
10
|
+
}
|
|
11
|
+
formatValue(aValues: any[], sTargetType: string) {
|
|
12
|
+
const oTimestamp = aValues && aValues[0];
|
|
13
|
+
if (
|
|
14
|
+
oTimestamp === undefined || // data is not yet available
|
|
15
|
+
// if time zone is not shown falsy timestamps cannot be formatted -> return null
|
|
16
|
+
(!oTimestamp && !this.bShowTimezoneForEmptyValues)
|
|
17
|
+
) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return super.formatValue(aValues, sTargetType);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export default DateTimeWithTimezone;
|
|
@@ -2,19 +2,37 @@
|
|
|
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/model/odata/type/String", "sap/ui/model/ValidateException"], function (ODataStringType, ValidateException) {
|
|
5
|
+
sap.ui.define(["sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/model/ValidateException", "sap/fe/core/helpers/ClassSupport"], function (Core, ODataStringType, ValidateException, ClassSupport) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
var _dec, _class;
|
|
9
|
+
|
|
10
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
11
|
+
|
|
12
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
8
16
|
var emailW3CRegexp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
|
|
9
|
-
var EmailType =
|
|
10
|
-
|
|
17
|
+
var EmailType = (_dec = defineUI5Class("sap.fe.core.type.Email"), _dec(_class = /*#__PURE__*/function (_ODataStringType) {
|
|
18
|
+
_inheritsLoose(EmailType, _ODataStringType);
|
|
19
|
+
|
|
20
|
+
function EmailType() {
|
|
21
|
+
return _ODataStringType.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _proto = EmailType.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.validateValue = function validateValue(sValue) {
|
|
11
27
|
if (!emailW3CRegexp.test(sValue)) {
|
|
12
|
-
throw new ValidateException(
|
|
28
|
+
throw new ValidateException(Core.getLibraryResourceBundle("sap.fe.core").getText("T_EMAILTYPE_INVALID_VALUE"));
|
|
13
29
|
}
|
|
14
30
|
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
31
|
+
_ODataStringType.prototype.validateValue.call(this, sValue);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return EmailType;
|
|
35
|
+
}(ODataStringType)) || _class);
|
|
18
36
|
return EmailType;
|
|
19
37
|
}, false);
|
|
20
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
38
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;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tIFwic2FwL3VpL21vZGVsL1ZhbGlkYXRlRXhjZXB0aW9uXCI7XG5pbXBvcnQgeyBkZWZpbmVVSTVDbGFzcyB9IGZyb20gXCJzYXAvZmUvY29yZS9oZWxwZXJzL0NsYXNzU3VwcG9ydFwiO1xuXG5jb25zdCBlbWFpbFczQ1JlZ2V4cCA9IC9eW2EtekEtWjAtOS4hIyQlJuKAmSorLz0/Xl9ge3x9fi1dK0BbYS16QS1aMC05LV0rKD86LlthLXpBLVowLTktXSspKiQvO1xuQGRlZmluZVVJNUNsYXNzKFwic2FwLmZlLmNvcmUudHlwZS5FbWFpbFwiKVxuY2xhc3MgRW1haWxUeXBlIGV4dGVuZHMgT0RhdGFTdHJpbmdUeXBlIHtcblx0dmFsaWRhdGVWYWx1ZShzVmFsdWU6IHN0cmluZykge1xuXHRcdGlmICghZW1haWxXM0NSZWdleHAudGVzdChzVmFsdWUpKSB7XG5cdFx0XHR0aHJvdyBuZXcgVmFsaWRhdGVFeGNlcHRpb24oKENvcmUgYXMgQ29yZUV4KS5nZXRMaWJyYXJ5UmVzb3VyY2VCdW5kbGUoXCJzYXAuZmUuY29yZVwiKS5nZXRUZXh0KFwiVF9FTUFJTFRZUEVfSU5WQUxJRF9WQUxVRVwiKSk7XG5cdFx0fVxuXHRcdHN1cGVyLnZhbGlkYXRlVmFsdWUoc1ZhbHVlKTtcblx0fVxufVxuZXhwb3J0IGRlZmF1bHQgRW1haWxUeXBlO1xuIl19
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Core from "sap/ui/core/Core";
|
|
2
2
|
import ODataStringType from "sap/ui/model/odata/type/String";
|
|
3
|
+
import { CoreEx } from "types/extension_types";
|
|
3
4
|
import ValidateException from "sap/ui/model/ValidateException";
|
|
5
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
4
6
|
|
|
5
7
|
const emailW3CRegexp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
|
|
6
|
-
|
|
8
|
+
@defineUI5Class("sap.fe.core.type.Email")
|
|
9
|
+
class EmailType extends ODataStringType {
|
|
7
10
|
validateValue(sValue: string) {
|
|
8
11
|
if (!emailW3CRegexp.test(sValue)) {
|
|
9
|
-
throw new ValidateException(
|
|
10
|
-
(sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle).getText("T_EMAILTYPE_INVALID_VALUE")
|
|
11
|
-
);
|
|
12
|
+
throw new ValidateException((Core as CoreEx).getLibraryResourceBundle("sap.fe.core").getText("T_EMAILTYPE_INVALID_VALUE"));
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
super.validateValue(sValue);
|
|
14
15
|
}
|
|
15
|
-
}
|
|
16
|
+
}
|
|
16
17
|
export default EmailType;
|