@openui5/sap.ui.core 1.107.0 → 1.108.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.
Files changed (287) hide show
  1. package/.dtsgenrc +63 -0
  2. package/THIRDPARTY.txt +1 -1
  3. package/package.json +1 -1
  4. package/src/jquery.sap.global.js +1 -1
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  9. package/src/sap/base/i18n/ResourceBundle.js +10 -0
  10. package/src/sap/base/security/URLListValidator.js +36 -3
  11. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  12. package/src/sap/base/util/restricted/_castArray.js +1 -1
  13. package/src/sap/base/util/restricted/_compact.js +1 -1
  14. package/src/sap/base/util/restricted/_curry.js +1 -1
  15. package/src/sap/base/util/restricted/_debounce.js +1 -1
  16. package/src/sap/base/util/restricted/_difference.js +1 -1
  17. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  18. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  19. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  20. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  21. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  22. package/src/sap/base/util/restricted/_flatten.js +1 -1
  23. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_intersection.js +1 -1
  26. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  27. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  28. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  29. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  30. package/src/sap/base/util/restricted/_isNil.js +1 -1
  31. package/src/sap/base/util/restricted/_max.js +1 -1
  32. package/src/sap/base/util/restricted/_merge.js +1 -1
  33. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  34. package/src/sap/base/util/restricted/_min.js +1 -1
  35. package/src/sap/base/util/restricted/_omit.js +1 -1
  36. package/src/sap/base/util/restricted/_pick.js +1 -1
  37. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  38. package/src/sap/base/util/restricted/_throttle.js +1 -1
  39. package/src/sap/base/util/restricted/_toArray.js +1 -1
  40. package/src/sap/base/util/restricted/_union.js +1 -1
  41. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  42. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  43. package/src/sap/base/util/restricted/_uniq.js +1 -1
  44. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  45. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  46. package/src/sap/base/util/restricted/_without.js +1 -1
  47. package/src/sap/base/util/restricted/_xor.js +1 -1
  48. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  49. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  50. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  51. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  52. package/src/sap/ui/Device.js +3 -3
  53. package/src/sap/ui/Global.js +4 -4
  54. package/src/sap/ui/base/Event.js +1 -1
  55. package/src/sap/ui/base/EventProvider.js +1 -1
  56. package/src/sap/ui/base/Interface.js +1 -1
  57. package/src/sap/ui/base/ManagedObject.js +2 -2
  58. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  59. package/src/sap/ui/base/Metadata.js +1 -1
  60. package/src/sap/ui/base/Object.js +1 -1
  61. package/src/sap/ui/base/ObjectPool.js +1 -1
  62. package/src/sap/ui/core/.library +50 -50
  63. package/src/sap/ui/core/BusyIndicator.js +1 -1
  64. package/src/sap/ui/core/BusyIndicatorUtils.js +22 -8
  65. package/src/sap/ui/core/Component.js +21 -4
  66. package/src/sap/ui/core/ComponentContainer.js +5 -1
  67. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  68. package/src/sap/ui/core/ComponentSupport.js +1 -1
  69. package/src/sap/ui/core/Configuration.js +2 -15
  70. package/src/sap/ui/core/Control.js +20 -2
  71. package/src/sap/ui/core/Core.js +311 -413
  72. package/src/sap/ui/core/CustomData.js +1 -1
  73. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  74. package/src/sap/ui/core/Element.js +1 -1
  75. package/src/sap/ui/core/ElementMetadata.js +1 -1
  76. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  77. package/src/sap/ui/core/EventBus.js +1 -1
  78. package/src/sap/ui/core/FocusHandler.js +12 -14
  79. package/src/sap/ui/core/Fragment.js +5 -2
  80. package/src/sap/ui/core/HTML.js +1 -1
  81. package/src/sap/ui/core/History.js +1 -1
  82. package/src/sap/ui/core/Icon.js +1 -1
  83. package/src/sap/ui/core/IconPool.js +7 -1
  84. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  85. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  86. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  87. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  88. package/src/sap/ui/core/InvisibleText.js +1 -1
  89. package/src/sap/ui/core/Item.js +1 -1
  90. package/src/sap/ui/core/LabelEnablement.js +1 -1
  91. package/src/sap/ui/core/LayoutData.js +1 -1
  92. package/src/sap/ui/core/ListItem.js +1 -1
  93. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  94. package/src/sap/ui/core/Locale.js +1 -1
  95. package/src/sap/ui/core/LocaleData.js +1 -1
  96. package/src/sap/ui/core/Manifest.js +16 -83
  97. package/src/sap/ui/core/Message.js +1 -1
  98. package/src/sap/ui/core/Popup.js +14 -4
  99. package/src/sap/ui/core/RenderManager.js +111 -109
  100. package/src/sap/ui/core/Renderer.js +1 -1
  101. package/src/sap/ui/core/ResizeHandler.js +1 -1
  102. package/src/sap/ui/core/ScrollBar.js +1 -1
  103. package/src/sap/ui/core/SeparatorItem.js +1 -1
  104. package/src/sap/ui/core/ShortcutHintsMixin.js +20 -0
  105. package/src/sap/ui/core/Title.js +1 -1
  106. package/src/sap/ui/core/TooltipBase.js +1 -1
  107. package/src/sap/ui/core/UIArea.js +4 -2
  108. package/src/sap/ui/core/UIComponent.js +1 -1
  109. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  110. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  111. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  112. package/src/sap/ui/core/XMLComposite.js +1 -1
  113. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  114. package/src/sap/ui/core/_IconRegistry.js +11 -7
  115. package/src/sap/ui/core/_UrlResolver.js +139 -0
  116. package/src/sap/ui/core/date/CalendarUtils.js +87 -0
  117. package/src/sap/ui/core/date/CalendarWeekNumbering.js +73 -0
  118. package/src/sap/ui/core/date/UniversalDate.js +198 -74
  119. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  120. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  121. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  122. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  123. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  124. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  125. package/src/sap/ui/core/format/DateFormat.js +187 -57
  126. package/src/sap/ui/core/format/NumberFormat.js +64 -23
  127. package/src/sap/ui/core/format/TimezoneUtil.js +3 -1
  128. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  129. package/src/sap/ui/core/library.js +19 -10
  130. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  131. package/src/sap/ui/core/message/Message.js +5 -3
  132. package/src/sap/ui/core/message/MessageManager.js +1 -1
  133. package/src/sap/ui/core/message/MessageParser.js +1 -1
  134. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  135. package/src/sap/ui/core/messagebundle_fr.properties +1 -1
  136. package/src/sap/ui/core/mvc/HTMLView.js +10 -2
  137. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  138. package/src/sap/ui/core/mvc/JSView.js +1 -1
  139. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  140. package/src/sap/ui/core/mvc/View.js +1 -1
  141. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  142. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  143. package/src/sap/ui/core/plugin/LessSupport.js +21 -20
  144. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  145. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  146. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  147. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  148. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  149. package/src/sap/ui/core/service/Service.js +1 -1
  150. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  151. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  152. package/src/sap/ui/core/support/Plugin.js +1 -1
  153. package/src/sap/ui/core/support/Support.js +1 -1
  154. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  156. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  158. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  159. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  160. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  161. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  162. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +3 -3
  163. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  164. package/src/sap/ui/core/theming/Parameters.js +31 -12
  165. package/src/sap/ui/core/theming/ThemeHelper.js +56 -1
  166. package/src/sap/ui/core/theming/ThemeManager.js +817 -0
  167. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  168. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  169. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  170. package/src/sap/ui/core/tmpl/Template.js +1 -1
  171. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  172. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  173. package/src/sap/ui/core/util/Export.js +1 -1
  174. package/src/sap/ui/core/util/ExportCell.js +1 -1
  175. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  176. package/src/sap/ui/core/util/ExportRow.js +1 -1
  177. package/src/sap/ui/core/util/ExportType.js +1 -1
  178. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  179. package/src/sap/ui/core/util/File.js +1 -1
  180. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  181. package/src/sap/ui/core/util/MockServer.js +1 -1
  182. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  183. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +2 -1
  184. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  185. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  186. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  187. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  188. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  189. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  190. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  191. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  192. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  193. package/src/sap/ui/debug/ControlTree.js +1 -1
  194. package/src/sap/ui/debug/DebugEnv.js +1 -1
  195. package/src/sap/ui/debug/PropertyList.js +1 -1
  196. package/src/sap/ui/dom/getFirstEditableInput.js +25 -6
  197. package/src/sap/ui/dom/includeStylesheet.js +2 -2
  198. package/src/sap/ui/model/ClientListBinding.js +11 -4
  199. package/src/sap/ui/model/ClientModel.js +1 -1
  200. package/src/sap/ui/model/ClientTreeBinding.js +60 -5
  201. package/src/sap/ui/model/CompositeDataState.js +1 -1
  202. package/src/sap/ui/model/CompositeType.js +1 -1
  203. package/src/sap/ui/model/DataState.js +1 -1
  204. package/src/sap/ui/model/Filter.js +6 -6
  205. package/src/sap/ui/model/MetaModel.js +1 -1
  206. package/src/sap/ui/model/Model.js +1 -1
  207. package/src/sap/ui/model/SelectionModel.js +1 -1
  208. package/src/sap/ui/model/SimpleType.js +1 -1
  209. package/src/sap/ui/model/Sorter.js +6 -4
  210. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  211. package/src/sap/ui/model/TreeBinding.js +18 -0
  212. package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +1 -1
  213. package/src/sap/ui/model/Type.js +1 -1
  214. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +28 -34
  215. package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +590 -0
  216. package/src/sap/ui/model/json/JSONModel.js +1 -1
  217. package/src/sap/ui/model/message/MessageModel.js +1 -1
  218. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  219. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  220. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  221. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  222. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  223. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  224. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  225. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  226. package/src/sap/ui/model/odata/type/Date.js +1 -1
  227. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  228. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  229. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  230. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  231. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  232. package/src/sap/ui/model/odata/type/Double.js +1 -1
  233. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  234. package/src/sap/ui/model/odata/type/Int.js +1 -1
  235. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  236. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  237. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  238. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  239. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  240. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  241. package/src/sap/ui/model/odata/type/Single.js +1 -1
  242. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  243. package/src/sap/ui/model/odata/type/String.js +1 -1
  244. package/src/sap/ui/model/odata/type/Time.js +1 -1
  245. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  246. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  247. package/src/sap/ui/model/odata/v2/BatchMode.js +2 -2
  248. package/src/sap/ui/model/odata/v2/Context.js +169 -4
  249. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  250. package/src/sap/ui/model/odata/v2/ODataListBinding.js +39 -17
  251. package/src/sap/ui/model/odata/v2/ODataModel.js +219 -82
  252. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  253. package/src/sap/ui/model/odata/v4/Context.js +35 -22
  254. package/src/sap/ui/model/odata/v4/ODataBinding.js +28 -22
  255. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +6 -6
  256. package/src/sap/ui/model/odata/v4/ODataListBinding.js +111 -89
  257. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +5 -4
  258. package/src/sap/ui/model/odata/v4/ODataModel.js +84 -46
  259. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +19 -20
  260. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
  261. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
  262. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +12 -5
  263. package/src/sap/ui/model/odata/v4/lib/_Cache.js +130 -64
  264. package/src/sap/ui/model/odata/v4/lib/_Helper.js +1 -1
  265. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +56 -15
  266. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  267. package/src/sap/ui/model/type/Boolean.js +1 -1
  268. package/src/sap/ui/model/type/Currency.js +1 -1
  269. package/src/sap/ui/model/type/Date.js +1 -1
  270. package/src/sap/ui/model/type/DateInterval.js +1 -1
  271. package/src/sap/ui/model/type/DateTime.js +1 -1
  272. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  273. package/src/sap/ui/model/type/FileSize.js +1 -1
  274. package/src/sap/ui/model/type/Float.js +1 -1
  275. package/src/sap/ui/model/type/Integer.js +1 -1
  276. package/src/sap/ui/model/type/String.js +1 -1
  277. package/src/sap/ui/model/type/Time.js +1 -1
  278. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  279. package/src/sap/ui/model/type/Unit.js +1 -1
  280. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  281. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  282. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  283. package/src/sap/ui/test/TestUtils.js +20 -0
  284. package/src/sap/ui/test/generic/TestBase.js +1 -1
  285. package/src/sap/ui/thirdparty/mobify-carousel.js +0 -4
  286. package/src/sap/ui/util/Storage.js +1 -1
  287. package/src/sap/ui/core/ThemeCheck.js +0 -389
