@sapui5/sap.fe.core 1.102.2 → 1.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +73 -30
- package/src/sap/fe/core/AppComponent.ts +65 -43
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +227 -126
- package/src/sap/fe/core/CommonUtils.ts +240 -163
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +170 -139
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +7 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
- package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
- package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
- package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
- package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +39 -63
- package/src/sap/fe/core/messagebundle_ar.properties +25 -39
- package/src/sap/fe/core/messagebundle_bg.properties +25 -39
- package/src/sap/fe/core/messagebundle_ca.properties +25 -39
- package/src/sap/fe/core/messagebundle_cs.properties +25 -39
- package/src/sap/fe/core/messagebundle_cy.properties +25 -39
- package/src/sap/fe/core/messagebundle_da.properties +25 -39
- package/src/sap/fe/core/messagebundle_de.properties +25 -39
- package/src/sap/fe/core/messagebundle_el.properties +26 -40
- package/src/sap/fe/core/messagebundle_en.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
- package/src/sap/fe/core/messagebundle_es.properties +27 -41
- package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
- package/src/sap/fe/core/messagebundle_et.properties +25 -39
- package/src/sap/fe/core/messagebundle_fi.properties +25 -39
- package/src/sap/fe/core/messagebundle_fr.properties +26 -40
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
- package/src/sap/fe/core/messagebundle_hi.properties +25 -39
- package/src/sap/fe/core/messagebundle_hr.properties +25 -39
- package/src/sap/fe/core/messagebundle_hu.properties +25 -39
- package/src/sap/fe/core/messagebundle_id.properties +25 -39
- package/src/sap/fe/core/messagebundle_it.properties +41 -55
- package/src/sap/fe/core/messagebundle_iw.properties +25 -39
- package/src/sap/fe/core/messagebundle_ja.properties +25 -39
- package/src/sap/fe/core/messagebundle_kk.properties +25 -39
- package/src/sap/fe/core/messagebundle_ko.properties +30 -44
- package/src/sap/fe/core/messagebundle_lt.properties +25 -39
- package/src/sap/fe/core/messagebundle_lv.properties +25 -39
- package/src/sap/fe/core/messagebundle_ms.properties +25 -39
- package/src/sap/fe/core/messagebundle_nl.properties +27 -41
- package/src/sap/fe/core/messagebundle_no.properties +25 -39
- package/src/sap/fe/core/messagebundle_pl.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
- package/src/sap/fe/core/messagebundle_ro.properties +25 -39
- package/src/sap/fe/core/messagebundle_ru.properties +25 -39
- package/src/sap/fe/core/messagebundle_sh.properties +25 -39
- package/src/sap/fe/core/messagebundle_sk.properties +25 -39
- package/src/sap/fe/core/messagebundle_sl.properties +25 -39
- package/src/sap/fe/core/messagebundle_sv.properties +25 -39
- package/src/sap/fe/core/messagebundle_th.properties +25 -39
- package/src/sap/fe/core/messagebundle_tr.properties +25 -39
- package/src/sap/fe/core/messagebundle_uk.properties +25 -39
- package/src/sap/fe/core/messagebundle_vi.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +16 -15
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,9 +1,19 @@
|
|
|
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
14
|
import type PageController from "sap/fe/core/PageController";
|
|
6
|
-
import { DataModelObjectPath
|
|
15
|
+
import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
16
|
+
import { enhanceDataModelPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
7
17
|
import {
|
|
8
18
|
getAssociatedUnitProperty,
|
|
9
19
|
getAssociatedUnitPropertyPath,
|
|
@@ -13,7 +23,7 @@ import {
|
|
|
13
23
|
hasValueHelpWithFixedValues
|
|
14
24
|
} from "sap/fe/core/templating/PropertyHelper";
|
|
15
25
|
import { getTextBinding, setEditStyleProperties } from "sap/fe/macros/field/FieldTemplating";
|
|
16
|
-
import { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
|
|
26
|
+
import type { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
|
|
17
27
|
import Button from "sap/m/Button";
|
|
18
28
|
import Dialog from "sap/m/Dialog";
|
|
19
29
|
import MessageToast from "sap/m/MessageToast";
|
|
@@ -22,16 +32,17 @@ import Fragment from "sap/ui/core/Fragment";
|
|
|
22
32
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
23
33
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
24
34
|
import EditMode from "sap/ui/mdc/enum/EditMode";
|
|
25
|
-
import Table from "sap/ui/mdc/Table";
|
|
35
|
+
import type Table from "sap/ui/mdc/Table";
|
|
26
36
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
27
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
28
|
-
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
29
|
-
import { CoreEx } from "types/extension_types";
|
|
30
|
-
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";
|
|
31
42
|
import { convertMetaModelContext, getInvolvedDataModelObjects } from "../converters/MetaModelConverter";
|
|
32
43
|
import { isReadOnlyExpression } from "../templating/FieldControlHelper";
|
|
33
44
|
import { getEditMode, getRequiredExpression, isCollectionField } from "../templating/UIFormatters";
|
|
34
|
-
import { InternalModelContext } from "./ModelHelper";
|
|
45
|
+
import type { InternalModelContext } from "./ModelHelper";
|
|
35
46
|
|
|
36
47
|
/* This class contains helpers to be used for mass edit functionality */
|
|
37
48
|
type TextArrangementInfo = {
|
|
@@ -54,9 +65,9 @@ const MassEditHelper = {
|
|
|
54
65
|
* Initializes the value at final or deepest level path with a blank array.
|
|
55
66
|
* Return an empty array pointing to the final or deepest level path.
|
|
56
67
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @returns
|
|
68
|
+
* @param sPath Property path
|
|
69
|
+
* @param aValues Array instance where the default data needs to be added
|
|
70
|
+
* @returns The final path
|
|
60
71
|
*/
|
|
61
72
|
initLastLevelOfPropertyPath: function (sPath: string, aValues: any /*, transCtx: Context */) {
|
|
62
73
|
let aFinalPath: any;
|
|
@@ -70,7 +81,7 @@ const MassEditHelper = {
|
|
|
70
81
|
sFullPath = sFullPath + sPropertyPath;
|
|
71
82
|
index++;
|
|
72
83
|
} else if (!aFinalPath[sPropertyPath]) {
|
|
73
|
-
sFullPath = sFullPath
|
|
84
|
+
sFullPath = `${sFullPath}/${sPropertyPath}`;
|
|
74
85
|
if (sFullPath !== sPath) {
|
|
75
86
|
aFinalPath[sPropertyPath] = {};
|
|
76
87
|
aFinalPath = aFinalPath[sPropertyPath];
|
|
@@ -85,10 +96,10 @@ const MassEditHelper = {
|
|
|
85
96
|
/**
|
|
86
97
|
* Method to get unique values for given array values.
|
|
87
98
|
*
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
91
|
-
* @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
|
|
92
103
|
*/
|
|
93
104
|
getUniqueValues: function (sValue: string, index: number, self: any[]) {
|
|
94
105
|
if (sValue != undefined && sValue != null) {
|
|
@@ -100,9 +111,9 @@ const MassEditHelper = {
|
|
|
100
111
|
* Gets the property value for a multi-level path (for example: _Materials/Material_Details gets the value of Material_Details under _Materials Object).
|
|
101
112
|
* Returns the propertyValue, which can be of any type (string, number, etc..).
|
|
102
113
|
*
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @returns
|
|
114
|
+
* @param sDataPropertyPath Property path
|
|
115
|
+
* @param oValues Object of property values
|
|
116
|
+
* @returns The property value
|
|
106
117
|
*/
|
|
107
118
|
getValueForMultiLevelPath: function (sDataPropertyPath: string, oValues: any) {
|
|
108
119
|
if (sDataPropertyPath && sDataPropertyPath.indexOf("/") > 0) {
|
|
@@ -122,9 +133,9 @@ const MassEditHelper = {
|
|
|
122
133
|
* => If propertyValue for all selected contexts is empty, then < Leave Blank > is preselected.
|
|
123
134
|
*
|
|
124
135
|
*
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @returns
|
|
136
|
+
* @param aContexts Contexts for mass edit
|
|
137
|
+
* @param sDataPropertyPath Data property path
|
|
138
|
+
* @returns The key path
|
|
128
139
|
*/
|
|
129
140
|
getDefaultSelectionPathComboBox: function (aContexts: any[], sDataPropertyPath: string) {
|
|
130
141
|
if (sDataPropertyPath && aContexts.length > 0) {
|
|
@@ -140,11 +151,11 @@ const MassEditHelper = {
|
|
|
140
151
|
});
|
|
141
152
|
const aUniquePropertyValues = aPropertyValues.filter(MassEditHelper.getUniqueValues);
|
|
142
153
|
if (aUniquePropertyValues.length > 1) {
|
|
143
|
-
return
|
|
154
|
+
return `Default/${sDataPropertyPath}`;
|
|
144
155
|
} else if (aUniquePropertyValues.length === 0) {
|
|
145
|
-
return
|
|
156
|
+
return `Empty/${sDataPropertyPath}`;
|
|
146
157
|
} else if (aUniquePropertyValues.length === 1) {
|
|
147
|
-
return sDataPropertyPath
|
|
158
|
+
return `${sDataPropertyPath}/${aUniquePropertyValues[0]}`;
|
|
148
159
|
}
|
|
149
160
|
}
|
|
150
161
|
},
|
|
@@ -152,9 +163,9 @@ const MassEditHelper = {
|
|
|
152
163
|
/**
|
|
153
164
|
* Checks hidden annotation value [both static and path based] for table's selected context.
|
|
154
165
|
*
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
157
|
-
* @returns
|
|
166
|
+
* @param hiddenValue Hidden annotation value / path for field
|
|
167
|
+
* @param aContexts Contexts for mass edit
|
|
168
|
+
* @returns The hidden annotation value
|
|
158
169
|
*/
|
|
159
170
|
getHiddenValueForContexts: function (hiddenValue: any, aContexts: any[]) {
|
|
160
171
|
if (hiddenValue && hiddenValue.$Path) {
|
|
@@ -194,10 +205,10 @@ const MassEditHelper = {
|
|
|
194
205
|
/**
|
|
195
206
|
* Get text path for the mass edit field.
|
|
196
207
|
*
|
|
197
|
-
* @param
|
|
198
|
-
* @param
|
|
199
|
-
* @param
|
|
200
|
-
* @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
|
|
201
212
|
*/
|
|
202
213
|
getTextPath: function (property: string, textBinding: any, displayMode: string): string | undefined {
|
|
203
214
|
let descriptionPath;
|
|
@@ -218,16 +229,16 @@ const MassEditHelper = {
|
|
|
218
229
|
/**
|
|
219
230
|
* Initializes a JSON Model for properties of dialog fields [label, visiblity, dataproperty, etc.].
|
|
220
231
|
*
|
|
221
|
-
* @param
|
|
222
|
-
* @param
|
|
223
|
-
* @param
|
|
224
|
-
* @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
|
|
225
236
|
*/
|
|
226
237
|
prepareDataForDialog: function (oTable: Table, aContexts: any[], aDataArray: any[]) {
|
|
227
238
|
const oMetaModel = oTable && (oTable.getModel().getMetaModel() as any),
|
|
228
239
|
sCurrentEntitySetName = oTable.data("metaPath"),
|
|
229
240
|
aTableFields = MassEditHelper.getTableFields(oTable),
|
|
230
|
-
oEntityTypeContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
241
|
+
oEntityTypeContext = oMetaModel.getContext(`${sCurrentEntitySetName}/@`),
|
|
231
242
|
oEntitySetContext = oMetaModel.getContext(sCurrentEntitySetName),
|
|
232
243
|
oDataModelObjectPath = getInvolvedDataModelObjects(oEntityTypeContext);
|
|
233
244
|
|
|
@@ -247,6 +258,7 @@ const MassEditHelper = {
|
|
|
247
258
|
oColumnInfo.label ||
|
|
248
259
|
(oPropertyInfo && oPropertyInfo["@com.sap.vocabularies.Common.v1.Label"]) ||
|
|
249
260
|
oColumnInfo.dataProperty;
|
|
261
|
+
|
|
250
262
|
if (oDataModelObjectPath) {
|
|
251
263
|
oDataModelObjectPath.targetObject = oDataModelObjectPath.targetEntityType.entityProperties.filter(function (
|
|
252
264
|
oProperty: any
|
|
@@ -258,7 +270,7 @@ const MassEditHelper = {
|
|
|
258
270
|
oTextBinding = getTextBinding(oDataModelObjectPath, {}, true) || {};
|
|
259
271
|
const oFieldContext = oMetaModel.getContext(oColumnInfo.annotationPath),
|
|
260
272
|
oDataFieldConverted = convertMetaModelContext(oFieldContext),
|
|
261
|
-
oPropertyContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
273
|
+
oPropertyContext = oMetaModel.getContext(`${sCurrentEntitySetName}/${sDataPropertyPath}@`),
|
|
262
274
|
oInterface = oPropertyContext && oPropertyContext.getInterface();
|
|
263
275
|
|
|
264
276
|
let oDataModelPath = getInvolvedDataModelObjects(oFieldContext, oEntitySetContext);
|
|
@@ -277,7 +289,7 @@ const MassEditHelper = {
|
|
|
277
289
|
return oInterface.getModel();
|
|
278
290
|
},
|
|
279
291
|
getPath: function () {
|
|
280
|
-
return sCurrentEntitySetName
|
|
292
|
+
return `${sCurrentEntitySetName}/${sDataPropertyPath}`;
|
|
281
293
|
}
|
|
282
294
|
};
|
|
283
295
|
oPropertyInfo =
|
|
@@ -297,18 +309,19 @@ const MassEditHelper = {
|
|
|
297
309
|
|
|
298
310
|
// ValueHelp properties
|
|
299
311
|
bValueHelpEnabled = hasValueHelp(oPropertyInfo);
|
|
300
|
-
sUnitPropertyPath =
|
|
312
|
+
sUnitPropertyPath =
|
|
313
|
+
((hasCurrency(oPropertyInfo) || hasUnit(oPropertyInfo)) && getAssociatedUnitPropertyPath(oPropertyInfo)) || "";
|
|
301
314
|
const unitPropertyInfo = sUnitPropertyPath && getAssociatedUnitProperty(oPropertyInfo);
|
|
302
315
|
bValueHelpEnabledForUnit = unitPropertyInfo && hasValueHelp(unitPropertyInfo);
|
|
303
316
|
|
|
304
317
|
// EditMode and InputType
|
|
305
318
|
const propertyForFieldControl = oPropertyInfo && oPropertyInfo.Value ? oPropertyInfo.Value : oPropertyInfo;
|
|
306
|
-
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, true);
|
|
319
|
+
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, constant(true));
|
|
307
320
|
const editModeValues = Object.keys(EditMode);
|
|
308
321
|
const editModeIsStatic = !!expBinding && editModeValues.includes(expBinding as EditMode);
|
|
309
322
|
const editable = !!expBinding && ((editModeIsStatic && expBinding === EditMode.Editable) || !editModeIsStatic);
|
|
310
|
-
|
|
311
|
-
if (!editable) {
|
|
323
|
+
const navPropertyWithValueHelp = sDataPropertyPath.includes("/") && bValueHelpEnabled;
|
|
324
|
+
if (!editable || navPropertyWithValueHelp) {
|
|
312
325
|
return;
|
|
313
326
|
}
|
|
314
327
|
|
|
@@ -321,8 +334,9 @@ const MassEditHelper = {
|
|
|
321
334
|
"label": sLabelText,
|
|
322
335
|
"dataProperty": sDataPropertyPath,
|
|
323
336
|
"isValueHelpEnabled": bValueHelpEnabled ? bValueHelpEnabled : false,
|
|
324
|
-
"unitProperty": sUnitPropertyPath ? sUnitPropertyPath : false,
|
|
325
|
-
"isValueHelpEnabledForUnit":
|
|
337
|
+
"unitProperty": sUnitPropertyPath && !sDataPropertyPath.includes("/") ? sUnitPropertyPath : false,
|
|
338
|
+
"isValueHelpEnabledForUnit":
|
|
339
|
+
bValueHelpEnabledForUnit && !sUnitPropertyPath.includes("/") ? bValueHelpEnabledForUnit : false,
|
|
326
340
|
"propertyPathForValueHelp": `${sCurrentEntitySetName}/${sDataPropertyPath}`,
|
|
327
341
|
"propertyPathForValueHelpUnit": sUnitPropertyPath && `${sCurrentEntitySetName}/${sUnitPropertyPath}`,
|
|
328
342
|
"isFieldRequired": getRequiredExpression(oPropertyInfo, oDataFieldConverted, true),
|
|
@@ -381,15 +395,17 @@ const MassEditHelper = {
|
|
|
381
395
|
? oResourceBundle.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT")
|
|
382
396
|
: oResourceBundle.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),
|
|
383
397
|
"useValueHelpValue": "< Use Value Help >",
|
|
384
|
-
"cancelButtonText": oResourceBundle.getText("
|
|
398
|
+
"cancelButtonText": oResourceBundle.getText("C_COMMON_OBJECT_PAGE_CANCEL"),
|
|
399
|
+
"noFields": oResourceBundle.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),
|
|
400
|
+
"okButtonText": oResourceBundle.getText("C_COMMON_DIALOG_OK")
|
|
385
401
|
};
|
|
386
402
|
},
|
|
387
403
|
|
|
388
404
|
/**
|
|
389
405
|
* Adds a suffix to the 'keep existing' property of the comboBox.
|
|
390
406
|
*
|
|
391
|
-
* @param
|
|
392
|
-
* @returns
|
|
407
|
+
* @param sInputType InputType of the field
|
|
408
|
+
* @returns The modified string
|
|
393
409
|
*/
|
|
394
410
|
// getSuffixForKeepExisiting: function (sInputType: string) {
|
|
395
411
|
// let sResult = "Values";
|
|
@@ -411,24 +427,23 @@ const MassEditHelper = {
|
|
|
411
427
|
/**
|
|
412
428
|
* Adds default values to the model [Keep Existing Values, Leave Blank].
|
|
413
429
|
*
|
|
414
|
-
* @param
|
|
415
|
-
* @param
|
|
416
|
-
* @param
|
|
417
|
-
* @param
|
|
418
|
-
* @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
|
|
419
434
|
*/
|
|
420
|
-
setDefaultValuesToDialog: function (aValues: any,
|
|
435
|
+
setDefaultValuesToDialog: function (aValues: any, oDefaultValues: any, oPropertyInfo: any, bUOMField?: boolean) {
|
|
421
436
|
const sPropertyPath = bUOMField ? oPropertyInfo.unitProperty : oPropertyInfo.dataProperty,
|
|
422
437
|
sInputType = oPropertyInfo.inputType,
|
|
423
438
|
bPropertyRequired = oPropertyInfo.isFieldRequired;
|
|
424
439
|
// const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
|
|
425
440
|
const sSuffixForKeepExisting = "Values";
|
|
426
441
|
aValues.defaultOptions = aValues.defaultOptions || [];
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
442
|
+
const selectOptionsExist = aValues.selectOptions && aValues.selectOptions.length > 0;
|
|
443
|
+
const keepEntry = {
|
|
444
|
+
text: `${oDefaultValues.keepExistingPrefix} ${sSuffixForKeepExisting} >`,
|
|
445
|
+
key: `Default/${sPropertyPath}`
|
|
446
|
+
};
|
|
432
447
|
|
|
433
448
|
if (sInputType === "CheckBox") {
|
|
434
449
|
const falseEntry = { text: "No", key: `${sPropertyPath}/false`, textInfo: { value: false } };
|
|
@@ -437,43 +452,38 @@ const MassEditHelper = {
|
|
|
437
452
|
aValues.defaultOptions.unshift(falseEntry);
|
|
438
453
|
aValues.unshift(truthyEntry);
|
|
439
454
|
aValues.defaultOptions.unshift(truthyEntry);
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
if (bValueExistsForPropertyPath) {
|
|
455
|
+
aValues.unshift(keepEntry);
|
|
456
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
457
|
+
} else {
|
|
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) {
|
|
450
464
|
if (bPropertyRequired !== "true" && !bUOMField) {
|
|
451
465
|
const clearEntry = { text: oDefaultValues.clearFieldValue, key: `ClearFieldValue/${sPropertyPath}` };
|
|
452
466
|
aValues.unshift(clearEntry);
|
|
453
467
|
aValues.defaultOptions.unshift(clearEntry);
|
|
454
468
|
}
|
|
469
|
+
aValues.unshift(keepEntry);
|
|
470
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
455
471
|
} else {
|
|
456
|
-
const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `
|
|
472
|
+
const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `Default/${sPropertyPath}` };
|
|
457
473
|
aValues.unshift(emptyEntry);
|
|
458
474
|
aValues.defaultOptions.unshift(emptyEntry);
|
|
459
475
|
}
|
|
460
476
|
}
|
|
461
|
-
const keepEntry = {
|
|
462
|
-
text: oDefaultValues.keepExistingPrefix + " " + sSuffixForKeepExisting + " >",
|
|
463
|
-
key: "Default/" + sPropertyPath
|
|
464
|
-
};
|
|
465
|
-
aValues.unshift(keepEntry);
|
|
466
|
-
aValues.defaultOptions.unshift(keepEntry);
|
|
467
477
|
},
|
|
468
478
|
|
|
469
479
|
/**
|
|
470
480
|
* Get text arrangement info for a context property.
|
|
471
481
|
*
|
|
472
|
-
* @param
|
|
473
|
-
* @param
|
|
474
|
-
* @param
|
|
475
|
-
* @param
|
|
476
|
-
* @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
|
|
477
487
|
*/
|
|
478
488
|
getTextArrangementInfo: function (
|
|
479
489
|
property: string,
|
|
@@ -497,15 +507,15 @@ const MassEditHelper = {
|
|
|
497
507
|
case "ValueDescription":
|
|
498
508
|
value = selectedContext.getObject(property) || "";
|
|
499
509
|
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
500
|
-
fullText =
|
|
510
|
+
fullText = descriptionValue ? `${value} (${descriptionValue})` : value;
|
|
501
511
|
break;
|
|
502
512
|
case "DescriptionValue":
|
|
503
513
|
value = selectedContext.getObject(property) || "";
|
|
504
514
|
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
505
|
-
fullText = descriptionValue ? descriptionValue
|
|
515
|
+
fullText = descriptionValue ? `${descriptionValue} (${value})` : value;
|
|
506
516
|
break;
|
|
507
517
|
default:
|
|
508
|
-
Log.info(
|
|
518
|
+
Log.info(`Display Property not applicable: ${property}`);
|
|
509
519
|
break;
|
|
510
520
|
}
|
|
511
521
|
}
|
|
@@ -523,8 +533,8 @@ const MassEditHelper = {
|
|
|
523
533
|
/**
|
|
524
534
|
* Return the visibility valuue for the ManagedObject Any.
|
|
525
535
|
*
|
|
526
|
-
* @param
|
|
527
|
-
* @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.
|
|
528
538
|
*/
|
|
529
539
|
isEditable: function (any: AnyType): boolean {
|
|
530
540
|
const binding = any.getBinding("any");
|
|
@@ -535,25 +545,25 @@ const MassEditHelper = {
|
|
|
535
545
|
/**
|
|
536
546
|
* Calculate and update the visibility of mass edit field on change of the ManagedObject Any binding.
|
|
537
547
|
*
|
|
538
|
-
* @param
|
|
539
|
-
* @param
|
|
548
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
549
|
+
* @param dataProperty Field name.
|
|
540
550
|
*/
|
|
541
551
|
onContextEditableChange: function (oDialogDataModel: JSONModel, dataProperty: string): void {
|
|
542
|
-
const objectsForVisibility = oDialogDataModel.getProperty(
|
|
552
|
+
const objectsForVisibility = oDialogDataModel.getProperty(`/values/${dataProperty}/objectsForVisibility`) || [];
|
|
543
553
|
const editable = objectsForVisibility.some(MassEditHelper.isEditable);
|
|
544
554
|
|
|
545
555
|
if (editable) {
|
|
546
|
-
oDialogDataModel.setProperty(
|
|
556
|
+
oDialogDataModel.setProperty(`/values/${dataProperty}/visible`, editable);
|
|
547
557
|
}
|
|
548
558
|
},
|
|
549
559
|
|
|
550
560
|
/**
|
|
551
561
|
* Update Managed Object Any for visibility of the mass edit fields.
|
|
552
562
|
*
|
|
553
|
-
* @param
|
|
554
|
-
* @param
|
|
555
|
-
* @param
|
|
556
|
-
* @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.
|
|
557
567
|
*/
|
|
558
568
|
updateOnContextChange: function (mOToUse: AnyType, oDialogDataModel: JSONModel, dataProperty: string, values: any) {
|
|
559
569
|
const binding = mOToUse.getBinding("any");
|
|
@@ -567,11 +577,11 @@ const MassEditHelper = {
|
|
|
567
577
|
/**
|
|
568
578
|
* Get bound object to calculate the visibility of contexts.
|
|
569
579
|
*
|
|
570
|
-
* @param
|
|
571
|
-
* @param
|
|
572
|
-
* @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.
|
|
573
583
|
*/
|
|
574
|
-
getBoundObject: function (expBinding:
|
|
584
|
+
getBoundObject: function (expBinding: CompiledBindingToolkitExpression, context: Context): AnyType {
|
|
575
585
|
const mOToUse = new Any({ any: expBinding });
|
|
576
586
|
const model = context.getModel();
|
|
577
587
|
mOToUse.setModel(model);
|
|
@@ -583,15 +593,15 @@ const MassEditHelper = {
|
|
|
583
593
|
/**
|
|
584
594
|
* Get the visibility of the field.
|
|
585
595
|
*
|
|
586
|
-
* @param
|
|
587
|
-
* @param
|
|
588
|
-
* @param
|
|
589
|
-
* @param
|
|
590
|
-
* @param
|
|
591
|
-
* @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.
|
|
592
602
|
*/
|
|
593
603
|
getFieldVisiblity: function (
|
|
594
|
-
expBinding:
|
|
604
|
+
expBinding: CompiledBindingToolkitExpression,
|
|
595
605
|
oDialogDataModel: JSONModel,
|
|
596
606
|
dataProperty: string,
|
|
597
607
|
values: any,
|
|
@@ -611,11 +621,11 @@ const MassEditHelper = {
|
|
|
611
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.)
|
|
612
622
|
* => The model will capture runtime changes in the results property (the value entered in the comboBox).
|
|
613
623
|
*
|
|
614
|
-
* @param
|
|
615
|
-
* @param
|
|
616
|
-
* @param
|
|
617
|
-
* @param
|
|
618
|
-
* @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
|
|
619
629
|
*/
|
|
620
630
|
setRuntimeModelOnDialog: function (aContexts: any[], aDataArray: any[], oDefaultValues: any, dialogContext: Context) {
|
|
621
631
|
const aValues: any[] = [];
|
|
@@ -627,27 +637,28 @@ const MassEditHelper = {
|
|
|
627
637
|
"unitData": aUnitData,
|
|
628
638
|
"results": aResults,
|
|
629
639
|
"readablePropertyData": aReadOnlyFieldInfo,
|
|
630
|
-
"selectedKey": undefined
|
|
640
|
+
"selectedKey": undefined,
|
|
641
|
+
"noFields": oDefaultValues.noFields
|
|
631
642
|
};
|
|
632
643
|
const oDialogDataModel = new JSONModel(oData);
|
|
633
|
-
aDataArray.forEach(function (
|
|
644
|
+
aDataArray.forEach(function (oInData: any) {
|
|
634
645
|
let oTextInfo;
|
|
635
646
|
let sPropertyKey;
|
|
636
647
|
let sUnitPropertyName;
|
|
637
648
|
const oDistinctValueMap: any = {};
|
|
638
649
|
const oDistinctUnitMap: any = {};
|
|
639
|
-
if (
|
|
640
|
-
const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(
|
|
641
|
-
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("/");
|
|
642
653
|
|
|
643
654
|
for (const context of aContexts) {
|
|
644
|
-
const sMultiLevelPathValue = context.getObject(
|
|
645
|
-
sPropertyKey =
|
|
655
|
+
const sMultiLevelPathValue = context.getObject(oInData.dataProperty);
|
|
656
|
+
sPropertyKey = `${oInData.dataProperty}/${sMultiLevelPathValue}`;
|
|
646
657
|
if (!oDistinctValueMap[sPropertyKey] && aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]]) {
|
|
647
658
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
659
|
+
oInData.dataProperty,
|
|
660
|
+
oInData.descriptionPath,
|
|
661
|
+
oInData.display,
|
|
651
662
|
context
|
|
652
663
|
);
|
|
653
664
|
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].push({
|
|
@@ -663,157 +674,166 @@ const MassEditHelper = {
|
|
|
663
674
|
// }
|
|
664
675
|
|
|
665
676
|
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].textInfo = {
|
|
666
|
-
descriptionPath:
|
|
667
|
-
valuePath:
|
|
668
|
-
displayMode:
|
|
677
|
+
descriptionPath: oInData.descriptionPath,
|
|
678
|
+
valuePath: oInData.dataProperty,
|
|
679
|
+
displayMode: oInData.display
|
|
669
680
|
};
|
|
670
681
|
} else {
|
|
671
|
-
aValues[
|
|
672
|
-
aValues[
|
|
673
|
-
if (
|
|
674
|
-
aUnitData[
|
|
675
|
-
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"] || [];
|
|
676
687
|
}
|
|
677
688
|
for (const context of aContexts) {
|
|
678
689
|
const oDataObject = context.getObject();
|
|
679
|
-
sPropertyKey =
|
|
680
|
-
if (
|
|
681
|
-
if (
|
|
690
|
+
sPropertyKey = `${oInData.dataProperty}/${oDataObject[oInData.dataProperty]}`;
|
|
691
|
+
if (oInData.dataProperty && oDataObject[oInData.dataProperty] && !oDistinctValueMap[sPropertyKey]) {
|
|
692
|
+
if (oInData.inputType != "CheckBox") {
|
|
682
693
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
694
|
+
oInData.dataProperty,
|
|
695
|
+
oInData.descriptionPath,
|
|
696
|
+
oInData.display,
|
|
686
697
|
context
|
|
687
698
|
);
|
|
688
699
|
const entry = {
|
|
689
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[
|
|
700
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.dataProperty],
|
|
690
701
|
"key": sPropertyKey,
|
|
691
702
|
"textInfo": oTextInfo
|
|
692
703
|
};
|
|
693
|
-
aValues[
|
|
694
|
-
aValues[
|
|
704
|
+
aValues[oInData.dataProperty].push(entry);
|
|
705
|
+
aValues[oInData.dataProperty]["selectOptions"].push(entry);
|
|
695
706
|
}
|
|
696
|
-
oDistinctValueMap[sPropertyKey] = oDataObject[
|
|
707
|
+
oDistinctValueMap[sPropertyKey] = oDataObject[oInData.dataProperty];
|
|
697
708
|
}
|
|
698
|
-
if (
|
|
699
|
-
sUnitPropertyName =
|
|
709
|
+
if (oInData.unitProperty && oDataObject[oInData.unitProperty]) {
|
|
710
|
+
sUnitPropertyName = `${oInData.unitProperty}/${oDataObject[oInData.unitProperty]}`;
|
|
700
711
|
if (!oDistinctUnitMap[sUnitPropertyName]) {
|
|
701
|
-
if (
|
|
712
|
+
if (oInData.inputType != "CheckBox") {
|
|
702
713
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
714
|
+
oInData.unitProperty,
|
|
715
|
+
oInData.descriptionPath,
|
|
716
|
+
oInData.display,
|
|
706
717
|
context
|
|
707
718
|
);
|
|
708
719
|
const unitEntry = {
|
|
709
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[
|
|
720
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.unitProperty],
|
|
710
721
|
"key": sUnitPropertyName,
|
|
711
722
|
"textInfo": oTextInfo
|
|
712
723
|
};
|
|
713
|
-
aUnitData[
|
|
714
|
-
aUnitData[
|
|
724
|
+
aUnitData[oInData.unitProperty].push(unitEntry);
|
|
725
|
+
aUnitData[oInData.unitProperty]["selectOptions"].push(unitEntry);
|
|
715
726
|
}
|
|
716
|
-
oDistinctUnitMap[sUnitPropertyName] = oDataObject[
|
|
727
|
+
oDistinctUnitMap[sUnitPropertyName] = oDataObject[oInData.unitProperty];
|
|
717
728
|
}
|
|
718
729
|
}
|
|
719
730
|
}
|
|
720
|
-
aValues[
|
|
721
|
-
descriptionPath:
|
|
722
|
-
valuePath:
|
|
723
|
-
displayMode:
|
|
731
|
+
aValues[oInData.dataProperty].textInfo = {
|
|
732
|
+
descriptionPath: oInData.descriptionPath,
|
|
733
|
+
valuePath: oInData.dataProperty,
|
|
734
|
+
displayMode: oInData.display
|
|
724
735
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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
|
+
}
|
|
731
742
|
}
|
|
732
743
|
});
|
|
733
|
-
aDataArray.forEach(function (
|
|
744
|
+
aDataArray.forEach(function (oInData: any) {
|
|
734
745
|
let values: any = {};
|
|
735
|
-
if (
|
|
736
|
-
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(
|
|
746
|
+
if (oInData.dataProperty.indexOf("/") > -1) {
|
|
747
|
+
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(oInData.dataProperty, aValues);
|
|
737
748
|
if (!sMultiLevelPropPathValue) {
|
|
738
|
-
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key:
|
|
749
|
+
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
739
750
|
} else {
|
|
740
|
-
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue,
|
|
751
|
+
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue, oDefaultValues, oInData);
|
|
741
752
|
}
|
|
742
753
|
values = sMultiLevelPropPathValue;
|
|
743
|
-
} else if (aValues[
|
|
744
|
-
aValues[
|
|
745
|
-
MassEditHelper.setDefaultValuesToDialog(aValues[
|
|
746
|
-
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];
|
|
747
758
|
}
|
|
748
759
|
|
|
749
|
-
if (aUnitData[
|
|
750
|
-
MassEditHelper.setDefaultValuesToDialog(aUnitData[
|
|
751
|
-
aUnitData[
|
|
752
|
-
aUnitData[
|
|
753
|
-
|
|
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;
|
|
754
768
|
} else if (
|
|
755
|
-
(
|
|
756
|
-
(
|
|
769
|
+
(oInData.dataProperty && aValues[oInData.dataProperty] && !aValues[oInData.dataProperty].length) ||
|
|
770
|
+
(oInData.unitProperty && aUnitData[oInData.unitProperty] && !aUnitData[oInData.unitProperty].length)
|
|
757
771
|
) {
|
|
758
772
|
const bClearFieldOrBlankValueExists =
|
|
759
|
-
aValues[
|
|
760
|
-
aValues[
|
|
773
|
+
aValues[oInData.dataProperty] &&
|
|
774
|
+
aValues[oInData.dataProperty].some(function (obj: any) {
|
|
761
775
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
762
776
|
});
|
|
763
|
-
if (
|
|
764
|
-
aValues[
|
|
777
|
+
if (oInData.dataProperty && !bClearFieldOrBlankValueExists) {
|
|
778
|
+
aValues[oInData.dataProperty].push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
765
779
|
}
|
|
766
780
|
const bClearFieldOrBlankUnitValueExists =
|
|
767
|
-
aUnitData[
|
|
768
|
-
aUnitData[
|
|
781
|
+
aUnitData[oInData.unitProperty] &&
|
|
782
|
+
aUnitData[oInData.unitProperty].some(function (obj: any) {
|
|
769
783
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
770
784
|
});
|
|
771
|
-
if (
|
|
785
|
+
if (oInData.unitProperty) {
|
|
772
786
|
if (!bClearFieldOrBlankUnitValueExists) {
|
|
773
|
-
aUnitData[
|
|
787
|
+
aUnitData[oInData.unitProperty].push({
|
|
774
788
|
text: oDefaultValues.leaveBlankValue,
|
|
775
|
-
key:
|
|
789
|
+
key: `Empty/${oInData.unitProperty}`
|
|
776
790
|
});
|
|
777
791
|
}
|
|
778
|
-
aUnitData[
|
|
779
|
-
aUnitData[
|
|
792
|
+
aUnitData[oInData.unitProperty].textInfo = {};
|
|
793
|
+
aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
|
|
780
794
|
aContexts,
|
|
781
|
-
|
|
795
|
+
oInData.unitProperty
|
|
782
796
|
);
|
|
783
|
-
aUnitData[
|
|
797
|
+
aUnitData[oInData.unitProperty].inputType = oInData.inputType;
|
|
784
798
|
}
|
|
785
799
|
}
|
|
786
|
-
if (
|
|
787
|
-
aReadOnlyFieldInfo.push({ "property":
|
|
800
|
+
if (oInData.isPropertyReadOnly && typeof oInData.isPropertyReadOnly === "boolean") {
|
|
801
|
+
aReadOnlyFieldInfo.push({ "property": oInData.dataProperty, value: oInData.isPropertyReadOnly, type: "Default" });
|
|
788
802
|
} else if (
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
803
|
+
oInData.isPropertyReadOnly &&
|
|
804
|
+
oInData.isPropertyReadOnly.operands &&
|
|
805
|
+
oInData.isPropertyReadOnly.operands[0] &&
|
|
806
|
+
oInData.isPropertyReadOnly.operands[0].operand1 &&
|
|
807
|
+
oInData.isPropertyReadOnly.operands[0].operand2
|
|
794
808
|
) {
|
|
795
809
|
// This needs to be refactored in accordance with the ReadOnlyExpression change
|
|
796
810
|
aReadOnlyFieldInfo.push({
|
|
797
|
-
"property":
|
|
798
|
-
propertyPath:
|
|
799
|
-
propertyValue:
|
|
811
|
+
"property": oInData.dataProperty,
|
|
812
|
+
propertyPath: oInData.isPropertyReadOnly.operands[0].operand1.path,
|
|
813
|
+
propertyValue: oInData.isPropertyReadOnly.operands[0].operand2.value,
|
|
800
814
|
type: "Path"
|
|
801
815
|
});
|
|
802
816
|
}
|
|
803
817
|
|
|
804
818
|
// Setting visbility of the mass edit field.
|
|
805
|
-
if (
|
|
819
|
+
if (oInData.editMode) {
|
|
806
820
|
values.visible =
|
|
807
|
-
|
|
821
|
+
oInData.editMode === EditMode.Editable ||
|
|
808
822
|
aContexts.some(
|
|
809
|
-
MassEditHelper.getFieldVisiblity.bind(
|
|
823
|
+
MassEditHelper.getFieldVisiblity.bind(
|
|
824
|
+
MassEditHelper,
|
|
825
|
+
oInData.editMode,
|
|
826
|
+
oDialogDataModel,
|
|
827
|
+
oInData.dataProperty,
|
|
828
|
+
values
|
|
829
|
+
)
|
|
810
830
|
);
|
|
811
831
|
} else {
|
|
812
832
|
values.visible = true;
|
|
813
833
|
}
|
|
814
|
-
values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts,
|
|
815
|
-
values.inputType =
|
|
816
|
-
values.unitProperty =
|
|
834
|
+
values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oInData.dataProperty);
|
|
835
|
+
values.inputType = oInData.inputType;
|
|
836
|
+
values.unitProperty = oInData.unitProperty;
|
|
817
837
|
});
|
|
818
838
|
|
|
819
839
|
return oDialogDataModel;
|
|
@@ -821,9 +841,9 @@ const MassEditHelper = {
|
|
|
821
841
|
/**
|
|
822
842
|
* Gets transient context for dialog.
|
|
823
843
|
*
|
|
824
|
-
* @param
|
|
825
|
-
* @param
|
|
826
|
-
* @returns
|
|
844
|
+
* @param table Instance of Table.
|
|
845
|
+
* @param dialog Mass Edit Dialog.
|
|
846
|
+
* @returns Promise returning instance of dialog.
|
|
827
847
|
*/
|
|
828
848
|
getDialogContext: function (table: Table, dialog?: Dialog): Context {
|
|
829
849
|
let transCtx: Context = (dialog && dialog.getBindingContext()) as Context;
|
|
@@ -852,12 +872,12 @@ const MassEditHelper = {
|
|
|
852
872
|
/**
|
|
853
873
|
* Create the mass edit dialog.
|
|
854
874
|
*
|
|
855
|
-
* @param
|
|
856
|
-
* @param
|
|
857
|
-
* @param
|
|
858
|
-
* @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.
|
|
859
879
|
*/
|
|
860
|
-
createDialog: function (oTable: Table, aContexts: any[], oController: PageController) {
|
|
880
|
+
createDialog: async function (oTable: Table, aContexts: any[], oController: PageController): Promise<any> {
|
|
861
881
|
const sFragmentName = "sap/fe/core/controls/massEdit/MassEditDialog",
|
|
862
882
|
aDataArray: any[] = [],
|
|
863
883
|
oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
|
|
@@ -866,159 +886,159 @@ const MassEditHelper = {
|
|
|
866
886
|
dialogContext = MassEditHelper.getDialogContext(oTable),
|
|
867
887
|
oDialogDataModel = MassEditHelper.setRuntimeModelOnDialog(aContexts, aDataArray, oDefaultValues, dialogContext);
|
|
868
888
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
{
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
dataFieldModel: oDataFieldModel
|
|
881
|
-
}
|
|
889
|
+
const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
890
|
+
const oCreatedFragment = await Promise.resolve(
|
|
891
|
+
XMLPreprocessor.process(
|
|
892
|
+
oFragment,
|
|
893
|
+
{ name: sFragmentName },
|
|
894
|
+
{
|
|
895
|
+
bindingContexts: {
|
|
896
|
+
dataFieldModel: oDataFieldModel.createBindingContext("/")
|
|
897
|
+
},
|
|
898
|
+
models: {
|
|
899
|
+
dataFieldModel: oDataFieldModel
|
|
882
900
|
}
|
|
883
|
-
|
|
901
|
+
}
|
|
884
902
|
)
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
.catch(function (oError: any) {
|
|
942
|
-
errorValues.push(oSelectedContext.getObject());
|
|
943
|
-
Log.error("Mass Edit: Something went wrong in updating entries.", oError);
|
|
944
|
-
})
|
|
945
|
-
);
|
|
946
|
-
}
|
|
947
|
-
});
|
|
948
|
-
});
|
|
949
|
-
|
|
950
|
-
(Promise as any).allSettled(changePromise).then(function () {
|
|
951
|
-
const oListBinding = oTable.getRowBinding();
|
|
952
|
-
const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
|
|
953
|
-
return oExtensionAPI.refresh(oListBinding.getPath()).then(function () {
|
|
954
|
-
let subtitleColumn = CommonUtils.getMessageColumn(oTable);
|
|
955
|
-
let messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
|
|
956
|
-
let boundTransitionErrorContexts = [] as any;
|
|
957
|
-
messages.forEach(function (message: any, idx: any) {
|
|
958
|
-
const messageTargets = message.getTargets();
|
|
959
|
-
if (
|
|
960
|
-
messageTargets &&
|
|
961
|
-
messageTargets.length === 1 &&
|
|
962
|
-
messageTargets[0].length &&
|
|
963
|
-
message.persistent === true
|
|
964
|
-
) {
|
|
965
|
-
let boundTransitionErrorContext = aContexts.find(function (oContext: any) {
|
|
966
|
-
return message.getTarget().indexOf(oContext.getPath()) !== -1;
|
|
967
|
-
});
|
|
968
|
-
boundTransitionErrorContexts.push(boundTransitionErrorContext);
|
|
969
|
-
message.additionalText = boundTransitionErrorContext
|
|
970
|
-
? boundTransitionErrorContext.getObject()[subtitleColumn]
|
|
971
|
-
: undefined;
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
if (boundTransitionErrorContexts.length === 0 && errorValues.length === 0) {
|
|
975
|
-
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
976
|
-
const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
|
|
977
|
-
MessageToast.show(successToast);
|
|
978
|
-
} else {
|
|
979
|
-
if (
|
|
980
|
-
errorValues.length + boundTransitionErrorContexts.length <
|
|
981
|
-
(oTable as any).getSelectedContexts().length
|
|
982
|
-
) {
|
|
983
|
-
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
984
|
-
} else if (
|
|
985
|
-
errorValues.length + boundTransitionErrorContexts.length ===
|
|
986
|
-
(oTable as any).getSelectedContexts().length
|
|
987
|
-
) {
|
|
988
|
-
oController._editFlow.setDraftStatus(DraftStatus.Clear);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
oController._editFlow.getMessageHandler().showMessages();
|
|
992
|
-
if (oDialog.isOpen()) {
|
|
993
|
-
oDialog.close();
|
|
994
|
-
oDialog.destroy();
|
|
995
|
-
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
996
|
-
"skipPatchHandlers",
|
|
997
|
-
false
|
|
998
|
-
);
|
|
999
|
-
}
|
|
1000
|
-
});
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
}),
|
|
1004
|
-
endButton: new Button({
|
|
1005
|
-
text: oDefaultValues.cancelButtonText,
|
|
1006
|
-
press: function (oEvent: any) {
|
|
1007
|
-
const oDialog = oEvent.getSource().getParent();
|
|
1008
|
-
oDialog.close();
|
|
1009
|
-
oDialog.destroy();
|
|
1010
|
-
}
|
|
1011
|
-
})
|
|
903
|
+
);
|
|
904
|
+
const oDialogContent = await Fragment.load({ definition: oCreatedFragment });
|
|
905
|
+
const DraftStatus = FELibrary.DraftStatus;
|
|
906
|
+
const oDialog = new Dialog({
|
|
907
|
+
resizable: true,
|
|
908
|
+
title: oDefaultValues.massEditTitle,
|
|
909
|
+
content: [oDialogContent as any],
|
|
910
|
+
afterOpen: MassEditHelper.onDialogOpen,
|
|
911
|
+
beginButton: new Button({
|
|
912
|
+
text: MassEditHelper.helpers.getExpBindingForApplyButtonTxt(oDefaultValues, oDataFieldModel.getObject("/")),
|
|
913
|
+
type: "Emphasized",
|
|
914
|
+
press: async function (oEvent: any) {
|
|
915
|
+
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty("skipPatchHandlers", true);
|
|
916
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
917
|
+
const oModel = oInDialog.getModel("fieldsInfo");
|
|
918
|
+
const aResults = oModel.getProperty("/results");
|
|
919
|
+
const aPropertyReadableInfo = oModel.getProperty("/readablePropertyData");
|
|
920
|
+
const changePromise: any[] = [];
|
|
921
|
+
let bReadOnlyField = false;
|
|
922
|
+
let groupId;
|
|
923
|
+
const errorValues: any[] = [];
|
|
924
|
+
aContexts.forEach(function (oSelectedContext: any, idx: number) {
|
|
925
|
+
aResults.forEach(function (oResult: any) {
|
|
926
|
+
//TODO - Add save implementation for Value Help.
|
|
927
|
+
if (aPropertyReadableInfo) {
|
|
928
|
+
bReadOnlyField = aPropertyReadableInfo.some(function (oPropertyInfo: any) {
|
|
929
|
+
if (oResult.keyValue === oPropertyInfo.property) {
|
|
930
|
+
if (oPropertyInfo.type === "Default") {
|
|
931
|
+
return oPropertyInfo.value === true;
|
|
932
|
+
} else if (
|
|
933
|
+
oPropertyInfo.type === "Path" &&
|
|
934
|
+
oPropertyInfo.propertyValue &&
|
|
935
|
+
oPropertyInfo.propertyPath
|
|
936
|
+
) {
|
|
937
|
+
return oSelectedContext.getObject(oPropertyInfo.propertyPath) === oPropertyInfo.propertyValue;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
groupId = `$auto.${idx}`;
|
|
943
|
+
//index += 1;
|
|
944
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saving);
|
|
945
|
+
//let promiseCount = 0;
|
|
946
|
+
if (oResult.keyValue && oResult.value !== "Default" && !bReadOnlyField) {
|
|
947
|
+
changePromise.push(
|
|
948
|
+
oSelectedContext
|
|
949
|
+
.setProperty(oResult.keyValue, oResult.value, groupId)
|
|
950
|
+
.then(function () {
|
|
951
|
+
return oSelectedContext;
|
|
952
|
+
})
|
|
953
|
+
.catch(function (oError: any) {
|
|
954
|
+
errorValues.push(oSelectedContext.getObject());
|
|
955
|
+
Log.error("Mass Edit: Something went wrong in updating entries.", oError);
|
|
956
|
+
})
|
|
957
|
+
);
|
|
958
|
+
}
|
|
1012
959
|
});
|
|
1013
|
-
const model = oTable.getModel();
|
|
1014
|
-
oDialog.setModel(oDialogDataModel, "fieldsInfo");
|
|
1015
|
-
oDialog.setModel(model);
|
|
1016
|
-
oDialog.setBindingContext(dialogContext);
|
|
1017
|
-
resolve(oDialog);
|
|
1018
960
|
});
|
|
1019
|
-
|
|
1020
|
-
|
|
961
|
+
|
|
962
|
+
await (Promise as any).allSettled(changePromise);
|
|
963
|
+
|
|
964
|
+
const oListBinding = oTable.getRowBinding();
|
|
965
|
+
const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
|
|
966
|
+
await oExtensionAPI.refresh(oListBinding.getPath());
|
|
967
|
+
|
|
968
|
+
const subtitleColumn = CommonUtils.getMessageColumn(oTable);
|
|
969
|
+
const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
|
|
970
|
+
const boundTransitionErrorContexts = [] as any;
|
|
971
|
+
messages.forEach(function (message: any) {
|
|
972
|
+
const messageTargets = message.getTargets();
|
|
973
|
+
if (messageTargets && messageTargets.length === 1 && messageTargets[0].length && message.persistent === true) {
|
|
974
|
+
const boundTransitionErrorContext = aContexts.find(function (oContext: any) {
|
|
975
|
+
return message.getTarget().indexOf(oContext.getPath()) !== -1;
|
|
976
|
+
});
|
|
977
|
+
boundTransitionErrorContexts.push(boundTransitionErrorContext);
|
|
978
|
+
message.additionalText = boundTransitionErrorContext
|
|
979
|
+
? boundTransitionErrorContext.getObject()[subtitleColumn]
|
|
980
|
+
: undefined;
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
if (aResults.length > 0 && boundTransitionErrorContexts.length === 0 && errorValues.length === 0) {
|
|
984
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
985
|
+
const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
|
|
986
|
+
MessageToast.show(successToast);
|
|
987
|
+
} else if (errorValues.length + boundTransitionErrorContexts.length < (oTable as any).getSelectedContexts().length) {
|
|
988
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
989
|
+
} else if (errorValues.length + boundTransitionErrorContexts.length === (oTable as any).getSelectedContexts().length) {
|
|
990
|
+
oController._editFlow.setDraftStatus(DraftStatus.Clear);
|
|
991
|
+
}
|
|
992
|
+
oController._editFlow.getMessageHandler().showMessages();
|
|
993
|
+
if (oInDialog.isOpen()) {
|
|
994
|
+
oInDialog.close();
|
|
995
|
+
oInDialog.destroy();
|
|
996
|
+
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
997
|
+
"skipPatchHandlers",
|
|
998
|
+
false
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}),
|
|
1003
|
+
endButton: new Button({
|
|
1004
|
+
text: oDefaultValues.cancelButtonText,
|
|
1005
|
+
visible: MassEditHelper.helpers.hasEditableFieldsBinding(oDataFieldModel.getObject("/"), true) as any,
|
|
1006
|
+
press: function (oEvent: any) {
|
|
1007
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
1008
|
+
oInDialog.close();
|
|
1009
|
+
oInDialog.destroy();
|
|
1010
|
+
}
|
|
1011
|
+
})
|
|
1021
1012
|
});
|
|
1013
|
+
const model = oTable.getModel();
|
|
1014
|
+
oDialog.setModel(oDialogDataModel, "fieldsInfo");
|
|
1015
|
+
oDialog.setModel(model);
|
|
1016
|
+
oDialog.setBindingContext(dialogContext);
|
|
1017
|
+
return oDialog;
|
|
1018
|
+
},
|
|
1019
|
+
|
|
1020
|
+
helpers: {
|
|
1021
|
+
getBindingExpForHasEditableFields: (fields: any, editable: boolean) => {
|
|
1022
|
+
const totalExp = fields.reduce(
|
|
1023
|
+
(expression: any, field: any) =>
|
|
1024
|
+
or(
|
|
1025
|
+
expression,
|
|
1026
|
+
pathInModel("/values/" + field.dataProperty + "/visible", "fieldsInfo") as BindingToolkitExpression<boolean>
|
|
1027
|
+
),
|
|
1028
|
+
constant(false)
|
|
1029
|
+
);
|
|
1030
|
+
return editable ? totalExp : not(totalExp);
|
|
1031
|
+
},
|
|
1032
|
+
|
|
1033
|
+
getExpBindingForApplyButtonTxt: (defaultValues: any, fields: boolean) => {
|
|
1034
|
+
const editableExp = MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, true);
|
|
1035
|
+
const totalExp = ifElse(editableExp, constant(defaultValues.applyButtonText), constant(defaultValues.okButtonText));
|
|
1036
|
+
return compileExpression(totalExp);
|
|
1037
|
+
},
|
|
1038
|
+
|
|
1039
|
+
hasEditableFieldsBinding: (fields: any, editable: boolean) => {
|
|
1040
|
+
return compileExpression(MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, editable));
|
|
1041
|
+
}
|
|
1022
1042
|
}
|
|
1023
1043
|
};
|
|
1024
1044
|
|