@sapui5/sap.fe.core 1.113.0 → 1.115.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 +1 -1
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/ActionRuntime-dbg.js +68 -5
- package/src/sap/fe/core/ActionRuntime.js +1 -1
- package/src/sap/fe/core/ActionRuntime.js.map +1 -1
- package/src/sap/fe/core/ActionRuntime.ts +120 -4
- package/src/sap/fe/core/AppComponent-dbg.js +8 -2
- package/src/sap/fe/core/AppComponent.js +1 -1
- package/src/sap/fe/core/AppComponent.js.map +1 -1
- package/src/sap/fe/core/AppComponent.ts +19 -3
- package/src/sap/fe/core/AppStateHandler-dbg.js +14 -10
- package/src/sap/fe/core/AppStateHandler.js +1 -1
- package/src/sap/fe/core/AppStateHandler.js.map +1 -1
- package/src/sap/fe/core/AppStateHandler.ts +17 -11
- package/src/sap/fe/core/BaseController-dbg.js +1 -1
- package/src/sap/fe/core/BaseController.ts +13 -2
- package/src/sap/fe/core/CommonUtils-dbg.js +74 -317
- package/src/sap/fe/core/CommonUtils.js +1 -1
- package/src/sap/fe/core/CommonUtils.js.map +1 -1
- package/src/sap/fe/core/CommonUtils.ts +96 -473
- package/src/sap/fe/core/ExtensionAPI-dbg.js +1 -1
- package/src/sap/fe/core/ExtensionAPI.ts +2 -2
- package/src/sap/fe/core/StateFilterToSelectionVariant-dbg.js +263 -0
- package/src/sap/fe/core/StateFilterToSelectionVariant.js +6 -0
- package/src/sap/fe/core/StateFilterToSelectionVariant.js.map +1 -0
- package/src/sap/fe/core/StateFilterToSelectionVariant.ts +316 -0
- package/src/sap/fe/core/TemplateComponent-dbg.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase-dbg.js +10 -3
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +8 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport-dbg.js +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.ts +1 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor-dbg.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.ts +7 -7
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment-dbg.js +1 -1
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.ts +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow-dbg.js +68 -36
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +83 -43
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation-dbg.js +12 -11
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +17 -21
- package/src/sap/fe/core/controllerextensions/InternalRouting-dbg.js +233 -133
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +260 -145
- package/src/sap/fe/core/controllerextensions/MassEdit-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +3 -3
- package/src/sap/fe/core/controllerextensions/Routing-dbg.js +5 -3
- package/src/sap/fe/core/controllerextensions/Routing.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Routing.ts +5 -4
- package/src/sap/fe/core/controllerextensions/Share-dbg.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Share.ts +2 -1
- package/src/sap/fe/core/controllerextensions/SideEffects-dbg.js +19 -14
- package/src/sap/fe/core/controllerextensions/SideEffects.js +1 -1
- package/src/sap/fe/core/controllerextensions/SideEffects.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +25 -18
- package/src/sap/fe/core/controllerextensions/ViewState-dbg.js +40 -26
- package/src/sap/fe/core/controllerextensions/ViewState.js +1 -1
- package/src/sap/fe/core/controllerextensions/ViewState.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/ViewState.ts +59 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync-dbg.js +8 -8
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +23 -25
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon-dbg.js +7 -45
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +5 -48
- package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog-dbg.js +2 -2
- package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.tsx +7 -3
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper-dbg.js +73 -90
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +88 -101
- package/src/sap/fe/core/controllerextensions/editFlow/draft-dbg.js +26 -4
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +29 -3
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup-dbg.js +13 -10
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +7 -20
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade-dbg.js +64 -4
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +91 -8
- package/src/sap/fe/core/controllerextensions/editFlow/sticky-dbg.js +2 -4
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +3 -5
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling-dbg.js +9 -9
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +1 -1
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +8 -8
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -0
- package/src/sap/fe/core/controls/CommandExecution-dbg.js +4 -9
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/CommandExecution.js.map +1 -1
- package/src/sap/fe/core/controls/CommandExecution.ts +0 -8
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block-dbg.js +335 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.js +6 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.js.map +1 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.tsx +336 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter-dbg.js +3 -28
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js.map +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +8 -29
- package/src/sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters-dbg.js +435 -0
- package/src/sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters.js +6 -0
- package/src/sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters.js.map +1 -0
- package/src/sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters.ts +532 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils-dbg.js +30 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js.map +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +38 -0
- package/src/sap/fe/core/converters/ManifestSettings-dbg.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +7 -5
- package/src/sap/fe/core/converters/MetaModelConverter-dbg.js +36 -4
- package/src/sap/fe/core/converters/MetaModelConverter.js +1 -1
- package/src/sap/fe/core/converters/MetaModelConverter.js.map +1 -1
- package/src/sap/fe/core/converters/MetaModelConverter.ts +45 -4
- package/src/sap/fe/core/converters/TemplateConverter-dbg.js +2 -3
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.js.map +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +1 -6
- package/src/sap/fe/core/converters/annotations/DataField-dbg.js +18 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +1 -1
- package/src/sap/fe/core/converters/annotations/DataField.js.map +1 -1
- package/src/sap/fe/core/converters/annotations/DataField.ts +18 -2
- package/src/sap/fe/core/converters/common/AnnotationConverter-dbg.js +679 -676
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Chart-dbg.js +32 -20
- package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Chart.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +30 -18
- package/src/sap/fe/core/converters/controls/Common/DataVisualization-dbg.js +4 -5
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +6 -37
- package/src/sap/fe/core/converters/controls/Common/Table-dbg.js +100 -72
- package/src/sap/fe/core/converters/controls/Common/Table.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Table.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Table.ts +146 -99
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions-dbg.js +37 -10
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +49 -16
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar-dbg.js +47 -18
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +74 -20
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters-dbg.js +26 -9
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +24 -8
- package/src/sap/fe/core/converters/helpers/Aggregation-dbg.js +28 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.js +1 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -9
- package/src/sap/fe/core/converters/helpers/InsightsHelpers-dbg.js +39 -0
- package/src/sap/fe/core/converters/helpers/InsightsHelpers.js +6 -0
- package/src/sap/fe/core/converters/helpers/InsightsHelpers.js.map +1 -0
- package/src/sap/fe/core/converters/helpers/InsightsHelpers.ts +45 -0
- package/src/sap/fe/core/converters/templates/ListReportConverter-dbg.js +13 -15
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.js.map +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +18 -54
- package/src/sap/fe/core/converters/templates/ObjectPageConverter-dbg.js +12 -12
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -1
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js.map +1 -1
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +16 -11
- package/src/sap/fe/core/formatters/CollaborationFormatter-dbg.js +17 -33
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CollaborationFormatter.js.map +1 -1
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +27 -22
- package/src/sap/fe/core/formatters/ValueFormatter-dbg.js +5 -11
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.js.map +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -25
- package/src/sap/fe/core/fpm/Component-dbg.js +3 -1
- package/src/sap/fe/core/fpm/Component.js +1 -1
- package/src/sap/fe/core/fpm/Component.js.map +1 -1
- package/src/sap/fe/core/fpm/Component.ts +3 -1
- package/src/sap/fe/core/fpm/manifest.json +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit-dbg.js +74 -26
- package/src/sap/fe/core/helpers/BindingToolkit.js +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit.js.map +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit.ts +116 -33
- package/src/sap/fe/core/helpers/DeleteHelper-dbg.js +82 -37
- package/src/sap/fe/core/helpers/DeleteHelper.js +1 -1
- package/src/sap/fe/core/helpers/DeleteHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/DeleteHelper.ts +109 -56
- package/src/sap/fe/core/helpers/KeepAliveHelper-dbg.js +1 -1
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +7 -5
- package/src/sap/fe/core/helpers/MassEditHelper-dbg.js +13 -3
- package/src/sap/fe/core/helpers/MassEditHelper.js +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.ts +28 -18
- package/src/sap/fe/core/helpers/MessageStrip-dbg.js +1 -1
- package/src/sap/fe/core/helpers/MessageStrip.ts +2 -1
- package/src/sap/fe/core/helpers/ModelHelper-dbg.js +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +3 -3
- package/src/sap/fe/core/helpers/RecommendationHelper-dbg.js +71 -0
- package/src/sap/fe/core/helpers/RecommendationHelper.js +6 -0
- package/src/sap/fe/core/helpers/RecommendationHelper.js.map +1 -0
- package/src/sap/fe/core/helpers/RecommendationHelper.ts +94 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper-dbg.js +5 -2
- package/src/sap/fe/core/helpers/ResourceModelHelper.js +1 -1
- package/src/sap/fe/core/helpers/ResourceModelHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/ResourceModelHelper.ts +5 -0
- package/src/sap/fe/core/helpers/StableIdHelper-dbg.js +24 -2
- package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.ts +23 -1
- package/src/sap/fe/core/helpers/TitleHelper-dbg.js +239 -0
- package/src/sap/fe/core/helpers/TitleHelper.js +6 -0
- package/src/sap/fe/core/helpers/TitleHelper.js.map +1 -0
- package/src/sap/fe/core/helpers/TitleHelper.ts +295 -0
- package/src/sap/fe/core/jsx-runtime/ViewLoader-dbg.js +4 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.js +1 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control-dbg.js +41 -17
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx-control.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +45 -21
- package/src/sap/fe/core/jsx-runtime/jsx-dbg.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -0
- package/src/sap/fe/core/jsx-runtime/useMDXComponents-dbg.js +8 -4
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +1 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +7 -2
- package/src/sap/fe/core/library-dbg.js +4 -3
- package/src/sap/fe/core/library-preload.js +91 -74
- package/src/sap/fe/core/library-preload.js.map +1 -1
- package/src/sap/fe/core/library.js +1 -1
- package/src/sap/fe/core/library.js.map +1 -1
- package/src/sap/fe/core/library.ts +1 -1
- package/src/sap/fe/core/manifest.json +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration-dbg.js +4 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js.map +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +3 -2
- package/src/sap/fe/core/messagebundle.properties +12 -8
- package/src/sap/fe/core/messagebundle_ar.properties +7 -5
- package/src/sap/fe/core/messagebundle_bg.properties +7 -5
- package/src/sap/fe/core/messagebundle_ca.properties +7 -5
- package/src/sap/fe/core/messagebundle_cs.properties +7 -5
- package/src/sap/fe/core/messagebundle_cy.properties +7 -5
- package/src/sap/fe/core/messagebundle_da.properties +7 -5
- package/src/sap/fe/core/messagebundle_de.properties +7 -5
- package/src/sap/fe/core/messagebundle_el.properties +7 -5
- package/src/sap/fe/core/messagebundle_en.properties +7 -5
- package/src/sap/fe/core/messagebundle_en_GB.properties +6 -4
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -4
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +6 -4
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +7 -4
- package/src/sap/fe/core/messagebundle_es.properties +7 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +7 -5
- package/src/sap/fe/core/messagebundle_et.properties +7 -5
- package/src/sap/fe/core/messagebundle_fi.properties +7 -5
- package/src/sap/fe/core/messagebundle_fr.properties +7 -5
- package/src/sap/fe/core/messagebundle_fr_CA.properties +8 -6
- package/src/sap/fe/core/messagebundle_hi.properties +7 -5
- package/src/sap/fe/core/messagebundle_hr.properties +7 -5
- package/src/sap/fe/core/messagebundle_hu.properties +7 -5
- package/src/sap/fe/core/messagebundle_id.properties +7 -5
- package/src/sap/fe/core/messagebundle_it.properties +8 -6
- package/src/sap/fe/core/messagebundle_iw.properties +7 -5
- package/src/sap/fe/core/messagebundle_ja.properties +7 -5
- package/src/sap/fe/core/messagebundle_kk.properties +7 -5
- package/src/sap/fe/core/messagebundle_ko.properties +7 -5
- package/src/sap/fe/core/messagebundle_lt.properties +7 -5
- package/src/sap/fe/core/messagebundle_lv.properties +7 -5
- package/src/sap/fe/core/messagebundle_ms.properties +7 -5
- package/src/sap/fe/core/messagebundle_nl.properties +7 -5
- package/src/sap/fe/core/messagebundle_no.properties +7 -5
- package/src/sap/fe/core/messagebundle_pl.properties +7 -5
- package/src/sap/fe/core/messagebundle_pt.properties +7 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +7 -5
- package/src/sap/fe/core/messagebundle_ro.properties +7 -5
- package/src/sap/fe/core/messagebundle_ru.properties +7 -5
- package/src/sap/fe/core/messagebundle_sh.properties +7 -5
- package/src/sap/fe/core/messagebundle_sk.properties +7 -5
- package/src/sap/fe/core/messagebundle_sl.properties +7 -5
- package/src/sap/fe/core/messagebundle_sv.properties +7 -5
- package/src/sap/fe/core/messagebundle_th.properties +7 -5
- package/src/sap/fe/core/messagebundle_tr.properties +7 -5
- package/src/sap/fe/core/messagebundle_uk.properties +7 -5
- package/src/sap/fe/core/messagebundle_vi.properties +7 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +7 -5
- package/src/sap/fe/core/messagebundle_zh_TW.properties +7 -5
- package/src/sap/fe/core/operationsHelper-dbg.js +1 -1
- package/src/sap/fe/core/operationsHelper.ts +1 -1
- package/src/sap/fe/core/rootView/Fcl-dbg.controller.js +8 -2
- package/src/sap/fe/core/rootView/Fcl.controller.js +1 -1
- package/src/sap/fe/core/rootView/Fcl.controller.js.map +1 -1
- package/src/sap/fe/core/rootView/Fcl.controller.ts +8 -1
- package/src/sap/fe/core/rootView/NavContainer-dbg.controller.js +8 -2
- package/src/sap/fe/core/rootView/NavContainer.controller.js +1 -1
- package/src/sap/fe/core/rootView/NavContainer.controller.js.map +1 -1
- package/src/sap/fe/core/rootView/NavContainer.controller.ts +10 -3
- package/src/sap/fe/core/rootView/RootViewBaseController-dbg.js +16 -6
- package/src/sap/fe/core/rootView/RootViewBaseController.js +1 -1
- package/src/sap/fe/core/rootView/RootViewBaseController.js.map +1 -1
- package/src/sap/fe/core/rootView/RootViewBaseController.ts +10 -4
- package/src/sap/fe/core/services/EnvironmentServiceFactory-dbg.js +54 -5
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +52 -6
- package/src/sap/fe/core/services/NavigationServiceFactory-dbg.js +31 -14
- package/src/sap/fe/core/services/NavigationServiceFactory.js +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +15 -1
- package/src/sap/fe/core/services/RoutingServiceFactory-dbg.js +10 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +29 -7
- package/src/sap/fe/core/services/SideEffectsServiceFactory-dbg.js +5 -2
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +1 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/TemplatedViewServiceFactory-dbg.js +1 -2
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +2 -18
- package/src/sap/fe/core/templating/CommonFormatters-dbg.js +8 -8
- package/src/sap/fe/core/templating/CommonFormatters.js.map +1 -1
- package/src/sap/fe/core/templating/CommonFormatters.ts +9 -9
- package/src/sap/fe/core/templating/CriticalityFormatters-dbg.js +1 -1
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +2 -2
- package/src/sap/fe/core/templating/DataFieldFormatters-dbg.js +38 -2
- package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -1
- package/src/sap/fe/core/templating/DataFieldFormatters.js.map +1 -1
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +40 -0
- package/src/sap/fe/core/templating/FieldControlHelper-dbg.js +5 -6
- package/src/sap/fe/core/templating/FieldControlHelper.js +1 -1
- package/src/sap/fe/core/templating/FieldControlHelper.js.map +1 -1
- package/src/sap/fe/core/templating/FieldControlHelper.ts +13 -11
- package/src/sap/fe/core/templating/FilterHelper-dbg.js +13 -1
- package/src/sap/fe/core/templating/FilterHelper.js +1 -1
- package/src/sap/fe/core/templating/FilterHelper.js.map +1 -1
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -1
- package/src/sap/fe/core/templating/PropertyHelper-dbg.js +1 -1
- package/src/sap/fe/core/templating/PropertyHelper.ts +7 -7
- package/src/sap/fe/core/templating/UIFormatters-dbg.js +5 -6
- package/src/sap/fe/core/templating/UIFormatters.js +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js.map +1 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +6 -7
- package/src/sap/fe/core/type/TypeUtil-dbg.js +2 -2
- package/src/sap/fe/core/type/TypeUtil.js +1 -1
- package/src/sap/fe/core/type/TypeUtil.js.map +1 -1
- package/src/sap/fe/core/type/TypeUtil.ts +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/Manage-dbg.js +0 -243
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +0 -6
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js.map +0 -1
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +0 -283
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +0 -121
- package/src/sap/fe/core/controllerextensions/collaboration/UserDetails.fragment.xml +0 -11
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +0 -59
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler-dbg.js +0 -171
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +0 -6
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js.map +0 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +0 -184
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
4
4
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
5
5
|
*/
|
|
6
|
-
sap.ui.predefine("sap/fe/core/ActionRuntime", ["sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","./controls/AnyElement","./converters/ConverterContext","./converters/objectPage/HeaderAndFooterAction"],function(t,
|
|
6
|
+
sap.ui.predefine("sap/fe/core/ActionRuntime", ["sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","sap/ui/core/message/Message","./controls/AnyElement","./converters/ConverterContext","./converters/objectPage/HeaderAndFooterAction"],function(e,t,n,o,i,a,l,s,r){"use strict";var d=r.getHiddenExpression;var c=r.getEditButtonEnabled;var u=i.isEntitySet;var g=n.transformRecursively;var f=n.equal;var v=n.constant;var p=n.compileExpression;const b={_addMessageForActionParameter:function(e,t){e.addMessages(t.map(e=>{const t=e.actionParameterInfo.field.getBinding(e.actionParameterInfo.isMultiValue?"items":"value");return new a({message:e.message,type:"Error",processor:t===null||t===void 0?void 0:t.getModel(),persistent:true,target:t===null||t===void 0?void 0:t.getResolvedPath()})}))},validateProperties:async function(e,t,n){await Promise.allSettled(t.map(e=>e.validationPromise));const o=t.filter(e=>e.field.getRequired());const i=e.getMessageModel().getData();const a=o.filter(e=>{const t=e.field.getId();const n=i.filter(e=>e.getControlIds().some(e=>e.includes(t)));if(n.length>0){return false}else if(e.isMultiValue){return e.value===undefined||!e.value.length}else{return e.value===undefined||e.value===null||e.value===""}});if(a.length){this._addMessageForActionParameter(e,a.map(e=>{var t;return{actionParameterInfo:e,message:n.getText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_MISSING_MANDATORY_MSG",[((t=e.field.getParent())===null||t===void 0?void 0:t.getAggregation("label")).getText()])}}))}const l=t.find(e=>e.hasError||e.field.getValueState()==="Error"||a.includes(e));if(l){l.field.focus();return false}else{return true}},setActionEnablement:async function(e,n,o,i){const a=[];for(const l in n){let s=[];e.setProperty(l,false);const r=n[l];for(let t=0;t<o.length;t++){const n=o[t];if(n){const t=n.getObject();if(i==="chart"){if(r===null&&!!t[`#${l}`]||n.getObject(r)){e.setProperty(l,true);break}}else if(i==="table"){s=this._setActionEnablementForTable(n,e,l,r,s)}}}if(i==="table"){if(!o.length){e.setProperty(`dynamicActions/${l}`,{bEnabled:false,aApplicable:[],aNotApplicable:[]});a.push(t.setContextsBasedOnOperationAvailable(e,[]))}else if(o.length&&typeof r==="string"){a.push(t.setContextsBasedOnOperationAvailable(e,s))}}}return Promise.all(a)},setActionEnablementAfterPatch:function(e,t,n){const o=n===null||n===void 0?void 0:n.getObject();const i=(o===null||o===void 0?void 0:o.controls)||{};for(const n in i){if(i[n]&&i[n].controlId){const o=e.byId(n);if(o&&o.isA("sap.ui.mdc.Table")){const e=o.getRowBinding();if(e==t){b.setActionEnablement(o.getBindingContext("internal"),JSON.parse(o.data("operationAvailableMap").customData),o.getSelectedContexts(),"table")}}}}},updateEditButtonVisibilityAndEnablement(n){var i,a;const l=(i=n.getViewData())===null||i===void 0?void 0:i.viewLevel,r=(a=n.getModel("ui"))===null||a===void 0?void 0:a.getProperty("/isEditable");if(l>1&&r!==true){var g,v,b,m;const i=n.getBindingContext();const a=t.getAppComponent(n);const l=o.getMetaPathForContext(i);const r=o.getRootEntitySetPath(l);const h=i===null||i===void 0?void 0:(g=i.getModel())===null||g===void 0?void 0:(v=g.getMetaModel())===null||v===void 0?void 0:v.getContext(i===null||i===void 0?void 0:i.getPath());const A=s===null||s===void 0?void 0:s.createConverterContextForMacro(r,h,a.getDiagnostics(),e,undefined);const E=A.getEntitySet();const y=A.getEntityType();let P;const M=u(E)&&((b=E.annotations.UI)===null||b===void 0?void 0:(m=b.UpdateHidden)===null||m===void 0?void 0:m.valueOf());if(M!==true){P=o.isUpdateHidden(E,y)}const x=c(A,undefined);const C=o.getDraftRootPath(i);const B=o.getStickyRootPath(i);const O=C||B;const I=n.getBindingContext("internal");if(O){const e=n.getModel().bindContext(O).getBoundContext();if(P!==undefined){const t=p(f(d(A,P),false));this.updateEditModelContext(t,n,e,"rootEditVisible",I)}if(x){this.updateEditModelContext(x,n,e,"rootEditEnabled",I)}}}},updateEditModelContext:function(e,t,n,o,i){if(e){var a,s,r;const d=new l({anyText:e});d.setBindingContext(null);t.addDependent(d);d.getBinding("anyText");const c=(a=d.getModel())===null||a===void 0?void 0:(s=a.bindContext(n.getPath(),n,{$$groupId:"$auto.Heroes"}))===null||s===void 0?void 0:s.getBoundContext();d.setBindingContext(c);d===null||d===void 0?void 0:(r=d.getBinding("anyText"))===null||r===void 0?void 0:r.attachChange(e=>{const t=e.getSource().getExternalValue();i.setProperty(o,t)})}},_setActionEnablementForTable:function(e,n,o,i,a){n.setProperty(`dynamicActions/${o}`,{bEnabled:false,aApplicable:[],aNotApplicable:[]});const l=[],s=[],r=`${n.getPath()}/dynamicActions/${o}/bEnabled`;if(typeof i==="object"&&i!==null&&i!==undefined){if(e){const t=e.getObject();const o=g(i,"PathInModel",function(e){return t?v(t[e.path]):v(false)},true);const a=p(o);if(a==="true"){n.getModel().setProperty(r,true);l.push(e)}else{s.push(e)}}t.setDynamicActionContexts(n,o,l,s)}else{const l=e===null||e===void 0?void 0:e.getObject();if(i===null&&!!l[`#${o}`]){n.getModel().setProperty(r,true)}else if(e!==undefined){a.push(t.requestProperty(e,o,i,r))}}return a}};return b},false);
|
|
7
7
|
/*!
|
|
8
8
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
9
9
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
10
10
|
*/
|
|
11
|
-
sap.ui.predefine("sap/fe/core/AppComponent", ["sap/base/Log","sap/fe/core/AppStateHandler","sap/fe/core/controllerextensions/routing/RouterProxy","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/ModelHelper","sap/fe/core/library","sap/fe/core/manifestMerger/ChangePageConfiguration","sap/fe/core/support/Diagnostics","sap/ui/core/Core","sap/ui/core/UIComponent","sap/ui/model/json/JSONModel","./controllerextensions/BusyLocker","./converters/MetaModelConverter","./helpers/SemanticDateOperators"],function(e,t,o,i,r,n,a,s,u,
|
|
11
|
+
sap.ui.predefine("sap/fe/core/AppComponent", ["sap/base/Log","sap/fe/core/AppStateHandler","sap/fe/core/controllerextensions/routing/RouterProxy","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/ModelHelper","sap/fe/core/library","sap/fe/core/manifestMerger/ChangePageConfiguration","sap/fe/core/support/Diagnostics","sap/ui/core/Core","sap/ui/core/Element","sap/ui/core/UIComponent","sap/ui/mdc/table/TableTypeBase","sap/ui/model/json/JSONModel","./controllerextensions/BusyLocker","./converters/MetaModelConverter","./helpers/SemanticDateOperators"],function(e,t,o,i,r,n,a,s,c,u,l,p,d,f,g,v){"use strict";var C,h,R;var N=g.deleteModelCacheData;var S=a.cleanPageConfigurationChanges;var M=a.changeConfiguration;var A=i.defineUI5Class;function E(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;y(e,t)}function y(e,t){y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,o){t.__proto__=o;return t};return y(e,t)}const m=n.StartupMode;p.prototype.exit=function(){var e;(e=this._oManagedObjectModel)===null||e===void 0?void 0:e.destroy();delete this._oManagedObjectModel;u.prototype.exit.apply(this,[])};const w={FCL:{VIEWNAME:"sap.fe.core.rootView.Fcl",VIEWNAME_COMPATIBILITY:"sap.fe.templates.RootContainer.view.Fcl",ROUTERCLASS:"sap.f.routing.Router"},NAVCONTAINER:{VIEWNAME:"sap.fe.core.rootView.NavContainer",VIEWNAME_COMPATIBILITY:"sap.fe.templates.RootContainer.view.NavContainer",ROUTERCLASS:"sap.m.routing.Router"}};let I=(C=A("sap.fe.core.AppComponent",{interfaces:["sap.ui.core.IAsyncContentCreation"],config:{fullWidth:true},manifest:{"sap.ui5":{services:{resourceModel:{factoryName:"sap.fe.core.services.ResourceModelService",startup:"waitFor",settings:{bundles:["sap.fe.core.messagebundle"],modelName:"sap.fe.i18n"}},routingService:{factoryName:"sap.fe.core.services.RoutingService",startup:"waitFor"},shellServices:{factoryName:"sap.fe.core.services.ShellServices",startup:"waitFor"},ShellUIService:{factoryName:"sap.ushell.ui5service.ShellUIService"},navigationService:{factoryName:"sap.fe.core.services.NavigationService",startup:"waitFor"},environmentCapabilities:{factoryName:"sap.fe.core.services.EnvironmentService",startup:"waitFor"},sideEffectsService:{factoryName:"sap.fe.core.services.SideEffectsService",startup:"waitFor"},asyncComponentService:{factoryName:"sap.fe.core.services.AsyncComponentService",startup:"waitFor"}},rootView:{viewName:w.NAVCONTAINER.VIEWNAME,type:"XML",async:true,id:"appRootView"},routing:{config:{controlId:"appContent",routerClass:w.NAVCONTAINER.ROUTERCLASS,viewType:"XML",controlAggregation:"pages",async:true,containerOptions:{propagateModel:true}}}}},designtime:"sap/fe/core/designtime/AppComponent.designtime",library:"sap.fe.core"}),C(h=(R=function(i){E(a,i);function a(){var e;for(var t=arguments.length,o=new Array(t),r=0;r<t;r++){o[r]=arguments[r]}e=i.call(this,...o)||this;e.startupMode=m.Normal;return e}var u=a.prototype;u._isFclEnabled=function e(){var t,o;const i=this.getManifestEntry("sap.ui5");return(i===null||i===void 0?void 0:(t=i.routing)===null||t===void 0?void 0:(o=t.config)===null||o===void 0?void 0:o.routerClass)===w.FCL.ROUTERCLASS};u.initializeFeatureToggles=async function e(){return Promise.resolve()};u.changePageConfiguration=function e(t,o,i){M(this.getManifest(),t,o,i,true)};u.getRouterProxy=function e(){return this._oRouterProxy};u.getAppStateHandler=function e(){return this._oAppStateHandler};u.getRootViewController=function e(){return this.getRootControl().getController()};u.getRootContainer=function e(){return this.getRootControl().getContent()[0]};u.getStartupMode=function e(){return this.startupMode};u.setStartupModeCreate=function e(){this.startupMode=m.Create};u.setStartupModeAutoCreate=function e(){this.startupMode=m.AutoCreate};u.setStartupModeDeeplink=function e(){this.startupMode=m.Deeplink};u.init=function c(){var u,l;const p=new d({editMode:n.EditMode.Display,isEditable:false,draftStatus:n.DraftStatus.Clear,busy:false,busyLocal:{},pages:{}});const f=new d({pages:{}});p.setDefaultBindingMode("OneWay");r.enhanceUiJSONModel(p,n);r.enhanceInternalJSONModel(f);this.setModel(p,"ui");this.setModel(f,"internal");this.bInitializeRouting=this.bInitializeRouting!==undefined?this.bInitializeRouting:true;this._oRouterProxy=new o;this._oAppStateHandler=new t(this);this._oDiagnostics=new s;const g=this.getModel();if(g!==null&&g!==void 0&&(u=g.isA)!==null&&u!==void 0&&u.call(g,"sap.ui.model.odata.v4.ODataModel")){this.entityContainer=g.getMetaModel().requestObject("/$EntityContainer/")}else{this.entityContainer=Promise.resolve()}const C=this.getManifest()["sap.ui5"];if(C!==null&&C!==void 0&&(l=C.rootView)!==null&&l!==void 0&&l.viewName){var h,R,N,S,M,A;if(C.rootView.viewName===w.FCL.VIEWNAME_COMPATIBILITY){C.rootView.viewName=w.FCL.VIEWNAME}else if(C.rootView.viewName===w.NAVCONTAINER.VIEWNAME_COMPATIBILITY){C.rootView.viewName=w.NAVCONTAINER.VIEWNAME}if(C.rootView.viewName===w.FCL.VIEWNAME&&((h=C.routing)===null||h===void 0?void 0:(R=h.config)===null||R===void 0?void 0:R.routerClass)===w.FCL.ROUTERCLASS){e.info(`Rootcontainer: "${w.FCL.VIEWNAME}" - Routerclass: "${w.FCL.ROUTERCLASS}"`)}else if(C.rootView.viewName===w.NAVCONTAINER.VIEWNAME&&((N=C.routing)===null||N===void 0?void 0:(S=N.config)===null||S===void 0?void 0:S.routerClass)===w.NAVCONTAINER.ROUTERCLASS){e.info(`Rootcontainer: "${w.NAVCONTAINER.VIEWNAME}" - Routerclass: "${w.NAVCONTAINER.ROUTERCLASS}"`)}else if(((M=C.rootView)===null||M===void 0?void 0:(A=M.viewName)===null||A===void 0?void 0:A.indexOf("sap.fe.core.rootView"))!==-1){var E,y;throw Error(`\nWrong configuration for the couple (rootView/routerClass) in manifest file.\n`+`Current values are :(${C.rootView.viewName}/${((E=C.routing)===null||E===void 0?void 0:(y=E.config)===null||y===void 0?void 0:y.routerClass)||"<missing router class>"})\n`+`Expected values are \n`+`\t - (${w.NAVCONTAINER.VIEWNAME}/${w.NAVCONTAINER.ROUTERCLASS})\n`+`\t - (${w.FCL.VIEWNAME}/${w.FCL.ROUTERCLASS})`)}else{e.info(`Rootcontainer: "${C.rootView.viewName}" - Routerclass: "${w.NAVCONTAINER.ROUTERCLASS}"`)}}v.addSemanticDateOperators();i.prototype.init.call(this);a.instanceMap[this.getId()]=this};u.onServicesStarted=async function t(){await this.initializeFeatureToggles();const o=()=>{this.entityContainer.then(()=>{if(this.getRootViewController().attachRouteMatchers){this.getRootViewController().attachRouteMatchers()}this.getRouter().initialize();this.getRouterProxy().init(this,this._isFclEnabled());return}).catch(e=>{const t=c.getLibraryResourceBundle("sap.fe.core");this.getRootViewController().displayErrorPage(t.getText("C_APP_COMPONENT_SAPFE_APPSTART_TECHNICAL_ISSUES"),{title:t.getText("C_COMMON_SAPFE_ERROR"),description:e.message,FCLLevel:0})})};if(this.bInitializeRouting){return this.getRoutingService().initializeRouting().then(()=>{if(this.getRootViewController()){o()}else{this.getRootControl().attachAfterInit(function(){o()})}return}).catch(function(t){e.error(`cannot cannot initialize routing: ${t.toString()}`)})}};u.exit=function e(){this._oAppStateHandler.destroy();this._oRouterProxy.destroy();delete this._oAppStateHandler;delete this._oRouterProxy;N(this.getMetaModel());this.getModel("ui").destroy();S()};u.getMetaModel=function e(){return this.getModel().getMetaModel()};u.getDiagnostics=function e(){return this._oDiagnostics};u.destroy=function t(o){var r;try{delete a.instanceMap[this.getId()];delete window._routing}catch(t){e.info(t)}const n=this.oModels[undefined];let s;if(n.oRequestor){s=jQuery.extend({},n.oRequestor.mHeaders)}(r=this.getRoutingService())===null||r===void 0?void 0:r.beforeExit();i.prototype.destroy.call(this,o);if(s&&n.oRequestor){n.oRequestor.mHeaders=s}};u.getRoutingService=function e(){return{}};u.getShellServices=function e(){return{}};u.getNavigationService=function e(){return{}};u.getSideEffectsService=function e(){return{}};u.getEnvironmentCapabilities=function e(){return{}};u.getStartupParameters=async function e(){const t=this.getComponentData();return Promise.resolve(t&&t.startupParameters||{})};u.restore=function e(){this.getRootViewController().viewState.onRestore()};u.suspend=function e(){this.getRootViewController().viewState.onSuspend()};u.navigateBasedOnStartupParameter=async function t(o){try{if(!f.isLocked(this.getModel("ui"))){if(!o){o=null}const e=this.getRoutingService();await e._manageDeepLinkStartup(o)}}catch(t){e.error(t);f.unlock(this.getModel("ui"))}};return a}(l),R.instanceMap={},R))||h);return I},false);
|
|
12
12
|
/*!
|
|
13
13
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
14
14
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
15
15
|
*/
|
|
16
|
-
sap.ui.predefine("sap/fe/core/AppStateHandler", ["sap/base/Log","sap/base/util/deepEqual","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/ToES6Promise","sap/fe/navigation/library","sap/ui/base/Object","./controllerextensions/BusyLocker","./helpers/ModelHelper"],function(t,e,n,o,a,i,r,
|
|
16
|
+
sap.ui.predefine("sap/fe/core/AppStateHandler", ["sap/base/Log","sap/base/util/deepEqual","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/ToES6Promise","sap/fe/navigation/library","sap/ui/base/Object","./controllerextensions/BusyLocker","./helpers/ModelHelper"],function(t,e,n,o,a,i,r,p){"use strict";var s,l;var c=n.defineUI5Class;function u(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;f(t,e)}function f(t,e){f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,n){e.__proto__=n;return e};return f(t,e)}const h=a.NavType;let S=(s=c("sap.fe.core.AppStateHandler"),s(l=function(n){u(a,n);function a(e){var o;o=n.call(this)||this;o._mCurrentAppState={};o.oAppComponent=e;o.sId=`${e.getId()}/AppStateHandler`;o.nbSimultaneousCreateRequest=0;o.bNoRouteChange=false;t.info("APPSTATE : Appstate handler initialized");return o}var i=a.prototype;i.getId=function t(){return this.sId};i.createAppState=async function n(){if(!this.oAppComponent.getEnvironmentCapabilities().getCapabilities().AppState||r.isLocked(this)){return}const o=this.oAppComponent.getNavigationService(),a=this.oAppComponent.getRouterProxy(),i=a.getHash(),s=this.oAppComponent.getRootControl().getController(),l=p.isStickySessionSupported(this.oAppComponent.getMetaModel());if(!s.viewState){throw new Error(`viewState controller extension not available for controller: ${s.getMetadata().getName()}`)}const c=await s.viewState.retrieveViewState();const u={appState:c};if(c&&!e(this._mCurrentAppState,c)){this._mCurrentAppState=c;try{this.nbSimultaneousCreateRequest++;const e=await o.storeInnerAppStateAsync(u,true,true);t.info("APPSTATE: Appstate stored");const n=o.replaceInnerAppStateKey(i,e);this.nbSimultaneousCreateRequest--;if(this.nbSimultaneousCreateRequest===0&&n!==i){a.navToHash(n,undefined,undefined,undefined,!l);this.bNoRouteChange=true}t.info("APPSTATE: navToHash")}catch(e){t.error(e)}}return u};i._createNavigationParameters=function t(e,n){return Object.assign({},e,{selectionVariantDefaults:e.oDefaultedSelectionVariant,selectionVariant:e.oSelectionVariant,requiresStandardVariant:!e.bNavSelVarHasDefaultsOnly,navigationType:n})};i._checkIfLastSeenRecord=function t(e){const n=e&&e.getBindingContext("internal");if(n&&n.getProperty("fclColumnClosed")===true){const t=n&&n.getProperty("technicalKeysOfLastSeenRecord");const o=e===null||e===void 0?void 0:e.getBindingContext();const a=o&&o.getPath()||"";const i=o===null||o===void 0?void 0:o.getModel().getMetaModel();const r=i===null||i===void 0?void 0:i.getMetaPath(a);const p=i===null||i===void 0?void 0:i.getObject(`${r}/$Type/$Key`);for(let e=0;e<p.length;e++){const a=o.getObject()[p[e]];if(a!==t[p[e]]){n.setProperty("fclColumnClosed",false);return true}}}return false};i._getAppStateData=function t(e,n,o){let a="",i=0;const r=o===h.hybrid?e.iAppState:e;if(r!==null&&r!==void 0&&r.appState){for(i=0;i<Object.keys(r.appState).length;i++){if(Object.keys(r.appState)[i]===n){a=Object.keys(r.appState)[i];break}}}if(r!==null&&r!==void 0&&r.appState){return{[Object.keys(r.appState)[i]]:r.appState[a]||{}}}};i.applyAppState=async function e(n,a){if(!this.oAppComponent.getEnvironmentCapabilities().getCapabilities().AppState||r.isLocked(this)){return Promise.resolve()}const i=this._checkIfLastSeenRecord(a);if(i===true){return Promise.resolve()}r.lock(this);r.lock(this.oAppComponent.getRootControl());const p=this.oAppComponent.getNavigationService();return o(p.parseNavigation()).catch(function(e){if(!e){e=[]}t.warning("APPSTATE: Parse Navigation failed",e[0]);return[{},e[1],e[2]]}).then(e=>{t.info("APPSTATE: Parse Navigation done");const o=e[0]||{},a=e[2]||h.initial,i=this.oAppComponent.getRootControl().getController();const r=this._getAppStateData(o,n,a);this._mCurrentAppState=a===h.iAppState||a===h.hybrid?r:undefined;if(!i.viewState){throw new Error(`viewState extension required for controller ${i.getMetadata().getName()}`)}if((!o||Object.keys(o).length===0)&&a==h.iAppState){if(!i.viewState._getInitialStateApplied()){i.viewState._setInitialStateApplied()}return{}}return i.viewState.applyViewState(this._mCurrentAppState,this._createNavigationParameters(o,a))}).catch(function(e){t.error("appState could not be applied",e);throw e}).finally(()=>{r.unlock(this);r.unlock(this.oAppComponent.getRootControl())})};i.checkIfRouteChangedByIApp=function t(){return this.bNoRouteChange};i.resetRouteChangedByIApp=function t(){if(this.bNoRouteChange){this.bNoRouteChange=false}};return a}(i))||l);return S},true);
|
|
17
17
|
/*!
|
|
18
18
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
19
19
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -23,7 +23,7 @@ sap.ui.predefine("sap/fe/core/BaseController", ["sap/fe/core/CommonUtils","sap/f
|
|
|
23
23
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
24
24
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
25
25
|
*/
|
|
26
|
-
sap.ui.predefine("sap/fe/core/CommonUtils", ["sap/base/Log","sap/base/util/array/uniqueSort","sap/base/util/merge","sap/fe/core/converters/ConverterContext","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticDateOperators","sap/fe/core/helpers/StableIdHelper","sap/fe/core/type/TypeUtil","sap/ui/core/Component","sap/ui/core/Fragment","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/Device","sap/ui/mdc/condition/FilterOperatorUtil","sap/ui/mdc/condition/RangeOperator","sap/ui/model/Filter","./controls/AnyElement","./helpers/MetaModelFunction","./templating/FilterHelper"],function(e,t,n,o,i,r,s,a,c,l,u,p,f,d,g,m,b,O,h,v,P){"use strict";var y={};var S=P.getConditions;var E=g.system;var j=c.generate;var C=r.pathInModel;var $=r.compileExpression;function T(e){if(!e){return undefined}return e.replace(/"/g," ").replace(/\\/g,"\\\\").split(/\s+/).reduce(function(e,t){if(t!==""){e=`${e?`${e} `:""}"${t}"`}return e},undefined)}async function A(e){var t;const n=e.getModel();const o=n.getMetaModel();const r=o.getMetaPath(e.getPath());const s=i.getInvolvedDataModelObjects(o.getContext(r));await e.requestProperty((t=s.targetEntityType.keys[0])===null||t===void 0?void 0:t.name)}function x(e){let t=false;if(e){e.getCurrentContexts().forEach(function(e){if(e&&e.isTransient()){t=true}})}return t}async function F(e,t,n,o){return e.getLinks({semanticObject:n,params:o})}function N(e){const t=[];const n=Object.keys(e);let o;for(let i=0;i<n.length;i++){o={LocalProperty:{$PropertyPath:n[i]},SemanticObjectProperty:e[n[i]]};t.push(o)}return t}function M(e,t,n,o,i){for(let r=0;r<e.length;r++){const s=e[r];const a=s.intent;const c=a.split("-")[1].split("?")[0];if(i&&i.includes(c)){o.push({text:s.text,targetSemObject:a.split("#")[1].split("-")[0],targetAction:c.split("~")[0],targetParams:n})}else if(!i&&t&&t.indexOf(c)===-1){o.push({text:s.text,targetSemObject:a.split("#")[1].split("-")[0],targetAction:c.split("~")[0],targetParams:n})}}}function w(e,t,n,o){if(o&&o.length>0){const i=e.allowedActions||undefined;const r=e.unavailableActions?e.unavailableActions:[];const s=e.mapping?N(e.mapping):[];const a={navigationContexts:t,semanticObjectMapping:s};M(o,r,a,n,i)}}function R(e,t,n,o){if(o.length>0){const i=[e.action];const r=[];const s=[];const a={navigationContexts:t,semanticObjectMapping:s};M(o,r,a,n,i)}}async function D(t,n,o,i,r,s,a){const c=a.getShellServices();const l={};let u="",p="";let f;let d=[];let g=[];let m;async function b(){const e=c.parseShellHash(document.location.hash);u=e.semanticObject;p=e.action;return F(c,o,u,l)}try{if(n){if(i&&i.length>0){for(let e=0;e<i.length;e++){const t=i[e].$PropertyPath;if(!l[t]){l[t]={value:n[t]}}}}else{const e=r.getObject(`${s}/$Type/$Key`);for(const t in e){const o=e[t];if(!l[o]){l[o]={value:n[o]}}}}}const e=_(o).getViewData();const O=[];let h;if(e.additionalSemanticObjects){m=Object.keys(e.additionalSemanticObjects);for(let n=0;n<m.length;n++){h=await Promise.resolve(F(c,o,m[n],l));w(e.additionalSemanticObjects[m[n]],t,O,h)}}const v=[];const P=a.getComponentData();if(P.feEnvironment&&P.feEnvironment.getIntent()){const e=P.feEnvironment.getIntent();h=await Promise.resolve(F(c,o,e.semanticObject,l));R(e,t,v,h)}const y=o.getBindingContext("internal");const S=await b();if(S){if(S.length>0){let n=false;const o={};const i=[];const a=`${s}@`;const c=`${s}/@`;const l=r.getObject(a);f=qe.getSemanticObjectAnnotations(l,u);if(!f.bHasEntitySetSO){const e=r.getObject(c);f=qe.getSemanticObjectAnnotations(e,u)}g=f.aUnavailableActions;g.push(p);o.navigationContexts=t;o.semanticObjectMapping=f.aMappings;M(S,g,o,i);O.forEach(function(e){var t;let{targetSemObject:o}=e;if(((t=i[0])===null||t===void 0?void 0:t.targetSemObject)===o){n=true}});if(e.additionalSemanticObjects&&i[0]&&e.additionalSemanticObjects[i[0].targetSemObject]&&!!e.additionalSemanticObjects[i[0].targetSemObject].allowedActions){n=true}const m=O.concat(v);d=n?m:m.concat(i);y.setProperty("relatedApps/visibility",d.length>0);y.setProperty("relatedApps/items",d)}else{y.setProperty("relatedApps/visibility",false)}}else{y.setProperty("relatedApps/visibility",false)}}catch(t){e.error("Cannot read links",t)}return d}function k(e,t){const n={bHasEntitySetSO:false,aAllowedActions:[],aUnavailableActions:[],aMappings:[]};let o,i;let r;for(const s in e){if(s.indexOf("com.sap.vocabularies.Common.v1.SemanticObject")>-1&&e[s]===t){n.bHasEntitySetSO=true;o=`@${"com.sap.vocabularies.Common.v1.SemanticObjectMapping"}`;i=`@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`;if(s.indexOf("#")>-1){r=s.split("#")[1];o=`${o}#${r}`;i=`${i}#${r}`}if(e[o]){n.aMappings=n.aMappings.concat(e[o])}if(e[i]){n.aUnavailableActions=n.aUnavailableActions.concat(e[i])}break}}return n}function L(t,n){const o=t.getModel().getMetaModel();const i=t.getBindingContext();const r=i&&i.getPath()||"";const s=o.getMetaPath(r);const a=`${s}/`+`@com.sap.vocabularies.Common.v1.SemanticKey`;const c=o.getObject(a);const l=i===null||i===void 0?void 0:i.getObject();if(!l&&i){i.requestObject().then(async function(e){return qe.updateRelateAppsModel(i,e,t,c,o,s,n)}).catch(function(t){e.error("Cannot update the related app details",t)})}else{return qe.updateRelateAppsModel(i,l,t,c,o,s,n)}}function I(e){if(e&&e.isA(["sap.m.Button","sap.m.OverflowToolbarButton"])&&e.getVisible()&&e.getEnabled()){e.firePress()}}function B(e){if(e.isA("sap.fe.core.AppComponent")){return e}const t=u.getOwnerComponentFor(e);if(!t){throw new Error("There should be a sap.fe.core.AppComponent as owner of the control")}else{return B(t)}}function V(e){const t=e.getRootViewController();return t.isFclEnabled()?t.getRightmostView():qe.getTargetView(e.getRootContainer().getCurrentPage())}function _(e){if(e&&e.isA("sap.ui.core.ComponentContainer")){const t=e.getComponentInstance();e=t&&t.getRootControl()}while(e&&!e.isA("sap.ui.core.mvc.View")){e=e.getParent()}return e}function W(e,t){for(const n in t){if(t[n]!==e[n]){return false}}return true}function q(e,t,n){const o=e.getObject(`${t}/`)||{},i={};for(const e in o){if(o.hasOwnProperty(e)&&!/^\$/i.test(e)&&o[e].$kind&&W(o[e],n||{$kind:"Property"})){i[e]=o[e]}}return i}function G(e,t){let n=[];if(e&&t){n=e.getObject(`${t}@Org.OData.Capabilities.V1.FilterRestrictions/RequiredProperties`)}return n}function U(e,t){const n=e&&e.getActions();if(n){n.forEach(function(e){if(e.isA("sap.ui.mdc.actiontoolbar.ActionToolbarAction")){e=e.getAction()}if(e.isA("sap.m.MenuButton")){const n=e.getMenu();const o=n.getItems();o.forEach(e=>{if(e.data("IBNData")){t.push(e)}})}else if(e.data("IBNData")){t.push(e)}})}return t}function H(t,n){const o={};const i=qe.getAppComponent(n);const r=s.isStickySessionSupported(n.getModel().getMetaModel());const a=function(n){if(n){const e=Object.keys(n);e.forEach(function(e){if(e.indexOf("_")!==0&&e.indexOf("odata.context")===-1){o[e]={value:n[e]}}})}if(t.length){t.forEach(function(t){const n=t.data("IBNData").semanticObject;const s=t.data("IBNData").action;i.getShellServices().getLinks({semanticObject:n,action:s,params:o}).then(function(e){t.setVisible(t.getVisible()&&e&&e.length===1);if(r){t.getBindingContext("internal").setProperty(t.getId().split("--")[1],{shellNavigationNotAvailable:!(e&&e.length===1)})}return}).catch(function(t){e.error("Cannot retrieve the links from the shell service",t)})})}};if(n&&n.getBindingContext()){var c;(c=n.getBindingContext())===null||c===void 0?void 0:c.requestObject().then(function(e){return a(e)}).catch(function(t){e.error("Cannot retrieve the links from the shell service",t)})}else{a()}}function Q(e,t,n,o){const i=!n?e.getObject(e.getPath()).toString():n;let r=e.getPath().split("/@")[0];const s=e.getObject(r).$Type;const a=Y(e.getModel(),s);if(a){r=`/${a}`}if(o){return e.getObject(`${r}/${i}@Org.OData.Core.V1.OperationAvailable`)}if(t){return`${r}/${i}`}else{return{sContextPath:r,sProperty:e.getObject(`${r}/${i}@Org.OData.Core.V1.OperationAvailable/$Path`),sBindingParameter:e.getObject(`${r}/${i}/@$ui5.overload/0/$Parameter/0/$Name`)}}}function Y(e,t){const n=e.getObject("/");for(const e in n){if(typeof n[e]==="object"&&n[e].$Type===t){return e}}}function K(e,t){const n=e["@com.sap.vocabularies.Common.v1.Text"],o=n&&(e&&e["@com.sap.vocabularies.Common.v1.Text@com.sap.vocabularies.UI.v1.TextArrangement"]||t&&t["@com.sap.vocabularies.UI.v1.TextArrangement"]);if(o){if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextOnly"){return"Description"}else if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextLast"){return"ValueDescription"}else if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextSeparate"){return"Value"}return"DescriptionValue"}return n?"DescriptionValue":"Value"}function z(e){const t=e.getModel().getMetaModel();return t.getObject(`${t.getMetaPath(e.getPath())}/$Type`)}async function J(t,n,o){let i=n;const r=t.indexOf("(");if(r>-1){const n=t.slice(r+1,-1);let o=z(i);while(o!==n){i=i.getBinding().getContext();if(i){o=z(i)}else{e.warning("Cannot determine target type to request property value for bound action invocation");return Promise.resolve(undefined)}}}return i.requestObject(o)}async function X(e,t,n,o){const i=n&&n.indexOf("/")===0?De(n,e.getModel()):J(t,e,n);return i.then(function(n){return{vPropertyValue:n,oSelectedContext:e,sAction:t,sDynamicActionEnabledPath:o}})}async function Z(t,n){return Promise.all(n).then(function(e){if(e.length){const n=[],o=[];e.forEach(function(e){if(e){if(e.vPropertyValue){t.getModel().setProperty(e.sDynamicActionEnabledPath,true);n.push(e.oSelectedContext)}else{o.push(e.oSelectedContext)}}});ee(t,e[0].sAction,n,o)}return}).catch(function(t){e.trace("Cannot retrieve property value from path",t)})}function ee(e,t,n,o){const i=`${e.getPath()}/dynamicActions/${t}`,r=e.getModel();r.setProperty(`${i}/aApplicable`,n);r.setProperty(`${i}/aNotApplicable`,o)}function te(e){const t=l.getDataTypeClassName(e);const n=l.getBaseType(t,{},{});return m.getOperatorsForType(n)}function ne(e,t){return e.filter(function(e){return t.indexOf(e)>-1})}function oe(e){const t=qe.AllowedExpressionsPrio;e.sort(function(e,n){return t.indexOf(e)-t.indexOf(n)});return e[0]}function ie(e,t,n,o,i,r){const s=qe.getFilterRestrictionsByPath(t,n);const c=["EQ"];const l=["EQ","GE","LE","LT","GT","BT","NOTLE","NOTLT","NOTGE","NOTGT"];const u=["EQ","BT"];const p=["TODAY","TOMORROW","YESTERDAY","DATE","FIRSTDAYWEEK","LASTDAYWEEK","FIRSTDAYMONTH","LASTDAYMONTH","FIRSTDAYQUARTER","LASTDAYQUARTER","FIRSTDAYYEAR","LASTDAYYEAR"];const f=["EQ","GE","LE","LT","GT","BT","NE","NOTBT","NOTLE","NOTLT","NOTGE","NOTGT"];const d=["Contains","NotContains","StartsWith","NotStartsWith","EndsWith","NotEndsWith"];const g=a.getSupportedOperations();const m=i==="true"||i===true;let b=[];const O=r&&typeof r==="string"?JSON.parse(r).customData:r;if(n.getObject(`${t}/@com.sap.vocabularies.Common.v1.ResultContext`)===true){return c}if(O&&O.operatorConfiguration&&O.operatorConfiguration.length>0){b=a.getFilterOperations(O.operatorConfiguration,o)}else{b=a.getSemanticDateOperations(o)}let h=te(o);if(m){h=g.concat(h)}let v=[];if(s&&s.FilterAllowedExpressions&&s.FilterAllowedExpressions[e]){const t=qe.getSpecificAllowedExpression(s.FilterAllowedExpressions[e]);switch(t){case"SingleValue":const e=o==="Edm.Date"&&m?p:c;v=ne(h,e);break;case"MultiValue":v=ne(h,c);break;case"SingleRange":let t;if(m){if(o==="Edm.Date"){t=b}else if(o==="Edm.DateTimeOffset"){t=b}else{t=l}}else if(o==="Edm.DateTimeOffset"){t=u}else{t=l}const n=ne(h,t);v=n;break;case"MultiRange":v=ne(h,f);break;case"SearchExpression":v=ne(h,d);break;case"MultiRangeOrSearchExpression":v=ne(h,d.concat(f));break;default:break}}return v}y.getOperatorsForProperty=ie;function re(){const e=["EQ","NE"];return e.toString()}function se(e){const t=te(e);const n=["EQ","GE","LE","LT","GT","BT","NE","NOTBT","NOTLE","NOTLT","NOTGE","NOTGT"];return ne(t,n)}function ae(e,t){const n=t.substring(0,t.lastIndexOf("/"));const o=e.getObject(`${n}/@com.sap.vocabularies.Common.v1.ResultContext`);const i={};if(o&&n!==t){i.contextPath=n;i.parameterProperties=qe.getContextPathProperties(e,n)}return i}function ce(e,t,n,o,i){var r;const s=S(i,e);if(i!==null&&i!==void 0&&i.SemanticDates&&n&&n.indexOf(i===null||i===void 0?void 0:(r=i.SemanticDates)===null||r===void 0?void 0:r.operator)>-1){const e=qe.addSemanticDatesToConditions(i===null||i===void 0?void 0:i.SemanticDates);if(e&&Object.keys(e).length>0){o.push(e)}}else if(s){if(t.length===0||t.indexOf(s.operator)>-1){o.push(s)}}return o}function le(e){const t=[];if(e!==null&&e!==void 0&&e.high){t.push(e===null||e===void 0?void 0:e.high)}if(e!==null&&e!==void 0&&e.low){t.push(e===null||e===void 0?void 0:e.low)}return{values:t,operator:e===null||e===void 0?void 0:e.operator,isEmpty:undefined}}function ue(e,t,n,o,i,r,s,a,c,l,u,p){let f=[],d,g,m=[];if(c||v.isPropertyFilterable(a,e,r,true)){const b=s[r];d=t.getSelectOption(n);const O=fe(p,r);g=c?["EQ"]:qe.getOperatorsForProperty(r,e,a);if(u){m=c?["EQ"]:qe.getOperatorsForProperty(r,e,a,b===null||b===void 0?void 0:b.$Type,u,O)}f=c?qe.addSelectOptionToConditions(b,g,m,f,d[0]):d.reduce(qe.addSelectOptionToConditions.bind(null,b,g,m),f);if(f.length){if(i){o[i+r]=o.hasOwnProperty(i+r)?o[i+r].concat(f):f}else if(l){f.forEach(e=>{e["filtered"]=true});if(o.hasOwnProperty(r)){o[r].forEach(e=>{e["filtered"]=false});o[r]=o[r].concat(f)}else{o[r]=f}}else{o[r]=o.hasOwnProperty(r)?o[r].concat(f):f}}}}function pe(e){var t,n;return{high:(e===null||e===void 0?void 0:(t=e.values)===null||t===void 0?void 0:t[0])||null,low:(e===null||e===void 0?void 0:(n=e.values)===null||n===void 0?void 0:n[1])||null,operator:e===null||e===void 0?void 0:e.operator}}function fe(){var e,t;let n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};let o=arguments.length>1?arguments[1]:undefined;const i=n===null||n===void 0?void 0:n.controlConfiguration;const r=i&&((e=i["@com.sap.vocabularies.UI.v1.SelectionFields"])===null||e===void 0?void 0:e.filterFields);return r!==null&&r!==void 0&&r[o]?(t=r[o])===null||t===void 0?void 0:t.settings:undefined}function de(e,t,n,o,i,r,s){const a=e.getSelectOptionsPropertyNames(),c=qe.getContextPathProperties(n,o),l=Object.keys(c),u=qe.getParameterInfo(n,o),p=u.contextPath,f=u.parameterProperties;if(p!==undefined&&f&&Object.keys(f).length>0){const o=Object.keys(f);o.forEach(function(o){let c;if(a.includes(`$Parameter.${o}`)){c=`$Parameter.${o}`}else if(a.includes(o)){c=o}else if(o.startsWith("P_")&&a.includes(`$Parameter.${o.slice(2,o.length)}`)){c=`$Parameter.${o.slice(2,o.length)}`}else if(o.startsWith("P_")&&a.includes(o.slice(2,o.length))){c=o.slice(2,o.length)}else if(a.includes(`$Parameter.P_${o}`)){c=`$Parameter.P_${o}`}else if(a.includes(`P_${o}`)){c=`P_${o}`}if(c){ue(p,e,c,t,undefined,o,f,n,true,i,r,s)}})}l.forEach(function(l){let u;if(a.includes(l)){u=l}else if(l.startsWith("P_")&&a.includes(l.slice(2,l.length))){u=l.slice(2,l.length)}else if(a.includes(`P_${l}`)){u=`P_${l}`}if(u){ue(o,e,u,t,undefined,l,c,n,false,i,r,s)}});a.forEach(function(a){if(a.indexOf(".")>0&&!a.includes("$Parameter")){const c=a.replaceAll(".","/");const l=`/${c}`.startsWith(o)?`/${c}`:`${o}/${c}`;if(n.getObject(l.replace("P_",""))){ge(l,o,e,a,n,t,i,r,s)}}});return t}function ge(e,t,n,o,i,r,s,a,c){let l=o.split(".");if(`/${o.replaceAll(".","/")}`.startsWith(t)){const e=`/${o}`.replaceAll(".","/"),n=e.replace(`${t}/`,"");l=n.split("/")}let u="";const p=l[l.length-1];for(let e=0;e<l.length-1;e++){if(i.getObject(`${t}/${l[e].replace("P_","")}`).$isCollection){u=`${u+l[e]}*/`}else{u=`${u+l[e]}/`}t=`${t}/${l[e]}`}const f=e.slice(0,e.lastIndexOf("/")),d=qe.getContextPathProperties(i,f),g=n.getSelectOptionsPropertyNames();let m=p;if(d[p]){m=p}else if(p.startsWith("P_")&&d[p.replace("P_","")]){m=p.replace("P_","")}else if(d[`P_${p}`]&&g.includes(`P_${p}`)){m=`P_${p}`}if(p.startsWith("P_")&&r[u+m]){}else if(!p.startsWith("P_")&&r[u+m]){delete r[u+m];ue(f,n,o,r,u,m,d,i,false,s,a,c)}else{ue(f,n,o,r,u,m,d,i,false,s,a,c)}}function me(e,t,n){const o=qe.getAppComponent(n);const i=o.getNavigationService();return i.mixAttributesAndSelectionVariant(t,e.toJSONString())}function be(t,n,o,i){let r;const s=function(t,n,o){const i={option:"",sign:"I",low:n,high:o};switch(t){case"Contains":i.option="CP";break;case"StartsWith":i.option="CP";i.low+="*";break;case"EndsWith":i.option="CP";i.low=`*${i.low}`;break;case"BT":case"LE":case"LT":case"GT":case"NE":case"EQ":i.option=t;break;case"DATE":i.option="EQ";break;case"DATERANGE":i.option="BT";break;case"FROM":i.option="GE";break;case"TO":i.option="LE";break;case"EEQ":i.option="EQ";break;case"Empty":i.option="EQ";i.low="";break;case"NotContains":i.option="CP";i.sign="E";break;case"NOTBT":i.option="BT";i.sign="E";break;case"NotStartsWith":i.option="CP";i.low+="*";i.sign="E";break;case"NotEndsWith":i.option="CP";i.low=`*${i.low}`;i.sign="E";break;case"NotEmpty":i.option="NE";i.low="";break;case"NOTLE":i.option="LE";i.sign="E";break;case"NOTGE":i.option="GE";i.sign="E";break;case"NOTLT":i.option="LT";i.sign="E";break;case"NOTGT":i.option="GT";i.sign="E";break;default:e.warning(`${t} is not supported. ${r} could not be added to the navigation context`)}return i};const c=n.filterConditions;const l=n.filterConditionsWithoutConflict?n.filterConditionsWithoutConflict:{};const u=o.propertiesWithoutConflict?o.propertiesWithoutConflict:{};const p=function(e,t,n){const o=c[t];const r=i&&i.getPropertyHelper().getProperty(t);const l=r===null||r===void 0?void 0:r.typeConfig;const u=i&&i.getControlDelegate().getTypeUtil();for(const i in o){const r=o[i];let c="",f="I",d="",g=null,O;const h=m.getOperator(r.operator);if(h instanceof b){var p;O=qe.createSemanticDatesFromConditions(r);const e=h.getModelFilter(r,t,l===null||l===void 0?void 0:l.typeInstance,false,l===null||l===void 0?void 0:l.baseType);if(!(e!==null&&e!==void 0&&e.getFilters())&&!(e!==null&&e!==void 0&&(p=e.getFilters())!==null&&p!==void 0&&p.length)){f=h.exclude?"E":"I";d=u.externalizeValue(e.getValue1(),l.typeInstance);g=u.externalizeValue(e.getValue2(),l.typeInstance);c=e.getOperator()}}else{const e=a.getSupportedOperations();if(e.includes(r===null||r===void 0?void 0:r.operator)){O=qe.createSemanticDatesFromConditions(r)}const t=r.values[0]&&r.values[0].toString()||"";const n=r.values[1]&&r.values[1].toString()||null;const o=s(r.operator,t,n);f=h!==null&&h!==void 0&&h.exclude?"E":"I";d=o===null||o===void 0?void 0:o.low;g=o===null||o===void 0?void 0:o.high;c=o===null||o===void 0?void 0:o.option}if(c&&O){e.addSelectOption(n?n:t,f,c,d,g,undefined,O)}else if(c){e.addSelectOption(n?n:t,f,c,d,g)}}};for(r in c){if(!t.getSelectOption(r)){if(r==="$editState"){continue}p(t,r)}else{if(u&&r in u){p(t,r,u[r])}if(r in l){p(t,r,l[r])}}}return t}function Oe(e){const t=s.isStickySessionSupported(e.getModel().getMetaModel());const n=e.getModel("ui").getProperty("/isEditable");return t&&n}function he(e,t,n){if(t&&e&&e.length){for(let o=0;o<e.length;o++){const i=t.getSelectOption("DisplayCurrency"),r=n&&n.getSelectOption("DisplayCurrency");if(e[o].$PropertyPath==="DisplayCurrency"&&(!i||!i.length)&&r&&r.length){const e=r[0];const n=e["Sign"];const o=e["Option"];const i=e["Low"];const s=e["High"];t.addSelectOption("DisplayCurrency",n,o,i,s)}}}}async function ve(e,t,n,o,i,r){const s=e.getComponentData(),a=s&&s.startupParameters||{},c=e.getShellServices();const l=await c.getStartupAppState(e);const u=(l===null||l===void 0?void 0:l.getData())||{},p=u.selectionVariant&&u.selectionVariant.SelectOptions||[];t.forEach(function(e){var t;const s=o?`/${e.$Name}`:(t=e.getPath)===null||t===void 0?void 0:t.call(e).slice(e.getPath().lastIndexOf("/")+1);const c=o?s.slice(1):s;if(r&&i){if(r[c]){n.setProperty(s,r[c])}}else if(a[c]){n.setProperty(s,a[c][0])}else if(p.length>0){for(const e of p){if(e.PropertyName===c){const t=e.Ranges.length?e.Ranges[e.Ranges.length-1]:undefined;if(t&&t.Sign==="I"&&t.Option==="EQ"){n.setProperty(s,t.Low)}}}}})}function Pe(e,t){const n=t,o=n!==undefined?Object.keys(n).filter(function(e){return n[e].useForCreate}):[];let i;for(let t=0;t<o.length;t++){const n=o[t];const r=e&&e[n];if(r&&r.length===1){i=i||Object.create(null);i[n]=r[0]}}return i}function ye(e){const t=[];if(e.parameters){const n=Object.keys(e.parameters)||[];if(n.length>0){n.forEach(function(n){const o=e.parameters[n];if(o.value&&o.value.value&&o.value.format==="binding"){const e={LocalProperty:{$PropertyPath:o.value.value},SemanticObjectProperty:n};if(t.length>0){for(let n=0;n<t.length;n++){var i;if(((i=t[n].LocalProperty)===null||i===void 0?void 0:i.$PropertyPath)!==e.LocalProperty.$PropertyPath){t.push(e)}}}else{t.push(e)}}})}}return t}function Se(t,n){const o={};let i;const r=t.controlConfiguration;for(const t in r){if(t.indexOf("@com.sap.vocabularies.UI.v1.DataPoint")>-1||t.indexOf("@com.sap.vocabularies.UI.v1.Chart")>-1){var s,a;const c=(s=r[t].navigation)===null||s===void 0?void 0:(a=s.targetOutbound)===null||a===void 0?void 0:a.outbound;if(c!==undefined){const r=n[c];if(r.semanticObject&&r.action){if(t.indexOf("Chart")>-1){i=j(["fe","MicroChartLink",t])}else{i=j(["fe","HeaderDPLink",t])}const e=qe.getSemanticObjectMapping(r);o[i]={semanticObject:r.semanticObject,action:r.action,semanticObjectMapping:e}}else{e.error(`Cross navigation outbound is configured without semantic object and action for ${c}`)}}}}return o}function Ee(e,t){const n=typeof t==="string"?JSON.parse(t):t;for(let t=0;t<n.length;t++){const o=n[t]["LocalProperty"]&&n[t]["LocalProperty"]["$PropertyPath"]||n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]&&n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"];const i=n[t]["SemanticObjectProperty"]||n[t]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];const r=e.getSelectOption(o);if(r){e.removeSelectOption(o);e.massAddSelectOption(i,r)}}return e}async function je(e,t,n){return new Promise(function(o){let i,r;if(n===""){i=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObject"}`);r=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`)}else{i=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObject"}#${n}`);r=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}#${n}`)}const s=[{semanticObject:i}];const a={semanticObject:i};o({semanticObjectPath:t,semanticObjectForGetLinks:s,semanticObject:a,unavailableActions:r})})}async function Ce(t,o,i,r){return Promise.all(t).then(function(e){let t,s,a,c=[];let l={};const u=function(e,t){for(const n in t){if(n===e){return true}else{return false}}};for(let n=0;n<e.length;n++){t=e[n];if(t&&t.length>0&&t[0]!==undefined){const e={};let i;let p;for(let l=0;l<t.length;l++){c.push([]);let f=false;let d=false;for(let e=0;e<t[l][0].length;e++){s=t[l][0][e];a=s&&s.intent.split("?")[0].split("-")[1];if(!(s&&s.intent&&s.intent.indexOf(r)===0)){f=true;if(!u(a,o[n].unavailableActions)){c[l].push(s);d=true}}}i={semanticObject:o[n].semanticObject,path:o[n].path,HasTargets:d,HasTargetsNotFiltered:f};if(e[o[n].semanticObject]===undefined){e[o[n].semanticObject]={}}p=o[n].path.replace(/\//g,"_");if(e[o[n].semanticObject][p]===undefined){e[o[n].semanticObject][p]={}}e[o[n].semanticObject][p]=Object.assign(e[o[n].semanticObject][p],i)}const f=Object.keys(e)[0];if(Object.keys(l).includes(f)){l[f]=Object.assign(l[f],e[f])}else{l=Object.assign(l,e)}c=[]}}if(Object.keys(l).length>0){i.setProperty("semanticsTargets",n(l,i.getProperty("semanticsTargets")));return l}return}).catch(function(t){e.error("fnUpdateSemanticTargetsModel: Cannot read links",t)})}async function $e(e,t,n,o,i){return qe.getSemanticObjectsFromPath(n,o,i)}function Te(e,t,n,o,i){let r,s;let a,c;for(let l=0;l<o.length;l++){s=o[l];r=Object.keys(n.getObject(s+"@"));for(let o=0;o<r.length;o++){if(r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObject"}`)===0&&r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObjectMapping"}`)===-1&&r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`)===-1){c=/#(.*)/.exec(r[o]);a=c?c[1]:"";i.push(qe.getSemanticObjectPromise(e,t,n,s,a))}}}}function Ae(t,n){const o=function(e,t,n){if(!e){return n}if(e instanceof Array){e.forEach(e=>{n=n.concat(o(e,t,[]))});return n}if(e[t]){n.push(e[t])}if(typeof e=="object"&&e!==null){const i=Object.keys(e);if(i.length>0){for(let r=0;r<i.length;r++){n=n.concat(o(e[i[r]],t,[]))}}}return n};const i=function(e,t){return o(e,t,[])};const r=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})};const s=t.getView();const a=s.getBindingContext("internal");if(a){const o=[];const c=t.getOwnerComponent();const l=u.getOwnerComponentFor(c);const p=l.getMetaModel();let f=c.getModel(n).getData();if(JSON.stringify(f)==="{}"){f=c.getModel(n)._getObject("/",undefined)}let d=i(f,"semanticObjectPath");d=r(d);const g=l.getShellServices();let m=g.getHash();const b=[];const O=[];let h;if(m&&m.indexOf("?")!==-1){m=m.split("?")[0]}Te(l,s,p,d,o);if(o.length===0){return Promise.resolve()}else{Promise.all(o).then(async function(e){const t=[];let n;const o=e.filter(function(e){if(e.semanticObject!==undefined&&e.semanticObject.semanticObject&&typeof e.semanticObject.semanticObject==="object"){n=$(C(e.semanticObject.semanticObject.$Path));e.semanticObject.semanticObject=n;e.semanticObjectForGetLinks[0].semanticObject=n;return true}else if(e){return e.semanticObject!==undefined}else{return false}});for(let e=0;e<o.length;e++){h=o[e];if(h&&h.semanticObject&&!(h.semanticObject.semanticObject.indexOf("{")===0)){b.push(h.semanticObjectForGetLinks);O.push({semanticObject:h.semanticObject.semanticObject,unavailableActions:h.unavailableActions,path:o[e].semanticObjectPath});t.push(g.getLinksWithCache([h.semanticObjectForGetLinks]))}}return qe.updateSemanticTargets(t,O,a,m)}).catch(function(t){e.error("fnGetSemanticTargetsFromTable: Cannot get Semantic Objects",t)})}}else{return Promise.resolve()}}function xe(e){const t={};if(e&&e.FilterExpressionRestrictions!==undefined){e.FilterExpressionRestrictions.forEach(function(e){if(e.Property&&e.AllowedExpressions!==undefined){if(t[e.Property.$PropertyPath]!==undefined){t[e.Property.$PropertyPath].push(e.AllowedExpressions)}else{t[e.Property.$PropertyPath]=[e.AllowedExpressions]}}})}return t}function Fe(e,t){let n=[];if(e&&e[t]){n=e[t].map(function(e){return e.$PropertyPath})}return n}function Ne(e,t,n){const o=t+"/";return e.reduce((e,t)=>{if(t.startsWith(o)){const n=t.replace(o,"");if(e.indexOf(n)===-1){e.push(n)}}return e},n)}function Me(e,o){const i={RequiredProperties:[],NonFilterableProperties:[],FilterAllowedExpressions:{}};let r;const a="$NavigationPropertyBinding";const c="@Org.OData.Capabilities.V1.FilterRestrictions";const l=e.replaceAll("%2F","/").split("/").filter(s.filterOutNavPropBinding);const u=`/${l.join("/")}/`;const p=s.getEntitySetPath(e,o);const f=p.split("/").filter(s.filterOutNavPropBinding);const d=o.getObject(`${u}$ContainsTarget`);const g=!!d&&l[l.length-1];if(!d){r=o.getObject(`${p}${c}`);i.RequiredProperties=Fe(r,"RequiredProperties")||[];const e=o.getObject(`${u}@com.sap.vocabularies.Common.v1.ResultContext`);if(!e){i.NonFilterableProperties=Fe(r,"NonFilterableProperties")||[]}i.FilterAllowedExpressions=xe(r)||{}}if(l.length>1){const e=d?g:f[f.length-1];const r=d?p:`/${f.slice(0,-1).join(`/${a}/`)}`;const s={RequiredProperties:[],NonFilterableProperties:[],FilterAllowedExpressions:{}};if(!e.includes("%2F")){const t=o.getObject(`${r}${c}`);i.RequiredProperties=Ne(Fe(t,"RequiredProperties")||[],e,i.RequiredProperties||[]);i.NonFilterableProperties=Ne(Fe(t,"NonFilterableProperties")||[],e,i.NonFilterableProperties||[]);const n=xe(t)||{};s.FilterAllowedExpressions=Object.keys(n).reduce((t,o)=>{if(o.startsWith(e+"/")){const i=o.replace(e+"/","");t[i]=n[o]}return t},{})}i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions||{},s.FilterAllowedExpressions||{});const u=v.getNavigationRestrictions(o,r,e.replaceAll("%2F","/"));const m=u&&u["FilterRestrictions"];const b=Fe(m,"RequiredProperties")||[];i.RequiredProperties=t(i.RequiredProperties.concat(b));const O=Fe(m,"NonFilterableProperties")||[];i.NonFilterableProperties=t(i.NonFilterableProperties.concat(O));i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions||{},xe(m)||{});const h=o.getObject(`/${l.join("/")}${c}`);const P=Fe(h,"RequiredProperties")||[];i.RequiredProperties=t(i.RequiredProperties.concat(P));const y=Fe(h,"NonFilterableProperties")||[];i.NonFilterableProperties=t(i.NonFilterableProperties.concat(y));i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions,xe(h)||{})}return i}async function we(e,t,n,o){n=n||{};if(o){return o.templateControlFragment(e,t,n.view).then(function(e){return o.targets==="xmlTree"&&e.length>0?e[0]:e})}else{const o=await f.process(d.loadTemplate(e,"fragment"),{name:e},t);const i=o.firstElementChild;if(!!n.isXML&&i){return i}return p.load({id:n.id,definition:o,controller:n.controller})}}function Re(e,t){const n=e.split("/").filter(Boolean),o=n.pop(),i=n.join("/"),r=i&&t.getObject(`/${i}`);if((r===null||r===void 0?void 0:r.$kind)==="Singleton"){const e=n[n.length-1];return`/${e}/${o}`}return undefined}async function De(e,t){if(!e||!t){return Promise.resolve(null)}const n=t.getMetaModel();const o=Re(e,n);if(o){const e=t.bindProperty(o);return e.requestValue()}return Promise.resolve(null)}function ke(e,t){let n;if(e.indexOf("@$ui5.overload")>-1){n=e.split("@$ui5.overload")[0]}else{const t=e.split("/0")[0].split(".");n=`/${t[t.length-1]}/`}return n+t}function Le(e,t){const n=new h({anyText:e});t.addDependent(n);const o=n.getAnyText();t.removeDependent(n);n.destroy();return o}function Ie(){return!E.desktop||g.resize.width<=320}function Be(e,t,n){const o=e.data("entityType"),i=qe.getAppComponent(e).getMetaModel(),r={},s=[],a=[];let c="";let l=i.getObject(`${o}${t}`);if(n){l=l.SelectionVariant}if(l){c=l.Text;(l.SelectOptions||[]).filter(function(e){return e&&e.PropertyName&&e.PropertyName.$PropertyPath}).forEach(function(e){const t=e.PropertyName.$PropertyPath;if(!a.includes(t)){a.push(t)}for(const i in e.Ranges){var n,o;const s=e.Ranges[i];r[t]=(r[t]||[]).concat(new O(t,(n=s.Option)===null||n===void 0?void 0:(o=n.$EnumMember)===null||o===void 0?void 0:o.split("/").pop(),s.Low,s.High))}});for(const e in r){s.push(new O({filters:r[e],and:false}))}}return{properties:a,filters:s,text:c}}function Ve(e,t,i,r){const s=t.createBindingContext(e);return o===null||o===void 0?void 0:o.createConverterContextForMacro(i,s||t,r,n,undefined)}function _e(e,t){return e.replace("_fe_"+t+"_","")}function We(e){e.forEach(e=>{if(e.sPath&&e.sPath.includes("fe_groupable")){e.sPath=qe.getInternalChartNameFromPropertyNameAndKind(e.sPath,"groupable")}});return e}const qe={fireButtonPress:I,getTargetView:_,getCurrentPageView:V,hasTransientContext:x,updateRelatedAppsDetails:L,getAppComponent:B,getMandatoryFilterFields:G,getContextPathProperties:q,getParameterInfo:ae,updateDataFieldForIBNButtonsVisibility:H,getEntitySetName:Y,getActionPath:Q,computeDisplayMode:K,isStickyEditMode:Oe,getOperatorsForProperty:ie,getOperatorsForDateProperty:se,getOperatorsForGuidProperty:re,addSelectionVariantToConditions:de,addExternalStateFiltersToSelectionVariant:be,addPageContextToSelectionVariant:me,addDefaultDisplayCurrency:he,setUserDefaults:ve,getIBNActions:U,getHeaderFacetItemConfigForExternalNavigation:Se,getSemanticObjectMapping:ye,setSemanticObjectMappings:Ee,getSemanticObjectPromise:$e,getSemanticTargetsFromPageModel:Ae,getSemanticObjectsFromPath:je,updateSemanticTargets:Ce,waitForContextRequested:A,getFilterRestrictionsByPath:Me,getSpecificAllowedExpression:oe,getAdditionalParamsForCreate:Pe,requestSingletonProperty:De,templateControlFragment:we,FilterRestrictions:{REQUIRED_PROPERTIES:"RequiredProperties",NON_FILTERABLE_PROPERTIES:"NonFilterableProperties",ALLOWED_EXPRESSIONS:"FilterAllowedExpressions"},AllowedExpressionsPrio:["SingleValue","MultiValue","SingleRange","MultiRange","SearchExpression","MultiRangeOrSearchExpression"],normalizeSearchTerm:T,setContextsBasedOnOperationAvailable:Z,setDynamicActionContexts:ee,requestProperty:X,getParameterPath:ke,getRelatedAppsMenuItems:M,getTranslatedTextFromExpBindingString:Le,addSemanticDatesToConditions:le,addSelectOptionToConditions:ce,createSemanticDatesFromConditions:pe,updateRelateAppsModel:D,getSemanticObjectAnnotations:k,getFiltersInfoForSV:Be,getInternalChartNameFromPropertyNameAndKind:_e,getChartPropertiesWithoutPrefixes:We,isSmallDevice:Ie,getConverterContextForPath:Ve};return qe},false);
|
|
26
|
+
sap.ui.predefine("sap/fe/core/CommonUtils", ["sap/base/Log","sap/base/util/array/uniqueSort","sap/base/util/merge","sap/fe/core/converters/ConverterContext","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticDateOperators","sap/fe/core/helpers/StableIdHelper","sap/fe/core/library","sap/fe/core/StateFilterToSelectionVariant","sap/fe/core/type/TypeUtil","sap/ui/core/Component","sap/ui/core/Fragment","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/Device","sap/ui/mdc/condition/FilterOperatorUtil","sap/ui/model/Filter","./controls/AnyElement","./helpers/MetaModelFunction","./templating/FilterHelper"],function(e,t,n,o,i,r,s,a,c,l,u,p,f,g,d,m,b,O,h,v,P,y){"use strict";var S={};var j=y.getConditions;var C=b.system;var A=c.generate;var x=r.pathInModel;var E=r.compileExpression;const T=l.ProgrammingModel;function $(e){if(!e){return undefined}return e.replace(/"/g," ").replace(/\\/g,"\\\\").split(/\s+/).reduce(function(e,t){if(t!==""){e=`${e?`${e} `:""}"${t}"`}return e},undefined)}async function F(e){var t;const n=e.getModel();const o=n.getMetaModel();const r=o.getMetaPath(e.getPath());const s=i.getInvolvedDataModelObjects(o.getContext(r));await e.requestProperty((t=s.targetEntityType.keys[0])===null||t===void 0?void 0:t.name)}function M(e){let t=false;if(e){e.getCurrentContexts().forEach(function(e){if(e&&e.isTransient()){t=true}})}return t}async function R(e,t,n,o){return e.getLinks({semanticObject:n,params:o})}function N(e){const t=[];const n=Object.keys(e);let o;for(let i=0;i<n.length;i++){o={LocalProperty:{$PropertyPath:n[i]},SemanticObjectProperty:e[n[i]]};t.push(o)}return t}function w(e,t,n,o,i){for(let r=0;r<e.length;r++){const s=e[r];const a=s.intent;const c=a.split("-")[1].split("?")[0];if(i&&i.includes(c)){o.push({text:s.text,targetSemObject:a.split("#")[1].split("-")[0],targetAction:c.split("~")[0],targetParams:n})}else if(!i&&t&&t.indexOf(c)===-1){o.push({text:s.text,targetSemObject:a.split("#")[1].split("-")[0],targetAction:c.split("~")[0],targetParams:n})}}}function D(e,t,n,o){if(o&&o.length>0){const i=e.allowedActions||undefined;const r=e.unavailableActions?e.unavailableActions:[];const s=e.mapping?N(e.mapping):[];const a={navigationContexts:t,semanticObjectMapping:s};w(o,r,a,n,i)}}function L(e,t,n,o){if(o.length>0){const i=[e.action];const r=[];const s=[];const a={navigationContexts:t,semanticObjectMapping:s};w(o,r,a,n,i)}}async function k(t,n,o,i,r,s,a){const c=a.getShellServices();const l={};let u="",p="";let f;let g=[];let d=[];let m;async function b(){const e=c.parseShellHash(document.location.hash);u=e.semanticObject;p=e.action;return R(c,o,u,l)}try{if(n){if(i&&i.length>0){for(let e=0;e<i.length;e++){const t=i[e].$PropertyPath;if(!l[t]){l[t]={value:n[t]}}}}else{const e=r.getObject(`${s}/$Type/$Key`);for(const t in e){const o=e[t];if(!l[o]){l[o]={value:n[o]}}}}}const e=G(o).getViewData();const O=[];let h;if(e.additionalSemanticObjects){m=Object.keys(e.additionalSemanticObjects);for(let n=0;n<m.length;n++){h=await Promise.resolve(R(c,o,m[n],l));D(e.additionalSemanticObjects[m[n]],t,O,h)}}const v=[];const P=a.getComponentData();if(P.feEnvironment&&P.feEnvironment.getIntent()){const e=P.feEnvironment.getIntent();h=await Promise.resolve(R(c,o,e.semanticObject,l));L(e,t,v,h)}const y=o.getBindingContext("internal");const S=await b();if(S){if(S.length>0){let n=false;const o={};const i=[];const a=`${s}@`;const c=`${s}/@`;const l=r.getObject(a);f=qe.getSemanticObjectAnnotations(l,u);if(!f.bHasEntitySetSO){const e=r.getObject(c);f=qe.getSemanticObjectAnnotations(e,u)}d=f.aUnavailableActions;d.push(p);o.navigationContexts=t;o.semanticObjectMapping=f.aMappings;w(S,d,o,i);O.forEach(function(e){var t;let{targetSemObject:o}=e;if(((t=i[0])===null||t===void 0?void 0:t.targetSemObject)===o){n=true}});if(e.additionalSemanticObjects&&i[0]&&e.additionalSemanticObjects[i[0].targetSemObject]&&!!e.additionalSemanticObjects[i[0].targetSemObject].allowedActions){n=true}const m=O.concat(v);g=n?m:m.concat(i);y.setProperty("relatedApps/visibility",g.length>0);y.setProperty("relatedApps/items",g)}else{y.setProperty("relatedApps/visibility",false)}}else{y.setProperty("relatedApps/visibility",false)}}catch(t){e.error("Cannot read links",t)}return g}function B(e,t){const n={bHasEntitySetSO:false,aAllowedActions:[],aUnavailableActions:[],aMappings:[]};let o,i;let r;for(const s in e){if(s.indexOf("com.sap.vocabularies.Common.v1.SemanticObject")>-1&&e[s]===t){n.bHasEntitySetSO=true;o=`@${"com.sap.vocabularies.Common.v1.SemanticObjectMapping"}`;i=`@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`;if(s.indexOf("#")>-1){r=s.split("#")[1];o=`${o}#${r}`;i=`${i}#${r}`}if(e[o]){n.aMappings=n.aMappings.concat(e[o])}if(e[i]){n.aUnavailableActions=n.aUnavailableActions.concat(e[i])}break}}return n}function I(t,n){const o=t.getModel().getMetaModel();const i=t.getBindingContext();const r=i&&i.getPath()||"";const s=o.getMetaPath(r);const a=`${s}/`+`@com.sap.vocabularies.Common.v1.SemanticKey`;const c=o.getObject(a);const l=i===null||i===void 0?void 0:i.getObject();if(!l&&i){i.requestObject().then(async function(e){return qe.updateRelateAppsModel(i,e,t,c,o,s,n)}).catch(function(t){e.error("Cannot update the related app details",t)})}else{return qe.updateRelateAppsModel(i,l,t,c,o,s,n)}}function V(e){if(e&&e.isA(["sap.m.Button","sap.m.OverflowToolbarButton"])&&e.getVisible()&&e.getEnabled()){e.firePress()}}function q(e){if(e.isA("sap.fe.core.AppComponent")){return e}const t=f.getOwnerComponentFor(e);if(!t){throw new Error("There should be a sap.fe.core.AppComponent as owner of the control")}else{return q(t)}}function U(e){const t=e.getRootViewController();return t.isFclEnabled()?t.getRightmostView():qe.getTargetView(e.getRootContainer().getCurrentPage())}function G(e){if(e&&e.isA("sap.ui.core.ComponentContainer")){const t=e.getComponentInstance();e=t&&t.getRootControl()}while(e&&!e.isA("sap.ui.core.mvc.View")){e=e.getParent()}return e}function H(e,t){for(const n in t){if(t[n]!==e[n]){return false}}return true}function W(e,t,n){const o=e.getObject(`${t}/`)||{},i={};for(const e in o){if(o.hasOwnProperty(e)&&!/^\$/i.test(e)&&o[e].$kind&&H(o[e],n||{$kind:"Property"})){i[e]=o[e]}}return i}function Y(e,t){let n=[];if(e&&t){n=e.getObject(`${t}@Org.OData.Capabilities.V1.FilterRestrictions/RequiredProperties`)}return n}function _(e,t){const n=e&&e.getActions();if(n){n.forEach(function(e){if(e.isA("sap.ui.mdc.actiontoolbar.ActionToolbarAction")){e=e.getAction()}if(e.isA("sap.m.MenuButton")){const n=e.getMenu();const o=n.getItems();o.forEach(e=>{if(e.data("IBNData")){t.push(e)}})}else if(e.data("IBNData")){t.push(e)}})}return t}function Q(t,n){const o={};const i=qe.getAppComponent(n);const r=s.isStickySessionSupported(n.getModel().getMetaModel());const a=function(n){if(n){const e=Object.keys(n);e.forEach(function(e){if(e.indexOf("_")!==0&&e.indexOf("odata.context")===-1){o[e]={value:n[e]}}})}if(t.length){t.forEach(function(t){const n=t.data("IBNData").semanticObject;const s=t.data("IBNData").action;i.getShellServices().getLinks({semanticObject:n,action:s,params:o}).then(function(e){t.setVisible(t.getVisible()&&e&&e.length===1);if(r){t.getBindingContext("internal").setProperty(t.getId().split("--")[1],{shellNavigationNotAvailable:!(e&&e.length===1)})}return}).catch(function(t){e.error("Cannot retrieve the links from the shell service",t)})})}};if(n&&n.getBindingContext()){var c;(c=n.getBindingContext())===null||c===void 0?void 0:c.requestObject().then(function(e){return a(e)}).catch(function(t){e.error("Cannot retrieve the links from the shell service",t)})}else{a()}}function K(e,t,n,o){const i=!n?e.getObject(e.getPath()).toString():n;let r=e.getPath().split("/@")[0];const s=e.getObject(r).$Type;const a=J(e.getModel(),s);if(a){r=`/${a}`}if(o){return e.getObject(`${r}/${i}@Org.OData.Core.V1.OperationAvailable`)}if(t){return`${r}/${i}`}else{return{sContextPath:r,sProperty:e.getObject(`${r}/${i}@Org.OData.Core.V1.OperationAvailable/$Path`),sBindingParameter:e.getObject(`${r}/${i}/@$ui5.overload/0/$Parameter/0/$Name`)}}}function J(e,t){const n=e.getObject("/");for(const e in n){if(typeof n[e]==="object"&&n[e].$Type===t){return e}}}function X(e,t){const n=e["@com.sap.vocabularies.Common.v1.Text"],o=n&&(e&&e["@com.sap.vocabularies.Common.v1.Text@com.sap.vocabularies.UI.v1.TextArrangement"]||t&&t["@com.sap.vocabularies.UI.v1.TextArrangement"]);if(o){if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextOnly"){return"Description"}else if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextLast"){return"ValueDescription"}else if(o.$EnumMember==="com.sap.vocabularies.UI.v1.TextArrangementType/TextSeparate"){return"Value"}return"DescriptionValue"}return n?"DescriptionValue":"Value"}function z(e){const t=e.getModel().getMetaModel();return t.getObject(`${t.getMetaPath(e.getPath())}/$Type`)}async function Z(t,n,o){let i=n;const r=t.indexOf("(");if(r>-1){const n=t.slice(r+1,-1);let o=z(i);while(o!==n){i=i.getBinding().getContext();if(i){o=z(i)}else{e.warning("Cannot determine target type to request property value for bound action invocation");return Promise.resolve(undefined)}}}return i.requestObject(o)}async function ee(e,t,n,o){const i=n&&n.indexOf("/")===0?Re(n,e.getModel()):Z(t,e,n);return i.then(function(n){return{vPropertyValue:n,oSelectedContext:e,sAction:t,sDynamicActionEnabledPath:o}})}async function te(t,n){return Promise.all(n).then(function(e){if(e.length){const n=[],o=[];e.forEach(function(e){if(e){if(e.vPropertyValue){t.getModel().setProperty(e.sDynamicActionEnabledPath,true);n.push(e.oSelectedContext)}else{o.push(e.oSelectedContext)}}});ne(t,e[0].sAction,n,o)}return}).catch(function(t){e.trace("Cannot retrieve property value from path",t)})}function ne(e,t,n,o){const i=`${e.getPath()}/dynamicActions/${t}`,r=e.getModel();r.setProperty(`${i}/aApplicable`,n);r.setProperty(`${i}/aNotApplicable`,o)}function oe(e){const t=p.getDataTypeClassName(e);const n=p.getBaseType(t,{},{});return O.getOperatorsForType(n)}function ie(e,t){return e.filter(function(e){return t.indexOf(e)>-1})}function re(e){const t=qe.AllowedExpressionsPrio;e.sort(function(e,n){return t.indexOf(e)-t.indexOf(n)});return e[0]}function se(e,t,n,o,i,r){const s=qe.getFilterRestrictionsByPath(t,n);const c=["EQ"];const l=["EQ","GE","LE","LT","GT","BT","NOTLE","NOTLT","NOTGE","NOTGT"];const u=["EQ","BT"];const p=["TODAY","TOMORROW","YESTERDAY","DATE","FIRSTDAYWEEK","LASTDAYWEEK","FIRSTDAYMONTH","LASTDAYMONTH","FIRSTDAYQUARTER","LASTDAYQUARTER","FIRSTDAYYEAR","LASTDAYYEAR"];const f=["EQ","GE","LE","LT","GT","BT","NE","NOTBT","NOTLE","NOTLT","NOTGE","NOTGT"];const g=["Contains","NotContains","StartsWith","NotStartsWith","EndsWith","NotEndsWith"];const d=a.getSupportedOperations();const m=i==="true"||i===true;let b=[];const O=r&&typeof r==="string"?JSON.parse(r).customData:r;if(n.getObject(`${t}/@com.sap.vocabularies.Common.v1.ResultContext`)===true){return c}if(O&&O.operatorConfiguration&&O.operatorConfiguration.length>0){b=a.getFilterOperations(O.operatorConfiguration,o)}else{b=a.getSemanticDateOperations(o)}let h=oe(o);if(m){h=d.concat(h)}let v=[];if(s&&s.FilterAllowedExpressions&&s.FilterAllowedExpressions[e]){const t=qe.getSpecificAllowedExpression(s.FilterAllowedExpressions[e]);switch(t){case"SingleValue":const e=o==="Edm.Date"&&m?p:c;v=ie(h,e);break;case"MultiValue":v=ie(h,c);break;case"SingleRange":let t;if(m){if(o==="Edm.Date"){t=b}else if(o==="Edm.DateTimeOffset"){t=b}else{t=l}}else if(o==="Edm.DateTimeOffset"){t=u}else{t=l}const n=ie(h,t);v=n;break;case"MultiRange":v=ie(h,f);break;case"SearchExpression":v=ie(h,g);break;case"MultiRangeOrSearchExpression":v=ie(h,g.concat(f));break;default:break}}return v}S.getOperatorsForProperty=se;function ae(){const e=["EQ","NE"];return e.toString()}function ce(e){const t=oe(e);const n=["EQ","GE","LE","LT","GT","BT","NE","NOTBT","NOTLE","NOTLT","NOTGE","NOTGT"];return ie(t,n)}function le(e,t){const n=t.substring(0,t.lastIndexOf("/"));const o=e.getObject(`${n}/@com.sap.vocabularies.Common.v1.ResultContext`);const i={};if(o&&n!==t){i.contextPath=n;i.parameterProperties=qe.getContextPathProperties(e,n)}return i}function ue(e,t,n,o,i){var r;const s=j(i,e);if(i!==null&&i!==void 0&&i.SemanticDates&&n&&n.indexOf(i===null||i===void 0?void 0:(r=i.SemanticDates)===null||r===void 0?void 0:r.operator)>-1){const e=qe.addSemanticDatesToConditions(i===null||i===void 0?void 0:i.SemanticDates);if(e&&Object.keys(e).length>0){o.push(e)}}else if(s){if(t.length===0||t.indexOf(s.operator)>-1){o.push(s)}}return o}function pe(e){const t=[];if(e!==null&&e!==void 0&&e.high){t.push(e===null||e===void 0?void 0:e.high)}if(e!==null&&e!==void 0&&e.low){t.push(e===null||e===void 0?void 0:e.low)}return{values:t,operator:e===null||e===void 0?void 0:e.operator,isEmpty:undefined}}function fe(e,t,n){const o=qe.getAppComponent(n);const i=o.getNavigationService();return i.mixAttributesAndSelectionVariant(t,e.toJSONString())}function ge(e,t,n,o){const i=t.filterConditions;const r=t.filterConditionsWithoutConflict?t.filterConditionsWithoutConflict:{};const s=o!==null&&o!==void 0&&o.propertiesWithoutConflict?o.propertiesWithoutConflict:{};const a=u.getSelectionVariantFromConditions(i,n.getPropertyHelper());for(const t in i){const n=a.getSelectOption(t);if(!e.getSelectOption(t)){if(t==="$editState"){continue}if(n){e.massAddSelectOption(t,n)}}else{if(s&&t in s){e.massAddSelectOption(s[t],n)}if(t in r){e.massAddSelectOption(r[t],n)}}}return e}function de(e){const t=s.isStickySessionSupported(e.getModel().getMetaModel());const n=e.getModel("ui").getProperty("/isEditable");return t&&n}function me(e,t,n){if(t&&e&&e.length){for(let o=0;o<e.length;o++){const i=t.getSelectOption("DisplayCurrency"),r=n&&n.getSelectOption("DisplayCurrency");if(e[o].$PropertyPath==="DisplayCurrency"&&(!i||!i.length)&&r&&r.length){const e=r[0];const n=e["Sign"];const o=e["Option"];const i=e["Low"];const s=e["High"];t.addSelectOption("DisplayCurrency",n,o,i,s)}}}}async function be(e,t,n,o,i,r){const s=e.getComponentData(),a=s&&s.startupParameters||{},c=e.getShellServices();const l=await c.getStartupAppState(e);const u=(l===null||l===void 0?void 0:l.getData())||{},p=u.selectionVariant&&u.selectionVariant.SelectOptions||[];t.forEach(function(e){var t;const s=o?`/${e.$Name}`:(t=e.getPath)===null||t===void 0?void 0:t.call(e).slice(e.getPath().lastIndexOf("/")+1);const c=o?s.slice(1):s;if(r&&i){if(r[c]){n.setProperty(s,r[c])}}else if(a[c]){n.setProperty(s,a[c][0])}else if(p.length>0){for(const e of p){if(e.PropertyName===c){const t=e.Ranges.length?e.Ranges[e.Ranges.length-1]:undefined;if(t&&t.Sign==="I"&&t.Option==="EQ"){n.setProperty(s,t.Low)}}}}})}function Oe(e,t){const n=t,o=n!==undefined?Object.keys(n).filter(function(e){return n[e].useForCreate}):[];let i;for(let t=0;t<o.length;t++){const n=o[t];const r=e&&e[n];if(r&&r.length===1){i=i||Object.create(null);i[n]=r[0]}}return i}function he(e){const t=[];if(e.parameters){const n=Object.keys(e.parameters)||[];if(n.length>0){n.forEach(function(n){const o=e.parameters[n];if(o.value&&o.value.value&&o.value.format==="binding"){const e={LocalProperty:{$PropertyPath:o.value.value},SemanticObjectProperty:n};if(t.length>0){for(let n=0;n<t.length;n++){var i;if(((i=t[n].LocalProperty)===null||i===void 0?void 0:i.$PropertyPath)!==e.LocalProperty.$PropertyPath){t.push(e)}}}else{t.push(e)}}})}}return t}function ve(t,n){const o={};let i;const r=t.controlConfiguration;for(const t in r){if(t.indexOf("@com.sap.vocabularies.UI.v1.DataPoint")>-1||t.indexOf("@com.sap.vocabularies.UI.v1.Chart")>-1){var s,a;const c=(s=r[t].navigation)===null||s===void 0?void 0:(a=s.targetOutbound)===null||a===void 0?void 0:a.outbound;if(c!==undefined){const r=n[c];if(r.semanticObject&&r.action){if(t.indexOf("Chart")>-1){i=A(["fe","MicroChartLink",t])}else{i=A(["fe","HeaderDPLink",t])}const e=qe.getSemanticObjectMapping(r);o[i]={semanticObject:r.semanticObject,action:r.action,semanticObjectMapping:e}}else{e.error(`Cross navigation outbound is configured without semantic object and action for ${c}`)}}}}return o}function Pe(e,t){const n=typeof t==="string"?JSON.parse(t):t;for(let t=0;t<n.length;t++){const o=n[t]["LocalProperty"]&&n[t]["LocalProperty"]["$PropertyPath"]||n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]&&n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"];const i=n[t]["SemanticObjectProperty"]||n[t]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];const r=e.getSelectOption(o);if(r){e.removeSelectOption(o);e.massAddSelectOption(i,r)}}return e}async function ye(e,t,n){return new Promise(function(o){let i,r;if(n===""){i=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObject"}`);r=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`)}else{i=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObject"}#${n}`);r=e.getObject(`${t}@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}#${n}`)}const s=[{semanticObject:i}];const a={semanticObject:i};o({semanticObjectPath:t,semanticObjectForGetLinks:s,semanticObject:a,unavailableActions:r})})}async function Se(t,o,i,r){return Promise.all(t).then(function(e){let t,s,a,c=[];let l={};const u=function(e,t){for(const n in t){if(n===e){return true}else{return false}}};for(let n=0;n<e.length;n++){t=e[n];if(t&&t.length>0&&t[0]!==undefined){const e={};let i;let p;for(let l=0;l<t.length;l++){c.push([]);let f=false;let g=false;for(let e=0;e<t[l][0].length;e++){s=t[l][0][e];a=s&&s.intent.split("?")[0].split("-")[1];if(!(s&&s.intent&&s.intent.indexOf(r)===0)){f=true;if(!u(a,o[n].unavailableActions)){c[l].push(s);g=true}}}i={semanticObject:o[n].semanticObject,path:o[n].path,HasTargets:g,HasTargetsNotFiltered:f};if(e[o[n].semanticObject]===undefined){e[o[n].semanticObject]={}}p=o[n].path.replace(/\//g,"_");if(e[o[n].semanticObject][p]===undefined){e[o[n].semanticObject][p]={}}e[o[n].semanticObject][p]=Object.assign(e[o[n].semanticObject][p],i)}const f=Object.keys(e)[0];if(Object.keys(l).includes(f)){l[f]=Object.assign(l[f],e[f])}else{l=Object.assign(l,e)}c=[]}}if(Object.keys(l).length>0){i.setProperty("semanticsTargets",n(l,i.getProperty("semanticsTargets")));return l}return}).catch(function(t){e.error("fnUpdateSemanticTargetsModel: Cannot read links",t)})}async function je(e,t,n,o,i){return qe.getSemanticObjectsFromPath(n,o,i)}function Ce(e,t,n,o,i){let r,s;let a,c;for(let l=0;l<o.length;l++){s=o[l];r=Object.keys(n.getObject(s+"@"));for(let o=0;o<r.length;o++){if(r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObject"}`)===0&&r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObjectMapping"}`)===-1&&r[o].indexOf(`@${"com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"}`)===-1){c=/#(.*)/.exec(r[o]);a=c?c[1]:"";i.push(qe.getSemanticObjectPromise(e,t,n,s,a))}}}}function Ae(t,n){const o=function(e,t,n){if(!e){return n}if(e instanceof Array){e.forEach(e=>{n=n.concat(o(e,t,[]))});return n}if(e[t]){n.push(e[t])}if(typeof e=="object"&&e!==null){const i=Object.keys(e);if(i.length>0){for(let r=0;r<i.length;r++){n=n.concat(o(e[i[r]],t,[]))}}}return n};const i=function(e,t){return o(e,t,[])};const r=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})};const s=t.getView();const a=s.getBindingContext("internal");if(a){const o=[];const c=t.getOwnerComponent();const l=f.getOwnerComponentFor(c);const u=l.getMetaModel();let p=c.getModel(n).getData();if(JSON.stringify(p)==="{}"){p=c.getModel(n)._getObject("/",undefined)}let g=i(p,"semanticObjectPath");g=r(g);const d=l.getShellServices();let m=d.getHash();const b=[];const O=[];let h;if(m&&m.indexOf("?")!==-1){m=m.split("?")[0]}Ce(l,s,u,g,o);if(o.length===0){return Promise.resolve()}else{Promise.all(o).then(async function(e){const t=[];let n;const o=e.filter(function(e){if(e.semanticObject!==undefined&&e.semanticObject.semanticObject&&typeof e.semanticObject.semanticObject==="object"){n=E(x(e.semanticObject.semanticObject.$Path));e.semanticObject.semanticObject=n;e.semanticObjectForGetLinks[0].semanticObject=n;return true}else if(e){return e.semanticObject!==undefined}else{return false}});for(let e=0;e<o.length;e++){h=o[e];if(h&&h.semanticObject&&!(h.semanticObject.semanticObject.indexOf("{")===0)){b.push(h.semanticObjectForGetLinks);O.push({semanticObject:h.semanticObject.semanticObject,unavailableActions:h.unavailableActions,path:o[e].semanticObjectPath});t.push(d.getLinksWithCache([h.semanticObjectForGetLinks]))}}return qe.updateSemanticTargets(t,O,a,m)}).catch(function(t){e.error("fnGetSemanticTargetsFromTable: Cannot get Semantic Objects",t)})}}else{return Promise.resolve()}}function xe(e){const t={};if(e&&e.FilterExpressionRestrictions!==undefined){e.FilterExpressionRestrictions.forEach(function(e){if(e.Property&&e.AllowedExpressions!==undefined){if(t[e.Property.$PropertyPath]!==undefined){t[e.Property.$PropertyPath].push(e.AllowedExpressions)}else{t[e.Property.$PropertyPath]=[e.AllowedExpressions]}}})}return t}function Ee(e,t){let n=[];if(e&&e[t]){n=e[t].map(function(e){return e.$PropertyPath})}return n}function Te(e,t,n){const o=t+"/";return e.reduce((e,t)=>{if(t.startsWith(o)){const n=t.replace(o,"");if(e.indexOf(n)===-1){e.push(n)}}return e},n)}function $e(e,o){const i={RequiredProperties:[],NonFilterableProperties:[],FilterAllowedExpressions:{}};let r;const a="$NavigationPropertyBinding";const c="@Org.OData.Capabilities.V1.FilterRestrictions";const l=e.replaceAll("%2F","/").split("/").filter(s.filterOutNavPropBinding);const u=`/${l.join("/")}/`;const p=s.getEntitySetPath(e,o);const f=p.split("/").filter(s.filterOutNavPropBinding);const g=o.getObject(`${u}$ContainsTarget`);const d=!!g&&l[l.length-1];if(!g){r=o.getObject(`${p}${c}`);i.RequiredProperties=Ee(r,"RequiredProperties")||[];const e=o.getObject(`${u}@com.sap.vocabularies.Common.v1.ResultContext`);if(!e){i.NonFilterableProperties=Ee(r,"NonFilterableProperties")||[]}i.FilterAllowedExpressions=xe(r)||{}}if(l.length>1){const e=g?d:f[f.length-1];const r=g?p:`/${f.slice(0,-1).join(`/${a}/`)}`;const s={RequiredProperties:[],NonFilterableProperties:[],FilterAllowedExpressions:{}};if(!e.includes("%2F")){const t=o.getObject(`${r}${c}`);i.RequiredProperties=Te(Ee(t,"RequiredProperties")||[],e,i.RequiredProperties||[]);i.NonFilterableProperties=Te(Ee(t,"NonFilterableProperties")||[],e,i.NonFilterableProperties||[]);const n=xe(t)||{};s.FilterAllowedExpressions=Object.keys(n).reduce((t,o)=>{if(o.startsWith(e+"/")){const i=o.replace(e+"/","");t[i]=n[o]}return t},{})}i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions||{},s.FilterAllowedExpressions||{});const u=P.getNavigationRestrictions(o,r,e.replaceAll("%2F","/"));const m=u&&u["FilterRestrictions"];const b=Ee(m,"RequiredProperties")||[];i.RequiredProperties=t(i.RequiredProperties.concat(b));const O=Ee(m,"NonFilterableProperties")||[];i.NonFilterableProperties=t(i.NonFilterableProperties.concat(O));i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions||{},xe(m)||{});const h=o.getObject(`/${l.join("/")}${c}`);const v=Ee(h,"RequiredProperties")||[];i.RequiredProperties=t(i.RequiredProperties.concat(v));const y=Ee(h,"NonFilterableProperties")||[];i.NonFilterableProperties=t(i.NonFilterableProperties.concat(y));i.FilterAllowedExpressions=n({},i.FilterAllowedExpressions,xe(h)||{})}return i}async function Fe(e,t,n,o){n=n||{};if(o){return o.templateControlFragment(e,t,n.view).then(function(e){return o.targets==="xmlTree"&&e.length>0?e[0]:e})}else{const o=await d.process(m.loadTemplate(e,"fragment"),{name:e},t);const i=o.firstElementChild;if(!!n.isXML&&i){return i}return g.load({id:n.id,definition:o,controller:n.controller})}}function Me(e,t){const n=e.split("/").filter(Boolean),o=n.pop(),i=n.join("/"),r=i&&t.getObject(`/${i}`);if((r===null||r===void 0?void 0:r.$kind)==="Singleton"){const e=n[n.length-1];return`/${e}/${o}`}return undefined}async function Re(e,t){if(!e||!t){return Promise.resolve(null)}const n=t.getMetaModel();const o=Me(e,n);if(o){const e=t.bindProperty(o);return e.requestValue()}return Promise.resolve(null)}function Ne(e,t){let n;if(e.indexOf("@$ui5.overload")>-1){n=e.split("@$ui5.overload")[0]}else{const t=e.split("/0")[0].split(".");n=`/${t[t.length-1]}/`}return n+t}function we(e,t){const n=new v({anyText:e});t.addDependent(n);const o=n.getAnyText();t.removeDependent(n);n.destroy();return o}function De(){return!C.desktop||b.resize.width<=320}function Le(e,t,n){const o=e.data("entityType"),i=qe.getAppComponent(e).getMetaModel(),r={},s=[],a=[];let c="";let l=i.getObject(`${o}${t}`);if(n){l=l.SelectionVariant}if(l){c=l.Text;(l.SelectOptions||[]).filter(function(e){return e&&e.PropertyName&&e.PropertyName.$PropertyPath}).forEach(function(e){const t=e.PropertyName.$PropertyPath;if(!a.includes(t)){a.push(t)}for(const i in e.Ranges){var n,o;const s=e.Ranges[i];r[t]=(r[t]||[]).concat(new h(t,(n=s.Option)===null||n===void 0?void 0:(o=n.$EnumMember)===null||o===void 0?void 0:o.split("/").pop(),s.Low,s.High))}});for(const e in r){s.push(new h({filters:r[e],and:false}))}}return{properties:a,filters:s,text:c}}function ke(e,t,i,r){const s=t.createBindingContext(e);return o===null||o===void 0?void 0:o.createConverterContextForMacro(i,s||t,r,n,undefined)}function Be(e,t){return e.replace("_fe_"+t+"_","")}function Ie(e){e.forEach(e=>{if(e.sPath&&e.sPath.includes("fe_groupable")){e.sPath=qe.getInternalChartNameFromPropertyNameAndKind(e.sPath,"groupable")}});return e}async function Ve(e,t,n){const o=t.getBindingContext();if(o){const a=e===T.Draft?s.getDraftRootPath(o):s.getStickyRootPath(o);let c;if(a){var i,r;const e=(i=n.getRootViewController().getInstancedViews().find(e=>{var t;return((t=e.getBindingContext())===null||t===void 0?void 0:t.getPath())===a}))===null||i===void 0?void 0:i.getBindingContext();if(e){return e}const s=t.getModel("internal");c=s.getProperty("/simpleRootContext");if(((r=c)===null||r===void 0?void 0:r.getPath())===a){return c}const l=o.getModel();c=l.bindContext(a).getBoundContext();await qe.waitForContextRequested(c);s.setProperty("/simpleRootContext",c);return c}}}const qe={fireButtonPress:V,getTargetView:G,getCurrentPageView:U,hasTransientContext:M,updateRelatedAppsDetails:I,getAppComponent:q,getMandatoryFilterFields:Y,getContextPathProperties:W,getParameterInfo:le,updateDataFieldForIBNButtonsVisibility:Q,getEntitySetName:J,getActionPath:K,computeDisplayMode:X,isStickyEditMode:de,getOperatorsForProperty:se,getOperatorsForDateProperty:ce,getOperatorsForGuidProperty:ae,addExternalStateFiltersToSelectionVariant:ge,addPageContextToSelectionVariant:fe,addDefaultDisplayCurrency:me,setUserDefaults:be,getIBNActions:_,getHeaderFacetItemConfigForExternalNavigation:ve,getSemanticObjectMapping:he,setSemanticObjectMappings:Pe,getSemanticObjectPromise:je,getSemanticTargetsFromPageModel:Ae,getSemanticObjectsFromPath:ye,updateSemanticTargets:Se,waitForContextRequested:F,getFilterRestrictionsByPath:$e,getSpecificAllowedExpression:re,getAdditionalParamsForCreate:Oe,requestSingletonProperty:Re,templateControlFragment:Fe,FilterRestrictions:{REQUIRED_PROPERTIES:"RequiredProperties",NON_FILTERABLE_PROPERTIES:"NonFilterableProperties",ALLOWED_EXPRESSIONS:"FilterAllowedExpressions"},AllowedExpressionsPrio:["SingleValue","MultiValue","SingleRange","MultiRange","SearchExpression","MultiRangeOrSearchExpression"],normalizeSearchTerm:$,setContextsBasedOnOperationAvailable:te,setDynamicActionContexts:ne,requestProperty:ee,getParameterPath:Ne,getRelatedAppsMenuItems:w,getTranslatedTextFromExpBindingString:we,addSemanticDatesToConditions:pe,addSelectOptionToConditions:ue,updateRelateAppsModel:k,getSemanticObjectAnnotations:B,getFiltersInfoForSV:Le,getInternalChartNameFromPropertyNameAndKind:Be,getChartPropertiesWithoutPrefixes:Ie,createRootContext:Ve,isSmallDevice:De,getConverterContextForPath:ke};return qe},false);
|
|
27
27
|
/*!
|
|
28
28
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
29
29
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -39,6 +39,11 @@ sap.ui.predefine("sap/fe/core/PageController", ["sap/fe/core/BaseController","sa
|
|
|
39
39
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
40
40
|
*/
|
|
41
41
|
sap.ui.predefine("sap/fe/core/ResourceModel", ["sap/fe/core/helpers/ClassSupport","sap/ui/model/resource/ResourceModel"],function(e,t){"use strict";var o,s;var r=e.defineUI5Class;function u(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;n(e,t)}function n(e,t){n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,o){t.__proto__=o;return t};return n(e,t)}let c=(o=r("sap.fe.core.ResourceModel"),o(s=function(e){u(t,e);function t(){return e.apply(this,arguments)||this}var o=t.prototype;o.getText=function e(t,o,s){let r=t;const u=this._oResourceBundle;if(s){const e=this.checkIfResourceKeyExists(`${r}|${s}`);r=e?`${r}|${s}`:r}return(u===null||u===void 0?void 0:u.getText(r,o,true))||t};o.checkIfResourceKeyExists=function e(t){return this._checkIfResourceKeyExists(t,this._oResourceBundle.aCustomBundles)};o._checkIfResourceKeyExists=function e(t,o){if(o!==null&&o!==void 0&&o.length){for(let e=o.length-1;e>=0;e--){const s=o[e].hasText(t);if(s){return true}this._checkIfResourceKeyExists(t,o[e].aCustomBundles)}}return false};return t}(t))||s);return c},false);
|
|
42
|
+
/*!
|
|
43
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
44
|
+
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
45
|
+
*/
|
|
46
|
+
sap.ui.predefine("sap/fe/core/StateFilterToSelectionVariant", ["sap/base/Log","sap/base/util/isEmptyObject","sap/fe/core/helpers/SemanticDateOperators","sap/fe/core/type/TypeUtil","sap/fe/navigation/SelectionVariant","sap/ui/mdc/condition/FilterOperatorUtil","sap/ui/mdc/condition/RangeOperator"],function(e,t,n,o,i,a,r){"use strict";const s={getSelectionVariantFromConditions:function(e,n,o){const a=new i;if(!t(e)){for(const t in e){const i=e[t];if(i!==null&&i!==void 0&&i.length){const e=s.getSelectionOptionsFromCondition(i,t,n);if(e.length){if(o!==null&&o!==void 0&&o.includes(t)){a.massAddSelectOption(`$Parameter.${t}`,e)}a.massAddSelectOption(t,e)}}}}return a},getSelectionOptionsFromCondition:function(e,t,n){const o=[];for(const i of e){const e=s.getSelectionOption(i,t,n);if(e){o.push(e)}}return o},getSelectionOption:function(e,t,o){var i;let c;let p;const l=e;const u=l.operator&&l.operator!==""?a.getOperator(l.operator):undefined;if(u instanceof r){c=s.createSemanticDatesFromConditions(l);p=s.getOptionForPropertyWithRangeOperator(u,l,t,o)}else{const e=n.getSupportedOperations();if(e.includes(l.operator)){c=s.createSemanticDatesFromConditions(l)}p=s.getSelectionFormatForNonRangeOperator(l,t,u)}if((i=p)!==null&&i!==void 0&&i.Option){p.SemanticDates=c?c:undefined}return p},getSelectionFormatForNonRangeOperator:function(e,t,n){const o=e.values[0]?e.values[0].toString():"";const i=e.values[1]?e.values[1].toString():null;const a=s.getSelectOption(e.operator,o,i,t);if(a){a.Sign=n!==null&&n!==void 0&&n.exclude?"E":"I"}return a},getTypeInfoForFilterProperty:function(e,t){const n=t.getProperty(e);let o;if(n){o=n.typeConfig}return o},getOptionForPropertyWithRangeOperator:function(e,t,n,i){const a={Sign:"I",Option:"",Low:"",High:""};const r=s.getTypeInfoForFilterProperty(n,i);const c=e.getModelFilter(t,n,r?r.typeInstance:undefined,false,r?r.baseType:undefined);const p=c.getFilters();if(p===undefined){a.Sign=e.exclude?"E":"I";a.Low=o.externalizeValue(c.getValue1(),r?r.typeInstance:"string");a.High=o.externalizeValue(c.getValue2(),r?r.typeInstance:"string");a.Option=c.getOperator()??""}return a.Option!=""?a:undefined},getSelectOption:function(t,n,o,i){const a={Option:"",Sign:"I",Low:n,High:o};switch(t){case"Contains":a.Option="CP";break;case"StartsWith":a.Option="CP";a.Low+="*";break;case"EndsWith":a.Option="CP";a.Low=`*${a.Low}`;break;case"BT":case"LE":case"LT":case"GT":case"NE":case"EQ":a.Option=t;break;case"DATE":a.Option="EQ";break;case"DATERANGE":a.Option="BT";break;case"FROM":a.Option="GE";break;case"TO":a.Option="LE";break;case"EEQ":a.Option="EQ";break;case"Empty":a.Option="EQ";a.Low="";break;case"NotContains":a.Option="CP";a.Sign="E";break;case"NOTBT":a.Option="BT";a.Sign="E";break;case"NotStartsWith":a.Option="CP";a.Low+="*";a.Sign="E";break;case"NotEndsWith":a.Option="CP";a.Low=`*${a.Low}`;a.Sign="E";break;case"NotEmpty":a.Option="NE";a.Low="";break;case"NOTLE":a.Option="LE";a.Sign="E";break;case"NOTGE":a.Option="GE";a.Sign="E";break;case"NOTLT":a.Option="LT";a.Sign="E";break;case"NOTGT":a.Option="GT";a.Sign="E";break;default:e.warning(`${t} is not supported. ${i} could not be added to the Selection variant`)}return a.Option!==""?a:undefined},createSemanticDatesFromConditions:function(e){if(!t(e)){return{high:e.values[0]?e.values[0]:null,low:e.values[1]?e.values[1]:null,operator:e.operator}}}};return s},false);
|
|
42
47
|
/*!
|
|
43
48
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
44
49
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -58,7 +63,7 @@ sap.ui.predefine("sap/fe/core/buildingBlocks/AttributeModel", ["sap/base/Log","s
|
|
|
58
63
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
59
64
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
60
65
|
*/
|
|
61
|
-
sap.ui.predefine("sap/fe/core/buildingBlocks/BuildingBlockBase", ["sap/base/util/deepClone","sap/base/util/merge","sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor","sap/fe/core/converters/ConverterContext","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/StableIdHelper"],function(e,t,r,
|
|
66
|
+
sap.ui.predefine("sap/fe/core/buildingBlocks/BuildingBlockBase", ["sap/base/util/deepClone","sap/base/util/merge","sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor","sap/fe/core/converters/ConverterContext","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/StableIdHelper","sap/fe/core/templating/DataModelPathHelper"],function(e,t,n,r,i,o,a){"use strict";var l={};var s=a.getTargetObjectPath;var u=o.generate;var c=i.isUndefinedExpression;var f=n.xml;var d=n.unregisterBuildingBlock;var p=n.registerBuildingBlock;function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,m(r.key),r)}}function g(e,t,n){if(t)v(e.prototype,t);if(n)v(e,n);Object.defineProperty(e,"prototype",{writable:false});return e}function m(e){var t=h(e,"string");return typeof t==="symbol"?t:String(t)}function h(e,t){if(typeof e!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==undefined){var r=n.call(e,t||"default");if(typeof r!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let b=function(){function n(n,i,o){var a;this.isPublic=false;this.getConverterContext=function(n,i,o,a){var l;const u=o.appComponent;const c=(l=o.models.viewData)===null||l===void 0?void 0:l.getData();let f=Object.assign({},c);delete f.resourceModel;delete f.appComponent;f=e(f);let d={};const p=s(n.contextLocation??n);if(p===(c===null||c===void 0?void 0:c.contextPath)||p===`/${c===null||c===void 0?void 0:c.entitySet}`){d=f.controlConfiguration}f.controlConfiguration=t(d,a||{});return r.createConverterContextForMacro(n.startingEntitySet.name,o.models.metaModel,u===null||u===void 0?void 0:u.getDiagnostics(),t,n.contextLocation,f)};Object.keys(n).forEach(e=>{this[e]=n[e]});this.resourceModel=o===null||o===void 0?void 0:(a=o.models)===null||a===void 0?void 0:a["sap.fe.i18n"]}l=n;var i=n.prototype;i.createId=function e(){if(this.id){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++){n[r]=arguments[r]}return u([this.id,...n])}return undefined};i.getContentId=function e(t){return`${t}-content`};i.getTranslatedText=function e(t,n,r){var i;return((i=this.resourceModel)===null||i===void 0?void 0:i.getText(t,n,r))||t};i.getProperties=function e(){const t={};for(const e in this){if(this.hasOwnProperty(e)){t[e]=this[e]}}return t};n.register=function e(){p(this)};n.unregister=function e(){d(this)};i.addConditionally=function e(t,n){if(t){return n}else{return""}};i.attr=function e(t,n){if(n!==undefined&&!c(n)){return()=>f`${t}="${n}"`}else{return()=>""}};g(n,null,[{key:"metadata",get:function(){this.internalMetadata??={namespace:"",name:"",properties:{},aggregations:{},stereotype:"xmlmacro"};return this.internalMetadata}}]);return n}();b.isRuntime=false;l=b;return l},false);
|
|
62
67
|
/*!
|
|
63
68
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
64
69
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -122,7 +127,7 @@ sap.ui.predefine("sap/fe/core/controllerextensions/BusyLocker", ["sap/base/Log"]
|
|
|
122
127
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
123
128
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
124
129
|
*/
|
|
125
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/EditFlow", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/controllerextensions/collaboration/CollaborationCommon","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/editFlow/sticky","sap/fe/core/controllerextensions/editFlow/TransactionHelper","sap/fe/core/controllerextensions/Feedback","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/MetaModelFunction","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageToast","sap/m/Text","sap/ui/core/Core","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/model/odata/v4/ODataListBinding","../ActionRuntime"],function(t,e,i,n,o,r,s,a,c,l,d,g,u,h,f,p,y,v,m,w,C,M,P,b,S,D,E,x){"use strict";var A,k,_,I,O,R,T,F,B,V,H,N,j,L,$,G,U,q,K,W,z,J,X,Q,Y,Z,tt,et,it,nt,ot;var rt=f.getResourceModel;var st=u.getNonComputedVisibleFields;var at=d.publicExtension;var ct=d.finalExtension;var lt=d.extensible;var dt=d.defineUI5Class;var gt=l.getInvolvedDataModelObjects;var ut=l.convertTypes;var ht=c.TriggerType;var ft=c.triggerConfiguredSurvey;var pt=c.StandardActions;var yt=o.shareObject;var vt=o.Activity;function mt(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;wt(t,e)}function wt(t,e){wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,i){e.__proto__=i;return e};return wt(t,e)}function Ct(t,e,i,n,o){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=i.slice().reverse().reduce(function(i,n){return n(t,e,i)||i},r);if(o&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(o):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}const Mt=y.CreationMode,Pt=y.ProgrammingModel,bt=y.Constants,St=y.DraftStatus,Dt=y.EditMode,Et=y.StartupMode,xt=P.MessageType;let At=(A=dt("sap.fe.core.controllerextensions.EditFlow"),k=at(),_=ct(),I=at(),O=ct(),R=at(),T=ct(),F=at(),B=lt(D.After),V=at(),H=lt(D.After),N=at(),j=lt(D.After),L=at(),$=lt(D.After),G=at(),U=lt(D.After),q=at(),K=ct(),W=at(),z=ct(),J=at(),X=ct(),Q=at(),Y=ct(),Z=at(),tt=ct(),et=at(),it=ct(),A(nt=(ot=function(o){mt(c,o);function c(){var t;for(var e=arguments.length,i=new Array(e),n=0;n<e;n++){i[n]=arguments[n]}t=o.call(this,...i)||this;t.syncTasks=Promise.resolve();return t}var l=c.prototype;l.getAppComponent=function t(){return this.base.getAppComponent()};l.editDocument=async function e(i){const n=true;const o=this.getTransactionHelper();const r=this._getRootViewController();const s=i.getModel();let a,c;const l=this.getView().getViewData();const d=this.getProgrammingModel(i);let g=i;const u=this.getView();try{if((l===null||l===void 0?void 0:l.viewLevel)>1){if(d===Pt.Draft){const t=h.getDraftRootPath(i);g=u.getModel().bindContext(t).getBoundContext();await g.requestObject(t)}else if(d===Pt.Sticky){const t=h.getStickyRootPath(i);g=u.getModel().bindContext(t).getBoundContext();await g.requestObject(t)}}await this.base.editFlow.onBeforeEdit({context:g});const t=await o.editDocument(g,this.getView(),this.getAppComponent(),this.getMessageHandler());this._setStickySessionInternalProperties(d,s);if(t){this.setEditMode(Dt.Editable,false);this.setDocumentModified(false);this.getMessageHandler().showMessageDialog();if(t!==g){let e=t;if(this._isFclEnabled()){a=r.getRightmostContext();c=await this._computeSiblingInformation(g,a,d,true);c=c??this._createSiblingInfo(i,t);this._updatePathsInHistory(c.pathMapping);if(c.targetContext.getPath()!=t.getPath()){e=c.targetContext}}else if((l===null||l===void 0?void 0:l.viewLevel)>1){c=await this._computeSiblingInformation(g,i,d,true);e=this._getNavigationTargetForEdit(i,t,c)}await this._handleNewContext(e,true,false,n,true);if(d===Pt.Sticky){let e;if(this._isFclEnabled()){e=t.getModel().getKeepAliveContext(t.getPath())}else{e=t}this.handleStickyOn(e)}else if(h.isCollaborationDraftSupported(s.getMetaModel())){await yt(t)}}}}catch(e){t.error("Error while editing the document",e)}};l.deleteMultipleDocuments=async function o(r,s){if(s){s.beforeDeleteCallBack=this.base.editFlow.onBeforeDelete}else{s={beforeDeleteCallBack:this.base.editFlow.onBeforeDelete}}const a=this.getGlobalUIModel();const c=this.getView().byId(s.controlId);if(!c){throw new Error("parameter controlId missing or incorrect")}else{s.parentControl=c}const l=c.getBinding("items")||c.getRowBinding();s.bFindActiveContexts=true;i.lock(a);try{await this.deleteDocumentTransaction(r,s);let t;if(c.isA("sap.ui.mdc.Table")){c.clearSelection()}const i=this.getView().getBindingContext();if(l.isRoot()){t=new Promise(t=>{l.attachEventOnce("dataReceived",function(){t()})});l.refresh()}else if(i){if(!e.hasTransientContext(l)){this.getAppComponent().getSideEffectsService().requestSideEffectsForNavigationProperty(l.getPath(),i)}}if(!this.getAppComponent()._isFclEnabled()){g.setEditStateDirty()}n.send(this.getView(),vt.Delete,r.map(t=>t.getPath()));return t}catch(e){t.error("Error while deleting the document(s)",e)}finally{i.unlock(a)}};l.updateDocument=function e(i,n){const o=this.getView().getBindingContext();const r=this.getProgrammingModel(i)===Pt.Draft;this.getMessageHandler().removeTransitionMessages();return this.syncTask(async()=>{if(o){this.setDocumentModified(true);if(!this._isFclEnabled()){g.setEditStateDirty()}if(r){this.setDraftStatus(St.Saving)}}try{await n;const t=this.getView().getBindingContext();if(!r||!t||t!==o){return}const e=t.getModel().getMetaModel();const i=e.getMetaContext(t.getPath()).getObject("@sapui.name");const s=p.getSemanticKeys(e,i);if(s!==null&&s!==void 0&&s.length){const e=this._getSemanticMapping();const i=e===null||e===void 0?void 0:e.semanticPath,n=p.getSemanticPath(t,true);if(i&&i!==n){await this._handleNewContext(t,true,false,true)}}this.setDraftStatus(St.Saved)}catch(e){t.error("Error while updating the document",e);if(r&&o){this.setDraftStatus(St.Clear)}}finally{await this.getMessageHandler().showMessages()}})};l.createDocument=async function o(r,s){var a;const c=this.getTransactionHelper(),l=this.getGlobalUIModel();let d;let u=s;let f;const p=!u||u.creationMode!==Mt.Inline&&u.creationMode!==Mt.CreationRow&&u.creationMode!==Mt.External;let y=Promise.resolve([]);const v=this.getAppComponent();v.getRouterProxy().removeIAppStateKey();if(u.creationMode===Mt.External){await this.syncTask();const t=this.getView().getController();const e=h.getAbsoluteMetaPathForListBinding(this.getView(),r);t.handlers.onChevronPressNavigateOutBound(t,u.outbound,undefined,e);return}if(u.creationMode===Mt.CreationRow&&u.creationRow){const t=u.creationRow.getBindingContext().getObject();delete t["@$ui5.context.isTransient"];d=u.creationRow.getParent();y=this.validateDocument(d.getBindingContext(),{data:t,customValidationFunction:d.getCreationRow().data("customValidationFunction")});if(d.getCreationRow().data("disableAddRowButtonForEmptyData")==="true"){const t=d.getBindingContext("internal");t.setProperty("creationRowFieldValidity",{})}}if(u.creationMode===Mt.Inline&&u.tableId){d=this.getView().byId(u.tableId)}if(d&&d.isA("sap.ui.mdc.Table")){const t=u.creationMode===Mt.Inline?d.focusRow.bind(d):d.scrollToIndex.bind(d);d.getRowBinding().attachEventOnce("change",async function(){await f;t(u.createAtEnd?d.getRowBinding().getLength():0,true)})}const m=async(i,n)=>{try{const t=await n;await t.created();const o=this.getView().getBindingContext();if(!e.hasTransientContext(i)){const t=this.getAppComponent();t.getSideEffectsService().requestSideEffectsForNavigationProperty(i.getPath(),o)}}catch(e){t.error("Error while creating the document",e)}};const w=t=>{var e;const i=d&&d.getCreationRow().data("customValidationFunction");const n=d&&((e=d.getBindingContext("internal"))===null||e===void 0?void 0:e.getProperty("creationRowCustomValidity"));const o=M.getMessageManager();const r=[];let s;let a;o.getMessageModel().getData().forEach(function(t){if(t.code===i){o.removeMessages(t)}});t.forEach(t=>{if(t.messageTarget){var e;s=M.getControl(n[t.messageTarget].fieldId);a=`${(e=s.getBindingContext())===null||e===void 0?void 0:e.getPath()}/${s.getBindingPath("value")}`;if(o.getMessageModel().getData().filter(function(t){return t.target===a}).length===0){o.addMessages(new b({message:t.messageText,processor:this.getView().getModel(),type:xt.Error,code:i,technical:false,persistent:false,target:a}))}const r=o.getMessageModel().getData().filter(function(t){return t.target===a});r[0].addControlId(n[t.messageTarget].fieldId)}else{r.push({code:i,text:t.messageText,persistent:true,type:xt.Error})}});if(r.length>0){this.getMessageHandler().showMessageDialog({customMessages:r})}};const C=(t,e,i,n)=>{if(t&&t!==Mt.NewPage){return t}else{if(!i.isRelative()){const t=i.getPath(),o=e===Pt.Draft?n.getObject(`${t}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`):n.getObject(`${t}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`);if(o){const t=n.getObject(`/${o}/@$ui5.overload/0/$Parameter`)||[];if(t.length>1){return Mt.Deferred}}}const t=n.getMetaPath(i===null||i===void 0?void 0:i.getHeaderContext().getPath());const o=st(n,t,this.getAppComponent());if(o.length>0){return Mt.Deferred}return Mt.Async}};if(p){i.lock(l)}try{const e=await this.syncTask(y);if(e.length>0){w(e);t.error("Custom Validation failed");return}let o;u=u||{};if(r&&typeof r==="object"){o=r}else if(typeof r==="string"){o=new E(this.getView().getModel(),r);u.creationMode=Mt.Sync;delete u.createAtEnd}else{throw new Error("Binding object or path expected")}const s=o.getModel();const l=this.getProgrammingModel(o);const p=C(u.creationMode,l,o,s.getMetaModel());let b;const k=u.creationRow;let _;let I;let O;const R=s.getMetaModel();const T=this.getInternalRouting();if(p!==Mt.Deferred){if(p===Mt.CreationRow){_=k.getBindingContext();O=R.getMetaPath(_.getPath());I=_.getObject();u.data={};Object.keys(I).forEach(function(t){const e=R.getObject(`${O}/${t}`);if(e&&e.$kind==="NavigationProperty"){return}u.data[t]=I[t]});await this._checkForValidationErrors()}if(p===Mt.CreationRow||p===Mt.Inline){var P,S,D;u.keepTransientContextOnFailed=false;u.busyMode="Local";u.busyId=(P=d)===null||P===void 0?void 0:(S=P.getParent())===null||S===void 0?void 0:(D=S.getTableDefinition())===null||D===void 0?void 0:D.annotation.id;this.handleCreateEvents(o)}if(!u.parentControl){u.parentControl=this.getView()}u.beforeCreateCallBack=this.onBeforeCreate;u.skipParameterDialog=v.getStartupMode()===Et.AutoCreate;f=c.createDocument(o,u,this.getAppComponent(),this.getMessageHandler(),false);if(!u.bSkipSideEffects){m(o,f)}}let F;switch(p){case Mt.Deferred:F=T.navigateForwardToContext(o,{bDeferredContext:true,editable:true,bForceFocus:true});break;case Mt.Async:F=T.navigateForwardToContext(o,{asyncContext:f,editable:true,bForceFocus:true});break;case Mt.Sync:b={editable:true,bForceFocus:true};if(l==Pt.Sticky||u.createAction){b.transient=true}F=(a=f)===null||a===void 0?void 0:a.then(function(t){if(!t){const t=M.getLibraryResourceBundle("sap.fe.core");return T.navigateToMessagePage(t.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),{title:t.getText("C_COMMON_SAPFE_ERROR"),description:t.getText("C_EDITFLOW_SAPFE_CREATION_FAILED_DESCRIPTION")})}else{return u.bFromDeferred?T.navigateToContext(t,b):T.navigateForwardToContext(t,b)}});break;case Mt.Inline:this.syncTask(f);break;case Mt.CreationRow:try{const e=_.getBinding();const i=e.create();k.setBindingContext(i);i.created().catch(function(){t.trace("transient fast creation context deleted")});F=_.delete("$direct")}catch(e){if(i.isLocked(this.getView().getModel("ui"))){i.unlock(this.getView().getModel("ui"))}t.error("CreationRow navigation error: ",e)}break;default:F=Promise.reject(`Unhandled creationMode ${p}`);break}if(f){try{const t=await Promise.all([f,F]);this._setStickySessionInternalProperties(l,s);this.setEditMode(Dt.Editable);if(!o.isRelative()&&l===Pt.Sticky){var x,A;const t=o.getModel().getMetaModel();const e=t.bindContext(t.getMetaPath(o.getPath()));const i=gt(e).startingEntitySet;const n=i===null||i===void 0?void 0:(x=i.annotations.Session)===null||x===void 0?void 0:(A=x.StickySessionSupported)===null||A===void 0?void 0:A.NewAction;this.getInternalModel().setProperty("/lastInvokedAction",n)}const e=t[0];if(e){this.setDocumentModifiedOnCreate(o);if(!this._isFclEnabled()){g.setEditStateDirty()}this._sendActivity(vt.Create,e);if(h.isCollaborationDraftSupported(s.getMetaModel())&&!n.isConnected(this.getView())){await yt(e)}}}catch(t){if(t===bt.CancelActionDialog||t===bt.ActionExecutionFailed||t===bt.CreationFailed){if(p===Mt.Sync||p===Mt.Deferred||p===Mt.Async){T.navigateBackFromTransientState()}}throw t}}}finally{if(p){i.unlock(l)}}};l.validateDocument=function t(e,i){return this.getTransactionHelper().validateDocument(e,i,this.getView())};l.createMultipleDocuments=async function n(o,r,s,a,c){let l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;const d=this.getTransactionHelper();const g=this.getGlobalUIModel();const u=o;i.lock(g);try{await this.syncTask();if(c){await c({contextPath:u.getPath()})}const t=u.getModel().getMetaModel();let i;if(u.getContext()){i=t.getMetaPath(`${u.getContext().getPath()}/${u.getPath()}`)}else{i=t.getMetaPath(u.getPath())}this.handleCreateEvents(u);const n=r.map(e=>{const n={data:{}};n.keepTransientContextOnFailed=false;n.busyMode="None";n.creationMode=Mt.CreationRow;n.parentControl=this.getView();n.createAtEnd=s;n.inactive=l;for(const o in e){const r=t.getObject(`${i}/${o}`);if(r&&r.$kind!=="NavigationProperty"&&o.indexOf("/")<0&&e[o]){n.data[o]=e[o]}}return d.createDocument(u,n,this.getAppComponent(),this.getMessageHandler(),a)});const o=await Promise.all(n);if(!l){this.setDocumentModifiedOnCreate(u)}await Promise.all(o.map(t=>{if(!t.bInactive){return t.created()}}));const g=this.getView().getBindingContext();if(!e.hasTransientContext(u)){this.getAppComponent().getSideEffectsService().requestSideEffectsForNavigationProperty(u.getPath(),g)}return o}catch(e){t.error("Error while creating multiple documents.");throw e}finally{i.unlock(g)}};l.onBeforeSave=function t(e){return Promise.resolve()};l.onBeforeCreate=function t(e){return Promise.resolve()};l.onBeforeEdit=function t(e){return Promise.resolve()};l.onBeforeDiscard=function t(e){return Promise.resolve()};l.onBeforeDelete=function t(e){return Promise.resolve()};l.saveDocument=async function e(i,o){o=o||{};const r=o.bExecuteSideEffectsOnError||undefined;const s=true;const a=this.getTransactionHelper();const c=o.bindings;try{await this.syncTask();await this._submitOpenChanges(i);await this._checkForValidationErrors();await this.base.editFlow.onBeforeSave({context:i});const t=this.getProgrammingModel(i);const e=this._getRootViewController();let o;if((t===Pt.Sticky||i.getProperty("HasActiveEntity"))&&e.isFclEnabled()){o=await this._computeSiblingInformation(i,e.getRightmostContext(),t,true)}const l=await a.saveDocument(i,this.getAppComponent(),this._getResourceModel(),r,c,this.getMessageHandler(),this.getCreationMode());this._removeStickySessionInternalProperties(t);this._sendActivity(vt.Activate,l);n.disconnect(this.getView());this._triggerConfiguredSurvey(pt.save,ht.standardAction);this.setDocumentModified(false);this.setEditMode(Dt.Display,false);this.getMessageHandler().showMessageDialog();if(l!==i){let t=l;if(e.isFclEnabled()){o=o??this._createSiblingInfo(i,l);this._updatePathsInHistory(o.pathMapping);if(o.targetContext.getPath()!==l.getPath()){t=o.targetContext}}await this._handleNewContext(t,false,false,s,true)}}catch(e){if(!(e&&e.canceled)){t.error("Error while saving the document",e)}throw e}};l.toggleDraftActive=async function t(e){const i=e.getObject();let n;const o=e&&this.getProgrammingModel(e)===Pt.Draft;if(!o||!(!i.IsActiveEntity&&i.HasActiveEntity||i.IsActiveEntity&&i.HasDraftEntity)){return}if(!i.IsActiveEntity&&i.HasActiveEntity){n=false}else{n=true}try{const t=this._getRootViewController();const i=t.isFclEnabled()?t.getRightmostContext():e;let o=await this._computeSiblingInformation(e,i,Pt.Draft,false);if(!o&&e!==i){o=await this._computeSiblingInformation(e,e,Pt.Draft,false)}if(o){this.setEditMode(n?Dt.Editable:Dt.Display,false);if(t.isFclEnabled()){const t=this._getSemanticMapping();if((t===null||t===void 0?void 0:t.technicalPath)===e.getPath()){const e=o.pathMapping[o.pathMapping.length-1].newPath;o.pathMapping.push({oldPath:t.semanticPath,newPath:e})}this._updatePathsInHistory(o.pathMapping)}await this._handleNewContext(o.targetContext,n,true,true,true)}else{throw new Error("Error in EditFlow.toggleDraftActive - Cannot find sibling")}}catch(t){throw new Error(`Error in EditFlow.toggleDraftActive:${t}`)}};l.cancelDocument=async function e(i,o){const r=this.getTransactionHelper();const s=o;let a;let c=false;s.cancelButton=o.control||s.cancelButton;s.beforeCancelCallBack=this.base.editFlow.onBeforeDiscard;try{await this.syncTask();const t=this.getProgrammingModel(i);if((t===Pt.Sticky||i.getProperty("HasActiveEntity"))&&this._isFclEnabled()){const e=this._getRootViewController();a=await this._computeSiblingInformation(i,e.getRightmostContext(),t,true)}const e=await r.cancelDocument(i,s,this.getAppComponent(),this._getResourceModel(),this.getMessageHandler(),this.getCreationMode(),this.isDocumentModified());const o=true;this._removeStickySessionInternalProperties(t);this.setEditMode(Dt.Display,false);this.setDocumentModified(false);this.setDraftStatus(St.Clear);g.setEditStateDirty();if(!e){this._sendActivity(vt.Discard,undefined);n.disconnect(this.getView());if(!s.skipBackNavigation){await this.getInternalRouting().navigateBackFromContext(i);c=true}}else{const r=e;this._sendActivity(vt.Discard,r);n.disconnect(this.getView());let c=r;if(this._isFclEnabled()){a=a??this._createSiblingInfo(i,r);this._updatePathsInHistory(a.pathMapping);if(a.targetContext.getPath()!==r.getPath()){c=a.targetContext}}if(t===Pt.Draft){await this._fetchSemanticKeyValues(r);if(!s.skipBindingToView){await this._handleNewContext(c,false,true,o,true)}else{return r}}else{await this._handleNewContext(c,false,false,o,true)}}this.showDocumentDiscardMessage(c)}catch(e){t.error("Error while discarding the document",e)}};l.showDocumentDiscardMessage=function t(e){const i=this._getResourceModel();const n=i.getText("C_TRANSACTION_HELPER_DISCARD_DRAFT_TOAST");if(e==true){const t=this.getAppComponent();t.getRoutingService().attachAfterRouteMatched(this.showMessageWhenNoContext,this)}else{w.show(n)}};l.showMessageWhenNoContext=function t(){const e=this._getResourceModel();const i=e.getText("C_TRANSACTION_HELPER_DISCARD_DRAFT_TOAST");const n=this.getAppComponent();w.show(i);n.getRoutingService().detachAfterRouteMatched(this.showMessageWhenNoContext,this)};l.isDraftRoot=function t(e){const i=e.getModel().getMetaModel();const n=i.getMetaContext(e.getPath());return h.isDraftRoot(gt(n).targetEntitySet)};l.deleteDocument=async function e(i,n){const o=this.getAppComponent();let r=n;if(!r){r={bFindActiveContexts:false}}else{r.bFindActiveContexts=false}r.beforeDeleteCallBack=this.base.editFlow.onBeforeDelete;try{if(this._isFclEnabled()&&this.isDraftRoot(i)&&i.getIndex()===undefined&&i.getProperty("IsActiveEntity")===true&&i.getProperty("HasDraftEntity")===true){r.beforeDeleteCallBack=async e=>{await this.base.editFlow.onBeforeDelete(e);try{const t=i.getModel();const e=t.bindContext(`${i.getPath()}/SiblingEntity`).getBoundContext();const n=await e.requestCanonicalPath();const o=t.getKeepAliveContext(n);o.replaceWith(i)}catch(e){t.error("Error while replacing the draft instance in the LR ODLB",e)}}}await this.deleteDocumentTransaction(i,r);if(!this._isFclEnabled()){g.setEditStateDirty()}this._sendActivity(vt.Delete,i);if(o){o.getShellServices().setBackNavigation()}if((o===null||o===void 0?void 0:o.getStartupMode())===Et.Deeplink&&!this._isFclEnabled()){o.getRouterProxy().exitFromApp()}else{this.getInternalRouting().navigateBackFromContext(i)}}catch(e){t.error("Error while deleting the document",e)}};l.applyDocument=async function t(e){const n=this.getGlobalUIModel();i.lock(n);try{await this.syncTask();await this._submitOpenChanges(e);await this._checkForValidationErrors();await this.getMessageHandler().showMessageDialog();await this.getInternalRouting().navigateBackFromContext(e)}finally{if(i.isLocked(n)){i.unlock(n)}}};l.invokeAction=async function e(i,o,r){var s;let a;const c=this.getTransactionHelper();let l;let d;let u;const h=this.getView();let f=o||{};if(f.isA&&f.isA("sap.ui.model.odata.v4.Context")||Array.isArray(f)||r!==undefined){const t=f;f=r||{};if(t){f.contexts=t}else{f.model=this.getView().getModel()}}f.isNavigable=f.requiresNavigation||f.isNavigable;const p=ut((s=this.getView().getModel())===null||s===void 0?void 0:s.getMetaModel());if(i.indexOf(""+p.entityContainer.name)>-1){f.isBound=false}else{f.isBound=true}if(!f.parentControl){f.parentControl=this.getView()}if(f.controlId){a=this.getView().byId(f.controlId);if(a){f.internalModelContext=a.getBindingContext("internal")}}else{f.internalModelContext=h.getBindingContext("internal")}if(i&&i.indexOf("(")>-1){l=i.split("(");i=l[0];d=l[l.length-1].replaceAll(")","")}if(f.bStaticAction){if(a.isTableBound()){f.contexts=a.getRowBinding().getHeaderContext()}else{const t=a.data("rowsBindingInfo").path,e=new E(this.getView().getModel(),t);f.contexts=e.getHeaderContext()}if(d&&a.getBindingContext()){f.contexts=this._getActionOverloadContextFromMetadataPath(a.getBindingContext(),a.getRowBinding(),d)}if(f.enableAutoScroll){u=this.createActionPromise(i,a.sId)}}f.bGetBoundContext=this._getBoundContext(h,f);f.bObjectPage=h.getViewData().converterType==="ObjectPage";try{await this.syncTask();const e=await c.callAction(i,f,this.getView(),this.getAppComponent(),this.getMessageHandler());let o;if(f.contexts&&f.isBound===true){o=await this._refreshListIfRequired(this.getActionResponseDataAndKeys(i,e),f.contexts[0])}if(n.isConnected(this.getView())){let t=[];if(e){t=Array.isArray(e)?Object.keys(e[0].value.getObject()):Object.keys(e.getObject())}this._sendActivity(vt.Action,f.contexts,i,o,t)}this._triggerConfiguredSurvey(i,ht.action);if(u){u.fResolver(e)}if(f.contexts){if(!this._isFclEnabled()){g.setEditStateDirty()}this.getInternalModel().setProperty("/lastInvokedAction",i)}if(f.isNavigable){let i=e;if(Array.isArray(i)&&i.length===1){i=i[0].value}if(i&&!Array.isArray(i)){const e=h.getModel().getMetaModel();const n=e.getMetaPath(i.getPath());const o=(t,e)=>t.filter(t=>{if(e){return e.indexOf(t)>-1}return true});const r=Array.isArray(f.contexts)?o(f.contexts,f.applicableContexts)[0]:f.contexts;const s=r&&e.getMetaPath(r.getPath());if(n!=undefined&&n===s){if(r.getPath()!==i.getPath()){this.getInternalRouting().navigateForwardToContext(i,{checkNoHashChange:true,noHistoryEntry:false})}else{t.info("Navigation to the same context is not allowed")}}}}return e}catch(t){if(u){u.fRejector()}if(t===bt.CancelActionDialog){throw new Error("Dialog cancelled")}else if(!(t&&(t.canceled||t.rejectedItems&&t.rejectedItems[0].canceled))){throw new Error(`Error in EditFlow.invokeAction:${t}`)}}};l.securedExecution=function t(e,n){var o,r;const s=(n===null||n===void 0?void 0:(o=n.busy)===null||o===void 0?void 0:o.set)??true,a=(n===null||n===void 0?void 0:(r=n.busy)===null||r===void 0?void 0:r.check)??true,c=(n===null||n===void 0?void 0:n.updatesDocument)??false,l=this.getGlobalUIModel(),d=this.getView().getBindingContext(),u=d&&this.getProgrammingModel(d)===Pt.Draft;if(a&&i.isLocked(l)){return Promise.reject("Application already busy therefore execution rejected")}if(s){i.lock(l)}if(c&&u){this.setDraftStatus(St.Saving)}this.getMessageHandler().removeTransitionMessages();return this.syncTask(e).then(()=>{if(c){this.setDocumentModified(true);if(!this._isFclEnabled()){g.setEditStateDirty()}if(u){this.setDraftStatus(St.Saved)}}}).catch(t=>{if(c&&u){this.setDraftStatus(St.Clear)}return Promise.reject(t)}).finally(()=>{if(s){i.unlock(l)}this.getMessageHandler().showMessageDialog()})};l.handlePatchSent=function t(e){var i,o;const r=n.isConnected(this.getView());if(r){e.getSource().getModel().setIgnoreETag(true)}if(!((i=this.getView())!==null&&i!==void 0&&(o=i.getBindingContext("internal"))!==null&&o!==void 0&&o.getProperty("skipPatchHandlers"))){const t=e.getSource();const i=new Promise((i,n)=>{e.getSource().attachEventOnce("patchCompleted",o=>{if(r){e.getSource().getModel().setIgnoreETag(false)}if(e.getSource().isA("sap.ui.model.odata.v4.ODataListBinding")){var s;x.setActionEnablementAfterPatch(this.getView(),t,(s=this.getView())===null||s===void 0?void 0:s.getBindingContext("internal"))}const a=o.getParameter("success");if(a){i()}else{n()}})});this.updateDocument(t,i)}};l.handleCreateActivate=async function e(i){const n=i.getSource();const o=this.getTransactionHelper();const r=true;const s=true;const a={creationMode:Mt.Inline,createAtEnd:r,inactive:s,keepTransientContextOnFailed:false,busyMode:"None"};try{var c;const e=i.getParameter("context");(c=e.created())===null||c===void 0?void 0:c.then(()=>{this._sendActivity(vt.Create,e)}).catch(()=>{t.warning(`Failed to activate context ${e.getPath()}`)});const r=await o.createDocument(n,a,this.getAppComponent(),this.getMessageHandler(),false);if(r){if(!this._isFclEnabled()){g.setEditStateDirty()}}}catch(e){t.error("Failed to activate new row -",e)}};l.syncTask=function t(e){if(e){if(typeof e==="function"){this.syncTasks=this.syncTasks.then(e).catch(function(){return Promise.resolve()})}else{this.syncTasks=this.syncTasks.then(()=>e).catch(function(){return Promise.resolve()})}}return this.syncTasks};l.computeEditMode=async function e(i){const n=this.getProgrammingModel(i);if(n===Pt.Draft){try{this.setDraftStatus(St.Clear);const t=this.getGlobalUIModel();t.setProperty("/isEditablePending",true,undefined,true);const e=await i.requestObject("IsActiveEntity");if(e===false){this.setEditMode(Dt.Editable);const t=await i.requestObject("HasActiveEntity");this.setEditMode(undefined,!t)}else{this.setEditMode(Dt.Display,false)}t.setProperty("/isEditablePending",false,undefined,true)}catch(e){t.error("Error while determining the editMode for draft",e);throw e}}else if(n===Pt.Sticky){const t=this.getInternalModel().getProperty("/lastInvokedAction");if(t&&this.isNewActionForSticky(t,i)){this.setEditMode(Dt.Editable,true);if(!this.getAppComponent()._isFclEnabled()){g.setEditStateDirty()}this.handleStickyOn(i);this.getInternalModel().setProperty("/lastInvokedAction",undefined)}}};l.deleteDocumentTransaction=async function t(e,i){var n;const o=rt(this);const r=this.getTransactionHelper();i.internalModelContext=i.controlId?(n=sap.ui.getCore().byId(i.controlId))===null||n===void 0?void 0:n.getBindingContext("internal"):null;await this.syncTask();await r.deleteDocument(e,i,this.getAppComponent(),o,this.getMessageHandler())};l._getResourceModel=function t(){return rt(this.getView())};l.getTransactionHelper=function t(){return a};l.getMessageHandler=function t(){if(this.base.messageHandler){return this.base.messageHandler}else{throw new Error("Edit Flow works only with a given message handler")}};l.getInternalModel=function t(){return this.getView().getModel("internal")};l.getGlobalUIModel=function t(){return this.getView().getModel("ui")};l.setCreationMode=function t(e){const i=this.getView().getBindingContext("ui");this.getGlobalUIModel().setProperty("createMode",e,i,true)};l.getCreationMode=function t(){const e=this.getView().getBindingContext("ui");return!!this.getGlobalUIModel().getProperty("createMode",e)};l.isDocumentModified=function t(){return!!this.getGlobalUIModel().getProperty("/isDocumentModified")};l.setDocumentModified=function t(e){this.getGlobalUIModel().setProperty("/isDocumentModified",e)};l.setDocumentModifiedOnCreate=function t(e){if(e.isRelative()){this.setDocumentModified(true)}};l.handleCreateEvents=function t(e){this.setDraftStatus(St.Clear);const i=this.getProgrammingModel(e);e.attachEvent("createSent",()=>{if(i===Pt.Draft){this.setDraftStatus(St.Saving)}});e.attachEvent("createCompleted",t=>{const e=t.getParameter("success");if(i===Pt.Draft){this.setDraftStatus(e?St.Saved:St.Clear)}this.getMessageHandler().showMessageDialog()})};l.setDraftStatus=function t(e){this.getView().getModel("ui").setProperty("/draftStatus",e,undefined,true)};l.getProgrammingModel=function t(e){return this.getTransactionHelper().getProgrammingModel(e)};l.setEditMode=function t(e,i){const n=this.getGlobalUIModel();if(e){n.setProperty("/isEditable",e==="Editable",undefined,true)}if(i!==undefined){this.setCreationMode(i)}};l.isNewActionForSticky=function e(i,n){try{var o;const t=n.getModel().getMetaModel();const e=t.getMetaContext(n.getPath());const r=gt(e).startingEntitySet;const s=(o=r.annotations.Session)===null||o===void 0?void 0:o.StickySessionSupported;if((s===null||s===void 0?void 0:s.NewAction)===i){return true}if(s!==null&&s!==void 0&&s.AdditionalNewActions&&(s===null||s===void 0?void 0:s.AdditionalNewActions.indexOf(i))!==-1){return true}return false}catch(e){t.info(e);return false}};l.handleStickyOn=function e(i){const n=this.getAppComponent();try{if(n===undefined){throw new Error("undefined AppComponent for function handleStickyOn")}if(!n.getRouterProxy().hasNavigationGuard()){const t=n.getRouterProxy().getHash();const e=this.getInternalModel();setTimeout(function(){n.getRouterProxy().setNavigationGuard(i.getPath().substring(1))},0);n.getShellServices().setBackNavigation(this.onBackNavigationInSession.bind(this));this.dirtyStateProviderFunction=this.getDirtyStateProvider(n,e,t);n.getShellServices().registerDirtyStateProvider(this.dirtyStateProviderFunction);const o=this.getView().getModel("sap.fe.i18n");this.sessionTimeoutFunction=this.getSessionTimeoutFunction(i,o);this.getView().getModel().attachSessionTimeout(this.sessionTimeoutFunction);this.stickyDiscardAfterNavigationFunction=this.getRouteMatchedFunction(i,n);n.getRoutingService().attachRouteMatched(this.stickyDiscardAfterNavigationFunction)}}catch(e){t.info(e);return false}return true};l.handleStickyOff=function e(){const i=this.getAppComponent();try{if(i===undefined){throw new Error("undefined AppComponent for function handleStickyOff")}if(i.getRouterProxy){i.getRouterProxy().discardNavigationGuard()}if(this.dirtyStateProviderFunction){i.getShellServices().deregisterDirtyStateProvider(this.dirtyStateProviderFunction);this.dirtyStateProviderFunction=undefined}const t=this.getView().getModel();if(t&&this.sessionTimeoutFunction){t.detachSessionTimeout(this.sessionTimeoutFunction)}i.getRoutingService().detachRouteMatched(this.stickyDiscardAfterNavigationFunction);this.stickyDiscardAfterNavigationFunction=undefined;this.setEditMode(Dt.Display,false);if(i.getShellServices){i.getShellServices().setBackNavigation()}}catch(e){t.info(e);return false}return true};l._setStickySessionInternalProperties=function t(e,i){if(e===Pt.Sticky){const t=this.getInternalModel();t.setProperty("/sessionOn",true);t.setProperty("/stickySessionToken",i.getHttpHeaders(true)["SAP-ContextId"])}};l.getDirtyStateProvider=function e(i,n,o){return e=>{try{if(e===undefined){throw new Error("Invalid input parameters for DirtyStateProvider function")}const t=e.innerAppRoute;const r=i.getRouterProxy();let s="";let a;const c=n.getProperty("/sessionOn");if(!c){return undefined}if(!r.isNavigationFinalized()){a=false;s=t}else if(o===t){a=true}else if(r.checkHashWithGuard(t)||r.isGuardCrossAllowedByUser()){s=t;a=false}else{a=true}if(a){setTimeout(function(){i.getShellServices().setDirtyFlag(false)},0)}else{o=s}return a}catch(e){t.info(e);return undefined}}};l.getSessionTimeoutFunction=function e(i,n){return()=>{try{if(i===undefined){throw new Error("Context missing for SessionTimeout function")}this.getMessageHandler().removeTransitionMessages();const t=new m({title:"{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_TITLE}",state:"Warning",content:new C({text:"{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_MESSAGE}"}),beginButton:new v({text:"{sap.fe.i18n>C_COMMON_DIALOG_OK}",type:"Emphasized",press:()=>{this.handleStickyOff();this.getInternalRouting().navigateBackFromContext(i)}}),afterClose:function(){t.destroy()}});t.addStyleClass("sapUiContentPadding");t.setModel(n,"sap.fe.i18n");this.getView().addDependent(t);t.open()}catch(e){t.info(e);return undefined}return true}};l.getRouteMatchedFunction=function t(e,i){return()=>{const t=i.getRouterProxy().getHash();if(!t||!i.getRouterProxy().checkHashWithGuard(t)){this.discardStickySession(e);setTimeout(()=>{e.getModel().clearSessionContext()},0)}}};l.discardStickySession=async function t(e){const i=await s.discardDocument(e);if(i!==null&&i!==void 0&&i.hasPendingChanges()){i.getBinding().resetChanges()}i===null||i===void 0?void 0:i.refresh();this.handleStickyOff()};l.getInternalRouting=function t(){if(this.base._routing){return this.base._routing}else{throw new Error("Edit Flow works only with a given routing listener")}};l._getRootViewController=function t(){return this.getAppComponent().getRootViewController()};l._getSemanticMapping=function t(){return this.getAppComponent().getRoutingService().getLastSemanticMapping()};l.createActionPromise=function t(e,i){let n,o;this.actionPromise=new Promise((t,e)=>{n=t;o=e}).then(t=>Object.assign({controlId:i},this.getActionResponseDataAndKeys(e,t)));return{fResolver:n,fRejector:o}};l.getActionResponseDataAndKeys=function t(e,i){if(Array.isArray(i)){if(i.length===1){i=i[0].value}else{return null}}if(!i){return null}const n=this.getView();const o=n.getModel().getMetaModel().getData();const r=o&&o[e]&&o[e][0]&&o[e][0].$ReturnType?o[e][0].$ReturnType.$Type:null;const s=r&&o[r]?o[r].$Key:null;return{oData:i.getObject(),keys:s}};l.getCurrentActionPromise=function t(){return this.actionPromise};l.deleteCurrentActionPromise=function t(){this.actionPromise=undefined};l._scrollAndFocusOnInactiveRow=function t(e){const i=e.getRowBinding();const n=i.getCount()||0;if(e.data("tableType")!=="ResponsiveTable"){if(n>0){e.scrollToIndex(n-1)}e.focusRow(n,true)}else{const t=i.getContexts();if(!(t!==null&&t!==void 0&&t.length)){e.focusRow(n,true);return}let o=n,r=0;for(const e of t){if(e.isInactive()&&r<o){o=r}r++}if(o>0){e.scrollToIndex(o)}e.focusRow(o,true)}};l.createEmptyRowsAndFocus=async function t(e){var i,n,o;const r=e.getParent();if(r!==null&&r!==void 0&&(i=r.tableDefinition)!==null&&i!==void 0&&(n=i.control)!==null&&n!==void 0&&n.inlineCreationRowsHiddenInEditMode&&!((o=e.getBindingContext("ui"))!==null&&o!==void 0&&o.getProperty("createMode"))){await r.setUpEmptyRows(e,true)}this._scrollAndFocusOnInactiveRow(e)};l._sendActivity=function t(e,i,o,r,s){const a=Array.isArray(i)?i.map(t=>t.getPath()):i===null||i===void 0?void 0:i.getPath();n.send(this.getView(),e,a,o,r,s)};l._triggerConfiguredSurvey=function t(e,i){ft(this.getView(),e,i)};l._submitOpenChanges=async function t(e){const n=e.getModel(),o=this.getGlobalUIModel();try{await n.submitBatch("$auto");await n.oRequestor.waitForRunningChangeRequests("$auto");if(n.hasPendingChanges("$auto")){throw new Error("submit of open changes failed")}}finally{if(i.isLocked(o)){i.unlock(o)}}};l._removeStickySessionInternalProperties=function t(e){if(e===Pt.Sticky){const t=this.getInternalModel();t.setProperty("/sessionOn",false);t.setProperty("/stickySessionToken",undefined);this.handleStickyOff()}};l.onBackNavigationInSession=function t(){const e=this.getView();const i=this.getAppComponent().getRouterProxy();if(i.checkIfBackIsOutOfGuard()){const t=e.getBindingContext();const i=this.getProgrammingModel(t);s.processDataLossConfirmation(async()=>{await this.discardStickySession(t);this._removeStickySessionInternalProperties(i);history.back()},e,i);return}history.back()};l._handleNewContext=async function t(e,i,n,o){let r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;if(!this._isFclEnabled()){g.setEditStateDirty()}await this.getInternalRouting().navigateToContext(e,{checkNoHashChange:true,editable:i,bPersistOPScroll:true,bRecreateContext:n,bDraftNavigation:o,showPlaceholder:false,bForceFocus:r,keepCurrentLayout:true})};l._getBoundContext=function t(e,i){const n=e.getViewData().viewLevel;const o=n>1||n===1&&i.controlId;return!i.isNavigable||!!o};l._checkForValidationErrors=function t(){return this.syncTask().then(()=>{const t=this.getView().getId();const e=sap.ui.getCore().getMessageManager().getMessageModel().getData();let i;let n;if(!e.length){return Promise.resolve("No validation errors found")}for(let o=0;o<e.length;o++){n=e[o];if(n.validation){i=M.byId(n.getControlId());while(i){if(i.getId()===t){return Promise.reject("validation errors exist")}i=i.getParent()}}}})};l._refreshListIfRequired=function e(i,n){if(!n||!i||!i.oData){return Promise.resolve(undefined)}const o=n.getBinding();if(o&&o.isA("sap.ui.model.odata.v4.ODataListBinding")){const e=i.oData;const r=i.keys;const s=n.getObject();let a=true;if(Object.keys(e).length){a=r.every(function(t){return s[t]===e[t]});if(!a){return new Promise(e=>{if(o.isRoot()){o.attachEventOnce("dataReceived",function(){e(!a)});o.refresh()}else{const i=this.getAppComponent();i.getSideEffectsService().requestSideEffects([{$NavigationPropertyPath:o.getPath()}],o.getContext()).then(function(){e(!a)},function(){t.error("Error while refreshing the table");e(!a)}).catch(function(e){t.error("Error while refreshing the table",e)})}})}}}return Promise.resolve(undefined)};l._fetchSemanticKeyValues=function t(e){const i=e.getModel().getMetaModel(),n=i.getMetaContext(e.getPath()).getObject("@sapui.name"),o=p.getSemanticKeys(i,n);if(o&&o.length){const t=o.map(function(t){return e.requestObject(t.$PropertyPath)});return Promise.all(t)}else{return Promise.resolve()}};l._getActionOverloadContextFromMetadataPath=function t(e,i,n){const o=e.getModel();const r=o.getMetaModel();let s=i.getPath().split("/");let a=e;s.pop();if(s.length===0){s=[""]}if(s[0]!==""){s.unshift("")}const c=s.map(t=>{if(t!==""){a=o.bindContext(t,a).getBoundContext()}else{a=e}return a}).reverse();const l=c.find(t=>r.getMetaContext(t.getPath()).getObject("$Type")===n);return l||i.getHeaderContext()};l._createSiblingInfo=function t(e,i){return{targetContext:i,pathMapping:[{oldPath:e.getPath(),newPath:i.getPath()}]}};l._updatePathsInHistory=function t(e){const i=this.getAppComponent();i.getRouterProxy().setPathMapping(e);const n=this._getSemanticMapping();if(e.length&&(n===null||n===void 0?void 0:n.technicalPath)===e[e.length-1].oldPath){n.technicalPath=e[e.length-1].newPath}};l._getNavigationTargetForEdit=function t(e,i,n){let o;n=n??this._createSiblingInfo(e,i);this._updatePathsInHistory(n.pathMapping);if(n.targetContext.getPath()!=i.getPath()){o=n.targetContext}return o};l._computeSiblingInformation=async function e(i,n,o,s){n=n??i;if(!n.getPath().startsWith(i.getPath())){t.error("Cannot compute rightmost sibling context");throw new Error("Cannot compute rightmost sibling context")}if(s&&n.getPath()===i.getPath()){return Promise.resolve(undefined)}const a=i.getModel();if(o===Pt.Draft){return r.computeSiblingInformation(i,n)}else{return{targetContext:a.bindContext(n.getPath()).getBoundContext(),pathMapping:[]}}};l._isFclEnabled=function t(){return this.getAppComponent()._isFclEnabled()};return c}(S),Ct(ot.prototype,"editDocument",[k,_],Object.getOwnPropertyDescriptor(ot.prototype,"editDocument"),ot.prototype),Ct(ot.prototype,"updateDocument",[I,O],Object.getOwnPropertyDescriptor(ot.prototype,"updateDocument"),ot.prototype),Ct(ot.prototype,"createDocument",[R,T],Object.getOwnPropertyDescriptor(ot.prototype,"createDocument"),ot.prototype),Ct(ot.prototype,"onBeforeSave",[F,B],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeSave"),ot.prototype),Ct(ot.prototype,"onBeforeCreate",[V,H],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeCreate"),ot.prototype),Ct(ot.prototype,"onBeforeEdit",[N,j],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeEdit"),ot.prototype),Ct(ot.prototype,"onBeforeDiscard",[L,$],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeDiscard"),ot.prototype),Ct(ot.prototype,"onBeforeDelete",[G,U],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeDelete"),ot.prototype),Ct(ot.prototype,"saveDocument",[q,K],Object.getOwnPropertyDescriptor(ot.prototype,"saveDocument"),ot.prototype),Ct(ot.prototype,"cancelDocument",[W,z],Object.getOwnPropertyDescriptor(ot.prototype,"cancelDocument"),ot.prototype),Ct(ot.prototype,"deleteDocument",[J,X],Object.getOwnPropertyDescriptor(ot.prototype,"deleteDocument"),ot.prototype),Ct(ot.prototype,"applyDocument",[Q,Y],Object.getOwnPropertyDescriptor(ot.prototype,"applyDocument"),ot.prototype),Ct(ot.prototype,"invokeAction",[Z,tt],Object.getOwnPropertyDescriptor(ot.prototype,"invokeAction"),ot.prototype),Ct(ot.prototype,"securedExecution",[et,it],Object.getOwnPropertyDescriptor(ot.prototype,"securedExecution"),ot.prototype),ot))||nt);return At},false);
|
|
130
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/EditFlow", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/controllerextensions/collaboration/CollaborationCommon","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/editFlow/sticky","sap/fe/core/controllerextensions/editFlow/TransactionHelper","sap/fe/core/controllerextensions/Feedback","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/MetaModelFunction","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageToast","sap/m/Text","sap/ui/core/Core","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/model/odata/v4/ODataListBinding","../ActionRuntime"],function(t,e,i,n,o,r,s,a,c,l,d,g,u,h,f,p,y,v,w,m,C,M,P,b,S,D,E,x){"use strict";var A,k,_,I,O,R,F,T,B,V,H,N,j,L,$,G,U,q,K,W,z,J,X,Q,Y,Z,tt,et,it,nt,ot,rt,st;var at=f.getResourceModel;var ct=u.getNonComputedVisibleFields;var lt=d.publicExtension;var dt=d.finalExtension;var gt=d.extensible;var ut=d.defineUI5Class;var ht=l.getInvolvedDataModelObjects;var ft=l.convertTypes;var pt=c.TriggerType;var yt=c.triggerConfiguredSurvey;var vt=c.StandardActions;var wt=o.shareObject;var mt=o.Activity;function Ct(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;Mt(t,e)}function Mt(t,e){Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,i){e.__proto__=i;return e};return Mt(t,e)}function Pt(t,e,i,n,o){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=i.slice().reverse().reduce(function(i,n){return n(t,e,i)||i},r);if(o&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(o):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}const bt=y.CreationMode,St=y.ProgrammingModel,Dt=y.Constants,Et=y.DraftStatus,xt=y.EditMode,At=y.StartupMode,kt=P.MessageType;let _t=(A=ut("sap.fe.core.controllerextensions.EditFlow"),k=lt(),_=dt(),I=lt(),O=dt(),R=lt(),F=dt(),T=lt(),B=gt(D.After),V=lt(),H=gt(D.After),N=lt(),j=gt(D.After),L=lt(),$=gt(D.After),G=lt(),U=gt(D.After),q=lt(),K=dt(),W=lt(),z=dt(),J=lt(),X=dt(),Q=lt(),Y=dt(),Z=lt(),tt=dt(),et=lt(),it=gt(D.After),nt=lt(),ot=dt(),A(rt=(st=function(o){Ct(c,o);function c(){var t;for(var e=arguments.length,i=new Array(e),n=0;n<e;n++){i[n]=arguments[n]}t=o.call(this,...i)||this;t.syncTasks=Promise.resolve();return t}var l=c.prototype;l.getAppComponent=function t(){return this.base.getAppComponent()};l.editDocument=async function i(n){const o=true;const r=this.getTransactionHelper();const s=this._getRootViewController();const a=n.getModel();let c,l;const d=this.getView().getViewData();const g=this.getProgrammingModel(n);let u=n;const f=this.base.getView();try{if((d===null||d===void 0?void 0:d.viewLevel)>1){if(g===St.Draft||g===St.Sticky){u=await e.createRootContext(g,f,this.getAppComponent())}}await this.base.editFlow.onBeforeEdit({context:u});const t=await r.editDocument(u,this.getView(),this.getAppComponent(),this.getMessageHandler());this._setStickySessionInternalProperties(g,a);if(t){this.setEditMode(xt.Editable,false);this.setDocumentModified(false);this.getMessageHandler().showMessageDialog();if(t!==u){let e=t;if(this._isFclEnabled()){c=s.getRightmostContext();l=await this._computeSiblingInformation(u,c,g,true);l=l??this._createSiblingInfo(n,t);this._updatePathsInHistory(l.pathMapping);if(l.targetContext.getPath()!=t.getPath()){e=l.targetContext}}else if((d===null||d===void 0?void 0:d.viewLevel)>1){const i=t===null||t===void 0?void 0:t.getPath();const o={rootSiblingPath:i,rootContextNotRequired:true};l=await this._computeSiblingInformation(u,n,g,true,o);e=this._getNavigationTargetForEdit(n,t,l)}await this._handleNewContext(e,true,false,o,true);if(g===St.Sticky){let e;if(this._isFclEnabled()){e=t.getModel().getKeepAliveContext(t.getPath())}else{e=t}this.handleStickyOn(e)}else if(h.isCollaborationDraftSupported(a.getMetaModel())){await wt(t)}}}}catch(e){t.error("Error while editing the document",e)}};l.deleteMultipleDocuments=async function o(r,s){if(s){s.beforeDeleteCallBack=this.base.editFlow.onBeforeDelete;s.requestSideEffects=s.requestSideEffects!==false}else{s={beforeDeleteCallBack:this.base.editFlow.onBeforeDelete,requestSideEffects:true}}const a=this.getGlobalUIModel();const c=this.getView().byId(s.controlId);if(!c){throw new Error("parameter controlId missing or incorrect")}else{s.parentControl=c}const l=c.getBinding("items")||c.getRowBinding();s.bFindActiveContexts=true;i.lock(a);try{await this.deleteDocumentTransaction(r,s);let t;if(c.isA("sap.ui.mdc.Table")){c.clearSelection()}const i=this.getView().getBindingContext();if(l.isRoot()){t=new Promise(t=>{l.attachEventOnce("dataReceived",function(){t()})});l.refresh()}else if(i){if(s.requestSideEffects&&!e.hasTransientContext(l)){this.getAppComponent().getSideEffectsService().requestSideEffectsForNavigationProperty(l.getPath(),i)}}if(!this.getAppComponent()._isFclEnabled()){g.setEditStateDirty()}n.send(this.getView(),mt.Delete,r.map(t=>t.getPath()));return t}catch(e){t.error("Error while deleting the document(s)",e)}finally{i.unlock(a)}};l.updateDocument=function e(i,n){const o=this.getView().getBindingContext();const r=this.getProgrammingModel(i)===St.Draft;this.getMessageHandler().removeTransitionMessages();return this.syncTask(async()=>{if(o){this.setDocumentModified(true);if(!this._isFclEnabled()){g.setEditStateDirty()}if(r){this.setDraftStatus(Et.Saving)}}try{await n;const t=this.getView().getBindingContext();if(!r||!t||t!==o){return}const e=t.getModel().getMetaModel();const i=e.getMetaContext(t.getPath()).getObject("@sapui.name");const s=p.getSemanticKeys(e,i);if(s!==null&&s!==void 0&&s.length){const e=this._getSemanticMapping();const i=e===null||e===void 0?void 0:e.semanticPath,n=p.getSemanticPath(t,true);if(i&&i!==n){await this._handleNewContext(t,true,false,true)}}this.setDraftStatus(Et.Saved)}catch(e){t.error("Error while updating the document",e);if(r&&o){this.setDraftStatus(Et.Clear)}}finally{await this.getMessageHandler().showMessages()}})};l.createDocument=async function o(r,s){var a;const c=this.getTransactionHelper(),l=this.getGlobalUIModel();let d;let u=s;let f;const p=!u||u.creationMode!==bt.Inline&&u.creationMode!==bt.CreationRow&&u.creationMode!==bt.External;let y=Promise.resolve([]);const v=this.getAppComponent();v.getRouterProxy().removeIAppStateKey();if(u.creationMode===bt.External){await this.syncTask();const t=this.getView().getController();const e=h.getAbsoluteMetaPathForListBinding(this.base.getView(),r);t.handlers.onChevronPressNavigateOutBound(t,u.outbound,undefined,e);return}if(u.creationMode===bt.CreationRow&&u.creationRow){const t=u.creationRow.getBindingContext().getObject();delete t["@$ui5.context.isTransient"];d=u.creationRow.getParent();y=this.validateDocument(d.getBindingContext(),{data:t,customValidationFunction:d.getCreationRow().data("customValidationFunction")});if(d.getCreationRow().data("disableAddRowButtonForEmptyData")==="true"){const t=d.getBindingContext("internal");t.setProperty("creationRowFieldValidity",{})}}if(u.creationMode===bt.Inline&&u.tableId){d=this.getView().byId(u.tableId)}if(d&&d.isA("sap.ui.mdc.Table")){const t=u.creationMode===bt.Inline?d.focusRow.bind(d):d.scrollToIndex.bind(d);d.getRowBinding().attachEventOnce("change",async function(){await f;t(u.createAtEnd?d.getRowBinding().getLength():0,true)})}const w=async(i,n)=>{try{const t=await n;await t.created();const o=this.getView().getBindingContext();if(!e.hasTransientContext(i)){const t=this.getAppComponent();t.getSideEffectsService().requestSideEffectsForNavigationProperty(i.getPath(),o)}}catch(e){t.error("Error while creating the document",e)}};const m=t=>{var e;const i=d&&d.getCreationRow().data("customValidationFunction");const n=d&&((e=d.getBindingContext("internal"))===null||e===void 0?void 0:e.getProperty("creationRowCustomValidity"));const o=M.getMessageManager();const r=[];let s;let a;o.getMessageModel().getData().forEach(function(t){if(t.code===i){o.removeMessages(t)}});t.forEach(t=>{if(t.messageTarget){var e;s=M.getControl(n[t.messageTarget].fieldId);a=`${(e=s.getBindingContext())===null||e===void 0?void 0:e.getPath()}/${s.getBindingPath("value")}`;if(o.getMessageModel().getData().filter(function(t){return t.target===a}).length===0){o.addMessages(new b({message:t.messageText,processor:this.getView().getModel(),type:kt.Error,code:i,technical:false,persistent:false,target:a}))}const r=o.getMessageModel().getData().filter(function(t){return t.target===a});r[0].addControlId(n[t.messageTarget].fieldId)}else{r.push({code:i,text:t.messageText,persistent:true,type:kt.Error})}});if(r.length>0){this.getMessageHandler().showMessageDialog({customMessages:r})}};const C=(t,e,i,n)=>{if(t&&t!==bt.NewPage){return t}else{if(!i.isRelative()){const t=i.getPath(),o=e===St.Draft?n.getObject(`${t}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`):n.getObject(`${t}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`);if(o){const t=n.getObject(`/${o}/@$ui5.overload/0/$Parameter`)||[];if(t.length>1){return bt.Deferred}}}const t=n.getMetaPath(i===null||i===void 0?void 0:i.getHeaderContext().getPath());const o=ct(n,t,this.getAppComponent());if(o.length>0){return bt.Deferred}return bt.Async}};if(p){i.lock(l)}try{const e=await this.syncTask(y);if(e.length>0){m(e);t.error("Custom Validation failed");return}let o;u=u||{};if(r&&typeof r==="object"){o=r}else if(typeof r==="string"){o=new E(this.getView().getModel(),r);u.creationMode=bt.Sync;delete u.createAtEnd}else{throw new Error("Binding object or path expected")}const s=o.getModel();const l=this.getProgrammingModel(o);const p=C(u.creationMode,l,o,s.getMetaModel());let b;const k=u.creationRow;let _;let I;let O;const R=s.getMetaModel();const F=this.getInternalRouting();if(p!==bt.Deferred){if(p===bt.CreationRow){_=k.getBindingContext();O=R.getMetaPath(_.getPath());I=_.getObject();u.data={};Object.keys(I).forEach(function(t){const e=R.getObject(`${O}/${t}`);if(e&&e.$kind==="NavigationProperty"){return}u.data[t]=I[t]});await this._checkForValidationErrors()}if(p===bt.CreationRow||p===bt.Inline){var P,S,D;u.keepTransientContextOnFailed=false;u.busyMode="Local";u.busyId=(P=d)===null||P===void 0?void 0:(S=P.getParent())===null||S===void 0?void 0:(D=S.getTableDefinition())===null||D===void 0?void 0:D.annotation.id;this.handleCreateEvents(o)}if(!u.parentControl){u.parentControl=this.getView()}u.beforeCreateCallBack=this.onBeforeCreate;u.skipParameterDialog=v.getStartupMode()===At.AutoCreate;f=c.createDocument(o,u,this.getAppComponent(),this.getMessageHandler(),false);if(!u.bSkipSideEffects){w(o,f)}}let T;switch(p){case bt.Deferred:T=F.navigateForwardToContext(o,{bDeferredContext:true,editable:true,bForceFocus:true});break;case bt.Async:T=F.navigateForwardToContext(o,{asyncContext:f,editable:true,bForceFocus:true});break;case bt.Sync:b={editable:true,bForceFocus:true};if(l==St.Sticky||u.createAction){b.transient=true}T=(a=f)===null||a===void 0?void 0:a.then(function(t){if(!t){const t=M.getLibraryResourceBundle("sap.fe.core");return F.navigateToMessagePage(t.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),{title:t.getText("C_COMMON_SAPFE_ERROR"),description:t.getText("C_EDITFLOW_SAPFE_CREATION_FAILED_DESCRIPTION")})}else{return u.bFromDeferred?F.navigateToContext(t,b):F.navigateForwardToContext(t,b)}});break;case bt.Inline:this.syncTask(f);break;case bt.CreationRow:try{const e=_.getBinding();const i=e.create();k.setBindingContext(i);i.created().catch(function(){t.trace("transient fast creation context deleted")});T=_.delete("$direct")}catch(e){if(i.isLocked(this.getView().getModel("ui"))){i.unlock(this.getView().getModel("ui"))}t.error("CreationRow navigation error: ",e)}break;default:T=Promise.reject(`Unhandled creationMode ${p}`);break}if(f){try{const t=await Promise.all([f,T]);this._setStickySessionInternalProperties(l,s);this.setEditMode(xt.Editable);if(!o.isRelative()&&l===St.Sticky){var x,A;const t=o.getModel().getMetaModel();const e=t.bindContext(t.getMetaPath(o.getPath()));const i=ht(e).startingEntitySet;const n=i===null||i===void 0?void 0:(x=i.annotations.Session)===null||x===void 0?void 0:(A=x.StickySessionSupported)===null||A===void 0?void 0:A.NewAction;this.getInternalModel().setProperty("/lastInvokedAction",n)}const e=t[0];if(e){this.setDocumentModifiedOnCreate(o);if(!this._isFclEnabled()){g.setEditStateDirty()}this._sendActivity(mt.Create,e);if(h.isCollaborationDraftSupported(s.getMetaModel())&&!n.isConnected(this.getView())){await wt(e)}}}catch(t){if(t===Dt.CancelActionDialog||t===Dt.ActionExecutionFailed||t===Dt.CreationFailed){if(p===bt.Sync||p===bt.Deferred||p===bt.Async){F.navigateBackFromTransientState()}}throw t}}}finally{if(p){i.unlock(l)}}};l.validateDocument=function t(e,i){return this.getTransactionHelper().validateDocument(e,i,this.getView())};l.createMultipleDocuments=async function n(o,r,s,a,c){let l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;let d=arguments.length>6?arguments[6]:undefined;const g=this.getTransactionHelper();const u=this.getGlobalUIModel();const h=o;d=d!==false;i.lock(u);try{await this.syncTask();if(c){await c({contextPath:h.getPath()})}const t=h.getModel().getMetaModel();let i;if(h.getContext()){i=t.getMetaPath(`${h.getContext().getPath()}/${h.getPath()}`)}else{i=t.getMetaPath(h.getPath())}this.handleCreateEvents(h);const n=r.map(e=>{const n={data:{}};n.keepTransientContextOnFailed=false;n.busyMode="None";n.creationMode=bt.CreationRow;n.parentControl=this.getView();n.createAtEnd=s;n.inactive=l;for(const o in e){const r=t.getObject(`${i}/${o}`);if(r&&r.$kind!=="NavigationProperty"&&o.indexOf("/")<0&&e[o]){n.data[o]=e[o]}}return g.createDocument(h,n,this.getAppComponent(),this.getMessageHandler(),a)});const o=await Promise.all(n);if(!l){this.setDocumentModifiedOnCreate(h)}await Promise.all(o.map(t=>{if(!t.bInactive){return t.created()}}));const u=this.getView().getBindingContext();if(d&&!e.hasTransientContext(h)){this.getAppComponent().getSideEffectsService().requestSideEffectsForNavigationProperty(h.getPath(),u)}return o}catch(e){t.error("Error while creating multiple documents.");throw e}finally{i.unlock(u)}};l.onBeforeSave=function t(e){return Promise.resolve()};l.onBeforeCreate=function t(e){return Promise.resolve()};l.onBeforeEdit=function t(e){return Promise.resolve()};l.onBeforeDiscard=function t(e){return Promise.resolve()};l.onBeforeDelete=function t(e){return Promise.resolve()};l.saveDocument=async function e(i,o){o=o||{};const r=o.bExecuteSideEffectsOnError||undefined;const s=true;const a=this.getTransactionHelper();const c=o.bindings;try{await this.syncTask();this.getMessageHandler().removeTransitionMessages();await this._submitOpenChanges(i);await this._checkForValidationErrors();await this.base.editFlow.onBeforeSave({context:i});const t=this.getProgrammingModel(i);const e=this._getRootViewController();let o;if((t===St.Sticky||i.getProperty("HasActiveEntity"))&&e.isFclEnabled()){o=await this._computeSiblingInformation(i,e.getRightmostContext(),t,true)}const l=await a.saveDocument(i,this.getAppComponent(),this._getResourceModel(),r,c,this.getMessageHandler(),this.getCreationMode());this._removeStickySessionInternalProperties(t);this._sendActivity(mt.Activate,l);n.disconnect(this.getView());this._triggerConfiguredSurvey(vt.save,pt.standardAction);this.setDocumentModified(false);this.setEditMode(xt.Display,false);this.getMessageHandler().showMessageDialog();if(l!==i){let t=l;if(e.isFclEnabled()){o=o??this._createSiblingInfo(i,l);this._updatePathsInHistory(o.pathMapping);if(o.targetContext.getPath()!==l.getPath()){t=o.targetContext}}await this._handleNewContext(t,false,false,s,true)}}catch(e){if(!(e&&e.canceled)){t.error("Error while saving the document",e)}throw e}};l.toggleDraftActive=async function t(e){const i=e.getObject();let n;const o=e&&this.getProgrammingModel(e)===St.Draft;if(!o||!(!i.IsActiveEntity&&i.HasActiveEntity||i.IsActiveEntity&&i.HasDraftEntity)){return}if(!i.IsActiveEntity&&i.HasActiveEntity){n=false}else{n=true}try{const t=this._getRootViewController();const i=t.isFclEnabled()?t.getRightmostContext():e;let o=await this._computeSiblingInformation(e,i,St.Draft,false);if(!o&&e!==i){o=await this._computeSiblingInformation(e,e,St.Draft,false)}if(o){this.setEditMode(n?xt.Editable:xt.Display,false);if(t.isFclEnabled()){const t=this._getSemanticMapping();if((t===null||t===void 0?void 0:t.technicalPath)===e.getPath()){const e=o.pathMapping[o.pathMapping.length-1].newPath;o.pathMapping.push({oldPath:t.semanticPath,newPath:e})}this._updatePathsInHistory(o.pathMapping)}await this._handleNewContext(o.targetContext,n,true,true,true)}else{throw new Error("Error in EditFlow.toggleDraftActive - Cannot find sibling")}}catch(t){throw new Error(`Error in EditFlow.toggleDraftActive:${t}`)}};l.cancelDocument=async function e(i,o){const r=this.getTransactionHelper();const s=o;let a;let c=false;s.cancelButton=o.control||s.cancelButton;s.beforeCancelCallBack=this.base.editFlow.onBeforeDiscard;try{await this.syncTask();const t=this.getProgrammingModel(i);if((t===St.Sticky||i.getProperty("HasActiveEntity"))&&this._isFclEnabled()){const e=this._getRootViewController();a=await this._computeSiblingInformation(i,e.getRightmostContext(),t,true)}const e=await r.cancelDocument(i,s,this.getAppComponent(),this._getResourceModel(),this.getMessageHandler(),this.getCreationMode(),this.isDocumentModified());this._getRootViewController().getInstancedViews().forEach(t=>{const e=t.getBindingContext();if(e&&e.isKeepAlive()){e.setKeepAlive(false)}});const o=true;this._removeStickySessionInternalProperties(t);this.setEditMode(xt.Display,false);this.setDocumentModified(false);this.setDraftStatus(Et.Clear);g.setEditStateDirty();if(!e){this._sendActivity(mt.Discard,undefined);n.disconnect(this.getView());if(!s.skipBackNavigation){await this.getInternalRouting().navigateBackFromContext(i);c=true}}else{const r=e;this._sendActivity(mt.Discard,r);n.disconnect(this.getView());let c=r;if(this._isFclEnabled()){a=a??this._createSiblingInfo(i,r);this._updatePathsInHistory(a.pathMapping);if(a.targetContext.getPath()!==r.getPath()){c=a.targetContext}}if(t===St.Draft){await this._fetchSemanticKeyValues(r);if(!s.skipBindingToView){await this._handleNewContext(c,false,true,o,true)}else{return r}}else{await this._handleNewContext(c,false,false,o,true)}}if(t===St.Draft){this.showDocumentDiscardMessage(c)}}catch(e){t.error("Error while discarding the document",e)}};l.showDocumentDiscardMessage=function t(e){const i=this._getResourceModel();const n=i.getText("C_TRANSACTION_HELPER_DISCARD_DRAFT_TOAST");if(e==true){const t=this.getAppComponent();t.getRoutingService().attachAfterRouteMatched(this.showMessageWhenNoContext,this)}else{m.show(n)}};l.showMessageWhenNoContext=function t(){const e=this._getResourceModel();const i=e.getText("C_TRANSACTION_HELPER_DISCARD_DRAFT_TOAST");const n=this.getAppComponent();m.show(i);n.getRoutingService().detachAfterRouteMatched(this.showMessageWhenNoContext,this)};l.isDraftRoot=function t(e){const i=e.getModel().getMetaModel();const n=i.getMetaContext(e.getPath());return h.isDraftRoot(ht(n).targetEntitySet)};l.deleteDocument=async function e(i,n){const o=this.getAppComponent();let r=n;if(!r){r={bFindActiveContexts:false}}else{r.bFindActiveContexts=false}r.beforeDeleteCallBack=this.base.editFlow.onBeforeDelete;try{if(this._isFclEnabled()&&this.isDraftRoot(i)&&i.getIndex()===undefined&&i.getProperty("IsActiveEntity")===true&&i.getProperty("HasDraftEntity")===true){r.beforeDeleteCallBack=async e=>{await this.base.editFlow.onBeforeDelete(e);try{const t=i.getModel();const e=t.bindContext(`${i.getPath()}/SiblingEntity`).getBoundContext();const n=await e.requestCanonicalPath();const o=t.getKeepAliveContext(n);o.replaceWith(i)}catch(e){t.error("Error while replacing the draft instance in the LR ODLB",e)}}}await this.deleteDocumentTransaction(i,r);if(!this._isFclEnabled()){g.setEditStateDirty()}this._sendActivity(mt.Delete,i);if(o){o.getShellServices().setBackNavigation()}if((o===null||o===void 0?void 0:o.getStartupMode())===At.Deeplink&&!this._isFclEnabled()){o.getRouterProxy().exitFromApp()}else{this.getInternalRouting().navigateBackFromContext(i)}}catch(e){t.error("Error while deleting the document",e)}};l.applyDocument=async function t(e){const n=this.getGlobalUIModel();try{await this.syncTask();if(e.getModel().hasPendingChanges("$auto")){i.lock(n);await this._submitOpenChanges(e)}await this._checkForValidationErrors();await this.getMessageHandler().showMessageDialog();await this.getInternalRouting().navigateBackFromContext(e)}finally{if(i.isLocked(n)){i.unlock(n)}}};l.invokeAction=async function e(i,o,r){var s;let a;const c=this.getTransactionHelper();let l;let d;let u;const h=this.base.getView();let f=o||{};if(f.isA&&f.isA("sap.ui.model.odata.v4.Context")||Array.isArray(f)||r!==undefined){const t=f;f=r||{};if(t){f.contexts=t}else{f.model=this.getView().getModel()}}f.isNavigable=f.requiresNavigation||f.isNavigable;const p=ft((s=this.getView().getModel())===null||s===void 0?void 0:s.getMetaModel());if(i.indexOf(""+p.entityContainer.name)>-1){f.isBound=false}else{f.isBound=true}if(!f.parentControl){f.parentControl=this.getView()}if(f.controlId){a=this.getView().byId(f.controlId);if(a){f.internalModelContext=a.getBindingContext("internal")}}else{f.internalModelContext=h.getBindingContext("internal")}if(i&&i.indexOf("(")>-1){l=i.split("(");i=l[0];d=l[l.length-1].replaceAll(")","")}if(f.bStaticAction){if(a.isTableBound()){f.contexts=a.getRowBinding().getHeaderContext()}else{const t=a.data("rowsBindingInfo").path,e=new E(this.getView().getModel(),t);f.contexts=e.getHeaderContext()}if(d&&a.getBindingContext()){f.contexts=this._getActionOverloadContextFromMetadataPath(a.getBindingContext(),a.getRowBinding(),d)}if(f.enableAutoScroll){u=this.createActionPromise(i,a.sId)}}f.bGetBoundContext=this._getBoundContext(h,f);f.bObjectPage=h.getViewData().converterType==="ObjectPage";try{await this.syncTask();const e=await c.callAction(i,f,this.getView(),this.getAppComponent(),this.getMessageHandler());let o;if(f.contexts&&f.isBound===true){o=await this._refreshListIfRequired(this.getActionResponseDataAndKeys(i,e),f.contexts[0])}if(n.isConnected(this.getView())){let t=[];if(e){t=Array.isArray(e)?Object.keys(e[0].value.getObject()):Object.keys(e.getObject())}this._sendActivity(mt.Action,f.contexts,i,o,t)}this._triggerConfiguredSurvey(i,pt.action);if(u){u.fResolver(e)}if(f.contexts){if(!this._isFclEnabled()){g.setEditStateDirty()}this.getInternalModel().setProperty("/lastInvokedAction",i)}if(f.isNavigable){let i=e;if(Array.isArray(i)&&i.length===1){i=i[0].value}if(i&&!Array.isArray(i)){const e=h.getModel().getMetaModel();const n=e.getMetaPath(i.getPath());const o=(t,e)=>t.filter(t=>{if(e){return e.indexOf(t)>-1}return true});const r=Array.isArray(f.contexts)?o(f.contexts,f.applicableContexts)[0]:f.contexts;const s=r&&e.getMetaPath(r.getPath());if(n!=undefined&&n===s){if(r.getPath()!==i.getPath()){this.getInternalRouting().navigateForwardToContext(i,{checkNoHashChange:true,noHistoryEntry:false})}else{t.info("Navigation to the same context is not allowed")}}}}this.base.editFlow.onAfterActionExecution(i);return e}catch(t){if(u){u.fRejector()}if(t===Dt.CancelActionDialog){throw new Error("Dialog cancelled")}else if(!(t&&(t.canceled||t.rejectedItems&&t.rejectedItems[0].canceled))){throw new Error(`Error in EditFlow.invokeAction:${t}`)}}};l.onAfterActionExecution=async function t(e){};l.securedExecution=function t(e,n){var o,r;const s=(n===null||n===void 0?void 0:(o=n.busy)===null||o===void 0?void 0:o.set)??true,a=(n===null||n===void 0?void 0:(r=n.busy)===null||r===void 0?void 0:r.check)??true,c=(n===null||n===void 0?void 0:n.updatesDocument)??false,l=this.getGlobalUIModel(),d=this.getView().getBindingContext(),u=d&&this.getProgrammingModel(d)===St.Draft;if(a&&i.isLocked(l)){return Promise.reject("Application already busy therefore execution rejected")}if(s){i.lock(l)}if(c&&u){this.setDraftStatus(Et.Saving)}this.getMessageHandler().removeTransitionMessages();return this.syncTask(e).then(()=>{if(c){this.setDocumentModified(true);if(!this._isFclEnabled()){g.setEditStateDirty()}if(u){this.setDraftStatus(Et.Saved)}}}).catch(t=>{if(c&&u){this.setDraftStatus(Et.Clear)}return Promise.reject(t)}).finally(()=>{if(s){i.unlock(l)}this.getMessageHandler().showMessageDialog()})};l.handlePatchSent=function t(e){var i,o;const r=n.isConnected(this.getView());if(r){e.getSource().getModel().setIgnoreETag(true)}if(!((i=this.getView())!==null&&i!==void 0&&(o=i.getBindingContext("internal"))!==null&&o!==void 0&&o.getProperty("skipPatchHandlers"))){const t=e.getSource();const i=new Promise((i,n)=>{e.getSource().attachEventOnce("patchCompleted",o=>{if(r){e.getSource().getModel().setIgnoreETag(false)}if(e.getSource().isA("sap.ui.model.odata.v4.ODataListBinding")){var s;x.setActionEnablementAfterPatch(this.getView(),t,(s=this.getView())===null||s===void 0?void 0:s.getBindingContext("internal"))}const a=o.getParameter("success");if(a){i()}else{n()}})});this.updateDocument(t,i)}};l.handleCreateActivate=async function e(i){const n=i.getSource();const o=this.getTransactionHelper();const r=true;const s=true;const a={creationMode:bt.Inline,createAtEnd:r,inactive:s,keepTransientContextOnFailed:false,busyMode:"None"};try{var c;const e=i.getParameter("context");(c=e.created())===null||c===void 0?void 0:c.then(()=>{this._sendActivity(mt.Create,e)}).catch(()=>{t.warning(`Failed to activate context ${e.getPath()}`)});const r=await o.createDocument(n,a,this.getAppComponent(),this.getMessageHandler(),false);if(r){if(!this._isFclEnabled()){g.setEditStateDirty()}}}catch(e){t.error("Failed to activate new row -",e)}};l.syncTask=function t(e){if(e){if(typeof e==="function"){this.syncTasks=this.syncTasks.then(e).catch(function(){return Promise.resolve()})}else{this.syncTasks=this.syncTasks.then(()=>e).catch(function(){return Promise.resolve()})}}return this.syncTasks};l.computeEditMode=async function e(i){const n=this.getProgrammingModel(i);if(n===St.Draft){try{this.setDraftStatus(Et.Clear);const t=this.getGlobalUIModel();t.setProperty("/isEditablePending",true,undefined,true);const e=await i.requestObject("IsActiveEntity");if(e===false){this.setEditMode(xt.Editable);const t=await i.requestObject("HasActiveEntity");this.setEditMode(undefined,!t)}else{this.setEditMode(xt.Display,false)}t.setProperty("/isEditablePending",false,undefined,true)}catch(e){t.error("Error while determining the editMode for draft",e);throw e}}else if(n===St.Sticky){const t=this.getInternalModel().getProperty("/lastInvokedAction");if(t&&this.isNewActionForSticky(t,i)){this.setEditMode(xt.Editable,true);if(!this.getAppComponent()._isFclEnabled()){g.setEditStateDirty()}this.handleStickyOn(i);this.getInternalModel().setProperty("/lastInvokedAction",undefined)}}};l.deleteDocumentTransaction=async function t(e,i){var n;const o=at(this);const r=this.getTransactionHelper();i.internalModelContext=i.controlId?(n=sap.ui.getCore().byId(i.controlId))===null||n===void 0?void 0:n.getBindingContext("internal"):null;await this.syncTask();await r.deleteDocument(e,i,this.getAppComponent(),o,this.getMessageHandler())};l._getResourceModel=function t(){return at(this.getView())};l.getTransactionHelper=function t(){return a};l.getMessageHandler=function t(){if(this.base.messageHandler){return this.base.messageHandler}else{throw new Error("Edit Flow works only with a given message handler")}};l.getInternalModel=function t(){return this.getView().getModel("internal")};l.getGlobalUIModel=function t(){return this.getView().getModel("ui")};l.setCreationMode=function t(e){const i=this.getView().getBindingContext("ui");this.getGlobalUIModel().setProperty("createMode",e,i,true)};l.getCreationMode=function t(){const e=this.getView().getBindingContext("ui");return!!this.getGlobalUIModel().getProperty("createMode",e)};l.isDocumentModified=function t(){return!!this.getGlobalUIModel().getProperty("/isDocumentModified")};l.setDocumentModified=function t(e){this.getGlobalUIModel().setProperty("/isDocumentModified",e)};l.setDocumentModifiedOnCreate=function t(e){if(e.isRelative()){this.setDocumentModified(true)}};l.handleCreateEvents=function t(e){this.setDraftStatus(Et.Clear);const i=this.getProgrammingModel(e);e.attachEvent("createSent",()=>{if(i===St.Draft){this.setDraftStatus(Et.Saving)}});e.attachEvent("createCompleted",t=>{const e=t.getParameter("success");if(i===St.Draft){this.setDraftStatus(e?Et.Saved:Et.Clear)}this.getMessageHandler().showMessageDialog()})};l.setDraftStatus=function t(e){this.getView().getModel("ui").setProperty("/draftStatus",e,undefined,true)};l.getProgrammingModel=function t(e){return this.getTransactionHelper().getProgrammingModel(e)};l.setEditMode=function t(e,i){const n=this.getGlobalUIModel();if(e){n.setProperty("/isEditable",e==="Editable",undefined,true)}if(i!==undefined){this.setCreationMode(i)}};l.isNewActionForSticky=function e(i,n){try{var o;const t=n.getModel().getMetaModel();const e=t.getMetaContext(n.getPath());const r=ht(e).startingEntitySet;const s=(o=r.annotations.Session)===null||o===void 0?void 0:o.StickySessionSupported;if((s===null||s===void 0?void 0:s.NewAction)===i){return true}if(s!==null&&s!==void 0&&s.AdditionalNewActions&&(s===null||s===void 0?void 0:s.AdditionalNewActions.indexOf(i))!==-1){return true}return false}catch(e){t.info(e);return false}};l.handleStickyOn=function e(i){const n=this.getAppComponent();try{if(n===undefined){throw new Error("undefined AppComponent for function handleStickyOn")}if(!n.getRouterProxy().hasNavigationGuard()){const t=n.getRouterProxy().getHash();const e=this.getInternalModel();setTimeout(function(){n.getRouterProxy().setNavigationGuard(i.getPath().substring(1))},0);n.getShellServices().setBackNavigation(this.onBackNavigationInSession.bind(this));this.dirtyStateProviderFunction=this.getDirtyStateProvider(n,e,t);n.getShellServices().registerDirtyStateProvider(this.dirtyStateProviderFunction);const o=this.base.getView().getModel("sap.fe.i18n");this.sessionTimeoutFunction=this.getSessionTimeoutFunction(i,o);this.getView().getModel().attachSessionTimeout(this.sessionTimeoutFunction);this.stickyDiscardAfterNavigationFunction=this.getRouteMatchedFunction(i,n);n.getRoutingService().attachRouteMatched(this.stickyDiscardAfterNavigationFunction)}}catch(e){t.info(e);return false}return true};l.handleStickyOff=function e(){const i=this.getAppComponent();try{if(i===undefined){throw new Error("undefined AppComponent for function handleStickyOff")}if(i.getRouterProxy){i.getRouterProxy().discardNavigationGuard()}if(this.dirtyStateProviderFunction){i.getShellServices().deregisterDirtyStateProvider(this.dirtyStateProviderFunction);this.dirtyStateProviderFunction=undefined}const t=this.getView().getModel();if(t&&this.sessionTimeoutFunction){t.detachSessionTimeout(this.sessionTimeoutFunction)}i.getRoutingService().detachRouteMatched(this.stickyDiscardAfterNavigationFunction);this.stickyDiscardAfterNavigationFunction=undefined;this.setEditMode(xt.Display,false);if(i.getShellServices){i.getShellServices().setBackNavigation()}}catch(e){t.info(e);return false}return true};l._setStickySessionInternalProperties=function t(e,i){if(e===St.Sticky){const t=this.getInternalModel();t.setProperty("/sessionOn",true);t.setProperty("/stickySessionToken",i.getHttpHeaders(true)["SAP-ContextId"])}};l.getDirtyStateProvider=function e(i,n,o){return e=>{try{if(e===undefined){throw new Error("Invalid input parameters for DirtyStateProvider function")}const t=e.innerAppRoute;const r=i.getRouterProxy();let s="";let a;const c=n.getProperty("/sessionOn");if(!c){return undefined}if(!r.isNavigationFinalized()){a=false;s=t}else if(o===t){a=true}else if(r.checkHashWithGuard(t)||r.isGuardCrossAllowedByUser()){s=t;a=false}else{a=true}if(a){setTimeout(function(){i.getShellServices().setDirtyFlag(false)},0)}else{o=s}return a}catch(e){t.info(e);return undefined}}};l.getSessionTimeoutFunction=function e(i,n){return()=>{try{if(i===undefined){throw new Error("Context missing for SessionTimeout function")}this.getMessageHandler().removeTransitionMessages();const t=new w({title:"{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_TITLE}",state:"Warning",content:new C({text:"{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_MESSAGE}"}),beginButton:new v({text:"{sap.fe.i18n>C_COMMON_DIALOG_OK}",type:"Emphasized",press:()=>{this.handleStickyOff();this.getInternalRouting().navigateBackFromContext(i)}}),afterClose:function(){t.destroy()}});t.addStyleClass("sapUiContentPadding");t.setModel(n,"sap.fe.i18n");this.getView().addDependent(t);t.open()}catch(e){t.info(e);return undefined}return true}};l.getRouteMatchedFunction=function t(e,i){return()=>{const t=i.getRouterProxy().getHash();if(!t||!i.getRouterProxy().checkHashWithGuard(t)){this.discardStickySession(e);e.getModel().clearSessionContext()}}};l.discardStickySession=async function t(e){const i=await s.discardDocument(e);if(i!==null&&i!==void 0&&i.hasPendingChanges()){i.getBinding().resetChanges()}if(!this.getCreationMode()){i===null||i===void 0?void 0:i.refresh()}this.handleStickyOff()};l.getInternalRouting=function t(){if(this.base._routing){return this.base._routing}else{throw new Error("Edit Flow works only with a given routing listener")}};l._getRootViewController=function t(){return this.getAppComponent().getRootViewController()};l._getSemanticMapping=function t(){return this.getAppComponent().getRoutingService().getLastSemanticMapping()};l.createActionPromise=function t(e,i){let n,o;this.actionPromise=new Promise((t,e)=>{n=t;o=e}).then(t=>Object.assign({controlId:i},this.getActionResponseDataAndKeys(e,t)));return{fResolver:n,fRejector:o}};l.getActionResponseDataAndKeys=function t(e,i){if(Array.isArray(i)){if(i.length===1){i=i[0].value}else{return null}}if(!i){return null}const n=this.base.getView();const o=n.getModel().getMetaModel().getData();const r=o&&o[e]&&o[e][0]&&o[e][0].$ReturnType?o[e][0].$ReturnType.$Type:null;const s=r&&o[r]?o[r].$Key:null;return{oData:i.getObject(),keys:s}};l.getCurrentActionPromise=function t(){return this.actionPromise};l.deleteCurrentActionPromise=function t(){this.actionPromise=undefined};l._scrollAndFocusOnInactiveRow=function t(e){const i=e.getRowBinding();const n=i.getCount()||0;if(e.data("tableType")!=="ResponsiveTable"){if(n>0){e.scrollToIndex(n-1)}e.focusRow(n,true)}else{const t=i.getContexts();if(!(t!==null&&t!==void 0&&t.length)){e.focusRow(n,true);return}let o=n,r=0;for(const e of t){if(e.isInactive()&&r<o){o=r}r++}if(o>0){e.scrollToIndex(o)}e.focusRow(o,true)}};l.createEmptyRowsAndFocus=async function t(e){var i,n,o;const r=e.getParent();if(r!==null&&r!==void 0&&(i=r.tableDefinition)!==null&&i!==void 0&&(n=i.control)!==null&&n!==void 0&&n.inlineCreationRowsHiddenInEditMode&&!((o=e.getBindingContext("ui"))!==null&&o!==void 0&&o.getProperty("createMode"))){await r.setUpEmptyRows(e,true)}this._scrollAndFocusOnInactiveRow(e)};l._sendActivity=function t(e,i,o,r,s){const a=Array.isArray(i)?i.map(t=>t.getPath()):i===null||i===void 0?void 0:i.getPath();n.send(this.getView(),e,a,o,r,s)};l._triggerConfiguredSurvey=function t(e,i){yt(this.getView(),e,i)};l._submitOpenChanges=async function t(e){const n=e.getModel(),o=this.getGlobalUIModel();try{await n.submitBatch("$auto");await n.oRequestor.waitForRunningChangeRequests("$auto");if(n.hasPendingChanges("$auto")){throw new Error("submit of open changes failed")}}finally{if(i.isLocked(o)){i.unlock(o)}}};l._removeStickySessionInternalProperties=function t(e){if(e===St.Sticky){const t=this.getInternalModel();t.setProperty("/sessionOn",false);t.setProperty("/stickySessionToken",undefined);this.handleStickyOff()}};l.onBackNavigationInSession=function t(){const e=this.base.getView();const i=this.getAppComponent().getRouterProxy();if(i.checkIfBackIsOutOfGuard()){const t=e.getBindingContext();const i=this.getProgrammingModel(t);s.processDataLossConfirmation(async()=>{await this.discardStickySession(t);this._removeStickySessionInternalProperties(i);history.back()},e,i);return}history.back()};l._handleNewContext=async function t(e,i,n,o){let r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;if(!this._isFclEnabled()){g.setEditStateDirty()}await this.getInternalRouting().navigateToContext(e,{checkNoHashChange:true,editable:i,bPersistOPScroll:true,bRecreateContext:n,bDraftNavigation:o,showPlaceholder:false,bForceFocus:r,keepCurrentLayout:true})};l._getBoundContext=function t(e,i){const n=e.getViewData().viewLevel;const o=n>1||n===1&&i.controlId;return!i.isNavigable||!!o};l._checkForValidationErrors=function t(){return this.syncTask().then(()=>{const t=this.getView().getId();const e=sap.ui.getCore().getMessageManager().getMessageModel().getData();let i;let n;if(!e.length){return Promise.resolve("No validation errors found")}for(let o=0;o<e.length;o++){n=e[o];if(n.validation){i=M.byId(n.getControlId());while(i){if(i.getId()===t){return Promise.reject("validation errors exist")}i=i.getParent()}}}})};l._refreshListIfRequired=function e(i,n){if(!n||!i||!i.oData){return Promise.resolve(undefined)}const o=n.getBinding();if(o&&o.isA("sap.ui.model.odata.v4.ODataListBinding")){const e=i.oData;const r=i.keys;const s=n.getObject();let a=true;if(Object.keys(e).length){a=r.every(function(t){return s[t]===e[t]});if(!a){return new Promise(e=>{if(o.isRoot()){o.attachEventOnce("dataReceived",function(){e(!a)});o.refresh()}else{const i=this.getAppComponent();i.getSideEffectsService().requestSideEffects([{$NavigationPropertyPath:o.getPath()}],o.getContext()).then(function(){e(!a)},function(){t.error("Error while refreshing the table");e(!a)}).catch(function(e){t.error("Error while refreshing the table",e)})}})}}}return Promise.resolve(undefined)};l._fetchSemanticKeyValues=function t(e){const i=e.getModel().getMetaModel(),n=i.getMetaContext(e.getPath()).getObject("@sapui.name"),o=p.getSemanticKeys(i,n);if(o&&o.length){const t=o.map(function(t){return e.requestObject(t.$PropertyPath)});return Promise.all(t)}else{return Promise.resolve()}};l._getActionOverloadContextFromMetadataPath=function t(e,i,n){const o=e.getModel();const r=o.getMetaModel();let s=i.getPath().split("/");let a=e;s.pop();if(s.length===0){s=[""]}if(s[0]!==""){s.unshift("")}const c=s.map(t=>{if(t!==""){a=o.bindContext(t,a).getBoundContext()}else{a=e}return a}).reverse();const l=c.find(t=>r.getMetaContext(t.getPath()).getObject("$Type")===n);return l||i.getHeaderContext()};l._createSiblingInfo=function t(e,i){return{targetContext:i,pathMapping:[{oldPath:e.getPath(),newPath:i.getPath()}]}};l._updatePathsInHistory=function t(e){const i=this.getAppComponent();i.getRouterProxy().setPathMapping(e);const n=this._getSemanticMapping();if(e.length&&(n===null||n===void 0?void 0:n.technicalPath)===e[e.length-1].oldPath){n.technicalPath=e[e.length-1].newPath}};l._getNavigationTargetForEdit=function t(e,i,n){let o;n=n??this._createSiblingInfo(e,i);this._updatePathsInHistory(n.pathMapping);if(n.targetContext.getPath()!=i.getPath()){o=n.targetContext}return o};l._computeSiblingInformation=async function e(i,n,o,s,a){n=n??i;if(!n.getPath().startsWith(i.getPath())){t.error("Cannot compute rightmost sibling context");throw new Error("Cannot compute rightmost sibling context")}if(s&&n.getPath()===i.getPath()){return Promise.resolve(undefined)}const c=i.getModel();if(o===St.Draft){return r.computeSiblingInformation(i,n,a)}else{return{targetContext:c.bindContext(n.getPath()).getBoundContext(),pathMapping:[]}}};l._isFclEnabled=function t(){return this.getAppComponent()._isFclEnabled()};return c}(S),Pt(st.prototype,"editDocument",[k,_],Object.getOwnPropertyDescriptor(st.prototype,"editDocument"),st.prototype),Pt(st.prototype,"updateDocument",[I,O],Object.getOwnPropertyDescriptor(st.prototype,"updateDocument"),st.prototype),Pt(st.prototype,"createDocument",[R,F],Object.getOwnPropertyDescriptor(st.prototype,"createDocument"),st.prototype),Pt(st.prototype,"onBeforeSave",[T,B],Object.getOwnPropertyDescriptor(st.prototype,"onBeforeSave"),st.prototype),Pt(st.prototype,"onBeforeCreate",[V,H],Object.getOwnPropertyDescriptor(st.prototype,"onBeforeCreate"),st.prototype),Pt(st.prototype,"onBeforeEdit",[N,j],Object.getOwnPropertyDescriptor(st.prototype,"onBeforeEdit"),st.prototype),Pt(st.prototype,"onBeforeDiscard",[L,$],Object.getOwnPropertyDescriptor(st.prototype,"onBeforeDiscard"),st.prototype),Pt(st.prototype,"onBeforeDelete",[G,U],Object.getOwnPropertyDescriptor(st.prototype,"onBeforeDelete"),st.prototype),Pt(st.prototype,"saveDocument",[q,K],Object.getOwnPropertyDescriptor(st.prototype,"saveDocument"),st.prototype),Pt(st.prototype,"cancelDocument",[W,z],Object.getOwnPropertyDescriptor(st.prototype,"cancelDocument"),st.prototype),Pt(st.prototype,"deleteDocument",[J,X],Object.getOwnPropertyDescriptor(st.prototype,"deleteDocument"),st.prototype),Pt(st.prototype,"applyDocument",[Q,Y],Object.getOwnPropertyDescriptor(st.prototype,"applyDocument"),st.prototype),Pt(st.prototype,"invokeAction",[Z,tt],Object.getOwnPropertyDescriptor(st.prototype,"invokeAction"),st.prototype),Pt(st.prototype,"onAfterActionExecution",[et,it],Object.getOwnPropertyDescriptor(st.prototype,"onAfterActionExecution"),st.prototype),Pt(st.prototype,"securedExecution",[nt,ot],Object.getOwnPropertyDescriptor(st.prototype,"securedExecution"),st.prototype),st))||rt);return _t},false);
|
|
126
131
|
/*!
|
|
127
132
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
128
133
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -137,12 +142,12 @@ sap.ui.predefine("sap/fe/core/controllerextensions/IntentBasedNavigation", ["sap
|
|
|
137
142
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
138
143
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
139
144
|
*/
|
|
140
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/InternalIntentBasedNavigation", ["sap/base/Log","sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/navigation/SelectionVariant","sap/ui/core/Core","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","../converters/helpers/Aggregation","./editFlow/NotApplicableContextDialog"],function(t,e,o,n,i,r,a,s,l,p,c,g,u,f,d){"use strict";var v,h,y,m,b,O,C,P,A,x,S,M,_,j,w,N,E,$,D,F,V,I,B;var R=f.AggregationHelper;var T=l.getResourceModel;var L=r.publicExtension;var k=r.privateExtension;var W=r.methodOverride;var z=r.finalExtension;var H=r.extensible;var U=r.defineUI5Class;var J=i.convertTypes;function q(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;G(t,e)}function G(t,e){G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return G(t,e)}function K(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}let Q=(v=U("sap.fe.core.controllerextensions.InternalInternalBasedNavigation"),h=W(),y=L(),m=z(),b=L(),O=z(),C=L(),P=z(),A=L(),x=H(u.Instead),S=L(),M=z(),_=k(),j=L(),w=z(),N=L(),E=z(),$=L(),D=z(),F=L(),V=z(),v(I=(B=function(r){q(l,r);function l(){return r.apply(this,arguments)||this}var g=l.prototype;g.onInit=function t(){this._oAppComponent=this.base.getAppComponent();this._oMetaModel=this._oAppComponent.getModel().getMetaModel();this._oNavigationService=this._oAppComponent.getNavigationService();this._oView=this.base.getView()};g.navigate=function t(o,i,r){const l=t=>{const n=r&&r.navigationContexts,s=n&&!Array.isArray(n)?[n]:n,l=r&&r.semanticObjectMapping,g=r&&r.additionalNavigationParameters,u={semanticObject:o,action:i},f=this.base.getView(),d=f.getController();if(t){this._oView.setBindingContext(t)}if(o&&i){let t=[],n=new p;if(s&&s.length){s.forEach(e=>{if(e.isA&&e.isA("sap.ui.model.odata.v4.Context")){let o=e.getObject();const n=this._oMetaModel.getMetaPath(e.getPath());o=this.removeSensitiveData(o,n);const i=this.prepareContextForExternalNavigation(o,e);u["propertiesWithoutConflict"]=i.propertiesWithoutConflict;t.push(i.semanticAttributes)}else if(!(e&&Array.isArray(e.data))&&typeof e==="object"){t.push(this.removeSensitiveData(e.data,e.metaPath))}else if(e&&Array.isArray(e.data)){t=this.removeSensitiveData(e.data,e.metaPath)}})}if(t&&t.length){n=this._oNavigationService.mixAttributesAndSelectionVariant(t,n.toJSONString())}const v=this._oView.getModel(),h=this.getEntitySet(),y=h?this._oNavigationService.constructContextUrl(h,v):undefined;if(y){n.setFilterContextUrl(y)}if(g){this._applyOutboundParams(n,g)}d.intentBasedNavigation.adaptNavigationContext(n,u);if(l){this._applySemanticObjectMappings(n,l)}this._removeTechnicalParameters(n);const m=d._intentBasedNavigation.getNavigationMode();const b=r&&r.refreshStrategies||{},O=f.getModel("internal");if(O){if((f&&f.getViewData()).refreshStrategyOnAppRestore){const t=f.getViewData().refreshStrategyOnAppRestore||{};e(b,t)}const t=a.getRefreshStrategyForIntent(b,o,i);if(t){O.setProperty("/refreshStrategyOnAppRestore",t)}}const C=function(){sap.ui.require(["sap/m/MessageBox"],function(t){const e=c.getLibraryResourceBundle("sap.fe.core");t.error(e.getText("C_COMMON_HELPER_NAVIGATION_ERROR_MESSAGE"),{title:e.getText("C_COMMON_SAPFE_ERROR")})})};this._oNavigationService.navigate(o,i,n.toJSONString(),undefined,C,undefined,m)}else{throw new Error("Semantic Object/action is not provided")}};const g=this.base.getView().getBindingContext();const u=g&&g.getModel().getMetaModel();if(this.getView().getViewData().converterType==="ObjectPage"&&u&&!s.isStickySessionSupported(u)){n.processDataLossOrDraftDiscardConfirmation(l.bind(this),Function.prototype,this.base.getView().getBindingContext(),this.base.getView().getController(),true,n.NavigationType.ForwardNavigation)}else{l()}};g.prepareContextForExternalNavigation=function t(e,o){const n={},i=o.getPath(),r=o.getModel().getMetaModel(),a=r.getMetaPath(i),s=a.split("/").filter(Boolean);function l(t,e){for(const o in t){if(t[o]===null||typeof t[o]!=="object"){if(!n[o]){n[o]=[]}n[o].push(e)}else{const n=t[o];l(n,`${e}/${o}`)}}}l(e,a);const p=s[0],c=r.getObject(`/${p}/@sapui.name`),g={};let u,f,d;for(const t in n){const i=n[t];let s;if(i.length>1){for(let n=0;n<=i.length-1;n++){const s=i[n];let l=s.replace(s===a?a:`${a}/`,"");l=(l===""?l:`${l}/`)+t;const p=r.getObject(`${s}/@sapui.name`);if(p===c){u=l}if(s===a){f=l}d=l;e[`${a}/${l}`.split("/").filter(function(t){return t!=""}).join(".")]=o.getProperty(l)}s=u||f||d;e[t]=o.getProperty(s);u=undefined;f=undefined;d=undefined}else{const n=i[0];let r=n.replace(n===a?a:`${a}/`,"");r=(r===""?r:`${r}/`)+t;e[t]=o.getProperty(r);g[t]=`${a}/${r}`.split("/").filter(function(t){return t!=""}).join(".")}}for(const t in e){if(e[t]!==null&&typeof e[t]==="object"){delete e[t]}}return{semanticAttributes:e,propertiesWithoutConflict:g}};g.prepareFiltersForExternalNavigation=function t(e,o,n){let i;const r={};const a={};let s,l,p,c,g;function u(t){let e;for(let n in t){if(t[n]){if(n.includes("/")){e=n;const t=n.split("/");n=t[t.length-1]}else{e=o}if(!r[n]){r[n]=[]}r[n].push(e)}}}u(e);for(const t in r){const u=r[t];if(u.length>1){for(let r=0;r<=u.length-1;r++){i=u[r];if(i===o){p=`${o}/${t}`;g=t;s=t;if(n&&n.includes(t)){e[`$Parameter.${t}`]=e[t]}}else{g=i;p=`${o}/${i}`.replaceAll(/\*/g,"");l=i}e[p.split("/").filter(function(t){return t!=""}).join(".")]=e[g];delete e[i]}c=s||l;e[t]=e[c]}else{i=u[0];p=i===o?`${o}/${t}`:`${o}/${i}`.replaceAll("*","");a[t]=p.split("/").filter(function(t){return t!=""}).join(".");if(n&&n.includes(t)){e[`$Parameter.${t}`]=e[t]}}}return{filterConditions:e,filterConditionsWithoutConflict:a}};g.getNavigationMode=function t(){return undefined};g.navigateWithConfirmationDialog=async function t(e,o,n){var i;let r=true;if(n!==null&&n!==void 0&&n.notApplicableContexts&&((i=n.notApplicableContexts)===null||i===void 0?void 0:i.length)>=1){const t=this.getView().getModel().getMetaModel();const e=t.getMetaPath(n.notApplicableContexts[0].getPath());const o=J(t);const i=o.resolvePath(e).target;const a=new d({title:"",entityType:i.entityType,resourceModel:T(this.getView()),notApplicableContexts:n.notApplicableContexts});n.navigationContexts=n.applicableContexts;r=await a.open(this.getView())}if(r){this.navigate(e,o,n)}};g._removeTechnicalParameters=function t(e){e.removeSelectOption("@odata.context");e.removeSelectOption("@odata.metadataEtag");e.removeSelectOption("SAP__Messages")};g.getEntitySet=function t(){return this._oView.getViewData().entitySet};g.removeSensitiveData=function t(e,o){if(e){const{transAggregations:t,customAggregates:s}=this._getAggregates(o,this.base.getView(),this.base.getAppComponent().getDiagnostics());const l=Object.keys(e);if(l.length){delete e["@odata.context"];delete e["@odata.metadataEtag"];delete e["SAP__Messages"];for(const p of l){if(e[p]&&typeof e[p]==="object"){this.removeSensitiveData(e[p],`${o}/${p}`)}if(p.indexOf("@odata.type")>-1){delete e[p];continue}this._deleteAggregates([...t,...s],p,e);const l=this._getPropertyAnnotations(p,o,e,this._oMetaModel);if(l){var n,i,r,a;if((n=l.PersonalData)!==null&&n!==void 0&&n.IsPotentiallySensitive||(i=l.UI)!==null&&i!==void 0&&i.ExcludeFromNavigationContext||(r=l.Analytics)!==null&&r!==void 0&&r.Measure){delete e[p]}else if((a=l.Common)!==null&&a!==void 0&&a.FieldControl){const t=l.Common.FieldControl;if(t["$EnumMember"]&&t["$EnumMember"].split("/")[1]==="Inapplicable"||t["$Path"]&&this._isFieldControlPathInapplicable(t["$Path"],e)){delete e[p]}}}}}}return e};g._deleteAggregates=function t(e,o,n){if(e&&e.indexOf(o)>-1){delete n[o]}};g._getPropertyAnnotations=function t(e,o,n,r){if(n[e]&&o&&!o.includes("undefined")){var a;const t=r.createBindingContext(`${o}/${e}`);const n=i.getInvolvedDataModelObjects(t);return n===null||n===void 0?void 0:(a=n.targetObject)===null||a===void 0?void 0:a.annotations}return null};g._getAggregates=function t(e,o,n){const i=this._getConverterContext(e,o,n);const r=new R(i.getEntityType(),i);const a=r.isAnalyticsSupported();let s,l;if(a){var p,c;s=r.getTransAggregations();if((p=s)!==null&&p!==void 0&&p.length){s=s.map(t=>t.Name||t.Value)}l=r.getCustomAggregateDefinitions();if((c=l)!==null&&c!==void 0&&c.length){l=l.map(t=>t.qualifier)}}s=s?s:[];l=l?l:[];return{transAggregations:s,customAggregates:l}};g._getConverterContext=function t(e,n,i){const r=n.getViewData();let a=r.entitySet;const s=r.contextPath;if(s&&(!a||a.includes("/"))){a=r===null||r===void 0?void 0:r.fullContextPath.split("/")[1]}return o.getConverterContextForPath(e,n.getModel().getMetaModel(),a,i)};g._isFieldControlPathInapplicable=function t(e,o){let n=false;const i=e.split("/");if(i.length>1){n=o[i[0]]&&o[i[0]].hasOwnProperty(i[1])&&o[i[0]][i[1]]===0}else{n=o[e]===0}return n};g._applySemanticObjectMappings=function t(e,o){const n=typeof o==="string"?JSON.parse(o):o;for(let t=0;t<n.length;t++){const o=n[t]["LocalProperty"]&&n[t]["LocalProperty"]["$PropertyPath"]||n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]&&n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"];const i=n[t]["SemanticObjectProperty"]||n[t]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];const r=e.getSelectOption(o);if(r){e.removeSelectOption(o);e.massAddSelectOption(i,r)}}return e};g.navigateOutbound=function e(o,n){var i,r;let a;const s=this.base.getAppComponent().getManifestEntry("sap.app"),l=(i=s.crossNavigation)===null||i===void 0?void 0:(r=i.outbounds)===null||r===void 0?void 0:r[o];if(!l){t.error("Outbound is not defined in manifest!!");return}const p=l.semanticObject,c=l.action,g=l.parameters&&this.getOutboundParams(l.parameters);if(n){a=[];Object.keys(n).forEach(function(t){let e;if(Array.isArray(n[t])){const i=n[t];for(let n=0;n<i.length;n++){var o;e={};e[t]=i[n];(o=a)===null||o===void 0?void 0:o.push(e)}}else{var i;e={};e[t]=n[t];(i=a)===null||i===void 0?void 0:i.push(e)}})}if(a||g){n={navigationContexts:{data:a||g}}}this.base._intentBasedNavigation.navigate(p,c,n)};g._applyOutboundParams=function t(e,o){const n=Object.keys(o);const i=e.getSelectOptionsPropertyNames();n.forEach(function(t){if(!i.includes(t)){e.addSelectOption(t,"I","EQ",o[t])}});return e};g.getOutboundParams=function t(e){const o={};if(e){const t=Object.keys(e)||[];if(t.length>0){t.forEach(function(t){const n=e[t];if(n.value&&n.value.value&&n.value.format==="plain"){if(!o[t]){o[t]=n.value.value}}})}}return o};g.onChevronPressNavigateOutBound=function t(e,o,n,i){const r=e.getAppComponent().getRoutingService().getOutbounds();const a=r[o];let l;if(a&&a.semanticObject&&a.action){const t={intents:{}};const o={};let r;if(n){if(n.isA&&n.isA("sap.ui.model.odata.v4.Context")){r=s.getMetaPathForContext(n);n=[n]}else{r=s.getMetaPathForContext(n[0])}o[r]="self";t["_feDefault"]=o}if(i){const e=`${a.semanticObject}-${a.action}`;t.intents[e]={};t.intents[e][i]="self"}if(a&&a.parameters){const t=a.parameters&&this.getOutboundParams(a.parameters);if(Object.keys(t).length>0){l=t}}e._intentBasedNavigation.navigate(a.semanticObject,a.action,{navigationContexts:n,refreshStrategies:t,additionalNavigationParameters:l});return Promise.resolve()}else{throw new Error(`outbound target ${o} not found in cross navigation definition of manifest`)}};return l}(g),K(B.prototype,"onInit",[h],Object.getOwnPropertyDescriptor(B.prototype,"onInit"),B.prototype),K(B.prototype,"navigate",[y,m],Object.getOwnPropertyDescriptor(B.prototype,"navigate"),B.prototype),K(B.prototype,"prepareContextForExternalNavigation",[b,O],Object.getOwnPropertyDescriptor(B.prototype,"prepareContextForExternalNavigation"),B.prototype),K(B.prototype,"prepareFiltersForExternalNavigation",[C,P],Object.getOwnPropertyDescriptor(B.prototype,"prepareFiltersForExternalNavigation"),B.prototype),K(B.prototype,"getNavigationMode",[A,x],Object.getOwnPropertyDescriptor(B.prototype,"getNavigationMode"),B.prototype),K(B.prototype,"navigateWithConfirmationDialog",[S,M],Object.getOwnPropertyDescriptor(B.prototype,"navigateWithConfirmationDialog"),B.prototype),K(B.prototype,"getEntitySet",[_],Object.getOwnPropertyDescriptor(B.prototype,"getEntitySet"),B.prototype),K(B.prototype,"removeSensitiveData",[j,w],Object.getOwnPropertyDescriptor(B.prototype,"removeSensitiveData"),B.prototype),K(B.prototype,"navigateOutbound",[N,E],Object.getOwnPropertyDescriptor(B.prototype,"navigateOutbound"),B.prototype),K(B.prototype,"getOutboundParams",[$,D],Object.getOwnPropertyDescriptor(B.prototype,"getOutboundParams"),B.prototype),K(B.prototype,"onChevronPressNavigateOutBound",[F,V],Object.getOwnPropertyDescriptor(B.prototype,"onChevronPressNavigateOutBound"),B.prototype),B))||I);return Q},false);
|
|
145
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/InternalIntentBasedNavigation", ["sap/base/Log","sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/navigation/SelectionVariant","sap/ui/core/Core","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","../converters/helpers/Aggregation","./editFlow/NotApplicableContextDialog"],function(t,e,o,n,i,r,a,s,l,p,c,g,u,f,d){"use strict";var v,h,y,m,b,O,C,P,A,x,S,M,_,j,w,N,E,$,D,F,V,I,B;var R=f.AggregationHelper;var T=l.getResourceModel;var L=r.publicExtension;var k=r.privateExtension;var W=r.methodOverride;var z=r.finalExtension;var H=r.extensible;var U=r.defineUI5Class;var J=i.convertTypes;function q(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;G(t,e)}function G(t,e){G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return G(t,e)}function K(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}let Q=(v=U("sap.fe.core.controllerextensions.InternalInternalBasedNavigation"),h=W(),y=L(),m=z(),b=L(),O=z(),C=L(),P=z(),A=L(),x=H(u.Instead),S=L(),M=z(),_=k(),j=L(),w=z(),N=L(),E=z(),$=L(),D=z(),F=L(),V=z(),v(I=(B=function(r){q(l,r);function l(){return r.apply(this,arguments)||this}var g=l.prototype;g.onInit=function t(){this._oAppComponent=this.base.getAppComponent();this._oMetaModel=this._oAppComponent.getModel().getMetaModel();this._oNavigationService=this._oAppComponent.getNavigationService();this._oView=this.base.getView()};g.navigate=function t(o,i,r){const l=t=>{const n=r&&r.navigationContexts,s=n&&!Array.isArray(n)?[n]:n,l=r&&r.semanticObjectMapping,g=r&&r.additionalNavigationParameters,u={semanticObject:o,action:i},f=this.base.getView(),d=f.getController();if(t){this._oView.setBindingContext(t)}if(o&&i){let t=[],n=new p;if(s&&s.length){s.forEach(e=>{if(e.isA&&e.isA("sap.ui.model.odata.v4.Context")){let o=e.getObject();const n=this._oMetaModel.getMetaPath(e.getPath());o=this.removeSensitiveData(o,n);const i=this.prepareContextForExternalNavigation(o,e);u["propertiesWithoutConflict"]=i.propertiesWithoutConflict;t.push(i.semanticAttributes)}else if(!(e&&Array.isArray(e.data))&&typeof e==="object"){t.push(this.removeSensitiveData(e.data,e.metaPath))}else if(e&&Array.isArray(e.data)){t=this.removeSensitiveData(e.data,e.metaPath)}})}if(t&&t.length){n=this._oNavigationService.mixAttributesAndSelectionVariant(t,n.toJSONString())}const v=this._oView.getModel(),h=this.getEntitySet(),y=h?this._oNavigationService.constructContextUrl(h,v):undefined;if(y){n.setFilterContextUrl(y)}if(g){this._applyOutboundParams(n,g)}d.intentBasedNavigation.adaptNavigationContext(n,u);if(l){this._applySemanticObjectMappings(n,l)}this._removeTechnicalParameters(n);const m=d._intentBasedNavigation.getNavigationMode();const b=r&&r.refreshStrategies||{},O=f.getModel("internal");if(O){if((f&&f.getViewData()).refreshStrategyOnAppRestore){const t=f.getViewData().refreshStrategyOnAppRestore||{};e(b,t)}const t=a.getRefreshStrategyForIntent(b,o,i);if(t){O.setProperty("/refreshStrategyOnAppRestore",t)}}const C=function(){sap.ui.require(["sap/m/MessageBox"],function(t){const e=c.getLibraryResourceBundle("sap.fe.core");t.error(e.getText("C_COMMON_HELPER_NAVIGATION_ERROR_MESSAGE"),{title:e.getText("C_COMMON_SAPFE_ERROR")})})};this._oNavigationService.navigate(o,i,n.toJSONString(),undefined,C,undefined,m)}else{throw new Error("Semantic Object/action is not provided")}};const g=this.base.getView().getBindingContext();const u=g&&g.getModel().getMetaModel();if(this.getView().getViewData().converterType==="ObjectPage"&&u&&!s.isStickySessionSupported(u)){n.processDataLossOrDraftDiscardConfirmation(l.bind(this),Function.prototype,this.base.getView().getBindingContext(),this.base.getView().getController(),true,n.NavigationType.ForwardNavigation)}else{l()}};g.prepareContextForExternalNavigation=function t(e,o){const n={},i=o.getPath(),r=o.getModel().getMetaModel(),a=r.getMetaPath(i),s=a.split("/").filter(Boolean);function l(t,e){for(const o in t){if(t[o]===null||typeof t[o]!=="object"){if(!n[o]){n[o]=[]}n[o].push(e)}else{const n=t[o];l(n,`${e}/${o}`)}}}l(e,a);const p=s[0],c=r.getObject(`/${p}/@sapui.name`),g={};let u,f,d;for(const t in n){const i=n[t];let s;if(i.length>1){for(let n=0;n<=i.length-1;n++){const s=i[n];let l=s.replace(s===a?a:`${a}/`,"");l=(l===""?l:`${l}/`)+t;const p=r.getObject(`${s}/@sapui.name`);if(p===c){u=l}if(s===a){f=l}d=l;e[`${a}/${l}`.split("/").filter(function(t){return t!=""}).join(".")]=o.getProperty(l)}s=u||f||d;e[t]=o.getProperty(s);u=undefined;f=undefined;d=undefined}else{const n=i[0];let r=n.replace(n===a?a:`${a}/`,"");r=(r===""?r:`${r}/`)+t;e[t]=o.getProperty(r);g[t]=`${a}/${r}`.split("/").filter(function(t){return t!=""}).join(".")}}for(const t in e){if(e[t]!==null&&typeof e[t]==="object"){delete e[t]}}return{semanticAttributes:e,propertiesWithoutConflict:g}};g.prepareFiltersForExternalNavigation=function t(e,o,n){let i;const r={};const a={};let s,l,p,c,g;function u(t){let e;for(const n in t){let i=n;if(t[i]){if(i.includes("/")){e=i;const t=i.split("/");i=t[t.length-1]}else{e=o}if(!r[i]){r[i]=[]}r[i].push(e)}}}u(e);for(const t in r){const u=r[t];if(u.length>1){for(let r=0;r<=u.length-1;r++){i=u[r];if(i===o){p=`${o}/${t}`;g=t;s=t;if(n&&n.includes(t)){e[`$Parameter.${t}`]=e[t]}}else{g=i;p=`${o}/${i}`.replaceAll(/\*/g,"");l=i}e[p.split("/").filter(function(t){return t!=""}).join(".")]=e[g];delete e[i]}c=s||l;e[t]=e[c]}else{i=u[0];p=i===o?`${o}/${t}`:`${o}/${i}`.replaceAll("*","");a[t]=p.split("/").filter(function(t){return t!=""}).join(".");if(n&&n.includes(t)){e[`$Parameter.${t}`]=e[t]}}}return{filterConditions:e,filterConditionsWithoutConflict:a}};g.getNavigationMode=function t(){return undefined};g.navigateWithConfirmationDialog=async function t(e,o,n){var i;let r=true;if(n!==null&&n!==void 0&&n.notApplicableContexts&&((i=n.notApplicableContexts)===null||i===void 0?void 0:i.length)>=1){const t=this.base.getView().getModel().getMetaModel();const e=t.getMetaPath(n.notApplicableContexts[0].getPath());const o=J(t);const i=o.resolvePath(e).target;const a=new d({title:"",entityType:i.entityType,resourceModel:T(this.getView()),notApplicableContexts:n.notApplicableContexts});n.navigationContexts=n.applicableContexts;r=await a.open(this.getView())}if(r){this.navigate(e,o,n)}};g._removeTechnicalParameters=function t(e){e.removeSelectOption("@odata.context");e.removeSelectOption("@odata.metadataEtag");e.removeSelectOption("SAP__Messages")};g.getEntitySet=function t(){return this._oView.getViewData().entitySet};g.removeSensitiveData=function t(e,o){if(e){const{transAggregations:t,customAggregates:s}=this._getAggregates(o,this.base.getView(),this.base.getAppComponent().getDiagnostics());const l=Object.keys(e);if(l.length){delete e["@odata.context"];delete e["@odata.metadataEtag"];delete e["SAP__Messages"];for(const p of l){if(e[p]&&typeof e[p]==="object"){this.removeSensitiveData(e[p],`${o}/${p}`)}if(p.indexOf("@odata.type")>-1){delete e[p];continue}this._deleteAggregates([...t,...s],p,e);const l=this._getPropertyAnnotations(p,o,e,this._oMetaModel);if(l){var n,i,r,a;if((n=l.PersonalData)!==null&&n!==void 0&&n.IsPotentiallySensitive||(i=l.UI)!==null&&i!==void 0&&i.ExcludeFromNavigationContext||(r=l.Analytics)!==null&&r!==void 0&&r.Measure){delete e[p]}else if((a=l.Common)!==null&&a!==void 0&&a.FieldControl){const t=l.Common.FieldControl;if(t["$EnumMember"]&&t["$EnumMember"].split("/")[1]==="Inapplicable"||t["$Path"]&&this._isFieldControlPathInapplicable(t["$Path"],e)){delete e[p]}}}}}}return e};g._deleteAggregates=function t(e,o,n){if(e&&e.indexOf(o)>-1){delete n[o]}};g._getPropertyAnnotations=function t(e,o,n,r){if(n[e]&&o&&!o.includes("undefined")){var a;const t=r.createBindingContext(`${o}/${e}`);const n=i.getInvolvedDataModelObjects(t);return n===null||n===void 0?void 0:(a=n.targetObject)===null||a===void 0?void 0:a.annotations}return null};g._getAggregates=function t(e,o,n){const i=this._getConverterContext(e,o,n);const r=new R(i.getEntityType(),i);const a=r.isAnalyticsSupported();let s,l;if(a){var p,c;s=r.getTransAggregations();if((p=s)!==null&&p!==void 0&&p.length){s=s.map(t=>t.Name||t.Value)}l=r.getCustomAggregateDefinitions();if((c=l)!==null&&c!==void 0&&c.length){l=l.map(t=>t.qualifier)}}s=s?s:[];l=l?l:[];return{transAggregations:s,customAggregates:l}};g._getConverterContext=function t(e,n,i){const r=n.getViewData();let a=r.entitySet;const s=r.contextPath;if(s&&(!a||a.includes("/"))){a=r===null||r===void 0?void 0:r.fullContextPath.split("/")[1]}return o.getConverterContextForPath(e,n.getModel().getMetaModel(),a,i)};g._isFieldControlPathInapplicable=function t(e,o){let n=false;const i=e.split("/");if(i.length>1){n=o[i[0]]&&o[i[0]].hasOwnProperty(i[1])&&o[i[0]][i[1]]===0}else{n=o[e]===0}return n};g._applySemanticObjectMappings=function t(e,o){const n=typeof o==="string"?JSON.parse(o):o;for(let t=0;t<n.length;t++){const o=n[t]["LocalProperty"]&&n[t]["LocalProperty"]["$PropertyPath"]||n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]&&n[t]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"];const i=n[t]["SemanticObjectProperty"]||n[t]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];const r=e.getSelectOption(o);if(r){e.removeSelectOption(o);e.massAddSelectOption(i,r)}}return e};g.navigateOutbound=function e(o,n){var i,r;let a;const s=this.base.getAppComponent().getManifestEntry("sap.app"),l=(i=s.crossNavigation)===null||i===void 0?void 0:(r=i.outbounds)===null||r===void 0?void 0:r[o];if(!l){t.error("Outbound is not defined in manifest!!");return}const p=l.semanticObject,c=l.action,g=l.parameters&&this.getOutboundParams(l.parameters);if(n){a=[];Object.keys(n).forEach(function(t){let e;if(Array.isArray(n[t])){const i=n[t];for(let n=0;n<i.length;n++){var o;e={};e[t]=i[n];(o=a)===null||o===void 0?void 0:o.push(e)}}else{var i;e={};e[t]=n[t];(i=a)===null||i===void 0?void 0:i.push(e)}})}if(a||g){n={navigationContexts:{data:a||g}}}this.base._intentBasedNavigation.navigate(p,c,n)};g._applyOutboundParams=function t(e,o){const n=Object.keys(o);const i=e.getSelectOptionsPropertyNames();n.forEach(function(t){if(!i.includes(t)){e.addSelectOption(t,"I","EQ",o[t])}});return e};g.getOutboundParams=function t(e){const o={};if(e){const t=Object.keys(e)||[];if(t.length>0){t.forEach(function(t){const n=e[t];if(n.value&&n.value.value&&n.value.format==="plain"){if(!o[t]){o[t]=n.value.value}}})}}return o};g.onChevronPressNavigateOutBound=function t(e,o,n,i){const r=e.getAppComponent().getRoutingService().getOutbounds();const a=r[o];let l;if(a&&a.semanticObject&&a.action){const t={intents:{}};const o={};let r;if(n){if(n.isA&&n.isA("sap.ui.model.odata.v4.Context")){r=s.getMetaPathForContext(n);n=[n]}else{r=s.getMetaPathForContext(n[0])}o[r]="self";t["_feDefault"]=o}if(i){const e=`${a.semanticObject}-${a.action}`;t.intents[e]={};t.intents[e][i]="self"}if(a&&a.parameters){const t=a.parameters&&this.getOutboundParams(a.parameters);if(Object.keys(t).length>0){l=t}}e._intentBasedNavigation.navigate(a.semanticObject,a.action,{navigationContexts:n,refreshStrategies:t,additionalNavigationParameters:l});return Promise.resolve()}else{throw new Error(`outbound target ${o} not found in cross navigation definition of manifest`)}};return l}(g),K(B.prototype,"onInit",[h],Object.getOwnPropertyDescriptor(B.prototype,"onInit"),B.prototype),K(B.prototype,"navigate",[y,m],Object.getOwnPropertyDescriptor(B.prototype,"navigate"),B.prototype),K(B.prototype,"prepareContextForExternalNavigation",[b,O],Object.getOwnPropertyDescriptor(B.prototype,"prepareContextForExternalNavigation"),B.prototype),K(B.prototype,"prepareFiltersForExternalNavigation",[C,P],Object.getOwnPropertyDescriptor(B.prototype,"prepareFiltersForExternalNavigation"),B.prototype),K(B.prototype,"getNavigationMode",[A,x],Object.getOwnPropertyDescriptor(B.prototype,"getNavigationMode"),B.prototype),K(B.prototype,"navigateWithConfirmationDialog",[S,M],Object.getOwnPropertyDescriptor(B.prototype,"navigateWithConfirmationDialog"),B.prototype),K(B.prototype,"getEntitySet",[_],Object.getOwnPropertyDescriptor(B.prototype,"getEntitySet"),B.prototype),K(B.prototype,"removeSensitiveData",[j,w],Object.getOwnPropertyDescriptor(B.prototype,"removeSensitiveData"),B.prototype),K(B.prototype,"navigateOutbound",[N,E],Object.getOwnPropertyDescriptor(B.prototype,"navigateOutbound"),B.prototype),K(B.prototype,"getOutboundParams",[$,D],Object.getOwnPropertyDescriptor(B.prototype,"getOutboundParams"),B.prototype),K(B.prototype,"onChevronPressNavigateOutBound",[F,V],Object.getOwnPropertyDescriptor(B.prototype,"onChevronPressNavigateOutBound"),B.prototype),B))||I);return Q},false);
|
|
141
146
|
/*!
|
|
142
147
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
143
148
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
144
149
|
*/
|
|
145
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/InternalRouting", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/routing/NavigationReason","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/ui/core/Component","sap/ui/core/Core","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/model/Filter","sap/ui/model/FilterOperator"],function(t,e,o,n,i,r,a,s,c,g,l,p,u,h,f,d){"use strict";var C,v,P,_,y,m,x,b,w,O,B,R,E,S,A,D,F,M,T,V,I,L,$,j,k,H,N,q,K,z,U,Q;var W=a.publicExtension;var X=a.methodOverride;var G=a.finalExtension;var J=a.extensible;var Y=a.defineUI5Class;var Z=n.isConnected;function tt(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;et(t,e)}function et(t,e){et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return et(t,e)}function ot(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}let nt=(C=Y("sap.fe.core.controllerextensions.InternalRouting"),v=X(),P=X(),_=W(),y=J(h.After),m=W(),x=J(h.After),b=W(),w=J(h.After),O=W(),B=J(h.After),R=W(),E=W(),S=W(),A=G(),D=W(),F=G(),M=W(),T=G(),V=W(),I=G(),L=W(),$=G(),j=W(),k=G(),H=W(),N=W(),q=G(),K=W(),z=J(h.Before),C(U=(Q=function(n){tt(a,n);function a(){return n.apply(this,arguments)||this}var u=a.prototype;u.onExit=function t(){if(this._oRoutingService){this._oRoutingService.detachRouteMatched(this._fnRouteMatchedBound)}};u.onInit=function t(){this._oView=this.base.getView();this._oAppComponent=e.getAppComponent(this._oView);this._oPageComponent=l.getOwnerComponentFor(this._oView);this._oRouter=this._oAppComponent.getRouter();this._oRouterProxy=this._oAppComponent.getRouterProxy();if(!this._oAppComponent||!this._oPageComponent){throw new Error("Failed to initialize controler extension 'sap.fe.core.controllerextesions.InternalRouting")}if(this._oAppComponent===this._oPageComponent){this._oPageComponent=null}this._oAppComponent.getService("routingService").then(t=>{this._oRoutingService=t;this._fnRouteMatchedBound=this._onRouteMatched.bind(this);this._oRoutingService.attachRouteMatched(this._fnRouteMatchedBound);this._oTargetInformation=t.getTargetInformationFor(this._oPageComponent||this._oView)}).catch(function(){throw new Error("This controller extension cannot work without a 'routingService' on the main AppComponent")})};u.onRouteMatched=function t(){};u.onRouteMatchedFinished=function t(){};u.onBeforeBinding=function t(e,o){const n=this.base.getView().getController().routing;if(n&&n.onBeforeBinding){n.onBeforeBinding(e,o)}};u.onAfterBinding=function t(e,o){this._oAppComponent.getRootViewController().onContextBoundToView(e);const n=this.base.getView().getController().routing;if(n&&n.onAfterBinding){n.onAfterBinding(e,o)}};u.navigateToTarget=function t(e,o,n){const i=this._oPageComponent&&this._oPageComponent.getNavigationConfiguration&&this._oPageComponent.getNavigationConfiguration(o);if(i){const t=i.detail;const o=t.route;const r=t.parameters;this._oRoutingService.navigateTo(e,o,r,n)}else{this._oRoutingService.navigateTo(e,null,null,n)}this._oView.getViewData()};u.navigateToRoute=function t(e,o){return this._oRoutingService.navigateToRoute(e,o)};u.navigateToContext=function e(o,n){const i={};n=n||{};if(o.isA("sap.ui.model.odata.v4.ODataListBinding")){if(n.asyncContext){this._oRouterProxy.activateRouteMatchSynchronization();n.asyncContext.then(t=>{this.navigateToContext(t,{checkNoHashChange:n.checkNoHashChange,editable:n.editable,bPersistOPScroll:n.bPersistOPScroll,updateFCLLevel:n.updateFCLLevel,bForceFocus:n.bForceFocus})}).catch(function(e){t.error("Error with the async context",e)})}else if(!n.bDeferredContext){throw"navigation to a list binding is not yet supported"}}if(n.callExtension){const t=this._oView.getModel("internal");t.setProperty("/paginatorCurrentContext",null);i.sourceBindingContext=o.getObject();i.bindingContext=o;if(n.oEvent){i.oEvent=n.oEvent}const e=this.base.getView().getController().routing.onBeforeNavigation(i);if(e){t.setProperty("/paginatorCurrentContext",o);return Promise.resolve(true)}}n.FCLLevel=this._getFCLLevel();return this._oRoutingService.navigateToContext(o,n,this._oView.getViewData(),this._oTargetInformation)};u.navigateBackFromContext=function t(e,o){o=o||{};o.updateFCLLevel=-1;return this.navigateToContext(e,o)};u.navigateForwardToContext=function t(e,o){var n;if(((n=this._oView.getBindingContext("internal"))===null||n===void 0?void 0:n.getProperty("messageFooterContainsErrors"))===true){return Promise.resolve(true)}o=o||{};o.updateFCLLevel=1;return this.navigateToContext(e,o)};u.navigateBackFromTransientState=function t(){const e=this._oRouterProxy.getHash();if(e.indexOf("(...)")!==-1){this._oRouterProxy.navBack()}};u.navigateToMessagePage=function t(e,o){o=o||{};if(this._oRouterProxy.getHash().indexOf("i-action=create")>-1||this._oRouterProxy.getHash().indexOf("i-action=autoCreate")>-1){return this._oRouterProxy.navToHash(this._oRoutingService.getDefaultCreateHash())}else{o.FCLLevel=this._getFCLLevel();return this._oAppComponent.getRootViewController().displayErrorPage(e,o)}};u.isCurrentStateImpactedBy=function t(e){return this._oRoutingService.isCurrentStateImpactedBy(e)};u._isViewPartOfRoute=function t(e){const o=e===null||e===void 0?void 0:e.targets;if(!o||o.indexOf(this._oTargetInformation.targetName)===-1){if((this._oTargetInformation.viewLevel??0)>=((e===null||e===void 0?void 0:e.routeLevel)??0)){this._setBindingContext(null)}return false}return true};u._buildBindingPath=function t(e,o,n){let i=o.replace(":?query:","");let r=false;for(const t in e){const a=e[t];if(a==="..."&&o.indexOf(`{${t}}`)>=0){r=true;n.bTargetEditable=true}i=i.replace(`{${t}}`,a)}if(e["?query"]&&e["?query"].hasOwnProperty("i-action")){n.bActionCreate=true}if(i&&i[0]!=="/"){i=`/${i}`}return{path:i,deferred:r}};u._onRouteMatched=function t(e){if(!this._isViewPartOfRoute(e.getParameter("routeInformation"))){return}let o;if(this._oPageComponent&&this._oPageComponent.getBindingContextPattern){o=this._oPageComponent.getBindingContextPattern()}o=o||this._oTargetInformation.contextPattern;if(o===null||o===undefined){o=e.getParameter("routePattern")}const n=e.getParameters().arguments;const i=e.getParameter("navigationInfo");const{path:r,deferred:a}=this._buildBindingPath(n,o,i);this.onRouteMatched();const s=this._oView.getModel();let c;if(a){c=this._bindDeferred(r,i)}else{c=this._bindPage(r,s,i)}c.finally(()=>{this.onRouteMatchedFinished()});this._oAppComponent.getRootViewController().updateUIStateForView(this._oView,this._getFCLLevel())};u._bindDeferred=function t(e,o){this.onBeforeBinding(null,{editable:o.bTargetEditable});if(o.bDeferredContext||!o.oAsyncContext){if(this._oPageComponent&&this._oPageComponent.createDeferredContext){this._oPageComponent.createDeferredContext(e,o.useContext,o.bActionCreate)}}const n=this._getBindingContext();if(n!==null&&n!==void 0&&n.hasPendingChanges()){n.getBinding().resetChanges()}this._setBindingContext(null);this.onAfterBinding(null);return Promise.resolve()};u._bindPage=function t(e,o,n){if(e===""){return Promise.resolve(this._bindPageToContext(null,o,n))}else{return this._resolveSemanticPath(e,o).then(t=>{this._bindPageToPath(t,o,n)}).catch(t=>{const e=p.getLibraryResourceBundle("sap.fe.core");this.navigateToMessagePage(e.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),{title:e.getText("C_COMMON_SAPFE_ERROR"),description:t.message})})}};u._createFilterFromSemanticPath=function t(e,o,n){const i=function(t){if(t.indexOf("'")===0&&t.lastIndexOf("'")===t.length-1){t=decodeURIComponent(t.substring(1,t.length-1))}return t};const r=e.substring(e.indexOf("(")+1,e.length-1).split(",");let a;if(o.length!=r.length){return null}const s=c.isFilteringCaseSensitive(n);if(o.length===1){const t=i(r[0]);a=[new f({path:o[0].$PropertyPath,operator:d.EQ,value1:t,caseSensitive:s})]}else{const t={};r.forEach(function(e){const o=e.split("="),n=i(o[1]);t[o[0]]=n});let e=false;a=o.map(function(o){const n=o.$PropertyPath,i=t[n];if(i!==undefined){return new f({path:n,operator:d.EQ,value1:i,caseSensitive:s})}else{e=true;return new f({path:"XX"})}});if(e){return null}}const g=new f({filters:[new f("IsActiveEntity","EQ",false),new f("SiblingEntity/IsActiveEntity","EQ",null)],and:false});a.push(g);return new f(a,true)};u._getTechnicalPathFromSemanticPath=function t(e,o,n){var i;const r=o.getMetaModel();let a=r.getMetaContext(e).getPath();if(!n||n.length===0){return Promise.resolve(null)}const s=this._createFilterFromSemanticPath(e,n,r);if(s===null){return Promise.resolve(null)}if(!((i=a)!==null&&i!==void 0&&i.startsWith("/"))){a=`/${a}`}const c=o.bindList(a,undefined,undefined,s,{$$groupId:"$auto.Heroes"});return c.requestContexts(0,2).then(function(t){if(t&&t.length){return t[0].getPath()}else{return null}})};u._checkPathForSemanticBookmarking=function t(e,o){const n=/^[/]?(\w+)\([^/]+\)$/.exec(e);if(!n){return false}const i=`/${n[1]}`;const r=o.getObject(`${i}@com.sap.vocabularies.Common.v1.DraftRoot`);const a=o.getObject(`${i}@com.sap.vocabularies.Common.v1.DraftNode`);return r||a?true:false};u._resolveSemanticPath=function t(e,o){const n=o.getMetaModel();const i=this._oRoutingService.getLastSemanticMapping();let r=this._oRouter.getHashChanger().getHash().split("?")[0];if(r&&r.lastIndexOf("/")===r.length-1){r=r.substring(0,r.length-1)}let a=r&&r.substr(0,r.indexOf("("));if(a.indexOf("/")===0){a=a.substring(1)}const s=this._checkPathForSemanticBookmarking(r,n),c=s&&g.getSemanticKeys(n,a);if(!c){return Promise.resolve(e)}else if(i&&i.semanticPath===e){return Promise.resolve(i.technicalPath)}else{return this._getTechnicalPathFromSemanticPath(r,o,c).then(t=>{if(t&&t!==e){this._oRoutingService.setLastSemanticMapping({technicalPath:t,semanticPath:e});return t}else{return e}})}};u._bindPageToPath=function t(e,o,n){const i=this._getBindingContext(),a=i&&i.getPath(),g=n.useContext;if(g&&g.getPath()===e){if(g!==i){const t=this._oAppComponent.getRootViewController();if(t.isFclEnabled()&&n.reason===r.RowPress){const t=g.getModel().getMetaModel();if(!g.getBinding().hasPendingChanges()){g.refresh()}else if(Z(this.getView())||c.isDraftSupported(t,g.getPath())&&c.isCollaborationDraftSupported(t)){g.getBinding().resetChanges();g.refresh()}}this._bindPageToContext(g,o,n)}}else if(a!==e){this._bindPageToContext(this._createContext(e,o),o,n)}else if(n.reason!==r.AppStateChanged&&s.isEditStateDirty()){this._refreshBindingContext(i)}};u._bindPageToContext=function e(o,n,i){if(!o){this.onBeforeBinding(null);this.onAfterBinding(null);return}const r=o.getBinding();const a=this._oAppComponent.getRootViewController();if(a.isFclEnabled()){if(!r||!r.isA("sap.ui.model.odata.v4.ODataListBinding")){o=this._createContext(o.getPath(),n)}try{this._setKeepAlive(o,true,()=>{if(a.isContextUsedInPages(o)){this.navigateBackFromContext(o)}},true)}catch(e){t.error(`View for ${o.getPath()} won't be synchronized. Parent listBinding must have binding parameter $$ownRequest=true`)}}else if(!r||r.isA("sap.ui.model.odata.v4.ODataListBinding")){o=this._createContext(o.getPath(),n)}this.onBeforeBinding(o,{editable:i.bTargetEditable,listBinding:r,bPersistOPScroll:i.bPersistOPScroll,bDraftNavigation:i.bDraftNavigation,showPlaceholder:i.bShowPlaceholder});this._setBindingContext(o);this.onAfterBinding(o)};u._createContext=function e(n,i){const r=this._oPageComponent,a=r&&r.getEntitySet&&r.getEntitySet(),s=r&&r.getContextPath&&r.getContextPath()||a&&`/${a}`,c=i.getMetaModel(),g={$$groupId:"$auto.Heroes",$$updateGroupId:"$auto",$$patchWithoutSideEffects:true};const l=c.getObject(`${s}@com.sap.vocabularies.Common.v1.DraftRoot`);const p=c.getObject(`${s}@com.sap.vocabularies.Common.v1.DraftNode`);const u=this._oAppComponent.getRootViewController();if(u.isFclEnabled()){const t=this._getKeepAliveContext(i,n,false,g);if(!t){throw new Error(`Cannot create keepAlive context ${n}`)}else if(l||p){if(t.getProperty("IsActiveEntity")===undefined){t.requestProperty(["HasActiveEntity","HasDraftEntity","IsActiveEntity"]);if(l){t.requestObject("DraftAdministrativeData")}}else{t.requestSideEffects(l?["HasActiveEntity","HasDraftEntity","IsActiveEntity","DraftAdministrativeData"]:["HasActiveEntity","HasDraftEntity","IsActiveEntity"])}}return t}else{if(a){const t=c.getObject(`${s}/@com.sap.vocabularies.Common.v1.Messages/$Path`);if(t){g.$select=t}}if(l||p){if(g.$select===undefined){g.$select="HasActiveEntity,HasDraftEntity,IsActiveEntity"}else{g.$select+=",HasActiveEntity,HasDraftEntity,IsActiveEntity"}}if(this._oView.getBindingContext()){var h;const e=(h=this._oView.getBindingContext())===null||h===void 0?void 0:h.getBinding();e===null||e===void 0?void 0:e.resetChanges().then(()=>{e.destroy()}).catch(e=>{t.error("Error while reseting the changes to the binding",e)})}const e=i.bindContext(n,undefined,g);e.attachEventOnce("dataRequested",()=>{o.lock(this._oView)});e.attachEventOnce("dataReceived",this.onDataReceived.bind(this));return e.getBoundContext()}};u.onDataReceived=async function e(n){const i=n&&n.getParameter("error");if(o.isLocked(this._oView)){o.unlock(this._oView)}if(i){try{const t=await p.getLibraryResourceBundle("sap.fe.core",true);const e=this.base.messageHandler;let o={};if(i.status===503){o={isInitialLoad503Error:true,shellBack:true}}else if(i.status===400){o={title:t.getText("C_COMMON_SAPFE_ERROR"),description:t.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR_DESCRIPTION"),isDataReceivedError:true,shellBack:true}}else{o={title:t.getText("C_COMMON_SAPFE_ERROR"),description:i,isDataReceivedError:true,shellBack:true}}await e.showMessages(o)}catch(e){t.error("Error while getting the core resource bundle",e)}}};u._refreshBindingContext=function t(e){const o=this._oPageComponent;const n=this._oAppComponent.getSideEffectsService();const i=e.getPath();const r=o&&o.getEntitySet&&o.getEntitySet();const a=o&&o.getContextPath&&o.getContextPath()||r&&`/${r}`;const s=this._oView.getModel().getMetaModel();let c;const g=[];const l=[];const p={targetProperties:[],targetEntities:[]};function u(t){let e;const o=(t.getContext()&&t.getContext().getPath()||"").replace(i,"");const n=(o?`${o.slice(1)}/`:o)+t.getPath();if(t.isA("sap.ui.model.odata.v4.ODataContextBinding")){e=t.getDependentBindings();if(e){for(let t=0;t<e.length;t++){u(e[t])}}else if(g.indexOf(n)===-1){g.push(n)}}else if(t.isA("sap.ui.model.odata.v4.ODataListBinding")){if(g.indexOf(n)===-1){g.push(n)}}else if(t.isA("sap.ui.model.odata.v4.ODataPropertyBinding")){if(l.indexOf(n)===-1){l.push(n)}}}if(a){c=s.getObject(`${a}/@com.sap.vocabularies.Common.v1.Messages/$Path`)}u(e.getBinding());let h;for(h=0;h<g.length;h++){p.targetEntities.push({$NavigationPropertyPath:g[h]})}p.targetProperties=l;if(c){p.targetProperties.push(c)}p.targetProperties=p.targetProperties.reduce((t,e)=>{if(e){const o=e.indexOf("/");t.push(o>0?e.slice(0,o):e)}return t},[]);n.requestSideEffects([...p.targetEntities,...p.targetProperties],e)};u._getBindingContext=function t(){if(this._oPageComponent){return this._oPageComponent.getBindingContext()}else{return this._oView.getBindingContext()}};u._setBindingContext=function t(e){var o;let n,i;if(this._oPageComponent){n=this._oPageComponent.getBindingContext();i=this._oPageComponent}else{n=this._oView.getBindingContext();i=this._oView}i.setBindingContext(e);if((o=n)!==null&&o!==void 0&&o.isKeepAlive()&&n!==e){this._setKeepAlive(n,false)}};u._getFCLLevel=function t(){return this._oTargetInformation.FCLLevel};u._setKeepAlive=function t(e,o,n,i){if(e.getPath().endsWith(")")){const t=e.getModel().getMetaModel();const r=t.getMetaPath(e.getPath());const a=t.getObject(`${r}/@com.sap.vocabularies.Common.v1.Messages/$Path`);e.setKeepAlive(o,n,!!a&&i)}};u._getKeepAliveContext=function t(e,o,n,i){const r=o.split("/");const a=[];while(r.length&&!r[r.length-1].endsWith(")")){a.push(r.pop())}if(r.length===0){return undefined}const s=r.join("/");const c=e.getKeepAliveContext(s,n,i);if(a.length===0){return c}else{a.reverse();const t=a.join("/");return e.bindContext(t,c).getBoundContext()}};u.switchFullScreen=function e(){const o=this.base.getView();const n=o.getModel("fclhelper"),i=n.getProperty("/actionButtonsInfo/isFullScreen"),r=n.getProperty(i?"/actionButtonsInfo/exitFullScreen":"/actionButtonsInfo/fullScreen"),a=this._oAppComponent.getRootViewController();const s=a.getRightmostContext?a.getRightmostContext():o.getBindingContext();this.base._routing.navigateToContext(s,{sLayout:r}).catch(function(){t.warning("cannot switch between column and fullscreen")})};u.closeColumn=function t(){const e=this._oView.getViewData();const o=this._oView.getBindingContext();const n=o.getModel().getMetaModel();const r={noPreservationCache:true,sLayout:this._oView.getModel("fclhelper").getProperty("/actionButtonsInfo/closeColumn")};if((e===null||e===void 0?void 0:e.viewLevel)===1&&c.isDraftSupported(n,o.getPath())){i.processDataLossOrDraftDiscardConfirmation(()=>{this.navigateBackFromContext(o,r)},Function.prototype,o,this._oView.getController(),false,i.NavigationType.BackNavigation)}else{this.navigateBackFromContext(o,r)}};return a}(u),ot(Q.prototype,"onExit",[v],Object.getOwnPropertyDescriptor(Q.prototype,"onExit"),Q.prototype),ot(Q.prototype,"onInit",[P],Object.getOwnPropertyDescriptor(Q.prototype,"onInit"),Q.prototype),ot(Q.prototype,"onRouteMatched",[_,y],Object.getOwnPropertyDescriptor(Q.prototype,"onRouteMatched"),Q.prototype),ot(Q.prototype,"onRouteMatchedFinished",[m,x],Object.getOwnPropertyDescriptor(Q.prototype,"onRouteMatchedFinished"),Q.prototype),ot(Q.prototype,"onBeforeBinding",[b,w],Object.getOwnPropertyDescriptor(Q.prototype,"onBeforeBinding"),Q.prototype),ot(Q.prototype,"onAfterBinding",[O,B],Object.getOwnPropertyDescriptor(Q.prototype,"onAfterBinding"),Q.prototype),ot(Q.prototype,"navigateToTarget",[R],Object.getOwnPropertyDescriptor(Q.prototype,"navigateToTarget"),Q.prototype),ot(Q.prototype,"navigateToRoute",[E],Object.getOwnPropertyDescriptor(Q.prototype,"navigateToRoute"),Q.prototype),ot(Q.prototype,"navigateToContext",[S,A],Object.getOwnPropertyDescriptor(Q.prototype,"navigateToContext"),Q.prototype),ot(Q.prototype,"navigateBackFromContext",[D,F],Object.getOwnPropertyDescriptor(Q.prototype,"navigateBackFromContext"),Q.prototype),ot(Q.prototype,"navigateForwardToContext",[M,T],Object.getOwnPropertyDescriptor(Q.prototype,"navigateForwardToContext"),Q.prototype),ot(Q.prototype,"navigateBackFromTransientState",[V,I],Object.getOwnPropertyDescriptor(Q.prototype,"navigateBackFromTransientState"),Q.prototype),ot(Q.prototype,"navigateToMessagePage",[L,$],Object.getOwnPropertyDescriptor(Q.prototype,"navigateToMessagePage"),Q.prototype),ot(Q.prototype,"isCurrentStateImpactedBy",[j,k],Object.getOwnPropertyDescriptor(Q.prototype,"isCurrentStateImpactedBy"),Q.prototype),ot(Q.prototype,"onDataReceived",[H],Object.getOwnPropertyDescriptor(Q.prototype,"onDataReceived"),Q.prototype),ot(Q.prototype,"switchFullScreen",[N,q],Object.getOwnPropertyDescriptor(Q.prototype,"switchFullScreen"),Q.prototype),ot(Q.prototype,"closeColumn",[K,z],Object.getOwnPropertyDescriptor(Q.prototype,"closeColumn"),Q.prototype),Q))||U);return nt},false);
|
|
150
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/InternalRouting", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/routing/NavigationReason","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/ui/core/Component","sap/ui/core/Core","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/model/Filter","sap/ui/model/FilterOperator"],function(t,e,o,n,i,r,a,s,c,l,g,p,u,h,d,f){"use strict";var v,C,y,P,_,m,x,b,w,O,B,R,E,A,D,S,T,M,F,I,V,$,L,j,H,k,N,K,q,z,U,W;var Q=a.publicExtension;var X=a.methodOverride;var G=a.finalExtension;var J=a.extensible;var Y=a.defineUI5Class;function Z(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;tt(t,e)}function tt(t,e){tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return tt(t,e)}function et(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}let ot=(v=Y("sap.fe.core.controllerextensions.InternalRouting"),C=X(),y=X(),P=Q(),_=J(h.After),m=Q(),x=J(h.After),b=Q(),w=J(h.After),O=Q(),B=J(h.After),R=Q(),E=Q(),A=Q(),D=G(),S=Q(),T=G(),M=Q(),F=G(),I=Q(),V=G(),$=Q(),L=G(),j=Q(),H=G(),k=Q(),N=Q(),K=G(),q=Q(),z=J(h.Before),v(U=(W=function(a){Z(u,a);function u(){return a.apply(this,arguments)||this}var h=u.prototype;h.onExit=function t(){if(this._oRoutingService){this._oRoutingService.detachRouteMatched(this._fnRouteMatchedBound)}};h.onInit=function t(){this._oView=this.base.getView();this._oAppComponent=e.getAppComponent(this._oView);this._oPageComponent=g.getOwnerComponentFor(this._oView);this._oRouter=this._oAppComponent.getRouter();this._oRouterProxy=this._oAppComponent.getRouterProxy();if(!this._oAppComponent||!this._oPageComponent){throw new Error("Failed to initialize controler extension 'sap.fe.core.controllerextesions.InternalRouting")}if(this._oAppComponent===this._oPageComponent){this._oPageComponent=null}this._oAppComponent.getService("routingService").then(t=>{this._oRoutingService=t;this._fnRouteMatchedBound=this._onRouteMatched.bind(this);this._oRoutingService.attachRouteMatched(this._fnRouteMatchedBound);this._oTargetInformation=t.getTargetInformationFor(this._oPageComponent||this._oView)}).catch(function(){throw new Error("This controller extension cannot work without a 'routingService' on the main AppComponent")})};h.onRouteMatched=function t(){};h.onRouteMatchedFinished=function t(){};h.onBeforeBinding=function t(e,o){const n=this.base.getView().getController().routing;if(n&&n.onBeforeBinding){n.onBeforeBinding(e,o)}};h.onAfterBinding=function t(e,o){this._oAppComponent.getRootViewController().onContextBoundToView(e);const n=this.base.getView().getController().routing;if(n&&n.onAfterBinding){n.onAfterBinding(e,o)}};h.navigateToTarget=function t(e,o,n){const i=this._oPageComponent&&this._oPageComponent.getNavigationConfiguration&&this._oPageComponent.getNavigationConfiguration(o);if(i){const t=i.detail;const o=t.route;const r=t.parameters;this._oRoutingService.navigateTo(e,o,r,n)}else{this._oRoutingService.navigateTo(e,null,null,n)}this._oView.getViewData()};h.navigateToRoute=function t(e,o){return this._oRoutingService.navigateToRoute(e,o)};h.navigateToContext=function e(o,n){const i={};n=n||{};if(o.isA("sap.ui.model.odata.v4.ODataListBinding")){if(n.asyncContext){this._oRouterProxy.activateRouteMatchSynchronization();n.asyncContext.then(t=>{this.navigateToContext(t,{checkNoHashChange:n.checkNoHashChange,editable:n.editable,bPersistOPScroll:n.bPersistOPScroll,updateFCLLevel:n.updateFCLLevel,bForceFocus:n.bForceFocus})}).catch(function(e){t.error("Error with the async context",e)})}else if(!n.bDeferredContext){throw"navigation to a list binding is not yet supported"}}if(n.callExtension){const t=this._oView.getModel("internal");t.setProperty("/paginatorCurrentContext",null);i.sourceBindingContext=o.getObject();i.bindingContext=o;if(n.oEvent){i.oEvent=n.oEvent}const e=this.base.getView().getController().routing.onBeforeNavigation(i);if(e){t.setProperty("/paginatorCurrentContext",o);return Promise.resolve(true)}}n.FCLLevel=this._getFCLLevel();return this._oRoutingService.navigateToContext(o,n,this._oView.getViewData(),this._oTargetInformation)};h.navigateBackFromContext=function t(e,o){o=o||{};o.updateFCLLevel=-1;return this.navigateToContext(e,o)};h.navigateForwardToContext=function t(e,o){var n;if(((n=this._oView.getBindingContext("internal"))===null||n===void 0?void 0:n.getProperty("messageFooterContainsErrors"))===true){return Promise.resolve(true)}o=o||{};o.updateFCLLevel=1;return this.navigateToContext(e,o)};h.navigateBackFromTransientState=function t(){const e=this._oRouterProxy.getHash();if(e.indexOf("(...)")!==-1){this._oRouterProxy.navBack()}};h.navigateToMessagePage=function t(e,o){o=o||{};if(this._oRouterProxy.getHash().indexOf("i-action=create")>-1||this._oRouterProxy.getHash().indexOf("i-action=autoCreate")>-1){return this._oRouterProxy.navToHash(this._oRoutingService.getDefaultCreateHash())}else{o.FCLLevel=this._getFCLLevel();return this._oAppComponent.getRootViewController().displayErrorPage(e,o)}};h.isCurrentStateImpactedBy=function t(e){return this._oRoutingService.isCurrentStateImpactedBy(e)};h._isViewPartOfRoute=function t(e){const o=e===null||e===void 0?void 0:e.targets;if(!o||o.indexOf(this._oTargetInformation.targetName)===-1){if((this._oTargetInformation.viewLevel??0)>=((e===null||e===void 0?void 0:e.routeLevel)??0)){this._setBindingContext(null)}return false}return true};h._buildBindingPath=function t(e,o,n){let i=o.replace(":?query:","");let r=false;for(const t in e){const a=e[t];if(typeof a!=="string"){continue}if(a==="..."&&o.indexOf(`{${t}}`)>=0){r=true;n.bTargetEditable=true}i=i.replace(`{${t}}`,a)}if(e["?query"]&&e["?query"].hasOwnProperty("i-action")){n.bActionCreate=true}if(i&&i[0]!=="/"){i=`/${i}`}return{path:i,deferred:r}};h._onRouteMatched=function t(e){if(!this._isViewPartOfRoute(e.getParameter("routeInformation"))){return}let o;if(this._oPageComponent&&this._oPageComponent.getBindingContextPattern){o=this._oPageComponent.getBindingContextPattern()}o=o||this._oTargetInformation.contextPattern;if(o===null||o===undefined){o=e.getParameter("routePattern")}const n=e.getParameters().arguments;const i=e.getParameter("navigationInfo");const{path:r,deferred:a}=this._buildBindingPath(n,o,i);this.onRouteMatched();const s=this._oView.getModel();let c;if(a){c=this._bindDeferred(r,i)}else{c=this._bindPage(r,s,i)}c.finally(()=>{this.onRouteMatchedFinished()});this._oAppComponent.getRootViewController().updateUIStateForView(this._oView,this._getFCLLevel())};h._bindDeferred=async function t(e,o){this.onBeforeBinding(null,{editable:o.bTargetEditable});if(o.bDeferredContext||!o.oAsyncContext){if(this._oPageComponent&&this._oPageComponent.createDeferredContext){this._oPageComponent.createDeferredContext(e,o.listBindingForCreate,!!o.bActionCreate)}}const n=this._getBindingContext();if(n!==null&&n!==void 0&&n.hasPendingChanges()){n.getBinding().resetChanges()}this._setBindingContext(null);this.onAfterBinding(null);return Promise.resolve()};h._bindPage=function t(e,o,n){if(e===""){return Promise.resolve(this._bindPageToContext(null,o,n))}return this.resolvePath(e,o,n).then(t=>{this._bindPageToPath(t,o,n)}).catch(t=>{const e=p.getLibraryResourceBundle("sap.fe.core");this.navigateToMessagePage(e.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),{title:e.getText("C_COMMON_SAPFE_ERROR"),description:t.message})})};h.createFilterFromPath=function t(e,o,n){const i=function(t){if(t.indexOf("'")===0&&t.lastIndexOf("'")===t.length-1){t=decodeURIComponent(t.substring(1,t.length-1))}return t};const r=e.substring(e.indexOf("(")+1,e.length-1).split(",");let a=o;let s=r;if(o.includes("IsActiveEntity")){a=o.filter(t=>t.indexOf("IsActiveEntity")<0);s=r.filter(t=>!t.startsWith("IsActiveEntity"))}if(a.length!=s.length){return null}const l=c.isFilteringCaseSensitive(n);let g;if(a.length===1){if(s[0].indexOf("=")>0){const t=s[0].split("=");s[0]=t[1]}const t=i(s[0]);g=[new d({path:a[0],operator:f.EQ,value1:t,caseSensitive:l})]}else{const t={};s.forEach(function(e){const o=e.split("="),n=i(o[1]);t[o[0]]=n});let e=false;g=a.map(function(o){const n=o,i=t[n];if(i!==undefined){return new d({path:n,operator:f.EQ,value1:i,caseSensitive:l})}else{e=true;return new d({path:"XX"})}});if(e){return null}}const p=new d({filters:[new d("IsActiveEntity","EQ",false),new d("SiblingEntity/IsActiveEntity","EQ",null)],and:false});g.push(p);return new d(g,true)};h.getTechnicalPathFromPath=async function t(e,o,n){var i;const r=o.getMetaModel();let a=r.getMetaContext(e).getPath();if(!n||n.length===0){return null}const s=this.createFilterFromPath(e,n,r);if(s===null){return null}if(!((i=a)!==null&&i!==void 0&&i.startsWith("/"))){a=`/${a}`}const c=o.bindList(a,undefined,undefined,s,{$$groupId:"$auto.Heroes"});const l=await c.requestContexts(0,2);if(l.length){return l[0].getPath()}else{return null}};h.refreshContext=async function t(e,o,n){const i=this._oAppComponent.getRootViewController();if(i.isFclEnabled()){const t=e.getKeepAliveContext(o);n.replaceWith(t)}else{s.setEditStateDirty()}};h.checkDraftAvailability=function t(e,o){const n=/^[/]?(\w+)\([^/]+\)$/.exec(e);if(!n){return false}const i=`/${n[1]}`;const r=o.getObject(`${i}@com.sap.vocabularies.Common.v1.DraftRoot`);return r?true:false};h.resolvePath=async function t(e,o,n){var i,r,a;const s=o.getMetaModel();const g=this._oRoutingService.getLastSemanticMapping();let p=this._oRouter.getHashChanger().getHash().split("?")[0];if(((i=p)===null||i===void 0?void 0:i.lastIndexOf("/"))===((r=p)===null||r===void 0?void 0:r.length)-1){p=p.substring(0,p.length-1)}let u=(a=p)===null||a===void 0?void 0:a.substr(0,p.indexOf("("));if(u.indexOf("/")===0){u=u.substring(1)}const h=this.checkDraftAvailability(p,s),d=h?l.getSemanticKeys(s,u):undefined,f=c.isCollaborationDraftSupported(s);if(h&&f){var v;const t=(n===null||n===void 0?void 0:(v=n.useContext)===null||v===void 0?void 0:v.getProperty("IsActiveEntity"))??true;if(!t){return this.resolveCollaborationPath(e,o,n,d,u)}}if(d===undefined){return e}if((g===null||g===void 0?void 0:g.semanticPath)===e){return g.technicalPath}const C=d.map(t=>t.$PropertyPath);const y=await this.getTechnicalPathFromPath(p,o,C);if(y&&y!==e){this._oRoutingService.setLastSemanticMapping({technicalPath:y,semanticPath:e});return y}return e};h.resolveCollaborationPath=async function t(e,o,n,i,r){const a=this._oRoutingService.getLastSemanticMapping();const s=o.getMetaModel();const c=this._oRouter.getHashChanger().getHash().split("?")[0];let l;const g=(a===null||a===void 0?void 0:a.technicalPath)??e;if(i){l=i.map(t=>t.$PropertyPath)}else{l=s.getObject(`/${r}/$Type/$Key`)}const p=await this.getTechnicalPathFromPath(c,o,l);if(p===null){return e}if(p!==g&&n.useContext){var u;if(a){this._oRoutingService.setLastSemanticMapping({technicalPath:p,semanticPath:e})}n.redirectedToNonDraft=((u=s.getObject(`/${r}/@com.sap.vocabularies.UI.v1.HeaderInfo`))===null||u===void 0?void 0:u.TypeName)??r;await this.refreshContext(o,p,n.useContext)}return p};h._bindPageToPath=function t(e,o,i){const a=this._getBindingContext(),l=a&&a.getPath(),g=i.useContext;if(g&&g.getPath()===e){if(g!==a){let t=false;const e=this._oAppComponent.getRootViewController();if(e.isFclEnabled()&&i.reason===r.RowPress){const e=g.getModel().getMetaModel();if(!g.getBinding().hasPendingChanges()){t=true}else if(n.isConnected(this.getView())||c.isDraftSupported(e,g.getPath())&&c.isCollaborationDraftSupported(e)){g.getBinding().resetChanges();t=true}}this._bindPageToContext(g,o,i);if(t){g.refresh()}}}else if(l!==e){this._bindPageToContext(this._createContext(e,o),o,i)}else if(i.reason!==r.AppStateChanged&&s.isEditStateDirty()){this._refreshBindingContext(a)}};h._bindPageToContext=function e(o,n,i){if(!o){this.onBeforeBinding(null);this.onAfterBinding(null);return}const r=o.getBinding();const a=this._oAppComponent.getRootViewController();if(a.isFclEnabled()){if(!r||!r.isA("sap.ui.model.odata.v4.ODataListBinding")){o=this._createContext(o.getPath(),n)}try{this._setKeepAlive(o,true,()=>{if(a.isContextUsedInPages(o)){this.navigateBackFromContext(o)}},true)}catch(e){t.error(`View for ${o.getPath()} won't be synchronized. Parent listBinding must have binding parameter $$ownRequest=true`)}}else if(!r||r.isA("sap.ui.model.odata.v4.ODataListBinding")){o=this._createContext(o.getPath(),n)}this.onBeforeBinding(o,{editable:i.bTargetEditable,listBinding:r,bPersistOPScroll:i.bPersistOPScroll,bDraftNavigation:i.bDraftNavigation,showPlaceholder:i.bShowPlaceholder});this._setBindingContext(o);this.onAfterBinding(o,{redirectedToNonDraft:i===null||i===void 0?void 0:i.redirectedToNonDraft})};h._createContext=function e(n,i){const r=this._oPageComponent,a=r&&r.getEntitySet&&r.getEntitySet(),s=r&&r.getContextPath&&r.getContextPath()||a&&`/${a}`,c=i.getMetaModel(),l={$$groupId:"$auto.Heroes",$$updateGroupId:"$auto",$$patchWithoutSideEffects:true};const g=c.getObject(`${s}@com.sap.vocabularies.Common.v1.DraftRoot`);const p=c.getObject(`${s}@com.sap.vocabularies.Common.v1.DraftNode`);const u=this._oAppComponent.getRootViewController();if(u.isFclEnabled()){const t=this._getKeepAliveContext(i,n,false,l);if(!t){throw new Error(`Cannot create keepAlive context ${n}`)}else if(g||p){if(t.getProperty("IsActiveEntity")===undefined){t.requestProperty(["HasActiveEntity","HasDraftEntity","IsActiveEntity"]);if(g){t.requestObject("DraftAdministrativeData")}}else{t.requestSideEffects(g?["HasActiveEntity","HasDraftEntity","IsActiveEntity","DraftAdministrativeData"]:["HasActiveEntity","HasDraftEntity","IsActiveEntity"])}}return t}else{if(a){const t=c.getObject(`${s}/@com.sap.vocabularies.Common.v1.Messages/$Path`);if(t){l.$select=t}}if(g||p){if(l.$select===undefined){l.$select="HasActiveEntity,HasDraftEntity,IsActiveEntity"}else{l.$select+=",HasActiveEntity,HasDraftEntity,IsActiveEntity"}}if(this._oView.getBindingContext()){var h;const e=(h=this._oView.getBindingContext())===null||h===void 0?void 0:h.getBinding();e===null||e===void 0?void 0:e.resetChanges().then(()=>{e.destroy()}).catch(e=>{t.error("Error while reseting the changes to the binding",e)})}const e=i.bindContext(n,undefined,l);e.attachEventOnce("dataRequested",()=>{o.lock(this._oView)});e.attachEventOnce("dataReceived",this.onDataReceived.bind(this));return e.getBoundContext()}};h.onDataReceived=async function e(n){const i=n&&n.getParameter("error");if(o.isLocked(this._oView)){o.unlock(this._oView)}if(i){try{const t=await p.getLibraryResourceBundle("sap.fe.core",true);const e=this.base.messageHandler;let o={};if(i.status===503){o={isInitialLoad503Error:true,shellBack:true}}else if(i.status===400){o={title:t.getText("C_COMMON_SAPFE_ERROR"),description:t.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR_DESCRIPTION"),isDataReceivedError:true,shellBack:true}}else{o={title:t.getText("C_COMMON_SAPFE_ERROR"),description:i,isDataReceivedError:true,shellBack:true}}await e.showMessages(o)}catch(e){t.error("Error while getting the core resource bundle",e)}}};h._refreshBindingContext=function t(e){const o=this._oPageComponent;const n=this._oAppComponent.getSideEffectsService();const i=e.getPath();const r=o&&o.getEntitySet&&o.getEntitySet();const a=o&&o.getContextPath&&o.getContextPath()||r&&`/${r}`;const s=this._oView.getModel().getMetaModel();let c;const l=[];const g=[];const p={targetProperties:[],targetEntities:[]};function u(t){let e;const o=(t.getContext()&&t.getContext().getPath()||"").replace(i,"");const n=(o?`${o.slice(1)}/`:o)+t.getPath();if(t.isA("sap.ui.model.odata.v4.ODataContextBinding")){e=t.getDependentBindings();if(e){for(let t=0;t<e.length;t++){u(e[t])}}else if(l.indexOf(n)===-1){l.push(n)}}else if(t.isA("sap.ui.model.odata.v4.ODataListBinding")){if(l.indexOf(n)===-1){l.push(n)}}else if(t.isA("sap.ui.model.odata.v4.ODataPropertyBinding")){if(g.indexOf(n)===-1){g.push(n)}}}if(a){c=s.getObject(`${a}/@com.sap.vocabularies.Common.v1.Messages/$Path`)}u(e.getBinding());let h;for(h=0;h<l.length;h++){p.targetEntities.push({$NavigationPropertyPath:l[h]})}p.targetProperties=g;if(c){p.targetProperties.push(c)}p.targetProperties=p.targetProperties.reduce((t,e)=>{if(e){const o=e.indexOf("/");t.push(o>0?e.slice(0,o):e)}return t},[]);n.requestSideEffects([...p.targetEntities,...p.targetProperties],e)};h._getBindingContext=function t(){if(this._oPageComponent){return this._oPageComponent.getBindingContext()}else{return this._oView.getBindingContext()}};h._setBindingContext=function t(e){var o;let n,i;if(this._oPageComponent){n=this._oPageComponent.getBindingContext();i=this._oPageComponent}else{n=this._oView.getBindingContext();i=this._oView}i.setBindingContext(e);if((o=n)!==null&&o!==void 0&&o.isKeepAlive()&&n!==e){this._setKeepAlive(n,false)}};h._getFCLLevel=function t(){return this._oTargetInformation.FCLLevel};h._setKeepAlive=function t(e,o,n,i){if(e.getPath().endsWith(")")){const t=e.getModel().getMetaModel();const r=t.getMetaPath(e.getPath());const a=t.getObject(`${r}/@com.sap.vocabularies.Common.v1.Messages/$Path`);e.setKeepAlive(o,n,!!a&&i)}};h._getKeepAliveContext=function t(e,o,n,i){const r=o.split("/");const a=[];while(r.length&&!r[r.length-1].endsWith(")")){a.push(r.pop())}if(r.length===0){return undefined}const s=r.join("/");const c=e.getKeepAliveContext(s,n,i);if(a.length===0){return c}else{a.reverse();const t=a.join("/");return e.bindContext(t,c).getBoundContext()}};h.switchFullScreen=function e(){const o=this.base.getView();const n=o.getModel("fclhelper"),i=n.getProperty("/actionButtonsInfo/isFullScreen"),r=n.getProperty(i?"/actionButtonsInfo/exitFullScreen":"/actionButtonsInfo/fullScreen"),a=this._oAppComponent.getRootViewController();const s=a.getRightmostContext?a.getRightmostContext():o.getBindingContext();this.base._routing.navigateToContext(s,{sLayout:r}).catch(function(){t.warning("cannot switch between column and fullscreen")})};h.closeColumn=function t(){const e=this._oView.getViewData();const o=this._oView.getBindingContext();const n=o.getModel().getMetaModel();const r={noPreservationCache:true,sLayout:this._oView.getModel("fclhelper").getProperty("/actionButtonsInfo/closeColumn")};if((e===null||e===void 0?void 0:e.viewLevel)===1&&c.isDraftSupported(n,o.getPath())){i.processDataLossOrDraftDiscardConfirmation(()=>{this.navigateBackFromContext(o,r)},Function.prototype,o,this._oView.getController(),false,i.NavigationType.BackNavigation)}else{this.navigateBackFromContext(o,r)}};return u}(u),et(W.prototype,"onExit",[C],Object.getOwnPropertyDescriptor(W.prototype,"onExit"),W.prototype),et(W.prototype,"onInit",[y],Object.getOwnPropertyDescriptor(W.prototype,"onInit"),W.prototype),et(W.prototype,"onRouteMatched",[P,_],Object.getOwnPropertyDescriptor(W.prototype,"onRouteMatched"),W.prototype),et(W.prototype,"onRouteMatchedFinished",[m,x],Object.getOwnPropertyDescriptor(W.prototype,"onRouteMatchedFinished"),W.prototype),et(W.prototype,"onBeforeBinding",[b,w],Object.getOwnPropertyDescriptor(W.prototype,"onBeforeBinding"),W.prototype),et(W.prototype,"onAfterBinding",[O,B],Object.getOwnPropertyDescriptor(W.prototype,"onAfterBinding"),W.prototype),et(W.prototype,"navigateToTarget",[R],Object.getOwnPropertyDescriptor(W.prototype,"navigateToTarget"),W.prototype),et(W.prototype,"navigateToRoute",[E],Object.getOwnPropertyDescriptor(W.prototype,"navigateToRoute"),W.prototype),et(W.prototype,"navigateToContext",[A,D],Object.getOwnPropertyDescriptor(W.prototype,"navigateToContext"),W.prototype),et(W.prototype,"navigateBackFromContext",[S,T],Object.getOwnPropertyDescriptor(W.prototype,"navigateBackFromContext"),W.prototype),et(W.prototype,"navigateForwardToContext",[M,F],Object.getOwnPropertyDescriptor(W.prototype,"navigateForwardToContext"),W.prototype),et(W.prototype,"navigateBackFromTransientState",[I,V],Object.getOwnPropertyDescriptor(W.prototype,"navigateBackFromTransientState"),W.prototype),et(W.prototype,"navigateToMessagePage",[$,L],Object.getOwnPropertyDescriptor(W.prototype,"navigateToMessagePage"),W.prototype),et(W.prototype,"isCurrentStateImpactedBy",[j,H],Object.getOwnPropertyDescriptor(W.prototype,"isCurrentStateImpactedBy"),W.prototype),et(W.prototype,"onDataReceived",[k],Object.getOwnPropertyDescriptor(W.prototype,"onDataReceived"),W.prototype),et(W.prototype,"switchFullScreen",[N,K],Object.getOwnPropertyDescriptor(W.prototype,"switchFullScreen"),W.prototype),et(W.prototype,"closeColumn",[q,z],Object.getOwnPropertyDescriptor(W.prototype,"closeColumn"),W.prototype),W))||U);return ot},false);
|
|
146
151
|
/*!
|
|
147
152
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
148
153
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -187,17 +192,17 @@ sap.ui.predefine("sap/fe/core/controllerextensions/RoutingListener", ["sap/fe/co
|
|
|
187
192
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
188
193
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
189
194
|
*/
|
|
190
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/Share", ["sap/base/Log","sap/base/util/extend","sap/base/util/ObjectPath","sap/fe/core/helpers/ClassSupport","sap/m/library","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/core/routing/HashChanger","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel"],function(e,t,o,r,a,i,n,s,l,c,p,u,h){"use strict";var d,m,g,f,S,y,b,_,w,T,E,O,v,M,P,D,j;var
|
|
195
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/Share", ["sap/base/Log","sap/base/util/extend","sap/base/util/ObjectPath","sap/fe/core/helpers/ClassSupport","sap/m/library","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/core/routing/HashChanger","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel"],function(e,t,o,r,a,i,n,s,l,c,p,u,h){"use strict";var d,m,g,f,S,y,b,_,w,T,E,O,v,M,P,D,j;var I=r.publicExtension;var A=r.methodOverride;var x=r.finalExtension;var C=r.extensible;var H=r.defineUI5Class;function U(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;L(e,t)}function L(e,t){L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,o){t.__proto__=o;return t};return L(e,t)}function R(e,t,o,r,a){var i={};Object.keys(r).forEach(function(e){i[e]=r[e]});i.enumerable=!!i.enumerable;i.configurable=!!i.configurable;if("value"in i||i.initializer){i.writable=true}i=o.slice().reverse().reduce(function(o,r){return r(e,t,o)||o},i);if(a&&i.initializer!==void 0){i.value=i.initializer?i.initializer.call(a):void 0;i.initializer=undefined}if(i.initializer===void 0){Object.defineProperty(e,t,i);i=null}return i}let F;let J=(d=H("sap.fe.core.controllerextensions.Share"),m=A(),g=A(),f=I(),S=x(),y=I(),b=C(l.After),_=I(),w=x(),T=I(),E=x(),O=I(),v=x(),M=I(),P=x(),d(D=(j=function(r){U(s,r);function s(){return r.apply(this,arguments)||this}var l=s.prototype;l.onInit=function e(){const t=new h({url:"",appTitle:"",subTitle:"",minifyUrlForChat:true,appId:""});this.base.getView().setModel(t,"collaborationInfo")};l.onExit=function e(){var t,o;const r=(t=this.base)===null||t===void 0?void 0:(o=t.getView())===null||o===void 0?void 0:o.getModel("collaborationInfo");if(r){r.destroy()}};l.openShareSheet=function e(t){this._openShareSheetImpl(t)};l.adaptShareMetadata=function e(t){return t};l._openShareSheetImpl=async function o(r){let s;const l=c.getInstance().getHash(),d=c.getInstance().hrefForAppSpecificHash?c.getInstance().hrefForAppSpecificHash(""):"",m={url:window.location.origin+window.location.pathname+window.location.search+(l?d+l:window.location.hash),title:document.title,email:{url:"",title:""},jam:{url:"",title:""},tile:{url:"",title:"",subtitle:"",icon:"",queryUrl:""}};F=r;const g=function(e,o){const r=e.getModel("shareData");const a=t(r.getData(),o);r.setData(a)};try{const o=await Promise.resolve(this.adaptShareMetadata(m));const l={shareEmailPressed:function(){const e=s.getModel("shareData");const t=e.getData();const o=i.getLibraryResourceBundle("sap.fe.core");const r=t.email.title?t.email.title:o.getText("T_SHARE_UTIL_HELPER_SAPFE_EMAIL_SUBJECT",[t.title]);a.URLHelper.triggerEmail(undefined,r,t.email.url?t.email.url:t.url)},shareMSTeamsPressed:function(){const e=s.getModel("shareData");const t=e.getData();const o=t.email.title?t.email.title:t.title;const r=t.email.url?t.email.url:t.url;const a=window.open("","ms-teams-share-popup","width=700,height=600");a.opener=null;a.location=`https://teams.microsoft.com/share?msgText=${encodeURIComponent(o)}&href=${encodeURIComponent(r)}`},onSaveTilePress:function(){setTimeout(function(){var e;(e=i.byId("bookmarkDialog"))===null||e===void 0?void 0:e.attachAfterClose(function(){F.focus()})},0)},shareJamPressed:()=>{this._doOpenJamShareDialog(o.jam.title?o.jam.title:o.title,o.jam.url?o.jam.url:o.url)}};l.onCancelPressed=function(){s.close()};l.setShareSheet=function(e){r.shareSheet=e};const c=new h({});const d={bindingContexts:{this:c.createBindingContext("/")},models:{this:c}};const f={title:o.tile.title?o.tile.title:o.title,subtitle:o.tile.subtitle,icon:o.tile.icon,url:o.tile.url?o.tile.url:o.url.substring(o.url.indexOf("#")),queryUrl:o.tile.queryUrl};if(r.shareSheet){s=r.shareSheet;const e=s.getModel("share");this._setStaticShareData(e);const a=t(e.getData(),f);e.setData(a);g(s,o);s.openBy(r)}else{const a="sap.fe.macros.share.ShareSheet";const i=u.loadTemplate(a,"fragment");try{const e=await Promise.resolve(p.process(i,{name:a},d));s=await n.load({definition:e,controller:l});s.setModel(new h(f||{}),"share");const c=s.getModel("share");this._setStaticShareData(c);const u=t(c.getData(),f);c.setData(u);s.setModel(new h(o||{}),"shareData");g(s,o);r.addDependent(s);s.openBy(r);l.setShareSheet(s)}catch(t){e.error("Error while opening the share fragment",t)}}}catch(t){e.error("Error while fetching the share model data",t)}};l._setStaticShareData=function e(t){const r=i.getLibraryResourceBundle("sap.fe.core");t.setProperty("/jamButtonText",r.getText("T_COMMON_SAPFE_SHARE_JAM"));t.setProperty("/emailButtonText",r.getText("T_SEMANTIC_CONTROL_SEND_EMAIL"));t.setProperty("/msTeamsShareButtonText",r.getText("T_COMMON_SAPFE_SHARE_MSTEAMS"));if(o.get("sap-ushell-config.renderers.fiori2.componentData.config.sapHorizonEnabled")===true){t.setProperty("/msTeamsVisible",true)}else{t.setProperty("/msTeamsVisible",false)}const a=o.get("sap.ushell.Container.getUser");t.setProperty("/jamVisible",!!a&&a().isJamActive());t.setProperty("/saveAsTileVisible",!!(sap&&sap.ushell&&sap.ushell.Container))};l._doOpenJamShareDialog=function e(t,o){const r=i.createComponent({name:"sap.collaboration.components.fiori.sharing.dialog",settings:{object:{id:o,share:t}}});r.open()};l._triggerEmail=async function e(){const t=await this._adaptShareMetadata();const o=i.getLibraryResourceBundle("sap.fe.core");const r=t.email.title?t.email.title:o.getText("T_SHARE_UTIL_HELPER_SAPFE_EMAIL_SUBJECT",[t.title]);a.URLHelper.triggerEmail(undefined,r,t.email.url?t.email.url:t.url)};l._triggerShareToJam=async function e(){const t=await this._adaptShareMetadata();this._doOpenJamShareDialog(t.jam.title?t.jam.title:t.title,t.jam.url?t.jam.url:window.location.origin+window.location.pathname+t.url)};l._saveAsTile=async function e(t){const o=await this._adaptShareMetadata(),r=t.getDependents()[0],a=c.getInstance().getHash(),i=c.getInstance().hrefForAppSpecificHash?c.getInstance().hrefForAppSpecificHash(""):"";o.url=a?i+a:window.location.hash;r.setTitle(o.tile.title?o.tile.title:o.title);r.setSubtitle(o.tile.subtitle);r.setTileIcon(o.tile.icon);r.setCustomUrl(o.tile.url?o.tile.url:o.url);r.setServiceUrl(o.tile.queryUrl);r.firePress()};l._adaptShareMetadata=function e(){const t=c.getInstance().getHash(),o=c.getInstance().hrefForAppSpecificHash?c.getInstance().hrefForAppSpecificHash(""):"",r={url:window.location.origin+window.location.pathname+window.location.search+(t?o+t:window.location.hash),title:document.title,email:{url:"",title:""},jam:{url:"",title:""},tile:{url:"",title:"",subtitle:"",icon:"",queryUrl:""}};return this.adaptShareMetadata(r)};return s}(s),R(j.prototype,"onInit",[m],Object.getOwnPropertyDescriptor(j.prototype,"onInit"),j.prototype),R(j.prototype,"onExit",[g],Object.getOwnPropertyDescriptor(j.prototype,"onExit"),j.prototype),R(j.prototype,"openShareSheet",[f,S],Object.getOwnPropertyDescriptor(j.prototype,"openShareSheet"),j.prototype),R(j.prototype,"adaptShareMetadata",[y,b],Object.getOwnPropertyDescriptor(j.prototype,"adaptShareMetadata"),j.prototype),R(j.prototype,"_triggerEmail",[_,w],Object.getOwnPropertyDescriptor(j.prototype,"_triggerEmail"),j.prototype),R(j.prototype,"_triggerShareToJam",[T,E],Object.getOwnPropertyDescriptor(j.prototype,"_triggerShareToJam"),j.prototype),R(j.prototype,"_saveAsTile",[O,v],Object.getOwnPropertyDescriptor(j.prototype,"_saveAsTile"),j.prototype),R(j.prototype,"_adaptShareMetadata",[M,P],Object.getOwnPropertyDescriptor(j.prototype,"_adaptShareMetadata"),j.prototype),j))||D);return J},false);
|
|
191
196
|
/*!
|
|
192
197
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
193
198
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
194
199
|
*/
|
|
195
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/SideEffects", ["sap/base/Log","sap/ui/core/mvc/ControllerExtension","../CommonUtils","../helpers/ClassSupport"],function(e,t,i,r){"use strict";var o,s,n,d,f,c,p,a,l,u,g,y,E,h,F,S,v,m,_,O,G,P,b,x,C,w,j,M,D,I,q,T,$,R,A,V,B,k,z,N;var Q=r.publicExtension;var U=r.privateExtension;var L=r.methodOverride;var W=r.finalExtension;var H=r.defineUI5Class;function J(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;K(e,t)}function K(e,t){K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,i){t.__proto__=i;return t};return K(e,t)}function X(e,t,i,r,o){var s={};Object.keys(r).forEach(function(e){s[e]=r[e]});s.enumerable=!!s.enumerable;s.configurable=!!s.configurable;if("value"in s||s.initializer){s.writable=true}s=i.slice().reverse().reduce(function(i,r){return r(e,t,i)||i},s);if(o&&s.initializer!==void 0){s.value=s.initializer?s.initializer.call(o):void 0;s.initializer=undefined}if(s.initializer===void 0){Object.defineProperty(e,t,s);s=null}return s}const Y="$$ImmediateRequest";let Z=(o=H("sap.fe.core.controllerextensions.SideEffects"),s=L(),n=Q(),d=W(),f=Q(),c=W(),p=Q(),a=W(),l=Q(),u=W(),g=Q(),y=W(),E=Q(),h=W(),F=Q(),S=W(),v=Q(),m=W(),_=Q(),O=W(),G=Q(),P=W(),b=Q(),x=W(),C=Q(),w=W(),j=U(),M=W(),D=Q(),I=W(),q=U(),T=W(),$=U(),R=W(),A=U(),V=W(),B=Q(),k=W(),o(z=(N=function(t){J(r,t);function r(){return t.apply(this,arguments)||this}var o=r.prototype;o.onInit=function e(){this._view=this.base.getView();this._sideEffectsService=i.getAppComponent(this._view).getSideEffectsService();this._registeredFieldGroupMap={};this._fieldGroupInvalidity={};this._registeredFailedSideEffects={}};o.addControlSideEffects=function e(t,i){this._sideEffectsService.addControlSideEffects(t,i)};o.removeControlSideEffects=function e(t){var i;const r=((i=t.isA)===null||i===void 0?void 0:i.call(t,"sap.ui.base.ManagedObject"))&&t.getId();if(r){this._sideEffectsService.removeControlSideEffects(r)}};o.getContextForSideEffects=function e(t,i){let r=t,o=this._sideEffectsService.getEntityTypeFromContext(t);if(i!==o){r=t.getBinding().getContext();if(r){o=this._sideEffectsService.getEntityTypeFromContext(r);if(i!==o){r=r.getBinding().getContext();if(r){o=this._sideEffectsService.getEntityTypeFromContext(r);if(i!==o){return undefined}}}}}return r||undefined};o.getFieldSideEffectsMap=function e(t){let i={};const r=t.getFieldGroupIds(),o=this._view.getViewData().entitySet,s=this._sideEffectsService.getConvertedMetaModel().entitySets.find(e=>e.name===o);i=this.getSideEffectsMapForFieldGroups(r,t.getBindingContext());if(o&&s){const e=s.entityType.fullyQualifiedName,r=this.getTargetProperty(t),o=this.getContextForSideEffects(t.getBindingContext(),e);if(r&&o){const t=this._sideEffectsService.getControlEntitySideEffects(e);Object.keys(t).forEach(s=>{const n=t[s];if(n.sourceProperties.includes(r)){const t=`${s}::${e}`;i[t]={name:t,immediate:true,sideEffects:n,context:o}}})}}return i};o.getSideEffectsMapForFieldGroups=function e(t,i){const r={};t.forEach(e=>{const{name:t,immediate:o,sideEffects:s,sideEffectEntityType:n}=this._getSideEffectsPropertyForFieldGroup(e);const d=i?this.getContextForSideEffects(i,n):undefined;if(s&&(!i||i&&d)){r[t]={name:t,immediate:o,sideEffects:s};if(i){r[t].context=d}}});return r};o.clearFieldGroupsValidity=function e(){this._fieldGroupInvalidity={}};o.isFieldGroupValid=function e(t,i){const r=this._getFieldGroupIndex(t,i);return Object.keys(this._fieldGroupInvalidity[r]??{}).length===0};o.getTargetProperty=function e(t){var i;const r=t.data("sourcePath");const o=this._view.getModel().getMetaModel();const s=(i=this._view.getBindingContext())===null||i===void 0?void 0:i.getPath();const n=s?`${o.getMetaPath(s)}/`:"";return r===null||r===void 0?void 0:r.replace(n,"")};o.handleFieldChange=async function t(i,r,o){const s=i.getSource();this._saveFieldPropertiesStatus(s,r);if(!r){return}try{await(i.getParameter("promise")??Promise.resolve())}catch(t){e.debug("Prerequisites on Field for the SideEffects have been rejected",t);return}return this._manageSideEffectsFromField(s,o??Promise.resolve())};o.handleFieldGroupChange=function t(i){const r=i.getSource(),o=i.getParameter("fieldGroupIds"),s=o.reduce((e,t)=>e.concat(this.getRegisteredSideEffectsForFieldGroup(t)),[]);return Promise.all(s.map(e=>this._requestFieldGroupSideEffects(e))).catch(t=>{var i;const o=(i=r.getBindingContext())===null||i===void 0?void 0:i.getPath();e.debug(`Error while processing FieldGroup SideEffects on context ${o}`,t)})};o.requestSideEffects=async function e(t,i,r,o){let s,n;if(o){const e=await o(t);s=e["aTargets"];n=e["TriggerAction"]}else{s=[...t.targetEntities??[],...t.targetProperties??[]];n=t.triggerAction}if(n){this._sideEffectsService.executeAction(n,i,r)}if(s.length){return this._sideEffectsService.requestSideEffects(s,i,r).catch(e=>{this.registerFailedSideEffects(t,i);throw e})}};o.getRegisteredFailedRequests=function e(){return this._registeredFailedSideEffects};o.registerFailedSideEffects=function e(t,i){const r=i.getPath();this._registeredFailedSideEffects[r]=this._registeredFailedSideEffects[r]??[];const o=this._registeredFailedSideEffects[r].every(e=>t.fullyQualifiedName!==e.fullyQualifiedName);if(o){this._registeredFailedSideEffects[r].push(t)}};o.unregisterFailedSideEffectsForAContext=function e(t){delete this._registeredFailedSideEffects[t]};o.unregisterFailedSideEffects=function e(t,i){var r;const o=i.getPath();if((r=this._registeredFailedSideEffects[o])!==null&&r!==void 0&&r.length){this._registeredFailedSideEffects[o]=this._registeredFailedSideEffects[o].filter(e=>e.fullyQualifiedName!==t)}};o.registerFieldGroupSideEffects=function e(t,i){const r=this._getFieldGroupIndex(t.name,t.context);if(!this._registeredFieldGroupMap[r]){this._registeredFieldGroupMap[r]={promise:i??Promise.resolve(),sideEffectProperty:t}}};o.unregisterFieldGroupSideEffects=function e(t){const{context:i,name:r}=t;const o=this._getFieldGroupIndex(r,i);delete this._registeredFieldGroupMap[o]};o.getRegisteredSideEffectsForFieldGroup=function e(t){const i=[];for(const e of Object.keys(this._registeredFieldGroupMap)){if(e.startsWith(`${t}_`)){i.push(this._registeredFieldGroupMap[e])}}return i};o._getFieldGroupIndex=function e(t,i){return`${t}_${i.getPath()}`};o._getSideEffectsPropertyForFieldGroup=function e(t){var i;const r=t.indexOf(Y)!==-1,o=t.replace(Y,""),s=o.split("#"),n=s[0],d=`${n}@com.sap.vocabularies.Common.v1.SideEffects${s.length===2?`#${s[1]}`:""}`,f=(i=this._sideEffectsService.getODataEntitySideEffects(n))===null||i===void 0?void 0:i[d];return{name:o,immediate:r,sideEffects:f,sideEffectEntityType:n}};o._manageSideEffectsFromField=async function t(i,r){const o=this.getFieldSideEffectsMap(i);try{const e=[];const t=Object.keys(o).map(e=>{const t=o[e];if(t.immediate===true){this.unregisterFailedSideEffects(t.sideEffects.fullyQualifiedName,t.context);return this.requestSideEffects(t.sideEffects,t.context)}return this.registerFieldGroupSideEffects(t,r)});for(const t of[i.getBindingContext(),this._view.getBindingContext()]){if(t){const i=t.getPath();const r=this._registeredFailedSideEffects[i]??[];this.unregisterFailedSideEffectsForAContext(i);for(const i of r){e.push(this.requestSideEffects(i,t))}}}await Promise.all(t.concat(e))}catch(t){e.debug(`Error while managing Field SideEffects`,t)}};o._requestFieldGroupSideEffects=async function t(i){this.unregisterFieldGroupSideEffects(i.sideEffectProperty);try{await i.promise}catch(t){e.debug(`Error while processing FieldGroup SideEffects`,t);return}try{const{sideEffects:e,context:t,name:r}=i.sideEffectProperty;if(this.isFieldGroupValid(r,t)){await this.requestSideEffects(e,t)}}catch(t){e.debug(`Error while executing FieldGroup SideEffects`,t)}};o._saveFieldPropertiesStatus=function e(t,i){const r=this.getFieldSideEffectsMap(t);Object.keys(r).forEach(e=>{const{name:o,immediate:s,context:n}=r[e];if(!s){const e=this._getFieldGroupIndex(o,n);if(i){var d;(d=this._fieldGroupInvalidity[e])===null||d===void 0?true:delete d[t.getId()]}else{this._fieldGroupInvalidity[e]={...this._fieldGroupInvalidity[e],...{[t.getId()]:true}}}}})};return r}(t),X(N.prototype,"onInit",[s],Object.getOwnPropertyDescriptor(N.prototype,"onInit"),N.prototype),X(N.prototype,"addControlSideEffects",[n,d],Object.getOwnPropertyDescriptor(N.prototype,"addControlSideEffects"),N.prototype),X(N.prototype,"removeControlSideEffects",[f,c],Object.getOwnPropertyDescriptor(N.prototype,"removeControlSideEffects"),N.prototype),X(N.prototype,"getContextForSideEffects",[p,a],Object.getOwnPropertyDescriptor(N.prototype,"getContextForSideEffects"),N.prototype),X(N.prototype,"getFieldSideEffectsMap",[l,u],Object.getOwnPropertyDescriptor(N.prototype,"getFieldSideEffectsMap"),N.prototype),X(N.prototype,"getSideEffectsMapForFieldGroups",[g,y],Object.getOwnPropertyDescriptor(N.prototype,"getSideEffectsMapForFieldGroups"),N.prototype),X(N.prototype,"clearFieldGroupsValidity",[E,h],Object.getOwnPropertyDescriptor(N.prototype,"clearFieldGroupsValidity"),N.prototype),X(N.prototype,"isFieldGroupValid",[F,S],Object.getOwnPropertyDescriptor(N.prototype,"isFieldGroupValid"),N.prototype),X(N.prototype,"getTargetProperty",[v,m],Object.getOwnPropertyDescriptor(N.prototype,"getTargetProperty"),N.prototype),X(N.prototype,"handleFieldChange",[_,O],Object.getOwnPropertyDescriptor(N.prototype,"handleFieldChange"),N.prototype),X(N.prototype,"handleFieldGroupChange",[G,P],Object.getOwnPropertyDescriptor(N.prototype,"handleFieldGroupChange"),N.prototype),X(N.prototype,"requestSideEffects",[b,x],Object.getOwnPropertyDescriptor(N.prototype,"requestSideEffects"),N.prototype),X(N.prototype,"getRegisteredFailedRequests",[C,w],Object.getOwnPropertyDescriptor(N.prototype,"getRegisteredFailedRequests"),N.prototype),X(N.prototype,"registerFailedSideEffects",[j,M],Object.getOwnPropertyDescriptor(N.prototype,"registerFailedSideEffects"),N.prototype),X(N.prototype,"unregisterFailedSideEffectsForAContext",[D,I],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFailedSideEffectsForAContext"),N.prototype),X(N.prototype,"unregisterFailedSideEffects",[q,T],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFailedSideEffects"),N.prototype),X(N.prototype,"registerFieldGroupSideEffects",[$,R],Object.getOwnPropertyDescriptor(N.prototype,"registerFieldGroupSideEffects"),N.prototype),X(N.prototype,"unregisterFieldGroupSideEffects",[A,V],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFieldGroupSideEffects"),N.prototype),X(N.prototype,"getRegisteredSideEffectsForFieldGroup",[B,k],Object.getOwnPropertyDescriptor(N.prototype,"getRegisteredSideEffectsForFieldGroup"),N.prototype),N))||z);return Z},false);
|
|
200
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/SideEffects", ["sap/base/Log","sap/ui/core/mvc/ControllerExtension","../CommonUtils","../helpers/ClassSupport"],function(e,t,i,r){"use strict";var o,s,n,d,f,c,p,a,l,u,g,y,E,h,F,S,v,m,_,O,G,P,b,x,C,w,j,M,D,I,q,T,$,R,A,V,B,k,z,N;var Q=r.publicExtension;var U=r.privateExtension;var L=r.methodOverride;var W=r.finalExtension;var H=r.defineUI5Class;function J(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;K(e,t)}function K(e,t){K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,i){t.__proto__=i;return t};return K(e,t)}function X(e,t,i,r,o){var s={};Object.keys(r).forEach(function(e){s[e]=r[e]});s.enumerable=!!s.enumerable;s.configurable=!!s.configurable;if("value"in s||s.initializer){s.writable=true}s=i.slice().reverse().reduce(function(i,r){return r(e,t,i)||i},s);if(o&&s.initializer!==void 0){s.value=s.initializer?s.initializer.call(o):void 0;s.initializer=undefined}if(s.initializer===void 0){Object.defineProperty(e,t,s);s=null}return s}const Y="$$ImmediateRequest";let Z=(o=H("sap.fe.core.controllerextensions.SideEffects"),s=L(),n=Q(),d=W(),f=Q(),c=W(),p=Q(),a=W(),l=Q(),u=W(),g=Q(),y=W(),E=Q(),h=W(),F=Q(),S=W(),v=Q(),m=W(),_=Q(),O=W(),G=Q(),P=W(),b=Q(),x=W(),C=Q(),w=W(),j=U(),M=W(),D=Q(),I=W(),q=U(),T=W(),$=U(),R=W(),A=U(),V=W(),B=Q(),k=W(),o(z=(N=function(t){J(r,t);function r(){return t.apply(this,arguments)||this}var o=r.prototype;o.onInit=function e(){this._view=this.base.getView();this._sideEffectsService=i.getAppComponent(this._view).getSideEffectsService();this._registeredFieldGroupMap={};this._fieldGroupInvalidity={};this._registeredFailedSideEffects={}};o.addControlSideEffects=function e(t,i){this._sideEffectsService.addControlSideEffects(t,i)};o.removeControlSideEffects=function e(t){var i;const r=((i=t.isA)===null||i===void 0?void 0:i.call(t,"sap.ui.base.ManagedObject"))&&t.getId();if(r){this._sideEffectsService.removeControlSideEffects(r)}};o.getContextForSideEffects=function e(t,i){let r=t,o=this._sideEffectsService.getEntityTypeFromContext(t);if(i!==o){r=t.getBinding().getContext();if(r){o=this._sideEffectsService.getEntityTypeFromContext(r);if(i!==o){r=r.getBinding().getContext();if(r){o=this._sideEffectsService.getEntityTypeFromContext(r);if(i!==o){return undefined}}}}}return r||undefined};o.getFieldSideEffectsMap=function e(t){let i={};const r=t.getFieldGroupIds(),o=this._view.getViewData().entitySet,s=this._sideEffectsService.getConvertedMetaModel().entitySets.find(e=>e.name===o);i=this.getSideEffectsMapForFieldGroups(r,t.getBindingContext());if(o&&s){const e=s.entityType.fullyQualifiedName,r=this.getTargetProperty(t),o=this.getContextForSideEffects(t.getBindingContext(),e);if(r&&o){const t=this._sideEffectsService.getControlEntitySideEffects(e);Object.keys(t).forEach(s=>{const n=t[s];if(n.sourceProperties.includes(r)){const t=`${s}::${e}`;i[t]={name:t,immediate:true,sideEffects:n,context:o}}})}}return i};o.getSideEffectsMapForFieldGroups=function e(t,i){const r={};t.forEach(e=>{const{name:t,immediate:o,sideEffects:s,sideEffectEntityType:n}=this._getSideEffectsPropertyForFieldGroup(e);const d=i?this.getContextForSideEffects(i,n):undefined;if(s&&(!i||i&&d)){r[t]={name:t,immediate:o,sideEffects:s};if(i){r[t].context=d}}});return r};o.clearFieldGroupsValidity=function e(){this._fieldGroupInvalidity={}};o.isFieldGroupValid=function e(t,i){const r=this._getFieldGroupIndex(t,i);return Object.keys(this._fieldGroupInvalidity[r]??{}).length===0};o.getTargetProperty=function e(t){var i;const r=t.data("sourcePath");const o=this._view.getModel().getMetaModel();const s=(i=this._view.getBindingContext())===null||i===void 0?void 0:i.getPath();const n=s?`${o.getMetaPath(s)}/`:"";return r===null||r===void 0?void 0:r.replace(n,"")};o.handleFieldChange=async function t(i,r,o){const s=i.getSource();this._saveFieldPropertiesStatus(s,r);if(!r){return}const n=this.getFieldSideEffectsMap(s);Object.keys(n).filter(e=>n[e].immediate!==true).forEach(e=>{const t=n[e];this.registerFieldGroupSideEffects(t,o)});try{await(i.getParameter("promise")??Promise.resolve())}catch(t){e.debug("Prerequisites on Field for the SideEffects have been rejected",t);return}return this._manageSideEffectsFromField(s)};o.handleFieldGroupChange=function t(i){const r=i.getSource(),o=i.getParameter("fieldGroupIds"),s=o.reduce((e,t)=>e.concat(this.getRegisteredSideEffectsForFieldGroup(t)),[]);return Promise.all(s.map(e=>this._requestFieldGroupSideEffects(e))).catch(t=>{var i;const o=(i=r.getBindingContext())===null||i===void 0?void 0:i.getPath();e.debug(`Error while processing FieldGroup SideEffects on context ${o}`,t)})};o.requestSideEffects=async function e(t,i,r,o){let s,n;if(o){const e=await o(t);s=e["aTargets"];n=e["TriggerAction"]}else{s=[...t.targetEntities??[],...t.targetProperties??[]];n=t.triggerAction}if(n){this._sideEffectsService.executeAction(n,i,r)}if(s.length){return this._sideEffectsService.requestSideEffects(s,i,r).catch(e=>{this.registerFailedSideEffects(t,i);throw e})}};o.getRegisteredFailedRequests=function e(){return this._registeredFailedSideEffects};o.registerFailedSideEffects=function e(t,i){const r=i.getPath();this._registeredFailedSideEffects[r]=this._registeredFailedSideEffects[r]??[];const o=this._registeredFailedSideEffects[r].every(e=>t.fullyQualifiedName!==e.fullyQualifiedName);if(o){this._registeredFailedSideEffects[r].push(t)}};o.unregisterFailedSideEffectsForAContext=function e(t){delete this._registeredFailedSideEffects[t]};o.unregisterFailedSideEffects=function e(t,i){var r;const o=i.getPath();if((r=this._registeredFailedSideEffects[o])!==null&&r!==void 0&&r.length){this._registeredFailedSideEffects[o]=this._registeredFailedSideEffects[o].filter(e=>e.fullyQualifiedName!==t)}};o.registerFieldGroupSideEffects=function e(t,i){const r=this._getFieldGroupIndex(t.name,t.context);if(!this._registeredFieldGroupMap[r]){this._registeredFieldGroupMap[r]={promise:i??Promise.resolve(),sideEffectProperty:t}}};o.unregisterFieldGroupSideEffects=function e(t){const{context:i,name:r}=t;const o=this._getFieldGroupIndex(r,i);delete this._registeredFieldGroupMap[o]};o.getRegisteredSideEffectsForFieldGroup=function e(t){const i=[];for(const e of Object.keys(this._registeredFieldGroupMap)){if(e.startsWith(`${t}_`)){i.push(this._registeredFieldGroupMap[e])}}return i};o._getFieldGroupIndex=function e(t,i){return`${t}_${i.getPath()}`};o._getSideEffectsPropertyForFieldGroup=function e(t){var i;const r=t.indexOf(Y)!==-1,o=t.replace(Y,""),s=o.split("#"),n=s[0],d=`${n}@com.sap.vocabularies.Common.v1.SideEffects${s.length===2?`#${s[1]}`:""}`,f=(i=this._sideEffectsService.getODataEntitySideEffects(n))===null||i===void 0?void 0:i[d];return{name:o,immediate:r,sideEffects:f,sideEffectEntityType:n}};o._manageSideEffectsFromField=async function t(i){const r=this.getFieldSideEffectsMap(i);try{const e=[];const t=Object.keys(r).filter(e=>r[e].immediate===true).map(e=>{const t=r[e];this.unregisterFailedSideEffects(t.sideEffects.fullyQualifiedName,t.context);return this.requestSideEffects(t.sideEffects,t.context)});for(const t of[i.getBindingContext(),this._view.getBindingContext()]){if(t){const i=t.getPath();const r=this._registeredFailedSideEffects[i]??[];this.unregisterFailedSideEffectsForAContext(i);for(const i of r){e.push(this.requestSideEffects(i,t))}}}await Promise.all(t.concat(e))}catch(t){e.debug(`Error while managing Field SideEffects`,t)}};o._requestFieldGroupSideEffects=async function t(i){this.unregisterFieldGroupSideEffects(i.sideEffectProperty);try{await i.promise}catch(t){e.debug(`Error while processing FieldGroup SideEffects`,t);return}try{const{sideEffects:e,context:t,name:r}=i.sideEffectProperty;if(this.isFieldGroupValid(r,t)){await this.requestSideEffects(e,t)}}catch(t){e.debug(`Error while executing FieldGroup SideEffects`,t)}};o._saveFieldPropertiesStatus=function e(t,i){const r=this.getFieldSideEffectsMap(t);Object.keys(r).forEach(e=>{const{name:o,immediate:s,context:n}=r[e];if(!s){const e=this._getFieldGroupIndex(o,n);if(i){var d;(d=this._fieldGroupInvalidity[e])===null||d===void 0?true:delete d[t.getId()]}else{this._fieldGroupInvalidity[e]={...this._fieldGroupInvalidity[e],...{[t.getId()]:true}}}}})};return r}(t),X(N.prototype,"onInit",[s],Object.getOwnPropertyDescriptor(N.prototype,"onInit"),N.prototype),X(N.prototype,"addControlSideEffects",[n,d],Object.getOwnPropertyDescriptor(N.prototype,"addControlSideEffects"),N.prototype),X(N.prototype,"removeControlSideEffects",[f,c],Object.getOwnPropertyDescriptor(N.prototype,"removeControlSideEffects"),N.prototype),X(N.prototype,"getContextForSideEffects",[p,a],Object.getOwnPropertyDescriptor(N.prototype,"getContextForSideEffects"),N.prototype),X(N.prototype,"getFieldSideEffectsMap",[l,u],Object.getOwnPropertyDescriptor(N.prototype,"getFieldSideEffectsMap"),N.prototype),X(N.prototype,"getSideEffectsMapForFieldGroups",[g,y],Object.getOwnPropertyDescriptor(N.prototype,"getSideEffectsMapForFieldGroups"),N.prototype),X(N.prototype,"clearFieldGroupsValidity",[E,h],Object.getOwnPropertyDescriptor(N.prototype,"clearFieldGroupsValidity"),N.prototype),X(N.prototype,"isFieldGroupValid",[F,S],Object.getOwnPropertyDescriptor(N.prototype,"isFieldGroupValid"),N.prototype),X(N.prototype,"getTargetProperty",[v,m],Object.getOwnPropertyDescriptor(N.prototype,"getTargetProperty"),N.prototype),X(N.prototype,"handleFieldChange",[_,O],Object.getOwnPropertyDescriptor(N.prototype,"handleFieldChange"),N.prototype),X(N.prototype,"handleFieldGroupChange",[G,P],Object.getOwnPropertyDescriptor(N.prototype,"handleFieldGroupChange"),N.prototype),X(N.prototype,"requestSideEffects",[b,x],Object.getOwnPropertyDescriptor(N.prototype,"requestSideEffects"),N.prototype),X(N.prototype,"getRegisteredFailedRequests",[C,w],Object.getOwnPropertyDescriptor(N.prototype,"getRegisteredFailedRequests"),N.prototype),X(N.prototype,"registerFailedSideEffects",[j,M],Object.getOwnPropertyDescriptor(N.prototype,"registerFailedSideEffects"),N.prototype),X(N.prototype,"unregisterFailedSideEffectsForAContext",[D,I],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFailedSideEffectsForAContext"),N.prototype),X(N.prototype,"unregisterFailedSideEffects",[q,T],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFailedSideEffects"),N.prototype),X(N.prototype,"registerFieldGroupSideEffects",[$,R],Object.getOwnPropertyDescriptor(N.prototype,"registerFieldGroupSideEffects"),N.prototype),X(N.prototype,"unregisterFieldGroupSideEffects",[A,V],Object.getOwnPropertyDescriptor(N.prototype,"unregisterFieldGroupSideEffects"),N.prototype),X(N.prototype,"getRegisteredSideEffectsForFieldGroup",[B,k],Object.getOwnPropertyDescriptor(N.prototype,"getRegisteredSideEffectsForFieldGroup"),N.prototype),N))||z);return Z},false);
|
|
196
201
|
/*!
|
|
197
202
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
198
203
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
199
204
|
*/
|
|
200
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/ViewState", ["sap/base/Log","sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/fe/core/helpers/ModelHelper","sap/fe/navigation/library","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/fl/apply/api/ControlVariantApplyAPI","sap/ui/mdc/p13n/StateUtil"],function(t,e,r,i,n,o,a,p,s,l,c){"use strict";var f,d,u,y,g,S,h,v,b,w,C,O,A,I,m,P,R,_,j,B,V,E,x,K,D,H,F,M,k,N,T,$,U,z,L,q,G,Q,J,W,X,Y,Z,tt,et,rt,it,nt,ot;var at=i.publicExtension;var pt=i.privateExtension;var st=i.finalExtension;var lt=i.extensible;var ct=i.defineUI5Class;function ft(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;dt(t,e)}function dt(t,e){dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,r){e.__proto__=r;return e};return dt(t,e)}function ut(t,e,r,i,n){var o={};Object.keys(i).forEach(function(t){o[t]=i[t]});o.enumerable=!!o.enumerable;o.configurable=!!o.configurable;if("value"in o||o.initializer){o.writable=true}o=r.slice().reverse().reduce(function(r,i){return i(t,e,r)||r},o);if(n&&o.initializer!==void 0){o.value=o.initializer?o.initializer.call(n):void 0;o.initializer=undefined}if(o.initializer===void 0){Object.defineProperty(t,e,o);o=null}return o}const yt="#additionalStates",gt=a.NavType;const St={"sap.ui.fl.variants.VariantManagement":{retrieve:function(t){return{variantId:t.getCurrentVariantKey()}},apply:async function(e,r){try{if(r&&r.variantId!==undefined&&r.variantId!==e.getCurrentVariantKey()){const i=this._checkIfVariantIdIsAvailable(e,r.variantId);let n;if(i){n=r.variantId}else{n=e.getStandardVariantKey();this.controlsVariantIdUnavailable.push(...e.getFor())}try{await l.activateVariant({element:e,variantReference:n});await this._setInitialStatesForDeltaCompute(e)}catch(r){t.error(r);this.invalidateInitialStateForApply.push(...e.getFor());await this._setInitialStatesForDeltaCompute(e)}}else{this._setInitialStatesForDeltaCompute(e)}}catch(e){t.error(e)}}},"sap.m.IconTabBar":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e&&e.selectedKey){const r=t.getItems().find(function(t){return t.getKey()===e.selectedKey});if(r){t.setSelectedItem(r)}}}},"sap.ui.mdc.FilterBar":{retrieve:async function(t){const e=this.getStateKey(t);const r=await c.retrieveExternalState(t);const i=t.getPropertyInfoSet();const n=r.filter||{};i.filter(function(t){return Object.keys(n).length>0&&t.path&&n[t.path]&&(t.removeFromAppState||n[t.path].length===0)}).forEach(function(t){if(t.path){delete n[t.path]}});return this._getControlState(e,r)},apply:async function(e,r){try{if(r){const t=(r===null||r===void 0?void 0:r.initialState)&&this.invalidateInitialStateForApply.indexOf(e.getId())===-1&&this.controlsVariantIdUnavailable.indexOf(e.getId())===-1;if(t){const t=await c.diffState(e,r.initialState,r.fullState);return c.applyExternalState(e,t)}else{return c.applyExternalState(e,(r===null||r===void 0?void 0:r.fullState)??r)}}}catch(e){t.error(e)}}},"sap.ui.mdc.Table":{retrieve:async function(t){const e=this.getStateKey(t);const r=await c.retrieveExternalState(t);return this._getControlState(e,r)},apply:async function(e,r){try{if(r){const t=(r===null||r===void 0?void 0:r.initialState)&&this.invalidateInitialStateForApply.indexOf(e.getId())===-1&&this.controlsVariantIdUnavailable.indexOf(e.getId())===-1;if(t){var i;if(r.initialState&&!((i=r.initialState)!==null&&i!==void 0&&i.supplementaryConfig)){r.initialState.supplementaryConfig={}}const t=await c.diffState(e,r.initialState,r.fullState);return c.applyExternalState(e,t)}else{if(!r.supplementaryConfig){r.supplementaryConfig={}}return c.applyExternalState(e,(r===null||r===void 0?void 0:r.fullState)??r)}}}catch(e){t.error(e)}},refreshBinding:function(e){const r=e.getRowBinding();if(r){const t=r.getRootBinding();if(t===r){r.refresh()}else{const t=r.getHeaderContext();const e=r.getGroupId();if(t){t.requestSideEffects([{$NavigationPropertyPath:""}],e)}}}else{t.info(`Table: ${e.getId()} was not refreshed. No binding found!`)}}},"sap.ui.mdc.Chart":{retrieve:function(t){return c.retrieveExternalState(t)},apply:function(t,e){if(e){return c.applyExternalState(t,e)}}},"sap.uxap.ObjectPageLayout":{retrieve:function(t){return{selectedSection:t.getSelectedSection()}},apply:function(t,e){if(e){t.setSelectedSection(e.selectedSection)}},refreshBinding:function(e){const i=e.getBindingContext();const a=i&&i.getBinding();if(a){const t=o.getMetaPathForContext(i);const p=n.getControlRefreshStrategyForContextPath(e,t);if(p==="self"){const e=i.getModel(),n=e.getMetaModel(),o=r.getContextPathProperties(n,t,{$kind:"NavigationProperty"})||{},p=Object.keys(o).reduce(function(t,e){if(o[e].$isCollection!==true){t.push({$NavigationPropertyPath:e})}return t},[]),s=[{$PropertyPath:"*"}],l=a.getGroupId();i.requestSideEffects(s.concat(p),l)}else if(p==="includingDependents"){a.refresh()}}else{t.info(`ObjectPage: ${e.getId()} was not refreshed. No binding found!`)}}},"sap.fe.macros.table.QuickFilterContainer":{retrieve:function(t){return{selectedKey:t.getSelectorKey()}},apply:function(t,e){if(e!==null&&e!==void 0&&e.selectedKey){t.setSelectorKey(e.selectedKey)}}},"sap.m.SegmentedButton":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e!==null&&e!==void 0&&e.selectedKey){t.setSelectedKey(e.selectedKey)}}},"sap.m.Select":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e!==null&&e!==void 0&&e.selectedKey){t.setSelectedKey(e.selectedKey)}}},"sap.f.DynamicPage":{retrieve:function(t){return{headerExpanded:t.getHeaderExpanded()}},apply:function(t,e){if(e){t.setHeaderExpanded(e.headerExpanded)}}},"sap.ui.core.mvc.View":{retrieve:function(t){const e=t.getController();if(e&&e.viewState){return e.viewState.retrieveViewState(e.viewState)}return{}},apply:function(t,e,r){const i=t.getController();if(i&&i.viewState){return i.viewState.applyViewState(e,r)}},refreshBinding:function(t){const e=t.getController();if(e&&e.viewState){return e.viewState.refreshViewBindings()}}},"sap.ui.core.ComponentContainer":{retrieve:function(t){const e=t.getComponentInstance();if(e){return this.retrieveControlState(e.getRootControl())}return{}},apply:function(t,e,r){const i=t.getComponentInstance();if(i){return this.applyControlState(i.getRootControl(),e,r)}}}};let ht=(f=ct("sap.fe.core.controllerextensions.ViewState"),d=at(),u=st(),y=at(),g=lt(s.After),S=pt(),h=st(),v=pt(),b=st(),w=at(),C=lt(s.After),O=at(),A=lt(s.After),I=at(),m=lt(s.After),P=pt(),R=st(),_=at(),j=lt(s.After),B=pt(),V=st(),E=at(),x=lt(s.After),K=at(),D=st(),H=at(),F=st(),M=at(),k=lt(s.After),N=pt(),T=st(),$=at(),U=lt(s.Instead),z=at(),L=st(),q=pt(),G=at(),Q=lt(s.After),J=at(),W=lt(s.After),X=at(),Y=lt(s.After),Z=pt(),tt=at(),et=lt(s.After),rt=pt(),it=st(),f(nt=(ot=function(r){ft(i,r);function i(){var e;e=r.call(this)||this;e.initialControlStatesMapper={};e.controlsVariantIdUnavailable=[];e.invalidateInitialStateForApply=[];e.viewStateControls=[];e._setInitialStatesForDeltaCompute=async r=>{try{const t=e.viewStateControls;const i=[];const n=[];let o=[];const a=(r===null||r===void 0?void 0:r.getFor())??[];t.filter(function(t){return t&&(!r||a.indexOf(t.getId())>-1)&&(t.isA("sap.ui.mdc.Table")||t.isA("sap.ui.mdc.FilterBar")||t.isA("sap.ui.mdc.Chart"))}).forEach(t=>{if(r){e._addEventListenersToVariantManagement(r,a)}const o=c.retrieveExternalState(t);i.push(o);n.push(e.getStateKey(t))});o=await Promise.all(i);o.forEach((t,r)=>{e.initialControlStatesMapper[n[r]]=t})}catch(e){t.error(e)}};e._iRetrievingStateCounter=0;e._pInitialStateApplied=new Promise(t=>{e._pInitialStateAppliedResolve=t});return e}var n=i.prototype;n.refreshViewBindings=async function t(){const e=await this.collectResults(this.base.viewState.adaptBindingRefreshControls);let r=Promise.resolve();e.filter(t=>t&&t.isA&&t.isA("sap.ui.base.ManagedObject")).forEach(t=>{r=r.then(this.refreshControlBinding.bind(this,t))});return r};n.adaptBindingRefreshControls=function t(e){};n.refreshControlBinding=function e(r){const i=this.getControlRefreshBindingHandler(r);let n=Promise.resolve();if(typeof i.refreshBinding!=="function"){t.info(`refreshBinding handler for control: ${r.getMetadata().getName()} is not provided`)}else{n=n.then(i.refreshBinding.bind(this,r))}return n};n.getControlRefreshBindingHandler=function t(e){const r={};if(e){for(const t in St){if(e.isA(t)){r["refreshBinding"]=St[t].refreshBinding||{};break}}}this.base.viewState.adaptBindingRefreshHandler(e,r);return r};n.adaptBindingRefreshHandler=function t(e,r){};n.onSuspend=function t(){};n.onRestore=function t(){};n.destroy=function t(){delete this._pInitialStateAppliedResolve;r.prototype.destroy.call(this)};n.collectResults=function t(e){const r=[];for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++){n[o-1]=arguments[o]}n.push(r);e.apply(this,n);return Promise.all(r)};n.adaptControlStateHandler=function t(e,r){};n.getControlStateHandler=function t(e){const r=[],i=[];if(e){for(const t in St){if(e.isA(t)){r.push(Object.assign({},St[t]));break}}}this.base.viewState.adaptControlStateHandler(e,i);return r.concat(i)};n.adaptStateControls=function t(e){};n.getStateKey=function t(e){return this.getView().getLocalId(e.getId())||e.getId()};n.retrieveViewState=async function t(){++this._iRetrievingStateCounter;let r;try{await this._pInitialStateApplied;const t=await this.collectResults(this.base.viewState.adaptStateControls);const i=await Promise.all(t.filter(function(t){return t&&t.isA&&t.isA("sap.ui.base.ManagedObject")}).map(t=>this.retrieveControlState(t).then(e=>({key:this.getStateKey(t),value:e}))));r=i.reduce(function(t,r){const i={};i[r.key]=r.value;return e(t,i)},{});const n=await Promise.resolve(this._retrieveAdditionalStates());if(n&&Object.keys(n).length){r[yt]=n}}finally{--this._iRetrievingStateCounter}return this._iRetrievingStateCounter===0?r:undefined};n.retrieveAdditionalStates=function t(e){};n._retrieveAdditionalStates=function t(){const e={};this.base.viewState.retrieveAdditionalStates(e);return e};n.retrieveControlState=function t(r){const i=this.getControlStateHandler(r);return Promise.all(i.map(t=>{if(typeof t.retrieve!=="function"){throw new Error(`controlStateHandler.retrieve is not a function for control: ${r.getMetadata().getName()}`)}return t.retrieve.call(this,r)})).then(t=>t.reduce(function(t,r){return e(t,r)},{}))};n.applyInitialStateOnly=function t(){return true};n.applyViewState=async function e(r,i){if(this.base.viewState.applyInitialStateOnly()&&this._getInitialStateApplied()){return}try{await this.collectResults(this.base.viewState.onBeforeStateApplied);const t=await this.collectResults(this.base.viewState.adaptStateControls);this.viewStateControls=t;let e=Promise.resolve();let n=false;const o=t.reduce((t,e)=>{if(!e){return t}const r=e.isA("sap.ui.fl.variants.VariantManagement");if(!n){n=r}t=r?[e,...t]:[...t,e];return t},[]);if(!n){this._setInitialStatesForDeltaCompute()}o.filter(function(t){return t.isA("sap.ui.base.ManagedObject")}).forEach(t=>{const n=this.getStateKey(t);e=e.then(this.applyControlState.bind(this,t,r?r[n]:undefined,i))});await e;if(i.navigationType===gt.iAppState){await this.collectResults(this.base.viewState.applyAdditionalStates,r?r[yt]:undefined)}else{await this.collectResults(this.base.viewState.applyNavigationParameters,i);await this.collectResults(this.base.viewState._applyNavigationParametersToFilterbar,i)}}finally{try{await this.collectResults(this.base.viewState.onAfterStateApplied);this._setInitialStateApplied()}catch(e){t.error(e)}}};n._checkIfVariantIdIsAvailable=function t(e,r){const i=e.getVariants();let n=false;i.forEach(function(t){if(t.key===r){n=true}});return n};n._setInitialStateApplied=function t(){if(this._pInitialStateAppliedResolve){const t=this._pInitialStateAppliedResolve;delete this._pInitialStateAppliedResolve;t()}};n._getInitialStateApplied=function t(){return!this._pInitialStateAppliedResolve};n.onBeforeStateApplied=function t(e){};n.onAfterStateApplied=function t(e){};n.applyAdditionalStates=function t(e,r){};n._applyNavigationParametersToFilterbar=function t(e,r){};n.applyNavigationParameters=function t(e,r){};n.applyControlState=function t(e,r,i){const n=this.getControlStateHandler(e);let o=Promise.resolve();n.forEach(t=>{if(typeof t.apply!=="function"){throw new Error(`controlStateHandler.apply is not a function for control: ${e.getMetadata().getName()}`)}o=o.then(t.apply.bind(this,e,r,i))});return o};n.getInterface=function t(){return this};n._getControlState=function t(e,r){const i=this.initialControlStatesMapper;if(Object.keys(i).length>0&&i[e]){if(Object.keys(i[e]).length===0){i[e]={...r}}return{fullState:r,initialState:i[e]}}return r};n._addEventListenersToVariantManagement=function t(e,r){const i={variantManagedControls:r};const n=()=>{this._updateInitialStatesOnVariantChange(r)};e.attachSave(i,n,{});e.attachSelect(i,n,{})};n._updateInitialStatesOnVariantChange=function t(e){const r=this.initialControlStatesMapper;Object.keys(r).forEach(t=>{for(const i of e){if(i.indexOf(t)>-1){r[t]={}}}})};return i}(p),ut(ot.prototype,"refreshViewBindings",[d,u],Object.getOwnPropertyDescriptor(ot.prototype,"refreshViewBindings"),ot.prototype),ut(ot.prototype,"adaptBindingRefreshControls",[y,g],Object.getOwnPropertyDescriptor(ot.prototype,"adaptBindingRefreshControls"),ot.prototype),ut(ot.prototype,"refreshControlBinding",[S,h],Object.getOwnPropertyDescriptor(ot.prototype,"refreshControlBinding"),ot.prototype),ut(ot.prototype,"getControlRefreshBindingHandler",[v,b],Object.getOwnPropertyDescriptor(ot.prototype,"getControlRefreshBindingHandler"),ot.prototype),ut(ot.prototype,"adaptBindingRefreshHandler",[w,C],Object.getOwnPropertyDescriptor(ot.prototype,"adaptBindingRefreshHandler"),ot.prototype),ut(ot.prototype,"onSuspend",[O,A],Object.getOwnPropertyDescriptor(ot.prototype,"onSuspend"),ot.prototype),ut(ot.prototype,"onRestore",[I,m],Object.getOwnPropertyDescriptor(ot.prototype,"onRestore"),ot.prototype),ut(ot.prototype,"collectResults",[P,R],Object.getOwnPropertyDescriptor(ot.prototype,"collectResults"),ot.prototype),ut(ot.prototype,"adaptControlStateHandler",[_,j],Object.getOwnPropertyDescriptor(ot.prototype,"adaptControlStateHandler"),ot.prototype),ut(ot.prototype,"getControlStateHandler",[B,V],Object.getOwnPropertyDescriptor(ot.prototype,"getControlStateHandler"),ot.prototype),ut(ot.prototype,"adaptStateControls",[E,x],Object.getOwnPropertyDescriptor(ot.prototype,"adaptStateControls"),ot.prototype),ut(ot.prototype,"getStateKey",[K,D],Object.getOwnPropertyDescriptor(ot.prototype,"getStateKey"),ot.prototype),ut(ot.prototype,"retrieveViewState",[H,F],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveViewState"),ot.prototype),ut(ot.prototype,"retrieveAdditionalStates",[M,k],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveAdditionalStates"),ot.prototype),ut(ot.prototype,"retrieveControlState",[N,T],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveControlState"),ot.prototype),ut(ot.prototype,"applyInitialStateOnly",[$,U],Object.getOwnPropertyDescriptor(ot.prototype,"applyInitialStateOnly"),ot.prototype),ut(ot.prototype,"applyViewState",[z,L],Object.getOwnPropertyDescriptor(ot.prototype,"applyViewState"),ot.prototype),ut(ot.prototype,"_checkIfVariantIdIsAvailable",[q],Object.getOwnPropertyDescriptor(ot.prototype,"_checkIfVariantIdIsAvailable"),ot.prototype),ut(ot.prototype,"onBeforeStateApplied",[G,Q],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeStateApplied"),ot.prototype),ut(ot.prototype,"onAfterStateApplied",[J,W],Object.getOwnPropertyDescriptor(ot.prototype,"onAfterStateApplied"),ot.prototype),ut(ot.prototype,"applyAdditionalStates",[X,Y],Object.getOwnPropertyDescriptor(ot.prototype,"applyAdditionalStates"),ot.prototype),ut(ot.prototype,"_applyNavigationParametersToFilterbar",[Z],Object.getOwnPropertyDescriptor(ot.prototype,"_applyNavigationParametersToFilterbar"),ot.prototype),ut(ot.prototype,"applyNavigationParameters",[tt,et],Object.getOwnPropertyDescriptor(ot.prototype,"applyNavigationParameters"),ot.prototype),ut(ot.prototype,"applyControlState",[rt,it],Object.getOwnPropertyDescriptor(ot.prototype,"applyControlState"),ot.prototype),ot))||nt);return ht},false);
|
|
205
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/ViewState", ["sap/base/Log","sap/base/util/merge","sap/fe/core/CommonUtils","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/fe/core/helpers/ModelHelper","sap/fe/navigation/library","sap/ui/core/mvc/ControllerExtension","sap/ui/core/mvc/OverrideExecution","sap/ui/fl/apply/api/ControlVariantApplyAPI","sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters","sap/ui/mdc/p13n/StateUtil"],function(t,e,r,i,n,a,o,p,l,s,c,f){"use strict";var d,u,y,g,S,h,v,b,w,C,O,A,I,m,P,_,B,R,j,V,E,x,D,K,F,H,M,T,k,N,$,z,U,L,q,G,J,Q,W,X,Y,Z,tt,et,rt,it,nt,at,ot;var pt=i.publicExtension;var lt=i.privateExtension;var st=i.finalExtension;var ct=i.extensible;var ft=i.defineUI5Class;function dt(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;ut(t,e)}function ut(t,e){ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,r){e.__proto__=r;return e};return ut(t,e)}function yt(t,e,r,i,n){var a={};Object.keys(i).forEach(function(t){a[t]=i[t]});a.enumerable=!!a.enumerable;a.configurable=!!a.configurable;if("value"in a||a.initializer){a.writable=true}a=r.slice().reverse().reduce(function(r,i){return i(t,e,r)||r},a);if(n&&a.initializer!==void 0){a.value=a.initializer?a.initializer.call(n):void 0;a.initializer=undefined}if(a.initializer===void 0){Object.defineProperty(t,e,a);a=null}return a}const gt="#additionalStates",St=o.NavType;const ht={"sap.ui.fl.variants.VariantManagement":{retrieve:function(t){return{variantId:t.getCurrentVariantKey()}},apply:async function(e,r){try{if(r&&r.variantId!==undefined&&r.variantId!==e.getCurrentVariantKey()){const i=this._checkIfVariantIdIsAvailable(e,r.variantId);let n;if(i){n=r.variantId}else{n=e.getStandardVariantKey();this.controlsVariantIdUnavailable.push(...e.getFor())}try{await s.activateVariant({element:e,variantReference:n});await this._setInitialStatesForDeltaCompute(e)}catch(r){t.error(r);this.invalidateInitialStateForApply.push(...e.getFor());await this._setInitialStatesForDeltaCompute(e)}}else{this._setInitialStatesForDeltaCompute(e)}}catch(e){t.error(e)}}},"sap.m.IconTabBar":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e&&e.selectedKey){const r=t.getItems().find(function(t){return t.getKey()===e.selectedKey});if(r){t.setSelectedItem(r)}}}},"sap.ui.mdc.FilterBar":{retrieve:async function(t){const e=this.getStateKey(t);const r=await f.retrieveExternalState(t);const i=t.getPropertyInfoSet();const n=r.filter||{};i.filter(function(t){return Object.keys(n).length>0&&t.path&&n[t.path]&&(t.removeFromAppState||n[t.path].length===0)}).forEach(function(t){if(t.path){delete n[t.path]}});return this._getControlState(e,r)},apply:async function(e,r,i){try{if(r){const t=this._isInitialStatesApplicable(r===null||r===void 0?void 0:r.initialState,e);const n=i.navigationType;if(n===St.hybrid&&r.fullState!==undefined){const t=await c.getFilterBarSupportedFields(e),n=c.getFilterBarInfoForConversion(e),a=c.getConditionsFromSV(i.selectionVariant,n,t);const o={...r.fullState,filter:{...r.fullState.filter,...a}};return f.applyExternalState(e,o)}if(t){const t=await f.diffState(e,r.initialState,r.fullState);return f.applyExternalState(e,t)}return f.applyExternalState(e,(r===null||r===void 0?void 0:r.fullState)??r)}}catch(e){t.error(e)}}},"sap.ui.mdc.Table":{retrieve:async function(t){const e=this.getStateKey(t);const r=await f.retrieveExternalState(t);return this._getControlState(e,r)},apply:async function(e,r,i){try{if(r){const t=this._isInitialStatesApplicable(r===null||r===void 0?void 0:r.initialState,e,i.navigationType!==St.hybrid);if(t){var n;if(r.initialState&&!((n=r.initialState)!==null&&n!==void 0&&n.supplementaryConfig)){r.initialState.supplementaryConfig={}}const t=await f.diffState(e,r.initialState,r.fullState);return f.applyExternalState(e,t)}else{if(!r.supplementaryConfig){r.supplementaryConfig={}}return f.applyExternalState(e,(r===null||r===void 0?void 0:r.fullState)??r)}}}catch(e){t.error(e)}},refreshBinding:function(e){const r=e.getRowBinding();if(r){const t=r.getRootBinding();if(t===r){r.refresh()}else{const t=r.getHeaderContext();const e=r.getGroupId();if(t){t.requestSideEffects([{$NavigationPropertyPath:""}],e)}}}else{t.info(`Table: ${e.getId()} was not refreshed. No binding found!`)}}},"sap.ui.mdc.Chart":{retrieve:function(t){return f.retrieveExternalState(t)},apply:function(t,e){if(e){return f.applyExternalState(t,e)}}},"sap.uxap.ObjectPageLayout":{retrieve:function(t){return{selectedSection:t.getSelectedSection()}},apply:function(t,e){if(e){t.setSelectedSection(e.selectedSection)}},refreshBinding:function(e){const i=e.getBindingContext();const o=i&&i.getBinding();if(o){const t=a.getMetaPathForContext(i);const p=n.getControlRefreshStrategyForContextPath(e,t);if(p==="self"){const e=i.getModel(),n=e.getMetaModel(),a=r.getContextPathProperties(n,t,{$kind:"NavigationProperty"})||{},p=Object.keys(a).reduce(function(t,e){if(a[e].$isCollection!==true){t.push({$NavigationPropertyPath:e})}return t},[]),l=[{$PropertyPath:"*"}],s=o.getGroupId();i.requestSideEffects(l.concat(p),s)}else if(p==="includingDependents"){o.refresh()}}else{t.info(`ObjectPage: ${e.getId()} was not refreshed. No binding found!`)}}},"sap.m.SegmentedButton":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e!==null&&e!==void 0&&e.selectedKey&&e.selectedKey!==t.getSelectedKey()){var r;t.setSelectedKey(e.selectedKey);if((r=t.getParent())!==null&&r!==void 0&&r.isA("sap.ui.mdc.ActionToolbar")){t.fireEvent("selectionChange")}}}},"sap.m.Select":{retrieve:function(t){return{selectedKey:t.getSelectedKey()}},apply:function(t,e){if(e!==null&&e!==void 0&&e.selectedKey&&e.selectedKey!==t.getSelectedKey()){var r;t.setSelectedKey(e.selectedKey);if((r=t.getParent())!==null&&r!==void 0&&r.isA("sap.ui.mdc.ActionToolbar")){t.fireEvent("change")}}}},"sap.f.DynamicPage":{retrieve:function(t){return{headerExpanded:t.getHeaderExpanded()}},apply:function(t,e){if(e){t.setHeaderExpanded(e.headerExpanded)}}},"sap.ui.core.mvc.View":{retrieve:function(t){const e=t.getController();if(e&&e.viewState){return e.viewState.retrieveViewState(e.viewState)}return{}},apply:function(t,e,r){const i=t.getController();if(i&&i.viewState){return i.viewState.applyViewState(e,r)}},refreshBinding:function(t){const e=t.getController();if(e&&e.viewState){return e.viewState.refreshViewBindings()}}},"sap.ui.core.ComponentContainer":{retrieve:function(t){const e=t.getComponentInstance();if(e){return this.retrieveControlState(e.getRootControl())}return{}},apply:function(t,e,r){const i=t.getComponentInstance();if(i){return this.applyControlState(i.getRootControl(),e,r)}}}};let vt=(d=ft("sap.fe.core.controllerextensions.ViewState"),u=pt(),y=st(),g=pt(),S=ct(l.After),h=lt(),v=st(),b=lt(),w=st(),C=pt(),O=ct(l.After),A=pt(),I=ct(l.After),m=pt(),P=ct(l.After),_=lt(),B=st(),R=pt(),j=ct(l.After),V=lt(),E=st(),x=pt(),D=ct(l.After),K=pt(),F=st(),H=pt(),M=st(),T=pt(),k=ct(l.After),N=lt(),$=st(),z=pt(),U=ct(l.Instead),L=pt(),q=st(),G=lt(),J=pt(),Q=ct(l.After),W=pt(),X=ct(l.After),Y=pt(),Z=ct(l.After),tt=lt(),et=pt(),rt=ct(l.After),it=lt(),nt=st(),d(at=(ot=function(r){dt(i,r);function i(){var e;e=r.call(this)||this;e.initialControlStatesMapper={};e.controlsVariantIdUnavailable=[];e.invalidateInitialStateForApply=[];e.viewStateControls=[];e._setInitialStatesForDeltaCompute=async r=>{try{const t=e.viewStateControls;const i=[];const n=[];let a=[];const o=(r===null||r===void 0?void 0:r.getFor())??[];t.filter(function(t){return t&&(!r||o.indexOf(t.getId())>-1)&&(t.isA("sap.ui.mdc.Table")||t.isA("sap.ui.mdc.FilterBar")||t.isA("sap.ui.mdc.Chart"))}).forEach(t=>{if(r){e._addEventListenersToVariantManagement(r,o)}const a=f.retrieveExternalState(t);i.push(a);n.push(e.getStateKey(t))});a=await Promise.all(i);a.forEach((t,r)=>{e.initialControlStatesMapper[n[r]]=t})}catch(e){t.error(e)}};e._iRetrievingStateCounter=0;e._pInitialStateApplied=new Promise(t=>{e._pInitialStateAppliedResolve=t});return e}var n=i.prototype;n.refreshViewBindings=async function t(){const e=await this.collectResults(this.base.viewState.adaptBindingRefreshControls);let r=Promise.resolve();e.filter(t=>t&&t.isA&&t.isA("sap.ui.base.ManagedObject")).forEach(t=>{r=r.then(this.refreshControlBinding.bind(this,t))});return r};n.adaptBindingRefreshControls=function t(e){};n.refreshControlBinding=function e(r){const i=this.getControlRefreshBindingHandler(r);let n=Promise.resolve();if(typeof i.refreshBinding!=="function"){t.info(`refreshBinding handler for control: ${r.getMetadata().getName()} is not provided`)}else{n=n.then(i.refreshBinding.bind(this,r))}return n};n.getControlRefreshBindingHandler=function t(e){const r={};if(e){for(const t in ht){if(e.isA(t)){r["refreshBinding"]=ht[t].refreshBinding||{};break}}}this.base.viewState.adaptBindingRefreshHandler(e,r);return r};n.adaptBindingRefreshHandler=function t(e,r){};n.onSuspend=function t(){};n.onRestore=function t(){};n.destroy=function t(){delete this._pInitialStateAppliedResolve;r.prototype.destroy.call(this)};n.collectResults=function t(e){const r=[];for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++){n[a-1]=arguments[a]}n.push(r);e.apply(this,n);return Promise.all(r)};n.adaptControlStateHandler=function t(e,r){};n.getControlStateHandler=function t(e){const r=[],i=[];if(e){for(const t in ht){if(e.isA(t)){r.push(Object.assign({},ht[t]));break}}}this.base.viewState.adaptControlStateHandler(e,i);return r.concat(i)};n.adaptStateControls=function t(e){};n.getStateKey=function t(e){return this.getView().getLocalId(e.getId())||e.getId()};n.retrieveViewState=async function t(){++this._iRetrievingStateCounter;let r;try{await this._pInitialStateApplied;const t=await this.collectResults(this.base.viewState.adaptStateControls);const i=await Promise.all(t.filter(function(t){return t&&t.isA&&t.isA("sap.ui.base.ManagedObject")}).map(t=>this.retrieveControlState(t).then(e=>({key:this.getStateKey(t),value:e}))));r=i.reduce(function(t,r){const i={};i[r.key]=r.value;return e(t,i)},{});const n=await Promise.resolve(this._retrieveAdditionalStates());if(n&&Object.keys(n).length){r[gt]=n}}finally{--this._iRetrievingStateCounter}return this._iRetrievingStateCounter===0?r:undefined};n.retrieveAdditionalStates=function t(e){};n._retrieveAdditionalStates=function t(){const e={};this.base.viewState.retrieveAdditionalStates(e);return e};n.retrieveControlState=function t(r){const i=this.getControlStateHandler(r);return Promise.all(i.map(t=>{if(typeof t.retrieve!=="function"){throw new Error(`controlStateHandler.retrieve is not a function for control: ${r.getMetadata().getName()}`)}return t.retrieve.call(this,r)})).then(t=>t.reduce(function(t,r){return e(t,r)},{}))};n.applyInitialStateOnly=function t(){return true};n.applyViewState=async function e(r,i){if(this.base.viewState.applyInitialStateOnly()&&this._getInitialStateApplied()){return}try{await this.collectResults(this.base.viewState.onBeforeStateApplied,[],i.navigationType);const t=await this.collectResults(this.base.viewState.adaptStateControls);this.viewStateControls=t;let e=Promise.resolve();let n=false;const a=t.reduce((t,e)=>{if(!e){return t}const r=e.isA("sap.ui.fl.variants.VariantManagement");if(!n){n=r}t=r?[e,...t]:[...t,e];return t},[]);if(!n){this._setInitialStatesForDeltaCompute()}a.filter(function(t){return t.isA("sap.ui.base.ManagedObject")}).forEach(t=>{const n=this.getStateKey(t);e=e.then(this.applyControlState.bind(this,t,r?r[n]:undefined,i))});await e;if(i.navigationType===St.iAppState||i.navigationType===St.hybrid){await this.collectResults(this.base.viewState.applyAdditionalStates,r?r[gt]:undefined)}else{await this.collectResults(this.base.viewState.applyNavigationParameters,i);await this.collectResults(this.base.viewState._applyNavigationParametersToFilterbar,i)}}finally{try{await this.collectResults(this.base.viewState.onAfterStateApplied);this._setInitialStateApplied()}catch(e){t.error(e)}}};n._checkIfVariantIdIsAvailable=function t(e,r){const i=e.getVariants();let n=false;i.forEach(function(t){if(t.key===r){n=true}});return n};n._setInitialStateApplied=function t(){if(this._pInitialStateAppliedResolve){const t=this._pInitialStateAppliedResolve;delete this._pInitialStateAppliedResolve;t()}};n._getInitialStateApplied=function t(){return!this._pInitialStateAppliedResolve};n.onBeforeStateApplied=function t(e,r){};n.onAfterStateApplied=function t(e){};n.applyAdditionalStates=function t(e,r){};n._applyNavigationParametersToFilterbar=function t(e,r){};n.applyNavigationParameters=function t(e,r){};n.applyControlState=function t(e,r,i){const n=this.getControlStateHandler(e);let a=Promise.resolve();n.forEach(t=>{if(typeof t.apply!=="function"){throw new Error(`controlStateHandler.apply is not a function for control: ${e.getMetadata().getName()}`)}a=a.then(t.apply.bind(this,e,r,i))});return a};n.getInterface=function t(){return this};n._getControlState=function t(e,r){const i=this.initialControlStatesMapper;if(Object.keys(i).length>0&&i[e]){if(Object.keys(i[e]).length===0){i[e]={...r}}return{fullState:r,initialState:i[e]}}return r};n._addEventListenersToVariantManagement=function t(e,r){const i={variantManagedControls:r};const n=()=>{this._updateInitialStatesOnVariantChange(r)};e.attachSave(i,n,{});e.attachSelect(i,n,{})};n._updateInitialStatesOnVariantChange=function t(e){const r=this.initialControlStatesMapper;Object.keys(r).forEach(t=>{for(const i of e){if(i.indexOf(t)>-1){r[t]={}}}})};n._isInitialStatesApplicable=function t(e,r,i){return e&&this.invalidateInitialStateForApply.indexOf(r.getId())===-1&&this.controlsVariantIdUnavailable.indexOf(r.getId())===-1&&(i??true)};return i}(p),yt(ot.prototype,"refreshViewBindings",[u,y],Object.getOwnPropertyDescriptor(ot.prototype,"refreshViewBindings"),ot.prototype),yt(ot.prototype,"adaptBindingRefreshControls",[g,S],Object.getOwnPropertyDescriptor(ot.prototype,"adaptBindingRefreshControls"),ot.prototype),yt(ot.prototype,"refreshControlBinding",[h,v],Object.getOwnPropertyDescriptor(ot.prototype,"refreshControlBinding"),ot.prototype),yt(ot.prototype,"getControlRefreshBindingHandler",[b,w],Object.getOwnPropertyDescriptor(ot.prototype,"getControlRefreshBindingHandler"),ot.prototype),yt(ot.prototype,"adaptBindingRefreshHandler",[C,O],Object.getOwnPropertyDescriptor(ot.prototype,"adaptBindingRefreshHandler"),ot.prototype),yt(ot.prototype,"onSuspend",[A,I],Object.getOwnPropertyDescriptor(ot.prototype,"onSuspend"),ot.prototype),yt(ot.prototype,"onRestore",[m,P],Object.getOwnPropertyDescriptor(ot.prototype,"onRestore"),ot.prototype),yt(ot.prototype,"collectResults",[_,B],Object.getOwnPropertyDescriptor(ot.prototype,"collectResults"),ot.prototype),yt(ot.prototype,"adaptControlStateHandler",[R,j],Object.getOwnPropertyDescriptor(ot.prototype,"adaptControlStateHandler"),ot.prototype),yt(ot.prototype,"getControlStateHandler",[V,E],Object.getOwnPropertyDescriptor(ot.prototype,"getControlStateHandler"),ot.prototype),yt(ot.prototype,"adaptStateControls",[x,D],Object.getOwnPropertyDescriptor(ot.prototype,"adaptStateControls"),ot.prototype),yt(ot.prototype,"getStateKey",[K,F],Object.getOwnPropertyDescriptor(ot.prototype,"getStateKey"),ot.prototype),yt(ot.prototype,"retrieveViewState",[H,M],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveViewState"),ot.prototype),yt(ot.prototype,"retrieveAdditionalStates",[T,k],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveAdditionalStates"),ot.prototype),yt(ot.prototype,"retrieveControlState",[N,$],Object.getOwnPropertyDescriptor(ot.prototype,"retrieveControlState"),ot.prototype),yt(ot.prototype,"applyInitialStateOnly",[z,U],Object.getOwnPropertyDescriptor(ot.prototype,"applyInitialStateOnly"),ot.prototype),yt(ot.prototype,"applyViewState",[L,q],Object.getOwnPropertyDescriptor(ot.prototype,"applyViewState"),ot.prototype),yt(ot.prototype,"_checkIfVariantIdIsAvailable",[G],Object.getOwnPropertyDescriptor(ot.prototype,"_checkIfVariantIdIsAvailable"),ot.prototype),yt(ot.prototype,"onBeforeStateApplied",[J,Q],Object.getOwnPropertyDescriptor(ot.prototype,"onBeforeStateApplied"),ot.prototype),yt(ot.prototype,"onAfterStateApplied",[W,X],Object.getOwnPropertyDescriptor(ot.prototype,"onAfterStateApplied"),ot.prototype),yt(ot.prototype,"applyAdditionalStates",[Y,Z],Object.getOwnPropertyDescriptor(ot.prototype,"applyAdditionalStates"),ot.prototype),yt(ot.prototype,"_applyNavigationParametersToFilterbar",[tt],Object.getOwnPropertyDescriptor(ot.prototype,"_applyNavigationParametersToFilterbar"),ot.prototype),yt(ot.prototype,"applyNavigationParameters",[et,rt],Object.getOwnPropertyDescriptor(ot.prototype,"applyNavigationParameters"),ot.prototype),yt(ot.prototype,"applyControlState",[it,nt],Object.getOwnPropertyDescriptor(ot.prototype,"applyControlState"),ot.prototype),ot))||at);return vt},false);
|
|
201
206
|
/*!
|
|
202
207
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
203
208
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -207,17 +212,12 @@ sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/ActivityBase",
|
|
|
207
212
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
208
213
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
209
214
|
*/
|
|
210
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/ActivitySync", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/collaboration/ActivityBase","sap/fe/core/controllerextensions/collaboration/CollaborationCommon","sap/fe/core/converters/MetaModelConverter","sap/m/MessageBox"],function(t,e,n,o,i,s){"use strict";var r={};var c=o.
|
|
211
|
-
/*!
|
|
212
|
-
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
213
|
-
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
214
|
-
*/
|
|
215
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/CollaborationCommon", ["sap/fe/core/helpers/BindingToolkit","sap/fe/macros/CommonHelper","sap/ui/core/Component","sap/ui/core/Core","../../formatters/CollaborationFormatter"],function(e,t,n,o,r){"use strict";var i={};var a=e.getExpressionFromAnnotation;var s=e.formatResult;var l=e.constant;var c=e.compileExpression;let u;(function(e){e[e["NotYetInvited"]=0]="NotYetInvited";e[e["NoChangesMade"]=1]="NoChangesMade";e[e["ChangesMade"]=2]="ChangesMade";e[e["CurrentlyEditing"]=3]="CurrentlyEditing"})(u||(u={}));i.UserStatus=u;let g;(function(e){e["NoChanges"]="N";e["InProgress"]="P"})(g||(g={}));i.UserEditingState=g;let d;(function(e){e["Join"]="JOIN";e["JoinEcho"]="JOINECHO";e["Leave"]="LEAVE";e["Change"]="CHANGE";e["Create"]="CREATE";e["Delete"]="DELETE";e["Action"]="ACTION";e["LiveChange"]="LIVECHANGE";e["Activate"]="ACTIVATE";e["Discard"]="DISCARD";e["Undo"]="UNDO"})(d||(d={}));i.Activity=d;const f="Users";const p="UserID";function C(e){const t=["Dr.","Prof.","Prof. Dr.","B.A.","MBA","Ph.D."];t.forEach(function(t){e=e.replace(t,"")});let n;const o=e.trimStart().split(" ");if(o.length>1){var r,i;n=((o===null||o===void 0?void 0:(r=o.shift())===null||r===void 0?void 0:r.charAt(0))||"")+((i=o.pop())===null||i===void 0?void 0:i.charAt(0))}else{n=e.substring(0,2)}return n.toUpperCase()}function m(e,t,n){const o=t.find(t=>t.id===e);if(o){return o.color}else{for(let e=1;e<=10;e++){if(t.findIndex(t=>t.color===e)===-1&&n.findIndex(t=>t.color===e)===-1){return e}}return 10}}function A(e){const n=e.targetEntitySet.annotations.Common.DraftRoot.ShareAction.toString();const o=e.targetEntityType.resolvePath(n);const r=o.parameters.find(e=>e.name===f);const i={name:t.addSingleQuotes("sap/fe/macros/valuehelp/ValueHelpDelegate"),payload:{propertyPath:t.addSingleQuotes(`/${r.type}/${p}`),qualifiers:{},valueHelpQualifier:t.addSingleQuotes(""),isActionParameterDialog:true}};return t.objectToString(i)}i.getValueHelpDelegate=A;function h(e){if(e.isA("sap.fe.core.AppComponent")){return e}const t=n.getOwnerComponentFor(e);if(!t){return e}else{return h(t)}}function v(e){const t=h(e).getShellServices();if(!t||!t.hasUShell()){throw"No Shell... No User"}return{initials:t.getUser().getInitials(),id:t.getUser().getId(),name:`${t.getUser().getFullName()} (${E("C_COLLABORATIONDRAFT_YOU")})`,initialName:t.getUser().getFullName(),color:6,me:true,status:u.CurrentlyEditing}}function E(e){const t=o.getLibraryResourceBundle("sap.fe.core");for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return t.getText(e,r)}i.getText=E;function I(e){var t;const n=e.targetObject;const o=a((t=n.Title)===null||t===void 0?void 0:t.Value,[],"");const i=["C_COLLABORATIONDRAFT_INVITATION_DIALOG",l(n.TypeName),o];const u=s(i,r.getFormattedText);return c(u)}i.getInvitationDialogTitleExpBinding=I;const N={formatInitials:C,getUserColor:m,getMe:v,getAppComponent:h,getText:E,getInvitationDialogTitleExpBinding:I};i.CollaborationUtils=N;function T(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];const n=e.getModel();const o=n.getMetaModel();const r=o.getMetaPath(e);const i=o.getObject(`${r}@com.sap.vocabularies.Common.v1.DraftRoot/ShareAction`);const a=n.bindContext(`${i}(...)`,e);a.setParameter("Users",t);a.setParameter("ShareAll",true);return a.execute()}i.shareObject=T;return i},false);
|
|
215
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/ActivitySync", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/collaboration/ActivityBase","sap/fe/core/controllerextensions/collaboration/CollaborationCommon","sap/fe/core/converters/MetaModelConverter","sap/m/MessageBox"],function(t,e,n,o,i,s){"use strict";var r={};var c=o.getActivityKeyFromPath;var a=o.CollaborationUtils;var l=o.Activity;var d=n.isCollaborationConnected;var g=n.initializeCollaboration;var f=n.endCollaboration;var u=n.broadcastCollaborationMessage;const p="/collaboration/myActivity";const C="/collaboration/activeUsers";const v="/collaboration/activities";const h="$auto.sync";const y=function(t){const e=t.getModel("internal");return d(e)};r.isConnected=y;const M=function(t,e,n,o,i,s){if(y(t)){const r=t.getModel("internal");const c=Array.isArray(n)?n.join("|"):n;const a=s===null||s===void 0?void 0:s.join("|");const d=r.getProperty(p);if(e===l.LiveChange){if(d===c){return}else{r.setProperty(p,c)}}else{if(e===l.Undo&&d===null){return}r.setProperty(p,null)}u(e,c,r,o,i,a)}};r.send=M;const P=function(t){return t.getModel().getMetaModel().getObject("/@com.sap.vocabularies.Common.v1.WebSocketBaseURL")};const b=function(t){const e=(t===null||t===void 0?void 0:t.getBindingContext)&&t.getBindingContext();return!!(e&&P(e))};r.isCollaborationEnabled=b;const m=async function(t){const e=t.getModel("internal");const n=a.getMe(t);if(!n){return}const o=t.getBindingContext();const i=P(o);const s=o.getModel().getServiceUrl();if(!i){return}const r=await o.requestProperty("DraftAdministrativeData/DraftUUID");if(!r){return}g(n,i,r,s,e,e=>{x(e,t)});e.setProperty(p,null)};r.connect=m;const A=function(t){const e=t.getModel("internal");f(e)};r.disconnect=A;function x(t,e){var n;const o=e.getModel("internal");let i=o.getProperty(C);let s;let r;const d=R(e,t.clientContent);t.userAction=t.userAction||t.clientAction;const g={id:t.userID,name:t.userDescription,initials:a.formatInitials(t.userDescription),color:a.getUserColor(t.userID,i,[])};let f=g;switch(t.userAction){case l.Join:case l.JoinEcho:if(i.findIndex(t=>t.id===g.id)===-1){i.unshift(g);o.setProperty(C,i)}if(t.userAction===l.Join){u(l.JoinEcho,o.getProperty(p),o)}if(t.userAction===l.JoinEcho){if(t.clientContent){t.userAction=l.LiveChange;x(t,e)}}break;case l.Leave:i=i.filter(t=>t.id!==g.id||t.me);o.setProperty(C,i);const h=o.getProperty(v)||{};const y=function(t){if(Array.isArray(t)){return t.filter(t=>t.id!==g.id)}else{for(const e in t){t[e]=y(t[e])}return t}};y(h);o.setProperty(v,h);break;case l.Change:D(e,t);break;case l.Create:I(e,t);break;case l.Delete:O(e,t);break;case l.Activate:E(e,t.clientContent,a.getText("C_COLLABORATIONDRAFT_ACTIVATE",g.name));break;case l.Discard:E(e,t.clientContent,a.getText("C_COLLABORATIONDRAFT_DISCARD",g.name));break;case l.Action:k(e,t);break;case l.LiveChange:f=g;f.key=c(t.clientContent);let M="";const P=d.split("/");for(let t=1;t<P.length-1;t++){M+=`/${P[t]}`;if(!o.getProperty(v+M)){o.setProperty(v+M,{})}}s=o.getProperty(v+d);s=(n=s)!==null&&n!==void 0&&n.slice?s.slice():[];s.push(f);o.setProperty(v+d,s);break;case l.Undo:s=o.getProperty(v+d);r=c(t.clientContent);o.setProperty(v+d,s.filter(t=>t.key!==r));break}}function E(e,n,o){A(e);s.information(o);e.getBindingContext().getBinding().resetChanges().then(function(){T(n,e)}).catch(function(){t.error("Pending Changes could not be reset - still navigating to active instance");T(n,e)})}function D(t,e){const n=e.clientContent.split("|");const o=t.getModel().getMetaModel();const i=t.getModel("internal");n.forEach(t=>{var e;const n=o.getMetaPath(t);const s=c(t);let r=i.getProperty(v+n)||[];r=((e=r)===null||e===void 0?void 0:e.filter)&&r.filter(t=>t.key!==s);if(r){i.setProperty(v+n,r)}});const s=w(t);const r=s.getBindingContext();const a=n.map(e=>B(t,e));s.getController().editFlow.updateDocument(r,Promise.all(a))}async function B(e,n){const o=e.getModel().getMetaModel();const s=o.getMetaContext(n);const r=i.getInvolvedDataModelObjects(s);const c=n.substring(0,n.lastIndexOf("/"));const l=L(e,c);const d=c.substring(0,c.lastIndexOf("("));const g=d.substring(0,d.lastIndexOf("/"));const f=g?L(e,g):undefined;if(!l&&!f){return}try{const t=[];const i=a.getAppComponent(e).getSideEffectsService();if(l){const e=o.getMetaPath(l.getPath());const s=o.getMetaPath(n).replace(e,"").slice(1);t.push(i.requestSideEffects([s],l,h))}const s=i.computeFieldGroupIds(r.targetEntityType.fullyQualifiedName,r.targetObject.fullyQualifiedName);if(s.length){const n=e.getController();const o=n._sideEffects.getSideEffectsMapForFieldGroups(s,l||f);Object.keys(o).forEach(e=>{const i=o[e];t.push(n._sideEffects.requestSideEffects(i.sideEffects,i.context,h))})}await Promise.all(t)}catch(e){t.error("Failed to update data after change:"+e);throw e}}function O(t,e){const n=w(t);const o=n.getBindingContext();const i=o.getPath();const r=e.clientContent.split("|");const c=r.find(t=>i.startsWith(t));if(c){s.information(a.getText("C_COLLABORATIONDRAFT_DELETE",e.userDescription),{onClose:()=>{const e=o.getModel().getKeepAliveContext(c);e.setKeepAlive(false);const i=S(t,r[0]);n.getController().editFlow.updateDocument(n.getBindingContext(),i);n.getController()._routing.navigateBackFromContext(e)}})}else{const e=S(t,r[0]);n.getController().editFlow.updateDocument(n.getBindingContext(),e)}}function I(t,e){const n=w(t);const o=e.clientContent.split("|");const i=S(t,o[0]);n.getController().editFlow.updateDocument(n.getBindingContext(),i)}async function S(e,n){const o=a.getAppComponent(e);const i=n.substring(0,n.lastIndexOf("/"));const s=L(e,i);if(s){try{const t=[];const e=s.getModel().getMetaModel();const i=e.getMetaPath(n);const r=e.getMetaPath(s.getPath());const c=i.replace(`${r}/`,"");const a=o.getSideEffectsService();t.push(a.requestSideEffects([c],s,h));t.push(a.requestSideEffectsForNavigationProperty(c,s,h));await Promise.all(t)}catch(e){t.error("Failed to update data after collection update:"+e)}}}function k(t,e){var n;const o=w(t);const i=e.clientContent.split("|");const s=e.clientTriggeredActionName||"";const r=(n=e.clientRequestedProperties)===null||n===void 0?void 0:n.split("|");const c=e.clientRefreshListBinding==="true";let a=[];if(c){a.push(S(t,i[0]))}else{a=i.map(e=>F(t,e,s,r))}o.getController().editFlow.updateDocument(o.getBindingContext(),Promise.all(a))}async function F(t,e,n,o){const s=L(t,e);if(!s){return}const r=a.getAppComponent(t);const c=r.getSideEffectsService();const l=c.getODataActionSideEffects(n,s);const d=[];if(l){var g;if((g=l.pathExpressions)!==null&&g!==void 0&&g.length){d.push(c.requestSideEffects(l.pathExpressions,s,h))}}if(o&&o.length>0){const n=t.getModel().getMetaModel();const r=R(t,e);const a=i.getInvolvedDataModelObjects(n.getContext(r));const l=a.targetEntityType.entityProperties.map(t=>t.name).filter(t=>o.includes(t));if(l.length>0){d.push(c.requestSideEffects(l,s,h))}}await Promise.all(d)}function L(t,e){if(!e){return undefined}const n=[];while(!e.endsWith(")")){n.unshift(e);e=e.substring(0,e.lastIndexOf("/"))}n.unshift(e);const o=e.substring(0,e.lastIndexOf("("));let i;let s=w(t).getBindingContext();while(s&&!i){var r;if(n.indexOf(s.getPath())>=0){i=s}s=(r=s.getBinding())===null||r===void 0?void 0:r.getContext()}if(i){return i}const c=w(t).getBindingContext().getModel();const a=c.getAllBindings().find(t=>{const e=t.isRelative()?t.getResolvedPath():t.getPath();return t.isA("sap.ui.model.odata.v4.ODataListBinding")&&e===o});i=a===null||a===void 0?void 0:a.getAllCurrentContexts().find(t=>n.indexOf(t.getPath())>=0);return i}function T(t,e){const n=w(e);const o=e.getModel().bindContext(t).getBoundContext();n.getController().routing.navigate(o)}function w(t){const n=a.getAppComponent(t);return e.getCurrentPageView(n)}function R(t,e){let n="";if(e){const o=e.split("|")[0];n=t.getModel().getMetaModel().getMetaPath(o)}return n}return{connect:m,disconnect:A,isConnected:y,isCollaborationEnabled:b,send:M}},false);
|
|
216
216
|
/*!
|
|
217
217
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
218
218
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
219
219
|
*/
|
|
220
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/
|
|
220
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/collaboration/CollaborationCommon", ["sap/ui/core/Component","sap/ui/core/Core"],function(e,t){"use strict";var n={};let r;(function(e){e[e["NotYetInvited"]=0]="NotYetInvited";e[e["NoChangesMade"]=1]="NoChangesMade";e[e["ChangesMade"]=2]="ChangesMade";e[e["CurrentlyEditing"]=3]="CurrentlyEditing"})(r||(r={}));n.UserStatus=r;let o;(function(e){e["NoChanges"]="N";e["InProgress"]="P"})(o||(o={}));n.UserEditingState=o;let i;(function(e){e["Join"]="JOIN";e["JoinEcho"]="JOINECHO";e["Leave"]="LEAVE";e["Change"]="CHANGE";e["Create"]="CREATE";e["Delete"]="DELETE";e["Action"]="ACTION";e["LiveChange"]="LIVECHANGE";e["Activate"]="ACTIVATE";e["Discard"]="DISCARD";e["Undo"]="UNDO"})(i||(i={}));n.Activity=i;function s(e){const t=["Dr.","Prof.","Prof. Dr.","B.A.","MBA","Ph.D."];t.forEach(function(t){e=e.replace(t,"")});let n;const r=e.trimStart().split(" ");if(r.length>1){var o,i;n=((r===null||r===void 0?void 0:(o=r.shift())===null||o===void 0?void 0:o.charAt(0))||"")+((i=r.pop())===null||i===void 0?void 0:i.charAt(0))}else{n=e.substring(0,2)}return n.toUpperCase()}function a(e,t,n){const r=t.find(t=>t.id===e);if(r){return r.color}else{for(let e=1;e<=10;e++){if(t.findIndex(t=>t.color===e)===-1&&n.findIndex(t=>t.color===e)===-1){return e}}return 10}}function l(t){if(t.isA("sap.fe.core.AppComponent")){return t}const n=e.getOwnerComponentFor(t);if(!n){return t}else{return l(n)}}function c(e){const t=l(e).getShellServices();if(!t||!t.hasUShell()){throw"No Shell... No User"}return{initials:t.getUser().getInitials(),id:t.getUser().getId(),name:`${t.getUser().getFullName()} (${u("C_COLLABORATIONDRAFT_YOU")})`,initialName:t.getUser().getFullName(),color:6,me:true,status:r.CurrentlyEditing}}function u(e){const n=t.getLibraryResourceBundle("sap.fe.core");for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}return n.getText(e,o)}n.getText=u;const g={formatInitials:s,getUserColor:a,getMe:c,getAppComponent:l,getText:u};n.CollaborationUtils=g;function f(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];const n=e.getModel();const r=n.getMetaModel();const o=r.getMetaPath(e);const i=r.getObject(`${o}@com.sap.vocabularies.Common.v1.DraftRoot/ShareAction`);const s=n.bindContext(`${i}(...)`,e);s.setParameter("Users",t);s.setParameter("ShareAll",true);return s.execute()}n.shareObject=f;function d(e){return e.substring(e.lastIndexOf("(")+1,e.lastIndexOf(")"))}n.getActivityKeyFromPath=d;return n},false);
|
|
221
221
|
/*!
|
|
222
222
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
223
223
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -227,22 +227,22 @@ sap.ui.predefine("sap/fe/core/controllerextensions/dialog/OperationsDialog.block
|
|
|
227
227
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
228
228
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
229
229
|
*/
|
|
230
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog", ["sap/fe/core/templating/EntityTypeHelper","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/List","sap/m/Text","sap/m/VBox","sap/fe/core/jsx-runtime/jsx","sap/fe/core/jsx-runtime/Fragment","sap/fe/core/jsx-runtime/jsxs"],function(t,e,i,n,s,o,r,a,l,p
|
|
230
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog", ["sap/fe/core/templating/EntityTypeHelper","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/List","sap/m/Text","sap/m/VBox","sap/fe/core/jsx-runtime/jsx","sap/fe/core/jsx-runtime/Fragment","sap/fe/core/jsx-runtime/jsxs"],function(t,e,i,n,s,o,r,a,l,h,p){"use strict";var c={};var u=t.getTitleExpression;let d=function(){function t(t){this.totalContextCount=0;this.title=t.title;this.resourceModel=t.resourceModel;this.entityType=t.entityType;this.notApplicableContexts=t.notApplicableContexts;this._shouldContinue=false;this._dialog=this.createDialog();this._processingPromise=new Promise(t=>{this._fnResolve=t})}c=t;var d=t.prototype;d.onAfterClose=function t(){this._fnResolve(this._shouldContinue);this._dialog.destroy()};d.onContinue=function t(){this._shouldContinue=true;this._dialog.close()};d.open=async function t(e){e.addDependent(this._dialog);this._dialog.open();return this._processingPromise};d.getDialog=function t(){return this._dialog};d.createDialog=function t(){var c,d;return l(n,{state:"Warning",showHeader:true,contentWidth:"20rem",resizable:true,verticalScrolling:true,horizontalScrolling:true,class:"sapUiContentPadding",title:this.title,afterClose:this.onAfterClose.bind(this),children:{beginButton:l(e,{text:this.resourceModel.getText("C_ACTION_PARTIAL_FRAGMENT_SAPFE_CONTINUE_ANYWAY"),press:this.onContinue.bind(this),type:"Emphasized"}),endButton:l(e,{text:this.resourceModel.getText("C_COMMON_SAPFE_CLOSE"),press:()=>this._dialog.close()}),content:p(h,{children:[l(a,{children:l(r,{text:this.notApplicableContexts.length===1?this.resourceModel.getText("C_ACTION_PARTIAL_FRAGMENT_SAPFE_BOUND_ACTION"):this.resourceModel.getText("C_ACTION_PARTIAL_FRAGMENT_SAPFE_BOUND_ACTION_PLURAL",[this.notApplicableContexts.length]),class:"sapUiTinyMarginBegin sapUiTinyMarginTopBottom"})}),l(o,{headerText:(c=this.entityType.annotations.UI)===null||c===void 0?void 0:(d=c.HeaderInfo)===null||d===void 0?void 0:d.TypeNamePlural,showSeparators:"None",children:{items:this.notApplicableContexts.map(t=>{const e=u(this.entityType);const n=l(i,{children:l(s,{justifyContent:"Start",children:l(r,{text:e,class:"sapUiTinyMarginBegin sapUiTinyMarginTopBottom"})})});n.setBindingContext(t);return n})}})]})}})};return t}();c=d;return c},false);
|
|
231
231
|
/*!
|
|
232
232
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
233
233
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
234
234
|
*/
|
|
235
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/TransactionHelper", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/editFlow/operations","sap/fe/core/controllerextensions/editFlow/sticky","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/DeleteHelper","sap/fe/core/helpers/FPMHelper","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/m/MessageToast","sap/m/Popover","sap/m/Text","sap/m/VBox","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel","../../helpers/MetaModelFunction","../../helpers/ToES6Promise"],function(e,t,n,a,o,r,s,i,c,l,d,u,g,f,p,C,h,m,b,y,E,w,A,x,D,P,T,M){"use strict";var v=T.getRequiredPropertiesFromInsertRestrictions;var O=T.getNonComputedVisibleFields;var _=u.generate;var I=d.getResourceModel;const S=g.CreationMode;const N=g.ProgrammingModel;const B=A.ValueState;function R(e){if(e&&e.getMetadata&&e.getMetadata().getName()==="sap.ui.base.Event"){e={}}return e||{}}let k=function(){function d(){}var u=d.prototype;u.busyLock=function e(t,a){n.lock(t.getModel("ui"),a)};u.busyUnlock=function e(t,a){n.unlock(t.getModel("ui"),a)};u.getProgrammingModel=function e(t){let n;if(t.isA("sap.ui.model.odata.v4.Context")){n=t.getPath()}else{n=(t.isRelative()?t.getResolvedPath():t.getPath())??""}const a=t.getModel().getMetaModel();if(l.isDraftSupported(a,n)){return N.Draft}else if(l.isStickySessionSupported(a)){return N.Sticky}else{return N.NonDraft}};u.validateDocument=function e(t,n,a){const o=n&&n.customValidationFunction;if(o){const e=o.substring(0,o.lastIndexOf(".")||-1).replace(/\./gi,"/"),r=o.substring(o.lastIndexOf(".")+1,o.length),s=n.data;delete s["@$ui5.context.isTransient"];return c.validationWrapper(e,r,s,a,t)}return Promise.resolve([])};u.createDocument=async function t(n,a,r,s,i){const c=n.getModel(),d=c.getMetaModel(),u=d.getMetaPath(n.getHeaderContext().getPath()),f=r.getRouterProxy().getHash(),p=r.getComponentData(),C=p&&p.startupParameters||{},h=!n.isRelative()?this._getNewAction(C,f,d,u):undefined;const m={$$patchWithoutSideEffects:true};const b=d.getObject(`${u}/@com.sap.vocabularies.Common.v1.Messages/$Path`);let y="/busy";let w=d.getObject(`${u}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`)||d.getObject(`${l.getTargetEntitySet(d.getContext(u))}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`);let A;let x;if(w){if(d.getObject(`${u}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`)&&l.getTargetEntitySet(d.getContext(u))!==u){A=true}else{A=false}}if(b){m["$select"]=b}const D=R(a);if(!n){throw new Error("Binding required for new document creation")}const P=this.getProgrammingModel(n);if(P!==N.Draft&&P!==N.Sticky){throw new Error("Create document only allowed for draft or sticky session supported services")}if(D.busyMode==="Local"){y=`/busyLocal/${D.busyId}`}D.beforeCreateCallBack=i?null:D.beforeCreateCallBack;this.busyLock(r,y);const T=E.getLibraryResourceBundle("sap.fe.core");let v;try{if(h){v=await this.callAction(h,{contexts:n.getHeaderContext(),showActionParameterDialog:true,label:this._getSpecificCreateActionDialogLabel(d,u,h,T),bindingParameters:m,parentControl:D.parentControl,bIsCreateAction:true,skipParameterDialog:D.skipParameterDialog},null,r,s)}else{const t=D.creationMode!==S.CreationRow&&D.creationMode!==S.Inline;const a=t?O(d,u,r):[];w=i?null:w;let l,g;if(w){if(A){l=n.getContext()&&`${d.getMetaPath(n.getContext().getPath())}/${w}`;g=n.getContext()}else{l=n.getHeaderContext()&&`${d.getMetaPath(n.getHeaderContext().getPath())}/${w}`;g=n.getHeaderContext()}}const f=l&&d.createBindingContext(l);try{let t;try{const e=f&&f.getObject()&&f.getObject()[0].$IsBound?await o.callBoundFunction(w,g,c):await o.callFunctionImport(w,c);if(e){t=e.getObject()}}catch(t){e.error(`Error while executing the function ${w}`,t);throw t}D.data=t?Object.assign({},t,D.data):D.data;if(D.data){delete D.data["@odata.context"]}if(a.length>0){v=await this._launchDialogWithKeyFields(n,a,c,D,r,s);x=v.newContext}else{if(D.beforeCreateCallBack){await M(D.beforeCreateCallBack({contextPath:n&&n.getPath()}))}x=n.create(D.data,true,D.createAtEnd,D.inactive);if(!D.inactive){v=await this.onAfterCreateCompletion(n,x,D)}}}catch(t){e.error("Error while creating the new document",t);throw t}}x=x||v;await s.showMessageDialog({control:D.parentControl});return x}catch(e){var _;await s.showMessageDialog({control:D.parentControl});if((e===g.Constants.ActionExecutionFailed||e===g.Constants.CancelActionDialog)&&(_=x)!==null&&_!==void 0&&_.isTransient()){x.delete("$direct")}throw e}finally{this.busyUnlock(r,y)}};u._isDraftEnabled=function e(t){const n=t[0];const a=this.getProgrammingModel(n);return a===N.Draft};u.deleteDocument=function e(t,n,a,o,r){const c=E.getLibraryResourceBundle("sap.fe.core");let l;this.busyLock(a);const d=Array.isArray(t)?[...t]:[t];return new Promise((e,t)=>{try{const u=this._isDraftEnabled(n.selectedContexts||d);const g=[];const h=[];if(n){if(!n.numberOfSelectedContexts){if(u){const e=d.find(e=>{const t=e.getObject();return t.IsActiveEntity===true&&t.HasDraftEntity===true&&t.DraftAdministrativeData&&t.DraftAdministrativeData.InProcessByUser&&!t.DraftAdministrativeData.DraftIsCreatedByMe});if(e){const n=e.getObject().DraftAdministrativeData.InProcessByUser;C.show(o.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",[n]),{title:o.getText("C_COMMON_DELETE"),onClose:t});return}}n=R(n);let e="";if(n.title){if(n.description){l=[n.title+" ",n.description]}else{l=[n.title,""]}e=o.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",l,n.entitySetName)}else{e=o.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,n.entitySetName)}h.push({type:"deletableContexts",contexts:d,text:e,selected:true,control:"text"})}else{let e=d.length;if(u){e+=n.draftsWithNonDeletableActive.length+n.draftsWithDeletableActive.length+n.unSavedContexts.length+n.createModeContexts.length;i.updateDraftOptionsForDeletableTexts(n,d,e,o,g,h)}else{const t=i.getNonDeletableText(n,e,o);if(t){g.push(t)}}i.updateOptionsForDeletableTexts(n,d,o,h)}}i.updateContentForDeleteDialog(h,g);const m=new y({items:g});const b=c.getText("C_COMMON_DELETE");const E=async()=>{this.busyLock(a);try{await i.deleteConfirmHandler(h,n,r,o,a,u);e()}catch(e){t()}finally{this.busyUnlock(a)}};let w=false;const A=new p({title:b,state:"Warning",content:[m],ariaLabelledBy:g,beginButton:new f({text:c.getText("C_COMMON_DELETE"),type:"Emphasized",press:function(){s.removeBoundTransitionMessages();w=true;A.close();E()}}),endButton:new f({text:o.getText("C_COMMON_DIALOG_CANCEL"),press:function(){A.close()}}),afterClose:function(){A.destroy();if(!w){t()}}});if(n.noDialog){E()}else{A.addStyleClass("sapUiContentPadding");A.open()}}finally{this.busyUnlock(a)}})};u.editDocument=async function e(t,n,o,s){const i=this.getProgrammingModel(t);if(!t){throw new Error("Binding context to active document is required")}if(i!==N.Draft&&i!==N.Sticky){throw new Error("Edit is only allowed for draft or sticky session supported services")}this.busyLock(o);s.removeTransitionMessages();try{const e=i===N.Draft?await a.createDraftFromActiveDocument(t,o,{bPreserveChanges:true,oView:n}):await r.editDocumentInStickySession(t,o);await s.showMessageDialog();return e}catch(e){await s.showMessages({concurrentEditFlag:true});throw e}finally{this.busyUnlock(o)}};u.cancelDocument=async function e(t,n,o,s,i,c,l){if(!t){throw new Error("No context exists. Pass a meaningful context")}this.busyLock(o);const d=R(n);const u=t.getModel();const g=this.getProgrammingModel(t);if(g!==N.Draft&&g!==N.Sticky){throw new Error("Cancel document only allowed for draft or sticky session supported services")}try{let e=false;if(g===N.Draft&&!l){const e=u.bindContext(`${t.getPath()}/DraftAdministrativeData`).getBoundContext();const n=await e.requestObject();if(n){l=n.CreationDateTime!==n.LastChangeDateTime}}if(!d.skipDiscardPopover){await this._confirmDiscard(d.cancelButton,l,s)}if(t.isKeepAlive()){t.setKeepAlive(false)}if(d.beforeCancelCallBack){await d.beforeCancelCallBack({context:t})}if(g===N.Draft){if(c){if(t.hasPendingChanges()){t.getBinding().resetChanges()}e=await a.deleteDraft(t,o)}else{const n=u.bindContext(`${t.getPath()}/SiblingEntity`).getBoundContext();try{const a=await n.requestCanonicalPath();if(t.hasPendingChanges()){t.getBinding().resetChanges()}e=u.bindContext(a).getBoundContext()}finally{await a.deleteDraft(t,o)}}}else{const n=await r.discardDocument(t);if(n){if(n.hasPendingChanges()){n.getBinding().resetChanges()}if(!c){n.refresh();e=n}}}i.removeTransitionMessages();await i.showMessages();return e}catch(e){await i.showMessages();throw e}finally{this.busyUnlock(o)}};u.saveDocument=async function e(n,o,i,c,l,d,u){const g=this.getProgrammingModel(n);if(g!==N.Sticky&&g!==N.Draft){throw new Error("Save is only allowed for draft or sticky session supported services")}d.removeTransitionMessages();try{this.busyLock(o);const e=g===N.Draft?await a.activateDocument(n,o,{},d):await r.activateDocument(n,o);const t=s.getMessages().concat(s.getMessages(true,true));if(!(t.length===1&&t[0].type===A.MessageType.Success)){h.show(u?i.getText("C_TRANSACTION_HELPER_OBJECT_CREATED"):i.getText("C_TRANSACTION_HELPER_OBJECT_SAVED"))}return e}catch(e){if(c&&(l===null||l===void 0?void 0:l.length)>0){l.forEach(e=>{if(!t.hasTransientContext(e)){o.getSideEffectsService().requestSideEffectsForNavigationProperty(e.getPath(),n)}})}await d.showMessages();throw e}finally{this.busyUnlock(o)}};u.callAction=async function e(t,n,a,r,s){n=R(n);let i,c;const l=n.bindingParameters;if(!t){throw new Error("Provide name of action to be executed")}const d=t.split("/")[1];t=d||t;i=d?undefined:n.contexts;if(i&&(Array.isArray(i)&&i.length||!Array.isArray(i))){i=Array.isArray(i)?i[0]:i;c=i.getModel()}if(n.model){c=n.model}if(!c){throw new Error("Pass a context for a bound action or pass the model for an unbound action")}const u=r.getSideEffectsService().getODataActionSideEffects(t,i)||{};try{let e;if(i&&c){e=await o.callBoundAction(t,n.contexts,c,r,{parameterValues:n.parameterValues,invocationGrouping:n.invocationGrouping,label:n.label,skipParameterDialog:n.skipParameterDialog,mBindingParameters:l,entitySetName:n.entitySetName,additionalSideEffect:u,onSubmitted:()=>{s.removeTransitionMessages();this.busyLock(r)},onResponse:()=>{this.busyUnlock(r)},parentControl:n.parentControl,controlId:n.controlId,internalModelContext:n.internalModelContext,operationAvailableMap:n.operationAvailableMap,bIsCreateAction:n.bIsCreateAction,bGetBoundContext:n.bGetBoundContext,bObjectPage:n.bObjectPage,messageHandler:s,defaultValuesExtensionFunction:n.defaultValuesExtensionFunction,selectedItems:n.contexts})}else{e=await o.callActionImport(t,c,r,{parameterValues:n.parameterValues,label:n.label,skipParameterDialog:n.skipParameterDialog,bindingParameters:l,entitySetName:n.entitySetName,onSubmitted:()=>{this.busyLock(r)},onResponse:()=>{this.busyUnlock(r)},parentControl:n.parentControl,internalModelContext:n.internalModelContext,operationAvailableMap:n.operationAvailableMap,messageHandler:s,bObjectPage:n.bObjectPage})}await this._handleActionResponse(s,n,t);return e}catch(e){await this._handleActionResponse(s,n,t);throw e}};u._handleActionResponse=function e(t,n,a){const o=s.getMessages(true,true);const r=n.label?n.label:a;if(o.length>0&&n&&n.internalModelContext){n.internalModelContext.setProperty("sActionName",n.label?n.label:a)}let i;if(n.controlId){i=n.parentControl.byId(n.controlId)}else{i=n.parentControl}return t.showMessages({sActionName:r,control:i})};u.handleValidationError=function e(){const t=E.getMessageManager(),n=t.getMessageModel().getData().filter(function(e){if(e.validation){return e}});t.removeMessages(n)};u._createPopover=function e(t){return new m(t)};u._confirmDiscard=function e(t,n,a){if(!n){this.handleValidationError();return Promise.resolve()}t.setEnabled(false);return new Promise((e,n)=>{const o=this._createPopover({showHeader:false,placement:"Top"});o.addStyleClass("sapUiContentPadding");const r=new b({text:a.getText("C_TRANSACTION_HELPER_DRAFT_DISCARD_MESSAGE")});const s=new f({text:a.getText("C_TRANSACTION_HELPER_DRAFT_DISCARD_BUTTON"),width:"100%",press:()=>{this.handleValidationError();o.data("continueDiscard",true);o.close()},ariaLabelledBy:[r]});o.addContent(new y({items:[r,s]}));o.attachBeforeOpen(()=>{o.setInitialFocus(s)});o.attachAfterClose(()=>{t.setEnabled(true);if(o.data("continueDiscard")){e()}else{n()}});o.openBy(t,false)})};u._onFieldChange=function e(t,n,a,o){a.removeTransitionMessages();const r=t.getSource();const s=t.getParameter("promise");if(s){return s.then(function(e){r.setValue(e);o();return r.getValue()}).catch(function(e){if(e!==""){n.setEnabled(false)}else{r.setValue(e);o()}})}};u._launchDialogWithKeyFields=function e(a,o,r,s,i,c){let l;const d=s.parentControl;const u=r.bindList(a.getPath(),a.getContext(),[],[],{$$updateGroupId:"submitLater"});u.refreshInternal=function(){};const f=u.create(s.data,true);return new Promise(async(e,C)=>{const h="sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog";const m=D.loadTemplate(h,"fragment"),b=I(d),y=r.getMetaModel(),E=[],A=a.isRelative()?a.getResolvedPath():a.getPath(),T=y.createBindingContext(A),O=y.getMetaPath(A);for(const e in o){E.push(y.createBindingContext(`${O}/${o[e]}`))}const S=new P(E);const N=S.createBindingContext("/");const R=v(O,y);const k=new P(R);const L=k.createBindingContext("/");const F=await x.process(m,{name:h},{bindingContexts:{entitySet:T,fields:N,requiredProperties:L},models:{entitySet:T.getModel(),fields:N.getModel(),metaModel:y,requiredProperties:k}});let H=[];const $={};let U;const j=async function(){let e=false;try{const t=await Promise.all(H.map(function(e){return e.getFields()[0]}).filter(function(e){return e.getRequired()||e.getValueState()===B.Error}).map(async function(e){const t=e.getId();if(t in $){try{const n=await $[t];return e.getValue()===""?undefined:n}catch(e){return undefined}}return e.getValue()===""?undefined:e.getValue()}));e=t.every(function(e){if(Array.isArray(e)){e=e[0]}return e!==undefined&&e!==null&&e!==""})}catch(t){e=false}U.setEnabled(e)};const V={handleChange:e=>{const t=e.getParameter("id");$[t]=this._onFieldChange(e,U,c,j)},handleLiveChange:e=>{const t=e.getParameter("id");const n=e.getParameter("value");$[t]=n;j()}};const W=await w.load({definition:F,controller:V});let G;const q=function(){if(G.error){C(G.error)}else{e(G.response)}l.close()};l=new p(_(["CreateDialog",O]),{title:b.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"),content:[W],beginButton:{text:b.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"),type:"Emphasized",press:async e=>{const t=e.getSource();t.setEnabled(false);n.lock(l);s.bIsCreateDialog=true;try{const e=await Promise.all(Object.keys($).map(async function(e){const t=await $[e];const n={};n[e]=t;return n}));if(s.beforeCreateCallBack){await M(s.beforeCreateCallBack({contextPath:a&&a.getPath(),createParameters:e}))}const t=f.getObject();const n={};Object.keys(t).forEach(function(e){const a=y.getObject(`${O}/${e}`);if(a&&a.$kind==="NavigationProperty"){return}n[e]=t[e]});const o=a.create(n,true,s.createAtEnd,s.inactive);const r=this.onAfterCreateCompletion(a,o,s);let i=await r;if(!i||i&&i.bKeepDialogOpen!==true){i=i??{};l.setBindingContext(null);i.newContext=o;G={response:i};q()}}catch(e){if(e!==g.Constants.CreationFailed){G={error:e};q()}else{t.setEnabled(true)}}finally{n.unlock(l);c.showMessages()}}},endButton:{text:b.getText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL"),press:function(){G={error:g.Constants.CancelActionDialog};q()}},afterClose:function(){var e;(e=l.getBindingContext("internal"))===null||e===void 0?void 0:e.setProperty("isCreateDialogOpen",false);l.destroy();u.destroy()}});H=W===null||W===void 0?void 0:W.getAggregation("form").getAggregation("formContainers")[0].getAggregation("formElements");if(d&&d.addDependent){d.addDependent(l)}U=l.getBeginButton();l.setBindingContext(f);try{await t.setUserDefaults(i,E,f,false,s.createAction,s.data);j();l.getBindingContext("internal").setProperty("isCreateDialogOpen",true);l.open()}catch(e){await c.showMessages();throw e}})};u.onAfterCreateCompletion=function t(n,a,o){let r;const s=new Promise(e=>{r=e});const i=e=>{const t=e.getParameter("context"),o=e.getParameter("success");if(t===a){n.detachCreateCompleted(i,this);r(o)}};const c=()=>{a.created().then(undefined,function(){e.trace("transient creation context deleted")}).catch(function(t){e.trace("transient creation context deletion error",t)})};n.attachCreateCompleted(i,this);return s.then(e=>{if(!e){if(!o.keepTransientContextOnFailed){c();n.resetChanges();n.getModel().resetChanges(n.getUpdateGroupId());throw g.Constants.CreationFailed}return{bKeepDialogOpen:true}}else{return a.created()}})};u._getNewAction=function e(t,n,a,o){let r;if(t&&t.preferredMode&&n.toUpperCase().indexOf("I-ACTION=CREATEWITH")>-1){const e=t.preferredMode[0];r=e.toUpperCase().indexOf("CREATEWITH:")>-1?e.substr(e.lastIndexOf(":")+1):undefined}else if(t&&t.preferredMode&&n.toUpperCase().indexOf("I-ACTION=AUTOCREATEWITH")>-1){const e=t.preferredMode[0];r=e.toUpperCase().indexOf("AUTOCREATEWITH:")>-1?e.substr(e.lastIndexOf(":")+1):undefined}else{r=a&&a.getObject!==undefined?a.getObject(`${o}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`)||a.getObject(`${o}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`):undefined}return r};u._getSpecificCreateActionDialogLabel=function e(t,n,a,o){const r=function(){if(t&&t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`)){const e=t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`).findIndex(function(e){const t=e.Action?e.Action.split("("):undefined;return t?t[0]===a:false});return e>-1?t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`)[e].Label:undefined}else{return undefined}};return r()||t&&t.getObject(`${n}/${a}@com.sap.vocabularies.Common.v1.Label`)||o&&o.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE")};return d}();const L=new k;return L},false);
|
|
235
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/TransactionHelper", ["sap/base/Log","sap/fe/core/ActionRuntime","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/editFlow/draft","sap/fe/core/controllerextensions/editFlow/operations","sap/fe/core/controllerextensions/editFlow/sticky","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/DeleteHelper","sap/fe/core/helpers/FPMHelper","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/m/MessageToast","sap/m/Popover","sap/m/Text","sap/m/VBox","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel","../../helpers/MetaModelFunction","../../helpers/ToES6Promise"],function(e,t,n,o,a,r,s,i,c,l,d,u,g,f,p,C,h,m,b,y,E,w,A,D,x,M,P,T,v){"use strict";var O=T.getRequiredPropertiesFromInsertRestrictions;var _=T.getNonComputedVisibleFields;var I=g.generate;var S=u.getResourceModel;const N=f.CreationMode;const R=f.ProgrammingModel;const B=c.DeleteOptionTypes;const k=c.DeleteDialogContentControl;function L(e){if(e&&e.getMetadata&&e.getMetadata().getName()==="sap.ui.base.Event"){e={}}return e||{}}let F=function(){function u(){}var g=u.prototype;g.busyLock=function e(t,n){o.lock(t.getModel("ui"),n)};g.busyUnlock=function e(t,n){o.unlock(t.getModel("ui"),n)};g.getProgrammingModel=function e(t){let n;if(t.isA("sap.ui.model.odata.v4.Context")){n=t.getPath()}else{n=(t.isRelative()?t.getResolvedPath():t.getPath())??""}const o=t.getModel().getMetaModel();if(d.isDraftSupported(o,n)){return R.Draft}else if(d.isStickySessionSupported(o)){return R.Sticky}else{return R.NonDraft}};g.validateDocument=function e(t,n,o){const a=n&&n.customValidationFunction;if(a){const e=a.substring(0,a.lastIndexOf(".")||-1).replace(/\./gi,"/"),r=a.substring(a.lastIndexOf(".")+1,a.length),s=n.data;delete s["@$ui5.context.isTransient"];return l.validationWrapper(e,r,s,o,t)}return Promise.resolve([])};g.createDocument=async function t(n,o,a,s,i){const c=n.getModel(),l=c.getMetaModel(),u=l.getMetaPath(n.getHeaderContext().getPath()),g=a.getRouterProxy().getHash(),p=a.getComponentData(),C=p&&p.startupParameters||{},h=!n.isRelative()?this._getNewAction(C,g,l,u):undefined;const m={$$patchWithoutSideEffects:true};const b=l.getObject(`${u}/@com.sap.vocabularies.Common.v1.Messages/$Path`);let y="/busy";let E=l.getObject(`${u}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`)||l.getObject(`${d.getTargetEntitySet(l.getContext(u))}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`);let A;let D;if(E){if(l.getObject(`${u}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`)&&d.getTargetEntitySet(l.getContext(u))!==u){A=true}else{A=false}}if(b){m["$select"]=b}const x=L(o);if(!n){throw new Error("Binding required for new document creation")}const M=this.getProgrammingModel(n);if(M!==R.Draft&&M!==R.Sticky){throw new Error("Create document only allowed for draft or sticky session supported services")}if(x.busyMode==="Local"){y=`/busyLocal/${x.busyId}`}x.beforeCreateCallBack=i?null:x.beforeCreateCallBack;this.busyLock(a,y);const P=w.getLibraryResourceBundle("sap.fe.core");let T;try{if(h){T=await this.callAction(h,{contexts:n.getHeaderContext(),showActionParameterDialog:true,label:this._getSpecificCreateActionDialogLabel(l,u,h,P),bindingParameters:m,parentControl:x.parentControl,bIsCreateAction:true,skipParameterDialog:x.skipParameterDialog},null,a,s)}else{const t=x.creationMode!==N.CreationRow&&x.creationMode!==N.Inline;const o=t?_(l,u,a):[];E=i?null:E;let d,g;if(E){if(A){d=n.getContext()&&`${l.getMetaPath(n.getContext().getPath())}/${E}`;g=n.getContext()}else{d=n.getHeaderContext()&&`${l.getMetaPath(n.getHeaderContext().getPath())}/${E}`;g=n.getHeaderContext()}}const f=d&&l.createBindingContext(d);try{let t;try{const e=f&&f.getObject()&&f.getObject()[0].$IsBound?await r.callBoundFunction(E,g,c):await r.callFunctionImport(E,c);if(e){t=e.getObject()}}catch(t){e.error(`Error while executing the function ${E}`,t);throw t}x.data=t?Object.assign({},t,x.data):x.data;if(x.data){delete x.data["@odata.context"]}if(o.length>0){T=await this._launchDialogWithKeyFields(n,o,c,x,a,s);D=T.newContext}else{if(x.beforeCreateCallBack){await v(x.beforeCreateCallBack({contextPath:n&&n.getPath()}))}D=n.create(x.data,true,x.createAtEnd,x.inactive);if(!x.inactive){T=await this.onAfterCreateCompletion(n,D,x)}}}catch(t){e.error("Error while creating the new document",t);throw t}}D=D||T;await s.showMessageDialog({control:x.parentControl});return D}catch(e){var O;await s.showMessageDialog({control:x.parentControl});if((e===f.Constants.ActionExecutionFailed||e===f.Constants.CancelActionDialog)&&(O=D)!==null&&O!==void 0&&O.isTransient()){D.delete("$direct")}throw e}finally{this.busyUnlock(a,y)}};g._isDraftEnabled=function e(t){const n=t[0];const o=this.getProgrammingModel(n);return o===R.Draft};g.deleteDocument=function e(t,n,o,a,r){const s=w.getLibraryResourceBundle("sap.fe.core");let l;this.busyLock(o);const d=Array.isArray(t)?[...t]:[t];return new Promise((e,t)=>{try{const u=this._isDraftEnabled(n.selectedContexts||d);const g=[];let f=[];if(n){if(!n.numberOfSelectedContexts){if(u){const e=d.find(e=>{const t=e.getObject();return t.IsActiveEntity===true&&t.HasDraftEntity===true&&t.DraftAdministrativeData&&t.DraftAdministrativeData.InProcessByUser&&!t.DraftAdministrativeData.DraftIsCreatedByMe});if(e){const n=e.getObject().DraftAdministrativeData.InProcessByUser;h.show(a.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",[n]),{title:a.getText("C_COMMON_DELETE"),onClose:t});return}}n=L(n);let e="";if(n.title){if(n.description){l=[n.title+" ",n.description]}else{l=[n.title,""]}e=a.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",l,n.entitySetName)}else{e=a.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,n.entitySetName)}f.push({type:B.deletableContexts,contexts:d,text:e,selected:true,control:k.TEXT})}else{let e=d.length;if(u){e+=n.draftsWithNonDeletableActive.length+n.draftsWithDeletableActive.length+n.unSavedContexts.length;c.updateDraftOptionsForDeletableTexts(n,d,e,a,g,f)}else{const t=c.getNonDeletableText(n,e,a);if(t){g.push(t)}}const t=c.getOptionsForDeletableTexts(n,d,a);f=[...f,...t]}}c.updateContentForDeleteDialog(f,g);const m=new E({items:g});const b=s.getText("C_COMMON_DELETE");const y=async()=>{this.busyLock(o);try{await c.deleteConfirmHandler(f,n,r,a,o,u);e()}catch(e){t()}finally{this.busyUnlock(o)}};let w=false;const A=new C({title:b,state:"Warning",content:[m],ariaLabelledBy:g,beginButton:new p({text:s.getText("C_COMMON_DELETE"),type:"Emphasized",press:function(){i.removeBoundTransitionMessages();w=true;A.close();y()}}),endButton:new p({text:a.getText("C_COMMON_DIALOG_CANCEL"),press:function(){A.close()}}),afterClose:function(){A.destroy();if(!w){t()}}});if(n.noDialog){y()}else{A.addStyleClass("sapUiContentPadding");A.open()}}finally{this.busyUnlock(o)}})};g.editDocument=async function e(t,n,o,r){const i=this.getProgrammingModel(t);if(!t){throw new Error("Binding context to active document is required")}if(i!==R.Draft&&i!==R.Sticky){throw new Error("Edit is only allowed for draft or sticky session supported services")}this.busyLock(o);r.removeTransitionMessages();try{const e=i===R.Draft?await a.createDraftFromActiveDocument(t,o,{bPreserveChanges:true,oView:n}):await s.editDocumentInStickySession(t,o);await r.showMessageDialog();return e}catch(e){await r.showMessages({concurrentEditFlag:true});throw e}finally{this.busyUnlock(o)}};g.cancelDocument=async function e(t,n,o,r,i,c,l){if(!t){throw new Error("No context exists. Pass a meaningful context")}this.busyLock(o);const d=L(n);const u=t.getModel();const g=this.getProgrammingModel(t);if(g!==R.Draft&&g!==R.Sticky){throw new Error("Cancel document only allowed for draft or sticky session supported services")}try{let e=false;if(g===R.Draft&&!l){const e=u.bindContext(`${t.getPath()}/DraftAdministrativeData`).getBoundContext();const n=await e.requestObject();if(n){l=n.CreationDateTime!==n.LastChangeDateTime}}if(!d.skipDiscardPopover){await this._confirmDiscard(d.cancelButton,l,r)}if(t.isKeepAlive()){t.setKeepAlive(true,undefined)}if(d.beforeCancelCallBack){await d.beforeCancelCallBack({context:t})}if(g===R.Draft){if(c){if(t.hasPendingChanges()){t.getBinding().resetChanges()}e=await a.deleteDraft(t,o)}else{const n=u.bindContext(`${t.getPath()}/SiblingEntity`).getBoundContext();try{const o=await n.requestCanonicalPath();if(t.hasPendingChanges()){t.getBinding().resetChanges()}e=u.bindContext(o).getBoundContext()}finally{await a.deleteDraft(t,o)}}}else{const n=await s.discardDocument(t);if(n){if(n.hasPendingChanges()){n.getBinding().resetChanges()}if(!c){n.refresh();e=n}}}i.removeTransitionMessages();await i.showMessages();return e}catch(e){await i.showMessages();throw e}finally{this.busyUnlock(o)}};g.saveDocument=async function e(t,o,r,c,l,d,u){const g=this.getProgrammingModel(t);if(g!==R.Sticky&&g!==R.Draft){throw new Error("Save is only allowed for draft or sticky session supported services")}try{this.busyLock(o);const e=g===R.Draft?await a.activateDocument(t,o,{},d):await s.activateDocument(t,o);const n=i.getMessages().concat(i.getMessages(true,true));if(!(n.length===1&&n[0].type===D.MessageType.Success)){m.show(u?r.getText("C_TRANSACTION_HELPER_OBJECT_CREATED"):r.getText("C_TRANSACTION_HELPER_OBJECT_SAVED"))}return e}catch(e){if(c&&(l===null||l===void 0?void 0:l.length)>0){l.forEach(e=>{if(!n.hasTransientContext(e)){o.getSideEffectsService().requestSideEffectsForNavigationProperty(e.getPath(),t)}})}await d.showMessages();throw e}finally{this.busyUnlock(o)}};g.callAction=async function e(t,n,o,a,s){n=L(n);let i,c;const l=n.bindingParameters;if(!t){throw new Error("Provide name of action to be executed")}const d=t.split("/")[1];t=d||t;i=d?undefined:n.contexts;if(i&&(Array.isArray(i)&&i.length||!Array.isArray(i))){i=Array.isArray(i)?i[0]:i;c=i.getModel()}if(n.model){c=n.model}if(!c){throw new Error("Pass a context for a bound action or pass the model for an unbound action")}const u=a.getSideEffectsService().getODataActionSideEffects(t,i)||{};try{let e;if(i&&c){e=await r.callBoundAction(t,n.contexts,c,a,{parameterValues:n.parameterValues,invocationGrouping:n.invocationGrouping,label:n.label,skipParameterDialog:n.skipParameterDialog,mBindingParameters:l,entitySetName:n.entitySetName,additionalSideEffect:u,onSubmitted:()=>{s.removeTransitionMessages();this.busyLock(a)},onResponse:()=>{this.busyUnlock(a)},parentControl:n.parentControl,controlId:n.controlId,internalModelContext:n.internalModelContext,operationAvailableMap:n.operationAvailableMap,bIsCreateAction:n.bIsCreateAction,bGetBoundContext:n.bGetBoundContext,bObjectPage:n.bObjectPage,messageHandler:s,defaultValuesExtensionFunction:n.defaultValuesExtensionFunction,selectedItems:n.contexts})}else{e=await r.callActionImport(t,c,a,{parameterValues:n.parameterValues,label:n.label,skipParameterDialog:n.skipParameterDialog,bindingParameters:l,entitySetName:n.entitySetName,onSubmitted:()=>{this.busyLock(a)},onResponse:()=>{this.busyUnlock(a)},parentControl:n.parentControl,internalModelContext:n.internalModelContext,operationAvailableMap:n.operationAvailableMap,messageHandler:s,bObjectPage:n.bObjectPage})}await this._handleActionResponse(s,n,t);return e}catch(e){await this._handleActionResponse(s,n,t);throw e}};g._handleActionResponse=function e(t,n,o){const a=i.getMessages(true,true);const r=n.label?n.label:o;if(a.length>0&&n&&n.internalModelContext){n.internalModelContext.setProperty("sActionName",n.label?n.label:o)}let s;if(n.controlId){s=n.parentControl.byId(n.controlId)}else{s=n.parentControl}return t.showMessages({sActionName:r,control:s})};g.handleValidationError=function e(){const t=w.getMessageManager(),n=t.getMessageModel().getData().filter(function(e){if(e.validation){return e}});t.removeMessages(n)};g._createPopover=function e(t){return new b(t)};g._confirmDiscard=function e(t,n,o){if(!n){this.handleValidationError();return Promise.resolve()}t.setEnabled(false);return new Promise((e,n)=>{const a=this._createPopover({showHeader:false,placement:"Top"});a.addStyleClass("sapUiContentPadding");const r=new y({text:o.getText("C_TRANSACTION_HELPER_DRAFT_DISCARD_MESSAGE")});const s=new p({text:o.getText("C_TRANSACTION_HELPER_DRAFT_DISCARD_BUTTON"),width:"100%",press:()=>{this.handleValidationError();a.data("continueDiscard",true);a.close()},ariaLabelledBy:[r]});a.addContent(new E({items:[r,s]}));a.attachBeforeOpen(()=>{a.setInitialFocus(s)});a.attachAfterClose(()=>{t.setEnabled(true);if(a.data("continueDiscard")){e()}else{n()}});a.openBy(t,false)})};g._launchDialogWithKeyFields=function e(a,r,s,i,c,l){let d;const u=i.parentControl;const g=s.bindList(a.getPath(),a.getContext(),[],[],{$$updateGroupId:"submitLater"});g.refreshInternal=function(){};const p=g.create(i.data,true);return new Promise(async(e,h)=>{const m="sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog";const b=M.loadTemplate(m,"fragment"),y=S(u),E=s.getMetaModel(),D=[],T=a.isRelative()?a.getResolvedPath():a.getPath(),_=E.createBindingContext(T),N=E.getMetaPath(T);for(const e in r){D.push(E.createBindingContext(`${N}/${r[e]}`))}const R=new P(D);const B=R.createBindingContext("/");const k=O(N,E);const L=new P(k);const F=L.createBindingContext("/");const H=await x.process(b,{name:m},{bindingContexts:{entitySet:_,fields:B,requiredProperties:F},models:{entitySet:_.getModel(),fields:B.getModel(),metaModel:E,requiredProperties:L}});let $=[];const U={};const j=w.getMessageManager();const V=e=>{const t=j.getMessageModel().getData();const n=t.filter(t=>t.getControlIds().some(t=>t.includes(e)));j.removeMessages(n)};const W={handleChange:async e=>{const t=e.getParameter("id");const n=e.getSource();const o=J.find(e=>e.field===n);V(t);o.validationPromise=e.getParameter("promise");try{o.value=await o.validationPromise;o.hasError=false}catch(e){delete o.value;o.hasError=true}},handleLiveChange:e=>{const t=e.getParameter("id");V(t)}};const G=await A.load({definition:H,controller:W});let q;const K=function(){if(q.error){h(q.error)}else{e(q.response)}d.close()};d=new C(I(["CreateDialog",N]),{title:y.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"),content:[G],beginButton:{text:y.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"),type:"Emphasized",press:async e=>{if(!await t.validateProperties(j,J,y)){return}o.lock(d);i.bIsCreateDialog=true;try{const e=await Promise.all(Object.keys(U).map(async function(e){const t=await U[e];const n={};n[e]=t;return n}));if(i.beforeCreateCallBack){await v(i.beforeCreateCallBack({contextPath:a&&a.getPath(),createParameters:e}))}const t=p.getObject();const n={};Object.keys(t).forEach(function(e){const o=E.getObject(`${N}/${e}`);if(o&&o.$kind==="NavigationProperty"){return}n[e]=t[e]});const o=a.create(n,true,i.createAtEnd,i.inactive);const r=this.onAfterCreateCompletion(a,o,i);let s=await r;if(!s||s&&s.bKeepDialogOpen!==true){s=s??{};d.setBindingContext(null);s.newContext=o;q={response:s};K()}}catch(e){if(e!==f.Constants.CreationFailed){q={error:e};K()}}finally{o.unlock(d);l.showMessages()}}},endButton:{text:y.getText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL"),press:function(){q={error:f.Constants.CancelActionDialog};K()}},afterClose:function(){var e;for(const e of J){const t=e.field.getId();V(t)}(e=d.getBindingContext("internal"))===null||e===void 0?void 0:e.setProperty("isCreateDialogOpen",false);d.destroy();g.destroy()}});$=G===null||G===void 0?void 0:G.getAggregation("form").getAggregation("formContainers")[0].getAggregation("formElements");const J=$.map(e=>{const t=e.getFields()[0];const n=t.isA("sap.ui.mdc.MultiValueField");return{parameter:e,isMultiValue:n,field:t,value:n?t.getItems():t.getValue(),validationPromise:undefined,hasError:false}});if(u&&u.addDependent){u.addDependent(d)}d.setBindingContext(p);try{await n.setUserDefaults(c,D,p,false,i.createAction,i.data);d.getBindingContext("internal").setProperty("isCreateDialogOpen",true);d.open()}catch(e){await l.showMessages();throw e}})};g.onAfterCreateCompletion=function t(n,o,a){let r;const s=new Promise(e=>{r=e});const i=e=>{const t=e.getParameter("context"),a=e.getParameter("success");if(t===o){n.detachCreateCompleted(i,this);r(a)}};const c=()=>{o.created().then(undefined,function(){e.trace("transient creation context deleted")}).catch(function(t){e.trace("transient creation context deletion error",t)})};n.attachCreateCompleted(i,this);return s.then(e=>{if(!e){if(!a.keepTransientContextOnFailed){c();n.resetChanges();n.getModel().resetChanges(n.getUpdateGroupId());throw f.Constants.CreationFailed}return{bKeepDialogOpen:true}}else{return o.created()}})};g._getNewAction=function e(t,n,o,a){let r;if(t&&t.preferredMode&&n.toUpperCase().indexOf("I-ACTION=CREATEWITH")>-1){const e=t.preferredMode[0];r=e.toUpperCase().indexOf("CREATEWITH:")>-1?e.substr(e.lastIndexOf(":")+1):undefined}else if(t&&t.preferredMode&&n.toUpperCase().indexOf("I-ACTION=AUTOCREATEWITH")>-1){const e=t.preferredMode[0];r=e.toUpperCase().indexOf("AUTOCREATEWITH:")>-1?e.substr(e.lastIndexOf(":")+1):undefined}else{r=o&&o.getObject!==undefined?o.getObject(`${a}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`)||o.getObject(`${a}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`):undefined}return r};g._getSpecificCreateActionDialogLabel=function e(t,n,o,a){const r=function(){if(t&&t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`)){const e=t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`).findIndex(function(e){const t=e.Action?e.Action.split("("):undefined;return t?t[0]===o:false});return e>-1?t.getObject(`${n}/@com.sap.vocabularies.UI.v1.LineItem`)[e].Label:undefined}else{return undefined}};return r()||t&&t.getObject(`${n}/${o}@com.sap.vocabularies.Common.v1.Label`)||a&&a.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE")};return u}();const H=new F;return H},false);
|
|
236
236
|
/*!
|
|
237
237
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
238
238
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
239
239
|
*/
|
|
240
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/draft", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/ResourceModelHelper","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/m/Text","sap/ui/core/Core","../../operationsHelper","./draftDataLossPopup"],function(e,t,n,o,r,
|
|
240
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/draft", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/ResourceModelHelper","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/m/Text","sap/ui/core/Core","../../operationsHelper","./draftDataLossPopup"],function(e,t,n,o,i,r,a,s,c,u,d){"use strict";var l=o.getResourceModel;const f={EDIT:"EditAction",ACTIVATION:"ActivationAction",DISCARD:"DiscardAction",PREPARE:"PreparationAction"};function g(e,t){const n=e.getModel(),o=n.getMetaModel(),i=o.getMetaPath(e.getPath());return o.getObject(`${i}@com.sap.vocabularies.Common.v1.DraftRoot/${t}`)}function h(e,t,n){const o=g(e,t);return e.getModel().bindContext(`${o}(...)`,e,n)}function E(e,t){const n=e.getModel(),o=n.getMetaModel(),i=o.getMetaPath(e.getPath());return o.getObject(`${i}@com.sap.vocabularies.Common.v1.DraftRoot/${t}/$ReturnType`)}function P(e){return!!g(e,f.PREPARE)}async function p(e,t,n){if(e.getProperty("IsActiveEntity")){const o={$$inheritExpandSelect:true};const i=h(e,f.EDIT,o);i.setParameter("PreserveChanges",t);const r="direct";const a=l(n);const s=a.getText("C_COMMON_OBJECT_PAGE_EDIT");const c=i.execute(r,undefined,u.fnOnStrictHandlingFailed.bind(O,r,{label:s,model:e.getModel()},a,null,null,null,undefined,undefined),e.getBinding().isA("sap.ui.model.odata.v4.ODataListBinding"));i.getModel().submitBatch(r);return await c}else{throw new Error("You cannot edit this draft document")}}async function A(t,n,o){if(O.getMessagesPath(t)&&O.hasPrepareAction(t)){try{if(!o){await t.getBinding().requestObject("")}const e=await O.executeDraftPreparationAction(t,t.getUpdateGroupId(),true,o);if(e&&!E(t,f.PREPARE)){w(t,n.getSideEffectsService())}return e}catch(t){e.error("Error while requesting messages",t)}}return undefined}async function m(t,n,o){const i=P(t);const r=i;if(!t.getProperty("IsActiveEntity")){const a=h(t,f.ACTIVATION,{$$inheritExpandSelect:true});const s=l(n);const c=s.getText("C_OP_OBJECT_PAGE_SAVE");try{return await a.execute(o,r,o?u.fnOnStrictHandlingFailed.bind(O,o,{label:c,model:t.getModel()},s,null,null,null,undefined,undefined):undefined,t.getBinding().isA("sap.ui.model.odata.v4.ODataListBinding"))}catch(o){if(i){const o=g(t,f.PREPARE),i=n.getSideEffectsService(),r=i.getODataActionSideEffects(o,t),a=r&&r.pathExpressions;if(a&&a.length>0){try{await i.requestSideEffects(a,t)}catch(t){e.error("Error while requesting side effects",t)}}else{try{await w(t,i)}catch(t){e.error("Error while requesting messages",t)}}}throw o}}else{throw new Error("The activation action cannot be executed on an active document")}}function v(e){const t=e.getModel().getMetaModel();const n=t.getMetaPath(e.getPath());const o=E(e,f.PREPARE);return o?t.getObject(`${n}/@${"com.sap.vocabularies.Common.v1.Messages"}/$Path`):null}function C(t,n,o,i){if(!t.getProperty("IsActiveEntity")){const r=o?v(t):null;const a=h(t,f.PREPARE,r?{$select:r}:null);a.setParameter("SideEffectsQualifier","");const s=n||a.getGroupId();return a.execute(s,i).then(function(){return a}).catch(function(t){e.error("Error while executing the operation",t)})}else{throw new Error("The preparation action cannot be executed on an active document")}}function D(e){const t=e.getModel(),n=t.getMetaModel(),o=n.getMetaPath(e.getPath());return n.getObject(`${o}/@com.sap.vocabularies.Common.v1.Messages/$Path`)}function w(e,t){const n=O.getMessagesPath(e);if(n){return t.requestSideEffects([n],e)}return Promise.resolve()}async function x(e,t,n){if(!e.getProperty("IsActiveEntity")){const o=O.createOperation(e,f.DISCARD);const i=t&&l(t);const r="direct";const a=(i===null||i===void 0?void 0:i.getText("C_TRANSACTION_HELPER_DRAFT_DISCARD_BUTTON"))||"";const s=!n?o.execute(r):o.execute(r,undefined,u.fnOnStrictHandlingFailed.bind(O,r,{label:a,model:e.getModel()},i,null,null,null,undefined,undefined),false);e.getModel().submitBatch(r);return s}else{throw new Error("The discard action cannot be executed on an active document")}}async function b(t,n,o){if(!n.getPath().startsWith(t.getPath())){e.error("Cannot compute rightmost sibling context");throw new Error("Cannot compute rightmost sibling context")}if(n.getProperty("IsActiveEntity")===false&&n.getProperty("HasActiveEntity")===false){return undefined}const i=t.getModel();try{const e=n.getPath().replace(t.getPath(),"");const a=e?e.substring(1).split("/"):[];a.unshift(t.getPath().substring(1));const s=[];const c=[];let u="";const d=[...a];if((o===null||o===void 0?void 0:o.rootContextNotRequired)===true){var r;d.shift();u="/"+(t===null||t===void 0?void 0:(r=t.getPath())===null||r===void 0?void 0:r.substring(1))}const l=d.map(e=>{u+=`/${e}`;s.unshift(u);if(u.endsWith(")")){const e=i.bindContext(`${u}/SiblingEntity`).getBoundContext();return e.requestCanonicalPath()}else{return Promise.resolve(undefined)}});const f=await Promise.all(l);if((o===null||o===void 0?void 0:o.rootContextNotRequired)===true){f.unshift(o===null||o===void 0?void 0:o.rootSiblingPath);s.push(t.getPath())}let g="";f.forEach((e,t)=>{if(t!==0){if(a[t].endsWith(")")){const n=a[t].replace(/\(.*$/,"");const o=e.replace(/.*\(/,"(");g+=`/${n}${o}`}else{g+=`/${a[t]}`}}else{g=e}c.unshift(g)});return{targetContext:i.bindContext(g,undefined,{$$groupId:"$auto.Heroes"}).getBoundContext(),pathMapping:s.map((e,t)=>({oldPath:e,newPath:c[t]}))}}catch(e){return undefined}}async function M(e,o,i){const r=i||{},s=typeof r.bPreserveChanges==="undefined"||typeof r.bPreserveChanges==="boolean"&&r.bPreserveChanges;async function c(){const t=e.getModel();const o=t.bindContext(`${e.getPath()}/DraftAdministrativeData`).getBoundContext();const r=l(i.oView);const s=await o.requestObject();if(s){n.removeUnboundTransitionMessages();let t=s.InProcessByUserDescription||s.InProcessByUser;const o=i.oView.getViewData().entitySet;if(t){const e=r.getText("C_DRAFT_OBJECT_PAGE_DRAFT_LOCKED_BY_USER",t,o);a.error(e);throw new Error(e)}else{t=s.CreatedByUserDescription||s.CreatedByUser;const n=r.getText("C_DRAFT_OBJECT_PAGE_DRAFT_UNSAVED_CHANGES",t,o);await O.showEditConfirmationMessageBox(n,e);return O.executeDraftEditAction(e,false,i.oView)}}throw new Error(`Draft creation aborted for document: ${e.getPath()}`)}if(!e){throw new Error("Binding context to active document is required")}let u;try{u=await O.executeDraftEditAction(e,s,i.oView)}catch(o){if(o.status===409||o.status===412||o.status===423){n.removeBoundTransitionMessages();n.removeUnboundTransitionMessages();const o=await O.computeSiblingInformation(e,e);if(o!==null&&o!==void 0&&o.targetContext){await t.waitForContextRequested(o.targetContext);return o.targetContext}else{u=await c()}}else if(!(o&&o.canceled)){throw new Error(o)}}if(u){var d;const e=O.getActionName(u,f.EDIT);const t=o.getSideEffectsService().getODataActionSideEffects(e,u);if(t!==null&&t!==void 0&&(d=t.triggerActions)!==null&&d!==void 0&&d.length){await o.getSideEffectsService().requestSideEffectsForODataAction(t,u);return u}else{return u}}else{return undefined}}async function y(e,t,n,o){const i=n||{};if(!e){throw new Error("Binding context to draft document is required")}const r=i.fnBeforeActivateDocument?await i.fnBeforeActivateDocument(e):true;if(!r){throw new Error(`Activation of the document was aborted by extension for document: ${e.getPath()}`)}let a;if(!P(e)){a=await m(e,t)}else{const n="draft";let i=O.executeDraftPreparationAction(e,n,false);e.getModel().submitBatch(n);const r=O.executeDraftActivationAction(e,t,n);try{const e=await Promise.all([i,r]);a=e[1]}catch(t){const r=v(e);if(r){i=O.executeDraftPreparationAction(e,n,true);e.getModel().submitBatch(n);await i;const t=await e.requestObject();if(t[r].length>0){o===null||o===void 0?void 0:o.removeTransitionMessages(false,false,e.getPath())}}throw t}}return i.fnAfterActivateDocument?i.fnAfterActivateDocument(e,a):a}function T(e,t){const n=c.getLibraryResourceBundle("sap.fe.core");return new Promise(function(o,a){const c=new r({title:n.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_WARNING"),state:"Warning",content:new s({text:e}),beginButton:new i({text:n.getText("C_COMMON_OBJECT_PAGE_EDIT"),type:"Emphasized",press:function(){c.close();o(true)}}),endButton:new i({text:n.getText("C_COMMON_OBJECT_PAGE_CANCEL"),press:function(){c.close();a(`Draft creation aborted for document: ${t.getPath()}`)}}),afterClose:function(){c.destroy()}});c.addStyleClass("sapUiContentPadding");c.open()})}function _(e,t,n){const o=g(e,f.DISCARD),i=e.getObject().IsActiveEntity;if(i||!i&&!o){if(e.hasPendingChanges()){return e.getBinding().resetChanges().then(function(){return e.delete()}).catch(function(e){return Promise.reject(e)})}else{return e.delete()}}else{return x(e,t,n)}}const O={createDraftFromActiveDocument:M,activateDocument:y,deleteDraft:_,executeDraftEditAction:p,executeDraftValidation:A,executeDraftPreparationAction:C,executeDraftActivationAction:m,hasPrepareAction:P,getMessagesPath:D,computeSiblingInformation:b,processDataLossOrDraftDiscardConfirmation:d.processDataLossOrDraftDiscardConfirmation,silentlyKeepDraftOnForwardNavigation:d.silentlyKeepDraftOnForwardNavigation,createOperation:h,executeDraftDiscardAction:x,NavigationType:d.NavigationType,getActionName:g,showEditConfirmationMessageBox:T};return O},false);
|
|
241
241
|
/*!
|
|
242
242
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
243
243
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
244
244
|
*/
|
|
245
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/draftDataLossPopup", ["sap/base/Log","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/
|
|
245
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/draftDataLossPopup", ["sap/base/Log","sap/fe/core/controllerextensions/collaboration/ActivitySync","sap/fe/core/helpers/EditState","../../controls/DataLossOrDraftDiscard/DraftDataLossDialog.block"],function(t,e,a,i){"use strict";var o;(function(t){t["BackNavigation"]="BackNavigation";t["ForwardNavigation"]="ForwardNavigation"})(o||(o={}));const n=new i({});function r(t){var e,a;let i=false;const o=t.getAppComponent().getManifest();i=(o===null||o===void 0?void 0:(e=o["sap.fe"])===null||e===void 0?void 0:(a=e.app)===null||a===void 0?void 0:a.silentlyKeepDraftOnForwardNavigation)||false;return i}async function s(t,e,a,i,o){if(t.CreationDateTime!==t.LastChangeDateTime){n.performAfterDiscardorKeepDraft(i,e,a,o)}else{i()}}async function c(e,i,r,s,c,l,f){if(a.isEditStateDirty()){if(e.CreationDateTime===e.LastChangeDateTime&&c===o.BackNavigation){try{await n.discardDraft(r,f);s()}catch(e){t.error("Error while canceling the document",e)}}else if(c===o.ForwardNavigation&&l){s()}else{n.performAfterDiscardorKeepDraft(s,i,r,f)}}else{s()}}async function l(e,a,i,n){if(n===o.BackNavigation){const o={skipDiscardPopover:true};try{await e.editFlow.cancelDocument(a,o);i()}catch(e){t.error("Error while canceling the document",e)}}else{i()}}async function f(t,e,a,i,r,s){if(i===o.ForwardNavigation&&r){a()}else{n.performAfterDiscardorKeepDraft(a,e,t,s)}}async function d(t,i,n,d,g,D){let p=arguments.length>6&&arguments[6]!==undefined?arguments[6]:o.BackNavigation;const v=e.isConnected(g.getView());const u=!v?i:function(){e.disconnect(g.getView());for(var t=arguments.length,a=new Array(t),o=0;o<t;o++){a[o]=arguments[o]}i.apply(null,...a)};const y=r(g);if(t){if(g.getAppComponent().getRootViewController().isFclEnabled()){await s(t,n,g,u,D)}else if(!d.getObject().HasActiveEntity){c(t,n,g,u,p,y,D)}else if(t.CreationDateTime===t.LastChangeDateTime){l(g,d,u,p)}else if(a.isEditStateDirty()){f(g,n,u,p,y,D)}else{u()}}else{i()}}async function g(e,a,i,n,r){let s=arguments.length>5&&arguments[5]!==undefined?arguments[5]:o.BackNavigation;const c=n.getView();const l=i.getModel();const f=l.getMetaModel();const g=c.getViewData().entitySet??"";const D=g&&f.getObject("/"+g+"@com.sap.vocabularies.Common.v1.DraftRoot");const p=c.getModel("ui");const v=p.getProperty("/isEditable");const u=l.bindContext(`${i.getPath()}/DraftAdministrativeData`).getBoundContext();if(i&&i.getObject()&&(!D&&s===o.BackNavigation||!v)){e()}else{try{const t=await u.requestObject();await d(t,e,a,i,n,r,s)}catch(e){t.error("Cannot retrieve draftDataContext information",e)}}}const D={processDataLossOrDraftDiscardConfirmation:g,silentlyKeepDraftOnForwardNavigation:r,NavigationType:o,processFclMode:s,processNoActiveEntityMode:c,processEditingDraftForExistingEntity:l,processEditStateDirty:f};return D},false);
|
|
246
246
|
/*!
|
|
247
247
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
248
248
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -257,17 +257,17 @@ sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/operations/_internal
|
|
|
257
257
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
258
258
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
259
259
|
*/
|
|
260
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/operations/facade", ["sap/base/Log","sap/fe/core/ActionRuntime","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/FPMHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel","../../../operationsHelper","./_internal"],function(e,t,n,s,a,i,o,r,l,c,d,u,g,f,m,p,h,M,E,P,C){"use strict";var x=C._validateProperties;var b=C._addMessageForActionParameter;var v=m.MessageType;var A=r.generate;var O=o.getResourceModel;const S=l.Constants,$=l.InvocationGrouping;const y=u.Action;function T(e,t,n,s,a,i){if(!i){i={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}if(!t||t.length===0){return Promise.reject("Bound actions always requires at least one context")}const o=Array.isArray(t);a.aContexts=o?t:[t];const r=n.getMetaModel(),l=`${r.getMetaPath(a.aContexts[0].getPath())}/${e}`,c=r.createBindingContext(`${l}/@$ui5.overload/0`);a.isCriticalAction=L(r,l,a.aContexts,c);const d=function(e){if(e[0].status==="fulfilled"){return e[0].value}else{throw e[0].reason||e}};return B(e,n,c,s,a,i).then(e=>{if(o){return e}else{return d(e)}},e=>{if(o){throw e}else{return d(e)}})}function _(e,t,n,s,a){if(!t){return Promise.reject("Action expects a model/context for execution")}const i=t.getMetaModel(),o=t.bindContext(`/${e}`).getPath(),r=i.createBindingContext(`/${i.createBindingContext(o).getObject("$Action")}/0`);s.isCriticalAction=L(i,`${o}/@$ui5.overload`);return B(e,t,r,n,s,a)}function N(e,t,n){if(!t){return Promise.reject("Bound functions always requires a context")}const s=n.getMetaModel(),a=`${s.getMetaPath(t.getPath())}/${e}`,i=s.createBindingContext(a);return I(e,n,i,t)}function w(e,t){if(!e){return Promise.resolve()}const n=t.getMetaModel(),s=t.bindContext(`/${e}`).getPath(),a=n.createBindingContext(`/${n.createBindingContext(s).getObject("$Function")}/0`);return I(e,t,a)}function I(e,t,n,s){let a;if(!n||!n.getObject()){return Promise.reject(new Error(`Function ${e} not found`))}if(s){n=t.bindContext(`${s.getPath()}/${e}(...)`);a="functionGroup"}else{n=t.bindContext(`/${e}(...)`);a="functionImport"}const i=n.execute(a);t.submitBatch(a);return i.then(function(){return n.getBoundContext()})}function B(e,t,n,s,a,i){if(!i){i={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}a.bGrouped=a.invocationGrouping===$.ChangeSet;return new Promise(async function(o,r){let l={};let c;let d;const u=a.label;const f=a.skipParameterDialog;const m=a.aContexts;const p=a.bIsCreateAction;const h=a.isCriticalAction;let M;let E;let P;let C;let x;let b;let v;const A=n.getObject();if(!n||!n.getObject()){return r(new Error(`Action ${e} not found`))}const O=F(n);const S=O.length>0&&!(O.length===1&&O[0].$Name==="ResultIsActiveEntity");const y=a.parameterValues;const T=s.getComponentData();const _=T&&T.startupParameters||{};if(S&&f){v=K(p,O,y,_)}c=null;if(S){if(!(f&&v)){c=G}}else if(h){c=D}l={fnOnSubmitted:a.onSubmitted,fnOnResponse:a.onResponse,actionName:e,model:t,aActionParameters:O,bGetBoundContext:a.bGetBoundContext,defaultValuesExtensionFunction:a.defaultValuesExtensionFunction,label:a.label,selectedItems:a.selectedItems};if(n.getObject("$IsBound")){if(a.additionalSideEffect&&a.additionalSideEffect.pathExpressions){M=t.getMetaModel();E=M.getMetaPath(m[0].getPath());P=M.getObject(`${E}/@com.sap.vocabularies.Common.v1.Messages/$Path`);if(P){C=a.additionalSideEffect.pathExpressions.findIndex(function(e){return typeof e==="string"&&e===P});b=n.getObject("$ReturnType");x=b&&!b.$isCollection&&n.getModel().getObject(E).$Type===b.$Type;if(C>-1||x){a.mBindingParameters=a.mBindingParameters||{};if(n.getObject(`$ReturnType/$Type/${P}`)&&(!a.mBindingParameters.$select||a.mBindingParameters.$select.split(",").indexOf(P)===-1)){a.mBindingParameters.$select=a.mBindingParameters.$select?`${a.mBindingParameters.$select},${P}`:P;if(C===-1){a.additionalSideEffect.pathExpressions.push("*")}if(a.additionalSideEffect.triggerActions.length===0&&C>-1){a.additionalSideEffect.pathExpressions.splice(C,1)}}}}}l.aContexts=m;l.mBindingParameters=a.mBindingParameters;l.additionalSideEffect=a.additionalSideEffect;l.bGrouped=a.invocationGrouping===$.ChangeSet;l.internalModelContext=a.internalModelContext;l.operationAvailableMap=a.operationAvailableMap;l.isCreateAction=p;l.bObjectPage=a.bObjectPage;if(a.controlId){l.control=a.parentControl.byId(a.controlId);a.control=l.control}else{l.control=a.parentControl;a.control=a.parentControl}}if(p){l.bIsCreateAction=p}const N=(A.$Parameter||[]).some(e=>(A.$EntitySetPath&&A.$EntitySetPath===e.$Name||A.$IsBound)&&e.$isCollection);l.isStatic=N;if(c){d=c(e,s,u,l,O,y,n,a.parentControl,a.entitySetName,a.messageHandler,i);return d.then(function(e){H(a,l,A);o(e)}).catch(function(e){r(e)})}else{if(y){for(const e in l.aActionParameters){var w;l.aActionParameters[e].value=y===null||y===void 0?void 0:(w=y.find(t=>t.name===l.aActionParameters[e].$Name))===null||w===void 0?void 0:w.value}}else{for(const e in l.aActionParameters){var I;l.aActionParameters[e].value=(I=_[l.aActionParameters[e].$Name])===null||I===void 0?void 0:I[0]}}let e;try{e=await U(s,l,a.parentControl,a.messageHandler,i);const t=g.getMessageManager().getMessageModel().getData();if(i&&i.is412Executed&&i.strictHandlingTransitionFails.length){i.delaySuccessMessages=i.delaySuccessMessages.concat(t)}H(a,l,A);o(e)}catch{r(e)}finally{var B,R;if(i&&i.is412Executed&&i.strictHandlingTransitionFails.length){try{const e=i.strictHandlingTransitionFails;const t=[];e.forEach(function(e){t.push(e.oAction.getContext())});l.aContexts=t;const n=await U(s,l,a.parentControl,a.messageHandler,i);i.strictHandlingTransitionFails=[];g.getMessageManager().addMessages(i.delaySuccessMessages);H(a,l,A);o(n)}catch(e){r(e)}}let e=false;if(a.bGrouped&&i&&i.strictHandlingPromises.length||q(a.bGrouped)!==-1){e=true}a===null||a===void 0?void 0:(B=a.messageHandler)===null||B===void 0?void 0:B.showMessageDialog({control:(R=l)===null||R===void 0?void 0:R.control,onBeforeShowMessage:function(t,n){return j(a,m,undefined,t,n,e)},aSelectedContexts:a.aContexts,sActionName:u});if(i){i={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}}}})}function D(e,t,n,s,a,i,o,r,l,c){return new Promise((n,a)=>{let i=e?e:null;i=i.indexOf(".")>=0?i.split(".")[i.split(".").length-1]:i;const o=i&&l?`${l}|${i}`:"";const d=O(r);const g=d.getText("C_OPERATIONS_ACTION_CONFIRM_MESSAGE",undefined,o);u.confirm(g,{onClose:async function(e){if(e===y.OK){try{const e=await U(t,s,r,c);n(e)}catch(e){try{await c.showMessageDialog();a(e)}catch(t){a(e)}}}else{n()}}})})}async function R(e,t,n,s,a,i,o,r){var l;const c=await U(e,t,n,s,r);if((l=t.aContexts)!==null&&l!==void 0&&l.length){if(c!==null&&c!==void 0&&c.some(e=>e.status==="rejected")){throw c}}const d=g.getMessageManager().getMessageModel().getData();if(r&&r.is412Executed&&r.strictHandlingTransitionFails.length){if(!o){r.delaySuccessMessages=r.delaySuccessMessages.concat(d)}else{g.getMessageManager().addMessages(r.delaySuccessMessages);let e=false;if(t.bGrouped&&r.strictHandlingPromises.length||q(t.bGrouped)!==-1){e=true}if(d.length){i.attachEventOnce("afterClose",function(){s.showMessageDialog({onBeforeShowMessage:function(n,s){return j(t,a,i,n,s,e)},control:t.control,aSelectedContexts:t.aContexts,sActionName:t.label})})}}}else if(d.length){let e=false;if(t.bGrouped&&r&&r.strictHandlingPromises.length||q(t.bGrouped)!==-1){e=true}i.attachEventOnce("afterClose",function(){s.showMessageDialog({isActionParameterDialogOpen:t===null||t===void 0?void 0:t.oDialog.isOpen(),onBeforeShowMessage:function(n,s){return j(t,a,i,n,s,e)},control:t.control,aSelectedContexts:t.aContexts,sActionName:t.label})})}return c}function H(e,n,s){if(n.internalModelContext&&n.operationAvailableMap&&n.aContexts&&n.aContexts.length&&s.$IsBound){const s=n.isStatic;if(!s){t.setActionEnablement(n.internalModelContext,JSON.parse(n.operationAvailableMap),e.selectedItems,"table")}else if(n.control){const e=n.control;if(e.isA("sap.ui.mdc.Table")){const s=e.getSelectedContexts();t.setActionEnablement(n.internalModelContext,JSON.parse(n.operationAvailableMap),s,"table")}}}}function j(e,t,n,s,i,o){let r=i.showMessageBox,l=i.showMessageDialog;const c=e.control;const d=g.getLibraryResourceBundle("sap.fe.core");const u=s.filter(function(e){return e.getTarget()===""});const f=s.filter(function(t){var n;return t.getTarget&&t.getTarget().indexOf(e.actionName)!==-1&&(e===null||e===void 0?void 0:(n=e.aActionParameters)===null||n===void 0?void 0:n.some(function(e){return t.getTarget().indexOf(e.$Name)!==-1}))});f===null||f===void 0?void 0:f.forEach(function(e){e.isAPDTarget=true});const m=f.length?true:false;let h=false;if(o&&!m){h=true;let e=d.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_TEXT");let t=d.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_DETAIL_TEXT");const n=g.getMessageManager().getMessageModel();const i=n.getData();const o=a.getMessages(true);let u;const f=c&&c.getModel("ui").getProperty("/isEditable");const m=s.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"});const M=i.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"});if(m!==1&&M!==-1){if(i.length===1&&o.length===1){if(f===false){i[0].setMessage(d.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT")+"\n\n"+i[0].getMessage())}else{e=f?d.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT_EDIT"):d.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT");t="";u=new p({message:e,type:v.Error,target:"",persistent:true,description:t,code:"FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"});s.unshift(u);if(s.length===1){r=true;l=false}else{l=true;r=false}}}else{u=new p({message:e,type:v.Error,target:"",persistent:true,description:t,code:"FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"});s.unshift(u);if(s.length===1){r=true;l=false}else{l=true;r=false}}}}if(n&&n.isOpen()&&t.length!==0&&!e.isStatic){if(!e.bGrouped){if(t.length>1||!m){n.close();n.destroy()}}else if(!m){n.close();n.destroy()}}let M=[];const E=n&&n.isOpen();if(!h){if(s.length===1&&s[0].getTarget&&s[0].getTarget()!==undefined&&s[0].getTarget()!==""){if(c&&c.getModel("ui").getProperty("/isEditable")===false||!c){r=!m;l=false}else if(c&&c.getModel("ui").getProperty("/isEditable")===true){r=false;l=false}}else if(c){if(c.getModel("ui").getProperty("/isEditable")===false){if(E&&m){l=false}}else if(c.getModel("ui").getProperty("/isEditable")===true){if(!E&&m){l=true;M=u.concat(f)}else if(!E&&u.length===0){l=false}}}}return{showMessageBox:r,showMessageDialog:l,filteredMessages:M.length?M:s,fnGetMessageSubtitle:c&&c.isA("sap.ui.mdc.Table")&&a.setMessageSubtitle.bind({},c,t),showChangeSetErrorDialog:e.bGrouped}}function G(t,a,o,r,l,m,p,P,C,v,$){const y=X(p,t),T=p.getModel().oModel.getMetaModel(),_=T.createBindingContext(y),w=p.getObject("$IsBound")?p.getPath().split("/@$ui5.overload/0")[0]:p.getPath().split("/0")[0],I=T.createBindingContext(w),B=r.isCreateAction,D="sap/fe/core/controls/ActionParameterDialog";return new Promise(async function(y,T){let w;const H=g.getMessageManager();const G=e=>{const t=H.getMessageModel().getData();const n=A(["APD_",e.$Name]);const s=t.filter(e=>e.getControlIds().some(e=>n.split("-").includes(e)));H.removeMessages(s)};const F={handleChange:async function(e){const t=e.getSource();const n=w.find(e=>e.field===t);G(n.parameter);n.validationPromise=e.getParameter("promise");try{n.value=await n.validationPromise;n.hasError=false}catch(e){delete n.value;n.hasError=true;b(H,[{actionParameterInfo:n,message:e.message}])}}};const L=M.loadTemplate(D,"fragment");const k=new E({$displayMode:{}});try{const M=await h.process(L,{name:D},{bindingContexts:{action:p,actionName:I,entitySet:_},models:{action:p.getModel(),actionName:I.getModel(),entitySet:_.getModel(),metaModel:_.getModel()}});const b=r.aContexts||[];const J=[];let z;await n.setUserDefaults(a,l,k,true);const Y=await f.load({definition:M,controller:F});w=l.map(e=>{const t=g.byId(A(["APD_",e.$Name]));const n=t.isA("sap.ui.mdc.MultiValueField");return{parameter:e,field:t,isMultiValue:n}});const Q=O(P);let Z={dialogCancelled:true,result:undefined};const ee=new d(A(["fe","APD_",t]),{title:o||Q.getText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE"),content:[Y],escapeHandler:function(){ee.close()},beginButton:new c(A(["fe","APD_",t,"Action","Ok"]),{text:B?Q.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"):V(Q,o,t,C),type:"Emphasized",press:async function(){try{if(!await x(H,w,Q)){return}s.lock(ee);try{v.removeTransitionMessages();let e;const t=z&&z.getParameterContext();for(const n in l){if(l[n].$isCollection){const t=ee.getModel("mvfview").getProperty(`/${l[n].$Name}`),s=[];for(const e in t){s.push(t[e].Key)}e=s}else{e=t.getProperty(l[n].$Name)}l[n].value=e;e=undefined}r.label=o;try{const e=await R(a,r,P,v,b,ee,false,$);Z={dialogCancelled:false,result:e};ee.close()}catch(e){const t=sap.ui.getCore().getMessageManager().getMessageModel().getData();if($&&$.is412Executed&&$.strictHandlingTransitionFails.length){$.delaySuccessMessages=$.delaySuccessMessages.concat(t)}throw e}finally{if($&&$.is412Executed&&$.strictHandlingTransitionFails.length){try{const e=$.strictHandlingTransitionFails;const t=[];e.forEach(function(e){t.push(e.oAction.getContext())});r.aContexts=t;const n=await R(a,r,P,v,b,ee,true,$);$.strictHandlingTransitionFails=[];Z={dialogCancelled:false,result:n}}catch{if($.is412Executed&&$.strictHandlingTransitionFails.length){g.getMessageManager().addMessages($.delaySuccessMessages)}let e=false;if(r.bGrouped&&$.strictHandlingPromises.length||q(r.bGrouped)!==-1){e=true}await v.showMessageDialog({isActionParameterDialogOpen:ee.isOpen(),onBeforeShowMessage:function(t,n){return j(r,b,ee,t,n,e)},aSelectedContexts:r.aContexts,sActionName:o})}}if(s.isLocked(ee)){s.unlock(ee)}}}catch(e){let t=true;let n=false;if(r.bGrouped&&$&&$.strictHandlingPromises.length||q(r.bGrouped)!==-1){n=true}await v.showMessages({context:r.aContexts[0],isActionParameterDialogOpen:ee.isOpen(),messagePageNavigationCallback:function(){ee.close()},onBeforeShowMessage:function(e,s){const a=j(r,b,ee,e,s,n);t=a.showMessageDialog;return a},aSelectedContexts:r.aContexts,sActionName:o,control:r.control});if(t){if(ee.isOpen()){}else{T(e)}}}}finally{if($){$={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}if(s.isLocked(ee)){s.unlock(ee)}}}}),endButton:new c(A(["fe","APD_",t,"Action","Cancel"]),{text:Q.getText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL"),press:function(){ee.close()}}),beforeOpen:async function(t){const s=Object.assign({},t);v.removeTransitionMessages();const a=function(){const e=ee.getModel().getMetaModel(),t=p.sPath&&p.sPath.split("/@")[0],n=e.getObject(`${t}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`);return n};const o=async function(t){const o=a();const c=async function(s,a){if(a!==undefined){if(b.length>0&&a.$Path){try{let e=await n.requestSingletonProperty(a.$Path,z.getModel());if(e===null){e=await z.getParameterContext().requestProperty(a.$Path)}if(b.length>1){let n=a.$Path;if(n.indexOf(`${t}/`)===0){n=n.replace(`${t}/`,"")}for(let t=1;t<b.length;t++){if(b[t].getProperty(n)!==e){return{paramName:s,value:undefined,bNoPossibleValue:true}}}}return{paramName:s,value:e}}catch(t){e.error("Error while reading default action parameter",s,r.actionName);return{paramName:s,value:undefined,bLatePropertyError:true}}}else{return{paramName:s,value:a}}}else if(k&&k.oData[s]){return{paramName:s,value:k.oData[s]}}else{return{paramName:s,value:undefined}}};const d=function(e){const t=ee.getModel().getMetaModel(),s=n.getParameterPath(p.getPath(),e)+"@",a=t.getObject(s),i=a&&a["@com.sap.vocabularies.UI.v1.ParameterDefaultValue"];return i};const g=[];let f,h;for(const e in l){f=l[e].$Name;h=d(f);g.push(c(f,h))}if(p.getObject("$IsBound")&&b.length>0){if(o&&o.length>0&&typeof o==="string"){for(const e in b){J.push(N(o,b[e],r.model))}}}const M=Promise.all(g);let E=Promise.resolve([]);let P;if(J&&J.length>0){E=Promise.all(J)}if(r.defaultValuesExtensionFunction){const e=r.defaultValuesExtensionFunction.substring(0,r.defaultValuesExtensionFunction.lastIndexOf(".")||-1).replace(/\./gi,"/"),t=r.defaultValuesExtensionFunction.substring(r.defaultValuesExtensionFunction.lastIndexOf(".")+1,r.defaultValuesExtensionFunction.length);P=i.actionWrapper(s,e,t,{contexts:b})}try{const e=await Promise.all([M,E,P]);const t=e[0];const n=e[1];const s=e[2];let a;for(const e in l){var C;a=l[e].$Name;const i=m===null||m===void 0?void 0:(C=m.find(t=>t.name===l[e].$Name))===null||C===void 0?void 0:C.value;if(i){z.setParameter(l[e].$Name,i)}else if(s&&s.hasOwnProperty(a)){z.setParameter(l[e].$Name,s[a])}else if(t[e]&&t[e].value!==undefined){z.setParameter(l[e].$Name,t[e].value)}else if(o&&!t[e].bNoPossibleValue){if(b.length>1){let t=0;while(t<b.length-1){if(n[t]&&n[t+1]&&n[t].getObject(a)===n[t+1].getObject(a)){t++}else{break}}if(t===b.length-1){z.setParameter(l[e].$Name,n[t].getObject(a))}}else if(n[0]&&n[0].getObject(a)){z.setParameter(l[e].$Name,n[0].getObject(a))}}}const i=t.some(function(e){if(e.bLatePropertyError){return e.bLatePropertyError}});if(i){const e=Q.getText("C_APP_COMPONENT_SAPFE_ETAG_LATE_PROPERTY");u.warning(e,{contentWidth:"25em"})}}catch(t){e.error("Error while retrieving the parameter",t)}};const c=async function(){if(p.getObject("$IsBound")&&b.length>0){const t=p.getObject("$Parameter");const n=t[0]&&t[0].$Name;try{const e=await b[0].requestObject();if(e){z.setParameter(n,e)}await o(n)}catch(t){e.error("Error while retrieving the parameter",t)}}else{await o()}};await c();for(const e of w){const t=e.isMultiValue?e.field.getItems():e.field.getValue();e.value=t;e.validationPromise=Promise.resolve(t)}},afterClose:function(){l.forEach(G);ee.destroy();if(Z.dialogCancelled){T(S.CancelActionDialog)}else{y(Z.result)}}});r.oDialog=ee;ee.setModel(p.getModel().oModel);ee.setModel(k,"paramsModel");ee.bindElement({path:"/",model:"paramsModel"});const te=new E({});ee.setModel(te,"mvfview");for(const e of w){if(e.isMultiValue){var W,U;e===null||e===void 0?void 0:(W=e.field)===null||W===void 0?void 0:(U=W.getBinding("items"))===null||U===void 0?void 0:U.attachChange(()=>{G(e.parameter)})}else{var X,K;e===null||e===void 0?void 0:(X=e.field)===null||X===void 0?void 0:(K=X.getBinding("value"))===null||K===void 0?void 0:K.attachChange(()=>{G(e.parameter)})}}let ne=`${t}(...)`;if(!b.length){ne=`/${ne}`}ee.bindElement({path:ne});if(P){P.addDependent(ee)}if(b.length>0){ee.setBindingContext(b[0])}z=ee.getObjectBinding();ee.open()}catch(e){T(e)}})}function F(e){const t=e.getObject("$Parameter")||[];if(t&&t.length){if(e.getObject("$IsBound")){return t.slice(1,t.length)||[]}}return t}function L(e,t,n,s){const a=e.getObject(`${t}@com.sap.vocabularies.Common.v1.IsActionCritical`);let i=a&&a.$Path;if(!i){return!!a}const o=s&&s.getObject("$Parameter"),r=i&&i.split("/"),l=o&&o.length&&typeof o==="object"&&i&&n&&n.length;if(l){o.filter(function(e){const t=r&&r.indexOf(e.$Name);if(t>-1){r.splice(t,1)}});i=r.join("/");return n[0].getObject(i)}else if(i){return n[0].getObject(i)}}function V(e,t,n,s){let a=n?n:null;const i=a.split(".");a=a.indexOf(".")>=0?i[i.length-1]:a;const o=a&&s?`${s}|${a}`:"";const r="ACTION_PARAMETER_DIALOG_ACTION_NAME";const l=e.checkIfResourceKeyExists(`${r}|${o}`);if(t){if(l){return e.getText(r,undefined,o)}else if(e.checkIfResourceKeyExists(`${r}|${s}`)){return e.getText(r,undefined,`${s}`)}else if(e.checkIfResourceKeyExists(`${r}`)){return e.getText(r)}else{return t}}else{return e.getText("C_COMMON_DIALOG_OK")}}function k(e,t,n,s,a,i,o,r,l,c,d){let u,g=true;if(t){t.internalOperationsPromiseResolve=l}if(n){var f;const t=e.getBoundContext().getPath();const n=e.getModel().getMetaModel().getMetaPath(t);const s=e.getModel().getMetaModel().getObject(n);if(s&&((f=s[0])===null||f===void 0?void 0:f.$kind)!=="Action"){g=false}}if(!g){u=e.execute(s).then(function(){l(e.getBoundContext());return e.getBoundContext()})}else{u=n?e.execute(s,undefined,P.fnOnStrictHandlingFailed.bind(z,s,t,a,r,e.getContext(),o,i,d)).then(function(){l(e.getBoundContext());return e.getBoundContext()}).catch(function(){c();return Promise.reject()}):e.execute(s,undefined,P.fnOnStrictHandlingFailed.bind(z,s,t,a,r,e.getContext(),o,i,d)).then(function(e){l(e);return e}).catch(function(){c();return Promise.reject()})}return u.catch(()=>{throw S.ActionExecutionFailed})}function W(){let e=null,t=null;const n=new Promise(function(n,s){e=n;t=s});return{oLocalActionPromise:n,internalOperationsPromiseResolve:e,internalOperationsPromiseReject:t}}function q(e){if(e){const e=g.getMessageManager().getMessageModel().getData();return e.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"})}return-1}function U(t,n,s,a,i){const o=n.aContexts||[];const r=n.model;const l=n.aActionParameters||[];const c=n.actionName;const d=n.fnOnSubmitted;const u=n.fnOnResponse;const f=O(s);let m;function p(){if(l&&l.length){for(let e=0;e<l.length;e++){if(!l[e].value){switch(l[e].$Type){case"Edm.String":l[e].value="";break;case"Edm.Boolean":l[e].value=false;break;case"Edm.Byte":case"Edm.Int16":case"Edm.Int32":case"Edm.Int64":l[e].value=0;break;default:break}}m.setParameter(l[e].$Name,l[e].value)}}}if(o.length){return new Promise(function(s){const l=n.mBindingParameters;const u=n.bGrouped;const h=n.bGetBoundContext;const M=[];let E;let C;let x;const b=W();const v=function(e,s,o,r){p();const l=[];x=!u?`$auto.${s}`:e.getUpdateGroupId();n.requestSideEffects=J.bind(z,t,o,n,x,l);E=k(e,n,h,x,f,a,r,s,b.internalOperationsPromiseResolve,b.internalOperationsPromiseReject,i);M.push(E);l.push(b.oLocalActionPromise);J(t,o,n,x,l);return Promise.allSettled(l)};const A=function(e,s,o,l){const c=[];p();x=`apiMode${s}`;n.requestSideEffects=J.bind(z,t,o,n,x,c);E=k(e,n,h,x,f,a,l,s,b.internalOperationsPromiseResolve,b.internalOperationsPromiseReject,i);M.push(E);c.push(b.oLocalActionPromise);J(t,o,n,x,c);r.submitBatch(x);return Promise.allSettled(c)};async function O(){const t=[];for(C=0;C<o.length;C++){m=r.bindContext(`${c}(...)`,o[C],l);t.push(v(m,o.length<=1?null:C,{context:o[C],pathExpressions:n.additionalSideEffect&&n.additionalSideEffect.pathExpressions,triggerActions:n.additionalSideEffect&&n.additionalSideEffect.triggerActions},o.length))}(d||function e(){})(M);await Promise.allSettled(t);if(i&&i.strictHandlingPromises.length){try{const e=q(true);if(e===-1){await P.renderMessageView(n,f,a,i.strictHandlingWarningMessages,i,o.length>1)}else{i.strictHandlingPromises.forEach(function(e){e.resolve(false)});const e=g.getMessageManager().getMessageModel();const t=e.getData();e.setData(t.concat(i.strictHandlingWarningMessages))}}catch{e.error("Retriggering of strict handling actions failed")}}$()}async function S(e){(d||function e(){})(M);function t(e,t,s){m=r.bindContext(`${c}(...)`,e,l);return A(m,t,{context:e,pathExpressions:n.additionalSideEffect&&n.additionalSideEffect.pathExpressions,triggerActions:n.additionalSideEffect&&n.additionalSideEffect.triggerActions},s)}await e.reduce(async(e,n,s)=>{await e;await t(n,s+1,o.length)},Promise.resolve());if(i&&i.strictHandlingPromises.length){await P.renderMessageView(n,f,a,i.strictHandlingWarningMessages,i,o.length>1)}$()}if(!u){S(o)}else{O()}function $(){return Promise.allSettled(M).then(s)}}).finally(function(){(u||function e(){})()})}else{m=r.bindContext(`/${c}(...)`);p();const t="actionImport";const s=m.execute(t,undefined,P.fnOnStrictHandlingFailed.bind(z,t,{label:n.label,model:r},f,null,null,null,a,i));r.submitBatch(t);(d||function e(){})(s);return s.then(function(e){if(e){return e}else{var t,n,s;return(t=(n=m).getBoundContext)===null||t===void 0?void 0:(s=t.call(n))===null||s===void 0?void 0:s.getObject()}}).catch(function(t){e.error("Error while executing action "+c,t);throw t}).finally(function(){(u||function e(){})()})}}function X(e,t){let n=e.getPath();n=e.getObject("$IsBound")?n.split("@$ui5.overload")[0]:n.split("/0")[0];return n.split(`/${t}`)[0]}function K(e,t,n,s){if(n){for(const e of t){if(e.$Name!=="ResultIsActiveEntity"&&!(n!==null&&n!==void 0&&n.find(t=>t.name===e.$Name))){return false}}}else if(e&&s){for(const e of t){if(!s[e.$Name]){return false}}}return true}function J(n,s,a,i,o){const r=n.getSideEffectsService();let l;if(s&&s.triggerActions&&s.triggerActions.length){s.triggerActions.forEach(function(e){if(e){l=r.executeAction(e,s.context,i);if(o){o.push(l)}}})}if(s&&s.pathExpressions&&s.pathExpressions.length>0){l=r.requestSideEffects(s.pathExpressions,s.context,i);if(o){o.push(l)}l.then(function(){if(a.operationAvailableMap&&a.internalModelContext){t.setActionEnablement(a.internalModelContext,JSON.parse(a.operationAvailableMap),a.selectedItems,"table")}}).catch(function(t){e.error("Error while requesting side effects",t)})}}const z={callBoundAction:T,callActionImport:_,callBoundFunction:N,callFunctionImport:w,executeDependingOnSelectedContexts:k,valuesProvidedForAllParameters:K,getActionParameterActionName:V,actionParameterShowMessageCallback:j,afterActionResolution:H};return z},false);
|
|
260
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/operations/facade", ["sap/base/Log","sap/fe/core/ActionRuntime","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/helpers/FPMHelper","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/library","sap/m/Button","sap/m/Dialog","sap/m/MessageBox","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/model/json/JSONModel","../../../operationsHelper","./_internal"],function(e,t,n,s,i,o,a,r,l,c,u,d,g,f,m,p,h,M,E,P,C){"use strict";var x=C._validateProperties;var b=C._addMessageForActionParameter;var v=m.MessageType;var A=r.generate;var O=a.getResourceModel;const S=l.Constants,$=l.InvocationGrouping;const y=d.Action;function T(e,t,n,s,i,o){if(!o){o={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}if(!t||t.length===0){return Promise.reject("Bound actions always requires at least one context")}const a=Array.isArray(t);i.aContexts=a?t:[t];const r=n.getMetaModel(),l=`${r.getMetaPath(i.aContexts[0].getPath())}/${e}`,c=r.createBindingContext(`${l}/@$ui5.overload/0`);i.isCriticalAction=L(r,l,i.aContexts,c);const u=function(e){if(e[0].status==="fulfilled"){return e[0].value}else{throw e[0].reason||e}};return B(e,n,c,s,i,o).then(e=>{if(a){return e}else{return u(e)}},e=>{if(a){throw e}else{return u(e)}})}function _(e,t,n,s,i){if(!t){return Promise.reject("Action expects a model/context for execution")}const o=t.getMetaModel(),a=t.bindContext(`/${e}`).getPath(),r=o.createBindingContext(`/${o.createBindingContext(a).getObject("$Action")}/0`);s.isCriticalAction=L(o,`${a}/@$ui5.overload`);return B(e,t,r,n,s,i)}function N(e,t,n){if(!t){return Promise.reject("Bound functions always requires a context")}const s=n.getMetaModel(),i=`${s.getMetaPath(t.getPath())}/${e}`,o=s.createBindingContext(i);return I(e,n,o,t)}function w(e,t){if(!e){return Promise.resolve()}const n=t.getMetaModel(),s=t.bindContext(`/${e}`).getPath(),i=n.createBindingContext(`/${n.createBindingContext(s).getObject("$Function")}/0`);return I(e,t,i)}function I(e,t,n,s){let i;if(!n||!n.getObject()){return Promise.reject(new Error(`Function ${e} not found`))}if(s){n=t.bindContext(`${s.getPath()}/${e}(...)`);i="functionGroup"}else{n=t.bindContext(`/${e}(...)`);i="functionImport"}const o=n.execute(i);t.submitBatch(i);return o.then(function(){return n.getBoundContext()})}function B(e,t,n,s,i,o){if(!o){o={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}i.bGrouped=i.invocationGrouping===$.ChangeSet;return new Promise(async function(a,r){let l={};let c;let u;const d=i.label;const f=i.skipParameterDialog;const m=i.aContexts;const p=i.bIsCreateAction;const h=i.isCriticalAction;let M;let E;let P;let C;let x;let b;let v;const A=n.getObject();if(!n||!n.getObject()){return r(new Error(`Action ${e} not found`))}const O=F(n);const S=O.length>0&&!(O.length===1&&O[0].$Name==="ResultIsActiveEntity");const y=i.parameterValues;const T=s.getComponentData();const _=T&&T.startupParameters||{};if(S&&f){v=J(p,O,y,_)}c=null;if(S){if(!(f&&v)){c=j}}else if(h){c=D}l={fnOnSubmitted:i.onSubmitted,fnOnResponse:i.onResponse,actionName:e,model:t,aActionParameters:O,bGetBoundContext:i.bGetBoundContext,defaultValuesExtensionFunction:i.defaultValuesExtensionFunction,label:i.label,selectedItems:i.selectedItems};if(n.getObject("$IsBound")){if(i.additionalSideEffect&&i.additionalSideEffect.pathExpressions){M=t.getMetaModel();E=M.getMetaPath(m[0].getPath());P=M.getObject(`${E}/@com.sap.vocabularies.Common.v1.Messages/$Path`);if(P){C=i.additionalSideEffect.pathExpressions.findIndex(function(e){return typeof e==="string"&&e===P});b=n.getObject("$ReturnType");x=b&&!b.$isCollection&&n.getModel().getObject(E).$Type===b.$Type;if(C>-1||x){i.mBindingParameters=i.mBindingParameters||{};if(n.getObject(`$ReturnType/$Type/${P}`)&&(!i.mBindingParameters.$select||i.mBindingParameters.$select.split(",").indexOf(P)===-1)){i.mBindingParameters.$select=i.mBindingParameters.$select?`${i.mBindingParameters.$select},${P}`:P;if(C===-1){i.additionalSideEffect.pathExpressions.push("*")}if(i.additionalSideEffect.triggerActions.length===0&&C>-1){i.additionalSideEffect.pathExpressions.splice(C,1)}}}}}l.aContexts=m;l.mBindingParameters=i.mBindingParameters;l.additionalSideEffect=i.additionalSideEffect;l.bGrouped=i.invocationGrouping===$.ChangeSet;l.internalModelContext=i.internalModelContext;l.operationAvailableMap=i.operationAvailableMap;l.isCreateAction=p;l.bObjectPage=i.bObjectPage;if(i.controlId){l.control=i.parentControl.byId(i.controlId);i.control=l.control}else{l.control=i.parentControl;i.control=i.parentControl}}if(p){l.bIsCreateAction=p}const N=(A.$Parameter||[]).some(e=>(A.$EntitySetPath&&A.$EntitySetPath===e.$Name||A.$IsBound)&&e.$isCollection);l.isStatic=N;if(c){u=c(e,s,d,l,O,y,n,i.parentControl,i.entitySetName,i.messageHandler,o);return u.then(function(e){G(i,l,A);a(e)}).catch(function(e){r(e)})}else{if(y){for(const e in l.aActionParameters){var w;l.aActionParameters[e].value=y===null||y===void 0?void 0:(w=y.find(t=>t.name===l.aActionParameters[e].$Name))===null||w===void 0?void 0:w.value}}else{for(const e in l.aActionParameters){var I;l.aActionParameters[e].value=(I=_[l.aActionParameters[e].$Name])===null||I===void 0?void 0:I[0]}}let e;try{e=await X(s,l,i.parentControl,i.messageHandler,o);const t=g.getMessageManager().getMessageModel().getData();if(o&&o.is412Executed&&o.strictHandlingTransitionFails.length){o.delaySuccessMessages=o.delaySuccessMessages.concat(t)}G(i,l,A);a(e)}catch{r(e)}finally{var B,R;if(o&&o.is412Executed&&o.strictHandlingTransitionFails.length){try{const e=o.strictHandlingTransitionFails;const t=[];e.forEach(function(e){t.push(e.oAction.getContext())});l.aContexts=t;const n=await X(s,l,i.parentControl,i.messageHandler,o);o.strictHandlingTransitionFails=[];g.getMessageManager().addMessages(o.delaySuccessMessages);G(i,l,A);a(n)}catch(e){r(e)}}let e=false;if(i.bGrouped&&o&&o.strictHandlingPromises.length||U(i.bGrouped)!==-1){e=true}i===null||i===void 0?void 0:(B=i.messageHandler)===null||B===void 0?void 0:B.showMessageDialog({control:(R=l)===null||R===void 0?void 0:R.control,onBeforeShowMessage:function(t,n){return H(i,m,undefined,t,n,e)},aSelectedContexts:i.aContexts,sActionName:d});if(o){o={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}}}})}function D(e,t,n,s,i,o,a,r,l,c){return new Promise((n,i)=>{let o=e?e:null;o=o.indexOf(".")>=0?o.split(".")[o.split(".").length-1]:o;const a=o&&l?`${l}|${o}`:"";const u=O(r);const g=u.getText("C_OPERATIONS_ACTION_CONFIRM_MESSAGE",undefined,a);d.confirm(g,{onClose:async function(e){if(e===y.OK){try{const e=await X(t,s,r,c);n(e)}catch(e){try{await c.showMessageDialog();i(e)}catch(t){i(e)}}}else{n(S.CancelActionDialog)}}})})}async function R(e,t,n,s,i,o,a,r){var l;const c=await X(e,t,n,s,r);if((l=t.aContexts)!==null&&l!==void 0&&l.length){if(c!==null&&c!==void 0&&c.some(e=>e.status==="rejected")){throw c}}const u=g.getMessageManager().getMessageModel().getData();if(r&&r.is412Executed&&r.strictHandlingTransitionFails.length){if(!a){r.delaySuccessMessages=r.delaySuccessMessages.concat(u)}else{g.getMessageManager().addMessages(r.delaySuccessMessages);let e=false;if(t.bGrouped&&r.strictHandlingPromises.length||U(t.bGrouped)!==-1){e=true}if(u.length){o.attachEventOnce("afterClose",function(){s.showMessageDialog({onBeforeShowMessage:function(n,s){return H(t,i,o,n,s,e)},control:t.control,aSelectedContexts:t.aContexts,sActionName:t.label})})}}}else if(u.length){let e=false;if(t.bGrouped&&r&&r.strictHandlingPromises.length||U(t.bGrouped)!==-1){e=true}o.attachEventOnce("afterClose",function(){s.showMessageDialog({isActionParameterDialogOpen:t===null||t===void 0?void 0:t.oDialog.isOpen(),onBeforeShowMessage:function(n,s){return H(t,i,o,n,s,e)},control:t.control,aSelectedContexts:t.aContexts,sActionName:t.label})})}return c}function G(e,n,s){if(n.internalModelContext&&n.operationAvailableMap&&n.aContexts&&n.aContexts.length&&s.$IsBound){const s=n.isStatic;if(!s){t.setActionEnablement(n.internalModelContext,JSON.parse(n.operationAvailableMap),e.selectedItems,"table")}else if(n.control){const e=n.control;if(e.isA("sap.ui.mdc.Table")){const s=e.getSelectedContexts();t.setActionEnablement(n.internalModelContext,JSON.parse(n.operationAvailableMap),s,"table")}}}}function H(e,t,n,s,o,a){let r=o.showMessageBox,l=o.showMessageDialog;const c=e.control;const u=g.getLibraryResourceBundle("sap.fe.core");const d=s.filter(function(e){return e.getTarget()===""});const f=s.filter(function(t){var n;return t.getTarget&&t.getTarget().indexOf(e.actionName)!==-1&&(e===null||e===void 0?void 0:(n=e.aActionParameters)===null||n===void 0?void 0:n.some(function(e){return t.getTarget().indexOf(e.$Name)!==-1}))});f===null||f===void 0?void 0:f.forEach(function(e){e.isAPDTarget=true});const m=f.length?true:false;let h=false;if(a&&!m){h=true;let e=u.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_TEXT");let t=u.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_DETAIL_TEXT");const n=g.getMessageManager().getMessageModel();const o=n.getData();const a=i.getMessages(true);let d;const f=c&&c.getModel("ui").getProperty("/isEditable");const m=s.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"});const M=o.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"});if(m!==1&&M!==-1){if(o.length===1&&a.length===1){if(f===false){o[0].setMessage(u.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT")+"\n\n"+o[0].getMessage())}else{e=f?u.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT_EDIT"):u.getText("C_COMMON_DIALOG_CANCEL_SINGLE_ERROR_MESSAGE_TEXT");t="";d=new p({message:e,type:v.Error,target:"",persistent:true,description:t,code:"FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"});s.unshift(d);if(s.length===1){r=true;l=false}else{l=true;r=false}}}else{d=new p({message:e,type:v.Error,target:"",persistent:true,description:t,code:"FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"});s.unshift(d);if(s.length===1){r=true;l=false}else{l=true;r=false}}}}if(n&&n.isOpen()&&t.length!==0&&!e.isStatic){if(!e.bGrouped){if(t.length>1||!m){n.close();n.destroy()}}else if(!m){n.close();n.destroy()}}let M=[];const E=n&&n.isOpen();if(!h){if(s.length===1&&s[0].getTarget&&s[0].getTarget()!==undefined&&s[0].getTarget()!==""){if(c&&c.getModel("ui").getProperty("/isEditable")===false||!c){r=!m;l=false}else if(c&&c.getModel("ui").getProperty("/isEditable")===true){r=false;l=false}}else if(c){if(c.getModel("ui").getProperty("/isEditable")===false){if(E&&m){l=false}}else if(c.getModel("ui").getProperty("/isEditable")===true){if(!E&&m){l=true;M=d.concat(f)}else if(!E&&d.length===0){l=false}}}}return{showMessageBox:r,showMessageDialog:l,filteredMessages:M.length?M:s,fnGetMessageSubtitle:c&&c.isA("sap.ui.mdc.Table")&&i.setMessageSubtitle.bind({},c,t),showChangeSetErrorDialog:e.bGrouped}}function j(t,i,a,r,l,m,p,P,C,v,$){const y=K(p,t),T=p.getModel().oModel.getMetaModel(),_=T.createBindingContext(y),w=p.getObject("$IsBound")?p.getPath().split("/@$ui5.overload/0")[0]:p.getPath().split("/0")[0],I=T.createBindingContext(w),B=r.isCreateAction,D="sap/fe/core/controls/ActionParameterDialog";return new Promise(async function(y,T){let w;const G=g.getMessageManager();const j=e=>{const t=G.getMessageModel().getData();const n=A(["APD_",e.$Name]);const s=t.filter(e=>e.getControlIds().some(e=>n.split("-").includes(e)));G.removeMessages(s)};const F={handleChange:async function(e){const t=e.getSource();const n=w.find(e=>e.field===t);j(n.parameter);n.validationPromise=e.getParameter("promise");try{n.value=await n.validationPromise;n.hasError=false}catch(e){delete n.value;n.hasError=true;b(G,[{actionParameterInfo:n,message:e.message}])}}};const L=M.loadTemplate(D,"fragment");const V=new E({$displayMode:{}});try{const M=await h.process(L,{name:D},{bindingContexts:{action:p,actionName:I,entitySet:_},models:{action:p.getModel(),actionName:I.getModel(),entitySet:_.getModel(),metaModel:_.getModel()}});const b=r.aContexts||[];const J=[];let z;await n.setUserDefaults(i,l,V,true);const Y=await f.load({definition:M,controller:F});w=l.map(e=>{const t=g.byId(A(["APD_",e.$Name]));const n=t.isA("sap.ui.mdc.MultiValueField");return{parameter:e,field:t,isMultiValue:n}});const Q=O(P);let Z={dialogCancelled:true,result:undefined};const ee=new u(A(["fe","APD_",t]),{title:a||Q.getText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE"),content:[Y],escapeHandler:function(){ee.close()},beginButton:new c(A(["fe","APD_",t,"Action","Ok"]),{text:B?Q.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"):k(Q,a,t,C),type:"Emphasized",press:async function(){try{if(!await x(G,w,Q)){return}s.lock(ee);try{v.removeTransitionMessages();let e;const t=z&&z.getParameterContext();for(const n in l){if(l[n].$isCollection){const t=ee.getModel("mvfview").getProperty(`/${l[n].$Name}`),s=[];for(const e in t){s.push(t[e].Key)}e=s}else{e=t.getProperty(l[n].$Name)}l[n].value=e;e=undefined}r.label=a;try{const e=await R(i,r,P,v,b,ee,false,$);Z={dialogCancelled:false,result:e};ee.close()}catch(e){const t=sap.ui.getCore().getMessageManager().getMessageModel().getData();if($&&$.is412Executed&&$.strictHandlingTransitionFails.length){$.delaySuccessMessages=$.delaySuccessMessages.concat(t)}throw e}finally{if($&&$.is412Executed&&$.strictHandlingTransitionFails.length){try{const e=$.strictHandlingTransitionFails;const t=[];e.forEach(function(e){t.push(e.oAction.getContext())});r.aContexts=t;const n=await R(i,r,P,v,b,ee,true,$);$.strictHandlingTransitionFails=[];Z={dialogCancelled:false,result:n}}catch{if($.is412Executed&&$.strictHandlingTransitionFails.length){g.getMessageManager().addMessages($.delaySuccessMessages)}let e=false;if(r.bGrouped&&$.strictHandlingPromises.length||U(r.bGrouped)!==-1){e=true}await v.showMessageDialog({isActionParameterDialogOpen:ee.isOpen(),onBeforeShowMessage:function(t,n){return H(r,b,ee,t,n,e)},aSelectedContexts:r.aContexts,sActionName:a})}}if(s.isLocked(ee)){s.unlock(ee)}}}catch(e){let t=true;let n=false;if(r.bGrouped&&$&&$.strictHandlingPromises.length||U(r.bGrouped)!==-1){n=true}await v.showMessages({context:r.aContexts[0],isActionParameterDialogOpen:ee.isOpen(),messagePageNavigationCallback:function(){ee.close()},onBeforeShowMessage:function(e,s){const i=H(r,b,ee,e,s,n);t=i.showMessageDialog;return i},aSelectedContexts:r.aContexts,sActionName:a,control:r.control});if(t){if(ee.isOpen()){}else{T(e)}}}}finally{if($){$={is412Executed:false,strictHandlingTransitionFails:[],strictHandlingPromises:[],strictHandlingWarningMessages:[],delaySuccessMessages:[],processedMessageIds:[]}}if(s.isLocked(ee)){s.unlock(ee)}}}}),endButton:new c(A(["fe","APD_",t,"Action","Cancel"]),{text:Q.getText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL"),press:function(){ee.close()}}),beforeOpen:async function(t){const s=Object.assign({},t);v.removeTransitionMessages();const i=function(){const e=ee.getModel().getMetaModel(),t=p.sPath&&p.sPath.split("/@")[0],n=e.getObject(`${t}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`);return n};const a=async function(t){const a=i();const c=async function(s,i){if(i!==undefined){if(b.length>0&&i.$Path){try{let e=await n.requestSingletonProperty(i.$Path,z.getModel());if(e===null){e=await z.getParameterContext().requestProperty(i.$Path)}if(b.length>1){let n=i.$Path;if(n.indexOf(`${t}/`)===0){n=n.replace(`${t}/`,"")}for(let t=1;t<b.length;t++){if(b[t].getProperty(n)!==e){return{paramName:s,value:undefined,bNoPossibleValue:true}}}}return{paramName:s,value:e}}catch(t){e.error("Error while reading default action parameter",s,r.actionName);return{paramName:s,value:undefined,bLatePropertyError:true}}}else{return{paramName:s,value:i}}}else if(V&&V.oData[s]){return{paramName:s,value:V.oData[s]}}else{return{paramName:s,value:undefined}}};const u=function(e){const t=ee.getModel().getMetaModel(),s=n.getParameterPath(p.getPath(),e)+"@",i=t.getObject(s),o=i&&i["@com.sap.vocabularies.UI.v1.ParameterDefaultValue"];return o};const g=[];let f,h;for(const e in l){f=l[e].$Name;h=u(f);g.push(c(f,h))}if(p.getObject("$IsBound")&&b.length>0){if(a&&a.length>0&&typeof a==="string"){for(const e in b){J.push(N(a,b[e],r.model))}}}const M=Promise.all(g);let E=Promise.resolve([]);let P;if(J&&J.length>0){E=Promise.all(J)}if(r.defaultValuesExtensionFunction){const e=r.defaultValuesExtensionFunction.substring(0,r.defaultValuesExtensionFunction.lastIndexOf(".")||-1).replace(/\./gi,"/"),t=r.defaultValuesExtensionFunction.substring(r.defaultValuesExtensionFunction.lastIndexOf(".")+1,r.defaultValuesExtensionFunction.length);P=o.actionWrapper(s,e,t,{contexts:b})}try{const e=await Promise.all([M,E,P]);const t=e[0];const n=e[1];const s=e[2];let i;for(const e in l){var C;i=l[e].$Name;const o=m===null||m===void 0?void 0:(C=m.find(t=>t.name===l[e].$Name))===null||C===void 0?void 0:C.value;if(o){z.setParameter(l[e].$Name,o)}else if(s&&s.hasOwnProperty(i)){z.setParameter(l[e].$Name,s[i])}else if(t[e]&&t[e].value!==undefined){z.setParameter(l[e].$Name,t[e].value)}else if(a&&!t[e].bNoPossibleValue){if(b.length>1){let t=0;while(t<b.length-1){if(n[t]&&n[t+1]&&n[t].getObject(i)===n[t+1].getObject(i)){t++}else{break}}if(t===b.length-1){z.setParameter(l[e].$Name,n[t].getObject(i))}}else if(n[0]&&n[0].getObject(i)){z.setParameter(l[e].$Name,n[0].getObject(i))}}}const o=t.some(function(e){if(e.bLatePropertyError){return e.bLatePropertyError}});if(o){const e=Q.getText("C_APP_COMPONENT_SAPFE_ETAG_LATE_PROPERTY");d.warning(e,{contentWidth:"25em"})}}catch(t){e.error("Error while retrieving the parameter",t)}};const c=async function(){if(p.getObject("$IsBound")&&b.length>0){const t=p.getObject("$Parameter");const n=t[0]&&t[0].$Name;try{const e=await b[0].requestObject();if(e){z.setParameter(n,e)}await a(n)}catch(t){e.error("Error while retrieving the parameter",t)}}else{await a()}};await c();for(const e of w){const t=e.isMultiValue?e.field.getItems():e.field.getValue();e.value=t;e.validationPromise=Promise.resolve(t)}},afterClose:function(){l.forEach(j);ee.destroy();if(Z.dialogCancelled){T(S.CancelActionDialog)}else{y(Z.result)}}});r.oDialog=ee;ee.setModel(p.getModel().oModel);ee.setModel(V,"paramsModel");ee.bindElement({path:"/",model:"paramsModel"});const te=new E({});ee.setModel(te,"mvfview");for(const e of w){if(e.isMultiValue){var W,q;e===null||e===void 0?void 0:(W=e.field)===null||W===void 0?void 0:(q=W.getBinding("items"))===null||q===void 0?void 0:q.attachChange(()=>{j(e.parameter)})}else{var X,K;e===null||e===void 0?void 0:(X=e.field)===null||X===void 0?void 0:(K=X.getBinding("value"))===null||K===void 0?void 0:K.attachChange(()=>{j(e.parameter)})}}let ne=`${t}(...)`;if(!b.length){ne=`/${ne}`}ee.bindElement({path:ne});if(P){P.addDependent(ee)}if(b.length>0){ee.setBindingContext(b[0])}z=ee.getObjectBinding();ee.open()}catch(e){T(e)}})}function F(e){const t=e.getObject("$Parameter")||[];if(t&&t.length){if(e.getObject("$IsBound")){return t.slice(1,t.length)||[]}}return t}function L(e,t,n,s){const i=e.getObject(`${t}@com.sap.vocabularies.Common.v1.IsActionCritical`);let o=i&&i.$Path;if(!o){return!!i}const a=s&&s.getObject("$Parameter"),r=o&&o.split("/"),l=a&&a.length&&typeof a==="object"&&o&&n&&n.length;if(l){a.filter(function(e){const t=r&&r.indexOf(e.$Name);if(t>-1){r.splice(t,1)}});o=r.join("/");return n[0].getObject(o)}else if(o){return n[0].getObject(o)}}function k(e,t,n,s){let i=n?n:null;const o=i.split(".");i=i.indexOf(".")>=0?o[o.length-1]:i;const a=i&&s?`${s}|${i}`:"";const r="ACTION_PARAMETER_DIALOG_ACTION_NAME";const l=e.checkIfResourceKeyExists(`${r}|${a}`);if(t){if(l){return e.getText(r,undefined,a)}else if(e.checkIfResourceKeyExists(`${r}|${s}`)){return e.getText(r,undefined,`${s}`)}else if(e.checkIfResourceKeyExists(`${r}`)){return e.getText(r)}else{return t}}else{return e.getText("C_COMMON_DIALOG_OK")}}function V(e,t,n,s,i,o,a,r,l,c,u){let d,g=true;if(t){t.internalOperationsPromiseResolve=l}if(n){var f;const t=e.getBoundContext().getPath();const n=e.getModel().getMetaModel().getMetaPath(t);const s=e.getModel().getMetaModel().getObject(n);if(s&&((f=s[0])===null||f===void 0?void 0:f.$kind)!=="Action"){g=false}}if(!g){d=e.execute(s).then(function(){l(e.getBoundContext());return e.getBoundContext()})}else{d=n?e.execute(s,undefined,P.fnOnStrictHandlingFailed.bind(Y,s,t,i,r,e.getContext(),a,o,u)).then(function(){if(u&&!t.bGrouped){W(e,s,u,t)}l(e.getBoundContext());return e.getBoundContext()}).catch(function(){if(u&&!t.bGrouped){W(e,s,u,t)}c();return Promise.reject()}):e.execute(s,undefined,P.fnOnStrictHandlingFailed.bind(Y,s,t,i,r,e.getContext(),a,o,u)).then(function(n){if(u&&!t.bGrouped){W(e,s,u,t)}l(n);return n}).catch(function(){if(u&&!t.bGrouped){W(e,s,u,t)}c();return Promise.reject()})}return d.catch(()=>{throw S.ActionExecutionFailed})}function W(e,t,n,s){const i=sap.ui.getCore().getMessageManager().getMessageModel().getData();let{processedMessageIds:o,delaySuccessMessages:a,strictHandlingTransitionFails:r}=n;const l=i.filter(function(e){const t=o.find(function(t){return e.id===t});if(!t){o.push(e.id);if(e.type===v.Success){a.push(e)}}return e.persistent===true&&e.type!==v.Success&&!t});if(l.length){if(s!==null&&s!==void 0&&s.internalModelContext){r.push({oAction:e,groupId:t})}}}function q(){let t=null,n=null;const s=new Promise(function(e,s){t=e;n=s}).catch(function(t){e.error("Error while executing action ",t)});return{oLocalActionPromise:s,internalOperationsPromiseResolve:t,internalOperationsPromiseReject:n}}function U(e){if(e){const e=i.getMessages();return e.findIndex(function(e){return e.getType()==="Error"||e.getType()==="Warning"})}return-1}function X(t,n,s,i,o){const a=n.aContexts||[];const r=n.model;const l=n.aActionParameters||[];const c=n.actionName;const u=n.fnOnSubmitted;const d=n.fnOnResponse;const f=O(s);let m;function p(){if(l&&l.length){for(let e=0;e<l.length;e++){if(!l[e].value){switch(l[e].$Type){case"Edm.String":l[e].value="";break;case"Edm.Boolean":l[e].value=false;break;case"Edm.Byte":case"Edm.Int16":case"Edm.Int32":case"Edm.Int64":l[e].value=0;break;default:break}}m.setParameter(l[e].$Name,l[e].value)}}}if(a.length){return new Promise(function(s){const l=n.mBindingParameters;const d=n.bGrouped;const h=n.bGetBoundContext;const M=[];let E;let C;let x;const b=q();const v=function(e,s,a,r){p();const l=[];x=!d?`$auto.${s}`:e.getUpdateGroupId();n.requestSideEffects=z.bind(Y,t,a,n,x,l);E=V(e,n,h,x,f,i,r,s,b.internalOperationsPromiseResolve,b.internalOperationsPromiseReject,o);M.push(E);l.push(b.oLocalActionPromise);z(t,a,n,x,l);return Promise.allSettled(l)};const A=function(e,s,a,l){const c=[];p();x=`apiMode${s}`;n.requestSideEffects=z.bind(Y,t,a,n,x,c);E=V(e,n,h,x,f,i,l,s,b.internalOperationsPromiseResolve,b.internalOperationsPromiseReject,o);M.push(E);c.push(b.oLocalActionPromise);z(t,a,n,x,c);r.submitBatch(x);return Promise.allSettled(c)};async function O(){const t=[];for(C=0;C<a.length;C++){m=r.bindContext(`${c}(...)`,a[C],l);t.push(v(m,a.length<=1?null:C,{context:a[C],pathExpressions:n.additionalSideEffect&&n.additionalSideEffect.pathExpressions,triggerActions:n.additionalSideEffect&&n.additionalSideEffect.triggerActions},a.length))}(u||function e(){})(M);await Promise.allSettled(t);if(o&&o.strictHandlingPromises.length){try{const e=U(true);if(e===-1){await P.renderMessageView(n,f,i,o.strictHandlingWarningMessages,o,a.length>1)}else{o.strictHandlingPromises.forEach(function(e){e.resolve(false)});const e=g.getMessageManager().getMessageModel();const t=e.getData();e.setData(t.concat(o.strictHandlingWarningMessages))}}catch{e.error("Retriggering of strict handling actions failed")}}$()}async function S(e){(u||function e(){})(M);function t(e,t,s){m=r.bindContext(`${c}(...)`,e,l);return A(m,t,{context:e,pathExpressions:n.additionalSideEffect&&n.additionalSideEffect.pathExpressions,triggerActions:n.additionalSideEffect&&n.additionalSideEffect.triggerActions},s)}await e.reduce(async(e,n,s)=>{await e;await t(n,s+1,a.length)},Promise.resolve());if(o&&o.strictHandlingPromises.length){await P.renderMessageView(n,f,i,o.strictHandlingWarningMessages,o,a.length>1)}$()}if(!d){S(a)}else{O()}function $(){return Promise.allSettled(M).then(s)}}).finally(function(){(d||function e(){})()})}else{m=r.bindContext(`/${c}(...)`);p();const t="actionImport";const s=m.execute(t,undefined,P.fnOnStrictHandlingFailed.bind(Y,t,{label:n.label,model:r},f,null,null,null,i,o));r.submitBatch(t);(u||function e(){})(s);return s.then(function(e){if(e){return e}else{var t,n,s;return(t=(n=m).getBoundContext)===null||t===void 0?void 0:(s=t.call(n))===null||s===void 0?void 0:s.getObject()}}).catch(function(t){e.error("Error while executing action "+c,t);throw t}).finally(function(){(d||function e(){})()})}}function K(e,t){let n=e.getPath();n=e.getObject("$IsBound")?n.split("@$ui5.overload")[0]:n.split("/0")[0];return n.split(`/${t}`)[0]}function J(e,t,n,s){if(n){for(const e of t){if(e.$Name!=="ResultIsActiveEntity"&&!(n!==null&&n!==void 0&&n.find(t=>t.name===e.$Name))){return false}}}else if(e&&s){for(const e of t){if(!s[e.$Name]){return false}}}return true}function z(n,s,i,o,a){const r=n.getSideEffectsService();let l;if(s&&s.triggerActions&&s.triggerActions.length){s.triggerActions.forEach(function(e){if(e){l=r.executeAction(e,s.context,o);if(a){a.push(l)}}})}if(s&&s.pathExpressions&&s.pathExpressions.length>0){l=r.requestSideEffects(s.pathExpressions,s.context,o);if(a){a.push(l)}l.then(function(){if(i.operationAvailableMap&&i.internalModelContext){t.setActionEnablement(i.internalModelContext,JSON.parse(i.operationAvailableMap),i.selectedItems,"table")}}).catch(function(t){e.error("Error while requesting side effects",t)})}}const Y={callBoundAction:T,callActionImport:_,callBoundFunction:N,callFunctionImport:w,executeDependingOnSelectedContexts:V,createinternalOperationsPromiseForActionExecution:q,valuesProvidedForAllParameters:J,getActionParameterActionName:k,actionParameterShowMessageCallback:H,afterActionResolution:G,checkforOtherMessages:U};return Y},false);
|
|
261
261
|
/*!
|
|
262
262
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
263
263
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
264
264
|
*/
|
|
265
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/sticky", ["sap/base/Log","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/library","sap/m/MessageBox","sap/ui/core/Core","../../operationsHelper"],function(e,t,n,o,i,c){"use strict";var s=t.getResourceModel;const r=n.ProgrammingModel;async function a(e,t){const n=e.getModel(),o=n.getMetaModel(),i=o.getMetaPath(e.getPath()),r=o.getObject(`${i}@com.sap.vocabularies.Session.v1.StickySessionSupported/EditAction`);if(!r){throw new Error(`Edit Action for Sticky Session not found for ${i}`)}const a=s(t);const d=a.getText("C_COMMON_OBJECT_PAGE_EDIT");const u=n.bindContext(`${r}(...)`,e,{$$inheritExpandSelect:true});const f="direct";const g=u.execute(f,undefined,c.fnOnStrictHandlingFailed.bind(l,f,{label:d,model:n},a,null,null,null,undefined,undefined));n.submitBatch(f);const S=await g;const M=t.getSideEffectsService().getODataActionSideEffects(r,S);if(M!==null&&M!==void 0&&M.triggerActions&&M.triggerActions.length){await t.getSideEffectsService().requestSideEffectsForODataAction(M,S)}return S}async function d(t,n){const o=t.getModel(),i=o.getMetaModel(),r=i.getMetaPath(t.getPath()),a=i.getObject(`${r}@com.sap.vocabularies.Session.v1.StickySessionSupported/SaveAction`);if(!a){throw new Error(`Save Action for Sticky Session not found for ${r}`)}const d=s(n);const u=d.getText("C_OP_OBJECT_PAGE_SAVE");const f=o.bindContext(`${a}(...)`,t,{$$inheritExpandSelect:true});const g="direct";const S=f.execute(g,undefined,c.fnOnStrictHandlingFailed.bind(l,g,{label:u,model:o},d,null,null,null,undefined,undefined));o.submitBatch(g);try{return await S}catch(o){const c=i.getObject(`${r}/@${"com.sap.vocabularies.Common.v1.Messages"}/$Path`);if(c){try{await n.getSideEffectsService().requestSideEffects([c],t)}catch(t){e.error("Error while requesting side effects",t)}}throw o}}function u(e){const t=e.getModel(),n=t.getMetaModel(),o=n.getMetaPath(e.getPath()),i=n.getObject(`${o}@com.sap.vocabularies.Session.v1.StickySessionSupported/DiscardAction`);if(!i){throw new Error(`Discard Action for Sticky Session not found for ${o}`)}const c=t.bindContext(`/${i}(...)`);
|
|
265
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/editFlow/sticky", ["sap/base/Log","sap/fe/core/helpers/ResourceModelHelper","sap/fe/core/library","sap/m/MessageBox","sap/ui/core/Core","../../operationsHelper"],function(e,t,n,o,i,c){"use strict";var s=t.getResourceModel;const r=n.ProgrammingModel;async function a(e,t){const n=e.getModel(),o=n.getMetaModel(),i=o.getMetaPath(e.getPath()),r=o.getObject(`${i}@com.sap.vocabularies.Session.v1.StickySessionSupported/EditAction`);if(!r){throw new Error(`Edit Action for Sticky Session not found for ${i}`)}const a=s(t);const d=a.getText("C_COMMON_OBJECT_PAGE_EDIT");const u=n.bindContext(`${r}(...)`,e,{$$inheritExpandSelect:true});const f="direct";const g=u.execute(f,undefined,c.fnOnStrictHandlingFailed.bind(l,f,{label:d,model:n},a,null,null,null,undefined,undefined));n.submitBatch(f);const S=await g;const M=t.getSideEffectsService().getODataActionSideEffects(r,S);if(M!==null&&M!==void 0&&M.triggerActions&&M.triggerActions.length){await t.getSideEffectsService().requestSideEffectsForODataAction(M,S)}return S}async function d(t,n){const o=t.getModel(),i=o.getMetaModel(),r=i.getMetaPath(t.getPath()),a=i.getObject(`${r}@com.sap.vocabularies.Session.v1.StickySessionSupported/SaveAction`);if(!a){throw new Error(`Save Action for Sticky Session not found for ${r}`)}const d=s(n);const u=d.getText("C_OP_OBJECT_PAGE_SAVE");const f=o.bindContext(`${a}(...)`,t,{$$inheritExpandSelect:true});const g="direct";const S=f.execute(g,undefined,c.fnOnStrictHandlingFailed.bind(l,g,{label:u,model:o},d,null,null,null,undefined,undefined));o.submitBatch(g);try{return await S}catch(o){const c=i.getObject(`${r}/@${"com.sap.vocabularies.Common.v1.Messages"}/$Path`);if(c){try{await n.getSideEffectsService().requestSideEffects([c],t)}catch(t){e.error("Error while requesting side effects",t)}}throw o}}function u(e){const t=e.getModel(),n=t.getMetaModel(),o=n.getMetaPath(e.getPath()),i=n.getObject(`${o}@com.sap.vocabularies.Session.v1.StickySessionSupported/DiscardAction`);if(!i){throw new Error(`Discard Action for Sticky Session not found for ${o}`)}const c=t.bindContext(`/${i}(...)`);return c.execute("$direct").then(function(){return e})}function f(t,n,c){const s=n.getModel("ui").getProperty("/isEditable"),a=i.getLibraryResourceBundle("sap.fe.templates"),d=a&&a.getText("T_COMMON_UTILS_NAVIGATION_AWAY_MSG"),u=a&&a.getText("T_COMMON_UTILS_NAVIGATION_AWAY_CONFIRM_BUTTON"),f=a&&a.getText("T_COMMON_UTILS_NAVIGATION_AWAY_CANCEL_BUTTON");if(c===r.Sticky&&s){return o.warning(d,{actions:[u,f],emphasizedAction:u,onClose:function(n){if(n===u){e.info("Navigation confirmed.");t()}else{e.info("Navigation rejected.")}}})}return t()}const l={editDocumentInStickySession:a,activateDocument:d,discardDocument:u,processDataLossConfirmation:f};return l},false);
|
|
266
266
|
/*!
|
|
267
267
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
268
268
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
269
269
|
*/
|
|
270
|
-
sap.ui.predefine("sap/fe/core/controllerextensions/messageHandler/messageHandling", ["sap/fe/core/helpers/ResourceModelHelper","sap/m/Bar","sap/m/Button","sap/m/Dialog","sap/m/FormattedText","sap/m/MessageBox","sap/m/MessageItem","sap/m/MessageToast","sap/m/MessageView","sap/m/Text","sap/ui/core/Core","sap/ui/core/format/DateFormat","sap/ui/core/IconPool","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/model/Filter","sap/ui/model/FilterOperator","sap/ui/model/json/JSONModel","sap/ui/model/Sorter"],function(e,t,n,o,r,i,a,s,l,u,g,c,f,d,p,T,m,E,_){"use strict";var S=e.getResourceModel;const A=d.MessageType;let h=[];let C=[];let M=[];let b;let I;let N;function R(){let e;function t(e){return e.property?"( ${"+e.property+'} ? ("<p>'+e.property.substr(Math.max(e.property.lastIndexOf("/"),e.property.lastIndexOf("."))+1)+' : " + '+"${"+e.property+'} + "</p>") : "" )':""}function n(t){let n="";if(t.groupName&&t.property&&t.groupName!==e){n+="( ${"+t.property+'} ? "<br><h3>'+t.groupName+'</h3>" : "" ) + ';e=t.groupName}return n}function o(){const e="technicalDetails";return[{groupName:"",property:`${e}/status`},{groupName:"",property:`${e}/statusText`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ComponentId`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceId`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceRepository`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceVersion`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/Analysis`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/Note`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/DetailedNote`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ExceptionCategory`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.TimeStamp`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.TransactionId`},{groupName:"Messages",property:`${e}/error/code`},{groupName:"Messages",property:`${e}/error/message`}]}let r="Object.keys("+"${technicalDetails}"+').length > 0 ? "<h2>Technical Details</h2>" : "" ';o().forEach(function(e){r=`${r+n(e)}${t(e)} + `});return r}function P(){return"(${"+'description} ? ("<h2>Description</h2>" + ${'+'description}) : "")'}function x(e){let t=A.None;const n=e.length;const o={Error:0,Warning:0,Success:0,Information:0};for(let t=0;t<n;t++){++o[e[t].getType()]}if(o[A.Error]>0){t=A.Error}else if(o[A.Warning]>0){t=A.Warning}else if(o[A.Success]>0){t=A.Success}else if(o[A.Information]>0){t=A.Information}return t}function O(e,t,n){const o=e.getMessageModel().getObject("/");let r=false;let i="";o.forEach(function(a,s){const l=a.getTechnicalDetails&&a.getTechnicalDetails();if(l&&l.httpStatus===412&&l.isConcurrentModification){if(n){i=i||t.getText("C_APP_COMPONENT_SAPFE_ETAG_TECHNICAL_ISSUES_CONCURRENT_MODIFICATION")}else{i=i||t.getText("C_APP_COMPONENT_SAPFE_ETAG_TECHNICAL_ISSUES")}e.removeMessages(o[s]);a.setMessage(i);a.target="";e.addMessages(a);r=true}});return r}function y(){b.close();I.setVisible(false);h=[];const e=N.getModel();if(e){e.setData({})}X()}function v(e,t){const n=new Date;const o=e.getTechnicalDetails();const r=g.getLibraryResourceBundle("sap.fe.core");let i;if(o&&o.httpStatus===503&&o.retryAfter){const e=o.retryAfter;let a;if(n.getFullYear()!==e.getFullYear()){a=c.getDateTimeInstance({pattern:"MMMM dd, yyyy 'at' hh:mm a"});i=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR",[a.format(e)])}else if(n.getFullYear()==e.getFullYear()){if(t){i=`${r.getText("C_MESSAGE_HANDLING_SAPFE_503_TITLE")} ${r.getText("C_MESSAGE_HANDLING_SAPFE_503_DESC")}`}else if(n.getMonth()!==e.getMonth()||n.getDate()!==e.getDate()){a=c.getDateTimeInstance({pattern:"MMMM dd 'at' hh:mm a"});i=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR",[a.format(e)])}else{a=c.getDateTimeInstance({pattern:"hh:mm a"});i=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_DAY",[a.format(e)])}}}if(o&&o.httpStatus===503&&!o.retryAfter){i=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_NO_RETRY_AFTER")}return i}function G(e,t,o){let r;if(!t){const e='{= ${description} ? "<html><body>" + '+P()+' + "</html></body>" : "" }';const t='{= ${technicalDetails} ? "<html><body>" + '+R()+' + "</html></body>" : "" }';r=new a(undefined,{counter:{path:"counter"},title:"{message}",subtitle:"{additionalText}",longtextUrl:"{descriptionUrl}",type:{path:"type"},groupName:"{headerName}",description:e+t,markupDescription:true})}else if(o){r=new a(undefined,{counter:{path:"counter"},title:"{message}",subtitle:"{additionalText}",longtextUrl:"{descriptionUrl}",type:{path:"type"},description:"{description}",markupDescription:true})}else{r=new a({title:"{message}",type:{path:"type"},longtextUrl:"{descriptionUrl}"})}N=new l({showDetailsPageHeader:false,itemSelect:function(){I.setVisible(true)},items:{path:"/",template:r}});N.setGroupItems(true);I=I||new n({icon:f.getIconURI("nav-back"),visible:false,press:function(){N.navigateBack();this.setVisible(false)}});N.setModel(e);return{oMessageView:N,oBackButton:I}}function D(e,a,l,c,f,d,S,R,P){let O=this.getMessages();const D=g.getMessageManager();let $;let L;const w=[new T({path:"persistent",operator:m.NE,value1:false})];let B=false,U=false;if(l){O=O.concat(Z(true,true));w.push(new T({path:"persistent",operator:m.EQ,value1:true}));const e=function(e){let t=Infinity,n=g.byId(e[0]);const r=g.byId(e[0]);while(n){const e=n instanceof o?r.getParent().findElements(true).indexOf(r):Infinity;if(n instanceof o){if(t>e){t=e;r.focus()}return false}n=n.getParent()}return true};w.push(new T({path:"controlIds",test:e,caseSensitive:true}))}else{w.push(new T({path:"target",operator:m.EQ,value1:""}))}if(e&&e.length){e.forEach(function(e){const t=e.code?e.code:"";D.addMessages(new p({message:e.text,type:e.type,target:"",persistent:true,code:t}))})}const H=N&&N.getModel()||new E;const V=this.modifyETagMessagesOnly(D,g.getLibraryResourceBundle("sap.fe.core"),c);if(O.length===1&&O[0].getCode()==="503"){U=true}else if(O.length!==0){B=true}let j;let k=[];if(B||!U&&!R){const e=D.getMessageModel().bindList("/",undefined,undefined,w),t=e.getCurrentContexts();if(t&&t.length>0){B=true;const e=[];t.forEach(function(t){const n=t.getObject();e.push(n);C=e});let n=[];if(Array.isArray(H.getData())){n=H.getData()}const o={};k=C.concat(n).filter(function(e){return!o[e.id]&&(o[e.id]=true)});H.setData(k)}}if(R){j={showMessageBox:U,showMessageDialog:B};j=R(O,j);U=j.showMessageBox;B=j.showMessageDialog;if(B||j.showChangeSetErrorDialog){k=j.filteredMessages?j.filteredMessages:k}}if(O.length===0&&!e&&!V){return Promise.resolve(true)}else if(O.length===1&&O[0].getType()===A.Success&&!e){return new Promise(e=>{s.show(O[0].message);if(H){H.setData({})}D.removeMessages(O);e()})}else if(B){ge.updateMessageObjectGroupName(k,f,d,P);H.setData(k);M=M||[];return new Promise(function(e,r){M.push(e);g.getLibraryResourceBundle("sap.fe.core",true).then(function(r){const i=false;if(j&&j.fnGetMessageSubtitle){H.getData().forEach(function(e){j.fnGetMessageSubtitle(e)})}const s=G(H,i);const l=new _("",undefined,undefined,(e,t)=>{const n=F(e);const o=F(t);if(n<o){return-1}if(n>o){return 1}return 0});s.oMessageView.getBinding("items").sort(l);b=b&&b.isOpen()?b:new o({resizable:true,endButton:new n({press:function(){y();D.removeMessages(k)},text:r.getText("C_COMMON_SAPFE_CLOSE")}),customHeader:new t({contentMiddle:[new u({text:r.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE")})],contentLeft:[I]}),contentWidth:"37.5em",contentHeight:"21.5em",verticalScrolling:false,afterClose:function(){for(let e=0;e<M.length;e++){M[e].call()}M=[]}});b.removeAllContent();b.addContent(s.oMessageView);if(V){sap.ui.require(["sap/m/ButtonType"],function(e){b.setBeginButton(new n({press:function(){y();if(a.hasPendingChanges()){a.getBinding().resetChanges()}a.refresh()},text:r.getText("C_COMMON_SAPFE_REFRESH"),type:e.Emphasized}))})}else{b.destroyBeginButton()}$=x(N.getItems());L=Q($);b.setState($);b.getCustomHeader().getContentMiddle()[0].setText(L);N.navigateBack();b.open();if(S){e(b)}}).catch(r)})}else if(U){return new Promise(function(e){const t=O[0];if(t.technicalDetails&&h.indexOf(t.technicalDetails.originalMessage.message)===-1||j&&j.showChangeSetErrorDialog){if(!j||!j.showChangeSetErrorDialog){h.push(t.technicalDetails.originalMessage.message)}let n="<html><body>";const o=v(t,true);if(o){n=`<h6>${o}</h6><br>`}if(j&&j.fnGetMessageSubtitle){j.fnGetMessageSubtitle(t)}if(t.getCode()!=="503"&&t.getAdditionalText()!==undefined){n=`${n+t.getAdditionalText()}: ${t.getMessage()}</html></body>`}else{n=`${n+t.getMessage()}</html></body>`}const a=new r({htmlText:n});i.error(a,{onClose:function(){h=[];if(l){q()}X();e(true)}})}})}else{return Promise.resolve(true)}}function $(e,t,n,o){e.forEach(e=>{var r,i,a;e["headerName"]="";if(!((r=e.target)!==null&&r!==void 0&&r.length)&&((i=e.getCode)===null||i===void 0?void 0:i.call(e))!=="FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"){e["headerName"]="General"}else if((a=e.target)!==null&&a!==void 0&&a.length){if(o==="ListReport"){ge.setGroupNameLRTable(t,e,n)}else if(o==="ObjectPage"){ge.setGroupNameOPDisplayMode(e,n,t)}else{e["headerName"]=ge.getLastActionTextAndActionName(n)}}})}function L(e,t,n){const o=e&&e.getRowBinding();if(o){var r;const o=`${e.getRowBinding().getPath()}`;if(((r=t.target)===null||r===void 0?void 0:r.indexOf(o))===0){const o=e.getRowBinding().getContexts();o.forEach(o=>{var r;if((r=t.target)!==null&&r!==void 0&&r.includes(o.getPath())){const r=`${o.getPath()}/`;const i=e.getParent().getIdentifierColumn();const a=i&&o.getObject()[i];const s=ge.getTableColProperty(e,t,r);const{sTableTargetColName:l}=ge.getTableColInfo(e,s);if(s&&l){t["headerName"]=a?` ${a}`:e.getHeader()}else{t["headerName"]=ge.getLastActionTextAndActionName(n)}}})}}}function w(e,t,n){const o=n===null||n===void 0?void 0:n.getBindingContext();const r=(n===null||n===void 0?void 0:n.getContent)&&(n===null||n===void 0?void 0:n.getContent()[0]);let i=true;if(r){ge.getVisibleSectionsFromObjectPageLayout(r).forEach(function(n){const r=n.getSubSections();r.forEach(function(n){n.findElements(true).forEach(function(r){if(r.isA("sap.ui.mdc.Table")){const l=r.getRowBinding(),u=true;let c;r.findElements(true).forEach(e=>{if(e.isA("sap.m.Table")||e.isA("sap.ui.table.Table")){c=e}});if(l){var a,s;const f=`${o===null||o===void 0?void 0:o.getPath()}/${(a=r.getRowBinding())===null||a===void 0?void 0:a.getPath()}`;if(((s=e.target)===null||s===void 0?void 0:s.indexOf(f))===0){const o=ge.getTableColumnDataAndSetSubtile(e,r,c,l,t,u,U);const{oTargetTableInfo:a}=o;if(u){const t=r.getParent().getIdentifierColumn();if(t){const n=r.getRowBinding().getContexts();n.forEach(n=>{var o;if((o=e.target)!==null&&o!==void 0&&o.includes(n.getPath())){const o=t?n.getObject()[t]:undefined;e["additionalText"]=`${o}, ${a.sTableTargetColName}`}})}else{e["additionalText"]=`${a.sTableTargetColName}`}let o=r.getHeaderVisible()&&a.tableHeader;if(!o){o=n.getTitle()}else{const e=g.getLibraryResourceBundle("sap.fe.core");o=`${e.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${o}`}e["headerName"]=o;i=false}}}}})})})}if(i){var a;const n=`${o===null||o===void 0?void 0:o.getPath()}`;if(((a=e.target)===null||a===void 0?void 0:a.indexOf(n))===0){const n=ge.getLastActionTextAndActionName(t);e["headerName"]=n}else{e["headerName"]="General"}}}function B(e){const t=g.getLibraryResourceBundle("sap.fe.core").getText("T_MESSAGE_BUTTON_SAPFE_MESSAGE_GROUP_LAST_ACTION");return e?`${t}: ${e}`:""}function F(e){var t,n;if((t=e.headerName)!==null&&t!==void 0&&t.toString().includes("Last Action")){return 1}else if((n=e.headerName)!==null&&n!==void 0&&n.toString().includes("General")){return 3}else{return 2}}const U=(e,t,n)=>{if(n){const t=g.getLibraryResourceBundle("sap.fe.core").getText("T_MESSAGE_BUTTON_SAPFE_MESSAGE_GROUP_GENERAL");e["headerName"]=t}else{e["headerName"]=ge.getLastActionTextAndActionName(t)}};function H(e,t,n,o,r,i,a){const s=ge.getTableAndTargetInfo(t,e,n,o);s.tableHeader=t.getHeader();let l,u;if(!s.oTableRowContext){l=e.getControlIds().find(function(e){return ge.isControlInTable(t,e)})}if(l){const e=g.byId(l);u=ge.isControlPartOfCreationRow(e)}if(!s.sTableTargetColName){if(e.persistent&&r){a(e,r);i=false}}const c=ge.getMessageSubtitle(e,s.oTableRowBindingContexts,s.oTableRowContext,s.sTableTargetColName,t,u);return{oTargetTableInfo:s,subTitle:c}}function V(e,t,n,o,r,i,a){let s;let l;const u=S(r);const g=r.getParent().getIdentifierColumn();const c=ge.fetchColumnInfo(e,r);if(i){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[u.getText("T_MESSAGE_ITEM_SUBTITLE_CREATION_ROW_INDICATOR"),o?o:c.label])}else{const e=ge.getTableFirstColBindingContextForTextAnnotation(r,n,g);const i=e?e.getObject("$Path"):undefined;const f=i&&e?e.getObject("@com.sap.vocabularies.UI.v1.TextArrangement/$EnumMember"):undefined;if(t.length>0){if(a){l=a.getValue()}else if(n&&g){l=ge.getTableFirstColValue(g,n,i,f)}else{l=undefined}const e=ge.determineColumnInfo(c,u);if(l&&o){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[l,o])}else if(l&&e.sColumnIndicator==="Hidden"){s=`${u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW")}: ${l}, ${e.sColumnValue}`}else if(l&&e.sColumnIndicator==="Unknown"){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[l,e.sColumnValue])}else if(l&&e.sColumnIndicator==="undefined"){s=`${u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW")}: ${l}`}else if(!l&&o){s=u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN")+": "+o}else if(!l&&e.sColumnIndicator==="Hidden"){s=e.sColumnValue}else{s=null}}else{s=null}}return s}function j(e,t,n){let o;if(t&&n){const r=e===null||e===void 0?void 0:e.getModel();const i=r===null||r===void 0?void 0:r.getMetaModel();const a=i===null||i===void 0?void 0:i.getMetaPath(t.getPath());if(i!==null&&i!==void 0&&i.getObject(`${a}/${n}@com.sap.vocabularies.Common.v1.Text/$Path`)){o=i.createBindingContext(`${a}/${n}@com.sap.vocabularies.Common.v1.Text`)}}return o}function k(e,t,n,o){const r=t.getValue(e);let i;let a=r;if(n){if(e.lastIndexOf("/")>0){e=e.slice(0,e.lastIndexOf("/")+1);e=e.concat(n)}else{e=n}i=t.getValue(e);if(i){if(o){const e=o.slice(o.indexOf("/")+1);switch(e){case"TextOnly":a=i;break;case"TextFirst":a=`${i} (${r})`;break;case"TextLast":a=`${r} (${i})`;break;case"TextSeparate":a=r;break;default:}}else{a=`${i} (${r})`}}}return a}function W(e,t){const n=e===null||e===void 0?void 0:e.getTargets()[0].split("/").pop();return t.getParent().getTableDefinition().columns.find(function(e){return e.key.split("::").pop()===n})}function Y(e,t){const n={sColumnIndicator:String,sColumnValue:String};if(e){if(e.availability==="Hidden"){n.sColumnValue=undefined;n.sColumnIndicator="undefined"}else{n.sColumnValue=`${t.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN")} (${t.getText("T_COLUMN_INDICATOR_IN_TABLE_DEFINITION")}): ${e.label}`;n.sColumnIndicator="Hidden"}}else{n.sColumnValue=t.getText("T_MESSAGE_ITEM_SUBTITLE_INDICATOR_UNKNOWN");n.sColumnIndicator="Unknown"}return n}function K(e,t){const n=g.byId(t);if(n&&!n.isA("sap.ui.table.Table")&&!n.isA("sap.m.Table")){return e.findElements(true,function(e){return e.getId()===n})}return false}function z(e){let t=e===null||e===void 0?void 0:e.getParent();while(t&&!((n=t)!==null&&n!==void 0&&n.isA("sap.ui.table.Row"))&&!((o=t)!==null&&o!==void 0&&o.isA("sap.ui.table.CreationRow"))&&!((r=t)!==null&&r!==void 0&&r.isA("sap.m.ColumnListItem"))){var n,o,r;t=t.getParent()}return!!t&&t.isA("sap.ui.table.CreationRow")}function Q(e){const t=g.getLibraryResourceBundle("sap.fe.core");switch(e){case"Error":return t.getText("C_COMMON_SAPFE_ERROR_MESSAGES_PAGE_TITLE_ERRORS");case"Information":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_INFO");case"Success":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_SUCCESS");case"Warning":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_WARNINGS");default:return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE")}}function X(){ee(false)}function q(e){ee(true,e)}function J(e,t){if(t===undefined){return e.getObject("/")}const n=e.bindList("/");n.filter(new T({path:"target",operator:m.StartsWith,value1:t}));return n.getCurrentContexts().map(function(e){return e.getObject()})}function Z(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n=arguments.length>2?arguments[2]:undefined;let o;const r=g.getMessageManager(),i=r.getMessageModel(),a=g.getLibraryResourceBundle("sap.fe.core"),s=[];let l=[];if(e&&t&&n){l=J(i,n)}else{l=i.getObject("/")}for(o=0;o<l.length;o++){if((!t||l[o].persistent)&&(e&&l[o].target!==""||!e&&(!l[o].target||l[o].target===""))){s.push(l[o])}}for(o=0;o<s.length;o++){if(s[o].code==="503"&&s[o].message!==""&&s[o].message.indexOf(a.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX"))===-1){s[o].message=`\n${a.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX")}${s[o].message}`}}const u=[];for(o=0;o<s.length;o++){if(s[o].technicalDetails&&(s[o].technicalDetails.originalMessage!==undefined&&s[o].technicalDetails.originalMessage!==null||s[o].technicalDetails.httpStatus!==undefined&&s[o].technicalDetails.httpStatus!==null)||s[o].code){u.push(s[o])}}return u}function ee(e,t){const n=Z(e,true,t);if(n.length>0){g.getMessageManager().removeMessages(n)}}function te(e,t,n){if(n.additionalText===undefined){const o=e.getParent().getIdentifierColumn();const r=t.find(function(e){return n.getTargets()[0].indexOf(e.getPath())!==-1});n.additionalText=r?r.getObject()[o]:undefined}}function ne(e){return e.getSections().filter(function(e){return e.getVisible()})}function oe(e,t){return e.findElements(true,e=>se(t.getControlIds(),e)).sort(function(e,t){if(e.isA("sap.ui.mdc.Table")&&!t.isA("sap.ui.mdc.Table")){return-1}return 1})}function re(e,t,n){const o=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};if(!n){var r;n=new RegExp(`${o(`${(r=e.getBindingContext())===null||r===void 0?void 0:r.getPath()}/${e.getRowBinding().getPath()}`)}\\(.*\\)/`)}return t.getTargets()[0].replace(n,"")}function ie(e,t){let n;let o=e.getColumns().find(function(e){return e.getDataProperty()==t});if(!o){const i=e.getControlDelegate().getColumnsFor(e).find(function(e){if(!!e.template&&e.propertyInfos){return e.propertyInfos[0]===t||e.propertyInfos[0].replace("Property::","")===t}else{return false}});if(i){var r;o=i;t=(r=o)===null||r===void 0?void 0:r.name;n=e.getColumns().find(function(e){return t===e.getDataProperty()}).getHeader()}else{const r=e.getControlDelegate().getColumnsFor(e);o=r.find(function(e){if(e.key.indexOf("::FieldGroup::")!==-1){var n;return(n=e.propertyInfos)===null||n===void 0?void 0:n.find(function(){return r.find(function(e){return e.relativePath===t})})}});let i=false;if(o&&o.label){i=e.getColumns().some(function(e){return e.getHeader()===o.label})}n=i&&o.label;t=i&&o.key}}else{n=o&&o.getHeader()}return{sTableTargetColName:n,sTableTargetColProperty:t}}function ae(e,t,n,o){const r={};r.sTableTargetColProperty=re(e,t);const i=ie(e,r.sTableTargetColProperty);r.oTableRowBindingContexts=n.isA("sap.ui.table.Table")?o.getContexts():o.getCurrentContexts();r.sTableTargetColName=i.sTableTargetColName;r.sTableTargetColProperty=i.sTableTargetColProperty;r.oTableRowContext=r.oTableRowBindingContexts.find(function(e){return e&&t.getTargets()[0].indexOf(e.getPath())===0});return r}function se(e,t){return e.some(function(e){if(e===t.getId()){return true}return false})}function le(e,t,n,o,r){return e.getTitle()+(t.getTitle()&&n?`, ${t.getTitle()}`:"")+(o?`, ${r.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${o.tableHeader}`:"")}function ue(e,t){return!t.some(function(t){let n=e.getParent();while(n&&n!==t){n=n.getParent()}return n?true:false})}const ge={getMessages:Z,showUnboundMessages:D,removeUnboundTransitionMessages:X,removeBoundTransitionMessages:q,modifyETagMessagesOnly:O,getRetryAfterMessage:v,prepareMessageViewForDialog:G,setMessageSubtitle:te,getVisibleSectionsFromObjectPageLayout:ne,getControlFromMessageRelatingToSubSection:oe,fnFilterUponIds:se,getTableAndTargetInfo:ae,createSectionGroupName:le,bIsOrphanElement:ue,getLastActionTextAndActionName:B,getTableColumnDataAndSetSubtile:H,getTableColInfo:ie,getTableColProperty:re,getMessageSubtitle:V,determineColumnInfo:Y,fetchColumnInfo:W,getTableFirstColBindingContextForTextAnnotation:j,getMessageRank:F,fnCallbackSetGroupName:U,getTableFirstColValue:k,setGroupNameOPDisplayMode:w,updateMessageObjectGroupName:$,setGroupNameLRTable:L,isControlInTable:K,isControlPartOfCreationRow:z};return ge},false);
|
|
270
|
+
sap.ui.predefine("sap/fe/core/controllerextensions/messageHandler/messageHandling", ["sap/fe/core/helpers/ResourceModelHelper","sap/m/Bar","sap/m/Button","sap/m/Dialog","sap/m/FormattedText","sap/m/MessageBox","sap/m/MessageItem","sap/m/MessageToast","sap/m/MessageView","sap/m/Text","sap/ui/core/Core","sap/ui/core/format/DateFormat","sap/ui/core/IconPool","sap/ui/core/library","sap/ui/core/message/Message","sap/ui/model/Filter","sap/ui/model/FilterOperator","sap/ui/model/json/JSONModel","sap/ui/model/Sorter"],function(e,t,n,o,r,a,i,s,l,u,g,c,f,d,p,T,m,E,_){"use strict";var S=e.getResourceModel;const A=d.MessageType;let C=[];let h=[];let M=[];let b;let I;let N;function R(){let e;function t(e){return e.property?"( ${"+e.property+'} ? ("<p>'+e.property.substr(Math.max(e.property.lastIndexOf("/"),e.property.lastIndexOf("."))+1)+' : " + '+"${"+e.property+'} + "</p>") : "" )':""}function n(t){let n="";if(t.groupName&&t.property&&t.groupName!==e){n+="( ${"+t.property+'} ? "<br><h3>'+t.groupName+'</h3>" : "" ) + ';e=t.groupName}return n}function o(){const e="technicalDetails";return[{groupName:"",property:`${e}/status`},{groupName:"",property:`${e}/statusText`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ComponentId`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceId`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceRepository`},{groupName:"Application",property:`${e}/error/@SAP__common.Application/ServiceVersion`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/Analysis`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/Note`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ErrorResolution/DetailedNote`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.ExceptionCategory`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.TimeStamp`},{groupName:"ErrorResolution",property:`${e}/error/@SAP__common.TransactionId`},{groupName:"Messages",property:`${e}/error/code`},{groupName:"Messages",property:`${e}/error/message`}]}let r="Object.keys("+"${technicalDetails}"+').length > 0 ? "<h2>Technical Details</h2>" : "" ';o().forEach(function(e){r=`${r+n(e)}${t(e)} + `});return r}function P(){return"(${"+"description} ? (${"+'description}) : "")'}function x(e){let t=A.None;const n=e.length;const o={Error:0,Warning:0,Success:0,Information:0};for(let t=0;t<n;t++){++o[e[t].getType()]}if(o[A.Error]>0){t=A.Error}else if(o[A.Warning]>0){t=A.Warning}else if(o[A.Success]>0){t=A.Success}else if(o[A.Information]>0){t=A.Information}return t}function O(e,t,n){const o=e.getMessageModel().getObject("/");let r=false;let a="";o.forEach(function(i,s){const l=i.getTechnicalDetails&&i.getTechnicalDetails();if(l&&l.httpStatus===412&&l.isConcurrentModification){if(n){a=a||t.getText("C_APP_COMPONENT_SAPFE_ETAG_TECHNICAL_ISSUES_CONCURRENT_MODIFICATION")}else{a=a||t.getText("C_APP_COMPONENT_SAPFE_ETAG_TECHNICAL_ISSUES")}e.removeMessages(o[s]);i.setMessage(a);i.target="";e.addMessages(i);r=true}});return r}function y(){b.close();I.setVisible(false);C=[];const e=N.getModel();if(e){e.setData({})}X()}function v(e,t){const n=new Date;const o=e.getTechnicalDetails();const r=g.getLibraryResourceBundle("sap.fe.core");let a;if(o&&o.httpStatus===503&&o.retryAfter){const e=o.retryAfter;let i;if(n.getFullYear()!==e.getFullYear()){i=c.getDateTimeInstance({pattern:"MMMM dd, yyyy 'at' hh:mm a"});a=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR",[i.format(e)])}else if(n.getFullYear()==e.getFullYear()){if(t){a=`${r.getText("C_MESSAGE_HANDLING_SAPFE_503_TITLE")} ${r.getText("C_MESSAGE_HANDLING_SAPFE_503_DESC")}`}else if(n.getMonth()!==e.getMonth()||n.getDate()!==e.getDate()){i=c.getDateTimeInstance({pattern:"MMMM dd 'at' hh:mm a"});a=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR",[i.format(e)])}else{i=c.getDateTimeInstance({pattern:"hh:mm a"});a=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_DAY",[i.format(e)])}}}if(o&&o.httpStatus===503&&!o.retryAfter){a=r.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_NO_RETRY_AFTER")}return a}function G(e,t,o){let r;if(!t){const e='{= ${description} ? "<html><body>" + '+P()+' + "</html></body>" : "" }';const t='{= ${technicalDetails} ? "<html><body>" + '+R()+' + "</html></body>" : "" }';r=new i(undefined,{counter:{path:"counter"},title:"{message}",subtitle:"{additionalText}",longtextUrl:"{descriptionUrl}",type:{path:"type"},groupName:"{headerName}",description:e+t,markupDescription:true})}else if(o){r=new i(undefined,{counter:{path:"counter"},title:"{message}",subtitle:"{additionalText}",longtextUrl:"{descriptionUrl}",type:{path:"type"},description:"{description}",markupDescription:true})}else{r=new i({title:"{message}",type:{path:"type"},longtextUrl:"{descriptionUrl}"})}N=new l({showDetailsPageHeader:false,itemSelect:function(){I.setVisible(true)},items:{path:"/",template:r}});N.setGroupItems(true);I=I||new n({icon:f.getIconURI("nav-back"),visible:false,press:function(){N.navigateBack();this.setVisible(false)}});N.setModel(e);return{oMessageView:N,oBackButton:I}}function D(e,i,l,c,f,d,S,R,P){let O=this.getMessages();const D=g.getMessageManager();let $;let L;const w=[new T({path:"persistent",operator:m.NE,value1:false})];let B=false,U=false;if(l){O=O.concat(Z(true,true));w.push(new T({path:"persistent",operator:m.EQ,value1:true}));const e=function(e){let t=Infinity,n=g.byId(e[0]);const r=g.byId(e[0]);while(n){const e=n instanceof o?r.getParent().findElements(true).indexOf(r):Infinity;if(n instanceof o){if(t>e){t=e;r.focus()}return false}n=n.getParent()}return true};w.push(new T({path:"controlIds",test:e,caseSensitive:true}))}else{w.push(new T({path:"target",operator:m.EQ,value1:""}))}if(e&&e.length){e.forEach(function(e){const t=e.code?e.code:"";D.addMessages(new p({message:e.text,type:e.type,target:"",persistent:true,code:t}))})}const H=N&&N.getModel()||new E;const V=this.modifyETagMessagesOnly(D,g.getLibraryResourceBundle("sap.fe.core"),c);if(O.length===1&&O[0].getCode()==="503"){U=true}else if(O.length!==0){B=true}let j;let k=[];if(B||!U&&!R){const e=D.getMessageModel().bindList("/",undefined,undefined,w),t=e.getCurrentContexts();if(t&&t.length>0){B=true;const e=[];t.forEach(function(t){const n=t.getObject();e.push(n);h=e});let n=[];if(Array.isArray(H.getData())){n=H.getData()}const o={};k=h.concat(n).filter(function(e){return!o[e.id]&&(o[e.id]=true)});H.setData(k)}}if(R){j={showMessageBox:U,showMessageDialog:B};j=R(O,j);U=j.showMessageBox;B=j.showMessageDialog;if(B||j.showChangeSetErrorDialog){k=j.filteredMessages?j.filteredMessages:k}}if(O.length===0&&!e&&!V){return Promise.resolve(true)}else if(O.length===1&&O[0].getType()===A.Success&&!e){return new Promise(e=>{s.show(O[0].message);if(H){H.setData({})}D.removeMessages(O);e()})}else if(B){ge.updateMessageObjectGroupName(k,f,d,P);H.setData(k);M=M||[];return new Promise(function(e,r){M.push(e);g.getLibraryResourceBundle("sap.fe.core",true).then(function(r){const a=false;if(j&&j.fnGetMessageSubtitle){H.getData().forEach(function(e){j.fnGetMessageSubtitle(e)})}const s=G(H,a);const l=new _("",undefined,undefined,(e,t)=>{const n=F(e);const o=F(t);if(n<o){return-1}if(n>o){return 1}return 0});s.oMessageView.getBinding("items").sort(l);b=b&&b.isOpen()?b:new o({resizable:true,endButton:new n({press:function(){y();D.removeMessages(k)},text:r.getText("C_COMMON_SAPFE_CLOSE")}),customHeader:new t({contentMiddle:[new u({text:r.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE")})],contentLeft:[I]}),contentWidth:"37.5em",contentHeight:"21.5em",verticalScrolling:false,afterClose:function(){for(let e=0;e<M.length;e++){M[e].call()}M=[]}});b.removeAllContent();b.addContent(s.oMessageView);if(V){sap.ui.require(["sap/m/ButtonType"],function(e){b.setBeginButton(new n({press:function(){y();if(i.hasPendingChanges()){i.getBinding().resetChanges()}i.refresh()},text:r.getText("C_COMMON_SAPFE_REFRESH"),type:e.Emphasized}))})}else{b.destroyBeginButton()}$=x(N.getItems());L=Q($);b.setState($);b.getCustomHeader().getContentMiddle()[0].setText(L);N.navigateBack();b.open();if(S){e(b)}}).catch(r)})}else if(U){return new Promise(function(e){const t=O[0];if(t.technicalDetails&&C.indexOf(t.technicalDetails.originalMessage.message)===-1||j&&j.showChangeSetErrorDialog){if(!j||!j.showChangeSetErrorDialog){C.push(t.technicalDetails.originalMessage.message)}let n="<html><body>";const o=v(t,true);if(o){n=`<h6>${o}</h6><br>`}if(j&&j.fnGetMessageSubtitle){j.fnGetMessageSubtitle(t)}if(t.getCode()!=="503"&&t.getAdditionalText()!==undefined){n=`${n+t.getAdditionalText()}: ${t.getMessage()}</html></body>`}else{n=`${n+t.getMessage()}</html></body>`}const i=new r({htmlText:n});a.error(i,{onClose:function(){C=[];if(l){q()}X();e(true)}})}})}else{return Promise.resolve(true)}}function $(e,t,n,o){e.forEach(e=>{var r,a,i;e["headerName"]="";if(!((r=e.target)!==null&&r!==void 0&&r.length)&&((a=e.getCode)===null||a===void 0?void 0:a.call(e))!=="FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED"){e["headerName"]="General"}else if((i=e.target)!==null&&i!==void 0&&i.length){if(o==="ListReport"){ge.setGroupNameLRTable(t,e,n)}else if(o==="ObjectPage"){ge.setGroupNameOPDisplayMode(e,n,t)}else{e["headerName"]=ge.getLastActionTextAndActionName(n)}}})}function L(e,t,n){const o=e&&e.getRowBinding();if(o){var r;const a=`${e.getRowBinding().getPath()}`;if(((r=t.target)===null||r===void 0?void 0:r.indexOf(a))===0){const r=o.getCurrentContexts();r.forEach(o=>{var r;if((r=t.target)!==null&&r!==void 0&&r.includes(o.getPath())){const r=`${o.getPath()}/`;const a=e.getParent().getIdentifierColumn();const i=a&&o.getObject()[a];const s=ge.getTableColProperty(e,t,r);const{sTableTargetColName:l}=ge.getTableColInfo(e,s);if(s&&l){t["headerName"]=i?` ${i}`:e.getHeader()}else{t["headerName"]=ge.getLastActionTextAndActionName(n)}}})}}}function w(e,t,n){const o=n===null||n===void 0?void 0:n.getBindingContext();const r=(n===null||n===void 0?void 0:n.getContent)&&(n===null||n===void 0?void 0:n.getContent()[0]);let a=true;if(r){ge.getVisibleSectionsFromObjectPageLayout(r).forEach(function(n){const r=n.getSubSections();r.forEach(function(n){n.findElements(true).forEach(function(r){if(r.isA("sap.ui.mdc.Table")){const l=r.getRowBinding(),u=true;let c;r.findElements(true).forEach(e=>{if(e.isA("sap.m.Table")||e.isA("sap.ui.table.Table")){c=e}});if(l){var i,s;const f=`${o===null||o===void 0?void 0:o.getPath()}/${(i=r.getRowBinding())===null||i===void 0?void 0:i.getPath()}`;if(((s=e.target)===null||s===void 0?void 0:s.indexOf(f))===0){const o=ge.getTableColumnDataAndSetSubtile(e,r,c,l,t,u,U);const{oTargetTableInfo:i}=o;if(u){const t=r.getParent().getIdentifierColumn();if(t){const n=r.getRowBinding().getContexts();n.forEach(n=>{var o;if((o=e.target)!==null&&o!==void 0&&o.includes(n.getPath())){const o=t?n.getObject()[t]:undefined;e["additionalText"]=`${o}, ${i.sTableTargetColName}`}})}else{e["additionalText"]=`${i.sTableTargetColName}`}let o=r.getHeaderVisible()&&i.tableHeader;if(!o){o=n.getTitle()}else{const e=g.getLibraryResourceBundle("sap.fe.core");o=`${e.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${o}`}e["headerName"]=o;a=false}}}}})})})}if(a){var i;const n=`${o===null||o===void 0?void 0:o.getPath()}`;if(((i=e.target)===null||i===void 0?void 0:i.indexOf(n))===0){const n=ge.getLastActionTextAndActionName(t);e["headerName"]=n}else{e["headerName"]="General"}}}function B(e){const t=g.getLibraryResourceBundle("sap.fe.core").getText("T_MESSAGE_BUTTON_SAPFE_MESSAGE_GROUP_LAST_ACTION");return e?`${t}: ${e}`:""}function F(e){var t,n;if((t=e.headerName)!==null&&t!==void 0&&t.toString().includes("Last Action")){return 1}else if((n=e.headerName)!==null&&n!==void 0&&n.toString().includes("General")){return 3}else{return 2}}const U=(e,t,n)=>{if(n){const t=g.getLibraryResourceBundle("sap.fe.core").getText("T_MESSAGE_BUTTON_SAPFE_MESSAGE_GROUP_GENERAL");e["headerName"]=t}else{e["headerName"]=ge.getLastActionTextAndActionName(t)}};function H(e,t,n,o,r,a,i){const s=ge.getTableAndTargetInfo(t,e,n,o);s.tableHeader=t.getHeader();let l,u;if(!s.oTableRowContext){l=e.getControlIds().find(function(e){return ge.isControlInTable(t,e)})}if(l){const e=g.byId(l);u=ge.isControlPartOfCreationRow(e)}if(!s.sTableTargetColName){if(e.persistent&&r){i(e,r);a=false}}const c=ge.getMessageSubtitle(e,s.oTableRowBindingContexts,s.oTableRowContext,s.sTableTargetColName,t,u);return{oTargetTableInfo:s,subTitle:c}}function V(e,t,n,o,r,a,i){let s;let l;const u=S(r);const g=r.getParent().getIdentifierColumn();const c=ge.fetchColumnInfo(e,r);if(a){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[u.getText("T_MESSAGE_ITEM_SUBTITLE_CREATION_ROW_INDICATOR"),o?o:c.label])}else{const e=ge.getTableFirstColBindingContextForTextAnnotation(r,n,g);const a=e?e.getObject("$Path"):undefined;const f=a&&e?e.getObject("@com.sap.vocabularies.UI.v1.TextArrangement/$EnumMember"):undefined;if(t.length>0){if(i){l=i.getValue()}else if(n&&g){l=ge.getTableFirstColValue(g,n,a,f)}else{l=undefined}const e=ge.determineColumnInfo(c,u);if(l&&o){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[l,o])}else if(l&&e.sColumnIndicator==="Hidden"){s=`${u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW")}: ${l}, ${e.sColumnValue}`}else if(l&&e.sColumnIndicator==="Unknown"){s=u.getText("T_MESSAGE_ITEM_SUBTITLE",[l,e.sColumnValue])}else if(l&&e.sColumnIndicator==="undefined"){s=`${u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW")}: ${l}`}else if(!l&&o){s=u.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN")+": "+o}else if(!l&&e.sColumnIndicator==="Hidden"){s=e.sColumnValue}else{s=null}}else{s=null}}return s}function j(e,t,n){let o;if(t&&n){const r=e===null||e===void 0?void 0:e.getModel();const a=r===null||r===void 0?void 0:r.getMetaModel();const i=a===null||a===void 0?void 0:a.getMetaPath(t.getPath());if(a!==null&&a!==void 0&&a.getObject(`${i}/${n}@com.sap.vocabularies.Common.v1.Text/$Path`)){o=a.createBindingContext(`${i}/${n}@com.sap.vocabularies.Common.v1.Text`)}}return o}function k(e,t,n,o){const r=t.getValue(e);let a;let i=r;if(n){if(e.lastIndexOf("/")>0){e=e.slice(0,e.lastIndexOf("/")+1);e=e.concat(n)}else{e=n}a=t.getValue(e);if(a){if(o){const e=o.slice(o.indexOf("/")+1);switch(e){case"TextOnly":i=a;break;case"TextFirst":i=`${a} (${r})`;break;case"TextLast":i=`${r} (${a})`;break;case"TextSeparate":i=r;break;default:}}else{i=`${a} (${r})`}}}return i}function W(e,t){const n=e===null||e===void 0?void 0:e.getTargets()[0].split("/").pop();return t.getParent().getTableDefinition().columns.find(function(e){return e.key.split("::").pop()===n})}function Y(e,t){const n={sColumnIndicator:String,sColumnValue:String};if(e){if(e.availability==="Hidden"){n.sColumnValue=undefined;n.sColumnIndicator="undefined"}else{n.sColumnValue=`${t.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN")} (${t.getText("T_COLUMN_INDICATOR_IN_TABLE_DEFINITION")}): ${e.label}`;n.sColumnIndicator="Hidden"}}else{n.sColumnValue=t.getText("T_MESSAGE_ITEM_SUBTITLE_INDICATOR_UNKNOWN");n.sColumnIndicator="Unknown"}return n}function K(e,t){const n=g.byId(t);if(n&&!n.isA("sap.ui.table.Table")&&!n.isA("sap.m.Table")){return e.findElements(true,function(e){return e.getId()===n})}return false}function z(e){let t=e===null||e===void 0?void 0:e.getParent();while(t&&!((n=t)!==null&&n!==void 0&&n.isA("sap.ui.table.Row"))&&!((o=t)!==null&&o!==void 0&&o.isA("sap.ui.table.CreationRow"))&&!((r=t)!==null&&r!==void 0&&r.isA("sap.m.ColumnListItem"))){var n,o,r;t=t.getParent()}return!!t&&t.isA("sap.ui.table.CreationRow")}function Q(e){const t=g.getLibraryResourceBundle("sap.fe.core");switch(e){case"Error":return t.getText("C_COMMON_SAPFE_ERROR_MESSAGES_PAGE_TITLE_ERROR");case"Information":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_INFO");case"Success":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_SUCCESS");case"Warning":return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_WARNING");default:return t.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE")}}function X(){ee(false)}function q(e){ee(true,e)}function J(e,t){if(t===undefined){return e.getObject("/")}const n=e.bindList("/");n.filter(new T({path:"target",operator:m.StartsWith,value1:t}));return n.getCurrentContexts().map(function(e){return e.getObject()})}function Z(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n=arguments.length>2?arguments[2]:undefined;let o;const r=g.getMessageManager(),a=r.getMessageModel(),i=g.getLibraryResourceBundle("sap.fe.core"),s=[];let l=[];if(e&&t&&n){l=J(a,n)}else{l=a.getObject("/")}for(o=0;o<l.length;o++){if((!t||l[o].persistent)&&(e&&l[o].target!==""||!e&&(!l[o].target||l[o].target===""))){s.push(l[o])}}for(o=0;o<s.length;o++){if(s[o].code==="503"&&s[o].message!==""&&s[o].message.indexOf(i.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX"))===-1){s[o].message=`\n${i.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX")}${s[o].message}`}}const u=[];for(o=0;o<s.length;o++){if(s[o].technicalDetails&&(s[o].technicalDetails.originalMessage!==undefined&&s[o].technicalDetails.originalMessage!==null||s[o].technicalDetails.httpStatus!==undefined&&s[o].technicalDetails.httpStatus!==null)||s[o].code){u.push(s[o])}}return u}function ee(e,t){const n=Z(e,true,t);if(n.length>0){g.getMessageManager().removeMessages(n)}}function te(e,t,n){if(n.additionalText===undefined){const o=e.getParent().getIdentifierColumn();const r=t.find(function(e){return n.getTargets()[0].indexOf(e.getPath())!==-1});n.additionalText=r?r.getObject()[o]:undefined}}function ne(e){return e.getSections().filter(function(e){return e.getVisible()})}function oe(e,t){return e.findElements(true,e=>se(t.getControlIds(),e)).sort(function(e,t){if(e.isA("sap.ui.mdc.Table")&&!t.isA("sap.ui.mdc.Table")){return-1}return 1})}function re(e,t,n){const o=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};if(!n){var r;n=new RegExp(`${o(`${(r=e.getBindingContext())===null||r===void 0?void 0:r.getPath()}/${e.getRowBinding().getPath()}`)}\\(.*\\)/`)}return t.getTargets()[0].replace(n,"")}function ae(e,t){let n;let o=e.getColumns().find(function(e){return e.getDataProperty()==t});if(!o){const a=e.getControlDelegate().getColumnsFor(e).find(function(e){if(!!e.template&&e.propertyInfos){return e.propertyInfos[0]===t||e.propertyInfos[0].replace("Property::","")===t}else{return false}});if(a){var r;o=a;t=(r=o)===null||r===void 0?void 0:r.name;n=e.getColumns().find(function(e){return t===e.getDataProperty()}).getHeader()}else{const r=e.getControlDelegate().getColumnsFor(e);o=r.find(function(e){if(e.key.indexOf("::FieldGroup::")!==-1){var n;return(n=e.propertyInfos)===null||n===void 0?void 0:n.find(function(){return r.find(function(e){return e.relativePath===t})})}});let a=false;if(o&&o.label){a=e.getColumns().some(function(e){return e.getHeader()===o.label})}n=a&&o.label;t=a&&o.key}}else{n=o&&o.getHeader()}return{sTableTargetColName:n,sTableTargetColProperty:t}}function ie(e,t,n,o){const r={};r.sTableTargetColProperty=re(e,t);const a=ae(e,r.sTableTargetColProperty);r.oTableRowBindingContexts=n.isA("sap.ui.table.Table")?o.getContexts():o.getCurrentContexts();r.sTableTargetColName=a.sTableTargetColName;r.sTableTargetColProperty=a.sTableTargetColProperty;r.oTableRowContext=r.oTableRowBindingContexts.find(function(e){return e&&t.getTargets()[0].indexOf(e.getPath())===0});return r}function se(e,t){return e.some(function(e){if(e===t.getId()){return true}return false})}function le(e,t,n,o,r){return e.getTitle()+(t.getTitle()&&n?`, ${t.getTitle()}`:"")+(o?`, ${r.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${o.tableHeader}`:"")}function ue(e,t){return!t.some(function(t){let n=e.getParent();while(n&&n!==t){n=n.getParent()}return n?true:false})}const ge={getMessages:Z,showUnboundMessages:D,removeUnboundTransitionMessages:X,removeBoundTransitionMessages:q,modifyETagMessagesOnly:O,getRetryAfterMessage:v,prepareMessageViewForDialog:G,setMessageSubtitle:te,getVisibleSectionsFromObjectPageLayout:ne,getControlFromMessageRelatingToSubSection:oe,fnFilterUponIds:se,getTableAndTargetInfo:ie,createSectionGroupName:le,bIsOrphanElement:ue,getLastActionTextAndActionName:B,getTableColumnDataAndSetSubtile:H,getTableColInfo:ae,getTableColProperty:re,getMessageSubtitle:V,determineColumnInfo:Y,fetchColumnInfo:W,getTableFirstColBindingContextForTextAnnotation:j,getMessageRank:F,fnCallbackSetGroupName:U,getTableFirstColValue:k,setGroupNameOPDisplayMode:w,updateMessageObjectGroupName:$,setGroupNameLRTable:L,isControlInTable:K,isControlPartOfCreationRow:z};return ge},false);
|
|
271
271
|
/*!
|
|
272
272
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
273
273
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -297,12 +297,12 @@ sap.ui.predefine("sap/fe/core/controls/AnyElement", ["sap/ui/core/Element"],func
|
|
|
297
297
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
298
298
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
299
299
|
*/
|
|
300
|
-
sap.ui.predefine("sap/fe/core/controls/CommandExecution", ["sap/base/Log","sap/fe/core/helpers/ClassSupport","sap/ui/core/CommandExecution","sap/ui/core/Component","sap/ui/core/Element","sap/ui/core/Shortcut"],function(t,e,o,r,n,i){"use strict";var s,
|
|
300
|
+
sap.ui.predefine("sap/fe/core/controls/CommandExecution", ["sap/base/Log","sap/fe/core/helpers/ClassSupport","sap/ui/core/CommandExecution","sap/ui/core/Component","sap/ui/core/Element","sap/ui/core/Shortcut"],function(t,e,o,r,n,i){"use strict";var s,a;var c={};var p=e.defineUI5Class;function u(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;f(t,e)}function f(t,e){f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return f(t,e)}let h=(s=p("sap.fe.core.controls.CommandExecution"),s(a=function(e){u(o,e);function o(t,o){return e.call(this,t,o)||this}c=o;var s=o.prototype;s.setParent=function t(o){e.prototype.setParent.call(this,o);const r=o.data("sap.ui.core.Shortcut");if(Array.isArray(r)&&r.length>0){const t=o.data("sap.ui.core.Shortcut")[r.length-1],e=t.shortcutSpec;if(e){for(const t in e){if(e[t]&&t!=="key"){return this}}}return this}};s.destroy=function t(e){const o=this.getParent();if(o){const t=this._getCommandInfo();if(t){i.unregister(this.getParent(),t.shortcut)}this._cleanupContext(o)}n.prototype.destroy.apply(this,[e])};s.setVisible=function o(n){let i,s=this.getParent(),a;if(!s){e.prototype.setVisible.call(this,n)}while(!a&&s){a=r.getOwnerComponentFor(s);s=s.getParent()}if(a){i=a.getCommand(this.getCommand());if(i){e.prototype.setVisible.call(this,n)}else{t.info("There is no shortcut definition registered in the manifest for the command : "+this.getCommand())}}return this};return o}(o))||a);c=h;return c},false);
|
|
301
301
|
/*!
|
|
302
302
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
303
303
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
304
304
|
*/
|
|
305
|
-
sap.ui.predefine("sap/fe/core/controls/DataLossOrDraftDiscard/
|
|
305
|
+
sap.ui.predefine("sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block", ["sap/base/Log","sap/fe/core/buildingBlocks/BuildingBlockSupport","sap/fe/core/buildingBlocks/RuntimeBuildingBlock","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/ResourceModelHelper","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/Label","sap/m/List","sap/m/Text","sap/m/VBox","sap/ui/core/CustomData","sap/ui/core/library","sap/fe/core/jsx-runtime/jsx","sap/fe/core/jsx-runtime/jsxs","sap/fe/core/jsx-runtime/Fragment"],function(e,t,o,i,s,n,a,r,l,c,u,d,p,D,f,g,h){"use strict";var L,T,_,m,v,A,S;var R={};var O=D.ValueState;var b=s.getResourceModel;var y=i.defineReference;var C=t.defineBuildingBlock;function F(e,t,o,i){if(!o)return;Object.defineProperty(e,t,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(i):void 0})}function x(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function B(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;w(e,t)}function w(e,t){w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,o){t.__proto__=o;return t};return w(e,t)}function E(e,t,o,i,s){var n={};Object.keys(i).forEach(function(e){n[e]=i[e]});n.enumerable=!!n.enumerable;n.configurable=!!n.configurable;if("value"in n||n.initializer){n.writable=true}n=o.slice().reverse().reduce(function(o,i){return i(e,t,o)||o},n);if(s&&n.initializer!==void 0){n.value=n.initializer?n.initializer.call(s):void 0;n.initializer=undefined}if(n.initializer===void 0){Object.defineProperty(e,t,n);n=null}return n}function M(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}var k;(function(e){e["Save"]="draftDataLossOptionSave";e["Keep"]="draftDataLossOptionKeep";e["Discard"]="draftDataLossOptionDiscard"})(k||(k={}));let P=(L=C({name:"DraftDataLossDialog",namespace:"sap.fe.core.controllerextensions"}),T=y(),_=y(),L(m=(v=function(t){B(o,t);function o(e){var o;o=t.call(this,e)||this;F(o,"dataLossDialog",A,x(o));F(o,"optionsList",S,x(o));return o}R=o;var i=o.prototype;i.dataLossConfirmation=function e(){var t;const o=this.controller.getView();this.dataLossResourceModel=b(o);this.getContent();const i=()=>this.handleDataLossOk();(t=this.optionsList.current)===null||t===void 0?void 0:t.addEventDelegate({onsapenter:function(){i()}});o.addDependent(this.dataLossDialog.current);this.openDataLossDialog();this.selectAndFocusFirstEntry()};i.performAfterDiscardorKeepDraft=async function e(t,o,i,s){this.controller=i;this.skipBindingToView=s;this.dataLossConfirmation();return new Promise((e,i)=>{this.onDataLossConfirmationFollowUpFunction=o=>{const i=t(o);e(i)};this.onDataLossCancelFollowUpFunction=()=>{o();i()}})};i.handleDataLossOk=function t(){const o=this.getSelectedKey();if(o===k.Save){this.saveDocument(this.controller).then(this.onDataLossConfirmationFollowUpFunction).catch(function(t){e.error("Error while saving document",t)});this.closeDataLossDialog()}else if(o===k.Keep){this.onDataLossConfirmationFollowUpFunction();this.closeDataLossDialog()}else if(o===k.Discard){this.discardDraft(this.controller,this.skipBindingToView).then(this.onDataLossConfirmationFollowUpFunction).catch(function(t){e.error("Error while discarding draft",t)});this.closeDataLossDialog()}};i.handleDataLossCancel=function e(){this.onDataLossCancelFollowUpFunction();this.closeDataLossDialog()};i.selectAndFocusFirstEntry=function e(){var t,o;const i=(t=this.optionsList.current)===null||t===void 0?void 0:t.getItems()[0];(o=this.optionsList.current)===null||o===void 0?void 0:o.setSelectedItem(i);i===null||i===void 0?void 0:i.focus()};i.discardDraft=async function e(t,o){const i=t.getView().getBindingContext();const s={skipBackNavigation:true,skipDiscardPopover:true,skipBindingToView:o!==undefined?o:true};return t.editFlow.cancelDocument(i,s)};i.saveDocument=function e(t){const o=t.getView().getBindingContext();if(t.isA("sap.fe.templates.ObjectPage.ObjectPageController")){return t._saveDocument(o)}else{return t.editFlow.saveDocument(o,{})}};i.getSelectedKey=function e(){const t=this.optionsList.current;return t.getSelectedItem().data("itemKey")};i.openDataLossDialog=function e(){var t;(t=this.dataLossDialog.current)===null||t===void 0?void 0:t.open()};i.closeDataLossDialog=function e(){var t,o;(t=this.dataLossDialog.current)===null||t===void 0?void 0:t.close();(o=this.dataLossDialog.current)===null||o===void 0?void 0:o.destroy()};i.getConfirmButton=function e(){return f(n,{text:this.dataLossResourceModel.getText("C_COMMON_DIALOG_OK"),type:"Emphasized",press:()=>this.handleDataLossOk()})};i.getCancelButton=function e(){return f(n,{text:this.dataLossResourceModel.getText("C_COMMON_DIALOG_CANCEL"),press:()=>this.handleDataLossCancel()})};i.getContent=function e(){var t;const o=(t=this.controller.getView().getBindingContext())===null||t===void 0?void 0:t.getObject().HasActiveEntity;const i=o?this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_POPUP_MESSAGE_SAVE"):this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_POPUP_MESSAGE_CREATE");const s=o?this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_SAVE_DRAFT_RBL"):this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_CREATE_ENTITY_RBL");const n=o?this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_SAVE_DRAFT_TOL"):this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_CREATE_ENTITY_TOL");return f(r,{title:this.dataLossResourceModel.getText("WARNING"),state:O.Warning,type:"Message",contentWidth:"22rem",ref:this.dataLossDialog,children:{content:g(h,{children:[f(u,{text:i,class:"sapUiTinyMarginBegin sapUiTinyMarginTopBottom"}),g(c,{mode:"SingleSelectLeft",showSeparators:"None",includeItemInSelection:"true",backgroundDesign:"Transparent",class:"sapUiNoContentPadding",ref:this.optionsList,children:[f(a,{customData:[new p({key:"itemKey",value:"draftDataLossOptionSave"})],children:g(d,{class:"sapUiTinyMargin",children:[f(l,{text:s,design:"Bold"}),f(u,{text:n})]})}),f(a,{customData:[new p({key:"itemKey",value:"draftDataLossOptionKeep"})],children:g(d,{class:"sapUiTinyMargin",children:[f(l,{text:this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_KEEP_DRAFT_RBL"),design:"Bold"}),f(u,{text:this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_KEEP_DRAFT_TOL")})]})}),f(a,{customData:[new p({key:"itemKey",value:"draftDataLossOptionDiscard"})],children:g(d,{class:"sapUiTinyMargin",children:[f(l,{text:this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_DISCARD_DRAFT_RBL"),design:"Bold"}),f(u,{text:this.dataLossResourceModel.getText("ST_DRAFT_DATALOSS_DISCARD_DRAFT_TOL")})]})})]})]}),buttons:g(h,{children:["confirmButton = ",this.getConfirmButton(),"cancelButton = ",this.getCancelButton()]})}})};return o}(o),A=E(v.prototype,"dataLossDialog",[T],{configurable:true,enumerable:true,writable:true,initializer:null}),S=E(v.prototype,"optionsList",[_],{configurable:true,enumerable:true,writable:true,initializer:null}),v))||m);R=P;return R},false);
|
|
306
306
|
/*!
|
|
307
307
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
308
308
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -332,7 +332,7 @@ sap.ui.predefine("sap/fe/core/controls/filterbar/FilterContainer", ["sap/fe/core
|
|
|
332
332
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
333
333
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
334
334
|
*/
|
|
335
|
-
sap.ui.predefine("sap/fe/core/controls/filterbar/VisualFilter", ["sap/fe/core/CommonUtils","sap/fe/core/controls/filterbar/utils/VisualFilterUtils","sap/fe/core/helpers/ClassSupport","sap/fe/macros/CommonHelper","sap/fe/macros/filter/FilterUtils","sap/m/VBox","sap/ui/core/Core","../../templating/FilterHelper"],function(e,t,r,i,
|
|
335
|
+
sap.ui.predefine("sap/fe/core/controls/filterbar/VisualFilter", ["sap/fe/core/CommonUtils","sap/fe/core/controls/filterbar/utils/VisualFilterUtils","sap/fe/core/helpers/ClassSupport","sap/fe/macros/CommonHelper","sap/fe/macros/filter/FilterUtils","sap/m/VBox","sap/ui/core/Core","../../templating/FilterHelper"],function(e,t,r,n,i,a,o,s){"use strict";var l,c,u,p,f,g,d,h,m,_,I;var b=s.getFiltersConditionsFromSelectionVariant;var v=r.property;var y=r.implementInterface;var E=r.event;var P=r.defineUI5Class;function R(e,t,r,n){if(!r)return;Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function S(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function C(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;T(e,t)}function T(e,t){T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,r){t.__proto__=r;return t};return T(e,t)}function O(e,t,r,n,i){var a={};Object.keys(n).forEach(function(e){a[e]=n[e]});a.enumerable=!!a.enumerable;a.configurable=!!a.configurable;if("value"in a||a.initializer){a.writable=true}a=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},a);if(i&&a.initializer!==void 0){a.value=a.initializer?a.initializer.call(i):void 0;a.initializer=undefined}if(a.initializer===void 0){Object.defineProperty(e,t,a);a=null}return a}function F(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let L=(l=P("sap.fe.core.controls.filterbar.VisualFilter"),c=y("sap.ui.core.IFormContent"),u=v({type:"boolean"}),p=v({type:"string"}),f=E(),l(g=(d=function(r){C(a,r);function a(){var e;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}e=r.call(this,...n)||this;R(e,"__implements__sap_ui_core_IFormContent",h,S(e));R(e,"showValueHelp",m,S(e));R(e,"valueHelpIconSrc",_,S(e));R(e,"valueHelpRequest",I,S(e));return e}var s=a.prototype;s.onAfterRendering=function e(){var r;let a;const s=this.getItems()[1].getItems()[0];const l=this.data("infoPath");const c=s.getBinding("segments")||s.getBinding("bars")||s.getBinding("points");const u=s.getBindingContext("internal");const p=o.getLibraryResourceBundle("sap.fe.macros");const f=s.data("showOverlayInitially");const g=s.data("selectionVariantAnnotation")?n.parseCustomData(s.data("selectionVariantAnnotation")):{SelectOptions:[]};const d=s.data("requiredProperties")?n.parseCustomData(s.data("requiredProperties")):[];const h=s.getModel().getMetaModel();const m=c?c.getPath():"";let _=(r=this.getParent())===null||r===void 0?void 0:r.getParent();if(_.getMetadata().getElementName()==="sap.ui.mdc.filterbar.p13n.AdaptationFilterBar"){var I;_=(I=_.getParent())===null||I===void 0?void 0:I.getParent()}let v={};let y=[];let E;if(_.getMetadata().getElementName()==="sap.fe.core.controls.FilterBar"){v=_.getConditions();y=_.getPropertyInfoSet();E=_.data("entityType").split("/")[1]}const P=s.data("parameters")?s.data("parameters").customData:[];const R=b(m,h,g,t.getCustomConditions.bind(t));const S=t.convertFilterCondions(R);const C={};Object.keys(v).forEach(function(e){if(v[e].length){C[e]=v[e]}});Object.keys(S).forEach(function(e){if(!C[e]){C[e]=S[e]}});if(f==="true"){if(!Object.keys(g).length){if(d.length>1){u.setProperty(l,{showError:true,errorMessageTitle:p.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE"),errorMessage:p.getText("M_VISUAL_FILTERS_PROVIDE_FILTER_VAL_MULTIPLEVF")})}else{a=h.getObject(`${m}/${d[0]}@com.sap.vocabularies.Common.v1.Label`)||d[0];u.setProperty(l,{showError:true,errorMessageTitle:p.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE"),errorMessage:p.getText("M_VISUAL_FILTERS_PROVIDE_FILTER_VAL_SINGLEVF",a)})}}else{const e=[];const r=[];if(g.SelectOptions){g.SelectOptions.forEach(function(t){e.push(t.PropertyName.$PropertyPath)})}if(g.Parameters){g.Parameters.forEach(function(t){e.push(t.PropertyName.$PropertyPath)})}d.forEach(function(t){if(e.indexOf(t)===-1){r.push(t)}});const n=t.getErrorInfoForNoInitialOverlay(r,p,m,h);u.setProperty(l,n)}}if(!this._oChartBinding||this._oChartBinding!==c){if(this._oChartBinding){this.detachDataReceivedHandler(this._oChartBinding)}this.attachDataRecivedHandler(c);this._oChartBinding=c}const T=u.getProperty(l)&&u.getProperty(l).showError;const O=m!==""?m.split("/")[1].split("(")[0]:"";if(P&&P.length&&E===O){const e=i.getBindingPathForParameters(_,C,y,P);if(e){c.sPath=e}}if(c&&c.isSuspended()&&!T){c.resume()}};s.attachDataRecivedHandler=function e(t){if(t){t.attachEvent("dataReceived",this.onInternalDataReceived,this);this._oChartBinding=t}};s.detachDataReceivedHandler=function e(t){if(t){t.detachEvent("dataReceived",this.onInternalDataReceived,this);this._oChartBinding=undefined}};s.setShowValueHelp=function e(t){if(this.getItems().length>0){const e=this.getItems()[0].getItems()[0];e.getContent().some(function(e){if(e.isA("sap.m.Button")){e.setVisible(t)}});this.setProperty("showValueHelp",t)}};s.setValueHelpIconSrc=function e(t){if(this.getItems().length>0){const e=this.getItems()[0].getItems()[0];e.getContent().some(function(e){if(e.isA("sap.m.Button")){e.setIcon(t)}});this.setProperty("valueHelpIconSrc",t)}};s.onInternalDataReceived=function r(n){const i=this.getId();const a=e.getTargetView(this);const s=this.getItems()[1].getItems()[0];const l=this.data("infoPath");const c=s.getBindingContext("internal");const u=o.getLibraryResourceBundle("sap.fe.macros");const p=s.data("uom");t.updateChartScaleFactorTitle(s,a,i,l);if(n.getParameter("error")){const e=u.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");const r=u.getText("M_VISUAL_FILTERS_ERROR_DATA_TEXT");t.applyErrorMessageAndTitle(e,r,l,a)}else if(n.getParameter("data")){const e=n.getSource().getCurrentContexts();if(e&&e.length===0){t.setNoDataMessage(l,u,a)}else{c.setProperty(l,{})}t.setMultiUOMMessage(e,s,l,u,a)}if(p&&(p["ISOCurrency"]&&p["ISOCurrency"].$Path||p["Unit"]&&p["Unit"].$Path)){const e=n.getSource().getContexts();const r=e&&e[0].getObject();t.applyUOMToTitle(s,r,a,l)}};return a}(a),h=O(d.prototype,"__implements__sap_ui_core_IFormContent",[c],{configurable:true,enumerable:true,writable:true,initializer:function(){return true}}),m=O(d.prototype,"showValueHelp",[u],{configurable:true,enumerable:true,writable:true,initializer:null}),_=O(d.prototype,"valueHelpIconSrc",[p],{configurable:true,enumerable:true,writable:true,initializer:null}),I=O(d.prototype,"valueHelpRequest",[f],{configurable:true,enumerable:true,writable:true,initializer:null}),d))||g);return L},false);
|
|
336
336
|
/*!
|
|
337
337
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
338
338
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -342,7 +342,12 @@ sap.ui.predefine("sap/fe/core/controls/filterbar/VisualFilterContainer", ["sap/f
|
|
|
342
342
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
343
343
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
344
344
|
*/
|
|
345
|
-
sap.ui.predefine("sap/fe/core/controls/filterbar/
|
|
345
|
+
sap.ui.predefine("sap/fe/core/controls/filterbar/adapter/SelectionVariantToStateFilters", ["sap/fe/core/CommonUtils","sap/fe/core/helpers/BindingToolkit","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/FilterHelper"],function(t,e,n,o){"use strict";var r=o.getConditions;var i=n.ODATA_TYPE_MAPPING;var a=e.EDM_TYPE_MAPPING;const s=["$search","$editState"];const l={getFilterBarInfoForConversion:t=>({metaModel:l._getMetaModel(t),contextPath:l._getContextPath(t),useSemanticDateRange:l._checkSemanticDateRangeIsUsed(t),filterFieldsConfig:l._getFilterFieldsConfig(t)}),getFilterBarSupportedFields:async t=>{await t.waitForInitialization();return t.getControlDelegate().fetchProperties(t)},getConditionsFromSV:function(t,e,n){const{contextPath:o}=e;const r={};n.forEach(function(n){if(!s.includes(n.name)){let i=[];const{conditionPath:a,annotationPath:s}=n;const c=a.replaceAll("*","");const p=c.substring(0,c.lastIndexOf("/"));const u=c.substring(c.lastIndexOf("/")+1);const g={propertyName:u,navPath:p,propertyContextPath:`${o}${p}`,propertyMetadata:n,selectionVariant:t,filterBarInfo:e};if(n.isParameter&&s){g.propertyContextPath=s.substring(0,s.lastIndexOf("/")+1);i=l._getConditionsForParameter(g)}else if(a.includes("/")){i=l._getConditionsForNavProperty(g)}else{i=l._getConditionsForProperty(g)}if(i.length>0){r[a]=i}}});return r},_getMetaModel:function(t){var e;return(e=t.getModel())===null||e===void 0?void 0:e.getMetaModel()},_getContextPath:function(t){return t.data("entityType")},_getViewData:function(t){const e=t.getModel("viewData");return e.getData()},_checkSemanticDateRangeIsUsed:function(t){return t.data("useSemanticDateRange")==="true"||t.data("useSemanticDateRange")===true},_getPropertyFilterConfigurationSetting:function(t){var e;let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return n[t]?(e=n[t])===null||e===void 0?void 0:e.settings:undefined},_getFilterFieldsConfig:t=>{const e=l._getViewData(t);const n=e.controlConfiguration;const o=n&&n["@com.sap.vocabularies.UI.v1.SelectionFields"].filterFields;return o||{}},_getConditionsForParameter:function(t){let e=[];const{propertyMetadata:n,selectionVariant:o}=t;const r=n.name;const i=l._getSelectOptionName(o,r,true);if(i){e=l._getPropertyConditions(t,i,true)}return e},_getConditionsForProperty:function(t){const{propertyMetadata:e,selectionVariant:n}=t;const o=e.name;const r=l._getSelectOptionName(n,o);let i=[];if(r){i=l._getPropertyConditions(t,r,false)}return i},_getConditionsForNavProperty:function(t){const{filterBarInfo:e,selectionVariant:n,propertyName:o,navPath:r}=t;const{contextPath:i}=e;let a=[];let s=`${i.substring(1)}${r}`.replaceAll("/",".");let c=l._getSelectOptionName(n,o,false,s);if(!c){s=r.replaceAll("/",".");c=l._getSelectOptionName(n,o,false,s)}if(c){a=l._getPropertyConditions(t,c,false)}return a},_getSelectOptionName:function(t,e,n,o){const r=[];const i=t.getSelectOptionsPropertyNames();if(n){r.push(`$Parameter.${e}`);r.push(e);if(e.startsWith("P_")){r.push(`$Parameter.${e.slice(2,e.length)}`);r.push(e.slice(2,e.length))}else{r.push(`$Parameter.P_${e}`);r.push(`P_${e}`)}}else{r.push(e);r.push(`$Parameter.${e}`);if(e.startsWith("P_")){const t=e.slice(2,e.length);r.push(`$Parameter.${t}`);r.push(t)}else{const t=`P_${e}`;r.push(`$Parameter.${t}`);r.push(t)}}let a="";r.some(t=>{const e=o?`${o}.${t}`:t;return i.includes(e)?a=e:false});return a},_getPropertyConditions:function(e,n,o){const{filterBarInfo:r,propertyMetadata:i,selectionVariant:a,propertyContextPath:s,propertyName:c}=e;const p=a.getSelectOption(n);const{metaModel:u}=r;let g=[];if(p!==null&&p!==void 0&&p.length){const n=l._getSemanticDateOperators(e,o);const r=s.substring(0,s.length-1);const a=o?["EQ"]:t.getOperatorsForProperty(c,r,u);g=this._getConditionsFromSelectOptions(p,i,a,n,o)}return g},_getSemanticDateOperators:function(e,n){const{filterBarInfo:o,propertyMetadata:r,propertyName:a,propertyContextPath:s}=e;const c=r.name;let p=[];let u;const{useSemanticDateRange:g,filterFieldsConfig:d,metaModel:f}=o;if(g){if(n){p=["EQ"]}else{const e=s.substring(0,s.length-1);u=l._getPropertyFilterConfigurationSetting(c,d);p=t.getOperatorsForProperty(a,e,f,i[r.dataType],g,u)}}return p},_getConditionsFromSelectOptions:function(t,e,n,o,r){let i=[];if(t.length){i=r?l._addConditionFromSelectOption(e,n,o,i,t[0]):t.reduce(l._addConditionFromSelectOption.bind(null,e,n,o),i)}return i},_addConditionFromSelectOption:function(t,e,n,o,i){const a={type:""};a.type=l._getEdmType(t.typeConfig.className);const s=r(i,a);if(i.SemanticDates&&n.length&&n.includes(i.SemanticDates.operator)){const t=l._addSemanticDatesToConditions(i.SemanticDates);if(Object.keys(t).length>0){o.push(t)}}else if(s){if(e.length===0||e.includes(s.operator)){o.push(s)}}return o},_addSemanticDatesToConditions:t=>{const e=[];if(t.high){e.push(t.high)}if(t.low){e.push(t.low)}return{values:e,operator:t.operator,isEmpty:undefined}},_getEdmType:t=>{const e=Object.fromEntries(Object.entries(a).map(t=>{let[e,n]=t;return[n.type,e]}));return e[t]}};return l},false);
|
|
346
|
+
/*!
|
|
347
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
348
|
+
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
349
|
+
*/
|
|
350
|
+
sap.ui.predefine("sap/fe/core/controls/filterbar/utils/VisualFilterUtils", ["sap/base/Log","sap/fe/core/templating/FilterHelper","sap/ui/core/format/NumberFormat","sap/ui/mdc/condition/Condition","sap/ui/model/odata/type/DateTimeOffset"],function(e,t,r,n,a){"use strict";var o=t.getTypeCompliantValue;var s=t.getRangeProperty;const i={applyMedianScaleToChartData:function(e,t,r,n){const a=[];const o=e.data("measure");const s=t.getBindingContext("internal");const i=e.getPoints&&e.getPoints()||e.getBars&&e.getBars()||e.getSegments&&e.getSegments();for(let e=0;e<i.length;e++){a.push(i[e].getBindingContext().getObject())}const l=this._getMedianScaleFactor(a,o);if(l&&l.iShortRefNumber&&l.scale){s.setProperty(`scalefactor/${n}`,l.scale);s.setProperty(`scalefactorNumber/${n}`,l.iShortRefNumber)}else{s.setProperty(`scalefactor/${n}`,"");s.setProperty(`scalefactorNumber/${n}`,"");const e=t.byId(`${r}::ScaleUoMTitle`);const a=t.byId(`${r}::MeasureDimensionTitle`);const o=e.getText();if(o===" | "){e.setText("");a.setTooltip(a.getText())}}},_getMedianScaleFactor:function(e,t){let n;let a;e.sort(function(e,r){if(Number(e[t])<Number(r[t])){return-1}if(Number(e[t])>Number(r[t])){return 1}return 0});if(e.length>0){const r=e.length/2,o=r%1===0?(parseFloat(e[r-1][t])+parseFloat(e[r][t]))/2:parseFloat(e[Math.floor(r)][t]),s=o;for(n=0;n<14;n++){a=Math.pow(10,n);if(Math.round(Math.abs(s)/a)<10){break}}}const o=r.getIntegerInstance({style:"short",showScale:false,shortRefNumber:a});for(n=0;n<e.length;n++){const r=e[n],s=o.format(r[t]),i=s.split(".");if(!i[1]&&parseInt(i[0],10)===0||i[1]&&parseInt(i[0],10)===0&&i[1].indexOf("0")===0||s/1e3>=1e3){a=undefined;break}}return{iShortRefNumber:a,scale:a?o.getScale():""}},getFormattedNumber:function(e,t,n,a){let o;e=typeof e==="string"?Number(e.replace(/,/g,"")):e;if(a){const t=r.getCurrencyInstance({showMeasure:false});return t.format(parseFloat(e),a)}else if(t){o=r.getFloatInstance({style:"short",showScale:false,shortRefNumber:t,shortDecimals:n});return o.format(parseFloat(e))}else{o=r.getFloatInstance({decimals:n});return o.format(parseFloat(e))}},applyUOMToTitle:function(e,t,r,n){const a=e.data("uom");let o;let s;if(a&&a["ISOCurrency"]){o=a["ISOCurrency"];s=o.$Path?t[o.$Path]:o}else if(a&&a["Unit"]){o=a["Unit"]}if(o){const e=o.$Path?t[o.$Path]:o;const a=r.getBindingContext("internal");a.setProperty(`uom/${n}`,e);if(s){a.setProperty(`currency/${n}`,e)}}},updateChartScaleFactorTitle:function(e,t,n,a){if(!e.data("scalefactor")){this.applyMedianScaleToChartData(e,t,n,a)}else{const n=r.getIntegerInstance({style:"short",showScale:false,shortRefNumber:e.data("scalefactor")});const o=t.getBindingContext("internal");const s=n.getScale()?n.getScale():"";o.setProperty(`scalefactor/${a}`,s)}},applyErrorMessageAndTitle:function(e,t,r,n){const a=n.getBindingContext("internal");a.setProperty(r,{});a.setProperty(r,{errorMessageTitle:e,errorMessage:t,showError:true})},checkMulitUnit:function(e,t){const r=[];if(e&&t){for(let n=0;n<e.length;n++){const a=e[n]&&e[n].getObject();r.push(a[t])}}return!!r.reduce(function(e,t){return e===t?e:NaN})},setMultiUOMMessage:function(t,r,n,a,o){const s=r.data("uom");const i=s&&s["ISOCurrency"]&&s["ISOCurrency"].$Path;const l=s&&s["Unit"]&&s["Unit"].$Path;const c=i||l;let u,f;if(c){if(!this.checkMulitUnit(t,c)){if(i){u=a.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");f=a.getText("M_VISUAL_FILTERS_MULTIPLE_CURRENCY",c);this.applyErrorMessageAndTitle(u,f,n,o);e.warning(`Filter is set for multiple Currency for${c}`)}else if(l){u=a.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");f=a.getText("M_VISUAL_FILTERS_MULTIPLE_UNIT",c);this.applyErrorMessageAndTitle(u,f,n,o);e.warning(`Filter is set for multiple UOMs for${c}`)}}}},setNoDataMessage:function(e,t,r){const n=t.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE");const a=t.getText("M_VISUAL_FILTER_NO_DATA_TEXT");this.applyErrorMessageAndTitle(n,a,e,r)},convertFilterCondions:function(e){const t={};Object.keys(e).forEach(function(r){const a=[];const o=e[r];for(let e=0;e<o.length;e++){const t=o[e].value2?[o[e].value1,o[e].value2]:[o[e].value1];a.push(n.createCondition(o[e].operator,t,null,null,"Validated"))}if(a.length){t[r]=a}});return t},getCustomConditions:function(e,t,r){let n,a;if(t.$Type==="Edm.DateTimeOffset"){n=this._parseDateTime(o(this._formatDateTime(e.Low),t.$Type));a=e.High?this._parseDateTime(o(this._formatDateTime(e.High),t.$Type)):null}else{n=e.Low;a=e.High?e.High:null}return{operator:e.Option?s(e.Option.$EnumMember||e.Option):null,value1:n,value2:a,path:r}},_parseDateTime:function(e){return this._getDateTimeTypeInstance().parseValue(e,"string")},_formatDateTime:function(e){return this._getDateTimeTypeInstance().formatValue(e,"string")},_getDateTimeTypeInstance:function(){return new a({pattern:"yyyy-MM-ddTHH:mm:ssZ",calendarType:"Gregorian"},{V4:true})},getErrorInfoForNoInitialOverlay:function(e,t,r,n){let a;if(e.length>1){a={showError:true,errorMessageTitle:t.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE"),errorMessage:t.getText("M_VISUAL_FILTERS_PROVIDE_FILTER_VAL_MULTIPLEVF")}}else if(e.length===1){const o=n.getObject(`${r}/${e[0]}@com.sap.vocabularies.Common.v1.Label`)||e[0];a={showError:true,errorMessageTitle:t.getText("M_VISUAL_FILTERS_ERROR_MESSAGE_TITLE"),errorMessage:t.getText("M_VISUAL_FILTERS_PROVIDE_FILTER_VAL_SINGLEVF",[o])}}return a}};return i},false);
|
|
346
351
|
/*!
|
|
347
352
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
348
353
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -367,22 +372,22 @@ sap.ui.predefine("sap/fe/core/converters/ManifestWrapper", ["sap/fe/core/convert
|
|
|
367
372
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
368
373
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
369
374
|
*/
|
|
370
|
-
sap.ui.predefine("sap/fe/core/converters/MetaModelConverter", ["sap/fe/core/converters/common/AnnotationConverter","sap/fe/core/helpers/TypeGuards","../helpers/StableIdHelper"],function(e,t,n){"use strict";var i={};var o=n.prepareId;var a=t.isSingleton;var r=t.isServiceObject;var l=t.isNavigationProperty;var s=t.isEntityType;var p=t.isEntitySet;var y=t.isEntityContainer;const c={"Org.OData.Capabilities.V1":"Capabilities","Org.OData.Core.V1":"Core","Org.OData.Measures.V1":"Measures","com.sap.vocabularies.Common.v1":"Common","com.sap.vocabularies.UI.v1":"UI","com.sap.vocabularies.Session.v1":"Session","com.sap.vocabularies.Analytics.v1":"Analytics","com.sap.vocabularies.PersonalData.v1":"PersonalData","com.sap.vocabularies.Communication.v1":"Communication"};const f={Chart:true,MicroChart:true,UShell:true,IntentBasedNavigation:true,AppState:true};i.DefaultEnvironmentCapabilities=f;function u(e,t,n,i,o){let a;const r=`${n}/${t}`;const l=typeof e;if(e===null){a={type:"Null",Null:null}}else if(l==="string"){a={type:"String",String:e}}else if(l==="boolean"){a={type:"Bool",Bool:e}}else if(l==="number"){a={type:"Int",Int:e}}else if(Array.isArray(e)){a={type:"Collection",Collection:e.map((e,t)=>d(e,`${r}/${t}`,i,o))};if(e.length>0){if(e[0].hasOwnProperty("$PropertyPath")){a.Collection.type="PropertyPath"}else if(e[0].hasOwnProperty("$Path")){a.Collection.type="Path"}else if(e[0].hasOwnProperty("$NavigationPropertyPath")){a.Collection.type="NavigationPropertyPath"}else if(e[0].hasOwnProperty("$AnnotationPath")){a.Collection.type="AnnotationPath"}else if(e[0].hasOwnProperty("$Type")){a.Collection.type="Record"}else if(e[0].hasOwnProperty("$If")){a.Collection.type="If"}else if(e[0].hasOwnProperty("$Or")){a.Collection.type="Or"}else if(e[0].hasOwnProperty("$And")){a.Collection.type="And"}else if(e[0].hasOwnProperty("$Eq")){a.Collection.type="Eq"}else if(e[0].hasOwnProperty("$Ne")){a.Collection.type="Ne"}else if(e[0].hasOwnProperty("$Not")){a.Collection.type="Not"}else if(e[0].hasOwnProperty("$Gt")){a.Collection.type="Gt"}else if(e[0].hasOwnProperty("$Ge")){a.Collection.type="Ge"}else if(e[0].hasOwnProperty("$Lt")){a.Collection.type="Lt"}else if(e[0].hasOwnProperty("$Le")){a.Collection.type="Le"}else if(e[0].hasOwnProperty("$Apply")){a.Collection.type="Apply"}else if(typeof e[0]==="object"){a.Collection.type="Record"}else{a.Collection.type="String"}}}else if(e.$Path!==undefined){a={type:"Path",Path:e.$Path}}else if(e.$Decimal!==undefined){a={type:"Decimal",Decimal:parseFloat(e.$Decimal)}}else if(e.$PropertyPath!==undefined){a={type:"PropertyPath",PropertyPath:e.$PropertyPath}}else if(e.$NavigationPropertyPath!==undefined){a={type:"NavigationPropertyPath",NavigationPropertyPath:e.$NavigationPropertyPath}}else if(e.$If!==undefined){a={type:"If",If:e.$If}}else if(e.$And!==undefined){a={type:"And",And:e.$And}}else if(e.$Or!==undefined){a={type:"Or",Or:e.$Or}}else if(e.$Not!==undefined){a={type:"Not",Not:e.$Not}}else if(e.$Eq!==undefined){a={type:"Eq",Eq:e.$Eq}}else if(e.$Ne!==undefined){a={type:"Ne",Ne:e.$Ne}}else if(e.$Gt!==undefined){a={type:"Gt",Gt:e.$Gt}}else if(e.$Ge!==undefined){a={type:"Ge",Ge:e.$Ge}}else if(e.$Lt!==undefined){a={type:"Lt",Lt:e.$Lt}}else if(e.$Le!==undefined){a={type:"Le",Le:e.$Le}}else if(e.$Apply!==undefined){a={type:"Apply",Apply:e.$Apply,Function:e.$Function}}else if(e.$AnnotationPath!==undefined){a={type:"AnnotationPath",AnnotationPath:e.$AnnotationPath}}else if(e.$EnumMember!==undefined){a={type:"EnumMember",EnumMember:`${$(e.$EnumMember.split("/")[0])}/${e.$EnumMember.split("/")[1]}`}}else{a={type:"Record",Record:d(e,n,i,o)}}return{name:t,value:a}}function $(e){let[t,n]=e.split("@");if(!n){n=t;t=""}else{t+="@"}const i=n.lastIndexOf(".");return`${t+c[n.substr(0,i)]}.${n.substr(i+1)}`}function d(e,t,n,i){let o={};const a=typeof e;if(e===null){o={type:"Null",Null:null}}else if(a==="string"){o={type:"String",String:e}}else if(a==="boolean"){o={type:"Bool",Bool:e}}else if(a==="number"){o={type:"Int",Int:e}}else if(e.$AnnotationPath!==undefined){o={type:"AnnotationPath",AnnotationPath:e.$AnnotationPath}}else if(e.$Path!==undefined){o={type:"Path",Path:e.$Path}}else if(e.$Decimal!==undefined){o={type:"Decimal",Decimal:parseFloat(e.$Decimal)}}else if(e.$PropertyPath!==undefined){o={type:"PropertyPath",PropertyPath:e.$PropertyPath}}else if(e.$If!==undefined){o={type:"If",If:e.$If}}else if(e.$And!==undefined){o={type:"And",And:e.$And}}else if(e.$Or!==undefined){o={type:"Or",Or:e.$Or}}else if(e.$Not!==undefined){o={type:"Not",Not:e.$Not}}else if(e.$Eq!==undefined){o={type:"Eq",Eq:e.$Eq}}else if(e.$Ne!==undefined){o={type:"Ne",Ne:e.$Ne}}else if(e.$Gt!==undefined){o={type:"Gt",Gt:e.$Gt}}else if(e.$Ge!==undefined){o={type:"Ge",Ge:e.$Ge}}else if(e.$Lt!==undefined){o={type:"Lt",Lt:e.$Lt}}else if(e.$Le!==undefined){o={type:"Le",Le:e.$Le}}else if(e.$Apply!==undefined){o={type:"Apply",Apply:e.$Apply,Function:e.$Function}}else if(e.$NavigationPropertyPath!==undefined){o={type:"NavigationPropertyPath",NavigationPropertyPath:e.$NavigationPropertyPath}}else if(e.$EnumMember!==undefined){o={type:"EnumMember",EnumMember:`${$(e.$EnumMember.split("/")[0])}/${e.$EnumMember.split("/")[1]}`}}else if(Array.isArray(e)){const a=o;a.collection=e.map((e,o)=>d(e,`${t}/${o}`,n,i));if(e.length>0){if(e[0].hasOwnProperty("$PropertyPath")){a.collection.type="PropertyPath"}else if(e[0].hasOwnProperty("$Path")){a.collection.type="Path"}else if(e[0].hasOwnProperty("$NavigationPropertyPath")){a.collection.type="NavigationPropertyPath"}else if(e[0].hasOwnProperty("$AnnotationPath")){a.collection.type="AnnotationPath"}else if(e[0].hasOwnProperty("$Type")){a.collection.type="Record"}else if(e[0].hasOwnProperty("$If")){a.collection.type="If"}else if(e[0].hasOwnProperty("$And")){a.collection.type="And"}else if(e[0].hasOwnProperty("$Or")){a.collection.type="Or"}else if(e[0].hasOwnProperty("$Eq")){a.collection.type="Eq"}else if(e[0].hasOwnProperty("$Ne")){a.collection.type="Ne"}else if(e[0].hasOwnProperty("$Not")){a.collection.type="Not"}else if(e[0].hasOwnProperty("$Gt")){a.collection.type="Gt"}else if(e[0].hasOwnProperty("$Ge")){a.collection.type="Ge"}else if(e[0].hasOwnProperty("$Lt")){a.collection.type="Lt"}else if(e[0].hasOwnProperty("$Le")){a.collection.type="Le"}else if(e[0].hasOwnProperty("$Apply")){a.collection.type="Apply"}else if(typeof e[0]==="object"){a.collection.type="Record"}else{a.collection.type="String"}}}else{if(e.$Type){const t=e.$Type;o.type=t}const a=[];Object.keys(e).forEach(o=>{if(o!=="$Type"&&o!=="$If"&&o!=="$Apply"&&o!=="$And"&&o!=="$Or"&&o!=="$Ne"&&o!=="$Gt"&&o!=="$Ge"&&o!=="$Lt"&&o!=="$Le"&&o!=="$Not"&&o!=="$Eq"&&!o.startsWith("@")){a.push(u(e[o],o,t,n,i))}else if(o.startsWith("@")){N({[o]:e[o]},t,n,i)}});o.propertyValues=a}return o}function h(e,t){if(!t.hasOwnProperty(e)){t[e]={target:e,annotations:[]}}return t[e]}function P(e){const t=e.ID??e.Target.$AnnotationPath;return t?o(t):t}function m(e){return e.filter(e=>{if(e.Target&&e.Target.$AnnotationPath){return e.Target.$AnnotationPath.indexOf(`@${"com.sap.vocabularies.UI.v1.Chart"}`)===-1}else{return true}})}function v(e){return e.filter(e=>e.$Type!=="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation")}function g(e){return e.filter(e=>e.$AnnotationPath!==`@${"com.sap.vocabularies.UI.v1.Chart"}`)}function N(e,t,n,i){if(Object.keys(e).length===0){return}const o=h(t,n);if(!i.MicroChart){delete e[`@${"com.sap.vocabularies.UI.v1.Chart"}`]}for(let a in e){let r=e[a];switch(a){case`@${"com.sap.vocabularies.UI.v1.HeaderFacets"}`:if(!i.MicroChart){r=m(r);e[a]=r}break;case`@${"com.sap.vocabularies.UI.v1.Identification"}`:if(!i.IntentBasedNavigation){r=v(r);e[a]=r}break;case`@${"com.sap.vocabularies.UI.v1.LineItem"}`:if(!i.IntentBasedNavigation){r=v(r);e[a]=r}if(!i.MicroChart){r=m(r);e[a]=r}break;case`@${"com.sap.vocabularies.UI.v1.FieldGroup"}`:if(!i.IntentBasedNavigation){r.Data=v(r.Data);e[a]=r}if(!i.MicroChart){r.Data=m(r.Data);e[a]=r}break;case`@${"com.sap.vocabularies.UI.v1.PresentationVariant"}`:if(!i.Chart&&r.Visualizations){r.Visualizations=g(r.Visualizations);e[a]=r}break;default:break}let l=o;const s=a.split("@");if(s.length>2){l=h(`${t}@${s[1]}`,n);a=s[2]}else{a=s[1]}const p=a.split("#");const y=p[1];a=p[0];const c={term:a,qualifier:y};let f=`${t}@${c.term}`;if(y){f+=`#${y}`}let P=false;const O=typeof r;if(r===null){c.value={type:"Null"}}else if(O==="string"){c.value={type:"String",String:r}}else if(O==="boolean"){c.value={type:"Bool",Bool:r}}else if(O==="number"){c.value={type:"Int",Int:r}}else if(r.$If!==undefined){c.value={type:"If",If:r.$If}}else if(r.$And!==undefined){c.value={type:"And",And:r.$And}}else if(r.$Or!==undefined){c.value={type:"Or",Or:r.$Or}}else if(r.$Not!==undefined){c.value={type:"Not",Not:r.$Not}}else if(r.$Eq!==undefined){c.value={type:"Eq",Eq:r.$Eq}}else if(r.$Ne!==undefined){c.value={type:"Ne",Ne:r.$Ne}}else if(r.$Gt!==undefined){c.value={type:"Gt",Gt:r.$Gt}}else if(r.$Ge!==undefined){c.value={type:"Ge",Ge:r.$Ge}}else if(r.$Lt!==undefined){c.value={type:"Lt",Lt:r.$Lt}}else if(r.$Le!==undefined){c.value={type:"Le",Le:r.$Le}}else if(r.$Apply!==undefined){c.value={type:"Apply",Apply:r.$Apply,Function:r.$Function}}else if(r.$Path!==undefined){c.value={type:"Path",Path:r.$Path}}else if(r.$AnnotationPath!==undefined){c.value={type:"AnnotationPath",AnnotationPath:r.$AnnotationPath}}else if(r.$Decimal!==undefined){c.value={type:"Decimal",Decimal:parseFloat(r.$Decimal)}}else if(r.$EnumMember!==undefined){c.value={type:"EnumMember",EnumMember:`${$(r.$EnumMember.split("/")[0])}/${r.$EnumMember.split("/")[1]}`}}else if(Array.isArray(r)){P=true;c.collection=r.map((e,t)=>d(e,`${f}/${t}`,n,i));if(r.length>0){if(r[0].hasOwnProperty("$PropertyPath")){c.collection.type="PropertyPath"}else if(r[0].hasOwnProperty("$Path")){c.collection.type="Path"}else if(r[0].hasOwnProperty("$NavigationPropertyPath")){c.collection.type="NavigationPropertyPath"}else if(r[0].hasOwnProperty("$AnnotationPath")){c.collection.type="AnnotationPath"}else if(r[0].hasOwnProperty("$Type")){c.collection.type="Record"}else if(r[0].hasOwnProperty("$If")){c.collection.type="If"}else if(r[0].hasOwnProperty("$Or")){c.collection.type="Or"}else if(r[0].hasOwnProperty("$Eq")){c.collection.type="Eq"}else if(r[0].hasOwnProperty("$Ne")){c.collection.type="Ne"}else if(r[0].hasOwnProperty("$Not")){c.collection.type="Not"}else if(r[0].hasOwnProperty("$Gt")){c.collection.type="Gt"}else if(r[0].hasOwnProperty("$Ge")){c.collection.type="Ge"}else if(r[0].hasOwnProperty("$Lt")){c.collection.type="Lt"}else if(r[0].hasOwnProperty("$Le")){c.collection.type="Le"}else if(r[0].hasOwnProperty("$And")){c.collection.type="And"}else if(r[0].hasOwnProperty("$Apply")){c.collection.type="Apply"}else if(typeof r[0]==="object"){c.collection.type="Record"}else{c.collection.type="String"}}}else{const e={propertyValues:[]};if(r.$Type){const t=r.$Type;e.type=`${t}`}const t=[];for(const e in r){if(e!=="$Type"&&!e.startsWith("@")){t.push(u(r[e],e,f,n,i))}else if(e.startsWith("@")){N({[e]:r[e]},f,n,i)}}e.propertyValues=t;c.record=e}c.isCollection=P;l.annotations.push(c)}}function O(e,t,n){return{_type:"Property",name:n,fullyQualifiedName:`${t.fullyQualifiedName}/${n}`,type:e.$Type,maxLength:e.$MaxLength,precision:e.$Precision,scale:e.$Scale,nullable:e.$Nullable}}function b(e,t,n){let i=[];if(e.$ReferentialConstraint){i=Object.keys(e.$ReferentialConstraint).map(n=>({sourceTypeName:t.name,sourceProperty:n,targetTypeName:e.$Type,targetProperty:e.$ReferentialConstraint[n]}))}const o={_type:"NavigationProperty",name:n,fullyQualifiedName:`${t.fullyQualifiedName}/${n}`,partner:e.$Partner,isCollection:e.$isCollection?e.$isCollection:false,containsTarget:e.$ContainsTarget,targetTypeName:e.$Type,referentialConstraint:i};return o}function A(e,t,n){const i={_type:"EntitySet",name:t,navigationPropertyBinding:{},entityTypeName:e.$Type,fullyQualifiedName:`${n}/${t}`};return i}function T(e,t,n){return{_type:"Singleton",name:t,navigationPropertyBinding:{},entityTypeName:e.$Type,fullyQualifiedName:`${n}/${t}`,nullable:true}}function C(e,t,n){return{_type:"ActionImport",name:t,fullyQualifiedName:`${n}/${t}`,actionName:e.$Action}}function w(e,t,n){const i={_type:"TypeDefinition",name:t.substring(n.length),fullyQualifiedName:t,underlyingType:e.$UnderlyingType};return i}function I(e,t,n){const i={_type:"ComplexType",name:t.substring(n.length),fullyQualifiedName:t,properties:[],navigationProperties:[]};const o=Object.keys(e).filter(t=>{if(t!="$Key"&&t!="$kind"){return e[t].$kind==="Property"}}).sort((e,t)=>e>t?1:-1).map(t=>O(e[t],i,t));i.properties=o;const a=Object.keys(e).filter(t=>{if(t!="$Key"&&t!="$kind"){return e[t].$kind==="NavigationProperty"}}).sort((e,t)=>e>t?1:-1).map(t=>b(e[t],i,t));i.navigationProperties=a;return i}function E(e,t){if(!e.$Key&&e.$BaseType){return E(t[e.$BaseType],t)}return e.$Key??[]}function L(e,t,n,i){var o,a;const r={_type:"EntityType",name:t.substring(n.length),fullyQualifiedName:t,keys:[],entityProperties:[],navigationProperties:[],actions:{}};for(const t in e){const n=e[t];switch(n.$kind){case"Property":const e=O(n,r,t);r.entityProperties.push(e);break;case"NavigationProperty":const i=b(n,r,t);r.navigationProperties.push(i);break}}r.keys=E(e,i).map(e=>r.entityProperties.find(t=>t.name===e)).filter(e=>e!==undefined);(o=i.$Annotations[r.fullyQualifiedName])===null||o===void 0?void 0:(a=o[`@${"com.sap.vocabularies.UI.v1.FilterFacets"}`])===null||a===void 0?void 0:a.forEach(e=>{e.ID=P(e)});for(const e of r.entityProperties){if(!i.$Annotations[e.fullyQualifiedName]){i.$Annotations[e.fullyQualifiedName]={}}if(!i.$Annotations[e.fullyQualifiedName][`@${"com.sap.vocabularies.UI.v1.DataFieldDefault"}`]){i.$Annotations[e.fullyQualifiedName][`@${"com.sap.vocabularies.UI.v1.DataFieldDefault"}`]={$Type:"com.sap.vocabularies.UI.v1.DataField",Value:{$Path:e.name}}}}return r}function G(e,t,n){var i;let o="";let a=e;if(t.$IsBound){const n=t.$Parameter[0];o=n.$Type;if(n.$isCollection===true){a=`${e}(Collection(${o}))`}else{a=`${e}(${o})`}}const r=t.$Parameter??[];return{_type:"Action",name:e.substring(n.length),fullyQualifiedName:a,isBound:t.$IsBound??false,isFunction:t.$kind==="Function",sourceType:o,returnType:((i=t.$ReturnType)===null||i===void 0?void 0:i.$Type)??"",parameters:r.map(e=>({_type:"ActionParameter",fullyQualifiedName:`${a}/${e.$Name}`,isCollection:e.$isCollection??false,name:e.$Name,type:e.$Type}))}}function D(e,t,n,i){i.entityContainer={_type:"EntityContainer",name:t.substring(e.length),fullyQualifiedName:t};for(const e in n){const o=n[e];switch(o.$kind){case"EntitySet":i.entitySets.push(A(o,e,t));break;case"Singleton":i.singletons.push(T(o,e,t));break;case"ActionImport":i.actionImports.push(C(o,e,t));break}}for(const e of i.entitySets){const t=n[e.name].$NavigationPropertyBinding;if(t){for(const n of Object.keys(t)){const o=i.entitySets.find(e=>e.name===t[n]);if(o){e.navigationPropertyBinding[n]=o}}}}}function M(e,t){const n={};for(const i in e){N(e[i],i,n,t)}return Object.values(n)}function k(e){const t=Object.keys(e).find(t=>e[t].$kind==="Schema")??"";const n={namespace:t.slice(0,-1),entityContainer:{_type:"EntityContainer",name:"",fullyQualifiedName:""},entitySets:[],entityTypes:[],complexTypes:[],typeDefinitions:[],singletons:[],associations:[],associationSets:[],actions:[],actionImports:[],annotations:{}};const i=(i,o)=>{switch(o.$kind){case"EntityContainer":D(t,i,o,n);break;case"Action":case"Function":n.actions.push(G(i,o,t));break;case"EntityType":n.entityTypes.push(L(o,i,t,e));break;case"ComplexType":n.complexTypes.push(I(o,i,t));break;case"TypeDefinition":n.typeDefinitions.push(w(o,i,t));break}};for(const t in e){const n=e[t];if(Array.isArray(n)){for(const e of n){i(t,e)}}else{i(t,n)}}return n}function S(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:f;const i={identification:"metamodelResult",version:"4.0",references:[]};e.lazy(i,"schema",()=>{const i=t.getObject("/$");const o=k(i);e.lazy(o.annotations,"metamodelResult",()=>M(i.$Annotations,n));return o});return i}i.parseMetaModel=S;const j={};function B(t,n){const i=t.id;if(!j.hasOwnProperty(i)){const o=S(t,n);try{j[i]=e.convert(o)}catch(e){throw new Error(e)}}return j[i]}i.convertTypes=B;function F(e){const t=e.getModel();if(!t.isA("sap.ui.model.odata.v4.ODataMetaModel")){throw new Error("This should only be called on a ODataMetaModel")}return B(t)}i.getConvertedTypes=F;function Q(e){delete j[e.id]}i.deleteModelCacheData=Q;function q(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const n=B(e.getModel());const i=e.getPath();const o=i.split("/");let a=o[1];let r=2;if(n.entityContainer.fullyQualifiedName===a){a=o[2];r++}let l=n.entitySets.find(e=>e.name===a);if(!l){l=n.singletons.find(e=>e.name===a)}let s=o.slice(r).join("/");const p=[l];while(s&&s.length>0&&s.startsWith("$NavigationPropertyBinding")){var y;let e=s.split("/");let t=0;let n,i;e=e.slice(1);while(!n&&e.length>t){if(e[t]!=="$NavigationPropertyBinding"){i=e.slice(0,t+1).join("/").replace("/$NavigationPropertyBinding","");n=l&&l.navigationPropertyBinding[i]}t++}if(!n){i=e[0]}const o=((y=i)===null||y===void 0?void 0:y.split("/"))||[];let a=l&&l.entityType;for(const e of o){const t=a&&a.navigationProperties.find(t=>t.name===e);if(t){p.push(t);a=t.targetType}else{break}}l=l&&n||l&&l.navigationPropertyBinding[e[0]];if(l){p.push(l)}e=e.slice(o.length||1);if(e.length&&e[0]==="$"){e.shift()}s=e.join("/")}if(s.startsWith("$Type")){if(s.startsWith("$Type@")){s=s.replace("$Type","")}else{s=o.slice(3).join("/")}}if(l&&s.length){const e=l.entityType.resolvePath(s,t);if(e){if(t){e.visitedObjects=p.concat(e.visitedObjects)}}else if(l.entityType&&l.entityType.actions){const e=l.entityType&&l.entityType.actions;const t=s.split("/");if(e[t[0]]){const n=e[t[0]];if(t[1]&&n.parameters){const e=t[1];return n.parameters.find(t=>t.fullyQualifiedName.endsWith(`/${e}`))}else if(s.length===1){return n}}}return e}else{if(t){return{target:l,visitedObjects:p}}return l}}i.convertMetaModelContext=q;function U(e,t){const n=B(e.getModel());const i=q(e,true);let o;if(t&&t.getPath()!=="/"){o=U(t)}return R(i,n,o)}i.getInvolvedDataModelObjects=U;function R(e,t,n){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const o=e.visitedObjects.filter(e=>r(e)&&!s(e)&&!y(e));if(r(e.target)&&!s(e.target)&&o[o.length-1]!==e.target&&!i){o.push(e.target)}const c=[];const f=o[0];let u=f;let $=f.entityType;let d;let h=[];for(let e=1;e<o.length;e++){d=o[e];if(l(d)){var P;h.push(d.name);c.push(d);$=d.targetType;const e=(P=u)===null||P===void 0?void 0:P.navigationPropertyBinding[h.join("/")];if(e!==undefined){u=e;h=[]}}if(p(d)||a(d)){u=d;$=u.entityType}}if(h.length>0){u=undefined}if(n&&n.startingEntitySet!==f){const e=o.indexOf(n.startingEntitySet);if(e!==-1){const t=o.slice(0,e);n.startingEntitySet=f;n.navigationProperties=t.filter(l).concat(n.navigationProperties)}}const m={startingEntitySet:f,targetEntitySet:u,targetEntityType:$,targetObject:e.target,navigationProperties:c,contextLocation:n,convertedTypes:t};if(!r(m.targetObject)&&i){m.targetObject=r(d)?d:undefined}if(!m.contextLocation){m.contextLocation=m}return m}i.getInvolvedDataModelObjectFromPath=R;return i},false);
|
|
375
|
+
sap.ui.predefine("sap/fe/core/converters/MetaModelConverter", ["sap/fe/core/converters/common/AnnotationConverter","sap/fe/core/helpers/TypeGuards","../helpers/StableIdHelper"],function(e,t,n){"use strict";var i={};var o=n.prepareId;var a=t.isSingleton;var r=t.isServiceObject;var l=t.isNavigationProperty;var s=t.isEntityType;var p=t.isEntitySet;var y=t.isEntityContainer;const c={"Org.OData.Capabilities.V1":"Capabilities","Org.OData.Core.V1":"Core","Org.OData.Measures.V1":"Measures","com.sap.vocabularies.Common.v1":"Common","com.sap.vocabularies.UI.v1":"UI","com.sap.vocabularies.Session.v1":"Session","com.sap.vocabularies.Analytics.v1":"Analytics","com.sap.vocabularies.PersonalData.v1":"PersonalData","com.sap.vocabularies.Communication.v1":"Communication"};const f={Chart:true,MicroChart:true,UShell:true,IntentBasedNavigation:true,AppState:true,InsightsSupported:false};i.DefaultEnvironmentCapabilities=f;function u(e,t,n,i,o){let a;const r=`${n}/${t}`;const l=typeof e;if(e===null){a={type:"Null",Null:null}}else if(l==="string"){a={type:"String",String:e}}else if(l==="boolean"){a={type:"Bool",Bool:e}}else if(l==="number"){a={type:"Int",Int:e}}else if(Array.isArray(e)){a={type:"Collection",Collection:e.map((e,t)=>d(e,`${r}/${t}`,i,o))};if(e.length>0){if(e[0].hasOwnProperty("$PropertyPath")){a.Collection.type="PropertyPath"}else if(e[0].hasOwnProperty("$Path")){a.Collection.type="Path"}else if(e[0].hasOwnProperty("$NavigationPropertyPath")){a.Collection.type="NavigationPropertyPath"}else if(e[0].hasOwnProperty("$AnnotationPath")){a.Collection.type="AnnotationPath"}else if(e[0].hasOwnProperty("$Type")){a.Collection.type="Record"}else if(e[0].hasOwnProperty("$If")){a.Collection.type="If"}else if(e[0].hasOwnProperty("$Or")){a.Collection.type="Or"}else if(e[0].hasOwnProperty("$And")){a.Collection.type="And"}else if(e[0].hasOwnProperty("$Eq")){a.Collection.type="Eq"}else if(e[0].hasOwnProperty("$Ne")){a.Collection.type="Ne"}else if(e[0].hasOwnProperty("$Not")){a.Collection.type="Not"}else if(e[0].hasOwnProperty("$Gt")){a.Collection.type="Gt"}else if(e[0].hasOwnProperty("$Ge")){a.Collection.type="Ge"}else if(e[0].hasOwnProperty("$Lt")){a.Collection.type="Lt"}else if(e[0].hasOwnProperty("$Le")){a.Collection.type="Le"}else if(e[0].hasOwnProperty("$Apply")){a.Collection.type="Apply"}else if(typeof e[0]==="object"){a.Collection.type="Record"}else{a.Collection.type="String"}}}else if(e.$Path!==undefined){a={type:"Path",Path:e.$Path}}else if(e.$Decimal!==undefined){a={type:"Decimal",Decimal:parseFloat(e.$Decimal)}}else if(e.$PropertyPath!==undefined){a={type:"PropertyPath",PropertyPath:e.$PropertyPath}}else if(e.$NavigationPropertyPath!==undefined){a={type:"NavigationPropertyPath",NavigationPropertyPath:e.$NavigationPropertyPath}}else if(e.$If!==undefined){a={type:"If",If:e.$If}}else if(e.$And!==undefined){a={type:"And",And:e.$And}}else if(e.$Or!==undefined){a={type:"Or",Or:e.$Or}}else if(e.$Not!==undefined){a={type:"Not",Not:e.$Not}}else if(e.$Eq!==undefined){a={type:"Eq",Eq:e.$Eq}}else if(e.$Ne!==undefined){a={type:"Ne",Ne:e.$Ne}}else if(e.$Gt!==undefined){a={type:"Gt",Gt:e.$Gt}}else if(e.$Ge!==undefined){a={type:"Ge",Ge:e.$Ge}}else if(e.$Lt!==undefined){a={type:"Lt",Lt:e.$Lt}}else if(e.$Le!==undefined){a={type:"Le",Le:e.$Le}}else if(e.$Apply!==undefined){a={type:"Apply",Apply:e.$Apply,Function:e.$Function}}else if(e.$AnnotationPath!==undefined){a={type:"AnnotationPath",AnnotationPath:e.$AnnotationPath}}else if(e.$EnumMember!==undefined){a={type:"EnumMember",EnumMember:`${$(e.$EnumMember.split("/")[0])}/${e.$EnumMember.split("/")[1]}`}}else{a={type:"Record",Record:d(e,n,i,o)}}return{name:t,value:a}}function $(e){let[t,n]=e.split("@");if(!n){n=t;t=""}else{t+="@"}const i=n.lastIndexOf(".");return`${t+c[n.substr(0,i)]}.${n.substr(i+1)}`}function d(e,t,n,i){let o={};const a=typeof e;if(e===null){o={type:"Null",Null:null}}else if(a==="string"){o={type:"String",String:e}}else if(a==="boolean"){o={type:"Bool",Bool:e}}else if(a==="number"){o={type:"Int",Int:e}}else if(e.$AnnotationPath!==undefined){o={type:"AnnotationPath",AnnotationPath:e.$AnnotationPath}}else if(e.$Path!==undefined){o={type:"Path",Path:e.$Path}}else if(e.$Decimal!==undefined){o={type:"Decimal",Decimal:parseFloat(e.$Decimal)}}else if(e.$PropertyPath!==undefined){o={type:"PropertyPath",PropertyPath:e.$PropertyPath}}else if(e.$If!==undefined){o={type:"If",If:e.$If}}else if(e.$And!==undefined){o={type:"And",And:e.$And}}else if(e.$Or!==undefined){o={type:"Or",Or:e.$Or}}else if(e.$Not!==undefined){o={type:"Not",Not:e.$Not}}else if(e.$Eq!==undefined){o={type:"Eq",Eq:e.$Eq}}else if(e.$Ne!==undefined){o={type:"Ne",Ne:e.$Ne}}else if(e.$Gt!==undefined){o={type:"Gt",Gt:e.$Gt}}else if(e.$Ge!==undefined){o={type:"Ge",Ge:e.$Ge}}else if(e.$Lt!==undefined){o={type:"Lt",Lt:e.$Lt}}else if(e.$Le!==undefined){o={type:"Le",Le:e.$Le}}else if(e.$Apply!==undefined){o={type:"Apply",Apply:e.$Apply,Function:e.$Function}}else if(e.$NavigationPropertyPath!==undefined){o={type:"NavigationPropertyPath",NavigationPropertyPath:e.$NavigationPropertyPath}}else if(e.$EnumMember!==undefined){o={type:"EnumMember",EnumMember:`${$(e.$EnumMember.split("/")[0])}/${e.$EnumMember.split("/")[1]}`}}else if(Array.isArray(e)){const a=o;a.collection=e.map((e,o)=>d(e,`${t}/${o}`,n,i));if(e.length>0){if(e[0].hasOwnProperty("$PropertyPath")){a.collection.type="PropertyPath"}else if(e[0].hasOwnProperty("$Path")){a.collection.type="Path"}else if(e[0].hasOwnProperty("$NavigationPropertyPath")){a.collection.type="NavigationPropertyPath"}else if(e[0].hasOwnProperty("$AnnotationPath")){a.collection.type="AnnotationPath"}else if(e[0].hasOwnProperty("$Type")){a.collection.type="Record"}else if(e[0].hasOwnProperty("$If")){a.collection.type="If"}else if(e[0].hasOwnProperty("$And")){a.collection.type="And"}else if(e[0].hasOwnProperty("$Or")){a.collection.type="Or"}else if(e[0].hasOwnProperty("$Eq")){a.collection.type="Eq"}else if(e[0].hasOwnProperty("$Ne")){a.collection.type="Ne"}else if(e[0].hasOwnProperty("$Not")){a.collection.type="Not"}else if(e[0].hasOwnProperty("$Gt")){a.collection.type="Gt"}else if(e[0].hasOwnProperty("$Ge")){a.collection.type="Ge"}else if(e[0].hasOwnProperty("$Lt")){a.collection.type="Lt"}else if(e[0].hasOwnProperty("$Le")){a.collection.type="Le"}else if(e[0].hasOwnProperty("$Apply")){a.collection.type="Apply"}else if(typeof e[0]==="object"){a.collection.type="Record"}else{a.collection.type="String"}}}else{if(e.$Type){const t=e.$Type;o.type=t}const a=[];Object.keys(e).forEach(o=>{if(o!=="$Type"&&o!=="$If"&&o!=="$Apply"&&o!=="$And"&&o!=="$Or"&&o!=="$Ne"&&o!=="$Gt"&&o!=="$Ge"&&o!=="$Lt"&&o!=="$Le"&&o!=="$Not"&&o!=="$Eq"&&!o.startsWith("@")){a.push(u(e[o],o,t,n,i))}else if(o.startsWith("@")){O({[o]:e[o]},t,n,i)}});o.propertyValues=a}return o}function h(e,t){if(!t.hasOwnProperty(e)){t[e]={target:e,annotations:[]}}return t[e]}function P(e){const t=e.ID??e.Target.$AnnotationPath;return t?o(t):t}function m(e){return e.filter(e=>{if(e.Target&&e.Target.$AnnotationPath){return e.Target.$AnnotationPath.indexOf(`@${"com.sap.vocabularies.UI.v1.Chart"}`)===-1}else{return true}})}function g(e){return e.filter(e=>e.$Type!=="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation")}function v(e){return e.filter(e=>e.$AnnotationPath!==`@${"com.sap.vocabularies.UI.v1.Chart"}`)}function O(e,t,n,i){var o;if(Object.keys(e).length===0){return}const a=h(t,n);if(!i.MicroChart){delete e[`@${"com.sap.vocabularies.UI.v1.Chart"}`]}for(const r in e){let l=r;let s=e[l];switch(l){case`@${"com.sap.vocabularies.UI.v1.HeaderFacets"}`:if(!i.MicroChart){s=m(s);e[l]=s}break;case`@${"com.sap.vocabularies.UI.v1.Identification"}`:if(!i.IntentBasedNavigation){s=g(s);e[l]=s}break;case`@${"com.sap.vocabularies.UI.v1.LineItem"}`:if(!i.IntentBasedNavigation){s=g(s);e[l]=s}if(!i.MicroChart){s=m(s);e[l]=s}break;case`@${"com.sap.vocabularies.UI.v1.FieldGroup"}`:if(!i.IntentBasedNavigation){s.Data=g(s.Data);e[l]=s}if(!i.MicroChart){s.Data=m(s.Data);e[l]=s}break;case`@${"com.sap.vocabularies.UI.v1.PresentationVariant"}`:if(!i.Chart&&s.Visualizations){s.Visualizations=v(s.Visualizations);e[l]=s}break;case`@com.sap.vocabularies.Common.v1.DraftRoot`:if(e[`@Org.OData.Capabilities.V1.FilterRestrictions`]&&(o=e[`@Org.OData.Capabilities.V1.FilterRestrictions`].FilterExpressionRestrictions)!==null&&o!==void 0&&o.length){if(!e[`@Org.OData.Capabilities.V1.FilterRestrictions`].FilterExpressionRestrictions.some(e=>{var t;return e===null||e===void 0?void 0:(t=e.Property)===null||t===void 0?void 0:t.$PropertyPath.includes("DraftAdministrativeData")})){e[`@Org.OData.Capabilities.V1.FilterRestrictions`].FilterExpressionRestrictions.push({$Type:"Org.OData.Capabilities.V1.FilterExpressionRestrictionType",AllowedExpressions:"SingleRange",Property:{$PropertyPath:"DraftAdministrativeData/CreationDateTime"}},{$Type:"Org.OData.Capabilities.V1.FilterExpressionRestrictionType",AllowedExpressions:"SingleRange",Property:{$PropertyPath:"DraftAdministrativeData/LastChangeDateTime"}})}}break;default:break}let p=a;const y=l.split("@");if(y.length>2){p=h(`${t}@${y[1]}`,n);l=y[2]}else{l=y[1]}const c=l.split("#");const f=c[1];l=c[0];const P={term:l,qualifier:f};let b=`${t}@${P.term}`;if(f){b+=`#${f}`}let N=false;const A=typeof s;if(s===null){P.value={type:"Null"}}else if(A==="string"){P.value={type:"String",String:s}}else if(A==="boolean"){P.value={type:"Bool",Bool:s}}else if(A==="number"){P.value={type:"Int",Int:s}}else if(s.$If!==undefined){P.value={type:"If",If:s.$If}}else if(s.$And!==undefined){P.value={type:"And",And:s.$And}}else if(s.$Or!==undefined){P.value={type:"Or",Or:s.$Or}}else if(s.$Not!==undefined){P.value={type:"Not",Not:s.$Not}}else if(s.$Eq!==undefined){P.value={type:"Eq",Eq:s.$Eq}}else if(s.$Ne!==undefined){P.value={type:"Ne",Ne:s.$Ne}}else if(s.$Gt!==undefined){P.value={type:"Gt",Gt:s.$Gt}}else if(s.$Ge!==undefined){P.value={type:"Ge",Ge:s.$Ge}}else if(s.$Lt!==undefined){P.value={type:"Lt",Lt:s.$Lt}}else if(s.$Le!==undefined){P.value={type:"Le",Le:s.$Le}}else if(s.$Apply!==undefined){P.value={type:"Apply",Apply:s.$Apply,Function:s.$Function}}else if(s.$Path!==undefined){P.value={type:"Path",Path:s.$Path}}else if(s.$AnnotationPath!==undefined){P.value={type:"AnnotationPath",AnnotationPath:s.$AnnotationPath}}else if(s.$Decimal!==undefined){P.value={type:"Decimal",Decimal:parseFloat(s.$Decimal)}}else if(s.$EnumMember!==undefined){P.value={type:"EnumMember",EnumMember:`${$(s.$EnumMember.split("/")[0])}/${s.$EnumMember.split("/")[1]}`}}else if(Array.isArray(s)){N=true;P.collection=s.map((e,t)=>d(e,`${b}/${t}`,n,i));if(s.length>0){if(s[0].hasOwnProperty("$PropertyPath")){P.collection.type="PropertyPath"}else if(s[0].hasOwnProperty("$Path")){P.collection.type="Path"}else if(s[0].hasOwnProperty("$NavigationPropertyPath")){P.collection.type="NavigationPropertyPath"}else if(s[0].hasOwnProperty("$AnnotationPath")){P.collection.type="AnnotationPath"}else if(s[0].hasOwnProperty("$Type")){P.collection.type="Record"}else if(s[0].hasOwnProperty("$If")){P.collection.type="If"}else if(s[0].hasOwnProperty("$Or")){P.collection.type="Or"}else if(s[0].hasOwnProperty("$Eq")){P.collection.type="Eq"}else if(s[0].hasOwnProperty("$Ne")){P.collection.type="Ne"}else if(s[0].hasOwnProperty("$Not")){P.collection.type="Not"}else if(s[0].hasOwnProperty("$Gt")){P.collection.type="Gt"}else if(s[0].hasOwnProperty("$Ge")){P.collection.type="Ge"}else if(s[0].hasOwnProperty("$Lt")){P.collection.type="Lt"}else if(s[0].hasOwnProperty("$Le")){P.collection.type="Le"}else if(s[0].hasOwnProperty("$And")){P.collection.type="And"}else if(s[0].hasOwnProperty("$Apply")){P.collection.type="Apply"}else if(typeof s[0]==="object"){P.collection.type="Record"}else{P.collection.type="String"}}}else{const e={propertyValues:[]};if(s.$Type){const t=s.$Type;e.type=`${t}`}const t=[];for(const e in s){if(e!=="$Type"&&!e.startsWith("@")){t.push(u(s[e],e,b,n,i))}else if(e.startsWith("@")){O({[e]:s[e]},b,n,i)}}e.propertyValues=t;P.record=e}P.isCollection=N;p.annotations.push(P)}}function b(e,t,n){return{_type:"Property",name:n,fullyQualifiedName:`${t.fullyQualifiedName}/${n}`,type:e.$Type,maxLength:e.$MaxLength,precision:e.$Precision,scale:e.$Scale,nullable:e.$Nullable}}function N(e,t,n){let i=[];if(e.$ReferentialConstraint){i=Object.keys(e.$ReferentialConstraint).map(n=>({sourceTypeName:t.name,sourceProperty:n,targetTypeName:e.$Type,targetProperty:e.$ReferentialConstraint[n]}))}const o={_type:"NavigationProperty",name:n,fullyQualifiedName:`${t.fullyQualifiedName}/${n}`,partner:e.$Partner,isCollection:e.$isCollection?e.$isCollection:false,containsTarget:e.$ContainsTarget,targetTypeName:e.$Type,referentialConstraint:i};return o}function A(e,t,n){const i={_type:"EntitySet",name:t,navigationPropertyBinding:{},entityTypeName:e.$Type,fullyQualifiedName:`${n}/${t}`};return i}function C(e,t,n){return{_type:"Singleton",name:t,navigationPropertyBinding:{},entityTypeName:e.$Type,fullyQualifiedName:`${n}/${t}`,nullable:true}}function T(e,t,n){return{_type:"ActionImport",name:t,fullyQualifiedName:`${n}/${t}`,actionName:e.$Action}}function w(e,t,n){const i={_type:"TypeDefinition",name:t.substring(n.length),fullyQualifiedName:t,underlyingType:e.$UnderlyingType};return i}function E(e,t,n){const i={_type:"ComplexType",name:t.substring(n.length),fullyQualifiedName:t,properties:[],navigationProperties:[]};const o=Object.keys(e).filter(t=>{if(t!="$Key"&&t!="$kind"){return e[t].$kind==="Property"}}).sort((e,t)=>e>t?1:-1).map(t=>b(e[t],i,t));i.properties=o;const a=Object.keys(e).filter(t=>{if(t!="$Key"&&t!="$kind"){return e[t].$kind==="NavigationProperty"}}).sort((e,t)=>e>t?1:-1).map(t=>N(e[t],i,t));i.navigationProperties=a;return i}function I(e,t){if(!e.$Key&&e.$BaseType){return I(t[e.$BaseType],t)}return e.$Key??[]}function D(e,t,n,i){var o,a;const r={_type:"EntityType",name:t.substring(n.length),fullyQualifiedName:t,keys:[],entityProperties:[],navigationProperties:[],actions:{}};for(const t in e){const n=e[t];switch(n.$kind){case"Property":const e=b(n,r,t);r.entityProperties.push(e);break;case"NavigationProperty":const i=N(n,r,t);r.navigationProperties.push(i);break}}r.keys=I(e,i).map(e=>r.entityProperties.find(t=>t.name===e)).filter(e=>e!==undefined);(o=i.$Annotations[r.fullyQualifiedName])===null||o===void 0?void 0:(a=o[`@${"com.sap.vocabularies.UI.v1.FilterFacets"}`])===null||a===void 0?void 0:a.forEach(e=>{e.ID=P(e)});for(const e of r.entityProperties){if(!i.$Annotations[e.fullyQualifiedName]){i.$Annotations[e.fullyQualifiedName]={}}if(!i.$Annotations[e.fullyQualifiedName][`@${"com.sap.vocabularies.UI.v1.DataFieldDefault"}`]){i.$Annotations[e.fullyQualifiedName][`@${"com.sap.vocabularies.UI.v1.DataFieldDefault"}`]={$Type:"com.sap.vocabularies.UI.v1.DataField",Value:{$Path:e.name}}}}return r}function L(e,t,n){var i;let o="";let a=e;if(t.$IsBound){const n=t.$Parameter[0];o=n.$Type;if(n.$isCollection===true){a=`${e}(Collection(${o}))`}else{a=`${e}(${o})`}}const r=t.$Parameter??[];return{_type:"Action",name:e.substring(n.length),fullyQualifiedName:a,isBound:t.$IsBound??false,isFunction:t.$kind==="Function",sourceType:o,returnType:((i=t.$ReturnType)===null||i===void 0?void 0:i.$Type)??"",parameters:r.map(e=>({_type:"ActionParameter",fullyQualifiedName:`${a}/${e.$Name}`,isCollection:e.$isCollection??false,name:e.$Name,type:e.$Type,nullable:e.$Nullable??false,maxLength:e.$MaxLength,precision:e.$Precision,scale:e.$Scale}))}}function G(e,t,n,i){i.entityContainer={_type:"EntityContainer",name:t.substring(e.length),fullyQualifiedName:t};for(const e in n){const o=n[e];switch(o.$kind){case"EntitySet":i.entitySets.push(A(o,e,t));break;case"Singleton":i.singletons.push(C(o,e,t));break;case"ActionImport":i.actionImports.push(T(o,e,t));break}}for(const e of i.entitySets){const t=n[e.name].$NavigationPropertyBinding;if(t){for(const n of Object.keys(t)){const o=i.entitySets.find(e=>e.name===t[n]);if(o){e.navigationPropertyBinding[n]=o}}}}}function M(e,t){const n={};for(const i in e){O(e[i],i,n,t)}return Object.values(n)}function S(e){const t=Object.keys(e).find(t=>e[t].$kind==="Schema")??"";const n={namespace:t.slice(0,-1),entityContainer:{_type:"EntityContainer",name:"",fullyQualifiedName:""},entitySets:[],entityTypes:[],complexTypes:[],typeDefinitions:[],singletons:[],associations:[],associationSets:[],actions:[],actionImports:[],annotations:{}};const i=(i,o)=>{switch(o.$kind){case"EntityContainer":G(t,i,o,n);break;case"Action":case"Function":n.actions.push(L(i,o,t));break;case"EntityType":n.entityTypes.push(D(o,i,t,e));break;case"ComplexType":n.complexTypes.push(E(o,i,t));break;case"TypeDefinition":n.typeDefinitions.push(w(o,i,t));break}};for(const t in e){const n=e[t];if(Array.isArray(n)){for(const e of n){i(t,e)}}else{i(t,n)}}return n}function k(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:f;const i={identification:"metamodelResult",version:"4.0",references:[]};e.lazy(i,"schema",()=>{const i=t.getObject("/$");const o=S(i);e.lazy(o.annotations,"metamodelResult",()=>M(i.$Annotations,n));return o});return i}i.parseMetaModel=k;const F={};function j(t,n){const i=t.id;if(!F.hasOwnProperty(i)){const o=k(t,n);try{F[i]=e.convert(o)}catch(e){throw new Error(e)}}return F[i]}i.convertTypes=j;function B(e){const t=e.getModel();if(!t.isA("sap.ui.model.odata.v4.ODataMetaModel")){throw new Error("This should only be called on a ODataMetaModel")}return j(t)}i.getConvertedTypes=B;function R(e){delete F[e.id]}i.deleteModelCacheData=R;function x(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const n=j(e.getModel());const i=e.getPath();const o=i.split("/");let a=o[1];let r=2;if(n.entityContainer.fullyQualifiedName===a){a=o[2];r++}let l=n.entitySets.find(e=>e.name===a);if(!l){l=n.singletons.find(e=>e.name===a)}let s=o.slice(r).join("/");const p=[l];while(s&&s.length>0&&s.startsWith("$NavigationPropertyBinding")){var y;let e=s.split("/");let t=0;let n,i;e=e.slice(1);while(!n&&e.length>t){if(e[t]!=="$NavigationPropertyBinding"){i=e.slice(0,t+1).join("/").replace("/$NavigationPropertyBinding","");n=l&&l.navigationPropertyBinding[i]}t++}if(!n){i=e[0]}const o=((y=i)===null||y===void 0?void 0:y.split("/"))||[];let a=l&&l.entityType;for(const e of o){const t=a&&a.navigationProperties.find(t=>t.name===e);if(t){p.push(t);a=t.targetType}else{break}}l=l&&n||l&&l.navigationPropertyBinding[e[0]];if(l){p.push(l)}e=e.slice(o.length||1);if(e.length&&e[0]==="$"){e.shift()}s=e.join("/")}if(s.startsWith("$Type")){if(s.startsWith("$Type@")){s=s.replace("$Type","")}else{s=o.slice(3).join("/")}}if(l&&s.length){const e=l.entityType.resolvePath(s,t);if(e){if(t){e.visitedObjects=p.concat(e.visitedObjects)}}else if(l.entityType&&l.entityType.actions){const e=l.entityType&&l.entityType.actions;const t=s.split("/");if(e[t[0]]){const n=e[t[0]];if(t[1]&&n.parameters){const e=t[1];return n.parameters.find(t=>t.fullyQualifiedName.endsWith(`/${e}`))}else if(s.length===1){return n}}}return e}else{if(t){return{target:l,visitedObjects:p}}return l}}i.convertMetaModelContext=x;function Q(e,t){const n=j(e.getModel());const i=x(e,true);let o;if(t&&t.getPath()!=="/"){o=Q(t)}return q(i,n,o)}i.getInvolvedDataModelObjects=Q;function q(e,t,n){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const o=e.visitedObjects.filter(e=>r(e)&&!s(e)&&!y(e));if(r(e.target)&&!s(e.target)&&o[o.length-1]!==e.target&&!i){o.push(e.target)}const c=[];const f=o[0];let u=f;let $=f.entityType;let d;let h=[];for(let e=1;e<o.length;e++){d=o[e];if(l(d)){var P;h.push(d.name);c.push(d);$=d.targetType;const e=(P=u)===null||P===void 0?void 0:P.navigationPropertyBinding[h.join("/")];if(e!==undefined){u=e;h=[]}}if(p(d)||a(d)){u=d;$=u.entityType}}if(h.length>0){u=undefined}if(n&&n.startingEntitySet!==f){const e=o.indexOf(n.startingEntitySet);if(e!==-1){const t=o.slice(0,e);n.startingEntitySet=f;n.navigationProperties=t.filter(l).concat(n.navigationProperties)}}const m={startingEntitySet:f,targetEntitySet:u,targetEntityType:$,targetObject:e.target,navigationProperties:c,contextLocation:n,convertedTypes:t};if(!r(m.targetObject)&&i){m.targetObject=r(d)?d:undefined}if(!m.contextLocation){m.contextLocation=m}return m}i.getInvolvedDataModelObjectFromPath=q;return i},false);
|
|
371
376
|
/*!
|
|
372
377
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
373
378
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
374
379
|
*/
|
|
375
|
-
sap.ui.predefine("sap/fe/core/converters/TemplateConverter", ["sap/base/util/merge","sap/fe/core/converters/helpers/IssueManager","./ConverterContext","./ManifestSettings","./MetaModelConverter","./templates/ListReportConverter","./templates/ObjectPageConverter"],function(e,t,o,n,i,a,s){"use strict";var l={};var v=i.getInvolvedDataModelObjects;var
|
|
380
|
+
sap.ui.predefine("sap/fe/core/converters/TemplateConverter", ["sap/base/util/merge","sap/fe/core/converters/helpers/IssueManager","./ConverterContext","./ManifestSettings","./MetaModelConverter","./templates/ListReportConverter","./templates/ObjectPageConverter"],function(e,t,o,n,i,a,s){"use strict";var l={};var v=i.getInvolvedDataModelObjects;var d=i.convertTypes;var c=n.TemplateType;var r=t.IssueSeverity;var u=t.IssueCategoryType;var f=t.IssueCategory;function g(e,t,o,n){e.forEach(e=>{let i=`For entity set ${o}`;if((e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.CollectionFacet"&&!(e!==null&&e!==void 0&&e.ID)){var a;i=`${i}, `+`level ${n}, the collection facet does not have an ID.`;t.addIssue(f.Facets,r.High,i,u,u===null||u===void 0?void 0:(a=u.Facets)===null||a===void 0?void 0:a.MissingID)}if((e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.CollectionFacet"&&n>=3){var s;i=`${i}, collection facet ${e.Label} is not supported at `+`level ${n}`;t.addIssue(f.Facets,r.Medium,i,u,u===null||u===void 0?void 0:(s=u.Facets)===null||s===void 0?void 0:s.UnSupportedLevel)}if(e!==null&&e!==void 0&&e.Facets){g(e===null||e===void 0?void 0:e.Facets,t,o,++n);n=n-1}})}function p(t,n,i,l,u,p,I){var h;const y=d(n,p);y.diagnostics.forEach(e=>{const t=l.checkIfIssueExists(f.Annotation,r.High,e.message);if(!t){l.addIssue(f.Annotation,r.High,e.message)}});y===null||y===void 0?void 0:(h=y.entityTypes)===null||h===void 0?void 0:h.forEach(e=>{var t,o;if(e!==null&&e!==void 0&&(t=e.annotations)!==null&&t!==void 0&&(o=t.UI)!==null&&o!==void 0&&o.Facets){var n,i;g(e===null||e===void 0?void 0:(n=e.annotations)===null||n===void 0?void 0:(i=n.UI)===null||i===void 0?void 0:i.Facets,l,e===null||e===void 0?void 0:e.name,1)}});const F=i.entitySet;const m=(i===null||i===void 0?void 0:i.contextPath)||(u==="/"?u+F:u);const C=n.createBindingContext(m);const b=v(C);if(b){let n={};const v=new o(y,i,l,e,b);switch(t){case c.ListReport:case c.AnalyticalListPage:n=a.convertPage(v,p===null||p===void 0?void 0:p.InsightsSupported);break;case c.ObjectPage:n=s.convertPage(v);break}if(I!==null&&I!==void 0&&I.extendPageDefinition){n=I.extendPageDefinition(n,v)}return n}return undefined}l.convertPage=p;return l},false);
|
|
376
381
|
/*!
|
|
377
382
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
378
383
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
379
384
|
*/
|
|
380
|
-
sap.ui.predefine("sap/fe/core/converters/annotations/DataField", ["sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/PropertyHelper","../helpers/DataFieldHelper"],function(e,t,a,i){"use strict";var o={};var n=i.isReferencePropertyStaticallyHidden;var l=a.getAssociatedUnitProperty;var r=a.getAssociatedTimezoneProperty;var d=a.getAssociatedCurrencyProperty;var v=t.getDisplayMode;var s=e.isProperty;var u=e.isPathAnnotationExpression;function c(e){return e.hasOwnProperty("Action")}o.isDataFieldForActionAbstract=c;function p(e){return e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"}o.isDataFieldForAnnotation=p;function f(e){return e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"}o.isDataFieldForAction=f;function g(e){return e.hasOwnProperty("Value")}o.isDataFieldTypes=g;function m(e){const t=e.targetObject;return $(f(t)?t:undefined)}o.isDataModelObjectPathForActionWithDialog=m;function $(e){const t=e===null||e===void 0?void 0:e.ActionTarget;if(t){var a,i;const e=(a=t.annotations)===null||a===void 0?void 0:(i=a.Common)===null||i===void 0?void 0:i.IsActionCritical;if(t.parameters.length>1||e){return"Dialog"}else{return"None"}}else{return"None"}}o.isActionWithDialog=$;function D(e){let t;if(s(e)){var a,i,o,n,l,r,d,v,c,p;t=((a=e.annotations)===null||a===void 0?void 0:(i=a.UI)===null||i===void 0?void 0:(o=i.DataFieldDefault)===null||o===void 0?void 0:(n=o.Target)===null||n===void 0?void 0:(l=n.$target)===null||l===void 0?void 0:l.TargetValue)??((r=e.annotations)===null||r===void 0?void 0:(d=r.UI)===null||d===void 0?void 0:(v=d.DataFieldDefault)===null||v===void 0?void 0:(c=v.Target)===null||c===void 0?void 0:(p=c.$target)===null||p===void 0?void 0:p.MaximumValue)}else{t=e.TargetValue??e.MaximumValue}if(typeof t==="number"){return t.toString()}return u(t)?t:"100"}o.getTargetValueOnDataPoint=D;const T=function(e){var t,a,i,o,n;return((t=e.annotations)===null||t===void 0?void 0:(a=t.UI)===null||a===void 0?void 0:(i=a.DataFieldDefault)===null||i===void 0?void 0:(o=i.Target)===null||o===void 0?void 0:(n=o.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"};o.isDataPointFromDataFieldDefault=T;function y(e,t){if(typeof t==="object"){var a;if(g(t)&&(a=t.Value)!==null&&a!==void 0&&a.$target){var i,o,n;const a=(i=t.Value)===null||i===void 0?void 0:i.$target;if((a===null||a===void 0?void 0:(o=a.annotations)===null||o===void 0?void 0:(n=o.Common)===null||n===void 0?void 0:n.SemanticObject)!==undefined){return e.getEntitySetBasedAnnotationPath(a===null||a===void 0?void 0:a.fullyQualifiedName)}}else if(s(t)){var l,r;if((t===null||t===void 0?void 0:(l=t.annotations)===null||l===void 0?void 0:(r=l.Common)===null||r===void 0?void 0:r.SemanticObject)!==undefined){return e.getEntitySetBasedAnnotationPath(t===null||t===void 0?void 0:t.fullyQualifiedName)}}}return undefined}o.getSemanticObjectPath=y;function b(e){return e.indexOf("/")>-1?e.substring(0,e.lastIndexOf("/")+1):""}function h(e,t,a,i){if(a==="AnalyticalTable"){var o,n;const a=(o=e.annotations)===null||o===void 0?void 0:(n=o.UI)===null||n===void 0?void 0:n.Hidden;if(a!==null&&a!==void 0&&a.path&&s(a.$target)){const e=t+a.path;i.additionalProperties[e]=a.$target}const l=e.Criticality;if(l!==null&&l!==void 0&&l.path&&s(l===null||l===void 0?void 0:l.$target)){const e=t+l.path;i.additionalProperties[e]=l===null||l===void 0?void 0:l.$target}}return i}function F(e,t,a,i,o){let n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{properties:{},additionalProperties:{},textOnlyPropertiesFromTextAnnotation:[]};let u=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;let c=arguments.length>7&&arguments[7]!==undefined?arguments[7]:false;function p(e,t){if(!n.properties.hasOwnProperty(e)){n.properties[e]=t}return Object.keys(n.properties).indexOf(e)}function f(e){n.exportSettingsTemplate=n.exportSettingsTemplate?`${n.exportSettingsTemplate}${e}`:`${e}`}if(e&&t){var g,m;let G;let H;let R;let Q;let q;if(c){G=p(e,t);f(`{${G}}`);return n}const J=b(e);const K=(g=t.annotations)===null||g===void 0?void 0:(m=g.Common)===null||m===void 0?void 0:m.Text;if(n.exportSettingsTemplate){f("\n");n.exportSettingsWrapping=true}if(K!==null&&K!==void 0&&K.path&&K!==null&&K!==void 0&&K.$target){const i=a.getDataModelObjectPath();const o=J+K.path;const l=v(t,i);let r;switch(l){case"Value":G=p(e,t);f(`{${G}}`);break;case"Description":r=p(o,K.$target);f(`{${r}}`);n.textOnlyPropertiesFromTextAnnotation.push(o);break;case"ValueDescription":G=p(e,t);r=p(o,K.$target);f(`{${G}} ({${r}})`);break;case"DescriptionValue":G=p(e,t);r=p(o,K.$target);f(`{${r}} ({${G}})`);break}}else{var $,T,y,F,I,U,P,A,x,O,V,k,C,S,N;const a=d(t)||l(t);const o=(t===null||t===void 0?void 0:($=t.annotations)===null||$===void 0?void 0:(T=$.Measures)===null||T===void 0?void 0:T.ISOCurrency)||(t===null||t===void 0?void 0:(y=t.annotations)===null||y===void 0?void 0:(F=y.Measures)===null||F===void 0?void 0:F.Unit);const v=r(t);const c=t===null||t===void 0?void 0:(I=t.annotations)===null||I===void 0?void 0:(U=I.Common)===null||U===void 0?void 0:U.Timezone;if(a&&o!==null&&o!==void 0&&o.$target){G=p(e,t);R=p(J+o.path,o.$target);if(u){f(`{${G}} {${R}}`)}else{n.exportUnitName=J+o.path}}else if(v&&c!==null&&c!==void 0&&c.$target){G=p(e,t);Q=p(J+c.path,c.$target);if(u){f(`{${G}} {${Q}}`)}else{n.exportTimezoneName=J+c.path}}else if(((P=t.Target)===null||P===void 0?void 0:(A=P.$target)===null||A===void 0?void 0:A.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"&&!((x=t.Target)!==null&&x!==void 0&&(O=x.$target)!==null&&O!==void 0&&O.ValueFormat)||((V=t.annotations)===null||V===void 0?void 0:(k=V.UI)===null||k===void 0?void 0:(C=k.DataFieldDefault)===null||C===void 0?void 0:(S=C.Target)===null||S===void 0?void 0:(N=S.$target)===null||N===void 0?void 0:N.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"){var W,j,M,w,B;const a=(W=t.Target)===null||W===void 0?void 0:(j=W.$target)===null||j===void 0?void 0:j.Value.$target;const i=(M=t.Target)===null||M===void 0?void 0:M.$target;const o=(w=t.annotations)===null||w===void 0?void 0:(B=w.UI)===null||B===void 0?void 0:B.DataFieldDefault;G=p(J?J+e:e,o?t:a);H=D(o?t:i);if(s(H.$target)){H=H;q=p(J?J+H.$target.name:H.$target.name,H.$target);f(`{${G}}/{${q}}`)}else{n.exportDataPointTargetValue=H;f(`{${G}}/${H}`)}}else if(t.$Type==="com.sap.vocabularies.Communication.v1.ContactType"){var E,z;const e=(E=t.fn)===null||E===void 0?void 0:E.$target;const a=(z=t.fn)===null||z===void 0?void 0:z.path;G=p(J?J+a:a,e);f(`{${G}}`)}else if(!i){G=p(e,t);f(`{${G}}`);if(o){n.exportUnitString=`${o}`}else if(c){n.exportTimezoneString=`${c}`}}}n=h(t,J,o,n);if(Object.keys(n.additionalProperties).length>0&&Object.keys(n.properties).length===0){G=p(e,t);f(`{${G}}`)}}return n}o.collectRelatedProperties=F;function I(e,t,a){var i,o,l;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{properties:{},additionalProperties:{},textOnlyPropertiesFromTextAnnotation:[]};let d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;let v=false;switch(e===null||e===void 0?void 0:e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":if(e.Value){var s,u,c;const i=e.Value;v=n((s=i.$target)===null||s===void 0?void 0:(u=s.annotations)===null||u===void 0?void 0:(c=u.UI)===null||c===void 0?void 0:c.DataFieldDefault)||n(e)||false;r=F(i.path,i.$target,t,false,a,r,d,v);const o=b(i.path);r=h(e,o,a,r)}break;case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":switch((i=e.Target)===null||i===void 0?void 0:(o=i.$target)===null||o===void 0?void 0:o.$Type){case"com.sap.vocabularies.UI.v1.FieldGroupType":(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{r=I(e,t,a,r,true)});break;case"com.sap.vocabularies.UI.v1.DataPointType":v=n(e)??false;r=F(e.Target.$target.Value.path,e,t,false,a,r,d,v);break;case"com.sap.vocabularies.Communication.v1.ContactType":const i=e.Target.$target;v=n(e)??false;r=F(e.Target.value,i,t,v,a,r,d,v);break;default:break}break;default:break}return r}o.collectRelatedPropertiesRecursively=I;const U=function(e){var t,a,i,o;if(s(e)){return e.type}let n;switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldWithActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":n=undefined;break;case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":n=e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:(a=t.$target)===null||a===void 0?void 0:a.type;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":default:const s=(i=e.Target)===null||i===void 0?void 0:(o=i.$target)===null||o===void 0?void 0:o.$Type;if(s){var l;const t=(l=e.Target)===null||l===void 0?void 0:l.$target;if(t.$Type==="com.sap.vocabularies.Communication.v1.ContactType"){var r,d;n=u(t===null||t===void 0?void 0:t.fn)&&(t===null||t===void 0?void 0:(r=t.fn)===null||r===void 0?void 0:(d=r.$target)===null||d===void 0?void 0:d.type)||undefined}else if(t.$Type==="com.sap.vocabularies.UI.v1.DataPointType"){var v,c,p;n=(t===null||t===void 0?void 0:(v=t.Value)===null||v===void 0?void 0:(c=v.$Path)===null||c===void 0?void 0:c.$Type)||(t===null||t===void 0?void 0:(p=t.Value)===null||p===void 0?void 0:p.$target.type)}else{var f;n=((f=e.Target)===null||f===void 0?void 0:f.$target.$Type)==="com.sap.vocabularies.UI.v1.ChartDefinitionType"?undefined:"Edm.Boolean"}}else{n=undefined}break}return n};o.getDataFieldDataType=U;return o},false);
|
|
385
|
+
sap.ui.predefine("sap/fe/core/converters/annotations/DataField", ["sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/PropertyHelper","../helpers/DataFieldHelper"],function(e,t,a,i){"use strict";var o={};var n=i.isReferencePropertyStaticallyHidden;var l=a.getAssociatedUnitProperty;var r=a.getAssociatedTimezoneProperty;var d=a.getAssociatedCurrencyProperty;var v=t.getDisplayMode;var s=e.isProperty;var u=e.isPathAnnotationExpression;function c(e){return e.hasOwnProperty("Action")}o.isDataFieldForActionAbstract=c;function p(e){return e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"}o.isDataFieldForAnnotation=p;function f(e){return e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"}o.isDataFieldForAction=f;function g(e){return e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"}o.isDataFieldForIntentBasedNavigation=g;function m(e){return e.hasOwnProperty("Value")}o.isDataFieldTypes=m;function $(e){const t=e.targetObject;return D(f(t)?t:undefined)}o.isDataModelObjectPathForActionWithDialog=$;function D(e){const t=e===null||e===void 0?void 0:e.ActionTarget;if(t){var a,i;const e=(a=t.annotations)===null||a===void 0?void 0:(i=a.Common)===null||i===void 0?void 0:i.IsActionCritical;if(t.parameters.length>1||e){return"Dialog"}else{return"None"}}else{return"None"}}o.isActionWithDialog=D;function T(e){let t;if(s(e)){var a,i,o,n,l,r,d,v,c,p;t=((a=e.annotations)===null||a===void 0?void 0:(i=a.UI)===null||i===void 0?void 0:(o=i.DataFieldDefault)===null||o===void 0?void 0:(n=o.Target)===null||n===void 0?void 0:(l=n.$target)===null||l===void 0?void 0:l.TargetValue)??((r=e.annotations)===null||r===void 0?void 0:(d=r.UI)===null||d===void 0?void 0:(v=d.DataFieldDefault)===null||v===void 0?void 0:(c=v.Target)===null||c===void 0?void 0:(p=c.$target)===null||p===void 0?void 0:p.MaximumValue)}else{t=e.TargetValue??e.MaximumValue}if(typeof t==="number"){return t.toString()}return u(t)?t:"100"}o.getTargetValueOnDataPoint=T;const y=function(e){var t,a,i,o,n;return((t=e.annotations)===null||t===void 0?void 0:(a=t.UI)===null||a===void 0?void 0:(i=a.DataFieldDefault)===null||i===void 0?void 0:(o=i.Target)===null||o===void 0?void 0:(n=o.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"};o.isDataPointFromDataFieldDefault=y;function b(e,t){if(typeof t==="object"){var a;if(m(t)&&(a=t.Value)!==null&&a!==void 0&&a.$target){var i,o,n;const a=(i=t.Value)===null||i===void 0?void 0:i.$target;if((a===null||a===void 0?void 0:(o=a.annotations)===null||o===void 0?void 0:(n=o.Common)===null||n===void 0?void 0:n.SemanticObject)!==undefined){return e.getEntitySetBasedAnnotationPath(a===null||a===void 0?void 0:a.fullyQualifiedName)}}else if(s(t)){var l,r;if((t===null||t===void 0?void 0:(l=t.annotations)===null||l===void 0?void 0:(r=l.Common)===null||r===void 0?void 0:r.SemanticObject)!==undefined){return e.getEntitySetBasedAnnotationPath(t===null||t===void 0?void 0:t.fullyQualifiedName)}}}return undefined}o.getSemanticObjectPath=b;function F(e){if(e){return e.indexOf("/")>-1?e.substring(0,e.lastIndexOf("/")+1):""}return""}function h(e,t,a,i){if(a==="AnalyticalTable"){var o,n;const a=(o=e.annotations)===null||o===void 0?void 0:(n=o.UI)===null||n===void 0?void 0:n.Hidden;if(a!==null&&a!==void 0&&a.path&&s(a.$target)){const e=t+a.path;i.additionalProperties[e]=a.$target}const l=e.Criticality;if(l!==null&&l!==void 0&&l.path&&s(l===null||l===void 0?void 0:l.$target)){const e=t+l.path;i.additionalProperties[e]=l===null||l===void 0?void 0:l.$target}}return i}function I(e,t,a,i,o){let n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{properties:{},additionalProperties:{},textOnlyPropertiesFromTextAnnotation:[]};let u=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;let c=arguments.length>7&&arguments[7]!==undefined?arguments[7]:false;function p(e,t){if(!n.properties.hasOwnProperty(e)){n.properties[e]=t}return Object.keys(n.properties).indexOf(e)}function f(e){n.exportSettingsTemplate=n.exportSettingsTemplate?`${n.exportSettingsTemplate}${e}`:`${e}`}if(e&&t){var g,m;let G;let H;let R;let Q;let q;if(c){G=p(e,t);f(`{${G}}`);return n}const J=F(e);const K=(g=t.annotations)===null||g===void 0?void 0:(m=g.Common)===null||m===void 0?void 0:m.Text;if(n.exportSettingsTemplate){f("\n");n.exportSettingsWrapping=true}if(K!==null&&K!==void 0&&K.path&&K!==null&&K!==void 0&&K.$target){const i=a.getDataModelObjectPath();const o=J+K.path;const l=v(t,i);let r;switch(l){case"Value":G=p(e,t);f(`{${G}}`);break;case"Description":r=p(o,K.$target);f(`{${r}}`);n.textOnlyPropertiesFromTextAnnotation.push(o);break;case"ValueDescription":G=p(e,t);r=p(o,K.$target);f(`{${G}} ({${r}})`);break;case"DescriptionValue":G=p(e,t);r=p(o,K.$target);f(`{${r}} ({${G}})`);break}}else{var $,D,y,b,I,U,P,A,x,O,V,k,C,S,N;const a=d(t)||l(t);const o=(t===null||t===void 0?void 0:($=t.annotations)===null||$===void 0?void 0:(D=$.Measures)===null||D===void 0?void 0:D.ISOCurrency)||(t===null||t===void 0?void 0:(y=t.annotations)===null||y===void 0?void 0:(b=y.Measures)===null||b===void 0?void 0:b.Unit);const v=r(t);const c=t===null||t===void 0?void 0:(I=t.annotations)===null||I===void 0?void 0:(U=I.Common)===null||U===void 0?void 0:U.Timezone;if(a&&o!==null&&o!==void 0&&o.$target){G=p(e,t);R=p(J+o.path,o.$target);if(u){f(`{${G}} {${R}}`)}else{n.exportUnitName=J+o.path}}else if(v&&c!==null&&c!==void 0&&c.$target){G=p(e,t);Q=p(J+c.path,c.$target);if(u){f(`{${G}} {${Q}}`)}else{n.exportTimezoneName=J+c.path}}else if(((P=t.Target)===null||P===void 0?void 0:(A=P.$target)===null||A===void 0?void 0:A.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"&&!((x=t.Target)!==null&&x!==void 0&&(O=x.$target)!==null&&O!==void 0&&O.ValueFormat)||((V=t.annotations)===null||V===void 0?void 0:(k=V.UI)===null||k===void 0?void 0:(C=k.DataFieldDefault)===null||C===void 0?void 0:(S=C.Target)===null||S===void 0?void 0:(N=S.$target)===null||N===void 0?void 0:N.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"){var W,j,B,M,w;const a=(W=t.Target)===null||W===void 0?void 0:(j=W.$target)===null||j===void 0?void 0:j.Value.$target;const i=(B=t.Target)===null||B===void 0?void 0:B.$target;const o=(M=t.annotations)===null||M===void 0?void 0:(w=M.UI)===null||w===void 0?void 0:w.DataFieldDefault;G=p(J?J+e:e,o?t:a);H=T(o?t:i);if(s(H.$target)){H=H;q=p(J?J+H.$target.name:H.$target.name,H.$target);f(`{${G}}/{${q}}`)}else{n.exportDataPointTargetValue=H;f(`{${G}}/${H}`)}}else if(t.$Type==="com.sap.vocabularies.Communication.v1.ContactType"){var E,z;const e=(E=t.fn)===null||E===void 0?void 0:E.$target;const a=(z=t.fn)===null||z===void 0?void 0:z.path;G=p(J?J+a:a,e);f(`{${G}}`)}else if(!i){G=p(e,t);f(`{${G}}`);if(o){n.exportUnitString=`${o}`}else if(c){n.exportTimezoneString=`${c}`}}}n=h(t,J,o,n);if(Object.keys(n.additionalProperties).length>0&&Object.keys(n.properties).length===0){G=p(e,t);f(`{${G}}`)}}return n}o.collectRelatedProperties=I;function U(e,t,a){var i,o,l;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{properties:{},additionalProperties:{},textOnlyPropertiesFromTextAnnotation:[]};let d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;let v=false;switch(e===null||e===void 0?void 0:e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":if(e.Value){var s,u,c;const i=e.Value;v=n((s=i.$target)===null||s===void 0?void 0:(u=s.annotations)===null||u===void 0?void 0:(c=u.UI)===null||c===void 0?void 0:c.DataFieldDefault)||n(e)||false;r=I(i.path,i.$target,t,false,a,r,d,v);const o=F(i.path);r=h(e,o,a,r)}break;case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":switch((i=e.Target)===null||i===void 0?void 0:(o=i.$target)===null||o===void 0?void 0:o.$Type){case"com.sap.vocabularies.UI.v1.FieldGroupType":(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{r=U(e,t,a,r,true)});break;case"com.sap.vocabularies.UI.v1.DataPointType":v=n(e)??false;r=I(e.Target.$target.Value.path,e,t,false,a,r,d,v);break;case"com.sap.vocabularies.Communication.v1.ContactType":const i=e.Target.$target;v=n(e)??false;r=I(e.Target.value,i,t,v,a,r,d,v);break;default:break}break;default:break}return r}o.collectRelatedPropertiesRecursively=U;const P=function(e){var t,a,i,o;if(s(e)){return e.type}let n;switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldWithActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":n=undefined;break;case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":n=e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:(a=t.$target)===null||a===void 0?void 0:a.type;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":default:const s=(i=e.Target)===null||i===void 0?void 0:(o=i.$target)===null||o===void 0?void 0:o.$Type;if(s){var l;const t=(l=e.Target)===null||l===void 0?void 0:l.$target;if(t.$Type==="com.sap.vocabularies.Communication.v1.ContactType"){var r,d;n=u(t===null||t===void 0?void 0:t.fn)&&(t===null||t===void 0?void 0:(r=t.fn)===null||r===void 0?void 0:(d=r.$target)===null||d===void 0?void 0:d.type)||undefined}else if(t.$Type==="com.sap.vocabularies.UI.v1.DataPointType"){var v,c,p;n=(t===null||t===void 0?void 0:(v=t.Value)===null||v===void 0?void 0:(c=v.$Path)===null||c===void 0?void 0:c.$Type)||(t===null||t===void 0?void 0:(p=t.Value)===null||p===void 0?void 0:p.$target.type)}else{var f;n=((f=e.Target)===null||f===void 0?void 0:f.$target.$Type)==="com.sap.vocabularies.UI.v1.ChartDefinitionType"?undefined:"Edm.Boolean"}}else{n=undefined}break}return n};o.getDataFieldDataType=P;return o},false);
|
|
381
386
|
/*!
|
|
382
387
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
383
388
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
384
389
|
*/
|
|
385
|
-
sap.ui.predefine("sap/fe/core/converters/common/AnnotationConverter", [],function(){var e;(function(){"use strict";var a={232:function(e,a,t){Object.defineProperty(a,"__esModule",{value:true});a.convert=void 0;const o=t(534);const r=Symbol("Annotation Target");function i(e,a){if(e[e.length-1]!==a){e.push(a)}return e}function n(e,a,t,s){var l,u,p,m;if(t.startsWith("/")){t=t.substring(1);a=undefined}const v=t.split("/").reduce((e,a)=>{if(a.includes("@")){const[t,r]=(0,o.splitAtFirst)(a,"@");e.push(t);e.push(`@${r}`)}else{e.push(a)}return e},[]);if(a===undefined){if(v[0].startsWith(e.rawSchema.namespace)&&v[0]!==((l=e.getConvertedEntityContainer())===null||l===void 0?void 0:l.fullyQualifiedName)){a=(p=(u=e.getConvertedEntityType(v[0]))!==null&&u!==void 0?u:e.getConvertedComplexType(v[0]))!==null&&p!==void 0?p:e.getConvertedAction(v[0]);v.shift()}else{a=e.getConvertedEntityContainer()}}else if(a[r]!==undefined){a=a[r]}else if(a._type==="Property"){const t=(0,o.substringBeforeFirst)(a.fullyQualifiedName,"/");a=(m=e.getConvertedEntityType(t))!==null&&m!==void 0?m:e.getConvertedComplexType(t)}const g=v.reduce((a,t)=>{var o,s,l,c,u;const p=e=>{a.messages.push({message:e});a.target=undefined;return a};if(a.target===undefined){return a}a.objectPath=i(a.objectPath,a.target);if(t.startsWith("@")&&t!=="@$ui5.overload"){const[r,i]=e.splitTerm(t);const n=(o=a.target.annotations[r.substring(1)])===null||o===void 0?void 0:o[i];if(n!==undefined){a.target=n;return a}return p(`Annotation '${t.substring(1)}' not found on ${a.target._type} '${a.target.fullyQualifiedName}'`)}if(a.target.$target){let o;if(t==="$AnnotationPath"){o=a.target.value}else if(t==="$Path"){o=a.target.path}if(o!==undefined){const t=n(e,a.target[r],o);t.objectPath.forEach(e=>{if(!a.objectPath.includes(e)){a.objectPath=i(a.objectPath,e)}});a.target=t.target;a.objectPath=i(a.objectPath,a.target);return a}}switch((s=a.target)===null||s===void 0?void 0:s._type){case"Schema":break;case"EntityContainer":{const e=a.target;if(t===""||t===e.fullyQualifiedName){return a}const o=(c=(l=e.entitySets.by_name(t))!==null&&l!==void 0?l:e.singletons.by_name(t))!==null&&c!==void 0?c:e.actionImports.by_name(t);if(o){a.target=o;return a}}break;case"EntitySet":case"Singleton":{const o=a.target;if(t===""||t==="$Type"){a.target=o.entityType;return a}if(t==="$"){return a}if(t==="$NavigationPropertyBinding"){const e=o.navigationPropertyBinding;a.target=e;return a}const r=n(e,o.entityType,t);a.target=r.target;a.objectPath=r.objectPath.reduce(i,a.objectPath);return a}case"EntityType":{const e=a.target;if(t===""||t==="$Type"){return a}const o=e.entityProperties.by_name(t);if(o){a.target=o;return a}const r=e.navigationProperties.by_name(t);if(r){a.target=r;return a}const i=e.actions[t];if(i){a.target=i;return a}}break;case"ActionImport":{const o=n(e,a.target.action,t);a.target=o.target;a.objectPath=o.objectPath.reduce(i,a.objectPath);return a}case"Action":{const e=a.target;if(t===""){return a}if(t==="@$ui5.overload"||t==="0"){return a}if(t==="$Parameter"&&e.isBound){a.target=e.parameters;return a}const o=(u=e.parameters[t])!==null&&u!==void 0?u:e.parameters.find(e=>e.name===t);if(o){a.target=o;return a}break}case"Property":{const e=a.target;const o=e.targetType;if(o!==undefined){const e=o.properties.by_name(t);if(e){a.target=e;return a}const r=o.navigationProperties.by_name(t);if(r){a.target=r;return a}}}break;case"ActionParameter":const o=a.target.typeReference;if(o!==undefined){const r=n(e,o,t);a.target=r.target;a.objectPath=r.objectPath.reduce(i,a.objectPath);return a}break;case"NavigationProperty":const r=n(e,a.target.targetType,t);a.target=r.target;a.objectPath=r.objectPath.reduce(i,a.objectPath);return a;default:if(t===""){return a}if(a.target[t]){a.target=a.target[t];a.objectPath=i(a.objectPath,a.target);return a}}return p(`Element '${t}' not found at ${a.target._type} '${a.target.fullyQualifiedName}'`)},{target:a,objectPath:[],messages:[]});g.messages.forEach(a=>e.logError(a.message));if(!g.target){if(s){const o=c(e,s,a.fullyQualifiedName);e.logError("Unable to resolve the path expression: "+"\n"+t+"\n"+"\n"+"Hint: Check and correct the path values under the following structure in the metadata (annotation.xml file or CDS annotations for the application): \n\n"+"<Annotation Term = "+s+">"+"\n"+"<Record Type = "+o+">"+"\n"+"<AnnotationPath = "+t+">")}else{e.logError("Unable to resolve the path expression: "+t+"\n"+"\n"+"Hint: Check and correct the path values under the following structure in the metadata (annotation.xml file or CDS annotations for the application): \n\n"+"<Annotation Term = "+v[0]+">"+"\n"+"<PropertyValue Path= "+v[1]+">")}}return g}function s(e){return e.includes("@")}function l(e,a,t,i,l,c,u){if(c===undefined){return undefined}switch(c.type){case"String":return c.String;case"Int":return c.Int;case"Bool":return c.Bool;case"Decimal":return(0,o.Decimal)(c.Decimal);case"Date":return c.Date;case"EnumMember":const p=e.alias(c.EnumMember);const v=p.split(" ");if(v[0]&&o.EnumIsFlag[(0,o.substringBeforeFirst)(v[0],"/")]){return v}return p;case"PropertyPath":return{type:"PropertyPath",value:c.PropertyPath,fullyQualifiedName:u,$target:n(e,a,c.PropertyPath,t).target,[r]:a};case"NavigationPropertyPath":return{type:"NavigationPropertyPath",value:c.NavigationPropertyPath,fullyQualifiedName:u,$target:n(e,a,c.NavigationPropertyPath,t).target,[r]:a};case"AnnotationPath":return{type:"AnnotationPath",value:c.AnnotationPath,fullyQualifiedName:u,$target:n(e,a,e.unalias(c.AnnotationPath),t).target,annotationsTerm:t,term:"",path:"",[r]:a};case"Path":const y=n(e,a,c.Path,t).target;if(s(c.Path)){return y}else{return{type:"Path",path:c.Path,fullyQualifiedName:u,$target:y,[r]:a}}case"Record":return m(e,t,a,i,l,c.Record,u);case"Collection":return g(e,a,t,i,l,c.Collection,u);case"Apply":case"Null":case"Not":case"Eq":case"Ne":case"Gt":case"Ge":case"Lt":case"Le":case"If":case"And":case"Or":default:return c}}function c(e,a,t,r){let i=o.TermToTypes[a];if(r){a=`${(0,o.substringBeforeLast)(a,".")}.${r}`;i=o.TermToTypes[a]}e.logError(`The type of the record used within the term ${a} was not defined and was inferred as ${i}.\nHint: If possible, try to maintain the Type property for each Record.\n<Annotations Target="${t}">\n\t<Annotation Term="${a}">\n\t\t<Record>...</Record>\n\t</Annotation>\n</Annotations>`);return i}function u(e){return e.hasOwnProperty("Action")&&(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithAction")}function p(e,a,t,o,r){let i;if(!r.type&&a){i=c(e,a,t.fullyQualifiedName,o)}else{i=e.unalias(r.type)}return i}function m(e,a,t,i,n,s,c){var m;const v={$Type:p(e,a,t,i,s),fullyQualifiedName:c,[r]:t};(0,o.lazy)(v,"annotations",()=>{var a;let o;if(s.annotations&&s.annotations.length>0){o=s.annotations}else{o=(a=e.rawAnnotationsPerTarget[c])===null||a===void 0?void 0:a.annotations}o===null||o===void 0?void 0:o.forEach(e=>{e.target=c;e.__source=n;e[r]=t;e.fullyQualifiedName=`${c}@${e.term}`});return V(e,v,o!==null&&o!==void 0?o:[])});const g=(m=s.propertyValues)===null||m===void 0?void 0:m.reduce((r,i)=>{(0,o.lazy)(r,i.name,()=>l(e,t,a,i.name,n,i.value,`${c}/${i.name}`));return r},v);if(u(g)){(0,o.lazy)(g,"ActionTarget",()=>{var a,o;let r=(a=t.actions)===null||a===void 0?void 0:a[g.Action];if(!r){r=(o=e.getConvertedActionImport(g.Action))===null||o===void 0?void 0:o.action}if(!r){r=e.getConvertedAction(g.Action);if(!(r===null||r===void 0?void 0:r.isBound)){r=undefined}}if(!r){e.logError(`Unable to resolve the action '${g.Action}' defined for '${v.fullyQualifiedName}'`)}return r})}return g}function v(e){let a=e.type;if(a===undefined&&e.length>0){const t=e[0];if(t.hasOwnProperty("PropertyPath")){a="PropertyPath"}else if(t.hasOwnProperty("Path")){a="Path"}else if(t.hasOwnProperty("AnnotationPath")){a="AnnotationPath"}else if(t.hasOwnProperty("NavigationPropertyPath")){a="NavigationPropertyPath"}else if(typeof t==="object"&&(t.hasOwnProperty("type")||t.hasOwnProperty("propertyValues"))){a="Record"}else if(typeof t==="string"){a="String"}}else if(a===undefined){a="EmptyCollection"}return a}function g(e,a,t,r,i,s,l){const c=v(s);switch(c){case"PropertyPath":return s.map((r,i)=>{const s={type:"PropertyPath",value:r.PropertyPath,fullyQualifiedName:`${l}/${i}`};(0,o.lazy)(s,"$target",()=>{var o;return(o=n(e,a,r.PropertyPath,t).target)!==null&&o!==void 0?o:{}});return s});case"Path":return s.map(o=>n(e,a,o.Path,t).target);case"AnnotationPath":return s.map((r,i)=>{const s={type:"AnnotationPath",value:r.AnnotationPath,fullyQualifiedName:`${l}/${i}`,annotationsTerm:t,term:"",path:""};(0,o.lazy)(s,"$target",()=>n(e,a,r.AnnotationPath,t).target);return s});case"NavigationPropertyPath":return s.map((r,i)=>{var s;const c=(s=r.NavigationPropertyPath)!==null&&s!==void 0?s:"";const u={type:"NavigationPropertyPath",value:c,fullyQualifiedName:`${l}/${i}`};if(c===""){u.$target=undefined}else{(0,o.lazy)(u,"$target",()=>n(e,a,c,t).target)}return u});case"Record":return s.map((o,n)=>m(e,t,a,r,i,o,`${l}/${n}`));case"Apply":case"Null":case"If":case"Eq":case"Ne":case"Lt":case"Gt":case"Le":case"Ge":case"Not":case"And":case"Or":return s.map(e=>e);case"String":return s.map(e=>{if(typeof e==="string"||e===undefined){return e}else{return e.String}});default:if(s.length===0){return[]}throw new Error("Unsupported case")}}function y(e){return!!e.targetTypeName}function d(e,a){return(0,o.splitAtLast)((0,o.alias)(e,a),".")}function O(e,a,t){var i;let n;if(t.record){n=m(e,t.term,a,"",t.__source,t.record,t.fullyQualifiedName)}else if(t.collection===undefined){n=l(e,a,t.term,"",t.__source,(i=t.value)!==null&&i!==void 0?i:{type:"Bool",Bool:true},t.fullyQualifiedName)}else if(t.collection){n=g(e,a,t.term,"",t.__source,t.collection,t.fullyQualifiedName)}else{throw new Error("Unsupported case")}switch(typeof n){case"string":n=new String(n);break;case"boolean":n=new Boolean(n);break;case"number":n=new Number(n);break;default:break}n.fullyQualifiedName=t.fullyQualifiedName;n[r]=a;const[s,c]=e.splitTerm(t.term);n.term=e.unalias(`${s}.${c}`);n.qualifier=t.qualifier;n.__source=t.__source;try{(0,o.lazy)(n,"annotations",()=>{var o;const i=n.fullyQualifiedName;let s;if(t.annotations&&t.annotations.length>0){s=t.annotations}else{s=(o=e.rawAnnotationsPerTarget[i])===null||o===void 0?void 0:o.annotations}s===null||s===void 0?void 0:s.forEach(e=>{e.target=i;e.__source=n.__source;e[r]=a;e.fullyQualifiedName=`${i}@${e.term}`});return V(e,n,s!==null&&s!==void 0?s:[])})}catch(e){}return n}function f(e,a,t){const r=`${e}@${(0,o.unalias)(a,t.term)}`;if(t.qualifier){return`${r}#${t.qualifier}`}else{return r}}function C(e){const a={};Object.keys(e.schema.annotations).forEach(t=>{e.schema.annotations[t].forEach(r=>{const i=(0,o.unalias)(e.references,r.target);r.__source=t;if(!a[i]){a[i]={annotations:r.annotations.map(a=>{a.fullyQualifiedName=f(i,e.references,a);a.__source=t;return a}),target:i};a[i].__source=t}else{r.annotations.forEach(o=>{const r=a[i].annotations.findIndex(e=>e.term===o.term&&e.qualifier===o.qualifier);o.__source=t;o.fullyQualifiedName=f(i,e.references,o);if(r!==-1){a[i].annotations.splice(r,1,o)}else{a[i].annotations.push(o)}})}})});return a}class b{get rawAnnotationsPerTarget(){if(this._rawAnnotationsPerTarget===undefined){this._rawAnnotationsPerTarget=C(this.rawMetadata)}return this._rawAnnotationsPerTarget}getConvertedEntityContainer(){return this.getConvertedElement(this.rawMetadata.schema.entityContainer.fullyQualifiedName,this.rawMetadata.schema.entityContainer,P)}getConvertedEntitySet(e){return this.convertedOutput.entitySets.by_fullyQualifiedName(e)}getConvertedSingleton(e){return this.convertedOutput.singletons.by_fullyQualifiedName(e)}getConvertedEntityType(e){return this.convertedOutput.entityTypes.by_fullyQualifiedName(e)}getConvertedComplexType(e){return this.convertedOutput.complexTypes.by_fullyQualifiedName(e)}getConvertedTypeDefinition(e){return this.convertedOutput.typeDefinitions.by_fullyQualifiedName(e)}getConvertedActionImport(e){let a=this.convertedOutput.actionImports.by_fullyQualifiedName(e);if(!a){a=this.convertedOutput.actionImports.by_name(e)}return a}getConvertedAction(e){return this.convertedOutput.actions.by_fullyQualifiedName(e)}convert(e,a){if(Array.isArray(e)){return()=>{const t=e.reduce((e,t)=>{const o=this.getConvertedElement(t.fullyQualifiedName,t,a);if(o){e.push(o)}return e},[]);(0,o.addGetByValue)(t,"name");(0,o.addGetByValue)(t,"fullyQualifiedName");return t}}else{return()=>this.getConvertedElement(e.fullyQualifiedName,e,a)}}constructor(e,a){this.convertedElements=new Map;this.rawMetadata=e;this.rawSchema=e.schema;this.convertedOutput=a}getConvertedElement(e,a,t){let o=this.convertedElements.get(e);if(o===undefined){const r=typeof a==="function"?a.apply(undefined,[e]):a;if(r!==undefined){o=t.apply(undefined,[this,r]);this.convertedElements.set(e,o)}}return o}logError(e){this.convertedOutput.diagnostics.push({message:e})}splitTerm(e){return d(this.rawMetadata.references,e)}alias(e){return(0,o.alias)(this.rawMetadata.references,e)}unalias(e){var a;return(a=(0,o.unalias)(this.rawMetadata.references,e))!==null&&a!==void 0?a:""}}function T(e,a){return()=>{let t=e.getConvertedEntityType(a);if(!t){e.logError(`EntityType '${a}' not found`);t={}}return t}}function D(e,a,t){return()=>Object.keys(a).reduce((r,i)=>{const n=a[i];(0,o.lazy)(r,i,()=>{let a;if(n._type==="Singleton"){a=e.getConvertedSingleton(n.fullyQualifiedName)}else{a=e.getConvertedEntitySet(n.fullyQualifiedName)}if(!a){e.logError(`${t._type} '${t.fullyQualifiedName}': Failed to resolve NavigationPropertyBinding ${i}`);a={}}return a});return r},{})}function h(e,a){const t=a.annotations;return()=>{var o,r;return V(e,a,(r=t!==null&&t!==void 0?t:(o=e.rawAnnotationsPerTarget[a.fullyQualifiedName])===null||o===void 0?void 0:o.annotations)!==null&&r!==void 0?r:[])}}function V(e,a,t){return t.reduce((t,r)=>{const[i,n]=e.splitTerm(r.term);const s=`${n}${r.qualifier?"#"+r.qualifier:""}`;if(t[i]===undefined){t[i]={}}if(!t[i].hasOwnProperty(s)){(0,o.lazy)(t[i],s,()=>e.getConvertedElement(r.fullyQualifiedName,r,(e,t)=>O(e,a,t)))}return t},{})}function P(e,a){const t=a;(0,o.lazy)(t,"annotations",h(e,a));(0,o.lazy)(t,"entitySets",e.convert(e.rawSchema.entitySets,A));(0,o.lazy)(t,"singletons",e.convert(e.rawSchema.singletons,I));(0,o.lazy)(t,"actionImports",e.convert(e.rawSchema.actionImports,N));return t}function I(e,a){const t=a;t.entityTypeName=e.unalias(a.entityTypeName);(0,o.lazy)(t,"entityType",T(e,a.entityTypeName));(0,o.lazy)(t,"annotations",h(e,a));const r=a.navigationPropertyBinding;(0,o.lazy)(t,"navigationPropertyBinding",D(e,r,a));return t}function A(e,a){const t=a;t.entityTypeName=e.unalias(a.entityTypeName);(0,o.lazy)(t,"entityType",T(e,a.entityTypeName));(0,o.lazy)(t,"annotations",h(e,a));const r=a.navigationPropertyBinding;(0,o.lazy)(t,"navigationPropertyBinding",D(e,r,a));return t}function S(e,a){const t=a;a.keys.forEach(e=>{e.isKey=true});(0,o.lazy)(t,"annotations",h(e,a));(0,o.lazy)(t,"keys",e.convert(a.keys,E));(0,o.lazy)(t,"entityProperties",e.convert(a.entityProperties,E));(0,o.lazy)(t,"navigationProperties",e.convert(a.navigationProperties,U));(0,o.lazy)(t,"actions",()=>e.rawSchema.actions.filter(e=>e.isBound&&(e.sourceType===a.fullyQualifiedName||e.sourceType===`Collection(${a.fullyQualifiedName})`)).reduce((a,t)=>{const o=`${e.rawSchema.namespace}.${t.name}`;a[o]=e.getConvertedAction(t.fullyQualifiedName);return a},{}));t.resolvePath=(t,o)=>{const r=n(e,a,t);if(o){return{target:r.target,visitedObjects:r.objectPath,messages:r.messages}}else{return r.target}};return t}function E(e,a){const t=a;t.type=e.unalias(a.type);(0,o.lazy)(t,"annotations",h(e,a));(0,o.lazy)(t,"targetType",()=>{var t;const o=a.type;const r=o.startsWith("Collection")?o.substring(11,o.length-1):o;return(t=e.getConvertedComplexType(r))!==null&&t!==void 0?t:e.getConvertedTypeDefinition(r)});return t}function U(e,a){var t,r,i;const n=a;n.referentialConstraint=(t=n.referentialConstraint)!==null&&t!==void 0?t:[];if(y(a)){n.targetTypeName=e.unalias(a.targetTypeName)}else{const t=(r=e.rawSchema.associations.find(e=>e.fullyQualifiedName===a.relationship))===null||r===void 0?void 0:r.associationEnd.find(e=>e.role===a.toRole);n.isCollection=(t===null||t===void 0?void 0:t.multiplicity)==="*";n.targetTypeName=(i=t===null||t===void 0?void 0:t.type)!==null&&i!==void 0?i:""}(0,o.lazy)(n,"targetType",T(e,a.targetTypeName));(0,o.lazy)(n,"annotations",h(e,a));return n}function N(e,a){const t=a;t.actionName=e.unalias(a.actionName);(0,o.lazy)(t,"annotations",h(e,a));(0,o.lazy)(t,"action",()=>e.getConvertedAction(a.actionName));return t}function R(e,a){const t=a;t.sourceType=e.unalias(a.sourceType);if(t.sourceType){(0,o.lazy)(t,"sourceEntityType",T(e,a.sourceType))}t.returnType=e.unalias(a.returnType);if(t.returnType){(0,o.lazy)(t,"returnEntityType",T(e,a.returnType))}(0,o.lazy)(t,"parameters",e.convert(a.parameters,$));(0,o.lazy)(t,"annotations",()=>{var t,o,r,i,n,s,l,c,u,p,m;const v=a.fullyQualifiedName.match(/(?<action>[^()]+)(?:\((?<overload>.*)\))?/);let g=[];if(v){if((t=v.groups)===null||t===void 0?void 0:t.overload){g=(r=(o=e.rawAnnotationsPerTarget[a.fullyQualifiedName])===null||o===void 0?void 0:o.annotations)!==null&&r!==void 0?r:[]}else{g=(s=(n=e.rawAnnotationsPerTarget[`${(i=v.groups)===null||i===void 0?void 0:i.action}()`])===null||n===void 0?void 0:n.annotations)!==null&&s!==void 0?s:[]}if(((l=v.groups)===null||l===void 0?void 0:l.action)&&((c=v.groups)===null||c===void 0?void 0:c.action)!==a.fullyQualifiedName){const a=(m=(p=e.rawAnnotationsPerTarget[(u=v.groups)===null||u===void 0?void 0:u.action])===null||p===void 0?void 0:p.annotations)!==null&&m!==void 0?m:[];g=g.concat(a)}}return V(e,a,g)});return t}function $(e,a){const t=a;(0,o.lazy)(t,"typeReference",()=>{var t,o;return(o=(t=e.getConvertedEntityType(a.type))!==null&&t!==void 0?t:e.getConvertedComplexType(a.type))!==null&&o!==void 0?o:e.getConvertedTypeDefinition(a.type)});(0,o.lazy)(t,"annotations",h(e,a));return t}function M(e,a){const t=a;(0,o.lazy)(t,"properties",e.convert(a.properties,E));(0,o.lazy)(t,"navigationProperties",e.convert(a.navigationProperties,U));(0,o.lazy)(t,"annotations",h(e,a));return t}function w(e,a){const t=a;(0,o.lazy)(t,"annotations",h(e,a));return t}function F(e){if(e.references.length===0){e.references=o.defaultReferences}const a={version:e.version,namespace:e.schema.namespace,annotations:e.schema.annotations,references:o.defaultReferences.concat(e.references),diagnostics:[]};const t=new b(e,a);(0,o.lazy)(a,"entityContainer",t.convert(t.rawSchema.entityContainer,P));(0,o.lazy)(a,"entitySets",t.convert(t.rawSchema.entitySets,A));(0,o.lazy)(a,"singletons",t.convert(t.rawSchema.singletons,I));(0,o.lazy)(a,"entityTypes",t.convert(t.rawSchema.entityTypes,S));(0,o.lazy)(a,"actions",t.convert(t.rawSchema.actions,R));(0,o.lazy)(a,"complexTypes",t.convert(t.rawSchema.complexTypes,M));(0,o.lazy)(a,"actionImports",t.convert(t.rawSchema.actionImports,N));(0,o.lazy)(a,"typeDefinitions",t.convert(t.rawSchema.typeDefinitions,w));a.resolvePath=function e(a){const o=n(t,undefined,a);if(o.target){i(o.objectPath,o.target)}return o};return a}a.convert=F},782:function(e,a,t){var o=this&&this.__createBinding||(Object.create?function(e,a,t,o){if(o===undefined)o=t;var r=Object.getOwnPropertyDescriptor(a,t);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[t]}}}Object.defineProperty(e,o,r)}:function(e,a,t,o){if(o===undefined)o=t;e[o]=a[t]});var r=this&&this.__exportStar||function(e,a){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(a,t))o(a,e,t)};Object.defineProperty(a,"__esModule",{value:true});r(t(232),a);r(t(488),a);r(t(534),a)},534:function(e,a){Object.defineProperty(a,"__esModule",{value:true});a.addGetByValue=a.createIndexedFind=a.lazy=a.Decimal=a.isComplexTypeDefinition=a.TermToTypes=a.EnumIsFlag=a.unalias=a.alias=a.substringBeforeLast=a.substringBeforeFirst=a.splitAtLast=a.splitAtFirst=a.defaultReferences=void 0;a.defaultReferences=[{alias:"Capabilities",namespace:"Org.OData.Capabilities.V1",uri:""},{alias:"Aggregation",namespace:"Org.OData.Aggregation.V1",uri:""},{alias:"Validation",namespace:"Org.OData.Validation.V1",uri:""},{namespace:"Org.OData.Core.V1",alias:"Core",uri:""},{namespace:"Org.OData.Measures.V1",alias:"Measures",uri:""},{namespace:"com.sap.vocabularies.Common.v1",alias:"Common",uri:""},{namespace:"com.sap.vocabularies.UI.v1",alias:"UI",uri:""},{namespace:"com.sap.vocabularies.Session.v1",alias:"Session",uri:""},{namespace:"com.sap.vocabularies.Analytics.v1",alias:"Analytics",uri:""},{namespace:"com.sap.vocabularies.CodeList.v1",alias:"CodeList",uri:""},{namespace:"com.sap.vocabularies.PersonalData.v1",alias:"PersonalData",uri:""},{namespace:"com.sap.vocabularies.Communication.v1",alias:"Communication",uri:""},{namespace:"com.sap.vocabularies.HTML5.v1",alias:"HTML5",uri:""}];function t(e,a){return a<0?[e,""]:[e.substring(0,a),e.substring(a+1)]}function o(e,a){return a<0?e:e.substring(0,a)}function r(e,a){return t(e,e.indexOf(a))}a.splitAtFirst=r;function i(e,a){return t(e,e.lastIndexOf(a))}a.splitAtLast=i;function n(e,a){return o(e,e.indexOf(a))}a.substringBeforeFirst=n;function s(e,a){return o(e,e.lastIndexOf(a))}a.substringBeforeLast=s;function l(e,a){if(!e.reverseReferenceMap){e.reverseReferenceMap=e.reduce((e,a)=>{e[a.namespace]=a;return e},{})}if(!a){return a}const[t,o]=i(a,".");const n=e.reverseReferenceMap[t];if(n){return`${n.alias}.${o}`}else if(a.includes("@")){const[t,o]=r(a,"@");return`${t}@${l(e,o)}`}else{return a}}a.alias=l;function c(e,a){if(!e.referenceMap){e.referenceMap=e.reduce((e,a)=>{e[a.alias]=a;return e},{})}if(!a){return a}const[t,o]=r(a,".");const i=e.referenceMap[t];if(i){return`${i.namespace}.${o}`}else if(a.includes("@")){const[t,o]=r(a,"@");return`${t}@${c(e,o)}`}else{return a}}a.unalias=c;a.EnumIsFlag={"Auth.KeyLocation":false,"Core.RevisionKind":false,"Core.DataModificationOperationKind":false,"Core.Permission":true,"Capabilities.ConformanceLevelType":false,"Capabilities.IsolationLevel":true,"Capabilities.NavigationType":false,"Capabilities.SearchExpressions":true,"Capabilities.HttpMethod":true,"Aggregation.RollupType":false,"Common.TextFormatType":false,"Common.FilterExpressionType":false,"Common.FieldControlType":false,"Common.EffectType":true,"Communication.KindType":false,"Communication.ContactInformationType":true,"Communication.PhoneType":true,"Communication.GenderType":false,"UI.VisualizationType":false,"UI.CriticalityType":false,"UI.ImprovementDirectionType":false,"UI.TrendType":false,"UI.ChartType":false,"UI.ChartAxisScaleBehaviorType":false,"UI.ChartAxisAutoScaleDataScopeType":false,"UI.ChartDimensionRoleType":false,"UI.ChartMeasureRoleType":false,"UI.SelectionRangeSignType":false,"UI.SelectionRangeOptionType":false,"UI.TextArrangementType":false,"UI.ImportanceType":false,"UI.CriticalityRepresentationType":false,"UI.OperationGroupingType":false};var u;(function(e){e["Org.OData.Authorization.V1.SecuritySchemes"]="Org.OData.Authorization.V1.SecurityScheme";e["Org.OData.Authorization.V1.Authorizations"]="Org.OData.Authorization.V1.Authorization";e["Org.OData.Core.V1.Revisions"]="Org.OData.Core.V1.RevisionType";e["Org.OData.Core.V1.Links"]="Org.OData.Core.V1.Link";e["Org.OData.Core.V1.Example"]="Org.OData.Core.V1.ExampleValue";e["Org.OData.Core.V1.Messages"]="Org.OData.Core.V1.MessageType";e["Org.OData.Core.V1.ValueException"]="Org.OData.Core.V1.ValueExceptionType";e["Org.OData.Core.V1.ResourceException"]="Org.OData.Core.V1.ResourceExceptionType";e["Org.OData.Core.V1.DataModificationException"]="Org.OData.Core.V1.DataModificationExceptionType";e["Org.OData.Core.V1.IsLanguageDependent"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.AppliesViaContainer"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.DereferenceableIDs"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.ConventionalIDs"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.Permissions"]="Org.OData.Core.V1.Permission";e["Org.OData.Core.V1.DefaultNamespace"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.Immutable"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.Computed"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.ComputedDefaultValue"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.IsURL"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.IsMediaType"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.ContentDisposition"]="Org.OData.Core.V1.ContentDispositionType";e["Org.OData.Core.V1.OptimisticConcurrency"]="Edm.PropertyPath";e["Org.OData.Core.V1.AdditionalProperties"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.AutoExpand"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.AutoExpandReferences"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.MayImplement"]="Org.OData.Core.V1.QualifiedTypeName";e["Org.OData.Core.V1.Ordered"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.PositionalInsert"]="Org.OData.Core.V1.Tag";e["Org.OData.Core.V1.AlternateKeys"]="Org.OData.Core.V1.AlternateKey";e["Org.OData.Core.V1.OptionalParameter"]="Org.OData.Core.V1.OptionalParameterType";e["Org.OData.Core.V1.OperationAvailable"]="Edm.Boolean";e["Org.OData.Core.V1.SymbolicName"]="Org.OData.Core.V1.SimpleIdentifier";e["Org.OData.Core.V1.GeometryFeature"]="Org.OData.Core.V1.GeometryFeatureType";e["Org.OData.Capabilities.V1.ConformanceLevel"]="Org.OData.Capabilities.V1.ConformanceLevelType";e["Org.OData.Capabilities.V1.AsynchronousRequestsSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.BatchContinueOnErrorSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.IsolationSupported"]="Org.OData.Capabilities.V1.IsolationLevel";e["Org.OData.Capabilities.V1.CrossJoinSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.CallbackSupported"]="Org.OData.Capabilities.V1.CallbackType";e["Org.OData.Capabilities.V1.ChangeTracking"]="Org.OData.Capabilities.V1.ChangeTrackingType";e["Org.OData.Capabilities.V1.CountRestrictions"]="Org.OData.Capabilities.V1.CountRestrictionsType";e["Org.OData.Capabilities.V1.NavigationRestrictions"]="Org.OData.Capabilities.V1.NavigationRestrictionsType";e["Org.OData.Capabilities.V1.IndexableByKey"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.TopSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.SkipSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.ComputeSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.SelectSupport"]="Org.OData.Capabilities.V1.SelectSupportType";e["Org.OData.Capabilities.V1.BatchSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.BatchSupport"]="Org.OData.Capabilities.V1.BatchSupportType";e["Org.OData.Capabilities.V1.FilterRestrictions"]="Org.OData.Capabilities.V1.FilterRestrictionsType";e["Org.OData.Capabilities.V1.SortRestrictions"]="Org.OData.Capabilities.V1.SortRestrictionsType";e["Org.OData.Capabilities.V1.ExpandRestrictions"]="Org.OData.Capabilities.V1.ExpandRestrictionsType";e["Org.OData.Capabilities.V1.SearchRestrictions"]="Org.OData.Capabilities.V1.SearchRestrictionsType";e["Org.OData.Capabilities.V1.KeyAsSegmentSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.QuerySegmentSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.InsertRestrictions"]="Org.OData.Capabilities.V1.InsertRestrictionsType";e["Org.OData.Capabilities.V1.DeepInsertSupport"]="Org.OData.Capabilities.V1.DeepInsertSupportType";e["Org.OData.Capabilities.V1.UpdateRestrictions"]="Org.OData.Capabilities.V1.UpdateRestrictionsType";e["Org.OData.Capabilities.V1.DeepUpdateSupport"]="Org.OData.Capabilities.V1.DeepUpdateSupportType";e["Org.OData.Capabilities.V1.DeleteRestrictions"]="Org.OData.Capabilities.V1.DeleteRestrictionsType";e["Org.OData.Capabilities.V1.CollectionPropertyRestrictions"]="Org.OData.Capabilities.V1.CollectionPropertyRestrictionsType";e["Org.OData.Capabilities.V1.OperationRestrictions"]="Org.OData.Capabilities.V1.OperationRestrictionsType";e["Org.OData.Capabilities.V1.AnnotationValuesInQuerySupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Capabilities.V1.ModificationQueryOptions"]="Org.OData.Capabilities.V1.ModificationQueryOptionsType";e["Org.OData.Capabilities.V1.ReadRestrictions"]="Org.OData.Capabilities.V1.ReadRestrictionsType";e["Org.OData.Capabilities.V1.CustomHeaders"]="Org.OData.Capabilities.V1.CustomParameter";e["Org.OData.Capabilities.V1.CustomQueryOptions"]="Org.OData.Capabilities.V1.CustomParameter";e["Org.OData.Capabilities.V1.MediaLocationUpdateSupported"]="Org.OData.Core.V1.Tag";e["Org.OData.Aggregation.V1.ApplySupported"]="Org.OData.Aggregation.V1.ApplySupportedType";e["Org.OData.Aggregation.V1.ApplySupportedDefaults"]="Org.OData.Aggregation.V1.ApplySupportedBase";e["Org.OData.Aggregation.V1.Groupable"]="Org.OData.Core.V1.Tag";e["Org.OData.Aggregation.V1.Aggregatable"]="Org.OData.Core.V1.Tag";e["Org.OData.Aggregation.V1.ContextDefiningProperties"]="Edm.PropertyPath";e["Org.OData.Aggregation.V1.LeveledHierarchy"]="Edm.PropertyPath";e["Org.OData.Aggregation.V1.RecursiveHierarchy"]="Org.OData.Aggregation.V1.RecursiveHierarchyType";e["Org.OData.Aggregation.V1.AvailableOnAggregates"]="Org.OData.Aggregation.V1.AvailableOnAggregatesType";e["Org.OData.Validation.V1.Minimum"]="Edm.PrimitiveType";e["Org.OData.Validation.V1.Maximum"]="Edm.PrimitiveType";e["Org.OData.Validation.V1.Exclusive"]="Org.OData.Core.V1.Tag";e["Org.OData.Validation.V1.AllowedValues"]="Org.OData.Validation.V1.AllowedValue";e["Org.OData.Validation.V1.MultipleOf"]="Edm.Decimal";e["Org.OData.Validation.V1.Constraint"]="Org.OData.Validation.V1.ConstraintType";e["Org.OData.Validation.V1.ItemsOf"]="Org.OData.Validation.V1.ItemsOfType";e["Org.OData.Validation.V1.OpenPropertyTypeConstraint"]="Org.OData.Validation.V1.SingleOrCollectionType";e["Org.OData.Validation.V1.DerivedTypeConstraint"]="Org.OData.Validation.V1.SingleOrCollectionType";e["Org.OData.Validation.V1.AllowedTerms"]="Org.OData.Core.V1.QualifiedTermName";e["Org.OData.Validation.V1.ApplicableTerms"]="Org.OData.Core.V1.QualifiedTermName";e["Org.OData.Validation.V1.MaxItems"]="Edm.Int64";e["Org.OData.Validation.V1.MinItems"]="Edm.Int64";e["Org.OData.Measures.V1.Scale"]="Edm.Byte";e["Org.OData.Measures.V1.DurationGranularity"]="Org.OData.Measures.V1.DurationGranularityType";e["com.sap.vocabularies.Analytics.v1.Dimension"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Analytics.v1.Measure"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Analytics.v1.AccumulativeMeasure"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Analytics.v1.RolledUpPropertyCount"]="Edm.Int16";e["com.sap.vocabularies.Analytics.v1.PlanningAction"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Analytics.v1.AggregatedProperties"]="com.sap.vocabularies.Analytics.v1.AggregatedPropertyType";e["com.sap.vocabularies.Analytics.v1.AggregatedProperty"]="com.sap.vocabularies.Analytics.v1.AggregatedPropertyType";e["com.sap.vocabularies.Analytics.v1.AnalyticalContext"]="com.sap.vocabularies.Analytics.v1.AnalyticalContextType";e["com.sap.vocabularies.Common.v1.ServiceVersion"]="Edm.Int32";e["com.sap.vocabularies.Common.v1.ServiceSchemaVersion"]="Edm.Int32";e["com.sap.vocabularies.Common.v1.TextFor"]="Edm.PropertyPath";e["com.sap.vocabularies.Common.v1.IsLanguageIdentifier"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.TextFormat"]="com.sap.vocabularies.Common.v1.TextFormatType";e["com.sap.vocabularies.Common.v1.IsDigitSequence"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsUpperCase"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCurrency"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsUnit"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.UnitSpecificScale"]="Edm.PrimitiveType";e["com.sap.vocabularies.Common.v1.UnitSpecificPrecision"]="Edm.PrimitiveType";e["com.sap.vocabularies.Common.v1.SecondaryKey"]="Edm.PropertyPath";e["com.sap.vocabularies.Common.v1.MinOccurs"]="Edm.Int64";e["com.sap.vocabularies.Common.v1.MaxOccurs"]="Edm.Int64";e["com.sap.vocabularies.Common.v1.AssociationEntity"]="Edm.NavigationPropertyPath";e["com.sap.vocabularies.Common.v1.DerivedNavigation"]="Edm.NavigationPropertyPath";e["com.sap.vocabularies.Common.v1.Masked"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.RevealOnDemand"]="Edm.Boolean";e["com.sap.vocabularies.Common.v1.SemanticObjectMapping"]="com.sap.vocabularies.Common.v1.SemanticObjectMappingType";e["com.sap.vocabularies.Common.v1.IsInstanceAnnotation"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"]="com.sap.vocabularies.Common.v1.FilterExpressionRestrictionType";e["com.sap.vocabularies.Common.v1.FieldControl"]="com.sap.vocabularies.Common.v1.FieldControlType";e["com.sap.vocabularies.Common.v1.Application"]="com.sap.vocabularies.Common.v1.ApplicationType";e["com.sap.vocabularies.Common.v1.Timestamp"]="Edm.DateTimeOffset";e["com.sap.vocabularies.Common.v1.ErrorResolution"]="com.sap.vocabularies.Common.v1.ErrorResolutionType";e["com.sap.vocabularies.Common.v1.Messages"]="Edm.ComplexType";e["com.sap.vocabularies.Common.v1.numericSeverity"]="com.sap.vocabularies.Common.v1.NumericMessageSeverityType";e["com.sap.vocabularies.Common.v1.MaximumNumericMessageSeverity"]="com.sap.vocabularies.Common.v1.NumericMessageSeverityType";e["com.sap.vocabularies.Common.v1.IsActionCritical"]="Edm.Boolean";e["com.sap.vocabularies.Common.v1.Attributes"]="Edm.PropertyPath";e["com.sap.vocabularies.Common.v1.RelatedRecursiveHierarchy"]="Edm.AnnotationPath";e["com.sap.vocabularies.Common.v1.Interval"]="com.sap.vocabularies.Common.v1.IntervalType";e["com.sap.vocabularies.Common.v1.ResultContext"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.SAPObjectNodeType"]="com.sap.vocabularies.Common.v1.SAPObjectNodeTypeType";e["com.sap.vocabularies.Common.v1.Composition"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsNaturalPerson"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.ValueList"]="com.sap.vocabularies.Common.v1.ValueListType";e["com.sap.vocabularies.Common.v1.ValueListRelevantQualifiers"]="Org.OData.Core.V1.SimpleIdentifier";e["com.sap.vocabularies.Common.v1.ValueListWithFixedValues"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.ValueListMapping"]="com.sap.vocabularies.Common.v1.ValueListMappingType";e["com.sap.vocabularies.Common.v1.IsCalendarYear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarHalfyear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarQuarter"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarMonth"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarWeek"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsDayOfCalendarMonth"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsDayOfCalendarYear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarYearHalfyear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarYearQuarter"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarYearMonth"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarYearWeek"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsCalendarDate"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalYear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalPeriod"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalYearPeriod"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalQuarter"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalYearQuarter"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalWeek"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalYearWeek"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsDayOfFiscalYear"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.IsFiscalYearVariant"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.MutuallyExclusiveTerm"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.DraftRoot"]="com.sap.vocabularies.Common.v1.DraftRootType";e["com.sap.vocabularies.Common.v1.DraftNode"]="com.sap.vocabularies.Common.v1.DraftNodeType";e["com.sap.vocabularies.Common.v1.DraftActivationVia"]="Org.OData.Core.V1.SimpleIdentifier";e["com.sap.vocabularies.Common.v1.EditableFieldFor"]="Edm.PropertyPath";e["com.sap.vocabularies.Common.v1.SemanticKey"]="Edm.PropertyPath";e["com.sap.vocabularies.Common.v1.SideEffects"]="com.sap.vocabularies.Common.v1.SideEffectsType";e["com.sap.vocabularies.Common.v1.DefaultValuesFunction"]="com.sap.vocabularies.Common.v1.QualifiedName";e["com.sap.vocabularies.Common.v1.FilterDefaultValue"]="Edm.PrimitiveType";e["com.sap.vocabularies.Common.v1.FilterDefaultValueHigh"]="Edm.PrimitiveType";e["com.sap.vocabularies.Common.v1.SortOrder"]="com.sap.vocabularies.Common.v1.SortOrderType";e["com.sap.vocabularies.Common.v1.RecursiveHierarchy"]="com.sap.vocabularies.Common.v1.RecursiveHierarchyType";e["com.sap.vocabularies.Common.v1.CreatedAt"]="Edm.DateTimeOffset";e["com.sap.vocabularies.Common.v1.CreatedBy"]="com.sap.vocabularies.Common.v1.UserID";e["com.sap.vocabularies.Common.v1.ChangedAt"]="Edm.DateTimeOffset";e["com.sap.vocabularies.Common.v1.ChangedBy"]="com.sap.vocabularies.Common.v1.UserID";e["com.sap.vocabularies.Common.v1.ApplyMultiUnitBehaviorForSortingAndFiltering"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Common.v1.PrimitivePropertyPath"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.CodeList.v1.CurrencyCodes"]="com.sap.vocabularies.CodeList.v1.CodeListSource";e["com.sap.vocabularies.CodeList.v1.UnitsOfMeasure"]="com.sap.vocabularies.CodeList.v1.CodeListSource";e["com.sap.vocabularies.CodeList.v1.StandardCode"]="Edm.PropertyPath";e["com.sap.vocabularies.CodeList.v1.ExternalCode"]="Edm.PropertyPath";e["com.sap.vocabularies.CodeList.v1.IsConfigurationDeprecationCode"]="Edm.Boolean";e["com.sap.vocabularies.Communication.v1.Contact"]="com.sap.vocabularies.Communication.v1.ContactType";e["com.sap.vocabularies.Communication.v1.Address"]="com.sap.vocabularies.Communication.v1.AddressType";e["com.sap.vocabularies.Communication.v1.IsEmailAddress"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Communication.v1.IsPhoneNumber"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Communication.v1.Event"]="com.sap.vocabularies.Communication.v1.EventData";e["com.sap.vocabularies.Communication.v1.Task"]="com.sap.vocabularies.Communication.v1.TaskData";e["com.sap.vocabularies.Communication.v1.Message"]="com.sap.vocabularies.Communication.v1.MessageData";e["com.sap.vocabularies.Hierarchy.v1.RecursiveHierarchy"]="com.sap.vocabularies.Hierarchy.v1.RecursiveHierarchyType";e["com.sap.vocabularies.PersonalData.v1.EntitySemantics"]="com.sap.vocabularies.PersonalData.v1.EntitySemanticsType";e["com.sap.vocabularies.PersonalData.v1.FieldSemantics"]="com.sap.vocabularies.PersonalData.v1.FieldSemanticsType";e["com.sap.vocabularies.PersonalData.v1.IsPotentiallyPersonal"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.Session.v1.StickySessionSupported"]="com.sap.vocabularies.Session.v1.StickySessionSupportedType";e["com.sap.vocabularies.UI.v1.HeaderInfo"]="com.sap.vocabularies.UI.v1.HeaderInfoType";e["com.sap.vocabularies.UI.v1.Identification"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";e["com.sap.vocabularies.UI.v1.Badge"]="com.sap.vocabularies.UI.v1.BadgeType";e["com.sap.vocabularies.UI.v1.LineItem"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";e["com.sap.vocabularies.UI.v1.StatusInfo"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";e["com.sap.vocabularies.UI.v1.FieldGroup"]="com.sap.vocabularies.UI.v1.FieldGroupType";e["com.sap.vocabularies.UI.v1.ConnectedFields"]="com.sap.vocabularies.UI.v1.ConnectedFieldsType";e["com.sap.vocabularies.UI.v1.GeoLocations"]="com.sap.vocabularies.UI.v1.GeoLocationType";e["com.sap.vocabularies.UI.v1.GeoLocation"]="com.sap.vocabularies.UI.v1.GeoLocationType";e["com.sap.vocabularies.UI.v1.Contacts"]="Edm.AnnotationPath";e["com.sap.vocabularies.UI.v1.MediaResource"]="com.sap.vocabularies.UI.v1.MediaResourceType";e["com.sap.vocabularies.UI.v1.DataPoint"]="com.sap.vocabularies.UI.v1.DataPointType";e["com.sap.vocabularies.UI.v1.KPI"]="com.sap.vocabularies.UI.v1.KPIType";e["com.sap.vocabularies.UI.v1.Chart"]="com.sap.vocabularies.UI.v1.ChartDefinitionType";e["com.sap.vocabularies.UI.v1.ValueCriticality"]="com.sap.vocabularies.UI.v1.ValueCriticalityType";e["com.sap.vocabularies.UI.v1.CriticalityLabels"]="com.sap.vocabularies.UI.v1.CriticalityLabelType";e["com.sap.vocabularies.UI.v1.SelectionFields"]="Edm.PropertyPath";e["com.sap.vocabularies.UI.v1.Facets"]="com.sap.vocabularies.UI.v1.Facet";e["com.sap.vocabularies.UI.v1.HeaderFacets"]="com.sap.vocabularies.UI.v1.Facet";e["com.sap.vocabularies.UI.v1.QuickViewFacets"]="com.sap.vocabularies.UI.v1.Facet";e["com.sap.vocabularies.UI.v1.QuickCreateFacets"]="com.sap.vocabularies.UI.v1.Facet";e["com.sap.vocabularies.UI.v1.FilterFacets"]="com.sap.vocabularies.UI.v1.ReferenceFacet";e["com.sap.vocabularies.UI.v1.SelectionPresentationVariant"]="com.sap.vocabularies.UI.v1.SelectionPresentationVariantType";e["com.sap.vocabularies.UI.v1.PresentationVariant"]="com.sap.vocabularies.UI.v1.PresentationVariantType";e["com.sap.vocabularies.UI.v1.SelectionVariant"]="com.sap.vocabularies.UI.v1.SelectionVariantType";e["com.sap.vocabularies.UI.v1.ThingPerspective"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.IsSummary"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.PartOfPreview"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.Map"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.Gallery"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.IsImageURL"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.IsImage"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.MultiLineText"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.TextArrangement"]="com.sap.vocabularies.UI.v1.TextArrangementType";e["com.sap.vocabularies.UI.v1.Importance"]="com.sap.vocabularies.UI.v1.ImportanceType";e["com.sap.vocabularies.UI.v1.Hidden"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.IsCopyAction"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.CreateHidden"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.UpdateHidden"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.DeleteHidden"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.HiddenFilter"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.AdaptationHidden"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.DataFieldDefault"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";e["com.sap.vocabularies.UI.v1.Criticality"]="com.sap.vocabularies.UI.v1.CriticalityType";e["com.sap.vocabularies.UI.v1.CriticalityCalculation"]="com.sap.vocabularies.UI.v1.CriticalityCalculationType";e["com.sap.vocabularies.UI.v1.Emphasized"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.OrderBy"]="Edm.PropertyPath";e["com.sap.vocabularies.UI.v1.ParameterDefaultValue"]="Edm.PrimitiveType";e["com.sap.vocabularies.UI.v1.RecommendationState"]="com.sap.vocabularies.UI.v1.RecommendationStateType";e["com.sap.vocabularies.UI.v1.RecommendationList"]="com.sap.vocabularies.UI.v1.RecommendationListType";e["com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext"]="Org.OData.Core.V1.Tag";e["com.sap.vocabularies.UI.v1.DoNotCheckScaleOfMeasuredQuantity"]="Edm.Boolean";e["com.sap.vocabularies.HTML5.v1.CssDefaults"]="com.sap.vocabularies.HTML5.v1.CssDefaultsType"})(u=a.TermToTypes||(a.TermToTypes={}));function p(e){return!!e&&e._type==="ComplexType"&&!!e.properties}a.isComplexTypeDefinition=p;function m(e){return{isDecimal(){return true},valueOf(){return e},toString(){return e.toString()}}}a.Decimal=m;function v(e,a,t){const o=Symbol("initial");let r=o;Object.defineProperty(e,a,{enumerable:true,get(){if(r===o){r=t()}return r},set(e){r=e}})}a.lazy=v;function g(e,a){const t=new Map;return function o(r){const i=t.get(r);if((i===null||i===void 0?void 0:i[a])===r){return i}return e.find(e=>{if(!(e===null||e===void 0?void 0:e.hasOwnProperty(a))){return false}const o=e[a];t.set(o,e);return o===r})}}a.createIndexedFind=g;function y(e,a){const t=`by_${a}`;if(!e.hasOwnProperty(t)){Object.defineProperty(e,t,{writable:false,value:g(e,a)})}else{throw new Error(`Property '${t}' already exists`)}return e}a.addGetByValue=y},488:function(e,a,t){Object.defineProperty(a,"__esModule",{value:true});a.revertTermToGenericType=void 0;const o=t(534);function r(e,a){var t,o,r,i,n,s;let c;if(Array.isArray(a)){c={type:"Collection",Collection:a.map(a=>l(e,a))}}else if((t=a.isDecimal)===null||t===void 0?void 0:t.call(a)){c={type:"Decimal",Decimal:a.valueOf()}}else if((o=a.isString)===null||o===void 0?void 0:o.call(a)){const t=a.valueOf().split(".");if(t.length>1&&e.find(e=>e.alias===t[0])){c={type:"EnumMember",EnumMember:a.valueOf()}}else{c={type:"String",String:a.valueOf()}}}else if((r=a.isInt)===null||r===void 0?void 0:r.call(a)){c={type:"Int",Int:a.valueOf()}}else if((i=a.isFloat)===null||i===void 0?void 0:i.call(a)){c={type:"Float",Float:a.valueOf()}}else if((n=a.isDate)===null||n===void 0?void 0:n.call(a)){c={type:"Date",Date:a.valueOf()}}else if((s=a.isBoolean)===null||s===void 0?void 0:s.call(a)){c={type:"Bool",Bool:a.valueOf()==="true"}}else if(a.type==="Path"){c={type:"Path",Path:a.path}}else if(a.type==="AnnotationPath"){c={type:"AnnotationPath",AnnotationPath:a.value}}else if(a.type==="Apply"){c={type:"Apply",Apply:a.Apply}}else if(a.type==="Null"){c={type:"Null"}}else if(a.type==="PropertyPath"){c={type:"PropertyPath",PropertyPath:a.value}}else if(a.type==="NavigationPropertyPath"){c={type:"NavigationPropertyPath",NavigationPropertyPath:a.value}}else if(Object.prototype.hasOwnProperty.call(a,"$Type")){c={type:"Record",Record:l(e,a)}}return c}function i(e,a){let t;const o=a===null||a===void 0?void 0:a.constructor.name;switch(o){case"String":case"string":const o=a.toString().split(".");if(o.length>1&&e.find(e=>e.alias===o[0])){t={type:"EnumMember",EnumMember:a.toString()}}else{t={type:"String",String:a.toString()}}break;case"Boolean":case"boolean":t={type:"Bool",Bool:a.valueOf()};break;case"Number":case"number":if(a.toString()===a.toFixed()){t={type:"Int",Int:a.valueOf()}}else{t={type:"Decimal",Decimal:a.valueOf()}}break;case"object":default:t=r(e,a);break}return t}const n=["$Type","term","__source","qualifier","ActionTarget","fullyQualifiedName","annotations"];function s(e,a,t){Object.keys(a).filter(e=>e!=="_annotations").forEach(r=>{Object.keys(a[r]).forEach(i=>{const n=c(e,a[r][i]);if(!n.term){const a=(0,o.unalias)(e,`${r}.${i}`);if(a){const e=a.split("#");n.term=e[0];if(e.length>1){n.qualifier=e[1]}}}t.push(n)})})}function l(e,a){if(typeof a==="string"){return a}else if(typeof a==="object"){if(a.hasOwnProperty("$Type")){const t={type:a.$Type,propertyValues:[]};Object.keys(a).forEach(o=>{if(n.indexOf(o)===-1){const r=a[o];t.propertyValues.push({name:o,value:i(e,r)})}else if(o==="annotations"&&Object.keys(a[o]).length>0){t.annotations=[];s(e,a[o],t.annotations)}});return t}else if(a.type==="PropertyPath"){return{type:"PropertyPath",PropertyPath:a.value}}else if(a.type==="AnnotationPath"){return{type:"AnnotationPath",AnnotationPath:a.value}}else if(a.type==="NavigationPropertyPath"){return{type:"NavigationPropertyPath",NavigationPropertyPath:a.value}}}return undefined}function c(e,a){const t={term:a.term,qualifier:a.qualifier};if(Array.isArray(a)){if(a.hasOwnProperty("annotations")&&Object.keys(a.annotations).length>0){t.annotations=[];s(e,a.annotations,t.annotations)}return{...t,collection:a.map(a=>l(e,a))}}else if(a.hasOwnProperty("$Type")){return{...t,record:l(e,a)}}else{return{...t,value:i(e,a)}}}a.revertTermToGenericType=c}};var t={};function o(e){var r=t[e];if(r!==undefined){return r.exports}var i=t[e]={exports:{}};a[e].call(i.exports,i,i.exports,o);return i.exports}var r=o(782);e=r})();return e},true);
|
|
390
|
+
sap.ui.predefine("sap/fe/core/converters/common/AnnotationConverter", [],function(){var a;(function(){"use strict";var e={175:function(a,e,t){Object.defineProperty(e,"__esModule",{value:true});e.convert=void 0;const o=t(899);const r=t(168);const i=Symbol("Annotation Target");function n(a,e){if(a[a.length-1]!==e){a.push(e)}return a}function s(a,e,t,o){var c,l,p,m;if(t.startsWith("/")){t=t.substring(1);e=undefined}const v=t.split("/").reduce((a,e)=>{if(e.includes("@")){const[t,o]=(0,r.splitAtFirst)(e,"@");a.push(t);a.push(`@${o}`)}else{a.push(e)}return a},[]);if(e===undefined){if(v[0].startsWith(`${a.rawSchema.namespace}.`)&&v[0]!==((c=a.getConvertedEntityContainer())===null||c===void 0?void 0:c.fullyQualifiedName)){e=(p=(l=a.getConvertedEntityType(v[0]))!==null&&l!==void 0?l:a.getConvertedComplexType(v[0]))!==null&&p!==void 0?p:a.getConvertedAction(v[0]);v.shift()}else{e=a.getConvertedEntityContainer()}}else if(e[i]!==undefined){e=e[i]}else if(e._type==="Property"){const t=(0,r.substringBeforeFirst)(e.fullyQualifiedName,"/");e=(m=a.getConvertedEntityType(t))!==null&&m!==void 0?m:a.getConvertedComplexType(t)}const g=v.reduce((e,t)=>{var o,c,l,u,p;const m=a=>{e.messages.push({message:a});e.target=undefined;return e};if(e.target===undefined){return e}e.objectPath=n(e.objectPath,e.target);if(t.startsWith("@")&&t!=="@$ui5.overload"){const[r,i]=a.splitTerm(t);const n=(o=e.target.annotations[r.substring(1)])===null||o===void 0?void 0:o[i];if(n!==undefined){e.target=n;return e}return m(`Annotation '${t.substring(1)}' not found on ${e.target._type} '${e.target.fullyQualifiedName}'`)}if(e.target.$target){let o;if(t==="$AnnotationPath"){o=e.target.value}else if(t==="$Path"){o=e.target.path}if(o!==undefined){const t=s(a,e.target[i],o);t.objectPath.forEach(a=>{if(!e.objectPath.includes(a)){e.objectPath=n(e.objectPath,a)}});e.target=t.target;e.objectPath=n(e.objectPath,e.target);return e}}switch((c=e.target)===null||c===void 0?void 0:c._type){case"Schema":break;case"EntityContainer":{const o=e.target;if(t===""||a.unalias(t)===o.fullyQualifiedName){return e}const r=(u=(l=o.entitySets.by_name(t))!==null&&l!==void 0?l:o.singletons.by_name(t))!==null&&u!==void 0?u:o.actionImports.by_name(t);if(r){e.target=r;return e}}break;case"EntitySet":case"Singleton":{const o=e.target;if(t===""||t==="$Type"){e.target=o.entityType;return e}if(t==="$"){return e}if(t==="$NavigationPropertyBinding"){const a=o.navigationPropertyBinding;e.target=a;return e}const r=s(a,o.entityType,t);e.target=r.target;e.objectPath=r.objectPath.reduce(n,e.objectPath);return e}case"EntityType":{const o=e.target;if(t===""||t==="$Type"){return e}const i=o.entityProperties.by_name(t);if(i){e.target=i;return e}const n=o.navigationProperties.by_name(t);if(n){e.target=n;return e}const s=(0,r.substringBeforeFirst)(a.unalias(t),"(");const c=o.actions[s];if(c){e.target=c;return e}}break;case"ActionImport":{const o=s(a,e.target.action,t);e.target=o.target;e.objectPath=o.objectPath.reduce(n,e.objectPath);return e}case"Action":{const a=e.target;if(t===""){return e}if(t==="@$ui5.overload"||t==="0"){return e}if(t==="$Parameter"&&a.isBound){e.target=a.parameters;return e}const o=(p=a.parameters[t])!==null&&p!==void 0?p:a.parameters.find(a=>a.name===t);if(o){e.target=o;return e}break}case"Property":{const a=e.target;const o=a.targetType;if(o!==undefined){const a=o.properties.by_name(t);if(a){e.target=a;return e}const r=o.navigationProperties.by_name(t);if(r){e.target=r;return e}}}break;case"ActionParameter":const o=e.target.typeReference;if(o!==undefined){const r=s(a,o,t);e.target=r.target;e.objectPath=r.objectPath.reduce(n,e.objectPath);return e}break;case"NavigationProperty":const i=s(a,e.target.targetType,t);e.target=i.target;e.objectPath=i.objectPath.reduce(n,e.objectPath);return e;default:if(t===""){return e}if(e.target[t]){e.target=e.target[t];e.objectPath=n(e.objectPath,e.target);return e}}return m(`Element '${t}' not found at ${e.target._type} '${e.target.fullyQualifiedName}'`)},{target:e,objectPath:[],messages:[]});g.messages.forEach(e=>a.logError(e.message));if(!g.target){if(o){const r=u(a,o,e.fullyQualifiedName);a.logError("Unable to resolve the path expression: "+"\n"+t+"\n"+"\n"+"Hint: Check and correct the path values under the following structure in the metadata (annotation.xml file or CDS annotations for the application): \n\n"+"<Annotation Term = "+o+">"+"\n"+"<Record Type = "+r+">"+"\n"+"<AnnotationPath = "+t+">")}else{a.logError("Unable to resolve the path expression: "+t+"\n"+"\n"+"Hint: Check and correct the path values under the following structure in the metadata (annotation.xml file or CDS annotations for the application): \n\n"+"<Annotation Term = "+v[0]+">"+"\n"+"<PropertyValue Path= "+v[1]+">")}}return g}function c(a){return a.includes("@")}function l(a,e,t,n,l,u,p){if(u===undefined){return undefined}switch(u.type){case"String":return u.String;case"Int":return u.Int;case"Bool":return u.Bool;case"Decimal":return(0,r.Decimal)(u.Decimal);case"Date":return u.Date;case"EnumMember":const m=u.EnumMember.split(" ").map(e=>{var t;const i=(t=a.unalias(e))!==null&&t!==void 0?t:"";return(0,r.alias)(o.VocabularyReferences,i)});if(m[0]!==undefined&&r.EnumIsFlag[(0,r.substringBeforeFirst)(m[0],"/")]){return m}return m[0];case"PropertyPath":return{type:"PropertyPath",value:u.PropertyPath,fullyQualifiedName:p,$target:s(a,e,u.PropertyPath,t).target,[i]:e};case"NavigationPropertyPath":return{type:"NavigationPropertyPath",value:u.NavigationPropertyPath,fullyQualifiedName:p,$target:s(a,e,u.NavigationPropertyPath,t).target,[i]:e};case"AnnotationPath":return{type:"AnnotationPath",value:u.AnnotationPath,fullyQualifiedName:p,$target:s(a,e,a.unalias(u.AnnotationPath),t).target,annotationsTerm:t,term:"",path:"",[i]:e};case"Path":const g=s(a,e,u.Path,t).target;if(c(u.Path)){return g}else{return{type:"Path",path:u.Path,fullyQualifiedName:p,$target:g,[i]:e}}case"Record":return v(a,t,e,n,l,u.Record,p);case"Collection":return y(a,e,t,n,l,u.Collection,p);case"Apply":case"Null":case"Not":case"Eq":case"Ne":case"Gt":case"Ge":case"Lt":case"Le":case"If":case"And":case"Or":default:return u}}function u(a,e,t,o){let i=r.TermToTypes[e];if(o){e=`${(0,r.substringBeforeLast)(e,".")}.${o}`;i=r.TermToTypes[e]}a.logError(`The type of the record used within the term ${e} was not defined and was inferred as ${i}.\nHint: If possible, try to maintain the Type property for each Record.\n<Annotations Target="${t}">\n\t<Annotation Term="${e}">\n\t\t<Record>...</Record>\n\t</Annotation>\n</Annotations>`);return i}function p(a){return a.hasOwnProperty("Action")&&(a.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"||a.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithAction")}function m(a,e,t,o,r){let i;if(!r.type&&e){i=u(a,e,t.fullyQualifiedName,o)}else{i=a.unalias(r.type)}return i}function v(a,e,t,o,n,s,c){const u={$Type:m(a,e,t,o,s),fullyQualifiedName:c,[i]:t,__source:n};for(const o of s.propertyValues){(0,r.lazy)(u,o.name,()=>l(a,t,e,o.name,n,o.value,`${c}/${o.name}`))}(0,r.lazy)(u,"annotations",h(a,s,u));if(p(u)){(0,r.lazy)(u,"ActionTarget",()=>{var e,o,r;const i=a.unalias((e=u.Action)===null||e===void 0?void 0:e.toString());let n=(o=t.actions)===null||o===void 0?void 0:o[i];if(!n){n=(r=a.getConvertedActionImport(i))===null||r===void 0?void 0:r.action}if(!n){n=a.getConvertedAction(i);if(!(n===null||n===void 0?void 0:n.isBound)){n=undefined}}if(!n){a.logError(`${u.fullyQualifiedName}: Unable to resolve '${u.Action}' ('${i}')`)}return n})}return u}function g(a){let e=a.type;if(e===undefined&&a.length>0){const t=a[0];if(t.hasOwnProperty("PropertyPath")){e="PropertyPath"}else if(t.hasOwnProperty("Path")){e="Path"}else if(t.hasOwnProperty("AnnotationPath")){e="AnnotationPath"}else if(t.hasOwnProperty("NavigationPropertyPath")){e="NavigationPropertyPath"}else if(typeof t==="object"&&(t.hasOwnProperty("type")||t.hasOwnProperty("propertyValues"))){e="Record"}else if(typeof t==="string"){e="String"}}else if(e===undefined){e="EmptyCollection"}return e}function y(a,e,t,o,i,n,c){const l=g(n);switch(l){case"PropertyPath":return n.map((o,i)=>{const n={type:"PropertyPath",value:o.PropertyPath,fullyQualifiedName:`${c}/${i}`};(0,r.lazy)(n,"$target",()=>{var r;return(r=s(a,e,o.PropertyPath,t).target)!==null&&r!==void 0?r:{}});return n});case"Path":return n.map(o=>s(a,e,o.Path,t).target);case"AnnotationPath":return n.map((o,i)=>{const n={type:"AnnotationPath",value:o.AnnotationPath,fullyQualifiedName:`${c}/${i}`,annotationsTerm:t,term:"",path:""};(0,r.lazy)(n,"$target",()=>s(a,e,o.AnnotationPath,t).target);return n});case"NavigationPropertyPath":return n.map((o,i)=>{var n;const l=(n=o.NavigationPropertyPath)!==null&&n!==void 0?n:"";const u={type:"NavigationPropertyPath",value:l,fullyQualifiedName:`${c}/${i}`};if(l===""){u.$target=undefined}else{(0,r.lazy)(u,"$target",()=>s(a,e,l,t).target)}return u});case"Record":return n.map((r,n)=>v(a,t,e,o,i,r,`${c}/${n}`));case"Apply":case"Null":case"If":case"Eq":case"Ne":case"Lt":case"Gt":case"Le":case"Ge":case"Not":case"And":case"Or":return n.map(a=>a);case"String":return n.map(a=>{if(typeof a==="string"||a===undefined){return a}else{return a.String}});default:if(n.length===0){return[]}throw new Error("Unsupported case")}}function O(a){return!!a.targetTypeName}function d(a,e,t){var n;let s;if(t.record){s=v(a,t.term,e,"",t.__source,t.record,t.fullyQualifiedName)}else if(t.collection===undefined){s=l(a,e,t.term,"",t.__source,(n=t.value)!==null&&n!==void 0?n:{type:"Bool",Bool:true},t.fullyQualifiedName)}else if(t.collection){s=y(a,e,t.term,"",t.__source,t.collection,t.fullyQualifiedName)}else{throw new Error("Unsupported case")}switch(typeof s){case"string":s=new String(s);break;case"boolean":s=new Boolean(s);break;case"number":s=new Number(s);break;default:break}s.fullyQualifiedName=t.fullyQualifiedName;s[i]=e;const[c,u]=a.splitTerm(t.term);s.term=a.unalias(`${c}.${u}`,o.VocabularyReferences);s.qualifier=t.qualifier;s.__source=t.__source;try{(0,r.lazy)(s,"annotations",h(a,t,s))}catch(a){}return s}function f(a){return Object.keys(a.rawSchema.annotations).reduceRight((e,t)=>{for(const{target:o,annotations:r}of a.rawSchema.annotations[t]){if(!e[o]){e[o]=[]}e[o].push(...r.filter(a=>!e[o].some(e=>e.term===a.term&&e.qualifier===a.qualifier)).map(e=>{let r=`${o}@${a.unalias(e.term)}`;if(e.qualifier){r=`${r}#${e.qualifier}`}const i=e;i.fullyQualifiedName=r;i.__source=t;return i}))}return e},{})}class C{getAnnotations(a){var e;if(this.annotationsByTarget===undefined){this.annotationsByTarget=f(this)}return(e=this.annotationsByTarget[a])!==null&&e!==void 0?e:[]}getConvertedEntityContainer(){return this.getConvertedElement(this.rawMetadata.schema.entityContainer.fullyQualifiedName,this.rawMetadata.schema.entityContainer,P)}getConvertedEntitySet(a){return this.convertedOutput.entitySets.by_fullyQualifiedName(a)}getConvertedSingleton(a){return this.convertedOutput.singletons.by_fullyQualifiedName(a)}getConvertedEntityType(a){return this.convertedOutput.entityTypes.by_fullyQualifiedName(a)}getConvertedComplexType(a){return this.convertedOutput.complexTypes.by_fullyQualifiedName(a)}getConvertedTypeDefinition(a){return this.convertedOutput.typeDefinitions.by_fullyQualifiedName(a)}getConvertedActionImport(a){let e=this.convertedOutput.actionImports.by_fullyQualifiedName(a);if(!e){e=this.convertedOutput.actionImports.by_name(a)}return e}getConvertedAction(a){return this.convertedOutput.actions.by_fullyQualifiedName(a)}convert(a,e){if(Array.isArray(a)){return()=>{const t=a.reduce((a,t)=>{const o=this.getConvertedElement(t.fullyQualifiedName,t,e);if(o){a.push(o)}return a},[]);(0,r.addGetByValue)(t,"name");(0,r.addGetByValue)(t,"fullyQualifiedName");return t}}else{return()=>this.getConvertedElement(a.fullyQualifiedName,a,e)}}constructor(a,e){this.convertedElements=new Map;this.rawMetadata=a;this.rawSchema=a.schema;this.convertedOutput=e}getConvertedElement(a,e,t){let o=this.convertedElements.get(a);if(o===undefined){const r=typeof e==="function"?e.apply(undefined,[a]):e;if(r!==undefined){o=t.apply(undefined,[this,r]);this.convertedElements.set(a,o)}}return o}logError(a){this.convertedOutput.diagnostics.push({message:a})}splitTerm(a){const e=(0,r.alias)(o.VocabularyReferences,a);return(0,r.splitAtLast)(e,".")}unalias(a,e=this.rawMetadata.references){var t;return(t=(0,r.unalias)(e,a,this.rawSchema.namespace))!==null&&t!==void 0?t:""}}function b(a,e){return()=>{let t=a.getConvertedEntityType(e);if(!t){a.logError(`EntityType '${e}' not found`);t={}}return t}}function D(a,e,t){return()=>Object.keys(e).reduce((o,i)=>{const n=e[i];(0,r.lazy)(o,i,()=>{let e;if(n._type==="Singleton"){e=a.getConvertedSingleton(n.fullyQualifiedName)}else{e=a.getConvertedEntitySet(n.fullyQualifiedName)}if(!e){a.logError(`${t._type} '${t.fullyQualifiedName}': Failed to resolve NavigationPropertyBinding ${i}`);e={}}return e});return o},{})}function T(a,e){const t=e.annotations;return()=>V(a,e,t!==null&&t!==void 0?t:a.getAnnotations(e.fullyQualifiedName))}function h(a,e,t){return()=>{const o=t.fullyQualifiedName;let r;if(e.annotations&&e.annotations.length>0){r=e.annotations}else{r=a.getAnnotations(o)}r===null||r===void 0?void 0:r.forEach(a=>{a.target=o;a.__source=t.__source;a[i]=t[i];a.fullyQualifiedName=`${o}@${a.term}`});return V(a,t,r!==null&&r!==void 0?r:[])}}function V(a,e,t){return t.reduce((t,o)=>{const[i,n]=a.splitTerm(o.term);const s=`${n}${o.qualifier?"#"+o.qualifier:""}`;if(t[i]===undefined){t[i]={}}if(!t[i].hasOwnProperty(s)){(0,r.lazy)(t[i],s,()=>a.getConvertedElement(o.fullyQualifiedName,o,(a,t)=>d(a,e,t)))}return t},{})}function P(a,e){const t=e;(0,r.lazy)(t,"annotations",T(a,e));(0,r.lazy)(t,"entitySets",a.convert(a.rawSchema.entitySets,A));(0,r.lazy)(t,"singletons",a.convert(a.rawSchema.singletons,I));(0,r.lazy)(t,"actionImports",a.convert(a.rawSchema.actionImports,N));return t}function I(a,e){const t=e;(0,r.lazy)(t,"entityType",b(a,e.entityTypeName));(0,r.lazy)(t,"annotations",T(a,e));const o=e.navigationPropertyBinding;(0,r.lazy)(t,"navigationPropertyBinding",D(a,o,e));return t}function A(a,e){const t=e;(0,r.lazy)(t,"entityType",b(a,e.entityTypeName));(0,r.lazy)(t,"annotations",T(a,e));const o=e.navigationPropertyBinding;(0,r.lazy)(t,"navigationPropertyBinding",D(a,o,e));return t}function S(a,e){const t=e;e.keys.forEach(a=>{a.isKey=true});(0,r.lazy)(t,"annotations",T(a,e));(0,r.lazy)(t,"keys",a.convert(e.keys,E));(0,r.lazy)(t,"entityProperties",a.convert(e.entityProperties,E));(0,r.lazy)(t,"navigationProperties",a.convert(e.navigationProperties,U));(0,r.lazy)(t,"actions",()=>a.rawSchema.actions.filter(a=>a.isBound&&(a.sourceType===e.fullyQualifiedName||a.sourceType===`Collection(${e.fullyQualifiedName})`)).reduce((e,t)=>{const o=`${a.rawSchema.namespace}.${t.name}`;e[o]=a.getConvertedAction(t.fullyQualifiedName);return e},{}));t.resolvePath=(t,o)=>{const r=s(a,e,t);if(o){return{target:r.target,visitedObjects:r.objectPath,messages:r.messages}}else{return r.target}};return t}function E(a,e){const t=e;(0,r.lazy)(t,"annotations",T(a,e));(0,r.lazy)(t,"targetType",()=>{var t;const o=e.type;const r=o.startsWith("Collection")?o.substring(11,o.length-1):o;return(t=a.getConvertedComplexType(r))!==null&&t!==void 0?t:a.getConvertedTypeDefinition(r)});return t}function U(a,e){var t,o,i;const n=e;n.referentialConstraint=(t=n.referentialConstraint)!==null&&t!==void 0?t:[];if(!O(e)){const t=(o=a.rawSchema.associations.find(a=>a.fullyQualifiedName===e.relationship))===null||o===void 0?void 0:o.associationEnd.find(a=>a.role===e.toRole);n.isCollection=(t===null||t===void 0?void 0:t.multiplicity)==="*";n.targetTypeName=(i=t===null||t===void 0?void 0:t.type)!==null&&i!==void 0?i:""}(0,r.lazy)(n,"targetType",b(a,e.targetTypeName));(0,r.lazy)(n,"annotations",T(a,e));return n}function N(a,e){const t=e;(0,r.lazy)(t,"annotations",T(a,e));(0,r.lazy)(t,"action",()=>a.getConvertedAction(e.actionName));return t}function R(a,e){const t=e;if(t.sourceType){(0,r.lazy)(t,"sourceEntityType",b(a,e.sourceType))}if(t.returnType){(0,r.lazy)(t,"returnEntityType",b(a,e.returnType))}(0,r.lazy)(t,"parameters",a.convert(e.parameters,x));(0,r.lazy)(t,"annotations",()=>{const t=(0,r.substringBeforeFirst)(e.fullyQualifiedName,"(");const o=e.isBound?e.fullyQualifiedName:`${e.fullyQualifiedName}()`;const i=a.getAnnotations(o);const n=a.getAnnotations(t);for(const a of n){if(!i.some(e=>e.term===a.term&&e.qualifier===a.qualifier)){i.push(a)}}return V(a,e,i)});return t}function x(a,e){const t=e;(0,r.lazy)(t,"typeReference",()=>{var t,o;return(o=(t=a.getConvertedEntityType(e.type))!==null&&t!==void 0?t:a.getConvertedComplexType(e.type))!==null&&o!==void 0?o:a.getConvertedTypeDefinition(e.type)});(0,r.lazy)(t,"annotations",T(a,e));return t}function $(a,e){const t=e;(0,r.lazy)(t,"properties",a.convert(e.properties,E));(0,r.lazy)(t,"navigationProperties",a.convert(e.navigationProperties,U));(0,r.lazy)(t,"annotations",T(a,e));return t}function F(a,e){const t=e;(0,r.lazy)(t,"annotations",T(a,e));return t}function M(a){const e={version:a.version,namespace:a.schema.namespace,annotations:a.schema.annotations,references:o.VocabularyReferences.concat(a.references),diagnostics:[]};if(a.references.length===0){a.references=o.VocabularyReferences}const t=new C(a,e);(0,r.lazy)(e,"entityContainer",t.convert(t.rawSchema.entityContainer,P));(0,r.lazy)(e,"entitySets",t.convert(t.rawSchema.entitySets,A));(0,r.lazy)(e,"singletons",t.convert(t.rawSchema.singletons,I));(0,r.lazy)(e,"entityTypes",t.convert(t.rawSchema.entityTypes,S));(0,r.lazy)(e,"actions",t.convert(t.rawSchema.actions,R));(0,r.lazy)(e,"complexTypes",t.convert(t.rawSchema.complexTypes,$));(0,r.lazy)(e,"actionImports",t.convert(t.rawSchema.actionImports,N));(0,r.lazy)(e,"typeDefinitions",t.convert(t.rawSchema.typeDefinitions,F));e.resolvePath=function a(e){const o=s(t,undefined,e);if(o.target){n(o.objectPath,o.target)}return o};return e}e.convert=M},878:function(a,e,t){var o=this&&this.__createBinding||(Object.create?function(a,e,t,o){if(o===undefined)o=t;var r=Object.getOwnPropertyDescriptor(e,t);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(a,o,r)}:function(a,e,t,o){if(o===undefined)o=t;a[o]=e[t]});var r=this&&this.__exportStar||function(a,e){for(var t in a)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t))o(e,a,t)};Object.defineProperty(e,"__esModule",{value:true});r(t(175),e);r(t(168),e);r(t(311),e)},168:function(a,e,t){Object.defineProperty(e,"__esModule",{value:true});e.addGetByValue=e.createIndexedFind=e.lazy=e.Decimal=e.isComplexTypeDefinition=e.unalias=e.alias=e.substringBeforeLast=e.substringBeforeFirst=e.splitAtLast=e.splitAtFirst=e.defaultReferences=e.TermToTypes=e.EnumIsFlag=void 0;var o=t(830);Object.defineProperty(e,"EnumIsFlag",{enumerable:true,get:function(){return o.EnumIsFlag}});var r=t(377);Object.defineProperty(e,"TermToTypes",{enumerable:true,get:function(){return r.TermToTypes}});var i=t(899);Object.defineProperty(e,"defaultReferences",{enumerable:true,get:function(){return i.VocabularyReferences}});function n(a,e){return e<0?[a,""]:[a.substring(0,e),a.substring(e+1)]}function s(a,e){return e<0?a:a.substring(0,e)}function c(a,e){return n(a,a.indexOf(e))}e.splitAtFirst=c;function l(a,e){return n(a,a.lastIndexOf(e))}e.splitAtLast=l;function u(a,e){return s(a,a.indexOf(e))}e.substringBeforeFirst=u;function p(a,e){return s(a,a.lastIndexOf(e))}e.substringBeforeLast=p;function m(a,e){if(!a.reverseReferenceMap){a.reverseReferenceMap=a.reduce((a,e)=>{a[e.namespace]=e;return a},{})}if(!e){return e}const[t,o]=l(e,".");const r=a.reverseReferenceMap[t];if(r){return`${r.alias}.${o}`}else if(e.includes("@")){const[t,o]=c(e,"@");return`${t}@${m(a,o)}`}else{return e}}e.alias=m;function v(a,e,t){var o;const r=e=>{if(!a.referenceMap){a.referenceMap=Object.fromEntries(a.map(a=>[a.alias,a]))}const[o,r]=c(e,".");if(!r||r.includes(".")){return e}const i=o.startsWith("@");const n=i?o.substring(1):o;const s=a.referenceMap[n];if(s){return i?`@${s.namespace}.${r}`:`${s.namespace}.${r}`}return t&&!i?`${t}.${r}`:e};return(o=e===null||e===void 0?void 0:e.split("/").reduce((a,e)=>{const[t,o]=c(e,"(");const i=[r(t)];if(o){const a=o.slice(0,-1);i.push(`(${r(a)})`)}a.push(i.join(""));return a},[]))===null||o===void 0?void 0:o.join("/")}e.unalias=v;function g(a){return!!a&&a._type==="ComplexType"&&!!a.properties}e.isComplexTypeDefinition=g;function y(a){return{isDecimal(){return true},valueOf(){return a},toString(){return a.toString()}}}e.Decimal=y;function O(a,e,t){const o=Symbol("initial");let r=o;Object.defineProperty(a,e,{enumerable:true,get(){if(r===o){r=t()}return r},set(a){r=a}})}e.lazy=O;function d(a,e){const t=new Map;return function o(r){const i=t.get(r);if((i===null||i===void 0?void 0:i[e])===r){return i}return a.find(a=>{if(!(a===null||a===void 0?void 0:a.hasOwnProperty(e))){return false}const o=a[e];t.set(o,a);return o===r})}}e.createIndexedFind=d;function f(a,e){const t=`by_${e}`;if(!a.hasOwnProperty(t)){Object.defineProperty(a,t,{writable:false,value:d(a,e)})}else{throw new Error(`Property '${t}' already exists`)}return a}e.addGetByValue=f},311:function(a,e,t){Object.defineProperty(e,"__esModule",{value:true});e.revertTermToGenericType=void 0;const o=t(168);function r(a,e){var t,o,r,i,n,s;let l;if(Array.isArray(e)){l={type:"Collection",Collection:e.map(e=>c(a,e))}}else if((t=e.isDecimal)===null||t===void 0?void 0:t.call(e)){l={type:"Decimal",Decimal:e.valueOf()}}else if((o=e.isString)===null||o===void 0?void 0:o.call(e)){const t=e.valueOf().split(".");if(t.length>1&&a.find(a=>a.alias===t[0])){l={type:"EnumMember",EnumMember:e.valueOf()}}else{l={type:"String",String:e.valueOf()}}}else if((r=e.isInt)===null||r===void 0?void 0:r.call(e)){l={type:"Int",Int:e.valueOf()}}else if((i=e.isFloat)===null||i===void 0?void 0:i.call(e)){l={type:"Float",Float:e.valueOf()}}else if((n=e.isDate)===null||n===void 0?void 0:n.call(e)){l={type:"Date",Date:e.valueOf()}}else if((s=e.isBoolean)===null||s===void 0?void 0:s.call(e)){l={type:"Bool",Bool:e.valueOf()}}else if(e.type==="Path"){l={type:"Path",Path:e.path}}else if(e.type==="AnnotationPath"){l={type:"AnnotationPath",AnnotationPath:e.value}}else if(e.type==="Apply"){l={type:"Apply",Apply:e.Apply}}else if(e.type==="Null"){l={type:"Null"}}else if(e.type==="PropertyPath"){l={type:"PropertyPath",PropertyPath:e.value}}else if(e.type==="NavigationPropertyPath"){l={type:"NavigationPropertyPath",NavigationPropertyPath:e.value}}else if(Object.prototype.hasOwnProperty.call(e,"$Type")){l={type:"Record",Record:c(a,e)}}return l}function i(a,e){let t;const o=e===null||e===void 0?void 0:e.constructor.name;switch(o){case"String":case"string":const o=e.toString().split(".");if(o.length>1&&a.find(a=>a.alias===o[0])){t={type:"EnumMember",EnumMember:e.toString()}}else{t={type:"String",String:e.toString()}}break;case"Boolean":case"boolean":t={type:"Bool",Bool:e.valueOf()};break;case"Number":case"number":if(e.toString()===e.toFixed()){t={type:"Int",Int:e.valueOf()}}else{t={type:"Decimal",Decimal:e.valueOf()}}break;case"object":default:t=r(a,e);break}return t}const n=["$Type","term","__source","qualifier","ActionTarget","fullyQualifiedName","annotations"];function s(a,e,t){Object.keys(e).filter(a=>a!=="_annotations").forEach(r=>{Object.keys(e[r]).forEach(i=>{const n=l(a,e[r][i]);if(!n.term){const e=(0,o.unalias)(a,`${r}.${i}`);if(e){const a=e.split("#");n.term=a[0];if(a.length>1){n.qualifier=a[1]}}}t.push(n)})})}function c(a,e){if(typeof e==="string"){return e}else if(typeof e==="object"){if(e.hasOwnProperty("$Type")){const t={type:e.$Type,propertyValues:[]};Object.keys(e).forEach(o=>{if(n.indexOf(o)===-1){const r=e[o];t.propertyValues.push({name:o,value:i(a,r)})}else if(o==="annotations"&&Object.keys(e[o]).length>0){t.annotations=[];s(a,e[o],t.annotations)}});return t}else if(e.type==="PropertyPath"){return{type:"PropertyPath",PropertyPath:e.value}}else if(e.type==="AnnotationPath"){return{type:"AnnotationPath",AnnotationPath:e.value}}else if(e.type==="NavigationPropertyPath"){return{type:"NavigationPropertyPath",NavigationPropertyPath:e.value}}}return undefined}function l(a,e){const t={term:e.term,qualifier:e.qualifier};if(Array.isArray(e)){if(e.hasOwnProperty("annotations")&&Object.keys(e.annotations).length>0){t.annotations=[];s(a,e.annotations,t.annotations)}return{...t,collection:e.map(e=>c(a,e))}}else if(e.hasOwnProperty("$Type")){return{...t,record:c(a,e)}}else{return{...t,value:i(a,e)}}}e.revertTermToGenericType=l},830:function(a,e){Object.defineProperty(e,"__esModule",{value:true});e.EnumIsFlag=void 0;e.EnumIsFlag={"Auth.KeyLocation":false,"Core.RevisionKind":false,"Core.DataModificationOperationKind":false,"Core.Permission":true,"Capabilities.ConformanceLevelType":false,"Capabilities.IsolationLevel":true,"Capabilities.NavigationType":false,"Capabilities.SearchExpressions":true,"Capabilities.HttpMethod":true,"Aggregation.RollupType":false,"Common.TextFormatType":false,"Common.FilterExpressionType":false,"Common.FieldControlType":false,"Common.EffectType":true,"Communication.KindType":false,"Communication.ContactInformationType":true,"Communication.PhoneType":true,"Communication.GenderType":false,"UI.VisualizationType":false,"UI.CriticalityType":false,"UI.ImprovementDirectionType":false,"UI.TrendType":false,"UI.ChartType":false,"UI.ChartAxisScaleBehaviorType":false,"UI.ChartAxisAutoScaleDataScopeType":false,"UI.ChartDimensionRoleType":false,"UI.ChartMeasureRoleType":false,"UI.SelectionRangeSignType":false,"UI.SelectionRangeOptionType":false,"UI.TextArrangementType":false,"UI.ImportanceType":false,"UI.CriticalityRepresentationType":false,"UI.OperationGroupingType":false}},377:function(a,e){Object.defineProperty(e,"__esModule",{value:true});e.TermToTypes=void 0;var t;(function(a){a["Org.OData.Authorization.V1.SecuritySchemes"]="Org.OData.Authorization.V1.SecurityScheme";a["Org.OData.Authorization.V1.Authorizations"]="Org.OData.Authorization.V1.Authorization";a["Org.OData.Core.V1.Revisions"]="Org.OData.Core.V1.RevisionType";a["Org.OData.Core.V1.Links"]="Org.OData.Core.V1.Link";a["Org.OData.Core.V1.Example"]="Org.OData.Core.V1.ExampleValue";a["Org.OData.Core.V1.Messages"]="Org.OData.Core.V1.MessageType";a["Org.OData.Core.V1.ValueException"]="Org.OData.Core.V1.ValueExceptionType";a["Org.OData.Core.V1.ResourceException"]="Org.OData.Core.V1.ResourceExceptionType";a["Org.OData.Core.V1.DataModificationException"]="Org.OData.Core.V1.DataModificationExceptionType";a["Org.OData.Core.V1.IsLanguageDependent"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.AppliesViaContainer"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.DereferenceableIDs"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.ConventionalIDs"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.Permissions"]="Org.OData.Core.V1.Permission";a["Org.OData.Core.V1.DefaultNamespace"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.Immutable"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.Computed"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.ComputedDefaultValue"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.IsURL"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.IsMediaType"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.ContentDisposition"]="Org.OData.Core.V1.ContentDispositionType";a["Org.OData.Core.V1.OptimisticConcurrency"]="Edm.PropertyPath";a["Org.OData.Core.V1.AdditionalProperties"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.AutoExpand"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.AutoExpandReferences"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.MayImplement"]="Org.OData.Core.V1.QualifiedTypeName";a["Org.OData.Core.V1.Ordered"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.PositionalInsert"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.AlternateKeys"]="Org.OData.Core.V1.AlternateKey";a["Org.OData.Core.V1.OptionalParameter"]="Org.OData.Core.V1.OptionalParameterType";a["Org.OData.Core.V1.OperationAvailable"]="Edm.Boolean";a["Org.OData.Core.V1.RequiresExplicitBinding"]="Org.OData.Core.V1.Tag";a["Org.OData.Core.V1.ExplicitOperationBindings"]="Org.OData.Core.V1.QualifiedBoundOperationName";a["Org.OData.Core.V1.SymbolicName"]="Org.OData.Core.V1.SimpleIdentifier";a["Org.OData.Core.V1.GeometryFeature"]="Org.OData.Core.V1.GeometryFeatureType";a["Org.OData.Capabilities.V1.ConformanceLevel"]="Org.OData.Capabilities.V1.ConformanceLevelType";a["Org.OData.Capabilities.V1.AsynchronousRequestsSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.BatchContinueOnErrorSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.IsolationSupported"]="Org.OData.Capabilities.V1.IsolationLevel";a["Org.OData.Capabilities.V1.CrossJoinSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.CallbackSupported"]="Org.OData.Capabilities.V1.CallbackType";a["Org.OData.Capabilities.V1.ChangeTracking"]="Org.OData.Capabilities.V1.ChangeTrackingType";a["Org.OData.Capabilities.V1.CountRestrictions"]="Org.OData.Capabilities.V1.CountRestrictionsType";a["Org.OData.Capabilities.V1.NavigationRestrictions"]="Org.OData.Capabilities.V1.NavigationRestrictionsType";a["Org.OData.Capabilities.V1.IndexableByKey"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.TopSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.SkipSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.ComputeSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.SelectSupport"]="Org.OData.Capabilities.V1.SelectSupportType";a["Org.OData.Capabilities.V1.BatchSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.BatchSupport"]="Org.OData.Capabilities.V1.BatchSupportType";a["Org.OData.Capabilities.V1.FilterRestrictions"]="Org.OData.Capabilities.V1.FilterRestrictionsType";a["Org.OData.Capabilities.V1.SortRestrictions"]="Org.OData.Capabilities.V1.SortRestrictionsType";a["Org.OData.Capabilities.V1.ExpandRestrictions"]="Org.OData.Capabilities.V1.ExpandRestrictionsType";a["Org.OData.Capabilities.V1.SearchRestrictions"]="Org.OData.Capabilities.V1.SearchRestrictionsType";a["Org.OData.Capabilities.V1.KeyAsSegmentSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.QuerySegmentSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.InsertRestrictions"]="Org.OData.Capabilities.V1.InsertRestrictionsType";a["Org.OData.Capabilities.V1.DeepInsertSupport"]="Org.OData.Capabilities.V1.DeepInsertSupportType";a["Org.OData.Capabilities.V1.UpdateRestrictions"]="Org.OData.Capabilities.V1.UpdateRestrictionsType";a["Org.OData.Capabilities.V1.DeepUpdateSupport"]="Org.OData.Capabilities.V1.DeepUpdateSupportType";a["Org.OData.Capabilities.V1.DeleteRestrictions"]="Org.OData.Capabilities.V1.DeleteRestrictionsType";a["Org.OData.Capabilities.V1.CollectionPropertyRestrictions"]="Org.OData.Capabilities.V1.CollectionPropertyRestrictionsType";a["Org.OData.Capabilities.V1.OperationRestrictions"]="Org.OData.Capabilities.V1.OperationRestrictionsType";a["Org.OData.Capabilities.V1.AnnotationValuesInQuerySupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Capabilities.V1.ModificationQueryOptions"]="Org.OData.Capabilities.V1.ModificationQueryOptionsType";a["Org.OData.Capabilities.V1.ReadRestrictions"]="Org.OData.Capabilities.V1.ReadRestrictionsType";a["Org.OData.Capabilities.V1.CustomHeaders"]="Org.OData.Capabilities.V1.CustomParameter";a["Org.OData.Capabilities.V1.CustomQueryOptions"]="Org.OData.Capabilities.V1.CustomParameter";a["Org.OData.Capabilities.V1.MediaLocationUpdateSupported"]="Org.OData.Core.V1.Tag";a["Org.OData.Aggregation.V1.ApplySupported"]="Org.OData.Aggregation.V1.ApplySupportedType";a["Org.OData.Aggregation.V1.ApplySupportedDefaults"]="Org.OData.Aggregation.V1.ApplySupportedBase";a["Org.OData.Aggregation.V1.Groupable"]="Org.OData.Core.V1.Tag";a["Org.OData.Aggregation.V1.Aggregatable"]="Org.OData.Core.V1.Tag";a["Org.OData.Aggregation.V1.ContextDefiningProperties"]="Edm.PropertyPath";a["Org.OData.Aggregation.V1.LeveledHierarchy"]="Edm.PropertyPath";a["Org.OData.Aggregation.V1.RecursiveHierarchy"]="Org.OData.Aggregation.V1.RecursiveHierarchyType";a["Org.OData.Aggregation.V1.AvailableOnAggregates"]="Org.OData.Aggregation.V1.AvailableOnAggregatesType";a["Org.OData.Validation.V1.Minimum"]="Edm.PrimitiveType";a["Org.OData.Validation.V1.Maximum"]="Edm.PrimitiveType";a["Org.OData.Validation.V1.Exclusive"]="Org.OData.Core.V1.Tag";a["Org.OData.Validation.V1.AllowedValues"]="Org.OData.Validation.V1.AllowedValue";a["Org.OData.Validation.V1.MultipleOf"]="Edm.Decimal";a["Org.OData.Validation.V1.Constraint"]="Org.OData.Validation.V1.ConstraintType";a["Org.OData.Validation.V1.ItemsOf"]="Org.OData.Validation.V1.ItemsOfType";a["Org.OData.Validation.V1.OpenPropertyTypeConstraint"]="Org.OData.Validation.V1.SingleOrCollectionType";a["Org.OData.Validation.V1.DerivedTypeConstraint"]="Org.OData.Validation.V1.SingleOrCollectionType";a["Org.OData.Validation.V1.AllowedTerms"]="Org.OData.Core.V1.QualifiedTermName";a["Org.OData.Validation.V1.ApplicableTerms"]="Org.OData.Core.V1.QualifiedTermName";a["Org.OData.Validation.V1.MaxItems"]="Edm.Int64";a["Org.OData.Validation.V1.MinItems"]="Edm.Int64";a["Org.OData.Measures.V1.Scale"]="Edm.Byte";a["Org.OData.Measures.V1.DurationGranularity"]="Org.OData.Measures.V1.DurationGranularityType";a["com.sap.vocabularies.Analytics.v1.Dimension"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Analytics.v1.Measure"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Analytics.v1.AccumulativeMeasure"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Analytics.v1.RolledUpPropertyCount"]="Edm.Int16";a["com.sap.vocabularies.Analytics.v1.PlanningAction"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Analytics.v1.AggregatedProperties"]="com.sap.vocabularies.Analytics.v1.AggregatedPropertyType";a["com.sap.vocabularies.Analytics.v1.AggregatedProperty"]="com.sap.vocabularies.Analytics.v1.AggregatedPropertyType";a["com.sap.vocabularies.Analytics.v1.AnalyticalContext"]="com.sap.vocabularies.Analytics.v1.AnalyticalContextType";a["com.sap.vocabularies.Common.v1.ServiceVersion"]="Edm.Int32";a["com.sap.vocabularies.Common.v1.ServiceSchemaVersion"]="Edm.Int32";a["com.sap.vocabularies.Common.v1.TextFor"]="Edm.PropertyPath";a["com.sap.vocabularies.Common.v1.IsLanguageIdentifier"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.TextFormat"]="com.sap.vocabularies.Common.v1.TextFormatType";a["com.sap.vocabularies.Common.v1.IsTimezone"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsDigitSequence"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsUpperCase"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCurrency"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsUnit"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.UnitSpecificScale"]="Edm.PrimitiveType";a["com.sap.vocabularies.Common.v1.UnitSpecificPrecision"]="Edm.PrimitiveType";a["com.sap.vocabularies.Common.v1.SecondaryKey"]="Edm.PropertyPath";a["com.sap.vocabularies.Common.v1.MinOccurs"]="Edm.Int64";a["com.sap.vocabularies.Common.v1.MaxOccurs"]="Edm.Int64";a["com.sap.vocabularies.Common.v1.AssociationEntity"]="Edm.NavigationPropertyPath";a["com.sap.vocabularies.Common.v1.DerivedNavigation"]="Edm.NavigationPropertyPath";a["com.sap.vocabularies.Common.v1.Masked"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.RevealOnDemand"]="Edm.Boolean";a["com.sap.vocabularies.Common.v1.SemanticObjectMapping"]="com.sap.vocabularies.Common.v1.SemanticObjectMappingType";a["com.sap.vocabularies.Common.v1.IsInstanceAnnotation"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"]="com.sap.vocabularies.Common.v1.FilterExpressionRestrictionType";a["com.sap.vocabularies.Common.v1.FieldControl"]="com.sap.vocabularies.Common.v1.FieldControlType";a["com.sap.vocabularies.Common.v1.Application"]="com.sap.vocabularies.Common.v1.ApplicationType";a["com.sap.vocabularies.Common.v1.Timestamp"]="Edm.DateTimeOffset";a["com.sap.vocabularies.Common.v1.ErrorResolution"]="com.sap.vocabularies.Common.v1.ErrorResolutionType";a["com.sap.vocabularies.Common.v1.Messages"]="Edm.ComplexType";a["com.sap.vocabularies.Common.v1.numericSeverity"]="com.sap.vocabularies.Common.v1.NumericMessageSeverityType";a["com.sap.vocabularies.Common.v1.MaximumNumericMessageSeverity"]="com.sap.vocabularies.Common.v1.NumericMessageSeverityType";a["com.sap.vocabularies.Common.v1.IsActionCritical"]="Edm.Boolean";a["com.sap.vocabularies.Common.v1.Attributes"]="Edm.PropertyPath";a["com.sap.vocabularies.Common.v1.RelatedRecursiveHierarchy"]="Edm.AnnotationPath";a["com.sap.vocabularies.Common.v1.Interval"]="com.sap.vocabularies.Common.v1.IntervalType";a["com.sap.vocabularies.Common.v1.ResultContext"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.SAPObjectNodeType"]="com.sap.vocabularies.Common.v1.SAPObjectNodeTypeType";a["com.sap.vocabularies.Common.v1.Composition"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsNaturalPerson"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.ValueList"]="com.sap.vocabularies.Common.v1.ValueListType";a["com.sap.vocabularies.Common.v1.ValueListRelevantQualifiers"]="Org.OData.Core.V1.SimpleIdentifier";a["com.sap.vocabularies.Common.v1.ValueListWithFixedValues"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.ValueListMapping"]="com.sap.vocabularies.Common.v1.ValueListMappingType";a["com.sap.vocabularies.Common.v1.IsCalendarYear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarHalfyear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarQuarter"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarMonth"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarWeek"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsDayOfCalendarMonth"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsDayOfCalendarYear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarYearHalfyear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarYearQuarter"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarYearMonth"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarYearWeek"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsCalendarDate"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalYear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalPeriod"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalYearPeriod"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalQuarter"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalYearQuarter"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalWeek"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalYearWeek"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsDayOfFiscalYear"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.IsFiscalYearVariant"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.MutuallyExclusiveTerm"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.DraftRoot"]="com.sap.vocabularies.Common.v1.DraftRootType";a["com.sap.vocabularies.Common.v1.DraftNode"]="com.sap.vocabularies.Common.v1.DraftNodeType";a["com.sap.vocabularies.Common.v1.DraftActivationVia"]="Org.OData.Core.V1.SimpleIdentifier";a["com.sap.vocabularies.Common.v1.EditableFieldFor"]="Edm.PropertyPath";a["com.sap.vocabularies.Common.v1.SemanticKey"]="Edm.PropertyPath";a["com.sap.vocabularies.Common.v1.SideEffects"]="com.sap.vocabularies.Common.v1.SideEffectsType";a["com.sap.vocabularies.Common.v1.DefaultValuesFunction"]="com.sap.vocabularies.Common.v1.QualifiedName";a["com.sap.vocabularies.Common.v1.FilterDefaultValue"]="Edm.PrimitiveType";a["com.sap.vocabularies.Common.v1.FilterDefaultValueHigh"]="Edm.PrimitiveType";a["com.sap.vocabularies.Common.v1.SortOrder"]="com.sap.vocabularies.Common.v1.SortOrderType";a["com.sap.vocabularies.Common.v1.RecursiveHierarchy"]="com.sap.vocabularies.Common.v1.RecursiveHierarchyType";a["com.sap.vocabularies.Common.v1.CreatedAt"]="Edm.DateTimeOffset";a["com.sap.vocabularies.Common.v1.CreatedBy"]="com.sap.vocabularies.Common.v1.UserID";a["com.sap.vocabularies.Common.v1.ChangedAt"]="Edm.DateTimeOffset";a["com.sap.vocabularies.Common.v1.ChangedBy"]="com.sap.vocabularies.Common.v1.UserID";a["com.sap.vocabularies.Common.v1.ApplyMultiUnitBehaviorForSortingAndFiltering"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Common.v1.PrimitivePropertyPath"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.CodeList.v1.CurrencyCodes"]="com.sap.vocabularies.CodeList.v1.CodeListSource";a["com.sap.vocabularies.CodeList.v1.UnitsOfMeasure"]="com.sap.vocabularies.CodeList.v1.CodeListSource";a["com.sap.vocabularies.CodeList.v1.StandardCode"]="Edm.PropertyPath";a["com.sap.vocabularies.CodeList.v1.ExternalCode"]="Edm.PropertyPath";a["com.sap.vocabularies.CodeList.v1.IsConfigurationDeprecationCode"]="Edm.Boolean";a["com.sap.vocabularies.Communication.v1.Contact"]="com.sap.vocabularies.Communication.v1.ContactType";a["com.sap.vocabularies.Communication.v1.Address"]="com.sap.vocabularies.Communication.v1.AddressType";a["com.sap.vocabularies.Communication.v1.IsEmailAddress"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Communication.v1.IsPhoneNumber"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Communication.v1.Event"]="com.sap.vocabularies.Communication.v1.EventData";a["com.sap.vocabularies.Communication.v1.Task"]="com.sap.vocabularies.Communication.v1.TaskData";a["com.sap.vocabularies.Communication.v1.Message"]="com.sap.vocabularies.Communication.v1.MessageData";a["com.sap.vocabularies.Hierarchy.v1.RecursiveHierarchy"]="com.sap.vocabularies.Hierarchy.v1.RecursiveHierarchyType";a["com.sap.vocabularies.PersonalData.v1.EntitySemantics"]="com.sap.vocabularies.PersonalData.v1.EntitySemanticsType";a["com.sap.vocabularies.PersonalData.v1.FieldSemantics"]="com.sap.vocabularies.PersonalData.v1.FieldSemanticsType";a["com.sap.vocabularies.PersonalData.v1.IsPotentiallyPersonal"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.Session.v1.StickySessionSupported"]="com.sap.vocabularies.Session.v1.StickySessionSupportedType";a["com.sap.vocabularies.UI.v1.HeaderInfo"]="com.sap.vocabularies.UI.v1.HeaderInfoType";a["com.sap.vocabularies.UI.v1.Identification"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";a["com.sap.vocabularies.UI.v1.Badge"]="com.sap.vocabularies.UI.v1.BadgeType";a["com.sap.vocabularies.UI.v1.LineItem"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";a["com.sap.vocabularies.UI.v1.StatusInfo"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";a["com.sap.vocabularies.UI.v1.FieldGroup"]="com.sap.vocabularies.UI.v1.FieldGroupType";a["com.sap.vocabularies.UI.v1.ConnectedFields"]="com.sap.vocabularies.UI.v1.ConnectedFieldsType";a["com.sap.vocabularies.UI.v1.GeoLocations"]="com.sap.vocabularies.UI.v1.GeoLocationType";a["com.sap.vocabularies.UI.v1.GeoLocation"]="com.sap.vocabularies.UI.v1.GeoLocationType";a["com.sap.vocabularies.UI.v1.Contacts"]="Edm.AnnotationPath";a["com.sap.vocabularies.UI.v1.MediaResource"]="com.sap.vocabularies.UI.v1.MediaResourceType";a["com.sap.vocabularies.UI.v1.DataPoint"]="com.sap.vocabularies.UI.v1.DataPointType";a["com.sap.vocabularies.UI.v1.KPI"]="com.sap.vocabularies.UI.v1.KPIType";a["com.sap.vocabularies.UI.v1.Chart"]="com.sap.vocabularies.UI.v1.ChartDefinitionType";a["com.sap.vocabularies.UI.v1.ValueCriticality"]="com.sap.vocabularies.UI.v1.ValueCriticalityType";a["com.sap.vocabularies.UI.v1.CriticalityLabels"]="com.sap.vocabularies.UI.v1.CriticalityLabelType";a["com.sap.vocabularies.UI.v1.SelectionFields"]="Edm.PropertyPath";a["com.sap.vocabularies.UI.v1.Facets"]="com.sap.vocabularies.UI.v1.Facet";a["com.sap.vocabularies.UI.v1.HeaderFacets"]="com.sap.vocabularies.UI.v1.Facet";a["com.sap.vocabularies.UI.v1.QuickViewFacets"]="com.sap.vocabularies.UI.v1.Facet";a["com.sap.vocabularies.UI.v1.QuickCreateFacets"]="com.sap.vocabularies.UI.v1.Facet";a["com.sap.vocabularies.UI.v1.FilterFacets"]="com.sap.vocabularies.UI.v1.ReferenceFacet";a["com.sap.vocabularies.UI.v1.SelectionPresentationVariant"]="com.sap.vocabularies.UI.v1.SelectionPresentationVariantType";a["com.sap.vocabularies.UI.v1.PresentationVariant"]="com.sap.vocabularies.UI.v1.PresentationVariantType";a["com.sap.vocabularies.UI.v1.SelectionVariant"]="com.sap.vocabularies.UI.v1.SelectionVariantType";a["com.sap.vocabularies.UI.v1.ThingPerspective"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.IsSummary"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.PartOfPreview"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.Map"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.Gallery"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.IsImageURL"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.IsImage"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.MultiLineText"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.TextArrangement"]="com.sap.vocabularies.UI.v1.TextArrangementType";a["com.sap.vocabularies.UI.v1.Note"]="com.sap.vocabularies.UI.v1.NoteType";a["com.sap.vocabularies.UI.v1.Importance"]="com.sap.vocabularies.UI.v1.ImportanceType";a["com.sap.vocabularies.UI.v1.Hidden"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.IsCopyAction"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.CreateHidden"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.UpdateHidden"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.DeleteHidden"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.HiddenFilter"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.AdaptationHidden"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.DataFieldDefault"]="com.sap.vocabularies.UI.v1.DataFieldAbstract";a["com.sap.vocabularies.UI.v1.Criticality"]="com.sap.vocabularies.UI.v1.CriticalityType";a["com.sap.vocabularies.UI.v1.CriticalityCalculation"]="com.sap.vocabularies.UI.v1.CriticalityCalculationType";a["com.sap.vocabularies.UI.v1.Emphasized"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.OrderBy"]="Edm.PropertyPath";a["com.sap.vocabularies.UI.v1.ParameterDefaultValue"]="Edm.PrimitiveType";a["com.sap.vocabularies.UI.v1.RecommendationState"]="com.sap.vocabularies.UI.v1.RecommendationStateType";a["com.sap.vocabularies.UI.v1.RecommendationList"]="com.sap.vocabularies.UI.v1.RecommendationListType";a["com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext"]="Org.OData.Core.V1.Tag";a["com.sap.vocabularies.UI.v1.DoNotCheckScaleOfMeasuredQuantity"]="Edm.Boolean";a["com.sap.vocabularies.HTML5.v1.CssDefaults"]="com.sap.vocabularies.HTML5.v1.CssDefaultsType"})(t=e.TermToTypes||(e.TermToTypes={}))},899:function(a,e){Object.defineProperty(e,"__esModule",{value:true});e.VocabularyReferences=void 0;e.VocabularyReferences=[{alias:"Auth",namespace:"Org.OData.Authorization.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml"},{alias:"Core",namespace:"Org.OData.Core.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml"},{alias:"Capabilities",namespace:"Org.OData.Capabilities.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml"},{alias:"Aggregation",namespace:"Org.OData.Aggregation.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml"},{alias:"Validation",namespace:"Org.OData.Validation.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml"},{alias:"Measures",namespace:"Org.OData.Measures.V1",uri:"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml"},{alias:"Analytics",namespace:"com.sap.vocabularies.Analytics.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml"},{alias:"Common",namespace:"com.sap.vocabularies.Common.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/Common.xml"},{alias:"CodeList",namespace:"com.sap.vocabularies.CodeList.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/CodeList.xml"},{alias:"Communication",namespace:"com.sap.vocabularies.Communication.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/Communication.xml"},{alias:"Hierarchy",namespace:"com.sap.vocabularies.Hierarchy.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/Hierarchy.xml"},{alias:"PersonalData",namespace:"com.sap.vocabularies.PersonalData.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/PersonalData.xml"},{alias:"Session",namespace:"com.sap.vocabularies.Session.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/Session.xml"},{alias:"UI",namespace:"com.sap.vocabularies.UI.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/UI.xml"},{alias:"HTML5",namespace:"com.sap.vocabularies.HTML5.v1",uri:"https://sap.github.io/odata-vocabularies/vocabularies/HTML5.xml"}]}};var t={};function o(a){var r=t[a];if(r!==undefined){return r.exports}var i=t[a]={exports:{}};e[a].call(i.exports,i,i.exports,o);return i.exports}var r=o(878);a=r})();return a},true);
|
|
386
391
|
/*!
|
|
387
392
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
388
393
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -392,7 +397,7 @@ sap.ui.predefine("sap/fe/core/converters/controls/Common/Action", ["sap/base/Log
|
|
|
392
397
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
393
398
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
394
399
|
*/
|
|
395
|
-
sap.ui.predefine("sap/fe/core/converters/controls/Common/Chart", ["sap/base/Log","sap/fe/core/converters/annotations/DataField","sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/Key","sap/fe/core/helpers/BindingToolkit","sap/fe/core/templating/DataModelPathHelper","sap/ui/core/Core","../../helpers/Aggregation","../../helpers/ID","../../ManifestSettings"],function(t,e,n,a,o,i,r,l,
|
|
400
|
+
sap.ui.predefine("sap/fe/core/converters/controls/Common/Chart", ["sap/base/Log","sap/fe/core/converters/annotations/DataField","sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/Key","sap/fe/core/helpers/BindingToolkit","sap/fe/core/templating/DataModelPathHelper","sap/ui/core/Core","../../helpers/Aggregation","../../helpers/ID","../../helpers/InsightsHelpers","../../ManifestSettings"],function(t,e,n,a,o,i,r,s,l,g,c,p){"use strict";var u={};var d=p.VisualizationType;var v=p.VariantManagementType;var f=p.TemplateType;var m=p.ActionType;var y=c.getInsightsVisibility;var h=g.getFilterBarID;var P=g.getChartID;var b=l.AggregationHelper;var A=r.getTargetObjectPath;var T=i.not;var S=i.getExpressionFromAnnotation;var C=i.equal;var M=i.compileExpression;var O=o.KeyHelper;var I=a.OverrideType;var D=a.insertCustomElements;var E=n.getActionsFromManifest;var F=e.isDataFieldForActionAbstract;function V(t,e,n){const a=[];if(t){const e=t.Actions||[];e.forEach(t=>{var e;let o;if(F(t)&&!t.Inline&&!t.Determining){const a=O.generateKeyFromDataField(t);switch(t.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":if(!((e=t.ActionTarget)!==null&&e!==void 0&&e.isBound)){o={type:m.DataFieldForAction,annotationPath:n.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),key:a,visible:x(t,n)}}break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":o={type:m.DataFieldForIntentBasedNavigation,annotationPath:n.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),key:a,visible:x(t,n),isNavigable:true};break}}if(o){a.push(o)}})}return a}function N(t,e,n){const a=V(t,e,n);const o=E(n.getManifestControlConfiguration(e).actions,n,a);const i={enabled:I.overwrite,enableOnSelect:I.overwrite,visible:I.overwrite,command:I.overwrite};const r=D(a,o.actions,i);return{actions:r,commandActions:o.commandActions}}u.getChartActions=N;function w(t,e){var n;const a=e.getManifestWrapper();const o=e.getManifestControlConfiguration(t);const i=a.getVariantManagement();const r=[];const s=o===null||o===void 0?void 0:(n=o.chartSettings)===null||n===void 0?void 0:n.personalization;const l=i===v.Control?true:false;if(s!==undefined&&!s||s=="false"){return undefined}switch(true){case typeof s==="object":if(s.type){r.push("Type")}if(s.item){r.push("Item")}if(s.sort){r.push("Sort")}if(s.filter){r.push("Filter")}return r.join(",");case l:case!!s:return"Sort,Type,Item,Filter";default:return"Sort,Type,Item"}}u.getP13nMode=w;function B(t){var e;return(t===null||t===void 0?void 0:(e=t.annotationPath)===null||e===void 0?void 0:e.indexOf(`@${"com.sap.vocabularies.UI.v1.SelectionPresentationVariant"}`))!==-1?t===null||t===void 0?void 0:t.annotationPath:undefined}function $(t){let e;if(t!==null&&t!==void 0&&t.Property){var n;e={Property:{$PropertyPath:t===null||t===void 0?void 0:(n=t.Property)===null||n===void 0?void 0:n.value}}}else{e={Property:{$PropertyPath:t===null||t===void 0?void 0:t.name}}}return e}function z(e,n,a,o,i,r){var l;const g=new b(a.getEntityType(),a,true);if(!o&&!g.isAnalyticsSupported()){throw new Error("ApplySupported is not added to the annotations")}const c=g.getTransAggregations();const p=g.getCustomAggregateDefinitions();const u=a.getManifestWrapper();const v=u.getVariantManagement();const m=w(n,a);if(m===undefined&&v==="Control"){t.warning("Variant Management cannot be enabled when personalization is disabled")}const T={};const S=B(i);if(p){const t=g.getEntityType();for(const e of p){var C,M,O,I,D;const n=e===null||e===void 0?void 0:(C=e.annotations)===null||C===void 0?void 0:(M=C.Aggregation)===null||M===void 0?void 0:M.ContextDefiningProperties;const a=e===null||e===void 0?void 0:e.qualifier;const o=a&&t.entityProperties.find(t=>t.name===a);const i=o&&(o===null||o===void 0?void 0:(O=o.annotations)===null||O===void 0?void 0:(I=O.Common)===null||I===void 0?void 0:(D=I.Label)===null||D===void 0?void 0:D.toString());T[a]={name:a,label:i||`Custom Aggregate (${a})`,sortable:true,sortOrder:"both",contextDefiningProperty:n?n.map(t=>t.value):[]}}}const E={};const F=s.getLibraryResourceBundle("sap.fe.core");if(c){for(let t=0;t<c.length;t++){var V,z,x,G,j,k;E[c[t].Name]={name:c[t].Name,propertyPath:c[t].AggregatableProperty.valueOf().value,aggregationMethod:c[t].AggregationMethod,label:(V=c[t])!==null&&V!==void 0&&(z=V.annotations)!==null&&z!==void 0&&(x=z.Common)!==null&&x!==void 0&&x.Label?(G=c[t])===null||G===void 0?void 0:(j=G.annotations)===null||j===void 0?void 0:(k=j.Common)===null||k===void 0?void 0:k.Label.toString():`${F.getText("AGGREGATABLE_PROPERTY")} (${c[t].Name})`,sortable:true,sortOrder:"both",custom:false}}}const R=g.getAggregatableProperties();const H=g.getGroupableProperties();const Q={};Q.$Type="Org.OData.Aggregation.V1.ApplySupportedType";Q.AggregatableProperties=[];Q.GroupableProperties=[];if(R){Q.AggregatableProperties=R.map(t=>$(t))}if(H){Q.GroupableProperties=H.map(t=>({["$PropertyPath"]:t.value}))}const U=N(e,n,a);let[W]=n.split("@");if(W.lastIndexOf("/")===W.length-1){W=W.substr(0,W.length-1)}const K=((l=e.Title)===null||l===void 0?void 0:l.toString())||"";const q=a.getDataModelObjectPath();const J=W.length===0;const Y=q.targetEntitySet?q.targetEntitySet.name:q.startingEntitySet.name;const _=J?h(a.getContextPath()):undefined;const X={legendGroup:{layout:{position:"bottom"}}};let Z;if(a.getTemplateType()===f.ObjectPage){Z=true}else if(a.getTemplateType()===f.ListReport||a.getTemplateType()===f.AnalyticalListPage){Z=false}const tt=a.getManifestWrapper().hasMultipleVisualizations()||a.getTemplateType()===f.AnalyticalListPage;const et=tt?".handlers.onSegmentedButtonPressed":"";const nt=tt?"{= ${pageInternal>alpContentView} !== 'Table'}":"true";const at=g.getAllowedTransformations();Q.enableSearch=at?at.indexOf("search")>=0:true;let ot="";if(e.fullyQualifiedName.split("#").length>1){ot=e.fullyQualifiedName.split("#")[1]}return{type:d.Chart,id:ot?P(J?Y:W,ot,d.Chart):P(J?Y:W,d.Chart),collection:A(a.getDataModelObjectPath()),entityName:Y,personalization:w(n,a),navigationPath:W,annotationPath:a.getAbsoluteAnnotationPath(n),filterId:_,vizProperties:JSON.stringify(X),actions:U.actions,commandActions:U.commandActions,title:K,autoBindOnInit:Z,onSegmentedButtonPressed:et,visible:nt,customAgg:T,transAgg:E,applySupported:Q,selectionPresentationVariantPath:S,variantManagement:L(m,v),isInsightsEnabled:(r??false)&&y("Analytical",a,n)}}u.createChartVisualization=z;function L(t,e){return e==="Control"&&!t?v.None:e}function x(t,e){var n,a;return M(T(C(S((n=t.annotations)===null||n===void 0?void 0:(a=n.UI)===null||a===void 0?void 0:a.Hidden,[],undefined,e.getRelativeModelPathFunction()),true)))}function G(t){const e=t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===f.AnalyticalListPage;const n=t.getDataModelObjectPath();const a=n.targetEntitySet?n.targetEntitySet.name:n.startingEntitySet.name;const o={type:d.Chart,id:P(a,d.Chart),entityName:a,title:"",collection:"",personalization:undefined,navigationPath:"",annotationPath:"",vizProperties:JSON.stringify({legendGroup:{layout:{position:"bottom"}}}),actions:[],commandActions:{},autoBindOnInit:false,onSegmentedButtonPressed:"",visible:e?"{= ${pageInternal>alpContentView} !== 'Table'}":"true",customAgg:{},transAgg:{},applySupported:{$Type:"Org.OData.Aggregation.V1.ApplySupportedType",AggregatableProperties:[],GroupableProperties:[],enableSearch:false},multiViews:false,variantManagement:v.None};return o}u.createBlankChartVisualization=G;return u},false);
|
|
396
401
|
/*!
|
|
397
402
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
398
403
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -402,7 +407,7 @@ sap.ui.predefine("sap/fe/core/converters/controls/Common/Criticality", ["sap/fe/
|
|
|
402
407
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
403
408
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
404
409
|
*/
|
|
405
|
-
sap.ui.predefine("sap/fe/core/converters/controls/Common/DataVisualization", ["sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/MetaModelConverter","sap/fe/macros/CommonHelper","../../ManifestSettings","./Chart","./Table"],function(t,n,e,a,i,o){"use strict";var r={};var s=i.createChartVisualization;var l=i.createBlankChartVisualization;var u=a.TemplateType;var c=t.IssueType;var v=t.IssueSeverity;var f=t.IssueCategory;const d=function(t,n,e,a){const i=[];const o=S(e);const r=n.split("@")[0];if((a===true||o)&&!I(t,o)){if(!y(t,"com.sap.vocabularies.UI.v1.LineItem")){const t=z("com.sap.vocabularies.UI.v1.LineItem",r,e);if(t){i.push(t)}}if(!y(t,"com.sap.vocabularies.UI.v1.Chart")){const t=z("com.sap.vocabularies.UI.v1.Chart",r,e);if(t){i.push(t)}}}const s=t.Visualizations;const l=function(t){const n=s===null||s===void 0?void 0:s.find(n=>{var e;return t.indexOf((e=n.$target)===null||e===void 0?void 0:e.term)>=0});if(n){i.push({visualization:n.$target,annotationPath:`${r}${n.value}`,converterContext:e})}};if(o){l(["com.sap.vocabularies.UI.v1.LineItem"]);l(["com.sap.vocabularies.UI.v1.Chart"])}else{l(["com.sap.vocabularies.UI.v1.LineItem","com.sap.vocabularies.UI.v1.Chart"])}return i};r.getVisualizationsFromPresentationVariant=d;function p(t,n,e){if(n){const t=e.getEntityTypeAnnotation(n);const a=t.annotation;if(a){if(a.term==="com.sap.vocabularies.UI.v1.SelectionPresentationVariant"){return a}}else{throw new Error("Annotation Path for the SPV mentioned in the manifest is not found, Please add the SPV in the annotation")}}else{var a,i;return(a=t.annotations)===null||a===void 0?void 0:(i=a.UI)===null||i===void 0?void 0:i.SelectionPresentationVariant}}r.getSelectionPresentationVariant=p;function m(t,n){const e=t&&t.PresentationVariant;if(e){return I(e,n)}else{throw new Error("Presentation Variant is not present in the SPV annotation")}}r.isSelectionPresentationCompliant=m;function I(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let e=false,a=false;if(n){if(t!==null&&t!==void 0&&t.Visualizations){const n=t.Visualizations;n.forEach(t=>{var n,i;if(((n=t.$target)===null||n===void 0?void 0:n.term)==="com.sap.vocabularies.UI.v1.LineItem"){e=true}if(((i=t.$target)===null||i===void 0?void 0:i.term)==="com.sap.vocabularies.UI.v1.Chart"){a=true}})}return a&&e}else{return(t===null||t===void 0?void 0:t.Visualizations)&&!!t.Visualizations.find(t=>{var n,e;return((n=t.$target)===null||n===void 0?void 0:n.term)==="com.sap.vocabularies.UI.v1.LineItem"||((e=t.$target)===null||e===void 0?void 0:e.term)==="com.sap.vocabularies.UI.v1.Chart"})}}r.isPresentationCompliant=I;function h(t){var n;return(n=t.annotations.UI)===null||n===void 0?void 0:n.LineItem}r.getDefaultLineItem=h;function g(t){var n;return(n=t.annotations.UI)===null||n===void 0?void 0:n.Chart}r.getDefaultChart=g;function P(t){var n,e;return(n=t.annotations)===null||n===void 0?void 0:(e=n.UI)===null||e===void 0?void 0:e.PresentationVariant}r.getDefaultPresentationVariant=P;function V(t){var n,e;return(n=t.annotations)===null||n===void 0?void 0:(e=n.UI)===null||e===void 0?void 0:e.SelectionVariant}r.getDefaultSelectionVariant=V;function b(t,n){const e=n.getManifestWrapper().getDefaultTemplateAnnotationPath();const a=p(t,e,n);let i;if(a){i=a.SelectionVariant;if(i){return i}}else{i=V(t);return i}}r.getSelectionVariant=b;function C(t,n,e,a,i,r,u){const
|
|
410
|
+
sap.ui.predefine("sap/fe/core/converters/controls/Common/DataVisualization", ["sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/MetaModelConverter","sap/fe/macros/CommonHelper","../../ManifestSettings","./Chart","./Table"],function(t,n,e,a,i,o){"use strict";var r={};var s=i.createChartVisualization;var l=i.createBlankChartVisualization;var u=a.TemplateType;var c=t.IssueType;var v=t.IssueSeverity;var f=t.IssueCategory;const d=function(t,n,e,a){const i=[];const o=S(e);const r=n.split("@")[0];if((a===true||o)&&!I(t,o)){if(!y(t,"com.sap.vocabularies.UI.v1.LineItem")){const t=z("com.sap.vocabularies.UI.v1.LineItem",r,e);if(t){i.push(t)}}if(!y(t,"com.sap.vocabularies.UI.v1.Chart")){const t=z("com.sap.vocabularies.UI.v1.Chart",r,e);if(t){i.push(t)}}}const s=t.Visualizations;const l=function(t){const n=s===null||s===void 0?void 0:s.find(n=>{var e;return t.indexOf((e=n.$target)===null||e===void 0?void 0:e.term)>=0});if(n){i.push({visualization:n.$target,annotationPath:`${r}${n.value}`,converterContext:e})}};if(o){l(["com.sap.vocabularies.UI.v1.LineItem"]);l(["com.sap.vocabularies.UI.v1.Chart"])}else{l(["com.sap.vocabularies.UI.v1.LineItem","com.sap.vocabularies.UI.v1.Chart"])}return i};r.getVisualizationsFromPresentationVariant=d;function p(t,n,e){if(n){const t=e.getEntityTypeAnnotation(n);const a=t.annotation;if(a){if(a.term==="com.sap.vocabularies.UI.v1.SelectionPresentationVariant"){return a}}else{throw new Error("Annotation Path for the SPV mentioned in the manifest is not found, Please add the SPV in the annotation")}}else{var a,i;return(a=t.annotations)===null||a===void 0?void 0:(i=a.UI)===null||i===void 0?void 0:i.SelectionPresentationVariant}}r.getSelectionPresentationVariant=p;function m(t,n){const e=t&&t.PresentationVariant;if(e){return I(e,n)}else{throw new Error("Presentation Variant is not present in the SPV annotation")}}r.isSelectionPresentationCompliant=m;function I(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let e=false,a=false;if(n){if(t!==null&&t!==void 0&&t.Visualizations){const n=t.Visualizations;n.forEach(t=>{var n,i;if(((n=t.$target)===null||n===void 0?void 0:n.term)==="com.sap.vocabularies.UI.v1.LineItem"){e=true}if(((i=t.$target)===null||i===void 0?void 0:i.term)==="com.sap.vocabularies.UI.v1.Chart"){a=true}})}return a&&e}else{return(t===null||t===void 0?void 0:t.Visualizations)&&!!t.Visualizations.find(t=>{var n,e;return((n=t.$target)===null||n===void 0?void 0:n.term)==="com.sap.vocabularies.UI.v1.LineItem"||((e=t.$target)===null||e===void 0?void 0:e.term)==="com.sap.vocabularies.UI.v1.Chart"})}}r.isPresentationCompliant=I;function h(t){var n;return(n=t.annotations.UI)===null||n===void 0?void 0:n.LineItem}r.getDefaultLineItem=h;function g(t){var n;return(n=t.annotations.UI)===null||n===void 0?void 0:n.Chart}r.getDefaultChart=g;function P(t){var n,e;return(n=t.annotations)===null||n===void 0?void 0:(e=n.UI)===null||e===void 0?void 0:e.PresentationVariant}r.getDefaultPresentationVariant=P;function V(t){var n,e;return(n=t.annotations)===null||n===void 0?void 0:(e=n.UI)===null||e===void 0?void 0:e.SelectionVariant}r.getDefaultSelectionVariant=V;function b(t,n){const e=n.getManifestWrapper().getDefaultTemplateAnnotationPath();const a=p(t,e,n);let i;if(a){i=a.SelectionVariant;if(i){return i}}else{i=V(t);return i}}r.getSelectionVariant=b;function C(t,n,e,a,i,r,u,p){const m=t!==""?e.getEntityTypeAnnotation(t):{annotation:undefined,converterContext:e};const I=r?e.getEntityTypeAnnotation(r):null;const h=m.annotation;e=m.converterContext;let g=[];let P;let V="";let b,C;const U=h===null||h===void 0?void 0:h.term;if(U){switch(U){case"com.sap.vocabularies.UI.v1.LineItem":case"com.sap.vocabularies.UI.v1.Chart":P=I===null||I===void 0?void 0:I.annotation;g.push({visualization:h,annotationPath:t,converterContext:e});break;case"com.sap.vocabularies.UI.v1.PresentationVariant":P=h;g=g.concat(d(h,t,e,u));break;case"com.sap.vocabularies.UI.v1.SelectionPresentationVariant":P=h.PresentationVariant;V=P.fullyQualifiedName;g=g.concat(d(P,t,e,u));break;default:break}g.forEach(t=>{const{visualization:e,annotationPath:r,converterContext:l}=t;switch(e.term){case"com.sap.vocabularies.UI.v1.Chart":b=s(e,r,l,i,a,p);break;case"com.sap.vocabularies.UI.v1.LineItem":default:C=o.createTableVisualization(e,r,l,P,n,a,p);break}})}const y=[];let z=U==="com.sap.vocabularies.UI.v1.SelectionPresentationVariant"?V:h===null||h===void 0?void 0:h.fullyQualifiedName;if(z===undefined){z="/"}const M=S(e);if(!U||M&&C===undefined){C=o.createDefaultTableVisualization(e,u!==true);e.getDiagnostics().addIssue(f.Annotation,v.Medium,c.MISSING_LINEITEM)}if(M&&b===undefined){b=l(e);e.getDiagnostics().addIssue(f.Annotation,v.Medium,c.MISSING_CHART)}if(b){y.push(b)}if(C){y.push(C)}return{visualizations:y,annotationPath:e.getEntitySetBasedAnnotationPath(z)}}r.getDataVisualizationConfiguration=C;function U(t,a){e.validatePresentationMetaPath(t.getPath(),a);const i=n.convertMetaModelContext(t),o=e.createPresentationPathContext(t),r=t.getModel();if(i){if(e._isPresentationVariantAnnotation(o.getPath())){const n=i.PresentationVariant?i.PresentationVariant.Visualizations:i.Visualizations;if(Array.isArray(n)){for(const e of n){if(e.type=="AnnotationPath"&&e.value.indexOf(a)!==-1&&!!r.getMetaContext(t.getPath().split("@")[0]+e.value).getObject()){a=e.value;break}}}}else{return t}}return r.getMetaContext(t.getPath().split("@")[0]+a)}r.getUiControl=U;const y=function(t,n){var e;return((e=t.Visualizations)===null||e===void 0?void 0:e.some(t=>t.value.indexOf(n)>-1))??false};r.annotationExistsInPresentationVariant=y;const z=function(t,n,e){const a=e.getEntityType();const i=t==="com.sap.vocabularies.UI.v1.LineItem"?h(a):g(a);if(i){return{visualization:i,annotationPath:`${n}${e.getRelativeAnnotationPath(i.fullyQualifiedName,a)}`,converterContext:e}}return undefined};r.prepareDefaultVisualization=z;const S=function(t){return t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===u.AnalyticalListPage};r.isAlpAnnotation=S;return r},false);
|
|
406
411
|
/*!
|
|
407
412
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
408
413
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -417,22 +422,22 @@ sap.ui.predefine("sap/fe/core/converters/controls/Common/KPI", ["sap/fe/core/con
|
|
|
417
422
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
418
423
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
419
424
|
*/
|
|
420
|
-
sap.ui.predefine("sap/fe/core/converters/controls/Common/Table", ["sap/fe/core/converters/annotations/DataField","sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/helpers/BindingHelper","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/helpers/Key","sap/fe/core/formatters/TableFormatter","sap/fe/core/formatters/TableFormatterTypes","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/EntitySetHelper","sap/fe/core/templating/PropertyHelper","sap/fe/core/templating/UIFormatters","sap/fe/macros/internal/helpers/ActionHelper","sap/ui/core/Core","../../helpers/Aggregation","../../helpers/DataFieldHelper","../../helpers/ID","../../ManifestSettings","./Criticality","./table/StandardActions"],function(e,t,n,o,i,a,l,r,s,d,u,c,v,f,p,g,m,y,b,h,T,I,P,A,D){"use strict";var F={};var C=D.isInDisplayMode;var S=D.isDraftOrStickySupported;var E=D.getStandardActionPaste;var O=D.getStandardActionMassEdit;var x=D.getStandardActionDelete;var M=D.getStandardActionCreate;var U=D.getRestrictions;var $=D.getMassEditVisibility;var N=D.getInsertUpdateActionsTemplating;var w=D.getDeleteVisibility;var V=D.getCreationRow;var k=D.generateStandardActionsContext;var L=A.getMessageTypeFromCriticalityType;var R=P.VisualizationType;var j=P.VariantManagementType;var H=P.TemplateType;var B=P.SelectionMode;var z=P.Importance;var G=P.HorizontalAlign;var K=P.CreationMode;var W=P.ActionType;var q=I.getTableID;var Q=T.isReferencePropertyStaticallyHidden;var _=h.AggregationHelper;var Y=m.isMultiValueField;var J=g.getAssociatedUnitProperty;var X=g.getAssociatedTimezoneProperty;var Z=g.getAssociatedCurrencyProperty;var ee=p.getNonSortablePropertiesRestrictions;var te=f.getDisplayMode;var ne=v.isPathUpdatable;var oe=v.isPathSearchable;var ie=v.isPathDeletable;var ae=v.getTargetObjectPath;var le=v.enhanceDataModelPath;var re=c.isTypeDefinition;var se=c.isProperty;var de=c.isPathAnnotationExpression;var ue=c.isNavigationProperty;var ce=c.isAnnotationOfType;var ve=u.replaceSpecialChars;var fe=u.generate;var pe=s.resolveBindingString;var ge=s.pathInModel;var me=s.or;var ye=s.not;var be=s.isConstant;var he=s.ifElse;var Te=s.getExpressionFromAnnotation;var Ie=s.formatResult;var Pe=s.equal;var Ae=s.EDM_TYPE_MAPPING;var De=s.constant;var Fe=s.compileExpression;var Ce=s.and;var Se=r.MessageType;var Ee=a.KeyHelper;var Oe=i.IssueType;var xe=i.IssueSeverity;var Me=i.IssueCategoryType;var Ue=i.IssueCategory;var $e=o.Placement;var Ne=o.OverrideType;var we=o.insertCustomElements;var Ve=n.UI;var ke=n.Entity;var Le=t.getEnabledForAnnotationAction;var Re=t.removeDuplicateActions;var je=t.isActionNavigable;var He=t.getCopyAction;var Be=t.getActionsFromManifest;var ze=t.dataFieldIsCopyAction;var Ge=e.isDataPointFromDataFieldDefault;var Ke=e.isDataFieldTypes;var We=e.isDataFieldForActionAbstract;var qe=e.getTargetValueOnDataPoint;var Qe=e.getSemanticObjectPath;var _e=e.getDataFieldDataType;var Ye=e.collectRelatedPropertiesRecursively;var Je=e.collectRelatedProperties;var Xe;(function(e){e["Default"]="Default";e["Annotation"]="Annotation";e["Slot"]="Slot"})(Xe||(Xe={}));function Ze(e,t,n,o){const i=ht(e,t,n);const a=i.tableActions;const l=i.hiddenTableActions;const r=Be(n.getManifestControlConfiguration(t).actions,n,a,o,true,l);const s={isNavigable:Ne.overwrite,enableOnSelect:Ne.overwrite,enableAutoScroll:Ne.overwrite,enabled:Ne.overwrite,visible:Ne.overwrite,defaultValuesExtensionFunction:Ne.overwrite,command:Ne.overwrite};const d=we(a,r.actions,s);return{actions:d,commandActions:r.commandActions}}F.getTableActions=Ze;function et(e,t,n,o){const i=Jt(e,t,n);const a=en(n.getManifestControlConfiguration(t).columns,i,n,n.getAnnotationEntityType(e),o);return we(i,a,{width:Ne.overwrite,importance:Ne.overwrite,horizontalAlign:Ne.overwrite,availability:Ne.overwrite,isNavigable:Ne.overwrite,settings:Ne.overwrite,formatOptions:Ne.overwrite})}F.getTableColumns=et;const tt=function(e,t,n){const o=new _(e,n);function i(e){return t.find(t=>{const n=t;return n.propertyInfos===undefined&&n.relativePath===e})}if(!o.isAnalyticsSupported()){return undefined}const a=new Set;t.forEach(e=>{const t=e;if(t.unit){a.add(t.unit)}});const l=o.getCustomAggregateDefinitions();const r={};l.forEach(e=>{const t=o._entityType.entityProperties.find(t=>t.name===e.qualifier);if(t){var n,i;const o=(n=e.annotations)===null||n===void 0?void 0:(i=n.Aggregation)===null||i===void 0?void 0:i.ContextDefiningProperties;r[t.name]=o?o.map(e=>e.value):[]}});const s={};t.forEach(e=>{const t=e;if(t.propertyInfos===undefined&&t.relativePath){const e=r[t.relativePath];if(e&&!a.has(t.name)){s[t.name]={defaultAggregate:{},relativePath:t.relativePath};const n=[];e.forEach(e=>{const t=i(e);if(t){n.push(t.name)}});if(n.length){s[t.name].defaultAggregate.contextDefiningProperties=n}}}});return s};F.getAggregateDefinitionsFromEntityType=tt;function nt(e,t,n,o){if(e.control.type==="AnalyticalTable"){const i=tt(t,e.columns,n),a=new _(t,n);if(i){e.enableAnalytics=true;e.enable$select=false;e.enable$$getKeepAliveContext=false;e.aggregates=i;sn(e);const t=a.getAllowedTransformations();e.enableBasicSearch=t?t.indexOf("search")>=0:true;e.annotation.groupConditions=rn(o,e.columns,e.control.type);e.annotation.aggregateConditions=dn(o,e.columns)}e.control.type="GridTable"}else if(e.control.type==="ResponsiveTable"){e.annotation.groupConditions=rn(o,e.columns,e.control.type)}else if(e.control.type==="TreeTable"){const o=new _(t,n);const i=o.getAllowedTransformations();e.enableBasicSearch=i?i.includes("search"):true;e.enable$$getKeepAliveContext=false}}F.updateTableVisualizationForType=nt;function ot(e,t){const n=e.getManifestWrapper();if(t&&n.getNavigationConfiguration(t)){const e=n.getNavigationConfiguration(t);if(Object.keys(e).length>0){return t}}const o=e.getDataModelObjectPath();const i=e.getContextPath();const a=n.getNavigationConfiguration(i);if(a&&Object.keys(a).length>0){return i}return o.targetEntitySet?o.targetEntitySet.name:o.startingEntitySet.name}function it(e,t){function n(e){return t.find(t=>{const n=t;return n.propertyInfos===undefined&&n.relativePath===e})}t.forEach(t=>{const o=t;if(o.propertyInfos===undefined&&o.relativePath){const t=e.entityProperties.find(e=>e.name===o.relativePath);if(t){var i,a,l;const e=Z(t)||J(t);const c=X(t);const v=t===null||t===void 0?void 0:(i=t.annotations)===null||i===void 0?void 0:(a=i.Common)===null||a===void 0?void 0:a.Timezone;if(e){const t=n(e.name);o.unit=t===null||t===void 0?void 0:t.name}else{var r,s,d,u;const e=(t===null||t===void 0?void 0:(r=t.annotations)===null||r===void 0?void 0:(s=r.Measures)===null||s===void 0?void 0:s.ISOCurrency)||(t===null||t===void 0?void 0:(d=t.annotations)===null||d===void 0?void 0:(u=d.Measures)===null||u===void 0?void 0:u.Unit);if(e){o.unitText=`${e}`}}if(c){const e=n(c.name);o.timezone=e===null||e===void 0?void 0:e.name}else if(v){o.timezoneText=v.toString()}const f=te(t),p=(l=t.annotations.Common)===null||l===void 0?void 0:l.Text;if(de(p)&&f!=="Value"){const e=n(p.path);if(e&&e.name!==o.name){o.textArrangement={textProperty:e.name,mode:f}}}}}})}F.updateLinkedProperties=it;function at(e){var t,n,o,i,a,l,r,s,d,u,c,v,f;const p=(t=e.getAnnotationEntityType())===null||t===void 0?void 0:(n=t.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:(i=o.HeaderInfo)===null||i===void 0?void 0:(a=i.Title)===null||a===void 0?void 0:(l=a.Value)===null||l===void 0?void 0:l.path;const g=(r=e.getAnnotationEntityType())===null||r===void 0?void 0:(s=r.annotations)===null||s===void 0?void 0:(d=s.Common)===null||d===void 0?void 0:d.SemanticKey;const m=e===null||e===void 0?void 0:(u=e.getAnnotationEntityType())===null||u===void 0?void 0:(c=u.annotations)===null||c===void 0?void 0:(v=c.UI)===null||v===void 0?void 0:(f=v.HeaderInfo)===null||f===void 0?void 0:f.TypeName;const y=[];if(g){g.forEach(function(e){y.push(e.value)})}return{headerInfoTitlePath:p,semanticKeyColumns:y,headerInfoTypeName:m}}function lt(e,t,n,o,i,a){const l=Fn(e,t,n,i);const{navigationPropertyPath:r}=vn(t);const s=ot(n,r);const d=n.getManifestWrapper().getNavigationConfiguration(s);const u=et(e,t,n,d);const c=st(e,n);const v=at(n);const f=Ze(e,t,n,d);const p={type:R.Table,annotation:un(e,t,n,l,u,o,a),control:l,actions:Re(f.actions),commandActions:f.commandActions,columns:u,operationAvailableMap:JSON.stringify(c),operationAvailableProperties:ut(c,n),headerInfoTitle:v.headerInfoTitlePath,semanticKeys:v.semanticKeyColumns,headerInfoTypeName:v.headerInfoTypeName,enable$select:true,enable$$getKeepAliveContext:true};it(n.getAnnotationEntityType(e),u);nt(p,n.getAnnotationEntityType(e),n,o);return p}F.createTableVisualization=lt;function rt(e,t){const n=Fn(undefined,"",e,false);const o=At({},e.getEntityType(),[],[],e,n.type,[]);const i=st(undefined,e);const a=at(e);const l={type:R.Table,annotation:un(undefined,"",e,n,t?[]:o),control:n,actions:[],columns:o,operationAvailableMap:JSON.stringify(i),operationAvailableProperties:ut(i,e),headerInfoTitle:a.headerInfoTitlePath,semanticKeys:a.semanticKeyColumns,headerInfoTypeName:a.headerInfoTypeName,enable$select:true,enable$$getKeepAliveContext:true};it(e.getEntityType(),o);nt(l,e.getEntityType(),e);return l}F.createDefaultTableVisualization=rt;function st(e,t){return y.getOperationAvailableMap(e,"table",t)}function dt(e){var t,n;const o=U(e);const i=e.getEntitySet();const a=o.isUpdatable;const l=!be(a.expression)&&a.navigationExpression._type==="Unresolvable";const r=i===null||i===void 0?void 0:(t=i.annotations.Capabilities)===null||t===void 0?void 0:(n=t.UpdateRestrictions)===null||n===void 0?void 0:n.Updatable;const s=de(r)&&r.path;return l?s:""}function ut(e,t){const n=new Set;for(const t in e){const o=e[t];if(o===null){n.add(t)}else if(typeof o==="string"){n.add(o)}}if(n.size){var o,i,a,l,r;const e=t.getEntityType();const s=(o=e.annotations)===null||o===void 0?void 0:(i=o.UI)===null||i===void 0?void 0:(a=i.HeaderInfo)===null||a===void 0?void 0:(l=a.Title)===null||l===void 0?void 0:(r=l.Value)===null||r===void 0?void 0:r.path;if(s){n.add(s)}}return Array.from(n).join(",")}function ct(e,t,n,o){const i=[];e.forEach(e=>{var a,l;if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"&&e!==null&&e!==void 0&&(a=e.ActionTarget)!==null&&a!==void 0&&a.isBound&&t===(e===null||e===void 0?void 0:e.ActionTarget.sourceEntityType)||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"&&e.RequiresContext&&(e===null||e===void 0?void 0:(l=e.Inline)===null||l===void 0?void 0:l.valueOf())!==true){var r,s,d;if(typeof((r=e.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:(d=s.Hidden)===null||d===void 0?void 0:d.valueOf())==="object"){i.push(Pe(vt(e,n,o),false))}}});return i}function vt(e,t,n){let o;if((e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.DataFieldForAction"||(e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"){var i,a;o=e===null||e===void 0?void 0:(i=e.annotations)===null||i===void 0?void 0:(a=i.UI)===null||a===void 0?void 0:a.Hidden}else{o=e===null||e===void 0?void 0:e.visible}let l;if(de(o)){l=o.path}else{l=o}if(l){if(e!==null&&e!==void 0&&e.visible){l=l.substring(1,l.length-1)}if(l.indexOf("/")>0){const e=l.split("/");const n=e[0];if(ue(t===null||t===void 0?void 0:t.targetObject)&&t.targetObject.partner===n){return ge(e.slice(1).join("/"))}else{return De(true)}}else if(n){return ge(l)}else{return De(true)}}return De(true)}function ft(e,t,n){return Object.keys(n).some(o=>{if(o===e){var i;if(t!==null&&t!==void 0&&(i=t.ActionTarget)!==null&&i!==void 0&&i.isBound||t!==null&&t!==void 0&&t.RequiresContext){n[e].requiresSelection=true}return true}return false})}function pt(e,t,n){return e.some(e=>{var o,i,a,l,r,s,d;if((e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation")&&(e===null||e===void 0?void 0:(o=e.Inline)===null||o===void 0?void 0:o.valueOf())!==true&&(((i=e.annotations)===null||i===void 0?void 0:(a=i.UI)===null||a===void 0?void 0:(l=a.Hidden)===null||l===void 0?void 0:l.valueOf())===false||((r=e.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:(d=s.Hidden)===null||d===void 0?void 0:d.valueOf())===undefined)){if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"){var u;const o=fe(["DataFieldForAction",e.Action]);if(ft(o,e,t)){return false}return(e===null||e===void 0?void 0:(u=e.ActionTarget)===null||u===void 0?void 0:u.isBound)&&n===(e===null||e===void 0?void 0:e.ActionTarget.sourceEntityType)}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"){if(ft(`DataFieldForIntentBasedNavigation::${e.SemanticObject}::${e.Action}`,e,t)){return false}return e.RequiresContext}}return false})}function gt(e){return Object.keys(e).some(t=>{var n;const o=e[t];if(o.requiresSelection&&((n=o.visible)===null||n===void 0?void 0:n.toString())==="true"){return true}return false})}function mt(e){const t=[];if(e){Object.keys(e).forEach(n=>{const o=e[n];if(o.requiresSelection===true&&o.visible!==undefined){if(typeof o.visible==="string"){var i;t.push(pe(o===null||o===void 0?void 0:(i=o.visible)===null||i===void 0?void 0:i.valueOf()))}}})}return t}function yt(e){const t=ie(e.getDataModelObjectPath());const n=ne(e.getDataModelObjectPath());return{isDeletable:!(be(t)&&t.value===false),isUpdatable:!(be(n)&&n.value===false)}}F.getCapabilityRestriction=yt;function bt(e,t,n,o,i,a){var l;let r=arguments.length>6&&arguments[6]!==undefined?arguments[6]:De(false);if(!e){return B.None}const s=n.getManifestControlConfiguration(t);let d=(l=s.tableSettings)===null||l===void 0?void 0:l.selectionMode;let u=[],c=[];const v=Be(n.getManifestControlConfiguration(t).actions,n,[],undefined,false);let f,p;if(n.getTemplateType()===H.ObjectPage){f=ie(n.getDataModelObjectPath());p=f?Fe(f,true):f}const g=!be(r)||r.value!==false;if(d&&d===B.None&&a){if(n.getTemplateType()===H.ObjectPage&&g){return Fe(he(Ce(Ve.IsEditable,r),De("Multi"),he(a,De("Multi"),De("None"))))}else if(g){return B.Multi}return Fe(he(a,De("Multi"),De("None")))}if(!d||d===B.Auto){d=B.Multi}if(g){d=d===B.Single?B.Single:B.Multi}if(pt(e,v.actions,n.getEntityType())||gt(v.actions)){return d}u=ct(e,n.getEntityType(),n.getDataModelObjectPath(),o);c=mt(v.actions);if(u.length===0&&c.length===0&&(a||g)){if(!o){if(i.isDeletable||p!=="false"||g){const e=me(a||true,r);return Fe(he(Ce(Ve.IsEditable,e),De(d),De(B.None)))}else{return B.None}}else if(g){return d}else if(i.isDeletable&&a){return Fe(he(a,De(d),De("None")))}else{return B.None}}else if(!o){if(i.isDeletable||p!=="false"||g){const e=he(g&&!i.isDeletable,r,De(true));return Fe(he(Ce(Ve.IsEditable,e),De(d),he(me(...u.concat(c)),De(d),De(B.None))))}else{return Fe(he(me(...u.concat(c)),De(d),De(B.None)))}}else if(i.isDeletable||g){return d}else{return Fe(he(me(...u.concat(c),r),De(d),De(B.None)))}}F.getSelectionMode=bt;function ht(e,t,n){const o=[];const i=[];const a=He(e.filter(e=>ze(e)));const l=n.getEntityType().fullyQualifiedName;if(a){var r,s,d;o.push({type:W.Copy,annotationPath:n.getEntitySetBasedAnnotationPath(a.fullyQualifiedName),key:Ee.generateKeyFromDataField(a),enabled:Fe(Pe(ge("numberOfSelectedContexts","internal"),1)),visible:Fe(ye(Pe(Te((r=a.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:s.Hidden,[],undefined,n.getRelativeModelPathFunction()),true))),text:((d=a.Label)===null||d===void 0?void 0:d.toString())??b.getLibraryResourceBundle("sap.fe.core").getText("C_COMMON_COPY"),isNavigable:true})}e.filter(e=>!ze(e)).forEach(e=>{var t,a,r,s,d,u,c,v,f,p,g,m;if(((t=e.annotations)===null||t===void 0?void 0:(a=t.UI)===null||a===void 0?void 0:(r=a.Hidden)===null||r===void 0?void 0:r.valueOf())===true){i.push({type:W.Default,key:Ee.generateKeyFromDataField(e)})}else if(We(e)&&((s=e.Inline)===null||s===void 0?void 0:s.valueOf())!==true&&((d=e.Determining)===null||d===void 0?void 0:d.valueOf())!==true){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":let t=false;if(((u=e.ActionTarget)===null||u===void 0?void 0:(c=u.annotations)===null||c===void 0?void 0:(v=c.Core)===null||v===void 0?void 0:v.OperationAvailable)!==undefined){var y,b,h,T;if(!((y=e.ActionTarget)!==null&&y!==void 0&&y.isBound)){t=true}else if((b=e.ActionTarget)!==null&&b!==void 0&&b.isBound&&((h=e.ActionTarget)===null||h===void 0?void 0:h.sourceType)!==l){t=true}else if((T=e.ActionTarget)!==null&&T!==void 0&&T.parameters[0].isCollection){t=true}}const i={type:W.DataFieldForAction,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),key:Ee.generateKeyFromDataField(e),visible:Fe(ye(Pe(Te((f=e.annotations)===null||f===void 0?void 0:(p=f.UI)===null||p===void 0?void 0:p.Hidden,[],undefined,n.getRelativeModelPathFunction()),true))),isNavigable:true};if(t){i.enabled=Le(n,e.ActionTarget)}o.push(i);break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":o.push({type:W.DataFieldForIntentBasedNavigation,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),key:Ee.generateKeyFromDataField(e),visible:Fe(ye(Pe(Te((g=e.annotations)===null||g===void 0?void 0:(m=g.UI)===null||m===void 0?void 0:m.Hidden,[],undefined,n.getRelativeModelPathFunction()),true)))});break;default:break}}});return{tableActions:o,hiddenTableActions:i}}function Tt(e,t,n){let o=Se.None;if(e){if(typeof e==="object"){o=Te(e)}else{o=L(e)}}const i=[];n===null||n===void 0?void 0:n.keys.forEach(e=>{if(e.name!=="IsActiveEntity"){i.push(ge(e.name,undefined))}});return Ie([o,ge(`filteredMessages`,"internal"),t&&ke.HasActive,t&&ke.IsActive,`${t}`,...i],l.rowHighlighting,n)}function It(e,t,n,o,i){var a;const l=(o===null||o===void 0?void 0:o.create)||(o===null||o===void 0?void 0:o.detail);const r=n.getManifestControlConfiguration(i);const s=r&&r.tableSettings||{};if(l!==null&&l!==void 0&&l.outbound&&l.outboundDetail&&o!==null&&o!==void 0&&o.create){return{mode:"External",outbound:l.outbound,outboundDetail:l.outboundDetail,navigationSettings:o}}let d;if(e){var u,c,v;const e=(u=n.getEntitySet())===null||u===void 0?void 0:u.annotations;const o=e===null||e===void 0?void 0:e.Common,i=e===null||e===void 0?void 0:e.Session;d=(o===null||o===void 0?void 0:(c=o.DraftRoot)===null||c===void 0?void 0:c.NewAction)||(i===null||i===void 0?void 0:(v=i.StickySessionSupported)===null||v===void 0?void 0:v.NewAction);if(t.creationMode===K.CreationRow&&d){throw Error(`Creation mode '${K.CreationRow}' can not be used with a custom 'new' action (${d})`)}if(l!==null&&l!==void 0&&l.route){var f;return{mode:t.creationMode,append:t.createAtEnd,newAction:(f=d)===null||f===void 0?void 0:f.toString(),navigateToTarget:t.creationMode===K.NewPage?l.route:undefined}}}if(t.creationMode===K.NewPage){var p;t.creationMode=K.Inline;if(((p=s.creationMode)===null||p===void 0?void 0:p.createAtEnd)===undefined){t.createAtEnd=false}}return{mode:t.creationMode,append:t.createAtEnd,newAction:(a=d)===null||a===void 0?void 0:a.toString()}}const Pt=function(e,t,n,o,i){let a,r;let s=De(Se.None);const u=t.getEntityType();if(n&&e){var v,f;r=((v=n.display)===null||v===void 0?void 0:v.target)||((f=n.detail)===null||f===void 0?void 0:f.outbound);if(r){a=".handlers.onChevronPressNavigateOutBound( $controller ,'"+r+"', ${$parameters>bindingContext})"}else if(u){var p,g,m;const l=t.getEntitySet();r=(p=n.detail)===null||p===void 0?void 0:p.route;s=Tt((g=e.annotations)===null||g===void 0?void 0:(m=g.UI)===null||m===void 0?void 0:m.Criticality,!!d.getDraftRoot(l)||!!d.getDraftNode(l),u);if(r&&c.isEntitySet(l)){a="API.onTableRowPress($event, $controller, ${$parameters>bindingContext}, { callExtension: true, targetPath: '"+o+"', editable : "+(d.getDraftRoot(l)||d.getDraftNode(l)?"!${$parameters>bindingContext}.getProperty('IsActiveEntity')":"undefined")+(i==="AnalyticalTable"||i==="TreeTable"?", bRecreateContext: true":"")+"})"}}}const y=Ie([ge("/deepestPath","internal")],l.navigatedRow,u);return{press:a,action:a?"Navigation":undefined,rowHighlighting:Fe(s),rowNavigated:Fe(y),visible:Fe(ye(Ve.IsInactive))}};const At=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let o=arguments.length>3?arguments[3]:undefined;let i=arguments.length>4?arguments[4]:undefined;let a=arguments.length>5?arguments[5]:undefined;let l=arguments.length>6?arguments[6]:undefined;const r=n;const s=new _(t,i);t.entityProperties.forEach(t=>{const d=n.some(e=>e.name===t.name);if(!t.targetType&&!d){const n=Je(t.name,t,i,true,a);const d=Object.keys(n.properties);const u=Object.keys(n.additionalProperties);if(n.textOnlyPropertiesFromTextAnnotation.length>0){l.push(...n.textOnlyPropertiesFromTextAnnotation)}const c=Dt(t,i.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),t.name,true,true,o,s,i,l);const v=i.getAnnotationsByTerm("Common","com.sap.vocabularies.Common.v1.SemanticKey",[i.getEntityType()])[0];const f=Wt(c.name,v,false,null);if(Object.keys(f).length>0){c.formatOptions={...f}}if(d.length>0){c.propertyInfos=d;c.exportSettings={...c.exportSettings,template:n.exportSettingsTemplate,wrap:n.exportSettingsWrapping};c.exportSettings.type=cn(t.type,d.length>1);if(n.exportUnitName){c.exportSettings.unitProperty=n.exportUnitName;c.exportSettings.type="Currency"}else if(n.exportUnitString){c.exportSettings.unit=n.exportUnitString}if(n.exportTimezoneName){c.exportSettings.timezoneProperty=n.exportTimezoneName;c.exportSettings.utc=false}else if(n.exportTimezoneString){c.exportSettings.timezone=n.exportTimezoneString}if(n.exportDataPointTargetValue){c.exportDataPointTargetValue=n.exportDataPointTargetValue;c.exportSettings.type="String"}d.forEach(t=>{e[t]=n.properties[t]})}if(u.length>0){c.additionalPropertyInfos=u;u.forEach(t=>{e[t]=n.additionalProperties[t]})}r.push(c)}if(te(t)==="Description"){o=o.concat(t.name);r.push(Dt(t,i.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),t.name,false,false,o,s,i,[]))}});const d=Ut(e,r,o,i,t,l);return r.concat(d)};F.getColumnsFromEntityType=At;const Dt=function(e,t,n,o,i,a,l,r,s){var d,u,c,v,f;const p=o?n:`Property::${n}`;const g=(o?"DataField::":"Property::")+ve(n);const m=Qe(r,e);const y=((d=e.annotations)===null||d===void 0?void 0:(u=d.UI)===null||u===void 0?void 0:(c=u.Hidden)===null||c===void 0?void 0:c.valueOf())===true;const b=e.name?kt(e.name,true,false):undefined;const h=b!=e.name;const T=cn(e.type);const I=e.type==="Edm.Date"?"YYYY-MM-DD":undefined;const P=_e(e);const A=Cn(e,P);const D=r.getAnnotationsByTerm("Common","com.sap.vocabularies.Common.v1.SemanticKey",[r.getEntityType()])[0];const F=s&&s.indexOf(n)>=0;const C=(!y||F)&&a.indexOf(n)===-1;const S={className:e.type||P,formatOptions:A.formatOptions,constraints:A.constraints};let E=null;if(Ft(e)){var O,x,M,U,$,N;const t=Z(e)||J(e);const n=X(e);const o=((O=e.annotations)===null||O===void 0?void 0:(x=O.Measures)===null||x===void 0?void 0:x.ISOCurrency)||((M=e.annotations)===null||M===void 0?void 0:(U=M.Measures)===null||U===void 0?void 0:U.Unit);const i=($=e.annotations)===null||$===void 0?void 0:(N=$.Common)===null||N===void 0?void 0:N.Timezone;E={type:T,inputFormat:I,scale:e.scale,delimiter:e.type==="Edm.Int64"};if(t){E.unitProperty=t.name;E.type="Currency"}else if(o){E.unit=`${o}`}if(n){E.timezoneProperty=n.name;E.utc=false}else if(i){E.timezone=i.toString()}}const w=Dn(n,r);const V={key:g,type:Xe.Annotation,label:Ot(e,h),groupLabel:h?Ot(e):undefined,group:h?b:undefined,annotationPath:t,semanticObjectPath:m,availability:!i||y?"Hidden":"Adaptation",name:p,relativePath:n,sortable:C,isGroupable:l.isAnalyticsSupported()?!!l.isPropertyGroupable(e):C,isKey:e.isKey,exportSettings:E,caseSensitive:jt(r),typeConfig:S,importance:Yt((v=e.annotations)===null||v===void 0?void 0:(f=v.UI)===null||f===void 0?void 0:f.DataFieldDefault,D),additionalLabels:w};const k=xt(e);if(k){V.tooltip=k}const L=qe(e);if(Ge(e)&&typeof L==="string"&&V.exportSettings){V.exportDataPointTargetValue=L;V.exportSettings.template="{0}/"+L}return V};function Ft(e){var t;let n,o;const i=(t=e.annotations.UI)===null||t===void 0?void 0:t.DataFieldDefault;if(se(e)&&i!==null&&i!==void 0&&i.$Type){if(Q(i)===true){return false}n=i===null||i===void 0?void 0:i.$Type}else if(Q(e)===true){return false}else{var a,l,r,s,d,u,c,v,f,p,g;o=e;n=o.$Type;if(n==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&(a=o.Target)!==null&&a!==void 0&&(l=a.$target)!==null&&l!==void 0&&l.$Type){var m,y;n=(m=o.Target)===null||m===void 0?void 0:(y=m.$target)===null||y===void 0?void 0:y.$Type;return"com.sap.vocabularies.UI.v1.ChartDefinitionType".indexOf(n)===-1}else if(((r=o.Value)===null||r===void 0?void 0:(s=r.$target)===null||s===void 0?void 0:(d=s.annotations)===null||d===void 0?void 0:(u=d.Core)===null||u===void 0?void 0:(c=u.MediaType)===null||c===void 0?void 0:c.term)==="Org.OData.Core.V1.MediaType"&&((v=o.Value)===null||v===void 0?void 0:(f=v.$target)===null||f===void 0?void 0:(p=f.annotations)===null||p===void 0?void 0:(g=p.Core)===null||g===void 0?void 0:g.isURL)!==true){return false}}return n?["com.sap.vocabularies.UI.v1.DataFieldForAction","com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation","com.sap.vocabularies.UI.v1.DataFieldForActionGroup"].indexOf(n)===-1:true}const Ct=function(e){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":return!!e.Inline;case"com.sap.vocabularies.UI.v1.DataFieldWithAction":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":return true;default:}};const St=function(e){var t,n,o,i,a,l;const r=e.targetObject;let s;if(r){switch(r.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":case"com.sap.vocabularies.UI.v1.DataPointType":s=r.Value.$target;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":if((r===null||r===void 0?void 0:(t=r.Target)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"){var d;s=(d=r.Target.$target)===null||d===void 0?void 0:d.Value.$target}break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldForAction":default:s=undefined}}const u=De(false);const c=De(false);return Ce(...[ye(Pe(Te(r===null||r===void 0?void 0:(o=r.annotations)===null||o===void 0?void 0:(i=o.UI)===null||i===void 0?void 0:i.Hidden),true)),he(!!s,s&&ye(Pe(Te((a=s.annotations)===null||a===void 0?void 0:(l=a.UI)===null||l===void 0?void 0:l.Hidden),true)),true),me(ye(u),c)])};F._getVisibleExpression=St;const Et=function(e){var t,n;const o=[];if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((t=e.Target)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){var i,a;if(e!==null&&e!==void 0&&(i=e.annotations)!==null&&i!==void 0&&(a=i.UI)!==null&&a!==void 0&&a.Hidden){return Fe(ye(Pe(Te(e.annotations.UI.Hidden),true)))}else{var l;(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{o.push(St({targetObject:e}))});return Fe(he(me(...o),De(true),De(false)))}}else{return undefined}};const Ot=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!e){return undefined}if(se(e)||ue(e)){var n,o,i,a,l;const t=(n=e.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:o.DataFieldDefault;if(t&&!t.qualifier&&(i=t.Label)!==null&&i!==void 0&&i.valueOf()){var r;return Fe(Te((r=t.Label)===null||r===void 0?void 0:r.valueOf()))}return Fe(Te(((a=e.annotations.Common)===null||a===void 0?void 0:(l=a.Label)===null||l===void 0?void 0:l.valueOf())||e.name))}else if(Ke(e)){var s,d,u,c,v,f,p,g;if(!!t&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation"){var m;return Fe(Te((m=e.Label)===null||m===void 0?void 0:m.valueOf()))}return Fe(Te(((s=e.Label)===null||s===void 0?void 0:s.valueOf())||((d=e.Value)===null||d===void 0?void 0:(u=d.$target)===null||u===void 0?void 0:(c=u.annotations)===null||c===void 0?void 0:(v=c.Common)===null||v===void 0?void 0:(f=v.Label)===null||f===void 0?void 0:f.valueOf())||((p=e.Value)===null||p===void 0?void 0:(g=p.$target)===null||g===void 0?void 0:g.name)))}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"){var y,b,h,T,I,P,A,D;return Fe(Te(((y=e.Label)===null||y===void 0?void 0:y.valueOf())||((b=e.Target)===null||b===void 0?void 0:(h=b.$target)===null||h===void 0?void 0:(T=h.Value)===null||T===void 0?void 0:(I=T.$target)===null||I===void 0?void 0:(P=I.annotations)===null||P===void 0?void 0:(A=P.Common)===null||A===void 0?void 0:(D=A.Label)===null||D===void 0?void 0:D.valueOf())))}else{var F;return Fe(Te((F=e.Label)===null||F===void 0?void 0:F.valueOf()))}};const xt=function(e){var t,n;if(!e){return undefined}if(se(e)||(t=e.annotations)!==null&&t!==void 0&&(n=t.Common)!==null&&n!==void 0&&n.QuickInfo){var o,i;return(o=e.annotations)!==null&&o!==void 0&&(i=o.Common)!==null&&i!==void 0&&i.QuickInfo?Fe(Te(e.annotations.Common.QuickInfo.valueOf())):undefined}else if(Ke(e)){var a,l,r,s;return(a=e.Value)!==null&&a!==void 0&&(l=a.$target)!==null&&l!==void 0&&(r=l.annotations)!==null&&r!==void 0&&(s=r.Common)!==null&&s!==void 0&&s.QuickInfo?Fe(Te(e.Value.$target.annotations.Common.QuickInfo.valueOf())):undefined}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"){var d,u,c,v,f;const t=(d=e.Target)===null||d===void 0?void 0:d.$target;return t!==null&&t!==void 0&&(u=t.Value)!==null&&u!==void 0&&(c=u.$target)!==null&&c!==void 0&&(v=c.annotations)!==null&&v!==void 0&&(f=v.Common)!==null&&f!==void 0&&f.QuickInfo?Fe(Te(t.Value.$target.annotations.Common.QuickInfo.valueOf())):undefined}else{return undefined}};function Mt(e,t){return Ie([ge(`semanticKeyHasDraftIndicator`,"internal"),ge(`filteredMessages`,"internal"),e,t],l.getErrorStatusTextVisibilityFormatter)}F.getRowStatusVisibility=Mt;const Ut=function(e,t,n,o,i,a){const l=[];const r={};const s=new _(i,o);Object.keys(e).forEach(i=>{const d=e[i],u=o.getAbsoluteAnnotationPath(i),c=t.find(e=>e.name===i);if(c===undefined){const e=Dt(d,u,i,true,false,n,s,o,a);e.isPartOfLineItem=t.some(e=>{var t;return((t=e.propertyInfos)===null||t===void 0?void 0:t.includes(i))&&e.isPartOfLineItem});l.push(e)}else if(c.annotationPath!==u||c.propertyInfos){const e=`Property::${i}`;if(!t.some(t=>t.name===e)){const t=Dt(d,u,i,false,false,n,s,o,a);t.isPartOfLineItem=c.isPartOfLineItem;l.push(t);r[i]=e}else if(t.some(t=>t.name===e)&&t.some(e=>{var t;return(t=e.propertyInfos)===null||t===void 0?void 0:t.includes(i)})){r[i]=e}}});t.forEach(e=>{var t,n;e.propertyInfos=(t=e.propertyInfos)===null||t===void 0?void 0:t.map(e=>r[e]??e);e.additionalPropertyInfos=(n=e.additionalPropertyInfos)===null||n===void 0?void 0:n.map(e=>r[e]??e)});return l};const $t=function(e){var t,n,o;if(Ke(e)){var i;return(i=e.Value)===null||i===void 0?void 0:i.path}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&(t=e.Target)!==null&&t!==void 0&&(n=t.$target)!==null&&n!==void 0&&(o=n.Value)!==null&&o!==void 0&&o.path){var a,l;return(a=e.Target)===null||a===void 0?void 0:(l=a.$target)===null||l===void 0?void 0:l.Value.path}else{return Ee.generateKeyFromDataField(e)}};const Nt=function(e,t,n){const o=`Property_Technical::${e}`;const i=t.find(e=>e.key===o);const a=!i&&t.find(t=>t.name===e&&!t.propertyInfos);if(a){const i={key:o,type:Xe.Annotation,label:a.label,annotationPath:a.annotationPath,availability:"Hidden",name:o,relativePath:a.relativePath,sortable:false,isGroupable:false,isKey:false,exportSettings:null,caseSensitive:false,aggregatable:false,extension:{technicallyGroupable:true,technicallyAggregatable:true}};t.push(i);n[e]=i.name}};const wt=function(e,t,n){var o;const i=(o=n.getManifestControlConfiguration(t))===null||o===void 0?void 0:o.columns;const a=i&&Object.keys(i);return a&&!!a.find(function(t){return t===e&&i[t].showDataFieldsLabel})};const Vt=function(e){var t,n;let o="";switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":o=e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:t.path;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":o=e===null||e===void 0?void 0:(n=e.Target)===null||n===void 0?void 0:n.value;break;case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldForActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldWithActionGroup":o=Ee.generateKeyFromDataField(e);break}return o};const kt=function(e,t,n){const o=t?e.lastIndexOf("/"):e.indexOf("/");if(o===-1){return e}return n?e.substring(o+1,e.length):e.substring(0,o)};const Lt=function(e,t){if(Ke(e)&&de(e.Value)){const n=le(t.getDataModelObjectPath(),e.Value.path);return Y(n)}else{return false}};const Rt=function(e,t,n){return n.indexOf(t)===-1&&(e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithAction")};const jt=function(e){const t=Ht(e);return Array.isArray(t)?t.indexOf("tolower")===-1:true};F.isFilteringCaseSensitive=jt;function Ht(e){const t=e.getEntitySet();if(c.isEntitySet(t)){var n,o;return((n=t.annotations.Capabilities)===null||n===void 0?void 0:n.FilterFunctions)??((o=e.getEntityContainer().annotations.Capabilities)===null||o===void 0?void 0:o.FilterFunctions)}return undefined}function Bt(e){return e===undefined?undefined:{textLinesEdit:4,...e}}function zt(e,t){const n=[];let o=false;for(let i=0;i<e.length;i++){n.push(e[i].value);if(e[i].value===t){o=true}}return{values:n,semanticKeyFound:o}}function Gt(e,t){let n=false;let o;if(e&&e.length>=1&&t&&t.length>=1){for(let i=0;i<e.length;i++){if([e[i]].some(e=>t.indexOf(e)>=0)){n=true;o=e[i];break}}}return{semanticKeyHasPropertyInFieldGroup:n,fieldGroupPropertyPath:o}}function Kt(e,t){var n,o;const i=[];let a={semanticKeyHasPropertyInFieldGroup:false,fieldGroupPropertyPath:undefined};if(e&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((n=e.Target)===null||n===void 0?void 0:(o=n.$target)===null||o===void 0?void 0:o.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){var l;(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{if((e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl")&&e.Value){i.push(e.Value.path)}a=Gt(t,i)})}return{semanticKeyHasPropertyInFieldGroup:a.semanticKeyHasPropertyInFieldGroup,propertyPath:a.fieldGroupPropertyPath}}function Wt(e,t,n,o){if(!t){return{}}const i=zt(t,e);const a=Kt(o,i.values);if(i.semanticKeyFound){const t={hasDraftIndicator:true,semantickeys:i.values,showErrorObjectStatus:Fe(Mt(e,false))};if(n&&a.semanticKeyHasPropertyInFieldGroup){t.showErrorObjectStatus=Fe(Mt(e,true));t.fieldGroupDraftIndicatorPropertyPath=a.propertyPath}return t}else if(!a.semanticKeyHasPropertyInFieldGroup){return{}}else{return{fieldGroupDraftIndicatorPropertyPath:a.propertyPath,fieldGroupName:e,showErrorObjectStatus:Fe(Mt(e,true))}}}function qt(e){var t,n;const o=e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance;if(o&&o.includes("UI.ImportanceType/High")){return 3}if(o&&o.includes("UI.ImportanceType/Medium")){return 2}if(o&&o.includes("UI.ImportanceType/Low")){return 1}return 0}function Qt(e){var t,n;const o=e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance;return o?o.split("/")[1]:z.None}function _t(e){if(e&&e.length>0){let t=-1;let n=-1;let o;for(const i of e){n=qt(i);if(n>t){t=n;o=i}}return Qt(o)}return z.None}function Yt(e,t){var n;let o,i=[];if(t&&t.length>0){i=t.map(function(e){return e.value})}if(!e){return undefined}if(ce(e,"com.sap.vocabularies.UI.v1.DataFieldForAnnotation")){const t=e.Target.$target;if(ce(t,"com.sap.vocabularies.UI.v1.FieldGroupType")){const n=t.Data;const r=n&&n.some(function(e){var t,n;return(e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:t.path)&&e.$Type!=="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&i.includes(e===null||e===void 0?void 0:(n=e.Value)===null||n===void 0?void 0:n.path)});if(r){return z.High}else{var a,l;if(e!==null&&e!==void 0&&(a=e.annotations)!==null&&a!==void 0&&(l=a.UI)!==null&&l!==void 0&&l.Importance){return Qt(e)}o=n&&n.filter(function(e){var t,n;return e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance});return _t(o)}}}return e.Value&&e!==null&&e!==void 0&&(n=e.Value)!==null&&n!==void 0&&n.path&&i.includes(e.Value.path)?z.High:Qt(e)}F.getImportance=Yt;const Jt=function(e,t,n){var o;const i=n.getAnnotationEntityType(e),a=[],l={},r=ee(n.getEntitySet()),s=n.getManifestControlConfiguration(t),d=(s===null||s===void 0?void 0:(o=s.tableSettings)===null||o===void 0?void 0:o.type)||"ResponsiveTable";const u=[];const c=n.getAnnotationsByTerm("Common","com.sap.vocabularies.Common.v1.SemanticKey",[n.getEntityType()])[0];if(e){const o=n.getConverterContextFor(ae(n.getDataModelObjectPath()));e.forEach(e=>{var i,s,v,f,p,g,m,y,b,h,T;if(!Ct(e)){return}let I=null;const P=Ke(e)&&(i=e.Value)!==null&&i!==void 0&&(s=i.$target)!==null&&s!==void 0&&s.fullyQualifiedName?Qe(n,e):undefined;const A=Vt(e);const D=Ye(e,n,d);const F=Object.keys(D.properties);const C=Object.keys(D.additionalProperties);const S=kt(A,true,false);const E=S!=A;const O=Ot(e,E);const x=$t(e);const M=S.indexOf(`@${"com.sap.vocabularies.UI.v1.FieldGroup"}`)>-1;const U=M?wt(x,t,n):false;const $=_e(e);const N=$==="Edm.Date"?"YYYY-MM-DD":undefined;const w=Bt(Wt(x,c,M,e));let V;if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((v=e.Target)===null||v===void 0?void 0:(f=v.$target)===null||f===void 0?void 0:f.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){V=Et(e)}if(Ft(e)){I={template:D.exportSettingsTemplate,wrap:D.exportSettingsWrapping,type:$?cn($,F.length>1):undefined,inputFormat:N,delimiter:$==="Edm.Int64"};if(D.exportUnitName){I.unitProperty=D.exportUnitName;I.type="Currency"}else if(D.exportUnitString){I.unit=D.exportUnitString}if(D.exportTimezoneName){I.timezoneProperty=D.exportTimezoneName}else if(D.exportTimezoneString){I.timezone=D.exportTimezoneString}}let k;if($){k=Cn(e,$)}const L={className:$,formatOptions:{...w,...(p=k)===null||p===void 0?void 0:p.formatOptions},constraints:{...(g=k)===null||g===void 0?void 0:g.constraints}};const R={};if(!$||!L){R.widthCalculation=null}const j=Lt(e,o);const H=!j&&Rt(e,A,r);const B={key:Ee.generateKeyFromDataField(e),type:Xe.Annotation,label:O,groupLabel:E?Ot(e):undefined,group:E?S:undefined,FieldGroupHiddenExpressions:V,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),semanticObjectPath:P,availability:Q(e)?"Hidden":"Default",name:x,showDataFieldsLabel:U,relativePath:A,sortable:H,propertyInfos:F.length?F:undefined,additionalPropertyInfos:C.length>0?C:undefined,exportSettings:I,width:((m=e.annotations)===null||m===void 0?void 0:(y=m.HTML5)===null||y===void 0?void 0:(b=y.CssDefaults)===null||b===void 0?void 0:(h=b.width)===null||h===void 0?void 0:h.valueOf())||undefined,importance:Yt(e,c),isNavigable:true,formatOptions:w,caseSensitive:jt(n),typeConfig:L,visualSettings:R,timezoneText:(T=I)===null||T===void 0?void 0:T.timezone,isPartOfLineItem:true};const z=xt(e);if(z){B.tooltip=z}if(D.textOnlyPropertiesFromTextAnnotation.length>0){u.push(...D.textOnlyPropertiesFromTextAnnotation)}if(D.exportDataPointTargetValue&&B.exportSettings){B.exportDataPointTargetValue=D.exportDataPointTargetValue;B.exportSettings.type="String"}a.push(B);F.forEach(e=>{l[e]=D.properties[e];if(j){r.push(e)}});C.forEach(e=>{l[e]=D.additionalProperties[e]})})}return At(l,i,a,r,n,d,u)};const Xt=function(e,t,n,o){let i;if(e){i=e.map(function(e){const i=t.find(function(t){return t.relativePath===e&&t.propertyInfos===undefined});if(i){return i.name}else{const i=Ut({[e]:o.resolvePath(e)},t,[],n,o,[]);t.push(i[0]);return i[0].name}})}return i};const Zt=function(e){return e.map(t=>`{${e.indexOf(t)}}`).join(`${"\n"}`)};const en=function(e,t,n,o,i){const a={};function l(e,n){return t.some(e=>e.key===n)}function r(e){return e.type===Xe.Slot}function s(e){return e.type===undefined&&!!e.template}function d(e,t){const o=ee(n.getEntitySet());e.forEach(e=>{t.forEach(t=>{if(t.name===e){t.sortable=o.indexOf(e.replace("Property::",""))===-1;t.isGroupable=t.sortable}})})}for(const v in e){var u;const f=e[v];Ee.validateKey(v);const p={key:v,width:f.width||undefined,position:{anchor:(u=f.position)===null||u===void 0?void 0:u.anchor,placement:f.position===undefined?$e.After:f.position.placement},caseSensitive:jt(n)};if(l(f,v)){const e={...p,importance:f===null||f===void 0?void 0:f.importance,horizontalAlign:f===null||f===void 0?void 0:f.horizontalAlign,availability:f===null||f===void 0?void 0:f.availability,type:Xe.Annotation,isNavigable:l(f,v)?undefined:je(f,i,true),settings:f.settings,formatOptions:Bt(f.formatOptions)};a[v]=e}else{const e=Xt(f.properties,t,n,o);const i={...p,header:f.header,importance:(f===null||f===void 0?void 0:f.importance)||z.None,horizontalAlign:(f===null||f===void 0?void 0:f.horizontalAlign)||G.Begin,availability:(f===null||f===void 0?void 0:f.availability)||"Default",template:f.template,propertyInfos:e,exportSettings:e?{template:Zt(e),wrap:!!(e.length>1)}:null,id:`CustomColumn::${v}`,name:`CustomColumn::${v}`,formatOptions:{textLinesEdit:4},isGroupable:false,isNavigable:false,sortable:false,visualSettings:{widthCalculation:null},properties:f.properties};if(e){d(e,t)}if(r(f)){const e={...i,type:Xe.Slot};a[v]=e}else if(s(f)){const e={...i,type:Xe.Default};a[v]=e}else{var c;const e=`The annotation column '${v}' referenced in the manifest is not found`;n.getDiagnostics().addIssue(Ue.Manifest,xe.Low,e,Me,Me===null||Me===void 0?void 0:(c=Me.AnnotationColumns)===null||c===void 0?void 0:c.InvalidKey)}}}return a};function tn(e,t,n){var o;const i=t.getManifestWrapper();const a=t.getManifestControlConfiguration(e);const l=i.getVariantManagement();const r=[];const s=n.type==="AnalyticalTable";const d=n.type==="ResponsiveTable";if((a===null||a===void 0?void 0:(o=a.tableSettings)===null||o===void 0?void 0:o.personalization)!==undefined){const e=a.tableSettings.personalization;if(e===true){switch(n.type){case"AnalyticalTable":return"Sort,Column,Filter,Group,Aggregate";case"ResponsiveTable":return"Sort,Column,Filter,Group";default:return"Sort,Column,Filter"}}else if(typeof e==="object"){if(e.sort){r.push("Sort")}if(e.column){r.push("Column")}if(e.filter){r.push("Filter")}if(e.group&&(s||d)){r.push("Group")}if(e.aggregate&&s){r.push("Aggregate")}return r.length>0?r.join(","):undefined}}else{r.push("Sort");r.push("Column");if(t.getTemplateType()===H.ListReport){if(l===j.Control||nn(i,t)){r.push("Filter")}}else{r.push("Filter")}if(s){r.push("Group");r.push("Aggregate")}if(d){r.push("Group")}return r.join(",")}return undefined}F.getP13nMode=tn;function nn(e,t){return e.isFilterBarHidden()&&!t.getManifestWrapper().hasMultipleVisualizations()&&t.getTemplateType()!==H.AnalyticalListPage}function on(e,t,n){const o=ee(e.getEntitySet());let i;if(t!==null&&t!==void 0&&t.SortOrder){const e=[];const a={sorters:e};t.SortOrder.forEach(e=>{var t;const i=e.Property;if(i&&o.indexOf((t=i.$target)===null||t===void 0?void 0:t.name)===-1){const t=ln([i],n)[0];if(t){a.sorters.push({name:t,descending:!!e.Descending})}}});i=a.sorters.length?JSON.stringify(a):undefined}return i}function an(e){var t;if(!e){return undefined}const n=(t=e.InitialExpansionLevel)===null||t===void 0?void 0:t.valueOf();return typeof n==="number"?n:undefined}function ln(e,t){const n=[];let o,i;e.forEach(e=>{if(e!==null&&e!==void 0&&e.value){o=t.find(t=>{i=t;return!i.propertyInfos&&i.relativePath===(e===null||e===void 0?void 0:e.value)});if(o){n.push(o.name)}}});return n}function rn(e,t,n){let o;if(e!==null&&e!==void 0&&e.GroupBy){let i=e.GroupBy;if(n==="ResponsiveTable"){i=i.slice(0,1)}const a=ln(i,t).map(e=>({name:e}));o=a.length?JSON.stringify({groupLevels:a}):undefined}return o}function sn(e){const t={};e.columns.forEach(n=>{var o;n=n;const i=Object.keys(e.aggregates).find(e=>e===n.name);if(i){const t=e.aggregates[i];n.aggregatable=true;n.extension={customAggregate:t.defaultAggregate??{}}}if((o=n.additionalPropertyInfos)!==null&&o!==void 0&&o.length){n.additionalPropertyInfos.forEach(n=>{Nt(n,e.columns,t)})}});e.columns.forEach(e=>{e=e;if(e.additionalPropertyInfos){var n;e.additionalPropertyInfos=e.additionalPropertyInfos.map(e=>t[e]??e);e.propertyInfos=(n=e.propertyInfos)===null||n===void 0?void 0:n.concat(e.additionalPropertyInfos)}})}function dn(e,t){let n;if(e!==null&&e!==void 0&&e.Total){const o=e.Total;const i={};ln(o,t).forEach(e=>{i[e]={}});n=JSON.stringify(i)}return n}function un(e,t,n,o,i,a,l){var r,s,d;const{navigationPropertyPath:u}=vn(t);const c=(r=n.getDataModelObjectPath().targetEntityType.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:(d=s.HeaderInfo)===null||d===void 0?void 0:d.TypeNamePlural;const v=c&&Fe(Te(c));const f=n.getDataModelObjectPath().targetEntitySet;const p=n.getManifestWrapper();const g=u.length===0,m=tn(t,n,o),y=u?q(t):q(n.getContextPath(),"LineItem");const b=yt(n);const h=ot(n,u);const T=p.getNavigationConfiguration(h);const I=It(e,o,n,T,t);const P=k(n,I.mode,o,l);const A=w(n,P);const D=$(n,P);const F=N(P,S(n));const U=bt(e,t,n,g,b,A,D);let L=u?10:30;if(a!==null&&a!==void 0&&a.MaxItems){L=a.MaxItems.valueOf()}const R=p.getVariantManagement();const B=oe(n.getDataModelObjectPath());const z={create:M(n,P),delete:x(n,P),paste:E(n,P,F),massEdit:O(n,P),creationRow:V(n,P)};return{id:y,entityName:f?f.name:"",collection:ae(n.getDataModelObjectPath()),navigationPath:u,row:Pt(e,n,T,h,o.type),p13nMode:m,standardActions:{actions:z,isInsertUpdateTemplated:F,updatablePropertyPath:dt(n)},displayMode:C(n,l),create:I,selectionMode:U,autoBindOnInit:nn(p,n)||n.getTemplateType()!==H.ListReport&&n.getTemplateType()!==H.AnalyticalListPage&&!(l&&p.hasMultipleVisualizations(l)),variantManagement:R==="Control"&&!m?j.None:R,threshold:L,sortConditions:on(n,a,i),title:v,searchable:o.type!=="AnalyticalTable"&&!(be(B)&&B.value===false),initialExpansionLevel:an(a)}}F.getTableAnnotationConfiguration=un;function cn(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n="String";if(t){if(e==="Edm.DateTimeOffset"){n="DateTime"}return n}else{switch(e){case"Edm.Decimal":case"Edm.Int32":case"Edm.Int64":case"Edm.Double":case"Edm.Byte":n="Number";break;case"Edm.DateOfTime":case"Edm.Date":n="Date";break;case"Edm.DateTimeOffset":n="DateTime";break;case"Edm.TimeOfDay":n="Time";break;case"Edm.Boolean":n="Boolean";break;default:n="String"}}return n}function vn(e){const[t,n]=e.split("@");let o=t;if(o.lastIndexOf("/")===o.length-1){o=o.substr(0,o.length-1)}return{navigationPropertyPath:o,annotationPath:n}}F.splitPath=vn;function fn(e,t){const n=t.getEntityTypeAnnotation(e);const o=n.annotation;if(o){var i,a;const e=[];(i=o.SelectOptions)===null||i===void 0?void 0:i.forEach(t=>{const n=t.PropertyName;const o=(n===null||n===void 0?void 0:n.value)??"";if(e.indexOf(o)===-1){e.push(o)}});return{text:o===null||o===void 0?void 0:(a=o.Text)===null||a===void 0?void 0:a.toString(),propertyNames:e}}return undefined}F.getSelectionVariantConfiguration=fn;function pn(e,t,n){let o=e.enableFullScreen??n;if(!n&&o&&t.getTemplateType()===H.ListReport){o=false;t.getDiagnostics().addIssue(Ue.Manifest,xe.Low,Oe.FULLSCREENMODE_NOT_ON_LISTREPORT)}return o}function gn(e,t,n){let o;if(t!=="ResponsiveTable"){return undefined}switch(n.getTemplateType()){case H.ListReport:case H.AnalyticalListPage:o=!e.selectAll?"ClearAll":"Default";break;case H.ObjectPage:o=e.selectAll===false?"ClearAll":"Default";if(n.getManifestWrapper().useIconTabBar()){o=!e.selectAll?"ClearAll":"Default"}break;default:}return o}function mn(e,t,n){let o=(e===null||e===void 0?void 0:e.type)||"ResponsiveTable";if((o==="AnalyticalTable"||o==="TreeTable")&&!n.getManifestWrapper().isDesktop()){o="ResponsiveTable"}return o}function yn(e,t,n){if(e==="GridTable"){if(n){return{rowCountMode:"Auto",rowCount:3}}else{return{rowCountMode:t.rowCountMode??"Fixed",rowCount:t.rowCount?t.rowCount:5}}}else{return{}}}function bn(e,t){return t.condensedTableLayout!==undefined&&e!=="ResponsiveTable"?t.condensedTableLayout:false}function hn(e){return e.selectAll===true||e.selectionLimit===0?0:e.selectionLimit||200}function Tn(e){var t,n;return(t=e.creationMode)!==null&&t!==void 0&&t.inlineCreationRowCount?(n=e.creationMode)===null||n===void 0?void 0:n.inlineCreationRowCount:2}function In(e,t,n,o,i){var a;if(n){t.push({annotationPath:o.annotationPath})}return{quickFilters:{enabled:i.getTemplateType()!==H.ListReport,showCounts:e===null||e===void 0?void 0:(a=e.quickVariantSelection)===null||a===void 0?void 0:a.showCounts,paths:t}}}function Pn(e,t,n){return e.enableExport!==undefined?e.enableExport:t.getTemplateType()!=="ObjectPage"||n}function An(e,t,n){var o,i,a;if(!t){return{}}const l=[];const r=n.getAnnotationEntityType(t);let s;let d;e===null||e===void 0?void 0:(o=e.quickVariantSelection)===null||o===void 0?void 0:(i=o.paths)===null||i===void 0?void 0:i.forEach(t=>{s=r.resolvePath(t.annotationPath);d=In(e,l,s,t,n)});let u=false;u=!!((a=e.quickVariantSelection)!==null&&a!==void 0&&a.hideTableTitle);return{filters:d,headerVisible:!(s&&u)}}function Dn(e,t){const n=le(t.getDataModelObjectPath(),e).navigationProperties;if((n===null||n===void 0?void 0:n.length)>0){const e=[];n.forEach(t=>{e.push(Ot(t)||t.name)});return e}}function Fn(e,t,n){var o,i,a,l,r,s,d,u;let c=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const v=n.getManifestWrapper();const f=n.getManifestControlConfiguration(t);const p=f&&f.tableSettings||{};const g=((o=p.creationMode)===null||o===void 0?void 0:o.name)||K.NewPage;const m=!v.isPhone();const y=p.enablePaste!==undefined?p.enablePaste:n.getTemplateType()==="ObjectPage";const b=n.getTemplateType();const h=b===H.ListReport?"API.dataStateIndicatorFilter":undefined;const T=c&&v.isCondensedLayoutCompliant();const I=An(p,e,n);const P=(i=p.creationMode)===null||i===void 0?void 0:i.customValidationFunction;const A=n.getEntityType();const D=new _(A,n);const F=mn(p,D,n);const C=yn(F,p,b===H.ListReport);const S=bn(F,p);const E={createAtEnd:((a=p.creationMode)===null||a===void 0?void 0:a.createAtEnd)!==undefined?(l=p.creationMode)===null||l===void 0?void 0:l.createAtEnd:g!==K.Inline,creationMode:g,customValidationFunction:P,dataStateIndicatorFilter:h,disableAddRowButtonForEmptyData:!P?!!((r=p.creationMode)!==null&&r!==void 0&&r.disableAddRowButtonForEmptyData):false,enableAutoColumnWidth:m,enableExport:Pn(p,n,y),enableFullScreen:pn(p,n,v.isPhone()),enableMassEdit:p===null||p===void 0?void 0:p.enableMassEdit,enablePaste:y,headerVisible:true,multiSelectMode:gn(p,F,n),selectionLimit:hn(p),inlineCreationRowCount:Tn(p),inlineCreationRowsHiddenInEditMode:(p===null||p===void 0?void 0:(s=p.creationMode)===null||s===void 0?void 0:s.inlineCreationRowsHiddenInEditMode)??false,showRowCount:!(p!==null&&p!==void 0&&(d=p.quickVariantSelection)!==null&&d!==void 0&&d.showCounts)&&!((u=v.getViewConfiguration())!==null&&u!==void 0&&u.showCounts),type:F,useCondensedTableLayout:S&&T,isCompactType:v.isCompactType()};const O={...E,...C,...I};if(F==="TreeTable"){O.hierarchyQualifier=p.hierarchyQualifier}return O}F.getTableManifestConfiguration=Fn;function Cn(e,t){var n,o,i,a,l;let r;if(se(e)){r=re(e.targetType)?Ae[e.targetType.underlyingType]:Ae[e.type]}if(r===undefined&&t!==undefined){r=Ae[t]}const s={type:(n=r)===null||n===void 0?void 0:n.type,constraints:{},formatOptions:{}};if(se(e)&&r!==undefined){var d,u,c,v,f,p,g,m,y,b,h,T,I,P,A,D,F;s.constraints={scale:(d=r.constraints)!==null&&d!==void 0&&d.$Scale?e.scale:undefined,precision:(u=r.constraints)!==null&&u!==void 0&&u.$Precision?e.precision:undefined,maxLength:(c=r.constraints)!==null&&c!==void 0&&c.$MaxLength?e.maxLength:undefined,nullable:(v=r.constraints)!==null&&v!==void 0&&v.$Nullable?e.nullable:undefined,minimum:(f=r.constraints)!==null&&f!==void 0&&f["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((p=e.annotations)===null||p===void 0?void 0:(g=p.Validation)===null||g===void 0?void 0:g.Minimum)?`${(m=e.annotations)===null||m===void 0?void 0:(y=m.Validation)===null||y===void 0?void 0:y.Minimum}`:undefined,maximum:(b=r.constraints)!==null&&b!==void 0&&b["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((h=e.annotations)===null||h===void 0?void 0:(T=h.Validation)===null||T===void 0?void 0:T.Maximum)?`${(I=e.annotations)===null||I===void 0?void 0:(P=I.Validation)===null||P===void 0?void 0:P.Maximum}`:undefined,isDigitSequence:s.type==="sap.ui.model.odata.type.String"&&(A=r.constraints)!==null&&A!==void 0&&A[`@${"com.sap.vocabularies.Common.v1.IsDigitSequence"}`]&&(D=e.annotations)!==null&&D!==void 0&&(F=D.Common)!==null&&F!==void 0&&F.IsDigitSequence?true:undefined}}s.formatOptions={parseAsString:(s===null||s===void 0?void 0:(o=s.type)===null||o===void 0?void 0:o.indexOf("sap.ui.model.odata.type.Int"))===0||(s===null||s===void 0?void 0:(i=s.type)===null||i===void 0?void 0:i.indexOf("sap.ui.model.odata.type.Double"))===0?false:undefined,emptyString:(s===null||s===void 0?void 0:(a=s.type)===null||a===void 0?void 0:a.indexOf("sap.ui.model.odata.type.Int"))===0||(s===null||s===void 0?void 0:(l=s.type)===null||l===void 0?void 0:l.indexOf("sap.ui.model.odata.type.Double"))===0?"":undefined,parseKeepsEmptyString:s.type==="sap.ui.model.odata.type.String"?true:undefined};return s}F.getTypeConfig=Cn;return{getTableActions:Ze,getTableColumns:et,getColumnsFromEntityType:At,updateLinkedProperties:it,createTableVisualization:lt,createDefaultTableVisualization:rt,getCapabilityRestriction:yt,getSelectionMode:bt,getRowStatusVisibility:Mt,getImportance:Yt,getP13nMode:tn,getTableAnnotationConfiguration:un,isFilteringCaseSensitive:jt,splitPath:vn,getSelectionVariantConfiguration:fn,getTableManifestConfiguration:Fn,getTypeConfig:Cn,updateTableVisualizationForType:nt}},false);
|
|
425
|
+
sap.ui.predefine("sap/fe/core/converters/controls/Common/Table", ["sap/fe/core/converters/annotations/DataField","sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/helpers/BindingHelper","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/helpers/Key","sap/fe/core/formatters/TableFormatter","sap/fe/core/formatters/TableFormatterTypes","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/StableIdHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/EntitySetHelper","sap/fe/core/templating/PropertyHelper","sap/fe/core/templating/UIFormatters","sap/fe/macros/internal/helpers/ActionHelper","sap/ui/core/Core","../../helpers/Aggregation","../../helpers/DataFieldHelper","../../helpers/ID","../../ManifestSettings","./Criticality","./table/StandardActions","sap/base/Log"],function(e,t,n,o,i,a,l,r,s,d,u,v,c,f,p,g,m,y,b,h,T,I,A,P,D,F){"use strict";var C={};var S=D.isInDisplayMode;var E=D.isDraftOrStickySupported;var O=D.getStandardActionPaste;var x=D.getStandardActionMassEdit;var M=D.getStandardActionInsights;var U=D.getStandardActionDelete;var $=D.getStandardActionCreate;var N=D.getRestrictions;var w=D.getMassEditVisibility;var V=D.getInsertUpdateActionsTemplating;var L=D.getDeleteVisibility;var R=D.getCreationRow;var k=D.generateStandardActionsContext;var H=P.getMessageTypeFromCriticalityType;var j=A.VisualizationType;var B=A.VariantManagementType;var z=A.TemplateType;var G=A.SelectionMode;var K=A.Importance;var W=A.HorizontalAlign;var Q=A.CreationMode;var q=A.ActionType;var _=I.getTableID;var Y=T.isReferencePropertyStaticallyHidden;var J=h.AggregationHelper;var X=m.isMultiValueField;var Z=g.isImageURL;var ee=g.getAssociatedUnitProperty;var te=g.getAssociatedTimezoneProperty;var ne=g.getAssociatedCurrencyProperty;var oe=p.getNonSortablePropertiesRestrictions;var ie=f.getDisplayMode;var ae=c.isPathUpdatable;var le=c.isPathSearchable;var re=c.isPathDeletable;var se=c.getTargetObjectPath;var de=c.enhanceDataModelPath;var ue=v.isTypeDefinition;var ve=v.isProperty;var ce=v.isPathAnnotationExpression;var fe=v.isNavigationProperty;var pe=v.isAnnotationOfType;var ge=u.replaceSpecialChars;var me=u.generate;var ye=s.resolveBindingString;var be=s.pathInModel;var he=s.or;var Te=s.not;var Ie=s.isConstant;var Ae=s.ifElse;var Pe=s.getExpressionFromAnnotation;var De=s.formatResult;var Fe=s.equal;var Ce=s.EDM_TYPE_MAPPING;var Se=s.constant;var Ee=s.compileExpression;var Oe=s.and;var xe=r.MessageType;var Me=a.KeyHelper;var Ue=i.IssueType;var $e=i.IssueSeverity;var Ne=i.IssueCategoryType;var we=i.IssueCategory;var Ve=o.Placement;var Le=o.OverrideType;var Re=o.insertCustomElements;var ke=n.UI;var He=n.Entity;var je=t.getEnabledForAnnotationAction;var Be=t.removeDuplicateActions;var ze=t.isActionNavigable;var Ge=t.getCopyAction;var Ke=t.getActionsFromManifest;var We=t.dataFieldIsCopyAction;var Qe=e.isDataPointFromDataFieldDefault;var qe=e.isDataFieldTypes;var _e=e.isDataFieldForActionAbstract;var Ye=e.getTargetValueOnDataPoint;var Je=e.getSemanticObjectPath;var Xe=e.getDataFieldDataType;var Ze=e.collectRelatedPropertiesRecursively;var et=e.collectRelatedProperties;var tt;(function(e){e["Default"]="Default";e["Annotation"]="Annotation";e["Slot"]="Slot"})(tt||(tt={}));function nt(e,t,n,o){const i=At(e,t,n);const a=i.tableActions;const l=i.hiddenTableActions;const r=Ke(n.getManifestControlConfiguration(t).actions,n,a,o,true,l);const s={isNavigable:Le.overwrite,enableOnSelect:Le.overwrite,enableAutoScroll:Le.overwrite,enabled:Le.overwrite,visible:Le.overwrite,defaultValuesExtensionFunction:Le.overwrite,command:Le.overwrite};const d=Re(a,r.actions,s);return{actions:d,commandActions:r.commandActions}}C.getTableActions=nt;function ot(e,t,n,o,i){const a=tn(e,t,n,i);const l=an(n.getManifestControlConfiguration(t).columns,a,n,n.getAnnotationEntityType(e),o);return Re(a,l,{width:Le.overwrite,importance:Le.overwrite,horizontalAlign:Le.overwrite,availability:Le.overwrite,isNavigable:Le.overwrite,settings:Le.overwrite,formatOptions:Le.overwrite})}C.getTableColumns=ot;const it=function(e,t,n){const o=new J(e,n);function i(e){return t.find(t=>{const n=t;return n.propertyInfos===undefined&&n.relativePath===e})}if(!o.isAnalyticsSupported()){return undefined}const a=new Set;t.forEach(e=>{const t=e;if(t.unit){a.add(t.unit)}});const l=o.getCustomAggregateDefinitions();const r={};l.forEach(e=>{const t=o._entityType.entityProperties.find(t=>t.name===e.qualifier);if(t){var n,i;const o=(n=e.annotations)===null||n===void 0?void 0:(i=n.Aggregation)===null||i===void 0?void 0:i.ContextDefiningProperties;r[t.name]=o?o.map(e=>e.value):[]}});const s={};t.forEach(e=>{const t=e;if(t.propertyInfos===undefined&&t.relativePath){const e=r[t.relativePath];if(e&&!a.has(t.name)){s[t.name]={defaultAggregate:{},relativePath:t.relativePath};const n=[];e.forEach(e=>{const t=i(e);if(t){n.push(t.name)}});if(n.length){s[t.name].defaultAggregate.contextDefiningProperties=n}}}});return s};C.getAggregateDefinitionsFromEntityType=it;function at(e,t,n,o){if(e.control.type==="AnalyticalTable"){const i=it(t,e.columns,n),a=new J(t,n);if(i){e.enableAnalytics=true;e.enable$select=false;e.enable$$getKeepAliveContext=false;e.aggregates=i;cn(e);const t=a.getAllowedTransformations();e.enableBasicSearch=t?t.indexOf("search")>=0:true;e.annotation.groupConditions=vn(o,e.columns,e.control.type);e.annotation.aggregateConditions=fn(o,e.columns)}e.control.type="GridTable"}else if(e.control.type==="ResponsiveTable"){e.annotation.groupConditions=vn(o,e.columns,e.control.type)}else if(e.control.type==="TreeTable"){const o=new J(t,n);const i=o.getAllowedTransformations();e.enableBasicSearch=i?i.includes("search"):true;e.enable$$getKeepAliveContext=true}}C.updateTableVisualizationForType=at;function lt(e,t){const n=e.getManifestWrapper();if(t&&n.getNavigationConfiguration(t)){const e=n.getNavigationConfiguration(t);if(Object.keys(e).length>0){return t}}const o=e.getDataModelObjectPath();const i=e.getContextPath();const a=n.getNavigationConfiguration(i);if(a&&Object.keys(a).length>0){return i}return o.targetEntitySet?o.targetEntitySet.name:o.startingEntitySet.name}function rt(e,t){function n(e){return t.find(t=>{const n=t;return n.propertyInfos===undefined&&n.relativePath===e})}t.forEach(t=>{const o=t;if(o.propertyInfos===undefined&&o.relativePath){const t=e.entityProperties.find(e=>e.name===o.relativePath);if(t){var i,a,l;const e=ne(t)||ee(t);const v=te(t);const c=t===null||t===void 0?void 0:(i=t.annotations)===null||i===void 0?void 0:(a=i.Common)===null||a===void 0?void 0:a.Timezone;if(e){const t=n(e.name);o.unit=t===null||t===void 0?void 0:t.name}else{var r,s,d,u;const e=(t===null||t===void 0?void 0:(r=t.annotations)===null||r===void 0?void 0:(s=r.Measures)===null||s===void 0?void 0:s.ISOCurrency)||(t===null||t===void 0?void 0:(d=t.annotations)===null||d===void 0?void 0:(u=d.Measures)===null||u===void 0?void 0:u.Unit);if(e){o.unitText=`${e}`}}if(v){const e=n(v.name);o.timezone=e===null||e===void 0?void 0:e.name}else if(c){o.timezoneText=c.toString()}const f=ie(t),p=(l=t.annotations.Common)===null||l===void 0?void 0:l.Text;if(ce(p)&&f!=="Value"){const e=n(p.path);if(e&&e.name!==o.name){o.textArrangement={textProperty:e.name,mode:f}}}}}})}C.updateLinkedProperties=rt;function st(e){var t,n,o,i,a,l,r,s,d,u,v,c,f;const p=(t=e.getAnnotationEntityType())===null||t===void 0?void 0:(n=t.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:(i=o.HeaderInfo)===null||i===void 0?void 0:(a=i.Title)===null||a===void 0?void 0:(l=a.Value)===null||l===void 0?void 0:l.path;const g=(r=e.getAnnotationEntityType())===null||r===void 0?void 0:(s=r.annotations)===null||s===void 0?void 0:(d=s.Common)===null||d===void 0?void 0:d.SemanticKey;const m=e===null||e===void 0?void 0:(u=e.getAnnotationEntityType())===null||u===void 0?void 0:(v=u.annotations)===null||v===void 0?void 0:(c=v.UI)===null||c===void 0?void 0:(f=c.HeaderInfo)===null||f===void 0?void 0:f.TypeName;const y=[];if(g){g.forEach(function(e){y.push(e.value)})}return{headerInfoTitlePath:p,semanticKeyColumns:y,headerInfoTypeName:m}}function dt(e,t,n,o,i,a,l){const r=xn(e,t,n,i);const{navigationPropertyPath:s}=mn(t);const d=lt(n,s);const u=n.getManifestWrapper().getNavigationConfiguration(d);const v=ot(e,t,n,u,l);const c=vt(e,n);const f=st(n);const p=nt(e,t,n,u);const g={type:j.Table,annotation:pn(e,t,n,r,v,o,a,l),control:r,actions:Be(p.actions),commandActions:p.commandActions,columns:v,operationAvailableMap:JSON.stringify(c),operationAvailableProperties:ft(c,n),headerInfoTitle:f.headerInfoTitlePath,semanticKeys:f.semanticKeyColumns,headerInfoTypeName:f.headerInfoTypeName,enable$select:true,enable$$getKeepAliveContext:true};rt(n.getAnnotationEntityType(e),v);at(g,n.getAnnotationEntityType(e),n,o);return g}C.createTableVisualization=dt;function ut(e,t){const n=xn(undefined,"",e,false);const o=Ct({},e.getEntityType(),[],[],e,n.type,[]);const i=vt(undefined,e);const a=st(e);const l={type:j.Table,annotation:pn(undefined,"",e,n,t?[]:o),control:n,actions:[],columns:o,operationAvailableMap:JSON.stringify(i),operationAvailableProperties:ft(i,e),headerInfoTitle:a.headerInfoTitlePath,semanticKeys:a.semanticKeyColumns,headerInfoTypeName:a.headerInfoTypeName,enable$select:true,enable$$getKeepAliveContext:true};rt(e.getEntityType(),o);at(l,e.getEntityType(),e);return l}C.createDefaultTableVisualization=ut;function vt(e,t){return y.getOperationAvailableMap(e,"table",t)}function ct(e){var t,n;const o=N(e);const i=e.getEntitySet();const a=o.isUpdatable;const l=!Ie(a.expression)&&a.navigationExpression._type==="Unresolvable";const r=i===null||i===void 0?void 0:(t=i.annotations.Capabilities)===null||t===void 0?void 0:(n=t.UpdateRestrictions)===null||n===void 0?void 0:n.Updatable;const s=ce(r)&&r.path;return l?s:""}function ft(e,t){const n=new Set;for(const t in e){const o=e[t];if(o===null){n.add(t)}else if(typeof o==="string"){n.add(o)}}if(n.size){var o,i,a,l,r;const e=t.getEntityType();const s=(o=e.annotations)===null||o===void 0?void 0:(i=o.UI)===null||i===void 0?void 0:(a=i.HeaderInfo)===null||a===void 0?void 0:(l=a.Title)===null||l===void 0?void 0:(r=l.Value)===null||r===void 0?void 0:r.path;if(s){n.add(s)}}return Array.from(n).join(",")}function pt(e,t,n,o){const i=[];e.forEach(e=>{var a,l;if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"&&e!==null&&e!==void 0&&(a=e.ActionTarget)!==null&&a!==void 0&&a.isBound&&t===(e===null||e===void 0?void 0:e.ActionTarget.sourceEntityType)||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"&&e.RequiresContext&&(e===null||e===void 0?void 0:(l=e.Inline)===null||l===void 0?void 0:l.valueOf())!==true){var r,s,d;if(typeof((r=e.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:(d=s.Hidden)===null||d===void 0?void 0:d.valueOf())==="object"){i.push(Fe(gt(e,n,o),false))}}});return i}function gt(e,t,n){let o;if((e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.DataFieldForAction"||(e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"){var i,a;o=e===null||e===void 0?void 0:(i=e.annotations)===null||i===void 0?void 0:(a=i.UI)===null||a===void 0?void 0:a.Hidden}else{o=e===null||e===void 0?void 0:e.visible}let l;if(ce(o)){l=o.path}else{l=o}if(l){if(e!==null&&e!==void 0&&e.visible){l=l.substring(1,l.length-1)}if(l.indexOf("/")>0){const e=l.split("/");const n=e[0];if(fe(t===null||t===void 0?void 0:t.targetObject)&&t.targetObject.partner===n){return be(e.slice(1).join("/"))}else{return Se(true)}}else if(n){return be(l)}else{return Se(true)}}return Se(true)}function mt(e,t,n){return Object.keys(n).some(o=>{if(o===e){var i;if(t!==null&&t!==void 0&&(i=t.ActionTarget)!==null&&i!==void 0&&i.isBound||t!==null&&t!==void 0&&t.RequiresContext){n[e].requiresSelection=true}return true}return false})}function yt(e,t,n){return e.some(e=>{var o,i,a,l,r,s,d;if((e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation")&&(e===null||e===void 0?void 0:(o=e.Inline)===null||o===void 0?void 0:o.valueOf())!==true&&(((i=e.annotations)===null||i===void 0?void 0:(a=i.UI)===null||a===void 0?void 0:(l=a.Hidden)===null||l===void 0?void 0:l.valueOf())===false||((r=e.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:(d=s.Hidden)===null||d===void 0?void 0:d.valueOf())===undefined)){if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAction"){var u;const o=me(["DataFieldForAction",e.Action]);if(mt(o,e,t)){return false}return(e===null||e===void 0?void 0:(u=e.ActionTarget)===null||u===void 0?void 0:u.isBound)&&n===(e===null||e===void 0?void 0:e.ActionTarget.sourceEntityType)}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation"){if(mt(`DataFieldForIntentBasedNavigation::${e.SemanticObject}::${e.Action}`,e,t)){return false}return e.RequiresContext}}return false})}function bt(e){return Object.keys(e).some(t=>{var n;const o=e[t];if(o.requiresSelection&&((n=o.visible)===null||n===void 0?void 0:n.toString())==="true"){return true}return false})}function ht(e){const t=[];if(e){Object.keys(e).forEach(n=>{const o=e[n];if(o.requiresSelection===true&&o.visible!==undefined){if(typeof o.visible==="string"){var i;t.push(ye(o===null||o===void 0?void 0:(i=o.visible)===null||i===void 0?void 0:i.valueOf()))}}})}return t}function Tt(e){const t=re(e.getDataModelObjectPath());const n=ae(e.getDataModelObjectPath());return{isDeletable:!(Ie(t)&&t.value===false),isUpdatable:!(Ie(n)&&n.value===false)}}C.getCapabilityRestriction=Tt;function It(e,t,n,o,i,a){var l;let r=arguments.length>6&&arguments[6]!==undefined?arguments[6]:Se(false);const s=n.getManifestControlConfiguration(t);let d=(l=s.tableSettings)===null||l===void 0?void 0:l.selectionMode;if(!e||d===G.None){return G.None}let u=[],v=[];const c=Ke(n.getManifestControlConfiguration(t).actions,n,[],undefined,false);let f,p;if(n.getTemplateType()===z.ObjectPage){f=re(n.getDataModelObjectPath());p=f?Ee(f,true):f}const g=!Ie(r)||r.value!==false;if(!d||d===G.Auto){d=G.Multi}if(g){d=d===G.Single?G.Single:G.Multi}if(yt(e,c.actions,n.getEntityType())||bt(c.actions)){return d}u=pt(e,n.getEntityType(),n.getDataModelObjectPath(),o);v=ht(c.actions);if(u.length===0&&v.length===0&&(a||g)){if(!o){if(i.isDeletable||p!=="false"||g){const e=he(a||true,r);return Ee(Ae(Oe(ke.IsEditable,e),Se(d),Se(G.None)))}else{return G.None}}else if(g){return d}else if(i.isDeletable&&a){return Ee(Ae(a,Se(d),Se("None")))}else{return G.None}}else if(!o){if(i.isDeletable||p!=="false"||g){const e=Ae(g&&!i.isDeletable,r,Se(true));return Ee(Ae(Oe(ke.IsEditable,e),Se(d),Ae(he(...u.concat(v)),Se(d),Se(G.None))))}else{return Ee(Ae(he(...u.concat(v)),Se(d),Se(G.None)))}}else if(i.isDeletable||g){return d}else{return Ee(Ae(he(...u.concat(v),r),Se(d),Se(G.None)))}}C.getSelectionMode=It;function At(e,t,n){const o=[];const i=[];const a=Ge(e.filter(e=>We(e)));const l=n.getEntityType().fullyQualifiedName;if(a){var r,s,d;o.push({type:q.Copy,annotationPath:n.getEntitySetBasedAnnotationPath(a.fullyQualifiedName),key:Me.generateKeyFromDataField(a),enabled:Ee(Fe(be("numberOfSelectedContexts","internal"),1)),visible:Ee(Te(Fe(Pe((r=a.annotations)===null||r===void 0?void 0:(s=r.UI)===null||s===void 0?void 0:s.Hidden,[],undefined,n.getRelativeModelPathFunction()),true))),text:((d=a.Label)===null||d===void 0?void 0:d.toString())??b.getLibraryResourceBundle("sap.fe.core").getText("C_COMMON_COPY"),isNavigable:true})}e.filter(e=>!We(e)).forEach(e=>{var t,a,r,s,d,u,v,c,f,p,g,m;if(((t=e.annotations)===null||t===void 0?void 0:(a=t.UI)===null||a===void 0?void 0:(r=a.Hidden)===null||r===void 0?void 0:r.valueOf())===true){i.push({type:q.Default,key:Me.generateKeyFromDataField(e)})}else if(_e(e)&&((s=e.Inline)===null||s===void 0?void 0:s.valueOf())!==true&&((d=e.Determining)===null||d===void 0?void 0:d.valueOf())!==true){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":let t=false;if(((u=e.ActionTarget)===null||u===void 0?void 0:(v=u.annotations)===null||v===void 0?void 0:(c=v.Core)===null||c===void 0?void 0:c.OperationAvailable)!==undefined){var y,b,h,T;if(!((y=e.ActionTarget)!==null&&y!==void 0&&y.isBound)){t=true}else if((b=e.ActionTarget)!==null&&b!==void 0&&b.isBound&&((h=e.ActionTarget)===null||h===void 0?void 0:h.sourceType)!==l){t=true}else if((T=e.ActionTarget)!==null&&T!==void 0&&T.parameters[0].isCollection){t=true}}const i={type:q.DataFieldForAction,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),key:Me.generateKeyFromDataField(e),visible:Ee(Te(Fe(Pe((f=e.annotations)===null||f===void 0?void 0:(p=f.UI)===null||p===void 0?void 0:p.Hidden,[],undefined,n.getRelativeModelPathFunction()),true))),isNavigable:true};if(t){i.enabled=je(n,e.ActionTarget)}o.push(i);break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":o.push({type:q.DataFieldForIntentBasedNavigation,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),key:Me.generateKeyFromDataField(e),visible:Ee(Te(Fe(Pe((g=e.annotations)===null||g===void 0?void 0:(m=g.UI)===null||m===void 0?void 0:m.Hidden,[],undefined,n.getRelativeModelPathFunction()),true)))});break;default:break}}});return{tableActions:o,hiddenTableActions:i}}function Pt(e,t,n){let o=xe.None;if(e){if(typeof e==="object"){o=Pe(e)}else{o=H(e)}}const i=[];n===null||n===void 0?void 0:n.keys.forEach(e=>{if(e.name!=="IsActiveEntity"){i.push(be(e.name,undefined))}});return De([o,be(`filteredMessages`,"internal"),t&&He.HasActive,t&&He.IsActive,`${t}`,...i],l.rowHighlighting,n)}function Dt(e,t,n,o,i){var a;const l=(o===null||o===void 0?void 0:o.create)||(o===null||o===void 0?void 0:o.detail);const r=n.getManifestControlConfiguration(i);const s=r&&r.tableSettings||{};if(l!==null&&l!==void 0&&l.outbound&&l.outboundDetail&&o!==null&&o!==void 0&&o.create){return{mode:"External",outbound:l.outbound,outboundDetail:l.outboundDetail,navigationSettings:o}}let d;if(e){var u,v,c;const e=(u=n.getEntitySet())===null||u===void 0?void 0:u.annotations;const o=e===null||e===void 0?void 0:e.Common,i=e===null||e===void 0?void 0:e.Session;d=(o===null||o===void 0?void 0:(v=o.DraftRoot)===null||v===void 0?void 0:v.NewAction)||(i===null||i===void 0?void 0:(c=i.StickySessionSupported)===null||c===void 0?void 0:c.NewAction);if(t.creationMode===Q.CreationRow&&d){throw Error(`Creation mode '${Q.CreationRow}' can not be used with a custom 'new' action (${d})`)}if(l!==null&&l!==void 0&&l.route){var f;return{mode:t.creationMode,append:t.createAtEnd,newAction:(f=d)===null||f===void 0?void 0:f.toString(),navigateToTarget:t.creationMode===Q.NewPage?l.route:undefined}}}if(t.creationMode===Q.NewPage){var p;t.creationMode=Q.Inline;if(((p=s.creationMode)===null||p===void 0?void 0:p.createAtEnd)===undefined){t.createAtEnd=false}}return{mode:t.creationMode,append:t.createAtEnd,newAction:(a=d)===null||a===void 0?void 0:a.toString()}}const Ft=function(e,t,n,o,i){let a,r;let s=Se(xe.None);const u=t.getEntityType();if(n&&e){var v,c,f,p,g;r=((v=n.display)===null||v===void 0?void 0:v.target)||((c=n.detail)===null||c===void 0?void 0:c.outbound);const l=t.getEntitySet();s=Pt((f=e.annotations)===null||f===void 0?void 0:(p=f.UI)===null||p===void 0?void 0:p.Criticality,!!d.getDraftRoot(l)||!!d.getDraftNode(l),u);if(r){a=".handlers.onChevronPressNavigateOutBound( $controller ,'"+r+"', ${$parameters>bindingContext})"}if(!r&&(g=n.detail)!==null&&g!==void 0&&g.route){a="API.onTableRowPress($event, $controller, ${$parameters>bindingContext}, { callExtension: true, targetPath: '"+o+"', editable : "+(d.getDraftRoot(l)||d.getDraftNode(l)?"!${$parameters>bindingContext}.getProperty('IsActiveEntity')":"undefined")+(i==="AnalyticalTable"||i==="TreeTable"?", bRecreateContext: true":"")+"})"}}const m=De([be("/deepestPath","internal")],l.navigatedRow,u);return{press:a,action:a?"Navigation":undefined,rowHighlighting:Ee(s),rowNavigated:Ee(m),visible:Ee(Te(ke.IsInactive))}};const Ct=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let o=arguments.length>3?arguments[3]:undefined;let i=arguments.length>4?arguments[4]:undefined;let a=arguments.length>5?arguments[5]:undefined;let l=arguments.length>6?arguments[6]:undefined;const r=n;const s=new J(t,i);t.entityProperties.forEach(t=>{const d=n.some(e=>e.name===t.name);if(!t.targetType&&!d){const n=et(t.name,t,i,true,a);const d=Object.keys(n.properties);const u=Object.keys(n.additionalProperties);if(n.textOnlyPropertiesFromTextAnnotation.length>0){l.push(...n.textOnlyPropertiesFromTextAnnotation)}const v=St(t,i.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),t.name,true,true,o,s,i,l);if(d.length>0){v.propertyInfos=d;v.exportSettings={...v.exportSettings,template:n.exportSettingsTemplate,wrap:n.exportSettingsWrapping};v.exportSettings.type=gn(t.type,d.length>1);if(n.exportUnitName){v.exportSettings.unitProperty=n.exportUnitName;v.exportSettings.type="Currency"}else if(n.exportUnitString){v.exportSettings.unit=n.exportUnitString}if(n.exportTimezoneName){v.exportSettings.timezoneProperty=n.exportTimezoneName;v.exportSettings.utc=false}else if(n.exportTimezoneString){v.exportSettings.timezone=n.exportTimezoneString}if(n.exportDataPointTargetValue){v.exportDataPointTargetValue=n.exportDataPointTargetValue;v.exportSettings.type="String"}d.forEach(t=>{e[t]=n.properties[t]})}if(u.length>0){v.additionalPropertyInfos=u;u.forEach(t=>{e[t]=n.additionalProperties[t]})}r.push(v)}if(ie(t)==="Description"){o=o.concat(t.name);r.push(St(t,i.getEntitySetBasedAnnotationPath(t.fullyQualifiedName),t.name,false,false,o,s,i,[]))}});const d=wt(e,r,o,i,t,l);return r.concat(d)};C.getColumnsFromEntityType=Ct;const St=function(e,t,n,o,i,a,l,r,s){var d,u,v,c,f;const p=o?n:`Property::${n}`;const g=(o?"DataField::":"Property::")+ge(n);const m=Je(r,e);const y=((d=e.annotations)===null||d===void 0?void 0:(u=d.UI)===null||u===void 0?void 0:(v=u.Hidden)===null||v===void 0?void 0:v.valueOf())===true;const b=e.name?Ht(e.name,true,false):undefined;const h=b!=e.name;const T=gn(e.type);const I=e.type==="Edm.Date"?"YYYY-MM-DD":undefined;const A=Xe(e);const P=Mn(e,A);const D=r.getAnnotationsByTerm("Common","com.sap.vocabularies.Common.v1.SemanticKey",[r.getEntityType()])[0];const F=s&&s.indexOf(n)>=0;const C=(!y||F)&&a.indexOf(n)===-1;const S={className:e.type||A,formatOptions:P.formatOptions,constraints:P.constraints};let E=null;if(Et(e)){var O,x,M,U,$,N;const t=ne(e)||ee(e);const n=te(e);const o=((O=e.annotations)===null||O===void 0?void 0:(x=O.Measures)===null||x===void 0?void 0:x.ISOCurrency)||((M=e.annotations)===null||M===void 0?void 0:(U=M.Measures)===null||U===void 0?void 0:U.Unit);const i=($=e.annotations)===null||$===void 0?void 0:(N=$.Common)===null||N===void 0?void 0:N.Timezone;E={type:T,inputFormat:I,scale:e.scale,delimiter:e.type==="Edm.Int64"};if(t){E.unitProperty=t.name;E.type="Currency"}else if(o){E.unit=`${o}`}if(n){E.timezoneProperty=n.name;E.utc=false}else if(i){E.timezone=i.toString()}}const w=On(n,r);const V={key:g,type:tt.Annotation,label:Ut(e,h),groupLabel:h?Ut(e):undefined,group:h?b:undefined,annotationPath:t,semanticObjectPath:m,availability:!i||y?"Hidden":"Adaptation",name:p,relativePath:n,sortable:C,isGroupable:l.isAnalyticsSupported()?!!l.isPropertyGroupable(e):C,isKey:e.isKey,exportSettings:E,caseSensitive:zt(r),typeConfig:S,importance:Zt((c=e.annotations)===null||c===void 0?void 0:(f=c.UI)===null||f===void 0?void 0:f.DataFieldDefault,D),additionalLabels:w};const L=$t(e)||Ut(e,h);if(L){V.tooltip=L}const R=Ye(e);if(Qe(e)&&typeof R==="string"&&V.exportSettings){V.exportDataPointTargetValue=R;V.exportSettings.template="{0}/"+R}return V};function Et(e){var t;let n,o;const i=(t=e.annotations.UI)===null||t===void 0?void 0:t.DataFieldDefault;if(ve(e)&&i!==null&&i!==void 0&&i.$Type){if(Y(i)===true){return false}n=i===null||i===void 0?void 0:i.$Type}else if(Y(e)===true){return false}else{var a,l,r,s,d,u,v,c,f,p,g;o=e;n=o.$Type;if(n==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&(a=o.Target)!==null&&a!==void 0&&(l=a.$target)!==null&&l!==void 0&&l.$Type){var m,y;n=(m=o.Target)===null||m===void 0?void 0:(y=m.$target)===null||y===void 0?void 0:y.$Type;return"com.sap.vocabularies.UI.v1.ChartDefinitionType".indexOf(n)===-1}else if(((r=o.Value)===null||r===void 0?void 0:(s=r.$target)===null||s===void 0?void 0:(d=s.annotations)===null||d===void 0?void 0:(u=d.Core)===null||u===void 0?void 0:(v=u.MediaType)===null||v===void 0?void 0:v.term)==="Org.OData.Core.V1.MediaType"&&((c=o.Value)===null||c===void 0?void 0:(f=c.$target)===null||f===void 0?void 0:(p=f.annotations)===null||p===void 0?void 0:(g=p.Core)===null||g===void 0?void 0:g.isURL)!==true){return false}}return n?["com.sap.vocabularies.UI.v1.DataFieldForAction","com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation","com.sap.vocabularies.UI.v1.DataFieldForActionGroup"].indexOf(n)===-1:true}const Ot=function(e){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":return!!e.Inline;case"com.sap.vocabularies.UI.v1.DataFieldWithAction":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":return true;default:}};const xt=function(e){var t,n,o,i,a,l;const r=e.targetObject;let s;if(r){switch(r.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":case"com.sap.vocabularies.UI.v1.DataPointType":s=r.Value.$target;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":if((r===null||r===void 0?void 0:(t=r.Target)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.DataPointType"){var d;s=(d=r.Target.$target)===null||d===void 0?void 0:d.Value.$target}break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldForAction":default:s=undefined}}const u=Se(false);const v=Se(false);return Oe(...[Te(Fe(Pe(r===null||r===void 0?void 0:(o=r.annotations)===null||o===void 0?void 0:(i=o.UI)===null||i===void 0?void 0:i.Hidden),true)),Ae(!!s,s&&Te(Fe(Pe((a=s.annotations)===null||a===void 0?void 0:(l=a.UI)===null||l===void 0?void 0:l.Hidden),true)),true),he(Te(u),v)])};C._getVisibleExpression=xt;const Mt=function(e){var t,n;const o=[];if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((t=e.Target)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){var i,a;if(e!==null&&e!==void 0&&(i=e.annotations)!==null&&i!==void 0&&(a=i.UI)!==null&&a!==void 0&&a.Hidden){return Ee(Te(Fe(Pe(e.annotations.UI.Hidden),true)))}else{var l;(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{o.push(xt({targetObject:e}))});return Ee(Ae(he(...o),Se(true),Se(false)))}}else{return undefined}};const Ut=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!e){return undefined}if(ve(e)||fe(e)){var n,o,i,a,l;const t=(n=e.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:o.DataFieldDefault;if(t&&!t.qualifier&&(i=t.Label)!==null&&i!==void 0&&i.valueOf()){var r;return Ee(Pe((r=t.Label)===null||r===void 0?void 0:r.valueOf()))}return Ee(Pe(((a=e.annotations.Common)===null||a===void 0?void 0:(l=a.Label)===null||l===void 0?void 0:l.valueOf())||e.name))}else if(qe(e)){var s,d,u,v,c,f,p,g;if(!!t&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation"){var m;return Ee(Pe((m=e.Label)===null||m===void 0?void 0:m.valueOf()))}return Ee(Pe(((s=e.Label)===null||s===void 0?void 0:s.valueOf())||((d=e.Value)===null||d===void 0?void 0:(u=d.$target)===null||u===void 0?void 0:(v=u.annotations)===null||v===void 0?void 0:(c=v.Common)===null||c===void 0?void 0:(f=c.Label)===null||f===void 0?void 0:f.valueOf())||((p=e.Value)===null||p===void 0?void 0:(g=p.$target)===null||g===void 0?void 0:g.name)))}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"){var y,b,h,T,I,A,P,D;return Ee(Pe(((y=e.Label)===null||y===void 0?void 0:y.valueOf())||((b=e.Target)===null||b===void 0?void 0:(h=b.$target)===null||h===void 0?void 0:(T=h.Value)===null||T===void 0?void 0:(I=T.$target)===null||I===void 0?void 0:(A=I.annotations)===null||A===void 0?void 0:(P=A.Common)===null||P===void 0?void 0:(D=P.Label)===null||D===void 0?void 0:D.valueOf())))}else{var F;return Ee(Pe((F=e.Label)===null||F===void 0?void 0:F.valueOf()))}};const $t=function(e){var t,n;if(!e){return undefined}if(ve(e)||(t=e.annotations)!==null&&t!==void 0&&(n=t.Common)!==null&&n!==void 0&&n.QuickInfo){var o,i;return(o=e.annotations)!==null&&o!==void 0&&(i=o.Common)!==null&&i!==void 0&&i.QuickInfo?Ee(Pe(e.annotations.Common.QuickInfo.valueOf())):undefined}else if(qe(e)){var a,l,r,s;return(a=e.Value)!==null&&a!==void 0&&(l=a.$target)!==null&&l!==void 0&&(r=l.annotations)!==null&&r!==void 0&&(s=r.Common)!==null&&s!==void 0&&s.QuickInfo?Ee(Pe(e.Value.$target.annotations.Common.QuickInfo.valueOf())):undefined}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"){var d,u,v,c,f;const t=(d=e.Target)===null||d===void 0?void 0:d.$target;return t!==null&&t!==void 0&&(u=t.Value)!==null&&u!==void 0&&(v=u.$target)!==null&&v!==void 0&&(c=v.annotations)!==null&&c!==void 0&&(f=c.Common)!==null&&f!==void 0&&f.QuickInfo?Ee(Pe(t.Value.$target.annotations.Common.QuickInfo.valueOf())):undefined}else{return undefined}};function Nt(e,t){return De([be(`semanticKeyHasDraftIndicator`,"internal"),be(`filteredMessages`,"internal"),e,t],l.getErrorStatusTextVisibilityFormatter)}C.getRowStatusVisibility=Nt;const wt=function(e,t,n,o,i,a){const l=[];const r={};const s=new J(i,o);Object.keys(e).forEach(i=>{const d=e[i],u=o.getAbsoluteAnnotationPath(i),v=t.find(e=>e.name===i);if(v===undefined){const e=St(d,u,i,true,false,n,s,o,a);e.isPartOfLineItem=t.some(e=>{var t;return((t=e.propertyInfos)===null||t===void 0?void 0:t.includes(i))&&e.isPartOfLineItem});l.push(e)}else if(v.annotationPath!==u||v.propertyInfos){const e=`Property::${i}`;if(!t.some(t=>t.name===e)){const t=St(d,u,i,false,false,n,s,o,a);t.isPartOfLineItem=v.isPartOfLineItem;l.push(t);r[i]=e}else if(t.some(t=>t.name===e)&&t.some(e=>{var t;return(t=e.propertyInfos)===null||t===void 0?void 0:t.includes(i)})){r[i]=e}}});t.forEach(e=>{var t,n;e.propertyInfos=(t=e.propertyInfos)===null||t===void 0?void 0:t.map(e=>r[e]??e);e.additionalPropertyInfos=(n=e.additionalPropertyInfos)===null||n===void 0?void 0:n.map(e=>r[e]??e)});return l};const Vt=function(e){var t,n,o,i;if(qe(e)&&(t=e.Value)!==null&&t!==void 0&&t.path){var a;return(a=e.Value)===null||a===void 0?void 0:a.path}else if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&(n=e.Target)!==null&&n!==void 0&&(o=n.$target)!==null&&o!==void 0&&(i=o.Value)!==null&&i!==void 0&&i.path){var l,r;return(l=e.Target)===null||l===void 0?void 0:(r=l.$target)===null||r===void 0?void 0:r.Value.path}else{return Me.generateKeyFromDataField(e)}};const Lt=function(e,t,n){const o=`Property_Technical::${e}`;const i=t.find(e=>e.key===o);const a=!i&&t.find(t=>t.name===e&&!t.propertyInfos);if(a){const i={key:o,type:tt.Annotation,label:a.label,annotationPath:a.annotationPath,availability:"Hidden",name:o,relativePath:a.relativePath,sortable:false,isGroupable:false,isKey:false,exportSettings:null,caseSensitive:false,aggregatable:false,extension:{technicallyGroupable:true,technicallyAggregatable:true}};t.push(i);n[e]=i.name}};const Rt=function(e,t,n){var o;const i=(o=n.getManifestControlConfiguration(t))===null||o===void 0?void 0:o.columns;const a=i&&Object.keys(i);return a&&!!a.find(function(t){return t===e&&i[t].showDataFieldsLabel})};const kt=function(e){var t,n;let o="";switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":o=e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:t.path;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":o=e===null||e===void 0?void 0:(n=e.Target)===null||n===void 0?void 0:n.value;break;case"com.sap.vocabularies.UI.v1.DataFieldForAction":case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldForActionGroup":case"com.sap.vocabularies.UI.v1.DataFieldWithActionGroup":o=Me.generateKeyFromDataField(e);break}return o};const Ht=function(e,t,n){const o=t?e.lastIndexOf("/"):e.indexOf("/");if(o===-1){return e}return n?e.substring(o+1,e.length):e.substring(0,o)};const jt=function(e,t){if(qe(e)&&ce(e.Value)){const n=de(t.getDataModelObjectPath(),e.Value.path);return X(n)}else{return false}};const Bt=function(e,t,n){return n.indexOf(t)===-1&&(e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithAction")};const zt=function(e){const t=Gt(e);return Array.isArray(t)?t.indexOf("tolower")===-1:true};C.isFilteringCaseSensitive=zt;function Gt(e){const t=e.getEntitySet();if(v.isEntitySet(t)){var n,o;return((n=t.annotations.Capabilities)===null||n===void 0?void 0:n.FilterFunctions)??((o=e.getEntityContainer().annotations.Capabilities)===null||o===void 0?void 0:o.FilterFunctions)}return undefined}function Kt(e){return e===undefined?undefined:{textLinesEdit:4,...e}}function Wt(e,t){const n=[];let o=false;for(let i=0;i<e.length;i++){n.push(e[i].value);if(e[i].value===t){o=true}}return{values:n,semanticKeyFound:o}}function Qt(e,t){let n=false;let o;if(e&&e.length>=1&&t&&t.length>=1){for(let i=0;i<e.length;i++){if([e[i]].some(e=>t.indexOf(e)>=0)){n=true;o=e[i];break}}}return{semanticKeyHasPropertyInFieldGroup:n,fieldGroupPropertyPath:o}}function qt(e,t){var n,o;const i=[];let a={semanticKeyHasPropertyInFieldGroup:false,fieldGroupPropertyPath:undefined};if(e&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((n=e.Target)===null||n===void 0?void 0:(o=n.$target)===null||o===void 0?void 0:o.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){var l;(l=e.Target.$target.Data)===null||l===void 0?void 0:l.forEach(e=>{if((e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl")&&e.Value){i.push(e.Value.path)}a=Qt(t,i)})}return{semanticKeyHasPropertyInFieldGroup:a.semanticKeyHasPropertyInFieldGroup,propertyPath:a.fieldGroupPropertyPath}}function _t(e,t,n,o){if(!t){return{}}const i=Wt(t,e);const a=qt(o,i.values);if(a.semanticKeyHasPropertyInFieldGroup){return{fieldGroupDraftIndicatorPropertyPath:a.propertyPath,fieldGroupName:e,showErrorObjectStatus:Ee(Nt(e,true))}}else if(i.semanticKeyFound){return{hasDraftIndicator:true,showErrorObjectStatus:Ee(Nt(e,false))}}return{}}function Yt(e){var t,n;const o=e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance;if(o&&o.includes("UI.ImportanceType/High")){return 3}if(o&&o.includes("UI.ImportanceType/Medium")){return 2}if(o&&o.includes("UI.ImportanceType/Low")){return 1}return 0}function Jt(e){var t,n;const o=e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance;return o?o.split("/")[1]:K.None}function Xt(e){if(e&&e.length>0){let t=-1;let n=-1;let o;for(const i of e){n=Yt(i);if(n>t){t=n;o=i}}return Jt(o)}return K.None}function Zt(e,t){var n;let o,i=[];if(t&&t.length>0){i=t.map(function(e){return e.value})}if(!e){return undefined}if(pe(e,"com.sap.vocabularies.UI.v1.DataFieldForAnnotation")){const t=e.Target.$target;if(pe(t,"com.sap.vocabularies.UI.v1.FieldGroupType")){const n=t.Data;const r=n&&n.some(function(e){var t,n;return(e===null||e===void 0?void 0:(t=e.Value)===null||t===void 0?void 0:t.path)&&e.$Type!=="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&i.includes(e===null||e===void 0?void 0:(n=e.Value)===null||n===void 0?void 0:n.path)});if(r){return K.High}else{var a,l;if(e!==null&&e!==void 0&&(a=e.annotations)!==null&&a!==void 0&&(l=a.UI)!==null&&l!==void 0&&l.Importance){return Jt(e)}o=n&&n.filter(function(e){var t,n;return e===null||e===void 0?void 0:(t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.Importance});return Xt(o)}}}return e.Value&&e!==null&&e!==void 0&&(n=e.Value)!==null&&n!==void 0&&n.path&&i.includes(e.Value.path)?K.High:Jt(e)}C.getImportance=Zt;const en=function(e,t,n,o){const i=n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName);if(t&&t!==""&&i.indexOf("@com.sap.vocabularies.UI.v1.LineItem")!==-1&&qe(e)){var a;const t=(a=e.Value)!==null&&a!==void 0&&a.$target?Z(e.Value.$target):false;return!o&&!t}return false};const tn=function(e,t,n,o){var i;const a=n.getAnnotationEntityType(e),l=[],r={},s=oe(n.getEntitySet()),d=n.getManifestControlConfiguration(t),u=(d===null||d===void 0?void 0:(i=d.tableSettings)===null||i===void 0?void 0:i.type)||"ResponsiveTable";const v=[];const c=n.getAnnotationsByTerm("Common","com.sap.vocabularies.Common.v1.SemanticKey",[n.getEntityType()])[0];if(e){const i=n.getConverterContextFor(se(n.getDataModelObjectPath()));e.forEach(e=>{var a,d,f,p,g,m,y,b,h,T,I,A;if(!Ot(e)){return}let P=null;const D=qe(e)&&(a=e.Value)!==null&&a!==void 0&&(d=a.$target)!==null&&d!==void 0&&d.fullyQualifiedName?Je(n,e):undefined;const F=kt(e);const C=Ze(e,n,u);const S=Object.keys(C.properties);const E=Object.keys(C.additionalProperties);const O=F?Ht(F,true,false):undefined;const x=O!=F;const M=Ut(e,x);const U=Vt(e);const $=O?O.indexOf(`@${"com.sap.vocabularies.UI.v1.FieldGroup"}`)>-1:false;const N=$?Rt(U,t,n):false;const w=Xe(e);const V=w==="Edm.Date"?"YYYY-MM-DD":undefined;const L=Kt(_t(U,c,$,e));let R;if(e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&((f=e.Target)===null||f===void 0?void 0:(p=f.$target)===null||p===void 0?void 0:p.$Type)==="com.sap.vocabularies.UI.v1.FieldGroupType"){R=Mt(e)}if(Et(e)){P={template:C.exportSettingsTemplate,wrap:C.exportSettingsWrapping,type:w?gn(w,S.length>1):undefined,inputFormat:V,delimiter:w==="Edm.Int64"};if(C.exportUnitName){P.unitProperty=C.exportUnitName;P.type="Currency"}else if(C.exportUnitString){P.unit=C.exportUnitString}if(C.exportTimezoneName){P.timezoneProperty=C.exportTimezoneName}else if(C.exportTimezoneString){P.timezone=C.exportTimezoneString}}let k;if(w){k=Mn(e,w)}const H={className:w,formatOptions:{...L,...(g=k)===null||g===void 0?void 0:g.formatOptions},constraints:{...(m=k)===null||m===void 0?void 0:m.constraints}};const j={};if(!w||!H){j.widthCalculation=null}const B=jt(e,i);const z=!B&&Bt(e,F,s);const G=n.getManifestControlConfiguration(t);const K=((y=G.tableSettings)===null||y===void 0?void 0:y.enableAddCardToInsights)??true;const W={key:Me.generateKeyFromDataField(e),type:tt.Annotation,label:M,groupLabel:x?Ut(e):undefined,group:x?O:undefined,FieldGroupHiddenExpressions:R,annotationPath:n.getEntitySetBasedAnnotationPath(e.fullyQualifiedName),semanticObjectPath:D,availability:Y(e)?"Hidden":"Default",name:U,showDataFieldsLabel:N,relativePath:F,sortable:z,propertyInfos:S.length?S:undefined,additionalPropertyInfos:E.length>0?E:undefined,exportSettings:P,width:((b=e.annotations)===null||b===void 0?void 0:(h=b.HTML5)===null||h===void 0?void 0:(T=h.CssDefaults)===null||T===void 0?void 0:(I=T.width)===null||I===void 0?void 0:I.valueOf())||undefined,importance:Zt(e,c),isNavigable:true,formatOptions:L,caseSensitive:zt(n),typeConfig:H,visualSettings:j,timezoneText:(A=P)===null||A===void 0?void 0:A.timezone,isPartOfLineItem:true};W.isInsightsSupported=K===true&&o===true&&en(e,M,n,B);const Q=$t(e)||M;if(Q){W.tooltip=Q}if(C.textOnlyPropertiesFromTextAnnotation.length>0){v.push(...C.textOnlyPropertiesFromTextAnnotation)}if(C.exportDataPointTargetValue&&W.exportSettings){W.exportDataPointTargetValue=C.exportDataPointTargetValue;W.exportSettings.type="String"}l.push(W);S.forEach(e=>{r[e]=C.properties[e];if(B){s.push(e)}});E.forEach(e=>{r[e]=C.additionalProperties[e]})})}return Ct(r,a,l,s,n,u,v)};const nn=function(e,t,n,o){let i;if(e){i=e.map(function(e){const i=t.find(function(t){return t.relativePath===e&&t.propertyInfos===undefined});if(i){return i.name}else{const i=wt({[e]:o.resolvePath(e)},t,[],n,o,[]);t.push(i[0]);return i[0].name}})}return i};const on=function(e){return e.map(t=>`{${e.indexOf(t)}}`).join(`${"\n"}`)};const an=function(e,t,n,o,i){const a={};function l(e,n){return t.some(e=>e.key===n)}function r(e){return e.type===tt.Slot}function s(e){return e.type===undefined&&!!e.template}function d(e,t){const o=oe(n.getEntitySet());e.forEach(e=>{t.forEach(t=>{if(t.name===e){t.sortable=o.indexOf(e.replace("Property::",""))===-1;t.isGroupable=t.sortable}})})}for(const g in e){var u;const m=e[g];Me.validateKey(g);const y={key:g,width:m.width||undefined,position:{anchor:(u=m.position)===null||u===void 0?void 0:u.anchor,placement:m.position===undefined?Ve.After:m.position.placement},caseSensitive:zt(n)};if(l(m,g)){const e={...y,importance:m===null||m===void 0?void 0:m.importance,horizontalAlign:m===null||m===void 0?void 0:m.horizontalAlign,availability:m===null||m===void 0?void 0:m.availability,type:tt.Annotation,isNavigable:l(m,g)?undefined:ze(m,i,true),settings:m.settings,formatOptions:Kt(m.formatOptions)};a[g]=e}else{var v;const e=nn(m.properties,t,n,o);const i={...y,header:m.header,importance:(m===null||m===void 0?void 0:m.importance)||K.None,horizontalAlign:(m===null||m===void 0?void 0:m.horizontalAlign)||W.Begin,availability:(m===null||m===void 0?void 0:m.availability)||"Default",template:m.template,propertyInfos:e,exportSettings:e?{template:on(e),wrap:!!(e.length>1)}:null,id:`CustomColumn::${g}`,name:`CustomColumn::${g}`,formatOptions:{textLinesEdit:4},isGroupable:false,isNavigable:false,sortable:false,visualSettings:{widthCalculation:null},properties:m.properties,tooltip:m.header};if((v=m.header)!==null&&v!==void 0&&v.startsWith("{metaModel>")){var c,f;const e=(c=m.header)===null||c===void 0?void 0:c.substring(11,((f=m.header)===null||f===void 0?void 0:f.length)-1);try{i.header=n.getEntityTypeAnnotation(e).annotation.toString()}catch(t){F.info(`Unable to retrieve text from meta model using path ${e}`)}}if(e){d(e,t)}if(r(m)){const e={...i,type:tt.Slot};a[g]=e}else if(s(m)){const e={...i,type:tt.Default};a[g]=e}else{var p;const e=`The annotation column '${g}' referenced in the manifest is not found`;n.getDiagnostics().addIssue(we.Manifest,$e.Low,e,Ne,Ne===null||Ne===void 0?void 0:(p=Ne.AnnotationColumns)===null||p===void 0?void 0:p.InvalidKey)}}}return a};function ln(e,t,n){var o;const i=t.getManifestWrapper();const a=t.getManifestControlConfiguration(e);const l=i.getVariantManagement();const r=[];const s=n.type==="AnalyticalTable";const d=n.type==="ResponsiveTable";if((a===null||a===void 0?void 0:(o=a.tableSettings)===null||o===void 0?void 0:o.personalization)!==undefined){const e=a.tableSettings.personalization;if(e===true){switch(n.type){case"AnalyticalTable":return"Sort,Column,Filter,Group,Aggregate";case"ResponsiveTable":return"Sort,Column,Filter,Group";default:return"Sort,Column,Filter"}}else if(typeof e==="object"){if(e.sort){r.push("Sort")}if(e.column){r.push("Column")}if(e.filter){r.push("Filter")}if(e.group&&(s||d)){r.push("Group")}if(e.aggregate&&s){r.push("Aggregate")}return r.length>0?r.join(","):undefined}}else{r.push("Sort");r.push("Column");if(t.getTemplateType()===z.ListReport){if(l===B.Control||rn(i,t)){r.push("Filter")}}else{r.push("Filter")}if(s){r.push("Group");r.push("Aggregate")}if(d){r.push("Group")}return r.join(",")}return undefined}C.getP13nMode=ln;function rn(e,t){return e.isFilterBarHidden()&&!t.getManifestWrapper().hasMultipleVisualizations()&&t.getTemplateType()!==z.AnalyticalListPage}function sn(e,t,n){const o=oe(e.getEntitySet());let i;if(t!==null&&t!==void 0&&t.SortOrder){const e=[];const a={sorters:e};t.SortOrder.forEach(e=>{var t;const i=e.Property;if(i&&o.indexOf((t=i.$target)===null||t===void 0?void 0:t.name)===-1){const t=un([i],n)[0];if(t){a.sorters.push({name:t,descending:!!e.Descending})}}});i=a.sorters.length?JSON.stringify(a):undefined}return i}function dn(e){var t;if(!e){return undefined}const n=(t=e.InitialExpansionLevel)===null||t===void 0?void 0:t.valueOf();return typeof n==="number"?n:undefined}function un(e,t){const n=[];let o,i;e.forEach(e=>{if(e!==null&&e!==void 0&&e.value){o=t.find(t=>{i=t;return!i.propertyInfos&&i.relativePath===(e===null||e===void 0?void 0:e.value)});if(o){n.push(o.name)}}});return n}function vn(e,t,n){let o;if(e!==null&&e!==void 0&&e.GroupBy){let i=e.GroupBy;if(n==="ResponsiveTable"){i=i.slice(0,1)}const a=un(i,t).map(e=>({name:e}));o=a.length?JSON.stringify({groupLevels:a}):undefined}return o}function cn(e){const t={};e.columns.forEach(n=>{var o;n=n;const i=Object.keys(e.aggregates).find(e=>e===n.name);if(i){const t=e.aggregates[i];n.aggregatable=true;n.extension={customAggregate:t.defaultAggregate??{}}}if((o=n.additionalPropertyInfos)!==null&&o!==void 0&&o.length){n.additionalPropertyInfos.forEach(n=>{Lt(n,e.columns,t)})}});e.columns.forEach(e=>{e=e;if(e.additionalPropertyInfos){var n;e.additionalPropertyInfos=e.additionalPropertyInfos.map(e=>t[e]??e);e.propertyInfos=(n=e.propertyInfos)===null||n===void 0?void 0:n.concat(e.additionalPropertyInfos)}})}function fn(e,t){let n;if(e!==null&&e!==void 0&&e.Total){const o=e.Total;const i={};un(o,t).forEach(e=>{i[e]={}});n=JSON.stringify(i)}return n}function pn(e,t,n,o,i,a,l,r){var s,d,u;const{navigationPropertyPath:v}=mn(t);const c=(s=n.getDataModelObjectPath().targetEntityType.annotations)===null||s===void 0?void 0:(d=s.UI)===null||d===void 0?void 0:(u=d.HeaderInfo)===null||u===void 0?void 0:u.TypeNamePlural;const f=c&&Ee(Pe(c));const p=n.getDataModelObjectPath().targetEntitySet;const g=n.getManifestWrapper();const m=v.length===0,y=ln(t,n,o),b=v?_(t):_(n.getContextPath(),"LineItem");const h=Tt(n);const T=lt(n,v);const I=g.getNavigationConfiguration(T);const A=Dt(e,o,n,I,t);const P=k(n,A.mode,o,l,r);const D=L(n,P);const F=w(n,P);const C=V(P,E(n));const N=It(e,t,n,m,h,D,F);let H=v?10:30;if(a!==null&&a!==void 0&&a.MaxItems){H=a.MaxItems.valueOf()}const j=g.getVariantManagement();const G=le(n.getDataModelObjectPath());const K={create:$(n,P),delete:U(n,P),paste:O(n,P,C),massEdit:x(n,P),insights:M(n,P,t),creationRow:R(n,P)};return{id:b,entityName:p?p.name:"",collection:se(n.getDataModelObjectPath()),navigationPath:v,row:Ft(e,n,I,T,o.type),p13nMode:y,standardActions:{actions:K,isInsertUpdateTemplated:C,updatablePropertyPath:ct(n)},displayMode:S(n,l),create:A,selectionMode:N,autoBindOnInit:rn(g,n)||n.getTemplateType()!==z.ListReport&&n.getTemplateType()!==z.AnalyticalListPage&&!(l&&g.hasMultipleVisualizations(l)),variantManagement:j==="Control"&&!y?B.None:j,threshold:H,sortConditions:sn(n,a,i),title:f,searchable:o.type!=="AnalyticalTable"&&!(Ie(G)&&G.value===false),initialExpansionLevel:dn(a)}}C.getTableAnnotationConfiguration=pn;function gn(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n="String";if(t){if(e==="Edm.DateTimeOffset"){n="DateTime"}return n}else{switch(e){case"Edm.Decimal":case"Edm.Int32":case"Edm.Int64":case"Edm.Double":case"Edm.Byte":n="Number";break;case"Edm.DateOfTime":case"Edm.Date":n="Date";break;case"Edm.DateTimeOffset":n="DateTime";break;case"Edm.TimeOfDay":n="Time";break;case"Edm.Boolean":n="Boolean";break;default:n="String"}}return n}function mn(e){const[t,n]=e.split("@");let o=t;if(o.lastIndexOf("/")===o.length-1){o=o.substr(0,o.length-1)}return{navigationPropertyPath:o,annotationPath:n}}C.splitPath=mn;function yn(e,t){const n=t.getEntityTypeAnnotation(e);const o=n.annotation;if(o){var i,a;const e=[];(i=o.SelectOptions)===null||i===void 0?void 0:i.forEach(t=>{const n=t.PropertyName;const o=(n===null||n===void 0?void 0:n.value)??"";if(e.indexOf(o)===-1){e.push(o)}});return{text:o===null||o===void 0?void 0:(a=o.Text)===null||a===void 0?void 0:a.toString(),propertyNames:e}}return undefined}C.getSelectionVariantConfiguration=yn;function bn(e,t,n){let o=e.enableFullScreen??n;if(!n&&o&&t.getTemplateType()===z.ListReport){o=false;t.getDiagnostics().addIssue(we.Manifest,$e.Low,Ue.FULLSCREENMODE_NOT_ON_LISTREPORT)}return o}function hn(e,t,n){let o;if(t!=="ResponsiveTable"){return undefined}switch(n.getTemplateType()){case z.ListReport:case z.AnalyticalListPage:o=!e.selectAll?"ClearAll":"Default";break;case z.ObjectPage:o=e.selectAll===false?"ClearAll":"Default";if(n.getManifestWrapper().useIconTabBar()){o=!e.selectAll?"ClearAll":"Default"}break;default:}return o}function Tn(e,t,n){let o=(e===null||e===void 0?void 0:e.type)||"ResponsiveTable";if((o==="AnalyticalTable"||o==="TreeTable")&&!n.getManifestWrapper().isDesktop()){o="ResponsiveTable"}return o}function In(e,t,n){if(e!=="ResponsiveTable"){if(n){return{rowCountMode:"Auto",rowCount:3}}else{return{rowCountMode:t.rowCountMode??"Fixed",rowCount:t.rowCount?t.rowCount:5}}}else{return{}}}function An(e,t){return t.condensedTableLayout!==undefined&&e!=="ResponsiveTable"?t.condensedTableLayout:false}function Pn(e){return e.selectAll===true||e.selectionLimit===0?0:e.selectionLimit||200}function Dn(e){var t,n;return(t=e.creationMode)!==null&&t!==void 0&&t.inlineCreationRowCount?(n=e.creationMode)===null||n===void 0?void 0:n.inlineCreationRowCount:2}function Fn(e,t,n,o){var i;if(n){t.push({annotationPath:o.annotationPath})}return{quickFilters:{showCounts:e===null||e===void 0?void 0:(i=e.quickVariantSelection)===null||i===void 0?void 0:i.showCounts,paths:t}}}function Cn(e,t,n){return e.enableExport!==undefined?e.enableExport:t.getTemplateType()!=="ObjectPage"||n}function Sn(e){return e.frozenColumnCount}function En(e,t,n){var o,i,a;if(!t){return{}}const l=[];const r=n.getAnnotationEntityType(t);let s;let d;e===null||e===void 0?void 0:(o=e.quickVariantSelection)===null||o===void 0?void 0:(i=o.paths)===null||i===void 0?void 0:i.forEach(t=>{s=r.resolvePath(t.annotationPath);d=Fn(e,l,s,t)});let u=false;u=!!((a=e.quickVariantSelection)!==null&&a!==void 0&&a.hideTableTitle);return{filters:d,headerVisible:!(s&&u)}}function On(e,t){const n=de(t.getDataModelObjectPath(),e).navigationProperties;if((n===null||n===void 0?void 0:n.length)>0){const e=[];n.forEach(t=>{e.push(Ut(t)||t.name)});return e}}function xn(e,t,n){var o,i,a,l,r,s,d,u;let v=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const c=n.getManifestWrapper();const f=n.getManifestControlConfiguration(t);const p=f&&f.tableSettings||{};const g=((o=p.creationMode)===null||o===void 0?void 0:o.name)||Q.NewPage;const m=!c.isPhone();const y=p.enablePaste!==undefined?p.enablePaste:n.getTemplateType()==="ObjectPage";const b=n.getTemplateType();const h=b===z.ListReport?"API.dataStateIndicatorFilter":undefined;const T=v&&c.isCondensedLayoutCompliant();const I=En(p,e,n);const A=(i=p.creationMode)===null||i===void 0?void 0:i.customValidationFunction;const P=n.getEntityType();const D=new J(P,n);const F=Tn(p,D,n);const C=In(F,p,b===z.ListReport);const S=An(F,p);const E={createAtEnd:((a=p.creationMode)===null||a===void 0?void 0:a.createAtEnd)!==undefined?(l=p.creationMode)===null||l===void 0?void 0:l.createAtEnd:g!==Q.Inline,creationMode:g,customValidationFunction:A,dataStateIndicatorFilter:h,disableAddRowButtonForEmptyData:!A?!!((r=p.creationMode)!==null&&r!==void 0&&r.disableAddRowButtonForEmptyData):false,enableAutoColumnWidth:m,enableExport:Cn(p,n,y),frozenColumnCount:Sn(p),enableFullScreen:bn(p,n,c.isPhone()),enableMassEdit:p===null||p===void 0?void 0:p.enableMassEdit,enableAddCardToInsights:p===null||p===void 0?void 0:p.enableAddCardToInsights,enablePaste:y,headerVisible:true,multiSelectMode:hn(p,F,n),selectionLimit:Pn(p),inlineCreationRowCount:Dn(p),inlineCreationRowsHiddenInEditMode:(p===null||p===void 0?void 0:(s=p.creationMode)===null||s===void 0?void 0:s.inlineCreationRowsHiddenInEditMode)??false,showRowCount:!(p!==null&&p!==void 0&&(d=p.quickVariantSelection)!==null&&d!==void 0&&d.showCounts)&&!((u=c.getViewConfiguration())!==null&&u!==void 0&&u.showCounts),type:F,useCondensedTableLayout:S&&T,isCompactType:c.isCompactType()};const O={...E,...C,...I};if(F==="TreeTable"){O.hierarchyQualifier=p.hierarchyQualifier}return O}C.getTableManifestConfiguration=xn;function Mn(e,t){var n,o,i,a,l;let r;if(ve(e)){r=ue(e.targetType)?Ce[e.targetType.underlyingType]:Ce[e.type]}if(r===undefined&&t!==undefined){r=Ce[t]}const s={type:(n=r)===null||n===void 0?void 0:n.type,constraints:{},formatOptions:{}};if(ve(e)&&r!==undefined){var d,u,v,c,f,p,g,m,y,b,h,T,I,A,P,D,F;s.constraints={scale:(d=r.constraints)!==null&&d!==void 0&&d.$Scale?e.scale:undefined,precision:(u=r.constraints)!==null&&u!==void 0&&u.$Precision?e.precision:undefined,maxLength:(v=r.constraints)!==null&&v!==void 0&&v.$MaxLength?e.maxLength:undefined,nullable:(c=r.constraints)!==null&&c!==void 0&&c.$Nullable?e.nullable:undefined,minimum:(f=r.constraints)!==null&&f!==void 0&&f["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((p=e.annotations)===null||p===void 0?void 0:(g=p.Validation)===null||g===void 0?void 0:g.Minimum)?`${(m=e.annotations)===null||m===void 0?void 0:(y=m.Validation)===null||y===void 0?void 0:y.Minimum}`:undefined,maximum:(b=r.constraints)!==null&&b!==void 0&&b["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((h=e.annotations)===null||h===void 0?void 0:(T=h.Validation)===null||T===void 0?void 0:T.Maximum)?`${(I=e.annotations)===null||I===void 0?void 0:(A=I.Validation)===null||A===void 0?void 0:A.Maximum}`:undefined,isDigitSequence:s.type==="sap.ui.model.odata.type.String"&&(P=r.constraints)!==null&&P!==void 0&&P[`@${"com.sap.vocabularies.Common.v1.IsDigitSequence"}`]&&(D=e.annotations)!==null&&D!==void 0&&(F=D.Common)!==null&&F!==void 0&&F.IsDigitSequence?true:undefined}}s.formatOptions={parseAsString:(s===null||s===void 0?void 0:(o=s.type)===null||o===void 0?void 0:o.indexOf("sap.ui.model.odata.type.Int"))===0||(s===null||s===void 0?void 0:(i=s.type)===null||i===void 0?void 0:i.indexOf("sap.ui.model.odata.type.Double"))===0?false:undefined,emptyString:(s===null||s===void 0?void 0:(a=s.type)===null||a===void 0?void 0:a.indexOf("sap.ui.model.odata.type.Int"))===0||(s===null||s===void 0?void 0:(l=s.type)===null||l===void 0?void 0:l.indexOf("sap.ui.model.odata.type.Double"))===0?"":undefined,parseKeepsEmptyString:s.type==="sap.ui.model.odata.type.String"?true:undefined};return s}C.getTypeConfig=Mn;return{getTableActions:nt,getTableColumns:ot,getColumnsFromEntityType:Ct,updateLinkedProperties:rt,createTableVisualization:dt,createDefaultTableVisualization:ut,getCapabilityRestriction:Tt,getSelectionMode:It,getRowStatusVisibility:Nt,getImportance:Zt,getP13nMode:ln,getTableAnnotationConfiguration:pn,isFilteringCaseSensitive:zt,splitPath:mn,getSelectionVariantConfiguration:yn,getTableManifestConfiguration:xn,getTypeConfig:Mn,updateTableVisualizationForType:at}},false);
|
|
421
426
|
/*!
|
|
422
427
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
423
428
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
424
429
|
*/
|
|
425
|
-
sap.ui.predefine("sap/fe/core/converters/controls/Common/table/StandardActions", ["sap/fe/core/formatters/TableFormatter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","../../../helpers/BindingHelper","../../../ManifestSettings"],function(e,t,n,i,a,o,r){"use strict";var
|
|
430
|
+
sap.ui.predefine("sap/fe/core/converters/controls/Common/table/StandardActions", ["sap/fe/core/formatters/TableFormatter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","../../../helpers/BindingHelper","../../../helpers/InsightsHelpers","../../../ManifestSettings"],function(e,t,n,i,a,o,s,r){"use strict";var l={};var d=r.TemplateType;var c=r.CreationMode;var u=s.getInsightsVisibility;var p=o.UI;var v=o.singletonPathVisitor;var f=a.isPathUpdatable;var g=a.isPathInsertable;var b=a.isPathDeletable;var h=a.getTargetObjectPath;var y=i.isNavigationProperty;var T=i.isEntitySet;var C=t.pathInModel;var M=t.or;var m=t.notEqual;var E=t.not;var P=t.length;var D=t.isPathInModelExpression;var A=t.isConstant;var S=t.ifElse;var I=t.greaterThan;var x=t.greaterOrEqual;var O=t.getExpressionFromAnnotation;var R=t.formatResult;var w=t.equal;var H=t.constant;var U=t.compileExpression;var V=t.and;var j;(function(e){e["CreateHidden"]="CreateHidden";e["DeleteHidden"]="DeleteHidden";e["UpdateHidden"]="UpdateHidden"})(j||(j={}));function k(e,t,n,i,a){return{collectionPath:h(e.getDataModelObjectPath()),hiddenAnnotation:{create:F(e,j.CreateHidden),delete:F(e,j.DeleteHidden),update:F(e,j.UpdateHidden)},creationMode:t,isDraftOrStickySupported:L(e),isViewWithMultipleVisualizations:i?e.getManifestWrapper().hasMultipleVisualizations(i):false,newAction:z(e),tableManifestConfiguration:n,restrictions:N(e),isInsightsEnabled:a}}l.generateStandardActionsContext=k;function L(e){var t,i,a;const o=e.getDataModelObjectPath();const s=n.isObjectPathDraftSupported(o);const r=(t=o.startingEntitySet)!==null&&t!==void 0&&(i=t.annotations)!==null&&i!==void 0&&(a=i.Session)!==null&&a!==void 0&&a.StickySessionSupported?true:false;return s||r}l.isDraftOrStickySupported=L;function z(e){var t,n,i,a;const o=e.getEntitySet();const s=T(o)?((t=o.annotations.Common)===null||t===void 0?void 0:(n=t.DraftRoot)===null||n===void 0?void 0:n.NewAction)??((i=o.annotations.Session)===null||i===void 0?void 0:(a=i.StickySessionSupported)===null||a===void 0?void 0:a.NewAction):undefined;const r=s===null||s===void 0?void 0:s.toString();if(r){var l,d,c,u;let t=e===null||e===void 0?void 0:(l=e.getEntityType().actions[r])===null||l===void 0?void 0:(d=l.annotations)===null||d===void 0?void 0:(c=d.Core)===null||c===void 0?void 0:(u=c.OperationAvailable)===null||u===void 0?void 0:u.valueOf();t=t!==undefined?t:true;return{name:r,available:O(t)}}return undefined}l.getNewAction=z;function F(e,t){var n;let i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;const a=e.getEntitySet();const o=e.getDataModelObjectPath();const s=o.navigationProperties.length>0&&i?[o.navigationProperties[o.navigationProperties.length-1].name]:[];const r=(a===null||a===void 0?void 0:(n=a.annotations.UI)===null||n===void 0?void 0:n[t])||false;return a?O(r,s,undefined,t=>v(t,e.getConvertedTypes(),s)):H(false)}l.isActionAnnotatedHidden=F;function N(e){const t=e.getDataModelObjectPath();const n=[{key:"isInsertable",function:g},{key:"isUpdatable",function:f},{key:"isDeletable",function:b}];const i={};n.forEach(function(n){const a=n["function"];i[n.key]={expression:a.apply(null,[t,{pathVisitor:(t,n)=>v(t,e.getConvertedTypes(),n)}]),navigationExpression:a.apply(null,[t,{ignoreTargetCollection:true,authorizeUnresolvable:true,pathVisitor:(t,n)=>v(t,e.getConvertedTypes(),n)}])}});return i}l.getRestrictions=N;function W(e,t){return t||e.creationMode===c.External}l.getInsertUpdateActionsTemplating=W;function q(e,t){const n=X(e,t);return{isTemplated:U(K(t,n)),visible:U(n),enabled:U(ne(e,t,n))}}l.getStandardActionCreate=q;function B(e,t){const n=Y(e,t);return{isTemplated:U(Q(n)),visible:U(n),enabled:U(ie(e,t,n))}}l.getStandardActionDelete=B;function _(e,t){const n=X(e,t,true);return{isTemplated:U(K(t,n,true)),visible:U(n),enabled:U(te(e,t,n))}}l.getCreationRow=_;function $(e,t,n){const i=X(e,t);const a=ne(e,t,i);const o=Z(e,t,i,n);return{visible:U(o),enabled:U(ae(o,a))}}l.getStandardActionPaste=$;function G(e,t){const n=ee(e,t);return{isTemplated:U(Q(n)),visible:U(n),enabled:U(oe(e,t,n))}}l.getStandardActionMassEdit=G;function J(e,t,n){const i=(t.isInsightsEnabled??false)&&u("Table",e,n,t);return{isTemplated:U(i),visible:U(i),enabled:U(i)}}l.getStandardActionInsights=J;function K(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return V(M(V(n,e.creationMode===c.CreationRow),V(!n,e.creationMode!==c.CreationRow)),M(E(A(t)),t))}l.getCreateTemplating=K;function Q(e){return M(E(A(e)),e)}l.getDefaultTemplating=Q;function X(e,t){var n,i;let a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;const o=t.restrictions.isInsertable.expression;const s=a?F(e,j.CreateHidden,false):t.hiddenAnnotation.create;const r=t.newAction;return S(t.creationMode===c.External,V(E(s),M(e.getTemplateType()===d.ListReport,p.IsEditable)),S(M(V(A(r===null||r===void 0?void 0:r.available),w(r===null||r===void 0?void 0:r.available,false)),V(A(o),w(o,false),!r),V(A(s),w(s,true)),V(t.creationMode===c.InlineCreationRows,((n=t.tableManifestConfiguration)===null||n===void 0?void 0:n.type)==="ResponsiveTable",S((t===null||t===void 0?void 0:(i=t.tableManifestConfiguration)===null||i===void 0?void 0:i.inlineCreationRowsHiddenInEditMode)===false,true,p.IsCreateMode))),false,S(e.getTemplateType()===d.ListReport,M(E(D(s)),E(s)),V(E(s),p.IsEditable))))}l.getCreateVisibility=X;function Y(e,t){const n=t.hiddenAnnotation.delete;const i=t.restrictions.isDeletable.expression;return S(e.getTemplateType()===d.AnalyticalListPage,false,S(V(A(i),w(i,false)),false,S(V(A(n),w(n,H(true))),false,S(e.getTemplateType()!==d.ListReport,V(E(n),p.IsEditable),E(V(D(n),n))))))}l.getDeleteVisibility=Y;function Z(e,t,n,i){return V(m(t.tableManifestConfiguration.enablePaste,false),n,i,[d.ListReport,d.AnalyticalListPage].indexOf(e.getTemplateType())===-1,t.restrictions.isInsertable.expression)}l.getPasteVisibility=Z;function ee(e,t){var n;const i=t.hiddenAnnotation.update,a=t.restrictions.isUpdatable.expression,o=((n=t.tableManifestConfiguration)===null||n===void 0?void 0:n.enableMassEdit)||false;const s=e.getTemplateType()===d.ObjectPage?p.IsEditable:e.getTemplateType()===d.ListReport;return V(E(V(A(a),w(a,false))),o,s,E(i))}l.getMassEditVisibility=ee;function te(t,n,i){const a=g(t.getDataModelObjectPath(),{ignoreTargetCollection:true,authorizeUnresolvable:true,pathVisitor:(e,n)=>{if(e.indexOf("/")===0){e=v(e,t.getConvertedTypes(),n);return e}const i=t.getDataModelObjectPath().navigationProperties;if(i){const t=i[i.length-1];const n=y(t)&&t.partner;if(n){e=`${n}/${e}`}}return e}});const o=a._type==="Unresolvable"?g(t.getDataModelObjectPath(),{pathVisitor:e=>v(e,t.getConvertedTypes(),[])}):a;return V(i,o,M(!n.tableManifestConfiguration.disableAddRowButtonForEmptyData,R([C("creationRowFieldValidity","internal")],e.validateCreationRowFields)))}l.getCreationRowEnablement=te;function ne(e,t,n){let i;if(t.creationMode===c.InlineCreationRows){i=E(t.hiddenAnnotation.create)}else{i=n}const a=t.restrictions.isInsertable.expression;const o=e.resolveAbsolutePath(t.collectionPath).target;return V(i,M(T(o),V(a,M(e.getTemplateType()!==d.ObjectPage,p.IsEditable))))}l.getCreateEnablement=ne;function ie(e,t,n){const i=C("deletableContexts","internal");const a=C("unSavedContexts","internal");const o=C("draftsWithDeletableActive","internal");const s=C("draftsWithNonDeletableActive","internal");return V(n,M(t.restrictions.isDeletable.navigationExpression._type==="Unresolvable",t.restrictions.isDeletable.expression),M(V(m(i,undefined),I(P(i),0)),V(m(o,undefined),I(P(o),0)),V(m(s,undefined),I(P(s),0)),V(m(a,undefined),I(P(a),0))))}l.getDeleteEnablement=ie;function ae(e,t){return V(e,t)}l.getPasteEnablement=ae;function oe(e,t,i){const a=t.restrictions.isUpdatable.expression;const o=!A(a)&&t.restrictions.isUpdatable.navigationExpression._type==="Unresolvable";const s=x(C("numberOfSelectedContexts","internal"),1);const r=x(P(C("updatableContexts","internal")),1);const l=n.isObjectPathDraftSupported(e.getDataModelObjectPath());const d=se(e);const c=S(M(V(d,l),o),V(s,r),V(s));return V(i,S(o,c,V(c,a)))}l.getMassEditEnablement=oe;function se(e,t){const n=e.getTemplateType();if(n===d.ListReport||n===d.AnalyticalListPage||t&&e.getManifestWrapper().hasMultipleVisualizations(t)){return true}return false}l.isInDisplayMode=se;return l},false);
|
|
426
431
|
/*!
|
|
427
432
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
428
433
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
429
434
|
*/
|
|
430
|
-
sap.ui.predefine("sap/fe/core/converters/controls/ListReport/FilterBar", ["sap/fe/core/converters/controls/Common/Table","sap/fe/core/converters/controls/ListReport/VisualFilters","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/helpers/Key","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/PropertyHelper","../Common/DataVisualization"],function(e,t,n,o,i,a,r,l,s,c,u){"use strict";var d={};var v=u.getSelectionVariant;var p=c.getAssociatedUnitPropertyPath;var f=c.getAssociatedTimezonePropertyPath;var g=c.getAssociatedTextPropertyPath;var h=c.getAssociatedCurrencyPropertyPath;var y=s.enhanceDataModelPath;var m=l.isNavigationProperty;var P=l.isMultipleNavigationProperty;var b=l.isEntitySet;var F=l.isComplexType;var S=a.getExpressionFromAnnotation;var T=a.compileExpression;var E=i.KeyHelper;var x=o.IssueType;var O=o.IssueSeverity;var C=o.IssueCategory;var D=n.Placement;var I=n.OverrideType;var A=n.insertCustomElements;var N=t.getVisualFilters;var U=e.isFilteringCaseSensitive;var R=e.getTypeConfig;var M=e.getSelectionVariantConfiguration;var w;(function(e){e["Default"]="Default";e["Slot"]="Slot"})(w||(w={}));const V="Edm.String";const $="sap.ui.model.odata.type.String";function k(e){const t={};e.Data.forEach(n=>{if(n.$Type==="com.sap.vocabularies.UI.v1.DataField"){var o,i;t[n.Value.path]={group:e.fullyQualifiedName,groupLabel:T(S(e.Label||((o=e.annotations)===null||o===void 0?void 0:(i=o.Common)===null||i===void 0?void 0:i.Label)||e.qualifier))||e.qualifier}}});return t}function L(e){return e.reduce((e,t)=>{t.propertyNames.forEach(t=>{e[t]=true});return e},{})}function j(e,t){if(t&&e.length>0){return e.every(e=>e.enableAnalytics&&t===e.annotation.collection)}return false}function q(e,t){const n=[];return e.map(e=>{const o=e.control.filters;const i=[];for(const e in o){if(Array.isArray(o[e].paths)){const a=o[e].paths;a.forEach(e=>{if(e&&e.annotationPath&&n.indexOf(e.annotationPath)===-1){n.push(e.annotationPath);const o=M(e.annotationPath,t);if(o){i.push(o)}}})}}return i}).reduce((e,t)=>e.concat(t),[])}const H=function(e,t){const n=t.split("/");let o;let i="";while(n.length){let t=n.shift();o=o?`${o}/${t}`:t;const a=e.resolvePath(o);if(P(a)){t+="*"}i=i?`${i}/${t}`:t}return i};const B=function(e,t,n,o,i){var a,r,l;if(t&&t.targetType===undefined&&(o||((a=t.annotations)===null||a===void 0?void 0:(r=a.UI)===null||r===void 0?void 0:(l=r.Hidden)===null||l===void 0?void 0:l.valueOf())!==true)){var s,c,u,d,v,p,f,g;const o=i.getAnnotationEntityType(t);return{key:E.getSelectionFieldKeyFromPath(n),annotationPath:i.getAbsoluteAnnotationPath(n),conditionPath:H(e,n),availability:((s=t.annotations)===null||s===void 0?void 0:(c=s.UI)===null||c===void 0?void 0:(u=c.HiddenFilter)===null||u===void 0?void 0:u.valueOf())===true?"Hidden":"Adaptation",label:T(S(((d=t.annotations.Common)===null||d===void 0?void 0:(v=d.Label)===null||v===void 0?void 0:v.valueOf())||t.name)),group:o.name,groupLabel:T(S((o===null||o===void 0?void 0:(p=o.annotations)===null||p===void 0?void 0:(f=p.Common)===null||f===void 0?void 0:(g=f.Label)===null||g===void 0?void 0:g.valueOf())||o.name))}}return undefined};const W=function(e,t,n,o,i){const a={};if(n){n.forEach(n=>{const r=n.name;const l=(t?`${t}/`:"")+r;const s=B(e,n,l,o,i);if(s){a[l]=s}})}return a};const K=function(e,t,n,o){let i={};if(t){t.forEach(t=>{let a;const r=e.resolvePath(t);if(r===undefined){return}if(m(r)){a=W(e,t,r.targetType.entityProperties,n,o)}else if(F(r.targetType)){a=W(e,t,r.targetType.properties,n,o)}else{const i=t.includes("/")?t.split("/").splice(0,1).join("/"):"";a=W(e,i,[r],n,o)}i={...i,...a}})}return i};const J=function(e,t,n,o){let i=e[t];if(i){delete e[t]}else{i=B(o,o.resolvePath(t),t,true,n)}if(!i){var a;(a=n.getDiagnostics())===null||a===void 0?void 0:a.addIssue(C.Annotation,O.High,x.MISSING_SELECTIONFIELD)}if(i){var r,l;i.availability=i.availability==="Hidden"?"Hidden":"Default";i.isParameter=!!((r=o.annotations)!==null&&r!==void 0&&(l=r.Common)!==null&&l!==void 0&&l.ResultContext)}return i};const G=function(e,t,n,o,i){const a=[];const r={};const l=t.entityProperties;i===null||i===void 0?void 0:i.forEach(e=>{r[e.value]=true});if(e&&e.length>0){e===null||e===void 0?void 0:e.forEach(e=>{const r=e.PropertyName;const l=r===null||r===void 0?void 0:r.value;const s={};i===null||i===void 0?void 0:i.forEach(e=>{s[e.value]=true});if(l&&!(l in o)){if(!(l in s)){const e=X(l,n,t);if(e){a.push(e)}}}})}else if(l){l.forEach(e=>{var i,l;const s=(i=e.annotations)===null||i===void 0?void 0:(l=i.Common)===null||l===void 0?void 0:l.FilterDefaultValue;const c=e.name;if(!(c in o)){if(s&&!(c in r)){const e=X(c,n,t);if(e){a.push(e)}}}})}return a};function z(e){var t,n;const o=e.getDataModelObjectPath();const i=o.startingEntitySet.entityType;const a=!!((t=i.annotations)!==null&&t!==void 0&&(n=t.Common)!==null&&n!==void 0&&n.ResultContext)&&!o.targetEntitySet;const r=a&&e.getConverterContextFor(`/${o.startingEntitySet.name}`);return r?i.entityProperties.map(function(e){return J({},e.name,r,i)}):[]}const Q=function(e,t,n){const o=t.length===0||t.every(e=>!e.applySupported.enableSearch);const i=e.length===0||e.every(e=>(e.enableAnalytics||e.control.type==="TreeTable")&&!e.enableBasicSearch);const a=n.getContextPath();if(a&&o&&i){return true}else{return false}};d.getFilterBarHideBasicSearch=Q;const _=function(e,t){const n=t.getManifestWrapper().getFilterConfiguration();const o=(n===null||n===void 0?void 0:n.filterFields)||{};const i=K(e,Object.keys(o).map(e=>E.getPathFromSelectionFieldKey(e)),true,t);const a={};for(const n in o){const r=o[n];const l=E.getPathFromSelectionFieldKey(n);const s=i[l];const c=r.type==="Slot"?w.Slot:w.Default;const u=r&&r!==null&&r!==void 0&&r.visualFilter?N(e,t,n,o):undefined;a[n]={key:n,type:c,slotName:(r===null||r===void 0?void 0:r.slotName)||n,annotationPath:s===null||s===void 0?void 0:s.annotationPath,conditionPath:(s===null||s===void 0?void 0:s.conditionPath)||l,template:r.template,label:r.label,position:r.position||{placement:D.After},availability:r.availability||"Default",settings:r.settings,visualFilter:u,required:r.required}}return a};d.getManifestFilterFields=_;const X=function(e,t,n){return J({},e,t,n)};d.getFilterField=X;const Y=function(e,t){let n=[];if(e&&e[t]){n=e[t].map(function(e){return e.value})}return n};d.getFilterRestrictions=Y;const Z=function(e){const t={};if(e&&e.FilterExpressionRestrictions){e.FilterExpressionRestrictions.forEach(function(e){var n;if((n=e.Property)!==null&&n!==void 0&&n.value&&e.AllowedExpressions){var o;if(t[(o=e.Property)===null||o===void 0?void 0:o.value]){var i;t[(i=e.Property)===null||i===void 0?void 0:i.value].push(e.AllowedExpressions.toString())}else{var a;t[(a=e.Property)===null||a===void 0?void 0:a.value]=[e.AllowedExpressions.toString()]}}})}return t};d.getFilterAllowedExpression=Z;const ee=function(){return{name:"$search",path:"$search",dataType:$,maxConditions:1}};const te=function(){return{name:"$editState",path:"$editState",groupLabel:"",group:"",dataType:$,hiddenFilter:false}};const ne=function(e){var t;const n=e.getEntitySet();return b(n)?(t=n.annotations.Capabilities)===null||t===void 0?void 0:t.SearchRestrictions:undefined};const oe=function(e,t){var n,o,i;const a=(n=e.getEntitySet())===null||n===void 0?void 0:(o=n.annotations)===null||o===void 0?void 0:(i=o.Capabilities)===null||i===void 0?void 0:i.NavigationRestrictions;const r=a&&a.RestrictedProperties;return r&&r.find(function(e){return e&&e.NavigationProperty&&e.NavigationProperty.value===t})};d.getNavigationRestrictions=oe;const ie=function(e){return{key:e.key,annotationPath:e.annotationPath,conditionPath:e.conditionPath,name:e.conditionPath,label:e.label,hiddenFilter:e.availability==="Hidden",display:"Value",isParameter:e.isParameter,caseSensitive:e.caseSensitive,availability:e.availability,position:e.position,type:e.type,template:e.template,menu:e.menu,required:e.required}};const ae=function(e){const t=["SingleValue","MultiValue","SingleRange","MultiRange","SearchExpression","MultiRangeOrSearchExpression"];e.sort(function(e,n){return t.indexOf(e)-t.indexOf(n)});return e[0]};d.getSpecificAllowedExpression=ae;const re=function(e,t){var n,o,i,a,r,l;const s=e===null||e===void 0?void 0:(n=e.Common)===null||n===void 0?void 0:n.Text,c=s&&(e&&(e===null||e===void 0?void 0:(o=e.Common)===null||o===void 0?void 0:(i=o.Text)===null||i===void 0?void 0:(a=i.annotations)===null||a===void 0?void 0:(r=a.UI)===null||r===void 0?void 0:r.TextArrangement)||t&&(t===null||t===void 0?void 0:(l=t.UI)===null||l===void 0?void 0:l.TextArrangement));if(c){if(c.valueOf()==="UI.TextArrangementType/TextOnly"){return"Description"}else if(c.valueOf()==="UI.TextArrangementType/TextLast"){return"ValueDescription"}return"DescriptionValue"}return s?"DescriptionValue":"Value"};d.displayMode=re;const le=function(e,t,n){var o;let i=ie(t);const a=t.annotationPath;if(!a){return i}const r=e.getConverterContextFor(a).getDataModelObjectPath().targetObject;const l=r===null||r===void 0?void 0:r.annotations;const s=e===null||e===void 0?void 0:(o=e.getDataModelObjectPath().targetObject)===null||o===void 0?void 0:o.annotations;const c=n.formatOptions;const u=n.constraints;i=Object.assign(i,{formatOptions:c,constraints:u,display:re(l,s)});return i};d.fetchPropertyInfo=le;const se=function(e){let t=true;switch(e.filterExpression){case"SearchExpression":case"SingleRange":case"SingleValue":t=false;break;default:break}if(e.type&&e.type.indexOf("Boolean")>0){t=false}return t};d.isMultiValue=se;const ce=function(e){return(e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath")&&e.Value.path.includes("/")};const ue=function(e,t,n){var o;const i=(o=e.Value)===null||o===void 0?void 0:o.$target;if(i){const e=g(i)||h(i)||p(i)||f(i);const o=e?y(t.getDataModelObjectPath(),e).navigationProperties:undefined;if(o!==null&&o!==void 0&&o.length){const e=o[0].name;if(!n.includes(e)){n.push(e)}}}};const de=function(e,t,n){var o,i,a;switch(t.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":switch((o=t.Target)===null||o===void 0?void 0:(i=o.$target)===null||i===void 0?void 0:i.$Type){case"com.sap.vocabularies.UI.v1.FieldGroupType":(a=t.Target.$target.Data)===null||a===void 0?void 0:a.forEach(t=>{de(e,t,n)});break;default:break}break;case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":if(ce(t)){const o=y(n.getDataModelObjectPath(),t.Value.path).navigationProperties[0].name;if(!e.includes(o)){e.push(o)}}ue(t,n,e);break;default:break}return e};const ve=function(e){var t,n,o;let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let l=arguments.length>4?arguments[4]:undefined;const s=q(i,e);const c=L(s);const u=e.getEntityType();const d=a&&((t=e.getEntityTypeAnnotation(a))===null||t===void 0?void 0:t.annotation)||((n=u.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:o.SelectionFields)||[];let p=[];if(i.length===0&&!!l){var f;(f=e.getEntityTypeAnnotation(l).annotation)===null||f===void 0?void 0:f.forEach(t=>{p=de(p,t,e)})}const g={...W(u,"",u.entityProperties,r,e),...K(u,p,false,e),...K(u,e.getManifestWrapper().getFilterConfiguration().navigationProperties,r,e)};let h=[];const y=v(u,e);if(y){h=y.SelectOptions}const m=(d===null||d===void 0?void 0:d.reduce((t,n)=>{const o=n.value;if(!(o in c)){let n;if(a.startsWith("@com.sap.vocabularies.UI.v1.SelectionFields")){n=""}else{n=a.split("/@com.sap.vocabularies.UI.v1.SelectionFields")[0]}const i=n?n+"/"+o:o;const r=J(g,i,e,u);if(r){r.group="";r.groupLabel="";t.push(r)}}return t},[]))||[];const P=G(h,u,e,c,d);return{excludedFilterProperties:c,entityType:u,annotatedSelectionFields:d,filterFields:g,propertyInfoFields:m,defaultFilterFields:P}};const pe=function(e){const t=R(e,e===null||e===void 0?void 0:e.type);if((e===null||e===void 0?void 0:e.type)===V&&(t.constraints.nullable===undefined||t.constraints.nullable===true)){t.formatOptions.parseKeepsEmptyString=false}return t};d.fetchTypeConfig=pe;const fe=function(e,t,n,o){let i=le(t,e,o[e.key]),a="";if(e.conditionPath){a=e.conditionPath.replace(/\+|\*/g,"")}if(i){i=Object.assign(i,{maxConditions:!i.isParameter&&se(i)?-1:1,required:e.required??(i.isParameter||n.indexOf(a)>=0),caseSensitive:U(t),dataType:o[e.key].type})}return i};d.assignDataTypeToPropertyInfo=fe;const ge=function(e,t,n){var o;const i=[];const a={};if(n){e=e.concat(n)}e.forEach(function(e){if(e.annotationPath){const n=t.getConverterContextFor(e.annotationPath);const o=n.getDataModelObjectPath().targetObject;i.push(o===null||o===void 0?void 0:o.type);const r=pe(o);a[e.key]=r}else{i.push(V);a[e.key]={type:$}}});const l=t.getEntitySet();const s=b(l)?(o=l.annotations.Capabilities)===null||o===void 0?void 0:o.FilterRestrictions:undefined;const c={};c.RequiredProperties=Y(s,"RequiredProperties")||[];c.NonFilterableProperties=Y(s,"NonFilterableProperties")||[];c.FilterAllowedExpressions=Z(s);const u=t.getContextPath();const d=u.split("/");if(d.length>2){const e=d[d.length-1];d.splice(-1,1);const n=oe(t,e);const o=n&&n.FilterRestrictions;c.RequiredProperties=c.RequiredProperties.concat(Y(o,"RequiredProperties")||[]);c.NonFilterableProperties=c.NonFilterableProperties.concat(Y(o,"NonFilterableProperties")||[]);c.FilterAllowedExpressions={...Z(o)||{},...c.FilterAllowedExpressions}}const v=c.RequiredProperties;const p=c.NonFilterableProperties;const f=[];e.forEach(function(e){const n=e.conditionPath.replace(/\+|\*/g,"");if(p.indexOf(n)===-1){const n=fe(e,t,v,a);f.push(n)}});const g=t.getDataModelObjectPath();if(r.isObjectPathDraftSupported(g)){f.push(te())}const h=ne(t);const y=Boolean(h&&!h.Searchable);if(u&&y!==true){if(!h||h!==null&&h!==void 0&&h.Searchable){f.push(ee())}}return f};d.processSelectionFields=ge;const he=function(e,t,n){return A(e,_(t,n),{availability:I.overwrite,label:I.overwrite,type:I.overwrite,position:I.overwrite,slotName:I.overwrite,template:I.overwrite,settings:I.overwrite,visualFilter:I.overwrite,required:I.overwrite})};d.insertCustomManifestElements=he;const ye=function(e){var t,n;let o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";let a=arguments.length>3?arguments[3]:undefined;let r=arguments.length>4?arguments[4]:undefined;const l=ve(e,o,i,a,r);const s=z(e);let c=JSON.parse(JSON.stringify(l.propertyInfoFields));const u=l.entityType;c=s.concat(c);c=he(c,u,e);const d=ge(c,e,l.defaultFilterFields);d.sort(function(e,t){if(e.groupLabel===undefined||e.groupLabel===null){return-1}if(t.groupLabel===undefined||t.groupLabel===null){return 1}return e.groupLabel.localeCompare(t.groupLabel)});let v=JSON.stringify(d);v=v.replace(/\{/g,"\\{");v=v.replace(/\}/g,"\\}");const p=v;let f=JSON.parse(JSON.stringify(l.propertyInfoFields));f=s.concat(f);const g=l.excludedFilterProperties;const h=u===null||u===void 0?void 0:(t=u.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.FilterFacets;let y={};const m=e.getAnnotationsByTerm("UI","com.sap.vocabularies.UI.v1.FieldGroup");if(h===undefined||h.length<0){for(const e in m){y={...y,...k(m[e])}}}else{y=h.reduce((e,t)=>{for(let d=0;d<(t===null||t===void 0?void 0:(n=t.Target)===null||n===void 0?void 0:(o=n.$target)===null||o===void 0?void 0:(i=o.Data)===null||i===void 0?void 0:i.length);d++){var n,o,i,a,r,l,s,c,u;e[t===null||t===void 0?void 0:(a=t.Target)===null||a===void 0?void 0:(r=a.$target)===null||r===void 0?void 0:(l=r.Data[d])===null||l===void 0?void 0:(s=l.Value)===null||s===void 0?void 0:s.path]={group:t===null||t===void 0?void 0:(c=t.ID)===null||c===void 0?void 0:c.toString(),groupLabel:t===null||t===void 0?void 0:(u=t.Label)===null||u===void 0?void 0:u.toString()}}return e},{})}const P=l.filterFields;let b=f.concat(Object.keys(P).filter(e=>!(e in g)).map(e=>Object.assign(P[e],y[e])));const F=e.getContextPath();if(j(o,F)){const e=o[0].aggregates;if(e){const t=Object.keys(e).map(t=>e[t].relativePath);b=b.filter(e=>t.indexOf(e.key)===-1)}}const S=he(b,u,e);const T=U(e);S.forEach(e=>{e.caseSensitive=T});return{selectionFields:S,sPropertyInfo:p}};d.getSelectionFields=ye;const me=function(e,t,n){const o=Y(t,"RequiredProperties");const i=ne(e);const a=Boolean(i&&!i.Searchable);if(o.length>0||a||(n===null||n===void 0?void 0:n.FetchValues)===2){return true}return false};d.getExpandFilterFields=me;return d},false);
|
|
435
|
+
sap.ui.predefine("sap/fe/core/converters/controls/ListReport/FilterBar", ["sap/fe/core/converters/controls/Common/Table","sap/fe/core/converters/controls/ListReport/VisualFilters","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/converters/helpers/Key","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/PropertyHelper","sap/m/library","../Common/DataVisualization"],function(e,t,n,i,o,a,r,l,s,c,u,d){"use strict";var v={};var p=d.getSelectionVariant;var f=u.StandardDynamicDateRangeKeys;var g=c.getAssociatedUnitPropertyPath;var h=c.getAssociatedTimezonePropertyPath;var y=c.getAssociatedTextPropertyPath;var m=c.getAssociatedCurrencyPropertyPath;var P=s.getTargetNavigationPath;var b=s.enhanceDataModelPath;var F=l.isNavigationProperty;var T=l.isMultipleNavigationProperty;var S=l.isEntitySet;var E=l.isComplexType;var D=a.getExpressionFromAnnotation;var O=a.compileExpression;var x=o.KeyHelper;var C=i.IssueType;var A=i.IssueSeverity;var I=i.IssueCategory;var N=n.Placement;var R=n.OverrideType;var U=n.insertCustomElements;var M=t.getVisualFilters;var k=e.isFilteringCaseSensitive;var L=e.getTypeConfig;var j=e.getSelectionVariantConfiguration;var w;(function(e){e["Default"]="Default";e["Slot"]="Slot"})(w||(w={}));const V="Edm.String";const $="sap.ui.model.odata.type.String";function q(e){const t={};e.Data.forEach(n=>{if(n.$Type==="com.sap.vocabularies.UI.v1.DataField"){var i,o;t[n.Value.path]={group:e.fullyQualifiedName,groupLabel:O(D(e.Label||((i=e.annotations)===null||i===void 0?void 0:(o=i.Common)===null||o===void 0?void 0:o.Label)||e.qualifier))||e.qualifier}}});return t}function H(e){return e.reduce((e,t)=>{t.propertyNames.forEach(t=>{e[t]=true});return e},{})}function B(e,t){if(t&&e.length>0){return e.every(e=>e.enableAnalytics&&t===e.annotation.collection)}return false}function W(e,t){const n=[];return e.map(e=>{const i=e.control.filters;const o=[];for(const e in i){if(Array.isArray(i[e].paths)){const a=i[e].paths;a.forEach(e=>{if(e&&e.annotationPath&&n.indexOf(e.annotationPath)===-1){n.push(e.annotationPath);const i=j(e.annotationPath,t);if(i){o.push(i)}}})}}return o}).reduce((e,t)=>e.concat(t),[])}const K=function(e,t){const n=t.split("/");let i;let o="";while(n.length){let t=n.shift();i=i?`${i}/${t}`:t;const a=e.resolvePath(i);if(T(a)){t+="*"}o=o?`${o}/${t}`:t}return o};const G=function(e,t,n,i,o){var a,r,l;if(t&&t.targetType===undefined&&(i||((a=t.annotations)===null||a===void 0?void 0:(r=a.UI)===null||r===void 0?void 0:(l=r.Hidden)===null||l===void 0?void 0:l.valueOf())!==true)){var s,c,u,d,v,p,f,g;const i=o.getAnnotationEntityType(t),a={key:x.getSelectionFieldKeyFromPath(n),annotationPath:o.getAbsoluteAnnotationPath(n),conditionPath:K(e,n),availability:((s=t.annotations)===null||s===void 0?void 0:(c=s.UI)===null||c===void 0?void 0:(u=c.HiddenFilter)===null||u===void 0?void 0:u.valueOf())===true?"Hidden":"Adaptation",label:O(D(((d=t.annotations.Common)===null||d===void 0?void 0:(v=d.Label)===null||v===void 0?void 0:v.valueOf())||t.name)),group:i.name,groupLabel:O(D((i===null||i===void 0?void 0:(p=i.annotations)===null||p===void 0?void 0:(f=p.Common)===null||f===void 0?void 0:(g=f.Label)===null||g===void 0?void 0:g.valueOf())||i.name))};X(a);return a}return undefined};const X=function(e){if(e.key==="DraftAdministrativeData::CreationDateTime"||e.key==="DraftAdministrativeData::LastChangeDateTime"){const t=[f.TO,f.TOMORROW,f.NEXTWEEK,f.NEXTMONTH,f.NEXTQUARTER,f.NEXTYEAR];e.settings={operatorConfiguration:[{path:"key",equals:t.join(","),exclude:true}]}}};const J=function(e,t,n,i,o){const a={};if(n){n.forEach(n=>{const r=n.name;const l=(t?`${t}/`:"")+r;const s=G(e,n,l,i,o);if(s){a[l]=s}})}return a};const z=function(e,t,n,i){let o={};if(t){t.forEach(t=>{let a={};const r=b(i.getDataModelObjectPath(),t);const l=r.targetObject;if(l===undefined||!n&&r.navigationProperties.find(e=>{var t,n,i;return((t=e.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:(i=n.Hidden)===null||i===void 0?void 0:i.valueOf())===true})){return}if(F(l)){a=J(e,t,l.targetType.entityProperties,n,i)}else if(E(l.targetType)){a=J(e,t,l.targetType.properties,n,i)}else{a=J(e,P(r,true),[l],n,i)}o={...o,...a}})}return o};const Q=function(e,t,n,i){let o=e[t];if(o){delete e[t]}else{o=G(i,i.resolvePath(t),t,true,n)}if(!o){var a;(a=n.getDiagnostics())===null||a===void 0?void 0:a.addIssue(I.Annotation,A.High,C.MISSING_SELECTIONFIELD)}if(o){var r,l;o.availability=o.availability==="Hidden"?"Hidden":"Default";o.isParameter=!!((r=i.annotations)!==null&&r!==void 0&&(l=r.Common)!==null&&l!==void 0&&l.ResultContext)}return o};const Y=function(e,t,n,i,o){const a=[];const r={};const l=t.entityProperties;o===null||o===void 0?void 0:o.forEach(e=>{r[e.value]=true});if(e&&e.length>0){e===null||e===void 0?void 0:e.forEach(e=>{const r=e.PropertyName;const l=r===null||r===void 0?void 0:r.value;const s={};o===null||o===void 0?void 0:o.forEach(e=>{s[e.value]=true});if(l&&!(l in i)){if(!(l in s)){const e=te(l,n,t);if(e){a.push(e)}}}})}else if(l){l.forEach(e=>{var o,l;const s=(o=e.annotations)===null||o===void 0?void 0:(l=o.Common)===null||l===void 0?void 0:l.FilterDefaultValue;const c=e.name;if(!(c in i)){if(s&&!(c in r)){const e=te(c,n,t);if(e){a.push(e)}}}})}return a};function _(e){var t,n;const i=e.getDataModelObjectPath();const o=i.startingEntitySet.entityType;const a=!!((t=o.annotations)!==null&&t!==void 0&&(n=t.Common)!==null&&n!==void 0&&n.ResultContext)&&!i.targetEntitySet;const r=a&&e.getConverterContextFor(`/${i.startingEntitySet.name}`);return r?o.entityProperties.map(function(e){return Q({},e.name,r,o)}):[]}const Z=function(e,t,n){const i=t.length===0||t.every(e=>!e.applySupported.enableSearch);const o=e.length===0||e.every(e=>(e.enableAnalytics||e.control.type==="TreeTable")&&!e.enableBasicSearch);const a=n.getContextPath();if(a&&i&&o){return true}else{return false}};v.getFilterBarHideBasicSearch=Z;const ee=function(e,t){const n=t.getManifestWrapper().getFilterConfiguration();const i=(n===null||n===void 0?void 0:n.filterFields)||{};const o=z(e,Object.keys(i).map(e=>x.getPathFromSelectionFieldKey(e)),true,t);const a={};for(const n in i){const r=i[n];const l=x.getPathFromSelectionFieldKey(n);const s=o[l];const c=r.type==="Slot"?w.Slot:w.Default;const u=r&&r!==null&&r!==void 0&&r.visualFilter?M(e,t,n,i):undefined;a[n]={key:n,type:c,slotName:(r===null||r===void 0?void 0:r.slotName)||n,annotationPath:s===null||s===void 0?void 0:s.annotationPath,conditionPath:(s===null||s===void 0?void 0:s.conditionPath)||l,template:r.template,label:r.label,position:r.position||{placement:N.After},availability:r.availability||"Default",settings:r.settings,visualFilter:u,required:r.required}}return a};v.getManifestFilterFields=ee;const te=function(e,t,n){return Q({},e,t,n)};v.getFilterField=te;const ne=function(e,t){let n=[];if(e&&e[t]){n=e[t].map(function(e){return e.value})}return n};v.getFilterRestrictions=ne;const ie=function(e){const t={};if(e&&e.FilterExpressionRestrictions){e.FilterExpressionRestrictions.forEach(function(e){var n;if((n=e.Property)!==null&&n!==void 0&&n.value&&e.AllowedExpressions){var i;if(t[(i=e.Property)===null||i===void 0?void 0:i.value]){var o;t[(o=e.Property)===null||o===void 0?void 0:o.value].push(e.AllowedExpressions.toString())}else{var a;t[(a=e.Property)===null||a===void 0?void 0:a.value]=[e.AllowedExpressions.toString()]}}})}return t};v.getFilterAllowedExpression=ie;const oe=function(){return{name:"$search",path:"$search",dataType:$,maxConditions:1}};const ae=function(){return{name:"$editState",path:"$editState",groupLabel:"",group:"",dataType:$,hiddenFilter:false}};const re=function(e){var t;const n=e.getEntitySet();return S(n)?(t=n.annotations.Capabilities)===null||t===void 0?void 0:t.SearchRestrictions:undefined};const le=function(e,t){var n,i,o;const a=(n=e.getEntitySet())===null||n===void 0?void 0:(i=n.annotations)===null||i===void 0?void 0:(o=i.Capabilities)===null||o===void 0?void 0:o.NavigationRestrictions;const r=a&&a.RestrictedProperties;return r&&r.find(function(e){return e&&e.NavigationProperty&&e.NavigationProperty.value===t})};v.getNavigationRestrictions=le;const se=function(e){return{key:e.key,annotationPath:e.annotationPath,conditionPath:e.conditionPath,name:e.conditionPath,label:e.label,hiddenFilter:e.availability==="Hidden",display:"Value",isParameter:e.isParameter,caseSensitive:e.caseSensitive,availability:e.availability,position:e.position,type:e.type,template:e.template,menu:e.menu,required:e.required}};const ce=function(e){const t=["SingleValue","MultiValue","SingleRange","MultiRange","SearchExpression","MultiRangeOrSearchExpression"];e.sort(function(e,n){return t.indexOf(e)-t.indexOf(n)});return e[0]};v.getSpecificAllowedExpression=ce;const ue=function(e,t){var n,i,o,a,r,l;const s=e===null||e===void 0?void 0:(n=e.Common)===null||n===void 0?void 0:n.Text,c=s&&(e&&(e===null||e===void 0?void 0:(i=e.Common)===null||i===void 0?void 0:(o=i.Text)===null||o===void 0?void 0:(a=o.annotations)===null||a===void 0?void 0:(r=a.UI)===null||r===void 0?void 0:r.TextArrangement)||t&&(t===null||t===void 0?void 0:(l=t.UI)===null||l===void 0?void 0:l.TextArrangement));if(c){if(c.valueOf()==="UI.TextArrangementType/TextOnly"){return"Description"}else if(c.valueOf()==="UI.TextArrangementType/TextLast"){return"ValueDescription"}return"DescriptionValue"}return s?"DescriptionValue":"Value"};v.displayMode=ue;const de=function(e,t,n){var i;let o=se(t);const a=t.annotationPath;if(!a){return o}const r=e.getConverterContextFor(a).getDataModelObjectPath().targetObject;const l=r===null||r===void 0?void 0:r.annotations;const s=e===null||e===void 0?void 0:(i=e.getDataModelObjectPath().targetObject)===null||i===void 0?void 0:i.annotations;const c=n.formatOptions;const u=n.constraints;o=Object.assign(o,{formatOptions:c,constraints:u,display:ue(l,s)});return o};v.fetchPropertyInfo=de;const ve=function(e){let t=true;switch(e.filterExpression){case"SearchExpression":case"SingleRange":case"SingleValue":t=false;break;default:break}if(e.type&&e.type.indexOf("Boolean")>0){t=false}return t};v.isMultiValue=ve;const pe=function(e){return(e.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithUrl"||e.$Type==="com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath")&&e.Value.path.includes("/")};const fe=function(e,t,n){var i;const o=(i=e.Value)===null||i===void 0?void 0:i.$target;if(o){const e=y(o)||m(o)||g(o)||h(o);const i=e?b(t.getDataModelObjectPath(),e).navigationProperties:undefined;if(i!==null&&i!==void 0&&i.length){const e=i[0].name;if(!n.includes(e)){n.push(e)}}}};const ge=function(e,t,n){var i,o,a;switch(t.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":switch((i=t.Target)===null||i===void 0?void 0:(o=i.$target)===null||o===void 0?void 0:o.$Type){case"com.sap.vocabularies.UI.v1.FieldGroupType":(a=t.Target.$target.Data)===null||a===void 0?void 0:a.forEach(t=>{ge(e,t,n)});break;default:break}break;case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":if(pe(t)){const i=b(n.getDataModelObjectPath(),t.Value.path).navigationProperties[0].name;if(!e.includes(i)){e.push(i)}}fe(t,n,e);break;default:break}return e};const he=function(e){var t,n,i;let o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";let l=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let s=arguments.length>4?arguments[4]:undefined;const c=W(o,e);const u=H(c);const d=e.getEntityType();const v=a&&((t=e.getEntityTypeAnnotation(a))===null||t===void 0?void 0:t.annotation)||((n=d.annotations)===null||n===void 0?void 0:(i=n.UI)===null||i===void 0?void 0:i.SelectionFields)||[];let f=[];if(o.length===0&&!!s){var g;(g=e.getEntityTypeAnnotation(s).annotation)===null||g===void 0?void 0:g.forEach(t=>{f=ge(f,t,e)})}if(r.isDraftRoot(e.getEntitySet())){f.push("DraftAdministrativeData/CreationDateTime","DraftAdministrativeData/CreatedByUser","DraftAdministrativeData/LastChangeDateTime","DraftAdministrativeData/LastChangedByUser")}const h={...J(d,"",d.entityProperties,l,e),...z(d,f,false,e),...z(d,e.getManifestWrapper().getFilterConfiguration().navigationProperties,l,e)};let y=[];const m=p(d,e);if(m){y=m.SelectOptions}const P=(v===null||v===void 0?void 0:v.reduce((t,n)=>{const i=n.value;if(!(i in u)){let n;if(a.startsWith("@com.sap.vocabularies.UI.v1.SelectionFields")){n=""}else{n=a.split("/@com.sap.vocabularies.UI.v1.SelectionFields")[0]}const o=n?n+"/"+i:i;const r=Q(h,o,e,d);if(r){r.group="";r.groupLabel="";t.push(r)}}return t},[]))||[];const b=Y(y,d,e,u,v);return{excludedFilterProperties:u,entityType:d,annotatedSelectionFields:v,filterFields:h,propertyInfoFields:P,defaultFilterFields:b}};const ye=function(e){const t=L(e,e===null||e===void 0?void 0:e.type);if((e===null||e===void 0?void 0:e.type)===V&&(t.constraints.nullable===undefined||t.constraints.nullable===true)){t.formatOptions.parseKeepsEmptyString=false}return t};v.fetchTypeConfig=ye;const me=function(e,t,n,i){let o=de(t,e,i[e.key]),a="";if(e.conditionPath){a=e.conditionPath.replace(/\+|\*/g,"")}if(o){o=Object.assign(o,{maxConditions:!o.isParameter&&ve(o)?-1:1,required:e.required??(o.isParameter||n.indexOf(a)>=0),caseSensitive:k(t),dataType:i[e.key].type})}return o};v.assignDataTypeToPropertyInfo=me;const Pe=function(e,t,n){var i;const o=[];const a={};if(n){e=e.concat(n)}e.forEach(function(e){if(e.annotationPath){const n=t.getConverterContextFor(e.annotationPath);const i=n.getDataModelObjectPath().targetObject;o.push(i===null||i===void 0?void 0:i.type);const r=ye(i);a[e.key]=r}else{o.push(V);a[e.key]={type:$}}});const l=t.getEntitySet();const s=S(l)?(i=l.annotations.Capabilities)===null||i===void 0?void 0:i.FilterRestrictions:undefined;const c={};c.RequiredProperties=ne(s,"RequiredProperties")||[];c.NonFilterableProperties=ne(s,"NonFilterableProperties")||[];c.FilterAllowedExpressions=ie(s);const u=t.getContextPath();const d=u.split("/");if(d.length>2){const e=d[d.length-1];d.splice(-1,1);const n=le(t,e);const i=n&&n.FilterRestrictions;c.RequiredProperties=c.RequiredProperties.concat(ne(i,"RequiredProperties")||[]);c.NonFilterableProperties=c.NonFilterableProperties.concat(ne(i,"NonFilterableProperties")||[]);c.FilterAllowedExpressions={...ie(i)||{},...c.FilterAllowedExpressions}}const v=c.RequiredProperties;const p=c.NonFilterableProperties;const f=[];e.forEach(function(e){const n=e.conditionPath.replace(/\+|\*/g,"");if(p.indexOf(n)===-1){const n=me(e,t,v,a);f.push(n)}});const g=t.getDataModelObjectPath();if(r.isObjectPathDraftSupported(g)){f.push(ae())}const h=re(t);const y=Boolean(h&&!h.Searchable);if(u&&y!==true){if(!h||h!==null&&h!==void 0&&h.Searchable){f.push(oe())}}return f};v.processSelectionFields=Pe;const be=function(e,t,n){return U(e,ee(t,n),{availability:R.overwrite,label:R.overwrite,type:R.overwrite,position:R.overwrite,slotName:R.overwrite,template:R.overwrite,settings:R.overwrite,visualFilter:R.overwrite,required:R.overwrite})};v.insertCustomManifestElements=be;const Fe=function(e){var t,n;let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";let a=arguments.length>3?arguments[3]:undefined;let r=arguments.length>4?arguments[4]:undefined;const l=he(e,i,o,a,r);const s=_(e);let c=l.propertyInfoFields;const u=l.entityType;c=s.concat(c);c=be(c,u,e);const d=Pe(c,e,l.defaultFilterFields);d.sort(function(e,t){if(e.groupLabel===undefined||e.groupLabel===null){return-1}if(t.groupLabel===undefined||t.groupLabel===null){return 1}return e.groupLabel.localeCompare(t.groupLabel)});let v=JSON.stringify(d);v=v.replace(/\{/g,"\\{");v=v.replace(/\}/g,"\\}");const p=v;let f=JSON.parse(JSON.stringify(l.propertyInfoFields));f=s.concat(f);const g=l.excludedFilterProperties;const h=u===null||u===void 0?void 0:(t=u.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.FilterFacets;let y={};const m=e.getAnnotationsByTerm("UI","com.sap.vocabularies.UI.v1.FieldGroup");if(h===undefined||h.length<0){for(const e in m){y={...y,...q(m[e])}}}else{y=h.reduce((e,t)=>{for(let d=0;d<(t===null||t===void 0?void 0:(n=t.Target)===null||n===void 0?void 0:(i=n.$target)===null||i===void 0?void 0:(o=i.Data)===null||o===void 0?void 0:o.length);d++){var n,i,o,a,r,l,s,c,u;e[t===null||t===void 0?void 0:(a=t.Target)===null||a===void 0?void 0:(r=a.$target)===null||r===void 0?void 0:(l=r.Data[d])===null||l===void 0?void 0:(s=l.Value)===null||s===void 0?void 0:s.path]={group:t===null||t===void 0?void 0:(c=t.ID)===null||c===void 0?void 0:c.toString(),groupLabel:t===null||t===void 0?void 0:(u=t.Label)===null||u===void 0?void 0:u.toString()}}return e},{})}const P=l.filterFields;let b=f.concat(Object.keys(P).filter(e=>!(e in g)).map(e=>Object.assign(P[e],y[e])));const F=e.getContextPath();if(B(i,F)){const e=i[0].aggregates;if(e){const t=Object.keys(e).map(t=>e[t].relativePath);b=b.filter(e=>t.indexOf(e.key)===-1)}}const T=be(b,u,e);const S=k(e);T.forEach(e=>{e.caseSensitive=S});return{selectionFields:T,sPropertyInfo:p}};v.getSelectionFields=Fe;const Te=function(e,t,n){const i=ne(t,"RequiredProperties");const o=re(e);const a=Boolean(o&&!o.Searchable);if(i.length>0||a||(n===null||n===void 0?void 0:n.FetchValues)===2){return true}return false};v.getExpandFilterFields=Te;return v},false);
|
|
431
436
|
/*!
|
|
432
437
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
433
438
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
434
439
|
*/
|
|
435
|
-
sap.ui.predefine("sap/fe/core/converters/controls/ListReport/VisualFilters", ["sap/fe/core/converters/helpers/Aggregation","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/FilterTemplating"],function(t,e,i,o,n,l){"use strict";var a={};var r=l.isPropertyFilterable;var v=l.getIsRequired;var d=n.checkFilterExpressionRestrictions;var s=o.isEntitySet;var u=i.not;var g=i.compileExpression;var c=e.IssueType;var f=e.IssueSeverity;var p=e.IssueCategory;var P=t.AggregationHelper;const y=function(t,e,i){var o,n,l,a;let r,v,d;let s;const u=i.getCustomAggregateDefinitions();let g=i.getTransAggregations();let c=[];if(e!==null&&e!==void 0&&(o=e.$target)!==null&&o!==void 0&&o.Measures){var f,p,P;c=u.filter(function(t){var i,o,n;return t.qualifier===(e===null||e===void 0?void 0:(i=e.$target)===null||i===void 0?void 0:(o=i.Measures)===null||o===void 0?void 0:(n=o[0])===null||n===void 0?void 0:n.value)});s=c.length>0?c[0].qualifier:e===null||e===void 0?void 0:(f=e.$target)===null||f===void 0?void 0:(p=f.Measures)===null||p===void 0?void 0:(P=p[0])===null||P===void 0?void 0:P.value}if(!c[0]&&e!==null&&e!==void 0&&(n=e.$target)!==null&&n!==void 0&&n.DynamicMeasures){var y,h;s=t.getConverterContextFor(t.getAbsoluteAnnotationPath((y=e.$target.DynamicMeasures)===null||y===void 0?void 0:(h=y[0])===null||h===void 0?void 0:h.value)).getDataModelObjectPath().targetObject.Name;g=i.getAggregatedProperties("AggregatedProperty")}else{g=i.getAggregatedProperties("AggregatedProperties")[0]}const m=e===null||e===void 0?void 0:(l=e.$target)===null||l===void 0?void 0:(a=l.Dimensions[0])===null||a===void 0?void 0:a.value;if(u.some(function(t){return t.qualifier===s})){r=s}else if(g&&g[0]){g.some(function(t){if(t.Name===s){r=t===null||t===void 0?void 0:t.AggregatableProperty.value}})}const A=i.getAggregatableProperties();const L=i.getGroupableProperties();if(A&&A.length){for(const t of A){var
|
|
440
|
+
sap.ui.predefine("sap/fe/core/converters/controls/ListReport/VisualFilters", ["sap/fe/core/converters/helpers/Aggregation","sap/fe/core/converters/helpers/IssueManager","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/FilterTemplating"],function(t,e,i,o,n,l){"use strict";var a={};var r=l.isPropertyFilterable;var v=l.getIsRequired;var d=n.checkFilterExpressionRestrictions;var s=o.isEntitySet;var u=i.not;var g=i.compileExpression;var c=e.IssueType;var f=e.IssueSeverity;var p=e.IssueCategory;var P=t.AggregationHelper;const y=function(t,e,i){var o,n,l,a;let r,v,d;let s;const u=i.getCustomAggregateDefinitions();let g=i.getTransAggregations();let c=[];if(e!==null&&e!==void 0&&(o=e.$target)!==null&&o!==void 0&&o.Measures){var f,p,P;c=u.filter(function(t){var i,o,n;return t.qualifier===(e===null||e===void 0?void 0:(i=e.$target)===null||i===void 0?void 0:(o=i.Measures)===null||o===void 0?void 0:(n=o[0])===null||n===void 0?void 0:n.value)});s=c.length>0?c[0].qualifier:e===null||e===void 0?void 0:(f=e.$target)===null||f===void 0?void 0:(p=f.Measures)===null||p===void 0?void 0:(P=p[0])===null||P===void 0?void 0:P.value}if(!c[0]&&e!==null&&e!==void 0&&(n=e.$target)!==null&&n!==void 0&&n.DynamicMeasures){var y,h;s=t.getConverterContextFor(t.getAbsoluteAnnotationPath((y=e.$target.DynamicMeasures)===null||y===void 0?void 0:(h=y[0])===null||h===void 0?void 0:h.value)).getDataModelObjectPath().targetObject.Name;g=i.getAggregatedProperties("AggregatedProperty")}else{g=i.getAggregatedProperties("AggregatedProperties")[0]}const m=e===null||e===void 0?void 0:(l=e.$target)===null||l===void 0?void 0:(a=l.Dimensions[0])===null||a===void 0?void 0:a.value;if(u.some(function(t){return t.qualifier===s})){r=s}else if(g&&g[0]){g.some(function(t){if(t.Name===s){r=t===null||t===void 0?void 0:t.AggregatableProperty.value}})}const A=i.getAggregatableProperties();const L=i.getGroupableProperties();if(A&&A.length){for(const t of A){var I;if((t===null||t===void 0?void 0:(I=t.Property)===null||I===void 0?void 0:I.value)===r){d=true}}}if(L&&L.length){for(const t of L){if((t===null||t===void 0?void 0:t.value)===m){v=true}}}return d&&v};function h(t,e,i,o){var n;let l;const a=o[i];if(a!==null&&a!==void 0&&(n=a.visualFilter)!==null&&n!==void 0&&n.valueList){var h,A,L,I,C,E;const o=a===null||a===void 0?void 0:(h=a.visualFilter)===null||h===void 0?void 0:h.valueList;const n=o.split("#");const ct=n.length>1?`ValueList#${n[1]}`:n[0];const ft=t.resolvePath(i);const pt=ft===null||ft===void 0?void 0:(A=ft.annotations)===null||A===void 0?void 0:(L=A.Common)===null||L===void 0?void 0:L[ct];const Pt=(ft===null||ft===void 0?void 0:(I=ft.annotations)===null||I===void 0?void 0:(C=I.Common)===null||C===void 0?void 0:(E=C.ValueListWithFixedValues)===null||E===void 0?void 0:E.valueOf())||false;if(pt){var S,D;const t=pt===null||pt===void 0?void 0:pt.CollectionPath.toString();const o=e.getConverterContextFor(`/${t||((S=e.getEntitySet())===null||S===void 0?void 0:S.name)}`);const n=pt===null||pt===void 0?void 0:pt.Parameters;let a;const h=[];let A=[];const L=o.getParameterEntityType();A=L?L.keys.map(function(t){return t.name}):[];if(e.getContextPath()===o.getContextPath()){m(h,A,true)}if(n){for(const t of n){var V;const e=(V=t.LocalDataProperty)===null||V===void 0?void 0:V.value;const n=t.ValueListProperty;if(((t===null||t===void 0?void 0:t.$Type)==="com.sap.vocabularies.Common.v1.ValueListParameterInOut"||(t===null||t===void 0?void 0:t.$Type)==="com.sap.vocabularies.Common.v1.ValueListParameterOut")&&i===e){a=t}if(((t===null||t===void 0?void 0:t.$Type)==="com.sap.vocabularies.Common.v1.ValueListParameterInOut"||(t===null||t===void 0?void 0:t.$Type)==="com.sap.vocabularies.Common.v1.ValueListParameterIn")&&i!==e){const t=r(o,n);if(!t){h.push({localDataProperty:e,valueListProperty:n})}}}}if(h&&h.length){h.forEach(function(t){const n=g(d(e.getConverterContextFor(e.getAbsoluteAnnotationPath(t===null||t===void 0?void 0:t.localDataProperty)).getDataModelObjectPath(),["SingleValue"]));const l=g(d(o.getConverterContextFor(o.getAbsoluteAnnotationPath(t===null||t===void 0?void 0:t.valueListProperty)).getDataModelObjectPath(),["SingleValue"]));if(l==="true"&&n==="false"){throw new Error(`FilterRestrictions of ${i} in MainEntitySet and ValueListEntitySet are different`)}})}const I=pt===null||pt===void 0?void 0:pt.PresentationVariantQualifier;const C=pt===null||pt===void 0?void 0:pt.SelectionVariantQualifier;const E=o===null||o===void 0?void 0:(D=o.getEntityType().annotations.UI)===null||D===void 0?void 0:D[`PresentationVariant#${I}`];const ct=new P(o.getEntityType(),o);if(!ct.isAnalyticsSupported()){return undefined}if(E){var T;const n=E===null||E===void 0?void 0:E.Visualizations;const r=`/${pt===null||pt===void 0?void 0:pt.CollectionPath}`||`/${o===null||o===void 0?void 0:(T=o.getEntitySet())===null||T===void 0?void 0:T.name}`;l={};l.contextPath=r;l.isValueListWithFixedValues=Pt;let P;for(const t of n){var $;if((($=t.$target)===null||$===void 0?void 0:$.term)==="com.sap.vocabularies.UI.v1.Chart"){P=t;break}}if(P){var F,O,M,R,b,x,N,U,H,q,w,j,_,Q;const r=y(o,P,ct);if(!r){return}const I=(F=P)===null||F===void 0?void 0:(O=F.$target)===null||O===void 0?void 0:(M=O.Dimensions[0])===null||M===void 0?void 0:(R=M.$target)===null||R===void 0?void 0:(b=R.annotations)===null||b===void 0?void 0:(x=b.UI)===null||x===void 0?void 0:(N=x.Hidden)===null||N===void 0?void 0:N.valueOf();const S=(U=P)===null||U===void 0?void 0:(H=U.$target)===null||H===void 0?void 0:(q=H.Dimensions[0])===null||q===void 0?void 0:(w=q.$target)===null||w===void 0?void 0:(j=w.annotations)===null||j===void 0?void 0:(_=j.UI)===null||_===void 0?void 0:(Q=_.HiddenFilter)===null||Q===void 0?void 0:Q.valueOf();if(I===true||S===true){return}else if(n&&n.length){var k,G,W,z,B,J,K,X,Y,Z;l.chartAnnotation=P?o===null||o===void 0?void 0:o.getAbsoluteAnnotationPath(`${P.$target.fullyQualifiedName}/$AnnotationPath/`):undefined;const n=(k=o.getEntitySet())===null||k===void 0?void 0:k.name;let r;const y=o===null||o===void 0?void 0:o.getRelativeAnnotationPath(`${E.fullyQualifiedName}/`,o.getEntityType());if(L){r=o.getContextPath()+"/"+y}else{r="/"+n+"/"+y}l.presentationAnnotation=E?r:undefined;l.outParameter=(G=a)===null||G===void 0?void 0:(W=G.LocalDataProperty)===null||W===void 0?void 0:W.value;l.inParameters=h;l.valuelistProperty=(z=a)===null||z===void 0?void 0:z.ValueListProperty;const I=d(e.getConverterContextFor(e.getAbsoluteAnnotationPath(i)).getDataModelObjectPath(),["SingleRange","MultiRange"]);if(g(I)==="true"){e.getDiagnostics().addIssue(p.Annotation,f.High,c.MALFORMED_VISUALFILTERS.VALUELIST);return undefined}const S=d(e.getConverterContextFor(e.getAbsoluteAnnotationPath(i)).getDataModelObjectPath(),["SingleValue"]);l.multipleSelectionAllowed=g(u(S));l.required=v(e,i);let D;if(C){var tt,et;D=o===null||o===void 0?void 0:(tt=o.getEntityTypeAnnotation(`@UI.SelectionVariant#${C}`))===null||tt===void 0?void 0:tt.annotation;let t;const e=o===null||o===void 0?void 0:o.getRelativeAnnotationPath(`${(et=D)===null||et===void 0?void 0:et.fullyQualifiedName}/`,o.getEntityType());if(L){t=o.getContextPath()+"/"+e}else{t="/"+n+"/"+e}l.selectionVariantAnnotation=D?t:undefined}let V=[];if(L){var it,ot,nt,lt,at;const i=t.split("/")[0];const o=t.split("/")[1];const n=e.getConverterContextFor(`/${i}`);const l=n===null||n===void 0?void 0:(it=n.getDataModelObjectPath().startingEntitySet)===null||it===void 0?void 0:(ot=it.annotations)===null||ot===void 0?void 0:(nt=ot.Capabilities)===null||nt===void 0?void 0:(lt=nt.NavigationRestrictions)===null||lt===void 0?void 0:lt.RestrictedProperties;const a=l===null||l===void 0?void 0:l.find(t=>{var e;if(((e=t.NavigationProperty)===null||e===void 0?void 0:e.type)==="NavigationPropertyPath"){return t.NavigationProperty.value===o}});V=(a===null||a===void 0?void 0:(at=a.FilterRestrictions)===null||at===void 0?void 0:at.RequiredProperties)??[]}else{const t=o===null||o===void 0?void 0:o.getEntitySet();if(s(t)){var rt,vt;V=((rt=t.annotations.Capabilities)===null||rt===void 0?void 0:(vt=rt.FilterRestrictions)===null||vt===void 0?void 0:vt.RequiredProperties)??[]}}let T=[];if((B=V)!==null&&B!==void 0&&B.length){V.forEach(function(t){T.push(t.value)})}T=T.concat(A);l.requiredProperties=T;if(e.getContextPath()===o.getContextPath()){m(h,V,false)}if((J=l.requiredProperties)!==null&&J!==void 0&&J.length){if(!l.inParameters||!l.inParameters.length){if(!l.selectionVariantAnnotation){l.showOverlayInitially=true}else{var dt,st,ut,gt;let t=((dt=D)===null||dt===void 0?void 0:(st=dt.SelectOptions)===null||st===void 0?void 0:st.map(t=>{var e;return(e=t.PropertyName)===null||e===void 0?void 0:e.value}))||[];const e=((ut=D)===null||ut===void 0?void 0:(gt=ut.Parameters)===null||gt===void 0?void 0:gt.map(t=>{var e;return(e=t.PropertyName)===null||e===void 0?void 0:e.value}))||[];t=t.concat(e);T=T.sort();t=t.sort();l.showOverlayInitially=T.some(function(e){return t.indexOf(e)===-1})}}else{l.showOverlayInitially=false}}else{l.showOverlayInitially=false}const $=(K=P)===null||K===void 0?void 0:(X=K.$target)===null||X===void 0?void 0:(Y=X.Dimensions[0])===null||Y===void 0?void 0:(Z=Y.$target)===null||Z===void 0?void 0:Z.type;if(!($==="Edm.DateTimeOffset"||$==="Edm.Date"||$==="Edm.TimeOfDay")&&P.$target.ChartType==="UI.ChartType/Line"){l.renderLineChart=false}else{l.renderLineChart=true}}}else{e.getDiagnostics().addIssue(p.Annotation,f.High,c.MALFORMED_VISUALFILTERS.CHART);return}}else{e.getDiagnostics().addIssue(p.Annotation,f.High,c.MALFORMED_VISUALFILTERS.PRESENTATIONVARIANT)}}else{e.getDiagnostics().addIssue(p.Annotation,f.High,c.MALFORMED_VISUALFILTERS.VALUELIST)}}else{e.getDiagnostics().addIssue(p.Manifest,f.High,c.MALFORMED_VISUALFILTERS.VALUELIST)}return l}a.getVisualFilters=h;function m(t,e,i){e.forEach(function(e){const o=i?e:e.value;t.push({localDataProperty:o,valueListProperty:o})})}a._addInParameters=m;return a},false);
|
|
436
441
|
/*!
|
|
437
442
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
438
443
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -452,7 +457,7 @@ sap.ui.predefine("sap/fe/core/converters/controls/ObjectPage/SubSection", ["sap/
|
|
|
452
457
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
453
458
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
454
459
|
*/
|
|
455
|
-
sap.ui.predefine("sap/fe/core/converters/helpers/Aggregation", ["sap/fe/core/helpers/TypeGuards"],function(t){"use strict";var e={};var n=t.isNavigationProperty;var o=t.isEntityType;var
|
|
460
|
+
sap.ui.predefine("sap/fe/core/converters/helpers/Aggregation", ["sap/fe/core/helpers/TypeGuards"],function(t){"use strict";var e={};var n=t.isNavigationProperty;var o=t.isEntityType;var i=t.isEntitySet;let r=function(){function t(t,e){var r;let g=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this._entityType=t;this._converterContext=e;this._oAggregationAnnotationTarget=this._determineAggregationAnnotationTarget();if(n(this._oAggregationAnnotationTarget)||o(this._oAggregationAnnotationTarget)||i(this._oAggregationAnnotationTarget)){this.oTargetAggregationAnnotations=this._oAggregationAnnotationTarget.annotations.Aggregation}this._bApplySupported=(r=this.oTargetAggregationAnnotations)!==null&&r!==void 0&&r.ApplySupported?true:false;if(this._bApplySupported){var a,s,l,u;this._aGroupableProperties=(a=this.oTargetAggregationAnnotations)===null||a===void 0?void 0:(s=a.ApplySupported)===null||s===void 0?void 0:s.GroupableProperties;this._aAggregatableProperties=(l=this.oTargetAggregationAnnotations)===null||l===void 0?void 0:(u=l.ApplySupported)===null||u===void 0?void 0:u.AggregatableProperties;this.oContainerAggregationAnnotation=e.getEntityContainer().annotations.Aggregation}if(!this._aAggregatableProperties&&g){const t=this._getEntityProperties();this._aAggregatableProperties=t===null||t===void 0?void 0:t.filter(t=>{var e,n;return(e=t.annotations)===null||e===void 0?void 0:(n=e.Aggregation)===null||n===void 0?void 0:n.Aggregatable})}}e.AggregationHelper=t;var r=t.prototype;r._determineAggregationAnnotationTarget=function t(){var e,n,o,r,g;const a=(e=this._converterContext.getDataModelObjectPath())!==null&&e!==void 0&&(n=e.targetEntitySet)!==null&&n!==void 0&&(o=n.entityType)!==null&&o!==void 0&&(r=o.annotations)!==null&&r!==void 0&&(g=r.Common)!==null&&g!==void 0&&g.ResultContext?true:false;let s;if(a){var l,u,p,A;const t=this._converterContext.getDataModelObjectPath();const e=t===null||t===void 0?void 0:t.targetObject;const n=t===null||t===void 0?void 0:t.targetEntityType;if(e!==null&&e!==void 0&&(l=e.annotations)!==null&&l!==void 0&&(u=l.Aggregation)!==null&&u!==void 0&&u.ApplySupported){s=e}else if(n!==null&&n!==void 0&&(p=n.annotations)!==null&&p!==void 0&&(A=p.Aggregation)!==null&&A!==void 0&&A.ApplySupported){s=n}}else{var d;const t=this._converterContext.getEntitySet();if(i(t)&&(d=t.annotations.Aggregation)!==null&&d!==void 0&&d.ApplySupported){s=t}else{s=this._converterContext.getEntityType()}}return s};r.isAnalyticsSupported=function t(){return this._bApplySupported};r.isPropertyGroupable=function t(e){if(!this._bApplySupported){return undefined}else if(!this._aGroupableProperties||this._aGroupableProperties.length===0){return true}else{return this._aGroupableProperties.findIndex(t=>t.$target.fullyQualifiedName===e.fullyQualifiedName)>=0}};r.isPropertyAggregatable=function t(e){if(!this._bApplySupported){return undefined}else{const t=this._converterContext.getAnnotationsByTerm("Aggregation","Org.OData.Aggregation.V1.CustomAggregate",[this._oAggregationAnnotationTarget]);return t.some(t=>e.name===t.qualifier)}};r.getGroupableProperties=function t(){return this._aGroupableProperties};r.getAggregatableProperties=function t(){return this._aAggregatableProperties};r.getEntityType=function t(){return this._entityType};r.getAggregatedProperties=function t(e){if(e==="AggregatedProperties"){return this._converterContext.getAnnotationsByTerm("Analytics","com.sap.vocabularies.Analytics.v1.AggregatedProperties",[this._converterContext.getEntityContainer(),this._converterContext.getEntityType()])}return this._converterContext.getAnnotationsByTerm("Analytics","com.sap.vocabularies.Analytics.v1.AggregatedProperty",[this._converterContext.getEntityContainer(),this._converterContext.getEntityType()])};r.getTransAggregations=function t(){var e;let n=this.getAggregatedProperties("AggregatedProperty");if(!n||n.length===0){n=this.getAggregatedProperties("AggregatedProperties")[0]}return(e=n)===null||e===void 0?void 0:e.filter(t=>{if(this._getAggregatableAggregates(t.AggregatableProperty)){return t}})};r._getAggregatableAggregates=function t(e){const n=this.getAggregatableProperties()||[];return n.find(function(t){var n;const o=e.qualifier?e.qualifier:e.$target.name;if(t!==null&&t!==void 0&&(n=t.Property)!==null&&n!==void 0&&n.value){return t.Property.value===o}return(t===null||t===void 0?void 0:t.name)===o})};r._getEntityProperties=function t(){let e;if(i(this._oAggregationAnnotationTarget)){var n,r;e=(n=this._oAggregationAnnotationTarget)===null||n===void 0?void 0:(r=n.entityType)===null||r===void 0?void 0:r.entityProperties}else if(o(this._oAggregationAnnotationTarget)){var g;e=(g=this._oAggregationAnnotationTarget)===null||g===void 0?void 0:g.entityProperties}return e};r.getCustomAggregateDefinitions=function t(){const e=this._converterContext.getAnnotationsByTerm("Aggregation","Org.OData.Aggregation.V1.CustomAggregate",[this._oAggregationAnnotationTarget]);return e};r.getAllowedTransformations=function t(){var e,n,o,i;return((e=this.oTargetAggregationAnnotations)===null||e===void 0?void 0:(n=e.ApplySupported)===null||n===void 0?void 0:n.Transformations)||((o=this.oContainerAggregationAnnotation)===null||o===void 0?void 0:(i=o.ApplySupportedDefaults)===null||i===void 0?void 0:i.Transformations)};return t}();e.AggregationHelper=r;return e},false);
|
|
456
461
|
/*!
|
|
457
462
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
458
463
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -473,6 +478,11 @@ sap.ui.predefine("sap/fe/core/converters/helpers/DataFieldHelper", ["sap/base/Lo
|
|
|
473
478
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
474
479
|
*/
|
|
475
480
|
sap.ui.predefine("sap/fe/core/converters/helpers/ID", ["../../helpers/StableIdHelper"],function(t){"use strict";var e={};var n=t.generate;const o=["fe"];function r(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return n(o.concat(...e,...r))}}e.createIDGenerator=r;const a=r("HeaderFacet");e.getHeaderFacetID=a;const c=r("HeaderFacetContainer");e.getHeaderFacetContainerID=c;const i=r("HeaderFacet","Form");e.getHeaderFacetFormID=i;const s=r("HeaderFacetCustomContainer");e.getCustomHeaderFacetID=s;const u=r("EditableHeaderSection");e.getEditableHeaderSectionID=u;const g=r("FacetSection");e.getSectionID=g;const I=r("CustomSection");e.getCustomSectionID=I;const D=r("FacetSubSection");e.getSubSectionID=D;const d=r("CustomSubSection");e.getCustomSubSectionID=d;const C=r("SideContent");e.getSideContentID=C;const m=function(t){return n(["fe",t,"SideContentLayout"])};e.getSideContentLayoutID=m;const F=r("Form");e.getFormID=F;const S=r("FormContainer");e.getFormContainerID=S;const f=function(t,e){return n(["fe","FormContainer",t,"StandardAction",e])};e.getFormStandardActionButtonID=f;const l=r("table");e.getTableID=l;const b=r("CustomTab");e.getCustomTabID=b;const H=r("FilterBar");e.getFilterBarID=H;const p=function(){return"fe::ListReport"};e.getDynamicListReportID=p;const A=r("TabMultipleMode");e.getIconTabBarID=A;const h=function(t){return n([t,"VariantManagement"])};e.getFilterVariantManagementID=h;const y=r("Chart");e.getChartID=y;const T=function(t){return n(["CustomAction",t])};e.getCustomActionID=T;const v=r("KPI");e.getKPIID=v;return e},false);
|
|
481
|
+
/*!
|
|
482
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
483
|
+
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
484
|
+
*/
|
|
485
|
+
sap.ui.predefine("sap/fe/core/converters/helpers/InsightsHelpers", ["../ManifestSettings"],function(t){"use strict";var e={};var i=t.TemplateType;function n(t,e,n,a){var s;let l,o;const r=e.getManifestWrapper().hasMultipleEntitySets();const u=e.getManifestWrapper().hasMultipleVisualizations();const d=e.getManifestWrapper().getViewConfiguration();const f=d!==undefined&&d.paths.length>1?true:false;const p=e.getTemplateType()===i.ListReport;const g=e.getManifestControlConfiguration(n);const v=t==="Analytical"?(g===null||g===void 0?void 0:g.enableAddCardToInsights)??true:(g===null||g===void 0?void 0:(s=g.tableSettings)===null||s===void 0?void 0:s.enableAddCardToInsights)??true;if(t==="Table"){var c;l=a===null||a===void 0?void 0:a.tableManifestConfiguration;o=((c=l)===null||c===void 0?void 0:c.type)==="ResponsiveTable"}return v&&p&&!r&&!f&&(t==="Table"?(o??false)&&!u:true)}e.getInsightsVisibility=n;return e},false);
|
|
476
486
|
/*!
|
|
477
487
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
478
488
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -502,17 +512,17 @@ sap.ui.predefine("sap/fe/core/converters/objectPage/HeaderAndFooterAction", ["sa
|
|
|
502
512
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
503
513
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
504
514
|
*/
|
|
505
|
-
sap.ui.predefine("sap/fe/core/converters/templates/ListReportConverter", ["sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/controls/ListReport/FilterBar","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/helpers/BindingToolkit","../controls/Common/DataVisualization","../controls/Common/KPI","../helpers/ID","../ManifestSettings"],function(t,e,n,i,a,o,r,s){"use strict";var l={};var c=s.VisualizationType;var u=s.VariantManagementType;var f=s.TemplateType;var d=r.getTableID;var p=r.getIconTabBarID;var v=r.getFilterVariantManagementID;var h=r.getFilterBarID;var y=r.getDynamicListReportID;var g=r.getCustomTabID;var m=r.getChartID;var C=o.getKPIDefinitions;var b=a.isSelectionPresentationCompliant;var P=a.isPresentationCompliant;var T=a.getSelectionVariant;var I=a.getSelectionPresentationVariant;var V=a.getDefaultPresentationVariant;var w=a.getDefaultLineItem;var E=a.getDefaultChart;var z=a.getDataVisualizationConfiguration;var S=i.getExpressionFromAnnotation;var M=i.compileExpression;var k=n.insertCustomElements;var A=e.getSelectionFields;var D=e.getManifestFilterFields;var F=e.getFilterBarHideBasicSearch;var L=t.getActionsFromManifest;function B(t){const e=[];t.forEach(function(t){if(!t.type){const n=t.secondaryVisualization?t.secondaryVisualization.visualizations:t.presentation.visualizations;n.forEach(function(t){if(t.type===c.Table){e.push(t)}})}});return e}function x(t){const e=[];t.forEach(function(t){if(!t.type){const n=t.primaryVisualization?t.primaryVisualization.visualizations:t.presentation.visualizations;n.forEach(function(t){if(t.type===c.Chart){e.push(t)}})}});return e}const R=function(t){const e={};for(const s in t){var n,i,a;if((n=t[s])!==null&&n!==void 0&&(i=n.settings)!==null&&i!==void 0&&(a=i.defaultValues)!==null&&a!==void 0&&a.length){var o,r;e[s]=(o=t[s])===null||o===void 0?void 0:(r=o.settings)===null||r===void 0?void 0:r.defaultValues}}return e};function W(t,e,n){const i=e.getManifestWrapper().getDefaultTemplateAnnotationPath();const a=I(t,i,e);const o="ALP flavor needs both chart and table to load the application";if(a){if(i){const t=a.PresentationVariant;if(!t){throw new Error("Presentation Variant is not configured in the SPV mentioned in the manifest")}if(!P(t,n)){if(n){throw new Error(o)}return undefined}}if(b(a,n)===true){return a}else if(n){throw new Error(o)}}const r=V(t);if(r){if(P(r,n)){return r}else if(n){throw new Error(o)}}if(!n){return w(t)}return undefined}const H=function(t){let e=t;if(e.converterContext){var n,i;let t=e.converterContext;e=e;const a=function(t){return t.key!==undefined};let o=z(e.annotation?t.getRelativeAnnotationPath(e.annotation.fullyQualifiedName,t.getEntityType()):"",true,t,e,undefined,undefined,a(e));let r="";let s="";let l="";let u="";const p=function(t,e){let n;for(const i of t.visualizations){if(e&&i.type===c.Chart){n=i;break}if(!e&&i.type===c.Table){n=i;break}}const i=Object.assign({},t);if(n){i.visualizations=[n]}else{throw new Error((e?"Primary":"Secondary")+" visualisation needs valid "+(e?"chart":"table"))}return i};const v=function(n,i){const a=t.getEntityTypeAnnotation(n.annotationPath);const r=a.annotation;t=a.converterContext;const s=r;if(s||t.getTemplateType()===f.AnalyticalListPage){o=z(s?t.getRelativeAnnotationPath(s.fullyQualifiedName,t.getEntityType()):"",true,t,e);return o}else{const t="Annotation Path for the "+(i?"primary":"secondary")+" visualisation mentioned in the manifest is not found";throw new Error(t)}};const h=function(t,n){var i,a,o;const l=p(t[0],true);s=l===null||l===void 0?void 0:(i=l.visualizations[0])===null||i===void 0?void 0:i.id;const c=p(t[1]?t[1]:t[0],false);r=c===null||c===void 0?void 0:(a=c.visualizations[0])===null||a===void 0?void 0:(o=a.annotation)===null||o===void 0?void 0:o.id;if(l&&c){e=e;const t=e.visible;const i={primaryVisualization:l,secondaryVisualization:c,tableControlId:r,chartControlId:s,defaultPath:n,visible:t};return i}};if(!t.getManifestWrapper().hasMultipleVisualizations(e)&&((n=o)===null||n===void 0?void 0:(i=n.visualizations)===null||i===void 0?void 0:i.length)===2&&t.getTemplateType()===f.AnalyticalListPage){const t=h([o],"both");if(t){return t}}else if(t.getManifestWrapper().hasMultipleVisualizations(e)||t.getTemplateType()===f.AnalyticalListPage){const{primary:t,secondary:n}=e;if(t&&t.length&&n&&n.length){const i=h([v(t[0],true),v(n[0],false)],e.defaultPath);if(i){return i}}else{throw new Error("SecondaryItems in the Views is not present")}}else if(a(e)){const n=t.getEntityTypeAnnotation(e.annotationPath);const i=n.annotation;t=n.converterContext;l=M(S(i.Text));o.visualizations.forEach((t,n)=>{var i;switch(t.type){case c.Table:const t=o.visualizations[n];const r=t.control.filters||{};r.hiddenFilters=r.hiddenFilters||{paths:[]};if(!e.keepPreviousPersonalization){t.annotation.id=d(e.key||"","LineItem")}e=e;if(((i=e.annotation)===null||i===void 0?void 0:i.term)==="com.sap.vocabularies.UI.v1.SelectionPresentationVariant"){var a;if(!e.annotation.SelectionVariant){throw new Error(`The Selection Variant is missing for the Selection Presentation Variant ${e.annotation.fullyQualifiedName}`)}u=`@${(a=e.annotation.SelectionVariant)===null||a===void 0?void 0:a.fullyQualifiedName.split("@")[1]}`}else{u=e.annotationPath}r.hiddenFilters.paths.push({annotationPath:u});t.control.filters=r;break;case c.Chart:const s=o.visualizations[n];s.id=m(e.key||"","Chart");s.multiViews=true;break;default:break}})}o.visualizations.forEach(t=>{if(t.type===c.Table){r=t.annotation.id}else if(t.type===c.Chart){s=t.id}});e=e;const y=e.visible;return{presentation:o,tableControlId:r,chartControlId:s,title:l,selectionVariantPath:u,visible:y}}else{e=e;const t=e.label,n=e.template,i=e.type,a=g(e.key||""),o=e.visible;return{title:t,fragment:n,type:i,customTabId:a,visible:o}}};const j=function(t,e){let n=[];if(e){e.paths.forEach(i=>{if(t.getManifestWrapper().hasMultipleVisualizations(i)){if(e.paths.length>1){throw new Error("ALP flavor cannot have multiple views")}else{i=i;n.push({converterContext:t,primary:i.primary,secondary:i.secondary,defaultPath:i.defaultPath})}}else if(i.template){i=i;n.push({key:i.key,label:i.label,template:i.template,type:"Custom",visible:i.visible})}else{i=i;const e=t.getConverterContextFor(i.contextPath||i.entitySet&&`/${i.entitySet}`||t.getContextPath()),a=e.getEntityType();if(a&&e){let t;const o=e.getEntityTypeAnnotation(i.annotationPath);const r=o.annotation;if(r){t=r.term==="com.sap.vocabularies.UI.v1.SelectionVariant"?W(a,e,false):r;n.push({converterContext:e,annotation:t,annotationPath:i.annotationPath,keepPreviousPersonalization:i.keepPreviousPersonalization,key:i.key,visible:i.visible})}}else{}}})}else{const e=t.getEntityType();if(t.getTemplateType()===f.AnalyticalListPage){n=Q(t,n)}else{n.push({annotation:W(e,t,false),converterContext:t})}}return n.map(t=>H(t))};const N=function(t,e){const n=t.getManifestWrapper();const i=n.getViewConfiguration();if(e.length>1&&!$(t)){return{showTabCounts:i?(i===null||i===void 0?void 0:i.showCounts)||n.hasMultipleEntitySets():undefined,id:p()}}return undefined};function Q(t,e){const n=t.getEntityType();const i=W(n,t,true);let a,o;if(i){e.push({annotation:i,converterContext:t})}else{a=E(n);o=w(n);if(a&&o){const n=[{annotationPath:"@"+a.term}];const i=[{annotationPath:"@"+o.term}];e.push({converterContext:t,primary:n,secondary:i,defaultPath:"both"})}else{throw new Error("ALP flavor needs both chart and table to load the application")}}return e}function $(t){return t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===f.AnalyticalListPage}const K=function(t){const e=t.getManifestWrapper();return k([],L(e.getHeaderActions(),t).actions)};l.getHeaderActions=K;const O=function(t,e){t.forEach(t=>{if(!t.type){const n=t.presentation;n.visualizations.forEach(t=>{if(t.type===c.Chart&&t.filterId!==e){t.filterId=e}})}})};l.checkChartFilterBarId=O;const U=function(t){const e=t.getEntityType();const n=t.getContextPath();if(!n){throw new Error("An EntitySet is required to be able to display a ListReport, please adjust your `entitySet` property to point to one.")}const i=t.getManifestWrapper();const a=i.getViewConfiguration();const o=i.hasMultipleEntitySets();const r=j(t,a);const s=B(r);const l=x(r);const c=s.some(t=>t.control.type==="ResponsiveTable");let f="";let d="";const p=y();const g=h(n);const m=v(g);const b=i.getFilterConfiguration();const P=(b===null||b===void 0?void 0:b.initialLayout)!==undefined?b===null||b===void 0?void 0:b.initialLayout.toLowerCase():"compact";const I=(b===null||b===void 0?void 0:b.layout)!==undefined?b===null||b===void 0?void 0:b.layout.toLowerCase():"compact";const V=b.useSemanticDateRange!==undefined?b.useSemanticDateRange:true;const w=b.showClearButton!==undefined?b.showClearButton:false;const E=q(t,r);if(E){d=E.chartId;f=E.tableId}const z=i.useHiddenFilterBar();const S=(i.isFilterBarHidden()||z)&&d==="";const M=A(t,s);const k=M.selectionFields;const L=M.sPropertyInfo;const W=F(s,l,t);const H=N(t,r);const Q=H?undefined:T(e,t);const U=V?R(D(e,t)):{};const G=K(t);if(o){O(r,g)}const J=s.map(t=>t.annotation.id).concat(l.map(t=>t.id));const X=[...S&&!z?[]:[g],...i.getVariantManagement()!==u.Control?J:[],...H?[H.id]:[]];const Y=H&&i.getStickyMultiTabHeaderConfiguration()?H.id:undefined;return{mainEntitySet:n,mainEntityType:`${n}/`,multiViewsControl:H,stickySubheaderProvider:Y,singleTableId:f,singleChartId:d,dynamicListReportId:p,headerActions:G,showPinnableToggle:c,filterBar:{propertyInfo:L,selectionFields:k,hideBasicSearch:W,showClearButton:w},views:r,filterBarId:S&&!z?"":g,filterConditions:{selectionVariant:Q,defaultSemanticDates:U},variantManagement:{id:m,targetControlIds:X.join(",")},hasMultiVisualizations:$(t),templateType:i.getTemplateType(),useSemanticDateRange:V,filterInitialLayout:P,filterLayout:I,kpiDefinitions:C(t),hideFilterBar:S,useHiddenFilterBar:z}};l.convertPage=U;function q(t,e){let n="",i="";if(t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===f.AnalyticalListPage){for(let t of e){t=t;if(t.chartControlId&&t.tableControlId){i=t.chartControlId;n=t.tableControlId;break}}}else{for(let t of e){t=t;if(!n&&t.tableControlId){n=t.tableControlId||""}if(!i&&t.chartControlId){i=t.chartControlId||""}if(i&&n){break}}}if(n||i){return{chartId:i,tableId:n}}return undefined}return l},false);
|
|
515
|
+
sap.ui.predefine("sap/fe/core/converters/templates/ListReportConverter", ["sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/controls/ListReport/FilterBar","sap/fe/core/converters/helpers/ConfigurableObject","sap/fe/core/helpers/BindingToolkit","../controls/Common/DataVisualization","../controls/Common/KPI","../helpers/ID","../ManifestSettings"],function(t,e,n,i,a,o,r,s){"use strict";var l={};var c=s.VisualizationType;var u=s.VariantManagementType;var f=s.TemplateType;var d=r.getTableID;var p=r.getIconTabBarID;var v=r.getFilterVariantManagementID;var h=r.getFilterBarID;var y=r.getDynamicListReportID;var g=r.getCustomTabID;var m=r.getChartID;var C=o.getKPIDefinitions;var b=a.isSelectionPresentationCompliant;var P=a.isPresentationCompliant;var T=a.getSelectionVariant;var I=a.getSelectionPresentationVariant;var V=a.getDefaultPresentationVariant;var w=a.getDefaultLineItem;var E=a.getDefaultChart;var z=a.getDataVisualizationConfiguration;var S=i.getExpressionFromAnnotation;var M=i.compileExpression;var k=n.insertCustomElements;var A=e.getSelectionFields;var D=e.getManifestFilterFields;var F=e.getFilterBarHideBasicSearch;var L=t.getActionsFromManifest;function B(t){const e=[];t.forEach(function(t){if(!t.type){const n=t.secondaryVisualization?t.secondaryVisualization.visualizations:t.presentation.visualizations;n.forEach(function(t){if(t.type===c.Table){e.push(t)}})}});return e}function x(t){const e=[];t.forEach(function(t){if(!t.type){const n=t.primaryVisualization?t.primaryVisualization.visualizations:t.presentation.visualizations;n.forEach(function(t){if(t.type===c.Chart){e.push(t)}})}});return e}const R=function(t){const e={};for(const s in t){var n,i,a;if((n=t[s])!==null&&n!==void 0&&(i=n.settings)!==null&&i!==void 0&&(a=i.defaultValues)!==null&&a!==void 0&&a.length){var o,r;e[s]=(o=t[s])===null||o===void 0?void 0:(r=o.settings)===null||r===void 0?void 0:r.defaultValues}}return e};function W(t,e,n){const i=e.getManifestWrapper().getDefaultTemplateAnnotationPath();const a=I(t,i,e);const o="ALP flavor needs both chart and table to load the application";if(a){if(i){const t=a.PresentationVariant;if(!t){throw new Error("Presentation Variant is not configured in the SPV mentioned in the manifest")}if(!P(t,n)){if(n){throw new Error(o)}return undefined}}if(b(a,n)===true){return a}else if(n){throw new Error(o)}}const r=V(t);if(r){if(P(r,n)){return r}else if(n){throw new Error(o)}}if(!n){return w(t)}return undefined}const H=function(t,e){let n=t;if(n.converterContext){var i,a;let t=n.converterContext;n=n;const o=function(t){return t.key!==undefined};let r=z(n.annotation?t.getRelativeAnnotationPath(n.annotation.fullyQualifiedName,t.getEntityType()):"",true,t,n,undefined,undefined,o(n),e);let s="";let l="";let u="";let p="";const v=function(t,e){let n;for(const i of t.visualizations){if(e&&i.type===c.Chart){n=i;break}if(!e&&i.type===c.Table){n=i;break}}const i=Object.assign({},t);if(n){i.visualizations=[n]}else{throw new Error((e?"Primary":"Secondary")+" visualisation needs valid "+(e?"chart":"table"))}return i};const h=function(i,a){const o=t.getEntityTypeAnnotation(i.annotationPath);const s=o.annotation;t=o.converterContext;const l=s;if(l||t.getTemplateType()===f.AnalyticalListPage){r=z(l?t.getRelativeAnnotationPath(l.fullyQualifiedName,t.getEntityType()):"",true,t,n,undefined,undefined,undefined,e);return r}else{const t="Annotation Path for the "+(a?"primary":"secondary")+" visualisation mentioned in the manifest is not found";throw new Error(t)}};const y=function(t,e){var i,a,o;const r=v(t[0],true);l=r===null||r===void 0?void 0:(i=r.visualizations[0])===null||i===void 0?void 0:i.id;const c=v(t[1]?t[1]:t[0],false);s=c===null||c===void 0?void 0:(a=c.visualizations[0])===null||a===void 0?void 0:(o=a.annotation)===null||o===void 0?void 0:o.id;if(r&&c){n=n;const t=n.visible;const i={primaryVisualization:r,secondaryVisualization:c,tableControlId:s,chartControlId:l,defaultPath:e,visible:t};return i}};if(!t.getManifestWrapper().hasMultipleVisualizations(n)&&((i=r)===null||i===void 0?void 0:(a=i.visualizations)===null||a===void 0?void 0:a.length)===2&&t.getTemplateType()===f.AnalyticalListPage){const t=y([r],"both");if(t){return t}}else if(t.getManifestWrapper().hasMultipleVisualizations(n)||t.getTemplateType()===f.AnalyticalListPage){const{primary:t,secondary:e}=n;if(t&&t.length&&e&&e.length){const i=y([h(t[0],true),h(e[0],false)],n.defaultPath);if(i){return i}}else{throw new Error("SecondaryItems in the Views is not present")}}else if(o(n)){const e=t.getEntityTypeAnnotation(n.annotationPath);const i=e.annotation;t=e.converterContext;u=M(S(i.Text));r.visualizations.forEach((t,e)=>{var i;switch(t.type){case c.Table:const t=r.visualizations[e];const o=t.control.filters||{};o.hiddenFilters=o.hiddenFilters||{paths:[]};if(!n.keepPreviousPersonalization){t.annotation.id=d(n.key||"","LineItem")}n=n;if(((i=n.annotation)===null||i===void 0?void 0:i.term)==="com.sap.vocabularies.UI.v1.SelectionPresentationVariant"){var a;if(!n.annotation.SelectionVariant){throw new Error(`The Selection Variant is missing for the Selection Presentation Variant ${n.annotation.fullyQualifiedName}`)}p=`@${(a=n.annotation.SelectionVariant)===null||a===void 0?void 0:a.fullyQualifiedName.split("@")[1]}`}else{p=n.annotationPath}o.hiddenFilters.paths.push({annotationPath:p});t.control.filters=o;break;case c.Chart:const s=r.visualizations[e];s.id=m(n.key||"","Chart");s.multiViews=true;break;default:break}})}r.visualizations.forEach(t=>{if(t.type===c.Table){s=t.annotation.id}else if(t.type===c.Chart){l=t.id}});n=n;const g=n.visible;return{presentation:r,tableControlId:s,chartControlId:l,title:u,selectionVariantPath:p,visible:g}}else{n=n;const t=n.label,e=n.template,i=n.type,a=g(n.key||""),o=n.visible;return{title:t,fragment:e,type:i,customTabId:a,visible:o}}};const j=function(t,e,n){let i=[];if(e){e.paths.forEach(n=>{if(t.getManifestWrapper().hasMultipleVisualizations(n)){if(e.paths.length>1){throw new Error("ALP flavor cannot have multiple views")}else{n=n;i.push({converterContext:t,primary:n.primary,secondary:n.secondary,defaultPath:n.defaultPath})}}else if(n.template){n=n;i.push({key:n.key,label:n.label,template:n.template,type:"Custom",visible:n.visible})}else{n=n;const e=t.getConverterContextFor(n.contextPath||n.entitySet&&`/${n.entitySet}`||t.getContextPath()),a=e.getEntityType();if(a&&e){let t;const o=e.getEntityTypeAnnotation(n.annotationPath);const r=o.annotation;if(r){t=r.term==="com.sap.vocabularies.UI.v1.SelectionVariant"?W(a,e,false):r;i.push({converterContext:e,annotation:t,annotationPath:n.annotationPath,keepPreviousPersonalization:n.keepPreviousPersonalization,key:n.key,visible:n.visible})}}else{}}})}else{const e=t.getEntityType();if(t.getTemplateType()===f.AnalyticalListPage){i=Q(t,i)}else{i.push({annotation:W(e,t,false),converterContext:t})}}return i.map(t=>H(t,n))};const N=function(t,e){const n=t.getManifestWrapper();const i=n.getViewConfiguration();if(e.length>1&&!$(t)){return{showTabCounts:i?(i===null||i===void 0?void 0:i.showCounts)||n.hasMultipleEntitySets():undefined,id:p()}}return undefined};function Q(t,e){const n=t.getEntityType();const i=W(n,t,true);let a,o;if(i){e.push({annotation:i,converterContext:t})}else{a=E(n);o=w(n);if(a&&o){const n=[{annotationPath:"@"+a.term}];const i=[{annotationPath:"@"+o.term}];e.push({converterContext:t,primary:n,secondary:i,defaultPath:"both"})}else{throw new Error("ALP flavor needs both chart and table to load the application")}}return e}function $(t){return t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===f.AnalyticalListPage}const K=function(t){const e=t.getManifestWrapper();return k([],L(e.getHeaderActions(),t).actions)};l.getHeaderActions=K;const O=function(t,e){t.forEach(t=>{if(!t.type){const n=t.presentation;n.visualizations.forEach(t=>{if(t.type===c.Chart&&t.filterId!==e){t.filterId=e}})}})};l.checkChartFilterBarId=O;const U=function(t,e){const n=t.getEntityType();const i=t.getContextPath();if(!i){throw new Error("An EntitySet is required to be able to display a ListReport, please adjust your `entitySet` property to point to one.")}const a=t.getManifestWrapper();const o=a.getViewConfiguration();const r=a.hasMultipleEntitySets();const s=j(t,o,e);const l=B(s);const c=x(s);const f=l.some(t=>t.control.type==="ResponsiveTable");let d="";let p="";const g=y();const m=h(i);const b=v(m);const P=a.getFilterConfiguration();const I=(P===null||P===void 0?void 0:P.initialLayout)!==undefined?P===null||P===void 0?void 0:P.initialLayout.toLowerCase():"compact";const V=(P===null||P===void 0?void 0:P.layout)!==undefined?P===null||P===void 0?void 0:P.layout.toLowerCase():"compact";const w=P.useSemanticDateRange!==undefined?P.useSemanticDateRange:true;const E=P.showClearButton!==undefined?P.showClearButton:false;const z=q(t,s);if(z){p=z.chartId;d=z.tableId}const S=a.useHiddenFilterBar();const M=(a.isFilterBarHidden()||S)&&p==="";const k=A(t,l);const L=k.selectionFields;const W=k.sPropertyInfo;const H=F(l,c,t);const Q=N(t,s);const U=Q?undefined:T(n,t);const G=w?R(D(n,t)):{};const J=K(t);if(r){O(s,m)}const X=l.map(t=>t.annotation.id).concat(c.map(t=>t.id));const Y=[...M&&!S?[]:[m],...a.getVariantManagement()!==u.Control?X:[],...Q?[Q.id]:[]];const Z=Q&&a.getStickyMultiTabHeaderConfiguration()?Q.id:undefined;return{mainEntitySet:i,mainEntityType:`${i}/`,multiViewsControl:Q,stickySubheaderProvider:Z,singleTableId:d,singleChartId:p,dynamicListReportId:g,headerActions:J,showPinnableToggle:f,filterBar:{propertyInfo:W,selectionFields:L,hideBasicSearch:H,showClearButton:E},views:s,filterBarId:M&&!S?"":m,filterConditions:{selectionVariant:U,defaultSemanticDates:G},variantManagement:{id:b,targetControlIds:Y.join(",")},hasMultiVisualizations:$(t),templateType:a.getTemplateType(),useSemanticDateRange:w,filterInitialLayout:I,filterLayout:V,kpiDefinitions:C(t),hideFilterBar:M,useHiddenFilterBar:S}};l.convertPage=U;function q(t,e){let n="",i="";if(t.getManifestWrapper().hasMultipleVisualizations()||t.getTemplateType()===f.AnalyticalListPage){for(const t of e){const e=t;if(e.chartControlId&&e.tableControlId){i=e.chartControlId;n=e.tableControlId;break}}}else{for(const t of e){const e=t;if(!n&&e.tableControlId){n=e.tableControlId||""}if(!i&&e.chartControlId){i=e.chartControlId||""}if(i&&n){break}}}if(n||i){return{chartId:i,tableId:n}}return undefined}return l},false);
|
|
506
516
|
/*!
|
|
507
517
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
508
518
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
509
519
|
*/
|
|
510
|
-
sap.ui.predefine("sap/fe/core/converters/templates/ObjectPageConverter", ["sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/objectPage/HeaderAndFooterAction","sap/fe/core/helpers/BindingToolkit","../controls/ObjectPage/Avatar","../controls/ObjectPage/HeaderFacet","../controls/ObjectPage/SubSection","../helpers/BindingHelper","../helpers/ConfigurableObject","../helpers/ID","../ManifestSettings"],function(e,t,n,o,i,a,s,r,c,l){"use strict";var d={};var
|
|
520
|
+
sap.ui.predefine("sap/fe/core/converters/templates/ObjectPageConverter", ["sap/fe/core/converters/controls/Common/Action","sap/fe/core/converters/objectPage/HeaderAndFooterAction","sap/fe/core/helpers/BindingToolkit","../controls/ObjectPage/Avatar","../controls/ObjectPage/HeaderFacet","../controls/ObjectPage/SubSection","../helpers/BindingHelper","../helpers/ConfigurableObject","../helpers/ID","../ManifestSettings"],function(e,t,n,o,i,a,s,r,c,l){"use strict";var d={};var v=l.VisualizationType;var u=l.TemplateType;var f=c.getSectionID;var b=c.getEditableHeaderSectionID;var g=c.getCustomSectionID;var p=r.Placement;var m=r.OverrideType;var y=r.insertCustomElements;var h=s.UI;var E=a.SubSectionType;var A=a.createSubSections;var S=a.createCustomSubSections;var C=a.createCustomHeaderFacetSubSections;var T=i.getHeaderFacetsFromManifest;var w=i.getHeaderFacetsFromAnnotations;var H=o.getAvatar;var I=n.not;var F=n.ifElse;var k=n.getExpressionFromAnnotation;var L=n.equal;var M=n.constant;var O=n.compileExpression;var P=t.getHiddenHeaderActions;var j=t.getHeaderDefaultActions;var z=t.getFooterDefaultActions;var x=e.removeDuplicateActions;var D=e.getActionsFromManifest;const B=(e,t)=>{var n,o;return((n=e.ID)===null||n===void 0?void 0:n.toString())||((o=e.Label)===null||o===void 0?void 0:o.toString())||t};function U(e,t){var n,o;const i=b();const a=(n=e.getEntityType().annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:o.HeaderFacets;const s=a?A(a,e,true):[];const r=C(e);let c=[];if(r.length>0){let e=0;t.forEach(function(t){while(s.length>e&&s[e].visible==="false"){c.push(s[e]);e++}if(s.length>e&&(t.key===s[e].key||t.key.slice(t.key.lastIndexOf("::")+2)===s[e].key.slice(s[e].key.lastIndexOf("::")+2))){c.push(s[e]);e++}else{r.forEach(function(e){if(t.key===e.key){c.push(e)}})}})}else{c=s}const l={id:i,key:"EditableHeaderContent",title:"{sap.fe.i18n>T_COMMON_OBJECT_PAGE_HEADER_SECTION}",visible:O(h.IsEditable),subSections:c};return l}d.createEditableHeaderSection=U;function V(e){var t,n,o;const i=e.getEntityType();const a=((t=i.annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:(o=n.Facets)===null||o===void 0?void 0:o.map(t=>W(t,e)))||[];return a}function W(e,t){var n,o,i;const a=f(e);const s={id:a,key:B(e,a),title:e.Label?O(k(e.Label)):undefined,showTitle:!!e.Label,visible:O(I(L(k((n=e.annotations)===null||n===void 0?void 0:(o=n.UI)===null||o===void 0?void 0:(i=o.Hidden)===null||i===void 0?void 0:i.valueOf()),true))),subSections:A([e],t)};return s}function _(e,t){const n={};Object.keys(e).forEach(o=>{n[o]=N(e[o],o,t)});return n}function N(e,t,n){const o=e.id||g(t);let i=e.position;if(!i){i={placement:p.After}}let a;if(!e.subSections){a={[t]:{...e,position:undefined,visible:"true"}}}else{a=e.subSections}const s=S(a,n);const r={id:o,key:t,title:e.title,showTitle:!!e.title,visible:e.visible!==undefined?e.visible:"true",position:i,subSections:s};return r}const R=function(e){const t=j(e);const n=e.getManifestWrapper();const o=D(n.getHeaderActions(),e,t,undefined,undefined,P(e));const i={isNavigable:m.overwrite,enabled:m.overwrite,visible:m.overwrite,defaultValuesExtensionFunction:m.overwrite,command:m.overwrite};const a=y(t,o.actions,i);return{actions:x(a),commandActions:o.commandActions}};d.getHeaderActions=R;const q=function(e){const t=e.getManifestWrapper();const n=z(t.getViewLevel(),e);const o=D(t.getFooterActions(),e,n);const i={isNavigable:m.overwrite,enabled:m.overwrite,visible:m.overwrite,defaultValuesExtensionFunction:m.overwrite,command:m.overwrite};const a=y(n,o.actions,i);return{actions:a,commandActions:o.commandActions}};d.getFooterActions=q;function G(e){var t;return e!==null&&e!==void 0&&(t=e.presentation)!==null&&t!==void 0&&t.visualizations[0]?e.presentation.visualizations[0]:undefined}function J(e,t){var n,o;return e.visible==="true"&&(e===null||e===void 0?void 0:(n=e.presentation)===null||n===void 0?void 0:n.visualizations)&&(t===null||t===void 0?void 0:t.type)==="Table"&&(t===null||t===void 0?void 0:(o=t.control)===null||o===void 0?void 0:o.type)!=="ResponsiveTable"}function K(e,t,n,o){if(J(t,n)){const t=n.control;if(!(o==="Page"&&e.length>1)){t.rowCountMode="Auto"}if(o!=="Tabs"){t.useCondensedTableLayout=false}}}function Q(e,t){var n;if((e===null||e===void 0?void 0:(n=e.content)===null||n===void 0?void 0:n.length)===1){var o;const n=((o=e.content[0].presentation)===null||o===void 0?void 0:o.visualizations[0]).control;if(n.type!=="ResponsiveTable"){n.rowCountMode="Auto";if(t!=="Tabs"){n.useCondensedTableLayout=false}}}}function X(e,t,n){let o;let i;const a=t.subSections;if(a.length===1){o=a[0];switch(a[0].type){case"DataVisualization":i=G(o);K(e,o,i,n);break;case"Mixed":Q(o,n);break;default:break}return}Y(a)}function Y(e){let t;e.forEach(e=>{var n,o,i;t=e;if((n=t)!==null&&n!==void 0&&(o=n.presentation)!==null&&o!==void 0&&o.visualizations){var a,s;(a=t)===null||a===void 0?void 0:(s=a.presentation)===null||s===void 0?void 0:s.visualizations.forEach(e=>{if(e.type===v.Table){e.control.useCondensedTableLayout=false}})}if((i=t)!==null&&i!==void 0&&i.content){t.content.forEach(e=>{var t;(t=e.presentation)===null||t===void 0?void 0:t.visualizations.forEach(e=>{if(e.type===v.Table){e.control.useCondensedTableLayout=false}})})}})}const Z=function(e){const t=e.getManifestWrapper();const n=y(V(e),_(t.getSections(),e),{title:m.overwrite,visible:m.overwrite,subSections:{actions:m.merge,title:m.overwrite,sideContent:m.overwrite,objectPageLazyLoaderEnabled:m.overwrite}});n.forEach(function(e){var o;X(n,e,t.getSectionLayout());(o=e.subSections)===null||o===void 0?void 0:o.forEach(function(e){var t;e.title=e.title==="undefined"?undefined:e.title;if(e.type==="Mixed"){var n;(n=e.content)===null||n===void 0?void 0:n.forEach(t=>{t.objectPageLazyLoaderEnabled=e.objectPageLazyLoaderEnabled})}if(e.type==="Mixed"&&(t=e.content)!==null&&t!==void 0&&t.length){var o;const t=e.content.find(e=>e.type===E.Form);if(e.sideContent){if(t){t.sideContent=e.sideContent}else{e.content[0].sideContent=e.sideContent}e.sideContent=undefined}if(t&&(o=e.actions)!==null&&o!==void 0&&o.length){t.actions=e.actions;e.actions=[]}}})});return n};d.getSections=Z;function $(e){var t,n;const o=e.getManifestWrapper();return(((t=e.getEntityType().annotations)===null||t===void 0?void 0:(n=t.UI)===null||n===void 0?void 0:n.HeaderFacets)||[]).length>0||Object.keys(o.getHeaderFacets()).length>0}function ee(e){const t=e.getManifestWrapper();return F(!$(e),M(false),F(L(t.isHeaderEditable(),false),M(true),I(h.IsEditable)))}const te=function(e){return O(ee(e))};d.getShowHeaderContent=te;const ne=function(e){return O(I(ee(e)))};d.getExpandedImageVisible=ne;const oe=function(e){var t,n;const o=e.getManifestWrapper();let i;const a=e.getEntityType();const s=y(w(e),T(o.getHeaderFacets()));const r=R(e);const c=q(e);if(o.isHeaderEditable()&&((t=a.annotations.UI)!==null&&t!==void 0&&t.HeaderFacets||(n=a.annotations.UI)!==null&&n!==void 0&&n.HeaderInfo)){i=U(e,s)}const l=Z(e);return{template:u.ObjectPage,header:{visible:o.getShowObjectPageHeader(),section:i,facets:s,actions:r.actions,showContent:te(e),hasContent:$(e),avatar:H(e),title:{expandedImageVisible:ne(e)}},sections:l,footerActions:c.actions,headerCommandActions:r.commandActions,footerCommandActions:c.commandActions,showAnchorBar:o.getShowAnchorBar(),useIconTabBar:o.useIconTabBar()}};d.convertPage=oe;return d},false);
|
|
511
521
|
/*!
|
|
512
522
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
513
523
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
514
524
|
*/
|
|
515
|
-
sap.ui.predefine("sap/fe/core/formatters/CollaborationFormatter", ["sap/ui/core/Core"],function(t){"use strict";var
|
|
525
|
+
sap.ui.predefine("sap/fe/core/formatters/CollaborationFormatter", ["sap/fe/core/controllerextensions/collaboration/CollaborationCommon","sap/ui/core/Core"],function(t,o){"use strict";var n={};var e=t.getActivityKeyFromPath;const r=function(t){if(r.hasOwnProperty(t)){for(var o=arguments.length,n=new Array(o>1?o-1:0),e=1;e<o;e++){n[e-1]=arguments[e]}return r[t].apply(this,n)}else{return""}};const i=function(t){return!!c(t,this)};i.__functionName="sap.fe.core.formatters.CollaborationFormatter#hasCollaborationActivity";n.hasCollaborationActivity=i;const a=function(t){const o=c(t,this);return o===null||o===void 0?void 0:o.initials};a.__functionName="sap.fe.core.formatters.CollaborationFormatter#getCollaborationActivityInitials";n.getCollaborationActivityInitials=a;const l=function(t){const o=c(t,this);return o!==null&&o!==void 0&&o.color?`Accent${o.color}`:undefined};l.__functionName="sap.fe.core.formatters.CollaborationFormatter#getCollaborationActivityColor";n.getCollaborationActivityColor=l;function c(t,o){var n;const r=o===null||o===void 0?void 0:(n=o.getBindingContext())===null||n===void 0?void 0:n.getPath();if(!r){return undefined}const i=e(r);if(t&&t.length>0){return t.find(t=>t.key===i)}else{return undefined}}const s=function(){const t=arguments.length<=0?undefined:arguments[0];const n=o.getLibraryResourceBundle("sap.fe.core");const e=[];for(let t=1;t<arguments.length;t++){e.push(t<0||arguments.length<=t?undefined:arguments[t])}return n.getText(t,e)};s.__functionName="sap.fe.core.formatters.CollaborationFormatter#getFormattedText";n.getFormattedText=s;r.hasCollaborationActivity=i;r.getCollaborationActivityInitials=a;r.getCollaborationActivityColor=l;r.getFormattedText=s;return r},true);
|
|
516
526
|
/*!
|
|
517
527
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
518
528
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -547,12 +557,12 @@ sap.ui.predefine("sap/fe/core/formatters/TableFormatterTypes", [],function(){"us
|
|
|
547
557
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
548
558
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
549
559
|
*/
|
|
550
|
-
sap.ui.predefine("sap/fe/core/formatters/ValueFormatter", ["sap/base/strings/whitespaceReplacer","sap/ui/core/Core","sap/ui/core/format/DateFormat"],function(e,t,r){"use strict";var i={};const a=function(e){if(a.hasOwnProperty(e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++){r[i-1]=arguments[i]}return a[e].apply(this,r)}else{return""}};const o=(e,r)=>{if(e&&r){return t.getLibraryResourceBundle("sap.fe.core").getText("C_FORMAT_FOR_TEXT_ARRANGEMENT",[e,r])}else{return e||r||""}};o.__functionName="sap.fe.core.formatters.ValueFormatter#formatWithBrackets";const s=(r
|
|
560
|
+
sap.ui.predefine("sap/fe/core/formatters/ValueFormatter", ["sap/base/strings/whitespaceReplacer","sap/ui/core/Core","sap/ui/core/format/DateFormat"],function(e,t,r){"use strict";var i={};const a=function(e){if(a.hasOwnProperty(e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++){r[i-1]=arguments[i]}return a[e].apply(this,r)}else{return""}};const o=(e,r)=>{if(e&&r){return t.getLibraryResourceBundle("sap.fe.core").getText("C_FORMAT_FOR_TEXT_ARRANGEMENT",[e,r])}else{return e||r||""}};o.__functionName="sap.fe.core.formatters.ValueFormatter#formatWithBrackets";const s=(t,r)=>r?o(e(t),e(r)):e(t);s.__functionName="sap.fe.core.formatters.ValueFormatter#formatTitle";const n=e=>e!==null&&e!==undefined?`${e} %`:"";n.__functionName="sap.fe.core.formatters.ValueFormatter#formatWithPercentage";const c=(e,t,r)=>{let i;if(e===undefined){return"0"}const a=typeof e==="string"?parseFloat(e):e;const o=typeof t==="string"?parseFloat(t):t;if(r==="%"){if(a>100){i="100"}else if(a<=0){i="0"}else{i=typeof e==="string"?e:e===null||e===void 0?void 0:e.toString()}}else if(a>o){i="100"}else if(a<=0){i="0"}else{i=a&&o?(a/o*100).toString():"0"}return i};c.__functionName="sap.fe.core.formatters.ValueFormatter#computePercentage";const l=e=>{let t;if(e==="UI.CriticalityType/Negative"||e==="1"||e===1){t="sap-icon://message-error"}else if(e==="UI.CriticalityType/Critical"||e==="2"||e===2){t="sap-icon://message-warning"}else if(e==="UI.CriticalityType/Positive"||e==="3"||e===3){t="sap-icon://message-success"}else if(e==="UI.CriticalityType/Information"||e==="5"||e===5){t="sap-icon://message-information"}else{t=""}return t};l.__functionName="sap.fe.core.formatters.ValueFormatter#formatCriticalityIcon";i.formatCriticalityIcon=l;const f=e=>{let t;if(e==="UI.CriticalityType/Negative"||e==="1"||e===1){t="Error"}else if(e==="UI.CriticalityType/Critical"||e==="2"||e===2){t="Warning"}else if(e==="UI.CriticalityType/Positive"||e==="3"||e===3){t="Success"}else if(e==="UI.CriticalityType/Information"||e==="5"||e===5){t="Information"}else{t="None"}return t};f.__functionName="sap.fe.core.formatters.ValueFormatter#formatCriticalityValueState";i.formatCriticalityValueState=f;const m=e=>{let t;if(e==="UI.CriticalityType/Negative"||e==="1"||e===1){t="Reject"}else if(e==="UI.CriticalityType/Positive"||e==="3"||e===3){t="Accept"}else{t="Default"}return t};m.__functionName="sap.fe.core.formatters.ValueFormatter#formatCriticalityButtonType";i.formatCriticalityButtonType=m;const u=e=>{let t;if(e==="UI.CriticalityType/Negative"||e==="1"||e===1){t="Error"}else if(e==="UI.CriticalityType/Critical"||e==="2"||e===2){t="Critical"}else if(e==="UI.CriticalityType/Positive"||e==="3"||e===3){t="Good"}else{t="Neutral"}return t};u.__functionName="sap.fe.core.formatters.ValueFormatter#formatCriticalityColorMicroChart";i.formatCriticalityColorMicroChart=u;const p=(e,i,a)=>{if(e&&i&&a){var o,s,n;const c=a.split("-");const l=`${c[1]===undefined?a:c[1]}-narrow`;const f=r.getDateInstance();const m=f.oLocaleData.mData;const u=t.getLibraryResourceBundle("sap.fe.macros");let p=a;if(m!==null&&m!==void 0&&(o=m.dateFields[l])!==null&&o!==void 0&&o.displayName){p=m.dateFields[l].displayName}else if(m!==null&&m!==void 0&&(s=m.units)!==null&&s!==void 0&&(n=s.short[a])!==null&&n!==void 0&&n.displayName){p=m.units.short[a].displayName}return u.getText("T_COMMON_PROGRESS_INDICATOR_DISPLAY_VALUE_WITH_UOM",[e,i,p])}};p.__functionName="sap.fe.core.formatters.ValueFormatter#formatProgressIndicatorText";i.formatProgressIndicatorText=p;const y=t=>t===null||t===undefined?"":e(t+"");y.__functionName="sap.fe.core.formatters.ValueFormatter#formatToKeepWhitespace";i.formatToKeepWhitespace=y;a.formatWithBrackets=o;a.formatTitle=s;a.formatWithPercentage=n;a.computePercentage=c;a.formatCriticalityIcon=l;a.formatCriticalityValueState=f;a.formatCriticalityButtonType=m;a.formatCriticalityColorMicroChart=u;a.formatProgressIndicatorText=p;a.formatToKeepWhitespace=y;return a},true);
|
|
551
561
|
/*!
|
|
552
562
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
553
563
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
554
564
|
*/
|
|
555
|
-
sap.ui.predefine("sap/fe/core/fpm/Component", ["sap/fe/core/helpers/ClassSupport","sap/fe/core/TemplateComponent"],function(e,r){"use strict";var i,t,n,a,o,l,u,c,f;var s=e.property;var p=e.defineUI5Class;function b(e,r,i,t){if(!i)return;Object.defineProperty(e,r,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(t):void 0})}function m(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function d(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;v(e,r)}function v(e,r){v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(r,i){r.__proto__=i;return r};return v(e,r)}function w(e,r,i,t,n){var a={};Object.keys(t).forEach(function(e){a[e]=t[e]});a.enumerable=!!a.enumerable;a.configurable=!!a.configurable;if("value"in a||a.initializer){a.writable=true}a=i.slice().reverse().reduce(function(i,t){return t(e,r,i)||i},a);if(n&&a.initializer!==void 0){a.value=a.initializer?a.initializer.call(n):void 0;a.initializer=undefined}if(a.initializer===void 0){Object.defineProperty(e,r,a);a=null}return a}function y(e,r){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let
|
|
565
|
+
sap.ui.predefine("sap/fe/core/fpm/Component", ["sap/fe/core/helpers/ClassSupport","sap/fe/core/TemplateComponent"],function(e,r){"use strict";var i,t,n,a,o,l,u,c,f;var s=e.property;var p=e.defineUI5Class;function b(e,r,i,t){if(!i)return;Object.defineProperty(e,r,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(t):void 0})}function m(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function d(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;v(e,r)}function v(e,r){v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(r,i){r.__proto__=i;return r};return v(e,r)}function w(e,r,i,t,n){var a={};Object.keys(t).forEach(function(e){a[e]=t[e]});a.enumerable=!!a.enumerable;a.configurable=!!a.configurable;if("value"in a||a.initializer){a.writable=true}a=i.slice().reverse().reduce(function(i,t){return t(e,r,i)||i},a);if(n&&a.initializer!==void 0){a.value=a.initializer?a.initializer.call(n):void 0;a.initializer=undefined}if(a.initializer===void 0){Object.defineProperty(e,r,a);a=null}return a}function y(e,r){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let h=(i=p("sap.fe.core.fpm.Component",{manifest:"json"}),t=s({type:"string"}),n=s({type:"string"}),a=s({type:"string"}),i(o=(l=function(e){d(r,e);function r(r){var i;if(r.viewType==="JSX"){r._mdxViewName=r.viewName;r.viewName="module:sap/fe/core/jsx-runtime/ViewLoader";delete r.cache}i=e.call(this,r)||this;b(i,"viewName",u,m(i));b(i,"controllerName",c,m(i));b(i,"_mdxViewName",f,m(i));return i}return r}(r),u=w(l.prototype,"viewName",[t],{configurable:true,enumerable:true,writable:true,initializer:null}),c=w(l.prototype,"controllerName",[n],{configurable:true,enumerable:true,writable:true,initializer:null}),f=w(l.prototype,"_mdxViewName",[a],{configurable:true,enumerable:true,writable:true,initializer:function(){return""}}),l))||o);return h},false);
|
|
556
566
|
/*!
|
|
557
567
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
558
568
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -567,7 +577,7 @@ sap.ui.predefine("sap/fe/core/helpers/AppStartupHelper", ["sap/ui/model/Filter",
|
|
|
567
577
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
568
578
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
569
579
|
*/
|
|
570
|
-
sap.ui.predefine("sap/fe/core/helpers/BindingToolkit", ["./AnnotationEnum"],function(e){"use strict";var n={};var t=e.resolveEnumValue;const r={"Edm.Boolean":{type:"sap.ui.model.odata.type.Boolean"},"Edm.Byte":{type:"sap.ui.model.odata.type.Byte"},"Edm.Date":{type:"sap.ui.model.odata.type.Date"},"Edm.DateTimeOffset":{constraints:{$Precision:"precision",$V4:"V4"},type:"sap.ui.model.odata.type.DateTimeOffset"},"Edm.Decimal":{constraints:{"@Org.OData.Validation.V1.Minimum/$Decimal":"minimum","@Org.OData.Validation.V1.Minimum@Org.OData.Validation.V1.Exclusive":"minimumExclusive","@Org.OData.Validation.V1.Maximum/$Decimal":"maximum","@Org.OData.Validation.V1.Maximum@Org.OData.Validation.V1.Exclusive":"maximumExclusive",$Precision:"precision",$Scale:"scale"},type:"sap.ui.model.odata.type.Decimal"},"Edm.Double":{type:"sap.ui.model.odata.type.Double"},"Edm.Guid":{type:"sap.ui.model.odata.type.Guid"},"Edm.Int16":{type:"sap.ui.model.odata.type.Int16"},"Edm.Int32":{type:"sap.ui.model.odata.type.Int32"},"Edm.Int64":{type:"sap.ui.model.odata.type.Int64"},"Edm.SByte":{type:"sap.ui.model.odata.type.SByte"},"Edm.Single":{type:"sap.ui.model.odata.type.Single"},"Edm.Stream":{type:"sap.ui.model.odata.type.Stream"},"Edm.Binary":{type:"sap.ui.model.odata.type.Stream"},"Edm.String":{constraints:{"@com.sap.vocabularies.Common.v1.IsDigitSequence":"isDigitSequence",$MaxLength:"maxLength",$Nullable:"nullable"},type:"sap.ui.model.odata.type.String"},"Edm.TimeOfDay":{constraints:{$Precision:"precision"},type:"sap.ui.model.odata.type.TimeOfDay"}};n.EDM_TYPE_MAPPING=r;const a={_type:"Unresolvable"};n.unresolvableExpression=a;function o(e){return e.replace(/'/g,"\\'")}function i(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}return n.find(e=>e._type==="Unresolvable")!==undefined}n.hasUnresolvableExpression=i;function s(e,n){if(e._type!==n._type){return false}switch(e._type){case"Unresolvable":return false;case"Constant":case"EmbeddedBinding":case"EmbeddedExpressionBinding":return e.value===n.value;case"Not":return s(e.operand,n.operand);case"Truthy":return s(e.operand,n.operand);case"Set":return e.operator===n.operator&&e.operands.length===n.operands.length&&e.operands.every(e=>n.operands.some(n=>s(e,n)));case"IfElse":return s(e.condition,n.condition)&&s(e.onTrue,n.onTrue)&&s(e.onFalse,n.onFalse);case"Comparison":return e.operator===n.operator&&s(e.operand1,n.operand1)&&s(e.operand2,n.operand2);case"Concat":const t=e.expressions;const r=n.expressions;if(t.length!==r.length){return false}return t.every((e,n)=>s(e,r[n]));case"Length":return s(e.pathInModel,n.pathInModel);case"PathInModel":return e.modelName===n.modelName&&e.path===n.path&&e.targetEntitySet===n.targetEntitySet;case"Formatter":return e.fn===n.fn&&e.parameters.length===n.parameters.length&&e.parameters.every((e,t)=>s(n.parameters[t],e));case"ComplexType":return e.type===n.type&&e.bindingParameters.length===n.bindingParameters.length&&e.bindingParameters.every((e,t)=>s(n.bindingParameters[t],e));case"Function":const a=n;if(e.obj===undefined||a.obj===undefined){return e.obj===a}return e.fn===a.fn&&s(e.obj,a.obj)&&e.parameters.length===a.parameters.length&&e.parameters.every((e,n)=>s(a.parameters[n],e));case"Ref":return e.ref===n.ref}return false}n._checkExpressionsAreEqual=s;function u(e){return e.operands.reduce((n,t)=>{const r=t._type==="Set"&&t.operator===e.operator?t.operands:[t];r.forEach(e=>{if(n.operands.every(n=>!s(n,e))){n.operands.push(e)}});return n},{_type:"Set",operator:e.operator,operands:[]})}function l(e){const n=e.map(f);return e.some((e,t)=>{for(let r=t+1;r<n.length;r++){if(s(e,n[r])){return true}}return false})}function p(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=u({_type:"Set",operator:"&&",operands:n.map($)}).operands;if(i(...r)){return a}let o=false;const s=r.filter(e=>{if(I(e)){o=true}return!E(e)});if(o){return v(false)}else if(s.length===0){const e=r.reduce((e,n)=>e&&O(n),true);return v(e)}else if(s.length===1){return s[0]}else if(l(s)){return v(false)}else{return{_type:"Set",operator:"&&",operands:s}}}n.and=p;function d(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=u({_type:"Set",operator:"||",operands:n.map($)}).operands;if(i(...r)){return a}let o=false;const s=r.filter(e=>{if(O(e)){o=true}return!E(e)||e.value});if(o){return v(true)}else if(s.length===0){const e=r.reduce((e,n)=>e&&O(n),true);return v(e)}else if(s.length===1){return s[0]}else if(l(s)){return v(true)}else{return{_type:"Set",operator:"||",operands:s}}}n.or=d;function f(e){e=$(e);if(i(e)){return a}else if(E(e)){return v(!e.value)}else if(typeof e==="object"&&e._type==="Set"&&e.operator==="||"&&e.operands.every(e=>E(e)||P(e))){return p(...e.operands.map(e=>f(e)))}else if(typeof e==="object"&&e._type==="Set"&&e.operator==="&&"&&e.operands.every(e=>E(e)||P(e))){return d(...e.operands.map(e=>f(e)))}else if(P(e)){switch(e.operator){case"!==":return{...e,operator:"==="};case"<":return{...e,operator:">="};case"<=":return{...e,operator:">"};case"===":return{...e,operator:"!=="};case">":return{...e,operator:"<="};case">=":return{...e,operator:"<"}}}else if(e._type==="Not"){return e.operand}return{_type:"Not",operand:e}}n.not=f;function c(e){if(E(e)){return v(!!e.value)}else{return{_type:"Truthy",operand:e}}}n.isTruthy=c;function m(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let r=arguments.length>3?arguments[3]:undefined;return y(e,n,t,r)}n.bindingExpression=m;function y(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let r=arguments.length>3?arguments[3]:undefined;if(e===undefined){return a}let o;if(r){o=r(e);if(o===undefined){return a}}else{const n=t.concat();n.push(e);o=n.join("/")}return{_type:"PathInModel",modelName:n,path:o}}n.pathInModel=y;function v(e){let n;if(typeof e==="object"&&e!==null&&e!==undefined){if(Array.isArray(e)){n=e.map($)}else if(F(e)){n=e.valueOf()}else{n=Object.entries(e).reduce((e,n)=>{let[t,r]=n;const a=$(r);if(a._type!=="Constant"||a.value!==undefined){e[t]=a}return e},{})}}else{n=e}return{_type:"Constant",value:n}}n.constant=v;function h(e,n){if(e!==undefined&&typeof e==="string"&&e.startsWith("{")){const n=/^{(.*)>(.+)}$/;const t=n.exec(e);if(e.startsWith("{=")){return{_type:"EmbeddedExpressionBinding",value:e}}else if(t){return y(t[2]||"",t[1]||undefined)}else{return{_type:"EmbeddedBinding",value:e}}}else if(n==="boolean"&&typeof e==="string"&&(e==="true"||e==="false")){return v(e==="true")}else if(n==="number"&&typeof e==="string"&&(!isNaN(Number(e))||e==="NaN")){return v(Number(e))}else{return v(e)}}n.resolveBindingString=h;function g(e){return{_type:"Ref",ref:e}}n.ref=g;function $(e){if(b(e)){return e}return v(e)}function b(e){return(e===null||e===void 0?void 0:e._type)!==undefined}n.isBindingToolkitExpression=b;function E(e){return typeof e!=="object"||e._type==="Constant"}n.isConstant=E;function O(e){return E(e)&&e.value===true}function I(e){return E(e)&&e.value===false}function _(e){return(e===null||e===void 0?void 0:e._type)==="PathInModel"}n.isPathInModelExpression=_;function x(e){return(e===null||e===void 0?void 0:e._type)==="ComplexType"}n.isComplexTypeExpression=x;function C(e){return(e===null||e===void 0?void 0:e._type)==="Concat"}function P(e){return e._type==="Comparison"}function S(e){const n=e;return(n===null||n===void 0?void 0:n._type)==="Constant"&&(n===null||n===void 0?void 0:n.value)===undefined}n.isUndefinedExpression=S;function F(e){switch(e.constructor.name){case"String":case"Number":case"Boolean":return true;default:return false}}function T(e){return typeof e==="object"&&!F(e)}function N(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;let r=arguments.length>3?arguments[3]:undefined;return M(e,n,t,r)}n.annotationExpression=N;function M(e){var n;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let r=arguments.length>2?arguments[2]:undefined;let o=arguments.length>3?arguments[3]:undefined;if(e===undefined){return $(r)}e=(n=e)===null||n===void 0?void 0:n.valueOf();if(!T(e)){return v(e)}switch(e.type){case"Path":return y(e.path,undefined,t,o);case"If":return D(e.If,t,o);case"Not":return f(w(e.Not,t,o));case"Eq":return L(w(e.Eq[0],t,o),w(e.Eq[1],t,o));case"Ne":return k(w(e.Ne[0],t,o),w(e.Ne[1],t,o));case"Gt":return q(w(e.Gt[0],t,o),w(e.Gt[1],t,o));case"Ge":return B(w(e.Ge[0],t,o),w(e.Ge[1],t,o));case"Lt":return U(w(e.Lt[0],t,o),w(e.Lt[1],t,o));case"Le":return G(w(e.Le[0],t,o),w(e.Le[1],t,o));case"Or":return d(...e.Or.map(function(e){return w(e,t,o)}));case"And":return p(...e.And.map(function(e){return w(e,t,o)}));case"Apply":return A(e,t,o)}return a}n.getExpressionFromAnnotation=M;function w(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let r=arguments.length>2?arguments[2]:undefined;if(e===null||typeof e!=="object"){return v(e)}else if(e.hasOwnProperty("$Or")){return d(...e.$Or.map(function(e){return w(e,n,r)}))}else if(e.hasOwnProperty("$And")){return p(...e.$And.map(function(e){return w(e,n,r)}))}else if(e.hasOwnProperty("$Not")){return f(w(e.$Not,n,r))}else if(e.hasOwnProperty("$Eq")){return L(w(e.$Eq[0],n,r),w(e.$Eq[1],n,r))}else if(e.hasOwnProperty("$Ne")){return k(w(e.$Ne[0],n,r),w(e.$Ne[1],n,r))}else if(e.hasOwnProperty("$Gt")){return q(w(e.$Gt[0],n,r),w(e.$Gt[1],n,r))}else if(e.hasOwnProperty("$Ge")){return B(w(e.$Ge[0],n,r),w(e.$Ge[1],n,r))}else if(e.hasOwnProperty("$Lt")){return U(w(e.$Lt[0],n,r),w(e.$Lt[1],n,r))}else if(e.hasOwnProperty("$Le")){return G(w(e.$Le[0],n,r),w(e.$Le[1],n,r))}else if(e.hasOwnProperty("$Path")){return y(e.$Path,undefined,n,r)}else if(e.hasOwnProperty("$Apply")){return M({type:"Apply",Function:e.$Function,Apply:e.$Apply},n,undefined,r)}else if(e.hasOwnProperty("$If")){return M({type:"If",If:e.$If},n,undefined,r)}else if(e.hasOwnProperty("$EnumMember")){return v(t(e.$EnumMember))}return v(false)}function D(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;return Y(w(e[0],n,t),w(e[1],n,t),w(e[2],n,t))}n.annotationIfExpression=D;function A(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;switch(e.Function){case"odata.concat":return ee(...e.Apply.map(e=>{let r=e;if(e.hasOwnProperty("$Path")){r={type:"Path",path:e.$Path}}else if(e.hasOwnProperty("$If")){r={type:"If",If:e.$If}}else if(e.hasOwnProperty("$Apply")){r={type:"Apply",Function:e.$Function,Apply:e.$Apply}}return M(r,n,undefined,t)}))}return a}n.annotationApplyExpression=A;function j(e,n,t){const r=$(n);const o=$(t);if(i(r,o)){return a}if(E(r)&&E(o)){switch(e){case"!==":return v(r.value!==o.value);case"===":return v(r.value===o.value);case"<":return v(r.value<o.value);case"<=":return v(r.value<=o.value);case">":return v(r.value>o.value);case">=":return v(r.value>=o.value)}}else{return{_type:"Comparison",operator:e,operand1:r,operand2:o}}}function V(e){if(e._type==="Unresolvable"){return e}return{_type:"Length",pathInModel:e}}n.length=V;function L(e,n){const t=$(e);const r=$(n);if(i(t,r)){return a}if(s(t,r)){return v(true)}function o(e,n){if(e._type==="Comparison"&&O(n)){return e}else if(e._type==="Comparison"&&I(n)){return f(e)}else if(e._type==="IfElse"&&s(e.onTrue,n)){return d(e.condition,L(e.onFalse,n))}else if(e._type==="IfElse"&&s(e.onFalse,n)){return d(f(e.condition),L(e.onTrue,n))}else if(e._type==="IfElse"&&E(e.onTrue)&&E(e.onFalse)&&E(n)&&!s(e.onTrue,n)&&!s(e.onFalse,n)){return v(false)}return undefined}const u=o(t,r)??o(r,t);return u??j("===",t,r)}n.equal=L;function k(e,n){return f(L(e,n))}n.notEqual=k;function B(e,n){return j(">=",e,n)}n.greaterOrEqual=B;function q(e,n){return j(">",e,n)}n.greaterThan=q;function G(e,n){return j("<=",e,n)}n.lessOrEqual=G;function U(e,n){return j("<",e,n)}n.lessThan=U;function Y(e,n,t){let r=$(e);let o=$(n);let u=$(t);if(i(r,o,u)){return a}if(r._type==="Not"){[o,u]=[u,o];r=f(r)}if(o._type==="IfElse"&&s(r,o.condition)){o=o.onTrue}if(u._type==="IfElse"&&s(r,u.condition)){u=u.onFalse}if(E(r)){return r.value?o:u}if(s(o,u)){return o}if(I(u)){return p(r,o)}if(O(u)){return d(f(r),o)}if(I(o)){return p(f(r),u)}if(O(o)){return d(r,u)}if(x(e)||x(n)||x(t)){let r=0;const a=R([e,n,t],"sap.fe.core.formatters.StandardFormatter#ifElse");const o=[];ne(a,"PathInModel",e=>{o.push(e);return y(`$${r++}`,"$")},true);o.unshift(v(JSON.stringify(a)));return R(o,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}return{_type:"IfElse",condition:r,onTrue:o,onFalse:u}}n.ifElse=Y;function W(e){switch(e._type){case"Constant":case"Formatter":case"ComplexType":return false;case"Set":return e.operands.some(W);case"PathInModel":return e.modelName===undefined;case"Comparison":return W(e.operand1)||W(e.operand2);case"IfElse":return W(e.condition)||W(e.onTrue)||W(e.onFalse);case"Not":case"Truthy":return W(e.operand);default:return false}}function R(e,n,t){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const o=e.map($);if(i(...o)){return a}if(t){if(!o.some(W)){t.keys.forEach(e=>o.push(y(e.name,"")))}}let s="";if(typeof n==="string"){s=n}else{s=n.__functionName}const[u,l]=s.split("#");if(!r&&(o.some(x)||o.some(C))){let e=0;const n=R(o,s,undefined,true);const t=[];ne(n,"PathInModel",n=>{t.push(n);return y(`$${e++}`,"$")});t.unshift(v(JSON.stringify(n)));return R(t,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}else if(!!l&&l.length>0){o.unshift(v(l))}return{_type:"Formatter",fn:u,parameters:o}}n.formatResult=R;function Q(e,n){var t,r,a,o,i,s,u,l,p,d,f,c,m;const y={};if(e!==null&&e!==void 0&&(t=e.constraints)!==null&&t!==void 0&&t.$Scale&&n.scale!==undefined){y.scale=n.scale}if(e!==null&&e!==void 0&&(r=e.constraints)!==null&&r!==void 0&&r.$Precision&&n.precision!==undefined){y.precision=n.precision}if(e!==null&&e!==void 0&&(a=e.constraints)!==null&&a!==void 0&&a.$MaxLength&&n.maxLength!==undefined){y.maxLength=n.maxLength}if(n.nullable===false){y.nullable=false}if(e!==null&&e!==void 0&&(o=e.constraints)!==null&&o!==void 0&&o["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((i=n.annotations)===null||i===void 0?void 0:(s=i.Validation)===null||s===void 0?void 0:s.Minimum)){var v,h;y.minimum=`${(v=n.annotations)===null||v===void 0?void 0:(h=v.Validation)===null||h===void 0?void 0:h.Minimum}`}if(e!==null&&e!==void 0&&(u=e.constraints)!==null&&u!==void 0&&u["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((l=n.annotations)===null||l===void 0?void 0:(p=l.Validation)===null||p===void 0?void 0:p.Maximum)){var g,$;y.maximum=`${(g=n.annotations)===null||g===void 0?void 0:($=g.Validation)===null||$===void 0?void 0:$.Maximum}`}if((d=n.annotations)!==null&&d!==void 0&&(f=d.Common)!==null&&f!==void 0&&f.IsDigitSequence&&e.type==="sap.ui.model.odata.type.String"&&e!==null&&e!==void 0&&(c=e.constraints)!==null&&c!==void 0&&c["@com.sap.vocabularies.Common.v1.IsDigitSequence"]){y.isDigitSequence=true}if(e!==null&&e!==void 0&&(m=e.constraints)!==null&&m!==void 0&&m.$V4){y.V4=true}return y}n.setUpConstraints=Q;function J(e,n){var t;let a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;const o=n;if(e._type!=="Property"){return o}const i=r[e.type];if(!i){return o}if(!o.formatOptions){o.formatOptions={}}o.constraints={};o.type=i.type;if(!a){o.constraints=Q(i,e)}if((o===null||o===void 0?void 0:(t=o.type)===null||t===void 0?void 0:t.indexOf("sap.ui.model.odata.type.Int"))===0&&(o===null||o===void 0?void 0:o.type)!=="sap.ui.model.odata.type.Int64"||(o===null||o===void 0?void 0:o.type)==="sap.ui.model.odata.type.Double"){o.formatOptions=Object.assign(o.formatOptions,{parseAsString:false})}if(o.type==="sap.ui.model.odata.type.String"){o.formatOptions.parseKeepsEmptyString=true;const n=K(e);if(n){o.formatOptions.fiscalType=n;o.type="sap.fe.core.type.FiscalDate"}}if(o.type==="sap.ui.model.odata.type.Decimal"||(o===null||o===void 0?void 0:o.type)==="sap.ui.model.odata.type.Int64"){o.formatOptions=Object.assign(o.formatOptions,{emptyString:""})}return o}n.formatWithTypeInformation=J;const K=function(e){var n,t,r,a,o,i,s,u,l,p,d,f,c,m,y,v;if((n=e.annotations)!==null&&n!==void 0&&(t=n.Common)!==null&&t!==void 0&&t.IsFiscalYear){return"com.sap.vocabularies.Common.v1.IsFiscalYear"}if((r=e.annotations)!==null&&r!==void 0&&(a=r.Common)!==null&&a!==void 0&&a.IsFiscalPeriod){return"com.sap.vocabularies.Common.v1.IsFiscalPeriod"}if((o=e.annotations)!==null&&o!==void 0&&(i=o.Common)!==null&&i!==void 0&&i.IsFiscalYearPeriod){return"com.sap.vocabularies.Common.v1.IsFiscalYearPeriod"}if((s=e.annotations)!==null&&s!==void 0&&(u=s.Common)!==null&&u!==void 0&&u.IsFiscalQuarter){return"com.sap.vocabularies.Common.v1.IsFiscalQuarter"}if((l=e.annotations)!==null&&l!==void 0&&(p=l.Common)!==null&&p!==void 0&&p.IsFiscalYearQuarter){return"com.sap.vocabularies.Common.v1.IsFiscalYearQuarter"}if((d=e.annotations)!==null&&d!==void 0&&(f=d.Common)!==null&&f!==void 0&&f.IsFiscalWeek){return"com.sap.vocabularies.Common.v1.IsFiscalWeek"}if((c=e.annotations)!==null&&c!==void 0&&(m=c.Common)!==null&&m!==void 0&&m.IsFiscalYearWeek){return"com.sap.vocabularies.Common.v1.IsFiscalYearWeek"}if((y=e.annotations)!==null&&y!==void 0&&(v=y.Common)!==null&&v!==void 0&&v.IsDayOfFiscalYear){return"com.sap.vocabularies.Common.v1.IsDayOfFiscalYear"}};n.getFiscalType=K;function z(e,n,t,r){const o=e.map($);if(i(...o)){return a}if(o.length===1&&E(o[0])&&!t){return o[0]}else if(t){if(!o.some(W)){t.keys.forEach(e=>o.push(y(e.name,"")))}}r=H(e[0],r);if(n==="sap.ui.model.odata.type.Unit"){const e=y("/##@@requestUnitsOfMeasure");e.targetType="any";e.mode="OneTime";o.push(e)}else if(n==="sap.ui.model.odata.type.Currency"){const e=y("/##@@requestCurrencyCodes");e.targetType="any";e.mode="OneTime";o.push(e)}return{_type:"ComplexType",type:n,formatOptions:r||{},parameters:{},bindingParameters:o}}n.addTypeInformation=z;function H(e,n){var t,r;if(!(n&&n.showNumber===false)&&((e===null||e===void 0?void 0:(t=e.type)===null||t===void 0?void 0:t.indexOf("sap.ui.model.odata.type.Int"))===0||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Decimal"||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Double")){if((e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Int64"||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Decimal"){var a;n=((a=n)===null||a===void 0?void 0:a.showMeasure)===false?{emptyString:"",showMeasure:false}:{emptyString:""}}else{var o;n=((o=n)===null||o===void 0?void 0:o.showMeasure)===false?{parseAsString:false,showMeasure:false}:{parseAsString:false}}}if((e===null||e===void 0?void 0:(r=e.constraints)===null||r===void 0?void 0:r.nullable)!==false){var i;(i=n)===null||i===void 0?true:delete i.emptyString}return n}function X(e,n,t){const r=typeof e==="string"?e:e.__functionName;return{_type:"Function",obj:t!==undefined?$(t):undefined,fn:r,parameters:n.map($)}}n.fn=X;function Z(e){const n=[];ne(e,"PathInModel",e=>{n.push(d(L(e,""),L(e,undefined),L(e,null)));return e});return p(...n)}n.isEmpty=Z;function ee(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=n.map($);if(i(...r)){return a}if(r.every(E)){return v(r.reduce((e,n)=>{if(n.value!==undefined){return e+n.value.toString()}return e},""))}else if(r.some(x)){let e=0;const n=R(r,"sap.fe.core.formatters.StandardFormatter#concat",undefined,true);const t=[];ne(n,"PathInModel",n=>{t.push(n);return y(`$${e++}`,"$")});t.unshift(v(JSON.stringify(n)));return R(t,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}return{_type:"Concat",expressions:r}}n.concat=ee;function ne(e,n,t){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let a=e;switch(a._type){case"Function":case"Formatter":a.parameters=a.parameters.map(e=>ne(e,n,t,r));break;case"Concat":a.expressions=a.expressions.map(e=>ne(e,n,t,r));a=ee(...a.expressions);break;case"ComplexType":a.bindingParameters=a.bindingParameters.map(e=>ne(e,n,t,r));break;case"IfElse":const e=ne(a.onTrue,n,t,r);const o=ne(a.onFalse,n,t,r);let i=a.condition;if(r){i=ne(a.condition,n,t,r)}a=Y(i,e,o);break;case"Not":if(r){const e=ne(a.operand,n,t,r);a=f(e)}break;case"Truthy":break;case"Set":if(r){const e=a.operands.map(e=>ne(e,n,t,r));a=a.operator==="||"?d(...e):p(...e)}break;case"Comparison":if(r){const e=ne(a.operand1,n,t,r);const o=ne(a.operand2,n,t,r);a=j(a.operator,e,o)}break;case"Ref":case"Length":case"PathInModel":case"Constant":case"EmbeddedBinding":case"EmbeddedExpressionBinding":case"Unresolvable":break}if(n===a._type){a=t(e)}return a}n.transformRecursively=ne;const te=function(e){return!E(e)&&!_(e)&&b(e)&&e._type!=="IfElse"&&e._type!=="Function"};function re(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(n&&Object.keys(e.value).length===0){return""}const t=e.value;const r=[];Object.keys(t).forEach(e=>{const a=t[e];const o=ue(a,true,false,n);if(o&&o.length>0){r.push(`${e}: ${o}`)}});return`{${r.join(", ")}}`}function ae(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(e.value===null){return r?null:"null"}if(e.value===undefined){return r?undefined:"undefined"}if(typeof e.value==="object"){if(Array.isArray(e.value)){const n=e.value.map(e=>ue(e,true));return`[${n.join(", ")}]`}else{return re(e,t)}}if(n){switch(typeof e.value){case"number":case"bigint":case"boolean":return e.value.toString();case"string":return`'${o(e.value.toString())}'`;default:return""}}else{return r?e.value:e.value.toString()}}n.compileConstant=ae;function oe(e,n,t){if(e.type||e.parameters||e.targetType||e.formatOptions||e.constraints){const r={path:ce(e),type:e.type,targetType:e.targetType,parameters:e.parameters,formatOptions:e.formatOptions,constraints:e.constraints};const a=ue(r,false,false,true);if(n){return`${t}${a}`}return a}else if(n){return`${t}{${ce(e)}}`}else{return`{${ce(e)}}`}}function ie(e){if(e.bindingParameters.length===1){return`{${de(e.bindingParameters[0],true)}, type: '${e.type}'}`}let n=`], type: '${e.type}'`;if(fe(e.formatOptions)){n+=`, formatOptions: ${ue(e.formatOptions)}`}if(fe(e.parameters)){n+=`, parameters: ${ue(e.parameters)}`}n+="}";return`{mode:'TwoWay', parts:[${e.bindingParameters.map(e=>de(e)).join(",")}${n}`}function se(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(n){if(t){return`(${e})`}else{return e}}else{return`{= ${e}}`}}n.wrapBindingExpression=se;function ue(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const a=$(e);const o=t?"$":"%";switch(a._type){case"Unresolvable":return undefined;case"Constant":return ae(a,n,r);case"Ref":return a.ref||"null";case"Function":const e=`${a.parameters.map(e=>ue(e,true)).join(", ")}`;return a.obj===undefined?`${a.fn}(${e})`:`${ue(a.obj,true)}.${a.fn}(${e})`;case"EmbeddedExpressionBinding":return n?`(${a.value.substring(2,a.value.length-1)})`:`${a.value}`;case"EmbeddedBinding":return n?`${o}${a.value}`:`${a.value}`;case"PathInModel":return oe(a,n,o);case"Comparison":const t=le(a);return se(t,n);case"IfElse":const i=`${ue(a.condition,true)} ? ${ue(a.onTrue,true)} : ${ue(a.onFalse,true)}`;return se(i,n,true);case"Set":const s=a.operands.map(e=>ue(e,true)).join(` ${a.operator} `);return se(s,n,true);case"Concat":const u=a.expressions.map(e=>ue(e,true,true)).join(" + ");return se(u,n);case"Length":const l=`${ue(a.pathInModel,true)}.length`;return se(l,n);case"Not":const p=`!${ue(a.operand,true)}`;return se(p,n);case"Truthy":const d=`!!${ue(a.operand,true)}`;return se(d,n);case"Formatter":const f=pe(a);return n?`$${f}`:f;case"ComplexType":const c=ie(a);return n?`$${c}`:c;default:return""}}n.compileExpression=ue;function le(e){function n(e){const n=ue(e,true)??"undefined";return se(n,true,te(e))}return`${n(e.operand1)} ${e.operator} ${n(e.operand2)}`}function pe(e){if(e.parameters.length===1){return`{${de(e.parameters[0],true)}, formatter: '${e.fn}'}`}else{const n=e.parameters.map(e=>{if(e._type==="ComplexType"){return ie(e)}else{return de(e)}});return`{parts: [${n.join(", ")}], formatter: '${e.fn}'}`}}function de(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let t="";if(e._type==="Constant"){if(e.value===undefined){t=`value: 'undefined'`}else{t=`value: ${ae(e,true)}`}}else if(e._type==="PathInModel"){t=`path: '${ce(e)}'`;t+=e.type?`, type: '${e.type}'`:`, targetType: 'any'`;if(fe(e.mode)){t+=`, mode: '${ue(e.mode)}'`}if(fe(e.constraints)){t+=`, constraints: ${ue(e.constraints)}`}if(fe(e.formatOptions)){t+=`, formatOptions: ${ue(e.formatOptions)}`}if(fe(e.parameters)){t+=`, parameters: ${ue(e.parameters)}`}}else{return""}return n?t:`{${t}}`}function fe(e){return e&&Object.keys(e).length>0}function ce(e){return`${e.modelName?`${e.modelName}>`:""}${e.path}`}return n},false);
|
|
580
|
+
sap.ui.predefine("sap/fe/core/helpers/BindingToolkit", ["sap/fe/core/helpers/TypeGuards","./AnnotationEnum"],function(e,n){"use strict";var t={};var r=n.resolveEnumValue;var a=e.isProperty;const o={"Edm.Boolean":{type:"sap.ui.model.odata.type.Boolean"},"Edm.Byte":{type:"sap.ui.model.odata.type.Byte"},"Edm.Date":{type:"sap.ui.model.odata.type.Date"},"Edm.DateTimeOffset":{constraints:{$Precision:"precision",$V4:"V4"},type:"sap.ui.model.odata.type.DateTimeOffset"},"Edm.Decimal":{constraints:{"@Org.OData.Validation.V1.Minimum/$Decimal":"minimum","@Org.OData.Validation.V1.Minimum@Org.OData.Validation.V1.Exclusive":"minimumExclusive","@Org.OData.Validation.V1.Maximum/$Decimal":"maximum","@Org.OData.Validation.V1.Maximum@Org.OData.Validation.V1.Exclusive":"maximumExclusive",$Precision:"precision",$Scale:"scale"},type:"sap.ui.model.odata.type.Decimal"},"Edm.Double":{type:"sap.ui.model.odata.type.Double"},"Edm.Guid":{type:"sap.ui.model.odata.type.Guid"},"Edm.Int16":{type:"sap.ui.model.odata.type.Int16"},"Edm.Int32":{type:"sap.ui.model.odata.type.Int32"},"Edm.Int64":{type:"sap.ui.model.odata.type.Int64"},"Edm.SByte":{type:"sap.ui.model.odata.type.SByte"},"Edm.Single":{type:"sap.ui.model.odata.type.Single"},"Edm.Stream":{type:"sap.ui.model.odata.type.Stream"},"Edm.Binary":{type:"sap.ui.model.odata.type.Stream"},"Edm.String":{constraints:{"@com.sap.vocabularies.Common.v1.IsDigitSequence":"isDigitSequence",$MaxLength:"maxLength",$Nullable:"nullable"},type:"sap.ui.model.odata.type.String"},"Edm.TimeOfDay":{constraints:{$Precision:"precision"},type:"sap.ui.model.odata.type.TimeOfDay"}};t.EDM_TYPE_MAPPING=o;const i={_type:"Unresolvable"};t.unresolvableExpression=i;function s(e){return e.replace(/'/g,"\\'")}function u(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}return n.find(e=>e._type==="Unresolvable")!==undefined}t.hasUnresolvableExpression=u;function l(e,n){if(e._type!==n._type){return false}switch(e._type){case"Unresolvable":return false;case"Constant":case"EmbeddedBinding":case"EmbeddedExpressionBinding":return e.value===n.value;case"Not":return l(e.operand,n.operand);case"Truthy":return l(e.operand,n.operand);case"Set":return e.operator===n.operator&&e.operands.length===n.operands.length&&e.operands.every(e=>n.operands.some(n=>l(e,n)));case"IfElse":return l(e.condition,n.condition)&&l(e.onTrue,n.onTrue)&&l(e.onFalse,n.onFalse);case"Comparison":return e.operator===n.operator&&l(e.operand1,n.operand1)&&l(e.operand2,n.operand2);case"Concat":const t=e.expressions;const r=n.expressions;if(t.length!==r.length){return false}return t.every((e,n)=>l(e,r[n]));case"Length":return l(e.pathInModel,n.pathInModel);case"PathInModel":return e.modelName===n.modelName&&e.path===n.path&&e.targetEntitySet===n.targetEntitySet;case"Formatter":return e.fn===n.fn&&e.parameters.length===n.parameters.length&&e.parameters.every((e,t)=>l(n.parameters[t],e));case"ComplexType":return e.type===n.type&&e.bindingParameters.length===n.bindingParameters.length&&e.bindingParameters.every((e,t)=>l(n.bindingParameters[t],e));case"Function":const a=n;if(e.obj===undefined||a.obj===undefined){return e.obj===a}return e.fn===a.fn&&l(e.obj,a.obj)&&e.parameters.length===a.parameters.length&&e.parameters.every((e,n)=>l(a.parameters[n],e));case"Ref":return e.ref===n.ref}return false}t._checkExpressionsAreEqual=l;function d(e){return e.operands.reduce((n,t)=>{const r=t._type==="Set"&&t.operator===e.operator?t.operands:[t];r.forEach(e=>{if(n.operands.every(n=>!l(n,e))){n.operands.push(e)}});return n},{_type:"Set",operator:e.operator,operands:[]})}function p(e){const n=e.map(m);return e.some((e,t)=>{for(let r=t+1;r<n.length;r++){if(l(e,n[r])){return true}}return false})}function f(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=d({_type:"Set",operator:"&&",operands:n.map(E)}).operands;if(u(...r)){return i}let a=false;const o=r.filter(e=>{if(x(e)){a=true}return!I(e)});if(a){return g(false)}else if(o.length===0){const e=r.reduce((e,n)=>e&&_(n),true);return g(e)}else if(o.length===1){return o[0]}else if(p(o)){return g(false)}else{return{_type:"Set",operator:"&&",operands:o}}}t.and=f;function c(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=d({_type:"Set",operator:"||",operands:n.map(E)}).operands;if(u(...r)){return i}let a=false;const o=r.filter(e=>{if(_(e)){a=true}return!I(e)||e.value});if(a){return g(true)}else if(o.length===0){const e=r.reduce((e,n)=>e&&_(n),true);return g(e)}else if(o.length===1){return o[0]}else if(p(o)){return g(true)}else{return{_type:"Set",operator:"||",operands:o}}}t.or=c;function m(e){e=E(e);if(u(e)){return i}else if(I(e)){return g(!e.value)}else if(typeof e==="object"&&e._type==="Set"&&e.operator==="||"&&e.operands.every(e=>I(e)||S(e))){return f(...e.operands.map(e=>m(e)))}else if(typeof e==="object"&&e._type==="Set"&&e.operator==="&&"&&e.operands.every(e=>I(e)||S(e))){return c(...e.operands.map(e=>m(e)))}else if(S(e)){switch(e.operator){case"!==":return{...e,operator:"==="};case"<":return{...e,operator:">="};case"<=":return{...e,operator:">"};case"===":return{...e,operator:"!=="};case">":return{...e,operator:"<="};case">=":return{...e,operator:"<"}}}else if(e._type==="Not"){return e.operand}return{_type:"Not",operand:e}}t.not=m;function y(e){if(I(e)){return g(!!e.value)}else{return{_type:"Truthy",operand:e}}}t.isTruthy=y;function v(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let r=arguments.length>3?arguments[3]:undefined;return h(e,n,t,r)}t.bindingExpression=v;function h(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];let r=arguments.length>3?arguments[3]:undefined;if(e===undefined){return i}let a;if(r){a=r(e);if(a===undefined){return i}}else{const n=t.concat();n.push(e);a=n.join("/")}return{_type:"PathInModel",modelName:n,path:a}}t.pathInModel=h;function g(e){let n;if(typeof e==="object"&&e!==null&&e!==undefined){if(Array.isArray(e)){n=e.map(E)}else if(N(e)){n=e.valueOf()}else{n=Object.entries(e).reduce((e,n)=>{let[t,r]=n;const a=E(r);if(a._type!=="Constant"||a.value!==undefined){e[t]=a}return e},{})}}else{n=e}return{_type:"Constant",value:n}}t.constant=g;function $(e,n){if(e!==undefined&&typeof e==="string"&&e.startsWith("{")){const n=/^{(.*)>(.+)}$/;const t=n.exec(e);if(e.startsWith("{=")){return{_type:"EmbeddedExpressionBinding",value:e}}else if(t){return h(t[2]||"",t[1]||undefined)}else{return{_type:"EmbeddedBinding",value:e}}}else if(n==="boolean"&&typeof e==="string"&&(e==="true"||e==="false")){return g(e==="true")}else if(n==="number"&&typeof e==="string"&&(!isNaN(Number(e))||e==="NaN")){return g(Number(e))}else{return g(e)}}t.resolveBindingString=$;function b(e){return{_type:"Ref",ref:e}}t.ref=b;function E(e){if(O(e)){return e}return g(e)}function O(e){return(e===null||e===void 0?void 0:e._type)!==undefined}t.isBindingToolkitExpression=O;function I(e){return typeof e!=="object"||e._type==="Constant"}t.isConstant=I;function _(e){return I(e)&&e.value===true}function x(e){return I(e)&&e.value===false}function C(e){return(e===null||e===void 0?void 0:e._type)==="PathInModel"}t.isPathInModelExpression=C;function P(e){return(e===null||e===void 0?void 0:e._type)==="ComplexType"}t.isComplexTypeExpression=P;function F(e){return(e===null||e===void 0?void 0:e._type)==="Concat"}function S(e){return e._type==="Comparison"}function T(e){const n=e;return(n===null||n===void 0?void 0:n._type)==="Constant"&&(n===null||n===void 0?void 0:n.value)===undefined}t.isUndefinedExpression=T;function N(e){switch(e.constructor.name){case"String":case"Number":case"Boolean":return true;default:return false}}function M(e){return typeof e==="object"&&!N(e)}function w(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;let r=arguments.length>3?arguments[3]:undefined;return D(e,n,t,r)}t.annotationExpression=w;function D(e){var n;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let r=arguments.length>2?arguments[2]:undefined;let a=arguments.length>3?arguments[3]:undefined;if(e===undefined){return E(r)}e=(n=e)===null||n===void 0?void 0:n.valueOf();if(!M(e)){return g(e)}switch(e.type){case"Path":return h(e.path,undefined,t,a);case"If":return j(e.If,t,a);case"Not":return m(A(e.Not,t,a));case"Eq":return q(A(e.Eq[0],t,a),A(e.Eq[1],t,a));case"Ne":return G(A(e.Ne[0],t,a),A(e.Ne[1],t,a));case"Gt":return Y(A(e.Gt[0],t,a),A(e.Gt[1],t,a));case"Ge":return U(A(e.Ge[0],t,a),A(e.Ge[1],t,a));case"Lt":return R(A(e.Lt[0],t,a),A(e.Lt[1],t,a));case"Le":return W(A(e.Le[0],t,a),A(e.Le[1],t,a));case"Or":return c(...e.Or.map(function(e){return A(e,t,a)}));case"And":return f(...e.And.map(function(e){return A(e,t,a)}));case"Apply":return L(e,t,a)}return i}t.getExpressionFromAnnotation=D;function A(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;if(e===null||typeof e!=="object"){return g(e)}else if(e.hasOwnProperty("$Or")){return c(...e.$Or.map(function(e){return A(e,n,t)}))}else if(e.hasOwnProperty("$And")){return f(...e.$And.map(function(e){return A(e,n,t)}))}else if(e.hasOwnProperty("$Not")){return m(A(e.$Not,n,t))}else if(e.hasOwnProperty("$Eq")){return q(A(e.$Eq[0],n,t),A(e.$Eq[1],n,t))}else if(e.hasOwnProperty("$Ne")){return G(A(e.$Ne[0],n,t),A(e.$Ne[1],n,t))}else if(e.hasOwnProperty("$Gt")){return Y(A(e.$Gt[0],n,t),A(e.$Gt[1],n,t))}else if(e.hasOwnProperty("$Ge")){return U(A(e.$Ge[0],n,t),A(e.$Ge[1],n,t))}else if(e.hasOwnProperty("$Lt")){return R(A(e.$Lt[0],n,t),A(e.$Lt[1],n,t))}else if(e.hasOwnProperty("$Le")){return W(A(e.$Le[0],n,t),A(e.$Le[1],n,t))}else if(e.hasOwnProperty("$Path")){return h(e.$Path,undefined,n,t)}else if(e.hasOwnProperty("$Apply")){return D({type:"Apply",Function:e.$Function,Apply:e.$Apply},n,undefined,t)}else if(e.hasOwnProperty("$If")){return D({type:"If",If:e.$If},n,undefined,t)}else if(e.hasOwnProperty("$EnumMember")){return g(r(e.$EnumMember))}return g(false)}function j(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;return Q(A(e[0],n,t),A(e[1],n,t),A(e[2],n,t))}t.annotationIfExpression=j;function V(e){let n=e;if(e.hasOwnProperty("$Path")){n={type:"Path",path:e.$Path}}else if(e.hasOwnProperty("$If")){n={type:"If",If:e.$If}}else if(e.hasOwnProperty("$Apply")){n={type:"Apply",Function:e.$Function,Apply:e.$Apply}}return n}function L(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let t=arguments.length>2?arguments[2]:undefined;switch(e.Function){case"odata.concat":return re(...e.Apply.map(e=>D(V(e),n,undefined,t)));case"odata.uriEncode":const r=D(V(e.Apply[0]),n,undefined,t);return ne("odata.uriEncode",[r,"Edm.String"],undefined,true);case"odata.fillUriTemplate":const a=e.Apply[0];const o=e.Apply.slice(1);const i={};o.forEach(e=>{i[e.$Name]=D(V(e.$LabeledElement),n,undefined,t)});return ne("odata.fillUriTemplate",[a,i],undefined,true)}return i}t.annotationApplyExpression=L;function k(e,n,t){const r=E(n);const a=E(t);if(u(r,a)){return i}if(I(r)&&I(a)){switch(e){case"!==":return g(r.value!==a.value);case"===":return g(r.value===a.value);case"<":return g(r.value<a.value);case"<=":return g(r.value<=a.value);case">":return g(r.value>a.value);case">=":return g(r.value>=a.value)}}else{return{_type:"Comparison",operator:e,operand1:r,operand2:a}}}function B(e){if(e._type==="Unresolvable"){return e}return{_type:"Length",pathInModel:e}}t.length=B;function q(e,n){const t=E(e);const r=E(n);if(u(t,r)){return i}if(l(t,r)){return g(true)}function a(e,n){if(e._type==="Comparison"&&_(n)){return e}else if(e._type==="Comparison"&&x(n)){return m(e)}else if(e._type==="IfElse"&&l(e.onTrue,n)){return c(e.condition,q(e.onFalse,n))}else if(e._type==="IfElse"&&l(e.onFalse,n)){return c(m(e.condition),q(e.onTrue,n))}else if(e._type==="IfElse"&&I(e.onTrue)&&I(e.onFalse)&&I(n)&&!l(e.onTrue,n)&&!l(e.onFalse,n)){return g(false)}return undefined}const o=a(t,r)??a(r,t);return o??k("===",t,r)}t.equal=q;function G(e,n){return m(q(e,n))}t.notEqual=G;function U(e,n){return k(">=",e,n)}t.greaterOrEqual=U;function Y(e,n){return k(">",e,n)}t.greaterThan=Y;function W(e,n){return k("<=",e,n)}t.lessOrEqual=W;function R(e,n){return k("<",e,n)}t.lessThan=R;function Q(e,n,t){let r=E(e);let a=E(n);let o=E(t);if(u(r,a,o)){return i}if(r._type==="Not"){[a,o]=[o,a];r=m(r)}if(a._type==="IfElse"&&l(r,a.condition)){a=a.onTrue}if(o._type==="IfElse"&&l(r,o.condition)){o=o.onFalse}if(I(r)){return r.value?a:o}if(l(a,o)){return a}if(x(o)){return f(r,a)}if(_(o)){return c(m(r),a)}if(x(a)){return f(m(r),o)}if(_(a)){return c(r,o)}if(P(e)||P(n)||P(t)){let r=0;const a=K([e,n,t],"sap.fe.core.formatters.StandardFormatter#ifElse");const o=[];ae(a,"PathInModel",e=>{o.push(e);return h(`$${r++}`,"$")},true);o.unshift(g(JSON.stringify(a)));return K(o,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}return{_type:"IfElse",condition:r,onTrue:a,onFalse:o}}t.ifElse=Q;function J(e){switch(e._type){case"Constant":case"Formatter":case"ComplexType":return false;case"Set":return e.operands.some(J);case"PathInModel":return e.modelName===undefined;case"Comparison":return J(e.operand1)||J(e.operand2);case"IfElse":return J(e.condition)||J(e.onTrue)||J(e.onFalse);case"Not":case"Truthy":return J(e.operand);default:return false}}function K(e,n,t){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const a=e.map(E);if(u(...a)){return i}if(t){if(!a.some(J)){t.keys.forEach(e=>a.push(h(e.name,"")))}}let o="";if(typeof n==="string"){o=n}else{o=n.__functionName}const[s,l]=o.split("#");if(!r&&(a.some(P)||a.some(F))){let e=0;const n=K(a,o,undefined,true);const t=[];ae(n,"PathInModel",n=>{t.push(n);return h(`$${e++}`,"$")});t.unshift(g(JSON.stringify(n)));return K(t,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}else if(!!l&&l.length>0){a.unshift(g(l))}return{_type:"Formatter",fn:s,parameters:a}}t.formatResult=K;function z(e,n){var t,r,a,o,i,s,u,l,d,p,f,c,m;const y={};if(e!==null&&e!==void 0&&(t=e.constraints)!==null&&t!==void 0&&t.$Scale&&n.scale!==undefined){y.scale=n.scale}if(e!==null&&e!==void 0&&(r=e.constraints)!==null&&r!==void 0&&r.$Precision&&n.precision!==undefined){y.precision=n.precision}if(e!==null&&e!==void 0&&(a=e.constraints)!==null&&a!==void 0&&a.$MaxLength&&n.maxLength!==undefined){y.maxLength=n.maxLength}if(n.nullable===false){y.nullable=false}if(e!==null&&e!==void 0&&(o=e.constraints)!==null&&o!==void 0&&o["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((i=n.annotations)===null||i===void 0?void 0:(s=i.Validation)===null||s===void 0?void 0:s.Minimum)){var v,h;y.minimum=`${(v=n.annotations)===null||v===void 0?void 0:(h=v.Validation)===null||h===void 0?void 0:h.Minimum}`}if(e!==null&&e!==void 0&&(u=e.constraints)!==null&&u!==void 0&&u["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((l=n.annotations)===null||l===void 0?void 0:(d=l.Validation)===null||d===void 0?void 0:d.Maximum)){var g,$;y.maximum=`${(g=n.annotations)===null||g===void 0?void 0:($=g.Validation)===null||$===void 0?void 0:$.Maximum}`}if((p=n.annotations)!==null&&p!==void 0&&(f=p.Common)!==null&&f!==void 0&&f.IsDigitSequence&&e.type==="sap.ui.model.odata.type.String"&&e!==null&&e!==void 0&&(c=e.constraints)!==null&&c!==void 0&&c["@com.sap.vocabularies.Common.v1.IsDigitSequence"]){y.isDigitSequence=true}if(e!==null&&e!==void 0&&(m=e.constraints)!==null&&m!==void 0&&m.$V4){y.V4=true}return y}t.setUpConstraints=z;function H(e,n){var t;let r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;const i=n;if(e._type!=="Property"&&e._type!=="ActionParameter"){return i}const s=o[e.type];if(!s){return i}if(!i.formatOptions){i.formatOptions={}}i.constraints={};i.type=s.type;if(!r){i.constraints=z(s,e)}if((i===null||i===void 0?void 0:(t=i.type)===null||t===void 0?void 0:t.indexOf("sap.ui.model.odata.type.Int"))===0&&(i===null||i===void 0?void 0:i.type)!=="sap.ui.model.odata.type.Int64"||(i===null||i===void 0?void 0:i.type)==="sap.ui.model.odata.type.Double"){i.formatOptions=Object.assign(i.formatOptions,{parseAsString:false})}if(i.type==="sap.ui.model.odata.type.String"&&a(e)){i.formatOptions.parseKeepsEmptyString=true;const n=X(e);if(n){i.formatOptions.fiscalType=n;i.type="sap.fe.core.type.FiscalDate"}}if(i.type==="sap.ui.model.odata.type.Decimal"||(i===null||i===void 0?void 0:i.type)==="sap.ui.model.odata.type.Int64"){i.formatOptions=Object.assign(i.formatOptions,{emptyString:""})}return i}t.formatWithTypeInformation=H;const X=function(e){var n,t,r,a,o,i,s,u,l,d,p,f,c,m,y,v;if((n=e.annotations)!==null&&n!==void 0&&(t=n.Common)!==null&&t!==void 0&&t.IsFiscalYear){return"com.sap.vocabularies.Common.v1.IsFiscalYear"}if((r=e.annotations)!==null&&r!==void 0&&(a=r.Common)!==null&&a!==void 0&&a.IsFiscalPeriod){return"com.sap.vocabularies.Common.v1.IsFiscalPeriod"}if((o=e.annotations)!==null&&o!==void 0&&(i=o.Common)!==null&&i!==void 0&&i.IsFiscalYearPeriod){return"com.sap.vocabularies.Common.v1.IsFiscalYearPeriod"}if((s=e.annotations)!==null&&s!==void 0&&(u=s.Common)!==null&&u!==void 0&&u.IsFiscalQuarter){return"com.sap.vocabularies.Common.v1.IsFiscalQuarter"}if((l=e.annotations)!==null&&l!==void 0&&(d=l.Common)!==null&&d!==void 0&&d.IsFiscalYearQuarter){return"com.sap.vocabularies.Common.v1.IsFiscalYearQuarter"}if((p=e.annotations)!==null&&p!==void 0&&(f=p.Common)!==null&&f!==void 0&&f.IsFiscalWeek){return"com.sap.vocabularies.Common.v1.IsFiscalWeek"}if((c=e.annotations)!==null&&c!==void 0&&(m=c.Common)!==null&&m!==void 0&&m.IsFiscalYearWeek){return"com.sap.vocabularies.Common.v1.IsFiscalYearWeek"}if((y=e.annotations)!==null&&y!==void 0&&(v=y.Common)!==null&&v!==void 0&&v.IsDayOfFiscalYear){return"com.sap.vocabularies.Common.v1.IsDayOfFiscalYear"}};t.getFiscalType=X;function Z(e,n,t,r){const a=e.map(E);if(u(...a)){return i}if(a.length===1&&I(a[0])&&!t){return a[0]}else if(t){if(!a.some(J)){t.keys.forEach(e=>a.push(h(e.name,"")))}}r=ee(e[0],r);if(n==="sap.ui.model.odata.type.Unit"){const e=h("/##@@requestUnitsOfMeasure");e.targetType="any";e.mode="OneTime";a.push(e)}else if(n==="sap.ui.model.odata.type.Currency"){const e=h("/##@@requestCurrencyCodes");e.targetType="any";e.mode="OneTime";a.push(e)}return{_type:"ComplexType",type:n,formatOptions:r||{},parameters:{},bindingParameters:a}}t.addTypeInformation=Z;function ee(e,n){var t,r;if(!(n&&n.showNumber===false)&&((e===null||e===void 0?void 0:(t=e.type)===null||t===void 0?void 0:t.indexOf("sap.ui.model.odata.type.Int"))===0||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Decimal"||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Double")){if((e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Int64"||(e===null||e===void 0?void 0:e.type)==="sap.ui.model.odata.type.Decimal"){var a;n=((a=n)===null||a===void 0?void 0:a.showMeasure)===false?{emptyString:"",showMeasure:false}:{emptyString:""}}else{var o;n=((o=n)===null||o===void 0?void 0:o.showMeasure)===false?{parseAsString:false,showMeasure:false}:{parseAsString:false}}}if((e===null||e===void 0?void 0:(r=e.constraints)===null||r===void 0?void 0:r.nullable)!==false){var i;(i=n)===null||i===void 0?true:delete i.emptyString}return n}function ne(e,n,t){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const a=typeof e==="string"?e:e.__functionName;return{_type:"Function",obj:t!==undefined?E(t):undefined,fn:a,isFormattingFn:r,parameters:n.map(E)}}t.fn=ne;function te(e){const n=[];ae(e,"PathInModel",e=>{n.push(c(q(e,""),q(e,undefined),q(e,null)));return e});return f(...n)}t.isEmpty=te;function re(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}const r=n.map(E);if(u(...r)){return i}if(r.every(I)){return g(r.reduce((e,n)=>{if(n.value!==undefined){return e+n.value.toString()}return e},""))}else if(r.some(P)){let e=0;const n=K(r,"sap.fe.core.formatters.StandardFormatter#concat",undefined,true);const t=[];ae(n,"PathInModel",n=>{t.push(n);return h(`$${e++}`,"$")});t.unshift(g(JSON.stringify(n)));return K(t,"sap.fe.core.formatters.StandardFormatter#evaluateComplexExpression",undefined,true)}return{_type:"Concat",expressions:r}}t.concat=re;function ae(e,n,t){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let a=e;switch(a._type){case"Function":case"Formatter":a.parameters=a.parameters.map(e=>ae(e,n,t,r));break;case"Concat":a.expressions=a.expressions.map(e=>ae(e,n,t,r));a=re(...a.expressions);break;case"ComplexType":a.bindingParameters=a.bindingParameters.map(e=>ae(e,n,t,r));break;case"IfElse":const e=ae(a.onTrue,n,t,r);const o=ae(a.onFalse,n,t,r);let i=a.condition;if(r){i=ae(a.condition,n,t,r)}a=Q(i,e,o);break;case"Not":if(r){const e=ae(a.operand,n,t,r);a=m(e)}break;case"Truthy":break;case"Set":if(r){const e=a.operands.map(e=>ae(e,n,t,r));a=a.operator==="||"?c(...e):f(...e)}break;case"Comparison":if(r){const e=ae(a.operand1,n,t,r);const o=ae(a.operand2,n,t,r);a=k(a.operator,e,o)}break;case"Constant":const s=a.value;if(typeof s==="object"&&s){Object.keys(s).forEach(e=>{s[e]=ae(s[e],n,t,r)})}break;case"Ref":case"Length":case"PathInModel":case"EmbeddedBinding":case"EmbeddedExpressionBinding":case"Unresolvable":break}if(n===a._type){a=t(e)}return a}t.transformRecursively=ae;const oe=function(e){return!I(e)&&!C(e)&&O(e)&&e._type!=="IfElse"&&e._type!=="Function"};function ie(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(n&&Object.keys(e.value).length===0){return""}const t=e.value;const r=[];Object.keys(t).forEach(e=>{const a=t[e];const o=pe(a,true,false,n);if(o&&o.length>0){r.push(`${e}: ${o}`)}});return`{${r.join(", ")}}`}function se(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(e.value===null){return r?null:"null"}if(e.value===undefined){return r?undefined:"undefined"}if(typeof e.value==="object"){if(Array.isArray(e.value)){const n=e.value.map(e=>pe(e,true));return`[${n.join(", ")}]`}else{return ie(e,t)}}if(n){switch(typeof e.value){case"number":case"bigint":case"boolean":return e.value.toString();case"string":return`'${s(e.value.toString())}'`;default:return""}}else{return r?e.value:e.value.toString()}}t.compileConstant=se;function ue(e,n,t){if(e.type||e.parameters||e.targetType||e.formatOptions||e.constraints){const r={path:ve(e),type:e.type,targetType:e.targetType,parameters:e.parameters,formatOptions:e.formatOptions,constraints:e.constraints};const a=pe(r,false,false,true);if(n){return`${t}${a}`}return a}else if(n){return`${t}{${ve(e)}}`}else{return`{${ve(e)}}`}}function le(e){if(e.bindingParameters.length===1){return`{${me(e.bindingParameters[0],true)}, type: '${e.type}'}`}let n=`], type: '${e.type}'`;if(ye(e.formatOptions)){n+=`, formatOptions: ${pe(e.formatOptions)}`}if(ye(e.parameters)){n+=`, parameters: ${pe(e.parameters)}`}n+="}";return`{mode:'TwoWay', parts:[${e.bindingParameters.map(e=>me(e)).join(",")}${n}`}function de(e,n){let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(n){if(t){return`(${e})`}else{return e}}else{return`{= ${e}}`}}t.wrapBindingExpression=de;function pe(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;const a=E(e);const o=t?"$":"%";switch(a._type){case"Unresolvable":return undefined;case"Constant":return se(a,n,r);case"Ref":return a.ref||"null";case"Function":let e=false;if(a.isFormattingFn){ae(a,"Function",n=>{if(n!==a&&n.obj===undefined){e=true}return n},true);ae(a,"Constant",n=>{if(n!==a&&typeof n.value==="object"){ae(n,"PathInModel",n=>{e=true;return n})}return n},true)}const i=`${a.parameters.map(e=>pe(e,true)).join(", ")}`;let s=a.obj===undefined?`${a.fn}(${i})`:`${pe(a.obj,true)}.${a.fn}(${i})`;if(!n&&e){s=`{= ${s}}`}return s;case"EmbeddedExpressionBinding":return n?`(${a.value.substring(2,a.value.length-1)})`:`${a.value}`;case"EmbeddedBinding":return n?`${o}${a.value}`:`${a.value}`;case"PathInModel":return ue(a,n,o);case"Comparison":const u=fe(a);return de(u,n);case"IfElse":const l=`${pe(a.condition,true)} ? ${pe(a.onTrue,true,t)} : ${pe(a.onFalse,true,t)}`;return de(l,n,true);case"Set":const d=a.operands.map(e=>pe(e,true)).join(` ${a.operator} `);return de(d,n,true);case"Concat":const p=a.expressions.map(e=>pe(e,true,true)).join(" + ");return de(p,n);case"Length":const f=`${pe(a.pathInModel,true)}.length`;return de(f,n);case"Not":const c=`!${pe(a.operand,true)}`;return de(c,n);case"Truthy":const m=`!!${pe(a.operand,true)}`;return de(m,n);case"Formatter":const y=ce(a);return n?`$${y}`:y;case"ComplexType":const v=le(a);return n?`$${v}`:v;default:return""}}t.compileExpression=pe;function fe(e){function n(e){const n=pe(e,true)??"undefined";return de(n,true,oe(e))}return`${n(e.operand1)} ${e.operator} ${n(e.operand2)}`}function ce(e){if(e.parameters.length===1){return`{${me(e.parameters[0],true)}, formatter: '${e.fn}'}`}else{const n=e.parameters.map(e=>{if(e._type==="ComplexType"){return le(e)}else{return me(e)}});return`{parts: [${n.join(", ")}], formatter: '${e.fn}'}`}}function me(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let t="";if(e._type==="Constant"){if(e.value===undefined){t=`value: 'undefined'`}else{t=`value: ${se(e,true)}`}}else if(e._type==="PathInModel"){t=`path: '${ve(e)}'`;t+=e.type?`, type: '${e.type}'`:`, targetType: 'any'`;if(ye(e.mode)){t+=`, mode: '${pe(e.mode)}'`}if(ye(e.constraints)){t+=`, constraints: ${pe(e.constraints)}`}if(ye(e.formatOptions)){t+=`, formatOptions: ${pe(e.formatOptions)}`}if(ye(e.parameters)){t+=`, parameters: ${pe(e.parameters)}`}}else{return""}return n?t:`{${t}}`}function ye(e){return e&&Object.keys(e).length>0}function ve(e){return`${e.modelName?`${e.modelName}>`:""}${e.path}`}return t},false);
|
|
571
581
|
/*!
|
|
572
582
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
573
583
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -577,7 +587,7 @@ sap.ui.predefine("sap/fe/core/helpers/ClassSupport", ["sap/base/util/merge","sap
|
|
|
577
587
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
578
588
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
579
589
|
*/
|
|
580
|
-
sap.ui.predefine("sap/fe/core/helpers/DeleteHelper", ["sap/base/Log","sap/fe/core/controllerextensions/editFlow/draft","sap/m/CheckBox","sap/m/MessageToast","sap/m/Text"],function(e,t,n,o,s){"use strict";var l={};let i;(function(e){e["deletableContexts"]="deletableContexts";e["draftsWithDeletableActive"]="draftsWithDeletableActive";e["createModeContexts"]="createModeContexts";e["unSavedContexts"]="unSavedContexts";e["draftsWithNonDeletableActive"]="draftsWithNonDeletableActive";e["draftsToDeleteBeforeActive"]="draftsToDeleteBeforeActive"})(i||(i={}));l.DeleteOptionTypes=i;let E;(function(e){e["CHECKBOX"]="checkBox";e["TEXT"]="text"})(E||(E={}));l.DeleteDialogContentControl=E;function r(e,t,n,o){o.forEach(e=>{const t=n.indexOf(e);if(t!==-1){n.splice(t,1)}});e.setProperty(t,[]);return[...n]}function a(e,t){let n=e.getProperty("selectedContexts")||[];if(t.type===i.deletableContexts){n=r(e,i.deletableContexts,n,e.getProperty(i.deletableContexts)||[]);n=r(e,i.createModeContexts,n,e.getProperty(i.createModeContexts)||[]);const t=e.getProperty(i.draftsWithDeletableActive)||[];const o=t.map(e=>e.draft);n=r(e,i.draftsWithDeletableActive,n,o)}else{const o=e.getProperty(t.type)||[];n=r(e,t.type,n,o)}e.setProperty("selectedContexts",n);e.setProperty("numberOfSelectedContexts",n.length)}function _(e,t,n,s){const{internalModelContext:l,entitySetName:i}=e;if(l){if(l.getProperty("deleteEnabled")!=undefined){t.forEach(e=>{if(e.selected){a(l,e)}})}l.setProperty("deleteEnabled",t.some(e=>!e.selected))}if(n.length===1){o.show(s.getText("C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR",undefined,i))}else{o.show(s.getText("C_TRANSACTION_HELPER_DELETE_TOAST_PLURAL",undefined,i))}}function T(e){const t=e.getObject()["DraftAdministrativeData"];return t&&t["InProcessByUser"]||""}function c(e,t,n){let o="";if(t===1&&n.length===1){const t=T(n[0]);o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",[t])}else if(n.length==1){const s=T(n[0]);o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_LOCKED",[t,s])}else if(n.length>1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_LOCKED",[n.length,t])}return o}function f(e,t,n){let o="";if(n===t){if(t===1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_ONLY_DRAFT_OF_NON_DELETABLE_ACTIVE")}else{o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_ONLY_DRAFTS_OF_NON_DELETABLE_ACTIVE")}}else if(t===1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_DRAFT_OF_NON_DELETABLE_ACTIVE")}else{o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_DRAFTS_OF_NON_DELETABLE_ACTIVE")}return o}function C(e){const t=e.getObject()["DraftAdministrativeData"];let n="";if(t){n=t["LastChangedByUserDescription"]||t["LastChangedByUser"]||""}return n}function N(e,t,n,o){let s="",l="",i=false;if(t===1&&n.length===1){const t=C(n[0]);s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES",[t]);i=true}else if(t===n.length){s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES_MULTIPLE_OBJECTS");i=true}else if(o===n.length){if(n.length===1){const t=C(n[0]);s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_SINGULAR",[t])}else{s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_PLURAL")}i=true}else if(o>n.length){if(n.length===1){const t=C(n[0]);l=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_SINGULAR",[t])}else{l=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_PLURAL")}}return{infoTxt:s,optionTxt:l,optionWithoutTxt:i}}function A(e,t,n){const{numberOfSelectedContexts:o,lockedContexts:l=[],draftsWithNonDeletableActive:i=[]}=e;const E=o-(l.length+t-i.length);let r="";if(E>0&&(t===0||i.length===t)){if(l.length>0){if(E===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_ALL_REMAINING_NON_DELETABLE_SINGULAR")}else{r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_ALL_REMAINING_NON_DELETABLE_PLURAL")}}else if(E===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_AND_ONE_OBJECT_NON_DELETABLE")}else{r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_MULTIPLE_AND_ALL_OBJECT_NON_DELETABLE")}}else if(E===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_NON_DELETABLE",[o])}else if(E>1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",[E,o])}return r?new s({text:r}):undefined}function d(e,t){return t.reduce((e,t)=>t.selected&&t.type!==i.draftsToDeleteBeforeActive?e.concat(t.contexts):e,e)}function D(e){const t=[];return e.reduce((e,t)=>t.selected&&t.type===i.draftsToDeleteBeforeActive?e.concat(t.contexts):e,t)}function g(e,t,n,o,l,r){const{numberOfSelectedContexts:a,draftsWithDeletableActive:_,unSavedContexts:T,createModeContexts:c,lockedContexts:f,draftsWithNonDeletableActive:C}=e;let N="";if(_.length>0){const e=[];_.forEach(n=>{if(n.draft.getProperty("DraftAdministrativeData/InProcessByUser")){e.push(n.draft)}t.push(n.siblingInfo.targetContext)});if(e.length>0){r.push({type:i.draftsToDeleteBeforeActive,contexts:e,selected:true})}}if(c.length>0){c.forEach(e=>t.push(e))}if(f.length>0){N=h.getLockedObjectsText(o,a,f)||"";l.push(new s({text:N}))}const A=a!=n-C.length+f.length;const d=A&&h.getNonDeletableText(e,n,o);if(d){l.push(d)}if(T.length>0){const e=h.getUnsavedContextsText(o,a,T,n)||{};if(e.infoTxt){l.push(new s({text:e.infoTxt}))}if(e.optionTxt||e.optionWithoutTxt){r.push({type:i.unSavedContexts,contexts:T,text:e.optionTxt,selected:true,control:E.CHECKBOX})}}if(C.length>0){const e=h.getNonDeletableActivesOfDraftsText(o,C.length,n)||"";if(e){r.push({type:i.draftsWithNonDeletableActive,contexts:C,text:e,selected:true,control:n>0?E.CHECKBOX:E.TEXT})}}}function O(e,t){if(e.length===1){const n=e[0];if(n.text){t.push(new s({text:n.text}))}}else if(e.length>1){e.forEach(e=>{if(e.control==="text"&&e.text){t.push(new s({text:e.text}))}});e.forEach(e=>{if(e.control==="checkBox"&&e.text){t.push(new n({text:e.text,selected:true,select:function(t){const n=t.getSource();const o=n.getSelected();e.selected=o}}))}})}}function L(e,t,n,o){const{numberOfSelectedContexts:s,entitySetName:l,parentControl:r,description:a,lockedContexts:_,draftsWithNonDeletableActive:T,unSavedContexts:c}=e;const f=t.length+T.length+c.length;const C=s-(_.length+f-T.length);if(s===1&&s===t.length){const e=t[0].getObject();const s=r;const _=s&&s.getParent().getIdentifierColumn();let T;let c=[];if(_){const t=_?e[_]:undefined;const o=a&&a.path?e[a.path]:undefined;if(t){if(o&&a&&_!==a.path){c=[t+" ",o]}else{c=[t,""]}T=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",c,l)}else{T=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,l)}}else{T=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,l)}o.push({type:i.deletableContexts,contexts:t,text:T,selected:true,control:E.TEXT})}else if(c.length!==f&&s>0&&(t.length>0||c.length>0&&T.length>0)){if(s>t.length&&C+_.length>0){let e="";if(f===1){e=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR_NON_DELETABLE",undefined,l)}else{e=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL_NON_DELETABLE",undefined,l)}o.unshift({type:i.deletableContexts,contexts:t,text:e,selected:true,control:E.TEXT})}else{const e=f===1?n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,l):n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL",undefined,l);o.push({type:i.deletableContexts,contexts:t,text:e,selected:true,control:E.TEXT})}}}async function x(n,o,s,l,i,E){try{const r=h.getConfirmedDeletableContext([],n);const a=D(n);const{beforeDeleteCallBack:_,parentControl:T}=o;if(_){await _({contexts:r})}if(r&&r.length){try{const s=r.length===1?true:false;const _=[];await Promise.allSettled(a.map(function(n){try{return t.deleteDraft(n,i,s)}catch(t){e.error(`FE : core : DeleteHelper : Error while discrding draft with path : ${n.getPath()}`);_.push(t)}}));await Promise.all(r.map(function(e){if(E&&!e.getProperty("IsActiveEntity")){return t.deleteDraft(e,i,s)}return e.delete()}));h.afterDeleteProcess(o,n,r,l);if(_.length>0){throw Error(`FE : core : DeleteHelper : Errors on draft delete : ${_}`)}}catch(e){await s.showMessageDialog({control:T});throw e}}}catch(e){await s.showMessages();throw e}}async function I(e,n){const o=n.map(e=>{const n=e.getModel().getMetaModel().getMetaContext(e.getCanonicalPath());const o=n.getProperty("@Org.OData.Capabilities.V1.DeleteRestrictions/Deletable/$Path");const s=!o&&n.getProperty("@Org.OData.Capabilities.V1.DeleteRestrictions/Deletable")!==false;const l={context:e,isDraftRoot:!!n.getProperty("@com.sap.vocabularies.Common.v1.DraftRoot"),isDraftNode:!!n.getProperty("@com.sap.vocabularies.Common.v1.DraftNode"),isActive:true,hasActive:false,hasDraft:false,locked:false,deletable:o?e.getProperty(o):s,siblingPromise:Promise.resolve(undefined),siblingInfo:undefined,siblingDeletable:false};if(l.isDraftRoot){var i;l.locked=!!((i=e.getObject("DraftAdministrativeData"))!==null&&i!==void 0&&i.InProcessByUser);l.hasDraft=e.getProperty("HasDraftEntity")}if(l.isDraftRoot){l.isActive=e.getProperty("IsActiveEntity");l.hasActive=e.getProperty("HasActiveEntity");if(!l.isActive&&l.hasActive){l.siblingPromise=t.computeSiblingInformation(e,e).then(async e=>{l.siblingInfo=e;if(o){var t;l.siblingDeletable=await(e===null||e===void 0?void 0:(t=e.targetContext)===null||t===void 0?void 0:t.requestProperty(o))}else{l.siblingDeletable=s}})}}return l});await Promise.all(o.map(e=>e.siblingPromise));const s=[{key:"draftsWithDeletableActive",value:o.filter(e=>e.isDraftRoot&&!e.isActive&&e.hasActive&&e.siblingDeletable)},{key:"draftsWithNonDeletableActive",value:o.filter(e=>e.isDraftRoot&&!e.isActive&&e.hasActive&&!e.siblingDeletable)},{key:"lockedContexts",value:o.filter(e=>e.isDraftRoot&&e.isActive&&e.hasDraft&&e.locked)},{key:"unSavedContexts",value:o.filter(e=>e.isDraftRoot&&e.isActive&&e.hasDraft&&!e.locked)},{key:"deletableContexts",value:o.filter(e=>!e.isDraftRoot&&!e.isDraftNode&&e.deletable||e.isDraftRoot&&e.isActive&&!e.hasDraft&&e.deletable||e.isDraftRoot&&!e.isActive&&!e.hasActive||e.isDraftNode&&e.deletable)}];for(const{key:t,value:n}of s){e.setProperty(t,n.map(e=>t==="draftsWithDeletableActive"?{draft:e.context,siblingInfo:e.siblingInfo}:e.context))}}const h={getNonDeletableText:A,deleteConfirmHandler:x,updateOptionsForDeletableTexts:L,updateContentForDeleteDialog:O,updateDraftOptionsForDeletableTexts:g,getConfirmedDeletableContext:d,getLockedObjectsText:c,getUnsavedContextsText:N,getNonDeletableActivesOfDraftsText:f,afterDeleteProcess:_,updateDeleteInfoForSelectedContexts:I};return h},false);
|
|
590
|
+
sap.ui.predefine("sap/fe/core/helpers/DeleteHelper", ["sap/base/Log","sap/fe/core/controllerextensions/editFlow/draft","sap/m/CheckBox","sap/m/MessageToast","sap/m/Text"],function(e,t,n,o,s){"use strict";var l;(function(e){e["deletableContexts"]="deletableContexts";e["draftsWithDeletableActive"]="draftsWithDeletableActive";e["unSavedContexts"]="unSavedContexts";e["draftsWithNonDeletableActive"]="draftsWithNonDeletableActive";e["draftsToDeleteBeforeActive"]="draftsToDeleteBeforeActive"})(l||(l={}));var i;(function(e){e["CHECKBOX"]="checkBox";e["TEXT"]="text"})(i||(i={}));function E(e,t,n,o){const s=[...n];o.forEach(e=>{const t=s.indexOf(e);if(t!==-1){s.splice(t,1)}});e.setProperty(t,[]);return s}function a(e,t){let n=e.getProperty("selectedContexts")||[];if(t.type===l.deletableContexts){n=E(e,l.deletableContexts,n,e.getProperty(l.deletableContexts)||[]);const t=e.getProperty(l.draftsWithDeletableActive)||[];const o=t.map(e=>e.draft);n=E(e,l.draftsWithDeletableActive,n,o)}else{const o=e.getProperty(t.type)||[];n=E(e,t.type,n,o)}e.setProperty("selectedContexts",n);e.setProperty("numberOfSelectedContexts",n.length)}function r(e,t,n,s,l){const{internalModelContext:i,entitySetName:E}=e;if(i){if(i.getProperty("deleteEnabled")!=undefined){t.forEach(e=>{if(e.selected){a(i,e)}})}i.setProperty("deleteEnabled",t.some(e=>!e.selected))}if(n.length===1){o.show(s.getText("C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR",undefined,E))}else{o.show(s.getText("C_TRANSACTION_HELPER_DELETE_TOAST_PLURAL",undefined,E))}R.setFocusAfterDelete(e.parentControl,n.length,l)}async function _(e,t,n){var o;const s=(o=e.getRowBinding())===null||o===void 0?void 0:o.getCount();const l=(s??0)+t;let i;if(n!==-1&&s!==undefined&&s>0){if(n===l-1){i=s-1}else{i=n-t+1}await e.focusRow(i,false)}else{e.focus()}}function T(e){const t=e.getObject()["DraftAdministrativeData"];return t&&t["InProcessByUser"]||""}function c(e,t,n){let o="";if(t===1&&n.length===1){const t=T(n[0]);o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",[t])}else if(n.length==1){const s=T(n[0]);o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_LOCKED",[t,s])}else if(n.length>1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_LOCKED",[n.length,t])}return o}function f(e,t,n){let o="";if(n===t){if(t===1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_ONLY_DRAFT_OF_NON_DELETABLE_ACTIVE")}else{o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_ONLY_DRAFTS_OF_NON_DELETABLE_ACTIVE")}}else if(t===1){o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_DRAFT_OF_NON_DELETABLE_ACTIVE")}else{o=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_DRAFTS_OF_NON_DELETABLE_ACTIVE")}return o}function C(e){const t=e.getObject()["DraftAdministrativeData"];let n="";if(t){n=t["LastChangedByUserDescription"]||t["LastChangedByUser"]||""}return n}function N(e,t,n,o){let s="",l="",i=false;if(t===1&&n.length===1){const t=C(n[0]);s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES",[t]);i=true}else if(t===n.length){s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES_MULTIPLE_OBJECTS");i=true}else if(o===n.length){if(n.length===1){const t=C(n[0]);s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_SINGULAR",[t])}else{s=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_PLURAL")}i=true}else if(o>n.length){if(n.length===1){const t=C(n[0]);l=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_SINGULAR",[t])}else{l=e.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_PLURAL")}}return{infoTxt:s,optionTxt:l,optionWithoutTxt:i}}function A(e,t,n){const{numberOfSelectedContexts:o,entitySetName:l,lockedContexts:i=[],draftsWithNonDeletableActive:E=[]}=e;const a=o-(i.length+t-E.length);let r="";if(a>0&&(t===0||E.length===t)){if(i.length>0){if(a===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_ALL_REMAINING_NON_DELETABLE_SINGULAR")}else{r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_ALL_REMAINING_NON_DELETABLE_PLURAL")}}else if(a===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_AND_ONE_OBJECT_NON_DELETABLE",undefined,l)}else{r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_MULTIPLE_AND_ALL_OBJECT_NON_DELETABLE",undefined,l)}}else if(a===1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_NON_DELETABLE",[o],l)}else if(a>1){r=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",[a,o],l)}return r?new s({text:r}):undefined}function d(e,t){return t.reduce((e,t)=>t.selected&&t.type!==l.draftsToDeleteBeforeActive?e.concat(t.contexts):e,e)}function D(e){const t=[];return e.reduce((e,t)=>t.selected&&t.type===l.draftsToDeleteBeforeActive?e.concat(t.contexts):e,t)}function g(e,t,n,o,E,a){const{numberOfSelectedContexts:r,draftsWithDeletableActive:_,unSavedContexts:T,lockedContexts:c,draftsWithNonDeletableActive:f}=e;let C="";if(_.length>0){const e=[];_.forEach(n=>{e.push(n.draft);t.push(n.siblingInfo.targetContext)});if(e.length>0){a.push({type:l.draftsToDeleteBeforeActive,contexts:e,selected:true})}}if(c.length>0){C=R.getLockedObjectsText(o,r,c)||"";E.push(new s({text:C}))}const N=r!=n-f.length+c.length;const A=N&&R.getNonDeletableText(e,n,o);if(A){E.push(A)}if(T.length>0){const e=R.getUnsavedContextsText(o,r,T,n)||{};if(e.infoTxt){E.push(new s({text:e.infoTxt}))}if(e.optionTxt||e.optionWithoutTxt){a.push({type:l.unSavedContexts,contexts:T,text:e.optionTxt,selected:true,control:i.CHECKBOX})}}if(f.length>0){const e=R.getNonDeletableActivesOfDraftsText(o,f.length,n)||"";if(e){a.push({type:l.draftsWithNonDeletableActive,contexts:f,text:e,selected:true,control:n>0?i.CHECKBOX:i.TEXT})}}}function O(e,t){if(e.length===1){const n=e[0];if(n.text){t.push(new s({text:n.text}))}}else if(e.length>1){e.forEach(e=>{if(e.control==="text"&&e.text){t.push(new s({text:e.text}))}});e.forEach(e=>{if(e.control==="checkBox"&&e.text){t.push(new n({text:e.text,selected:true,select:function(t){const n=t.getSource();const o=n.getSelected();e.selected=o}}))}})}}function L(e,t){const{draftsWithDeletableActive:n}=e;const o=n.find(e=>e.siblingInfo.targetContext===t);return o!==null&&o!==void 0&&o.draft?o.draft:t}function u(e,t,n){const{numberOfSelectedContexts:o,entitySetName:s,parentControl:E,description:a,lockedContexts:r,draftsWithNonDeletableActive:_,unSavedContexts:T}=e;const c=t.length+_.length+T.length;const f=o-(r.length+c-_.length);const C=[];if(o===1&&o===t.length){const o=E;const r=o&&o.getParent().getIdentifierColumn();let _;let T=[];if(r){const o=a&&a.path;let l=t[0];let i=l.getObject();if(!i||Object.keys(i).length===0){l=L(e,l);i=l.getObject()}const E=r?i[r]:undefined;const c=o&&i[o];if(E){if(c&&a&&r!==a.path){T=[E+" ",c]}else{T=[E,""]}_=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",T,s)}else{_=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,s)}}else{_=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,s)}C.push({type:l.deletableContexts,contexts:t,text:_,selected:true,control:i.TEXT})}else if(T.length!==c&&o>0&&(t.length>0||T.length>0&&_.length>0)){if(o>t.length&&f+r.length>0){let e="";if(c===1){e=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR_NON_DELETABLE",undefined,s)}else{e=n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL_NON_DELETABLE",undefined,s)}C.unshift({type:l.deletableContexts,contexts:t,text:e,selected:true,control:i.TEXT})}else{const e=c===1?n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",undefined,s):n.getText("C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL",undefined,s);C.push({type:l.deletableContexts,contexts:t,text:e,selected:true,control:i.TEXT})}}return C}async function I(n,o,s,l,i,E){try{const a=R.getConfirmedDeletableContext([],n);const r=a[a.length-1].getIndex()??-1;const _=D(n);const{beforeDeleteCallBack:T,parentControl:c}=o;if(T){await T({contexts:a})}if(a&&a.length){try{const s=a.length===1?true:false;const T=[];await Promise.allSettled(_.map(async function(n){try{return await t.deleteDraft(n,i,s)}catch(t){e.error(`FE : core : DeleteHelper : Error while discarding draft with path : ${n.getPath()}`);T.push(t)}}));await Promise.all(a.map(function(e){if(E&&!e.getProperty("IsActiveEntity")){return t.deleteDraft(e,i,s)}return e.delete()}));await R.afterDeleteProcess(o,n,a,l,r);if(T.length>0){throw Error(`FE : core : DeleteHelper : Errors on draft delete : ${T}`)}}catch(e){await s.showMessageDialog({control:c});throw e}}}catch(e){await s.showMessages();throw e}}async function x(e,n){const o=n.map(e=>{const n=e.getModel().getMetaModel().getMetaContext(e.getCanonicalPath());const o=n.getProperty("@Org.OData.Capabilities.V1.DeleteRestrictions/Deletable/$Path");const s=!o&&n.getProperty("@Org.OData.Capabilities.V1.DeleteRestrictions/Deletable")!==false;const l={context:e,isDraftRoot:!!n.getProperty("@com.sap.vocabularies.Common.v1.DraftRoot"),isDraftNode:!!n.getProperty("@com.sap.vocabularies.Common.v1.DraftNode"),isActive:true,hasActive:false,hasDraft:false,locked:false,deletable:o?e.getProperty(o):s,siblingPromise:Promise.resolve(undefined),siblingInfo:undefined,siblingDeletable:false};if(l.isDraftRoot){var i;l.locked=!!((i=e.getObject("DraftAdministrativeData"))!==null&&i!==void 0&&i.InProcessByUser);l.hasDraft=e.getProperty("HasDraftEntity")}if(l.isDraftRoot){l.isActive=e.getProperty("IsActiveEntity");l.hasActive=e.getProperty("HasActiveEntity");if(!l.isActive&&l.hasActive){l.siblingPromise=t.computeSiblingInformation(e,e).then(async e=>{l.siblingInfo=e;if(o){var t;l.siblingDeletable=await(e===null||e===void 0?void 0:(t=e.targetContext)===null||t===void 0?void 0:t.requestProperty(o))}else{l.siblingDeletable=s}})}}return l});await Promise.all(o.map(e=>e.siblingPromise));const s=[{key:"draftsWithDeletableActive",value:o.filter(e=>e.isDraftRoot&&!e.isActive&&e.hasActive&&e.siblingDeletable)},{key:"draftsWithNonDeletableActive",value:o.filter(e=>e.isDraftRoot&&!e.isActive&&e.hasActive&&!e.siblingDeletable)},{key:"lockedContexts",value:o.filter(e=>e.isDraftRoot&&e.isActive&&e.hasDraft&&e.locked)},{key:"unSavedContexts",value:o.filter(e=>e.isDraftRoot&&e.isActive&&e.hasDraft&&!e.locked)},{key:"deletableContexts",value:o.filter(e=>!e.isDraftRoot&&!e.isDraftNode&&e.deletable||e.isDraftRoot&&e.isActive&&!e.hasDraft&&e.deletable||e.isDraftRoot&&!e.isActive&&!e.hasActive||e.isDraftNode&&e.deletable)}];for(const{key:t,value:n}of s){e.setProperty(t,n.map(e=>t==="draftsWithDeletableActive"?{draft:e.context,siblingInfo:e.siblingInfo}:e.context))}}const R={getNonDeletableText:A,deleteConfirmHandler:I,getOptionsForDeletableTexts:u,updateContentForDeleteDialog:O,updateDraftOptionsForDeletableTexts:g,getConfirmedDeletableContext:d,getLockedObjectsText:c,getUnsavedContextsText:N,getNonDeletableActivesOfDraftsText:f,afterDeleteProcess:r,updateDeleteInfoForSelectedContexts:x,DeleteOptionTypes:l,DeleteDialogContentControl:i,setFocusAfterDelete:_};return R},false);
|
|
581
591
|
/*!
|
|
582
592
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
583
593
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -617,7 +627,7 @@ sap.ui.predefine("sap/fe/core/helpers/LoaderUtils", [],function(){"use strict";v
|
|
|
617
627
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
618
628
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
619
629
|
*/
|
|
620
|
-
sap.ui.predefine("sap/fe/core/helpers/MassEditHelper", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/library","sap/fe/core/TemplateModel","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/PropertyHelper","sap/fe/macros/field/FieldTemplating","sap/fe/macros/table/TableHelper","sap/m/Button","sap/m/Dialog","sap/m/MessageToast","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/mdc/enum/EditMode","sap/ui/model/json/JSONModel","../controllerextensions/messageHandler/messageHandling","../controls/Any","../converters/MetaModelConverter","../templating/FieldControlHelper","../templating/UIFormatters"],function(e,t,n,o,a,i,r,s,l,u,c,d,p,f,g,y,P,h,v,x,m,E,b,O){"use strict";var T=O.isMultiValueField;var M=O.getRequiredExpression;var C=O.getEditMode;var F=b.isReadOnlyExpression;var V=E.getInvolvedDataModelObjects;var D=E.convertMetaModelContext;var S=l.setEditStyleProperties;var $=l.getTextBinding;var B=s.hasValueHelpWithFixedValues;var k=s.hasValueHelp;var I=s.hasUnit;var j=s.hasCurrency;var A=s.getAssociatedUnitPropertyPath;var w=s.getAssociatedUnitProperty;var _=r.getRelativePaths;var H=r.enhanceDataModelPath;var R=o.isProperty;var L=n.pathInModel;var N=n.or;var U=n.not;var G=n.ifElse;var Q=n.constant;var q=n.compileExpression;const K={initLastLevelOfPropertyPath:function(e,t){let n;let o=0;const a=e.split("/");let i="";a.forEach(function(a){if(!t[a]&&o===0){t[a]={};n=t[a];i=i+a;o++}else if(!n[a]){i=`${i}/${a}`;if(i!==e){n[a]={};n=n[a]}else{n[a]=[]}}});return n},getUniqueValues:function(e,t,n){return e!=undefined&&e!=null?n.indexOf(e)===t:undefined},getValueForMultiLevelPath:function(e,t){let n;if(e&&e.indexOf("/")>0){const o=e.split("/");o.forEach(function(e){n=t&&t[e]?t[e]:n&&n[e]})}return n},getDefaultSelectionPathComboBox:function(e,t){let n;if(t&&e.length>0){const o=e,a=[];o.forEach(function(e){const n=e.getObject();const o=t.indexOf("/")>-1&&n.hasOwnProperty(t.split("/")[0]);if(e&&(n.hasOwnProperty(t)||o)){a.push(e.getObject(t))}});const i=a.filter(K.getUniqueValues);if(i.length>1){n=`Default/${t}`}else if(i.length===0){n=`Empty/${t}`}else if(i.length===1){n=`${t}/${i[0]}`}}return n},getHiddenValueForContexts:function(e,t){if(e&&e.$Path){return!t.some(function(t){return t.getObject(e.$Path)===false})}return e},getInputType:function(e,t,n){const o={};let a;if(e){S(o,t,n,true);a=(o===null||o===void 0?void 0:o.editStyle)||""}const i=a&&["DatePicker","TimePicker","DateTimePicker","RatingIndicator"].indexOf(a)===-1&&!T(n)&&!B(e);return(i||"")&&a},getIsFieldGrp:function(e){return e&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&e.Target&&e.Target.value&&e.Target.value.indexOf("FieldGroup")>-1},getTextPath:function(e,t,n){let o;if(t&&(t.path||t.parameters&&t.parameters.length)&&e){if(t.path&&n==="Description"){o=t.path}else if(t.parameters){t.parameters.forEach(function(t){if(t.path&&t.path!==e){o=t.path}})}}return o},prepareDataForDialog:function(e,n,o){const a=e&&e.getModel().getMetaModel(),i=e.data("metaPath"),r=K.getTableFields(e),s=a.getContext(`${i}/@`),l=a.getContext(i),u=V(s);const c=new v;let d;let p;let f;let g;let y;let P;r.forEach(function(e){const r=e.dataProperty;if(r){var s,c,v,x,m,E,b,O,T;let S=r&&a.getObject(`${i}/${r}@`);p=e.label||S&&S["@com.sap.vocabularies.Common.v1.Label"]||r;if(u){u.targetObject=u.targetEntityType.entityProperties.filter(function(e){return e.name===r})}u.targetObject=u.targetObject[0]||{};P=$(u,{},true)||{};const B=a.getContext(e.annotationPath),L=D(B),N=a.getContext(`${i}/${r}@`),U=N&&N.getInterface();let G=V(B,l);if((L===null||L===void 0?void 0:(s=L.Value)===null||s===void 0?void 0:(c=s.path)===null||c===void 0?void 0:c.length)>0){G=H(G,r)}const q=K.getHiddenValueForContexts(B&&B.getObject()["@com.sap.vocabularies.UI.v1.Hidden"],n)||false;const X=S&&S["@com.sap.vocabularies.UI.v1.IsImageURL"];U.context={getModel:function(){return U.getModel()},getPath:function(){return`${i}/${r}`}};S=R(L)?L:(L===null||L===void 0?void 0:(v=L.Value)===null||v===void 0?void 0:v.$target)??(L===null||L===void 0?void 0:(x=L.Target)===null||x===void 0?void 0:x.$target);const z=S&&S.term&&S.term==="com.sap.vocabularies.UI.v1.Chart";const J=!!L.Action;const Y=K.getIsFieldGrp(L);if(X||q||z||J||Y){return}g=(j(S)||I(S))&&A(S)||"";const W=g&&w(S);f=k(S);y=W&&k(W);const Z=(f||y)&&(((m=S)===null||m===void 0?void 0:(E=m.annotations)===null||E===void 0?void 0:(b=E.Common)===null||b===void 0?void 0:b.ValueListRelevantQualifiers)||W&&(W===null||W===void 0?void 0:(O=W.annotations)===null||O===void 0?void 0:(T=O.Common)===null||T===void 0?void 0:T.ValueListRelevantQualifiers));if(Z){return}const ee=S&&S.Value?S.Value:S;const te=C(ee,G,false,false,L,Q(true));const ne=Object.keys(h);const oe=!!te&&ne.includes(te);const ae=!!te&&(oe&&te===h.Editable||!oe);const ie=r.includes("/")&&f;if(!ae||ie){return}const re=K.getInputType(S,L,G);if(re){const e=_(G);const a=F(S,e);const s=t.computeDisplayMode(N.getObject());const l=f?f:false;const u=y&&!g.includes("/")?y:false;const c=g&&!r.includes("/")?g:false;d={label:p,dataProperty:r,isValueHelpEnabled:f?f:false,unitProperty:c,isFieldRequired:M(S,L,true,false,{},G),defaultSelectionPath:r?K.getDefaultSelectionPathComboBox(n,r):false,defaultSelectionUnitPath:g?K.getDefaultSelectionPathComboBox(n,g):false,entitySet:i,display:s,descriptionPath:K.getTextPath(r,P,s),nullable:S.nullable!==undefined?S.nullable:true,isPropertyReadOnly:a!==undefined?a:false,inputType:re,editMode:ae?te:undefined,propertyInfo:{hasVH:l,runtimePath:"fieldsInfo>/values/",relativePath:r,propertyFullyQualifiedName:S.fullyQualifiedName,propertyPathForValueHelp:`${i}/${r}`},unitInfo:c&&{hasVH:u,runtimePath:"fieldsInfo>/unitData/",relativePath:c,propertyPathForValueHelp:`${i}/${c}`}};o.push(d)}}});c.setData(o);return c},getTableFields:function(e){const t=e&&e.getColumns()||[];const n=e&&e.getParent().getTableDefinition().columns;return t.map(function(e){const t=e&&e.getDataProperty(),o=n&&n.filter(function(e){return e.name===t&&e.type==="Annotation"});return{dataProperty:t,label:e.getHeader(),annotationPath:o&&o[0]&&o[0].annotationPath}})},getDefaultTextsForDialog:function(e,t,n){const o=n.data("displayModePropertyBinding")==="true";return{keepExistingPrefix:"< Keep",leaveBlankValue:"< Leave Blank >",clearFieldValue:"< Clear Values >",massEditTitle:e.getText("C_MASS_EDIT_DIALOG_TITLE",t.toString()),applyButtonText:o?e.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT"):e.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),useValueHelpValue:"< Use Value Help >",cancelButtonText:e.getText("C_COMMON_OBJECT_PAGE_CANCEL"),noFields:e.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),okButtonText:e.getText("C_COMMON_DIALOG_OK")}},setDefaultValuesToDialog:function(e,t,n,o){const a=o?n.unitProperty:n.dataProperty,i=n.inputType,r=n.isFieldRequired;const s="Values";e.defaultOptions=e.defaultOptions||[];const l=e.selectOptions&&e.selectOptions.length>0;const u={text:`${t.keepExistingPrefix} ${s} >`,key:`Default/${a}`};if(i==="CheckBox"){const t={text:"No",key:`${a}/false`,textInfo:{value:false}};const n={text:"Yes",key:`${a}/true`,textInfo:{value:true}};e.unshift(t);e.defaultOptions.unshift(t);e.unshift(n);e.defaultOptions.unshift(n);e.unshift(u);e.defaultOptions.unshift(u)}else{var c,d;if(n!==null&&n!==void 0&&(c=n.propertyInfo)!==null&&c!==void 0&&c.hasVH||n!==null&&n!==void 0&&(d=n.unitInfo)!==null&&d!==void 0&&d.hasVH&&o){const n={text:t.useValueHelpValue,key:`UseValueHelpValue/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}if(l){if(r!=="true"&&!o){const n={text:t.clearFieldValue,key:`ClearFieldValue/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}e.unshift(u);e.defaultOptions.unshift(u)}else{const n={text:t.leaveBlankValue,key:`Default/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}}},getTextArrangementInfo:function(t,n,o,a){let i=a.getObject(t),r,s;if(n&&t){switch(o){case"Description":r=a.getObject(n)||"";s=r;break;case"Value":i=a.getObject(t)||"";s=i;break;case"ValueDescription":i=a.getObject(t)||"";r=a.getObject(n)||"";s=r?`${i} (${r})`:i;break;case"DescriptionValue":i=a.getObject(t)||"";r=a.getObject(n)||"";s=r?`${r} (${i})`:i;break;default:e.info(`Display Property not applicable: ${t}`);break}}return{textArrangement:o,valuePath:t,descriptionPath:n,value:i,description:r,fullText:s}},isEditable:function(e){const t=e.getBinding("any");const n=t.getExternalValue();return n===h.Editable},onContextEditableChange:function(e,t){const n=e.getProperty(`/values/${t}/objectsForVisibility`)||[];const o=n.some(K.isEditable);if(o){e.setProperty(`/values/${t}/visible`,o)}},updateOnContextChange:function(e,t,n,o){const a=e.getBinding("any");o.objectsForVisibility=o.objectsForVisibility||[];o.objectsForVisibility.push(e);a===null||a===void 0?void 0:a.attachChange(K.onContextEditableChange.bind(null,t,n))},getBoundObject:function(e,t){const n=new m({any:e});const o=t.getModel();n.setModel(o);n.setBindingContext(t);return n},getFieldVisiblity:function(e,t,n,o,a){const i=K.getBoundObject(e,a);const r=K.isEditable(i);if(!r){K.updateOnContextChange(i,t,n,o)}return r},setRuntimeModelOnDialog:function(e,t,n,o){const a=[];const i=[];const r=[];const s=[];const l=[];const u={values:a,unitData:i,results:r,readablePropertyData:l,selectedKey:undefined,textPaths:s,noFields:n.noFields};const c=new v(u);t.forEach(function(t){let n;let r;let l;const u={};const c={};if(t.dataProperty&&t.dataProperty.indexOf("/")>-1){const o=K.initLastLevelOfPropertyPath(t.dataProperty,a);const i=t.dataProperty.split("/");for(const a of e){const e=a.getObject(t.dataProperty);r=`${t.dataProperty}/${e}`;if(!u[r]&&o[i[i.length-1]]){n=K.getTextArrangementInfo(t.dataProperty,t.descriptionPath,t.display,a);o[i[i.length-1]].push({text:n&&n.fullText||e,key:r,textInfo:n});u[r]=e}}o[i[i.length-1]].textInfo={descriptionPath:t.descriptionPath,valuePath:t.dataProperty,displayMode:t.display}}else{a[t.dataProperty]=a[t.dataProperty]||[];a[t.dataProperty]["selectOptions"]=a[t.dataProperty]["selectOptions"]||[];if(t.unitProperty){i[t.unitProperty]=i[t.unitProperty]||[];i[t.unitProperty]["selectOptions"]=i[t.unitProperty]["selectOptions"]||[]}for(const o of e){const e=o.getObject();r=`${t.dataProperty}/${e[t.dataProperty]}`;if(t.dataProperty&&e[t.dataProperty]&&!u[r]){if(t.inputType!="CheckBox"){n=K.getTextArrangementInfo(t.dataProperty,t.descriptionPath,t.display,o);const i={text:n&&n.fullText||e[t.dataProperty],key:r,textInfo:n};a[t.dataProperty].push(i);a[t.dataProperty]["selectOptions"].push(i)}u[r]=e[t.dataProperty]}if(t.unitProperty&&e[t.unitProperty]){l=`${t.unitProperty}/${e[t.unitProperty]}`;if(!c[l]){if(t.inputType!="CheckBox"){n=K.getTextArrangementInfo(t.unitProperty,t.descriptionPath,t.display,o);const a={text:n&&n.fullText||e[t.unitProperty],key:l,textInfo:n};i[t.unitProperty].push(a);i[t.unitProperty]["selectOptions"].push(a)}c[l]=e[t.unitProperty]}}}a[t.dataProperty].textInfo={descriptionPath:t.descriptionPath,valuePath:t.dataProperty,displayMode:t.display};if(Object.keys(u).length===1){o.setProperty(t.dataProperty,r&&u[r])}if(Object.keys(c).length===1){o.setProperty(t.unitProperty,l&&c[l])}}s[t.dataProperty]=t.descriptionPath?[t.descriptionPath]:[]});t.forEach(function(t){let o={};if(t.dataProperty.indexOf("/")>-1){const e=K.getValueForMultiLevelPath(t.dataProperty,a);if(!e){e.push({text:n.leaveBlankValue,key:`Empty/${t.dataProperty}`})}else{K.setDefaultValuesToDialog(e,n,t)}o=e}else if(a[t.dataProperty]){a[t.dataProperty]=a[t.dataProperty]||[];K.setDefaultValuesToDialog(a[t.dataProperty],n,t);o=a[t.dataProperty]}if(i[t.unitProperty]&&i[t.unitProperty].length){K.setDefaultValuesToDialog(i[t.unitProperty],n,t,true);i[t.unitProperty].textInfo={};i[t.unitProperty].selectedKey=K.getDefaultSelectionPathComboBox(e,t.unitProperty);i[t.unitProperty].inputType=t.inputType}else if(t.dataProperty&&a[t.dataProperty]&&!a[t.dataProperty].length||t.unitProperty&&i[t.unitProperty]&&!i[t.unitProperty].length){const o=a[t.dataProperty]&&a[t.dataProperty].some(function(e){return e.text==="< Clear Values >"||e.text==="< Leave Blank >"});if(t.dataProperty&&!o){a[t.dataProperty].push({text:n.leaveBlankValue,key:`Empty/${t.dataProperty}`})}const r=i[t.unitProperty]&&i[t.unitProperty].some(function(e){return e.text==="< Clear Values >"||e.text==="< Leave Blank >"});if(t.unitProperty){if(!r){i[t.unitProperty].push({text:n.leaveBlankValue,key:`Empty/${t.unitProperty}`})}i[t.unitProperty].textInfo={};i[t.unitProperty].selectedKey=K.getDefaultSelectionPathComboBox(e,t.unitProperty);i[t.unitProperty].inputType=t.inputType}}if(t.isPropertyReadOnly&&typeof t.isPropertyReadOnly==="boolean"){l.push({property:t.dataProperty,value:t.isPropertyReadOnly,type:"Default"})}else if(t.isPropertyReadOnly&&t.isPropertyReadOnly.operands&&t.isPropertyReadOnly.operands[0]&&t.isPropertyReadOnly.operands[0].operand1&&t.isPropertyReadOnly.operands[0].operand2){l.push({property:t.dataProperty,propertyPath:t.isPropertyReadOnly.operands[0].operand1.path,propertyValue:t.isPropertyReadOnly.operands[0].operand2.value,type:"Path"})}if(t.editMode){o.visible=t.editMode===h.Editable||e.some(K.getFieldVisiblity.bind(K,t.editMode,c,t.dataProperty,o))}else{o.visible=true}o.selectedKey=K.getDefaultSelectionPathComboBox(e,t.dataProperty);o.inputType=t.inputType;o.unitProperty=t.unitProperty});return c},getDialogContext:function(e,t){let n=t&&t.getBindingContext();if(!n){const t=e.getModel();const o=e.getRowBinding();const a=t.bindList(o.getPath(),o.getContext(),[],[],{$$updateGroupId:"submitLater"});a.refreshInternal=function(){};n=a.create({},true)}return n},onDialogOpen:function(e){const t=e.getSource();const n=t.getModel("fieldsInfo");n.setProperty("/isOpen",true)},closeDialog:function(e){e.close();e.destroy()},messageHandlingForMassEdit:async function(e,t,n,o,i,r){var s,l,u,c;const d=a.DraftStatus;const g=f.getLibraryResourceBundle("sap.fe.core");(s=n.getView())===null||s===void 0?void 0:(l=s.getBindingContext("internal"))===null||l===void 0?void 0:l.setProperty("getBoundMessagesForMassEdit",true);n.messageHandler.showMessages({onBeforeShowMessage:function(o,a){a.fnGetMessageSubtitle=x.setMessageSubtitle.bind({},e,t);const s=[];o.forEach(function(e){if(!e.getTarget()){s.push(e)}});if(i.length>0&&r.length===0){n.editFlow.setDraftStatus(d.Saved);const e=g.getText("C_MASS_EDIT_SUCCESS_TOAST");p.show(e)}else if(r.length<e.getSelectedContexts().length){n.editFlow.setDraftStatus(d.Saved)}else if(r.length===e.getSelectedContexts().length){n.editFlow.setDraftStatus(d.Clear)}if(n.getModel("ui").getProperty("/isEditable")&&s.length===0){a.showMessageBox=false;a.showMessageDialog=false}return a}});if(o.isOpen()){var y,P;K.closeDialog(o);(y=n.getView())===null||y===void 0?void 0:(P=y.getBindingContext("internal"))===null||P===void 0?void 0:P.setProperty("skipPatchHandlers",false)}(u=n.getView())===null||u===void 0?void 0:(c=u.getBindingContext("internal"))===null||c===void 0?void 0:c.setProperty("getBoundMessagesForMassEdit",false)},getSideEffectDataForKey:function(e,t,n,o){const a=e.getProperty("$Type");const i={};o.forEach(e=>{const o=e.keyValue;const r=t.getSideEffectsService();const s=r.computeFieldGroupIds(a,e.propertyFullyQualifiedName??"")??[];i[o]=n._sideEffects.getSideEffectsMapForFieldGroups(s)});return i},fnGetPathForSourceProperty:function(e,t,n){const o=e.indexOf("/")>0?"/"+t+"/"+e.substr(0,e.lastIndexOf("/")+1)+"@sapui.name":false,a=!o?Promise.resolve(t):n.requestObject(o);e=o?e.substr(e.lastIndexOf("/")+1):e;return{sPath:e,pOwnerEntity:a,sNavigationPath:o}},fnGetEntityTypeOfOwner:function(e,t,n,o,a){const i=n.getProperty("$Type");const{$Type:r,$Partner:s}=e.getObject(`${n}/${t}`);if(s){const t=e.getObject(`/${r}/${s}`);if(t){const e=t["$Type"];if(e!==i){a.push(o)}}}else{a.push(o)}return a},fnGetTargetsForMassEdit:function(e,t,n,o){const{targetProperties:a,targetEntities:i}=e;const r=[];let s=[];const l=t.getProperty("$Type");if(n===l){i===null||i===void 0?void 0:i.forEach(e=>{e=e["$NavigationPropertyPath"];let n;if(e.includes("/")){n=e.split("/")[0]}else{n=e}s=K.fnGetEntityTypeOfOwner(o,n,t,e,s)})}if(a.length){a.forEach(e=>{const{pOwnerEntity:a}=K.fnGetPathForSourceProperty(e,n,o);r.push(a.then(n=>{if(n===l){s.push(e)}else if(e.includes("/")){const n=e.split("/")[0];s=K.fnGetEntityTypeOfOwner(o,n,t,e,s)}return Promise.resolve(s)}))})}else{r.push(Promise.resolve(s))}return Promise.all(r)},checkIfEntityExistsAsTargetEntity:(e,t)=>{const n=t.getProperty("$Type");const o=Object.values(e).filter(e=>e.name.indexOf(n)==-1);const a=t.getPath().split("/").pop();const i=o.filter(e=>{const t=e.sideEffects.targetEntities;return t!==null&&t!==void 0&&t.filter(e=>e["$NavigationPropertyPath"]===a).length?e:false});return i.length},handleMassEditFieldUpdateAndRequestSideEffects:async function(e){const{oController:n,oFieldPromise:o,sideEffectsMap:a,textPaths:i,groupId:r,key:s,oEntitySetContext:l,oMetaModel:c,oSelectedContext:d,deferredTargetsForAQualifiedName:p}=e;const f=[o];const g=l.getProperty("$Type");const y=t.getAppComponent(n.getView());const P=y.getSideEffectsService();const h=K.checkIfEntityExistsAsTargetEntity(a,l);if(a){const e=Object.keys(a);const t=Object.values(a);const o={};p[s]={};for(const[a,i]of t.entries()){const t=e[a];const y=t.split("#")[0];const P=n._sideEffects.getContextForSideEffects(d,y);i.context=P;const v=n._sideEffects.getRegisteredFailedRequests();const x=v[P.getPath()];n._sideEffects.unregisterFailedSideEffectsForAContext(P);let m=[i.sideEffects];m=x&&x.length?m.concat(x):m;o[P]={};for(const e of m){if(!o[P].hasOwnProperty(e.fullyQualifiedName)){o[P][e.fullyQualifiedName]=true;let t=[],a=[],i;const d=async function(e){const{targetProperties:n,targetEntities:o}=e;const r=e.fullyQualifiedName.split("@")[0];const d=await K.fnGetTargetsForMassEdit(e,l,r,c);t=d[0];a=(n||[]).concat(o||[]);const f=e.triggerAction;const y=a.filter(e=>!t.includes(e));p[s][e.fullyQualifiedName]={aTargets:y,oContext:P,mSideEffect:e};if(f&&r===g){const t=u._isStaticAction(c.getObject(`/${f}`),f);if(!t){i=f}else{p[s][e.fullyQualifiedName]["TriggerAction"]=f}}else{p[s][e.fullyQualifiedName]["TriggerAction"]=f}if(h){t=[]}return{aTargets:t,TriggerAction:i}};f.push(n._sideEffects.requestSideEffects(e,P,r,d))}}}}if(i!==null&&i!==void 0&&i[s]&&i[s].length){f.push(P.requestSideEffects(i[s],d,r))}return Promise.allSettled(f)},createDialog:async function(n,o,a){const r="sap/fe/core/controls/massEdit/MassEditDialog",s=[],l=f.getLibraryResourceBundle("sap.fe.core"),u=K.getDefaultTextsForDialog(l,o.length,n),p=K.prepareDataForDialog(n,o,s),h=K.getDialogContext(n),v=K.setRuntimeModelOnDialog(o,s,u,h),m=n.getModel(),E=m.getMetaModel(),b=new i(p.getData(),E);const O=P.loadTemplate(r,"fragment");const T=await Promise.resolve(y.process(O,{name:r},{bindingContexts:{dataFieldModel:b.createBindingContext("/"),metaModel:E.createBindingContext("/"),contextPath:E.createBindingContext(E.getMetaPath(h.getPath()))},models:{dataFieldModel:b,metaModel:E,contextPath:E}}));const M=await g.load({definition:T});const C=new d({resizable:true,title:u.massEditTitle,content:[M],afterOpen:K.onDialogOpen,beginButton:new c({text:K.helpers.getExpBindingForApplyButtonTxt(u,p.getObject("/")),type:"Emphasized",press:async function(i){var r,s;x.removeBoundTransitionMessages();x.removeUnboundTransitionMessages();(r=a.getView())===null||r===void 0?void 0:(s=r.getBindingContext("internal"))===null||s===void 0?void 0:s.setProperty("skipPatchHandlers",true);const l=t.getAppComponent(a.getView());const u=i.getSource().getParent();const c=u.getModel("fieldsInfo");const d=c.getProperty("/results");const p=n&&n.getModel().getMetaModel(),f=n.data("metaPath"),g=p.getContext(f);const y=[];const P=c.getProperty("/textPaths");const h=c.getProperty("/readablePropertyData");let v;let m;const E=[];const b={};const O=o.length;const T={};const M=K.getSideEffectDataForKey(g,l,a,d);o.forEach(function(t,n){m=[];d.forEach(async function(o){if(!b.hasOwnProperty(o.keyValue)){b[o.keyValue]=0}if(M[o.keyValue]){m[o.keyValue]=M[o.keyValue]}if(h){h.some(function(e){if(o.keyValue===e.property){if(e.type==="Default"){return e.value===true}else if(e.type==="Path"&&e.propertyValue&&e.propertyPath){return t.getObject(e.propertyPath)===e.propertyValue}}})}v=`$auto.${n}`;const i=t.setProperty(o.keyValue,o.value,v).catch(function(n){y.push(t.getObject());e.error("Mass Edit: Something went wrong in updating entries.",n);b[o.keyValue]=b[o.keyValue]+1;return Promise.reject({isFieldUpdateFailed:true})});const r={oController:a,oFieldPromise:i,sideEffectsMap:M[o.keyValue],textPaths:P,groupId:v,key:o.keyValue,oEntitySetContext:g,oMetaModel:p,oSelectedContext:t,deferredTargetsForAQualifiedName:T};E.push(K.handleMassEditFieldUpdateAndRequestSideEffects(r))})});await Promise.allSettled(E).then(async function(){v=`$auto.massEditDeferred`;const e=[];const t=Object.values(T);const n=Object.keys(T);t.forEach((t,o)=>{const i=n[o];if(b[i]!==O){const n=Object.values(t);n.forEach(t=>{const{aTargets:n,oContext:o,TriggerAction:i,mSideEffect:r}=t;const s=function(){return n};const l=function(){return{aTargets:s(),TriggerAction:i}};e.push(a._sideEffects.requestSideEffects(r,o,v,l))})}})}).then(function(){K.messageHandlingForMassEdit(n,o,a,u,d,y)}).catch(e=>{K.closeDialog(C);return Promise.reject(e)})}}),endButton:new c({text:u.cancelButtonText,visible:K.helpers.hasEditableFieldsBinding(p.getObject("/"),true),press:function(e){const t=e.getSource().getParent();K.closeDialog(t)}})});C.setModel(v,"fieldsInfo");C.setModel(m);C.setBindingContext(h);return C},helpers:{getBindingExpForHasEditableFields:(e,t)=>{const n=e.reduce((e,t)=>N(e,L("/values/"+t.dataProperty+"/visible","fieldsInfo")),Q(false));return t?n:U(n)},getExpBindingForApplyButtonTxt:(e,t)=>{const n=K.helpers.getBindingExpForHasEditableFields(t,true);const o=G(n,Q(e.applyButtonText),Q(e.okButtonText));return q(o)},hasEditableFieldsBinding:(e,t)=>q(K.helpers.getBindingExpForHasEditableFields(e,t))}};return K},false);
|
|
630
|
+
sap.ui.predefine("sap/fe/core/helpers/MassEditHelper", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/library","sap/fe/core/TemplateModel","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/PropertyHelper","sap/fe/macros/field/FieldTemplating","sap/fe/macros/table/TableHelper","sap/m/Button","sap/m/Dialog","sap/m/MessageToast","sap/ui/core/Core","sap/ui/core/Fragment","sap/ui/core/util/XMLPreprocessor","sap/ui/core/XMLTemplateProcessor","sap/ui/mdc/enum/EditMode","sap/ui/model/json/JSONModel","../controllerextensions/messageHandler/messageHandling","../controls/Any","../converters/MetaModelConverter","../templating/FieldControlHelper","../templating/UIFormatters"],function(e,t,n,o,a,i,r,s,l,u,c,d,p,f,g,y,P,h,v,x,m,E,b,O){"use strict";var T=O.isMultiValueField;var M=O.getRequiredExpression;var C=O.getEditMode;var F=b.isReadOnlyExpression;var V=E.getInvolvedDataModelObjects;var D=E.convertMetaModelContext;var S=l.setEditStyleProperties;var $=l.getTextBinding;var B=s.hasValueHelpWithFixedValues;var k=s.hasValueHelp;var I=s.hasUnit;var j=s.hasCurrency;var A=s.getAssociatedUnitPropertyPath;var w=s.getAssociatedUnitProperty;var _=r.getRelativePaths;var H=r.enhanceDataModelPath;var R=o.isProperty;var L=n.pathInModel;var N=n.or;var U=n.not;var G=n.ifElse;var Q=n.constant;var q=n.compileExpression;const K={initLastLevelOfPropertyPath:function(e,t){let n;let o=0;const a=e.split("/");let i="";a.forEach(function(a){if(!t[a]&&o===0){t[a]={};n=t[a];i=i+a;o++}else if(!n[a]){i=`${i}/${a}`;if(i!==e){n[a]={};n=n[a]}else{n[a]=[]}}});return n},getUniqueValues:function(e,t,n){return e!=undefined&&e!=null?n.indexOf(e)===t:undefined},getValueForMultiLevelPath:function(e,t){let n;if(e&&e.indexOf("/")>0){const o=e.split("/");o.forEach(function(e){n=t&&t[e]?t[e]:n&&n[e]})}return n},getDefaultSelectionPathComboBox:function(e,t){let n;if(t&&e.length>0){const o=e,a=[];o.forEach(function(e){const n=e.getObject();const o=t.indexOf("/")>-1&&n.hasOwnProperty(t.split("/")[0]);if(e&&(n.hasOwnProperty(t)||o)){a.push(e.getObject(t))}});const i=a.filter(K.getUniqueValues);if(i.length>1){n=`Default/${t}`}else if(i.length===0){n=`Empty/${t}`}else if(i.length===1){n=`${t}/${i[0]}`}}return n},getHiddenValueForContexts:function(e,t){if(e&&e.$Path){return!t.some(function(t){return t.getObject(e.$Path)===false})}return e},getInputType:function(e,t,n){const o={};let a;if(e){S(o,t,n,true);a=(o===null||o===void 0?void 0:o.editStyle)||""}const i=a&&["DatePicker","TimePicker","DateTimePicker","RatingIndicator"].indexOf(a)===-1&&!T(n)&&!B(e);return(i||"")&&a},getIsFieldGrp:function(e){return e&&e.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&e.Target&&e.Target.value&&e.Target.value.indexOf("FieldGroup")>-1},getTextPath:function(e,t,n){let o;if(t&&(t.path||t.parameters&&t.parameters.length)&&e){if(t.path&&n==="Description"){o=t.path}else if(t.parameters){t.parameters.forEach(function(t){if(t.path&&t.path!==e){o=t.path}})}}return o},prepareDataForDialog:function(e,n,o){const a=e&&e.getModel().getMetaModel(),i=e.data("metaPath"),r=K.getTableFields(e),s=a.getContext(`${i}/@`),l=a.getContext(i),u=V(s);const c=new v;let d;let p;let f;let g;let y;let P;r.forEach(function(e){if(!e.annotationPath){return}const r=e.dataProperty;if(r){var s,c,v,x,m,E,b,O,T;let S=r&&a.getObject(`${i}/${r}@`);p=e.label||S&&S["@com.sap.vocabularies.Common.v1.Label"]||r;if(u){u.targetObject=u.targetEntityType.entityProperties.filter(function(e){return e.name===r})}u.targetObject=u.targetObject[0]||{};P=$(u,{},true)||{};const B=a.getContext(e.annotationPath),L=D(B),N=a.getContext(`${i}/${r}@`),U=N&&N.getInterface();let G=V(B,l);if((L===null||L===void 0?void 0:(s=L.Value)===null||s===void 0?void 0:(c=s.path)===null||c===void 0?void 0:c.length)>0){G=H(G,r)}const q=K.getHiddenValueForContexts(B&&B.getObject()["@com.sap.vocabularies.UI.v1.Hidden"],n)||false;const X=S&&S["@com.sap.vocabularies.UI.v1.IsImageURL"];U.context={getModel:function(){return U.getModel()},getPath:function(){return`${i}/${r}`}};S=R(L)?L:(L===null||L===void 0?void 0:(v=L.Value)===null||v===void 0?void 0:v.$target)??(L===null||L===void 0?void 0:(x=L.Target)===null||x===void 0?void 0:x.$target);const z=S&&S.term&&S.term==="com.sap.vocabularies.UI.v1.Chart";const J=!!L.Action;const Y=K.getIsFieldGrp(L);if(X||q||z||J||Y){return}g=(j(S)||I(S))&&A(S)||"";const W=g&&w(S);f=k(S);y=W&&k(W);const Z=(f||y)&&(((m=S)===null||m===void 0?void 0:(E=m.annotations)===null||E===void 0?void 0:(b=E.Common)===null||b===void 0?void 0:b.ValueListRelevantQualifiers)||W&&(W===null||W===void 0?void 0:(O=W.annotations)===null||O===void 0?void 0:(T=O.Common)===null||T===void 0?void 0:T.ValueListRelevantQualifiers));if(Z){return}const ee=S&&S.Value?S.Value:S;const te=C(ee,G,false,false,L,Q(true));const ne=Object.keys(h);const oe=!!te&&ne.includes(te);const ae=!!te&&(oe&&te===h.Editable||!oe);const ie=r.includes("/")&&f;if(!ae||ie){return}const re=K.getInputType(S,L,G);if(re){const e=_(G);const a=F(S,e);const s=t.computeDisplayMode(N.getObject());const l=f?f:false;const u=y&&!g.includes("/")?y:false;const c=g&&!r.includes("/")?g:false;d={label:p,dataProperty:r,isValueHelpEnabled:f?f:false,unitProperty:c,isFieldRequired:M(S,L,true,false,{},G),defaultSelectionPath:r?K.getDefaultSelectionPathComboBox(n,r):false,defaultSelectionUnitPath:g?K.getDefaultSelectionPathComboBox(n,g):false,entitySet:i,display:s,descriptionPath:K.getTextPath(r,P,s),nullable:S.nullable!==undefined?S.nullable:true,isPropertyReadOnly:a!==undefined?a:false,inputType:re,editMode:ae?te:undefined,propertyInfo:{hasVH:l,runtimePath:"fieldsInfo>/values/",relativePath:r,propertyFullyQualifiedName:S.fullyQualifiedName,propertyPathForValueHelp:`${i}/${r}`},unitInfo:c&&{hasVH:u,runtimePath:"fieldsInfo>/unitData/",relativePath:c,propertyPathForValueHelp:`${i}/${c}`}};o.push(d)}}});c.setData(o);return c},getTableFields:function(e){const t=e&&e.getColumns()||[];const n=e&&e.getParent().getTableDefinition().columns;return t.map(function(e){const t=e&&e.getDataProperty(),o=n&&n.filter(function(e){return e.name===t&&e.type==="Annotation"});return{dataProperty:t,label:e.getHeader(),annotationPath:o&&o[0]&&o[0].annotationPath}})},getDefaultTextsForDialog:function(e,t,n){const o=n.data("displayModePropertyBinding")==="true";return{keepExistingPrefix:"< Keep",leaveBlankValue:"< Leave Blank >",clearFieldValue:"< Clear Values >",massEditTitle:e.getText("C_MASS_EDIT_DIALOG_TITLE",t.toString()),applyButtonText:o?e.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT"):e.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),useValueHelpValue:"< Use Value Help >",cancelButtonText:e.getText("C_COMMON_OBJECT_PAGE_CANCEL"),noFields:e.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),okButtonText:e.getText("C_COMMON_DIALOG_OK")}},setDefaultValuesToDialog:function(e,t,n,o){const a=o?n.unitProperty:n.dataProperty,i=n.inputType,r=n.isFieldRequired;const s="Values";e.defaultOptions=e.defaultOptions||[];const l=e.selectOptions&&e.selectOptions.length>0;const u={text:`${t.keepExistingPrefix} ${s} >`,key:`Default/${a}`};if(i==="CheckBox"){const t={text:"No",key:`${a}/false`,textInfo:{value:false}};const n={text:"Yes",key:`${a}/true`,textInfo:{value:true}};e.unshift(t);e.defaultOptions.unshift(t);e.unshift(n);e.defaultOptions.unshift(n);e.unshift(u);e.defaultOptions.unshift(u)}else{var c,d;if(n!==null&&n!==void 0&&(c=n.propertyInfo)!==null&&c!==void 0&&c.hasVH||n!==null&&n!==void 0&&(d=n.unitInfo)!==null&&d!==void 0&&d.hasVH&&o){const n={text:t.useValueHelpValue,key:`UseValueHelpValue/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}if(l){if(r!=="true"&&!o){const n={text:t.clearFieldValue,key:`ClearFieldValue/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}e.unshift(u);e.defaultOptions.unshift(u)}else{const n={text:t.leaveBlankValue,key:`Default/${a}`};e.unshift(n);e.defaultOptions.unshift(n)}}},getTextArrangementInfo:function(t,n,o,a){let i=a.getObject(t),r,s;if(n&&t){switch(o){case"Description":r=a.getObject(n)||"";s=r;break;case"Value":i=a.getObject(t)||"";s=i;break;case"ValueDescription":i=a.getObject(t)||"";r=a.getObject(n)||"";s=r?`${i} (${r})`:i;break;case"DescriptionValue":i=a.getObject(t)||"";r=a.getObject(n)||"";s=r?`${r} (${i})`:i;break;default:e.info(`Display Property not applicable: ${t}`);break}}return{textArrangement:o,valuePath:t,descriptionPath:n,value:i,description:r,fullText:s}},isEditable:function(e){const t=e.getBinding("any");const n=t.getExternalValue();return n===h.Editable},onContextEditableChange:function(e,t){const n=e.getProperty(`/values/${t}/objectsForVisibility`)||[];const o=n.some(K.isEditable);if(o){e.setProperty(`/values/${t}/visible`,o)}},updateOnContextChange:function(e,t,n,o){const a=e.getBinding("any");o.objectsForVisibility=o.objectsForVisibility||[];o.objectsForVisibility.push(e);a===null||a===void 0?void 0:a.attachChange(K.onContextEditableChange.bind(null,t,n))},getBoundObject:function(e,t){const n=new m({any:e});const o=t.getModel();n.setModel(o);n.setBindingContext(t);return n},getFieldVisiblity:function(e,t,n,o,a){const i=K.getBoundObject(e,a);const r=K.isEditable(i);if(!r){K.updateOnContextChange(i,t,n,o)}return r},setRuntimeModelOnDialog:function(e,t,n,o){const a=[];const i=[];const r=[];const s=[];const l=[];const u={values:a,unitData:i,results:r,readablePropertyData:l,selectedKey:undefined,textPaths:s,noFields:n.noFields};const c=new v(u);t.forEach(function(t){let n;let r;let l;const u={};const c={};if(t.dataProperty&&t.dataProperty.indexOf("/")>-1){const o=K.initLastLevelOfPropertyPath(t.dataProperty,a);const i=t.dataProperty.split("/");for(const a of e){const e=a.getObject(t.dataProperty);r=`${t.dataProperty}/${e}`;if(!u[r]&&o[i[i.length-1]]){n=K.getTextArrangementInfo(t.dataProperty,t.descriptionPath,t.display,a);o[i[i.length-1]].push({text:n&&n.fullText||e,key:r,textInfo:n});u[r]=e}}o[i[i.length-1]].textInfo={descriptionPath:t.descriptionPath,valuePath:t.dataProperty,displayMode:t.display}}else{a[t.dataProperty]=a[t.dataProperty]||[];a[t.dataProperty]["selectOptions"]=a[t.dataProperty]["selectOptions"]||[];if(t.unitProperty){i[t.unitProperty]=i[t.unitProperty]||[];i[t.unitProperty]["selectOptions"]=i[t.unitProperty]["selectOptions"]||[]}for(const o of e){const e=o.getObject();r=`${t.dataProperty}/${e[t.dataProperty]}`;if(t.dataProperty&&e[t.dataProperty]&&!u[r]){if(t.inputType!="CheckBox"){n=K.getTextArrangementInfo(t.dataProperty,t.descriptionPath,t.display,o);const i={text:n&&n.fullText||e[t.dataProperty],key:r,textInfo:n};a[t.dataProperty].push(i);a[t.dataProperty]["selectOptions"].push(i)}u[r]=e[t.dataProperty]}if(t.unitProperty&&e[t.unitProperty]){l=`${t.unitProperty}/${e[t.unitProperty]}`;if(!c[l]){if(t.inputType!="CheckBox"){n=K.getTextArrangementInfo(t.unitProperty,t.descriptionPath,t.display,o);const a={text:n&&n.fullText||e[t.unitProperty],key:l,textInfo:n};i[t.unitProperty].push(a);i[t.unitProperty]["selectOptions"].push(a)}c[l]=e[t.unitProperty]}}}a[t.dataProperty].textInfo={descriptionPath:t.descriptionPath,valuePath:t.dataProperty,displayMode:t.display};if(Object.keys(u).length===1){o.setProperty(t.dataProperty,r&&u[r])}if(Object.keys(c).length===1){o.setProperty(t.unitProperty,l&&c[l])}}s[t.dataProperty]=t.descriptionPath?[t.descriptionPath]:[]});t.forEach(function(t){let o={};if(t.dataProperty.indexOf("/")>-1){const e=K.getValueForMultiLevelPath(t.dataProperty,a);if(!e){e.push({text:n.leaveBlankValue,key:`Empty/${t.dataProperty}`})}else{K.setDefaultValuesToDialog(e,n,t)}o=e}else if(a[t.dataProperty]){a[t.dataProperty]=a[t.dataProperty]||[];K.setDefaultValuesToDialog(a[t.dataProperty],n,t);o=a[t.dataProperty]}if(i[t.unitProperty]&&i[t.unitProperty].length){K.setDefaultValuesToDialog(i[t.unitProperty],n,t,true);i[t.unitProperty].textInfo={};i[t.unitProperty].selectedKey=K.getDefaultSelectionPathComboBox(e,t.unitProperty);i[t.unitProperty].inputType=t.inputType}else if(t.dataProperty&&a[t.dataProperty]&&!a[t.dataProperty].length||t.unitProperty&&i[t.unitProperty]&&!i[t.unitProperty].length){const o=a[t.dataProperty]&&a[t.dataProperty].some(function(e){return e.text==="< Clear Values >"||e.text==="< Leave Blank >"});if(t.dataProperty&&!o){a[t.dataProperty].push({text:n.leaveBlankValue,key:`Empty/${t.dataProperty}`})}const r=i[t.unitProperty]&&i[t.unitProperty].some(function(e){return e.text==="< Clear Values >"||e.text==="< Leave Blank >"});if(t.unitProperty){if(!r){i[t.unitProperty].push({text:n.leaveBlankValue,key:`Empty/${t.unitProperty}`})}i[t.unitProperty].textInfo={};i[t.unitProperty].selectedKey=K.getDefaultSelectionPathComboBox(e,t.unitProperty);i[t.unitProperty].inputType=t.inputType}}if(t.isPropertyReadOnly&&typeof t.isPropertyReadOnly==="boolean"){l.push({property:t.dataProperty,value:t.isPropertyReadOnly,type:"Default"})}else if(t.isPropertyReadOnly&&t.isPropertyReadOnly.operands&&t.isPropertyReadOnly.operands[0]&&t.isPropertyReadOnly.operands[0].operand1&&t.isPropertyReadOnly.operands[0].operand2){l.push({property:t.dataProperty,propertyPath:t.isPropertyReadOnly.operands[0].operand1.path,propertyValue:t.isPropertyReadOnly.operands[0].operand2.value,type:"Path"})}if(t.editMode){o.visible=t.editMode===h.Editable||e.some(K.getFieldVisiblity.bind(K,t.editMode,c,t.dataProperty,o))}else{o.visible=true}o.selectedKey=K.getDefaultSelectionPathComboBox(e,t.dataProperty);o.inputType=t.inputType;o.unitProperty=t.unitProperty});return c},getDialogContext:function(e,t){let n=t===null||t===void 0?void 0:t.getBindingContext();if(!n){const t=e.getModel();const o=e.getRowBinding();const a=t.bindList(o.getPath(),o.getContext(),[],[],{$$updateGroupId:"submitLater"});a.refreshInternal=function(){};n=a.create({},true)}return n},onDialogOpen:function(e){const t=e.getSource();const n=t.getModel("fieldsInfo");n.setProperty("/isOpen",true)},closeDialog:function(e){e.close();e.destroy()},messageHandlingForMassEdit:async function(e,t,n,o,i,r){var s,l,u,c;const d=a.DraftStatus;const g=f.getLibraryResourceBundle("sap.fe.core");(s=n.getView())===null||s===void 0?void 0:(l=s.getBindingContext("internal"))===null||l===void 0?void 0:l.setProperty("getBoundMessagesForMassEdit",true);n.messageHandler.showMessages({onBeforeShowMessage:function(o,a){a.fnGetMessageSubtitle=x.setMessageSubtitle.bind({},e,t);const s=[];o.forEach(function(e){if(!e.getTarget()){s.push(e)}});if(i.length>0&&r.length===0){n.editFlow.setDraftStatus(d.Saved);const e=g.getText("C_MASS_EDIT_SUCCESS_TOAST");p.show(e)}else if(r.length<e.getSelectedContexts().length){n.editFlow.setDraftStatus(d.Saved)}else if(r.length===e.getSelectedContexts().length){n.editFlow.setDraftStatus(d.Clear)}if(n.getModel("ui").getProperty("/isEditable")&&s.length===0){a.showMessageBox=false;a.showMessageDialog=false}return a}});if(o.isOpen()){var y,P;K.closeDialog(o);(y=n.getView())===null||y===void 0?void 0:(P=y.getBindingContext("internal"))===null||P===void 0?void 0:P.setProperty("skipPatchHandlers",false)}(u=n.getView())===null||u===void 0?void 0:(c=u.getBindingContext("internal"))===null||c===void 0?void 0:c.setProperty("getBoundMessagesForMassEdit",false)},getSideEffectDataForKey:function(e,t,n,o){const a=e.getProperty("$Type");const i={};o.forEach(e=>{const o=e.keyValue;const r=t.getSideEffectsService();const s=r.computeFieldGroupIds(a,e.propertyFullyQualifiedName??"")??[];i[o]=n._sideEffects.getSideEffectsMapForFieldGroups(s)});return i},fnGetPathForSourceProperty:function(e,t,n){const o=e.indexOf("/")>0?"/"+t+"/"+e.substr(0,e.lastIndexOf("/")+1)+"@sapui.name":false,a=!o?Promise.resolve(t):n.requestObject(o);e=o?e.substr(e.lastIndexOf("/")+1):e;return{sPath:e,pOwnerEntity:a,sNavigationPath:o}},fnGetEntityTypeOfOwner:function(e,t,n,o,a){const i=n.getProperty("$Type");const{$Type:r,$Partner:s}=e.getObject(`${n}/${t}`);if(s){const t=e.getObject(`/${r}/${s}`);if(t){const e=t["$Type"];if(e!==i){a.push(o)}}}else{a.push(o)}return a},fnGetTargetsForMassEdit:function(e,t,n,o){const{targetProperties:a,targetEntities:i}=e;const r=[];let s=[];const l=t.getProperty("$Type");if(n===l){i===null||i===void 0?void 0:i.forEach(e=>{e=e["$NavigationPropertyPath"];let n;if(e.includes("/")){n=e.split("/")[0]}else{n=e}s=K.fnGetEntityTypeOfOwner(o,n,t,e,s)})}if(a.length){a.forEach(e=>{const{pOwnerEntity:a}=K.fnGetPathForSourceProperty(e,n,o);r.push(a.then(n=>{if(n===l){s.push(e)}else if(e.includes("/")){const n=e.split("/")[0];s=K.fnGetEntityTypeOfOwner(o,n,t,e,s)}return Promise.resolve(s)}))})}else{r.push(Promise.resolve(s))}return Promise.all(r)},checkIfEntityExistsAsTargetEntity:(e,t)=>{const n=t.getProperty("$Type");const o=Object.values(e).filter(e=>e.name.indexOf(n)==-1);const a=t.getPath().split("/").pop();const i=o.filter(e=>{const t=e.sideEffects.targetEntities;return t!==null&&t!==void 0&&t.filter(e=>e["$NavigationPropertyPath"]===a).length?e:false});return i.length},handleMassEditFieldUpdateAndRequestSideEffects:async function(e){const{oController:n,oFieldPromise:o,sideEffectsMap:a,textPaths:i,groupId:r,key:s,oEntitySetContext:l,oMetaModel:c,oSelectedContext:d,deferredTargetsForAQualifiedName:p}=e;const f=[o];const g=l.getProperty("$Type");const y=t.getAppComponent(n.getView());const P=y.getSideEffectsService();const h=K.checkIfEntityExistsAsTargetEntity(a,l);if(a){const e=Object.keys(a);const t=Object.values(a);const o={};p[s]={};for(const[a,i]of t.entries()){const t=e[a];const y=t.split("#")[0];const P=n._sideEffects.getContextForSideEffects(d,y);i.context=P;const v=n._sideEffects.getRegisteredFailedRequests();const x=v[P.getPath()];n._sideEffects.unregisterFailedSideEffectsForAContext(P);let m=[i.sideEffects];m=x&&x.length?m.concat(x):m;o[P]={};for(const e of m){if(!o[P].hasOwnProperty(e.fullyQualifiedName)){o[P][e.fullyQualifiedName]=true;let t=[],a=[],i;const d=async function(e){const{targetProperties:n,targetEntities:o}=e;const r=e.fullyQualifiedName.split("@")[0];const d=await K.fnGetTargetsForMassEdit(e,l,r,c);t=d[0];a=(n||[]).concat(o||[]);const f=e.triggerAction;const y=a.filter(e=>!t.includes(e));p[s][e.fullyQualifiedName]={aTargets:y,oContext:P,mSideEffect:e};if(f&&r===g){const t=u._isStaticAction(c.getObject(`/${f}`),f);if(!t){i=f}else{p[s][e.fullyQualifiedName]["TriggerAction"]=f}}else{p[s][e.fullyQualifiedName]["TriggerAction"]=f}if(h){t=[]}return{aTargets:t,TriggerAction:i}};f.push(n._sideEffects.requestSideEffects(e,P,r,d))}}}}if(i!==null&&i!==void 0&&i[s]&&i[s].length){f.push(P.requestSideEffects(i[s],d,r))}return Promise.allSettled(f)},createDialog:async function(n,o,a){const r="sap/fe/core/controls/massEdit/MassEditDialog",s=[],l=f.getLibraryResourceBundle("sap.fe.core"),u=K.getDefaultTextsForDialog(l,o.length,n),p=K.prepareDataForDialog(n,o,s),h=K.getDialogContext(n),v=K.setRuntimeModelOnDialog(o,s,u,h),m=n.getModel(),E=m.getMetaModel(),b=new i(p.getData(),E);const O=P.loadTemplate(r,"fragment");const T=await Promise.resolve(y.process(O,{name:r},{bindingContexts:{dataFieldModel:b.createBindingContext("/"),metaModel:E.createBindingContext("/"),contextPath:E.createBindingContext(E.getMetaPath(h.getPath()))},models:{dataFieldModel:b,metaModel:E,contextPath:E}}));const M=await g.load({definition:T});const C=new d({resizable:true,title:u.massEditTitle,content:[M],afterOpen:K.onDialogOpen,beginButton:new c({text:K.helpers.getExpBindingForApplyButtonTxt(u,p.getObject("/")),type:"Emphasized",press:async function(i){var r,s;x.removeBoundTransitionMessages();x.removeUnboundTransitionMessages();(r=a.getView())===null||r===void 0?void 0:(s=r.getBindingContext("internal"))===null||s===void 0?void 0:s.setProperty("skipPatchHandlers",true);const l=t.getAppComponent(a.getView());const u=i.getSource().getParent();const c=u.getModel("fieldsInfo");const d=c.getProperty("/results");const p=n&&n.getModel().getMetaModel(),f=n.data("metaPath"),g=p.getContext(f);const y=[];const P=c.getProperty("/textPaths");const h=c.getProperty("/readablePropertyData");let v;let m;const E=[];const b={};const O=o.length;const T={};const M=K.getSideEffectDataForKey(g,l,a,d);o.forEach(function(t,n){m=[];d.forEach(async function(o){if(!b.hasOwnProperty(o.keyValue)){b[o.keyValue]=0}if(M[o.keyValue]){m[o.keyValue]=M[o.keyValue]}if(h){h.some(function(e){if(o.keyValue===e.property){if(e.type==="Default"){return e.value===true}else if(e.type==="Path"&&e.propertyValue&&e.propertyPath){return t.getObject(e.propertyPath)===e.propertyValue}}})}v=`$auto.${n}`;const i=t.setProperty(o.keyValue,o.value,v).catch(function(n){y.push(t.getObject());e.error("Mass Edit: Something went wrong in updating entries.",n);b[o.keyValue]=b[o.keyValue]+1;return Promise.reject({isFieldUpdateFailed:true})});const r={oController:a,oFieldPromise:i,sideEffectsMap:M[o.keyValue],textPaths:P,groupId:v,key:o.keyValue,oEntitySetContext:g,oMetaModel:p,oSelectedContext:t,deferredTargetsForAQualifiedName:T};E.push(K.handleMassEditFieldUpdateAndRequestSideEffects(r))})});await Promise.allSettled(E).then(async function(){v=`$auto.massEditDeferred`;const e=[];const t=Object.values(T);const n=Object.keys(T);t.forEach((t,o)=>{const i=n[o];if(b[i]!==O){const n=Object.values(t);n.forEach(t=>{const{aTargets:n,oContext:o,TriggerAction:i,mSideEffect:r}=t;const s=function(){return n};const l=function(){return{aTargets:s(),TriggerAction:i}};e.push(a._sideEffects.requestSideEffects(r,o,v,l))})}})}).then(function(){K.messageHandlingForMassEdit(n,o,a,u,d,y)}).catch(e=>{K.closeDialog(C);return Promise.reject(e)})}}),endButton:new c({text:u.cancelButtonText,visible:K.helpers.hasEditableFieldsBinding(p.getObject("/"),true),press:function(e){const t=e.getSource().getParent();K.closeDialog(t)}})});C.setModel(v,"fieldsInfo");C.setModel(m);C.setBindingContext(h);return C},helpers:{getBindingExpForHasEditableFields:(e,t)=>{const n=e.reduce((e,t)=>N(e,L("/values/"+t.dataProperty+"/visible","fieldsInfo")),Q(false));return t?n:U(n)},getExpBindingForApplyButtonTxt:(e,t)=>{const n=K.helpers.getBindingExpForHasEditableFields(t,true);const o=G(n,Q(e.applyButtonText),Q(e.okButtonText));return q(o)},hasEditableFieldsBinding:(e,t)=>{const n=q(K.helpers.getBindingExpForHasEditableFields(e,t));if(n==="true"){return true}else if(n==="false"){return false}else{return n}}}};return K},false);
|
|
621
631
|
/*!
|
|
622
632
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
623
633
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -642,7 +652,12 @@ sap.ui.predefine("sap/fe/core/helpers/PasteHelper", ["sap/base/Log","sap/m/Messa
|
|
|
642
652
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
643
653
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
644
654
|
*/
|
|
645
|
-
sap.ui.predefine("sap/fe/core/helpers/
|
|
655
|
+
sap.ui.predefine("sap/fe/core/helpers/RecommendationHelper", [],function(){"use strict";var e={};const t={sortRecommendationsData(e){const t=e.recommendations;t.sort((e,t)=>{if(e.probability<t.probability){return 1}else if(e.probability>t.probability){return-1}else{return 0}});const r=e;delete r["recommendations"];r.additionalValues=t},transformRecommendationsForInternalStorage(e){if(e.hasOwnProperty("recommendations")){this.sortRecommendationsData(e);return}else if(Array.isArray(e)){e.forEach(e=>{Object.values(e).forEach(e=>{if(typeof e==="object"){this.transformRecommendationsForInternalStorage(e)}})})}else{Object.values(e).forEach(e=>{if(typeof e==="object"){this.transformRecommendationsForInternalStorage(e)}})}}};e.recommendationHelper=t;return e},false);
|
|
656
|
+
/*!
|
|
657
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
658
|
+
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
659
|
+
*/
|
|
660
|
+
sap.ui.predefine("sap/fe/core/helpers/ResourceModelHelper", ["sap/base/Log"],function(e){"use strict";var t={};function o(e){if(e.isA("sap.ui.core.mvc.Controller")||e.isA("sap.ui.core.mvc.ControllerExtension")){var t;return(t=e.getView())===null||t===void 0?void 0:t.getModel("sap.fe.i18n")}else{return e.getModel("sap.fe.i18n")}}t.getResourceModel=o;function r(t,o){const r=/{([A-Za-z0-9_.|@]+)>([A-Za-z0-9_.|]+)}/.exec(t);if(r){try{const e=o.getModel(r[1]).getResourceBundle();return e.getText(r[2])}catch(o){e.info(`Unable to retrieve localized text ${t}`)}}return t}t.getLocalizedText=r;return{getResourceModel:o,getLocalizedText:r}},false);
|
|
646
661
|
/*!
|
|
647
662
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
648
663
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -662,12 +677,17 @@ sap.ui.predefine("sap/fe/core/helpers/SizeHelper", ["sap/m/Button","sap/ui/core/
|
|
|
662
677
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
663
678
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
664
679
|
*/
|
|
665
|
-
sap.ui.predefine("sap/fe/core/helpers/StableIdHelper", [],function(){"use strict";var
|
|
680
|
+
sap.ui.predefine("sap/fe/core/helpers/StableIdHelper", [],function(){"use strict";var a={};const e=a=>{var e;const t=[a.SemanticObject.valueOf(),(e=a.Action)===null||e===void 0?void 0:e.valueOf()];if(a.RequiresContext){t.push("RequiresContext")}return t.filter(a=>a).join("::")};const t=a=>{const e=a.Value;if(e.path){return e.path}else if(e.Apply&&e.Function==="odata.concat"){return e.Apply.map(a=>a.$Path).join("::")}return s(e.replace(/ /g,"_"))};const i=a=>{const e=a.Value;if(e!==null&&e!==void 0&&e.path){return e.path}else if(e!==null&&e!==void 0&&e.Apply&&e.Function==="odata.concat"){return e.Apply.map(a=>a.$Path).join("::")}const t=a.Url;if(t!==null&&t!==void 0&&t.path){return t.path}else if(t!==null&&t!==void 0&&t.Apply&&t.Function==="odata.concat"){return t.Apply.map(a=>a.$Path).join("::")}return s(e===null||e===void 0?void 0:e.replace(/ /g,"_"))};const n=a=>/^([A-Za-z_][-A-Za-z0-9_.:]*)$/.test(a);const r=a=>{a=a.replace("com.sap.vocabularies.UI.v1.","");a=a.replace("com.sap.vocabularies.Communication.v1.","");return a};const o=function(a){var e;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;let i;switch(a.$Type){case"com.sap.vocabularies.UI.v1.ReferenceFacet":i=a.ID??a.Target.value;break;case"com.sap.vocabularies.UI.v1.CollectionFacet":i=a.ID??"undefined";break;case"com.sap.vocabularies.UI.v1.FieldGroupType":i=a.Label;break;default:i=l(a);break}i=(e=i)===null||e===void 0?void 0:e.toString();return i&&t?u(i):i};a.createIdForAnnotation=o;const c=a=>{const e=a.map(a=>{if(typeof a==="string"||!a){return a}return o(a.targetObject||a,false)});const t=e.filter(a=>a).join("::");return u(t)};a.generate=c;const l=function(a){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let r="";switch(a.$Type){case"com.sap.vocabularies.UI.v1.DataFieldForAction":r=`DataFieldForAction::${a.Action}`;break;case"com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation":r=`DataFieldForIntentBasedNavigation::${e(a)}`;break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":r=`DataFieldForAnnotation::${a.Target.value}`;break;case"com.sap.vocabularies.UI.v1.DataFieldWithAction":r=`DataFieldWithAction::${t(a)}::${a.Action}`;break;case"com.sap.vocabularies.UI.v1.DataField":r=`DataField::${t(a)}`;break;case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":r=`DataFieldWithIntentBasedNavigation::${t(a)}::${e(a)}`;break;case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":r=`DataFieldWithNavigationPath::${t(a)}`;if(a.Target.type==="NavigationPropertyPath"&&!n){r=`${r}::${a.Target.value}`}break;case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":r=`DataFieldWithUrl::${i(a)}`;break;default:break}return r?u(r):undefined};a.getStableIdPartFromDataField=l;const s=a=>{if(a.indexOf(" ")>=0){throw Error(`${a} - Spaces are not allowed in ID parts.`)}a=a.replace(/^\/|^@|^#|^\*/,"").replace(/\/$|@$|#$|\*$/,"").replace(/\/|@|\(|\)|#|\*/g,"::");while(a.indexOf("::::")>-1){a=a.replace("::::","::")}if(a.slice(-2)=="::"){a=a.slice(0,-2)}return a};a.replaceSpecialChars=s;const u=function(a){a=s(r(a));if(n(a)){return a}else{throw Error(`${a} - Stable Id could not be generated due to insufficient information.`)}};a.prepareId=u;return a},false);
|
|
666
681
|
/*!
|
|
667
682
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
668
683
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
669
684
|
*/
|
|
670
685
|
sap.ui.predefine("sap/fe/core/helpers/Synchronization", [],function(){"use strict";let e=function(){function e(){this._fnResolve=null;this._isResolved=false}var s=e.prototype;s.waitFor=function e(){if(this._isResolved){return Promise.resolve()}else{return new Promise(e=>{this._fnResolve=e})}};s.resolve=function e(){if(!this._isResolved){this._isResolved=true;if(this._fnResolve){this._fnResolve()}}};return e}();return e},false);
|
|
686
|
+
/*!
|
|
687
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
688
|
+
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
689
|
+
*/
|
|
690
|
+
sap.ui.predefine("sap/fe/core/helpers/TitleHelper", ["sap/fe/core/converters/helpers/BindingHelper","sap/fe/core/formatters/ValueFormatter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataFieldFormatters","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/UIFormatters"],function(e,t,n,o,a,r,i){"use strict";var l={};var s=r.getRelativePaths;var c=r.getContextRelativeTargetObjectPath;var v=r.enhanceDataModelPath;var d=a.getLabelForConnectedFields;var u=o.isPropertyPathExpression;var f=o.isPathAnnotationExpression;var p=n.transformRecursively;var T=n.resolveBindingString;var m=n.pathInModel;var E=n.or;var g=n.not;var _=n.isEmpty;var y=n.ifElse;var I=n.getExpressionFromAnnotation;var h=n.formatWithTypeInformation;var A=n.formatResult;var O=n.constant;var D=n.concat;var C=n.compileExpression;var N=e.UI;var b=e.Draft;const F=function(e,t){return p(e,"PathInModel",e=>{let n=e;if(e.modelName===undefined){const o=v(t,e.path);n=h(o.targetObject,e)}return n})};l.formatValueRecursively=F;const x=e=>{const t=e.targetObject;return u(t)?t.$target:t};const P=e=>{var t,n,o,a,r,i;const l=(t=e.targetEntitySet)===null||t===void 0?void 0:(n=t.annotations)===null||n===void 0?void 0:(o=n.Common)===null||o===void 0?void 0:o.DraftRoot;const s=(a=e.targetEntitySet)===null||a===void 0?void 0:(r=a.annotations)===null||r===void 0?void 0:(i=r.Common)===null||i===void 0?void 0:i.DraftNode;if(!!l||!!s){return g(b.IsNewObject)}return false};const M=e=>e._type==="Constant"?O(!e.value):_(e);const R=function(e,t,n,o){var a,r,l,c,v,d;const u=n===null||n===void 0?void 0:n.displayMode;const f=x(e);const p=u||i.getDisplayMode(e);const T=(a=f.annotations.Common)===null||a===void 0?void 0:a.Text;const m=s(e);const E=o??!!((r=e.targetObject)!==null&&r!==void 0&&(l=r.annotations)!==null&&l!==void 0&&(c=l.Common)!==null&&c!==void 0&&c.SemanticObject);t=h(f,t);let g=[t];if(p!=="Value"&&T){switch(p){case"Description":g=[I(T,m)];break;case"DescriptionValue":g=[I(T,m),y(!!((v=T.annotations)!==null&&v!==void 0&&(d=v.UI)!==null&&d!==void 0&&d.TextArrangement),t,y(E,t,O("")))];break;case"ValueDescription":g=[t,I(T,m)];break}}return g};const U=function(e,t){return p(e,"PathInModel",e=>{if(e.modelName!==undefined)return e;const n=v(t,e.path);return R(n,e)})};const B=function(e,n){let{TypeName:o}=n;const a=m("T_NEW_OBJECT","sap.fe.i18n");let r=a;if(e.resourceModel.getText("T_NEW_OBJECT",undefined,e.entitySet)===e.resourceModel.getText("T_NEW_OBJECT_DEFAULT",undefined,e.entitySet)){const t=e.resourceModel.getText("T_ANNOTATION_HELPER_DEFAULT_OBJECT_PAGE_HEADER_TITLE",undefined,e.entitySet);r=o?D(t,": ",T(o.toString())):a}return A([r],t.formatTitle)};const $=e=>{var t,n;const o=x(e);if(o&&(t=o.annotations)!==null&&t!==void 0&&(n=t.Core)!==null&&n!==void 0&&n.Computed){return N.IsInactive}else{return O(false)}};const j=function(e,t,n){let o;if(t.$Type==="com.sap.vocabularies.UI.v1.DataField"){var a,r,i,l,s,c;o=I(t.Value);if((a=t.Value)!==null&&a!==void 0&&(r=a.$target)!==null&&r!==void 0&&(i=r.annotations.Common)!==null&&i!==void 0&&(l=i.Text)!==null&&l!==void 0&&(s=l.annotations)!==null&&s!==void 0&&(c=s.UI)!==null&&c!==void 0&&c.TextArrangement){o=U(o,e)}o=F(o,e)}if(t.$Type==="com.sap.vocabularies.UI.v1.DataFieldForAnnotation"&&t.Target.$target.$Type==="com.sap.vocabularies.UI.v1.ConnectedFieldsType"){const t=v(e,"$Type/@UI.HeaderInfo/Title/Target/$AnnotationPath");o=d(t,n,false)}return o};const H=function(e,n,o,a,r,i){var l;let s=m("T_NEW_OBJECT","sap.fe.i18n");let d;if(a!==null&&a!==void 0&&(l=a.Title)!==null&&l!==void 0&&l.$Type&&r){d=j(e,a.Title,n);s=B(r,a)}if(f(e.targetObject)){e=v(e,e.targetObject.path)}const u=m(c(e));let p;if(d){p=Array.isArray(d)?d:[d]}else{p=R(e,u,o,i)}const T=M(p[0]);const _=$(e);const I=A(p,t.formatTitle);d=y(T,y(_,"",y(E(N.IsCreateMode,g(P(e))),s,m("T_ANNOTATION_HELPER_DEFAULT_HEADER_TITLE_NO_HEADER_INFO","sap.fe.i18n"))),I);return C(d)};l.getTitleBindingExpression=H;return l},false);
|
|
671
691
|
/*!
|
|
672
692
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
673
693
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -687,12 +707,12 @@ sap.ui.predefine("sap/fe/core/jsx-runtime/Fragment", [],function(){"use strict";
|
|
|
687
707
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
688
708
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
689
709
|
*/
|
|
690
|
-
sap.ui.predefine("sap/fe/core/jsx-runtime/ViewLoader", ["sap/fe/core/helpers/ClassSupport","sap/m/Page","sap/ui/base/ManagedObject","sap/ui/core/mvc/View","sap/fe/core/jsx-runtime/jsx"],function(e,r,t,i,n){"use strict";var a,o,s,c,l;var u={};var
|
|
710
|
+
sap.ui.predefine("sap/fe/core/jsx-runtime/ViewLoader", ["sap/fe/core/helpers/ClassSupport","sap/m/Page","sap/ui/base/ManagedObject","sap/ui/core/mvc/View","sap/fe/core/jsx-runtime/jsx"],function(e,r,t,i,n){"use strict";var a,o,s,c,l;var u={};var f=e.property;var p=e.defineUI5Class;function d(e,r,t,i){if(!t)return;Object.defineProperty(e,r,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(i):void 0})}function b(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function v(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;h(e,r)}function h(e,r){h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(r,t){r.__proto__=t;return r};return h(e,r)}function m(e,r,t,i,n){var a={};Object.keys(i).forEach(function(e){a[e]=i[e]});a.enumerable=!!a.enumerable;a.configurable=!!a.configurable;if("value"in a||a.initializer){a.writable=true}a=t.slice().reverse().reduce(function(t,i){return i(e,r,t)||t},a);if(n&&a.initializer!==void 0){a.value=a.initializer?a.initializer.call(n):void 0;a.initializer=undefined}if(a.initializer===void 0){Object.defineProperty(e,r,a);a=null}return a}function w(e,r){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let y=(a=p("sap.fe.core.jsx-runtime.MDXViewLoader"),o=f({type:"string"}),a(s=(c=function(e){v(i,e);function i(){var r;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}r=e.call(this,...i)||this;d(r,"viewName",l,b(r));return r}u=i;var a=i.prototype;a.loadDependency=function e(r){return new Promise(e=>{sap.ui.require([r],async r=>{e(r)})})};a.getControllerName=function e(){const r=this.getViewData();return r.controllerName};a.createContent=async function e(a){const o=this.getViewData();const s=o.viewContent||await this.loadDependency(o._mdxViewName);i.preprocessorData=this.mPreprocessors.xml;i.controller=a;const c=t.runWithPreprocessors(()=>s(),{id:e=>this.createId(e),settings:function(){this.controller=a}});return n(r,{class:"sapUiContentPadding",children:{content:c}})};return i}(i),l=m(c.prototype,"viewName",[o],{configurable:true,enumerable:true,writable:true,initializer:null}),c))||s);u=y;return u},false);
|
|
691
711
|
/*!
|
|
692
712
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
693
713
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
694
714
|
*/
|
|
695
|
-
sap.ui.predefine("sap/fe/core/jsx-runtime/jsx-control", ["sap/fe/core/helpers/BindingToolkit","sap/m/Text","sap/ui/base/DataType"],function(e,t,n){"use strict";var
|
|
715
|
+
sap.ui.predefine("sap/fe/core/jsx-runtime/jsx-control", ["sap/fe/core/helpers/BindingToolkit","sap/m/Text","sap/ui/base/DataType","sap/ui/core/mvc/EventHandlerResolver"],function(e,t,n,i){"use strict";var s=e.isConstant;var o=e.isBindingToolkitExpression;var l=e.compileExpression;var a=e.compileConstant;const r=function(e,t,n){if(n===undefined||typeof n==="string"){return}if(!e[t]){e[t]=[]}if(c(n)){e[t].push(n)}else if(Array.isArray(n)){n.forEach(n=>{r(e,t,n)})}else{Object.keys(n).forEach(t=>{r(e,t,n[t])})}};const c=function(e){var t,n;return e===null||e===void 0?void 0:(t=(n=e).isA)===null||t===void 0?void 0:t.call(n,"sap.ui.core.Element")};const f=function(e){return!!(e!==null&&e!==void 0&&e.getMetadata)};function d(e,t){const n=e.getAllAggregations();const i=e.getDefaultAggregationName();const s={};r(s,i,t.children);delete t.children;Object.keys(n).forEach(e=>{if(s[e]!==undefined){if(t.hasOwnProperty(e)){t[e].template=s[e][0]}else{t[e]=s[e]}}})}function u(e,t){let i;for(i in t){const d=t[i];if(o(d)){const e=d;if(s(e)){t[i]=a(e,false,true,true)}else{t[i]=l(e)}}else if(typeof d==="string"&&!d.startsWith("{")){var r,c,f;const s=(r=e.getAllProperties()[i])===null||r===void 0?void 0:(c=(f=r).getType)===null||c===void 0?void 0:c.call(f);if(s&&s instanceof n&&["boolean","int","float"].indexOf(s.getName())>-1){t[i]=s.parseValue(d)}}}}function p(e,t){const n=t["jsx:command"];if(n){const[s,o]=n.split("|");const l=e.getAllEvents()[o];if(l&&s.startsWith("cmd:")){t[l.name]=i.resolveEventHandler(s)}}delete t["jsx:command"]}const v=function(e,n,i,s){let o;if(e!==null&&e!==void 0&&e.isFragment){o=n.children}else if(e!==null&&e!==void 0&&e.isRuntime){const t=new e(n);o=t.getContent(s.view,s.appComponent)}else if(f(e)){const t=e.getMetadata();if(i!==undefined){n["key"]=i}p(t,n);d(t,n);const s=n.class;const l=n.ref;delete n.ref;delete n.class;u(t,n);o=new e(n);if(s){o.addStyleClass(s)}if(l){l.setCurrent(o)}}else if(typeof e==="function"){const t=e;o=t(n)}else{o=new t({text:"Missing component "+e})}return o};return v},false);
|
|
696
716
|
/*!
|
|
697
717
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
698
718
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -712,17 +732,17 @@ sap.ui.predefine("sap/fe/core/jsx-runtime/jsxs", ["sap/fe/core/jsx-runtime/jsx"]
|
|
|
712
732
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
713
733
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
714
734
|
*/
|
|
715
|
-
sap.ui.predefine("sap/fe/core/jsx-runtime/useMDXComponents", ["sap/base/Log","sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor","sap/fe/core/helpers/ClassSupport","sap/fe/core/jsx-runtime/ViewLoader","sap/fe/macros/macroLibrary","sap/m/FormattedText","sap/m/HBox","sap/m/Panel","sap/m/Title","sap/ui/codeeditor/CodeEditor","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/util/XMLPreprocessor","sap/fe/core/jsx-runtime/jsx"],function(e,r,t,n,i,a,o,
|
|
735
|
+
sap.ui.predefine("sap/fe/core/jsx-runtime/useMDXComponents", ["sap/base/Log","sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor","sap/fe/core/helpers/ClassSupport","sap/fe/core/jsx-runtime/ViewLoader","sap/fe/macros/macroLibrary","sap/m/FormattedText","sap/m/HBox","sap/m/Panel","sap/m/Title","sap/ui/codeeditor/CodeEditor","sap/ui/core/Fragment","sap/ui/core/library","sap/ui/core/util/XMLPreprocessor","sap/fe/core/jsx-runtime/jsx"],function(e,r,t,n,i,a,s,o,l,c,u,d,p,h){"use strict";var m=d.TitleLevel;var f=t.createReference;var g=r.parseXMLString;function v(e){const r=Array.isArray(e.children)?e.children.map(e=>{let r;if(typeof e==="string"){r=e}else{switch(e.getMetadata().getName()){case"sap.m.Link":r=`<a href="${e.getHref()}">${e.getText()}</a>`;break;case"sap.ui.codeeditor.CodeEditor":r=`<code>${e.getValue()}</code>`;break}}return r}).join(""):e.children;return h(a,{htmlText:r,class:"sapUiTinyMarginBottom"})}function x(e){return h(l,{text:e.children,level:m.H1,class:"sapUiTinyMarginBottom"})}function y(e){return`<a href={strValue.href}>${e.children}</a>`}function T(e){const r=`<ul>${Array.isArray(e.children)?e.children.join(""):e.children}</ul>`;return h(a,{htmlText:r})}function b(e){return`<li>${Array.isArray(e.children)?e.children.join(""):e.children}</li>`}function B(e){return h(l,{text:e.children,level:m.H2,class:"sapUiSmallMarginTop sapUiTinyMarginBottom"})}function M(e){return e.children}function L(r){const t=f();const a=r.binding?{path:r.binding}:undefined;const l=h(o,{headerText:r.headerText||"",class:"sapUiSmallMarginTop",children:h(s,{ref:t})});if(a){l.bindElement(a)}i.register();const c=p.process(g(`<root>${r.children}</root>`,true)[0],{name:"myBuildingBlockFragment"},n.preprocessorData);Promise.resolve(c).then(e=>u.load({definition:e.firstElementChild,controller:n.controller})).then(e=>{t.current.removeAllItems();t.current.addItem(e)}).catch(r=>{e.error(r)});return l}function j(e){var r,t,n;const i=((r=e.children)===null||r===void 0?void 0:r.trim())||"";const a=e.lineCount||Math.max((t=i.split("\n"))===null||t===void 0?void 0:t.length,3);const s=e.type||(e===null||e===void 0?void 0:(n=e.className)===null||n===void 0?void 0:n.split("-")[1])||"js";const o=h(c,{class:"sapUiTinyMargin",lineNumbers:e.lineNumbers||false,type:s,editable:e.editable||false,maxLines:a,height:"auto",width:"98%"});o.setValue(i);if(e.source){fetch(e.source).then(e=>e.text()).then(r=>{let t=r.split("\n");if(e.start){t=t.slice(e.start-1,e.end)}const n=Math.max(t.length,3);o.setMaxLines(n);o.setValue(t.join("\n"));return}).catch(e=>{o.setValue(e.message)})}return o}const k=function(){return{p:v,a:y,h1:x,h2:B,ul:T,li:b,pre:M,code:j,CodeBlock:j,BuildingBlockPlayground:L}};return k},false);
|
|
716
736
|
/*!
|
|
717
737
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
718
738
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
719
739
|
*/
|
|
720
|
-
sap.ui.predefine("sap/fe/core/library", ["sap/base/Log","sap/fe/core/formatters/FPMFormatter","sap/fe/core/formatters/StandardFormatter","sap/fe/core/formatters/ValueFormatter","sap/fe/core/services/AsyncComponentServiceFactory","sap/fe/core/services/CacheHandlerServiceFactory","sap/fe/core/services/EnvironmentServiceFactory","sap/fe/core/services/NavigationServiceFactory","sap/fe/core/services/ResourceModelServiceFactory","sap/fe/core/services/RoutingServiceFactory","sap/fe/core/services/ShellServicesFactory","sap/fe/core/services/SideEffectsServiceFactory","sap/fe/core/services/TemplatedViewServiceFactory","sap/fe/core/type/DateTimeWithTimezone","sap/fe/core/type/Email","sap/fe/core/type/FiscalDate","sap/fe/navigation/library","sap/fe/placeholder/library","sap/ui/base/DataType","sap/ui/core/Core","sap/ui/core/library","sap/ui/core/service/ServiceFactoryRegistry","sap/ui/fl/library","sap/ui/mdc/library"],function(e,a,r,i,o,t,s,n,c,l,p,f,d,v,u,y,S,m,g,C,b,F,w,D){"use strict";var E={};
|
|
740
|
+
sap.ui.predefine("sap/fe/core/library", ["sap/base/Log","sap/fe/core/formatters/FPMFormatter","sap/fe/core/formatters/StandardFormatter","sap/fe/core/formatters/ValueFormatter","sap/fe/core/services/AsyncComponentServiceFactory","sap/fe/core/services/CacheHandlerServiceFactory","sap/fe/core/services/EnvironmentServiceFactory","sap/fe/core/services/NavigationServiceFactory","sap/fe/core/services/ResourceModelServiceFactory","sap/fe/core/services/RoutingServiceFactory","sap/fe/core/services/ShellServicesFactory","sap/fe/core/services/SideEffectsServiceFactory","sap/fe/core/services/TemplatedViewServiceFactory","sap/fe/core/type/DateTimeWithTimezone","sap/fe/core/type/Email","sap/fe/core/type/FiscalDate","sap/fe/navigation/library","sap/fe/placeholder/library","sap/ui/base/DataType","sap/ui/core/Core","sap/ui/core/library","sap/ui/core/service/ServiceFactoryRegistry","sap/ui/fl/library","sap/ui/mdc/library"],function(e,a,r,i,o,t,s,n,c,l,p,f,d,v,u,y,S,m,g,C,b,F,w,D){"use strict";var E={};var M=s.EnvironmentServiceFactory;const N="sap.fe";E.feNamespace=N;const I="sap.fe.core";E.feCoreNamespace=I;const h="sap.fe.controllerextensions";E.feCextNamespace=h;const A="sap.fe.core.fpm";E.feFpmNamespace=A;const R=C.initLibrary({name:"sap.fe.core",dependencies:["sap.ui.core","sap.fe.navigation","sap.fe.placeholder","sap.ui.fl","sap.ui.mdc","sap.f"],types:["sap.fe.core.CreationMode","sap.fe.core.VariantManagement"],interfaces:[],controls:[],elements:[],version:"1.115.0",noLibraryCSS:true,extensions:{"sap.ui.support":{publicRules:true,internalRules:true},flChangeHandlers:{"sap.fe.core.controls.FilterBar":"sap/ui/mdc/flexibility/FilterBar"}}});R.InvocationGrouping={Isolated:"Isolated",ChangeSet:"ChangeSet"};R.CreationMode={NewPage:"NewPage",Sync:"Sync",Async:"Async",Deferred:"Deferred",Inline:"Inline",CreationRow:"CreationRow",InlineCreationRows:"InlineCreationRows",External:"External"};R.VariantManagement={None:"None",Page:"Page",Control:"Control"};R.Constants={CancelActionDialog:"cancel",ActionExecutionFailed:"actionExecutionFailed",CreationFailed:"creationFailed"};R.ProgrammingModel={Draft:"Draft",Sticky:"Sticky",NonDraft:"NonDraft"};R.DraftStatus={Saving:"Saving",Saved:"Saved",Clear:"Clear"};R.EditMode={Display:"Display",Editable:"Editable"};R.TemplateContentView={Hybrid:"Hybrid",Chart:"Chart",Table:"Table"};let L;(function(e){e["Enabled"]="Enabled";e["Disabled"]="Disabled";e["Auto"]="Auto"})(L||(L={}));E.InitialLoadMode=L;R.InitialLoadMode=L;R.StartupMode={Normal:"Normal",Deeplink:"Deeplink",Create:"Create",AutoCreate:"AutoCreate"};const T=g.createType("sap.fe.core.InitialLoadMode",{defaultValue:R.InitialLoadMode.Auto,isValid:function(a){if(typeof a==="boolean"){e.warning("DEPRECATED: boolean value not allowed for 'initialLoad' manifest setting - supported values are: Disabled|Enabled|Auto")}return a===undefined||a===null||typeof a==="boolean"||R.InitialLoadMode.hasOwnProperty(a)}});T.setNormalizer(function(e){if(!e){return R.InitialLoadMode.Disabled}return e===true?R.InitialLoadMode.Enabled:e});F.register("sap.fe.core.services.TemplatedViewService",new d);F.register("sap.fe.core.services.ResourceModelService",new c);F.register("sap.fe.core.services.CacheHandlerService",new t);F.register("sap.fe.core.services.NavigationService",new n);F.register("sap.fe.core.services.RoutingService",new l);F.register("sap.fe.core.services.SideEffectsService",new f);F.register("sap.fe.core.services.ShellServices",new p);F.register("sap.fe.core.services.EnvironmentService",new M);F.register("sap.fe.core.services.AsyncComponentService",new o);return R},false);
|
|
721
741
|
/*!
|
|
722
742
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
723
743
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
724
744
|
*/
|
|
725
|
-
sap.ui.predefine("sap/fe/core/manifestMerger/ChangePageConfiguration", ["sap/base/Log","sap/base/util/ObjectPath"],function(t,n){"use strict";var o={};let e={};function i(n,o){const e=o.getContent();const i=e===null||e===void 0?void 0:e.page;const a=e===null||e===void 0?void 0:e.entityPropertyChange;if((a===null||a===void 0?void 0:a.operation)!=="UPSERT"||!(a!==null&&a!==void 0&&a.propertyPath)||(a===null||a===void 0?void 0:a.propertyValue)===undefined||a!==null&&a!==void 0&&a.propertyPath.startsWith("/")){t.error("Change content is not a valid");return n}return r(n,i,a.propertyPath,a.propertyValue)}o.applyChange=i;function r(o,i,r,l,u){const
|
|
745
|
+
sap.ui.predefine("sap/fe/core/manifestMerger/ChangePageConfiguration", ["sap/base/Log","sap/base/util/ObjectPath"],function(t,n){"use strict";var o={};let e={};function i(n,o){const e=o.getContent();const i=e===null||e===void 0?void 0:e.page;const a=e===null||e===void 0?void 0:e.entityPropertyChange;if((a===null||a===void 0?void 0:a.operation)!=="UPSERT"||!(a!==null&&a!==void 0&&a.propertyPath)||(a===null||a===void 0?void 0:a.propertyValue)===undefined||a!==null&&a!==void 0&&a.propertyPath.startsWith("/")){t.error("Change content is not a valid");return n}return r(n,i,a.propertyPath,a.propertyValue)}o.applyChange=i;function r(o,i,r,l,u){const c=s(o,i);if(c){const t=a(r);n.set(t,l,c);if(u){e[i]=e[i]||[];e[i].push(r)}}else{t.error(`No Fiori elements page with ID ${i} found in routing targets.`)}return o}o.changeConfiguration=r;function a(t){let n=t.split("/");if(n[0]==="controlConfiguration"){let t="";for(let o=1;o<n.length;o++){t+=(o>1?"/":"")+n[o];if(t.indexOf("@")>-1){n=["controlConfiguration",t].concat(n.slice(o+1));break}}}return n}function s(t,n){var o,e;let i;const r=((o=t["sap.ui5"])===null||o===void 0?void 0:(e=o.routing)===null||e===void 0?void 0:e.targets)??{};for(const t in r){if(r[t].id===n&&r[t].name.startsWith("sap.fe.templates.")){var a;i=((a=r[t].options)===null||a===void 0?void 0:a.settings)??{};break}}return i}function l(t,o,i,r){o=o??{};const s=e[r]||[];for(const e of s){const i=a(e);const r=n.get(i,t);n.set(i,r,o)}return o}o.applyPageConfigurationChanges=l;function u(){e={}}o.cleanPageConfigurationChanges=u;return o},false);
|
|
726
746
|
/*!
|
|
727
747
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
728
748
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -732,17 +752,17 @@ sap.ui.predefine("sap/fe/core/operationsHelper", ["sap/m/MessageBox","sap/ui/cor
|
|
|
732
752
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
733
753
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
734
754
|
*/
|
|
735
|
-
sap.ui.predefine("sap/fe/core/rootView/Fcl.controller", ["sap/base/Log","sap/f/FlexibleColumnLayoutSemanticHelper","sap/f/library","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/m/Link","sap/m/MessageBox","sap/m/MessagePage","./RootViewBaseController"],function(e,t,n,o,i,r,l,s,a,u){"use strict";var g,c,C,h,d;var f=s.Icon;var m=s.Action;var p=i.usingExtension;var F=i.defineUI5Class;function w(e,t,n,o){if(!n)return;Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(o):void 0})}function E(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function P(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;b(e,t)}function b(e,t){b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,n){t.__proto__=n;return t};return b(e,t)}function M(e,t,n,o,i){var r={};Object.keys(o).forEach(function(e){r[e]=o[e]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(e,t,r);r=null}return r}function v(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}const y=n.LayoutType;const x={page:{names:["BeginColumn","MidColumn","EndColumn"],currentGetter:{prefix:"getCurrent",suffix:"Page"},getter:{prefix:"get",suffix:"Pages"}}};const T=function(e){if(e.isA("sap.ui.core.ComponentContainer")){return e.getComponentInstance().getRootControl()}else{return e}};let R=(g=F("sap.fe.core.rootView.Fcl"),c=p(o.override({applyInitialStateOnly:function(){return false},adaptBindingRefreshControls:function(e){this.getView().getController()._getAllVisibleViews().forEach(function(t){const n=Promise.resolve(t);e.push(n)})},adaptStateControls:function(e){this.getView().getController()._getAllVisibleViews().forEach(function(t){const n=Promise.resolve(t);e.push(n)})},onRestore:function(){const e=this.getView().getController();const t=e.getAppContentContainer();const n=t.getModel("internal");const o=n.getProperty("/pages");for(const e in o){n.setProperty(`/pages/${e}/restoreStatus`,"pending")}e.onContainerReady()},onSuspend:function(){const e=this.getView().getController();const t=e.getFclControl();const n=t.getBeginColumnPages()||[];const o=t.getMidColumnPages()||[];const i=t.getEndColumnPages()||[];const r=[].concat(n,o,i);r.forEach(function(e){const t=T(e);const n=t&&t.getController();if(n&&n.viewState&&n.viewState.onSuspend){n.viewState.onSuspend()}})}})),g(C=(h=function(n){P(o,n);function o(){var e;for(var t=arguments.length,o=new Array(t),i=0;i<t;i++){o[i]=arguments[i]}e=n.call(this,...o)||this;w(e,"viewState",d,E(e));return e}var i=o.prototype;i.onInit=function e(){n.prototype.onInit.call(this);this._internalInit()};i.manageDataReceived=function e(t){if(t.getParameter("error")){var n;const e=t.getParameter("path"),o=this._getAllVisibleViews().find(t=>{var n;return((n=t.getBindingContext())===null||n===void 0?void 0:n.getPath())===e});if(e&&o!==null&&o!==void 0&&(n=o.getBindingContext())!==null&&n!==void 0&&n.isKeepAlive()){o.getController()._routing.onDataReceived(t)}}};i.attachRouteMatchers=function e(){this.getRouter().attachBeforeRouteMatched(this._getViewForNavigatedRowsComputation,this);n.prototype.attachRouteMatchers.call(this);this._internalInit();this.getRouter().attachBeforeRouteMatched(this.onBeforeRouteMatched,this);this.getRouter().attachRouteMatched(this.onRouteMatched,this);this.getFclControl().attachStateChange(this._saveLayout,this)};i._internalInit=function e(){var t,n;if(this._oRouterProxy){return}this.sCurrentRouteName="";this.sCurrentArguments={};this.SQUERYKEYNAME="?query";const o=this.getAppComponent();const i=this.getAppComponent().getModel();i===null||i===void 0?void 0:i.attachEvent("dataReceived",this.manageDataReceived.bind(this));this._oRouterProxy=o.getRouterProxy();this._oFCLConfig={maxColumnsCount:3};const r=o.getManifest()["sap.ui5"].routing;if(r!==null&&r!==void 0&&(t=r.config)!==null&&t!==void 0&&t.flexibleColumnLayout){const e=r.config.flexibleColumnLayout;if(e.defaultTwoColumnLayoutType){this._oFCLConfig.defaultTwoColumnLayoutType=e.defaultTwoColumnLayoutType}if(e.defaultThreeColumnLayoutType){this._oFCLConfig.defaultThreeColumnLayoutType=e.defaultThreeColumnLayoutType}if(e.limitFCLToTwoColumns===true){this._oFCLConfig.maxColumnsCount=2}}if(r!==null&&r!==void 0&&(n=r.config)!==null&&n!==void 0&&n.controlAggregation){this._oFCLConfig.defaultControlAggregation=r.config.controlAggregation}this._initializeTargetAggregation(o);this._initializeRoutesInformation(o);this.getFclControl().attachStateChange(this.onStateChanged,this);this.getFclControl().attachAfterEndColumnNavigate(this.onStateChanged,this)};i.getFclControl=function e(){return this.getAppContentContainer()};i._saveLayout=function e(t){this.sPreviousLayout=t.getParameters().layout};i._getViewForNavigatedRowsComputation=function e(){const t=this._getAllVisibleViews(this.sPreviousLayout);const n=t[t.length-1];let o;this.getRouter().attachEventOnce("routeMatched",e=>{o=T(e.getParameter("views")[e.getParameter("views").length-1]);if(n){if(o.getViewData()&&o.getViewData().viewLevel===this._oFCLConfig.maxColumnsCount){this.oAdditionalViewForNavRowsComputation=o}if(o.getViewData()&&n.getViewData()&&n.getViewData().viewLevel<this._oFCLConfig.maxColumnsCount&&n.getViewData()&&n.getViewData().viewLevel>o.getViewData().viewLevel&&o!==n){this.oAdditionalViewForNavRowsComputation=n}}})};i.getViewForNavigatedRowsComputation=function e(){return this.oAdditionalViewForNavRowsComputation};i.onExit=function e(){this.getRouter().detachRouteMatched(this.onRouteMatched,this);this.getRouter().detachBeforeRouteMatched(this.onBeforeRouteMatched,this);this.getFclControl().detachStateChange(this.onStateChanged,this);this.getFclControl().detachAfterEndColumnNavigate(this.onStateChanged,this);this._oTargetsAggregation=null;this._oTargetsFromRoutePattern=null;u.prototype.onExit.bind(this)()};i.isFclEnabled=function e(){return true};i.displayErrorPage=function e(t,n){const o=this.getFclControl();if(this._oFCLConfig&&n.FCLLevel>=this._oFCLConfig.maxColumnsCount){n.FCLLevel=this._oFCLConfig.maxColumnsCount-1}if(!this.aMessagePages){this.aMessagePages=[null,null,null]}let i=this.aMessagePages[n.FCLLevel];if(!i){i=new a({showHeader:false,icon:"sap-icon://message-error"});this.aMessagePages[n.FCLLevel]=i;switch(n.FCLLevel){case 0:o.addBeginColumnPage(i);break;case 1:o.addMidColumnPage(i);break;default:o.addEndColumnPage(i)}}i.setText(t);if(n.technicalMessage){i.setCustomDescription(new l({text:n.description||n.technicalMessage,press:function(){s.show(n.technicalMessage,{icon:f.ERROR,title:n.title,actions:[m.OK],defaultAction:m.OK,details:n.technicalDetails||"",contentWidth:"60%"})}}))}else{i.setDescription(n.description||"")}o.to(i.getId());return Promise.resolve(true)};i._initializeTargetAggregation=function e(t){const n=t.getManifest(),o=n["sap.ui5"].routing?n["sap.ui5"].routing.targets:null;this._oTargetsAggregation={};if(o){Object.keys(o).forEach(e=>{const t=o[e];if(t.controlAggregation){this._oTargetsAggregation[e]={aggregation:t.controlAggregation,pattern:t.contextPattern}}else{this._oTargetsAggregation[e]={aggregation:"page",pattern:null}}})}};i._initializeRoutesInformation=function e(t){const n=t.getManifest(),o=n["sap.ui5"].routing?n["sap.ui5"].routing.routes:null;this._oTargetsFromRoutePattern={};if(o){o.forEach(e=>{this._oTargetsFromRoutePattern[e.pattern]=e.target})}};i.getCurrentArgument=function e(){return this.sCurrentArguments};i.getCurrentRouteName=function e(){return this.sCurrentRouteName};i.getConstants=function e(){return x};i.getTargetAggregation=function e(){return this._oTargetsAggregation};i.onRouteMatched=function e(t){const n=t.getParameter("name");this.sCurrentRouteName=n;this.sCurrentArguments=t.getParameter("arguments")};i._scrollTablesToLastNavigatedItems=function e(){const t=this._getAllVisibleViews();if(t.length>1||t[0].getViewData().viewLevel<this._oFCLConfig.maxColumnsCount){let e;const n=this.getViewForNavigatedRowsComputation();if(n&&t.indexOf(n)===-1){t.push(n)}for(let n=t.length-1;n>0;n--){const o=t[n],i=t[n-1];if(o.getBindingContext()){e=o.getBindingContext().getPath();i.getController()._scrollTablesToRow(e)}}}};i.onStateChanged=function e(t){const n=t.getParameter("isNavigationArrow");if(this.sCurrentArguments!==undefined){if(!this.sCurrentArguments[this.SQUERYKEYNAME]){this.sCurrentArguments[this.SQUERYKEYNAME]={}}this.sCurrentArguments[this.SQUERYKEYNAME].layout=t.getParameter("layout")}this._forceModelContextChangeOnBreadCrumbs(t);if(n){this._oRouterProxy.navTo(this.sCurrentRouteName,this.sCurrentArguments)}const o=this.getRightmostView();if(o){this._computeTitleHierarchy(o)}};i._forceModelContextChangeOnBreadCrumbs=function e(t){const n=t.getSource();let o=[];o=o.concat(n.getBeginColumnPages()).concat(n.getMidColumnPages()).concat(n.getEndColumnPages());o.forEach(function(e){const t=T(e);const n=t.byId&&t.byId("breadcrumbs");if(n){n.fireModelContextChange()}})};i._updateShareButtonVisibility=function e(t,n){let o;switch(n){case"OneColumn":o=t==="beginColumn";break;case"MidColumnFullScreen":case"ThreeColumnsBeginExpandedEndHidden":case"ThreeColumnsMidExpandedEndHidden":case"TwoColumnsBeginExpanded":case"TwoColumnsMidExpanded":o=t==="midColumn";break;case"EndColumnFullScreen":case"ThreeColumnsEndExpanded":case"ThreeColumnsMidExpanded":o=t==="endColumn";break;default:o=false}return o};i._updateEditButtonVisiblity=function e(t,n){let o=true;switch(t){case"midColumn":switch(n){case"TwoColumnsMidExpanded":case"ThreeColumnsMidExpanded":case"ThreeColumnsEndExpanded":o=false;break}break;case"endColumn":switch(n){case"ThreeColumnsMidExpanded":case"ThreeColumnsEndExpanded":o=false}break}return o};i.updateUIStateForView=function e(t,n){const o=this.getHelper().getCurrentUIState(),i=["beginColumn","midColumn","endColumn"],r=this.getFclControl().getLayout();let l;if(!t.getModel("fclhelper")){t.setModel(this._createHelperModel(),"fclhelper")}if(n>=this._oFCLConfig.maxColumnsCount){l=i[this._oFCLConfig.maxColumnsCount-1];o.actionButtonsInfo.midColumn.fullScreen=null;o.actionButtonsInfo.midColumn.exitFullScreen=null;o.actionButtonsInfo.midColumn.closeColumn=null;o.actionButtonsInfo.endColumn.exitFullScreen=null;o.actionButtonsInfo.endColumn.fullScreen=null;o.actionButtonsInfo.endColumn.closeColumn=null}else{l=i[n]}if(n>=this._oFCLConfig.maxColumnsCount||r==="EndColumnFullScreen"||r==="MidColumnFullScreen"||r==="OneColumn"){t.getModel("fclhelper").setProperty("/breadCrumbIsVisible",true)}else{t.getModel("fclhelper").setProperty("/breadCrumbIsVisible",false)}o.actionButtonsInfo.beginColumn={fullScreen:null,exitFullScreen:null,closeColumn:null};const s=Object.assign({},o.actionButtonsInfo[l]);s.switchVisible=s.fullScreen!==null||s.exitFullScreen!==null;s.switchIcon=s.fullScreen!==null?"sap-icon://full-screen":"sap-icon://exit-full-screen";s.isFullScreen=s.fullScreen===null;s.closeVisible=s.closeColumn!==null;t.getModel("fclhelper").setProperty("/actionButtonsInfo",s);t.getModel("fclhelper").setProperty("/showEditButton",this._updateEditButtonVisiblity(l,r));t.getModel("fclhelper").setProperty("/showShareIcon",this._updateShareButtonVisibility(l,r))};i.onBeforeRouteMatched=function e(t){if(t){const e=t.getParameters().arguments[this.SQUERYKEYNAME];let n=e?e.layout:null;if(!n){const e=this.getHelper().getNextUIState(0);n=e.layout}const o=t.getParameter("config").target;n=this._correctLayoutForTargets(n,o);if(n){this.getFclControl().setLayout(n)}}};i.getHelper=function e(){return t.getInstanceFor(this.getFclControl(),this._oFCLConfig)};i.calculateLayout=function e(t,n,o){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!o){o=i?this.getFclControl().getLayout():this.getHelper().getNextUIState(t).layout}const r=this.getRouter().getRouteByHash(`${n}?layout=${o}`);const l=this._oTargetsFromRoutePattern[r.getPattern()];return this._correctLayoutForTargets(o,l)};i._correctLayoutForTargets=function e(t,n){const o={2:["TwoColumnsMidExpanded","TwoColumnsBeginExpanded","MidColumnFullScreen"],3:["ThreeColumnsMidExpanded","ThreeColumnsEndExpanded","ThreeColumnsMidExpandedEndHidden","ThreeColumnsBeginExpandedEndHidden","MidColumnFullScreen","EndColumnFullScreen"]};if(n&&!Array.isArray(n)){n=[n]}if(!n){return t}else if(n.length>1){const e=o[n.length];if(e.indexOf(t)<0){t=e[0]}}else{const e=this.getTargetAggregation()[n[0]].aggregation||this._oFCLConfig.defaultControlAggregation;switch(e){case"beginColumnPages":t="OneColumn";break;case"midColumnPages":t="MidColumnFullScreen";break;case"endColumnPages":t="EndColumnFullScreen";break}}return t};i.getInstancedViews=function e(){const t=this.getFclControl();const n=[...t.getBeginColumnPages(),...t.getMidColumnPages(),...t.getEndColumnPages()];return n.map(e=>e.getComponentInstance().getRootControl())};i._getAllVisibleViews=function t(n){const o=[];n=n?n:this.getFclControl().getLayout();switch(n){case y.EndColumnFullScreen:if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.MidColumnFullScreen:if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;case y.OneColumn:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}break;case y.ThreeColumnsEndExpanded:case y.ThreeColumnsMidExpanded:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.TwoColumnsBeginExpanded:case y.TwoColumnsMidExpanded:case y.ThreeColumnsMidExpandedEndHidden:case y.ThreeColumnsBeginExpandedEndHidden:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;default:e.error(`Unhandled switch case for ${this.getFclControl().getLayout()}`)}return o};i._getAllViews=function t(n){const o=[];n=n?n:this.getFclControl().getLayout();switch(n){case y.OneColumn:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}break;case y.ThreeColumnsEndExpanded:case y.ThreeColumnsMidExpanded:case y.ThreeColumnsMidExpandedEndHidden:case y.ThreeColumnsBeginExpandedEndHidden:case y.EndColumnFullScreen:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.TwoColumnsBeginExpanded:case y.TwoColumnsMidExpanded:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;case y.MidColumnFullScreen:const t=this.getHelper().getCurrentUIState().actionButtonsInfo.midColumn.exitFullScreen;if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(t.indexOf("ThreeColumn")>=0){if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}}break;default:e.error(`Unhandled switch case for ${this.getFclControl().getLayout()}`)}return o};i.onContainerReady=function e(){const t=this._getAllVisibleViews();const n=t.reduce(function(e,t){e.push(r.restoreView(t));return e},[]);return Promise.all(n)};i.getRightmostContext=function e(){const t=this.getRightmostView();return t&&t.getBindingContext()};i.getRightmostView=function e(){return this._getAllViews().pop()};i.isContextUsedInPages=function e(t){if(!this.getFclControl()){return false}const n=this._getAllViews();for(const e of n){if(e){if(e.getBindingContext()===t){return true}}else{return false}}return false};i._setShellMenuTitle=function e(t,n,o){if(this.getHelper().getCurrentUIState().isFullScreen!==true){t.getShellServices().setTitle(o)}else{t.getShellServices().setTitle(n)}};return o}(u),d=M(h.prototype,"viewState",[c],{configurable:true,enumerable:true,writable:true,initializer:null}),h))||C);return R},false);
|
|
755
|
+
sap.ui.predefine("sap/fe/core/rootView/Fcl.controller", ["sap/base/Log","sap/f/FlexibleColumnLayoutSemanticHelper","sap/f/library","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/m/Link","sap/m/MessageBox","sap/m/MessagePage","./RootViewBaseController"],function(e,t,n,o,i,r,l,s,a,u){"use strict";var g,c,C,h,d;var f=s.Icon;var m=s.Action;var p=i.usingExtension;var F=i.defineUI5Class;function w(e,t,n,o){if(!n)return;Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(o):void 0})}function E(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function P(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;b(e,t)}function b(e,t){b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,n){t.__proto__=n;return t};return b(e,t)}function M(e,t,n,o,i){var r={};Object.keys(o).forEach(function(e){r[e]=o[e]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(e,t,r);r=null}return r}function v(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}const y=n.LayoutType;const x={page:{names:["BeginColumn","MidColumn","EndColumn"],currentGetter:{prefix:"getCurrent",suffix:"Page"},getter:{prefix:"get",suffix:"Pages"}}};const T=function(e){if(e.isA("sap.ui.core.ComponentContainer")){return e.getComponentInstance().getRootControl()}else{return e}};let R=(g=F("sap.fe.core.rootView.Fcl"),c=p(o.override({applyInitialStateOnly:function(){return false},adaptBindingRefreshControls:function(e){this.getView().getController()._getAllVisibleViews().forEach(function(t){const n=Promise.resolve(t);e.push(n)})},adaptStateControls:function(e){this.getView().getController()._getAllVisibleViews().forEach(function(t){const n=Promise.resolve(t);e.push(n)})},onRestore:function(){const e=this.getView().getController();const t=e.getAppContentContainer();const n=t.getModel("internal");const o=n.getProperty("/pages");for(const e in o){n.setProperty(`/pages/${e}/restoreStatus`,"pending")}e.onContainerReady()},onSuspend:function(){const e=this.getView().getController();const t=e.getFclControl();const n=t.getBeginColumnPages()||[];const o=t.getMidColumnPages()||[];const i=t.getEndColumnPages()||[];const r=[].concat(n,o,i);r.forEach(function(e){const t=T(e);const n=t&&t.getController();if(n&&n.viewState&&n.viewState.onSuspend){n.viewState.onSuspend()}})}})),g(C=(h=function(n){P(o,n);function o(){var e;for(var t=arguments.length,o=new Array(t),i=0;i<t;i++){o[i]=arguments[i]}e=n.call(this,...o)||this;w(e,"viewState",d,E(e));return e}var i=o.prototype;i.onInit=function e(){n.prototype.onInit.call(this);this._internalInit()};i.manageDataReceived=function e(t){if(t.getParameter("error")){var n;const e=t.getParameter("path"),o=this._getAllVisibleViews().find(t=>{var n;return((n=t.getBindingContext())===null||n===void 0?void 0:n.getPath())===e});if(e&&o!==null&&o!==void 0&&(n=o.getBindingContext())!==null&&n!==void 0&&n.isKeepAlive()){o.getController()._routing.onDataReceived(t)}}};i.attachRouteMatchers=function e(){this.getRouter().attachBeforeRouteMatched(this._getViewForNavigatedRowsComputation,this);n.prototype.attachRouteMatchers.call(this);this._internalInit();this.getRouter().attachBeforeRouteMatched(this.onBeforeRouteMatched,this);this.getRouter().attachRouteMatched(this.onRouteMatched,this);this.getFclControl().attachStateChange(this._saveLayout,this)};i._internalInit=function e(){var t,n;if(this._oRouterProxy){return}this.sCurrentRouteName="";this.sCurrentArguments={};this.SQUERYKEYNAME="?query";const o=this.getAppComponent();const i=this.getAppComponent().getModel();i===null||i===void 0?void 0:i.attachEvent("dataReceived",this.manageDataReceived.bind(this));this._oRouterProxy=o.getRouterProxy();this._oFCLConfig={maxColumnsCount:3};const r=o.getManifest()["sap.ui5"].routing;if(r!==null&&r!==void 0&&(t=r.config)!==null&&t!==void 0&&t.flexibleColumnLayout){const e=r.config.flexibleColumnLayout;if(e.defaultTwoColumnLayoutType){this._oFCLConfig.defaultTwoColumnLayoutType=e.defaultTwoColumnLayoutType}if(e.defaultThreeColumnLayoutType){this._oFCLConfig.defaultThreeColumnLayoutType=e.defaultThreeColumnLayoutType}if(e.limitFCLToTwoColumns===true){this._oFCLConfig.maxColumnsCount=2}}if(r!==null&&r!==void 0&&(n=r.config)!==null&&n!==void 0&&n.controlAggregation){this._oFCLConfig.defaultControlAggregation=r.config.controlAggregation}this._initializeTargetAggregation(o);this._initializeRoutesInformation(o);this.getFclControl().attachStateChange(this.onStateChanged,this);this.getFclControl().attachAfterEndColumnNavigate(this.onStateChanged,this)};i.getFclControl=function e(){return this.getAppContentContainer()};i._saveLayout=function e(t){this.sPreviousLayout=t.getParameters().layout};i._getViewForNavigatedRowsComputation=function e(){const t=this._getAllVisibleViews(this.sPreviousLayout);const n=t[t.length-1];let o;this.getRouter().attachEventOnce("routeMatched",e=>{o=T(e.getParameter("views")[e.getParameter("views").length-1]);if(n){if(o.getViewData()&&o.getViewData().viewLevel===this._oFCLConfig.maxColumnsCount){this.oAdditionalViewForNavRowsComputation=o}if(o.getViewData()&&n.getViewData()&&n.getViewData().viewLevel<this._oFCLConfig.maxColumnsCount&&n.getViewData()&&n.getViewData().viewLevel>o.getViewData().viewLevel&&o!==n){this.oAdditionalViewForNavRowsComputation=n}}})};i.getViewForNavigatedRowsComputation=function e(){return this.oAdditionalViewForNavRowsComputation};i.onExit=function e(){this.getRouter().detachRouteMatched(this.onRouteMatched,this);this.getRouter().detachBeforeRouteMatched(this.onBeforeRouteMatched,this);this.getFclControl().detachStateChange(this.onStateChanged,this);this.getFclControl().detachAfterEndColumnNavigate(this.onStateChanged,this);this._oTargetsAggregation=null;this._oTargetsFromRoutePattern=null;u.prototype.onExit.bind(this)()};i.isFclEnabled=function e(){return true};i.displayErrorPage=function e(t,n){const o=this.getFclControl();if(this._oFCLConfig&&n.FCLLevel>=this._oFCLConfig.maxColumnsCount){n.FCLLevel=this._oFCLConfig.maxColumnsCount-1}if(!this.aMessagePages){this.aMessagePages=[null,null,null]}let i=this.aMessagePages[n.FCLLevel];if(!i){i=new a({showHeader:false,icon:"sap-icon://message-error"});this.aMessagePages[n.FCLLevel]=i;switch(n.FCLLevel){case 0:o.addBeginColumnPage(i);break;case 1:o.addMidColumnPage(i);break;default:o.addEndColumnPage(i)}}i.setText(t);if(n.technicalMessage){i.setCustomDescription(new l({text:n.description||n.technicalMessage,press:function(){s.show(n.technicalMessage,{icon:f.ERROR,title:n.title,actions:[m.OK],defaultAction:m.OK,details:n.technicalDetails||"",contentWidth:"60%"})}}))}else{i.setDescription(n.description||"")}o.to(i.getId());return Promise.resolve(true)};i._initializeTargetAggregation=function e(t){const n=t.getManifest(),o=n["sap.ui5"].routing?n["sap.ui5"].routing.targets:null;this._oTargetsAggregation={};if(o){Object.keys(o).forEach(e=>{const t=o[e];if(t.controlAggregation){this._oTargetsAggregation[e]={aggregation:t.controlAggregation,pattern:t.contextPattern}}else{this._oTargetsAggregation[e]={aggregation:"page",pattern:null}}})}};i._initializeRoutesInformation=function e(t){const n=t.getManifest(),o=n["sap.ui5"].routing?n["sap.ui5"].routing.routes:null;this._oTargetsFromRoutePattern={};if(o){o.forEach(e=>{this._oTargetsFromRoutePattern[e.pattern]=e.target})}};i.getCurrentArgument=function e(){return this.sCurrentArguments};i.getCurrentRouteName=function e(){return this.sCurrentRouteName};i.getConstants=function e(){return x};i.getTargetAggregation=function e(){return this._oTargetsAggregation};i.onRouteMatched=function e(t){const n=t.getParameter("name");this.sCurrentRouteName=n;this.sCurrentArguments=t.getParameter("arguments")};i._scrollTablesToLastNavigatedItems=function e(){const t=this._getAllVisibleViews();if(t.length>1||t[0].getViewData().viewLevel<this._oFCLConfig.maxColumnsCount){let e;const n=this.getViewForNavigatedRowsComputation();if(n&&t.indexOf(n)===-1){t.push(n)}for(let n=t.length-1;n>0;n--){const o=t[n],i=t[n-1];if(o.getBindingContext()){e=o.getBindingContext().getPath();i.getController()._scrollTablesToRow(e)}}}};i.onStateChanged=function e(t){const n=t.getParameter("isNavigationArrow");if(this.sCurrentArguments!==undefined){if(!this.sCurrentArguments[this.SQUERYKEYNAME]){this.sCurrentArguments[this.SQUERYKEYNAME]={}}this.sCurrentArguments[this.SQUERYKEYNAME].layout=t.getParameter("layout")}this._forceModelContextChangeOnBreadCrumbs(t);if(n){this._oRouterProxy.navTo(this.sCurrentRouteName,this.sCurrentArguments)}const o=this.getRightmostView();if(o){this._computeTitleHierarchy(o)}};i._forceModelContextChangeOnBreadCrumbs=function e(t){const n=t.getSource();let o=[];o=o.concat(n.getBeginColumnPages()).concat(n.getMidColumnPages()).concat(n.getEndColumnPages());o.forEach(function(e){const t=T(e);const n=t.byId&&t.byId("breadcrumbs");if(n){n.fireModelContextChange()}})};i._updateShareButtonVisibility=function e(t,n){let o;switch(n){case"OneColumn":o=t==="beginColumn";break;case"MidColumnFullScreen":case"ThreeColumnsBeginExpandedEndHidden":case"ThreeColumnsMidExpandedEndHidden":case"TwoColumnsBeginExpanded":case"TwoColumnsMidExpanded":o=t==="midColumn";break;case"EndColumnFullScreen":case"ThreeColumnsEndExpanded":case"ThreeColumnsMidExpanded":o=t==="endColumn";break;default:o=false}return o};i._updateEditButtonVisiblity=function e(t,n){let o=true;switch(t){case"midColumn":switch(n){case"TwoColumnsMidExpanded":case"ThreeColumnsMidExpanded":case"ThreeColumnsEndExpanded":o=false;break}break;case"endColumn":switch(n){case"ThreeColumnsMidExpanded":case"ThreeColumnsEndExpanded":o=false}break}return o};i.updateUIStateForView=function e(t,n){const o=this.getHelper().getCurrentUIState(),i=["beginColumn","midColumn","endColumn"],r=this.getFclControl().getLayout();let l;if(!t.getModel("fclhelper")){t.setModel(this._createHelperModel(),"fclhelper")}if(n>=this._oFCLConfig.maxColumnsCount){l=i[this._oFCLConfig.maxColumnsCount-1];o.actionButtonsInfo.midColumn.fullScreen=null;o.actionButtonsInfo.midColumn.exitFullScreen=null;o.actionButtonsInfo.midColumn.closeColumn=null;o.actionButtonsInfo.endColumn.exitFullScreen=null;o.actionButtonsInfo.endColumn.fullScreen=null;o.actionButtonsInfo.endColumn.closeColumn=null}else{l=i[n]}if(n>=this._oFCLConfig.maxColumnsCount||r==="EndColumnFullScreen"||r==="MidColumnFullScreen"||r==="OneColumn"){t.getModel("fclhelper").setProperty("/breadCrumbIsVisible",true)}else{t.getModel("fclhelper").setProperty("/breadCrumbIsVisible",false)}o.actionButtonsInfo.beginColumn={fullScreen:null,exitFullScreen:null,closeColumn:null};const s=Object.assign({},o.actionButtonsInfo[l]);s.switchVisible=s.fullScreen!==null||s.exitFullScreen!==null;s.switchIcon=s.fullScreen!==null?"sap-icon://full-screen":"sap-icon://exit-full-screen";s.isFullScreen=s.fullScreen===null;s.closeVisible=s.closeColumn!==null;t.getModel("fclhelper").setProperty("/actionButtonsInfo",s);t.getModel("fclhelper").setProperty("/showEditButton",this._updateEditButtonVisiblity(l,r));t.getModel("fclhelper").setProperty("/showShareIcon",this._updateShareButtonVisibility(l,r))};i.onBeforeRouteMatched=function e(t){if(t){const e=t.getParameters().arguments[this.SQUERYKEYNAME];let n=e?e.layout:null;if(!n){const e=this.getHelper().getNextUIState(0);n=e.layout}const o=t.getParameter("config").target;n=this._correctLayoutForTargets(n,o);if(n){this.getFclControl().setLayout(n)}}};i.getHelper=function e(){return t.getInstanceFor(this.getFclControl(),this._oFCLConfig)};i.calculateLayout=function e(t,n,o){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!o){o=i?this.getFclControl().getLayout():this.getHelper().getNextUIState(t).layout}const r=this.getRouter().getRouteByHash(`${n}?layout=${o}`);const l=this._oTargetsFromRoutePattern[r.getPattern()];return this._correctLayoutForTargets(o,l)};i._correctLayoutForTargets=function e(t,n){const o={2:["TwoColumnsMidExpanded","TwoColumnsBeginExpanded","MidColumnFullScreen"],3:["ThreeColumnsMidExpanded","ThreeColumnsEndExpanded","ThreeColumnsMidExpandedEndHidden","ThreeColumnsBeginExpandedEndHidden","MidColumnFullScreen","EndColumnFullScreen"]};if(n&&!Array.isArray(n)){n=[n]}if(!n){return t}else if(n.length>1){const e=o[n.length];if(e.indexOf(t)<0){t=e[0]}}else{const e=this.getTargetAggregation()[n[0]].aggregation||this._oFCLConfig.defaultControlAggregation;switch(e){case"beginColumnPages":t="OneColumn";break;case"midColumnPages":t="MidColumnFullScreen";break;case"endColumnPages":t="EndColumnFullScreen";break}}return t};i.getInstancedViews=function e(){const t=this.getFclControl();const n=[...t.getBeginColumnPages(),...t.getMidColumnPages(),...t.getEndColumnPages()];return n.map(e=>{if(e&&e.isA("sap.ui.core.ComponentContainer")){return e.getComponentInstance().getRootControl()}else{return e}})};i._getAllVisibleViews=function t(n){const o=[];n=n?n:this.getFclControl().getLayout();switch(n){case y.EndColumnFullScreen:if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.MidColumnFullScreen:if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;case y.OneColumn:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}break;case y.ThreeColumnsEndExpanded:case y.ThreeColumnsMidExpanded:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.TwoColumnsBeginExpanded:case y.TwoColumnsMidExpanded:case y.ThreeColumnsMidExpandedEndHidden:case y.ThreeColumnsBeginExpandedEndHidden:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;default:e.error(`Unhandled switch case for ${this.getFclControl().getLayout()}`)}return o};i._getAllViews=function t(n){const o=[];n=n?n:this.getFclControl().getLayout();switch(n){case y.OneColumn:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}break;case y.ThreeColumnsEndExpanded:case y.ThreeColumnsMidExpanded:case y.ThreeColumnsMidExpandedEndHidden:case y.ThreeColumnsBeginExpandedEndHidden:case y.EndColumnFullScreen:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}break;case y.TwoColumnsBeginExpanded:case y.TwoColumnsMidExpanded:if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}break;case y.MidColumnFullScreen:const t=this.getHelper().getCurrentUIState().actionButtonsInfo.midColumn.exitFullScreen;if(this.getFclControl().getCurrentBeginColumnPage()){o.push(T(this.getFclControl().getCurrentBeginColumnPage()))}if(this.getFclControl().getCurrentMidColumnPage()){o.push(T(this.getFclControl().getCurrentMidColumnPage()))}if(t.indexOf("ThreeColumn")>=0){if(this.getFclControl().getCurrentEndColumnPage()){o.push(T(this.getFclControl().getCurrentEndColumnPage()))}}break;default:e.error(`Unhandled switch case for ${this.getFclControl().getLayout()}`)}return o};i.onContainerReady=function e(){const t=this._getAllVisibleViews();const n=t.reduce(function(e,t){e.push(r.restoreView(t));return e},[]);return Promise.all(n)};i.getRightmostContext=function e(){const t=this.getRightmostView();return t&&t.getBindingContext()};i.getRightmostView=function e(){return this._getAllViews().pop()};i.isContextUsedInPages=function e(t){if(!this.getFclControl()){return false}const n=this._getAllViews();for(const e of n){if(e){if(e.getBindingContext()===t){return true}}else{return false}}return false};i._setShellMenuTitle=function e(t,n,o){if(this.getHelper().getCurrentUIState().isFullScreen!==true){t.getShellServices().setTitle(o)}else{t.getShellServices().setTitle(n)}};return o}(u),d=M(h.prototype,"viewState",[c],{configurable:true,enumerable:true,writable:true,initializer:null}),h))||C);return R},false);
|
|
736
756
|
/*!
|
|
737
757
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
738
758
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
739
759
|
*/
|
|
740
|
-
sap.ui.predefine("sap/fe/core/rootView/NavContainer.controller", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/m/IllustratedMessage","sap/m/Page","./RootViewBaseController"],function(e,t,n,r,o,i,a,s){"use strict";var l,c,u,g,f;var p=r.usingExtension;var d=r.defineUI5Class;function h(e,t,n,r){if(!n)return;Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function C(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function v(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;w(e,t)}function w(e,t){w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,n){t.__proto__=n;return t};return w(e,t)}function P(e,t,n,r,o){var i={};Object.keys(r).forEach(function(e){i[e]=r[e]});i.enumerable=!!i.enumerable;i.configurable=!!i.configurable;if("value"in i||i.initializer){i.writable=true}i=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},i);if(o&&i.initializer!==void 0){i.value=i.initializer?i.initializer.call(o):void 0;i.initializer=undefined}if(i.initializer===void 0){Object.defineProperty(e,t,i);i=null}return i}function b(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let y=(l=d("sap.fe.core.rootView.NavContainer"),c=p(n.override({applyInitialStateOnly:function(){return false},adaptBindingRefreshControls:function(e){const t=this.getView(),n=t.getController();e.push(n._getCurrentPage(t))},adaptStateControls:function(e){const t=this.getView(),n=t.getController();e.push(n._getCurrentPage(t))},onRestore:function(){const e=this.getView(),t=e.getController(),n=t.getAppContentContainer();const r=n.getModel("internal");const o=r.getProperty("/pages");for(const e in o){r.setProperty(`/pages/${e}/restoreStatus`,"pending")}t.onContainerReady()},onSuspend:function(){const e=this.getView(),n=e.getController(),r=n.getAppContentContainer();const o=r.getPages();o.forEach(function(e){const n=t.getTargetView(e);const r=n&&n.getController();if(r&&r.viewState&&r.viewState.onSuspend){r.viewState.onSuspend()}})}})),l(u=(g=function(n){v(r,n);function r(){var e;for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}e=n.call(this,...r)||this;h(e,"viewState",f,C(e));return e}var s=r.prototype;s.onContainerReady=function e(){const n=this.getView(),r=this._getCurrentPage(n);return r.then(function(e){const n=t.getTargetView(e);return o.restoreView(n)})};s._getCurrentPage=function e(n){const r=this.getAppContentContainer();return new Promise(function(e){const o=r.getCurrentPage();if(o&&o.getController&&o.getController().isPlaceholder&&o.getController().isPlaceholder()){o.getController().attachEventOnce("targetPageInsertedInContainer",function(r){const o=r.getParameter("targetpage");const i=t.getTargetView(o);e(i!==n&&i)})}else{const r=t.getTargetView(o);e(r!==n&&r)}})};s._getNavContainer=function e(){return this.getAppContentContainer()};s.getInstancedViews=function e(){return this._getNavContainer().getPages().map(e=>e.getComponentInstance().getRootControl())};s.isFclEnabled=function e(){return false};s._scrollTablesToLastNavigatedItems=function e(){};s.displayErrorPage=function n(r,o){return new Promise((n,s)=>{try{const e=this._getNavContainer();if(!this.oPage){this.oPage=new a({showHeader:false});this.oIllustratedMessage=new i({title:r,description:o.description||"",illustrationType:`sapIllus-${o.errorType}`});this.oPage.insertContent(this.oIllustratedMessage,0);e.addPage(this.oPage)}if(o.handleShellBack){const n=e.getCurrentPage(),r=t.getAppComponent(e.getCurrentPage());r.getShellServices().setBackNavigation(function(){e.to(n.getId());r.getShellServices().setBackNavigation()})}e.attachAfterNavigate(function(){n(true)});e.to(this.oPage.getId())}catch(t){s(false);e.info(t)}})};return r}(s),f=P(g.prototype,"viewState",[c],{configurable:true,enumerable:true,writable:true,initializer:null}),g))||u);return y},false);
|
|
760
|
+
sap.ui.predefine("sap/fe/core/rootView/NavContainer.controller", ["sap/base/Log","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/KeepAliveHelper","sap/m/IllustratedMessage","sap/m/Page","./RootViewBaseController"],function(e,t,n,r,o,i,a,s){"use strict";var l,c,u,g,f;var p=r.usingExtension;var d=r.defineUI5Class;function h(e,t,n,r){if(!n)return;Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function C(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function v(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;w(e,t)}function w(e,t){w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,n){t.__proto__=n;return t};return w(e,t)}function P(e,t,n,r,o){var i={};Object.keys(r).forEach(function(e){i[e]=r[e]});i.enumerable=!!i.enumerable;i.configurable=!!i.configurable;if("value"in i||i.initializer){i.writable=true}i=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},i);if(o&&i.initializer!==void 0){i.value=i.initializer?i.initializer.call(o):void 0;i.initializer=undefined}if(i.initializer===void 0){Object.defineProperty(e,t,i);i=null}return i}function b(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let y=(l=d("sap.fe.core.rootView.NavContainer"),c=p(n.override({applyInitialStateOnly:function(){return false},adaptBindingRefreshControls:function(e){const t=this.getView(),n=t.getController();e.push(n._getCurrentPage(t))},adaptStateControls:function(e){const t=this.getView(),n=t.getController();e.push(n._getCurrentPage(t))},onRestore:function(){const e=this.getView(),t=e.getController(),n=t.getAppContentContainer();const r=n.getModel("internal");const o=r.getProperty("/pages");for(const e in o){r.setProperty(`/pages/${e}/restoreStatus`,"pending")}t.onContainerReady()},onSuspend:function(){const e=this.getView(),n=e.getController(),r=n.getAppContentContainer();const o=r.getPages();o.forEach(function(e){const n=t.getTargetView(e);const r=n&&n.getController();if(r&&r.viewState&&r.viewState.onSuspend){r.viewState.onSuspend()}})}})),l(u=(g=function(n){v(r,n);function r(){var e;for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}e=n.call(this,...r)||this;h(e,"viewState",f,C(e));return e}var s=r.prototype;s.onContainerReady=function e(){const n=this.getView(),r=this._getCurrentPage(n);return r.then(function(e){const n=t.getTargetView(e);return o.restoreView(n)})};s._getCurrentPage=function e(n){const r=this.getAppContentContainer();return new Promise(function(e){const o=r.getCurrentPage();if(o&&o.getController&&o.getController().isPlaceholder&&o.getController().isPlaceholder()){o.getController().attachEventOnce("targetPageInsertedInContainer",function(r){const o=r.getParameter("targetpage");const i=t.getTargetView(o);e(i!==n&&i)})}else{const r=t.getTargetView(o);e(r!==n&&r)}})};s._getNavContainer=function e(){return this.getAppContentContainer()};s.getInstancedViews=function e(){return this._getNavContainer().getPages().map(e=>{if(e&&e.isA("sap.ui.core.ComponentContainer")){return e.getComponentInstance().getRootControl()}else{return e}})};s.isFclEnabled=function e(){return false};s._scrollTablesToLastNavigatedItems=function e(){};s.displayErrorPage=function n(r,o){return new Promise((n,s)=>{try{const e=this._getNavContainer();if(!this.oPage){this.oPage=new a({showHeader:false});this.oIllustratedMessage=new i({title:r,description:o.description||"",illustrationType:`sapIllus-${o.errorType}`});this.oPage.insertContent(this.oIllustratedMessage,0);e.addPage(this.oPage)}if(o.handleShellBack){const n=e.getCurrentPage(),r=t.getAppComponent(e.getCurrentPage());r.getShellServices().setBackNavigation(function(){e.to(n.getId());r.getShellServices().setBackNavigation()})}e.attachAfterNavigate(function(){n(true)});e.to(this.oPage.getId())}catch(t){s(false);e.info(t)}})};return r}(s),f=P(g.prototype,"viewState",[c],{configurable:true,enumerable:true,writable:true,initializer:null}),g))||u);return y},false);
|
|
741
761
|
/*!
|
|
742
762
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
743
763
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
744
764
|
*/
|
|
745
|
-
sap.ui.predefine("sap/fe/core/rootView/RootViewBaseController", ["sap/base/Log","sap/fe/core/BaseController","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/Placeholder","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/SizeHelper","sap/ui/base/BindingParser","sap/ui/core/routing/HashChanger","sap/ui/model/json/JSONModel","sap/ui/model/odata/v4/AnnotationHelper"],function(e,t,o,n,i,r,a,s,c,l,u){"use strict";var
|
|
765
|
+
sap.ui.predefine("sap/fe/core/rootView/RootViewBaseController", ["sap/base/Log","sap/fe/core/BaseController","sap/fe/core/CommonUtils","sap/fe/core/controllerextensions/Placeholder","sap/fe/core/controllerextensions/ViewState","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/SizeHelper","sap/ui/base/BindingParser","sap/ui/core/routing/HashChanger","sap/ui/model/json/JSONModel","sap/ui/model/odata/v4/AnnotationHelper","sap/ui/thirdparty/URI"],function(e,t,o,n,i,r,a,s,c,l,u,h){"use strict";var f,p,g,d,m,y,b;var P=r.usingExtension;var C=r.defineUI5Class;function v(e,t,o,n){if(!o)return;Object.defineProperty(e,t,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(n):void 0})}function R(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;T(e,t)}function T(e,t){T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,o){t.__proto__=o;return t};return T(e,t)}function H(e,t,o,n,i){var r={};Object.keys(n).forEach(function(e){r[e]=n[e]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(e,t,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(e,t,r);r=null}return r}function w(e,t){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let I=(f=C("sap.fe.core.rootView.RootViewBaseController"),p=P(n),g=P(i),f(d=(m=function(t){_(n,t);function n(){var e;for(var o=arguments.length,n=new Array(o),i=0;i<o;i++){n[i]=arguments[i]}e=t.call(this,...n)||this;v(e,"oPlaceholder",y,R(e));v(e,"viewState",b,R(e));e.bIsComputingTitleHierachy=false;return e}var i=n.prototype;i.onInit=function e(){a.init();this._aHelperModels=[]};i.getPlaceholder=function e(){return this.oPlaceholder};i.attachRouteMatchers=function e(){this.oPlaceholder.attachRouteMatchers();this.getAppComponent().getRoutingService().attachAfterRouteMatched(this._onAfterRouteMatched,this)};i.onExit=function e(){this.getAppComponent().getRoutingService().detachAfterRouteMatched(this._onAfterRouteMatched,this);this.oRouter=undefined;a.exit();this._aHelperModels.forEach(function(e){e.destroy()})};i.getResourceBundle=function e(){return this.getOwnerComponent().getModel("i18n").getResourceBundle()};i.getRouter=function e(){if(!this.oRouter){this.oRouter=this.getAppComponent().getRouter()}return this.oRouter};i._createHelperModel=function e(){const t=new l;this._aHelperModels.push(t);return t};i.waitForRightMostViewReady=function e(t){return new Promise(function(e){const o=t.getParameter("views"),n=[];o.forEach(function(e){let t=e;if(e&&e.getComponentInstance){const o=e.getComponentInstance();t=o.getRootControl()}if(t&&t.getController()&&t.getController().pageReady){n.push(t)}});const i=n[n.length-1];if(i&&i.getController().pageReady.isPageReady()){e(i)}else if(i){i.getController().pageReady.attachEventOnce("pageReady",function(){e(i)})}})};i._onAfterRouteMatched=function t(o){if(!this._oRouteMatchedPromise){this._oRouteMatchedPromise=this.waitForRightMostViewReady(o).then(e=>{const t=this.getView().getContent()[0];if(t&&t.getAutoFocus&&!t.getAutoFocus()){t.setProperty("autoFocus",true,true)}const o=this.getAppComponent();this._scrollTablesToLastNavigatedItems();if(o.getEnvironmentCapabilities().getCapabilities().UShell){this._computeTitleHierarchy(e)}const n=o.getRouterProxy().isFocusForced();o.getRouterProxy().setFocusForced(false);if(e.getController()&&e.getController().onPageReady&&e.getParent().onPageReady){e.getParent().onPageReady({forceFocus:n})}if(!n){o.getRouterProxy().restoreFocusForCurrentHash()}if(this.onContainerReady){this.onContainerReady()}}).catch(function(t){e.error("An error occurs while computing the title hierarchy and calling focus method",t)}).finally(()=>{this._oRouteMatchedPromise=null})}};i._getTitleHierarchyCache=function e(){if(!this.oTitleHierarchyCache){this.oTitleHierarchyCache={}}return this.oTitleHierarchyCache};i._computeTitleInfo=function e(t,o,n){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";const r=n.split("/");if(r[r.length-1].indexOf("?")===-1){n+="?restoreHistory=true"}else{n+="&restoreHistory=true"}return{title:t,subtitle:o,intent:n,icon:i}};i._formatTitle=function e(t,o,n){let i="";switch(t){case"Value":i=`${o}`;break;case"ValueDescription":i=`${o} (${n})`;break;case"DescriptionValue":i=`${n} (${o})`;break;case"Description":i=`${n}`;break;default:}return i};i._fetchTitleValue=async function t(n){const i=this.getAppComponent(),r=this.getView().getModel(),a=i.getMetaModel(),c=a.getMetaPath(n),l=r.createBindingContext(n),h=u.format(a.getObject(`${c}/@com.sap.vocabularies.UI.v1.HeaderInfo/Title/Value`),{context:a.createBindingContext("/")});if(!h){return Promise.resolve("")}const f=u.format(a.getObject(`${c}/@com.sap.vocabularies.UI.v1.HeaderInfo/Title/Value/$Path@com.sap.vocabularies.Common.v1.Text`),{context:a.createBindingContext("/")}),p=a.getObject(`${c}/@com.sap.vocabularies.UI.v1.HeaderInfo/Title/Value/$Path@`),g=[],d=s.complexParser(h),m=new Promise(function(e){const t=o.computeDisplayMode(p);e(t)});g.push(m);const y=d.parts?d.parts[0].path:d.path,b=d.formatter,P=r.bindProperty(y,l,{$$groupId:"$auto.Heroes"});P.initialize();const C=new Promise(function(e){const t=function(o){const n=b?b(o.getSource().getValue()):o.getSource().getValue();P.detachChange(t);e(n)};P.attachChange(t)});g.push(C);if(f){const e=s.complexParser(f);let t=e.parts?e.parts[0].path:e.path;t=y.lastIndexOf("/")>-1?`${y.slice(0,y.lastIndexOf("/"))}/${t}`:t;const o=e.formatter,n=r.bindProperty(t,l,{$$groupId:"$auto.Heroes"});n.initialize();const i=new Promise(function(e){const t=function(i){const r=o?o(i.getSource().getValue()):i.getSource().getValue();n.detachChange(t);e(r)};n.attachChange(t)});g.push(i)}try{const e=await Promise.all(g);let t="";if(typeof e!=="string"){t=this._formatTitle(e[0],e[1],e[2])}return t}catch(t){e.error("Error while fetching the title from the header info :"+t)}return""};i._getAppSpecificHash=function e(){const t=c.getInstance();return"hrefForAppSpecificHash"in t?h.decode(t.hrefForAppSpecificHash("")):"#/"};i._getHash=function e(){return c.getInstance().getHash()};i.getTitleInfoFromPath=function e(t){const o=this._getTitleHierarchyCache();if(o[t]){return Promise.resolve(o[t])}const n=this.getAppComponent().getMetaModel();const i=n.getMetaPath(t);const r=n.getObject(`${i}/@com.sap.vocabularies.UI.v1.HeaderInfo/TypeName`);const a=this._getAppSpecificHash();const s=a+t.slice(1);return this._fetchTitleValue(t).then(e=>{const n=this._computeTitleInfo(r,e,s);o[t]=n;return n})};i._ensureHierarchyElementsAreStrings=function e(t){const o=[];for(const e in t){const n=t[e];const i={};for(const e in n){i[e]=typeof n[e]!=="string"?String(n[e]):n[e]}o.push(i)}return o};i._getTargetTypeFromHash=function e(t){var o;const n=this.getAppComponent();let i="";const r=((o=n.getManifestEntry("sap.ui5").routing)===null||o===void 0?void 0:o.routes)??[];for(const e of r){const o=n.getRouter().getRoute(e.name);if(o!==null&&o!==void 0&&o.match(t)){const t=Array.isArray(e.target)?e.target[0]:e.target;i=n.getRouter().getTarget(t)._oOptions.name;break}}return i};i._computeTitleHierarchy=function t(o){const n=this.getAppComponent(),i=o.getBindingContext(),r=o.getParent(),a=[],s=this._getAppSpecificHash(),c=n.getManifestEntry("sap.app"),l=c.title||"",u=c.subTitle||"",h=c.icon||"";let f,p;if(r&&r._getPageTitleInformation){if(i){if(this._getTargetTypeFromHash("")==="sap.fe.templates.ListReport"){a.push(Promise.resolve(this._computeTitleInfo(l,u,s,h)))}p=i.getPath();const e=p.split("/");let t="";e.shift();e.pop();e.forEach(e=>{t+=`/${e}`;const o=n.getMetaModel(),i=o.getMetaPath(t),r=o.getObject(`${i}/@com.sap.vocabularies.Common.v1.ResultContext`);if(!r){a.push(this.getTitleInfoFromPath(t))}})}f=r._getPageTitleInformation();f=this._computeTitleInfo(f.title,f.subtitle,s+this._getHash());if(i){this._getTitleHierarchyCache()[p]=f}else{this._getTitleHierarchyCache()[s]=f}}else{a.push(Promise.reject("Title information missing in HeaderInfo"))}return Promise.all(a).then(e=>{const t=this._ensureHierarchyElementsAreStrings(e),o=f.title;t.reverse();n.getShellServices().setHierarchy(t);this._setShellMenuTitle(n,o,l)}).catch(function(t){e.error(t)}).finally(()=>{this.bIsComputingTitleHierachy=false}).catch(function(t){e.error(t)})};i.calculateLayout=function e(t,o,n){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return null};i.onContextBoundToView=function e(t){if(t){const e=this.getView().getModel("internal").getProperty("/deepestPath"),o=t.getPath();if(!e||e.indexOf(o)!==0){this.getView().getModel("internal").setProperty("/deepestPath",o,undefined,true)}}};i.displayErrorPage=function e(t,o){return Promise.resolve(true)};i.updateUIStateForView=function e(t,o){};i.getInstancedViews=function e(){return[]};i._scrollTablesToLastNavigatedItems=function e(){};i.isFclEnabled=function e(){return false};i._setShellMenuTitle=function e(t,o,n){t.getShellServices().setTitle(o)};i.getAppContentContainer=function e(){var t,o;const n=this.getAppComponent();const i=((t=n.getManifestEntry("sap.ui5").routing)===null||t===void 0?void 0:(o=t.config)===null||o===void 0?void 0:o.controlId)??"appContent";return this.getView().byId(i)};return n}(t),y=H(m.prototype,"oPlaceholder",[p],{configurable:true,enumerable:true,writable:true,initializer:null}),b=H(m.prototype,"viewState",[g],{configurable:true,enumerable:true,writable:true,initializer:null}),m))||d);return I},false);
|
|
746
766
|
/*!
|
|
747
767
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
748
768
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -757,12 +777,12 @@ sap.ui.predefine("sap/fe/core/services/CacheHandlerServiceFactory", ["sap/base/s
|
|
|
757
777
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
758
778
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
759
779
|
*/
|
|
760
|
-
sap.ui.predefine("sap/fe/core/services/EnvironmentServiceFactory", ["sap/ui/core/Core","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","sap/ui/VersionInfo","../converters/MetaModelConverter"],function(t,
|
|
780
|
+
sap.ui.predefine("sap/fe/core/services/EnvironmentServiceFactory", ["sap/suite/ui/commons/collaboration/CollaborationHelper","sap/ui/core/Core","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","sap/ui/VersionInfo","../converters/MetaModelConverter"],function(e,t,i,n,r,a){"use strict";var s={};var o=a.DefaultEnvironmentCapabilities;function c(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;l(e,t)}function l(e,t){l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,i){t.__proto__=i;return t};return l(e,t)}let p=function(e){c(i,e);function i(){return e.apply(this,arguments)||this}s.EnvironmentCapabilitiesService=i;var n=i.prototype;n.init=function e(){this.initPromise=new Promise((e,t)=>{this.resolveFn=e;this.rejectFn=t});const t=this.getContext();this.environmentCapabilities=Object.assign({},o);r.load().then(async e=>{this.environmentCapabilities.Chart=!!e.libraries.find(e=>e.name==="sap.viz");this.environmentCapabilities.MicroChart=!!e.libraries.find(e=>e.name==="sap.suite.ui.microchart");this.environmentCapabilities.UShell=!!(sap&&sap.ushell&&sap.ushell.Container);this.environmentCapabilities.IntentBasedNavigation=!!(sap&&sap.ushell&&sap.ushell.Container);this.environmentCapabilities.InsightsSupported=!!e.libraries.find(e=>e.name==="sap.insights")&&await h();this.environmentCapabilities=Object.assign(this.environmentCapabilities,t.settings);this.resolveFn(this);return null}).catch(this.rejectFn)};i.resolveLibrary=async function e(i){return new Promise(function(e){try{t.loadLibrary(`${i.replace(/\./g,"/")}`,{async:true}).then(function(){e(true)}).catch(function(){e(false)})}catch(t){e(false)}})};n.setCapabilities=function e(t){this.environmentCapabilities=t};n.setCapability=function e(t,i){this.environmentCapabilities[t]=i};n.getCapabilities=function e(){return this.environmentCapabilities};n.getInterface=function e(){return this};return i}(i);s.EnvironmentCapabilitiesService=p;let u=function(e){c(t,e);function t(){return e.apply(this,arguments)||this}s.EnvironmentServiceFactory=t;var i=t.prototype;i.createInstance=function e(t){const i=new p(t);return i.initPromise};return t}(n);s.EnvironmentServiceFactory=u;async function h(){return new Promise(async e=>{try{const t=await p.resolveLibrary("sap.insights");if(t){sap.ui.require(["sap/insights/CardHelper"],async t=>{try{await t.getServiceAsync("UIService");e(!await v())}catch{e(false)}})}else{e(false)}}catch{e(false)}})}s.getInsightsEnabled=h;async function v(){let t=false;try{t=await e.isTeamsModeActive()}catch{return false}return t}s.getMSTeamsActive=v;return s},false);
|
|
761
781
|
/*!
|
|
762
782
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
763
783
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
764
784
|
*/
|
|
765
|
-
sap.ui.predefine("sap/fe/core/services/NavigationServiceFactory", ["sap/fe/navigation/NavigationHandler","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory"],function(t,
|
|
785
|
+
sap.ui.predefine("sap/fe/core/services/NavigationServiceFactory", ["sap/fe/navigation/NavigationHandler","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory"],function(e,t,n){"use strict";var r={};function i(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function a(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;o(e,t)}function o(e,t){o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(t,n){t.__proto__=n;return t};return o(e,t)}let s=function(t){a(n,t);function n(){return t.apply(this,arguments)||this}r.NavigationService=n;var i=n.prototype;i.init=function t(){const n=this.getContext(),r=n&&n.scopeObject;this.oNavHandler=new e(r);this.oNavHandler.setModel(r.getModel());this.initPromise=Promise.resolve(this)};i.exit=function e(){this.oNavHandler.destroy()};i.navigate=function e(t,n,r,i,a,o,s){this.oNavHandler.navigate(t,n,r,i,a,o,s)};i.parseNavigation=function e(){return this.oNavHandler.parseNavigation()};i._processBeforeSmartLinkPopoverOpens=function e(t,n,r){return this.oNavHandler.processBeforeSmartLinkPopoverOpens(t,n,r)};i.getAppStateKeyAndUrlParameters=function e(t){return this.oNavHandler._getAppStateKeyAndUrlParameters(t)};i.getTechnicalParameters=function e(){return this.oNavHandler.getTechnicalParameters()};i.setTechnicalParameters=function e(t){this.oNavHandler.setTechnicalParameters(t)};i.setModel=function e(t){this.oNavHandler.setModel(t)};i.storeInnerAppStateAsync=function e(t,n,r){return new Promise((e,i)=>this.oNavHandler.storeInnerAppStateAsync(t,n,r).then(e,i))};i.storeInnerAppStateWithImmediateReturn=function e(t,n){return this.oNavHandler.storeInnerAppStateWithImmediateReturn(t,n)};i.replaceHash=function e(t){this.oNavHandler.replaceHash(t)};i.replaceInnerAppStateKey=function e(t,n){return this.oNavHandler._replaceInnerAppStateKey(t,n)};i.getUrlParametersFromSelectionVariant=function e(t){return this.oNavHandler._getURLParametersFromSelectionVariant(t)};i.saveAppStateWithImmediateReturn=function e(t){if(t){const e=t.toJSONString(),n=JSON.parse(e),r={selectionVariant:n},i=this.oNavHandler._saveAppStateWithImmediateReturn(r);return i!==null&&i!==void 0&&i.appStateKey?i.appStateKey:""}else{return undefined}};i.mixAttributesAndSelectionVariant=function e(t,n,r){return this.oNavHandler.mixAttributesAndSelectionVariant(t,n,r)};i.constructContextUrl=function e(t,n){return this.oNavHandler.constructContextUrl(t,n)};i.getInterface=function e(){return this};i.getIAppStateKey=function e(){return this.oNavHandler.getIAppStateKey()};return n}(t);r.NavigationService=s;function c(){return{}}function u(){return Promise.resolve({})}function p(){const e=jQuery.Deferred();e.resolve({},{},"initial");return e.promise()}function l(){return""}let v=function(e){a(t,e);function t(){var t;t=e.call(this)||this;t.createEmptyAppState=c;t.storeInnerAppStateWithImmediateReturn=c;t.mixAttributesAndSelectionVariant=c;t.getAppState=u;t.getStartupAppState=u;t.parseNavigation=p;t.constructContextUrl=l;t.getIAppStateKey=l;t.initPromise=Promise.resolve(i(t));return t}r.NavigationServicesMock=t;var n=t.prototype;n.getInterface=function e(){return this};n.replaceInnerAppStateKey=function e(t){return t?t:""};n.navigate=function e(){};return t}(n);r.NavigationServicesMock=v;let f=function(e){a(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;n.createInstance=function e(t){const n=sap.ushell&&sap.ushell.Container?new s(t):new v;return n.initPromise.then(function(e){return e})};return t}(n);return f},false);
|
|
766
786
|
/*!
|
|
767
787
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
768
788
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -772,7 +792,7 @@ sap.ui.predefine("sap/fe/core/services/ResourceModelServiceFactory", ["sap/fe/co
|
|
|
772
792
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
773
793
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
774
794
|
*/
|
|
775
|
-
sap.ui.predefine("sap/fe/core/services/RoutingServiceFactory", ["sap/base/Log","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/controllerextensions/Placeholder","sap/fe/core/controllerextensions/routing/NavigationReason","sap/fe/core/helpers/AppStartupHelper","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/suite/ui/commons/collaboration/CollaborationHelper","sap/ui/base/BindingParser","sap/ui/base/EventProvider","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","sap/ui/model/odata/v4/ODataUtils"],function(t,e,o,n,i,r,a,s,u,h,c,l,g,f,p,d){"use strict";var m,v,P,C,R,_,y;var M={};var b=a.event;var x=a.defineUI5Class;function L(t,e,o,n){if(!o)return;Object.defineProperty(t,e,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(n):void 0})}function T(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function S(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;w(t,e)}function w(t,e){w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return w(t,e)}function E(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}function I(t,e){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let A=(m=x("sap.fe.core.services.RoutingServiceEventing"),v=b(),P=b(),m(C=(R=function(t){S(e,t);function e(){var e;for(var o=arguments.length,n=new Array(o),i=0;i<o;i++){n[i]=arguments[i]}e=t.call(this,...n)||this;L(e,"routeMatched",_,T(e));L(e,"afterRouteMatched",y,T(e));return e}return e}(g),_=E(R.prototype,"routeMatched",[v],{configurable:true,enumerable:true,writable:true,initializer:null}),y=E(R.prototype,"afterRouteMatched",[P],{configurable:true,enumerable:true,writable:true,initializer:null}),R))||C);let O=function(a){S(g,a);function g(){var t;for(var e=arguments.length,o=new Array(e),n=0;n<e;n++){o[n]=arguments[n]}t=a.call(this,...o)||this;t.navigationInfoQueue=[];return t}M.RoutingService=g;var f=g.prototype;f.init=function t(){const e=this.getContext();if(e.scopeType==="component"){var o;this.oAppComponent=e.scopeObject;this.oModel=this.oAppComponent.getModel();this.oMetaModel=this.oModel.getMetaModel();this.oRouter=this.oAppComponent.getRouter();this.oRouterProxy=this.oAppComponent.getRouterProxy();this.eventProvider=new A;const t=this.oAppComponent.getManifestEntry("sap.ui5").routing;this._parseRoutingConfiguration(t);const n=this.oAppComponent.getManifestEntry("sap.app");this.outbounds=(o=n.crossNavigation)===null||o===void 0?void 0:o.outbounds}this.initPromise=Promise.resolve(this)};f.beforeExit=function t(){this.oRouter.detachRouteMatched(this._fnOnRouteMatched,this);this.eventProvider.fireEvent("routeMatched",{})};f.exit=function t(){this.eventProvider.destroy()};f._parseRoutingConfiguration=function e(o){var n;const i=(o===null||o===void 0?void 0:(n=o.config)===null||n===void 0?void 0:n.routerClass)==="sap.f.routing.Router";this._mTargets={};Object.keys(o.targets).forEach(t=>{this._mTargets[t]=Object.assign({targetName:t},o.targets[t]);if(this._mTargets[t].contextPattern!==undefined){this._mTargets[t].viewLevel=this._getViewLevelFromPattern(this._mTargets[t].contextPattern,0)}});this._mRoutes={};for(const e in o.routes){const n=o.routes[e],r=Array.isArray(n.target)?n.target:[n.target],a=Array.isArray(o.routes)?n.name:e,s=n.pattern;if(s.length<8||s.indexOf(":?query:")!==s.length-8){t.warning(`Pattern for route ${a} doesn't end with ':?query:' : ${s}`)}const u=this._getViewLevelFromPattern(s,0);this._mRoutes[a]={name:a,pattern:s,targets:r,routeLevel:u};for(let t=0;t<r.length;t++){const e=this._mTargets[r[t]].parent;if(e){r.push(e)}}if(!i){if(this._mTargets[r[0]].viewLevel===undefined||this._mTargets[r[0]].viewLevel<u){this._mTargets[r[0]].viewLevel=u}this._mTargets[r[0]].FCLLevel=-1}else if(r.length===1&&this._mTargets[r[0]].controlAggregation!=="beginColumnPages"){this._mTargets[r[0]].FCLLevel=3}else{r.forEach(t=>{switch(this._mTargets[t].controlAggregation){case"beginColumnPages":this._mTargets[t].FCLLevel=0;break;case"midColumnPages":this._mTargets[t].FCLLevel=1;break;default:this._mTargets[t].FCLLevel=2}})}}Object.keys(this._mTargets).forEach(t=>{while(this._mTargets[t].parent){const e=this._mTargets[t].parent;this._mTargets[e].viewLevel=this._mTargets[e].viewLevel||this._mTargets[t].viewLevel;this._mTargets[e].contextPattern=this._mTargets[e].contextPattern||this._mTargets[t].contextPattern;this._mTargets[e].FCLLevel=this._mTargets[e].FCLLevel||this._mTargets[t].FCLLevel;this._mTargets[e].controlAggregation=this._mTargets[e].controlAggregation||this._mTargets[t].controlAggregation;t=e}});const r=[];const a=[];let s;for(const t in this._mRoutes){const e=this._mRoutes[t].routeLevel;if(e===0){r.push(t)}else if(e===1){a.push(t)}}if(r.length===1){s=r[0]}else if(a.length===1){s=a[0]}if(s){const e=this._mRoutes[s].targets.slice(-1)[0];this.sContextPath="";if(this._mTargets[e].options&&this._mTargets[e].options.settings){const t=this._mTargets[e].options.settings;this.sContextPath=t.contextPath||`/${t.entitySet}`}if(!this.sContextPath){t.warning(`Cannot determine default contextPath: contextPath or entitySet missing in default target: ${e}`)}}else{t.warning("Cannot determine default contextPath: no default route found.")}Object.keys(this._mTargets).map(t=>this._mTargets[t]).sort((t,e)=>t.viewLevel<e.viewLevel?-1:1).forEach(t=>{if(t.options){const e=t.options.settings;const o=e.contextPath||(e.entitySet?`/${e.entitySet}`:"");if(!e.fullContextPath&&o){e.fullContextPath=`${o}/`}Object.keys(e.navigation||{}).forEach(o=>{const n=this._mRoutes[e.navigation[o].detail.route];if(n&&n.targets){n.targets.forEach(n=>{if(this._mTargets[n].options&&this._mTargets[n].options.settings&&!this._mTargets[n].options.settings.fullContextPath){if(t.viewLevel===0){this._mTargets[n].options.settings.fullContextPath=`${(o.startsWith("/")?"":"/")+o}/`}else{this._mTargets[n].options.settings.fullContextPath=`${e.fullContextPath+o}/`}}})}})}})};f._getViewLevelFromPattern=function t(e,o){e=e.replace(":?query:","");const n=new RegExp("/[^/]*$");if(e&&e[0]!=="/"&&e[0]!=="?"){e=`/${e}`}if(e.length){e=e.replace(n,"");if(this.oRouter.match(e)||e===""){return this._getViewLevelFromPattern(e,++o)}else{return this._getViewLevelFromPattern(e,o)}}else{return o}};f._getRouteInformation=function t(e){return this._mRoutes[e]};f._getTargetInformation=function t(e){return this._mTargets[e]};f._getComponentId=function t(e,o){if(o.indexOf(`${e}---`)===0){return o.substr(e.length+3)}return o};f.getTargetInformationFor=function t(e){const o=this._getComponentId(e._sOwnerId,e.getId());let n=null;Object.keys(this._mTargets).forEach(t=>{if(this._mTargets[t].id===o||this._mTargets[t].viewId===o){n=t}});return this._getTargetInformation(n)};f.getLastSemanticMapping=function t(){return this.oLastSemanticMapping};f.setLastSemanticMapping=function t(e){this.oLastSemanticMapping=e};f.navigateTo=function t(e,o,n,i){let r,a;if(e.getModel()&&e.getModel().getMetaModel&&e.getModel().getMetaModel()){a=u.isStickySessionSupported(e.getModel().getMetaModel())}if(!n){r=Promise.resolve(h.getSemanticPath(e))}else{r=this.prepareParameters(n,o,e).then(t=>this.oRouter.getURL(o,t))}return r.then(t=>{this.oRouterProxy.navToHash(t,i,false,false,!a)})};f.prepareParameters=function e(o,n,i){let r;try{const t=i.getPath();const e=i.getModel().getMetaModel();const n=t.split("/");const a=Object.keys(o).map(t=>{const r=o[t];const a=l.complexParser(r);const s=a.parts||[a];const u=s.map(function(t){const o=t.path.split("../");const r=n.slice(0,n.length-o.length+1);r.push(o[o.length-1]);const a=r.join("/");const s=e.getMetaContext(a);return i.requestProperty(a).then(function(t){const e=s.getObject();const o=e.$Type;return d.formatLiteral(t,o)})});return Promise.all(u).then(e=>{const o=a.formatter?a.formatter.apply(this,e):e.join("");return{key:t,value:o}})});r=Promise.all(a).then(function(t){const e={};t.forEach(function(t){e[t.key]=t.value});return e})}catch(e){t.error(`Could not parse the parameters for the navigation to route ${n}`);r=Promise.resolve(undefined)}return r};f._fireRouteMatchEvents=function t(e){this.eventProvider.fireEvent("routeMatched",e);this.eventProvider.fireEvent("afterRouteMatched",e);s.cleanProcessedEditState()};f.navigateToContext=function t(e,n,i,r){let a="",s,h=false;if(e.getModel()&&e.getModel().getMetaModel){h=u.isStickySessionSupported(e.getModel().getMetaModel())}if(n&&n.targetPath&&i&&i.navigation){const t=i.navigation[n.targetPath].detail;a=t.route;if(t.parameters){s=this.prepareParameters(t.parameters,a,e)}}let c=this._getPathFromContext(e,n);if(c.length===0&&this.bExitOnNavigateBackToRoot){this.oRouterProxy.exitFromApp();return Promise.resolve(true)}if(n!==null&&n!==void 0&&n.asyncContext||n!==null&&n!==void 0&&n.bDeferredContext){c+="(...)"}const l=this._calculateLayout(c,n);if(l){c+=`?layout=${l}`}const g={oAsyncContext:n===null||n===void 0?void 0:n.asyncContext,bDeferredContext:n===null||n===void 0?void 0:n.bDeferredContext,bTargetEditable:n===null||n===void 0?void 0:n.editable,bPersistOPScroll:n===null||n===void 0?void 0:n.bPersistOPScroll,useContext:(n===null||n===void 0?void 0:n.updateFCLLevel)===-1||n!==null&&n!==void 0&&n.bRecreateContext?undefined:e,bDraftNavigation:n===null||n===void 0?void 0:n.bDraftNavigation,bShowPlaceholder:(n===null||n===void 0?void 0:n.showPlaceholder)!==undefined?n===null||n===void 0?void 0:n.showPlaceholder:true,reason:n===null||n===void 0?void 0:n.reason};if(n!==null&&n!==void 0&&n.checkNoHashChange){const t=this.oRouterProxy.getHash().replace(/[&?]{1}sap-iapp-state=[A-Z0-9]+/,"");if(c===t){const t=this.oRouter.getRouteInfoByHash(this.oRouterProxy.getHash());if(t){t.navigationInfo=g;t.routeInformation=this._getRouteInformation(this.sCurrentRouteName);t.routePattern=this.sCurrentRoutePattern;t.views=this.aCurrentViews}this.oRouterProxy.setFocusForced(!!n.bForceFocus);this._fireRouteMatchEvents(t);return Promise.resolve(true)}}if(n!==null&&n!==void 0&&n.transient&&n.editable==true&&c.indexOf("(...)")===-1){if(c.indexOf("?")>-1){c+="&i-action=create"}else{c+="?i-action=create"}}if(r&&r.name==="sap.fe.templates.ListReport"){const t=this.oRouter.getRouteInfoByHash(c);if(t){const e=this._getRouteInformation(t.name);if(e&&e.targets&&e.targets.length>0){const t=e.targets[e.targets.length-1];const n=this._getTargetInformation(t);if(n&&n.name==="sap.fe.templates.ObjectPage"){o.removeUnboundTransitionMessages()}}}}this.navigationInfoQueue.push(g);if(a&&s){return s.then(t=>{t.bIsStickyMode=h;this.oRouter.navTo(a,t);return Promise.resolve(true)})}return this.oRouterProxy.navToHash(c,false,n===null||n===void 0?void 0:n.noPreservationCache,n===null||n===void 0?void 0:n.bForceFocus,!h).then(t=>{if(!t){this.navigationInfoQueue.pop()}return t})};f.navigateToRoute=function t(e,o){const n=this.oRouter.getURL(e,o);return this.oRouterProxy.navToHash(n,undefined,undefined,undefined,!o.bIsStickyMode)};f.isCurrentStateImpactedBy=function t(e){const o=e.getPath();if(this.oRouterProxy.isCurrentStateImpactedBy(o)){return true}else if(/^[^()]+\([^()]+\)$/.test(o)){let t;if(this.oLastSemanticMapping&&this.oLastSemanticMapping.technicalPath===o){t=this.oLastSemanticMapping.semanticPath}else{t=h.getSemanticPath(e)}return t!=o?this.oRouterProxy.isCurrentStateImpactedBy(t):false}else{return false}};f._findPathToNavigate=function t(e){const o=new RegExp("/[^/]*$");e=e.replace(o,"");if(this.oRouter.match(e)||e===""){return e}else{return this._findPathToNavigate(e)}};f._checkIfContextSupportsSemanticPath=function t(e){const o=e.getPath();if(!/^\/[^(]+\([^)]+\)$/.test(o)){return false}const n=e.getModel().getMetaModel();const i=n.getMetaContext(e.getPath()).getObject("@sapui.name");if(!h.getSemanticKeys(n,i)){return false}return u.isDraftSupported(n,o)};f._getPathFromContext=function t(e,o){let n;if(e.isA("sap.ui.model.odata.v4.ODataListBinding")&&e.isRelative()){n=e.getHeaderContext().getPath()}else{n=e.getPath()}if(o.updateFCLLevel===-1){n=this._findPathToNavigate(n);if(this.oLastSemanticMapping&&this.oLastSemanticMapping.technicalPath===n){n=this.oLastSemanticMapping.semanticPath}}else if(this._checkIfContextSupportsSemanticPath(e)){const t=h.getSemanticPath(e,true);if(!t){this.setLastSemanticMapping(undefined)}else if(t!==n){this.setLastSemanticMapping({technicalPath:n,semanticPath:t});n=t}}if(n[0]==="/"){n=n.substring(1)}return n};f._calculateLayout=function t(e,o){let n=o.FCLLevel;if(o.updateFCLLevel){n+=o.updateFCLLevel;if(n<0){n=0}}if(o.updateFCLLevel<0&&!o.sLayout){o.sLayout=this.oRouterProxy.findLayoutForHash(e)}return this.oAppComponent.getRootViewController().calculateLayout(n,e,o.sLayout,o.keepCurrentLayout)};f._beforeRouteMatched=function t(){const o=(new n).isPlaceholderEnabled();if(!o){const t=this.oAppComponent.getRootControl();e.lock(t)}};f._onRouteMatched=function o(r){const a=this.oAppComponent.getAppStateHandler(),s=this.oAppComponent.getRootControl();const u=(new n).isPlaceholderEnabled();if(e.isLocked(s)&&!u){e.unlock(s)}const h=r.getParameters();if(this.navigationInfoQueue.length){h.navigationInfo=this.navigationInfoQueue[0];this.navigationInfoQueue=this.navigationInfoQueue.slice(1)}else{h.navigationInfo={}}if(a.checkIfRouteChangedByIApp()){h.navigationInfo.reason=i.AppStateChanged;a.resetRouteChangedByIApp()}this.sCurrentRouteName=r.getParameter("name");this.sCurrentRoutePattern=h.config.pattern;this.aCurrentViews=r.getParameter("views");h.routeInformation=this._getRouteInformation(this.sCurrentRouteName);h.routePattern=this.sCurrentRoutePattern;this._fireRouteMatchEvents(h);if(!history.state||history.state.feLevel===undefined){this.oRouterProxy.restoreHistory().then(()=>{this.oRouterProxy.resolveRouteMatch()}).catch(function(e){t.error("Error while restoring history",e)})}else{this.oRouterProxy.resolveRouteMatch()}};f.attachRouteMatched=function t(e,o,n){this.eventProvider.attachEvent("routeMatched",e,o,n)};f.detachRouteMatched=function t(e,o){this.eventProvider.detachEvent("routeMatched",e,o)};f.attachAfterRouteMatched=function t(e,o,n){this.eventProvider.attachEvent("afterRouteMatched",e,o,n)};f.detachAfterRouteMatched=function t(e,o){this.eventProvider.detachEvent("afterRouteMatched",e,o)};f.getRouteFromHash=function t(e,o){const n=e.getHashChanger().hash;const i=e.getRouteInfoByHash(n);return o.getMetadata().getManifestEntry("/sap.ui5/routing/routes").filter(function(t){return t.name===i.name})[0]};f.getTargetsFromRoute=function t(e){const o=e.target;if(typeof o==="string"){return[this._mTargets[o]]}else{const t=[];o.forEach(e=>{t.push(this._mTargets[e])});return t}};f.initializeRouting=async function e(){await c.processAndExpandHash();this._fnOnRouteMatched=this._onRouteMatched.bind(this);this.oRouter.attachRouteMatched(this._fnOnRouteMatched,this);const o=(new n).isPlaceholderEnabled();if(!o){this.oRouter.attachBeforeRouteMatched(this._beforeRouteMatched.bind(this))}this.navigationInfoQueue=[];s.resetEditState();this.bExitOnNavigateBackToRoot=!this.oRouter.match("");const i=this.oRouter.getHashChanger().getHash().indexOf("sap-iapp-state")!==-1;try{const t=await this.oAppComponent.getStartupParameters();const e=t!==undefined&&Object.keys(t).length!==0;const o=this.oRouter.getHashChanger().getHash();if(!i&&e&&!o){if(t.preferredMode&&t.preferredMode[0].toUpperCase().indexOf("CREATE")!==-1){await this._manageCreateStartup(t)}else{await this._manageDeepLinkStartup(t)}}}catch(e){t.error("Error during routing initialization",e)}};f.getDefaultCreateHash=function t(e){return r.getDefaultCreateHash(e,this.getContextPath(),this.oRouter)};f._manageCreateStartup=function t(e){return r.getCreateStartupHash(e,this.getContextPath(),this.oRouter,this.oMetaModel).then(t=>{if(t){this.oRouter.getHashChanger().replaceHash(t);if(e!==null&&e!==void 0&&e.preferredMode&&e.preferredMode[0].toUpperCase().indexOf("AUTOCREATE")!==-1){this.oAppComponent.setStartupModeAutoCreate()}else{this.oAppComponent.setStartupModeCreate()}this.bExitOnNavigateBackToRoot=true}})};f._manageDeepLinkStartup=function t(e){return r.getDeepLinkStartupHash(this.oAppComponent.getManifest()["sap.ui5"].routing,e,this.oModel).then(t=>{let e;if(t.context){const o=t.context.getPath();const n=this._checkIfContextSupportsSemanticPath(t.context)?h.getSemanticPath(t.context):o;if(n!==o){this.setLastSemanticMapping({technicalPath:o,semanticPath:n})}e=n.substring(1)}else if(t.hash){e=t.hash}if(e){this.oRouter.getHashChanger().replaceHash(e);this.oAppComponent.setStartupModeDeeplink()}})};f.getOutbounds=function t(){return this.outbounds};f.getContextPath=function t(){return this.sContextPath};f.getInterface=function t(){return this};return g}(f);M.RoutingService=O;let H=function(t){S(e,t);function e(){return t.apply(this,arguments)||this}var o=e.prototype;o.createInstance=function t(e){const o=new O(e);return o.initPromise};return e}(p);return H},false);
|
|
795
|
+
sap.ui.predefine("sap/fe/core/services/RoutingServiceFactory", ["sap/base/Log","sap/fe/core/controllerextensions/BusyLocker","sap/fe/core/controllerextensions/messageHandler/messageHandling","sap/fe/core/controllerextensions/Placeholder","sap/fe/core/controllerextensions/routing/NavigationReason","sap/fe/core/helpers/AppStartupHelper","sap/fe/core/helpers/ClassSupport","sap/fe/core/helpers/EditState","sap/fe/core/helpers/ModelHelper","sap/fe/core/helpers/SemanticKeyHelper","sap/suite/ui/commons/collaboration/CollaborationHelper","sap/ui/base/BindingParser","sap/ui/base/EventProvider","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","sap/ui/model/odata/v4/ODataUtils"],function(t,e,o,n,i,r,a,s,u,h,c,l,g,f,p,d){"use strict";var m,v,P,C,R,_,y;var M={};var b=a.event;var x=a.defineUI5Class;function L(t,e,o,n){if(!o)return;Object.defineProperty(t,e,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(n):void 0})}function T(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function S(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;w(t,e)}function w(t,e){w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,o){e.__proto__=o;return e};return w(t,e)}function E(t,e,o,n,i){var r={};Object.keys(n).forEach(function(t){r[t]=n[t]});r.enumerable=!!r.enumerable;r.configurable=!!r.configurable;if("value"in r||r.initializer){r.writable=true}r=o.slice().reverse().reduce(function(o,n){return n(t,e,o)||o},r);if(i&&r.initializer!==void 0){r.value=r.initializer?r.initializer.call(i):void 0;r.initializer=undefined}if(r.initializer===void 0){Object.defineProperty(t,e,r);r=null}return r}function A(t,e){throw new Error("Decorating class property failed. Please ensure that "+"proposal-class-properties is enabled and runs after the decorators transform.")}let I=(m=x("sap.fe.core.services.RoutingServiceEventing"),v=b(),P=b(),m(C=(R=function(t){S(e,t);function e(){var e;for(var o=arguments.length,n=new Array(o),i=0;i<o;i++){n[i]=arguments[i]}e=t.call(this,...n)||this;L(e,"routeMatched",_,T(e));L(e,"afterRouteMatched",y,T(e));return e}return e}(g),_=E(R.prototype,"routeMatched",[v],{configurable:true,enumerable:true,writable:true,initializer:null}),y=E(R.prototype,"afterRouteMatched",[P],{configurable:true,enumerable:true,writable:true,initializer:null}),R))||C);let O=function(a){S(g,a);function g(){var t;for(var e=arguments.length,o=new Array(e),n=0;n<e;n++){o[n]=arguments[n]}t=a.call(this,...o)||this;t.navigationInfoQueue=[];return t}M.RoutingService=g;var f=g.prototype;f.init=function t(){const e=this.getContext();if(e.scopeType==="component"){var o;this.oAppComponent=e.scopeObject;this.oModel=this.oAppComponent.getModel();this.oMetaModel=this.oModel.getMetaModel();this.oRouter=this.oAppComponent.getRouter();this.oRouterProxy=this.oAppComponent.getRouterProxy();this.eventProvider=new I;const t=this.oAppComponent.getManifestEntry("sap.ui5").routing;this._parseRoutingConfiguration(t);const n=this.oAppComponent.getManifestEntry("sap.app");this.outbounds=(o=n.crossNavigation)===null||o===void 0?void 0:o.outbounds}this.initPromise=Promise.resolve(this)};f.beforeExit=function t(){this.oRouter.detachRouteMatched(this._fnOnRouteMatched,this);this.eventProvider.fireEvent("routeMatched",{})};f.exit=function t(){this.eventProvider.destroy()};f._parseRoutingConfiguration=function e(o){var n;const i=(o===null||o===void 0?void 0:(n=o.config)===null||n===void 0?void 0:n.routerClass)==="sap.f.routing.Router";this._mTargets={};Object.keys(o.targets).forEach(t=>{this._mTargets[t]=Object.assign({targetName:t},o.targets[t]);if(this._mTargets[t].contextPattern!==undefined){this._mTargets[t].viewLevel=this._getViewLevelFromPattern(this._mTargets[t].contextPattern,0)}});this._mRoutes={};for(const e in o.routes){const n=o.routes[e],r=Array.isArray(n.target)?n.target:[n.target],a=Array.isArray(o.routes)?n.name:e,s=n.pattern;if(s.length<8||s.indexOf(":?query:")!==s.length-8){t.warning(`Pattern for route ${a} doesn't end with ':?query:' : ${s}`)}const u=this._getViewLevelFromPattern(s,0);this._mRoutes[a]={name:a,pattern:s,targets:r,routeLevel:u};for(let t=0;t<r.length;t++){const e=this._mTargets[r[t]].parent;if(e){r.push(e)}}if(!i){if(this._mTargets[r[0]].viewLevel===undefined||this._mTargets[r[0]].viewLevel<u){this._mTargets[r[0]].viewLevel=u}this._mTargets[r[0]].FCLLevel=-1}else if(r.length===1&&this._mTargets[r[0]].controlAggregation!=="beginColumnPages"){this._mTargets[r[0]].FCLLevel=3}else{r.forEach(t=>{switch(this._mTargets[t].controlAggregation){case"beginColumnPages":this._mTargets[t].FCLLevel=0;break;case"midColumnPages":this._mTargets[t].FCLLevel=1;break;default:this._mTargets[t].FCLLevel=2}})}}Object.keys(this._mTargets).forEach(t=>{while(this._mTargets[t].parent){const e=this._mTargets[t].parent;this._mTargets[e].viewLevel=this._mTargets[e].viewLevel||this._mTargets[t].viewLevel;this._mTargets[e].contextPattern=this._mTargets[e].contextPattern||this._mTargets[t].contextPattern;this._mTargets[e].FCLLevel=this._mTargets[e].FCLLevel||this._mTargets[t].FCLLevel;this._mTargets[e].controlAggregation=this._mTargets[e].controlAggregation||this._mTargets[t].controlAggregation;t=e}});const r=[];const a=[];let s;for(const t in this._mRoutes){const e=this._mRoutes[t].routeLevel;if(e===0){r.push(t)}else if(e===1){a.push(t)}}if(r.length===1){s=r[0]}else if(a.length===1){s=a[0]}if(s){const e=this._mRoutes[s].targets.slice(-1)[0];this.sContextPath="";if(this._mTargets[e].options&&this._mTargets[e].options.settings){const t=this._mTargets[e].options.settings;this.sContextPath=t.contextPath||`/${t.entitySet}`}if(!this.sContextPath){t.warning(`Cannot determine default contextPath: contextPath or entitySet missing in default target: ${e}`)}}else{t.warning("Cannot determine default contextPath: no default route found.")}Object.keys(this._mTargets).map(t=>this._mTargets[t]).sort((t,e)=>t.viewLevel<e.viewLevel?-1:1).forEach(t=>{if(t.options){const e=t.options.settings;const o=e.contextPath||(e.entitySet?`/${e.entitySet}`:"");if(!e.fullContextPath&&o){e.fullContextPath=`${o}/`}Object.keys(e.navigation||{}).forEach(o=>{const n=this._mRoutes[e.navigation[o].detail.route];if(n&&n.targets){n.targets.forEach(n=>{if(this._mTargets[n].options&&this._mTargets[n].options.settings&&!this._mTargets[n].options.settings.fullContextPath){if(t.viewLevel===0){this._mTargets[n].options.settings.fullContextPath=`${(o.startsWith("/")?"":"/")+o}/`}else{this._mTargets[n].options.settings.fullContextPath=`${e.fullContextPath+o}/`}}})}})}})};f._getViewLevelFromPattern=function t(e,o){e=e.replace(":?query:","");const n=new RegExp("/[^/]*$");if(e&&e[0]!=="/"&&e[0]!=="?"){e=`/${e}`}if(e.length){e=e.replace(n,"");if(this.oRouter.match(e)||e===""){return this._getViewLevelFromPattern(e,++o)}else{return this._getViewLevelFromPattern(e,o)}}else{return o}};f._getRouteInformation=function t(e){return this._mRoutes[e]};f._getTargetInformation=function t(e){return this._mTargets[e]};f._getComponentId=function t(e,o){if(o.indexOf(`${e}---`)===0){return o.substr(e.length+3)}return o};f.getTargetInformationFor=function t(e){const o=this._getComponentId(e._sOwnerId,e.getId());let n=null;Object.keys(this._mTargets).forEach(t=>{if(this._mTargets[t].id===o||this._mTargets[t].viewId===o){n=t}});return this._getTargetInformation(n)};f.getLastSemanticMapping=function t(){return this.oLastSemanticMapping};f.setLastSemanticMapping=function t(e){this.oLastSemanticMapping=e};f.navigateTo=function t(e,o,n,i){let r,a;if(e.getModel()&&e.getModel().getMetaModel&&e.getModel().getMetaModel()){a=u.isStickySessionSupported(e.getModel().getMetaModel())}if(!n){r=Promise.resolve(h.getSemanticPath(e))}else{r=this.prepareParameters(n,o,e).then(t=>this.oRouter.getURL(o,t))}return r.then(t=>{this.oRouterProxy.navToHash(t,i,false,false,!a)})};f.prepareParameters=function e(o,n,i){let r;try{const t=i.getPath();const e=i.getModel().getMetaModel();const n=t.split("/");const a=Object.keys(o).map(t=>{const r=o[t];const a=l.complexParser(r);const s=a.parts||[a];const u=s.map(function(t){const o=t.path.split("../");const r=n.slice(0,n.length-o.length+1);r.push(o[o.length-1]);const a=r.join("/");const s=e.getMetaContext(a);return i.requestProperty(a).then(function(t){const e=s.getObject();const o=e.$Type;return d.formatLiteral(t,o)})});return Promise.all(u).then(e=>{const o=a.formatter?a.formatter.apply(this,e):e.join("");return{key:t,value:o}})});r=Promise.all(a).then(function(t){const e={};t.forEach(function(t){e[t.key]=t.value});return e})}catch(e){t.error(`Could not parse the parameters for the navigation to route ${n}`);r=Promise.resolve(undefined)}return r};f._fireRouteMatchEvents=function t(e){this.eventProvider.fireEvent("routeMatched",e);this.eventProvider.fireEvent("afterRouteMatched",e);s.cleanProcessedEditState()};f.navigateToContext=function t(e,n,i,r){let a="",s,h=false;if(e.getModel()&&e.getModel().getMetaModel){h=u.isStickySessionSupported(e.getModel().getMetaModel())}if(n&&n.targetPath&&i&&i.navigation){const t=i.navigation[n.targetPath].detail;a=t.route;if(t.parameters&&e.isA("sap.ui.model.odata.v4.Context")){s=this.prepareParameters(t.parameters,a,e)}}let c=this._getPathFromContext(e,n);if(c.length===0&&this.bExitOnNavigateBackToRoot){this.oRouterProxy.exitFromApp();return Promise.resolve(true)}if(n!==null&&n!==void 0&&n.asyncContext||n!==null&&n!==void 0&&n.bDeferredContext){c+="(...)"}const l=this._calculateLayout(c,n);if(l){c+=`?layout=${l}`}const g={oAsyncContext:n===null||n===void 0?void 0:n.asyncContext,bDeferredContext:n===null||n===void 0?void 0:n.bDeferredContext,bTargetEditable:n===null||n===void 0?void 0:n.editable,bPersistOPScroll:n===null||n===void 0?void 0:n.bPersistOPScroll,bDraftNavigation:n===null||n===void 0?void 0:n.bDraftNavigation,bShowPlaceholder:(n===null||n===void 0?void 0:n.showPlaceholder)!==undefined?n===null||n===void 0?void 0:n.showPlaceholder:true,reason:n===null||n===void 0?void 0:n.reason};if((n===null||n===void 0?void 0:n.updateFCLLevel)!==-1&&(n===null||n===void 0?void 0:n.bRecreateContext)!==true){if(e.isA("sap.ui.model.odata.v4.Context")){g.useContext=e}else{g.listBindingForCreate=e}}if(n!==null&&n!==void 0&&n.checkNoHashChange){const t=this.oRouterProxy.getHash().replace(/[&?]{1}sap-iapp-state=[A-Z0-9]+/,"");if(c===t){const t=this.oRouter.getRouteInfoByHash(this.oRouterProxy.getHash());if(t){t.navigationInfo=g;t.routeInformation=this._getRouteInformation(this.sCurrentRouteName);t.routePattern=this.sCurrentRoutePattern;t.views=this.aCurrentViews}this.oRouterProxy.setFocusForced(!!n.bForceFocus);this._fireRouteMatchEvents(t);return Promise.resolve(true)}}if(n!==null&&n!==void 0&&n.transient&&n.editable==true&&c.indexOf("(...)")===-1){if(c.indexOf("?")>-1){c+="&i-action=create"}else{c+="?i-action=create"}}if(r&&r.name==="sap.fe.templates.ListReport"){const t=this.oRouter.getRouteInfoByHash(c);if(t){const e=this._getRouteInformation(t.name);if(e&&e.targets&&e.targets.length>0){const t=e.targets[e.targets.length-1];const n=this._getTargetInformation(t);if(n&&n.name==="sap.fe.templates.ObjectPage"){o.removeUnboundTransitionMessages()}}}}this.navigationInfoQueue.push(g);if(a&&s){return s.then(t=>{t.bIsStickyMode=h;this.oRouter.navTo(a,t);return Promise.resolve(true)})}return this.oRouterProxy.navToHash(c,false,n===null||n===void 0?void 0:n.noPreservationCache,n===null||n===void 0?void 0:n.bForceFocus,!h).then(t=>{if(!t){this.navigationInfoQueue.pop()}return t})};f.navigateToRoute=function t(e,o){const n=this.oRouter.getURL(e,o);return this.oRouterProxy.navToHash(n,undefined,undefined,undefined,!o.bIsStickyMode)};f.isCurrentStateImpactedBy=function t(e){const o=e.getPath();if(this.oRouterProxy.isCurrentStateImpactedBy(o)){return true}else if(/^[^()]+\([^()]+\)$/.test(o)){let t;if(this.oLastSemanticMapping&&this.oLastSemanticMapping.technicalPath===o){t=this.oLastSemanticMapping.semanticPath}else{t=h.getSemanticPath(e)}return t!=o?this.oRouterProxy.isCurrentStateImpactedBy(t):false}else{return false}};f._findPathToNavigate=function t(e){const o=new RegExp("/[^/]*$");e=e.replace(o,"");if(this.oRouter.match(e)||e===""){return e}else{return this._findPathToNavigate(e)}};f._checkIfContextSupportsSemanticPath=function t(e){const o=e.getPath();if(!/^\/[^(]+\([^)]+\)$/.test(o)){return false}const n=e.getModel().getMetaModel();const i=n.getMetaContext(e.getPath()).getObject("@sapui.name");if(!h.getSemanticKeys(n,i)){return false}return u.isDraftSupported(n,o)};f._getPathFromContext=function t(e,o){let n;if(e.isA("sap.ui.model.odata.v4.ODataListBinding")&&e.isRelative()){n=e.getHeaderContext().getPath()}else{n=e.getPath()}if(o.updateFCLLevel===-1){n=this._findPathToNavigate(n);if(this.oLastSemanticMapping&&this.oLastSemanticMapping.technicalPath===n){n=this.oLastSemanticMapping.semanticPath}}else if(this._checkIfContextSupportsSemanticPath(e)){const t=h.getSemanticPath(e,true);if(!t){this.setLastSemanticMapping(undefined)}else if(t!==n){this.setLastSemanticMapping({technicalPath:n,semanticPath:t});n=t}}if(n[0]==="/"){n=n.substring(1)}return n};f._calculateLayout=function t(e,o){let n=o.FCLLevel;if(o.updateFCLLevel){n+=o.updateFCLLevel;if(n<0){n=0}}if(o.updateFCLLevel<0&&!o.sLayout){o.sLayout=this.oRouterProxy.findLayoutForHash(e)}return this.oAppComponent.getRootViewController().calculateLayout(n,e,o.sLayout,o.keepCurrentLayout)};f._beforeRouteMatched=function t(){const o=(new n).isPlaceholderEnabled();if(!o){const t=this.oAppComponent.getRootControl();e.lock(t)}};f._onRouteMatched=function o(r){const a=this.oAppComponent.getAppStateHandler(),s=this.oAppComponent.getRootControl();const u=(new n).isPlaceholderEnabled();if(e.isLocked(s)&&!u){e.unlock(s)}const h=r.getParameters();if(this.navigationInfoQueue.length){h.navigationInfo=this.navigationInfoQueue[0];this.navigationInfoQueue=this.navigationInfoQueue.slice(1)}else{h.navigationInfo={}}if(a.checkIfRouteChangedByIApp()){h.navigationInfo.reason=i.AppStateChanged;a.resetRouteChangedByIApp()}this.sCurrentRouteName=r.getParameter("name");this.sCurrentRoutePattern=h.config.pattern;this.aCurrentViews=r.getParameter("views");h.routeInformation=this._getRouteInformation(this.sCurrentRouteName);h.routePattern=this.sCurrentRoutePattern;this._fireRouteMatchEvents(h);if(!history.state||history.state.feLevel===undefined){this.oRouterProxy.restoreHistory().then(()=>{this.oRouterProxy.resolveRouteMatch()}).catch(function(e){t.error("Error while restoring history",e)})}else{this.oRouterProxy.resolveRouteMatch()}};f.attachRouteMatched=function t(e,o,n){this.eventProvider.attachEvent("routeMatched",e,o,n)};f.detachRouteMatched=function t(e,o){this.eventProvider.detachEvent("routeMatched",e,o)};f.attachAfterRouteMatched=function t(e,o,n){this.eventProvider.attachEvent("afterRouteMatched",e,o,n)};f.detachAfterRouteMatched=function t(e,o){this.eventProvider.detachEvent("afterRouteMatched",e,o)};f.getRouteFromHash=function t(e,o){const n=e.getHashChanger().hash;const i=e.getRouteInfoByHash(n);return o.getMetadata().getManifestEntry("/sap.ui5/routing/routes").filter(function(t){return t.name===i.name})[0]};f.getTargetsFromRoute=function t(e){const o=e.target;if(typeof o==="string"){return[this._mTargets[o]]}else{const t=[];o.forEach(e=>{t.push(this._mTargets[e])});return t}};f.initializeRouting=async function e(){await c.processAndExpandHash();this._fnOnRouteMatched=this._onRouteMatched.bind(this);this.oRouter.attachRouteMatched(this._fnOnRouteMatched,this);const o=(new n).isPlaceholderEnabled();if(!o){this.oRouter.attachBeforeRouteMatched(this._beforeRouteMatched.bind(this))}this.navigationInfoQueue=[];s.resetEditState();this.bExitOnNavigateBackToRoot=!this.oRouter.match("");const i=this.oRouter.getHashChanger().getHash().indexOf("sap-iapp-state")!==-1;try{const t=await this.oAppComponent.getStartupParameters();const e=t!==undefined&&Object.keys(t).length!==0;const o=this.oRouter.getHashChanger().getHash();if(!i&&e&&!o){if(t.preferredMode&&t.preferredMode[0].toUpperCase().indexOf("CREATE")!==-1){await this._manageCreateStartup(t)}else{await this._manageDeepLinkStartup(t)}}}catch(e){t.error("Error during routing initialization",e)}};f.getDefaultCreateHash=function t(e){return r.getDefaultCreateHash(e,this.getContextPath(),this.oRouter)};f._manageCreateStartup=function t(e){return r.getCreateStartupHash(e,this.getContextPath(),this.oRouter,this.oMetaModel).then(t=>{if(t){this.oRouter.getHashChanger().replaceHash(t);if(e!==null&&e!==void 0&&e.preferredMode&&e.preferredMode[0].toUpperCase().indexOf("AUTOCREATE")!==-1){this.oAppComponent.setStartupModeAutoCreate()}else{this.oAppComponent.setStartupModeCreate()}this.bExitOnNavigateBackToRoot=true}})};f._manageDeepLinkStartup=function t(e){return r.getDeepLinkStartupHash(this.oAppComponent.getManifest()["sap.ui5"].routing,e,this.oModel).then(t=>{let e;if(t.context){const o=t.context.getPath();const n=this._checkIfContextSupportsSemanticPath(t.context)?h.getSemanticPath(t.context):o;if(n!==o){this.setLastSemanticMapping({technicalPath:o,semanticPath:n})}e=n.substring(1)}else if(t.hash){e=t.hash}if(e){this.oRouter.getHashChanger().replaceHash(e);this.oAppComponent.setStartupModeDeeplink()}})};f.getOutbounds=function t(){return this.outbounds};f.getContextPath=function t(){return this.sContextPath};f.getInterface=function t(){return this};return g}(f);M.RoutingService=O;let F=function(t){S(e,t);function e(){return t.apply(this,arguments)||this}var o=e.prototype;o.createInstance=function t(e){const o=new O(e);return o.initPromise};return e}(p);return F},false);
|
|
776
796
|
/*!
|
|
777
797
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
778
798
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -782,7 +802,7 @@ sap.ui.predefine("sap/fe/core/services/ShellServicesFactory", ["sap/base/Log","s
|
|
|
782
802
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
783
803
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
784
804
|
*/
|
|
785
|
-
sap.ui.predefine("sap/fe/core/services/SideEffectsServiceFactory", ["sap/base/Log","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/PropertyHelper","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","../templating/DataModelPathHelper"],function(t,e,i,r,o,n,s){"use strict";var a={};var c=s.getTargetObjectPath;var f=s.getTargetNavigationPath;var u=s.enhanceDataModelPath;var l=r.getAssociatedTextPropertyPath;var d=i.isProperty;var p=i.isEntityType;var g=i.isComplexType;var h=e.getInvolvedDataModelObjects;var E=e.convertTypes;function y(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;v(t,e)}function v(t,e){v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,i){e.__proto__=i;return e};return v(t,e)}let m=function(e){y(i,e);function i(){return e.apply(this,arguments)||this}a.SideEffectsService=i;var r=i.prototype;r.init=function t(){this.sideEffectsRegistry={oData:{entities:{},actions:{}},control:{}};this.isInitialized=false;this.initPromise=Promise.resolve(this)};r.addControlSideEffects=function t(e,i){if(i.sourceControlId){const t={...i,fullyQualifiedName:`${e}/SideEffectsForControl/${i.sourceControlId}`};const r=this.sideEffectsRegistry.control[e]||{};r[t.sourceControlId]=t;this.sideEffectsRegistry.control[e]=r}};r.executeAction=function t(e,i,r){const o=i.getModel().bindContext(`${e}(...)`,i);return o.execute(r||i.getBinding().getUpdateGroupId())};r.getConvertedMetaModel=function t(){return E(this.getMetaModel(),this.capabilities)};r.getEntityTypeFromContext=function t(e){const i=e.getModel().getMetaModel(),r=i.getMetaPath(e.getPath()),o=i.getObject(r)["$Type"];return o};r.getODataEntitySideEffects=function t(e){return this.sideEffectsRegistry.oData.entities[e]||{}};r.getGlobalODataEntitySideEffects=function t(e){const i=this.getODataEntitySideEffects(e);const r=[];for(const t in i){const e=i[t];if(!e.sourceEntities&&!e.sourceProperties){r.push(e)}}return r};r.getODataActionSideEffects=function t(e,i){if(i){const t=this.getEntityTypeFromContext(i);if(t){var r;return(r=this.sideEffectsRegistry.oData.actions[t])===null||r===void 0?void 0:r[e]}}return undefined};r.initializeSideEffects=function t(e){this.capabilities=e;if(!this.isInitialized){const t={entities:{},properties:{}};const e=this.getConvertedMetaModel();e.entityTypes.forEach(e=>{this.sideEffectsRegistry.oData.entities[e.fullyQualifiedName]=this.retrieveODataEntitySideEffects(e);this.sideEffectsRegistry.oData.actions[e.fullyQualifiedName]=this.retrieveODataActionsSideEffects(e);this.mapSideEffectSources(e,t)});this.sourcesToSideEffectMappings=t;this.isInitialized=true}};r.removeControlSideEffects=function t(e){Object.keys(this.sideEffectsRegistry.control).forEach(t=>{if(this.sideEffectsRegistry.control[t][e]){delete this.sideEffectsRegistry.control[t][e]}})};r.requestSideEffects=function t(e,i,r){this.logRequest(e,i);return i.requestSideEffects(e,r)};r.requestSideEffectsForODataAction=function t(e,i){var r,o;let n;if((r=e.triggerActions)!==null&&r!==void 0&&r.length){n=e.triggerActions.map(t=>this.executeAction(t,i))}else{n=[]}if((o=e.pathExpressions)!==null&&o!==void 0&&o.length){n.push(this.requestSideEffects(e.pathExpressions,i))}return n.length?Promise.all(n):Promise.resolve([])};r.requestSideEffectsForNavigationProperty=function e(i,r,o){const n=this.getEntityTypeFromContext(r);if(n){const e=`${i}/`;const s=this.getODataEntitySideEffects(n);let a=[];let c=[];let f=[];Object.keys(s).filter(t=>{const r=s[t];return(r.sourceProperties||[]).some(t=>t.startsWith(e)&&t.replace(e,"").indexOf("/")===-1)||(r.sourceEntities||[]).some(t=>t.$NavigationPropertyPath===i)}).forEach(t=>{const e=s[t];if(e.triggerAction){this.executeAction(e.triggerAction,r,o)}a=a.concat(e.targetProperties);c=c.concat(e.targetEntities)});const u=this.removeDuplicateTargets({targetProperties:a,targetEntities:c});f=[...u.targetProperties,...u.targetEntities];if(f.length){return this.requestSideEffects(f,r,o).catch(e=>t.error(`SideEffects - Error while processing SideEffects for Navigation Property ${i}`,e))}}return Promise.resolve()};r.getControlEntitySideEffects=function t(e){return this.sideEffectsRegistry.control[e]||{}};r.getSideEffectWhereEntityIsSource=function t(e){return this.sourcesToSideEffectMappings.entities[e]||[]};r.computeFieldGroupIds=function t(e,i){const r=this.getSideEffectWhereEntityIsSource(e).map(t=>this.getFieldGroupIdForSideEffect(t,true));return r.concat(this.getSideEffectWherePropertyIsSource(i).map(t=>this.getFieldGroupIdForSideEffect(t)))};r.getSideEffectWherePropertyIsSource=function t(e){return this.sourcesToSideEffectMappings.properties[e]||[]};r.addTextProperties=function t(e,i){const r=new Set(e.targetProperties);const o=new Set(e.targetEntities.map(t=>t.$NavigationPropertyPath));const n=e.targetProperties.reduce((t,e)=>t.concat(this.getDataModelPropertiesFromAPath(e,i)),[]);for(const t of n){const e=l(t.targetObject);if(e){const i=u(t,e);const n=f(i,true);const s=c(i,true);if(d(i.targetObject)&&!r.has(s)&&!r.has(`${n}${i.navigationProperties.length?"/":""}*`)&&!o.has(`${n}`)){if(t.targetEntitySet!==i.targetEntitySet&&i.navigationProperties&&i.targetEntityType){o.add(n)}else{r.add(s)}}}}return{targetProperties:Array.from(r),targetEntities:Array.from(o).map(t=>({$NavigationPropertyPath:t}))}};r.convertSideEffects=function t(e,i,r){const o=e.TriggerAction;const n=this.convertSideEffectsFormat(e);let s={targetProperties:n.targetProperties,targetEntities:n.targetEntities};s=this.removeBindingParameter(s,r);s=this.addTextProperties(s,i);s=this.removeDuplicateTargets(s);return{...n,...{targetEntities:s.targetEntities,targetProperties:s.targetProperties,triggerAction:o}}};r.convertSideEffectsFormat=function e(i){const r=e=>e?e.reduce((e,r)=>{const o=r.type&&r.value||r;if(o){e.push(o)}else{t.error(`SideEffects - Error while processing TargetProperties for SideEffects ${i.fullyQualifiedName}`)}return e},[]):e;const o=t=>t?t.map(t=>({$NavigationPropertyPath:t.value})):t;return{fullyQualifiedName:i.fullyQualifiedName,sourceProperties:r(i.SourceProperties),sourceEntities:o(i.SourceEntities),targetProperties:r(i.TargetProperties)??[],targetEntities:o(i.TargetEntities)??[]}};r.getDataModelPropertiesFromAPath=function t(e,i){let r=[];const o=this.getConvertedMetaModel();const n=o.entitySets.find(t=>t.entityType===i)||o.singletons.find(t=>t.entityType===i);if(n){const t=this.getMetaModel(),i=t.createBindingContext(`/${n.name}`);if(i){const t=h(i);const o=u(t,e.replace("*","")||"/"),n=o.targetObject;if(d(n)){if(g(n.targetType)){r=r.concat(n.targetType.properties.map(t=>u(o,t.name)))}else{r.push(o)}}else if(p(n)){r=r.concat(o.targetEntityType.entityProperties.map(t=>u(o,t.name)))}i.destroy()}}return r.filter(t=>t.targetObject)};r.getMetaModel=function t(){const e=this.getContext();const i=e.scopeObject;return i.getModel().getMetaModel()};r.getSideEffectsFromSource=function t(e){var i;let r="";const o=p(e);const n=o?e:e.sourceEntityType;const s=(i=e.annotations)===null||i===void 0?void 0:i.Common;if(n&&s){if(!o){var a;const t=(a=e.parameters)===null||a===void 0?void 0:a.find(t=>t.type===n.fullyQualifiedName);r=(t===null||t===void 0?void 0:t.fullyQualifiedName.split("/")[1])??""}return this.getSideEffectsAnnotationFromSource(e).map(t=>this.convertSideEffects(t,n,r))}return[]};r.getSideEffectsAnnotationFromSource=function t(e){var i;const r=[];const o=(i=e.annotations)===null||i===void 0?void 0:i.Common;for(const t in o){const e=o[t];if(this.isSideEffectsAnnotation(e)){r.push(e)}}return r};r.isSideEffectsAnnotation=function t(e){return(e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.Common.v1.SideEffectsType"};r.logRequest=function e(i,r){const o=i.reduce(function(t,e){return`${t}\n\t\t${e.$NavigationPropertyPath||e||""}`},"");t.debug(`SideEffects - Request:\n\tContext path : ${r.getPath()}\n\tProperty paths :${o}`)};r.removeBindingParameter=function t(e,i){if(i){const t=function(t){return t.replace(new RegExp(`^${i}/?`),"")};return{targetProperties:e.targetProperties.map(e=>t(e)),targetEntities:e.targetEntities.map(e=>({$NavigationPropertyPath:t(e.$NavigationPropertyPath)}))}}return{targetProperties:e.targetProperties,targetEntities:e.targetEntities}};r.removeDuplicateTargets=function t(e){const i=e.targetEntities.map(t=>t.$NavigationPropertyPath);const r=new Set(i);const o=new Set(e.targetProperties);const n=Array.from(r).map(t=>({$NavigationPropertyPath:t}));return{targetProperties:Array.from(o),targetEntities:n}};r.retrieveODataActionsSideEffects=function t(e){const i={};const r=e.actions;if(r){Object.keys(r).forEach(t=>{const r=e.actions[t];const o=new Set;let n=[];let s=[];this.getSideEffectsFromSource(r).forEach(t=>{const e=t.triggerAction;n=n.concat(t.targetProperties);s=s.concat(t.targetEntities);if(e){o.add(e)}});const a=this.removeDuplicateTargets({targetProperties:n,targetEntities:s});i[t]={pathExpressions:[...a.targetProperties,...a.targetEntities],triggerActions:Array.from(o)}})}return i};r.retrieveODataEntitySideEffects=function t(e){const i={};this.getSideEffectsFromSource(e).forEach(t=>{i[t.fullyQualifiedName]=t});return i};r.mapSideEffectSources=function t(e,i){for(const t of this.getSideEffectsAnnotationFromSource(e)){var r;for(const r of t.SourceEntities??[]){var o;const n=r.value?(o=r.$target)===null||o===void 0?void 0:o.targetType:e;if(n){if(!i.entities[n.fullyQualifiedName]){i.entities[n.fullyQualifiedName]=[]}i.entities[n.fullyQualifiedName].push({entity:e.fullyQualifiedName,qualifier:t.qualifier})}}const c=((r=t.SourceProperties)===null||r===void 0?void 0:r.length)===1;for(const r of t.SourceProperties??[]){var n,s;if(!i.properties[(n=r.$target)===null||n===void 0?void 0:n.fullyQualifiedName]){var a;i.properties[(a=r.$target)===null||a===void 0?void 0:a.fullyQualifiedName]=[]}i.properties[(s=r.$target)===null||s===void 0?void 0:s.fullyQualifiedName].push({entity:e.fullyQualifiedName,qualifier:t.qualifier,hasUniqueSourceProperty:c})}}};r.getFieldGroupIdForSideEffect=function t(e){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const r=e.qualifier?`${e.entity}#${e.qualifier}`:e.entity;return i||e.hasUniqueSourceProperty===true?`${r}$$ImmediateRequest`:r};r.getInterface=function t(){return this};return i}(o);a.SideEffectsService=m;let P=function(t){y(e,t);function e(){return t.apply(this,arguments)||this}var i=e.prototype;i.createInstance=function t(e){const i=new m(e);return i.initPromise};return e}(n);return P},false);
|
|
805
|
+
sap.ui.predefine("sap/fe/core/services/SideEffectsServiceFactory", ["sap/base/Log","sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/PropertyHelper","sap/ui/core/service/Service","sap/ui/core/service/ServiceFactory","../templating/DataModelPathHelper"],function(t,e,i,r,o,n,s){"use strict";var a={};var c=s.getTargetObjectPath;var f=s.getTargetNavigationPath;var u=s.enhanceDataModelPath;var l=r.getAssociatedTextPropertyPath;var d=i.isProperty;var p=i.isEntityType;var g=i.isComplexType;var h=e.getInvolvedDataModelObjects;var E=e.convertTypes;function y(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;v(t,e)}function v(t,e){v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function t(e,i){e.__proto__=i;return e};return v(t,e)}let m=function(e){y(i,e);function i(){return e.apply(this,arguments)||this}a.SideEffectsService=i;var r=i.prototype;r.init=function t(){this.sideEffectsRegistry={oData:{entities:{},actions:{}},control:{}};this.isInitialized=false;this.initPromise=Promise.resolve(this)};r.addControlSideEffects=function t(e,i){if(i.sourceControlId){const t={...i,fullyQualifiedName:`${e}/SideEffectsForControl/${i.sourceControlId}`};const r=this.sideEffectsRegistry.control[e]||{};r[t.sourceControlId]=t;this.sideEffectsRegistry.control[e]=r}};r.executeAction=function t(e,i,r){const o=i.getModel().bindContext(`${e}(...)`,i);return o.execute(r||i.getBinding().getUpdateGroupId())};r.getConvertedMetaModel=function t(){return E(this.getMetaModel(),this.capabilities)};r.getEntityTypeFromContext=function t(e){const i=e.getModel().getMetaModel(),r=i.getMetaPath(e.getPath()),o=i.getObject(r)["$Type"];return o};r.getODataEntitySideEffects=function t(e){return this.sideEffectsRegistry.oData.entities[e]||{}};r.getGlobalODataEntitySideEffects=function t(e){const i=this.getODataEntitySideEffects(e);const r=[];for(const t in i){const e=i[t];if(!e.sourceEntities&&!e.sourceProperties){r.push(e)}}return r};r.getODataActionSideEffects=function t(e,i){if(i){const t=this.getEntityTypeFromContext(i);if(t){var r;return(r=this.sideEffectsRegistry.oData.actions[t])===null||r===void 0?void 0:r[e]}}return undefined};r.initializeSideEffects=function t(e){this.capabilities=e;if(!this.isInitialized){const t={entities:{},properties:{}};const e=this.getConvertedMetaModel();e.entityTypes.forEach(e=>{this.sideEffectsRegistry.oData.entities[e.fullyQualifiedName]=this.retrieveODataEntitySideEffects(e);this.sideEffectsRegistry.oData.actions[e.fullyQualifiedName]=this.retrieveODataActionsSideEffects(e);this.mapSideEffectSources(e,t)});this.sourcesToSideEffectMappings=t;this.isInitialized=true}};r.removeControlSideEffects=function t(e){Object.keys(this.sideEffectsRegistry.control).forEach(t=>{if(this.sideEffectsRegistry.control[t][e]){delete this.sideEffectsRegistry.control[t][e]}})};r.requestSideEffects=function t(e,i,r){this.logRequest(e,i);return i.requestSideEffects(e,r)};r.requestSideEffectsForODataAction=function t(e,i){var r,o;let n;if((r=e.triggerActions)!==null&&r!==void 0&&r.length){n=e.triggerActions.map(t=>this.executeAction(t,i))}else{n=[]}if((o=e.pathExpressions)!==null&&o!==void 0&&o.length){n.push(this.requestSideEffects(e.pathExpressions,i))}return n.length?Promise.all(n):Promise.resolve([])};r.requestSideEffectsForNavigationProperty=function e(i,r,o){const n=this.getEntityTypeFromContext(r);if(n){const e=`${i}/`;const s=this.getODataEntitySideEffects(n);let a=[];let c=[];let f=[];Object.keys(s).filter(t=>{var r;const o=s[t];return(o.sourceEntities||[]).some(t=>t.$NavigationPropertyPath===i)||((r=o.sourceProperties)===null||r===void 0?void 0:r.length)===1&&o.sourceProperties.some(t=>t.startsWith(e)&&t.replace(e,"").indexOf("/")===-1)}).forEach(t=>{const e=s[t];if(e.triggerAction){this.executeAction(e.triggerAction,r,o)}a=a.concat(e.targetProperties);c=c.concat(e.targetEntities)});const u=this.removeDuplicateTargets({targetProperties:a,targetEntities:c});f=[...u.targetProperties,...u.targetEntities];if(f.length){return this.requestSideEffects(f,r,o).catch(e=>t.error(`SideEffects - Error while processing SideEffects for Navigation Property ${i}`,e))}}return Promise.resolve()};r.getControlEntitySideEffects=function t(e){return this.sideEffectsRegistry.control[e]||{}};r.getSideEffectWhereEntityIsSource=function t(e){return this.sourcesToSideEffectMappings.entities[e]||[]};r.computeFieldGroupIds=function t(e,i){const r=this.getSideEffectWhereEntityIsSource(e).map(t=>this.getFieldGroupIdForSideEffect(t,true));return r.concat(this.getSideEffectWherePropertyIsSource(i).map(t=>this.getFieldGroupIdForSideEffect(t)))};r.getSideEffectWherePropertyIsSource=function t(e){return this.sourcesToSideEffectMappings.properties[e]||[]};r.addTextProperties=function t(e,i){const r=new Set(e.targetProperties);const o=new Set(e.targetEntities.map(t=>t.$NavigationPropertyPath));const n=e.targetProperties.reduce((t,e)=>t.concat(this.getDataModelPropertiesFromAPath(e,i)),[]);for(const t of n){const e=l(t.targetObject);if(e){const i=u(t,e);const n=f(i,true);const s=c(i,true);if(d(i.targetObject)&&!r.has(s)&&!r.has(`${n}${i.navigationProperties.length?"/":""}*`)&&!o.has(`${n}`)){if(t.targetEntitySet!==i.targetEntitySet&&i.navigationProperties&&i.targetEntityType){o.add(n)}else{r.add(s)}}}}return{targetProperties:Array.from(r),targetEntities:Array.from(o).map(t=>({$NavigationPropertyPath:t}))}};r.convertSideEffects=function t(e,i,r){const o=e.TriggerAction;const n=this.convertSideEffectsFormat(e);let s={targetProperties:n.targetProperties,targetEntities:n.targetEntities};s=this.removeBindingParameter(s,r);s=this.addTextProperties(s,i);s=this.removeDuplicateTargets(s);return{...n,...{targetEntities:s.targetEntities,targetProperties:s.targetProperties,triggerAction:o}}};r.convertSideEffectsFormat=function e(i){const r=e=>e?e.reduce((e,r)=>{const o=r.type&&r.value||r;if(o){e.push(o)}else{t.error(`SideEffects - Error while processing TargetProperties for SideEffects ${i.fullyQualifiedName}`)}return e},[]):e;const o=t=>t?t.map(t=>({$NavigationPropertyPath:t.value})):t;return{fullyQualifiedName:i.fullyQualifiedName,sourceProperties:r(i.SourceProperties),sourceEntities:o(i.SourceEntities),targetProperties:r(i.TargetProperties)??[],targetEntities:o(i.TargetEntities)??[]}};r.getDataModelPropertiesFromAPath=function t(e,i){let r=[];const o=this.getConvertedMetaModel();const n=o.entitySets.find(t=>t.entityType===i)||o.singletons.find(t=>t.entityType===i);if(n){const t=this.getMetaModel(),i=t.createBindingContext(`/${n.name}`);if(i){const t=h(i);const o=u(t,e.replace("*","")||"/"),n=o.targetObject;if(d(n)){if(g(n.targetType)){r=r.concat(n.targetType.properties.map(t=>u(o,t.name)))}else{r.push(o)}}else if(p(n)){r=r.concat(o.targetEntityType.entityProperties.map(t=>u(o,t.name)))}i.destroy()}}return r.filter(t=>t.targetObject)};r.getMetaModel=function t(){const e=this.getContext();const i=e.scopeObject;return i.getModel().getMetaModel()};r.getSideEffectsFromSource=function t(e){var i;let r="";const o=p(e);const n=o?e:e.sourceEntityType;const s=(i=e.annotations)===null||i===void 0?void 0:i.Common;if(n&&s){if(!o){var a;const t=(a=e.parameters)===null||a===void 0?void 0:a.find(t=>t.type===n.fullyQualifiedName);r=(t===null||t===void 0?void 0:t.fullyQualifiedName.split("/")[1])??""}return this.getSideEffectsAnnotationFromSource(e).map(t=>this.convertSideEffects(t,n,r))}return[]};r.getSideEffectsAnnotationFromSource=function t(e){var i;const r=[];const o=(i=e.annotations)===null||i===void 0?void 0:i.Common;for(const t in o){const e=o[t];if(this.isSideEffectsAnnotation(e)){r.push(e)}}return r};r.isSideEffectsAnnotation=function t(e){return(e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.Common.v1.SideEffectsType"};r.logRequest=function e(i,r){const o=i.reduce(function(t,e){return`${t}\n\t\t${e.$NavigationPropertyPath||e||""}`},"");t.debug(`SideEffects - Request:\n\tContext path : ${r.getPath()}\n\tProperty paths :${o}`)};r.removeBindingParameter=function t(e,i){if(i){const t=function(t){return t.replace(new RegExp(`^${i}/?`),"")};return{targetProperties:e.targetProperties.map(e=>t(e)),targetEntities:e.targetEntities.map(e=>({$NavigationPropertyPath:t(e.$NavigationPropertyPath)}))}}return{targetProperties:e.targetProperties,targetEntities:e.targetEntities}};r.removeDuplicateTargets=function t(e){const i=e.targetEntities.map(t=>t.$NavigationPropertyPath);const r=new Set(i);const o=new Set(e.targetProperties);const n=Array.from(r).map(t=>({$NavigationPropertyPath:t}));return{targetProperties:Array.from(o),targetEntities:n}};r.retrieveODataActionsSideEffects=function t(e){const i={};const r=e.actions;if(r){Object.keys(r).forEach(t=>{const r=e.actions[t];const o=new Set;let n=[];let s=[];this.getSideEffectsFromSource(r).forEach(t=>{const e=t.triggerAction;n=n.concat(t.targetProperties);s=s.concat(t.targetEntities);if(e){o.add(e)}});const a=this.removeDuplicateTargets({targetProperties:n,targetEntities:s});i[t]={pathExpressions:[...a.targetProperties,...a.targetEntities],triggerActions:Array.from(o)}})}return i};r.retrieveODataEntitySideEffects=function t(e){const i={};this.getSideEffectsFromSource(e).forEach(t=>{i[t.fullyQualifiedName]=t});return i};r.mapSideEffectSources=function t(e,i){for(const t of this.getSideEffectsAnnotationFromSource(e)){var r;for(const r of t.SourceEntities??[]){var o;const n=r.value?(o=r.$target)===null||o===void 0?void 0:o.targetType:e;if(n){if(!i.entities[n.fullyQualifiedName]){i.entities[n.fullyQualifiedName]=[]}i.entities[n.fullyQualifiedName].push({entity:e.fullyQualifiedName,qualifier:t.qualifier})}}const c=((r=t.SourceProperties)===null||r===void 0?void 0:r.length)===1;for(const r of t.SourceProperties??[]){var n,s;if(!i.properties[(n=r.$target)===null||n===void 0?void 0:n.fullyQualifiedName]){var a;i.properties[(a=r.$target)===null||a===void 0?void 0:a.fullyQualifiedName]=[]}i.properties[(s=r.$target)===null||s===void 0?void 0:s.fullyQualifiedName].push({entity:e.fullyQualifiedName,qualifier:t.qualifier,hasUniqueSourceProperty:c})}}};r.getFieldGroupIdForSideEffect=function t(e){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const r=e.qualifier?`${e.entity}#${e.qualifier}`:e.entity;return i||e.hasUniqueSourceProperty===true?`${r}$$ImmediateRequest`:r};r.getInterface=function t(){return this};return i}(o);a.SideEffectsService=m;let P=function(t){y(e,t);function e(){return t.apply(this,arguments)||this}var i=e.prototype;i.createInstance=function t(e){const i=new m(e);return i.initPromise};return e}(n);return P},false);
|
|
786
806
|
/*!
|
|
787
807
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
788
808
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -817,7 +837,7 @@ sap.ui.predefine("sap/fe/core/templating/CriticalityFormatters", ["sap/fe/core/h
|
|
|
817
837
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
818
838
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
819
839
|
*/
|
|
820
|
-
sap.ui.predefine("sap/fe/core/templating/DataFieldFormatters", ["sap/fe/core/converters/MetaModelConverter","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/UIFormatters"],function(t,e,o){"use strict";var
|
|
840
|
+
sap.ui.predefine("sap/fe/core/templating/DataFieldFormatters", ["sap/fe/core/converters/MetaModelConverter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/UIFormatters"],function(t,e,n,o){"use strict";var r={};var a=o.getConverterContext;var c=n.enhanceDataModelPath;var i=e.constant;var s=e.concat;var l=e.compileExpression;var p=t.getInvolvedDataModelObjects;const d=function(t,e){const n=e.context.getPath();if(!t){throw new Error(`Unresolved context path ${n}`)}let o=false;if(typeof t==="object"&&(t.hasOwnProperty("$Path")||t.hasOwnProperty("$AnnotationPath"))){o=true}else if(typeof t==="object"&&t.hasOwnProperty("$kind")&&t.$kind!=="Property"){throw new Error(`Context does not resolve to a DataField object but to a ${t.$kind}`)}let r=a(t,e);if(o){r=r.$target}return r};r.getDataField=d;const f=function(t,e){const n=e.context.getPath();if(!t){throw new Error(`Unresolved context path ${n}`)}if(typeof t==="object"&&t.hasOwnProperty("$kind")&&t.$kind!=="Property"){throw new Error(`Context does not resolve to a Property object but to a ${t.$kind}`)}let o=p(e.context);if(o.targetObject&&o.targetObject.type==="Path"){o=c(o,o.targetObject.path)}if(o.targetObject&&o.targetObject.type==="AnnotationPath"){o=c(o,o.targetObject)}if(n.endsWith("$Path")||n.endsWith("$AnnotationPath")){o=c(o,t)}return o};r.getDataFieldObjectPath=f;const h=function(t,e){const n=d(t,e);return n.$Type==="com.sap.vocabularies.UI.v1.ConnectedFieldsType"};r.isSemanticallyConnectedFields=h;const u=/(?:({[^}]+})[^{]*)/g;const g=/{([^}]+)}(.*)/;const b=function(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;const o=t.targetObject;const r=o.Template.toString().match(u);if(!r){return""}const a=r.reduce((n,r)=>{const a=r.match(g);if(a&&a.length>1){const r=a[1];const s=o.Data[r];if(s){const o=c(t,s.fullyQualifiedName.replace(t.targetEntityType.fullyQualifiedName,""));o.targetObject=o.targetObject.Value;n.push(e(o,{}));if(a.length>2){n.push(i(a[2]))}}}return n},[]);return n?l(s(...a)):s(...a)};r.getLabelForConnectedFields=b;return r},false);
|
|
821
841
|
/*!
|
|
822
842
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
823
843
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -842,12 +862,12 @@ sap.ui.predefine("sap/fe/core/templating/EntityTypeHelper", ["sap/base/Log","sap
|
|
|
842
862
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
843
863
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
844
864
|
*/
|
|
845
|
-
sap.ui.predefine("sap/fe/core/templating/FieldControlHelper", ["sap/fe/core/helpers/BindingToolkit"],function(o){"use strict";var n={};var i=o.or;var l=o.getExpressionFromAnnotation;var e=o.equal;var
|
|
865
|
+
sap.ui.predefine("sap/fe/core/templating/FieldControlHelper", ["sap/fe/core/helpers/BindingToolkit"],function(o){"use strict";var n={};var i=o.or;var t=o.isConstant;var l=o.getExpressionFromAnnotation;var e=o.equal;var r=o.constant;const d=function(o,n){var t,d,s;const v=o===null||o===void 0?void 0:(t=o.annotations)===null||t===void 0?void 0:(d=t.Common)===null||d===void 0?void 0:(s=d.FieldControl)===null||s===void 0?void 0:s.valueOf();if(typeof v==="object"&&!!v){return i(e(l(v,n),1),e(l(v,n),"1"))}return r(v==="Common.FieldControlType/ReadOnly")};n.isReadOnlyExpression=d;const s=function(o,n){var t,d,s;const v=o===null||o===void 0?void 0:(t=o.annotations)===null||t===void 0?void 0:(d=t.Common)===null||d===void 0?void 0:(s=d.FieldControl)===null||s===void 0?void 0:s.valueOf();if(typeof v==="object"&&!!v){return i(e(l(v,n),0),e(l(v,n),"0"))}return r(v==="Common.FieldControlType/Inapplicable")};n.isDisabledExpression=s;const v=function(o,n){return i(d(o,n),s(o,n))};n.isNonEditableExpression=v;const a=function(o,n){var r,d,s;const v=(r=o.annotations)===null||r===void 0?void 0:(d=r.Common)===null||d===void 0?void 0:(s=d.FieldControl)===null||s===void 0?void 0:s.valueOf();const a=l(v,n);return i(t(a)&&e(a,"Common.FieldControlType/Mandatory"),e(a,7),e(a,"7"))};n.isRequiredExpression=a;return n},false);
|
|
846
866
|
/*!
|
|
847
867
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
848
868
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
849
869
|
*/
|
|
850
|
-
sap.ui.predefine("sap/fe/core/templating/FilterHelper", ["sap/base/Log","sap/fe/core/type/EDM","sap/ui/mdc/condition/Condition","sap/ui/mdc/enum/ConditionValidated"],function(e,t,n,i){"use strict";var o={};var a=t.isTypeFilterable;const s={Contains:"NotContains",StartsWith:"NotStartsWith",EndsWith:"NotEndsWith",Empty:"NotEmpty",NotEmpty:"Empty",LE:"NOTLE",GE:"NOTGE",LT:"NOTLT",GT:"NOTGT",BT:"NOTBT",NE:"EQ",EQ:"NE"};function d(e){let t;if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})\+(\d{1,4})/)){t=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})\+(\d{1,4})/)[0]}else if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})/)){t=`${e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})/)[0]}+0000`}else if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)){t=`${e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)[0]}T00:00:00+0000`}else if(e.indexOf("Z")===e.length-1){t=`${e.split("Z")[0]}+0100`}else{t=undefined}return t}o._getDateTimeOffsetCompliantValue=d;function r(e){return e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)?e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)[0]:e.match(/^(\d{8})/)&&e.match(/^(\d{8})/)[0]}o._getDateCompliantValue=r;function l(e,t){let n;if(!a(t)){return undefined}n=e;switch(t){case"Edm.Boolean":if(typeof e==="boolean"){n=e}else{n=e==="true"||(e==="false"?false:undefined)}break;case"Edm.Double":case"Edm.Single":n=isNaN(e)?undefined:parseFloat(e);break;case"Edm.Byte":case"Edm.Int16":case"Edm.Int32":case"Edm.SByte":n=isNaN(e)?undefined:parseInt(e,10);break;case"Edm.Date":n=r(e);break;case"Edm.DateTimeOffset":n=d(e);break;case"Edm.TimeOfDay":n=e.match(/(\d{1,2}):(\d{1,2}):(\d{1,2})/)?e.match(/(\d{1,2}):(\d{1,2}):(\d{1,2})/)[0]:undefined;break;default:}return n===null?undefined:n}o.getTypeCompliantValue=l;function c(t,n,i,o){let a=n,d,r;const l={};l.values=[];l.isEmpty=null;if(n===undefined||n===null){return undefined}switch(t){case"CP":r="Contains";if(a){const t=a.indexOf("*");const n=a.lastIndexOf("*");if(t>-1){if(t===0&&n!==a.length-1){r="EndsWith";a=a.substring(1,a.length)}else if(t!==0&&n===a.length-1){r="StartsWith";a=a.substring(0,a.length-1)}else{a=a.substring(1,a.length-1)}}else{e.warning("Contains Option cannot be used without '*'.");return undefined}}break;case"EQ":r=n===""?"Empty":t;break;case"NE":r=n===""?"NotEmpty":t;break;case"BT":if(i===undefined||i===null){return}d=i;r=t;break;case"LE":case"GE":case"GT":case"LT":r=t;break;default:e.warning(`Selection Option is not supported : '${t}'`);return undefined}if(o==="E"){r=s[r]}l.operator=r;if(r!=="Empty"){l.values.push(a);if(d){l.values.push(d)}}return l}o.resolveConditionValues=c;function u(e){return e.indexOf("/")>0?e.split("/")[1]:e}o.getRangeProperty=u;function f(e,t,n,i){const o=[];e===null||e===void 0?void 0:e.forEach(e=>{const a=i?i(e,t,n):h(e,t);if(a){o.push(a)}});return o}function p(e,t,n){const i=e.lastIndexOf("/");const o=i>-1?e.substring(0,e.lastIndexOf("/")+1):"";const a=t.getObject(`${n}/${o}`);return a===null||a===void 0?void 0:a[e.replace(o,"")]}function m(e,t,n,i){const o=e.PropertyName,a={},s=o.value||o.$PropertyPath,d=e.Ranges;const r=p(s,t,n);if(r){const e=f(d,r,s,i);if(e.length){a[s]=(a[s]||[]).concat(e)}}return a}function g(e,t,n,o){let a={};if(!n){return a}const s=n.SelectOptions,d=n.Parameters;s===null||s===void 0?void 0:s.forEach(n=>{const i=n.PropertyName,s=i.value||i.$PropertyPath;if(Object.keys(a).includes(s)){a[s]=a[s].concat(m(n,t,e,o)[s])}else{a={...a,...m(n,t,e,o)}}});d===null||d===void 0?void 0:d.forEach(e=>{const t=e.PropertyName.value||e.PropertyName.$PropertyPath;const n=o?{operator:"EQ",value1:e.PropertyValue,value2:null,path:t,isParameter:true}:{operator:"EQ",values:[e.PropertyValue],isEmpty:null,validated:i.Validated,isParameter:true};a[t]=[n]});return a}o.getFiltersConditionsFromSelectionVariant=g;function h(e,t){let o;const a=e.Sign?u(e.Sign):undefined;const s=e.Option?u(e.Option):undefined;const d=l(e.Low,t.$Type||t.type);const r=e.High?l(e.High,t.$Type||t.type):undefined;const f=c(s,d,r,a);if(f){o=n.createCondition(f.operator,f.values,null,null,i.Validated)}return o}o.getConditions=h;const E=function(e,t){const o={};const a=e.getInterface(1).getPath(),s=e.getInterface(1).getModel();if(t){for(const e in t){const t=s.getObject(`${a}/${e}@com.sap.vocabularies.Common.v1.FilterDefaultValue`);if(t!==undefined){const a=e;o[a]=[n.createCondition("EQ",[t],null,null,i.Validated)]}}}return o};const v=function(e,t,i){const o={};const a=e.getInterface(1);const s=a.getModel();const d=a.getPath();for(const e in i){if(i[e][0]){const t=e.split("::");let a="";const r=t.length;const l=t.slice(0,t.length-1).join("/");const c=t[r-1];if(l){const e=s.getObject(d+"/"+l);if(e.$kind==="NavigationProperty"&&e.$isCollection){a+=`${l}*/`}else if(e.$kind==="NavigationProperty"){a+=`${l}/`}}a+=c;const u="values"in i[e][0]?i[e][0].values:[];o[a]=[n.createCondition(i[e][0].operator,u,null,null,null)]}}return o};function y(){const e={};e["$editState"]=[n.createCondition("DRAFT_EDIT_STATE",["ALL"],null,null,i.Validated)];return e}function
|
|
870
|
+
sap.ui.predefine("sap/fe/core/templating/FilterHelper", ["sap/base/Log","sap/fe/core/type/EDM","sap/ui/mdc/condition/Condition","sap/ui/mdc/enum/ConditionValidated"],function(e,t,n,i){"use strict";var o={};var a=t.isTypeFilterable;const s={Contains:"NotContains",StartsWith:"NotStartsWith",EndsWith:"NotEndsWith",Empty:"NotEmpty",NotEmpty:"Empty",LE:"NOTLE",GE:"NOTGE",LT:"NOTLT",GT:"NOTGT",BT:"NOTBT",NE:"EQ",EQ:"NE"};function d(e){let t;if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})\+(\d{1,4})/)){t=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})\+(\d{1,4})/)[0]}else if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})/)){t=`${e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})/)[0]}+0000`}else if(e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)){t=`${e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)[0]}T00:00:00+0000`}else if(e.indexOf("Z")===e.length-1){t=`${e.split("Z")[0]}+0100`}else{t=undefined}return t}o._getDateTimeOffsetCompliantValue=d;function r(e){return e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)?e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/)[0]:e.match(/^(\d{8})/)&&e.match(/^(\d{8})/)[0]}o._getDateCompliantValue=r;function l(e,t){let n;if(!a(t)){return undefined}n=e;switch(t){case"Edm.Boolean":if(typeof e==="boolean"){n=e}else{n=e==="true"||(e==="false"?false:undefined)}break;case"Edm.Double":case"Edm.Single":n=isNaN(e)?undefined:parseFloat(e);break;case"Edm.Byte":case"Edm.Int16":case"Edm.Int32":case"Edm.SByte":n=isNaN(e)?undefined:parseInt(e,10);break;case"Edm.Date":n=r(e);break;case"Edm.DateTimeOffset":n=d(e);break;case"Edm.TimeOfDay":n=e.match(/(\d{1,2}):(\d{1,2}):(\d{1,2})/)?e.match(/(\d{1,2}):(\d{1,2}):(\d{1,2})/)[0]:undefined;break;default:}return n===null?undefined:n}o.getTypeCompliantValue=l;function c(t,n,i,o){let a=n,d,r;const l={};l.values=[];l.isEmpty=null;if(n===undefined||n===null){return undefined}switch(t){case"CP":r="Contains";if(a){const t=a.indexOf("*");const n=a.lastIndexOf("*");if(t>-1){if(t===0&&n!==a.length-1){r="EndsWith";a=a.substring(1,a.length)}else if(t!==0&&n===a.length-1){r="StartsWith";a=a.substring(0,a.length-1)}else{a=a.substring(1,a.length-1)}}else{e.warning("Contains Option cannot be used without '*'.");return undefined}}break;case"EQ":r=n===""?"Empty":t;break;case"NE":r=n===""?"NotEmpty":t;break;case"BT":if(i===undefined||i===null){return}d=i;r=t;break;case"LE":case"GE":case"GT":case"LT":r=t;break;default:e.warning(`Selection Option is not supported : '${t}'`);return undefined}if(o==="E"){r=s[r]}l.operator=r;if(r!=="Empty"){l.values.push(a);if(d){l.values.push(d)}}return l}o.resolveConditionValues=c;function u(e){return e.indexOf("/")>0?e.split("/")[1]:e}o.getRangeProperty=u;function f(e,t,n,i){const o=[];e===null||e===void 0?void 0:e.forEach(e=>{const a=i?i(e,t,n):h(e,t);if(a){o.push(a)}});return o}function p(e,t,n){const i=e.lastIndexOf("/");const o=i>-1?e.substring(0,e.lastIndexOf("/")+1):"";const a=t.getObject(`${n}/${o}`);return a===null||a===void 0?void 0:a[e.replace(o,"")]}function m(e,t,n,i){const o=e.PropertyName,a={},s=o.value||o.$PropertyPath,d=e.Ranges;const r=p(s,t,n);if(r){const e=f(d,r,s,i);if(e.length){a[s]=(a[s]||[]).concat(e)}}return a}function g(e,t,n,o){let a={};if(!n){return a}const s=n.SelectOptions,d=n.Parameters;s===null||s===void 0?void 0:s.forEach(n=>{const i=n.PropertyName,s=i.value||i.$PropertyPath;if(Object.keys(a).includes(s)){a[s]=a[s].concat(m(n,t,e,o)[s])}else{a={...a,...m(n,t,e,o)}}});d===null||d===void 0?void 0:d.forEach(e=>{const t=e.PropertyName.value||e.PropertyName.$PropertyPath;const n=o?{operator:"EQ",value1:e.PropertyValue,value2:null,path:t,isParameter:true}:{operator:"EQ",values:[e.PropertyValue],isEmpty:null,validated:i.Validated,isParameter:true};a[t]=[n]});return a}o.getFiltersConditionsFromSelectionVariant=g;function h(e,t){let o;const a=e.Sign?u(e.Sign):undefined;const s=e.Option?u(e.Option):undefined;const d=l(e.Low,t.$Type||t.type);const r=e.High?l(e.High,t.$Type||t.type):undefined;const f=c(s,d,r,a);if(f){o=n.createCondition(f.operator,f.values,null,null,i.Validated)}return o}o.getConditions=h;const E=function(e,t){const o={};const a=e.getInterface(1).getPath(),s=e.getInterface(1).getModel();if(t){for(const e in t){const t=s.getObject(`${a}/${e}@com.sap.vocabularies.Common.v1.FilterDefaultValue`);if(t!==undefined){const a=e;o[a]=[n.createCondition("EQ",[t],null,null,i.Validated)]}}}return o};const v=function(e,t,i){const o={};const a=e.getInterface(1);const s=a.getModel();const d=a.getPath();for(const e in i){if(i[e][0]){const t=e.split("::");let a="";const r=t.length;const l=t.slice(0,t.length-1).join("/");const c=t[r-1];if(l){const e=s.getObject(d+"/"+l);if(e.$kind==="NavigationProperty"&&e.$isCollection){a+=`${l}*/`}else if(e.$kind==="NavigationProperty"){a+=`${l}/`}}a+=c;const u="values"in i[e][0]?i[e][0].values:[];o[a]=[n.createCondition(i[e][0].operator,u,null,null,null)]}}return o};function y(){const e={};e["$editState"]=[n.createCondition("DRAFT_EDIT_STATE",["ALL"],null,null,i.Validated)];return e}o.getEditStatusFilter=y;function T(e,t){var n,i;let o;const a=e.getInterface(1).getPath(),s=e.getInterface(1).getModel(),d=s.getObject(`${a}@`),r=s.getObject(`${a}/`);if(d&&(d["@com.sap.vocabularies.Common.v1.DraftRoot"]||d["@com.sap.vocabularies.Common.v1.DraftNode"])){o=y()}const l=(n=t)===null||n===void 0?void 0:n.selectionVariant;const c=((i=t)===null||i===void 0?void 0:i.defaultSemanticDates)||{};const u=E(e,r);const f=v(e,r,c);if(l){t=g(a,s,l)}else if(u){t=u}if(f){t={...t,...f}}if(o){t={...t,...o}}return Object.keys(t).length>0?JSON.stringify(t).replace(/([{}])/g,"\\$1"):undefined}o.getFilterConditions=T;function b(e){return(e===null||e===void 0?void 0:e.$Type)==="com.sap.vocabularies.UI.v1.SelectionVariantType"}o.isSelectionVariant=b;T.requiresIContext=true;return o},false);
|
|
851
871
|
/*!
|
|
852
872
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
853
873
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -872,7 +892,7 @@ sap.ui.predefine("sap/fe/core/templating/SemanticObjectHelper", [],function(){"u
|
|
|
872
892
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
873
893
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
874
894
|
*/
|
|
875
|
-
sap.ui.predefine("sap/fe/core/templating/UIFormatters", ["sap/fe/core/converters/helpers/BindingHelper","sap/fe/core/converters/MetaModelConverter","sap/fe/core/formatters/ValueFormatter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/FieldControlHelper","sap/fe/core/templating/PropertyHelper","sap/ui/mdc/enum/EditMode"],function(e,t,n,i,o,a,r,l,s,d){"use strict";var u={};var c=s.isKey;var v=s.isImmutable;var f=s.isComputed;var p=s.hasValueHelp;var g=s.getAssociatedUnitProperty;var m=s.getAssociatedCurrencyProperty;var y=l.isRequiredExpression;var h=l.isReadOnlyExpression;var b=l.isNonEditableExpression;var E=l.isDisabledExpression;var x=a.isPathUpdatable;var D=a.getTargetObjectPath;var T=a.getRelativePaths;var I=a.getContextRelativeTargetObjectPath;var $=o.isProperty;var O=o.isPathAnnotationExpression;var M=o.isMultipleNavigationProperty;var P=i.pathInModel;var C=i.or;var U=i.notEqual;var V=i.not;var F=i.isTruthy;var j=i.isConstant;var S=i.ifElse;var q=i.getExpressionFromAnnotation;var w=i.formatWithTypeInformation;var A=i.formatResult;var N=i.equal;var R=i.EDM_TYPE_MAPPING;var B=i.constant;var W=i.compileExpression;var z=i.and;var k=i.addTypeInformation;var H=t.getInvolvedDataModelObjects;var L=t.convertMetaModelContext;var K=e.UI;var G=e.singletonPathVisitor;const _=function(e){return r.getDisplayMode(e.targetObject,e)};u.getDisplayMode=_;const Y=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;let n=arguments.length>2?arguments[2]:undefined;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:K.IsEditable;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;return J(e,t,n,true,i,o)};u.getEditableExpressionAsObject=Y;const J=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;let n=arguments.length>2?arguments[2]:undefined;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:K.IsEditable;let a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;if(!e||typeof e==="string"){return W(false)}let r=B(true);if(t!==null){r=S(b(t),false,o)}const l=O(e)?e.$target:e;const s=T(n);const d=x(n,{propertyPath:e,pathVisitor:(e,t)=>G(e,n.convertedTypes,t)});if(W(d)==="false"&&a){return i?d:"false"}const u=S(C(z(V(d),a),f(l),c(l),v(l),b(l,s)),S(C(f(l),b(l,s)),false,K.IsTransientBinding),o);if(i){return z(u,r)}return W(z(u,r))};u.getEditableExpression=J;const Q=function(e,t){var n;const i=D(e);const o=P(`/collaboration/activities${i}`,"internal");const a=e===null||e===void 0?void 0:(n=e.targetEntityType)===null||n===void 0?void 0:n.keys;const r=[];a===null||a===void 0?void 0:a.forEach(function(e){const t=P(e.name);r.push(t)});return A([o,...r],t)};u.getCollaborationExpression=Q;const X=function(e,t,n){return Z(e,t,true,n)};u.getEnabledExpressionAsObject=X;const Z=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3?arguments[3]:undefined;if(!e||typeof e==="string"){return W(true)}let o;if(i){o=T(i)}let a=B(true);if(t!==null){a=S(E(t),false,true)}const r=O(e)?e.$target:e;const l=S(E(r,o),false,true);if(n){return z(l,a)}return W(z(l,a))};u.getEnabledExpression=Z;const ee=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;let a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:K.IsEditable;if(!e||typeof e==="string"||(o===null||o===void 0?void 0:o.$Type)==="com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath"){return d.Display}const r=O(e)?e.$target:e;const l=T(t);const s=x(t,{propertyPath:r,pathVisitor:(e,n)=>G(e,t.convertedTypes,n)});const u=Y(e,o,t,a,false);const c=X(e,o,t);const p=m(r);const y=p||g(r);let b=B(d.Editable);if(y){const e=h(y,l);b=S(C(e,f(y),z(v(y),V(K.IsTransientBinding)),n),S(!j(e)&&e,d.EditableReadOnly,d.EditableDisplay),d.Editable)}const E=C(h(r,l),h(o));const D=S(C(s,K.IsTransientBinding),S(c,S(u,b,S(z(!j(E)&&E,a),d.ReadOnly,d.Display)),S(a,d.Disabled,d.Display)),d.Display);if(i){return D}return W(D)};u.getEditMode=ee;const te=function(e){var t,n,i,o;const a=e.targetObject;const r=(t=a.annotations)===null||t===void 0?void 0:(n=t.Measures)===null||n===void 0?void 0:n.ISOCurrency;const l=r?r:(i=a.annotations)===null||i===void 0?void 0:(o=i.Measures)===null||o===void 0?void 0:o.Unit;if(l){return W(C(F(q(l)),V(K.IsTotal)))}else{return W(B(true))}};u.hasValidAnalyticalCurrencyOrUnit=te;const ne=function(e,t,n){const i=O(e)&&e.$target||e;const o=m(i)||g(i);if(!o){return W(n)}const a=h(o);const r=z(C(!j(a),V(a)),V(f(o)),V(v(o)));return W(S(r,t,n))};u.ifUnitEditable=ne;const ie=function(e,t,n){const i=O(e)&&e.$target||e;return p(i)?W(t):W(S(N(n,"Editable"),"Value",t))};u.getFieldDisplay=ie;const oe=function(e,t){var n,i,o,a;const r=R[e===null||e===void 0?void 0:e.type]||(t?R[t]:undefined);const l={type:r.type,constraints:{},formatOptions:{}};if($(e)){var s,d,u,c,v,f,p,g,m,y,h,b,E,x,D,T,I,O;l.constraints={scale:(s=r.constraints)!==null&&s!==void 0&&s.$Scale?e.scale:undefined,precision:(d=r.constraints)!==null&&d!==void 0&&d.$Precision?e.precision:undefined,maxLength:(u=r.constraints)!==null&&u!==void 0&&u.$MaxLength?e.maxLength:undefined,nullable:(c=r.constraints)!==null&&c!==void 0&&c.$Nullable?e.nullable:undefined,minimum:(v=r.constraints)!==null&&v!==void 0&&v["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((f=e.annotations)===null||f===void 0?void 0:(p=f.Validation)===null||p===void 0?void 0:p.Minimum)?`${(g=e.annotations)===null||g===void 0?void 0:(m=g.Validation)===null||m===void 0?void 0:m.Minimum}`:undefined,maximum:(y=r.constraints)!==null&&y!==void 0&&y["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((h=e.annotations)===null||h===void 0?void 0:(b=h.Validation)===null||b===void 0?void 0:b.Maximum)?`${(E=e.annotations)===null||E===void 0?void 0:(x=E.Validation)===null||x===void 0?void 0:x.Maximum}`:undefined,isDigitSequence:l.type==="sap.ui.model.odata.type.String"&&(D=r.constraints)!==null&&D!==void 0&&D["@com.sap.vocabularies.Common.v1.IsDigitSequence"]&&(T=e.annotations)!==null&&T!==void 0&&(I=T.Common)!==null&&I!==void 0&&I.IsDigitSequence?true:undefined,V4:(O=r.constraints)!==null&&O!==void 0&&O.$V4?true:undefined}}l.formatOptions={parseAsString:(l===null||l===void 0?void 0:(n=l.type)===null||n===void 0?void 0:n.indexOf("sap.ui.model.odata.type.Int"))===0||(l===null||l===void 0?void 0:(i=l.type)===null||i===void 0?void 0:i.indexOf("sap.ui.model.odata.type.Double"))===0?false:undefined,emptyString:(l===null||l===void 0?void 0:(o=l.type)===null||o===void 0?void 0:o.indexOf("sap.ui.model.odata.type.Int"))===0||(l===null||l===void 0?void 0:(a=l.type)===null||a===void 0?void 0:a.indexOf("sap.ui.model.odata.type.Double"))===0?"":undefined,parseKeepsEmptyString:l.type==="sap.ui.model.odata.type.String"?true:undefined};return l};u.getTypeConfig=oe;const ae=function(e,t,i,o){var a,r,l,s,d;const u=e.targetObject;let c=(a=u.annotations)===null||a===void 0?void 0:(r=a.Measures)===null||r===void 0?void 0:r.Unit;const v=T(e);t=w(u,t);if(((l=c)===null||l===void 0?void 0:l.toString())==="%"){if((o===null||o===void 0?void 0:o.showMeasure)===false){return t}return A([t],n.formatWithPercentage)}const f=c?"sap.ui.model.odata.type.Unit":"sap.ui.model.odata.type.Currency";c=c?c:(s=u.annotations)===null||s===void 0?void 0:(d=s.Measures)===null||d===void 0?void 0:d.ISOCurrency;const p=c.$target?w(c.$target,q(c,v),i):q(c,v);return k([t,p],f,undefined,o)};u.getBindingWithUnitOrCurrency=ae;const re=function(e){var t,n,i,o,a;const r=e.targetObject;let l=(t=r.annotations)===null||t===void 0?void 0:(n=t.Measures)===null||n===void 0?void 0:n.Unit;if(((i=l)===null||i===void 0?void 0:i.toString())==="%"){return B("%")}const s=T(e);const d=l?"sap.ui.model.odata.type.Unit":"sap.ui.model.odata.type.Currency";l=l?l:(o=r.annotations)===null||o===void 0?void 0:(a=o.Measures)===null||a===void 0?void 0:a.ISOCurrency;const u=l.$target?w(l.$target,q(l,s)):q(l,s);let c=P(I(e));c=w(r,c,true);return k([c,u],d,undefined,{parseKeepsEmptyString:true,emptyString:"",showNumber:false})};u.getBindingForUnitOrCurrency=re;const le=function(e,t){var n,i;let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let r=arguments.length>4?arguments[4]:undefined;const l=e.targetObject;const s=(n=l.annotations)===null||n===void 0?void 0:(i=n.Common)===null||i===void 0?void 0:i.Timezone;const d=T(e);t=w(l,t);const u="sap.fe.core.type.DateTimeWithTimezone";const c=s.$target?w(s.$target,q(s,d),o):q(s,d);let v={};if(a){v={showTimezoneForEmptyValues:false}}if(r!==null&&r!==void 0&&r.showTime){v={...v,...{showTime:r.showTime==="false"?false:true}}}if(r!==null&&r!==void 0&&r.showDate){v={...v,...{showDate:r.showDate==="false"?false:true}}}if(r!==null&&r!==void 0&&r.showTimezone){v={...v,...{showTimezone:r.showTimezone==="false"?false:true}}}return k([t,c],u,undefined,v)};u.getBindingWithTimezone=le;const se=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"Begin";let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"Begin";return W(S(N(e,"Display"),t,n))};u.getAlignmentExpression=se;const de=function(e,t){if(t&&t.context){return L(t.context)}return null};de.requiresIContext=true;u.getConverterContext=de;const ue=function(e,t){if(t&&t.context){return H(t.context)}return null};ue.requiresIContext=true;u.getDataModelObjectPath=ue;const ce=function(e){var t;if((t=e.navigationProperties)!==null&&t!==void 0&&t.length){const t=(e===null||e===void 0?void 0:e.navigationProperties.findIndex(t=>{if(M(t)){var n,i;if((n=e.contextLocation)!==null&&n!==void 0&&(i=n.navigationProperties)!==null&&i!==void 0&&i.length){var o;return((o=e.contextLocation)===null||o===void 0?void 0:o.navigationProperties.findIndex(e=>e.name===t.name))===-1}return true}return false}))>-1;if(t){return true}}return false};u.isMultiValueField=ce;const ve=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return fe(e,t,n,true)};u.getRequiredExpressionAsObject=ve;const fe=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};let a=arguments.length>5?arguments[5]:undefined;const r=o.requiredPropertiesFromInsertRestrictions;const l=o.requiredPropertiesFromUpdateRestrictions;if(!e||typeof e==="string"){if(i){return B(false)}return W(B(false))}let s;if(a){s=T(a)}let d=B(true);if(t!==null){d=y(t)}let u=B(false);let c=B(false);const v=O(e)&&e.$target||e;const f=y(v,s);const p=n||K.IsEditable;if(r!==null&&r!==void 0&&r.includes(e.name)){u=z(B(true),K.IsCreateMode)}if(l!==null&&l!==void 0&&l.includes(e.name)){c=z(B(true),U(K.IsCreateMode,true))}const g=C(z(C(f,d),p),u,c);if(i){return g}return W(g)};u.getRequiredExpression=fe;const pe=function(e){var t,n;const i=e===null||e===void 0?void 0:(t=e.targetObject)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.Data;const o=Object.keys(i);const a=[];let r;const l=[];for(const e of o){if(i[e]["$Type"]&&i[e]["$Type"].indexOf("DataField")>-1){a.push(i[e])}}for(const e of a){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":if(typeof e.Value==="object"){r=e.Value.$target}break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":if(e.Target.$target){if(e.Target.$target.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.Target.$target.$Type==="com.sap.vocabularies.UI.v1.DataPointType"){if(typeof e.Target.$target.Value==="object"){r=e.Target.$target.Value.$target}}else{if(typeof e.Target==="object"){r=e.Target.$target}break}}break}l.push(ve(r,e,false))}return W(C(...l))};u.getRequiredExpressionForConnectedDataField=pe;return u},false);
|
|
895
|
+
sap.ui.predefine("sap/fe/core/templating/UIFormatters", ["sap/fe/core/converters/helpers/BindingHelper","sap/fe/core/converters/MetaModelConverter","sap/fe/core/formatters/ValueFormatter","sap/fe/core/helpers/BindingToolkit","sap/fe/core/helpers/TypeGuards","sap/fe/core/templating/DataModelPathHelper","sap/fe/core/templating/DisplayModeFormatter","sap/fe/core/templating/FieldControlHelper","sap/fe/core/templating/PropertyHelper","sap/ui/mdc/enum/EditMode"],function(e,t,n,i,o,a,r,l,s,d){"use strict";var u={};var c=s.isKey;var v=s.isImmutable;var f=s.isComputed;var p=s.hasValueHelp;var g=s.getAssociatedUnitProperty;var m=s.getAssociatedCurrencyProperty;var y=l.isRequiredExpression;var h=l.isReadOnlyExpression;var b=l.isNonEditableExpression;var E=l.isDisabledExpression;var x=a.isPathUpdatable;var D=a.getTargetObjectPath;var T=a.getRelativePaths;var I=a.getContextRelativeTargetObjectPath;var $=o.isProperty;var O=o.isPathAnnotationExpression;var M=o.isMultipleNavigationProperty;var P=i.pathInModel;var C=i.or;var U=i.not;var V=i.isTruthy;var F=i.isConstant;var j=i.ifElse;var S=i.getExpressionFromAnnotation;var w=i.formatWithTypeInformation;var A=i.formatResult;var q=i.equal;var N=i.EDM_TYPE_MAPPING;var R=i.constant;var B=i.compileExpression;var W=i.and;var z=i.addTypeInformation;var k=t.getInvolvedDataModelObjects;var H=t.convertMetaModelContext;var L=e.UI;var K=e.singletonPathVisitor;const G=function(e){return r.getDisplayMode(e.targetObject,e)};u.getDisplayMode=G;const _=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;let n=arguments.length>2?arguments[2]:undefined;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:L.IsEditable;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;return Y(e,t,n,true,i,o)};u.getEditableExpressionAsObject=_;const Y=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;let n=arguments.length>2?arguments[2]:undefined;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:L.IsEditable;let a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;if(!e||typeof e==="string"){return B(false)}let r=R(true);if(t!==null){r=j(b(t),false,o)}const l=O(e)?e.$target:e;const s=T(n);const d=x(n,{propertyPath:e,pathVisitor:(e,t)=>K(e,n.convertedTypes,t)});if(B(d)==="false"&&a){return i?d:"false"}const u=j(C(W(U(d),a),f(l),c(l),v(l),b(l,s)),j(C(f(l),b(l,s)),false,L.IsTransientBinding),o);if(i){return W(u,r)}return B(W(u,r))};u.getEditableExpression=Y;const J=function(e,t){var n;const i=D(e);const o=P(`/collaboration/activities${i}`,"internal");const a=e===null||e===void 0?void 0:(n=e.targetEntityType)===null||n===void 0?void 0:n.keys;const r=[];a===null||a===void 0?void 0:a.forEach(function(e){const t=P(e.name);r.push(t)});return A([o,...r],t)};u.getCollaborationExpression=J;const Q=function(e,t,n){return X(e,t,true,n)};u.getEnabledExpressionAsObject=Q;const X=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3?arguments[3]:undefined;if(!e||typeof e==="string"){return B(true)}let o;if(i){o=T(i)}let a=R(true);if(t!==null){a=j(E(t),false,true)}const r=O(e)?e.$target:e;const l=j(E(r,o),false,true);if(n){return W(l,a)}return B(W(l,a))};u.getEnabledExpression=X;const Z=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;let a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:L.IsEditable;if(!e||typeof e==="string"||(o===null||o===void 0?void 0:o.$Type)==="com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath"){return d.Display}const r=O(e)?e.$target:e;const l=T(t);const s=x(t,{propertyPath:r,pathVisitor:(e,n)=>K(e,t.convertedTypes,n)});const u=_(e,o,t,a,false);const c=Q(e,o,t);const p=m(r);const y=p||g(r);let b=R(d.Editable);if(y){const e=h(y,l);b=j(C(e,f(y),W(v(y),U(L.IsTransientBinding)),n),j(!F(e)&&e,d.EditableReadOnly,d.EditableDisplay),d.Editable)}const E=C(h(r,l),h(o));const D=j(C(s,L.IsTransientBinding),j(c,j(u,b,j(W(!F(E)&&E,a),d.ReadOnly,d.Display)),j(a,d.Disabled,d.Display)),d.Display);if(i){return D}return B(D)};u.getEditMode=Z;const ee=function(e){var t,n,i,o;const a=e.targetObject;const r=(t=a.annotations)===null||t===void 0?void 0:(n=t.Measures)===null||n===void 0?void 0:n.ISOCurrency;const l=r?r:(i=a.annotations)===null||i===void 0?void 0:(o=i.Measures)===null||o===void 0?void 0:o.Unit;if(l){return B(C(V(S(l)),U(L.IsTotal)))}else{return B(R(true))}};u.hasValidAnalyticalCurrencyOrUnit=ee;const te=function(e,t,n){const i=O(e)&&e.$target||e;const o=m(i)||g(i);if(!o){return B(n)}const a=h(o);const r=W(C(!F(a),U(a)),U(f(o)),U(v(o)));return B(j(r,t,n))};u.ifUnitEditable=te;const ne=function(e,t,n){const i=O(e)&&e.$target||e;return p(i)?B(t):B(j(q(n,"Editable"),"Value",t))};u.getFieldDisplay=ne;const ie=function(e,t){var n,i,o,a;const r=N[e===null||e===void 0?void 0:e.type]||(t?N[t]:undefined);const l={type:r.type,constraints:{},formatOptions:{}};if($(e)){var s,d,u,c,v,f,p,g,m,y,h,b,E,x,D,T,I,O;l.constraints={scale:(s=r.constraints)!==null&&s!==void 0&&s.$Scale?e.scale:undefined,precision:(d=r.constraints)!==null&&d!==void 0&&d.$Precision?e.precision:undefined,maxLength:(u=r.constraints)!==null&&u!==void 0&&u.$MaxLength?e.maxLength:undefined,nullable:(c=r.constraints)!==null&&c!==void 0&&c.$Nullable?e.nullable:undefined,minimum:(v=r.constraints)!==null&&v!==void 0&&v["@Org.OData.Validation.V1.Minimum/$Decimal"]&&!isNaN((f=e.annotations)===null||f===void 0?void 0:(p=f.Validation)===null||p===void 0?void 0:p.Minimum)?`${(g=e.annotations)===null||g===void 0?void 0:(m=g.Validation)===null||m===void 0?void 0:m.Minimum}`:undefined,maximum:(y=r.constraints)!==null&&y!==void 0&&y["@Org.OData.Validation.V1.Maximum/$Decimal"]&&!isNaN((h=e.annotations)===null||h===void 0?void 0:(b=h.Validation)===null||b===void 0?void 0:b.Maximum)?`${(E=e.annotations)===null||E===void 0?void 0:(x=E.Validation)===null||x===void 0?void 0:x.Maximum}`:undefined,isDigitSequence:l.type==="sap.ui.model.odata.type.String"&&(D=r.constraints)!==null&&D!==void 0&&D["@com.sap.vocabularies.Common.v1.IsDigitSequence"]&&(T=e.annotations)!==null&&T!==void 0&&(I=T.Common)!==null&&I!==void 0&&I.IsDigitSequence?true:undefined,V4:(O=r.constraints)!==null&&O!==void 0&&O.$V4?true:undefined}}l.formatOptions={parseAsString:(l===null||l===void 0?void 0:(n=l.type)===null||n===void 0?void 0:n.indexOf("sap.ui.model.odata.type.Int"))===0||(l===null||l===void 0?void 0:(i=l.type)===null||i===void 0?void 0:i.indexOf("sap.ui.model.odata.type.Double"))===0?false:undefined,emptyString:(l===null||l===void 0?void 0:(o=l.type)===null||o===void 0?void 0:o.indexOf("sap.ui.model.odata.type.Int"))===0||(l===null||l===void 0?void 0:(a=l.type)===null||a===void 0?void 0:a.indexOf("sap.ui.model.odata.type.Double"))===0?"":undefined,parseKeepsEmptyString:l.type==="sap.ui.model.odata.type.String"?true:undefined};return l};u.getTypeConfig=ie;const oe=function(e,t,i,o){var a,r,l,s,d;const u=e.targetObject;let c=(a=u.annotations)===null||a===void 0?void 0:(r=a.Measures)===null||r===void 0?void 0:r.Unit;const v=T(e);t=w(u,t);if(((l=c)===null||l===void 0?void 0:l.toString())==="%"){if((o===null||o===void 0?void 0:o.showMeasure)===false){return t}return A([t],n.formatWithPercentage)}const f=c?"sap.ui.model.odata.type.Unit":"sap.ui.model.odata.type.Currency";c=c?c:(s=u.annotations)===null||s===void 0?void 0:(d=s.Measures)===null||d===void 0?void 0:d.ISOCurrency;const p=c.$target?w(c.$target,S(c,v),i):S(c,v);return z([t,p],f,undefined,o)};u.getBindingWithUnitOrCurrency=oe;const ae=function(e){var t,n,i,o,a;const r=e.targetObject;let l=(t=r.annotations)===null||t===void 0?void 0:(n=t.Measures)===null||n===void 0?void 0:n.Unit;if(((i=l)===null||i===void 0?void 0:i.toString())==="%"){return R("%")}const s=T(e);const d=l?"sap.ui.model.odata.type.Unit":"sap.ui.model.odata.type.Currency";l=l?l:(o=r.annotations)===null||o===void 0?void 0:(a=o.Measures)===null||a===void 0?void 0:a.ISOCurrency;const u=l.$target?w(l.$target,S(l,s)):S(l,s);let c=P(I(e));c=w(r,c,true);return z([c,u],d,undefined,{parseKeepsEmptyString:true,emptyString:"",showNumber:false})};u.getBindingForUnitOrCurrency=ae;const re=function(e,t){var n,i;let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let r=arguments.length>4?arguments[4]:undefined;const l=e.targetObject;const s=(n=l.annotations)===null||n===void 0?void 0:(i=n.Common)===null||i===void 0?void 0:i.Timezone;const d=T(e);t=w(l,t);const u="sap.fe.core.type.DateTimeWithTimezone";const c=s.$target?w(s.$target,S(s,d),o):S(s,d);let v={};if(a){v={showTimezoneForEmptyValues:false}}if(r!==null&&r!==void 0&&r.showTime){v={...v,...{showTime:r.showTime==="false"?false:true}}}if(r!==null&&r!==void 0&&r.showDate){v={...v,...{showDate:r.showDate==="false"?false:true}}}if(r!==null&&r!==void 0&&r.showTimezone){v={...v,...{showTimezone:r.showTimezone==="false"?false:true}}}return z([t,c],u,undefined,v)};u.getBindingWithTimezone=re;const le=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"Begin";let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"Begin";return B(j(q(e,"Display"),t,n))};u.getAlignmentExpression=le;const se=function(e,t){if(t&&t.context){return H(t.context)}return null};se.requiresIContext=true;u.getConverterContext=se;const de=function(e,t){if(t&&t.context){return k(t.context)}return null};de.requiresIContext=true;u.getDataModelObjectPath=de;const ue=function(e){var t;if((t=e.navigationProperties)!==null&&t!==void 0&&t.length){const t=(e===null||e===void 0?void 0:e.navigationProperties.findIndex(t=>{if(M(t)){var n,i;if((n=e.contextLocation)!==null&&n!==void 0&&(i=n.navigationProperties)!==null&&i!==void 0&&i.length){var o;return((o=e.contextLocation)===null||o===void 0?void 0:o.navigationProperties.findIndex(e=>e.name===t.name))===-1}return true}return false}))>-1;if(t){return true}}return false};u.isMultiValueField=ue;const ce=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return ve(e,t,n,true)};u.getRequiredExpressionAsObject=ce;const ve=function(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;let o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};let a=arguments.length>5?arguments[5]:undefined;const r=o.requiredPropertiesFromInsertRestrictions;const l=o.requiredPropertiesFromUpdateRestrictions;if(!e||typeof e==="string"){if(i){return R(false)}return B(R(false))}let s;if(a){s=T(a)}let d=R(false);if(t!==null&&t!==undefined){d=y(t)}let u=R(false);let c=R(false);const v=O(e)&&e.$target||e;const f=y(v,s);const p=n||L.IsEditable;if(r!==null&&r!==void 0&&r.includes(e.name)){u=L.IsCreateMode}if(l!==null&&l!==void 0&&l.includes(e.name)){c=W(L.IsEditable,U(L.IsCreateMode))}const g=C(W(C(f,d),p),u,c);if(i){return g}return B(g)};u.getRequiredExpression=ve;const fe=function(e){var t,n;const i=e===null||e===void 0?void 0:(t=e.targetObject)===null||t===void 0?void 0:(n=t.$target)===null||n===void 0?void 0:n.Data;const o=Object.keys(i);const a=[];let r;const l=[];for(const e of o){if(i[e]["$Type"]&&i[e]["$Type"].indexOf("DataField")>-1){a.push(i[e])}}for(const e of a){switch(e.$Type){case"com.sap.vocabularies.UI.v1.DataField":case"com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":case"com.sap.vocabularies.UI.v1.DataFieldWithUrl":case"com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":case"com.sap.vocabularies.UI.v1.DataFieldWithAction":if(typeof e.Value==="object"){r=e.Value.$target}break;case"com.sap.vocabularies.UI.v1.DataFieldForAnnotation":if(e.Target.$target){if(e.Target.$target.$Type==="com.sap.vocabularies.UI.v1.DataField"||e.Target.$target.$Type==="com.sap.vocabularies.UI.v1.DataPointType"){if(typeof e.Target.$target.Value==="object"){r=e.Target.$target.Value.$target}}else{if(typeof e.Target==="object"){r=e.Target.$target}break}}break}l.push(ce(r,e,false))}return B(C(...l))};u.getRequiredExpressionForConnectedDataField=fe;return u},false);
|
|
876
896
|
/*!
|
|
877
897
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
878
898
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
@@ -897,18 +917,15 @@ sap.ui.predefine("sap/fe/core/type/FiscalDate", ["sap/fe/core/formatters/FiscalF
|
|
|
897
917
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
898
918
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved
|
|
899
919
|
*/
|
|
900
|
-
sap.ui.predefine("sap/fe/core/type/TypeUtil", ["sap/
|
|
920
|
+
sap.ui.predefine("sap/fe/core/type/TypeUtil", ["sap/base/util/merge","sap/fe/core/helpers/BindingToolkit","sap/ui/mdc/enum/BaseType","sap/ui/mdc/odata/v4/TypeUtil"],function(e,a,t,s){"use strict";var r=a.EDM_TYPE_MAPPING;const u=Object.assign({},s);u.getBaseType=function(e,a,r){switch(e){case"sap.ui.model.odata.type.Date":return t.Date;case"sap.ui.model.odata.type.TimeOfDay":return t.Time;case"sap.ui.model.odata.type.Unit":case"sap.ui.model.odata.type.Currency":if(!a||(!a.hasOwnProperty("showMeasure")||a.showMeasure)&&(!a.hasOwnProperty("showNumber")||a.showNumber)){return t.Unit}else if(!a.hasOwnProperty("showNumber")||a.showNumber){return t.Numeric}else{return t.String}default:return s.getBaseType.call(u,e,a,r)}};u.getDataTypeClassName=function(e){if(r[e]){e=r[e].type}else{e=s.getDataTypeClassName.call(u,e)}return e};u.getDataTypeInstance=function(a,t,s){switch(a){case"sap.ui.model.odata.type.DateTimeOffset":case"Edm.DateTimeOffset":s=e({},s||{});s.V4=true;break;default:}const r=u.getDataTypeClass(a);return new r(t,s)};return u},false);
|
|
901
921
|
sap.ui.require.preload({
|
|
902
|
-
"sap/fe/core/
|
|
903
|
-
"sap/fe/core/controllerextensions/collaboration/UserDetails.fragment.xml":'<core:FragmentDefinition xmlns="sap.m" xmlns:f="sap.f" xmlns:core="sap.ui.core"><ResponsivePopover id="userDetails" showHeader="false" class="sapUiContentPadding" placement="Bottom"><HBox><f:Avatar initials="{internal>initials}" displaySize="S" /><VBox><Label class="sapUiMediumMarginBegin" text="{internal>name}" /><Label class="sapUiMediumMarginBegin" text="{internal>id}" /></VBox></HBox></ResponsivePopover></core:FragmentDefinition>\n',
|
|
904
|
-
"sap/fe/core/controls/ActionParameterDialog.fragment.xml":'\n<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcField="sap.ui.mdc.field"\n\txmlns:form="sap.ui.layout.form"\n\txmlns:unittest="http://schemas.sap.com/sapui5/preprocessorextension/sap.fe.unittesting/1"\n\ttemplate:require="{\n\t\tMODEL: \'sap/ui/model/odata/v4/AnnotationHelper\',\n\t\tCOMMON: \'sap/fe/macros/CommonHelper\',\n\t\tFIELD: \'sap/fe/macros/field/FieldHelper\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tFE_MODEL: \'sap/fe/core/helpers/ModelHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\',\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\'\n\t}"\n><form:SimpleForm binding="{$Parameter}" width="20rem"><template:repeat list="{action>$Parameter}" var="parameter"><template:with path="parameter>" helper="COMMON.gotoActionParameter" var="actionParameter"><template:if test="{= !${action>$IsBound} || ${parameter>$Name} !== ${action>$Parameter/0/$Name} }"><Label\n\t\t\t\t\t\tunittest:id="ActionParameterDialogLabelExpressionTest"\n\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\ttext="{= ${actionParameter>@com.sap.vocabularies.Common.v1.Label} ? ${actionParameter>@com.sap.vocabularies.Common.v1.Label} : ${parameter>$Name}}"\n\t\t\t\t\t/><template:if test="{= !${parameter>$isCollection} }"><template:then><mdc:Field\n\t\t\t\t\t\t\t\tdelegate="{name:\'sap/fe/macros/field/FieldBaseDelegate\', payload:{retrieveTextFromValueList:true}}"\n\t\t\t\t\t\t\t\tunittest:id="ActionParameterDialogFieldExpressionTest"\n\t\t\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}]) }"\n\t\t\t\t\t\t\t\tvalue="{parameter>@@MODEL.format}"\n\t\t\t\t\t\t\t\tdisplay="{actionParameter>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\t\t\teditMode="{actionParameter>@@COMMON.getParameterEditMode}"\n\t\t\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\t\t\tmultipleLines="{= ${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} ? (${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} !== false) : undefined}"\n\t\t\t\t\t\t\t\trequired="{= FIELD.isRequired(${actionParameter>@@FIELD.fieldControl}, \'Editable\')}"\n\t\t\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${parameter>$Name} + \'\\\')\' }"\n\t\t\t\t\t\t\t\tfieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"\n\t\t\t\t\t\t\t\tvisible="{= (${actionParameter>$Name} === \'ResultIsActiveEntity\') ? false : ${actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility} }"\n\t\t\t\t\t\t\t\tariaLabelledBy="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\t\t><core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" /></mdc:Field></template:then><template:else><mdc:MultiValueField\n\t\t\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}]) }"\n\t\t\t\t\t\t\t\titems="{actionParameter>@@FE_MODEL.getActionParameterItemsModelPath}"\n\t\t\t\t\t\t\t\tdelegate="{name: \'sap/fe/core/controls/MultiValueParameterDelegate\'}"\n\t\t\t\t\t\t\t\tunittest:id="ActionParameterDialogMultiValueFieldExpressionTest"\n\t\t\t\t\t\t\t\tdisplay="{actionParameter>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\t\t\teditMode="{actionParameter>@@COMMON.getParameterEditMode}"\n\t\t\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\t\t\tmultipleLines="{= ${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} ? (${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} !== false) : undefined}"\n\t\t\t\t\t\t\t\trequired="{= FIELD.isRequired(${actionParameter>@@FIELD.fieldControl}, \'Editable\')}"\n\t\t\t\t\t\t\t\tfieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"\n\t\t\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${parameter>$Name} + \'\\\')\' }"\n\t\t\t\t\t\t\t\tvisible="{actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility}"\n\t\t\t\t\t\t\t\tariaLabelledBy="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\t\t><mdcField:MultiValueFieldItem\n\t\t\t\t\t\t\t\t\tkey="{path: \'mvfview>Key\', type:\'sap.ui.model.type.String\'}"\n\t\t\t\t\t\t\t\t\tdescription="{mvfview>Desc}"\n\t\t\t\t\t\t\t\t/><core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" /></mdc:MultiValueField></template:else></template:if></template:if></template:with></template:repeat></form:SimpleForm></core:FragmentDefinition>\n',
|
|
922
|
+
"sap/fe/core/controls/ActionParameterDialog.fragment.xml":'\n<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcField="sap.ui.mdc.field"\n\txmlns:form="sap.ui.layout.form"\n\txmlns:unittest="http://schemas.sap.com/sapui5/preprocessorextension/sap.fe.unittesting/1"\n\ttemplate:require="{\n\t\tMODEL: \'sap/ui/model/odata/v4/AnnotationHelper\',\n\t\tCOMMON: \'sap/fe/macros/CommonHelper\',\n\t\tFIELD: \'sap/fe/macros/field/FieldHelper\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tFE_MODEL: \'sap/fe/core/helpers/ModelHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\',\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\'\n\t}"\n><form:SimpleForm binding="{$Parameter}" width="20rem"><template:repeat list="{action>$Parameter}" var="parameter"><template:with path="parameter>" helper="COMMON.gotoActionParameter" var="actionParameter"><template:if test="{= !${action>$IsBound} || ${parameter>$Name} !== ${action>$Parameter/0/$Name} }"><Label\n\t\t\t\t\t\tunittest:id="ActionParameterDialogLabelExpressionTest"\n\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\ttext="{= ${actionParameter>@com.sap.vocabularies.Common.v1.Label} ? ${actionParameter>@com.sap.vocabularies.Common.v1.Label} : ${parameter>$Name}}"\n\t\t\t\t\t/><template:if test="{= !${parameter>$isCollection} }"><template:then><mdc:Field\n\t\t\t\t\t\t\t\tdelegate="{name:\'sap/fe/macros/field/FieldBaseDelegate\', payload:{retrieveTextFromValueList:true}}"\n\t\t\t\t\t\t\t\tunittest:id="ActionParameterDialogFieldExpressionTest"\n\t\t\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}]) }"\n\t\t\t\t\t\t\t\tvalue="{parameter>@@MODEL.format}"\n\t\t\t\t\t\t\t\tplaceholder="{actionParameter>@com.sap.vocabularies.UI.v1.Placeholder@@MODEL.value}"\n\t\t\t\t\t\t\t\tdisplay="{actionParameter>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\t\t\teditMode="{actionParameter>@@COMMON.getParameterEditMode}"\n\t\t\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\t\t\tmultipleLines="{= ${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} ? (${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} !== false) : undefined}"\n\t\t\t\t\t\t\t\trequired="{= FIELD.isRequired(${actionParameter>@@FIELD.fieldControl}, \'Editable\')}"\n\t\t\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${parameter>$Name} + \'\\\')\' }"\n\t\t\t\t\t\t\t\tfieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"\n\t\t\t\t\t\t\t\tvisible="{= (${actionParameter>$Name} === \'ResultIsActiveEntity\') ? false : ${actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility} }"\n\t\t\t\t\t\t\t\tariaLabelledBy="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\t\t><core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" /></mdc:Field></template:then><template:else><mdc:MultiValueField\n\t\t\t\t\t\t\t\tid="{= ID.generate([\'APD_\', ${parameter>$Name}]) }"\n\t\t\t\t\t\t\t\tplaceholder="{actionParameter>@com.sap.vocabularies.UI.v1.Placeholder@@MODEL.value}"\n\t\t\t\t\t\t\t\titems="{actionParameter>@@FE_MODEL.getActionParameterItemsModelPath}"\n\t\t\t\t\t\t\t\tdelegate="{name: \'sap/fe/core/controls/MultiValueParameterDelegate\'}"\n\t\t\t\t\t\t\t\tunittest:id="ActionParameterDialogMultiValueFieldExpressionTest"\n\t\t\t\t\t\t\t\tdisplay="{actionParameter>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\t\t\teditMode="{actionParameter>@@COMMON.getParameterEditMode}"\n\t\t\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\t\t\tmultipleLines="{= ${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} ? (${actionParameter>@com.sap.vocabularies.UI.v1.MultiLineText} !== false) : undefined}"\n\t\t\t\t\t\t\t\trequired="{= FIELD.isRequired(${actionParameter>@@FIELD.fieldControl}, \'Editable\')}"\n\t\t\t\t\t\t\t\tfieldHelp="{= FIELD.getActionParameterDialogFieldHelp(${actionParameter>@}, ${actionName>@sapui.name}, ${parameter>$Name}) }"\n\t\t\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${parameter>$Name} + \'\\\')\' }"\n\t\t\t\t\t\t\t\tvisible="{actionParameter>@com.sap.vocabularies.UI.v1.Hidden@@FIELD.getActionParameterVisibility}"\n\t\t\t\t\t\t\t\tariaLabelledBy="{= ID.generate([\'APD_\', ${parameter>$Name}, \'Label\']) }"\n\t\t\t\t\t\t\t><mdcField:MultiValueFieldItem\n\t\t\t\t\t\t\t\t\tkey="{path: \'mvfview>Key\', type:\'sap.ui.model.type.String\'}"\n\t\t\t\t\t\t\t\t\tdescription="{mvfview>Desc}"\n\t\t\t\t\t\t\t\t/><core:Fragment fragmentName="sap.fe.core.controls.ActionParameterDialogValueHelp" type="XML" /></mdc:MultiValueField></template:else></template:if></template:if></template:with></template:repeat></form:SimpleForm></core:FragmentDefinition>\n',
|
|
905
923
|
"sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml":'<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcv="sap.ui.mdc.valuehelp"\n\txmlns:mdcvc="sap.ui.mdc.valuehelp.content"\n\txmlns:unittest="http://schemas.sap.com/sapui5/preprocessorextension/sap.fe.unittesting/1"\n\txmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"\n\ttemplate:require="{\n\t\tCOMMON: \'sap/fe/macros/CommonHelper\',\n\t\tFIELD: \'sap/fe/macros/field/FieldHelper\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\',\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\'\n\t}"\n><template:if test="{= FIELD.hasValueHelpAnnotation(${actionParameter>@}) }"><mdc:dependents><mdc:ValueHelp\n\t\t\t\tunittest:id="ActionParameterDialogValuehelpExpressionTest"\n\t\t\t\tid="{= ID.generate([${actionName>@sapui.name},${parameter>$Name}]) }"\n\t\t\t\tdelegate="{= FIELD.getValueHelpDelegate(${action>$IsBound}, ${entitySet>@@COMMON.getContextPath}, ${actionName>@sapui.name}, ${parameter>$Name}) }"\n\t\t\t\tvalidateInput="{= ValueHelpTemplating.requiresValidation(${actionParameter>@@Property.getProperty})}"\n\t\t\t><mdc:typeahead><mdcv:Popover><mdcvc:MTable\n\t\t\t\t\t\t\tid="{= ID.generate([${actionName>@sapui.name},${parameter>$Name}]) }::Popover::qualifier::"\n\t\t\t\t\t\t\tcaseSensitive="{= ValueHelpTemplating.useCaseSensitiveFilterRequests(${actionParameter>@@Property.getPropertyObjectPath}, ${actionParameter>/@Org.OData.Capabilities.V1.FilterFunctions})}"\n\t\t\t\t\t\t\tuseAsValueHelp="{= ${actionParameter>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} || false}"\n\t\t\t\t\t\t/></mdcv:Popover></mdc:typeahead><template:if\n\t\t\t\t\ttest="{= ${actionParameter>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} ? (${actionParameter>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} === \'true\') : true}"\n\t\t\t\t><mdc:dialog><mdcv:Dialog /></mdc:dialog></template:if></mdc:ValueHelp></mdc:dependents></template:if></core:FragmentDefinition>\n',
|
|
906
|
-
"sap/fe/core/controls/
|
|
907
|
-
"sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml":'<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcv="sap.ui.mdc.valuehelp"\n\txmlns:mdcvc="sap.ui.mdc.valuehelp.content"\n\txmlns:form="sap.ui.layout.form"\n\txmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"\n\ttemplate:require="{\n\t\tMODEL: \'sap/ui/model/odata/v4/AnnotationHelper\',\n\t\tCOMMON: \'sap/fe/macros/CommonHelper\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\',\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\',\n\t\tFIELD: \'sap/fe/macros/field/FieldHelper\',\n\t\tUI: \'sap/fe/core/templating/UIFormatters\'\n\t}"\n><template:with path="fields>" var="allFields"><form:SimpleForm><template:repeat list="{allFields>}" var="key"><template:with path="key>" helper="COMMON.getPathToKey" var="immutableKey"><Label text="{= ${immutableKey>@com.sap.vocabularies.Common.v1.Label}}" /><mdc:Field\n\t\t\t\t\t\tdelegate="{name:\'sap/fe/macros/field/FieldBaseDelegate\', payload:{retrieveTextFromValueList:true}}"\n\t\t\t\t\t\tid="{= ID.generate([\'CreateDialog\', ${entitySet>@sapui.name}, ${immutableKey>@sapui.name}]) }"\n\t\t\t\t\t\tvalue="{immutableKey>@@MODEL.format}"\n\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\trequired="{= FIELD.getRequired(${immutableKey>@sapui.name}, ${immutableKey>@@UI.getDataModelObjectPath}, ${requiredProperties>})}"\n\t\t\t\t\t\tdisplay="{immutableKey>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${immutableKey>@sapui.name} + \'\\\')\' }"\n\t\t\t\t\t\tliveChange=".handleLiveChange"\n\t\t\t\t\t\tfieldHelp="{= ${immutableKey>@@Property.hasValueHelp} ? ID.generate([${immutableKey>@sapui.name},\'VH\']) : undefined }"\n\t\t\t\t\t\tcustomData:fieldName="{immutableKey>@sapui.name}"\n\t\t\t\t\t\teditMode="{= ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl} && ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl/$EnumMember} && ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl/$EnumMember} === \'com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly\' ? \'Display\' : \'Editable\'}"\n\t\t\t\t\t><template:if test="{immutableKey>@@Property.hasValueHelp}"><template:then><mdc:dependents><mdc:ValueHelp\n\t\t\t\t\t\t\t\t\t\tid="{= ID.generate([${immutableKey>@sapui.name},\'VH\']) }"\n\t\t\t\t\t\t\t\t\t\tdelegate="{= FIELD.getValueHelpDelegateForNonComputedVisibleKeyField(${immutableKey>@@Property.getPropertyPath}) }"\n\t\t\t\t\t\t\t\t\t\tvalidateInput="{= ValueHelpTemplating.requiresValidation(${immutableKey>@@Property.getProperty})}"\n\t\t\t\t\t\t\t\t\t><mdc:typeahead><mdcv:Popover><mdcvc:MTable\n\t\t\t\t\t\t\t\t\t\t\t\t\tid="{= ID.generate([${immutableKey>@sapui.name},\'VH\']) }::Popover::qualifier::"\n\t\t\t\t\t\t\t\t\t\t\t\t\tcaseSensitive="{= ValueHelpTemplating.useCaseSensitiveFilterRequests(${immutableKey>@@Property.getPropertyObjectPath}, ${immutableKey>/@Org.OData.Capabilities.V1.FilterFunctions})}"\n\t\t\t\t\t\t\t\t\t\t\t\t\tuseAsValueHelp="{= ${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} || false}"\n\t\t\t\t\t\t\t\t\t\t\t\t/></mdcv:Popover></mdc:typeahead><template:if\n\t\t\t\t\t\t\t\t\t\t\ttest="{= ${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} ? (${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} === \'true\') : true}"\n\t\t\t\t\t\t\t\t\t\t><mdc:dialog><mdcv:Dialog /></mdc:dialog></template:if></mdc:ValueHelp></mdc:dependents></template:then></template:if></mdc:Field></template:with></template:repeat></form:SimpleForm></template:with></core:FragmentDefinition>\n',
|
|
924
|
+
"sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml":'<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcv="sap.ui.mdc.valuehelp"\n\txmlns:mdcvc="sap.ui.mdc.valuehelp.content"\n\txmlns:form="sap.ui.layout.form"\n\txmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"\n\ttemplate:require="{\n\t\tMODEL: \'sap/ui/model/odata/v4/AnnotationHelper\',\n\t\tCOMMON: \'sap/fe/macros/CommonHelper\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\',\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\',\n\t\tFIELD: \'sap/fe/macros/field/FieldHelper\',\n\t\tUI: \'sap/fe/core/templating/UIFormatters\'\n\t}"\n><template:with path="fields>" var="allFields"><form:SimpleForm><template:repeat list="{allFields>}" var="key"><template:with path="key>" helper="COMMON.getPathToKey" var="immutableKey"><Label text="{= ${immutableKey>@com.sap.vocabularies.Common.v1.Label}}" /><mdc:Field\n\t\t\t\t\t\tdelegate="{name:\'sap/fe/macros/field/FieldBaseDelegate\', payload:{retrieveTextFromValueList:true}}"\n\t\t\t\t\t\tid="{= ID.generate([\'CreateDialog\', ${entitySet>@sapui.name}, ${immutableKey>@sapui.name}]) }"\n\t\t\t\t\t\tvalue="{immutableKey>@@MODEL.format}"\n\t\t\t\t\t\tplaceholder="{immutableKey>@com.sap.vocabularies.UI.v1.Placeholder@@MODEL.value}"\n\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\trequired="{= FIELD.getRequired(${immutableKey>@sapui.name}, ${immutableKey>@@UI.getDataModelObjectPath}, ${requiredProperties>})}"\n\t\t\t\t\t\tdisplay="{immutableKey>@@FIELD.getAPDialogDisplayFormat}"\n\t\t\t\t\t\tchange="{= \'.handleChange($event, \\\'\' + ${immutableKey>@sapui.name} + \'\\\')\' }"\n\t\t\t\t\t\tliveChange=".handleLiveChange"\n\t\t\t\t\t\tfieldHelp="{= ${immutableKey>@@Property.hasValueHelp} ? ID.generate([${immutableKey>@sapui.name},\'VH\']) : undefined }"\n\t\t\t\t\t\tcustomData:fieldName="{immutableKey>@sapui.name}"\n\t\t\t\t\t\teditMode="{= ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl} && ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl/$EnumMember} && ${immutableKey>@com.sap.vocabularies.Common.v1.FieldControl/$EnumMember} === \'com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly\' ? \'Display\' : \'Editable\'}"\n\t\t\t\t\t><template:if test="{immutableKey>@@Property.hasValueHelp}"><template:then><mdc:dependents><mdc:ValueHelp\n\t\t\t\t\t\t\t\t\t\tid="{= ID.generate([${immutableKey>@sapui.name},\'VH\']) }"\n\t\t\t\t\t\t\t\t\t\tdelegate="{= FIELD.getValueHelpDelegateForNonComputedVisibleKeyField(${immutableKey>@@Property.getPropertyPath}) }"\n\t\t\t\t\t\t\t\t\t\tvalidateInput="{= ValueHelpTemplating.requiresValidation(${immutableKey>@@Property.getProperty})}"\n\t\t\t\t\t\t\t\t\t><mdc:typeahead><mdcv:Popover><mdcvc:MTable\n\t\t\t\t\t\t\t\t\t\t\t\t\tid="{= ID.generate([${immutableKey>@sapui.name},\'VH\']) }::Popover::qualifier::"\n\t\t\t\t\t\t\t\t\t\t\t\t\tcaseSensitive="{= ValueHelpTemplating.useCaseSensitiveFilterRequests(${immutableKey>@@Property.getPropertyObjectPath}, ${immutableKey>/@Org.OData.Capabilities.V1.FilterFunctions})}"\n\t\t\t\t\t\t\t\t\t\t\t\t\tuseAsValueHelp="{= ${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} || false}"\n\t\t\t\t\t\t\t\t\t\t\t\t/></mdcv:Popover></mdc:typeahead><template:if\n\t\t\t\t\t\t\t\t\t\t\ttest="{= ${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} ? (${immutableKey>@com.sap.vocabularies.Common.v1.ValueListWithFixedValues} === \'true\') : true}"\n\t\t\t\t\t\t\t\t\t\t><mdc:dialog><mdcv:Dialog /></mdc:dialog></template:if></mdc:ValueHelp></mdc:dependents></template:then></template:if></mdc:Field></template:with></template:repeat></form:SimpleForm></template:with></core:FragmentDefinition>\n',
|
|
908
925
|
"sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml":'<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns:core="sap.ui.core"\n\txmlns="sap.m"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcField="sap.ui.mdc.field"\n\txmlns:f="sap.ui.layout.form"\n\txmlns:l="sap.ui.layout"\n\ttemplate:require="{\n\t\tMED: \'sap/fe/core/helpers/MassEditHelper\'\n\t}"\n><f:Form visible="{= MED.helpers.hasEditableFieldsBinding(${dataFieldModel>}, true) }"><f:layout><f:ResponsiveGridLayout\n\t\t\t\tlabelSpanXL="4"\n\t\t\t\tlabelSpanL="4"\n\t\t\t\tlabelSpanM="12"\n\t\t\t\tlabelSpanS="12"\n\t\t\t\tadjustLabelSpan="false"\n\t\t\t\temptySpanXL="0"\n\t\t\t\temptySpanL="0"\n\t\t\t\temptySpanM="0"\n\t\t\t\temptySpanS="0"\n\t\t\t\tcolumnsXL="2"\n\t\t\t\tcolumnsL="2"\n\t\t\t\tcolumnsM="1"\n\t\t\t\tsingleContainerFullSize="false"\n\t\t\t/></f:layout><f:formContainers><f:FormContainer><f:formElements><template:repeat list="{dataFieldModel>}" var="dataField"><f:FormElement\n\t\t\t\t\t\t\tlabel="{dataField>label}"\n\t\t\t\t\t\t\tvisible="{= \'{fieldsInfo>/values/\' + ${dataField>dataProperty} + \'/visible}\' }"\n\t\t\t\t\t\t><f:fields><template:with path="dataField>propertyInfo" var="property"><core:Fragment fragmentName="sap.fe.core.controls.massEdit.MassEditField" type="XML" /></template:with><template:if test="{dataField>unitInfo}"><template:with path="dataField>unitInfo" var="property"><core:Fragment fragmentName="sap.fe.core.controls.massEdit.MassEditField" type="XML" /></template:with></template:if></f:fields></f:FormElement></template:repeat></f:formElements></f:FormContainer></f:formContainers></f:Form><Text\n\t\tvisible="{= MED.helpers.hasEditableFieldsBinding(${dataFieldModel>}, false) }"\n\t\ttext="{fieldsInfo>/noFields}"\n\t\tclass="sapUiSmallMargin"\n\t/>\n\t/></core:FragmentDefinition>\n',
|
|
909
926
|
"sap/fe/core/controls/massEdit/MassEditField.fragment.xml":'<core:FragmentDefinition\n\txmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"\n\txmlns:core="sap.ui.core"\n\txmlns="sap.m"\n\txmlns:mdc="sap.ui.mdc"\n\txmlns:mdcField="sap.ui.mdc.field"\n\txmlns:control="sap.fe.core.controls"\n\txmlns:macro="sap.fe.macros"\n\txmlns:f="sap.ui.layout.form"\n\txmlns:l="sap.ui.layout"\n\txmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"\n\ttemplate:require="{\n\t\tProperty: \'sap/fe/core/templating/PropertyFormatters\',\n\t\tID: \'sap/fe/core/helpers/StableIdHelper\',\n\t\tValueHelpTemplating: \'sap/fe/macros/internal/valuehelp/ValueHelpTemplating\'\n\t}"\n><template:if test="{property>hasVH}"><template:then><template:with path="property>propertyPathForValueHelp" var="vhProperty"><mdc:Field\n\t\t\t\t\tdelegate="{name: \'sap/ui/mdc/odata/v4/FieldBaseDelegate\'}"\n\t\t\t\t\tid="{= ID.generate([\'MED_\', ${dataField>entitySet}, ${property>relativePath}, \'_MDCField\']) }"\n\t\t\t\t\tcore:require="{MassEditHandlers: \'sap/fe/core/controls/massEdit/MassEditHandlers\'}"\n\t\t\t\t\tchange="{= \'MassEditHandlers.handleMDCFieldChange($event, \\\'\' + ${property>relativePath} + \'\\\')\' }"\n\t\t\t\t\tlabel="{dataField>label}"\n\t\t\t\t\twidth="100%"\n\t\t\t\t\trequired="{dataField>isFieldRequired}"\n\t\t\t\t\tfieldHelp="{= ID.generate([\'MED_\', ${dataField>entitySet}, \'VHD\', ${vhProperty>@@Property.getRelativePropertyPath} ]) }"\n\t\t\t\t\tdisplay="{dataField>display}"\n\t\t\t\t\tvalue="{= ${property>relativePath} ? \'{path: \\\'\' + ${property>relativePath} + \'\\\', parameters: {$$noPatch: true} }\' : undefined }"\n\t\t\t\t\tadditionalValue="{= ${dataField>descriptionPath} ? \'{path: \\\'\' + ${dataField>descriptionPath} + \'\\\', parameters: {$$noPatch: true} }\' : undefined }"\n\t\t\t\t><mdc:layoutData><l:GridData\n\t\t\t\t\t\t\tspan="{= (!${dataField>unitProperty}) ? \'XL12 L12 M12 S12\' : ((${property>relativePath} === ${dataField>unitProperty}) ? \'XL4 L4 M4 S4\' : \'XL8 L8 M8 S8\') }"\n\t\t\t\t\t\t/></mdc:layoutData><control:MassEditSelect\n\t\t\t\t\t\tcore:require="{MassEditHandlers: \'sap/fe/core/controls/massEdit/MassEditHandlers\'}"\n\t\t\t\t\t\tid="{= ID.generate([\'MED_\', ${dataField>entitySet}, ${property>relativePath}]) }"\n\t\t\t\t\t\titems="{= \'{path : \\\'\' + ${property>runtimePath} + ${property>relativePath} + \'\\\'}\' }"\n\t\t\t\t\t\tchange="MassEditHandlers.handleSelectionChange($event)"\n\t\t\t\t\t\tselectedKey="{= \'{\' + ${property>runtimePath} + ${property>relativePath} + \'/selectedKey}\' }"\n\t\t\t\t\t\tselectValue="{= (${dataField>inputType} !== \'CheckBox\') && (\'{ parts : [{ path:\\\'\' + ${property>relativePath} + \'\\\'}, {value: \\\'\' + ${property>relativePath} + \'\\\' }, {value: \\\'\' + ID.generate([\'MED_\', ${dataField>entitySet}, ${property>relativePath}, \'_MDCField\']) + \'\\\' }], formatter: \\\'MassEditHandlers.contextPropertyChange\\\' }\') }"\n\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\tcustomData:fieldPath="{property>relativePath}"\n\t\t\t\t\t\tcustomData:propertyFullyQualifiedName="{property>propertyFullyQualifiedName}"\n\t\t\t\t\t><control:items><core:Item key="{fieldsInfo>key}" text="{fieldsInfo>text}" /></control:items><control:layoutData><l:GridData span="XL12 L12 M12 S12" /></control:layoutData></control:MassEditSelect><template:if test="{= ${dataField>inputType} !== \'CheckBox\' }"><mdc:dependents><macro:ValueHelp\n\t\t\t\t\t\t\t\tcontextPath="{contextPath>}"\n\t\t\t\t\t\t\t\tidPrefix="{= ID.generate([\'MED_\', ${dataField>entitySet}, \'VHD\' ]) }"\n\t\t\t\t\t\t\t\tproperty="{vhProperty>}"\n\t\t\t\t\t\t\t\tuseMultiValueField="true"\n\t\t\t\t\t\t\t/></mdc:dependents></template:if></mdc:Field></template:with></template:then><template:else><ComboBox\n\t\t\t\tid="{= ID.generate([\'MED_\', ${dataField>entitySet}, ${property>relativePath}]) }"\n\t\t\t\tcore:require="{MassEditHandlers: \'sap/fe/core/controls/massEdit/MassEditHandlers\'}"\n\t\t\t\titems="{= \'{path : \\\'\' + ${property>runtimePath} + ${property>relativePath} + \'\\\'}\' }"\n\t\t\t\tchange="MassEditHandlers.handleSelectionChange($event)"\n\t\t\t\tselectedKey="{= \'{\' + ${property>runtimePath} + ${property>relativePath} + \'/selectedKey}\' }"\n\t\t\t\tvisible="{= \'{\' + ${property>runtimePath} + ${property>relativePath} + \'/visible}\' }"\n\t\t\t\tcustomData:fieldPath="{property>relativePath}"\n\t\t\t\tcustomData:propertyFullyQualifiedName="{property>propertyFullyQualifiedName}"\n\t\t\t><items><core:Item key="{fieldsInfo>key}" text="{fieldsInfo>text}" /></items><layoutData><l:GridData\n\t\t\t\t\t\tspan="{= (!${dataField>unitProperty}) ? \'XL12 L12 M12 S12\' : ((${property>relativePath} === ${dataField>unitProperty}) ? \'XL4 L4 M4 S4\' : \'XL8 L8 M8 S8\') }"\n\t\t\t\t\t/></layoutData></ComboBox></template:else></template:if></core:FragmentDefinition>\n',
|
|
910
|
-
"sap/fe/core/fpm/manifest.json":'{"_version":"1.14.0","sap.app":{"id":"sap.fe.core.fpm","type":"component","applicationVersion":{"version":"1.
|
|
911
|
-
"sap/fe/core/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"sap.fe.core","type":"library","embeds":["fpm"],"applicationVersion":{"version":"1.
|
|
927
|
+
"sap/fe/core/fpm/manifest.json":'{"_version":"1.14.0","sap.app":{"id":"sap.fe.core.fpm","type":"component","applicationVersion":{"version":"1.115.0"},"title":"Object Page","tags":{"keywords":["Object Page"]},"ach":"CA-UI5-FE","offline":false,"resources":"resources.json"},"sap.ui":{"technology":"UI5","deviceTypes":{"desktop":true,"tablet":true,"phone":true},"supportedThemes":["sap_fiori_3","sap_hcb","sap_bluecrystal","sap_belize","sap_belize_plus","sap_belize_hcw"]},"sap.ui5":{"config":{"sapFiori2Adaptation":{"style":true,"hierarchy":true}},"services":{"templatedViewService":{"factoryName":"sap.fe.core.services.TemplatedViewService","startup":"waitFor","settings":{"converterType":"None"}},"asyncComponentService":{"factoryName":"sap.fe.core.services.AsyncComponentService","startup":"waitFor"}},"handleValidation":true,"dependencies":{"minUI5Version":"${sap.ui5.core.version}","libs":{"sap.f":{},"sap.fe.macros":{},"sap.m":{},"sap.ui.core":{},"sap.ui.layout":{},"sap.ui.mdc":{},"sap.ui.fl":{}}},"contentDensities":{"compact":true,"cozy":true}}}',
|
|
928
|
+
"sap/fe/core/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"sap.fe.core","type":"library","embeds":["fpm"],"applicationVersion":{"version":"1.115.0"},"title":"UI5 library: sap.fe.core","description":"UI5 library: sap.fe.core","ach":"CA-UI5-FE","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":[]},"sap.ui5":{"dependencies":{"libs":{"sap.ui.core":{},"sap.f":{},"sap.fe.navigation":{},"sap.fe.placeholder":{},"sap.m":{},"sap.ui.layout":{"lazy":true},"sap.ui.mdc":{},"sap.ui.fl":{}}},"library":{"i18n":{"bundleUrl":"messagebundle.properties","supportedLocales":["","ar","bg","ca","cs","cy","da","de","el","en","en-GB","en-US-sappsd","en-US-saprigi","en-US-saptrc","es","es-MX","et","fi","fr","fr-CA","hi","hr","hu","id","it","iw","ja","kk","ko","lt","lv","ms","nl","no","pl","pt","pt-PT","ro","ru","sh","sk","sl","sv","th","tr","uk","vi","zh-CN","zh-TW"]},"content":{"controls":[],"elements":[],"types":[],"interfaces":[]}}}}',
|
|
912
929
|
"sap/fe/core/rootView/Fcl.view.xml":'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.f" displayBlock="true" height="100%" controllerName="sap.fe.core.rootView.Fcl"><FlexibleColumnLayout id="appContent" backgroundDesign="Transparent" restoreFocusOnBackNavigation="true" autoFocus="false" /></mvc:View>\n',
|
|
913
930
|
"sap/fe/core/rootView/NavContainer.view.xml":'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" displayBlock="true" height="100%" controllerName="sap.fe.core.rootView.NavContainer"><NavContainer id="appContent" autoFocus="false" /></mvc:View>\n',
|
|
914
931
|
"sap/fe/core/services/view/TemplatingErrorPage.view.xml":'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="sap.fe.core.services.view.TemplatingErrorPage"><MessagePage\n\t\tshowHeader="false"\n\t\ticon="sap-icon://message-error"\n\t\ttext="{sap.fe.i18n>T_TEMPLATING_ERROR_PAGE_SAPFE_APPSTART_TEMPLATING_FAILED}"\n\t\tdescription="{= ${error>/message} ? ${error>/message} : \'\'}"\n\t/></mvc:View>\n'
|