@openui5/sap.ui.core 1.136.4 → 1.139.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/.eslintrc.json +3 -3
- package/README.md +1 -1
- package/REUSE.toml +8 -29
- package/THIRDPARTY.txt +72 -90
- package/package.json +2 -2
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +1 -1
- package/src/sap/base/Eventing.js +1 -1
- package/src/sap/base/config.js +1 -1
- package/src/sap/base/i18n/LanguageFallback.js +18 -2
- package/src/sap/base/i18n/LanguageTag.js +1 -1
- package/src/sap/base/i18n/Localization.js +5 -3
- package/src/sap/base/i18n/ResourceBundle.js +59 -35
- package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +3 -3
- package/src/sap/ui/base/BindingInfo.js +18 -9
- package/src/sap/ui/base/BindingParser.js +13 -6
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -8
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +37 -27
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/base/OwnStatics.js +49 -0
- package/src/sap/ui/core/.library +9 -31
- package/src/sap/ui/core/BusyIndicator.js +8 -8
- package/src/sap/ui/core/Component.js +63 -73
- package/src/sap/ui/core/ComponentContainer.js +34 -4
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +1 -1
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +2 -2
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +13 -11
- package/src/sap/ui/core/Element.js +1 -3
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/ExtensionPoint.js +4 -4
- package/src/sap/ui/core/Fragment.js +10 -6
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +39 -24
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +1 -1
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +39 -178
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/Theming.js +2 -2
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +16 -57
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +5 -1
- package/src/sap/ui/core/_IconRegistry.js +2 -0
- package/src/sap/ui/core/date/UI5Date.js +1 -1
- package/src/sap/ui/core/delegate/ItemNavigation.js +2 -2
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +12 -2
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +5 -3
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/FormatUtils.js +1 -1
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/interaction/KeyboardInteractionDisplay.js +64 -37
- package/src/sap/ui/core/library.js +3 -3
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +6 -6
- package/src/sap/ui/core/messagebundle.properties +58 -28
- package/src/sap/ui/core/messagebundle_mk.properties +3 -3
- package/src/sap/ui/core/mvc/Controller.js +5 -1
- package/src/sap/ui/core/mvc/HTMLView.js +6 -2
- package/src/sap/ui/core/mvc/JSONView.js +6 -2
- package/src/sap/ui/core/mvc/JSView.js +6 -3
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +69 -195
- package/src/sap/ui/core/mvc/XMLView.js +7 -2
- package/src/sap/ui/core/mvc/_ViewFactory.js +196 -0
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/Route.js +197 -13
- package/src/sap/ui/core/routing/Router.js +19 -8
- package/src/sap/ui/core/routing/RouterHashChanger.js +12 -3
- package/src/sap/ui/core/routing/Target.js +714 -61
- package/src/sap/ui/core/routing/TargetCache.js +205 -25
- package/src/sap/ui/core/routing/Targets.js +162 -67
- package/src/sap/ui/core/routing/Views.js +1 -0
- package/src/sap/ui/core/routing/sync/Route.js +1 -1
- package/src/sap/ui/core/routing/sync/Target.js +11 -1
- package/src/sap/ui/core/routing/sync/TargetCache.js +3 -3
- package/src/sap/ui/core/routing/sync/Targets.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -48
- package/src/sap/ui/core/service/ServiceFactory.js +44 -4
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +356 -353
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +4 -2
- package/src/sap/ui/core/themes/base/base.less +20 -20
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/themes/base/global.less +4 -0
- package/src/sap/ui/core/themes/base/skeleton.less +3 -3
- package/src/sap/ui/core/theming/ThemeHelper.js +1 -18
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +4 -4
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/XMLPreprocessor.js +8 -1
- package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +4 -4
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/webc/WebComponent.js +2 -3
- package/src/sap/ui/core/webc/WebComponentMetadata.js +2 -3
- package/src/sap/ui/core/webc/WebComponentRenderer.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientModel.js +2 -2
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/Filter.js +55 -35
- package/src/sap/ui/model/FilterOperator.js +79 -9
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -1
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +2 -1
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
- package/src/sap/ui/model/analytics/odata4analytics.js +2 -1
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +3 -3
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +2 -1
- package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +3 -3
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataModel.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +20 -17
- package/src/sap/ui/model/odata/v4/ODataBinding.js +2 -2
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +4 -4
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +34 -22
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +60 -22
- package/src/sap/ui/model/odata/v4/ODataModel.js +9 -8
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +2 -2
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataUtils.js +2 -2
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +98 -89
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +39 -7
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +32 -26
- package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +10 -4
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +44 -24
- package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +50 -19
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -4
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa.js +14 -2
- package/src/sap/ui/test/Opa5.js +61 -10
- package/src/sap/ui/test/TestUtils.js +6 -2
- package/src/sap/ui/test/generic/GenericTestCollection.js +11 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/thirdparty/datajs.js +13 -10
- package/src/sap/ui/thirdparty/jquery.js +1 -1
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader-autoconfig.js +49 -59
- package/src/ui5loader.js +1 -1
- package/src/sap/ui/core/routing/async/Route.js +0 -186
- package/src/sap/ui/core/routing/async/Target.js +0 -712
- package/src/sap/ui/core/routing/async/TargetCache.js +0 -196
- package/src/sap/ui/core/routing/async/Targets.js +0 -130
- package/src/sap/ui/thirdparty/iscroll-lite.js +0 -603
- package/src/sap/ui/thirdparty/iscroll.js +0 -1104
- package/src/sap/ui/thirdparty/mobiscroll/css/mobiscroll-core.css +0 -416
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-core.js +0 -127
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-datetime.js +0 -818
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js +0 -1264
- package/src/sap/ui/thirdparty/swipe-view.js +0 -560
|
@@ -12,11 +12,14 @@ sap.ui.define([
|
|
|
12
12
|
'sap/base/util/extend',
|
|
13
13
|
'sap/base/util/merge',
|
|
14
14
|
'sap/ui/base/ManagedObject',
|
|
15
|
+
'sap/ui/base/OwnStatics',
|
|
15
16
|
'sap/base/Log'
|
|
16
17
|
],
|
|
17
|
-
function(View, JSViewRenderer, ViewType, merge, extend, ManagedObject, Log) {
|
|
18
|
+
function(View, JSViewRenderer, ViewType, merge, extend, ManagedObject, OwnStatics, Log) {
|
|
18
19
|
"use strict";
|
|
19
20
|
|
|
21
|
+
const { runWithPreprocessors } = OwnStatics.get(ManagedObject);
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Constructor for a new <code>JSView</code>.
|
|
@@ -27,7 +30,7 @@ sap.ui.define([
|
|
|
27
30
|
* @param {object} [mSettings] initial settings for the new control
|
|
28
31
|
*
|
|
29
32
|
* @extends sap.ui.core.mvc.View
|
|
30
|
-
* @version 1.
|
|
33
|
+
* @version 1.139.0
|
|
31
34
|
* @deprecated Since 1.90. Instead use {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed Views}
|
|
32
35
|
* by defining the view class with {@link sap.ui.core.mvc.View.extend View.extend} and
|
|
33
36
|
* creating the view instances with {@link sap.ui.core.mvc.View.create View.create}.
|
|
@@ -243,7 +246,7 @@ sap.ui.define([
|
|
|
243
246
|
|
|
244
247
|
JSView.prototype.onControllerConnected = function(oController) {
|
|
245
248
|
// temporarily replace any preprocessors, e.g. from an enclosing JSON view
|
|
246
|
-
|
|
249
|
+
runWithPreprocessors(function() {
|
|
247
250
|
this.applySettings({
|
|
248
251
|
content : this.createContent(oController)
|
|
249
252
|
});
|
|
@@ -29,7 +29,7 @@ function(View, TemplateViewRenderer, ViewType, Log) {
|
|
|
29
29
|
* @extends sap.ui.core.mvc.View
|
|
30
30
|
*
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.139.0
|
|
33
33
|
*
|
|
34
34
|
* @public
|
|
35
35
|
* @deprecated Since version 1.56.0, use {@link sap.ui.core.mvc.XMLView} in combination with
|
|
@@ -13,12 +13,14 @@ sap.ui.define([
|
|
|
13
13
|
"sap/base/util/isEmptyObject",
|
|
14
14
|
"sap/base/util/merge",
|
|
15
15
|
"sap/ui/base/ManagedObject",
|
|
16
|
+
"sap/ui/base/OwnStatics",
|
|
16
17
|
"sap/ui/core/Control",
|
|
17
18
|
"sap/ui/base/DesignTime",
|
|
18
19
|
"sap/ui/core/Element",
|
|
19
20
|
"./Controller",
|
|
20
21
|
"./ViewRenderer",
|
|
21
22
|
"./ViewType",
|
|
23
|
+
"./_ViewFactory",
|
|
22
24
|
"./XMLProcessingMode"
|
|
23
25
|
], function(
|
|
24
26
|
assert,
|
|
@@ -28,16 +30,19 @@ sap.ui.define([
|
|
|
28
30
|
isEmptyObject,
|
|
29
31
|
merge,
|
|
30
32
|
ManagedObject,
|
|
33
|
+
OwnStatics,
|
|
31
34
|
Control,
|
|
32
35
|
DesignTime,
|
|
33
36
|
Element,
|
|
34
37
|
Controller,
|
|
35
38
|
ViewRenderer,
|
|
36
39
|
ViewType,
|
|
40
|
+
_ViewFactory,
|
|
37
41
|
XMLProcessingMode
|
|
38
42
|
) {
|
|
39
43
|
"use strict";
|
|
40
44
|
|
|
45
|
+
const { getCurrentOwnerId, runWithPreprocessors } = OwnStatics.get(ManagedObject);
|
|
41
46
|
|
|
42
47
|
/**
|
|
43
48
|
* @namespace
|
|
@@ -148,7 +153,7 @@ sap.ui.define([
|
|
|
148
153
|
* </ul>
|
|
149
154
|
*
|
|
150
155
|
* @extends sap.ui.core.Control
|
|
151
|
-
* @version 1.
|
|
156
|
+
* @version 1.139.0
|
|
152
157
|
*
|
|
153
158
|
* @public
|
|
154
159
|
* @alias sap.ui.core.mvc.View
|
|
@@ -293,11 +298,9 @@ sap.ui.define([
|
|
|
293
298
|
|
|
294
299
|
/**
|
|
295
300
|
* Global map of preprocessors with view types and source types as keys,
|
|
296
|
-
* e.g.
|
|
297
|
-
*
|
|
298
|
-
* @private
|
|
301
|
+
* e.g. mPreprocessors[sViewType][sSourceType]
|
|
299
302
|
*/
|
|
300
|
-
|
|
303
|
+
const mPreprocessors = {};
|
|
301
304
|
|
|
302
305
|
/**
|
|
303
306
|
* align object structure to internal preprocessor format to be able to store internal settings without conflicts
|
|
@@ -371,8 +374,8 @@ sap.ui.define([
|
|
|
371
374
|
i, l, oOnDemandPreprocessor, aPreprocessors = [];
|
|
372
375
|
|
|
373
376
|
//clone static preprocessor settings
|
|
374
|
-
if (
|
|
375
|
-
aGlobalPreprocessors =
|
|
377
|
+
if (mPreprocessors[sViewType] && mPreprocessors[sViewType][sType]) {
|
|
378
|
+
aGlobalPreprocessors = mPreprocessors[sViewType][sType].map(function(oProcessor) {
|
|
376
379
|
return Object.assign({}, oProcessor);
|
|
377
380
|
});
|
|
378
381
|
}
|
|
@@ -482,7 +485,7 @@ sap.ui.define([
|
|
|
482
485
|
} else {
|
|
483
486
|
oThis.bControllerIsViewManaged = false;
|
|
484
487
|
// if passed controller is not extended yet we need to do it.
|
|
485
|
-
var sOwnerId =
|
|
488
|
+
var sOwnerId = getCurrentOwnerId();
|
|
486
489
|
if (!oController._isExtended()) {
|
|
487
490
|
oController = Controller.applyExtensions(oController, sName, sOwnerId, oThis.sId, bAsync);
|
|
488
491
|
} else if (bAsync) {
|
|
@@ -860,6 +863,7 @@ sap.ui.define([
|
|
|
860
863
|
sync: !!bSync
|
|
861
864
|
};
|
|
862
865
|
}
|
|
866
|
+
/** @deprecated since 1.120.0 */
|
|
863
867
|
if (View._supportInfo) {
|
|
864
868
|
this.oPreprocessorInfo._supportInfo = View._supportInfo;
|
|
865
869
|
}
|
|
@@ -918,16 +922,16 @@ sap.ui.define([
|
|
|
918
922
|
};
|
|
919
923
|
|
|
920
924
|
function initGlobalPreprocessorsRegistry(sType, sViewType) {
|
|
921
|
-
if (!
|
|
922
|
-
|
|
925
|
+
if (!mPreprocessors[sViewType]) {
|
|
926
|
+
mPreprocessors[sViewType] = {};
|
|
923
927
|
}
|
|
924
|
-
if (!
|
|
925
|
-
|
|
928
|
+
if (!mPreprocessors[sViewType][sType]) {
|
|
929
|
+
mPreprocessors[sViewType][sType] = [];
|
|
926
930
|
}
|
|
927
931
|
}
|
|
928
932
|
|
|
929
933
|
function onDemandPreprocessorExists(sViewType, sType) {
|
|
930
|
-
return
|
|
934
|
+
return mPreprocessors[sViewType][sType].some(function(oPreprocessor) {
|
|
931
935
|
return !!oPreprocessor._onDemand;
|
|
932
936
|
});
|
|
933
937
|
}
|
|
@@ -980,7 +984,7 @@ sap.ui.define([
|
|
|
980
984
|
future.errorThrows(`${this.getMetadata().getName()}: Registration for "${sType}" failed, only one on-demand-preprocessor allowed`);
|
|
981
985
|
return;
|
|
982
986
|
}
|
|
983
|
-
|
|
987
|
+
mPreprocessors[sViewType][sType].push({
|
|
984
988
|
preprocessor: vPreprocessor,
|
|
985
989
|
_onDemand: bOnDemand,
|
|
986
990
|
_syncSupport: bSyncSupport,
|
|
@@ -1105,16 +1109,16 @@ sap.ui.define([
|
|
|
1105
1109
|
// This is required as the viewFactory is called async
|
|
1106
1110
|
var Component = sap.ui.require("sap/ui/core/Component");
|
|
1107
1111
|
var oOwnerComponent;
|
|
1108
|
-
if (Component &&
|
|
1109
|
-
oOwnerComponent = Component.getComponentById(
|
|
1112
|
+
if (Component && getCurrentOwnerId()) {
|
|
1113
|
+
oOwnerComponent = Component.getComponentById(getCurrentOwnerId());
|
|
1110
1114
|
}
|
|
1111
1115
|
|
|
1112
1116
|
function createView() {
|
|
1113
|
-
return
|
|
1117
|
+
return _ViewFactory.create(mParameters.id, mParameters, mParameters.type).loaded();
|
|
1114
1118
|
}
|
|
1115
1119
|
|
|
1116
1120
|
return new Promise(function(resolve, reject) {
|
|
1117
|
-
var sViewClass = getViewClassName(mParameters);
|
|
1121
|
+
var sViewClass = _ViewFactory.getViewClassName(mParameters);
|
|
1118
1122
|
sap.ui.require([sViewClass], function(ViewClass){
|
|
1119
1123
|
resolve(ViewClass);
|
|
1120
1124
|
}, reject);
|
|
@@ -1137,18 +1141,6 @@ sap.ui.define([
|
|
|
1137
1141
|
});
|
|
1138
1142
|
};
|
|
1139
1143
|
|
|
1140
|
-
/**
|
|
1141
|
-
* Used to bypass the public APIs returning a Promise.
|
|
1142
|
-
* Some internal use-cases need the View instance synchronously instead of the wrapping Promises
|
|
1143
|
-
* of the [...]View.create() factories: e.g. root-view creation in sap/ui/core/UIComponent
|
|
1144
|
-
* Internally, the views might still be loaded and processed asynchronously.
|
|
1145
|
-
* @private
|
|
1146
|
-
* @ui5-restricted sap.ui.core
|
|
1147
|
-
* @see {sap.ui.view}
|
|
1148
|
-
* @function
|
|
1149
|
-
*/
|
|
1150
|
-
View._create = viewFactory;
|
|
1151
|
-
|
|
1152
1144
|
/**
|
|
1153
1145
|
* Creates a view of the given type, name and with the given ID.
|
|
1154
1146
|
*
|
|
@@ -1209,156 +1201,9 @@ sap.ui.define([
|
|
|
1209
1201
|
};
|
|
1210
1202
|
}
|
|
1211
1203
|
);
|
|
1212
|
-
return
|
|
1204
|
+
return _ViewFactory.create(sId, vView, sType);
|
|
1213
1205
|
};
|
|
1214
1206
|
|
|
1215
|
-
/**
|
|
1216
|
-
* The old sap.ui.view implementation
|
|
1217
|
-
*
|
|
1218
|
-
* @param {string} sId id of the newly created view, only allowed for instance creation
|
|
1219
|
-
* @param {string|object} [vView] the view name or view configuration object
|
|
1220
|
-
* @param {sap.ui.core.mvc.ViewType} [sType] Specifies what kind of view will be instantiated. All valid
|
|
1221
|
-
* view types are listed in the enumeration {@link sap.ui.core.mvc.ViewType}
|
|
1222
|
-
* @returns {sap.ui.core.mvc.View} the created view instance
|
|
1223
|
-
* @private
|
|
1224
|
-
*/
|
|
1225
|
-
function viewFactory(sId, vView, sType) {
|
|
1226
|
-
var view = null, oView = {};
|
|
1227
|
-
|
|
1228
|
-
// if the id is a configuration object or a string
|
|
1229
|
-
// and the vView is not defined we shift the parameters
|
|
1230
|
-
if (typeof sId === "object" ||
|
|
1231
|
-
typeof sId === "string" && vView === undefined) {
|
|
1232
|
-
vView = sId;
|
|
1233
|
-
sId = undefined;
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
// prepare the parameters
|
|
1237
|
-
if (vView) {
|
|
1238
|
-
if (typeof vView === "string") {
|
|
1239
|
-
oView.viewName = vView;
|
|
1240
|
-
} else {
|
|
1241
|
-
oView = vView;
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
// can be removed when generic type checking for special settings is introduced
|
|
1246
|
-
assert(!oView.async || typeof oView.async === "boolean", "sap.ui.view factory: Special setting async has to be of the type 'boolean'!");
|
|
1247
|
-
|
|
1248
|
-
// apply the id if defined
|
|
1249
|
-
if (sId) {
|
|
1250
|
-
oView.id = sId;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
// apply the type defined in specialized factory functions
|
|
1254
|
-
if (sType) {
|
|
1255
|
-
oView.type = sType;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
/**
|
|
1259
|
-
* @deprecated because the 'Sequential' Mode is used by default and it's the only mode that will be supported
|
|
1260
|
-
* in the next major release
|
|
1261
|
-
*/
|
|
1262
|
-
if (oView.type === ViewType.XML && oView.async) {
|
|
1263
|
-
// the processingMode might be already set by the asnychronous View.create factory
|
|
1264
|
-
// "SequentialLegacy" is only used if the sap.ui.view factory with async=true was called
|
|
1265
|
-
oView.processingMode = oView.processingMode || XMLProcessingMode.SequentialLegacy;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
// view replacement
|
|
1271
|
-
// get current owner component
|
|
1272
|
-
var Component = sap.ui.require("sap/ui/core/Component");
|
|
1273
|
-
|
|
1274
|
-
if (Component && ManagedObject._sOwnerId) {
|
|
1275
|
-
var customViewConfig = Component.getCustomizing(ManagedObject._sOwnerId, {
|
|
1276
|
-
type: "sap.ui.viewReplacements",
|
|
1277
|
-
name: oView.viewName
|
|
1278
|
-
});
|
|
1279
|
-
if (customViewConfig) {
|
|
1280
|
-
// make sure that "async=true" will not be overriden
|
|
1281
|
-
delete customViewConfig.async;
|
|
1282
|
-
|
|
1283
|
-
Log.info("Customizing: View replacement for view '" + oView.viewName + "' found and applied: " + customViewConfig.viewName + " (type: " + customViewConfig.type + ")");
|
|
1284
|
-
extend(oView, customViewConfig);
|
|
1285
|
-
} else {
|
|
1286
|
-
Log.debug("Customizing: no View replacement found for view '" + oView.viewName + "'.");
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
var sViewClass = getViewClassName(oView);
|
|
1291
|
-
view = createView(sViewClass, oView);
|
|
1292
|
-
return view;
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
/**
|
|
1296
|
-
* Extract the class name from the given view settings object
|
|
1297
|
-
*
|
|
1298
|
-
* @param {object} oViewSettings Settings object as given to the view factory
|
|
1299
|
-
* @param {boolean} [bSkipLog=false] Whether to skip the logging
|
|
1300
|
-
* @returns {string|undefined} Name of the view class (in sap.ui.define syntax)
|
|
1301
|
-
* @private
|
|
1302
|
-
*/
|
|
1303
|
-
function getViewClassName(oViewSettings, bSkipLog) {
|
|
1304
|
-
var sViewClass = getTypedViewModuleName(oViewSettings);
|
|
1305
|
-
|
|
1306
|
-
// view creation
|
|
1307
|
-
if (sViewClass) {
|
|
1308
|
-
if (oViewSettings.type && !bSkipLog) {
|
|
1309
|
-
Log.error("When using the view factory, the 'type' setting must be omitted for typed views. When embedding typed views in XML, don't use the <JSView> tag, use the <View> tag instead.");
|
|
1310
|
-
}
|
|
1311
|
-
return sViewClass;
|
|
1312
|
-
}
|
|
1313
|
-
if (!oViewSettings.type) {
|
|
1314
|
-
throw new Error("No view type specified.");
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
if (oViewSettings.type === ViewType.XML) {
|
|
1318
|
-
return 'sap/ui/core/mvc/XMLView';
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
/**
|
|
1322
|
-
* The different ViewTypes have been deprecated with different UI5 versions.
|
|
1323
|
-
* Please see the public "sap/ui/core/mvc/ViewType" enum for the specific versions.
|
|
1324
|
-
* @deprecated
|
|
1325
|
-
*/
|
|
1326
|
-
if (oViewSettings.type === ViewType.JS) {
|
|
1327
|
-
sViewClass = 'sap/ui/core/mvc/JSView';
|
|
1328
|
-
} else if (oViewSettings.type === ViewType.JSON) {
|
|
1329
|
-
sViewClass = 'sap/ui/core/mvc/JSONView';
|
|
1330
|
-
} else if (oViewSettings.type === ViewType.HTML) {
|
|
1331
|
-
sViewClass = 'sap/ui/core/mvc/HTMLView';
|
|
1332
|
-
} else if (oViewSettings.type === ViewType.Template) {
|
|
1333
|
-
sViewClass = 'sap/ui/core/mvc/TemplateView';
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
// unknown view type
|
|
1337
|
-
if (!sViewClass) {
|
|
1338
|
-
throw new Error("Unknown view type " + oViewSettings.type + " specified.");
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
return sViewClass;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
function createView(sViewClass, oViewSettings) {
|
|
1345
|
-
var ViewClass = sap.ui.require(sViewClass);
|
|
1346
|
-
if (!ViewClass) {
|
|
1347
|
-
future.warningThrows(`The view class '${sViewClass}' needs to be required before an instance of the view can be created.`);
|
|
1348
|
-
/**
|
|
1349
|
-
* @deprecated
|
|
1350
|
-
*/
|
|
1351
|
-
(() => {
|
|
1352
|
-
ViewClass = sap.ui.requireSync(sViewClass);// legacy-relevant: sync fallback for missing dependency
|
|
1353
|
-
if (oViewSettings.async) {
|
|
1354
|
-
//not supported
|
|
1355
|
-
Log.warning("sap.ui.view was called without requiring the according view class.");
|
|
1356
|
-
}
|
|
1357
|
-
})();
|
|
1358
|
-
}
|
|
1359
|
-
return new ViewClass(oViewSettings);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
1207
|
/**
|
|
1363
1208
|
* Returns a Promise representing the state of the view initialization.
|
|
1364
1209
|
*
|
|
@@ -1378,21 +1223,6 @@ sap.ui.define([
|
|
|
1378
1223
|
}
|
|
1379
1224
|
};
|
|
1380
1225
|
|
|
1381
|
-
/**
|
|
1382
|
-
* Extract module name from viewName property.
|
|
1383
|
-
*
|
|
1384
|
-
* @param {object} mSettings Settings as given to the view factory
|
|
1385
|
-
* @returns {string|undefined} Name of the module (in sap.ui.define syntax) from which to load the view definition.
|
|
1386
|
-
* @private
|
|
1387
|
-
*/
|
|
1388
|
-
function getTypedViewModuleName(mSettings) {
|
|
1389
|
-
var sModuleName;
|
|
1390
|
-
if (mSettings.viewName && mSettings.viewName.startsWith("module:")) {
|
|
1391
|
-
sModuleName = mSettings.viewName.slice("module:".length);
|
|
1392
|
-
}
|
|
1393
|
-
return sModuleName;
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
1226
|
/**
|
|
1397
1227
|
* Interface for Preprocessor implementations that can be hooked in the view life cycle.
|
|
1398
1228
|
*
|
|
@@ -1505,7 +1335,7 @@ sap.ui.define([
|
|
|
1505
1335
|
settings: this._fnSettingsPreprocessor
|
|
1506
1336
|
};
|
|
1507
1337
|
|
|
1508
|
-
return
|
|
1338
|
+
return runWithPreprocessors(function() {
|
|
1509
1339
|
var vContent = this.createContent(oController);
|
|
1510
1340
|
if (mSettings.async) {
|
|
1511
1341
|
vContent = Promise.resolve(vContent);
|
|
@@ -1543,6 +1373,50 @@ sap.ui.define([
|
|
|
1543
1373
|
}
|
|
1544
1374
|
};
|
|
1545
1375
|
|
|
1546
|
-
|
|
1376
|
+
OwnStatics.set(View, {
|
|
1377
|
+
/**
|
|
1378
|
+
* Retrieves all registered preprocessors for a given view and preprocessor type.
|
|
1379
|
+
*
|
|
1380
|
+
* @param {string} sViewType - The view type
|
|
1381
|
+
* @param {string} sType - The preprocessor type
|
|
1382
|
+
* @returns {Array<object>} An array of matching preprocessor entries. Returns an empty array if none are registered.
|
|
1383
|
+
* @private
|
|
1384
|
+
*/
|
|
1385
|
+
_getPreprocessors: function(sViewType, sType) {
|
|
1386
|
+
if (!mPreprocessors[sViewType]) {
|
|
1387
|
+
return [];
|
|
1388
|
+
}
|
|
1389
|
+
return mPreprocessors[sViewType][sType] || [];
|
|
1390
|
+
},
|
|
1391
|
+
/**
|
|
1392
|
+
* Removes a specific preprocessor from the registry based on its characteristics.
|
|
1393
|
+
*
|
|
1394
|
+
* The preprocessor is matched by reference and optional flags (`_onDemand` and `_syncSupport`).
|
|
1395
|
+
*
|
|
1396
|
+
* @param {string} sViewType - The view type from which to remove the preprocessor.
|
|
1397
|
+
* @param {string} sType - The preprocessor type.
|
|
1398
|
+
* @param {object} oPreprocessor - The preprocessor function or object to remove.
|
|
1399
|
+
* @param {boolean} [bOnDemand] - Whether the preprocessor was registered as on-demand.
|
|
1400
|
+
* @param {boolean} [bSyncSupport] - Whether the preprocessor supports synchronous execution.
|
|
1401
|
+
* @returns {object|null} The removed preprocessor entry if found and removed, otherwise `null`.
|
|
1402
|
+
* @private
|
|
1403
|
+
*/
|
|
1404
|
+
_removePreprocessor: function(sViewType, sType, oPreprocessor, bOnDemand, bSyncSupport) {
|
|
1405
|
+
if (mPreprocessors[sViewType] && mPreprocessors[sViewType][sType]) {
|
|
1406
|
+
const aPreprocessors = mPreprocessors[sViewType][sType];
|
|
1407
|
+
const iIndex = aPreprocessors.findIndex((oEntry) => {
|
|
1408
|
+
return !!oEntry._onDemand === !!bOnDemand
|
|
1409
|
+
&& !!oEntry._syncSupport === !!bSyncSupport
|
|
1410
|
+
&& oEntry.preprocessor === oPreprocessor;
|
|
1411
|
+
});
|
|
1412
|
+
if (iIndex >= 0) {
|
|
1413
|
+
return aPreprocessors.splice(iIndex, 1)[0];
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1547
1416
|
|
|
1417
|
+
return null;
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
|
|
1421
|
+
return View;
|
|
1548
1422
|
});
|
|
@@ -17,6 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
"sap/base/util/LoaderExtensions",
|
|
18
18
|
"sap/base/util/merge",
|
|
19
19
|
"sap/ui/base/ManagedObject",
|
|
20
|
+
"sap/ui/base/OwnStatics",
|
|
20
21
|
"sap/ui/core/Core",
|
|
21
22
|
"sap/ui/core/Control",
|
|
22
23
|
"sap/ui/core/RenderManager",
|
|
@@ -40,6 +41,7 @@ sap.ui.define([
|
|
|
40
41
|
LoaderExtensions,
|
|
41
42
|
merge,
|
|
42
43
|
ManagedObject,
|
|
44
|
+
OwnStatics,
|
|
43
45
|
Core,
|
|
44
46
|
Control,
|
|
45
47
|
RenderManager,
|
|
@@ -53,6 +55,8 @@ sap.ui.define([
|
|
|
53
55
|
) {
|
|
54
56
|
"use strict";
|
|
55
57
|
|
|
58
|
+
const { runWithPreprocessors } = OwnStatics.get(ManagedObject);
|
|
59
|
+
|
|
56
60
|
// actual constants
|
|
57
61
|
var RenderPrefixes = RenderManager.RenderPrefixes,
|
|
58
62
|
sXMLViewCacheError = "XMLViewCacheError",
|
|
@@ -113,7 +117,7 @@ sap.ui.define([
|
|
|
113
117
|
* bound content aggregation. An error will be thrown when the above combination is detected.
|
|
114
118
|
*
|
|
115
119
|
* @extends sap.ui.core.mvc.View
|
|
116
|
-
* @version 1.
|
|
120
|
+
* @version 1.139.0
|
|
117
121
|
*
|
|
118
122
|
* @public
|
|
119
123
|
* @alias sap.ui.core.mvc.XMLView
|
|
@@ -564,6 +568,7 @@ sap.ui.define([
|
|
|
564
568
|
function processView(xContent) {
|
|
565
569
|
that._xContent = xContent;
|
|
566
570
|
|
|
571
|
+
/** @deprecated since 1.120.0 */
|
|
567
572
|
if (View._supportInfo) {
|
|
568
573
|
View._supportInfo({context: that._xContent, env: {caller:"view", viewinfo: merge({}, that), settings: merge({}, mSettings || {}), type: "xmlview"}});
|
|
569
574
|
}
|
|
@@ -736,7 +741,7 @@ sap.ui.define([
|
|
|
736
741
|
// XMLView special logic for asynchronous template parsing, when component loading is async but
|
|
737
742
|
// instance creation is sync.
|
|
738
743
|
function fnRunWithPreprocessor(fn) {
|
|
739
|
-
return
|
|
744
|
+
return runWithPreprocessors(fn, {
|
|
740
745
|
settings: that._fnSettingsPreprocessor
|
|
741
746
|
});
|
|
742
747
|
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/base/assert",
|
|
8
|
+
"sap/base/future",
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/base/util/extend",
|
|
11
|
+
"sap/ui/base/OwnStatics",
|
|
12
|
+
"sap/ui/base/ManagedObject",
|
|
13
|
+
"./ViewType",
|
|
14
|
+
"./XMLProcessingMode"
|
|
15
|
+
], function(
|
|
16
|
+
assert,
|
|
17
|
+
future,
|
|
18
|
+
Log,
|
|
19
|
+
extend,
|
|
20
|
+
OwnStatics,
|
|
21
|
+
ManagedObject,
|
|
22
|
+
ViewType,
|
|
23
|
+
XMLProcessingMode
|
|
24
|
+
) {
|
|
25
|
+
"use strict";
|
|
26
|
+
|
|
27
|
+
const { getCurrentOwnerId } = OwnStatics.get(ManagedObject);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Extract module name from viewName property.
|
|
31
|
+
*
|
|
32
|
+
* @param {object} mSettings Settings as given to the view factory
|
|
33
|
+
* @returns {string|undefined} Name of the module (in sap.ui.define syntax) from which to load the view definition.
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
function getTypedViewModuleName(mSettings) {
|
|
37
|
+
var sModuleName;
|
|
38
|
+
if (mSettings.viewName && mSettings.viewName.startsWith("module:")) {
|
|
39
|
+
sModuleName = mSettings.viewName.slice("module:".length);
|
|
40
|
+
}
|
|
41
|
+
return sModuleName;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Extract the class name from the given view settings object
|
|
46
|
+
*
|
|
47
|
+
* @param {object} oViewSettings Settings object as given to the view factory
|
|
48
|
+
* @param {boolean} [bSkipLog=false] Whether to skip the logging
|
|
49
|
+
* @returns {string|undefined} Name of the view class (in sap.ui.define syntax)
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
function getViewClassName(oViewSettings, bSkipLog) {
|
|
53
|
+
var sViewClass = getTypedViewModuleName(oViewSettings);
|
|
54
|
+
|
|
55
|
+
// view creation
|
|
56
|
+
if (sViewClass) {
|
|
57
|
+
if (oViewSettings.type && !bSkipLog) {
|
|
58
|
+
Log.error("When using the view factory, the 'type' setting must be omitted for typed views. When embedding typed views in XML, don't use the <JSView> tag, use the <View> tag instead.");
|
|
59
|
+
}
|
|
60
|
+
return sViewClass;
|
|
61
|
+
}
|
|
62
|
+
if (!oViewSettings.type) {
|
|
63
|
+
throw new Error("No view type specified.");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (oViewSettings.type === ViewType.XML) {
|
|
67
|
+
return 'sap/ui/core/mvc/XMLView';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The different ViewTypes have been deprecated with different UI5 versions.
|
|
72
|
+
* Please see the public "sap/ui/core/mvc/ViewType" enum for the specific versions.
|
|
73
|
+
* @deprecated
|
|
74
|
+
*/
|
|
75
|
+
if (oViewSettings.type === ViewType.JS) {
|
|
76
|
+
sViewClass = 'sap/ui/core/mvc/JSView';
|
|
77
|
+
} else if (oViewSettings.type === ViewType.JSON) {
|
|
78
|
+
sViewClass = 'sap/ui/core/mvc/JSONView';
|
|
79
|
+
} else if (oViewSettings.type === ViewType.HTML) {
|
|
80
|
+
sViewClass = 'sap/ui/core/mvc/HTMLView';
|
|
81
|
+
} else if (oViewSettings.type === ViewType.Template) {
|
|
82
|
+
sViewClass = 'sap/ui/core/mvc/TemplateView';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// unknown view type
|
|
86
|
+
if (!sViewClass) {
|
|
87
|
+
throw new Error("Unknown view type " + oViewSettings.type + " specified.");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return sViewClass;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createView(sViewClass, oViewSettings) {
|
|
94
|
+
var ViewClass = sap.ui.require(sViewClass);
|
|
95
|
+
if (!ViewClass) {
|
|
96
|
+
future.warningThrows(`The view class '${sViewClass}' needs to be required before an instance of the view can be created.`);
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated
|
|
99
|
+
*/
|
|
100
|
+
(() => {
|
|
101
|
+
ViewClass = sap.ui.requireSync(sViewClass);// legacy-relevant: sync fallback for missing dependency
|
|
102
|
+
if (oViewSettings.async) {
|
|
103
|
+
//not supported
|
|
104
|
+
Log.warning("sap.ui.view was called without requiring the according view class.");
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
}
|
|
108
|
+
return new ViewClass(oViewSettings);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The old sap.ui.view implementation
|
|
114
|
+
*
|
|
115
|
+
* @param {string} sId id of the newly created view, only allowed for instance creation
|
|
116
|
+
* @param {string|object} [vView] the view name or view configuration object
|
|
117
|
+
* @param {sap.ui.core.mvc.ViewType} [sType] Specifies what kind of view will be instantiated. All valid
|
|
118
|
+
* view types are listed in the enumeration {@link sap.ui.core.mvc.ViewType}
|
|
119
|
+
* @returns {sap.ui.core.mvc.View} the created view instance
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
122
|
+
function viewFactory(sId, vView, sType) {
|
|
123
|
+
var view = null, oView = {};
|
|
124
|
+
|
|
125
|
+
// if the id is a configuration object or a string
|
|
126
|
+
// and the vView is not defined we shift the parameters
|
|
127
|
+
if (typeof sId === "object" ||
|
|
128
|
+
typeof sId === "string" && vView === undefined) {
|
|
129
|
+
vView = sId;
|
|
130
|
+
sId = undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// prepare the parameters
|
|
134
|
+
if (vView) {
|
|
135
|
+
if (typeof vView === "string") {
|
|
136
|
+
oView.viewName = vView;
|
|
137
|
+
} else {
|
|
138
|
+
oView = vView;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// can be removed when generic type checking for special settings is introduced
|
|
143
|
+
assert(!oView.async || typeof oView.async === "boolean", "sap.ui.view factory: Special setting async has to be of the type 'boolean'!");
|
|
144
|
+
|
|
145
|
+
// apply the id if defined
|
|
146
|
+
if (sId) {
|
|
147
|
+
oView.id = sId;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// apply the type defined in specialized factory functions
|
|
151
|
+
if (sType) {
|
|
152
|
+
oView.type = sType;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated because the 'Sequential' Mode is used by default and it's the only mode that will be supported
|
|
157
|
+
* in the next major release
|
|
158
|
+
*/
|
|
159
|
+
if (oView.type === ViewType.XML && oView.async) {
|
|
160
|
+
// the processingMode might be already set by the asnychronous View.create factory
|
|
161
|
+
// "SequentialLegacy" is only used if the sap.ui.view factory with async=true was called
|
|
162
|
+
oView.processingMode = oView.processingMode || XMLProcessingMode.SequentialLegacy;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
// view replacement
|
|
168
|
+
// get current owner component
|
|
169
|
+
var Component = sap.ui.require("sap/ui/core/Component");
|
|
170
|
+
|
|
171
|
+
if (Component && getCurrentOwnerId()) {
|
|
172
|
+
var customViewConfig = Component.getCustomizing(getCurrentOwnerId(), {
|
|
173
|
+
type: "sap.ui.viewReplacements",
|
|
174
|
+
name: oView.viewName
|
|
175
|
+
});
|
|
176
|
+
if (customViewConfig) {
|
|
177
|
+
// make sure that "async=true" will not be overriden
|
|
178
|
+
delete customViewConfig.async;
|
|
179
|
+
|
|
180
|
+
Log.info("Customizing: View replacement for view '" + oView.viewName + "' found and applied: " + customViewConfig.viewName + " (type: " + customViewConfig.type + ")");
|
|
181
|
+
extend(oView, customViewConfig);
|
|
182
|
+
} else {
|
|
183
|
+
Log.debug("Customizing: no View replacement found for view '" + oView.viewName + "'.");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var sViewClass = getViewClassName(oView);
|
|
188
|
+
view = createView(sViewClass, oView);
|
|
189
|
+
return view;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
create: viewFactory,
|
|
194
|
+
getViewClassName: getViewClassName
|
|
195
|
+
};
|
|
196
|
+
});
|