@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.
- package/.eslintrc.json +13 -2
- package/.reuse/dep5 +6 -11
- package/THIRDPARTY.txt +10 -16
- package/package.json +1 -1
- package/src/jquery.sap.global.js +5 -2
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/jquery.sap.stubs.js +2 -1
- package/src/jquery.sap.trace.js +2 -1
- package/src/sap/base/i18n/ResourceBundle.js +6 -2
- package/src/sap/base/strings/whitespaceReplacer.js +52 -0
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +37 -42
- package/src/sap/ui/Global.js +8 -7
- package/src/sap/ui/base/DataType.js +14 -8
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/ExpressionParser.js +9 -6
- package/src/sap/ui/base/Interface.js +3 -49
- package/src/sap/ui/base/ManagedObject.js +12 -7
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +49 -4
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/base/syncXHRFix.js +2 -1
- package/src/sap/ui/core/.library +5 -5
- package/src/sap/ui/core/AppCacheBuster.js +4 -4
- package/src/sap/ui/core/BusyIndicator.js +1 -11
- package/src/sap/ui/core/Component.js +300 -140
- package/src/sap/ui/core/ComponentContainer.js +24 -8
- package/src/sap/ui/core/ComponentMetadata.js +14 -3
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +67 -31
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +103 -25
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/CustomizingConfiguration.js +35 -260
- package/src/sap/ui/core/DeclarativeSupport.js +3 -2
- package/src/sap/ui/core/Element.js +1 -1
- package/src/sap/ui/core/ElementMetadata.js +4 -2
- package/src/sap/ui/core/EnabledPropagator.js +91 -73
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/ExtensionPoint.js +7 -14
- package/src/sap/ui/core/Fragment.js +30 -32
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +7 -8
- package/src/sap/ui/core/IconPool.js +26 -1097
- package/src/sap/ui/core/IconRenderer.js +6 -6
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +26 -4
- package/src/sap/ui/core/LocaleData.js +1 -1
- package/src/sap/ui/core/Manifest.js +4 -61
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Patcher.js +27 -3
- package/src/sap/ui/core/Placeholder.js +28 -15
- package/src/sap/ui/core/RenderManager.js +36 -6
- package/src/sap/ui/core/Renderer.js +13 -3
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +2 -2
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ShortcutHintsMixin.js +14 -7
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +42 -16
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +2 -2
- package/src/sap/ui/core/XMLCompositeMetadata.js +2 -2
- package/src/sap/ui/core/XMLTemplateProcessor.js +116 -41
- package/src/sap/ui/core/_IconRegistry.js +1148 -0
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +6 -3
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +2 -2
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/NumberFormat.js +16 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +73 -221
- package/src/sap/ui/core/hyphenation/HyphenationTestingWords.js +11 -10
- package/src/sap/ui/core/library.js +3 -3
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +13 -15
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_de.properties +1 -1
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/messagebundle_it.properties +1 -1
- package/src/sap/ui/core/messagebundle_pl.properties +1 -1
- package/src/sap/ui/core/messagebundle_th.properties +2 -2
- package/src/sap/ui/core/mvc/Controller.js +38 -19
- package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +30 -32
- package/src/sap/ui/core/mvc/ControllerMetadata.js +18 -18
- package/src/sap/ui/core/mvc/HTMLView.js +2 -2
- package/src/sap/ui/core/mvc/JSONView.js +2 -2
- package/src/sap/ui/core/mvc/JSView.js +2 -2
- package/src/sap/ui/core/mvc/TemplateView.js +2 -2
- package/src/sap/ui/core/mvc/View.js +58 -85
- package/src/sap/ui/core/mvc/XMLView.js +2 -2
- package/src/sap/ui/core/mvc/XMLViewRenderer.js +17 -20
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/History.js +10 -2
- package/src/sap/ui/core/routing/Router.js +8 -1
- package/src/sap/ui/core/routing/Target.js +13 -0
- package/src/sap/ui/core/routing/Targets.js +13 -2
- package/src/sap/ui/core/routing/async/Route.js +1 -1
- package/src/sap/ui/core/routing/async/Target.js +353 -259
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/BootSupportTool.js +11 -0
- package/src/sap/ui/core/support/InteractionTree.css +4 -0
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/ViewInfo.css +599 -0
- package/src/sap/ui/core/support/controls/InteractionTree.js +352 -222
- package/src/sap/ui/core/support/controls/ObjectViewer.js +3 -41
- package/src/sap/ui/core/support/controls/TimelineOverview.js +49 -24
- package/src/sap/ui/core/support/controls/TreeViewer.js +12 -58
- package/src/sap/ui/core/support/plugins/ControlTree.js +59 -68
- package/src/sap/ui/core/support/plugins/Debugging.js +9 -11
- package/src/sap/ui/core/support/plugins/Interaction.js +2 -2
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +147 -75
- package/src/sap/ui/core/support/plugins/Selector.js +19 -24
- package/src/sap/ui/core/support/plugins/TechInfo.js +5 -5
- package/src/sap/ui/core/support/plugins/Trace.js +95 -32
- package/src/sap/ui/core/support/plugins/ViewInfo.js +9 -73
- package/src/sap/ui/core/support/support.css +109 -14
- package/src/sap/ui/core/support/support.html +6 -2
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.fragment.xml +1 -0
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +149 -72
- package/src/sap/ui/core/themes/base/Icon.less +9 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +6 -4
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +10 -28
- package/src/sap/ui/core/tmpl/TemplateControl.js +4 -4
- package/src/sap/ui/core/tmpl/_parsePath.js +35 -0
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/DraftEnabledMockServer.js +9 -4
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +5 -5
- package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +3 -2
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/XMLPreprocessor.js +11 -12
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +136 -63
- package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +170 -153
- package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +424 -293
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +10 -4
- package/src/sap/ui/debug/DebugEnv.js +3 -4
- package/src/sap/ui/debug/Highlighter.js +8 -2
- package/src/sap/ui/debug/PropertyList.css +55 -0
- package/src/sap/ui/debug/PropertyList.js +111 -182
- package/src/sap/ui/model/Binding.js +174 -118
- package/src/sap/ui/model/ClientContextBinding.js +1 -1
- package/src/sap/ui/model/ClientListBinding.js +1 -3
- package/src/sap/ui/model/ClientModel.js +4 -4
- package/src/sap/ui/model/ClientPropertyBinding.js +4 -2
- package/src/sap/ui/model/ClientTreeBinding.js +15 -9
- package/src/sap/ui/model/ClientTreeBindingAdapter.js +28 -23
- package/src/sap/ui/model/CompositeBinding.js +98 -77
- package/src/sap/ui/model/CompositeDataState.js +2 -2
- package/src/sap/ui/model/CompositeType.js +2 -2
- package/src/sap/ui/model/Context.js +4 -2
- package/src/sap/ui/model/ContextBinding.js +6 -14
- package/src/sap/ui/model/DataState.js +2 -2
- package/src/sap/ui/model/Filter.js +255 -53
- package/src/sap/ui/model/FilterOperator.js +1 -1
- package/src/sap/ui/model/FilterProcessor.js +27 -17
- package/src/sap/ui/model/FilterType.js +1 -1
- package/src/sap/ui/model/ListBinding.js +180 -117
- package/src/sap/ui/model/MetaModel.js +4 -9
- package/src/sap/ui/model/Model.js +345 -294
- package/src/sap/ui/model/PropertyBinding.js +92 -58
- package/src/sap/ui/model/SelectionModel.js +2 -2
- package/src/sap/ui/model/SimpleType.js +2 -2
- package/src/sap/ui/model/Sorter.js +1 -1
- package/src/sap/ui/model/SorterProcessor.js +1 -1
- package/src/sap/ui/model/StaticBinding.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +2 -2
- package/src/sap/ui/model/TreeBinding.js +1 -1
- package/src/sap/ui/model/TreeBindingAdapter.js +251 -100
- package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +16 -9
- package/src/sap/ui/model/TreeBindingUtils.js +1 -0
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +8 -4
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +1 -1
- package/src/sap/ui/model/analytics/BatchResponseCollector.js +1 -1
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +1 -1
- package/src/sap/ui/model/analytics/odata4analytics.js +34 -25
- package/src/sap/ui/model/base/ManagedObjectModel.js +4 -0
- package/src/sap/ui/model/json/JSONListBinding.js +8 -5
- package/src/sap/ui/model/json/JSONModel.js +24 -15
- package/src/sap/ui/model/json/JSONPropertyBinding.js +4 -3
- package/src/sap/ui/model/json/JSONTreeBinding.js +1 -1
- package/src/sap/ui/model/message/MessageListBinding.js +6 -3
- package/src/sap/ui/model/message/MessageModel.js +23 -15
- package/src/sap/ui/model/message/MessagePropertyBinding.js +2 -2
- package/src/sap/ui/model/odata/AnnotationHelper.js +1 -1
- package/src/sap/ui/model/odata/AnnotationParser.js +1 -1
- package/src/sap/ui/model/odata/CountMode.js +1 -1
- package/src/sap/ui/model/odata/Filter.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +2 -2
- package/src/sap/ui/model/odata/ODataContextBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataListBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
- package/src/sap/ui/model/odata/ODataMetaModel.js +5 -3
- package/src/sap/ui/model/odata/ODataMetadata.js +2 -2
- package/src/sap/ui/model/odata/ODataModel.js +8 -7
- package/src/sap/ui/model/odata/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBinding.js +65 -33
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +2 -2
- package/src/sap/ui/model/odata/ODataUtils.js +13 -11
- package/src/sap/ui/model/odata/OperationMode.js +1 -1
- package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +81 -9
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +3 -3
- package/src/sap/ui/model/odata/v2/ODataContextBinding.js +39 -49
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +236 -73
- package/src/sap/ui/model/odata/v2/ODataModel.js +314 -164
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +110 -97
- package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +129 -0
- package/src/sap/ui/model/odata/v4/Context.js +6 -3
- package/src/sap/ui/model/odata/v4/ODataBinding.js +5 -6
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +117 -40
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +95 -15
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +44 -31
- package/src/sap/ui/model/odata/v4/ODataModel.js +86 -78
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +47 -28
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +11 -7
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +10 -3
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +8 -1
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +24 -16
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +32 -30
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +52 -17
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +2 -2
- package/src/sap/ui/model/resource/ResourceModel.js +6 -2
- package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +2 -2
- package/src/sap/ui/model/type/Currency.js +2 -2
- package/src/sap/ui/model/type/Date.js +9 -3
- package/src/sap/ui/model/type/DateInterval.js +4 -2
- package/src/sap/ui/model/type/DateTime.js +2 -2
- package/src/sap/ui/model/type/DateTimeInterval.js +2 -2
- package/src/sap/ui/model/type/FileSize.js +4 -2
- package/src/sap/ui/model/type/Float.js +4 -2
- package/src/sap/ui/model/type/Integer.js +4 -2
- package/src/sap/ui/model/type/String.js +2 -2
- package/src/sap/ui/model/type/Time.js +2 -2
- package/src/sap/ui/model/type/TimeInterval.js +2 -2
- package/src/sap/ui/model/type/Unit.js +14 -7
- package/src/sap/ui/model/xml/XMLListBinding.js +15 -9
- package/src/sap/ui/model/xml/XMLModel.js +70 -41
- package/src/sap/ui/model/xml/XMLPropertyBinding.js +4 -4
- package/src/sap/ui/model/xml/XMLTreeBinding.js +5 -4
- package/src/sap/ui/performance/trace/Interaction.js +30 -15
- package/src/sap/ui/performance/trace/initTraces.js +1 -1
- package/src/sap/ui/qunit/QUnitUtils.js +3 -2
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +9 -11
- package/src/sap/ui/test/TestUtils.js +11 -4
- package/src/sap/ui/test/actions/Drag.js +6 -2
- package/src/sap/ui/test/actions/Drop.js +6 -2
- package/src/sap/ui/test/actions/EnterText.js +6 -0
- package/src/sap/ui/test/actions/Press.js +6 -0
- package/src/sap/ui/test/actions/Scroll.js +6 -0
- package/src/sap/ui/test/autowaiter/_resourceWaiter.js +4 -4
- package/src/sap/ui/test/launchers/componentLauncher.js +0 -4
- package/src/sap/ui/test/matchers/I18NText.js +29 -11
- package/src/sap/ui/test/opaQunit.js +5 -0
- package/src/sap/ui/thirdparty/crossroads.js +6 -4
- package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly.js +1196 -0
- package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly_Loader.js +797 -0
- package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.asm.js +108 -127
- package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.wasm +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/bg.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/ca.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/da.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/de.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/el-monoton.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/en-us.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/es.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/et.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/fi.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/fr.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/hi.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/hr.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/hu.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/it.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/lt.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/nb-no.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/nl.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/pt.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/ru.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/sl.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/sv.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/th.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/tr.hpb +0 -0
- package/src/sap/ui/thirdparty/hyphenopoly/patterns/uk.hpb +0 -0
- package/src/sap/ui/thirdparty/jquery.js +9 -1
- package/src/sap/ui/thirdparty/qunit-2.js +1 -1
- package/src/sap/ui/thirdparty/qunit.js +1 -1
- package/src/sap/ui/util/Mobile.js +2 -20
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap/ui/util/isCrossOriginURL.js +16 -6
- package/src/sap-ui-core-nojQuery.js +1 -1
- package/src/sap-ui-core.js +1 -1
- package/src/sap-ui-debug.js +3 -17
- package/ui5.yaml +5 -2
- package/src/sap/ui/core/support/plugins/MessageTest.js +0 -96
- package/src/sap/ui/thirdparty/hyphenopoly/hyphenopoly.bundle.js +0 -860
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Hyphenopoly_Loader 3.4.0 - client side hyphenation
|
|
3
|
+
* ©2019 Mathias Nater, Zürich (mathiasnater at gmail dot com)
|
|
4
|
+
* https://github.com/mnater/Hyphenopoly
|
|
5
|
+
*
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
* http://mnater.github.io/Hyphenopoly/LICENSE
|
|
8
|
+
* Modifications SAP SE or an SAP affiliate company and OpenUI5 contributors. All rights reserved.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* globals Hyphenopoly:readonly */
|
|
12
|
+
/**
|
|
13
|
+
* Wrap all code in an iife to keep a scope. Important objects are parameters
|
|
14
|
+
* of this iife to keep codesize low.
|
|
15
|
+
* @param {Object} w shorthand for window
|
|
16
|
+
* @param {Object} d shorthand for document
|
|
17
|
+
* @param {Object} H shorthand for Hyphenopoly
|
|
18
|
+
* @param {Object} o shorthand for object
|
|
19
|
+
*/
|
|
20
|
+
(function H9YL(w, d, H, o) {
|
|
21
|
+
|
|
22
|
+
"use strict";
|
|
23
|
+
|
|
24
|
+
var store = sessionStorage;
|
|
25
|
+
var wa = w.WebAssembly;
|
|
26
|
+
var lcFallbacks = new Map();
|
|
27
|
+
var lcRequire = new Map();
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create Object without standard Object-prototype
|
|
31
|
+
* @returns {Object} empty object
|
|
32
|
+
*/
|
|
33
|
+
function empty() {
|
|
34
|
+
return o.create(null);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Shorthand for Object.keys(obj).forEach(function () {})
|
|
40
|
+
* @param {Object} obj the object to iterate
|
|
41
|
+
* @param {function} fn the function to execute
|
|
42
|
+
* @returns {undefined}
|
|
43
|
+
*/
|
|
44
|
+
function eachKey(obj, fn) {
|
|
45
|
+
o.keys(obj).forEach(fn);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set H.cf (Hyphenopoly.clientFeatures) either by reading out previously
|
|
50
|
+
* computed settings from sessionStorage or creating an template object.
|
|
51
|
+
* This is in an iife to keep complexity low.
|
|
52
|
+
*/
|
|
53
|
+
(function configFeat() {
|
|
54
|
+
if (H.cacheFeatureTests && store.getItem("Hyphenopoly_Loader")) {
|
|
55
|
+
H.cf = JSON.parse(store.getItem("Hyphenopoly_Loader"));
|
|
56
|
+
} else {
|
|
57
|
+
H.cf = {
|
|
58
|
+
"langs": empty(),
|
|
59
|
+
"polyfill": false,
|
|
60
|
+
"wasm": null
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}());
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set H.paths defaults or overwrite with user settings.
|
|
67
|
+
* This is in an iife to keep complexity low.
|
|
68
|
+
*/
|
|
69
|
+
(function configPaths() {
|
|
70
|
+
var maindir = (d.currentScript)
|
|
71
|
+
? d.currentScript.src.replace(/Hyphenopoly_Loader.js/i, "")
|
|
72
|
+
: "../";
|
|
73
|
+
var patterndir = maindir + "patterns/";
|
|
74
|
+
if (H.paths) {
|
|
75
|
+
H.paths.maindir = H.paths.maindir || maindir;
|
|
76
|
+
H.paths.patterndir = H.paths.patterndir || patterndir;
|
|
77
|
+
} else {
|
|
78
|
+
H.paths = o.create({
|
|
79
|
+
"maindir": maindir,
|
|
80
|
+
"patterndir": patterndir
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}());
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Set some H.setup fields to defaults or overwrite with user settings.
|
|
87
|
+
* This is in an iife to keep complexity low.
|
|
88
|
+
*/
|
|
89
|
+
(function configSetup() {
|
|
90
|
+
if (H.setup) {
|
|
91
|
+
H.setup.selectors = H.setup.selectors || {".hyphenate": {}};
|
|
92
|
+
H.setup.timeout = H.setup.timeout || 1000;
|
|
93
|
+
H.setup.hide = H.setup.hide || "all";
|
|
94
|
+
} else {
|
|
95
|
+
H.setup = {
|
|
96
|
+
"hide": "all",
|
|
97
|
+
"selectors": {".hyphenate": {}},
|
|
98
|
+
"timeout": 1000
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}());
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Copy required languages to local lcRequire and
|
|
105
|
+
* eventually fallbacks to local lcFallbacks.
|
|
106
|
+
* This is in an iife to keep complexity low.
|
|
107
|
+
*/
|
|
108
|
+
(function configRequire() {
|
|
109
|
+
eachKey(H.require, function copyRequire(k) {
|
|
110
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
111
|
+
lcRequire.set(k.toLowerCase(), H.require[k]);
|
|
112
|
+
});
|
|
113
|
+
if (H.fallbacks) {
|
|
114
|
+
eachKey(H.fallbacks, function copyFallbacks(k) {
|
|
115
|
+
lcFallbacks.set(
|
|
116
|
+
k.toLowerCase(),
|
|
117
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
118
|
+
H.fallbacks[k].toLowerCase()
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}());
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Define function H.toggle.
|
|
126
|
+
* This function hides or unhides (depending of the parameter state)
|
|
127
|
+
* the whole document (H.setup.hide == "all") or
|
|
128
|
+
* each selected element (H.setup.hide == "element") or
|
|
129
|
+
* text of each selected element (H.setup.hide == "text")
|
|
130
|
+
* @param {string} state State: either on (visible) or off (hidden)
|
|
131
|
+
*/
|
|
132
|
+
H.toggle = function toggle(state) {
|
|
133
|
+
if (state === "on") {
|
|
134
|
+
var stylesNode = d.getElementById("H9Y_Styles");
|
|
135
|
+
if (stylesNode) {
|
|
136
|
+
stylesNode.parentNode.removeChild(stylesNode);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
var vis = " {visibility: hidden !important}\n";
|
|
140
|
+
var sc = d.createElement("style");
|
|
141
|
+
var myStyle = "";
|
|
142
|
+
sc.id = "H9Y_Styles";
|
|
143
|
+
switch (H.setup.hide) {
|
|
144
|
+
case "all":
|
|
145
|
+
myStyle = "html" + vis;
|
|
146
|
+
break;
|
|
147
|
+
case "element":
|
|
148
|
+
eachKey(H.setup.selectors, function eachSelector(sel) {
|
|
149
|
+
myStyle += sel + vis;
|
|
150
|
+
});
|
|
151
|
+
break;
|
|
152
|
+
case "text":
|
|
153
|
+
eachKey(H.setup.selectors, function eachSelector(sel) {
|
|
154
|
+
myStyle += sel + " {color: transparent !important}\n";
|
|
155
|
+
});
|
|
156
|
+
break;
|
|
157
|
+
// No Default
|
|
158
|
+
}
|
|
159
|
+
sc.appendChild(d.createTextNode(myStyle));
|
|
160
|
+
d.head.appendChild(sc);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Setup basic event system. Some events are defined but the definition of
|
|
166
|
+
* what happens when they are triggered is deferred to Hyphenopoly.js
|
|
167
|
+
* This is in an iife to keep complexity low.
|
|
168
|
+
*/
|
|
169
|
+
(function setupEvents() {
|
|
170
|
+
// Events known to the system
|
|
171
|
+
var definedEvents = new Map();
|
|
172
|
+
// Default events, execution deferred to Hyphenopoly.js
|
|
173
|
+
var deferred = [];
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* Register for custom event handlers, where event is not yet defined
|
|
177
|
+
* these events will be correctly registered in Hyphenopoly.js
|
|
178
|
+
*/
|
|
179
|
+
var tempRegister = [];
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Create Event Object
|
|
183
|
+
* @param {string} name The Name of the event
|
|
184
|
+
* @param {function} defFunc The default method of the event
|
|
185
|
+
* @param {boolean} cancellable Is the default cancellable
|
|
186
|
+
* @returns {undefined}
|
|
187
|
+
*/
|
|
188
|
+
function define(name, defFunc, cancellable) {
|
|
189
|
+
definedEvents.set(name, {
|
|
190
|
+
"cancellable": cancellable,
|
|
191
|
+
"default": defFunc,
|
|
192
|
+
"register": []
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
define(
|
|
197
|
+
"timeout",
|
|
198
|
+
function def(e) {
|
|
199
|
+
H.toggle("on");
|
|
200
|
+
w.console.info(
|
|
201
|
+
"Hyphenopolys 'FOUHC'-prevention timed out after %dms",
|
|
202
|
+
e.delay
|
|
203
|
+
);
|
|
204
|
+
},
|
|
205
|
+
false
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
define(
|
|
209
|
+
"error",
|
|
210
|
+
function def(e) {
|
|
211
|
+
switch (e.lvl) {
|
|
212
|
+
case "info":
|
|
213
|
+
w.console.info(e.msg);
|
|
214
|
+
break;
|
|
215
|
+
case "warn":
|
|
216
|
+
w.console.warn(e.msg);
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
w.console.error(e.msg);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
true
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
define(
|
|
226
|
+
"contentLoaded",
|
|
227
|
+
function def(e) {
|
|
228
|
+
deferred.push({
|
|
229
|
+
"data": e,
|
|
230
|
+
"name": "contentLoaded"
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
false
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
define(
|
|
237
|
+
"engineLoaded",
|
|
238
|
+
function def(e) {
|
|
239
|
+
deferred.push({
|
|
240
|
+
"data": e,
|
|
241
|
+
"name": "engineLoaded"
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
false
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
define(
|
|
248
|
+
"hpbLoaded",
|
|
249
|
+
function def(e) {
|
|
250
|
+
deferred.push({
|
|
251
|
+
"data": e,
|
|
252
|
+
"name": "hpbLoaded"
|
|
253
|
+
});
|
|
254
|
+
},
|
|
255
|
+
false
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
define(
|
|
259
|
+
"loadError",
|
|
260
|
+
function def(e) {
|
|
261
|
+
deferred.push({
|
|
262
|
+
"data": e,
|
|
263
|
+
"name": "loadError"
|
|
264
|
+
});
|
|
265
|
+
},
|
|
266
|
+
false
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
define(
|
|
270
|
+
"tearDown",
|
|
271
|
+
null,
|
|
272
|
+
true
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Dispatch event <name> with arguments <data>
|
|
277
|
+
* @param {string} name The name of the event
|
|
278
|
+
* @param {Object|undefined} data Data of the event
|
|
279
|
+
* @returns {undefined}
|
|
280
|
+
*/
|
|
281
|
+
function dispatch(name, data) {
|
|
282
|
+
data = data || empty();
|
|
283
|
+
var defaultPrevented = false;
|
|
284
|
+
definedEvents.get(name).register.forEach(
|
|
285
|
+
function call(currentHandler) {
|
|
286
|
+
data.preventDefault = function preventDefault() {
|
|
287
|
+
if (definedEvents.get(name).cancellable) {
|
|
288
|
+
defaultPrevented = true;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
currentHandler(data);
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
if (
|
|
295
|
+
!defaultPrevented &&
|
|
296
|
+
definedEvents.get(name).default
|
|
297
|
+
) {
|
|
298
|
+
definedEvents.get(name).default(data);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Add EventListender <handler> to event <name>
|
|
304
|
+
* @param {string} name The name of the event
|
|
305
|
+
* @param {function} handler Function to register
|
|
306
|
+
* @param {boolean} defer If the registration is deferred
|
|
307
|
+
* @returns {undefined}
|
|
308
|
+
*/
|
|
309
|
+
function addListener(name, handler, defer) {
|
|
310
|
+
if (definedEvents.has(name)) {
|
|
311
|
+
definedEvents.get(name).register.push(handler);
|
|
312
|
+
} else if (defer) {
|
|
313
|
+
tempRegister.push({
|
|
314
|
+
"handler": handler,
|
|
315
|
+
"name": name
|
|
316
|
+
});
|
|
317
|
+
} else {
|
|
318
|
+
H.events.dispatch(
|
|
319
|
+
"error",
|
|
320
|
+
{
|
|
321
|
+
"lvl": "warn",
|
|
322
|
+
"msg": "unknown Event \"" + name + "\" discarded"
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (H.handleEvent) {
|
|
329
|
+
eachKey(H.handleEvent, function add(name) {
|
|
330
|
+
/* eslint-disable security/detect-object-injection */
|
|
331
|
+
addListener(name, H.handleEvent[name], true);
|
|
332
|
+
/* eslint-enable security/detect-object-injection */
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
H.events = empty();
|
|
337
|
+
H.events.deferred = deferred;
|
|
338
|
+
H.events.tempRegister = tempRegister;
|
|
339
|
+
H.events.dispatch = dispatch;
|
|
340
|
+
H.events.define = define;
|
|
341
|
+
H.events.addListener = addListener;
|
|
342
|
+
}());
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Feature test for wasm.
|
|
346
|
+
* @returns {boolean} support
|
|
347
|
+
*/
|
|
348
|
+
function runWasmTest() {
|
|
349
|
+
/*
|
|
350
|
+
* Wasm feature test with iOS bug detection
|
|
351
|
+
* (https://bugs.webkit.org/show_bug.cgi?id=181781)
|
|
352
|
+
*/
|
|
353
|
+
if (
|
|
354
|
+
typeof wa === "object" &&
|
|
355
|
+
typeof wa.Instance === "function"
|
|
356
|
+
) {
|
|
357
|
+
// #### BEGIN MODIFIED BY SAP
|
|
358
|
+
// modification adds try-catch block to enable fallback to asm.js in restricted environments
|
|
359
|
+
try {
|
|
360
|
+
/* eslint-disable array-element-newline */
|
|
361
|
+
var module = new wa.Module(Uint8Array.from([
|
|
362
|
+
0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 127, 1, 127,
|
|
363
|
+
3, 2, 1, 0, 5, 3, 1, 0, 1, 7, 5, 1, 1, 116, 0, 0,
|
|
364
|
+
10, 16, 1, 14, 0, 32, 0, 65, 1, 54, 2, 0, 32, 0, 40, 2,
|
|
365
|
+
0, 11
|
|
366
|
+
]));
|
|
367
|
+
/* eslint-enable array-element-newline */
|
|
368
|
+
return (new wa.Instance(module).exports.t(4) !== 0);
|
|
369
|
+
} catch (e) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
// #### END MODIFIED BY SAP
|
|
373
|
+
}
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Load script by adding <script>-tag
|
|
379
|
+
* @param {string} path Where the script is stored
|
|
380
|
+
* @param {string} filename Filename of the script
|
|
381
|
+
* @returns {undefined}
|
|
382
|
+
*/
|
|
383
|
+
function loadScript(path, filename) {
|
|
384
|
+
var script = d.createElement("script");
|
|
385
|
+
script.src = path + filename;
|
|
386
|
+
if (filename === "hyphenEngine.asm.js") {
|
|
387
|
+
script.addEventListener("load", function listener() {
|
|
388
|
+
H.events.dispatch("engineLoaded", {"msg": "asm"});
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
d.head.appendChild(script);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
var loadedBins = new Map();
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Load binary files either with fetch (on new browsers that support wasm)
|
|
398
|
+
* or with xmlHttpRequest
|
|
399
|
+
* @param {string} path Where the script is stored
|
|
400
|
+
* @param {string} fne Filename of the script with extension
|
|
401
|
+
* @param {string} name Name of the ressource
|
|
402
|
+
* @param {Object} msg Message
|
|
403
|
+
* @returns {undefined}
|
|
404
|
+
*/
|
|
405
|
+
function loadBinary(path, fne, name, msg) {
|
|
406
|
+
/**
|
|
407
|
+
* Get bin file using fetch
|
|
408
|
+
* @param {string} p Where the script is stored
|
|
409
|
+
* @param {string} f Filename of the script with extension
|
|
410
|
+
* @param {string} n Name of the ressource
|
|
411
|
+
* @param {Object} m Message
|
|
412
|
+
* @returns {undefined}
|
|
413
|
+
*/
|
|
414
|
+
function fetchBinary(p, f, n, m) {
|
|
415
|
+
// #### BEGIN MODIFIED BY SAP
|
|
416
|
+
// modification is to not include credentials in the fetch request
|
|
417
|
+
w.fetch(p + f)
|
|
418
|
+
// #### END MODIFIED BY SAP
|
|
419
|
+
.then(
|
|
420
|
+
function resolve(response) {
|
|
421
|
+
if (response.ok) {
|
|
422
|
+
if (n === "hyphenEngine") {
|
|
423
|
+
H.bins.set(n, response.arrayBuffer().then(
|
|
424
|
+
function getModule(buf) {
|
|
425
|
+
return new wa.Module(buf);
|
|
426
|
+
}
|
|
427
|
+
));
|
|
428
|
+
H.events.dispatch("engineLoaded", {"msg": m});
|
|
429
|
+
} else {
|
|
430
|
+
var files = loadedBins.get(f);
|
|
431
|
+
files.forEach(function eachHpb(rn) {
|
|
432
|
+
H.bins.set(
|
|
433
|
+
rn,
|
|
434
|
+
(files.length > 1)
|
|
435
|
+
? response.clone().arrayBuffer()
|
|
436
|
+
: response.arrayBuffer()
|
|
437
|
+
);
|
|
438
|
+
H.events.dispatch(
|
|
439
|
+
"hpbLoaded",
|
|
440
|
+
{"msg": rn}
|
|
441
|
+
);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
H.events.dispatch("loadError", {
|
|
446
|
+
"file": f,
|
|
447
|
+
"msg": m,
|
|
448
|
+
"name": n,
|
|
449
|
+
"path": p
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Get bin file using XHR
|
|
458
|
+
* @param {string} p Where the script is stored
|
|
459
|
+
* @param {string} f Filename of the script with extension
|
|
460
|
+
* @param {string} n Name of the ressource
|
|
461
|
+
* @param {Object} m Message
|
|
462
|
+
* @returns {undefined}
|
|
463
|
+
*/
|
|
464
|
+
function requestBinary(p, f, n, m) {
|
|
465
|
+
var xhr = new XMLHttpRequest();
|
|
466
|
+
xhr.onload = function onload() {
|
|
467
|
+
if (xhr.status === 200) {
|
|
468
|
+
loadedBins.get(f).
|
|
469
|
+
forEach(function eachHpb(rn) {
|
|
470
|
+
H.bins.set(
|
|
471
|
+
rn,
|
|
472
|
+
xhr.response
|
|
473
|
+
);
|
|
474
|
+
H.events.dispatch(
|
|
475
|
+
"hpbLoaded",
|
|
476
|
+
{"msg": rn}
|
|
477
|
+
);
|
|
478
|
+
});
|
|
479
|
+
} else {
|
|
480
|
+
H.events.dispatch("loadError", {
|
|
481
|
+
"file": f,
|
|
482
|
+
"msg": m,
|
|
483
|
+
"name": n,
|
|
484
|
+
"path": p
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
xhr.open("GET", p + f);
|
|
489
|
+
xhr.responseType = "arraybuffer";
|
|
490
|
+
xhr.send();
|
|
491
|
+
}
|
|
492
|
+
if (!loadedBins.has(fne)) {
|
|
493
|
+
loadedBins.set(fne, [msg]);
|
|
494
|
+
if (H.cf.wasm) {
|
|
495
|
+
fetchBinary(path, fne, name, msg);
|
|
496
|
+
} else {
|
|
497
|
+
requestBinary(path, fne, name, msg);
|
|
498
|
+
}
|
|
499
|
+
} else if (name !== "hyphenEngine") {
|
|
500
|
+
loadedBins.get(fne).push(msg);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Pre-Allocate memory for (w)asm
|
|
506
|
+
* Default is 32 wasm Pages (). For languages with larger .hpb
|
|
507
|
+
* files a higher value is needed.
|
|
508
|
+
* Get the value from baseData.heapSize in Hyphenopoly.js
|
|
509
|
+
* @param {string} lang Language
|
|
510
|
+
* @returns {undefined}
|
|
511
|
+
*/
|
|
512
|
+
function allocateMemory(lang) {
|
|
513
|
+
var specVal = new Map(
|
|
514
|
+
[["de", 54], ["hu", 205], ["nb-no", 91], ["nl", 41]]
|
|
515
|
+
);
|
|
516
|
+
var wasmPages = specVal.get(lang) || 32;
|
|
517
|
+
H.specMems = H.specMems || new Map();
|
|
518
|
+
if (H.cf.wasm) {
|
|
519
|
+
H.specMems.set(lang, new wa.Memory({
|
|
520
|
+
"initial": wasmPages,
|
|
521
|
+
"maximum": 256
|
|
522
|
+
}));
|
|
523
|
+
} else {
|
|
524
|
+
/* eslint-disable no-bitwise */
|
|
525
|
+
var asmPages = (2 << Math.floor(
|
|
526
|
+
Math.log(wasmPages) * Math.LOG2E
|
|
527
|
+
)) << 16;
|
|
528
|
+
/* eslint-enable no-bitwise */
|
|
529
|
+
H.specMems.set(lang, new ArrayBuffer(asmPages));
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
(function testClientFeatures() {
|
|
534
|
+
var tester = (function tester() {
|
|
535
|
+
var fakeBody = null;
|
|
536
|
+
/* eslint-disable array-element-newline */
|
|
537
|
+
var css = [
|
|
538
|
+
"visibility:hidden",
|
|
539
|
+
"-moz-hyphens:auto",
|
|
540
|
+
"-webkit-hyphens:auto",
|
|
541
|
+
"-ms-hyphens:auto",
|
|
542
|
+
"hyphens:auto",
|
|
543
|
+
"width:48px",
|
|
544
|
+
"font-size:12px",
|
|
545
|
+
"line-height:12px",
|
|
546
|
+
"border:none",
|
|
547
|
+
"padding:0",
|
|
548
|
+
"word-wrap:normal"
|
|
549
|
+
].join(";");
|
|
550
|
+
/* eslint-enable array-element-newline */
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Create and append div with CSS-hyphenated word
|
|
554
|
+
* @param {string} lang Language
|
|
555
|
+
* @returns {undefined}
|
|
556
|
+
*/
|
|
557
|
+
function create(lang) {
|
|
558
|
+
/* eslint-disable security/detect-object-injection */
|
|
559
|
+
if (H.cf.langs[lang]) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
/* eslint-enable security/detect-object-injection */
|
|
563
|
+
fakeBody = fakeBody || d.createElement("body");
|
|
564
|
+
var testDiv = d.createElement("div");
|
|
565
|
+
testDiv.lang = lang;
|
|
566
|
+
testDiv.style.cssText = css;
|
|
567
|
+
testDiv.appendChild(
|
|
568
|
+
d.createTextNode(lcRequire.get(lang).toLowerCase())
|
|
569
|
+
);
|
|
570
|
+
fakeBody.appendChild(testDiv);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Append fakeBody with tests to target (document)
|
|
575
|
+
* @param {Object} target Where to append fakeBody
|
|
576
|
+
* @returns {Object|null} The body element or null, if no tests
|
|
577
|
+
*/
|
|
578
|
+
function append(target) {
|
|
579
|
+
if (fakeBody) {
|
|
580
|
+
target.appendChild(fakeBody);
|
|
581
|
+
return fakeBody;
|
|
582
|
+
}
|
|
583
|
+
return null;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Remove fakeBody
|
|
588
|
+
* @returns {undefined}
|
|
589
|
+
*/
|
|
590
|
+
function clear() {
|
|
591
|
+
if (fakeBody) {
|
|
592
|
+
fakeBody.parentNode.removeChild(fakeBody);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return {
|
|
596
|
+
"append": append,
|
|
597
|
+
"clear": clear,
|
|
598
|
+
"create": create
|
|
599
|
+
};
|
|
600
|
+
}());
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Checks if hyphens (ev.prefixed) is set to auto for the element.
|
|
604
|
+
* @param {Object} elm - the element
|
|
605
|
+
* @returns {Boolean} result of the check
|
|
606
|
+
*/
|
|
607
|
+
function checkCSSHyphensSupport(elm) {
|
|
608
|
+
return (
|
|
609
|
+
elm.style.hyphens === "auto" ||
|
|
610
|
+
elm.style.webkitHyphens === "auto" ||
|
|
611
|
+
elm.style.msHyphens === "auto" ||
|
|
612
|
+
elm.style["-moz-hyphens"] === "auto"
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Expose the hyphenate-function of a specific language to
|
|
618
|
+
* Hyphenopoly.hyphenators.<language>
|
|
619
|
+
*
|
|
620
|
+
* Hyphenopoly.hyphenators.<language> is a Promise that fullfills
|
|
621
|
+
* to hyphenate(entity, sel) as soon as the ressources are loaded
|
|
622
|
+
* and the engine is ready.
|
|
623
|
+
* If Promises aren't supported (e.g. IE11) a error message is produced.
|
|
624
|
+
*
|
|
625
|
+
* @param {string} lang - the language
|
|
626
|
+
* @returns {undefined}
|
|
627
|
+
*/
|
|
628
|
+
function exposeHyphenateFunction(lang) {
|
|
629
|
+
/* eslint-disable security/detect-object-injection */
|
|
630
|
+
H.hyphenators = H.hyphenators || empty();
|
|
631
|
+
if (!H.hyphenators[lang]) {
|
|
632
|
+
if (w.Promise) {
|
|
633
|
+
H.hyphenators[lang] = new Promise(function pro(rs, rj) {
|
|
634
|
+
H.events.addListener(
|
|
635
|
+
"engineReady",
|
|
636
|
+
function handler(e) {
|
|
637
|
+
if (e.msg === lang) {
|
|
638
|
+
rs(H.createHyphenator(e.msg));
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
true
|
|
642
|
+
);
|
|
643
|
+
H.events.addListener(
|
|
644
|
+
"loadError",
|
|
645
|
+
function handler(e) {
|
|
646
|
+
if (e.name === lang || e.name === "hyphenEngine") {
|
|
647
|
+
rj(new Error("File " + e.file + " can't be loaded from " + e.path));
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
false
|
|
651
|
+
);
|
|
652
|
+
});
|
|
653
|
+
H.hyphenators[lang].catch(function catchPromiseError(e) {
|
|
654
|
+
H.events.dispatch(
|
|
655
|
+
"error",
|
|
656
|
+
{
|
|
657
|
+
"lvl": "error",
|
|
658
|
+
"msg": e.message
|
|
659
|
+
}
|
|
660
|
+
);
|
|
661
|
+
});
|
|
662
|
+
} else {
|
|
663
|
+
H.hyphenators[lang] = {
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Fires an error message, if then is called
|
|
667
|
+
* @returns {undefined}
|
|
668
|
+
*/
|
|
669
|
+
"then": function () {
|
|
670
|
+
H.events.dispatch(
|
|
671
|
+
"error",
|
|
672
|
+
{"msg": "Promises not supported in this engine. Use a polyfill."}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
/* eslint-enable security/detect-object-injection */
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Load .hpb files
|
|
683
|
+
* @param {string} lang The language
|
|
684
|
+
* @returns {undefined}
|
|
685
|
+
*/
|
|
686
|
+
function loadPattern(lang) {
|
|
687
|
+
var filename = lang + ".hpb";
|
|
688
|
+
var langFallback = lang;
|
|
689
|
+
H.cf.polyfill = true;
|
|
690
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
691
|
+
H.cf.langs[lang] = "H9Y";
|
|
692
|
+
if (lcFallbacks && lcFallbacks.has(lang)) {
|
|
693
|
+
langFallback = lcFallbacks.get(lang);
|
|
694
|
+
filename = langFallback + ".hpb";
|
|
695
|
+
}
|
|
696
|
+
H.bins = H.bins || new Map();
|
|
697
|
+
loadBinary(H.paths.patterndir, filename, langFallback, lang);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
if (H.cf.wasm === null) {
|
|
701
|
+
H.cf.wasm = runWasmTest();
|
|
702
|
+
}
|
|
703
|
+
lcRequire.forEach(function eachReq(value, lang) {
|
|
704
|
+
if (value === "FORCEHYPHENOPOLY" ||
|
|
705
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
706
|
+
(H.cf.langs[lang] && H.cf.langs[lang] === "H9Y")
|
|
707
|
+
) {
|
|
708
|
+
loadPattern(lang);
|
|
709
|
+
} else {
|
|
710
|
+
tester.create(lang);
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
var testContainer = tester.append(d.documentElement);
|
|
715
|
+
if (testContainer !== null) {
|
|
716
|
+
var nl = testContainer.querySelectorAll("div");
|
|
717
|
+
Array.prototype.forEach.call(nl, function eachNode(n) {
|
|
718
|
+
if (checkCSSHyphensSupport(n) && n.offsetHeight > 12) {
|
|
719
|
+
H.cf.langs[n.lang] = "CSS";
|
|
720
|
+
} else {
|
|
721
|
+
loadPattern(n.lang);
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
tester.clear();
|
|
725
|
+
}
|
|
726
|
+
if (H.cf.polyfill) {
|
|
727
|
+
loadScript(H.paths.maindir, "Hyphenopoly.js");
|
|
728
|
+
if (H.cf.wasm) {
|
|
729
|
+
loadBinary(
|
|
730
|
+
H.paths.maindir,
|
|
731
|
+
"hyphenEngine.wasm",
|
|
732
|
+
"hyphenEngine",
|
|
733
|
+
"wasm"
|
|
734
|
+
);
|
|
735
|
+
} else {
|
|
736
|
+
loadScript(H.paths.maindir, "hyphenEngine.asm.js");
|
|
737
|
+
}
|
|
738
|
+
eachKey(H.cf.langs, function prepareEach(lang) {
|
|
739
|
+
/* eslint-disable security/detect-object-injection */
|
|
740
|
+
if (H.cf.langs[lang] === "H9Y") {
|
|
741
|
+
allocateMemory(lang);
|
|
742
|
+
exposeHyphenateFunction(lang);
|
|
743
|
+
}
|
|
744
|
+
/* eslint-enable security/detect-object-injection */
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
}());
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Hides the specified elements and starts the process by
|
|
751
|
+
* dispatching a "contentLoaded"-event in Hyphenopoly
|
|
752
|
+
* @returns {undefined}
|
|
753
|
+
*/
|
|
754
|
+
function handleDCL() {
|
|
755
|
+
if (H.setup.hide.match(/^(?:element|text)$/)) {
|
|
756
|
+
H.toggle("off");
|
|
757
|
+
}
|
|
758
|
+
H.events.dispatch(
|
|
759
|
+
"contentLoaded",
|
|
760
|
+
{"msg": ["contentLoaded"]}
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if (H.cf.polyfill) {
|
|
765
|
+
if (H.setup.hide === "all") {
|
|
766
|
+
H.toggle("off");
|
|
767
|
+
}
|
|
768
|
+
if (H.setup.hide !== "none") {
|
|
769
|
+
H.setup.timeOutHandler = w.setTimeout(function timedOut() {
|
|
770
|
+
H.toggle("on");
|
|
771
|
+
H.events.dispatch("timeout", {"delay": H.setup.timeout});
|
|
772
|
+
}, H.setup.timeout);
|
|
773
|
+
}
|
|
774
|
+
if (d.readyState === "loading") {
|
|
775
|
+
d.addEventListener(
|
|
776
|
+
"DOMContentLoaded",
|
|
777
|
+
handleDCL,
|
|
778
|
+
{
|
|
779
|
+
"once": true,
|
|
780
|
+
"passive": true
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
} else {
|
|
784
|
+
handleDCL();
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
H.events.dispatch("tearDown", {});
|
|
788
|
+
w.Hyphenopoly = null;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
if (H.cacheFeatureTests) {
|
|
792
|
+
store.setItem(
|
|
793
|
+
"Hyphenopoly_Loader",
|
|
794
|
+
JSON.stringify(H.cf)
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
}(window, document, Hyphenopoly, Object));
|