@openui5/sap.ui.core 1.108.2 → 1.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +7 -25
- package/.reuse/dep5 +16 -16
- package/THIRDPARTY.txt +2 -2
- package/package.json +1 -1
- package/src/jquery.sap.act.js +1 -1
- package/src/jquery.sap.dom.js +1 -1
- package/src/jquery.sap.encoder.js +1 -1
- package/src/jquery.sap.events.js +1 -1
- package/src/jquery.sap.global.js +2 -2
- package/src/jquery.sap.history.js +1 -1
- package/src/jquery.sap.keycodes.js +1 -1
- package/src/jquery.sap.mobile.js +1 -1
- package/src/jquery.sap.promise.js +1 -1
- package/src/jquery.sap.properties.js +2 -2
- package/src/jquery.sap.resources.js +2 -2
- package/src/jquery.sap.script.js +2 -2
- package/src/jquery.sap.sjax.js +1 -1
- package/src/jquery.sap.storage.js +4 -4
- package/src/jquery.sap.strings.js +1 -1
- package/src/jquery.sap.stubs.js +1 -1
- package/src/jquery.sap.trace.js +1 -1
- package/src/jquery.sap.ui.js +1 -1
- package/src/jquery.sap.xml.js +1 -1
- package/src/sap/base/Log.js +126 -85
- package/src/sap/base/assert.js +1 -1
- package/src/sap/base/i18n/ResourceBundle.js +42 -12
- package/src/sap/base/security/URLListValidator.js +1 -1
- package/src/sap/base/security/URLWhitelist.js +1 -1
- package/src/sap/base/security/encodeCSS.js +1 -1
- package/src/sap/base/security/encodeJS.js +1 -1
- package/src/sap/base/security/encodeURL.js +1 -1
- package/src/sap/base/security/encodeURLParameters.js +1 -1
- package/src/sap/base/security/encodeXML.js +1 -1
- package/src/sap/base/security/sanitizeHTML.js +1 -1
- package/src/sap/base/strings/camelize.js +1 -1
- package/src/sap/base/strings/capitalize.js +1 -1
- package/src/sap/base/strings/escapeRegExp.js +1 -1
- package/src/sap/base/strings/formatMessage.js +1 -1
- package/src/sap/base/strings/hash.js +1 -1
- package/src/sap/base/strings/hyphenate.js +1 -1
- package/src/sap/base/strings/toHex.js +1 -1
- package/src/sap/base/strings/whitespaceReplacer.js +1 -1
- package/src/sap/base/util/Deferred.js +1 -1
- package/src/sap/base/util/JSTokenizer.js +1 -1
- package/src/sap/base/util/LoaderExtensions.js +1 -1
- package/src/sap/base/util/ObjectPath.js +1 -1
- package/src/sap/base/util/Properties.js +1 -1
- package/src/sap/base/util/UriParameters.js +1 -1
- package/src/sap/base/util/Version.js +1 -1
- package/src/sap/base/util/_merge.js +1 -1
- package/src/sap/base/util/array/diff.js +1 -1
- package/src/sap/base/util/array/uniqueSort.js +1 -1
- package/src/sap/base/util/deepClone.js +1 -1
- package/src/sap/base/util/deepEqual.js +1 -1
- package/src/sap/base/util/deepExtend.js +1 -1
- package/src/sap/base/util/defineCoupledProperty.js +1 -1
- package/src/sap/base/util/defineLazyProperty.js +1 -1
- package/src/sap/base/util/each.js +1 -1
- package/src/sap/base/util/extend.js +1 -1
- package/src/sap/base/util/fetch.js +4 -4
- package/src/sap/base/util/includes.js +2 -2
- package/src/sap/base/util/isEmptyObject.js +1 -1
- package/src/sap/base/util/isPlainObject.js +1 -1
- package/src/sap/base/util/merge.js +1 -1
- package/src/sap/base/util/mixedFetch.js +1 -1
- package/src/sap/base/util/now.js +1 -1
- package/src/sap/base/util/resolveReference.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +2 -2
- package/src/sap/base/util/restricted/_compact.js +2 -2
- package/src/sap/base/util/restricted/_curry.js +2 -2
- package/src/sap/base/util/restricted/_debounce.js +2 -2
- package/src/sap/base/util/restricted/_difference.js +2 -2
- package/src/sap/base/util/restricted/_differenceBy.js +2 -2
- package/src/sap/base/util/restricted/_differenceWith.js +2 -2
- package/src/sap/base/util/restricted/_flatMap.js +2 -2
- package/src/sap/base/util/restricted/_flatMapDeep.js +2 -2
- package/src/sap/base/util/restricted/_flatMapDepth.js +2 -2
- package/src/sap/base/util/restricted/_flatten.js +2 -2
- package/src/sap/base/util/restricted/_flattenDeep.js +2 -2
- package/src/sap/base/util/restricted/_flattenDepth.js +2 -2
- package/src/sap/base/util/restricted/_intersection.js +2 -2
- package/src/sap/base/util/restricted/_intersectionBy.js +2 -2
- package/src/sap/base/util/restricted/_intersectionWith.js +2 -2
- package/src/sap/base/util/restricted/_isEqual.js +2 -2
- package/src/sap/base/util/restricted/_isEqualWith.js +2 -2
- package/src/sap/base/util/restricted/_isNil.js +2 -2
- package/src/sap/base/util/restricted/_max.js +2 -2
- package/src/sap/base/util/restricted/_merge.js +2 -2
- package/src/sap/base/util/restricted/_mergeWith.js +2 -2
- package/src/sap/base/util/restricted/_min.js +2 -2
- package/src/sap/base/util/restricted/_omit.js +2 -2
- package/src/sap/base/util/restricted/_pick.js +2 -2
- package/src/sap/base/util/restricted/_pickBy.js +2 -2
- package/src/sap/base/util/restricted/_throttle.js +2 -2
- package/src/sap/base/util/restricted/_toArray.js +2 -2
- package/src/sap/base/util/restricted/_union.js +2 -2
- package/src/sap/base/util/restricted/_unionBy.js +2 -2
- package/src/sap/base/util/restricted/_unionWith.js +2 -2
- package/src/sap/base/util/restricted/_uniq.js +2 -2
- package/src/sap/base/util/restricted/_uniqBy.js +2 -2
- package/src/sap/base/util/restricted/_uniqWith.js +2 -2
- package/src/sap/base/util/restricted/_without.js +2 -2
- package/src/sap/base/util/restricted/_xor.js +2 -2
- package/src/sap/base/util/restricted/_xorBy.js +2 -2
- package/src/sap/base/util/restricted/_xorWith.js +2 -2
- package/src/sap/base/util/restricted/_zipObject.js +2 -2
- package/src/sap/base/util/restricted/_zipObjectDeep.js +2 -2
- package/src/sap/base/util/syncFetch.js +2 -2
- package/src/sap/base/util/uid.js +1 -1
- package/src/sap/base/util/values.js +3 -2
- package/src/sap/ui/Device.js +4 -4
- package/src/sap/ui/Global.js +5 -5
- package/src/sap/ui/VersionInfo.js +1 -1
- package/src/sap/ui/base/BindingInfo.js +1 -1
- package/src/sap/ui/base/BindingParser.js +1 -1
- package/src/sap/ui/base/DataType.js +1 -1
- package/src/sap/ui/base/Event.js +2 -2
- package/src/sap/ui/base/EventProvider.js +2 -2
- package/src/sap/ui/base/Exception.js +1 -1
- package/src/sap/ui/base/ExpressionParser.js +1 -1
- package/src/sap/ui/base/Interface.js +2 -2
- package/src/sap/ui/base/ManagedObject.js +337 -233
- package/src/sap/ui/base/ManagedObjectMetadata.js +8 -6
- package/src/sap/ui/base/ManagedObjectObserver.js +1 -1
- package/src/sap/ui/base/ManagedObjectRegistry.js +1 -1
- package/src/sap/ui/base/Metadata.js +2 -2
- package/src/sap/ui/base/Object.js +21 -12
- package/src/sap/ui/base/ObjectPool.js +2 -2
- package/src/sap/ui/base/SyncPromise.js +1 -1
- package/src/sap/ui/base/syncXHRFix.js +1 -1
- package/src/sap/ui/core/.library +4 -4
- package/src/sap/ui/core/AccessKeysEnablement.js +1 -1
- package/src/sap/ui/core/AppCacheBuster.js +1 -1
- package/src/sap/ui/core/BlockLayerUtils.js +11 -4
- package/src/sap/ui/core/BusyIndicator.js +7 -5
- package/src/sap/ui/core/BusyIndicatorUtils.js +1 -1
- package/src/sap/ui/core/CalendarType.js +1 -1
- package/src/sap/ui/core/CommandExecution.js +1 -1
- package/src/sap/ui/core/Component.js +48 -34
- package/src/sap/ui/core/ComponentContainer.js +3 -3
- package/src/sap/ui/core/ComponentContainerRenderer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +2 -2
- package/src/sap/ui/core/ComponentSupport.js +2 -2
- package/src/sap/ui/core/Configuration.js +10 -7
- package/src/sap/ui/core/ContextMenuSupport.js +1 -1
- package/src/sap/ui/core/Control.js +11 -21
- package/src/sap/ui/core/Core.js +66 -986
- package/src/sap/ui/core/CustomData.js +2 -2
- package/src/sap/ui/core/CustomStyleClassSupport.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +2 -2
- package/src/sap/ui/core/Element.js +109 -28
- package/src/sap/ui/core/ElementMetadata.js +2 -2
- package/src/sap/ui/core/EnabledPropagator.js +2 -2
- package/src/sap/ui/core/EventBus.js +2 -2
- package/src/sap/ui/core/ExtensionPoint.js +1 -1
- package/src/sap/ui/core/FocusHandler.js +1 -1
- package/src/sap/ui/core/Fragment.js +2 -2
- package/src/sap/ui/core/HTML.js +2 -2
- package/src/sap/ui/core/HTMLRenderer.js +1 -1
- package/src/sap/ui/core/History.js +2 -2
- package/src/sap/ui/core/Icon.js +5 -3
- package/src/sap/ui/core/IconPool.js +1 -1
- package/src/sap/ui/core/IconRenderer.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +6 -6
- package/src/sap/ui/core/IntervalTrigger.js +2 -2
- package/src/sap/ui/core/InvisibleMessage.js +2 -2
- package/src/sap/ui/core/InvisibleRenderer.js +2 -2
- package/src/sap/ui/core/InvisibleText.js +11 -7
- package/src/sap/ui/core/Item.js +2 -2
- package/src/sap/ui/core/LabelEnablement.js +2 -2
- package/src/sap/ui/core/LayoutData.js +2 -2
- package/src/sap/ui/core/Lib.js +1595 -0
- package/src/sap/ui/core/ListItem.js +2 -2
- package/src/sap/ui/core/LocalBusyIndicator.js +2 -2
- package/src/sap/ui/core/LocalBusyIndicatorRenderer.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicatorSupport.js +1 -1
- package/src/sap/ui/core/Locale.js +2 -2
- package/src/sap/ui/core/LocaleData.js +254 -26
- package/src/sap/ui/core/Manifest.js +5 -3
- package/src/sap/ui/core/Message.js +2 -2
- package/src/sap/ui/core/Patcher.js +1 -1
- package/src/sap/ui/core/Placeholder.js +3 -3
- package/src/sap/ui/core/Popup.js +1 -1
- package/src/sap/ui/core/RenderManager.js +83 -51
- package/src/sap/ui/core/Renderer.js +2 -2
- package/src/sap/ui/core/Rendering.js +30 -10
- package/src/sap/ui/core/ResizeHandler.js +61 -21
- package/src/sap/ui/core/ScrollBar.js +2 -2
- package/src/sap/ui/core/ScrollBarRenderer.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +2 -2
- package/src/sap/ui/core/Shortcut.js +1 -1
- package/src/sap/ui/core/ShortcutHint.js +5 -5
- package/src/sap/ui/core/ShortcutHintsMixin.js +1 -1
- package/src/sap/ui/core/StashedControlSupport.js +1 -1
- package/src/sap/ui/core/Title.js +2 -2
- package/src/sap/ui/core/TooltipBase.js +2 -2
- package/src/sap/ui/core/UIArea.js +10 -8
- package/src/sap/ui/core/UIComponent.js +9 -7
- package/src/sap/ui/core/UIComponentMetadata.js +2 -2
- package/src/sap/ui/core/ValueStateSupport.js +6 -6
- package/src/sap/ui/core/VariantLayoutData.js +2 -2
- package/src/sap/ui/core/XMLComposite.js +2 -2
- package/src/sap/ui/core/XMLCompositeMetadata.js +2 -2
- package/src/sap/ui/core/XMLTemplateProcessor.js +7 -7
- package/src/sap/ui/core/_ConfigurationProvider.js +1 -1
- package/src/sap/ui/core/_IconRegistry.js +5 -4
- package/src/sap/ui/core/_UrlResolver.js +1 -1
- package/src/sap/ui/core/cache/CacheManager.js +1 -1
- package/src/sap/ui/core/cache/CacheManagerNOP.js +1 -1
- package/src/sap/ui/core/cache/LRUPersistentCache.js +1 -1
- package/src/sap/ui/core/cldr/ar.json +1133 -429
- package/src/sap/ui/core/cldr/ar_EG.json +1133 -429
- package/src/sap/ui/core/cldr/ar_SA.json +1228 -525
- package/src/sap/ui/core/cldr/bg.json +815 -284
- package/src/sap/ui/core/cldr/ca.json +670 -101
- package/src/sap/ui/core/cldr/cs.json +689 -60
- package/src/sap/ui/core/cldr/cy.json +714 -325
- package/src/sap/ui/core/cldr/da.json +814 -305
- package/src/sap/ui/core/cldr/de.json +679 -115
- package/src/sap/ui/core/cldr/de_AT.json +669 -105
- package/src/sap/ui/core/cldr/de_CH.json +681 -117
- package/src/sap/ui/core/cldr/el.json +603 -128
- package/src/sap/ui/core/cldr/el_CY.json +603 -128
- package/src/sap/ui/core/cldr/en.json +600 -34
- package/src/sap/ui/core/cldr/en_AU.json +787 -210
- package/src/sap/ui/core/cldr/en_GB.json +759 -181
- package/src/sap/ui/core/cldr/en_HK.json +801 -221
- package/src/sap/ui/core/cldr/en_IE.json +800 -223
- package/src/sap/ui/core/cldr/en_IN.json +804 -223
- package/src/sap/ui/core/cldr/en_NZ.json +799 -222
- package/src/sap/ui/core/cldr/en_PG.json +800 -223
- package/src/sap/ui/core/cldr/en_SG.json +789 -209
- package/src/sap/ui/core/cldr/en_ZA.json +797 -220
- package/src/sap/ui/core/cldr/es.json +884 -385
- package/src/sap/ui/core/cldr/es_AR.json +791 -291
- package/src/sap/ui/core/cldr/es_BO.json +800 -300
- package/src/sap/ui/core/cldr/es_CL.json +758 -258
- package/src/sap/ui/core/cldr/es_CO.json +759 -259
- package/src/sap/ui/core/cldr/es_MX.json +945 -445
- package/src/sap/ui/core/cldr/es_PE.json +725 -225
- package/src/sap/ui/core/cldr/es_UY.json +729 -229
- package/src/sap/ui/core/cldr/es_VE.json +728 -228
- package/src/sap/ui/core/cldr/et.json +763 -232
- package/src/sap/ui/core/cldr/fa.json +975 -416
- package/src/sap/ui/core/cldr/fi.json +755 -125
- package/src/sap/ui/core/cldr/fr.json +606 -65
- package/src/sap/ui/core/cldr/fr_BE.json +603 -62
- package/src/sap/ui/core/cldr/fr_CA.json +622 -81
- package/src/sap/ui/core/cldr/fr_CH.json +603 -62
- package/src/sap/ui/core/cldr/fr_LU.json +606 -65
- package/src/sap/ui/core/cldr/he.json +1097 -538
- package/src/sap/ui/core/cldr/hi.json +630 -100
- package/src/sap/ui/core/cldr/hr.json +833 -80
- package/src/sap/ui/core/cldr/hu.json +670 -82
- package/src/sap/ui/core/cldr/id.json +686 -174
- package/src/sap/ui/core/cldr/it.json +586 -76
- package/src/sap/ui/core/cldr/it_CH.json +586 -76
- package/src/sap/ui/core/cldr/ja.json +592 -41
- package/src/sap/ui/core/cldr/kk.json +614 -69
- package/src/sap/ui/core/cldr/ko.json +673 -120
- package/src/sap/ui/core/cldr/lt.json +622 -87
- package/src/sap/ui/core/cldr/lv.json +741 -202
- package/src/sap/ui/core/cldr/ms.json +731 -250
- package/src/sap/ui/core/cldr/nb.json +624 -98
- package/src/sap/ui/core/cldr/nl.json +642 -63
- package/src/sap/ui/core/cldr/nl_BE.json +642 -63
- package/src/sap/ui/core/cldr/pl.json +821 -168
- package/src/sap/ui/core/cldr/pt.json +862 -350
- package/src/sap/ui/core/cldr/pt_PT.json +860 -346
- package/src/sap/ui/core/cldr/ro.json +668 -123
- package/src/sap/ui/core/cldr/ru.json +801 -211
- package/src/sap/ui/core/cldr/ru_UA.json +800 -210
- package/src/sap/ui/core/cldr/sk.json +674 -48
- package/src/sap/ui/core/cldr/sl.json +921 -295
- package/src/sap/ui/core/cldr/sr.json +698 -177
- package/src/sap/ui/core/cldr/sr_Latn.json +687 -178
- package/src/sap/ui/core/cldr/sv.json +770 -250
- package/src/sap/ui/core/cldr/th.json +746 -162
- package/src/sap/ui/core/cldr/tr.json +688 -98
- package/src/sap/ui/core/cldr/uk.json +936 -333
- package/src/sap/ui/core/cldr/vi.json +582 -70
- package/src/sap/ui/core/cldr/zh_CN.json +889 -333
- package/src/sap/ui/core/cldr/zh_HK.json +860 -304
- package/src/sap/ui/core/cldr/zh_SG.json +865 -309
- package/src/sap/ui/core/cldr/zh_TW.json +747 -177
- package/src/sap/ui/core/date/Buddhist.js +1 -1
- package/src/sap/ui/core/date/CalendarUtils.js +1 -1
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +1 -1
- package/src/sap/ui/core/date/Gregorian.js +1 -1
- package/src/sap/ui/core/date/Islamic.js +1 -1
- package/src/sap/ui/core/date/Japanese.js +31 -1
- package/src/sap/ui/core/date/Persian.js +1 -1
- package/src/sap/ui/core/date/UniversalDate.js +1 -1
- package/src/sap/ui/core/date/UniversalDateUtils.js +1 -1
- package/src/sap/ui/core/date/_Calendars.js +1 -1
- package/src/sap/ui/core/delegate/ItemNavigation.js +18 -14
- package/src/sap/ui/core/delegate/ScrollEnablement.js +40 -3
- package/src/sap/ui/core/designtime/ComponentContainer.designtime.js +1 -1
- package/src/sap/ui/core/designtime/CustomData.designtime.js +1 -1
- package/src/sap/ui/core/designtime/Icon.designtime.js +1 -1
- package/src/sap/ui/core/designtime/UIComponent.designtime.js +1 -1
- package/src/sap/ui/core/designtime/library.designtime.js +1 -1
- package/src/sap/ui/core/designtime/mvc/ControllerExtensionTemplate.js +1 -1
- package/src/sap/ui/core/designtime/mvc/View.designtime.js +1 -1
- package/src/sap/ui/core/designtime/mvc/XMLView.designtime.js +1 -1
- package/src/sap/ui/core/dnd/DragAndDrop.js +3 -3
- package/src/sap/ui/core/dnd/DragDropBase.js +2 -2
- package/src/sap/ui/core/dnd/DragDropInfo.js +2 -2
- package/src/sap/ui/core/dnd/DragInfo.js +2 -2
- package/src/sap/ui/core/dnd/DropInfo.js +2 -2
- package/src/sap/ui/core/format/DateFormat.js +549 -294
- package/src/sap/ui/core/format/DateFormatTimezoneDisplay.js +1 -1
- package/src/sap/ui/core/format/FileSizeFormat.js +15 -5
- package/src/sap/ui/core/format/ListFormat.js +1 -1
- package/src/sap/ui/core/format/NumberFormat.js +155 -161
- package/src/sap/ui/core/format/TimezoneUtil.js +3 -3
- package/src/sap/ui/core/hyphenation/Hyphenation.js +2 -2
- package/src/sap/ui/core/hyphenation/HyphenationTestingWords.js +1 -1
- package/src/sap/ui/core/library.js +41 -13
- package/src/sap/ui/core/library.support.js +1 -1
- package/src/sap/ui/core/message/ControlMessageProcessor.js +2 -2
- package/src/sap/ui/core/message/Message.js +2 -2
- package/src/sap/ui/core/message/MessageManager.js +2 -2
- package/src/sap/ui/core/message/MessageMixin.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +2 -2
- package/src/sap/ui/core/message/MessageProcessor.js +2 -2
- package/src/sap/ui/core/messagebundle_bg.properties +1 -1
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/messagebundle_th.properties +1 -1
- package/src/sap/ui/core/mvc/Controller.js +1 -1
- package/src/sap/ui/core/mvc/ControllerExtension.js +1 -1
- package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +1 -1
- package/src/sap/ui/core/mvc/ControllerMetadata.js +1 -1
- package/src/sap/ui/core/mvc/EventHandlerResolver.js +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +2 -2
- package/src/sap/ui/core/mvc/HTMLViewRenderer.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +2 -2
- package/src/sap/ui/core/mvc/JSONViewRenderer.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +2 -2
- package/src/sap/ui/core/mvc/JSViewRenderer.js +1 -1
- package/src/sap/ui/core/mvc/OverrideExecution.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +2 -2
- package/src/sap/ui/core/mvc/TemplateViewRenderer.js +1 -1
- package/src/sap/ui/core/mvc/View.js +4 -9
- package/src/sap/ui/core/mvc/ViewRenderer.js +1 -1
- package/src/sap/ui/core/mvc/ViewType.js +5 -1
- package/src/sap/ui/core/mvc/XMLProcessingMode.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +2 -2
- package/src/sap/ui/core/mvc/XMLViewRenderer.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +2 -2
- package/src/sap/ui/core/plugin/LessSupport.js +3 -3
- package/src/sap/ui/core/plugin/TemplatingSupport.js +2 -2
- package/src/sap/ui/core/postmessage/Bus.js +13 -18
- package/src/sap/ui/core/postmessage/confirmationDialog.js +2 -2
- package/src/sap/ui/core/routing/HashChanger.js +1 -1
- package/src/sap/ui/core/routing/HashChangerBase.js +1 -1
- package/src/sap/ui/core/routing/History.js +1 -1
- package/src/sap/ui/core/routing/Route.js +1 -1
- package/src/sap/ui/core/routing/Router.js +1 -1
- package/src/sap/ui/core/routing/RouterHashChanger.js +1 -1
- package/src/sap/ui/core/routing/Target.js +19 -3
- package/src/sap/ui/core/routing/TargetCache.js +1 -1
- package/src/sap/ui/core/routing/Targets.js +7 -15
- package/src/sap/ui/core/routing/Views.js +1 -1
- package/src/sap/ui/core/routing/async/Route.js +1 -1
- package/src/sap/ui/core/routing/async/Target.js +15 -23
- package/src/sap/ui/core/routing/async/TargetCache.js +1 -3
- package/src/sap/ui/core/routing/async/Targets.js +1 -1
- package/src/sap/ui/core/routing/sync/Route.js +1 -1
- package/src/sap/ui/core/routing/sync/Target.js +1 -2
- package/src/sap/ui/core/routing/sync/TargetCache.js +1 -1
- package/src/sap/ui/core/routing/sync/Targets.js +1 -1
- package/src/sap/ui/core/rules/App.support.js +1 -1
- package/src/sap/ui/core/rules/Config.support.js +1 -1
- package/src/sap/ui/core/rules/CoreHelper.support.js +1 -1
- package/src/sap/ui/core/rules/Misc.support.js +1 -1
- package/src/sap/ui/core/rules/Model.support.js +1 -1
- package/src/sap/ui/core/rules/Rendering.support.js +1 -1
- package/src/sap/ui/core/rules/Theming.support.js +1 -1
- package/src/sap/ui/core/rules/View.support.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +2 -2
- package/src/sap/ui/core/search/SearchProvider.js +2 -2
- package/src/sap/ui/core/service/Service.js +2 -2
- package/src/sap/ui/core/service/ServiceFactory.js +2 -2
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +2 -2
- package/src/sap/ui/core/support/BootSupportTool.js +1 -1
- package/src/sap/ui/core/support/Hotkeys.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +2 -2
- package/src/sap/ui/core/support/RuleEngineOpaExtension.js +9 -8
- package/src/sap/ui/core/support/Support.js +20 -12
- package/src/sap/ui/core/support/ToolsAPI.js +1 -1
- package/src/sap/ui/core/support/bootstrapFallback.js +1 -1
- package/src/sap/ui/core/support/controls/InteractionSlider.js +1 -1
- package/src/sap/ui/core/support/controls/InteractionTree.js +1 -1
- package/src/sap/ui/core/support/controls/ObjectViewer.js +1 -1
- package/src/sap/ui/core/support/controls/TimelineOverview.js +1 -1
- package/src/sap/ui/core/support/controls/TreeViewer.js +1 -1
- package/src/sap/ui/core/support/debugReboot.js +1 -1
- package/src/sap/ui/core/support/plugins/Breakpoint.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
- package/src/sap/ui/core/support/plugins/Debugging.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +2 -2
- package/src/sap/ui/core/support/plugins/LocalStorage.js +2 -2
- package/src/sap/ui/core/support/plugins/Performance.js +2 -2
- package/src/sap/ui/core/support/plugins/Selector.js +2 -2
- package/src/sap/ui/core/support/plugins/TechInfo.js +2 -2
- package/src/sap/ui/core/support/plugins/Trace.js +2 -2
- package/src/sap/ui/core/support/plugins/ViewInfo.js +2 -2
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.fragment.xml +2 -1
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +8 -6
- package/src/sap/ui/core/support/techinfo/TechnicalInfoDebugDialog.fragment.xml +1 -0
- package/src/sap/ui/core/support/techinfo/moduleTreeHelper.js +1 -1
- package/src/sap/ui/core/support/trace/E2eTraceLib.js +1 -1
- package/src/sap/ui/core/support/trace/EppLib.js +1 -1
- package/src/sap/ui/core/support/usage/EventBroadcaster.js +1 -1
- package/src/sap/ui/core/syncStyleClass.js +1 -1
- package/src/sap/ui/core/themes/base/Icon.less +17 -4
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +1 -1
- package/src/sap/ui/core/themes/base/base.less +606 -92
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/global.less +64 -0
- package/src/sap/ui/core/themes/base/library.source.less +1 -1
- package/src/sap/ui/core/themes/sap_hcb/global.less +65 -0
- package/src/sap/ui/core/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/core/theming/Parameters.js +15 -14
- package/src/sap/ui/core/theming/ThemeHelper.js +48 -26
- package/src/sap/ui/core/theming/ThemeManager.js +4 -22
- package/src/sap/ui/core/tmpl/DOMAttribute.js +2 -2
- package/src/sap/ui/core/tmpl/DOMElement.js +2 -2
- package/src/sap/ui/core/tmpl/DOMElementRenderer.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +2 -2
- package/src/sap/ui/core/tmpl/Template.js +2 -2
- package/src/sap/ui/core/tmpl/TemplateControl.js +2 -2
- package/src/sap/ui/core/tmpl/TemplateControlRenderer.js +1 -1
- package/src/sap/ui/core/tmpl/_parsePath.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +2 -2
- package/src/sap/ui/core/util/DraftEnabledMockServer.js +1 -1
- package/src/sap/ui/core/util/Export.js +2 -2
- package/src/sap/ui/core/util/ExportCell.js +2 -2
- package/src/sap/ui/core/util/ExportColumn.js +2 -2
- package/src/sap/ui/core/util/ExportRow.js +2 -2
- package/src/sap/ui/core/util/ExportType.js +2 -2
- package/src/sap/ui/core/util/ExportTypeCSV.js +2 -2
- package/src/sap/ui/core/util/File.js +2 -2
- package/src/sap/ui/core/util/LibraryInfo.js +2 -2
- package/src/sap/ui/core/util/MockServer.js +2 -2
- package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +2 -2
- package/src/sap/ui/core/util/ResponsivePaddingsEnablement.js +1 -1
- package/src/sap/ui/core/util/ShortcutHelper.js +1 -1
- package/src/sap/ui/core/util/XMLPreprocessor.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +13 -1
- package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +28 -4
- package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +17 -4
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +2 -2
- package/src/sap/ui/core/util/serializer/Serializer.js +2 -2
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +2 -2
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +2 -2
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +2 -2
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +2 -2
- package/src/sap/ui/core/util/serializer/delegate/XML.js +2 -2
- package/src/sap/ui/core/ws/ReadyState.js +2 -2
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +2 -2
- package/src/sap/ui/core/ws/WebSocket.js +2 -2
- package/src/sap/ui/debug/ControlTree.js +2 -2
- package/src/sap/ui/debug/DebugEnv.js +2 -2
- package/src/sap/ui/debug/Highlighter.js +1 -1
- package/src/sap/ui/debug/LogViewer.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +2 -2
- package/src/sap/ui/dom/_ready.js +1 -1
- package/src/sap/ui/dom/containsOrEquals.js +1 -1
- package/src/sap/ui/dom/denormalizeScrollBeginRTL.js +1 -1
- package/src/sap/ui/dom/denormalizeScrollLeftRTL.js +1 -1
- package/src/sap/ui/dom/getComputedStyleFix.js +1 -1
- package/src/sap/ui/dom/getFirstEditableInput.js +1 -1
- package/src/sap/ui/dom/getOwnerWindow.js +1 -1
- package/src/sap/ui/dom/getScrollbarSize.js +1 -1
- package/src/sap/ui/dom/includeScript.js +1 -1
- package/src/sap/ui/dom/includeStylesheet.js +1 -1
- package/src/sap/ui/dom/isBehindOtherElement.js +53 -0
- package/src/sap/ui/dom/isHidden.js +1 -1
- package/src/sap/ui/dom/jquery/Aria.js +1 -1
- package/src/sap/ui/dom/jquery/Focusable.js +1 -1
- package/src/sap/ui/dom/jquery/Selection.js +1 -1
- package/src/sap/ui/dom/jquery/Selectors.js +1 -1
- package/src/sap/ui/dom/jquery/control.js +1 -1
- package/src/sap/ui/dom/jquery/cursorPos.js +1 -1
- package/src/sap/ui/dom/jquery/getSelectedText.js +1 -1
- package/src/sap/ui/dom/jquery/hasTabIndex.js +1 -1
- package/src/sap/ui/dom/jquery/parentByAttribute.js +1 -1
- package/src/sap/ui/dom/jquery/rect.js +1 -1
- package/src/sap/ui/dom/jquery/rectContains.js +1 -1
- package/src/sap/ui/dom/jquery/scrollLeftRTL.js +1 -1
- package/src/sap/ui/dom/jquery/scrollRightRTL.js +1 -1
- package/src/sap/ui/dom/jquery/selectText.js +1 -1
- package/src/sap/ui/dom/jquery/zIndex.js +1 -1
- package/src/sap/ui/dom/units/Rem.js +1 -1
- package/src/sap/ui/events/ControlEvents.js +1 -1
- package/src/sap/ui/events/F6Navigation.js +230 -164
- package/src/sap/ui/events/KeyCodes.js +1 -1
- package/src/sap/ui/events/PasteEventFix.js +1 -1
- package/src/sap/ui/events/PseudoEvents.js +1 -1
- package/src/sap/ui/events/TouchToMouseMapping.js +1 -1
- package/src/sap/ui/events/checkMouseEnterOrLeave.js +1 -1
- package/src/sap/ui/events/isMouseEventDelayed.js +1 -1
- package/src/sap/ui/events/isSpecialKey.js +1 -1
- package/src/sap/ui/events/jquery/EventExtension.js +1 -1
- package/src/sap/ui/events/jquery/EventSimulation.js +1 -1
- package/src/sap/ui/events/jquery/EventTriggerHook.js +1 -1
- package/src/sap/ui/model/Binding.js +1 -1
- package/src/sap/ui/model/BindingMode.js +1 -1
- package/src/sap/ui/model/ChangeReason.js +1 -1
- package/src/sap/ui/model/ClientContextBinding.js +1 -1
- package/src/sap/ui/model/ClientListBinding.js +1 -1
- package/src/sap/ui/model/ClientModel.js +2 -2
- package/src/sap/ui/model/ClientPropertyBinding.js +1 -1
- package/src/sap/ui/model/ClientTreeBinding.js +1 -1
- package/src/sap/ui/model/ClientTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/CompositeBinding.js +1 -1
- package/src/sap/ui/model/CompositeDataState.js +2 -2
- package/src/sap/ui/model/CompositeType.js +2 -2
- package/src/sap/ui/model/Context.js +1 -1
- package/src/sap/ui/model/ContextBinding.js +1 -1
- package/src/sap/ui/model/DataState.js +2 -2
- package/src/sap/ui/model/Filter.js +1 -1
- package/src/sap/ui/model/FilterOperator.js +1 -1
- package/src/sap/ui/model/FilterProcessor.js +1 -1
- package/src/sap/ui/model/FilterType.js +1 -1
- package/src/sap/ui/model/FormatException.js +1 -1
- package/src/sap/ui/model/ListBinding.js +1 -1
- package/src/sap/ui/model/ManagedObjectBindingSupport.js +4 -10
- package/src/sap/ui/model/MetaModel.js +2 -2
- package/src/sap/ui/model/Model.js +3 -3
- package/src/sap/ui/model/ParseException.js +1 -1
- package/src/sap/ui/model/PropertyBinding.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +2 -2
- package/src/sap/ui/model/SimpleType.js +2 -2
- package/src/sap/ui/model/Sorter.js +1 -1
- package/src/sap/ui/model/SorterProcessor.js +1 -1
- package/src/sap/ui/model/StaticBinding.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +2 -2
- package/src/sap/ui/model/TreeBinding.js +1 -1
- package/src/sap/ui/model/TreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +1 -1
- package/src/sap/ui/model/TreeBindingUtils.js +1 -1
- package/src/sap/ui/model/Type.js +2 -2
- package/src/sap/ui/model/ValidateException.js +1 -1
- package/src/sap/ui/model/_Helper.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +17 -7
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +1 -1
- package/src/sap/ui/model/analytics/BatchResponseCollector.js +1 -1
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +1 -1
- package/src/sap/ui/model/analytics/odata4analytics.js +7 -3
- package/src/sap/ui/model/base/ManagedObjectModel.js +1 -1
- package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +54 -28
- package/src/sap/ui/model/json/JSONListBinding.js +1 -1
- package/src/sap/ui/model/json/JSONModel.js +2 -2
- package/src/sap/ui/model/json/JSONPropertyBinding.js +1 -1
- package/src/sap/ui/model/json/JSONTreeBinding.js +1 -1
- package/src/sap/ui/model/message/MessageListBinding.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +2 -2
- package/src/sap/ui/model/message/MessagePropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/AnnotationHelper.js +1 -1
- package/src/sap/ui/model/odata/AnnotationParser.js +1 -1
- package/src/sap/ui/model/odata/CountMode.js +1 -1
- package/src/sap/ui/model/odata/Filter.js +1 -1
- package/src/sap/ui/model/odata/MessageScope.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +13 -5
- package/src/sap/ui/model/odata/ODataContextBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataListBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
- package/src/sap/ui/model/odata/ODataMetaModel.js +28 -22
- package/src/sap/ui/model/odata/ODataMetadata.js +2 -2
- package/src/sap/ui/model/odata/ODataModel.js +2 -2
- package/src/sap/ui/model/odata/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +1 -1
- package/src/sap/ui/model/odata/ODataUtils.js +1 -1
- package/src/sap/ui/model/odata/OperationMode.js +1 -1
- package/src/sap/ui/model/odata/UpdateMethod.js +1 -1
- package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +1 -1
- package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +1 -1
- package/src/sap/ui/model/odata/_ODataMetaModelUtils.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +2 -2
- package/src/sap/ui/model/odata/type/Byte.js +3 -3
- package/src/sap/ui/model/odata/type/Currency.js +9 -5
- package/src/sap/ui/model/odata/type/Date.js +3 -3
- package/src/sap/ui/model/odata/type/DateTime.js +2 -2
- package/src/sap/ui/model/odata/type/DateTimeBase.js +2 -2
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +3 -3
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +2 -2
- package/src/sap/ui/model/odata/type/Decimal.js +4 -4
- package/src/sap/ui/model/odata/type/Double.js +4 -4
- package/src/sap/ui/model/odata/type/Guid.js +2 -2
- package/src/sap/ui/model/odata/type/Int.js +2 -2
- package/src/sap/ui/model/odata/type/Int16.js +4 -4
- package/src/sap/ui/model/odata/type/Int32.js +4 -4
- package/src/sap/ui/model/odata/type/Int64.js +4 -4
- package/src/sap/ui/model/odata/type/ODataType.js +2 -2
- package/src/sap/ui/model/odata/type/Raw.js +2 -2
- package/src/sap/ui/model/odata/type/SByte.js +3 -3
- package/src/sap/ui/model/odata/type/Single.js +4 -4
- package/src/sap/ui/model/odata/type/Stream.js +2 -2
- package/src/sap/ui/model/odata/type/String.js +2 -2
- package/src/sap/ui/model/odata/type/Time.js +3 -3
- package/src/sap/ui/model/odata/type/TimeOfDay.js +3 -3
- package/src/sap/ui/model/odata/type/Unit.js +8 -5
- package/src/sap/ui/model/odata/type/UnitMixin.js +1 -1
- package/src/sap/ui/model/odata/v2/BatchMode.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +3 -5
- package/src/sap/ui/model/odata/v2/ODataContextBinding.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataModel.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +4 -5
- package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +1 -1
- package/src/sap/ui/model/odata/v4/AnnotationHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +230 -127
- package/src/sap/ui/model/odata/v4/ODataBinding.js +4 -1
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +119 -83
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +257 -183
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +3 -4
- package/src/sap/ui/model/odata/v4/ODataModel.js +68 -14
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +47 -13
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +19 -5
- package/src/sap/ui/model/odata/v4/ODataUtils.js +7 -7
- package/src/sap/ui/model/odata/v4/SubmitMode.js +1 -1
- package/src/sap/ui/model/odata/v4/ValueListType.js +1 -1
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +422 -162
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +122 -22
- package/src/sap/ui/model/odata/v4/lib/_Batch.js +20 -13
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +225 -149
- package/src/sap/ui/model/odata/v4/lib/_ConcatHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +122 -14
- package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Parser.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +29 -14
- package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_V4MetadataConverter.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +2 -2
- package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +2 -2
- package/src/sap/ui/model/type/Currency.js +2 -2
- package/src/sap/ui/model/type/Date.js +2 -2
- package/src/sap/ui/model/type/DateInterval.js +2 -2
- package/src/sap/ui/model/type/DateTime.js +2 -2
- package/src/sap/ui/model/type/DateTimeInterval.js +2 -2
- package/src/sap/ui/model/type/FileSize.js +4 -3
- package/src/sap/ui/model/type/Float.js +4 -3
- package/src/sap/ui/model/type/Integer.js +4 -3
- package/src/sap/ui/model/type/String.js +2 -2
- package/src/sap/ui/model/type/Time.js +2 -2
- package/src/sap/ui/model/type/TimeInterval.js +2 -2
- package/src/sap/ui/model/type/Unit.js +2 -2
- package/src/sap/ui/model/xml/XMLListBinding.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +2 -2
- package/src/sap/ui/model/xml/XMLPropertyBinding.js +1 -1
- package/src/sap/ui/model/xml/XMLTreeBinding.js +1 -1
- package/src/sap/ui/performance/BeaconRequest.js +1 -1
- package/src/sap/ui/performance/Measurement.js +1 -1
- package/src/sap/ui/performance/XHRInterceptor.js +1 -1
- package/src/sap/ui/performance/trace/FESR.js +1 -1
- package/src/sap/ui/performance/trace/FESRHelper.js +1 -1
- package/src/sap/ui/performance/trace/Interaction.js +1 -1
- package/src/sap/ui/performance/trace/Passport.js +1 -1
- package/src/sap/ui/performance/trace/initTraces.js +10 -6
- package/src/sap/ui/qunit/QUnitUtils.js +15 -3
- package/src/sap/ui/qunit/qunit-2-css.js +1 -1
- package/src/sap/ui/qunit/qunit-coverage.js +1 -1
- package/src/sap/ui/qunit/qunit-css.js +1 -1
- package/src/sap/ui/qunit/qunit-junit.js +1 -1
- package/src/sap/ui/qunit/qunit-redirect.js +1 -1
- package/src/sap/ui/qunit/sinon-qunit-bridge.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +2 -2
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +2 -2
- package/src/sap/ui/qunit/utils/createAndAppendDiv.js +1 -1
- package/src/sap/ui/qunit/utils/waitForThemeApplied.js +1 -1
- package/src/sap/ui/security/FrameOptions.js +1 -1
- package/src/sap/ui/test/BlanketReporter.js +1 -1
- package/src/sap/ui/test/BlanketReporterUI.view.xml +2 -5
- package/src/sap/ui/test/BranchTracking.js +1 -1
- package/src/sap/ui/test/Opa.js +1 -1
- package/src/sap/ui/test/Opa5.js +1 -1
- package/src/sap/ui/test/OpaBuilder.js +2 -2
- package/src/sap/ui/test/OpaExtension.js +2 -2
- package/src/sap/ui/test/OpaPlugin.js +27 -6
- package/src/sap/ui/test/PageObjectFactory.js +12 -10
- package/src/sap/ui/test/RecordReplay.js +2 -2
- package/src/sap/ui/test/RecorderHotkeyListener.js +1 -1
- package/src/sap/ui/test/TestUtils.js +78 -92
- package/src/sap/ui/test/_BrowserLogCollector.js +1 -1
- package/src/sap/ui/test/_ControlFinder.js +254 -238
- package/src/sap/ui/test/_FocusListener.js +49 -0
- package/src/sap/ui/test/_LogCollector.js +1 -1
- package/src/sap/ui/test/_OpaLogger.js +2 -2
- package/src/sap/ui/test/_OpaUriParameterParser.js +1 -1
- package/src/sap/ui/test/_ParameterValidator.js +1 -1
- package/src/sap/ui/test/_UsageReport.js +1 -1
- package/src/sap/ui/test/_ValidationParameters.js +1 -1
- package/src/sap/ui/test/actions/Action.js +17 -3
- package/src/sap/ui/test/actions/Drag.js +1 -1
- package/src/sap/ui/test/actions/Drop.js +1 -1
- package/src/sap/ui/test/actions/EnterText.js +37 -5
- package/src/sap/ui/test/actions/Press.js +1 -1
- package/src/sap/ui/test/actions/Scroll.js +1 -1
- package/src/sap/ui/test/autowaiter/WaiterBase.js +1 -1
- package/src/sap/ui/test/autowaiter/_UIUpdatesWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_XHRWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_autoWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_autoWaiterAsync.js +1 -1
- package/src/sap/ui/test/autowaiter/_cssAnimationWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_cssTransitionWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_jsAnimationWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_moduleWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_navigationContainerWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_promiseWaiter.js +6 -3
- package/src/sap/ui/test/autowaiter/_resourceWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_timeoutWaiter.js +1 -1
- package/src/sap/ui/test/autowaiter/_utils.js +1 -1
- package/src/sap/ui/test/generic/GenericTestCollection.js +22 -11
- package/src/sap/ui/test/generic/TestBase.js +2 -2
- package/src/sap/ui/test/generic/Utils.js +2 -2
- package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +5 -5
- package/src/sap/ui/test/gherkin/GherkinTestGenerator.js +1 -1
- package/src/sap/ui/test/gherkin/StepDefinitions.js +1 -1
- package/src/sap/ui/test/gherkin/dataTableUtils.js +1 -1
- package/src/sap/ui/test/gherkin/opa5TestHarness.js +1 -1
- package/src/sap/ui/test/gherkin/qUnitTestHarness.js +1 -1
- package/src/sap/ui/test/gherkin/simpleGherkinParser.js +1 -1
- package/src/sap/ui/test/launchers/componentLauncher.js +1 -1
- package/src/sap/ui/test/launchers/iFrameLauncher.js +1 -1
- package/src/sap/ui/test/matchers/AggregationContainsPropertyEqual.js +1 -1
- package/src/sap/ui/test/matchers/AggregationEmpty.js +1 -1
- package/src/sap/ui/test/matchers/AggregationFilled.js +1 -1
- package/src/sap/ui/test/matchers/AggregationLengthEquals.js +1 -1
- package/src/sap/ui/test/matchers/Ancestor.js +1 -1
- package/src/sap/ui/test/matchers/BindingPath.js +1 -1
- package/src/sap/ui/test/matchers/Descendant.js +1 -1
- package/src/sap/ui/test/matchers/I18NText.js +1 -1
- package/src/sap/ui/test/matchers/Interactable.js +1 -1
- package/src/sap/ui/test/matchers/LabelFor.js +1 -1
- package/src/sap/ui/test/matchers/Matcher.js +1 -1
- package/src/sap/ui/test/matchers/MatcherFactory.js +1 -1
- package/src/sap/ui/test/matchers/Properties.js +1 -1
- package/src/sap/ui/test/matchers/PropertyStrictEquals.js +1 -1
- package/src/sap/ui/test/matchers/Sibling.js +1 -1
- package/src/sap/ui/test/matchers/Visible.js +1 -1
- package/src/sap/ui/test/matchers/_Busy.js +1 -1
- package/src/sap/ui/test/matchers/_Editable.js +1 -1
- package/src/sap/ui/test/matchers/_Enabled.js +1 -1
- package/src/sap/ui/test/matchers/_Visitor.js +1 -1
- package/src/sap/ui/test/matchers/matchers.js +1 -1
- package/src/sap/ui/test/opaQunit.js +1 -1
- package/src/sap/ui/test/pipelines/ActionPipeline.js +1 -1
- package/src/sap/ui/test/pipelines/MatcherPipeline.js +1 -1
- package/src/sap/ui/test/pipelines/PipelineFactory.js +1 -1
- package/src/sap/ui/test/qunitPause.js +1 -1
- package/src/sap/ui/test/selectors/_BindingPath.js +1 -1
- package/src/sap/ui/test/selectors/_ControlSelectorGenerator.js +1 -1
- package/src/sap/ui/test/selectors/_ControlSelectorValidator.js +1 -1
- package/src/sap/ui/test/selectors/_ControlType.js +1 -1
- package/src/sap/ui/test/selectors/_DropdownItem.js +1 -1
- package/src/sap/ui/test/selectors/_GlobalID.js +1 -1
- package/src/sap/ui/test/selectors/_LabelFor.js +1 -1
- package/src/sap/ui/test/selectors/_Properties.js +1 -1
- package/src/sap/ui/test/selectors/_Selector.js +2 -1
- package/src/sap/ui/test/selectors/_TableRowItem.js +1 -1
- package/src/sap/ui/test/selectors/_ViewID.js +1 -1
- package/src/sap/ui/test/selectors/_selectors.js +1 -1
- package/src/sap/ui/test/starter/_configureLoader.js +1 -1
- package/src/sap/ui/test/starter/_setupAndStart.js +1 -1
- package/src/sap/ui/test/starter/_utils.js +1 -1
- package/src/sap/ui/test/starter/createSuite.js +1 -1
- package/src/sap/ui/test/starter/runTest.js +1 -1
- package/src/sap/ui/thirdparty/RequestRecorder.js +1 -1
- package/src/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/src/sap/ui/util/ActivityDetection.js +1 -1
- package/src/sap/ui/util/Mobile.js +18 -19
- package/src/sap/ui/util/Storage.js +91 -64
- package/src/sap/ui/util/XMLHelper.js +1 -1
- package/src/sap/ui/util/_FeatureDetection.js +1 -1
- package/src/sap/ui/util/defaultLinkTypes.js +1 -1
- package/src/sap/ui/util/isCrossOriginURL.js +1 -1
- package/src/sap/ui/util/openWindow.js +1 -1
- package/src/sap-ui-boot.js +1 -1
- package/src/sap-ui-core-nojQuery.js +1 -1
- package/src/sap-ui-core.js +1 -1
- package/src/sap-ui-debug.js +1 -1
- package/src/ui5loader-autoconfig.js +1 -1
- package/src/ui5loader.js +1 -1
|
@@ -0,0 +1,1595 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//Provides class sap.ui.core.Lib
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
'sap/base/assert',
|
|
10
|
+
'sap/base/i18n/ResourceBundle',
|
|
11
|
+
'sap/base/Log',
|
|
12
|
+
'sap/base/util/deepExtend',
|
|
13
|
+
'sap/base/util/LoaderExtensions',
|
|
14
|
+
'sap/base/util/mixedFetch',
|
|
15
|
+
"sap/base/util/ObjectPath",
|
|
16
|
+
'sap/base/util/Version',
|
|
17
|
+
'sap/base/util/array/uniqueSort',
|
|
18
|
+
'sap/ui/Global', /* sap.ui.lazyRequire */
|
|
19
|
+
'sap/ui/VersionInfo',
|
|
20
|
+
'sap/ui/base/DataType',
|
|
21
|
+
'sap/ui/base/EventProvider',
|
|
22
|
+
'sap/ui/base/Object',
|
|
23
|
+
'sap/ui/base/SyncPromise',
|
|
24
|
+
'sap/ui/core/Configuration',
|
|
25
|
+
'sap/ui/core/_UrlResolver'
|
|
26
|
+
], function (
|
|
27
|
+
assert,
|
|
28
|
+
ResourceBundle,
|
|
29
|
+
Log,
|
|
30
|
+
deepExtend,
|
|
31
|
+
LoaderExtensions,
|
|
32
|
+
mixedFetch,
|
|
33
|
+
ObjectPath,
|
|
34
|
+
Version,
|
|
35
|
+
uniqueSort,
|
|
36
|
+
Global,
|
|
37
|
+
VersionInfo,
|
|
38
|
+
DataType,
|
|
39
|
+
EventProvider,
|
|
40
|
+
BaseObject,
|
|
41
|
+
SyncPromise,
|
|
42
|
+
Configuration,
|
|
43
|
+
_UrlResolver
|
|
44
|
+
) {
|
|
45
|
+
"use strict";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Save the library instances by their keys
|
|
49
|
+
*/
|
|
50
|
+
var mLibraries = {};
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Bookkeeping for the guessing of library names.
|
|
55
|
+
*
|
|
56
|
+
* Set of bundleUrls from which a library name has been derived or not, see #getLibraryNameForBundle
|
|
57
|
+
* If no library name can be derived, the result will also be tracked with 'false' as value.
|
|
58
|
+
*
|
|
59
|
+
* Example:
|
|
60
|
+
* mGuessedLibraries = {
|
|
61
|
+
* "my/simple/library/i18n/i18n.properties": "my.simple.library",
|
|
62
|
+
* "no/library/i18n/i18n.properties": false
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
65
|
+
var mGuessedLibraries = {};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Set of libraries that provide a bundle info file (library-preload-lazy.js).
|
|
69
|
+
*
|
|
70
|
+
* The file will be loaded, when a lazy dependency to the library is encountered.
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
var oLibraryWithBundleInfo = new Set([
|
|
74
|
+
"sap.suite.ui.generic.template",
|
|
75
|
+
"sap.ui.comp",
|
|
76
|
+
"sap.ui.layout",
|
|
77
|
+
"sap.ui.unified"
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves the module path.
|
|
82
|
+
* @param {string} sModuleName module name.
|
|
83
|
+
* @param {string} sSuffix is used untouched (dots are not replaced with slashes).
|
|
84
|
+
* @returns {string} module path.
|
|
85
|
+
*/
|
|
86
|
+
function getModulePath(sModuleName, sSuffix){
|
|
87
|
+
return sap.ui.require.toUrl(sModuleName.replace(/\./g, "/") + sSuffix);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Register the given namespace prefix to the given URL
|
|
92
|
+
* @param {string} sModuleNamePrefix The namespace prefix
|
|
93
|
+
* @param {string} sUrlPrefix The URL prefix that will be registered for the given namespace
|
|
94
|
+
*/
|
|
95
|
+
function registerModulePath(sModuleNamePrefix, sUrlPrefix) {
|
|
96
|
+
LoaderExtensions.registerResourcePath(sModuleNamePrefix.replace(/\./g, "/"), sUrlPrefix);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Adds all resources from a preload bundle to the preload cache.
|
|
101
|
+
*
|
|
102
|
+
* When a resource exists already in the cache, the new content is ignored.
|
|
103
|
+
*
|
|
104
|
+
* @param {object} oData Preload bundle
|
|
105
|
+
* @param {string} [oData.url] URL from which the bundle has been loaded
|
|
106
|
+
* @param {string} [oData.name] Unique name of the bundle
|
|
107
|
+
* @param {string} [oData.version='1.0'] Format version of the preload bundle
|
|
108
|
+
* @param {object} oData.modules Map of resources keyed by their resource name; each resource must be a string or a function
|
|
109
|
+
* @param {string} sURL URL from which the bundle has been loaded
|
|
110
|
+
*
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
113
|
+
function registerPreloadedModules(oData, sURL) {
|
|
114
|
+
var modules = oData.modules,
|
|
115
|
+
fnUI5ToRJS = function(sName) {
|
|
116
|
+
return /^jquery\.sap\./.test(sName) ? sName : sName.replace(/\./g, "/");
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
if ( Version(oData.version || "1.0").compareTo("2.0") < 0 ) {
|
|
120
|
+
modules = {};
|
|
121
|
+
for ( var sName in oData.modules ) {
|
|
122
|
+
modules[fnUI5ToRJS(sName) + ".js"] = oData.modules[sName];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
sap.ui.require.preload(modules, oData.name, sURL);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Configured type of preload file per library.
|
|
130
|
+
* The empty name represents the default for all libraries not explicitly listed.
|
|
131
|
+
*
|
|
132
|
+
* A type can be one of
|
|
133
|
+
* - 'none' (do not preload),
|
|
134
|
+
* - 'js' (preload JS file),
|
|
135
|
+
* - 'json' (preload a json file)
|
|
136
|
+
* or 'both (try js first, then 'json')
|
|
137
|
+
*
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
var mLibraryPreloadFileTypes = {};
|
|
141
|
+
|
|
142
|
+
// evaluate configuration for library preload file types
|
|
143
|
+
Configuration.getValue("xx-libraryPreloadFiles").forEach(function(v){
|
|
144
|
+
var fields = String(v).trim().split(/\s*:\s*/),
|
|
145
|
+
name = fields[0],
|
|
146
|
+
fileType = fields[1];
|
|
147
|
+
if ( fields.length === 1 ) {
|
|
148
|
+
fileType = name;
|
|
149
|
+
name = '';
|
|
150
|
+
}
|
|
151
|
+
if ( /^(?:none|js|json|both)$/.test(fileType) ) {
|
|
152
|
+
mLibraryPreloadFileTypes[name] = fileType;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Set of libraries which require CSS.
|
|
158
|
+
*/
|
|
159
|
+
var aAllLibrariesRequiringCss = [];
|
|
160
|
+
|
|
161
|
+
var pThemeManager;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Get the sap/ui/core/theming/ThemeManager on demand
|
|
165
|
+
*
|
|
166
|
+
* @param {boolean} [bClear=false] Whether to reset the ThemeManager
|
|
167
|
+
* @returns {Promise} The promise that resolves with the sap/ui/core/theming/ThemeManager class
|
|
168
|
+
*/
|
|
169
|
+
function _getThemeManager(bClear) {
|
|
170
|
+
var ThemeManager = sap.ui.require("sap/ui/core/theming/ThemeManager");
|
|
171
|
+
if (!pThemeManager) {
|
|
172
|
+
if (!ThemeManager) {
|
|
173
|
+
pThemeManager = new Promise(function (resolve, reject) {
|
|
174
|
+
sap.ui.require(["sap/ui/core/theming/ThemeManager"], function (ThemeManager) {
|
|
175
|
+
resolve(ThemeManager);
|
|
176
|
+
}, reject);
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
pThemeManager = Promise.resolve(ThemeManager);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// This is only used within initLibrary to reset flag themeLoaded synchronously in case
|
|
183
|
+
// a theme for a new library will be loaded
|
|
184
|
+
if (ThemeManager && bClear) {
|
|
185
|
+
ThemeManager.reset();
|
|
186
|
+
}
|
|
187
|
+
return pThemeManager;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* This is an identifier to restrict the usage of constructor within this module
|
|
192
|
+
*/
|
|
193
|
+
var oConstructorKey = Symbol("sap.ui.core.Lib");
|
|
194
|
+
|
|
195
|
+
var oPropDescriptor = {
|
|
196
|
+
configurable: true,
|
|
197
|
+
enumerable: true,
|
|
198
|
+
writable: false
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
function createPropDescriptorWithValue(vValue) {
|
|
202
|
+
oPropDescriptor.value = vValue;
|
|
203
|
+
return oPropDescriptor;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Freezes the object and nested objects to avoid later manipulation
|
|
209
|
+
*
|
|
210
|
+
* @param {object} oObject the object to deep freeze
|
|
211
|
+
*/
|
|
212
|
+
function deepFreeze(oObject) {
|
|
213
|
+
if (oObject && typeof oObject === 'object' && !Object.isFrozen(oObject)) {
|
|
214
|
+
Object.freeze(oObject);
|
|
215
|
+
for (var sKey in oObject) {
|
|
216
|
+
if (oObject.hasOwnProperty(sKey)) {
|
|
217
|
+
deepFreeze(oObject[sKey]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/*
|
|
224
|
+
* Create an instance that represents a library with the given name.
|
|
225
|
+
*
|
|
226
|
+
* <h3>Note</h3>
|
|
227
|
+
* This constructor is designed for internal usage only. To create an instance, use {@link #.get}.
|
|
228
|
+
*
|
|
229
|
+
* @classdesc
|
|
230
|
+
* <h3>Library Loading</h3>
|
|
231
|
+
* To load a library, {@link #.load} can be used directly without creating a library instance in advance.
|
|
232
|
+
*
|
|
233
|
+
* <h3>What a library does</h3>
|
|
234
|
+
* <ul>
|
|
235
|
+
* <li>preload: {@link #preload} loads the library-preload bundle and its resource bundle and apply the
|
|
236
|
+
* same for its dependencies</li>
|
|
237
|
+
* <li>theming: {@link #_includeTheme} creates a <link> in the page referring to the corresponding
|
|
238
|
+
* <code>library.css</code></li>
|
|
239
|
+
* <li>resource bundle: {@link #getResourceBundle} returns the resource bundle directly when it's already loaded or
|
|
240
|
+
* triggers a synchronous request to load it. {@link #loadResourceBundle} loads a library's resource bundle file
|
|
241
|
+
* asynchronously. The resource bundle file is also loaded when the <code>preload</code> function is called</li>
|
|
242
|
+
* </ul>
|
|
243
|
+
*
|
|
244
|
+
* @param {object} mSettings Info object for the library
|
|
245
|
+
* @param {string} mSettings.name Name of the library; when given it must match the name by which the library has been loaded
|
|
246
|
+
* @class
|
|
247
|
+
* @alias sap.ui.core.Lib
|
|
248
|
+
* @extends sap.ui.base.BaseObject
|
|
249
|
+
* @since 1.110
|
|
250
|
+
* @private
|
|
251
|
+
* @hideconstructor
|
|
252
|
+
* @ui5-restricted sap.ui.core
|
|
253
|
+
*/
|
|
254
|
+
var Library = BaseObject.extend("sap.ui.core.Lib", /** @lends sap.ui.core.Lib.prototype */ {
|
|
255
|
+
|
|
256
|
+
constructor: function(mSettings) {
|
|
257
|
+
BaseObject.call(this);
|
|
258
|
+
|
|
259
|
+
assert(typeof mSettings === "object", "A settings object must be given to the constructor of sap/ui/base/Library");
|
|
260
|
+
assert(typeof mSettings.name === "string" && mSettings.name, "The settings object that is given to the constructor of sap/ui/base/Library must contain a 'name' property which is a non-empty string");
|
|
261
|
+
|
|
262
|
+
if (mSettings._key !== oConstructorKey) {
|
|
263
|
+
throw new Error("The constructor of sap/ui/core/Lib is restricted to the internal usage. To get an instance of Library with name '" + mSettings.name + "', use the static method 'get' from sap/ui/core/Lib instead.");
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
this.name = mSettings.name;
|
|
267
|
+
|
|
268
|
+
var aPropsWithDefaults = ["dependencies", "types", "interfaces", "controls", "elements"];
|
|
269
|
+
|
|
270
|
+
// provide default values
|
|
271
|
+
aPropsWithDefaults.forEach(function(sPropName) {
|
|
272
|
+
Object.defineProperty(this, sPropName, createPropDescriptorWithValue([]));
|
|
273
|
+
}.bind(this));
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Resource bundles that are cached by their locales as key
|
|
277
|
+
*/
|
|
278
|
+
Object.defineProperty(this, "_resourceBundles", {
|
|
279
|
+
value: {},
|
|
280
|
+
writable: true
|
|
281
|
+
});
|
|
282
|
+
/**
|
|
283
|
+
* The '_loadingStatus' property may contain the following attributes
|
|
284
|
+
* * {boolean} pending
|
|
285
|
+
* * {boolean} async
|
|
286
|
+
* * {Promise} promise
|
|
287
|
+
*/
|
|
288
|
+
Object.defineProperty(this, "_loadingStatus", {
|
|
289
|
+
value: null,
|
|
290
|
+
writable: true
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(this, "_settingsEnhanced", {
|
|
293
|
+
value: false,
|
|
294
|
+
writable: true
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Indicates whether the {@link sap.ui.core.Lib#enhanceSettings} is called
|
|
300
|
+
*
|
|
301
|
+
* @returns {boolean} Whether a library's setting is enhanced with additional metadata
|
|
302
|
+
* @private
|
|
303
|
+
*/
|
|
304
|
+
isSettingsEnhanced: function() {
|
|
305
|
+
return this._settingsEnhanced;
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Enhances a library's setting information.
|
|
311
|
+
*
|
|
312
|
+
* When the <code>mSettings</code> has been processed, a normalized version of it will be kept and set on the
|
|
313
|
+
* library instance.
|
|
314
|
+
*
|
|
315
|
+
* @param {object} mSettings Info object for the library
|
|
316
|
+
* @param {string} mSettings.version Version of the library
|
|
317
|
+
* @param {string[]} [mSettings.dependencies=[]] List of libraries that this library depends on; names are in
|
|
318
|
+
* dot notation (e.g. "sap.ui.core")
|
|
319
|
+
* @param {string[]} [mSettings.types=[]] List of names of types that this library provides; names are in dot
|
|
320
|
+
* notation (e.g. "sap.ui.core.CSSSize")
|
|
321
|
+
* @param {string[]} [mSettings.interfaces=[]] List of names of interface types that this library provides;
|
|
322
|
+
* names are in dot notation (e.g. "sap.ui.core.PopupInterface")
|
|
323
|
+
* @param {string[]} [mSettings.controls=[]] Names of control types that this library provides; names are in dot
|
|
324
|
+
* notation (e.g. "sap.ui.core.ComponentContainer")
|
|
325
|
+
* @param {string[]} [mSettings.elements=[]] Names of element types that this library provides (excluding
|
|
326
|
+
* controls); names are in dot notation (e.g. "sap.ui.core.Item")
|
|
327
|
+
* @param {boolean} [mSettings.noLibraryCSS=false] Indicates whether the library doesn't provide/use theming.
|
|
328
|
+
* When set to true, no library.css will be loaded for this library
|
|
329
|
+
* @param {object} [oLibInfo.extensions] Potential extensions of the library metadata; structure not defined by
|
|
330
|
+
* the UI5 core framework.
|
|
331
|
+
* @returns {sap.ui.core.Lib} The library instance
|
|
332
|
+
* @private
|
|
333
|
+
*/
|
|
334
|
+
enhanceSettings: function(mSettings) {
|
|
335
|
+
if (this._settingsEnhanced) {
|
|
336
|
+
return this;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
this._settingsEnhanced = true;
|
|
340
|
+
|
|
341
|
+
var sKey, vValue, vValueToSet;
|
|
342
|
+
|
|
343
|
+
for (sKey in mSettings) {
|
|
344
|
+
vValue = mSettings[sKey];
|
|
345
|
+
vValueToSet = undefined;
|
|
346
|
+
|
|
347
|
+
// don't copy undefined values
|
|
348
|
+
if ( vValue !== undefined ) {
|
|
349
|
+
if ( Array.isArray(this[sKey]) ) {
|
|
350
|
+
// concat array typed values
|
|
351
|
+
if (this[sKey].length === 0) {
|
|
352
|
+
vValueToSet = vValue;
|
|
353
|
+
} else {
|
|
354
|
+
vValueToSet = uniqueSort(this[sKey].concat(vValue));
|
|
355
|
+
}
|
|
356
|
+
} else if ( this[sKey] === undefined ) {
|
|
357
|
+
// only set values for properties that are still undefined
|
|
358
|
+
vValueToSet = vValue;
|
|
359
|
+
} else if ( sKey != "name" ) {
|
|
360
|
+
// ignore other values (silently ignore "name")
|
|
361
|
+
Log.warning("library info setting ignored: " + sKey + "=" + vValue);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (vValueToSet !== undefined) {
|
|
365
|
+
// freeze settings value
|
|
366
|
+
Object.defineProperty(this, sKey, createPropDescriptorWithValue(vValueToSet));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return this;
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Returns the file type (either js, json, none, or both) that should be used for preloading this library
|
|
376
|
+
* instance.
|
|
377
|
+
*
|
|
378
|
+
* When <code>bJSON</code> is set to <code>true</code>, type "json" is returned directly. When
|
|
379
|
+
* <code>bJSON</code> is set to <code>false</code>, type "js" is returned. Otherwise it takes the configured
|
|
380
|
+
* file type into consideration. In case of conflict between the given <code>bJSON</code> and the configured
|
|
381
|
+
* file type, type "none" is returned.
|
|
382
|
+
*
|
|
383
|
+
* @param {boolean} [bJSON] Whether the "json" file type is set
|
|
384
|
+
* @returns {string} The determined file type. It can be "js", "json", "none", or "both".
|
|
385
|
+
* @private
|
|
386
|
+
*/
|
|
387
|
+
_getFileType: function (bJSON) {
|
|
388
|
+
var sFileType;
|
|
389
|
+
var sConfiguredFileType = mLibraryPreloadFileTypes[this.name] || mLibraryPreloadFileTypes[''] || 'both';
|
|
390
|
+
|
|
391
|
+
if ( bJSON === true ) {
|
|
392
|
+
sFileType = 'json';
|
|
393
|
+
} else if ( bJSON === false ) {
|
|
394
|
+
sFileType = 'js';
|
|
395
|
+
} else {
|
|
396
|
+
// take the configured preload file type as default
|
|
397
|
+
sFileType = sConfiguredFileType;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (sConfiguredFileType !== 'both' && sFileType !== 'both' && sConfiguredFileType !== sFileType ) {
|
|
401
|
+
// if the configured and the supported file type are not equal and the library doesn't support 'both',
|
|
402
|
+
// then there is no compromise -> 'none'
|
|
403
|
+
sFileType = 'none';
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return sFileType;
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Loads the library-preload bundle and the resource bundle for a library and apply the same for its
|
|
411
|
+
* dependencies.
|
|
412
|
+
*
|
|
413
|
+
* When the optional parameter <code>mOptions.url</code> is given, its value will be registered for the
|
|
414
|
+
* namespace of the library and all resources will be loaded from that location.
|
|
415
|
+
*
|
|
416
|
+
* When the library has been loaded already, or its entry module (library.js) is already loaded or preloaded, no
|
|
417
|
+
* further action will be taken, especially, a given <code>mOptions.url</code> will not be registered. A promise
|
|
418
|
+
* will be returned which resolves immediately.
|
|
419
|
+
*
|
|
420
|
+
* @param {object} [mOptions] The options object that contains the following properties
|
|
421
|
+
* @param {string} [mOptions.url] URL to load the library from
|
|
422
|
+
* @param {boolean} [mOptions.lazy] Whether the library-preload-lazy bundle should be loaded instead of the
|
|
423
|
+
* library-preload bundle
|
|
424
|
+
* @returns {Promise<sap.ui.core.Lib>} A promise that resolves with the library instance
|
|
425
|
+
* @private
|
|
426
|
+
*/
|
|
427
|
+
preload: function(mOptions) {
|
|
428
|
+
if (mOptions && (mOptions.hasOwnProperty("async") || mOptions.hasOwnProperty("sync"))) {
|
|
429
|
+
Log.error("The 'preload' function of class sap/ui/core/Lib only support preloading a library asynchronously. The given 'async' or 'sync' setting is ignored.");
|
|
430
|
+
}
|
|
431
|
+
if (mOptions && mOptions.hasOwnProperty("json")) {
|
|
432
|
+
Log.error("The 'preload' function of class sap/ui/core/Lib only support preloading in JS Format. The given 'json' setting is ignored.");
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return this._preload(["url", "lazy"].reduce(function(acc, sProperty) {
|
|
436
|
+
if (mOptions && mOptions.hasOwnProperty(sProperty)) {
|
|
437
|
+
acc[sProperty] = mOptions[sProperty];
|
|
438
|
+
}
|
|
439
|
+
return acc;
|
|
440
|
+
}, {}));
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
/* Internal function for preloading a library which still supports the legacy parameters:
|
|
444
|
+
*
|
|
445
|
+
* <ul>
|
|
446
|
+
* <li><code>mOptions.sync</code>: load the preload file in sync mode</li>
|
|
447
|
+
* <li><code>mOptions.json</code>: load the preload file in "json" format</li>
|
|
448
|
+
* </ul>
|
|
449
|
+
*
|
|
450
|
+
* @param [mOptions] The options object that contains the following properties
|
|
451
|
+
* @param [mOptions.url] URL to load the library from
|
|
452
|
+
* @param [mOptions.lazy] Whether the library-preload-lazy bundle should be loaded instead of the
|
|
453
|
+
* library-preload bundle
|
|
454
|
+
* @param @deprecated [mOptions.sync] Whether to load the preload bundle in sync mode
|
|
455
|
+
* @param @deprecated [mOptions.json] Whether to load the preload in JSON format
|
|
456
|
+
* @returns {Promise<Lib>|Lib} A promise that resolves with the library instance in async mode and the library
|
|
457
|
+
* instance itself in sync mode
|
|
458
|
+
* @private
|
|
459
|
+
*/
|
|
460
|
+
_preload: function(mOptions) {
|
|
461
|
+
mOptions = mOptions || {};
|
|
462
|
+
|
|
463
|
+
var sFileType = this._getFileType(mOptions.json),
|
|
464
|
+
sLibPackage = this.name.replace(/\./g, '/'),
|
|
465
|
+
bLibLoaded = !!sap.ui.loader._.getModuleState(sLibPackage + '/library.js'),
|
|
466
|
+
bHttp2 = Configuration.getDepCache();
|
|
467
|
+
|
|
468
|
+
if (sFileType === 'none' || bLibLoaded) {
|
|
469
|
+
// When a library's entry module is already available (either loaded or preloaded), a resolved promise
|
|
470
|
+
// is returned instead of this._loadingStatus.promise to avoid the deadlock between 2 libraries which
|
|
471
|
+
// have dependency of each other
|
|
472
|
+
return mOptions.sync ? this : Promise.resolve(this);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (this._loadingStatus == null && mOptions.url) {
|
|
476
|
+
registerModulePath(this.name, mOptions.url);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
this._loadingStatus = this._loadingStatus || {};
|
|
480
|
+
|
|
481
|
+
if ((mOptions.sync && this._loadingStatus.pending === false)
|
|
482
|
+
|| (!mOptions.sync && this._loadingStatus.promise)) {
|
|
483
|
+
// in the sync case, we can do a immediate return only when the library is fully loaded.
|
|
484
|
+
return mOptions.sync ? this : this._loadingStatus.promise;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
if (this._loadingStatus.pending && mOptions.sync) {
|
|
489
|
+
if (mOptions.lazy) {
|
|
490
|
+
// ignore a lazy request when an eager request is already pending
|
|
491
|
+
return this;
|
|
492
|
+
} else if (this._loadingStatus.async) {
|
|
493
|
+
Log.warning("request to load " + this.name + " synchronously while async loading is pending; this causes a duplicate request and should be avoided by caller");
|
|
494
|
+
// fall through and preload synchronously
|
|
495
|
+
} else {
|
|
496
|
+
// sync cycle -> ignore nested call (would nevertheless be a dependency cycle)
|
|
497
|
+
Log.warning("request to load " + this.name + " synchronously while sync loading is pending (cycle, ignored)");
|
|
498
|
+
return this;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (mOptions.lazy) {
|
|
503
|
+
// For selected lazy dependencies, we load a library-preload-lazy module.
|
|
504
|
+
// Errors are ignored and the library is not marked as pending in the bookkeeping
|
|
505
|
+
// (but the loader avoids double loading).
|
|
506
|
+
Log.debug("Lazy dependency to '" + this.name + "' encountered, loading library-preload-lazy.js");
|
|
507
|
+
|
|
508
|
+
if (mOptions.sync) {
|
|
509
|
+
try {
|
|
510
|
+
sap.ui.requireSync(sLibPackage + '/library-preload-lazy');
|
|
511
|
+
} catch (e) {
|
|
512
|
+
Log.error("failed to load '" + sLibPackage + "/library-preload-lazy.js" + "' synchronously (" + (e && e.message || e) + ")");
|
|
513
|
+
}
|
|
514
|
+
return this;
|
|
515
|
+
} else {
|
|
516
|
+
return sap.ui.loader._.loadJSResourceAsync(
|
|
517
|
+
sLibPackage + '/library-preload-lazy.js', /* ignoreErrors = */ true);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// otherwise mark as pending
|
|
522
|
+
this._loadingStatus.pending = true;
|
|
523
|
+
this._loadingStatus.async = !mOptions.sync;
|
|
524
|
+
|
|
525
|
+
// first preload code, resolves with list of dependencies (or undefined)
|
|
526
|
+
var pPreload = sFileType !== 'json' ?
|
|
527
|
+
/* 'js' or 'both', not forced to JSON */
|
|
528
|
+
this._preloadJSFormat({
|
|
529
|
+
fallbackToJSON: sFileType !== "js",
|
|
530
|
+
http2: bHttp2,
|
|
531
|
+
sync: mOptions.sync
|
|
532
|
+
})
|
|
533
|
+
: this._preloadJSONFormat({sync: mOptions.sync});
|
|
534
|
+
|
|
535
|
+
// load dependencies, if there are any
|
|
536
|
+
this._loadingStatus.promise = pPreload.then(function(aDependencies) {
|
|
537
|
+
var oManifest = this.getManifest(),
|
|
538
|
+
aPromises;
|
|
539
|
+
|
|
540
|
+
if (aDependencies && aDependencies.length) {
|
|
541
|
+
if (!mOptions.sync) {
|
|
542
|
+
var aEagerDependencies = [],
|
|
543
|
+
aLazyDependencies = [];
|
|
544
|
+
|
|
545
|
+
aDependencies.forEach(function(oDependency) {
|
|
546
|
+
if (oDependency.lazy) {
|
|
547
|
+
aLazyDependencies.push(oDependency);
|
|
548
|
+
} else {
|
|
549
|
+
aEagerDependencies.push(oDependency.name);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
// aEagerDependencies contains string elements before executing the next line
|
|
553
|
+
|
|
554
|
+
aEagerDependencies = VersionInfo._getTransitiveDependencyForLibraries(aEagerDependencies)
|
|
555
|
+
.map(function(sDependencyName) {
|
|
556
|
+
return {
|
|
557
|
+
name: sDependencyName
|
|
558
|
+
};
|
|
559
|
+
});
|
|
560
|
+
// aEagerDependencies contains object elements after executing the above line
|
|
561
|
+
|
|
562
|
+
// combine transitive closure of eager dependencies and direct lazy dependencies,
|
|
563
|
+
// the latter might be redundant
|
|
564
|
+
aDependencies = aEagerDependencies.concat(aLazyDependencies);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
aPromises = aDependencies.map(function(oDependency) {
|
|
568
|
+
var oLibrary = Library._get(oDependency.name, true/* bCreate */);
|
|
569
|
+
return oLibrary._preload({
|
|
570
|
+
sync: mOptions.sync,
|
|
571
|
+
lazy: oDependency.lazy
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
} else {
|
|
575
|
+
aPromises = [];
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (!mOptions.sync && oManifest && Version(oManifest._version).compareTo("1.9.0") >= 0) {
|
|
579
|
+
aPromises.push(this.loadResourceBundle());
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
var pFinish = mOptions.sync ? SyncPromise.all(aPromises) : Promise.all(aPromises);
|
|
583
|
+
return pFinish.then(function() {
|
|
584
|
+
this._loadingStatus.pending = false;
|
|
585
|
+
return this;
|
|
586
|
+
}.bind(this));
|
|
587
|
+
|
|
588
|
+
}.bind(this));
|
|
589
|
+
|
|
590
|
+
return mOptions.sync ? this._loadingStatus.promise.unwrap() : this._loadingStatus.promise;
|
|
591
|
+
},
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Loads the library's preload bundle in JS format. In case the resource "library-preload.js" doesn't exist and
|
|
595
|
+
* <code>mOptions.fallbackToJSON</code> is set to <code>true</code>, the library's preload in JSON format will
|
|
596
|
+
* be loaded.
|
|
597
|
+
*
|
|
598
|
+
* @param {object} [mOptions] The options object that contains the following properties
|
|
599
|
+
* @param {boolean} [mOptions.fallbackToJSON] Whether to load the preload in JSON format when loading the JS
|
|
600
|
+
* format fails
|
|
601
|
+
* @param {boolean} [mOptions.http2] Whether to load the "library-h2-preload" bundle instead of the
|
|
602
|
+
* "library-preload" bundle
|
|
603
|
+
* @param {boolean} [mOptions.sync] Whether to load the preload in sync mode
|
|
604
|
+
* @returns {Promise|object} A promise that resolves with the dependency information of the library in async
|
|
605
|
+
* mode or the dependency information directly in sync mode
|
|
606
|
+
* @private
|
|
607
|
+
*/
|
|
608
|
+
_preloadJSFormat: function(mOptions) {
|
|
609
|
+
mOptions = mOptions || {};
|
|
610
|
+
|
|
611
|
+
var that = this;
|
|
612
|
+
var sPreloadModule = this.name.replace(/\./g, '/')
|
|
613
|
+
+ (mOptions.http2 ? '/library-h2-preload' : '/library-preload')
|
|
614
|
+
+ (mOptions.sync ? '' : '.js');
|
|
615
|
+
var pResult;
|
|
616
|
+
|
|
617
|
+
if (mOptions.sync) {
|
|
618
|
+
// necessary to call sap.ui.requireSync in the "then" function to result in a rejected promise once the
|
|
619
|
+
// loading of JS preload fails
|
|
620
|
+
pResult = SyncPromise.resolve().then(function() {
|
|
621
|
+
sap.ui.requireSync(sPreloadModule); // legacy-relevant: Synchronous preloading
|
|
622
|
+
});
|
|
623
|
+
} else {
|
|
624
|
+
pResult = sap.ui.loader._.loadJSResourceAsync(sPreloadModule);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
return pResult.then(function() {
|
|
628
|
+
return that._getDependencies();
|
|
629
|
+
}, function(e) {
|
|
630
|
+
if (mOptions.fallbackToJSON) {
|
|
631
|
+
var bFallback;
|
|
632
|
+
if (mOptions.sync) {
|
|
633
|
+
var oRootCause = e;
|
|
634
|
+
while (oRootCause && oRootCause.cause) {
|
|
635
|
+
oRootCause = oRootCause.cause;
|
|
636
|
+
}
|
|
637
|
+
// fall back to JSON, but only if the root cause was an XHRLoadError
|
|
638
|
+
// ignore other errors (preload shouldn't fail)
|
|
639
|
+
bFallback = oRootCause && oRootCause.name === "XHRLoadError";
|
|
640
|
+
} else {
|
|
641
|
+
// loading library-preload.js failed, might be an old style lib with a library-preload.json only.
|
|
642
|
+
// with mOptions.fallbackToJSON === false, this fallback can be suppressed
|
|
643
|
+
bFallback = true;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
if (bFallback) {
|
|
647
|
+
Log.error("failed to load '" + sPreloadModule + "' (" + (e && e.message || e) + "), falling back to library-preload.json");
|
|
648
|
+
return that._preloadJSONFormat({sync: mOptions.sync});
|
|
649
|
+
}
|
|
650
|
+
// ignore other errors
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
},
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Loads the library's preload bundle in JSON format.
|
|
657
|
+
*
|
|
658
|
+
* @param {object} [mOptions] The options object that contains the following properties
|
|
659
|
+
* @param {boolean} [mOptions.sync] Whether to load the preload in sync mode
|
|
660
|
+
* @returns {Promise|object} A promise that resolves with the dependency information of the library in async
|
|
661
|
+
* mode or the dependency information directly in sync mode
|
|
662
|
+
* @private
|
|
663
|
+
*/
|
|
664
|
+
_preloadJSONFormat: function(mOptions) {
|
|
665
|
+
mOptions = mOptions || {};
|
|
666
|
+
|
|
667
|
+
var sURL = getModulePath(this.name, "/library-preload.json");
|
|
668
|
+
|
|
669
|
+
return mixedFetch(sURL, {
|
|
670
|
+
headers: {
|
|
671
|
+
Accept: mixedFetch.ContentTypes.JSON
|
|
672
|
+
}
|
|
673
|
+
}, mOptions.sync).then(function(response) {
|
|
674
|
+
if (response.ok) {
|
|
675
|
+
return response.json().then(function(data) {
|
|
676
|
+
if (data) {
|
|
677
|
+
registerPreloadedModules(data, sURL);
|
|
678
|
+
if (Array.isArray(data.dependencies)) {
|
|
679
|
+
// remove .library-preload suffix from dependencies
|
|
680
|
+
return data.dependencies.map(function (sDepLibraryName) {
|
|
681
|
+
return {
|
|
682
|
+
name: sDepLibraryName.replace(/\.library-preload$/, '')
|
|
683
|
+
};
|
|
684
|
+
});
|
|
685
|
+
} else {
|
|
686
|
+
return data.dependencies;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
} else {
|
|
691
|
+
throw Error(response.statusText || response.status);
|
|
692
|
+
}
|
|
693
|
+
}).catch(function(oError) {
|
|
694
|
+
Log.error("failed to load '" + sURL + "': " + oError.message);
|
|
695
|
+
});
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Returns the library's manifest when it's available.
|
|
700
|
+
*
|
|
701
|
+
* Only when the library's manifest is preloaded with the library's preload bundle, the manifest will be
|
|
702
|
+
* returned from this function. This function never triggers a separate request to load the library's manifest.
|
|
703
|
+
*
|
|
704
|
+
* @returns {object|undefined} The manifest of the library
|
|
705
|
+
*/
|
|
706
|
+
getManifest: function() {
|
|
707
|
+
if (!this.oManifest) {
|
|
708
|
+
var manifestModule = this.name.replace(/\./g, '/') + '/manifest.json';
|
|
709
|
+
|
|
710
|
+
if ( sap.ui.loader._.getModuleState(manifestModule) ) {
|
|
711
|
+
this.oManifest = LoaderExtensions.loadResource(manifestModule, {
|
|
712
|
+
dataType: 'json',
|
|
713
|
+
async: false, // always sync as we are sure to load from preload cache
|
|
714
|
+
failOnError: false
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
deepFreeze(this.oManifest);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
return this.oManifest;
|
|
722
|
+
},
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Returns the dependency information of the library which is read from the library's manifest.
|
|
726
|
+
*
|
|
727
|
+
* The returned array contains elements which have a property "name" and an optional "lazy" property.
|
|
728
|
+
*
|
|
729
|
+
* @private
|
|
730
|
+
* @returns {Array<{name:string, lazy:boolean}>} The dependency information of the library
|
|
731
|
+
*/
|
|
732
|
+
_getDependencies: function() {
|
|
733
|
+
var oManifest = this.getManifest();
|
|
734
|
+
var aDependencies = [];
|
|
735
|
+
|
|
736
|
+
var mDependencies = oManifest && oManifest["sap.ui5"] && oManifest["sap.ui5"].dependencies && oManifest["sap.ui5"].dependencies.libs;
|
|
737
|
+
if (mDependencies) {
|
|
738
|
+
// convert manifest map to array, inject object which contains "name" and optional "lazy" properties
|
|
739
|
+
return Object.keys(mDependencies).reduce(function(aResult, sDependencyName) {
|
|
740
|
+
if (!mDependencies[sDependencyName].lazy) {
|
|
741
|
+
aResult.push({
|
|
742
|
+
name: sDependencyName
|
|
743
|
+
});
|
|
744
|
+
} else if (oLibraryWithBundleInfo.has(sDependencyName)) {
|
|
745
|
+
aResult.push({
|
|
746
|
+
name: sDependencyName,
|
|
747
|
+
lazy: true
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
return aResult;
|
|
751
|
+
}, aDependencies);
|
|
752
|
+
} else {
|
|
753
|
+
return aDependencies;
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Returns the i18n information of the library which is read from the library's manifest.
|
|
759
|
+
*
|
|
760
|
+
* @returns {object|undefined} The i18n information of the library
|
|
761
|
+
*/
|
|
762
|
+
_getI18nSettings: function() {
|
|
763
|
+
var oManifest = this.getManifest(),
|
|
764
|
+
vI18n;
|
|
765
|
+
|
|
766
|
+
if ( oManifest && Version(oManifest._version).compareTo("1.9.0") >= 0 ) {
|
|
767
|
+
vI18n = oManifest["sap.ui5"] && oManifest["sap.ui5"].library && oManifest["sap.ui5"].library.i18n;
|
|
768
|
+
} // else vI18n = undefined
|
|
769
|
+
|
|
770
|
+
vI18n = this._normalizeI18nSettings(vI18n);
|
|
771
|
+
|
|
772
|
+
return vI18n;
|
|
773
|
+
},
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Provides the default values for the library's i18n information
|
|
777
|
+
*
|
|
778
|
+
* @param {boolean|string|object} vI18n bundle information. Can be:
|
|
779
|
+
* <ul>
|
|
780
|
+
* <li>false - library has no resource bundle</li>
|
|
781
|
+
* <li>true|null|undefined - use default settings: bundle is 'messageBundle.properties',
|
|
782
|
+
* fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
|
|
783
|
+
* <li>typeof string - string is the url of the bundle,
|
|
784
|
+
* fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
|
|
785
|
+
* <li>typeof object - object can contain bundleUrl, supportedLocales, fallbackLocale</li>
|
|
786
|
+
* </ul>
|
|
787
|
+
* @returns {object} normalized i18N information
|
|
788
|
+
*/
|
|
789
|
+
_normalizeI18nSettings: function(vI18n) {
|
|
790
|
+
if ( vI18n == null || vI18n === true ) {
|
|
791
|
+
vI18n = {
|
|
792
|
+
bundleUrl: "messagebundle.properties"
|
|
793
|
+
};
|
|
794
|
+
} else if ( typeof vI18n === "string" ) {
|
|
795
|
+
vI18n = {
|
|
796
|
+
bundleUrl: vI18n
|
|
797
|
+
};
|
|
798
|
+
} else if (typeof vI18n === "object") {
|
|
799
|
+
vI18n = deepExtend({}, vI18n);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
return vI18n;
|
|
803
|
+
},
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Includes the library theme into the current page (if a variant is specified it will include the variant
|
|
807
|
+
* library theme)
|
|
808
|
+
*
|
|
809
|
+
* @param {string} [sVariant] the variant to include (optional)
|
|
810
|
+
* @param {string} [sQuery] to be used only by the Core
|
|
811
|
+
* @private
|
|
812
|
+
*/
|
|
813
|
+
_includeTheme: function(sVariant, sQuery) {
|
|
814
|
+
var sName = this.name;
|
|
815
|
+
|
|
816
|
+
aAllLibrariesRequiringCss.push({
|
|
817
|
+
name: sName,
|
|
818
|
+
version: this.version,
|
|
819
|
+
variant: sVariant
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
_getThemeManager().then(function(ThemeManager) {
|
|
823
|
+
ThemeManager.includeLibraryTheme(sName, sVariant, sQuery);
|
|
824
|
+
});
|
|
825
|
+
},
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Returns a resource bundle for the given locale.
|
|
829
|
+
*
|
|
830
|
+
* The locale's default value is read from {@link sap.ui.core.Configuration#getLanguage session locale}.
|
|
831
|
+
*
|
|
832
|
+
* This method returns the resource bundle directly. When the resource bundle for the given locale isn't loaded
|
|
833
|
+
* yet, synchronous request will be used to load the resource bundle. If it should be loaded asynchronously, use
|
|
834
|
+
* {@link #loadResourceBundle}.
|
|
835
|
+
*
|
|
836
|
+
* The {@link #preload} method will evaluate the same descriptor entry as described above. If it is not
|
|
837
|
+
* <code>false</code>, loading the main resource bundle of the library will become a subtask of the
|
|
838
|
+
* asynchronous preloading.
|
|
839
|
+
*
|
|
840
|
+
* Due to this preload of the main bundle and the caching behavior of this method, controls in such a library
|
|
841
|
+
* still can use this method in their API, behavior and rendering code without causing a synchronous request to
|
|
842
|
+
* be sent. Only when the bundle is needed at module execution time (by top level code in a control module),
|
|
843
|
+
* then the asynchronous loading of resource bundle with {@link #loadResourceBundle} should be preferred.
|
|
844
|
+
*
|
|
845
|
+
* <h3>Configuration via App Descriptor</h3>
|
|
846
|
+
* When the App Descriptor for the library is available without further request (manifest.json
|
|
847
|
+
* has been preloaded) and when the App Descriptor is at least of version 1.9.0 or higher, then
|
|
848
|
+
* this method will evaluate the App Descriptor entry <code>"sap.ui5" / "library" / "i18n"</code>.
|
|
849
|
+
* <ul>
|
|
850
|
+
* <li>When the entry is <code>true</code>, a bundle with the default name "messagebundle.properties"
|
|
851
|
+
* will be loaded</li>
|
|
852
|
+
* <li>If it is a string, then that string will be used as name of the bundle</li>
|
|
853
|
+
* <li>If it is <code>false</code>, no bundle will be loaded and the result will be
|
|
854
|
+
* <code>undefined</code></li>
|
|
855
|
+
* </ul>
|
|
856
|
+
*
|
|
857
|
+
* <h3>Caching</h3>
|
|
858
|
+
* Once a resource bundle for a library has been loaded, it will be cached.
|
|
859
|
+
* Further calls for the same locale won't create new requests, but return the already
|
|
860
|
+
* loaded bundle. There's therefore no need for control code to cache the returned bundle for a longer
|
|
861
|
+
* period of time. Not further caching the result also prevents stale texts after a locale change.
|
|
862
|
+
*
|
|
863
|
+
* @param {string} [sLocale] Locale to retrieve the resource bundle for
|
|
864
|
+
* @returns {module:sap/base/i18n/ResourceBundle} The best matching
|
|
865
|
+
* resource bundle for the given locale or <code>undefined</code> when resource bundle isn't available
|
|
866
|
+
*/
|
|
867
|
+
getResourceBundle: function(sLocale) {
|
|
868
|
+
return this._loadResourceBundle(sLocale, true /* bSync */);
|
|
869
|
+
},
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Retrieves a resource bundle for the given locale.
|
|
873
|
+
*
|
|
874
|
+
* The locale's default value is read from {@link sap.ui.core.Configuration#getLanguage session locale}.
|
|
875
|
+
*
|
|
876
|
+
* <h3>Configuration via App Descriptor</h3>
|
|
877
|
+
* When the App Descriptor for the library is available without further request (manifest.json
|
|
878
|
+
* has been preloaded) and when the App Descriptor is at least of version 1.9.0 or higher, then
|
|
879
|
+
* this method will evaluate the App Descriptor entry <code>"sap.ui5" / "library" / "i18n"</code>.
|
|
880
|
+
* <ul>
|
|
881
|
+
* <li>When the entry is <code>true</code>, a bundle with the default name "messagebundle.properties"
|
|
882
|
+
* will be loaded</li>
|
|
883
|
+
* <li>If it is a string, then that string will be used as name of the bundle</li>
|
|
884
|
+
* <li>If it is <code>false</code>, no bundle will be loaded and the result will be
|
|
885
|
+
* <code>undefined</code></li>
|
|
886
|
+
* </ul>
|
|
887
|
+
*
|
|
888
|
+
* <h3>Caching</h3>
|
|
889
|
+
* Once a resource bundle for a library has been loaded, it will be cached.
|
|
890
|
+
* Further calls for the same library and locale won't create new requests, but return the already
|
|
891
|
+
* loaded bundle. There's therefore no need for control code to cache the returned bundle for a longer
|
|
892
|
+
* period of time. Not further caching the result also prevents stale texts after a locale change.
|
|
893
|
+
*
|
|
894
|
+
* @param {string} [sLocale] Locale to retrieve the resource bundle for
|
|
895
|
+
* @returns {Promise<module:sap/base/i18n/ResourceBundle>} Promise that resolves with the best matching
|
|
896
|
+
* resource bundle for the given locale
|
|
897
|
+
*/
|
|
898
|
+
loadResourceBundle: function(sLocale) {
|
|
899
|
+
return this._loadResourceBundle(sLocale);
|
|
900
|
+
},
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Internal method that either returns the resource bundle directly when <code>bSync</code> is set to
|
|
904
|
+
* <code>true</code> or a Promise that resolves with the resource bundle in the asynchronous case.
|
|
905
|
+
*
|
|
906
|
+
* @param {string} [sLocale] Locale to retrieve the resource bundle for
|
|
907
|
+
* @param {string} [bSync=false] Whether to load the resource bundle synchronously
|
|
908
|
+
* @returns {module:sap/base/i18n/ResourceBundle|Promise<module:sap/base/i18n/ResourceBundle>} The resource
|
|
909
|
+
* bundle in synchronous case, otherwise a promise that resolves with the resource bundle
|
|
910
|
+
* @prviate
|
|
911
|
+
*/
|
|
912
|
+
_loadResourceBundle: function(sLocale, bSync) {
|
|
913
|
+
var that = this,
|
|
914
|
+
oManifest = this.getManifest(),
|
|
915
|
+
// A library ResourceBundle can be requested before its owning library is preloaded.
|
|
916
|
+
// In this case we do not have the library's manifest yet and the default bundle (messagebundle.properties) is requested.
|
|
917
|
+
// We still cache this default bundle for as long as the library remains "not-preloaded".
|
|
918
|
+
// When the library is preloaded later on, a new ResourceBundle needs to be requested, since we need to take the
|
|
919
|
+
// "sap.ui5/library/i18n" section of the library's manifest into account.
|
|
920
|
+
bLibraryManifestIsAvailable = !!oManifest,
|
|
921
|
+
vResult,
|
|
922
|
+
vI18n,
|
|
923
|
+
sNotLoadedCacheKey,
|
|
924
|
+
sKey;
|
|
925
|
+
|
|
926
|
+
assert(sLocale === undefined || typeof sLocale === "string", "sLocale must be a string or omitted");
|
|
927
|
+
sLocale = sLocale || Configuration.getLanguage();
|
|
928
|
+
sNotLoadedCacheKey = sLocale + "/manifest-not-available";
|
|
929
|
+
|
|
930
|
+
// If the library was loaded in the meantime (or the first time around), we can delete the old ResourceBundle
|
|
931
|
+
if (bLibraryManifestIsAvailable) {
|
|
932
|
+
sKey = sLocale;
|
|
933
|
+
delete this._resourceBundles[sNotLoadedCacheKey];
|
|
934
|
+
} else {
|
|
935
|
+
// otherwise we use the temporary cache-key
|
|
936
|
+
sKey = sNotLoadedCacheKey;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
vResult = this._resourceBundles[sKey];
|
|
940
|
+
if (!vResult || (bSync && vResult instanceof Promise)) {
|
|
941
|
+
|
|
942
|
+
vI18n = this._getI18nSettings();
|
|
943
|
+
|
|
944
|
+
if (vI18n) {
|
|
945
|
+
var sBundleUrl = getModulePath(this.name + "/", vI18n.bundleUrl);
|
|
946
|
+
|
|
947
|
+
// add known library name to cache to avoid later guessing
|
|
948
|
+
mGuessedLibraries[sBundleUrl] = this;
|
|
949
|
+
|
|
950
|
+
vResult = ResourceBundle.create({
|
|
951
|
+
bundleUrl: sBundleUrl,
|
|
952
|
+
supportedLocales: vI18n.supportedLocales,
|
|
953
|
+
fallbackLocale: vI18n.fallbackLocale,
|
|
954
|
+
locale: sLocale,
|
|
955
|
+
async: !bSync,
|
|
956
|
+
activeTerminologies: Configuration.getActiveTerminologies()
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
if (vResult instanceof Promise) {
|
|
960
|
+
vResult = vResult.then(function(oBundle) {
|
|
961
|
+
that._resourceBundles[sKey] = oBundle;
|
|
962
|
+
return oBundle;
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// Save the result directly under the map
|
|
967
|
+
// the real bundle will replace the promise after it's loaded in async case
|
|
968
|
+
this._resourceBundles[sKey] = vResult;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
// if the bundle is loaded, return a promise which resolved with the bundle
|
|
973
|
+
return bSync ? vResult : Promise.resolve(vResult);
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Returns an array containing all libraries which require loading of CSS
|
|
980
|
+
*
|
|
981
|
+
* @returns {Array} Array containing all libraries which require loading of CSS
|
|
982
|
+
* @private
|
|
983
|
+
* @ui5-restricted sap.ui.core.theming.Parameters
|
|
984
|
+
*/
|
|
985
|
+
Library.getAllInstancesRequiringCss = function() {
|
|
986
|
+
return aAllLibrariesRequiringCss.slice();
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Returns an instance of a Library whose "name" is the same as the given <code>sName</code>. Created library
|
|
991
|
+
* instances are cached by its name. For one library name, there's maximum one instance created and cached.
|
|
992
|
+
*
|
|
993
|
+
* If no library under the given <code>sName</code> is created yet, <code>undefined</code> is returned. To load a
|
|
994
|
+
* library, {@link #.load} can be used directly without calling this method in advance.
|
|
995
|
+
*
|
|
996
|
+
* @param {string} sName The name of the library
|
|
997
|
+
* @returns {Promise<module:sap/ui/core/Lib>|undefined} Either an instance of the library or <code>undefined</code>
|
|
998
|
+
* @public
|
|
999
|
+
*/
|
|
1000
|
+
Library.get = function(sName) {
|
|
1001
|
+
return Library._get(sName);
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Internal method for fetching library instance from the library cache by using the given <code>sName</code>.
|
|
1006
|
+
*
|
|
1007
|
+
* When the <code>bCreate</code> is set to <code>true</code>, a new instance for the library is created in case
|
|
1008
|
+
* there was no such library instance before. Otherwise, the library instance from the cache or
|
|
1009
|
+
* <code>undefined</code> is returned.
|
|
1010
|
+
*
|
|
1011
|
+
* @param {string} sName The name of the library
|
|
1012
|
+
* @param {boolean} bCreate Whether to create an instance for the library when there's no instance saved in the
|
|
1013
|
+
* cache under the given <code>sName</code>
|
|
1014
|
+
* @returns {Promise<module:sap/ui/core/Lib>|undefined} Either an instance of the library or <code>undefined</code>
|
|
1015
|
+
* @private
|
|
1016
|
+
*/
|
|
1017
|
+
Library._get = function(sName, bCreate) {
|
|
1018
|
+
var oLibrary = mLibraries[sName];
|
|
1019
|
+
|
|
1020
|
+
if (!oLibrary && bCreate) {
|
|
1021
|
+
mLibraries[sName] = oLibrary = new Library({
|
|
1022
|
+
name: sName,
|
|
1023
|
+
_key: oConstructorKey
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
return oLibrary;
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Tries to derive a library from a bundle URL by guessing the resource name first,
|
|
1032
|
+
* then trying to match with the (known) loaded libraries.
|
|
1033
|
+
*
|
|
1034
|
+
* @param {string} sBundleUrl The bundleURL from which the library name needs to be derived.
|
|
1035
|
+
* @returns {sap.ui.core.Lib|undefined} Returns the corresponding library if found or 'undefined'.
|
|
1036
|
+
* @private
|
|
1037
|
+
*/
|
|
1038
|
+
Library._getByBundleUrl = function(sBundleUrl) {
|
|
1039
|
+
if (sBundleUrl) {
|
|
1040
|
+
if (mGuessedLibraries[sBundleUrl]) {
|
|
1041
|
+
return mGuessedLibraries[sBundleUrl];
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// [1] Guess ResourceName
|
|
1045
|
+
var sBundleName = sap.ui.loader._.guessResourceName(sBundleUrl);
|
|
1046
|
+
if (sBundleName) {
|
|
1047
|
+
|
|
1048
|
+
// [2] Guess library name
|
|
1049
|
+
for (var sLibrary in mLibraries) {
|
|
1050
|
+
if (!mLibraries[sLibrary].isSettingsEnhanced()) {
|
|
1051
|
+
// ignore libraries that haven't been initialized
|
|
1052
|
+
continue;
|
|
1053
|
+
}
|
|
1054
|
+
var sLibraryName = sLibrary.replace(/\./g, "/");
|
|
1055
|
+
var oLib = mLibraries[sLibrary];
|
|
1056
|
+
if (sLibraryName !== "" && sBundleName.startsWith(sLibraryName + "/")) {
|
|
1057
|
+
var sBundlePath = sBundleName.replace(sLibraryName + "/", "");
|
|
1058
|
+
|
|
1059
|
+
// [3] Retrieve i18n from manifest for looking up the base bundle
|
|
1060
|
+
// (can be undefined if the lib defines "sap.ui5/library/i18n" with <false>)
|
|
1061
|
+
var vI18n = oLib._getI18nSettings();
|
|
1062
|
+
|
|
1063
|
+
if (vI18n) {
|
|
1064
|
+
// Resolve bundle paths relative to library before comparing
|
|
1065
|
+
var sManifestBaseBundlePath = getModulePath(sLibraryName, "/" + vI18n.bundleUrl);
|
|
1066
|
+
sBundlePath = getModulePath(sLibraryName, "/" + sBundlePath);
|
|
1067
|
+
|
|
1068
|
+
// the input bundle-path and the derived library bundle-path must match,
|
|
1069
|
+
// otherwise we would enhance the wrong bundle with terminologies etc.
|
|
1070
|
+
if (sBundlePath === sManifestBaseBundlePath) {
|
|
1071
|
+
// [4.1] Cache matching result
|
|
1072
|
+
mGuessedLibraries[sBundleUrl] = oLib;
|
|
1073
|
+
return oLib;
|
|
1074
|
+
}
|
|
1075
|
+
// [4.2] Cache none-matching result
|
|
1076
|
+
mGuessedLibraries[sBundleUrl] = false;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Returns a map that contains the libraries that are already initialized (by calling {@link #.init}). Each library
|
|
1086
|
+
* instance is saved in the map under its name as key.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns {object} A map that contains the initialized libraries. Each library is saved in the map under its name
|
|
1089
|
+
* as key.
|
|
1090
|
+
* @public
|
|
1091
|
+
*/
|
|
1092
|
+
Library.all = function() {
|
|
1093
|
+
var mInitLibraries = {};
|
|
1094
|
+
|
|
1095
|
+
Object.keys(mLibraries).forEach(function(sKey) {
|
|
1096
|
+
if (mLibraries[sKey].isSettingsEnhanced()) {
|
|
1097
|
+
mInitLibraries[sKey] = mLibraries[sKey];
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
return mInitLibraries;
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Provides information about a library.
|
|
1106
|
+
*
|
|
1107
|
+
* This method is intended to be called exactly once while the main module of a library (its <code>library.js</code>
|
|
1108
|
+
* module) is executing, typically at its begin. The single parameter <code>oLibInfo</code> is an info object that
|
|
1109
|
+
* describes the content of the library.
|
|
1110
|
+
*
|
|
1111
|
+
* When the <code>mSettings</code> has been processed, a normalized version will be set on the library instance
|
|
1112
|
+
* Finally, this function fires {@link #event:LibraryChanged} event with operation 'add' for the newly loaded
|
|
1113
|
+
* library.
|
|
1114
|
+
*
|
|
1115
|
+
* <h3>Side Effects</h3>
|
|
1116
|
+
*
|
|
1117
|
+
* While analyzing the <code>mSettings</code>, the framework takes some additional actions:
|
|
1118
|
+
*
|
|
1119
|
+
* <ul>
|
|
1120
|
+
* <li>If the object contains a list of <code>interfaces</code>, they will be registered with the {@link
|
|
1121
|
+
* sap.ui.base.DataType} class to make them available as aggregation types in managed objects.</li>
|
|
1122
|
+
*
|
|
1123
|
+
* <li>If the object contains a list of <code>controls</code> or <code>elements</code>, {@link sap.ui.lazyRequire
|
|
1124
|
+
* lazy stubs} will be created for their constructor as well as for their static <code>extend</code> and
|
|
1125
|
+
* <code>getMetadata</code> methods.<br> <b>Note:</b> Future versions might abandon the concept of lazy stubs as it
|
|
1126
|
+
* requires synchronous XMLHttpRequests which have been deprecated (see {@link http://xhr.spec.whatwg.org}). To be
|
|
1127
|
+
* on the safe side, productive applications should always require any modules that they directly depend on.</li>
|
|
1128
|
+
*
|
|
1129
|
+
* <li>With the <code>noLibraryCSS</code> property, the library can be marked as 'theming-free'. Otherwise, the
|
|
1130
|
+
* framework will add a <link> tag to the page's head, pointing to the library's theme-specific stylesheet.
|
|
1131
|
+
* The creation of such a <link> tag can be suppressed with the {@link sap.ui.core.Configuration global
|
|
1132
|
+
* configuration option} <code>preloadLibCss</code>. It can contain a list of library names for which no stylesheet
|
|
1133
|
+
* should be included. This is e.g. useful when an application merges the CSS for multiple libraries and already
|
|
1134
|
+
* loaded the resulting stylesheet.</li>
|
|
1135
|
+
*
|
|
1136
|
+
* <li>If a list of library <code>dependencies</code> is specified in the info object, those libraries will be
|
|
1137
|
+
* loaded synchronously.<br> <b>Note:</b> Dependencies between libraries don't have to be modeled as AMD
|
|
1138
|
+
* dependencies. Only when enums or types from an additional library are used in the coding of the
|
|
1139
|
+
* <code>library.js</code> module, the library should be additionally listed in the AMD dependencies.</li>
|
|
1140
|
+
* </ul>
|
|
1141
|
+
*
|
|
1142
|
+
* Last but not least, higher layer frameworks might want to include their own metadata for libraries.
|
|
1143
|
+
* The property <code>extensions</code> might contain such additional metadata. Its structure is not defined
|
|
1144
|
+
* by the framework, but it is strongly suggested that each extension only occupies a single property
|
|
1145
|
+
* in the <code>extensions</code> object and that the name of that property contains some namespace
|
|
1146
|
+
* information (e.g. library name that introduces the feature) to avoid conflicts with other extensions.
|
|
1147
|
+
* The framework won't touch the content of <code>extensions</code> but will make it available
|
|
1148
|
+
* in the library info objects returned by {@link #.getInitializedLibraries}.
|
|
1149
|
+
*
|
|
1150
|
+
*
|
|
1151
|
+
* <h3>Relationship to Descriptor for Libraries (manifest.json)</h3>
|
|
1152
|
+
*
|
|
1153
|
+
* The information contained in <code>mSettings</code> is partially redundant to the content of the descriptor
|
|
1154
|
+
* for the same library (its <code>manifest.json</code> file). Future versions of UI5 might ignore the information
|
|
1155
|
+
* provided in <code>oLibInfo</code> and might evaluate the descriptor file instead. Library developers therefore
|
|
1156
|
+
* should keep the information in both files in sync.
|
|
1157
|
+
*
|
|
1158
|
+
* When the <code>manifest.json</code> is generated from the <code>.library</code> file (which is the default
|
|
1159
|
+
* for UI5 libraries built with Maven), then the content of the <code>.library</code> and <code>library.js</code>
|
|
1160
|
+
* files must be kept in sync.
|
|
1161
|
+
*
|
|
1162
|
+
* @param {object} mSettings Info object for the library
|
|
1163
|
+
* @param {string} [mSettings.name] Name of the library; when given it must match the name by which the library has
|
|
1164
|
+
* been loaded
|
|
1165
|
+
* @param {string} mSettings.version Version of the library
|
|
1166
|
+
* @param {string[]} [mSettings.dependencies=[]] List of libraries that this library depends on; names are in dot
|
|
1167
|
+
* notation (e.g. "sap.ui.core")
|
|
1168
|
+
* @param {string[]} [mSettings.types=[]] List of names of types that this library provides; names are in dot
|
|
1169
|
+
* notation (e.g. "sap.ui.core.CSSSize")
|
|
1170
|
+
* @param {string[]} [mSettings.interfaces=[]] List of names of interface types that this library provides; names
|
|
1171
|
+
* are in dot notation (e.g. "sap.ui.core.PopupInterface")
|
|
1172
|
+
* @param {string[]} [mSettings.controls=[]] Names of control types that this library provides; names are in dot
|
|
1173
|
+
* notation (e.g. "sap.ui.core.ComponentContainer")
|
|
1174
|
+
* @param {string[]} [mSettings.elements=[]] Names of element types that this library provides (excluding controls);
|
|
1175
|
+
* names are in dot notation (e.g. "sap.ui.core.Item")
|
|
1176
|
+
* @param {boolean} [mSettings.noLibraryCSS=false] Indicates whether the library doesn't provide / use theming.
|
|
1177
|
+
* When set to true, no library.css will be loaded for this library
|
|
1178
|
+
* @param {object} [oLibInfo.extensions] Potential extensions of the library metadata; structure not defined by the
|
|
1179
|
+
* UI5 core framework.
|
|
1180
|
+
* @returns {object|undefined} As of version 1.101; returns the library namespace, based on the given library name.
|
|
1181
|
+
* Returns 'undefined' if no library name is provided.
|
|
1182
|
+
* @public
|
|
1183
|
+
*/
|
|
1184
|
+
Library.init = function(mSettings) {
|
|
1185
|
+
assert(typeof mSettings === "object" , "mSettings given to 'sap/ui/core/Lib.create' must be an object");
|
|
1186
|
+
assert(typeof mSettings.name === "string" && mSettings.name, "mSettings given to 'sap/ui/core/Lib.create' must have the 'name' property set");
|
|
1187
|
+
|
|
1188
|
+
var METHOD = "sap/ui/core/Lib.init";
|
|
1189
|
+
Log.debug("Analyzing Library " + mSettings.name, null, METHOD);
|
|
1190
|
+
|
|
1191
|
+
var oLib = Library._get(mSettings.name, true /* bCreate */);
|
|
1192
|
+
oLib.enhanceSettings(mSettings);
|
|
1193
|
+
|
|
1194
|
+
// ensure namespace
|
|
1195
|
+
var oLibNamespace = ObjectPath.create(mSettings.name),
|
|
1196
|
+
i;
|
|
1197
|
+
|
|
1198
|
+
// resolve dependencies
|
|
1199
|
+
for (i = 0; i < oLib.dependencies.length; i++) {
|
|
1200
|
+
var sDepLib = oLib.dependencies[i];
|
|
1201
|
+
var oDepLib = Library._get(sDepLib, true /* bCreate */);
|
|
1202
|
+
Log.debug("resolve Dependencies to " + sDepLib, null, METHOD);
|
|
1203
|
+
if (!oDepLib.isSettingsEnhanced()) {
|
|
1204
|
+
Log.warning("Dependency from " + mSettings.name + " to " + sDepLib + " has not been resolved by library itself", null, METHOD);
|
|
1205
|
+
Library._load({name: sDepLib}, {sync: true}); // legacy-relevant: Sync fallback for missing manifest/AMD dependencies
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
// register interface types
|
|
1210
|
+
DataType.registerInterfaceTypes(oLib.interfaces);
|
|
1211
|
+
|
|
1212
|
+
// Declare a module for each (non-builtin) simple type
|
|
1213
|
+
// Only needed for backward compatibility: some code 'requires' such types although they never have been modules on their own
|
|
1214
|
+
for (i = 0; i < oLib.types.length; i++) {
|
|
1215
|
+
if ( !/^(any|boolean|float|int|string|object|void)$/.test(oLib.types[i]) ) {
|
|
1216
|
+
sap.ui.loader._.declareModule(oLib.types[i].replace(/\./g, "/") + ".js");
|
|
1217
|
+
|
|
1218
|
+
// ensure parent namespace of the type
|
|
1219
|
+
var sNamespacePrefix = oLib.types[i].substring(0, oLib.types[i].lastIndexOf("."));
|
|
1220
|
+
if (ObjectPath.get(sNamespacePrefix) === undefined) {
|
|
1221
|
+
// parent type namespace does not exists, so we create its
|
|
1222
|
+
ObjectPath.create(sNamespacePrefix);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// create lazy loading stubs for all controls and elements
|
|
1228
|
+
var aElements = oLib.controls.concat(oLib.elements);
|
|
1229
|
+
for (i = 0; i < aElements.length; i++) {
|
|
1230
|
+
sap.ui.lazyRequire(aElements[i], "new extend getMetadata"); // TODO don't create an 'extend' stub for final classes
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
// include the library theme, but only if it has not been suppressed in library metadata or by configuration
|
|
1234
|
+
if (!oLib.noLibraryCSS) {
|
|
1235
|
+
var oLibThemingInfo = {
|
|
1236
|
+
name: oLib.name,
|
|
1237
|
+
version: oLib.version
|
|
1238
|
+
};
|
|
1239
|
+
// Don't reset ThemeManager in case CSS for current library is already preloaded
|
|
1240
|
+
var bResetThemeManager = Configuration.getValue('preloadLibCss').indexOf(oLib.name) === -1;
|
|
1241
|
+
aAllLibrariesRequiringCss.push(oLibThemingInfo);
|
|
1242
|
+
_getThemeManager(bResetThemeManager).then(function(ThemeManager) {
|
|
1243
|
+
ThemeManager._includeLibraryThemeAndEnsureThemeRoot(oLibThemingInfo);
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// expose some legacy names
|
|
1248
|
+
oLib.sName = oLib.name;
|
|
1249
|
+
oLib.aControls = oLib.controls;
|
|
1250
|
+
|
|
1251
|
+
Library.fireLibraryChanged({
|
|
1252
|
+
name: mSettings.name,
|
|
1253
|
+
stereotype: "library",
|
|
1254
|
+
operation: "add",
|
|
1255
|
+
metadata: oLib
|
|
1256
|
+
});
|
|
1257
|
+
|
|
1258
|
+
return oLibNamespace;
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
function getLibraryModuleNames(aLibs) {
|
|
1262
|
+
return aLibs.map(function(oLib) {
|
|
1263
|
+
return oLib.name.replace(/\./g, "/") + "/library";
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
function requireLibrariesAsync(aLibs) {
|
|
1268
|
+
var aLibraryModuleNames = getLibraryModuleNames(aLibs);
|
|
1269
|
+
|
|
1270
|
+
return new Promise(function(resolve, reject) {
|
|
1271
|
+
sap.ui.require(
|
|
1272
|
+
aLibraryModuleNames,
|
|
1273
|
+
function () {
|
|
1274
|
+
// Wrapper function is needed to omit parameters for resolve()
|
|
1275
|
+
// which is always one library (first from the list), not an array of libraries.
|
|
1276
|
+
resolve(aLibs);
|
|
1277
|
+
},
|
|
1278
|
+
reject
|
|
1279
|
+
);
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Loads the given library and its dependencies and makes its content available to the application.
|
|
1285
|
+
*
|
|
1286
|
+
*
|
|
1287
|
+
* <h3>What it does</h3>
|
|
1288
|
+
*
|
|
1289
|
+
* When library preloads are not suppressed for the given library, then a library-preload bundle will be loaded for
|
|
1290
|
+
* it.
|
|
1291
|
+
*
|
|
1292
|
+
* After preloading the bundle, dependency information from the bundle is evaluated and any missing libraries are
|
|
1293
|
+
* also preloaded.
|
|
1294
|
+
*
|
|
1295
|
+
* Only then the library entry module (named <code><i>your/lib</i>/library.js</code>) will be required and executed.
|
|
1296
|
+
* The module is supposed to call {@link #.init} providing the framework with additional metadata about the library,
|
|
1297
|
+
* e.g. its version, the set of contained enums, types, interfaces, controls and elements and whether the library
|
|
1298
|
+
* requires CSS. If the library requires CSS, a <link> will be added to the page referring to the
|
|
1299
|
+
* corresponding <code>library.css</code> stylesheet for the library and the current theme.
|
|
1300
|
+
*
|
|
1301
|
+
* When the optional parameter <code>mOptions.url</code> is given, then that URL will be registered for the
|
|
1302
|
+
* namespace of the library and all resources will be loaded from that location. This is convenience for a call like
|
|
1303
|
+
* <pre>
|
|
1304
|
+
* sap.ui.loader.config({
|
|
1305
|
+
* paths: {
|
|
1306
|
+
* "lib/with/slashes": mOptions.url
|
|
1307
|
+
* }
|
|
1308
|
+
* });
|
|
1309
|
+
* </pre>
|
|
1310
|
+
*
|
|
1311
|
+
* When the given library has been loaded already, no further action will be taken, especially, a given URL will not
|
|
1312
|
+
* be registered. A Promise will be returned, but will be resolved immediately.
|
|
1313
|
+
*
|
|
1314
|
+
*
|
|
1315
|
+
* <h3>When to use</h3>
|
|
1316
|
+
*
|
|
1317
|
+
* For applications that follow the best practices and use components with component descriptors (manifest.json),
|
|
1318
|
+
* the framework will load all declared mandatory libraries and their dependencies automatically before
|
|
1319
|
+
* instantiating the application component.
|
|
1320
|
+
*
|
|
1321
|
+
* The same is true for libraries that are listed in the bootstrap configuration (e.g. with the attribute
|
|
1322
|
+
* <code>data-sap-ui-libs</code>). They will be loaded before the <code>init</code> event of the UI5 Core is fired.
|
|
1323
|
+
*
|
|
1324
|
+
* Only when an app declares a library to be a lazy library dependency or when code does not use descriptors at all,
|
|
1325
|
+
* then an explicit call to <code>loadLibrary</code> becomes necessary. The call should be made before artifacts
|
|
1326
|
+
* (controls, elements, types, helpers, modules etc.) from the library are used or required. This allows the
|
|
1327
|
+
* framework to optimize access to those artifacts.
|
|
1328
|
+
*
|
|
1329
|
+
* For example, when an app uses a heavy-weight charting library that shouldn't be loaded during startup, it can
|
|
1330
|
+
* declare it as "lazy" and load it just before it loads and displays a view that uses the charting library:
|
|
1331
|
+
* <pre>
|
|
1332
|
+
* Lib.load({name: "heavy.charting"})
|
|
1333
|
+
* .then(function() {
|
|
1334
|
+
* View.create({
|
|
1335
|
+
* name: "myapp.views.HeavyChartingView",
|
|
1336
|
+
* type: ViewType.XML
|
|
1337
|
+
* });
|
|
1338
|
+
* });
|
|
1339
|
+
* </pre>
|
|
1340
|
+
*
|
|
1341
|
+
* @param {object} mOptions The options object that contains the following properties
|
|
1342
|
+
* @param {string} mOptions.name The name of the library
|
|
1343
|
+
* @param {string} [mOptions.url] URL to load the library from
|
|
1344
|
+
* @returns {Promise<module:sap/ui/core/Lib>} A promise that resolves with the library instance after the loading of
|
|
1345
|
+
* the library is finished
|
|
1346
|
+
* @public
|
|
1347
|
+
*/
|
|
1348
|
+
Library.load = function(mOptions) {
|
|
1349
|
+
if (typeof mOptions === "string") {
|
|
1350
|
+
mOptions = {name: mOptions};
|
|
1351
|
+
} else {
|
|
1352
|
+
mOptions = ["name", "url"].reduce(function(acc, sProperty) {
|
|
1353
|
+
if (mOptions && mOptions.hasOwnProperty(sProperty)) {
|
|
1354
|
+
acc[sProperty] = mOptions[sProperty];
|
|
1355
|
+
}
|
|
1356
|
+
return acc;
|
|
1357
|
+
}, {});
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
return Library._load(mOptions).then(function(aLibs) {
|
|
1361
|
+
return aLibs[0];
|
|
1362
|
+
});
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Internal function for loading library/libraries which still supports the legacy features:
|
|
1367
|
+
*
|
|
1368
|
+
* <ul>
|
|
1369
|
+
* <li>loading multiple libraries: libraries are preloaded firstly and their entry modules are executed within a
|
|
1370
|
+
* single <code>sap.ui.require</code> call after their preloads are finished</li>
|
|
1371
|
+
* <li><code>oLibConfig.json</code>: load the library preload in JSON format</li>
|
|
1372
|
+
* <li><code>mOptions.sync</code>: load the preload file in sync mode</li>
|
|
1373
|
+
* <li><code>mOptions.preloadOnly</code>: load the preload file in sync mode</li>
|
|
1374
|
+
* </ul>
|
|
1375
|
+
*
|
|
1376
|
+
* @param {object[]|object} vLibConfigs An array of objects for libraries or a single object for one library
|
|
1377
|
+
* which contain the following properties
|
|
1378
|
+
* @param {string} oLibConfig.name The name of the library
|
|
1379
|
+
* @param {string} [oLibConfig.url] URL to load the library from
|
|
1380
|
+
* @param {boolean} [oLibConfig.json] Whether to load the library's preload bundle in JSON format
|
|
1381
|
+
* @param {object} [mOptions] The options object that contains the following properties
|
|
1382
|
+
* @param {boolean} [mOptions.sync] Whether to load the preload bundle(s) in sync mode
|
|
1383
|
+
* @param {boolean} [mOptions.preloadOnly] Whether to skip executing the entry module(s) after preloading the
|
|
1384
|
+
* library/libraries
|
|
1385
|
+
* @return {Promise<Array<module:sap/ui/core/Lib>>|Array<module:sap/ui/core/Lib>} A promise that resolves with an
|
|
1386
|
+
* array of library instances in async mode or an array of library instances in sync mode
|
|
1387
|
+
* @private
|
|
1388
|
+
*/
|
|
1389
|
+
Library._load = function(vLibConfigs, mOptions) {
|
|
1390
|
+
mOptions = mOptions || {};
|
|
1391
|
+
|
|
1392
|
+
if (!Array.isArray(vLibConfigs)) {
|
|
1393
|
+
vLibConfigs = [vLibConfigs];
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
var mAdditionalConfig = {};
|
|
1397
|
+
var aLibraryNames = [];
|
|
1398
|
+
vLibConfigs.forEach(function(vLibrary) {
|
|
1399
|
+
if (typeof vLibrary === "object") {
|
|
1400
|
+
if (vLibrary.hasOwnProperty("url") || vLibrary.hasOwnProperty("json")) {
|
|
1401
|
+
mAdditionalConfig[vLibrary.name] = vLibrary;
|
|
1402
|
+
}
|
|
1403
|
+
aLibraryNames.push(vLibrary.name);
|
|
1404
|
+
} else {
|
|
1405
|
+
aLibraryNames.push(vLibrary);
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
|
|
1409
|
+
var bPreload = Configuration.getPreload() === 'sync' || Configuration.getPreload() === 'async',
|
|
1410
|
+
bRequire = !mOptions.preloadOnly;
|
|
1411
|
+
|
|
1412
|
+
if (!mOptions.sync) {
|
|
1413
|
+
aLibraryNames = VersionInfo._getTransitiveDependencyForLibraries(aLibraryNames);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
var aLibs = aLibraryNames.map(function(sLibraryName) {
|
|
1417
|
+
var oLib = Library._get(sLibraryName, true /* bCreate */);
|
|
1418
|
+
|
|
1419
|
+
if (oLib._loadingStatus == null && mAdditionalConfig[sLibraryName] && mAdditionalConfig[sLibraryName].url) {
|
|
1420
|
+
registerModulePath(sLibraryName, mAdditionalConfig[sLibraryName].url);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
return oLib;
|
|
1424
|
+
});
|
|
1425
|
+
|
|
1426
|
+
if (!mOptions.sync) {
|
|
1427
|
+
var pPreloaded = bPreload ?
|
|
1428
|
+
Promise.all(aLibs.map(function(oLib) {
|
|
1429
|
+
var mOptions = {};
|
|
1430
|
+
if (mAdditionalConfig[oLib.name] && mAdditionalConfig[oLib.name].hasOwnProperty("json")) {
|
|
1431
|
+
mOptions.json = mAdditionalConfig[oLib.name].json;
|
|
1432
|
+
}
|
|
1433
|
+
return oLib._preload(mOptions);
|
|
1434
|
+
})) :
|
|
1435
|
+
Promise.resolve(aLibs);
|
|
1436
|
+
|
|
1437
|
+
return bRequire ? pPreloaded.then(requireLibrariesAsync) : pPreloaded;
|
|
1438
|
+
} else {
|
|
1439
|
+
if (bPreload) {
|
|
1440
|
+
aLibs.forEach(function(oLib) {
|
|
1441
|
+
var mOptions = {sync: true};
|
|
1442
|
+
if (mAdditionalConfig[oLib.name] && mAdditionalConfig[oLib.name].hasOwnProperty("json")) {
|
|
1443
|
+
mOptions.json = mAdditionalConfig[oLib.name].json;
|
|
1444
|
+
}
|
|
1445
|
+
oLib._preload(mOptions);
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
if (bRequire) {
|
|
1450
|
+
getLibraryModuleNames(aLibs).forEach(function(sModuleName, index) {
|
|
1451
|
+
if (aLibs[index].isSettingsEnhanced()) {
|
|
1452
|
+
// load library only once
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// require the library module (which in turn will call initLibrary())
|
|
1457
|
+
sap.ui.requireSync(sModuleName); // legacy-relevant: Sync path
|
|
1458
|
+
|
|
1459
|
+
// check for legacy code
|
|
1460
|
+
if (!aLibs[index].isSettingsEnhanced()) {
|
|
1461
|
+
Log.warning("library " + aLibs[index].name + " didn't initialize itself");
|
|
1462
|
+
Library.create(aLibs[index].name); // TODO redundant to generated initLibrary call....
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
return aLibs;
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Registers the given Element class to the library to which it belongs.
|
|
1473
|
+
*
|
|
1474
|
+
* @param {sap.ui.core.ElementMetadata} oElementMetadata the metadata of the Element class
|
|
1475
|
+
* @private
|
|
1476
|
+
*/
|
|
1477
|
+
Library._registerElement = function(oElementMetadata) {
|
|
1478
|
+
var sElementName = oElementMetadata.getName(),
|
|
1479
|
+
sLibraryName = oElementMetadata.getLibraryName() || "",
|
|
1480
|
+
oLibrary = Library.get(sLibraryName),
|
|
1481
|
+
sCategory = oElementMetadata.isA("sap.ui.core.Control") ? 'controls' : 'elements';
|
|
1482
|
+
|
|
1483
|
+
// if library has not been loaded yet, create a library
|
|
1484
|
+
if (!oLibrary) {
|
|
1485
|
+
// ensure namespace
|
|
1486
|
+
ObjectPath.create(sLibraryName);
|
|
1487
|
+
oLibrary = Library._get(sLibraryName, true /* bCreate */);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
if (oLibrary[sCategory].indexOf(sElementName) < 0) {
|
|
1491
|
+
// add class to corresponding category in library ('elements' or 'controls')
|
|
1492
|
+
oLibrary[sCategory].push(sElementName);
|
|
1493
|
+
|
|
1494
|
+
Log.debug("Class " + sElementName + " registered for library " + sLibraryName);
|
|
1495
|
+
Library.fireLibraryChanged({name: sElementName, stereotype: oElementMetadata.getStereotype(), operation: "add", metadata : oElementMetadata});
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1499
|
+
var _oEventProvider = new EventProvider();
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* Fired when the set of controls, elements etc. for a library has changed or when the set of libraries has changed.
|
|
1503
|
+
*
|
|
1504
|
+
* Note: while the parameters of this event could already describe <i>any</i> type of change, the set of reported
|
|
1505
|
+
* changes is currently restricted to the addition of libraries, controls and elements. Future implementations might
|
|
1506
|
+
* extend the set of reported changes. Therefore applications should already check the operation and stereotype
|
|
1507
|
+
* parameters.
|
|
1508
|
+
*
|
|
1509
|
+
* @name sap.ui.core.Lib#libraryChanged
|
|
1510
|
+
* @event
|
|
1511
|
+
* @private
|
|
1512
|
+
* @ui5-restricted sap.ui.core, sap.ui.fl, sap.ui.support
|
|
1513
|
+
* @param {sap.ui.base.Event} oEvent
|
|
1514
|
+
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
1515
|
+
* @param {object} oEvent.getParameters
|
|
1516
|
+
* @param {string} oEvent.getParameters.name name of the newly added entity
|
|
1517
|
+
* @param {string} [oEvent.getParameters.stereotype] stereotype of the newly added entity type ("control", "element")
|
|
1518
|
+
* @param {string} [oEvent.getParameters.operation] type of operation ("add")
|
|
1519
|
+
* @param {sap.ui.base.Metadata|object} [oEvent.getParameters.metadata] metadata for the added entity type.
|
|
1520
|
+
* Either an instance of sap.ui.core.ElementMetadata if it is a Control or Element, or a library info object
|
|
1521
|
+
* if it is a library. Note that the API of all metadata objects is not public yet and might change.
|
|
1522
|
+
*/
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Register a listener for the {@link sap.ui.core.Lib#event:libraryChanged} event.
|
|
1526
|
+
*
|
|
1527
|
+
* @param {function} fnFunction Callback to be called when the <code>libraryChanged</code> event is fired
|
|
1528
|
+
* @param {object} [oListener] Optional context object to call the callback on
|
|
1529
|
+
*/
|
|
1530
|
+
Library.attachLibraryChanged = function(fnFunction, oListener) {
|
|
1531
|
+
_oEventProvider.attachEvent("LibraryChanged", fnFunction, oListener);
|
|
1532
|
+
};
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Unregister a listener from the {@link sap.ui.core.Lib#event:libraryChanged} event.
|
|
1536
|
+
*
|
|
1537
|
+
* @param {function} fnFunction function to unregister
|
|
1538
|
+
* @param {object} [oListener] context object given during registration
|
|
1539
|
+
*/
|
|
1540
|
+
Library.detachLibraryChanged = function(fnFunction, oListener) {
|
|
1541
|
+
_oEventProvider.detachEvent("LibraryChanged", fnFunction, oListener);
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
Library.fireLibraryChanged = function(oParams) {
|
|
1545
|
+
// notify registered Core listeners
|
|
1546
|
+
_oEventProvider.fireEvent("LibraryChanged", oParams);
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* Implementation of the ResourceBundle._enrichBundleConfig hook.
|
|
1551
|
+
* Guesses if the given bundleUrl is pointing to a library's ResourceBundle and adapts the given bundle definition accordingly
|
|
1552
|
+
* based on the inferred library's manifest.
|
|
1553
|
+
*
|
|
1554
|
+
* @param {module:sap/base/i18n/ResourceBundle.Configuration} mParams Map containing the arguments of the sap.base.i18n.ResourceBundle.create call
|
|
1555
|
+
* @returns {module:sap/base/i18n/ResourceBundle.Configuration} mParams The enriched config object
|
|
1556
|
+
* @private
|
|
1557
|
+
*/
|
|
1558
|
+
ResourceBundle._enrichBundleConfig = function (mParams) {
|
|
1559
|
+
if (!mParams.terminologies || !mParams.enhanceWith) {
|
|
1560
|
+
|
|
1561
|
+
var oLib = Library._getByBundleUrl(mParams.url);
|
|
1562
|
+
|
|
1563
|
+
if (oLib) {
|
|
1564
|
+
// look up i18n information in library manifest
|
|
1565
|
+
// (can be undefined if the lib defines "sap.ui5/library/i18n" with <false>)
|
|
1566
|
+
var vI18n = oLib._getI18nSettings();
|
|
1567
|
+
|
|
1568
|
+
// enrich i18n information
|
|
1569
|
+
if (vI18n) {
|
|
1570
|
+
// resolve bundleUrls relative to library path
|
|
1571
|
+
var sLibraryPath = oLib.name.replace(/\./g, "/");
|
|
1572
|
+
sLibraryPath = sLibraryPath.endsWith("/") ? sLibraryPath : sLibraryPath + "/"; // add trailing slash if missing
|
|
1573
|
+
sLibraryPath = sap.ui.require.toUrl(sLibraryPath);
|
|
1574
|
+
|
|
1575
|
+
_UrlResolver._processResourceConfiguration(vI18n, {
|
|
1576
|
+
alreadyResolvedOnRoot: true,
|
|
1577
|
+
relativeTo: sLibraryPath
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
// basic i18n information
|
|
1581
|
+
mParams.fallbackLocale = mParams.fallbackLocale || vI18n.fallbackLocale;
|
|
1582
|
+
mParams.supportedLocales = mParams.supportedLocales || vI18n.supportedLocales;
|
|
1583
|
+
|
|
1584
|
+
// text verticalization information
|
|
1585
|
+
mParams.terminologies = mParams.terminologies || vI18n.terminologies;
|
|
1586
|
+
mParams.enhanceWith = mParams.enhanceWith || vI18n.enhanceWith;
|
|
1587
|
+
mParams.activeTerminologies = mParams.activeTerminologies || Configuration.getActiveTerminologies();
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
return mParams;
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
return Library;
|
|
1595
|
+
});
|