@openui5/sap.ui.core 1.99.1 → 1.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/.eslintrc.json +27 -5
  2. package/THIRDPARTY.txt +5 -5
  3. package/package.json +1 -1
  4. package/src/jquery.sap.global.js +6 -3
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  9. package/src/sap/base/Log.js +1 -1
  10. package/src/sap/base/assert.js +1 -1
  11. package/src/sap/base/strings/whitespaceReplacer.js +1 -1
  12. package/src/sap/base/util/LoaderExtensions.js +1 -10
  13. package/src/sap/base/util/UriParameters.js +2 -2
  14. package/src/sap/base/util/restricted/_CancelablePromise.js +2 -2
  15. package/src/sap/base/util/restricted/_castArray.js +1 -1
  16. package/src/sap/base/util/restricted/_compact.js +1 -1
  17. package/src/sap/base/util/restricted/_curry.js +1 -1
  18. package/src/sap/base/util/restricted/_debounce.js +1 -1
  19. package/src/sap/base/util/restricted/_difference.js +1 -1
  20. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  22. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_flatten.js +1 -1
  26. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  28. package/src/sap/base/util/restricted/_intersection.js +1 -1
  29. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  31. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  33. package/src/sap/base/util/restricted/_isNil.js +1 -1
  34. package/src/sap/base/util/restricted/_max.js +1 -1
  35. package/src/sap/base/util/restricted/_merge.js +1 -1
  36. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  37. package/src/sap/base/util/restricted/_min.js +1 -1
  38. package/src/sap/base/util/restricted/_omit.js +1 -1
  39. package/src/sap/base/util/restricted/_pick.js +1 -1
  40. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  41. package/src/sap/base/util/restricted/_throttle.js +1 -1
  42. package/src/sap/base/util/restricted/_toArray.js +1 -1
  43. package/src/sap/base/util/restricted/_union.js +1 -1
  44. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  45. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  46. package/src/sap/base/util/restricted/_uniq.js +1 -1
  47. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  49. package/src/sap/base/util/restricted/_without.js +1 -1
  50. package/src/sap/base/util/restricted/_xor.js +1 -1
  51. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  52. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  53. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  55. package/src/sap/ui/Device.js +3 -3
  56. package/src/sap/ui/Global.js +4 -4
  57. package/src/sap/ui/base/Event.js +1 -1
  58. package/src/sap/ui/base/EventProvider.js +2 -2
  59. package/src/sap/ui/base/ExpressionParser.js +1 -1
  60. package/src/sap/ui/base/Interface.js +1 -1
  61. package/src/sap/ui/base/ManagedObject.js +1 -1
  62. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  63. package/src/sap/ui/base/ManagedObjectObserver.js +2 -0
  64. package/src/sap/ui/base/ManagedObjectRegistry.js +10 -5
  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/core/.library +2 -1
  69. package/src/sap/ui/core/BusyIndicator.js +1 -1
  70. package/src/sap/ui/core/CommandExecution.js +15 -12
  71. package/src/sap/ui/core/Component.js +50 -27
  72. package/src/sap/ui/core/ComponentContainer.js +1 -1
  73. package/src/sap/ui/core/ComponentMetadata.js +28 -13
  74. package/src/sap/ui/core/ComponentSupport.js +1 -1
  75. package/src/sap/ui/core/Configuration.js +25 -9
  76. package/src/sap/ui/core/Control.js +2 -3
  77. package/src/sap/ui/core/Core.js +121 -36
  78. package/src/sap/ui/core/CustomData.js +1 -1
  79. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  80. package/src/sap/ui/core/Element.js +1 -1
  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 +6 -1
  85. package/src/sap/ui/core/FocusHandler.js +2 -3
  86. package/src/sap/ui/core/Fragment.js +1 -1
  87. package/src/sap/ui/core/HTML.js +1 -1
  88. package/src/sap/ui/core/History.js +1 -1
  89. package/src/sap/ui/core/Icon.js +17 -3
  90. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  91. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  92. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  93. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  94. package/src/sap/ui/core/InvisibleText.js +1 -1
  95. package/src/sap/ui/core/Item.js +1 -1
  96. package/src/sap/ui/core/LabelEnablement.js +1 -1
  97. package/src/sap/ui/core/LayoutData.js +1 -1
  98. package/src/sap/ui/core/ListItem.js +1 -1
  99. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  100. package/src/sap/ui/core/Locale.js +1 -1
  101. package/src/sap/ui/core/LocaleData.js +159 -9
  102. package/src/sap/ui/core/Manifest.js +5 -3
  103. package/src/sap/ui/core/Message.js +1 -1
  104. package/src/sap/ui/core/Patcher.js +6 -4
  105. package/src/sap/ui/core/Popup.js +21 -20
  106. package/src/sap/ui/core/RenderManager.js +1 -1
  107. package/src/sap/ui/core/Renderer.js +1 -1
  108. package/src/sap/ui/core/ResizeHandler.js +1 -1
  109. package/src/sap/ui/core/ScrollBar.js +21 -15
  110. package/src/sap/ui/core/SeparatorItem.js +1 -1
  111. package/src/sap/ui/core/ShortcutHintsMixin.js +2 -4
  112. package/src/sap/ui/core/Title.js +1 -1
  113. package/src/sap/ui/core/TooltipBase.js +1 -1
  114. package/src/sap/ui/core/UIArea.js +3 -5
  115. package/src/sap/ui/core/UIComponent.js +1 -1
  116. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  117. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  118. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  119. package/src/sap/ui/core/XMLComposite.js +1 -1
  120. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  121. package/src/sap/ui/core/XMLTemplateProcessor.js +521 -395
  122. package/src/sap/ui/core/_IconRegistry.js +3 -2
  123. package/src/sap/ui/core/cache/CacheManager.js +28 -1
  124. package/src/sap/ui/core/cache/CacheManagerNOP.js +3 -0
  125. package/src/sap/ui/core/cache/LRUPersistentCache.js +76 -4
  126. package/src/sap/ui/core/cldr/ar.json +469 -1
  127. package/src/sap/ui/core/cldr/ar_EG.json +469 -1
  128. package/src/sap/ui/core/cldr/ar_SA.json +469 -1
  129. package/src/sap/ui/core/cldr/bg.json +469 -1
  130. package/src/sap/ui/core/cldr/ca.json +469 -1
  131. package/src/sap/ui/core/cldr/cs.json +469 -1
  132. package/src/sap/ui/core/cldr/cy.json +469 -1
  133. package/src/sap/ui/core/cldr/da.json +469 -1
  134. package/src/sap/ui/core/cldr/de.json +469 -1
  135. package/src/sap/ui/core/cldr/de_AT.json +469 -1
  136. package/src/sap/ui/core/cldr/de_CH.json +469 -1
  137. package/src/sap/ui/core/cldr/el.json +469 -1
  138. package/src/sap/ui/core/cldr/el_CY.json +469 -1
  139. package/src/sap/ui/core/cldr/en.json +469 -1
  140. package/src/sap/ui/core/cldr/en_AU.json +470 -2
  141. package/src/sap/ui/core/cldr/en_GB.json +469 -1
  142. package/src/sap/ui/core/cldr/en_HK.json +469 -1
  143. package/src/sap/ui/core/cldr/en_IE.json +469 -1
  144. package/src/sap/ui/core/cldr/en_IN.json +469 -1
  145. package/src/sap/ui/core/cldr/en_NZ.json +469 -1
  146. package/src/sap/ui/core/cldr/en_PG.json +469 -1
  147. package/src/sap/ui/core/cldr/en_SG.json +469 -1
  148. package/src/sap/ui/core/cldr/en_ZA.json +469 -1
  149. package/src/sap/ui/core/cldr/es.json +469 -1
  150. package/src/sap/ui/core/cldr/es_AR.json +469 -1
  151. package/src/sap/ui/core/cldr/es_BO.json +469 -1
  152. package/src/sap/ui/core/cldr/es_CL.json +469 -1
  153. package/src/sap/ui/core/cldr/es_CO.json +469 -1
  154. package/src/sap/ui/core/cldr/es_MX.json +469 -1
  155. package/src/sap/ui/core/cldr/es_PE.json +469 -1
  156. package/src/sap/ui/core/cldr/es_UY.json +469 -1
  157. package/src/sap/ui/core/cldr/es_VE.json +469 -1
  158. package/src/sap/ui/core/cldr/et.json +469 -1
  159. package/src/sap/ui/core/cldr/fa.json +469 -1
  160. package/src/sap/ui/core/cldr/fi.json +469 -1
  161. package/src/sap/ui/core/cldr/fr.json +469 -1
  162. package/src/sap/ui/core/cldr/fr_BE.json +469 -1
  163. package/src/sap/ui/core/cldr/fr_CA.json +469 -1
  164. package/src/sap/ui/core/cldr/fr_CH.json +469 -1
  165. package/src/sap/ui/core/cldr/fr_LU.json +469 -1
  166. package/src/sap/ui/core/cldr/he.json +469 -1
  167. package/src/sap/ui/core/cldr/hi.json +469 -1
  168. package/src/sap/ui/core/cldr/hr.json +469 -1
  169. package/src/sap/ui/core/cldr/hu.json +469 -1
  170. package/src/sap/ui/core/cldr/id.json +469 -1
  171. package/src/sap/ui/core/cldr/it.json +469 -1
  172. package/src/sap/ui/core/cldr/it_CH.json +469 -1
  173. package/src/sap/ui/core/cldr/ja.json +469 -1
  174. package/src/sap/ui/core/cldr/kk.json +469 -1
  175. package/src/sap/ui/core/cldr/ko.json +469 -1
  176. package/src/sap/ui/core/cldr/lt.json +469 -1
  177. package/src/sap/ui/core/cldr/lv.json +469 -1
  178. package/src/sap/ui/core/cldr/ms.json +469 -1
  179. package/src/sap/ui/core/cldr/nb.json +469 -1
  180. package/src/sap/ui/core/cldr/nl.json +469 -1
  181. package/src/sap/ui/core/cldr/nl_BE.json +469 -1
  182. package/src/sap/ui/core/cldr/pl.json +469 -1
  183. package/src/sap/ui/core/cldr/pt.json +469 -1
  184. package/src/sap/ui/core/cldr/pt_PT.json +469 -1
  185. package/src/sap/ui/core/cldr/ro.json +469 -1
  186. package/src/sap/ui/core/cldr/ru.json +469 -1
  187. package/src/sap/ui/core/cldr/ru_UA.json +469 -1
  188. package/src/sap/ui/core/cldr/sk.json +469 -1
  189. package/src/sap/ui/core/cldr/sl.json +469 -1
  190. package/src/sap/ui/core/cldr/sr.json +469 -1
  191. package/src/sap/ui/core/cldr/sr_Latn.json +469 -1
  192. package/src/sap/ui/core/cldr/sv.json +469 -1
  193. package/src/sap/ui/core/cldr/th.json +469 -1
  194. package/src/sap/ui/core/cldr/tr.json +469 -1
  195. package/src/sap/ui/core/cldr/uk.json +469 -1
  196. package/src/sap/ui/core/cldr/vi.json +469 -1
  197. package/src/sap/ui/core/cldr/zh_CN.json +470 -2
  198. package/src/sap/ui/core/cldr/zh_HK.json +470 -2
  199. package/src/sap/ui/core/cldr/zh_SG.json +470 -2
  200. package/src/sap/ui/core/cldr/zh_TW.json +469 -1
  201. package/src/sap/ui/core/date/Buddhist.js +3 -3
  202. package/src/sap/ui/core/date/Japanese.js +3 -3
  203. package/src/sap/ui/core/date/UniversalDate.js +10 -0
  204. package/src/sap/ui/core/date/UniversalDateUtils.js +49 -49
  205. package/src/sap/ui/core/delegate/ItemNavigation.js +13 -14
  206. package/src/sap/ui/core/delegate/ScrollEnablement.js +11 -7
  207. package/src/sap/ui/core/dnd/DragAndDrop.js +27 -22
  208. package/src/sap/ui/core/dnd/DragDropBase.js +1 -2
  209. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  210. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  211. package/src/sap/ui/core/dnd/DropInfo.js +3 -3
  212. package/src/sap/ui/core/format/DateFormat.js +285 -151
  213. package/src/sap/ui/core/format/DateFormatTimezoneDisplay.js +4 -0
  214. package/src/sap/ui/core/format/NumberFormat.js +331 -179
  215. package/src/sap/ui/core/format/TimezoneUtil.js +50 -18
  216. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  217. package/src/sap/ui/core/library.js +219 -188
  218. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  219. package/src/sap/ui/core/message/Message.js +1 -1
  220. package/src/sap/ui/core/message/MessageManager.js +1 -1
  221. package/src/sap/ui/core/message/MessageParser.js +1 -1
  222. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  223. package/src/sap/ui/core/messagebundle.properties +0 -2
  224. package/src/sap/ui/core/messagebundle_ar.properties +0 -1
  225. package/src/sap/ui/core/messagebundle_bg.properties +0 -1
  226. package/src/sap/ui/core/messagebundle_ca.properties +0 -1
  227. package/src/sap/ui/core/messagebundle_cs.properties +0 -1
  228. package/src/sap/ui/core/messagebundle_cy.properties +0 -1
  229. package/src/sap/ui/core/messagebundle_da.properties +0 -1
  230. package/src/sap/ui/core/messagebundle_de.properties +0 -1
  231. package/src/sap/ui/core/messagebundle_el.properties +0 -1
  232. package/src/sap/ui/core/messagebundle_en.properties +0 -1
  233. package/src/sap/ui/core/messagebundle_en_GB.properties +0 -1
  234. package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +0 -1
  235. package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +0 -1
  236. package/src/sap/ui/core/messagebundle_es.properties +0 -1
  237. package/src/sap/ui/core/messagebundle_es_MX.properties +0 -1
  238. package/src/sap/ui/core/messagebundle_et.properties +0 -1
  239. package/src/sap/ui/core/messagebundle_fi.properties +0 -1
  240. package/src/sap/ui/core/messagebundle_fr.properties +0 -1
  241. package/src/sap/ui/core/messagebundle_fr_CA.properties +0 -1
  242. package/src/sap/ui/core/messagebundle_hi.properties +0 -1
  243. package/src/sap/ui/core/messagebundle_hr.properties +0 -1
  244. package/src/sap/ui/core/messagebundle_hu.properties +0 -1
  245. package/src/sap/ui/core/messagebundle_id.properties +0 -1
  246. package/src/sap/ui/core/messagebundle_it.properties +0 -1
  247. package/src/sap/ui/core/messagebundle_iw.properties +0 -1
  248. package/src/sap/ui/core/messagebundle_ja.properties +0 -1
  249. package/src/sap/ui/core/messagebundle_kk.properties +0 -1
  250. package/src/sap/ui/core/messagebundle_ko.properties +1 -2
  251. package/src/sap/ui/core/messagebundle_lt.properties +0 -1
  252. package/src/sap/ui/core/messagebundle_lv.properties +0 -1
  253. package/src/sap/ui/core/messagebundle_ms.properties +0 -1
  254. package/src/sap/ui/core/messagebundle_nl.properties +0 -1
  255. package/src/sap/ui/core/messagebundle_no.properties +0 -1
  256. package/src/sap/ui/core/messagebundle_pl.properties +0 -1
  257. package/src/sap/ui/core/messagebundle_pt.properties +0 -1
  258. package/src/sap/ui/core/messagebundle_pt_PT.properties +0 -1
  259. package/src/sap/ui/core/messagebundle_ro.properties +0 -1
  260. package/src/sap/ui/core/messagebundle_ru.properties +0 -1
  261. package/src/sap/ui/core/messagebundle_sh.properties +0 -1
  262. package/src/sap/ui/core/messagebundle_sk.properties +0 -1
  263. package/src/sap/ui/core/messagebundle_sl.properties +0 -1
  264. package/src/sap/ui/core/messagebundle_sv.properties +0 -1
  265. package/src/sap/ui/core/messagebundle_th.properties +0 -1
  266. package/src/sap/ui/core/messagebundle_tr.properties +0 -1
  267. package/src/sap/ui/core/messagebundle_uk.properties +0 -1
  268. package/src/sap/ui/core/messagebundle_vi.properties +0 -1
  269. package/src/sap/ui/core/messagebundle_zh_CN.properties +0 -1
  270. package/src/sap/ui/core/messagebundle_zh_TW.properties +0 -1
  271. package/src/sap/ui/core/mvc/Controller.js +1 -1
  272. package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +1 -1
  273. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  274. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  275. package/src/sap/ui/core/mvc/JSView.js +2 -2
  276. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  277. package/src/sap/ui/core/mvc/View.js +2 -1
  278. package/src/sap/ui/core/mvc/XMLView.js +25 -21
  279. package/src/sap/ui/core/mvc/XMLViewRenderer.js +81 -59
  280. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  281. package/src/sap/ui/core/plugin/LessSupport.js +3 -3
  282. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  283. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  284. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  285. package/src/sap/ui/core/routing/Router.js +1 -1
  286. package/src/sap/ui/core/rules/App.support.js +14 -9
  287. package/src/sap/ui/core/rules/Config.support.js +12 -12
  288. package/src/sap/ui/core/rules/Misc.support.js +8 -3
  289. package/src/sap/ui/core/rules/Model.support.js +8 -8
  290. package/src/sap/ui/core/rules/Rendering.support.js +1 -1
  291. package/src/sap/ui/core/rules/Theming.support.js +4 -4
  292. package/src/sap/ui/core/rules/View.support.js +9 -9
  293. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  294. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  295. package/src/sap/ui/core/service/Service.js +1 -1
  296. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  297. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  298. package/src/sap/ui/core/support/Plugin.js +29 -1
  299. package/src/sap/ui/core/support/Support.js +4 -4
  300. package/src/sap/ui/core/support/controls/InteractionSlider.js +395 -407
  301. package/src/sap/ui/core/support/plugins/Breakpoint.js +5 -5
  302. package/src/sap/ui/core/support/plugins/ControlTree.js +440 -349
  303. package/src/sap/ui/core/support/plugins/Debugging.js +153 -129
  304. package/src/sap/ui/core/support/plugins/Interaction.js +71 -85
  305. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  306. package/src/sap/ui/core/support/plugins/Performance.js +10 -13
  307. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  308. package/src/sap/ui/core/support/plugins/TechInfo.js +5 -3
  309. package/src/sap/ui/core/support/plugins/Trace.js +7 -7
  310. package/src/sap/ui/core/support/plugins/ViewInfo.js +91 -43
  311. package/src/sap/ui/core/support/support.css +23 -23
  312. package/src/sap/ui/core/support/support.html +5 -7
  313. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +1 -1
  314. package/src/sap/ui/core/themes/base/CommandShortcutHints.less +1 -1
  315. package/src/sap/ui/core/themes/base/DragAndDrop.less +3 -3
  316. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +15 -1
  317. package/src/sap/ui/core/themes/base/base.less +1524 -54
  318. package/src/sap/ui/core/themes/base/global.less +171 -13
  319. package/src/sap/ui/core/themes/base/shared.less +1 -0
  320. package/src/sap/ui/core/themes/sap_hcb/global.less +166 -7
  321. package/src/sap/ui/core/theming/Parameters.js +1 -1
  322. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  323. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  324. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  325. package/src/sap/ui/core/tmpl/Template.js +1 -1
  326. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  327. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  328. package/src/sap/ui/core/util/Export.js +1 -1
  329. package/src/sap/ui/core/util/ExportCell.js +1 -1
  330. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  331. package/src/sap/ui/core/util/ExportRow.js +1 -1
  332. package/src/sap/ui/core/util/ExportType.js +1 -1
  333. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  334. package/src/sap/ui/core/util/File.js +1 -1
  335. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  336. package/src/sap/ui/core/util/MockServer.js +4 -3
  337. package/src/sap/ui/core/util/PasteHelper.js +2 -2
  338. package/src/sap/ui/core/util/XMLPreprocessor.js +1 -0
  339. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  340. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  341. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  342. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  343. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  344. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  345. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  346. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  347. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  348. package/src/sap/ui/core/ws/WebSocket.js +7 -8
  349. package/src/sap/ui/debug/ControlTree.js +1 -1
  350. package/src/sap/ui/debug/DebugEnv.js +1 -1
  351. package/src/sap/ui/debug/LogViewer.js +2 -2
  352. package/src/sap/ui/debug/PropertyList.js +1 -1
  353. package/src/sap/ui/model/ClientListBinding.js +127 -21
  354. package/src/sap/ui/model/ClientModel.js +1 -1
  355. package/src/sap/ui/model/CompositeBinding.js +3 -0
  356. package/src/sap/ui/model/CompositeDataState.js +1 -1
  357. package/src/sap/ui/model/CompositeType.js +13 -1
  358. package/src/sap/ui/model/DataState.js +1 -1
  359. package/src/sap/ui/model/ListBinding.js +32 -13
  360. package/src/sap/ui/model/MetaModel.js +1 -1
  361. package/src/sap/ui/model/Model.js +10 -7
  362. package/src/sap/ui/model/SelectionModel.js +1 -1
  363. package/src/sap/ui/model/SimpleType.js +1 -1
  364. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  365. package/src/sap/ui/model/Type.js +1 -1
  366. package/src/sap/ui/model/_Helper.js +26 -0
  367. package/src/sap/ui/model/analytics/AnalyticalBinding.js +29 -13
  368. package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
  369. package/src/sap/ui/model/base/ManagedObjectModel.js +8 -6
  370. package/src/sap/ui/model/json/JSONListBinding.js +0 -58
  371. package/src/sap/ui/model/json/JSONModel.js +15 -8
  372. package/src/sap/ui/model/message/MessageListBinding.js +0 -42
  373. package/src/sap/ui/model/message/MessageModel.js +1 -1
  374. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  375. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  376. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  377. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  378. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  379. package/src/sap/ui/model/odata/ODataPropertyBinding.js +3 -1
  380. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +5 -4
  381. package/src/sap/ui/model/odata/ODataUtils.js +7 -9
  382. package/src/sap/ui/model/odata/OperationMode.js +6 -0
  383. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  384. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  385. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  386. package/src/sap/ui/model/odata/type/Date.js +1 -1
  387. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  388. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  389. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  390. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +78 -68
  391. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  392. package/src/sap/ui/model/odata/type/Double.js +1 -1
  393. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  394. package/src/sap/ui/model/odata/type/Int.js +1 -1
  395. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  396. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  397. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  398. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  399. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  400. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  401. package/src/sap/ui/model/odata/type/Single.js +1 -1
  402. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  403. package/src/sap/ui/model/odata/type/String.js +1 -1
  404. package/src/sap/ui/model/odata/type/Time.js +1 -1
  405. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  406. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  407. package/src/sap/ui/model/odata/type/UnitMixin.js +1 -1
  408. package/src/sap/ui/model/odata/v2/Context.js +78 -5
  409. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  410. package/src/sap/ui/model/odata/v2/ODataListBinding.js +280 -76
  411. package/src/sap/ui/model/odata/v2/ODataModel.js +342 -96
  412. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +8 -4
  413. package/src/sap/ui/model/odata/v4/Context.js +52 -25
  414. package/src/sap/ui/model/odata/v4/ODataBinding.js +50 -32
  415. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +35 -6
  416. package/src/sap/ui/model/odata/v4/ODataListBinding.js +302 -110
  417. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +13 -6
  418. package/src/sap/ui/model/odata/v4/ODataModel.js +297 -30
  419. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +25 -57
  420. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -2
  421. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +59 -5
  422. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +15 -0
  423. package/src/sap/ui/model/odata/v4/lib/_Cache.js +309 -130
  424. package/src/sap/ui/model/odata/v4/lib/_ConcatHelper.js +5 -13
  425. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +16 -0
  426. package/src/sap/ui/model/odata/v4/lib/_Helper.js +114 -41
  427. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +270 -36
  428. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  429. package/src/sap/ui/model/type/Boolean.js +1 -1
  430. package/src/sap/ui/model/type/Currency.js +1 -1
  431. package/src/sap/ui/model/type/Date.js +1 -1
  432. package/src/sap/ui/model/type/DateInterval.js +1 -1
  433. package/src/sap/ui/model/type/DateTime.js +1 -1
  434. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  435. package/src/sap/ui/model/type/FileSize.js +1 -1
  436. package/src/sap/ui/model/type/Float.js +1 -1
  437. package/src/sap/ui/model/type/Integer.js +1 -1
  438. package/src/sap/ui/model/type/String.js +1 -1
  439. package/src/sap/ui/model/type/Time.js +1 -1
  440. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  441. package/src/sap/ui/model/type/Unit.js +1 -1
  442. package/src/sap/ui/model/xml/XMLListBinding.js +0 -53
  443. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  444. package/src/sap/ui/performance/trace/FESR.js +1 -1
  445. package/src/sap/ui/performance/trace/FESRHelper.js +72 -0
  446. package/src/sap/ui/performance/trace/Interaction.js +6 -2
  447. package/src/sap/ui/qunit/qunit-2-css.js +4 -4
  448. package/src/sap/ui/qunit/qunit-css.js +4 -4
  449. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  450. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  451. package/src/sap/ui/test/BranchTracking.js +1 -0
  452. package/src/sap/ui/test/Opa5.js +9 -5
  453. package/src/sap/ui/test/OpaBuilder.js +7 -7
  454. package/src/sap/ui/test/TestUtils.js +11 -0
  455. package/src/sap/ui/test/_UsageReport.js +1 -1
  456. package/src/sap/ui/test/actions/Action.js +3 -3
  457. package/src/sap/ui/test/actions/Press.js +1 -1
  458. package/src/sap/ui/test/generic/GenericTestCollection.js +176 -0
  459. package/src/sap/ui/test/generic/TestBase.js +151 -0
  460. package/src/sap/ui/test/generic/Utils.js +284 -0
  461. package/src/sap/ui/test/gherkin/opa5TestHarness.js +14 -5
  462. package/src/sap/ui/test/opaQunit.js +11 -10
  463. package/src/sap/ui/test/selectors/_ControlSelectorGenerator.js +9 -8
  464. package/src/sap/ui/test/selectors/_ControlSelectorValidator.js +1 -1
  465. package/src/sap/ui/test/starter/_setupAndStart.js +4 -0
  466. package/src/sap/ui/thirdparty/jszip.js +0 -1
  467. package/src/sap/ui/util/Storage.js +1 -1
  468. package/src/ui5loader.js +8 -4
  469. package/ui5.yaml +1 -1
