@nanoporetech-digital/components 5.10.0 → 5.11.1

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 (737) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cjs/{algolia-data-6841724e.js → algolia-data-dba27b97.js} +2 -2
  3. package/dist/cjs/{algolia-data-6841724e.js.map → algolia-data-dba27b97.js.map} +1 -1
  4. package/dist/cjs/{algoliasearch-lite.esm.browser-992a2eff.js → algoliasearch-lite.esm.browser-b74ca774.js} +30 -5
  5. package/dist/cjs/algoliasearch-lite.esm.browser-b74ca774.js.map +1 -0
  6. package/dist/cjs/{component-store-6d7b8855.js → component-store-149aeffe.js} +2 -2
  7. package/dist/cjs/{component-store-6d7b8855.js.map → component-store-149aeffe.js.map} +1 -1
  8. package/dist/cjs/fade-dcabf3c1.js +211 -0
  9. package/dist/cjs/fade-dcabf3c1.js.map +1 -0
  10. package/dist/cjs/{form-control-8db579a2.js → form-control-f100407e.js} +2 -2
  11. package/dist/cjs/{form-control-8db579a2.js.map → form-control-f100407e.js.map} +1 -1
  12. package/dist/cjs/fullscreen-d24940a1.js +133 -0
  13. package/dist/cjs/fullscreen-d24940a1.js.map +1 -0
  14. package/dist/cjs/{global-3a6a7873.js → global-a5710651.js} +7 -7
  15. package/dist/cjs/{global-3a6a7873.js.map → global-a5710651.js.map} +1 -1
  16. package/dist/cjs/{index-1d3ebe1a.js → index-14451c95.js} +8 -6
  17. package/dist/cjs/index-14451c95.js.map +1 -0
  18. package/dist/cjs/{index-0f470227.js → index-f6f89d47.js} +2 -2
  19. package/dist/cjs/{index-0f470227.js.map → index-f6f89d47.js.map} +1 -1
  20. package/dist/cjs/lazyload-f6be7590.js +95 -0
  21. package/dist/cjs/lazyload-f6be7590.js.map +1 -0
  22. package/dist/cjs/loader.cjs.js +4 -4
  23. package/dist/cjs/loader.cjs.js.map +1 -1
  24. package/dist/cjs/nano-accordion.cjs.entry.js +1 -1
  25. package/dist/cjs/nano-alert.cjs.entry.js +3 -3
  26. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nano-algolia-filter.cjs.entry.js +3 -3
  28. package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -7
  30. package/dist/cjs/nano-algolia-pagination.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nano-algolia-results.cjs.entry.js +2 -2
  32. package/dist/cjs/nano-algolia-results.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nano-algolia.cjs.entry.js +982 -26
  34. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
  36. package/dist/cjs/nano-checkbox-group.cjs.entry.js +10 -4
  37. package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nano-checkbox.cjs.entry.js +4 -2
  39. package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nano-components.cjs.js +4 -4
  41. package/dist/cjs/nano-components.cjs.js.map +1 -1
  42. package/dist/cjs/nano-datalist_3.cjs.entry.js +4 -4
  43. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
  45. package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
  46. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
  47. package/dist/cjs/nano-demo.cjs.entry.js +1 -1
  48. package/dist/cjs/nano-details.cjs.entry.js +2 -2
  49. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nano-dialog.cjs.entry.js +5 -5
  51. package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
  52. package/dist/cjs/nano-drawer.cjs.entry.js +5 -5
  53. package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
  54. package/dist/cjs/nano-dropdown.cjs.entry.js +1 -1
  55. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  56. package/dist/cjs/nano-field-validator.cjs.entry.js +7 -5
  57. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  58. package/dist/cjs/nano-file-upload.cjs.entry.js +2 -2
  59. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  60. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +4 -4
  61. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  62. package/dist/cjs/nano-global-nav.cjs.entry.js +122 -153
  63. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  64. package/dist/cjs/nano-global-search-results.cjs.entry.js +4 -4
  65. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  66. package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
  67. package/dist/cjs/nano-grid_2.cjs.entry.js +2 -2
  68. package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -1
  69. package/dist/cjs/nano-hero.cjs.entry.js +2 -2
  70. package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
  71. package/dist/cjs/nano-icon-button_2.cjs.entry.js +24 -4
  72. package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
  73. package/dist/cjs/nano-icon.cjs.entry.js +4 -4
  74. package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
  75. package/dist/cjs/nano-input.cjs.entry.js +3 -3
  76. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  77. package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
  78. package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
  79. package/dist/cjs/nano-overflow-nav.cjs.entry.js +2 -2
  80. package/dist/cjs/nano-overflow-nav.cjs.entry.js.map +1 -1
  81. package/dist/cjs/nano-progress-bar.cjs.entry.js +2 -2
  82. package/dist/cjs/nano-progress-bar.cjs.entry.js.map +1 -1
  83. package/dist/cjs/nano-range.cjs.entry.js +2 -2
  84. package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
  85. package/dist/cjs/nano-rating.cjs.entry.js +2 -2
  86. package/dist/cjs/nano-rating.cjs.entry.js.map +1 -1
  87. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -1
  88. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  89. package/dist/cjs/nano-slides-2f3dcc02.js +2975 -0
  90. package/dist/cjs/nano-slides-2f3dcc02.js.map +1 -0
  91. package/dist/cjs/nano-slides.cjs.entry.js +3 -4292
  92. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  93. package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
  94. package/dist/cjs/nano-spinner.cjs.entry.js +2 -2
  95. package/dist/cjs/nano-spinner.cjs.entry.js.map +1 -1
  96. package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
  97. package/dist/cjs/nano-sticker.cjs.entry.js +3 -2
  98. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  99. package/dist/cjs/nano-tab-content.cjs.entry.js +1 -1
  100. package/dist/cjs/nano-tab-group.cjs.entry.js +4 -4
  101. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  102. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  103. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  104. package/dist/cjs/{nano-table-72d5dc63.js → nano-table-bbd65636.js} +5 -5
  105. package/dist/cjs/{nano-table-72d5dc63.js.map → nano-table-bbd65636.js.map} +1 -1
  106. package/dist/cjs/nano-table.cjs.entry.js +3 -3
  107. package/dist/cjs/page-dots-ae2cefb4.js +140 -0
  108. package/dist/cjs/page-dots-ae2cefb4.js.map +1 -0
  109. package/dist/cjs/{scroll-fc1b8387.js → scroll-e8c21f80.js} +8 -4
  110. package/dist/cjs/scroll-e8c21f80.js.map +1 -0
  111. package/dist/cjs/{table.worker-3df34efe.js → table.worker-ea98a8dd.js} +4 -4
  112. package/dist/cjs/table.worker-ea98a8dd.js.map +1 -0
  113. package/dist/collection/collection-manifest.json +1 -1
  114. package/dist/collection/components/alert/alert.css +1 -2
  115. package/dist/collection/components/algolia/algolia-data.js.map +1 -1
  116. package/dist/collection/components/algolia/algolia-filter.js.map +1 -1
  117. package/dist/collection/components/algolia/algolia-pagination.js +0 -5
  118. package/dist/collection/components/algolia/algolia-pagination.js.map +1 -1
  119. package/dist/collection/components/algolia/algolia-results.js.map +1 -1
  120. package/dist/collection/components/algolia/algolia.js +4 -27
  121. package/dist/collection/components/algolia/algolia.js.map +1 -1
  122. package/dist/collection/components/algolia/lib/squirrelly/browser.js +10 -0
  123. package/dist/collection/components/algolia/lib/squirrelly/browser.js.map +1 -0
  124. package/dist/collection/components/algolia/lib/squirrelly/compile-string.js +151 -0
  125. package/dist/collection/components/algolia/lib/squirrelly/compile-string.js.map +1 -0
  126. package/dist/collection/components/algolia/lib/squirrelly/compile.js +44 -0
  127. package/dist/collection/components/algolia/lib/squirrelly/compile.js.map +1 -0
  128. package/dist/collection/components/algolia/lib/squirrelly/config.js +68 -0
  129. package/dist/collection/components/algolia/lib/squirrelly/config.js.map +1 -0
  130. package/dist/collection/components/algolia/lib/squirrelly/container-utils.js +57 -0
  131. package/dist/collection/components/algolia/lib/squirrelly/container-utils.js.map +1 -0
  132. package/dist/collection/components/algolia/lib/squirrelly/containers.js +128 -0
  133. package/dist/collection/components/algolia/lib/squirrelly/containers.js.map +1 -0
  134. package/dist/collection/components/algolia/lib/squirrelly/err.js +39 -0
  135. package/dist/collection/components/algolia/lib/squirrelly/err.js.map +1 -0
  136. package/dist/collection/components/algolia/lib/squirrelly/parse.js +327 -0
  137. package/dist/collection/components/algolia/lib/squirrelly/parse.js.map +1 -0
  138. package/dist/collection/components/algolia/lib/squirrelly/render.js +62 -0
  139. package/dist/collection/components/algolia/lib/squirrelly/render.js.map +1 -0
  140. package/dist/collection/components/algolia/lib/squirrelly/storage.js +32 -0
  141. package/dist/collection/components/algolia/lib/squirrelly/storage.js.map +1 -0
  142. package/dist/collection/components/algolia/lib/squirrelly/utils.js +102 -0
  143. package/dist/collection/components/algolia/lib/squirrelly/utils.js.map +1 -0
  144. package/dist/collection/{utils → components/algolia/lib}/template.js +1 -2
  145. package/dist/collection/components/algolia/lib/template.js.map +1 -0
  146. package/dist/collection/components/checkbox/checkbox-group.css +17 -15
  147. package/dist/collection/components/checkbox/checkbox-group.js +29 -2
  148. package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
  149. package/dist/collection/components/checkbox/checkbox.css +20 -22
  150. package/dist/collection/components/checkbox/checkbox.js +2 -0
  151. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  152. package/dist/collection/components/date-picker/date-picker.css +5 -10
  153. package/dist/collection/components/details/details.css +4 -4
  154. package/dist/collection/components/dialog/dialog.css +3 -6
  155. package/dist/collection/components/dialog/dialog.js +1 -1
  156. package/dist/collection/components/dialog/dialog.js.map +1 -1
  157. package/dist/collection/components/drawer/drawer.css +18 -24
  158. package/dist/collection/components/drawer/drawer.js +1 -1
  159. package/dist/collection/components/drawer/drawer.js.map +1 -1
  160. package/dist/collection/components/dropdown/dropdown.js +1 -1
  161. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  162. package/dist/collection/components/field-validator/field-validator.js +5 -3
  163. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  164. package/dist/collection/components/file-upload/file-upload.css +16 -30
  165. package/dist/collection/components/global-nav/global-nav.js +118 -157
  166. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  167. package/dist/collection/components/global-nav/style/global-nav.css +97 -138
  168. package/dist/collection/components/global-search-results/global-search-results.css +85 -127
  169. package/dist/collection/components/global-search-results/global-search-results.js +2 -2
  170. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  171. package/dist/collection/components/hero/hero.css +13 -26
  172. package/dist/collection/components/icon/icon.css +6 -6
  173. package/dist/collection/components/icon/icon.js +2 -2
  174. package/dist/collection/components/icon/icon.js.map +1 -1
  175. package/dist/collection/components/img/img.css +7 -17
  176. package/dist/collection/components/input/input.css +15 -36
  177. package/dist/collection/components/menu/menu.css +1 -1
  178. package/dist/collection/components/menu/menu.js +1 -1
  179. package/dist/collection/components/menu/menu.js.map +1 -1
  180. package/dist/collection/components/menu-drawer/menu-drawer.css +5 -14
  181. package/dist/collection/components/nav-item/nav-item.css +25 -46
  182. package/dist/collection/components/option/option.css +3 -5
  183. package/dist/collection/components/overflow-nav/overflow-nav.css +16 -27
  184. package/dist/collection/components/progress-bar/progress-bar.css +2 -2
  185. package/dist/collection/components/range/range.css +17 -19
  186. package/dist/collection/components/rating/rating.css +2 -8
  187. package/dist/collection/components/select/select.css +30 -53
  188. package/dist/collection/components/slides/lib/js/animate.js +29 -54
  189. package/dist/collection/components/slides/lib/js/animate.js.map +1 -0
  190. package/dist/collection/components/slides/lib/js/cell.js +12 -24
  191. package/dist/collection/components/slides/lib/js/cell.js.map +1 -0
  192. package/dist/collection/components/slides/lib/js/drag.js +65 -116
  193. package/dist/collection/components/slides/lib/js/drag.js.map +1 -0
  194. package/dist/collection/components/slides/lib/js/fade.js +52 -79
  195. package/dist/collection/components/slides/lib/js/fade.js.map +1 -0
  196. package/dist/collection/components/slides/lib/js/flickity.js +118 -206
  197. package/dist/collection/components/slides/lib/js/flickity.js.map +1 -0
  198. package/dist/collection/components/slides/lib/js/fullscreen.js +21 -40
  199. package/dist/collection/components/slides/lib/js/fullscreen.js.map +1 -0
  200. package/dist/collection/components/slides/lib/js/index.js +4 -6
  201. package/dist/collection/components/slides/lib/js/index.js.map +1 -0
  202. package/dist/collection/components/slides/lib/js/lazyload.js +21 -36
  203. package/dist/collection/components/slides/lib/js/lazyload.js.map +1 -0
  204. package/dist/collection/components/slides/lib/js/page-dots.js +21 -45
  205. package/dist/collection/components/slides/lib/js/page-dots.js.map +1 -0
  206. package/dist/collection/components/slides/lib/js/player.js +12 -40
  207. package/dist/collection/components/slides/lib/js/player.js.map +1 -0
  208. package/dist/collection/components/slides/lib/js/prev-next-button.js +24 -52
  209. package/dist/collection/components/slides/lib/js/prev-next-button.js.map +1 -0
  210. package/dist/collection/components/slides/lib/js/slide.js +10 -15
  211. package/dist/collection/components/slides/lib/js/slide.js.map +1 -0
  212. package/dist/collection/components/slides/lib/js/utils/event-emitter.js +75 -0
  213. package/dist/collection/components/slides/lib/js/utils/event-emitter.js.map +1 -0
  214. package/dist/collection/components/slides/lib/js/utils/gestures.js +436 -0
  215. package/dist/collection/components/slides/lib/js/utils/gestures.js.map +1 -0
  216. package/dist/collection/components/slides/lib/js/utils/get-size.js +160 -0
  217. package/dist/collection/components/slides/lib/js/utils/get-size.js.map +1 -0
  218. package/dist/collection/components/slides/lib/js/utils/utils.js +166 -0
  219. package/dist/collection/components/slides/lib/js/utils/utils.js.map +1 -0
  220. package/dist/collection/components/slides/slides.css +18 -19
  221. package/dist/collection/components/slides/slides.js +31 -5
  222. package/dist/collection/components/slides/slides.js.map +1 -1
  223. package/dist/collection/components/spinner/spinner.css +1 -2
  224. package/dist/collection/components/sticker/sticker.js +2 -1
  225. package/dist/collection/components/sticker/sticker.js.map +1 -1
  226. package/dist/collection/components/table/table.css +29 -48
  227. package/dist/collection/components/tabs/tab-group.css +10 -14
  228. package/dist/collection/components/tabs/tab.css +8 -18
  229. package/dist/collection/components/tooltip/tooltip.css +34 -31
  230. package/dist/collection/components/tooltip/tooltip.js +23 -3
  231. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  232. package/dist/collection/global/script/global.js +6 -6
  233. package/dist/collection/global/script/global.js.map +1 -1
  234. package/dist/collection/utils/scroll.js +7 -3
  235. package/dist/collection/utils/scroll.js.map +1 -1
  236. package/dist/components/algolia-data.js.map +1 -1
  237. package/dist/components/algolia.js +978 -23
  238. package/dist/components/algolia.js.map +1 -1
  239. package/dist/components/algoliasearch-lite.esm.browser.js +29 -4
  240. package/dist/components/algoliasearch-lite.esm.browser.js.map +1 -1
  241. package/dist/components/date-picker.js +1 -1
  242. package/dist/components/date-picker.js.map +1 -1
  243. package/dist/components/dropdown.js +1 -1
  244. package/dist/components/dropdown.js.map +1 -1
  245. package/dist/components/fade.js +208 -0
  246. package/dist/components/fade.js.map +1 -0
  247. package/dist/components/fullscreen.js +130 -0
  248. package/dist/components/fullscreen.js.map +1 -0
  249. package/dist/components/icon.js +3 -3
  250. package/dist/components/icon.js.map +1 -1
  251. package/dist/components/img.js +1 -1
  252. package/dist/components/img.js.map +1 -1
  253. package/dist/components/index.js +6 -6
  254. package/dist/components/index.js.map +1 -1
  255. package/dist/components/input.js +1 -1
  256. package/dist/components/input.js.map +1 -1
  257. package/dist/components/lazyload.js +92 -0
  258. package/dist/components/lazyload.js.map +1 -0
  259. package/dist/components/menu.js +2 -2
  260. package/dist/components/menu.js.map +1 -1
  261. package/dist/components/nano-alert.js +1 -1
  262. package/dist/components/nano-alert.js.map +1 -1
  263. package/dist/components/nano-algolia-filter.js.map +1 -1
  264. package/dist/components/nano-algolia-pagination.js +0 -5
  265. package/dist/components/nano-algolia-pagination.js.map +1 -1
  266. package/dist/components/nano-algolia-results.js.map +1 -1
  267. package/dist/components/nano-checkbox-group.js +10 -3
  268. package/dist/components/nano-checkbox-group.js.map +1 -1
  269. package/dist/components/nano-checkbox.js +3 -1
  270. package/dist/components/nano-checkbox.js.map +1 -1
  271. package/dist/components/nano-details.js +1 -1
  272. package/dist/components/nano-details.js.map +1 -1
  273. package/dist/components/nano-dialog.js +2 -2
  274. package/dist/components/nano-dialog.js.map +1 -1
  275. package/dist/components/nano-drawer.js +2 -2
  276. package/dist/components/nano-drawer.js.map +1 -1
  277. package/dist/components/nano-field-validator.js +5 -3
  278. package/dist/components/nano-field-validator.js.map +1 -1
  279. package/dist/components/nano-file-upload.js +1 -1
  280. package/dist/components/nano-file-upload.js.map +1 -1
  281. package/dist/components/nano-global-nav.js +119 -152
  282. package/dist/components/nano-global-nav.js.map +1 -1
  283. package/dist/components/nano-global-search-results.js +3 -3
  284. package/dist/components/nano-global-search-results.js.map +1 -1
  285. package/dist/components/nano-hero.js +1 -1
  286. package/dist/components/nano-hero.js.map +1 -1
  287. package/dist/components/nano-menu-drawer.js +1 -1
  288. package/dist/components/nano-menu-drawer.js.map +1 -1
  289. package/dist/components/nano-overflow-nav.js +1 -1
  290. package/dist/components/nano-overflow-nav.js.map +1 -1
  291. package/dist/components/nano-range.js +1 -1
  292. package/dist/components/nano-range.js.map +1 -1
  293. package/dist/components/nano-rating.js +1 -1
  294. package/dist/components/nano-rating.js.map +1 -1
  295. package/dist/components/nano-slides.js +760 -2090
  296. package/dist/components/nano-slides.js.map +1 -1
  297. package/dist/components/nano-tab-group.js +1 -1
  298. package/dist/components/nano-tab-group.js.map +1 -1
  299. package/dist/components/nano-tab.js +1 -1
  300. package/dist/components/nano-tab.js.map +1 -1
  301. package/dist/components/nav-item.js +1 -1
  302. package/dist/components/nav-item.js.map +1 -1
  303. package/dist/components/option.js +1 -1
  304. package/dist/components/option.js.map +1 -1
  305. package/dist/components/page-dots.js +137 -0
  306. package/dist/components/page-dots.js.map +1 -0
  307. package/dist/components/progress-bar.js +1 -1
  308. package/dist/components/progress-bar.js.map +1 -1
  309. package/dist/components/scroll.js +7 -3
  310. package/dist/components/scroll.js.map +1 -1
  311. package/dist/components/select.js +1 -1
  312. package/dist/components/select.js.map +1 -1
  313. package/dist/components/spinner.js +1 -1
  314. package/dist/components/spinner.js.map +1 -1
  315. package/dist/components/sticker.js +2 -1
  316. package/dist/components/sticker.js.map +1 -1
  317. package/dist/components/table.js +1 -1
  318. package/dist/components/table.js.map +1 -1
  319. package/dist/components/tooltip.js +24 -4
  320. package/dist/components/tooltip.js.map +1 -1
  321. package/dist/esm/{algolia-data-ebf2a439.js → algolia-data-1b42827c.js} +2 -2
  322. package/dist/esm/{algolia-data-ebf2a439.js.map → algolia-data-1b42827c.js.map} +1 -1
  323. package/dist/esm/{algoliasearch-lite.esm.browser-04891fdc.js → algoliasearch-lite.esm.browser-d71a28dc.js} +30 -5
  324. package/dist/esm/algoliasearch-lite.esm.browser-d71a28dc.js.map +1 -0
  325. package/dist/esm/{component-store-54df2005.js → component-store-f7eb0a56.js} +2 -2
  326. package/dist/esm/{component-store-54df2005.js.map → component-store-f7eb0a56.js.map} +1 -1
  327. package/dist/esm/fade-1aa7a6db.js +209 -0
  328. package/dist/esm/fade-1aa7a6db.js.map +1 -0
  329. package/dist/esm/{form-control-eb06e009.js → form-control-881fa3af.js} +2 -2
  330. package/dist/esm/{form-control-eb06e009.js.map → form-control-881fa3af.js.map} +1 -1
  331. package/dist/esm/fullscreen-86fa276a.js +131 -0
  332. package/dist/esm/fullscreen-86fa276a.js.map +1 -0
  333. package/dist/esm/{global-f6e05656.js → global-be484e8c.js} +7 -7
  334. package/dist/esm/{global-f6e05656.js.map → global-be484e8c.js.map} +1 -1
  335. package/dist/esm/{index-e8891229.js → index-3003356f.js} +2 -2
  336. package/dist/esm/{index-e8891229.js.map → index-3003356f.js.map} +1 -1
  337. package/dist/esm/{index-06666022.js → index-9695db0a.js} +8 -6
  338. package/dist/esm/index-9695db0a.js.map +1 -0
  339. package/dist/esm/lazyload-994232a6.js +93 -0
  340. package/dist/esm/lazyload-994232a6.js.map +1 -0
  341. package/dist/esm/loader.js +5 -5
  342. package/dist/esm/loader.js.map +1 -1
  343. package/dist/esm/nano-accordion.entry.js +1 -1
  344. package/dist/esm/nano-alert.entry.js +3 -3
  345. package/dist/esm/nano-alert.entry.js.map +1 -1
  346. package/dist/esm/nano-algolia-filter.entry.js +3 -3
  347. package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
  348. package/dist/esm/nano-algolia-pagination.entry.js +2 -7
  349. package/dist/esm/nano-algolia-pagination.entry.js.map +1 -1
  350. package/dist/esm/nano-algolia-results.entry.js +2 -2
  351. package/dist/esm/nano-algolia-results.entry.js.map +1 -1
  352. package/dist/esm/nano-algolia.entry.js +982 -26
  353. package/dist/esm/nano-algolia.entry.js.map +1 -1
  354. package/dist/esm/nano-aspect-ratio.entry.js +1 -1
  355. package/dist/esm/nano-checkbox-group.entry.js +10 -4
  356. package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
  357. package/dist/esm/nano-checkbox.entry.js +4 -2
  358. package/dist/esm/nano-checkbox.entry.js.map +1 -1
  359. package/dist/esm/nano-components.js +5 -5
  360. package/dist/esm/nano-components.js.map +1 -1
  361. package/dist/esm/nano-datalist_3.entry.js +4 -4
  362. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  363. package/dist/esm/nano-date-input.entry.js +1 -1
  364. package/dist/esm/nano-date-picker.entry.js +2 -2
  365. package/dist/esm/nano-date-picker.entry.js.map +1 -1
  366. package/dist/esm/nano-demo.entry.js +1 -1
  367. package/dist/esm/nano-details.entry.js +2 -2
  368. package/dist/esm/nano-details.entry.js.map +1 -1
  369. package/dist/esm/nano-dialog.entry.js +5 -5
  370. package/dist/esm/nano-dialog.entry.js.map +1 -1
  371. package/dist/esm/nano-drawer.entry.js +5 -5
  372. package/dist/esm/nano-drawer.entry.js.map +1 -1
  373. package/dist/esm/nano-dropdown.entry.js +1 -1
  374. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  375. package/dist/esm/nano-field-validator.entry.js +7 -5
  376. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  377. package/dist/esm/nano-file-upload.entry.js +2 -2
  378. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  379. package/dist/esm/nano-global-nav-user-profile_3.entry.js +4 -4
  380. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  381. package/dist/esm/nano-global-nav.entry.js +122 -153
  382. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  383. package/dist/esm/nano-global-search-results.entry.js +4 -4
  384. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  385. package/dist/esm/nano-grid-item.entry.js +1 -1
  386. package/dist/esm/nano-grid_2.entry.js +2 -2
  387. package/dist/esm/nano-grid_2.entry.js.map +1 -1
  388. package/dist/esm/nano-hero.entry.js +2 -2
  389. package/dist/esm/nano-hero.entry.js.map +1 -1
  390. package/dist/esm/nano-icon-button_2.entry.js +24 -4
  391. package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
  392. package/dist/esm/nano-icon.entry.js +4 -4
  393. package/dist/esm/nano-icon.entry.js.map +1 -1
  394. package/dist/esm/nano-input.entry.js +3 -3
  395. package/dist/esm/nano-input.entry.js.map +1 -1
  396. package/dist/esm/nano-menu-drawer.entry.js +2 -2
  397. package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
  398. package/dist/esm/nano-overflow-nav.entry.js +2 -2
  399. package/dist/esm/nano-overflow-nav.entry.js.map +1 -1
  400. package/dist/esm/nano-progress-bar.entry.js +2 -2
  401. package/dist/esm/nano-progress-bar.entry.js.map +1 -1
  402. package/dist/esm/nano-range.entry.js +2 -2
  403. package/dist/esm/nano-range.entry.js.map +1 -1
  404. package/dist/esm/nano-rating.entry.js +2 -2
  405. package/dist/esm/nano-rating.entry.js.map +1 -1
  406. package/dist/esm/nano-resize-observe_2.entry.js +1 -1
  407. package/dist/esm/nano-slide.entry.js +1 -1
  408. package/dist/esm/nano-slides-9908c44d.js +2970 -0
  409. package/dist/esm/nano-slides-9908c44d.js.map +1 -0
  410. package/dist/esm/nano-slides.entry.js +2 -4295
  411. package/dist/esm/nano-slides.entry.js.map +1 -1
  412. package/dist/esm/nano-sortable.entry.js +1 -1
  413. package/dist/esm/nano-spinner.entry.js +2 -2
  414. package/dist/esm/nano-spinner.entry.js.map +1 -1
  415. package/dist/esm/nano-split-pane.entry.js +1 -1
  416. package/dist/esm/nano-sticker.entry.js +3 -2
  417. package/dist/esm/nano-sticker.entry.js.map +1 -1
  418. package/dist/esm/nano-tab-content.entry.js +1 -1
  419. package/dist/esm/nano-tab-group.entry.js +4 -4
  420. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  421. package/dist/esm/nano-tab.entry.js +2 -2
  422. package/dist/esm/nano-tab.entry.js.map +1 -1
  423. package/dist/esm/{nano-table-5af42ba4.js → nano-table-3ab8cd85.js} +5 -5
  424. package/dist/esm/{nano-table-5af42ba4.js.map → nano-table-3ab8cd85.js.map} +1 -1
  425. package/dist/esm/nano-table.entry.js +3 -3
  426. package/dist/esm/page-dots-467ace2e.js +138 -0
  427. package/dist/esm/page-dots-467ace2e.js.map +1 -0
  428. package/dist/esm/{scroll-ec7ac257.js → scroll-ac332213.js} +8 -4
  429. package/dist/esm/scroll-ac332213.js.map +1 -0
  430. package/dist/esm/{table.worker-3cae908c.js → table.worker-75d6e1d2.js} +4 -4
  431. package/dist/esm/table.worker-75d6e1d2.js.map +1 -0
  432. package/dist/nano-components/{p-74a7fc4f.js → active-element-75b7c8a0.js} +1 -1
  433. package/dist/nano-components/algolia-data-1b42827c.js +5 -0
  434. package/dist/nano-components/{p-a26bdb65.js.map → algolia-data-1b42827c.js.map} +1 -1
  435. package/dist/nano-components/algoliasearch-lite.esm.browser-d71a28dc.js +5 -0
  436. package/dist/nano-components/algoliasearch-lite.esm.browser-d71a28dc.js.map +1 -0
  437. package/dist/nano-components/component-store-f7eb0a56.js +5 -0
  438. package/dist/nano-components/{p-dd5687db.js.map → component-store-f7eb0a56.js.map} +1 -1
  439. package/dist/nano-components/{p-cecb9af1.js → date-utils-6b7a6e1f.js} +1 -1
  440. package/dist/nano-components/{p-cdfc507e.js → dom-8599fac1.js} +1 -1
  441. package/dist/nano-components/{p-842cf127.js → drag-1723a4cc.js} +1 -1
  442. package/dist/nano-components/{p-9bfdee71.js → events-6a805b42.js} +1 -1
  443. package/dist/nano-components/fade-1aa7a6db.js +5 -0
  444. package/dist/nano-components/fade-1aa7a6db.js.map +1 -0
  445. package/dist/nano-components/{p-f8f89998.js → focus-visible-8b2c14da.js} +1 -1
  446. package/dist/nano-components/form-control-881fa3af.js +5 -0
  447. package/dist/nano-components/{p-dc805ecc.js.map → form-control-881fa3af.js.map} +1 -1
  448. package/dist/nano-components/fullscreen-86fa276a.js +5 -0
  449. package/dist/nano-components/fullscreen-86fa276a.js.map +1 -0
  450. package/dist/nano-components/{p-d4f6ec9f.js → global-be484e8c.js} +2 -2
  451. package/dist/nano-components/{p-d4f6ec9f.js.map → global-be484e8c.js.map} +1 -1
  452. package/dist/nano-components/index-3003356f.js +5 -0
  453. package/dist/nano-components/{p-70747f20.js.map → index-3003356f.js.map} +1 -1
  454. package/dist/nano-components/{p-d6a04b3a.js → index-9695db0a.js} +2 -2
  455. package/dist/nano-components/{p-d6a04b3a.js.map → index-9695db0a.js.map} +1 -1
  456. package/dist/nano-components/{p-bb07c3d0.js → index-f626f476.js} +1 -1
  457. package/dist/nano-components/index.esm.js +1 -1
  458. package/dist/nano-components/index.esm.js.map +1 -1
  459. package/dist/nano-components/lazyload-994232a6.js +5 -0
  460. package/dist/nano-components/lazyload-994232a6.js.map +1 -0
  461. package/dist/nano-components/{p-2155fc2c.js → local-my-account-6662da72.js} +1 -1
  462. package/dist/nano-components/{p-ee045579.js → math-c02ddfda.js} +1 -1
  463. package/dist/nano-components/modal-bd9638c0.js +5 -0
  464. package/dist/nano-components/{p-2234694a.js.map → modal-bd9638c0.js.map} +1 -1
  465. package/dist/nano-components/nano-accordion.entry.js +5 -0
  466. package/dist/nano-components/{p-9f60ff14.entry.js.map → nano-accordion.entry.js.map} +1 -1
  467. package/dist/nano-components/nano-alert.entry.js +5 -0
  468. package/dist/nano-components/{p-191352c4.entry.js.map → nano-alert.entry.js.map} +1 -1
  469. package/dist/nano-components/nano-algolia-filter.entry.js +5 -0
  470. package/dist/nano-components/nano-algolia-filter.entry.js.map +1 -0
  471. package/dist/nano-components/nano-algolia-pagination.entry.js +5 -0
  472. package/dist/nano-components/nano-algolia-pagination.entry.js.map +1 -0
  473. package/dist/nano-components/nano-algolia-results.entry.js +5 -0
  474. package/dist/nano-components/nano-algolia-results.entry.js.map +1 -0
  475. package/dist/nano-components/nano-algolia.entry.js +5 -0
  476. package/dist/nano-components/nano-algolia.entry.js.map +1 -0
  477. package/dist/nano-components/nano-aspect-ratio.entry.js +5 -0
  478. package/dist/nano-components/{p-87329424.entry.js.map → nano-aspect-ratio.entry.js.map} +1 -1
  479. package/dist/nano-components/nano-checkbox-group.entry.js +5 -0
  480. package/dist/nano-components/nano-checkbox-group.entry.js.map +1 -0
  481. package/dist/nano-components/nano-checkbox.entry.js +5 -0
  482. package/dist/nano-components/nano-checkbox.entry.js.map +1 -0
  483. package/dist/nano-components/nano-components.css +1 -1
  484. package/dist/nano-components/nano-components.esm.js +1 -1
  485. package/dist/nano-components/nano-components.esm.js.map +1 -1
  486. package/dist/nano-components/nano-datalist_3.entry.js +5 -0
  487. package/dist/nano-components/nano-datalist_3.entry.js.map +1 -0
  488. package/dist/nano-components/nano-date-input.entry.js +5 -0
  489. package/dist/nano-components/{p-d4e44f93.entry.js.map → nano-date-input.entry.js.map} +1 -1
  490. package/dist/nano-components/nano-date-picker.entry.js +5 -0
  491. package/dist/nano-components/{p-efd3e121.entry.js.map → nano-date-picker.entry.js.map} +1 -1
  492. package/dist/nano-components/nano-demo.entry.js +5 -0
  493. package/dist/nano-components/{p-e98835e2.entry.js.map → nano-demo.entry.js.map} +1 -1
  494. package/dist/nano-components/nano-details.entry.js +5 -0
  495. package/dist/nano-components/nano-details.entry.js.map +1 -0
  496. package/dist/nano-components/nano-dialog.entry.js +5 -0
  497. package/dist/nano-components/{p-79fff4fd.entry.js.map → nano-dialog.entry.js.map} +1 -1
  498. package/dist/nano-components/nano-drawer.entry.js +5 -0
  499. package/dist/nano-components/nano-drawer.entry.js.map +1 -0
  500. package/dist/nano-components/nano-dropdown.entry.js +5 -0
  501. package/dist/nano-components/nano-dropdown.entry.js.map +1 -0
  502. package/dist/nano-components/nano-field-validator.entry.js +5 -0
  503. package/dist/nano-components/nano-field-validator.entry.js.map +1 -0
  504. package/dist/nano-components/nano-file-upload.entry.js +5 -0
  505. package/dist/nano-components/nano-file-upload.entry.js.map +1 -0
  506. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js +5 -0
  507. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js.map +1 -0
  508. package/dist/nano-components/nano-global-nav.entry.js +5 -0
  509. package/dist/nano-components/nano-global-nav.entry.js.map +1 -0
  510. package/dist/nano-components/nano-global-search-results.entry.js +5 -0
  511. package/dist/nano-components/nano-global-search-results.entry.js.map +1 -0
  512. package/dist/nano-components/nano-grid-item.entry.js +5 -0
  513. package/dist/nano-components/{p-9c290055.entry.js.map → nano-grid-item.entry.js.map} +1 -1
  514. package/dist/nano-components/nano-grid_2.entry.js +5 -0
  515. package/dist/nano-components/{p-7c82af28.entry.js.map → nano-grid_2.entry.js.map} +1 -1
  516. package/dist/nano-components/nano-hero.entry.js +5 -0
  517. package/dist/nano-components/{p-328ef9d3.entry.js.map → nano-hero.entry.js.map} +1 -1
  518. package/dist/nano-components/nano-icon-button_2.entry.js +5 -0
  519. package/dist/nano-components/nano-icon-button_2.entry.js.map +1 -0
  520. package/dist/nano-components/nano-icon.entry.js +5 -0
  521. package/dist/nano-components/nano-icon.entry.js.map +1 -0
  522. package/dist/nano-components/nano-input.entry.js +5 -0
  523. package/dist/nano-components/nano-input.entry.js.map +1 -0
  524. package/dist/nano-components/nano-menu-drawer.entry.js +5 -0
  525. package/dist/nano-components/nano-menu-drawer.entry.js.map +1 -0
  526. package/dist/nano-components/nano-overflow-nav.entry.js +5 -0
  527. package/dist/nano-components/nano-overflow-nav.entry.js.map +1 -0
  528. package/dist/nano-components/nano-progress-bar.entry.js +5 -0
  529. package/dist/nano-components/nano-progress-bar.entry.js.map +1 -0
  530. package/dist/nano-components/nano-range.entry.js +5 -0
  531. package/dist/nano-components/nano-range.entry.js.map +1 -0
  532. package/dist/nano-components/nano-rating.entry.js +5 -0
  533. package/dist/nano-components/nano-rating.entry.js.map +1 -0
  534. package/dist/nano-components/nano-resize-observe_2.entry.js +5 -0
  535. package/dist/nano-components/{p-e6a0675e.entry.js.map → nano-resize-observe_2.entry.js.map} +1 -1
  536. package/dist/nano-components/nano-slide.entry.js +5 -0
  537. package/dist/nano-components/{p-3d8fb8a1.entry.js.map → nano-slide.entry.js.map} +1 -1
  538. package/dist/nano-components/nano-slides-9908c44d.js +20 -0
  539. package/dist/nano-components/nano-slides-9908c44d.js.map +1 -0
  540. package/dist/nano-components/nano-slides.entry.js +5 -0
  541. package/dist/nano-components/nano-sortable.entry.js +5 -0
  542. package/dist/nano-components/{p-3ae362ae.entry.js.map → nano-sortable.entry.js.map} +1 -1
  543. package/dist/nano-components/nano-spinner.entry.js +5 -0
  544. package/dist/nano-components/{p-9925e504.entry.js.map → nano-spinner.entry.js.map} +1 -1
  545. package/dist/nano-components/nano-split-pane.entry.js +5 -0
  546. package/dist/nano-components/{p-6c4171fa.entry.js.map → nano-split-pane.entry.js.map} +1 -1
  547. package/dist/nano-components/nano-sticker.entry.js +5 -0
  548. package/dist/nano-components/nano-sticker.entry.js.map +1 -0
  549. package/dist/nano-components/nano-tab-content.entry.js +5 -0
  550. package/dist/nano-components/{p-3f40e370.entry.js.map → nano-tab-content.entry.js.map} +1 -1
  551. package/dist/nano-components/nano-tab-group.entry.js +5 -0
  552. package/dist/nano-components/nano-tab-group.entry.js.map +1 -0
  553. package/dist/nano-components/nano-tab.entry.js +5 -0
  554. package/dist/nano-components/{p-3cac5f6d.entry.js.map → nano-tab.entry.js.map} +1 -1
  555. package/dist/nano-components/nano-table-3ab8cd85.js +5 -0
  556. package/dist/nano-components/nano-table-3ab8cd85.js.map +1 -0
  557. package/dist/nano-components/nano-table.entry.js +5 -0
  558. package/dist/nano-components/page-dots-467ace2e.js +5 -0
  559. package/dist/nano-components/page-dots-467ace2e.js.map +1 -0
  560. package/dist/nano-components/{p-cd1fd454.js → popover-e5e7a641.js} +1 -1
  561. package/dist/nano-components/scroll-ac332213.js +5 -0
  562. package/dist/nano-components/scroll-ac332213.js.map +1 -0
  563. package/dist/nano-components/{p-dc565459.js → slot-8126e238.js} +1 -1
  564. package/dist/nano-components/{p-f88fa15c.js → tabbable-26a66a22.js} +1 -1
  565. package/dist/nano-components/table.worker-75d6e1d2.js +5 -0
  566. package/dist/nano-components/{p-411bb8f1.js → theme-82feb8cf.js} +1 -1
  567. package/dist/nano-components/{p-7bff5224.js → throttle-ac4fcefa.js} +1 -1
  568. package/dist/nano-components/{p-c3e8e3f9.js → transitions-fb09eb32.js} +1 -1
  569. package/dist/themes/nanopore.cn.css +1 -1
  570. package/dist/themes/nanopore.cn.css.map +1 -1
  571. package/dist/themes/nanopore.css +1 -1
  572. package/dist/themes/nanopore.css.map +1 -1
  573. package/dist/types/components/algolia/algolia-data.d.ts +1 -1
  574. package/dist/types/components/algolia/algolia-filter.d.ts +1 -1
  575. package/dist/types/components/algolia/algolia-pagination.d.ts +1 -1
  576. package/dist/types/components/algolia/algolia-results.d.ts +1 -1
  577. package/dist/types/components/algolia/algolia.d.ts +1 -7
  578. package/dist/types/components/algolia/lib/squirrelly/browser.d.ts +6 -0
  579. package/dist/types/components/algolia/lib/squirrelly/compile-string.d.ts +5 -0
  580. package/dist/types/components/algolia/lib/squirrelly/compile.d.ts +3 -0
  581. package/dist/types/components/algolia/lib/squirrelly/config.d.ts +48 -0
  582. package/dist/types/components/algolia/lib/squirrelly/container-utils.d.ts +8 -0
  583. package/dist/types/components/algolia/lib/squirrelly/containers.d.ts +18 -0
  584. package/dist/types/components/algolia/lib/squirrelly/err.d.ts +6 -0
  585. package/dist/types/components/algolia/lib/squirrelly/parse.d.ts +23 -0
  586. package/dist/types/components/algolia/lib/squirrelly/render.d.ts +3 -0
  587. package/dist/types/components/algolia/lib/squirrelly/storage.d.ts +13 -0
  588. package/dist/types/components/algolia/lib/squirrelly/utils.d.ts +8 -0
  589. package/dist/types/components/algolia/lib/template.d.ts +2 -0
  590. package/dist/types/components/checkbox/checkbox-group.d.ts +5 -0
  591. package/dist/types/components/global-nav/global-nav.d.ts +15 -20
  592. package/dist/types/components/slides/lib/js/animate.d.ts +2 -0
  593. package/dist/types/components/slides/lib/js/cell.d.ts +1 -0
  594. package/dist/types/components/slides/lib/js/drag.d.ts +1 -0
  595. package/dist/types/components/slides/lib/js/fade.d.ts +1 -0
  596. package/dist/types/components/slides/lib/js/flickity.d.ts +23 -0
  597. package/dist/types/components/slides/lib/js/fullscreen.d.ts +1 -0
  598. package/dist/types/components/slides/lib/js/index.d.ts +5 -0
  599. package/dist/types/components/slides/lib/js/lazyload.d.ts +1 -0
  600. package/dist/types/components/slides/lib/js/page-dots.d.ts +1 -0
  601. package/dist/types/components/slides/lib/js/player.d.ts +1 -0
  602. package/dist/types/components/slides/lib/js/prev-next-button.d.ts +1 -0
  603. package/dist/types/components/slides/lib/js/slide.d.ts +1 -0
  604. package/dist/types/components/slides/lib/js/utils/event-emitter.d.ts +1 -0
  605. package/dist/types/components/slides/lib/js/utils/gestures.d.ts +26 -0
  606. package/dist/types/components/slides/lib/js/utils/get-size.d.ts +6 -0
  607. package/dist/types/components/slides/lib/js/utils/utils.d.ts +5 -0
  608. package/dist/types/components/slides/slides-interface.d.ts +17 -7
  609. package/dist/types/components/slides/slides.d.ts +5 -0
  610. package/dist/types/components.d.ts +10 -10
  611. package/dist/types/utils/scroll.d.ts +5 -1
  612. package/docs-json.json +33 -24
  613. package/docs-vscode.json +4 -0
  614. package/hydrate/index.js +4147 -3953
  615. package/package.json +5 -8
  616. package/dist/cjs/_commonjsHelpers-29614748.js +0 -30
  617. package/dist/cjs/_commonjsHelpers-29614748.js.map +0 -1
  618. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js.map +0 -1
  619. package/dist/cjs/index-1d3ebe1a.js.map +0 -1
  620. package/dist/cjs/scroll-fc1b8387.js.map +0 -1
  621. package/dist/cjs/table.worker-3df34efe.js.map +0 -1
  622. package/dist/collection/components/slides/lib/js/add-remove-cell.js +0 -128
  623. package/dist/collection/components/slides/lib/js/images-loaded.js +0 -24
  624. package/dist/collection/components/slides/slides-interface.js +0 -2
  625. package/dist/collection/components/slides/slides-interface.js.map +0 -1
  626. package/dist/collection/utils/template.js.map +0 -1
  627. package/dist/components/_commonjsHelpers.js +0 -26
  628. package/dist/components/_commonjsHelpers.js.map +0 -1
  629. package/dist/esm/_commonjsHelpers-04a0e019.js +0 -26
  630. package/dist/esm/_commonjsHelpers-04a0e019.js.map +0 -1
  631. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js.map +0 -1
  632. package/dist/esm/index-06666022.js.map +0 -1
  633. package/dist/esm/scroll-ec7ac257.js.map +0 -1
  634. package/dist/esm/table.worker-3cae908c.js.map +0 -1
  635. package/dist/nano-components/p-0563e812.entry.js +0 -5
  636. package/dist/nano-components/p-0563e812.entry.js.map +0 -1
  637. package/dist/nano-components/p-0bc40dd1.entry.js +0 -5
  638. package/dist/nano-components/p-0bc40dd1.entry.js.map +0 -1
  639. package/dist/nano-components/p-0e0f07f0.entry.js +0 -5
  640. package/dist/nano-components/p-0e0f07f0.entry.js.map +0 -1
  641. package/dist/nano-components/p-0e4da739.entry.js +0 -5
  642. package/dist/nano-components/p-0e4da739.entry.js.map +0 -1
  643. package/dist/nano-components/p-16e75af9.entry.js +0 -5
  644. package/dist/nano-components/p-16e75af9.entry.js.map +0 -1
  645. package/dist/nano-components/p-17eb456c.entry.js +0 -5
  646. package/dist/nano-components/p-17eb456c.entry.js.map +0 -1
  647. package/dist/nano-components/p-191352c4.entry.js +0 -5
  648. package/dist/nano-components/p-1987f7a9.js +0 -5
  649. package/dist/nano-components/p-1a55e282.entry.js +0 -5
  650. package/dist/nano-components/p-1a55e282.entry.js.map +0 -1
  651. package/dist/nano-components/p-2234694a.js +0 -5
  652. package/dist/nano-components/p-2a105609.entry.js +0 -5
  653. package/dist/nano-components/p-2a105609.entry.js.map +0 -1
  654. package/dist/nano-components/p-2c0218e6.entry.js +0 -5
  655. package/dist/nano-components/p-2c0218e6.entry.js.map +0 -1
  656. package/dist/nano-components/p-328ef9d3.entry.js +0 -5
  657. package/dist/nano-components/p-359b7cd2.entry.js +0 -5
  658. package/dist/nano-components/p-359b7cd2.entry.js.map +0 -1
  659. package/dist/nano-components/p-36c3ded8.entry.js +0 -5
  660. package/dist/nano-components/p-36c3ded8.entry.js.map +0 -1
  661. package/dist/nano-components/p-3ae362ae.entry.js +0 -5
  662. package/dist/nano-components/p-3cac5f6d.entry.js +0 -5
  663. package/dist/nano-components/p-3d8fb8a1.entry.js +0 -5
  664. package/dist/nano-components/p-3eeaba47.entry.js +0 -5
  665. package/dist/nano-components/p-3eeaba47.entry.js.map +0 -1
  666. package/dist/nano-components/p-3f40e370.entry.js +0 -5
  667. package/dist/nano-components/p-51133e62.entry.js +0 -5
  668. package/dist/nano-components/p-51133e62.entry.js.map +0 -1
  669. package/dist/nano-components/p-54c4a2f5.entry.js +0 -5
  670. package/dist/nano-components/p-54c4a2f5.entry.js.map +0 -1
  671. package/dist/nano-components/p-5fc3035d.entry.js +0 -5
  672. package/dist/nano-components/p-5fc3035d.entry.js.map +0 -1
  673. package/dist/nano-components/p-650aa197.entry.js +0 -5
  674. package/dist/nano-components/p-650aa197.entry.js.map +0 -1
  675. package/dist/nano-components/p-67ab5a5f.entry.js +0 -5
  676. package/dist/nano-components/p-67ab5a5f.entry.js.map +0 -1
  677. package/dist/nano-components/p-688f1a55.entry.js +0 -5
  678. package/dist/nano-components/p-688f1a55.entry.js.map +0 -1
  679. package/dist/nano-components/p-6c4171fa.entry.js +0 -5
  680. package/dist/nano-components/p-70747f20.js +0 -5
  681. package/dist/nano-components/p-7670058b.entry.js +0 -5
  682. package/dist/nano-components/p-7670058b.entry.js.map +0 -1
  683. package/dist/nano-components/p-79fff4fd.entry.js +0 -5
  684. package/dist/nano-components/p-7c82af28.entry.js +0 -5
  685. package/dist/nano-components/p-87329424.entry.js +0 -5
  686. package/dist/nano-components/p-8fe51abf.js +0 -5
  687. package/dist/nano-components/p-935968b8.entry.js +0 -23
  688. package/dist/nano-components/p-935968b8.entry.js.map +0 -1
  689. package/dist/nano-components/p-9925e504.entry.js +0 -5
  690. package/dist/nano-components/p-9c290055.entry.js +0 -5
  691. package/dist/nano-components/p-9f60ff14.entry.js +0 -5
  692. package/dist/nano-components/p-a225e976.entry.js +0 -5
  693. package/dist/nano-components/p-a225e976.entry.js.map +0 -1
  694. package/dist/nano-components/p-a26bdb65.js +0 -5
  695. package/dist/nano-components/p-abd11243.entry.js +0 -5
  696. package/dist/nano-components/p-abd11243.entry.js.map +0 -1
  697. package/dist/nano-components/p-b27b56d3.js +0 -5
  698. package/dist/nano-components/p-b27b56d3.js.map +0 -1
  699. package/dist/nano-components/p-c80336b2.entry.js +0 -5
  700. package/dist/nano-components/p-c80336b2.entry.js.map +0 -1
  701. package/dist/nano-components/p-cad86fb8.js +0 -5
  702. package/dist/nano-components/p-cad86fb8.js.map +0 -1
  703. package/dist/nano-components/p-d4e44f93.entry.js +0 -5
  704. package/dist/nano-components/p-dc4020f8.js +0 -5
  705. package/dist/nano-components/p-dc4020f8.js.map +0 -1
  706. package/dist/nano-components/p-dc6cb252.entry.js +0 -5
  707. package/dist/nano-components/p-dc6cb252.entry.js.map +0 -1
  708. package/dist/nano-components/p-dc805ecc.js +0 -5
  709. package/dist/nano-components/p-dd5687db.js +0 -5
  710. package/dist/nano-components/p-e6a0675e.entry.js +0 -5
  711. package/dist/nano-components/p-e98835e2.entry.js +0 -5
  712. package/dist/nano-components/p-efd3e121.entry.js +0 -5
  713. package/dist/nano-components/p-f73f52ed.entry.js +0 -5
  714. package/dist/nano-components/p-f73f52ed.entry.js.map +0 -1
  715. package/dist/nano-components/p-fbde7010.entry.js +0 -5
  716. package/dist/nano-components/p-fcbc9122.entry.js +0 -5
  717. package/dist/nano-components/p-fcbc9122.entry.js.map +0 -1
  718. package/dist/types/utils/template.d.ts +0 -2
  719. /package/dist/nano-components/{p-74a7fc4f.js.map → active-element-75b7c8a0.js.map} +0 -0
  720. /package/dist/nano-components/{p-cecb9af1.js.map → date-utils-6b7a6e1f.js.map} +0 -0
  721. /package/dist/nano-components/{p-cdfc507e.js.map → dom-8599fac1.js.map} +0 -0
  722. /package/dist/nano-components/{p-842cf127.js.map → drag-1723a4cc.js.map} +0 -0
  723. /package/dist/nano-components/{p-9bfdee71.js.map → events-6a805b42.js.map} +0 -0
  724. /package/dist/nano-components/{p-f8f89998.js.map → focus-visible-8b2c14da.js.map} +0 -0
  725. /package/dist/nano-components/{p-bb07c3d0.js.map → index-f626f476.js.map} +0 -0
  726. /package/dist/nano-components/{p-1987f7a9.js.map → local-my-account-6662da72.js.map} +0 -0
  727. /package/dist/nano-components/{p-ee045579.js.map → math-c02ddfda.js.map} +0 -0
  728. /package/dist/nano-components/{p-2155fc2c.js.map → nano-slides.entry.js.map} +0 -0
  729. /package/dist/nano-components/{p-8fe51abf.js.map → nano-table.entry.js.map} +0 -0
  730. /package/dist/nano-components/{p-cd1fd454.js.map → popover-e5e7a641.js.map} +0 -0
  731. /package/dist/nano-components/{p-dc565459.js.map → slot-8126e238.js.map} +0 -0
  732. /package/dist/nano-components/{p-f88fa15c.js.map → tabbable-26a66a22.js.map} +0 -0
  733. /package/dist/nano-components/{p-fbde7010.entry.js.map → table.worker-75d6e1d2.js.map} +0 -0
  734. /package/dist/nano-components/{p-f258383d.js → table.worker-f258383d.js} +0 -0
  735. /package/dist/nano-components/{p-411bb8f1.js.map → theme-82feb8cf.js.map} +0 -0
  736. /package/dist/nano-components/{p-7bff5224.js.map → throttle-ac4fcefa.js.map} +0 -0
  737. /package/dist/nano-components/{p-c3e8e3f9.js.map → transitions-fb09eb32.js.map} +0 -0
