@sapui5/sap.fe.core 1.102.0 → 1.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +62 -26
- package/src/sap/fe/core/AppComponent.ts +56 -40
- package/src/sap/fe/core/AppStateHandler.js +10 -10
- package/src/sap/fe/core/AppStateHandler.ts +9 -9
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +236 -109
- package/src/sap/fe/core/CommonUtils.ts +252 -136
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +31 -26
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +8 -8
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +22 -22
- package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +65 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +6 -6
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +184 -137
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -44
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +2 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +11 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +47 -47
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +50 -32
- package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -34
- package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -26
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
- package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
- package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +64 -57
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +73 -72
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +14 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +281 -254
- package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +49 -35
- package/src/sap/fe/core/messagebundle_ar.properties +13 -5
- package/src/sap/fe/core/messagebundle_bg.properties +13 -5
- package/src/sap/fe/core/messagebundle_ca.properties +13 -5
- package/src/sap/fe/core/messagebundle_cs.properties +13 -5
- package/src/sap/fe/core/messagebundle_cy.properties +14 -6
- package/src/sap/fe/core/messagebundle_da.properties +13 -5
- package/src/sap/fe/core/messagebundle_de.properties +15 -7
- package/src/sap/fe/core/messagebundle_el.properties +14 -6
- package/src/sap/fe/core/messagebundle_en.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
- package/src/sap/fe/core/messagebundle_es.properties +13 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
- package/src/sap/fe/core/messagebundle_et.properties +13 -5
- package/src/sap/fe/core/messagebundle_fi.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
- package/src/sap/fe/core/messagebundle_hi.properties +14 -6
- package/src/sap/fe/core/messagebundle_hr.properties +14 -6
- package/src/sap/fe/core/messagebundle_hu.properties +13 -5
- package/src/sap/fe/core/messagebundle_id.properties +13 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -25
- package/src/sap/fe/core/messagebundle_iw.properties +13 -5
- package/src/sap/fe/core/messagebundle_ja.properties +14 -6
- package/src/sap/fe/core/messagebundle_kk.properties +13 -5
- package/src/sap/fe/core/messagebundle_ko.properties +13 -5
- package/src/sap/fe/core/messagebundle_lt.properties +13 -5
- package/src/sap/fe/core/messagebundle_lv.properties +14 -6
- package/src/sap/fe/core/messagebundle_ms.properties +13 -5
- package/src/sap/fe/core/messagebundle_nl.properties +13 -5
- package/src/sap/fe/core/messagebundle_no.properties +13 -5
- package/src/sap/fe/core/messagebundle_pl.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
- package/src/sap/fe/core/messagebundle_ro.properties +13 -5
- package/src/sap/fe/core/messagebundle_ru.properties +13 -5
- package/src/sap/fe/core/messagebundle_sh.properties +13 -5
- package/src/sap/fe/core/messagebundle_sk.properties +13 -5
- package/src/sap/fe/core/messagebundle_sl.properties +17 -9
- package/src/sap/fe/core/messagebundle_sv.properties +14 -6
- package/src/sap/fe/core/messagebundle_th.properties +13 -5
- package/src/sap/fe/core/messagebundle_tr.properties +13 -5
- package/src/sap/fe/core/messagebundle_uk.properties +13 -5
- package/src/sap/fe/core/messagebundle_vi.properties +13 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +53 -44
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +72 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +20 -15
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +10 -9
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +148 -93
- package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { PropertyAnnotationValue } from "@sap-ux/vocabularies-types";
|
|
1
|
+
import type { PropertyAnnotationValue } from "@sap-ux/vocabularies-types";
|
|
2
2
|
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
3
|
+
import type { BindingToolkitExpression, CompiledBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
3
4
|
import {
|
|
4
5
|
and,
|
|
5
|
-
|
|
6
|
-
bindingExpression,
|
|
7
|
-
BindingExpression,
|
|
8
|
-
compileBinding,
|
|
6
|
+
compileExpression,
|
|
9
7
|
constant,
|
|
10
8
|
equal,
|
|
11
|
-
Expression,
|
|
12
9
|
formatResult,
|
|
10
|
+
getExpressionFromAnnotation,
|
|
13
11
|
greaterOrEqual,
|
|
14
12
|
greaterThan,
|
|
15
13
|
ifElse,
|
|
16
|
-
isBinding,
|
|
17
14
|
isConstant,
|
|
15
|
+
isPathInModelExpression,
|
|
18
16
|
length,
|
|
19
17
|
not,
|
|
20
18
|
notEqual,
|
|
21
|
-
or
|
|
22
|
-
|
|
19
|
+
or,
|
|
20
|
+
pathInModel
|
|
21
|
+
} from "sap/fe/core/helpers/BindingToolkit";
|
|
23
22
|
import { getTargetObjectPath, isPathDeletable, isPathInsertable, isPathUpdatable } from "sap/fe/core/templating/DataModelPathHelper";
|
|
24
|
-
import ConverterContext from "../../../ConverterContext";
|
|
23
|
+
import type ConverterContext from "../../../ConverterContext";
|
|
25
24
|
import { singletonPathVisitor, UI } from "../../../helpers/BindingHelper";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
25
|
+
import type { ViewPathConfiguration } from "../../../ManifestSettings";
|
|
26
|
+
import { CreationMode, TemplateType } from "../../../ManifestSettings";
|
|
27
|
+
import type { TableControlConfiguration } from "../Table";
|
|
28
28
|
|
|
29
29
|
enum AnnotationHiddenProperty {
|
|
30
30
|
CreateHidden = "CreateHidden",
|
|
@@ -33,30 +33,30 @@ enum AnnotationHiddenProperty {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export type StandardActionConfigType = {
|
|
36
|
-
isTemplated?:
|
|
37
|
-
visible:
|
|
38
|
-
enabled:
|
|
36
|
+
isTemplated?: CompiledBindingToolkitExpression;
|
|
37
|
+
visible: CompiledBindingToolkitExpression;
|
|
38
|
+
enabled: CompiledBindingToolkitExpression;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
type ExpressionRestrictionsType = {
|
|
42
|
-
expression:
|
|
43
|
-
navigationExpression:
|
|
42
|
+
expression: BindingToolkitExpression<boolean>;
|
|
43
|
+
navigationExpression: BindingToolkitExpression<boolean>;
|
|
44
44
|
};
|
|
45
45
|
type StandardActionsRestrictionsType = Record<string, ExpressionRestrictionsType>;
|
|
46
46
|
|
|
47
47
|
export type StandardActionsContext = {
|
|
48
48
|
collectionPath: string;
|
|
49
49
|
hiddenAnnotation: {
|
|
50
|
-
create:
|
|
51
|
-
"delete":
|
|
52
|
-
update:
|
|
50
|
+
create: BindingToolkitExpression<boolean>;
|
|
51
|
+
"delete": BindingToolkitExpression<boolean>;
|
|
52
|
+
update: BindingToolkitExpression<boolean>;
|
|
53
53
|
};
|
|
54
54
|
creationMode: CreationMode;
|
|
55
55
|
isDraftOrStickySupported: boolean;
|
|
56
56
|
isViewWithMultipleVisualizations: boolean;
|
|
57
57
|
newAction?: {
|
|
58
58
|
name?: string;
|
|
59
|
-
available?:
|
|
59
|
+
available?: BindingToolkitExpression<boolean>;
|
|
60
60
|
};
|
|
61
61
|
tableManifestConfiguration: TableControlConfiguration;
|
|
62
62
|
restrictions: StandardActionsRestrictionsType;
|
|
@@ -65,10 +65,10 @@ export type StandardActionsContext = {
|
|
|
65
65
|
/**
|
|
66
66
|
* Generates the context for the standard actions.
|
|
67
67
|
*
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
68
|
+
* @param converterContext
|
|
69
|
+
* @param creationMode
|
|
70
|
+
* @param tableManifestConfiguration
|
|
71
|
+
* @param viewConfiguration
|
|
72
72
|
* @returns The context for table actions
|
|
73
73
|
*/
|
|
74
74
|
export function generateStandardActionsContext(
|
|
@@ -98,8 +98,8 @@ export function generateStandardActionsContext(
|
|
|
98
98
|
/**
|
|
99
99
|
* Checks if draft is supported.
|
|
100
100
|
*
|
|
101
|
-
* @param
|
|
102
|
-
* @returns
|
|
101
|
+
* @param converterContext
|
|
102
|
+
* @returns `true` if it is supported
|
|
103
103
|
*/
|
|
104
104
|
export function isDraftSupported(converterContext: ConverterContext): boolean {
|
|
105
105
|
const currentEntitySet = converterContext.getEntitySet();
|
|
@@ -118,8 +118,8 @@ export function isDraftSupported(converterContext: ConverterContext): boolean {
|
|
|
118
118
|
/**
|
|
119
119
|
* Checks if sticky or draft is supported.
|
|
120
120
|
*
|
|
121
|
-
* @param
|
|
122
|
-
* @returns
|
|
121
|
+
* @param converterContext
|
|
122
|
+
* @returns `true` if it is supported
|
|
123
123
|
*/
|
|
124
124
|
export function isDraftOrStickySupported(converterContext: ConverterContext): boolean {
|
|
125
125
|
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
@@ -134,12 +134,12 @@ export function isDraftOrStickySupported(converterContext: ConverterContext): bo
|
|
|
134
134
|
/**
|
|
135
135
|
* Gets the configured newAction into annotation.
|
|
136
136
|
*
|
|
137
|
-
* @param
|
|
138
|
-
* @returns
|
|
137
|
+
* @param converterContext
|
|
138
|
+
* @returns The new action info
|
|
139
139
|
*/
|
|
140
140
|
export function getNewAction(converterContext: ConverterContext): any {
|
|
141
141
|
const currentEntitySet = converterContext.getEntitySet();
|
|
142
|
-
const newActionName:
|
|
142
|
+
const newActionName: CompiledBindingToolkitExpression = (
|
|
143
143
|
currentEntitySet?.annotations?.Common?.DraftRoot?.NewAction ||
|
|
144
144
|
currentEntitySet?.annotations?.Session?.StickySessionSupported?.NewAction
|
|
145
145
|
)?.toString();
|
|
@@ -148,7 +148,7 @@ export function getNewAction(converterContext: ConverterContext): any {
|
|
|
148
148
|
availableProperty = availableProperty !== undefined ? availableProperty : true;
|
|
149
149
|
return {
|
|
150
150
|
name: newActionName,
|
|
151
|
-
available:
|
|
151
|
+
available: getExpressionFromAnnotation(availableProperty)
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
return undefined;
|
|
@@ -157,16 +157,16 @@ export function getNewAction(converterContext: ConverterContext): any {
|
|
|
157
157
|
/**
|
|
158
158
|
* Gets the binding expression for the action visibility configured into annotation.
|
|
159
159
|
*
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
* @returns
|
|
160
|
+
* @param converterContext
|
|
161
|
+
* @param sAnnotationTerm
|
|
162
|
+
* @param bWithNavigationPath
|
|
163
|
+
* @returns The binding expression for the action visibility
|
|
164
164
|
*/
|
|
165
165
|
export function isActionAnnotatedHidden(
|
|
166
166
|
converterContext: ConverterContext,
|
|
167
167
|
sAnnotationTerm: string,
|
|
168
168
|
bWithNavigationPath = true
|
|
169
|
-
):
|
|
169
|
+
): BindingToolkitExpression<boolean> {
|
|
170
170
|
const currentEntitySet = converterContext.getEntitySet();
|
|
171
171
|
const dataModelObjectPath = converterContext.getDataModelObjectPath();
|
|
172
172
|
// Consider only the last level of navigation. The others are already considered in the element binding of the page.
|
|
@@ -178,7 +178,7 @@ export function isActionAnnotatedHidden(
|
|
|
178
178
|
((currentEntitySet?.annotations.UI as any)?.[sAnnotationTerm] as PropertyAnnotationValue<boolean>) || false;
|
|
179
179
|
|
|
180
180
|
return currentEntitySet
|
|
181
|
-
?
|
|
181
|
+
? getExpressionFromAnnotation(actionAnnotationValue, visitedNavigationPaths, undefined, (path: string) =>
|
|
182
182
|
singletonPathVisitor(path, converterContext.getConvertedTypes(), visitedNavigationPaths)
|
|
183
183
|
)
|
|
184
184
|
: constant(false);
|
|
@@ -187,8 +187,8 @@ export function isActionAnnotatedHidden(
|
|
|
187
187
|
/**
|
|
188
188
|
* Gets the annotated restrictions for the actions.
|
|
189
189
|
*
|
|
190
|
-
* @param
|
|
191
|
-
* @returns
|
|
190
|
+
* @param converterContext
|
|
191
|
+
* @returns The restriction information
|
|
192
192
|
*/
|
|
193
193
|
export function getRestrictions(converterContext: ConverterContext): StandardActionsRestrictionsType {
|
|
194
194
|
const dataModelObjectPath = converterContext.getDataModelObjectPath();
|
|
@@ -234,10 +234,10 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
|
|
|
234
234
|
/**
|
|
235
235
|
* Checks if templating for insert/update actions is mandatory.
|
|
236
236
|
*
|
|
237
|
-
* @param
|
|
238
|
-
* @param
|
|
239
|
-
* @param
|
|
240
|
-
* @returns
|
|
237
|
+
* @param standardActionsContext
|
|
238
|
+
* @param isDraftOrSticky
|
|
239
|
+
* @param isCreateAlwaysHidden
|
|
240
|
+
* @returns The
|
|
241
241
|
*/
|
|
242
242
|
export function getInsertUpdateActionsTemplating(
|
|
243
243
|
standardActionsContext: StandardActionsContext,
|
|
@@ -250,9 +250,9 @@ export function getInsertUpdateActionsTemplating(
|
|
|
250
250
|
/**
|
|
251
251
|
* Gets the binding expressions for the properties of the action Create.
|
|
252
252
|
*
|
|
253
|
-
* @param
|
|
254
|
-
* @param
|
|
255
|
-
* @returns
|
|
253
|
+
* @param converterContext
|
|
254
|
+
* @param standardActionsContext
|
|
255
|
+
* @returns The standard action info
|
|
256
256
|
*/
|
|
257
257
|
export function getStandardActionCreate(
|
|
258
258
|
converterContext: ConverterContext,
|
|
@@ -260,18 +260,18 @@ export function getStandardActionCreate(
|
|
|
260
260
|
): StandardActionConfigType {
|
|
261
261
|
const createVisibility = getCreateVisibility(converterContext, standardActionsContext);
|
|
262
262
|
return {
|
|
263
|
-
isTemplated:
|
|
264
|
-
visible:
|
|
265
|
-
enabled:
|
|
263
|
+
isTemplated: compileExpression(getCreateTemplating(standardActionsContext, createVisibility)),
|
|
264
|
+
visible: compileExpression(createVisibility),
|
|
265
|
+
enabled: compileExpression(getCreateEnablement(converterContext, standardActionsContext, createVisibility))
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
270
|
* Gets the binding expressions for the properties of the action Delete.
|
|
271
271
|
*
|
|
272
|
-
* @param
|
|
273
|
-
* @param
|
|
274
|
-
* @returns
|
|
272
|
+
* @param converterContext
|
|
273
|
+
* @param standardActionsContext
|
|
274
|
+
* @returns The binding expressions for the properties of the action Delete.
|
|
275
275
|
*/
|
|
276
276
|
export function getStandardActionDelete(
|
|
277
277
|
converterContext: ConverterContext,
|
|
@@ -280,9 +280,9 @@ export function getStandardActionDelete(
|
|
|
280
280
|
const deleteVisibility = getDeleteVisibility(converterContext, standardActionsContext);
|
|
281
281
|
|
|
282
282
|
return {
|
|
283
|
-
isTemplated:
|
|
284
|
-
visible:
|
|
285
|
-
enabled:
|
|
283
|
+
isTemplated: compileExpression(getDefaultTemplating(deleteVisibility)),
|
|
284
|
+
visible: compileExpression(deleteVisibility),
|
|
285
|
+
enabled: compileExpression(getDeleteEnablement(converterContext, standardActionsContext, deleteVisibility))
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
|
|
@@ -298,19 +298,19 @@ export function getCreationRow(
|
|
|
298
298
|
const creationRowVisibility = getCreateVisibility(converterContext, standardActionsContext, true);
|
|
299
299
|
|
|
300
300
|
return {
|
|
301
|
-
isTemplated:
|
|
302
|
-
visible:
|
|
303
|
-
enabled:
|
|
301
|
+
isTemplated: compileExpression(getCreateTemplating(standardActionsContext, creationRowVisibility, true)),
|
|
302
|
+
visible: compileExpression(creationRowVisibility),
|
|
303
|
+
enabled: compileExpression(getCreationRowEnablement(converterContext, standardActionsContext, creationRowVisibility))
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
/**
|
|
308
308
|
* Gets the binding expressions for the properties of the action Paste.
|
|
309
309
|
*
|
|
310
|
-
* @param
|
|
311
|
-
* @param
|
|
312
|
-
* @param
|
|
313
|
-
* @returns
|
|
310
|
+
* @param converterContext
|
|
311
|
+
* @param standardActionsContext
|
|
312
|
+
* @param isInsertUpdateActionsTemplated
|
|
313
|
+
* @returns The binding expressions for the properties of the action Paste.
|
|
314
314
|
*/
|
|
315
315
|
export function getStandardActionPaste(
|
|
316
316
|
converterContext: ConverterContext,
|
|
@@ -321,17 +321,17 @@ export function getStandardActionPaste(
|
|
|
321
321
|
const createEnablement = getCreateEnablement(converterContext, standardActionsContext, createVisibility);
|
|
322
322
|
const pasteVisibility = getPasteVisibility(converterContext, standardActionsContext, createVisibility, isInsertUpdateActionsTemplated);
|
|
323
323
|
return {
|
|
324
|
-
visible:
|
|
325
|
-
enabled:
|
|
324
|
+
visible: compileExpression(pasteVisibility),
|
|
325
|
+
enabled: compileExpression(getPasteEnablement(pasteVisibility, createEnablement))
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/**
|
|
330
330
|
* Gets the binding expressions for the properties of the action MassEdit.
|
|
331
331
|
*
|
|
332
|
-
* @param
|
|
333
|
-
* @param
|
|
334
|
-
* @returns
|
|
332
|
+
* @param converterContext
|
|
333
|
+
* @param standardActionsContext
|
|
334
|
+
* @returns The binding expressions for the properties of the action MassEdit.
|
|
335
335
|
*/
|
|
336
336
|
export function getStandardActionMassEdit(
|
|
337
337
|
converterContext: ConverterContext,
|
|
@@ -340,25 +340,25 @@ export function getStandardActionMassEdit(
|
|
|
340
340
|
const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext);
|
|
341
341
|
|
|
342
342
|
return {
|
|
343
|
-
isTemplated:
|
|
344
|
-
visible:
|
|
345
|
-
enabled:
|
|
343
|
+
isTemplated: compileExpression(getDefaultTemplating(massEditVisibility)),
|
|
344
|
+
visible: compileExpression(massEditVisibility),
|
|
345
|
+
enabled: compileExpression(getMassEditEnablement(converterContext, standardActionsContext, massEditVisibility))
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/**
|
|
350
350
|
* Gets the binding expression for the templating of the action Create.
|
|
351
351
|
*
|
|
352
|
-
* @param
|
|
353
|
-
* @param
|
|
354
|
-
* @param
|
|
355
|
-
* @returns
|
|
352
|
+
* @param standardActionsContext
|
|
353
|
+
* @param createVisibility
|
|
354
|
+
* @param isForCreationRow
|
|
355
|
+
* @returns The create binding expression
|
|
356
356
|
*/
|
|
357
357
|
export function getCreateTemplating(
|
|
358
358
|
standardActionsContext: StandardActionsContext,
|
|
359
|
-
createVisibility:
|
|
359
|
+
createVisibility: BindingToolkitExpression<boolean>,
|
|
360
360
|
isForCreationRow = false
|
|
361
|
-
):
|
|
361
|
+
): BindingToolkitExpression<boolean> {
|
|
362
362
|
//Templating of Create Button is not done:
|
|
363
363
|
// - If Button is never visible(covered the External create button, new Action)
|
|
364
364
|
// - or CreationMode is on CreationRow for Create Button
|
|
@@ -377,26 +377,26 @@ export function getCreateTemplating(
|
|
|
377
377
|
/**
|
|
378
378
|
* Gets the binding expression for the templating of the non-Create actions.
|
|
379
379
|
*
|
|
380
|
-
* @param
|
|
381
|
-
* @returns
|
|
380
|
+
* @param actionVisibility
|
|
381
|
+
* @returns The binding expression for the templating of the non-Create actions.
|
|
382
382
|
*/
|
|
383
|
-
export function getDefaultTemplating(actionVisibility:
|
|
383
|
+
export function getDefaultTemplating(actionVisibility: BindingToolkitExpression<boolean>): BindingToolkitExpression<boolean> {
|
|
384
384
|
return or(not(isConstant(actionVisibility)), actionVisibility);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
/**
|
|
388
388
|
* Gets the binding expression for the property visible of the action Create.
|
|
389
389
|
*
|
|
390
|
-
* @param
|
|
391
|
-
* @param
|
|
392
|
-
* @param
|
|
393
|
-
* @returns
|
|
390
|
+
* @param converterContext
|
|
391
|
+
* @param standardActionsContext
|
|
392
|
+
* @param isForCreationRow
|
|
393
|
+
* @returns The binding expression for the property visible of the action Create.
|
|
394
394
|
*/
|
|
395
395
|
export function getCreateVisibility(
|
|
396
396
|
converterContext: ConverterContext,
|
|
397
397
|
standardActionsContext: StandardActionsContext,
|
|
398
398
|
isForCreationRow = false
|
|
399
|
-
):
|
|
399
|
+
): BindingToolkitExpression<boolean> {
|
|
400
400
|
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
401
401
|
const isCreateHidden = isForCreationRow
|
|
402
402
|
? isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.CreateHidden, false)
|
|
@@ -438,7 +438,7 @@ export function getCreateVisibility(
|
|
|
438
438
|
false,
|
|
439
439
|
ifElse(
|
|
440
440
|
converterContext.getTemplateType() === TemplateType.ListReport,
|
|
441
|
-
or(not(
|
|
441
|
+
or(not(isPathInModelExpression(isCreateHidden)), not(isCreateHidden)),
|
|
442
442
|
and(not(isCreateHidden), UI.IsEditable)
|
|
443
443
|
)
|
|
444
444
|
)
|
|
@@ -448,14 +448,14 @@ export function getCreateVisibility(
|
|
|
448
448
|
/**
|
|
449
449
|
* Gets the binding expression for the property visible of the action Delete.
|
|
450
450
|
*
|
|
451
|
-
* @param
|
|
452
|
-
* @param
|
|
453
|
-
* @returns
|
|
451
|
+
* @param converterContext
|
|
452
|
+
* @param standardActionsContext
|
|
453
|
+
* @returns The binding expression for the property visible of the action Delete.
|
|
454
454
|
*/
|
|
455
455
|
export function getDeleteVisibility(
|
|
456
456
|
converterContext: ConverterContext,
|
|
457
457
|
standardActionsContext: StandardActionsContext
|
|
458
|
-
):
|
|
458
|
+
): BindingToolkitExpression<boolean> {
|
|
459
459
|
const isDeleteHidden = standardActionsContext.hiddenAnnotation.delete;
|
|
460
460
|
const pathDeletableExpression = standardActionsContext.restrictions.isDeletable.expression;
|
|
461
461
|
|
|
@@ -484,7 +484,7 @@ export function getDeleteVisibility(
|
|
|
484
484
|
ifElse(
|
|
485
485
|
converterContext.getTemplateType() !== TemplateType.ListReport,
|
|
486
486
|
and(not(isDeleteHidden), UI.IsEditable),
|
|
487
|
-
not(and(
|
|
487
|
+
not(and(isPathInModelExpression(isDeleteHidden), isDeleteHidden))
|
|
488
488
|
)
|
|
489
489
|
)
|
|
490
490
|
)
|
|
@@ -494,18 +494,18 @@ export function getDeleteVisibility(
|
|
|
494
494
|
/**
|
|
495
495
|
* Gets the binding expression for the property visible of the action Paste.
|
|
496
496
|
*
|
|
497
|
-
* @param
|
|
498
|
-
* @param
|
|
499
|
-
* @param
|
|
500
|
-
* @param
|
|
501
|
-
* @returns
|
|
497
|
+
* @param converterContext
|
|
498
|
+
* @param standardActionsContext
|
|
499
|
+
* @param createVisibility
|
|
500
|
+
* @param isInsertUpdateActionsTemplated
|
|
501
|
+
* @returns The binding expression for the property visible of the action Paste.
|
|
502
502
|
*/
|
|
503
503
|
export function getPasteVisibility(
|
|
504
504
|
converterContext: ConverterContext,
|
|
505
505
|
standardActionsContext: StandardActionsContext,
|
|
506
|
-
createVisibility:
|
|
506
|
+
createVisibility: BindingToolkitExpression<boolean>,
|
|
507
507
|
isInsertUpdateActionsTemplated: boolean
|
|
508
|
-
):
|
|
508
|
+
): BindingToolkitExpression<boolean> {
|
|
509
509
|
// If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
|
|
510
510
|
// Then button will be visible according to insertable restrictions and create visibility
|
|
511
511
|
// Otherwise it's not visible
|
|
@@ -521,14 +521,14 @@ export function getPasteVisibility(
|
|
|
521
521
|
/**
|
|
522
522
|
* Gets the binding expression for the property visible of the action MassEdit.
|
|
523
523
|
*
|
|
524
|
-
* @param
|
|
525
|
-
* @param
|
|
526
|
-
* @returns
|
|
524
|
+
* @param converterContext
|
|
525
|
+
* @param standardActionsContext
|
|
526
|
+
* @returns The binding expression for the property visible of the action MassEdit
|
|
527
527
|
*/
|
|
528
528
|
export function getMassEditVisibility(
|
|
529
529
|
converterContext: ConverterContext,
|
|
530
530
|
standardActionsContext: StandardActionsContext
|
|
531
|
-
):
|
|
531
|
+
): BindingToolkitExpression<boolean> {
|
|
532
532
|
const isUpdateHidden = standardActionsContext.hiddenAnnotation.update,
|
|
533
533
|
pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression,
|
|
534
534
|
bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false;
|
|
@@ -554,16 +554,16 @@ export function getMassEditVisibility(
|
|
|
554
554
|
/**
|
|
555
555
|
* Gets the binding expression for the property enabled of the creationRow.
|
|
556
556
|
*
|
|
557
|
-
* @param
|
|
558
|
-
* @param
|
|
559
|
-
* @param
|
|
560
|
-
* @returns
|
|
557
|
+
* @param converterContext
|
|
558
|
+
* @param standardActionsContext
|
|
559
|
+
* @param creationRowVisibility
|
|
560
|
+
* @returns The binding expression for the property enabled of the creationRow.
|
|
561
561
|
*/
|
|
562
562
|
export function getCreationRowEnablement(
|
|
563
563
|
converterContext: ConverterContext,
|
|
564
564
|
standardActionsContext: StandardActionsContext,
|
|
565
|
-
creationRowVisibility:
|
|
566
|
-
):
|
|
565
|
+
creationRowVisibility: BindingToolkitExpression<boolean>
|
|
566
|
+
): BindingToolkitExpression<boolean> {
|
|
567
567
|
const restrictionsInsertable = isPathInsertable(converterContext.getDataModelObjectPath(), {
|
|
568
568
|
ignoreTargetCollection: true,
|
|
569
569
|
authorizeUnresolvable: true,
|
|
@@ -594,7 +594,7 @@ export function getCreationRowEnablement(
|
|
|
594
594
|
isInsertable,
|
|
595
595
|
or(
|
|
596
596
|
!standardActionsContext.tableManifestConfiguration.disableAddRowButtonForEmptyData,
|
|
597
|
-
formatResult([
|
|
597
|
+
formatResult([pathInModel("creationRowFieldValidity", "internal")], tableFormatters.validateCreationRowFields)
|
|
598
598
|
)
|
|
599
599
|
);
|
|
600
600
|
}
|
|
@@ -602,16 +602,16 @@ export function getCreationRowEnablement(
|
|
|
602
602
|
/**
|
|
603
603
|
* Gets the binding expression for the property enabled of the action Create.
|
|
604
604
|
*
|
|
605
|
-
* @param
|
|
606
|
-
* @param
|
|
607
|
-
* @param
|
|
608
|
-
* @returns
|
|
605
|
+
* @param converterContext
|
|
606
|
+
* @param standardActionsContext
|
|
607
|
+
* @param createVisibility
|
|
608
|
+
* @returns The binding expression for the property enabled of the action Create.
|
|
609
609
|
*/
|
|
610
610
|
export function getCreateEnablement(
|
|
611
611
|
converterContext: ConverterContext,
|
|
612
612
|
standardActionsContext: StandardActionsContext,
|
|
613
|
-
createVisibility:
|
|
614
|
-
):
|
|
613
|
+
createVisibility: BindingToolkitExpression<boolean>
|
|
614
|
+
): BindingToolkitExpression<boolean> {
|
|
615
615
|
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
616
616
|
const CollectionType = converterContext.resolveAbsolutePath<any>(standardActionsContext.collectionPath).target?._type;
|
|
617
617
|
return and(
|
|
@@ -626,22 +626,22 @@ export function getCreateEnablement(
|
|
|
626
626
|
/**
|
|
627
627
|
* Gets the binding expression for the property enabled of the action Delete.
|
|
628
628
|
*
|
|
629
|
-
* @param
|
|
630
|
-
* @param
|
|
631
|
-
* @param
|
|
632
|
-
* @returns
|
|
629
|
+
* @param converterContext
|
|
630
|
+
* @param standardActionsContext
|
|
631
|
+
* @param deleteVisibility
|
|
632
|
+
* @returns The binding expression for the property enabled of the action Delete.
|
|
633
633
|
*/
|
|
634
634
|
export function getDeleteEnablement(
|
|
635
635
|
converterContext: ConverterContext,
|
|
636
636
|
standardActionsContext: StandardActionsContext,
|
|
637
|
-
deleteVisibility:
|
|
638
|
-
):
|
|
637
|
+
deleteVisibility: BindingToolkitExpression<boolean>
|
|
638
|
+
): BindingToolkitExpression<boolean> {
|
|
639
639
|
const isDeletable = standardActionsContext.restrictions.isDeletable.expression;
|
|
640
640
|
const isOnlyDynamicOnCurrentEntity =
|
|
641
641
|
!isConstant(isDeletable) && standardActionsContext.restrictions.isDeletable.navigationExpression._type === "Unresolvable";
|
|
642
|
-
const numberOfSelectedContexts =
|
|
643
|
-
const numberOfDeletableContexts =
|
|
644
|
-
const numberOfUnSavedContexts =
|
|
642
|
+
const numberOfSelectedContexts = pathInModel("numberOfSelectedContexts", "internal");
|
|
643
|
+
const numberOfDeletableContexts = pathInModel("deletableContexts", "internal");
|
|
644
|
+
const numberOfUnSavedContexts = pathInModel("unSavedContexts", "internal");
|
|
645
645
|
|
|
646
646
|
return and(
|
|
647
647
|
deleteVisibility,
|
|
@@ -652,7 +652,7 @@ export function getDeleteEnablement(
|
|
|
652
652
|
and(notEqual(numberOfDeletableContexts, undefined), greaterThan(length(numberOfDeletableContexts), 0)),
|
|
653
653
|
and(notEqual(numberOfUnSavedContexts, undefined), greaterThan(length(numberOfUnSavedContexts), 0))
|
|
654
654
|
),
|
|
655
|
-
|
|
655
|
+
pathInModel("deleteEnabled", "internal")
|
|
656
656
|
),
|
|
657
657
|
and(notEqual(numberOfSelectedContexts, 0), isDeletable)
|
|
658
658
|
)
|
|
@@ -662,33 +662,36 @@ export function getDeleteEnablement(
|
|
|
662
662
|
/**
|
|
663
663
|
* Gets the binding expression for the property enabled of the action Paste.
|
|
664
664
|
*
|
|
665
|
-
* @param
|
|
666
|
-
* @param
|
|
667
|
-
* @returns
|
|
665
|
+
* @param pasteVisibility
|
|
666
|
+
* @param createEnablement
|
|
667
|
+
* @returns The binding expression for the property enabled of the action Paste.
|
|
668
668
|
*/
|
|
669
|
-
export function getPasteEnablement(
|
|
669
|
+
export function getPasteEnablement(
|
|
670
|
+
pasteVisibility: BindingToolkitExpression<boolean>,
|
|
671
|
+
createEnablement: BindingToolkitExpression<boolean>
|
|
672
|
+
): BindingToolkitExpression<boolean> {
|
|
670
673
|
return and(pasteVisibility, createEnablement);
|
|
671
674
|
}
|
|
672
675
|
|
|
673
676
|
/**
|
|
674
677
|
* Gets the binding expression for the property enabled of the action MassEdit.
|
|
675
678
|
*
|
|
676
|
-
* @param
|
|
677
|
-
* @param
|
|
678
|
-
* @param
|
|
679
|
-
* @returns
|
|
679
|
+
* @param converterContext
|
|
680
|
+
* @param standardActionsContext
|
|
681
|
+
* @param massEditVisibility
|
|
682
|
+
* @returns The binding expression for the property enabled of the action MassEdit.
|
|
680
683
|
*/
|
|
681
684
|
export function getMassEditEnablement(
|
|
682
685
|
converterContext: ConverterContext,
|
|
683
686
|
standardActionsContext: StandardActionsContext,
|
|
684
|
-
massEditVisibility:
|
|
685
|
-
):
|
|
687
|
+
massEditVisibility: BindingToolkitExpression<boolean>
|
|
688
|
+
): BindingToolkitExpression<boolean> {
|
|
686
689
|
const pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression;
|
|
687
690
|
const isOnlyDynamicOnCurrentEntity: any =
|
|
688
691
|
!isConstant(pathUpdatableExpression) &&
|
|
689
692
|
standardActionsContext.restrictions.isUpdatable.navigationExpression._type === "Unresolvable";
|
|
690
|
-
const numberOfSelectedContexts = greaterOrEqual(
|
|
691
|
-
const numberOfUpdatableContexts = greaterOrEqual(length(
|
|
693
|
+
const numberOfSelectedContexts = greaterOrEqual(pathInModel("numberOfSelectedContexts", "internal"), 1);
|
|
694
|
+
const numberOfUpdatableContexts = greaterOrEqual(length(pathInModel("updatableContexts", "internal")), 1);
|
|
692
695
|
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
693
696
|
const bDisplayMode = isInDisplayMode(converterContext);
|
|
694
697
|
|
|
@@ -708,9 +711,9 @@ export function getMassEditEnablement(
|
|
|
708
711
|
/**
|
|
709
712
|
* Tells if the table in template is in display mode.
|
|
710
713
|
*
|
|
711
|
-
* @param
|
|
712
|
-
* @param
|
|
713
|
-
* @returns
|
|
714
|
+
* @param converterContext
|
|
715
|
+
* @param viewConfiguration
|
|
716
|
+
* @returns `true` if the table is in display mode
|
|
714
717
|
*/
|
|
715
718
|
export function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
|
|
716
719
|
const templateType = converterContext.getTemplateType();
|