@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,12 +1,29 @@
|
|
|
1
1
|
import Log from "sap/base/Log";
|
|
2
2
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BindingToolkitExpression,
|
|
5
|
+
CompiledBindingToolkitExpression,
|
|
6
|
+
compileExpression,
|
|
7
|
+
constant,
|
|
8
|
+
ifElse,
|
|
9
|
+
not,
|
|
10
|
+
or,
|
|
11
|
+
pathInModel
|
|
12
|
+
} from "sap/fe/core/helpers/BindingToolkit";
|
|
4
13
|
import FELibrary from "sap/fe/core/library";
|
|
5
|
-
import PageController from "sap/fe/core/PageController";
|
|
6
|
-
import { DataModelObjectPath
|
|
7
|
-
import {
|
|
14
|
+
import type PageController from "sap/fe/core/PageController";
|
|
15
|
+
import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
16
|
+
import { enhanceDataModelPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
17
|
+
import {
|
|
18
|
+
getAssociatedUnitProperty,
|
|
19
|
+
getAssociatedUnitPropertyPath,
|
|
20
|
+
hasCurrency,
|
|
21
|
+
hasUnit,
|
|
22
|
+
hasValueHelp,
|
|
23
|
+
hasValueHelpWithFixedValues
|
|
24
|
+
} from "sap/fe/core/templating/PropertyHelper";
|
|
8
25
|
import { getTextBinding, setEditStyleProperties } from "sap/fe/macros/field/FieldTemplating";
|
|
9
|
-
import { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
|
|
26
|
+
import type { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
|
|
10
27
|
import Button from "sap/m/Button";
|
|
11
28
|
import Dialog from "sap/m/Dialog";
|
|
12
29
|
import MessageToast from "sap/m/MessageToast";
|
|
@@ -15,16 +32,17 @@ import Fragment from "sap/ui/core/Fragment";
|
|
|
15
32
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
16
33
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
17
34
|
import EditMode from "sap/ui/mdc/enum/EditMode";
|
|
18
|
-
import Table from "sap/ui/mdc/Table";
|
|
35
|
+
import type Table from "sap/ui/mdc/Table";
|
|
19
36
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
20
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
21
|
-
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
22
|
-
import { CoreEx } from "types/extension_types";
|
|
23
|
-
import
|
|
37
|
+
import type Context from "sap/ui/model/odata/v4/Context";
|
|
38
|
+
import type ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
39
|
+
import type { CoreEx } from "types/extension_types";
|
|
40
|
+
import type { AnyType } from "../controls/Any";
|
|
41
|
+
import Any from "../controls/Any";
|
|
24
42
|
import { convertMetaModelContext, getInvolvedDataModelObjects } from "../converters/MetaModelConverter";
|
|
25
43
|
import { isReadOnlyExpression } from "../templating/FieldControlHelper";
|
|
26
44
|
import { getEditMode, getRequiredExpression, isCollectionField } from "../templating/UIFormatters";
|
|
27
|
-
import { InternalModelContext } from "./ModelHelper";
|
|
45
|
+
import type { InternalModelContext } from "./ModelHelper";
|
|
28
46
|
|
|
29
47
|
/* This class contains helpers to be used for mass edit functionality */
|
|
30
48
|
type TextArrangementInfo = {
|
|
@@ -47,9 +65,9 @@ const MassEditHelper = {
|
|
|
47
65
|
* Initializes the value at final or deepest level path with a blank array.
|
|
48
66
|
* Return an empty array pointing to the final or deepest level path.
|
|
49
67
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @returns
|
|
68
|
+
* @param sPath Property path
|
|
69
|
+
* @param aValues Array instance where the default data needs to be added
|
|
70
|
+
* @returns The final path
|
|
53
71
|
*/
|
|
54
72
|
initLastLevelOfPropertyPath: function (sPath: string, aValues: any /*, transCtx: Context */) {
|
|
55
73
|
let aFinalPath: any;
|
|
@@ -63,7 +81,7 @@ const MassEditHelper = {
|
|
|
63
81
|
sFullPath = sFullPath + sPropertyPath;
|
|
64
82
|
index++;
|
|
65
83
|
} else if (!aFinalPath[sPropertyPath]) {
|
|
66
|
-
sFullPath = sFullPath
|
|
84
|
+
sFullPath = `${sFullPath}/${sPropertyPath}`;
|
|
67
85
|
if (sFullPath !== sPath) {
|
|
68
86
|
aFinalPath[sPropertyPath] = {};
|
|
69
87
|
aFinalPath = aFinalPath[sPropertyPath];
|
|
@@ -78,10 +96,10 @@ const MassEditHelper = {
|
|
|
78
96
|
/**
|
|
79
97
|
* Method to get unique values for given array values.
|
|
80
98
|
*
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @returns
|
|
99
|
+
* @param sValue Property value
|
|
100
|
+
* @param index Index of the property value
|
|
101
|
+
* @param self Instance of the array
|
|
102
|
+
* @returns The unique value
|
|
85
103
|
*/
|
|
86
104
|
getUniqueValues: function (sValue: string, index: number, self: any[]) {
|
|
87
105
|
if (sValue != undefined && sValue != null) {
|
|
@@ -93,9 +111,9 @@ const MassEditHelper = {
|
|
|
93
111
|
* Gets the property value for a multi-level path (for example: _Materials/Material_Details gets the value of Material_Details under _Materials Object).
|
|
94
112
|
* Returns the propertyValue, which can be of any type (string, number, etc..).
|
|
95
113
|
*
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
98
|
-
* @returns
|
|
114
|
+
* @param sDataPropertyPath Property path
|
|
115
|
+
* @param oValues Object of property values
|
|
116
|
+
* @returns The property value
|
|
99
117
|
*/
|
|
100
118
|
getValueForMultiLevelPath: function (sDataPropertyPath: string, oValues: any) {
|
|
101
119
|
if (sDataPropertyPath && sDataPropertyPath.indexOf("/") > 0) {
|
|
@@ -115,9 +133,9 @@ const MassEditHelper = {
|
|
|
115
133
|
* => If propertyValue for all selected contexts is empty, then < Leave Blank > is preselected.
|
|
116
134
|
*
|
|
117
135
|
*
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @returns
|
|
136
|
+
* @param aContexts Contexts for mass edit
|
|
137
|
+
* @param sDataPropertyPath Data property path
|
|
138
|
+
* @returns The key path
|
|
121
139
|
*/
|
|
122
140
|
getDefaultSelectionPathComboBox: function (aContexts: any[], sDataPropertyPath: string) {
|
|
123
141
|
if (sDataPropertyPath && aContexts.length > 0) {
|
|
@@ -133,11 +151,11 @@ const MassEditHelper = {
|
|
|
133
151
|
});
|
|
134
152
|
const aUniquePropertyValues = aPropertyValues.filter(MassEditHelper.getUniqueValues);
|
|
135
153
|
if (aUniquePropertyValues.length > 1) {
|
|
136
|
-
return
|
|
154
|
+
return `Default/${sDataPropertyPath}`;
|
|
137
155
|
} else if (aUniquePropertyValues.length === 0) {
|
|
138
|
-
return
|
|
156
|
+
return `Empty/${sDataPropertyPath}`;
|
|
139
157
|
} else if (aUniquePropertyValues.length === 1) {
|
|
140
|
-
return sDataPropertyPath
|
|
158
|
+
return `${sDataPropertyPath}/${aUniquePropertyValues[0]}`;
|
|
141
159
|
}
|
|
142
160
|
}
|
|
143
161
|
},
|
|
@@ -145,9 +163,9 @@ const MassEditHelper = {
|
|
|
145
163
|
/**
|
|
146
164
|
* Checks hidden annotation value [both static and path based] for table's selected context.
|
|
147
165
|
*
|
|
148
|
-
* @param
|
|
149
|
-
* @param
|
|
150
|
-
* @returns
|
|
166
|
+
* @param hiddenValue Hidden annotation value / path for field
|
|
167
|
+
* @param aContexts Contexts for mass edit
|
|
168
|
+
* @returns The hidden annotation value
|
|
151
169
|
*/
|
|
152
170
|
getHiddenValueForContexts: function (hiddenValue: any, aContexts: any[]) {
|
|
153
171
|
if (hiddenValue && hiddenValue.$Path) {
|
|
@@ -187,10 +205,10 @@ const MassEditHelper = {
|
|
|
187
205
|
/**
|
|
188
206
|
* Get text path for the mass edit field.
|
|
189
207
|
*
|
|
190
|
-
* @param
|
|
191
|
-
* @param
|
|
192
|
-
* @param
|
|
193
|
-
* @returns
|
|
208
|
+
* @param property Property path
|
|
209
|
+
* @param textBinding Text Binding Info
|
|
210
|
+
* @param displayMode Display mode
|
|
211
|
+
* @returns Text Property Path if it exists
|
|
194
212
|
*/
|
|
195
213
|
getTextPath: function (property: string, textBinding: any, displayMode: string): string | undefined {
|
|
196
214
|
let descriptionPath;
|
|
@@ -211,16 +229,16 @@ const MassEditHelper = {
|
|
|
211
229
|
/**
|
|
212
230
|
* Initializes a JSON Model for properties of dialog fields [label, visiblity, dataproperty, etc.].
|
|
213
231
|
*
|
|
214
|
-
* @param
|
|
215
|
-
* @param
|
|
216
|
-
* @param
|
|
217
|
-
* @returns
|
|
232
|
+
* @param oTable Instance of Table
|
|
233
|
+
* @param aContexts Contexts for mass edit
|
|
234
|
+
* @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
|
|
235
|
+
* @returns The model
|
|
218
236
|
*/
|
|
219
237
|
prepareDataForDialog: function (oTable: Table, aContexts: any[], aDataArray: any[]) {
|
|
220
238
|
const oMetaModel = oTable && (oTable.getModel().getMetaModel() as any),
|
|
221
239
|
sCurrentEntitySetName = oTable.data("metaPath"),
|
|
222
240
|
aTableFields = MassEditHelper.getTableFields(oTable),
|
|
223
|
-
oEntityTypeContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
241
|
+
oEntityTypeContext = oMetaModel.getContext(`${sCurrentEntitySetName}/@`),
|
|
224
242
|
oEntitySetContext = oMetaModel.getContext(sCurrentEntitySetName),
|
|
225
243
|
oDataModelObjectPath = getInvolvedDataModelObjects(oEntityTypeContext);
|
|
226
244
|
|
|
@@ -235,28 +253,12 @@ const MassEditHelper = {
|
|
|
235
253
|
aTableFields.forEach(function (oColumnInfo: any) {
|
|
236
254
|
const sDataPropertyPath = oColumnInfo.dataProperty;
|
|
237
255
|
if (sDataPropertyPath) {
|
|
238
|
-
let oPropertyInfo = sDataPropertyPath && oMetaModel.getObject(sCurrentEntitySetName
|
|
239
|
-
bValueHelpEnabled =
|
|
240
|
-
sDataPropertyPath &&
|
|
241
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sDataPropertyPath + "@") &&
|
|
242
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sDataPropertyPath + "@")[
|
|
243
|
-
"@com.sap.vocabularies.Common.v1.ValueList"
|
|
244
|
-
];
|
|
245
|
-
sUnitPropertyPath =
|
|
246
|
-
(oPropertyInfo && oPropertyInfo["@Org.OData.Measures.V1.Unit"] && oPropertyInfo["@Org.OData.Measures.V1.Unit"].$Path) ||
|
|
247
|
-
(oPropertyInfo &&
|
|
248
|
-
oPropertyInfo["@Org.OData.Measures.V1.ISOCurrency"] &&
|
|
249
|
-
oPropertyInfo["@Org.OData.Measures.V1.ISOCurrency"].$Path);
|
|
256
|
+
let oPropertyInfo = sDataPropertyPath && oMetaModel.getObject(`${sCurrentEntitySetName}/${sDataPropertyPath}@`);
|
|
250
257
|
sLabelText =
|
|
251
258
|
oColumnInfo.label ||
|
|
252
259
|
(oPropertyInfo && oPropertyInfo["@com.sap.vocabularies.Common.v1.Label"]) ||
|
|
253
260
|
oColumnInfo.dataProperty;
|
|
254
|
-
|
|
255
|
-
sUnitPropertyPath &&
|
|
256
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sUnitPropertyPath + "@") &&
|
|
257
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sUnitPropertyPath + "@")[
|
|
258
|
-
"@com.sap.vocabularies.Common.v1.ValueList"
|
|
259
|
-
];
|
|
261
|
+
|
|
260
262
|
if (oDataModelObjectPath) {
|
|
261
263
|
oDataModelObjectPath.targetObject = oDataModelObjectPath.targetEntityType.entityProperties.filter(function (
|
|
262
264
|
oProperty: any
|
|
@@ -268,7 +270,7 @@ const MassEditHelper = {
|
|
|
268
270
|
oTextBinding = getTextBinding(oDataModelObjectPath, {}, true) || {};
|
|
269
271
|
const oFieldContext = oMetaModel.getContext(oColumnInfo.annotationPath),
|
|
270
272
|
oDataFieldConverted = convertMetaModelContext(oFieldContext),
|
|
271
|
-
oPropertyContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
273
|
+
oPropertyContext = oMetaModel.getContext(`${sCurrentEntitySetName}/${sDataPropertyPath}@`),
|
|
272
274
|
oInterface = oPropertyContext && oPropertyContext.getInterface();
|
|
273
275
|
|
|
274
276
|
let oDataModelPath = getInvolvedDataModelObjects(oFieldContext, oEntitySetContext);
|
|
@@ -287,7 +289,7 @@ const MassEditHelper = {
|
|
|
287
289
|
return oInterface.getModel();
|
|
288
290
|
},
|
|
289
291
|
getPath: function () {
|
|
290
|
-
return sCurrentEntitySetName
|
|
292
|
+
return `${sCurrentEntitySetName}/${sDataPropertyPath}`;
|
|
291
293
|
}
|
|
292
294
|
};
|
|
293
295
|
oPropertyInfo =
|
|
@@ -305,9 +307,16 @@ const MassEditHelper = {
|
|
|
305
307
|
return;
|
|
306
308
|
}
|
|
307
309
|
|
|
310
|
+
// ValueHelp properties
|
|
311
|
+
bValueHelpEnabled = hasValueHelp(oPropertyInfo);
|
|
312
|
+
sUnitPropertyPath =
|
|
313
|
+
((hasCurrency(oPropertyInfo) || hasUnit(oPropertyInfo)) && getAssociatedUnitPropertyPath(oPropertyInfo)) || "";
|
|
314
|
+
const unitPropertyInfo = sUnitPropertyPath && getAssociatedUnitProperty(oPropertyInfo);
|
|
315
|
+
bValueHelpEnabledForUnit = unitPropertyInfo && hasValueHelp(unitPropertyInfo);
|
|
316
|
+
|
|
308
317
|
// EditMode and InputType
|
|
309
318
|
const propertyForFieldControl = oPropertyInfo && oPropertyInfo.Value ? oPropertyInfo.Value : oPropertyInfo;
|
|
310
|
-
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, true);
|
|
319
|
+
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, constant(true));
|
|
311
320
|
const editModeValues = Object.keys(EditMode);
|
|
312
321
|
const editModeIsStatic = !!expBinding && editModeValues.includes(expBinding as EditMode);
|
|
313
322
|
const editable = !!expBinding && ((editModeIsStatic && expBinding === EditMode.Editable) || !editModeIsStatic);
|
|
@@ -325,10 +334,11 @@ const MassEditHelper = {
|
|
|
325
334
|
"label": sLabelText,
|
|
326
335
|
"dataProperty": sDataPropertyPath,
|
|
327
336
|
"isValueHelpEnabled": bValueHelpEnabled ? bValueHelpEnabled : false,
|
|
328
|
-
"unitProperty": sUnitPropertyPath ? sUnitPropertyPath : false,
|
|
329
|
-
"isValueHelpEnabledForUnit":
|
|
330
|
-
|
|
331
|
-
"
|
|
337
|
+
"unitProperty": sUnitPropertyPath && !sDataPropertyPath.includes("/") ? sUnitPropertyPath : false,
|
|
338
|
+
"isValueHelpEnabledForUnit":
|
|
339
|
+
bValueHelpEnabledForUnit && !sUnitPropertyPath.includes("/") ? bValueHelpEnabledForUnit : false,
|
|
340
|
+
"propertyPathForValueHelp": `${sCurrentEntitySetName}/${sDataPropertyPath}`,
|
|
341
|
+
"propertyPathForValueHelpUnit": sUnitPropertyPath && `${sCurrentEntitySetName}/${sUnitPropertyPath}`,
|
|
332
342
|
"isFieldRequired": getRequiredExpression(oPropertyInfo, oDataFieldConverted, true),
|
|
333
343
|
"defaultSelectionPath": sDataPropertyPath
|
|
334
344
|
? MassEditHelper.getDefaultSelectionPathComboBox(aContexts, sDataPropertyPath)
|
|
@@ -385,53 +395,55 @@ const MassEditHelper = {
|
|
|
385
395
|
? oResourceBundle.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT")
|
|
386
396
|
: oResourceBundle.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),
|
|
387
397
|
"useValueHelpValue": "< Use Value Help >",
|
|
388
|
-
"cancelButtonText": oResourceBundle.getText("C_MASS_EDIT_CANCEL_BUTTON_TEXT")
|
|
398
|
+
"cancelButtonText": oResourceBundle.getText("C_MASS_EDIT_CANCEL_BUTTON_TEXT"),
|
|
399
|
+
"noFields": oResourceBundle.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),
|
|
400
|
+
"okButtonText": oResourceBundle.getText("C_COMMON_DIALOG_OK")
|
|
389
401
|
};
|
|
390
402
|
},
|
|
391
403
|
|
|
392
404
|
/**
|
|
393
405
|
* Adds a suffix to the 'keep existing' property of the comboBox.
|
|
394
406
|
*
|
|
395
|
-
* @param
|
|
396
|
-
* @returns
|
|
407
|
+
* @param sInputType InputType of the field
|
|
408
|
+
* @returns The modified string
|
|
397
409
|
*/
|
|
398
|
-
getSuffixForKeepExisiting: function (sInputType: string) {
|
|
399
|
-
|
|
410
|
+
// getSuffixForKeepExisiting: function (sInputType: string) {
|
|
411
|
+
// let sResult = "Values";
|
|
400
412
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
},
|
|
413
|
+
// switch (sInputType) {
|
|
414
|
+
// //TODO - Add for other control types as well (Radio Button, Email, Input, MDC Fields, Image etc.)
|
|
415
|
+
// case "DatePicker":
|
|
416
|
+
// sResult = "Dates";
|
|
417
|
+
// break;
|
|
418
|
+
// case "CheckBox":
|
|
419
|
+
// sResult = "Settings";
|
|
420
|
+
// break;
|
|
421
|
+
// default:
|
|
422
|
+
// sResult = "Values";
|
|
423
|
+
// }
|
|
424
|
+
// return sResult;
|
|
425
|
+
// },
|
|
414
426
|
|
|
415
427
|
/**
|
|
416
428
|
* Adds default values to the model [Keep Existing Values, Leave Blank].
|
|
417
429
|
*
|
|
418
|
-
* @param
|
|
419
|
-
* @param
|
|
420
|
-
* @param
|
|
421
|
-
* @param
|
|
422
|
-
* @param {boolean} bUOMField
|
|
430
|
+
* @param aValues Array instance where the default data needs to be added
|
|
431
|
+
* @param oDefaultValues Default values from Application Manifest
|
|
432
|
+
* @param oPropertyInfo Property information
|
|
433
|
+
* @param bUOMField
|
|
423
434
|
*/
|
|
424
|
-
setDefaultValuesToDialog: function (aValues: any,
|
|
435
|
+
setDefaultValuesToDialog: function (aValues: any, oDefaultValues: any, oPropertyInfo: any, bUOMField?: boolean) {
|
|
425
436
|
const sPropertyPath = bUOMField ? oPropertyInfo.unitProperty : oPropertyInfo.dataProperty,
|
|
426
437
|
sInputType = oPropertyInfo.inputType,
|
|
427
438
|
bPropertyRequired = oPropertyInfo.isFieldRequired;
|
|
428
|
-
const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
|
|
439
|
+
// const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
|
|
440
|
+
const sSuffixForKeepExisting = "Values";
|
|
429
441
|
aValues.defaultOptions = aValues.defaultOptions || [];
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
442
|
+
const selectOptionsExist = aValues.selectOptions && aValues.selectOptions.length > 0;
|
|
443
|
+
const keepEntry = {
|
|
444
|
+
text: `${oDefaultValues.keepExistingPrefix} ${sSuffixForKeepExisting} >`,
|
|
445
|
+
key: `Default/${sPropertyPath}`
|
|
446
|
+
};
|
|
435
447
|
|
|
436
448
|
if (sInputType === "CheckBox") {
|
|
437
449
|
const falseEntry = { text: "No", key: `${sPropertyPath}/false`, textInfo: { value: false } };
|
|
@@ -440,41 +452,38 @@ const MassEditHelper = {
|
|
|
440
452
|
aValues.defaultOptions.unshift(falseEntry);
|
|
441
453
|
aValues.unshift(truthyEntry);
|
|
442
454
|
aValues.defaultOptions.unshift(truthyEntry);
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
if (oPropertyInfo.isValueHelpEnabled || (oPropertyInfo.isValueHelpEnabledForUnit && bUOMField)) {
|
|
446
|
-
const vhdEntry = { text: oDefaultValues.useValueHelpValue, key: "UseValueHelpValue/" + sPropertyPath };
|
|
447
|
-
aValues.unshift(vhdEntry);
|
|
448
|
-
aValues.defaultOptions.unshift(vhdEntry);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
if (bValueExistsForPropertyPath) {
|
|
452
|
-
if (bPropertyRequired !== "true" && !bUOMField) {
|
|
453
|
-
const clearEntry = { text: oDefaultValues.clearFieldValue, key: "ClearFieldValue/" + sPropertyPath };
|
|
454
|
-
aValues.unshift(clearEntry);
|
|
455
|
-
aValues.defaultOptions.unshift(clearEntry);
|
|
456
|
-
}
|
|
455
|
+
aValues.unshift(keepEntry);
|
|
456
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
457
457
|
} else {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
if (oPropertyInfo.isValueHelpEnabled || (oPropertyInfo.isValueHelpEnabledForUnit && bUOMField)) {
|
|
459
|
+
const vhdEntry = { text: oDefaultValues.useValueHelpValue, key: `UseValueHelpValue/${sPropertyPath}` };
|
|
460
|
+
aValues.unshift(vhdEntry);
|
|
461
|
+
aValues.defaultOptions.unshift(vhdEntry);
|
|
462
|
+
}
|
|
463
|
+
if (selectOptionsExist) {
|
|
464
|
+
if (bPropertyRequired !== "true" && !bUOMField) {
|
|
465
|
+
const clearEntry = { text: oDefaultValues.clearFieldValue, key: `ClearFieldValue/${sPropertyPath}` };
|
|
466
|
+
aValues.unshift(clearEntry);
|
|
467
|
+
aValues.defaultOptions.unshift(clearEntry);
|
|
468
|
+
}
|
|
469
|
+
aValues.unshift(keepEntry);
|
|
470
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
471
|
+
} else {
|
|
472
|
+
const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `Default/${sPropertyPath}` };
|
|
473
|
+
aValues.unshift(emptyEntry);
|
|
474
|
+
aValues.defaultOptions.unshift(emptyEntry);
|
|
475
|
+
}
|
|
461
476
|
}
|
|
462
|
-
const keepEntry = {
|
|
463
|
-
text: oDefaultValues.keepExistingPrefix + " " + sSuffixForKeepExisting + " >",
|
|
464
|
-
key: "Default/" + sPropertyPath
|
|
465
|
-
};
|
|
466
|
-
aValues.unshift(keepEntry);
|
|
467
|
-
aValues.defaultOptions.unshift(keepEntry);
|
|
468
477
|
},
|
|
469
478
|
|
|
470
479
|
/**
|
|
471
480
|
* Get text arrangement info for a context property.
|
|
472
481
|
*
|
|
473
|
-
* @param
|
|
474
|
-
* @param
|
|
475
|
-
* @param
|
|
476
|
-
* @param
|
|
477
|
-
* @returns
|
|
482
|
+
* @param property Property Path
|
|
483
|
+
* @param descriptionPath Path to text association of the property
|
|
484
|
+
* @param displayMode Display mode of the property and text association
|
|
485
|
+
* @param selectedContext Context to find the full text
|
|
486
|
+
* @returns The text arrangement
|
|
478
487
|
*/
|
|
479
488
|
getTextArrangementInfo: function (
|
|
480
489
|
property: string,
|
|
@@ -488,25 +497,25 @@ const MassEditHelper = {
|
|
|
488
497
|
if (descriptionPath && property) {
|
|
489
498
|
switch (displayMode) {
|
|
490
499
|
case "Description":
|
|
491
|
-
descriptionValue = selectedContext.getObject(descriptionPath);
|
|
500
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
492
501
|
fullText = descriptionValue;
|
|
493
502
|
break;
|
|
494
503
|
case "Value":
|
|
495
|
-
value = selectedContext.getObject(property);
|
|
504
|
+
value = selectedContext.getObject(property) || "";
|
|
496
505
|
fullText = value;
|
|
497
506
|
break;
|
|
498
507
|
case "ValueDescription":
|
|
499
|
-
value = selectedContext.getObject(property);
|
|
500
|
-
descriptionValue = selectedContext.getObject(descriptionPath);
|
|
501
|
-
fullText =
|
|
508
|
+
value = selectedContext.getObject(property) || "";
|
|
509
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
510
|
+
fullText = descriptionValue ? `${value} (${descriptionValue})` : value;
|
|
502
511
|
break;
|
|
503
512
|
case "DescriptionValue":
|
|
504
|
-
value = selectedContext.getObject(property);
|
|
505
|
-
descriptionValue = selectedContext.getObject(descriptionPath);
|
|
506
|
-
fullText = descriptionValue
|
|
513
|
+
value = selectedContext.getObject(property) || "";
|
|
514
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
515
|
+
fullText = descriptionValue ? `${descriptionValue} (${value})` : value;
|
|
507
516
|
break;
|
|
508
517
|
default:
|
|
509
|
-
Log.info(
|
|
518
|
+
Log.info(`Display Property not applicable: ${property}`);
|
|
510
519
|
break;
|
|
511
520
|
}
|
|
512
521
|
}
|
|
@@ -524,8 +533,8 @@ const MassEditHelper = {
|
|
|
524
533
|
/**
|
|
525
534
|
* Return the visibility valuue for the ManagedObject Any.
|
|
526
535
|
*
|
|
527
|
-
* @param
|
|
528
|
-
* @returns
|
|
536
|
+
* @param any The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
537
|
+
* @returns Returns true if the mass edit field is editable.
|
|
529
538
|
*/
|
|
530
539
|
isEditable: function (any: AnyType): boolean {
|
|
531
540
|
const binding = any.getBinding("any");
|
|
@@ -536,25 +545,25 @@ const MassEditHelper = {
|
|
|
536
545
|
/**
|
|
537
546
|
* Calculate and update the visibility of mass edit field on change of the ManagedObject Any binding.
|
|
538
547
|
*
|
|
539
|
-
* @param
|
|
540
|
-
* @param
|
|
548
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
549
|
+
* @param dataProperty Field name.
|
|
541
550
|
*/
|
|
542
551
|
onContextEditableChange: function (oDialogDataModel: JSONModel, dataProperty: string): void {
|
|
543
|
-
const objectsForVisibility = oDialogDataModel.getProperty(
|
|
552
|
+
const objectsForVisibility = oDialogDataModel.getProperty(`/values/${dataProperty}/objectsForVisibility`) || [];
|
|
544
553
|
const editable = objectsForVisibility.some(MassEditHelper.isEditable);
|
|
545
554
|
|
|
546
555
|
if (editable) {
|
|
547
|
-
oDialogDataModel.setProperty(
|
|
556
|
+
oDialogDataModel.setProperty(`/values/${dataProperty}/visible`, editable);
|
|
548
557
|
}
|
|
549
558
|
},
|
|
550
559
|
|
|
551
560
|
/**
|
|
552
561
|
* Update Managed Object Any for visibility of the mass edit fields.
|
|
553
562
|
*
|
|
554
|
-
* @param
|
|
555
|
-
* @param
|
|
556
|
-
* @param
|
|
557
|
-
* @param
|
|
563
|
+
* @param mOToUse The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
564
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
565
|
+
* @param dataProperty Field name.
|
|
566
|
+
* @param values Values of the field.
|
|
558
567
|
*/
|
|
559
568
|
updateOnContextChange: function (mOToUse: AnyType, oDialogDataModel: JSONModel, dataProperty: string, values: any) {
|
|
560
569
|
const binding = mOToUse.getBinding("any");
|
|
@@ -568,11 +577,11 @@ const MassEditHelper = {
|
|
|
568
577
|
/**
|
|
569
578
|
* Get bound object to calculate the visibility of contexts.
|
|
570
579
|
*
|
|
571
|
-
* @param
|
|
572
|
-
* @param
|
|
573
|
-
* @returns
|
|
580
|
+
* @param expBinding Binding String object.
|
|
581
|
+
* @param context Context the binding value.
|
|
582
|
+
* @returns The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
574
583
|
*/
|
|
575
|
-
getBoundObject: function (expBinding:
|
|
584
|
+
getBoundObject: function (expBinding: CompiledBindingToolkitExpression, context: Context): AnyType {
|
|
576
585
|
const mOToUse = new Any({ any: expBinding });
|
|
577
586
|
const model = context.getModel();
|
|
578
587
|
mOToUse.setModel(model);
|
|
@@ -584,15 +593,15 @@ const MassEditHelper = {
|
|
|
584
593
|
/**
|
|
585
594
|
* Get the visibility of the field.
|
|
586
595
|
*
|
|
587
|
-
* @param
|
|
588
|
-
* @param
|
|
589
|
-
* @param
|
|
590
|
-
* @param
|
|
591
|
-
* @param
|
|
592
|
-
* @returns
|
|
596
|
+
* @param expBinding Binding String object.
|
|
597
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
598
|
+
* @param dataProperty Field name.
|
|
599
|
+
* @param values Values of the field.
|
|
600
|
+
* @param context Context the binding value.
|
|
601
|
+
* @returns Returns true if the mass edit field is editable.
|
|
593
602
|
*/
|
|
594
603
|
getFieldVisiblity: function (
|
|
595
|
-
expBinding:
|
|
604
|
+
expBinding: CompiledBindingToolkitExpression,
|
|
596
605
|
oDialogDataModel: JSONModel,
|
|
597
606
|
dataProperty: string,
|
|
598
607
|
values: any,
|
|
@@ -612,11 +621,11 @@ const MassEditHelper = {
|
|
|
612
621
|
* => The model consists of values shown in the comboBox of the dialog (Leave Blank, Keep Existing Values, or any property value for the selected context, etc.)
|
|
613
622
|
* => The model will capture runtime changes in the results property (the value entered in the comboBox).
|
|
614
623
|
*
|
|
615
|
-
* @param
|
|
616
|
-
* @param
|
|
617
|
-
* @param
|
|
618
|
-
* @param
|
|
619
|
-
* @returns
|
|
624
|
+
* @param aContexts Contexts for mass edit
|
|
625
|
+
* @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
|
|
626
|
+
* @param oDefaultValues Default values from i18n
|
|
627
|
+
* @param dialogContext Transient context for mass edit dialog.
|
|
628
|
+
* @returns The runtime model
|
|
620
629
|
*/
|
|
621
630
|
setRuntimeModelOnDialog: function (aContexts: any[], aDataArray: any[], oDefaultValues: any, dialogContext: Context) {
|
|
622
631
|
const aValues: any[] = [];
|
|
@@ -628,27 +637,28 @@ const MassEditHelper = {
|
|
|
628
637
|
"unitData": aUnitData,
|
|
629
638
|
"results": aResults,
|
|
630
639
|
"readablePropertyData": aReadOnlyFieldInfo,
|
|
631
|
-
"selectedKey": undefined
|
|
640
|
+
"selectedKey": undefined,
|
|
641
|
+
"noFields": oDefaultValues.noFields
|
|
632
642
|
};
|
|
633
643
|
const oDialogDataModel = new JSONModel(oData);
|
|
634
|
-
aDataArray.forEach(function (
|
|
644
|
+
aDataArray.forEach(function (oInData: any) {
|
|
635
645
|
let oTextInfo;
|
|
636
646
|
let sPropertyKey;
|
|
637
647
|
let sUnitPropertyName;
|
|
638
648
|
const oDistinctValueMap: any = {};
|
|
639
649
|
const oDistinctUnitMap: any = {};
|
|
640
|
-
if (
|
|
641
|
-
const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(
|
|
642
|
-
const aPropertyPaths =
|
|
650
|
+
if (oInData.dataProperty && oInData.dataProperty.indexOf("/") > -1) {
|
|
651
|
+
const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(oInData.dataProperty, aValues /*, dialogContext */);
|
|
652
|
+
const aPropertyPaths = oInData.dataProperty.split("/");
|
|
643
653
|
|
|
644
654
|
for (const context of aContexts) {
|
|
645
|
-
const sMultiLevelPathValue = context.getObject(
|
|
646
|
-
sPropertyKey =
|
|
655
|
+
const sMultiLevelPathValue = context.getObject(oInData.dataProperty);
|
|
656
|
+
sPropertyKey = `${oInData.dataProperty}/${sMultiLevelPathValue}`;
|
|
647
657
|
if (!oDistinctValueMap[sPropertyKey] && aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]]) {
|
|
648
658
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
659
|
+
oInData.dataProperty,
|
|
660
|
+
oInData.descriptionPath,
|
|
661
|
+
oInData.display,
|
|
652
662
|
context
|
|
653
663
|
);
|
|
654
664
|
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].push({
|
|
@@ -664,157 +674,166 @@ const MassEditHelper = {
|
|
|
664
674
|
// }
|
|
665
675
|
|
|
666
676
|
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].textInfo = {
|
|
667
|
-
descriptionPath:
|
|
668
|
-
valuePath:
|
|
669
|
-
displayMode:
|
|
677
|
+
descriptionPath: oInData.descriptionPath,
|
|
678
|
+
valuePath: oInData.dataProperty,
|
|
679
|
+
displayMode: oInData.display
|
|
670
680
|
};
|
|
671
681
|
} else {
|
|
672
|
-
aValues[
|
|
673
|
-
aValues[
|
|
674
|
-
if (
|
|
675
|
-
aUnitData[
|
|
676
|
-
aUnitData[
|
|
682
|
+
aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
|
|
683
|
+
aValues[oInData.dataProperty]["selectOptions"] = aValues[oInData.dataProperty]["selectOptions"] || [];
|
|
684
|
+
if (oInData.unitProperty) {
|
|
685
|
+
aUnitData[oInData.unitProperty] = aUnitData[oInData.unitProperty] || [];
|
|
686
|
+
aUnitData[oInData.unitProperty]["selectOptions"] = aUnitData[oInData.unitProperty]["selectOptions"] || [];
|
|
677
687
|
}
|
|
678
688
|
for (const context of aContexts) {
|
|
679
689
|
const oDataObject = context.getObject();
|
|
680
|
-
sPropertyKey =
|
|
681
|
-
if (
|
|
682
|
-
if (
|
|
690
|
+
sPropertyKey = `${oInData.dataProperty}/${oDataObject[oInData.dataProperty]}`;
|
|
691
|
+
if (oInData.dataProperty && oDataObject[oInData.dataProperty] && !oDistinctValueMap[sPropertyKey]) {
|
|
692
|
+
if (oInData.inputType != "CheckBox") {
|
|
683
693
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
694
|
+
oInData.dataProperty,
|
|
695
|
+
oInData.descriptionPath,
|
|
696
|
+
oInData.display,
|
|
687
697
|
context
|
|
688
698
|
);
|
|
689
699
|
const entry = {
|
|
690
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[
|
|
700
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.dataProperty],
|
|
691
701
|
"key": sPropertyKey,
|
|
692
702
|
"textInfo": oTextInfo
|
|
693
703
|
};
|
|
694
|
-
aValues[
|
|
695
|
-
aValues[
|
|
704
|
+
aValues[oInData.dataProperty].push(entry);
|
|
705
|
+
aValues[oInData.dataProperty]["selectOptions"].push(entry);
|
|
696
706
|
}
|
|
697
|
-
oDistinctValueMap[sPropertyKey] = oDataObject[
|
|
707
|
+
oDistinctValueMap[sPropertyKey] = oDataObject[oInData.dataProperty];
|
|
698
708
|
}
|
|
699
|
-
if (
|
|
700
|
-
sUnitPropertyName =
|
|
709
|
+
if (oInData.unitProperty && oDataObject[oInData.unitProperty]) {
|
|
710
|
+
sUnitPropertyName = `${oInData.unitProperty}/${oDataObject[oInData.unitProperty]}`;
|
|
701
711
|
if (!oDistinctUnitMap[sUnitPropertyName]) {
|
|
702
|
-
if (
|
|
712
|
+
if (oInData.inputType != "CheckBox") {
|
|
703
713
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
714
|
+
oInData.unitProperty,
|
|
715
|
+
oInData.descriptionPath,
|
|
716
|
+
oInData.display,
|
|
707
717
|
context
|
|
708
718
|
);
|
|
709
719
|
const unitEntry = {
|
|
710
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[
|
|
720
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.unitProperty],
|
|
711
721
|
"key": sUnitPropertyName,
|
|
712
722
|
"textInfo": oTextInfo
|
|
713
723
|
};
|
|
714
|
-
aUnitData[
|
|
715
|
-
aUnitData[
|
|
724
|
+
aUnitData[oInData.unitProperty].push(unitEntry);
|
|
725
|
+
aUnitData[oInData.unitProperty]["selectOptions"].push(unitEntry);
|
|
716
726
|
}
|
|
717
|
-
oDistinctUnitMap[sUnitPropertyName] = oDataObject[
|
|
727
|
+
oDistinctUnitMap[sUnitPropertyName] = oDataObject[oInData.unitProperty];
|
|
718
728
|
}
|
|
719
729
|
}
|
|
720
730
|
}
|
|
721
|
-
aValues[
|
|
722
|
-
descriptionPath:
|
|
723
|
-
valuePath:
|
|
724
|
-
displayMode:
|
|
731
|
+
aValues[oInData.dataProperty].textInfo = {
|
|
732
|
+
descriptionPath: oInData.descriptionPath,
|
|
733
|
+
valuePath: oInData.dataProperty,
|
|
734
|
+
displayMode: oInData.display
|
|
725
735
|
};
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
736
|
+
if (Object.keys(oDistinctValueMap).length === 1) {
|
|
737
|
+
dialogContext.setProperty(oInData.dataProperty, sPropertyKey && oDistinctValueMap[sPropertyKey]);
|
|
738
|
+
}
|
|
739
|
+
if (Object.keys(oDistinctUnitMap).length === 1) {
|
|
740
|
+
dialogContext.setProperty(oInData.unitProperty, sUnitPropertyName && oDistinctUnitMap[sUnitPropertyName]);
|
|
741
|
+
}
|
|
732
742
|
}
|
|
733
743
|
});
|
|
734
|
-
aDataArray.forEach(function (
|
|
744
|
+
aDataArray.forEach(function (oInData: any) {
|
|
735
745
|
let values: any = {};
|
|
736
|
-
if (
|
|
737
|
-
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(
|
|
746
|
+
if (oInData.dataProperty.indexOf("/") > -1) {
|
|
747
|
+
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(oInData.dataProperty, aValues);
|
|
738
748
|
if (!sMultiLevelPropPathValue) {
|
|
739
|
-
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key:
|
|
749
|
+
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
740
750
|
} else {
|
|
741
|
-
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue,
|
|
751
|
+
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue, oDefaultValues, oInData);
|
|
742
752
|
}
|
|
743
753
|
values = sMultiLevelPropPathValue;
|
|
744
|
-
} else if (aValues[
|
|
745
|
-
aValues[
|
|
746
|
-
MassEditHelper.setDefaultValuesToDialog(aValues[
|
|
747
|
-
values = aValues[
|
|
754
|
+
} else if (aValues[oInData.dataProperty]) {
|
|
755
|
+
aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
|
|
756
|
+
MassEditHelper.setDefaultValuesToDialog(aValues[oInData.dataProperty], oDefaultValues, oInData);
|
|
757
|
+
values = aValues[oInData.dataProperty];
|
|
748
758
|
}
|
|
749
759
|
|
|
750
|
-
if (aUnitData[
|
|
751
|
-
MassEditHelper.setDefaultValuesToDialog(aUnitData[
|
|
752
|
-
aUnitData[
|
|
753
|
-
aUnitData[
|
|
754
|
-
|
|
760
|
+
if (aUnitData[oInData.unitProperty] && aUnitData[oInData.unitProperty].length) {
|
|
761
|
+
MassEditHelper.setDefaultValuesToDialog(aUnitData[oInData.unitProperty], oDefaultValues, oInData, true);
|
|
762
|
+
aUnitData[oInData.unitProperty].textInfo = {};
|
|
763
|
+
aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
|
|
764
|
+
aContexts,
|
|
765
|
+
oInData.unitProperty
|
|
766
|
+
);
|
|
767
|
+
aUnitData[oInData.unitProperty].inputType = oInData.inputType;
|
|
755
768
|
} else if (
|
|
756
|
-
(
|
|
757
|
-
(
|
|
769
|
+
(oInData.dataProperty && aValues[oInData.dataProperty] && !aValues[oInData.dataProperty].length) ||
|
|
770
|
+
(oInData.unitProperty && aUnitData[oInData.unitProperty] && !aUnitData[oInData.unitProperty].length)
|
|
758
771
|
) {
|
|
759
772
|
const bClearFieldOrBlankValueExists =
|
|
760
|
-
aValues[
|
|
761
|
-
aValues[
|
|
773
|
+
aValues[oInData.dataProperty] &&
|
|
774
|
+
aValues[oInData.dataProperty].some(function (obj: any) {
|
|
762
775
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
763
776
|
});
|
|
764
|
-
if (
|
|
765
|
-
aValues[
|
|
777
|
+
if (oInData.dataProperty && !bClearFieldOrBlankValueExists) {
|
|
778
|
+
aValues[oInData.dataProperty].push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
766
779
|
}
|
|
767
780
|
const bClearFieldOrBlankUnitValueExists =
|
|
768
|
-
aUnitData[
|
|
769
|
-
aUnitData[
|
|
781
|
+
aUnitData[oInData.unitProperty] &&
|
|
782
|
+
aUnitData[oInData.unitProperty].some(function (obj: any) {
|
|
770
783
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
771
784
|
});
|
|
772
|
-
if (
|
|
785
|
+
if (oInData.unitProperty) {
|
|
773
786
|
if (!bClearFieldOrBlankUnitValueExists) {
|
|
774
|
-
aUnitData[
|
|
787
|
+
aUnitData[oInData.unitProperty].push({
|
|
775
788
|
text: oDefaultValues.leaveBlankValue,
|
|
776
|
-
key:
|
|
789
|
+
key: `Empty/${oInData.unitProperty}`
|
|
777
790
|
});
|
|
778
791
|
}
|
|
779
|
-
aUnitData[
|
|
780
|
-
aUnitData[
|
|
792
|
+
aUnitData[oInData.unitProperty].textInfo = {};
|
|
793
|
+
aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
|
|
781
794
|
aContexts,
|
|
782
|
-
|
|
795
|
+
oInData.unitProperty
|
|
783
796
|
);
|
|
784
|
-
aUnitData[
|
|
797
|
+
aUnitData[oInData.unitProperty].inputType = oInData.inputType;
|
|
785
798
|
}
|
|
786
799
|
}
|
|
787
|
-
if (
|
|
788
|
-
aReadOnlyFieldInfo.push({ "property":
|
|
800
|
+
if (oInData.isPropertyReadOnly && typeof oInData.isPropertyReadOnly === "boolean") {
|
|
801
|
+
aReadOnlyFieldInfo.push({ "property": oInData.dataProperty, value: oInData.isPropertyReadOnly, type: "Default" });
|
|
789
802
|
} else if (
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
803
|
+
oInData.isPropertyReadOnly &&
|
|
804
|
+
oInData.isPropertyReadOnly.operands &&
|
|
805
|
+
oInData.isPropertyReadOnly.operands[0] &&
|
|
806
|
+
oInData.isPropertyReadOnly.operands[0].operand1 &&
|
|
807
|
+
oInData.isPropertyReadOnly.operands[0].operand2
|
|
795
808
|
) {
|
|
796
809
|
// This needs to be refactored in accordance with the ReadOnlyExpression change
|
|
797
810
|
aReadOnlyFieldInfo.push({
|
|
798
|
-
"property":
|
|
799
|
-
propertyPath:
|
|
800
|
-
propertyValue:
|
|
811
|
+
"property": oInData.dataProperty,
|
|
812
|
+
propertyPath: oInData.isPropertyReadOnly.operands[0].operand1.path,
|
|
813
|
+
propertyValue: oInData.isPropertyReadOnly.operands[0].operand2.value,
|
|
801
814
|
type: "Path"
|
|
802
815
|
});
|
|
803
816
|
}
|
|
804
817
|
|
|
805
818
|
// Setting visbility of the mass edit field.
|
|
806
|
-
if (
|
|
819
|
+
if (oInData.editMode) {
|
|
807
820
|
values.visible =
|
|
808
|
-
|
|
821
|
+
oInData.editMode === EditMode.Editable ||
|
|
809
822
|
aContexts.some(
|
|
810
|
-
MassEditHelper.getFieldVisiblity.bind(
|
|
823
|
+
MassEditHelper.getFieldVisiblity.bind(
|
|
824
|
+
MassEditHelper,
|
|
825
|
+
oInData.editMode,
|
|
826
|
+
oDialogDataModel,
|
|
827
|
+
oInData.dataProperty,
|
|
828
|
+
values
|
|
829
|
+
)
|
|
811
830
|
);
|
|
812
831
|
} else {
|
|
813
832
|
values.visible = true;
|
|
814
833
|
}
|
|
815
|
-
values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts,
|
|
816
|
-
values.inputType =
|
|
817
|
-
values.unitProperty =
|
|
834
|
+
values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oInData.dataProperty);
|
|
835
|
+
values.inputType = oInData.inputType;
|
|
836
|
+
values.unitProperty = oInData.unitProperty;
|
|
818
837
|
});
|
|
819
838
|
|
|
820
839
|
return oDialogDataModel;
|
|
@@ -822,9 +841,9 @@ const MassEditHelper = {
|
|
|
822
841
|
/**
|
|
823
842
|
* Gets transient context for dialog.
|
|
824
843
|
*
|
|
825
|
-
* @param
|
|
826
|
-
* @param
|
|
827
|
-
* @returns
|
|
844
|
+
* @param table Instance of Table.
|
|
845
|
+
* @param dialog Mass Edit Dialog.
|
|
846
|
+
* @returns Promise returning instance of dialog.
|
|
828
847
|
*/
|
|
829
848
|
getDialogContext: function (table: Table, dialog?: Dialog): Context {
|
|
830
849
|
let transCtx: Context = (dialog && dialog.getBindingContext()) as Context;
|
|
@@ -853,10 +872,10 @@ const MassEditHelper = {
|
|
|
853
872
|
/**
|
|
854
873
|
* Create the mass edit dialog.
|
|
855
874
|
*
|
|
856
|
-
* @param
|
|
857
|
-
* @param
|
|
858
|
-
* @param
|
|
859
|
-
* @returns
|
|
875
|
+
* @param oTable Instance of Table
|
|
876
|
+
* @param aContexts Contexts for mass edit
|
|
877
|
+
* @param oController Controller for the view
|
|
878
|
+
* @returns Promise returning instance of dialog.
|
|
860
879
|
*/
|
|
861
880
|
createDialog: function (oTable: Table, aContexts: any[], oController: PageController) {
|
|
862
881
|
const sFragmentName = "sap/fe/core/controls/massEdit/MassEditDialog",
|
|
@@ -883,30 +902,31 @@ const MassEditHelper = {
|
|
|
883
902
|
}
|
|
884
903
|
)
|
|
885
904
|
)
|
|
886
|
-
.then(function (
|
|
887
|
-
return Fragment.load({ definition:
|
|
905
|
+
.then(function (oCreatedFragment: any) {
|
|
906
|
+
return Fragment.load({ definition: oCreatedFragment }).then(function (oDialogContent: any) {
|
|
888
907
|
const DraftStatus = FELibrary.DraftStatus;
|
|
889
908
|
const oDialog = new Dialog({
|
|
909
|
+
resizable: true,
|
|
890
910
|
title: oDefaultValues.massEditTitle,
|
|
891
911
|
content: [oDialogContent],
|
|
892
912
|
afterOpen: MassEditHelper.onDialogOpen,
|
|
893
913
|
beginButton: new Button({
|
|
894
|
-
text: oDefaultValues.
|
|
914
|
+
text: MassEditHelper.helpers.getExpBindingForApplyButtonTxt(oDefaultValues, oDataFieldModel.getObject("/")),
|
|
895
915
|
type: "Emphasized",
|
|
896
916
|
press: function (oEvent: any) {
|
|
897
917
|
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
898
918
|
"skipPatchHandlers",
|
|
899
919
|
true
|
|
900
920
|
);
|
|
901
|
-
const
|
|
902
|
-
const oModel =
|
|
921
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
922
|
+
const oModel = oInDialog.getModel("fieldsInfo");
|
|
903
923
|
const aResults = oModel.getProperty("/results");
|
|
904
924
|
const aPropertyReadableInfo = oModel.getProperty("/readablePropertyData");
|
|
905
925
|
const changePromise: any[] = [];
|
|
906
926
|
let bReadOnlyField = false;
|
|
907
927
|
let groupId;
|
|
908
928
|
//let index = 0;
|
|
909
|
-
|
|
929
|
+
const errorValues: any[] = [];
|
|
910
930
|
aContexts.forEach(function (oSelectedContext: any, idx: number) {
|
|
911
931
|
aResults.forEach(function (oResult: any) {
|
|
912
932
|
//TODO - Add save implementation for Value Help.
|
|
@@ -928,7 +948,7 @@ const MassEditHelper = {
|
|
|
928
948
|
}
|
|
929
949
|
});
|
|
930
950
|
}
|
|
931
|
-
groupId =
|
|
951
|
+
groupId = `$auto.${idx}`;
|
|
932
952
|
//index += 1;
|
|
933
953
|
oController._editFlow.setDraftStatus(DraftStatus.Saving);
|
|
934
954
|
//let promiseCount = 0;
|
|
@@ -948,14 +968,15 @@ const MassEditHelper = {
|
|
|
948
968
|
});
|
|
949
969
|
});
|
|
950
970
|
|
|
971
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
951
972
|
(Promise as any).allSettled(changePromise).then(function () {
|
|
952
973
|
const oListBinding = oTable.getRowBinding();
|
|
953
974
|
const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
|
|
954
975
|
return oExtensionAPI.refresh(oListBinding.getPath()).then(function () {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
messages.forEach(function (message: any
|
|
976
|
+
const subtitleColumn = CommonUtils.getMessageColumn(oTable);
|
|
977
|
+
const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
|
|
978
|
+
const boundTransitionErrorContexts = [] as any;
|
|
979
|
+
messages.forEach(function (message: any) {
|
|
959
980
|
const messageTargets = message.getTargets();
|
|
960
981
|
if (
|
|
961
982
|
messageTargets &&
|
|
@@ -963,7 +984,7 @@ const MassEditHelper = {
|
|
|
963
984
|
messageTargets[0].length &&
|
|
964
985
|
message.persistent === true
|
|
965
986
|
) {
|
|
966
|
-
|
|
987
|
+
const boundTransitionErrorContext = aContexts.find(function (oContext: any) {
|
|
967
988
|
return message.getTarget().indexOf(oContext.getPath()) !== -1;
|
|
968
989
|
});
|
|
969
990
|
boundTransitionErrorContexts.push(boundTransitionErrorContext);
|
|
@@ -972,27 +993,29 @@ const MassEditHelper = {
|
|
|
972
993
|
: undefined;
|
|
973
994
|
}
|
|
974
995
|
});
|
|
975
|
-
if (
|
|
996
|
+
if (
|
|
997
|
+
aResults.length > 0 &&
|
|
998
|
+
boundTransitionErrorContexts.length === 0 &&
|
|
999
|
+
errorValues.length === 0
|
|
1000
|
+
) {
|
|
976
1001
|
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
977
1002
|
const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
|
|
978
1003
|
MessageToast.show(successToast);
|
|
979
|
-
} else
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
)
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
)
|
|
989
|
-
oController._editFlow.setDraftStatus(DraftStatus.Clear);
|
|
990
|
-
}
|
|
1004
|
+
} else if (
|
|
1005
|
+
errorValues.length + boundTransitionErrorContexts.length <
|
|
1006
|
+
(oTable as any).getSelectedContexts().length
|
|
1007
|
+
) {
|
|
1008
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
1009
|
+
} else if (
|
|
1010
|
+
errorValues.length + boundTransitionErrorContexts.length ===
|
|
1011
|
+
(oTable as any).getSelectedContexts().length
|
|
1012
|
+
) {
|
|
1013
|
+
oController._editFlow.setDraftStatus(DraftStatus.Clear);
|
|
991
1014
|
}
|
|
992
1015
|
oController._editFlow.getMessageHandler().showMessages();
|
|
993
|
-
if (
|
|
994
|
-
|
|
995
|
-
|
|
1016
|
+
if (oInDialog.isOpen()) {
|
|
1017
|
+
oInDialog.close();
|
|
1018
|
+
oInDialog.destroy();
|
|
996
1019
|
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
997
1020
|
"skipPatchHandlers",
|
|
998
1021
|
false
|
|
@@ -1004,10 +1027,11 @@ const MassEditHelper = {
|
|
|
1004
1027
|
}),
|
|
1005
1028
|
endButton: new Button({
|
|
1006
1029
|
text: oDefaultValues.cancelButtonText,
|
|
1030
|
+
visible: MassEditHelper.helpers.hasEditableFieldsBinding(oDataFieldModel.getObject("/"), true) as any,
|
|
1007
1031
|
press: function (oEvent: any) {
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
|
|
1032
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
1033
|
+
oInDialog.close();
|
|
1034
|
+
oInDialog.destroy();
|
|
1011
1035
|
}
|
|
1012
1036
|
})
|
|
1013
1037
|
});
|
|
@@ -1020,6 +1044,30 @@ const MassEditHelper = {
|
|
|
1020
1044
|
})
|
|
1021
1045
|
.catch(reject);
|
|
1022
1046
|
});
|
|
1047
|
+
},
|
|
1048
|
+
|
|
1049
|
+
helpers: {
|
|
1050
|
+
getBindingExpForHasEditableFields: (fields: any, editable: boolean) => {
|
|
1051
|
+
const totalExp = fields.reduce(
|
|
1052
|
+
(expression: any, field: any) =>
|
|
1053
|
+
or(
|
|
1054
|
+
expression,
|
|
1055
|
+
pathInModel("/values/" + field.dataProperty + "/visible", "fieldsInfo") as BindingToolkitExpression<boolean>
|
|
1056
|
+
),
|
|
1057
|
+
constant(false)
|
|
1058
|
+
);
|
|
1059
|
+
return editable ? totalExp : not(totalExp);
|
|
1060
|
+
},
|
|
1061
|
+
|
|
1062
|
+
getExpBindingForApplyButtonTxt: (defaultValues: any, fields: boolean) => {
|
|
1063
|
+
const editableExp = MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, true);
|
|
1064
|
+
const totalExp = ifElse(editableExp, constant(defaultValues.applyButtonText), constant(defaultValues.okButtonText));
|
|
1065
|
+
return compileExpression(totalExp);
|
|
1066
|
+
},
|
|
1067
|
+
|
|
1068
|
+
hasEditableFieldsBinding: (fields: any, editable: boolean) => {
|
|
1069
|
+
return compileExpression(MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, editable));
|
|
1070
|
+
}
|
|
1023
1071
|
}
|
|
1024
1072
|
};
|
|
1025
1073
|
|