@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,1104 +0,0 @@
1
- /*!
2
- * iScroll v4.2.5 ~ Copyright (c) 2012 Matteo Spinelli, http://cubiq.org
3
- * Released under MIT license, http://cubiq.org/license
4
- */
5
- (function(window, doc){
6
- var m = Math,
7
- dummyStyle = doc.createElement('div').style,
8
- vendor = (function () {
9
- var vendors = 't,webkitT,MozT,msT,OT'.split(','),
10
- t,
11
- i = 0,
12
- l = vendors.length;
13
-
14
- for ( ; i < l; i++ ) {
15
- t = vendors[i] + 'ransform';
16
- if ( t in dummyStyle ) {
17
- return vendors[i].substr(0, vendors[i].length - 1);
18
- }
19
- }
20
-
21
- return false;
22
- })(),
23
- cssVendor = vendor ? '-' + vendor.toLowerCase() + '-' : '',
24
-
25
- // Style properties
26
- transform = prefixStyle('transform'),
27
- transitionProperty = prefixStyle('transitionProperty'),
28
- transitionDuration = prefixStyle('transitionDuration'),
29
- transformOrigin = prefixStyle('transformOrigin'),
30
- transitionTimingFunction = prefixStyle('transitionTimingFunction'),
31
- transitionDelay = prefixStyle('transitionDelay'),
32
-
33
- // Browser capabilities
34
- isAndroid = (/android/gi).test(navigator.appVersion),
35
- isIDevice = (/iphone|ipad/gi).test(navigator.appVersion),
36
- isTouchPad = (/hp-tablet/gi).test(navigator.appVersion),
37
-
38
- has3d = prefixStyle('perspective') in dummyStyle,
39
- hasTouch = 'ontouchstart' in window && !isTouchPad,
40
- hasTransform = vendor !== false,
41
- hasTransitionEnd = prefixStyle('transition') in dummyStyle,
42
-
43
- RESIZE_EV = 'onorientationchange' in window ? 'orientationchange' : 'resize',
44
- START_EV = hasTouch ? 'touchstart' : 'mousedown',
45
- MOVE_EV = hasTouch ? 'touchmove' : 'mousemove',
46
- END_EV = hasTouch ? 'touchend' : 'mouseup',
47
- CANCEL_EV = hasTouch ? 'touchcancel' : 'mouseup',
48
- TRNEND_EV = (function () {
49
- if ( vendor === false ) return false;
50
-
51
- var transitionEnd = {
52
- '' : 'transitionend',
53
- 'webkit' : 'webkitTransitionEnd',
54
- 'Moz' : 'transitionend',
55
- 'O' : 'otransitionend',
56
- 'ms' : 'MSTransitionEnd'
57
- };
58
-
59
- return transitionEnd[vendor];
60
- })(),
61
-
62
- nextFrame = (function() {
63
- return window.requestAnimationFrame ||
64
- window.webkitRequestAnimationFrame ||
65
- window.mozRequestAnimationFrame ||
66
- window.oRequestAnimationFrame ||
67
- window.msRequestAnimationFrame ||
68
- function(callback) { return setTimeout(callback, 1); };
69
- })(),
70
- cancelFrame = (function () {
71
- return window.cancelRequestAnimationFrame ||
72
- window.webkitCancelAnimationFrame ||
73
- window.webkitCancelRequestAnimationFrame ||
74
- window.mozCancelRequestAnimationFrame ||
75
- window.oCancelRequestAnimationFrame ||
76
- window.msCancelRequestAnimationFrame ||
77
- clearTimeout;
78
- })(),
79
-
80
- // Helpers
81
- translateZ = has3d ? ' translateZ(0)' : '',
82
-
83
- // Constructor
84
- iScroll = function (el, options) {
85
- var that = this,
86
- i;
87
-
88
- that.wrapper = typeof el == 'object' ? el : doc.getElementById(el);
89
- that.wrapper.style.overflow = 'hidden';
90
- that.scroller = that.wrapper.children[0];
91
-
92
- // Default options
93
- that.options = {
94
- hScroll: true,
95
- vScroll: true,
96
- x: 0,
97
- y: 0,
98
- bounce: true,
99
- bounceLock: false,
100
- momentum: true,
101
- lockDirection: true,
102
- useTransform: true,
103
- useTransition: false,
104
- topOffset: 0,
105
- checkDOMChanges: false, // Experimental
106
- handleClick: true,
107
-
108
- // Scrollbar
109
- hScrollbar: true,
110
- vScrollbar: true,
111
- fixedScrollbar: isAndroid,
112
- hideScrollbar: isIDevice,
113
- fadeScrollbar: isIDevice && has3d,
114
- scrollbarClass: '',
115
-
116
- // Zoom
117
- zoom: false,
118
- zoomMin: 1,
119
- zoomMax: 4,
120
- doubleTapZoom: 2,
121
- wheelAction: 'scroll',
122
-
123
- // Snap
124
- snap: false,
125
- snapThreshold: 1,
126
-
127
- // Events
128
- onRefresh: null,
129
- onBeforeScrollStart: function (e) { e.preventDefault(); },
130
- onScrollStart: null,
131
- onBeforeScrollMove: null,
132
- onScrollMove: null,
133
- onBeforeScrollEnd: null,
134
- onScrollEnd: null,
135
- onTouchEnd: null,
136
- onDestroy: null,
137
- onZoomStart: null,
138
- onZoom: null,
139
- onZoomEnd: null
140
- };
141
-
142
- // User defined options
143
- for (i in options) that.options[i] = options[i];
144
-
145
- // Set starting position
146
- that.x = that.options.x;
147
- that.y = that.options.y;
148
-
149
- // Normalize options
150
- that.options.useTransform = hasTransform && that.options.useTransform;
151
- that.options.hScrollbar = that.options.hScroll && that.options.hScrollbar;
152
- that.options.vScrollbar = that.options.vScroll && that.options.vScrollbar;
153
- that.options.zoom = that.options.useTransform && that.options.zoom;
154
- that.options.useTransition = hasTransitionEnd && that.options.useTransition;
155
-
156
- // Helpers FIX ANDROID BUG!
157
- // translate3d and scale doesn't work together!
158
- // Ignoring 3d ONLY WHEN YOU SET that.options.zoom
159
- if ( that.options.zoom && isAndroid ){
160
- translateZ = '';
161
- }
162
-
163
- // Set some default styles
164
- that.scroller.style[transitionProperty] = that.options.useTransform ? cssVendor + 'transform' : 'top left';
165
- that.scroller.style[transitionDuration] = '0';
166
- that.scroller.style[transformOrigin] = '0 0';
167
- if (that.options.useTransition) that.scroller.style[transitionTimingFunction] = 'cubic-bezier(0.33,0.66,0.66,1)';
168
-
169
- if (that.options.useTransform) that.scroller.style[transform] = 'translate(' + that.x + 'px,' + that.y + 'px)' + translateZ;
170
- else that.scroller.style.cssText += ';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px';
171
-
172
- if (that.options.useTransition) that.options.fixedScrollbar = true;
173
-
174
- that.refresh();
175
-
176
- that._bind(RESIZE_EV, window);
177
- that._bind(START_EV);
178
- if (!hasTouch) {
179
- if (that.options.wheelAction != 'none') {
180
- that._bind('DOMMouseScroll');
181
- that._bind('mousewheel');
182
- }
183
- }
184
-
185
- if (that.options.checkDOMChanges) that.checkDOMTime = setInterval(function () {
186
- that._checkDOMChanges();
187
- }, 500);
188
- };
189
-
190
- // Prototype
191
- iScroll.prototype = {
192
- enabled: true,
193
- x: 0,
194
- y: 0,
195
- steps: [],
196
- scale: 1,
197
- currPageX: 0, currPageY: 0,
198
- pagesX: [], pagesY: [],
199
- aniTime: null,
200
- wheelZoomCount: 0,
201
-
202
- handleEvent: function (e) {
203
- var that = this;
204
- switch(e.type) {
205
- case START_EV:
206
- if (!hasTouch && e.button !== 0) return;
207
- that._start(e);
208
- break;
209
- case MOVE_EV: that._move(e); break;
210
- case END_EV:
211
- case CANCEL_EV: that._end(e); break;
212
- case RESIZE_EV: that._resize(); break;
213
- case 'DOMMouseScroll': case 'mousewheel': that._wheel(e); break;
214
- case TRNEND_EV: that._transitionEnd(e); break;
215
- }
216
- },
217
-
218
- _checkDOMChanges: function () {
219
- if (this.moved || this.zoomed || this.animating ||
220
- (this.scrollerW == this.scroller.offsetWidth * this.scale && this.scrollerH == this.scroller.offsetHeight * this.scale)) return;
221
-
222
- this.refresh();
223
- },
224
-
225
- _scrollbar: function (dir) {
226
- var that = this,
227
- bar;
228
-
229
- if (!that[dir + 'Scrollbar']) {
230
- if (that[dir + 'ScrollbarWrapper']) {
231
- if (hasTransform) that[dir + 'ScrollbarIndicator'].style[transform] = '';
232
- that[dir + 'ScrollbarWrapper'].parentNode.removeChild(that[dir + 'ScrollbarWrapper']);
233
- that[dir + 'ScrollbarWrapper'] = null;
234
- that[dir + 'ScrollbarIndicator'] = null;
235
- }
236
-
237
- return;
238
- }
239
-
240
- if (!that[dir + 'ScrollbarWrapper']) {
241
- // Create the scrollbar wrapper
242
- bar = doc.createElement('div');
243
-
244
- if (that.options.scrollbarClass) bar.className = that.options.scrollbarClass + dir.toUpperCase();
245
- else bar.style.cssText = 'position:absolute;z-index:100;' + (dir == 'h' ? 'height:7px;bottom:1px;left:2px;right:' + (that.vScrollbar ? '7' : '2') + 'px' : 'width:7px;bottom:' + (that.hScrollbar ? '7' : '2') + 'px;top:2px;right:1px');
246
-
247
- bar.style.cssText += ';pointer-events:none;' + cssVendor + 'transition-property:opacity;' + cssVendor + 'transition-duration:' + (that.options.fadeScrollbar ? '350ms' : '0') + ';overflow:hidden;opacity:' + (that.options.hideScrollbar ? '0' : '1');
248
-
249
- that.wrapper.appendChild(bar);
250
- that[dir + 'ScrollbarWrapper'] = bar;
251
-
252
- // Create the scrollbar indicator
253
- bar = doc.createElement('div');
254
- if (!that.options.scrollbarClass) {
255
- bar.style.cssText = 'position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);' + cssVendor + 'background-clip:padding-box;' + cssVendor + 'box-sizing:border-box;' + (dir == 'h' ? 'height:100%' : 'width:100%') + ';' + cssVendor + 'border-radius:3px;border-radius:3px';
256
- }
257
- bar.style.cssText += ';pointer-events:none;' + cssVendor + 'transition-property:' + cssVendor + 'transform;' + cssVendor + 'transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);' + cssVendor + 'transition-duration:0;' + cssVendor + 'transform: translate(0,0)' + translateZ;
258
- if (that.options.useTransition) bar.style.cssText += ';' + cssVendor + 'transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)';
259
-
260
- that[dir + 'ScrollbarWrapper'].appendChild(bar);
261
- that[dir + 'ScrollbarIndicator'] = bar;
262
- }
263
-
264
- if (dir == 'h') {
265
- that.hScrollbarSize = that.hScrollbarWrapper.clientWidth;
266
- that.hScrollbarIndicatorSize = m.max(m.round(that.hScrollbarSize * that.hScrollbarSize / that.scrollerW), 8);
267
- that.hScrollbarIndicator.style.width = that.hScrollbarIndicatorSize + 'px';
268
- that.hScrollbarMaxScroll = that.hScrollbarSize - that.hScrollbarIndicatorSize;
269
- that.hScrollbarProp = that.hScrollbarMaxScroll / that.maxScrollX;
270
- } else {
271
- that.vScrollbarSize = that.vScrollbarWrapper.clientHeight;
272
- that.vScrollbarIndicatorSize = m.max(m.round(that.vScrollbarSize * that.vScrollbarSize / that.scrollerH), 8);
273
- that.vScrollbarIndicator.style.height = that.vScrollbarIndicatorSize + 'px';
274
- that.vScrollbarMaxScroll = that.vScrollbarSize - that.vScrollbarIndicatorSize;
275
- that.vScrollbarProp = that.vScrollbarMaxScroll / that.maxScrollY;
276
- }
277
-
278
- // Reset position
279
- that._scrollbarPos(dir, true);
280
- },
281
-
282
- _resize: function () {
283
- var that = this;
284
- setTimeout(function () { that.refresh(); }, isAndroid ? 200 : 0);
285
- },
286
-
287
- _pos: function (x, y) {
288
- if (this.zoomed) return;
289
-
290
- x = this.hScroll ? x : 0;
291
- y = this.vScroll ? y : 0;
292
-
293
- if (this.options.useTransform) {
294
- this.scroller.style[transform] = 'translate(' + x + 'px,' + y + 'px) scale(' + this.scale + ')' + translateZ;
295
- } else {
296
- x = m.round(x);
297
- y = m.round(y);
298
- this.scroller.style.left = x + 'px';
299
- this.scroller.style.top = y + 'px';
300
- }
301
-
302
- this.x = x;
303
- this.y = y;
304
-
305
- this._scrollbarPos('h');
306
- this._scrollbarPos('v');
307
- },
308
-
309
- _scrollbarPos: function (dir, hidden) {
310
- var that = this,
311
- pos = dir == 'h' ? that.x : that.y,
312
- size;
313
-
314
- if (!that[dir + 'Scrollbar']) return;
315
-
316
- pos = that[dir + 'ScrollbarProp'] * pos;
317
-
318
- if (pos < 0) {
319
- if (!that.options.fixedScrollbar) {
320
- size = that[dir + 'ScrollbarIndicatorSize'] + m.round(pos * 3);
321
- if (size < 8) size = 8;
322
- that[dir + 'ScrollbarIndicator'].style[dir == 'h' ? 'width' : 'height'] = size + 'px';
323
- }
324
- pos = 0;
325
- } else if (pos > that[dir + 'ScrollbarMaxScroll']) {
326
- if (!that.options.fixedScrollbar) {
327
- size = that[dir + 'ScrollbarIndicatorSize'] - m.round((pos - that[dir + 'ScrollbarMaxScroll']) * 3);
328
- if (size < 8) size = 8;
329
- that[dir + 'ScrollbarIndicator'].style[dir == 'h' ? 'width' : 'height'] = size + 'px';
330
- pos = that[dir + 'ScrollbarMaxScroll'] + (that[dir + 'ScrollbarIndicatorSize'] - size);
331
- } else {
332
- pos = that[dir + 'ScrollbarMaxScroll'];
333
- }
334
- }
335
-
336
- that[dir + 'ScrollbarWrapper'].style[transitionDelay] = '0';
337
- that[dir + 'ScrollbarWrapper'].style.opacity = hidden && that.options.hideScrollbar ? '0' : '1';
338
- that[dir + 'ScrollbarIndicator'].style[transform] = 'translate(' + (dir == 'h' ? pos + 'px,0)' : '0,' + pos + 'px)') + translateZ;
339
- },
340
-
341
- _start: function (e) {
342
- var that = this,
343
- point = hasTouch ? e.touches[0] : e,
344
- matrix, x, y,
345
- c1, c2;
346
-
347
- if (!that.enabled) return;
348
-
349
- if (that.options.onBeforeScrollStart) that.options.onBeforeScrollStart.call(that, e);
350
-
351
- if (that.options.useTransition || that.options.zoom) that._transitionTime(0);
352
-
353
- that.moved = false;
354
- that.animating = false;
355
- that.zoomed = false;
356
- that.distX = 0;
357
- that.distY = 0;
358
- that.absDistX = 0;
359
- that.absDistY = 0;
360
- that.dirX = 0;
361
- that.dirY = 0;
362
-
363
- // Gesture start
364
- if (that.options.zoom && hasTouch && e.touches.length > 1) {
365
- c1 = m.abs(e.touches[0].pageX-e.touches[1].pageX);
366
- c2 = m.abs(e.touches[0].pageY-e.touches[1].pageY);
367
- that.touchesDistStart = m.sqrt(c1 * c1 + c2 * c2);
368
-
369
- that.originX = m.abs(e.touches[0].pageX + e.touches[1].pageX - that.wrapperOffsetLeft * 2) / 2 - that.x;
370
- that.originY = m.abs(e.touches[0].pageY + e.touches[1].pageY - that.wrapperOffsetTop * 2) / 2 - that.y;
371
-
372
- if (that.options.onZoomStart) that.options.onZoomStart.call(that, e);
373
- }
374
-
375
- if (that.options.momentum) {
376
- if (that.options.useTransform) {
377
- // Very lame general purpose alternative to CSSMatrix
378
- matrix = getComputedStyle(that.scroller, null)[transform].replace(/[^0-9\-.,]/g, '').split(',');
379
- x = +(matrix[12] || matrix[4]);
380
- y = +(matrix[13] || matrix[5]);
381
- } else {
382
- x = +getComputedStyle(that.scroller, null).left.replace(/[^0-9-]/g, '');
383
- y = +getComputedStyle(that.scroller, null).top.replace(/[^0-9-]/g, '');
384
- }
385
-
386
- if (x != that.x || y != that.y) {
387
- if (that.options.useTransition) that._unbind(TRNEND_EV);
388
- else cancelFrame(that.aniTime);
389
- that.steps = [];
390
- that._pos(x, y);
391
- if (that.options.onScrollEnd) that.options.onScrollEnd.call(that);
392
- }
393
- }
394
-
395
- that.absStartX = that.x; // Needed by snap threshold
396
- that.absStartY = that.y;
397
-
398
- that.startX = that.x;
399
- that.startY = that.y;
400
- that.pointX = point.pageX;
401
- that.pointY = point.pageY;
402
-
403
- that.startTime = e.timeStamp || Date.now();
404
-
405
- if (that.options.onScrollStart) that.options.onScrollStart.call(that, e);
406
-
407
- that._bind(MOVE_EV, window);
408
- that._bind(END_EV, window);
409
- that._bind(CANCEL_EV, window);
410
- },
411
-
412
- _move: function (e) {
413
- var that = this,
414
- point = hasTouch ? e.touches[0] : e,
415
- deltaX = point.pageX - that.pointX,
416
- deltaY = point.pageY - that.pointY,
417
- newX = that.x + deltaX,
418
- newY = that.y + deltaY,
419
- c1, c2, scale,
420
- timestamp = e.timeStamp || Date.now();
421
-
422
- if (that.options.onBeforeScrollMove) that.options.onBeforeScrollMove.call(that, e);
423
-
424
- // Zoom
425
- if (that.options.zoom && hasTouch && e.touches.length > 1) {
426
- c1 = m.abs(e.touches[0].pageX - e.touches[1].pageX);
427
- c2 = m.abs(e.touches[0].pageY - e.touches[1].pageY);
428
- that.touchesDist = m.sqrt(c1*c1+c2*c2);
429
-
430
- that.zoomed = true;
431
-
432
- scale = 1 / that.touchesDistStart * that.touchesDist * this.scale;
433
-
434
- if (scale < that.options.zoomMin) scale = 0.5 * that.options.zoomMin * Math.pow(2.0, scale / that.options.zoomMin);
435
- else if (scale > that.options.zoomMax) scale = 2.0 * that.options.zoomMax * Math.pow(0.5, that.options.zoomMax / scale);
436
-
437
- that.lastScale = scale / this.scale;
438
-
439
- newX = this.originX - this.originX * that.lastScale + this.x,
440
- newY = this.originY - this.originY * that.lastScale + this.y;
441
-
442
- this.scroller.style[transform] = 'translate(' + newX + 'px,' + newY + 'px) scale(' + scale + ')' + translateZ;
443
-
444
- if (that.options.onZoom) that.options.onZoom.call(that, e);
445
- return;
446
- }
447
-
448
- that.pointX = point.pageX;
449
- that.pointY = point.pageY;
450
-
451
- // Slow down if outside of the boundaries
452
- if (newX > 0 || newX < that.maxScrollX) {
453
- newX = that.options.bounce ? that.x + (deltaX / 2) : newX >= 0 || that.maxScrollX >= 0 ? 0 : that.maxScrollX;
454
- }
455
- if (newY > that.minScrollY || newY < that.maxScrollY) {
456
- newY = that.options.bounce ? that.y + (deltaY / 2) : newY >= that.minScrollY || that.maxScrollY >= 0 ? that.minScrollY : that.maxScrollY;
457
- }
458
-
459
- that.distX += deltaX;
460
- that.distY += deltaY;
461
- that.absDistX = m.abs(that.distX);
462
- that.absDistY = m.abs(that.distY);
463
-
464
- if (that.absDistX < 6 && that.absDistY < 6) {
465
- return;
466
- }
467
-
468
- // Lock direction
469
- if (that.options.lockDirection) {
470
- if (that.absDistX > that.absDistY + 5) {
471
- newY = that.y;
472
- deltaY = 0;
473
- } else if (that.absDistY > that.absDistX + 5) {
474
- newX = that.x;
475
- deltaX = 0;
476
- }
477
- }
478
-
479
- that.moved = true;
480
- that._pos(newX, newY);
481
- that.dirX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
482
- that.dirY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
483
-
484
- if (timestamp - that.startTime > 300) {
485
- that.startTime = timestamp;
486
- that.startX = that.x;
487
- that.startY = that.y;
488
- }
489
-
490
- if (that.options.onScrollMove) that.options.onScrollMove.call(that, e);
491
- },
492
-
493
- _end: function (e) {
494
- if (hasTouch && e.touches.length !== 0) return;
495
-
496
- var that = this,
497
- point = hasTouch ? e.changedTouches[0] : e,
498
- target, ev,
499
- momentumX = { dist:0, time:0 },
500
- momentumY = { dist:0, time:0 },
501
- duration = (e.timeStamp || Date.now()) - that.startTime,
502
- newPosX = that.x,
503
- newPosY = that.y,
504
- distX, distY,
505
- newDuration,
506
- snap,
507
- scale;
508
-
509
- that._unbind(MOVE_EV, window);
510
- that._unbind(END_EV, window);
511
- that._unbind(CANCEL_EV, window);
512
-
513
- if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e);
514
-
515
- if (that.zoomed) {
516
- scale = that.scale * that.lastScale;
517
- scale = Math.max(that.options.zoomMin, scale);
518
- scale = Math.min(that.options.zoomMax, scale);
519
- that.lastScale = scale / that.scale;
520
- that.scale = scale;
521
-
522
- that.x = that.originX - that.originX * that.lastScale + that.x;
523
- that.y = that.originY - that.originY * that.lastScale + that.y;
524
-
525
- that.scroller.style[transitionDuration] = '200ms';
526
- that.scroller.style[transform] = 'translate(' + that.x + 'px,' + that.y + 'px) scale(' + that.scale + ')' + translateZ;
527
-
528
- that.zoomed = false;
529
- that.refresh();
530
-
531
- if (that.options.onZoomEnd) that.options.onZoomEnd.call(that, e);
532
- return;
533
- }
534
-
535
- if (!that.moved) {
536
- if (hasTouch) {
537
- if (that.doubleTapTimer && that.options.zoom) {
538
- // Double tapped
539
- clearTimeout(that.doubleTapTimer);
540
- that.doubleTapTimer = null;
541
- if (that.options.onZoomStart) that.options.onZoomStart.call(that, e);
542
- that.zoom(that.pointX, that.pointY, that.scale == 1 ? that.options.doubleTapZoom : 1);
543
- if (that.options.onZoomEnd) {
544
- setTimeout(function() {
545
- that.options.onZoomEnd.call(that, e);
546
- }, 200); // 200 is default zoom duration
547
- }
548
- } else if (this.options.handleClick) {
549
- that.doubleTapTimer = setTimeout(function () {
550
- that.doubleTapTimer = null;
551
-
552
- // Find the last touched element
553
- target = point.target;
554
- while (target.nodeType != 1) target = target.parentNode;
555
-
556
- if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA') {
557
- ev = doc.createEvent('MouseEvents');
558
- ev.initMouseEvent('click', true, true, e.view, 1,
559
- point.screenX, point.screenY, point.clientX, point.clientY,
560
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
561
- 0, null);
562
- ev._fake = true;
563
- target.dispatchEvent(ev);
564
- }
565
- }, that.options.zoom ? 250 : 0);
566
- }
567
- }
568
-
569
- that._resetPos(400);
570
-
571
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
572
- return;
573
- }
574
-
575
- if (duration < 300 && that.options.momentum) {
576
- momentumX = newPosX ? that._momentum(newPosX - that.startX, duration, -that.x, that.scrollerW - that.wrapperW + that.x, that.options.bounce ? that.wrapperW : 0) : momentumX;
577
- momentumY = newPosY ? that._momentum(newPosY - that.startY, duration, -that.y, (that.maxScrollY < 0 ? that.scrollerH - that.wrapperH + that.y - that.minScrollY : 0), that.options.bounce ? that.wrapperH : 0) : momentumY;
578
-
579
- newPosX = that.x + momentumX.dist;
580
- newPosY = that.y + momentumY.dist;
581
-
582
- if ((that.x > 0 && newPosX > 0) || (that.x < that.maxScrollX && newPosX < that.maxScrollX)) momentumX = { dist:0, time:0 };
583
- if ((that.y > that.minScrollY && newPosY > that.minScrollY) || (that.y < that.maxScrollY && newPosY < that.maxScrollY)) momentumY = { dist:0, time:0 };
584
- }
585
-
586
- if (momentumX.dist || momentumY.dist) {
587
- newDuration = m.max(m.max(momentumX.time, momentumY.time), 10);
588
-
589
- // Do we need to snap?
590
- if (that.options.snap) {
591
- distX = newPosX - that.absStartX;
592
- distY = newPosY - that.absStartY;
593
- if (m.abs(distX) < that.options.snapThreshold && m.abs(distY) < that.options.snapThreshold) { that.scrollTo(that.absStartX, that.absStartY, 200); }
594
- else {
595
- snap = that._snap(newPosX, newPosY);
596
- newPosX = snap.x;
597
- newPosY = snap.y;
598
- newDuration = m.max(snap.time, newDuration);
599
- }
600
- }
601
-
602
- that.scrollTo(m.round(newPosX), m.round(newPosY), newDuration);
603
-
604
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
605
- return;
606
- }
607
-
608
- // Do we need to snap?
609
- if (that.options.snap) {
610
- distX = newPosX - that.absStartX;
611
- distY = newPosY - that.absStartY;
612
- if (m.abs(distX) < that.options.snapThreshold && m.abs(distY) < that.options.snapThreshold) that.scrollTo(that.absStartX, that.absStartY, 200);
613
- else {
614
- snap = that._snap(that.x, that.y);
615
- if (snap.x != that.x || snap.y != that.y) that.scrollTo(snap.x, snap.y, snap.time);
616
- }
617
-
618
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
619
- return;
620
- }
621
-
622
- that._resetPos(200);
623
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
624
- },
625
-
626
- _resetPos: function (time) {
627
- var that = this,
628
- resetX = that.x >= 0 ? 0 : that.x < that.maxScrollX ? that.maxScrollX : that.x,
629
- resetY = that.y >= that.minScrollY || that.maxScrollY > 0 ? that.minScrollY : that.y < that.maxScrollY ? that.maxScrollY : that.y;
630
-
631
- if (resetX == that.x && resetY == that.y) {
632
- if (that.moved) {
633
- that.moved = false;
634
- if (that.options.onScrollEnd) that.options.onScrollEnd.call(that); // Execute custom code on scroll end
635
- }
636
-
637
- if (that.hScrollbar && that.options.hideScrollbar) {
638
- if (vendor == 'webkit') that.hScrollbarWrapper.style[transitionDelay] = '300ms';
639
- that.hScrollbarWrapper.style.opacity = '0';
640
- }
641
- if (that.vScrollbar && that.options.hideScrollbar) {
642
- if (vendor == 'webkit') that.vScrollbarWrapper.style[transitionDelay] = '300ms';
643
- that.vScrollbarWrapper.style.opacity = '0';
644
- }
645
-
646
- return;
647
- }
648
-
649
- that.scrollTo(resetX, resetY, time || 0);
650
- },
651
-
652
- _wheel: function (e) {
653
- var that = this,
654
- wheelDeltaX, wheelDeltaY,
655
- deltaX, deltaY,
656
- deltaScale;
657
-
658
- if ('wheelDeltaX' in e) {
659
- wheelDeltaX = e.wheelDeltaX / 12;
660
- wheelDeltaY = e.wheelDeltaY / 12;
661
- } else if('wheelDelta' in e) {
662
- wheelDeltaX = wheelDeltaY = e.wheelDelta / 12;
663
- } else if ('detail' in e) {
664
- wheelDeltaX = wheelDeltaY = -e.detail * 3;
665
- } else {
666
- return;
667
- }
668
-
669
- if (that.options.wheelAction == 'zoom') {
670
- deltaScale = that.scale * Math.pow(2, 1/3 * (wheelDeltaY ? wheelDeltaY / Math.abs(wheelDeltaY) : 0));
671
- if (deltaScale < that.options.zoomMin) deltaScale = that.options.zoomMin;
672
- if (deltaScale > that.options.zoomMax) deltaScale = that.options.zoomMax;
673
-
674
- if (deltaScale != that.scale) {
675
- if (!that.wheelZoomCount && that.options.onZoomStart) that.options.onZoomStart.call(that, e);
676
- that.wheelZoomCount++;
677
-
678
- that.zoom(e.pageX, e.pageY, deltaScale, 400);
679
-
680
- setTimeout(function() {
681
- that.wheelZoomCount--;
682
- if (!that.wheelZoomCount && that.options.onZoomEnd) that.options.onZoomEnd.call(that, e);
683
- }, 400);
684
- }
685
-
686
- return;
687
- }
688
-
689
- deltaX = that.x + wheelDeltaX;
690
- deltaY = that.y + wheelDeltaY;
691
-
692
- if (deltaX > 0) deltaX = 0;
693
- else if (deltaX < that.maxScrollX) deltaX = that.maxScrollX;
694
-
695
- if (deltaY > that.minScrollY) deltaY = that.minScrollY;
696
- else if (deltaY < that.maxScrollY) deltaY = that.maxScrollY;
697
-
698
- if (that.maxScrollY < 0) {
699
- that.scrollTo(deltaX, deltaY, 0);
700
- }
701
- },
702
-
703
- _transitionEnd: function (e) {
704
- var that = this;
705
-
706
- if (e.target != that.scroller) return;
707
-
708
- that._unbind(TRNEND_EV);
709
-
710
- that._startAni();
711
- },
712
-
713
-
714
- /**
715
- *
716
- * Utilities
717
- *
718
- */
719
- _startAni: function () {
720
- var that = this,
721
- startX = that.x, startY = that.y,
722
- startTime = Date.now(),
723
- step, easeOut,
724
- animate;
725
-
726
- if (that.animating) return;
727
-
728
- if (!that.steps.length) {
729
- that._resetPos(400);
730
- return;
731
- }
732
-
733
- step = that.steps.shift();
734
-
735
- if (step.x == startX && step.y == startY) step.time = 0;
736
-
737
- that.animating = true;
738
- that.moved = true;
739
-
740
- if (that.options.useTransition) {
741
- that._transitionTime(step.time);
742
- that._pos(step.x, step.y);
743
- that.animating = false;
744
- if (step.time) that._bind(TRNEND_EV);
745
- else that._resetPos(0);
746
- return;
747
- }
748
-
749
- animate = function () {
750
- var now = Date.now(),
751
- newX, newY;
752
-
753
- if (now >= startTime + step.time) {
754
- that._pos(step.x, step.y);
755
- that.animating = false;
756
- if (that.options.onAnimationEnd) that.options.onAnimationEnd.call(that); // Execute custom code on animation end
757
- that._startAni();
758
- return;
759
- }
760
-
761
- now = (now - startTime) / step.time - 1;
762
- easeOut = m.sqrt(1 - now * now);
763
- newX = (step.x - startX) * easeOut + startX;
764
- newY = (step.y - startY) * easeOut + startY;
765
- that._pos(newX, newY);
766
- if (that.animating) that.aniTime = nextFrame(animate);
767
- };
768
-
769
- animate();
770
- },
771
-
772
- _transitionTime: function (time) {
773
- time += 'ms';
774
- this.scroller.style[transitionDuration] = time;
775
- if (this.hScrollbar) this.hScrollbarIndicator.style[transitionDuration] = time;
776
- if (this.vScrollbar) this.vScrollbarIndicator.style[transitionDuration] = time;
777
- },
778
-
779
- _momentum: function (dist, time, maxDistUpper, maxDistLower, size) {
780
- var deceleration = 0.0006,
781
- speed = m.abs(dist) / time,
782
- newDist = (speed * speed) / (2 * deceleration),
783
- newTime = 0, outsideDist = 0;
784
-
785
- // Proportinally reduce speed if we are outside of the boundaries
786
- if (dist > 0 && newDist > maxDistUpper) {
787
- outsideDist = size / (6 / (newDist / speed * deceleration));
788
- maxDistUpper = maxDistUpper + outsideDist;
789
- speed = speed * maxDistUpper / newDist;
790
- newDist = maxDistUpper;
791
- } else if (dist < 0 && newDist > maxDistLower) {
792
- outsideDist = size / (6 / (newDist / speed * deceleration));
793
- maxDistLower = maxDistLower + outsideDist;
794
- speed = speed * maxDistLower / newDist;
795
- newDist = maxDistLower;
796
- }
797
-
798
- newDist = newDist * (dist < 0 ? -1 : 1);
799
- newTime = speed / deceleration;
800
-
801
- return { dist: newDist, time: m.round(newTime) };
802
- },
803
-
804
- _offset: function (el) {
805
- var left = -el.offsetLeft,
806
- top = -el.offsetTop;
807
-
808
- while (el = el.offsetParent) {
809
- left -= el.offsetLeft;
810
- top -= el.offsetTop;
811
- }
812
-
813
- if (el != this.wrapper) {
814
- left *= this.scale;
815
- top *= this.scale;
816
- }
817
-
818
- return { left: left, top: top };
819
- },
820
-
821
- _snap: function (x, y) {
822
- var that = this,
823
- i, l,
824
- page, time,
825
- sizeX, sizeY;
826
-
827
- // Check page X
828
- page = that.pagesX.length - 1;
829
- for (i=0, l=that.pagesX.length; i<l; i++) {
830
- if (x >= that.pagesX[i]) {
831
- page = i;
832
- break;
833
- }
834
- }
835
- if (page == that.currPageX && page > 0 && that.dirX < 0) page--;
836
- x = that.pagesX[page];
837
- sizeX = m.abs(x - that.pagesX[that.currPageX]);
838
- sizeX = sizeX ? m.abs(that.x - x) / sizeX * 500 : 0;
839
- that.currPageX = page;
840
-
841
- // Check page Y
842
- page = that.pagesY.length-1;
843
- for (i=0; i<page; i++) {
844
- if (y >= that.pagesY[i]) {
845
- page = i;
846
- break;
847
- }
848
- }
849
- if (page == that.currPageY && page > 0 && that.dirY < 0) page--;
850
- y = that.pagesY[page];
851
- sizeY = m.abs(y - that.pagesY[that.currPageY]);
852
- sizeY = sizeY ? m.abs(that.y - y) / sizeY * 500 : 0;
853
- that.currPageY = page;
854
-
855
- // Snap with constant speed (proportional duration)
856
- time = m.round(m.max(sizeX, sizeY)) || 200;
857
-
858
- return { x: x, y: y, time: time };
859
- },
860
-
861
- _bind: function (type, el, bubble) {
862
- (el || this.scroller).addEventListener(type, this, !!bubble);
863
- },
864
-
865
- _unbind: function (type, el, bubble) {
866
- (el || this.scroller).removeEventListener(type, this, !!bubble);
867
- },
868
-
869
-
870
- /**
871
- *
872
- * Public methods
873
- *
874
- */
875
- destroy: function () {
876
- var that = this;
877
-
878
- that.scroller.style[transform] = '';
879
-
880
- // Remove the scrollbars
881
- that.hScrollbar = false;
882
- that.vScrollbar = false;
883
- that._scrollbar('h');
884
- that._scrollbar('v');
885
-
886
- // Remove the event listeners
887
- that._unbind(RESIZE_EV, window);
888
- that._unbind(START_EV);
889
- that._unbind(MOVE_EV, window);
890
- that._unbind(END_EV, window);
891
- that._unbind(CANCEL_EV, window);
892
-
893
- if (!that.options.hasTouch) {
894
- that._unbind('DOMMouseScroll');
895
- that._unbind('mousewheel');
896
- }
897
-
898
- if (that.options.useTransition) that._unbind(TRNEND_EV);
899
-
900
- if (that.options.checkDOMChanges) clearInterval(that.checkDOMTime);
901
-
902
- if (that.options.onDestroy) that.options.onDestroy.call(that);
903
- },
904
-
905
- refresh: function () {
906
- var that = this,
907
- offset,
908
- i, l,
909
- els,
910
- pos = 0,
911
- page = 0;
912
-
913
- if (that.scale < that.options.zoomMin) that.scale = that.options.zoomMin;
914
- that.wrapperW = that.wrapper.clientWidth || 1;
915
- that.wrapperH = that.wrapper.clientHeight || 1;
916
-
917
- that.minScrollY = -that.options.topOffset || 0;
918
- that.scrollerW = m.round(that.scroller.offsetWidth * that.scale);
919
- that.scrollerH = m.round((that.scroller.offsetHeight + that.minScrollY) * that.scale);
920
- that.maxScrollX = that.wrapperW - that.scrollerW;
921
- that.maxScrollY = that.wrapperH - that.scrollerH + that.minScrollY;
922
- that.dirX = 0;
923
- that.dirY = 0;
924
-
925
- if (that.options.onRefresh) that.options.onRefresh.call(that);
926
-
927
- that.hScroll = that.options.hScroll && that.maxScrollX < 0;
928
- that.vScroll = that.options.vScroll && (!that.options.bounceLock && !that.hScroll || that.scrollerH > that.wrapperH);
929
-
930
- that.hScrollbar = that.hScroll && that.options.hScrollbar;
931
- that.vScrollbar = that.vScroll && that.options.vScrollbar && that.scrollerH > that.wrapperH;
932
-
933
- offset = that._offset(that.wrapper);
934
- that.wrapperOffsetLeft = -offset.left;
935
- that.wrapperOffsetTop = -offset.top;
936
-
937
- // Prepare snap
938
- if (typeof that.options.snap == 'string') {
939
- that.pagesX = [];
940
- that.pagesY = [];
941
- els = that.scroller.querySelectorAll(that.options.snap);
942
- for (i=0, l=els.length; i<l; i++) {
943
- pos = that._offset(els[i]);
944
- pos.left += that.wrapperOffsetLeft;
945
- pos.top += that.wrapperOffsetTop;
946
- that.pagesX[i] = pos.left < that.maxScrollX ? that.maxScrollX : pos.left * that.scale;
947
- that.pagesY[i] = pos.top < that.maxScrollY ? that.maxScrollY : pos.top * that.scale;
948
- }
949
- } else if (that.options.snap) {
950
- that.pagesX = [];
951
- while (pos >= that.maxScrollX) {
952
- that.pagesX[page] = pos;
953
- pos = pos - that.wrapperW;
954
- page++;
955
- }
956
- if (that.maxScrollX%that.wrapperW) that.pagesX[that.pagesX.length] = that.maxScrollX - that.pagesX[that.pagesX.length-1] + that.pagesX[that.pagesX.length-1];
957
-
958
- pos = 0;
959
- page = 0;
960
- that.pagesY = [];
961
- while (pos >= that.maxScrollY) {
962
- that.pagesY[page] = pos;
963
- pos = pos - that.wrapperH;
964
- page++;
965
- }
966
- if (that.maxScrollY%that.wrapperH) that.pagesY[that.pagesY.length] = that.maxScrollY - that.pagesY[that.pagesY.length-1] + that.pagesY[that.pagesY.length-1];
967
- }
968
-
969
- // Prepare the scrollbars
970
- that._scrollbar('h');
971
- that._scrollbar('v');
972
-
973
- if (!that.zoomed) {
974
- that.scroller.style[transitionDuration] = '0';
975
- that._resetPos(400);
976
- }
977
- },
978
-
979
- scrollTo: function (x, y, time, relative) {
980
- var that = this,
981
- step = x,
982
- i, l;
983
-
984
- that.stop();
985
-
986
- if (!step.length) step = [{ x: x, y: y, time: time, relative: relative }];
987
-
988
- for (i=0, l=step.length; i<l; i++) {
989
- if (step[i].relative) { step[i].x = that.x - step[i].x; step[i].y = that.y - step[i].y; }
990
- that.steps.push({ x: step[i].x, y: step[i].y, time: step[i].time || 0 });
991
- }
992
-
993
- that._startAni();
994
- },
995
-
996
- scrollToElement: function (el, time) {
997
- var that = this, pos;
998
- el = el.nodeType ? el : that.scroller.querySelector(el);
999
- if (!el) return;
1000
-
1001
- pos = that._offset(el);
1002
- pos.left += that.wrapperOffsetLeft;
1003
- pos.top += that.wrapperOffsetTop;
1004
-
1005
- pos.left = pos.left > 0 ? 0 : pos.left < that.maxScrollX ? that.maxScrollX : pos.left;
1006
- pos.top = pos.top > that.minScrollY ? that.minScrollY : pos.top < that.maxScrollY ? that.maxScrollY : pos.top;
1007
- time = time === undefined ? m.max(m.abs(pos.left)*2, m.abs(pos.top)*2) : time;
1008
-
1009
- that.scrollTo(pos.left, pos.top, time);
1010
- },
1011
-
1012
- scrollToPage: function (pageX, pageY, time) {
1013
- var that = this, x, y;
1014
-
1015
- time = time === undefined ? 400 : time;
1016
-
1017
- if (that.options.onScrollStart) that.options.onScrollStart.call(that);
1018
-
1019
- if (that.options.snap) {
1020
- pageX = pageX == 'next' ? that.currPageX+1 : pageX == 'prev' ? that.currPageX-1 : pageX;
1021
- pageY = pageY == 'next' ? that.currPageY+1 : pageY == 'prev' ? that.currPageY-1 : pageY;
1022
-
1023
- pageX = pageX < 0 ? 0 : pageX > that.pagesX.length-1 ? that.pagesX.length-1 : pageX;
1024
- pageY = pageY < 0 ? 0 : pageY > that.pagesY.length-1 ? that.pagesY.length-1 : pageY;
1025
-
1026
- that.currPageX = pageX;
1027
- that.currPageY = pageY;
1028
- x = that.pagesX[pageX];
1029
- y = that.pagesY[pageY];
1030
- } else {
1031
- x = -that.wrapperW * pageX;
1032
- y = -that.wrapperH * pageY;
1033
- if (x < that.maxScrollX) x = that.maxScrollX;
1034
- if (y < that.maxScrollY) y = that.maxScrollY;
1035
- }
1036
-
1037
- that.scrollTo(x, y, time);
1038
- },
1039
-
1040
- disable: function () {
1041
- this.stop();
1042
- this._resetPos(0);
1043
- this.enabled = false;
1044
-
1045
- // If disabled after touchstart we make sure that there are no left over events
1046
- this._unbind(MOVE_EV, window);
1047
- this._unbind(END_EV, window);
1048
- this._unbind(CANCEL_EV, window);
1049
- },
1050
-
1051
- enable: function () {
1052
- this.enabled = true;
1053
- },
1054
-
1055
- stop: function () {
1056
- if (this.options.useTransition) this._unbind(TRNEND_EV);
1057
- else cancelFrame(this.aniTime);
1058
- this.steps = [];
1059
- this.moved = false;
1060
- this.animating = false;
1061
- },
1062
-
1063
- zoom: function (x, y, scale, time) {
1064
- var that = this,
1065
- relScale = scale / that.scale;
1066
-
1067
- if (!that.options.useTransform) return;
1068
-
1069
- that.zoomed = true;
1070
- time = time === undefined ? 200 : time;
1071
- x = x - that.wrapperOffsetLeft - that.x;
1072
- y = y - that.wrapperOffsetTop - that.y;
1073
- that.x = x - x * relScale + that.x;
1074
- that.y = y - y * relScale + that.y;
1075
-
1076
- that.scale = scale;
1077
- that.refresh();
1078
-
1079
- that.x = that.x > 0 ? 0 : that.x < that.maxScrollX ? that.maxScrollX : that.x;
1080
- that.y = that.y > that.minScrollY ? that.minScrollY : that.y < that.maxScrollY ? that.maxScrollY : that.y;
1081
-
1082
- that.scroller.style[transitionDuration] = time + 'ms';
1083
- that.scroller.style[transform] = 'translate(' + that.x + 'px,' + that.y + 'px) scale(' + scale + ')' + translateZ;
1084
- that.zoomed = false;
1085
- },
1086
-
1087
- isReady: function () {
1088
- return !this.moved && !this.zoomed && !this.animating;
1089
- }
1090
- };
1091
-
1092
- function prefixStyle (style) {
1093
- if ( vendor === '' ) return style;
1094
-
1095
- style = style.charAt(0).toUpperCase() + style.substr(1);
1096
- return vendor + style;
1097
- }
1098
-
1099
- dummyStyle = null; // for the sake of it
1100
-
1101
- if (typeof exports !== 'undefined') exports.iScroll = iScroll;
1102
- else window.iScroll = iScroll;
1103
-
1104
- })(window, document);