@sapui5/sap.fe.core 1.97.0 → 1.100.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 +7 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +309 -405
- package/src/sap/fe/core/AnnotationHelper.ts +315 -0
- package/src/sap/fe/core/AppComponent.js +389 -397
- package/src/sap/fe/core/AppComponent.ts +403 -0
- package/src/sap/fe/core/AppStateHandler.js +198 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +83 -58
- package/src/sap/fe/core/BaseController.ts +68 -0
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2164 -2379
- package/src/sap/fe/core/CommonUtils.ts +2177 -0
- package/src/sap/fe/core/ExtensionAPI.js +279 -266
- package/src/sap/fe/core/ExtensionAPI.ts +250 -0
- package/src/sap/fe/core/PageController.js +218 -125
- package/src/sap/fe/core/PageController.ts +129 -0
- package/src/sap/fe/core/RouterProxy.js +924 -807
- package/src/sap/fe/core/RouterProxy.ts +840 -0
- package/src/sap/fe/core/Synchronization.js +41 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +173 -0
- package/src/sap/fe/core/TemplateModel.js +79 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1560 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1717 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +521 -581
- package/src/sap/fe/core/actions/draft.ts +566 -0
- package/src/sap/fe/core/actions/messageHandling.js +564 -511
- package/src/sap/fe/core/actions/messageHandling.ts +552 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1093 -1211
- package/src/sap/fe/core/actions/operations.ts +1192 -0
- package/src/sap/fe/core/actions/sticky.js +114 -104
- package/src/sap/fe/core/actions/sticky.ts +119 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +70 -66
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
- package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
- package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
- package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
- package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
- package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +220 -244
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
- package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/CommandExecution.js +68 -66
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
- package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
- package/src/sap/fe/core/controls/FilterBar.js +163 -159
- package/src/sap/fe/core/controls/FilterBar.ts +143 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
- package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -367
- package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
- package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
- package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
- package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
- package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +21 -11
- package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
- package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
- package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +51 -54
- package/src/sap/fe/core/fpm/Component.ts +48 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
- package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
- package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
- package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
- package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +250 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +427 -425
- package/src/sap/fe/core/library.support.js +23 -27
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
- package/src/sap/fe/core/messagebundle.properties +78 -13
- package/src/sap/fe/core/messagebundle_ar.properties +58 -7
- package/src/sap/fe/core/messagebundle_bg.properties +58 -7
- package/src/sap/fe/core/messagebundle_ca.properties +58 -7
- package/src/sap/fe/core/messagebundle_cs.properties +59 -8
- package/src/sap/fe/core/messagebundle_cy.properties +58 -7
- package/src/sap/fe/core/messagebundle_da.properties +58 -7
- package/src/sap/fe/core/messagebundle_de.properties +58 -7
- package/src/sap/fe/core/messagebundle_el.properties +58 -7
- package/src/sap/fe/core/messagebundle_en.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
- package/src/sap/fe/core/messagebundle_es.properties +58 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
- package/src/sap/fe/core/messagebundle_et.properties +58 -7
- package/src/sap/fe/core/messagebundle_fi.properties +60 -9
- package/src/sap/fe/core/messagebundle_fr.properties +64 -13
- package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
- package/src/sap/fe/core/messagebundle_hi.properties +58 -7
- package/src/sap/fe/core/messagebundle_hr.properties +58 -7
- package/src/sap/fe/core/messagebundle_hu.properties +59 -8
- package/src/sap/fe/core/messagebundle_id.properties +61 -10
- package/src/sap/fe/core/messagebundle_it.properties +58 -7
- package/src/sap/fe/core/messagebundle_iw.properties +58 -7
- package/src/sap/fe/core/messagebundle_ja.properties +58 -7
- package/src/sap/fe/core/messagebundle_kk.properties +58 -7
- package/src/sap/fe/core/messagebundle_ko.properties +58 -7
- package/src/sap/fe/core/messagebundle_lt.properties +58 -7
- package/src/sap/fe/core/messagebundle_lv.properties +59 -8
- package/src/sap/fe/core/messagebundle_ms.properties +58 -7
- package/src/sap/fe/core/messagebundle_nl.properties +58 -7
- package/src/sap/fe/core/messagebundle_no.properties +58 -7
- package/src/sap/fe/core/messagebundle_pl.properties +58 -7
- package/src/sap/fe/core/messagebundle_pt.properties +59 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
- package/src/sap/fe/core/messagebundle_ro.properties +58 -7
- package/src/sap/fe/core/messagebundle_ru.properties +58 -7
- package/src/sap/fe/core/messagebundle_sh.properties +58 -7
- package/src/sap/fe/core/messagebundle_sk.properties +58 -7
- package/src/sap/fe/core/messagebundle_sl.properties +58 -7
- package/src/sap/fe/core/messagebundle_sv.properties +59 -8
- package/src/sap/fe/core/messagebundle_th.properties +58 -7
- package/src/sap/fe/core/messagebundle_tr.properties +60 -9
- package/src/sap/fe/core/messagebundle_uk.properties +58 -7
- package/src/sap/fe/core/messagebundle_vi.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
- package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -1
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +97 -127
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +140 -78
- package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
- package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters.js +76 -135
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
2
|
+
import Condition from "sap/ui/mdc/condition/Condition";
|
|
3
|
+
import Log from "sap/base/Log";
|
|
4
|
+
import View from "sap/ui/core/mvc/View";
|
|
5
|
+
import Title from "sap/m/Title";
|
|
6
|
+
import NumberFormat from "sap/ui/core/format/NumberFormat";
|
|
7
|
+
import Context from "sap/ui/model/Context";
|
|
8
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
9
|
+
import ConditionValidated from "sap/ui/mdc/enum/ConditionValidated";
|
|
10
|
+
import { getOperator, getTypeCompliantValue } from "sap/fe/core/templating/FilterHelper";
|
|
11
|
+
import DateTimeOffset from "sap/ui/model/odata/type/DateTimeOffset";
|
|
12
|
+
|
|
13
|
+
const VisualFilterUtils = {
|
|
14
|
+
/**
|
|
15
|
+
* Applies the median scale to the chart data.
|
|
16
|
+
*
|
|
17
|
+
* @param {object} oInteractiveChart InteractiveChart in the VisualFilter control
|
|
18
|
+
* @param {object} oView Instance of the view
|
|
19
|
+
* @param {object} sVFId VisualFilter control ID
|
|
20
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
21
|
+
*/
|
|
22
|
+
applyMedianScaleToChartData: function(oInteractiveChart: any, oView: View, sVFId: object, sInfoPath: string) {
|
|
23
|
+
const oData = [];
|
|
24
|
+
const sMeasure = oInteractiveChart.data("measure");
|
|
25
|
+
const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
|
|
26
|
+
const aAggregation =
|
|
27
|
+
(oInteractiveChart.getPoints && oInteractiveChart.getPoints()) ||
|
|
28
|
+
(oInteractiveChart.getBars && oInteractiveChart.getBars()) ||
|
|
29
|
+
(oInteractiveChart.getSegments && oInteractiveChart.getSegments());
|
|
30
|
+
for (let i = 0; i < aAggregation.length; i++) {
|
|
31
|
+
oData.push(aAggregation[i].getBindingContext().getObject());
|
|
32
|
+
}
|
|
33
|
+
const scaleFactor = this._getMedianScaleFactor(oData, sMeasure);
|
|
34
|
+
if (scaleFactor && scaleFactor.iShortRefNumber && scaleFactor.scale) {
|
|
35
|
+
oInternalModelContext.setProperty("scalefactor/" + sInfoPath, scaleFactor.scale);
|
|
36
|
+
oInternalModelContext.setProperty("scalefactorNumber/" + sInfoPath, scaleFactor.iShortRefNumber);
|
|
37
|
+
} else {
|
|
38
|
+
oInternalModelContext.setProperty("scalefactor/" + sInfoPath, "");
|
|
39
|
+
oInternalModelContext.setProperty("scalefactorNumber/" + sInfoPath, "");
|
|
40
|
+
const oScaleTitle = oView.byId(sVFId + "::ScaleUoMTitle") as Title;
|
|
41
|
+
const oMeasureDimensionTitle = oView.byId(sVFId + "::MeasureDimensionTitle") as Title;
|
|
42
|
+
const sText = oScaleTitle.getText();
|
|
43
|
+
if (sText === " | ") {
|
|
44
|
+
oScaleTitle.setVisible(false);
|
|
45
|
+
oMeasureDimensionTitle.setTooltip(oMeasureDimensionTitle.getText());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns the median scale factor.
|
|
52
|
+
*
|
|
53
|
+
* @param {object} oData VisualFilter data
|
|
54
|
+
* @param {string} sMeasureField Path of the measure
|
|
55
|
+
* @returns {object} Object containing scale and iShortRefNumber
|
|
56
|
+
*/
|
|
57
|
+
_getMedianScaleFactor: function(oData: any[], sMeasureField: string) {
|
|
58
|
+
let i;
|
|
59
|
+
let scaleFactor;
|
|
60
|
+
oData.sort(function(a: any, b: any) {
|
|
61
|
+
if (Number(a[sMeasureField]) < Number(b[sMeasureField])) {
|
|
62
|
+
return -1;
|
|
63
|
+
}
|
|
64
|
+
if (Number(a[sMeasureField]) > Number(b[sMeasureField])) {
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
return 0;
|
|
68
|
+
});
|
|
69
|
+
if (oData.length > 0) {
|
|
70
|
+
// get median index
|
|
71
|
+
const iMid = oData.length / 2, // get mid of array
|
|
72
|
+
// if iMid is whole number, array length is even, calculate median
|
|
73
|
+
// if iMid is not whole number, array length is odd, take median as iMid - 1
|
|
74
|
+
iMedian =
|
|
75
|
+
iMid % 1 === 0
|
|
76
|
+
? (parseFloat(oData[iMid - 1][sMeasureField]) + parseFloat(oData[iMid][sMeasureField])) / 2
|
|
77
|
+
: parseFloat(oData[Math.floor(iMid)][sMeasureField]),
|
|
78
|
+
// get scale factor on median
|
|
79
|
+
val = iMedian;
|
|
80
|
+
for (i = 0; i < 14; i++) {
|
|
81
|
+
scaleFactor = Math.pow(10, i);
|
|
82
|
+
if (Math.round(Math.abs(val) / scaleFactor) < 10) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const fixedInteger = NumberFormat.getIntegerInstance({
|
|
89
|
+
style: "short",
|
|
90
|
+
showScale: false,
|
|
91
|
+
shortRefNumber: scaleFactor
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// apply scale factor to other values and check
|
|
95
|
+
for (i = 0; i < oData.length; i++) {
|
|
96
|
+
const aData = oData[i],
|
|
97
|
+
sScaledValue = fixedInteger.format(aData[sMeasureField]) as any,
|
|
98
|
+
aScaledValueParts = sScaledValue.split(".");
|
|
99
|
+
// if scaled value has only 0 before decimal or 0 after decimal (example: 0.02)
|
|
100
|
+
// then ignore this scale factor else proceed with this scale factor
|
|
101
|
+
// if scaled value divided by 1000 is >= 1000 then also ignore scale factor
|
|
102
|
+
if (
|
|
103
|
+
(!aScaledValueParts[1] && parseInt(aScaledValueParts[0], 10) === 0) ||
|
|
104
|
+
(aScaledValueParts[1] && parseInt(aScaledValueParts[0], 10) === 0 && aScaledValueParts[1].indexOf("0") === 0) ||
|
|
105
|
+
sScaledValue / 1000 >= 1000
|
|
106
|
+
) {
|
|
107
|
+
scaleFactor = undefined;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
iShortRefNumber: scaleFactor,
|
|
113
|
+
scale: scaleFactor ? (fixedInteger as any).getScale() : ""
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns the formatted number according to the rules of VisualChartFilters.
|
|
119
|
+
*
|
|
120
|
+
* @param {string | number} value Value which needs to be formatted
|
|
121
|
+
* @param {number} scaleFactor ScaleFactor to which the value needs to be scaled
|
|
122
|
+
* @param {number} numberOfFractionalDigits NumberOfFractionalDigits digits in the decimals according to scale
|
|
123
|
+
* @param {string} currency Currency code
|
|
124
|
+
* @returns {number} The formatted number
|
|
125
|
+
*/
|
|
126
|
+
getFormattedNumber: function(
|
|
127
|
+
value: string | number,
|
|
128
|
+
scaleFactor: number | undefined,
|
|
129
|
+
numberOfFractionalDigits: number | undefined,
|
|
130
|
+
currency: string | undefined
|
|
131
|
+
) {
|
|
132
|
+
let fixedInteger;
|
|
133
|
+
value = typeof value === "string" ? Number(value.replace(/,/g, "")) : value;
|
|
134
|
+
|
|
135
|
+
if (currency) {
|
|
136
|
+
const currencyFormat = NumberFormat.getCurrencyInstance({
|
|
137
|
+
showMeasure: false
|
|
138
|
+
});
|
|
139
|
+
return currencyFormat.format(parseFloat(value as any), currency);
|
|
140
|
+
// parseFloat(value) is required otherwise -ve value are wrongly rounded off
|
|
141
|
+
// Example: "-1.9" rounds off to -1 instead of -2. however -1.9 rounds off to -2
|
|
142
|
+
} else if (scaleFactor) {
|
|
143
|
+
fixedInteger = NumberFormat.getFloatInstance({
|
|
144
|
+
style: "short",
|
|
145
|
+
showScale: false,
|
|
146
|
+
shortRefNumber: scaleFactor,
|
|
147
|
+
shortDecimals: numberOfFractionalDigits
|
|
148
|
+
});
|
|
149
|
+
return fixedInteger.format(parseFloat(value as any));
|
|
150
|
+
} else {
|
|
151
|
+
fixedInteger = NumberFormat.getFloatInstance({
|
|
152
|
+
decimals: numberOfFractionalDigits
|
|
153
|
+
});
|
|
154
|
+
return fixedInteger.format(parseFloat(value as any));
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Applies the UOM to the title of the visual filter control.
|
|
160
|
+
*
|
|
161
|
+
* @param {object} oInteractiveChart InteractiveChart in the VisualFilter control
|
|
162
|
+
* @param {object} oContextData Data of the VisualFilter
|
|
163
|
+
* @param {object} oView Instance of the view
|
|
164
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
165
|
+
*/
|
|
166
|
+
applyUOMToTitle: function(oInteractiveChart: any, oContextData: any, oView: View, sInfoPath: string) {
|
|
167
|
+
const vUOM = oInteractiveChart.data("uom");
|
|
168
|
+
let sUOM;
|
|
169
|
+
let sCurrency;
|
|
170
|
+
if (vUOM && vUOM["ISOCurrency"]) {
|
|
171
|
+
sUOM = vUOM["ISOCurrency"];
|
|
172
|
+
sCurrency = sUOM.$Path ? oContextData[sUOM.$Path] : sUOM;
|
|
173
|
+
} else if (vUOM && vUOM["Unit"]) {
|
|
174
|
+
sUOM = vUOM["Unit"];
|
|
175
|
+
}
|
|
176
|
+
if (sUOM) {
|
|
177
|
+
const sUOMValue = sUOM.$Path ? oContextData[sUOM.$Path] : sUOM;
|
|
178
|
+
const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
|
|
179
|
+
oInternalModelContext.setProperty("uom/" + sInfoPath, sUOMValue);
|
|
180
|
+
if (sCurrency) {
|
|
181
|
+
oInternalModelContext.setProperty("currency/" + sInfoPath, sUOMValue);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
/**
|
|
186
|
+
* Updates the scale factor in the title of the visual filter.
|
|
187
|
+
*
|
|
188
|
+
* @param {object} oInteractiveChart InteractiveChart in the VisualFilter control
|
|
189
|
+
* @param {object} oView Instance of the view
|
|
190
|
+
* @param {object} sVFId VisualFilter control ID
|
|
191
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
192
|
+
*/
|
|
193
|
+
updateChartScaleFactorTitle: function(oInteractiveChart: any, oView: View, sVFId: object, sInfoPath: string) {
|
|
194
|
+
if (!oInteractiveChart.data("scalefactor")) {
|
|
195
|
+
this.applyMedianScaleToChartData(oInteractiveChart, oView, sVFId, sInfoPath);
|
|
196
|
+
} else {
|
|
197
|
+
const fixedInteger = NumberFormat.getIntegerInstance({
|
|
198
|
+
style: "short",
|
|
199
|
+
showScale: false,
|
|
200
|
+
shortRefNumber: oInteractiveChart.data("scalefactor")
|
|
201
|
+
});
|
|
202
|
+
const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
|
|
203
|
+
oInternalModelContext.setProperty("scalefactor/" + sInfoPath, (fixedInteger as any).getScale());
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
* @param {string} s18nMessageTitle Text of the error message title.
|
|
210
|
+
* @param {string} s18nMessage Text of the error message description.
|
|
211
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
212
|
+
* @param {object} oView Instance of the view.
|
|
213
|
+
*/
|
|
214
|
+
applyErrorMessageAndTitle: function(s18nMessageTitle: string, s18nMessage: string, sInfoPath: string, oView: View) {
|
|
215
|
+
const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
|
|
216
|
+
oInternalModelContext.setProperty(sInfoPath, {});
|
|
217
|
+
oInternalModelContext.setProperty(sInfoPath, {
|
|
218
|
+
"errorMessageTitle": s18nMessageTitle,
|
|
219
|
+
"errorMessage": s18nMessage,
|
|
220
|
+
"showError": true
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Checks if multiple units are present.
|
|
225
|
+
*
|
|
226
|
+
* @param {object} oContexts Contexts of the VisualFilter
|
|
227
|
+
* @param {string} sUnitfield The path of the unit field
|
|
228
|
+
* @returns {boolean} Returns if multiple units are configured or not
|
|
229
|
+
*/
|
|
230
|
+
checkMulitUnit: function(oContexts: Context[], sUnitfield: string) {
|
|
231
|
+
const aData = [];
|
|
232
|
+
if (oContexts && sUnitfield) {
|
|
233
|
+
for (let i = 0; i < oContexts.length; i++) {
|
|
234
|
+
const aContextData = oContexts[i] && (oContexts[i].getObject() as any);
|
|
235
|
+
aData.push(aContextData[sUnitfield]);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return !!aData.reduce(function(data: any, key: any) {
|
|
239
|
+
return data === key ? data : NaN;
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Sets an error message if multiple UOM are present.
|
|
245
|
+
*
|
|
246
|
+
* @param {object} oData Data of the VisualFilter control
|
|
247
|
+
* @param {object} oInteractiveChart InteractiveChart in the VisualFilter control
|
|
248
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
249
|
+
* @param {string} oResourceBundle The resource bundle
|
|
250
|
+
* @param {string} oView Instance of the view
|
|
251
|
+
*/
|
|
252
|
+
setMultiUOMMessage: function(
|
|
253
|
+
oData: Context[],
|
|
254
|
+
oInteractiveChart: any,
|
|
255
|
+
sInfoPath: string,
|
|
256
|
+
oResourceBundle: ResourceBundle,
|
|
257
|
+
oView: View
|
|
258
|
+
) {
|
|
259
|
+
const vUOM = oInteractiveChart.data("uom");
|
|
260
|
+
const sIsCurrency = vUOM && vUOM["ISOCurrency"] && vUOM["ISOCurrency"].$Path;
|
|
261
|
+
const sIsUnit = vUOM && vUOM["Unit"] && vUOM["Unit"].$Path;
|
|
262
|
+
const sUnitfield = sIsCurrency || sIsUnit;
|
|
263
|
+
let s18nMessageTitle, s18nMessage;
|
|
264
|
+
if (sUnitfield) {
|
|
265
|
+
if (!this.checkMulitUnit(oData, sUnitfield)) {
|
|
266
|
+
if (sIsCurrency) {
|
|
267
|
+
s18nMessageTitle = oResourceBundle.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");
|
|
268
|
+
s18nMessage = oResourceBundle.getText("M_VISUAL_FILTERS_MULTIPLE_CURRENCY", sUnitfield);
|
|
269
|
+
this.applyErrorMessageAndTitle(s18nMessageTitle, s18nMessage, sInfoPath, oView);
|
|
270
|
+
Log.warning("Filter is set for multiple Currency for" + sUnitfield);
|
|
271
|
+
} else if (sIsUnit) {
|
|
272
|
+
s18nMessageTitle = oResourceBundle.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");
|
|
273
|
+
s18nMessage = oResourceBundle.getText("M_VISUAL_FILTERS_MULTIPLE_UNIT", sUnitfield);
|
|
274
|
+
this.applyErrorMessageAndTitle(s18nMessageTitle, s18nMessage, sInfoPath, oView);
|
|
275
|
+
Log.warning("Filter is set for multiple UOMs for" + sUnitfield);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Sets an error message if response data is empty.
|
|
283
|
+
*
|
|
284
|
+
* @param {string} sInfoPath Internal model context path to store info.
|
|
285
|
+
* @param {string} oResourceBundle The resource bundle
|
|
286
|
+
* @param {string} oView Instance of the view
|
|
287
|
+
*/
|
|
288
|
+
setNoDataMessage: function(sInfoPath: string, oResourceBundle: ResourceBundle, oView: View) {
|
|
289
|
+
const s18nMessageTitle = oResourceBundle.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");
|
|
290
|
+
const s18nMessage = oResourceBundle.getText("M_VISUAL_FILTER_NO_DATA_TEXT");
|
|
291
|
+
this.applyErrorMessageAndTitle(s18nMessageTitle, s18nMessage, sInfoPath, oView);
|
|
292
|
+
},
|
|
293
|
+
convertFilterCondions: function(oFilterConditions: any) {
|
|
294
|
+
const oConvertedConditions: any = {};
|
|
295
|
+
Object.keys(oFilterConditions).forEach(function(sKey: string) {
|
|
296
|
+
const aConvertedConditions = [];
|
|
297
|
+
const aConditions = oFilterConditions[sKey];
|
|
298
|
+
for (let i = 0; i < aConditions.length; i++) {
|
|
299
|
+
const values = aConditions[i].value2 ? [aConditions[i].value1, aConditions[i].value2] : [aConditions[i].value1];
|
|
300
|
+
aConvertedConditions.push(
|
|
301
|
+
Condition.createCondition(aConditions[i].operator, values, null, null, "Validated" as ConditionValidated)
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
if (aConvertedConditions.length) {
|
|
305
|
+
oConvertedConditions[sKey] = aConvertedConditions;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
return oConvertedConditions;
|
|
309
|
+
},
|
|
310
|
+
getCustomConditions: function(Range: any, oValidProperty: any, sPropertyName: any) {
|
|
311
|
+
let value1, value2;
|
|
312
|
+
if (oValidProperty.$Type === "Edm.DateTimeOffset") {
|
|
313
|
+
value1 = this._parseDateTime(getTypeCompliantValue(this._formatDateTime(Range.Low), oValidProperty.$Type));
|
|
314
|
+
value2 = Range.High ? this._parseDateTime(getTypeCompliantValue(this._formatDateTime(Range.High), oValidProperty.$Type)) : null;
|
|
315
|
+
} else {
|
|
316
|
+
value1 = Range.Low;
|
|
317
|
+
value2 = Range.High ? Range.High : null;
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
operator: Range.Option ? getOperator(Range.Option.$EnumMember || Range.Option) : null,
|
|
321
|
+
value1: value1,
|
|
322
|
+
value2: value2,
|
|
323
|
+
path: sPropertyName
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
_parseDateTime: function(sValue: any) {
|
|
327
|
+
return this._getDateTimeTypeInstance().parseValue(sValue, "string");
|
|
328
|
+
},
|
|
329
|
+
_formatDateTime: function(sValue: any) {
|
|
330
|
+
return this._getDateTimeTypeInstance().formatValue(sValue, "string");
|
|
331
|
+
},
|
|
332
|
+
_getDateTimeTypeInstance: function() {
|
|
333
|
+
return new DateTimeOffset({ pattern: "yyyy-MM-ddTHH:mm:ssZ", calendarType: "Gregorian" }, { V4: true });
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export default VisualFilterUtils;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<core:FragmentDefinition
|
|
2
|
+
xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
|
|
3
|
+
xmlns:core="sap.ui.core"
|
|
4
|
+
xmlns="sap.m"
|
|
5
|
+
xmlns:f="sap.ui.layout.form"
|
|
6
|
+
xmlns:l="sap.ui.layout"
|
|
7
|
+
template:require="{
|
|
8
|
+
ID: 'sap/fe/core/helpers/StableIdHelper'
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<f:Form>
|
|
12
|
+
<f:layout>
|
|
13
|
+
<f:ResponsiveGridLayout
|
|
14
|
+
labelSpanXL="4"
|
|
15
|
+
labelSpanL="4"
|
|
16
|
+
labelSpanM="12"
|
|
17
|
+
labelSpanS="12"
|
|
18
|
+
adjustLabelSpan="false"
|
|
19
|
+
emptySpanXL="0"
|
|
20
|
+
emptySpanL="0"
|
|
21
|
+
emptySpanM="0"
|
|
22
|
+
emptySpanS="0"
|
|
23
|
+
columnsXL="2"
|
|
24
|
+
columnsL="2"
|
|
25
|
+
columnsM="1"
|
|
26
|
+
singleContainerFullSize="false"
|
|
27
|
+
/>
|
|
28
|
+
</f:layout>
|
|
29
|
+
<f:formContainers>
|
|
30
|
+
<f:FormContainer>
|
|
31
|
+
<f:formElements>
|
|
32
|
+
<template:repeat list="{dataFieldModel>}" var="dataField">
|
|
33
|
+
<template:if test="{dataField>visible}">
|
|
34
|
+
<template:if test="{dataField>unitProperty}">
|
|
35
|
+
<template:then>
|
|
36
|
+
<f:FormElement>
|
|
37
|
+
<f:fields>
|
|
38
|
+
<Label text="{dataField>label}" required="{dataField>isFieldRequired}">
|
|
39
|
+
<layoutData>
|
|
40
|
+
<l:GridData span="XL12 L12 M12 S12" />
|
|
41
|
+
</layoutData>
|
|
42
|
+
</Label>
|
|
43
|
+
<ComboBox
|
|
44
|
+
id="{= ID.generate(['MED_', ${dataField>entitySet}, ${dataField>dataProperty}]) }"
|
|
45
|
+
core:require="{MassEditHandlers: 'sap/fe/core/controls/massEdit/MassEditHandlers'}"
|
|
46
|
+
items="{= '{path : \'fieldsInfo>/values/' + ${dataField>dataProperty} + '\'}' }"
|
|
47
|
+
change="MassEditHandlers.handleMassEditChange($event)"
|
|
48
|
+
selectedKey="{dataField>defaultSelectionPath}"
|
|
49
|
+
visible="{dataField>visible}"
|
|
50
|
+
>
|
|
51
|
+
<items>
|
|
52
|
+
<core:Item key="{fieldsInfo>key}" text="{fieldsInfo>text}" />
|
|
53
|
+
</items>
|
|
54
|
+
<layoutData>
|
|
55
|
+
<l:GridData span="XL6 L6 M6 S12" />
|
|
56
|
+
</layoutData>
|
|
57
|
+
</ComboBox>
|
|
58
|
+
<ComboBox
|
|
59
|
+
core:require="{MassEditHandlers: 'sap/fe/core/controls/massEdit/MassEditHandlers'}"
|
|
60
|
+
id="{= ID.generate(['MED_', ${dataField>entitySet}, ${dataField>unitProperty}]) }"
|
|
61
|
+
items="{= '{path : \'fieldsInfo>/unitData/' + ${dataField>unitProperty} + '\'}' }"
|
|
62
|
+
change="MassEditHandlers.handleMassEditChange($event)"
|
|
63
|
+
selectedKey="{dataField>defaultSelectionUnitPath}"
|
|
64
|
+
visible="{dataField>visible}"
|
|
65
|
+
>
|
|
66
|
+
<items>
|
|
67
|
+
<core:Item key="{fieldsInfo>key}" text="{fieldsInfo>text}" />
|
|
68
|
+
</items>
|
|
69
|
+
<layoutData>
|
|
70
|
+
<l:GridData span="XL6 L6 M6 S12" />
|
|
71
|
+
</layoutData>
|
|
72
|
+
</ComboBox>
|
|
73
|
+
</f:fields>
|
|
74
|
+
</f:FormElement>
|
|
75
|
+
</template:then>
|
|
76
|
+
<template:else>
|
|
77
|
+
<f:FormElement>
|
|
78
|
+
<f:fields>
|
|
79
|
+
<Label text="{dataField>label}" required="{dataField>isFieldRequired}">
|
|
80
|
+
<layoutData>
|
|
81
|
+
<l:GridData span="XL12 L12 M12 S12" />
|
|
82
|
+
</layoutData>
|
|
83
|
+
</Label>
|
|
84
|
+
<ComboBox
|
|
85
|
+
id="{= ID.generate(['MED_', ${dataField>entitySet}, ${dataField>dataProperty}]) }"
|
|
86
|
+
core:require="{MassEditHandlers: 'sap/fe/core/controls/massEdit/MassEditHandlers'}"
|
|
87
|
+
items="{= '{path : \'fieldsInfo>/values/' + ${dataField>dataProperty} + '\'}' }"
|
|
88
|
+
change="MassEditHandlers.handleMassEditChange($event)"
|
|
89
|
+
selectedKey="{dataField>defaultSelectionPath}"
|
|
90
|
+
visible="{dataField>visible}"
|
|
91
|
+
>
|
|
92
|
+
<items>
|
|
93
|
+
<core:Item key="{fieldsInfo>key}" text="{fieldsInfo>text}" />
|
|
94
|
+
</items>
|
|
95
|
+
</ComboBox>
|
|
96
|
+
</f:fields>
|
|
97
|
+
</f:FormElement>
|
|
98
|
+
</template:else>
|
|
99
|
+
</template:if>
|
|
100
|
+
</template:if>
|
|
101
|
+
</template:repeat>
|
|
102
|
+
</f:formElements>
|
|
103
|
+
</f:FormContainer>
|
|
104
|
+
</f:formContainers>
|
|
105
|
+
</f:Form>
|
|
106
|
+
</core:FragmentDefinition>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define([], function () {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Constructor for a new Visual Filter Container.
|
|
10
|
+
* Used for visual filters
|
|
11
|
+
*
|
|
12
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
13
|
+
* @extends sap.ui.mdc.filterbar.IFilterContainer
|
|
14
|
+
* @class
|
|
15
|
+
* @private
|
|
16
|
+
* @alias sap.fe.core.controls.filterbar.VisualFilterContainer
|
|
17
|
+
*/
|
|
18
|
+
var MassEditHandlers = {
|
|
19
|
+
handleMassEditChange: function (oEvent) {
|
|
20
|
+
var oSource = oEvent && oEvent.getSource();
|
|
21
|
+
var aParams = oSource && oSource.getSelectedKey() && oSource.getSelectedKey().split("/");
|
|
22
|
+
var oDialog = oSource && oSource.getParent().getParent().getParent().getParent();
|
|
23
|
+
var oFieldsInfoData = oDialog && oDialog.getModel("fieldsInfo").getData();
|
|
24
|
+
var oDataObject; //TODO - Value Help Handling Load Value Help when respective value is selected in combo Box in dialog
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
if (aParams[0] === "ValueHelp") {
|
|
28
|
+
} */
|
|
29
|
+
|
|
30
|
+
if (aParams[0] === "Default") {
|
|
31
|
+
oDataObject = {
|
|
32
|
+
keyValue: aParams[1],
|
|
33
|
+
value: aParams[0]
|
|
34
|
+
};
|
|
35
|
+
} else if (aParams[0] === "ClearFieldValue") {
|
|
36
|
+
oDataObject = {
|
|
37
|
+
keyValue: aParams[1],
|
|
38
|
+
value: ""
|
|
39
|
+
};
|
|
40
|
+
} else if (!aParams) {
|
|
41
|
+
var sPropertyName = oSource.getId().substring(oSource.getId().lastIndexOf(":") + 1);
|
|
42
|
+
oDataObject = {
|
|
43
|
+
keyValue: sPropertyName,
|
|
44
|
+
value: oSource.getValue()
|
|
45
|
+
};
|
|
46
|
+
} else {
|
|
47
|
+
var aRelatedField = aParams[0] && oFieldsInfoData.values && oFieldsInfoData.values[aParams[0]].filter(function (oFieldData) {
|
|
48
|
+
return oFieldData.text === oSource.getValue();
|
|
49
|
+
});
|
|
50
|
+
var iValueIndex = oFieldsInfoData.values[aParams[0]].findIndex(function (data) {
|
|
51
|
+
return typeof data.text === "boolean" && data.text === Boolean(oSource.getValue());
|
|
52
|
+
});
|
|
53
|
+
oDataObject = aRelatedField && aRelatedField[0] && aRelatedField[0].textInfo ? {
|
|
54
|
+
keyValue: aParams[0],
|
|
55
|
+
value: aRelatedField[0].textInfo.value
|
|
56
|
+
} : {
|
|
57
|
+
keyValue: aParams[0],
|
|
58
|
+
value: iValueIndex !== -1 ? oFieldsInfoData.values[aParams[0]][iValueIndex].text : oSource.getValue()
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var bExistingElementindex = -1;
|
|
63
|
+
|
|
64
|
+
for (var i = 0; i < oFieldsInfoData.results.length; i++) {
|
|
65
|
+
if (oFieldsInfoData.results[i].keyValue === oDataObject.keyValue) {
|
|
66
|
+
bExistingElementindex = i;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (bExistingElementindex !== -1) {
|
|
71
|
+
oFieldsInfoData.results[bExistingElementindex] = oDataObject;
|
|
72
|
+
} else {
|
|
73
|
+
oFieldsInfoData.results.push(oDataObject);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return MassEditHandlers;
|
|
78
|
+
}, false);
|
|
79
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1hc3NFZGl0SGFuZGxlcnMudHMiXSwibmFtZXMiOlsiTWFzc0VkaXRIYW5kbGVycyIsImhhbmRsZU1hc3NFZGl0Q2hhbmdlIiwib0V2ZW50Iiwib1NvdXJjZSIsImdldFNvdXJjZSIsImFQYXJhbXMiLCJnZXRTZWxlY3RlZEtleSIsInNwbGl0Iiwib0RpYWxvZyIsImdldFBhcmVudCIsIm9GaWVsZHNJbmZvRGF0YSIsImdldE1vZGVsIiwiZ2V0RGF0YSIsIm9EYXRhT2JqZWN0Iiwia2V5VmFsdWUiLCJ2YWx1ZSIsInNQcm9wZXJ0eU5hbWUiLCJnZXRJZCIsInN1YnN0cmluZyIsImxhc3RJbmRleE9mIiwiZ2V0VmFsdWUiLCJhUmVsYXRlZEZpZWxkIiwidmFsdWVzIiwiZmlsdGVyIiwib0ZpZWxkRGF0YSIsInRleHQiLCJpVmFsdWVJbmRleCIsImZpbmRJbmRleCIsImRhdGEiLCJCb29sZWFuIiwidGV4dEluZm8iLCJiRXhpc3RpbmdFbGVtZW50aW5kZXgiLCJpIiwicmVzdWx0cyIsImxlbmd0aCIsInB1c2giXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7Ozs7QUFGQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQU1BLGdCQUFnQixHQUF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yZXN1bHRzLmxlbmd0aDsgaSsrKSB7XG5cdFx0XHRpZiAob0ZpZWxkc0luZm9EYXRhLnJlc3VsdHNbaV0ua2V5VmFsdWUgPT09IG9EYXRhT2JqZWN0LmtleVZhbHVlKSB7XG5cdFx0XHRcdGJFeGlzdGluZ0VsZW1lbnRpbmRleCA9IGk7XG5cdFx0XHR9XG5cdFx0fVxuXHRcdGlmIChiRXhpc3RpbmdFbGVtZW50aW5kZXggIT09IC0xKSB7XG5cdFx0XHRvRmllbGRzSW5mb0RhdGEucmVzdWx0c1tiRXhpc3RpbmdFbGVtZW50aW5kZXhdID0gb0RhdGFPYmplY3Q7XG5cdFx0fSBlbHNlIHtcblx0XHRcdG9GaWVsZHNJbmZvRGF0YS5yZXN1bHRzLnB1c2gob0RhdGFPYmplY3QpO1xuXHRcdH1cblx0fVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTWFzc0VkaXRIYW5kbGVycztcbiJdfQ==
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constructor for a new Visual Filter Container.
|
|
3
|
+
* Used for visual filters
|
|
4
|
+
*
|
|
5
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
6
|
+
* @extends sap.ui.mdc.filterbar.IFilterContainer
|
|
7
|
+
* @class
|
|
8
|
+
* @private
|
|
9
|
+
* @alias sap.fe.core.controls.filterbar.VisualFilterContainer
|
|
10
|
+
*/
|
|
11
|
+
const MassEditHandlers = {
|
|
12
|
+
handleMassEditChange: function(oEvent: any) {
|
|
13
|
+
const oSource = oEvent && oEvent.getSource();
|
|
14
|
+
const aParams = oSource && oSource.getSelectedKey() && oSource.getSelectedKey().split("/");
|
|
15
|
+
const oDialog =
|
|
16
|
+
oSource &&
|
|
17
|
+
oSource
|
|
18
|
+
.getParent()
|
|
19
|
+
.getParent()
|
|
20
|
+
.getParent()
|
|
21
|
+
.getParent();
|
|
22
|
+
const oFieldsInfoData = oDialog && oDialog.getModel("fieldsInfo").getData();
|
|
23
|
+
let oDataObject;
|
|
24
|
+
//TODO - Value Help Handling Load Value Help when respective value is selected in combo Box in dialog
|
|
25
|
+
/*
|
|
26
|
+
if (aParams[0] === "ValueHelp") {
|
|
27
|
+
} */
|
|
28
|
+
if (aParams[0] === "Default") {
|
|
29
|
+
oDataObject = { keyValue: aParams[1], value: aParams[0] };
|
|
30
|
+
} else if (aParams[0] === "ClearFieldValue") {
|
|
31
|
+
oDataObject = { keyValue: aParams[1], value: "" };
|
|
32
|
+
} else if (!aParams) {
|
|
33
|
+
const sPropertyName = oSource.getId().substring(oSource.getId().lastIndexOf(":") + 1);
|
|
34
|
+
oDataObject = {
|
|
35
|
+
keyValue: sPropertyName,
|
|
36
|
+
value: oSource.getValue()
|
|
37
|
+
};
|
|
38
|
+
} else {
|
|
39
|
+
const aRelatedField =
|
|
40
|
+
aParams[0] &&
|
|
41
|
+
oFieldsInfoData.values &&
|
|
42
|
+
oFieldsInfoData.values[aParams[0]].filter(function(oFieldData: any) {
|
|
43
|
+
return oFieldData.text === oSource.getValue();
|
|
44
|
+
});
|
|
45
|
+
const iValueIndex = oFieldsInfoData.values[aParams[0]].findIndex(function(data: any) {
|
|
46
|
+
return typeof data.text === "boolean" && data.text === Boolean(oSource.getValue());
|
|
47
|
+
});
|
|
48
|
+
oDataObject =
|
|
49
|
+
aRelatedField && aRelatedField[0] && aRelatedField[0].textInfo
|
|
50
|
+
? { keyValue: aParams[0], value: aRelatedField[0].textInfo.value }
|
|
51
|
+
: {
|
|
52
|
+
keyValue: aParams[0],
|
|
53
|
+
value: iValueIndex !== -1 ? oFieldsInfoData.values[aParams[0]][iValueIndex].text : oSource.getValue()
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
let bExistingElementindex = -1;
|
|
57
|
+
for (let i = 0; i < oFieldsInfoData.results.length; i++) {
|
|
58
|
+
if (oFieldsInfoData.results[i].keyValue === oDataObject.keyValue) {
|
|
59
|
+
bExistingElementindex = i;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (bExistingElementindex !== -1) {
|
|
63
|
+
oFieldsInfoData.results[bExistingElementindex] = oDataObject;
|
|
64
|
+
} else {
|
|
65
|
+
oFieldsInfoData.results.push(oDataObject);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default MassEditHandlers;
|