@openui5/sap.ui.core 1.101.0 → 1.103.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 +26 -5
- package/THIRDPARTY.txt +1 -1
- package/package.json +1 -1
- package/src/jquery.sap.global.js +2 -2
- 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/assert.js +1 -1
- package/src/sap/base/i18n/ResourceBundle.js +2 -2
- package/src/sap/base/strings/whitespaceReplacer.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +2 -2
- 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 +9 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/VersionInfo.js +12 -6
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +2 -2
- package/src/sap/ui/base/ExpressionParser.js +2 -2
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +10 -8
- package/src/sap/ui/base/ManagedObjectMetadata.js +21 -8
- 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/SyncPromise.js +2 -0
- package/src/sap/ui/core/.library +2 -89
- package/src/sap/ui/core/AppCacheBuster.js +4 -4
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/CommandExecution.js +15 -12
- package/src/sap/ui/core/Component.js +34 -15
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +27 -12
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +23 -9
- package/src/sap/ui/core/Control.js +3 -4
- package/src/sap/ui/core/Core.js +102 -34
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +10 -9
- package/src/sap/ui/core/Element.js +12 -11
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +4 -2
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/ExtensionPoint.js +1 -1
- package/src/sap/ui/core/FocusHandler.js +4 -5
- package/src/sap/ui/core/Fragment.js +17 -14
- package/src/sap/ui/core/HTML.js +2 -2
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +7 -7
- package/src/sap/ui/core/IconPool.js +1 -3
- 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/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +28 -4
- package/src/sap/ui/core/LocaleData.js +119 -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 +16 -16
- 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 +21 -15
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ShortcutHintsMixin.js +2 -4
- package/src/sap/ui/core/ThemeCheck.js +7 -7
- 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 +5 -6
- package/src/sap/ui/core/UIComponent.js +2 -2
- package/src/sap/ui/core/UIComponentMetadata.js +2 -2
- 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 +515 -392
- package/src/sap/ui/core/cache/CacheManager.js +27 -0
- package/src/sap/ui/core/cache/CacheManagerNOP.js +3 -0
- package/src/sap/ui/core/cache/LRUPersistentCache.js +75 -3
- package/src/sap/ui/core/cldr/ar.json +469 -1
- package/src/sap/ui/core/cldr/ar_EG.json +469 -1
- package/src/sap/ui/core/cldr/ar_SA.json +469 -1
- package/src/sap/ui/core/cldr/bg.json +469 -1
- package/src/sap/ui/core/cldr/ca.json +469 -1
- package/src/sap/ui/core/cldr/cs.json +469 -1
- package/src/sap/ui/core/cldr/cy.json +469 -1
- package/src/sap/ui/core/cldr/da.json +469 -1
- package/src/sap/ui/core/cldr/de.json +469 -1
- package/src/sap/ui/core/cldr/de_AT.json +469 -1
- package/src/sap/ui/core/cldr/de_CH.json +469 -1
- package/src/sap/ui/core/cldr/el.json +469 -1
- package/src/sap/ui/core/cldr/el_CY.json +469 -1
- package/src/sap/ui/core/cldr/en.json +469 -1
- package/src/sap/ui/core/cldr/en_AU.json +469 -1
- package/src/sap/ui/core/cldr/en_GB.json +469 -1
- package/src/sap/ui/core/cldr/en_HK.json +469 -1
- package/src/sap/ui/core/cldr/en_IE.json +469 -1
- package/src/sap/ui/core/cldr/en_IN.json +469 -1
- package/src/sap/ui/core/cldr/en_NZ.json +469 -1
- package/src/sap/ui/core/cldr/en_PG.json +469 -1
- package/src/sap/ui/core/cldr/en_SG.json +469 -1
- package/src/sap/ui/core/cldr/en_ZA.json +469 -1
- package/src/sap/ui/core/cldr/es.json +469 -1
- package/src/sap/ui/core/cldr/es_AR.json +469 -1
- package/src/sap/ui/core/cldr/es_BO.json +469 -1
- package/src/sap/ui/core/cldr/es_CL.json +469 -1
- package/src/sap/ui/core/cldr/es_CO.json +469 -1
- package/src/sap/ui/core/cldr/es_MX.json +469 -1
- package/src/sap/ui/core/cldr/es_PE.json +469 -1
- package/src/sap/ui/core/cldr/es_UY.json +469 -1
- package/src/sap/ui/core/cldr/es_VE.json +469 -1
- package/src/sap/ui/core/cldr/et.json +469 -1
- package/src/sap/ui/core/cldr/fa.json +469 -1
- package/src/sap/ui/core/cldr/fi.json +469 -1
- package/src/sap/ui/core/cldr/fr.json +469 -1
- package/src/sap/ui/core/cldr/fr_BE.json +469 -1
- package/src/sap/ui/core/cldr/fr_CA.json +469 -1
- package/src/sap/ui/core/cldr/fr_CH.json +469 -1
- package/src/sap/ui/core/cldr/fr_LU.json +469 -1
- package/src/sap/ui/core/cldr/he.json +469 -1
- package/src/sap/ui/core/cldr/hi.json +469 -1
- package/src/sap/ui/core/cldr/hr.json +469 -1
- package/src/sap/ui/core/cldr/hu.json +469 -1
- package/src/sap/ui/core/cldr/id.json +469 -1
- package/src/sap/ui/core/cldr/it.json +469 -1
- package/src/sap/ui/core/cldr/it_CH.json +469 -1
- package/src/sap/ui/core/cldr/ja.json +469 -1
- package/src/sap/ui/core/cldr/kk.json +469 -1
- package/src/sap/ui/core/cldr/ko.json +469 -1
- package/src/sap/ui/core/cldr/lt.json +469 -1
- package/src/sap/ui/core/cldr/lv.json +469 -1
- package/src/sap/ui/core/cldr/ms.json +469 -1
- package/src/sap/ui/core/cldr/nb.json +469 -1
- package/src/sap/ui/core/cldr/nl.json +469 -1
- package/src/sap/ui/core/cldr/nl_BE.json +469 -1
- package/src/sap/ui/core/cldr/pl.json +469 -1
- package/src/sap/ui/core/cldr/pt.json +469 -1
- package/src/sap/ui/core/cldr/pt_PT.json +469 -1
- package/src/sap/ui/core/cldr/ro.json +469 -1
- package/src/sap/ui/core/cldr/ru.json +469 -1
- package/src/sap/ui/core/cldr/ru_UA.json +469 -1
- package/src/sap/ui/core/cldr/sk.json +469 -1
- package/src/sap/ui/core/cldr/sl.json +469 -1
- package/src/sap/ui/core/cldr/sr.json +469 -1
- package/src/sap/ui/core/cldr/sr_Latn.json +469 -1
- package/src/sap/ui/core/cldr/sv.json +469 -1
- package/src/sap/ui/core/cldr/th.json +469 -1
- package/src/sap/ui/core/cldr/tr.json +469 -1
- package/src/sap/ui/core/cldr/uk.json +469 -1
- package/src/sap/ui/core/cldr/vi.json +469 -1
- package/src/sap/ui/core/cldr/zh_CN.json +470 -2
- package/src/sap/ui/core/cldr/zh_HK.json +470 -2
- package/src/sap/ui/core/cldr/zh_SG.json +470 -2
- package/src/sap/ui/core/cldr/zh_TW.json +469 -1
- package/src/sap/ui/core/delegate/ItemNavigation.js +13 -14
- package/src/sap/ui/core/delegate/ScrollEnablement.js +11 -7
- package/src/sap/ui/core/dnd/DragAndDrop.js +3 -3
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +43 -28
- package/src/sap/ui/core/format/NumberFormat.js +30 -30
- package/src/sap/ui/core/format/TimezoneUtil.js +48 -16
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- 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 +2 -2
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_el.properties +2 -2
- package/src/sap/ui/core/messagebundle_it.properties +56 -56
- package/src/sap/ui/core/mvc/ControllerExtension.js +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +12 -12
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +2 -2
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +2 -1
- package/src/sap/ui/core/mvc/XMLView.js +12 -20
- package/src/sap/ui/core/mvc/XMLViewRenderer.js +81 -62
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +3 -3
- 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/History.js +5 -3
- package/src/sap/ui/core/routing/Router.js +5 -3
- package/src/sap/ui/core/routing/Targets.js +2 -2
- package/src/sap/ui/core/rules/App.support.js +8 -8
- package/src/sap/ui/core/rules/Config.support.js +12 -12
- package/src/sap/ui/core/rules/Model.support.js +8 -8
- package/src/sap/ui/core/rules/Rendering.support.js +1 -1
- package/src/sap/ui/core/rules/Theming.support.js +4 -4
- package/src/sap/ui/core/rules/View.support.js +9 -9
- 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 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- 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/RuleEngineOpaExtension.js +1 -1
- package/src/sap/ui/core/support/Support.js +2 -2
- package/src/sap/ui/core/support/ToolsAPI.js +4 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +9 -3
- 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 +8 -22
- package/src/sap/ui/core/support/support.html +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +15 -1
- package/src/sap/ui/core/themes/base/base.less +4 -4
- package/src/sap/ui/core/themes/base/global.less +2 -0
- package/src/sap/ui/core/themes/sap_hcb/global.less +2 -0
- package/src/sap/ui/core/theming/Parameters.js +1 -1
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +2 -2
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +4 -4
- package/src/sap/ui/core/tmpl/TemplateControl.js +2 -2
- 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 +2 -2
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/ResponsivePaddingsEnablement.js +2 -2
- package/src/sap/ui/core/util/XMLPreprocessor.js +1 -1
- 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/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +7 -8
- 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/dom/_ready.js +34 -0
- package/src/sap/ui/dom/containsOrEquals.js +2 -2
- package/src/sap/ui/dom/getFirstEditableInput.js +2 -2
- package/src/sap/ui/dom/jquery/Focusable.js +1 -1
- package/src/sap/ui/dom/jquery/control.js +1 -1
- package/src/sap/ui/events/jquery/EventExtension.js +1 -1
- package/src/sap/ui/events/jquery/EventSimulation.js +1 -1
- package/src/sap/ui/model/ClientListBinding.js +127 -21
- package/src/sap/ui/model/ClientModel.js +1 -1
- 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/ListBinding.js +32 -13
- 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/TreeBindingAdapter.js +134 -0
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/_Helper.js +3 -1
- package/src/sap/ui/model/json/JSONListBinding.js +0 -58
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageListBinding.js +0 -42
- 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 +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +6 -0
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +279 -4
- package/src/sap/ui/model/odata/OperationMode.js +6 -0
- 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 -2
- 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/type/UnitMixin.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +13 -4
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +107 -34
- package/src/sap/ui/model/odata/v2/ODataModel.js +70 -22
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +43 -7
- package/src/sap/ui/model/odata/v4/Context.js +31 -10
- package/src/sap/ui/model/odata/v4/ODataBinding.js +16 -8
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +24 -1
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +83 -27
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +17 -10
- package/src/sap/ui/model/odata/v4/ODataModel.js +175 -6
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +30 -1
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +17 -6
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +6 -6
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +208 -85
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +119 -42
- package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +60 -35
- package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.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 -1
- package/src/sap/ui/model/xml/XMLListBinding.js +0 -53
- 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/security/FrameOptions.js +4 -2
- package/src/sap/ui/test/OpaBuilder.js +1 -1
- package/src/sap/ui/test/OpaPlugin.js +3 -3
- package/src/sap/ui/test/_ControlFinder.js +5 -4
- package/src/sap/ui/test/actions/Action.js +3 -3
- package/src/sap/ui/test/actions/Drag.js +2 -2
- package/src/sap/ui/test/actions/Drop.js +2 -2
- package/src/sap/ui/test/actions/EnterText.js +8 -8
- package/src/sap/ui/test/actions/Press.js +6 -6
- package/src/sap/ui/test/actions/Scroll.js +1 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/util/Mobile.js +59 -33
- package/src/sap/ui/util/Storage.js +2 -2
- package/src/sap/ui/util/openWindow.js +1 -1
- package/src/ui5loader.js +3 -3
- package/ui5.yaml +72 -1
|
@@ -180,10 +180,10 @@ sap.ui.define([
|
|
|
180
180
|
Array.isArray(vCacheData) ? sKeyPredicate : vDeleteProperty),
|
|
181
181
|
sTransientGroup = _Helper.getPrivateAnnotation(oEntity, "transient");
|
|
182
182
|
|
|
183
|
-
if (sTransientGroup === true) {
|
|
184
|
-
throw new Error("No 'delete' allowed while waiting for server response");
|
|
185
|
-
}
|
|
186
183
|
if (sTransientGroup) {
|
|
184
|
+
if (typeof sTransientGroup !== "string") {
|
|
185
|
+
throw new Error("No 'delete' allowed while waiting for server response");
|
|
186
|
+
}
|
|
187
187
|
that.oRequestor.removePost(sTransientGroup, oEntity);
|
|
188
188
|
return undefined;
|
|
189
189
|
}
|
|
@@ -206,7 +206,7 @@ sap.ui.define([
|
|
|
206
206
|
}),
|
|
207
207
|
iIndex === undefined // single element or kept-alive not in list
|
|
208
208
|
&& !bDoNotRequestCount
|
|
209
|
-
&& that.requestCount(oGroupLock),
|
|
209
|
+
&& that.requestCount(oGroupLock || that.oRequestor.lockGroup("$auto", that)),
|
|
210
210
|
oGroupLock && oGroupLock.unlock() // unlock when all requests have been queued
|
|
211
211
|
]).then(function () {
|
|
212
212
|
if (Array.isArray(vCacheData)) {
|
|
@@ -329,6 +329,7 @@ sap.ui.define([
|
|
|
329
329
|
sGroupId = oGroupLock.getGroupId(),
|
|
330
330
|
bKeepTransientPath = oEntityData && oEntityData["@$ui5.keepTransientPath"],
|
|
331
331
|
oPostBody,
|
|
332
|
+
fnResolve,
|
|
332
333
|
that = this;
|
|
333
334
|
|
|
334
335
|
// Clean-up when the create has been canceled.
|
|
@@ -352,7 +353,9 @@ sap.ui.define([
|
|
|
352
353
|
// Sets a marker that the create request is pending, so that update and delete fail.
|
|
353
354
|
function setCreatePending() {
|
|
354
355
|
that.addPendingRequest();
|
|
355
|
-
_Helper.setPrivateAnnotation(oEntityData, "transient",
|
|
356
|
+
_Helper.setPrivateAnnotation(oEntityData, "transient", new Promise(function (resolve) {
|
|
357
|
+
fnResolve = resolve;
|
|
358
|
+
}));
|
|
356
359
|
fnSubmitCallback();
|
|
357
360
|
}
|
|
358
361
|
|
|
@@ -395,17 +398,20 @@ sap.ui.define([
|
|
|
395
398
|
aSelect = _Helper.getQueryOptionsForPath(that.mQueryOptions, sPath).$select;
|
|
396
399
|
_Helper.updateSelected(that.mChangeListeners,
|
|
397
400
|
_Helper.buildPath(sPath, sPredicate || sTransientPredicate), oEntityData,
|
|
398
|
-
oCreatedEntity,
|
|
399
|
-
aSelect && aSelect.concat("@odata.etag")); // do not change $select
|
|
401
|
+
oCreatedEntity, aSelect);
|
|
400
402
|
|
|
401
403
|
that.removePendingRequest();
|
|
404
|
+
fnResolve(true);
|
|
402
405
|
return oEntityData;
|
|
403
406
|
}, function (oError) {
|
|
404
407
|
if (oError.canceled) {
|
|
405
408
|
// for cancellation no error is reported via fnErrorCallback
|
|
406
409
|
throw oError;
|
|
407
410
|
}
|
|
408
|
-
|
|
411
|
+
if (fnResolve) {
|
|
412
|
+
that.removePendingRequest();
|
|
413
|
+
fnResolve();
|
|
414
|
+
}
|
|
409
415
|
fnErrorCallback(oError);
|
|
410
416
|
if (that.fetchTypes().isRejected()) {
|
|
411
417
|
throw oError;
|
|
@@ -501,6 +507,7 @@ sap.ui.define([
|
|
|
501
507
|
var oDataPromise = SyncPromise.resolve(oData),
|
|
502
508
|
oEntity,
|
|
503
509
|
iEntityPathLength,
|
|
510
|
+
bInAnnotation = false,
|
|
504
511
|
aSegments,
|
|
505
512
|
bTransient = false,
|
|
506
513
|
that = this;
|
|
@@ -515,21 +522,42 @@ sap.ui.define([
|
|
|
515
522
|
* Determines the implicit value if the value is missing in the cache. Reports an invalid
|
|
516
523
|
* segment if there is no @Core.Permissions: 'None' annotation and no implicit value.
|
|
517
524
|
*
|
|
518
|
-
* @param {object} oValue The object that is expected to have the value
|
|
519
|
-
* @param {string} sSegment The path segment that is missing
|
|
520
|
-
* @param {number} iPathLength The length of the path of the missing value
|
|
521
|
-
* @returns {
|
|
525
|
+
* @param {object} oValue - The object that is expected to have the value
|
|
526
|
+
* @param {string} sSegment - The path segment that is missing
|
|
527
|
+
* @param {number} iPathLength - The length of the path of the missing value
|
|
528
|
+
* @returns {sap.ui.base.SyncPromise|undefined}
|
|
529
|
+
* Returns a SyncPromise which resolves with the value or returns undefined in some
|
|
530
|
+
* special cases.
|
|
522
531
|
*/
|
|
523
532
|
function missingValue(oValue, sSegment, iPathLength) {
|
|
524
533
|
var sPropertyPath = aSegments.slice(0, iPathLength).join("/"),
|
|
534
|
+
sPropertyName,
|
|
525
535
|
sReadLink,
|
|
526
536
|
sServiceUrl;
|
|
527
537
|
|
|
528
538
|
if (Array.isArray(oValue)) {
|
|
529
539
|
return invalidSegment(sSegment, sSegment === "0"); // missing key predicate or index
|
|
530
540
|
}
|
|
541
|
+
|
|
542
|
+
if (bInAnnotation) {
|
|
543
|
+
return invalidSegment(sSegment, true);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (sSegment.includes("@")) { // missing property annotation
|
|
547
|
+
sPropertyName = sSegment.split("@")[0];
|
|
548
|
+
if (bTransient
|
|
549
|
+
|| sPropertyName in oValue
|
|
550
|
+
|| oValue[sPropertyName + "@$ui5.noData"]
|
|
551
|
+
|| (that.mQueryOptions
|
|
552
|
+
&& that.mQueryOptions.$select.includes(sPropertyPath.split("@")[0]))) {
|
|
553
|
+
// no use to send late request
|
|
554
|
+
return invalidSegment(sSegment, true);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
531
558
|
return that.oRequestor.getModelInterface()
|
|
532
|
-
.fetchMetadata(that.sMetaPath + "/"
|
|
559
|
+
.fetchMetadata(that.sMetaPath + "/"
|
|
560
|
+
+ _Helper.getMetaPath(sPropertyPath.split("@")[0]))
|
|
533
561
|
.then(function (oProperty) {
|
|
534
562
|
var vPermissions;
|
|
535
563
|
|
|
@@ -559,7 +587,7 @@ sap.ui.define([
|
|
|
559
587
|
return oEntity
|
|
560
588
|
&& that.fetchLateProperty(oGroupLock, oEntity,
|
|
561
589
|
aSegments.slice(0, iEntityPathLength).join("/"),
|
|
562
|
-
aSegments.slice(iEntityPathLength).join("/"),
|
|
590
|
+
aSegments.slice(iEntityPathLength).join("/").split("@")[0],
|
|
563
591
|
aSegments.slice(iEntityPathLength, iPathLength).join("/"))
|
|
564
592
|
|| invalidSegment(sSegment);
|
|
565
593
|
}
|
|
@@ -627,9 +655,14 @@ sap.ui.define([
|
|
|
627
655
|
vValue = vValue[vIndex];
|
|
628
656
|
}
|
|
629
657
|
// missing advertisement or annotation is not an error
|
|
630
|
-
|
|
658
|
+
vValue = vValue === undefined && sSegment[0] !== "#" && sSegment[0] !== "@"
|
|
631
659
|
? missingValue(oParentValue, sSegment, i + 1)
|
|
632
660
|
: vValue;
|
|
661
|
+
if (sSegment.includes("@")) {
|
|
662
|
+
bInAnnotation = true;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return vValue;
|
|
633
666
|
});
|
|
634
667
|
}, oDataPromise);
|
|
635
668
|
};
|
|
@@ -691,7 +724,7 @@ sap.ui.define([
|
|
|
691
724
|
sExpand;
|
|
692
725
|
|
|
693
726
|
if (!oEntityType) {
|
|
694
|
-
oEntityType = that.fetchType(mTypeForMetaPath, sMetaPath).getResult();
|
|
727
|
+
oEntityType = that.oRequestor.fetchType(mTypeForMetaPath, sMetaPath).getResult();
|
|
695
728
|
}
|
|
696
729
|
if (sBasePath) {
|
|
697
730
|
// Key properties and predicate must only be copied from the result for nested
|
|
@@ -703,10 +736,7 @@ sap.ui.define([
|
|
|
703
736
|
}
|
|
704
737
|
aUpdateProperties.push(_Helper.buildPath(sBasePath, vKey));
|
|
705
738
|
});
|
|
706
|
-
aUpdateProperties.push(sBasePath + "/@$ui5._/predicate");
|
|
707
739
|
}
|
|
708
|
-
// Always copy the ETag for the case that the cached entity is still initial
|
|
709
|
-
aUpdateProperties.push(_Helper.buildPath(sBasePath, "@odata.etag"));
|
|
710
740
|
if (mQueryOptions0.$expand) {
|
|
711
741
|
// intersecting the query options with sRequestedPropertyPath delivers exactly one
|
|
712
742
|
// entry in $expand at each level (one for each navigation property binding)
|
|
@@ -758,11 +788,12 @@ sap.ui.define([
|
|
|
758
788
|
// even when two late properties lead to the same request, each of them must be copied to
|
|
759
789
|
// the cache.
|
|
760
790
|
return oPromise.then(function (oData) {
|
|
761
|
-
var
|
|
791
|
+
var sNewPredicate = _Helper.getPrivateAnnotation(oData, "predicate"),
|
|
792
|
+
sOldPredicate = _Helper.getPrivateAnnotation(oResource, "predicate");
|
|
762
793
|
|
|
763
|
-
if (
|
|
794
|
+
if (sOldPredicate && sNewPredicate && sOldPredicate !== sNewPredicate) {
|
|
764
795
|
throw new Error("GET " + sRequestPath + ": Key predicate changed from "
|
|
765
|
-
+
|
|
796
|
+
+ sOldPredicate + " to " + sNewPredicate);
|
|
766
797
|
}
|
|
767
798
|
// we expect the server to always or never send an ETag for this entity
|
|
768
799
|
if (oResource["@odata.etag"] && oData["@odata.etag"] !== oResource["@odata.etag"]) {
|
|
@@ -779,54 +810,6 @@ sap.ui.define([
|
|
|
779
810
|
});
|
|
780
811
|
};
|
|
781
812
|
|
|
782
|
-
/**
|
|
783
|
-
* Fetches the type for the given path and puts it into mTypeForMetaPath. Recursively fetches
|
|
784
|
-
* the key properties' parent types if they are complex.
|
|
785
|
-
*
|
|
786
|
-
* @param {object} mTypeForMetaPath
|
|
787
|
-
* A map from resource path and entity path to the type
|
|
788
|
-
* @param {string} sMetaPath
|
|
789
|
-
* The meta path of the resource + navigation or key path (which may lead to an entity or
|
|
790
|
-
* complex type)
|
|
791
|
-
* @returns {SyncPromise<object>}
|
|
792
|
-
* A promise resolving with the type
|
|
793
|
-
*/
|
|
794
|
-
_Cache.prototype.fetchType = function (mTypeForMetaPath, sMetaPath) {
|
|
795
|
-
var that = this;
|
|
796
|
-
|
|
797
|
-
if (sMetaPath in mTypeForMetaPath) {
|
|
798
|
-
return SyncPromise.resolve(mTypeForMetaPath[sMetaPath]);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
return this.oRequestor.fetchTypeForPath(sMetaPath).then(function (oType) {
|
|
802
|
-
var oMessageAnnotation,
|
|
803
|
-
aPromises = [];
|
|
804
|
-
|
|
805
|
-
if (oType) {
|
|
806
|
-
oMessageAnnotation = that.oRequestor.getModelInterface()
|
|
807
|
-
.fetchMetadata(sMetaPath + "/" + sMessagesAnnotation).getResult();
|
|
808
|
-
if (oMessageAnnotation) {
|
|
809
|
-
oType = Object.create(oType);
|
|
810
|
-
oType[sMessagesAnnotation] = oMessageAnnotation;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
mTypeForMetaPath[sMetaPath] = oType;
|
|
814
|
-
|
|
815
|
-
(oType.$Key || []).forEach(function (vKey) {
|
|
816
|
-
if (typeof vKey === "object") {
|
|
817
|
-
// key has an alias
|
|
818
|
-
vKey = vKey[Object.keys(vKey)[0]];
|
|
819
|
-
aPromises.push(that.fetchType(mTypeForMetaPath,
|
|
820
|
-
sMetaPath + "/" + vKey.slice(0, vKey.lastIndexOf("/"))));
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
return SyncPromise.all(aPromises).then(function () {
|
|
824
|
-
return oType;
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
};
|
|
829
|
-
|
|
830
813
|
/**
|
|
831
814
|
* Fetches the type from the metadata for the root entity plus all types for $expand and puts
|
|
832
815
|
* them into a map from meta path to type. Checks the types' key properties and puts their types
|
|
@@ -855,7 +838,7 @@ sap.ui.define([
|
|
|
855
838
|
|
|
856
839
|
sNavigationPath.split("/").forEach(function (sSegment) {
|
|
857
840
|
sMetaPath += "/" + sSegment;
|
|
858
|
-
aPromises.push(that.fetchType(mTypeForMetaPath, sMetaPath));
|
|
841
|
+
aPromises.push(that.oRequestor.fetchType(mTypeForMetaPath, sMetaPath));
|
|
859
842
|
});
|
|
860
843
|
fetchExpandedTypes(sMetaPath, mQueryOptions.$expand[sNavigationPath]);
|
|
861
844
|
});
|
|
@@ -865,7 +848,7 @@ sap.ui.define([
|
|
|
865
848
|
if (!this.oTypePromise) {
|
|
866
849
|
aPromises = [];
|
|
867
850
|
mTypeForMetaPath = {};
|
|
868
|
-
aPromises.push(this.fetchType(mTypeForMetaPath, this.sMetaPath));
|
|
851
|
+
aPromises.push(this.oRequestor.fetchType(mTypeForMetaPath, this.sMetaPath));
|
|
869
852
|
fetchExpandedTypes(this.sMetaPath, this.mQueryOptions);
|
|
870
853
|
this.oTypePromise = SyncPromise.all(aPromises).then(function () {
|
|
871
854
|
return mTypeForMetaPath;
|
|
@@ -1384,7 +1367,7 @@ sap.ui.define([
|
|
|
1384
1367
|
delete aElements.$byPredicate[sTransientPredicate];
|
|
1385
1368
|
}
|
|
1386
1369
|
if (!sPath && iIndex !== undefined) {
|
|
1387
|
-
// Note: sPath is empty only in a CollectionCache, so we may use
|
|
1370
|
+
// Note: sPath is empty only in a CollectionCache, so we may use iLimit and
|
|
1388
1371
|
// adjustReadRequests
|
|
1389
1372
|
if (!sTransientPredicate) {
|
|
1390
1373
|
this.iLimit -= 1; // this doesn't change Infinity
|
|
@@ -1862,7 +1845,7 @@ sap.ui.define([
|
|
|
1862
1845
|
}
|
|
1863
1846
|
sTransientGroup = _Helper.getPrivateAnnotation(oEntity, "transient");
|
|
1864
1847
|
if (sTransientGroup) {
|
|
1865
|
-
if (sTransientGroup
|
|
1848
|
+
if (typeof sTransientGroup !== "string") {
|
|
1866
1849
|
throw new Error("No 'update' allowed while waiting for server response");
|
|
1867
1850
|
}
|
|
1868
1851
|
if (sTransientGroup.startsWith("$parked.")
|
|
@@ -2066,8 +2049,8 @@ sap.ui.define([
|
|
|
2066
2049
|
|| sProperty.endsWith("@mediaReadLink")) {
|
|
2067
2050
|
oInstance[sProperty] = _Helper.makeAbsolute(vPropertyValue, sContextUrl);
|
|
2068
2051
|
}
|
|
2069
|
-
if (sProperty.includes("@")) {
|
|
2070
|
-
return;
|
|
2052
|
+
if (sProperty === sMessageProperty || sProperty.includes("@")) {
|
|
2053
|
+
return; // ignore message property and other annotations
|
|
2071
2054
|
}
|
|
2072
2055
|
if (Array.isArray(vPropertyValue)) {
|
|
2073
2056
|
vPropertyValue.$created = 0; // number of (client-side) created elements
|
|
@@ -2500,7 +2483,8 @@ sap.ui.define([
|
|
|
2500
2483
|
};
|
|
2501
2484
|
|
|
2502
2485
|
/**
|
|
2503
|
-
* Handles a GET response by updating the cache data; filters out newly created elements
|
|
2486
|
+
* Handles a GET response by updating the cache data; filters out newly created elements and
|
|
2487
|
+
* overwrites the corresponding <code>SyncPromise</code> with <code>undefined</code>.
|
|
2504
2488
|
*
|
|
2505
2489
|
* @param {object} oResult - The result of the GET request
|
|
2506
2490
|
* @param {number} iStart - The start index of the GET's range in this.aElements
|
|
@@ -2513,6 +2497,8 @@ sap.ui.define([
|
|
|
2513
2497
|
*/
|
|
2514
2498
|
_CollectionCache.prototype.handleResponse = function (oResult, iStart, mTypeForMetaPath) {
|
|
2515
2499
|
var oElement,
|
|
2500
|
+
aElements = this.aElements,
|
|
2501
|
+
iCreated = aElements.$created,
|
|
2516
2502
|
oKeptElement,
|
|
2517
2503
|
iOffset = 0,
|
|
2518
2504
|
sPredicate,
|
|
@@ -2525,14 +2511,15 @@ sap.ui.define([
|
|
|
2525
2511
|
oElement = oResult.value[i];
|
|
2526
2512
|
sPredicate = _Helper.getPrivateAnnotation(oElement, "predicate");
|
|
2527
2513
|
if (sPredicate) {
|
|
2528
|
-
oKeptElement =
|
|
2514
|
+
oKeptElement = aElements.$byPredicate[sPredicate];
|
|
2529
2515
|
if (oKeptElement) {
|
|
2530
2516
|
// we expect the server to always or never send an ETag for this entity
|
|
2531
2517
|
if (!oKeptElement["@odata.etag"]
|
|
2532
2518
|
|| oElement["@odata.etag"] === oKeptElement["@odata.etag"]) {
|
|
2533
|
-
if (
|
|
2519
|
+
if (iCreated && aElements.lastIndexOf(oKeptElement, iCreated - 1) >= 0) {
|
|
2534
2520
|
// client-side filter for newly created persisted
|
|
2535
2521
|
iOffset += 1;
|
|
2522
|
+
aElements[iStart + iResultLength - iOffset] = undefined;
|
|
2536
2523
|
continue;
|
|
2537
2524
|
}
|
|
2538
2525
|
_Helper.updateNonExisting(oKeptElement, oElement);
|
|
@@ -2542,9 +2529,9 @@ sap.ui.define([
|
|
|
2542
2529
|
+ this.sResourcePath + sPredicate);
|
|
2543
2530
|
} // else: if POST and GET are in the same $batch, ETag cannot differ!
|
|
2544
2531
|
}
|
|
2545
|
-
|
|
2532
|
+
aElements.$byPredicate[sPredicate] = oElement;
|
|
2546
2533
|
}
|
|
2547
|
-
|
|
2534
|
+
aElements[iStart + i - iOffset] = oElement;
|
|
2548
2535
|
}
|
|
2549
2536
|
|
|
2550
2537
|
return iOffset;
|
|
@@ -3203,20 +3190,27 @@ sap.ui.define([
|
|
|
3203
3190
|
* requests for late properties. If <code>false<code>, {@link #post} throws an error.
|
|
3204
3191
|
* @param {string} [sMetaPath]
|
|
3205
3192
|
* Optional meta path in case it cannot be derived from the given resource path
|
|
3206
|
-
*
|
|
3193
|
+
* @param {boolean} [bEmpty]
|
|
3194
|
+
* Whether the cache is initialized with an empty response so that all properties are fetched
|
|
3195
|
+
* as late properties
|
|
3207
3196
|
* @alias sap.ui.model.odata.v4.lib._SingleCache
|
|
3208
3197
|
* @constructor
|
|
3209
3198
|
* @private
|
|
3210
3199
|
*/
|
|
3211
3200
|
function _SingleCache(oRequestor, sResourcePath, mQueryOptions, bSortExpandSelect,
|
|
3212
|
-
bSharedRequest, fnGetOriginalResourcePath, bPost, sMetaPath) {
|
|
3201
|
+
bSharedRequest, fnGetOriginalResourcePath, bPost, sMetaPath, bEmpty) {
|
|
3213
3202
|
_Cache.call(this, oRequestor, sResourcePath, mQueryOptions, bSortExpandSelect,
|
|
3214
3203
|
fnGetOriginalResourcePath, bSharedRequest);
|
|
3215
3204
|
|
|
3216
3205
|
this.sMetaPath = sMetaPath || this.sMetaPath; // overrides Cache c'tor
|
|
3217
3206
|
this.bPost = bPost;
|
|
3218
3207
|
this.bPosting = false;
|
|
3219
|
-
|
|
3208
|
+
if (bEmpty) {
|
|
3209
|
+
// simulates an empty response and ensure that all properties become late properties
|
|
3210
|
+
this.oPromise = SyncPromise.resolve({});
|
|
3211
|
+
} else {
|
|
3212
|
+
this.oPromise = null; // a SyncPromise for the current value
|
|
3213
|
+
}
|
|
3220
3214
|
}
|
|
3221
3215
|
|
|
3222
3216
|
// make SingleCache a Cache
|
|
@@ -3492,6 +3486,132 @@ sap.ui.define([
|
|
|
3492
3486
|
return oResult;
|
|
3493
3487
|
};
|
|
3494
3488
|
|
|
3489
|
+
/**
|
|
3490
|
+
* Resets the property for the given path. This means that the next #fetchValue will request the
|
|
3491
|
+
* property again via #fetchLateProperty. Deletes also the entity's ETag within the cache in
|
|
3492
|
+
* order to allow that it may change.
|
|
3493
|
+
*
|
|
3494
|
+
* @param {string} sPath - The path to the property within the cache
|
|
3495
|
+
*/
|
|
3496
|
+
_SingleCache.prototype.resetProperty = function (sPath) {
|
|
3497
|
+
var oData = this.oPromise.getResult();
|
|
3498
|
+
|
|
3499
|
+
if (oData) {
|
|
3500
|
+
sPath.split("/").some(function (sProperty) {
|
|
3501
|
+
// Note: all ETags that are reached by the given sPath are deleted in order to
|
|
3502
|
+
// prevent that #fetchLateProperty throws "Key predicate changed from ..."
|
|
3503
|
+
// Ideally only the ETag for the entity the property belongs to should be deleted.
|
|
3504
|
+
// But because PATCH within SingletonPropertyCache is anyhow not supported we can
|
|
3505
|
+
// delete all ETags so far
|
|
3506
|
+
delete oData["@odata.etag"];
|
|
3507
|
+
if (typeof oData[sProperty] === "object") {
|
|
3508
|
+
oData = oData[sProperty];
|
|
3509
|
+
return false;
|
|
3510
|
+
}
|
|
3511
|
+
delete oData[sProperty];
|
|
3512
|
+
return true;
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
|
|
3517
|
+
//*********************************************************************************************
|
|
3518
|
+
// SingletonPropertyCache
|
|
3519
|
+
//*********************************************************************************************
|
|
3520
|
+
/**
|
|
3521
|
+
* Creates a cache for a property that belongs to an OData singleton by creating a _SingleCache
|
|
3522
|
+
* for the singleton and remembering the property path within that _SingleCache. All
|
|
3523
|
+
* _SingletonPropertyCaches that belong to the same singleton share the same _SingleCache if
|
|
3524
|
+
* they have the same query options.
|
|
3525
|
+
*
|
|
3526
|
+
* @param {sap.ui.model.odata.v4.lib._Requestor} oRequestor
|
|
3527
|
+
* The requestor
|
|
3528
|
+
* @param {string} sResourcePath
|
|
3529
|
+
* A resource path relative to the service URL
|
|
3530
|
+
* @param {object} [mQueryOptions]
|
|
3531
|
+
* A map of key-value pairs representing the query string
|
|
3532
|
+
* @private
|
|
3533
|
+
*/
|
|
3534
|
+
function _SingletonPropertyCache(oRequestor, sResourcePath, mQueryOptions) {
|
|
3535
|
+
var aSegments = sResourcePath.split("/"),
|
|
3536
|
+
sSingleton = aSegments[0],
|
|
3537
|
+
sSingletonKey = sSingleton + JSON.stringify(mQueryOptions),
|
|
3538
|
+
mSingletonCacheByPath = oRequestor.$mSingletonCacheByPath;
|
|
3539
|
+
|
|
3540
|
+
_PropertyCache.call(this, oRequestor, sResourcePath,
|
|
3541
|
+
{/*mQueryOptions will be passed to the _SingleCache*/});
|
|
3542
|
+
|
|
3543
|
+
if (!mSingletonCacheByPath) {
|
|
3544
|
+
mSingletonCacheByPath = oRequestor.$mSingletonCacheByPath = {};
|
|
3545
|
+
}
|
|
3546
|
+
this.oSingleton = mSingletonCacheByPath[sSingletonKey];
|
|
3547
|
+
if (!this.oSingleton) {
|
|
3548
|
+
this.oSingleton = mSingletonCacheByPath[sSingletonKey]
|
|
3549
|
+
= new _SingleCache(oRequestor, sSingleton, mQueryOptions,
|
|
3550
|
+
/*bSortExpandSelect*/ undefined, /*bSharedRequest*/ undefined,
|
|
3551
|
+
/*fnGetOriginalResourcePath*/ undefined, /*bPost*/ undefined,
|
|
3552
|
+
/*sMetaPath*/ undefined, /*bEmpty*/ true);
|
|
3553
|
+
}
|
|
3554
|
+
this.sRelativePath = sResourcePath.split(sSingleton + "/")[1];
|
|
3555
|
+
}
|
|
3556
|
+
|
|
3557
|
+
// make _SingletonPropertyCache a _PropertyCache
|
|
3558
|
+
_SingletonPropertyCache.prototype = Object.create(_PropertyCache.prototype);
|
|
3559
|
+
|
|
3560
|
+
/**
|
|
3561
|
+
* Delegates to #fetchValue of its shared OData Singleton _SingleCache. Within the 1st call its
|
|
3562
|
+
* own relative property path is added to the mLateQueryOptions of its _SingleCache.
|
|
3563
|
+
*
|
|
3564
|
+
* @param {sap.ui.model.odata.v4.lib._GroupLock} oGroupLock
|
|
3565
|
+
* A lock for the group to associate the request with
|
|
3566
|
+
* see {sap.ui.model.odata.v4.lib._Requestor#request} for details
|
|
3567
|
+
* @param {string} [_sPath]
|
|
3568
|
+
* ignored for property caches, should be empty
|
|
3569
|
+
* @param {function} [fnDataRequested]
|
|
3570
|
+
* The function is called just before the back-end request is sent.
|
|
3571
|
+
* @param {object} [oListener]
|
|
3572
|
+
* A change listener that is added for the given path. Its method <code>onChange</code> is
|
|
3573
|
+
* called with the new value if the property at that path is modified later
|
|
3574
|
+
* @param {boolean} [bCreateOnDemand]
|
|
3575
|
+
* Unsupported
|
|
3576
|
+
* @returns {sap.ui.base.SyncPromise}
|
|
3577
|
+
* A promise to be resolved with the value. It is rejected if the request for the data failed.
|
|
3578
|
+
* @throws {Error}
|
|
3579
|
+
* If <code>bCreateOnDemand</code> is set or if group ID is '$cached' and the value is not
|
|
3580
|
+
* cached (the error has a property <code>$cached = true</code> then)
|
|
3581
|
+
*
|
|
3582
|
+
* @public
|
|
3583
|
+
*/
|
|
3584
|
+
_SingletonPropertyCache.prototype.fetchValue = function (oGroupLock, _sPath, fnDataRequested,
|
|
3585
|
+
oListener, bCreateOnDemand) {
|
|
3586
|
+
var sPropertyPath = this.oSingleton.sResourcePath + "/" + this.sRelativePath,
|
|
3587
|
+
mLateQueryOptions,
|
|
3588
|
+
oMetadataPromise = this.oMetadataPromise || this.oRequestor.getModelInterface()
|
|
3589
|
+
.fetchMetadata("/" + _Helper.getMetaPath(sPropertyPath)),
|
|
3590
|
+
that = this;
|
|
3591
|
+
|
|
3592
|
+
return oMetadataPromise.then(function () {
|
|
3593
|
+
if (!that.oMetadataPromise) {
|
|
3594
|
+
mLateQueryOptions = that.oSingleton.getLateQueryOptions() || {};
|
|
3595
|
+
_Helper.aggregateExpandSelect(mLateQueryOptions,
|
|
3596
|
+
_Helper.wrapChildQueryOptions("/" + that.oSingleton.sResourcePath,
|
|
3597
|
+
that.sRelativePath, {}, that.oRequestor.getModelInterface().fetchMetadata));
|
|
3598
|
+
that.oSingleton.setLateQueryOptions(mLateQueryOptions);
|
|
3599
|
+
}
|
|
3600
|
+
that.oMetadataPromise = oMetadataPromise;
|
|
3601
|
+
return that.oSingleton.fetchValue(oGroupLock, that.sRelativePath, fnDataRequested,
|
|
3602
|
+
oListener, bCreateOnDemand);
|
|
3603
|
+
});
|
|
3604
|
+
};
|
|
3605
|
+
|
|
3606
|
+
/**
|
|
3607
|
+
* Resets the property for its own relative path within the singleton's single cache. This means
|
|
3608
|
+
* that the next #fetchValue will request the property again via #fetchLateProperty. Deletes
|
|
3609
|
+
* also the entity's ETag within the cache in order to allow that it may change.
|
|
3610
|
+
*/
|
|
3611
|
+
_SingletonPropertyCache.prototype.reset = function () {
|
|
3612
|
+
this.oSingleton.resetProperty(this.sRelativePath);
|
|
3613
|
+
};
|
|
3614
|
+
|
|
3495
3615
|
//*********************************************************************************************
|
|
3496
3616
|
// "static" functions
|
|
3497
3617
|
//*********************************************************************************************
|
|
@@ -3590,7 +3710,10 @@ sap.ui.define([
|
|
|
3590
3710
|
* @public
|
|
3591
3711
|
*/
|
|
3592
3712
|
_Cache.createProperty = function (oRequestor, sResourcePath, mQueryOptions) {
|
|
3593
|
-
|
|
3713
|
+
if (sResourcePath.includes("(") || sResourcePath.endsWith("/$count")) {
|
|
3714
|
+
return new _PropertyCache(oRequestor, sResourcePath, mQueryOptions);
|
|
3715
|
+
}
|
|
3716
|
+
return new _SingletonPropertyCache(oRequestor, sResourcePath, mQueryOptions);
|
|
3594
3717
|
};
|
|
3595
3718
|
|
|
3596
3719
|
/**
|