@openui5/sap.ui.core 1.115.0 → 1.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dtsgenrc +18 -0
- package/.eslintrc.json +11 -0
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.sjax.js +2 -2
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +106 -0
- package/src/sap/base/Eventing.js +320 -0
- package/src/sap/base/config.js +1 -1
- package/src/sap/base/i18n/Formatting.js +991 -0
- package/src/sap/base/i18n/LanguageTag.js +189 -0
- package/src/sap/base/i18n/Localization.js +711 -0
- package/src/sap/base/i18n/ResourceBundle.js +5 -20
- package/src/sap/base/i18n/date/CalendarType.js +54 -0
- package/src/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
- package/src/sap/base/i18n/date/TimezoneUtils.js +287 -0
- package/src/sap/base/util/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 +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +4 -12
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +8 -12
- package/src/sap/ui/base/ManagedObjectMetadata.js +30 -7
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/base/SyncPromise.js +10 -5
- package/src/sap/ui/core/.library +2 -2
- package/src/sap/ui/core/AccessKeysEnablement.js +10 -5
- package/src/sap/ui/core/AnimationMode.js +49 -0
- package/src/sap/ui/core/BusyIndicator.js +33 -42
- package/src/sap/ui/core/CalendarType.js +11 -37
- package/src/sap/ui/core/Component.js +4 -5
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +2 -2
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +409 -1270
- package/src/sap/ui/core/Control.js +4 -12
- package/src/sap/ui/core/ControlBehavior.js +157 -0
- package/src/sap/ui/core/Core.js +124 -132
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +14 -3
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +5 -7
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +12 -12
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +109 -22
- 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 +151 -430
- package/src/sap/ui/core/LocaleData.js +39 -11
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/StaticArea.js +31 -17
- package/src/sap/ui/core/Theming.js +451 -0
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +1 -0
- package/src/sap/ui/core/_IconRegistry.js +7 -1
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +12 -83
- package/src/sap/ui/core/date/UI5Date.js +2 -2
- package/src/sap/ui/core/delegate/ItemNavigation.js +8 -10
- package/src/sap/ui/core/delegate/ScrollEnablement.js +5 -5
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +20 -15
- package/src/sap/ui/core/format/TimezoneUtil.js +15 -273
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +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 +1 -1
- 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_cs.properties +1 -1
- package/src/sap/ui/core/messagebundle_cy.properties +1 -1
- package/src/sap/ui/core/messagebundle_da.properties +1 -1
- package/src/sap/ui/core/messagebundle_de.properties +1 -1
- package/src/sap/ui/core/messagebundle_el.properties +1 -1
- package/src/sap/ui/core/messagebundle_en.properties +1 -1
- package/src/sap/ui/core/messagebundle_en_GB.properties +1 -1
- package/src/sap/ui/core/messagebundle_es.properties +1 -1
- package/src/sap/ui/core/messagebundle_es_MX.properties +1 -1
- package/src/sap/ui/core/messagebundle_et.properties +1 -1
- package/src/sap/ui/core/messagebundle_id.properties +1 -1
- package/src/sap/ui/core/messagebundle_it.properties +49 -49
- package/src/sap/ui/core/messagebundle_iw.properties +1 -1
- package/src/sap/ui/core/messagebundle_kk.properties +1 -1
- package/src/sap/ui/core/messagebundle_ko.properties +1 -1
- package/src/sap/ui/core/messagebundle_lt.properties +1 -1
- package/src/sap/ui/core/messagebundle_lv.properties +1 -1
- package/src/sap/ui/core/messagebundle_ms.properties +8 -8
- package/src/sap/ui/core/messagebundle_nl.properties +1 -1
- package/src/sap/ui/core/messagebundle_no.properties +1 -1
- package/src/sap/ui/core/messagebundle_pl.properties +1 -1
- package/src/sap/ui/core/messagebundle_pt.properties +1 -1
- package/src/sap/ui/core/messagebundle_pt_PT.properties +1 -1
- package/src/sap/ui/core/messagebundle_ro.properties +1 -1
- package/src/sap/ui/core/messagebundle_sh.properties +1 -1
- package/src/sap/ui/core/messagebundle_sv.properties +1 -1
- package/src/sap/ui/core/messagebundle_th.properties +1 -1
- package/src/sap/ui/core/messagebundle_uk.properties +21 -21
- package/src/sap/ui/core/messagebundle_vi.properties +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +14 -16
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/HashChanger.js +1 -0
- package/src/sap/ui/core/routing/Route.js +1 -0
- package/src/sap/ui/core/routing/Router.js +3 -1
- package/src/sap/ui/core/rules/Config.support.js +2 -2
- package/src/sap/ui/core/rules/Model.support.js +3 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/controls/TimelineOverview.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +4 -4
- package/src/sap/ui/core/themes/base/base.less +41 -20
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +6 -5
- package/src/sap/ui/core/theming/ThemeManager.js +310 -447
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +5 -10
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +3 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/events/PseudoEvents.js +17 -9
- package/src/sap/ui/model/Binding.js +19 -15
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeBinding.js +57 -19
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/ListBinding.js +42 -1
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +5 -4
- package/src/sap/ui/model/PropertyBinding.js +10 -0
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +4 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/base/ManagedObjectModel.js +1 -1
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +8 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +3 -3
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +3 -2
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +14 -3
- package/src/sap/ui/model/odata/v2/ODataModel.js +45 -31
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +7 -3
- package/src/sap/ui/model/odata/v4/ODataBinding.js +68 -39
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +12 -8
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +30 -8
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +11 -9
- package/src/sap/ui/model/odata/v4/ODataModel.js +10 -14
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +64 -31
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +21 -16
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +2 -0
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +37 -14
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +11 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +7 -4
- package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa5.js +1 -1
- package/src/sap/ui/test/autowaiter/_autoWaiter.js +1 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/gherkin/simpleGherkinParser.js +10 -5
- package/src/sap/ui/test/matchers/LabelFor.js +1 -0
- package/src/sap/ui/thirdparty/caja-html-sanitizer.js +111 -96
- package/src/sap/ui/util/ActivityDetection.js +7 -1
- package/src/sap/ui/util/Mobile.js +11 -8
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader-autoconfig.js +5 -2
- package/src/ui5loader.js +169 -185
- package/test/sap/ui/core/FormatHelper.js +3 -2
- package/test/sap/ui/core/demokit/docuindex.json +6 -0
- package/test/sap/ui/core/demokit/sample/OpaBusyIndicator/OpaBusyIndicator.js +1 -1
- package/test/sap/ui/core/demokit/sample/OpaMatchers/OpaMatchers.js +2 -2
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/MIT.ODataTypes.html +9 -14
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Opa.qunit.js +7 -0
- package/test/sap/ui/core/demokit/sample/common/pages/Any.js +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/tests/filter.js +2 -2
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Component.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.controller.js +43 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.view.xml +47 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.controller.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.view.xml +7 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/NotFound.view.xml +8 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.controller.js +123 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.view.xml +92 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.html +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.js +69 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/README.html +55 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/SandboxModel.js +56 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/POST-SalesOrderList.json +66 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000')-SO_2_SOITEM.json +57 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000').json +20 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000001').json +9 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000007')-SO_2_BP.json +12 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList.json +62 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.json +85 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.xml +185 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.json +93 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.xml +262 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/metadata.xml +1779 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/manifest.json +134 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/pages/Main.js +119 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/pages/Main.js +0 -41
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Main.controller.js +5 -17
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Main.view.xml +3 -3
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/qunit/CompositeBinding.qunit.js +25 -7
- package/test/sap/ui/core/qunit/ControlRenderer.qunit.js +86 -2
- package/test/sap/ui/core/qunit/DataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/HTML.qunit.js +31 -31
- package/test/sap/ui/core/qunit/Lib.qunit.js +55 -2
- package/test/sap/ui/core/qunit/LocalBusyIndicator.qunit.js +22 -15
- package/test/sap/ui/core/qunit/ManagedObject.qunit.js +5 -3
- package/test/sap/ui/core/qunit/Object.qunit.js +4 -1
- package/test/sap/ui/core/qunit/ThemeManager.qunit.js +2 -2
- package/test/sap/ui/core/qunit/ThemeParameters.qunit.js +9 -3
- package/test/sap/ui/core/qunit/Theming.beforeBootstrap.qunit.js +13 -0
- package/test/sap/ui/core/qunit/Theming.qunit.js +229 -0
- package/test/sap/ui/core/qunit/analytics/AnalyticalTreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/analytics/ODataModelAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/app/MessageListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.html +24 -0
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.js +275 -0
- package/test/sap/ui/core/qunit/base/i18n/Localization.qunit.js +259 -0
- package/test/sap/ui/core/qunit/base/i18n/ResourceBundle.qunit.js +5 -6
- package/test/sap/ui/core/qunit/base/security/sanitizeHTML.qunit.js +17 -0
- package/test/sap/ui/core/qunit/bootstrap/BootstrapPreload.qunit.js +1 -2
- package/test/sap/ui/core/qunit/bootstrap/BootstrapWithCustomBootTask.beforeBootstrap.qunit.js +13 -12
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.js +388 -254
- package/test/sap/ui/core/qunit/bootstrap/ThemeVersion.qunit.js +19 -30
- package/test/sap/ui/core/qunit/component/Models.qunit.js +7 -28
- package/test/sap/ui/core/qunit/component/Models_unavoidablySync.qunit.js +8 -26
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/sync/Component.js +2 -6
- package/test/sap/ui/core/qunit/component/testdata/customizing/customersub/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/inherit/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inherit/parent/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/other/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/terminologies/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component1/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component2/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component3/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component5/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/reuse/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/v1/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1empty/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v1missing/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v2/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2asyncRootView/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2empty/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2missing/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2version/Component.js +2 -2
- package/test/sap/ui/core/qunit/dnd/DragDropInfo.qunit.js +1 -2
- package/test/sap/ui/core/qunit/generic/legacy/ControlMemoryLeaks.qunit.js +2 -0
- package/test/sap/ui/core/qunit/generic/legacy/DuplicateIdCheck.qunit.js +2 -0
- package/test/sap/ui/core/qunit/gherkin/dataTableUtils.qunit.js +2 -2
- package/test/sap/ui/core/qunit/i18n/Locale.qunit.js +0 -52
- package/test/sap/ui/core/qunit/i18n/LocaleData.qunit.js +1 -1
- package/test/sap/ui/core/qunit/i18n/UniversalDate.qunit.js +14 -24
- package/test/sap/ui/core/qunit/i18n/testsuite.i18n.qunit.js +18 -0
- package/test/sap/ui/core/qunit/internal/1RingModels.qunit.js +1 -0
- package/test/sap/ui/core/qunit/json/JSONListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/json/JSONPropertyBinding.qunit.js +7 -12
- package/test/sap/ui/core/qunit/json/JSONTwoWay.qunit.js +3 -8
- package/test/sap/ui/core/qunit/loader/fixture/amd-with-export-true/module1.js +2 -2
- package/test/sap/ui/core/qunit/messages/MessageMixin.qunit.js +2 -7
- package/test/sap/ui/core/qunit/messages/messagesUsage.qunit.js +1 -1
- package/test/sap/ui/core/qunit/model/Binding.qunit.js +36 -11
- package/test/sap/ui/core/qunit/model/ClientListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ClientTreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/CompositeDataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ContextBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ListBinding.qunit.js +63 -6
- package/test/sap/ui/core/qunit/model/Model.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/PropertyBinding.qunit.js +40 -0
- package/test/sap/ui/core/qunit/model/TreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/TreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/mvc/XMLView.qunit.js +9 -8
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions.qunit.js +4 -4
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions_legacy.qunit.js +4 -4
- package/test/sap/ui/core/qunit/odata/AnnotationParserNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/ODataMessageParser.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/ODataMessageParserNoFakeService.qunit.js +2 -8
- package/test/sap/ui/core/qunit/odata/ODataMetadataNoFakeService.qunit.js +1 -6
- package/test/sap/ui/core/qunit/odata/type/DateTimeBase.qunit.js +24 -0
- package/test/sap/ui/core/qunit/odata/v2/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataContextBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataListBindingNoFakeService.qunit.js +31 -17
- package/test/sap/ui/core/qunit/odata/v2/ODataModel.integration.qunit.js +28 -19
- package/test/sap/ui/core/qunit/odata/v2/ODataModelNoFakeService.qunit.js +70 -15
- package/test/sap/ui/core/qunit/odata/v2/ODataPropertyBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingFlatNoFakeService.qunit.js +4 -9
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/_CreatedContextsCache.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v4/AnnotationHelper.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/v4/Context.qunit.js +45 -17
- package/test/sap/ui/core/qunit/odata/v4/ODataBinding.qunit.js +152 -151
- package/test/sap/ui/core/qunit/odata/v4/ODataContextBinding.qunit.js +55 -27
- package/test/sap/ui/core/qunit/odata/v4/ODataListBinding.qunit.js +119 -4
- package/test/sap/ui/core/qunit/odata/v4/ODataMetaModel.qunit.js +3 -3
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.integration.qunit.js +754 -195
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.qunit.js +42 -53
- package/test/sap/ui/core/qunit/odata/v4/ODataParentBinding.qunit.js +283 -170
- package/test/sap/ui/core/qunit/odata/v4/ODataPropertyBinding.qunit.js +103 -78
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationCache.qunit.js +3 -0
- package/test/sap/ui/core/qunit/odata/v4/lib/_Cache.qunit.js +87 -58
- package/test/sap/ui/core/qunit/odata/v4/lib/_Helper.qunit.js +3 -1
- package/test/sap/ui/core/qunit/odata/v4/lib/_Requestor.qunit.js +124 -22
- package/test/sap/ui/core/qunit/odata/v4/testsuite.odatav4.qunit.js +4 -0
- package/test/sap/ui/core/qunit/opa/_LogCollector.qunit.js +1 -1
- package/test/sap/ui/core/qunit/performance/trace/FESR.qunit.js +5 -0
- package/test/sap/ui/core/qunit/resource/ResourceModel.qunit.js +17 -37
- package/test/sap/ui/core/qunit/routing/HashChanger.qunit.js +1 -6
- package/test/sap/ui/core/qunit/routing/RouterHashChanger.qunit.js +1 -10
- package/test/sap/ui/core/qunit/routing/async/Router.qunit.js +1 -22
- package/test/sap/ui/core/qunit/routing/async/Target.qunit.js +1 -4
- package/test/sap/ui/core/qunit/rule/model/modelSupport.qunit.js +34 -1
- package/test/sap/ui/core/qunit/testdata/fastnavigation/view/FastNavigation.view.xml +2 -2
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/i18n.properties +1 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/manifest.json +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/messagebundle.properties +1 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.databinding.qunit.js +3 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.theming.qunit.js +29 -0
- package/test/sap/ui/core/qunit/types/DateFormatTimezones.qunit.js +397 -607
- package/test/sap/ui/core/qunit/types/SimpleType.qunit.js +16 -2
- package/test/sap/ui/core/qunit/types/Types.qunit.js +2 -37
- package/test/sap/ui/core/qunit/types/testsuite.types.qunit.js +1 -1
- package/test/sap/ui/core/qunit/util/SyncPromise.qunit.js +4 -1
- package/test/sap/ui/core/qunit/util/jQuery.sap.measure.qunit.js +16 -11
- package/test/sap/ui/core/qunit/xml/XMLListBinding.qunit.js +1 -3
- package/test/sap/ui/core/qunit/xml/XMLModel.qunit.js +4 -14
- package/test/sap/ui/core/qunit/xml/XMLPropertyBinding.qunit.js +7 -11
- package/test/sap/ui/core/qunit/xml/XMLTreeBinding.qunit.js +1 -1
- package/test/sap/ui/core/qunit/xml/XMLTwoWay.qunit.js +3 -7
- package/test/sap/ui/core/relnotes/changes-1.115.json +1 -37
- package/test/sap/ui/core/relnotes/changes-1.116.json +82 -0
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/firstItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/initial.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/lastItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/leftDownBtn-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/myButtonSample-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/rightDownBtn-contextMenu.ref.lnk +1 -1
- package/test/testsuite/js/samples.js +2 -0
- package/ui5.yaml +1 -1
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/base/assert",
|
|
8
|
+
"sap/base/config",
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/base/Eventing",
|
|
11
|
+
"sap/base/i18n/Localization",
|
|
12
|
+
"sap/base/i18n/LanguageTag",
|
|
13
|
+
"sap/base/i18n/date/CalendarType",
|
|
14
|
+
"sap/base/i18n/date/CalendarWeekNumbering",
|
|
15
|
+
"sap/base/util/deepEqual",
|
|
16
|
+
"sap/base/util/extend",
|
|
17
|
+
"sap/base/util/isEmptyObject"
|
|
18
|
+
], function(
|
|
19
|
+
assert,
|
|
20
|
+
BaseConfig,
|
|
21
|
+
Log,
|
|
22
|
+
Eventing,
|
|
23
|
+
Localization,
|
|
24
|
+
LanguageTag,
|
|
25
|
+
CalendarType,
|
|
26
|
+
CalendarWeekNumbering,
|
|
27
|
+
deepEqual,
|
|
28
|
+
extend,
|
|
29
|
+
isEmptyObject
|
|
30
|
+
) {
|
|
31
|
+
"use strict";
|
|
32
|
+
|
|
33
|
+
var mChanges,
|
|
34
|
+
mSettings = {};
|
|
35
|
+
|
|
36
|
+
var M_ABAP_DATE_FORMAT_PATTERN = {
|
|
37
|
+
"" : {pattern: null},
|
|
38
|
+
"1": {pattern: "dd.MM.yyyy"},
|
|
39
|
+
"2": {pattern: "MM/dd/yyyy"},
|
|
40
|
+
"3": {pattern: "MM-dd-yyyy"},
|
|
41
|
+
"4": {pattern: "yyyy.MM.dd"},
|
|
42
|
+
"5": {pattern: "yyyy/MM/dd"},
|
|
43
|
+
"6": {pattern: "yyyy-MM-dd"},
|
|
44
|
+
"7": {pattern: "Gyy.MM.dd"},
|
|
45
|
+
"8": {pattern: "Gyy/MM/dd"},
|
|
46
|
+
"9": {pattern: "Gyy-MM-dd"},
|
|
47
|
+
"A": {pattern: "yyyy/MM/dd"},
|
|
48
|
+
"B": {pattern: "yyyy/MM/dd"},
|
|
49
|
+
"C": {pattern: "yyyy/MM/dd"}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var M_ABAP_TIME_FORMAT_PATTERN = {
|
|
53
|
+
"" : {"short": null, medium: null, dayPeriods: null},
|
|
54
|
+
"0": {"short": "HH:mm", medium: "HH:mm:ss", dayPeriods: null},
|
|
55
|
+
"1": {"short": "hh:mm a", medium: "hh:mm:ss a", dayPeriods: ["AM", "PM"]},
|
|
56
|
+
"2": {"short": "hh:mm a", medium: "hh:mm:ss a", dayPeriods: ["am", "pm"]},
|
|
57
|
+
"3": {"short": "KK:mm a", medium: "KK:mm:ss a", dayPeriods: ["AM", "PM"]},
|
|
58
|
+
"4": {"short": "KK:mm a", medium: "KK:mm:ss a", dayPeriods: ["am", "pm"]}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
var M_ABAP_NUMBER_FORMAT_SYMBOLS = {
|
|
62
|
+
"" : {groupingSeparator: null, decimalSeparator: null},
|
|
63
|
+
" ": {groupingSeparator: ".", decimalSeparator: ","},
|
|
64
|
+
"X": {groupingSeparator: ",", decimalSeparator: "."},
|
|
65
|
+
"Y": {groupingSeparator: " ", decimalSeparator: ","}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function check(bCondition, sMessage) {
|
|
69
|
+
if ( !bCondition ) {
|
|
70
|
+
throw new Error(sMessage);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Helper that creates a LanguageTag object from the given language
|
|
76
|
+
* or, throws an error for non BCP-47 compliant languages.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} sLanguageTag A BCP-47 compliant language tag
|
|
79
|
+
* @return {sap.base.i18n.LanguageTag} The resulting LanguageTag
|
|
80
|
+
* @throws {TypeError} Throws a TypeError for unknown languages
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
function createLanguageTag(sLanguageTag) {
|
|
84
|
+
var oLanguageTag;
|
|
85
|
+
if (sLanguageTag && typeof sLanguageTag === 'string') {
|
|
86
|
+
try {
|
|
87
|
+
oLanguageTag = new LanguageTag( sLanguageTag );
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// ignore
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return oLanguageTag;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var oWritableConfig = BaseConfig.getWritableInstance();
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Configuration for formatting specific parameters
|
|
99
|
+
* @private
|
|
100
|
+
* @ui5-restricted sap.ui.core
|
|
101
|
+
* @alias module:sap/base/i18n/Formatting
|
|
102
|
+
* @namespace
|
|
103
|
+
* @mixes module:sap/base/Eventing
|
|
104
|
+
* @borrows module:sap/base/Eventing#attachEvent as attachEvent
|
|
105
|
+
* @borrows module:sap/base/Eventing#attachEventOnce as attachEventOnce
|
|
106
|
+
* @borrows module:sap/base/Eventing#detachEvent as detachEvent
|
|
107
|
+
* @borrows module:sap/base/Eventing#fireEvent as fireEvent
|
|
108
|
+
* @borrows module:sap/base/Eventing#hasListeners as hasListeners
|
|
109
|
+
* @borrows module:sap/base/Eventing#getEventingParent as getEventingParent
|
|
110
|
+
* @borrows module:sap/base/Eventing#toString as toString
|
|
111
|
+
*/
|
|
112
|
+
var Formatting = {
|
|
113
|
+
/**
|
|
114
|
+
* The <code>change</code> event is fired, when the configuration options are changed.
|
|
115
|
+
*
|
|
116
|
+
* @name module:sap/base/i18n/Formatting.change
|
|
117
|
+
* @event
|
|
118
|
+
* @private
|
|
119
|
+
* @ui5-restricted sap.ui.core
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Attaches the <code>fnFunction</code> event handler to the {@link #event:change change} event
|
|
124
|
+
* of <code>sap.base.i18n.Formatting</code>.
|
|
125
|
+
*
|
|
126
|
+
* @param {function} fnFunction
|
|
127
|
+
* The function to be called when the event occurs
|
|
128
|
+
* @private
|
|
129
|
+
* @ui5-restricted sap.ui.core
|
|
130
|
+
*/
|
|
131
|
+
attachChange: function(fnFunction) {
|
|
132
|
+
Formatting.attachEvent("change", fnFunction);
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Detaches event handler <code>fnFunction</code> from the {@link #event:change change} event of
|
|
137
|
+
* this <code>sap.base.i18n.Formatting</code>.
|
|
138
|
+
*
|
|
139
|
+
* @param {function} fnFunction Function to be called when the event occurs
|
|
140
|
+
* @private
|
|
141
|
+
* @ui5-restricted sap.ui.core
|
|
142
|
+
*/
|
|
143
|
+
detachChange: function(fnFunction) {
|
|
144
|
+
Formatting.detachEvent("change", fnFunction);
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Returns the LanguageTag to be used for formatting.
|
|
149
|
+
*
|
|
150
|
+
* If no such LanguageTag has been defined, this method falls back to the language,
|
|
151
|
+
* see {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}.
|
|
152
|
+
*
|
|
153
|
+
* If any user preferences for date, time or number formatting have been set,
|
|
154
|
+
* and if no format LanguageTag has been specified, then a special private use subtag
|
|
155
|
+
* is added to the LanguageTag, indicating to the framework that these user preferences
|
|
156
|
+
* should be applied.
|
|
157
|
+
*
|
|
158
|
+
* @return {sap.base.i18n.LanguageTag} the format LanguageTag
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
getLanguageTag : function() {
|
|
162
|
+
function fallback(oFormatSettings) {
|
|
163
|
+
var oLanguageTag = new LanguageTag(Localization.getLanguage());
|
|
164
|
+
// if any user settings have been defined, add the private use subtag "sapufmt"
|
|
165
|
+
if (!isEmptyObject(mSettings)
|
|
166
|
+
|| oFormatSettings.getCalendarWeekNumbering() !== CalendarWeekNumbering.Default) {
|
|
167
|
+
var l = oLanguageTag.toString();
|
|
168
|
+
if ( l.indexOf("-x-") < 0 ) {
|
|
169
|
+
l = l + "-x-sapufmt";
|
|
170
|
+
} else if ( l.indexOf("-sapufmt") <= l.indexOf("-x-") ) {
|
|
171
|
+
l = l + "-sapufmt";
|
|
172
|
+
}
|
|
173
|
+
oLanguageTag = new LanguageTag(l);
|
|
174
|
+
}
|
|
175
|
+
return oLanguageTag;
|
|
176
|
+
}
|
|
177
|
+
return oWritableConfig.get({
|
|
178
|
+
name: "sapUiFormatLocale",
|
|
179
|
+
type: function(sFormatLocale) {return new LanguageTag(sFormatLocale);},
|
|
180
|
+
defaultValue: fallback(this),
|
|
181
|
+
external: true
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Sets a new language tag to be used from now on for retrieving language
|
|
187
|
+
* specific formatters. Modifying this setting does not have an impact on
|
|
188
|
+
* the retrieval of translated texts!
|
|
189
|
+
*
|
|
190
|
+
* Can either be set to a concrete value (a BCP47 or Java locale compliant
|
|
191
|
+
* language tag) or to <code>null</code>. When set to <code>null</code> (default
|
|
192
|
+
* value) then locale specific formatters are retrieved for the current language.
|
|
193
|
+
*
|
|
194
|
+
* After changing the format locale, the framework tries to update localization
|
|
195
|
+
* specific parts of the UI. See the documentation of
|
|
196
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
197
|
+
* for details and restrictions.
|
|
198
|
+
*
|
|
199
|
+
* <b>Note</b>: When a language tag is set, it has higher priority than a number,
|
|
200
|
+
* date or time format defined with a call to <code>setLegacyNumberFormat</code>,
|
|
201
|
+
* <code>setLegacyDateFormat</code> or <code>setLegacyTimeFormat</code>.
|
|
202
|
+
*
|
|
203
|
+
* <b>Note</b>: See documentation of
|
|
204
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
205
|
+
* for restrictions.
|
|
206
|
+
*
|
|
207
|
+
* @param {string|null} sLanguageTag the new BCP47 compliant language tag;
|
|
208
|
+
* case doesn't matter and underscores can be used instead of dashes to separate
|
|
209
|
+
* components (compatibility with Java Locale IDs)
|
|
210
|
+
* @return {this} <code>this</code> to allow method chaining
|
|
211
|
+
* @public
|
|
212
|
+
* @throws {Error} When <code>sLanguageTag</code> is given, but is not a valid BCP47 language
|
|
213
|
+
* tag or Java locale identifier
|
|
214
|
+
*/
|
|
215
|
+
setLanguageTag : function(sLanguageTag) {
|
|
216
|
+
var oLanguageTag = createLanguageTag(sLanguageTag);
|
|
217
|
+
check(sLanguageTag == null || typeof sLanguageTag === "string" && oLanguageTag, "sLanguageTag must be a BCP47 language tag or Java Locale id or null");
|
|
218
|
+
sLanguageTag = sLanguageTag === null ? undefined : sLanguageTag;
|
|
219
|
+
var oOldLanguageTag = Formatting.getLanguageTag();
|
|
220
|
+
oWritableConfig.set("sapUiFormatLocale", sLanguageTag);
|
|
221
|
+
var oCurrentLanguageTag = Formatting.getLanguageTag();
|
|
222
|
+
if (oOldLanguageTag.toString() !== oCurrentLanguageTag.toString()) {
|
|
223
|
+
var bFireEvent = !mChanges;
|
|
224
|
+
mChanges = mChanges || {};
|
|
225
|
+
mChanges.languageTag = oCurrentLanguageTag.toString();
|
|
226
|
+
if (bFireEvent) {
|
|
227
|
+
fireChange();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return this;
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
_set : function(sKey, oValue) {
|
|
234
|
+
var oOldValue = mSettings[sKey];
|
|
235
|
+
if ( oValue != null ) {
|
|
236
|
+
mSettings[sKey] = oValue;
|
|
237
|
+
} else {
|
|
238
|
+
delete mSettings[sKey];
|
|
239
|
+
}
|
|
240
|
+
// report a change only if old and new value differ (null/undefined are treated as the same value)
|
|
241
|
+
if ( (oOldValue != null || oValue != null) && !deepEqual(oOldValue, oValue) ) {
|
|
242
|
+
var bFireEvent = !mChanges;
|
|
243
|
+
mChanges = mChanges || {};
|
|
244
|
+
mChanges[sKey] = oValue;
|
|
245
|
+
if (bFireEvent) {
|
|
246
|
+
fireChange();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Retrieves the custom units.
|
|
253
|
+
* These custom units are set by {@link #setCustomUnits} and {@link #addCustomUnits}
|
|
254
|
+
* @return {object} custom units object
|
|
255
|
+
* @see #setCustomUnits
|
|
256
|
+
* @see #addCustomUnits
|
|
257
|
+
*/
|
|
258
|
+
getCustomUnits: function () {
|
|
259
|
+
return mSettings["units"] ? mSettings["units"]["short"] : undefined;
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Sets custom units which can be used to do Unit Formatting.
|
|
264
|
+
*
|
|
265
|
+
* The custom unit object consists of:
|
|
266
|
+
* * a custom unit key which can then be referenced to use this unit.
|
|
267
|
+
* * <code>displayName</code> which represents the name of the unit.
|
|
268
|
+
* * <code>unitPattern-count-<pluralName></code> which represents the plural category of the locale for the given value.
|
|
269
|
+
* The plural category is defined within the locale, e.g. in the 'en' locale:
|
|
270
|
+
* <code>unitPattern-count-one</code> for <code>1</code>,
|
|
271
|
+
* <code>unitPattern-count-zero</code> for <code>0</code>,
|
|
272
|
+
* <code>unitPattern-count-other</code> for all the res
|
|
273
|
+
* To retrieve all plural categories defined for a locale use <code>sap.ui.core.LocaleData.prototype.getPluralCategories</code>.
|
|
274
|
+
*
|
|
275
|
+
* A Sample custom unit definition could look like this:
|
|
276
|
+
* <code>
|
|
277
|
+
* {
|
|
278
|
+
* "BAG": {
|
|
279
|
+
* "displayName": "Bag",
|
|
280
|
+
* "unitPattern-count-one": "{0} bag",
|
|
281
|
+
* "unitPattern-count-other": "{0} bags"
|
|
282
|
+
* }
|
|
283
|
+
* }
|
|
284
|
+
* </code>
|
|
285
|
+
* In the above snippet:
|
|
286
|
+
* * <code>"BAG"</code> represent the unit key which is used to reference it.
|
|
287
|
+
* * <code>"unitPattern-count-one"</code> represent the unit pattern for the form "one", e.g. the number <code>1</code> in the 'en' locale.
|
|
288
|
+
* * <code>"unitPattern-count-other"</code> represent the unit pattern for all other numbers which do not
|
|
289
|
+
* match the plural forms of the previous patterns.
|
|
290
|
+
* * In the patterns <code>{0}</code> is replaced by the number
|
|
291
|
+
*
|
|
292
|
+
* E.g. In locale 'en' value <code>1</code> would result in <code>1 Bag</code>, while <code>2</code> would result in <code>2 Bags</code>
|
|
293
|
+
* @param {object} mUnits custom unit object which replaces the current custom unit definition. Call with <code>null</code> to delete custom units.
|
|
294
|
+
* @returns {this} The config for chaining
|
|
295
|
+
* @private
|
|
296
|
+
*/
|
|
297
|
+
setCustomUnits: function (mUnits) {
|
|
298
|
+
// add custom units, or remove the existing ones if none are given
|
|
299
|
+
var mUnitsshort = null;
|
|
300
|
+
if (mUnits) {
|
|
301
|
+
mUnitsshort = {
|
|
302
|
+
"short": mUnits
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
Formatting._set("units", mUnitsshort);
|
|
306
|
+
return this;
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Adds custom units.
|
|
311
|
+
* Similar to {@link #setCustomUnits} but instead of setting the custom units, it will add additional ones.
|
|
312
|
+
* @param {object} mUnits custom unit object which replaces the current custom unit definition. Call with <code>null</code> to delete custom units.
|
|
313
|
+
* @returns {this} The config for chaining
|
|
314
|
+
* @see #setCustomUnits
|
|
315
|
+
* @private
|
|
316
|
+
*/
|
|
317
|
+
addCustomUnits: function (mUnits) {
|
|
318
|
+
// add custom units, or remove the existing ones if none are given
|
|
319
|
+
var mExistingUnits = Formatting.getCustomUnits();
|
|
320
|
+
if (mExistingUnits){
|
|
321
|
+
mUnits = extend({}, mExistingUnits, mUnits);
|
|
322
|
+
}
|
|
323
|
+
Formatting.setCustomUnits(mUnits);
|
|
324
|
+
return this;
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Sets custom unit mappings.
|
|
329
|
+
* Unit mappings contain key value pairs (both strings)
|
|
330
|
+
* * {string} key: a new entry which maps to an existing unit key
|
|
331
|
+
* * {string} value: an existing unit key
|
|
332
|
+
*
|
|
333
|
+
* Example:
|
|
334
|
+
* <code>
|
|
335
|
+
* {
|
|
336
|
+
* "my": "my-custom-unit",
|
|
337
|
+
* "cm": "length-centimeter"
|
|
338
|
+
* }
|
|
339
|
+
* </code>
|
|
340
|
+
* Note: It is possible to create multiple entries per unit key.
|
|
341
|
+
* Call with <code>null</code> to delete unit mappings.
|
|
342
|
+
* @param {object} mUnitMappings unit mappings
|
|
343
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
344
|
+
*/
|
|
345
|
+
setUnitMappings: function (mUnitMappings) {
|
|
346
|
+
Formatting._set("unitMappings", mUnitMappings);
|
|
347
|
+
return this;
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Adds unit mappings.
|
|
352
|
+
* Similar to {@link #setUnitMappings} but instead of setting the unit mappings, it will add additional ones.
|
|
353
|
+
* @param {object} mUnitMappings unit mappings
|
|
354
|
+
* @returns {this} The config for chaining
|
|
355
|
+
* @see #setUnitMappings
|
|
356
|
+
* @private
|
|
357
|
+
*/
|
|
358
|
+
addUnitMappings: function (mUnitMappings) {
|
|
359
|
+
// add custom units, or remove the existing ones if none are given
|
|
360
|
+
var mExistingUnits = Formatting.getUnitMappings();
|
|
361
|
+
if (mExistingUnits){
|
|
362
|
+
mUnitMappings = extend({}, mExistingUnits, mUnitMappings);
|
|
363
|
+
}
|
|
364
|
+
Formatting.setUnitMappings(mUnitMappings);
|
|
365
|
+
return this;
|
|
366
|
+
},
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Retrieves the unit mappings.
|
|
370
|
+
* These unit mappings are set by {@link #setUnitMappings} and {@link #addUnitMappings}
|
|
371
|
+
* @returns {object} unit mapping object
|
|
372
|
+
* @see #setUnitMappings
|
|
373
|
+
* @see #addUnitMappings
|
|
374
|
+
*/
|
|
375
|
+
getUnitMappings: function () {
|
|
376
|
+
return mSettings["unitMappings"];
|
|
377
|
+
},
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Returns the currently set date pattern or undefined if no pattern has been defined.
|
|
381
|
+
* @param {string} sStyle The date style (short, medium, long or full)
|
|
382
|
+
* @return {string} The resulting date pattern
|
|
383
|
+
* @public
|
|
384
|
+
*/
|
|
385
|
+
getDatePattern : function(sStyle) {
|
|
386
|
+
assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
|
|
387
|
+
return mSettings["dateFormats-" + sStyle];
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Defines the preferred format pattern for the given date format style.
|
|
392
|
+
*
|
|
393
|
+
* Calling this method with a null or undefined pattern removes a previously set pattern.
|
|
394
|
+
*
|
|
395
|
+
* If a pattern is defined, it will be preferred over patterns derived from the current locale.
|
|
396
|
+
*
|
|
397
|
+
* See class {@link sap.ui.core.format.DateFormat} for details about the pattern syntax.
|
|
398
|
+
*
|
|
399
|
+
* After changing the date pattern, the framework tries to update localization
|
|
400
|
+
* specific parts of the UI. See the documentation of {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
401
|
+
* for details and restrictions.
|
|
402
|
+
*
|
|
403
|
+
* @param {string} sStyle must be one of short, medium, long or full.
|
|
404
|
+
* @param {string} sPattern the format pattern to be used in LDML syntax.
|
|
405
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
406
|
+
* @public
|
|
407
|
+
*/
|
|
408
|
+
setDatePattern : function(sStyle, sPattern) {
|
|
409
|
+
check(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
|
|
410
|
+
Formatting._set("dateFormats-" + sStyle, sPattern);
|
|
411
|
+
return this;
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Returns the currently set time pattern or undefined if no pattern has been defined.
|
|
416
|
+
* @param {string} sStyle The time style (short, medium, long or full)
|
|
417
|
+
* @return {string} The resulting time pattern
|
|
418
|
+
* @public
|
|
419
|
+
*/
|
|
420
|
+
getTimePattern : function(sStyle) {
|
|
421
|
+
assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
|
|
422
|
+
return mSettings["timeFormats-" + sStyle];
|
|
423
|
+
},
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Defines the preferred format pattern for the given time format style.
|
|
427
|
+
*
|
|
428
|
+
* Calling this method with a null or undefined pattern removes a previously set pattern.
|
|
429
|
+
*
|
|
430
|
+
* If a pattern is defined, it will be preferred over patterns derived from the current locale.
|
|
431
|
+
*
|
|
432
|
+
* See class {@link sap.ui.core.format.DateFormat} for details about the pattern syntax.
|
|
433
|
+
*
|
|
434
|
+
* After changing the time pattern, the framework tries to update localization
|
|
435
|
+
* specific parts of the UI. See the documentation of
|
|
436
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
437
|
+
* for details and restrictions.
|
|
438
|
+
*
|
|
439
|
+
* @param {string} sStyle must be one of short, medium, long or full.
|
|
440
|
+
* @param {string} sPattern the format pattern to be used in LDML syntax.
|
|
441
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
setTimePattern : function(sStyle, sPattern) {
|
|
445
|
+
check(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full");
|
|
446
|
+
Formatting._set("timeFormats-" + sStyle, sPattern);
|
|
447
|
+
return this;
|
|
448
|
+
},
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Returns the currently set number symbol of the given type or undefined if no symbol has been defined.
|
|
452
|
+
*
|
|
453
|
+
* @param {"group"|"decimal"|"plusSign"|"minusSign"} sType the type of symbol
|
|
454
|
+
* @return {string} A non-numerical symbol used as part of a number for the given type,
|
|
455
|
+
* e.g. for locale de_DE:
|
|
456
|
+
* <ul>
|
|
457
|
+
* <li>"group": "." (grouping separator)</li>
|
|
458
|
+
* <li>"decimal": "," (decimal separator)</li>
|
|
459
|
+
* <li>"plusSign": "+" (plus sign)</li>
|
|
460
|
+
* <li>"minusSign": "-" (minus sign)</li>
|
|
461
|
+
* </ul>
|
|
462
|
+
* @public
|
|
463
|
+
*/
|
|
464
|
+
getNumberSymbol : function(sType) {
|
|
465
|
+
assert(["group", "decimal", "plusSign", "minusSign"].includes(sType), "sType must be decimal, group, plusSign or minusSign");
|
|
466
|
+
return mSettings["symbols-latn-" + sType];
|
|
467
|
+
},
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Defines the string to be used for the given number symbol.
|
|
471
|
+
*
|
|
472
|
+
* Calling this method with a null or undefined symbol removes a previously set symbol string.
|
|
473
|
+
* Note that an empty string is explicitly allowed.
|
|
474
|
+
*
|
|
475
|
+
* If a symbol is defined, it will be preferred over symbols derived from the current locale.
|
|
476
|
+
*
|
|
477
|
+
* See class {@link sap.ui.core.format.NumberFormat} for details about the symbols.
|
|
478
|
+
*
|
|
479
|
+
* After changing the number symbol, the framework tries to update localization
|
|
480
|
+
* specific parts of the UI. See the documentation of
|
|
481
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
482
|
+
* for details and restrictions.
|
|
483
|
+
*
|
|
484
|
+
* @param {"group"|"decimal"|"plusSign"|"minusSign"} sType the type of symbol
|
|
485
|
+
* @param {string} sSymbol will be used to represent the given symbol type
|
|
486
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
487
|
+
* @public
|
|
488
|
+
*/
|
|
489
|
+
setNumberSymbol : function(sType, sSymbol) {
|
|
490
|
+
check(["group", "decimal", "plusSign", "minusSign"].includes(sType), "sType must be decimal, group, plusSign or minusSign");
|
|
491
|
+
Formatting._set("symbols-latn-" + sType, sSymbol);
|
|
492
|
+
return this;
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Retrieves the custom currencies.
|
|
497
|
+
* E.g.
|
|
498
|
+
* <code>
|
|
499
|
+
* {
|
|
500
|
+
* "KWD": {"digits": 3},
|
|
501
|
+
* "TND" : {"digits": 3}
|
|
502
|
+
* }
|
|
503
|
+
* </code>
|
|
504
|
+
* @public
|
|
505
|
+
* @returns {object} the mapping between custom currencies and its digits
|
|
506
|
+
*/
|
|
507
|
+
getCustomCurrencies : function() {
|
|
508
|
+
return mSettings["currency"];
|
|
509
|
+
},
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Sets custom currencies and replaces existing entries.
|
|
513
|
+
*
|
|
514
|
+
* There is a special currency code named "DEFAULT" that is optional.
|
|
515
|
+
* In case it is set it will be used for all currencies not contained
|
|
516
|
+
* in the list, otherwise currency digits as defined by the CLDR will
|
|
517
|
+
* be used as a fallback.
|
|
518
|
+
*
|
|
519
|
+
* Example:
|
|
520
|
+
* To use CLDR, but override single currencies
|
|
521
|
+
* <code>
|
|
522
|
+
* {
|
|
523
|
+
* "KWD": {"digits": 3},
|
|
524
|
+
* "TND" : {"digits": 3}
|
|
525
|
+
* }
|
|
526
|
+
* </code>
|
|
527
|
+
*
|
|
528
|
+
* To replace the CLDR currency digits completely
|
|
529
|
+
* <code>
|
|
530
|
+
* {
|
|
531
|
+
* "DEFAULT": {"digits": 2},
|
|
532
|
+
* "ADP": {"digits": 0},
|
|
533
|
+
* ...
|
|
534
|
+
* "XPF": {"digits": 0}
|
|
535
|
+
* }
|
|
536
|
+
* </code>
|
|
537
|
+
*
|
|
538
|
+
* Note: To unset the custom currencies: call with <code>undefined</code>
|
|
539
|
+
* Custom currencies must not only consist of digits but contain at least one non-digit character, e.g. "a",
|
|
540
|
+
* so that the measure part can be distinguished from the number part.
|
|
541
|
+
* @public
|
|
542
|
+
* @param {object} mCurrencies currency map which is set
|
|
543
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
544
|
+
*/
|
|
545
|
+
setCustomCurrencies : function(mCurrencies) {
|
|
546
|
+
check(typeof mCurrencies === "object" || mCurrencies == null, "mCurrencyDigits must be an object");
|
|
547
|
+
Object.keys(mCurrencies || {}).forEach(function(sCurrencyDigit) {
|
|
548
|
+
check(typeof sCurrencyDigit === "string");
|
|
549
|
+
check(typeof mCurrencies[sCurrencyDigit] === "object");
|
|
550
|
+
});
|
|
551
|
+
Formatting._set("currency", mCurrencies);
|
|
552
|
+
return this;
|
|
553
|
+
},
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Adds custom currencies to the existing entries.
|
|
557
|
+
* E.g.
|
|
558
|
+
* <code>
|
|
559
|
+
* {
|
|
560
|
+
* "KWD": {"digits": 3},
|
|
561
|
+
* "TND" : {"digits": 3}
|
|
562
|
+
* }
|
|
563
|
+
* </code>
|
|
564
|
+
*
|
|
565
|
+
* @public
|
|
566
|
+
* @param {object} mCurrencies adds to the currency map
|
|
567
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
568
|
+
* @see #setCustomCurrencies
|
|
569
|
+
*/
|
|
570
|
+
addCustomCurrencies: function (mCurrencies) {
|
|
571
|
+
// add custom units, or remove the existing ones if none are given
|
|
572
|
+
var mExistingCurrencies = Formatting.getCustomCurrencies();
|
|
573
|
+
if (mExistingCurrencies){
|
|
574
|
+
mCurrencies = extend({}, mExistingCurrencies, mCurrencies);
|
|
575
|
+
}
|
|
576
|
+
Formatting.setCustomCurrencies(mCurrencies);
|
|
577
|
+
return this;
|
|
578
|
+
},
|
|
579
|
+
|
|
580
|
+
_setDayPeriods : function(sWidth, aTexts) {
|
|
581
|
+
assert(sWidth == "narrow" || sWidth == "abbreviated" || sWidth == "wide", "sWidth must be narrow, abbreviated or wide");
|
|
582
|
+
Formatting._set("dayPeriods-format-" + sWidth, aTexts);
|
|
583
|
+
return this;
|
|
584
|
+
},
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Returns the currently set legacy ABAP date format (its id) or undefined if none has been set.
|
|
588
|
+
*
|
|
589
|
+
* @return {"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"A"|"B"|"C"|undefined} ID of the ABAP date format,
|
|
590
|
+
* if not set or set to <code>""</code>, <code>undefined</code> will be returned
|
|
591
|
+
* @public
|
|
592
|
+
*/
|
|
593
|
+
getLegacyDateFormat : function() {
|
|
594
|
+
var sLegacyDateFormat = oWritableConfig.get({
|
|
595
|
+
name: "sapUiLegacyDateFormat",
|
|
596
|
+
type: BaseConfig.Type.String,
|
|
597
|
+
defaultValue: undefined,
|
|
598
|
+
external: true
|
|
599
|
+
});
|
|
600
|
+
return sLegacyDateFormat ? sLegacyDateFormat.toUpperCase() : undefined;
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Allows to specify one of the legacy ABAP date formats.
|
|
605
|
+
*
|
|
606
|
+
* This method modifies the date patterns for 'short' and 'medium' style with the corresponding ABAP
|
|
607
|
+
* format. When called with a null or undefined format id, any previously applied format will be removed.
|
|
608
|
+
*
|
|
609
|
+
* After changing the legacy date format, the framework tries to update localization
|
|
610
|
+
* specific parts of the UI. See the documentation of
|
|
611
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
612
|
+
* for details and restrictions.
|
|
613
|
+
*
|
|
614
|
+
* @param {""|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"A"|"B"|"C"} [sFormatId=""] ID of the ABAP date format,
|
|
615
|
+
* <code>""</code> will reset the date patterns for 'short' and 'medium' style to the
|
|
616
|
+
* locale-specific ones.
|
|
617
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
618
|
+
* @public
|
|
619
|
+
*/
|
|
620
|
+
setLegacyDateFormat : function(sFormatId) {
|
|
621
|
+
sFormatId = sFormatId ? String(sFormatId).toUpperCase() : "";
|
|
622
|
+
check(M_ABAP_DATE_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['1','2','3','4','5','6','7','8','9','A','B','C'] or empty");
|
|
623
|
+
var bFireEvent = !mChanges;
|
|
624
|
+
var sOldFormat = Formatting.getLegacyDateFormat();
|
|
625
|
+
if (sOldFormat !== sFormatId) {
|
|
626
|
+
mChanges = mChanges || {};
|
|
627
|
+
oWritableConfig.set("sapUiLegacyDateFormat", sFormatId);
|
|
628
|
+
mChanges.legacyDateFormat = sFormatId;
|
|
629
|
+
Formatting.setDatePattern("short", M_ABAP_DATE_FORMAT_PATTERN[sFormatId].pattern);
|
|
630
|
+
Formatting.setDatePattern("medium", M_ABAP_DATE_FORMAT_PATTERN[sFormatId].pattern);
|
|
631
|
+
if (bFireEvent) {
|
|
632
|
+
fireChange();
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return this;
|
|
636
|
+
},
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Returns the currently set legacy ABAP time format (its id) or undefined if none has been set.
|
|
640
|
+
*
|
|
641
|
+
* @return {"0"|"1"|"2"|"3"|"4"|undefined} ID of the ABAP date format,
|
|
642
|
+
* if not set or set to <code>""</code>, <code>undefined</code> will be returned
|
|
643
|
+
* @public
|
|
644
|
+
*/
|
|
645
|
+
getLegacyTimeFormat : function() {
|
|
646
|
+
var sLegacyTimeFormat = oWritableConfig.get({
|
|
647
|
+
name: "sapUiLegacyTimeFormat",
|
|
648
|
+
type: BaseConfig.Type.String,
|
|
649
|
+
defaultValue: undefined,
|
|
650
|
+
external: true
|
|
651
|
+
});
|
|
652
|
+
return sLegacyTimeFormat ? sLegacyTimeFormat.toUpperCase() : undefined;
|
|
653
|
+
},
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Allows to specify one of the legacy ABAP time formats.
|
|
657
|
+
*
|
|
658
|
+
* This method sets the time patterns for 'short' and 'medium' style to the corresponding ABAP
|
|
659
|
+
* formats and sets the day period texts to "AM"/"PM" or "am"/"pm" respectively. When called
|
|
660
|
+
* with a null or undefined format id, any previously applied format will be removed.
|
|
661
|
+
*
|
|
662
|
+
* After changing the legacy time format, the framework tries to update localization
|
|
663
|
+
* specific parts of the UI. See the documentation of
|
|
664
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
665
|
+
* for details and restrictions.
|
|
666
|
+
*
|
|
667
|
+
* @param {""|"0"|"1"|"2"|"3"|"4"} [sFormatId=""] ID of the ABAP time format,
|
|
668
|
+
* <code>""</code> will reset the time patterns for 'short' and 'medium' style and the day
|
|
669
|
+
* period texts to the locale-specific ones.
|
|
670
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
671
|
+
* @public
|
|
672
|
+
*/
|
|
673
|
+
setLegacyTimeFormat : function(sFormatId) {
|
|
674
|
+
sFormatId = sFormatId || "";
|
|
675
|
+
check(M_ABAP_TIME_FORMAT_PATTERN.hasOwnProperty(sFormatId), "sFormatId must be one of ['0','1','2','3','4'] or empty");
|
|
676
|
+
var bFireEvent = !mChanges;
|
|
677
|
+
var sOldFormat = Formatting.getLegacyTimeFormat();
|
|
678
|
+
if (sOldFormat !== sFormatId) {
|
|
679
|
+
mChanges = mChanges || {};
|
|
680
|
+
oWritableConfig.set("sapUiLegacyTimeFormat", sFormatId);
|
|
681
|
+
mChanges.legacyTimeFormat = sFormatId;
|
|
682
|
+
Formatting.setTimePattern("short", M_ABAP_TIME_FORMAT_PATTERN[sFormatId]["short"]);
|
|
683
|
+
Formatting.setTimePattern("medium", M_ABAP_TIME_FORMAT_PATTERN[sFormatId]["medium"]);
|
|
684
|
+
Formatting._setDayPeriods("abbreviated", M_ABAP_TIME_FORMAT_PATTERN[sFormatId].dayPeriods);
|
|
685
|
+
if (bFireEvent) {
|
|
686
|
+
fireChange();
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return this;
|
|
690
|
+
},
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Returns the currently set legacy ABAP number format (its id) or undefined if none has been set.
|
|
694
|
+
*
|
|
695
|
+
* @return {" "|"X"|"Y"|undefined} ID of the ABAP number format,
|
|
696
|
+
* if not set or set to <code>""</code>, <code>undefined</code> will be returned
|
|
697
|
+
* @public
|
|
698
|
+
*/
|
|
699
|
+
getLegacyNumberFormat : function() {
|
|
700
|
+
var sLegacyNumberFormat = oWritableConfig.get({
|
|
701
|
+
name: "sapUiLegacyNumberFormat",
|
|
702
|
+
type: BaseConfig.Type.String,
|
|
703
|
+
defaultValue: undefined,
|
|
704
|
+
external: true
|
|
705
|
+
});
|
|
706
|
+
return sLegacyNumberFormat ? sLegacyNumberFormat.toUpperCase() : undefined;
|
|
707
|
+
},
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Allows to specify one of the legacy ABAP number format.
|
|
711
|
+
*
|
|
712
|
+
* This method will modify the 'group' and 'decimal' symbols. When called with a null
|
|
713
|
+
* or undefined format id, any previously applied format will be removed.
|
|
714
|
+
*
|
|
715
|
+
* After changing the legacy number format, the framework tries to update localization
|
|
716
|
+
* specific parts of the UI. See the documentation of
|
|
717
|
+
* {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}
|
|
718
|
+
* for details and restrictions.
|
|
719
|
+
*
|
|
720
|
+
* @param {""|" "|"X"|"Y"} [sFormatId=""] ID of the ABAP number format set,
|
|
721
|
+
* <code>""</code> will reset the 'group' and 'decimal' symbols to the locale-specific
|
|
722
|
+
* ones.
|
|
723
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
724
|
+
* @public
|
|
725
|
+
*/
|
|
726
|
+
setLegacyNumberFormat : function(sFormatId) {
|
|
727
|
+
sFormatId = sFormatId ? sFormatId.toUpperCase() : "";
|
|
728
|
+
check(M_ABAP_NUMBER_FORMAT_SYMBOLS.hasOwnProperty(sFormatId), "sFormatId must be one of [' ','X','Y'] or empty");
|
|
729
|
+
var bFireEvent = !mChanges;
|
|
730
|
+
var sOldFormat = Formatting.getLegacyNumberFormat();
|
|
731
|
+
if (sOldFormat !== sFormatId) {
|
|
732
|
+
mChanges = mChanges || {};
|
|
733
|
+
oWritableConfig.set("sapUiLegacyNumberFormat", sFormatId);
|
|
734
|
+
mChanges.legacyNumberFormat = sFormatId;
|
|
735
|
+
Formatting.setNumberSymbol("group", M_ABAP_NUMBER_FORMAT_SYMBOLS[sFormatId].groupingSeparator);
|
|
736
|
+
Formatting.setNumberSymbol("decimal", M_ABAP_NUMBER_FORMAT_SYMBOLS[sFormatId].decimalSeparator);
|
|
737
|
+
if (bFireEvent) {
|
|
738
|
+
fireChange();
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return this;
|
|
742
|
+
},
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Allows to specify the customizing data for Islamic calendar support
|
|
746
|
+
*
|
|
747
|
+
* @param {object[]} aMappings contains the customizing data for the support of Islamic calendar.
|
|
748
|
+
* @param {string} aMappings[].dateFormat The date format
|
|
749
|
+
* @param {string} aMappings[].islamicMonthStart The Islamic date
|
|
750
|
+
* @param {string} aMappings[].gregDate The corresponding Gregorian date
|
|
751
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
752
|
+
* @public
|
|
753
|
+
*/
|
|
754
|
+
setLegacyDateCalendarCustomizing : function(aMappings) {
|
|
755
|
+
check(Array.isArray(aMappings), "aMappings must be an Array");
|
|
756
|
+
var bFireEvent = !mChanges;
|
|
757
|
+
mChanges = mChanges || {};
|
|
758
|
+
Formatting.aLegacyDateCalendarCustomizing = mChanges.legacyDateCalendarCustomizing = aMappings.slice();
|
|
759
|
+
if (bFireEvent) {
|
|
760
|
+
fireChange();
|
|
761
|
+
}
|
|
762
|
+
return this;
|
|
763
|
+
},
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Returns the currently set customizing data for Islamic calendar support
|
|
767
|
+
*
|
|
768
|
+
* @return {object[]} Returns an array contains the customizing data. Each element in the array has properties: dateFormat, islamicMonthStart, gregDate. For details, please see {@link #setLegacyDateCalendarCustomizing}
|
|
769
|
+
* @public
|
|
770
|
+
*/
|
|
771
|
+
getLegacyDateCalendarCustomizing : function() {
|
|
772
|
+
var aLegacyDateCalendarCustomizing = Formatting.aLegacyDateCalendarCustomizing;
|
|
773
|
+
if (aLegacyDateCalendarCustomizing) {
|
|
774
|
+
aLegacyDateCalendarCustomizing = aLegacyDateCalendarCustomizing.slice();
|
|
775
|
+
}
|
|
776
|
+
return aLegacyDateCalendarCustomizing;
|
|
777
|
+
},
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Define whether the NumberFormatter shall always place the currency code after the numeric value, with
|
|
781
|
+
* the only exception of right-to-left locales, where the currency code shall be placed before the numeric value.
|
|
782
|
+
* Default configuration setting is <code>true</code>.
|
|
783
|
+
*
|
|
784
|
+
* When set to <code>false</code> the placement of the currency code is done dynamically, depending on the
|
|
785
|
+
* configured locale using data provided by the Unicode Common Locale Data Repository (CLDR).
|
|
786
|
+
*
|
|
787
|
+
* Each currency instance ({@link sap.ui.core.format.NumberFormat.getCurrencyInstance}) will be created
|
|
788
|
+
* with this setting unless overwritten on instance level.
|
|
789
|
+
*
|
|
790
|
+
* @param {boolean} bTrailingCurrencyCode Whether currency codes shall always be placed after the numeric value
|
|
791
|
+
* @returns {this} Returns <code>this</code> to allow method chaining
|
|
792
|
+
* @since 1.75.0
|
|
793
|
+
* @public
|
|
794
|
+
*/
|
|
795
|
+
setTrailingCurrencyCode : function(bTrailingCurrencyCode) {
|
|
796
|
+
check(typeof bTrailingCurrencyCode === "boolean", "bTrailingCurrencyCode must be a boolean");
|
|
797
|
+
oWritableConfig.set("sapUiTrailingCurrencyCode", bTrailingCurrencyCode);
|
|
798
|
+
return this;
|
|
799
|
+
},
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Returns current trailingCurrencyCode configuration for new NumberFormatter instances
|
|
803
|
+
*
|
|
804
|
+
* @return {boolean} Whether currency codes shall always be placed after the numeric value
|
|
805
|
+
* @since 1.75.0
|
|
806
|
+
* @public
|
|
807
|
+
*/
|
|
808
|
+
getTrailingCurrencyCode : function() {
|
|
809
|
+
return oWritableConfig.get({
|
|
810
|
+
name: "sapUiTrailingCurrencyCode",
|
|
811
|
+
type: BaseConfig.Type.Boolean,
|
|
812
|
+
defaultValue: true,
|
|
813
|
+
external: true
|
|
814
|
+
});
|
|
815
|
+
},
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Returns a live object with the current settings
|
|
819
|
+
* TODO this method is part of the facade to be accessible from LocaleData, but it shouldn't be
|
|
820
|
+
*
|
|
821
|
+
* @return {mSettings} The custom LocaleData settings object
|
|
822
|
+
* @private
|
|
823
|
+
*/
|
|
824
|
+
getCustomLocaleData : function() {
|
|
825
|
+
return mSettings;
|
|
826
|
+
},
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Returns the calendar week numbering algorithm used to determine the first day of the week
|
|
830
|
+
* and the first calendar week of the year, see {@link sap.base.i18n.CalendarWeekNumbering}.
|
|
831
|
+
*
|
|
832
|
+
* @returns {sap.base.i18n.CalendarWeekNumbering} The calendar week numbering algorithm
|
|
833
|
+
*
|
|
834
|
+
* @public
|
|
835
|
+
* @since 1.113.0
|
|
836
|
+
*/
|
|
837
|
+
getCalendarWeekNumbering: function() {
|
|
838
|
+
var oCalendarWeekNumbering = CalendarWeekNumbering.Default;
|
|
839
|
+
|
|
840
|
+
try {
|
|
841
|
+
oCalendarWeekNumbering = oWritableConfig.get({
|
|
842
|
+
name: "sapUiCalendarWeekNumbering",
|
|
843
|
+
type: CalendarWeekNumbering,
|
|
844
|
+
defaultValue: CalendarWeekNumbering.Default,
|
|
845
|
+
external: true
|
|
846
|
+
});
|
|
847
|
+
} catch (err) {
|
|
848
|
+
//nothing to do, return default;
|
|
849
|
+
}
|
|
850
|
+
return oCalendarWeekNumbering;
|
|
851
|
+
},
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Sets the calendar week numbering algorithm which is used to determine the first day of the week
|
|
855
|
+
* and the first calendar week of the year, see {@link sap.base.i18n.CalendarWeekNumbering}.
|
|
856
|
+
*
|
|
857
|
+
* @param {sap.base.i18n.CalendarWeekNumbering} sCalendarWeekNumbering
|
|
858
|
+
* The calendar week numbering algorithm
|
|
859
|
+
* @returns {this}
|
|
860
|
+
* <code>this</code> to allow method chaining
|
|
861
|
+
* @throws {Error}
|
|
862
|
+
* If <code>sCalendarWeekNumbering</code> is not a valid calendar week numbering algorithm,
|
|
863
|
+
* defined in {@link sap.base.i18n.CalendarWeekNumbering}
|
|
864
|
+
*
|
|
865
|
+
* @public
|
|
866
|
+
* @since 1.113.0
|
|
867
|
+
*/
|
|
868
|
+
setCalendarWeekNumbering: function(sCalendarWeekNumbering) {
|
|
869
|
+
BaseConfig._.checkEnum(CalendarWeekNumbering, sCalendarWeekNumbering, "calendarWeekNumbering");
|
|
870
|
+
var sCurrentWeekNumbering = oWritableConfig.get({
|
|
871
|
+
name: "sapUiCalendarWeekNumbering",
|
|
872
|
+
type: CalendarWeekNumbering,
|
|
873
|
+
defaultValue: CalendarWeekNumbering.Default,
|
|
874
|
+
external: true
|
|
875
|
+
});
|
|
876
|
+
if (sCurrentWeekNumbering !== sCalendarWeekNumbering) {
|
|
877
|
+
var bFireEvent = !mChanges;
|
|
878
|
+
mChanges = mChanges || {};
|
|
879
|
+
oWritableConfig.set("sapUiCalendarWeekNumbering", sCalendarWeekNumbering);
|
|
880
|
+
mChanges.calendarWeekNumbering = sCalendarWeekNumbering;
|
|
881
|
+
if (bFireEvent) {
|
|
882
|
+
fireChange();
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
return this;
|
|
886
|
+
},
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Returns the calendar type which is being used in locale dependent functionality.
|
|
890
|
+
*
|
|
891
|
+
* When it's explicitly set by calling <code>setCalendar</code>, the set calendar type is returned.
|
|
892
|
+
* Otherwise, the calendar type is determined by checking the format settings and current locale.
|
|
893
|
+
*
|
|
894
|
+
* @return {sap.base.i18n.CalendarType} the current calendar type, e.g. <code>Gregorian</code>
|
|
895
|
+
* @since 1.28.6
|
|
896
|
+
*/
|
|
897
|
+
getCalendarType: function() {
|
|
898
|
+
var sName,
|
|
899
|
+
sCalendarType = oWritableConfig.get({
|
|
900
|
+
name: "sapUiCalendarType",
|
|
901
|
+
type: BaseConfig.Type.String,
|
|
902
|
+
defaultValue: null,
|
|
903
|
+
external: true
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
if (sCalendarType) {
|
|
907
|
+
for (sName in CalendarType) {
|
|
908
|
+
if (sName.toLowerCase() === sCalendarType.toLowerCase()) {
|
|
909
|
+
return sName;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
Log.warning("Parameter 'calendarType' is set to " + sCalendarType + " which isn't a valid value and therefore ignored. The calendar type is determined from format setting and current locale");
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
var sLegacyDateFormat = Formatting.getLegacyDateFormat();
|
|
916
|
+
|
|
917
|
+
switch (sLegacyDateFormat) {
|
|
918
|
+
case "1":
|
|
919
|
+
case "2":
|
|
920
|
+
case "3":
|
|
921
|
+
case "4":
|
|
922
|
+
case "5":
|
|
923
|
+
case "6":
|
|
924
|
+
return CalendarType.Gregorian;
|
|
925
|
+
case "7":
|
|
926
|
+
case "8":
|
|
927
|
+
case "9":
|
|
928
|
+
return CalendarType.Japanese;
|
|
929
|
+
case "A":
|
|
930
|
+
case "B":
|
|
931
|
+
return CalendarType.Islamic;
|
|
932
|
+
case "C":
|
|
933
|
+
return CalendarType.Persian;
|
|
934
|
+
default:
|
|
935
|
+
return Localization.getPreferredCalendarType();
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Sets the new calendar type to be used from now on in locale dependent functionality (for example,
|
|
941
|
+
* formatting, translation texts, etc.).
|
|
942
|
+
*
|
|
943
|
+
* @param {sap.base.i18n.CalendarType|null} sCalendarType the new calendar type. Set it with null to clear the calendar type
|
|
944
|
+
* and the calendar type is calculated based on the format settings and current locale.
|
|
945
|
+
* @return {this} <code>this</code> to allow method chaining
|
|
946
|
+
* @public
|
|
947
|
+
* @since 1.28.6
|
|
948
|
+
*/
|
|
949
|
+
setCalendarType : function(sCalendarType) {
|
|
950
|
+
var sOldCalendarType = Formatting.getCalendarType();
|
|
951
|
+
oWritableConfig.set("sapUiCalendarType", sCalendarType);
|
|
952
|
+
var sCurrentCalendarType = Formatting.getCalendarType();
|
|
953
|
+
if (sOldCalendarType !== sCurrentCalendarType) {
|
|
954
|
+
var bFireEvent = !mChanges;
|
|
955
|
+
mChanges = mChanges || {};
|
|
956
|
+
mChanges.calendarType = sCurrentCalendarType;
|
|
957
|
+
if (bFireEvent) {
|
|
958
|
+
fireChange();
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
return this;
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
function fireChange() {
|
|
966
|
+
Formatting.fireEvent("change", mChanges);
|
|
967
|
+
mChanges = undefined;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
function init() {
|
|
971
|
+
// init legacy formats
|
|
972
|
+
var sLegacyDateFormat = Formatting.getLegacyDateFormat();
|
|
973
|
+
if (sLegacyDateFormat !== undefined) {
|
|
974
|
+
Formatting.setLegacyDateFormat(sLegacyDateFormat);
|
|
975
|
+
}
|
|
976
|
+
var sLegacyNumberFormat = Formatting.getLegacyNumberFormat();
|
|
977
|
+
if (sLegacyNumberFormat !== undefined) {
|
|
978
|
+
Formatting.setLegacyNumberFormat(sLegacyNumberFormat);
|
|
979
|
+
}
|
|
980
|
+
var sLegacyTimeFormat = Formatting.getLegacyTimeFormat();
|
|
981
|
+
if (sLegacyTimeFormat !== undefined) {
|
|
982
|
+
Formatting.setLegacyTimeFormat(sLegacyTimeFormat);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
Eventing.apply(Formatting);
|
|
987
|
+
|
|
988
|
+
init();
|
|
989
|
+
|
|
990
|
+
return Formatting;
|
|
991
|
+
});
|