@@ -5,410 +5,398 @@
5
5
  */
6
6
 
7
7
  sap.ui.define(['sap/ui/base/ManagedObject', "sap/ui/events/KeyCodes", "sap/ui/thirdparty/jquery"],
8
- function(ManagedObject, KeyCodes, jQuery) {
9
- 'use strict';
10
- var InteractionSlider = ManagedObject.extend("sap.ui.core.support.controls.InteractionSlider", {
11
- metadata: {
12
- library: "sap.ui.core"
13
- },
14
- constructor: function () {
15
- //this.SIDE_LIST_WIDTH = 250;
16
- this.SIDE_LIST_WIDTH = 0;
17
- this.LEFT_HANDLE_ID = 'left';
18
- this.RIGHT_HANDLE_ID = 'right';
19
- this.HANDLE_BORDER_SIZE = 0;
20
- this.HANDLES_WIDTH = 3;
21
-
22
- this.selectedInterval = {
23
- start: 0,
24
- end: 0,
25
- duration: 0
26
- };
27
- this.nodes = {
28
- slider: null,
29
- handle: null,
30
- leftResizeHandle: null,
31
- rightResizeHandle: null
32
- };
33
- this.sizes = {
34
- width: 0,
35
- handleWidth: 0,
36
- handleMinWidth: 10
37
- };
38
-
39
- this.drag = {
40
- handleClickOffsetX: 0,
41
- handleOffsetLeft: 0,
42
- isResize: false,
43
- whichResizeHandle: ''
44
- };
45
-
46
- this.fRefs = {
47
- mousedown: undefined,
48
- mousemove: undefined,
49
- mouseup: undefined,
50
- dragstart: undefined
51
- };
52
- }
53
- });
54
-
55
- InteractionSlider.prototype.render = function(rm) {
56
- rm.write("<div id='interactionSlider'>" +
57
- "<div id='interactionSlideHandle'>" +
58
- "<span id='interactionLeftHandle'></span>" +
59
- "<span id='interactionRightHandle'></span>" +
60
- "</div>" +
61
- "</div>");
62
- rm.write("<div id='interactionSliderBottom'>" +
63
- "<div id='interactionSlideHandleBottom'>" +
64
- "<span id='interactionLeftHandleBottom'></span>" +
65
- "<span id='interactionRightHandleBottom'></span>" +
66
- "</div>" +
67
- "</div>");
68
- };
69
-
70
- InteractionSlider.prototype.initialize = function () {
71
- this._registerEventListeners();
72
- this._initSlider();
73
- };
74
-
75
- InteractionSlider.prototype.setDuration = function(aMeasurements) {
76
- if (!aMeasurements || !aMeasurements.length) {
77
- return;
78
- }
79
-
80
- this.selectedInterval.duration = aMeasurements[aMeasurements.length - 1].end - aMeasurements[0].start;
81
- };
82
-
83
- InteractionSlider.prototype._registerEventListeners = function () {
84
- var that = this;
85
- window.addEventListener('resize', function () {
86
- that._calculateSliderSize();
87
- }, false);
88
-
89
- window.addEventListener('keydown', this._onArrowMove.bind(this));
90
- window.addEventListener('keyup', this._onArrowUp.bind(this));
91
- jQuery("#interactionSlideHandle").on('dblclick', this._initSlider.bind(this));
92
- jQuery("#interactionSlider").on('wheel', this._onMouseWheel.bind(this));
93
- jQuery("#interactionSlideHandleBottom").on('dblclick', this._initSlider.bind(this));
94
- jQuery("#interactionSliderBottom").on('wheel', this._onMouseWheel.bind(this));
95
- };
96
-
97
- InteractionSlider.prototype._initSlider = function () {
98
- this.nodes.slider = this.nodes.slider || document.querySelector('#interactionSlider');
99
- this.nodes.sliderBottom = this.nodes.sliderBottom || document.querySelector('#interactionSliderBottom');
100
- this.nodes.handle = this.nodes.handle || document.querySelector('#interactionSlideHandle');
101
- this.nodes.handleBottom = this.nodes.handleBottom || document.querySelector('#interactionSlideHandleBottom');
102
- this.nodes.leftResizeHandle = this.nodes.leftResizeHandle || document.querySelector('#interactionLeftHandle');
103
- this.nodes.leftResizeHandleBottom = this.nodes.leftResizeHandleBottom ||
104
- document.querySelector('#interactionLeftHandleBottom');
105
- this.nodes.rightResizeHandle = this.nodes.rightResizeHandle || document.querySelector('#interactionRightHandle');
106
- this.nodes.rightResizeHandleBottom = this.nodes.rightResizeHandleBottom || document.querySelector('#interactionRightHandleBottom');
107
-
108
- this.nodes.handle.style.left = 0;
109
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
110
- this.nodes.handle.style.width = '100%';
111
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
112
-
113
- //set the slider width
114
- this._calculateSliderSize();
115
-
116
- if (!this.fRefs.mousedown) {
117
- this.fRefs.mousedown = this._onMouseDown.bind(this);
118
- this.nodes.slider.addEventListener('mousedown', this.fRefs.mousedown);
119
- this.nodes.sliderBottom.addEventListener('mousedown', this.fRefs.mousedown);
120
- } else {
121
- this._fireSelectEvent();
122
- }
123
- };
124
-
125
- InteractionSlider.prototype._calculateSliderSize = function () {
126
- var oldSliderWidth = this.sizes.width;
127
- this.sizes.handleWidth = parseInt(this._getSlideHandleWidth());
128
- this.sizes.width = this.nodes.slider.offsetWidth;
129
-
130
- if (this.sizes.width !== this.sizes.handleWidth) {
131
- this._resizeSliderHandle(oldSliderWidth);
132
- }
133
- this._updateUI();
134
- };
135
-
136
- InteractionSlider.prototype._resizeSliderHandle = function (oldSliderWidth) {
137
- var sliderWidthDifference = this.sizes.width - oldSliderWidth;
138
- var upperWidthBound = this.sizes.width - this.drag.handleOffsetLeft;
139
- var newHandleWidth = this.sizes.handleWidth + sliderWidthDifference;
140
-
141
- this.sizes.handleWidth = Math.max(this.sizes.handleMinWidth, Math.min(newHandleWidth, upperWidthBound));
142
- this.nodes.handle.style.width = this.sizes.handleWidth + 'px';
143
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
144
-
145
- if (this.sizes.width < (this.drag.handleOffsetLeft + this.sizes.handleWidth)) {
146
- this.drag.handleOffsetLeft = this.sizes.width - this.sizes.handleWidth;
147
- this.nodes.handle.style.left = this.drag.handleOffsetLeft + 'px';
148
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
149
- }
150
- };
151
-
152
- InteractionSlider.prototype._updateUI = function () {
153
- this.sizes.handleWidth = parseInt(this._getSlideHandleWidth());
154
- this.drag.handleOffsetLeft = this.nodes.handle.offsetLeft;
155
- };
156
-
157
- InteractionSlider.prototype._getSlideHandleWidth = function () {
158
- var handleComputedWidth;
159
- if (document.getElementById("interactionSlideHandle").currentStyle) {
160
- handleComputedWidth = document.getElementById("interactionSlideHandle").currentStyle.width;
161
- } else {
162
- handleComputedWidth = window.getComputedStyle(this.nodes.handle).width;
163
- }
164
- return handleComputedWidth;
165
- };
166
-
167
- InteractionSlider.prototype._onArrowMove = function (evt) {
168
- var offsetLeft = 0;
169
- var STEP = 5;
170
-
171
- if (evt.keyCode != KeyCodes.ARROW_LEFT && evt.keyCode != KeyCodes.ARROW_RIGHT) {
172
- return;
173
- } else if (evt.keyCode == KeyCodes.ARROW_LEFT) {
174
- offsetLeft = -STEP;
175
- } else if (evt.keyCode == KeyCodes.ARROW_RIGHT) {
176
- offsetLeft = STEP;
177
- }
178
- var maxLeftOffset = Math.min((this.drag.handleOffsetLeft + offsetLeft),
179
- this.sizes.width - this.sizes.handleWidth);
180
-
181
- this.drag.handleOffsetLeft = Math.max(maxLeftOffset, 0);
182
- this.nodes.handle.style.left = this.drag.handleOffsetLeft + 'px';
183
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
184
- };
185
-
186
- InteractionSlider.prototype._onArrowUp = function (evt) {
187
- if (evt.keyCode != KeyCodes.ARROW_LEFT && evt.keyCode != KeyCodes.ARROW_RIGHT) {
188
- return;
189
- }
190
- this._fireSelectEvent();
191
- };
192
-
193
- InteractionSlider.prototype._onMouseDown = function (evt) {
194
- var targetId = evt.target.id;
195
- var marginAndHalfOfSlideHandleWidth = this.SIDE_LIST_WIDTH + (this.sizes.handleWidth / 2);
196
- var leftConstraint = Math.max(evt.clientX - marginAndHalfOfSlideHandleWidth, 0);
197
- var rightConstraint = this.sizes.width - this.sizes.handleWidth;
198
- var constrainedPosition = Math.min(leftConstraint, rightConstraint);
199
-
200
- if (targetId === this.nodes.slider.id || targetId === this.nodes.sliderBottom.id) {
201
- this.nodes.handle.style.left = constrainedPosition + 'px';
202
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
203
- this.drag.handleOffsetLeft = this.nodes.handle.offsetLeft;
204
- this.drag.isResize = false;
205
- } else if (targetId === this.nodes.handle.id || targetId === this.nodes.handleBottom.id) {
206
- this.drag.handleClickOffsetX = evt.offsetX;
207
- this.drag.isResize = false;
208
-
209
- this._registerOnMouseMoveListener();
210
- } else if (targetId === this.nodes.leftResizeHandle.id || targetId === this.nodes.leftResizeHandleBottom.id) {
211
- this.drag.whichResizeHandle = this.LEFT_HANDLE_ID;
212
- this.drag.isResize = true;
213
-
214
- this._registerOnMouseMoveListener();
215
- } else if (targetId === this.nodes.rightResizeHandle.id || targetId === this.nodes.rightResizeHandleBottom.id) {
216
- this.drag.whichResizeHandle = this.RIGHT_HANDLE_ID;
217
- this.drag.isResize = true;
218
-
219
- this._registerOnMouseMoveListener();
220
- } else {
221
- return;
222
- }
223
-
224
- this._registerOnMouseUpListener();
225
- this._registerOnDragStartListener();
226
- };
227
-
228
- InteractionSlider.prototype._registerOnMouseMoveListener = function () {
229
- this.fRefs.mousemove = this._onMouseMove.bind(this);
230
- window.addEventListener('mousemove', this.fRefs.mousemove);
231
- };
232
-
233
- InteractionSlider.prototype._registerOnMouseUpListener = function () {
234
- this.fRefs.mouseup = this._onMouseUp.bind(this);
235
- window.addEventListener('mouseup', this.fRefs.mouseup);
236
- };
237
-
238
- InteractionSlider.prototype._registerOnDragStartListener = function () {
239
- this.fRefs.dragstart = this._onDragStart.bind(this);
240
- window.addEventListener('dragstart', this.fRefs.dragstart);
241
- };
242
-
243
- InteractionSlider.prototype._onMouseMove = function (evt) {
244
- evt.stopImmediatePropagation();
245
-
246
- var constraintDistance;
247
- var distance = evt.clientX - this.SIDE_LIST_WIDTH;
248
- if (this.drag.isResize) {
249
- this._handleResize(evt);
250
- return;
251
- }
252
-
253
- var rightBorder = this.sizes.width - this.sizes.handleWidth + this.drag.handleClickOffsetX;
254
- constraintDistance = Math.max(Math.min(distance, rightBorder), this.drag.handleClickOffsetX);
255
- this.nodes.handle.style.left = constraintDistance - this.drag.handleClickOffsetX + 'px';
256
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
257
- };
258
-
259
- InteractionSlider.prototype._onMouseWheel = function (evt) {
260
- evt.preventDefault();
261
- this._handleMouseWheelResize(evt);
262
- };
263
-
264
- InteractionSlider.prototype._handleResize = function (evt) {
265
- evt.stopImmediatePropagation();
266
-
267
- var minWidth;
268
- var maxWidth;
269
- var newWidth;
270
- var resizeDistance;
271
- var rightConstraint;
272
- var leftRightConstraints;
273
- var clientX = evt.clientX - this.SIDE_LIST_WIDTH;
274
- //var LEFT_DRAG_OFFSET_VALUE = 10;
275
- var DRAG_OFFSET_VALUE = 3;
276
-
277
- if (this.drag.whichResizeHandle === this.RIGHT_HANDLE_ID) {
278
- resizeDistance = clientX - this.drag.handleOffsetLeft + DRAG_OFFSET_VALUE;
279
- minWidth = Math.max(resizeDistance, this.sizes.handleMinWidth);
280
- maxWidth = this.sizes.width - this.drag.handleOffsetLeft;
281
-
282
- newWidth = Math.min(minWidth, maxWidth);
283
- this.nodes.handle.style.width = newWidth + 'px';
284
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
285
- }
286
-
287
- if (this.drag.whichResizeHandle === this.LEFT_HANDLE_ID) {
288
- minWidth = this.drag.handleOffsetLeft + this.sizes.handleWidth - this.sizes.handleMinWidth;
289
- clientX = Math.max(Math.min(clientX, minWidth), 0);
290
- maxWidth = this.drag.handleOffsetLeft + this.sizes.handleWidth;
291
- rightConstraint = Math.min(clientX, this.sizes.width);
292
- leftRightConstraints = Math.max(Math.max(rightConstraint, -2 * this.sizes.handleMinWidth),
293
- DRAG_OFFSET_VALUE);
294
- newWidth = maxWidth - leftRightConstraints + DRAG_OFFSET_VALUE;
295
-
296
- if (newWidth <= DRAG_OFFSET_VALUE + this.sizes.handleMinWidth) {
297
- newWidth -= DRAG_OFFSET_VALUE;
298
- leftRightConstraints += DRAG_OFFSET_VALUE;
299
- }
300
-
301
- this.nodes.handle.style.left = (leftRightConstraints - DRAG_OFFSET_VALUE) + 'px';
302
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
303
- this.nodes.handle.style.width = newWidth + 'px';
304
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
305
- }
306
- };
307
-
308
- InteractionSlider.prototype._handleMouseWheelResize = function (evt) {
309
- var sizeChangeStep = 40;
310
- if (evt.originalEvent.deltaY && evt.originalEvent.deltaY >= 0) {
311
- this._calculateHandlerSizePositionOnMouseWheelDown(sizeChangeStep);
312
- } else {
313
- this._calculateHandlerSizePositionOnMouseWheelUp(sizeChangeStep);
314
- }
315
- this._updateUI();
316
- this._fireSelectEvent();
317
- };
318
-
319
- InteractionSlider.prototype._calculateHandlerSizePositionOnMouseWheelDown = function (sizeChangeStep) {
320
- var newLeftHandlerPosition;
321
- var newWidth;
322
- var rightHandlerMaxSizeLimit = this.sizes.width - this.drag.handleOffsetLeft;
323
- var widthIncrease = Math.min((rightHandlerMaxSizeLimit - this.sizes.handleWidth), sizeChangeStep);
324
- var rightHandlerInMaxRightPosition = (this.drag.handleOffsetLeft + this.sizes.handleWidth === this.sizes.width);
325
-
326
- if ((widthIncrease < sizeChangeStep) && !rightHandlerInMaxRightPosition) {
327
- newWidth = this.sizes.handleWidth + widthIncrease;
328
- newLeftHandlerPosition = this.nodes.handle.offsetLeft;
329
- } else if (rightHandlerInMaxRightPosition) {
330
- var leftHandlerChangeStep = Math.min(this.sizes.width - this.sizes.handleWidth, sizeChangeStep);
331
- newWidth = this.sizes.handleWidth + leftHandlerChangeStep;
332
- newLeftHandlerPosition = Math.max(0, this.nodes.handle.offsetLeft - leftHandlerChangeStep);
333
- } else {
334
- newWidth = this.sizes.handleWidth + sizeChangeStep;
335
- newLeftHandlerPosition = Math.max(0, this.nodes.handle.offsetLeft - (sizeChangeStep / 2));
336
- }
337
- this.nodes.handle.style.left = newLeftHandlerPosition + 'px';
338
- this.nodes.handleBottom.style.left = this.nodes.handle.style.left;
339
- this.nodes.handle.style.width = newWidth + 'px';
340
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
341
- };
342
-
343
- InteractionSlider.prototype._calculateHandlerSizePositionOnMouseWheelUp = function (sizeChangeStep) {
344
- if (this.sizes.handleWidth - sizeChangeStep > this.sizes.handleMinWidth) {
345
- this.nodes.handle.style.left = (this.nodes.handle.offsetLeft + (sizeChangeStep / 2)) + 'px';
346
- this.nodes.handleBottom.style.left = (this.nodes.handleBottom.offsetLeft + (sizeChangeStep / 2)) + 'px';
347
- this.nodes.handle.style.width = (this.sizes.handleWidth - sizeChangeStep) + 'px';
348
- this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
349
- }
350
- };
351
-
352
- InteractionSlider.prototype._onMouseUp = function (evt) {
353
- evt.stopImmediatePropagation();
354
- window.removeEventListener('mousemove', this.fRefs.mousemove);
355
- window.removeEventListener('mouseup', this.fRefs.mouseup);
356
- window.removeEventListener('dragstart', this.fRefs.dragstart);
357
- this._updateUI();
358
- this._fireSelectEvent();
359
- };
360
-
361
- InteractionSlider.prototype._onDragStart = function (evt) {
362
- evt.preventDefault();
363
- };
364
-
365
- InteractionSlider.prototype._fireSelectEvent = function () {
366
- var oldStartInterval = this.selectedInterval.start;
367
- var oldEndInterval = this.selectedInterval.end;
368
- this._calculateStartEndPeriod();
369
-
370
- if (oldStartInterval === this.selectedInterval.start && oldEndInterval == this.selectedInterval.end) {
371
- return;
372
- }
373
-
374
- jQuery("#interactionSlider").trigger("InteractionSliderChange", [ this.selectedInterval.start, this.selectedInterval.end ]);
375
- };
376
-
377
-
378
- InteractionSlider.prototype._calculateStartEndPeriod = function () {
379
- var sliderWidth = this.nodes.slider.offsetWidth;
380
- var leftHandlerPosition = this.nodes.leftResizeHandle.getBoundingClientRect().left -
381
- this.nodes.slider.getBoundingClientRect().left - this.HANDLE_BORDER_SIZE;
382
- var rightHandlerPosition = this.nodes.rightResizeHandle.getBoundingClientRect().left -
383
- this.nodes.slider.getBoundingClientRect().left + this.HANDLE_BORDER_SIZE + this.HANDLES_WIDTH;
384
- var leftHandlerPositionPercent = leftHandlerPosition / sliderWidth;
385
- var rightHandlerPositionPercent = rightHandlerPosition / sliderWidth,
386
- that = this,
387
- setTooltipText = function(handlerPosition, handlerId) {
388
- var getTooltipText = function (handlerPosition) {
389
- return "" + Math.round( handlerPosition * that.selectedInterval.duration / 10 ) / 100 + "s";
390
- };
391
- var sTooltip = getTooltipText(handlerPosition);
392
-
393
- jQuery("#" + handlerId).attr('title', sTooltip);
394
- jQuery("#" + handlerId + "Bottom").attr('title', sTooltip);
395
- };
396
-
397
- // update slider title before update the positions
398
- if (leftHandlerPositionPercent != this.selectedInterval.start ) {
399
- // left handler is moved
400
- setTooltipText(leftHandlerPositionPercent, 'interactionLeftHandle');
401
- }
402
-
403
- if (rightHandlerPositionPercent != this.selectedInterval.end ) {
404
- // right handler is moved
405
- setTooltipText(rightHandlerPositionPercent, 'interactionRightHandle');
406
- }
407
- // end update slider tooltip
408
-
409
- this.selectedInterval.start = leftHandlerPositionPercent;
410
- this.selectedInterval.end = rightHandlerPositionPercent;
411
- };
412
-
413
- return InteractionSlider;
414
- });
8
+ function(ManagedObject, KeyCodes, jQuery) {
9
+ 'use strict';
10
+ var InteractionSlider = ManagedObject.extend("sap.ui.core.support.controls.InteractionSlider", {
11
+ metadata: {
12
+ library: "sap.ui.core"
13
+ },
14
+ constructor: function () {
15
+ //this.SIDE_LIST_WIDTH = 250;
16
+ this.SIDE_LIST_WIDTH = 0;
17
+ this.LEFT_HANDLE_ID = 'left';
18
+ this.RIGHT_HANDLE_ID = 'right';
19
+ this.HANDLE_BORDER_SIZE = 0;
20
+ this.HANDLES_WIDTH = 3;
21
+
22
+ this.selectedInterval = {
23
+ start: 0,
24
+ end: 0,
25
+ duration: 0
26
+ };
27
+ this.nodes = {
28
+ slider: null,
29
+ handle: null,
30
+ leftResizeHandle: null,
31
+ rightResizeHandle: null
32
+ };
33
+ this.sizes = {
34
+ width: 0,
35
+ handleWidth: 0,
36
+ handleMinWidth: 10
37
+ };
38
+
39
+ this.drag = {
40
+ handleClickOffsetX: 0,
41
+ handleOffsetLeft: 0,
42
+ isResize: false,
43
+ whichResizeHandle: ''
44
+ };
45
+
46
+ this.fRefs = {
47
+ mousedown: undefined,
48
+ mousemove: undefined,
49
+ mouseup: undefined,
50
+ dragstart: undefined
51
+ };
52
+ }
53
+ });
54
+
55
+ InteractionSlider.prototype.render = function(rm) {
56
+ rm.openStart("div", "interactionSlider").openEnd()
57
+ .openStart("div", "interactionSlideHandle").openEnd()
58
+ .openStart("span", "interactionLeftHandle").openEnd().close("span")
59
+ .openStart("span", "interactionRightHandle").openEnd().close("span")
60
+ .close("div")
61
+ .close("div");
62
+
63
+ rm.openStart("div", "interactionSliderBottom").openEnd()
64
+ .openStart("div", "interactionSlideHandleBottom").openEnd()
65
+ .openStart("span", "interactionLeftHandleBottom").openEnd().close("span")
66
+ .openStart("span", "interactionRightHandleBottom").openEnd().close("span")
67
+ .close("div")
68
+ .close("div");
69
+ };
70
+
71
+ InteractionSlider.prototype.initialize = function () {
72
+ this._registerEventListeners();
73
+ this._initSlider();
74
+ };
75
+
76
+ InteractionSlider.prototype.setDuration = function(aMeasurements) {
77
+ if (!aMeasurements || !aMeasurements.length) {
78
+ return;
79
+ }
80
+
81
+ this.selectedInterval.duration = aMeasurements[aMeasurements.length - 1].end - aMeasurements[0].start;
82
+ };
83
+
84
+ InteractionSlider.prototype._registerEventListeners = function () {
85
+ var that = this;
86
+ window.addEventListener('resize', function () {
87
+ that._calculateSliderSize();
88
+ }, false);
89
+
90
+ window.addEventListener('keydown', this._onArrowMove.bind(this));
91
+ window.addEventListener('keyup', this._onArrowUp.bind(this));
92
+ jQuery("#interactionSlideHandle").on('dblclick', this._initSlider.bind(this));
93
+ jQuery("#interactionSlider").on('wheel', this._onMouseWheel.bind(this));
94
+ jQuery("#interactionSlideHandleBottom").on('dblclick', this._initSlider.bind(this));
95
+ jQuery("#interactionSliderBottom").on('wheel', this._onMouseWheel.bind(this));
96
+ };
97
+
98
+ InteractionSlider.prototype._initSlider = function () {
99
+ this.nodes.slider = this.nodes.slider || document.querySelector('#interactionSlider');
100
+ this.nodes.sliderBottom = this.nodes.sliderBottom || document.querySelector('#interactionSliderBottom');
101
+ this.nodes.handle = this.nodes.handle || document.querySelector('#interactionSlideHandle');
102
+ this.nodes.handleBottom = this.nodes.handleBottom || document.querySelector('#interactionSlideHandleBottom');
103
+ this.nodes.leftResizeHandle = this.nodes.leftResizeHandle || document.querySelector('#interactionLeftHandle');
104
+ this.nodes.leftResizeHandleBottom = this.nodes.leftResizeHandleBottom ||
105
+ document.querySelector('#interactionLeftHandleBottom');
106
+ this.nodes.rightResizeHandle = this.nodes.rightResizeHandle || document.querySelector('#interactionRightHandle');
107
+ this.nodes.rightResizeHandleBottom = this.nodes.rightResizeHandleBottom || document.querySelector('#interactionRightHandleBottom');
108
+
109
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left = 0;
110
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width = "100%";
111
+
112
+ //set the slider width
113
+ this._calculateSliderSize();
114
+
115
+ if (!this.fRefs.mousedown) {
116
+ this.fRefs.mousedown = this._onMouseDown.bind(this);
117
+ this.nodes.slider.addEventListener('mousedown', this.fRefs.mousedown);
118
+ this.nodes.sliderBottom.addEventListener('mousedown', this.fRefs.mousedown);
119
+ } else {
120
+ this._fireSelectEvent();
121
+ }
122
+ };
123
+
124
+ InteractionSlider.prototype._calculateSliderSize = function () {
125
+ if (this.nodes.handle == null || this.nodes.slider == null) {
126
+ return;
127
+ }
128
+ var oldSliderWidth = this.sizes.width;
129
+ this.sizes.handleWidth = parseInt(this._getSlideHandleWidth());
130
+ this.sizes.width = this.nodes.slider.offsetWidth;
131
+
132
+ if (this.sizes.width !== this.sizes.handleWidth) {
133
+ this._resizeSliderHandle(oldSliderWidth);
134
+ }
135
+ this._updateUI();
136
+ };
137
+
138
+ InteractionSlider.prototype._resizeSliderHandle = function (oldSliderWidth) {
139
+ var sliderWidthDifference = this.sizes.width - oldSliderWidth;
140
+ var upperWidthBound = this.sizes.width - this.drag.handleOffsetLeft;
141
+ var newHandleWidth = this.sizes.handleWidth + sliderWidthDifference;
142
+
143
+ this.sizes.handleWidth = Math.max(this.sizes.handleMinWidth, Math.min(newHandleWidth, upperWidthBound));
144
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width = this.sizes.handleWidth + 'px';
145
+
146
+ if (this.sizes.width < (this.drag.handleOffsetLeft + this.sizes.handleWidth)) {
147
+ this.drag.handleOffsetLeft = this.sizes.width - this.sizes.handleWidth;
148
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left = this.drag.handleOffsetLeft + 'px';
149
+ }
150
+ };
151
+
152
+ InteractionSlider.prototype._updateUI = function () {
153
+ this.sizes.handleWidth = parseInt(this._getSlideHandleWidth());
154
+ this.drag.handleOffsetLeft = this.nodes.handle.offsetLeft;
155
+ };
156
+
157
+ InteractionSlider.prototype._getSlideHandleWidth = function () {
158
+ return window.getComputedStyle(this.nodes.handle).width;
159
+ };
160
+
161
+ InteractionSlider.prototype._onArrowMove = function (evt) {
162
+ var offsetLeft = 0;
163
+ var STEP = 5;
164
+
165
+ if (evt.keyCode != KeyCodes.ARROW_LEFT && evt.keyCode != KeyCodes.ARROW_RIGHT) {
166
+ return;
167
+ } else if (evt.keyCode == KeyCodes.ARROW_LEFT) {
168
+ offsetLeft = -STEP;
169
+ } else if (evt.keyCode == KeyCodes.ARROW_RIGHT) {
170
+ offsetLeft = STEP;
171
+ }
172
+ var maxLeftOffset = Math.min((this.drag.handleOffsetLeft + offsetLeft),
173
+ this.sizes.width - this.sizes.handleWidth);
174
+
175
+ this.drag.handleOffsetLeft = Math.max(maxLeftOffset, 0);
176
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left = this.drag.handleOffsetLeft + 'px';
177
+ };
178
+
179
+ InteractionSlider.prototype._onArrowUp = function (evt) {
180
+ if (evt.keyCode != KeyCodes.ARROW_LEFT && evt.keyCode != KeyCodes.ARROW_RIGHT) {
181
+ return;
182
+ }
183
+ this._fireSelectEvent();
184
+ };
185
+
186
+ InteractionSlider.prototype._onMouseDown = function (evt) {
187
+ var targetId = evt.target.id;
188
+ var marginAndHalfOfSlideHandleWidth = this.SIDE_LIST_WIDTH + (this.sizes.handleWidth / 2);
189
+ var leftConstraint = Math.max(evt.clientX - marginAndHalfOfSlideHandleWidth, 0);
190
+ var rightConstraint = this.sizes.width - this.sizes.handleWidth;
191
+ var constrainedPosition = Math.min(leftConstraint, rightConstraint);
192
+
193
+ if (targetId === this.nodes.slider.id || targetId === this.nodes.sliderBottom.id) {
194
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left = constrainedPosition + 'px';
195
+ this.drag.handleOffsetLeft = this.nodes.handle.offsetLeft;
196
+ this.drag.isResize = false;
197
+ } else if (targetId === this.nodes.handle.id || targetId === this.nodes.handleBottom.id) {
198
+ this.drag.handleClickOffsetX = evt.offsetX;
199
+ this.drag.isResize = false;
200
+
201
+ this._registerOnMouseMoveListener();
202
+ } else if (targetId === this.nodes.leftResizeHandle.id || targetId === this.nodes.leftResizeHandleBottom.id) {
203
+ this.drag.whichResizeHandle = this.LEFT_HANDLE_ID;
204
+ this.drag.isResize = true;
205
+
206
+ this._registerOnMouseMoveListener();
207
+ } else if (targetId === this.nodes.rightResizeHandle.id || targetId === this.nodes.rightResizeHandleBottom.id) {
208
+ this.drag.whichResizeHandle = this.RIGHT_HANDLE_ID;
209
+ this.drag.isResize = true;
210
+
211
+ this._registerOnMouseMoveListener();
212
+ } else {
213
+ return;
214
+ }
215
+
216
+ this._registerOnMouseUpListener();
217
+ this._registerOnDragStartListener();
218
+ };
219
+
220
+ InteractionSlider.prototype._registerOnMouseMoveListener = function () {
221
+ this.fRefs.mousemove = this._onMouseMove.bind(this);
222
+ window.addEventListener('mousemove', this.fRefs.mousemove);
223
+ };
224
+
225
+ InteractionSlider.prototype._registerOnMouseUpListener = function () {
226
+ this.fRefs.mouseup = this._onMouseUp.bind(this);
227
+ window.addEventListener('mouseup', this.fRefs.mouseup);
228
+ };
229
+
230
+ InteractionSlider.prototype._registerOnDragStartListener = function () {
231
+ this.fRefs.dragstart = this._onDragStart.bind(this);
232
+ window.addEventListener('dragstart', this.fRefs.dragstart);
233
+ };
234
+
235
+ InteractionSlider.prototype._onMouseMove = function (evt) {
236
+ evt.stopImmediatePropagation();
237
+
238
+ var constraintDistance;
239
+ var distance = evt.clientX - this.SIDE_LIST_WIDTH;
240
+ if (this.drag.isResize) {
241
+ this._handleResize(evt);
242
+ return;
243
+ }
244
+
245
+ var rightBorder = this.sizes.width - this.sizes.handleWidth + this.drag.handleClickOffsetX;
246
+ constraintDistance = Math.max(Math.min(distance, rightBorder), this.drag.handleClickOffsetX);
247
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left =
248
+ constraintDistance - this.drag.handleClickOffsetX + 'px';
249
+ };
250
+
251
+ InteractionSlider.prototype._onMouseWheel = function (evt) {
252
+ evt.preventDefault();
253
+ this._handleMouseWheelResize(evt);
254
+ };
255
+
256
+ InteractionSlider.prototype._handleResize = function (evt) {
257
+ evt.stopImmediatePropagation();
258
+
259
+ var minWidth;
260
+ var maxWidth;
261
+ var newWidth;
262
+ var resizeDistance;
263
+ var rightConstraint;
264
+ var leftRightConstraints;
265
+ var clientX = evt.clientX - this.SIDE_LIST_WIDTH;
266
+ //var LEFT_DRAG_OFFSET_VALUE = 10;
267
+ var DRAG_OFFSET_VALUE = 3;
268
+
269
+ if (this.drag.whichResizeHandle === this.RIGHT_HANDLE_ID) {
270
+ resizeDistance = clientX - this.drag.handleOffsetLeft + DRAG_OFFSET_VALUE;
271
+ minWidth = Math.max(resizeDistance, this.sizes.handleMinWidth);
272
+ maxWidth = this.sizes.width - this.drag.handleOffsetLeft;
273
+
274
+ newWidth = Math.min(minWidth, maxWidth);
275
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width = newWidth + 'px';
276
+ }
277
+
278
+ if (this.drag.whichResizeHandle === this.LEFT_HANDLE_ID) {
279
+ minWidth = this.drag.handleOffsetLeft + this.sizes.handleWidth - this.sizes.handleMinWidth;
280
+ clientX = Math.max(Math.min(clientX, minWidth), 0);
281
+ maxWidth = this.drag.handleOffsetLeft + this.sizes.handleWidth;
282
+ rightConstraint = Math.min(clientX, this.sizes.width);
283
+ leftRightConstraints = Math.max(Math.max(rightConstraint, -2 * this.sizes.handleMinWidth),
284
+ DRAG_OFFSET_VALUE);
285
+ newWidth = maxWidth - leftRightConstraints + DRAG_OFFSET_VALUE;
286
+
287
+ if (newWidth <= DRAG_OFFSET_VALUE + this.sizes.handleMinWidth) {
288
+ newWidth -= DRAG_OFFSET_VALUE;
289
+ leftRightConstraints += DRAG_OFFSET_VALUE;
290
+ }
291
+
292
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left =
293
+ (leftRightConstraints - DRAG_OFFSET_VALUE) + 'px';
294
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width = newWidth + 'px';
295
+ }
296
+ };
297
+
298
+ InteractionSlider.prototype._handleMouseWheelResize = function (evt) {
299
+ var sizeChangeStep = 40;
300
+ if (evt.originalEvent.deltaY && evt.originalEvent.deltaY >= 0) {
301
+ this._calculateHandlerSizePositionOnMouseWheelDown(sizeChangeStep);
302
+ } else {
303
+ this._calculateHandlerSizePositionOnMouseWheelUp(sizeChangeStep);
304
+ }
305
+ this._updateUI();
306
+ this._fireSelectEvent();
307
+ };
308
+
309
+ InteractionSlider.prototype._calculateHandlerSizePositionOnMouseWheelDown = function (sizeChangeStep) {
310
+ var newLeftHandlerPosition;
311
+ var newWidth;
312
+ var rightHandlerMaxSizeLimit = this.sizes.width - this.drag.handleOffsetLeft;
313
+ var widthIncrease = Math.min((rightHandlerMaxSizeLimit - this.sizes.handleWidth), sizeChangeStep);
314
+ var rightHandlerInMaxRightPosition = (this.drag.handleOffsetLeft + this.sizes.handleWidth === this.sizes.width);
315
+
316
+ if ((widthIncrease < sizeChangeStep) && !rightHandlerInMaxRightPosition) {
317
+ newWidth = this.sizes.handleWidth + widthIncrease;
318
+ newLeftHandlerPosition = this.nodes.handle.offsetLeft;
319
+ } else if (rightHandlerInMaxRightPosition) {
320
+ var leftHandlerChangeStep = Math.min(this.sizes.width - this.sizes.handleWidth, sizeChangeStep);
321
+ newWidth = this.sizes.handleWidth + leftHandlerChangeStep;
322
+ newLeftHandlerPosition = Math.max(0, this.nodes.handle.offsetLeft - leftHandlerChangeStep);
323
+ } else {
324
+ newWidth = this.sizes.handleWidth + sizeChangeStep;
325
+ newLeftHandlerPosition = Math.max(0, this.nodes.handle.offsetLeft - (sizeChangeStep / 2));
326
+ }
327
+ this.nodes.handleBottom.style.left = this.nodes.handle.style.left = newLeftHandlerPosition + 'px';
328
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width = newWidth + 'px';
329
+ };
330
+
331
+ InteractionSlider.prototype._calculateHandlerSizePositionOnMouseWheelUp = function (sizeChangeStep) {
332
+ if (this.sizes.handleWidth - sizeChangeStep > this.sizes.handleMinWidth) {
333
+ this.nodes.handle.style.left = (this.nodes.handle.offsetLeft + (sizeChangeStep / 2)) + 'px';
334
+ this.nodes.handleBottom.style.left = (this.nodes.handleBottom.offsetLeft + (sizeChangeStep / 2)) + 'px';
335
+ this.nodes.handle.style.width = (this.sizes.handleWidth - sizeChangeStep) + 'px';
336
+ this.nodes.handleBottom.style.width = this.nodes.handle.style.width;
337
+ }
338
+ };
339
+
340
+ InteractionSlider.prototype._onMouseUp = function (evt) {
341
+ evt.stopImmediatePropagation();
342
+ window.removeEventListener('mousemove', this.fRefs.mousemove);
343
+ window.removeEventListener('mouseup', this.fRefs.mouseup);
344
+ window.removeEventListener('dragstart', this.fRefs.dragstart);
345
+ this._updateUI();
346
+ this._fireSelectEvent();
347
+ };
348
+
349
+ InteractionSlider.prototype._onDragStart = function (evt) {
350
+ evt.preventDefault();
351
+ };
352
+
353
+ InteractionSlider.prototype._fireSelectEvent = function () {
354
+ var oldStartInterval = this.selectedInterval.start;
355
+ var oldEndInterval = this.selectedInterval.end;
356
+ this._calculateStartEndPeriod();
357
+
358
+ if (oldStartInterval === this.selectedInterval.start && oldEndInterval == this.selectedInterval.end) {
359
+ return;
360
+ }
361
+
362
+ jQuery("#interactionSlider").trigger("InteractionSliderChange", [ this.selectedInterval.start, this.selectedInterval.end ]);
363
+ };
364
+
365
+
366
+ InteractionSlider.prototype._calculateStartEndPeriod = function () {
367
+ var sliderWidth = this.nodes.slider.offsetWidth;
368
+ var leftHandlerPosition = this.nodes.leftResizeHandle.getBoundingClientRect().left -
369
+ this.nodes.slider.getBoundingClientRect().left - this.HANDLE_BORDER_SIZE;
370
+ var rightHandlerPosition = this.nodes.rightResizeHandle.getBoundingClientRect().left -
371
+ this.nodes.slider.getBoundingClientRect().left + this.HANDLE_BORDER_SIZE + this.HANDLES_WIDTH;
372
+ var leftHandlerPositionPercent = leftHandlerPosition / sliderWidth;
373
+ var rightHandlerPositionPercent = rightHandlerPosition / sliderWidth,
374
+ that = this,
375
+ setTooltipText = function(handlerPosition, handlerId) {
376
+ var getTooltipText = function (handlerPosition) {
377
+ return "" + Math.round( handlerPosition * that.selectedInterval.duration / 10 ) / 100 + "s";
378
+ };
379
+ var sTooltip = getTooltipText(handlerPosition);
380
+
381
+ jQuery("#" + handlerId).attr('title', sTooltip);
382
+ jQuery("#" + handlerId + "Bottom").attr('title', sTooltip);
383
+ };
384
+
385
+ // update slider title before update the positions
386
+ if (leftHandlerPositionPercent != this.selectedInterval.start ) {
387
+ // left handler is moved
388
+ setTooltipText(leftHandlerPositionPercent, 'interactionLeftHandle');
389
+ }
390
+
391
+ if (rightHandlerPositionPercent != this.selectedInterval.end ) {
392
+ // right handler is moved
393
+ setTooltipText(rightHandlerPositionPercent, 'interactionRightHandle');
394
+ }
395
+ // end update slider tooltip
396
+
397
+ this.selectedInterval.start = leftHandlerPositionPercent;
398
+ this.selectedInterval.end = rightHandlerPositionPercent;
399
+ };
400
+
401
+ return InteractionSlider;
402
+ });