@sapui5/sap.fe.core 1.111.1 → 1.112.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 +4 -4
- 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 +11 -11
- package/src/sap/fe/core/AppComponent-dbg.js +27 -5
- 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 +58 -3
- package/src/sap/fe/core/AppStateHandler-dbg.js +5 -2
- 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 +10 -1
- package/src/sap/fe/core/BaseController-dbg.js +1 -1
- package/src/sap/fe/core/BaseController.ts +2 -1
- package/src/sap/fe/core/CommonUtils-dbg.js +152 -365
- 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 +201 -478
- package/src/sap/fe/core/ExtensionAPI-dbg.js +2 -1
- package/src/sap/fe/core/ExtensionAPI.js +1 -1
- package/src/sap/fe/core/ExtensionAPI.js.map +1 -1
- package/src/sap/fe/core/ExtensionAPI.ts +9 -1
- package/src/sap/fe/core/PageController-dbg.js +26 -31
- package/src/sap/fe/core/PageController.js +1 -1
- package/src/sap/fe/core/PageController.js.map +1 -1
- package/src/sap/fe/core/PageController.ts +17 -3
- package/src/sap/fe/core/ResourceModel-dbg.js +71 -0
- package/src/sap/fe/core/ResourceModel.js +6 -0
- package/src/sap/fe/core/ResourceModel.js.map +1 -0
- package/src/sap/fe/core/ResourceModel.ts +67 -0
- package/src/sap/fe/core/TemplateComponent-dbg.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +1 -0
- package/src/sap/fe/core/TemplateModel-dbg.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +6 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel-dbg.js +5 -7
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +6 -5
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase-dbg.js +163 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +6 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +169 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport-dbg.js +88 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js +6 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.ts +147 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor-dbg.js +905 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js +21 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/{BuildingBlockRuntime.ts → BuildingBlockTemplateProcessor.ts} +290 -362
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock-dbg.js +79 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js +15 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.ts +68 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment-dbg.js +162 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js +6 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.ts +181 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo-dbg.js +4 -2
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +1 -1
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +5 -3
- package/src/sap/fe/core/controllerextensions/EditFlow-dbg.js +890 -220
- 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 +974 -239
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation-dbg.js +24 -34
- 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 +71 -61
- package/src/sap/fe/core/controllerextensions/InternalRouting-dbg.js +14 -17
- 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 +23 -17
- package/src/sap/fe/core/controllerextensions/KPIManagement-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -0
- package/src/sap/fe/core/controllerextensions/MassEdit-dbg.js +3 -3
- package/src/sap/fe/core/controllerextensions/MassEdit.js +1 -1
- package/src/sap/fe/core/controllerextensions/MassEdit.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +2 -2
- package/src/sap/fe/core/controllerextensions/MessageHandler-dbg.js +2 -1
- package/src/sap/fe/core/controllerextensions/MessageHandler.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +2 -0
- package/src/sap/fe/core/controllerextensions/PageReady-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/PageReady.ts +24 -0
- package/src/sap/fe/core/controllerextensions/Paginator-dbg.js +2 -1
- package/src/sap/fe/core/controllerextensions/Paginator.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Paginator.ts +7 -0
- package/src/sap/fe/core/controllerextensions/Placeholder-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +8 -0
- package/src/sap/fe/core/controllerextensions/Share-dbg.js +8 -1
- package/src/sap/fe/core/controllerextensions/Share.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Share.ts +11 -0
- package/src/sap/fe/core/controllerextensions/SideEffects-dbg.js +14 -13
- 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 +27 -27
- package/src/sap/fe/core/controllerextensions/ViewState-dbg.js +17 -8
- 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 +35 -14
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase-dbg.js +6 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +7 -4
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync-dbg.js +285 -82
- 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 +326 -89
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon-dbg.js +23 -2
- 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 +32 -3
- package/src/sap/fe/core/controllerextensions/collaboration/Manage-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +2 -3
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +17 -3
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block-dbg.js +65 -34
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +1 -1
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +33 -18
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper-dbg.js +45 -31
- 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 +52 -42
- package/src/sap/fe/core/controllerextensions/editFlow/draft-dbg.js +44 -49
- 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 +43 -63
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal-dbg.js +77 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js +6 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js.map +1 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.ts +114 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade-dbg.js +1505 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +6 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js.map +1 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +1985 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations-dbg.js +3 -1415
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +2 -1921
- package/src/sap/fe/core/controllerextensions/editFlow/sticky-dbg.js +10 -11
- 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 +9 -13
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling-dbg.js +43 -41
- 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 +44 -47
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher-dbg.js +12 -1
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +19 -0
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy-dbg.js +12 -13
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +1 -1
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +32 -13
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -1
- package/src/sap/fe/core/controls/CommandExecution-dbg.js +16 -5
- 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 +15 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler-dbg.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js.map +1 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +4 -1
- package/src/sap/fe/core/controls/FilterBar-dbg.js +1 -1
- package/src/sap/fe/core/controls/FilterBar.ts +5 -0
- package/src/sap/fe/core/controls/FormElementWrapper-dbg.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +3 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +7 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +4 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +10 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils-dbg.js +4 -3
- 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 +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +0 -1
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +2 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers-dbg.js +6 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js.map +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +5 -0
- package/src/sap/fe/core/converters/ConverterContext-dbg.js +1 -1
- package/src/sap/fe/core/converters/ConverterContext.ts +2 -1
- package/src/sap/fe/core/converters/ManifestSettings-dbg.js +1 -8
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.js.map +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +15 -6
- package/src/sap/fe/core/converters/ManifestWrapper-dbg.js +17 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +1 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js.map +1 -1
- package/src/sap/fe/core/converters/ManifestWrapper.ts +16 -0
- package/src/sap/fe/core/converters/MetaModelConverter-dbg.js +61 -49
- 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 +65 -51
- package/src/sap/fe/core/converters/TemplateConverter-dbg.js +2 -1
- package/src/sap/fe/core/converters/TemplateConverter.js.map +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField-dbg.js +65 -16
- 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 +62 -18
- package/src/sap/fe/core/converters/common/AnnotationConverter-dbg.js +1010 -957
- 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/Action-dbg.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Action.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Action.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Action.ts +28 -26
- package/src/sap/fe/core/converters/controls/Common/Chart-dbg.js +95 -33
- 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 +133 -49
- package/src/sap/fe/core/converters/controls/Common/DataVisualization-dbg.js +99 -62
- 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 +140 -75
- package/src/sap/fe/core/converters/controls/Common/Form-dbg.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -3
- package/src/sap/fe/core/converters/controls/Common/KPI-dbg.js +6 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +15 -15
- package/src/sap/fe/core/converters/controls/Common/Table-dbg.js +97 -69
- 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 +161 -137
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions-dbg.js +3 -3
- 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 +10 -9
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar-dbg.js +48 -44
- 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 +130 -86
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters-dbg.js +34 -26
- 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 +62 -45
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar-dbg.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet-dbg.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +5 -8
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection-dbg.js +34 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +54 -20
- package/src/sap/fe/core/converters/helpers/Aggregation-dbg.js +3 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +8 -0
- package/src/sap/fe/core/converters/helpers/ConfigurableObject-dbg.js +7 -6
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +19 -10
- package/src/sap/fe/core/converters/helpers/DataFieldHelper-dbg.js +1 -1
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +7 -2
- package/src/sap/fe/core/converters/helpers/ID-dbg.js +1 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +2 -1
- package/src/sap/fe/core/converters/helpers/IssueManager-dbg.js +9 -8
- package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +8 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction-dbg.js +8 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js.map +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +9 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter-dbg.js +25 -33
- 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 +35 -35
- package/src/sap/fe/core/converters/templates/ObjectPageConverter-dbg.js +11 -4
- 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 +7 -1
- package/src/sap/fe/core/formatters/FPMFormatter-dbg.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FiscalFormat-dbg.js +2 -2
- package/src/sap/fe/core/formatters/FiscalFormat.ts +6 -1
- package/src/sap/fe/core/formatters/TableFormatter-dbg.js +2 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
- package/src/sap/fe/core/formatters/TableFormatter.js.map +1 -1
- package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter-dbg.js +5 -5
- 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 +6 -4
- package/src/sap/fe/core/fpm/Component-dbg.js +1 -1
- package/src/sap/fe/core/fpm/Component.ts +1 -0
- package/src/sap/fe/core/fpm/manifest.json +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper-dbg.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit-dbg.js +6 -6
- package/src/sap/fe/core/helpers/BindingToolkit.js.map +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit.ts +8 -8
- package/src/sap/fe/core/helpers/ClassSupport-dbg.js +1 -1
- package/src/sap/fe/core/helpers/ClassSupport.js.map +1 -1
- package/src/sap/fe/core/helpers/ClassSupport.ts +1 -0
- package/src/sap/fe/core/helpers/DeleteHelper-dbg.js +93 -62
- 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 +140 -185
- package/src/sap/fe/core/helpers/MassEditHelper-dbg.js +20 -18
- 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 +22 -23
- package/src/sap/fe/core/helpers/MessageStrip-dbg.js +4 -5
- package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
- package/src/sap/fe/core/helpers/MessageStrip.js.map +1 -1
- package/src/sap/fe/core/helpers/MessageStrip.ts +4 -4
- package/src/sap/fe/core/helpers/MetaModelFunction-dbg.js +354 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.js +6 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.js.map +1 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.ts +408 -0
- package/src/sap/fe/core/helpers/ModelHelper-dbg.js +13 -13
- package/src/sap/fe/core/helpers/ModelHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +13 -13
- package/src/sap/fe/core/helpers/PasteHelper-dbg.js +5 -5
- package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.ts +6 -10
- package/src/sap/fe/core/helpers/ResourceModelHelper-dbg.js +26 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.js +6 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.js.map +1 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.ts +19 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators-dbg.js +93 -18
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.js.map +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +70 -17
- package/src/sap/fe/core/helpers/SemanticKeyHelper-dbg.js +2 -2
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/Synchronization-dbg.js +1 -1
- package/src/sap/fe/core/helpers/Synchronization.ts +2 -0
- package/src/sap/fe/core/helpers/TypeGuards-dbg.js +5 -1
- package/src/sap/fe/core/helpers/TypeGuards.js +1 -1
- package/src/sap/fe/core/helpers/TypeGuards.js.map +1 -1
- package/src/sap/fe/core/helpers/TypeGuards.ts +12 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader-dbg.js +2 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +6 -2
- package/src/sap/fe/core/jsx-runtime/jsx-control-dbg.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +3 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents-dbg.js +3 -3
- 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 +1 -1
- package/src/sap/fe/core/library-dbg.js +2 -2
- package/src/sap/fe/core/library-preload.js +127 -125
- 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.ts +7 -0
- package/src/sap/fe/core/manifest.json +1 -1
- package/src/sap/fe/core/messagebundle.properties +33 -0
- package/src/sap/fe/core/messagebundle_ar.properties +12 -10
- package/src/sap/fe/core/messagebundle_bg.properties +11 -9
- package/src/sap/fe/core/messagebundle_ca.properties +11 -9
- package/src/sap/fe/core/messagebundle_cs.properties +11 -9
- package/src/sap/fe/core/messagebundle_cy.properties +11 -9
- package/src/sap/fe/core/messagebundle_da.properties +11 -9
- package/src/sap/fe/core/messagebundle_de.properties +3 -1
- package/src/sap/fe/core/messagebundle_el.properties +11 -9
- package/src/sap/fe/core/messagebundle_en.properties +3 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +20 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +21 -3
- package/src/sap/fe/core/messagebundle_es.properties +11 -9
- package/src/sap/fe/core/messagebundle_es_MX.properties +11 -9
- package/src/sap/fe/core/messagebundle_et.properties +11 -9
- package/src/sap/fe/core/messagebundle_fi.properties +11 -9
- package/src/sap/fe/core/messagebundle_fr.properties +11 -9
- package/src/sap/fe/core/messagebundle_fr_CA.properties +3 -1
- package/src/sap/fe/core/messagebundle_hi.properties +2 -0
- package/src/sap/fe/core/messagebundle_hr.properties +11 -9
- package/src/sap/fe/core/messagebundle_hu.properties +11 -9
- package/src/sap/fe/core/messagebundle_id.properties +3 -1
- package/src/sap/fe/core/messagebundle_it.properties +11 -9
- package/src/sap/fe/core/messagebundle_iw.properties +11 -9
- package/src/sap/fe/core/messagebundle_ja.properties +11 -9
- package/src/sap/fe/core/messagebundle_kk.properties +11 -9
- package/src/sap/fe/core/messagebundle_ko.properties +2 -0
- package/src/sap/fe/core/messagebundle_lt.properties +11 -9
- package/src/sap/fe/core/messagebundle_lv.properties +2 -0
- package/src/sap/fe/core/messagebundle_ms.properties +12 -10
- package/src/sap/fe/core/messagebundle_nl.properties +12 -10
- package/src/sap/fe/core/messagebundle_no.properties +11 -9
- package/src/sap/fe/core/messagebundle_pl.properties +2 -0
- package/src/sap/fe/core/messagebundle_pt.properties +11 -9
- package/src/sap/fe/core/messagebundle_pt_PT.properties +11 -9
- package/src/sap/fe/core/messagebundle_ro.properties +3 -1
- package/src/sap/fe/core/messagebundle_ru.properties +3 -1
- package/src/sap/fe/core/messagebundle_sh.properties +11 -9
- package/src/sap/fe/core/messagebundle_sk.properties +11 -9
- package/src/sap/fe/core/messagebundle_sl.properties +11 -9
- package/src/sap/fe/core/messagebundle_sv.properties +2 -0
- package/src/sap/fe/core/messagebundle_th.properties +11 -9
- package/src/sap/fe/core/messagebundle_tr.properties +11 -9
- package/src/sap/fe/core/messagebundle_uk.properties +11 -9
- package/src/sap/fe/core/messagebundle_vi.properties +12 -10
- package/src/sap/fe/core/messagebundle_zh_CN.properties +2 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +2 -0
- package/src/sap/fe/core/operationsHelper-dbg.js +70 -44
- package/src/sap/fe/core/operationsHelper.js +1 -1
- package/src/sap/fe/core/operationsHelper.js.map +1 -1
- package/src/sap/fe/core/operationsHelper.ts +88 -63
- package/src/sap/fe/core/rootView/Fcl-dbg.controller.js +1 -1
- package/src/sap/fe/core/rootView/Fcl.controller.ts +10 -0
- package/src/sap/fe/core/rootView/NavContainer-dbg.controller.js +2 -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 +5 -3
- package/src/sap/fe/core/rootView/RootViewBaseController-dbg.js +4 -3
- 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 +15 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +15 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +4 -1
- package/src/sap/fe/core/services/NavigationServiceFactory-dbg.js +9 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +19 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory-dbg.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +10 -3
- package/src/sap/fe/core/services/RoutingServiceFactory-dbg.js +3 -3
- 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 -3
- package/src/sap/fe/core/services/ShellServicesFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/ShellServicesFactory.ts +14 -2
- package/src/sap/fe/core/services/SideEffectsServiceFactory-dbg.js +448 -279
- 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 +502 -333
- package/src/sap/fe/core/services/TemplatedViewServiceFactory-dbg.js +18 -5
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +41 -12
- package/src/sap/fe/core/support/Diagnostics-dbg.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -0
- package/src/sap/fe/core/templating/DataModelPathHelper-dbg.js +185 -86
- package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.js.map +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +190 -82
- package/src/sap/fe/core/templating/DisplayModeFormatter-dbg.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper-dbg.js +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper.js.map +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper.ts +1 -3
- package/src/sap/fe/core/templating/FilterHelper-dbg.js +3 -3
- 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 +5 -3
- package/src/sap/fe/core/templating/PropertyHelper-dbg.js +1 -1
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters-dbg.js +1 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +4 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone-dbg.js +1 -1
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +2 -0
- package/src/sap/fe/core/type/FiscalDate-dbg.js +2 -2
- package/src/sap/fe/core/type/FiscalDate.js.map +1 -1
- package/src/sap/fe/core/type/FiscalDate.ts +2 -1
- package/src/sap/fe/core/type/TypeUtil-dbg.js +5 -10
- 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 +3 -6
- package/src/sap/fe/core/buildingBlocks/BuildingBlock-dbg.js +0 -410
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +0 -15
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js.map +0 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +0 -536
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment-dbg.js +0 -44
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js +0 -6
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js.map +0 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.ts +0 -14
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime-dbg.js +0 -948
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +0 -19
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js.map +0 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow-dbg.js +0 -711
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +0 -6
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js.map +0 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +0 -863
- package/src/sap/fe/core/controls/ConditionalWrapper-dbg.js +0 -151
- package/src/sap/fe/core/controls/ConditionalWrapper.js +0 -6
- package/src/sap/fe/core/controls/ConditionalWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +0 -88
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper-dbg.js +0 -330
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +0 -6
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +0 -292
- package/src/sap/fe/core/controls/CustomQuickViewPage-dbg.js +0 -126
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +0 -6
- package/src/sap/fe/core/controls/CustomQuickViewPage.js.map +0 -1
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +0 -105
- package/src/sap/fe/core/controls/FieldWrapper-dbg.js +0 -194
- package/src/sap/fe/core/controls/FieldWrapper.js +0 -6
- package/src/sap/fe/core/controls/FieldWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/FieldWrapper.ts +0 -121
- package/src/sap/fe/core/controls/FileWrapper-dbg.js +0 -280
- package/src/sap/fe/core/controls/FileWrapper.js +0 -6
- package/src/sap/fe/core/controls/FileWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/FileWrapper.ts +0 -202
- package/src/sap/fe/core/helpers/SideEffectsHelper-dbg.js +0 -141
- package/src/sap/fe/core/helpers/SideEffectsHelper.js +0 -6
- package/src/sap/fe/core/helpers/SideEffectsHelper.js.map +0 -1
- package/src/sap/fe/core/helpers/SideEffectsHelper.ts +0 -129
package/src/sap/fe/core/buildingBlocks/{BuildingBlockRuntime.ts → BuildingBlockTemplateProcessor.ts}
RENAMED
|
@@ -1,48 +1,39 @@
|
|
|
1
|
-
import type ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
2
1
|
import Log from "sap/base/Log";
|
|
3
2
|
import deepClone from "sap/base/util/deepClone";
|
|
4
3
|
import uid from "sap/base/util/uid";
|
|
5
4
|
import type AppComponent from "sap/fe/core/AppComponent";
|
|
6
5
|
import AttributeModel from "sap/fe/core/buildingBlocks/AttributeModel";
|
|
6
|
+
import type BuildingBlockBase from "sap/fe/core/buildingBlocks/BuildingBlockBase";
|
|
7
7
|
import type {
|
|
8
8
|
BuildingBlockAggregationDefinition,
|
|
9
|
-
BuildingBlockBase,
|
|
10
|
-
BuildingBlockDefinition,
|
|
11
|
-
BuildingBlockDefinitionV1,
|
|
12
9
|
BuildingBlockMetadata,
|
|
13
10
|
BuildingBlockMetadataContextDefinition,
|
|
14
11
|
BuildingBlockPropertyDefinition,
|
|
15
12
|
ObjectValue,
|
|
16
13
|
ObjectValue2
|
|
17
|
-
} from "sap/fe/core/buildingBlocks/
|
|
14
|
+
} from "sap/fe/core/buildingBlocks/BuildingBlockSupport";
|
|
18
15
|
import type { Position } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
19
16
|
import { Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
20
17
|
import type { BindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
21
18
|
import { compileExpression, isBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
22
19
|
import { isContext, isFunctionArray } from "sap/fe/core/helpers/TypeGuards";
|
|
23
|
-
import ResourceModel from "sap/fe/
|
|
20
|
+
import type ResourceModel from "sap/fe/core/ResourceModel";
|
|
24
21
|
import BindingParser from "sap/ui/base/BindingParser";
|
|
25
22
|
import type Control from "sap/ui/core/Control";
|
|
26
23
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
27
24
|
import type Context from "sap/ui/model/Context";
|
|
28
|
-
import
|
|
25
|
+
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
29
26
|
import type Model from "sap/ui/model/Model";
|
|
30
27
|
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
31
|
-
import type _ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
32
28
|
import type { MacroInfo, TraceMetadataContext } from "./TraceInfo";
|
|
33
29
|
import TraceInfo from "./TraceInfo";
|
|
34
30
|
|
|
35
|
-
const LOGGER_SCOPE = "sap.fe.core.buildingBlocks.
|
|
31
|
+
const LOGGER_SCOPE = "sap.fe.core.buildingBlocks.BuildingBlockTemplateProcessor";
|
|
36
32
|
const XMLTEMPLATING_NS = "http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1";
|
|
37
33
|
const DOMParserInstance = new DOMParser();
|
|
38
|
-
let isTraceMode = false;
|
|
39
34
|
|
|
40
|
-
export type
|
|
41
|
-
properties: Record<string, BuildingBlockPropertyDefinition>;
|
|
42
|
-
aggregations: Record<string, BuildingBlockAggregationDefinition>;
|
|
35
|
+
export type TransformedBuildingBlockMetadata = BuildingBlockMetadata & {
|
|
43
36
|
metadataContexts: Record<string, BuildingBlockMetadataContextDefinition>;
|
|
44
|
-
isOpen: boolean;
|
|
45
|
-
defaultAggregation?: string;
|
|
46
37
|
};
|
|
47
38
|
|
|
48
39
|
/**
|
|
@@ -62,7 +53,7 @@ export type TemplateProcessorSettings = {
|
|
|
62
53
|
converterContext: JSONModel;
|
|
63
54
|
viewData: JSONModel;
|
|
64
55
|
metaModel: ODataMetaModel;
|
|
65
|
-
"sap.fe.i18n"?:
|
|
56
|
+
"sap.fe.i18n"?: ResourceModel;
|
|
66
57
|
};
|
|
67
58
|
bindingContexts: Record<string, Context>;
|
|
68
59
|
_macroInfo?: MacroInfo;
|
|
@@ -78,9 +69,9 @@ export type IVisitorCallback = {
|
|
|
78
69
|
* and {@link sap.ui.core.util.XMLPreprocessor.ICallback.visitChildNodes
|
|
79
70
|
* visitChildNodes}.
|
|
80
71
|
*
|
|
81
|
-
* @param
|
|
72
|
+
* @param oNode
|
|
82
73
|
* The XML DOM node
|
|
83
|
-
* @returns
|
|
74
|
+
* @returns
|
|
84
75
|
* A thenable which resolves with <code>undefined</code> as soon as visiting
|
|
85
76
|
* is done, or is rejected with a corresponding error if visiting fails
|
|
86
77
|
*/
|
|
@@ -93,13 +84,13 @@ export type IVisitorCallback = {
|
|
|
93
84
|
* put into place. Loading of fragments is asynchronous if the template view is
|
|
94
85
|
* asynchronous.
|
|
95
86
|
*
|
|
96
|
-
* @param
|
|
87
|
+
* @param sFragment
|
|
97
88
|
* the fragment's resolved name
|
|
98
|
-
* @param
|
|
89
|
+
* @param oElement
|
|
99
90
|
* the XML DOM element, e.g. <sap.ui.core:Fragment> or <core:ExtensionPoint>
|
|
100
|
-
* @param
|
|
91
|
+
* @param oWith
|
|
101
92
|
* the parent's "with" control
|
|
102
|
-
* @returns
|
|
93
|
+
* @returns
|
|
103
94
|
* A sync promise which resolves with <code>undefined</code> as soon as the fragment
|
|
104
95
|
* has been inserted, or is rejected with a corresponding error if loading or visiting
|
|
105
96
|
* fails.
|
|
@@ -113,12 +104,12 @@ export type IVisitorCallback = {
|
|
|
113
104
|
* Interprets the given XML DOM attribute value as a binding and returns the
|
|
114
105
|
* resulting value.
|
|
115
106
|
*
|
|
116
|
-
* @param
|
|
107
|
+
* @param sValue
|
|
117
108
|
* An XML DOM attribute value
|
|
118
|
-
* @param
|
|
109
|
+
* @param [element]
|
|
119
110
|
* The XML DOM element the attribute value belongs to (needed only for
|
|
120
111
|
* warnings which are logged to the console)
|
|
121
|
-
* @returns
|
|
112
|
+
* @returns
|
|
122
113
|
* A thenable which resolves with the resulting value, or is rejected with a
|
|
123
114
|
* corresponding error (for example, an error thrown by a formatter) or
|
|
124
115
|
* <code>null</code> in case the binding is not ready (because it refers to a
|
|
@@ -134,12 +125,12 @@ export type IVisitorCallback = {
|
|
|
134
125
|
* XML template in the usual way, that is, with a binding expression like
|
|
135
126
|
* <code>"{var>some/relative/path}"</code> (see example).
|
|
136
127
|
*
|
|
137
|
-
* @param
|
|
138
|
-
* Map from variable name (string) to value
|
|
139
|
-
* @param
|
|
128
|
+
* @param [mVariables={}]
|
|
129
|
+
* Map from variable name (string) to value
|
|
130
|
+
* @param [bReplace]
|
|
140
131
|
* Whether only the given variables are known in the new callback interface
|
|
141
132
|
* instance, no inherited ones
|
|
142
|
-
* @returns
|
|
133
|
+
* @returns
|
|
143
134
|
* A callback interface instance
|
|
144
135
|
* @param mVariables
|
|
145
136
|
* @param bReplace
|
|
@@ -147,16 +138,6 @@ export type IVisitorCallback = {
|
|
|
147
138
|
"with"(mVariables?: Record<string, Context>, bReplace?: boolean): IVisitorCallback;
|
|
148
139
|
};
|
|
149
140
|
|
|
150
|
-
/**
|
|
151
|
-
* Typeguard for checking if a building block uses API 1.
|
|
152
|
-
*
|
|
153
|
-
* @param buildingBlockDefinition
|
|
154
|
-
* @returns `true` if the building block is using API 1.
|
|
155
|
-
*/
|
|
156
|
-
function isV1MacroDef(buildingBlockDefinition: BuildingBlockDefinition): buildingBlockDefinition is BuildingBlockDefinitionV1 {
|
|
157
|
-
return buildingBlockDefinition.apiVersion === undefined || buildingBlockDefinition.apiVersion === 1;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
141
|
function validateMacroMetadataContext(
|
|
161
142
|
sName: string,
|
|
162
143
|
mContexts: Record<string, Context>,
|
|
@@ -197,7 +178,7 @@ function validateMacroMetadataContext(
|
|
|
197
178
|
}
|
|
198
179
|
export function validateMacroSignature(
|
|
199
180
|
sName: string,
|
|
200
|
-
oMetadata:
|
|
181
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
201
182
|
mContexts: Record<string, Context>,
|
|
202
183
|
oNode: Element
|
|
203
184
|
) {
|
|
@@ -244,79 +225,46 @@ const SAP_UI_CORE_ELEMENT = "sap.ui.core.Element";
|
|
|
244
225
|
export const SAP_UI_MODEL_CONTEXT = "sap.ui.model.Context";
|
|
245
226
|
|
|
246
227
|
/**
|
|
247
|
-
*
|
|
228
|
+
* Transforms the metadata of a building block by adding additional aggregations,
|
|
229
|
+
* and splitting properties into actual properties and metadata contexts.
|
|
248
230
|
*
|
|
249
231
|
* @param buildingBlockMetadata The metadata received from the input
|
|
250
|
-
* @
|
|
251
|
-
* @param apiVersion
|
|
252
|
-
* @returns A set of completed metadata for further processing
|
|
232
|
+
* @returns The transformed metadata
|
|
253
233
|
*/
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
};
|
|
234
|
+
function transformMetadata(buildingBlockMetadata: BuildingBlockMetadata): TransformedBuildingBlockMetadata {
|
|
235
|
+
const properties: Record<string, BuildingBlockPropertyDefinition> = {};
|
|
236
|
+
const aggregations: Record<string, BuildingBlockAggregationDefinition> = {
|
|
237
|
+
dependents: {
|
|
238
|
+
type: SAP_UI_CORE_ELEMENT,
|
|
239
|
+
slot: "dependents"
|
|
240
|
+
},
|
|
241
|
+
customData: {
|
|
242
|
+
type: SAP_UI_CORE_ELEMENT,
|
|
243
|
+
slot: "customData"
|
|
244
|
+
},
|
|
245
|
+
...buildingBlockMetadata.aggregations
|
|
246
|
+
};
|
|
247
|
+
const metadataContexts: Record<string, BuildingBlockPropertyDefinition> = {};
|
|
269
248
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
oAggregations.customData.slot = "customData";
|
|
273
|
-
}
|
|
249
|
+
for (const propertyName of Object.keys(buildingBlockMetadata.properties)) {
|
|
250
|
+
const propertyType = buildingBlockMetadata.properties[propertyName].type;
|
|
274
251
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Object.keys(buildingBlockMetadata.properties).forEach(function (sPropertyName: string) {
|
|
278
|
-
if (buildingBlockMetadata.properties[sPropertyName].type !== SAP_UI_MODEL_CONTEXT) {
|
|
279
|
-
oProperties[sPropertyName] = buildingBlockMetadata.properties[sPropertyName];
|
|
280
|
-
} else {
|
|
281
|
-
oMetadataContexts[sPropertyName] = buildingBlockMetadata.properties[sPropertyName];
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
// Merge events into properties as they are handled identically
|
|
285
|
-
if (buildingBlockMetadata.events !== undefined) {
|
|
286
|
-
Object.keys(buildingBlockMetadata.events).forEach(function (sEventName: string) {
|
|
287
|
-
oProperties[sEventName] = { type: "function", ...buildingBlockMetadata.events[sEventName] };
|
|
288
|
-
});
|
|
252
|
+
if (propertyType !== SAP_UI_MODEL_CONTEXT) {
|
|
253
|
+
properties[propertyName] = buildingBlockMetadata.properties[propertyName];
|
|
289
254
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
foundDefaultAggregation = sPropertyName;
|
|
295
|
-
}
|
|
296
|
-
});
|
|
255
|
+
|
|
256
|
+
if ([SAP_UI_MODEL_CONTEXT, "object", "array"].includes(propertyType)) {
|
|
257
|
+
// Explicitly defined contexts, objects, and arrays may come from the metadataContext
|
|
258
|
+
metadataContexts[propertyName] = buildingBlockMetadata.properties[propertyName];
|
|
297
259
|
}
|
|
298
|
-
return {
|
|
299
|
-
properties: oProperties,
|
|
300
|
-
aggregations: oAggregations,
|
|
301
|
-
defaultAggregation: foundDefaultAggregation,
|
|
302
|
-
metadataContexts: oMetadataContexts,
|
|
303
|
-
isOpen: isOpen
|
|
304
|
-
};
|
|
305
|
-
} else {
|
|
306
|
-
return {
|
|
307
|
-
metadataContexts: {},
|
|
308
|
-
aggregations: {
|
|
309
|
-
dependents: {
|
|
310
|
-
type: SAP_UI_CORE_ELEMENT
|
|
311
|
-
},
|
|
312
|
-
customData: {
|
|
313
|
-
type: SAP_UI_CORE_ELEMENT
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
properties: {},
|
|
317
|
-
isOpen: isOpen
|
|
318
|
-
};
|
|
319
260
|
}
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
...buildingBlockMetadata,
|
|
264
|
+
properties,
|
|
265
|
+
metadataContexts,
|
|
266
|
+
aggregations
|
|
267
|
+
};
|
|
320
268
|
}
|
|
321
269
|
|
|
322
270
|
/**
|
|
@@ -358,14 +306,13 @@ function _createInitialMetadataContext(
|
|
|
358
306
|
sAttributeValue: string
|
|
359
307
|
): MetaDataContext {
|
|
360
308
|
let returnContext: MetaDataContext;
|
|
361
|
-
if (sAttributeValue.startsWith("/uid--")) {
|
|
362
|
-
const
|
|
363
|
-
oSettings.models.converterContext.setProperty(sAttributeValue,
|
|
309
|
+
if (sAttributeValue.startsWith("/uid--") && !oSettings.models.converterContext.getProperty(sAttributeValue)) {
|
|
310
|
+
const data = unstoreObjectValue(sAttributeValue);
|
|
311
|
+
oSettings.models.converterContext.setProperty(sAttributeValue, data);
|
|
364
312
|
returnContext = {
|
|
365
313
|
model: "converterContext",
|
|
366
314
|
path: sAttributeValue
|
|
367
315
|
};
|
|
368
|
-
delete myStore[sAttributeValue];
|
|
369
316
|
} else if ((sAttributeName === "metaPath" && oSettings.currentContextPath) || sAttributeName === "contextPath") {
|
|
370
317
|
returnContext = _checkAbsoluteAndContextPaths(oSettings, sAttributeValue);
|
|
371
318
|
} else if (sAttributeValue && sAttributeValue.startsWith("/")) {
|
|
@@ -425,14 +372,12 @@ function _getMetadataContext(
|
|
|
425
372
|
* @param oNode The XML node to parse
|
|
426
373
|
* @param isPublic Whether the building block is used in a public context or not
|
|
427
374
|
* @param oVisitor The visitor instance
|
|
428
|
-
* @param apiVersion The API version of the building block
|
|
429
375
|
*/
|
|
430
376
|
async function processProperties(
|
|
431
|
-
oMetadata:
|
|
377
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
432
378
|
oNode: Element,
|
|
433
379
|
isPublic: boolean,
|
|
434
|
-
oVisitor: IVisitorCallback
|
|
435
|
-
apiVersion?: number
|
|
380
|
+
oVisitor: IVisitorCallback
|
|
436
381
|
) {
|
|
437
382
|
const oDefinitionProperties = oMetadata.properties;
|
|
438
383
|
|
|
@@ -442,7 +387,8 @@ async function processProperties(
|
|
|
442
387
|
const propertyValues: Record<string, ObjectValue> = {};
|
|
443
388
|
for (const sKeyValue of aDefinitionPropertiesKeys) {
|
|
444
389
|
if (oDefinitionProperties[sKeyValue].type === "object") {
|
|
445
|
-
propertyValues[sKeyValue] =
|
|
390
|
+
propertyValues[sKeyValue] =
|
|
391
|
+
oDefinitionProperties[sKeyValue].defaultValue && deepClone(oDefinitionProperties[sKeyValue].defaultValue); // To avoid values being reused across macros
|
|
446
392
|
} else {
|
|
447
393
|
propertyValues[sKeyValue] = oDefinitionProperties[sKeyValue].defaultValue as string | boolean | number;
|
|
448
394
|
}
|
|
@@ -453,7 +399,7 @@ async function processProperties(
|
|
|
453
399
|
await oVisitor.visitAttribute(oNode, oNode.attributes.getNamedItem(sKeyValue) as Attr);
|
|
454
400
|
let value: string | boolean | number | null | undefined = oNode.getAttribute(sKeyValue);
|
|
455
401
|
if (value !== undefined && value !== null) {
|
|
456
|
-
if (
|
|
402
|
+
if (typeof value === "string" && !value.startsWith("{")) {
|
|
457
403
|
switch (oDefinitionProperties[sKeyValue].type) {
|
|
458
404
|
case "boolean":
|
|
459
405
|
value = value === "true";
|
|
@@ -480,21 +426,20 @@ async function processProperties(
|
|
|
480
426
|
* @param isPublic Whether the building block is used in a public context or not
|
|
481
427
|
* @param oVisitor The visitor instance
|
|
482
428
|
* @param mContexts The contexts to be used
|
|
483
|
-
* @param
|
|
429
|
+
* @param propertyValues The current property values
|
|
484
430
|
* @returns The processed and missing contexts
|
|
485
431
|
*/
|
|
486
432
|
function processContexts(
|
|
487
|
-
oMetadata:
|
|
433
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
488
434
|
oSettings: TemplateProcessorSettings,
|
|
489
435
|
oNode: Element,
|
|
490
436
|
isPublic: boolean,
|
|
491
437
|
oVisitor: IVisitorCallback,
|
|
492
438
|
mContexts: Record<string, Context>,
|
|
493
|
-
|
|
439
|
+
propertyValues: Record<string, ObjectValue>
|
|
494
440
|
) {
|
|
495
441
|
oSettings.currentContextPath = oSettings.bindingContexts.contextPath;
|
|
496
442
|
const mMissingContext: Record<string, boolean> = {};
|
|
497
|
-
const propertyValues: Record<string, unknown> = {};
|
|
498
443
|
const oDefinitionContexts = oMetadata.metadataContexts;
|
|
499
444
|
const aDefinitionContextsKeys = Object.keys(oDefinitionContexts);
|
|
500
445
|
// Since the metaPath and other property can be relative to the contextPath we need to evaluate the current contextPath first
|
|
@@ -505,11 +450,17 @@ function processContexts(
|
|
|
505
450
|
aDefinitionContextsKeys.splice(0, 0, contextPathDefinition[0]);
|
|
506
451
|
}
|
|
507
452
|
for (const sAttributeName of aDefinitionContextsKeys) {
|
|
453
|
+
// If the context was resolved as a property (binding / xml aggregation) then we don't need to resolve it here.
|
|
454
|
+
const propertyValue = propertyValues[sAttributeName];
|
|
455
|
+
if (propertyValue !== undefined && typeof propertyValue === "object" && Object.keys(propertyValue as object).length > 0) {
|
|
456
|
+
delete oMetadata.metadataContexts[sAttributeName];
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
508
459
|
const bDoNotResolve = isPublic && oDefinitionContexts[sAttributeName].isPublic === false && oNode.hasAttribute(sAttributeName);
|
|
509
|
-
const oMetadataContext = _getMetadataContext(oSettings, oNode, sAttributeName, oVisitor, bDoNotResolve, oMetadata.isOpen);
|
|
460
|
+
const oMetadataContext = _getMetadataContext(oSettings, oNode, sAttributeName, oVisitor, bDoNotResolve, oMetadata.isOpen ?? false);
|
|
510
461
|
if (oMetadataContext) {
|
|
511
462
|
oMetadataContext.name = sAttributeName;
|
|
512
|
-
addSingleContext(mContexts, oVisitor, oMetadataContext
|
|
463
|
+
addSingleContext(mContexts, oVisitor, oMetadataContext);
|
|
513
464
|
if (
|
|
514
465
|
(sAttributeName === "entitySet" || sAttributeName === "contextPath") &&
|
|
515
466
|
!oSettings.bindingContexts.hasOwnProperty(sAttributeName)
|
|
@@ -519,12 +470,17 @@ function processContexts(
|
|
|
519
470
|
if (sAttributeName === "contextPath") {
|
|
520
471
|
oSettings.currentContextPath = mContexts[sAttributeName];
|
|
521
472
|
}
|
|
522
|
-
|
|
473
|
+
if (mContexts[sAttributeName] !== undefined) {
|
|
474
|
+
propertyValues[sAttributeName] = mContexts[sAttributeName];
|
|
475
|
+
} else if (typeof propertyValues[sAttributeName] === "string") {
|
|
476
|
+
// If the binding couldn't be resolved consider that there was no value here
|
|
477
|
+
delete oMetadata.metadataContexts[sAttributeName];
|
|
478
|
+
}
|
|
523
479
|
} else {
|
|
524
480
|
mMissingContext[sAttributeName] = true;
|
|
525
481
|
}
|
|
526
482
|
}
|
|
527
|
-
return
|
|
483
|
+
return mMissingContext;
|
|
528
484
|
}
|
|
529
485
|
|
|
530
486
|
export type BuildingBlockAggregation = {
|
|
@@ -554,6 +510,8 @@ function parseAggregation(oAggregation?: Element, processAggregations?: Function
|
|
|
554
510
|
aggregationObject = processAggregations(childDefinition, aggregationObject);
|
|
555
511
|
}
|
|
556
512
|
oOutObjects[aggregationObject.key] = aggregationObject;
|
|
513
|
+
} else if (childDefinition.tagName !== "slot") {
|
|
514
|
+
Log.error(`The aggregation ${childDefinition.nodeName} is missing a Key attribute. It is not displayed`);
|
|
557
515
|
}
|
|
558
516
|
}
|
|
559
517
|
}
|
|
@@ -568,57 +526,49 @@ function parseAggregation(oAggregation?: Element, processAggregations?: Function
|
|
|
568
526
|
* @param oMetadata The metadata for the building block
|
|
569
527
|
* @param isPublic Whether the building block is used in a public context or not
|
|
570
528
|
* @param propertyValues The values of already parsed property
|
|
571
|
-
* @param apiVersion The API version of the building block
|
|
572
529
|
*/
|
|
573
530
|
async function processChildren(
|
|
574
531
|
oNode: Element,
|
|
575
532
|
oVisitor: IVisitorCallback,
|
|
576
|
-
oMetadata:
|
|
533
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
577
534
|
isPublic: boolean,
|
|
578
|
-
propertyValues: Record<string, ObjectValue
|
|
579
|
-
apiVersion?: number
|
|
535
|
+
propertyValues: Record<string, ObjectValue>
|
|
580
536
|
) {
|
|
581
537
|
const oAggregations: Record<string, Element> = {};
|
|
582
538
|
if (oNode.firstElementChild !== null) {
|
|
583
539
|
let oFirstElementChild: Element | null = oNode.firstElementChild as Element | null;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
oFirstElementChild = oParent.children[iChildIndex] ? oParent.children[iChildIndex] : null;
|
|
594
|
-
} else {
|
|
595
|
-
// Not sure how this could happen but i also don't want to create infinite loops
|
|
596
|
-
oFirstElementChild = oFirstElementChild.nextElementSibling;
|
|
597
|
-
}
|
|
540
|
+
|
|
541
|
+
while (oFirstElementChild !== null) {
|
|
542
|
+
if (oFirstElementChild.namespaceURI === XMLTEMPLATING_NS) {
|
|
543
|
+
// In case we encounter a templating tag, run the visitor on it and continue with the resulting child
|
|
544
|
+
const oParent = oFirstElementChild.parentNode;
|
|
545
|
+
if (oParent) {
|
|
546
|
+
const iChildIndex = Array.from(oParent.children).indexOf(oFirstElementChild);
|
|
547
|
+
await oVisitor.visitNode(oFirstElementChild);
|
|
548
|
+
oFirstElementChild = oParent.children[iChildIndex] ? oParent.children[iChildIndex] : null;
|
|
598
549
|
} else {
|
|
599
|
-
|
|
600
|
-
let sAggregationName = sChildName;
|
|
601
|
-
if (sAggregationName[0].toUpperCase() === sAggregationName[0]) {
|
|
602
|
-
// not a sub aggregation, go back to default Aggregation
|
|
603
|
-
sAggregationName = oMetadata.defaultAggregation || "";
|
|
604
|
-
}
|
|
605
|
-
const aggregationDefinition = oMetadata.aggregations[sAggregationName];
|
|
606
|
-
if (aggregationDefinition !== undefined && !aggregationDefinition.slot) {
|
|
607
|
-
const parsedAggregation = parseAggregation(oFirstElementChild, aggregationDefinition.processAggregations);
|
|
608
|
-
propertyValues[sAggregationName] = parsedAggregation;
|
|
609
|
-
for (const parsedAggregationKey in parsedAggregation) {
|
|
610
|
-
oMetadata.aggregations[parsedAggregationKey] = parsedAggregation[parsedAggregationKey];
|
|
611
|
-
}
|
|
612
|
-
}
|
|
550
|
+
// Not sure how this could happen but I also don't want to create infinite loops
|
|
613
551
|
oFirstElementChild = oFirstElementChild.nextElementSibling;
|
|
614
552
|
}
|
|
553
|
+
} else {
|
|
554
|
+
const sChildName = oFirstElementChild.localName;
|
|
555
|
+
let sAggregationName = sChildName;
|
|
556
|
+
if (sAggregationName[0].toUpperCase() === sAggregationName[0]) {
|
|
557
|
+
// not a sub aggregation, go back to default Aggregation
|
|
558
|
+
sAggregationName = oMetadata.defaultAggregation || "";
|
|
559
|
+
}
|
|
560
|
+
const aggregationDefinition = oMetadata.aggregations[sAggregationName];
|
|
561
|
+
if (aggregationDefinition !== undefined && !aggregationDefinition.slot) {
|
|
562
|
+
const parsedAggregation = parseAggregation(oFirstElementChild, aggregationDefinition.processAggregations);
|
|
563
|
+
propertyValues[sAggregationName] = parsedAggregation;
|
|
564
|
+
for (const parsedAggregationKey in parsedAggregation) {
|
|
565
|
+
oMetadata.aggregations[parsedAggregationKey] = parsedAggregation[parsedAggregationKey];
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
oFirstElementChild = oFirstElementChild.nextElementSibling;
|
|
615
569
|
}
|
|
616
570
|
}
|
|
617
571
|
|
|
618
|
-
if (apiVersion !== 2) {
|
|
619
|
-
// If there are aggregation we need to visit the childNodes to resolve templating instructions
|
|
620
|
-
await oVisitor.visitChildNodes(oNode);
|
|
621
|
-
}
|
|
622
572
|
oFirstElementChild = oNode.firstElementChild;
|
|
623
573
|
while (oFirstElementChild !== null) {
|
|
624
574
|
const oNextChild: Element | null = oFirstElementChild.nextElementSibling;
|
|
@@ -632,38 +582,34 @@ async function processChildren(
|
|
|
632
582
|
Object.keys(oMetadata.aggregations).indexOf(sAggregationName) !== -1 &&
|
|
633
583
|
(!isPublic || oMetadata.aggregations[sAggregationName].isPublic === true)
|
|
634
584
|
) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
oAggregations[childDefinition.getAttribute("key")!] = childWrapper;
|
|
646
|
-
} else {
|
|
647
|
-
oAggregations[childDefinition.getAttribute("key")!] = childDefinition;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
childDefinition.removeAttribute("key");
|
|
651
|
-
childDefinition = nextChild;
|
|
652
|
-
}
|
|
653
|
-
} else if (aggregationDefinition.slot) {
|
|
654
|
-
if (sAggregationName !== sChildName) {
|
|
655
|
-
if (!oAggregations[sAggregationName]) {
|
|
656
|
-
const oNewChild = document.createElementNS(oNode.namespaceURI, sAggregationName);
|
|
657
|
-
oAggregations[sAggregationName] = oNewChild;
|
|
658
|
-
}
|
|
659
|
-
oAggregations[sAggregationName].appendChild(oFirstElementChild);
|
|
585
|
+
const aggregationDefinition = oMetadata.aggregations[sAggregationName];
|
|
586
|
+
if (!aggregationDefinition.slot && oFirstElementChild !== null && oFirstElementChild.children.length > 0) {
|
|
587
|
+
await oVisitor.visitNode(oFirstElementChild);
|
|
588
|
+
let childDefinition = oFirstElementChild.firstElementChild;
|
|
589
|
+
while (childDefinition) {
|
|
590
|
+
const nextChild = childDefinition.nextElementSibling;
|
|
591
|
+
if (!aggregationDefinition.hasVirtualNode) {
|
|
592
|
+
const childWrapper = document.createElementNS(oNode.namespaceURI, childDefinition.getAttribute("key")!);
|
|
593
|
+
childWrapper.appendChild(childDefinition);
|
|
594
|
+
oAggregations[childDefinition.getAttribute("key")!] = childWrapper;
|
|
660
595
|
} else {
|
|
661
|
-
oAggregations[
|
|
596
|
+
oAggregations[childDefinition.getAttribute("key")!] = childDefinition;
|
|
662
597
|
}
|
|
598
|
+
|
|
599
|
+
childDefinition.removeAttribute("key");
|
|
600
|
+
childDefinition = nextChild;
|
|
663
601
|
}
|
|
664
|
-
} else {
|
|
602
|
+
} else if (aggregationDefinition.slot) {
|
|
665
603
|
await oVisitor.visitNode(oFirstElementChild);
|
|
666
|
-
|
|
604
|
+
if (sAggregationName !== sChildName) {
|
|
605
|
+
if (!oAggregations[sAggregationName]) {
|
|
606
|
+
const oNewChild = document.createElementNS(oNode.namespaceURI, sAggregationName);
|
|
607
|
+
oAggregations[sAggregationName] = oNewChild;
|
|
608
|
+
}
|
|
609
|
+
oAggregations[sAggregationName].appendChild(oFirstElementChild);
|
|
610
|
+
} else {
|
|
611
|
+
oAggregations[sAggregationName] = oFirstElementChild;
|
|
612
|
+
}
|
|
667
613
|
}
|
|
668
614
|
} else if (Object.keys(oMetadata.properties).indexOf(sAggregationName) !== -1) {
|
|
669
615
|
await oVisitor.visitNode(oFirstElementChild);
|
|
@@ -754,31 +700,20 @@ function prepareAggregationElement(oNode: Element, sAggregationName: string, oEl
|
|
|
754
700
|
}
|
|
755
701
|
|
|
756
702
|
async function processBuildingBlock(
|
|
757
|
-
|
|
703
|
+
BuildingBlockClass: typeof BuildingBlockBase,
|
|
758
704
|
oNode: Element,
|
|
759
705
|
oVisitor: IVisitorCallback,
|
|
760
706
|
isPublic = false
|
|
761
707
|
) {
|
|
762
|
-
const
|
|
763
|
-
buildingBlockDefinition.fragment ||
|
|
764
|
-
`${buildingBlockDefinition.namespace}.${buildingBlockDefinition.xmlTag || buildingBlockDefinition.name}`;
|
|
708
|
+
const oMetadata = transformMetadata(BuildingBlockClass.metadata);
|
|
765
709
|
|
|
766
|
-
const
|
|
710
|
+
const sFragmentName = oMetadata.fragment || `${oMetadata.namespace}.${oMetadata.xmlTag || oMetadata.name}`;
|
|
767
711
|
|
|
768
712
|
const mContexts: Record<string, Context> = {};
|
|
769
|
-
const oMetadataContexts: Record<string, Context> = {};
|
|
770
713
|
const oSettings = oVisitor.getSettings();
|
|
771
|
-
|
|
772
|
-
if
|
|
773
|
-
|
|
774
|
-
.then(function (oResourceBundle: ResourceBundle) {
|
|
775
|
-
ResourceModel.setApplicationI18nBundle(oResourceBundle);
|
|
776
|
-
})
|
|
777
|
-
.catch(function (error: unknown) {
|
|
778
|
-
Log.error(error as string);
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
const oMetadata = prepareMetadata(buildingBlockDefinition.metadata, buildingBlockDefinition.isOpen, buildingBlockDefinition.apiVersion);
|
|
714
|
+
|
|
715
|
+
// Add an empty converter context if there is none in order to have a place to store object values
|
|
716
|
+
oSettings.models.converterContext ??= new JSONModel();
|
|
782
717
|
|
|
783
718
|
//Inject storage for macros
|
|
784
719
|
if (!oSettings[sFragmentName]) {
|
|
@@ -786,30 +721,13 @@ async function processBuildingBlock(
|
|
|
786
721
|
}
|
|
787
722
|
|
|
788
723
|
// First of all we need to visit the attributes to resolve the properties and the metadata contexts
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
const { mMissingContext, propertyValues: extraPropertyValues } = processContexts(
|
|
792
|
-
oMetadata,
|
|
793
|
-
oSettings,
|
|
794
|
-
oNode,
|
|
795
|
-
isPublic,
|
|
796
|
-
oVisitor,
|
|
797
|
-
mContexts,
|
|
798
|
-
oMetadataContexts
|
|
799
|
-
);
|
|
800
|
-
propertyValues = Object.assign(propertyValues, extraPropertyValues);
|
|
724
|
+
const propertyValues = await processProperties(oMetadata, oNode, isPublic, oVisitor);
|
|
801
725
|
const initialKeys = Object.keys(propertyValues);
|
|
726
|
+
const mMissingContext = processContexts(oMetadata, oSettings, oNode, isPublic, oVisitor, mContexts, propertyValues);
|
|
727
|
+
|
|
802
728
|
try {
|
|
803
729
|
// Aggregation and complex type support
|
|
804
|
-
const oAggregations = await processChildren(
|
|
805
|
-
oNode,
|
|
806
|
-
oVisitor,
|
|
807
|
-
oMetadata,
|
|
808
|
-
isPublic,
|
|
809
|
-
propertyValues,
|
|
810
|
-
buildingBlockDefinition.apiVersion
|
|
811
|
-
);
|
|
812
|
-
let oInstance: BuildingBlockBase | undefined;
|
|
730
|
+
const oAggregations = await processChildren(oNode, oVisitor, oMetadata, isPublic, propertyValues);
|
|
813
731
|
let oControlConfig = {};
|
|
814
732
|
|
|
815
733
|
if (oSettings.models.viewData) {
|
|
@@ -817,64 +735,39 @@ async function processBuildingBlock(
|
|
|
817
735
|
oControlConfig = oSettings.models.viewData.getProperty("/controlConfiguration");
|
|
818
736
|
}
|
|
819
737
|
let processedPropertyValues = propertyValues;
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
)
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
if (oData?.isA?.(SAP_UI_MODEL_CONTEXT) && !oData.getModel().isA("sap.ui.model.odata.v4.ODataMetaModel")) {
|
|
848
|
-
propertyValues[propName] = oData.getObject();
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
const BuildingBlockClass = buildingBlockDefinition as typeof BuildingBlockBase;
|
|
852
|
-
propertyValues.isPublic = isPublic;
|
|
853
|
-
|
|
854
|
-
oInstance = new BuildingBlockClass(
|
|
855
|
-
{ ...propertyValues, ...oAggregations },
|
|
856
|
-
oControlConfig,
|
|
857
|
-
oSettings
|
|
858
|
-
/*, oControlConfig, oSettings, oAggregations, isPublic*/
|
|
859
|
-
);
|
|
860
|
-
processedPropertyValues = oInstance.getProperties();
|
|
861
|
-
Object.keys(oMetadata.metadataContexts).forEach(function (sContextName: string) {
|
|
862
|
-
if (processedPropertyValues.hasOwnProperty(sContextName)) {
|
|
863
|
-
const targetObject = processedPropertyValues[sContextName];
|
|
864
|
-
if (typeof targetObject === "object" && !isContext(targetObject)) {
|
|
865
|
-
const sAttributeValue = storeValue(targetObject);
|
|
866
|
-
oSettings.models.converterContext.setProperty(sAttributeValue, targetObject);
|
|
867
|
-
const newContext = oSettings.models.converterContext.createBindingContext(sAttributeValue)!;
|
|
868
|
-
delete myStore[sAttributeValue];
|
|
869
|
-
mContexts[sContextName] = newContext;
|
|
870
|
-
} else if (!mContexts.hasOwnProperty(sContextName) && targetObject !== undefined) {
|
|
871
|
-
mContexts[sContextName] = targetObject as Context;
|
|
872
|
-
}
|
|
738
|
+
|
|
739
|
+
Object.keys(propertyValues).forEach((propName) => {
|
|
740
|
+
let oData = propertyValues[propName] as unknown as Context;
|
|
741
|
+
//check for additional processing function to validate / overwrite parameters
|
|
742
|
+
const originalDefinition = BuildingBlockClass?.metadata?.properties[propName];
|
|
743
|
+
if (originalDefinition?.validate) {
|
|
744
|
+
oData = originalDefinition.validate(oData) || oData;
|
|
745
|
+
}
|
|
746
|
+
if (oData?.isA?.(SAP_UI_MODEL_CONTEXT) && !oData.getModel().isA("sap.ui.model.odata.v4.ODataMetaModel")) {
|
|
747
|
+
propertyValues[propName] = oData.getObject();
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
propertyValues.isPublic = isPublic;
|
|
751
|
+
|
|
752
|
+
const oInstance = new BuildingBlockClass({ ...propertyValues, ...oAggregations }, oControlConfig, oSettings);
|
|
753
|
+
processedPropertyValues = oInstance.getProperties();
|
|
754
|
+
Object.keys(oMetadata.metadataContexts).forEach(function (sContextName: string) {
|
|
755
|
+
if (processedPropertyValues.hasOwnProperty(sContextName)) {
|
|
756
|
+
const targetObject = processedPropertyValues[sContextName];
|
|
757
|
+
if (typeof targetObject === "object" && !isContext(targetObject)) {
|
|
758
|
+
const attributeValue = storeObjectValue(targetObject);
|
|
759
|
+
oSettings.models.converterContext.setProperty(attributeValue, targetObject);
|
|
760
|
+
const newContext = oSettings.models.converterContext.createBindingContext(attributeValue)!;
|
|
761
|
+
unstoreObjectValue(attributeValue);
|
|
762
|
+
mContexts[sContextName] = newContext;
|
|
763
|
+
} else if (!mContexts.hasOwnProperty(sContextName) && targetObject !== undefined) {
|
|
764
|
+
mContexts[sContextName] = targetObject as Context;
|
|
873
765
|
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
const oAttributesModel: JSONModel = new AttributeModel(oNode, processedPropertyValues, BuildingBlockClass);
|
|
770
|
+
mContexts["this"] = oAttributesModel.createBindingContext("/");
|
|
878
771
|
let oPreviousMacroInfo: MacroInfo | undefined;
|
|
879
772
|
|
|
880
773
|
// Keep track
|
|
@@ -887,42 +780,31 @@ async function processBuildingBlock(
|
|
|
887
780
|
}
|
|
888
781
|
validateMacroSignature(sFragmentName, oMetadata, mContexts, oNode);
|
|
889
782
|
|
|
890
|
-
const oContextVisitor = oVisitor.with(
|
|
891
|
-
mContexts,
|
|
892
|
-
buildingBlockDefinition.isOpen !== undefined ? !buildingBlockDefinition.isOpen : true
|
|
893
|
-
);
|
|
783
|
+
const oContextVisitor = oVisitor.with(mContexts, oMetadata.isOpen !== undefined ? !oMetadata.isOpen : true);
|
|
894
784
|
const oParent = oNode.parentNode;
|
|
895
785
|
|
|
896
786
|
let iChildIndex: number;
|
|
897
787
|
let oPromise;
|
|
898
|
-
let processCustomData = true;
|
|
899
788
|
if (oParent) {
|
|
900
789
|
iChildIndex = Array.from(oParent.children).indexOf(oNode);
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
if (
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
const oData = myStore[myStoreKey];
|
|
913
|
-
oSettings.models.converterContext.setProperty(myStoreKey, oData);
|
|
914
|
-
delete myStore[myStoreKey];
|
|
915
|
-
}
|
|
790
|
+
|
|
791
|
+
if (oMetadata.fragment) {
|
|
792
|
+
oPromise = oContextVisitor.insertFragment(sFragmentName, oNode);
|
|
793
|
+
} else {
|
|
794
|
+
const templateString = await oInstance.getTemplate!(oNode);
|
|
795
|
+
|
|
796
|
+
if (BuildingBlockClass.isRuntime) {
|
|
797
|
+
// For runtime building blocks, we need to attach all objects to the converterContext directly, as the actual rendering takes place at runtime
|
|
798
|
+
for (const storeKey in temporaryObjectStore) {
|
|
799
|
+
const data = unstoreObjectValue(storeKey);
|
|
800
|
+
oSettings.models.converterContext.setProperty(storeKey, data);
|
|
916
801
|
}
|
|
917
|
-
addDefaultNamespace = true;
|
|
918
|
-
} else if (buildingBlockDefinition.getTemplate) {
|
|
919
|
-
templateString = await buildingBlockDefinition.getTemplate(processedPropertyValues);
|
|
920
802
|
}
|
|
921
803
|
|
|
922
804
|
let hasError = "";
|
|
923
805
|
if (templateString) {
|
|
924
806
|
let hasParseError = false;
|
|
925
|
-
let parsedTemplate = parseXMLString(templateString,
|
|
807
|
+
let parsedTemplate = parseXMLString(templateString, true);
|
|
926
808
|
// For safety purpose we try to detect trailing text in between XML Tags
|
|
927
809
|
for (const element of parsedTemplate) {
|
|
928
810
|
const iter = document.createNodeIterator(element, NodeFilter.SHOW_TEXT);
|
|
@@ -942,26 +824,17 @@ async function processBuildingBlock(
|
|
|
942
824
|
// If there is a parseerror while processing the XML it means the XML itself is malformed, as such we rerun the template process
|
|
943
825
|
// Setting isTraceMode true will make it so that each xml` expression is checked for validity from XML perspective
|
|
944
826
|
// If an error is found it's returned instead of the normal fragment
|
|
945
|
-
Log.error(
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
const initialTemplate = oInstance?.getTemplate
|
|
951
|
-
? await oInstance.getTemplate(oNode)
|
|
952
|
-
: await buildingBlockDefinition.getTemplate!(processedPropertyValues);
|
|
953
|
-
parsedTemplate = parseXMLString(initialTemplate, true);
|
|
954
|
-
} finally {
|
|
955
|
-
isTraceMode = false;
|
|
956
|
-
}
|
|
827
|
+
Log.error(`Error while processing building block ${oMetadata.xmlTag || oMetadata.name}`);
|
|
828
|
+
parsedTemplate = await processXmlInTrace(async () => {
|
|
829
|
+
const initialTemplate = await oInstance.getTemplate?.(oNode);
|
|
830
|
+
return parseXMLString(initialTemplate ?? "", true);
|
|
831
|
+
});
|
|
957
832
|
} else if (hasError.length > 0) {
|
|
958
833
|
// If there is trailing text we create a standard error and display it.
|
|
959
|
-
Log.error(
|
|
960
|
-
`Error while processing building block ${buildingBlockDefinition.xmlTag || buildingBlockDefinition.name}`
|
|
961
|
-
);
|
|
834
|
+
Log.error(`Error while processing building block ${oMetadata.xmlTag || oMetadata.name}`);
|
|
962
835
|
const oErrorText = createErrorXML(
|
|
963
836
|
[
|
|
964
|
-
`Error while processing building block ${
|
|
837
|
+
`Error while processing building block ${oMetadata.xmlTag || oMetadata.name}`,
|
|
965
838
|
`Trailing text was found in the XML: ${hasError}`
|
|
966
839
|
],
|
|
967
840
|
parsedTemplate.map((template) => template.outerHTML).join("\n")
|
|
@@ -970,20 +843,18 @@ async function processBuildingBlock(
|
|
|
970
843
|
}
|
|
971
844
|
oNode.replaceWith(...parsedTemplate);
|
|
972
845
|
oNode = oParent.children[iChildIndex];
|
|
973
|
-
processSlots(oAggregations, oMetadata.aggregations, oNode,
|
|
974
|
-
|
|
846
|
+
processSlots(oAggregations, oMetadata.aggregations, oNode, false);
|
|
847
|
+
|
|
975
848
|
oPromise = oContextVisitor.visitNode(oNode);
|
|
976
849
|
} else {
|
|
977
850
|
oNode.remove();
|
|
978
851
|
oPromise = Promise.resolve();
|
|
979
852
|
}
|
|
980
|
-
} else {
|
|
981
|
-
oPromise = oContextVisitor.insertFragment(sFragmentName, oNode);
|
|
982
853
|
}
|
|
983
854
|
|
|
984
855
|
await oPromise;
|
|
985
856
|
const oMacroElement = oParent.children[iChildIndex];
|
|
986
|
-
processSlots(oAggregations, oMetadata.aggregations, oMacroElement,
|
|
857
|
+
processSlots(oAggregations, oMetadata.aggregations, oMacroElement, true);
|
|
987
858
|
if (oMacroElement !== undefined) {
|
|
988
859
|
const oRemainingSlots = oMacroElement.querySelectorAll("slot");
|
|
989
860
|
oRemainingSlots.forEach(function (oSlotElement) {
|
|
@@ -1030,7 +901,7 @@ async function processBuildingBlock(
|
|
|
1030
901
|
}
|
|
1031
902
|
Log.error(e as string);
|
|
1032
903
|
const oError = createErrorXML(
|
|
1033
|
-
[`Error while processing building block ${
|
|
904
|
+
[`Error while processing building block ${oMetadata.name}`],
|
|
1034
905
|
oNode.outerHTML,
|
|
1035
906
|
traceDetails,
|
|
1036
907
|
(e as Error).stack
|
|
@@ -1046,11 +917,10 @@ function addSingleContext(
|
|
|
1046
917
|
name?: string;
|
|
1047
918
|
path: string;
|
|
1048
919
|
model?: string;
|
|
1049
|
-
}
|
|
1050
|
-
oMetadataContexts: Record<string, Context | undefined>
|
|
920
|
+
}
|
|
1051
921
|
) {
|
|
1052
922
|
const sKey = (oCtx.name || oCtx.model || undefined) as string;
|
|
1053
|
-
if (
|
|
923
|
+
if (mContexts[sKey]) {
|
|
1054
924
|
return; // do not add twice
|
|
1055
925
|
}
|
|
1056
926
|
try {
|
|
@@ -1066,33 +936,50 @@ function addSingleContext(
|
|
|
1066
936
|
} else {
|
|
1067
937
|
mContexts[sKey] = oVisitor.getContext(sContextPath); // add the context to the visitor
|
|
1068
938
|
}
|
|
1069
|
-
|
|
1070
|
-
oMetadataContexts[sKey] = mContexts[sKey]; // make it available inside metadataContexts JSON object
|
|
1071
939
|
} catch (ex) {
|
|
1072
|
-
//
|
|
1073
|
-
//
|
|
1074
|
-
// providing afterwards
|
|
1075
|
-
// TODO 0002 not yet implemented
|
|
1076
|
-
//mContexts["_$error"].oModel.setProperty("/" + sKey, ex);
|
|
940
|
+
// ignore the context as this can only be the case if the model is not ready,
|
|
941
|
+
// i.e. not a preprocessing model but maybe a model for providing afterwards
|
|
1077
942
|
}
|
|
1078
943
|
}
|
|
1079
944
|
|
|
1080
945
|
/**
|
|
1081
946
|
* Register a building block definition to be used inside the xml template processor.
|
|
1082
947
|
*
|
|
1083
|
-
* @param
|
|
948
|
+
* @param BuildingBlockClass The building block definition
|
|
1084
949
|
*/
|
|
1085
|
-
export function registerBuildingBlock(
|
|
950
|
+
export function registerBuildingBlock(BuildingBlockClass: typeof BuildingBlockBase): void {
|
|
1086
951
|
XMLPreprocessor.plugIn(
|
|
1087
|
-
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(
|
|
1088
|
-
|
|
1089
|
-
|
|
952
|
+
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(BuildingBlockClass, oNode, oVisitor),
|
|
953
|
+
BuildingBlockClass.metadata.namespace,
|
|
954
|
+
BuildingBlockClass.metadata.xmlTag || BuildingBlockClass.metadata.name
|
|
1090
955
|
);
|
|
1091
|
-
if (
|
|
956
|
+
if (BuildingBlockClass.metadata.publicNamespace) {
|
|
1092
957
|
XMLPreprocessor.plugIn(
|
|
1093
|
-
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(
|
|
1094
|
-
|
|
1095
|
-
|
|
958
|
+
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(BuildingBlockClass, oNode, oVisitor, true),
|
|
959
|
+
BuildingBlockClass.metadata.publicNamespace,
|
|
960
|
+
BuildingBlockClass.metadata.xmlTag || BuildingBlockClass.metadata.name
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* UnRegister a building block definition so that it is no longer used inside the xml template processor.
|
|
967
|
+
*
|
|
968
|
+
* @param BuildingBlockClass The building block definition
|
|
969
|
+
*/
|
|
970
|
+
export function unregisterBuildingBlock(BuildingBlockClass: typeof BuildingBlockBase): void {
|
|
971
|
+
if (BuildingBlockClass.metadata.namespace !== undefined) {
|
|
972
|
+
XMLPreprocessor.plugIn(
|
|
973
|
+
null,
|
|
974
|
+
BuildingBlockClass.metadata.namespace,
|
|
975
|
+
BuildingBlockClass.metadata.xmlTag || BuildingBlockClass.metadata.name
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
if (BuildingBlockClass.metadata.publicNamespace !== undefined) {
|
|
979
|
+
XMLPreprocessor.plugIn(
|
|
980
|
+
null,
|
|
981
|
+
BuildingBlockClass.metadata.publicNamespace,
|
|
982
|
+
BuildingBlockClass.metadata.xmlTag || BuildingBlockClass.metadata.name
|
|
1096
983
|
);
|
|
1097
984
|
}
|
|
1098
985
|
}
|
|
@@ -1111,26 +998,67 @@ function createErrorXML(errorMessages: string[], xmlFragment: string, additional
|
|
|
1111
998
|
<code:CodeEditor type="json" value="${`{= BBF.base64Decode('${btoa(JSON.stringify(additionalData, null, 4))}') }`}" height="300px" />
|
|
1112
999
|
</m:VBox>`;
|
|
1113
1000
|
}
|
|
1114
|
-
return xml`<
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1001
|
+
return xml`<controls:FormElementWrapper xmlns:controls="sap.fe.core.controls">
|
|
1002
|
+
<m:VBox xmlns:m="sap.m" xmlns:code="sap.ui.codeeditor" core:require="{BBF:'sap/fe/core/buildingBlocks/BuildingBlockFormatter'}">
|
|
1003
|
+
${errorLabels}
|
|
1004
|
+
${errorStack}
|
|
1005
|
+
<grid:CSSGrid gridTemplateRows="fr" gridTemplateColumns="repeat(2,1fr)" gridGap="1rem" xmlns:grid="sap.ui.layout.cssgrid" >
|
|
1006
|
+
<m:VBox>
|
|
1007
|
+
<m:Label text="How the building block was called"/>
|
|
1008
|
+
<code:CodeEditor type="xml" value="${`{= BBF.base64Decode('${btoa(xmlFragment.replaceAll(">", ">"))}') }`}" height="300px" />
|
|
1009
|
+
</m:VBox>
|
|
1010
|
+
${additionalText}
|
|
1011
|
+
</grid:CSSGrid>
|
|
1121
1012
|
</m:VBox>
|
|
1122
|
-
|
|
1123
|
-
</grid:CSSGrid>
|
|
1124
|
-
</m:VBox>`;
|
|
1013
|
+
</controls:FormElementWrapper>`;
|
|
1125
1014
|
}
|
|
1126
1015
|
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1016
|
+
const temporaryObjectStore: Record<string, unknown> = {};
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Stores an object value in a temporary storage and returns an ID used to retrieve this value at a later point in time.
|
|
1020
|
+
*
|
|
1021
|
+
* Required as there is functionality like the xml` function, which might take objects as parameters but needs to return a serialized string.
|
|
1022
|
+
*
|
|
1023
|
+
* @param value Value to store
|
|
1024
|
+
* @returns ID to retrieve this value
|
|
1025
|
+
*/
|
|
1026
|
+
function storeObjectValue(value: unknown) {
|
|
1129
1027
|
const propertyUID = `/uid--${uid()}`;
|
|
1130
|
-
|
|
1028
|
+
temporaryObjectStore[propertyUID] = value;
|
|
1131
1029
|
return propertyUID;
|
|
1132
1030
|
}
|
|
1133
1031
|
|
|
1032
|
+
/**
|
|
1033
|
+
* Unstores an object from a temporary store by removing it and returning its object value.
|
|
1034
|
+
*
|
|
1035
|
+
* @param propertyUID ID to retrieve this value
|
|
1036
|
+
* @returns Object value
|
|
1037
|
+
*/
|
|
1038
|
+
function unstoreObjectValue(propertyUID: string) {
|
|
1039
|
+
const value = temporaryObjectStore[propertyUID];
|
|
1040
|
+
delete temporaryObjectStore[propertyUID];
|
|
1041
|
+
return value;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
let processNextXmlInTrace = false;
|
|
1045
|
+
/**
|
|
1046
|
+
* Makes sure that all xml` calls inside the given method are processed in trace mode.
|
|
1047
|
+
*
|
|
1048
|
+
* @param method The method to execute
|
|
1049
|
+
* @returns The return value of the given method
|
|
1050
|
+
*/
|
|
1051
|
+
const processXmlInTrace = function (method: Function) {
|
|
1052
|
+
processNextXmlInTrace = true;
|
|
1053
|
+
let returnValue;
|
|
1054
|
+
try {
|
|
1055
|
+
returnValue = method();
|
|
1056
|
+
} finally {
|
|
1057
|
+
processNextXmlInTrace = false;
|
|
1058
|
+
}
|
|
1059
|
+
return returnValue;
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1134
1062
|
/**
|
|
1135
1063
|
* Parse an XML string and return the associated document.
|
|
1136
1064
|
*
|
|
@@ -1221,7 +1149,7 @@ export const xml = (strings: TemplateStringsArray, ...values: XMLProcessorTypeVa
|
|
|
1221
1149
|
if (isContext(value)) {
|
|
1222
1150
|
outStr += value.getPath();
|
|
1223
1151
|
} else {
|
|
1224
|
-
const propertyUId =
|
|
1152
|
+
const propertyUId = storeObjectValue(value);
|
|
1225
1153
|
outStr += `${propertyUId}`;
|
|
1226
1154
|
}
|
|
1227
1155
|
} else if (value && typeof value === "string" && !value.startsWith("<") && !value.startsWith("<")) {
|
|
@@ -1232,7 +1160,7 @@ export const xml = (strings: TemplateStringsArray, ...values: XMLProcessorTypeVa
|
|
|
1232
1160
|
}
|
|
1233
1161
|
outStr += strings[i];
|
|
1234
1162
|
outStr = outStr.trim();
|
|
1235
|
-
if (
|
|
1163
|
+
if (processNextXmlInTrace) {
|
|
1236
1164
|
return renderInTraceMode(outStr);
|
|
1237
1165
|
}
|
|
1238
1166
|
return outStr;
|