@zanichelli/albe-web-components 20.0.2 → 21.0.0-RC2

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 (406) hide show
  1. package/dist/cjs/dialog-polyfill.esm-D8Polhcd.js +863 -0
  2. package/dist/cjs/dialog-polyfill.esm-D8Polhcd.js.map +1 -0
  3. package/dist/cjs/hammer-CJF2Ixtg.js +2665 -0
  4. package/dist/cjs/hammer-CJF2Ixtg.js.map +1 -0
  5. package/dist/cjs/index-CZz7uP-M.js +6 -6
  6. package/dist/cjs/z-app-header_12.cjs.entry.js +7 -1
  7. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  8. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +8 -862
  9. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
  10. package/dist/cjs/z-toast-notification.cjs.entry.js +7 -2657
  11. package/dist/cjs/z-toast-notification.cjs.entry.js.map +1 -1
  12. package/dist/collection/components/z-input/index.js +7 -1
  13. package/dist/collection/components/z-input/index.js.map +1 -1
  14. package/dist/collection/components/z-modal/index.js +8 -6
  15. package/dist/collection/components/z-modal/index.js.map +1 -1
  16. package/dist/collection/components/z-toast-notification/index.js +7 -5
  17. package/dist/collection/components/z-toast-notification/index.js.map +1 -1
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/index.js.map +1 -1
  20. package/dist/components/{utils.js → p-8C_CrFxp.js} +3 -3
  21. package/dist/components/p-B3VFztJH.js +6 -0
  22. package/dist/components/p-B5U9pSXR.js +2 -0
  23. package/dist/components/{index14.js.map → p-B5U9pSXR.js.map} +1 -1
  24. package/dist/components/p-B6jtvVtV.js +2 -0
  25. package/dist/components/{utils2.js.map → p-B6jtvVtV.js.map} +1 -1
  26. package/dist/components/{_commonjsHelpers.js → p-B85MJLTf.js} +1 -1
  27. package/dist/components/p-BAguKZnb.js +2 -0
  28. package/dist/components/{index4.js.map → p-BAguKZnb.js.map} +1 -1
  29. package/dist/components/p-BRkq64wS.js +2 -0
  30. package/dist/components/p-BRkq64wS.js.map +1 -0
  31. package/dist/components/p-BeSVHdId.js +2 -0
  32. package/dist/components/{index9.js.map → p-BeSVHdId.js.map} +1 -1
  33. package/dist/components/p-Bj8MyegH.js +2 -0
  34. package/dist/components/{index18.js.map → p-Bj8MyegH.js.map} +1 -1
  35. package/dist/components/p-BoiZb7m1.js +2 -0
  36. package/dist/components/{index13.js.map → p-BoiZb7m1.js.map} +1 -1
  37. package/dist/components/p-BolVsvfr.js +2 -0
  38. package/dist/components/{index5.js.map → p-BolVsvfr.js.map} +1 -1
  39. package/dist/components/p-Bt1M0wUw.js +7 -0
  40. package/dist/components/p-Bt1M0wUw.js.map +1 -0
  41. package/dist/components/p-BvCsF6Eq.js +2 -0
  42. package/dist/components/p-BvCsF6Eq.js.map +1 -0
  43. package/dist/components/p-CGSP8diU.js +2 -0
  44. package/dist/components/{index15.js.map → p-CGSP8diU.js.map} +1 -1
  45. package/dist/components/p-CJjo0ntH.js +2 -0
  46. package/dist/components/{index12.js.map → p-CJjo0ntH.js.map} +1 -1
  47. package/dist/components/p-CaSvyuw6.js +2 -0
  48. package/dist/components/{index17.js.map → p-CaSvyuw6.js.map} +1 -1
  49. package/dist/components/p-CbXEdwLi.js +2 -0
  50. package/dist/components/{index3.js.map → p-CbXEdwLi.js.map} +1 -1
  51. package/dist/components/p-CdBqnUF6.js +2 -0
  52. package/dist/components/{index7.js.map → p-CdBqnUF6.js.map} +1 -1
  53. package/dist/components/p-Ch6o4_VN.js +2 -0
  54. package/dist/components/{index21.js.map → p-Ch6o4_VN.js.map} +1 -1
  55. package/dist/components/{iconset.js → p-D1c5gR45.js} +1 -1
  56. package/dist/components/p-D8wde41u.js +2 -0
  57. package/dist/components/{index16.js.map → p-D8wde41u.js.map} +1 -1
  58. package/dist/components/p-DL2QAfIP.js +2 -0
  59. package/dist/components/{index11.js.map → p-DL2QAfIP.js.map} +1 -1
  60. package/dist/components/{index2.js → p-DdetsoIY.js} +1 -1
  61. package/dist/components/p-LXvmZzZa.js +2 -0
  62. package/dist/components/p-LXvmZzZa.js.map +1 -0
  63. package/dist/components/{breakpoints.js → p-Q-tWjk7P.js} +1 -1
  64. package/dist/components/p-RmbDDbWd.js +2 -0
  65. package/dist/components/p-RmbDDbWd.js.map +1 -0
  66. package/dist/components/p-VP75-vje.js +2 -0
  67. package/dist/components/{index19.js.map → p-VP75-vje.js.map} +1 -1
  68. package/dist/components/p-cpTAMdcF.js +2 -0
  69. package/dist/components/{index8.js.map → p-cpTAMdcF.js.map} +1 -1
  70. package/dist/components/p-mphirYN3.js +2 -0
  71. package/dist/components/{index10.js.map → p-mphirYN3.js.map} +1 -1
  72. package/dist/components/z-accordion.js +1 -1
  73. package/dist/components/z-accordion.js.map +1 -1
  74. package/dist/components/z-anchor-navigation.js +1 -1
  75. package/dist/components/z-anchor-navigation.js.map +1 -1
  76. package/dist/components/z-app-header.js +1 -1
  77. package/dist/components/z-app-header.js.map +1 -1
  78. package/dist/components/z-aria-alert.js +1 -1
  79. package/dist/components/z-aria-alert.js.map +1 -1
  80. package/dist/components/z-avatar.js +1 -1
  81. package/dist/components/z-avatar.js.map +1 -1
  82. package/dist/components/z-book-card-app.js +1 -1
  83. package/dist/components/z-book-card-app.js.map +1 -1
  84. package/dist/components/z-book-card.js +1 -1
  85. package/dist/components/z-book-card.js.map +1 -1
  86. package/dist/components/z-book-cover.js +1 -1
  87. package/dist/components/z-breadcrumb.js +1 -1
  88. package/dist/components/z-breadcrumb.js.map +1 -1
  89. package/dist/components/z-button-sort.js +1 -1
  90. package/dist/components/z-button-sort.js.map +1 -1
  91. package/dist/components/z-button.js +1 -1
  92. package/dist/components/z-card.js +1 -1
  93. package/dist/components/z-card.js.map +1 -1
  94. package/dist/components/z-carousel.js +1 -1
  95. package/dist/components/z-carousel.js.map +1 -1
  96. package/dist/components/z-chip.js +1 -1
  97. package/dist/components/z-color-picker.js +1 -1
  98. package/dist/components/z-color-picker.js.map +1 -1
  99. package/dist/components/z-combobox.js +1 -1
  100. package/dist/components/z-combobox.js.map +1 -1
  101. package/dist/components/z-cover-hero.js +1 -1
  102. package/dist/components/z-cover-hero.js.map +1 -1
  103. package/dist/components/z-date-picker.js +2 -2
  104. package/dist/components/z-date-picker.js.map +1 -1
  105. package/dist/components/z-divider.js +1 -1
  106. package/dist/components/z-dragdrop-area.js +1 -1
  107. package/dist/components/z-file-upload.js +1 -1
  108. package/dist/components/z-file-upload.js.map +1 -1
  109. package/dist/components/z-file.js +1 -1
  110. package/dist/components/z-file.js.map +1 -1
  111. package/dist/components/z-ghost-loading.js +1 -1
  112. package/dist/components/z-icon.js +1 -1
  113. package/dist/components/z-info-box.js +1 -1
  114. package/dist/components/z-info-box.js.map +1 -1
  115. package/dist/components/z-info-reveal.js +1 -1
  116. package/dist/components/z-input-message.js +1 -1
  117. package/dist/components/z-input-range.js +1 -1
  118. package/dist/components/z-input-range.js.map +1 -1
  119. package/dist/components/z-input.js +1 -1
  120. package/dist/components/z-list-element.js +1 -1
  121. package/dist/components/z-list-group.js +1 -1
  122. package/dist/components/z-list.js +1 -1
  123. package/dist/components/z-logo.js +1 -1
  124. package/dist/components/z-logo.js.map +1 -1
  125. package/dist/components/z-menu-section.js +1 -1
  126. package/dist/components/z-menu-section.js.map +1 -1
  127. package/dist/components/z-menu.js +1 -1
  128. package/dist/components/z-menu.js.map +1 -1
  129. package/dist/components/z-modal.js +1 -1
  130. package/dist/components/z-navigation-tabs.js +1 -1
  131. package/dist/components/z-navigation-tabs.js.map +1 -1
  132. package/dist/components/z-notification.js +1 -1
  133. package/dist/components/z-notification.js.map +1 -1
  134. package/dist/components/z-offcanvas.js +1 -1
  135. package/dist/components/z-pagination.js +1 -1
  136. package/dist/components/z-pagination.js.map +1 -1
  137. package/dist/components/z-popover.js +1 -1
  138. package/dist/components/z-range-picker.js +1 -1
  139. package/dist/components/z-range-picker.js.map +1 -1
  140. package/dist/components/z-result-card.js +1 -1
  141. package/dist/components/z-result-card.js.map +1 -1
  142. package/dist/components/z-searchbar.js +1 -1
  143. package/dist/components/z-select.js +1 -1
  144. package/dist/components/z-select.js.map +1 -1
  145. package/dist/components/z-skip-to-content.js +1 -1
  146. package/dist/components/z-skip-to-content.js.map +1 -1
  147. package/dist/components/z-stepper-item.js +1 -1
  148. package/dist/components/z-stepper-item.js.map +1 -1
  149. package/dist/components/z-stepper.js +1 -1
  150. package/dist/components/z-stepper.js.map +1 -1
  151. package/dist/components/z-table.js +1 -1
  152. package/dist/components/z-table.js.map +1 -1
  153. package/dist/components/z-tag.js +1 -1
  154. package/dist/components/z-tbody.js +1 -1
  155. package/dist/components/z-tbody.js.map +1 -1
  156. package/dist/components/z-td.js +1 -1
  157. package/dist/components/z-td.js.map +1 -1
  158. package/dist/components/z-tfoot.js +1 -1
  159. package/dist/components/z-tfoot.js.map +1 -1
  160. package/dist/components/z-th.js +1 -1
  161. package/dist/components/z-th.js.map +1 -1
  162. package/dist/components/z-thead.js +1 -1
  163. package/dist/components/z-thead.js.map +1 -1
  164. package/dist/components/z-toast-notification-list.js +1 -1
  165. package/dist/components/z-toast-notification-list.js.map +1 -1
  166. package/dist/components/z-toast-notification.js +2 -7
  167. package/dist/components/z-toast-notification.js.map +1 -1
  168. package/dist/components/z-toggle-switch.js +1 -1
  169. package/dist/components/z-toggle-switch.js.map +1 -1
  170. package/dist/components/z-tool.js +1 -1
  171. package/dist/components/z-tool.js.map +1 -1
  172. package/dist/components/z-toolbar.js +1 -1
  173. package/dist/components/z-toolbar.js.map +1 -1
  174. package/dist/components/z-tooltip.js +1 -1
  175. package/dist/components/z-tr.js +1 -1
  176. package/dist/components/z-tr.js.map +1 -1
  177. package/dist/components/z-tree-list.js +1 -1
  178. package/dist/components/z-tree-list.js.map +1 -1
  179. package/dist/components/z-visually-hidden.js +1 -1
  180. package/dist/components/z-visually-hidden.js.map +1 -1
  181. package/dist/esm/dialog-polyfill.esm-BRkq64wS.js +861 -0
  182. package/dist/esm/dialog-polyfill.esm-BRkq64wS.js.map +1 -0
  183. package/dist/esm/hammer-C3JqVNyx.js +2663 -0
  184. package/dist/esm/hammer-C3JqVNyx.js.map +1 -0
  185. package/dist/esm/index-BcDWN4F1.js +6 -6
  186. package/dist/esm/z-app-header_12.entry.js +7 -1
  187. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  188. package/dist/esm/z-dragdrop-area_2.entry.js +8 -862
  189. package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
  190. package/dist/esm/z-toast-notification.entry.js +7 -2657
  191. package/dist/esm/z-toast-notification.entry.js.map +1 -1
  192. package/dist/types/components/z-input/index.d.ts +1 -0
  193. package/dist/types/components/z-modal/index.d.ts +1 -1
  194. package/dist/web-components-library/p-67051e01.entry.js +3 -0
  195. package/dist/web-components-library/p-67051e01.entry.js.map +1 -0
  196. package/dist/web-components-library/p-BRkq64wS.js +2 -0
  197. package/dist/web-components-library/p-BRkq64wS.js.map +1 -0
  198. package/dist/web-components-library/p-Bt1M0wUw.js +7 -0
  199. package/dist/web-components-library/p-Bt1M0wUw.js.map +1 -0
  200. package/dist/web-components-library/p-c3f69ac9.entry.js +2 -0
  201. package/dist/web-components-library/p-c3f69ac9.entry.js.map +1 -0
  202. package/dist/web-components-library/p-e2eea612.entry.js +2 -0
  203. package/dist/web-components-library/p-e2eea612.entry.js.map +1 -0
  204. package/dist/web-components-library/web-components-library.esm.js +1 -1
  205. package/package.json +9 -4
  206. package/react/components.d.ts +68 -66
  207. package/react/components.js +134 -69
  208. package/react/z-accordion.d.ts +12 -0
  209. package/react/z-accordion.js +18 -0
  210. package/react/z-anchor-navigation.d.ts +9 -0
  211. package/react/z-anchor-navigation.js +18 -0
  212. package/react/z-app-header.d.ts +12 -0
  213. package/react/z-app-header.js +18 -0
  214. package/react/z-aria-alert.d.ts +9 -0
  215. package/react/z-aria-alert.js +18 -0
  216. package/react/z-avatar.d.ts +9 -0
  217. package/react/z-avatar.js +18 -0
  218. package/react/z-book-card-app.d.ts +12 -0
  219. package/react/z-book-card-app.js +18 -0
  220. package/react/z-book-card.d.ts +14 -0
  221. package/react/z-book-card.js +22 -0
  222. package/react/z-book-cover.d.ts +9 -0
  223. package/react/z-book-cover.js +18 -0
  224. package/react/z-breadcrumb.d.ts +12 -0
  225. package/react/z-breadcrumb.js +18 -0
  226. package/react/z-button-sort.d.ts +12 -0
  227. package/react/z-button-sort.js +18 -0
  228. package/react/z-button.d.ts +9 -0
  229. package/react/z-button.js +18 -0
  230. package/react/z-card.d.ts +9 -0
  231. package/react/z-card.js +18 -0
  232. package/react/z-carousel.d.ts +14 -0
  233. package/react/z-carousel.js +18 -0
  234. package/react/z-chip.d.ts +12 -0
  235. package/react/z-chip.js +18 -0
  236. package/react/z-color-picker.d.ts +12 -0
  237. package/react/z-color-picker.js +18 -0
  238. package/react/z-combobox.d.ts +12 -0
  239. package/react/z-combobox.js +18 -0
  240. package/react/z-cover-hero.d.ts +9 -0
  241. package/react/z-cover-hero.js +18 -0
  242. package/react/z-date-picker.d.ts +12 -0
  243. package/react/z-date-picker.js +18 -0
  244. package/react/z-divider.d.ts +9 -0
  245. package/react/z-divider.js +18 -0
  246. package/react/z-dragdrop-area.d.ts +12 -0
  247. package/react/z-dragdrop-area.js +18 -0
  248. package/react/z-file-upload.d.ts +16 -0
  249. package/react/z-file-upload.js +21 -0
  250. package/react/z-file.d.ts +12 -0
  251. package/react/z-file.js +18 -0
  252. package/react/z-ghost-loading.d.ts +9 -0
  253. package/react/z-ghost-loading.js +18 -0
  254. package/react/z-icon.d.ts +9 -0
  255. package/react/z-icon.js +18 -0
  256. package/react/z-info-box.d.ts +14 -0
  257. package/react/z-info-box.js +18 -0
  258. package/react/z-info-reveal.d.ts +9 -0
  259. package/react/z-info-reveal.js +18 -0
  260. package/react/z-input-message.d.ts +9 -0
  261. package/react/z-input-message.js +18 -0
  262. package/react/z-input-range.d.ts +13 -0
  263. package/react/z-input-range.js +21 -0
  264. package/react/z-input.d.ts +17 -0
  265. package/react/z-input.js +25 -0
  266. package/react/z-list-element.d.ts +14 -0
  267. package/react/z-list-element.js +22 -0
  268. package/react/z-list-group.d.ts +9 -0
  269. package/react/z-list-group.js +18 -0
  270. package/react/z-list.d.ts +9 -0
  271. package/react/z-list.js +18 -0
  272. package/react/z-logo.d.ts +9 -0
  273. package/react/z-logo.js +18 -0
  274. package/react/z-menu-section.d.ts +13 -0
  275. package/react/z-menu-section.js +21 -0
  276. package/react/z-menu.d.ts +13 -0
  277. package/react/z-menu.js +21 -0
  278. package/react/z-modal.d.ts +14 -0
  279. package/react/z-modal.js +22 -0
  280. package/react/z-navigation-tabs.d.ts +12 -0
  281. package/react/z-navigation-tabs.js +18 -0
  282. package/react/z-notification.d.ts +13 -0
  283. package/react/z-notification.js +21 -0
  284. package/react/z-offcanvas.d.ts +12 -0
  285. package/react/z-offcanvas.js +18 -0
  286. package/react/z-pagination.d.ts +12 -0
  287. package/react/z-pagination.js +18 -0
  288. package/react/z-popover.d.ts +17 -0
  289. package/react/z-popover.js +21 -0
  290. package/react/z-range-picker.d.ts +12 -0
  291. package/react/z-range-picker.js +18 -0
  292. package/react/z-result-card.d.ts +9 -0
  293. package/react/z-result-card.js +18 -0
  294. package/react/z-searchbar.d.ts +14 -0
  295. package/react/z-searchbar.js +22 -0
  296. package/react/z-select.d.ts +13 -0
  297. package/react/z-select.js +21 -0
  298. package/react/z-skip-to-content.d.ts +9 -0
  299. package/react/z-skip-to-content.js +18 -0
  300. package/react/z-stepper-item.d.ts +9 -0
  301. package/react/z-stepper-item.js +18 -0
  302. package/react/z-stepper.d.ts +9 -0
  303. package/react/z-stepper.js +18 -0
  304. package/react/z-table.d.ts +9 -0
  305. package/react/z-table.js +18 -0
  306. package/react/z-tag.d.ts +9 -0
  307. package/react/z-tag.js +18 -0
  308. package/react/z-tbody.d.ts +9 -0
  309. package/react/z-tbody.js +18 -0
  310. package/react/z-td.d.ts +12 -0
  311. package/react/z-td.js +18 -0
  312. package/react/z-tfoot.d.ts +9 -0
  313. package/react/z-tfoot.js +18 -0
  314. package/react/z-th.d.ts +12 -0
  315. package/react/z-th.js +18 -0
  316. package/react/z-thead.d.ts +9 -0
  317. package/react/z-thead.js +18 -0
  318. package/react/z-toast-notification-list.d.ts +9 -0
  319. package/react/z-toast-notification-list.js +18 -0
  320. package/react/z-toast-notification.d.ts +12 -0
  321. package/react/z-toast-notification.js +18 -0
  322. package/react/z-toggle-switch.d.ts +12 -0
  323. package/react/z-toggle-switch.js +18 -0
  324. package/react/z-tool.d.ts +13 -0
  325. package/react/z-tool.js +21 -0
  326. package/react/z-toolbar.d.ts +9 -0
  327. package/react/z-toolbar.js +18 -0
  328. package/react/z-tooltip.d.ts +14 -0
  329. package/react/z-tooltip.js +18 -0
  330. package/react/z-tr.d.ts +12 -0
  331. package/react/z-tr.js +18 -0
  332. package/react/z-tree-list.d.ts +16 -0
  333. package/react/z-tree-list.js +18 -0
  334. package/react/z-visually-hidden.d.ts +9 -0
  335. package/react/z-visually-hidden.js +18 -0
  336. package/readme.md +7 -4
  337. package/www/build/{p-9a93e186.js → p-3ddbf8a7.js} +1 -1
  338. package/www/build/p-67051e01.entry.js +3 -0
  339. package/www/build/p-67051e01.entry.js.map +1 -0
  340. package/www/build/p-BRkq64wS.js +2 -0
  341. package/www/build/p-BRkq64wS.js.map +1 -0
  342. package/www/build/p-Bt1M0wUw.js +7 -0
  343. package/www/build/p-Bt1M0wUw.js.map +1 -0
  344. package/www/build/p-c3f69ac9.entry.js +2 -0
  345. package/www/build/p-c3f69ac9.entry.js.map +1 -0
  346. package/www/build/p-e2eea612.entry.js +2 -0
  347. package/www/build/p-e2eea612.entry.js.map +1 -0
  348. package/www/build/web-components-library.esm.js +1 -1
  349. package/www/index.html +1 -1
  350. package/dist/components/index10.js +0 -2
  351. package/dist/components/index11.js +0 -2
  352. package/dist/components/index12.js +0 -2
  353. package/dist/components/index13.js +0 -2
  354. package/dist/components/index14.js +0 -2
  355. package/dist/components/index15.js +0 -2
  356. package/dist/components/index16.js +0 -2
  357. package/dist/components/index17.js +0 -2
  358. package/dist/components/index18.js +0 -2
  359. package/dist/components/index19.js +0 -2
  360. package/dist/components/index20.js +0 -2
  361. package/dist/components/index20.js.map +0 -1
  362. package/dist/components/index21.js +0 -2
  363. package/dist/components/index3.js +0 -2
  364. package/dist/components/index4.js +0 -2
  365. package/dist/components/index5.js +0 -2
  366. package/dist/components/index6.js +0 -2
  367. package/dist/components/index6.js.map +0 -1
  368. package/dist/components/index7.js +0 -2
  369. package/dist/components/index8.js +0 -2
  370. package/dist/components/index9.js +0 -2
  371. package/dist/components/reactive-controller.js +0 -6
  372. package/dist/components/utils2.js +0 -2
  373. package/dist/web-components-library/p-1fad41b2.entry.js +0 -2
  374. package/dist/web-components-library/p-1fad41b2.entry.js.map +0 -1
  375. package/dist/web-components-library/p-baa35a6e.entry.js +0 -2
  376. package/dist/web-components-library/p-baa35a6e.entry.js.map +0 -1
  377. package/dist/web-components-library/p-ea96790b.entry.js +0 -8
  378. package/dist/web-components-library/p-ea96790b.entry.js.map +0 -1
  379. package/react/react-component-lib/createComponent.d.ts +0 -10
  380. package/react/react-component-lib/createComponent.js +0 -101
  381. package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
  382. package/react/react-component-lib/createOverlayComponent.js +0 -115
  383. package/react/react-component-lib/index.d.ts +0 -2
  384. package/react/react-component-lib/index.js +0 -7
  385. package/react/react-component-lib/interfaces.d.ts +0 -29
  386. package/react/react-component-lib/interfaces.js +0 -2
  387. package/react/react-component-lib/utils/attachProps.d.ts +0 -16
  388. package/react/react-component-lib/utils/attachProps.js +0 -115
  389. package/react/react-component-lib/utils/case.d.ts +0 -2
  390. package/react/react-component-lib/utils/case.js +0 -11
  391. package/react/react-component-lib/utils/dev.d.ts +0 -2
  392. package/react/react-component-lib/utils/dev.js +0 -17
  393. package/react/react-component-lib/utils/index.d.ts +0 -10
  394. package/react/react-component-lib/utils/index.js +0 -55
  395. package/www/build/p-1fad41b2.entry.js +0 -2
  396. package/www/build/p-1fad41b2.entry.js.map +0 -1
  397. package/www/build/p-baa35a6e.entry.js +0 -2
  398. package/www/build/p-baa35a6e.entry.js.map +0 -1
  399. package/www/build/p-ea96790b.entry.js +0 -8
  400. package/www/build/p-ea96790b.entry.js.map +0 -1
  401. /package/dist/components/{utils.js.map → p-8C_CrFxp.js.map} +0 -0
  402. /package/dist/components/{reactive-controller.js.map → p-B3VFztJH.js.map} +0 -0
  403. /package/dist/components/{_commonjsHelpers.js.map → p-B85MJLTf.js.map} +0 -0
  404. /package/dist/components/{iconset.js.map → p-D1c5gR45.js.map} +0 -0
  405. /package/dist/components/{index2.js.map → p-DdetsoIY.js.map} +0 -0
  406. /package/dist/components/{breakpoints.js.map → p-Q-tWjk7P.js.map} +0 -0
