@openui5/sap.ui.core 1.93.3 → 1.96.2

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 (416) hide show
  1. package/.eslintrc.json +13 -2
  2. package/.reuse/dep5 +6 -11
  3. package/THIRDPARTY.txt +10 -16
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +5 -2
  6. package/src/jquery.sap.properties.js +1 -1
  7. package/src/jquery.sap.resources.js +1 -1
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/jquery.sap.stubs.js +2 -1
  11. package/src/jquery.sap.trace.js +2 -1
  12. package/src/sap/base/i18n/ResourceBundle.js +6 -2
  13. package/src/sap/base/strings/whitespaceReplacer.js +52 -0
  14. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  15. package/src/sap/base/util/restricted/_castArray.js +1 -1
  16. package/src/sap/base/util/restricted/_compact.js +1 -1
  17. package/src/sap/base/util/restricted/_curry.js +1 -1
  18. package/src/sap/base/util/restricted/_debounce.js +1 -1
  19. package/src/sap/base/util/restricted/_difference.js +1 -1
  20. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  22. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_flatten.js +1 -1
  26. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  28. package/src/sap/base/util/restricted/_intersection.js +1 -1
  29. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  31. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  33. package/src/sap/base/util/restricted/_isNil.js +1 -1
  34. package/src/sap/base/util/restricted/_max.js +1 -1
  35. package/src/sap/base/util/restricted/_merge.js +1 -1
  36. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  37. package/src/sap/base/util/restricted/_min.js +1 -1
  38. package/src/sap/base/util/restricted/_omit.js +1 -1
  39. package/src/sap/base/util/restricted/_pick.js +1 -1
  40. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  41. package/src/sap/base/util/restricted/_throttle.js +1 -1
  42. package/src/sap/base/util/restricted/_toArray.js +1 -1
  43. package/src/sap/base/util/restricted/_union.js +1 -1
  44. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  45. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  46. package/src/sap/base/util/restricted/_uniq.js +1 -1
  47. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  49. package/src/sap/base/util/restricted/_without.js +1 -1
  50. package/src/sap/base/util/restricted/_xor.js +1 -1
  51. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  52. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  53. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  55. package/src/sap/ui/Device.js +37 -42
  56. package/src/sap/ui/Global.js +8 -7
  57. package/src/sap/ui/base/DataType.js +14 -8
  58. package/src/sap/ui/base/Event.js +1 -1
  59. package/src/sap/ui/base/EventProvider.js +1 -1
  60. package/src/sap/ui/base/ExpressionParser.js +9 -6
  61. package/src/sap/ui/base/Interface.js +3 -49
  62. package/src/sap/ui/base/ManagedObject.js +12 -7
  63. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  64. package/src/sap/ui/base/Metadata.js +1 -1
  65. package/src/sap/ui/base/Object.js +49 -4
  66. package/src/sap/ui/base/ObjectPool.js +1 -1
  67. package/src/sap/ui/base/syncXHRFix.js +2 -1
  68. package/src/sap/ui/core/.library +5 -5
  69. package/src/sap/ui/core/AppCacheBuster.js +4 -4
  70. package/src/sap/ui/core/BusyIndicator.js +1 -11
  71. package/src/sap/ui/core/Component.js +300 -140
  72. package/src/sap/ui/core/ComponentContainer.js +24 -8
  73. package/src/sap/ui/core/ComponentMetadata.js +14 -3
  74. package/src/sap/ui/core/ComponentSupport.js +1 -1
  75. package/src/sap/ui/core/Configuration.js +67 -31
  76. package/src/sap/ui/core/Control.js +1 -1
  77. package/src/sap/ui/core/Core.js +103 -25
  78. package/src/sap/ui/core/CustomData.js +1 -1
  79. package/src/sap/ui/core/CustomizingConfiguration.js +35 -260
  80. package/src/sap/ui/core/DeclarativeSupport.js +3 -2
  81. package/src/sap/ui/core/Element.js +1 -1
  82. package/src/sap/ui/core/ElementMetadata.js +4 -2
  83. package/src/sap/ui/core/EnabledPropagator.js +91 -73
  84. package/src/sap/ui/core/EventBus.js +1 -1
  85. package/src/sap/ui/core/ExtensionPoint.js +7 -14
  86. package/src/sap/ui/core/Fragment.js +30 -32
  87. package/src/sap/ui/core/HTML.js +1 -1
  88. package/src/sap/ui/core/History.js +1 -1
  89. package/src/sap/ui/core/Icon.js +7 -8
  90. package/src/sap/ui/core/IconPool.js +26 -1097
  91. package/src/sap/ui/core/IconRenderer.js +6 -6
  92. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  93. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  94. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  95. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  96. package/src/sap/ui/core/InvisibleText.js +1 -1
  97. package/src/sap/ui/core/Item.js +1 -1
  98. package/src/sap/ui/core/LabelEnablement.js +1 -1
  99. package/src/sap/ui/core/LayoutData.js +1 -1
  100. package/src/sap/ui/core/ListItem.js +1 -1
  101. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  102. package/src/sap/ui/core/Locale.js +26 -4
  103. package/src/sap/ui/core/LocaleData.js +1 -1
  104. package/src/sap/ui/core/Manifest.js +4 -61
  105. package/src/sap/ui/core/Message.js +1 -1
  106. package/src/sap/ui/core/Patcher.js +27 -3
  107. package/src/sap/ui/core/Placeholder.js +28 -15
  108. package/src/sap/ui/core/RenderManager.js +36 -6
  109. package/src/sap/ui/core/Renderer.js +13 -3
  110. package/src/sap/ui/core/ResizeHandler.js +1 -1
  111. package/src/sap/ui/core/ScrollBar.js +2 -2
  112. package/src/sap/ui/core/SeparatorItem.js +1 -1
  113. package/src/sap/ui/core/ShortcutHintsMixin.js +14 -7
  114. package/src/sap/ui/core/Title.js +1 -1
  115. package/src/sap/ui/core/TooltipBase.js +1 -1
  116. package/src/sap/ui/core/UIArea.js +1 -1
  117. package/src/sap/ui/core/UIComponent.js +42 -16
  118. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  119. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  120. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  121. package/src/sap/ui/core/XMLComposite.js +2 -2
  122. package/src/sap/ui/core/XMLCompositeMetadata.js +2 -2
  123. package/src/sap/ui/core/XMLTemplateProcessor.js +116 -41
  124. package/src/sap/ui/core/_IconRegistry.js +1148 -0
  125. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  126. package/src/sap/ui/core/delegate/ScrollEnablement.js +6 -3
  127. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  128. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  129. package/src/sap/ui/core/dnd/DragInfo.js +2 -2
  130. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  131. package/src/sap/ui/core/format/NumberFormat.js +16 -1
  132. package/src/sap/ui/core/hyphenation/Hyphenation.js +73 -221
  133. package/src/sap/ui/core/hyphenation/HyphenationTestingWords.js +11 -10
  134. package/src/sap/ui/core/library.js +3 -3
  135. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  136. package/src/sap/ui/core/message/Message.js +1 -1
  137. package/src/sap/ui/core/message/MessageManager.js +13 -15
  138. package/src/sap/ui/core/message/MessageParser.js +1 -1
  139. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  140. package/src/sap/ui/core/messagebundle_de.properties +1 -1
  141. package/src/sap/ui/core/messagebundle_fr.properties +1 -1
  142. package/src/sap/ui/core/messagebundle_it.properties +1 -1
  143. package/src/sap/ui/core/messagebundle_pl.properties +1 -1
  144. package/src/sap/ui/core/messagebundle_th.properties +2 -2
  145. package/src/sap/ui/core/mvc/Controller.js +38 -19
  146. package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +30 -32
  147. package/src/sap/ui/core/mvc/ControllerMetadata.js +18 -18
  148. package/src/sap/ui/core/mvc/HTMLView.js +2 -2
  149. package/src/sap/ui/core/mvc/JSONView.js +2 -2
  150. package/src/sap/ui/core/mvc/JSView.js +2 -2
  151. package/src/sap/ui/core/mvc/TemplateView.js +2 -2
  152. package/src/sap/ui/core/mvc/View.js +58 -85
  153. package/src/sap/ui/core/mvc/XMLView.js +2 -2
  154. package/src/sap/ui/core/mvc/XMLViewRenderer.js +17 -20
  155. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  156. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  157. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  158. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  159. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  160. package/src/sap/ui/core/routing/History.js +10 -2
  161. package/src/sap/ui/core/routing/Router.js +8 -1
  162. package/src/sap/ui/core/routing/Target.js +13 -0
  163. package/src/sap/ui/core/routing/Targets.js +13 -2
  164. package/src/sap/ui/core/routing/async/Route.js +1 -1
  165. package/src/sap/ui/core/routing/async/Target.js +353 -259
  166. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  167. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  168. package/src/sap/ui/core/service/Service.js +1 -1
  169. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  170. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  171. package/src/sap/ui/core/support/BootSupportTool.js +11 -0
  172. package/src/sap/ui/core/support/InteractionTree.css +4 -0
  173. package/src/sap/ui/core/support/Plugin.js +1 -1
  174. package/src/sap/ui/core/support/Support.js +1 -1
  175. package/src/sap/ui/core/support/ViewInfo.css +599 -0
  176. package/src/sap/ui/core/support/controls/InteractionTree.js +352 -222
  177. package/src/sap/ui/core/support/controls/ObjectViewer.js +3 -41
  178. package/src/sap/ui/core/support/controls/TimelineOverview.js +49 -24
  179. package/src/sap/ui/core/support/controls/TreeViewer.js +12 -58
  180. package/src/sap/ui/core/support/plugins/ControlTree.js +59 -68
  181. package/src/sap/ui/core/support/plugins/Debugging.js +9 -11
  182. package/src/sap/ui/core/support/plugins/Interaction.js +2 -2
  183. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  184. package/src/sap/ui/core/support/plugins/Performance.js +147 -75
  185. package/src/sap/ui/core/support/plugins/Selector.js +19 -24
  186. package/src/sap/ui/core/support/plugins/TechInfo.js +5 -5
  187. package/src/sap/ui/core/support/plugins/Trace.js +95 -32
  188. package/src/sap/ui/core/support/plugins/ViewInfo.js +9 -73
  189. package/src/sap/ui/core/support/support.css +109 -14
  190. package/src/sap/ui/core/support/support.html +6 -2
  191. package/src/sap/ui/core/support/techinfo/TechnicalInfo.fragment.xml +1 -0
  192. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +149 -72
  193. package/src/sap/ui/core/themes/base/Icon.less +9 -0
  194. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  195. package/src/sap/ui/core/theming/Parameters.js +6 -4
  196. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  197. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  198. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  199. package/src/sap/ui/core/tmpl/Template.js +10 -28
  200. package/src/sap/ui/core/tmpl/TemplateControl.js +4 -4
  201. package/src/sap/ui/core/tmpl/_parsePath.js +35 -0
  202. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  203. package/src/sap/ui/core/util/DraftEnabledMockServer.js +9 -4
  204. package/src/sap/ui/core/util/Export.js +1 -1
  205. package/src/sap/ui/core/util/ExportCell.js +1 -1
  206. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  207. package/src/sap/ui/core/util/ExportRow.js +1 -1
  208. package/src/sap/ui/core/util/ExportType.js +1 -1
  209. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  210. package/src/sap/ui/core/util/File.js +1 -1
  211. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  212. package/src/sap/ui/core/util/MockServer.js +5 -5
  213. package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +3 -2
  214. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  215. package/src/sap/ui/core/util/XMLPreprocessor.js +11 -12
  216. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +136 -63
  217. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +170 -153
  218. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +424 -293
  219. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  220. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  221. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  222. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  223. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  224. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  225. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  226. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  227. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  228. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  229. package/src/sap/ui/debug/ControlTree.js +10 -4
  230. package/src/sap/ui/debug/DebugEnv.js +3 -4
  231. package/src/sap/ui/debug/Highlighter.js +8 -2
  232. package/src/sap/ui/debug/PropertyList.css +55 -0
  233. package/src/sap/ui/debug/PropertyList.js +111 -182
  234. package/src/sap/ui/model/Binding.js +174 -118
  235. package/src/sap/ui/model/ClientContextBinding.js +1 -1
  236. package/src/sap/ui/model/ClientListBinding.js +1 -3
  237. package/src/sap/ui/model/ClientModel.js +4 -4
  238. package/src/sap/ui/model/ClientPropertyBinding.js +4 -2
  239. package/src/sap/ui/model/ClientTreeBinding.js +15 -9
  240. package/src/sap/ui/model/ClientTreeBindingAdapter.js +28 -23
  241. package/src/sap/ui/model/CompositeBinding.js +98 -77
  242. package/src/sap/ui/model/CompositeDataState.js +2 -2
  243. package/src/sap/ui/model/CompositeType.js +2 -2
  244. package/src/sap/ui/model/Context.js +4 -2
  245. package/src/sap/ui/model/ContextBinding.js +6 -14
  246. package/src/sap/ui/model/DataState.js +2 -2
  247. package/src/sap/ui/model/Filter.js +255 -53
  248. package/src/sap/ui/model/FilterOperator.js +1 -1
  249. package/src/sap/ui/model/FilterProcessor.js +27 -17
  250. package/src/sap/ui/model/FilterType.js +1 -1
  251. package/src/sap/ui/model/ListBinding.js +180 -117
  252. package/src/sap/ui/model/MetaModel.js +4 -9
  253. package/src/sap/ui/model/Model.js +345 -294
  254. package/src/sap/ui/model/PropertyBinding.js +92 -58
  255. package/src/sap/ui/model/SelectionModel.js +2 -2
  256. package/src/sap/ui/model/SimpleType.js +2 -2
  257. package/src/sap/ui/model/Sorter.js +1 -1
  258. package/src/sap/ui/model/SorterProcessor.js +1 -1
  259. package/src/sap/ui/model/StaticBinding.js +1 -1
  260. package/src/sap/ui/model/TreeAutoExpandMode.js +2 -2
  261. package/src/sap/ui/model/TreeBinding.js +1 -1
  262. package/src/sap/ui/model/TreeBindingAdapter.js +251 -100
  263. package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +16 -9
  264. package/src/sap/ui/model/TreeBindingUtils.js +1 -0
  265. package/src/sap/ui/model/Type.js +1 -1
  266. package/src/sap/ui/model/analytics/AnalyticalBinding.js +8 -4
  267. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +1 -1
  268. package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +1 -1
  269. package/src/sap/ui/model/analytics/BatchResponseCollector.js +1 -1
  270. package/src/sap/ui/model/analytics/ODataModelAdapter.js +1 -1
  271. package/src/sap/ui/model/analytics/odata4analytics.js +34 -25
  272. package/src/sap/ui/model/base/ManagedObjectModel.js +4 -0
  273. package/src/sap/ui/model/json/JSONListBinding.js +8 -5
  274. package/src/sap/ui/model/json/JSONModel.js +24 -15
  275. package/src/sap/ui/model/json/JSONPropertyBinding.js +4 -3
  276. package/src/sap/ui/model/json/JSONTreeBinding.js +1 -1
  277. package/src/sap/ui/model/message/MessageListBinding.js +6 -3
  278. package/src/sap/ui/model/message/MessageModel.js +23 -15
  279. package/src/sap/ui/model/message/MessagePropertyBinding.js +2 -2
  280. package/src/sap/ui/model/odata/AnnotationHelper.js +1 -1
  281. package/src/sap/ui/model/odata/AnnotationParser.js +1 -1
  282. package/src/sap/ui/model/odata/CountMode.js +1 -1
  283. package/src/sap/ui/model/odata/Filter.js +1 -1
  284. package/src/sap/ui/model/odata/ODataAnnotations.js +2 -2
  285. package/src/sap/ui/model/odata/ODataContextBinding.js +1 -1
  286. package/src/sap/ui/model/odata/ODataListBinding.js +1 -1
  287. package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
  288. package/src/sap/ui/model/odata/ODataMetaModel.js +5 -3
  289. package/src/sap/ui/model/odata/ODataMetadata.js +2 -2
  290. package/src/sap/ui/model/odata/ODataModel.js +8 -7
  291. package/src/sap/ui/model/odata/ODataPropertyBinding.js +1 -1
  292. package/src/sap/ui/model/odata/ODataTreeBinding.js +65 -33
  293. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +1 -1
  294. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +2 -2
  295. package/src/sap/ui/model/odata/ODataUtils.js +13 -11
  296. package/src/sap/ui/model/odata/OperationMode.js +1 -1
  297. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +1 -1
  298. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  299. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  300. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  301. package/src/sap/ui/model/odata/type/Date.js +1 -1
  302. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  303. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  304. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  305. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  306. package/src/sap/ui/model/odata/type/Double.js +1 -1
  307. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  308. package/src/sap/ui/model/odata/type/Int.js +1 -1
  309. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  310. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  311. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  312. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  313. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  314. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  315. package/src/sap/ui/model/odata/type/Single.js +1 -1
  316. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  317. package/src/sap/ui/model/odata/type/String.js +1 -1
  318. package/src/sap/ui/model/odata/type/Time.js +1 -1
  319. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  320. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  321. package/src/sap/ui/model/odata/v2/Context.js +81 -9
  322. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +3 -3
  323. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +39 -49
  324. package/src/sap/ui/model/odata/v2/ODataListBinding.js +236 -73
  325. package/src/sap/ui/model/odata/v2/ODataModel.js +314 -164
  326. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +110 -97
  327. package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +129 -0
  328. package/src/sap/ui/model/odata/v4/Context.js +6 -3
  329. package/src/sap/ui/model/odata/v4/ODataBinding.js +5 -6
  330. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +117 -40
  331. package/src/sap/ui/model/odata/v4/ODataListBinding.js +95 -15
  332. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +44 -31
  333. package/src/sap/ui/model/odata/v4/ODataModel.js +86 -78
  334. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +47 -28
  335. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +11 -7
  336. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +10 -3
  337. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +8 -1
  338. package/src/sap/ui/model/odata/v4/lib/_Cache.js +24 -16
  339. package/src/sap/ui/model/odata/v4/lib/_Helper.js +32 -30
  340. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +52 -17
  341. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +2 -2
  342. package/src/sap/ui/model/resource/ResourceModel.js +6 -2
  343. package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
  344. package/src/sap/ui/model/type/Boolean.js +2 -2
  345. package/src/sap/ui/model/type/Currency.js +2 -2
  346. package/src/sap/ui/model/type/Date.js +9 -3
  347. package/src/sap/ui/model/type/DateInterval.js +4 -2
  348. package/src/sap/ui/model/type/DateTime.js +2 -2
  349. package/src/sap/ui/model/type/DateTimeInterval.js +2 -2
  350. package/src/sap/ui/model/type/FileSize.js +4 -2
  351. package/src/sap/ui/model/type/Float.js +4 -2
  352. package/src/sap/ui/model/type/Integer.js +4 -2
  353. package/src/sap/ui/model/type/String.js +2 -2
  354. package/src/sap/ui/model/type/Time.js +2 -2
  355. package/src/sap/ui/model/type/TimeInterval.js +2 -2
  356. package/src/sap/ui/model/type/Unit.js +14 -7
  357. package/src/sap/ui/model/xml/XMLListBinding.js +15 -9
  358. package/src/sap/ui/model/xml/XMLModel.js +70 -41
  359. package/src/sap/ui/model/xml/XMLPropertyBinding.js +4 -4
  360. package/src/sap/ui/model/xml/XMLTreeBinding.js +5 -4
  361. package/src/sap/ui/performance/trace/Interaction.js +30 -15
  362. package/src/sap/ui/performance/trace/initTraces.js +1 -1
  363. package/src/sap/ui/qunit/QUnitUtils.js +3 -2
  364. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  365. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +9 -11
  366. package/src/sap/ui/test/TestUtils.js +11 -4
  367. package/src/sap/ui/test/actions/Drag.js +6 -2
  368. package/src/sap/ui/test/actions/Drop.js +6 -2
  369. package/src/sap/ui/test/actions/EnterText.js +6 -0
  370. package/src/sap/ui/test/actions/Press.js +6 -0
  371. package/src/sap/ui/test/actions/Scroll.js +6 -0
  372. package/src/sap/ui/test/autowaiter/_resourceWaiter.js +4 -4
  373. package/src/sap/ui/test/launchers/componentLauncher.js +0 -4
  374. package/src/sap/ui/test/matchers/I18NText.js +29 -11
  375. package/src/sap/ui/test/opaQunit.js +5 -0
  376. package/src/sap/ui/thirdparty/crossroads.js +6 -4
  377. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly.js +1196 -0
  378. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly_Loader.js +797 -0
  379. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.asm.js +108 -127
  380. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.wasm +0 -0
  381. package/src/sap/ui/thirdparty/hyphenopoly/patterns/bg.hpb +0 -0
  382. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ca.hpb +0 -0
  383. package/src/sap/ui/thirdparty/hyphenopoly/patterns/da.hpb +0 -0
  384. package/src/sap/ui/thirdparty/hyphenopoly/patterns/de.hpb +0 -0
  385. package/src/sap/ui/thirdparty/hyphenopoly/patterns/el-monoton.hpb +0 -0
  386. package/src/sap/ui/thirdparty/hyphenopoly/patterns/en-us.hpb +0 -0
  387. package/src/sap/ui/thirdparty/hyphenopoly/patterns/es.hpb +0 -0
  388. package/src/sap/ui/thirdparty/hyphenopoly/patterns/et.hpb +0 -0
  389. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fi.hpb +0 -0
  390. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fr.hpb +0 -0
  391. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hi.hpb +0 -0
  392. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hr.hpb +0 -0
  393. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hu.hpb +0 -0
  394. package/src/sap/ui/thirdparty/hyphenopoly/patterns/it.hpb +0 -0
  395. package/src/sap/ui/thirdparty/hyphenopoly/patterns/lt.hpb +0 -0
  396. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nb-no.hpb +0 -0
  397. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nl.hpb +0 -0
  398. package/src/sap/ui/thirdparty/hyphenopoly/patterns/pt.hpb +0 -0
  399. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ru.hpb +0 -0
  400. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sl.hpb +0 -0
  401. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sv.hpb +0 -0
  402. package/src/sap/ui/thirdparty/hyphenopoly/patterns/th.hpb +0 -0
  403. package/src/sap/ui/thirdparty/hyphenopoly/patterns/tr.hpb +0 -0
  404. package/src/sap/ui/thirdparty/hyphenopoly/patterns/uk.hpb +0 -0
  405. package/src/sap/ui/thirdparty/jquery.js +9 -1
  406. package/src/sap/ui/thirdparty/qunit-2.js +1 -1
  407. package/src/sap/ui/thirdparty/qunit.js +1 -1
  408. package/src/sap/ui/util/Mobile.js +2 -20
  409. package/src/sap/ui/util/Storage.js +1 -1
  410. package/src/sap/ui/util/isCrossOriginURL.js +16 -6
  411. package/src/sap-ui-core-nojQuery.js +1 -1
  412. package/src/sap-ui-core.js +1 -1
  413. package/src/sap-ui-debug.js +3 -17
  414. package/ui5.yaml +5 -2
  415. package/src/sap/ui/core/support/plugins/MessageTest.js +0 -96
  416. package/src/sap/ui/thirdparty/hyphenopoly/hyphenopoly.bundle.js +0 -860