@@ -20,25 +20,25 @@ sap.ui.define([
20
20
  './ElementMetadata',
21
21
  './Rendering',
22
22
  './RenderManager',
23
- './ThemeCheck',
24
23
  './UIArea',
25
24
  './message/MessageManager',
26
- "sap/ui/util/ActivityDetection",
27
25
  "sap/base/i18n/ResourceBundle",
28
26
  "sap/base/Log",
29
27
  "sap/ui/performance/Measurement",
30
28
  "sap/ui/security/FrameOptions",
31
29
  "sap/base/assert",
32
- "sap/ui/dom/includeStylesheet",
33
30
  "sap/base/util/ObjectPath",
34
31
  "sap/base/util/Version",
35
32
  "sap/base/util/array/uniqueSort",
36
33
  'sap/ui/performance/trace/initTraces',
37
34
  'sap/base/util/LoaderExtensions',
38
35
  'sap/base/util/isEmptyObject',
36
+ 'sap/base/util/deepExtend',
39
37
  'sap/base/util/each',
40
38
  'sap/base/util/mixedFetch',
39
+ './_UrlResolver',
41
40
  'sap/ui/VersionInfo',
41
+ 'sap/ui/thirdparty/URI',
42
42
  'sap/ui/events/jquery/EventSimulation'
43
43
  ],
44
44
  function(
@@ -56,25 +56,25 @@ sap.ui.define([
56
56
  ElementMetadata,
57
57
  Rendering,
58
58
  RenderManager,
59
- ThemeCheck,
60
59
  UIArea,
61
60
  MessageManager,
62
- ActivityDetection,
63
61
  ResourceBundle,
64
62
  Log,
65
63
  Measurement,
66
64
  FrameOptions,
67
65
  assert,
68
- includeStylesheet,
69
66
  ObjectPath,
70
67
  Version,
71
68
  uniqueSort,
72
69
  initTraces,
73
70
  LoaderExtensions,
74
71
  isEmptyObject,
72
+ deepExtend,
75
73
  each,
76
74
  mixedFetch,
77
- VersionInfo
75
+ _UrlResolver,
76
+ VersionInfo,
77
+ URI
78
78
  /* ,EventSimulation */
79
79
  ) {
80
80
 
@@ -90,6 +90,11 @@ sap.ui.define([
90
90
  */
91
91
  var FocusHandler;
92
92
 
93
+ /**
94
+ * ThemeManager module reference, lazily retrieved via private "_getThemeManager" API.
95
+ */
96
+ var ThemeManager;
97
+
93
98
  // Initialize SAP Passport or FESR
94
99
  initTraces();
95
100
 
@@ -101,6 +106,25 @@ sap.ui.define([
101
106
  */
102
107
  var mLoadedLibraries = {};
103
108
 
109
+ /**
110
+ * Bookkeeping for the guessing of library names.
111
+ *
112
+ * Set of bundleUrls from which a library name has been derived or not, see #getLibraryNameForBundle
113
+ * If no library name can be derived, the result will also be tracked with 'false' as value.
114
+ *
115
+ * Example:
116
+ * mGuessedLibraries = {
117
+ * "my/simple/library/i18n/i18n.properties": "my.simple.library",
118
+ * "no/library/i18n/i18n.properties": false
119
+ * }
120
+ */
121
+ var mGuessedLibraries = {};
122
+
123
+ /**
124
+ * Sequence of libraries which require CSS.
125
+ */
126
+ var aAllLibrariesRequiringCss = [];
127
+
104
128
  /**
105
129
  * Bookkeeping for the preloading of libraries.
106
130
  *
@@ -202,7 +226,7 @@ sap.ui.define([
202
226
  * @extends sap.ui.base.Object
203
227
  * @final
204
228
  * @author SAP SE
205
- * @version 1.107.0
229
+ * @version 1.108.0
206
230
  * @alias sap.ui.core.Core
207
231
  * @public
208
232
  * @hideconstructor
@@ -372,9 +396,11 @@ sap.ui.define([
372
396
  }
373
397
  });
374
398
 
375
- Log.info("Declared modules: " + aModules, METHOD);
399
+ // adding the following classList is done here for compatibility reasons
400
+ document.documentElement.classList.add("sapUiTheme-" + Configuration.getTheme());
401
+ Log.info("Declared theme " + Configuration.getTheme(), null, METHOD);
376
402
 
377
- this._setupThemes();
403
+ Log.info("Declared modules: " + aModules, METHOD);
378
404
 
379
405
  this._setupContentDirection();
380
406
 
@@ -597,6 +623,7 @@ sap.ui.define([
597
623
  "applyTheme","setThemeRoot","attachThemeChanged","detachThemeChanged",
598
624
  "isThemeApplied",
599
625
  "notifyContentDensityChanged",
626
+ "getAllLibrariesRequiringCss",
600
627
  // - Control & App dev.
601
628
  "getCurrentFocusedControlId",
602
629
  "isMobile",
@@ -675,38 +702,6 @@ sap.ui.define([
675
702
  };
676
703
  };
677
704
 
678
- /**
679
- * Initializes the window "sap-ui-config" property, sets theme roots, initializes sTheme, sets theme CSS classes
680
- * @private
681
- */
682
- Core.prototype._setupThemes = function() {
683
- var METHOD = "sap.ui.core.Core";
684
-
685
- // read themeRoots configuration
686
- var themeRoots = Configuration.getValue("themeRoots");
687
- if (themeRoots) {
688
- for (var themeName in themeRoots) {
689
- var themeRoot = themeRoots[themeName];
690
- if (typeof themeRoot === "string") {
691
- this.setThemeRoot(themeName, themeRoot);
692
- } else {
693
- for (var lib in themeRoot) {
694
- if (lib.length > 0) {
695
- this.setThemeRoot(themeName, [lib], themeRoot[lib]);
696
- } else {
697
- this.setThemeRoot(themeName, themeRoot[lib]);
698
- }
699
- }
700
- }
701
- }
702
- }
703
-
704
- // set CSS class for the theme name
705
- this.sTheme = Configuration.getTheme();
706
- document.documentElement.classList.add("sapUiTheme-" + this.sTheme);
707
- Log.info("Declared theme " + this.sTheme,null,METHOD);
708
- };
709
-
710
705
  /**
711
706
  * Set the document's dir property
712
707
  * @private
@@ -829,13 +824,6 @@ sap.ui.define([
829
824
  * @private
830
825
  */
831
826
  Core.prototype._boot = function(bAsync, fnCallback) {
832
-
833
- // if a list of preloaded library CSS is configured, request a merged CSS (if application did not already do it)
834
- var aCSSLibs = Configuration.getValue("preloadLibCss");
835
- if (aCSSLibs && aCSSLibs.length > 0 && !Configuration.getCssAppManaged()) {
836
- this.includeLibraryTheme("sap-ui-merged", undefined, "?l=" + aCSSLibs.join(","));
837
- }
838
-
839
827
  // add CalendarClass to list of modules
840
828
  this.aModules.push("sap/ui/core/date/" + Configuration.getCalendarType());
841
829
 
@@ -921,137 +909,18 @@ sap.ui.define([
921
909
 
922
910
  sThemeName = Configuration.normalizeTheme(sThemeName, sThemeBaseUrl);
923
911
 
924
- if (sThemeBaseUrl) {
925
- this.setThemeRoot(sThemeName, sThemeBaseUrl);
926
- }
927
-
928
- // only apply the theme if it is different from the active one
929
- if (sThemeName && this.sTheme != sThemeName) {
930
- var sCurrentTheme = this.sTheme;
931
- var html = document.documentElement;
932
- this._updateThemeUrls(sThemeName, /* bSuppressFOUC */ true);
933
- this.sTheme = sThemeName;
912
+ // Configuration needs to be updated synchronously but only
913
+ // applyTheme in case theme changed
914
+ // Check is duplicated in applyTheme in ThemeManager
915
+ // be aware to keep both in sync
916
+ if ((sThemeName && Configuration.getTheme() != sThemeName)) {
934
917
  Configuration.setTheme(sThemeName);
935
-
936
- // modify the <html> tag's CSS class with the theme name
937
- html.classList.remove("sapUiTheme-" + sCurrentTheme);
938
- html.classList.add("sapUiTheme-" + sThemeName);
939
-
940
- // notify the listeners
941
- if ( this.oThemeCheck ) {
942
- this.oThemeCheck.fireThemeChangedEvent(false);
943
- }
944
- }
945
- };
946
-
947
- // this function is also used by "sap.ui.core.ThemeCheck" to load a fallback theme for a single library
948
- Core.prototype._updateThemeUrl = function(oLink, sThemeName, bSuppressFOUC) {
949
- var sLibName,
950
- iQueryIndex = oLink.href.search(/[?#]/),
951
- sLibFileName,
952
- sQuery,
953
- sStandardLibFilePrefix = "library",
954
- sRTL = Configuration.getRTL() ? "-RTL" : "",
955
- sHref,
956
- pos;
957
-
958
- // derive lib name from id via regex
959
- var mLinkId = /^sap-ui-theme(?:skeleton)?-(.*)$/i.exec(oLink.id);
960
- if (Array.isArray(mLinkId)) {
961
- sLibName = mLinkId[1];
962
- } else {
963
- // fallback to legacy logic
964
- sLibName = oLink.id.slice(13); // length of "sap-ui-theme-"
965
- }
966
-
967
- if (iQueryIndex > -1) {
968
- // Split href on query and/or fragment to check for the standard lib file prefix
969
- sLibFileName = oLink.href.substring(0, iQueryIndex);
970
- sQuery = oLink.href.substring(iQueryIndex);
971
- } else {
972
- sLibFileName = oLink.href;
973
- sQuery = "";
974
- }
975
-
976
- // Get basename of stylesheet (e.g. "library.css")
977
- sLibFileName = sLibFileName.substring(sLibFileName.lastIndexOf("/") + 1);
978
-
979
- // handle 'variants'
980
- if ((pos = sLibName.indexOf("-[")) > 0) { // assumes that "-[" does not occur as part of a library name
981
- sStandardLibFilePrefix += sLibName.slice(pos + 2, -1); // 2=length of "-]"
982
- sLibName = sLibName.slice(0, pos);
983
- }
984
-
985
- // try to distinguish "our" library css from custom css included with the ':' notation in includeLibraryTheme
986
- if ( sLibFileName === (sStandardLibFilePrefix + ".css") || sLibFileName === (sStandardLibFilePrefix + "-RTL.css") ) {
987
- sLibFileName = sStandardLibFilePrefix + sRTL + ".css";
988
- }
989
-
990
- sHref = this._getThemePath(sLibName, sThemeName) + sLibFileName + sQuery;
991
- if ( sHref != oLink.href ) {
992
- // sap/ui/dom/includeStylesheet has a special FOUC handling
993
- // which is activated once the attribute data-sap-ui-foucmarker is
994
- // present on the link to be replaced (usage of the Promise
995
- // API is not sufficient as it will change the sync behavior)
996
- if (bSuppressFOUC) {
997
- oLink.dataset.sapUiFoucmarker = oLink.id;
998
- }
999
- // Replace the current <link> tag with a new one.
1000
- // Changing "oLink.href" would also trigger loading the new stylesheet but
1001
- // the load/error handlers would not get called which causes issues with the ThemeCheck
1002
- // as the "data-sap-ui-ready" attribute won't be set.
1003
- includeStylesheet(sHref, oLink.id);
1004
- }
1005
- };
1006
-
1007
- // modify style sheet URLs to point to the given theme, using the current RTL mode
1008
- Core.prototype._updateThemeUrls = function(sThemeName, bSuppressFOUC) {
1009
- // select "our" stylesheets
1010
- var oQueryResult = document.querySelectorAll("link[id^=sap-ui-theme-],link[id^=sap-ui-themeskeleton-]");
1011
-
1012
- Array.prototype.forEach.call(oQueryResult, function(oHTMLElement) {
1013
- this._updateThemeUrl(oHTMLElement, sThemeName, bSuppressFOUC);
1014
- }.bind(this));
1015
-
1016
- };
1017
-
1018
- /**
1019
- * Makes sure to register the correct module path for the given library and theme
1020
- * in case a themeRoot has been defined.
1021
- *
1022
- * @param {string} sLibName Library name (dot separated)
1023
- * @param {string} sThemeName Theme name
1024
- * @private
1025
- */
1026
- Core.prototype._ensureThemeRoot = function(sLibName, sThemeName) {
1027
- if (this._mThemeRoots) {
1028
- var path = this._mThemeRoots[sThemeName + " " + sLibName] || this._mThemeRoots[sThemeName];
1029
- // check whether for this combination (theme+lib) a URL is registered or for this theme a default location is registered
1030
- if (path) {
1031
- path = path + sLibName.replace(/\./g, "/") + "/themes/" + sThemeName + "/";
1032
- registerModulePath(sLibName + ".themes." + sThemeName, path);
1033
- }
918
+ this._getThemeManager().then(function(ThemeManager) {
919
+ ThemeManager.applyTheme(sThemeName, sThemeBaseUrl, /* bForce = */ true);
920
+ });
1034
921
  }
1035
922
  };
1036
923
 
1037
- /**
1038
- * Returns the URL of the folder in which the CSS file for the given theme and the given library is located.
1039
- *
1040
- * @param {string} sLibName Library name (dot separated)
1041
- * @param {string} sThemeName Theme name
1042
- * @returns {string} module path URL (ends with a slash)
1043
- * @private
1044
- */
1045
- Core.prototype._getThemePath = function(sLibName, sThemeName) {
1046
-
1047
- // make sure to register correct theme module path in case themeRoots are defined
1048
- this._ensureThemeRoot(sLibName, sThemeName);
1049
-
1050
- // use the library location as theme location
1051
- return getModulePath(sLibName + ".themes." + sThemeName, "/");
1052
- };
1053
-
1054
-
1055
924
  /**
1056
925
  * Defines the root directory from below which UI5 should load the theme with the given name.
1057
926
  * Optionally allows restricting the setting to parts of a theme covering specific control libraries.
@@ -1101,38 +970,9 @@ sap.ui.define([
1101
970
  * @public
1102
971
  */
1103
972
  Core.prototype.setThemeRoot = function(sThemeName, aLibraryNames, sThemeBaseUrl, bForceUpdate) {
1104
- assert(typeof sThemeName === "string", "sThemeName must be a string");
1105
- assert((Array.isArray(aLibraryNames) && typeof sThemeBaseUrl === "string") || (typeof aLibraryNames === "string" && sThemeBaseUrl === undefined), "either the second parameter must be a string (and the third is undefined), or it must be an array and the third parameter is a string");
1106
-
1107
- if (!this._mThemeRoots) {
1108
- this._mThemeRoots = {};
1109
- }
1110
-
1111
- // normalize parameters
1112
- if (typeof aLibraryNames === "string") {
1113
- bForceUpdate = sThemeBaseUrl;
1114
- sThemeBaseUrl = aLibraryNames;
1115
- aLibraryNames = undefined;
1116
- }
1117
- sThemeBaseUrl = sThemeBaseUrl + (sThemeBaseUrl.slice( -1) == "/" ? "" : "/");
1118
-
1119
- if (aLibraryNames) {
1120
- // registration of URL for several libraries
1121
- for (var i = 0; i < aLibraryNames.length; i++) {
1122
- var lib = aLibraryNames[i];
1123
- this._mThemeRoots[sThemeName + " " + lib] = sThemeBaseUrl;
1124
- }
1125
-
1126
- } else {
1127
- // registration of theme default base URL
1128
- this._mThemeRoots[sThemeName] = sThemeBaseUrl;
1129
- }
1130
-
1131
- // Update theme urls when theme roots of currently loaded theme have changed
1132
- if (bForceUpdate && sThemeName === this.sTheme) {
1133
- this._updateThemeUrls(this.sTheme);
1134
- }
1135
-
973
+ this._getThemeManager().then(function(ThemeManager) {
974
+ ThemeManager.setThemeRoot(sThemeName, aLibraryNames, sThemeBaseUrl, bForceUpdate);
975
+ });
1136
976
  return this;
1137
977
  };
1138
978
 
@@ -1154,44 +994,34 @@ sap.ui.define([
1154
994
 
1155
995
  Log.info("Initializing",null,METHOD);
1156
996
 
1157
- this.oThemeCheck = new ThemeCheck(this);
1158
-
1159
- Log.info("Initialized",null,METHOD);
1160
997
  Measurement.end("coreInit");
1161
998
 
1162
- // start the plugins
1163
- Log.info("Starting Plugins",null,METHOD);
1164
- this.startPlugins();
1165
- Log.info("Plugins started",null,METHOD);
1166
-
1167
999
  this._setBodyAccessibilityRole();
1168
1000
 
1169
- this.oThemeCheck.fireThemeChangedEvent(true);
1001
+ var sWaitForTheme = Configuration.getValue('xx-waitForTheme');
1170
1002
 
1171
- var sWaitForTheme = Configuration.getValue("xx-waitForTheme");
1172
- if ( this.isThemeApplied() || !sWaitForTheme ) {
1003
+ // If there is no waitForTheme or ThemeManager is already available and theme is loaded render directly sync
1004
+ if (this.isThemeApplied() || !sWaitForTheme) {
1173
1005
  this._executeInitialization();
1174
1006
  Rendering.renderPendingUIUpdates("during Core init"); // directly render without setTimeout, so rendering is guaranteed to be finished when init() ends
1175
- Measurement.end("coreComplete");
1176
-
1177
- } else if (sWaitForTheme === "rendering") {
1178
- Rendering.notifyInteractionStep();
1179
- this._executeInitialization();
1180
- Rendering.getLogger().debug("delay initial rendering until theme has been loaded");
1181
- _oEventProvider.attachEventOnce(Core.M_EVENTS.ThemeChanged, function() {
1182
- Rendering.renderPendingUIUpdates("after theme has been loaded", 0);
1183
- }, this);
1184
- Measurement.end("coreComplete");
1185
-
1186
- } else if (sWaitForTheme === "init") {
1187
- Rendering.getLogger().debug("delay init event and initial rendering until theme has been loaded");
1188
- Rendering.notifyInteractionStep();
1189
- _oEventProvider.attachEventOnce(Core.M_EVENTS.ThemeChanged, function() {
1007
+ } else {
1008
+ if (sWaitForTheme === "rendering") {
1009
+ Rendering.notifyInteractionStep();
1190
1010
  this._executeInitialization();
1191
- Rendering.renderPendingUIUpdates("after theme has been loaded", 0);
1192
- Measurement.end("coreComplete");
1193
- }, this);
1194
-
1011
+ Rendering.getLogger().debug("delay initial rendering until theme has been loaded");
1012
+ _oEventProvider.attachEventOnce(Core.M_EVENTS.ThemeChanged, function() {
1013
+ Rendering.renderPendingUIUpdates("after theme has been loaded", 0);
1014
+ }, this);
1015
+ } else if (sWaitForTheme === "init") {
1016
+ Rendering.getLogger().debug("delay init event and initial rendering until theme has been loaded");
1017
+ Rendering.notifyInteractionStep();
1018
+ _oEventProvider.attachEventOnce(Core.M_EVENTS.ThemeChanged, function() {
1019
+ this._executeInitialization();
1020
+ Rendering.renderPendingUIUpdates("after theme has been loaded", 0);
1021
+ }, this);
1022
+ }
1023
+ // Require ThemeManager if not already done to ensure ThemeManager is available and ThemeChanged event will be fired
1024
+ this._getThemeManager();
1195
1025
  }
1196
1026
  };
1197
1027
 
@@ -1320,10 +1150,19 @@ sap.ui.define([
1320
1150
  };
1321
1151
 
1322
1152
  Core.prototype._executeInitialization = function() {
1153
+ var METHOD = "sap.ui.core.Core.init()"; // Because it's only used from init
1323
1154
  if (this.bInitialized) {
1324
1155
  return;
1325
1156
  }
1326
1157
  this.bInitialized = true;
1158
+
1159
+ Log.info("Initialized",null,METHOD);
1160
+
1161
+ // start the plugins
1162
+ Log.info("Starting Plugins",null,METHOD);
1163
+ this.startPlugins();
1164
+ Log.info("Plugins started",null,METHOD);
1165
+
1327
1166
  this._executeOnInit();
1328
1167
  this._setupRootComponent(); // @legacy-relevant: private API for 2 deprecated concepts "rootComponent" & "sap.ui.app.Application"
1329
1168
  this._executeInitListeners();
@@ -1351,7 +1190,35 @@ sap.ui.define([
1351
1190
  * @public
1352
1191
  */
1353
1192
  Core.prototype.isThemeApplied = function () {
1354
- return ThemeCheck.themeLoaded;
1193
+ ThemeManager = ThemeManager || sap.ui.require("sap/ui/core/theming/ThemeManager");
1194
+ return ThemeManager ? ThemeManager.themeLoaded : false;
1195
+ };
1196
+
1197
+ Core.prototype._getThemeManager = function (bClear) {
1198
+ ThemeManager = ThemeManager || sap.ui.require("sap/ui/core/theming/ThemeManager");
1199
+ if (!this.pThemeManager) {
1200
+ if (!ThemeManager) {
1201
+ this.pThemeManager = new Promise(function (resolve, reject) {
1202
+ sap.ui.require(["sap/ui/core/theming/ThemeManager"], function (ThemeManager) {
1203
+ resolve(ThemeManager);
1204
+ }, reject);
1205
+ });
1206
+ } else {
1207
+ this.pThemeManager = Promise.resolve(ThemeManager);
1208
+ }
1209
+ this.pThemeManager = this.pThemeManager.then(function(ThemeManager) {
1210
+ ThemeManager.attachEvent("ThemeChanged", function(oEvent) {
1211
+ this.fireThemeChanged(oEvent.getParameters());
1212
+ }.bind(this));
1213
+ return ThemeManager;
1214
+ }.bind(this));
1215
+ }
1216
+ // This is only used within initLibrary to reset flag themeLoaded synchronously in case
1217
+ // a theme for a new library will be loaded
1218
+ if (ThemeManager && bClear) {
1219
+ ThemeManager.reset();
1220
+ }
1221
+ return this.pThemeManager;
1355
1222
  };
1356
1223
 
1357
1224
  /**
@@ -2355,25 +2222,14 @@ sap.ui.define([
2355
2222
 
2356
2223
  // include the library theme, but only if it has not been suppressed in library metadata or by configuration
2357
2224
  if ( !oLibInfo.noLibraryCSS) {
2358
-
2359
- // ensure to register correct library theme module path even when "preloadLibCss" prevents
2360
- // including the library theme as controls might use it to calculate theme-specific URLs
2361
- this._ensureThemeRoot(sLibName, this.sTheme);
2362
-
2363
- // also ensure correct theme root for the library's base theme which might be relevant in some cases
2364
- // (e.g. IconPool which includes font files from sap.ui.core base theme)
2365
- this._ensureThemeRoot(sLibName, "base");
2366
-
2367
- if (!Configuration.getValue("preloadLibCss").includes(sLibName)) {
2368
- // check for configured query parameters and use them
2369
- var sQuery = this._getLibraryCssQueryParams(oLibInfo);
2370
-
2371
- this.includeLibraryTheme(sLibName, undefined, sQuery);
2372
-
2373
- if (this.oThemeCheck && this.isInitialized()) {
2374
- this.oThemeCheck.fireThemeChangedEvent(false);
2375
- }
2376
- }
2225
+ var oLibThemingInfo = {
2226
+ name: oLibInfo.name,
2227
+ version: oLibInfo.version
2228
+ };
2229
+ aAllLibrariesRequiringCss.push(oLibThemingInfo);
2230
+ this._getThemeManager(true).then(function(ThemeManager) {
2231
+ ThemeManager._includeLibraryThemeAndEnsureThemeRoot(oLibThemingInfo);
2232
+ });
2377
2233
  }
2378
2234
 
2379
2235
  // expose some legacy names
@@ -2385,14 +2241,6 @@ sap.ui.define([
2385
2241
  return oLib;
2386
2242
  };
2387
2243
 
2388
- // helper to add the FOUC marker to the CSS for the given id
2389
- function fnAddFoucmarker(sLinkId) {
2390
- var oLink = document.getElementById(sLinkId);
2391
- if (oLink) {
2392
- oLink.dataset.sapUiFoucmarker = sLinkId;
2393
- }
2394
- }
2395
-
2396
2244
  /**
2397
2245
  * Includes a library theme into the current page (if a variant is specified it
2398
2246
  * will include the variant library theme)
@@ -2402,87 +2250,15 @@ sap.ui.define([
2402
2250
  * @public
2403
2251
  */
2404
2252
  Core.prototype.includeLibraryTheme = function(sLibName, sVariant, sQuery) {
2405
- assert(typeof sLibName === "string", "sLibName must be a string");
2406
- assert(sVariant === undefined || typeof sVariant === "string", "sVariant must be a string or undefined");
2407
-
2408
- /*
2409
- * by specifying a library name containing a colon (":") you can specify
2410
- * the file name of the CSS file to include (ignoring RTL)
2411
- */
2412
-
2413
- // include the stylesheet for the library (except for "classic" and "legacy" lib)
2414
- if ((sLibName != "sap.ui.legacy") && (sLibName != "sap.ui.classic")) {
2415
-
2416
- // no variant?
2417
- if (!sVariant) {
2418
- sVariant = "";
2419
- }
2420
-
2421
- // determine CSS Variables / RTL
2422
- var sCssVars = (/^(true|x)$/i.test(Configuration.getValue("xx-cssVariables")) ? "_skeleton" : "");
2423
- var sRtl = (Configuration.getRTL() ? "-RTL" : "");
2424
-
2425
- // create the library file name
2426
- var sLibFileName,
2427
- sLibId = sLibName + (sVariant.length > 0 ? "-[" + sVariant + "]" : sVariant);
2428
- if (sLibName && sLibName.indexOf(":") == -1) {
2429
- sLibFileName = "library" + sVariant + sCssVars + sRtl;
2430
- } else {
2431
- sLibFileName = sLibName.substring(sLibName.indexOf(":") + 1) + sVariant;
2432
- sLibName = sLibName.substring(0, sLibName.indexOf(":"));
2433
- }
2434
-
2435
- // use the special FOUC handling for initially existing stylesheets
2436
- // to ensure that they are not just replaced when using the
2437
- // includeStyleSheet API and to be removed later
2438
- var sLinkId = "sap-ui-theme-" + sLibId;
2439
- fnAddFoucmarker(sLinkId);
2440
-
2441
- // include the css variables
2442
- var cssPathAndName;
2443
- if (/^(true|x|additional)$/i.test(Configuration.getValue("xx-cssVariables"))) {
2444
- cssPathAndName = this._getThemePath(sLibName, this.sTheme) + "css_variables.css" + (sQuery ? sQuery : "");
2445
- Log.info("Including " + cssPathAndName + " - sap.ui.core.Core.includeLibraryTheme()");
2446
- includeStylesheet(cssPathAndName, sLinkId);
2447
- // include the skeleton css next to the css variables
2448
- sLinkId = "sap-ui-themeskeleton-" + sLibId;
2449
- fnAddFoucmarker(sLinkId);
2450
- }
2451
-
2452
- // log and include
2453
- cssPathAndName = this._getThemePath(sLibName, this.sTheme) + sLibFileName + ".css" + (sQuery ? sQuery : "");
2454
- Log.info("Including " + cssPathAndName + " - sap.ui.core.Core.includeLibraryTheme()");
2455
- includeStylesheet(cssPathAndName, sLinkId);
2456
-
2457
- // if parameters have been used, update them with the new style sheet
2458
- var Parameters = sap.ui.require("sap/ui/core/theming/Parameters");
2459
- if (Parameters) {
2460
- Parameters._addLibraryTheme(sLibId);
2461
- }
2462
- }
2463
-
2464
- };
2465
-
2466
- /**
2467
- * Returns a string containing query parameters for theme specific files.
2468
- *
2469
- * Used in Core#initLibrary and ThemeCheck#checkStyle.
2470
- *
2471
- * @param {object} oLibInfo Library info object (containing a "version" property)
2472
- * @returns {string|undefined} query parameters or undefined if "versionedLibCss" config is "false"
2473
- * @private
2474
- */
2475
- Core.prototype._getLibraryCssQueryParams = function(oLibInfo) {
2476
- var sQuery;
2477
- if (Configuration.getValue("versionedLibCss") && oLibInfo) {
2478
- sQuery = "?version=" + oLibInfo.version;
2479
-
2480
- // distribution version may not be available (will be loaded in Core constructor syncpoint2)
2481
- if (Global.versioninfo) {
2482
- sQuery += "&sap-ui-dist-version=" + Global.versioninfo.version;
2483
- }
2484
- }
2485
- return sQuery;
2253
+ var oLibInfo = this.getLoadedLibraries()[sLibName];
2254
+ aAllLibrariesRequiringCss.push({
2255
+ name: sLibName,
2256
+ version: oLibInfo && oLibInfo.version,
2257
+ variant: sVariant
2258
+ });
2259
+ this._getThemeManager().then(function(ThemeManager) {
2260
+ ThemeManager.includeLibraryTheme(sLibName, sVariant, sQuery);
2261
+ });
2486
2262
  };
2487
2263
 
2488
2264
  /**
@@ -2506,6 +2282,63 @@ sap.ui.define([
2506
2282
  return Object.assign({}, this.mLibraries);
2507
2283
  };
2508
2284
 
2285
+ /**
2286
+ * Returns an array containing all libraries which require loading of CSS
2287
+ *
2288
+ * @returns {Array} Array containing all libraries which require loading of CSS
2289
+ * @private
2290
+ * @ui5-restricted sap.ui.core.theming.Parameters
2291
+ */
2292
+ Core.prototype.getAllLibrariesRequiringCss = function() {
2293
+ return aAllLibrariesRequiringCss.slice();
2294
+ };
2295
+
2296
+ /**
2297
+ *
2298
+ * @param {any} vInfo bundle information. Can be:
2299
+ * <ul>
2300
+ * <li>false - library has no resource bundle</li>
2301
+ * <li>true|null|undefined - use default settings: bundle is 'messageBundle.properties',
2302
+ * fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
2303
+ * <li>typeof string - string is the url of the bundle,
2304
+ * fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
2305
+ * <li>typeof object - object can contain bundleUrl, supportedLocales, fallbackLocale</li>
2306
+ * </ul>
2307
+ * @returns {Object|undefined} either normalized bundle information or undefined;
2308
+ * The normalized bundle information is either the object defined in the library manifest.json,
2309
+ * or an object with a 'bundleUrl' property holding the default bundle url.
2310
+ * If undefined is returned, the library does not no have resource bundle (vInfo == false).
2311
+ */
2312
+ function normalizeBundleInfo(vInfo) {
2313
+ if ( vInfo == null || vInfo === true ) {
2314
+ return {
2315
+ bundleUrl: "messagebundle.properties"
2316
+ };
2317
+ }
2318
+ if ( typeof vInfo === "string" ) {
2319
+ return {
2320
+ bundleUrl: vInfo
2321
+ };
2322
+ }
2323
+ if ( typeof vInfo === "object" ) {
2324
+ return deepExtend({}, vInfo);
2325
+ }
2326
+ // return undefined
2327
+ }
2328
+
2329
+ function getLibraryI18n(sLibrary) {
2330
+ var vI18n;
2331
+ var oManifest = getManifest(sLibrary);
2332
+
2333
+ if (oManifest && Version(oManifest._version).compareTo("1.9.0") >= 0) {
2334
+ vI18n = oManifest["sap.ui5"] && oManifest["sap.ui5"].library && oManifest["sap.ui5"].library.i18n;
2335
+ } // else vI18n = undefined
2336
+
2337
+ vI18n = normalizeBundleInfo(vI18n);
2338
+
2339
+ return vI18n;
2340
+ }
2341
+
2509
2342
  /**
2510
2343
  * Retrieves a resource bundle for the given library and locale.
2511
2344
  *
@@ -2550,10 +2383,10 @@ sap.ui.define([
2550
2383
  * @public
2551
2384
  */
2552
2385
  Core.prototype.getLibraryResourceBundle = function(sLibraryName, sLocale, bAsync) {
2553
- var oManifest,
2554
- sKey,
2386
+ var sKey,
2555
2387
  vResult,
2556
- vI18n;
2388
+ vI18n,
2389
+ bLibraryManifestIsAvailable;
2557
2390
 
2558
2391
  if (typeof sLibraryName === "boolean") {
2559
2392
  bAsync = sLibraryName;
@@ -2566,36 +2399,6 @@ sap.ui.define([
2566
2399
  sLocale = undefined;
2567
2400
  }
2568
2401
 
2569
- /**
2570
- *
2571
- * @param {Object} vInfo bundle information. Can be:
2572
- * <ul>
2573
- * <li>false - library has no resource bundle</li>
2574
- * <li>true|null|undefined - use default settings: bundle is 'messageBundle.properties',
2575
- * fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
2576
- * <li>typeof string - string is the url of the bundle,
2577
- * fallback and supported locales are not defined (defaulted by ResourceBundle)</li>
2578
- * <li>typeof object - object can contain bundleUrl, supportedLocales, fallbackLocale</li>
2579
- * </ul>
2580
- * @returns {Object} bundle information
2581
- */
2582
- function normalizeBundleInfo(vInfo) {
2583
- if ( vInfo == null || vInfo === true ) {
2584
- return {
2585
- bundleUrl: "messagebundle.properties"
2586
- };
2587
- }
2588
- if ( typeof vInfo === "string" ) {
2589
- return {
2590
- bundleUrl: vInfo
2591
- };
2592
- }
2593
- if ( typeof vInfo === "object" ) {
2594
- return vInfo;
2595
- }
2596
- // return undefined
2597
- }
2598
-
2599
2402
  assert((sLibraryName === undefined && sLocale === undefined) || typeof sLibraryName === "string", "sLibraryName must be a string or there is no argument given at all");
2600
2403
  assert(sLocale === undefined || typeof sLocale === "string", "sLocale must be a string or omitted");
2601
2404
 
@@ -2603,21 +2406,39 @@ sap.ui.define([
2603
2406
  sLocale = sLocale || this.getConfiguration().getLanguage();
2604
2407
  sKey = sLibraryName + "/" + sLocale;
2605
2408
 
2409
+ // A library ResourceBundle can be requested before its owning library is preloaded.
2410
+ // In this case we do not have the library's manifest yet and the default bundle (messagebundle.properties) is requested.
2411
+ // We still cache this default bundle for as long as the library remains "not-preloaded".
2412
+ // When the library is preloaded later on, a new ResourceBundle needs to be requested, since we need to take the
2413
+ // "sap.ui5/library/i18n" section of the library's manifest into account.
2414
+ bLibraryManifestIsAvailable = mLibraryManifests.has(sLibraryName);
2415
+ var sNotLoadedCacheKey = sKey + "/manifest-not-available";
2416
+
2417
+ // If the library was loaded in the meantime (or the first time around), we can delete the old ResourceBundle
2418
+ if (bLibraryManifestIsAvailable) {
2419
+ delete this.mResourceBundles[sNotLoadedCacheKey];
2420
+ } else {
2421
+ // otherwise we use the temporary cache-key
2422
+ sKey = sNotLoadedCacheKey;
2423
+ }
2424
+
2606
2425
  vResult = this.mResourceBundles[sKey];
2607
2426
  if (!vResult || (!bAsync && vResult instanceof Promise)) {
2608
- oManifest = getManifest(sLibraryName);
2609
- if ( oManifest && Version(oManifest._version).compareTo("1.9.0") >= 0 ) {
2610
- vI18n = oManifest["sap.ui5"] && oManifest["sap.ui5"].library && oManifest["sap.ui5"].library.i18n;
2611
- } // else vI18n = undefined
2612
- vI18n = normalizeBundleInfo(vI18n);
2427
+ vI18n = getLibraryI18n(sLibraryName);
2613
2428
 
2614
2429
  if (vI18n) {
2430
+ var sBundleUrl = getModulePath(sLibraryName + "/", vI18n.bundleUrl);
2431
+
2432
+ // add known library name to cache to avoid later guessing
2433
+ mGuessedLibraries[sBundleUrl] = sLibraryName;
2434
+
2615
2435
  vResult = ResourceBundle.create({
2616
- url : getModulePath(sLibraryName + "/", vI18n.bundleUrl),
2436
+ bundleUrl: sBundleUrl,
2617
2437
  supportedLocales: vI18n.supportedLocales,
2618
2438
  fallbackLocale: vI18n.fallbackLocale,
2619
- locale : sLocale,
2620
- async: bAsync
2439
+ locale: sLocale,
2440
+ async: bAsync,
2441
+ activeTerminologies: this.getConfiguration().getActiveTerminologies()
2621
2442
  });
2622
2443
 
2623
2444
  if (vResult instanceof Promise) {
@@ -2649,6 +2470,56 @@ sap.ui.define([
2649
2470
  }
2650
2471
  }
2651
2472
 
2473
+ /**
2474
+ * Implementation of the ResourceBundle._enrichBundleConfig hook.
2475
+ * Guesses if the given bundleUrl is pointing to a library's ResourceBundle and adapts the given bundle definition accordingly
2476
+ * based on the infered library's manifest.
2477
+ *
2478
+ * @param {module:sap/base/i18n/ResourceBundle.Configuration} mParams Map containing the arguments of the sap.base.i18n.ResourceBundle.create call
2479
+ * @returns {module:sap/base/i18n/ResourceBundle.Configuration} mParams The enriched config object
2480
+ * @private
2481
+ */
2482
+ ResourceBundle._enrichBundleConfig = function (mParams) {
2483
+ if (!mParams.terminologies || !mParams.enhanceWith) {
2484
+
2485
+ var sLibraryName;
2486
+ if (mGuessedLibraries.hasOwnProperty(mParams.url)) {
2487
+ sLibraryName = mGuessedLibraries[mParams.url];
2488
+ } else {
2489
+ sLibraryName = getLibraryNameForBundle(mParams.url);
2490
+ }
2491
+
2492
+ if (sLibraryName) {
2493
+ // look up i18n information in library manifest
2494
+ // (can be undefined if the lib defines "sap.ui5/library/i18n" with <false>)
2495
+ var vI18n = getLibraryI18n(sLibraryName);
2496
+
2497
+ // enrich i18n information
2498
+ if (vI18n) {
2499
+ // resolve bundleUrls relative to library path
2500
+ var sLibraryPath = sLibraryName.replace(/\./g, "/");
2501
+ sLibraryPath = sLibraryPath.endsWith("/") ? sLibraryPath : sLibraryPath + "/"; // add trailing slash if missing
2502
+ sLibraryPath = sap.ui.require.toUrl(sLibraryPath);
2503
+
2504
+ _UrlResolver._processResourceConfiguration(vI18n, {
2505
+ alreadyResolvedOnRoot: true,
2506
+ relativeTo: sLibraryPath
2507
+ });
2508
+
2509
+ // basic i18n information
2510
+ mParams.fallbackLocale = mParams.fallbackLocale || vI18n.fallbackLocale;
2511
+ mParams.supportedLocales = mParams.supportedLocales || vI18n.supportedLocales;
2512
+
2513
+ // text verticalization information
2514
+ mParams.terminologies = mParams.terminologies || vI18n.terminologies;
2515
+ mParams.enhanceWith = mParams.enhanceWith || vI18n.enhanceWith;
2516
+ mParams.activeTerminologies = mParams.activeTerminologies || Configuration.getActiveTerminologies();
2517
+ }
2518
+ }
2519
+ }
2520
+ return mParams;
2521
+ };
2522
+
2652
2523
  /**
2653
2524
  * Implicitly creates a new <code>UIArea</code> (or reuses an exiting one) for the given DOM reference and
2654
2525
  * adds the given control reference to the UIAreas content (existing content will be removed).
@@ -2680,7 +2551,7 @@ sap.ui.define([
2680
2551
  * @public
2681
2552
  * @param {string|Element} o DOM element or ID of the UIArea
2682
2553
  * @return {sap.ui.core.UIArea|null|undefined} UIArea with the given ID or DOM element or <code>null</code> or <code>undefined</code>.
2683
- * @deprecated As of version 1.107, use {@link sap.ui.core.UIArea.registry#get UIArea.registry#get} instead!
2554
+ * @deprecated As of version 1.107, use {@link sap.ui.core.UIArea.registry#get UIArea.registry#get} instead, but note that <code>UIArea.registry.get</code> only accepts the ID of the UIArea as argument.
2684
2555
  */
2685
2556
  Core.prototype.getUIArea = function(o) {
2686
2557
  assert(typeof o === "string" || typeof o === "object", "o must be a string or object");
@@ -2742,7 +2613,9 @@ sap.ui.define([
2742
2613
  * @public
2743
2614
  */
2744
2615
  Core.prototype.notifyContentDensityChanged = function() {
2745
- this.fireThemeChanged();
2616
+ this._getThemeManager().then(function (ThemeManager) {
2617
+ ThemeManager.notifyContentDensityChanged();
2618
+ });
2746
2619
  };
2747
2620
 
2748
2621
  /**
@@ -2807,28 +2680,7 @@ sap.ui.define([
2807
2680
  * @param {string} [oParameters.theme] Theme name (default is <code>sap.ui.getCore().getConfiguration().getTheme()</code>)
2808
2681
  */
2809
2682
  Core.prototype.fireThemeChanged = function(oParameters) {
2810
- // special hook for resetting theming parameters before the controls get
2811
- // notified (lightweight coupling to static Parameters module)
2812
- var ThemeParameters = sap.ui.require("sap/ui/core/theming/Parameters");
2813
- if (ThemeParameters) {
2814
- ThemeParameters.reset(/* bOnlyWhenNecessary= */ true);
2815
- }
2816
-
2817
- oParameters = oParameters || {};
2818
- // set the current theme name as default if omitted
2819
- if (!oParameters.theme) {
2820
- oParameters.theme = this.getConfiguration().getTheme();
2821
- }
2822
-
2823
- // notify all elements/controls via a pseudo browser event
2824
2683
  var sEventId = Core.M_EVENTS.ThemeChanged;
2825
- var oEvent = jQuery.Event(sEventId);
2826
- oEvent.theme = oParameters.theme;
2827
- Element.registry.forEach(function(oElement) {
2828
- oElement._handleEvent(oEvent);
2829
- });
2830
-
2831
- ActivityDetection.refresh();
2832
2684
 
2833
2685
  // notify the listeners via a control event
2834
2686
  _oEventProvider.fireEvent(sEventId, oParameters);
@@ -2939,7 +2791,6 @@ sap.ui.define([
2939
2791
  }
2940
2792
  });
2941
2793
 
2942
-
2943
2794
  /*
2944
2795
  * Notify all UIAreas, Components, Elements to first update their models (phase 1)
2945
2796
  * and then to update their bindings and corresponding data types (phase 2)
@@ -2964,7 +2815,10 @@ sap.ui.define([
2964
2815
  // update the dir attribute of the document
2965
2816
  document.documentElement.setAttribute("dir", mChanges.rtl ? "rtl" : "ltr");
2966
2817
  // modify style sheet URLs
2967
- this._updateThemeUrls(this.sTheme);
2818
+ this._getThemeManager().then(function (ThemeManager) {
2819
+ ThemeManager._updateThemeUrls(Configuration.getTheme());
2820
+ });
2821
+
2968
2822
  // invalidate all UIAreas
2969
2823
  UIArea.registry.forEach(function(oUIArea) {
2970
2824
  oUIArea.invalidate();
@@ -3987,6 +3841,50 @@ sap.ui.define([
3987
3841
  BaseObject.prototype.destroy.call(this);
3988
3842
  };
3989
3843
 
3844
+ /**
3845
+ * Tries to derive a library name from a bundle URL by guessing the resource name first,
3846
+ * then trying to match with the (known) loaded libraries.
3847
+ *
3848
+ * @param {string} sBundleUrl The bundleURL from which the library name needs to be derived.
3849
+ * @returns {string|undefined} Returns the corresponding library name if found or 'undefined'.
3850
+ */
3851
+ function getLibraryNameForBundle(sBundleUrl) {
3852
+ if (sBundleUrl) {
3853
+ // [1] Guess ResourceName
3854
+ var sBundleName = sap.ui.loader._.guessResourceName(sBundleUrl);
3855
+ if (sBundleName) {
3856
+
3857
+ // [2] Guess library name
3858
+ for (var sLibrary in mLoadedLibraries) {
3859
+ var sLibraryName = sLibrary.replace(/\./g, "/");
3860
+ if (sLibraryName !== "" && sBundleName.startsWith(sLibraryName + "/")) {
3861
+ var sBundlePath = sBundleName.replace(sLibraryName + "/", "");
3862
+
3863
+ // [3] Retrieve i18n from manifest for looking up the base bundle
3864
+ // (can be undefined if the lib defines "sap.ui5/library/i18n" with <false>)
3865
+ var vI18n = getLibraryI18n(sLibraryName);
3866
+
3867
+ if (vI18n) {
3868
+ // Resolve bundle paths relative to library before comparing
3869
+ var sManifestBaseBundlePath = getModulePath(sLibraryName, "/" + vI18n.bundleUrl);
3870
+ sBundlePath = getModulePath(sLibraryName, "/" + sBundlePath);
3871
+
3872
+ // the input bundle-path and the derived library bundle-path must match,
3873
+ // otherwise we would enhance the wrong bundle with terminologies etc.
3874
+ if (sBundlePath === sManifestBaseBundlePath) {
3875
+ // [4.1] Cache matching result
3876
+ mGuessedLibraries[sBundleUrl] = sLibrary;
3877
+ return sLibrary;
3878
+ }
3879
+ // [4.2] Cache none-matching result
3880
+ mGuessedLibraries[sBundleUrl] = false;
3881
+ }
3882
+ }
3883
+ }
3884
+ }
3885
+ }
3886
+ }
3887
+
3990
3888
  /**
3991
3889
  * @name sap.ui.core.CorePlugin
3992
3890
  * @interface Contract for plugins that want to extend the core runtime