@openui5/sap.ui.core 1.115.1 → 1.117.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/.dtsgenrc +18 -0
- package/.eslintrc.json +1 -11
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- 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.sjax.js +2 -2
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +106 -0
- package/src/sap/base/Eventing.js +319 -0
- package/src/sap/base/config/MemoryConfigurationProvider.js +10 -1
- package/src/sap/base/config.js +3 -2
- package/src/sap/base/i18n/Formatting.js +989 -0
- package/src/sap/base/i18n/LanguageTag.js +189 -0
- package/src/sap/base/i18n/Localization.js +710 -0
- package/src/sap/base/i18n/ResourceBundle.js +5 -20
- package/src/sap/base/i18n/date/CalendarType.js +54 -0
- package/src/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
- package/src/sap/base/i18n/date/TimezoneUtils.js +287 -0
- package/src/sap/base/util/JSTokenizer.js +1 -1
- package/src/sap/base/util/fetch.js +4 -4
- package/src/sap/base/util/mixedFetch.js +2 -2
- 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 +2 -2
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +6 -4
- package/src/sap/ui/base/EventProvider.js +4 -12
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +9 -15
- package/src/sap/ui/base/ManagedObjectMetadata.js +33 -12
- 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 +10 -5
- package/src/sap/ui/core/.library +3 -3
- package/src/sap/ui/core/AccessKeysEnablement.js +10 -5
- package/src/sap/ui/core/AnimationMode.js +49 -0
- package/src/sap/ui/core/BusyIndicator.js +33 -42
- package/src/sap/ui/core/CalendarType.js +11 -37
- package/src/sap/ui/core/Component.js +4 -5
- 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/ConfigTest.js +17 -0
- package/src/sap/ui/core/Configuration.js +409 -1282
- package/src/sap/ui/core/Control.js +7 -12
- package/src/sap/ui/core/ControlBehavior.js +157 -0
- package/src/sap/ui/core/Core.js +126 -132
- 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 +14 -3
- package/src/sap/ui/core/ElementMetadata.js +2 -4
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- 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/IconPool.js +1 -2
- 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 +5 -7
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +12 -12
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +126 -38
- 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 +154 -430
- package/src/sap/ui/core/LocaleData.js +50 -14
- package/src/sap/ui/core/Manifest.js +5 -5
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +37 -50
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/Rendering.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/Shortcut.js +11 -9
- package/src/sap/ui/core/StaticArea.js +31 -17
- package/src/sap/ui/core/Theming.js +458 -0
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +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/XMLTemplateProcessor.js +28 -5
- package/src/sap/ui/core/_IconRegistry.js +89 -12
- package/src/sap/ui/core/boot/_bootConfig.js +137 -0
- package/src/sap/ui/core/boot/_runBoot.js +16 -0
- package/src/sap/ui/core/boot/initDOM.js +96 -0
- package/src/sap/ui/core/boot/loadCalendar.js +50 -0
- package/src/sap/ui/core/boot/loadManifest.js +55 -0
- package/src/sap/ui/core/boot/loadModules.js +80 -0
- package/src/sap/ui/core/boot/manifest.json +11 -0
- package/src/sap/ui/core/boot/onInit.js +44 -0
- package/src/sap/ui/core/boot.js +107 -0
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +12 -83
- package/src/sap/ui/core/date/UI5Date.js +10 -4
- package/src/sap/ui/core/delegate/ItemNavigation.js +8 -10
- package/src/sap/ui/core/delegate/ScrollEnablement.js +5 -5
- 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 +33 -27
- package/src/sap/ui/core/format/TimezoneUtil.js +15 -273
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +32 -6
- 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/MessageMixin.js +6 -5
- 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 +57 -55
- package/src/sap/ui/core/messagebundle_bg.properties +57 -55
- package/src/sap/ui/core/messagebundle_ca.properties +30 -28
- package/src/sap/ui/core/messagebundle_cs.properties +44 -42
- package/src/sap/ui/core/messagebundle_cy.properties +59 -57
- package/src/sap/ui/core/messagebundle_da.properties +57 -55
- package/src/sap/ui/core/messagebundle_de.properties +59 -57
- package/src/sap/ui/core/messagebundle_el.properties +48 -46
- package/src/sap/ui/core/messagebundle_en.properties +59 -57
- package/src/sap/ui/core/messagebundle_en_GB.properties +59 -57
- package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +3 -0
- package/src/sap/ui/core/messagebundle_es.properties +48 -46
- package/src/sap/ui/core/messagebundle_es_MX.properties +58 -56
- package/src/sap/ui/core/messagebundle_et.properties +55 -53
- package/src/sap/ui/core/messagebundle_fi.properties +51 -49
- package/src/sap/ui/core/messagebundle_fr.properties +36 -34
- package/src/sap/ui/core/messagebundle_fr_CA.properties +21 -19
- package/src/sap/ui/core/messagebundle_hi.properties +42 -40
- package/src/sap/ui/core/messagebundle_hr.properties +57 -55
- package/src/sap/ui/core/messagebundle_hu.properties +58 -56
- package/src/sap/ui/core/messagebundle_id.properties +59 -57
- package/src/sap/ui/core/messagebundle_it.properties +75 -73
- package/src/sap/ui/core/messagebundle_iw.properties +59 -57
- package/src/sap/ui/core/messagebundle_ja.properties +50 -48
- package/src/sap/ui/core/messagebundle_kk.properties +44 -42
- package/src/sap/ui/core/messagebundle_ko.properties +20 -18
- package/src/sap/ui/core/messagebundle_lt.properties +59 -57
- package/src/sap/ui/core/messagebundle_lv.properties +59 -57
- package/src/sap/ui/core/messagebundle_ms.properties +60 -58
- package/src/sap/ui/core/messagebundle_nl.properties +58 -56
- package/src/sap/ui/core/messagebundle_no.properties +56 -54
- package/src/sap/ui/core/messagebundle_pl.properties +56 -54
- package/src/sap/ui/core/messagebundle_pt.properties +58 -56
- package/src/sap/ui/core/messagebundle_pt_PT.properties +58 -56
- package/src/sap/ui/core/messagebundle_ro.properties +59 -57
- package/src/sap/ui/core/messagebundle_ru.properties +57 -55
- package/src/sap/ui/core/messagebundle_sh.properties +59 -57
- package/src/sap/ui/core/messagebundle_sk.properties +57 -55
- package/src/sap/ui/core/messagebundle_sl.properties +58 -56
- package/src/sap/ui/core/messagebundle_sv.properties +54 -52
- package/src/sap/ui/core/messagebundle_th.properties +18 -16
- package/src/sap/ui/core/messagebundle_tr.properties +58 -56
- package/src/sap/ui/core/messagebundle_uk.properties +59 -57
- package/src/sap/ui/core/messagebundle_vi.properties +59 -57
- package/src/sap/ui/core/messagebundle_zh_CN.properties +58 -56
- package/src/sap/ui/core/messagebundle_zh_TW.properties +58 -56
- 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 +14 -2
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +14 -16
- 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/HashChanger.js +1 -0
- package/src/sap/ui/core/routing/Route.js +1 -0
- package/src/sap/ui/core/routing/Router.js +3 -1
- package/src/sap/ui/core/rules/Config.support.js +2 -2
- package/src/sap/ui/core/rules/Misc.support.js +1 -1
- package/src/sap/ui/core/rules/Model.support.js +3 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -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 +7 -4
- package/src/sap/ui/core/support/controls/TimelineOverview.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
- 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 +1 -1
- package/src/sap/ui/core/themes/base/Icon.less +2 -2
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +4 -4
- package/src/sap/ui/core/themes/base/base.less +41 -20
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +6 -10
- package/src/sap/ui/core/theming/ThemeManager.js +312 -450
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +5 -10
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +4 -5
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +3 -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 +1 -1
- package/src/sap/ui/events/PseudoEvents.js +17 -9
- package/src/sap/ui/model/Binding.js +19 -15
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeBinding.js +57 -19
- 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 +42 -1
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +5 -4
- package/src/sap/ui/model/PropertyBinding.js +10 -0
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +4 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +166 -79
- package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +4 -3
- package/src/sap/ui/model/analytics/BatchResponseCollector.js +2 -2
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +14 -27
- package/src/sap/ui/model/analytics/odata4analytics.js +6 -12
- package/src/sap/ui/model/base/ManagedObjectModel.js +3 -2
- package/src/sap/ui/model/json/JSONModel.js +6 -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 +191 -5
- package/src/sap/ui/model/odata/ODataMetadata.js +38 -4
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- 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 +8 -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 +3 -3
- 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 +3 -2
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +14 -3
- package/src/sap/ui/model/odata/v2/ODataModel.js +46 -32
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/AnnotationHelper.js +4 -4
- package/src/sap/ui/model/odata/v4/Context.js +39 -32
- package/src/sap/ui/model/odata/v4/ODataBinding.js +85 -52
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +23 -19
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +139 -50
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +30 -36
- package/src/sap/ui/model/odata/v4/ODataModel.js +49 -44
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +72 -37
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +34 -29
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +95 -9
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +25 -27
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +95 -209
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +168 -1
- package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +14 -5
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +34 -19
- package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa5.js +1 -1
- package/src/sap/ui/test/TestUtils.js +1 -1
- package/src/sap/ui/test/autowaiter/_autoWaiter.js +1 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +1 -3
- package/src/sap/ui/test/gherkin/simpleGherkinParser.js +10 -5
- package/src/sap/ui/test/matchers/LabelFor.js +1 -0
- package/src/sap/ui/test/matchers/_Visitor.js +6 -1
- package/src/sap/ui/test/starter/_setupAndStart.js +2 -5
- package/src/sap/ui/thirdparty/caja-html-sanitizer.js +111 -96
- package/src/sap/ui/thirdparty/qunit-2.js +9 -3
- package/src/sap/ui/util/ActivityDetection.js +7 -1
- package/src/sap/ui/util/Mobile.js +21 -14
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap-ui-boot.js +23 -6
- package/src/ui5-boot.js +50 -0
- package/src/ui5loader-autoconfig.js +150 -75
- package/src/ui5loader.js +458 -514
- package/test/sap/ui/core/Device.js +1 -1
- package/test/sap/ui/core/FormatHelper.js +3 -2
- package/test/sap/ui/core/demokit/docuindex.json +6 -0
- package/test/sap/ui/core/demokit/sample/OpaAction/applicationUnderTest/view/Main.view.xml +1 -0
- package/test/sap/ui/core/demokit/sample/OpaBusyIndicator/OpaBusyIndicator.js +1 -1
- package/test/sap/ui/core/demokit/sample/OpaMatchers/OpaMatchers.js +2 -2
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/MIT.ODataTypes.html +9 -14
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Opa.qunit.js +7 -0
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Template.controller.js +2 -2
- package/test/sap/ui/core/demokit/sample/common/pages/Any.js +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v2/AutoExpand/AutoExpand.view.xml +24 -5
- package/test/sap/ui/core/demokit/sample/odata/v4/Ancestry/Main.view.xml +24 -6
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/DataAggregation.view.xml +20 -5
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/tests/filter.js +2 -2
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Component.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.controller.js +43 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.view.xml +47 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.controller.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.view.xml +7 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/NotFound.view.xml +8 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.controller.js +123 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.view.xml +92 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.html +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.js +70 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/README.html +55 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/SandboxModel.js +56 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/POST-SalesOrderList.json +66 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000')-SO_2_SOITEM.json +57 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000').json +20 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000001').json +9 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000007')-SO_2_BP.json +12 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList.json +62 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.json +85 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.xml +185 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.json +93 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.xml +262 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/metadata.xml +1779 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/manifest.json +134 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/pages/Main.js +119 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/Draft/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FieldGroups/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FlatDataAggregation/FlatDataAggregation.view.xml +4 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FlexibleColumnLayout/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/GridTable/GridTable.view.xml +12 -3
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Main.controller.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Opa.OptimisticBatch.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ListBinding/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ListBindingTemplate/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/pages/Main.js +0 -41
- package/test/sap/ui/core/demokit/sample/odata/v4/Products/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/RecursiveHierarchy/RecursiveHierarchy.view.xml +26 -8
- package/test/sap/ui/core/demokit/sample/odata/v4/RecursiveHierarchy/data/metadata.xml +4 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Main.controller.js +5 -17
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/pages/Main.js +18 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/tests/Create.js +10 -6
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersRTATest/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersRTATest/manifest.json +18 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersTemplate/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Main.view.xml +3 -3
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/pages/Main.js +4 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/Sticky/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/tutorial/odatav4/06/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/06/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/07/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/07/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/demokit/tutorial/odatav4/09/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/09/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/10/webapp/controller/App.controller.js +3 -8
- package/test/sap/ui/core/demokit/tutorial/odatav4/10/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/controller/App.controller.js +3 -8
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/qunit/CompositeBinding.qunit.js +25 -7
- package/test/sap/ui/core/qunit/ControlRenderer.qunit.js +86 -2
- package/test/sap/ui/core/qunit/DataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/HTML.qunit.js +31 -31
- package/test/sap/ui/core/qunit/IconPool.qunit.js +53 -4
- package/test/sap/ui/core/qunit/Lib.qunit.js +55 -2
- package/test/sap/ui/core/qunit/LocalBusyIndicator.qunit.js +22 -15
- package/test/sap/ui/core/qunit/ManagedObject.qunit.js +5 -3
- package/test/sap/ui/core/qunit/ManagedObjectModel.qunit.js +43 -5
- package/test/sap/ui/core/qunit/Object.qunit.js +4 -1
- package/test/sap/ui/core/qunit/ThemeManager.qunit.js +2 -2
- package/test/sap/ui/core/qunit/ThemeParameters.qunit.js +9 -3
- package/test/sap/ui/core/qunit/Theming.beforeBootstrap.qunit.js +13 -0
- package/test/sap/ui/core/qunit/Theming.qunit.js +247 -0
- package/test/sap/ui/core/qunit/analytics/AnalyticalBinding.qunit.js +510 -185
- package/test/sap/ui/core/qunit/analytics/AnalyticalTreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/analytics/ODataModelAdapter.qunit.js +81 -16
- package/test/sap/ui/core/qunit/analytics/odata4analytics.qunit.js +20 -29
- package/test/sap/ui/core/qunit/app/MessageListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/base/Config_cascade.qunit.js +18 -1
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.html +24 -0
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.js +277 -0
- package/test/sap/ui/core/qunit/base/i18n/Localization.qunit.js +282 -0
- package/test/sap/ui/core/qunit/base/i18n/ResourceBundle.qunit.js +5 -6
- package/test/sap/ui/core/qunit/base/security/sanitizeHTML.qunit.js +17 -0
- package/test/sap/ui/core/qunit/bootstrap/BootstrapPreload.qunit.js +1 -2
- package/test/sap/ui/core/qunit/bootstrap/BootstrapWithCustomBootTask.beforeBootstrap.qunit.js +13 -12
- package/test/sap/ui/core/qunit/bootstrap/Configuration.main.qunit.js +11 -0
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.html +4 -3
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.js +451 -281
- package/test/sap/ui/core/qunit/bootstrap/ThemeVersion.qunit.js +19 -30
- package/test/sap/ui/core/qunit/component/Models.qunit.js +12 -30
- package/test/sap/ui/core/qunit/component/Models_unavoidablySync.qunit.js +8 -26
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/sync/Component.js +2 -6
- package/test/sap/ui/core/qunit/component/testdata/customizing/customersub/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/inherit/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inherit/parent/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/other/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/terminologies/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component1/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component2/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component3/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component5/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/reuse/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/v1/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1empty/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v1missing/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v2/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2asyncRootView/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2empty/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2missing/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2version/Component.js +2 -2
- package/test/sap/ui/core/qunit/dnd/DragDropInfo.qunit.js +1 -2
- package/test/sap/ui/core/qunit/generic/EnforceSemanticRendering.qunit.js +2 -2
- package/test/sap/ui/core/qunit/generic/SettersContextReturn.qunit.js +2 -2
- package/test/sap/ui/core/qunit/generic/legacy/ControlMemoryLeaks.qunit.js +2 -0
- package/test/sap/ui/core/qunit/generic/legacy/DuplicateIdCheck.qunit.js +2 -0
- package/test/sap/ui/core/qunit/generic/legacy/SettersContextReturn.qunit.js +2 -2
- package/test/sap/ui/core/qunit/gherkin/dataTableUtils.qunit.js +2 -2
- package/test/sap/ui/core/qunit/i18n/Locale.qunit.js +0 -52
- package/test/sap/ui/core/qunit/i18n/LocaleData.qunit.js +49 -14
- package/test/sap/ui/core/qunit/i18n/UI5Date.qunit.js +16 -4
- package/test/sap/ui/core/qunit/i18n/UniversalDate.qunit.js +74 -114
- package/test/sap/ui/core/qunit/i18n/UniversalDateUtils.qunit.js +34 -39
- package/test/sap/ui/core/qunit/i18n/testsuite.i18n.qunit.js +18 -0
- package/test/sap/ui/core/qunit/internal/1RingModels.qunit.js +1 -0
- package/test/sap/ui/core/qunit/internal/BeforePush.ODataV4.js +28 -0
- package/test/sap/ui/core/qunit/internal/BeforePush.html +1 -0
- package/test/sap/ui/core/qunit/internal/BeforePush.js +15 -0
- package/test/sap/ui/core/qunit/internal/performance/ExpressionParser.performance.qunit.js +1 -0
- package/test/sap/ui/core/qunit/json/JSONListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/json/JSONPropertyBinding.qunit.js +7 -12
- package/test/sap/ui/core/qunit/json/JSONTwoWay.qunit.js +3 -8
- package/test/sap/ui/core/qunit/loader/asyncMode.qunit.js +2 -2
- package/test/sap/ui/core/qunit/loader/asyncMode_unavoidablySync.qunit.js +1 -1
- package/test/sap/ui/core/qunit/loader/fixture/amd-with-export-true/module1.js +2 -2
- package/test/sap/ui/core/qunit/loader/testsuite.loader.qunit.js +0 -3
- package/test/sap/ui/core/qunit/messages/MessageMixin.qunit.js +2 -7
- package/test/sap/ui/core/qunit/messages/messagesUsage.qunit.js +1 -1
- package/test/sap/ui/core/qunit/model/Binding.qunit.js +36 -11
- package/test/sap/ui/core/qunit/model/ClientListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ClientTreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/CompositeDataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ContextBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/FAR_CUSTOMER_LINE_ITEMS.metadata.xml +2 -0
- package/test/sap/ui/core/qunit/model/ListBinding.qunit.js +63 -6
- package/test/sap/ui/core/qunit/model/Model.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/PropertyBinding.qunit.js +40 -0
- package/test/sap/ui/core/qunit/model/TreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/TreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/mvc/XMLTemplateProcessorRequireXML.qunit.js +51 -0
- package/test/sap/ui/core/qunit/mvc/XMLView.qunit.js +9 -8
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions.qunit.js +4 -4
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions_legacy.qunit.js +4 -4
- package/test/sap/ui/core/qunit/mvc/testdata/Async.view.xml +1 -1
- package/test/sap/ui/core/qunit/mvc/testdata/AsyncTypedView.js +5 -1
- package/test/sap/ui/core/qunit/odata/AnnotationParserNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/ODataMessageParser.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/ODataMessageParserNoFakeService.qunit.js +2 -8
- package/test/sap/ui/core/qunit/odata/ODataMetadataNoFakeService.qunit.js +68 -9
- package/test/sap/ui/core/qunit/odata/type/DateTimeBase.qunit.js +24 -0
- package/test/sap/ui/core/qunit/odata/v2/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataContextBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataListBindingNoFakeService.qunit.js +31 -17
- package/test/sap/ui/core/qunit/odata/v2/ODataModel.integration.qunit.js +260 -56
- package/test/sap/ui/core/qunit/odata/v2/ODataModelNoFakeService.qunit.js +70 -15
- package/test/sap/ui/core/qunit/odata/v2/ODataPropertyBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingFlatNoFakeService.qunit.js +4 -9
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/V2ODataModel.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/v2/_CreatedContextsCache.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v4/AnnotationHelper.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/v4/Context.qunit.js +55 -22
- package/test/sap/ui/core/qunit/odata/v4/ODataBinding.qunit.js +184 -151
- package/test/sap/ui/core/qunit/odata/v4/ODataContextBinding.qunit.js +60 -30
- package/test/sap/ui/core/qunit/odata/v4/ODataListBinding.qunit.js +305 -69
- package/test/sap/ui/core/qunit/odata/v4/ODataMetaModel.qunit.js +20 -69
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.integration.qunit.js +1282 -255
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.qunit.js +90 -61
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.realOData.qunit.js +0 -3
- package/test/sap/ui/core/qunit/odata/v4/ODataParentBinding.qunit.js +283 -170
- package/test/sap/ui/core/qunit/odata/v4/ODataPropertyBinding.qunit.js +103 -78
- package/test/sap/ui/core/qunit/odata/v4/data/metadata.json +2 -1
- package/test/sap/ui/core/qunit/odata/v4/data/metadata.xml +4 -0
- package/test/sap/ui/core/qunit/odata/v4/data/metadata_special_cases.xml +2 -0
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationCache.qunit.js +151 -1
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationHelper.qunit.js +24 -11
- package/test/sap/ui/core/qunit/odata/v4/lib/_Cache.qunit.js +279 -458
- package/test/sap/ui/core/qunit/odata/v4/lib/_Helper.qunit.js +204 -3
- package/test/sap/ui/core/qunit/odata/v4/lib/_MetadataRequestor.qunit.js +7 -3
- package/test/sap/ui/core/qunit/odata/v4/lib/_Requestor.qunit.js +145 -26
- package/test/sap/ui/core/qunit/odata/v4/testsuite.odatav4.qunit.js +4 -0
- package/test/sap/ui/core/qunit/opa/_LogCollector.qunit.js +1 -1
- package/test/sap/ui/core/qunit/opa/matchers/LabelFor.qunit.js +4 -2
- package/test/sap/ui/core/qunit/opa/matchers/_Busy.qunit.js +129 -2
- package/test/sap/ui/core/qunit/opa/matchers/_Editable.qunit.js +5 -1
- package/test/sap/ui/core/qunit/performance/trace/FESR.qunit.js +5 -0
- package/test/sap/ui/core/qunit/resource/ResourceModel.qunit.js +17 -37
- package/test/sap/ui/core/qunit/routing/HashChanger.qunit.js +1 -6
- package/test/sap/ui/core/qunit/routing/RouterHashChanger.qunit.js +1 -10
- package/test/sap/ui/core/qunit/routing/async/Router.qunit.js +1 -22
- package/test/sap/ui/core/qunit/routing/async/Target.qunit.js +1 -4
- package/test/sap/ui/core/qunit/routing/fixture/Async1.view.xml +1 -1
- package/test/sap/ui/core/qunit/rule/model/modelSupport.qunit.js +34 -1
- package/test/sap/ui/core/qunit/testdata/fastnavigation/view/FastNavigation.view.xml +2 -2
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/i18n.properties +1 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/manifest.json +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/messagebundle.properties +1 -0
- package/test/sap/ui/core/qunit/testdata/xml-require/helper/Formatter.js +7 -4
- package/test/sap/ui/core/qunit/testdata/xml-require/view/XMLTemplateProcessorAsync_require_in_html.view.xml +36 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.databinding.qunit.js +3 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.theming.qunit.js +29 -0
- package/test/sap/ui/core/qunit/types/DateFormatTimezones.qunit.js +1381 -1570
- package/test/sap/ui/core/qunit/types/SimpleType.qunit.js +16 -2
- package/test/sap/ui/core/qunit/types/Types.qunit.js +2 -37
- package/test/sap/ui/core/qunit/types/testsuite.types.qunit.js +1 -1
- package/test/sap/ui/core/qunit/util/Popup.qunit.js +7 -11
- package/test/sap/ui/core/qunit/util/SyncPromise.qunit.js +4 -1
- package/test/sap/ui/core/qunit/util/XMLPreprocessor.qunit.js +3 -1
- package/test/sap/ui/core/qunit/util/jQuery.sap.Version.qunit.js +3 -0
- package/test/sap/ui/core/qunit/util/jQuery.sap.measure.qunit.js +16 -11
- package/test/sap/ui/core/qunit/util/reflection/BaseTreeModifier.qunit.js +1 -1
- package/test/sap/ui/core/qunit/xml/XMLListBinding.qunit.js +1 -3
- package/test/sap/ui/core/qunit/xml/XMLModel.qunit.js +4 -14
- package/test/sap/ui/core/qunit/xml/XMLPropertyBinding.qunit.js +7 -11
- package/test/sap/ui/core/qunit/xml/XMLTreeBinding.qunit.js +1 -1
- package/test/sap/ui/core/qunit/xml/XMLTwoWay.qunit.js +3 -7
- package/test/sap/ui/core/relnotes/changes-1.115.json +1 -37
- package/test/sap/ui/core/relnotes/changes-1.116.json +71 -0
- package/test/sap/ui/core/relnotes/changes-1.117.json +127 -0
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/firstItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/initial.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/lastItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/leftDownBtn-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/myButtonSample-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/rightDownBtn-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/HyphenationPlayground/windows/1600x1200/chrome/horizon/ltr/cozy/19_thirdParty_language_sl.ref.lnk +1 -1
- package/test/testsuite/js/samples.js +2 -0
- package/ui5.yaml +166 -1
- package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +0 -45
- /package/test/sap/ui/core/qunit/bootstrap/{GlobalConfigurationSettings.js → Configuration.beforeBootstrap.qunit.js} +0 -0
package/src/ui5loader.js
CHANGED
|
@@ -15,27 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
/*global sap:true, Blob, console, document, Promise, URL, XMLHttpRequest */
|
|
17
17
|
|
|
18
|
-
(function(__global) {
|
|
19
|
-
"use strict";
|
|
20
|
-
if ( __global.Promise === undefined || !__global.Promise.prototype.finally || __global.URLSearchParams === undefined ) {
|
|
21
|
-
var page = document.documentElement, pageStyle = page.style,
|
|
22
|
-
msg = "Microsoft Internet Explorer 11 and other legacy browsers are no longer supported. For more information, see ",
|
|
23
|
-
hrefText = "Internet Explorer 11 will no longer be supported by various SAP UI technologies in newer releases",
|
|
24
|
-
href = "https://blogs.sap.com/2021/02/02/internet-explorer-11-will-no-longer-be-supported-by-various-sap-ui-technologies-in-newer-releases/";
|
|
25
|
-
|
|
26
|
-
page.innerHTML = '<body style="margin:0;padding:0;overflow-y:hidden;background-color:#f7f7f7;text-align:center;width:100%;position:absolute;top:50%;transform:translate(0,-50%);"><div style="color:#32363a;font-family:Arial,Helvetica,sans-serif;font-size:.875rem;">' +
|
|
27
|
-
msg + '<a href="' + href + '" style="color:#4076b4;">' + hrefText + '</a>.</div></body>';
|
|
28
|
-
pageStyle.margin = pageStyle.padding = "0";
|
|
29
|
-
pageStyle.width = pageStyle.height = "100%";
|
|
30
|
-
if (__global.stop) { // Check for __global.stop first because Safari 11 has __global.stop and document.execCommand but document.execCommand('Stop') does not work in Safari 11
|
|
31
|
-
__global.stop();
|
|
32
|
-
} else {
|
|
33
|
-
document.execCommand('Stop');
|
|
34
|
-
}
|
|
35
|
-
throw new Error(msg + href);
|
|
36
|
-
}
|
|
37
|
-
}(window));
|
|
38
|
-
|
|
39
18
|
(function(__global) {
|
|
40
19
|
"use strict";
|
|
41
20
|
|
|
@@ -46,7 +25,7 @@
|
|
|
46
25
|
* @returns {string}
|
|
47
26
|
*/
|
|
48
27
|
function pathOnly(href) {
|
|
49
|
-
|
|
28
|
+
const p = href.search(/[?#]/);
|
|
50
29
|
return p < 0 ? href : href.slice(0, p);
|
|
51
30
|
}
|
|
52
31
|
|
|
@@ -72,19 +51,8 @@
|
|
|
72
51
|
|
|
73
52
|
function noop() {}
|
|
74
53
|
|
|
75
|
-
var aEarlyLogs = [];
|
|
76
|
-
|
|
77
|
-
function earlyLog(level, message) {
|
|
78
|
-
aEarlyLogs.push({
|
|
79
|
-
level: level,
|
|
80
|
-
message: message
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
54
|
function forEach(obj, callback) {
|
|
85
|
-
Object.keys(obj).forEach(
|
|
86
|
-
callback(key, obj[key]);
|
|
87
|
-
});
|
|
55
|
+
Object.keys(obj).forEach((key) => callback(key, obj[key]));
|
|
88
56
|
}
|
|
89
57
|
|
|
90
58
|
function executeInSeparateTask(fn) {
|
|
@@ -97,6 +65,15 @@
|
|
|
97
65
|
|
|
98
66
|
// ---- hooks & configuration -----------------------------------------------------------------
|
|
99
67
|
|
|
68
|
+
const aEarlyLogs = [];
|
|
69
|
+
|
|
70
|
+
function earlyLog(level, message) {
|
|
71
|
+
aEarlyLogs.push({
|
|
72
|
+
level,
|
|
73
|
+
message
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
100
77
|
/**
|
|
101
78
|
* Log functionality.
|
|
102
79
|
*
|
|
@@ -110,7 +87,7 @@
|
|
|
110
87
|
* @private
|
|
111
88
|
*/
|
|
112
89
|
|
|
113
|
-
|
|
90
|
+
let log = {
|
|
114
91
|
debug: earlyLog.bind(this, 'debug'),
|
|
115
92
|
info: earlyLog.bind(this, 'info'),
|
|
116
93
|
warning: earlyLog.bind(this, 'warning'),
|
|
@@ -129,7 +106,7 @@
|
|
|
129
106
|
* @type {function(any,string)}
|
|
130
107
|
* @private
|
|
131
108
|
*/
|
|
132
|
-
|
|
109
|
+
let assert = noop; // Null Object pattern: dummy assert which is used as long as no assert is injected
|
|
133
110
|
|
|
134
111
|
/**
|
|
135
112
|
* Callback for performance measurement.
|
|
@@ -138,7 +115,7 @@
|
|
|
138
115
|
* @type {{start:function(string,any),end:function(string)}}
|
|
139
116
|
* @private
|
|
140
117
|
*/
|
|
141
|
-
|
|
118
|
+
let measure;
|
|
142
119
|
|
|
143
120
|
/**
|
|
144
121
|
* Source code transformation hook.
|
|
@@ -146,7 +123,7 @@
|
|
|
146
123
|
* To be used by code coverage, only supported in sync mode.
|
|
147
124
|
* @private
|
|
148
125
|
*/
|
|
149
|
-
|
|
126
|
+
let translate;
|
|
150
127
|
|
|
151
128
|
/**
|
|
152
129
|
* Method used by sap.ui.require to simulate asynchronous behavior.
|
|
@@ -155,14 +132,14 @@
|
|
|
155
132
|
* Can be changed to execute in a micro task to save idle time in case of
|
|
156
133
|
* many nested sap.ui.require calls.
|
|
157
134
|
*/
|
|
158
|
-
|
|
135
|
+
let simulateAsyncCallback = executeInSeparateTask;
|
|
159
136
|
|
|
160
137
|
/*
|
|
161
138
|
* Activates strictest possible compliance with AMD spec
|
|
162
139
|
* - no multiple executions of the same module
|
|
163
140
|
* - at most one anonymous module definition per file, zero for adhoc definitions
|
|
164
141
|
*/
|
|
165
|
-
|
|
142
|
+
const strictModuleDefinitions = true;
|
|
166
143
|
|
|
167
144
|
/**
|
|
168
145
|
* Whether asynchronous loading can be used at all.
|
|
@@ -170,7 +147,7 @@
|
|
|
170
147
|
* @type {boolean}
|
|
171
148
|
* @private
|
|
172
149
|
*/
|
|
173
|
-
|
|
150
|
+
let bGlobalAsyncMode = false;
|
|
174
151
|
|
|
175
152
|
|
|
176
153
|
/**
|
|
@@ -179,7 +156,7 @@
|
|
|
179
156
|
* @type {boolean}
|
|
180
157
|
* @private
|
|
181
158
|
*/
|
|
182
|
-
|
|
159
|
+
let bExposeAsAMDLoader = false;
|
|
183
160
|
|
|
184
161
|
/**
|
|
185
162
|
* How the loader should react to calls of sync APIs or when global names are accessed:
|
|
@@ -189,7 +166,7 @@
|
|
|
189
166
|
* @type {int}
|
|
190
167
|
* @private
|
|
191
168
|
*/
|
|
192
|
-
|
|
169
|
+
let syncCallBehavior = 0;
|
|
193
170
|
|
|
194
171
|
/**
|
|
195
172
|
* Default base URL for modules, used when no other configuration is provided.
|
|
@@ -199,7 +176,7 @@
|
|
|
199
176
|
* @type {string}
|
|
200
177
|
* @private
|
|
201
178
|
*/
|
|
202
|
-
|
|
179
|
+
const DEFAULT_BASE_URL = "./";
|
|
203
180
|
|
|
204
181
|
/**
|
|
205
182
|
* Temporarily saved reference to the original value of the global define variable.
|
|
@@ -207,7 +184,7 @@
|
|
|
207
184
|
* @type {any}
|
|
208
185
|
* @private
|
|
209
186
|
*/
|
|
210
|
-
|
|
187
|
+
let vOriginalDefine;
|
|
211
188
|
|
|
212
189
|
/**
|
|
213
190
|
* Temporarily saved reference to the original value of the global require variable.
|
|
@@ -215,7 +192,7 @@
|
|
|
215
192
|
* @type {any}
|
|
216
193
|
* @private
|
|
217
194
|
*/
|
|
218
|
-
|
|
195
|
+
let vOriginalRequire;
|
|
219
196
|
|
|
220
197
|
|
|
221
198
|
/**
|
|
@@ -226,7 +203,7 @@
|
|
|
226
203
|
* @type {Object<string,{url:string,absoluteUrl:string}>}
|
|
227
204
|
* @private
|
|
228
205
|
*/
|
|
229
|
-
|
|
206
|
+
const mUrlPrefixes = Object.create(null);
|
|
230
207
|
mUrlPrefixes[''] = {
|
|
231
208
|
url: DEFAULT_BASE_URL,
|
|
232
209
|
absoluteUrl: resolveURL(DEFAULT_BASE_URL)
|
|
@@ -242,7 +219,7 @@
|
|
|
242
219
|
* @type {Object.<string,Object.<string,string>>}
|
|
243
220
|
* @private
|
|
244
221
|
*/
|
|
245
|
-
|
|
222
|
+
const mMaps = Object.create(null);
|
|
246
223
|
|
|
247
224
|
/**
|
|
248
225
|
* Information about third party modules, keyed by the module's resource name (including extension '.js').
|
|
@@ -266,7 +243,7 @@
|
|
|
266
243
|
* @type {Object.<string,{amd:boolean,exports:(string|string[]),deps:string[]}>}
|
|
267
244
|
* @private
|
|
268
245
|
*/
|
|
269
|
-
|
|
246
|
+
const mShims = Object.create(null);
|
|
270
247
|
|
|
271
248
|
/**
|
|
272
249
|
* Dependency Cache information.
|
|
@@ -274,14 +251,14 @@
|
|
|
274
251
|
* @type {Object.<string,string[]>}
|
|
275
252
|
* @private
|
|
276
253
|
*/
|
|
277
|
-
|
|
254
|
+
const mDepCache = Object.create(null);
|
|
278
255
|
|
|
279
256
|
/**
|
|
280
257
|
* Whether the loader should try to load debug sources.
|
|
281
258
|
* @type {boolean}
|
|
282
259
|
* @private
|
|
283
260
|
*/
|
|
284
|
-
|
|
261
|
+
let bDebugSources = false;
|
|
285
262
|
|
|
286
263
|
/**
|
|
287
264
|
* Indicates partial or total debug mode.
|
|
@@ -291,7 +268,7 @@
|
|
|
291
268
|
* @type {function(string):boolean|undefined}
|
|
292
269
|
* @private
|
|
293
270
|
*/
|
|
294
|
-
|
|
271
|
+
let fnIgnorePreload;
|
|
295
272
|
|
|
296
273
|
|
|
297
274
|
// ---- internal state ------------------------------------------------------------------------
|
|
@@ -302,7 +279,7 @@
|
|
|
302
279
|
* @type {Object<string,Module>}
|
|
303
280
|
* @private
|
|
304
281
|
*/
|
|
305
|
-
|
|
282
|
+
const mModules = Object.create(null);
|
|
306
283
|
|
|
307
284
|
/**
|
|
308
285
|
* Whether (sap.ui.)define calls must be executed synchronously in the current context.
|
|
@@ -316,35 +293,35 @@
|
|
|
316
293
|
* synchronously.
|
|
317
294
|
* Most prominent example: unit tests that include QUnitUtils as a script tag and use qutils
|
|
318
295
|
* in one of their inline scripts.
|
|
319
|
-
* @type {boolean}
|
|
296
|
+
* @type {boolean|null}
|
|
320
297
|
* @private
|
|
321
298
|
*/
|
|
322
|
-
|
|
299
|
+
let bForceSyncDefines = null;
|
|
323
300
|
|
|
324
301
|
/**
|
|
325
302
|
* Stack of modules that are currently being executed in case of synchronous processing.
|
|
326
303
|
*
|
|
327
304
|
* Allows to identify the executing module (e.g. when resolving dependencies or in case of
|
|
328
|
-
*
|
|
305
|
+
* bundles like sap-ui-core).
|
|
329
306
|
*
|
|
330
307
|
* @type {Array.<{name:string,used:boolean}>}
|
|
331
308
|
* @private
|
|
332
309
|
*/
|
|
333
|
-
|
|
310
|
+
const _execStack = [ ];
|
|
334
311
|
|
|
335
312
|
/**
|
|
336
313
|
* A prefix that will be added to module loading log statements and which reflects the nesting of module executions.
|
|
337
314
|
* @type {string}
|
|
338
315
|
* @private
|
|
339
316
|
*/
|
|
340
|
-
|
|
317
|
+
let sLogPrefix = "";
|
|
341
318
|
|
|
342
319
|
/**
|
|
343
320
|
* Counter used to give anonymous modules a unique module ID.
|
|
344
321
|
* @type {int}
|
|
345
322
|
* @private
|
|
346
323
|
*/
|
|
347
|
-
|
|
324
|
+
let iAnonymousModuleCount = 0;
|
|
348
325
|
|
|
349
326
|
// ---- break preload execution into tasks ----------------------------------------------------
|
|
350
327
|
|
|
@@ -353,33 +330,33 @@
|
|
|
353
330
|
*
|
|
354
331
|
* A value of -1 switched the scheduling off, a value of zero postpones each execution
|
|
355
332
|
*/
|
|
356
|
-
|
|
333
|
+
const DEFAULT_MAX_TASK_DURATION = -1; // off
|
|
357
334
|
|
|
358
335
|
/**
|
|
359
336
|
* Maximum accumulated task execution time (threshold)
|
|
360
337
|
* Can be configured via the private API property `maxTaskDuration`.
|
|
361
338
|
*/
|
|
362
|
-
|
|
339
|
+
let iMaxTaskDuration = DEFAULT_MAX_TASK_DURATION;
|
|
363
340
|
|
|
364
341
|
/**
|
|
365
342
|
* The earliest elapsed time at which a new browser task will be enforced.
|
|
366
343
|
* Will be updated when a new task starts.
|
|
367
344
|
*/
|
|
368
|
-
|
|
345
|
+
let iMaxTaskTime = Date.now() + iMaxTaskDuration;
|
|
369
346
|
|
|
370
347
|
/**
|
|
371
348
|
* A promise that fulfills when the new browser task has been reached.
|
|
372
349
|
* All postponed callback executions will be executed after this promise.
|
|
373
350
|
* `null` as long as the elapsed time threshold is not reached.
|
|
374
351
|
*/
|
|
375
|
-
|
|
352
|
+
let pWaitForNextTask;
|
|
376
353
|
|
|
377
354
|
/**
|
|
378
355
|
* Message channel which will be used to create a new browser task
|
|
379
356
|
* without being subject to timer throttling.
|
|
380
357
|
* Will be created lazily on first usage.
|
|
381
358
|
*/
|
|
382
|
-
|
|
359
|
+
let oNextTaskMessageChannel;
|
|
383
360
|
|
|
384
361
|
/**
|
|
385
362
|
* Update elapsed time threshold.
|
|
@@ -399,7 +376,7 @@
|
|
|
399
376
|
function updateMaxTaskDuration(v) {
|
|
400
377
|
v = Number(v);
|
|
401
378
|
|
|
402
|
-
|
|
379
|
+
const iBeginOfCurrentTask = iMaxTaskTime - iMaxTaskDuration;
|
|
403
380
|
|
|
404
381
|
// limit to range [-1 ... Infinity], any other value incl. NaN restores the default
|
|
405
382
|
iMaxTaskDuration = v >= -1 ? v : DEFAULT_MAX_TASK_DURATION;
|
|
@@ -510,8 +487,9 @@
|
|
|
510
487
|
}
|
|
511
488
|
|
|
512
489
|
function urnToIDAndType(sResourceName) {
|
|
513
|
-
|
|
514
|
-
|
|
490
|
+
const basenamePos = sResourceName.lastIndexOf('/');
|
|
491
|
+
const dotPos = sResourceName.lastIndexOf('.');
|
|
492
|
+
|
|
515
493
|
if ( dotPos > basenamePos ) {
|
|
516
494
|
return {
|
|
517
495
|
id: sResourceName.slice(0, dotPos),
|
|
@@ -524,10 +502,10 @@
|
|
|
524
502
|
};
|
|
525
503
|
}
|
|
526
504
|
|
|
527
|
-
|
|
505
|
+
const rJSSubTypes = /(\.controller|\.fragment|\.view|\.designtime|\.support)?.js$/;
|
|
528
506
|
|
|
529
507
|
function urnToBaseIDAndSubType(sResourceName) {
|
|
530
|
-
|
|
508
|
+
const m = rJSSubTypes.exec(sResourceName);
|
|
531
509
|
if ( m ) {
|
|
532
510
|
return {
|
|
533
511
|
baseID: sResourceName.slice(0, m.index),
|
|
@@ -536,8 +514,8 @@
|
|
|
536
514
|
}
|
|
537
515
|
}
|
|
538
516
|
|
|
539
|
-
|
|
540
|
-
|
|
517
|
+
const rDotSegmentAnywhere = /(?:^|\/)\.+(?=\/|$)/;
|
|
518
|
+
const rDotSegment = /^\.*$/;
|
|
541
519
|
|
|
542
520
|
/**
|
|
543
521
|
* Normalizes a resource name by resolving any relative name segments.
|
|
@@ -564,10 +542,7 @@
|
|
|
564
542
|
*/
|
|
565
543
|
function normalize(sResourceName, sBaseName) {
|
|
566
544
|
|
|
567
|
-
|
|
568
|
-
aSegments,
|
|
569
|
-
sSegment,
|
|
570
|
-
i,j,l;
|
|
545
|
+
const p = sResourceName.search(rDotSegmentAnywhere);
|
|
571
546
|
|
|
572
547
|
// check whether the name needs to be resolved at all - if not, just return the sModuleName as it is.
|
|
573
548
|
if ( p < 0 ) {
|
|
@@ -583,12 +558,14 @@
|
|
|
583
558
|
sResourceName = sBaseName.slice(0, sBaseName.lastIndexOf('/') + 1) + sResourceName;
|
|
584
559
|
}
|
|
585
560
|
|
|
586
|
-
aSegments = sResourceName.split('/');
|
|
561
|
+
const aSegments = sResourceName.split('/');
|
|
587
562
|
|
|
588
563
|
// process path segments
|
|
589
|
-
|
|
564
|
+
let j = 0;
|
|
565
|
+
const l = aSegments.length;
|
|
566
|
+
for (let i = 0; i < l; i++) {
|
|
590
567
|
|
|
591
|
-
sSegment = aSegments[i];
|
|
568
|
+
const sSegment = aSegments[i];
|
|
592
569
|
|
|
593
570
|
if ( rDotSegment.test(sSegment) ) {
|
|
594
571
|
if (sSegment === '.' || sSegment === '') {
|
|
@@ -629,14 +606,14 @@
|
|
|
629
606
|
if ( sResourceNamePrefix ) {
|
|
630
607
|
if ( mUrlPrefixes[sResourceNamePrefix] ) {
|
|
631
608
|
delete mUrlPrefixes[sResourceNamePrefix];
|
|
632
|
-
log.info(
|
|
609
|
+
log.info(`registerResourcePath ('${sResourceNamePrefix}') (registration removed)`);
|
|
633
610
|
}
|
|
634
611
|
return;
|
|
635
612
|
}
|
|
636
613
|
|
|
637
614
|
// otherwise restore the default
|
|
638
615
|
sUrlPrefix = DEFAULT_BASE_URL;
|
|
639
|
-
log.info(
|
|
616
|
+
log.info(`registerResourcePath ('${sResourceNamePrefix}') (default registration restored)`);
|
|
640
617
|
|
|
641
618
|
}
|
|
642
619
|
|
|
@@ -665,9 +642,8 @@
|
|
|
665
642
|
*/
|
|
666
643
|
function getResourcePath(sResourceName, sSuffix) {
|
|
667
644
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
sPath;
|
|
645
|
+
let sNamePrefix = sResourceName;
|
|
646
|
+
let p = sResourceName.length;
|
|
671
647
|
|
|
672
648
|
// search for a registered name prefix, starting with the full name and successively removing one segment
|
|
673
649
|
while ( p > 0 && !mUrlPrefixes[sNamePrefix] ) {
|
|
@@ -678,7 +654,7 @@
|
|
|
678
654
|
|
|
679
655
|
assert((p > 0 || sNamePrefix === '') && mUrlPrefixes[sNamePrefix], "there always must be a mapping");
|
|
680
656
|
|
|
681
|
-
sPath = mUrlPrefixes[sNamePrefix].url + sResourceName.slice(p + 1); // also skips a leading slash!
|
|
657
|
+
let sPath = mUrlPrefixes[sNamePrefix].url + sResourceName.slice(p + 1); // also skips a leading slash!
|
|
682
658
|
|
|
683
659
|
//remove trailing slash
|
|
684
660
|
if ( sPath.slice(-1) === '/' ) {
|
|
@@ -712,31 +688,27 @@
|
|
|
712
688
|
* @private
|
|
713
689
|
*/
|
|
714
690
|
function guessResourceName(sURL, bLoadedResourcesOnly) {
|
|
715
|
-
var sNamePrefix,
|
|
716
|
-
sUrlPrefix,
|
|
717
|
-
sResourceName;
|
|
718
|
-
|
|
719
691
|
// Make sure to have an absolute URL without query parameters or hash
|
|
720
692
|
// to check against absolute prefix URLs
|
|
721
693
|
sURL = pathOnly(resolveURL(sURL));
|
|
722
694
|
|
|
723
|
-
for (sNamePrefix in mUrlPrefixes) {
|
|
695
|
+
for (const sNamePrefix in mUrlPrefixes) {
|
|
724
696
|
|
|
725
697
|
// Note: configured URL prefixes are guaranteed to end with a '/'
|
|
726
698
|
// But to support the legacy scenario promoted by the application tools ( "registerModulePath('Application','Application')" )
|
|
727
699
|
// the prefix check here has to be done without the slash
|
|
728
|
-
sUrlPrefix = mUrlPrefixes[sNamePrefix].absoluteUrl.slice(0, -1);
|
|
700
|
+
const sUrlPrefix = mUrlPrefixes[sNamePrefix].absoluteUrl.slice(0, -1);
|
|
729
701
|
|
|
730
|
-
if ( sURL.
|
|
702
|
+
if ( sURL.startsWith(sUrlPrefix) ) {
|
|
731
703
|
|
|
732
704
|
// calc resource name
|
|
733
|
-
sResourceName = sNamePrefix + sURL.slice(sUrlPrefix.length);
|
|
705
|
+
let sResourceName = sNamePrefix + sURL.slice(sUrlPrefix.length);
|
|
734
706
|
// remove a leading '/' (occurs if name prefix is empty and if match was a full segment match
|
|
735
707
|
if ( sResourceName.charAt(0) === '/' ) {
|
|
736
708
|
sResourceName = sResourceName.slice(1);
|
|
737
709
|
}
|
|
738
710
|
|
|
739
|
-
if ( !bLoadedResourcesOnly || mModules[sResourceName]
|
|
711
|
+
if ( !bLoadedResourcesOnly || mModules[sResourceName]?.data != undefined ) {
|
|
740
712
|
return sResourceName;
|
|
741
713
|
}
|
|
742
714
|
}
|
|
@@ -749,7 +721,7 @@
|
|
|
749
721
|
* @returns {Object<string,string>|undefined} Most specific map or <code>undefined</code>
|
|
750
722
|
*/
|
|
751
723
|
function findMapForContext(sContext) {
|
|
752
|
-
|
|
724
|
+
let p, mMap;
|
|
753
725
|
if ( sContext != null ) {
|
|
754
726
|
// maps are defined on module IDs, reduce URN to module ID
|
|
755
727
|
sContext = urnToIDAndType(sContext).id;
|
|
@@ -769,8 +741,7 @@
|
|
|
769
741
|
|
|
770
742
|
function getMappedName(sResourceName, sRequestingResourceName) {
|
|
771
743
|
|
|
772
|
-
|
|
773
|
-
sPrefix, p;
|
|
744
|
+
const mMap = findMapForContext(sRequestingResourceName);
|
|
774
745
|
|
|
775
746
|
// resolve relative names
|
|
776
747
|
sResourceName = normalize(sResourceName, sRequestingResourceName);
|
|
@@ -778,8 +749,8 @@
|
|
|
778
749
|
// if there's a map, search for the most specific matching entry
|
|
779
750
|
if ( mMap != null ) {
|
|
780
751
|
// start with the full ID and successively remove one segment
|
|
781
|
-
sPrefix = urnToIDAndType(sResourceName).id;
|
|
782
|
-
p = sPrefix.length;
|
|
752
|
+
let sPrefix = urnToIDAndType(sResourceName).id;
|
|
753
|
+
let p = sPrefix.length;
|
|
783
754
|
while ( p > 0 && mMap[sPrefix] == null ) {
|
|
784
755
|
p = sPrefix.lastIndexOf('/');
|
|
785
756
|
// Note: an empty segment at p = 0 (leading slash) will be ignored
|
|
@@ -787,10 +758,11 @@
|
|
|
787
758
|
}
|
|
788
759
|
|
|
789
760
|
if ( p > 0 ) {
|
|
761
|
+
const sMappedResourceName = mMap[sPrefix] + sResourceName.slice(p);
|
|
790
762
|
if ( log.isLoggable() ) {
|
|
791
|
-
log.debug(
|
|
763
|
+
log.debug(`module ID ${sResourceName} mapped to ${sMappedResourceName}`);
|
|
792
764
|
}
|
|
793
|
-
return
|
|
765
|
+
return sMappedResourceName; // also skips a leading slash!
|
|
794
766
|
}
|
|
795
767
|
}
|
|
796
768
|
|
|
@@ -798,7 +770,7 @@
|
|
|
798
770
|
}
|
|
799
771
|
|
|
800
772
|
function getGlobalObject(oObject, aNames, l, bCreate) {
|
|
801
|
-
for (
|
|
773
|
+
for (let i = 0; oObject && i < l; i++) {
|
|
802
774
|
if (!oObject[aNames[i]] && bCreate ) {
|
|
803
775
|
oObject[aNames[i]] = {};
|
|
804
776
|
}
|
|
@@ -808,7 +780,7 @@
|
|
|
808
780
|
}
|
|
809
781
|
|
|
810
782
|
function getGlobalProperty(sName) {
|
|
811
|
-
|
|
783
|
+
const aNames = sName ? sName.split(".") : [];
|
|
812
784
|
|
|
813
785
|
if ( syncCallBehavior && aNames.length > 1 ) {
|
|
814
786
|
log.error("[nosync] getGlobalProperty called to retrieve global name '" + sName + "'");
|
|
@@ -818,10 +790,10 @@
|
|
|
818
790
|
}
|
|
819
791
|
|
|
820
792
|
function setGlobalProperty(sName, vValue) {
|
|
821
|
-
|
|
822
|
-
|
|
793
|
+
const aNames = sName ? sName.split(".") : [];
|
|
794
|
+
|
|
823
795
|
if ( aNames.length > 0 ) {
|
|
824
|
-
oObject = getGlobalObject(__global, aNames, aNames.length - 1, true);
|
|
796
|
+
const oObject = getGlobalObject(__global, aNames, aNames.length - 1, true);
|
|
825
797
|
oObject[aNames[aNames.length - 1]] = vValue;
|
|
826
798
|
}
|
|
827
799
|
}
|
|
@@ -839,7 +811,7 @@
|
|
|
839
811
|
/**
|
|
840
812
|
* Module neither has been required nor preloaded nor declared, but someone asked for it.
|
|
841
813
|
*/
|
|
842
|
-
|
|
814
|
+
const INITIAL = 0,
|
|
843
815
|
|
|
844
816
|
/**
|
|
845
817
|
* Module has been preloaded, but not required or declared.
|
|
@@ -879,7 +851,7 @@
|
|
|
879
851
|
/**
|
|
880
852
|
* A module/resource as managed by the module system.
|
|
881
853
|
*
|
|
882
|
-
* Each module
|
|
854
|
+
* Each module has the following properties
|
|
883
855
|
* <ul>
|
|
884
856
|
* <li>{int} state one of the module states defined in this function</li>
|
|
885
857
|
* <li>{string} url URL where the module has been loaded from</li>
|
|
@@ -888,193 +860,187 @@
|
|
|
888
860
|
* <li>{string} error an error description for state <code>FAILED</code></li>
|
|
889
861
|
* <li>{any} content the content of the module as exported via define()<(li>
|
|
890
862
|
* </ul>
|
|
891
|
-
*
|
|
892
|
-
* @param {string} name Name of the module, including extension
|
|
893
863
|
*/
|
|
894
|
-
|
|
895
|
-
this.name = name;
|
|
896
|
-
this.state = INITIAL;
|
|
897
|
-
/*
|
|
898
|
-
* Whether processing of the module is complete.
|
|
899
|
-
* This is very similar to, but not the same as state >= READY because declareModule() sets state=READY very early.
|
|
900
|
-
* That state transition is 'legacy' from the library-all files; it needs to be checked whether it can be removed.
|
|
901
|
-
*/
|
|
902
|
-
this.settled = false;
|
|
903
|
-
this.url =
|
|
904
|
-
this._deferred =
|
|
905
|
-
this.data =
|
|
906
|
-
this.group =
|
|
907
|
-
this.error =
|
|
908
|
-
this.pending = null;
|
|
909
|
-
this.content = NOT_YET_DETERMINED;
|
|
910
|
-
}
|
|
864
|
+
class Module {
|
|
911
865
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
866
|
+
/**
|
|
867
|
+
* Creates a new Module.
|
|
868
|
+
*
|
|
869
|
+
* @param {string} name Name of the module, including extension
|
|
870
|
+
*/
|
|
871
|
+
constructor(name) {
|
|
872
|
+
this.name = name;
|
|
873
|
+
this.state = INITIAL;
|
|
874
|
+
/*
|
|
875
|
+
* Whether processing of the module is complete.
|
|
876
|
+
* This is very similar to, but not the same as state >= READY because declareModule() sets state=READY very early.
|
|
877
|
+
* That state transition is 'legacy' from the library-all files; it needs to be checked whether it can be removed.
|
|
878
|
+
*/
|
|
879
|
+
this.settled = false;
|
|
880
|
+
this.url =
|
|
881
|
+
this._deferred =
|
|
882
|
+
this.data =
|
|
883
|
+
this.group =
|
|
884
|
+
this.error =
|
|
885
|
+
this.pending = null;
|
|
886
|
+
this.content = NOT_YET_DETERMINED;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
deferred() {
|
|
890
|
+
if ( this._deferred == null ) {
|
|
891
|
+
const deferred = this._deferred = {};
|
|
892
|
+
deferred.promise = new Promise(function(resolve,reject) {
|
|
893
|
+
deferred.resolve = resolve;
|
|
894
|
+
deferred.reject = reject;
|
|
895
|
+
});
|
|
896
|
+
// avoid 'Uncaught (in promise)' log entries
|
|
897
|
+
deferred.promise.catch(noop);
|
|
898
|
+
}
|
|
899
|
+
return this._deferred;
|
|
921
900
|
}
|
|
922
|
-
return this._deferred;
|
|
923
|
-
};
|
|
924
901
|
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
this._exports = {};
|
|
928
|
-
this._api = {
|
|
902
|
+
api() {
|
|
903
|
+
this._api ??= {
|
|
929
904
|
id: this.name.slice(0,-3),
|
|
930
|
-
exports: this._exports,
|
|
905
|
+
exports: this._exports = {},
|
|
931
906
|
url: this.url,
|
|
932
907
|
config: noop
|
|
933
908
|
};
|
|
909
|
+
return this._api;
|
|
934
910
|
}
|
|
935
|
-
return this._api;
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* Sets the module state to READY and either determines the value or sets
|
|
940
|
-
* it from the given parameter.
|
|
941
|
-
* @param {any} value Module value
|
|
942
|
-
*/
|
|
943
|
-
Module.prototype.ready = function(value) {
|
|
944
|
-
// should throw, but some tests and apps would fail
|
|
945
|
-
assert(!this.settled, "Module " + this.name + " is already settled");
|
|
946
|
-
this.state = READY;
|
|
947
|
-
this.settled = true;
|
|
948
|
-
if ( arguments.length > 0 ) {
|
|
949
|
-
// check arguments.length to allow a value of undefined
|
|
950
|
-
this.content = value;
|
|
951
|
-
}
|
|
952
|
-
this.deferred().resolve(wrapExport(this.value()));
|
|
953
|
-
if ( this.aliases ) {
|
|
954
|
-
value = this.value();
|
|
955
|
-
this.aliases.forEach(function(alias) {
|
|
956
|
-
Module.get(alias).ready(value);
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
911
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
912
|
+
/**
|
|
913
|
+
* Sets the module state to READY and either determines the value or sets
|
|
914
|
+
* it from the given parameter.
|
|
915
|
+
* @param {any} value Module value
|
|
916
|
+
*/
|
|
917
|
+
ready(value) {
|
|
918
|
+
// should throw, but some tests and apps would fail
|
|
919
|
+
assert(!this.settled, `Module ${this.name} is already settled`);
|
|
920
|
+
this.state = READY;
|
|
921
|
+
this.settled = true;
|
|
922
|
+
if ( arguments.length > 0 ) {
|
|
923
|
+
// check arguments.length to allow a value of undefined
|
|
924
|
+
this.content = value;
|
|
925
|
+
}
|
|
926
|
+
this.deferred().resolve(wrapExport(this.value()));
|
|
975
927
|
if ( this.aliases ) {
|
|
976
|
-
this.
|
|
977
|
-
|
|
978
|
-
});
|
|
928
|
+
value = this.value();
|
|
929
|
+
this.aliases.forEach((alias) => Module.get(alias).ready(value));
|
|
979
930
|
}
|
|
980
931
|
}
|
|
981
|
-
};
|
|
982
932
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
933
|
+
failWith(msg, cause) {
|
|
934
|
+
const err = makeModuleError(msg, this, cause);
|
|
935
|
+
this.fail(err);
|
|
936
|
+
return err;
|
|
937
|
+
}
|
|
986
938
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
939
|
+
fail(err) {
|
|
940
|
+
// should throw, but some tests and apps would fail
|
|
941
|
+
assert(!this.settled, `Module ${this.name} is already settled`);
|
|
942
|
+
this.settled = true;
|
|
943
|
+
if ( this.state !== FAILED ) {
|
|
944
|
+
this.state = FAILED;
|
|
945
|
+
this.error = err;
|
|
946
|
+
this.deferred().reject(err);
|
|
947
|
+
this.aliases?.forEach((alias) => Module.get(alias).fail(err));
|
|
948
|
+
}
|
|
949
|
+
}
|
|
992
950
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
this.state = PRELOADED;
|
|
996
|
-
this.url = url;
|
|
997
|
-
this.data = data;
|
|
998
|
-
this.group = bundle;
|
|
951
|
+
addPending(sDependency) {
|
|
952
|
+
(this.pending ??= []).push(sDependency);
|
|
999
953
|
}
|
|
1000
|
-
return this;
|
|
1001
|
-
};
|
|
1002
954
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
* @returns {any} Export of the module or <code>undefined</code>
|
|
1009
|
-
* @private
|
|
1010
|
-
*/
|
|
1011
|
-
Module.prototype.value = function() {
|
|
955
|
+
addAlias(sAliasName) {
|
|
956
|
+
(this.aliases ??= []).push(sAliasName);
|
|
957
|
+
// add this module as pending dependency to the original
|
|
958
|
+
Module.get(sAliasName).addPending(this.name);
|
|
959
|
+
}
|
|
1012
960
|
|
|
1013
|
-
|
|
1014
|
-
if ( this.
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
var oShim = mShims[this.name],
|
|
1020
|
-
sExport = oShim && (Array.isArray(oShim.exports) ? oShim.exports[0] : oShim.exports);
|
|
1021
|
-
// best guess for thirdparty modules or legacy modules that don't use sap.ui.define
|
|
1022
|
-
this.content = getGlobalProperty( sExport || urnToUI5(this.name) );
|
|
961
|
+
preload(url, data, bundle) {
|
|
962
|
+
if ( this.state === INITIAL && !fnIgnorePreload?.(this.name) ) {
|
|
963
|
+
this.state = PRELOADED;
|
|
964
|
+
this.url = url;
|
|
965
|
+
this.data = data;
|
|
966
|
+
this.group = bundle;
|
|
1023
967
|
}
|
|
1024
|
-
return this
|
|
968
|
+
return this;
|
|
1025
969
|
}
|
|
1026
970
|
|
|
1027
|
-
|
|
1028
|
-
|
|
971
|
+
/**
|
|
972
|
+
* Determines the value of this module.
|
|
973
|
+
*
|
|
974
|
+
* If the module hasn't been loaded or executed yet, <code>undefined</code> will be returned.
|
|
975
|
+
*
|
|
976
|
+
* @returns {any} Export of the module or <code>undefined</code>
|
|
977
|
+
* @private
|
|
978
|
+
*/
|
|
979
|
+
value() {
|
|
980
|
+
if ( this.state === READY ) {
|
|
981
|
+
if ( this.content === NOT_YET_DETERMINED ) {
|
|
982
|
+
// Determine the module value lazily.
|
|
983
|
+
// For AMD modules this has already been done on execution of the factory function.
|
|
984
|
+
// For other modules that are required synchronously, it has been done after execution.
|
|
985
|
+
// For the few remaining scenarios (like global scripts), it is done here
|
|
986
|
+
const oShim = mShims[this.name],
|
|
987
|
+
sExport = oShim && (Array.isArray(oShim.exports) ? oShim.exports[0] : oShim.exports);
|
|
988
|
+
// best guess for thirdparty modules or legacy modules that don't use sap.ui.define
|
|
989
|
+
this.content = getGlobalProperty( sExport || urnToUI5(this.name) );
|
|
990
|
+
}
|
|
991
|
+
return this.content;
|
|
992
|
+
}
|
|
1029
993
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
*
|
|
1033
|
-
* When a module definition (define) is executed, the requested dependencies are added
|
|
1034
|
-
* as 'pending' to the Module instance. This function checks if the oDependantModule is
|
|
1035
|
-
* reachable from this module when following the pending dependency information.
|
|
1036
|
-
*
|
|
1037
|
-
* Note: when module aliases are introduced (all module definitions in a file use an ID that differs
|
|
1038
|
-
* from the request module ID), then the alias module is also added as a "pending" dependency.
|
|
1039
|
-
*
|
|
1040
|
-
* @param {Module} oDependantModule Module which has a dependency to <code>oModule</code>
|
|
1041
|
-
* @returns {boolean} Whether this module depends on the given one.
|
|
1042
|
-
* @private
|
|
1043
|
-
*/
|
|
1044
|
-
Module.prototype.dependsOn = function(oDependantModule) {
|
|
1045
|
-
var dependant = oDependantModule.name,
|
|
1046
|
-
visited = Object.create(null);
|
|
994
|
+
return undefined;
|
|
995
|
+
}
|
|
1047
996
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
997
|
+
/**
|
|
998
|
+
* Checks whether this module depends on the given module.
|
|
999
|
+
*
|
|
1000
|
+
* When a module definition (define) is executed, the requested dependencies are added
|
|
1001
|
+
* as 'pending' to the Module instance. This function checks if the oDependantModule is
|
|
1002
|
+
* reachable from this module when following the pending dependency information.
|
|
1003
|
+
*
|
|
1004
|
+
* Note: when module aliases are introduced (all module definitions in a file use an ID that differs
|
|
1005
|
+
* from the request module ID), then the alias module is also added as a "pending" dependency.
|
|
1006
|
+
*
|
|
1007
|
+
* @param {Module} oDependantModule Module which has a dependency to <code>oModule</code>
|
|
1008
|
+
* @returns {boolean} Whether this module depends on the given one.
|
|
1009
|
+
* @private
|
|
1010
|
+
*/
|
|
1011
|
+
dependsOn(oDependantModule) {
|
|
1012
|
+
const dependant = oDependantModule.name,
|
|
1013
|
+
visited = Object.create(null);
|
|
1014
|
+
|
|
1015
|
+
// log.debug("checking for a cycle between", this.name, "and", dependant);
|
|
1016
|
+
function visit(mod) {
|
|
1017
|
+
if ( !visited[mod] ) {
|
|
1018
|
+
// log.debug(" ", mod);
|
|
1019
|
+
visited[mod] = true;
|
|
1020
|
+
const pending = mModules[mod]?.pending;
|
|
1021
|
+
return Array.isArray(pending) &&
|
|
1022
|
+
(pending.indexOf(dependant) >= 0 || pending.some(visit));
|
|
1023
|
+
}
|
|
1024
|
+
return false;
|
|
1056
1025
|
}
|
|
1057
|
-
return false;
|
|
1058
|
-
}
|
|
1059
1026
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1027
|
+
return this.name === dependant || visit(this.name);
|
|
1028
|
+
}
|
|
1062
1029
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
mModules[sModuleName] = new Module(sModuleName);
|
|
1030
|
+
/**
|
|
1031
|
+
* Find or create a module by its unified resource name.
|
|
1032
|
+
*
|
|
1033
|
+
* If the module doesn't exist yet, a new one is created in state INITIAL.
|
|
1034
|
+
*
|
|
1035
|
+
* @param {string} sModuleName Name of the module in URN syntax
|
|
1036
|
+
* @returns {Module} Module with that name, newly created if it didn't exist yet
|
|
1037
|
+
*/
|
|
1038
|
+
static get(sModuleName) {
|
|
1039
|
+
const oModule = mModules[sModuleName] ??= new Module(sModuleName);
|
|
1040
|
+
return oModule;
|
|
1075
1041
|
}
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1042
|
+
|
|
1043
|
+
}
|
|
1078
1044
|
|
|
1079
1045
|
/*
|
|
1080
1046
|
* Determines the currently executing module.
|
|
@@ -1083,12 +1049,12 @@
|
|
|
1083
1049
|
if ( _execStack.length > 0 ) {
|
|
1084
1050
|
return _execStack[_execStack.length - 1].name;
|
|
1085
1051
|
}
|
|
1086
|
-
return document.currentScript
|
|
1052
|
+
return document.currentScript?.getAttribute("data-sap-ui-module");
|
|
1087
1053
|
}
|
|
1088
1054
|
|
|
1089
1055
|
// --------------------------------------------------------------------------------------------
|
|
1090
1056
|
|
|
1091
|
-
|
|
1057
|
+
let _globalDefine,
|
|
1092
1058
|
_globalDefineAMD;
|
|
1093
1059
|
|
|
1094
1060
|
function updateDefineAndInterceptAMDFlag(newDefine) {
|
|
@@ -1114,16 +1080,16 @@
|
|
|
1114
1080
|
|
|
1115
1081
|
Object.defineProperty(_globalDefine, "amd", {
|
|
1116
1082
|
get: function() {
|
|
1117
|
-
|
|
1118
|
-
if ( sCurrentModule && mShims[sCurrentModule]
|
|
1119
|
-
log.debug(
|
|
1083
|
+
const sCurrentModule = getExecutingModule();
|
|
1084
|
+
if ( sCurrentModule && mShims[sCurrentModule]?.amd ) {
|
|
1085
|
+
log.debug(`suppressing define.amd for ${sCurrentModule}`);
|
|
1120
1086
|
return undefined;
|
|
1121
1087
|
}
|
|
1122
1088
|
return _globalDefineAMD;
|
|
1123
1089
|
},
|
|
1124
1090
|
set: function(newDefineAMD) {
|
|
1125
1091
|
_globalDefineAMD = newDefineAMD;
|
|
1126
|
-
log.debug(
|
|
1092
|
+
log.debug(`define.amd became ${newDefineAMD ? "active" : "unset"}`);
|
|
1127
1093
|
},
|
|
1128
1094
|
configurable: true // we have to allow a redefine for debug mode or restart from CDN etc.
|
|
1129
1095
|
});
|
|
@@ -1137,7 +1103,7 @@
|
|
|
1137
1103
|
},
|
|
1138
1104
|
set: function(newDefine) {
|
|
1139
1105
|
updateDefineAndInterceptAMDFlag(newDefine);
|
|
1140
|
-
log.debug(
|
|
1106
|
+
log.debug(`define became ${newDefine ? "active" : "unset"}`);
|
|
1141
1107
|
},
|
|
1142
1108
|
configurable: true // we have to allow a redefine for debug mode or restart from CDN etc.
|
|
1143
1109
|
});
|
|
@@ -1150,7 +1116,7 @@
|
|
|
1150
1116
|
// --------------------------------------------------------------------------------------------
|
|
1151
1117
|
|
|
1152
1118
|
function isModuleError(err) {
|
|
1153
|
-
return err
|
|
1119
|
+
return err?.name === "ModuleError";
|
|
1154
1120
|
}
|
|
1155
1121
|
|
|
1156
1122
|
/**
|
|
@@ -1171,11 +1137,11 @@
|
|
|
1171
1137
|
* @returns {Error} New module error
|
|
1172
1138
|
*/
|
|
1173
1139
|
function makeModuleError(template, module, cause) {
|
|
1174
|
-
|
|
1140
|
+
let modules = `'${module.name}'`;
|
|
1175
1141
|
|
|
1176
1142
|
if (isModuleError(cause)) {
|
|
1177
1143
|
// update the chain of modules (increasing the indent)
|
|
1178
|
-
modules
|
|
1144
|
+
modules += `\n -> ${cause._modules.replace(/ -> /g, " -> ")}`;
|
|
1179
1145
|
// omit repeated occurrences of the same kind of error
|
|
1180
1146
|
if ( template === cause._template ) {
|
|
1181
1147
|
cause = cause.cause;
|
|
@@ -1183,14 +1149,14 @@
|
|
|
1183
1149
|
}
|
|
1184
1150
|
|
|
1185
1151
|
// create the message string from the template and the cause's message
|
|
1186
|
-
|
|
1152
|
+
const message =
|
|
1187
1153
|
template.replace(/\{id\}/, modules).replace(/\{url\}/, module.url)
|
|
1188
1154
|
+ (cause ? ": " + cause.message : "");
|
|
1189
1155
|
|
|
1190
|
-
|
|
1156
|
+
const error = new Error(message);
|
|
1191
1157
|
error.name = "ModuleError";
|
|
1192
1158
|
error.cause = cause;
|
|
1193
|
-
if ( cause
|
|
1159
|
+
if ( cause?.stack ) {
|
|
1194
1160
|
error.stack = error.stack + "\nCaused by: " + cause.stack;
|
|
1195
1161
|
}
|
|
1196
1162
|
// the following properties are only for internal usage
|
|
@@ -1200,19 +1166,17 @@
|
|
|
1200
1166
|
}
|
|
1201
1167
|
|
|
1202
1168
|
function declareModule(sModuleName) {
|
|
1203
|
-
var oModule;
|
|
1204
|
-
|
|
1205
1169
|
// sModuleName must be a unified resource name of type .js
|
|
1206
1170
|
assert(/\.js$/.test(sModuleName), "must be a Javascript module");
|
|
1207
1171
|
|
|
1208
|
-
oModule = Module.get(sModuleName);
|
|
1172
|
+
const oModule = Module.get(sModuleName);
|
|
1209
1173
|
|
|
1210
1174
|
if ( oModule.state > INITIAL ) {
|
|
1211
1175
|
return oModule;
|
|
1212
1176
|
}
|
|
1213
1177
|
|
|
1214
1178
|
if ( log.isLoggable() ) {
|
|
1215
|
-
log.debug(sLogPrefix
|
|
1179
|
+
log.debug(`${sLogPrefix}declare module '${sModuleName}'`);
|
|
1216
1180
|
}
|
|
1217
1181
|
|
|
1218
1182
|
// avoid cycles
|
|
@@ -1241,7 +1205,7 @@
|
|
|
1241
1205
|
* @param {boolean} [nested] Whether this is a nested queue used during sync execution of a module
|
|
1242
1206
|
*/
|
|
1243
1207
|
function ModuleDefinitionQueue(nested) {
|
|
1244
|
-
|
|
1208
|
+
let aQueue = [],
|
|
1245
1209
|
iRun = 0,
|
|
1246
1210
|
vTimer;
|
|
1247
1211
|
|
|
@@ -1252,7 +1216,7 @@
|
|
|
1252
1216
|
+ " to define queue #" + iRun);
|
|
1253
1217
|
}
|
|
1254
1218
|
|
|
1255
|
-
|
|
1219
|
+
const sModule = document.currentScript?.getAttribute('data-sap-ui-module');
|
|
1256
1220
|
aQueue.push({
|
|
1257
1221
|
name: name,
|
|
1258
1222
|
deps: deps,
|
|
@@ -1286,26 +1250,22 @@
|
|
|
1286
1250
|
* @param {string} [sInitiator] A string describing the caller of <code>process</code>
|
|
1287
1251
|
*/
|
|
1288
1252
|
this.process = function(oRequestedModule, sInitiator) {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1253
|
+
const bLoggable = log.isLoggable();
|
|
1254
|
+
const aQueueCopy = aQueue;
|
|
1255
|
+
const iCurrentRun = iRun++;
|
|
1256
|
+
let sModuleName = null;
|
|
1293
1257
|
|
|
1294
1258
|
// clear the queue and timer early, we've already taken a copy of the queue
|
|
1295
1259
|
this.clear();
|
|
1296
1260
|
|
|
1297
1261
|
|
|
1298
|
-
if
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
if ( bLoggable ) {
|
|
1303
|
-
log.debug("module execution error detected, ignoring queued define calls (" + aQueueCopy.length + ")");
|
|
1304
|
-
}
|
|
1305
|
-
oRequestedModule.fail(oRequestedModule.execError);
|
|
1306
|
-
return;
|
|
1262
|
+
// if a module execution error was detected, stop processing the queue
|
|
1263
|
+
if ( oRequestedModule?.execError ) {
|
|
1264
|
+
if ( bLoggable ) {
|
|
1265
|
+
log.debug(`module execution error detected, ignoring queued define calls (${aQueueCopy.length})`);
|
|
1307
1266
|
}
|
|
1308
|
-
|
|
1267
|
+
oRequestedModule.fail(oRequestedModule.execError);
|
|
1268
|
+
return;
|
|
1309
1269
|
}
|
|
1310
1270
|
|
|
1311
1271
|
/*
|
|
@@ -1317,10 +1277,10 @@
|
|
|
1317
1277
|
* - when the name of a named module definition matches the name of requested module, the name is 'consumed'.
|
|
1318
1278
|
* Any later unnamed module definition will be reported as an error, too
|
|
1319
1279
|
*/
|
|
1320
|
-
sModuleName = oRequestedModule
|
|
1280
|
+
sModuleName = oRequestedModule?.name;
|
|
1321
1281
|
|
|
1322
1282
|
// check whether there's a module definition for the requested module
|
|
1323
|
-
aQueueCopy.forEach(
|
|
1283
|
+
aQueueCopy.forEach((oEntry) => {
|
|
1324
1284
|
if ( oEntry.name == null ) {
|
|
1325
1285
|
if ( sModuleName != null ) {
|
|
1326
1286
|
oEntry.name = sModuleName;
|
|
@@ -1328,7 +1288,7 @@
|
|
|
1328
1288
|
} else {
|
|
1329
1289
|
// multiple modules have been queued, but only one module can inherit the name from the require call
|
|
1330
1290
|
if ( strictModuleDefinitions ) {
|
|
1331
|
-
|
|
1291
|
+
const oError = new Error(
|
|
1332
1292
|
"Modules that use an anonymous define() call must be loaded with a require() call; " +
|
|
1333
1293
|
"they must not be executed via script tag or nested into other modules. ");
|
|
1334
1294
|
if ( oRequestedModule ) {
|
|
@@ -1338,7 +1298,7 @@
|
|
|
1338
1298
|
}
|
|
1339
1299
|
}
|
|
1340
1300
|
// give anonymous modules a unique pseudo ID
|
|
1341
|
-
oEntry.name =
|
|
1301
|
+
oEntry.name = `~anonymous~${++iAnonymousModuleCount}.js`;
|
|
1342
1302
|
log.error(
|
|
1343
1303
|
"Modules that use an anonymous define() call must be loaded with a require() call; " +
|
|
1344
1304
|
"they must not be executed via script tag or nested into other modules. " +
|
|
@@ -1361,7 +1321,7 @@
|
|
|
1361
1321
|
if ( bLoggable ) {
|
|
1362
1322
|
log.debug(
|
|
1363
1323
|
"No queued module definition matches the ID of the request. " +
|
|
1364
|
-
|
|
1324
|
+
`Now assuming that the first definition '${aQueueCopy[0].name}' is an alias of '${sModuleName}'`);
|
|
1365
1325
|
}
|
|
1366
1326
|
Module.get(aQueueCopy[0].name).addAlias(sModuleName);
|
|
1367
1327
|
sModuleName = null;
|
|
@@ -1371,10 +1331,10 @@
|
|
|
1371
1331
|
log.debug(sLogPrefix + "[" + sInitiator + "] "
|
|
1372
1332
|
+ "processing define queue #" + iCurrentRun
|
|
1373
1333
|
+ (oRequestedModule ? " for '" + oRequestedModule.name + "'" : "")
|
|
1374
|
-
+
|
|
1334
|
+
+ ` with entries [${aQueueCopy.map((entry) => `'${entry.name}'`)}]`);
|
|
1375
1335
|
}
|
|
1376
1336
|
|
|
1377
|
-
aQueueCopy.forEach(
|
|
1337
|
+
aQueueCopy.forEach((oEntry) => {
|
|
1378
1338
|
// start to resolve the dependencies
|
|
1379
1339
|
executeModuleDefinition(oEntry.name, oEntry.deps, oEntry.factory, oEntry._export, /* bAsync = */ true);
|
|
1380
1340
|
});
|
|
@@ -1389,12 +1349,12 @@
|
|
|
1389
1349
|
}
|
|
1390
1350
|
|
|
1391
1351
|
if ( bLoggable ) {
|
|
1392
|
-
log.debug(sLogPrefix +
|
|
1352
|
+
log.debug(sLogPrefix + `processing define queue #${iCurrentRun} done`);
|
|
1393
1353
|
}
|
|
1394
1354
|
};
|
|
1395
1355
|
}
|
|
1396
1356
|
|
|
1397
|
-
|
|
1357
|
+
let queue = new ModuleDefinitionQueue();
|
|
1398
1358
|
|
|
1399
1359
|
/**
|
|
1400
1360
|
* Loads the source for the given module with a sync XHR.
|
|
@@ -1402,7 +1362,7 @@
|
|
|
1402
1362
|
* @throws {Error} When loading failed for some reason.
|
|
1403
1363
|
*/
|
|
1404
1364
|
function loadSyncXHR(oModule) {
|
|
1405
|
-
|
|
1365
|
+
const xhr = new XMLHttpRequest();
|
|
1406
1366
|
|
|
1407
1367
|
function createXHRLoadError(error) {
|
|
1408
1368
|
error = new Error(xhr.statusText ? xhr.status + " - " + xhr.statusText : xhr.status);
|
|
@@ -1439,12 +1399,12 @@
|
|
|
1439
1399
|
* @private
|
|
1440
1400
|
*/
|
|
1441
1401
|
window.addEventListener('error', function onUncaughtError(errorEvent) {
|
|
1442
|
-
var sModuleName = document.currentScript
|
|
1402
|
+
var sModuleName = document.currentScript?.getAttribute('data-sap-ui-module');
|
|
1443
1403
|
var oModule = sModuleName && Module.get(sModuleName);
|
|
1444
1404
|
if ( oModule && oModule.execError == null ) {
|
|
1445
1405
|
// if a currently executing module can be identified, attach the error to it and suppress reporting
|
|
1446
1406
|
if ( log.isLoggable() ) {
|
|
1447
|
-
log.debug(
|
|
1407
|
+
log.debug(`unhandled exception occurred while executing ${sModuleName}: ${errorEvent.message}`);
|
|
1448
1408
|
}
|
|
1449
1409
|
oModule.execError = errorEvent.error || {
|
|
1450
1410
|
name: 'Error',
|
|
@@ -1456,12 +1416,20 @@
|
|
|
1456
1416
|
|
|
1457
1417
|
function loadScript(oModule, sAlternativeURL) {
|
|
1458
1418
|
|
|
1459
|
-
|
|
1419
|
+
const oScript = document.createElement('SCRIPT');
|
|
1420
|
+
// Accessing the 'src' property of the script in this strange way prevents Safari 12 (or WebKit) from
|
|
1421
|
+
// wrongly optimizing access. SF12 seems to check at optimization time whether there's a setter for the
|
|
1422
|
+
// property and optimize accordingly. When a setter is defined or changed at a later point in time (e.g.
|
|
1423
|
+
// by the AppCacheBuster), then the optimization seems not to be updated and the new setter is ignored
|
|
1424
|
+
// BCP 1970035485
|
|
1425
|
+
oScript["s" + "rc"] = oModule.url;
|
|
1426
|
+
//oScript.src = oModule.url;
|
|
1427
|
+
oScript.setAttribute("data-sap-ui-module", oModule.name);
|
|
1460
1428
|
|
|
1461
1429
|
function onload(e) {
|
|
1462
1430
|
updateMaxTaskTime();
|
|
1463
1431
|
if ( log.isLoggable() ) {
|
|
1464
|
-
log.debug(
|
|
1432
|
+
log.debug(`JavaScript resource loaded: ${oModule.name}`);
|
|
1465
1433
|
}
|
|
1466
1434
|
oScript.removeEventListener('load', onload);
|
|
1467
1435
|
oScript.removeEventListener('error', onerror);
|
|
@@ -1473,30 +1441,19 @@
|
|
|
1473
1441
|
oScript.removeEventListener('load', onload);
|
|
1474
1442
|
oScript.removeEventListener('error', onerror);
|
|
1475
1443
|
if (sAlternativeURL) {
|
|
1476
|
-
log.warning(
|
|
1477
|
-
|
|
1478
|
-
oScript.parentNode.removeChild(oScript);
|
|
1479
|
-
}
|
|
1444
|
+
log.warning(`retry loading JavaScript resource: ${oModule.name}`);
|
|
1445
|
+
oScript?.parentNode?.removeChild(oScript);
|
|
1480
1446
|
oModule.url = sAlternativeURL;
|
|
1481
1447
|
loadScript(oModule, /* sAlternativeURL= */ null);
|
|
1482
1448
|
return;
|
|
1483
1449
|
}
|
|
1484
1450
|
|
|
1485
|
-
log.error(
|
|
1451
|
+
log.error(`failed to load JavaScript resource: ${oModule.name}`);
|
|
1486
1452
|
oModule.failWith("failed to load {id} from {url}", new Error("script load error"));
|
|
1487
1453
|
}
|
|
1488
1454
|
|
|
1489
|
-
oScript = document.createElement('SCRIPT');
|
|
1490
|
-
// Accessing the 'src' property of the script in this strange way prevents Safari 12 (or WebKit) from
|
|
1491
|
-
// wrongly optimizing access. SF12 seems to check at optimization time whether there's a setter for the
|
|
1492
|
-
// property and optimize accordingly. When a setter is defined or changed at a later point in time (e.g.
|
|
1493
|
-
// by the AppCacheBuster), then the optimization seems not to be updated and the new setter is ignored
|
|
1494
|
-
// BCP 1970035485
|
|
1495
|
-
oScript["s" + "rc"] = oModule.url;
|
|
1496
|
-
//oScript.src = oModule.url;
|
|
1497
|
-
oScript.setAttribute("data-sap-ui-module", oModule.name);
|
|
1498
1455
|
if ( sAlternativeURL !== undefined ) {
|
|
1499
|
-
if ( mShims[oModule.name]
|
|
1456
|
+
if ( mShims[oModule.name]?.amd ) {
|
|
1500
1457
|
oScript.setAttribute("data-sap-ui-module-amd", "true");
|
|
1501
1458
|
}
|
|
1502
1459
|
oScript.addEventListener('load', onload);
|
|
@@ -1507,10 +1464,10 @@
|
|
|
1507
1464
|
}
|
|
1508
1465
|
|
|
1509
1466
|
function preloadDependencies(sModuleName) {
|
|
1510
|
-
|
|
1467
|
+
const knownDependencies = mDepCache[sModuleName];
|
|
1511
1468
|
if ( Array.isArray(knownDependencies) ) {
|
|
1512
|
-
log.debug(
|
|
1513
|
-
knownDependencies.forEach(
|
|
1469
|
+
log.debug(`preload dependencies for ${sModuleName}: ${knownDependencies}`);
|
|
1470
|
+
knownDependencies.forEach((dep) => {
|
|
1514
1471
|
dep = getMappedName(dep, sModuleName);
|
|
1515
1472
|
if ( /\.js$/.test(dep) ) {
|
|
1516
1473
|
requireModule(null, dep, /* always async */ true);
|
|
@@ -1539,14 +1496,10 @@
|
|
|
1539
1496
|
*/
|
|
1540
1497
|
function requireModule(oRequestingModule, sModuleName, bAsync, bSkipShimDeps, bSkipBundle) {
|
|
1541
1498
|
|
|
1542
|
-
var bLoggable = log.isLoggable(),
|
|
1543
|
-
oSplitName = urnToBaseIDAndSubType(sModuleName),
|
|
1544
|
-
oShim = mShims[sModuleName],
|
|
1545
|
-
oModule, aExtensions, i, sMsg, bExecutedNow;
|
|
1546
|
-
|
|
1547
1499
|
// only for robustness, should not be possible by design (all callers append '.js')
|
|
1500
|
+
const oSplitName = urnToBaseIDAndSubType(sModuleName);
|
|
1548
1501
|
if ( !oSplitName ) {
|
|
1549
|
-
throw new Error(
|
|
1502
|
+
throw new Error(`can only require Javascript module, not ${sModuleName}`);
|
|
1550
1503
|
}
|
|
1551
1504
|
|
|
1552
1505
|
// Module names should not start with a "/"
|
|
@@ -1554,11 +1507,14 @@
|
|
|
1554
1507
|
log.error("Module names that start with a slash should not be used, as they are reserved for future use.");
|
|
1555
1508
|
}
|
|
1556
1509
|
|
|
1557
|
-
|
|
1510
|
+
const bLoggable = log.isLoggable();
|
|
1511
|
+
|
|
1512
|
+
const oModule = Module.get(sModuleName);
|
|
1513
|
+
const oShim = mShims[sModuleName];
|
|
1558
1514
|
|
|
1559
1515
|
// when there's a shim with dependencies for the module
|
|
1560
1516
|
// resolve them first before requiring the module again with bSkipShimDeps = true
|
|
1561
|
-
if ( oShim
|
|
1517
|
+
if ( oShim?.deps && !bSkipShimDeps ) {
|
|
1562
1518
|
if ( bLoggable ) {
|
|
1563
1519
|
log.debug("require dependencies of raw module " + sModuleName);
|
|
1564
1520
|
}
|
|
@@ -1575,8 +1531,7 @@
|
|
|
1575
1531
|
// require the bundle first before requiring the module again with bSkipBundle = true
|
|
1576
1532
|
if ( oModule.state === INITIAL && oModule.group && oModule.group !== sModuleName && !bSkipBundle ) {
|
|
1577
1533
|
if ( bLoggable ) {
|
|
1578
|
-
log.debug(sLogPrefix
|
|
1579
|
-
+ " containing '" + sModuleName + "'");
|
|
1534
|
+
log.debug(`${sLogPrefix}require bundle '${oModule.group}' containing '${sModuleName}'`);
|
|
1580
1535
|
}
|
|
1581
1536
|
if ( bAsync ) {
|
|
1582
1537
|
return requireModule(null, oModule.group, bAsync).catch(noop).then(function() {
|
|
@@ -1602,6 +1557,8 @@
|
|
|
1602
1557
|
// check if module has been loaded already
|
|
1603
1558
|
if ( oModule.state !== INITIAL ) {
|
|
1604
1559
|
|
|
1560
|
+
let bExecutedNow = false;
|
|
1561
|
+
|
|
1605
1562
|
if ( oModule.state === EXECUTING && oModule.data != null && !bAsync && oModule.async ) {
|
|
1606
1563
|
oModule.state = PRELOADED;
|
|
1607
1564
|
oModule.async = bAsync;
|
|
@@ -1663,10 +1620,10 @@
|
|
|
1663
1620
|
oModule.async = bAsync;
|
|
1664
1621
|
|
|
1665
1622
|
// if debug is enabled, try to load debug module first
|
|
1666
|
-
aExtensions = bDebugSources ? ["-dbg", ""] : [""];
|
|
1623
|
+
const aExtensions = bDebugSources ? ["-dbg", ""] : [""];
|
|
1667
1624
|
if ( !bAsync ) {
|
|
1668
1625
|
|
|
1669
|
-
for (i = 0; i < aExtensions.length && oModule.state !== LOADED; i++) {
|
|
1626
|
+
for (let i = 0; i < aExtensions.length && oModule.state !== LOADED; i++) {
|
|
1670
1627
|
// create module URL for the current extension
|
|
1671
1628
|
oModule.url = getResourcePath(oSplitName.baseID, aExtensions[i] + oSplitName.subType);
|
|
1672
1629
|
if ( bLoggable ) {
|
|
@@ -1674,7 +1631,7 @@
|
|
|
1674
1631
|
}
|
|
1675
1632
|
|
|
1676
1633
|
if ( syncCallBehavior ) {
|
|
1677
|
-
sMsg = "[nosync] loading module '" + oModule.url + "'";
|
|
1634
|
+
const sMsg = "[nosync] loading module '" + oModule.url + "'";
|
|
1678
1635
|
if ( syncCallBehavior === 1 ) {
|
|
1679
1636
|
log.error(sMsg);
|
|
1680
1637
|
} else {
|
|
@@ -1708,7 +1665,7 @@
|
|
|
1708
1665
|
|
|
1709
1666
|
oModule.url = getResourcePath(oSplitName.baseID, aExtensions[0] + oSplitName.subType);
|
|
1710
1667
|
// in debug mode, fall back to the non-dbg source, otherwise try the same source again (for SSO re-connect)
|
|
1711
|
-
|
|
1668
|
+
const sAltUrl = bDebugSources ? getResourcePath(oSplitName.baseID, aExtensions[1] + oSplitName.subType) : oModule.url;
|
|
1712
1669
|
|
|
1713
1670
|
if ( log.isLoggable() ) {
|
|
1714
1671
|
log.debug(sLogPrefix + "loading '" + sModuleName + "' from '" + oModule.url + "' (using <script>)");
|
|
@@ -1728,14 +1685,14 @@
|
|
|
1728
1685
|
// sModuleName must be a normalized resource name of type .js
|
|
1729
1686
|
function execModule(sModuleName, bAsync) {
|
|
1730
1687
|
|
|
1731
|
-
|
|
1732
|
-
bLoggable = log.isLoggable(),
|
|
1733
|
-
sOldPrefix, sScript, oMatch, bOldForceSyncDefines, oOldQueue;
|
|
1688
|
+
const oModule = mModules[sModuleName];
|
|
1734
1689
|
|
|
1735
1690
|
if ( oModule && oModule.state === LOADED && typeof oModule.data !== "undefined" ) {
|
|
1736
1691
|
|
|
1737
|
-
|
|
1738
|
-
|
|
1692
|
+
const bLoggable = log.isLoggable();
|
|
1693
|
+
const bOldForceSyncDefines = bForceSyncDefines;
|
|
1694
|
+
const oOldQueue = queue;
|
|
1695
|
+
let sOldPrefix, sScript;
|
|
1739
1696
|
|
|
1740
1697
|
try {
|
|
1741
1698
|
|
|
@@ -1773,7 +1730,7 @@
|
|
|
1773
1730
|
// Note: Chrome ignores debug files when the same URL has already been load via sourcemap of the bootstrap file (sap-ui-core)
|
|
1774
1731
|
// Note: sourcemap annotations URLs in eval'ed sources are resolved relative to the page, not relative to the source
|
|
1775
1732
|
if (sScript ) {
|
|
1776
|
-
oMatch = /\/\/[#@] source(Mapping)?URL=(.*)$/.exec(sScript);
|
|
1733
|
+
const oMatch = /\/\/[#@] source(Mapping)?URL=(.*)$/.exec(sScript);
|
|
1777
1734
|
if ( oMatch && oMatch[1] && /^[^/]+\.js\.map$/.test(oMatch[2]) ) {
|
|
1778
1735
|
// found a sourcemap annotation with a typical UI5 generated relative URL
|
|
1779
1736
|
sScript = sScript.slice(0, oMatch.index) + oMatch[0].slice(0, -oMatch[2].length) + resolveURL(oMatch[2], oModule.url);
|
|
@@ -1833,8 +1790,9 @@
|
|
|
1833
1790
|
|
|
1834
1791
|
function requireAll(oRequestingModule, aDependencies, fnCallback, fnErrCallback, bAsync) {
|
|
1835
1792
|
|
|
1836
|
-
|
|
1837
|
-
|
|
1793
|
+
const aModules = [];
|
|
1794
|
+
let sBaseName,
|
|
1795
|
+
oError;
|
|
1838
1796
|
|
|
1839
1797
|
try {
|
|
1840
1798
|
// calculate the base name for relative module names
|
|
@@ -1845,20 +1803,20 @@
|
|
|
1845
1803
|
oRequestingModule = null;
|
|
1846
1804
|
}
|
|
1847
1805
|
aDependencies = aDependencies.slice();
|
|
1848
|
-
for (i = 0; i < aDependencies.length; i++) {
|
|
1806
|
+
for (let i = 0; i < aDependencies.length; i++) {
|
|
1849
1807
|
aDependencies[i] = getMappedName(aDependencies[i] + '.js', sBaseName);
|
|
1850
1808
|
}
|
|
1851
1809
|
if ( oRequestingModule ) {
|
|
1852
1810
|
// remember outgoing dependencies to be able to detect cycles, but ignore pseudo-dependencies
|
|
1853
|
-
aDependencies.forEach(
|
|
1811
|
+
aDependencies.forEach((dep) => {
|
|
1854
1812
|
if ( !/^(require|exports|module)\.js$/.test(dep) ) {
|
|
1855
1813
|
oRequestingModule.addPending(dep);
|
|
1856
1814
|
}
|
|
1857
1815
|
});
|
|
1858
1816
|
}
|
|
1859
1817
|
|
|
1860
|
-
for (i = 0; i < aDependencies.length; i++) {
|
|
1861
|
-
sDepModName = aDependencies[i];
|
|
1818
|
+
for (let i = 0; i < aDependencies.length; i++) {
|
|
1819
|
+
const sDepModName = aDependencies[i];
|
|
1862
1820
|
if ( oRequestingModule ) {
|
|
1863
1821
|
switch ( sDepModName ) {
|
|
1864
1822
|
case 'require.js':
|
|
@@ -1886,7 +1844,7 @@
|
|
|
1886
1844
|
}
|
|
1887
1845
|
|
|
1888
1846
|
if ( bAsync ) {
|
|
1889
|
-
oPromise = oError ? Promise.reject(oError) : Promise.all(aModules);
|
|
1847
|
+
const oPromise = oError ? Promise.reject(oError) : Promise.all(aModules);
|
|
1890
1848
|
return oPromise.then(fnCallback, fnErrCallback);
|
|
1891
1849
|
} else {
|
|
1892
1850
|
if ( oError ) {
|
|
@@ -1898,16 +1856,16 @@
|
|
|
1898
1856
|
}
|
|
1899
1857
|
|
|
1900
1858
|
function executeModuleDefinition(sResourceName, aDependencies, vFactory, bExport, bAsync) {
|
|
1901
|
-
|
|
1859
|
+
const bLoggable = log.isLoggable();
|
|
1902
1860
|
sResourceName = normalize(sResourceName);
|
|
1903
1861
|
|
|
1904
1862
|
if ( bLoggable ) {
|
|
1905
1863
|
log.debug(sLogPrefix + "define('" + sResourceName + "', " + "['" + aDependencies.join("','") + "']" + ")");
|
|
1906
1864
|
}
|
|
1907
1865
|
|
|
1908
|
-
|
|
1866
|
+
const oModule = declareModule(sResourceName);
|
|
1909
1867
|
|
|
1910
|
-
|
|
1868
|
+
let repeatedExecutionReported = false;
|
|
1911
1869
|
|
|
1912
1870
|
function shouldSkipExecution() {
|
|
1913
1871
|
if ( oModule.settled ) {
|
|
@@ -1956,7 +1914,7 @@
|
|
|
1956
1914
|
|
|
1957
1915
|
if ( bExport && syncCallBehavior !== 2 ) {
|
|
1958
1916
|
// ensure parent namespace
|
|
1959
|
-
|
|
1917
|
+
const aPackages = sResourceName.split('/');
|
|
1960
1918
|
if ( aPackages.length > 1 ) {
|
|
1961
1919
|
getGlobalObject(__global, aPackages, aPackages.length - 1, true);
|
|
1962
1920
|
}
|
|
@@ -1968,15 +1926,15 @@
|
|
|
1968
1926
|
// then that value should be assigned as the exported value for the module."
|
|
1969
1927
|
try {
|
|
1970
1928
|
aModules = aModules.map(unwrapExport);
|
|
1971
|
-
|
|
1972
|
-
if ( oModule._api
|
|
1929
|
+
let exports = vFactory.apply(__global, aModules);
|
|
1930
|
+
if ( oModule._api?.exports !== undefined && oModule._api.exports !== oModule._exports ) {
|
|
1973
1931
|
exports = oModule._api.exports;
|
|
1974
1932
|
} else if ( exports === undefined && oModule._exports ) {
|
|
1975
1933
|
exports = oModule._exports;
|
|
1976
1934
|
}
|
|
1977
1935
|
oModule.content = exports;
|
|
1978
1936
|
} catch (error) {
|
|
1979
|
-
|
|
1937
|
+
const wrappedError = oModule.failWith("failed to execute module factory for '{id}'", error);
|
|
1980
1938
|
if ( bAsync ) {
|
|
1981
1939
|
// Note: in async mode, the error is reported via the oModule's promise
|
|
1982
1940
|
return;
|
|
@@ -1990,13 +1948,13 @@
|
|
|
1990
1948
|
// HACK: global export
|
|
1991
1949
|
if ( bExport && syncCallBehavior !== 2 ) {
|
|
1992
1950
|
if ( oModule.content == null ) {
|
|
1993
|
-
log.error(
|
|
1951
|
+
log.error(`Module '${sResourceName}' returned no content, but should export to global?`);
|
|
1994
1952
|
} else {
|
|
1995
1953
|
if ( bLoggable ) {
|
|
1996
|
-
log.debug(
|
|
1954
|
+
log.debug(`exporting content of '${sResourceName}': as global object`);
|
|
1997
1955
|
}
|
|
1998
1956
|
// convert module name to UI5 module name syntax (might fail!)
|
|
1999
|
-
|
|
1957
|
+
const sModuleName = urnToUI5(sResourceName);
|
|
2000
1958
|
setGlobalProperty(sModuleName, oModule.content);
|
|
2001
1959
|
}
|
|
2002
1960
|
}
|
|
@@ -2007,7 +1965,7 @@
|
|
|
2007
1965
|
|
|
2008
1966
|
// Note: dependencies will be resolved and converted from RJS to URN inside requireAll
|
|
2009
1967
|
requireAll(oModule, aDependencies, bAsync && oModule.data ? scheduleExecution(onSuccess) : onSuccess, function(oErr) {
|
|
2010
|
-
|
|
1968
|
+
const oWrappedError = oModule.failWith("Failed to resolve dependencies of {id}", oErr);
|
|
2011
1969
|
if ( !bAsync ) {
|
|
2012
1970
|
throw oWrappedError;
|
|
2013
1971
|
}
|
|
@@ -2017,8 +1975,7 @@
|
|
|
2017
1975
|
}
|
|
2018
1976
|
|
|
2019
1977
|
function ui5Define(sModuleName, aDependencies, vFactory, bExport) {
|
|
2020
|
-
|
|
2021
|
-
oCurrentExecInfo;
|
|
1978
|
+
let sResourceName;
|
|
2022
1979
|
|
|
2023
1980
|
// optional id
|
|
2024
1981
|
if ( typeof sModuleName === 'string' ) {
|
|
@@ -2046,7 +2003,7 @@
|
|
|
2046
2003
|
if ( bForceSyncDefines === false || (bForceSyncDefines == null && bGlobalAsyncMode) ) {
|
|
2047
2004
|
queue.push(sResourceName, aDependencies, vFactory, bExport);
|
|
2048
2005
|
if ( sResourceName != null ) {
|
|
2049
|
-
|
|
2006
|
+
const oModule = Module.get(sResourceName);
|
|
2050
2007
|
if ( oModule.state === INITIAL ) {
|
|
2051
2008
|
oModule.state = EXECUTING;
|
|
2052
2009
|
oModule.async = true;
|
|
@@ -2056,7 +2013,7 @@
|
|
|
2056
2013
|
}
|
|
2057
2014
|
|
|
2058
2015
|
// immediate, synchronous execution
|
|
2059
|
-
oCurrentExecInfo = _execStack.length > 0 ? _execStack[_execStack.length - 1] : null;
|
|
2016
|
+
const oCurrentExecInfo = _execStack.length > 0 ? _execStack[_execStack.length - 1] : null;
|
|
2060
2017
|
if ( !sResourceName ) {
|
|
2061
2018
|
|
|
2062
2019
|
if ( oCurrentExecInfo && !oCurrentExecInfo.used ) {
|
|
@@ -2064,7 +2021,7 @@
|
|
|
2064
2021
|
oCurrentExecInfo.used = true;
|
|
2065
2022
|
} else {
|
|
2066
2023
|
// give anonymous modules a unique pseudo ID
|
|
2067
|
-
sResourceName =
|
|
2024
|
+
sResourceName = `~anonymous~${++iAnonymousModuleCount}.js`;
|
|
2068
2025
|
if ( oCurrentExecInfo ) {
|
|
2069
2026
|
sResourceName = oCurrentExecInfo.name.slice(0, oCurrentExecInfo.name.lastIndexOf('/') + 1) + sResourceName;
|
|
2070
2027
|
}
|
|
@@ -2074,8 +2031,8 @@
|
|
|
2074
2031
|
"All other usages will fail in future releases or when standard AMD loaders are used " +
|
|
2075
2032
|
"or when ui5loader runs in async mode. Now using substitute name " + sResourceName);
|
|
2076
2033
|
}
|
|
2077
|
-
} else if ( oCurrentExecInfo
|
|
2078
|
-
log.debug(
|
|
2034
|
+
} else if ( oCurrentExecInfo?.used && sResourceName !== oCurrentExecInfo.name ) {
|
|
2035
|
+
log.debug(`module names don't match: requested: ${sModuleName}, defined: ${oCurrentExecInfo.name}`);
|
|
2079
2036
|
Module.get(oCurrentExecInfo.name).addAlias(sModuleName);
|
|
2080
2037
|
}
|
|
2081
2038
|
executeModuleDefinition(sResourceName, aDependencies, vFactory, bExport, /* bAsync = */ false);
|
|
@@ -2088,8 +2045,8 @@
|
|
|
2088
2045
|
* mode (has to be configured explicitly).
|
|
2089
2046
|
*/
|
|
2090
2047
|
function amdDefine(sModuleName, aDependencies, vFactory) {
|
|
2091
|
-
|
|
2092
|
-
|
|
2048
|
+
let oArgs = arguments;
|
|
2049
|
+
const bExportIsSet = typeof oArgs[oArgs.length - 1] === "boolean";
|
|
2093
2050
|
|
|
2094
2051
|
// bExport parameter is proprietary and should not be used for an AMD compliant define()
|
|
2095
2052
|
if (bExportIsSet) {
|
|
@@ -2110,17 +2067,15 @@
|
|
|
2110
2067
|
* @returns {function} Require function.
|
|
2111
2068
|
*/
|
|
2112
2069
|
function createContextualRequire(sContextName, bAMDCompliance) {
|
|
2113
|
-
|
|
2114
|
-
var sModuleName;
|
|
2115
|
-
|
|
2070
|
+
const fnRequire = function(vDependencies, fnCallback, fnErrCallback) {
|
|
2116
2071
|
assert(typeof vDependencies === 'string' || Array.isArray(vDependencies), "dependency param either must be a single string or an array of strings");
|
|
2117
2072
|
assert(fnCallback == null || typeof fnCallback === 'function', "callback must be a function or null/undefined");
|
|
2118
2073
|
assert(fnErrCallback == null || typeof fnErrCallback === 'function', "error callback must be a function or null/undefined");
|
|
2119
2074
|
|
|
2120
2075
|
// Probing for existing module
|
|
2121
2076
|
if ( typeof vDependencies === 'string' ) {
|
|
2122
|
-
sModuleName = getMappedName(vDependencies + '.js', sContextName);
|
|
2123
|
-
|
|
2077
|
+
const sModuleName = getMappedName(vDependencies + '.js', sContextName);
|
|
2078
|
+
const oModule = Module.get(sModuleName);
|
|
2124
2079
|
|
|
2125
2080
|
// check the modules internal state
|
|
2126
2081
|
// everything from PRELOADED to LOADED (incl. FAILED) is considered erroneous
|
|
@@ -2165,7 +2120,7 @@
|
|
|
2165
2120
|
// return undefined;
|
|
2166
2121
|
};
|
|
2167
2122
|
fnRequire.toUrl = function(sName) {
|
|
2168
|
-
|
|
2123
|
+
const sMappedName = ensureTrailingSlash(getMappedName(sName, sContextName), sName);
|
|
2169
2124
|
return toUrl(sMappedName);
|
|
2170
2125
|
};
|
|
2171
2126
|
return fnRequire;
|
|
@@ -2181,7 +2136,7 @@
|
|
|
2181
2136
|
|
|
2182
2137
|
function toUrl(sName) {
|
|
2183
2138
|
if (sName.indexOf("/") === 0) {
|
|
2184
|
-
throw new Error(
|
|
2139
|
+
throw new Error(`The provided argument '${sName}' may not start with a slash`);
|
|
2185
2140
|
}
|
|
2186
2141
|
return ensureTrailingSlash(getResourcePath(sName), sName);
|
|
2187
2142
|
}
|
|
@@ -2189,7 +2144,7 @@
|
|
|
2189
2144
|
/*
|
|
2190
2145
|
* UI5 version of require (sap.ui.require)
|
|
2191
2146
|
*/
|
|
2192
|
-
|
|
2147
|
+
const ui5Require = createContextualRequire(null, false);
|
|
2193
2148
|
|
|
2194
2149
|
/*
|
|
2195
2150
|
* AMD version of require (window.require)
|
|
@@ -2198,12 +2153,12 @@
|
|
|
2198
2153
|
* - require("my/module"), returns undefined if the module was not loaded yet
|
|
2199
2154
|
* - amdRequire("my/module"), throws an error if the module was not loaded yet
|
|
2200
2155
|
*/
|
|
2201
|
-
|
|
2156
|
+
const amdRequire = createContextualRequire(null, true);
|
|
2202
2157
|
|
|
2203
2158
|
function requireSync(sModuleName) {
|
|
2204
2159
|
sModuleName = getMappedName(sModuleName + '.js');
|
|
2205
2160
|
if ( log.isLoggable() ) {
|
|
2206
|
-
log.warning(
|
|
2161
|
+
log.warning(`sync require of '${sModuleName}'`);
|
|
2207
2162
|
}
|
|
2208
2163
|
return unwrapExport(requireModule(null, sModuleName, /* bAsync = */ false));
|
|
2209
2164
|
}
|
|
@@ -2219,7 +2174,7 @@
|
|
|
2219
2174
|
function preload(modules, group, url) {
|
|
2220
2175
|
group = group || null;
|
|
2221
2176
|
url = url || "<unknown>";
|
|
2222
|
-
for (
|
|
2177
|
+
for ( let name in modules ) {
|
|
2223
2178
|
name = normalize(name);
|
|
2224
2179
|
Module.get(name).preload(url + "/" + name, modules[name], group);
|
|
2225
2180
|
}
|
|
@@ -2233,44 +2188,45 @@
|
|
|
2233
2188
|
*/
|
|
2234
2189
|
function dumpInternals(iThreshold) {
|
|
2235
2190
|
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2191
|
+
const states = [PRELOADED, INITIAL, LOADED, READY, FAILED, EXECUTING, LOADING];
|
|
2192
|
+
const stateNames = {
|
|
2193
|
+
[PRELOADED]: 'PRELOADED',
|
|
2194
|
+
[INITIAL]:'INITIAL',
|
|
2195
|
+
[LOADING]: 'LOADING',
|
|
2196
|
+
[LOADED]: 'LOADED',
|
|
2197
|
+
[EXECUTING]: 'EXECUTING',
|
|
2198
|
+
[READY]: 'READY',
|
|
2199
|
+
[FAILED]: 'FAILED'
|
|
2200
|
+
};
|
|
2245
2201
|
|
|
2246
2202
|
if ( iThreshold == null ) {
|
|
2247
2203
|
iThreshold = PRELOADED;
|
|
2248
2204
|
}
|
|
2249
2205
|
|
|
2250
2206
|
/*eslint-disable no-console */
|
|
2251
|
-
|
|
2207
|
+
const info = log.isLoggable('INFO') ? log.info.bind(log) : console.info.bind(console);
|
|
2252
2208
|
/*eslint-enable no-console */
|
|
2253
2209
|
|
|
2254
|
-
|
|
2255
|
-
states.forEach(
|
|
2210
|
+
const aModuleNames = Object.keys(mModules).sort();
|
|
2211
|
+
states.forEach((state) => {
|
|
2256
2212
|
if ( state < iThreshold ) {
|
|
2257
2213
|
return;
|
|
2258
2214
|
}
|
|
2259
|
-
|
|
2215
|
+
let count = 0;
|
|
2260
2216
|
info(stateNames[state] + ":");
|
|
2261
|
-
aModuleNames.forEach(
|
|
2262
|
-
|
|
2217
|
+
aModuleNames.forEach((sModule, idx) => {
|
|
2218
|
+
const oModule = mModules[sModule];
|
|
2263
2219
|
if ( oModule.state === state ) {
|
|
2264
|
-
|
|
2220
|
+
let addtlInfo;
|
|
2265
2221
|
if ( oModule.state === LOADING ) {
|
|
2266
|
-
|
|
2267
|
-
|
|
2222
|
+
const pending = oModule.pending?.reduce((acc, dep) => {
|
|
2223
|
+
const oDepModule = Module.get(dep);
|
|
2268
2224
|
if ( oDepModule.state !== READY ) {
|
|
2269
2225
|
acc.push( dep + "(" + stateNames[oDepModule.state] + ")");
|
|
2270
2226
|
}
|
|
2271
2227
|
return acc;
|
|
2272
2228
|
}, []);
|
|
2273
|
-
if ( pending
|
|
2229
|
+
if ( pending?.length > 0 ) {
|
|
2274
2230
|
addtlInfo = "waiting for " + pending.join(", ");
|
|
2275
2231
|
}
|
|
2276
2232
|
} else if ( oModule.state === FAILED ) {
|
|
@@ -2293,7 +2249,7 @@
|
|
|
2293
2249
|
* @private
|
|
2294
2250
|
*/
|
|
2295
2251
|
function getUrlPrefixes() {
|
|
2296
|
-
|
|
2252
|
+
const mUrlPrefixesCopy = Object.create(null);
|
|
2297
2253
|
forEach(mUrlPrefixes, function(sNamePrefix, oUrlInfo) {
|
|
2298
2254
|
mUrlPrefixesCopy[sNamePrefix] = oUrlInfo.url;
|
|
2299
2255
|
});
|
|
@@ -2311,8 +2267,7 @@
|
|
|
2311
2267
|
* @private
|
|
2312
2268
|
*/
|
|
2313
2269
|
function unloadResources(sName, bPreloadGroup, bUnloadAll, bDeleteExports) {
|
|
2314
|
-
|
|
2315
|
-
sURN, oModule;
|
|
2270
|
+
const aModules = [];
|
|
2316
2271
|
|
|
2317
2272
|
if ( bPreloadGroup == null ) {
|
|
2318
2273
|
bPreloadGroup = true;
|
|
@@ -2320,13 +2275,12 @@
|
|
|
2320
2275
|
|
|
2321
2276
|
if ( bPreloadGroup ) {
|
|
2322
2277
|
// collect modules that belong to the given group
|
|
2323
|
-
for ( sURN in mModules ) {
|
|
2324
|
-
oModule = mModules[sURN];
|
|
2278
|
+
for ( const sURN in mModules ) {
|
|
2279
|
+
const oModule = mModules[sURN];
|
|
2325
2280
|
if ( oModule && oModule.group === sName ) {
|
|
2326
2281
|
aModules.push(sURN);
|
|
2327
2282
|
}
|
|
2328
2283
|
}
|
|
2329
|
-
|
|
2330
2284
|
} else {
|
|
2331
2285
|
// single module
|
|
2332
2286
|
if ( mModules[sName] ) {
|
|
@@ -2334,8 +2288,8 @@
|
|
|
2334
2288
|
}
|
|
2335
2289
|
}
|
|
2336
2290
|
|
|
2337
|
-
aModules.forEach(
|
|
2338
|
-
|
|
2291
|
+
aModules.forEach((sURN) => {
|
|
2292
|
+
const oModule = mModules[sURN];
|
|
2339
2293
|
if ( oModule && bDeleteExports && sURN.match(/\.js$/) ) {
|
|
2340
2294
|
// @evo-todo move to compat layer?
|
|
2341
2295
|
setGlobalProperty(urnToUI5(sURN), undefined);
|
|
@@ -2344,7 +2298,6 @@
|
|
|
2344
2298
|
delete mModules[sURN];
|
|
2345
2299
|
}
|
|
2346
2300
|
});
|
|
2347
|
-
|
|
2348
2301
|
}
|
|
2349
2302
|
|
|
2350
2303
|
function getModuleContent(name, url) {
|
|
@@ -2353,7 +2306,7 @@
|
|
|
2353
2306
|
} else {
|
|
2354
2307
|
name = guessResourceName(url, true);
|
|
2355
2308
|
}
|
|
2356
|
-
|
|
2309
|
+
const oModule = name && mModules[name];
|
|
2357
2310
|
if ( oModule ) {
|
|
2358
2311
|
oModule.state = LOADED;
|
|
2359
2312
|
return oModule.data;
|
|
@@ -2373,7 +2326,7 @@
|
|
|
2373
2326
|
* @private
|
|
2374
2327
|
*/
|
|
2375
2328
|
function getAllModules() {
|
|
2376
|
-
|
|
2329
|
+
const mSnapshot = Object.create(null);
|
|
2377
2330
|
forEach(mModules, function(sURN, oModule) {
|
|
2378
2331
|
mSnapshot[sURN] = {
|
|
2379
2332
|
state: oModule.state,
|
|
@@ -2385,24 +2338,24 @@
|
|
|
2385
2338
|
|
|
2386
2339
|
function loadJSResourceAsync(sResource, bIgnoreErrors) {
|
|
2387
2340
|
sResource = getMappedName(sResource);
|
|
2388
|
-
|
|
2341
|
+
const promise = requireModule(null, sResource, /* bAsync = */ true).then(unwrapExport);
|
|
2389
2342
|
return bIgnoreErrors ? promise.catch(noop) : promise;
|
|
2390
2343
|
}
|
|
2391
2344
|
|
|
2392
2345
|
// ---- config --------------------------------------------------------------------------------
|
|
2393
2346
|
|
|
2394
|
-
|
|
2395
|
-
baseUrl
|
|
2347
|
+
const mUI5ConfigHandlers = {
|
|
2348
|
+
baseUrl(url) {
|
|
2396
2349
|
registerResourcePath("", url);
|
|
2397
2350
|
},
|
|
2398
2351
|
paths: registerResourcePath, // has length 2
|
|
2399
|
-
shim
|
|
2352
|
+
shim(module, shim) {
|
|
2400
2353
|
if ( Array.isArray(shim) ) {
|
|
2401
2354
|
shim = { deps : shim };
|
|
2402
2355
|
}
|
|
2403
2356
|
mShims[module + '.js'] = shim;
|
|
2404
2357
|
},
|
|
2405
|
-
amd
|
|
2358
|
+
amd(bValue) {
|
|
2406
2359
|
bValue = !!bValue;
|
|
2407
2360
|
if ( bExposeAsAMDLoader !== bValue ) {
|
|
2408
2361
|
bExposeAsAMDLoader = bValue;
|
|
@@ -2421,38 +2374,38 @@
|
|
|
2421
2374
|
}
|
|
2422
2375
|
}
|
|
2423
2376
|
},
|
|
2424
|
-
async
|
|
2377
|
+
async(async) {
|
|
2425
2378
|
if (bGlobalAsyncMode && !async) {
|
|
2426
2379
|
throw new Error("Changing the ui5loader config from async to sync is not supported. Only a change from sync to async is allowed.");
|
|
2427
2380
|
}
|
|
2428
2381
|
bGlobalAsyncMode = !!async;
|
|
2429
2382
|
},
|
|
2430
|
-
bundles
|
|
2383
|
+
bundles(bundle, modules) {
|
|
2431
2384
|
bundle += '.js';
|
|
2432
|
-
modules.forEach(
|
|
2433
|
-
Module.get(module + '.js').group = bundle;
|
|
2434
|
-
|
|
2385
|
+
modules.forEach(
|
|
2386
|
+
(module) => { Module.get(module + '.js').group = bundle; }
|
|
2387
|
+
);
|
|
2435
2388
|
},
|
|
2436
|
-
bundlesUI5
|
|
2437
|
-
resources.forEach(
|
|
2438
|
-
Module.get(module).group = bundle;
|
|
2439
|
-
|
|
2389
|
+
bundlesUI5(bundle, resources) {
|
|
2390
|
+
resources.forEach(
|
|
2391
|
+
(module) => { Module.get(module).group = bundle; }
|
|
2392
|
+
);
|
|
2440
2393
|
},
|
|
2441
|
-
debugSources
|
|
2394
|
+
debugSources(debug) {
|
|
2442
2395
|
bDebugSources = !!debug;
|
|
2443
2396
|
},
|
|
2444
|
-
depCache
|
|
2445
|
-
mDepCache[module + '.js'] = deps.map(
|
|
2397
|
+
depCache(module, deps) {
|
|
2398
|
+
mDepCache[module + '.js'] = deps.map((dep) => dep + '.js');
|
|
2446
2399
|
},
|
|
2447
|
-
depCacheUI5
|
|
2400
|
+
depCacheUI5(module, deps) {
|
|
2448
2401
|
mDepCache[module] = deps;
|
|
2449
2402
|
},
|
|
2450
|
-
ignoreBundledResources
|
|
2403
|
+
ignoreBundledResources(filter) {
|
|
2451
2404
|
if ( filter == null || typeof filter === 'function' ) {
|
|
2452
2405
|
fnIgnorePreload = filter;
|
|
2453
2406
|
}
|
|
2454
2407
|
},
|
|
2455
|
-
map
|
|
2408
|
+
map(context, map) {
|
|
2456
2409
|
// @evo-todo ignore empty context, empty prefix?
|
|
2457
2410
|
if ( map == null ) {
|
|
2458
2411
|
delete mMaps[context];
|
|
@@ -2460,18 +2413,18 @@
|
|
|
2460
2413
|
// SystemJS style config
|
|
2461
2414
|
mMaps['*'][context] = map;
|
|
2462
2415
|
} else {
|
|
2463
|
-
mMaps[context]
|
|
2416
|
+
mMaps[context] ||= Object.create(null);
|
|
2464
2417
|
forEach(map, function(alias, name) {
|
|
2465
2418
|
mMaps[context][alias] = name;
|
|
2466
2419
|
});
|
|
2467
2420
|
}
|
|
2468
2421
|
},
|
|
2469
|
-
reportSyncCalls
|
|
2422
|
+
reportSyncCalls(report) {
|
|
2470
2423
|
if ( report === 0 || report === 1 || report === 2 ) {
|
|
2471
2424
|
syncCallBehavior = report;
|
|
2472
2425
|
}
|
|
2473
2426
|
},
|
|
2474
|
-
noConflict
|
|
2427
|
+
noConflict(bValue) {
|
|
2475
2428
|
log.warning("Config option 'noConflict' has been deprecated, use option 'amd' instead, if still needed.");
|
|
2476
2429
|
mUI5ConfigHandlers.amd(!bValue);
|
|
2477
2430
|
}
|
|
@@ -2481,9 +2434,9 @@
|
|
|
2481
2434
|
* Config handlers used when amd mode is enabled.
|
|
2482
2435
|
* References only methods defined in the AMD spec.
|
|
2483
2436
|
*/
|
|
2484
|
-
|
|
2437
|
+
const mAMDConfigHandlers = {
|
|
2485
2438
|
baseUrl: mUI5ConfigHandlers.baseUrl,
|
|
2486
|
-
paths
|
|
2439
|
+
paths(module, url) {
|
|
2487
2440
|
registerResourcePath(module, resolveURL(url, getResourcePath("") + "/"));
|
|
2488
2441
|
},
|
|
2489
2442
|
map: mUI5ConfigHandlers.map,
|
|
@@ -2499,7 +2452,7 @@
|
|
|
2499
2452
|
function handleConfigObject(oCfg, mHandlers) {
|
|
2500
2453
|
|
|
2501
2454
|
function processConfig(key, value) {
|
|
2502
|
-
|
|
2455
|
+
const handler = mHandlers[key];
|
|
2503
2456
|
if ( typeof handler === 'function' ) {
|
|
2504
2457
|
if ( handler.length === 1) {
|
|
2505
2458
|
handler(value);
|
|
@@ -2507,7 +2460,7 @@
|
|
|
2507
2460
|
forEach(value, handler);
|
|
2508
2461
|
}
|
|
2509
2462
|
} else {
|
|
2510
|
-
log.warning(
|
|
2463
|
+
log.warning(`configuration option ${key} not supported (ignored)`);
|
|
2511
2464
|
}
|
|
2512
2465
|
}
|
|
2513
2466
|
|
|
@@ -2551,80 +2504,71 @@
|
|
|
2551
2504
|
ui5Require.load = function(context, url, id) {
|
|
2552
2505
|
};
|
|
2553
2506
|
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
/* void */ declareModule( normalize(sResourceName) );
|
|
2507
|
+
const privateAPI = {
|
|
2508
|
+
|
|
2509
|
+
// properties
|
|
2510
|
+
get assert() {
|
|
2511
|
+
return assert;
|
|
2560
2512
|
},
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
getAllModules: getAllModules,
|
|
2564
|
-
getModuleContent: getModuleContent,
|
|
2565
|
-
getModuleState: function(sResourceName) {
|
|
2566
|
-
return mModules[sResourceName] ? mModules[sResourceName].state : INITIAL;
|
|
2513
|
+
set assert(v) {
|
|
2514
|
+
assert = v;
|
|
2567
2515
|
},
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
getUrlPrefixes: getUrlPrefixes,
|
|
2571
|
-
loadJSResourceAsync: loadJSResourceAsync,
|
|
2572
|
-
resolveURL: resolveURL,
|
|
2573
|
-
guessResourceName: guessResourceName,
|
|
2574
|
-
toUrl: toUrl,
|
|
2575
|
-
unloadResources: unloadResources
|
|
2576
|
-
};
|
|
2577
|
-
Object.defineProperties(privateAPI, {
|
|
2578
|
-
logger: {
|
|
2579
|
-
get: function() {
|
|
2580
|
-
return log;
|
|
2581
|
-
},
|
|
2582
|
-
set: function(v) {
|
|
2583
|
-
log = v;
|
|
2584
|
-
aEarlyLogs.forEach(function(earlyLog) {
|
|
2585
|
-
log[earlyLog.level](earlyLog.message);
|
|
2586
|
-
});
|
|
2587
|
-
}
|
|
2516
|
+
get logger() {
|
|
2517
|
+
return log;
|
|
2588
2518
|
},
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
},
|
|
2593
|
-
set: function(v) {
|
|
2594
|
-
measure = v;
|
|
2595
|
-
}
|
|
2519
|
+
set logger(v) {
|
|
2520
|
+
log = v;
|
|
2521
|
+
aEarlyLogs.forEach(({level, message}) => log[level](message));
|
|
2596
2522
|
},
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
return assert;
|
|
2600
|
-
},
|
|
2601
|
-
set: function(v) {
|
|
2602
|
-
assert = v;
|
|
2603
|
-
}
|
|
2523
|
+
get measure() {
|
|
2524
|
+
return measure;
|
|
2604
2525
|
},
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
return translate;
|
|
2608
|
-
},
|
|
2609
|
-
set: function(v) {
|
|
2610
|
-
translate = v;
|
|
2611
|
-
}
|
|
2526
|
+
set measure(v) {
|
|
2527
|
+
measure = v;
|
|
2612
2528
|
},
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
return simulateAsyncCallback === executeInMicroTask;
|
|
2616
|
-
},
|
|
2617
|
-
set: function(v) {
|
|
2618
|
-
simulateAsyncCallback = v ? executeInMicroTask : executeInSeparateTask;
|
|
2619
|
-
}
|
|
2529
|
+
get translate() {
|
|
2530
|
+
return translate;
|
|
2620
2531
|
},
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2532
|
+
set translate(v) {
|
|
2533
|
+
translate = v;
|
|
2534
|
+
},
|
|
2535
|
+
get callbackInMicroTask() {
|
|
2536
|
+
return simulateAsyncCallback === executeInMicroTask;
|
|
2537
|
+
},
|
|
2538
|
+
set callbackInMicroTask(v) {
|
|
2539
|
+
simulateAsyncCallback = v ? executeInMicroTask : executeInSeparateTask;
|
|
2540
|
+
},
|
|
2541
|
+
get maxTaskDuration() {
|
|
2542
|
+
return iMaxTaskDuration;
|
|
2543
|
+
},
|
|
2544
|
+
set maxTaskDuration(v) {
|
|
2545
|
+
updateMaxTaskDuration(v);
|
|
2546
|
+
},
|
|
2547
|
+
|
|
2548
|
+
// methods
|
|
2549
|
+
amdDefine,
|
|
2550
|
+
amdRequire,
|
|
2551
|
+
config: ui5Config,
|
|
2552
|
+
declareModule(sResourceName) {
|
|
2553
|
+
/* void */ declareModule( normalize(sResourceName) );
|
|
2554
|
+
},
|
|
2555
|
+
defineModuleSync,
|
|
2556
|
+
dump: dumpInternals,
|
|
2557
|
+
getAllModules,
|
|
2558
|
+
getModuleContent,
|
|
2559
|
+
getModuleState(sResourceName) {
|
|
2560
|
+
return mModules[sResourceName] ? mModules[sResourceName].state : INITIAL;
|
|
2561
|
+
},
|
|
2562
|
+
getResourcePath,
|
|
2563
|
+
getSyncCallBehavior,
|
|
2564
|
+
getUrlPrefixes,
|
|
2565
|
+
loadJSResourceAsync,
|
|
2566
|
+
resolveURL,
|
|
2567
|
+
guessResourceName,
|
|
2568
|
+
toUrl,
|
|
2569
|
+
unloadResources
|
|
2570
|
+
};
|
|
2571
|
+
|
|
2628
2572
|
|
|
2629
2573
|
// establish APIs in the sap.ui namespace
|
|
2630
2574
|
|
|
@@ -3302,4 +3246,4 @@
|
|
|
3302
3246
|
*/
|
|
3303
3247
|
sap.ui.requireSync = requireSync;
|
|
3304
3248
|
|
|
3305
|
-
}(
|
|
3249
|
+
}(globalThis));
|