@@ -1,4300 +1,7 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-06666022.js';
5
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-04a0e019.js';
6
-
7
- var evEmitter = createCommonjsModule(function (module) {
8
- /**
9
- * EvEmitter v1.1.0
10
- * Lil' event emitter
11
- * MIT License
12
- */
13
-
14
- /* jshint unused: true, undef: true, strict: true */
15
-
16
- ( function( global, factory ) {
17
- // universal module definition
18
- /* jshint strict: false */ /* globals define, module, window */
19
- if ( module.exports ) {
20
- // CommonJS - Browserify, Webpack
21
- module.exports = factory();
22
- } else {
23
- // Browser globals
24
- global.EvEmitter = factory();
25
- }
26
-
27
- }( typeof window != 'undefined' ? window : commonjsGlobal, function() {
28
-
29
- function EvEmitter() {}
30
-
31
- var proto = EvEmitter.prototype;
32
-
33
- proto.on = function( eventName, listener ) {
34
- if ( !eventName || !listener ) {
35
- return;
36
- }
37
- // set events hash
38
- var events = this._events = this._events || {};
39
- // set listeners array
40
- var listeners = events[ eventName ] = events[ eventName ] || [];
41
- // only add once
42
- if ( listeners.indexOf( listener ) == -1 ) {
43
- listeners.push( listener );
44
- }
45
-
46
- return this;
47
- };
48
-
49
- proto.once = function( eventName, listener ) {
50
- if ( !eventName || !listener ) {
51
- return;
52
- }
53
- // add event
54
- this.on( eventName, listener );
55
- // set once flag
56
- // set onceEvents hash
57
- var onceEvents = this._onceEvents = this._onceEvents || {};
58
- // set onceListeners object
59
- var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
60
- // set flag
61
- onceListeners[ listener ] = true;
62
-
63
- return this;
64
- };
65
-
66
- proto.off = function( eventName, listener ) {
67
- var listeners = this._events && this._events[ eventName ];
68
- if ( !listeners || !listeners.length ) {
69
- return;
70
- }
71
- var index = listeners.indexOf( listener );
72
- if ( index != -1 ) {
73
- listeners.splice( index, 1 );
74
- }
75
-
76
- return this;
77
- };
78
-
79
- proto.emitEvent = function( eventName, args ) {
80
- var listeners = this._events && this._events[ eventName ];
81
- if ( !listeners || !listeners.length ) {
82
- return;
83
- }
84
- // copy over to avoid interference if .off() in listener
85
- listeners = listeners.slice(0);
86
- args = args || [];
87
- // once stuff
88
- var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
89
-
90
- for ( var i=0; i < listeners.length; i++ ) {
91
- var listener = listeners[i];
92
- var isOnce = onceListeners && onceListeners[ listener ];
93
- if ( isOnce ) {
94
- // remove listener
95
- // remove before trigger to prevent recursion
96
- this.off( eventName, listener );
97
- // unset once flag
98
- delete onceListeners[ listener ];
99
- }
100
- // trigger listener
101
- listener.apply( this, args );
102
- }
103
-
104
- return this;
105
- };
106
-
107
- proto.allOff = function() {
108
- delete this._events;
109
- delete this._onceEvents;
110
- };
111
-
112
- return EvEmitter;
113
-
114
- }));
115
- });
116
-
117
- var getSize = createCommonjsModule(function (module) {
118
- /*!
119
- * getSize v2.0.3
120
- * measure size of elements
121
- * MIT license
122
- */
123
-
124
- /* jshint browser: true, strict: true, undef: true, unused: true */
125
- /* globals console: false */
126
-
127
- ( function( window, factory ) {
128
- /* jshint strict: false */ /* globals define, module */
129
- if ( module.exports ) {
130
- // CommonJS
131
- module.exports = factory();
132
- } else {
133
- // browser global
134
- window.getSize = factory();
135
- }
136
-
137
- })( window, function factory() {
138
-
139
- // -------------------------- helpers -------------------------- //
140
-
141
- // get a number from a string, not a percentage
142
- function getStyleSize( value ) {
143
- var num = parseFloat( value );
144
- // not a percent like '100%', and a number
145
- var isValid = value.indexOf('%') == -1 && !isNaN( num );
146
- return isValid && num;
147
- }
148
-
149
- function noop() {}
150
-
151
- var logError = typeof console == 'undefined' ? noop :
152
- function( message ) {
153
- console.error( message );
154
- };
155
-
156
- // -------------------------- measurements -------------------------- //
157
-
158
- var measurements = [
159
- 'paddingLeft',
160
- 'paddingRight',
161
- 'paddingTop',
162
- 'paddingBottom',
163
- 'marginLeft',
164
- 'marginRight',
165
- 'marginTop',
166
- 'marginBottom',
167
- 'borderLeftWidth',
168
- 'borderRightWidth',
169
- 'borderTopWidth',
170
- 'borderBottomWidth'
171
- ];
172
-
173
- var measurementsLength = measurements.length;
174
-
175
- function getZeroSize() {
176
- var size = {
177
- width: 0,
178
- height: 0,
179
- innerWidth: 0,
180
- innerHeight: 0,
181
- outerWidth: 0,
182
- outerHeight: 0
183
- };
184
- for ( var i=0; i < measurementsLength; i++ ) {
185
- var measurement = measurements[i];
186
- size[ measurement ] = 0;
187
- }
188
- return size;
189
- }
190
-
191
- // -------------------------- getStyle -------------------------- //
192
-
193
- /**
194
- * getStyle, get style of element, check for Firefox bug
195
- * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
196
- */
197
- function getStyle( elem ) {
198
- var style = getComputedStyle( elem );
199
- if ( !style ) {
200
- logError( 'Style returned ' + style +
201
- '. Are you running this code in a hidden iframe on Firefox? ' +
202
- 'See https://bit.ly/getsizebug1' );
203
- }
204
- return style;
205
- }
206
-
207
- // -------------------------- setup -------------------------- //
208
-
209
- var isSetup = false;
210
-
211
- var isBoxSizeOuter;
212
-
213
- /**
214
- * setup
215
- * check isBoxSizerOuter
216
- * do on first getSize() rather than on page load for Firefox bug
217
- */
218
- function setup() {
219
- // setup once
220
- if ( isSetup ) {
221
- return;
222
- }
223
- isSetup = true;
224
-
225
- // -------------------------- box sizing -------------------------- //
226
-
227
- /**
228
- * Chrome & Safari measure the outer-width on style.width on border-box elems
229
- * IE11 & Firefox<29 measures the inner-width
230
- */
231
- var div = document.createElement('div');
232
- div.style.width = '200px';
233
- div.style.padding = '1px 2px 3px 4px';
234
- div.style.borderStyle = 'solid';
235
- div.style.borderWidth = '1px 2px 3px 4px';
236
- div.style.boxSizing = 'border-box';
237
-
238
- var body = document.body || document.documentElement;
239
- body.appendChild( div );
240
- var style = getStyle( div );
241
- // round value for browser zoom. desandro/masonry#928
242
- isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
243
- getSize.isBoxSizeOuter = isBoxSizeOuter;
244
-
245
- body.removeChild( div );
246
- }
247
-
248
- // -------------------------- getSize -------------------------- //
249
-
250
- function getSize( elem ) {
251
- setup();
252
-
253
- // use querySeletor if elem is string
254
- if ( typeof elem == 'string' ) {
255
- elem = document.querySelector( elem );
256
- }
257
-
258
- // do not proceed on non-objects
259
- if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
260
- return;
261
- }
262
-
263
- var style = getStyle( elem );
264
-
265
- // if hidden, everything is 0
266
- if ( style.display == 'none' ) {
267
- return getZeroSize();
268
- }
269
-
270
- var size = {};
271
- size.width = elem.offsetWidth;
272
- size.height = elem.offsetHeight;
273
-
274
- var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
275
-
276
- // get all measurements
277
- for ( var i=0; i < measurementsLength; i++ ) {
278
- var measurement = measurements[i];
279
- var value = style[ measurement ];
280
- var num = parseFloat( value );
281
- // any 'auto', 'medium' value will be 0
282
- size[ measurement ] = !isNaN( num ) ? num : 0;
283
- }
284
-
285
- var paddingWidth = size.paddingLeft + size.paddingRight;
286
- var paddingHeight = size.paddingTop + size.paddingBottom;
287
- var marginWidth = size.marginLeft + size.marginRight;
288
- var marginHeight = size.marginTop + size.marginBottom;
289
- var borderWidth = size.borderLeftWidth + size.borderRightWidth;
290
- var borderHeight = size.borderTopWidth + size.borderBottomWidth;
291
-
292
- var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
293
-
294
- // overwrite width and height if we can get it from style
295
- var styleWidth = getStyleSize( style.width );
296
- if ( styleWidth !== false ) {
297
- size.width = styleWidth +
298
- // add padding and border unless it's already including it
299
- ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
300
- }
301
-
302
- var styleHeight = getStyleSize( style.height );
303
- if ( styleHeight !== false ) {
304
- size.height = styleHeight +
305
- // add padding and border unless it's already including it
306
- ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
307
- }
308
-
309
- size.innerWidth = size.width - ( paddingWidth + borderWidth );
310
- size.innerHeight = size.height - ( paddingHeight + borderHeight );
311
-
312
- size.outerWidth = size.width + marginWidth;
313
- size.outerHeight = size.height + marginHeight;
314
-
315
- return size;
316
- }
317
-
318
- return getSize;
319
-
320
- });
321
- });
322
-
323
- var matchesSelector = createCommonjsModule(function (module) {
324
- /**
325
- * matchesSelector v2.0.2
326
- * matchesSelector( element, '.selector' )
327
- * MIT license
328
- */
329
-
330
- /*jshint browser: true, strict: true, undef: true, unused: true */
331
-
332
- ( function( window, factory ) {
333
- // universal module definition
334
- if ( module.exports ) {
335
- // CommonJS
336
- module.exports = factory();
337
- } else {
338
- // browser global
339
- window.matchesSelector = factory();
340
- }
341
-
342
- }( window, function factory() {
343
-
344
- var matchesMethod = ( function() {
345
- var ElemProto = window.Element.prototype;
346
- // check for the standard method name first
347
- if ( ElemProto.matches ) {
348
- return 'matches';
349
- }
350
- // check un-prefixed
351
- if ( ElemProto.matchesSelector ) {
352
- return 'matchesSelector';
353
- }
354
- // check vendor prefixes
355
- var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
356
-
357
- for ( var i=0; i < prefixes.length; i++ ) {
358
- var prefix = prefixes[i];
359
- var method = prefix + 'MatchesSelector';
360
- if ( ElemProto[ method ] ) {
361
- return method;
362
- }
363
- }
364
- })();
365
-
366
- return function matchesSelector( elem, selector ) {
367
- return elem[ matchesMethod ]( selector );
368
- };
369
-
370
- }));
371
- });
372
-
373
- var utils = createCommonjsModule(function (module) {
374
- /**
375
- * Fizzy UI utils v2.0.7
376
- * MIT license
377
- */
378
-
379
- /*jshint browser: true, undef: true, unused: true, strict: true */
380
-
381
- ( function( window, factory ) {
382
- // universal module definition
383
- /*jshint strict: false */ /*globals define, module, require */
384
-
385
- if ( module.exports ) {
386
- // CommonJS
387
- module.exports = factory(
388
- window,
389
- matchesSelector
390
- );
391
- } else {
392
- // browser global
393
- window.fizzyUIUtils = factory(
394
- window,
395
- window.matchesSelector
396
- );
397
- }
398
-
399
- }( window, function factory( window, matchesSelector ) {
400
-
401
- var utils = {};
402
-
403
- // ----- extend ----- //
404
-
405
- // extends objects
406
- utils.extend = function( a, b ) {
407
- for ( var prop in b ) {
408
- a[ prop ] = b[ prop ];
409
- }
410
- return a;
411
- };
412
-
413
- // ----- modulo ----- //
414
-
415
- utils.modulo = function( num, div ) {
416
- return ( ( num % div ) + div ) % div;
417
- };
418
-
419
- // ----- makeArray ----- //
420
-
421
- var arraySlice = Array.prototype.slice;
422
-
423
- // turn element or nodeList into an array
424
- utils.makeArray = function( obj ) {
425
- if ( Array.isArray( obj ) ) {
426
- // use object if already an array
427
- return obj;
428
- }
429
- // return empty array if undefined or null. #6
430
- if ( obj === null || obj === undefined ) {
431
- return [];
432
- }
433
-
434
- var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
435
- if ( isArrayLike ) {
436
- // convert nodeList to array
437
- return arraySlice.call( obj );
438
- }
439
-
440
- // array of single index
441
- return [ obj ];
442
- };
443
-
444
- // ----- removeFrom ----- //
445
-
446
- utils.removeFrom = function( ary, obj ) {
447
- var index = ary.indexOf( obj );
448
- if ( index != -1 ) {
449
- ary.splice( index, 1 );
450
- }
451
- };
452
-
453
- // ----- getParent ----- //
454
-
455
- utils.getParent = function( elem, selector ) {
456
- while ( elem.parentNode && elem != document.body ) {
457
- elem = elem.parentNode;
458
- if ( matchesSelector( elem, selector ) ) {
459
- return elem;
460
- }
461
- }
462
- };
463
-
464
- // ----- getQueryElement ----- //
465
-
466
- // use element as selector string
467
- utils.getQueryElement = function( elem ) {
468
- if ( typeof elem == 'string' ) {
469
- return document.querySelector( elem );
470
- }
471
- return elem;
472
- };
473
-
474
- // ----- handleEvent ----- //
475
-
476
- // enable .ontype to trigger from .addEventListener( elem, 'type' )
477
- utils.handleEvent = function( event ) {
478
- var method = 'on' + event.type;
479
- if ( this[ method ] ) {
480
- this[ method ]( event );
481
- }
482
- };
483
-
484
- // ----- filterFindElements ----- //
485
-
486
- utils.filterFindElements = function( elems, selector ) {
487
- // make array of elems
488
- elems = utils.makeArray( elems );
489
- var ffElems = [];
490
-
491
- elems.forEach( function( elem ) {
492
- // check that elem is an actual element
493
- if ( !( elem instanceof HTMLElement ) ) {
494
- return;
495
- }
496
- // add elem if no selector
497
- if ( !selector ) {
498
- ffElems.push( elem );
499
- return;
500
- }
501
- // filter & find items if we have a selector
502
- // filter
503
- if ( matchesSelector( elem, selector ) ) {
504
- ffElems.push( elem );
505
- }
506
- // find children
507
- var childElems = elem.querySelectorAll( selector );
508
- // concat childElems to filterFound array
509
- for ( var i=0; i < childElems.length; i++ ) {
510
- ffElems.push( childElems[i] );
511
- }
512
- });
513
-
514
- return ffElems;
515
- };
516
-
517
- // ----- debounceMethod ----- //
518
-
519
- utils.debounceMethod = function( _class, methodName, threshold ) {
520
- threshold = threshold || 100;
521
- // original method
522
- var method = _class.prototype[ methodName ];
523
- var timeoutName = methodName + 'Timeout';
524
-
525
- _class.prototype[ methodName ] = function() {
526
- var timeout = this[ timeoutName ];
527
- clearTimeout( timeout );
528
-
529
- var args = arguments;
530
- var _this = this;
531
- this[ timeoutName ] = setTimeout( function() {
532
- method.apply( _this, args );
533
- delete _this[ timeoutName ];
534
- }, threshold );
535
- };
536
- };
537
-
538
- // ----- docReady ----- //
539
-
540
- utils.docReady = function( callback ) {
541
- var readyState = document.readyState;
542
- if ( readyState == 'complete' || readyState == 'interactive' ) {
543
- // do async to allow for other scripts to run. metafizzy/flickity#441
544
- setTimeout( callback );
545
- } else {
546
- document.addEventListener( 'DOMContentLoaded', callback );
547
- }
548
- };
549
-
550
- // ----- htmlInit ----- //
551
-
552
- // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
553
- utils.toDashed = function( str ) {
554
- return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
555
- return $1 + '-' + $2;
556
- }).toLowerCase();
557
- };
558
-
559
- var console = window.console;
560
- /**
561
- * allow user to initialize classes via [data-namespace] or .js-namespace class
562
- * htmlInit( Widget, 'widgetName' )
563
- * options are parsed from data-namespace-options
564
- */
565
- utils.htmlInit = function( WidgetClass, namespace ) {
566
- utils.docReady( function() {
567
- var dashedNamespace = utils.toDashed( namespace );
568
- var dataAttr = 'data-' + dashedNamespace;
569
- var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
570
- var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
571
- var elems = utils.makeArray( dataAttrElems )
572
- .concat( utils.makeArray( jsDashElems ) );
573
- var dataOptionsAttr = dataAttr + '-options';
574
- var jQuery = window.jQuery;
575
-
576
- elems.forEach( function( elem ) {
577
- var attr = elem.getAttribute( dataAttr ) ||
578
- elem.getAttribute( dataOptionsAttr );
579
- var options;
580
- try {
581
- options = attr && JSON.parse( attr );
582
- } catch ( error ) {
583
- // log error, do not initialize
584
- if ( console ) {
585
- console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
586
- ': ' + error );
587
- }
588
- return;
589
- }
590
- // initialize
591
- var instance = new WidgetClass( elem, options );
592
- // make available via $().data('namespace')
593
- if ( jQuery ) {
594
- jQuery.data( elem, namespace, instance );
595
- }
596
- });
597
-
598
- });
599
- };
600
-
601
- // ----- ----- //
602
-
603
- return utils;
604
-
605
- }));
606
- });
607
-
608
- function Cell(elem, parent) {
609
- this.element = elem;
610
- this.parent = parent;
611
-
612
- this.create();
613
- }
614
-
615
- var proto$b = Cell.prototype;
616
-
617
- proto$b.create = function () {
618
- this.element.style.position = 'absolute';
619
- this.element.setAttribute('aria-hidden', 'true');
620
- this.x = 0;
621
- this.shift = 0;
622
- Array.from(this.element.querySelectorAll('*')).forEach((element) => {
623
- element.setAttribute('tabindex', '-1');
624
- });
625
- };
626
-
627
- proto$b.destroy = function () {
628
- // reset style
629
- this.unselect();
630
- this.element.style.position = '';
631
- var side = this.parent.originSide;
632
- this.element.style[side] = '';
633
- };
634
-
635
- proto$b.getSize = function () {
636
- this.size = getSize(this.element);
637
- };
638
-
639
- proto$b.setPosition = function (x) {
640
- this.x = x;
641
- this.updateTarget();
642
- this.renderPosition(x);
643
- };
644
-
645
- // setDefaultTarget v1 method, backwards compatibility, remove in v3
646
- proto$b.updateTarget = proto$b.setDefaultTarget = function () {
647
- var marginProperty =
648
- this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';
649
- this.target =
650
- this.x +
651
- this.size[marginProperty] +
652
- this.size.width * this.parent.cellAlign;
653
- };
654
-
655
- proto$b.renderPosition = function (x) {
656
- // render position of cell with in slider
657
- var side = this.parent.originSide;
658
- this.element.style[side] = this.parent.getPositionValue(x);
659
- };
660
-
661
- proto$b.select = function () {
662
- this.element.classList.add('is-selected');
663
- this.element.removeAttribute('aria-hidden');
664
- Array.from(this.element.querySelectorAll('*')).forEach((element) => {
665
- element.removeAttribute('tabindex');
666
- });
667
- };
668
-
669
- proto$b.unselect = function () {
670
- this.element.classList.remove('is-selected');
671
- this.element.setAttribute('aria-hidden', 'true');
672
- Array.from(this.element.querySelectorAll('*')).forEach((element) => {
673
- element.setAttribute('tabindex', '-1');
674
- });
675
- };
676
-
677
- /**
678
- * @param {Integer} factor - 0, 1, or -1
679
- **/
680
- proto$b.wrapShift = function (shift) {
681
- this.shift = shift;
682
- this.renderPosition(this.x + this.parent.slideableWidth * shift);
683
- };
684
-
685
- proto$b.remove = function () {
686
- this.element.parentNode.removeChild(this.element);
687
- };
688
-
689
- function Slide$1(parent) {
690
- this.parent = parent;
691
- this.isOriginLeft = parent.originSide == 'left';
692
- this.cells = [];
693
- this.outerWidth = 0;
694
- this.height = 0;
695
- }
696
-
697
- var proto$a = Slide$1.prototype;
698
-
699
- proto$a.addCell = function (cell) {
700
- this.cells.push(cell);
701
- this.outerWidth += cell.size.outerWidth;
702
- this.height = Math.max(cell.size.outerHeight, this.height);
703
- // first cell stuff
704
- if (this.cells.length == 1) {
705
- this.x = cell.x; // x comes from first cell
706
- var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';
707
- this.firstMargin = cell.size[beginMargin];
708
- }
709
- };
710
-
711
- proto$a.updateTarget = function () {
712
- var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';
713
- var lastCell = this.getLastCell();
714
- var lastMargin = lastCell ? lastCell.size[endMargin] : 0;
715
- var slideWidth = this.outerWidth - (this.firstMargin + lastMargin);
716
- this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
717
- };
718
-
719
- proto$a.getLastCell = function () {
720
- return this.cells[this.cells.length - 1];
721
- };
722
-
723
- proto$a.select = function () {
724
- this.cells.forEach(function (cell) {
725
- cell.select();
726
- });
727
- };
728
-
729
- proto$a.unselect = function () {
730
- this.cells.forEach(function (cell) {
731
- cell.unselect();
732
- });
733
- };
734
-
735
- proto$a.getCellElements = function () {
736
- return this.cells.map(function (cell) {
737
- return cell.element;
738
- });
739
- };
740
-
741
- const proto$9 = {};
742
-
743
- proto$9.startAnimation = function () {
744
- if (this.isAnimating) {
745
- return;
746
- }
747
-
748
- this.isAnimating = true;
749
- this.restingFrames = 0;
750
- this.animate();
751
- };
752
-
753
- proto$9.animate = function () {
754
- this.applyDragForce();
755
- this.applySelectedAttraction();
756
-
757
- var previousX = this.x;
758
-
759
- this.integratePhysics();
760
- this.positionSlider();
761
- this.settle(previousX);
762
- // animate next frame
763
- if (this.isAnimating) {
764
- var _this = this;
765
- requestAnimationFrame(function animateFrame() {
766
- _this.animate();
767
- });
768
- }
769
- };
770
-
771
- proto$9.positionSlider = function () {
772
- var x = this.x;
773
- // wrap position around
774
- if (this.options.wrapAround && this.cells.length > 1) {
775
- x = utils.modulo(x, this.slideableWidth);
776
- x = x - this.slideableWidth;
777
- this.shiftWrapCells(x);
778
- }
779
-
780
- this.setTranslateX(x, this.isAnimating);
781
- this.dispatchScrollEvent();
782
- };
783
-
784
- proto$9.setTranslateX = function (x, is3d) {
785
- x += this.cursorPosition;
786
- // reverse if right-to-left and using transform
787
- x = this.options.rightToLeft ? -x : x;
788
- var translateX = this.getPositionValue(x);
789
- // use 3D tranforms for hardware acceleration on iOS
790
- // but use 2D when settled, for better font-rendering
791
- // this.slider.style.transform = is3d
792
- // ? 'translate3d(' + translateX + ',0,0)'
793
- // : 'translateX(' + translateX + ')';
794
-
795
- this.slider.style.transform = 'translate3d(' + translateX + ',0,0)';
796
- };
797
-
798
- proto$9.dispatchScrollEvent = function () {
799
- var firstSlide = this.slides[0];
800
- if (!firstSlide) {
801
- return;
802
- }
803
- var positionX = -this.x - firstSlide.target;
804
- var progress = positionX / this.slidesWidth;
805
- this.dispatchEvent('scroll', null, [progress, positionX]);
806
- };
807
-
808
- proto$9.positionSliderAtSelected = function () {
809
- if (!this.cells.length) {
810
- return;
811
- }
812
- this.x = -this.selectedSlide.target;
813
- this.velocity = 0; // stop wobble
814
- this.positionSlider();
815
- };
816
-
817
- proto$9.getPositionValue = function (position) {
818
- if (this.options.percentPosition) {
819
- // percent position, round to 2 digits, like 12.34%
820
- return Math.round((position / this.size.innerWidth) * 10000) * 0.01 + '%';
821
- } else {
822
- // pixel positioning
823
- return Math.round(position) + 'px';
824
- }
825
- };
826
-
827
- proto$9.settle = function (previousX) {
828
- // keep track of frames where x hasn't moved
829
- if (
830
- !this.isPointerDown &&
831
- Math.round(this.x * 100) == Math.round(previousX * 100)
832
- ) {
833
- this.restingFrames++;
834
- }
835
- // stop animating if resting for 3 or more frames
836
- if (this.restingFrames > 2) {
837
- this.isAnimating = false;
838
- delete this.isFreeScrolling;
839
- // render position with translateX when settled
840
- this.positionSlider();
841
- this.dispatchEvent('settle', null, [this.selectedIndex]);
842
- }
843
- };
844
-
845
- proto$9.shiftWrapCells = function (x) {
846
- // shift before cells
847
- var beforeGap = this.cursorPosition + x;
848
- this._shiftCells(this.beforeShiftCells, beforeGap, -1);
849
- // shift after cells
850
- var afterGap =
851
- this.size.innerWidth - (x + this.slideableWidth + this.cursorPosition);
852
- this._shiftCells(this.afterShiftCells, afterGap, 1);
853
- };
854
-
855
- proto$9._shiftCells = function (cells, gap, shift) {
856
- for (var i = 0; i < cells.length; i++) {
857
- var cell = cells[i];
858
- var cellShift = gap > 0 ? shift : 0;
859
- cell.wrapShift(cellShift);
860
- gap -= cell.size.outerWidth;
861
- }
862
- };
863
-
864
- proto$9._unshiftCells = function (cells) {
865
- if (!cells || !cells.length) {
866
- return;
867
- }
868
- for (var i = 0; i < cells.length; i++) {
869
- cells[i].wrapShift(0);
870
- }
871
- };
872
-
873
- // -------------------------- physics -------------------------- //
874
-
875
- proto$9.integratePhysics = function () {
876
- this.x += this.velocity;
877
- this.velocity *= this.getFrictionFactor();
878
- };
879
-
880
- proto$9.applyForce = function (force) {
881
- this.velocity += force;
882
- };
883
-
884
- proto$9.getFrictionFactor = function () {
885
- return (
886
- 1 - this.options[this.isFreeScrolling ? 'freeScrollFriction' : 'friction']
887
- );
888
- };
889
-
890
- proto$9.getRestingPosition = function () {
891
- // my thanks to Steven Wittens, who simplified this math greatly
892
- return this.x + this.velocity / (1 - this.getFrictionFactor());
893
- };
894
-
895
- proto$9.applyDragForce = function () {
896
- if (!this.isDraggable || !this.isPointerDown) {
897
- return;
898
- }
899
- // change the position to drag position by applying force
900
- var dragVelocity = this.dragX - this.x;
901
- var dragForce = dragVelocity - this.velocity;
902
- this.applyForce(dragForce);
903
- };
904
-
905
- proto$9.applySelectedAttraction = function () {
906
- // do not attract if pointer down or no slides
907
- var dragDown = this.isDraggable && this.isPointerDown;
908
- if (dragDown || this.isFreeScrolling || !this.slides.length) {
909
- return;
910
- }
911
- var distance = this.selectedSlide.target * -1 - this.x;
912
- var force = distance * this.options.selectedAttraction;
913
- this.applyForce(force);
914
- };
915
-
916
- // vars
917
- var getComputedStyle$1 = window.getComputedStyle;
918
- var console$1 = window.console;
919
-
920
- function moveElements(elems, toElem) {
921
- elems = utils.makeArray(elems);
922
- while (elems.length) {
923
- toElem.appendChild(elems.shift());
924
- }
925
- }
926
-
927
- // -------------------------- Flickity -------------------------- //
928
-
929
- // globally unique identifiers
930
- var GUID = 0;
931
- // internal store of all Flickity intances
932
- var instances = {};
933
-
934
- function Flickity(element, options) {
935
- var queryElement = utils.getQueryElement(element);
936
- if (!queryElement) {
937
- if (console$1) {
938
- console$1.error('Bad element for Flickity: ' + (queryElement || element));
939
- }
940
- return;
941
- }
942
- this.element = queryElement;
943
- // do not initialize twice on same element
944
- if (this.element.flickityGUID) {
945
- var instance = instances[this.element.flickityGUID];
946
- if (!instances[this.element.flickityGUID]) return;
947
- instance.option(options);
948
- return instance;
949
- }
950
-
951
- // options
952
- this.options = utils.extend({}, this.constructor.defaults);
953
- this.option(options);
954
-
955
- // kick things off
956
- this._create();
957
- }
958
-
959
- Flickity.defaults = {
960
- accessibility: true,
961
- // adaptiveHeight: false,
962
- cellAlign: 'center',
963
- // cellSelector: undefined,
964
- // contain: false,
965
- freeScrollFriction: 0.075, // friction when free-scrolling
966
- friction: 0.28, // friction when selecting
967
- namespaceJQueryEvents: true,
968
- // initialIndex: 0,
969
- percentPosition: true,
970
- resize: true,
971
- selectedAttraction: 0.025,
972
- setGallerySize: true,
973
- // watchCSS: false,
974
- // wrapAround: false
975
- };
976
-
977
- // hash of methods triggered on _create()
978
- Flickity.createMethods = [];
979
-
980
- var proto$8 = Flickity.prototype;
981
- // inherit EventEmitter
982
- utils.extend(proto$8, evEmitter.prototype);
983
-
984
- proto$8._create = function () {
985
- // add id for Flickity.data
986
- var id = (this.guid = ++GUID);
987
- this.element.flickityGUID = id; // expando
988
- instances[id] = this; // associate via id
989
- // initial properties
990
- this.selectedIndex = 0;
991
- // how many frames slider has been in same position
992
- this.restingFrames = 0;
993
- // initial physics properties
994
- this.x = 0;
995
- this.velocity = 0;
996
- this.originSide = this.options.rightToLeft ? 'right' : 'left';
997
- // create viewport & slider
998
- this.viewport = document.createElement('div');
999
- this.viewport.className = 'flickity-viewport';
1000
- this.viewport.part.add('slide-viewport');
1001
- this._createSlider();
1002
-
1003
- if (this.options.resize || this.options.watchCSS) {
1004
- window.addEventListener('resize', this);
1005
- }
1006
-
1007
- // add listeners from on option
1008
- for (var eventName in this.options.on) {
1009
- var listener = this.options.on[eventName];
1010
- this.on(eventName, listener);
1011
- }
1012
-
1013
- Flickity.createMethods.forEach(function (method) {
1014
- this[method]();
1015
- }, this);
1016
-
1017
- if (this.options.watchCSS) {
1018
- this.watchCSS();
1019
- } else {
1020
- this.activate();
1021
- }
1022
- };
1023
-
1024
- /**
1025
- * set options
1026
- * @param {Object} opts
1027
- */
1028
- proto$8.option = function (opts) {
1029
- utils.extend(this.options, opts);
1030
- };
1031
-
1032
- proto$8.activate = function () {
1033
- if (this.isActive) {
1034
- return;
1035
- }
1036
- this.isActive = true;
1037
- this.element.classList.add('flickity-enabled');
1038
- if (this.options.rightToLeft) {
1039
- this.element.classList.add('flickity-rtl');
1040
- }
1041
-
1042
- this.getSize();
1043
- // move initial cell elements so they can be loaded as cells
1044
- var cellElems = this.element.children; //this._filterFindCellElements( this.element.children );
1045
- moveElements(cellElems, this.slider);
1046
- this.viewport.appendChild(this.slider);
1047
- this.element.appendChild(this.viewport);
1048
- // get cells from children
1049
- this.reloadCells();
1050
-
1051
- if (this.options.accessibility) {
1052
- // allow element to focusable
1053
- this.element.tabIndex = 0;
1054
- // listen for key presses
1055
- this.element.addEventListener('keydown', this);
1056
- }
1057
-
1058
- this.emitEvent('activate');
1059
- this.selectInitialIndex();
1060
- // flag for initial activation, for using initialIndex
1061
- this.isInitActivated = true;
1062
- // ready event. #493
1063
- this.dispatchEvent('ready');
1064
- };
1065
-
1066
- // slider positions the cells
1067
- proto$8._createSlider = function () {
1068
- // slider element does all the positioning
1069
- var slider = document.createElement('div');
1070
- slider.className = 'flickity-slider';
1071
- slider.style[this.originSide] = 0;
1072
- this.slider = slider;
1073
- };
1074
-
1075
- proto$8._filterFindCellElements = function (elems) {
1076
- return utils.filterFindElements(elems, this.options.cellSelector);
1077
- };
1078
-
1079
- // goes through all children
1080
- proto$8.reloadCells = function () {
1081
- // collection of item elements
1082
- this.cells = this._makeCells(
1083
- this.slider.getRootNode().host
1084
- ? this.slider.getRootNode().host.children
1085
- : this.slider.children
1086
- );
1087
- this.positionCells();
1088
- this._getWrapShiftCells();
1089
- this.setGallerySize();
1090
- };
1091
-
1092
- /**
1093
- * turn elements into Flickity.Cells
1094
- * @param {Array or NodeList or HTMLElement} elems
1095
- * @returns {Array} items - collection of new Flickity Cells
1096
- */
1097
- proto$8._makeCells = function (elems) {
1098
- var cellElems = this._filterFindCellElements(elems);
1099
-
1100
- // create new Flickity for collection
1101
- var cells = cellElems.map(function (cellElem) {
1102
- return new Cell(cellElem, this);
1103
- }, this);
1104
-
1105
- return cells;
1106
- };
1107
-
1108
- proto$8.getLastCell = function () {
1109
- return this.cells[this.cells.length - 1];
1110
- };
1111
-
1112
- proto$8.getLastSlide = function () {
1113
- return this.slides[this.slides.length - 1];
1114
- };
1115
-
1116
- // positions all cells
1117
- proto$8.positionCells = function () {
1118
- // size all cells
1119
- this._sizeCells(this.cells);
1120
- // position all cells
1121
- this._positionCells(0);
1122
- };
1123
-
1124
- /**
1125
- * position certain cells
1126
- * @param {Integer} index - which cell to start with
1127
- */
1128
- proto$8._positionCells = function (index) {
1129
- index = index || 0;
1130
- // also measure maxCellHeight
1131
- // start 0 if positioning all cells
1132
- this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;
1133
- var cellX = 0;
1134
- // get cellX
1135
- if (index > 0) {
1136
- var startCell = this.cells[index - 1];
1137
- cellX = startCell.x + startCell.size.outerWidth;
1138
- }
1139
- var len = this.cells.length;
1140
- for (var i = index; i < len; i++) {
1141
- var cell = this.cells[i];
1142
- cell.setPosition(cellX);
1143
- cellX += cell.size.outerWidth;
1144
- this.maxCellHeight = Math.max(cell.size.outerHeight, this.maxCellHeight);
1145
- }
1146
- // keep track of cellX for wrap-around
1147
- this.slideableWidth = cellX;
1148
- // slides
1149
- this.updateSlides();
1150
- // contain slides target
1151
- this._containSlides();
1152
- // update slidesWidth
1153
- this.slidesWidth = len
1154
- ? this.getLastSlide().target - this.slides[0].target
1155
- : 0;
1156
- };
1157
-
1158
- /**
1159
- * cell.getSize() on multiple cells
1160
- * @param {Array} cells
1161
- */
1162
- proto$8._sizeCells = function (cells) {
1163
- cells.forEach(function (cell) {
1164
- cell.getSize();
1165
- });
1166
- };
1167
-
1168
- // -------------------------- -------------------------- //
1169
-
1170
- proto$8.updateSlides = function () {
1171
- this.slides = [];
1172
- if (!this.cells.length) {
1173
- return;
1174
- }
1175
-
1176
- var slide = new Slide$1(this);
1177
- this.slides.push(slide);
1178
- var isOriginLeft = this.originSide == 'left';
1179
- var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';
1180
-
1181
- var canCellFit = this._getCanCellFit();
1182
-
1183
- this.cells.forEach(function (cell, i) {
1184
- // just add cell if first cell in slide
1185
- if (!slide.cells.length) {
1186
- slide.addCell(cell);
1187
- return;
1188
- }
1189
-
1190
- var slideWidth =
1191
- slide.outerWidth -
1192
- slide.firstMargin +
1193
- (cell.size.outerWidth - cell.size[nextMargin]);
1194
-
1195
- if (canCellFit.call(this, i, slideWidth)) {
1196
- slide.addCell(cell);
1197
- } else {
1198
- // doesn't fit, new slide
1199
- slide.updateTarget();
1200
-
1201
- slide = new Slide$1(this);
1202
- this.slides.push(slide);
1203
- slide.addCell(cell);
1204
- }
1205
- }, this);
1206
- // last slide
1207
- slide.updateTarget();
1208
- // update .selectedSlide
1209
- this.updateSelectedSlide();
1210
- };
1211
-
1212
- proto$8._getCanCellFit = function () {
1213
- var groupCells = this.options.groupCells;
1214
- if (!groupCells) {
1215
- return function () {
1216
- return false;
1217
- };
1218
- } else if (typeof groupCells == 'number') {
1219
- // group by number. 3 -> [0,1,2], [3,4,5], ...
1220
- var number = parseInt(groupCells, 10);
1221
- return function (i) {
1222
- return i % number !== 0;
1223
- };
1224
- }
1225
- // default, group by width of slide
1226
- // parse '75%
1227
- var percentMatch =
1228
- typeof groupCells == 'string' && groupCells.match(/^(\d+)%$/);
1229
- var percent = percentMatch ? parseInt(percentMatch[1], 10) / 100 : 1;
1230
- return function (i, slideWidth) {
1231
- return slideWidth <= (this.size.innerWidth + 1) * percent;
1232
- };
1233
- };
1234
-
1235
- // alias _init for jQuery plugin .flickity()
1236
- proto$8._init = proto$8.reposition = function () {
1237
- this.positionCells();
1238
- this.positionSliderAtSelected();
1239
- };
1240
-
1241
- proto$8.getSize = function () {
1242
- this.size = getSize(this.element);
1243
- this.setCellAlign();
1244
- this.cursorPosition = this.size.innerWidth * this.cellAlign;
1245
- };
1246
-
1247
- var cellAlignShorthands = {
1248
- // cell align, then based on origin side
1249
- center: {
1250
- left: 0.5,
1251
- right: 0.5,
1252
- },
1253
- left: {
1254
- left: 0,
1255
- right: 1,
1256
- },
1257
- right: {
1258
- right: 0,
1259
- left: 1,
1260
- },
1261
- };
1262
-
1263
- proto$8.setCellAlign = function () {
1264
- var shorthand = cellAlignShorthands[this.options.cellAlign];
1265
- this.cellAlign = shorthand
1266
- ? shorthand[this.originSide]
1267
- : this.options.cellAlign;
1268
- };
1269
-
1270
- proto$8.setGallerySize = function () {
1271
- if (this.options.setGallerySize) {
1272
- var height =
1273
- this.options.adaptiveHeight && this.selectedSlide
1274
- ? this.selectedSlide.height
1275
- : this.maxCellHeight;
1276
- this.viewport.style.height = height + 'px';
1277
- }
1278
- };
1279
-
1280
- proto$8._getWrapShiftCells = function () {
1281
- // only for wrap-around
1282
- if (!this.options.wrapAround) {
1283
- return;
1284
- }
1285
- // unshift previous cells
1286
- this._unshiftCells(this.beforeShiftCells);
1287
- this._unshiftCells(this.afterShiftCells);
1288
- // get before cells
1289
- // initial gap
1290
- var gapX = this.cursorPosition;
1291
- var cellIndex = this.cells.length - 1;
1292
- this.beforeShiftCells = this._getGapCells(gapX, cellIndex, -1);
1293
- // get after cells
1294
- // ending gap between last cell and end of gallery viewport
1295
- gapX = this.size.innerWidth - this.cursorPosition;
1296
- // start cloning at first cell, working forwards
1297
- this.afterShiftCells = this._getGapCells(gapX, 0, 1);
1298
- };
1299
-
1300
- proto$8._getGapCells = function (gapX, cellIndex, increment) {
1301
- // keep adding cells until the cover the initial gap
1302
- var cells = [];
1303
- while (gapX > 0) {
1304
- var cell = this.cells[cellIndex];
1305
- if (!cell) {
1306
- break;
1307
- }
1308
- cells.push(cell);
1309
- cellIndex += increment;
1310
- gapX -= cell.size.outerWidth;
1311
- }
1312
- return cells;
1313
- };
1314
-
1315
- // ----- contain ----- //
1316
-
1317
- // contain cell targets so no excess sliding
1318
- proto$8._containSlides = function () {
1319
- if (!this.options.contain || this.options.wrapAround || !this.cells.length) {
1320
- return;
1321
- }
1322
- var isRightToLeft = this.options.rightToLeft;
1323
- var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';
1324
- var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';
1325
- var contentWidth = this.slideableWidth - this.getLastCell().size[endMargin];
1326
- // content is less than gallery size
1327
- var isContentSmaller = contentWidth < this.size.innerWidth;
1328
- // bounds
1329
- var beginBound = this.cursorPosition + this.cells[0].size[beginMargin];
1330
- var endBound = contentWidth - this.size.innerWidth * (1 - this.cellAlign);
1331
- // contain each cell target
1332
- this.slides.forEach(function (slide) {
1333
- if (isContentSmaller) {
1334
- // all cells fit inside gallery
1335
- slide.target = contentWidth * this.cellAlign;
1336
- } else {
1337
- // contain to bounds
1338
- slide.target = Math.max(slide.target, beginBound);
1339
- slide.target = Math.min(slide.target, endBound);
1340
- }
1341
- }, this);
1342
- };
1343
-
1344
- // ----- ----- //
1345
-
1346
- /**
1347
- * emits events via eventEmitter and jQuery events
1348
- * @param {String} type - name of event
1349
- * @param {Event} event - original event
1350
- * @param {Array} args - extra arguments
1351
- */
1352
- proto$8.dispatchEvent = function (type, event, args) {
1353
- var emitArgs = event ? [event].concat(args) : args;
1354
- this.emitEvent(type, emitArgs);
1355
- };
1356
-
1357
- // -------------------------- select -------------------------- //
1358
-
1359
- /**
1360
- * @param {Integer} index - index of the slide
1361
- * @param {Boolean} isWrap - will wrap-around to last/first if at the end
1362
- * @param {Boolean} isInstant - will immediately set position at selected cell
1363
- */
1364
- proto$8.select = function (index, isWrap, isInstant) {
1365
- if (!this.isActive) {
1366
- return;
1367
- }
1368
- index = parseInt(index, 10);
1369
- this._wrapSelect(index);
1370
-
1371
- if (this.options.wrapAround || isWrap) {
1372
- index = utils.modulo(index, this.slides.length);
1373
- }
1374
- // bail if invalid index
1375
- if (!this.slides[index]) {
1376
- return;
1377
- }
1378
- var prevIndex = this.selectedIndex;
1379
- this.selectedIndex = index;
1380
- this.updateSelectedSlide();
1381
- if (isInstant) {
1382
- this.positionSliderAtSelected();
1383
- } else {
1384
- this.startAnimation();
1385
- }
1386
- if (this.options.adaptiveHeight) {
1387
- this.setGallerySize();
1388
- }
1389
- // events
1390
- this.dispatchEvent('select', null, [index]);
1391
- // change event if new index
1392
- if (index != prevIndex) {
1393
- this.dispatchEvent('change', null, [index]);
1394
- }
1395
- // old v1 event name, remove in v3
1396
- this.dispatchEvent('cellSelect');
1397
- };
1398
-
1399
- // wraps position for wrapAround, to move to closest slide. #113
1400
- proto$8._wrapSelect = function (index) {
1401
- var len = this.slides.length;
1402
- var isWrapping = this.options.wrapAround && len > 1;
1403
- if (!isWrapping) {
1404
- return index;
1405
- }
1406
- var wrapIndex = utils.modulo(index, len);
1407
- // go to shortest
1408
- var delta = Math.abs(wrapIndex - this.selectedIndex);
1409
- var backWrapDelta = Math.abs(wrapIndex + len - this.selectedIndex);
1410
- var forewardWrapDelta = Math.abs(wrapIndex - len - this.selectedIndex);
1411
- if (!this.isDragSelect && backWrapDelta < delta) {
1412
- index += len;
1413
- } else if (!this.isDragSelect && forewardWrapDelta < delta) {
1414
- index -= len;
1415
- }
1416
- // wrap position so slider is within normal area
1417
- if (index < 0) {
1418
- this.x -= this.slideableWidth;
1419
- } else if (index >= len) {
1420
- this.x += this.slideableWidth;
1421
- }
1422
- };
1423
-
1424
- proto$8.previous = function (isWrap, isInstant) {
1425
- this.select(this.selectedIndex - 1, isWrap, isInstant);
1426
- };
1427
-
1428
- proto$8.next = function (isWrap, isInstant) {
1429
- this.select(this.selectedIndex + 1, isWrap, isInstant);
1430
- };
1431
-
1432
- proto$8.updateSelectedSlide = function () {
1433
- var slide = this.slides[this.selectedIndex];
1434
- // selectedIndex could be outside of slides, if triggered before resize()
1435
- if (!slide) {
1436
- return;
1437
- }
1438
- // unselect previous selected slide
1439
- this.unselectSelectedSlide();
1440
- // update new selected slide
1441
- this.selectedSlide = slide;
1442
- slide.select();
1443
- this.selectedCells = slide.cells;
1444
- this.selectedElements = slide.getCellElements();
1445
- // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility
1446
- // Remove in v3?
1447
- this.selectedCell = slide.cells[0];
1448
- this.selectedElement = this.selectedElements[0];
1449
- };
1450
-
1451
- proto$8.unselectSelectedSlide = function () {
1452
- if (this.selectedSlide) {
1453
- this.selectedSlide.unselect();
1454
- }
1455
- };
1456
-
1457
- proto$8.selectInitialIndex = function () {
1458
- var initialIndex = this.options.initialIndex;
1459
- // already activated, select previous selectedIndex
1460
- if (this.isInitActivated) {
1461
- this.select(this.selectedIndex, false, true);
1462
- return;
1463
- }
1464
- // select with selector string
1465
- if (initialIndex && typeof initialIndex == 'string') {
1466
- var cell = this.queryCell(initialIndex);
1467
- if (cell) {
1468
- this.selectCell(initialIndex, false, true);
1469
- return;
1470
- }
1471
- }
1472
-
1473
- var index = 0;
1474
- // select with number
1475
- if (initialIndex && this.slides[initialIndex]) {
1476
- index = initialIndex;
1477
- }
1478
- // select instantly
1479
- this.select(index, false, true);
1480
- };
1481
-
1482
- /**
1483
- * select slide from number or cell element
1484
- * @param {Element or Number} elem
1485
- */
1486
- proto$8.selectCell = function (value, isWrap, isInstant) {
1487
- // get cell
1488
- var cell = this.queryCell(value);
1489
- if (!cell) {
1490
- return;
1491
- }
1492
-
1493
- var index = this.getCellSlideIndex(cell);
1494
- this.select(index, isWrap, isInstant);
1495
- };
1496
-
1497
- proto$8.getCellSlideIndex = function (cell) {
1498
- // get index of slides that has cell
1499
- for (var i = 0; i < this.slides.length; i++) {
1500
- var slide = this.slides[i];
1501
- var index = slide.cells.indexOf(cell);
1502
- if (index != -1) {
1503
- return i;
1504
- }
1505
- }
1506
- };
1507
-
1508
- // -------------------------- get cells -------------------------- //
1509
-
1510
- /**
1511
- * get Flickity.Cell, given an Element
1512
- * @param {Element} elem
1513
- * @returns {Flickity.Cell} item
1514
- */
1515
- proto$8.getCell = function (elem) {
1516
- // loop through cells to get the one that matches
1517
- for (var i = 0; i < this.cells.length; i++) {
1518
- var cell = this.cells[i];
1519
- if (cell.element == elem) {
1520
- return cell;
1521
- }
1522
- }
1523
- };
1524
-
1525
- /**
1526
- * get collection of Flickity.Cells, given Elements
1527
- * @param {Element, Array, NodeList} elems
1528
- * @returns {Array} cells - Flickity.Cells
1529
- */
1530
- proto$8.getCells = function (elems) {
1531
- elems = utils.makeArray(elems);
1532
- var cells = [];
1533
- elems.forEach(function (elem) {
1534
- var cell = this.getCell(elem);
1535
- if (cell) {
1536
- cells.push(cell);
1537
- }
1538
- }, this);
1539
- return cells;
1540
- };
1541
-
1542
- /**
1543
- * get cell elements
1544
- * @returns {Array} cellElems
1545
- */
1546
- proto$8.getCellElements = function () {
1547
- return this.cells.map(function (cell) {
1548
- return cell.element;
1549
- });
1550
- };
1551
-
1552
- /**
1553
- * get parent cell from an element
1554
- * @param {Element} elem
1555
- * @returns {Flickit.Cell} cell
1556
- */
1557
- proto$8.getParentCell = function (elem) {
1558
- // first check if elem is cell
1559
- var cell = this.getCell(elem);
1560
- if (cell) {
1561
- return cell;
1562
- }
1563
- // try to get parent cell elem
1564
- elem = utils.getParent(elem, '.flickity-slider > *');
1565
- return this.getCell(elem);
1566
- };
1567
-
1568
- /**
1569
- * get cells adjacent to a slide
1570
- * @param {Integer} adjCount - number of adjacent slides
1571
- * @param {Integer} index - index of slide to start
1572
- * @returns {Array} cells - array of Flickity.Cells
1573
- */
1574
- proto$8.getAdjacentCellElements = function (adjCount, index) {
1575
- if (!adjCount) {
1576
- return this.selectedSlide.getCellElements();
1577
- }
1578
- index = index === undefined ? this.selectedIndex : index;
1579
-
1580
- var len = this.slides.length;
1581
- if (1 + adjCount * 2 >= len) {
1582
- return this.getCellElements();
1583
- }
1584
-
1585
- var cellElems = [];
1586
- for (var i = index - adjCount; i <= index + adjCount; i++) {
1587
- var slideIndex = this.options.wrapAround ? utils.modulo(i, len) : i;
1588
- var slide = this.slides[slideIndex];
1589
- if (slide) {
1590
- cellElems = cellElems.concat(slide.getCellElements());
1591
- }
1592
- }
1593
- return cellElems;
1594
- };
1595
-
1596
- /**
1597
- * select slide from number or cell element
1598
- * @param {Element, Selector String, or Number} selector
1599
- */
1600
- proto$8.queryCell = function (selector) {
1601
- if (typeof selector == 'number') {
1602
- // use number as index
1603
- return this.cells[selector];
1604
- }
1605
- if (typeof selector == 'string') {
1606
- // do not select invalid selectors from hash: #123, #/. #791
1607
- if (selector.match(/^[#\.]?[\d\/]/)) {
1608
- return;
1609
- }
1610
- // use string as selector, get element
1611
- selector = this.element.querySelector(selector);
1612
- }
1613
- // get cell from element
1614
- return this.getCell(selector);
1615
- };
1616
-
1617
- // -------------------------- events -------------------------- //
1618
-
1619
- proto$8.uiChange = function () {
1620
- this.emitEvent('uiChange');
1621
- };
1622
-
1623
- // keep focus on element when child UI elements are clicked
1624
- proto$8.childUIPointerDown = function (event) {
1625
- // HACK iOS does not allow touch events to bubble up?!
1626
- if (event.type != 'touchstart') {
1627
- event.preventDefault();
1628
- }
1629
- this.focus();
1630
- };
1631
-
1632
- // ----- resize ----- //
1633
-
1634
- proto$8.onresize = function () {
1635
- this.watchCSS();
1636
- this.resize();
1637
- };
1638
-
1639
- utils.debounceMethod(Flickity, 'onresize', 150);
1640
-
1641
- proto$8.resize = function () {
1642
- if (!this.isActive) {
1643
- return;
1644
- }
1645
- this.getSize();
1646
- // wrap values
1647
- if (this.options.wrapAround) {
1648
- this.x = utils.modulo(this.x, this.slideableWidth);
1649
- }
1650
- this.positionCells();
1651
- this._getWrapShiftCells();
1652
- this.setGallerySize();
1653
- this.emitEvent('resize');
1654
- // update selected index for group slides, instant
1655
- // TODO: position can be lost between groups of various numbers
1656
- var selectedElement = this.selectedElements && this.selectedElements[0];
1657
- this.selectCell(selectedElement, false, true);
1658
- };
1659
-
1660
- // watches the :after property, activates/deactivates
1661
- proto$8.watchCSS = function () {
1662
- var watchOption = this.options.watchCSS;
1663
- if (!watchOption) {
1664
- return;
1665
- }
1666
-
1667
- var afterContent = getComputedStyle$1(this.element, ':after').content;
1668
- // activate if :after { content: 'flickity' }
1669
- if (afterContent.indexOf('flickity') != -1) {
1670
- this.activate();
1671
- } else {
1672
- this.deactivate();
1673
- }
1674
- };
1675
-
1676
- // ----- keydown ----- //
1677
-
1678
- // go previous/next if left/right keys pressed
1679
- proto$8.onkeydown = function (event) {
1680
- // only work if element is in focus
1681
- var isNotFocused =
1682
- document.activeElement && document.activeElement != this.element;
1683
- if (!this.options.accessibility || isNotFocused) {
1684
- return;
1685
- }
1686
-
1687
- var handler = Flickity.keyboardHandlers[event.keyCode];
1688
- if (handler) {
1689
- handler.call(this);
1690
- }
1691
- };
1692
-
1693
- Flickity.keyboardHandlers = {
1694
- // left arrow
1695
- 37: function () {
1696
- var leftMethod = this.options.rightToLeft ? 'next' : 'previous';
1697
- this.uiChange();
1698
- this[leftMethod]();
1699
- },
1700
- // right arrow
1701
- 39: function () {
1702
- var rightMethod = this.options.rightToLeft ? 'previous' : 'next';
1703
- this.uiChange();
1704
- this[rightMethod]();
1705
- },
1706
- };
1707
-
1708
- // ----- focus ----- //
1709
-
1710
- proto$8.focus = function () {
1711
- // TODO remove scrollTo once focus options gets more support
1712
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#Browser_compatibility
1713
- var prevScrollY = window.pageYOffset;
1714
- this.element.focus({ preventScroll: true });
1715
- // hack to fix scroll jump after focus, #76
1716
- if (window.pageYOffset != prevScrollY) {
1717
- window.scrollTo(window.pageXOffset, prevScrollY);
1718
- }
1719
- };
1720
-
1721
- // -------------------------- destroy -------------------------- //
1722
-
1723
- // deactivate all Flickity functionality, but keep stuff available
1724
- proto$8.deactivate = function () {
1725
- if (!this.isActive) {
1726
- return;
1727
- }
1728
- this.element.classList.remove('flickity-enabled');
1729
- this.element.classList.remove('flickity-rtl');
1730
- this.unselectSelectedSlide();
1731
- // destroy cells
1732
- this.cells.forEach(function (cell) {
1733
- cell.destroy();
1734
- });
1735
- this.element.removeChild(this.viewport);
1736
- // move child elements back into element
1737
- moveElements(this.slider.children, this.element);
1738
- if (this.options.accessibility) {
1739
- this.element.removeAttribute('tabIndex');
1740
- this.element.removeEventListener('keydown', this);
1741
- }
1742
- // set flags
1743
- this.isActive = false;
1744
- this.emitEvent('deactivate');
1745
- };
1746
-
1747
- proto$8.destroy = function () {
1748
- this.deactivate();
1749
- window.removeEventListener('resize', this);
1750
- this.allOff();
1751
- this.emitEvent('destroy');
1752
- delete this.element.flickityGUID;
1753
- delete instances[this.guid];
1754
- };
1755
-
1756
- // -------------------------- prototype -------------------------- //
1757
-
1758
- utils.extend(proto$8, proto$9);
1759
-
1760
- // -------------------------- extras -------------------------- //
1761
-
1762
- /**
1763
- * get Flickity instance from element
1764
- * @param {Element} elem
1765
- * @returns {Flickity}
1766
- */
1767
- Flickity.data = function (elem) {
1768
- elem = utils.getQueryElement(elem);
1769
- var id = elem && elem.flickityGUID;
1770
- return id && instances[id];
1771
- };
1772
-
1773
- utils.htmlInit(Flickity, 'flickity');
1774
-
1775
- Flickity.Cell = Cell;
1776
- Flickity.Slide = Slide$1;
1777
-
1778
- var unipointer = createCommonjsModule(function (module) {
1779
- /*!
1780
- * Unipointer v2.4.0
1781
- * base class for doing one thing with pointer event
1782
- * MIT license
1783
- */
1784
-
1785
- /*jshint browser: true, undef: true, unused: true, strict: true */
1786
-
1787
- ( function( window, factory ) {
1788
- // universal module definition
1789
- /* jshint strict: false */ /*global define, module, require */
1790
- if ( module.exports ) {
1791
- // CommonJS
1792
- module.exports = factory(
1793
- window,
1794
- evEmitter
1795
- );
1796
- } else {
1797
- // browser global
1798
- window.Unipointer = factory(
1799
- window,
1800
- window.EvEmitter
1801
- );
1802
- }
1803
-
1804
- }( window, function factory( window, EvEmitter ) {
1805
-
1806
- function noop() {}
1807
-
1808
- function Unipointer() {}
1809
-
1810
- // inherit EvEmitter
1811
- var proto = Unipointer.prototype = Object.create( EvEmitter.prototype );
1812
-
1813
- proto.bindStartEvent = function( elem ) {
1814
- this._bindStartEvent( elem, true );
1815
- };
1816
-
1817
- proto.unbindStartEvent = function( elem ) {
1818
- this._bindStartEvent( elem, false );
1819
- };
1820
-
1821
- /**
1822
- * Add or remove start event
1823
- * @param {Boolean} isAdd - remove if falsey
1824
- */
1825
- proto._bindStartEvent = function( elem, isAdd ) {
1826
- // munge isAdd, default to true
1827
- isAdd = isAdd === undefined ? true : isAdd;
1828
- var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
1829
-
1830
- // default to mouse events
1831
- var startEvent = 'mousedown';
1832
- if ( 'ontouchstart' in window ) {
1833
- // HACK prefer Touch Events as you can preventDefault on touchstart to
1834
- // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177
1835
- startEvent = 'touchstart';
1836
- } else if ( window.PointerEvent ) {
1837
- // Pointer Events
1838
- startEvent = 'pointerdown';
1839
- }
1840
- elem[ bindMethod ]( startEvent, this );
1841
- };
1842
-
1843
- // trigger handler methods for events
1844
- proto.handleEvent = function( event ) {
1845
- var method = 'on' + event.type;
1846
- if ( this[ method ] ) {
1847
- this[ method ]( event );
1848
- }
1849
- };
1850
-
1851
- // returns the touch that we're keeping track of
1852
- proto.getTouch = function( touches ) {
1853
- for ( var i=0; i < touches.length; i++ ) {
1854
- var touch = touches[i];
1855
- if ( touch.identifier == this.pointerIdentifier ) {
1856
- return touch;
1857
- }
1858
- }
1859
- };
1860
-
1861
- // ----- start event ----- //
1862
-
1863
- proto.onmousedown = function( event ) {
1864
- // dismiss clicks from right or middle buttons
1865
- var button = event.button;
1866
- if ( button && ( button !== 0 && button !== 1 ) ) {
1867
- return;
1868
- }
1869
- this._pointerDown( event, event );
1870
- };
1871
-
1872
- proto.ontouchstart = function( event ) {
1873
- this._pointerDown( event, event.changedTouches[0] );
1874
- };
1875
-
1876
- proto.onpointerdown = function( event ) {
1877
- this._pointerDown( event, event );
1878
- };
1879
-
1880
- /**
1881
- * pointer start
1882
- * @param {Event} event
1883
- * @param {Event or Touch} pointer
1884
- */
1885
- proto._pointerDown = function( event, pointer ) {
1886
- // dismiss right click and other pointers
1887
- // button = 0 is okay, 1-4 not
1888
- if ( event.button || this.isPointerDown ) {
1889
- return;
1890
- }
1891
-
1892
- this.isPointerDown = true;
1893
- // save pointer identifier to match up touch events
1894
- this.pointerIdentifier = pointer.pointerId !== undefined ?
1895
- // pointerId for pointer events, touch.indentifier for touch events
1896
- pointer.pointerId : pointer.identifier;
1897
-
1898
- this.pointerDown( event, pointer );
1899
- };
1900
-
1901
- proto.pointerDown = function( event, pointer ) {
1902
- this._bindPostStartEvents( event );
1903
- this.emitEvent( 'pointerDown', [ event, pointer ] );
1904
- };
1905
-
1906
- // hash of events to be bound after start event
1907
- var postStartEvents = {
1908
- mousedown: [ 'mousemove', 'mouseup' ],
1909
- touchstart: [ 'touchmove', 'touchend', 'touchcancel' ],
1910
- pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ],
1911
- };
1912
-
1913
- proto._bindPostStartEvents = function( event ) {
1914
- if ( !event ) {
1915
- return;
1916
- }
1917
- // get proper events to match start event
1918
- var events = postStartEvents[ event.type ];
1919
- // bind events to node
1920
- events.forEach( function( eventName ) {
1921
- window.addEventListener( eventName, this );
1922
- }, this );
1923
- // save these arguments
1924
- this._boundPointerEvents = events;
1925
- };
1926
-
1927
- proto._unbindPostStartEvents = function() {
1928
- // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug)
1929
- if ( !this._boundPointerEvents ) {
1930
- return;
1931
- }
1932
- this._boundPointerEvents.forEach( function( eventName ) {
1933
- window.removeEventListener( eventName, this );
1934
- }, this );
1935
-
1936
- delete this._boundPointerEvents;
1937
- };
1938
-
1939
- // ----- move event ----- //
1940
-
1941
- proto.onmousemove = function( event ) {
1942
- this._pointerMove( event, event );
1943
- };
1944
-
1945
- proto.onpointermove = function( event ) {
1946
- if ( event.pointerId == this.pointerIdentifier ) {
1947
- this._pointerMove( event, event );
1948
- }
1949
- };
1950
-
1951
- proto.ontouchmove = function( event ) {
1952
- var touch = this.getTouch( event.changedTouches );
1953
- if ( touch ) {
1954
- this._pointerMove( event, touch );
1955
- }
1956
- };
1957
-
1958
- /**
1959
- * pointer move
1960
- * @param {Event} event
1961
- * @param {Event or Touch} pointer
1962
- * @private
1963
- */
1964
- proto._pointerMove = function( event, pointer ) {
1965
- this.pointerMove( event, pointer );
1966
- };
1967
-
1968
- // public
1969
- proto.pointerMove = function( event, pointer ) {
1970
- this.emitEvent( 'pointerMove', [ event, pointer ] );
1971
- };
1972
-
1973
- // ----- end event ----- //
1974
-
1975
-
1976
- proto.onmouseup = function( event ) {
1977
- this._pointerUp( event, event );
1978
- };
1979
-
1980
- proto.onpointerup = function( event ) {
1981
- if ( event.pointerId == this.pointerIdentifier ) {
1982
- this._pointerUp( event, event );
1983
- }
1984
- };
1985
-
1986
- proto.ontouchend = function( event ) {
1987
- var touch = this.getTouch( event.changedTouches );
1988
- if ( touch ) {
1989
- this._pointerUp( event, touch );
1990
- }
1991
- };
1992
-
1993
- /**
1994
- * pointer up
1995
- * @param {Event} event
1996
- * @param {Event or Touch} pointer
1997
- * @private
1998
- */
1999
- proto._pointerUp = function( event, pointer ) {
2000
- this._pointerDone();
2001
- this.pointerUp( event, pointer );
2002
- };
2003
-
2004
- // public
2005
- proto.pointerUp = function( event, pointer ) {
2006
- this.emitEvent( 'pointerUp', [ event, pointer ] );
2007
- };
2008
-
2009
- // ----- pointer done ----- //
2010
-
2011
- // triggered on pointer up & pointer cancel
2012
- proto._pointerDone = function() {
2013
- this._pointerReset();
2014
- this._unbindPostStartEvents();
2015
- this.pointerDone();
2016
- };
2017
-
2018
- proto._pointerReset = function() {
2019
- // reset properties
2020
- this.isPointerDown = false;
2021
- delete this.pointerIdentifier;
2022
- };
2023
-
2024
- proto.pointerDone = noop;
2025
-
2026
- // ----- pointer cancel ----- //
2027
-
2028
- proto.onpointercancel = function( event ) {
2029
- if ( event.pointerId == this.pointerIdentifier ) {
2030
- this._pointerCancel( event, event );
2031
- }
2032
- };
2033
-
2034
- proto.ontouchcancel = function( event ) {
2035
- var touch = this.getTouch( event.changedTouches );
2036
- if ( touch ) {
2037
- this._pointerCancel( event, touch );
2038
- }
2039
- };
2040
-
2041
- /**
2042
- * pointer cancel
2043
- * @param {Event} event
2044
- * @param {Event or Touch} pointer
2045
- * @private
2046
- */
2047
- proto._pointerCancel = function( event, pointer ) {
2048
- this._pointerDone();
2049
- this.pointerCancel( event, pointer );
2050
- };
2051
-
2052
- // public
2053
- proto.pointerCancel = function( event, pointer ) {
2054
- this.emitEvent( 'pointerCancel', [ event, pointer ] );
2055
- };
2056
-
2057
- // ----- ----- //
2058
-
2059
- // utility function for getting x/y coords from event
2060
- Unipointer.getPointerPoint = function( pointer ) {
2061
- return {
2062
- x: pointer.pageX,
2063
- y: pointer.pageY
2064
- };
2065
- };
2066
-
2067
- // ----- ----- //
2068
-
2069
- return Unipointer;
2070
-
2071
- }));
2072
- });
2073
-
2074
- var unidragger = createCommonjsModule(function (module) {
2075
- /*!
2076
- * Unidragger v2.4.0
2077
- * Draggable base class
2078
- * MIT license
2079
- */
2080
-
2081
- /*jshint browser: true, unused: true, undef: true, strict: true */
2082
-
2083
- ( function( window, factory ) {
2084
- // universal module definition
2085
- /*jshint strict: false */ /*globals define, module, require */
2086
-
2087
- if ( module.exports ) {
2088
- // CommonJS
2089
- module.exports = factory(
2090
- window,
2091
- unipointer
2092
- );
2093
- } else {
2094
- // browser global
2095
- window.Unidragger = factory(
2096
- window,
2097
- window.Unipointer
2098
- );
2099
- }
2100
-
2101
- }( window, function factory( window, Unipointer ) {
2102
-
2103
- // -------------------------- Unidragger -------------------------- //
2104
-
2105
- function Unidragger() {}
2106
-
2107
- // inherit Unipointer & EvEmitter
2108
- var proto = Unidragger.prototype = Object.create( Unipointer.prototype );
2109
-
2110
- // ----- bind start ----- //
2111
-
2112
- proto.bindHandles = function() {
2113
- this._bindHandles( true );
2114
- };
2115
-
2116
- proto.unbindHandles = function() {
2117
- this._bindHandles( false );
2118
- };
2119
-
2120
- /**
2121
- * Add or remove start event
2122
- * @param {Boolean} isAdd
2123
- */
2124
- proto._bindHandles = function( isAdd ) {
2125
- // munge isAdd, default to true
2126
- isAdd = isAdd === undefined ? true : isAdd;
2127
- // bind each handle
2128
- var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
2129
- var touchAction = isAdd ? this._touchActionValue : '';
2130
- for ( var i=0; i < this.handles.length; i++ ) {
2131
- var handle = this.handles[i];
2132
- this._bindStartEvent( handle, isAdd );
2133
- handle[ bindMethod ]( 'click', this );
2134
- // touch-action: none to override browser touch gestures. metafizzy/flickity#540
2135
- if ( window.PointerEvent ) {
2136
- handle.style.touchAction = touchAction;
2137
- }
2138
- }
2139
- };
2140
-
2141
- // prototype so it can be overwriteable by Flickity
2142
- proto._touchActionValue = 'none';
2143
-
2144
- // ----- start event ----- //
2145
-
2146
- /**
2147
- * pointer start
2148
- * @param {Event} event
2149
- * @param {Event or Touch} pointer
2150
- */
2151
- proto.pointerDown = function( event, pointer ) {
2152
- var isOkay = this.okayPointerDown( event );
2153
- if ( !isOkay ) {
2154
- return;
2155
- }
2156
- // track start event position
2157
- // Safari 9 overrides pageX and pageY. These values needs to be copied. flickity#842
2158
- this.pointerDownPointer = {
2159
- pageX: pointer.pageX,
2160
- pageY: pointer.pageY,
2161
- };
2162
-
2163
- event.preventDefault();
2164
- this.pointerDownBlur();
2165
- // bind move and end events
2166
- this._bindPostStartEvents( event );
2167
- this.emitEvent( 'pointerDown', [ event, pointer ] );
2168
- };
2169
-
2170
- // nodes that have text fields
2171
- var cursorNodes = {
2172
- TEXTAREA: true,
2173
- INPUT: true,
2174
- SELECT: true,
2175
- OPTION: true,
2176
- };
2177
-
2178
- // input types that do not have text fields
2179
- var clickTypes = {
2180
- radio: true,
2181
- checkbox: true,
2182
- button: true,
2183
- submit: true,
2184
- image: true,
2185
- file: true,
2186
- };
2187
-
2188
- // dismiss inputs with text fields. flickity#403, flickity#404
2189
- proto.okayPointerDown = function( event ) {
2190
- var isCursorNode = cursorNodes[ event.target.nodeName ];
2191
- var isClickType = clickTypes[ event.target.type ];
2192
- var isOkay = !isCursorNode || isClickType;
2193
- if ( !isOkay ) {
2194
- this._pointerReset();
2195
- }
2196
- return isOkay;
2197
- };
2198
-
2199
- // kludge to blur previously focused input
2200
- proto.pointerDownBlur = function() {
2201
- var focused = document.activeElement;
2202
- // do not blur body for IE10, metafizzy/flickity#117
2203
- var canBlur = focused && focused.blur && focused != document.body;
2204
- if ( canBlur ) {
2205
- focused.blur();
2206
- }
2207
- };
2208
-
2209
- // ----- move event ----- //
2210
-
2211
- /**
2212
- * drag move
2213
- * @param {Event} event
2214
- * @param {Event or Touch} pointer
2215
- */
2216
- proto.pointerMove = function( event, pointer ) {
2217
- var moveVector = this._dragPointerMove( event, pointer );
2218
- this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] );
2219
- this._dragMove( event, pointer, moveVector );
2220
- };
2221
-
2222
- // base pointer move logic
2223
- proto._dragPointerMove = function( event, pointer ) {
2224
- var moveVector = {
2225
- x: pointer.pageX - this.pointerDownPointer.pageX,
2226
- y: pointer.pageY - this.pointerDownPointer.pageY
2227
- };
2228
- // start drag if pointer has moved far enough to start drag
2229
- if ( !this.isDragging && this.hasDragStarted( moveVector ) ) {
2230
- this._dragStart( event, pointer );
2231
- }
2232
- return moveVector;
2233
- };
2234
-
2235
- // condition if pointer has moved far enough to start drag
2236
- proto.hasDragStarted = function( moveVector ) {
2237
- return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3;
2238
- };
2239
-
2240
- // ----- end event ----- //
2241
-
2242
- /**
2243
- * pointer up
2244
- * @param {Event} event
2245
- * @param {Event or Touch} pointer
2246
- */
2247
- proto.pointerUp = function( event, pointer ) {
2248
- this.emitEvent( 'pointerUp', [ event, pointer ] );
2249
- this._dragPointerUp( event, pointer );
2250
- };
2251
-
2252
- proto._dragPointerUp = function( event, pointer ) {
2253
- if ( this.isDragging ) {
2254
- this._dragEnd( event, pointer );
2255
- } else {
2256
- // pointer didn't move enough for drag to start
2257
- this._staticClick( event, pointer );
2258
- }
2259
- };
2260
-
2261
- // -------------------------- drag -------------------------- //
2262
-
2263
- // dragStart
2264
- proto._dragStart = function( event, pointer ) {
2265
- this.isDragging = true;
2266
- // prevent clicks
2267
- this.isPreventingClicks = true;
2268
- this.dragStart( event, pointer );
2269
- };
2270
-
2271
- proto.dragStart = function( event, pointer ) {
2272
- this.emitEvent( 'dragStart', [ event, pointer ] );
2273
- };
2274
-
2275
- // dragMove
2276
- proto._dragMove = function( event, pointer, moveVector ) {
2277
- // do not drag if not dragging yet
2278
- if ( !this.isDragging ) {
2279
- return;
2280
- }
2281
-
2282
- this.dragMove( event, pointer, moveVector );
2283
- };
2284
-
2285
- proto.dragMove = function( event, pointer, moveVector ) {
2286
- event.preventDefault();
2287
- this.emitEvent( 'dragMove', [ event, pointer, moveVector ] );
2288
- };
2289
-
2290
- // dragEnd
2291
- proto._dragEnd = function( event, pointer ) {
2292
- // set flags
2293
- this.isDragging = false;
2294
- // re-enable clicking async
2295
- setTimeout( function() {
2296
- delete this.isPreventingClicks;
2297
- }.bind( this ) );
2298
-
2299
- this.dragEnd( event, pointer );
2300
- };
2301
-
2302
- proto.dragEnd = function( event, pointer ) {
2303
- this.emitEvent( 'dragEnd', [ event, pointer ] );
2304
- };
2305
-
2306
- // ----- onclick ----- //
2307
-
2308
- // handle all clicks and prevent clicks when dragging
2309
- proto.onclick = function( event ) {
2310
- if ( this.isPreventingClicks ) {
2311
- event.preventDefault();
2312
- }
2313
- };
2314
-
2315
- // ----- staticClick ----- //
2316
-
2317
- // triggered after pointer down & up with no/tiny movement
2318
- proto._staticClick = function( event, pointer ) {
2319
- // ignore emulated mouse up clicks
2320
- if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
2321
- return;
2322
- }
2323
-
2324
- this.staticClick( event, pointer );
2325
-
2326
- // set flag for emulated clicks 300ms after touchend
2327
- if ( event.type != 'mouseup' ) {
2328
- this.isIgnoringMouseUp = true;
2329
- // reset flag after 300ms
2330
- setTimeout( function() {
2331
- delete this.isIgnoringMouseUp;
2332
- }.bind( this ), 400 );
2333
- }
2334
- };
2335
-
2336
- proto.staticClick = function( event, pointer ) {
2337
- this.emitEvent( 'staticClick', [ event, pointer ] );
2338
- };
2339
-
2340
- // ----- utils ----- //
2341
-
2342
- Unidragger.getPointerPoint = Unipointer.getPointerPoint;
2343
-
2344
- // ----- ----- //
2345
-
2346
- return Unidragger;
2347
-
2348
- }));
2349
- });
2350
-
2351
- // ----- defaults ----- //
2352
-
2353
- utils.extend(Flickity.defaults, {
2354
- draggable: '>1',
2355
- dragThreshold: 3,
2356
- });
2357
-
2358
- // ----- create ----- //
2359
-
2360
- Flickity.createMethods.push('_createDrag');
2361
-
2362
- // -------------------------- drag prototype -------------------------- //
2363
-
2364
- var proto$7 = Flickity.prototype;
2365
- utils.extend(proto$7, unidragger.prototype);
2366
- proto$7._touchActionValue = 'pan-y';
2367
-
2368
- // -------------------------- -------------------------- //
2369
-
2370
- var isTouch = 'createTouch' in document;
2371
- var isTouchmoveScrollCanceled = false;
2372
-
2373
- proto$7._createDrag = function () {
2374
- this.on('activate', this.onActivateDrag);
2375
- this.on('uiChange', this._uiChangeDrag);
2376
- this.on('deactivate', this.onDeactivateDrag);
2377
- this.on('cellChange', this.updateDraggable);
2378
- // TODO updateDraggable on resize? if groupCells & slides change
2379
- // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
2380
- // #457, RubaXa/Sortable#973
2381
- if (isTouch && !isTouchmoveScrollCanceled) {
2382
- window.addEventListener('touchmove', function () {});
2383
- isTouchmoveScrollCanceled = true;
2384
- }
2385
- };
2386
-
2387
- proto$7.onActivateDrag = function () {
2388
- this.handles = [this.viewport];
2389
- this.bindHandles();
2390
- this.updateDraggable();
2391
- };
2392
-
2393
- proto$7.onDeactivateDrag = function () {
2394
- this.unbindHandles();
2395
- this.element.classList.remove('is-draggable');
2396
- };
2397
-
2398
- proto$7.updateDraggable = function () {
2399
- // disable dragging if less than 2 slides. #278
2400
- if (this.options.draggable == '>1') {
2401
- this.isDraggable = this.slides.length > 1;
2402
- } else {
2403
- this.isDraggable = this.options.draggable;
2404
- }
2405
- if (this.isDraggable) {
2406
- this.element.classList.add('is-draggable');
2407
- } else {
2408
- this.element.classList.remove('is-draggable');
2409
- }
2410
- };
2411
-
2412
- // backwards compatibility
2413
- proto$7.bindDrag = function () {
2414
- this.options.draggable = true;
2415
- this.updateDraggable();
2416
- };
2417
-
2418
- proto$7.unbindDrag = function () {
2419
- this.options.draggable = false;
2420
- this.updateDraggable();
2421
- };
2422
-
2423
- proto$7._uiChangeDrag = function () {
2424
- delete this.isFreeScrolling;
2425
- };
2426
-
2427
- // -------------------------- pointer events -------------------------- //
2428
-
2429
- proto$7.pointerDown = function (event, pointer) {
2430
- if (!this.isDraggable) {
2431
- this._pointerDownDefault(event, pointer);
2432
- return;
2433
- }
2434
- var isOkay = this.okayPointerDown(event);
2435
- if (!isOkay) {
2436
- return;
2437
- }
2438
-
2439
- this._pointerDownPreventDefault(event);
2440
- this.pointerDownFocus(event);
2441
- // blur
2442
- if (document.activeElement != this.element) {
2443
- // do not blur if already focused
2444
- this.pointerDownBlur();
2445
- }
2446
-
2447
- // stop if it was moving
2448
- this.dragX = this.x;
2449
- this.viewport.classList.add('is-pointer-down');
2450
- // track scrolling
2451
- this.pointerDownScroll = getScrollPosition();
2452
- window.addEventListener('scroll', this);
2453
-
2454
- this._pointerDownDefault(event, pointer);
2455
- };
2456
-
2457
- // default pointerDown logic, used for staticClick
2458
- proto$7._pointerDownDefault = function (event, pointer) {
2459
- // track start event position
2460
- // Safari 9 overrides pageX and pageY. These values needs to be copied. #779
2461
- this.pointerDownPointer = {
2462
- pageX: pointer.pageX,
2463
- pageY: pointer.pageY,
2464
- };
2465
- // bind move and end events
2466
- this._bindPostStartEvents(event);
2467
- this.dispatchEvent('pointerDown', event, [pointer]);
2468
- };
2469
-
2470
- var focusNodes = {
2471
- INPUT: true,
2472
- TEXTAREA: true,
2473
- SELECT: true,
2474
- };
2475
-
2476
- proto$7.pointerDownFocus = function (event) {
2477
- var isFocusNode = focusNodes[event.target.nodeName];
2478
- if (!isFocusNode) {
2479
- this.focus();
2480
- }
2481
- };
2482
-
2483
- proto$7._pointerDownPreventDefault = function (event) {
2484
- var isTouchStart = event.type == 'touchstart';
2485
- var isTouchPointer = event.pointerType == 'touch';
2486
- var isFocusNode = focusNodes[event.target.nodeName];
2487
- if (!isTouchStart && !isTouchPointer && !isFocusNode) {
2488
- event.preventDefault();
2489
- }
2490
- };
2491
-
2492
- // ----- move ----- //
2493
-
2494
- proto$7.hasDragStarted = function (moveVector) {
2495
- return Math.abs(moveVector.x) > this.options.dragThreshold;
2496
- };
2497
-
2498
- // ----- up ----- //
2499
-
2500
- proto$7.pointerUp = function (event, pointer) {
2501
- delete this.isTouchScrolling;
2502
- this.viewport.classList.remove('is-pointer-down');
2503
- this.dispatchEvent('pointerUp', event, [pointer]);
2504
- this._dragPointerUp(event, pointer);
2505
- };
2506
-
2507
- proto$7.pointerDone = function () {
2508
- window.removeEventListener('scroll', this);
2509
- delete this.pointerDownScroll;
2510
- };
2511
-
2512
- // -------------------------- dragging -------------------------- //
2513
-
2514
- proto$7.dragStart = function (event, pointer) {
2515
- if (!this.isDraggable) {
2516
- return;
2517
- }
2518
- this.dragStartPosition = this.x;
2519
- this.startAnimation();
2520
- window.removeEventListener('scroll', this);
2521
- this.dispatchEvent('dragStart', event, [pointer]);
2522
- };
2523
-
2524
- proto$7.pointerMove = function (event, pointer) {
2525
- var moveVector = this._dragPointerMove(event, pointer);
2526
- this.dispatchEvent('pointerMove', event, [pointer, moveVector]);
2527
- this._dragMove(event, pointer, moveVector);
2528
- };
2529
-
2530
- proto$7.dragMove = function (event, pointer, moveVector) {
2531
- if (!this.isDraggable) {
2532
- return;
2533
- }
2534
- event.preventDefault();
2535
-
2536
- this.previousDragX = this.dragX;
2537
- // reverse if right-to-left
2538
- var direction = this.options.rightToLeft ? -1 : 1;
2539
- if (this.options.wrapAround) {
2540
- // wrap around move. #589
2541
- moveVector.x = moveVector.x % this.slideableWidth;
2542
- }
2543
- var dragX = this.dragStartPosition + moveVector.x * direction;
2544
-
2545
- if (!this.options.wrapAround && this.slides.length) {
2546
- // slow drag
2547
- var originBound = Math.max(-this.slides[0].target, this.dragStartPosition);
2548
- dragX = dragX > originBound ? (dragX + originBound) * 0.5 : dragX;
2549
- var endBound = Math.min(
2550
- -this.getLastSlide().target,
2551
- this.dragStartPosition
2552
- );
2553
- dragX = dragX < endBound ? (dragX + endBound) * 0.5 : dragX;
2554
- }
2555
-
2556
- this.dragX = dragX;
2557
-
2558
- this.dragMoveTime = new Date();
2559
- this.dispatchEvent('dragMove', event, [pointer, moveVector]);
2560
- };
2561
-
2562
- proto$7.dragEnd = function (event, pointer) {
2563
- if (!this.isDraggable) {
2564
- return;
2565
- }
2566
- if (this.options.freeScroll) {
2567
- this.isFreeScrolling = true;
2568
- }
2569
- // set selectedIndex based on where flick will end up
2570
- var index = this.dragEndRestingSelect();
2571
-
2572
- if (this.options.freeScroll && !this.options.wrapAround) {
2573
- // if free-scroll & not wrap around
2574
- // do not free-scroll if going outside of bounding slides
2575
- // so bounding slides can attract slider, and keep it in bounds
2576
- var restingX = this.getRestingPosition();
2577
- this.isFreeScrolling =
2578
- -restingX > this.slides[0].target &&
2579
- -restingX < this.getLastSlide().target;
2580
- } else if (!this.options.freeScroll && index == this.selectedIndex) {
2581
- // boost selection if selected index has not changed
2582
- index += this.dragEndBoostSelect();
2583
- }
2584
- delete this.previousDragX;
2585
- // apply selection
2586
- // TODO refactor this, selecting here feels weird
2587
- // HACK, set flag so dragging stays in correct direction
2588
- this.isDragSelect = this.options.wrapAround;
2589
- this.select(index);
2590
- delete this.isDragSelect;
2591
- this.dispatchEvent('dragEnd', event, [pointer]);
2592
- };
2593
-
2594
- proto$7.dragEndRestingSelect = function () {
2595
- var restingX = this.getRestingPosition();
2596
- // how far away from selected slide
2597
- var distance = Math.abs(this.getSlideDistance(-restingX, this.selectedIndex));
2598
- // get closet resting going up and going down
2599
- var positiveResting = this._getClosestResting(restingX, distance, 1);
2600
- var negativeResting = this._getClosestResting(restingX, distance, -1);
2601
- // use closer resting for wrap-around
2602
- var index =
2603
- positiveResting.distance < negativeResting.distance
2604
- ? positiveResting.index
2605
- : negativeResting.index;
2606
- return index;
2607
- };
2608
-
2609
- /**
2610
- * given resting X and distance to selected cell
2611
- * get the distance and index of the closest cell
2612
- * @param {Number} restingX - estimated post-flick resting position
2613
- * @param {Number} distance - distance to selected cell
2614
- * @param {Integer} increment - +1 or -1, going up or down
2615
- * @returns {Object} - { distance: {Number}, index: {Integer} }
2616
- */
2617
- proto$7._getClosestResting = function (restingX, distance, increment) {
2618
- var index = this.selectedIndex;
2619
- var minDistance = Infinity;
2620
- var condition =
2621
- this.options.contain && !this.options.wrapAround
2622
- ? // if contain, keep going if distance is equal to minDistance
2623
- function (d, md) {
2624
- return d <= md;
2625
- }
2626
- : function (d, md) {
2627
- return d < md;
2628
- };
2629
- while (condition(distance, minDistance)) {
2630
- // measure distance to next cell
2631
- index += increment;
2632
- minDistance = distance;
2633
- distance = this.getSlideDistance(-restingX, index);
2634
- if (distance === null) {
2635
- break;
2636
- }
2637
- distance = Math.abs(distance);
2638
- }
2639
- return {
2640
- distance: minDistance,
2641
- // selected was previous index
2642
- index: index - increment,
2643
- };
2644
- };
2645
-
2646
- /**
2647
- * measure distance between x and a slide target
2648
- * @param {Number} x
2649
- * @param {Integer} index - slide index
2650
- */
2651
- proto$7.getSlideDistance = function (x, index) {
2652
- var len = this.slides.length;
2653
- // wrap around if at least 2 slides
2654
- var isWrapAround = this.options.wrapAround && len > 1;
2655
- var slideIndex = isWrapAround ? utils.modulo(index, len) : index;
2656
- var slide = this.slides[slideIndex];
2657
- if (!slide) {
2658
- return null;
2659
- }
2660
- // add distance for wrap-around slides
2661
- var wrap = isWrapAround ? this.slideableWidth * Math.floor(index / len) : 0;
2662
- return x - (slide.target + wrap);
2663
- };
2664
-
2665
- proto$7.dragEndBoostSelect = function () {
2666
- // do not boost if no previousDragX or dragMoveTime
2667
- if (
2668
- this.previousDragX === undefined ||
2669
- !this.dragMoveTime ||
2670
- // or if drag was held for 100 ms
2671
- new Date() - this.dragMoveTime > 100
2672
- ) {
2673
- return 0;
2674
- }
2675
-
2676
- var distance = this.getSlideDistance(-this.dragX, this.selectedIndex);
2677
- var delta = this.previousDragX - this.dragX;
2678
- if (distance > 0 && delta > 0) {
2679
- // boost to next if moving towards the right, and positive velocity
2680
- return 1;
2681
- } else if (distance < 0 && delta < 0) {
2682
- // boost to previous if moving towards the left, and negative velocity
2683
- return -1;
2684
- }
2685
- return 0;
2686
- };
2687
-
2688
- // ----- staticClick ----- //
2689
-
2690
- proto$7.staticClick = function (event, pointer) {
2691
- // get clickedCell, if cell was clicked
2692
- var clickedCell = this.getParentCell(event.target);
2693
- var cellElem = clickedCell && clickedCell.element;
2694
- var cellIndex = clickedCell && this.cells.indexOf(clickedCell);
2695
- this.dispatchEvent('staticClick', event, [pointer, cellElem, cellIndex]);
2696
- };
2697
-
2698
- // ----- scroll ----- //
2699
-
2700
- proto$7.onscroll = function () {
2701
- var scroll = getScrollPosition();
2702
- var scrollMoveX = this.pointerDownScroll.x - scroll.x;
2703
- var scrollMoveY = this.pointerDownScroll.y - scroll.y;
2704
- // cancel click/tap if scroll is too much
2705
- if (Math.abs(scrollMoveX) > 3 || Math.abs(scrollMoveY) > 3) {
2706
- this._pointerDone();
2707
- }
2708
- };
2709
-
2710
- // ----- utils ----- //
2711
-
2712
- function getScrollPosition() {
2713
- return {
2714
- x: window.pageXOffset,
2715
- y: window.pageYOffset,
2716
- };
2717
- }
2718
-
2719
- // ----- ----- //
2720
-
2721
- var svgURI$1 = 'http://www.w3.org/2000/svg';
2722
-
2723
- // -------------------------- PrevNextButton -------------------------- //
2724
-
2725
- function PrevNextButton(direction, parent) {
2726
- this.direction = direction;
2727
- this.parent = parent;
2728
- this.parentElement = this.parent.element.shadowRoot || this.parent.element;
2729
- this._create();
2730
- }
2731
-
2732
- PrevNextButton.prototype = Object.create(unipointer.prototype);
2733
-
2734
- PrevNextButton.prototype._create = function () {
2735
- // properties
2736
- this.isEnabled = true;
2737
- this.isPrevious = this.direction == -1;
2738
- var leftDirection = this.parent.options.rightToLeft ? 1 : -1;
2739
- this.isLeft = this.direction == leftDirection;
2740
-
2741
- var button = (this.element = document.createElement('button'));
2742
- button.className = 'flickity-button flickity-prev-next-button';
2743
- button.part.add('navigation-button');
2744
- if (this.isPrevious) {
2745
- button.classList.add('previous');
2746
- button.part.add('navigation-button--previous');
2747
- } else {
2748
- button.classList.add('next');
2749
- button.part.add('navigation-button--next');
2750
- }
2751
- // prevent button from submitting form http://stackoverflow.com/a/10836076/182183
2752
- button.setAttribute('type', 'button');
2753
- // init as disabled
2754
- this.disable();
2755
-
2756
- button.setAttribute('aria-label', this.isPrevious ? 'Previous' : 'Next');
2757
-
2758
- const slot = document.createElement('slot');
2759
- slot.name = this.isPrevious ? 'previous-icon' : 'next-icon';
2760
- button.appendChild(slot);
2761
- slot.addEventListener('slotchange', () => {
2762
- slot.assignedElements({ flatten: true }).forEach((ele) => {
2763
- ele.removeAttribute('hidden');
2764
- });
2765
- });
2766
-
2767
- // create arrow
2768
- var svg = this.createSVG();
2769
- slot.appendChild(svg);
2770
- // events
2771
- this.parent.on('select', this.update.bind(this));
2772
- this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent));
2773
- };
2774
-
2775
- PrevNextButton.prototype.activate = function () {
2776
- this.bindStartEvent(this.element);
2777
- this.element.addEventListener('click', this);
2778
- // add to DOM
2779
- this.parentElement.appendChild(this.element);
2780
- };
2781
-
2782
- PrevNextButton.prototype.deactivate = function () {
2783
- // remove from DOM
2784
- this.parentElement.removeChild(this.element);
2785
- // click events
2786
- this.unbindStartEvent(this.element);
2787
- this.element.removeEventListener('click', this);
2788
- };
2789
-
2790
- PrevNextButton.prototype.createSVG = function () {
2791
- var svg = document.createElementNS(svgURI$1, 'svg');
2792
- svg.setAttribute('class', 'flickity-button-icon');
2793
- svg.setAttribute('viewBox', '0 0 100 100');
2794
- svg.part.add('navigation-icon');
2795
- var path = document.createElementNS(svgURI$1, 'path');
2796
- var pathMovements = getArrowMovements(this.parent.options.arrowShape);
2797
- path.setAttribute('d', pathMovements);
2798
- path.setAttribute('class', 'arrow');
2799
- // rotate arrow
2800
- if (!this.isLeft) {
2801
- path.setAttribute('transform', 'translate(100, 100) rotate(180) ');
2802
- }
2803
- svg.appendChild(path);
2804
- return svg;
2805
- };
2806
-
2807
- // get SVG path movmement
2808
- function getArrowMovements(shape) {
2809
- // use shape as movement if string
2810
- if (typeof shape == 'string') {
2811
- return shape;
2812
- }
2813
- // create movement string
2814
- return (
2815
- 'M ' +
2816
- shape.x0 +
2817
- ',50' +
2818
- ' L ' +
2819
- shape.x1 +
2820
- ',' +
2821
- (shape.y1 + 50) +
2822
- ' L ' +
2823
- shape.x2 +
2824
- ',' +
2825
- (shape.y2 + 50) +
2826
- ' L ' +
2827
- shape.x3 +
2828
- ',50 ' +
2829
- ' L ' +
2830
- shape.x2 +
2831
- ',' +
2832
- (50 - shape.y2) +
2833
- ' L ' +
2834
- shape.x1 +
2835
- ',' +
2836
- (50 - shape.y1) +
2837
- ' Z'
2838
- );
2839
- }
2840
-
2841
- PrevNextButton.prototype.handleEvent = utils.handleEvent;
2842
-
2843
- PrevNextButton.prototype.onclick = function () {
2844
- if (!this.isEnabled) {
2845
- return;
2846
- }
2847
- this.parent.uiChange();
2848
- var method = this.isPrevious ? 'previous' : 'next';
2849
- this.parent[method]();
2850
- };
2851
-
2852
- // ----- ----- //
2853
-
2854
- PrevNextButton.prototype.enable = function () {
2855
- if (this.isEnabled) {
2856
- return;
2857
- }
2858
- this.element.disabled = false;
2859
- this.isEnabled = true;
2860
- };
2861
-
2862
- PrevNextButton.prototype.disable = function () {
2863
- if (!this.isEnabled) {
2864
- return;
2865
- }
2866
- this.element.disabled = true;
2867
- this.isEnabled = false;
2868
- };
2869
-
2870
- PrevNextButton.prototype.update = function () {
2871
- // index of first or last slide, if previous or next
2872
- var slides = this.parent.slides;
2873
- // enable is wrapAround and at least 2 slides
2874
- if (this.parent.options.wrapAround && slides.length > 1) {
2875
- this.enable();
2876
- return;
2877
- }
2878
- var lastIndex = slides.length ? slides.length - 1 : 0;
2879
- var boundIndex = this.isPrevious ? 0 : lastIndex;
2880
- var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';
2881
- this[method]();
2882
- };
2883
-
2884
- PrevNextButton.prototype.destroy = function () {
2885
- this.deactivate();
2886
- this.allOff();
2887
- };
2888
-
2889
- // -------------------------- Flickity prototype -------------------------- //
2890
-
2891
- utils.extend(Flickity.defaults, {
2892
- prevNextButtons: true,
2893
- arrowShape: {
2894
- x0: 10,
2895
- x1: 60,
2896
- y1: 50,
2897
- x2: 70,
2898
- y2: 40,
2899
- x3: 30,
2900
- },
2901
- });
2902
-
2903
- Flickity.createMethods.push('_createPrevNextButtons');
2904
- var proto$6 = Flickity.prototype;
2905
-
2906
- proto$6._createPrevNextButtons = function () {
2907
- if (!this.options.prevNextButtons) {
2908
- return;
2909
- }
2910
-
2911
- this.prevButton = new PrevNextButton(-1, this);
2912
- this.nextButton = new PrevNextButton(1, this);
2913
-
2914
- this.on('activate', this.activatePrevNextButtons);
2915
- };
2916
-
2917
- proto$6.activatePrevNextButtons = function () {
2918
- this.prevButton.activate();
2919
- this.nextButton.activate();
2920
- this.on('deactivate', this.deactivatePrevNextButtons);
2921
- };
2922
-
2923
- proto$6.deactivatePrevNextButtons = function () {
2924
- this.prevButton.deactivate();
2925
- this.nextButton.deactivate();
2926
- this.off('deactivate', this.deactivatePrevNextButtons);
2927
- };
2928
-
2929
- // -------------------------- -------------------------- //
2930
-
2931
- Flickity.PrevNextButton = PrevNextButton;
2932
-
2933
- function PageDots(parent) {
2934
- this.parent = parent;
2935
- this.parentElement = this.parent.element.shadowRoot || this.parent.element;
2936
- this._create();
2937
- }
2938
-
2939
- PageDots.prototype = Object.create(unipointer.prototype);
2940
-
2941
- PageDots.prototype._create = function () {
2942
- // create holder element
2943
- this.holder = document.createElement('ol');
2944
- this.holder.className = 'flickity-page-dots';
2945
- this.holder.part.add('pagination');
2946
-
2947
- // create dots, array of elements
2948
- this.dots = [];
2949
- // events
2950
- this.handleClick = this.onClick.bind(this);
2951
- this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent));
2952
- };
2953
-
2954
- PageDots.prototype.activate = function () {
2955
- this.setDots();
2956
- this.holder.addEventListener('click', this.handleClick);
2957
- this.bindStartEvent(this.holder);
2958
- // add to DOM
2959
- this.parentElement.appendChild(this.holder);
2960
- };
2961
-
2962
- PageDots.prototype.deactivate = function () {
2963
- this.holder.removeEventListener('click', this.handleClick);
2964
- this.unbindStartEvent(this.holder);
2965
- // remove from DOM
2966
- this.parentElement.removeChild(this.holder);
2967
- };
2968
-
2969
- PageDots.prototype.setDots = function () {
2970
- // get difference between number of slides and number of dots
2971
- var delta = this.parent.slides.length - this.dots.length;
2972
- if (delta > 0) {
2973
- this.addDots(delta);
2974
- } else if (delta < 0) {
2975
- this.removeDots(-delta);
2976
- }
2977
- };
2978
-
2979
- PageDots.prototype.addDots = function (count) {
2980
- var fragment = document.createDocumentFragment();
2981
- var newDots = [];
2982
- var length = this.dots.length;
2983
- var max = length + count;
2984
-
2985
- for (var i = length; i < max; i++) {
2986
- var dot = document.createElement('li');
2987
- dot.classList.add('dot');
2988
- dot.part.add('pagination-item');
2989
- dot.setAttribute('aria-label', 'Page dot ' + (i + 1));
2990
- fragment.appendChild(dot);
2991
- newDots.push(dot);
2992
- }
2993
-
2994
- this.holder.appendChild(fragment);
2995
- this.dots = this.dots.concat(newDots);
2996
- };
2997
-
2998
- PageDots.prototype.removeDots = function (count) {
2999
- // remove from this.dots collection
3000
- var removeDots = this.dots.splice(this.dots.length - count, count);
3001
- // remove from DOM
3002
- removeDots.forEach(function (dot) {
3003
- this.holder.removeChild(dot);
3004
- }, this);
3005
- };
3006
-
3007
- PageDots.prototype.updateSelected = function () {
3008
- // remove selected class on previous
3009
- if (this.selectedDot) {
3010
- this.selectedDot.classList.remove('is-selected');
3011
- this.selectedDot.part.remove('pagination-item--active');
3012
- this.selectedDot.removeAttribute('aria-current');
3013
- }
3014
- // don't proceed if no dots
3015
- if (!this.dots.length) {
3016
- return;
3017
- }
3018
- this.selectedDot = this.dots[this.parent.selectedIndex];
3019
- this.selectedDot.classList.add('is-selected');
3020
- this.selectedDot.part.add('pagination-item--active');
3021
- this.selectedDot.setAttribute('aria-current', 'step');
3022
- };
3023
-
3024
- PageDots.prototype.onTap = PageDots.prototype.onClick = function (event) {
3025
- // old method name, backwards-compatible
3026
- var target = event.target;
3027
- // only care about dot clicks
3028
- if (target.nodeName != 'LI') {
3029
- return;
3030
- }
3031
-
3032
- this.parent.uiChange();
3033
- var index = this.dots.indexOf(target);
3034
- this.parent.select(index);
3035
- };
3036
-
3037
- PageDots.prototype.destroy = function () {
3038
- this.deactivate();
3039
- this.allOff();
3040
- };
3041
-
3042
- Flickity.PageDots = PageDots;
3043
-
3044
- // -------------------------- Flickity -------------------------- //
3045
-
3046
- utils.extend(Flickity.defaults, {
3047
- pageDots: true,
3048
- });
3049
-
3050
- Flickity.createMethods.push('_createPageDots');
3051
-
3052
- var proto$5 = Flickity.prototype;
3053
-
3054
- proto$5._createPageDots = function () {
3055
- if (!this.options.pageDots) {
3056
- return;
3057
- }
3058
- this.pageDots = new PageDots(this);
3059
- // events
3060
- this.on('activate', this.activatePageDots);
3061
- this.on('select', this.updateSelectedPageDots);
3062
- this.on('cellChange', this.updatePageDots);
3063
- this.on('resize', this.updatePageDots);
3064
- this.on('deactivate', this.deactivatePageDots);
3065
- };
3066
-
3067
- proto$5.activatePageDots = function () {
3068
- this.pageDots.activate();
3069
- };
3070
-
3071
- proto$5.updateSelectedPageDots = function () {
3072
- this.pageDots.updateSelected();
3073
- };
3074
-
3075
- proto$5.updatePageDots = function () {
3076
- this.pageDots.setDots();
3077
- };
3078
-
3079
- proto$5.deactivatePageDots = function () {
3080
- this.pageDots.deactivate();
3081
- };
3082
-
3083
- // ----- ----- //
3084
-
3085
- Flickity.PageDots = PageDots;
3086
-
3087
- // -------------------------- Player -------------------------- //
3088
-
3089
- function Player(parent) {
3090
- this.parent = parent;
3091
- this.state = 'stopped';
3092
- // visibility change event handler
3093
- this.onVisibilityChange = this.visibilityChange.bind(this);
3094
- this.onVisibilityPlay = this.visibilityPlay.bind(this);
3095
- }
3096
-
3097
- Player.prototype = Object.create(evEmitter.prototype);
3098
-
3099
- // start play
3100
- Player.prototype.play = function () {
3101
- if (this.state == 'playing') {
3102
- return;
3103
- }
3104
- // do not play if page is hidden, start playing when page is visible
3105
- var isPageHidden = document.hidden;
3106
- if (isPageHidden) {
3107
- document.addEventListener('visibilitychange', this.onVisibilityPlay);
3108
- return;
3109
- }
3110
-
3111
- this.state = 'playing';
3112
- // listen to visibility change
3113
- document.addEventListener('visibilitychange', this.onVisibilityChange);
3114
- // start ticking
3115
- this.tick();
3116
- };
3117
-
3118
- Player.prototype.tick = function () {
3119
- // do not tick if not playing
3120
- if (this.state != 'playing') {
3121
- return;
3122
- }
3123
-
3124
- var time = this.parent.options.autoPlay;
3125
- // default to 3 seconds
3126
- time = typeof time == 'number' ? time : 3000;
3127
- var _this = this;
3128
- // HACK: reset ticks if stopped and started within interval
3129
- this.clear();
3130
- this.timeout = setTimeout(function () {
3131
- _this.parent.next(true);
3132
- _this.tick();
3133
- }, time);
3134
- };
3135
-
3136
- Player.prototype.stop = function () {
3137
- this.state = 'stopped';
3138
- this.clear();
3139
- // remove visibility change event
3140
- document.removeEventListener('visibilitychange', this.onVisibilityChange);
3141
- };
3142
-
3143
- Player.prototype.clear = function () {
3144
- clearTimeout(this.timeout);
3145
- };
3146
-
3147
- Player.prototype.pause = function () {
3148
- if (this.state == 'playing') {
3149
- this.state = 'paused';
3150
- this.clear();
3151
- }
3152
- };
3153
-
3154
- Player.prototype.unpause = function () {
3155
- // re-start play if paused
3156
- if (this.state == 'paused') {
3157
- this.play();
3158
- }
3159
- };
3160
-
3161
- // pause if page visibility is hidden, unpause if visible
3162
- Player.prototype.visibilityChange = function () {
3163
- var isPageHidden = document.hidden;
3164
- this[isPageHidden ? 'pause' : 'unpause']();
3165
- };
3166
-
3167
- Player.prototype.visibilityPlay = function () {
3168
- this.play();
3169
- document.removeEventListener('visibilitychange', this.onVisibilityPlay);
3170
- };
3171
-
3172
- // -------------------------- Flickity -------------------------- //
3173
-
3174
- utils.extend(Flickity.defaults, {
3175
- pauseAutoPlayOnHover: true,
3176
- });
3177
-
3178
- Flickity.createMethods.push('_createPlayer');
3179
- var proto$4 = Flickity.prototype;
3180
-
3181
- proto$4._createPlayer = function () {
3182
- this.player = new Player(this);
3183
-
3184
- this.on('activate', this.activatePlayer);
3185
- this.on('uiChange', this.stopPlayer);
3186
- this.on('pointerDown', this.stopPlayer);
3187
- this.on('deactivate', this.deactivatePlayer);
3188
- };
3189
-
3190
- proto$4.activatePlayer = function () {
3191
- if (!this.options.autoPlay) {
3192
- return;
3193
- }
3194
- this.player.play();
3195
- this.element.addEventListener('mouseenter', this);
3196
- };
3197
-
3198
- // Player API, don't hate the ... thanks I know where the door is
3199
-
3200
- proto$4.playPlayer = function () {
3201
- this.player.play();
3202
- };
3203
-
3204
- proto$4.stopPlayer = function () {
3205
- this.player.stop();
3206
- };
3207
-
3208
- proto$4.pausePlayer = function () {
3209
- this.player.pause();
3210
- };
3211
-
3212
- proto$4.unpausePlayer = function () {
3213
- this.player.unpause();
3214
- };
3215
-
3216
- proto$4.deactivatePlayer = function () {
3217
- this.player.stop();
3218
- this.element.removeEventListener('mouseenter', this);
3219
- };
3220
-
3221
- // ----- mouseenter/leave ----- //
3222
-
3223
- // pause auto-play on hover
3224
- proto$4.onmouseenter = function () {
3225
- if (!this.options.pauseAutoPlayOnHover) {
3226
- return;
3227
- }
3228
- this.player.pause();
3229
- this.element.addEventListener('mouseleave', this);
3230
- };
3231
-
3232
- // resume auto-play on hover off
3233
- proto$4.onmouseleave = function () {
3234
- this.player.unpause();
3235
- this.element.removeEventListener('mouseleave', this);
3236
- };
3237
-
3238
- // ----- ----- //
3239
-
3240
- Flickity.Player = Player;
3241
-
3242
- // append cells to a document fragment
3243
- function getCellsFragment(cells) {
3244
- var fragment = document.createDocumentFragment();
3245
- cells.forEach(function (cell) {
3246
- fragment.appendChild(cell.element);
3247
- });
3248
- return fragment;
3249
- }
3250
-
3251
- // -------------------------- add/remove cell prototype -------------------------- //
3252
-
3253
- var proto$3 = Flickity.prototype;
3254
-
3255
- /**
3256
- * Insert, prepend, or append cells
3257
- * @param {Element, Array, NodeList} elems
3258
- * @param {Integer} index
3259
- */
3260
- proto$3.insert = function (elems, index) {
3261
- var cells = this._makeCells(elems);
3262
- if (!cells || !cells.length) {
3263
- return;
3264
- }
3265
- var len = this.cells.length;
3266
- // default to append
3267
- index = index === undefined ? len : index;
3268
- // add cells with document fragment
3269
- var fragment = getCellsFragment(cells);
3270
- // append to slider
3271
- var isAppend = index == len;
3272
- if (isAppend) {
3273
- this.slider.appendChild(fragment);
3274
- } else {
3275
- var insertCellElement = this.cells[index].element;
3276
- this.slider.insertBefore(fragment, insertCellElement);
3277
- }
3278
- // add to this.cells
3279
- if (index === 0) {
3280
- // prepend, add to start
3281
- this.cells = cells.concat(this.cells);
3282
- } else if (isAppend) {
3283
- // append, add to end
3284
- this.cells = this.cells.concat(cells);
3285
- } else {
3286
- // insert in this.cells
3287
- var endCells = this.cells.splice(index, len - index);
3288
- this.cells = this.cells.concat(cells).concat(endCells);
3289
- }
3290
-
3291
- this._sizeCells(cells);
3292
- this.cellChange(index, true);
3293
- };
3294
-
3295
- proto$3.append = function (elems) {
3296
- this.insert(elems, this.cells.length);
3297
- };
3298
-
3299
- proto$3.prepend = function (elems) {
3300
- this.insert(elems, 0);
3301
- };
3302
-
3303
- /**
3304
- * Remove cells
3305
- * @param {Element, Array, NodeList} elems
3306
- */
3307
- proto$3.remove = function (elems) {
3308
- var cells = this.getCells(elems);
3309
- if (!cells || !cells.length) {
3310
- return;
3311
- }
3312
-
3313
- var minCellIndex = this.cells.length - 1;
3314
- // remove cells from collection & DOM
3315
- cells.forEach(function (cell) {
3316
- cell.remove();
3317
- var index = this.cells.indexOf(cell);
3318
- minCellIndex = Math.min(index, minCellIndex);
3319
- utils.removeFrom(this.cells, cell);
3320
- }, this);
3321
-
3322
- this.cellChange(minCellIndex, true);
3323
- };
3324
-
3325
- /**
3326
- * logic to be run after a cell's size changes
3327
- * @param {Element} elem - cell's element
3328
- */
3329
- proto$3.cellSizeChange = function (elem) {
3330
- var cell = this.getCell(elem);
3331
- if (!cell) {
3332
- return;
3333
- }
3334
- cell.getSize();
3335
-
3336
- var index = this.cells.indexOf(cell);
3337
- this.cellChange(index);
3338
- };
3339
-
3340
- /**
3341
- * logic any time a cell is changed: added, removed, or size changed
3342
- * @param {Integer} changedCellIndex - index of the changed cell, optional
3343
- */
3344
- proto$3.cellChange = function (changedCellIndex, isPositioningSlider) {
3345
- var prevSelectedElem = this.selectedElement;
3346
- this._positionCells(changedCellIndex);
3347
- this._getWrapShiftCells();
3348
- this.setGallerySize();
3349
- // update selectedIndex
3350
- // try to maintain position & select previous selected element
3351
- var cell = this.getCell(prevSelectedElem);
3352
- if (cell) {
3353
- this.selectedIndex = this.getCellSlideIndex(cell);
3354
- }
3355
- this.selectedIndex = Math.min(this.slides.length - 1, this.selectedIndex);
3356
-
3357
- this.emitEvent('cellChange', [changedCellIndex]);
3358
- // position slider
3359
- this.select(this.selectedIndex);
3360
- // do not position slider after lazy load
3361
- if (isPositioningSlider) {
3362
- this.positionSliderAtSelected();
3363
- }
3364
- };
3365
-
3366
- Flickity.createMethods.push('_createLazyload');
3367
- var proto$2 = Flickity.prototype;
3368
-
3369
- proto$2._createLazyload = function () {
3370
- this.on('select', this.lazyLoad);
3371
- };
3372
-
3373
- proto$2.lazyLoad = function () {
3374
- var lazyLoad = this.options.lazyLoad;
3375
- if (!lazyLoad) {
3376
- return;
3377
- }
3378
- // get adjacent cells, use lazyLoad option for adjacent count
3379
- var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0;
3380
- var cellElems = this.getAdjacentCellElements(adjCount);
3381
- // get lazy images in those cells
3382
- var lazyImages = [];
3383
- cellElems.forEach(function (cellElem) {
3384
- var lazyCellImages = getCellLazyImages(cellElem);
3385
- lazyImages = lazyImages.concat(lazyCellImages);
3386
- });
3387
- // load lazy images
3388
- lazyImages.forEach(function (img) {
3389
- new LazyLoader(img, this);
3390
- }, this);
3391
- };
3392
-
3393
- function getCellLazyImages(cellElem) {
3394
- // check if cell element is lazy image
3395
- if (cellElem.nodeName == 'IMG') {
3396
- var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload');
3397
- var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src');
3398
- var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset');
3399
- if (lazyloadAttr || srcAttr || srcsetAttr) {
3400
- return [cellElem];
3401
- }
3402
- }
3403
- // select lazy images in cell
3404
- var lazySelector =
3405
- 'img[data-flickity-lazyload], ' +
3406
- 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]';
3407
- var imgs = cellElem.querySelectorAll(lazySelector);
3408
- return utils.makeArray(imgs);
3409
- }
3410
-
3411
- // -------------------------- LazyLoader -------------------------- //
3412
-
3413
- /**
3414
- * class to handle loading images
3415
- */
3416
- function LazyLoader(img, flickity) {
3417
- this.img = img;
3418
- this.flickity = flickity;
3419
- this.load();
3420
- }
3421
-
3422
- LazyLoader.prototype.handleEvent = utils.handleEvent;
3423
-
3424
- LazyLoader.prototype.load = function () {
3425
- this.img.addEventListener('load', this);
3426
- this.img.addEventListener('error', this);
3427
- // get src & srcset
3428
- var src =
3429
- this.img.getAttribute('data-flickity-lazyload') ||
3430
- this.img.getAttribute('data-flickity-lazyload-src');
3431
- var srcset = this.img.getAttribute('data-flickity-lazyload-srcset');
3432
- // set src & serset
3433
- this.img.src = src;
3434
- if (srcset) {
3435
- this.img.setAttribute('srcset', srcset);
3436
- }
3437
- // remove attr
3438
- this.img.removeAttribute('data-flickity-lazyload');
3439
- this.img.removeAttribute('data-flickity-lazyload-src');
3440
- this.img.removeAttribute('data-flickity-lazyload-srcset');
3441
- };
3442
-
3443
- LazyLoader.prototype.onload = function (event) {
3444
- this.complete(event, 'flickity-lazyloaded');
3445
- };
3446
-
3447
- LazyLoader.prototype.onerror = function (event) {
3448
- this.complete(event, 'flickity-lazyerror');
3449
- };
3450
-
3451
- LazyLoader.prototype.complete = function (event, className) {
3452
- // unbind events
3453
- this.img.removeEventListener('load', this);
3454
- this.img.removeEventListener('error', this);
3455
-
3456
- var cell = this.flickity.getParentCell(this.img);
3457
- var cellElem = cell && cell.element;
3458
- this.flickity.cellSizeChange(cellElem);
3459
-
3460
- this.img.classList.add(className);
3461
- this.flickity.dispatchEvent('lazyLoad', event, cellElem);
3462
- };
3463
-
3464
- // ----- ----- //
3465
-
3466
- Flickity.LazyLoader = LazyLoader;
3467
-
3468
- Flickity.createMethods.push('_createFullscreen');
3469
- var proto$1 = Flickity.prototype;
3470
-
3471
- proto$1._createFullscreen = function () {
3472
- this.isFullscreen = false;
3473
-
3474
- if (!this.options.fullscreen) {
3475
- return;
3476
- }
3477
- // buttons
3478
- this.viewFullscreenButton = new FullscreenButton('view', this);
3479
- this.exitFullscreenButton = new FullscreenButton('exit', this);
3480
-
3481
- this.on('activate', this._changeFullscreenActive);
3482
- this.on('deactivate', this._changeFullscreenActive);
3483
- };
3484
-
3485
- // ----- activation ----- //
3486
-
3487
- proto$1._changeFullscreenActive = function () {
3488
- var childMethod = this.isActive ? 'appendChild' : 'removeChild';
3489
- this.element[childMethod](this.viewFullscreenButton.element);
3490
- this.element[childMethod](this.exitFullscreenButton.element);
3491
- // activate or deactivate buttons
3492
- var activeMethod = this.isActive ? 'activate' : 'deactivate';
3493
- this.viewFullscreenButton[activeMethod]();
3494
- this.exitFullscreenButton[activeMethod]();
3495
- };
3496
-
3497
- // ----- view, exit, toggle ----- //
3498
-
3499
- proto$1.viewFullscreen = function () {
3500
- this._changeFullscreen(true);
3501
- this.focus();
3502
- };
3503
-
3504
- proto$1.exitFullscreen = function () {
3505
- this._changeFullscreen(false);
3506
- };
3507
-
3508
- proto$1._changeFullscreen = function (isView) {
3509
- if (this.isFullscreen == isView) {
3510
- return;
3511
- }
3512
- this.isFullscreen = isView;
3513
- var classMethod = isView ? 'add' : 'remove';
3514
- document.documentElement.classList[classMethod]('is-flickity-fullscreen');
3515
- this.element.classList[classMethod]('is-fullscreen');
3516
- this.resize();
3517
- // HACK extra reposition on fullscreen for images
3518
- if (this.isFullscreen) {
3519
- this.reposition();
3520
- }
3521
- this.dispatchEvent('fullscreenChange', null, [isView]);
3522
- };
3523
-
3524
- proto$1.toggleFullscreen = function () {
3525
- this._changeFullscreen(!this.isFullscreen);
3526
- };
3527
-
3528
- // ----- setGallerySize ----- //
3529
-
3530
- // overwrite so fullscreen cells are full height
3531
- var setGallerySize = proto$1.setGallerySize;
3532
- proto$1.setGallerySize = function () {
3533
- if (!this.options.setGallerySize) {
3534
- return;
3535
- }
3536
- if (this.isFullscreen) {
3537
- // remove height style on fullscreen
3538
- this.viewport.style.height = '';
3539
- } else {
3540
- // otherwise, do normal
3541
- setGallerySize.call(this);
3542
- }
3543
- };
3544
-
3545
- // ----- keyboard ----- //
3546
-
3547
- // ESC key closes full screen
3548
- Flickity.keyboardHandlers[27] = function () {
3549
- this.exitFullscreen();
3550
- };
3551
-
3552
- // ----- FullscreenButton ----- //
3553
-
3554
- function FullscreenButton(name, flickity) {
3555
- this.name = name;
3556
- this.createButton();
3557
- this.createIcon();
3558
- // events
3559
- // trigger viewFullscreen or exitFullscreen on click
3560
- this.onClick = function () {
3561
- flickity[name + 'Fullscreen']();
3562
- };
3563
- this.clickHandler = this.onClick.bind(this);
3564
- }
3565
-
3566
- FullscreenButton.prototype.createButton = function () {
3567
- var element = (this.element = document.createElement('button'));
3568
- element.className =
3569
- 'flickity-button flickity-fullscreen-button ' +
3570
- 'flickity-fullscreen-button-' +
3571
- this.name;
3572
- // prevent button from submitting form
3573
- element.setAttribute('type', 'button');
3574
- // set label
3575
- var label = capitalize(this.name + ' full-screen');
3576
- element.setAttribute('aria-label', label);
3577
- element.title = label;
3578
- };
3579
-
3580
- function capitalize(text) {
3581
- return text[0].toUpperCase() + text.slice(1);
3582
- }
3583
-
3584
- var svgURI = 'http://www.w3.org/2000/svg';
3585
-
3586
- var pathDirections = {
3587
- view: 'M15,20,7,28h5v4H0V20H4v5l8-8Zm5-5,8-8v5h4V0H20V4h5l-8,8Z',
3588
- exit: 'M32,3l-7,7h5v4H18V2h4V7l7-7ZM3,32l7-7v5h4V18H2v4H7L0,29Z',
3589
- };
3590
-
3591
- FullscreenButton.prototype.createIcon = function () {
3592
- var svg = document.createElementNS(svgURI, 'svg');
3593
- svg.setAttribute('class', 'flickity-button-icon');
3594
- svg.setAttribute('viewBox', '0 0 32 32');
3595
- // path & direction
3596
- var path = document.createElementNS(svgURI, 'path');
3597
- var direction = pathDirections[this.name];
3598
- path.setAttribute('d', direction);
3599
- // put it together
3600
- svg.appendChild(path);
3601
- this.element.appendChild(svg);
3602
- };
3603
-
3604
- FullscreenButton.prototype.activate = function () {
3605
- this.element.addEventListener('click', this.clickHandler);
3606
- };
3607
-
3608
- FullscreenButton.prototype.deactivate = function () {
3609
- this.element.removeEventListener('click', this.clickHandler);
3610
- };
3611
-
3612
- Flickity.FullscreenButton = FullscreenButton;
3613
-
3614
- var Slide = Flickity.Slide;
3615
-
3616
- var slideUpdateTarget = Slide.prototype.updateTarget;
3617
- Slide.prototype.updateTarget = function () {
3618
- slideUpdateTarget.apply(this, arguments);
3619
- if (!this.parent.options.fade) {
3620
- return;
3621
- }
3622
- // position cells at selected target
3623
- var slideTargetX = this.target - this.x;
3624
- var firstCellX = this.cells[0].x;
3625
- this.cells.forEach(function (cell) {
3626
- var targetX = cell.x - firstCellX - slideTargetX;
3627
- cell.renderPosition(targetX);
3628
- });
3629
- };
3630
-
3631
- Slide.prototype.setOpacity = function (alpha) {
3632
- this.cells.forEach(function (cell) {
3633
- cell.element.style.opacity = alpha;
3634
- });
3635
- };
3636
-
3637
- // ---- Flickity ---- //
3638
-
3639
- var proto = Flickity.prototype;
3640
-
3641
- Flickity.createMethods.push('_createFade');
3642
-
3643
- proto._createFade = function () {
3644
- this.fadeIndex = this.selectedIndex;
3645
- this.prevSelectedIndex = this.selectedIndex;
3646
- this.on('select', this.onSelectFade);
3647
- this.on('dragEnd', this.onDragEndFade);
3648
- this.on('settle', this.onSettleFade);
3649
- this.on('activate', this.onActivateFade);
3650
- this.on('deactivate', this.onDeactivateFade);
3651
- };
3652
-
3653
- var updateSlides = proto.updateSlides;
3654
- proto.updateSlides = function () {
3655
- updateSlides.apply(this, arguments);
3656
- if (!this.options.fade) {
3657
- return;
3658
- }
3659
- // set initial opacity
3660
- this.slides.forEach(function (slide, i) {
3661
- var alpha = i == this.selectedIndex ? 1 : 0;
3662
- slide.setOpacity(alpha);
3663
- }, this);
3664
- };
3665
-
3666
- /* ---- events ---- */
3667
-
3668
- proto.onSelectFade = function () {
3669
- // in case of resize, keep fadeIndex within current count
3670
- this.fadeIndex = Math.min(this.prevSelectedIndex, this.slides.length - 1);
3671
- this.prevSelectedIndex = this.selectedIndex;
3672
- };
3673
-
3674
- proto.onSettleFade = function () {
3675
- delete this.didDragEnd;
3676
- if (!this.options.fade) {
3677
- return;
3678
- }
3679
- // set full and 0 opacity on selected & faded slides
3680
- this.selectedSlide.setOpacity(1);
3681
- var fadedSlide = this.slides[this.fadeIndex];
3682
- if (fadedSlide && this.fadeIndex != this.selectedIndex) {
3683
- this.slides[this.fadeIndex].setOpacity(0);
3684
- }
3685
- };
3686
-
3687
- proto.onDragEndFade = function () {
3688
- // set flag
3689
- this.didDragEnd = true;
3690
- };
3691
-
3692
- proto.onActivateFade = function () {
3693
- if (this.options.fade) {
3694
- this.element.classList.add('is-fade');
3695
- }
3696
- };
3697
-
3698
- proto.onDeactivateFade = function () {
3699
- if (!this.options.fade) {
3700
- return;
3701
- }
3702
- this.element.classList.remove('is-fade');
3703
- // reset opacity
3704
- this.slides.forEach(function (slide) {
3705
- slide.setOpacity('');
3706
- });
3707
- };
3708
-
3709
- /* ---- position & fading ---- */
3710
-
3711
- var positionSlider = proto.positionSlider;
3712
- proto.positionSlider = function () {
3713
- if (!this.options.fade) {
3714
- positionSlider.apply(this, arguments);
3715
- return;
3716
- }
3717
-
3718
- this.fadeSlides();
3719
- this.dispatchScrollEvent();
3720
- };
3721
-
3722
- var positionSliderAtSelected = proto.positionSliderAtSelected;
3723
- proto.positionSliderAtSelected = function () {
3724
- if (this.options.fade) {
3725
- // position fade slider at origin
3726
- this.setTranslateX(0);
3727
- }
3728
- positionSliderAtSelected.apply(this, arguments);
3729
- };
3730
-
3731
- proto.fadeSlides = function () {
3732
- if (this.slides.length < 2) {
3733
- return;
3734
- }
3735
- // get slides to fade-in & fade-out
3736
- var indexes = this.getFadeIndexes();
3737
- var fadeSlideA = this.slides[indexes.a];
3738
- var fadeSlideB = this.slides[indexes.b];
3739
- var distance = this.wrapDifference(fadeSlideA.target, fadeSlideB.target);
3740
- var progress = this.wrapDifference(fadeSlideA.target, -this.x);
3741
- progress = progress / distance;
3742
-
3743
- fadeSlideA.setOpacity(1 - progress);
3744
- fadeSlideB.setOpacity(progress);
3745
-
3746
- // hide previous slide
3747
- var fadeHideIndex = indexes.a;
3748
- if (this.isDragging) {
3749
- fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b;
3750
- }
3751
- var isNewHideIndex =
3752
- this.fadeHideIndex != undefined &&
3753
- this.fadeHideIndex != fadeHideIndex &&
3754
- this.fadeHideIndex != indexes.a &&
3755
- this.fadeHideIndex != indexes.b;
3756
- if (isNewHideIndex) {
3757
- // new fadeHideSlide set, hide previous
3758
- this.slides[this.fadeHideIndex].setOpacity(0);
3759
- }
3760
- this.fadeHideIndex = fadeHideIndex;
3761
- };
3762
-
3763
- proto.getFadeIndexes = function () {
3764
- if (!this.isDragging && !this.didDragEnd) {
3765
- return {
3766
- a: this.fadeIndex,
3767
- b: this.selectedIndex,
3768
- };
3769
- }
3770
- if (this.options.wrapAround) {
3771
- return this.getFadeDragWrapIndexes();
3772
- } else {
3773
- return this.getFadeDragLimitIndexes();
3774
- }
3775
- };
3776
-
3777
- proto.getFadeDragWrapIndexes = function () {
3778
- var distances = this.slides.map(function (slide, i) {
3779
- return this.getSlideDistance(-this.x, i);
3780
- }, this);
3781
- var absDistances = distances.map(function (distance) {
3782
- return Math.abs(distance);
3783
- });
3784
- var minDistance = Math.min.apply(Math, absDistances);
3785
- var closestIndex = absDistances.indexOf(minDistance);
3786
- var distance = distances[closestIndex];
3787
- var len = this.slides.length;
3788
-
3789
- var delta = distance >= 0 ? 1 : -1;
3790
- return {
3791
- a: closestIndex,
3792
- b: utils.modulo(closestIndex + delta, len),
3793
- };
3794
- };
3795
-
3796
- proto.getFadeDragLimitIndexes = function () {
3797
- // calculate closest previous slide
3798
- var dragIndex = 0;
3799
- for (var i = 0; i < this.slides.length - 1; i++) {
3800
- var slide = this.slides[i];
3801
- if (-this.x < slide.target) {
3802
- break;
3803
- }
3804
- dragIndex = i;
3805
- }
3806
- return {
3807
- a: dragIndex,
3808
- b: dragIndex + 1,
3809
- };
3810
- };
3811
-
3812
- proto.wrapDifference = function (a, b) {
3813
- var diff = b - a;
3814
-
3815
- if (!this.options.wrapAround) {
3816
- return diff;
3817
- }
3818
-
3819
- var diffPlus = diff + this.slideableWidth;
3820
- var diffMinus = diff - this.slideableWidth;
3821
- if (Math.abs(diffPlus) < Math.abs(diff)) {
3822
- diff = diffPlus;
3823
- }
3824
- if (Math.abs(diffMinus) < Math.abs(diff)) {
3825
- diff = diffMinus;
3826
- }
3827
- return diff;
3828
- };
3829
-
3830
- // ---- wrapAround ---- //
3831
-
3832
- var _getWrapShiftCells = proto._getWrapShiftCells;
3833
- proto._getWrapShiftCells = function () {
3834
- if (!this.options.fade) {
3835
- _getWrapShiftCells.apply(this, arguments);
3836
- }
3837
- };
3838
-
3839
- var shiftWrapCells = proto.shiftWrapCells;
3840
- proto.shiftWrapCells = function () {
3841
- if (!this.options.fade) {
3842
- shiftWrapCells.apply(this, arguments);
3843
- }
3844
- };
3845
-
3846
- const flickity = Flickity;
3847
-
3848
- const slidesCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-width:100vw}:host([ready]){opacity:1}.slideshow{max-height:100%;min-height:inherit;height:inherit;position:relative}.slideshow.not-ready{width:100%;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}.not-ready .flickity-container{width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}.flickity-container.slides-ready{min-height:inherit;max-height:inherit;height:inherit;width:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:none;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.flickity-button-icon{fill:var(--navbtns-icon-color)}.flickity-button:disabled .flickity-button-icon{fill:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;inline-size:44px;block-size:44px;border-radius:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;inset-block-end:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;inline-size:10px;block-size:10px;margin-block:0;margin-inline:8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}.flickity-page-dots .dot.is-selected{opacity:1;background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:rgba(0, 0, 0, 0.9);-webkit-padding-after:35px;padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}";
3849
-
3850
- const modulo = (num, div) => {
3851
- return ((num % div) + div) % div;
3852
- };
3853
- const Slides = class {
3854
- constructor(hostRef) {
3855
- registerInstance(this, hostRef);
3856
- this.nanoSlidesDidLoad = createEvent(this, "nanoSlidesDidLoad", 7);
3857
- this.nanoSlidesReady = createEvent(this, "nanoSlidesReady", 7);
3858
- this.nanoSlidesSelect = createEvent(this, "nanoSlidesSelect", 7);
3859
- this.nanoSlidesChange = createEvent(this, "nanoSlidesChange", 7);
3860
- this.nanoSlidesScroll = createEvent(this, "nanoSlidesScroll", 7);
3861
- this.nanoSlidesTransitionEnd = createEvent(this, "nanoSlidesTransitionEnd", 7);
3862
- this.nanoSlidesDragStart = createEvent(this, "nanoSlidesDragStart", 7);
3863
- this.nanoSlidesDragMove = createEvent(this, "nanoSlidesDragMove", 7);
3864
- this.nanoSlidesDragEnd = createEvent(this, "nanoSlidesDragEnd", 7);
3865
- this.nanoSlidesTap = createEvent(this, "nanoSlidesTap", 7);
3866
- this.nanoSlidesFullscreenChange = createEvent(this, "nanoSlidesFullscreenChange", 7);
3867
- this.flickityReady = false;
3868
- this.flickity = new Promise((resolve) => {
3869
- this.readyflickity = resolve;
3870
- });
3871
- this.parallax = async () => {
3872
- const flkty = await this.flickity;
3873
- const cells = flkty.cells;
3874
- cells.forEach((cell) => {
3875
- const ele = cell.element.children[0];
3876
- let flkX = flkty.x;
3877
- if (flkty.options.wrapAround && flkty.cells.length > 1) {
3878
- flkX = modulo(flkX, flkty.slideableWidth);
3879
- flkX = flkX - flkty.slideableWidth;
3880
- }
3881
- let x = ((cell.target + flkX) * -1) / 3;
3882
- if (cell.shift < 0) {
3883
- x = ((cell.target - flkty.slideableWidth + flkX) * -1) / 3;
3884
- }
3885
- else if (cell.shift > 0) {
3886
- x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
3887
- }
3888
- ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
3889
- const animAmount = ((x * 3) / cell.size.width) * 100;
3890
- cell.element.style.setProperty('--animation-amount', animAmount.toString());
3891
- });
3892
- };
3893
- this.handleFullscreen = (isFullScreen) => {
3894
- this.fullscreen = isFullScreen;
3895
- this.nanoSlidesFullscreenChange.emit(isFullScreen);
3896
- };
3897
- this.handleSlideSelect = (slide) => {
3898
- this.iCurrentSlide = slide;
3899
- this.nanoSlidesSelect.emit(slide);
3900
- };
3901
- this.iCurrentSlide = undefined;
3902
- this.slidesReady = undefined;
3903
- this.didInit = false;
3904
- this.options = {};
3905
- this.navbtns = false;
3906
- this.pager = false;
3907
- this.fullscreenbtn = false;
3908
- this.fullscreen = false;
3909
- this.animation = 'scroll';
3910
- this.currentSlide = 0;
3911
- this.autoplay = false;
3912
- this.ready = false;
3913
- }
3914
- async optionsChanged() {
3915
- if (this.flickityReady) {
3916
- const flickity = await this.getflickity();
3917
- Object.assign(flickity.options, this.options);
3918
- await this.update();
3919
- }
3920
- }
3921
- async navbtnsChanged() {
3922
- Array.from(this._getRoot().querySelectorAll('.flickity-prev-next-button')).forEach((btn) => {
3923
- btn.hidden = !this.navbtns;
3924
- });
3925
- }
3926
- async pagerChanged() {
3927
- const dots = this._getRoot().querySelector('.flickity-page-dots');
3928
- dots.hidden = !this.pager;
3929
- }
3930
- async fullscreenBtnChanged() {
3931
- const btn = this._getRoot().querySelector('.flickity-fullscreen-button');
3932
- btn.hidden = !this.fullscreenbtn;
3933
- }
3934
- async fullscreenChanged(_, oldFs) {
3935
- const flickity = await this.getflickity();
3936
- if (this.fullscreen)
3937
- flickity.viewFullscreen();
3938
- else if (typeof oldFs !== 'undefined')
3939
- flickity.exitFullscreen();
3940
- }
3941
- async animationChange(_, oldAnim) {
3942
- const [flkty, slides] = await Promise.all([
3943
- this.getflickity(),
3944
- waitForSlides(this.host),
3945
- ]);
3946
- // clear old stuff
3947
- slides.forEach((slide) => {
3948
- slide.style['left'] = undefined;
3949
- });
3950
- if (oldAnim === 'parallax') {
3951
- flkty.off('scroll', this.parallax);
3952
- slides.forEach((_, i) => {
3953
- if (this.childrenEles && this.childrenEles[i])
3954
- this.childrenEles[i].style['transform'] = undefined;
3955
- });
3956
- this.update();
3957
- }
3958
- // was a custom animation
3959
- if (typeof oldAnim === 'function') {
3960
- flkty.off('scroll', oldAnim);
3961
- }
3962
- // is a custom animation
3963
- if (typeof this.animation === 'function') {
3964
- this.options = { fade: false, percentPosition: true };
3965
- flkty.on('scroll', this.animation);
3966
- return;
3967
- }
3968
- // setup new stuff
3969
- switch (this.animation) {
3970
- case 'fade':
3971
- this.options = { fade: true, percentPosition: true };
3972
- break;
3973
- case 'parallax':
3974
- this.options = { fade: false, percentPosition: true };
3975
- flkty.on('scroll', this.parallax);
3976
- break;
3977
- default:
3978
- this.options = { fade: false, percentPosition: true };
3979
- break;
3980
- }
3981
- }
3982
- currentSlideChange() {
3983
- if (this.currentSlide !== this.iCurrentSlide)
3984
- this.slideTo(this.currentSlide);
3985
- }
3986
- internalSlideChange() {
3987
- this.currentSlide = this.iCurrentSlide;
3988
- }
3989
- async autoPlayChange() {
3990
- await this.stopAutoplay();
3991
- if (this.autoplay) {
3992
- if (typeof this.autoplay === 'string')
3993
- this.autoplay = parseInt(this.autoplay);
3994
- if (this.autoplay > 0)
3995
- this.startAutoplay(this.autoplay);
3996
- }
3997
- }
3998
- /**
3999
- * Update the underlying flickity implementation. Call this if you've added or removed
4000
- * child slides.
4001
- */
4002
- async update() {
4003
- const [flickity] = await Promise.all([
4004
- this.getflickity(),
4005
- waitForSlides(this.host),
4006
- ]);
4007
- this.childrenEles = this.host.querySelectorAll('nano-slide > *');
4008
- flickity.reloadCells();
4009
- flickity.resize();
4010
- flickity.reposition();
4011
- }
4012
- /**
4013
- * Force flickity to update its height (when adaptiveHeight is enabled) for the duration
4014
- * equal to 'speed' parameter.
4015
- *
4016
- * @param speed The transition duration (in ms).
4017
- */
4018
- async updateAutoHeight(speed) {
4019
- const vp = document.querySelector('.flickity-viewport');
4020
- if (vp)
4021
- vp.style.transition = speed + 'ms';
4022
- }
4023
- /**
4024
- * Transition to the specified slide.
4025
- *
4026
- * @param index The index of the slide to transition to.
4027
- * @param instant Immediately view the selected slide without animation.
4028
- */
4029
- async slideTo(index, instant) {
4030
- const flickity = await this.getflickity();
4031
- flickity.select(index, instant);
4032
- }
4033
- /**
4034
- * Transition to the next slide.
4035
- *
4036
- * @param instant The transition duration (in ms).
4037
- * @param wrap If true, the first slide will be selected if at the last slide.
4038
- */
4039
- async slideNext(instant, wrap) {
4040
- const flickity = await this.getflickity();
4041
- flickity.next(wrap, instant);
4042
- }
4043
- /**
4044
- * Transition to the previous slide.
4045
- *
4046
- * @param instant The transition duration (in ms).
4047
- * @param wrap If true, the last slide will be selected if at the first slide.
4048
- */
4049
- async slidePrev(instant, wrap) {
4050
- const flickity = await this.getflickity();
4051
- flickity.previous(instant, wrap);
4052
- }
4053
- /** Get the index of the active slide. */
4054
- async getActiveIndex() {
4055
- const flickity = await this.getflickity();
4056
- return flickity.selectedIndex;
4057
- }
4058
- /** Get the total number of slides. */
4059
- async length() {
4060
- const flickity = await this.getflickity();
4061
- return flickity.slides.length;
4062
- }
4063
- /** Get whether or not the current slide is the last slide. */
4064
- async isEnd() {
4065
- const flickity = await this.getflickity();
4066
- return flickity.selectedIndex === flickity.slides.length - 1;
4067
- }
4068
- /** Get whether or not the current slide is the first slide. */
4069
- async isBeginning() {
4070
- const flickity = await this.getflickity();
4071
- return flickity.selectedIndex === 0;
4072
- }
4073
- /**
4074
- * Start auto play.
4075
- * @param time - optional time duration to show slides
4076
- */
4077
- async startAutoplay(time) {
4078
- const flickity = await this.getflickity();
4079
- if (time)
4080
- this.options = { autoPlay: time };
4081
- setTimeout(() => flickity.playPlayer());
4082
- }
4083
- /** Stop auto play. */
4084
- async stopAutoplay() {
4085
- const flickity = await this.getflickity();
4086
- flickity.stopPlayer();
4087
- }
4088
- /**
4089
- * Lock or unlock the ability to slide to the next slide.
4090
- *
4091
- * @param lock If `true`, disable swiping
4092
- */
4093
- async lockSwipes(lock) {
4094
- const flickity = await this.getflickity();
4095
- flickity.options.draggable = !lock;
4096
- flickity.updateDraggable();
4097
- }
4098
- /**
4099
- * Get the flickity instance.
4100
- * Use this to access the full flickity API.
4101
- * See https://flickity.metafizzy.co/ for all API options.
4102
- */
4103
- async getflickity() {
4104
- return this.flickity;
4105
- }
4106
- /**
4107
- * Hard destroy / create.
4108
- * Certain flickity options, you will require the instance to be re-initialised
4109
- */
4110
- async reload() {
4111
- this.destroyflickity();
4112
- setTimeout(() => this.initflickity(), 20);
4113
- }
4114
- _getRoot() {
4115
- return this.host.shadowRoot ? this.host.shadowRoot : this.host;
4116
- }
4117
- destroyflickity() {
4118
- /**
4119
- * We need to synchronously destroy
4120
- * flickity otherwise it is possible
4121
- * that it will be left in a
4122
- * destroyed state if connectedCallback
4123
- * is called multiple times
4124
- */
4125
- const flickity = this.syncflickity;
4126
- if (flickity !== undefined) {
4127
- flickity.destroy();
4128
- this.flickity = new Promise((resolve) => {
4129
- this.readyflickity = resolve;
4130
- });
4131
- this.flickityReady = false;
4132
- this.syncflickity = undefined;
4133
- this.ready = false;
4134
- }
4135
- this.didInit = false;
4136
- }
4137
- async initflickity() {
4138
- const finalOptions = this.normalizeOptions();
4139
- // init flickity core
4140
- await waitForSlides(this.host);
4141
- this.flickityEl =
4142
- this.flickityEl || this._getRoot().querySelector('.flickity-container');
4143
- if (!this.flickityEl)
4144
- return;
4145
- this.slidesReady = true;
4146
- if (this.flickityEl.classList.contains('flickity-enabled')) {
4147
- this.destroyflickity();
4148
- }
4149
- this.flickityEl.style.height =
4150
- this.flickityEl.getBoundingClientRect().height + 'px';
4151
- setTimeout(() => {
4152
- this.flickityEl.style.height = '';
4153
- const flick = new flickity(this.flickityEl, finalOptions);
4154
- this.flickityReady = true;
4155
- this.syncflickity = flick;
4156
- this.animationChange();
4157
- this.navbtnsChanged();
4158
- this.pagerChanged();
4159
- this.fullscreenChanged();
4160
- this.fullscreenBtnChanged();
4161
- this.readyflickity(flick);
4162
- this.ready = true;
4163
- if (!window['ResizeObserver'])
4164
- return;
4165
- // just boots and braces to make sure it's the correct size oninit
4166
- const ro = (this.resizeO = new ResizeObserver(() => {
4167
- flick.resize();
4168
- // this.resizeO.disconnect();
4169
- }));
4170
- ro.observe(this.host);
4171
- }, 100);
4172
- }
4173
- normalizeOptions() {
4174
- // Base options, can be changed
4175
- const flickityOptions = {
4176
- cellSelector: 'nano-slide',
4177
- contain: true,
4178
- prevNextButtons: true,
4179
- fullscreen: true,
4180
- accessibility: true,
4181
- imagesLoaded: true,
4182
- pageDots: true,
4183
- };
4184
- if (this.animation === 'fade') {
4185
- flickityOptions.fade = true;
4186
- }
4187
- if (this.currentSlide > 0) {
4188
- flickityOptions.initialIndex = this.currentSlide;
4189
- }
4190
- if (this.autoplay) {
4191
- if (typeof this.autoplay === 'string')
4192
- this.autoplay = parseInt(this.autoplay);
4193
- if (this.autoplay > 0)
4194
- flickityOptions.autoPlay = this.autoplay;
4195
- }
4196
- // Keep the event options separate, we dont want users
4197
- // overwriting these
4198
- const eventOptions = {
4199
- ready: () => {
4200
- setTimeout(() => {
4201
- this.nanoSlidesReady.emit();
4202
- }, 20);
4203
- },
4204
- select: this.handleSlideSelect,
4205
- change: this.nanoSlidesChange.emit,
4206
- scroll: this.nanoSlidesScroll.emit,
4207
- settle: this.nanoSlidesTransitionEnd.emit,
4208
- dragStart: this.nanoSlidesDragStart.emit,
4209
- dragMove: this.nanoSlidesDragMove.emit,
4210
- dragEnd: this.nanoSlidesDragEnd.emit,
4211
- staticClick: this.nanoSlidesTap.emit,
4212
- fullscreenChange: this.handleFullscreen,
4213
- };
4214
- const customEvents = !!this.options && !!this.options.on ? this.options.on : {};
4215
- // merge "on" event listeners, while giving our event listeners priority
4216
- const mergedEventOptions = { on: Object.assign(Object.assign({}, customEvents), eventOptions) };
4217
- // Merge the base, user options, and events together then pass to flickity
4218
- // @ts-ignore
4219
- return Object.assign(Object.assign(Object.assign({}, flickityOptions), mergedEventOptions), this.options);
4220
- }
4221
- componentDidLoad() {
4222
- if (typeof window !== 'undefined' &&
4223
- window.MutationObserver) {
4224
- const mut = (this.mutationO = new MutationObserver((e) => {
4225
- if (e[0].addedNodes[0] &&
4226
- e[0].addedNodes[0].nodeName.toLowerCase() === 'nano-slide' &&
4227
- this.flickityReady) {
4228
- this.update();
4229
- }
4230
- }));
4231
- mut.observe(this.host, {
4232
- childList: true,
4233
- subtree: true,
4234
- });
4235
- }
4236
- }
4237
- componentWillLoad() {
4238
- this.nanoSlidesDidLoad.emit();
4239
- if (!this.didInit) {
4240
- this.didInit = true;
4241
- this.initflickity();
4242
- }
4243
- }
4244
- disconnectedCallback() {
4245
- if (this.mutationO) {
4246
- this.mutationO.disconnect();
4247
- this.mutationO = undefined;
4248
- }
4249
- if (this.resizeO)
4250
- this.resizeO.disconnect();
4251
- this.destroyflickity();
4252
- }
4253
- render() {
4254
- return (h(Host, null, h("div", { class: {
4255
- slideshow: true,
4256
- ready: this.ready,
4257
- 'not-ready': !this.ready,
4258
- }, part: "base" }, h("div", { ref: (div) => (this.flickityEl = div), class: {
4259
- 'flickity-container': true,
4260
- 'slides-ready': this.slidesReady,
4261
- 'slides-not-ready': !this.slidesReady,
4262
- }, part: "slide-container" }, h("slot", null)), h("div", { class: "ui-extras" }, h("slot", { name: "ui" })))));
4263
- }
4264
- get host() { return getElement(this); }
4265
- static get watchers() { return {
4266
- "options": ["optionsChanged"],
4267
- "navbtns": ["navbtnsChanged"],
4268
- "pager": ["pagerChanged"],
4269
- "fullscreenbtn": ["fullscreenBtnChanged"],
4270
- "fullscreen": ["fullscreenChanged"],
4271
- "animation": ["animationChange"],
4272
- "currentSlide": ["currentSlideChange"],
4273
- "iCurrentSlide": ["internalSlideChange"],
4274
- "autoplay": ["autoPlayChange"]
4275
- }; }
4276
- };
4277
- const waitForSlides = (host) => {
4278
- const allSlides = Array.from(host.querySelectorAll('nano-slide'));
4279
- let toLoadSlides = allSlides.filter((ele) => !ele.ready);
4280
- if (!toLoadSlides.length)
4281
- return Promise.resolve(allSlides);
4282
- return new Promise((resolve) => {
4283
- const slideResolver = (ev) => {
4284
- toLoadSlides = toLoadSlides.filter((ele) => ele !== ev.target);
4285
- if (!toLoadSlides.length) {
4286
- resolve(allSlides);
4287
- host.removeEventListener('nanoSlideReady', slideResolver);
4288
- host.removeEventListener('nano-slide-ready', slideResolver);
4289
- }
4290
- };
4291
- host.addEventListener('nanoSlideReady', slideResolver);
4292
- // fallback for vue who can't handle camelcase event names
4293
- host.addEventListener('nano-slide-ready', slideResolver);
4294
- });
4295
- };
4296
- Slides.style = slidesCss;
4297
-
4298
- export { Slides as nano_slides };
4
+ export { S as nano_slides } from './nano-slides-9908c44d.js';
5
+ import './index-9695db0a.js';
4299
6
 
4300
7
  //# sourceMappingURL=nano-slides.entry.js.map