@@ -0,0 +1,2663 @@
1
+ import { g as getDefaultExportFromCjs } from './_commonjsHelpers-B85MJLTf.js';
2
+
3
+ var hammer$2 = {exports: {}};
4
+
5
+ /*! Hammer.JS - v2.0.7 - 2016-04-22
6
+ * http://hammerjs.github.io/
7
+ *
8
+ * Copyright (c) 2016 Jorik Tangelder;
9
+ * Licensed under the MIT license */
10
+
11
+ var hasRequiredHammer;
12
+
13
+ function requireHammer () {
14
+ if (hasRequiredHammer) return hammer$2.exports;
15
+ hasRequiredHammer = 1;
16
+ (function (module) {
17
+ (function(window, document, exportName, undefined$1) {
18
+
19
+ var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
20
+ var TEST_ELEMENT = document.createElement('div');
21
+
22
+ var TYPE_FUNCTION = 'function';
23
+
24
+ var round = Math.round;
25
+ var abs = Math.abs;
26
+ var now = Date.now;
27
+
28
+ /**
29
+ * set a timeout with a given scope
30
+ * @param {Function} fn
31
+ * @param {Number} timeout
32
+ * @param {Object} context
33
+ * @returns {number}
34
+ */
35
+ function setTimeoutContext(fn, timeout, context) {
36
+ return setTimeout(bindFn(fn, context), timeout);
37
+ }
38
+
39
+ /**
40
+ * if the argument is an array, we want to execute the fn on each entry
41
+ * if it aint an array we don't want to do a thing.
42
+ * this is used by all the methods that accept a single and array argument.
43
+ * @param {*|Array} arg
44
+ * @param {String} fn
45
+ * @param {Object} [context]
46
+ * @returns {Boolean}
47
+ */
48
+ function invokeArrayArg(arg, fn, context) {
49
+ if (Array.isArray(arg)) {
50
+ each(arg, context[fn], context);
51
+ return true;
52
+ }
53
+ return false;
54
+ }
55
+
56
+ /**
57
+ * walk objects and arrays
58
+ * @param {Object} obj
59
+ * @param {Function} iterator
60
+ * @param {Object} context
61
+ */
62
+ function each(obj, iterator, context) {
63
+ var i;
64
+
65
+ if (!obj) {
66
+ return;
67
+ }
68
+
69
+ if (obj.forEach) {
70
+ obj.forEach(iterator, context);
71
+ } else if (obj.length !== undefined$1) {
72
+ i = 0;
73
+ while (i < obj.length) {
74
+ iterator.call(context, obj[i], i, obj);
75
+ i++;
76
+ }
77
+ } else {
78
+ for (i in obj) {
79
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * wrap a method with a deprecation warning and stack trace
86
+ * @param {Function} method
87
+ * @param {String} name
88
+ * @param {String} message
89
+ * @returns {Function} A new function wrapping the supplied method.
90
+ */
91
+ function deprecate(method, name, message) {
92
+ var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
93
+ return function() {
94
+ var e = new Error('get-stack-trace');
95
+ var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
96
+ .replace(/^\s+at\s+/gm, '')
97
+ .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
98
+
99
+ var log = window.console && (window.console.warn || window.console.log);
100
+ if (log) {
101
+ log.call(window.console, deprecationMessage, stack);
102
+ }
103
+ return method.apply(this, arguments);
104
+ };
105
+ }
106
+
107
+ /**
108
+ * extend object.
109
+ * means that properties in dest will be overwritten by the ones in src.
110
+ * @param {Object} target
111
+ * @param {...Object} objects_to_assign
112
+ * @returns {Object} target
113
+ */
114
+ var assign;
115
+ if (typeof Object.assign !== 'function') {
116
+ assign = function assign(target) {
117
+ if (target === undefined$1 || target === null) {
118
+ throw new TypeError('Cannot convert undefined or null to object');
119
+ }
120
+
121
+ var output = Object(target);
122
+ for (var index = 1; index < arguments.length; index++) {
123
+ var source = arguments[index];
124
+ if (source !== undefined$1 && source !== null) {
125
+ for (var nextKey in source) {
126
+ if (source.hasOwnProperty(nextKey)) {
127
+ output[nextKey] = source[nextKey];
128
+ }
129
+ }
130
+ }
131
+ }
132
+ return output;
133
+ };
134
+ } else {
135
+ assign = Object.assign;
136
+ }
137
+
138
+ /**
139
+ * extend object.
140
+ * means that properties in dest will be overwritten by the ones in src.
141
+ * @param {Object} dest
142
+ * @param {Object} src
143
+ * @param {Boolean} [merge=false]
144
+ * @returns {Object} dest
145
+ */
146
+ var extend = deprecate(function extend(dest, src, merge) {
147
+ var keys = Object.keys(src);
148
+ var i = 0;
149
+ while (i < keys.length) {
150
+ if (!merge || (merge && dest[keys[i]] === undefined$1)) {
151
+ dest[keys[i]] = src[keys[i]];
152
+ }
153
+ i++;
154
+ }
155
+ return dest;
156
+ }, 'extend', 'Use `assign`.');
157
+
158
+ /**
159
+ * merge the values from src in the dest.
160
+ * means that properties that exist in dest will not be overwritten by src
161
+ * @param {Object} dest
162
+ * @param {Object} src
163
+ * @returns {Object} dest
164
+ */
165
+ var merge = deprecate(function merge(dest, src) {
166
+ return extend(dest, src, true);
167
+ }, 'merge', 'Use `assign`.');
168
+
169
+ /**
170
+ * simple class inheritance
171
+ * @param {Function} child
172
+ * @param {Function} base
173
+ * @param {Object} [properties]
174
+ */
175
+ function inherit(child, base, properties) {
176
+ var baseP = base.prototype,
177
+ childP;
178
+
179
+ childP = child.prototype = Object.create(baseP);
180
+ childP.constructor = child;
181
+ childP._super = baseP;
182
+
183
+ if (properties) {
184
+ assign(childP, properties);
185
+ }
186
+ }
187
+
188
+ /**
189
+ * simple function bind
190
+ * @param {Function} fn
191
+ * @param {Object} context
192
+ * @returns {Function}
193
+ */
194
+ function bindFn(fn, context) {
195
+ return function boundFn() {
196
+ return fn.apply(context, arguments);
197
+ };
198
+ }
199
+
200
+ /**
201
+ * let a boolean value also be a function that must return a boolean
202
+ * this first item in args will be used as the context
203
+ * @param {Boolean|Function} val
204
+ * @param {Array} [args]
205
+ * @returns {Boolean}
206
+ */
207
+ function boolOrFn(val, args) {
208
+ if (typeof val == TYPE_FUNCTION) {
209
+ return val.apply(args ? args[0] || undefined$1 : undefined$1, args);
210
+ }
211
+ return val;
212
+ }
213
+
214
+ /**
215
+ * use the val2 when val1 is undefined
216
+ * @param {*} val1
217
+ * @param {*} val2
218
+ * @returns {*}
219
+ */
220
+ function ifUndefined(val1, val2) {
221
+ return (val1 === undefined$1) ? val2 : val1;
222
+ }
223
+
224
+ /**
225
+ * addEventListener with multiple events at once
226
+ * @param {EventTarget} target
227
+ * @param {String} types
228
+ * @param {Function} handler
229
+ */
230
+ function addEventListeners(target, types, handler) {
231
+ each(splitStr(types), function(type) {
232
+ target.addEventListener(type, handler, false);
233
+ });
234
+ }
235
+
236
+ /**
237
+ * removeEventListener with multiple events at once
238
+ * @param {EventTarget} target
239
+ * @param {String} types
240
+ * @param {Function} handler
241
+ */
242
+ function removeEventListeners(target, types, handler) {
243
+ each(splitStr(types), function(type) {
244
+ target.removeEventListener(type, handler, false);
245
+ });
246
+ }
247
+
248
+ /**
249
+ * find if a node is in the given parent
250
+ * @method hasParent
251
+ * @param {HTMLElement} node
252
+ * @param {HTMLElement} parent
253
+ * @return {Boolean} found
254
+ */
255
+ function hasParent(node, parent) {
256
+ while (node) {
257
+ if (node == parent) {
258
+ return true;
259
+ }
260
+ node = node.parentNode;
261
+ }
262
+ return false;
263
+ }
264
+
265
+ /**
266
+ * small indexOf wrapper
267
+ * @param {String} str
268
+ * @param {String} find
269
+ * @returns {Boolean} found
270
+ */
271
+ function inStr(str, find) {
272
+ return str.indexOf(find) > -1;
273
+ }
274
+
275
+ /**
276
+ * split string on whitespace
277
+ * @param {String} str
278
+ * @returns {Array} words
279
+ */
280
+ function splitStr(str) {
281
+ return str.trim().split(/\s+/g);
282
+ }
283
+
284
+ /**
285
+ * find if a array contains the object using indexOf or a simple polyFill
286
+ * @param {Array} src
287
+ * @param {String} find
288
+ * @param {String} [findByKey]
289
+ * @return {Boolean|Number} false when not found, or the index
290
+ */
291
+ function inArray(src, find, findByKey) {
292
+ if (src.indexOf && !findByKey) {
293
+ return src.indexOf(find);
294
+ } else {
295
+ var i = 0;
296
+ while (i < src.length) {
297
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
298
+ return i;
299
+ }
300
+ i++;
301
+ }
302
+ return -1;
303
+ }
304
+ }
305
+
306
+ /**
307
+ * convert array-like objects to real arrays
308
+ * @param {Object} obj
309
+ * @returns {Array}
310
+ */
311
+ function toArray(obj) {
312
+ return Array.prototype.slice.call(obj, 0);
313
+ }
314
+
315
+ /**
316
+ * unique array with objects based on a key (like 'id') or just by the array's value
317
+ * @param {Array} src [{id:1},{id:2},{id:1}]
318
+ * @param {String} [key]
319
+ * @param {Boolean} [sort=False]
320
+ * @returns {Array} [{id:1},{id:2}]
321
+ */
322
+ function uniqueArray(src, key, sort) {
323
+ var results = [];
324
+ var values = [];
325
+ var i = 0;
326
+
327
+ while (i < src.length) {
328
+ var val = src[i][key] ;
329
+ if (inArray(values, val) < 0) {
330
+ results.push(src[i]);
331
+ }
332
+ values[i] = val;
333
+ i++;
334
+ }
335
+
336
+ {
337
+ {
338
+ results = results.sort(function sortUniqueArray(a, b) {
339
+ return a[key] > b[key];
340
+ });
341
+ }
342
+ }
343
+
344
+ return results;
345
+ }
346
+
347
+ /**
348
+ * get the prefixed property
349
+ * @param {Object} obj
350
+ * @param {String} property
351
+ * @returns {String|Undefined} prefixed
352
+ */
353
+ function prefixed(obj, property) {
354
+ var prefix, prop;
355
+ var camelProp = property[0].toUpperCase() + property.slice(1);
356
+
357
+ var i = 0;
358
+ while (i < VENDOR_PREFIXES.length) {
359
+ prefix = VENDOR_PREFIXES[i];
360
+ prop = (prefix) ? prefix + camelProp : property;
361
+
362
+ if (prop in obj) {
363
+ return prop;
364
+ }
365
+ i++;
366
+ }
367
+ return undefined$1;
368
+ }
369
+
370
+ /**
371
+ * get a unique id
372
+ * @returns {number} uniqueId
373
+ */
374
+ var _uniqueId = 1;
375
+ function uniqueId() {
376
+ return _uniqueId++;
377
+ }
378
+
379
+ /**
380
+ * get the window object of an element
381
+ * @param {HTMLElement} element
382
+ * @returns {DocumentView|Window}
383
+ */
384
+ function getWindowForElement(element) {
385
+ var doc = element.ownerDocument || element;
386
+ return (doc.defaultView || doc.parentWindow || window);
387
+ }
388
+
389
+ var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
390
+
391
+ var SUPPORT_TOUCH = ('ontouchstart' in window);
392
+ var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined$1;
393
+ var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
394
+
395
+ var INPUT_TYPE_TOUCH = 'touch';
396
+ var INPUT_TYPE_PEN = 'pen';
397
+ var INPUT_TYPE_MOUSE = 'mouse';
398
+ var INPUT_TYPE_KINECT = 'kinect';
399
+
400
+ var COMPUTE_INTERVAL = 25;
401
+
402
+ var INPUT_START = 1;
403
+ var INPUT_MOVE = 2;
404
+ var INPUT_END = 4;
405
+ var INPUT_CANCEL = 8;
406
+
407
+ var DIRECTION_NONE = 1;
408
+ var DIRECTION_LEFT = 2;
409
+ var DIRECTION_RIGHT = 4;
410
+ var DIRECTION_UP = 8;
411
+ var DIRECTION_DOWN = 16;
412
+
413
+ var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
414
+ var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
415
+ var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
416
+
417
+ var PROPS_XY = ['x', 'y'];
418
+ var PROPS_CLIENT_XY = ['clientX', 'clientY'];
419
+
420
+ /**
421
+ * create new input type manager
422
+ * @param {Manager} manager
423
+ * @param {Function} callback
424
+ * @returns {Input}
425
+ * @constructor
426
+ */
427
+ function Input(manager, callback) {
428
+ var self = this;
429
+ this.manager = manager;
430
+ this.callback = callback;
431
+ this.element = manager.element;
432
+ this.target = manager.options.inputTarget;
433
+
434
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
435
+ // so when disabled the input events are completely bypassed.
436
+ this.domHandler = function(ev) {
437
+ if (boolOrFn(manager.options.enable, [manager])) {
438
+ self.handler(ev);
439
+ }
440
+ };
441
+
442
+ this.init();
443
+
444
+ }
445
+
446
+ Input.prototype = {
447
+ /**
448
+ * should handle the inputEvent data and trigger the callback
449
+ * @virtual
450
+ */
451
+ handler: function() { },
452
+
453
+ /**
454
+ * bind the events
455
+ */
456
+ init: function() {
457
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
458
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
459
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
460
+ },
461
+
462
+ /**
463
+ * unbind the events
464
+ */
465
+ destroy: function() {
466
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
467
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
468
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
469
+ }
470
+ };
471
+
472
+ /**
473
+ * create new input type manager
474
+ * called by the Manager constructor
475
+ * @param {Hammer} manager
476
+ * @returns {Input}
477
+ */
478
+ function createInputInstance(manager) {
479
+ var Type;
480
+ var inputClass = manager.options.inputClass;
481
+
482
+ if (inputClass) {
483
+ Type = inputClass;
484
+ } else if (SUPPORT_POINTER_EVENTS) {
485
+ Type = PointerEventInput;
486
+ } else if (SUPPORT_ONLY_TOUCH) {
487
+ Type = TouchInput;
488
+ } else if (!SUPPORT_TOUCH) {
489
+ Type = MouseInput;
490
+ } else {
491
+ Type = TouchMouseInput;
492
+ }
493
+ return new (Type)(manager, inputHandler);
494
+ }
495
+
496
+ /**
497
+ * handle input events
498
+ * @param {Manager} manager
499
+ * @param {String} eventType
500
+ * @param {Object} input
501
+ */
502
+ function inputHandler(manager, eventType, input) {
503
+ var pointersLen = input.pointers.length;
504
+ var changedPointersLen = input.changedPointers.length;
505
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
506
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
507
+
508
+ input.isFirst = !!isFirst;
509
+ input.isFinal = !!isFinal;
510
+
511
+ if (isFirst) {
512
+ manager.session = {};
513
+ }
514
+
515
+ // source event is the normalized value of the domEvents
516
+ // like 'touchstart, mouseup, pointerdown'
517
+ input.eventType = eventType;
518
+
519
+ // compute scale, rotation etc
520
+ computeInputData(manager, input);
521
+
522
+ // emit secret event
523
+ manager.emit('hammer.input', input);
524
+
525
+ manager.recognize(input);
526
+ manager.session.prevInput = input;
527
+ }
528
+
529
+ /**
530
+ * extend the data with some usable properties like scale, rotate, velocity etc
531
+ * @param {Object} manager
532
+ * @param {Object} input
533
+ */
534
+ function computeInputData(manager, input) {
535
+ var session = manager.session;
536
+ var pointers = input.pointers;
537
+ var pointersLength = pointers.length;
538
+
539
+ // store the first input to calculate the distance and direction
540
+ if (!session.firstInput) {
541
+ session.firstInput = simpleCloneInputData(input);
542
+ }
543
+
544
+ // to compute scale and rotation we need to store the multiple touches
545
+ if (pointersLength > 1 && !session.firstMultiple) {
546
+ session.firstMultiple = simpleCloneInputData(input);
547
+ } else if (pointersLength === 1) {
548
+ session.firstMultiple = false;
549
+ }
550
+
551
+ var firstInput = session.firstInput;
552
+ var firstMultiple = session.firstMultiple;
553
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
554
+
555
+ var center = input.center = getCenter(pointers);
556
+ input.timeStamp = now();
557
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
558
+
559
+ input.angle = getAngle(offsetCenter, center);
560
+ input.distance = getDistance(offsetCenter, center);
561
+
562
+ computeDeltaXY(session, input);
563
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
564
+
565
+ var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
566
+ input.overallVelocityX = overallVelocity.x;
567
+ input.overallVelocityY = overallVelocity.y;
568
+ input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
569
+
570
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
571
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
572
+
573
+ input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
574
+ session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
575
+
576
+ computeIntervalInputData(session, input);
577
+
578
+ // find the correct target
579
+ var target = manager.element;
580
+ if (hasParent(input.srcEvent.target, target)) {
581
+ target = input.srcEvent.target;
582
+ }
583
+ input.target = target;
584
+ }
585
+
586
+ function computeDeltaXY(session, input) {
587
+ var center = input.center;
588
+ var offset = session.offsetDelta || {};
589
+ var prevDelta = session.prevDelta || {};
590
+ var prevInput = session.prevInput || {};
591
+
592
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
593
+ prevDelta = session.prevDelta = {
594
+ x: prevInput.deltaX || 0,
595
+ y: prevInput.deltaY || 0
596
+ };
597
+
598
+ offset = session.offsetDelta = {
599
+ x: center.x,
600
+ y: center.y
601
+ };
602
+ }
603
+
604
+ input.deltaX = prevDelta.x + (center.x - offset.x);
605
+ input.deltaY = prevDelta.y + (center.y - offset.y);
606
+ }
607
+
608
+ /**
609
+ * velocity is calculated every x ms
610
+ * @param {Object} session
611
+ * @param {Object} input
612
+ */
613
+ function computeIntervalInputData(session, input) {
614
+ var last = session.lastInterval || input,
615
+ deltaTime = input.timeStamp - last.timeStamp,
616
+ velocity, velocityX, velocityY, direction;
617
+
618
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined$1)) {
619
+ var deltaX = input.deltaX - last.deltaX;
620
+ var deltaY = input.deltaY - last.deltaY;
621
+
622
+ var v = getVelocity(deltaTime, deltaX, deltaY);
623
+ velocityX = v.x;
624
+ velocityY = v.y;
625
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
626
+ direction = getDirection(deltaX, deltaY);
627
+
628
+ session.lastInterval = input;
629
+ } else {
630
+ // use latest velocity info if it doesn't overtake a minimum period
631
+ velocity = last.velocity;
632
+ velocityX = last.velocityX;
633
+ velocityY = last.velocityY;
634
+ direction = last.direction;
635
+ }
636
+
637
+ input.velocity = velocity;
638
+ input.velocityX = velocityX;
639
+ input.velocityY = velocityY;
640
+ input.direction = direction;
641
+ }
642
+
643
+ /**
644
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
645
+ * @param {Object} input
646
+ * @returns {Object} clonedInputData
647
+ */
648
+ function simpleCloneInputData(input) {
649
+ // make a simple copy of the pointers because we will get a reference if we don't
650
+ // we only need clientXY for the calculations
651
+ var pointers = [];
652
+ var i = 0;
653
+ while (i < input.pointers.length) {
654
+ pointers[i] = {
655
+ clientX: round(input.pointers[i].clientX),
656
+ clientY: round(input.pointers[i].clientY)
657
+ };
658
+ i++;
659
+ }
660
+
661
+ return {
662
+ timeStamp: now(),
663
+ pointers: pointers,
664
+ center: getCenter(pointers),
665
+ deltaX: input.deltaX,
666
+ deltaY: input.deltaY
667
+ };
668
+ }
669
+
670
+ /**
671
+ * get the center of all the pointers
672
+ * @param {Array} pointers
673
+ * @return {Object} center contains `x` and `y` properties
674
+ */
675
+ function getCenter(pointers) {
676
+ var pointersLength = pointers.length;
677
+
678
+ // no need to loop when only one touch
679
+ if (pointersLength === 1) {
680
+ return {
681
+ x: round(pointers[0].clientX),
682
+ y: round(pointers[0].clientY)
683
+ };
684
+ }
685
+
686
+ var x = 0, y = 0, i = 0;
687
+ while (i < pointersLength) {
688
+ x += pointers[i].clientX;
689
+ y += pointers[i].clientY;
690
+ i++;
691
+ }
692
+
693
+ return {
694
+ x: round(x / pointersLength),
695
+ y: round(y / pointersLength)
696
+ };
697
+ }
698
+
699
+ /**
700
+ * calculate the velocity between two points. unit is in px per ms.
701
+ * @param {Number} deltaTime
702
+ * @param {Number} x
703
+ * @param {Number} y
704
+ * @return {Object} velocity `x` and `y`
705
+ */
706
+ function getVelocity(deltaTime, x, y) {
707
+ return {
708
+ x: x / deltaTime || 0,
709
+ y: y / deltaTime || 0
710
+ };
711
+ }
712
+
713
+ /**
714
+ * get the direction between two points
715
+ * @param {Number} x
716
+ * @param {Number} y
717
+ * @return {Number} direction
718
+ */
719
+ function getDirection(x, y) {
720
+ if (x === y) {
721
+ return DIRECTION_NONE;
722
+ }
723
+
724
+ if (abs(x) >= abs(y)) {
725
+ return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
726
+ }
727
+ return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
728
+ }
729
+
730
+ /**
731
+ * calculate the absolute distance between two points
732
+ * @param {Object} p1 {x, y}
733
+ * @param {Object} p2 {x, y}
734
+ * @param {Array} [props] containing x and y keys
735
+ * @return {Number} distance
736
+ */
737
+ function getDistance(p1, p2, props) {
738
+ if (!props) {
739
+ props = PROPS_XY;
740
+ }
741
+ var x = p2[props[0]] - p1[props[0]],
742
+ y = p2[props[1]] - p1[props[1]];
743
+
744
+ return Math.sqrt((x * x) + (y * y));
745
+ }
746
+
747
+ /**
748
+ * calculate the angle between two coordinates
749
+ * @param {Object} p1
750
+ * @param {Object} p2
751
+ * @param {Array} [props] containing x and y keys
752
+ * @return {Number} angle
753
+ */
754
+ function getAngle(p1, p2, props) {
755
+ if (!props) {
756
+ props = PROPS_XY;
757
+ }
758
+ var x = p2[props[0]] - p1[props[0]],
759
+ y = p2[props[1]] - p1[props[1]];
760
+ return Math.atan2(y, x) * 180 / Math.PI;
761
+ }
762
+
763
+ /**
764
+ * calculate the rotation degrees between two pointersets
765
+ * @param {Array} start array of pointers
766
+ * @param {Array} end array of pointers
767
+ * @return {Number} rotation
768
+ */
769
+ function getRotation(start, end) {
770
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
771
+ }
772
+
773
+ /**
774
+ * calculate the scale factor between two pointersets
775
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
776
+ * @param {Array} start array of pointers
777
+ * @param {Array} end array of pointers
778
+ * @return {Number} scale
779
+ */
780
+ function getScale(start, end) {
781
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
782
+ }
783
+
784
+ var MOUSE_INPUT_MAP = {
785
+ mousedown: INPUT_START,
786
+ mousemove: INPUT_MOVE,
787
+ mouseup: INPUT_END
788
+ };
789
+
790
+ var MOUSE_ELEMENT_EVENTS = 'mousedown';
791
+ var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
792
+
793
+ /**
794
+ * Mouse events input
795
+ * @constructor
796
+ * @extends Input
797
+ */
798
+ function MouseInput() {
799
+ this.evEl = MOUSE_ELEMENT_EVENTS;
800
+ this.evWin = MOUSE_WINDOW_EVENTS;
801
+
802
+ this.pressed = false; // mousedown state
803
+
804
+ Input.apply(this, arguments);
805
+ }
806
+
807
+ inherit(MouseInput, Input, {
808
+ /**
809
+ * handle mouse events
810
+ * @param {Object} ev
811
+ */
812
+ handler: function MEhandler(ev) {
813
+ var eventType = MOUSE_INPUT_MAP[ev.type];
814
+
815
+ // on start we want to have the left mouse button down
816
+ if (eventType & INPUT_START && ev.button === 0) {
817
+ this.pressed = true;
818
+ }
819
+
820
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
821
+ eventType = INPUT_END;
822
+ }
823
+
824
+ // mouse must be down
825
+ if (!this.pressed) {
826
+ return;
827
+ }
828
+
829
+ if (eventType & INPUT_END) {
830
+ this.pressed = false;
831
+ }
832
+
833
+ this.callback(this.manager, eventType, {
834
+ pointers: [ev],
835
+ changedPointers: [ev],
836
+ pointerType: INPUT_TYPE_MOUSE,
837
+ srcEvent: ev
838
+ });
839
+ }
840
+ });
841
+
842
+ var POINTER_INPUT_MAP = {
843
+ pointerdown: INPUT_START,
844
+ pointermove: INPUT_MOVE,
845
+ pointerup: INPUT_END,
846
+ pointercancel: INPUT_CANCEL,
847
+ pointerout: INPUT_CANCEL
848
+ };
849
+
850
+ // in IE10 the pointer types is defined as an enum
851
+ var IE10_POINTER_TYPE_ENUM = {
852
+ 2: INPUT_TYPE_TOUCH,
853
+ 3: INPUT_TYPE_PEN,
854
+ 4: INPUT_TYPE_MOUSE,
855
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
856
+ };
857
+
858
+ var POINTER_ELEMENT_EVENTS = 'pointerdown';
859
+ var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
860
+
861
+ // IE10 has prefixed support, and case-sensitive
862
+ if (window.MSPointerEvent && !window.PointerEvent) {
863
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
864
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
865
+ }
866
+
867
+ /**
868
+ * Pointer events input
869
+ * @constructor
870
+ * @extends Input
871
+ */
872
+ function PointerEventInput() {
873
+ this.evEl = POINTER_ELEMENT_EVENTS;
874
+ this.evWin = POINTER_WINDOW_EVENTS;
875
+
876
+ Input.apply(this, arguments);
877
+
878
+ this.store = (this.manager.session.pointerEvents = []);
879
+ }
880
+
881
+ inherit(PointerEventInput, Input, {
882
+ /**
883
+ * handle mouse events
884
+ * @param {Object} ev
885
+ */
886
+ handler: function PEhandler(ev) {
887
+ var store = this.store;
888
+ var removePointer = false;
889
+
890
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
891
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
892
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
893
+
894
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
895
+
896
+ // get index of the event in the store
897
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
898
+
899
+ // start and mouse must be down
900
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
901
+ if (storeIndex < 0) {
902
+ store.push(ev);
903
+ storeIndex = store.length - 1;
904
+ }
905
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
906
+ removePointer = true;
907
+ }
908
+
909
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
910
+ if (storeIndex < 0) {
911
+ return;
912
+ }
913
+
914
+ // update the event in the store
915
+ store[storeIndex] = ev;
916
+
917
+ this.callback(this.manager, eventType, {
918
+ pointers: store,
919
+ changedPointers: [ev],
920
+ pointerType: pointerType,
921
+ srcEvent: ev
922
+ });
923
+
924
+ if (removePointer) {
925
+ // remove from the store
926
+ store.splice(storeIndex, 1);
927
+ }
928
+ }
929
+ });
930
+
931
+ var SINGLE_TOUCH_INPUT_MAP = {
932
+ touchstart: INPUT_START,
933
+ touchmove: INPUT_MOVE,
934
+ touchend: INPUT_END,
935
+ touchcancel: INPUT_CANCEL
936
+ };
937
+
938
+ var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
939
+ var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
940
+
941
+ /**
942
+ * Touch events input
943
+ * @constructor
944
+ * @extends Input
945
+ */
946
+ function SingleTouchInput() {
947
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
948
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
949
+ this.started = false;
950
+
951
+ Input.apply(this, arguments);
952
+ }
953
+
954
+ inherit(SingleTouchInput, Input, {
955
+ handler: function TEhandler(ev) {
956
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
957
+
958
+ // should we handle the touch events?
959
+ if (type === INPUT_START) {
960
+ this.started = true;
961
+ }
962
+
963
+ if (!this.started) {
964
+ return;
965
+ }
966
+
967
+ var touches = normalizeSingleTouches.call(this, ev, type);
968
+
969
+ // when done, reset the started state
970
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
971
+ this.started = false;
972
+ }
973
+
974
+ this.callback(this.manager, type, {
975
+ pointers: touches[0],
976
+ changedPointers: touches[1],
977
+ pointerType: INPUT_TYPE_TOUCH,
978
+ srcEvent: ev
979
+ });
980
+ }
981
+ });
982
+
983
+ /**
984
+ * @this {TouchInput}
985
+ * @param {Object} ev
986
+ * @param {Number} type flag
987
+ * @returns {undefined|Array} [all, changed]
988
+ */
989
+ function normalizeSingleTouches(ev, type) {
990
+ var all = toArray(ev.touches);
991
+ var changed = toArray(ev.changedTouches);
992
+
993
+ if (type & (INPUT_END | INPUT_CANCEL)) {
994
+ all = uniqueArray(all.concat(changed), 'identifier');
995
+ }
996
+
997
+ return [all, changed];
998
+ }
999
+
1000
+ var TOUCH_INPUT_MAP = {
1001
+ touchstart: INPUT_START,
1002
+ touchmove: INPUT_MOVE,
1003
+ touchend: INPUT_END,
1004
+ touchcancel: INPUT_CANCEL
1005
+ };
1006
+
1007
+ var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
1008
+
1009
+ /**
1010
+ * Multi-user touch events input
1011
+ * @constructor
1012
+ * @extends Input
1013
+ */
1014
+ function TouchInput() {
1015
+ this.evTarget = TOUCH_TARGET_EVENTS;
1016
+ this.targetIds = {};
1017
+
1018
+ Input.apply(this, arguments);
1019
+ }
1020
+
1021
+ inherit(TouchInput, Input, {
1022
+ handler: function MTEhandler(ev) {
1023
+ var type = TOUCH_INPUT_MAP[ev.type];
1024
+ var touches = getTouches.call(this, ev, type);
1025
+ if (!touches) {
1026
+ return;
1027
+ }
1028
+
1029
+ this.callback(this.manager, type, {
1030
+ pointers: touches[0],
1031
+ changedPointers: touches[1],
1032
+ pointerType: INPUT_TYPE_TOUCH,
1033
+ srcEvent: ev
1034
+ });
1035
+ }
1036
+ });
1037
+
1038
+ /**
1039
+ * @this {TouchInput}
1040
+ * @param {Object} ev
1041
+ * @param {Number} type flag
1042
+ * @returns {undefined|Array} [all, changed]
1043
+ */
1044
+ function getTouches(ev, type) {
1045
+ var allTouches = toArray(ev.touches);
1046
+ var targetIds = this.targetIds;
1047
+
1048
+ // when there is only one touch, the process can be simplified
1049
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
1050
+ targetIds[allTouches[0].identifier] = true;
1051
+ return [allTouches, allTouches];
1052
+ }
1053
+
1054
+ var i,
1055
+ targetTouches,
1056
+ changedTouches = toArray(ev.changedTouches),
1057
+ changedTargetTouches = [],
1058
+ target = this.target;
1059
+
1060
+ // get target touches from touches
1061
+ targetTouches = allTouches.filter(function(touch) {
1062
+ return hasParent(touch.target, target);
1063
+ });
1064
+
1065
+ // collect touches
1066
+ if (type === INPUT_START) {
1067
+ i = 0;
1068
+ while (i < targetTouches.length) {
1069
+ targetIds[targetTouches[i].identifier] = true;
1070
+ i++;
1071
+ }
1072
+ }
1073
+
1074
+ // filter changed touches to only contain touches that exist in the collected target ids
1075
+ i = 0;
1076
+ while (i < changedTouches.length) {
1077
+ if (targetIds[changedTouches[i].identifier]) {
1078
+ changedTargetTouches.push(changedTouches[i]);
1079
+ }
1080
+
1081
+ // cleanup removed touches
1082
+ if (type & (INPUT_END | INPUT_CANCEL)) {
1083
+ delete targetIds[changedTouches[i].identifier];
1084
+ }
1085
+ i++;
1086
+ }
1087
+
1088
+ if (!changedTargetTouches.length) {
1089
+ return;
1090
+ }
1091
+
1092
+ return [
1093
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
1094
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier'),
1095
+ changedTargetTouches
1096
+ ];
1097
+ }
1098
+
1099
+ /**
1100
+ * Combined touch and mouse input
1101
+ *
1102
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
1103
+ * This because touch devices also emit mouse events while doing a touch.
1104
+ *
1105
+ * @constructor
1106
+ * @extends Input
1107
+ */
1108
+
1109
+ var DEDUP_TIMEOUT = 2500;
1110
+ var DEDUP_DISTANCE = 25;
1111
+
1112
+ function TouchMouseInput() {
1113
+ Input.apply(this, arguments);
1114
+
1115
+ var handler = bindFn(this.handler, this);
1116
+ this.touch = new TouchInput(this.manager, handler);
1117
+ this.mouse = new MouseInput(this.manager, handler);
1118
+
1119
+ this.primaryTouch = null;
1120
+ this.lastTouches = [];
1121
+ }
1122
+
1123
+ inherit(TouchMouseInput, Input, {
1124
+ /**
1125
+ * handle mouse and touch events
1126
+ * @param {Hammer} manager
1127
+ * @param {String} inputEvent
1128
+ * @param {Object} inputData
1129
+ */
1130
+ handler: function TMEhandler(manager, inputEvent, inputData) {
1131
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
1132
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
1133
+
1134
+ if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
1135
+ return;
1136
+ }
1137
+
1138
+ // when we're in a touch event, record touches to de-dupe synthetic mouse event
1139
+ if (isTouch) {
1140
+ recordTouches.call(this, inputEvent, inputData);
1141
+ } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
1142
+ return;
1143
+ }
1144
+
1145
+ this.callback(manager, inputEvent, inputData);
1146
+ },
1147
+
1148
+ /**
1149
+ * remove the event listeners
1150
+ */
1151
+ destroy: function destroy() {
1152
+ this.touch.destroy();
1153
+ this.mouse.destroy();
1154
+ }
1155
+ });
1156
+
1157
+ function recordTouches(eventType, eventData) {
1158
+ if (eventType & INPUT_START) {
1159
+ this.primaryTouch = eventData.changedPointers[0].identifier;
1160
+ setLastTouch.call(this, eventData);
1161
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
1162
+ setLastTouch.call(this, eventData);
1163
+ }
1164
+ }
1165
+
1166
+ function setLastTouch(eventData) {
1167
+ var touch = eventData.changedPointers[0];
1168
+
1169
+ if (touch.identifier === this.primaryTouch) {
1170
+ var lastTouch = {x: touch.clientX, y: touch.clientY};
1171
+ this.lastTouches.push(lastTouch);
1172
+ var lts = this.lastTouches;
1173
+ var removeLastTouch = function() {
1174
+ var i = lts.indexOf(lastTouch);
1175
+ if (i > -1) {
1176
+ lts.splice(i, 1);
1177
+ }
1178
+ };
1179
+ setTimeout(removeLastTouch, DEDUP_TIMEOUT);
1180
+ }
1181
+ }
1182
+
1183
+ function isSyntheticEvent(eventData) {
1184
+ var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
1185
+ for (var i = 0; i < this.lastTouches.length; i++) {
1186
+ var t = this.lastTouches[i];
1187
+ var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
1188
+ if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
1189
+ return true;
1190
+ }
1191
+ }
1192
+ return false;
1193
+ }
1194
+
1195
+ var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
1196
+ var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined$1;
1197
+
1198
+ // magical touchAction value
1199
+ var TOUCH_ACTION_COMPUTE = 'compute';
1200
+ var TOUCH_ACTION_AUTO = 'auto';
1201
+ var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
1202
+ var TOUCH_ACTION_NONE = 'none';
1203
+ var TOUCH_ACTION_PAN_X = 'pan-x';
1204
+ var TOUCH_ACTION_PAN_Y = 'pan-y';
1205
+ var TOUCH_ACTION_MAP = getTouchActionProps();
1206
+
1207
+ /**
1208
+ * Touch Action
1209
+ * sets the touchAction property or uses the js alternative
1210
+ * @param {Manager} manager
1211
+ * @param {String} value
1212
+ * @constructor
1213
+ */
1214
+ function TouchAction(manager, value) {
1215
+ this.manager = manager;
1216
+ this.set(value);
1217
+ }
1218
+
1219
+ TouchAction.prototype = {
1220
+ /**
1221
+ * set the touchAction value on the element or enable the polyfill
1222
+ * @param {String} value
1223
+ */
1224
+ set: function(value) {
1225
+ // find out the touch-action by the event handlers
1226
+ if (value == TOUCH_ACTION_COMPUTE) {
1227
+ value = this.compute();
1228
+ }
1229
+
1230
+ if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
1231
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
1232
+ }
1233
+ this.actions = value.toLowerCase().trim();
1234
+ },
1235
+
1236
+ /**
1237
+ * just re-set the touchAction value
1238
+ */
1239
+ update: function() {
1240
+ this.set(this.manager.options.touchAction);
1241
+ },
1242
+
1243
+ /**
1244
+ * compute the value for the touchAction property based on the recognizer's settings
1245
+ * @returns {String} value
1246
+ */
1247
+ compute: function() {
1248
+ var actions = [];
1249
+ each(this.manager.recognizers, function(recognizer) {
1250
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
1251
+ actions = actions.concat(recognizer.getTouchAction());
1252
+ }
1253
+ });
1254
+ return cleanTouchActions(actions.join(' '));
1255
+ },
1256
+
1257
+ /**
1258
+ * this method is called on each input cycle and provides the preventing of the browser behavior
1259
+ * @param {Object} input
1260
+ */
1261
+ preventDefaults: function(input) {
1262
+ var srcEvent = input.srcEvent;
1263
+ var direction = input.offsetDirection;
1264
+
1265
+ // if the touch action did prevented once this session
1266
+ if (this.manager.session.prevented) {
1267
+ srcEvent.preventDefault();
1268
+ return;
1269
+ }
1270
+
1271
+ var actions = this.actions;
1272
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
1273
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
1274
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
1275
+
1276
+ if (hasNone) {
1277
+ //do not prevent defaults if this is a tap gesture
1278
+
1279
+ var isTapPointer = input.pointers.length === 1;
1280
+ var isTapMovement = input.distance < 2;
1281
+ var isTapTouchTime = input.deltaTime < 250;
1282
+
1283
+ if (isTapPointer && isTapMovement && isTapTouchTime) {
1284
+ return;
1285
+ }
1286
+ }
1287
+
1288
+ if (hasPanX && hasPanY) {
1289
+ // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
1290
+ return;
1291
+ }
1292
+
1293
+ if (hasNone ||
1294
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
1295
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
1296
+ return this.preventSrc(srcEvent);
1297
+ }
1298
+ },
1299
+
1300
+ /**
1301
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
1302
+ * @param {Object} srcEvent
1303
+ */
1304
+ preventSrc: function(srcEvent) {
1305
+ this.manager.session.prevented = true;
1306
+ srcEvent.preventDefault();
1307
+ }
1308
+ };
1309
+
1310
+ /**
1311
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
1312
+ * @param {String} actions
1313
+ * @returns {*}
1314
+ */
1315
+ function cleanTouchActions(actions) {
1316
+ // none
1317
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
1318
+ return TOUCH_ACTION_NONE;
1319
+ }
1320
+
1321
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
1322
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
1323
+
1324
+ // if both pan-x and pan-y are set (different recognizers
1325
+ // for different directions, e.g. horizontal pan but vertical swipe?)
1326
+ // we need none (as otherwise with pan-x pan-y combined none of these
1327
+ // recognizers will work, since the browser would handle all panning
1328
+ if (hasPanX && hasPanY) {
1329
+ return TOUCH_ACTION_NONE;
1330
+ }
1331
+
1332
+ // pan-x OR pan-y
1333
+ if (hasPanX || hasPanY) {
1334
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
1335
+ }
1336
+
1337
+ // manipulation
1338
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
1339
+ return TOUCH_ACTION_MANIPULATION;
1340
+ }
1341
+
1342
+ return TOUCH_ACTION_AUTO;
1343
+ }
1344
+
1345
+ function getTouchActionProps() {
1346
+ if (!NATIVE_TOUCH_ACTION) {
1347
+ return false;
1348
+ }
1349
+ var touchMap = {};
1350
+ var cssSupports = window.CSS && window.CSS.supports;
1351
+ ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
1352
+
1353
+ // If css.supports is not supported but there is native touch-action assume it supports
1354
+ // all values. This is the case for IE 10 and 11.
1355
+ touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
1356
+ });
1357
+ return touchMap;
1358
+ }
1359
+
1360
+ /**
1361
+ * Recognizer flow explained; *
1362
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
1363
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
1364
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
1365
+ *
1366
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
1367
+ * which determines with state it should be.
1368
+ *
1369
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
1370
+ * POSSIBLE to give it another change on the next cycle.
1371
+ *
1372
+ * Possible
1373
+ * |
1374
+ * +-----+---------------+
1375
+ * | |
1376
+ * +-----+-----+ |
1377
+ * | | |
1378
+ * Failed Cancelled |
1379
+ * +-------+------+
1380
+ * | |
1381
+ * Recognized Began
1382
+ * |
1383
+ * Changed
1384
+ * |
1385
+ * Ended/Recognized
1386
+ */
1387
+ var STATE_POSSIBLE = 1;
1388
+ var STATE_BEGAN = 2;
1389
+ var STATE_CHANGED = 4;
1390
+ var STATE_ENDED = 8;
1391
+ var STATE_RECOGNIZED = STATE_ENDED;
1392
+ var STATE_CANCELLED = 16;
1393
+ var STATE_FAILED = 32;
1394
+
1395
+ /**
1396
+ * Recognizer
1397
+ * Every recognizer needs to extend from this class.
1398
+ * @constructor
1399
+ * @param {Object} options
1400
+ */
1401
+ function Recognizer(options) {
1402
+ this.options = assign({}, this.defaults, options || {});
1403
+
1404
+ this.id = uniqueId();
1405
+
1406
+ this.manager = null;
1407
+
1408
+ // default is enable true
1409
+ this.options.enable = ifUndefined(this.options.enable, true);
1410
+
1411
+ this.state = STATE_POSSIBLE;
1412
+
1413
+ this.simultaneous = {};
1414
+ this.requireFail = [];
1415
+ }
1416
+
1417
+ Recognizer.prototype = {
1418
+ /**
1419
+ * @virtual
1420
+ * @type {Object}
1421
+ */
1422
+ defaults: {},
1423
+
1424
+ /**
1425
+ * set options
1426
+ * @param {Object} options
1427
+ * @return {Recognizer}
1428
+ */
1429
+ set: function(options) {
1430
+ assign(this.options, options);
1431
+
1432
+ // also update the touchAction, in case something changed about the directions/enabled state
1433
+ this.manager && this.manager.touchAction.update();
1434
+ return this;
1435
+ },
1436
+
1437
+ /**
1438
+ * recognize simultaneous with an other recognizer.
1439
+ * @param {Recognizer} otherRecognizer
1440
+ * @returns {Recognizer} this
1441
+ */
1442
+ recognizeWith: function(otherRecognizer) {
1443
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
1444
+ return this;
1445
+ }
1446
+
1447
+ var simultaneous = this.simultaneous;
1448
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1449
+ if (!simultaneous[otherRecognizer.id]) {
1450
+ simultaneous[otherRecognizer.id] = otherRecognizer;
1451
+ otherRecognizer.recognizeWith(this);
1452
+ }
1453
+ return this;
1454
+ },
1455
+
1456
+ /**
1457
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
1458
+ * @param {Recognizer} otherRecognizer
1459
+ * @returns {Recognizer} this
1460
+ */
1461
+ dropRecognizeWith: function(otherRecognizer) {
1462
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
1463
+ return this;
1464
+ }
1465
+
1466
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1467
+ delete this.simultaneous[otherRecognizer.id];
1468
+ return this;
1469
+ },
1470
+
1471
+ /**
1472
+ * recognizer can only run when an other is failing
1473
+ * @param {Recognizer} otherRecognizer
1474
+ * @returns {Recognizer} this
1475
+ */
1476
+ requireFailure: function(otherRecognizer) {
1477
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
1478
+ return this;
1479
+ }
1480
+
1481
+ var requireFail = this.requireFail;
1482
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1483
+ if (inArray(requireFail, otherRecognizer) === -1) {
1484
+ requireFail.push(otherRecognizer);
1485
+ otherRecognizer.requireFailure(this);
1486
+ }
1487
+ return this;
1488
+ },
1489
+
1490
+ /**
1491
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
1492
+ * @param {Recognizer} otherRecognizer
1493
+ * @returns {Recognizer} this
1494
+ */
1495
+ dropRequireFailure: function(otherRecognizer) {
1496
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
1497
+ return this;
1498
+ }
1499
+
1500
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1501
+ var index = inArray(this.requireFail, otherRecognizer);
1502
+ if (index > -1) {
1503
+ this.requireFail.splice(index, 1);
1504
+ }
1505
+ return this;
1506
+ },
1507
+
1508
+ /**
1509
+ * has require failures boolean
1510
+ * @returns {boolean}
1511
+ */
1512
+ hasRequireFailures: function() {
1513
+ return this.requireFail.length > 0;
1514
+ },
1515
+
1516
+ /**
1517
+ * if the recognizer can recognize simultaneous with an other recognizer
1518
+ * @param {Recognizer} otherRecognizer
1519
+ * @returns {Boolean}
1520
+ */
1521
+ canRecognizeWith: function(otherRecognizer) {
1522
+ return !!this.simultaneous[otherRecognizer.id];
1523
+ },
1524
+
1525
+ /**
1526
+ * You should use `tryEmit` instead of `emit` directly to check
1527
+ * that all the needed recognizers has failed before emitting.
1528
+ * @param {Object} input
1529
+ */
1530
+ emit: function(input) {
1531
+ var self = this;
1532
+ var state = this.state;
1533
+
1534
+ function emit(event) {
1535
+ self.manager.emit(event, input);
1536
+ }
1537
+
1538
+ // 'panstart' and 'panmove'
1539
+ if (state < STATE_ENDED) {
1540
+ emit(self.options.event + stateStr(state));
1541
+ }
1542
+
1543
+ emit(self.options.event); // simple 'eventName' events
1544
+
1545
+ if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
1546
+ emit(input.additionalEvent);
1547
+ }
1548
+
1549
+ // panend and pancancel
1550
+ if (state >= STATE_ENDED) {
1551
+ emit(self.options.event + stateStr(state));
1552
+ }
1553
+ },
1554
+
1555
+ /**
1556
+ * Check that all the require failure recognizers has failed,
1557
+ * if true, it emits a gesture event,
1558
+ * otherwise, setup the state to FAILED.
1559
+ * @param {Object} input
1560
+ */
1561
+ tryEmit: function(input) {
1562
+ if (this.canEmit()) {
1563
+ return this.emit(input);
1564
+ }
1565
+ // it's failing anyway
1566
+ this.state = STATE_FAILED;
1567
+ },
1568
+
1569
+ /**
1570
+ * can we emit?
1571
+ * @returns {boolean}
1572
+ */
1573
+ canEmit: function() {
1574
+ var i = 0;
1575
+ while (i < this.requireFail.length) {
1576
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
1577
+ return false;
1578
+ }
1579
+ i++;
1580
+ }
1581
+ return true;
1582
+ },
1583
+
1584
+ /**
1585
+ * update the recognizer
1586
+ * @param {Object} inputData
1587
+ */
1588
+ recognize: function(inputData) {
1589
+ // make a new copy of the inputData
1590
+ // so we can change the inputData without messing up the other recognizers
1591
+ var inputDataClone = assign({}, inputData);
1592
+
1593
+ // is is enabled and allow recognizing?
1594
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
1595
+ this.reset();
1596
+ this.state = STATE_FAILED;
1597
+ return;
1598
+ }
1599
+
1600
+ // reset when we've reached the end
1601
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
1602
+ this.state = STATE_POSSIBLE;
1603
+ }
1604
+
1605
+ this.state = this.process(inputDataClone);
1606
+
1607
+ // the recognizer has recognized a gesture
1608
+ // so trigger an event
1609
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
1610
+ this.tryEmit(inputDataClone);
1611
+ }
1612
+ },
1613
+
1614
+ /**
1615
+ * return the state of the recognizer
1616
+ * the actual recognizing happens in this method
1617
+ * @virtual
1618
+ * @param {Object} inputData
1619
+ * @returns {Const} STATE
1620
+ */
1621
+ process: function(inputData) { }, // jshint ignore:line
1622
+
1623
+ /**
1624
+ * return the preferred touch-action
1625
+ * @virtual
1626
+ * @returns {Array}
1627
+ */
1628
+ getTouchAction: function() { },
1629
+
1630
+ /**
1631
+ * called when the gesture isn't allowed to recognize
1632
+ * like when another is being recognized or it is disabled
1633
+ * @virtual
1634
+ */
1635
+ reset: function() { }
1636
+ };
1637
+
1638
+ /**
1639
+ * get a usable string, used as event postfix
1640
+ * @param {Const} state
1641
+ * @returns {String} state
1642
+ */
1643
+ function stateStr(state) {
1644
+ if (state & STATE_CANCELLED) {
1645
+ return 'cancel';
1646
+ } else if (state & STATE_ENDED) {
1647
+ return 'end';
1648
+ } else if (state & STATE_CHANGED) {
1649
+ return 'move';
1650
+ } else if (state & STATE_BEGAN) {
1651
+ return 'start';
1652
+ }
1653
+ return '';
1654
+ }
1655
+
1656
+ /**
1657
+ * direction cons to string
1658
+ * @param {Const} direction
1659
+ * @returns {String}
1660
+ */
1661
+ function directionStr(direction) {
1662
+ if (direction == DIRECTION_DOWN) {
1663
+ return 'down';
1664
+ } else if (direction == DIRECTION_UP) {
1665
+ return 'up';
1666
+ } else if (direction == DIRECTION_LEFT) {
1667
+ return 'left';
1668
+ } else if (direction == DIRECTION_RIGHT) {
1669
+ return 'right';
1670
+ }
1671
+ return '';
1672
+ }
1673
+
1674
+ /**
1675
+ * get a recognizer by name if it is bound to a manager
1676
+ * @param {Recognizer|String} otherRecognizer
1677
+ * @param {Recognizer} recognizer
1678
+ * @returns {Recognizer}
1679
+ */
1680
+ function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
1681
+ var manager = recognizer.manager;
1682
+ if (manager) {
1683
+ return manager.get(otherRecognizer);
1684
+ }
1685
+ return otherRecognizer;
1686
+ }
1687
+
1688
+ /**
1689
+ * This recognizer is just used as a base for the simple attribute recognizers.
1690
+ * @constructor
1691
+ * @extends Recognizer
1692
+ */
1693
+ function AttrRecognizer() {
1694
+ Recognizer.apply(this, arguments);
1695
+ }
1696
+
1697
+ inherit(AttrRecognizer, Recognizer, {
1698
+ /**
1699
+ * @namespace
1700
+ * @memberof AttrRecognizer
1701
+ */
1702
+ defaults: {
1703
+ /**
1704
+ * @type {Number}
1705
+ * @default 1
1706
+ */
1707
+ pointers: 1
1708
+ },
1709
+
1710
+ /**
1711
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
1712
+ * @memberof AttrRecognizer
1713
+ * @param {Object} input
1714
+ * @returns {Boolean} recognized
1715
+ */
1716
+ attrTest: function(input) {
1717
+ var optionPointers = this.options.pointers;
1718
+ return optionPointers === 0 || input.pointers.length === optionPointers;
1719
+ },
1720
+
1721
+ /**
1722
+ * Process the input and return the state for the recognizer
1723
+ * @memberof AttrRecognizer
1724
+ * @param {Object} input
1725
+ * @returns {*} State
1726
+ */
1727
+ process: function(input) {
1728
+ var state = this.state;
1729
+ var eventType = input.eventType;
1730
+
1731
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
1732
+ var isValid = this.attrTest(input);
1733
+
1734
+ // on cancel input and we've recognized before, return STATE_CANCELLED
1735
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
1736
+ return state | STATE_CANCELLED;
1737
+ } else if (isRecognized || isValid) {
1738
+ if (eventType & INPUT_END) {
1739
+ return state | STATE_ENDED;
1740
+ } else if (!(state & STATE_BEGAN)) {
1741
+ return STATE_BEGAN;
1742
+ }
1743
+ return state | STATE_CHANGED;
1744
+ }
1745
+ return STATE_FAILED;
1746
+ }
1747
+ });
1748
+
1749
+ /**
1750
+ * Pan
1751
+ * Recognized when the pointer is down and moved in the allowed direction.
1752
+ * @constructor
1753
+ * @extends AttrRecognizer
1754
+ */
1755
+ function PanRecognizer() {
1756
+ AttrRecognizer.apply(this, arguments);
1757
+
1758
+ this.pX = null;
1759
+ this.pY = null;
1760
+ }
1761
+
1762
+ inherit(PanRecognizer, AttrRecognizer, {
1763
+ /**
1764
+ * @namespace
1765
+ * @memberof PanRecognizer
1766
+ */
1767
+ defaults: {
1768
+ event: 'pan',
1769
+ threshold: 10,
1770
+ pointers: 1,
1771
+ direction: DIRECTION_ALL
1772
+ },
1773
+
1774
+ getTouchAction: function() {
1775
+ var direction = this.options.direction;
1776
+ var actions = [];
1777
+ if (direction & DIRECTION_HORIZONTAL) {
1778
+ actions.push(TOUCH_ACTION_PAN_Y);
1779
+ }
1780
+ if (direction & DIRECTION_VERTICAL) {
1781
+ actions.push(TOUCH_ACTION_PAN_X);
1782
+ }
1783
+ return actions;
1784
+ },
1785
+
1786
+ directionTest: function(input) {
1787
+ var options = this.options;
1788
+ var hasMoved = true;
1789
+ var distance = input.distance;
1790
+ var direction = input.direction;
1791
+ var x = input.deltaX;
1792
+ var y = input.deltaY;
1793
+
1794
+ // lock to axis?
1795
+ if (!(direction & options.direction)) {
1796
+ if (options.direction & DIRECTION_HORIZONTAL) {
1797
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
1798
+ hasMoved = x != this.pX;
1799
+ distance = Math.abs(input.deltaX);
1800
+ } else {
1801
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
1802
+ hasMoved = y != this.pY;
1803
+ distance = Math.abs(input.deltaY);
1804
+ }
1805
+ }
1806
+ input.direction = direction;
1807
+ return hasMoved && distance > options.threshold && direction & options.direction;
1808
+ },
1809
+
1810
+ attrTest: function(input) {
1811
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
1812
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
1813
+ },
1814
+
1815
+ emit: function(input) {
1816
+
1817
+ this.pX = input.deltaX;
1818
+ this.pY = input.deltaY;
1819
+
1820
+ var direction = directionStr(input.direction);
1821
+
1822
+ if (direction) {
1823
+ input.additionalEvent = this.options.event + direction;
1824
+ }
1825
+ this._super.emit.call(this, input);
1826
+ }
1827
+ });
1828
+
1829
+ /**
1830
+ * Pinch
1831
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
1832
+ * @constructor
1833
+ * @extends AttrRecognizer
1834
+ */
1835
+ function PinchRecognizer() {
1836
+ AttrRecognizer.apply(this, arguments);
1837
+ }
1838
+
1839
+ inherit(PinchRecognizer, AttrRecognizer, {
1840
+ /**
1841
+ * @namespace
1842
+ * @memberof PinchRecognizer
1843
+ */
1844
+ defaults: {
1845
+ event: 'pinch',
1846
+ threshold: 0,
1847
+ pointers: 2
1848
+ },
1849
+
1850
+ getTouchAction: function() {
1851
+ return [TOUCH_ACTION_NONE];
1852
+ },
1853
+
1854
+ attrTest: function(input) {
1855
+ return this._super.attrTest.call(this, input) &&
1856
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
1857
+ },
1858
+
1859
+ emit: function(input) {
1860
+ if (input.scale !== 1) {
1861
+ var inOut = input.scale < 1 ? 'in' : 'out';
1862
+ input.additionalEvent = this.options.event + inOut;
1863
+ }
1864
+ this._super.emit.call(this, input);
1865
+ }
1866
+ });
1867
+
1868
+ /**
1869
+ * Press
1870
+ * Recognized when the pointer is down for x ms without any movement.
1871
+ * @constructor
1872
+ * @extends Recognizer
1873
+ */
1874
+ function PressRecognizer() {
1875
+ Recognizer.apply(this, arguments);
1876
+
1877
+ this._timer = null;
1878
+ this._input = null;
1879
+ }
1880
+
1881
+ inherit(PressRecognizer, Recognizer, {
1882
+ /**
1883
+ * @namespace
1884
+ * @memberof PressRecognizer
1885
+ */
1886
+ defaults: {
1887
+ event: 'press',
1888
+ pointers: 1,
1889
+ time: 251, // minimal time of the pointer to be pressed
1890
+ threshold: 9 // a minimal movement is ok, but keep it low
1891
+ },
1892
+
1893
+ getTouchAction: function() {
1894
+ return [TOUCH_ACTION_AUTO];
1895
+ },
1896
+
1897
+ process: function(input) {
1898
+ var options = this.options;
1899
+ var validPointers = input.pointers.length === options.pointers;
1900
+ var validMovement = input.distance < options.threshold;
1901
+ var validTime = input.deltaTime > options.time;
1902
+
1903
+ this._input = input;
1904
+
1905
+ // we only allow little movement
1906
+ // and we've reached an end event, so a tap is possible
1907
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
1908
+ this.reset();
1909
+ } else if (input.eventType & INPUT_START) {
1910
+ this.reset();
1911
+ this._timer = setTimeoutContext(function() {
1912
+ this.state = STATE_RECOGNIZED;
1913
+ this.tryEmit();
1914
+ }, options.time, this);
1915
+ } else if (input.eventType & INPUT_END) {
1916
+ return STATE_RECOGNIZED;
1917
+ }
1918
+ return STATE_FAILED;
1919
+ },
1920
+
1921
+ reset: function() {
1922
+ clearTimeout(this._timer);
1923
+ },
1924
+
1925
+ emit: function(input) {
1926
+ if (this.state !== STATE_RECOGNIZED) {
1927
+ return;
1928
+ }
1929
+
1930
+ if (input && (input.eventType & INPUT_END)) {
1931
+ this.manager.emit(this.options.event + 'up', input);
1932
+ } else {
1933
+ this._input.timeStamp = now();
1934
+ this.manager.emit(this.options.event, this._input);
1935
+ }
1936
+ }
1937
+ });
1938
+
1939
+ /**
1940
+ * Rotate
1941
+ * Recognized when two or more pointer are moving in a circular motion.
1942
+ * @constructor
1943
+ * @extends AttrRecognizer
1944
+ */
1945
+ function RotateRecognizer() {
1946
+ AttrRecognizer.apply(this, arguments);
1947
+ }
1948
+
1949
+ inherit(RotateRecognizer, AttrRecognizer, {
1950
+ /**
1951
+ * @namespace
1952
+ * @memberof RotateRecognizer
1953
+ */
1954
+ defaults: {
1955
+ event: 'rotate',
1956
+ threshold: 0,
1957
+ pointers: 2
1958
+ },
1959
+
1960
+ getTouchAction: function() {
1961
+ return [TOUCH_ACTION_NONE];
1962
+ },
1963
+
1964
+ attrTest: function(input) {
1965
+ return this._super.attrTest.call(this, input) &&
1966
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
1967
+ }
1968
+ });
1969
+
1970
+ /**
1971
+ * Swipe
1972
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
1973
+ * @constructor
1974
+ * @extends AttrRecognizer
1975
+ */
1976
+ function SwipeRecognizer() {
1977
+ AttrRecognizer.apply(this, arguments);
1978
+ }
1979
+
1980
+ inherit(SwipeRecognizer, AttrRecognizer, {
1981
+ /**
1982
+ * @namespace
1983
+ * @memberof SwipeRecognizer
1984
+ */
1985
+ defaults: {
1986
+ event: 'swipe',
1987
+ threshold: 10,
1988
+ velocity: 0.3,
1989
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
1990
+ pointers: 1
1991
+ },
1992
+
1993
+ getTouchAction: function() {
1994
+ return PanRecognizer.prototype.getTouchAction.call(this);
1995
+ },
1996
+
1997
+ attrTest: function(input) {
1998
+ var direction = this.options.direction;
1999
+ var velocity;
2000
+
2001
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
2002
+ velocity = input.overallVelocity;
2003
+ } else if (direction & DIRECTION_HORIZONTAL) {
2004
+ velocity = input.overallVelocityX;
2005
+ } else if (direction & DIRECTION_VERTICAL) {
2006
+ velocity = input.overallVelocityY;
2007
+ }
2008
+
2009
+ return this._super.attrTest.call(this, input) &&
2010
+ direction & input.offsetDirection &&
2011
+ input.distance > this.options.threshold &&
2012
+ input.maxPointers == this.options.pointers &&
2013
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
2014
+ },
2015
+
2016
+ emit: function(input) {
2017
+ var direction = directionStr(input.offsetDirection);
2018
+ if (direction) {
2019
+ this.manager.emit(this.options.event + direction, input);
2020
+ }
2021
+
2022
+ this.manager.emit(this.options.event, input);
2023
+ }
2024
+ });
2025
+
2026
+ /**
2027
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
2028
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
2029
+ * a single tap.
2030
+ *
2031
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
2032
+ * multi-taps being recognized.
2033
+ * @constructor
2034
+ * @extends Recognizer
2035
+ */
2036
+ function TapRecognizer() {
2037
+ Recognizer.apply(this, arguments);
2038
+
2039
+ // previous time and center,
2040
+ // used for tap counting
2041
+ this.pTime = false;
2042
+ this.pCenter = false;
2043
+
2044
+ this._timer = null;
2045
+ this._input = null;
2046
+ this.count = 0;
2047
+ }
2048
+
2049
+ inherit(TapRecognizer, Recognizer, {
2050
+ /**
2051
+ * @namespace
2052
+ * @memberof PinchRecognizer
2053
+ */
2054
+ defaults: {
2055
+ event: 'tap',
2056
+ pointers: 1,
2057
+ taps: 1,
2058
+ interval: 300, // max time between the multi-tap taps
2059
+ time: 250, // max time of the pointer to be down (like finger on the screen)
2060
+ threshold: 9, // a minimal movement is ok, but keep it low
2061
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
2062
+ },
2063
+
2064
+ getTouchAction: function() {
2065
+ return [TOUCH_ACTION_MANIPULATION];
2066
+ },
2067
+
2068
+ process: function(input) {
2069
+ var options = this.options;
2070
+
2071
+ var validPointers = input.pointers.length === options.pointers;
2072
+ var validMovement = input.distance < options.threshold;
2073
+ var validTouchTime = input.deltaTime < options.time;
2074
+
2075
+ this.reset();
2076
+
2077
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
2078
+ return this.failTimeout();
2079
+ }
2080
+
2081
+ // we only allow little movement
2082
+ // and we've reached an end event, so a tap is possible
2083
+ if (validMovement && validTouchTime && validPointers) {
2084
+ if (input.eventType != INPUT_END) {
2085
+ return this.failTimeout();
2086
+ }
2087
+
2088
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
2089
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
2090
+
2091
+ this.pTime = input.timeStamp;
2092
+ this.pCenter = input.center;
2093
+
2094
+ if (!validMultiTap || !validInterval) {
2095
+ this.count = 1;
2096
+ } else {
2097
+ this.count += 1;
2098
+ }
2099
+
2100
+ this._input = input;
2101
+
2102
+ // if tap count matches we have recognized it,
2103
+ // else it has began recognizing...
2104
+ var tapCount = this.count % options.taps;
2105
+ if (tapCount === 0) {
2106
+ // no failing requirements, immediately trigger the tap event
2107
+ // or wait as long as the multitap interval to trigger
2108
+ if (!this.hasRequireFailures()) {
2109
+ return STATE_RECOGNIZED;
2110
+ } else {
2111
+ this._timer = setTimeoutContext(function() {
2112
+ this.state = STATE_RECOGNIZED;
2113
+ this.tryEmit();
2114
+ }, options.interval, this);
2115
+ return STATE_BEGAN;
2116
+ }
2117
+ }
2118
+ }
2119
+ return STATE_FAILED;
2120
+ },
2121
+
2122
+ failTimeout: function() {
2123
+ this._timer = setTimeoutContext(function() {
2124
+ this.state = STATE_FAILED;
2125
+ }, this.options.interval, this);
2126
+ return STATE_FAILED;
2127
+ },
2128
+
2129
+ reset: function() {
2130
+ clearTimeout(this._timer);
2131
+ },
2132
+
2133
+ emit: function() {
2134
+ if (this.state == STATE_RECOGNIZED) {
2135
+ this._input.tapCount = this.count;
2136
+ this.manager.emit(this.options.event, this._input);
2137
+ }
2138
+ }
2139
+ });
2140
+
2141
+ /**
2142
+ * Simple way to create a manager with a default set of recognizers.
2143
+ * @param {HTMLElement} element
2144
+ * @param {Object} [options]
2145
+ * @constructor
2146
+ */
2147
+ function Hammer(element, options) {
2148
+ options = options || {};
2149
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
2150
+ return new Manager(element, options);
2151
+ }
2152
+
2153
+ /**
2154
+ * @const {string}
2155
+ */
2156
+ Hammer.VERSION = '2.0.7';
2157
+
2158
+ /**
2159
+ * default settings
2160
+ * @namespace
2161
+ */
2162
+ Hammer.defaults = {
2163
+ /**
2164
+ * set if DOM events are being triggered.
2165
+ * But this is slower and unused by simple implementations, so disabled by default.
2166
+ * @type {Boolean}
2167
+ * @default false
2168
+ */
2169
+ domEvents: false,
2170
+
2171
+ /**
2172
+ * The value for the touchAction property/fallback.
2173
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
2174
+ * @type {String}
2175
+ * @default compute
2176
+ */
2177
+ touchAction: TOUCH_ACTION_COMPUTE,
2178
+
2179
+ /**
2180
+ * @type {Boolean}
2181
+ * @default true
2182
+ */
2183
+ enable: true,
2184
+
2185
+ /**
2186
+ * EXPERIMENTAL FEATURE -- can be removed/changed
2187
+ * Change the parent input target element.
2188
+ * If Null, then it is being set the to main element.
2189
+ * @type {Null|EventTarget}
2190
+ * @default null
2191
+ */
2192
+ inputTarget: null,
2193
+
2194
+ /**
2195
+ * force an input class
2196
+ * @type {Null|Function}
2197
+ * @default null
2198
+ */
2199
+ inputClass: null,
2200
+
2201
+ /**
2202
+ * Default recognizer setup when calling `Hammer()`
2203
+ * When creating a new Manager these will be skipped.
2204
+ * @type {Array}
2205
+ */
2206
+ preset: [
2207
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
2208
+ [RotateRecognizer, {enable: false}],
2209
+ [PinchRecognizer, {enable: false}, ['rotate']],
2210
+ [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
2211
+ [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
2212
+ [TapRecognizer],
2213
+ [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
2214
+ [PressRecognizer]
2215
+ ],
2216
+
2217
+ /**
2218
+ * Some CSS properties can be used to improve the working of Hammer.
2219
+ * Add them to this method and they will be set when creating a new Manager.
2220
+ * @namespace
2221
+ */
2222
+ cssProps: {
2223
+ /**
2224
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
2225
+ * @type {String}
2226
+ * @default 'none'
2227
+ */
2228
+ userSelect: 'none',
2229
+
2230
+ /**
2231
+ * Disable the Windows Phone grippers when pressing an element.
2232
+ * @type {String}
2233
+ * @default 'none'
2234
+ */
2235
+ touchSelect: 'none',
2236
+
2237
+ /**
2238
+ * Disables the default callout shown when you touch and hold a touch target.
2239
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
2240
+ * a callout containing information about the link. This property allows you to disable that callout.
2241
+ * @type {String}
2242
+ * @default 'none'
2243
+ */
2244
+ touchCallout: 'none',
2245
+
2246
+ /**
2247
+ * Specifies whether zooming is enabled. Used by IE10>
2248
+ * @type {String}
2249
+ * @default 'none'
2250
+ */
2251
+ contentZooming: 'none',
2252
+
2253
+ /**
2254
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
2255
+ * @type {String}
2256
+ * @default 'none'
2257
+ */
2258
+ userDrag: 'none',
2259
+
2260
+ /**
2261
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
2262
+ * clickable element in iOS. This property obeys the alpha value, if specified.
2263
+ * @type {String}
2264
+ * @default 'rgba(0,0,0,0)'
2265
+ */
2266
+ tapHighlightColor: 'rgba(0,0,0,0)'
2267
+ }
2268
+ };
2269
+
2270
+ var STOP = 1;
2271
+ var FORCED_STOP = 2;
2272
+
2273
+ /**
2274
+ * Manager
2275
+ * @param {HTMLElement} element
2276
+ * @param {Object} [options]
2277
+ * @constructor
2278
+ */
2279
+ function Manager(element, options) {
2280
+ this.options = assign({}, Hammer.defaults, options || {});
2281
+
2282
+ this.options.inputTarget = this.options.inputTarget || element;
2283
+
2284
+ this.handlers = {};
2285
+ this.session = {};
2286
+ this.recognizers = [];
2287
+ this.oldCssProps = {};
2288
+
2289
+ this.element = element;
2290
+ this.input = createInputInstance(this);
2291
+ this.touchAction = new TouchAction(this, this.options.touchAction);
2292
+
2293
+ toggleCssProps(this, true);
2294
+
2295
+ each(this.options.recognizers, function(item) {
2296
+ var recognizer = this.add(new (item[0])(item[1]));
2297
+ item[2] && recognizer.recognizeWith(item[2]);
2298
+ item[3] && recognizer.requireFailure(item[3]);
2299
+ }, this);
2300
+ }
2301
+
2302
+ Manager.prototype = {
2303
+ /**
2304
+ * set options
2305
+ * @param {Object} options
2306
+ * @returns {Manager}
2307
+ */
2308
+ set: function(options) {
2309
+ assign(this.options, options);
2310
+
2311
+ // Options that need a little more setup
2312
+ if (options.touchAction) {
2313
+ this.touchAction.update();
2314
+ }
2315
+ if (options.inputTarget) {
2316
+ // Clean up existing event listeners and reinitialize
2317
+ this.input.destroy();
2318
+ this.input.target = options.inputTarget;
2319
+ this.input.init();
2320
+ }
2321
+ return this;
2322
+ },
2323
+
2324
+ /**
2325
+ * stop recognizing for this session.
2326
+ * This session will be discarded, when a new [input]start event is fired.
2327
+ * When forced, the recognizer cycle is stopped immediately.
2328
+ * @param {Boolean} [force]
2329
+ */
2330
+ stop: function(force) {
2331
+ this.session.stopped = force ? FORCED_STOP : STOP;
2332
+ },
2333
+
2334
+ /**
2335
+ * run the recognizers!
2336
+ * called by the inputHandler function on every movement of the pointers (touches)
2337
+ * it walks through all the recognizers and tries to detect the gesture that is being made
2338
+ * @param {Object} inputData
2339
+ */
2340
+ recognize: function(inputData) {
2341
+ var session = this.session;
2342
+ if (session.stopped) {
2343
+ return;
2344
+ }
2345
+
2346
+ // run the touch-action polyfill
2347
+ this.touchAction.preventDefaults(inputData);
2348
+
2349
+ var recognizer;
2350
+ var recognizers = this.recognizers;
2351
+
2352
+ // this holds the recognizer that is being recognized.
2353
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
2354
+ // if no recognizer is detecting a thing, it is set to `null`
2355
+ var curRecognizer = session.curRecognizer;
2356
+
2357
+ // reset when the last recognizer is recognized
2358
+ // or when we're in a new session
2359
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
2360
+ curRecognizer = session.curRecognizer = null;
2361
+ }
2362
+
2363
+ var i = 0;
2364
+ while (i < recognizers.length) {
2365
+ recognizer = recognizers[i];
2366
+
2367
+ // find out if we are allowed try to recognize the input for this one.
2368
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
2369
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
2370
+ // that is being recognized.
2371
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
2372
+ // this can be setup with the `recognizeWith()` method on the recognizer.
2373
+ if (session.stopped !== FORCED_STOP && ( // 1
2374
+ !curRecognizer || recognizer == curRecognizer || // 2
2375
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
2376
+ recognizer.recognize(inputData);
2377
+ } else {
2378
+ recognizer.reset();
2379
+ }
2380
+
2381
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
2382
+ // current active recognizer. but only if we don't already have an active recognizer
2383
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
2384
+ curRecognizer = session.curRecognizer = recognizer;
2385
+ }
2386
+ i++;
2387
+ }
2388
+ },
2389
+
2390
+ /**
2391
+ * get a recognizer by its event name.
2392
+ * @param {Recognizer|String} recognizer
2393
+ * @returns {Recognizer|Null}
2394
+ */
2395
+ get: function(recognizer) {
2396
+ if (recognizer instanceof Recognizer) {
2397
+ return recognizer;
2398
+ }
2399
+
2400
+ var recognizers = this.recognizers;
2401
+ for (var i = 0; i < recognizers.length; i++) {
2402
+ if (recognizers[i].options.event == recognizer) {
2403
+ return recognizers[i];
2404
+ }
2405
+ }
2406
+ return null;
2407
+ },
2408
+
2409
+ /**
2410
+ * add a recognizer to the manager
2411
+ * existing recognizers with the same event name will be removed
2412
+ * @param {Recognizer} recognizer
2413
+ * @returns {Recognizer|Manager}
2414
+ */
2415
+ add: function(recognizer) {
2416
+ if (invokeArrayArg(recognizer, 'add', this)) {
2417
+ return this;
2418
+ }
2419
+
2420
+ // remove existing
2421
+ var existing = this.get(recognizer.options.event);
2422
+ if (existing) {
2423
+ this.remove(existing);
2424
+ }
2425
+
2426
+ this.recognizers.push(recognizer);
2427
+ recognizer.manager = this;
2428
+
2429
+ this.touchAction.update();
2430
+ return recognizer;
2431
+ },
2432
+
2433
+ /**
2434
+ * remove a recognizer by name or instance
2435
+ * @param {Recognizer|String} recognizer
2436
+ * @returns {Manager}
2437
+ */
2438
+ remove: function(recognizer) {
2439
+ if (invokeArrayArg(recognizer, 'remove', this)) {
2440
+ return this;
2441
+ }
2442
+
2443
+ recognizer = this.get(recognizer);
2444
+
2445
+ // let's make sure this recognizer exists
2446
+ if (recognizer) {
2447
+ var recognizers = this.recognizers;
2448
+ var index = inArray(recognizers, recognizer);
2449
+
2450
+ if (index !== -1) {
2451
+ recognizers.splice(index, 1);
2452
+ this.touchAction.update();
2453
+ }
2454
+ }
2455
+
2456
+ return this;
2457
+ },
2458
+
2459
+ /**
2460
+ * bind event
2461
+ * @param {String} events
2462
+ * @param {Function} handler
2463
+ * @returns {EventEmitter} this
2464
+ */
2465
+ on: function(events, handler) {
2466
+ if (events === undefined$1) {
2467
+ return;
2468
+ }
2469
+ if (handler === undefined$1) {
2470
+ return;
2471
+ }
2472
+
2473
+ var handlers = this.handlers;
2474
+ each(splitStr(events), function(event) {
2475
+ handlers[event] = handlers[event] || [];
2476
+ handlers[event].push(handler);
2477
+ });
2478
+ return this;
2479
+ },
2480
+
2481
+ /**
2482
+ * unbind event, leave emit blank to remove all handlers
2483
+ * @param {String} events
2484
+ * @param {Function} [handler]
2485
+ * @returns {EventEmitter} this
2486
+ */
2487
+ off: function(events, handler) {
2488
+ if (events === undefined$1) {
2489
+ return;
2490
+ }
2491
+
2492
+ var handlers = this.handlers;
2493
+ each(splitStr(events), function(event) {
2494
+ if (!handler) {
2495
+ delete handlers[event];
2496
+ } else {
2497
+ handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
2498
+ }
2499
+ });
2500
+ return this;
2501
+ },
2502
+
2503
+ /**
2504
+ * emit event to the listeners
2505
+ * @param {String} event
2506
+ * @param {Object} data
2507
+ */
2508
+ emit: function(event, data) {
2509
+ // we also want to trigger dom events
2510
+ if (this.options.domEvents) {
2511
+ triggerDomEvent(event, data);
2512
+ }
2513
+
2514
+ // no handlers, so skip it all
2515
+ var handlers = this.handlers[event] && this.handlers[event].slice();
2516
+ if (!handlers || !handlers.length) {
2517
+ return;
2518
+ }
2519
+
2520
+ data.type = event;
2521
+ data.preventDefault = function() {
2522
+ data.srcEvent.preventDefault();
2523
+ };
2524
+
2525
+ var i = 0;
2526
+ while (i < handlers.length) {
2527
+ handlers[i](data);
2528
+ i++;
2529
+ }
2530
+ },
2531
+
2532
+ /**
2533
+ * destroy the manager and unbinds all events
2534
+ * it doesn't unbind dom events, that is the user own responsibility
2535
+ */
2536
+ destroy: function() {
2537
+ this.element && toggleCssProps(this, false);
2538
+
2539
+ this.handlers = {};
2540
+ this.session = {};
2541
+ this.input.destroy();
2542
+ this.element = null;
2543
+ }
2544
+ };
2545
+
2546
+ /**
2547
+ * add/remove the css properties as defined in manager.options.cssProps
2548
+ * @param {Manager} manager
2549
+ * @param {Boolean} add
2550
+ */
2551
+ function toggleCssProps(manager, add) {
2552
+ var element = manager.element;
2553
+ if (!element.style) {
2554
+ return;
2555
+ }
2556
+ var prop;
2557
+ each(manager.options.cssProps, function(value, name) {
2558
+ prop = prefixed(element.style, name);
2559
+ if (add) {
2560
+ manager.oldCssProps[prop] = element.style[prop];
2561
+ element.style[prop] = value;
2562
+ } else {
2563
+ element.style[prop] = manager.oldCssProps[prop] || '';
2564
+ }
2565
+ });
2566
+ if (!add) {
2567
+ manager.oldCssProps = {};
2568
+ }
2569
+ }
2570
+
2571
+ /**
2572
+ * trigger dom event
2573
+ * @param {String} event
2574
+ * @param {Object} data
2575
+ */
2576
+ function triggerDomEvent(event, data) {
2577
+ var gestureEvent = document.createEvent('Event');
2578
+ gestureEvent.initEvent(event, true, true);
2579
+ gestureEvent.gesture = data;
2580
+ data.target.dispatchEvent(gestureEvent);
2581
+ }
2582
+
2583
+ assign(Hammer, {
2584
+ INPUT_START: INPUT_START,
2585
+ INPUT_MOVE: INPUT_MOVE,
2586
+ INPUT_END: INPUT_END,
2587
+ INPUT_CANCEL: INPUT_CANCEL,
2588
+
2589
+ STATE_POSSIBLE: STATE_POSSIBLE,
2590
+ STATE_BEGAN: STATE_BEGAN,
2591
+ STATE_CHANGED: STATE_CHANGED,
2592
+ STATE_ENDED: STATE_ENDED,
2593
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
2594
+ STATE_CANCELLED: STATE_CANCELLED,
2595
+ STATE_FAILED: STATE_FAILED,
2596
+
2597
+ DIRECTION_NONE: DIRECTION_NONE,
2598
+ DIRECTION_LEFT: DIRECTION_LEFT,
2599
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
2600
+ DIRECTION_UP: DIRECTION_UP,
2601
+ DIRECTION_DOWN: DIRECTION_DOWN,
2602
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
2603
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
2604
+ DIRECTION_ALL: DIRECTION_ALL,
2605
+
2606
+ Manager: Manager,
2607
+ Input: Input,
2608
+ TouchAction: TouchAction,
2609
+
2610
+ TouchInput: TouchInput,
2611
+ MouseInput: MouseInput,
2612
+ PointerEventInput: PointerEventInput,
2613
+ TouchMouseInput: TouchMouseInput,
2614
+ SingleTouchInput: SingleTouchInput,
2615
+
2616
+ Recognizer: Recognizer,
2617
+ AttrRecognizer: AttrRecognizer,
2618
+ Tap: TapRecognizer,
2619
+ Pan: PanRecognizer,
2620
+ Swipe: SwipeRecognizer,
2621
+ Pinch: PinchRecognizer,
2622
+ Rotate: RotateRecognizer,
2623
+ Press: PressRecognizer,
2624
+
2625
+ on: addEventListeners,
2626
+ off: removeEventListeners,
2627
+ each: each,
2628
+ merge: merge,
2629
+ extend: extend,
2630
+ assign: assign,
2631
+ inherit: inherit,
2632
+ bindFn: bindFn,
2633
+ prefixed: prefixed
2634
+ });
2635
+
2636
+ // this prevents errors when Hammer is loaded in the presence of an AMD
2637
+ // style loader but by script tag, not by the loader.
2638
+ var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
2639
+ freeGlobal.Hammer = Hammer;
2640
+
2641
+ if (module.exports) {
2642
+ module.exports = Hammer;
2643
+ } else {
2644
+ window[exportName] = Hammer;
2645
+ }
2646
+
2647
+ })(window, document, 'Hammer');
2648
+ } (hammer$2));
2649
+ return hammer$2.exports;
2650
+ }
2651
+
2652
+ var hammerExports = requireHammer();
2653
+ var hammer = /*@__PURE__*/getDefaultExportFromCjs(hammerExports);
2654
+
2655
+ var hammer$1 = /*#__PURE__*/Object.freeze({
2656
+ __proto__: null,
2657
+ default: hammer
2658
+ });
2659
+
2660
+ export { hammer$1 as h };
2661
+ //# sourceMappingURL=hammer-C3JqVNyx.js.map
2662
+
2663
+ //# sourceMappingURL=hammer-C3JqVNyx.js.map