@openui5/sap.ui.core 1.136.1 → 1.138.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/.eslintrc.json +3 -3
  2. package/REUSE.toml +0 -28
  3. package/THIRDPARTY.txt +1 -25
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +1 -1
  6. package/src/jquery.sap.properties.js +1 -1
  7. package/src/jquery.sap.resources.js +1 -1
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/sap/base/Event.js +1 -1
  11. package/src/sap/base/Eventing.js +1 -1
  12. package/src/sap/base/config.js +1 -1
  13. package/src/sap/base/i18n/LanguageTag.js +1 -1
  14. package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
  15. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  16. package/src/sap/base/util/restricted/_castArray.js +1 -1
  17. package/src/sap/base/util/restricted/_compact.js +1 -1
  18. package/src/sap/base/util/restricted/_curry.js +1 -1
  19. package/src/sap/base/util/restricted/_debounce.js +1 -1
  20. package/src/sap/base/util/restricted/_difference.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  22. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  25. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  26. package/src/sap/base/util/restricted/_flatten.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  28. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  29. package/src/sap/base/util/restricted/_intersection.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  31. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  33. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  34. package/src/sap/base/util/restricted/_isNil.js +1 -1
  35. package/src/sap/base/util/restricted/_max.js +1 -1
  36. package/src/sap/base/util/restricted/_merge.js +1 -1
  37. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  38. package/src/sap/base/util/restricted/_min.js +1 -1
  39. package/src/sap/base/util/restricted/_omit.js +1 -1
  40. package/src/sap/base/util/restricted/_pick.js +1 -1
  41. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  42. package/src/sap/base/util/restricted/_throttle.js +1 -1
  43. package/src/sap/base/util/restricted/_toArray.js +1 -1
  44. package/src/sap/base/util/restricted/_union.js +1 -1
  45. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  46. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  47. package/src/sap/base/util/restricted/_uniq.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  49. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  50. package/src/sap/base/util/restricted/_without.js +1 -1
  51. package/src/sap/base/util/restricted/_xor.js +1 -1
  52. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  53. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  55. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  56. package/src/sap/ui/Device.js +3 -3
  57. package/src/sap/ui/Global.js +3 -3
  58. package/src/sap/ui/base/BindingInfo.js +12 -8
  59. package/src/sap/ui/base/BindingParser.js +14 -7
  60. package/src/sap/ui/base/Event.js +1 -1
  61. package/src/sap/ui/base/EventProvider.js +1 -8
  62. package/src/sap/ui/base/Interface.js +1 -1
  63. package/src/sap/ui/base/ManagedObject.js +15 -42
  64. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  65. package/src/sap/ui/base/Metadata.js +1 -1
  66. package/src/sap/ui/base/Object.js +1 -1
  67. package/src/sap/ui/base/ObjectPool.js +1 -1
  68. package/src/sap/ui/base/_runWithOwner.js +43 -0
  69. package/src/sap/ui/core/.library +3 -30
  70. package/src/sap/ui/core/BusyIndicator.js +8 -8
  71. package/src/sap/ui/core/Component.js +61 -73
  72. package/src/sap/ui/core/ComponentContainer.js +22 -2
  73. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  74. package/src/sap/ui/core/ComponentSupport.js +1 -1
  75. package/src/sap/ui/core/Configuration.js +1 -1
  76. package/src/sap/ui/core/Control.js +1 -1
  77. package/src/sap/ui/core/Core.js +2 -2
  78. package/src/sap/ui/core/CustomData.js +1 -1
  79. package/src/sap/ui/core/DeclarativeSupport.js +13 -11
  80. package/src/sap/ui/core/Element.js +1 -3
  81. package/src/sap/ui/core/ElementMetadata.js +1 -1
  82. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  83. package/src/sap/ui/core/EventBus.js +1 -1
  84. package/src/sap/ui/core/ExtensionPoint.js +4 -4
  85. package/src/sap/ui/core/Fragment.js +4 -2
  86. package/src/sap/ui/core/HTML.js +1 -1
  87. package/src/sap/ui/core/History.js +1 -1
  88. package/src/sap/ui/core/Icon.js +1 -1
  89. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  90. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  91. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  92. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  93. package/src/sap/ui/core/InvisibleText.js +1 -1
  94. package/src/sap/ui/core/Item.js +1 -1
  95. package/src/sap/ui/core/LabelEnablement.js +1 -1
  96. package/src/sap/ui/core/LayoutData.js +1 -1
  97. package/src/sap/ui/core/ListItem.js +1 -1
  98. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  99. package/src/sap/ui/core/Locale.js +1 -1
  100. package/src/sap/ui/core/LocaleData.js +1 -1
  101. package/src/sap/ui/core/Manifest.js +1 -1
  102. package/src/sap/ui/core/Message.js +1 -1
  103. package/src/sap/ui/core/Popup.js +65 -180
  104. package/src/sap/ui/core/RenderManager.js +1 -1
  105. package/src/sap/ui/core/Renderer.js +1 -1
  106. package/src/sap/ui/core/ResizeHandler.js +1 -1
  107. package/src/sap/ui/core/ScrollBar.js +1 -1
  108. package/src/sap/ui/core/SeparatorItem.js +1 -1
  109. package/src/sap/ui/core/Theming.js +2 -2
  110. package/src/sap/ui/core/Title.js +1 -1
  111. package/src/sap/ui/core/TooltipBase.js +1 -1
  112. package/src/sap/ui/core/UIArea.js +1 -1
  113. package/src/sap/ui/core/UIComponent.js +11 -56
  114. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  115. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  116. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  117. package/src/sap/ui/core/XMLComposite.js +1 -1
  118. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  119. package/src/sap/ui/core/XMLTemplateProcessor.js +5 -1
  120. package/src/sap/ui/core/_IconRegistry.js +2 -0
  121. package/src/sap/ui/core/date/UI5Date.js +1 -1
  122. package/src/sap/ui/core/delegate/ItemNavigation.js +2 -2
  123. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  124. package/src/sap/ui/core/dnd/DragDropBase.js +12 -2
  125. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  126. package/src/sap/ui/core/dnd/DragInfo.js +5 -3
  127. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  128. package/src/sap/ui/core/format/FormatUtils.js +1 -1
  129. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  130. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  131. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  132. package/src/sap/ui/core/i18n/interaction_ar.xml +27 -0
  133. package/src/sap/ui/core/i18n/interaction_bg.xml +27 -0
  134. package/src/sap/ui/core/i18n/interaction_ca.xml +27 -0
  135. package/src/sap/ui/core/i18n/interaction_cnr.xml +27 -0
  136. package/src/sap/ui/core/i18n/interaction_cs.xml +27 -0
  137. package/src/sap/ui/core/i18n/interaction_cy.xml +27 -0
  138. package/src/sap/ui/core/i18n/interaction_da.xml +27 -0
  139. package/src/sap/ui/core/i18n/interaction_de.xml +27 -0
  140. package/src/sap/ui/core/i18n/interaction_el.xml +27 -0
  141. package/src/sap/ui/core/i18n/interaction_en.xml +27 -0
  142. package/src/sap/ui/core/i18n/interaction_en_GB.xml +27 -0
  143. package/src/sap/ui/core/i18n/interaction_en_US_saprigi.xml +27 -0
  144. package/src/sap/ui/core/i18n/interaction_es.xml +27 -0
  145. package/src/sap/ui/core/i18n/interaction_es_MX.xml +27 -0
  146. package/src/sap/ui/core/i18n/interaction_et.xml +27 -0
  147. package/src/sap/ui/core/i18n/interaction_fi.xml +27 -0
  148. package/src/sap/ui/core/i18n/interaction_fr.xml +27 -0
  149. package/src/sap/ui/core/i18n/interaction_fr_CA.xml +27 -0
  150. package/src/sap/ui/core/i18n/interaction_hi.xml +27 -0
  151. package/src/sap/ui/core/i18n/interaction_hr.xml +27 -0
  152. package/src/sap/ui/core/i18n/interaction_hu.xml +27 -0
  153. package/src/sap/ui/core/i18n/interaction_id.xml +27 -0
  154. package/src/sap/ui/core/i18n/interaction_it.xml +27 -0
  155. package/src/sap/ui/core/i18n/interaction_iw.xml +27 -0
  156. package/src/sap/ui/core/i18n/interaction_ja.xml +27 -0
  157. package/src/sap/ui/core/i18n/interaction_kk.xml +27 -0
  158. package/src/sap/ui/core/i18n/interaction_ko.xml +27 -0
  159. package/src/sap/ui/core/i18n/interaction_lt.xml +27 -0
  160. package/src/sap/ui/core/i18n/interaction_lv.xml +27 -0
  161. package/src/sap/ui/core/i18n/interaction_mk.xml +27 -0
  162. package/src/sap/ui/core/i18n/interaction_ms.xml +27 -0
  163. package/src/sap/ui/core/i18n/interaction_nl.xml +27 -0
  164. package/src/sap/ui/core/i18n/interaction_no.xml +27 -0
  165. package/src/sap/ui/core/i18n/interaction_pl.xml +27 -0
  166. package/src/sap/ui/core/i18n/interaction_pt.xml +27 -0
  167. package/src/sap/ui/core/i18n/interaction_pt_PT.xml +27 -0
  168. package/src/sap/ui/core/i18n/interaction_ro.xml +27 -0
  169. package/src/sap/ui/core/i18n/interaction_ru.xml +27 -0
  170. package/src/sap/ui/core/i18n/interaction_sh.xml +27 -0
  171. package/src/sap/ui/core/i18n/interaction_sk.xml +27 -0
  172. package/src/sap/ui/core/i18n/interaction_sl.xml +27 -0
  173. package/src/sap/ui/core/i18n/interaction_sr.xml +27 -0
  174. package/src/sap/ui/core/i18n/interaction_sv.xml +27 -0
  175. package/src/sap/ui/core/i18n/interaction_th.xml +27 -0
  176. package/src/sap/ui/core/i18n/interaction_tr.xml +27 -0
  177. package/src/sap/ui/core/i18n/interaction_uk.xml +27 -0
  178. package/src/sap/ui/core/i18n/interaction_vi.xml +27 -0
  179. package/src/sap/ui/core/i18n/interaction_zh_CN.xml +27 -0
  180. package/src/sap/ui/core/i18n/interaction_zh_TW.xml +27 -0
  181. package/src/sap/ui/core/interaction/KeyboardInteractionDisplay.js +43 -7
  182. package/src/sap/ui/core/library.js +3 -3
  183. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  184. package/src/sap/ui/core/message/Message.js +1 -1
  185. package/src/sap/ui/core/message/MessageManager.js +1 -1
  186. package/src/sap/ui/core/message/MessageParser.js +1 -1
  187. package/src/sap/ui/core/message/MessageProcessor.js +6 -6
  188. package/src/sap/ui/core/messagebundle_ar.properties +21 -1
  189. package/src/sap/ui/core/messagebundle_bg.properties +21 -1
  190. package/src/sap/ui/core/messagebundle_ca.properties +21 -1
  191. package/src/sap/ui/core/messagebundle_cnr.properties +21 -1
  192. package/src/sap/ui/core/messagebundle_cs.properties +21 -1
  193. package/src/sap/ui/core/messagebundle_cy.properties +21 -1
  194. package/src/sap/ui/core/messagebundle_da.properties +21 -1
  195. package/src/sap/ui/core/messagebundle_de.properties +22 -2
  196. package/src/sap/ui/core/messagebundle_el.properties +21 -1
  197. package/src/sap/ui/core/messagebundle_en.properties +21 -1
  198. package/src/sap/ui/core/messagebundle_en_GB.properties +21 -1
  199. package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +21 -1
  200. package/src/sap/ui/core/messagebundle_es.properties +23 -3
  201. package/src/sap/ui/core/messagebundle_es_MX.properties +21 -1
  202. package/src/sap/ui/core/messagebundle_et.properties +21 -1
  203. package/src/sap/ui/core/messagebundle_fi.properties +22 -2
  204. package/src/sap/ui/core/messagebundle_fr.properties +21 -1
  205. package/src/sap/ui/core/messagebundle_fr_CA.properties +21 -1
  206. package/src/sap/ui/core/messagebundle_hi.properties +21 -1
  207. package/src/sap/ui/core/messagebundle_hr.properties +21 -1
  208. package/src/sap/ui/core/messagebundle_hu.properties +21 -1
  209. package/src/sap/ui/core/messagebundle_id.properties +23 -3
  210. package/src/sap/ui/core/messagebundle_it.properties +21 -1
  211. package/src/sap/ui/core/messagebundle_iw.properties +21 -1
  212. package/src/sap/ui/core/messagebundle_ja.properties +21 -1
  213. package/src/sap/ui/core/messagebundle_kk.properties +23 -3
  214. package/src/sap/ui/core/messagebundle_ko.properties +21 -1
  215. package/src/sap/ui/core/messagebundle_lt.properties +21 -1
  216. package/src/sap/ui/core/messagebundle_lv.properties +21 -1
  217. package/src/sap/ui/core/messagebundle_mk.properties +24 -4
  218. package/src/sap/ui/core/messagebundle_ms.properties +21 -1
  219. package/src/sap/ui/core/messagebundle_nl.properties +21 -1
  220. package/src/sap/ui/core/messagebundle_no.properties +21 -1
  221. package/src/sap/ui/core/messagebundle_pl.properties +21 -1
  222. package/src/sap/ui/core/messagebundle_pt.properties +21 -1
  223. package/src/sap/ui/core/messagebundle_pt_PT.properties +21 -1
  224. package/src/sap/ui/core/messagebundle_ro.properties +21 -1
  225. package/src/sap/ui/core/messagebundle_ru.properties +23 -3
  226. package/src/sap/ui/core/messagebundle_sh.properties +21 -1
  227. package/src/sap/ui/core/messagebundle_sk.properties +21 -1
  228. package/src/sap/ui/core/messagebundle_sl.properties +23 -3
  229. package/src/sap/ui/core/messagebundle_sr.properties +21 -1
  230. package/src/sap/ui/core/messagebundle_sv.properties +21 -1
  231. package/src/sap/ui/core/messagebundle_th.properties +21 -1
  232. package/src/sap/ui/core/messagebundle_tr.properties +21 -1
  233. package/src/sap/ui/core/messagebundle_uk.properties +22 -2
  234. package/src/sap/ui/core/messagebundle_vi.properties +21 -1
  235. package/src/sap/ui/core/messagebundle_zh_CN.properties +21 -1
  236. package/src/sap/ui/core/messagebundle_zh_TW.properties +23 -3
  237. package/src/sap/ui/core/mvc/Controller.js +3 -1
  238. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  239. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  240. package/src/sap/ui/core/mvc/JSView.js +1 -1
  241. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  242. package/src/sap/ui/core/mvc/View.js +12 -181
  243. package/src/sap/ui/core/mvc/XMLView.js +2 -1
  244. package/src/sap/ui/core/mvc/_ViewFactory.js +192 -0
  245. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  246. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  247. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  248. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  249. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  250. package/src/sap/ui/core/routing/Route.js +197 -13
  251. package/src/sap/ui/core/routing/Router.js +19 -8
  252. package/src/sap/ui/core/routing/RouterHashChanger.js +12 -3
  253. package/src/sap/ui/core/routing/Target.js +714 -61
  254. package/src/sap/ui/core/routing/TargetCache.js +205 -25
  255. package/src/sap/ui/core/routing/Targets.js +162 -67
  256. package/src/sap/ui/core/routing/Views.js +1 -0
  257. package/src/sap/ui/core/routing/sync/Route.js +1 -1
  258. package/src/sap/ui/core/routing/sync/Target.js +11 -1
  259. package/src/sap/ui/core/routing/sync/TargetCache.js +3 -3
  260. package/src/sap/ui/core/routing/sync/Targets.js +1 -1
  261. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  262. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  263. package/src/sap/ui/core/service/Service.js +1 -48
  264. package/src/sap/ui/core/service/ServiceFactory.js +44 -4
  265. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  266. package/src/sap/ui/core/support/Plugin.js +1 -1
  267. package/src/sap/ui/core/support/Support.js +356 -353
  268. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  269. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  270. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  271. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  272. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  273. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  274. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  275. package/src/sap/ui/core/support/plugins/ViewInfo.js +4 -2
  276. package/src/sap/ui/core/themes/base/base.less +71 -29
  277. package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
  278. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  279. package/src/sap/ui/core/themes/base/global.less +4 -0
  280. package/src/sap/ui/core/themes/base/skeleton.less +9 -4
  281. package/src/sap/ui/core/theming/ThemeHelper.js +1 -18
  282. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  283. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  284. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +4 -4
  285. package/src/sap/ui/core/tmpl/Template.js +1 -1
  286. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  287. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  288. package/src/sap/ui/core/util/Export.js +1 -1
  289. package/src/sap/ui/core/util/ExportCell.js +1 -1
  290. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  291. package/src/sap/ui/core/util/ExportRow.js +1 -1
  292. package/src/sap/ui/core/util/ExportType.js +1 -1
  293. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  294. package/src/sap/ui/core/util/File.js +1 -1
  295. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  296. package/src/sap/ui/core/util/MockServer.js +1 -1
  297. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  298. package/src/sap/ui/core/util/XMLPreprocessor.js +8 -1
  299. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +4 -4
  300. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  301. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  302. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  303. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  304. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  305. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  306. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  307. package/src/sap/ui/core/webc/WebComponent.js +71 -3
  308. package/src/sap/ui/core/webc/WebComponentMetadata.js +2 -3
  309. package/src/sap/ui/core/webc/WebComponentRenderer.js +1 -1
  310. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  311. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  312. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  313. package/src/sap/ui/debug/ControlTree.js +1 -1
  314. package/src/sap/ui/debug/DebugEnv.js +1 -1
  315. package/src/sap/ui/debug/PropertyList.js +1 -1
  316. package/src/sap/ui/model/ClientModel.js +1 -1
  317. package/src/sap/ui/model/CompositeDataState.js +1 -1
  318. package/src/sap/ui/model/CompositeType.js +1 -1
  319. package/src/sap/ui/model/DataState.js +1 -1
  320. package/src/sap/ui/model/MetaModel.js +1 -1
  321. package/src/sap/ui/model/Model.js +1 -1
  322. package/src/sap/ui/model/SelectionModel.js +1 -1
  323. package/src/sap/ui/model/SimpleType.js +1 -1
  324. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  325. package/src/sap/ui/model/Type.js +1 -1
  326. package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -1
  327. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +2 -1
  328. package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
  329. package/src/sap/ui/model/analytics/odata4analytics.js +2 -1
  330. package/src/sap/ui/model/json/JSONModel.js +1 -1
  331. package/src/sap/ui/model/message/MessageModel.js +1 -1
  332. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  333. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  334. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  335. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  336. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  337. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +2 -1
  338. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +3 -3
  339. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  340. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  341. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  342. package/src/sap/ui/model/odata/type/Date.js +1 -1
  343. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  344. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  345. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  346. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  347. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  348. package/src/sap/ui/model/odata/type/Double.js +1 -1
  349. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  350. package/src/sap/ui/model/odata/type/Int.js +1 -1
  351. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  352. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  353. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  354. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  355. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  356. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  357. package/src/sap/ui/model/odata/type/Single.js +1 -1
  358. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  359. package/src/sap/ui/model/odata/type/String.js +1 -1
  360. package/src/sap/ui/model/odata/type/Time.js +1 -1
  361. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  362. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  363. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  364. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  365. package/src/sap/ui/model/odata/v2/ODataModel.js +1 -1
  366. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  367. package/src/sap/ui/model/odata/v4/Context.js +4 -7
  368. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  369. package/src/sap/ui/model/odata/v4/ODataListBinding.js +9 -9
  370. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +57 -19
  371. package/src/sap/ui/model/odata/v4/ODataModel.js +8 -7
  372. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  373. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +3 -3
  374. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +118 -90
  375. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +29 -0
  376. package/src/sap/ui/model/odata/v4/lib/_Cache.js +33 -12
  377. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +10 -4
  378. package/src/sap/ui/model/odata/v4/lib/_Helper.js +5 -3
  379. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +47 -16
  380. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  381. package/src/sap/ui/model/type/Boolean.js +1 -1
  382. package/src/sap/ui/model/type/Currency.js +1 -1
  383. package/src/sap/ui/model/type/Date.js +1 -1
  384. package/src/sap/ui/model/type/DateInterval.js +1 -1
  385. package/src/sap/ui/model/type/DateTime.js +1 -1
  386. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  387. package/src/sap/ui/model/type/FileSize.js +1 -1
  388. package/src/sap/ui/model/type/Float.js +1 -1
  389. package/src/sap/ui/model/type/Integer.js +1 -1
  390. package/src/sap/ui/model/type/String.js +1 -1
  391. package/src/sap/ui/model/type/Time.js +1 -1
  392. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  393. package/src/sap/ui/model/type/Unit.js +1 -1
  394. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  395. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  396. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  397. package/src/sap/ui/test/Opa.js +14 -2
  398. package/src/sap/ui/test/Opa5.js +61 -10
  399. package/src/sap/ui/test/TestUtils.js +6 -2
  400. package/src/sap/ui/test/generic/TestBase.js +1 -1
  401. package/src/sap/ui/thirdparty/datajs.js +13 -10
  402. package/src/sap/ui/util/Storage.js +1 -1
  403. package/src/ui5loader-autoconfig.js +1 -18
  404. package/src/ui5loader.js +1 -1
  405. package/src/sap/ui/core/routing/async/Route.js +0 -186
  406. package/src/sap/ui/core/routing/async/Target.js +0 -712
  407. package/src/sap/ui/core/routing/async/TargetCache.js +0 -196
  408. package/src/sap/ui/core/routing/async/Targets.js +0 -130
  409. package/src/sap/ui/thirdparty/iscroll-lite.js +0 -603
  410. package/src/sap/ui/thirdparty/iscroll.js +0 -1104
  411. package/src/sap/ui/thirdparty/mobiscroll/css/mobiscroll-core.css +0 -416
  412. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-core.js +0 -127
  413. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-datetime.js +0 -818
  414. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js +0 -1264
  415. package/src/sap/ui/thirdparty/swipe-view.js +0 -560
