@openui5/sap.ui.core 1.103.1 → 1.104.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/.reuse/dep5 +17 -0
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +35 -2
- package/package.json +1 -1
- 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/util/LoaderExtensions.js +69 -61
- package/src/sap/base/util/fetch.js +230 -0
- package/src/sap/base/util/mixedFetch.js +69 -0
- 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/base/util/syncFetch.js +73 -0
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +1 -1
- 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/core/.library +17 -2
- package/src/sap/ui/core/AppCacheBuster.js +65 -51
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +48 -21
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +2 -2
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +44 -21
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +49 -61
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +9 -1
- 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/FocusHandler.js +56 -33
- package/src/sap/ui/core/Fragment.js +1 -1
- 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 +4 -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 +1 -1
- package/src/sap/ui/core/LocaleData.js +3 -45
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/RenderManager.js +11 -21
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +22 -43
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- 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 +6 -4
- package/src/sap/ui/core/UIComponent.js +1 -1
- 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/_IconRegistry.js +66 -55
- package/src/sap/ui/core/cache/CacheManager.js +18 -14
- package/src/sap/ui/core/cache/CacheManagerNOP.js +5 -2
- package/src/sap/ui/core/cache/LRUPersistentCache.js +15 -8
- package/src/sap/ui/core/cldr/en.json +0 -1
- package/src/sap/ui/core/date/Buddhist.js +15 -13
- package/src/sap/ui/core/date/Japanese.js +0 -6
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- 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/NumberFormat.js +91 -25
- package/src/sap/ui/core/format/TimezoneUtil.js +2 -2
- 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 +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_ar.properties +54 -53
- package/src/sap/ui/core/messagebundle_bg.properties +54 -53
- package/src/sap/ui/core/messagebundle_ca.properties +28 -27
- package/src/sap/ui/core/messagebundle_cs.properties +37 -36
- package/src/sap/ui/core/messagebundle_cy.properties +56 -55
- package/src/sap/ui/core/messagebundle_da.properties +53 -52
- package/src/sap/ui/core/messagebundle_de.properties +54 -53
- package/src/sap/ui/core/messagebundle_el.properties +45 -44
- package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +1 -0
- package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +1 -0
- package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +1 -0
- package/src/sap/ui/core/messagebundle_es.properties +42 -41
- package/src/sap/ui/core/messagebundle_es_MX.properties +54 -53
- package/src/sap/ui/core/messagebundle_et.properties +51 -50
- package/src/sap/ui/core/messagebundle_fi.properties +48 -47
- package/src/sap/ui/core/messagebundle_fr.properties +36 -35
- package/src/sap/ui/core/messagebundle_fr_CA.properties +21 -20
- package/src/sap/ui/core/messagebundle_hi.properties +41 -40
- package/src/sap/ui/core/messagebundle_hr.properties +55 -54
- package/src/sap/ui/core/messagebundle_hu.properties +55 -54
- package/src/sap/ui/core/messagebundle_id.properties +55 -54
- package/src/sap/ui/core/messagebundle_it.properties +55 -54
- package/src/sap/ui/core/messagebundle_iw.properties +55 -54
- package/src/sap/ui/core/messagebundle_ja.properties +48 -47
- package/src/sap/ui/core/messagebundle_kk.properties +41 -40
- package/src/sap/ui/core/messagebundle_ko.properties +17 -16
- package/src/sap/ui/core/messagebundle_lt.properties +55 -54
- package/src/sap/ui/core/messagebundle_lv.properties +55 -54
- package/src/sap/ui/core/messagebundle_ms.properties +52 -51
- package/src/sap/ui/core/messagebundle_nl.properties +53 -52
- package/src/sap/ui/core/messagebundle_no.properties +53 -52
- package/src/sap/ui/core/messagebundle_pl.properties +52 -51
- package/src/sap/ui/core/messagebundle_pt.properties +54 -53
- package/src/sap/ui/core/messagebundle_pt_PT.properties +55 -54
- package/src/sap/ui/core/messagebundle_ro.properties +56 -55
- package/src/sap/ui/core/messagebundle_ru.properties +52 -51
- package/src/sap/ui/core/messagebundle_sh.properties +56 -55
- package/src/sap/ui/core/messagebundle_sk.properties +54 -53
- package/src/sap/ui/core/messagebundle_sl.properties +56 -55
- package/src/sap/ui/core/messagebundle_sv.properties +52 -51
- package/src/sap/ui/core/messagebundle_th.properties +25 -24
- package/src/sap/ui/core/messagebundle_tr.properties +56 -55
- package/src/sap/ui/core/messagebundle_uk.properties +55 -54
- package/src/sap/ui/core/messagebundle_vi.properties +55 -54
- package/src/sap/ui/core/messagebundle_zh_CN.properties +55 -54
- package/src/sap/ui/core/messagebundle_zh_TW.properties +55 -54
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -2
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +16 -14
- package/src/sap/ui/core/plugin/TemplatingSupport.js +2 -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/async/TargetCache.js +4 -0
- package/src/sap/ui/core/rules/Config.support.js +1 -1
- package/src/sap/ui/core/rules/View.support.js +11 -4
- package/src/sap/ui/core/search/OpenSearchProvider.js +24 -11
- 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/Support.js +2 -2
- 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 +46 -33
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +1 -1
- package/src/sap/ui/core/themes/base/base.less +26 -26
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +45 -39
- 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 +1 -1
- package/src/sap/ui/core/tmpl/Template.js +2 -2
- 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 +61 -42
- 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 +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 +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 +19 -9
- 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 +2 -2
- 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/odata4analytics.js +2 -2
- 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 +6 -3
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +128 -87
- 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/ODataContextBinding.js +4 -1
- package/src/sap/ui/model/odata/v2/ODataModel.js +112 -104
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +15 -2
- package/src/sap/ui/model/odata/v4/Context.js +3 -1
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +2 -1
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +74 -24
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +42 -0
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +3 -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/XMLModel.js +1 -1
- package/src/sap/ui/qunit/sinon-qunit-bridge.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/Opa5.js +1 -1
- package/src/sap/ui/test/TestUtils.js +35 -2
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/matchers/Matcher.js +9 -11
- package/src/sap/ui/test/opaQunit.js +4 -3
- package/src/sap/ui/thirdparty/IPv6.js +1 -1
- package/src/sap/ui/thirdparty/SecondLevelDomains.js +1 -1
- package/src/sap/ui/thirdparty/URI.js +8 -2
- package/src/sap/ui/thirdparty/URITemplate.js +1 -1
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap/ui/util/XMLHelper.js +1 -1
package/.reuse/dep5
CHANGED
|
@@ -137,6 +137,11 @@ Copyright: jQuery Foundation and other contributors
|
|
|
137
137
|
License: MIT
|
|
138
138
|
Comment: these files belong to: QUnit 2
|
|
139
139
|
|
|
140
|
+
Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
|
|
141
|
+
Copyright: jQuery Foundation and other contributors
|
|
142
|
+
License: MIT
|
|
143
|
+
Comment: these files belong to: QUnit 2.18
|
|
144
|
+
|
|
140
145
|
Files: src/sap.ui.core/src/sap/ui/thirdparty/jquery-compat.js
|
|
141
146
|
Copyright: OpenJS Foundation and other contributors
|
|
142
147
|
License: MIT
|
|
@@ -234,6 +239,11 @@ Copyright: 2010-2017, Christian Johansen, christian@cjohansen.no
|
|
|
234
239
|
License: BSD-3-Clause
|
|
235
240
|
Comment: these files belong to: SinonJS
|
|
236
241
|
|
|
242
|
+
Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
|
|
243
|
+
Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
|
|
244
|
+
License: BSD-3-Clause
|
|
245
|
+
Comment: these files belong to: SinonJS 14
|
|
246
|
+
|
|
237
247
|
Files: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
|
|
238
248
|
Copyright: 2010-2011, Christian Johansen
|
|
239
249
|
License: BSD-3-Clause
|
|
@@ -339,6 +349,13 @@ Copyright:
|
|
|
339
349
|
License: Apache-2.0 and ISC
|
|
340
350
|
Comment: these files contain content from SAP and node-lru-cache: LRUPersistentCache.js is overall written by SAP, but portions ('Least Recently Used' logic) are taken from the node-lru-cache project (see https://github.com/isaacs/node-lru-cache/blob/v2.7.3/README.md) and modified.
|
|
341
351
|
|
|
352
|
+
Files: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
|
|
353
|
+
Copyright:
|
|
354
|
+
2009-2022 SAP SE or an SAP affiliate company and OpenUI5 contributors
|
|
355
|
+
Arthur David Olson, Paul Eggert and other contributors
|
|
356
|
+
License: Apache-2.0 and LicenseRef-tzdata-PublicDomain
|
|
357
|
+
Comment: these files contain content from SAP and Time Zone Database: _timezones.js is overall written by SAP, but the list of IANA timezone IDs is taken from the Timezone Database
|
|
358
|
+
|
|
342
359
|
|
|
343
360
|
# Library: sap.ui.documentation:
|
|
344
361
|
|
package/THIRDPARTY.txt
CHANGED
|
@@ -76,6 +76,12 @@ License: MIT
|
|
|
76
76
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
|
|
77
77
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/qunit-2.*
|
|
78
78
|
|
|
79
|
+
Component: QUnit 2.18, version: 2.18.0
|
|
80
|
+
Copyright: jQuery Foundation and other contributors
|
|
81
|
+
License: MIT
|
|
82
|
+
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
|
|
83
|
+
Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
|
|
84
|
+
|
|
79
85
|
Component: jQuery-Migrate, version: 3.3.1
|
|
80
86
|
Copyright: OpenJS Foundation and other contributors
|
|
81
87
|
License: MIT
|
|
@@ -191,13 +197,19 @@ License: BSD-3-Clause
|
|
|
191
197
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
|
|
192
198
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-4.js
|
|
193
199
|
|
|
200
|
+
Component: SinonJS 14, version: 14.0.0
|
|
201
|
+
Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
|
|
202
|
+
License: BSD-3-Clause
|
|
203
|
+
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
|
|
204
|
+
Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
|
|
205
|
+
|
|
194
206
|
Component: Sinon-qunit, version: 2.0.0
|
|
195
207
|
Copyright: 2010-2011, Christian Johansen
|
|
196
208
|
License: BSD-3-Clause
|
|
197
209
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
|
|
198
210
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
|
|
199
211
|
|
|
200
|
-
Component: URI.js, version: 1.19.
|
|
212
|
+
Component: URI.js, version: 1.19.11
|
|
201
213
|
Copyright: Rodney Rehm
|
|
202
214
|
License: MIT
|
|
203
215
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
|
|
@@ -315,6 +327,12 @@ License: ISC
|
|
|
315
327
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/ISC.txt
|
|
316
328
|
Contained in: src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
|
|
317
329
|
|
|
330
|
+
Component: Time Zone Database, version: 2022a
|
|
331
|
+
Copyright: Arthur David Olson, Paul Eggert and other contributors
|
|
332
|
+
License: LicenseRef-tzdata-PublicDomain
|
|
333
|
+
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/LicenseRef-tzdata-PublicDomain.txt
|
|
334
|
+
Contained in: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
|
|
335
|
+
|
|
318
336
|
|
|
319
337
|
Library: sap.ui.documentation:
|
|
320
338
|
|
|
@@ -450,7 +468,7 @@ License: Apache-2.0
|
|
|
450
468
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
451
469
|
Contained in: lib/jsdoc/ui5/plugin.js
|
|
452
470
|
|
|
453
|
-
Component: SAP Theming Base Content, version: 11.1.
|
|
471
|
+
Component: SAP Theming Base Content, version: 11.1.40
|
|
454
472
|
Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
|
|
455
473
|
License: Apache-2.0
|
|
456
474
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -980,6 +998,21 @@ END of license: LicenseRef-JSONinJSPublicDomain
|
|
|
980
998
|
=================================
|
|
981
999
|
|
|
982
1000
|
|
|
1001
|
+
=================================
|
|
1002
|
+
BEGIN of license: LicenseRef-tzdata-PublicDomain
|
|
1003
|
+
=================================
|
|
1004
|
+
|
|
1005
|
+
Unless specified below, all files in the tz code and data (including
|
|
1006
|
+
this LICENSE file) are in the public domain.
|
|
1007
|
+
|
|
1008
|
+
If the files date.c, newstrftime.3, and strftime.c are present, they
|
|
1009
|
+
contain material derived from BSD and use the BSD 3-clause license.
|
|
1010
|
+
|
|
1011
|
+
=================================
|
|
1012
|
+
END of license: LicenseRef-tzdata-PublicDomain
|
|
1013
|
+
=================================
|
|
1014
|
+
|
|
1015
|
+
|
|
983
1016
|
=================================
|
|
984
1017
|
BEGIN of license: MIT
|
|
985
1018
|
=================================
|
package/package.json
CHANGED
package/src/jquery.sap.global.js
CHANGED
|
@@ -67,7 +67,7 @@ sap.ui.define(['jquery.sap.global', 'sap/base/util/Properties'],
|
|
|
67
67
|
* {@link #setProperty} to store or change a value for a key and {@link #getKeys}
|
|
68
68
|
* can be used to retrieve an array of all keys that are currently stored in the collection.
|
|
69
69
|
*
|
|
70
|
-
* @version 1.
|
|
70
|
+
* @version 1.104.0
|
|
71
71
|
* @since 0.9.0
|
|
72
72
|
* @name jQuery.sap.util.Properties
|
|
73
73
|
* @public
|
package/src/jquery.sap.script.js
CHANGED
|
@@ -267,7 +267,7 @@ sap.ui.define([
|
|
|
267
267
|
* Use {@link jQuery.sap.getUriParameters} to create an instance of jQuery.sap.util.UriParameters.
|
|
268
268
|
*
|
|
269
269
|
* @author SAP SE
|
|
270
|
-
* @version 1.
|
|
270
|
+
* @version 1.104.0
|
|
271
271
|
* @since 0.9.0
|
|
272
272
|
* @name jQuery.sap.util.UriParameters
|
|
273
273
|
* @public
|
|
@@ -37,7 +37,7 @@ sap.ui.define([
|
|
|
37
37
|
* @param {string} [sIdPrefix] Prefix used for the Ids. If not set a default prefix is used.
|
|
38
38
|
* @returns {jQuery.sap.storage.Storage}
|
|
39
39
|
*
|
|
40
|
-
* @version 1.
|
|
40
|
+
* @version 1.104.0
|
|
41
41
|
* @since 0.11.0
|
|
42
42
|
* @namespace
|
|
43
43
|
* @public
|
|
@@ -97,7 +97,7 @@ sap.ui.define([
|
|
|
97
97
|
* should be deleted the method {@link #removeAll} should be used.
|
|
98
98
|
*
|
|
99
99
|
* @author SAP SE
|
|
100
|
-
* @version 1.
|
|
100
|
+
* @version 1.104.0
|
|
101
101
|
* @since 0.11.0
|
|
102
102
|
* @public
|
|
103
103
|
* @name jQuery.sap.storage.Storage
|
|
@@ -201,7 +201,7 @@ sap.ui.define([
|
|
|
201
201
|
* Enumeration of the storage types supported by {@link jQuery.sap.storage.Storage}
|
|
202
202
|
* @enum {string}
|
|
203
203
|
* @public
|
|
204
|
-
* @version 1.
|
|
204
|
+
* @version 1.104.0
|
|
205
205
|
* @since 0.11.0
|
|
206
206
|
*/
|
|
207
207
|
jQuery.sap.storage.Type = Storage.Type;
|
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
'sap/ui/
|
|
8
|
+
'sap/ui/util/XMLHelper',
|
|
9
9
|
'sap/base/Log',
|
|
10
10
|
'sap/base/assert',
|
|
11
|
-
'sap/base/util/extend'
|
|
11
|
+
'sap/base/util/extend',
|
|
12
|
+
'sap/base/util/mixedFetch'
|
|
12
13
|
], function(
|
|
13
|
-
|
|
14
|
+
XMLHelper,
|
|
14
15
|
Log,
|
|
15
16
|
assert,
|
|
16
|
-
extend
|
|
17
|
+
extend,
|
|
18
|
+
mixedFetch
|
|
17
19
|
) {
|
|
18
20
|
"use strict";
|
|
19
21
|
|
|
@@ -246,9 +248,7 @@ sap.ui.define([
|
|
|
246
248
|
var sType,
|
|
247
249
|
oData,
|
|
248
250
|
sUrl,
|
|
249
|
-
|
|
250
|
-
oDeferred,
|
|
251
|
-
fnDone,
|
|
251
|
+
fnDone = function() {},
|
|
252
252
|
iSyncCallBehavior;
|
|
253
253
|
|
|
254
254
|
if (LoaderExtensions.notifyResourceLoading) {
|
|
@@ -271,44 +271,30 @@ sap.ui.define([
|
|
|
271
271
|
|
|
272
272
|
assert(/^(xml|html|json|text)$/.test(sType), "type must be one of xml, html, json or text");
|
|
273
273
|
|
|
274
|
-
oDeferred = mOptions.async ? new jQuery.Deferred() : null;
|
|
275
|
-
|
|
276
|
-
function handleData(d, e) {
|
|
277
|
-
if (d == null && mOptions.failOnError) {
|
|
278
|
-
oError = e || new Error("no data returned for " + sResourceName);
|
|
279
|
-
if (mOptions.async) {
|
|
280
|
-
oDeferred.reject(oError);
|
|
281
|
-
Log.error(oError);
|
|
282
|
-
}
|
|
283
|
-
if (fnDone) {
|
|
284
|
-
fnDone();
|
|
285
|
-
}
|
|
286
|
-
return null;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (mOptions.async) {
|
|
290
|
-
oDeferred.resolve(d);
|
|
291
|
-
}
|
|
292
|
-
if (fnDone) {
|
|
293
|
-
fnDone();
|
|
294
|
-
}
|
|
295
|
-
return d;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
274
|
function convertData(d) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
275
|
+
switch (sType) {
|
|
276
|
+
case "json":
|
|
277
|
+
return JSON.parse(d);
|
|
278
|
+
case "xml":
|
|
279
|
+
return XMLHelper.parse(d);
|
|
280
|
+
default:
|
|
281
|
+
return d;
|
|
282
|
+
}
|
|
304
283
|
}
|
|
305
284
|
|
|
306
285
|
oData = sap.ui.loader._.getModuleContent(sResourceName, mOptions.url);
|
|
307
286
|
|
|
308
287
|
if (oData != undefined) {
|
|
288
|
+
// data available
|
|
309
289
|
oData = convertData(oData);
|
|
310
|
-
} else {
|
|
311
290
|
|
|
291
|
+
if (mOptions.async) {
|
|
292
|
+
return Promise.resolve(oData);
|
|
293
|
+
} else {
|
|
294
|
+
return oData;
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
// load data
|
|
312
298
|
iSyncCallBehavior = sap.ui.loader._.getSyncCallBehavior();
|
|
313
299
|
if (!mOptions.async && iSyncCallBehavior) {
|
|
314
300
|
if (iSyncCallBehavior >= 1) { // temp. raise a warning only
|
|
@@ -318,34 +304,56 @@ sap.ui.define([
|
|
|
318
304
|
}
|
|
319
305
|
}
|
|
320
306
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
headers: mOptions.headers,
|
|
326
|
-
success: function(data, textStatus, xhr) {
|
|
327
|
-
oData = handleData(data);
|
|
328
|
-
},
|
|
329
|
-
error: function(xhr, textStatus, error) {
|
|
330
|
-
oError = new Error("resource " + sResourceName + " could not be loaded from " + sUrl + ". Check for 'file not found' or parse errors. Reason: " + error);
|
|
331
|
-
oError.status = textStatus;
|
|
332
|
-
oError.error = error;
|
|
333
|
-
oError.statusCode = xhr.status;
|
|
334
|
-
oData = handleData(null, oError);
|
|
335
|
-
}
|
|
336
|
-
});
|
|
307
|
+
var oHeaders = {};
|
|
308
|
+
if (sType) {
|
|
309
|
+
oHeaders["Accept"] = mixedFetch.ContentTypes[sType.toUpperCase()];
|
|
310
|
+
}
|
|
337
311
|
|
|
338
|
-
|
|
312
|
+
sUrl = mOptions.url || sap.ui.loader._.getResourcePath(sResourceName);
|
|
313
|
+
|
|
314
|
+
var pResponse = mixedFetch(sUrl, {
|
|
315
|
+
headers: Object.assign(oHeaders, mOptions.headers)
|
|
316
|
+
}, !mOptions.async)
|
|
317
|
+
.then(function(response) {
|
|
318
|
+
if (response.ok) {
|
|
319
|
+
return response.text().then(function(responseText) {
|
|
320
|
+
return {
|
|
321
|
+
data: convertData(responseText)
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
var oError = new Error("resource " + sResourceName + " could not be loaded from " + sUrl +
|
|
326
|
+
". Check for 'file not found' or parse errors. Reason: " + response.statusText || response.status);
|
|
327
|
+
oError.status = response.statusText;
|
|
328
|
+
oError.statusCode = response.status;
|
|
329
|
+
throw oError;
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
.catch(function(error) {
|
|
333
|
+
return {
|
|
334
|
+
data: null,
|
|
335
|
+
error: error
|
|
336
|
+
};
|
|
337
|
+
})
|
|
338
|
+
.then(function(oInfo) {
|
|
339
|
+
fnDone();
|
|
339
340
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
if (oInfo.data !== null) {
|
|
342
|
+
return oInfo.data;
|
|
343
|
+
} else if (mOptions.failOnError) {
|
|
344
|
+
Log.error(oInfo.error);
|
|
345
|
+
throw oInfo.error;
|
|
346
|
+
} else {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
343
350
|
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
if (mOptions.async) {
|
|
352
|
+
return pResponse;
|
|
353
|
+
} else {
|
|
354
|
+
return pResponse.unwrap();
|
|
355
|
+
}
|
|
346
356
|
}
|
|
347
|
-
|
|
348
|
-
return oData;
|
|
349
357
|
};
|
|
350
358
|
|
|
351
359
|
/**
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([], function () {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
function parseHeaders(sAllResponseHeaders) {
|
|
10
|
+
var result = new Headers();
|
|
11
|
+
sAllResponseHeaders.trim().split("\r\n").forEach(function (sHeader) {
|
|
12
|
+
if (sHeader) {
|
|
13
|
+
var pos = sHeader.indexOf(": ");
|
|
14
|
+
if (pos > 0) {
|
|
15
|
+
result.append(sHeader.slice(0, pos), sHeader.slice(pos + 2));
|
|
16
|
+
} else {
|
|
17
|
+
result.append(sHeader, "");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents the response object to a {@link module:sap/base/util/fetch} request and {@link module:sap/base/util/syncFetch} request.
|
|
26
|
+
* The implementation is based on the Response interface of the global <code>fetch()</code> method,
|
|
27
|
+
* but brings a much reduced set of properties and methods.
|
|
28
|
+
*
|
|
29
|
+
* The properties that are provided:
|
|
30
|
+
* <ul>
|
|
31
|
+
* <li>The <code>headers</code> property containing the <code>Headers</code> object</li>
|
|
32
|
+
* <li>The <code>ok</code> property containing a boolean stating whether the response was successful</li>
|
|
33
|
+
* <li>The <code>status</code> property containing the HTTP status code</li>
|
|
34
|
+
* <li>The <code>statusText</code> property containing an HTTP status message</li>
|
|
35
|
+
* </ul>
|
|
36
|
+
*
|
|
37
|
+
* The methods that are provided:
|
|
38
|
+
* <ul>
|
|
39
|
+
* <li>The <code>json()</code> method returns a promise that resolves with the result of parsing the XHR response text as JSON</li>
|
|
40
|
+
* <li>The <code>text()</code> method returns a promise that resolves with the XHR response text as String</li>
|
|
41
|
+
* </ul>
|
|
42
|
+
*
|
|
43
|
+
* In case of a response to a synchronous <code>sap.base.util.syncFetch</code> request,
|
|
44
|
+
* all methods will return the XHR response directly, according to the respective output format.
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* @param {XMLHttpRequest} xhr The XMLHttpRequest object
|
|
48
|
+
* @param {Promise|sap.ui.base.SyncPromise} PromiseImpl A Promise for asynchronous requests, and
|
|
49
|
+
* an <code>sap.ui.base.SyncPromise</code> for synchronous requests.
|
|
50
|
+
* @interface
|
|
51
|
+
* @alias sap.base.util.SimpleResponse
|
|
52
|
+
* @private
|
|
53
|
+
* @ui5-restricted SAPUI5 Dist
|
|
54
|
+
*/
|
|
55
|
+
function SimpleResponse(xhr, PromiseImpl) {
|
|
56
|
+
this.xhr = xhr;
|
|
57
|
+
|
|
58
|
+
var headers = parseHeaders(this.xhr.getAllResponseHeaders());
|
|
59
|
+
Object.defineProperties(this, {
|
|
60
|
+
headers: {
|
|
61
|
+
value: headers
|
|
62
|
+
},
|
|
63
|
+
ok: {
|
|
64
|
+
value: this.xhr.status >= 200 && this.xhr.status < 300
|
|
65
|
+
},
|
|
66
|
+
status: {
|
|
67
|
+
value: this.xhr.status
|
|
68
|
+
},
|
|
69
|
+
statusText: {
|
|
70
|
+
value: this.xhr.statusText
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
this.json = function() {
|
|
75
|
+
if (this.xhr.responseType === "json") {
|
|
76
|
+
return PromiseImpl.resolve(this.xhr.response);
|
|
77
|
+
} else {
|
|
78
|
+
try {
|
|
79
|
+
var oData = JSON.parse(this.xhr.responseText);
|
|
80
|
+
return PromiseImpl.resolve(oData);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
return PromiseImpl.reject(err);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
this.text = function() {
|
|
88
|
+
return PromiseImpl.resolve(this.xhr.responseText);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Allowed request credentials
|
|
93
|
+
var ALLOWED_CREDENTIALS = ["include", "omit", "same-origin"];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Performs an asynchronous XMLHttpRequest (XHR) with the provided resource URL and request settings.
|
|
97
|
+
* It returns a Promise that resolves with an <code>sap.base.util.SimpleResponse</code> object, which is
|
|
98
|
+
* a simplified implementation of the global Response interface, representing the response of the XHR.
|
|
99
|
+
*
|
|
100
|
+
* If the request encounters network failures, the returned promise will be rejected with a <code>TypeError</code>.
|
|
101
|
+
* In case of an HTTP error status (e.g. error status 404), the returned promise will resolve instead.
|
|
102
|
+
* The <code>response.ok</code> or <code>response.status</code> flags can be used to distinguish
|
|
103
|
+
* a success status from an error status.
|
|
104
|
+
*
|
|
105
|
+
* The Promise will reject with a <code>DOMException</code> if the request gets aborted.
|
|
106
|
+
* To abort a request, an instance of the global <code>AbortSignal</code> must be provided to the settings via property <code>init.signal</code>.
|
|
107
|
+
* An abort signal can be created via an instance of the <code>AbortController</code>, and then using
|
|
108
|
+
* the <code>AbortController.signal</code> property. The signal associates the abort controller with the request
|
|
109
|
+
* and allows it to abort the XHR by calling <code>AbortController.abort()</code>.
|
|
110
|
+
*
|
|
111
|
+
* Although the usage of this method is very similar to the native <code>fetch()</code> method,
|
|
112
|
+
* it allows a much reduced set of request settings (in the <code>init</code> argument).
|
|
113
|
+
*
|
|
114
|
+
* @param {string} resource A string containing the URL to which the request is sent
|
|
115
|
+
* @param {object} [init] A set of key/value pairs that configure the request.
|
|
116
|
+
* @param {any} [init.body] Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams, string, or ReadableStream object.
|
|
117
|
+
* Note that a request using the GET or HEAD method cannot have a body.
|
|
118
|
+
* @param {"omit"|"same-origin"|"include"} [init.credentials='same-origin'] Controls what browsers do with credentials.
|
|
119
|
+
* Must be either 'omit', 'same-origin' or 'include'.
|
|
120
|
+
* @param {Headers|object} [init.headers] A Headers object or an object with key/value pairs containing the request headers
|
|
121
|
+
* @param {string} [init.method='GET'] The request method, e.g. 'GET', 'POST'
|
|
122
|
+
* @param {AbortSignal} [init.signal] An AbortSignal object instance which allows to abort the request
|
|
123
|
+
* @return {Promise<sap.base.util.SimpleResponse>} Returns a Promise resolving with <code>sap.base.util.SimpleResponse</code>
|
|
124
|
+
*
|
|
125
|
+
* @alias module:sap/base/util/fetch
|
|
126
|
+
* @private
|
|
127
|
+
* @ui5-restricted SAPUI5 Dist
|
|
128
|
+
*/
|
|
129
|
+
function fetch(resource, init, _mImplementations) {
|
|
130
|
+
/**
|
|
131
|
+
* see "https://developer.mozilla.org/en-US/docs/Web/API/Request/Request"
|
|
132
|
+
* regarding default values
|
|
133
|
+
*/
|
|
134
|
+
init = Object.assign({
|
|
135
|
+
body: null,
|
|
136
|
+
credentials: "same-origin",
|
|
137
|
+
method: "GET",
|
|
138
|
+
signal: new AbortController().signal
|
|
139
|
+
// mode: "cors",
|
|
140
|
+
// redirect: "follow",
|
|
141
|
+
// referrer: "about:client"
|
|
142
|
+
}, init);
|
|
143
|
+
|
|
144
|
+
// "sap/base/util/syncFetch" might pass a SyncPromise implementation
|
|
145
|
+
var PromiseImpl = (_mImplementations && _mImplementations.promiseImpl) || Promise;
|
|
146
|
+
|
|
147
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
148
|
+
// check for credentials in the resource URL
|
|
149
|
+
var oUrl = new URL(resource, document.baseURI);
|
|
150
|
+
if (oUrl.username || oUrl.password) {
|
|
151
|
+
reject(new TypeError("Failed to execute 'fetch': Request cannot be constructed from a URL that includes credentials:" + resource));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (init.body !== null && (init.method == "GET" || init.method == "HEAD")) {
|
|
155
|
+
reject(new TypeError("Failed to execute 'fetch': Request with GET/HEAD method cannot have body."));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var xhr = new XMLHttpRequest();
|
|
159
|
+
// event listener
|
|
160
|
+
xhr.addEventListener("load", function() {
|
|
161
|
+
var oResponse = new SimpleResponse(xhr, PromiseImpl);
|
|
162
|
+
|
|
163
|
+
if (_mImplementations && _mImplementations.responseMixin) {
|
|
164
|
+
_mImplementations.responseMixin.apply(oResponse);
|
|
165
|
+
}
|
|
166
|
+
resolve(oResponse);
|
|
167
|
+
});
|
|
168
|
+
xhr.addEventListener("error", function() {
|
|
169
|
+
reject(new TypeError("Failed to fetch."));
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
xhr.open(init.method, resource, _mImplementations ? false : true);
|
|
173
|
+
|
|
174
|
+
// see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort
|
|
175
|
+
init.signal.addEventListener("abort", function () {
|
|
176
|
+
xhr.abort();
|
|
177
|
+
reject(new DOMException("The user aborted a request.", "AbortError"));
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// set request headers
|
|
181
|
+
var oHeaders;
|
|
182
|
+
if (init.headers instanceof Headers) {
|
|
183
|
+
oHeaders = Object.fromEntries(init.headers);
|
|
184
|
+
} else {
|
|
185
|
+
oHeaders = init.headers || {};
|
|
186
|
+
}
|
|
187
|
+
Object.keys(oHeaders).forEach(function(key) {
|
|
188
|
+
xhr.setRequestHeader(key, oHeaders[key]);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// request credentials
|
|
192
|
+
if (ALLOWED_CREDENTIALS.includes(init.credentials)) {
|
|
193
|
+
// set credentials
|
|
194
|
+
if (init.credentials === "omit") {
|
|
195
|
+
xhr.withCredentials = false;
|
|
196
|
+
} else if (init.credentials === "include") {
|
|
197
|
+
xhr.withCredentials = true;
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
reject(new TypeError("Failed to execute 'fetch': Failed to read the 'credentials' property from 'RequestInit': The provided value " + init.credentials
|
|
201
|
+
+ " is not a valid enum value of type RequestCredentials."));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// send request
|
|
205
|
+
try {
|
|
206
|
+
xhr.send(init.body);
|
|
207
|
+
} catch (error) {
|
|
208
|
+
reject(new TypeError(error.message));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Header values that can be used with the "Accept" and "Content-Type" headers
|
|
215
|
+
* in the fetch call or the response object.
|
|
216
|
+
*
|
|
217
|
+
* @type {Object}
|
|
218
|
+
* @private
|
|
219
|
+
* @ui5-restricted SAPUI5 Dist
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
fetch.ContentTypes = {
|
|
223
|
+
TEXT: "text/plain",
|
|
224
|
+
HTML: "text/html",
|
|
225
|
+
XML: "application/xml, text/xml",
|
|
226
|
+
JSON: "application/json, text/javascript"
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
return fetch;
|
|
230
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 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
|
+
"./fetch",
|
|
8
|
+
"sap/ui/base/SyncPromise"
|
|
9
|
+
], function (fetch, SyncPromise) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Allows to perform an synchronous or asynchronous XMLHttpRequest (XHR) with the provided resource URL and request settings.
|
|
14
|
+
* It returns a Promise resolving with an <code>sap.base.util.SimpleResponse</code> object, which is
|
|
15
|
+
* a simplified implementation of the global Response interface, representing the response of the XHR.
|
|
16
|
+
* It returns a <code>sap.ui.base.SyncPromise</code>, if the property <code>init.sync</code> is set to 'true'.
|
|
17
|
+
*
|
|
18
|
+
* If the request encounters network failures, the returned promise will be rejected with a <code>TypeError</code>.
|
|
19
|
+
* In case of an HTTP error status (e.g. error status 404), the returned promise will resolve instead. The properties
|
|
20
|
+
* <code>response.ok</code> or <code>response.status</code> can be used to distinguish
|
|
21
|
+
* a success status from an error status.
|
|
22
|
+
*
|
|
23
|
+
* The Promise or SyncPromise will reject with a <code>DOMException</code> if the request gets aborted.
|
|
24
|
+
* To abort a request, an instance of the global <code>AbortSignal</code> must be provided to the settings.
|
|
25
|
+
* An abort signal can be created via an instance of the <code>AbortController</code>, and then using
|
|
26
|
+
* the <code>AbortController.signal</code> property. The signal associates the abort controller with the request
|
|
27
|
+
* and allows it to abort the XHR by calling <code>AbortController.abort()</code>.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} resource A string containing the URL to which the request is sent
|
|
30
|
+
* @param {object} [init] A set of key/value pairs that configure the request.
|
|
31
|
+
* @param {any} [init.body] Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams, string, or ReadableStream object.
|
|
32
|
+
* Note that a request using the GET or HEAD method cannot have a body.
|
|
33
|
+
* @param {"omit"|"same-origin"|"include"} [init.credentials='same-origin'] Controls what browsers do with credentials.
|
|
34
|
+
* Must be either 'omit', 'same-origin' or 'include'.
|
|
35
|
+
* @param {Headers|object} [init.headers] A Headers object or an object with key/value pairs containing the request headers
|
|
36
|
+
* @param {string} [init.method='GET'] The request method, e.g. 'GET', 'POST'
|
|
37
|
+
* @param {AbortSignal} [init.signal] An AbortSignal object instance which allows to abort the request
|
|
38
|
+
* @param {boolean} [bSync=false] Performs a synchronous XMLHttpRequest if set to 'true'
|
|
39
|
+
* @return {Promise<sap.base.util.SimpleResponse>|sap.ui.base.SyncPromise<sap.base.util.SimpleResponse>} Returns a Promise or SyncPromise resolving with an <code>sap.base.util.SimpleResponse</code> object
|
|
40
|
+
*
|
|
41
|
+
* @alias module:sap/base/util/mixedFetch
|
|
42
|
+
* @private
|
|
43
|
+
* @ui5-restricted sap.ui.core, sap.ui.model
|
|
44
|
+
*/
|
|
45
|
+
function mixedFetch(resource, init, bSync) {
|
|
46
|
+
var mImplementations;
|
|
47
|
+
|
|
48
|
+
if (bSync === true) {
|
|
49
|
+
mImplementations = {
|
|
50
|
+
promiseImpl: SyncPromise
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return fetch(resource, init, mImplementations);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Header values that can be used with the "Accept" and "Content-Type" headers
|
|
59
|
+
* in the fetch call or the response object.
|
|
60
|
+
*
|
|
61
|
+
* @type {Object}
|
|
62
|
+
* @private
|
|
63
|
+
* @ui5-restricted sap.ui.core
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
mixedFetch.ContentTypes = fetch.ContentTypes;
|
|
67
|
+
|
|
68
|
+
return mixedFetch;
|
|
69
|
+
});
|