@zanichelli/albe-web-components 12.1.4-rc → 12.2.0-rc

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