@sapui5/sap.fe.core 1.111.0 → 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} +279 -335
- 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 -932
- 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,47 +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";
|
|
32
|
+
const XMLTEMPLATING_NS = "http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1";
|
|
36
33
|
const DOMParserInstance = new DOMParser();
|
|
37
|
-
let isTraceMode = false;
|
|
38
34
|
|
|
39
|
-
export type
|
|
40
|
-
properties: Record<string, BuildingBlockPropertyDefinition>;
|
|
41
|
-
aggregations: Record<string, BuildingBlockAggregationDefinition>;
|
|
35
|
+
export type TransformedBuildingBlockMetadata = BuildingBlockMetadata & {
|
|
42
36
|
metadataContexts: Record<string, BuildingBlockMetadataContextDefinition>;
|
|
43
|
-
isOpen: boolean;
|
|
44
|
-
defaultAggregation?: string;
|
|
45
37
|
};
|
|
46
38
|
|
|
47
39
|
/**
|
|
@@ -61,7 +53,7 @@ export type TemplateProcessorSettings = {
|
|
|
61
53
|
converterContext: JSONModel;
|
|
62
54
|
viewData: JSONModel;
|
|
63
55
|
metaModel: ODataMetaModel;
|
|
64
|
-
"sap.fe.i18n"?:
|
|
56
|
+
"sap.fe.i18n"?: ResourceModel;
|
|
65
57
|
};
|
|
66
58
|
bindingContexts: Record<string, Context>;
|
|
67
59
|
_macroInfo?: MacroInfo;
|
|
@@ -77,9 +69,9 @@ export type IVisitorCallback = {
|
|
|
77
69
|
* and {@link sap.ui.core.util.XMLPreprocessor.ICallback.visitChildNodes
|
|
78
70
|
* visitChildNodes}.
|
|
79
71
|
*
|
|
80
|
-
* @param
|
|
72
|
+
* @param oNode
|
|
81
73
|
* The XML DOM node
|
|
82
|
-
* @returns
|
|
74
|
+
* @returns
|
|
83
75
|
* A thenable which resolves with <code>undefined</code> as soon as visiting
|
|
84
76
|
* is done, or is rejected with a corresponding error if visiting fails
|
|
85
77
|
*/
|
|
@@ -92,13 +84,13 @@ export type IVisitorCallback = {
|
|
|
92
84
|
* put into place. Loading of fragments is asynchronous if the template view is
|
|
93
85
|
* asynchronous.
|
|
94
86
|
*
|
|
95
|
-
* @param
|
|
87
|
+
* @param sFragment
|
|
96
88
|
* the fragment's resolved name
|
|
97
|
-
* @param
|
|
89
|
+
* @param oElement
|
|
98
90
|
* the XML DOM element, e.g. <sap.ui.core:Fragment> or <core:ExtensionPoint>
|
|
99
|
-
* @param
|
|
91
|
+
* @param oWith
|
|
100
92
|
* the parent's "with" control
|
|
101
|
-
* @returns
|
|
93
|
+
* @returns
|
|
102
94
|
* A sync promise which resolves with <code>undefined</code> as soon as the fragment
|
|
103
95
|
* has been inserted, or is rejected with a corresponding error if loading or visiting
|
|
104
96
|
* fails.
|
|
@@ -112,12 +104,12 @@ export type IVisitorCallback = {
|
|
|
112
104
|
* Interprets the given XML DOM attribute value as a binding and returns the
|
|
113
105
|
* resulting value.
|
|
114
106
|
*
|
|
115
|
-
* @param
|
|
107
|
+
* @param sValue
|
|
116
108
|
* An XML DOM attribute value
|
|
117
|
-
* @param
|
|
109
|
+
* @param [element]
|
|
118
110
|
* The XML DOM element the attribute value belongs to (needed only for
|
|
119
111
|
* warnings which are logged to the console)
|
|
120
|
-
* @returns
|
|
112
|
+
* @returns
|
|
121
113
|
* A thenable which resolves with the resulting value, or is rejected with a
|
|
122
114
|
* corresponding error (for example, an error thrown by a formatter) or
|
|
123
115
|
* <code>null</code> in case the binding is not ready (because it refers to a
|
|
@@ -133,12 +125,12 @@ export type IVisitorCallback = {
|
|
|
133
125
|
* XML template in the usual way, that is, with a binding expression like
|
|
134
126
|
* <code>"{var>some/relative/path}"</code> (see example).
|
|
135
127
|
*
|
|
136
|
-
* @param
|
|
137
|
-
* Map from variable name (string) to value
|
|
138
|
-
* @param
|
|
128
|
+
* @param [mVariables={}]
|
|
129
|
+
* Map from variable name (string) to value
|
|
130
|
+
* @param [bReplace]
|
|
139
131
|
* Whether only the given variables are known in the new callback interface
|
|
140
132
|
* instance, no inherited ones
|
|
141
|
-
* @returns
|
|
133
|
+
* @returns
|
|
142
134
|
* A callback interface instance
|
|
143
135
|
* @param mVariables
|
|
144
136
|
* @param bReplace
|
|
@@ -146,16 +138,6 @@ export type IVisitorCallback = {
|
|
|
146
138
|
"with"(mVariables?: Record<string, Context>, bReplace?: boolean): IVisitorCallback;
|
|
147
139
|
};
|
|
148
140
|
|
|
149
|
-
/**
|
|
150
|
-
* Typeguard for checking if a building block uses API 1.
|
|
151
|
-
*
|
|
152
|
-
* @param buildingBlockDefinition
|
|
153
|
-
* @returns `true` if the building block is using API 1.
|
|
154
|
-
*/
|
|
155
|
-
function isV1MacroDef(buildingBlockDefinition: BuildingBlockDefinition): buildingBlockDefinition is BuildingBlockDefinitionV1 {
|
|
156
|
-
return buildingBlockDefinition.apiVersion === undefined || buildingBlockDefinition.apiVersion === 1;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
141
|
function validateMacroMetadataContext(
|
|
160
142
|
sName: string,
|
|
161
143
|
mContexts: Record<string, Context>,
|
|
@@ -196,7 +178,7 @@ function validateMacroMetadataContext(
|
|
|
196
178
|
}
|
|
197
179
|
export function validateMacroSignature(
|
|
198
180
|
sName: string,
|
|
199
|
-
oMetadata:
|
|
181
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
200
182
|
mContexts: Record<string, Context>,
|
|
201
183
|
oNode: Element
|
|
202
184
|
) {
|
|
@@ -243,78 +225,46 @@ const SAP_UI_CORE_ELEMENT = "sap.ui.core.Element";
|
|
|
243
225
|
export const SAP_UI_MODEL_CONTEXT = "sap.ui.model.Context";
|
|
244
226
|
|
|
245
227
|
/**
|
|
246
|
-
*
|
|
228
|
+
* Transforms the metadata of a building block by adding additional aggregations,
|
|
229
|
+
* and splitting properties into actual properties and metadata contexts.
|
|
247
230
|
*
|
|
248
231
|
* @param buildingBlockMetadata The metadata received from the input
|
|
249
|
-
* @
|
|
250
|
-
* @param apiVersion
|
|
251
|
-
* @returns A set of completed metadata for further processing
|
|
232
|
+
* @returns The transformed metadata
|
|
252
233
|
*/
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
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> = {};
|
|
268
248
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
249
|
+
for (const propertyName of Object.keys(buildingBlockMetadata.properties)) {
|
|
250
|
+
const propertyType = buildingBlockMetadata.properties[propertyName].type;
|
|
272
251
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
Object.keys(buildingBlockMetadata.properties).forEach(function (sPropertyName: string) {
|
|
276
|
-
if (buildingBlockMetadata.properties[sPropertyName].type !== SAP_UI_MODEL_CONTEXT) {
|
|
277
|
-
oProperties[sPropertyName] = buildingBlockMetadata.properties[sPropertyName];
|
|
278
|
-
} else {
|
|
279
|
-
oMetadataContexts[sPropertyName] = buildingBlockMetadata.properties[sPropertyName];
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
// Merge events into properties as they are handled identically
|
|
283
|
-
if (buildingBlockMetadata.events !== undefined) {
|
|
284
|
-
Object.keys(buildingBlockMetadata.events).forEach(function (sEventName: string) {
|
|
285
|
-
oProperties[sEventName] = { type: "function", ...buildingBlockMetadata.events[sEventName] };
|
|
286
|
-
});
|
|
252
|
+
if (propertyType !== SAP_UI_MODEL_CONTEXT) {
|
|
253
|
+
properties[propertyName] = buildingBlockMetadata.properties[propertyName];
|
|
287
254
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
foundDefaultAggregation = sPropertyName;
|
|
293
|
-
}
|
|
294
|
-
});
|
|
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];
|
|
295
259
|
}
|
|
296
|
-
return {
|
|
297
|
-
properties: oProperties,
|
|
298
|
-
aggregations: oAggregations,
|
|
299
|
-
defaultAggregation: foundDefaultAggregation,
|
|
300
|
-
metadataContexts: oMetadataContexts,
|
|
301
|
-
isOpen: isOpen
|
|
302
|
-
};
|
|
303
|
-
} else {
|
|
304
|
-
return {
|
|
305
|
-
metadataContexts: {},
|
|
306
|
-
aggregations: {
|
|
307
|
-
dependents: {
|
|
308
|
-
type: SAP_UI_CORE_ELEMENT
|
|
309
|
-
},
|
|
310
|
-
customData: {
|
|
311
|
-
type: SAP_UI_CORE_ELEMENT
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
properties: {},
|
|
315
|
-
isOpen: isOpen
|
|
316
|
-
};
|
|
317
260
|
}
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
...buildingBlockMetadata,
|
|
264
|
+
properties,
|
|
265
|
+
metadataContexts,
|
|
266
|
+
aggregations
|
|
267
|
+
};
|
|
318
268
|
}
|
|
319
269
|
|
|
320
270
|
/**
|
|
@@ -356,14 +306,13 @@ function _createInitialMetadataContext(
|
|
|
356
306
|
sAttributeValue: string
|
|
357
307
|
): MetaDataContext {
|
|
358
308
|
let returnContext: MetaDataContext;
|
|
359
|
-
if (sAttributeValue.startsWith("/uid--")) {
|
|
360
|
-
const
|
|
361
|
-
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);
|
|
362
312
|
returnContext = {
|
|
363
313
|
model: "converterContext",
|
|
364
314
|
path: sAttributeValue
|
|
365
315
|
};
|
|
366
|
-
delete myStore[sAttributeValue];
|
|
367
316
|
} else if ((sAttributeName === "metaPath" && oSettings.currentContextPath) || sAttributeName === "contextPath") {
|
|
368
317
|
returnContext = _checkAbsoluteAndContextPaths(oSettings, sAttributeValue);
|
|
369
318
|
} else if (sAttributeValue && sAttributeValue.startsWith("/")) {
|
|
@@ -423,14 +372,12 @@ function _getMetadataContext(
|
|
|
423
372
|
* @param oNode The XML node to parse
|
|
424
373
|
* @param isPublic Whether the building block is used in a public context or not
|
|
425
374
|
* @param oVisitor The visitor instance
|
|
426
|
-
* @param apiVersion The API version of the building block
|
|
427
375
|
*/
|
|
428
376
|
async function processProperties(
|
|
429
|
-
oMetadata:
|
|
377
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
430
378
|
oNode: Element,
|
|
431
379
|
isPublic: boolean,
|
|
432
|
-
oVisitor: IVisitorCallback
|
|
433
|
-
apiVersion?: number
|
|
380
|
+
oVisitor: IVisitorCallback
|
|
434
381
|
) {
|
|
435
382
|
const oDefinitionProperties = oMetadata.properties;
|
|
436
383
|
|
|
@@ -440,7 +387,8 @@ async function processProperties(
|
|
|
440
387
|
const propertyValues: Record<string, ObjectValue> = {};
|
|
441
388
|
for (const sKeyValue of aDefinitionPropertiesKeys) {
|
|
442
389
|
if (oDefinitionProperties[sKeyValue].type === "object") {
|
|
443
|
-
propertyValues[sKeyValue] =
|
|
390
|
+
propertyValues[sKeyValue] =
|
|
391
|
+
oDefinitionProperties[sKeyValue].defaultValue && deepClone(oDefinitionProperties[sKeyValue].defaultValue); // To avoid values being reused across macros
|
|
444
392
|
} else {
|
|
445
393
|
propertyValues[sKeyValue] = oDefinitionProperties[sKeyValue].defaultValue as string | boolean | number;
|
|
446
394
|
}
|
|
@@ -451,7 +399,7 @@ async function processProperties(
|
|
|
451
399
|
await oVisitor.visitAttribute(oNode, oNode.attributes.getNamedItem(sKeyValue) as Attr);
|
|
452
400
|
let value: string | boolean | number | null | undefined = oNode.getAttribute(sKeyValue);
|
|
453
401
|
if (value !== undefined && value !== null) {
|
|
454
|
-
if (
|
|
402
|
+
if (typeof value === "string" && !value.startsWith("{")) {
|
|
455
403
|
switch (oDefinitionProperties[sKeyValue].type) {
|
|
456
404
|
case "boolean":
|
|
457
405
|
value = value === "true";
|
|
@@ -478,21 +426,20 @@ async function processProperties(
|
|
|
478
426
|
* @param isPublic Whether the building block is used in a public context or not
|
|
479
427
|
* @param oVisitor The visitor instance
|
|
480
428
|
* @param mContexts The contexts to be used
|
|
481
|
-
* @param
|
|
429
|
+
* @param propertyValues The current property values
|
|
482
430
|
* @returns The processed and missing contexts
|
|
483
431
|
*/
|
|
484
432
|
function processContexts(
|
|
485
|
-
oMetadata:
|
|
433
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
486
434
|
oSettings: TemplateProcessorSettings,
|
|
487
435
|
oNode: Element,
|
|
488
436
|
isPublic: boolean,
|
|
489
437
|
oVisitor: IVisitorCallback,
|
|
490
438
|
mContexts: Record<string, Context>,
|
|
491
|
-
|
|
439
|
+
propertyValues: Record<string, ObjectValue>
|
|
492
440
|
) {
|
|
493
441
|
oSettings.currentContextPath = oSettings.bindingContexts.contextPath;
|
|
494
442
|
const mMissingContext: Record<string, boolean> = {};
|
|
495
|
-
const propertyValues: Record<string, unknown> = {};
|
|
496
443
|
const oDefinitionContexts = oMetadata.metadataContexts;
|
|
497
444
|
const aDefinitionContextsKeys = Object.keys(oDefinitionContexts);
|
|
498
445
|
// Since the metaPath and other property can be relative to the contextPath we need to evaluate the current contextPath first
|
|
@@ -503,11 +450,17 @@ function processContexts(
|
|
|
503
450
|
aDefinitionContextsKeys.splice(0, 0, contextPathDefinition[0]);
|
|
504
451
|
}
|
|
505
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
|
+
}
|
|
506
459
|
const bDoNotResolve = isPublic && oDefinitionContexts[sAttributeName].isPublic === false && oNode.hasAttribute(sAttributeName);
|
|
507
|
-
const oMetadataContext = _getMetadataContext(oSettings, oNode, sAttributeName, oVisitor, bDoNotResolve, oMetadata.isOpen);
|
|
460
|
+
const oMetadataContext = _getMetadataContext(oSettings, oNode, sAttributeName, oVisitor, bDoNotResolve, oMetadata.isOpen ?? false);
|
|
508
461
|
if (oMetadataContext) {
|
|
509
462
|
oMetadataContext.name = sAttributeName;
|
|
510
|
-
addSingleContext(mContexts, oVisitor, oMetadataContext
|
|
463
|
+
addSingleContext(mContexts, oVisitor, oMetadataContext);
|
|
511
464
|
if (
|
|
512
465
|
(sAttributeName === "entitySet" || sAttributeName === "contextPath") &&
|
|
513
466
|
!oSettings.bindingContexts.hasOwnProperty(sAttributeName)
|
|
@@ -517,12 +470,17 @@ function processContexts(
|
|
|
517
470
|
if (sAttributeName === "contextPath") {
|
|
518
471
|
oSettings.currentContextPath = mContexts[sAttributeName];
|
|
519
472
|
}
|
|
520
|
-
|
|
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
|
+
}
|
|
521
479
|
} else {
|
|
522
480
|
mMissingContext[sAttributeName] = true;
|
|
523
481
|
}
|
|
524
482
|
}
|
|
525
|
-
return
|
|
483
|
+
return mMissingContext;
|
|
526
484
|
}
|
|
527
485
|
|
|
528
486
|
export type BuildingBlockAggregation = {
|
|
@@ -552,6 +510,8 @@ function parseAggregation(oAggregation?: Element, processAggregations?: Function
|
|
|
552
510
|
aggregationObject = processAggregations(childDefinition, aggregationObject);
|
|
553
511
|
}
|
|
554
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`);
|
|
555
515
|
}
|
|
556
516
|
}
|
|
557
517
|
}
|
|
@@ -566,21 +526,31 @@ function parseAggregation(oAggregation?: Element, processAggregations?: Function
|
|
|
566
526
|
* @param oMetadata The metadata for the building block
|
|
567
527
|
* @param isPublic Whether the building block is used in a public context or not
|
|
568
528
|
* @param propertyValues The values of already parsed property
|
|
569
|
-
* @param apiVersion The API version of the building block
|
|
570
529
|
*/
|
|
571
530
|
async function processChildren(
|
|
572
531
|
oNode: Element,
|
|
573
532
|
oVisitor: IVisitorCallback,
|
|
574
|
-
oMetadata:
|
|
533
|
+
oMetadata: TransformedBuildingBlockMetadata,
|
|
575
534
|
isPublic: boolean,
|
|
576
|
-
propertyValues: Record<string, ObjectValue
|
|
577
|
-
apiVersion?: number
|
|
535
|
+
propertyValues: Record<string, ObjectValue>
|
|
578
536
|
) {
|
|
579
537
|
const oAggregations: Record<string, Element> = {};
|
|
580
538
|
if (oNode.firstElementChild !== null) {
|
|
581
539
|
let oFirstElementChild: Element | null = oNode.firstElementChild as Element | null;
|
|
582
|
-
|
|
583
|
-
|
|
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;
|
|
549
|
+
} else {
|
|
550
|
+
// Not sure how this could happen but I also don't want to create infinite loops
|
|
551
|
+
oFirstElementChild = oFirstElementChild.nextElementSibling;
|
|
552
|
+
}
|
|
553
|
+
} else {
|
|
584
554
|
const sChildName = oFirstElementChild.localName;
|
|
585
555
|
let sAggregationName = sChildName;
|
|
586
556
|
if (sAggregationName[0].toUpperCase() === sAggregationName[0]) {
|
|
@@ -599,10 +569,6 @@ async function processChildren(
|
|
|
599
569
|
}
|
|
600
570
|
}
|
|
601
571
|
|
|
602
|
-
if (apiVersion !== 2) {
|
|
603
|
-
// If there are aggregation we need to visit the childNodes to resolve templating instructions
|
|
604
|
-
await oVisitor.visitChildNodes(oNode);
|
|
605
|
-
}
|
|
606
572
|
oFirstElementChild = oNode.firstElementChild;
|
|
607
573
|
while (oFirstElementChild !== null) {
|
|
608
574
|
const oNextChild: Element | null = oFirstElementChild.nextElementSibling;
|
|
@@ -616,38 +582,34 @@ async function processChildren(
|
|
|
616
582
|
Object.keys(oMetadata.aggregations).indexOf(sAggregationName) !== -1 &&
|
|
617
583
|
(!isPublic || oMetadata.aggregations[sAggregationName].isPublic === true)
|
|
618
584
|
) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
oAggregations[childDefinition.getAttribute("key")!] = childWrapper;
|
|
630
|
-
} else {
|
|
631
|
-
oAggregations[childDefinition.getAttribute("key")!] = childDefinition;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
childDefinition.removeAttribute("key");
|
|
635
|
-
childDefinition = nextChild;
|
|
636
|
-
}
|
|
637
|
-
} else if (aggregationDefinition.slot) {
|
|
638
|
-
if (sAggregationName !== sChildName) {
|
|
639
|
-
if (!oAggregations[sAggregationName]) {
|
|
640
|
-
const oNewChild = document.createElementNS(oNode.namespaceURI, sAggregationName);
|
|
641
|
-
oAggregations[sAggregationName] = oNewChild;
|
|
642
|
-
}
|
|
643
|
-
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;
|
|
644
595
|
} else {
|
|
645
|
-
oAggregations[
|
|
596
|
+
oAggregations[childDefinition.getAttribute("key")!] = childDefinition;
|
|
646
597
|
}
|
|
598
|
+
|
|
599
|
+
childDefinition.removeAttribute("key");
|
|
600
|
+
childDefinition = nextChild;
|
|
647
601
|
}
|
|
648
|
-
} else {
|
|
602
|
+
} else if (aggregationDefinition.slot) {
|
|
649
603
|
await oVisitor.visitNode(oFirstElementChild);
|
|
650
|
-
|
|
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
|
+
}
|
|
651
613
|
}
|
|
652
614
|
} else if (Object.keys(oMetadata.properties).indexOf(sAggregationName) !== -1) {
|
|
653
615
|
await oVisitor.visitNode(oFirstElementChild);
|
|
@@ -738,31 +700,20 @@ function prepareAggregationElement(oNode: Element, sAggregationName: string, oEl
|
|
|
738
700
|
}
|
|
739
701
|
|
|
740
702
|
async function processBuildingBlock(
|
|
741
|
-
|
|
703
|
+
BuildingBlockClass: typeof BuildingBlockBase,
|
|
742
704
|
oNode: Element,
|
|
743
705
|
oVisitor: IVisitorCallback,
|
|
744
706
|
isPublic = false
|
|
745
707
|
) {
|
|
746
|
-
const
|
|
747
|
-
buildingBlockDefinition.fragment ||
|
|
748
|
-
`${buildingBlockDefinition.namespace}.${buildingBlockDefinition.xmlTag || buildingBlockDefinition.name}`;
|
|
708
|
+
const oMetadata = transformMetadata(BuildingBlockClass.metadata);
|
|
749
709
|
|
|
750
|
-
const
|
|
710
|
+
const sFragmentName = oMetadata.fragment || `${oMetadata.namespace}.${oMetadata.xmlTag || oMetadata.name}`;
|
|
751
711
|
|
|
752
712
|
const mContexts: Record<string, Context> = {};
|
|
753
|
-
const oMetadataContexts: Record<string, Context> = {};
|
|
754
713
|
const oSettings = oVisitor.getSettings();
|
|
755
|
-
|
|
756
|
-
if
|
|
757
|
-
|
|
758
|
-
.then(function (oResourceBundle: ResourceBundle) {
|
|
759
|
-
ResourceModel.setApplicationI18nBundle(oResourceBundle);
|
|
760
|
-
})
|
|
761
|
-
.catch(function (error: unknown) {
|
|
762
|
-
Log.error(error as string);
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
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();
|
|
766
717
|
|
|
767
718
|
//Inject storage for macros
|
|
768
719
|
if (!oSettings[sFragmentName]) {
|
|
@@ -770,30 +721,13 @@ async function processBuildingBlock(
|
|
|
770
721
|
}
|
|
771
722
|
|
|
772
723
|
// First of all we need to visit the attributes to resolve the properties and the metadata contexts
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
const { mMissingContext, propertyValues: extraPropertyValues } = processContexts(
|
|
776
|
-
oMetadata,
|
|
777
|
-
oSettings,
|
|
778
|
-
oNode,
|
|
779
|
-
isPublic,
|
|
780
|
-
oVisitor,
|
|
781
|
-
mContexts,
|
|
782
|
-
oMetadataContexts
|
|
783
|
-
);
|
|
784
|
-
propertyValues = Object.assign(propertyValues, extraPropertyValues);
|
|
724
|
+
const propertyValues = await processProperties(oMetadata, oNode, isPublic, oVisitor);
|
|
785
725
|
const initialKeys = Object.keys(propertyValues);
|
|
726
|
+
const mMissingContext = processContexts(oMetadata, oSettings, oNode, isPublic, oVisitor, mContexts, propertyValues);
|
|
727
|
+
|
|
786
728
|
try {
|
|
787
729
|
// Aggregation and complex type support
|
|
788
|
-
const oAggregations = await processChildren(
|
|
789
|
-
oNode,
|
|
790
|
-
oVisitor,
|
|
791
|
-
oMetadata,
|
|
792
|
-
isPublic,
|
|
793
|
-
propertyValues,
|
|
794
|
-
buildingBlockDefinition.apiVersion
|
|
795
|
-
);
|
|
796
|
-
let oInstance: BuildingBlockBase | undefined;
|
|
730
|
+
const oAggregations = await processChildren(oNode, oVisitor, oMetadata, isPublic, propertyValues);
|
|
797
731
|
let oControlConfig = {};
|
|
798
732
|
|
|
799
733
|
if (oSettings.models.viewData) {
|
|
@@ -801,64 +735,39 @@ async function processBuildingBlock(
|
|
|
801
735
|
oControlConfig = oSettings.models.viewData.getProperty("/controlConfiguration");
|
|
802
736
|
}
|
|
803
737
|
let processedPropertyValues = propertyValues;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
)
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
if (oData?.isA?.(SAP_UI_MODEL_CONTEXT) && !oData.getModel().isA("sap.ui.model.odata.v4.ODataMetaModel")) {
|
|
832
|
-
propertyValues[propName] = oData.getObject();
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
const BuildingBlockClass = buildingBlockDefinition as typeof BuildingBlockBase;
|
|
836
|
-
propertyValues.isPublic = isPublic;
|
|
837
|
-
|
|
838
|
-
oInstance = new BuildingBlockClass(
|
|
839
|
-
{ ...propertyValues, ...oAggregations },
|
|
840
|
-
oControlConfig,
|
|
841
|
-
oSettings
|
|
842
|
-
/*, oControlConfig, oSettings, oAggregations, isPublic*/
|
|
843
|
-
);
|
|
844
|
-
processedPropertyValues = oInstance.getProperties();
|
|
845
|
-
Object.keys(oMetadata.metadataContexts).forEach(function (sContextName: string) {
|
|
846
|
-
if (processedPropertyValues.hasOwnProperty(sContextName)) {
|
|
847
|
-
const targetObject = processedPropertyValues[sContextName];
|
|
848
|
-
if (typeof targetObject === "object" && !isContext(targetObject)) {
|
|
849
|
-
const sAttributeValue = storeValue(targetObject);
|
|
850
|
-
oSettings.models.converterContext.setProperty(sAttributeValue, targetObject);
|
|
851
|
-
const newContext = oSettings.models.converterContext.createBindingContext(sAttributeValue)!;
|
|
852
|
-
delete myStore[sAttributeValue];
|
|
853
|
-
mContexts[sContextName] = newContext;
|
|
854
|
-
} else if (!mContexts.hasOwnProperty(sContextName) && targetObject !== undefined) {
|
|
855
|
-
mContexts[sContextName] = targetObject as Context;
|
|
856
|
-
}
|
|
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;
|
|
857
765
|
}
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
const oAttributesModel: JSONModel = new AttributeModel(oNode, processedPropertyValues, BuildingBlockClass);
|
|
770
|
+
mContexts["this"] = oAttributesModel.createBindingContext("/");
|
|
862
771
|
let oPreviousMacroInfo: MacroInfo | undefined;
|
|
863
772
|
|
|
864
773
|
// Keep track
|
|
@@ -871,42 +780,31 @@ async function processBuildingBlock(
|
|
|
871
780
|
}
|
|
872
781
|
validateMacroSignature(sFragmentName, oMetadata, mContexts, oNode);
|
|
873
782
|
|
|
874
|
-
const oContextVisitor = oVisitor.with(
|
|
875
|
-
mContexts,
|
|
876
|
-
buildingBlockDefinition.isOpen !== undefined ? !buildingBlockDefinition.isOpen : true
|
|
877
|
-
);
|
|
783
|
+
const oContextVisitor = oVisitor.with(mContexts, oMetadata.isOpen !== undefined ? !oMetadata.isOpen : true);
|
|
878
784
|
const oParent = oNode.parentNode;
|
|
879
785
|
|
|
880
786
|
let iChildIndex: number;
|
|
881
787
|
let oPromise;
|
|
882
|
-
let processCustomData = true;
|
|
883
788
|
if (oParent) {
|
|
884
789
|
iChildIndex = Array.from(oParent.children).indexOf(oNode);
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
if (
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
const oData = myStore[myStoreKey];
|
|
897
|
-
oSettings.models.converterContext.setProperty(myStoreKey, oData);
|
|
898
|
-
delete myStore[myStoreKey];
|
|
899
|
-
}
|
|
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);
|
|
900
801
|
}
|
|
901
|
-
addDefaultNamespace = true;
|
|
902
|
-
} else if (buildingBlockDefinition.getTemplate) {
|
|
903
|
-
templateString = await buildingBlockDefinition.getTemplate(processedPropertyValues);
|
|
904
802
|
}
|
|
905
803
|
|
|
906
804
|
let hasError = "";
|
|
907
805
|
if (templateString) {
|
|
908
806
|
let hasParseError = false;
|
|
909
|
-
let parsedTemplate = parseXMLString(templateString,
|
|
807
|
+
let parsedTemplate = parseXMLString(templateString, true);
|
|
910
808
|
// For safety purpose we try to detect trailing text in between XML Tags
|
|
911
809
|
for (const element of parsedTemplate) {
|
|
912
810
|
const iter = document.createNodeIterator(element, NodeFilter.SHOW_TEXT);
|
|
@@ -926,26 +824,17 @@ async function processBuildingBlock(
|
|
|
926
824
|
// If there is a parseerror while processing the XML it means the XML itself is malformed, as such we rerun the template process
|
|
927
825
|
// Setting isTraceMode true will make it so that each xml` expression is checked for validity from XML perspective
|
|
928
826
|
// If an error is found it's returned instead of the normal fragment
|
|
929
|
-
Log.error(
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
const initialTemplate = oInstance?.getTemplate
|
|
935
|
-
? await oInstance.getTemplate(oNode)
|
|
936
|
-
: await buildingBlockDefinition.getTemplate!(processedPropertyValues);
|
|
937
|
-
parsedTemplate = parseXMLString(initialTemplate, true);
|
|
938
|
-
} finally {
|
|
939
|
-
isTraceMode = false;
|
|
940
|
-
}
|
|
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
|
+
});
|
|
941
832
|
} else if (hasError.length > 0) {
|
|
942
833
|
// If there is trailing text we create a standard error and display it.
|
|
943
|
-
Log.error(
|
|
944
|
-
`Error while processing building block ${buildingBlockDefinition.xmlTag || buildingBlockDefinition.name}`
|
|
945
|
-
);
|
|
834
|
+
Log.error(`Error while processing building block ${oMetadata.xmlTag || oMetadata.name}`);
|
|
946
835
|
const oErrorText = createErrorXML(
|
|
947
836
|
[
|
|
948
|
-
`Error while processing building block ${
|
|
837
|
+
`Error while processing building block ${oMetadata.xmlTag || oMetadata.name}`,
|
|
949
838
|
`Trailing text was found in the XML: ${hasError}`
|
|
950
839
|
],
|
|
951
840
|
parsedTemplate.map((template) => template.outerHTML).join("\n")
|
|
@@ -954,20 +843,18 @@ async function processBuildingBlock(
|
|
|
954
843
|
}
|
|
955
844
|
oNode.replaceWith(...parsedTemplate);
|
|
956
845
|
oNode = oParent.children[iChildIndex];
|
|
957
|
-
processSlots(oAggregations, oMetadata.aggregations, oNode,
|
|
958
|
-
|
|
846
|
+
processSlots(oAggregations, oMetadata.aggregations, oNode, false);
|
|
847
|
+
|
|
959
848
|
oPromise = oContextVisitor.visitNode(oNode);
|
|
960
849
|
} else {
|
|
961
850
|
oNode.remove();
|
|
962
851
|
oPromise = Promise.resolve();
|
|
963
852
|
}
|
|
964
|
-
} else {
|
|
965
|
-
oPromise = oContextVisitor.insertFragment(sFragmentName, oNode);
|
|
966
853
|
}
|
|
967
854
|
|
|
968
855
|
await oPromise;
|
|
969
856
|
const oMacroElement = oParent.children[iChildIndex];
|
|
970
|
-
processSlots(oAggregations, oMetadata.aggregations, oMacroElement,
|
|
857
|
+
processSlots(oAggregations, oMetadata.aggregations, oMacroElement, true);
|
|
971
858
|
if (oMacroElement !== undefined) {
|
|
972
859
|
const oRemainingSlots = oMacroElement.querySelectorAll("slot");
|
|
973
860
|
oRemainingSlots.forEach(function (oSlotElement) {
|
|
@@ -1014,7 +901,7 @@ async function processBuildingBlock(
|
|
|
1014
901
|
}
|
|
1015
902
|
Log.error(e as string);
|
|
1016
903
|
const oError = createErrorXML(
|
|
1017
|
-
[`Error while processing building block ${
|
|
904
|
+
[`Error while processing building block ${oMetadata.name}`],
|
|
1018
905
|
oNode.outerHTML,
|
|
1019
906
|
traceDetails,
|
|
1020
907
|
(e as Error).stack
|
|
@@ -1030,11 +917,10 @@ function addSingleContext(
|
|
|
1030
917
|
name?: string;
|
|
1031
918
|
path: string;
|
|
1032
919
|
model?: string;
|
|
1033
|
-
}
|
|
1034
|
-
oMetadataContexts: Record<string, Context | undefined>
|
|
920
|
+
}
|
|
1035
921
|
) {
|
|
1036
922
|
const sKey = (oCtx.name || oCtx.model || undefined) as string;
|
|
1037
|
-
if (
|
|
923
|
+
if (mContexts[sKey]) {
|
|
1038
924
|
return; // do not add twice
|
|
1039
925
|
}
|
|
1040
926
|
try {
|
|
@@ -1050,33 +936,50 @@ function addSingleContext(
|
|
|
1050
936
|
} else {
|
|
1051
937
|
mContexts[sKey] = oVisitor.getContext(sContextPath); // add the context to the visitor
|
|
1052
938
|
}
|
|
1053
|
-
|
|
1054
|
-
oMetadataContexts[sKey] = mContexts[sKey]; // make it available inside metadataContexts JSON object
|
|
1055
939
|
} catch (ex) {
|
|
1056
|
-
//
|
|
1057
|
-
//
|
|
1058
|
-
// providing afterwards
|
|
1059
|
-
// TODO 0002 not yet implemented
|
|
1060
|
-
//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
|
|
1061
942
|
}
|
|
1062
943
|
}
|
|
1063
944
|
|
|
1064
945
|
/**
|
|
1065
946
|
* Register a building block definition to be used inside the xml template processor.
|
|
1066
947
|
*
|
|
1067
|
-
* @param
|
|
948
|
+
* @param BuildingBlockClass The building block definition
|
|
1068
949
|
*/
|
|
1069
|
-
export function registerBuildingBlock(
|
|
950
|
+
export function registerBuildingBlock(BuildingBlockClass: typeof BuildingBlockBase): void {
|
|
1070
951
|
XMLPreprocessor.plugIn(
|
|
1071
|
-
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(
|
|
1072
|
-
|
|
1073
|
-
|
|
952
|
+
async (oNode: Element, oVisitor: IVisitorCallback) => processBuildingBlock(BuildingBlockClass, oNode, oVisitor),
|
|
953
|
+
BuildingBlockClass.metadata.namespace,
|
|
954
|
+
BuildingBlockClass.metadata.xmlTag || BuildingBlockClass.metadata.name
|
|
1074
955
|
);
|
|
1075
|
-
if (
|
|
956
|
+
if (BuildingBlockClass.metadata.publicNamespace) {
|
|
957
|
+
XMLPreprocessor.plugIn(
|
|
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) {
|
|
1076
972
|
XMLPreprocessor.plugIn(
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
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
|
|
1080
983
|
);
|
|
1081
984
|
}
|
|
1082
985
|
}
|
|
@@ -1095,26 +998,67 @@ function createErrorXML(errorMessages: string[], xmlFragment: string, additional
|
|
|
1095
998
|
<code:CodeEditor type="json" value="${`{= BBF.base64Decode('${btoa(JSON.stringify(additionalData, null, 4))}') }`}" height="300px" />
|
|
1096
999
|
</m:VBox>`;
|
|
1097
1000
|
}
|
|
1098
|
-
return xml`<
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
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>
|
|
1105
1012
|
</m:VBox>
|
|
1106
|
-
|
|
1107
|
-
</grid:CSSGrid>
|
|
1108
|
-
</m:VBox>`;
|
|
1013
|
+
</controls:FormElementWrapper>`;
|
|
1109
1014
|
}
|
|
1110
1015
|
|
|
1111
|
-
const
|
|
1112
|
-
|
|
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) {
|
|
1113
1027
|
const propertyUID = `/uid--${uid()}`;
|
|
1114
|
-
|
|
1028
|
+
temporaryObjectStore[propertyUID] = value;
|
|
1115
1029
|
return propertyUID;
|
|
1116
1030
|
}
|
|
1117
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
|
+
|
|
1118
1062
|
/**
|
|
1119
1063
|
* Parse an XML string and return the associated document.
|
|
1120
1064
|
*
|
|
@@ -1205,7 +1149,7 @@ export const xml = (strings: TemplateStringsArray, ...values: XMLProcessorTypeVa
|
|
|
1205
1149
|
if (isContext(value)) {
|
|
1206
1150
|
outStr += value.getPath();
|
|
1207
1151
|
} else {
|
|
1208
|
-
const propertyUId =
|
|
1152
|
+
const propertyUId = storeObjectValue(value);
|
|
1209
1153
|
outStr += `${propertyUId}`;
|
|
1210
1154
|
}
|
|
1211
1155
|
} else if (value && typeof value === "string" && !value.startsWith("<") && !value.startsWith("<")) {
|
|
@@ -1216,7 +1160,7 @@ export const xml = (strings: TemplateStringsArray, ...values: XMLProcessorTypeVa
|
|
|
1216
1160
|
}
|
|
1217
1161
|
outStr += strings[i];
|
|
1218
1162
|
outStr = outStr.trim();
|
|
1219
|
-
if (
|
|
1163
|
+
if (processNextXmlInTrace) {
|
|
1220
1164
|
return renderInTraceMode(outStr);
|
|
1221
1165
|
}
|
|
1222
1166
|
return outStr;
|