@@ -1,860 +0,0 @@
1
- "use strict";
2
-
3
- (function () {
4
- function r(e, n, t) {
5
- function o(i, f) {
6
- if (!n[i]) {
7
- if (!e[i]) {
8
- var c = "function" == typeof require && require;if (!f && c) return c(i, !0);if (u) return u(i, !0);var a = new Error("Cannot find module '" + i + "'");throw a.code = "MODULE_NOT_FOUND", a;
9
- }var p = n[i] = { exports: {} };e[i][0].call(p.exports, function (r) {
10
- var n = e[i][1][r];return o(n || r);
11
- }, p, p.exports, r, e, n, t);
12
- }return n[i].exports;
13
- }for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) {
14
- o(t[i]);
15
- }return o;
16
- }return r;
17
- })()({ 1: [function (require, module, exports) {
18
- /**
19
- * @license Hyphenopoly.module.js 2.4.0-devel - hyphenation for node
20
- * ©2018 Mathias Nater, Zürich (mathiasnater at gmail dot com)
21
- * https://github.com/mnater/Hyphenopoly
22
- *
23
- * Released under the MIT license
24
- * http://mnater.github.io/Hyphenopoly/LICENSE
25
- */
26
-
27
- /* eslint-env node */
28
- /* eslint no-console: 0 */
29
- "use strict";
30
-
31
- var decode = function makeDecoder() {
32
- var decoder = function decoder(ui16) {
33
- var i = 0;
34
- var str = "";
35
- while (i < ui16.length) {
36
- str += String.fromCharCode(ui16[i]);
37
- i += 1;
38
- }
39
- return str;
40
- };
41
- return decoder;
42
- }();
43
-
44
- var SOFTHYPHEN = String.fromCharCode(173);
45
-
46
- /**
47
- * Create Object without standard Object-prototype
48
- * @returns {Object} empty object
49
- */
50
- function empty() {
51
- return Object.create(null);
52
- }
53
- /**
54
- * Polyfill Math.imul
55
- * @param {number} a LHS
56
- * @param {number} b RHS
57
- * @returns {number} empty object
58
- */
59
- /* eslint-disable no-bitwise */
60
- Math.imul = Math.imul || function imul(a, b) {
61
- var aHi = a >>> 16 & 0xffff;
62
- var aLo = a & 0xffff;
63
- var bHi = b >>> 16 & 0xffff;
64
- var bLo = b & 0xffff;
65
-
66
- /*
67
- * The shift by 0 fixes the sign on the high part.
68
- * The final |0 converts the unsigned value into a signed value
69
- */
70
- return aLo * bLo + (aHi * bLo + aLo * bHi << 16 >>> 0) | 0;
71
- };
72
- /* eslint-enable no-bitwise */
73
- /**
74
- * Allocate memory for (w)asm
75
- * @param {string} lang Language
76
- * @returns {undefined}
77
- */
78
- function allocateMemory(lang) {
79
- var wasmPages = 0;
80
- switch (lang) {
81
- case "nl":
82
- wasmPages = 41;
83
- break;
84
- case "de":
85
- wasmPages = 75;
86
- break;
87
- case "nb-no":
88
- wasmPages = 92;
89
- break;
90
- case "hu":
91
- wasmPages = 207;
92
- break;
93
- default:
94
- wasmPages = 32;
95
- }
96
- if (!H.specMems) {
97
- H.specMems = empty();
98
- }
99
- if (H.wasm) {
100
- H.specMems[lang] = new WebAssembly.Memory({
101
- "initial": wasmPages,
102
- "maximum": 256
103
- });
104
- } else {
105
- /* eslint-disable no-bitwise */
106
- /**
107
- * Polyfill Math.log2
108
- * @param {number} x argument
109
- * @return {number} Log2(x)
110
- */
111
- Math.log2 = Math.log2 || function polyfillLog2(x) {
112
- return Math.log(x) * Math.LOG2E;
113
- };
114
-
115
- var asmPages = (2 << Math.floor(Math.log2(wasmPages))) * 65536;
116
- /* eslint-enable no-bitwise */
117
- H.specMems[lang] = new ArrayBuffer(asmPages);
118
- }
119
- }
120
- /**
121
- * Set value and properties of object member
122
- * Argument <props> is a bit pattern:
123
- * 1. bit: configurable
124
- * 2. bit: enumerable
125
- * 3. bit writable
126
- * e.g. 011(2) = 3(10) => configurable: f, enumerable: t, writable: t
127
- * or 010(2) = 2(10) => configurable: f, enumerable: t, writable: f
128
- * @param {any} val The value
129
- * @param {number} props bitfield
130
- * @returns {Object} Property object
131
- */
132
- function setProp(val, props) {
133
- /* eslint-disable no-bitwise, sort-keys */
134
- return {
135
- "configurable": (props & 4) > 0,
136
- "enumerable": (props & 2) > 0,
137
- "writable": (props & 1) > 0,
138
- "value": val
139
- };
140
- /* eslint-enable no-bitwise, sort-keys */
141
- }
142
-
143
- var H = empty();
144
- H.binaries = empty();
145
- var loadedScripts = [];
146
-
147
- /**
148
- * Fetches a binary file and reads it as an array buffer.
149
- *
150
- * @param {string} path The path to the requested binary
151
- * @returns {Promise} A promise that resolves with an ArrayBuffer.
152
- */
153
- function loadBinary(path) {
154
- return new Promise(function (resolve, reject) {
155
- if (window.fetch) {
156
- window.fetch(path).then(function (response) {
157
- if (response.ok) {
158
- response.arrayBuffer().then(resolve);
159
- } else {
160
- reject(response.status);
161
- }
162
- }).catch(function () {
163
- reject("network failure");
164
- });
165
- } else {
166
- var xhr = new XMLHttpRequest();
167
- xhr.open('GET', path);
168
- xhr.responseType = "arraybuffer";
169
- xhr.onload = function () {
170
- if (xhr.status !== 200) {
171
- return reject(xhr.status);
172
- }
173
-
174
- if (!(xhr.response instanceof ArrayBuffer)) {
175
- return reject("The response for '" + path + "' is invalid. Expected ArrayBuffer.");
176
- }
177
-
178
- resolve(new Uint8Array(xhr.response).buffer);
179
- };
180
- xhr.send();
181
- }
182
- });
183
- }
184
-
185
- /**
186
- * Read a wasm file
187
- * @returns {undefined}
188
- */
189
- function loadWasm() {
190
- loadBinary(H.c.paths.maindir + 'hyphenEngine.wasm').then(function (responseBuffer) {
191
- H.binaries.hyphenEngine = responseBuffer;
192
- H.events.dispatch("engineLoaded", { "msg": "wasm" });
193
- }).catch(function (message) {
194
- H.events.dispatch("error", {
195
- "key": "hyphenEngine",
196
- "msg": H.c.paths.maindir + "hyphenEngine.wasm not found.\n" + message
197
- });
198
- });
199
- }
200
-
201
- /**
202
- * Read a asm file
203
- * @returns {undefined}
204
- */
205
- function loadAsm() {
206
- var fileName = "hyphenEngine.asm.js";
207
- if (!loadedScripts[fileName]) {
208
- var script = document.createElement("script");
209
- loadedScripts[fileName] = true;
210
- script.src = H.c.paths.maindir + fileName;
211
- script.addEventListener("load", function listener() {
212
- H.events.dispatch("engineLoaded", { "msg": "asm" });
213
- });
214
-
215
- document.head.appendChild(script);
216
- }
217
- }
218
-
219
- /**
220
- * Read a hpb file
221
- * @param {string} lang - The language
222
- * @returns {undefined}
223
- */
224
- function loadHpb(lang) {
225
- loadBinary(H.c.paths.patterndir + lang + ".hpb").then(function (responseBuffer) {
226
- H.binaries[lang] = responseBuffer;
227
- H.events.dispatch("hpbLoaded", { "msg": lang });
228
- hpb.push(lang);
229
- }).catch(function (message) {
230
- H.events.dispatch("error", {
231
- "key": lang,
232
- "msg": "" + H.c.paths.patterndir + lang + ".hpb not found.\n" + message
233
- });
234
- });
235
- }
236
-
237
- /**
238
- * Calculate heap size for wasm
239
- * wasm page size: 65536 = 64 Ki
240
- * @param {number} targetSize The targetet Size
241
- * @returns {number} The necessary heap size
242
- */
243
- function calculateHeapSize(targetSize) {
244
- return Math.ceil(targetSize / 65536) * 65536;
245
- }
246
-
247
- /**
248
- * Calculate Base Data
249
- *
250
- * Build Heap (the heap object's byteLength must be
251
- * either 2^n for n in [12, 24)
252
- * or 2^24 · n for n ≥ 1;)
253
- *
254
- * MEMORY LAYOUT:
255
- *
256
- * -------------------- <- Offset 0
257
- * | translateMap |
258
- * | keys: |
259
- * |256 chars * 2Bytes|
260
- * | + |
261
- * | values: |
262
- * |256 chars * 1Byte |
263
- * -------------------- <- 768 Bytes
264
- * | alphabet |
265
- * |256 chars * 2Bytes|
266
- * -------------------- <- valueStoreOffset = 1280
267
- * | valueStore |
268
- * | 1 Byte |
269
- * |* valueStoreLength|
270
- * --------------------
271
- * | align to 4Bytes |
272
- * -------------------- <- patternTrieOffset
273
- * | patternTrie |
274
- * | 4 Bytes |
275
- * |*patternTrieLength|
276
- * -------------------- <- wordOffset
277
- * | wordStore |
278
- * | Uint16[64] | 128 bytes
279
- * -------------------- <- translatedWordOffset
280
- * | transl.WordStore |
281
- * | Uint16[64] | 128 bytes
282
- * -------------------- <- hyphenPointsOffset
283
- * | hyphenPoints |
284
- * | Uint8[64] | 64 bytes
285
- * -------------------- <- hyphenatedWordOffset
286
- * | hyphenatedWord |
287
- * | Uint16[128] | 256 Bytes
288
- * -------------------- <- hpbOffset -
289
- * | HEADER | |
290
- * | 6*4 Bytes | |
291
- * | 24 Bytes | |
292
- * -------------------- |
293
- * | PATTERN LIC | |
294
- * | variable Length | |
295
- * -------------------- |
296
- * | align to 4Bytes | } this is the .hpb-file
297
- * -------------------- <- hpbTranslateOffset |
298
- * | TRANSLATE | |
299
- * | 2 + [0] * 2Bytes | |
300
- * -------------------- <- hpbPatternsOffset |
301
- * | PATTERNS | |
302
- * | patternsLength | |
303
- * -------------------- <- heapEnd -
304
- * | align to 4Bytes |
305
- * -------------------- <- heapSize
306
- * @param {Object} hpbBuf FileBuffer from .hpb-file
307
- * @returns {Object} baseData-object
308
- */
309
- function calculateBaseData(hpbBuf) {
310
- var hpbMetaData = new Uint32Array(hpbBuf).subarray(0, 8);
311
- var valueStoreLength = hpbMetaData[7];
312
- var valueStoreOffset = 1280;
313
- var patternTrieOffset = valueStoreOffset + valueStoreLength + (4 - (valueStoreOffset + valueStoreLength) % 4);
314
- var wordOffset = patternTrieOffset + hpbMetaData[6] * 4;
315
- return {
316
- "heapSize": Math.max(calculateHeapSize(wordOffset + 576 + hpbMetaData[2] + hpbMetaData[3]), 32 * 1024 * 64),
317
- "hpbOffset": wordOffset + 576,
318
- "hpbPatternsOffset": wordOffset + 576 + hpbMetaData[2],
319
- "hpbTranslateOffset": wordOffset + 576 + hpbMetaData[1],
320
- "hyphenatedWordOffset": wordOffset + 320,
321
- "hyphenPointsOffset": wordOffset + 256,
322
- "leftmin": hpbMetaData[4],
323
- "patternsLength": hpbMetaData[3],
324
- "patternTrieOffset": patternTrieOffset,
325
- "rightmin": hpbMetaData[5],
326
- "translatedWordOffset": wordOffset + 128,
327
- "valueStoreOffset": valueStoreOffset,
328
- "wordOffset": wordOffset
329
- };
330
- }
331
-
332
- /**
333
- * Convert exceptions to object
334
- * @param {string} exc comma separated list of exceptions
335
- * @returns {Object} Map of exceptions
336
- */
337
- function convertExceptions(exc) {
338
- var words = exc.split(", ");
339
- var r = empty();
340
- var l = words.length;
341
- var i = 0;
342
- var key = null;
343
- while (i < l) {
344
- key = words[i].replace(/-/g, "");
345
- if (!r[key]) {
346
- r[key] = words[i];
347
- }
348
- i += 1;
349
- }
350
- return r;
351
- }
352
-
353
- /**
354
- * Setup a language object (lo) and dispatch "engineReady"
355
- * @param {string} lang The language
356
- * @param {function} hyphenateFunction The hyphenateFunction
357
- * @param {string} alphabet List of used characters
358
- * @param {number} leftmin leftmin
359
- * @param {number} rightmin rightmin
360
- * @returns {undefined}
361
- */
362
- function prepareLanguagesObj(lang, hyphenateFunction, alphabet, leftmin, rightmin, supressEvent) {
363
- alphabet = alphabet.replace(/-/g, "");
364
- if (!H.languages) {
365
- H.languages = empty();
366
- }
367
- if (!H.languages[lang]) {
368
- H.languages[lang] = empty();
369
- }
370
- var lo = H.languages[lang];
371
- if (!lo.engineReady) {
372
- lo.cache = empty();
373
- if (H.c.exceptions.global) {
374
- if (H.c.exceptions[lang]) {
375
- H.c.exceptions[lang] += ", " + H.c.exceptions.global;
376
- } else {
377
- H.c.exceptions[lang] = H.c.exceptions.global;
378
- }
379
- }
380
- if (H.c.exceptions[lang]) {
381
- lo.exceptions = convertExceptions(H.c.exceptions[lang]);
382
- delete H.c.exceptions[lang];
383
- } else {
384
- lo.exceptions = empty();
385
- }
386
- lo.genRegExp = new RegExp("[\\w" + alphabet + String.fromCharCode(8204) + "-]{" + H.c.minWordLength + ",}", "gi");
387
- lo.leftmin = leftmin;
388
- lo.rightmin = rightmin;
389
- lo.hyphenateFunction = hyphenateFunction;
390
- lo.engineReady = true;
391
- }
392
- H.events.dispatch("engineReady", { "msg": lang });
393
- }
394
-
395
- /**
396
- * Create basic import Object
397
- * @param {Object} baseData baseData
398
- * @returns {Object} import object
399
- */
400
- function createImportObject(baseData) {
401
- return {
402
- "hpbPatternsOffset": baseData.hpbPatternsOffset,
403
- "hpbTranslateOffset": baseData.hpbTranslateOffset,
404
- "hyphenatedWordOffset": baseData.hyphenatedWordOffset,
405
- "hyphenPointsOffset": baseData.hyphenPointsOffset,
406
- "patternsLength": baseData.patternsLength,
407
- "patternTrieOffset": baseData.patternTrieOffset,
408
- "translatedWordOffset": baseData.translatedWordOffset,
409
- "valueStoreOffset": baseData.valueStoreOffset,
410
- "wordOffset": baseData.wordOffset
411
- };
412
- }
413
- /**
414
- * Setup env for hyphenateFunction
415
- * @param {Object} baseData baseData
416
- * @param {function} hyphenateFunc hyphenateFunction
417
- * @returns {function} hyphenateFunction with closured environment
418
- */
419
- function encloseHyphenateFunction(baseData, hyphenateFunc) {
420
- /* eslint-disable no-bitwise */
421
- var heapBuffer = H.wasm ? baseData.wasmMemory.buffer : baseData.heapBuffer;
422
- var wordOffset = baseData.wordOffset;
423
- var hyphenatedWordOffset = baseData.hyphenatedWordOffset;
424
- var wordStore = new Uint16Array(heapBuffer).subarray(wordOffset >> 1, (wordOffset >> 1) + 64);
425
- var defLeftmin = baseData.leftmin;
426
- var defRightmin = baseData.rightmin;
427
- var hyphenatedWordStore = new Uint16Array(heapBuffer).subarray(hyphenatedWordOffset >> 1, (hyphenatedWordOffset >> 1) + 64);
428
- /* eslint-enable no-bitwise */
429
-
430
- /**
431
- * The hyphenateFunction that encloses the env above
432
- * Copies the word to wasm-Memory, calls wasm.hyphenateFunc and reads
433
- * the hyphenated word from wasm-Memory (eventually replacing hyphenchar)
434
- * @param {String} word - the word that has to be hyphenated
435
- * @param {String} hyphenchar – the hyphenate character
436
- * @param {Number} leftmin – min number of chars to remain on line
437
- * @param {Number} rightmin – min number of chars to go to new line
438
- * @returns {String} the hyphenated word
439
- */
440
- return function hyphenate(word, hyphenchar, leftmin, rightmin) {
441
- var i = 0;
442
- var wordLength = word.length;
443
- leftmin = leftmin || defLeftmin;
444
- rightmin = rightmin || defRightmin;
445
- wordStore[0] = wordLength + 2;
446
- wordStore[1] = 95;
447
- while (i < wordLength) {
448
- wordStore[i + 2] = word.charCodeAt(i);
449
- i += 1;
450
- }
451
- wordStore[i + 2] = 95;
452
-
453
- if (hyphenateFunc(leftmin, rightmin) === 1) {
454
- i = 1;
455
- word = "";
456
- while (i < hyphenatedWordStore[0] + 1) {
457
- word += String.fromCharCode(hyphenatedWordStore[i]);
458
- i += 1;
459
- }
460
- if (hyphenchar !== SOFTHYPHEN) {
461
- word = word.replace(new RegExp(SOFTHYPHEN, "g"), hyphenchar);
462
- }
463
- }
464
- return word;
465
- };
466
- }
467
-
468
- /**
469
- * Instantiate Wasm Engine, then compute the pattern trie and
470
- * call prepareLanguagesObj.
471
- * @param {string} lang The language
472
- * @returns {undefined}
473
- */
474
- function instantiateWasmEngine(lang) {
475
- var baseData = calculateBaseData(H.binaries[lang]);
476
-
477
- var wasmMemory;
478
- if (H.specMems[lang] && H.specMems[lang].buffer.byteLength >= baseData.heapSize) {
479
- wasmMemory = H.specMems[lang];
480
- } else {
481
- wasmMemory = new WebAssembly.Memory({
482
- "initial": baseData.heapSize / 65536,
483
- "maximum": 256
484
- });
485
- }
486
-
487
- var ui32wasmMemory = new Uint32Array(wasmMemory.buffer);
488
- ui32wasmMemory.set(new Uint32Array(H.binaries[lang]),
489
- // eslint-disable-next-line no-bitwise
490
- baseData.hpbOffset >> 2);
491
- baseData.wasmMemory = wasmMemory;
492
- WebAssembly.instantiate(H.binaries.hyphenEngine, {
493
- "env": {
494
- "memory": baseData.wasmMemory,
495
- "memoryBase": 0
496
- },
497
- "ext": {
498
- "hpbPatternsOffset": baseData.hpbPatternsOffset,
499
- "hpbTranslateOffset": baseData.hpbTranslateOffset,
500
- "hyphenatedWordOffset": baseData.hyphenatedWordOffset,
501
- "hyphenPointsOffset": baseData.hyphenPointsOffset,
502
- "patternsLength": baseData.patternsLength,
503
- "patternTrieOffset": baseData.patternTrieOffset,
504
- "translatedWordOffset": baseData.translatedWordOffset,
505
- "valueStoreOffset": baseData.valueStoreOffset,
506
- "wordOffset": baseData.wordOffset
507
- }
508
- }).then(function runWasm(result) {
509
- result.instance.exports.convert();
510
- prepareLanguagesObj(lang, encloseHyphenateFunction(baseData, result.instance.exports.hyphenate), decode(new Uint16Array(wasmMemory.buffer).subarray(384, 640)), baseData.leftmin, baseData.rightmin);
511
- }).catch(function (oError) {
512
- console.warn(oError);
513
- });
514
- }
515
- /**
516
- * Instantiate asm Engine
517
- * @param {string} lang The language
518
- * @returns {undefined}
519
- */
520
- function instantiateAsmEngine(lang) {
521
- var hpbBuf = H.binaries[lang];
522
- var baseData = calculateBaseData(hpbBuf);
523
- var heapBuffer = H.specMems[lang].byteLength >= baseData.heapSize ? H.specMems[lang] : new ArrayBuffer(baseData.heapSize);
524
- var ui8Heap = new Uint8Array(heapBuffer);
525
- var ui8Patterns = new Uint8Array(hpbBuf);
526
- ui8Heap.set(ui8Patterns, baseData.hpbOffset);
527
- baseData.heapBuffer = heapBuffer;
528
- var theHyphenEngine = asmHyphenEngine({
529
- "Int32Array": window.Int32Array,
530
- "Math": Math,
531
- "Uint16Array": window.Uint16Array,
532
- "Uint8Array": window.Uint8Array
533
- }, createImportObject(baseData), baseData.heapBuffer);
534
- theHyphenEngine.convert();
535
-
536
- setTimeout(function () {
537
- prepareLanguagesObj(lang, encloseHyphenateFunction(baseData, theHyphenEngine.hyphenate), decode(new Uint16Array(heapBuffer).subarray(384, 640)), baseData.leftmin, baseData.rightmin);
538
- }, 0);
539
- }
540
-
541
- var engineInstantiator = null;
542
- var hpb = [];
543
-
544
- /**
545
- * Instantiate hyphenEngines for languages
546
- * @param {string} lang The language
547
- * @returns {undefined}
548
- */
549
- function prepare(lang, engineType) {
550
- if (lang === "*") {
551
- if (engineType === "wasm") {
552
- engineInstantiator = instantiateWasmEngine;
553
- } else if (engineType === "asm") {
554
- engineInstantiator = instantiateAsmEngine;
555
- }
556
-
557
- hpb.forEach(function eachHbp(hpbLang) {
558
- engineInstantiator(hpbLang);
559
- });
560
- } else if (engineInstantiator) {
561
- engineInstantiator(lang);
562
- } else {
563
- hpb.push(lang);
564
- }
565
- }
566
-
567
- var wordHyphenatorPool = empty();
568
-
569
- /**
570
- * Factory for hyphenatorFunctions for a specific language and class
571
- * @param {Object} lo Language-Object
572
- * @param {string} lang The language
573
- * @returns {function} The hyphenate function
574
- */
575
- function createWordHyphenator(lo, lang) {
576
- lo.cache = empty();
577
-
578
- /**
579
- * HyphenateFunction for compound words
580
- * @param {string} word The word
581
- * @returns {string} The hyphenated compound word
582
- */
583
- function hyphenateCompound(word) {
584
- var zeroWidthSpace = String.fromCharCode(8203);
585
- var parts = null;
586
- var i = 0;
587
- var wordHyphenator = null;
588
- var hw = word;
589
- switch (H.c.compound) {
590
- case "auto":
591
- parts = word.split("-");
592
- wordHyphenator = createWordHyphenator(lo, lang);
593
- while (i < parts.length) {
594
- if (parts[i].length >= H.c.minWordLength) {
595
- parts[i] = wordHyphenator(parts[i]);
596
- }
597
- i += 1;
598
- }
599
- hw = parts.join("-");
600
- break;
601
- case "all":
602
- parts = word.split("-");
603
- wordHyphenator = createWordHyphenator(lo, lang);
604
- while (i < parts.length) {
605
- if (parts[i].length >= H.c.minWordLength) {
606
- parts[i] = wordHyphenator(parts[i]);
607
- }
608
- i += 1;
609
- }
610
- hw = parts.join("-" + zeroWidthSpace);
611
- break;
612
- default:
613
- hw = word.replace("-", "-" + zeroWidthSpace);
614
- }
615
- return hw;
616
- }
617
-
618
- /**
619
- * HyphenateFunction for words (compound or not)
620
- * @param {string} word The word
621
- * @returns {string} The hyphenated word
622
- */
623
- function hyphenator(word) {
624
- var hw = lo.cache[word];
625
- if (!hw) {
626
- if (lo.exceptions[word]) {
627
- hw = lo.exceptions[word].replace(/-/g, H.c.hyphen);
628
- } else if (word.indexOf("-") === -1) {
629
- hw = lo.hyphenateFunction(word, H.c.hyphen, H.c.leftmin, H.c.rightmin);
630
- } else {
631
- hw = hyphenateCompound(word);
632
- }
633
- lo.cache[word] = hw;
634
- }
635
- return hw;
636
- }
637
-
638
- wordHyphenatorPool[lang] = hyphenator;
639
- return hyphenator;
640
- }
641
-
642
- var orphanController = function createOrphanController() {
643
- /**
644
- * Function template
645
- * @param {string} ignore unused result of replace
646
- * @param {string} leadingWhiteSpace The leading whiteSpace
647
- * @param {string} lastWord The last word
648
- * @param {string} trailingWhiteSpace The trailing whiteSpace
649
- * @returns {string} Treated end of text
650
- */
651
- function controlOrphans(ignore, leadingWhiteSpace, lastWord, trailingWhiteSpace) {
652
- var h = H.c.hyphen;
653
- if (".\\+*?[^]$(){}=!<>|:-".indexOf(H.c.hyphen) !== -1) {
654
- h = "\\" + H.c.hyphen;
655
- }
656
- if (H.c.orphanControl === 3 && leadingWhiteSpace === " ") {
657
- leadingWhiteSpace = String.fromCharCode(160);
658
- }
659
- return leadingWhiteSpace + lastWord.replace(new RegExp(h, "g"), "") + trailingWhiteSpace;
660
- }
661
-
662
- return controlOrphans;
663
- }();
664
-
665
- /**
666
- * Encloses hyphenateTextFunction
667
- * @param {string} lang - The language
668
- * @return {function} The hyphenateText-function
669
- */
670
- function createTextHyphenator(lang) {
671
- var lo = H.languages[lang];
672
- var wordHyphenator = wordHyphenatorPool[lang] ? wordHyphenatorPool[lang] : createWordHyphenator(lo, lang);
673
-
674
- /**
675
- * Hyphenate text
676
- * @param {string} text The text
677
- * @param {string} lang The language of the text
678
- * @returns {string} Hyphenated text
679
- */
680
- return function hyphenateText(text) {
681
- if (H.c.normalize) {
682
- text = text.normalize("NFC");
683
- }
684
- var tn = text.replace(lo.genRegExp, wordHyphenator);
685
- if (H.c.orphanControl !== 1) {
686
- tn = tn.replace(/(\u0020*)(\S+)(\s*)$/, orphanController);
687
- }
688
- return tn;
689
- };
690
- }
691
-
692
- (function setupEvents() {
693
- // Events known to the system
694
- var definedEvents = empty();
695
-
696
- /**
697
- * Create Event Object
698
- * @param {string} name The Name of the event
699
- * @param {function|null} defFunc The default method of the event
700
- * @param {boolean} cancellable Is the default cancellable
701
- * @returns {undefined}
702
- */
703
- function define(name, defFunc, cancellable) {
704
- definedEvents[name] = {
705
- "cancellable": cancellable,
706
- "default": defFunc,
707
- "register": []
708
- };
709
- }
710
-
711
- define("error", function def(e) {
712
- console.error(e.msg);
713
- }, true);
714
-
715
- define("engineLoaded", function def(e) {
716
- prepare("*", e.msg);
717
- }, false);
718
-
719
- define("hpbLoaded", function def(e) {
720
- prepare(e.msg);
721
- }, false);
722
-
723
- define("engineReady", null, false);
724
-
725
- /**
726
- * Dispatch error <name> with arguments <data>
727
- * @param {string} name The name of the event
728
- * @param {Object|undefined} data Data of the event
729
- * @returns {undefined}
730
- */
731
- function dispatch(name, data) {
732
- if (!data) {
733
- data = empty();
734
- }
735
- data.defaultPrevented = false;
736
- data.preventDefault = function preventDefault() {
737
- if (definedEvents[name].cancellable) {
738
- data.defaultPrevented = true;
739
- }
740
- };
741
- definedEvents[name].register.forEach(function call(currentHandler) {
742
- currentHandler(data);
743
- });
744
- if (!data.defaultPrevented && definedEvents[name].default) {
745
- definedEvents[name].default(data);
746
- }
747
- }
748
-
749
- /**
750
- * Add EventListender <handler> to event <name>
751
- * @param {string} name The name of the event
752
- * @param {function} handler Function to register
753
- * @returns {undefined}
754
- */
755
- function addListener(name, handler) {
756
- if (definedEvents[name]) {
757
- definedEvents[name].register.push(handler);
758
- } else {
759
- H.events.dispatch("error", { "msg": "unknown Event \"" + name + "\" discarded" });
760
- }
761
- }
762
- /**
763
- * Add EventListender <handler> to event <name>
764
- * @param {string} name The name of the event
765
- * @param {function} handler Function to register
766
- * @returns {undefined}
767
- */
768
- function removeListener(name, handler) {
769
- if (definedEvents[name]) {
770
- var index = definedEvents[name].register.indexOf(handler);
771
- definedEvents[name].register.splice(index, 1);
772
- } else {
773
- H.events.dispatch("error", { "msg": "unknown Event \"" + name + "\" discarded" });
774
- }
775
- }
776
-
777
- H.events = empty();
778
- H.events.dispatch = dispatch;
779
- H.events.define = define;
780
- H.events.addListener = addListener;
781
- H.events.removeListener = removeListener;
782
- })();
783
- function constuctDefaults(userConfig) {
784
- var defaults = Object.create(null, {
785
- "compound": setProp("hyphen", 2),
786
- "exceptions": setProp(empty(), 2),
787
- "hyphen": setProp(SOFTHYPHEN, 2),
788
- "leftmin": setProp(0, 2),
789
- "minWordLength": setProp(6, 2),
790
- "normalize": setProp(false, 2),
791
- "orphanControl": setProp(1, 2),
792
- "paths": setProp(Object.create(null, {
793
- "maindir": setProp(userConfig.path + "/", 2),
794
- "patterndir": setProp(userConfig.path + "/patterns/", 2)
795
- }), 2),
796
- "require": setProp([], 2),
797
- "rightmin": setProp(0, 2)
798
- });
799
- var settings = Object.create(defaults);
800
- Object.keys(userConfig).forEach(function each(key) {
801
- Object.defineProperty(settings, key, setProp(userConfig[key], 3));
802
- });
803
- return settings;
804
- }
805
- function createPromise(lang) {
806
- return new Promise(function pro(resolve, reject) {
807
- H.events.addListener("engineReady", function handler(e) {
808
- if (e.msg === lang) {
809
- H.events.removeListener("engineReady", handler);
810
- resolve(createTextHyphenator(lang));
811
- }
812
- });
813
- H.events.addListener("error", function handler(e) {
814
- e.preventDefault();
815
- if (e.key === lang || e.key === "hyphenEngine") {
816
- reject(e.msg);
817
- }
818
- });
819
- });
820
- }
821
- H.reInitializeLanguage = function reinit(lang, userConfig) {
822
- H.c = constuctDefaults(userConfig);
823
- H.languages[lang].engineReady = false;
824
- wordHyphenatorPool[lang] = null;
825
- engineInstantiator(lang);
826
- return createPromise(lang);
827
- };
828
- H.initializeLanguage = function config(userConfig) {
829
-
830
- H.c = constuctDefaults(userConfig);
831
- if (H.c.handleEvent) {
832
- Object.keys(H.c.handleEvent).forEach(function add(name) {
833
- H.events.addListener(name, H.c.handleEvent[name]);
834
- });
835
- }
836
- //Check For WebAssembly support
837
-
838
- H.wasm = window.WebAssembly != null;
839
- if (!engineInstantiator) {
840
- H.wasm ? loadWasm() : loadAsm();
841
- }
842
- var result = new Map();
843
- if (H.c.require.length === 0) {
844
- H.events.dispatch("error", { "msg": "No language has been required. Setup config according to documenation." });
845
- }
846
- H.c.require.forEach(function each(lang) {
847
- if (hpb.indexOf(lang) == -1) {
848
- loadHpb(lang);
849
- allocateMemory(lang);
850
- result.set(lang, createPromise(lang));
851
- }
852
- });
853
- return result.size === 1 ? result.get(H.c.require[0]) : result;
854
- };
855
-
856
- module.exports = H;
857
- }, {}], 2: [function (require, module, exports) {
858
- var hyphenopoly = require('./hyphenopoly.browser');
859
- window.hyphenopoly = hyphenopoly;
860
- }, { "./hyphenopoly.browser": 1 }] }, {}, [2]);