@@ -1,1264 +0,0 @@
1
- /*jslint eqeq: true, plusplus: true, undef: true, sloppy: true, vars: true, forin: true, nomen: true */
2
- (function ($) {
3
-
4
- $.mobiscroll.classes.Scroller = function (elem, settings) {
5
- var m,
6
- hi,
7
- v,
8
- dw,
9
- persp,
10
- overlay,
11
- ww, // Window width
12
- wh, // Window height
13
- mw, // Modal width
14
- mh, // Modal height
15
- lock,
16
- anim,
17
- theme,
18
- lang,
19
- click,
20
- hasButtons,
21
- scrollable,
22
- moved,
23
- start,
24
- startTime,
25
- stop,
26
- p,
27
- min,
28
- max,
29
- modal,
30
- target,
31
- index,
32
- timer,
33
- readOnly,
34
- preventChange,
35
- preventPos,
36
- wndw,
37
- doc,
38
- buttons,
39
- btn,
40
- that = this,
41
- e = elem,
42
- elm = $(e),
43
- s = extend({}, defaults),
44
- pres = {},
45
- iv = {},
46
- pos = {},
47
- pixels = {},
48
- wheels = [],
49
- elmList = [],
50
- input = elm.is('input'),
51
- visible = false,
52
- onStart = function (e) {
53
- // Scroll start
54
- if (testTouch(e) && !move && !click && !btn && !isReadOnly(this)) {
55
- // Prevent touch highlight
56
- e.preventDefault();
57
-
58
- move = true;
59
- scrollable = s.mode != 'clickpick';
60
- target = $('.dw-ul', this);
61
- setGlobals(target);
62
- moved = iv[index] !== undefined; // Don't allow tap, if still moving
63
- p = moved ? getCurrentPosition(target) : pos[index];
64
- start = getCoord(e, 'Y');
65
- startTime = new Date();
66
- stop = start;
67
- scroll(target, index, p, 0.001);
68
-
69
- if (scrollable) {
70
- target.closest('.dwwl').addClass('dwa');
71
- }
72
-
73
- $(document).on(MOVE_EVENT, onMove).on(END_EVENT, onEnd);
74
- }
75
- },
76
- onMove = function (e) {
77
- if (scrollable) {
78
- // Prevent scroll
79
- e.preventDefault();
80
- e.stopPropagation();
81
- stop = getCoord(e, 'Y');
82
- scroll(target, index, constrain(p + (start - stop) / hi, min - 1, max + 1));
83
- }
84
- if (start !== stop) {
85
- moved = true;
86
- }
87
- },
88
- onEnd = function (e) {
89
- var time = new Date() - startTime,
90
- val = constrain(p + (start - stop) / hi, min - 1, max + 1),
91
- speed,
92
- dist,
93
- tindex,
94
- ttop = target.offset().top;
95
-
96
- if (time < 300) {
97
- speed = (stop - start) / time;
98
- dist = (speed * speed) / s.speedUnit;
99
- if (stop - start < 0) {
100
- dist = -dist;
101
- }
102
- } else {
103
- dist = stop - start;
104
- }
105
-
106
- tindex = Math.round(p - dist / hi);
107
-
108
- if (!dist && !moved) { // this is a "tap"
109
- var idx = Math.floor((stop - ttop) / hi),
110
- li = $($('.dw-li', target)[idx]),
111
- hl = scrollable;
112
- if (event('onValueTap', [li]) !== false) {
113
- tindex = idx;
114
- } else {
115
- hl = true;
116
- }
117
-
118
- if (hl) {
119
- li.addClass('dw-hl'); // Highlight
120
- setTimeout(function () {
121
- li.removeClass('dw-hl');
122
- }, 200);
123
- }
124
- }
125
-
126
- if (scrollable) {
127
- calc(target, tindex, 0, true, Math.round(val));
128
- }
129
-
130
- move = false;
131
- target = null;
132
-
133
- $(document).off(MOVE_EVENT, onMove).off(END_EVENT, onEnd);
134
- },
135
- onBtnStart = function (e) {
136
- if (btn) {
137
- btn.removeClass('dwb-a');
138
- }
139
- btn = $(this);
140
- $(document).on(END_EVENT, onBtnEnd);
141
- // Active button
142
- if (!btn.hasClass('dwb-d') && !btn.hasClass('dwb-nhl')) {
143
- btn.addClass('dwb-a');
144
- }
145
- // +/- buttons
146
- if (btn.hasClass('dwwb')) {
147
- if (testTouch(e)) {
148
- step(e, btn.closest('.dwwl'), btn.hasClass('dwwbp') ? plus : minus);
149
- }
150
- }
151
- },
152
- onBtnEnd = function (e) {
153
- if (click) {
154
- clearInterval(timer);
155
- click = false;
156
- }
157
- if (btn) {
158
- btn.removeClass('dwb-a');
159
- btn = null;
160
- }
161
- $(document).off(END_EVENT, onBtnEnd);
162
- },
163
-
164
- // ##### BEGIN: MODIFIED BY SAP //
165
- /*Improving sap.m.DateTimeInput keyboard handling:
166
- *
167
- Adding check if [ALT] key is pressed in combination with [ARROW_UP] and [ARROW_DOWN] keys,
168
- because [ALT]+[ARROW_UP] and [ALT]+[ARROW_DOWN] should close the scroller.
169
- *
170
- Adding keyboard handling for PAGE_UP and PAGE_DOWN keys:
171
- - on page_up press - scroller moves to the first (minimum) value of the column currently on focus.
172
- - on page_down press - scroller moves to the last (maximum) value of the column currently on focus.
173
- */
174
-
175
- onKeyDown = function (e) {
176
- if (e.which == 38 && !e.altKey) {
177
- step(e, $(this), minus); // up
178
- } else if (e.which == 40 && !e.altKey) {
179
- step(e, $(this), plus); // down
180
- } else if (e.which == 33) {
181
- step(e, $(this), pageUp); // page up
182
- } else if (e.which == 34) {
183
- step(e, $(this), pageDown); // page down
184
- }
185
- },
186
- // ##### END: MODIFIED BY SAP
187
-
188
- onKeyUp = function (e) {
189
- if (click) {
190
- clearInterval(timer);
191
- click = false;
192
- }
193
- },
194
- onScroll = function (e) {
195
- if (!isReadOnly(this)) {
196
- e.preventDefault();
197
- e = e.originalEvent || e;
198
- var delta = e.wheelDelta ? (e.wheelDelta / 120) : (e.detail ? (-e.detail / 3) : 0),
199
- t = $('.dw-ul', this);
200
-
201
- setGlobals(t);
202
- calc(t, Math.round(pos[index] - delta), delta < 0 ? 1 : 2);
203
- }
204
- };
205
-
206
- // Private functions
207
-
208
- function step(e, w, func) {
209
- e.stopPropagation();
210
- e.preventDefault();
211
- if (!click && !isReadOnly(w) && !w.hasClass('dwa')) {
212
- click = true;
213
- // + Button
214
- var t = w.find('.dw-ul');
215
-
216
- setGlobals(t);
217
- clearInterval(timer);
218
- timer = setInterval(function () { func(t); }, s.delay);
219
- func(t);
220
- }
221
- }
222
-
223
- function isReadOnly(wh) {
224
- if ($.isArray(s.readonly)) {
225
- var i = $('.dwwl', dw).index(wh);
226
- return s.readonly[i];
227
- }
228
- return s.readonly;
229
- }
230
-
231
- function generateWheelItems(i) {
232
- var html = '<div class="dw-bf">',
233
- ww = wheels[i],
234
- w = ww.values ? ww : convert(ww),
235
- l = 1,
236
- labels = w.labels || [],
237
- values = w.values,
238
- keys = w.keys || values;
239
-
240
- $.each(values, function (j, v) {
241
- if (l % 20 == 0) {
242
- html += '</div><div class="dw-bf">';
243
- }
244
- html += '<div role="option" aria-selected="false" class="dw-li dw-v" data-val="' + keys[j] + '"' + (labels[j] ? ' aria-label="' + labels[j] + '"' : '') + ' style="height:' + hi + 'px;line-height:' + hi + 'px;"><div class="dw-i">' + v + '</div></div>';
245
- l++;
246
- });
247
-
248
- html += '</div>';
249
- return html;
250
- }
251
-
252
- function setGlobals(t) {
253
- min = $('.dw-li', t).index($('.dw-v', t).eq(0));
254
- max = $('.dw-li', t).index($('.dw-v', t).eq(-1));
255
- index = $('.dw-ul', dw).index(t);
256
- }
257
-
258
- function formatHeader(v) {
259
- var t = s.headerText;
260
- return t ? (typeof t === 'function' ? t.call(e, v) : t.replace(/\{value\}/i, v)) : '';
261
- }
262
-
263
- function read() {
264
- that.temp = that.values ? that.values.slice(0) : s.parseValue(elm.val() || '', that);
265
- setVal();
266
- }
267
-
268
- function getCurrentPosition(t) {
269
- var style = window.getComputedStyle ? getComputedStyle(t[0]) : t[0].style,
270
- matrix,
271
- px;
272
-
273
- if (has3d) {
274
- $.each(['t', 'webkitT', 'MozT', 'OT', 'msT'], function (i, v) {
275
- if (style[v + 'ransform'] !== undefined) {
276
- matrix = style[v + 'ransform'];
277
- return false;
278
- }
279
- });
280
- matrix = matrix.split(')')[0].split(', ');
281
- px = matrix[13] || matrix[5];
282
- } else {
283
- px = style.top.replace('px', '');
284
- }
285
-
286
- return Math.round(m - (px / hi));
287
- }
288
-
289
- function ready(t, i) {
290
- clearTimeout(iv[i]);
291
- delete iv[i];
292
- t.closest('.dwwl').removeClass('dwa');
293
- }
294
-
295
- function scroll(t, index, val, time, active) {
296
- var px = (m - val) * hi,
297
- style = t[0].style,
298
- i;
299
-
300
- if (px == pixels[index] && iv[index]) {
301
- return;
302
- }
303
-
304
- if (time && px != pixels[index]) {
305
- // Trigger animation start event
306
- event('onAnimStart', [dw, index, time]);
307
- }
308
-
309
- pixels[index] = px;
310
-
311
- style[pr + 'Transition'] = 'all ' + (time ? time.toFixed(3) : 0) + 's ease-out';
312
-
313
- if (has3d) {
314
- style[pr + 'Transform'] = 'translate3d(0,' + px + 'px,0)';
315
- } else {
316
- style.top = px + 'px';
317
- }
318
-
319
- if (iv[index]) {
320
- ready(t, index);
321
- }
322
-
323
- if (time && active) {
324
- t.closest('.dwwl').addClass('dwa');
325
- iv[index] = setTimeout(function () {
326
- ready(t, index);
327
- }, time * 1000);
328
- }
329
-
330
- pos[index] = val;
331
- }
332
-
333
- function getValid(val, t, dir) {
334
- var cell = $('.dw-li[data-val="' + val + '"]', t),
335
- cells = $('.dw-li', t),
336
- v = cells.index(cell),
337
- l = cells.length;
338
-
339
- // Scroll to a valid cell
340
- if (!cell.hasClass('dw-v')) {
341
- var cell1 = cell,
342
- cell2 = cell,
343
- dist1 = 0,
344
- dist2 = 0;
345
-
346
- while (v - dist1 >= 0 && !cell1.hasClass('dw-v')) {
347
- dist1++;
348
- cell1 = cells.eq(v - dist1);
349
- }
350
-
351
- while (v + dist2 < l && !cell2.hasClass('dw-v')) {
352
- dist2++;
353
- cell2 = cells.eq(v + dist2);
354
- }
355
-
356
- // If we have direction (+/- or mouse wheel), the distance does not count
357
- if (((dist2 < dist1 && dist2 && dir !== 2) || !dist1 || (v - dist1 < 0) || dir == 1) && cell2.hasClass('dw-v')) {
358
- cell = cell2;
359
- v = v + dist2;
360
- } else {
361
- cell = cell1;
362
- v = v - dist1;
363
- }
364
- }
365
-
366
- return {
367
- cell: cell,
368
- v: v,
369
- val: cell.attr('data-val')
370
- };
371
- }
372
-
373
- function scrollToPos(time, index, manual, dir, active) {
374
- // Call validation event
375
- if (event('validate', [dw, index, time, dir]) !== false) {
376
- // Set scrollers to position
377
- $('.dw-ul', dw).each(function (i) {
378
- var t = $(this),
379
- sc = i == index || index === undefined,
380
- res = getValid(that.temp[i], t, dir),
381
- cell = res.cell;
382
-
383
- if (!(cell.hasClass('dw-sel')) || sc) {
384
- // Set valid value
385
- that.temp[i] = res.val;
386
-
387
- if (!s.multiple) {
388
- $('.dw-sel', t).removeAttr('aria-selected');
389
- cell.attr('aria-selected', 'true');
390
- }
391
-
392
- // Add selected class to cell
393
- $('.dw-sel', t).removeClass('dw-sel');
394
- cell.addClass('dw-sel');
395
-
396
- // Scroll to position
397
- scroll(t, i, res.v, sc ? time : 0.1, sc ? active : false);
398
- }
399
- });
400
-
401
- // Reformat value if validation changed something
402
- v = s.formatResult(that.temp);
403
- if (that.live) {
404
- setVal(manual, manual, 0, true);
405
- }
406
-
407
- $('.dwv', dw).html(formatHeader(v));
408
-
409
- if (manual) {
410
- event('onChange', [v]);
411
- }
412
- }
413
-
414
- }
415
-
416
- function event(name, args) {
417
- var ret;
418
- args.push(that);
419
- $.each([theme, pres, settings], function (i, v) {
420
- if (v && v[name]) { // Call preset event
421
- ret = v[name].apply(e, args);
422
- }
423
- });
424
- return ret;
425
- }
426
-
427
- function calc(t, val, dir, anim, orig) {
428
- val = constrain(val, min, max);
429
-
430
- var cell = $('.dw-li', t).eq(val),
431
- o = orig === undefined ? val : orig,
432
- active = orig !== undefined,
433
- idx = index,
434
- time = anim ? (val == o ? 0.1 : Math.abs((val - o) * s.timeUnit)) : 0;
435
-
436
- // Set selected scroller value
437
- that.temp[idx] = cell.attr('data-val');
438
-
439
- scroll(t, idx, val, time, active);
440
-
441
- setTimeout(function () {
442
- // Validate
443
- scrollToPos(time, idx, true, dir, active);
444
- }, 10);
445
- }
446
-
447
- function plus(t) {
448
- var val = pos[index] + 1;
449
- calc(t, val > max ? min : val, 1, true);
450
- }
451
-
452
- function minus(t) {
453
- var val = pos[index] - 1;
454
- calc(t, val < min ? max : val, 2, true);
455
- }
456
-
457
- // ##### BEGIN: MODIFIED BY SAP //
458
- // Adding functions pageUp and pageDown,
459
- // called when [PAGE_UP] AND [PAGE_DOWN] keys are pressed
460
- function pageUp(t){
461
- calc(t, min, 2, true);
462
- }
463
-
464
- function pageDown(t){
465
- calc(t, max, 2, true);
466
- }
467
- // ##### END: MODIFIED BY SAP
468
-
469
- function setVal(fill, change, time, noscroll, temp, manual) {
470
- if (visible && !noscroll) {
471
- scrollToPos(time, undefined, manual);
472
- }
473
-
474
- v = s.formatResult(that.temp);
475
-
476
- if (!temp) {
477
- that.values = that.temp.slice(0);
478
- that.val = v;
479
- }
480
-
481
- if (fill) {
482
- if (input) {
483
- elm.val(v);
484
- if (change) {
485
- preventChange = true;
486
- elm.change();
487
- }
488
- }
489
-
490
- event('onValueFill', [v, change]);
491
- }
492
- }
493
-
494
- function attachPosition(ev, checkLock) {
495
- var debounce;
496
- wndw.on(ev, function (e) {
497
- clearTimeout(debounce);
498
- debounce = setTimeout(function () {
499
- if ((lock && checkLock) || !checkLock) {
500
- that.position(!checkLock);
501
- }
502
- }, 200);
503
- });
504
- }
505
-
506
- // Public functions
507
-
508
- /**
509
- * Positions the scroller on the screen.
510
- */
511
- that.position = function (check) {
512
-
513
- var nw = dw.width(), // To get the width without scrollbar
514
- nh = wndw[0].innerHeight || wndw.innerHeight();
515
-
516
- if (!(ww === nw && wh === nh && check) && !preventPos && (event('onPosition', [dw, nw, nh]) !== false) && modal) {
517
- var w,
518
- l,
519
- t,
520
- aw, // anchor width
521
- ah, // anchor height
522
- ap, // anchor position
523
- at, // anchor top
524
- al, // anchor left
525
- arr, // arrow
526
- arrw, // arrow width
527
- arrl, // arrow left
528
- dh,
529
- scroll,
530
- totalw = 0,
531
- minw = 0,
532
- sl = wndw.scrollLeft(),
533
- st = wndw.scrollTop(),
534
- wr = $('.dwwr', dw),
535
- d = $('.dw', dw),
536
- css = {},
537
- anchor = s.anchor === undefined ? elm : s.anchor;
538
-
539
- if (/modal|bubble/.test(s.display)) {
540
- $('.dwc', dw).each(function () {
541
- w = $(this).outerWidth(true);
542
- totalw += w;
543
- minw = (w > minw) ? w : minw;
544
- });
545
- w = totalw > nw ? minw : totalw;
546
- wr.width(w).css('white-space', totalw > nw ? '' : 'nowrap');
547
- }
548
-
549
- mw = d.outerWidth();
550
- mh = d.outerHeight(true);
551
- lock = mh <= nh && mw <= nw;
552
-
553
- that.scrollLock = lock;
554
-
555
- if (s.display == 'modal') {
556
- l = (nw - mw) / 2;
557
- t = st + (nh - mh) / 2;
558
- } else if (s.display == 'bubble') {
559
- scroll = true;
560
- arr = $('.dw-arrw-i', dw);
561
- ap = anchor.offset();
562
- at = Math.abs($(s.context).offset().top - ap.top);
563
- al = Math.abs($(s.context).offset().left - ap.left);
564
-
565
- // horizontal positioning
566
- aw = anchor.outerWidth();
567
- ah = anchor.outerHeight();
568
- l = constrain(al - (d.outerWidth(true) - aw) / 2 - sl, 3, nw - mw - 3);
569
-
570
- // vertical positioning
571
- t = at - mh; // above the input
572
- if ((t < st) || (at > st + nh)) { // if doesn't fit above or the input is out of the screen
573
- d.removeClass('dw-bubble-top').addClass('dw-bubble-bottom');
574
- t = at + ah; // below the input
575
- } else {
576
- d.removeClass('dw-bubble-bottom').addClass('dw-bubble-top');
577
- }
578
-
579
- // Calculate Arrow position
580
- arrw = arr.outerWidth();
581
- arrl = constrain(al + aw / 2 - (l + (mw - arrw) / 2) - sl, 0, arrw);
582
-
583
- // Limit Arrow position
584
- $('.dw-arr', dw).css({ left: arrl });
585
- } else {
586
- if (s.display == 'top') {
587
- t = st;
588
- } else if (s.display == 'bottom') {
589
- t = st + nh - mh;
590
- }
591
- }
592
-
593
- css.top = t < 0 ? 0 : t;
594
- css.left = l;
595
- d.css(css);
596
-
597
- // If top + modal height > doc height, increase doc height
598
- persp.height(0);
599
- dh = Math.max(t + mh, s.context == 'body' ? $(document).height() : doc.scrollHeight);
600
- persp.css({ height: dh, left: sl });
601
-
602
- // Scroll needed
603
- if (scroll && ((t + mh > st + nh) || (at > st + nh))) {
604
- preventPos = true;
605
- setTimeout(function () { preventPos = false; }, 300);
606
- wndw.scrollTop(Math.min(t + mh - nh, dh - nh));
607
- }
608
- }
609
-
610
- ww = nw;
611
- wh = nh;
612
- };
613
-
614
- /**
615
- * Enables the scroller and the associated input.
616
- */
617
- that.enable = function () {
618
- s.disabled = false;
619
- if (input) {
620
- elm.prop('disabled', false);
621
- }
622
- };
623
-
624
- /**
625
- * Disables the scroller and the associated input.
626
- */
627
- that.disable = function () {
628
- s.disabled = true;
629
- if (input) {
630
- elm.prop('disabled', true);
631
- }
632
- };
633
-
634
- /**
635
- * Gets the selected wheel values, formats it, and set the value of the scroller instance.
636
- * If input parameter is true, populates the associated input element.
637
- * @param {Array} values Wheel values.
638
- * @param {Boolean} [fill=false] Also set the value of the associated input element.
639
- * @param {Number} [time=0] Animation time
640
- * @param {Boolean} [temp=false] If true, then only set the temporary value.(only scroll there but not set the value)
641
- */
642
- that.setValue = function (values, fill, time, temp, change) {
643
- that.temp = $.isArray(values) ? values.slice(0) : s.parseValue.call(e, values + '', that);
644
- setVal(fill, change === undefined ? fill : change, time, false, temp, fill);
645
- };
646
-
647
- /**
648
- * Return the selected wheel values.
649
- */
650
- that.getValue = function () {
651
- return that.values;
652
- };
653
-
654
- /**
655
- * Return selected values, if in multiselect mode.
656
- */
657
- that.getValues = function () {
658
- var ret = [],
659
- i;
660
-
661
- for (i in that._selectedValues) {
662
- ret.push(that._selectedValues[i]);
663
- }
664
- return ret;
665
- };
666
-
667
- /**
668
- * Changes the values of a wheel, and scrolls to the correct position
669
- * @param {Array} idx Indexes of the wheels to change.
670
- * @param {Number} [time=0] Animation time when scrolling to the selected value on the new wheel.
671
- * @param {Boolean} [manual=false] Indicates that the change was triggered by the user or from code.
672
- */
673
- that.changeWheel = function (idx, time, manual) {
674
- if (dw) {
675
- var i = 0,
676
- nr = idx.length;
677
-
678
- $.each(s.wheels, function (j, wg) {
679
- $.each(wg, function (k, w) {
680
- if ($.inArray(i, idx) > -1) {
681
- wheels[i] = w;
682
- $('.dw-ul', dw).eq(i).html(generateWheelItems(i));
683
- nr--;
684
- if (!nr) {
685
- that.position();
686
- scrollToPos(time, undefined, manual);
687
- return false;
688
- }
689
- }
690
- i++;
691
- });
692
- if (!nr) {
693
- return false;
694
- }
695
- });
696
- }
697
- };
698
-
699
- /**
700
- * Return true if the scroller is currently visible.
701
- */
702
- that.isVisible = function () {
703
- return visible;
704
- };
705
-
706
- /**
707
- * Attach tap event to the given element.
708
- */
709
- that.tap = function (el, handler) {
710
- var startX,
711
- startY;
712
-
713
- if (s.tap) {
714
- el.on('touchstart.dw mousedown.dw', function (e) {
715
- e.preventDefault();
716
- startX = getCoord(e, 'X');
717
- startY = getCoord(e, 'Y');
718
- }).on('touchend.dw', function (e) {
719
- // If movement is less than 20px, fire the click event handler
720
- if (Math.abs(getCoord(e, 'X') - startX) < 20 && Math.abs(getCoord(e, 'Y') - startY) < 20) {
721
- handler.call(this, e);
722
- }
723
- setTap();
724
- });
725
- }
726
-
727
- el.on('click.dw', function (e) {
728
- if (!tap) {
729
- // If handler was not called on touchend, call it on click;
730
- handler.call(this, e);
731
- }
732
- e.preventDefault();
733
- });
734
-
735
- };
736
-
737
- /**
738
- * Shows the scroller instance.
739
- * @param {Boolean} prevAnim - Prevent animation if true
740
- */
741
- that.show = function (prevAnim) {
742
- // Create wheels
743
- var lbl,
744
- l = 0,
745
- mAnim = '';
746
-
747
- if (s.disabled || visible) {
748
- return;
749
- }
750
-
751
- // MODIFIED BY SAP: save active element with API calls too
752
- activeElm = elm;
753
-
754
- if (s.display == 'top') {
755
- anim = 'slidedown';
756
- }
757
-
758
- if (s.display == 'bottom') {
759
- anim = 'slideup';
760
- }
761
-
762
- // Parse value from input
763
- read();
764
-
765
- event('onBeforeShow', []);
766
-
767
- if (anim && !prevAnim) {
768
- mAnim = 'dw-' + anim + ' dw-in';
769
- }
770
-
771
- // Create wheels containers
772
- var html = '<div role="dialog" class="' + s.theme + ' dw-' + s.display + (prefix ? ' dw' + prefix.replace(/\-$/, '') : '') + (hasButtons ? '' : ' dw-nobtn') + '"><div class="dw-persp">' + (!modal ? '<div class="dw dwbg dwi">' : '<div class="dwo"></div><div class="dw dwbg ' + mAnim + '"><div class="dw-arrw"><div class="dw-arrw-i"><div class="dw-arr"></div></div></div>') + '<div class="dwwr"><div aria-live="assertive" class="dwv' + (s.headerText ? '' : ' dw-hidden') + '"></div><div class="dwcc">',
773
- isMinw = $.isArray(s.minWidth),
774
- isMaxw = $.isArray(s.maxWidth),
775
- isFixw = $.isArray(s.fixedWidth);
776
-
777
- $.each(s.wheels, function (i, wg) { // Wheel groups
778
- html += '<div class="dwc' + (s.mode != 'scroller' ? ' dwpm' : ' dwsc') + (s.showLabel ? '' : ' dwhl') + '"><div class="dwwc dwrc"><table cellpadding="0" cellspacing="0"><tr>';
779
- $.each(wg, function (j, w) { // Wheels
780
- wheels[l] = w;
781
- lbl = w.label !== undefined ? w.label : j;
782
- html += '<td><div class="dwwl dwrc dwwl' + l + '">' + (s.mode != 'scroller' ? '<a href="#" tabindex="-1" class="dwb-e dwwb dwwbp" style="height:' + hi + 'px;line-height:' + hi + 'px;"><span>+</span></a><a href="#" tabindex="-1" class="dwb-e dwwb dwwbm" style="height:' + hi + 'px;line-height:' + hi + 'px;"><span>&ndash;</span></a>' : '') + '<div class="dwl">' + lbl + '</div><div tabindex="0" aria-live="off" aria-label="' + lbl + '" role="listbox" class="dwww"><div class="dww" style="height:' + (s.rows * hi) + 'px;' + (s.fixedWidth ? ('width:' + (isFixw ? s.fixedWidth[l] : s.fixedWidth) + 'px;') : (s.minWidth ? ('min-width:' + (isMinw ? s.minWidth[l] : s.minWidth) + 'px;') : 'min-width:' + s.width + 'px;') + (s.maxWidth ? ('max-width:' + (isMaxw ? s.maxWidth[l] : s.maxWidth) + 'px;') : '')) + '"><div class="dw-ul">';
783
- // Create wheel values
784
- html += generateWheelItems(l);
785
- html += '</div><div class="dwwol"></div></div><div class="dwwo"></div></div><div class="dwwol"></div></div></td>';
786
- l++;
787
- });
788
-
789
-
790
- html += '</tr></table></div></div>';
791
- });
792
-
793
- html += '</div>';
794
-
795
- if (modal && hasButtons) {
796
- html += '<div class="dwbc">';
797
- $.each(buttons, function (i, b) {
798
- b = (typeof b === 'string') ? that.buttons[b] : b;
799
- html += '<span' + (s.btnWidth ? ' style="width:' + (100 / buttons.length) + '%"' : '') + ' class="dwbw ' + b.css + '"><a href="#" class="dwb dwb' + i + ' dwb-e" role="button">' + b.text + '</a></span>';
800
- });
801
- html += '</div>';
802
- }
803
- html += '</div></div></div></div>';
804
-
805
- dw = $(html);
806
- persp = $('.dw-persp', dw);
807
- overlay = $('.dwo', dw);
808
-
809
- visible = true;
810
-
811
- scrollToPos();
812
-
813
- event('onMarkupReady', [dw]);
814
-
815
- // Show
816
- if (modal) {
817
-
818
- dw.appendTo(s.context);
819
- if (anim && !prevAnim) {
820
- dw.addClass('dw-trans');
821
- // Remove animation class
822
- setTimeout(function () {
823
- dw.removeClass('dw-trans').find('.dw').removeClass(mAnim);
824
- }, 350);
825
- }
826
- } else if (elm.is('div')) {
827
- elm.html(dw);
828
- } else {
829
- dw.insertAfter(elm);
830
- }
831
-
832
- event('onMarkupInserted', [dw]);
833
-
834
- if (modal) {
835
- // Enter / ESC
836
- $(window).on('keydown.dw', function (e) {
837
- if (e.keyCode == 13) {
838
- that.select();
839
- } else if (e.keyCode == 27) {
840
- that.cancel();
841
- }
842
- });
843
-
844
- // Prevent scroll if not specified otherwise
845
- if (s.scrollLock) {
846
- dw.on('touchmove', function (e) {
847
- if (lock) {
848
- e.preventDefault();
849
- }
850
- });
851
- }
852
-
853
- // Disable inputs to prevent bleed through (Android bug) and set autocomplete to off (for Firefox)
854
- $('input,select,button', doc).each(function () {
855
- if (!this.disabled) {
856
- if ($(this).attr('autocomplete')) {
857
- $(this).data('autocomplete', $(this).attr('autocomplete'));
858
- }
859
- $(this).addClass('dwtd').prop('disabled', true).attr('autocomplete', 'off');
860
- }
861
- });
862
-
863
- attachPosition('scroll.dw', true);
864
- }
865
-
866
- // Set position
867
- that.position();
868
- attachPosition('orientationchange.dw resize.dw', false);
869
-
870
- // Events
871
- dw.on('DOMMouseScroll mousewheel', '.dwwl', onScroll)
872
- .on('keydown', '.dwwl', onKeyDown)
873
- .on('keyup', '.dwwl', onKeyUp)
874
- .on('selectstart mousedown', prevdef) // Prevents blue highlight on Android and text selection in IE
875
- .on('click', '.dwb-e', prevdef)
876
- .on('touchend', function () { if (s.tap) { setTap(); } })
877
- .on('keydown', '.dwb-e', function (e) {
878
- if (e.keyCode == 32) { // Space
879
- e.preventDefault();
880
- e.stopPropagation();
881
- $(this).click();
882
- }
883
- });
884
-
885
- setTimeout(function () {
886
- // Init buttons
887
- $.each(buttons, function (i, b) {
888
- that.tap($('.dwb' + i, dw), function (e) {
889
- b = (typeof b === 'string') ? that.buttons[b] : b;
890
- b.handler.call(this, e, that);
891
- });
892
- });
893
-
894
- if (s.closeOnOverlay) {
895
- that.tap(overlay, function () {
896
- that.cancel();
897
- });
898
- }
899
-
900
- dw.on(START_EVENT, '.dwwl', onStart).on(START_EVENT, '.dwb-e', onBtnStart);
901
-
902
- }, 300);
903
-
904
- event('onShow', [dw, v]);
905
- };
906
-
907
- /**
908
- * Hides the scroller instance.
909
- */
910
- that.hide = function (prevAnim, btn, force) {
911
- // If onClose handler returns false, prevent hide
912
- if (!visible || (!force && event('onClose', [v, btn]) === false)) {
913
- return;
914
- }
915
-
916
- // Re-enable temporary disabled fields
917
- $('.dwtd', doc).each(function () {
918
- $(this).prop('disabled', false).removeClass('dwtd');
919
- if ($(this).data('autocomplete')) {
920
- $(this).attr('autocomplete', $(this).data('autocomplete'));
921
- } else {
922
- $(this).removeAttr('autocomplete');
923
- }
924
- });
925
-
926
- // Hide wheels and overlay
927
- if (dw) {
928
- var doAnim = modal && anim && !prevAnim;
929
- if (doAnim) {
930
- dw.addClass('dw-trans').find('.dw').addClass('dw-' + anim + ' dw-out');
931
- }
932
- if (prevAnim) {
933
- dw.remove();
934
- } else {
935
- setTimeout(function () {
936
- dw.remove();
937
- if (activeElm) {
938
- preventShow = true;
939
- activeElm.focus();
940
- }
941
- }, doAnim ? 350 : 1);
942
- }
943
-
944
- // Stop positioning on window resize
945
- wndw.off('.dw');
946
- }
947
-
948
- pixels = {};
949
- visible = false;
950
- };
951
-
952
- /**
953
- * Set button handler.
954
- */
955
- that.select = function () {
956
- if (that.hide(false, 'set') !== false) {
957
- setVal(true, true, 0, true);
958
- event('onSelect', [that.val]);
959
- }
960
- };
961
-
962
- /**
963
- * Show mobiscroll on focus and click event of the parameter.
964
- * @param {jQuery} elm - Events will be attached to this element.
965
- * @param {Function} [beforeShow=undefined] - Optional function to execute before showing mobiscroll.
966
- */
967
- that.attachShow = function (elm, beforeShow) {
968
- elmList.push(elm);
969
- if (s.display !== 'inline') {
970
- elm.on((s.showOnFocus ? 'focus.dw' : '') + (s.showOnTap ? ' click.dw' : ''), function (ev) {
971
- if ((ev.type !== 'focus' || (ev.type === 'focus' && !preventShow)) && !tap) {
972
- if (beforeShow) {
973
- beforeShow();
974
- }
975
- activeElm = elm;
976
- that.show();
977
- }
978
- setTimeout(function () {
979
- preventShow = false;
980
- }, 300); // With jQuery < 1.9 focus is fired twice in IE
981
- });
982
- }
983
- };
984
-
985
- /**
986
- * Cancel and hide the scroller instance.
987
- */
988
- that.cancel = function () {
989
- if (that.hide(false, 'cancel') !== false) {
990
- event('onCancel', [that.val]);
991
- }
992
- };
993
-
994
- /**
995
- * Scroller initialization.
996
- */
997
- that.init = function (ss) {
998
- // Get theme defaults
999
- theme = ms.themes[ss.theme || s.theme];
1000
-
1001
- // Get language defaults
1002
- lang = ms.i18n[ss.lang || s.lang];
1003
-
1004
- extend(settings, ss); // Update original user settings
1005
-
1006
- event('onThemeLoad', [lang, settings]);
1007
-
1008
- extend(s, theme, lang, settings);
1009
-
1010
- // Add default buttons
1011
- s.buttons = s.buttons || ['set', 'cancel'];
1012
-
1013
- // Hide header text in inline mode by default
1014
- s.headerText = s.headerText === undefined ? (s.display !== 'inline' ? '{value}' : false) : s.headerText;
1015
-
1016
- that.settings = s;
1017
-
1018
- // Unbind all events (if re-init)
1019
- elm.off('.dw');
1020
-
1021
- var preset = ms.presets[s.preset];
1022
-
1023
- if (preset) {
1024
- pres = preset.call(e, that);
1025
- extend(s, pres, settings); // Load preset settings
1026
- }
1027
-
1028
- // Set private members
1029
- m = Math.floor(s.rows / 2);
1030
- hi = s.height;
1031
- anim = s.animate;
1032
- modal = s.display !== 'inline';
1033
- buttons = s.buttons;
1034
- wndw = $(s.context == 'body' ? window : s.context);
1035
- doc = $(s.context)[0];
1036
-
1037
- if (!s.setText) {
1038
- buttons.splice($.inArray('set', buttons), 1);
1039
- }
1040
- if (!s.cancelText) {
1041
- buttons.splice($.inArray('cancel', buttons), 1);
1042
- }
1043
- if (s.button3) {
1044
- buttons.splice($.inArray('set', buttons) + 1, 0, { text: s.button3Text, handler: s.button3 });
1045
- }
1046
-
1047
- that.context = wndw;
1048
- that.live = !modal || ($.inArray('set', buttons) == -1);
1049
- that.buttons.set = { text: s.setText, css: 'dwb-s', handler: that.select };
1050
- that.buttons.cancel = { text: (that.live) ? s.closeText : s.cancelText, css: 'dwb-c', handler: that.cancel };
1051
- that.buttons.clear = { text: s.clearText, css: 'dwb-cl', handler: function () {
1052
- that.trigger('onClear', [dw]);
1053
- elm.val('');
1054
- if (!that.live) {
1055
- that.hide();
1056
- }
1057
- }};
1058
-
1059
- hasButtons = buttons.length > 0;
1060
-
1061
- if (visible) {
1062
- that.hide(true, false, true);
1063
- }
1064
-
1065
- if (modal) {
1066
- read();
1067
- if (input) {
1068
- // Set element readonly, save original state
1069
- if (readOnly === undefined) {
1070
- readOnly = e.readOnly;
1071
- }
1072
- e.readOnly = true;
1073
- }
1074
- that.attachShow(elm);
1075
- } else {
1076
- that.show();
1077
- }
1078
-
1079
- if (input) {
1080
- elm.on('change.dw', function () {
1081
- if (!preventChange) {
1082
- that.setValue(elm.val(), false, 0.2);
1083
- }
1084
- preventChange = false;
1085
- });
1086
- }
1087
- };
1088
-
1089
- /**
1090
- * Sets one ore more options.
1091
- */
1092
- that.option = function (opt, value) {
1093
- var obj = {};
1094
- if (typeof opt === 'object') {
1095
- obj = opt;
1096
- } else {
1097
- obj[opt] = value;
1098
- }
1099
- that.init(obj);
1100
- };
1101
-
1102
- /**
1103
- * Destroys the mobiscroll instance.
1104
- */
1105
- that.destroy = function () {
1106
- that.hide(true, false, true);
1107
- // Remove all events from elements
1108
- $.each(elmList, function (i, v) {
1109
- v.off('.dw');
1110
- });
1111
- // Remove events from window
1112
- $(window).off('.dwa');
1113
- // Reset original readonly state
1114
- if (input) {
1115
- e.readOnly = readOnly;
1116
- }
1117
- // Delete scroller instance
1118
- delete instances[e.id];
1119
- event('onDestroy', []);
1120
- };
1121
-
1122
- /**
1123
- * Returns the mobiscroll instance.
1124
- */
1125
- that.getInst = function () {
1126
- return that;
1127
- };
1128
-
1129
- /**
1130
- * Returns the closest valid cell.
1131
- */
1132
- that.getValidCell = getValid;
1133
-
1134
- /**
1135
- * Triggers a mobiscroll event.
1136
- */
1137
- that.trigger = event;
1138
-
1139
- instances[e.id] = that;
1140
-
1141
- that.values = null;
1142
- that.val = null;
1143
- that.temp = null;
1144
- that.buttons = {};
1145
- that._selectedValues = {};
1146
-
1147
- that.init(settings);
1148
- }
1149
-
1150
- function setTap() {
1151
- tap = true;
1152
- setTimeout(function () {
1153
- tap = false;
1154
- }, 300);
1155
- }
1156
-
1157
- function constrain(val, min, max) {
1158
- return Math.max(min, Math.min(val, max));
1159
- }
1160
-
1161
- function convert(w) {
1162
- var ret = {
1163
- values: [],
1164
- keys: []
1165
- };
1166
- $.each(w, function (k, v) {
1167
- ret.keys.push(k);
1168
- ret.values.push(v);
1169
- });
1170
- return ret;
1171
- }
1172
-
1173
- var activeElm,
1174
- move,
1175
- tap,
1176
- preventShow,
1177
- ms = $.mobiscroll,
1178
- instances = ms.instances,
1179
- util = ms.util,
1180
- prefix = util.prefix,
1181
- pr = util.jsPrefix,
1182
- has3d = util.has3d,
1183
- getCoord = util.getCoord,
1184
- testTouch = util.testTouch,
1185
- empty = function () {},
1186
- prevdef = function (e) { e.preventDefault(); },
1187
- extend = $.extend,
1188
- START_EVENT = 'touchstart mousedown',
1189
- MOVE_EVENT = 'touchmove mousemove',
1190
- END_EVENT = 'touchend mouseup',
1191
- defaults = extend(ms.defaults, {
1192
- // Options
1193
- width: 70,
1194
- height: 40,
1195
- rows: 3,
1196
- delay: 300,
1197
- disabled: false,
1198
- readonly: false,
1199
- closeOnOverlay: true,
1200
- showOnFocus: true,
1201
- showOnTap: true,
1202
- showLabel: true,
1203
- wheels: [],
1204
- theme: '',
1205
- display: 'modal',
1206
- mode: 'scroller',
1207
- preset: '',
1208
- lang: 'en-US',
1209
- context: 'body',
1210
- scrollLock: true,
1211
- tap: true,
1212
- btnWidth: true,
1213
- speedUnit: 0.0012,
1214
- timeUnit: 0.1,
1215
- formatResult: function (d) {
1216
- return d.join(' ');
1217
- },
1218
- parseValue: function (value, inst) {
1219
- var val = value.split(' '),
1220
- ret = [],
1221
- i = 0,
1222
- keys;
1223
-
1224
- $.each(inst.settings.wheels, function (j, wg) {
1225
- $.each(wg, function (k, w) {
1226
- w = w.values ? w : convert(w);
1227
- keys = w.keys || w.values;
1228
- if ($.inArray(val[i], keys) !== -1) {
1229
- ret.push(val[i]);
1230
- } else {
1231
- ret.push(keys[0]);
1232
- }
1233
- i++;
1234
- });
1235
- });
1236
- return ret;
1237
- }
1238
- });
1239
-
1240
- // English language module
1241
- ms.i18n.en = ms.i18n['en-US'] = {
1242
- setText: 'Set',
1243
- selectedText: 'Selected',
1244
- closeText: 'Close',
1245
- cancelText: 'Cancel',
1246
- clearText: 'Clear'
1247
- };
1248
-
1249
- // Prevent re-show on window focus
1250
- $(window).on('focus', function () {
1251
- if (activeElm) {
1252
- preventShow = true;
1253
- }
1254
- });
1255
-
1256
- $(document).on('mouseover mouseup mousedown click', function (e) { // Prevent standard behaviour on body click
1257
- if (tap) {
1258
- e.stopPropagation();
1259
- e.preventDefault();
1260
- return false;
1261
- }
1262
- });
1263
-
1264
- })(jQuery);