@sapui5/sap.fe.core 1.98.0 → 1.101.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 +8 -5
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AnnotationHelper.js +328 -405
- package/src/sap/fe/core/AnnotationHelper.ts +321 -0
- package/src/sap/fe/core/AppComponent.js +382 -399
- package/src/sap/fe/core/AppComponent.ts +397 -0
- package/src/sap/fe/core/AppStateHandler.js +198 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +83 -58
- package/src/sap/fe/core/BaseController.ts +67 -0
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2221 -2399
- package/src/sap/fe/core/CommonUtils.ts +2248 -0
- package/src/sap/fe/core/ExtensionAPI.js +280 -274
- package/src/sap/fe/core/ExtensionAPI.ts +242 -0
- package/src/sap/fe/core/PageController.js +219 -131
- package/src/sap/fe/core/PageController.ts +129 -0
- package/src/sap/fe/core/RouterProxy.js +936 -823
- package/src/sap/fe/core/RouterProxy.ts +854 -0
- package/src/sap/fe/core/Synchronization.js +41 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +248 -164
- package/src/sap/fe/core/TemplateComponent.ts +161 -0
- package/src/sap/fe/core/TemplateModel.js +77 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1575 -1664
- package/src/sap/fe/core/TransactionHelper.ts +1736 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +663 -608
- package/src/sap/fe/core/actions/draft.ts +669 -0
- package/src/sap/fe/core/actions/messageHandling.js +576 -514
- package/src/sap/fe/core/actions/messageHandling.ts +562 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1093 -1215
- package/src/sap/fe/core/actions/operations.ts +1193 -0
- package/src/sap/fe/core/actions/sticky.js +114 -104
- package/src/sap/fe/core/actions/sticky.ts +119 -0
- 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 +707 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -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/controllerextensions/EditFlow.js +1855 -1827
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +717 -512
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -815
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1057 -1004
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -533
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +36 -32
- package/src/sap/fe/core/controllerextensions/MassEdit.js +142 -77
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +222 -236
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
- package/src/sap/fe/core/controllerextensions/PageReady.ts +63 -55
- package/src/sap/fe/core/controllerextensions/Paginator.js +189 -175
- package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -149
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +145 -121
- package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +231 -268
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +79 -79
- package/src/sap/fe/core/controllerextensions/ViewState.js +775 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- 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 +93 -68
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +166 -79
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +168 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +164 -122
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +213 -153
- package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
- package/src/sap/fe/core/controls/FileWrapper.js +313 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
- package/src/sap/fe/core/controls/FilterBar.js +198 -159
- package/src/sap/fe/core/controls/FilterBar.ts +148 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +101 -39
- package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +148 -115
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +301 -265
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +186 -140
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +76 -74
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -379
- package/src/sap/fe/core/converters/ConverterContext.ts +23 -19
- package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +18 -2
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -365
- package/src/sap/fe/core/converters/ManifestWrapper.ts +19 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +16 -11
- package/src/sap/fe/core/converters/MetaModelConverter.ts +21 -18
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
- package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/Action.ts +22 -21
- package/src/sap/fe/core/converters/controls/Common/Chart.js +12 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -14
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +9 -7
- package/src/sap/fe/core/converters/controls/Common/Form.ts +23 -5
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +562 -218
- package/src/sap/fe/core/converters/controls/Common/Table.ts +670 -320
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +218 -94
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +265 -159
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +495 -77
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +535 -130
- 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 +10 -7
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +13 -16
- package/src/sap/fe/core/converters/helpers/Aggregation.js +117 -127
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- 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 +54 -30
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +52 -28
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +111 -74
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -98
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +4 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
- package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +5 -7
- package/src/sap/fe/core/fpm/Component.js +81 -55
- package/src/sap/fe/core/fpm/Component.ts +43 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +324 -310
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +370 -341
- package/src/sap/fe/core/helpers/BindingExpression.js +319 -360
- package/src/sap/fe/core/helpers/BindingExpression.ts +323 -397
- package/src/sap/fe/core/helpers/ClassSupport.js +321 -168
- package/src/sap/fe/core/helpers/ClassSupport.ts +362 -158
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
- package/src/sap/fe/core/helpers/MassEditHelper.js +736 -676
- package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +281 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +273 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +197 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +336 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +1 -10
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -10
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +23 -9
- package/src/sap/fe/core/library.js +426 -451
- package/src/sap/fe/core/library.support.js +23 -33
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +5 -5
- package/src/sap/fe/core/messagebundle.properties +63 -18
- package/src/sap/fe/core/messagebundle_ar.properties +37 -6
- package/src/sap/fe/core/messagebundle_bg.properties +37 -6
- package/src/sap/fe/core/messagebundle_ca.properties +37 -6
- package/src/sap/fe/core/messagebundle_cs.properties +38 -7
- package/src/sap/fe/core/messagebundle_cy.properties +37 -6
- package/src/sap/fe/core/messagebundle_da.properties +37 -6
- package/src/sap/fe/core/messagebundle_de.properties +37 -6
- package/src/sap/fe/core/messagebundle_el.properties +37 -6
- package/src/sap/fe/core/messagebundle_en.properties +37 -6
- package/src/sap/fe/core/messagebundle_en_GB.properties +37 -6
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -6
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -6
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +37 -6
- package/src/sap/fe/core/messagebundle_es.properties +37 -6
- package/src/sap/fe/core/messagebundle_es_MX.properties +37 -6
- package/src/sap/fe/core/messagebundle_et.properties +37 -6
- package/src/sap/fe/core/messagebundle_fi.properties +38 -7
- package/src/sap/fe/core/messagebundle_fr.properties +43 -12
- package/src/sap/fe/core/messagebundle_fr_CA.properties +45 -14
- package/src/sap/fe/core/messagebundle_hi.properties +43 -12
- package/src/sap/fe/core/messagebundle_hr.properties +43 -12
- package/src/sap/fe/core/messagebundle_hu.properties +37 -6
- package/src/sap/fe/core/messagebundle_id.properties +38 -7
- package/src/sap/fe/core/messagebundle_it.properties +37 -6
- package/src/sap/fe/core/messagebundle_iw.properties +37 -6
- package/src/sap/fe/core/messagebundle_ja.properties +36 -5
- package/src/sap/fe/core/messagebundle_kk.properties +43 -12
- package/src/sap/fe/core/messagebundle_ko.properties +37 -6
- package/src/sap/fe/core/messagebundle_lt.properties +37 -6
- package/src/sap/fe/core/messagebundle_lv.properties +44 -13
- package/src/sap/fe/core/messagebundle_ms.properties +42 -11
- package/src/sap/fe/core/messagebundle_nl.properties +37 -6
- package/src/sap/fe/core/messagebundle_no.properties +37 -6
- package/src/sap/fe/core/messagebundle_pl.properties +37 -6
- package/src/sap/fe/core/messagebundle_pt.properties +38 -7
- package/src/sap/fe/core/messagebundle_pt_PT.properties +37 -6
- package/src/sap/fe/core/messagebundle_ro.properties +37 -6
- package/src/sap/fe/core/messagebundle_ru.properties +37 -6
- package/src/sap/fe/core/messagebundle_sh.properties +39 -8
- package/src/sap/fe/core/messagebundle_sk.properties +37 -6
- package/src/sap/fe/core/messagebundle_sl.properties +43 -12
- package/src/sap/fe/core/messagebundle_sv.properties +38 -7
- package/src/sap/fe/core/messagebundle_th.properties +36 -5
- package/src/sap/fe/core/messagebundle_tr.properties +39 -8
- package/src/sap/fe/core/messagebundle_uk.properties +37 -6
- package/src/sap/fe/core/messagebundle_vi.properties +37 -6
- package/src/sap/fe/core/messagebundle_zh_CN.properties +37 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +43 -12
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +211 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -8
- package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +963 -899
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +907 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
- package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -40
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +572 -643
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +67 -96
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -487
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +449 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +48 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +11 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -4
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +138 -79
- package/src/sap/fe/core/templating/FilterHelper.ts +148 -79
- package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
- package/src/sap/fe/core/templating/UIFormatters.js +179 -43
- package/src/sap/fe/core/templating/UIFormatters.ts +190 -61
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +10 -11
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -74
|
@@ -16,13 +16,21 @@ import {
|
|
|
16
16
|
not,
|
|
17
17
|
notEqual,
|
|
18
18
|
or,
|
|
19
|
-
greaterThan
|
|
19
|
+
greaterThan,
|
|
20
|
+
formatResult
|
|
20
21
|
} from "sap/fe/core/helpers/BindingExpression";
|
|
21
|
-
import { CreationMode,
|
|
22
|
+
import { CreationMode, TemplateType, ViewPathConfiguration } from "../../../ManifestSettings";
|
|
22
23
|
import { singletonPathVisitor, UI } from "../../../helpers/BindingHelper";
|
|
23
24
|
import { PropertyAnnotationValue } from "@sap-ux/vocabularies-types";
|
|
24
25
|
import { getTargetObjectPath, isPathDeletable, isPathInsertable, isPathUpdatable } from "sap/fe/core/templating/DataModelPathHelper";
|
|
25
26
|
import { TableControlConfiguration } from "../Table";
|
|
27
|
+
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
28
|
+
|
|
29
|
+
enum AnnotationHiddenProperty {
|
|
30
|
+
CreateHidden = "CreateHidden",
|
|
31
|
+
DeleteHidden = "DeleteHidden",
|
|
32
|
+
UpdateHidden = "UpdateHidden"
|
|
33
|
+
}
|
|
26
34
|
|
|
27
35
|
export type StandardActionConfigType = {
|
|
28
36
|
isTemplated?: BindingExpression<boolean>;
|
|
@@ -32,7 +40,7 @@ export type StandardActionConfigType = {
|
|
|
32
40
|
|
|
33
41
|
type ExpressionRestrictionsType = {
|
|
34
42
|
expression: Expression<boolean>;
|
|
35
|
-
|
|
43
|
+
navigationExpression: Expression<boolean>;
|
|
36
44
|
};
|
|
37
45
|
type StandardActionsRestrictionsType = Record<string, ExpressionRestrictionsType>;
|
|
38
46
|
|
|
@@ -43,7 +51,7 @@ export type StandardActionsContext = {
|
|
|
43
51
|
"delete": Expression<boolean>;
|
|
44
52
|
update: Expression<boolean>;
|
|
45
53
|
};
|
|
46
|
-
|
|
54
|
+
creationMode: CreationMode;
|
|
47
55
|
isDraftOrStickySupported: boolean;
|
|
48
56
|
isViewWithMultipleVisualizations: boolean;
|
|
49
57
|
newAction?: {
|
|
@@ -55,29 +63,28 @@ export type StandardActionsContext = {
|
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
/**
|
|
58
|
-
* Generates context for the standard actions.
|
|
66
|
+
* Generates the context for the standard actions.
|
|
59
67
|
*
|
|
60
68
|
* @param {ConverterContext} converterContext
|
|
61
|
-
* @param {NavigationSettingsConfiguration}
|
|
69
|
+
* @param {NavigationSettingsConfiguration} creationMode
|
|
62
70
|
* @param {TableControlConfiguration} tableManifestConfiguration
|
|
63
71
|
* @param {ViewPathConfiguration} viewConfiguration
|
|
64
72
|
* @returns The context for table actions
|
|
65
73
|
*/
|
|
66
|
-
|
|
67
74
|
export function generateStandardActionsContext(
|
|
68
75
|
converterContext: ConverterContext,
|
|
69
|
-
|
|
76
|
+
creationMode: CreationMode,
|
|
70
77
|
tableManifestConfiguration: TableControlConfiguration,
|
|
71
78
|
viewConfiguration?: ViewPathConfiguration
|
|
72
79
|
): StandardActionsContext {
|
|
73
80
|
return {
|
|
74
81
|
collectionPath: getTargetObjectPath(converterContext.getDataModelObjectPath()),
|
|
75
82
|
hiddenAnnotation: {
|
|
76
|
-
create: isActionAnnotatedHidden(converterContext,
|
|
77
|
-
"delete": isActionAnnotatedHidden(converterContext,
|
|
78
|
-
update: isActionAnnotatedHidden(converterContext,
|
|
83
|
+
create: isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.CreateHidden),
|
|
84
|
+
"delete": isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.DeleteHidden),
|
|
85
|
+
update: isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.UpdateHidden)
|
|
79
86
|
},
|
|
80
|
-
|
|
87
|
+
creationMode: creationMode,
|
|
81
88
|
isDraftOrStickySupported: isDraftOrStickySupported(converterContext),
|
|
82
89
|
isViewWithMultipleVisualizations: viewConfiguration
|
|
83
90
|
? converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration)
|
|
@@ -89,14 +96,23 @@ export function generateStandardActionsContext(
|
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
/**
|
|
92
|
-
* Checks if
|
|
99
|
+
* Checks if draft is supported.
|
|
93
100
|
*
|
|
94
|
-
* @param {
|
|
101
|
+
* @param {ConverterContext} converterContext
|
|
95
102
|
* @returns {boolean}
|
|
96
103
|
*/
|
|
97
|
-
export function
|
|
98
|
-
const
|
|
99
|
-
|
|
104
|
+
export function isDraftSupported(converterContext: ConverterContext): boolean {
|
|
105
|
+
const currentEntitySet = converterContext.getEntitySet();
|
|
106
|
+
const bIsDraftRoot = currentEntitySet && currentEntitySet.annotations?.Common?.DraftRoot ? true : false;
|
|
107
|
+
const bIsDraftNode = currentEntitySet && currentEntitySet.annotations?.Common?.DraftNode ? true : false;
|
|
108
|
+
const bIsDraftParentEntityForContainment =
|
|
109
|
+
converterContext.getDataModelObjectPath().targetObject?.containsTarget &&
|
|
110
|
+
(converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftRoot ||
|
|
111
|
+
converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftNode)
|
|
112
|
+
? true
|
|
113
|
+
: false;
|
|
114
|
+
|
|
115
|
+
return bIsDraftRoot || bIsDraftNode || (!converterContext.getEntitySet() && bIsDraftParentEntityForContainment);
|
|
100
116
|
}
|
|
101
117
|
|
|
102
118
|
/**
|
|
@@ -106,26 +122,13 @@ export function isExternalCreateConfigured(navigationSettings: NavigationSetting
|
|
|
106
122
|
* @returns {boolean}
|
|
107
123
|
*/
|
|
108
124
|
export function isDraftOrStickySupported(converterContext: ConverterContext): boolean {
|
|
109
|
-
const
|
|
125
|
+
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
110
126
|
const bIsStickySessionSupported = converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Session
|
|
111
127
|
?.StickySessionSupported
|
|
112
128
|
? true
|
|
113
129
|
: false;
|
|
114
|
-
const bIsDraftRoot = currentEntitySet && currentEntitySet.annotations?.Common?.DraftRoot ? true : false;
|
|
115
|
-
const bIsDraftNode = currentEntitySet && currentEntitySet.annotations?.Common?.DraftNode ? true : false;
|
|
116
|
-
const bIsDraftParentEntityForContainment =
|
|
117
|
-
converterContext.getDataModelObjectPath().targetObject?.containsTarget &&
|
|
118
|
-
(converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftRoot ||
|
|
119
|
-
converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftNode)
|
|
120
|
-
? true
|
|
121
|
-
: false;
|
|
122
130
|
|
|
123
|
-
return
|
|
124
|
-
bIsDraftRoot ||
|
|
125
|
-
bIsDraftNode ||
|
|
126
|
-
bIsStickySessionSupported ||
|
|
127
|
-
(!converterContext.getEntitySet() && bIsDraftParentEntityForContainment)
|
|
128
|
-
);
|
|
131
|
+
return bIsDraftSupported || bIsStickySessionSupported;
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -152,32 +155,37 @@ export function getNewAction(converterContext: ConverterContext): any {
|
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
/**
|
|
155
|
-
* Gets binding expression for the action visibility configured into annotation.
|
|
158
|
+
* Gets the binding expression for the action visibility configured into annotation.
|
|
156
159
|
*
|
|
157
160
|
* @param {ConverterContext} converterContext
|
|
158
161
|
* @param {string} sAnnotationTerm
|
|
162
|
+
* @param {boolean} bWithNavigationPath
|
|
159
163
|
* @returns {Expression<boolean>}
|
|
160
164
|
*/
|
|
161
|
-
export function isActionAnnotatedHidden(
|
|
165
|
+
export function isActionAnnotatedHidden(
|
|
166
|
+
converterContext: ConverterContext,
|
|
167
|
+
sAnnotationTerm: string,
|
|
168
|
+
bWithNavigationPath = true
|
|
169
|
+
): Expression<boolean> {
|
|
162
170
|
const currentEntitySet = converterContext.getEntitySet();
|
|
163
171
|
const dataModelObjectPath = converterContext.getDataModelObjectPath();
|
|
164
172
|
// Consider only the last level of navigation. The others are already considered in the element binding of the page.
|
|
165
173
|
const visitedNavigationPaths =
|
|
166
|
-
dataModelObjectPath.navigationProperties.length > 0
|
|
174
|
+
dataModelObjectPath.navigationProperties.length > 0 && bWithNavigationPath
|
|
167
175
|
? [dataModelObjectPath.navigationProperties[dataModelObjectPath.navigationProperties.length - 1].name]
|
|
168
176
|
: [];
|
|
177
|
+
const actionAnnotationValue =
|
|
178
|
+
((currentEntitySet?.annotations.UI as any)?.[sAnnotationTerm] as PropertyAnnotationValue<boolean>) || false;
|
|
179
|
+
|
|
169
180
|
return currentEntitySet
|
|
170
|
-
? annotationExpression(
|
|
171
|
-
((
|
|
172
|
-
visitedNavigationPaths,
|
|
173
|
-
undefined,
|
|
174
|
-
(path: string) => singletonPathVisitor(path, converterContext, visitedNavigationPaths)
|
|
181
|
+
? annotationExpression(actionAnnotationValue, visitedNavigationPaths, undefined, (path: string) =>
|
|
182
|
+
singletonPathVisitor(path, converterContext.getConvertedTypes(), visitedNavigationPaths)
|
|
175
183
|
)
|
|
176
184
|
: constant(false);
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
/**
|
|
180
|
-
* Gets annotated restrictions for actions.
|
|
188
|
+
* Gets the annotated restrictions for the actions.
|
|
181
189
|
*
|
|
182
190
|
* @param {ConverterContext} converterContext
|
|
183
191
|
* @returns {StandardActionsRestrictionsType}
|
|
@@ -202,9 +210,22 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
|
|
|
202
210
|
restrictionsDef.forEach(function(def) {
|
|
203
211
|
const defFunction = def["function"];
|
|
204
212
|
result[def.key] = {
|
|
205
|
-
expression: defFunction.apply(null, [
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
expression: defFunction.apply(null, [
|
|
214
|
+
dataModelObjectPath,
|
|
215
|
+
{
|
|
216
|
+
pathVisitor: (path: string, navigationPaths: string[]) =>
|
|
217
|
+
singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths)
|
|
218
|
+
}
|
|
219
|
+
]),
|
|
220
|
+
navigationExpression: defFunction.apply(null, [
|
|
221
|
+
dataModelObjectPath,
|
|
222
|
+
{
|
|
223
|
+
ignoreTargetCollection: true,
|
|
224
|
+
authorizeUnresolvable: true,
|
|
225
|
+
pathVisitor: (path: string, navigationPaths: string[]) =>
|
|
226
|
+
singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths)
|
|
227
|
+
}
|
|
228
|
+
])
|
|
208
229
|
};
|
|
209
230
|
});
|
|
210
231
|
return result;
|
|
@@ -214,20 +235,20 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
|
|
|
214
235
|
* Checks if templating for insert/update actions is mandatory.
|
|
215
236
|
*
|
|
216
237
|
* @param {StandardActionsContext} standardActionsContext
|
|
217
|
-
* @param {boolean}
|
|
238
|
+
* @param {boolean} isDraftOrSticky
|
|
218
239
|
* @param {boolean} isCreateAlwaysHidden
|
|
219
240
|
* @returns {boolean}
|
|
220
241
|
*/
|
|
221
242
|
export function getInsertUpdateActionsTemplating(
|
|
222
243
|
standardActionsContext: StandardActionsContext,
|
|
223
|
-
|
|
244
|
+
isDraftOrSticky: boolean,
|
|
224
245
|
isCreateAlwaysHidden: boolean
|
|
225
246
|
): boolean {
|
|
226
|
-
return (
|
|
247
|
+
return (isDraftOrSticky || standardActionsContext.creationMode === CreationMode.External) && !isCreateAlwaysHidden;
|
|
227
248
|
}
|
|
228
249
|
|
|
229
250
|
/**
|
|
230
|
-
* Gets binding expressions for the properties of the action Create.
|
|
251
|
+
* Gets the binding expressions for the properties of the action Create.
|
|
231
252
|
*
|
|
232
253
|
* @param {ConverterContext} converterContext
|
|
233
254
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -246,7 +267,7 @@ export function getStandardActionCreate(
|
|
|
246
267
|
}
|
|
247
268
|
|
|
248
269
|
/**
|
|
249
|
-
* Gets binding expressions for the properties of the action Delete.
|
|
270
|
+
* Gets the binding expressions for the properties of the action Delete.
|
|
250
271
|
*
|
|
251
272
|
* @param {ConverterContext} converterContext
|
|
252
273
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -266,112 +287,120 @@ export function getStandardActionDelete(
|
|
|
266
287
|
}
|
|
267
288
|
|
|
268
289
|
/**
|
|
269
|
-
*
|
|
290
|
+
* @param converterContext
|
|
291
|
+
* @param standardActionsContext
|
|
292
|
+
* @returns StandardActionConfigType
|
|
293
|
+
*/
|
|
294
|
+
export function getCreationRow(
|
|
295
|
+
converterContext: ConverterContext,
|
|
296
|
+
standardActionsContext: StandardActionsContext
|
|
297
|
+
): StandardActionConfigType {
|
|
298
|
+
const creationRowVisibility = getCreateVisibility(converterContext, standardActionsContext, true);
|
|
299
|
+
|
|
300
|
+
return {
|
|
301
|
+
isTemplated: compileBinding(getCreateTemplating(standardActionsContext, creationRowVisibility, true)),
|
|
302
|
+
visible: compileBinding(creationRowVisibility),
|
|
303
|
+
enabled: compileBinding(getCreationRowEnablement(converterContext, standardActionsContext, creationRowVisibility))
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Gets the binding expressions for the properties of the action Paste.
|
|
270
309
|
*
|
|
271
310
|
* @param {ConverterContext} converterContext
|
|
272
311
|
* @param {StandardActionsContext} standardActionsContext
|
|
312
|
+
* @param {boolean} isInsertUpdateActionsTemplated
|
|
273
313
|
* @returns {StandardActionConfigType}
|
|
274
314
|
*/
|
|
275
315
|
export function getStandardActionPaste(
|
|
276
316
|
converterContext: ConverterContext,
|
|
277
|
-
standardActionsContext: StandardActionsContext
|
|
317
|
+
standardActionsContext: StandardActionsContext,
|
|
318
|
+
isInsertUpdateActionsTemplated: boolean
|
|
278
319
|
): StandardActionConfigType {
|
|
279
320
|
const createVisibility = getCreateVisibility(converterContext, standardActionsContext);
|
|
280
|
-
const
|
|
281
|
-
|
|
321
|
+
const createEnablement = getCreateEnablement(converterContext, standardActionsContext, createVisibility);
|
|
322
|
+
const pasteVisibility = getPasteVisibility(converterContext, standardActionsContext, createVisibility, isInsertUpdateActionsTemplated);
|
|
282
323
|
return {
|
|
283
|
-
isTemplated: compileBinding(getDefaultTemplating(pasteVisibility)),
|
|
284
324
|
visible: compileBinding(pasteVisibility),
|
|
285
|
-
enabled: compileBinding(pasteVisibility)
|
|
325
|
+
enabled: compileBinding(getPasteEnablement(pasteVisibility, createEnablement))
|
|
286
326
|
};
|
|
287
327
|
}
|
|
288
328
|
|
|
289
329
|
/**
|
|
290
|
-
* Gets binding expressions for the properties of the action MassEdit.
|
|
330
|
+
* Gets the binding expressions for the properties of the action MassEdit.
|
|
291
331
|
*
|
|
292
332
|
* @param {ConverterContext} converterContext
|
|
293
333
|
* @param {StandardActionsContext} standardActionsContext
|
|
294
|
-
* @param {string | undefined} selectionMode
|
|
295
334
|
* @returns {StandardActionConfigType}
|
|
296
335
|
*/
|
|
297
336
|
export function getStandardActionMassEdit(
|
|
298
337
|
converterContext: ConverterContext,
|
|
299
|
-
standardActionsContext: StandardActionsContext
|
|
300
|
-
selectionMode: string | undefined
|
|
338
|
+
standardActionsContext: StandardActionsContext
|
|
301
339
|
): StandardActionConfigType {
|
|
302
|
-
const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext
|
|
340
|
+
const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext);
|
|
303
341
|
|
|
304
342
|
return {
|
|
305
343
|
isTemplated: compileBinding(getDefaultTemplating(massEditVisibility)),
|
|
306
344
|
visible: compileBinding(massEditVisibility),
|
|
307
|
-
enabled: compileBinding(getMassEditEnablement(standardActionsContext, massEditVisibility))
|
|
345
|
+
enabled: compileBinding(getMassEditEnablement(converterContext, standardActionsContext, massEditVisibility))
|
|
308
346
|
};
|
|
309
347
|
}
|
|
310
348
|
|
|
311
349
|
/**
|
|
312
|
-
* Gets binding
|
|
350
|
+
* Gets the binding expression for the templating of the action Create.
|
|
313
351
|
*
|
|
314
352
|
* @param {StandardActionsContext} standardActionsContext
|
|
315
353
|
* @param {Expression<boolean>} createVisibility
|
|
354
|
+
* @param {boolean} isForCreationRow
|
|
316
355
|
* @returns {Expression<boolean> }
|
|
317
356
|
*/
|
|
318
357
|
export function getCreateTemplating(
|
|
319
358
|
standardActionsContext: StandardActionsContext,
|
|
320
|
-
createVisibility: Expression<boolean
|
|
359
|
+
createVisibility: Expression<boolean>,
|
|
360
|
+
isForCreationRow = false
|
|
321
361
|
): Expression<boolean> {
|
|
322
|
-
const isCreationRow = standardActionsContext.tableManifestConfiguration.creationMode === CreationMode.CreationRow;
|
|
323
|
-
const newAction = standardActionsContext.newAction;
|
|
324
|
-
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
325
|
-
|
|
326
362
|
//Templating of Create Button is not done:
|
|
327
|
-
// - If Button is never visible
|
|
328
|
-
//
|
|
329
|
-
// -
|
|
330
|
-
// - Otherwise If there is no external create action
|
|
331
|
-
// - Otherwise if there is delete restrictions on the current entitySet set to false
|
|
363
|
+
// - If Button is never visible(covered the External create button, new Action)
|
|
364
|
+
// - or CreationMode is on CreationRow for Create Button
|
|
365
|
+
// - or CreationMode is not on CreationRow for CreationRow Button
|
|
332
366
|
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
and(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
and(not(standardActionsContext.restrictions.isInsertable.isOnlyCurrentEntityExpression), isConstant(isInsertable)),
|
|
341
|
-
isInsertable,
|
|
342
|
-
ifElse(
|
|
343
|
-
standardActionsContext.isExternalCreateConfigured,
|
|
344
|
-
true,
|
|
345
|
-
not(and(isConstant(isInsertable), equal(isInsertable, constant(false))))
|
|
346
|
-
)
|
|
347
|
-
)
|
|
348
|
-
)
|
|
367
|
+
return and(
|
|
368
|
+
//XNOR gate
|
|
369
|
+
or(
|
|
370
|
+
and(isForCreationRow, standardActionsContext.creationMode === CreationMode.CreationRow),
|
|
371
|
+
and(!isForCreationRow, standardActionsContext.creationMode !== CreationMode.CreationRow)
|
|
372
|
+
),
|
|
373
|
+
or(not(isConstant(createVisibility)), createVisibility)
|
|
349
374
|
);
|
|
350
375
|
}
|
|
351
376
|
|
|
352
377
|
/**
|
|
353
|
-
* Gets binding
|
|
378
|
+
* Gets the binding expression for the templating of the non-Create actions.
|
|
354
379
|
*
|
|
355
380
|
* @param {Expression<boolean>} actionVisibility
|
|
356
381
|
* @returns {Expression<boolean> }
|
|
357
382
|
*/
|
|
358
383
|
export function getDefaultTemplating(actionVisibility: Expression<boolean>): Expression<boolean> {
|
|
359
|
-
return not(
|
|
384
|
+
return or(not(isConstant(actionVisibility)), actionVisibility);
|
|
360
385
|
}
|
|
361
386
|
|
|
362
387
|
/**
|
|
363
|
-
* Gets binding
|
|
388
|
+
* Gets the binding expression for the property visible of the action Create.
|
|
364
389
|
*
|
|
365
390
|
* @param {ConverterContext} converterContext
|
|
366
391
|
* @param {StandardActionsContext} standardActionsContext
|
|
392
|
+
* @param {boolean} isForCreationRow
|
|
367
393
|
* @returns {Expression<boolean> }
|
|
368
394
|
*/
|
|
369
395
|
export function getCreateVisibility(
|
|
370
396
|
converterContext: ConverterContext,
|
|
371
|
-
standardActionsContext: StandardActionsContext
|
|
397
|
+
standardActionsContext: StandardActionsContext,
|
|
398
|
+
isForCreationRow = false
|
|
372
399
|
): Expression<boolean> {
|
|
373
400
|
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
374
|
-
const isCreateHidden =
|
|
401
|
+
const isCreateHidden = isForCreationRow
|
|
402
|
+
? isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.CreateHidden, false)
|
|
403
|
+
: standardActionsContext.hiddenAnnotation.create;
|
|
375
404
|
const newAction = standardActionsContext.newAction;
|
|
376
405
|
|
|
377
406
|
//Create Button is visible:
|
|
@@ -385,12 +414,8 @@ export function getCreateVisibility(
|
|
|
385
414
|
// - Otherwise
|
|
386
415
|
// - This depends on the value of the the UI.IsEditable
|
|
387
416
|
return ifElse(
|
|
388
|
-
standardActionsContext.
|
|
389
|
-
|
|
390
|
-
converterContext.getTemplateType() === TemplateType.ListReport,
|
|
391
|
-
not(isCreateHidden),
|
|
392
|
-
and(not(isCreateHidden), UI.IsEditable)
|
|
393
|
-
),
|
|
417
|
+
standardActionsContext.creationMode === CreationMode.External,
|
|
418
|
+
and(not(isCreateHidden), or(converterContext.getTemplateType() === TemplateType.ListReport, UI.IsEditable)),
|
|
394
419
|
ifElse(
|
|
395
420
|
or(
|
|
396
421
|
and(isConstant(newAction?.available), equal(newAction?.available, false)),
|
|
@@ -402,7 +427,7 @@ export function getCreateVisibility(
|
|
|
402
427
|
false,
|
|
403
428
|
ifElse(
|
|
404
429
|
converterContext.getTemplateType() === TemplateType.ListReport,
|
|
405
|
-
|
|
430
|
+
or(not(isBinding(isCreateHidden)), not(isCreateHidden)),
|
|
406
431
|
and(not(isCreateHidden), UI.IsEditable)
|
|
407
432
|
)
|
|
408
433
|
)
|
|
@@ -410,7 +435,7 @@ export function getCreateVisibility(
|
|
|
410
435
|
}
|
|
411
436
|
|
|
412
437
|
/**
|
|
413
|
-
* Gets binding
|
|
438
|
+
* Gets the binding expression for the property visible of the action Delete.
|
|
414
439
|
*
|
|
415
440
|
* @param {ConverterContext} converterContext
|
|
416
441
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -421,7 +446,7 @@ export function getDeleteVisibility(
|
|
|
421
446
|
standardActionsContext: StandardActionsContext
|
|
422
447
|
): Expression<boolean> {
|
|
423
448
|
const isDeleteHidden = standardActionsContext.hiddenAnnotation.delete;
|
|
424
|
-
const
|
|
449
|
+
const pathDeletableExpression = standardActionsContext.restrictions.isDeletable.expression;
|
|
425
450
|
|
|
426
451
|
//Delete Button is visible:
|
|
427
452
|
// Prerequisites:
|
|
@@ -431,7 +456,7 @@ export function getDeleteVisibility(
|
|
|
431
456
|
// - Otherwise
|
|
432
457
|
// - If UI.DeleteHidden is true -> not visible
|
|
433
458
|
// - Otherwise
|
|
434
|
-
// - If we're on OP -> depending
|
|
459
|
+
// - If we're on OP -> depending if UI is editable and restrictions on deletable
|
|
435
460
|
// - Otherwise
|
|
436
461
|
// - If UI.DeleteHidden points to a property path -> provide a negated binding to this path
|
|
437
462
|
// - Otherwise, delete is visible
|
|
@@ -440,15 +465,15 @@ export function getDeleteVisibility(
|
|
|
440
465
|
or(standardActionsContext.isViewWithMultipleVisualizations, converterContext.getTemplateType() === TemplateType.AnalyticalListPage),
|
|
441
466
|
false,
|
|
442
467
|
ifElse(
|
|
443
|
-
and(isConstant(
|
|
468
|
+
and(isConstant(pathDeletableExpression), equal(pathDeletableExpression, false)),
|
|
444
469
|
false,
|
|
445
470
|
ifElse(
|
|
446
471
|
and(isConstant(isDeleteHidden), equal(isDeleteHidden, constant(true))),
|
|
447
472
|
false,
|
|
448
473
|
ifElse(
|
|
449
474
|
converterContext.getTemplateType() !== TemplateType.ListReport,
|
|
450
|
-
and(not(isDeleteHidden),
|
|
451
|
-
|
|
475
|
+
and(not(isDeleteHidden), UI.IsEditable),
|
|
476
|
+
not(and(isBinding(isDeleteHidden), isDeleteHidden))
|
|
452
477
|
)
|
|
453
478
|
)
|
|
454
479
|
)
|
|
@@ -456,47 +481,50 @@ export function getDeleteVisibility(
|
|
|
456
481
|
}
|
|
457
482
|
|
|
458
483
|
/**
|
|
459
|
-
* Gets binding
|
|
484
|
+
* Gets the binding expression for the property visible of the action Paste.
|
|
460
485
|
*
|
|
461
486
|
* @param {ConverterContext} converterContext
|
|
462
487
|
* @param {StandardActionsContext} standardActionsContext
|
|
463
488
|
* @param {Expression<boolean>} createVisibility
|
|
489
|
+
* @param {boolean} isInsertUpdateActionsTemplated
|
|
464
490
|
* @returns {Expression<boolean> }
|
|
465
491
|
*/
|
|
466
492
|
export function getPasteVisibility(
|
|
467
493
|
converterContext: ConverterContext,
|
|
468
494
|
standardActionsContext: StandardActionsContext,
|
|
469
|
-
createVisibility: Expression<boolean
|
|
495
|
+
createVisibility: Expression<boolean>,
|
|
496
|
+
isInsertUpdateActionsTemplated: boolean
|
|
470
497
|
): Expression<boolean> {
|
|
471
|
-
// If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
|
|
498
|
+
// If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
|
|
499
|
+
// Then button will be visible according to insertable restrictions and create visibility
|
|
472
500
|
// Otherwise it's not visible
|
|
473
|
-
return
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
501
|
+
return and(
|
|
502
|
+
notEqual(standardActionsContext.tableManifestConfiguration.enablePaste, false),
|
|
503
|
+
createVisibility,
|
|
504
|
+
isInsertUpdateActionsTemplated,
|
|
505
|
+
[TemplateType.ListReport, TemplateType.AnalyticalListPage].indexOf(converterContext.getTemplateType()) === -1,
|
|
506
|
+
standardActionsContext.restrictions.isInsertable.expression
|
|
478
507
|
);
|
|
479
508
|
}
|
|
480
509
|
|
|
481
510
|
/**
|
|
482
|
-
* Gets binding
|
|
511
|
+
* Gets the binding expression for the property visible of the action MassEdit.
|
|
483
512
|
*
|
|
484
513
|
* @param {ConverterContext} converterContext
|
|
485
514
|
* @param {StandardActionsContext} standardActionsContext
|
|
486
|
-
* @param {string | undefined} selectionMode
|
|
487
515
|
* @returns {Expression<boolean> }
|
|
488
516
|
*/
|
|
489
517
|
export function getMassEditVisibility(
|
|
490
518
|
converterContext: ConverterContext,
|
|
491
|
-
standardActionsContext: StandardActionsContext
|
|
492
|
-
selectionMode: string | undefined
|
|
519
|
+
standardActionsContext: StandardActionsContext
|
|
493
520
|
): Expression<boolean> {
|
|
494
521
|
const isUpdateHidden = standardActionsContext.hiddenAnnotation.update,
|
|
495
|
-
|
|
496
|
-
bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
522
|
+
pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression,
|
|
523
|
+
bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false;
|
|
524
|
+
const templateBindingExpression =
|
|
525
|
+
converterContext.getTemplateType() === TemplateType.ObjectPage
|
|
526
|
+
? UI.IsEditable
|
|
527
|
+
: converterContext.getTemplateType() === TemplateType.ListReport;
|
|
500
528
|
//MassEdit is visible
|
|
501
529
|
// If
|
|
502
530
|
// - there is no static restrictions set to false
|
|
@@ -504,19 +532,64 @@ export function getMassEditVisibility(
|
|
|
504
532
|
// - and the selectionMode is relevant
|
|
505
533
|
// Then MassEdit is always visible in LR or dynamically visible in OP according to ui>Editable and hiddenAnnotation
|
|
506
534
|
// Button is hidden for all other cases
|
|
507
|
-
return
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
converterContext.getTemplateType() === TemplateType.ListReport
|
|
513
|
-
),
|
|
514
|
-
false
|
|
535
|
+
return and(
|
|
536
|
+
not(and(isConstant(pathUpdatableExpression), equal(pathUpdatableExpression, false))),
|
|
537
|
+
bMassEditEnabledInManifest,
|
|
538
|
+
templateBindingExpression,
|
|
539
|
+
not(isUpdateHidden)
|
|
515
540
|
);
|
|
516
541
|
}
|
|
517
542
|
|
|
518
543
|
/**
|
|
519
|
-
* Gets binding
|
|
544
|
+
* Gets the binding expression for the property enabled of the creationRow.
|
|
545
|
+
*
|
|
546
|
+
* @param {ConverterContext} converterContext
|
|
547
|
+
* @param {StandardActionsContext} standardActionsContext
|
|
548
|
+
* @param {Expression<boolean>} creationRowVisibility
|
|
549
|
+
* @returns {Expression<boolean> }
|
|
550
|
+
*/
|
|
551
|
+
export function getCreationRowEnablement(
|
|
552
|
+
converterContext: ConverterContext,
|
|
553
|
+
standardActionsContext: StandardActionsContext,
|
|
554
|
+
creationRowVisibility: Expression<boolean>
|
|
555
|
+
): Expression<boolean> {
|
|
556
|
+
const restrictionsInsertable = isPathInsertable(converterContext.getDataModelObjectPath(), {
|
|
557
|
+
ignoreTargetCollection: true,
|
|
558
|
+
authorizeUnresolvable: true,
|
|
559
|
+
pathVisitor: (path: string, navigationPaths: string[]) => {
|
|
560
|
+
if (path.indexOf("/") === 0) {
|
|
561
|
+
path = singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths);
|
|
562
|
+
return path;
|
|
563
|
+
}
|
|
564
|
+
const navigationProperties = converterContext.getDataModelObjectPath().navigationProperties;
|
|
565
|
+
if (navigationProperties) {
|
|
566
|
+
const partner = navigationProperties[navigationProperties.length - 1].partner;
|
|
567
|
+
if (partner) {
|
|
568
|
+
path = `${partner}/${path}`;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return path;
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
const isInsertable =
|
|
575
|
+
restrictionsInsertable._type === "Unresolvable"
|
|
576
|
+
? isPathInsertable(converterContext.getDataModelObjectPath(), {
|
|
577
|
+
pathVisitor: (path: string) => singletonPathVisitor(path, converterContext.getConvertedTypes(), [])
|
|
578
|
+
})
|
|
579
|
+
: restrictionsInsertable;
|
|
580
|
+
|
|
581
|
+
return and(
|
|
582
|
+
creationRowVisibility,
|
|
583
|
+
isInsertable,
|
|
584
|
+
or(
|
|
585
|
+
!standardActionsContext.tableManifestConfiguration.disableAddRowButtonForEmptyData,
|
|
586
|
+
formatResult([bindingExpression("creationRowFieldValidity", "internal")], tableFormatters.validateCreationRowFields)
|
|
587
|
+
)
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Gets the binding expression for the property enabled of the action Create.
|
|
520
593
|
*
|
|
521
594
|
* @param {ConverterContext} converterContext
|
|
522
595
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -531,21 +604,16 @@ export function getCreateEnablement(
|
|
|
531
604
|
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
532
605
|
const CollectionType = converterContext.resolveAbsolutePath<any>(standardActionsContext.collectionPath).target?._type;
|
|
533
606
|
return and(
|
|
534
|
-
|
|
535
|
-
|
|
607
|
+
createVisibility,
|
|
608
|
+
or(
|
|
536
609
|
CollectionType === "EntitySet",
|
|
537
|
-
|
|
538
|
-
ifElse(
|
|
539
|
-
converterContext.getTemplateType() !== TemplateType.ObjectPage,
|
|
540
|
-
isInsertable,
|
|
541
|
-
and(isInsertable, equal(bindingExpression("/editMode", "ui"), "Editable"))
|
|
542
|
-
)
|
|
610
|
+
and(isInsertable, or(converterContext.getTemplateType() !== TemplateType.ObjectPage, UI.IsEditable))
|
|
543
611
|
)
|
|
544
612
|
);
|
|
545
613
|
}
|
|
546
614
|
|
|
547
615
|
/**
|
|
548
|
-
* Gets binding
|
|
616
|
+
* Gets the binding expression for the property enabled of the action Delete.
|
|
549
617
|
*
|
|
550
618
|
* @param {ConverterContext} converterContext
|
|
551
619
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -559,22 +627,21 @@ export function getDeleteEnablement(
|
|
|
559
627
|
): Expression<boolean> {
|
|
560
628
|
const isDeletable = standardActionsContext.restrictions.isDeletable.expression;
|
|
561
629
|
const isOnlyDynamicOnCurrentEntity =
|
|
562
|
-
standardActionsContext.restrictions.isDeletable.
|
|
630
|
+
!isConstant(isDeletable) && standardActionsContext.restrictions.isDeletable.navigationExpression._type === "Unresolvable";
|
|
563
631
|
const numberOfSelectedContexts = bindingExpression("numberOfSelectedContexts", "internal");
|
|
564
632
|
const numberOfDeletableContexts = bindingExpression("deletableContexts", "internal");
|
|
565
633
|
const numberOfUnSavedContexts = bindingExpression("unSavedContexts", "internal");
|
|
566
634
|
|
|
567
635
|
return and(
|
|
568
|
-
|
|
636
|
+
deleteVisibility,
|
|
569
637
|
ifElse(
|
|
570
638
|
or(converterContext.getTemplateType() !== TemplateType.ObjectPage, isOnlyDynamicOnCurrentEntity),
|
|
571
|
-
|
|
639
|
+
and(
|
|
572
640
|
or(
|
|
573
641
|
and(notEqual(numberOfDeletableContexts, undefined), greaterThan(length(numberOfDeletableContexts), 0)),
|
|
574
642
|
and(notEqual(numberOfUnSavedContexts, undefined), greaterThan(length(numberOfUnSavedContexts), 0))
|
|
575
643
|
),
|
|
576
|
-
bindingExpression("deleteEnabled", "internal")
|
|
577
|
-
false
|
|
644
|
+
bindingExpression("deleteEnabled", "internal")
|
|
578
645
|
),
|
|
579
646
|
and(notEqual(numberOfSelectedContexts, 0), isDeletable)
|
|
580
647
|
)
|
|
@@ -582,28 +649,67 @@ export function getDeleteEnablement(
|
|
|
582
649
|
}
|
|
583
650
|
|
|
584
651
|
/**
|
|
585
|
-
* Gets binding
|
|
652
|
+
* Gets the binding expression for the property enabled of the action Paste.
|
|
653
|
+
*
|
|
654
|
+
* @param {Expression<boolean>} pasteVisibility
|
|
655
|
+
* @param {Expression<boolean>} createEnablement
|
|
656
|
+
* @returns {Expression<boolean> }
|
|
657
|
+
*/
|
|
658
|
+
export function getPasteEnablement(pasteVisibility: Expression<boolean>, createEnablement: Expression<boolean>): Expression<boolean> {
|
|
659
|
+
return and(pasteVisibility, createEnablement);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Gets the binding expression for the property enabled of the action MassEdit.
|
|
586
664
|
*
|
|
665
|
+
* @param {ConverterContext} converterContext
|
|
587
666
|
* @param {StandardActionsContext} standardActionsContext
|
|
588
667
|
* @param {Expression<boolean>} massEditVisibility
|
|
589
668
|
* @returns {Expression<boolean> }
|
|
590
669
|
*/
|
|
591
670
|
export function getMassEditEnablement(
|
|
671
|
+
converterContext: ConverterContext,
|
|
592
672
|
standardActionsContext: StandardActionsContext,
|
|
593
673
|
massEditVisibility: Expression<boolean>
|
|
594
674
|
): Expression<boolean> {
|
|
595
|
-
const
|
|
675
|
+
const pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression;
|
|
596
676
|
const isOnlyDynamicOnCurrentEntity: any =
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
677
|
+
!isConstant(pathUpdatableExpression) &&
|
|
678
|
+
standardActionsContext.restrictions.isUpdatable.navigationExpression._type === "Unresolvable";
|
|
679
|
+
const numberOfSelectedContexts = greaterOrEqual(bindingExpression("numberOfSelectedContexts", "internal"), 1);
|
|
680
|
+
const numberOfUpdatableContexts = greaterOrEqual(length(bindingExpression("updatableContexts", "internal")), 1);
|
|
681
|
+
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
682
|
+
const bDisplayMode = isInDisplayMode(converterContext);
|
|
683
|
+
|
|
684
|
+
// numberOfUpdatableContexts needs to be added to the binding in case
|
|
685
|
+
// 1. Update is dependent on current entity property (isOnlyDynamicOnCurrentEntity is true).
|
|
686
|
+
// 2. The table is read only and draft enabled(like LR), in this case only active contexts can be mass edited.
|
|
687
|
+
// So, update depends on 'IsActiveEntity' value which needs to be checked runtime.
|
|
688
|
+
const runtimeBinding = ifElse(
|
|
689
|
+
or(and(bDisplayMode, bIsDraftSupported), isOnlyDynamicOnCurrentEntity),
|
|
690
|
+
and(numberOfSelectedContexts, numberOfUpdatableContexts),
|
|
691
|
+
and(numberOfSelectedContexts)
|
|
608
692
|
);
|
|
693
|
+
|
|
694
|
+
return and(massEditVisibility, ifElse(isOnlyDynamicOnCurrentEntity, runtimeBinding, and(runtimeBinding, pathUpdatableExpression)));
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Tells if the table in template is in display mode.
|
|
699
|
+
*
|
|
700
|
+
* @param {ConverterContext} converterContext
|
|
701
|
+
* @param {ViewPathConfiguration} viewConfiguration
|
|
702
|
+
* @returns {boolean}
|
|
703
|
+
*/
|
|
704
|
+
export function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
|
|
705
|
+
const templateType = converterContext.getTemplateType();
|
|
706
|
+
if (
|
|
707
|
+
templateType === TemplateType.ListReport ||
|
|
708
|
+
templateType === TemplateType.AnalyticalListPage ||
|
|
709
|
+
(viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration))
|
|
710
|
+
) {
|
|
711
|
+
return true;
|
|
712
|
+
}
|
|
713
|
+
// updatable will be handled at the property level
|
|
714
|
+
return false;
|
|
609
715
|
}
|