@openui5/sap.ui.core 1.99.1 → 1.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +27 -5
- package/THIRDPARTY.txt +5 -5
- package/package.json +1 -1
- package/src/jquery.sap.global.js +6 -3
- 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/sap/base/Log.js +1 -1
- package/src/sap/base/assert.js +1 -1
- package/src/sap/base/strings/whitespaceReplacer.js +1 -1
- package/src/sap/base/util/LoaderExtensions.js +1 -10
- package/src/sap/base/util/UriParameters.js +2 -2
- package/src/sap/base/util/restricted/_CancelablePromise.js +2 -2
- 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 +2 -2
- package/src/sap/ui/base/ExpressionParser.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +1 -1
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/ManagedObjectObserver.js +2 -0
- package/src/sap/ui/base/ManagedObjectRegistry.js +10 -5
- 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/core/.library +2 -1
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/CommandExecution.js +15 -12
- package/src/sap/ui/core/Component.js +50 -27
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +28 -13
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +25 -9
- package/src/sap/ui/core/Control.js +2 -3
- package/src/sap/ui/core/Core.js +121 -36
- 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 +1 -1
- 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/ExtensionPoint.js +6 -1
- package/src/sap/ui/core/FocusHandler.js +2 -3
- 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 +17 -3
- 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 +1 -1
- package/src/sap/ui/core/LocaleData.js +159 -9
- package/src/sap/ui/core/Manifest.js +5 -3
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Patcher.js +6 -4
- package/src/sap/ui/core/Popup.js +21 -20
- 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 +21 -15
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ShortcutHintsMixin.js +2 -4
- 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 +3 -5
- 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 +521 -395
- package/src/sap/ui/core/_IconRegistry.js +3 -2
- package/src/sap/ui/core/cache/CacheManager.js +28 -1
- package/src/sap/ui/core/cache/CacheManagerNOP.js +3 -0
- package/src/sap/ui/core/cache/LRUPersistentCache.js +76 -4
- package/src/sap/ui/core/cldr/ar.json +469 -1
- package/src/sap/ui/core/cldr/ar_EG.json +469 -1
- package/src/sap/ui/core/cldr/ar_SA.json +469 -1
- package/src/sap/ui/core/cldr/bg.json +469 -1
- package/src/sap/ui/core/cldr/ca.json +469 -1
- package/src/sap/ui/core/cldr/cs.json +469 -1
- package/src/sap/ui/core/cldr/cy.json +469 -1
- package/src/sap/ui/core/cldr/da.json +469 -1
- package/src/sap/ui/core/cldr/de.json +469 -1
- package/src/sap/ui/core/cldr/de_AT.json +469 -1
- package/src/sap/ui/core/cldr/de_CH.json +469 -1
- package/src/sap/ui/core/cldr/el.json +469 -1
- package/src/sap/ui/core/cldr/el_CY.json +469 -1
- package/src/sap/ui/core/cldr/en.json +469 -1
- package/src/sap/ui/core/cldr/en_AU.json +470 -2
- package/src/sap/ui/core/cldr/en_GB.json +469 -1
- package/src/sap/ui/core/cldr/en_HK.json +469 -1
- package/src/sap/ui/core/cldr/en_IE.json +469 -1
- package/src/sap/ui/core/cldr/en_IN.json +469 -1
- package/src/sap/ui/core/cldr/en_NZ.json +469 -1
- package/src/sap/ui/core/cldr/en_PG.json +469 -1
- package/src/sap/ui/core/cldr/en_SG.json +469 -1
- package/src/sap/ui/core/cldr/en_ZA.json +469 -1
- package/src/sap/ui/core/cldr/es.json +469 -1
- package/src/sap/ui/core/cldr/es_AR.json +469 -1
- package/src/sap/ui/core/cldr/es_BO.json +469 -1
- package/src/sap/ui/core/cldr/es_CL.json +469 -1
- package/src/sap/ui/core/cldr/es_CO.json +469 -1
- package/src/sap/ui/core/cldr/es_MX.json +469 -1
- package/src/sap/ui/core/cldr/es_PE.json +469 -1
- package/src/sap/ui/core/cldr/es_UY.json +469 -1
- package/src/sap/ui/core/cldr/es_VE.json +469 -1
- package/src/sap/ui/core/cldr/et.json +469 -1
- package/src/sap/ui/core/cldr/fa.json +469 -1
- package/src/sap/ui/core/cldr/fi.json +469 -1
- package/src/sap/ui/core/cldr/fr.json +469 -1
- package/src/sap/ui/core/cldr/fr_BE.json +469 -1
- package/src/sap/ui/core/cldr/fr_CA.json +469 -1
- package/src/sap/ui/core/cldr/fr_CH.json +469 -1
- package/src/sap/ui/core/cldr/fr_LU.json +469 -1
- package/src/sap/ui/core/cldr/he.json +469 -1
- package/src/sap/ui/core/cldr/hi.json +469 -1
- package/src/sap/ui/core/cldr/hr.json +469 -1
- package/src/sap/ui/core/cldr/hu.json +469 -1
- package/src/sap/ui/core/cldr/id.json +469 -1
- package/src/sap/ui/core/cldr/it.json +469 -1
- package/src/sap/ui/core/cldr/it_CH.json +469 -1
- package/src/sap/ui/core/cldr/ja.json +469 -1
- package/src/sap/ui/core/cldr/kk.json +469 -1
- package/src/sap/ui/core/cldr/ko.json +469 -1
- package/src/sap/ui/core/cldr/lt.json +469 -1
- package/src/sap/ui/core/cldr/lv.json +469 -1
- package/src/sap/ui/core/cldr/ms.json +469 -1
- package/src/sap/ui/core/cldr/nb.json +469 -1
- package/src/sap/ui/core/cldr/nl.json +469 -1
- package/src/sap/ui/core/cldr/nl_BE.json +469 -1
- package/src/sap/ui/core/cldr/pl.json +469 -1
- package/src/sap/ui/core/cldr/pt.json +469 -1
- package/src/sap/ui/core/cldr/pt_PT.json +469 -1
- package/src/sap/ui/core/cldr/ro.json +469 -1
- package/src/sap/ui/core/cldr/ru.json +469 -1
- package/src/sap/ui/core/cldr/ru_UA.json +469 -1
- package/src/sap/ui/core/cldr/sk.json +469 -1
- package/src/sap/ui/core/cldr/sl.json +469 -1
- package/src/sap/ui/core/cldr/sr.json +469 -1
- package/src/sap/ui/core/cldr/sr_Latn.json +469 -1
- package/src/sap/ui/core/cldr/sv.json +469 -1
- package/src/sap/ui/core/cldr/th.json +469 -1
- package/src/sap/ui/core/cldr/tr.json +469 -1
- package/src/sap/ui/core/cldr/uk.json +469 -1
- package/src/sap/ui/core/cldr/vi.json +469 -1
- package/src/sap/ui/core/cldr/zh_CN.json +470 -2
- package/src/sap/ui/core/cldr/zh_HK.json +470 -2
- package/src/sap/ui/core/cldr/zh_SG.json +470 -2
- package/src/sap/ui/core/cldr/zh_TW.json +469 -1
- package/src/sap/ui/core/date/Buddhist.js +3 -3
- package/src/sap/ui/core/date/Japanese.js +3 -3
- package/src/sap/ui/core/date/UniversalDate.js +10 -0
- package/src/sap/ui/core/date/UniversalDateUtils.js +49 -49
- package/src/sap/ui/core/delegate/ItemNavigation.js +13 -14
- package/src/sap/ui/core/delegate/ScrollEnablement.js +11 -7
- package/src/sap/ui/core/dnd/DragAndDrop.js +27 -22
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -2
- 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 +3 -3
- package/src/sap/ui/core/format/DateFormat.js +285 -151
- package/src/sap/ui/core/format/DateFormatTimezoneDisplay.js +4 -0
- package/src/sap/ui/core/format/NumberFormat.js +331 -179
- package/src/sap/ui/core/format/TimezoneUtil.js +50 -18
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +219 -188
- 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.properties +0 -2
- package/src/sap/ui/core/messagebundle_ar.properties +0 -1
- package/src/sap/ui/core/messagebundle_bg.properties +0 -1
- package/src/sap/ui/core/messagebundle_ca.properties +0 -1
- package/src/sap/ui/core/messagebundle_cs.properties +0 -1
- package/src/sap/ui/core/messagebundle_cy.properties +0 -1
- package/src/sap/ui/core/messagebundle_da.properties +0 -1
- package/src/sap/ui/core/messagebundle_de.properties +0 -1
- package/src/sap/ui/core/messagebundle_el.properties +0 -1
- package/src/sap/ui/core/messagebundle_en.properties +0 -1
- package/src/sap/ui/core/messagebundle_en_GB.properties +0 -1
- package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +0 -1
- package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +0 -1
- package/src/sap/ui/core/messagebundle_es.properties +0 -1
- package/src/sap/ui/core/messagebundle_es_MX.properties +0 -1
- package/src/sap/ui/core/messagebundle_et.properties +0 -1
- package/src/sap/ui/core/messagebundle_fi.properties +0 -1
- package/src/sap/ui/core/messagebundle_fr.properties +0 -1
- package/src/sap/ui/core/messagebundle_fr_CA.properties +0 -1
- package/src/sap/ui/core/messagebundle_hi.properties +0 -1
- package/src/sap/ui/core/messagebundle_hr.properties +0 -1
- package/src/sap/ui/core/messagebundle_hu.properties +0 -1
- package/src/sap/ui/core/messagebundle_id.properties +0 -1
- package/src/sap/ui/core/messagebundle_it.properties +0 -1
- package/src/sap/ui/core/messagebundle_iw.properties +0 -1
- package/src/sap/ui/core/messagebundle_ja.properties +0 -1
- package/src/sap/ui/core/messagebundle_kk.properties +0 -1
- package/src/sap/ui/core/messagebundle_ko.properties +1 -2
- package/src/sap/ui/core/messagebundle_lt.properties +0 -1
- package/src/sap/ui/core/messagebundle_lv.properties +0 -1
- package/src/sap/ui/core/messagebundle_ms.properties +0 -1
- package/src/sap/ui/core/messagebundle_nl.properties +0 -1
- package/src/sap/ui/core/messagebundle_no.properties +0 -1
- package/src/sap/ui/core/messagebundle_pl.properties +0 -1
- package/src/sap/ui/core/messagebundle_pt.properties +0 -1
- package/src/sap/ui/core/messagebundle_pt_PT.properties +0 -1
- package/src/sap/ui/core/messagebundle_ro.properties +0 -1
- package/src/sap/ui/core/messagebundle_ru.properties +0 -1
- package/src/sap/ui/core/messagebundle_sh.properties +0 -1
- package/src/sap/ui/core/messagebundle_sk.properties +0 -1
- package/src/sap/ui/core/messagebundle_sl.properties +0 -1
- package/src/sap/ui/core/messagebundle_sv.properties +0 -1
- package/src/sap/ui/core/messagebundle_th.properties +0 -1
- package/src/sap/ui/core/messagebundle_tr.properties +0 -1
- package/src/sap/ui/core/messagebundle_uk.properties +0 -1
- package/src/sap/ui/core/messagebundle_vi.properties +0 -1
- package/src/sap/ui/core/messagebundle_zh_CN.properties +0 -1
- package/src/sap/ui/core/messagebundle_zh_TW.properties +0 -1
- package/src/sap/ui/core/mvc/Controller.js +1 -1
- package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +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 +2 -2
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +2 -1
- package/src/sap/ui/core/mvc/XMLView.js +25 -21
- package/src/sap/ui/core/mvc/XMLViewRenderer.js +81 -59
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +3 -3
- 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/Router.js +1 -1
- package/src/sap/ui/core/rules/App.support.js +14 -9
- package/src/sap/ui/core/rules/Config.support.js +12 -12
- package/src/sap/ui/core/rules/Misc.support.js +8 -3
- package/src/sap/ui/core/rules/Model.support.js +8 -8
- package/src/sap/ui/core/rules/Rendering.support.js +1 -1
- package/src/sap/ui/core/rules/Theming.support.js +4 -4
- package/src/sap/ui/core/rules/View.support.js +9 -9
- 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 +29 -1
- package/src/sap/ui/core/support/Support.js +4 -4
- package/src/sap/ui/core/support/controls/InteractionSlider.js +395 -407
- package/src/sap/ui/core/support/plugins/Breakpoint.js +5 -5
- package/src/sap/ui/core/support/plugins/ControlTree.js +440 -349
- package/src/sap/ui/core/support/plugins/Debugging.js +153 -129
- package/src/sap/ui/core/support/plugins/Interaction.js +71 -85
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +10 -13
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +5 -3
- package/src/sap/ui/core/support/plugins/Trace.js +7 -7
- package/src/sap/ui/core/support/plugins/ViewInfo.js +91 -43
- package/src/sap/ui/core/support/support.css +23 -23
- package/src/sap/ui/core/support/support.html +5 -7
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +1 -1
- package/src/sap/ui/core/themes/base/CommandShortcutHints.less +1 -1
- package/src/sap/ui/core/themes/base/DragAndDrop.less +3 -3
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +15 -1
- package/src/sap/ui/core/themes/base/base.less +1524 -54
- package/src/sap/ui/core/themes/base/global.less +171 -13
- package/src/sap/ui/core/themes/base/shared.less +1 -0
- package/src/sap/ui/core/themes/sap_hcb/global.less +166 -7
- package/src/sap/ui/core/theming/Parameters.js +1 -1
- 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 +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 +4 -3
- package/src/sap/ui/core/util/PasteHelper.js +2 -2
- package/src/sap/ui/core/util/XMLPreprocessor.js +1 -0
- 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 +7 -8
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/LogViewer.js +2 -2
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientListBinding.js +127 -21
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeBinding.js +3 -0
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +13 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/ListBinding.js +32 -13
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +10 -7
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/_Helper.js +26 -0
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +29 -13
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
- package/src/sap/ui/model/base/ManagedObjectModel.js +8 -6
- package/src/sap/ui/model/json/JSONListBinding.js +0 -58
- package/src/sap/ui/model/json/JSONModel.js +15 -8
- package/src/sap/ui/model/message/MessageListBinding.js +0 -42
- 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/ODataPropertyBinding.js +3 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +5 -4
- package/src/sap/ui/model/odata/ODataUtils.js +7 -9
- package/src/sap/ui/model/odata/OperationMode.js +6 -0
- 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/DateTimeWithTimezone.js +78 -68
- 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/type/UnitMixin.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +78 -5
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +280 -76
- package/src/sap/ui/model/odata/v2/ODataModel.js +342 -96
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +8 -4
- package/src/sap/ui/model/odata/v4/Context.js +52 -25
- package/src/sap/ui/model/odata/v4/ODataBinding.js +50 -32
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +35 -6
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +302 -110
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +13 -6
- package/src/sap/ui/model/odata/v4/ODataModel.js +297 -30
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +25 -57
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -2
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +59 -5
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +15 -0
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +309 -130
- package/src/sap/ui/model/odata/v4/lib/_ConcatHelper.js +5 -13
- package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +16 -0
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +114 -41
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +270 -36
- 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/XMLListBinding.js +0 -53
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/performance/trace/FESR.js +1 -1
- package/src/sap/ui/performance/trace/FESRHelper.js +72 -0
- package/src/sap/ui/performance/trace/Interaction.js +6 -2
- package/src/sap/ui/qunit/qunit-2-css.js +4 -4
- package/src/sap/ui/qunit/qunit-css.js +4 -4
- 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/BranchTracking.js +1 -0
- package/src/sap/ui/test/Opa5.js +9 -5
- package/src/sap/ui/test/OpaBuilder.js +7 -7
- package/src/sap/ui/test/TestUtils.js +11 -0
- package/src/sap/ui/test/_UsageReport.js +1 -1
- package/src/sap/ui/test/actions/Action.js +3 -3
- package/src/sap/ui/test/actions/Press.js +1 -1
- package/src/sap/ui/test/generic/GenericTestCollection.js +176 -0
- package/src/sap/ui/test/generic/TestBase.js +151 -0
- package/src/sap/ui/test/generic/Utils.js +284 -0
- package/src/sap/ui/test/gherkin/opa5TestHarness.js +14 -5
- package/src/sap/ui/test/opaQunit.js +11 -10
- package/src/sap/ui/test/selectors/_ControlSelectorGenerator.js +9 -8
- package/src/sap/ui/test/selectors/_ControlSelectorValidator.js +1 -1
- package/src/sap/ui/test/starter/_setupAndStart.js +4 -0
- package/src/sap/ui/thirdparty/jszip.js +0 -1
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader.js +8 -4
- package/ui5.yaml +1 -1
|
@@ -305,41 +305,74 @@ sap.ui.define([
|
|
|
305
305
|
* default value.
|
|
306
306
|
* </p>
|
|
307
307
|
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
308
|
+
* The following example shows how grouping is done:
|
|
309
|
+
* <pre>
|
|
310
|
+
* var oFormat = NumberFormat.getFloatInstance({
|
|
311
|
+
* "groupingEnabled": true, // grouping is enabled
|
|
312
|
+
* "groupingSeparator": '.', // grouping separator is '.'
|
|
313
|
+
* "groupingSize": 3, // the amount of digits to be grouped (here: thousand)
|
|
314
|
+
* "decimalSeparator": "," // the decimal separator must be different from the grouping separator
|
|
315
|
+
* });
|
|
316
|
+
*
|
|
317
|
+
* oFormat.format(1234.56); // "1.234,56"
|
|
318
|
+
* </pre>
|
|
319
|
+
*
|
|
320
|
+
# * @param {object} [oFormatOptions] The option object, which supports the following parameters.
|
|
321
|
+
* If no options are given, default values according to the type and locale settings are used.
|
|
313
322
|
* @param {int} [oFormatOptions.decimals] defines the number of decimal digits
|
|
323
|
+
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
324
|
+
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
325
|
+
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what an empty string
|
|
326
|
+
* is parsed as, and what is formatted as an empty string. The allowed values are "" (empty string),
|
|
327
|
+
* NaN, <code>null</code>, or 0.
|
|
328
|
+
* The 'format' and 'parse' functions are done in a symmetric way. For example, when this
|
|
329
|
+
* parameter is set to NaN, an empty string is parsed as NaN, and NaN is formatted as an empty
|
|
330
|
+
* string.
|
|
331
|
+
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits if
|
|
332
|
+
* it is different from the grouping size (e.g. Indian grouping)
|
|
333
|
+
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled
|
|
334
|
+
* (grouping separators are shown)
|
|
335
|
+
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
336
|
+
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
337
|
+
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits; the default
|
|
338
|
+
* is <code>3</code>. It must be a positive number.
|
|
339
|
+
* @param {int} [oFormatOptions.maxFractionDigits=99] defines the maximum number of decimal digits
|
|
340
|
+
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines the maximum number of non-decimal digits.
|
|
341
|
+
* If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
342
|
+
* @param {int} [oFormatOptions.minFractionDigits=0] defines the minimal number of decimal digits
|
|
343
|
+
* @param {int} [oFormatOptions.minIntegerDigits=1] defines the minimal number of non-decimal digits
|
|
344
|
+
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
345
|
+
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output
|
|
346
|
+
* the string from the parse function in order to keep the precision for big numbers. Numbers
|
|
347
|
+
* in scientific notation are parsed back to standard notation. For example, "5e-3" is parsed
|
|
348
|
+
* to "0.005".
|
|
349
|
+
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
350
|
+
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
351
|
+
* @param {int} [oFormatOptions.precision] defines the numerical precision; the number of decimals
|
|
352
|
+
* is calculated dependent on the integer digits
|
|
353
|
+
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves
|
|
354
|
+
* decimal digits except trailing zeros in case there are more decimals than the
|
|
355
|
+
* <code>maxFractionDigits</code> format option allows.
|
|
356
|
+
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
357
|
+
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO]
|
|
358
|
+
* specifies the rounding behavior for discarding the digits after the maximum fraction digits
|
|
359
|
+
* defined by maxFractionDigits. Rounding will only be applied if the passed value is of type <code>number</code>.
|
|
360
|
+
* This can be assigned
|
|
361
|
+
* <ul>
|
|
362
|
+
* <li>by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode},</li>
|
|
363
|
+
* <li>via a function that is used for rounding the number and takes two parameters: the number itself, and the number of decimal digits that should be reserved.</li>
|
|
364
|
+
* </ul>
|
|
314
365
|
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' options is used
|
|
315
366
|
* @param {int} [oFormatOptions.shortLimit] only use short number formatting for values above this limit
|
|
316
367
|
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. The generated scale factor is
|
|
317
368
|
* used for all numbers which are formatted with this format instance. This option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default set
|
|
318
369
|
* with <code>undefined</code> which means the scale factor is selected automatically for each number being formatted.
|
|
319
370
|
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
320
|
-
* @param {
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits, the default is three
|
|
326
|
-
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits, in case it is different from the grouping size (e.g. indian grouping)
|
|
327
|
-
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
328
|
-
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
329
|
-
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
330
|
-
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
331
|
-
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output string from parse function in order to keep the precision for big numbers. Numbers in scientific notation are parsed
|
|
332
|
-
* back to the standard notation. For example "5e-3" is parsed to "0.005".
|
|
333
|
-
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves decimal digits except trailing zeros
|
|
334
|
-
* in case there are more decimals than the <code>maxFractionDigits</code> format option allows.
|
|
335
|
-
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
336
|
-
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are 'short, 'long' or 'standard' (based on CLDR decimalFormat). Numbers are formatted into compact forms when it's set to
|
|
337
|
-
* 'short' or 'long'. When this option is set, the default value of option 'precision' is set to 2. This can be changed by setting either min/maxFractionDigits, decimals, shortDecimals or precision option.
|
|
338
|
-
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO] specifies a rounding behavior for discarding the digits after the maximum fraction digits
|
|
339
|
-
* defined by maxFractionDigits. Rounding will only be applied, if the passed value if of type number. This can be assigned by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}
|
|
340
|
-
* or a function which will be used for rounding the number. The function is called with two parameters: the number and how many decimal digits should be reserved.
|
|
341
|
-
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what empty string is parsed as and what is formatted as empty string. The allowed values are "" (empty string), NaN, null or 0.
|
|
342
|
-
* The 'format' and 'parse' are done in a symmetric way. For example when this parameter is set to NaN, empty string is parsed as NaN and NaN is formatted as empty string.
|
|
371
|
+
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are
|
|
372
|
+
* 'short, 'long' or 'standard' (based on the CLDR decimalFormat). When set to 'short' or 'long',
|
|
373
|
+
* numbers are formatted into compact forms. When this option is set, the default value of the
|
|
374
|
+
* 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits,
|
|
375
|
+
* decimals, shortDecimals, or the 'precision' option itself.
|
|
343
376
|
* @param {sap.ui.core.Locale} [oLocale] Locale to get the formatter for
|
|
344
377
|
* @return {sap.ui.core.format.NumberFormat} float instance of the NumberFormat
|
|
345
378
|
* @static
|
|
@@ -349,7 +382,7 @@ sap.ui.define([
|
|
|
349
382
|
var oFormat = this.createInstance(oFormatOptions, oLocale),
|
|
350
383
|
oLocaleFormatOptions = this.getLocaleFormatOptions(oFormat.oLocaleData, mNumberType.FLOAT);
|
|
351
384
|
|
|
352
|
-
oFormat.oFormatOptions = extend({}, this.oDefaultFloatFormat, oLocaleFormatOptions,
|
|
385
|
+
oFormat.oFormatOptions = extend({}, this.oDefaultFloatFormat, oLocaleFormatOptions, oFormat.oOriginalFormatOptions);
|
|
353
386
|
return oFormat;
|
|
354
387
|
};
|
|
355
388
|
|
|
@@ -365,41 +398,73 @@ sap.ui.define([
|
|
|
365
398
|
* default value.
|
|
366
399
|
* </p>
|
|
367
400
|
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
401
|
+
* The following example shows how grouping is done:
|
|
402
|
+
* <pre>
|
|
403
|
+
* var oFormat = NumberFormat.getIntegerInstance({
|
|
404
|
+
* "groupingEnabled": true, // grouping is enabled
|
|
405
|
+
* "groupingSeparator": '.', // grouping separator is '.'
|
|
406
|
+
* "groupingSize": 3 // the amount of digits to be grouped (here: thousand)
|
|
407
|
+
* });
|
|
408
|
+
*
|
|
409
|
+
* oFormat.format(1234); // "1.234"
|
|
410
|
+
* </pre>
|
|
411
|
+
*
|
|
412
|
+
* @param {object} [oFormatOptions] The option object, which supports the following parameters.
|
|
413
|
+
* If no options are given, default values according to the type and locale settings are used.
|
|
373
414
|
* @param {int} [oFormatOptions.decimals] defines the number of decimal digits
|
|
415
|
+
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
416
|
+
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
417
|
+
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what an empty string
|
|
418
|
+
* is parsed as, and what is formatted as an empty string. The allowed values are only NaN,
|
|
419
|
+
* null or 0.
|
|
420
|
+
* The 'format' and 'parse' functions are done in a symmetric way. For example, when this
|
|
421
|
+
* parameter is set to NaN, an empty string is parsed as NaN, and NaN is formatted as an empty
|
|
422
|
+
* string.
|
|
423
|
+
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits if
|
|
424
|
+
* it is different from the grouping size (e.g. Indian grouping)
|
|
425
|
+
* @param {boolean} [oFormatOptions.groupingEnabled=false] defines whether grouping is enabled
|
|
426
|
+
* (grouping separators are shown)
|
|
427
|
+
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
428
|
+
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
429
|
+
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits; the default
|
|
430
|
+
* is <code>3</code>. It must be a positive number.
|
|
431
|
+
* @param {int} [oFormatOptions.maxFractionDigits=0] defines the maximum number of decimal digits
|
|
432
|
+
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines the maximum number of non-decimal digits.
|
|
433
|
+
* If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
434
|
+
* @param {int} [oFormatOptions.minFractionDigits=0] defines the minimal number of decimal digits
|
|
435
|
+
* @param {int} [oFormatOptions.minIntegerDigits=1] defines the minimal number of non-decimal digits
|
|
436
|
+
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
437
|
+
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output
|
|
438
|
+
* the string from the parse function in order to keep the precision for big numbers. Numbers
|
|
439
|
+
* in scientific notation are parsed back to standard notation. For example, "5e+3" is parsed
|
|
440
|
+
* to "5000".
|
|
441
|
+
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
442
|
+
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
443
|
+
* @param {int} [oFormatOptions.precision] defines the numerical precision; the number of decimals
|
|
444
|
+
* is calculated dependent on the integer digits
|
|
445
|
+
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves
|
|
446
|
+
* decimal digits except trailing zeros in case there are more decimals than the
|
|
447
|
+
* <code>maxFractionDigits</code> format option allows.
|
|
448
|
+
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
449
|
+
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=TOWARDS_ZERO]
|
|
450
|
+
* specifies the rounding behavior for discarding the digits after the maximum fraction digits
|
|
451
|
+
* defined by maxFractionDigits. Rounding will only be applied if the passed value is of type <code>number</code>.
|
|
452
|
+
* This can be assigned
|
|
453
|
+
* <ul>
|
|
454
|
+
* <li>by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode},</li>
|
|
455
|
+
* <li>via a function that is used for rounding the number and takes two parameters: the number itself, and the number of decimal digits that should be reserved.</li>
|
|
456
|
+
* </ul>
|
|
374
457
|
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' options is used
|
|
375
458
|
* @param {int} [oFormatOptions.shortLimit] only use short number formatting for values above this limit
|
|
376
459
|
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. The generated scale factor is
|
|
377
460
|
* used for all numbers which are formatted with this format instance. This option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default set
|
|
378
461
|
* with <code>undefined</code> which means the scale factor is selected automatically for each number being formatted.
|
|
379
462
|
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
380
|
-
* @param {
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits, the default is three
|
|
386
|
-
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits, in case it is different from the grouping size (e.g. indian grouping)
|
|
387
|
-
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
388
|
-
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
389
|
-
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
390
|
-
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
391
|
-
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output string from parse function in order to keep the precision for big numbers. Numbers in scientific notation are parsed
|
|
392
|
-
* back to the standard notation. For example "5e+3" is parsed to "5000".
|
|
393
|
-
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves decimal digits except trailing zeros
|
|
394
|
-
* in case there are more decimals than the <code>maxFractionDigits</code> format option allows.
|
|
395
|
-
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
396
|
-
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are 'short, 'long' or 'standard' (based on CLDR decimalFormat). Numbers are formatted into compact forms when it's set to
|
|
397
|
-
* 'short' or 'long'. When this option is set, the default value of option 'precision' is set to 2. This can be changed by setting either min/maxFractionDigits, decimals, shortDecimals or precision option.
|
|
398
|
-
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=TOWARDS_ZERO] specifies a rounding behavior for discarding the digits after the maximum fraction digits
|
|
399
|
-
* defined by maxFractionDigits. Rounding will only be applied, if the passed value if of type number. This can be assigned by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}
|
|
400
|
-
* or a function which will be used for rounding the number. The function is called with two parameters: the number and how many decimal digits should be reserved.
|
|
401
|
-
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what empty string is parsed as and what is formatted as empty string. The allowed values are only NaN, null or 0.
|
|
402
|
-
* The 'format' and 'parse' are done in a symmetric way. For example when this parameter is set to NaN, empty string is parsed as NaN and NaN is formatted as empty string.
|
|
463
|
+
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are
|
|
464
|
+
* 'short, 'long' or 'standard' (based on the CLDR decimalFormat). When set to 'short' or 'long',
|
|
465
|
+
* numbers are formatted into compact forms. When this option is set, the default value of the
|
|
466
|
+
* 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits,
|
|
467
|
+
* decimals, shortDecimals, or the 'precision' option itself.
|
|
403
468
|
* @param {sap.ui.core.Locale} [oLocale] Locale to get the formatter for
|
|
404
469
|
* @return {sap.ui.core.format.NumberFormat} integer instance of the NumberFormat
|
|
405
470
|
* @static
|
|
@@ -409,7 +474,7 @@ sap.ui.define([
|
|
|
409
474
|
var oFormat = this.createInstance(oFormatOptions, oLocale),
|
|
410
475
|
oLocaleFormatOptions = this.getLocaleFormatOptions(oFormat.oLocaleData, mNumberType.INTEGER);
|
|
411
476
|
|
|
412
|
-
oFormat.oFormatOptions = extend({}, this.oDefaultIntegerFormat, oLocaleFormatOptions,
|
|
477
|
+
oFormat.oFormatOptions = extend({}, this.oDefaultIntegerFormat, oLocaleFormatOptions, oFormat.oOriginalFormatOptions);
|
|
413
478
|
return oFormat;
|
|
414
479
|
};
|
|
415
480
|
|
|
@@ -468,40 +533,65 @@ sap.ui.define([
|
|
|
468
533
|
* oFormat.format(777.888, "Bitcoin"); // "Bitcoin 777.89"
|
|
469
534
|
* </pre>
|
|
470
535
|
*
|
|
471
|
-
* @param {object} [oFormatOptions] The option object which
|
|
472
|
-
*
|
|
473
|
-
* @param {
|
|
474
|
-
*
|
|
475
|
-
*
|
|
536
|
+
* @param {object} [oFormatOptions] The option object, which supports the following parameters.
|
|
537
|
+
* If no options are given, default values according to the type and locale settings are used.
|
|
538
|
+
* @param {boolean} [oFormatOptions.currencyCode=true] defines whether the currency is shown as
|
|
539
|
+
* a code in currency format. The currency symbol is displayed when this option is set to
|
|
540
|
+
* <code>false</code> and a symbol has been defined for the given currency code.
|
|
541
|
+
* @param {string} [oFormatOptions.currencyContext=standard] can be set either to 'standard'
|
|
542
|
+
* (the default value) or to 'accounting' for an accounting-specific currency display
|
|
543
|
+
* @param {Object<string,object>} [oFormatOptions.customCurrencies] defines a set of custom currencies exclusive to this NumberFormat instance.
|
|
544
|
+
* Custom currencies must not only consist of digits.
|
|
545
|
+
* If custom currencies are defined on the instance, no other currencies can be formatted and parsed by this instance.
|
|
546
|
+
* Globally available custom currencies can be added via the global configuration.
|
|
547
|
+
* See the above examples.
|
|
548
|
+
* See also {@link sap.ui.core.Configuration.FormatSettings#setCustomCurrencies} and {@link sap.ui.core.Configuration.FormatSettings#addCustomCurrencies}.
|
|
476
549
|
* @param {int} [oFormatOptions.decimals] defines the number of decimal digits
|
|
550
|
+
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
551
|
+
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
552
|
+
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what an empty string
|
|
553
|
+
* is parsed as, and what is formatted as an empty string. The allowed values are "" (empty string),
|
|
554
|
+
* NaN, <code>null</code>, or 0.
|
|
555
|
+
* The 'format' and 'parse' functions are done in a symmetric way. For example, when this
|
|
556
|
+
* parameter is set to NaN, an empty string is parsed as [NaN, undefined], and NaN is
|
|
557
|
+
* formatted as an empty string.
|
|
558
|
+
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits if
|
|
559
|
+
* it is different from the grouping size (e.g. Indian grouping)
|
|
560
|
+
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled
|
|
561
|
+
* (grouping separators are shown)
|
|
562
|
+
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
563
|
+
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
564
|
+
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits; the default
|
|
565
|
+
* is <code>3</code>. It must be a positive number.
|
|
566
|
+
* @param {int} [oFormatOptions.maxFractionDigits=99] defines the maximum number of decimal digits
|
|
567
|
+
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines the maximum number of non-decimal digits.
|
|
568
|
+
* If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
569
|
+
* @param {int} [oFormatOptions.minFractionDigits=0] defines the minimal number of decimal digits
|
|
570
|
+
* @param {int} [oFormatOptions.minIntegerDigits=1] defines the minimal number of non-decimal digits
|
|
571
|
+
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
572
|
+
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output
|
|
573
|
+
* the string from the parse function in order to keep the precision for big numbers. Numbers
|
|
574
|
+
* in scientific notation are parsed back to standard notation. For example, "5e-3" is parsed
|
|
575
|
+
* to "0.005".
|
|
576
|
+
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
577
|
+
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
578
|
+
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves
|
|
579
|
+
* decimal digits except trailing zeros in case there are more decimals than the
|
|
580
|
+
* <code>maxFractionDigits</code> format option allows.
|
|
581
|
+
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
582
|
+
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO]
|
|
583
|
+
* specifies the rounding behavior for discarding the digits after the maximum fraction digits
|
|
584
|
+
* defined by maxFractionDigits. Rounding will only be applied if the passed value is of type <code>number</code>.
|
|
585
|
+
* This can be assigned
|
|
586
|
+
* <ul>
|
|
587
|
+
* <li>by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode},</li>
|
|
588
|
+
* <li>via a function that is used for rounding the number and takes two parameters: the number itself, and the number of decimal digits that should be reserved.</li>
|
|
589
|
+
* </ul>
|
|
477
590
|
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' options is used
|
|
478
591
|
* @param {int} [oFormatOptions.shortLimit] only use short number formatting for values above this limit
|
|
479
592
|
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. The generated scale factor is
|
|
480
593
|
* used for all numbers which are formatted with this format instance. This option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default set
|
|
481
594
|
* with <code>undefined</code> which means the scale factor is selected automatically for each number being formatted.
|
|
482
|
-
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
483
|
-
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
484
|
-
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled (show the grouping separators)
|
|
485
|
-
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
486
|
-
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
487
|
-
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits, the default is three
|
|
488
|
-
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits, in case it is different from the grouping size (e.g. indian grouping)
|
|
489
|
-
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
490
|
-
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
491
|
-
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
492
|
-
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
493
|
-
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output string from parse function in order to keep the precision for big numbers. Numbers in scientific notation are parsed
|
|
494
|
-
* back to the standard notation. For example "5e-3" is parsed to "0.005".
|
|
495
|
-
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves decimal digits except trailing zeros
|
|
496
|
-
* in case there are more decimals than the <code>maxFractionDigits</code> format option allows.
|
|
497
|
-
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
498
|
-
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are 'short, 'long' or 'standard' (based on CLDR decimalFormat). Numbers are formatted into compact forms when it's set to
|
|
499
|
-
* 'short' or 'long'. When this option is set, the default value of option 'precision' is set to 2. This can be changed by setting either min/maxFractionDigits, decimals, shortDecimals or precision option.
|
|
500
|
-
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO] specifies a rounding behavior for discarding the digits after the maximum fraction digits
|
|
501
|
-
* defined by maxFractionDigits. Rounding will only be applied, if the passed value if of type number. This can be assigned by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}
|
|
502
|
-
* or a function which will be used for rounding the number. The function is called with two parameters: the number and how many decimal digits should be reserved.
|
|
503
|
-
* @param {boolean} [oFormatOptions.trailingCurrencyCode] Overrides the global configuration value {@link sap.ui.core.Configuration.FormatSettings#getTrailingCurrencyCode} whose default value is <code>true</>.
|
|
504
|
-
* This is ignored if <code>oFormatOptions.currencyCode</code> is set to <code>false</code> or if <code>oFormatOptions.pattern</code> is supplied
|
|
505
595
|
* @param {boolean} [oFormatOptions.showMeasure=true] defines whether the currency code/symbol is shown in the formatted string,
|
|
506
596
|
* e.g. true: "1.00 EUR", false: "1.00" for locale "en"
|
|
507
597
|
* If both <code>showMeasure</code> and <code>showNumber</code> are false, an empty string is returned
|
|
@@ -510,27 +600,29 @@ sap.ui.define([
|
|
|
510
600
|
* <code>NumberFormat.getCurrencyInstance({showNumber:true}).format(1, "EUR"); // "1.00 EUR"</code>
|
|
511
601
|
* <code>NumberFormat.getCurrencyInstance({showNumber:false}).format(1, "EUR"); // "EUR"</code>
|
|
512
602
|
* If both <code>showMeasure</code> and <code>showNumber</code> are false, an empty string is returned
|
|
513
|
-
* @param {boolean} [oFormatOptions.
|
|
514
|
-
*
|
|
515
|
-
* @param {string} [oFormatOptions.
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
603
|
+
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number.
|
|
604
|
+
* This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
605
|
+
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are
|
|
606
|
+
* 'short, 'long' or 'standard' (based on the CLDR decimalFormat). When set to 'short' or 'long',
|
|
607
|
+
* numbers are formatted into compact forms. When this option is set, the default value of the
|
|
608
|
+
* 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits,
|
|
609
|
+
* decimals, shortDecimals, or the 'precision' option itself.
|
|
610
|
+
* @param {boolean} [oFormatOptions.trailingCurrencyCode] overrides the global configuration
|
|
611
|
+
* value {@link sap.ui.core.Configuration.FormatSettings#getTrailingCurrencyCode}, which has a
|
|
612
|
+
* default value of <code>true</>.
|
|
613
|
+
* This is ignored if <code>oFormatOptions.currencyCode</code> is set to <code>false</code>,
|
|
614
|
+
* or if <code>oFormatOptions.pattern</code> is supplied.
|
|
523
615
|
* @param {sap.ui.core.Locale} [oLocale] Locale to get the formatter for
|
|
524
|
-
* @return {sap.ui.core.format.NumberFormat}
|
|
616
|
+
* @return {sap.ui.core.format.NumberFormat} currency instance of the NumberFormat
|
|
525
617
|
* @static
|
|
526
618
|
* @public
|
|
527
619
|
*/
|
|
528
620
|
NumberFormat.getCurrencyInstance = function(oFormatOptions, oLocale) {
|
|
529
621
|
var oFormat = this.createInstance(oFormatOptions, oLocale);
|
|
530
|
-
var sContext =
|
|
622
|
+
var sContext = oFormat.oOriginalFormatOptions && oFormat.oOriginalFormatOptions.currencyContext;
|
|
531
623
|
|
|
532
624
|
// currency code trailing
|
|
533
|
-
var bShowTrailingCurrencyCode = showTrailingCurrencyCode(
|
|
625
|
+
var bShowTrailingCurrencyCode = showTrailingCurrencyCode(oFormat.oOriginalFormatOptions);
|
|
534
626
|
|
|
535
627
|
|
|
536
628
|
// prepend "sap-" to pattern params to load (context and short)
|
|
@@ -540,7 +632,7 @@ sap.ui.define([
|
|
|
540
632
|
}
|
|
541
633
|
var oLocaleFormatOptions = this.getLocaleFormatOptions(oFormat.oLocaleData, mNumberType.CURRENCY, sContext);
|
|
542
634
|
|
|
543
|
-
oFormat.oFormatOptions = extend({}, this.oDefaultCurrencyFormat, oLocaleFormatOptions,
|
|
635
|
+
oFormat.oFormatOptions = extend({}, this.oDefaultCurrencyFormat, oLocaleFormatOptions, oFormat.oOriginalFormatOptions);
|
|
544
636
|
|
|
545
637
|
// Trailing currency code option
|
|
546
638
|
//
|
|
@@ -569,48 +661,70 @@ sap.ui.define([
|
|
|
569
661
|
* default value.
|
|
570
662
|
* </p>
|
|
571
663
|
*
|
|
572
|
-
* @param {object} [oFormatOptions] The option object which
|
|
573
|
-
*
|
|
574
|
-
* @param {
|
|
575
|
-
* @param {
|
|
576
|
-
*
|
|
664
|
+
* @param {object} [oFormatOptions] The option object, which supports the following parameters.
|
|
665
|
+
* If no options are given, default values according to the type and locale settings are used.
|
|
666
|
+
* @param {array} [oFormatOptions.allowedUnits] defines the allowed units for formatting and parsing, e.g. ["size-meter", "volume-liter", ...]
|
|
667
|
+
* @param {Object<string,object>} [oFormatOptions.customUnits] defines a set of custom units, e.g.
|
|
668
|
+
* {"electric-inductance": {
|
|
669
|
+
* "displayName": "henry",
|
|
670
|
+
* "unitPattern-count-one": "{0} H",
|
|
671
|
+
* "unitPattern-count-other": "{0} H",
|
|
672
|
+
* "perUnitPattern": "{0}/H",
|
|
673
|
+
* "decimals": 2,
|
|
674
|
+
* "precision": 4
|
|
675
|
+
* }}
|
|
577
676
|
* @param {int} [oFormatOptions.decimals] defines the number of decimal digits
|
|
578
|
-
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' options is used
|
|
579
|
-
* @param {int} [oFormatOptions.shortLimit] only use short number formatting for values above this limit
|
|
580
|
-
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. The generated scale factor is
|
|
581
|
-
* used for all numbers which are formatted with this format instance. This option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default set
|
|
582
|
-
* with <code>undefined</code> which means the scale factor is selected automatically for each number being formatted.
|
|
583
|
-
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
584
|
-
* @param {int} [oFormatOptions.precision] defines the number precision, number of decimals is calculated dependent on the integer digits
|
|
585
|
-
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
586
|
-
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled (show the grouping separators)
|
|
587
|
-
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
588
|
-
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
589
|
-
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits, the default is three
|
|
590
|
-
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits, in case it is different from the grouping size (e.g. indian grouping)
|
|
591
677
|
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
592
678
|
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
593
|
-
* @param {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
* @param {
|
|
602
|
-
*
|
|
679
|
+
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what an empty string
|
|
680
|
+
* is parsed as, and what is formatted as an empty string. The allowed values are "" (empty string),
|
|
681
|
+
* NaN, <code>null</code>, or 0.
|
|
682
|
+
* The 'format' and 'parse' functions are done in a symmetric way. For example, when this
|
|
683
|
+
* parameter is set to NaN, an empty string is parsed as [NaN, undefined], and NaN is
|
|
684
|
+
* formatted as an empty string.
|
|
685
|
+
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits if
|
|
686
|
+
* it is different from the grouping size (e.g. Indian grouping)
|
|
687
|
+
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled
|
|
688
|
+
* (grouping separators are shown)
|
|
689
|
+
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
690
|
+
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
691
|
+
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits; the default
|
|
692
|
+
* is <code>3</code>. It must be a positive number.
|
|
693
|
+
* @param {int} [oFormatOptions.maxFractionDigits=99] defines the maximum number of decimal digits
|
|
694
|
+
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines the maximum number of non-decimal digits.
|
|
695
|
+
* If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
696
|
+
* @param {int} [oFormatOptions.minFractionDigits=0] defines the minimal number of decimal digits
|
|
697
|
+
* @param {int} [oFormatOptions.minIntegerDigits=1] defines the minimal number of non-decimal digits
|
|
603
698
|
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
604
|
-
* @param {boolean} [oFormatOptions.parseAsString] @since 1.28.2 defines whether to output
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
* @param {string} [oFormatOptions.
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
699
|
+
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output
|
|
700
|
+
* the string from the parse function in order to keep the precision for big numbers. Numbers
|
|
701
|
+
* in scientific notation are parsed back to standard notation. For example, "5e-3" is parsed
|
|
702
|
+
* to "0.005".
|
|
703
|
+
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
704
|
+
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
705
|
+
* @param {int} [oFormatOptions.precision] defines the numerical precision; the number of decimals
|
|
706
|
+
* is calculated dependent on the integer digits
|
|
707
|
+
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves
|
|
708
|
+
* decimal digits except trailing zeros in case there are more decimals than the
|
|
709
|
+
* <code>maxFractionDigits</code> format option allows.
|
|
710
|
+
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
711
|
+
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO]
|
|
712
|
+
* specifies the rounding behavior for discarding the digits after the maximum fraction digits
|
|
713
|
+
* defined by maxFractionDigits. Rounding will only be applied if the passed value is of type <code>number</code>.
|
|
714
|
+
* This can be assigned
|
|
715
|
+
* <ul>
|
|
716
|
+
* <li>by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode},</li>
|
|
717
|
+
* <li>via a function that is used for rounding the number and takes two parameters: the number itself, and the number of decimal digits that should be reserved.</li>
|
|
718
|
+
* </ul>
|
|
719
|
+
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimals in the shortened
|
|
720
|
+
* format string. If this option isn't specified, the 'decimals' option is used instead.
|
|
721
|
+
* @param {int} [oFormatOptions.shortLimit] defines a limit above which only short number formatting is used
|
|
722
|
+
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the
|
|
723
|
+
* scale factor for the 'short' or 'long' style format is generated. The generated scale
|
|
724
|
+
* factor is used for all numbers which are formatted with this format instance. This option
|
|
725
|
+
* only takes effect when the 'style' option is set to 'short' or 'long'. This option is
|
|
726
|
+
* set to <code>undefined</code> by default, which means that the scale factor is selected
|
|
727
|
+
* automatically for each number being formatted.
|
|
614
728
|
* @param {boolean} [oFormatOptions.showMeasure=true] defines whether the unit of measure is shown in the formatted string,
|
|
615
729
|
* e.g. for input 1 and "duration-day" true: "1 day", false: "1".
|
|
616
730
|
* If both <code>showMeasure</code> and <code>showNumber</code> are false, an empty string is returned
|
|
@@ -622,8 +736,12 @@ sap.ui.define([
|
|
|
622
736
|
* <code>NumberFormat.getUnitInstance({showNumber:true}).format(2, "duration-day"); // "2 days"</code>
|
|
623
737
|
* <code>NumberFormat.getUnitInstance({showNumber:false}).format(2, "duration-day"); // "days"</code>
|
|
624
738
|
* If both <code>showMeasure</code> and <code>showNumber</code> are false, an empty string is returned
|
|
625
|
-
* @param {
|
|
626
|
-
*
|
|
739
|
+
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
740
|
+
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are
|
|
741
|
+
* 'short, 'long' or 'standard' (based on the CLDR decimalFormat). When set to 'short' or 'long',
|
|
742
|
+
* numbers are formatted into compact forms. When this option is set, the default value of the
|
|
743
|
+
* 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits,
|
|
744
|
+
* decimals, shortDecimals, or the 'precision' option itself.
|
|
627
745
|
* @param {sap.ui.core.Locale} [oLocale] Locale to get the formatter for
|
|
628
746
|
* @return {sap.ui.core.format.NumberFormat} unit instance of the NumberFormat
|
|
629
747
|
* @static
|
|
@@ -633,7 +751,7 @@ sap.ui.define([
|
|
|
633
751
|
var oFormat = this.createInstance(oFormatOptions, oLocale),
|
|
634
752
|
oLocaleFormatOptions = this.getLocaleFormatOptions(oFormat.oLocaleData, mNumberType.UNIT);
|
|
635
753
|
|
|
636
|
-
oFormat.oFormatOptions = extend({}, this.oDefaultUnitFormat, oLocaleFormatOptions,
|
|
754
|
+
oFormat.oFormatOptions = extend({}, this.oDefaultUnitFormat, oLocaleFormatOptions, oFormat.oOriginalFormatOptions);
|
|
637
755
|
return oFormat;
|
|
638
756
|
};
|
|
639
757
|
|
|
@@ -649,52 +767,73 @@ sap.ui.define([
|
|
|
649
767
|
* default value.
|
|
650
768
|
* </p>
|
|
651
769
|
*
|
|
652
|
-
* @param {object} [oFormatOptions] The option object which
|
|
653
|
-
*
|
|
654
|
-
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines maximum number of non-decimal digits. If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
655
|
-
* @param {int} [oFormatOptions.minFractionDigits=0] defines minimal number of decimal digits
|
|
656
|
-
* @param {int} [oFormatOptions.maxFractionDigits=99] defines maximum number of decimal digits
|
|
770
|
+
* @param {object} [oFormatOptions] The option object, which supports the following parameters.
|
|
771
|
+
* If no options are given, default values according to the type and locale settings are used.
|
|
657
772
|
* @param {int} [oFormatOptions.decimals] defines the number of decimal digits
|
|
773
|
+
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
774
|
+
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
775
|
+
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what an empty string
|
|
776
|
+
* is parsed as, and what is formatted as an empty string. The allowed values are "" (empty string),
|
|
777
|
+
* NaN, <code>null</code>, or 0.
|
|
778
|
+
* The 'format' and 'parse' functions are done in a symmetric way. For example, when this
|
|
779
|
+
* parameter is set to NaN, an empty string is parsed as NaN, and NaN is formatted as an empty
|
|
780
|
+
* string.
|
|
781
|
+
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits if
|
|
782
|
+
* it is different from the grouping size (e.g. Indian grouping)
|
|
783
|
+
* @param {boolean} [oFormatOptions.groupingEnabled=true] defines whether grouping is enabled
|
|
784
|
+
* (grouping separators are shown)
|
|
785
|
+
* @param {string} [oFormatOptions.groupingSeparator] defines the character used as grouping separator.
|
|
786
|
+
* Note: <code>groupingSeparator</code> must always be different from <code>decimalSeparator</code>.
|
|
787
|
+
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits; the default
|
|
788
|
+
* is <code>3</code>. It must be a positive number.
|
|
789
|
+
* @param {int} [oFormatOptions.maxFractionDigits=99] defines the maximum number of decimal digits
|
|
790
|
+
* @param {int} [oFormatOptions.maxIntegerDigits=99] defines the maximum number of non-decimal digits.
|
|
791
|
+
* If the number exceeds this maximum, e.g. 1e+120, "?" characters are shown instead of digits.
|
|
792
|
+
* @param {int} [oFormatOptions.minFractionDigits=0] defines the minimal number of decimal digits
|
|
793
|
+
* @param {int} [oFormatOptions.minIntegerDigits=1] defines the minimal number of non-decimal digits
|
|
794
|
+
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
795
|
+
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output
|
|
796
|
+
* the string from the parse function in order to keep the precision for big numbers. Numbers
|
|
797
|
+
* in scientific notation are parsed back to standard notation. For example, "5e-3" is parsed
|
|
798
|
+
* to "0.005".
|
|
799
|
+
* @param {string} [oFormatOptions.pattern] CLDR number pattern which is used to format the number
|
|
800
|
+
* @param {string} [oFormatOptions.percentSign] defines the used percent symbol
|
|
801
|
+
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
802
|
+
* @param {int} [oFormatOptions.precision] defines the numerical precision; the number of decimals
|
|
803
|
+
* is calculated dependent on the integer digits
|
|
804
|
+
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves
|
|
805
|
+
* decimal digits except trailing zeros in case there are more decimals than the
|
|
806
|
+
* <code>maxFractionDigits</code> format option allows.
|
|
807
|
+
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
808
|
+
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO]
|
|
809
|
+
* specifies the rounding behavior for discarding the digits after the maximum fraction digits
|
|
810
|
+
* defined by maxFractionDigits. Rounding will only be applied if the passed value is of type <code>number</code>.
|
|
811
|
+
* This can be assigned
|
|
812
|
+
* <ul>
|
|
813
|
+
* <li>by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode},</li>
|
|
814
|
+
* <li>via a function that is used for rounding the number and takes two parameters: the number itself, and the number of decimal digits that should be reserved.</li>
|
|
815
|
+
* </ul>
|
|
658
816
|
* @param {int} [oFormatOptions.shortDecimals] defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' options is used
|
|
659
817
|
* @param {int} [oFormatOptions.shortLimit] only use short number formatting for values above this limit
|
|
660
818
|
* @param {int} [oFormatOptions.shortRefNumber] @since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. The generated scale factor is
|
|
661
819
|
* used for all numbers which are formatted with this format instance. This option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default set
|
|
662
820
|
* with <code>undefined</code> which means the scale factor is selected automatically for each number being formatted.
|
|
663
821
|
* @param {boolean} [oFormatOptions.showScale=true] @since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect only when the 'style' options is set to either 'short' or 'long'.
|
|
664
|
-
* @param {
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
* @param {int} [oFormatOptions.groupingSize=3] defines the grouping size in digits, the default is three
|
|
670
|
-
* @param {int} [oFormatOptions.groupingBaseSize=3] defines the grouping base size in digits, in case it is different from the grouping size (e.g. indian grouping)
|
|
671
|
-
* @param {string} [oFormatOptions.decimalSeparator] defines the character used as decimal separator.
|
|
672
|
-
* Note: <code>decimalSeparator</code> must always be different from <code>groupingSeparator</code>.
|
|
673
|
-
* @param {string} [oFormatOptions.plusSign] defines the used plus symbol
|
|
674
|
-
* @param {string} [oFormatOptions.minusSign] defines the used minus symbol
|
|
675
|
-
* @param {string} [oFormatOptions.percentSign] defines the used percent symbol
|
|
676
|
-
* @param {boolean} [oFormatOptions.parseAsString=false] @since 1.28.2 defines whether to output string from parse function in order to keep the precision for big numbers. Numbers in scientific notation are parsed
|
|
677
|
-
* back to the standard notation. For example "5e-3" is parsed to "0.005".
|
|
678
|
-
* @param {boolean} [oFormatOptions.preserveDecimals=false] Whether {@link #format} preserves decimal digits except trailing zeros
|
|
679
|
-
* in case there are more decimals than the <code>maxFractionDigits</code> format option allows.
|
|
680
|
-
* If decimals are not preserved, the formatted number is rounded to <code>maxFractionDigits</code>.
|
|
681
|
-
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are 'short, 'long' or 'standard' (based on CLDR decimalFormat). Numbers are formatted into compact forms when it's set to
|
|
682
|
-
* 'short' or 'long'. When this option is set, the default value of option 'precision' is set to 2. This can be changed by setting either min/maxFractionDigits, decimals, shortDecimals or precision option.
|
|
683
|
-
* @param {sap.ui.core.format.NumberFormat.RoundingMode} [oFormatOptions.roundingMode=HALF_AWAY_FROM_ZERO] specifies a rounding behavior for discarding the digits after the maximum fraction digits
|
|
684
|
-
* defined by maxFractionDigits. Rounding will only be applied, if the passed value if of type number. This can be assigned by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}
|
|
685
|
-
* or a function which will be used for rounding the number. The function is called with two parameters: the number and how many decimal digits should be reserved.
|
|
686
|
-
* @param {number} [oFormatOptions.emptyString=NaN] @since 1.30.0 defines what empty string is parsed as and what is formatted as empty string. The allowed values are "" (empty string), NaN, null or 0.
|
|
687
|
-
* The 'format' and 'parse' are done in a symmetric way. For example when this parameter is set to NaN, empty string is parsed as NaN and NaN is formatted as empty string.
|
|
822
|
+
* @param {string} [oFormatOptions.style=standard] defines the style of format. Valid values are
|
|
823
|
+
* 'short, 'long' or 'standard' (based on the CLDR decimalFormat). When set to 'short' or 'long',
|
|
824
|
+
* numbers are formatted into compact forms. When this option is set, the default value of the
|
|
825
|
+
* 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits,
|
|
826
|
+
* decimals, shortDecimals, or the 'precision' option itself.
|
|
688
827
|
* @param {sap.ui.core.Locale} [oLocale] Locale to get the formatter for
|
|
689
828
|
* @return {sap.ui.core.format.NumberFormat} percentage instance of the NumberFormat
|
|
690
829
|
* @static
|
|
691
830
|
* @public
|
|
692
|
-
|
|
831
|
+
*/
|
|
693
832
|
NumberFormat.getPercentInstance = function(oFormatOptions, oLocale) {
|
|
694
833
|
var oFormat = this.createInstance(oFormatOptions, oLocale),
|
|
695
834
|
oLocaleFormatOptions = this.getLocaleFormatOptions(oFormat.oLocaleData, mNumberType.PERCENT);
|
|
696
835
|
|
|
697
|
-
oFormat.oFormatOptions = extend({}, this.oDefaultPercentFormat, oLocaleFormatOptions,
|
|
836
|
+
oFormat.oFormatOptions = extend({}, this.oDefaultPercentFormat, oLocaleFormatOptions, oFormat.oOriginalFormatOptions);
|
|
698
837
|
return oFormat;
|
|
699
838
|
};
|
|
700
839
|
|
|
@@ -1073,6 +1212,12 @@ sap.ui.define([
|
|
|
1073
1212
|
sLookupMeasure,
|
|
1074
1213
|
bValueIsNullOrUndefined = vValue === undefined || vValue === null;
|
|
1075
1214
|
|
|
1215
|
+
if (oOptions.groupingEnabled && oOptions.groupingSize <= 0) {
|
|
1216
|
+
// invalid grouping size specified
|
|
1217
|
+
Log.error("Grouping requires the 'groupingSize' format option to be a positive number, but it is '" + oOptions.groupingSize + "' instead.");
|
|
1218
|
+
return "";
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1076
1221
|
// emptyString is only relevant for the number part (vValue)
|
|
1077
1222
|
if (oOptions.showNumber && (vValue === oOptions.emptyString || (isNaN(vValue) && isNaN(oOptions.emptyString)))) {
|
|
1078
1223
|
// if the value equals the 'emptyString' format option, return empty string.
|
|
@@ -1796,8 +1941,8 @@ sap.ui.define([
|
|
|
1796
1941
|
return (oOptions.type === mNumberType.CURRENCY || oOptions.type === mNumberType.UNIT) ? null : NaN;
|
|
1797
1942
|
}
|
|
1798
1943
|
|
|
1799
|
-
// Get rid of leading zeros
|
|
1800
|
-
if (oOptions.parseAsString) {
|
|
1944
|
+
// Get rid of leading zeros (percent was already shifted)
|
|
1945
|
+
if (oOptions.parseAsString && !bPercent) {
|
|
1801
1946
|
vResult = NumberFormat._shiftDecimalPoint(sValue, 0);
|
|
1802
1947
|
}
|
|
1803
1948
|
|
|
@@ -1863,13 +2008,20 @@ sap.ui.define([
|
|
|
1863
2008
|
/**
|
|
1864
2009
|
* Returns the scaling factor which is calculated based on the format options and the current locale being used.
|
|
1865
2010
|
*
|
|
1866
|
-
* This function returns meaningful scaling factor
|
|
1867
|
-
*
|
|
2011
|
+
* This function only returns a meaningful scaling factor when the 'style' formatting option is set
|
|
2012
|
+
* to 'short' or 'long', and the 'shortRefNumber' option for calculating the scale factor is set.
|
|
1868
2013
|
*
|
|
1869
|
-
* Consider using this function when the
|
|
2014
|
+
* Consider using this function when the 'showScale' option is set to <code>false</code>, which
|
|
2015
|
+
* causes the scale factor not to appear in every formatted number but in a shared place.
|
|
1870
2016
|
*
|
|
1871
|
-
* @
|
|
1872
|
-
*
|
|
2017
|
+
* @example thousand (locale "en")
|
|
2018
|
+
*
|
|
2019
|
+
* NumberFormat.getFloatInstance({style: "long", shortRefNumber: 1000}).getScale();
|
|
2020
|
+
* // "thousand"
|
|
2021
|
+
*
|
|
2022
|
+
* @returns {string|undefined} The scale string if it exists based on the given 'shortRefNumber' option. Otherwise it returns <code>undefined</code>.
|
|
2023
|
+
* @since 1.100
|
|
2024
|
+
* @public
|
|
1873
2025
|
*/
|
|
1874
2026
|
NumberFormat.prototype.getScale = function() {
|
|
1875
2027
|
if ((this.oFormatOptions.style !== "short" && this.oFormatOptions.style !== "long") || this.oFormatOptions.shortRefNumber === undefined) {
|