luda 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +5 -0
  4. data/assets/javascripts/luda-degradation.js +131 -0
  5. data/assets/javascripts/luda-degradation.js.map +1 -0
  6. data/assets/javascripts/luda-degradation.min.js +7 -0
  7. data/assets/javascripts/luda-degradation.min.js.map +1 -0
  8. data/assets/javascripts/luda-sprockets.js +11 -0
  9. data/assets/javascripts/luda.js +2024 -0
  10. data/assets/javascripts/luda.js.map +1 -0
  11. data/assets/javascripts/luda.min.js +7 -0
  12. data/assets/javascripts/luda.min.js.map +1 -0
  13. data/assets/javascripts/luda/behaviours/enter-click.js +38 -0
  14. data/assets/javascripts/luda/behaviours/focus.js +103 -0
  15. data/assets/javascripts/luda/behaviours/radio-tab.js +69 -0
  16. data/assets/javascripts/luda/behaviours/readonly.js +57 -0
  17. data/assets/javascripts/luda/behaviours/toggle.js +104 -0
  18. data/assets/javascripts/luda/collections/carousel.js +314 -0
  19. data/assets/javascripts/luda/collections/dropdown.js +269 -0
  20. data/assets/javascripts/luda/collections/form-dropdown.js +112 -0
  21. data/assets/javascripts/luda/collections/tab.js +117 -0
  22. data/assets/javascripts/luda/component.js +240 -0
  23. data/assets/javascripts/luda/constants.js +18 -0
  24. data/assets/javascripts/luda/degradation.js +125 -0
  25. data/assets/javascripts/luda/dom.js +81 -0
  26. data/assets/javascripts/luda/elements/form-file.js +104 -0
  27. data/assets/javascripts/luda/elements/form-select.js +212 -0
  28. data/assets/javascripts/luda/event.js +193 -0
  29. data/assets/javascripts/luda/index.js +20 -0
  30. data/assets/javascripts/luda/install.js +75 -0
  31. data/assets/javascripts/luda/singleton.js +77 -0
  32. data/assets/javascripts/luda/utilities.js +16 -0
  33. data/assets/stylesheets/luda/_core/_base.sass +430 -0
  34. data/assets/stylesheets/luda/_core/_functions.sass +240 -0
  35. data/assets/stylesheets/luda/_core/_variables.sass +710 -0
  36. data/assets/stylesheets/luda/_core/behaviours/_disabled.sass +12 -0
  37. data/assets/stylesheets/luda/_core/behaviours/_focus.sass +7 -0
  38. data/assets/stylesheets/luda/_core/behaviours/_readonly.sass +16 -0
  39. data/assets/stylesheets/luda/_core/behaviours/_toggle.sass +4 -0
  40. data/assets/stylesheets/luda/_core/collections/_alert.sass +24 -0
  41. data/assets/stylesheets/luda/_core/collections/_avatar.sass +117 -0
  42. data/assets/stylesheets/luda/_core/collections/_breadcrumb.sass +21 -0
  43. data/assets/stylesheets/luda/_core/collections/_button-group.sass +67 -0
  44. data/assets/stylesheets/luda/_core/collections/_button-icon.sass +46 -0
  45. data/assets/stylesheets/luda/_core/collections/_carousel.sass +132 -0
  46. data/assets/stylesheets/luda/_core/collections/_dropdown.sass +60 -0
  47. data/assets/stylesheets/luda/_core/collections/_form-button.sass +23 -0
  48. data/assets/stylesheets/luda/_core/collections/_form-dropdown.sass +21 -0
  49. data/assets/stylesheets/luda/_core/collections/_form-group.sass +48 -0
  50. data/assets/stylesheets/luda/_core/collections/_form-icon.sass +71 -0
  51. data/assets/stylesheets/luda/_core/collections/_media.sass +55 -0
  52. data/assets/stylesheets/luda/_core/collections/_modal.sass +12 -0
  53. data/assets/stylesheets/luda/_core/collections/_nav.sass +162 -0
  54. data/assets/stylesheets/luda/_core/collections/_tab.sass +18 -0
  55. data/assets/stylesheets/luda/_core/elements/_badge.sass +19 -0
  56. data/assets/stylesheets/luda/_core/elements/_baseline.sass +22 -0
  57. data/assets/stylesheets/luda/_core/elements/_button.sass +136 -0
  58. data/assets/stylesheets/luda/_core/elements/_container.sass +8 -0
  59. data/assets/stylesheets/luda/_core/elements/_grid.sass +55 -0
  60. data/assets/stylesheets/luda/_core/elements/_icon.sass +110 -0
  61. data/assets/stylesheets/luda/_core/elements/_overlay.sass +11 -0
  62. data/assets/stylesheets/luda/_core/elements/_progress.sass +31 -0
  63. data/assets/stylesheets/luda/_core/elements/_scrollbar.sass +21 -0
  64. data/assets/stylesheets/luda/_core/elements/_table.sass +102 -0
  65. data/assets/stylesheets/luda/_core/elements/_turbolinks-progress-bar.sass +5 -0
  66. data/assets/stylesheets/luda/_core/elements/form/_form-check-radio.sass +105 -0
  67. data/assets/stylesheets/luda/_core/elements/form/_form-element.sass +83 -0
  68. data/assets/stylesheets/luda/_core/elements/form/_form-helper.sass +66 -0
  69. data/assets/stylesheets/luda/_core/elements/form/_form-label.sass +20 -0
  70. data/assets/stylesheets/luda/_core/elements/form/_form-range.sass +92 -0
  71. data/assets/stylesheets/luda/_core/elements/form/_form-row.sass +214 -0
  72. data/assets/stylesheets/luda/_core/elements/typography/_code.sass +27 -0
  73. data/assets/stylesheets/luda/_core/elements/typography/_link.sass +15 -0
  74. data/assets/stylesheets/luda/_core/elements/typography/_list.sass +14 -0
  75. data/assets/stylesheets/luda/_core/elements/typography/_mark.sass +7 -0
  76. data/assets/stylesheets/luda/_core/elements/typography/_quote.sass +68 -0
  77. data/assets/stylesheets/luda/_core/elements/typography/_sub-sup.sass +16 -0
  78. data/assets/stylesheets/luda/_core/elements/typography/_typography.sass +52 -0
  79. data/assets/stylesheets/luda/_core/mixins/_browser.sass +15 -0
  80. data/assets/stylesheets/luda/_core/mixins/_button.sass +90 -0
  81. data/assets/stylesheets/luda/_core/mixins/_dropdown.sass +40 -0
  82. data/assets/stylesheets/luda/_core/mixins/_focus.sass +3 -0
  83. data/assets/stylesheets/luda/_core/mixins/_form.sass +27 -0
  84. data/assets/stylesheets/luda/_core/mixins/_install.sass +7 -0
  85. data/assets/stylesheets/luda/_core/mixins/_media-query.sass +66 -0
  86. data/assets/stylesheets/luda/_core/mixins/_overlay.sass +14 -0
  87. data/assets/stylesheets/luda/_core/mixins/_sass-lint-fix.sass +3 -0
  88. data/assets/stylesheets/luda/_core/mixins/_typography.sass +40 -0
  89. data/assets/stylesheets/luda/_core/utilities/_align.sass +19 -0
  90. data/assets/stylesheets/luda/_core/utilities/_background.sass +88 -0
  91. data/assets/stylesheets/luda/_core/utilities/_color.sass +36 -0
  92. data/assets/stylesheets/luda/_core/utilities/_display.sass +40 -0
  93. data/assets/stylesheets/luda/_core/utilities/_flex.sass +114 -0
  94. data/assets/stylesheets/luda/_core/utilities/_float.sass +21 -0
  95. data/assets/stylesheets/luda/_core/utilities/_opacity.sass +19 -0
  96. data/assets/stylesheets/luda/_core/utilities/_overflow.sass +18 -0
  97. data/assets/stylesheets/luda/_core/utilities/_position.sass +48 -0
  98. data/assets/stylesheets/luda/_core/utilities/_shape.sass +62 -0
  99. data/assets/stylesheets/luda/_core/utilities/_size.sass +67 -0
  100. data/assets/stylesheets/luda/_core/utilities/_space.sass +227 -0
  101. data/assets/stylesheets/luda/_core/utilities/_text.sass +85 -0
  102. data/assets/stylesheets/luda/_core/utilities/_visibility.sass +11 -0
  103. data/assets/stylesheets/luda/_core/utilities/_z-index.sass +19 -0
  104. data/assets/stylesheets/luda/_default.sass +51 -0
  105. data/assets/stylesheets/luda/core/_base.sass +430 -0
  106. data/assets/stylesheets/luda/core/_functions.sass +240 -0
  107. data/assets/stylesheets/luda/core/_variables.sass +710 -0
  108. data/assets/stylesheets/luda/core/behaviours/_disabled.sass +12 -0
  109. data/assets/stylesheets/luda/core/behaviours/_focus.sass +7 -0
  110. data/assets/stylesheets/luda/core/behaviours/_readonly.sass +16 -0
  111. data/assets/stylesheets/luda/core/behaviours/_toggle.sass +4 -0
  112. data/assets/stylesheets/luda/core/collections/_alert.sass +24 -0
  113. data/assets/stylesheets/luda/core/collections/_avatar.sass +117 -0
  114. data/assets/stylesheets/luda/core/collections/_breadcrumb.sass +21 -0
  115. data/assets/stylesheets/luda/core/collections/_button-group.sass +67 -0
  116. data/assets/stylesheets/luda/core/collections/_button-icon.sass +46 -0
  117. data/assets/stylesheets/luda/core/collections/_carousel.sass +132 -0
  118. data/assets/stylesheets/luda/core/collections/_dropdown.sass +60 -0
  119. data/assets/stylesheets/luda/core/collections/_form-button.sass +23 -0
  120. data/assets/stylesheets/luda/core/collections/_form-dropdown.sass +21 -0
  121. data/assets/stylesheets/luda/core/collections/_form-group.sass +48 -0
  122. data/assets/stylesheets/luda/core/collections/_form-icon.sass +71 -0
  123. data/assets/stylesheets/luda/core/collections/_media.sass +55 -0
  124. data/assets/stylesheets/luda/core/collections/_modal.sass +12 -0
  125. data/assets/stylesheets/luda/core/collections/_nav.sass +162 -0
  126. data/assets/stylesheets/luda/core/collections/_tab.sass +18 -0
  127. data/assets/stylesheets/luda/core/elements/_badge.sass +19 -0
  128. data/assets/stylesheets/luda/core/elements/_baseline.sass +22 -0
  129. data/assets/stylesheets/luda/core/elements/_button.sass +136 -0
  130. data/assets/stylesheets/luda/core/elements/_container.sass +8 -0
  131. data/assets/stylesheets/luda/core/elements/_grid.sass +55 -0
  132. data/assets/stylesheets/luda/core/elements/_icon.sass +110 -0
  133. data/assets/stylesheets/luda/core/elements/_overlay.sass +11 -0
  134. data/assets/stylesheets/luda/core/elements/_progress.sass +31 -0
  135. data/assets/stylesheets/luda/core/elements/_scrollbar.sass +21 -0
  136. data/assets/stylesheets/luda/core/elements/_table.sass +102 -0
  137. data/assets/stylesheets/luda/core/elements/_turbolinks-progress-bar.sass +5 -0
  138. data/assets/stylesheets/luda/core/elements/form/_form-check-radio.sass +105 -0
  139. data/assets/stylesheets/luda/core/elements/form/_form-element.sass +83 -0
  140. data/assets/stylesheets/luda/core/elements/form/_form-helper.sass +66 -0
  141. data/assets/stylesheets/luda/core/elements/form/_form-label.sass +20 -0
  142. data/assets/stylesheets/luda/core/elements/form/_form-range.sass +92 -0
  143. data/assets/stylesheets/luda/core/elements/form/_form-row.sass +214 -0
  144. data/assets/stylesheets/luda/core/elements/typography/_code.sass +27 -0
  145. data/assets/stylesheets/luda/core/elements/typography/_link.sass +15 -0
  146. data/assets/stylesheets/luda/core/elements/typography/_list.sass +14 -0
  147. data/assets/stylesheets/luda/core/elements/typography/_mark.sass +7 -0
  148. data/assets/stylesheets/luda/core/elements/typography/_quote.sass +68 -0
  149. data/assets/stylesheets/luda/core/elements/typography/_sub-sup.sass +16 -0
  150. data/assets/stylesheets/luda/core/elements/typography/_typography.sass +52 -0
  151. data/assets/stylesheets/luda/core/mixins/_browser.sass +15 -0
  152. data/assets/stylesheets/luda/core/mixins/_button.sass +90 -0
  153. data/assets/stylesheets/luda/core/mixins/_dropdown.sass +40 -0
  154. data/assets/stylesheets/luda/core/mixins/_focus.sass +3 -0
  155. data/assets/stylesheets/luda/core/mixins/_form.sass +27 -0
  156. data/assets/stylesheets/luda/core/mixins/_install.sass +7 -0
  157. data/assets/stylesheets/luda/core/mixins/_media-query.sass +66 -0
  158. data/assets/stylesheets/luda/core/mixins/_overlay.sass +14 -0
  159. data/assets/stylesheets/luda/core/mixins/_sass-lint-fix.sass +3 -0
  160. data/assets/stylesheets/luda/core/mixins/_typography.sass +40 -0
  161. data/assets/stylesheets/luda/core/utilities/_align.sass +19 -0
  162. data/assets/stylesheets/luda/core/utilities/_background.sass +88 -0
  163. data/assets/stylesheets/luda/core/utilities/_color.sass +36 -0
  164. data/assets/stylesheets/luda/core/utilities/_display.sass +40 -0
  165. data/assets/stylesheets/luda/core/utilities/_flex.sass +114 -0
  166. data/assets/stylesheets/luda/core/utilities/_float.sass +21 -0
  167. data/assets/stylesheets/luda/core/utilities/_opacity.sass +19 -0
  168. data/assets/stylesheets/luda/core/utilities/_overflow.sass +18 -0
  169. data/assets/stylesheets/luda/core/utilities/_position.sass +48 -0
  170. data/assets/stylesheets/luda/core/utilities/_shape.sass +62 -0
  171. data/assets/stylesheets/luda/core/utilities/_size.sass +67 -0
  172. data/assets/stylesheets/luda/core/utilities/_space.sass +227 -0
  173. data/assets/stylesheets/luda/core/utilities/_text.sass +85 -0
  174. data/assets/stylesheets/luda/core/utilities/_visibility.sass +11 -0
  175. data/assets/stylesheets/luda/core/utilities/_z-index.sass +19 -0
  176. data/assets/stylesheets/luda/default/_banner.sass +7 -0
  177. data/assets/stylesheets/luda/default/_base.sass +6 -0
  178. data/assets/stylesheets/luda/default/_functions.sass +1 -0
  179. data/assets/stylesheets/luda/default/_mixins.sass +10 -0
  180. data/assets/stylesheets/luda/default/_variables.sass +1 -0
  181. data/assets/stylesheets/luda/default/behaviours/_disabled.sass +5 -0
  182. data/assets/stylesheets/luda/default/behaviours/_focus.sass +5 -0
  183. data/assets/stylesheets/luda/default/behaviours/_readonly.sass +5 -0
  184. data/assets/stylesheets/luda/default/behaviours/_toggle.sass +5 -0
  185. data/assets/stylesheets/luda/default/collections/_alert.sass +6 -0
  186. data/assets/stylesheets/luda/default/collections/_avatar.sass +7 -0
  187. data/assets/stylesheets/luda/default/collections/_breadcrumb.sass +6 -0
  188. data/assets/stylesheets/luda/default/collections/_button-group.sass +7 -0
  189. data/assets/stylesheets/luda/default/collections/_button-icon.sass +8 -0
  190. data/assets/stylesheets/luda/default/collections/_carousel.sass +7 -0
  191. data/assets/stylesheets/luda/default/collections/_dropdown.sass +8 -0
  192. data/assets/stylesheets/luda/default/collections/_form-button.sass +9 -0
  193. data/assets/stylesheets/luda/default/collections/_form-dropdown.sass +8 -0
  194. data/assets/stylesheets/luda/default/collections/_form-group.sass +11 -0
  195. data/assets/stylesheets/luda/default/collections/_form-icon.sass +8 -0
  196. data/assets/stylesheets/luda/default/collections/_media.sass +7 -0
  197. data/assets/stylesheets/luda/default/collections/_modal.sass +7 -0
  198. data/assets/stylesheets/luda/default/collections/_nav.sass +10 -0
  199. data/assets/stylesheets/luda/default/collections/_tab.sass +9 -0
  200. data/assets/stylesheets/luda/default/elements/_badge.sass +6 -0
  201. data/assets/stylesheets/luda/default/elements/_baseline.sass +6 -0
  202. data/assets/stylesheets/luda/default/elements/_button.sass +7 -0
  203. data/assets/stylesheets/luda/default/elements/_container.sass +6 -0
  204. data/assets/stylesheets/luda/default/elements/_form.sass +13 -0
  205. data/assets/stylesheets/luda/default/elements/_grid.sass +6 -0
  206. data/assets/stylesheets/luda/default/elements/_icon.sass +6 -0
  207. data/assets/stylesheets/luda/default/elements/_overlay.sass +6 -0
  208. data/assets/stylesheets/luda/default/elements/_progress.sass +6 -0
  209. data/assets/stylesheets/luda/default/elements/_scrollbar.sass +6 -0
  210. data/assets/stylesheets/luda/default/elements/_table.sass +6 -0
  211. data/assets/stylesheets/luda/default/elements/_turbolinks-progress-bar.sass +6 -0
  212. data/assets/stylesheets/luda/default/elements/_typography.sass +12 -0
  213. data/assets/stylesheets/luda/default/elements/form/_form-check-radio.sass +5 -0
  214. data/assets/stylesheets/luda/default/elements/form/_form-element.sass +5 -0
  215. data/assets/stylesheets/luda/default/elements/form/_form-helper.sass +5 -0
  216. data/assets/stylesheets/luda/default/elements/form/_form-label.sass +5 -0
  217. data/assets/stylesheets/luda/default/elements/form/_form-range.sass +5 -0
  218. data/assets/stylesheets/luda/default/elements/form/_form-row.sass +5 -0
  219. data/assets/stylesheets/luda/default/elements/typography/_code.sass +5 -0
  220. data/assets/stylesheets/luda/default/elements/typography/_link.sass +5 -0
  221. data/assets/stylesheets/luda/default/elements/typography/_list.sass +4 -0
  222. data/assets/stylesheets/luda/default/elements/typography/_mark.sass +5 -0
  223. data/assets/stylesheets/luda/default/elements/typography/_quote.sass +5 -0
  224. data/assets/stylesheets/luda/default/elements/typography/_sub-sup.sass +5 -0
  225. data/assets/stylesheets/luda/default/elements/typography/_typography.sass +5 -0
  226. data/assets/stylesheets/luda/default/index.sass +56 -0
  227. data/assets/stylesheets/luda/default/utilities/_align.sass +5 -0
  228. data/assets/stylesheets/luda/default/utilities/_background.sass +5 -0
  229. data/assets/stylesheets/luda/default/utilities/_color.sass +5 -0
  230. data/assets/stylesheets/luda/default/utilities/_display.sass +5 -0
  231. data/assets/stylesheets/luda/default/utilities/_flex.sass +5 -0
  232. data/assets/stylesheets/luda/default/utilities/_float.sass +5 -0
  233. data/assets/stylesheets/luda/default/utilities/_opacity.sass +5 -0
  234. data/assets/stylesheets/luda/default/utilities/_overflow.sass +5 -0
  235. data/assets/stylesheets/luda/default/utilities/_position.sass +5 -0
  236. data/assets/stylesheets/luda/default/utilities/_shape.sass +5 -0
  237. data/assets/stylesheets/luda/default/utilities/_size.sass +5 -0
  238. data/assets/stylesheets/luda/default/utilities/_space.sass +5 -0
  239. data/assets/stylesheets/luda/default/utilities/_text.sass +5 -0
  240. data/assets/stylesheets/luda/default/utilities/_visibility.sass +5 -0
  241. data/assets/stylesheets/luda/default/utilities/_z-index.sass +5 -0
  242. data/lib/luda.rb +72 -0
  243. data/lib/luda/config.rb +3 -0
  244. data/lib/luda/engine.rb +11 -0
  245. data/lib/luda/version.rb +3 -0
  246. metadata +302 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"luda.js","sources":["../../src/coffee/install.coffee","../../src/coffee/constants.coffee","../../src/coffee/dom.coffee","../../src/coffee/event.coffee","../../src/coffee/utilities.coffee","../../src/coffee/singleton.coffee","../../src/coffee/behaviours/enter-click.coffee","../../src/coffee/behaviours/focus.coffee","../../src/coffee/behaviours/radio-tab.coffee","../../src/coffee/component.coffee","../../src/coffee/behaviours/readonly.coffee","../../src/coffee/behaviours/toggle.coffee","../../src/coffee/elements/form-file.coffee","../../src/coffee/elements/form-select.coffee","../../src/coffee/collections/carousel.coffee","../../src/coffee/collections/dropdown.coffee","../../src/coffee/collections/form-dropdown.coffee","../../src/coffee/collections/tab.coffee"],"sourcesContent":["ENV = (->\r\n if typeof document isnt 'undefined'\r\n return window if typeof window isnt 'undefined'\r\n return global if typeof global isnt 'undefined'\r\n throw new Error 'Unsupported runtime environment.'\r\n)()\r\n\r\n\r\n\r\nunless typeof ENV.luda is 'function'\r\n ENV.luda = (installer) ->\r\n throw new Error 'Installer cannot be detected.' unless installer\r\n unless ['object', 'function'].includes typeof installer\r\n throw new Error 'Installer must be object, array or function.'\r\n if installer.hasOwnProperty '_SCOPE'\r\n unless typeof installer._SCOPE is 'string'\r\n throw new Error '_SCOPE must be string'\r\n return ENV.luda._install installer._SCOPE, installer\r\n if installer instanceof Array or typeof installer is 'function'\r\n throw new Error 'Unscoped installer must be object.'\r\n installed = {}\r\n for name, property of installer\r\n installed[name] = ENV.luda._install name, property\r\n installed\r\n\r\n ENV.luda._install = (namespace, installer) ->\r\n if ENV.luda[namespace]\r\n console.warn \"Namespace #{namespace} is ocupied, sikp installation.\"\r\n return ENV.luda[namespace]\r\n for installedName, installedInstaller of ENV.luda\r\n if installer is installedInstaller\r\n console.warn \"Installer is installed with name #{installedName},\r\n skip installation.\"\r\n return ENV.luda[installedName]\r\n if installer._install\r\n if typeof installer._install is 'function'\r\n return ENV.luda[namespace] = installer._install()\r\n return ENV.luda[namespace] = installer._install\r\n ENV.luda[namespace] = installer","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n\r\n KEY_LEFT: 37\r\n KEY_UP: 38\r\n KEY_RIGHT: 39\r\n KEY_DOWN: 40\r\n KEY_TAB: 9\r\n KEY_ESC: 27\r\n KEY_ENTER: 13","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n $child: (selector, $ancestor) ->\r\n $ancestor = document unless $ancestor\r\n $ancestor.querySelector selector\r\n\r\n $children: (selector, $ancestor) ->\r\n $ancestor = document unless $ancestor\r\n $descendant = @$child selector, $ancestor\r\n if $descendant\r\n descendants = Array.from($ancestor.querySelectorAll selector)\r\n else\r\n descendants = []\r\n\r\n $unnested: (selector, $ancestor, ancestorSelector) ->\r\n descendants = @$children selector, $ancestor\r\n descendants.filter ($descendant) =>\r\n $descendant if @$parent(ancestorSelector, $descendant) is $ancestor\r\n\r\n $parent: (selector, $descendant) ->\r\n $ancestor = $descendant.parentNode\r\n if $ancestor\r\n if $ancestor.matches and $ancestor.matches selector\r\n $ancestor\r\n else\r\n @$parent selector, $ancestor\r\n\r\n $parents: (selector, $descendant, _ancestors) ->\r\n $ancestor = @$parent selector, $descendant\r\n _ancestors = [] unless _ancestors\r\n if $ancestor\r\n _ancestors.push($ancestor)\r\n @$parents selector, $ancestor, _ancestors\r\n else\r\n _ancestors\r\n\r\n $after: ($node, $target) ->\r\n $parent = $target.parentNode\r\n if $parent.lastChild is $target\r\n $parent.appendChild $node\r\n else\r\n $parent.insertBefore $node, $target.nextSibling\r\n\r\n $prepend: ($node, $target) ->\r\n if $target.firstChild\r\n $target.insertBefore $node, $target.firstChild\r\n else\r\n $target.appendChild $node\r\n\r\n reflow: ($element) -> $element.offsetHeight","import './install.coffee'\r\nimport './dom.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n _SWIPE_DISTANCE: 10\r\n _EVENT_TYPE_PREFIX: 'luda'\r\n _SWIPE_LEFT: 'swipeleft'\r\n _SWIPE_RIGHT: 'swiperight'\r\n _SWIPE_UP: 'swipeup'\r\n _SWIPE_DOWN: 'swipedown'\r\n _SWIPE_LEFT_OR_UP: 'swipeleft or swipeup'\r\n _SWIPE_RIGHT_OR_DOWN: 'swiperight or swipedown'\r\n _DOC_READY: 'docready'\r\n _FORM_RESET: 'reset'\r\n\r\n eventPath: (event) ->\r\n if event.composedPath\r\n path = event.composedPath()\r\n else if event.path\r\n path = event.path\r\n else\r\n path = [event.target].concat(luda.$parents '*', event.target)\r\n\r\n on: (event, selector..., handler) ->\r\n switch event\r\n when @_DOC_READY then @_onDocReady handler\r\n when @_FORM_RESET then @_onReset selector[0], handler\r\n when @_SWIPE_LEFT, \\\r\n @_SWIPE_RIGHT, \\\r\n @_SWIPE_UP, \\\r\n @_SWIPE_DOWN, \\\r\n @_SWIPE_LEFT_OR_UP, \\\r\n @_SWIPE_RIGHT_OR_DOWN\r\n then @_onSwipe event, selector[0], handler\r\n else @_on event, selector[0], handler\r\n\r\n onOpposite: (event, selector, handler) ->\r\n _self = this\r\n document.addEventListener event, (e) ->\r\n trigger = _self.eventPath(e).every ($element) ->\r\n not $element.matches or not $element.matches selector\r\n handler e if trigger\r\n\r\n dispatch: ($target, type, detail, options = {}) ->\r\n options.bubbles = true unless typeof options.bubbles is 'boolean'\r\n options.cancelable = true unless typeof options.cancelable is 'boolean'\r\n options.composed = true unless typeof options.composed is 'boolean'\r\n evt = new Event \"#{@_EVENT_TYPE_PREFIX}:#{type}\", options\r\n evt.detail = detail\r\n $target.dispatchEvent evt\r\n evt\r\n \r\n _onDocReady: (handler) ->\r\n if document.readyState is 'loading'\r\n document.addEventListener 'DOMContentLoaded', handler\r\n else\r\n handler()\r\n\r\n _onReset: (selector, handler) ->\r\n document.addEventListener 'reset', (e) ->\r\n if selector?\r\n luda.$children(selector, e.target).forEach ($element) ->\r\n handler.bind($element)(e)\r\n else\r\n handler e\r\n \r\n _onSwipe: (event, selector, handler) ->\r\n _self = this\r\n watch = false\r\n $touchStartElement = document\r\n touchStartE = null\r\n touchStartX = 0\r\n touchStartY = 0\r\n document.addEventListener 'touchstart', (e) ->\r\n if e.touches.length is 1\r\n touchStartX = e.touches[0].screenX\r\n touchStartY = e.touches[0].screenY\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element.matches and $element.matches selector\r\n $touchStartElement = $element\r\n touchStartE = e\r\n watch = true\r\n return true\r\n else\r\n watch = true\r\n\r\n document.addEventListener 'touchmove', (e) ->\r\n if watch and e.touches.length is 1\r\n touchDistanceX = e.touches[0].screenX - touchStartX\r\n touchDistanceY = e.touches[0].screenY - touchStartY\r\n eventX = undefined\r\n eventY = undefined\r\n eventXOrY = undefined\r\n if Math.abs(touchDistanceX) >= _self._SWIPE_DISTANCE\r\n if touchDistanceX > 0\r\n eventX = _self._SWIPE_RIGHT\r\n else\r\n eventX = _self._SWIPE_LEFT\r\n if Math.abs(touchDistanceY) >= _self._SWIPE_DISTANCE\r\n if touchDistanceY > 0\r\n eventY = _self._SWIPE_DOWN\r\n else\r\n eventY = _self._SWIPE_UP\r\n if eventX is _self._SWIPE_LEFT \\\r\n or eventY is _self._SWIPE_UP\r\n eventXOrY = _self._SWIPE_LEFT_OR_UP\r\n if eventX is _self._SWIPE_RIGHT \\\r\n or eventY is _self._SWIPE_DOWN\r\n eventXOrY = _self._SWIPE_RIGHT_OR_DOWN\r\n if (eventX? and eventX is event) \\\r\n or (eventY? and eventY is event) \\\r\n or eventXOrY is event\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element is $touchStartElement\r\n watch = false\r\n handler.bind($element)(touchStartE, e)\r\n return true\r\n else\r\n watch = false\r\n handler touchStartE, e\r\n\r\n _on: (event, selector, handler) ->\r\n if selector is window\r\n window.addEventListener event, (e) -> handler e\r\n else\r\n _self = this\r\n document.addEventListener event, (e) ->\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element.matches and $element.matches selector\r\n handler.bind($element)(e)\r\n return true\r\n else\r\n handler e","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n except: (element, arr) ->\r\n arr.splice(arr.indexOf(element), 1) if arr.includes element","import './install.coffee'\r\nimport './utilities.coffee'\r\n\r\n\r\n \r\nluda class Singleton\r\n\r\n @_SCOPE: 'Singleton'\r\n \r\n @_SELECTOR_INVALID_ERROR: '@param selector must be a css selector string'\r\n @_SELECTORS: []\r\n\r\n @_selector: ''\r\n @_actived: true\r\n\r\n @active: ->\r\n @_actived = true\r\n\r\n @deactive: ->\r\n @_actived = false\r\n\r\n @_add: (selector) ->\r\n throw new Error @_SELECTOR_INVALID_ERROR if typeof selector isnt 'string'\r\n @_SELECTORS.push selector unless @_SELECTORS.includes selector\r\n @_mergeSelectors()\r\n\r\n @_remove: (selector) ->\r\n throw new Error @_SELECTOR_INVALID_ERROR if typeof selector isnt 'string'\r\n luda.except selector, @_SELECTORS\r\n @_mergeSelectors()\r\n\r\n @_mergeSelectors: ->\r\n @_selector = @_SELECTORS.join ','\r\n\r\n @_install: ->\r\n return this if this is Singleton\r\n @_SELECTORS = [] unless @hasOwnProperty '_SELECTORS'\r\n @_mergeSelectors()\r\n exposed = @_init() if typeof @_init is 'function'\r\n if exposed then exposed else this","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'enterClick'\r\n\r\n @_SELECTORS: [\r\n 'input[type=checkbox]'\r\n 'input[type=radio]'\r\n '[tabindex]'\r\n ]\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'keydown', (e) ->\r\n if self._actived \\\r\n and e.keyCode is luda.KEY_ENTER \\\r\n and e.target.matches self._selector\r\n e.preventDefault()\r\n setTimeout(-> e.target.click())","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'focus'\r\n\r\n @_CSS_CLASS: 'focus'\r\n # mouse focusable selectors\r\n @_SELECTORS: ['select'\r\n 'textarea'\r\n ':not(.btn-check):not(.btn-radio):not(.btn-file) >\r\n input:not([type=button]):not([type=submit]):not([type=reset])'\r\n ]\r\n @_TOUCHSTART_FOCUS_SELECTOR: 'input[type=range]'\r\n @_PARENT_FOCUS_SELECTOR: 'select[multiple]'\r\n @_PARENT_FOCUS_CHILDREN_SELECTOR: \"#{@_PARENT_FOCUS_SELECTOR} *\"\r\n\r\n @_$focus: document.getElementsByClassName(@_CSS_CLASS)\r\n\r\n @_removeFocusClassExcept: ($exception) ->\r\n Array.from(@_$focus).forEach ($focus) =>\r\n $focus.classList.remove @_CSS_CLASS if $focus isnt $exception\r\n\r\n @_addFocusClassExceptHtmlAndBody: ($target) ->\r\n if $target isnt document.body and $target isnt document.documentElement\r\n $target.classList.add @_CSS_CLASS\r\n\r\n @_changeFocusStateOnKeyEvent: (e) ->\r\n if @_actived\r\n @_removeFocusClassExcept e.target\r\n @_addFocusClassExceptHtmlAndBody e.target\r\n\r\n @_changeFocusStateOnMouseDownEvent: (e) ->\r\n if @_actived\r\n if e.target.matches @_PARENT_FOCUS_CHILDREN_SELECTOR\r\n target = luda.$parent @_PARENT_FOCUS_SELECTOR, e.target\r\n else\r\n target = e.target\r\n if target.matches @_selector\r\n @_removeFocusClassExcept target\r\n @_addFocusClassExceptHtmlAndBody target\r\n else\r\n @_removeFocusClassExcept()\r\n\r\n @_setElementPrototype: ->\r\n focus = HTMLElement.prototype.focus\r\n blur = HTMLElement.prototype.blur\r\n self = this\r\n HTMLElement.prototype.focus = ->\r\n focus.apply this, arguments\r\n if self._actived and document.activeElement is this\r\n self._removeFocusClassExcept this\r\n self._addFocusClassExceptHtmlAndBody this\r\n HTMLElement.prototype.blur = ->\r\n blur.apply this, arguments\r\n this.classList.remove self._CSS_CLASS if self._actived\r\n\r\n @_init: ->\r\n self = this\r\n @_setElementPrototype()\r\n luda.on 'keydown', @_changeFocusStateOnKeyEvent.bind this\r\n luda.on 'keyup', @_changeFocusStateOnKeyEvent.bind this\r\n luda.on 'mousedown', @_changeFocusStateOnMouseDownEvent.bind this\r\n luda.on 'touchstart', @_TOUCHSTART_FOCUS_SELECTOR, \\\r\n @_changeFocusStateOnMouseDownEvent.bind this\r\n luda.on 'focusin', @_changeFocusStateOnMouseDownEvent.bind this","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'radioTab'\r\n\r\n @_SELECTORS: ['input[type=radio]:not([disabled])']\r\n\r\n @_querySameName$radios: ($radio) ->\r\n if $radio.name\r\n selector = \"#{@_selector}[name=#{$radio.name}]\"\r\n else\r\n selector = @_selector\r\n $inputs = luda.$children selector\r\n $inputs.filter ($input) -> $input.tabIndex >= 0\r\n\r\n @_query$prev$next: ($radio) ->\r\n $sameNameRadios = @_querySameName$radios $radio\r\n radioIndex = $sameNameRadios.indexOf $radio\r\n $prev = $sameNameRadios[radioIndex - 1]\r\n $next = $sameNameRadios[radioIndex + 1]\r\n {$prev, $next}\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'keydown', (e) ->\r\n if self._actived \\\r\n and e.keyCode is luda.KEY_TAB \\\r\n and e.target.nodeName.toUpperCase() is 'INPUT' \\\r\n and e.target.type is 'radio'\r\n if e.shiftKey\r\n if $prev = self._query$prev$next(e.target).$prev\r\n e.preventDefault()\r\n $prev.focus()\r\n else\r\n if $next = self._query$prev$next(e.target).$next\r\n e.preventDefault()\r\n $next.focus()","import './install.coffee'\r\nimport './utilities.coffee'\r\nimport './dom.coffee'\r\nimport './event.coffee'\r\n\r\n\r\n\r\n\r\nluda class Component\r\n\r\n @_SCOPE: 'Component'\r\n \r\n @_COMPONENT_NO_SELECTOR_ERROR: 'Extended component must has a css selector'\r\n @_$COMPONENT_INVALID_ERROR: '@param $component must be an instance of Element'\r\n @_SELECTOR: ''\r\n @_instances: []\r\n\r\n @_Observed: []\r\n @_observer: null\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n\r\n _hasDescendant: (descendant) ->\r\n if @_children.length and descendant\r\n return true if @_children.includes descendant\r\n return @_children.some (child) -> child._hasDescendant descendant\r\n else\r\n return false\r\n\r\n _observe: ->\r\n @_observer = new MutationObserver @_onMutations.bind this\r\n @_observer.observe @_$component, @constructor._observerConfig\r\n\r\n _disconnect: ->\r\n @_observer.disconnect()\r\n @_observer = null\r\n\r\n @create: ($component) ->\r\n componentIsElementInstance = $component instanceof Element\r\n throw new Error @_$COMPONENT_INVALID_ERROR unless componentIsElementInstance\r\n $family = @_query$family $component\r\n instance = @query $component\r\n if $family._$parent\r\n if parent = @query $family._$parent\r\n @_instances.push instance = @_createInstance $component unless instance\r\n if instance._parent isnt parent\r\n parent._children.push(instance) and (instance._parent = parent)\r\n $family._$children.forEach ($child) => @create $child\r\n return instance\r\n else\r\n @create $family._$parent\r\n return @query $component\r\n else\r\n @_instances.push instance = @_createInstance $component unless instance\r\n $family._$children.forEach ($child) => @create $child\r\n return instance\r\n\r\n @destroy: (instance$component) ->\r\n instance = @query instance$component\r\n if instance\r\n instance._disconnect() if instance._observer\r\n instance._destroy() if instance._destroy\r\n @destroy instance._children[0] while instance._children.length\r\n if instance._parent\r\n luda.except instance, instance._parent._children\r\n luda.except instance, @_instances\r\n for attribute, value of instance\r\n instance[attribute] = null\r\n \r\n @query: (instance$component) ->\r\n instance = null\r\n if instance$component instanceof this \\\r\n and @_instances.includes instance$component\r\n instance = instance$component\r\n else if instance$component instanceof Element\r\n @_instances.some (inited) ->\r\n if inited._$component is instance$component\r\n instance = inited\r\n return true\r\n return instance\r\n\r\n @_query$family: ($component) ->\r\n _$parent = null\r\n _$children = []\r\n if @_SELECTOR\r\n _$parent = luda.$parent @_SELECTOR, $component\r\n _$children = luda.$unnested @_SELECTOR, $component, @_SELECTOR\r\n {_$parent, _$children}\r\n\r\n @_createInstance: ($component) ->\r\n instance = new this()\r\n instance._$component = $component\r\n instance._parent = null\r\n instance._children = []\r\n instance._observer = null\r\n instance._constructor() if instance._constructor\r\n unless instance._observer and instance._onMutations and @_observerConfig\r\n instance._observe()\r\n instance\r\n\r\n @_observe: (classObj) ->\r\n unless Component._observer\r\n Component._observer = new MutationObserver (mutations) ->\r\n mutations.forEach (mutation) ->\r\n $removedNodes = Array.from mutation.removedNodes\r\n $addedNodes = Array.from mutation.addedNodes\r\n $removedNodes.forEach ($node) ->\r\n if $node instanceof Element\r\n Component._Observed.forEach (Observed) ->\r\n if $node.matches Observed._SELECTOR\r\n Observed.destroy $node\r\n else\r\n $destroies = luda.$children Observed._SELECTOR, $node\r\n $destroies.forEach ($destroy) -> Observed.destroy $destroy\r\n $addedNodes.forEach ($node) ->\r\n if $node instanceof Element\r\n Component._Observed.forEach (Observed) ->\r\n if $node.matches Observed._SELECTOR\r\n Observed.create $node\r\n else\r\n $creates = luda.$children Observed._SELECTOR, $node\r\n $creates.forEach ($create) -> Observed.create $create\r\n Component._observer.observe document.documentElement, \\\r\n Component._observerConfig\r\n unless Component._Observed.includes classObj\r\n Component._Observed.push classObj\r\n\r\n @_install: ->\r\n self = this\r\n return this if this is Component\r\n unless @_SELECTOR or typeof @_SELECTOR isnt 'string'\r\n throw new Error @_COMPONENT_NO_SELECTOR_ERROR\r\n @_instances = [] unless @hasOwnProperty '_instances'\r\n exposed = @_init() if typeof @_init is 'function'\r\n luda.on luda._DOC_READY, ->\r\n luda.$children(self._SELECTOR).forEach ($component) ->\r\n self.create $component\r\n Component._observe(self)\r\n if exposed then exposed else this","import '../install.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'readonly'\r\n @_READONLY_ATTRIBUTE: 'data-readonly'\r\n @_READONLY_FALSE_VALUE: 'false'\r\n @_SELECTOR: \"[#{@_READONLY_ATTRIBUTE}]\"\r\n\r\n @_observerConfig:\r\n attributes: true\r\n attributeFilter: [@_READONLY_ATTRIBUTE]\r\n\r\n _getConfig: ->\r\n readonly = @_$component.getAttribute @constructor._READONLY_ATTRIBUTE\r\n _isReadonly = readonly isnt @constructor._READONLY_FALSE_VALUE\r\n _originalTabIndex = @_$component.tabIndex\r\n {_isReadonly, _originalTabIndex}\r\n \r\n _constructor: ->\r\n {\r\n @_isReadonly,\r\n @_originalTabIndex\r\n } = @_getConfig()\r\n @_setTabIndex()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _setTabIndex: ->\r\n if @_isReadonly\r\n @_$component.tabIndex = -1\r\n else\r\n @_$component.tabIndex = @_originalTabIndex","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'toggle'\r\n @_TOGGLE_TARGET_ATTRIBUTE: 'data-toggle-target'\r\n @_TOGGLE_ATTRIBUTE: 'data-toggle'\r\n @_TOGGLE_FOR_ATTRIBUTE: 'data-toggle-for'\r\n @_NONE_TOGGLE_ATTRIBUTE: 'data-none-toggle'\r\n @_ACTIVE_CSS_CLASS: 'toggle-active'\r\n @_SELECTORS: [\r\n \"[#{@_TOGGLE_FOR_ATTRIBUTE}]\"\r\n \"[#{@_TOGGLE_ATTRIBUTE}]\"\r\n ]\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @active: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n $target.classList.add @_ACTIVE_CSS_CLASS\r\n luda.dispatch($target, @_ACTIVED_EVENT_TYPE)\r\n\r\n @deactive: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n $target.classList.remove @_ACTIVE_CSS_CLASS\r\n luda.dispatch($target, @_DEACTIVED_EVENT_TYPE)\r\n\r\n @toggle: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n if $target.classList.contains @_ACTIVE_CSS_CLASS\r\n @deactive($target)\r\n else\r\n @active($target)\r\n\r\n @_query$targets: (name$target) ->\r\n if name$target instanceof Element\r\n [name$target]\r\n else\r\n luda.$children \"[#{@_TOGGLE_TARGET_ATTRIBUTE}=#{name$target}]\"\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'click', @_selector, (e) ->\r\n toggleChecked = false\r\n luda.eventPath(e).some ($path) ->\r\n if $path instanceof Element\r\n if $path.hasAttribute(self._TOGGLE_ATTRIBUTE) \\\r\n or $path.hasAttribute(self._TOGGLE_FOR_ATTRIBUTE)\r\n if toggleName = $path.getAttribute self._TOGGLE_FOR_ATTRIBUTE\r\n self.toggle toggleName\r\n toggleChecked = true\r\n if $path.hasAttribute self._TOGGLE_ATTRIBUTE\r\n if $path.hasAttribute self._TOGGLE_TARGET_ATTRIBUTE\r\n $toggle = $path\r\n else\r\n $toggle = luda.$parent \\\r\n \"[#{self._TOGGLE_TARGET_ATTRIBUTE}]\", $path\r\n if $toggle\r\n self.toggle $toggle\r\n toggleChecked = true\r\n else if $path.hasAttribute self._NONE_TOGGLE_ATTRIBUTE\r\n toggleChecked = true","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmFile'\r\n\r\n @_VALUE_SPLITOR: ' '\r\n @_SELECTOR: '.fm-file'\r\n @_FILE_SELECTOR: 'input[type=file]'\r\n @_SIMULATOR_SELECTOR: 'input:not([type=file])'\r\n @_PLACEHOLDER_ATTRIBUTE: 'placeholder'\r\n @_VALUE_ATTRIBUTE: 'value'\r\n\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n\r\n _getConfig: ->\r\n _$file = luda.$child @constructor._FILE_SELECTOR, @_$component\r\n _$simulator = luda.$child \\\r\n @constructor._SIMULATOR_SELECTOR, @_$component\r\n {_$file, _$simulator}\r\n\r\n _constructor: ->\r\n {\r\n @_$file,\r\n @_$simulator\r\n } = @_getConfig()\r\n @_init()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _insertSimulator: ->\r\n @_$simulator = document.createElement 'input'\r\n @_$simulator.tabIndex = -1\r\n luda.$after @_$simulator, @_$file\r\n\r\n _setPlaceholderValue: ->\r\n @_$simulator.placeholder = \\\r\n @_$file.getAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _setSimulatorValue: ->\r\n values = []\r\n Array.from(@_$file.files).map (file) -> values.push file.name\r\n if values.length\r\n @_$simulator.value = values.join @constructor._VALUE_SPLITOR\r\n else if @_$file.hasAttribute(@constructor._VALUE_ATTRIBUTE)\r\n @_$simulator.value = @_$file.getAttribute @constructor._VALUE_ATTRIBUTE\r\n\r\n _init: ->\r\n if @_$file\r\n @_insertSimulator() unless @_$simulator\r\n if @_$file.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_setPlaceholderValue()\r\n @_setSimulatorValue()\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'change', \"#{@_SELECTOR} #{@_FILE_SELECTOR}\", (e) ->\r\n self.query(luda.$parent self._SELECTOR, this)._setSimulatorValue()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._setSimulatorValue()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmSelect'\r\n\r\n @_SELECTOR: '.fm-select'\r\n @_SELECT_SELECTOR: 'select'\r\n @_SINGLE_SELECT_SIMULATOR_SELECTOR: 'input'\r\n @_PLACEHOLDER_ATTRIBUTE: 'placeholder'\r\n @_MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS: 'fm-select-multiple-placeholder'\r\n @_DEFAULT_SELECTED_OPTION_ATTRIBUTE: 'data-fm-select-default-selected'\r\n @_INITED_ATTRIBUTE: 'data-fm-select-inited'\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: ['selected']\r\n\r\n select: (indexOrIndexArray) ->\r\n if @_$select.multiple\r\n if @_$multipleSelectPlaceholder\r\n selectedIndexes = indexOrIndexArray\r\n else\r\n selectedIndexes = indexOrIndexArray.map (index) -> index + 1\r\n Array.from(@_$select.options).forEach ($option, index) ->\r\n $option.selected = selectedIndexes.includes index\r\n @_markSelectedOption()\r\n else\r\n @_$select.selectedIndex = selectedIndex\r\n @_setSingleSelectSimulatorValue()\r\n @_markSelectedOption()\r\n\r\n _getConfig: ->\r\n _$select = luda.$child @constructor._SELECT_SELECTOR, @_$component\r\n _$singleSelectSimulator = luda.$child \\\r\n @constructor._SINGLE_SELECT_SIMULATOR_SELECTOR, @_$component\r\n _$multipleSelectPlaceholder = luda.$child \\\r\n \".#{@constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS}\", @_$component\r\n _$defaultSelectedOptions = luda.$children \\\r\n \"[#{@constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE}]\", @_$component\r\n _defaultSelectedOptionMarked = @_$component.hasAttribute \\\r\n @constructor._INITED_ATTRIBUTE\r\n {\r\n _$select,\r\n _$singleSelectSimulator,\r\n _$multipleSelectPlaceholder,\r\n _$defaultSelectedOptions,\r\n _defaultSelectedOptionMarked\r\n }\r\n\r\n _constructor: ->\r\n {\r\n @_$select,\r\n @_$singleSelectSimulator,\r\n @_$multipleSelectPlaceholder,\r\n @_$defaultSelectedOptions,\r\n @_defaultSelectedOptionMarked\r\n } = @_getConfig()\r\n if @_$select\r\n if @_$select.multiple\r\n @_initMultipleSelect()\r\n else\r\n @_initSingleSelect()\r\n \r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _markSelectedOption: ->\r\n @_disconnect() if @_observer\r\n Array.from(@_$select.options).forEach ($option) ->\r\n if $option.selected\r\n $option.setAttribute 'selected', 'selected'\r\n else\r\n $option.removeAttribute 'selected'\r\n @_observe() unless @_observer\r\n\r\n _markDefaultSelectedOption: ->\r\n @_$component.setAttribute @constructor._INITED_ATTRIBUTE, ''\r\n Array.from(@_$select.options).forEach ($option) =>\r\n if $option.selected\r\n $option.setAttribute @constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE, ''\r\n\r\n _setSingleSelectedDefaultSelectedOption: ->\r\n hasSelected = Array.from(@_$select.options).some ($option) ->\r\n $option.getAttribute('selected') is 'selected'\r\n @_$select.selectedIndex = -1 unless hasSelected\r\n\r\n _insertSingleSelectSimulator: ->\r\n @_$singleSelectSimulator = document.createElement 'input'\r\n @_$singleSelectSimulator.tabIndex = -1\r\n luda.$after @_$singleSelectSimulator, @_$select\r\n\r\n _setSingleSelectPlaceholderValue: ->\r\n @_$singleSelectSimulator.placeholder = @_$select.getAttribute \\\r\n @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _setSingleSelectSimulatorValue: ->\r\n if $selectedOption = @_$select.options[@_$select.selectedIndex]\r\n @_$singleSelectSimulator.value = $selectedOption.innerText\r\n else\r\n @_$singleSelectSimulator.value = ''\r\n\r\n _initSingleSelect: ->\r\n @_insertSingleSelectSimulator() unless @_$singleSelectSimulator\r\n if @_$select.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_setSingleSelectedDefaultSelectedOption()\r\n @_setSingleSelectPlaceholderValue()\r\n @_markDefaultSelectedOption() unless @_defaultSelectedOptionMarked\r\n @_setSingleSelectSimulatorValue()\r\n @_markSelectedOption()\r\n\r\n _insertMultipleSelectBlankOption: ->\r\n @_$multipleSelectPlaceholder = document.createElement 'option'\r\n @_$multipleSelectPlaceholder.className = \\\r\n @constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS\r\n @_$multipleSelectPlaceholder.disabled = true\r\n luda.$prepend @_$multipleSelectPlaceholder, @_$select\r\n\r\n _setMultipleSelectPlaceholderValue: ->\r\n @_$multipleSelectPlaceholder.innerText = @_$select.getAttribute \\\r\n @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _initMultipleSelect: ->\r\n unless @_$multipleSelectPlaceholder\r\n if @_$select.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_insertMultipleSelectBlankOption()\r\n @_setMultipleSelectPlaceholderValue()\r\n @_markDefaultSelectedOption() unless @_defaultSelectedOptionMarked\r\n\r\n _reset: ->\r\n if @_$select\r\n Array.from(@_$select.options).forEach ($option) =>\r\n $option.selected = @_$defaultSelectedOptions.includes $option\r\n @_setSingleSelectSimulatorValue() unless @_$select.multiple\r\n @_markSelectedOption()\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'change', \"#{@_SELECTOR} #{@_SELECT_SELECTOR}\", (e) ->\r\n instance = self.query(luda.$parent self._SELECTOR, this)\r\n instance._setSingleSelectSimulatorValue() unless this.multiple\r\n instance._markSelectedOption()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._reset()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'carousel'\r\n\r\n @_SELECTOR: '.carousel'\r\n @_ITEMS_SELECTOR: '.carousel-item'\r\n @_PREV_CONTROL_SELECTOR: '.carousel-prev'\r\n @_NEXT_CONTROL_SELECTOR: '.carousel-next'\r\n @_INDICATORS_SELECTOR: '.carousel-indicators .btn'\r\n @_INTERVAL_ATTRIBUTE: 'data-carousel-interval'\r\n @_WRAP_ATTRIBUTE: 'data-carousel-wrap'\r\n @_ITEM_ACTIVE_CSS_CLASS: 'carousel-item-active'\r\n @_ITEM_NEXT_CSS_CLASS: 'carousel-item-next'\r\n @_ITEM_PREV_CSS_CLASS: 'carousel-item-prev'\r\n @_ACTIVE_INDEX: 0\r\n @_INTERVAL: 5000\r\n @_WRAP: true\r\n @_FALSE: 'false'\r\n @_ACTIVE_EVENT_TYPE: \"#{@_SCOPE}:active\"\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVE_EVENT_TYPE: \"#{@_SCOPE}:deactive\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [@_INTERVAL_ATTRIBUTE, @_WRAP_ATTRIBUTE]\r\n \r\n # public\r\n active: (index) ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n if index? \\\r\n and index isnt @_activeIndex \\\r\n and 0 <= index <= @_$items.length - 1\r\n @_transiting = true\r\n @_activeIndex = index\r\n action = if index < activedIndex then '_slidePrev' else '_slideNext'\r\n @[action] @_$items[activedIndex], activedIndex\r\n\r\n next: ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n index = activedIndex + 1\r\n if index > @_$items.length - 1\r\n return unless @_wrap\r\n index = 0\r\n @_transiting = true\r\n @_activeIndex = index\r\n @_slideNext @_$items[activedIndex], activedIndex\r\n @_playTimeStamp = Date.now()\r\n @_pausedRemainTime = @_interval\r\n\r\n prev: ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n index = activedIndex - 1\r\n if index < 0\r\n return unless @_wrap\r\n index = @_$items.length - 1\r\n @_transiting = true\r\n @_activeIndex = index\r\n @_slidePrev @_$items[activedIndex], activedIndex\r\n @_playTimeStamp = Date.now()\r\n @_pausedRemainTime = @_interval\r\n\r\n pause: ->\r\n if @_intervaling?\r\n clearInterval @_intervaling\r\n @_intervaling = null\r\n @_pausedRemainTime = @_pausedRemainTime - (Date.now() - @_playTimeStamp)\r\n\r\n play: ->\r\n if @_interval and @_$items.length > 1\r\n @_playTimeStamp = Date.now()\r\n @pause()\r\n execute = =>\r\n @next()\r\n @_intervaling = setInterval @next.bind(this), @_interval\r\n @_intervaling = setTimeout execute, @_pausedRemainTime\r\n\r\n\r\n # private\r\n _getConfig: ->\r\n _$items = luda.$unnested \\\r\n @constructor._ITEMS_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$indicators = luda.$unnested \\\r\n @constructor._INDICATORS_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$prevControl = luda.$child \\\r\n @constructor._PREV_CONTROL_SELECTOR, @_$component\r\n _$nextControl = luda.$child \\\r\n @constructor._NEXT_CONTROL_SELECTOR, @_$component\r\n _activeIndex = _$items.indexOf \\\r\n luda.$child \".#{@constructor._ITEM_ACTIVE_CSS_CLASS}\", @_$component\r\n _activeIndex = @constructor._ACTIVE_INDEX if _activeIndex is -1\r\n _interval = @_$component.getAttribute(@constructor._INTERVAL_ATTRIBUTE)\r\n if _interval is @constructor._FALSE\r\n _interval = false\r\n else\r\n _interval = Math.abs(parseInt _interval, 10) or @constructor._INTERVAL\r\n _wrap = @_$component.getAttribute(@constructor._WRAP_ATTRIBUTE)\r\n _wrap = if _wrap is @constructor._FALSE then false else @constructor._WRAP\r\n {\r\n _$items,\r\n _$indicators,\r\n _$prevControl,\r\n _$nextControl,\r\n _activeIndex,\r\n _interval,\r\n _wrap\r\n }\r\n\r\n _constructor: ->\r\n {\r\n @_$items,\r\n @_$indicators,\r\n @_$prevControl,\r\n @_$nextControl,\r\n @_activeIndex,\r\n @_interval,\r\n @_wrap\r\n } = @_getConfig()\r\n @_transiting = false\r\n @_intervaling = null\r\n @_playTimeStamp = 0\r\n @_pausedRemainTime = @_interval\r\n @_layout()\r\n @play()\r\n\r\n _onMutations: (mutations) ->\r\n {\r\n @_$items,\r\n @_$indicators,\r\n @_$prevControl,\r\n @_$nextControl,\r\n @_activeIndex,\r\n @_interval,\r\n @_wrap\r\n } = @_getConfig()\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n @play()\r\n\r\n _destroy: ->\r\n @pause()\r\n\r\n _layout: ->\r\n @_$items.forEach ($item, index) =>\r\n $item.style.transition = 'none'\r\n if index > @_activeIndex\r\n $item.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n else if index < @_activeIndex\r\n $item.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n else\r\n luda.dispatch($item, @constructor._ACTIVED_EVENT_TYPE, index)\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n luda.reflow($item)\r\n $item.style.transition = ''\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _slideNext: ($activedItem, activedIndex) ->\r\n if @_$items.length > 1\r\n $item = @_$items[@_activeIndex]\r\n luda.dispatch($item, \\\r\n @constructor._ACTIVE_EVENT_TYPE, @_activeIndex)\r\n $item.style.transition = 'none'\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n luda.reflow $item\r\n $item.style.transition = ''\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch($activedItem, \\\r\n @constructor._DEACTIVE_EVENT_TYPE, activedIndex)\r\n $activedItem.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $activedItem.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _slidePrev: ($activedItem, activedIndex) ->\r\n if @_$items.length > 1\r\n $item = @_$items[@_activeIndex]\r\n luda.dispatch($item, \\\r\n @constructor._ACTIVE_EVENT_TYPE, @_activeIndex)\r\n $item.style.transition = 'none'\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n luda.reflow $item\r\n $item.style.transition = ''\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch($activedItem, \\\r\n @constructor._DEACTIVE_EVENT_TYPE, activedIndex)\r\n $activedItem.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $activedItem.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _setIndicatorsState: ->\r\n @_$indicators.forEach ($indicator, index) =>\r\n $indicator.disabled = index is @_activeIndex\r\n\r\n _setDirectionControlState: ->\r\n if @_$items.length <= 1\r\n @_$prevControl?.disabled = @_$nextControl?.disabled = true\r\n else\r\n @_$prevControl?.disabled = @_activeIndex is 0 and not @_wrap\r\n @_$nextControl?.disabled = \\\r\n @_activeIndex is @_$items.length - 1 and not @_wrap\r\n \r\n # static private\r\n @_init: ->\r\n self = this\r\n luda.on 'transitionend', @_ITEMS_SELECTOR, (e) ->\r\n instance = self.query(luda.$parent self._SELECTOR, this)\r\n instance._transiting = false\r\n index = instance._$items.indexOf this\r\n if this.classList.contains self._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch(this, self._ACTIVED_EVENT_TYPE, index)\r\n else\r\n luda.dispatch(this, self._DEACTIVED_EVENT_TYPE, index)\r\n luda.on 'click', @_INDICATORS_SELECTOR, (e) ->\r\n instance = self.query luda.$parent self._SELECTOR, this\r\n instance.active instance._$indicators.indexOf this\r\n luda.on 'touchstart', @_SELECTOR, (e) ->\r\n self.query(this).pause()\r\n luda.on 'touchend', @_SELECTOR, (e) ->\r\n setTimeout => self.query(this).play()\r\n luda.on 'mouseover', @_SELECTOR, (e) ->\r\n self.query(this).pause()\r\n luda.on 'mouseout', @_SELECTOR, (e) ->\r\n self.query(this).play()\r\n luda.on luda._SWIPE_LEFT_OR_UP, @_SELECTOR, (startE, e) ->\r\n self.query(this).next()\r\n luda.on luda._SWIPE_RIGHT_OR_DOWN, @_SELECTOR, (startE, e) ->\r\n self.query(this).prev()\r\n luda.on 'click', @_PREV_CONTROL_SELECTOR, (e) ->\r\n self.query(luda.$parent self._SELECTOR, this).prev()\r\n luda.on 'click', @_NEXT_CONTROL_SELECTOR, (e) ->\r\n self.query(luda.$parent self._SELECTOR, this).next()","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'dropdown'\r\n @_SELECTOR: '.dropdown-fixed,.dropdown-absolute,\r\n .dropdown-static,.dropdown-absolute-m'\r\n @_MENU_SELECTOR: '.dropdown-menu'\r\n @_ITEMS_SELECTOR: 'a[href]:not([disabled]),button:not([disabled]),\r\n input:not([disabled]),[tabindex]:not([disabled])'\r\n @_TOGGLE_ATTRIBUTE: 'data-dropdown-toggle'\r\n @_NONE_TOGGLE_ATTRIBUTE: 'data-dropdown-none-toggle'\r\n @_STANDALONE_ATTRIBUTE: 'data-dropdown-standalone'\r\n @_SWITCHES_SELECTOR: \"[#{@_TOGGLE_ATTRIBUTE}]\"\r\n @_NONE_SWITCHES_SELECTOR: \"[#{@_NONE_TOGGLE_ATTRIBUTE}]\"\r\n @_ACTIVE_CSS_CLASS: 'dropdown-active'\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [\r\n @_TOGGLE_ATTRIBUTE\r\n @_NONE_TOGGLE_ATTRIBUTE\r\n @_STANDALONE_ATTRIBUTE\r\n ]\r\n\r\n @_$focused: []\r\n\r\n active: ->\r\n unless @_actived()\r\n @_$component.classList.add @constructor._ACTIVE_CSS_CLASS\r\n @constructor._$focused.push document.activeElement\r\n @_parent?.active()\r\n luda.dispatch(@_$component, @constructor._ACTIVED_EVENT_TYPE)\r\n\r\n deactive: (focus) ->\r\n if @_actived()\r\n @_$component.classList.remove @constructor._ACTIVE_CSS_CLASS\r\n @_children.forEach (child) -> child.deactive()\r\n if focus\r\n @constructor._$focused[@constructor._$focused.length - 1]?.focus()\r\n @constructor._$focused.splice @constructor._$focused.length - 1, 1\r\n luda.dispatch(@_$component, @constructor._DEACTIVED_EVENT_TYPE)\r\n\r\n toggle: (focus) ->\r\n if @_actived() then @deactive(focus) else @active()\r\n\r\n prev: ->\r\n if @_$items.length and @_actived()\r\n focusIndex = @_$items.indexOf(document.activeElement) - 1\r\n focusIndex = 0 if focusIndex < 0\r\n @_$items[focusIndex].focus()\r\n\r\n next: ->\r\n if @_$items.length and @_actived()\r\n focusIndex = @_$items.indexOf(document.activeElement) + 1\r\n focusIndex = @_$items.length - 1 if focusIndex > @_$items.length - 1\r\n @_$items[focusIndex].focus()\r\n\r\n _getConfig: ->\r\n _$menu = luda.$child @constructor._MENU_SELECTOR, @_$component\r\n _$switches = luda.$unnested( \\\r\n @constructor._SWITCHES_SELECTOR, @_$component, @constructor._SELECTOR)\r\n .concat(luda.$unnested \\\r\n @constructor._SWITCHES_SELECTOR, _$menu, @constructor._MENU_SELECTOR)\r\n _$noneSwitches = luda.$unnested( \\\r\n @constructor._NONE_SWITCHES_SELECTOR, \\\r\n @_$component, @constructor._SELECTOR) \\\r\n .concat(luda.$unnested \\\r\n @constructor._NONE_SWITCHES_SELECTOR, _$menu, @constructor._MENU_SELECTOR)\r\n _$items = luda.$unnested \\\r\n @constructor._ITEMS_SELECTOR, _$menu, @constructor._MENU_SELECTOR\r\n _isStandalone = @_$component.hasAttribute @constructor._STANDALONE_ATTRIBUTE\r\n {_$items, _$switches, _$noneSwitches, _isStandalone}\r\n\r\n _constructor: ->\r\n {\r\n @_$items,\r\n @_$switches,\r\n @_$noneSwitches,\r\n @_isStandalone\r\n } = @_getConfig()\r\n\r\n _onMutations: (mutations) ->\r\n @_constructor()\r\n\r\n _actived: ->\r\n @_$component.classList.contains @constructor._ACTIVE_CSS_CLASS\r\n\r\n _deactiveChildrenExcept: (exceptions) ->\r\n if exceptions and not (exceptions instanceof Array)\r\n exceptions = [exceptions]\r\n if exceptions\r\n @_children.forEach (child) ->\r\n child.deactive() if child._actived() and not exceptions.includes child\r\n else\r\n @_children.forEach (child) ->\r\n child.deactive() if child._actived()\r\n\r\n @deactiveExcept: (instances$dropdowns) ->\r\n exceptions = []\r\n if instances$dropdowns and not (instances$dropdowns instanceof Array)\r\n instances$dropdowns = [instances$dropdowns]\r\n if instances$dropdowns\r\n instances$dropdowns.forEach (instance$dropdown) =>\r\n exceptions.push exception if exception = @query instance$dropdown\r\n if exceptions.length\r\n @_instances.forEach (instance) ->\r\n instanceIsntInExceptions = not exceptions.includes instance\r\n instanceHasntExceptionChild = exceptions.every (exception) ->\r\n not instance._hasDescendant exception\r\n if instance._actived() \\\r\n and instanceIsntInExceptions \\\r\n and instanceHasntExceptionChild\r\n instance.deactive()\r\n else\r\n @_instances.forEach (instance) ->\r\n instance.deactive() if instance._actived()\r\n\r\n @_standaloneInstances: ->\r\n @_instances.filter (instance) -> instance if instance._isStandalone\r\n\r\n @_init: ->\r\n self = this\r\n luda.onOpposite 'click', @_SELECTOR, (e) ->\r\n self.deactiveExcept self._standaloneInstances()\r\n luda.on 'click', @_SELECTOR, (e) ->\r\n if instance = self.query this\r\n toggleChecked = false\r\n focus = not e.detail\r\n self.deactiveExcept(self._standaloneInstances().concat instance)\r\n instance._deactiveChildrenExcept()\r\n instance._parent._deactiveChildrenExcept(instance) if instance._parent\r\n if instance._$switches.length or instance._$noneSwitches.length\r\n luda.eventPath(e).some ($path) ->\r\n if instance._$switches.includes $path\r\n instance.toggle focus\r\n toggleChecked = true\r\n else if instance._$noneSwitches.includes $path\r\n toggleChecked = true\r\n instance.toggle focus unless toggleChecked\r\n\r\n luda.onOpposite 'keyup', @_SELECTOR, (e) -> self.deactiveExcept()\r\n luda.on 'keyup', @_SELECTOR, (e) ->\r\n if e.keyCode is luda.KEY_TAB and instance = self.query this\r\n self.deactiveExcept(instance)\r\n instance.active()\r\n luda.on 'keydown', @_SELECTOR, (e) ->\r\n if e.keyCode is luda.KEY_ESC and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.deactive true\r\n else\r\n instance._parent?.deactive true\r\n luda.on 'keydown', @_SELECTOR, (e) ->\r\n if [luda.KEY_LEFT, luda.KEY_UP].includes(e.keyCode) \\\r\n and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.prev()\r\n else\r\n instance._parent?.prev()\r\n else if [luda.KEY_RIGHT, luda.KEY_DOWN].includes(e.keyCode) \\\r\n and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.next()\r\n else\r\n instance._parent?.next()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\nimport '../behaviours/focus.coffee'\r\nimport '../behaviours/enter-click.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmDropdown'\r\n\r\n @_SELECTOR: '.fm-dropdown'\r\n @_VALUE_SPLITOR: ' '\r\n @_VALUE_ATTRIBUTE: 'data-fm-dropdown-value'\r\n @_VALUE_SELECTOR: '.dropdown-items .btn-radio input,\r\n .dropdown-items .btn-check input'\r\n @_DEFAULT_VALUE_SELECTOR: '.dropdown-items .btn-radio label,\r\n .dropdown-items .btn-check label'\r\n @_VALUE_HOLDER_SELECTOR: '.fm input'\r\n @_ENTER_CLICK_VALUE_HOLDER_SELECTOR: '.fm-dropdown .fm input'\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [\r\n 'checked'\r\n @_VALUE_ATTRIBUTE\r\n ]\r\n\r\n _getConfig: ->\r\n _$values = luda.$children @constructor._VALUE_SELECTOR, @_$component\r\n _$defaultValues = luda.$children \\\r\n @constructor._DEFAULT_VALUE_SELECTOR, @_$component\r\n _$valueHolder = luda.$child \\\r\n @constructor._VALUE_HOLDER_SELECTOR, @_$component\r\n {_$values, _$valueHolder, _$defaultValues}\r\n\r\n _constructor: ->\r\n {\r\n @_$values,\r\n @_$valueHolder,\r\n @_$defaultValues\r\n } = @_getConfig()\r\n @_setValueHolderAttribute()\r\n @_setValueHolderValue()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _setValueHolderValue: ->\r\n values = []\r\n @_$values.forEach ($value, index) =>\r\n if $value.checked\r\n if $value.hasAttribute @constructor._VALUE_ATTRIBUTE\r\n value = $value.getAttribute @constructor._VALUE_ATTRIBUTE\r\n else\r\n value = @_$defaultValues[index].innerText\r\n values.push value if value and not values.includes value\r\n if @_$valueHolder\r\n @_$valueHolder.value = values.join @constructor._VALUE_SPLITOR\r\n\r\n _setValueHolderAttribute: ->\r\n @_$valueHolder.setAttribute('readonly', '') if @_$valueHolder\r\n\r\n @_init: ->\r\n self = this\r\n luda.enterClick._add @_ENTER_CLICK_VALUE_HOLDER_SELECTOR\r\n luda.on 'change', \"#{@_SELECTOR} #{@_VALUE_SELECTOR}\", (e) ->\r\n self.query(luda.$parent self._SELECTOR, this)._setValueHolderValue()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._setValueHolderValue()\r\n # prevent ios device pop out wired navigation pannel\r\n if /iphone/i.test(navigator.userAgent) or /ipad/i.test(navigator.userAgent)\r\n luda.on 'focusin', @_ENTER_CLICK_VALUE_HOLDER_SELECTOR, (e) ->\r\n this.blur()\r\n this.classList.add luda.focus._CSS_CLASS","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'tab'\r\n\r\n @_SELECTOR: '.tab'\r\n @_PANE_SELECTOR: '.tab-pane'\r\n @_INDICATOR_SELECTOR: '.tab-indicators .btn-radio input[type=radio]'\r\n @_PANE_ACTIVE_CSS_CLASS: 'tab-pane-active'\r\n @_ACTIVE_INDEX: 0\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n \r\n # public\r\n active: (index) ->\r\n if @_$panes.length\r\n activedIndex = @_activeIndex\r\n if index? \\\r\n and index isnt @_activeIndex \\\r\n and 0 <= index <= @_$panes.length - 1\r\n @_activeIndex = index\r\n @_active(activedIndex)\r\n\r\n # private\r\n _getConfig: ->\r\n _$panes = luda.$unnested \\\r\n @constructor._PANE_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$indicators = luda.$unnested \\\r\n @constructor._INDICATOR_SELECTOR, @_$component, @constructor._SELECTOR\r\n _activeIndex = @constructor._ACTIVE_INDEX\r\n _$indicators.some ($indicator, index) ->\r\n if $indicator.checked\r\n _activeIndex = index\r\n true\r\n {_$panes, _$indicators, _activeIndex}\r\n\r\n _constructor: ->\r\n {\r\n @_$panes,\r\n @_$indicators,\r\n @_activeIndex\r\n } = @_getConfig()\r\n @_active()\r\n\r\n _onMutations: (mutations) ->\r\n @_constructor()\r\n\r\n _active: (activedIndex) ->\r\n @_$panes.forEach ($pane, index) =>\r\n if index is @_activeIndex\r\n $pane.classList.add @constructor._PANE_ACTIVE_CSS_CLASS\r\n luda.dispatch($pane, @constructor._ACTIVED_EVENT_TYPE, index)\r\n else\r\n $pane.classList.remove @constructor._PANE_ACTIVE_CSS_CLASS\r\n if index is activedIndex\r\n luda.dispatch($pane, @constructor._DEACTIVED_EVENT_TYPE, index)\r\n @_setIndicatorsState()\r\n\r\n _setIndicatorsState: ->\r\n @_$indicators.forEach ($indicator, index) =>\r\n if index is @_activeIndex\r\n $indicator.setAttribute 'checked', ''\r\n else\r\n $indicator.removeAttribute 'checked'\r\n\r\n # static private\r\n @_init: ->\r\n self = this\r\n luda.on 'change', @_INDICATOR_SELECTOR, (e) ->\r\n if this.checked\r\n instance = self.query luda.$parent self._SELECTOR, this\r\n instance.active instance._$indicators.indexOf this"],"names":[],"mappings":";;;;;;;;;;;EAAA,IAAA;;EAAA,GAAA,GAAM,CAAC;IACL,IAAG,OAAO,QAAP,KAAqB,WAAxB;MACE,IAAiB,OAAO,MAAP,KAAmB,WAApC;EAAA,aAAO,OAAP;;MACA,IAAiB,OAAO,MAAP,KAAmB,WAApC;EAAA,aAAO,OAAP;OAFF;;IAGA,MAAM,IAAI,KAAJ,CAAU,kCAAV;EAJD,CAAD;;EASN,IAAO,OAAO,GAAG,CAAC,IAAX,KAAmB,UAA1B;IACE,GAAG,CAAC,IAAJ,GAAW,SAAC,SAAD;EACT,QAAA,SAAA,EAAA,IAAA,EAAA;MAAA,IAAA,CAAuD,SAAvD;QAAA,MAAM,IAAI,KAAJ,CAAU,+BAAV,EAAN;;MACA,IAAA,CAAO,CAAC,QAAD,EAAW,UAAX,CAAsB,CAAC,QAAvB,CAAgC,OAAO,SAAvC,CAAP;QACE,MAAM,IAAI,KAAJ,CAAU,8CAAV,EADR;;MAEA,IAAG,SAAS,CAAC,cAAV,CAAyB,QAAzB,CAAH;QACE,IAAO,OAAO,SAAS,CAAC,MAAjB,KAA2B,QAAlC;UACE,MAAM,IAAI,KAAJ,CAAU,uBAAV,EADR;;EAEA,aAAO,GAAG,CAAC,IAAI,CAAC,QAAT,CAAkB,SAAS,CAAC,MAA5B,EAAoC,SAApC,EAHT;;MAIA,IAAG,SAAA,Y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A,SAAA,EAAW,IAAX;MACA,OAAA,EAAS;;;;;eAdb;;;;"}
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Luda 0.1.5 | https://luda.dev
3
+ * Copyright 2018 oatw | https://oatw.blog
4
+ * MIT license | http://opensource.org/licenses/MIT
5
+ */
6
+ (function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory():typeof define==="function"&&define.amd?define(factory):factory()})(this,function(){"use strict";var ENV;ENV=function(){if(typeof document!=="undefined"){if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}}throw new Error("Unsupported runtime environment.")}();if(typeof ENV.luda!=="function"){ENV.luda=function(installer){var installed,name,property;if(!installer){throw new Error("Installer cannot be detected.")}if(!["object","function"].includes(typeof installer)){throw new Error("Installer must be object, array or function.")}if(installer.hasOwnProperty("_SCOPE")){if(typeof installer._SCOPE!=="string"){throw new Error("_SCOPE must be string")}return ENV.luda._install(installer._SCOPE,installer)}if(installer instanceof Array||typeof installer==="function"){throw new Error("Unscoped installer must be object.")}installed={};for(name in installer){property=installer[name];installed[name]=ENV.luda._install(name,property)}return installed};ENV.luda._install=function(namespace,installer){var installedInstaller,installedName,ref;if(ENV.luda[namespace]){console.warn(`Namespace ${namespace} is ocupied, sikp installation.`);return ENV.luda[namespace]}ref=ENV.luda;for(installedName in ref){installedInstaller=ref[installedName];if(installer===installedInstaller){console.warn(`Installer is installed with name ${installedName}, skip installation.`);return ENV.luda[installedName]}}if(installer._install){if(typeof installer._install==="function"){return ENV.luda[namespace]=installer._install()}return ENV.luda[namespace]=installer._install}return ENV.luda[namespace]=installer}}luda({KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_TAB:9,KEY_ESC:27,KEY_ENTER:13});luda({$child:function(selector,$ancestor){if(!$ancestor){$ancestor=document}return $ancestor.querySelector(selector)},$children:function(selector,$ancestor){var $descendant,descendants;if(!$ancestor){$ancestor=document}$descendant=this.$child(selector,$ancestor);if($descendant){return descendants=Array.from($ancestor.querySelectorAll(selector))}else{return descendants=[]}},$unnested:function(selector,$ancestor,ancestorSelector){var descendants;descendants=this.$children(selector,$ancestor);return descendants.filter($descendant=>{if(this.$parent(ancestorSelector,$descendant)===$ancestor){return $descendant}})},$parent:function(selector,$descendant){var $ancestor;$ancestor=$descendant.parentNode;if($ancestor){if($ancestor.matches&&$ancestor.matches(selector)){return $ancestor}else{return this.$parent(selector,$ancestor)}}},$parents:function(selector,$descendant,_ancestors){var $ancestor;$ancestor=this.$parent(selector,$descendant);if(!_ancestors){_ancestors=[]}if($ancestor){_ancestors.push($ancestor);return this.$parents(selector,$ancestor,_ancestors)}else{return _ancestors}},$after:function($node,$target){var $parent;$parent=$target.parentNode;if($parent.lastChild===$target){return $parent.appendChild($node)}else{return $parent.insertBefore($node,$target.nextSibling)}},$prepend:function($node,$target){if($target.firstChild){return $target.insertBefore($node,$target.firstChild)}else{return $target.appendChild($node)}},reflow:function($element){return $element.offsetHeight}});var splice=[].splice;luda({_SWIPE_DISTANCE:10,_EVENT_TYPE_PREFIX:"luda",_SWIPE_LEFT:"swipeleft",_SWIPE_RIGHT:"swiperight",_SWIPE_UP:"swipeup",_SWIPE_DOWN:"swipedown",_SWIPE_LEFT_OR_UP:"swipeleft or swipeup",_SWIPE_RIGHT_OR_DOWN:"swiperight or swipedown",_DOC_READY:"docready",_FORM_RESET:"reset",eventPath:function(event){var path;if(event.composedPath){return path=event.composedPath()}else if(event.path){return path=event.path}else{return path=[event.target].concat(luda.$parents("*",event.target))}},on:function(event,...selector){var handler,ref;ref=selector,[...selector]=ref,[handler]=splice.call(selector,-1);switch(event){case this._DOC_READY:return this._onDocReady(handler);case this._FORM_RESET:return this._onReset(selector[0],handler);case this._SWIPE_LEFT:case this._SWIPE_RIGHT:case this._SWIPE_UP:case this._SWIPE_DOWN:case this._SWIPE_LEFT_OR_UP:case this._SWIPE_RIGHT_OR_DOWN:return this._onSwipe(event,selector[0],handler);default:return this._on(event,selector[0],handler)}},onOpposite:function(event,selector,handler){var _self;_self=this;return document.addEventListener(event,function(e){var trigger;trigger=_self.eventPath(e).every(function($element){return!$element.matches||!$element.matches(selector)});if(trigger){return handler(e)}})},dispatch:function($target,type,detail,options={}){var evt;if(typeof options.bubbles!=="boolean"){options.bubbles=true}if(typeof options.cancelable!=="boolean"){options.cancelable=true}if(typeof options.composed!=="boolean"){options.composed=true}evt=new Event(`${this._EVENT_TYPE_PREFIX}:${type}`,options);evt.detail=detail;$target.dispatchEvent(evt);return evt},_onDocReady:function(handler){if(document.readyState==="loading"){return document.addEventListener("DOMContentLoaded",handler)}else{return handler()}},_onReset:function(selector,handler){return document.addEventListener("reset",function(e){if(selector!=null){return luda.$children(selector,e.target).forEach(function($element){return handler.bind($element)(e)})}else{return handler(e)}})},_onSwipe:function(event,selector,handler){var $touchStartElement,_self,touchStartE,touchStartX,touchStartY,watch;_self=this;watch=false;$touchStartElement=document;touchStartE=null;touchStartX=0;touchStartY=0;document.addEventListener("touchstart",function(e){if(e.touches.length===1){touchStartX=e.touches[0].screenX;touchStartY=e.touches[0].screenY;if(selector!=null){return _self.eventPath(e).some(function($element){if($element.matches&&$element.matches(selector)){$touchStartElement=$element;touchStartE=e;watch=true;return true}})}else{return watch=true}}});return document.addEventListener("touchmove",function(e){var eventX,eventXOrY,eventY,touchDistanceX,touchDistanceY;if(watch&&e.touches.length===1){touchDistanceX=e.touches[0].screenX-touchStartX;touchDistanceY=e.touches[0].screenY-touchStartY;eventX=void 0;eventY=void 0;eventXOrY=void 0;if(Math.abs(touchDistanceX)>=_self._SWIPE_DISTANCE){if(touchDistanceX>0){eventX=_self._SWIPE_RIGHT}else{eventX=_self._SWIPE_LEFT}}if(Math.abs(touchDistanceY)>=_self._SWIPE_DISTANCE){if(touchDistanceY>0){eventY=_self._SWIPE_DOWN}else{eventY=_self._SWIPE_UP}}if(eventX===_self._SWIPE_LEFT||eventY===_self._SWIPE_UP){eventXOrY=_self._SWIPE_LEFT_OR_UP}if(eventX===_self._SWIPE_RIGHT||eventY===_self._SWIPE_DOWN){eventXOrY=_self._SWIPE_RIGHT_OR_DOWN}if(eventX!=null&&eventX===event||eventY!=null&&eventY===event||eventXOrY===event){if(selector!=null){return _self.eventPath(e).some(function($element){if($element===$touchStartElement){watch=false;handler.bind($element)(touchStartE,e);return true}})}else{watch=false;return handler(touchStartE,e)}}}})},_on:function(event,selector,handler){var _self;if(selector===window){return window.addEventListener(event,function(e){return handler(e)})}else{_self=this;return document.addEventListener(event,function(e){if(selector!=null){return _self.eventPath(e).some(function($element){if($element.matches&&$element.matches(selector)){handler.bind($element)(e);return true}})}else{return handler(e)}})}}});luda({except:function(element,arr){if(arr.includes(element)){return arr.splice(arr.indexOf(element),1)}}});var Singleton;luda(Singleton=function(){class Singleton{static active(){return this._actived=true}static deactive(){return this._actived=false}static _add(selector){if(typeof selector!=="string"){throw new Error(this._SELECTOR_INVALID_ERROR)}if(!this._SELECTORS.includes(selector)){this._SELECTORS.push(selector)}return this._mergeSelectors()}static _remove(selector){if(typeof selector!=="string"){throw new Error(this._SELECTOR_INVALID_ERROR)}luda.except(selector,this._SELECTORS);return this._mergeSelectors()}static _mergeSelectors(){return this._selector=this._SELECTORS.join(",")}static _install(){var exposed;if(this===Singleton){return this}if(!this.hasOwnProperty("_SELECTORS")){this._SELECTORS=[]}this._mergeSelectors();if(typeof this._init==="function"){exposed=this._init()}if(exposed){return exposed}else{return this}}}Singleton._SCOPE="Singleton";Singleton._SELECTOR_INVALID_ERROR="@param selector must be a css selector string";Singleton._SELECTORS=[];Singleton._selector="";Singleton._actived=true;return Singleton}.call(this));luda(function(){var _Class;_Class=class extends luda.Singleton{static _init(){var self;self=this;return luda.on("keydown",function(e){if(self._actived&&e.keyCode===luda.KEY_ENTER&&e.target.matches(self._selector)){e.preventDefault();return setTimeout(function(){return e.target.click()})}})}};_Class._SCOPE="enterClick";_Class._SELECTORS=["input[type=checkbox]","input[type=radio]","[tabindex]"];return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Singleton{static _removeFocusClassExcept($exception){return Array.from(this._$focus).forEach($focus=>{if($focus!==$exception){return $focus.classList.remove(this._CSS_CLASS)}})}static _addFocusClassExceptHtmlAndBody($target){if($target!==document.body&&$target!==document.documentElement){return $target.classList.add(this._CSS_CLASS)}}static _changeFocusStateOnKeyEvent(e){if(this._actived){this._removeFocusClassExcept(e.target);return this._addFocusClassExceptHtmlAndBody(e.target)}}static _changeFocusStateOnMouseDownEvent(e){var target;if(this._actived){if(e.target.matches(this._PARENT_FOCUS_CHILDREN_SELECTOR)){target=luda.$parent(this._PARENT_FOCUS_SELECTOR,e.target)}else{target=e.target}if(target.matches(this._selector)){this._removeFocusClassExcept(target);return this._addFocusClassExceptHtmlAndBody(target)}else{return this._removeFocusClassExcept()}}}static _setElementPrototype(){var blur,focus,self;focus=HTMLElement.prototype.focus;blur=HTMLElement.prototype.blur;self=this;HTMLElement.prototype.focus=function(){focus.apply(this,arguments);if(self._actived&&document.activeElement===this){self._removeFocusClassExcept(this);return self._addFocusClassExceptHtmlAndBody(this)}};return HTMLElement.prototype.blur=function(){blur.apply(this,arguments);if(self._actived){return this.classList.remove(self._CSS_CLASS)}}}static _init(){this._setElementPrototype();luda.on("keydown",this._changeFocusStateOnKeyEvent.bind(this));luda.on("keyup",this._changeFocusStateOnKeyEvent.bind(this));luda.on("mousedown",this._changeFocusStateOnMouseDownEvent.bind(this));luda.on("touchstart",this._TOUCHSTART_FOCUS_SELECTOR,this._changeFocusStateOnMouseDownEvent.bind(this));return luda.on("focusin",this._changeFocusStateOnMouseDownEvent.bind(this))}};_Class._SCOPE="focus";_Class._CSS_CLASS="focus";_Class._SELECTORS=["select","textarea",":not(.btn-check):not(.btn-radio):not(.btn-file) > input:not([type=button]):not([type=submit]):not([type=reset])"];_Class._TOUCHSTART_FOCUS_SELECTOR="input[type=range]";_Class._PARENT_FOCUS_SELECTOR="select[multiple]";_Class._PARENT_FOCUS_CHILDREN_SELECTOR=`${_Class._PARENT_FOCUS_SELECTOR} *`;_Class._$focus=document.getElementsByClassName(_Class._CSS_CLASS);return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Singleton{static _querySameName$radios($radio){var $inputs,selector;if($radio.name){selector=`${this._selector}[name=${$radio.name}]`}else{selector=this._selector}$inputs=luda.$children(selector);return $inputs.filter(function($input){return $input.tabIndex>=0})}static _query$prev$next($radio){var $next,$prev,$sameNameRadios,radioIndex;$sameNameRadios=this._querySameName$radios($radio);radioIndex=$sameNameRadios.indexOf($radio);$prev=$sameNameRadios[radioIndex-1];$next=$sameNameRadios[radioIndex+1];return{$prev:$prev,$next:$next}}static _init(){var self;self=this;return luda.on("keydown",function(e){var $next,$prev;if(self._actived&&e.keyCode===luda.KEY_TAB&&e.target.nodeName.toUpperCase()==="INPUT"&&e.target.type==="radio"){if(e.shiftKey){if($prev=self._query$prev$next(e.target).$prev){e.preventDefault();return $prev.focus()}}else{if($next=self._query$prev$next(e.target).$next){e.preventDefault();return $next.focus()}}}})}};_Class._SCOPE="radioTab";_Class._SELECTORS=["input[type=radio]:not([disabled])"];return _Class}.call(this));var Component;luda(Component=function(){class Component{_hasDescendant(descendant){if(this._children.length&&descendant){if(this._children.includes(descendant)){return true}return this._children.some(function(child){return child._hasDescendant(descendant)})}else{return false}}_observe(){this._observer=new MutationObserver(this._onMutations.bind(this));return this._observer.observe(this._$component,this.constructor._observerConfig)}_disconnect(){this._observer.disconnect();return this._observer=null}static create($component){var $family,componentIsElementInstance,instance,parent;componentIsElementInstance=$component instanceof Element;if(!componentIsElementInstance){throw new Error(this._$COMPONENT_INVALID_ERROR)}$family=this._query$family($component);instance=this.query($component);if($family._$parent){if(parent=this.query($family._$parent)){if(!instance){this._instances.push(instance=this._createInstance($component))}if(instance._parent!==parent){parent._children.push(instance)&&(instance._parent=parent)}$family._$children.forEach($child=>{return this.create($child)});return instance}else{this.create($family._$parent);return this.query($component)}}else{if(!instance){this._instances.push(instance=this._createInstance($component))}$family._$children.forEach($child=>{return this.create($child)});return instance}}static destroy(instance$component){var attribute,instance,results,value;instance=this.query(instance$component);if(instance){if(instance._observer){instance._disconnect()}if(instance._destroy){instance._destroy()}while(instance._children.length){this.destroy(instance._children[0])}if(instance._parent){luda.except(instance,instance._parent._children)}luda.except(instance,this._instances);results=[];for(attribute in instance){value=instance[attribute];results.push(instance[attribute]=null)}return results}}static query(instance$component){var instance;instance=null;if(instance$component instanceof this&&this._instances.includes(instance$component)){instance=instance$component}else if(instance$component instanceof Element){this._instances.some(function(inited){if(inited._$component===instance$component){instance=inited;return true}})}return instance}static _query$family($component){var _$children,_$parent;_$parent=null;_$children=[];if(this._SELECTOR){_$parent=luda.$parent(this._SELECTOR,$component);_$children=luda.$unnested(this._SELECTOR,$component,this._SELECTOR)}return{_$parent:_$parent,_$children:_$children}}static _createInstance($component){var instance;instance=new this;instance._$component=$component;instance._parent=null;instance._children=[];instance._observer=null;if(instance._constructor){instance._constructor()}if(!(instance._observer&&instance._onMutations&&this._observerConfig)){instance._observe()}return instance}static _observe(classObj){if(!Component._observer){Component._observer=new MutationObserver(function(mutations){return mutations.forEach(function(mutation){var $addedNodes,$removedNodes;$removedNodes=Array.from(mutation.removedNodes);$addedNodes=Array.from(mutation.addedNodes);$removedNodes.forEach(function($node){if($node instanceof Element){return Component._Observed.forEach(function(Observed){var $destroies;if($node.matches(Observed._SELECTOR)){return Observed.destroy($node)}else{$destroies=luda.$children(Observed._SELECTOR,$node);return $destroies.forEach(function($destroy){return Observed.destroy($destroy)})}})}});return $addedNodes.forEach(function($node){if($node instanceof Element){return Component._Observed.forEach(function(Observed){var $creates;if($node.matches(Observed._SELECTOR)){return Observed.create($node)}else{$creates=luda.$children(Observed._SELECTOR,$node);return $creates.forEach(function($create){return Observed.create($create)})}})}})})});Component._observer.observe(document.documentElement,Component._observerConfig)}if(!Component._Observed.includes(classObj)){return Component._Observed.push(classObj)}}static _install(){var exposed,self;self=this;if(this===Component){return this}if(!(this._SELECTOR||typeof this._SELECTOR!=="string")){throw new Error(this._COMPONENT_NO_SELECTOR_ERROR)}if(!this.hasOwnProperty("_instances")){this._instances=[]}if(typeof this._init==="function"){exposed=this._init()}luda.on(luda._DOC_READY,function(){luda.$children(self._SELECTOR).forEach(function($component){return self.create($component)});return Component._observe(self)});if(exposed){return exposed}else{return this}}}Component._SCOPE="Component";Component._COMPONENT_NO_SELECTOR_ERROR="Extended component must has a css selector";Component._$COMPONENT_INVALID_ERROR="@param $component must be an instance of Element";Component._SELECTOR="";Component._instances=[];Component._Observed=[];Component._observer=null;Component._observerConfig={childList:true,subtree:true};return Component}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{_getConfig(){var _isReadonly,_originalTabIndex,readonly;readonly=this._$component.getAttribute(this.constructor._READONLY_ATTRIBUTE);_isReadonly=readonly!==this.constructor._READONLY_FALSE_VALUE;_originalTabIndex=this._$component.tabIndex;return{_isReadonly:_isReadonly,_originalTabIndex:_originalTabIndex}}_constructor(){({_isReadonly:this._isReadonly,_originalTabIndex:this._originalTabIndex}=this._getConfig());return this._setTabIndex()}_onMutations(){return this._constructor()}_setTabIndex(){if(this._isReadonly){return this._$component.tabIndex=-1}else{return this._$component.tabIndex=this._originalTabIndex}}};_Class._SCOPE="readonly";_Class._READONLY_ATTRIBUTE="data-readonly";_Class._READONLY_FALSE_VALUE="false";_Class._SELECTOR=`[${_Class._READONLY_ATTRIBUTE}]`;_Class._observerConfig={attributes:true,attributeFilter:[_Class._READONLY_ATTRIBUTE]};return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Singleton{static active(name$target){return this._query$targets(name$target).forEach($target=>{$target.classList.add(this._ACTIVE_CSS_CLASS);return luda.dispatch($target,this._ACTIVED_EVENT_TYPE)})}static deactive(name$target){return this._query$targets(name$target).forEach($target=>{$target.classList.remove(this._ACTIVE_CSS_CLASS);return luda.dispatch($target,this._DEACTIVED_EVENT_TYPE)})}static toggle(name$target){return this._query$targets(name$target).forEach($target=>{if($target.classList.contains(this._ACTIVE_CSS_CLASS)){return this.deactive($target)}else{return this.active($target)}})}static _query$targets(name$target){if(name$target instanceof Element){return[name$target]}else{return luda.$children(`[${this._TOGGLE_TARGET_ATTRIBUTE}=${name$target}]`)}}static _init(){var self;self=this;return luda.on("click",this._selector,function(e){var toggleChecked;toggleChecked=false;return luda.eventPath(e).some(function($path){var $toggle,toggleName;if($path instanceof Element){if($path.hasAttribute(self._TOGGLE_ATTRIBUTE)||$path.hasAttribute(self._TOGGLE_FOR_ATTRIBUTE)){if(toggleName=$path.getAttribute(self._TOGGLE_FOR_ATTRIBUTE)){self.toggle(toggleName);toggleChecked=true}if($path.hasAttribute(self._TOGGLE_ATTRIBUTE)){if($path.hasAttribute(self._TOGGLE_TARGET_ATTRIBUTE)){$toggle=$path}else{$toggle=luda.$parent(`[${self._TOGGLE_TARGET_ATTRIBUTE}]`,$path)}if($toggle){self.toggle($toggle);return toggleChecked=true}}}else if($path.hasAttribute(self._NONE_TOGGLE_ATTRIBUTE)){return toggleChecked=true}}})})}};_Class._SCOPE="toggle";_Class._TOGGLE_TARGET_ATTRIBUTE="data-toggle-target";_Class._TOGGLE_ATTRIBUTE="data-toggle";_Class._TOGGLE_FOR_ATTRIBUTE="data-toggle-for";_Class._NONE_TOGGLE_ATTRIBUTE="data-none-toggle";_Class._ACTIVE_CSS_CLASS="toggle-active";_Class._SELECTORS=[`[${_Class._TOGGLE_FOR_ATTRIBUTE}]`,`[${_Class._TOGGLE_ATTRIBUTE}]`];_Class._ACTIVED_EVENT_TYPE=`${_Class._SCOPE}:actived`;_Class._DEACTIVED_EVENT_TYPE=`${_Class._SCOPE}:deactived`;return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{_getConfig(){var _$file,_$simulator;_$file=luda.$child(this.constructor._FILE_SELECTOR,this._$component);_$simulator=luda.$child(this.constructor._SIMULATOR_SELECTOR,this._$component);return{_$file:_$file,_$simulator:_$simulator}}_constructor(){({_$file:this._$file,_$simulator:this._$simulator}=this._getConfig());return this._init()}_onMutations(){return this._constructor()}_insertSimulator(){this._$simulator=document.createElement("input");this._$simulator.tabIndex=-1;return luda.$after(this._$simulator,this._$file)}_setPlaceholderValue(){return this._$simulator.placeholder=this._$file.getAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)}_setSimulatorValue(){var values;values=[];Array.from(this._$file.files).map(function(file){return values.push(file.name)});if(values.length){return this._$simulator.value=values.join(this.constructor._VALUE_SPLITOR)}else if(this._$file.hasAttribute(this.constructor._VALUE_ATTRIBUTE)){return this._$simulator.value=this._$file.getAttribute(this.constructor._VALUE_ATTRIBUTE)}}_init(){if(this._$file){if(!this._$simulator){this._insertSimulator()}if(this._$file.hasAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)){this._setPlaceholderValue()}return this._setSimulatorValue()}}static _init(){var self;self=this;luda.on("change",`${this._SELECTOR} ${this._FILE_SELECTOR}`,function(e){return self.query(luda.$parent(self._SELECTOR,this))._setSimulatorValue()});return luda.on(luda._FORM_RESET,this._SELECTOR,function(e){return setTimeout(()=>{return self.query(this)._setSimulatorValue()})})}};_Class._SCOPE="fmFile";_Class._VALUE_SPLITOR=" ";_Class._SELECTOR=".fm-file";_Class._FILE_SELECTOR="input[type=file]";_Class._SIMULATOR_SELECTOR="input:not([type=file])";_Class._PLACEHOLDER_ATTRIBUTE="placeholder";_Class._VALUE_ATTRIBUTE="value";_Class._observerConfig={childList:true,subtree:true};return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{select(indexOrIndexArray){var selectedIndexes;if(this._$select.multiple){if(this._$multipleSelectPlaceholder){selectedIndexes=indexOrIndexArray}else{selectedIndexes=indexOrIndexArray.map(function(index){return index+1})}Array.from(this._$select.options).forEach(function($option,index){return $option.selected=selectedIndexes.includes(index)});return this._markSelectedOption()}else{this._$select.selectedIndex=selectedIndex;this._setSingleSelectSimulatorValue();return this._markSelectedOption()}}_getConfig(){var _$defaultSelectedOptions,_$multipleSelectPlaceholder,_$select,_$singleSelectSimulator,_defaultSelectedOptionMarked;_$select=luda.$child(this.constructor._SELECT_SELECTOR,this._$component);_$singleSelectSimulator=luda.$child(this.constructor._SINGLE_SELECT_SIMULATOR_SELECTOR,this._$component);_$multipleSelectPlaceholder=luda.$child(`.${this.constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS}`,this._$component);_$defaultSelectedOptions=luda.$children(`[${this.constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE}]`,this._$component);_defaultSelectedOptionMarked=this._$component.hasAttribute(this.constructor._INITED_ATTRIBUTE);return{_$select:_$select,_$singleSelectSimulator:_$singleSelectSimulator,_$multipleSelectPlaceholder:_$multipleSelectPlaceholder,_$defaultSelectedOptions:_$defaultSelectedOptions,_defaultSelectedOptionMarked:_defaultSelectedOptionMarked}}_constructor(){({_$select:this._$select,_$singleSelectSimulator:this._$singleSelectSimulator,_$multipleSelectPlaceholder:this._$multipleSelectPlaceholder,_$defaultSelectedOptions:this._$defaultSelectedOptions,_defaultSelectedOptionMarked:this._defaultSelectedOptionMarked}=this._getConfig());if(this._$select){if(this._$select.multiple){return this._initMultipleSelect()}else{return this._initSingleSelect()}}}_onMutations(){return this._constructor()}_markSelectedOption(){if(this._observer){this._disconnect()}Array.from(this._$select.options).forEach(function($option){if($option.selected){return $option.setAttribute("selected","selected")}else{return $option.removeAttribute("selected")}});if(!this._observer){return this._observe()}}_markDefaultSelectedOption(){this._$component.setAttribute(this.constructor._INITED_ATTRIBUTE,"");return Array.from(this._$select.options).forEach($option=>{if($option.selected){return $option.setAttribute(this.constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE,"")}})}_setSingleSelectedDefaultSelectedOption(){var hasSelected;hasSelected=Array.from(this._$select.options).some(function($option){return $option.getAttribute("selected")==="selected"});if(!hasSelected){return this._$select.selectedIndex=-1}}_insertSingleSelectSimulator(){this._$singleSelectSimulator=document.createElement("input");this._$singleSelectSimulator.tabIndex=-1;return luda.$after(this._$singleSelectSimulator,this._$select)}_setSingleSelectPlaceholderValue(){return this._$singleSelectSimulator.placeholder=this._$select.getAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)}_setSingleSelectSimulatorValue(){var $selectedOption;if($selectedOption=this._$select.options[this._$select.selectedIndex]){return this._$singleSelectSimulator.value=$selectedOption.innerText}else{return this._$singleSelectSimulator.value=""}}_initSingleSelect(){if(!this._$singleSelectSimulator){this._insertSingleSelectSimulator()}if(this._$select.hasAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)){this._setSingleSelectedDefaultSelectedOption();this._setSingleSelectPlaceholderValue()}if(!this._defaultSelectedOptionMarked){this._markDefaultSelectedOption()}this._setSingleSelectSimulatorValue();return this._markSelectedOption()}_insertMultipleSelectBlankOption(){this._$multipleSelectPlaceholder=document.createElement("option");this._$multipleSelectPlaceholder.className=this.constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS;this._$multipleSelectPlaceholder.disabled=true;return luda.$prepend(this._$multipleSelectPlaceholder,this._$select)}_setMultipleSelectPlaceholderValue(){return this._$multipleSelectPlaceholder.innerText=this._$select.getAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)}_initMultipleSelect(){if(!this._$multipleSelectPlaceholder){if(this._$select.hasAttribute(this.constructor._PLACEHOLDER_ATTRIBUTE)){this._insertMultipleSelectBlankOption();this._setMultipleSelectPlaceholderValue()}}if(!this._defaultSelectedOptionMarked){return this._markDefaultSelectedOption()}}_reset(){if(this._$select){Array.from(this._$select.options).forEach($option=>{return $option.selected=this._$defaultSelectedOptions.includes($option)});if(!this._$select.multiple){this._setSingleSelectSimulatorValue()}return this._markSelectedOption()}}static _init(){var self;self=this;luda.on("change",`${this._SELECTOR} ${this._SELECT_SELECTOR}`,function(e){var instance;instance=self.query(luda.$parent(self._SELECTOR,this));if(!this.multiple){instance._setSingleSelectSimulatorValue()}return instance._markSelectedOption()});return luda.on(luda._FORM_RESET,this._SELECTOR,function(e){return setTimeout(()=>{return self.query(this)._reset()})})}};_Class._SCOPE="fmSelect";_Class._SELECTOR=".fm-select";_Class._SELECT_SELECTOR="select";_Class._SINGLE_SELECT_SIMULATOR_SELECTOR="input";_Class._PLACEHOLDER_ATTRIBUTE="placeholder";_Class._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS="fm-select-multiple-placeholder";_Class._DEFAULT_SELECTED_OPTION_ATTRIBUTE="data-fm-select-default-selected";_Class._INITED_ATTRIBUTE="data-fm-select-inited";_Class._observerConfig={childList:true,attributes:true,subtree:true,attributeFilter:["selected"]};return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{active(index){var action,activedIndex;if(this._$items.length&&!this._transiting){activedIndex=this._activeIndex;if(index!=null&&index!==this._activeIndex&&(0<=index&&index<=this._$items.length-1)){this._transiting=true;this._activeIndex=index;action=index<activedIndex?"_slidePrev":"_slideNext";return this[action](this._$items[activedIndex],activedIndex)}}}next(){var activedIndex,index;if(this._$items.length&&!this._transiting){activedIndex=this._activeIndex;index=activedIndex+1;if(index>this._$items.length-1){if(!this._wrap){return}index=0}this._transiting=true;this._activeIndex=index;this._slideNext(this._$items[activedIndex],activedIndex);this._playTimeStamp=Date.now();return this._pausedRemainTime=this._interval}}prev(){var activedIndex,index;if(this._$items.length&&!this._transiting){activedIndex=this._activeIndex;index=activedIndex-1;if(index<0){if(!this._wrap){return}index=this._$items.length-1}this._transiting=true;this._activeIndex=index;this._slidePrev(this._$items[activedIndex],activedIndex);this._playTimeStamp=Date.now();return this._pausedRemainTime=this._interval}}pause(){if(this._intervaling!=null){clearInterval(this._intervaling);this._intervaling=null;return this._pausedRemainTime=this._pausedRemainTime-(Date.now()-this._playTimeStamp)}}play(){var execute;if(this._interval&&this._$items.length>1){this._playTimeStamp=Date.now();this.pause();execute=(()=>{this.next();return this._intervaling=setInterval(this.next.bind(this),this._interval)});return this._intervaling=setTimeout(execute,this._pausedRemainTime)}}_getConfig(){var _$indicators,_$items,_$nextControl,_$prevControl,_activeIndex,_interval,_wrap;_$items=luda.$unnested(this.constructor._ITEMS_SELECTOR,this._$component,this.constructor._SELECTOR);_$indicators=luda.$unnested(this.constructor._INDICATORS_SELECTOR,this._$component,this.constructor._SELECTOR);_$prevControl=luda.$child(this.constructor._PREV_CONTROL_SELECTOR,this._$component);_$nextControl=luda.$child(this.constructor._NEXT_CONTROL_SELECTOR,this._$component);_activeIndex=_$items.indexOf(luda.$child(`.${this.constructor._ITEM_ACTIVE_CSS_CLASS}`,this._$component));if(_activeIndex===-1){_activeIndex=this.constructor._ACTIVE_INDEX}_interval=this._$component.getAttribute(this.constructor._INTERVAL_ATTRIBUTE);if(_interval===this.constructor._FALSE){_interval=false}else{_interval=Math.abs(parseInt(_interval,10))||this.constructor._INTERVAL}_wrap=this._$component.getAttribute(this.constructor._WRAP_ATTRIBUTE);_wrap=_wrap===this.constructor._FALSE?false:this.constructor._WRAP;return{_$items:_$items,_$indicators:_$indicators,_$prevControl:_$prevControl,_$nextControl:_$nextControl,_activeIndex:_activeIndex,_interval:_interval,_wrap:_wrap}}_constructor(){({_$items:this._$items,_$indicators:this._$indicators,_$prevControl:this._$prevControl,_$nextControl:this._$nextControl,_activeIndex:this._activeIndex,_interval:this._interval,_wrap:this._wrap}=this._getConfig());this._transiting=false;this._intervaling=null;this._playTimeStamp=0;this._pausedRemainTime=this._interval;this._layout();return this.play()}_onMutations(mutations){({_$items:this._$items,_$indicators:this._$indicators,_$prevControl:this._$prevControl,_$nextControl:this._$nextControl,_activeIndex:this._activeIndex,_interval:this._interval,_wrap:this._wrap}=this._getConfig());this._setIndicatorsState();this._setDirectionControlState();return this.play()}_destroy(){return this.pause()}_layout(){this._$items.forEach(($item,index)=>{$item.style.transition="none";if(index>this._activeIndex){$item.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS)}else if(index<this._activeIndex){$item.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS)}else{luda.dispatch($item,this.constructor._ACTIVED_EVENT_TYPE,index);$item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);$item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS)}luda.reflow($item);return $item.style.transition=""});this._setIndicatorsState();return this._setDirectionControlState()}_slideNext($activedItem,activedIndex){var $item;if(this._$items.length>1){$item=this._$items[this._activeIndex];luda.dispatch($item,this.constructor._ACTIVE_EVENT_TYPE,this._activeIndex);$item.style.transition="none";$item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);$item.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);luda.reflow($item);$item.style.transition="";$item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);$item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);luda.dispatch($activedItem,this.constructor._DEACTIVE_EVENT_TYPE,activedIndex);$activedItem.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);$activedItem.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);this._setIndicatorsState();return this._setDirectionControlState()}}_slidePrev($activedItem,activedIndex){var $item;if(this._$items.length>1){$item=this._$items[this._activeIndex];luda.dispatch($item,this.constructor._ACTIVE_EVENT_TYPE,this._activeIndex);$item.style.transition="none";$item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);$item.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);luda.reflow($item);$item.style.transition="";$item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);$item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);luda.dispatch($activedItem,this.constructor._DEACTIVE_EVENT_TYPE,activedIndex);$activedItem.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);$activedItem.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);this._setIndicatorsState();return this._setDirectionControlState()}}_setIndicatorsState(){return this._$indicators.forEach(($indicator,index)=>{return $indicator.disabled=index===this._activeIndex})}_setDirectionControlState(){var ref,ref1,ref2,ref3;if(this._$items.length<=1){return(ref=this._$prevControl)!=null?ref.disabled=(ref1=this._$nextControl)!=null?ref1.disabled=true:void 0:void 0}else{if((ref2=this._$prevControl)!=null){ref2.disabled=this._activeIndex===0&&!this._wrap}return(ref3=this._$nextControl)!=null?ref3.disabled=this._activeIndex===this._$items.length-1&&!this._wrap:void 0}}static _init(){var self;self=this;luda.on("transitionend",this._ITEMS_SELECTOR,function(e){var index,instance;instance=self.query(luda.$parent(self._SELECTOR,this));instance._transiting=false;index=instance._$items.indexOf(this);if(this.classList.contains(self._ITEM_ACTIVE_CSS_CLASS)){return luda.dispatch(this,self._ACTIVED_EVENT_TYPE,index)}else{return luda.dispatch(this,self._DEACTIVED_EVENT_TYPE,index)}});luda.on("click",this._INDICATORS_SELECTOR,function(e){var instance;instance=self.query(luda.$parent(self._SELECTOR,this));return instance.active(instance._$indicators.indexOf(this))});luda.on("touchstart",this._SELECTOR,function(e){return self.query(this).pause()});luda.on("touchend",this._SELECTOR,function(e){return setTimeout(()=>{return self.query(this).play()})});luda.on("mouseover",this._SELECTOR,function(e){return self.query(this).pause()});luda.on("mouseout",this._SELECTOR,function(e){return self.query(this).play()});luda.on(luda._SWIPE_LEFT_OR_UP,this._SELECTOR,function(startE,e){return self.query(this).next()});luda.on(luda._SWIPE_RIGHT_OR_DOWN,this._SELECTOR,function(startE,e){return self.query(this).prev()});luda.on("click",this._PREV_CONTROL_SELECTOR,function(e){return self.query(luda.$parent(self._SELECTOR,this)).prev()});return luda.on("click",this._NEXT_CONTROL_SELECTOR,function(e){return self.query(luda.$parent(self._SELECTOR,this)).next()})}};_Class._SCOPE="carousel";_Class._SELECTOR=".carousel";_Class._ITEMS_SELECTOR=".carousel-item";_Class._PREV_CONTROL_SELECTOR=".carousel-prev";_Class._NEXT_CONTROL_SELECTOR=".carousel-next";_Class._INDICATORS_SELECTOR=".carousel-indicators .btn";_Class._INTERVAL_ATTRIBUTE="data-carousel-interval";_Class._WRAP_ATTRIBUTE="data-carousel-wrap";_Class._ITEM_ACTIVE_CSS_CLASS="carousel-item-active";_Class._ITEM_NEXT_CSS_CLASS="carousel-item-next";_Class._ITEM_PREV_CSS_CLASS="carousel-item-prev";_Class._ACTIVE_INDEX=0;_Class._INTERVAL=5e3;_Class._WRAP=true;_Class._FALSE="false";_Class._ACTIVE_EVENT_TYPE=`${_Class._SCOPE}:active`;_Class._ACTIVED_EVENT_TYPE=`${_Class._SCOPE}:actived`;_Class._DEACTIVE_EVENT_TYPE=`${_Class._SCOPE}:deactive`;_Class._DEACTIVED_EVENT_TYPE=`${_Class._SCOPE}:deactived`;_Class._observerConfig={childList:true,attributes:true,subtree:true,attributeFilter:[_Class._INTERVAL_ATTRIBUTE,_Class._WRAP_ATTRIBUTE]};return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{active(){var ref;if(!this._actived()){this._$component.classList.add(this.constructor._ACTIVE_CSS_CLASS);this.constructor._$focused.push(document.activeElement);if((ref=this._parent)!=null){ref.active()}return luda.dispatch(this._$component,this.constructor._ACTIVED_EVENT_TYPE)}}deactive(focus){var ref;if(this._actived()){this._$component.classList.remove(this.constructor._ACTIVE_CSS_CLASS);this._children.forEach(function(child){return child.deactive()});if(focus){if((ref=this.constructor._$focused[this.constructor._$focused.length-1])!=null){ref.focus()}}this.constructor._$focused.splice(this.constructor._$focused.length-1,1);return luda.dispatch(this._$component,this.constructor._DEACTIVED_EVENT_TYPE)}}toggle(focus){if(this._actived()){return this.deactive(focus)}else{return this.active()}}prev(){var focusIndex;if(this._$items.length&&this._actived()){focusIndex=this._$items.indexOf(document.activeElement)-1;if(focusIndex<0){focusIndex=0}return this._$items[focusIndex].focus()}}next(){var focusIndex;if(this._$items.length&&this._actived()){focusIndex=this._$items.indexOf(document.activeElement)+1;if(focusIndex>this._$items.length-1){focusIndex=this._$items.length-1}return this._$items[focusIndex].focus()}}_getConfig(){var _$items,_$menu,_$noneSwitches,_$switches,_isStandalone;_$menu=luda.$child(this.constructor._MENU_SELECTOR,this._$component);_$switches=luda.$unnested(this.constructor._SWITCHES_SELECTOR,this._$component,this.constructor._SELECTOR).concat(luda.$unnested(this.constructor._SWITCHES_SELECTOR,_$menu,this.constructor._MENU_SELECTOR));_$noneSwitches=luda.$unnested(this.constructor._NONE_SWITCHES_SELECTOR,this._$component,this.constructor._SELECTOR).concat(luda.$unnested(this.constructor._NONE_SWITCHES_SELECTOR,_$menu,this.constructor._MENU_SELECTOR));_$items=luda.$unnested(this.constructor._ITEMS_SELECTOR,_$menu,this.constructor._MENU_SELECTOR);_isStandalone=this._$component.hasAttribute(this.constructor._STANDALONE_ATTRIBUTE);return{_$items:_$items,_$switches:_$switches,_$noneSwitches:_$noneSwitches,_isStandalone:_isStandalone}}_constructor(){return({_$items:this._$items,_$switches:this._$switches,_$noneSwitches:this._$noneSwitches,_isStandalone:this._isStandalone}=this._getConfig())}_onMutations(mutations){return this._constructor()}_actived(){return this._$component.classList.contains(this.constructor._ACTIVE_CSS_CLASS)}_deactiveChildrenExcept(exceptions){if(exceptions&&!(exceptions instanceof Array)){exceptions=[exceptions]}if(exceptions){return this._children.forEach(function(child){if(child._actived()&&!exceptions.includes(child)){return child.deactive()}})}else{return this._children.forEach(function(child){if(child._actived()){return child.deactive()}})}}static deactiveExcept(instances$dropdowns){var exceptions;exceptions=[];if(instances$dropdowns&&!(instances$dropdowns instanceof Array)){instances$dropdowns=[instances$dropdowns]}if(instances$dropdowns){instances$dropdowns.forEach(instance$dropdown=>{var exception;if(exception=this.query(instance$dropdown)){return exceptions.push(exception)}})}if(exceptions.length){return this._instances.forEach(function(instance){var instanceHasntExceptionChild,instanceIsntInExceptions;instanceIsntInExceptions=!exceptions.includes(instance);instanceHasntExceptionChild=exceptions.every(function(exception){return!instance._hasDescendant(exception)});if(instance._actived()&&instanceIsntInExceptions&&instanceHasntExceptionChild){return instance.deactive()}})}else{return this._instances.forEach(function(instance){if(instance._actived()){return instance.deactive()}})}}static _standaloneInstances(){return this._instances.filter(function(instance){if(instance._isStandalone){return instance}})}static _init(){var self;self=this;luda.onOpposite("click",this._SELECTOR,function(e){return self.deactiveExcept(self._standaloneInstances())});luda.on("click",this._SELECTOR,function(e){var focus,instance,toggleChecked;if(instance=self.query(this)){toggleChecked=false;focus=!e.detail;self.deactiveExcept(self._standaloneInstances().concat(instance));instance._deactiveChildrenExcept();if(instance._parent){instance._parent._deactiveChildrenExcept(instance)}if(instance._$switches.length||instance._$noneSwitches.length){luda.eventPath(e).some(function($path){if(instance._$switches.includes($path)){instance.toggle(focus);return toggleChecked=true}else if(instance._$noneSwitches.includes($path)){return toggleChecked=true}})}if(!toggleChecked){return instance.toggle(focus)}}});luda.onOpposite("keyup",this._SELECTOR,function(e){return self.deactiveExcept()});luda.on("keyup",this._SELECTOR,function(e){var instance;if(e.keyCode===luda.KEY_TAB&&(instance=self.query(this))){self.deactiveExcept(instance);return instance.active()}});luda.on("keydown",this._SELECTOR,function(e){var instance,ref;if(e.keyCode===luda.KEY_ESC&&(instance=self.query(this))){e.preventDefault();if(instance._actived()){return instance.deactive(true)}else{return(ref=instance._parent)!=null?ref.deactive(true):void 0}}});return luda.on("keydown",this._SELECTOR,function(e){var instance,ref,ref1;if([luda.KEY_LEFT,luda.KEY_UP].includes(e.keyCode)&&(instance=self.query(this))){e.preventDefault();if(instance._actived()){return instance.prev()}else{return(ref=instance._parent)!=null?ref.prev():void 0}}else if([luda.KEY_RIGHT,luda.KEY_DOWN].includes(e.keyCode)&&(instance=self.query(this))){e.preventDefault();if(instance._actived()){return instance.next()}else{return(ref1=instance._parent)!=null?ref1.next():void 0}}})}};_Class._SCOPE="dropdown";_Class._SELECTOR=".dropdown-fixed,.dropdown-absolute, .dropdown-static,.dropdown-absolute-m";_Class._MENU_SELECTOR=".dropdown-menu";_Class._ITEMS_SELECTOR="a[href]:not([disabled]),button:not([disabled]), input:not([disabled]),[tabindex]:not([disabled])";_Class._TOGGLE_ATTRIBUTE="data-dropdown-toggle";_Class._NONE_TOGGLE_ATTRIBUTE="data-dropdown-none-toggle";_Class._STANDALONE_ATTRIBUTE="data-dropdown-standalone";_Class._SWITCHES_SELECTOR=`[${_Class._TOGGLE_ATTRIBUTE}]`;_Class._NONE_SWITCHES_SELECTOR=`[${_Class._NONE_TOGGLE_ATTRIBUTE}]`;_Class._ACTIVE_CSS_CLASS="dropdown-active";_Class._ACTIVED_EVENT_TYPE=`${_Class._SCOPE}:actived`;_Class._DEACTIVED_EVENT_TYPE=`${_Class._SCOPE}:deactived`;_Class._observerConfig={childList:true,attributes:true,subtree:true,attributeFilter:[_Class._TOGGLE_ATTRIBUTE,_Class._NONE_TOGGLE_ATTRIBUTE,_Class._STANDALONE_ATTRIBUTE]};_Class._$focused=[];return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{_getConfig(){var _$defaultValues,_$valueHolder,_$values;_$values=luda.$children(this.constructor._VALUE_SELECTOR,this._$component);_$defaultValues=luda.$children(this.constructor._DEFAULT_VALUE_SELECTOR,this._$component);_$valueHolder=luda.$child(this.constructor._VALUE_HOLDER_SELECTOR,this._$component);return{_$values:_$values,_$valueHolder:_$valueHolder,_$defaultValues:_$defaultValues}}_constructor(){({_$values:this._$values,_$valueHolder:this._$valueHolder,_$defaultValues:this._$defaultValues}=this._getConfig());this._setValueHolderAttribute();return this._setValueHolderValue()}_onMutations(){return this._constructor()}_setValueHolderValue(){var values;values=[];this._$values.forEach(($value,index)=>{var value;if($value.checked){if($value.hasAttribute(this.constructor._VALUE_ATTRIBUTE)){value=$value.getAttribute(this.constructor._VALUE_ATTRIBUTE)}else{value=this._$defaultValues[index].innerText}}if(value&&!values.includes(value)){return values.push(value)}});if(this._$valueHolder){return this._$valueHolder.value=values.join(this.constructor._VALUE_SPLITOR)}}_setValueHolderAttribute(){if(this._$valueHolder){return this._$valueHolder.setAttribute("readonly","")}}static _init(){var self;self=this;luda.enterClick._add(this._ENTER_CLICK_VALUE_HOLDER_SELECTOR);luda.on("change",`${this._SELECTOR} ${this._VALUE_SELECTOR}`,function(e){return self.query(luda.$parent(self._SELECTOR,this))._setValueHolderValue()});luda.on(luda._FORM_RESET,this._SELECTOR,function(e){return setTimeout(()=>{return self.query(this)._setValueHolderValue()})});if(/iphone/i.test(navigator.userAgent)||/ipad/i.test(navigator.userAgent)){return luda.on("focusin",this._ENTER_CLICK_VALUE_HOLDER_SELECTOR,function(e){this.blur();return this.classList.add(luda.focus._CSS_CLASS)})}}};_Class._SCOPE="fmDropdown";_Class._SELECTOR=".fm-dropdown";_Class._VALUE_SPLITOR=" ";_Class._VALUE_ATTRIBUTE="data-fm-dropdown-value";_Class._VALUE_SELECTOR=".dropdown-items .btn-radio input, .dropdown-items .btn-check input";_Class._DEFAULT_VALUE_SELECTOR=".dropdown-items .btn-radio label, .dropdown-items .btn-check label";_Class._VALUE_HOLDER_SELECTOR=".fm input";_Class._ENTER_CLICK_VALUE_HOLDER_SELECTOR=".fm-dropdown .fm input";_Class._observerConfig={childList:true,attributes:true,subtree:true,attributeFilter:["checked",_Class._VALUE_ATTRIBUTE]};return _Class}.call(this));luda(function(){var _Class;_Class=class extends luda.Component{active(index){var activedIndex;if(this._$panes.length){activedIndex=this._activeIndex;if(index!=null&&index!==this._activeIndex&&(0<=index&&index<=this._$panes.length-1)){this._activeIndex=index;return this._active(activedIndex)}}}_getConfig(){var _$indicators,_$panes,_activeIndex;_$panes=luda.$unnested(this.constructor._PANE_SELECTOR,this._$component,this.constructor._SELECTOR);_$indicators=luda.$unnested(this.constructor._INDICATOR_SELECTOR,this._$component,this.constructor._SELECTOR);_activeIndex=this.constructor._ACTIVE_INDEX;_$indicators.some(function($indicator,index){if($indicator.checked){_activeIndex=index;return true}});return{_$panes:_$panes,_$indicators:_$indicators,_activeIndex:_activeIndex}}_constructor(){({_$panes:this._$panes,_$indicators:this._$indicators,_activeIndex:this._activeIndex}=this._getConfig());return this._active()}_onMutations(mutations){return this._constructor()}_active(activedIndex){this._$panes.forEach(($pane,index)=>{if(index===this._activeIndex){$pane.classList.add(this.constructor._PANE_ACTIVE_CSS_CLASS);return luda.dispatch($pane,this.constructor._ACTIVED_EVENT_TYPE,index)}else{$pane.classList.remove(this.constructor._PANE_ACTIVE_CSS_CLASS);if(index===activedIndex){return luda.dispatch($pane,this.constructor._DEACTIVED_EVENT_TYPE,index)}}});return this._setIndicatorsState()}_setIndicatorsState(){return this._$indicators.forEach(($indicator,index)=>{if(index===this._activeIndex){return $indicator.setAttribute("checked","")}else{return $indicator.removeAttribute("checked")}})}static _init(){var self;self=this;return luda.on("change",this._INDICATOR_SELECTOR,function(e){var instance;if(this.checked){instance=self.query(luda.$parent(self._SELECTOR,this));return instance.active(instance._$indicators.indexOf(this))}})}};_Class._SCOPE="tab";_Class._SELECTOR=".tab";_Class._PANE_SELECTOR=".tab-pane";_Class._INDICATOR_SELECTOR=".tab-indicators .btn-radio input[type=radio]";_Class._PANE_ACTIVE_CSS_CLASS="tab-pane-active";_Class._ACTIVE_INDEX=0;_Class._ACTIVED_EVENT_TYPE=`${_Class._SCOPE}:actived`;_Class._DEACTIVED_EVENT_TYPE=`${_Class._SCOPE}:deactived`;_Class._observerConfig={childList:true,subtree:true};return _Class}.call(this))});
7
+ //# sourceMappingURL=luda.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/coffee/install.coffee","../../src/coffee/constants.coffee","../../src/coffee/dom.coffee","../../src/coffee/event.coffee","../../src/coffee/utilities.coffee","../../src/coffee/singleton.coffee","../../src/coffee/behaviours/enter-click.coffee","../../src/coffee/behaviours/focus.coffee","../../src/coffee/behaviours/radio-tab.coffee","../../src/coffee/component.coffee","../../src/coffee/behaviours/readonly.coffee","../../src/coffee/behaviours/toggle.coffee","../../src/coffee/elements/form-file.coffee","../../src/coffee/elements/form-select.coffee","../../src/coffee/collections/carousel.coffee","../../src/coffee/collections/dropdown.coffee","../../src/coffee/collections/form-dropdown.coffee","../../src/coffee/collections/tab.coffee"],"names":["ENV","document","window","global","Error","luda","installer","installed","name","property","includes","hasOwnProperty","_SCOPE","_install","Array","namespace","installedInstaller","installedName","ref","console","warn","KEY_LEFT","KEY_UP","KEY_RIGHT","KEY_DOWN","KEY_TAB","KEY_ESC","KEY_ENTER","$child","selector","$ancestor","querySelector","$children","$descendant","descendants","this","from","querySelectorAll","$unnested","ancestorSelector","filter","$parent","parentNode","matches","$parents","_ancestors","push","$after","$node","$target","lastChild","appendChild","insertBefore","nextSibling","$prepend","firstChild","reflow","$element","offsetHeight","splice","_SWIPE_DISTANCE","_EVENT_TYPE_PREFIX","_SWIPE_LEFT","_SWIPE_RIGHT","_SWIPE_UP","_SWIPE_DOWN","_SWIPE_LEFT_OR_UP","_SWIPE_RIGHT_OR_DOWN","_DOC_READY","_FORM_RESET","eventPath","event","path","composedPath","target","concat","on","handler","call","_onDocReady","_onReset","_onSwipe","_on","onOpposite","_self","addEventListener","e","trigger","every","dispatch","type","detail","options","evt","bubbles","cancelable","composed","Event","dispatchEvent","readyState","forEach","bind","$touchStartElement","touchStartE","touchStartX","touchStartY","watch","touches","length","screenX","screenY","some","eventX","eventXOrY","eventY","touchDistanceX","touchDistanceY","Math","abs","except","element","arr","indexOf","Singleton","[object Object]","_actived","_SELECTOR_INVALID_ERROR","_SELECTORS","_mergeSelectors","_selector","join","exposed","_init","self","keyCode","preventDefault","setTimeout","click","_Class","$exception","_$focus","$focus","classList","remove","_CSS_CLASS","body","documentElement","add","_removeFocusClassExcept","_addFocusClassExceptHtmlAndBody","_PARENT_FOCUS_CHILDREN_SELECTOR","_PARENT_FOCUS_SELECTOR","blur","focus","HTMLElement","prototype","apply","arguments","activeElement","_setElementPrototype","_changeFocusStateOnKeyEvent","_changeFocusStateOnMouseDownEvent","_TOUCHSTART_FOCUS_SELECTOR","getElementsByClassName","$radio","$inputs","$input","tabIndex","$next","$prev","$sameNameRadios","radioIndex","_querySameName$radios","nodeName","toUpperCase","shiftKey","_query$prev$next","Component","descendant","_children","child","_hasDescendant","_observer","MutationObserver","_onMutations","observe","_$component","constructor","_observerConfig","disconnect","$component","$family","componentIsElementInstance","instance","parent","Element","_$COMPONENT_INVALID_ERROR","_query$family","query","_$parent","_instances","_createInstance","_parent","_$children","create","instance$component","attribute","results","value","_disconnect","_destroy","destroy","inited","_SELECTOR","_constructor","_observe","classObj","mutations","mutation","$addedNodes","$removedNodes","removedNodes","addedNodes","_Observed","Observed","$destroies","$destroy","$creates","$create","_COMPONENT_NO_SELECTOR_ERROR","childList","subtree","_isReadonly","_originalTabIndex","readonly","getAttribute","_READONLY_ATTRIBUTE","_READONLY_FALSE_VALUE","_getConfig","_setTabIndex","attributes","attributeFilter","name$target","_query$targets","_ACTIVE_CSS_CLASS","_ACTIVED_EVENT_TYPE","_DEACTIVED_EVENT_TYPE","contains","deactive","active","_TOGGLE_TARGET_ATTRIBUTE","toggleChecked","$path","$toggle","toggleName","hasAttribute","_TOGGLE_ATTRIBUTE","_TOGGLE_FOR_ATTRIBUTE","toggle","_NONE_TOGGLE_ATTRIBUTE","_$file","_$simulator","_FILE_SELECTOR","_SIMULATOR_SELECTOR","createElement","placeholder","_PLACEHOLDER_ATTRIBUTE","values","files","map","file","_VALUE_SPLITOR","_VALUE_ATTRIBUTE","_insertSimulator","_setPlaceholderValue","_setSimulatorValue","indexOrIndexArray","selectedIndexes","_$select","multiple","_$multipleSelectPlaceholder","index","$option","selected","_markSelectedOption","selectedIndex","_setSingleSelectSimulatorValue","_$defaultSelectedOptions","_$singleSelectSimulator","_defaultSelectedOptionMarked","_SELECT_SELECTOR","_SINGLE_SELECT_SIMULATOR_SELECTOR","_MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS","_DEFAULT_SELECTED_OPTION_ATTRIBUTE","_INITED_ATTRIBUTE","_initMultipleSelect","_initSingleSelect","setAttribute","removeAttribute","hasSelected","$selectedOption","innerText","_insertSingleSelectSimulator","_setSingleSelectedDefaultSelectedOption","_setSingleSelectPlaceholderValue","_markDefaultSelectedOption","className","disabled","_insertMultipleSelectBlankOption","_setMultipleSelectPlaceholderValue","_reset","action","activedIndex","_$items","_transiting","_activeIndex","_wrap","_slideNext","_playTimeStamp","Date","now","_pausedRemainTime","_interval","_slidePrev","_intervaling","clearInterval","execute","pause","next","setInterval","_$indicators","_$nextControl","_$prevControl","_ITEMS_SELECTOR","_INDICATORS_SELECTOR","_PREV_CONTROL_SELECTOR","_NEXT_CONTROL_SELECTOR","_ITEM_ACTIVE_CSS_CLASS","_ACTIVE_INDEX","_INTERVAL_ATTRIBUTE","_FALSE","parseInt","_INTERVAL","_WRAP_ATTRIBUTE","_WRAP","_layout","play","_setIndicatorsState","_setDirectionControlState","$item","style","transition","_ITEM_NEXT_CSS_CLASS","_ITEM_PREV_CSS_CLASS","$activedItem","_ACTIVE_EVENT_TYPE","_DEACTIVE_EVENT_TYPE","$indicator","ref1","ref2","ref3","startE","prev","_$focused","focusIndex","_$menu","_$noneSwitches","_$switches","_isStandalone","_MENU_SELECTOR","_SWITCHES_SELECTOR","_NONE_SWITCHES_SELECTOR","_STANDALONE_ATTRIBUTE","exceptions","instances$dropdowns","instance$dropdown","exception","instanceHasntExceptionChild","instanceIsntInExceptions","deactiveExcept","_standaloneInstances","_deactiveChildrenExcept","_$defaultValues","_$valueHolder","_$values","_VALUE_SELECTOR","_DEFAULT_VALUE_SELECTOR","_VALUE_HOLDER_SELECTOR","_setValueHolderAttribute","_setValueHolderValue","$value","checked","enterClick","_add","_ENTER_CLICK_VALUE_HOLDER_SELECTOR","test","navigator","userAgent","_$panes","_active","_PANE_SELECTOR","_INDICATOR_SELECTOR","$pane","_PANE_ACTIVE_CSS_CLASS"],"mappings":";;;;;2LAAA,IAAAA,IAAAA,IAAM,WACJ,UAAUC,WAAc,YAAxB,CACE,UAAwBC,SAAY,YAApC,CAAA,OAAOA,OACP,UAAwBC,SAAY,YAApC,CAAA,OAAOA,QACT,MAAM,IAAIC,MAAM,oCAJZ,GASN,UAAcJ,IAAIK,OAAQ,WAA1B,CACEL,IAAIK,KAAO,SAACC,WACV,IAAAC,UAAAC,KA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wR,aAAb,CACEuF,MAAMpQ,UAAUK,IAAIhH,KAACwJ,YAAYwN,+BACjC9Y,KAAKoF,SAASyT,MAAO/W,KAACwJ,YAAY0D,oBAAqBoC,WAFzD,CAIEyH,MAAMpQ,UAAUC,OAAO5G,KAACwJ,YAAYwN,wBACpC,GAAG1H,QAAS+B,aAAZ,QACEnT,KAAKoF,SAASyT,MAAO/W,KAACwJ,YAAY2D,sBAAuBmC,kBAC/DtP,KAACwT,sBAEH/N,6BACEzF,KAACuS,aAAatO,QAAQ,CAACiQ,WAAY5E,SACjC,GAAGA,QAAStP,KAACwR,aAAb,QACE0C,WAAW5D,aAAa,UAAW,QADrC,QAGE4D,WAAW3D,gBAAgB,cAGzB9K,eACN,IAAAS,KAAAA,KAAOlG,YACP9B,KAAKuE,GAAG,SAAUzC,KAAC8W,oBAAqB,SAAC3T,GACvC,IAAA2G,SAAA,GAAG9J,KAAKoW,QAAR,CACEtM,SAAW5D,KAAKiE,MAAMjM,KAAKoC,QAAQ4F,KAAKgF,UAAWlL,cACnD8J,SAASwD,OAAOxD,SAASyI,aAAahN,QAAQvF,YAxEpDuG,OAAC9H,OAAQ,MAET8H,OAAC2E,UAAW,OACZ3E,OAACsQ,eAAgB,YACjBtQ,OAACuQ,oBAAqB,+CACtBvQ,OAACyQ,uBAAwB,kBACzBzQ,OAACwM,cAAe,EAChBxM,OAAC2G,uBAAwB3G,OAAC9H,iBAC1B8H,OAAC4G,yBAA0B5G,OAAC9H,mBAE5B8H,OAACkD,gBACC,CAAA0C,UAAW,KACXC,QAAS","sourcesContent":["ENV = (->\r\n if typeof document isnt 'undefined'\r\n return window if typeof window isnt 'undefined'\r\n return global if typeof global isnt 'undefined'\r\n throw new Error 'Unsupported runtime environment.'\r\n)()\r\n\r\n\r\n\r\nunless typeof ENV.luda is 'function'\r\n ENV.luda = (installer) ->\r\n throw new Error 'Installer cannot be detected.' unless installer\r\n unless ['object', 'function'].includes typeof installer\r\n throw new Error 'Installer must be object, array or function.'\r\n if installer.hasOwnProperty '_SCOPE'\r\n unless typeof installer._SCOPE is 'string'\r\n throw new Error '_SCOPE must be string'\r\n return ENV.luda._install installer._SCOPE, installer\r\n if installer instanceof Array or typeof installer is 'function'\r\n throw new Error 'Unscoped installer must be object.'\r\n installed = {}\r\n for name, property of installer\r\n installed[name] = ENV.luda._install name, property\r\n installed\r\n\r\n ENV.luda._install = (namespace, installer) ->\r\n if ENV.luda[namespace]\r\n console.warn \"Namespace #{namespace} is ocupied, sikp installation.\"\r\n return ENV.luda[namespace]\r\n for installedName, installedInstaller of ENV.luda\r\n if installer is installedInstaller\r\n console.warn \"Installer is installed with name #{installedName},\r\n skip installation.\"\r\n return ENV.luda[installedName]\r\n if installer._install\r\n if typeof installer._install is 'function'\r\n return ENV.luda[namespace] = installer._install()\r\n return ENV.luda[namespace] = installer._install\r\n ENV.luda[namespace] = installer","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n\r\n KEY_LEFT: 37\r\n KEY_UP: 38\r\n KEY_RIGHT: 39\r\n KEY_DOWN: 40\r\n KEY_TAB: 9\r\n KEY_ESC: 27\r\n KEY_ENTER: 13","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n $child: (selector, $ancestor) ->\r\n $ancestor = document unless $ancestor\r\n $ancestor.querySelector selector\r\n\r\n $children: (selector, $ancestor) ->\r\n $ancestor = document unless $ancestor\r\n $descendant = @$child selector, $ancestor\r\n if $descendant\r\n descendants = Array.from($ancestor.querySelectorAll selector)\r\n else\r\n descendants = []\r\n\r\n $unnested: (selector, $ancestor, ancestorSelector) ->\r\n descendants = @$children selector, $ancestor\r\n descendants.filter ($descendant) =>\r\n $descendant if @$parent(ancestorSelector, $descendant) is $ancestor\r\n\r\n $parent: (selector, $descendant) ->\r\n $ancestor = $descendant.parentNode\r\n if $ancestor\r\n if $ancestor.matches and $ancestor.matches selector\r\n $ancestor\r\n else\r\n @$parent selector, $ancestor\r\n\r\n $parents: (selector, $descendant, _ancestors) ->\r\n $ancestor = @$parent selector, $descendant\r\n _ancestors = [] unless _ancestors\r\n if $ancestor\r\n _ancestors.push($ancestor)\r\n @$parents selector, $ancestor, _ancestors\r\n else\r\n _ancestors\r\n\r\n $after: ($node, $target) ->\r\n $parent = $target.parentNode\r\n if $parent.lastChild is $target\r\n $parent.appendChild $node\r\n else\r\n $parent.insertBefore $node, $target.nextSibling\r\n\r\n $prepend: ($node, $target) ->\r\n if $target.firstChild\r\n $target.insertBefore $node, $target.firstChild\r\n else\r\n $target.appendChild $node\r\n\r\n reflow: ($element) -> $element.offsetHeight","import './install.coffee'\r\nimport './dom.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n _SWIPE_DISTANCE: 10\r\n _EVENT_TYPE_PREFIX: 'luda'\r\n _SWIPE_LEFT: 'swipeleft'\r\n _SWIPE_RIGHT: 'swiperight'\r\n _SWIPE_UP: 'swipeup'\r\n _SWIPE_DOWN: 'swipedown'\r\n _SWIPE_LEFT_OR_UP: 'swipeleft or swipeup'\r\n _SWIPE_RIGHT_OR_DOWN: 'swiperight or swipedown'\r\n _DOC_READY: 'docready'\r\n _FORM_RESET: 'reset'\r\n\r\n eventPath: (event) ->\r\n if event.composedPath\r\n path = event.composedPath()\r\n else if event.path\r\n path = event.path\r\n else\r\n path = [event.target].concat(luda.$parents '*', event.target)\r\n\r\n on: (event, selector..., handler) ->\r\n switch event\r\n when @_DOC_READY then @_onDocReady handler\r\n when @_FORM_RESET then @_onReset selector[0], handler\r\n when @_SWIPE_LEFT, \\\r\n @_SWIPE_RIGHT, \\\r\n @_SWIPE_UP, \\\r\n @_SWIPE_DOWN, \\\r\n @_SWIPE_LEFT_OR_UP, \\\r\n @_SWIPE_RIGHT_OR_DOWN\r\n then @_onSwipe event, selector[0], handler\r\n else @_on event, selector[0], handler\r\n\r\n onOpposite: (event, selector, handler) ->\r\n _self = this\r\n document.addEventListener event, (e) ->\r\n trigger = _self.eventPath(e).every ($element) ->\r\n not $element.matches or not $element.matches selector\r\n handler e if trigger\r\n\r\n dispatch: ($target, type, detail, options = {}) ->\r\n options.bubbles = true unless typeof options.bubbles is 'boolean'\r\n options.cancelable = true unless typeof options.cancelable is 'boolean'\r\n options.composed = true unless typeof options.composed is 'boolean'\r\n evt = new Event \"#{@_EVENT_TYPE_PREFIX}:#{type}\", options\r\n evt.detail = detail\r\n $target.dispatchEvent evt\r\n evt\r\n \r\n _onDocReady: (handler) ->\r\n if document.readyState is 'loading'\r\n document.addEventListener 'DOMContentLoaded', handler\r\n else\r\n handler()\r\n\r\n _onReset: (selector, handler) ->\r\n document.addEventListener 'reset', (e) ->\r\n if selector?\r\n luda.$children(selector, e.target).forEach ($element) ->\r\n handler.bind($element)(e)\r\n else\r\n handler e\r\n \r\n _onSwipe: (event, selector, handler) ->\r\n _self = this\r\n watch = false\r\n $touchStartElement = document\r\n touchStartE = null\r\n touchStartX = 0\r\n touchStartY = 0\r\n document.addEventListener 'touchstart', (e) ->\r\n if e.touches.length is 1\r\n touchStartX = e.touches[0].screenX\r\n touchStartY = e.touches[0].screenY\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element.matches and $element.matches selector\r\n $touchStartElement = $element\r\n touchStartE = e\r\n watch = true\r\n return true\r\n else\r\n watch = true\r\n\r\n document.addEventListener 'touchmove', (e) ->\r\n if watch and e.touches.length is 1\r\n touchDistanceX = e.touches[0].screenX - touchStartX\r\n touchDistanceY = e.touches[0].screenY - touchStartY\r\n eventX = undefined\r\n eventY = undefined\r\n eventXOrY = undefined\r\n if Math.abs(touchDistanceX) >= _self._SWIPE_DISTANCE\r\n if touchDistanceX > 0\r\n eventX = _self._SWIPE_RIGHT\r\n else\r\n eventX = _self._SWIPE_LEFT\r\n if Math.abs(touchDistanceY) >= _self._SWIPE_DISTANCE\r\n if touchDistanceY > 0\r\n eventY = _self._SWIPE_DOWN\r\n else\r\n eventY = _self._SWIPE_UP\r\n if eventX is _self._SWIPE_LEFT \\\r\n or eventY is _self._SWIPE_UP\r\n eventXOrY = _self._SWIPE_LEFT_OR_UP\r\n if eventX is _self._SWIPE_RIGHT \\\r\n or eventY is _self._SWIPE_DOWN\r\n eventXOrY = _self._SWIPE_RIGHT_OR_DOWN\r\n if (eventX? and eventX is event) \\\r\n or (eventY? and eventY is event) \\\r\n or eventXOrY is event\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element is $touchStartElement\r\n watch = false\r\n handler.bind($element)(touchStartE, e)\r\n return true\r\n else\r\n watch = false\r\n handler touchStartE, e\r\n\r\n _on: (event, selector, handler) ->\r\n if selector is window\r\n window.addEventListener event, (e) -> handler e\r\n else\r\n _self = this\r\n document.addEventListener event, (e) ->\r\n if selector?\r\n _self.eventPath(e).some ($element) ->\r\n if $element.matches and $element.matches selector\r\n handler.bind($element)(e)\r\n return true\r\n else\r\n handler e","import './install.coffee'\r\n\r\n\r\n\r\nluda\r\n \r\n except: (element, arr) ->\r\n arr.splice(arr.indexOf(element), 1) if arr.includes element","import './install.coffee'\r\nimport './utilities.coffee'\r\n\r\n\r\n \r\nluda class Singleton\r\n\r\n @_SCOPE: 'Singleton'\r\n \r\n @_SELECTOR_INVALID_ERROR: '@param selector must be a css selector string'\r\n @_SELECTORS: []\r\n\r\n @_selector: ''\r\n @_actived: true\r\n\r\n @active: ->\r\n @_actived = true\r\n\r\n @deactive: ->\r\n @_actived = false\r\n\r\n @_add: (selector) ->\r\n throw new Error @_SELECTOR_INVALID_ERROR if typeof selector isnt 'string'\r\n @_SELECTORS.push selector unless @_SELECTORS.includes selector\r\n @_mergeSelectors()\r\n\r\n @_remove: (selector) ->\r\n throw new Error @_SELECTOR_INVALID_ERROR if typeof selector isnt 'string'\r\n luda.except selector, @_SELECTORS\r\n @_mergeSelectors()\r\n\r\n @_mergeSelectors: ->\r\n @_selector = @_SELECTORS.join ','\r\n\r\n @_install: ->\r\n return this if this is Singleton\r\n @_SELECTORS = [] unless @hasOwnProperty '_SELECTORS'\r\n @_mergeSelectors()\r\n exposed = @_init() if typeof @_init is 'function'\r\n if exposed then exposed else this","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'enterClick'\r\n\r\n @_SELECTORS: [\r\n 'input[type=checkbox]'\r\n 'input[type=radio]'\r\n '[tabindex]'\r\n ]\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'keydown', (e) ->\r\n if self._actived \\\r\n and e.keyCode is luda.KEY_ENTER \\\r\n and e.target.matches self._selector\r\n e.preventDefault()\r\n setTimeout(-> e.target.click())","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'focus'\r\n\r\n @_CSS_CLASS: 'focus'\r\n # mouse focusable selectors\r\n @_SELECTORS: ['select'\r\n 'textarea'\r\n ':not(.btn-check):not(.btn-radio):not(.btn-file) >\r\n input:not([type=button]):not([type=submit]):not([type=reset])'\r\n ]\r\n @_TOUCHSTART_FOCUS_SELECTOR: 'input[type=range]'\r\n @_PARENT_FOCUS_SELECTOR: 'select[multiple]'\r\n @_PARENT_FOCUS_CHILDREN_SELECTOR: \"#{@_PARENT_FOCUS_SELECTOR} *\"\r\n\r\n @_$focus: document.getElementsByClassName(@_CSS_CLASS)\r\n\r\n @_removeFocusClassExcept: ($exception) ->\r\n Array.from(@_$focus).forEach ($focus) =>\r\n $focus.classList.remove @_CSS_CLASS if $focus isnt $exception\r\n\r\n @_addFocusClassExceptHtmlAndBody: ($target) ->\r\n if $target isnt document.body and $target isnt document.documentElement\r\n $target.classList.add @_CSS_CLASS\r\n\r\n @_changeFocusStateOnKeyEvent: (e) ->\r\n if @_actived\r\n @_removeFocusClassExcept e.target\r\n @_addFocusClassExceptHtmlAndBody e.target\r\n\r\n @_changeFocusStateOnMouseDownEvent: (e) ->\r\n if @_actived\r\n if e.target.matches @_PARENT_FOCUS_CHILDREN_SELECTOR\r\n target = luda.$parent @_PARENT_FOCUS_SELECTOR, e.target\r\n else\r\n target = e.target\r\n if target.matches @_selector\r\n @_removeFocusClassExcept target\r\n @_addFocusClassExceptHtmlAndBody target\r\n else\r\n @_removeFocusClassExcept()\r\n\r\n @_setElementPrototype: ->\r\n focus = HTMLElement.prototype.focus\r\n blur = HTMLElement.prototype.blur\r\n self = this\r\n HTMLElement.prototype.focus = ->\r\n focus.apply this, arguments\r\n if self._actived and document.activeElement is this\r\n self._removeFocusClassExcept this\r\n self._addFocusClassExceptHtmlAndBody this\r\n HTMLElement.prototype.blur = ->\r\n blur.apply this, arguments\r\n this.classList.remove self._CSS_CLASS if self._actived\r\n\r\n @_init: ->\r\n self = this\r\n @_setElementPrototype()\r\n luda.on 'keydown', @_changeFocusStateOnKeyEvent.bind this\r\n luda.on 'keyup', @_changeFocusStateOnKeyEvent.bind this\r\n luda.on 'mousedown', @_changeFocusStateOnMouseDownEvent.bind this\r\n luda.on 'touchstart', @_TOUCHSTART_FOCUS_SELECTOR, \\\r\n @_changeFocusStateOnMouseDownEvent.bind this\r\n luda.on 'focusin', @_changeFocusStateOnMouseDownEvent.bind this","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'radioTab'\r\n\r\n @_SELECTORS: ['input[type=radio]:not([disabled])']\r\n\r\n @_querySameName$radios: ($radio) ->\r\n if $radio.name\r\n selector = \"#{@_selector}[name=#{$radio.name}]\"\r\n else\r\n selector = @_selector\r\n $inputs = luda.$children selector\r\n $inputs.filter ($input) -> $input.tabIndex >= 0\r\n\r\n @_query$prev$next: ($radio) ->\r\n $sameNameRadios = @_querySameName$radios $radio\r\n radioIndex = $sameNameRadios.indexOf $radio\r\n $prev = $sameNameRadios[radioIndex - 1]\r\n $next = $sameNameRadios[radioIndex + 1]\r\n {$prev, $next}\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'keydown', (e) ->\r\n if self._actived \\\r\n and e.keyCode is luda.KEY_TAB \\\r\n and e.target.nodeName.toUpperCase() is 'INPUT' \\\r\n and e.target.type is 'radio'\r\n if e.shiftKey\r\n if $prev = self._query$prev$next(e.target).$prev\r\n e.preventDefault()\r\n $prev.focus()\r\n else\r\n if $next = self._query$prev$next(e.target).$next\r\n e.preventDefault()\r\n $next.focus()","import './install.coffee'\r\nimport './utilities.coffee'\r\nimport './dom.coffee'\r\nimport './event.coffee'\r\n\r\n\r\n\r\n\r\nluda class Component\r\n\r\n @_SCOPE: 'Component'\r\n \r\n @_COMPONENT_NO_SELECTOR_ERROR: 'Extended component must has a css selector'\r\n @_$COMPONENT_INVALID_ERROR: '@param $component must be an instance of Element'\r\n @_SELECTOR: ''\r\n @_instances: []\r\n\r\n @_Observed: []\r\n @_observer: null\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n\r\n _hasDescendant: (descendant) ->\r\n if @_children.length and descendant\r\n return true if @_children.includes descendant\r\n return @_children.some (child) -> child._hasDescendant descendant\r\n else\r\n return false\r\n\r\n _observe: ->\r\n @_observer = new MutationObserver @_onMutations.bind this\r\n @_observer.observe @_$component, @constructor._observerConfig\r\n\r\n _disconnect: ->\r\n @_observer.disconnect()\r\n @_observer = null\r\n\r\n @create: ($component) ->\r\n componentIsElementInstance = $component instanceof Element\r\n throw new Error @_$COMPONENT_INVALID_ERROR unless componentIsElementInstance\r\n $family = @_query$family $component\r\n instance = @query $component\r\n if $family._$parent\r\n if parent = @query $family._$parent\r\n @_instances.push instance = @_createInstance $component unless instance\r\n if instance._parent isnt parent\r\n parent._children.push(instance) and (instance._parent = parent)\r\n $family._$children.forEach ($child) => @create $child\r\n return instance\r\n else\r\n @create $family._$parent\r\n return @query $component\r\n else\r\n @_instances.push instance = @_createInstance $component unless instance\r\n $family._$children.forEach ($child) => @create $child\r\n return instance\r\n\r\n @destroy: (instance$component) ->\r\n instance = @query instance$component\r\n if instance\r\n instance._disconnect() if instance._observer\r\n instance._destroy() if instance._destroy\r\n @destroy instance._children[0] while instance._children.length\r\n if instance._parent\r\n luda.except instance, instance._parent._children\r\n luda.except instance, @_instances\r\n for attribute, value of instance\r\n instance[attribute] = null\r\n \r\n @query: (instance$component) ->\r\n instance = null\r\n if instance$component instanceof this \\\r\n and @_instances.includes instance$component\r\n instance = instance$component\r\n else if instance$component instanceof Element\r\n @_instances.some (inited) ->\r\n if inited._$component is instance$component\r\n instance = inited\r\n return true\r\n return instance\r\n\r\n @_query$family: ($component) ->\r\n _$parent = null\r\n _$children = []\r\n if @_SELECTOR\r\n _$parent = luda.$parent @_SELECTOR, $component\r\n _$children = luda.$unnested @_SELECTOR, $component, @_SELECTOR\r\n {_$parent, _$children}\r\n\r\n @_createInstance: ($component) ->\r\n instance = new this()\r\n instance._$component = $component\r\n instance._parent = null\r\n instance._children = []\r\n instance._observer = null\r\n instance._constructor() if instance._constructor\r\n unless instance._observer and instance._onMutations and @_observerConfig\r\n instance._observe()\r\n instance\r\n\r\n @_observe: (classObj) ->\r\n unless Component._observer\r\n Component._observer = new MutationObserver (mutations) ->\r\n mutations.forEach (mutation) ->\r\n $removedNodes = Array.from mutation.removedNodes\r\n $addedNodes = Array.from mutation.addedNodes\r\n $removedNodes.forEach ($node) ->\r\n if $node instanceof Element\r\n Component._Observed.forEach (Observed) ->\r\n if $node.matches Observed._SELECTOR\r\n Observed.destroy $node\r\n else\r\n $destroies = luda.$children Observed._SELECTOR, $node\r\n $destroies.forEach ($destroy) -> Observed.destroy $destroy\r\n $addedNodes.forEach ($node) ->\r\n if $node instanceof Element\r\n Component._Observed.forEach (Observed) ->\r\n if $node.matches Observed._SELECTOR\r\n Observed.create $node\r\n else\r\n $creates = luda.$children Observed._SELECTOR, $node\r\n $creates.forEach ($create) -> Observed.create $create\r\n Component._observer.observe document.documentElement, \\\r\n Component._observerConfig\r\n unless Component._Observed.includes classObj\r\n Component._Observed.push classObj\r\n\r\n @_install: ->\r\n self = this\r\n return this if this is Component\r\n unless @_SELECTOR or typeof @_SELECTOR isnt 'string'\r\n throw new Error @_COMPONENT_NO_SELECTOR_ERROR\r\n @_instances = [] unless @hasOwnProperty '_instances'\r\n exposed = @_init() if typeof @_init is 'function'\r\n luda.on luda._DOC_READY, ->\r\n luda.$children(self._SELECTOR).forEach ($component) ->\r\n self.create $component\r\n Component._observe(self)\r\n if exposed then exposed else this","import '../install.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'readonly'\r\n @_READONLY_ATTRIBUTE: 'data-readonly'\r\n @_READONLY_FALSE_VALUE: 'false'\r\n @_SELECTOR: \"[#{@_READONLY_ATTRIBUTE}]\"\r\n\r\n @_observerConfig:\r\n attributes: true\r\n attributeFilter: [@_READONLY_ATTRIBUTE]\r\n\r\n _getConfig: ->\r\n readonly = @_$component.getAttribute @constructor._READONLY_ATTRIBUTE\r\n _isReadonly = readonly isnt @constructor._READONLY_FALSE_VALUE\r\n _originalTabIndex = @_$component.tabIndex\r\n {_isReadonly, _originalTabIndex}\r\n \r\n _constructor: ->\r\n {\r\n @_isReadonly,\r\n @_originalTabIndex\r\n } = @_getConfig()\r\n @_setTabIndex()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _setTabIndex: ->\r\n if @_isReadonly\r\n @_$component.tabIndex = -1\r\n else\r\n @_$component.tabIndex = @_originalTabIndex","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../singleton.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Singleton\r\n\r\n @_SCOPE: 'toggle'\r\n @_TOGGLE_TARGET_ATTRIBUTE: 'data-toggle-target'\r\n @_TOGGLE_ATTRIBUTE: 'data-toggle'\r\n @_TOGGLE_FOR_ATTRIBUTE: 'data-toggle-for'\r\n @_NONE_TOGGLE_ATTRIBUTE: 'data-none-toggle'\r\n @_ACTIVE_CSS_CLASS: 'toggle-active'\r\n @_SELECTORS: [\r\n \"[#{@_TOGGLE_FOR_ATTRIBUTE}]\"\r\n \"[#{@_TOGGLE_ATTRIBUTE}]\"\r\n ]\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @active: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n $target.classList.add @_ACTIVE_CSS_CLASS\r\n luda.dispatch($target, @_ACTIVED_EVENT_TYPE)\r\n\r\n @deactive: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n $target.classList.remove @_ACTIVE_CSS_CLASS\r\n luda.dispatch($target, @_DEACTIVED_EVENT_TYPE)\r\n\r\n @toggle: (name$target) ->\r\n @_query$targets(name$target).forEach ($target) =>\r\n if $target.classList.contains @_ACTIVE_CSS_CLASS\r\n @deactive($target)\r\n else\r\n @active($target)\r\n\r\n @_query$targets: (name$target) ->\r\n if name$target instanceof Element\r\n [name$target]\r\n else\r\n luda.$children \"[#{@_TOGGLE_TARGET_ATTRIBUTE}=#{name$target}]\"\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'click', @_selector, (e) ->\r\n toggleChecked = false\r\n luda.eventPath(e).some ($path) ->\r\n if $path instanceof Element\r\n if $path.hasAttribute(self._TOGGLE_ATTRIBUTE) \\\r\n or $path.hasAttribute(self._TOGGLE_FOR_ATTRIBUTE)\r\n if toggleName = $path.getAttribute self._TOGGLE_FOR_ATTRIBUTE\r\n self.toggle toggleName\r\n toggleChecked = true\r\n if $path.hasAttribute self._TOGGLE_ATTRIBUTE\r\n if $path.hasAttribute self._TOGGLE_TARGET_ATTRIBUTE\r\n $toggle = $path\r\n else\r\n $toggle = luda.$parent \\\r\n \"[#{self._TOGGLE_TARGET_ATTRIBUTE}]\", $path\r\n if $toggle\r\n self.toggle $toggle\r\n toggleChecked = true\r\n else if $path.hasAttribute self._NONE_TOGGLE_ATTRIBUTE\r\n toggleChecked = true","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmFile'\r\n\r\n @_VALUE_SPLITOR: ' '\r\n @_SELECTOR: '.fm-file'\r\n @_FILE_SELECTOR: 'input[type=file]'\r\n @_SIMULATOR_SELECTOR: 'input:not([type=file])'\r\n @_PLACEHOLDER_ATTRIBUTE: 'placeholder'\r\n @_VALUE_ATTRIBUTE: 'value'\r\n\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n\r\n _getConfig: ->\r\n _$file = luda.$child @constructor._FILE_SELECTOR, @_$component\r\n _$simulator = luda.$child \\\r\n @constructor._SIMULATOR_SELECTOR, @_$component\r\n {_$file, _$simulator}\r\n\r\n _constructor: ->\r\n {\r\n @_$file,\r\n @_$simulator\r\n } = @_getConfig()\r\n @_init()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _insertSimulator: ->\r\n @_$simulator = document.createElement 'input'\r\n @_$simulator.tabIndex = -1\r\n luda.$after @_$simulator, @_$file\r\n\r\n _setPlaceholderValue: ->\r\n @_$simulator.placeholder = \\\r\n @_$file.getAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _setSimulatorValue: ->\r\n values = []\r\n Array.from(@_$file.files).map (file) -> values.push file.name\r\n if values.length\r\n @_$simulator.value = values.join @constructor._VALUE_SPLITOR\r\n else if @_$file.hasAttribute(@constructor._VALUE_ATTRIBUTE)\r\n @_$simulator.value = @_$file.getAttribute @constructor._VALUE_ATTRIBUTE\r\n\r\n _init: ->\r\n if @_$file\r\n @_insertSimulator() unless @_$simulator\r\n if @_$file.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_setPlaceholderValue()\r\n @_setSimulatorValue()\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'change', \"#{@_SELECTOR} #{@_FILE_SELECTOR}\", (e) ->\r\n self.query(luda.$parent self._SELECTOR, this)._setSimulatorValue()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._setSimulatorValue()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmSelect'\r\n\r\n @_SELECTOR: '.fm-select'\r\n @_SELECT_SELECTOR: 'select'\r\n @_SINGLE_SELECT_SIMULATOR_SELECTOR: 'input'\r\n @_PLACEHOLDER_ATTRIBUTE: 'placeholder'\r\n @_MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS: 'fm-select-multiple-placeholder'\r\n @_DEFAULT_SELECTED_OPTION_ATTRIBUTE: 'data-fm-select-default-selected'\r\n @_INITED_ATTRIBUTE: 'data-fm-select-inited'\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: ['selected']\r\n\r\n select: (indexOrIndexArray) ->\r\n if @_$select.multiple\r\n if @_$multipleSelectPlaceholder\r\n selectedIndexes = indexOrIndexArray\r\n else\r\n selectedIndexes = indexOrIndexArray.map (index) -> index + 1\r\n Array.from(@_$select.options).forEach ($option, index) ->\r\n $option.selected = selectedIndexes.includes index\r\n @_markSelectedOption()\r\n else\r\n @_$select.selectedIndex = selectedIndex\r\n @_setSingleSelectSimulatorValue()\r\n @_markSelectedOption()\r\n\r\n _getConfig: ->\r\n _$select = luda.$child @constructor._SELECT_SELECTOR, @_$component\r\n _$singleSelectSimulator = luda.$child \\\r\n @constructor._SINGLE_SELECT_SIMULATOR_SELECTOR, @_$component\r\n _$multipleSelectPlaceholder = luda.$child \\\r\n \".#{@constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS}\", @_$component\r\n _$defaultSelectedOptions = luda.$children \\\r\n \"[#{@constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE}]\", @_$component\r\n _defaultSelectedOptionMarked = @_$component.hasAttribute \\\r\n @constructor._INITED_ATTRIBUTE\r\n {\r\n _$select,\r\n _$singleSelectSimulator,\r\n _$multipleSelectPlaceholder,\r\n _$defaultSelectedOptions,\r\n _defaultSelectedOptionMarked\r\n }\r\n\r\n _constructor: ->\r\n {\r\n @_$select,\r\n @_$singleSelectSimulator,\r\n @_$multipleSelectPlaceholder,\r\n @_$defaultSelectedOptions,\r\n @_defaultSelectedOptionMarked\r\n } = @_getConfig()\r\n if @_$select\r\n if @_$select.multiple\r\n @_initMultipleSelect()\r\n else\r\n @_initSingleSelect()\r\n \r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _markSelectedOption: ->\r\n @_disconnect() if @_observer\r\n Array.from(@_$select.options).forEach ($option) ->\r\n if $option.selected\r\n $option.setAttribute 'selected', 'selected'\r\n else\r\n $option.removeAttribute 'selected'\r\n @_observe() unless @_observer\r\n\r\n _markDefaultSelectedOption: ->\r\n @_$component.setAttribute @constructor._INITED_ATTRIBUTE, ''\r\n Array.from(@_$select.options).forEach ($option) =>\r\n if $option.selected\r\n $option.setAttribute @constructor._DEFAULT_SELECTED_OPTION_ATTRIBUTE, ''\r\n\r\n _setSingleSelectedDefaultSelectedOption: ->\r\n hasSelected = Array.from(@_$select.options).some ($option) ->\r\n $option.getAttribute('selected') is 'selected'\r\n @_$select.selectedIndex = -1 unless hasSelected\r\n\r\n _insertSingleSelectSimulator: ->\r\n @_$singleSelectSimulator = document.createElement 'input'\r\n @_$singleSelectSimulator.tabIndex = -1\r\n luda.$after @_$singleSelectSimulator, @_$select\r\n\r\n _setSingleSelectPlaceholderValue: ->\r\n @_$singleSelectSimulator.placeholder = @_$select.getAttribute \\\r\n @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _setSingleSelectSimulatorValue: ->\r\n if $selectedOption = @_$select.options[@_$select.selectedIndex]\r\n @_$singleSelectSimulator.value = $selectedOption.innerText\r\n else\r\n @_$singleSelectSimulator.value = ''\r\n\r\n _initSingleSelect: ->\r\n @_insertSingleSelectSimulator() unless @_$singleSelectSimulator\r\n if @_$select.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_setSingleSelectedDefaultSelectedOption()\r\n @_setSingleSelectPlaceholderValue()\r\n @_markDefaultSelectedOption() unless @_defaultSelectedOptionMarked\r\n @_setSingleSelectSimulatorValue()\r\n @_markSelectedOption()\r\n\r\n _insertMultipleSelectBlankOption: ->\r\n @_$multipleSelectPlaceholder = document.createElement 'option'\r\n @_$multipleSelectPlaceholder.className = \\\r\n @constructor._MULTIPLE_SELECT_PLACEHOLDER_CSS_CLASS\r\n @_$multipleSelectPlaceholder.disabled = true\r\n luda.$prepend @_$multipleSelectPlaceholder, @_$select\r\n\r\n _setMultipleSelectPlaceholderValue: ->\r\n @_$multipleSelectPlaceholder.innerText = @_$select.getAttribute \\\r\n @constructor._PLACEHOLDER_ATTRIBUTE\r\n\r\n _initMultipleSelect: ->\r\n unless @_$multipleSelectPlaceholder\r\n if @_$select.hasAttribute @constructor._PLACEHOLDER_ATTRIBUTE\r\n @_insertMultipleSelectBlankOption()\r\n @_setMultipleSelectPlaceholderValue()\r\n @_markDefaultSelectedOption() unless @_defaultSelectedOptionMarked\r\n\r\n _reset: ->\r\n if @_$select\r\n Array.from(@_$select.options).forEach ($option) =>\r\n $option.selected = @_$defaultSelectedOptions.includes $option\r\n @_setSingleSelectSimulatorValue() unless @_$select.multiple\r\n @_markSelectedOption()\r\n\r\n @_init: ->\r\n self = this\r\n luda.on 'change', \"#{@_SELECTOR} #{@_SELECT_SELECTOR}\", (e) ->\r\n instance = self.query(luda.$parent self._SELECTOR, this)\r\n instance._setSingleSelectSimulatorValue() unless this.multiple\r\n instance._markSelectedOption()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._reset()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'carousel'\r\n\r\n @_SELECTOR: '.carousel'\r\n @_ITEMS_SELECTOR: '.carousel-item'\r\n @_PREV_CONTROL_SELECTOR: '.carousel-prev'\r\n @_NEXT_CONTROL_SELECTOR: '.carousel-next'\r\n @_INDICATORS_SELECTOR: '.carousel-indicators .btn'\r\n @_INTERVAL_ATTRIBUTE: 'data-carousel-interval'\r\n @_WRAP_ATTRIBUTE: 'data-carousel-wrap'\r\n @_ITEM_ACTIVE_CSS_CLASS: 'carousel-item-active'\r\n @_ITEM_NEXT_CSS_CLASS: 'carousel-item-next'\r\n @_ITEM_PREV_CSS_CLASS: 'carousel-item-prev'\r\n @_ACTIVE_INDEX: 0\r\n @_INTERVAL: 5000\r\n @_WRAP: true\r\n @_FALSE: 'false'\r\n @_ACTIVE_EVENT_TYPE: \"#{@_SCOPE}:active\"\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVE_EVENT_TYPE: \"#{@_SCOPE}:deactive\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [@_INTERVAL_ATTRIBUTE, @_WRAP_ATTRIBUTE]\r\n \r\n # public\r\n active: (index) ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n if index? \\\r\n and index isnt @_activeIndex \\\r\n and 0 <= index <= @_$items.length - 1\r\n @_transiting = true\r\n @_activeIndex = index\r\n action = if index < activedIndex then '_slidePrev' else '_slideNext'\r\n @[action] @_$items[activedIndex], activedIndex\r\n\r\n next: ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n index = activedIndex + 1\r\n if index > @_$items.length - 1\r\n return unless @_wrap\r\n index = 0\r\n @_transiting = true\r\n @_activeIndex = index\r\n @_slideNext @_$items[activedIndex], activedIndex\r\n @_playTimeStamp = Date.now()\r\n @_pausedRemainTime = @_interval\r\n\r\n prev: ->\r\n if @_$items.length and not @_transiting\r\n activedIndex = @_activeIndex\r\n index = activedIndex - 1\r\n if index < 0\r\n return unless @_wrap\r\n index = @_$items.length - 1\r\n @_transiting = true\r\n @_activeIndex = index\r\n @_slidePrev @_$items[activedIndex], activedIndex\r\n @_playTimeStamp = Date.now()\r\n @_pausedRemainTime = @_interval\r\n\r\n pause: ->\r\n if @_intervaling?\r\n clearInterval @_intervaling\r\n @_intervaling = null\r\n @_pausedRemainTime = @_pausedRemainTime - (Date.now() - @_playTimeStamp)\r\n\r\n play: ->\r\n if @_interval and @_$items.length > 1\r\n @_playTimeStamp = Date.now()\r\n @pause()\r\n execute = =>\r\n @next()\r\n @_intervaling = setInterval @next.bind(this), @_interval\r\n @_intervaling = setTimeout execute, @_pausedRemainTime\r\n\r\n\r\n # private\r\n _getConfig: ->\r\n _$items = luda.$unnested \\\r\n @constructor._ITEMS_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$indicators = luda.$unnested \\\r\n @constructor._INDICATORS_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$prevControl = luda.$child \\\r\n @constructor._PREV_CONTROL_SELECTOR, @_$component\r\n _$nextControl = luda.$child \\\r\n @constructor._NEXT_CONTROL_SELECTOR, @_$component\r\n _activeIndex = _$items.indexOf \\\r\n luda.$child \".#{@constructor._ITEM_ACTIVE_CSS_CLASS}\", @_$component\r\n _activeIndex = @constructor._ACTIVE_INDEX if _activeIndex is -1\r\n _interval = @_$component.getAttribute(@constructor._INTERVAL_ATTRIBUTE)\r\n if _interval is @constructor._FALSE\r\n _interval = false\r\n else\r\n _interval = Math.abs(parseInt _interval, 10) or @constructor._INTERVAL\r\n _wrap = @_$component.getAttribute(@constructor._WRAP_ATTRIBUTE)\r\n _wrap = if _wrap is @constructor._FALSE then false else @constructor._WRAP\r\n {\r\n _$items,\r\n _$indicators,\r\n _$prevControl,\r\n _$nextControl,\r\n _activeIndex,\r\n _interval,\r\n _wrap\r\n }\r\n\r\n _constructor: ->\r\n {\r\n @_$items,\r\n @_$indicators,\r\n @_$prevControl,\r\n @_$nextControl,\r\n @_activeIndex,\r\n @_interval,\r\n @_wrap\r\n } = @_getConfig()\r\n @_transiting = false\r\n @_intervaling = null\r\n @_playTimeStamp = 0\r\n @_pausedRemainTime = @_interval\r\n @_layout()\r\n @play()\r\n\r\n _onMutations: (mutations) ->\r\n {\r\n @_$items,\r\n @_$indicators,\r\n @_$prevControl,\r\n @_$nextControl,\r\n @_activeIndex,\r\n @_interval,\r\n @_wrap\r\n } = @_getConfig()\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n @play()\r\n\r\n _destroy: ->\r\n @pause()\r\n\r\n _layout: ->\r\n @_$items.forEach ($item, index) =>\r\n $item.style.transition = 'none'\r\n if index > @_activeIndex\r\n $item.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n else if index < @_activeIndex\r\n $item.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n else\r\n luda.dispatch($item, @constructor._ACTIVED_EVENT_TYPE, index)\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n luda.reflow($item)\r\n $item.style.transition = ''\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _slideNext: ($activedItem, activedIndex) ->\r\n if @_$items.length > 1\r\n $item = @_$items[@_activeIndex]\r\n luda.dispatch($item, \\\r\n @constructor._ACTIVE_EVENT_TYPE, @_activeIndex)\r\n $item.style.transition = 'none'\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n luda.reflow $item\r\n $item.style.transition = ''\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch($activedItem, \\\r\n @constructor._DEACTIVE_EVENT_TYPE, activedIndex)\r\n $activedItem.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $activedItem.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _slidePrev: ($activedItem, activedIndex) ->\r\n if @_$items.length > 1\r\n $item = @_$items[@_activeIndex]\r\n luda.dispatch($item, \\\r\n @constructor._ACTIVE_EVENT_TYPE, @_activeIndex)\r\n $item.style.transition = 'none'\r\n $item.classList.remove @constructor._ITEM_NEXT_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_PREV_CSS_CLASS\r\n luda.reflow $item\r\n $item.style.transition = ''\r\n $item.classList.remove @constructor._ITEM_PREV_CSS_CLASS\r\n $item.classList.add @constructor._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch($activedItem, \\\r\n @constructor._DEACTIVE_EVENT_TYPE, activedIndex)\r\n $activedItem.classList.remove @constructor._ITEM_ACTIVE_CSS_CLASS\r\n $activedItem.classList.add @constructor._ITEM_NEXT_CSS_CLASS\r\n @_setIndicatorsState()\r\n @_setDirectionControlState()\r\n\r\n _setIndicatorsState: ->\r\n @_$indicators.forEach ($indicator, index) =>\r\n $indicator.disabled = index is @_activeIndex\r\n\r\n _setDirectionControlState: ->\r\n if @_$items.length <= 1\r\n @_$prevControl?.disabled = @_$nextControl?.disabled = true\r\n else\r\n @_$prevControl?.disabled = @_activeIndex is 0 and not @_wrap\r\n @_$nextControl?.disabled = \\\r\n @_activeIndex is @_$items.length - 1 and not @_wrap\r\n \r\n # static private\r\n @_init: ->\r\n self = this\r\n luda.on 'transitionend', @_ITEMS_SELECTOR, (e) ->\r\n instance = self.query(luda.$parent self._SELECTOR, this)\r\n instance._transiting = false\r\n index = instance._$items.indexOf this\r\n if this.classList.contains self._ITEM_ACTIVE_CSS_CLASS\r\n luda.dispatch(this, self._ACTIVED_EVENT_TYPE, index)\r\n else\r\n luda.dispatch(this, self._DEACTIVED_EVENT_TYPE, index)\r\n luda.on 'click', @_INDICATORS_SELECTOR, (e) ->\r\n instance = self.query luda.$parent self._SELECTOR, this\r\n instance.active instance._$indicators.indexOf this\r\n luda.on 'touchstart', @_SELECTOR, (e) ->\r\n self.query(this).pause()\r\n luda.on 'touchend', @_SELECTOR, (e) ->\r\n setTimeout => self.query(this).play()\r\n luda.on 'mouseover', @_SELECTOR, (e) ->\r\n self.query(this).pause()\r\n luda.on 'mouseout', @_SELECTOR, (e) ->\r\n self.query(this).play()\r\n luda.on luda._SWIPE_LEFT_OR_UP, @_SELECTOR, (startE, e) ->\r\n self.query(this).next()\r\n luda.on luda._SWIPE_RIGHT_OR_DOWN, @_SELECTOR, (startE, e) ->\r\n self.query(this).prev()\r\n luda.on 'click', @_PREV_CONTROL_SELECTOR, (e) ->\r\n self.query(luda.$parent self._SELECTOR, this).prev()\r\n luda.on 'click', @_NEXT_CONTROL_SELECTOR, (e) ->\r\n self.query(luda.$parent self._SELECTOR, this).next()","import '../install.coffee'\r\nimport '../constants.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'dropdown'\r\n @_SELECTOR: '.dropdown-fixed,.dropdown-absolute,\r\n .dropdown-static,.dropdown-absolute-m'\r\n @_MENU_SELECTOR: '.dropdown-menu'\r\n @_ITEMS_SELECTOR: 'a[href]:not([disabled]),button:not([disabled]),\r\n input:not([disabled]),[tabindex]:not([disabled])'\r\n @_TOGGLE_ATTRIBUTE: 'data-dropdown-toggle'\r\n @_NONE_TOGGLE_ATTRIBUTE: 'data-dropdown-none-toggle'\r\n @_STANDALONE_ATTRIBUTE: 'data-dropdown-standalone'\r\n @_SWITCHES_SELECTOR: \"[#{@_TOGGLE_ATTRIBUTE}]\"\r\n @_NONE_SWITCHES_SELECTOR: \"[#{@_NONE_TOGGLE_ATTRIBUTE}]\"\r\n @_ACTIVE_CSS_CLASS: 'dropdown-active'\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [\r\n @_TOGGLE_ATTRIBUTE\r\n @_NONE_TOGGLE_ATTRIBUTE\r\n @_STANDALONE_ATTRIBUTE\r\n ]\r\n\r\n @_$focused: []\r\n\r\n active: ->\r\n unless @_actived()\r\n @_$component.classList.add @constructor._ACTIVE_CSS_CLASS\r\n @constructor._$focused.push document.activeElement\r\n @_parent?.active()\r\n luda.dispatch(@_$component, @constructor._ACTIVED_EVENT_TYPE)\r\n\r\n deactive: (focus) ->\r\n if @_actived()\r\n @_$component.classList.remove @constructor._ACTIVE_CSS_CLASS\r\n @_children.forEach (child) -> child.deactive()\r\n if focus\r\n @constructor._$focused[@constructor._$focused.length - 1]?.focus()\r\n @constructor._$focused.splice @constructor._$focused.length - 1, 1\r\n luda.dispatch(@_$component, @constructor._DEACTIVED_EVENT_TYPE)\r\n\r\n toggle: (focus) ->\r\n if @_actived() then @deactive(focus) else @active()\r\n\r\n prev: ->\r\n if @_$items.length and @_actived()\r\n focusIndex = @_$items.indexOf(document.activeElement) - 1\r\n focusIndex = 0 if focusIndex < 0\r\n @_$items[focusIndex].focus()\r\n\r\n next: ->\r\n if @_$items.length and @_actived()\r\n focusIndex = @_$items.indexOf(document.activeElement) + 1\r\n focusIndex = @_$items.length - 1 if focusIndex > @_$items.length - 1\r\n @_$items[focusIndex].focus()\r\n\r\n _getConfig: ->\r\n _$menu = luda.$child @constructor._MENU_SELECTOR, @_$component\r\n _$switches = luda.$unnested( \\\r\n @constructor._SWITCHES_SELECTOR, @_$component, @constructor._SELECTOR)\r\n .concat(luda.$unnested \\\r\n @constructor._SWITCHES_SELECTOR, _$menu, @constructor._MENU_SELECTOR)\r\n _$noneSwitches = luda.$unnested( \\\r\n @constructor._NONE_SWITCHES_SELECTOR, \\\r\n @_$component, @constructor._SELECTOR) \\\r\n .concat(luda.$unnested \\\r\n @constructor._NONE_SWITCHES_SELECTOR, _$menu, @constructor._MENU_SELECTOR)\r\n _$items = luda.$unnested \\\r\n @constructor._ITEMS_SELECTOR, _$menu, @constructor._MENU_SELECTOR\r\n _isStandalone = @_$component.hasAttribute @constructor._STANDALONE_ATTRIBUTE\r\n {_$items, _$switches, _$noneSwitches, _isStandalone}\r\n\r\n _constructor: ->\r\n {\r\n @_$items,\r\n @_$switches,\r\n @_$noneSwitches,\r\n @_isStandalone\r\n } = @_getConfig()\r\n\r\n _onMutations: (mutations) ->\r\n @_constructor()\r\n\r\n _actived: ->\r\n @_$component.classList.contains @constructor._ACTIVE_CSS_CLASS\r\n\r\n _deactiveChildrenExcept: (exceptions) ->\r\n if exceptions and not (exceptions instanceof Array)\r\n exceptions = [exceptions]\r\n if exceptions\r\n @_children.forEach (child) ->\r\n child.deactive() if child._actived() and not exceptions.includes child\r\n else\r\n @_children.forEach (child) ->\r\n child.deactive() if child._actived()\r\n\r\n @deactiveExcept: (instances$dropdowns) ->\r\n exceptions = []\r\n if instances$dropdowns and not (instances$dropdowns instanceof Array)\r\n instances$dropdowns = [instances$dropdowns]\r\n if instances$dropdowns\r\n instances$dropdowns.forEach (instance$dropdown) =>\r\n exceptions.push exception if exception = @query instance$dropdown\r\n if exceptions.length\r\n @_instances.forEach (instance) ->\r\n instanceIsntInExceptions = not exceptions.includes instance\r\n instanceHasntExceptionChild = exceptions.every (exception) ->\r\n not instance._hasDescendant exception\r\n if instance._actived() \\\r\n and instanceIsntInExceptions \\\r\n and instanceHasntExceptionChild\r\n instance.deactive()\r\n else\r\n @_instances.forEach (instance) ->\r\n instance.deactive() if instance._actived()\r\n\r\n @_standaloneInstances: ->\r\n @_instances.filter (instance) -> instance if instance._isStandalone\r\n\r\n @_init: ->\r\n self = this\r\n luda.onOpposite 'click', @_SELECTOR, (e) ->\r\n self.deactiveExcept self._standaloneInstances()\r\n luda.on 'click', @_SELECTOR, (e) ->\r\n if instance = self.query this\r\n toggleChecked = false\r\n focus = not e.detail\r\n self.deactiveExcept(self._standaloneInstances().concat instance)\r\n instance._deactiveChildrenExcept()\r\n instance._parent._deactiveChildrenExcept(instance) if instance._parent\r\n if instance._$switches.length or instance._$noneSwitches.length\r\n luda.eventPath(e).some ($path) ->\r\n if instance._$switches.includes $path\r\n instance.toggle focus\r\n toggleChecked = true\r\n else if instance._$noneSwitches.includes $path\r\n toggleChecked = true\r\n instance.toggle focus unless toggleChecked\r\n\r\n luda.onOpposite 'keyup', @_SELECTOR, (e) -> self.deactiveExcept()\r\n luda.on 'keyup', @_SELECTOR, (e) ->\r\n if e.keyCode is luda.KEY_TAB and instance = self.query this\r\n self.deactiveExcept(instance)\r\n instance.active()\r\n luda.on 'keydown', @_SELECTOR, (e) ->\r\n if e.keyCode is luda.KEY_ESC and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.deactive true\r\n else\r\n instance._parent?.deactive true\r\n luda.on 'keydown', @_SELECTOR, (e) ->\r\n if [luda.KEY_LEFT, luda.KEY_UP].includes(e.keyCode) \\\r\n and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.prev()\r\n else\r\n instance._parent?.prev()\r\n else if [luda.KEY_RIGHT, luda.KEY_DOWN].includes(e.keyCode) \\\r\n and instance = self.query this\r\n e.preventDefault()\r\n if instance._actived()\r\n instance.next()\r\n else\r\n instance._parent?.next()","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\nimport '../behaviours/focus.coffee'\r\nimport '../behaviours/enter-click.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'fmDropdown'\r\n\r\n @_SELECTOR: '.fm-dropdown'\r\n @_VALUE_SPLITOR: ' '\r\n @_VALUE_ATTRIBUTE: 'data-fm-dropdown-value'\r\n @_VALUE_SELECTOR: '.dropdown-items .btn-radio input,\r\n .dropdown-items .btn-check input'\r\n @_DEFAULT_VALUE_SELECTOR: '.dropdown-items .btn-radio label,\r\n .dropdown-items .btn-check label'\r\n @_VALUE_HOLDER_SELECTOR: '.fm input'\r\n @_ENTER_CLICK_VALUE_HOLDER_SELECTOR: '.fm-dropdown .fm input'\r\n\r\n @_observerConfig:\r\n childList: true\r\n attributes: true\r\n subtree: true\r\n attributeFilter: [\r\n 'checked'\r\n @_VALUE_ATTRIBUTE\r\n ]\r\n\r\n _getConfig: ->\r\n _$values = luda.$children @constructor._VALUE_SELECTOR, @_$component\r\n _$defaultValues = luda.$children \\\r\n @constructor._DEFAULT_VALUE_SELECTOR, @_$component\r\n _$valueHolder = luda.$child \\\r\n @constructor._VALUE_HOLDER_SELECTOR, @_$component\r\n {_$values, _$valueHolder, _$defaultValues}\r\n\r\n _constructor: ->\r\n {\r\n @_$values,\r\n @_$valueHolder,\r\n @_$defaultValues\r\n } = @_getConfig()\r\n @_setValueHolderAttribute()\r\n @_setValueHolderValue()\r\n\r\n _onMutations: ->\r\n @_constructor()\r\n\r\n _setValueHolderValue: ->\r\n values = []\r\n @_$values.forEach ($value, index) =>\r\n if $value.checked\r\n if $value.hasAttribute @constructor._VALUE_ATTRIBUTE\r\n value = $value.getAttribute @constructor._VALUE_ATTRIBUTE\r\n else\r\n value = @_$defaultValues[index].innerText\r\n values.push value if value and not values.includes value\r\n if @_$valueHolder\r\n @_$valueHolder.value = values.join @constructor._VALUE_SPLITOR\r\n\r\n _setValueHolderAttribute: ->\r\n @_$valueHolder.setAttribute('readonly', '') if @_$valueHolder\r\n\r\n @_init: ->\r\n self = this\r\n luda.enterClick._add @_ENTER_CLICK_VALUE_HOLDER_SELECTOR\r\n luda.on 'change', \"#{@_SELECTOR} #{@_VALUE_SELECTOR}\", (e) ->\r\n self.query(luda.$parent self._SELECTOR, this)._setValueHolderValue()\r\n luda.on luda._FORM_RESET, @_SELECTOR, (e) ->\r\n setTimeout => self.query(this)._setValueHolderValue()\r\n # prevent ios device pop out wired navigation pannel\r\n if /iphone/i.test(navigator.userAgent) or /ipad/i.test(navigator.userAgent)\r\n luda.on 'focusin', @_ENTER_CLICK_VALUE_HOLDER_SELECTOR, (e) ->\r\n this.blur()\r\n this.classList.add luda.focus._CSS_CLASS","import '../install.coffee'\r\nimport '../dom.coffee'\r\nimport '../event.coffee'\r\nimport '../component.coffee'\r\n\r\n\r\n\r\nluda class extends luda.Component\r\n\r\n @_SCOPE: 'tab'\r\n\r\n @_SELECTOR: '.tab'\r\n @_PANE_SELECTOR: '.tab-pane'\r\n @_INDICATOR_SELECTOR: '.tab-indicators .btn-radio input[type=radio]'\r\n @_PANE_ACTIVE_CSS_CLASS: 'tab-pane-active'\r\n @_ACTIVE_INDEX: 0\r\n @_ACTIVED_EVENT_TYPE: \"#{@_SCOPE}:actived\"\r\n @_DEACTIVED_EVENT_TYPE: \"#{@_SCOPE}:deactived\"\r\n\r\n @_observerConfig:\r\n childList: true\r\n subtree: true\r\n \r\n # public\r\n active: (index) ->\r\n if @_$panes.length\r\n activedIndex = @_activeIndex\r\n if index? \\\r\n and index isnt @_activeIndex \\\r\n and 0 <= index <= @_$panes.length - 1\r\n @_activeIndex = index\r\n @_active(activedIndex)\r\n\r\n # private\r\n _getConfig: ->\r\n _$panes = luda.$unnested \\\r\n @constructor._PANE_SELECTOR, @_$component, @constructor._SELECTOR\r\n _$indicators = luda.$unnested \\\r\n @constructor._INDICATOR_SELECTOR, @_$component, @constructor._SELECTOR\r\n _activeIndex = @constructor._ACTIVE_INDEX\r\n _$indicators.some ($indicator, index) ->\r\n if $indicator.checked\r\n _activeIndex = index\r\n true\r\n {_$panes, _$indicators, _activeIndex}\r\n\r\n _constructor: ->\r\n {\r\n @_$panes,\r\n @_$indicators,\r\n @_activeIndex\r\n } = @_getConfig()\r\n @_active()\r\n\r\n _onMutations: (mutations) ->\r\n @_constructor()\r\n\r\n _active: (activedIndex) ->\r\n @_$panes.forEach ($pane, index) =>\r\n if index is @_activeIndex\r\n $pane.classList.add @constructor._PANE_ACTIVE_CSS_CLASS\r\n luda.dispatch($pane, @constructor._ACTIVED_EVENT_TYPE, index)\r\n else\r\n $pane.classList.remove @constructor._PANE_ACTIVE_CSS_CLASS\r\n if index is activedIndex\r\n luda.dispatch($pane, @constructor._DEACTIVED_EVENT_TYPE, index)\r\n @_setIndicatorsState()\r\n\r\n _setIndicatorsState: ->\r\n @_$indicators.forEach ($indicator, index) =>\r\n if index is @_activeIndex\r\n $indicator.setAttribute 'checked', ''\r\n else\r\n $indicator.removeAttribute 'checked'\r\n\r\n # static private\r\n @_init: ->\r\n self = this\r\n luda.on 'change', @_INDICATOR_SELECTOR, (e) ->\r\n if this.checked\r\n instance = self.query luda.$parent self._SELECTOR, this\r\n instance.active instance._$indicators.indexOf this"]}
@@ -0,0 +1,38 @@
1
+ //= require ../install
2
+ //= require ../constants
3
+ //= require ../event
4
+ //= require ../singleton
5
+ (function (global, factory) {
6
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../constants.js'), require('../event.js'), require('../singleton.js')) :
7
+ typeof define === 'function' && define.amd ? define(['../install.js', '../constants.js', '../event.js', '../singleton.js'], factory) :
8
+ (factory());
9
+ }(this, (function () { 'use strict';
10
+
11
+ luda((function() {
12
+ var _Class;
13
+
14
+ _Class = class extends luda.Singleton {
15
+ static _init() {
16
+ var self;
17
+ self = this;
18
+ return luda.on('keydown', function(e) {
19
+ if (self._actived && e.keyCode === luda.KEY_ENTER && e.target.matches(self._selector)) {
20
+ e.preventDefault();
21
+ return setTimeout(function() {
22
+ return e.target.click();
23
+ });
24
+ }
25
+ });
26
+ }
27
+
28
+ };
29
+
30
+ _Class._SCOPE = 'enterClick';
31
+
32
+ _Class._SELECTORS = ['input[type=checkbox]', 'input[type=radio]', '[tabindex]'];
33
+
34
+ return _Class;
35
+
36
+ }).call(this));
37
+
38
+ })));
@@ -0,0 +1,103 @@
1
+ //= require ../install
2
+ //= require ../dom
3
+ //= require ../event
4
+ //= require ../singleton
5
+ (function (global, factory) {
6
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../dom.js'), require('../event.js'), require('../singleton.js')) :
7
+ typeof define === 'function' && define.amd ? define(['../install.js', '../dom.js', '../event.js', '../singleton.js'], factory) :
8
+ (factory());
9
+ }(this, (function () { 'use strict';
10
+
11
+ luda((function() {
12
+ var _Class;
13
+
14
+ _Class = class extends luda.Singleton {
15
+ static _removeFocusClassExcept($exception) {
16
+ return Array.from(this._$focus).forEach(($focus) => {
17
+ if ($focus !== $exception) {
18
+ return $focus.classList.remove(this._CSS_CLASS);
19
+ }
20
+ });
21
+ }
22
+
23
+ static _addFocusClassExceptHtmlAndBody($target) {
24
+ if ($target !== document.body && $target !== document.documentElement) {
25
+ return $target.classList.add(this._CSS_CLASS);
26
+ }
27
+ }
28
+
29
+ static _changeFocusStateOnKeyEvent(e) {
30
+ if (this._actived) {
31
+ this._removeFocusClassExcept(e.target);
32
+ return this._addFocusClassExceptHtmlAndBody(e.target);
33
+ }
34
+ }
35
+
36
+ static _changeFocusStateOnMouseDownEvent(e) {
37
+ var target;
38
+ if (this._actived) {
39
+ if (e.target.matches(this._PARENT_FOCUS_CHILDREN_SELECTOR)) {
40
+ target = luda.$parent(this._PARENT_FOCUS_SELECTOR, e.target);
41
+ } else {
42
+ target = e.target;
43
+ }
44
+ if (target.matches(this._selector)) {
45
+ this._removeFocusClassExcept(target);
46
+ return this._addFocusClassExceptHtmlAndBody(target);
47
+ } else {
48
+ return this._removeFocusClassExcept();
49
+ }
50
+ }
51
+ }
52
+
53
+ static _setElementPrototype() {
54
+ var blur, focus, self;
55
+ focus = HTMLElement.prototype.focus;
56
+ blur = HTMLElement.prototype.blur;
57
+ self = this;
58
+ HTMLElement.prototype.focus = function() {
59
+ focus.apply(this, arguments);
60
+ if (self._actived && document.activeElement === this) {
61
+ self._removeFocusClassExcept(this);
62
+ return self._addFocusClassExceptHtmlAndBody(this);
63
+ }
64
+ };
65
+ return HTMLElement.prototype.blur = function() {
66
+ blur.apply(this, arguments);
67
+ if (self._actived) {
68
+ return this.classList.remove(self._CSS_CLASS);
69
+ }
70
+ };
71
+ }
72
+
73
+ static _init() {
74
+ this._setElementPrototype();
75
+ luda.on('keydown', this._changeFocusStateOnKeyEvent.bind(this));
76
+ luda.on('keyup', this._changeFocusStateOnKeyEvent.bind(this));
77
+ luda.on('mousedown', this._changeFocusStateOnMouseDownEvent.bind(this));
78
+ luda.on('touchstart', this._TOUCHSTART_FOCUS_SELECTOR, this._changeFocusStateOnMouseDownEvent.bind(this));
79
+ return luda.on('focusin', this._changeFocusStateOnMouseDownEvent.bind(this));
80
+ }
81
+
82
+ };
83
+
84
+ _Class._SCOPE = 'focus';
85
+
86
+ _Class._CSS_CLASS = 'focus';
87
+
88
+ // mouse focusable selectors
89
+ _Class._SELECTORS = ['select', 'textarea', ':not(.btn-check):not(.btn-radio):not(.btn-file) > input:not([type=button]):not([type=submit]):not([type=reset])'];
90
+
91
+ _Class._TOUCHSTART_FOCUS_SELECTOR = 'input[type=range]';
92
+
93
+ _Class._PARENT_FOCUS_SELECTOR = 'select[multiple]';
94
+
95
+ _Class._PARENT_FOCUS_CHILDREN_SELECTOR = `${_Class._PARENT_FOCUS_SELECTOR} *`;
96
+
97
+ _Class._$focus = document.getElementsByClassName(_Class._CSS_CLASS);
98
+
99
+ return _Class;
100
+
101
+ }).call(this));
102
+
103
+ })));
@@ -0,0 +1,69 @@
1
+ //= require ../install
2
+ //= require ../constants
3
+ //= require ../dom
4
+ //= require ../event
5
+ //= require ../singleton
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../constants.js'), require('../dom.js'), require('../event.js'), require('../singleton.js')) :
8
+ typeof define === 'function' && define.amd ? define(['../install.js', '../constants.js', '../dom.js', '../event.js', '../singleton.js'], factory) :
9
+ (factory());
10
+ }(this, (function () { 'use strict';
11
+
12
+ luda((function() {
13
+ var _Class;
14
+
15
+ _Class = class extends luda.Singleton {
16
+ static _querySameName$radios($radio) {
17
+ var $inputs, selector;
18
+ if ($radio.name) {
19
+ selector = `${this._selector}[name=${$radio.name}]`;
20
+ } else {
21
+ selector = this._selector;
22
+ }
23
+ $inputs = luda.$children(selector);
24
+ return $inputs.filter(function($input) {
25
+ return $input.tabIndex >= 0;
26
+ });
27
+ }
28
+
29
+ static _query$prev$next($radio) {
30
+ var $next, $prev, $sameNameRadios, radioIndex;
31
+ $sameNameRadios = this._querySameName$radios($radio);
32
+ radioIndex = $sameNameRadios.indexOf($radio);
33
+ $prev = $sameNameRadios[radioIndex - 1];
34
+ $next = $sameNameRadios[radioIndex + 1];
35
+ return {$prev, $next};
36
+ }
37
+
38
+ static _init() {
39
+ var self;
40
+ self = this;
41
+ return luda.on('keydown', function(e) {
42
+ var $next, $prev;
43
+ if (self._actived && e.keyCode === luda.KEY_TAB && e.target.nodeName.toUpperCase() === 'INPUT' && e.target.type === 'radio') {
44
+ if (e.shiftKey) {
45
+ if ($prev = self._query$prev$next(e.target).$prev) {
46
+ e.preventDefault();
47
+ return $prev.focus();
48
+ }
49
+ } else {
50
+ if ($next = self._query$prev$next(e.target).$next) {
51
+ e.preventDefault();
52
+ return $next.focus();
53
+ }
54
+ }
55
+ }
56
+ });
57
+ }
58
+
59
+ };
60
+
61
+ _Class._SCOPE = 'radioTab';
62
+
63
+ _Class._SELECTORS = ['input[type=radio]:not([disabled])'];
64
+
65
+ return _Class;
66
+
67
+ }).call(this));
68
+
69
+ })));
@@ -0,0 +1,57 @@
1
+ //= require ../install
2
+ //= require ../component
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../component.js')) :
5
+ typeof define === 'function' && define.amd ? define(['../install.js', '../component.js'], factory) :
6
+ (factory());
7
+ }(this, (function () { 'use strict';
8
+
9
+ luda((function() {
10
+ var _Class;
11
+
12
+ _Class = class extends luda.Component {
13
+ _getConfig() {
14
+ var _isReadonly, _originalTabIndex, readonly;
15
+ readonly = this._$component.getAttribute(this.constructor._READONLY_ATTRIBUTE);
16
+ _isReadonly = readonly !== this.constructor._READONLY_FALSE_VALUE;
17
+ _originalTabIndex = this._$component.tabIndex;
18
+ return {_isReadonly, _originalTabIndex};
19
+ }
20
+
21
+ _constructor() {
22
+ ({_isReadonly: this._isReadonly, _originalTabIndex: this._originalTabIndex} = this._getConfig());
23
+ return this._setTabIndex();
24
+ }
25
+
26
+ _onMutations() {
27
+ return this._constructor();
28
+ }
29
+
30
+ _setTabIndex() {
31
+ if (this._isReadonly) {
32
+ return this._$component.tabIndex = -1;
33
+ } else {
34
+ return this._$component.tabIndex = this._originalTabIndex;
35
+ }
36
+ }
37
+
38
+ };
39
+
40
+ _Class._SCOPE = 'readonly';
41
+
42
+ _Class._READONLY_ATTRIBUTE = 'data-readonly';
43
+
44
+ _Class._READONLY_FALSE_VALUE = 'false';
45
+
46
+ _Class._SELECTOR = `[${_Class._READONLY_ATTRIBUTE}]`;
47
+
48
+ _Class._observerConfig = {
49
+ attributes: true,
50
+ attributeFilter: [_Class._READONLY_ATTRIBUTE]
51
+ };
52
+
53
+ return _Class;
54
+
55
+ }).call(this));
56
+
57
+ })));
@@ -0,0 +1,104 @@
1
+ //= require ../install
2
+ //= require ../dom
3
+ //= require ../event
4
+ //= require ../singleton
5
+ (function (global, factory) {
6
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../dom.js'), require('../event.js'), require('../singleton.js')) :
7
+ typeof define === 'function' && define.amd ? define(['../install.js', '../dom.js', '../event.js', '../singleton.js'], factory) :
8
+ (factory());
9
+ }(this, (function () { 'use strict';
10
+
11
+ luda((function() {
12
+ var _Class;
13
+
14
+ _Class = class extends luda.Singleton {
15
+ static active(name$target) {
16
+ return this._query$targets(name$target).forEach(($target) => {
17
+ $target.classList.add(this._ACTIVE_CSS_CLASS);
18
+ return luda.dispatch($target, this._ACTIVED_EVENT_TYPE);
19
+ });
20
+ }
21
+
22
+ static deactive(name$target) {
23
+ return this._query$targets(name$target).forEach(($target) => {
24
+ $target.classList.remove(this._ACTIVE_CSS_CLASS);
25
+ return luda.dispatch($target, this._DEACTIVED_EVENT_TYPE);
26
+ });
27
+ }
28
+
29
+ static toggle(name$target) {
30
+ return this._query$targets(name$target).forEach(($target) => {
31
+ if ($target.classList.contains(this._ACTIVE_CSS_CLASS)) {
32
+ return this.deactive($target);
33
+ } else {
34
+ return this.active($target);
35
+ }
36
+ });
37
+ }
38
+
39
+ static _query$targets(name$target) {
40
+ if (name$target instanceof Element) {
41
+ return [name$target];
42
+ } else {
43
+ return luda.$children(`[${this._TOGGLE_TARGET_ATTRIBUTE}=${name$target}]`);
44
+ }
45
+ }
46
+
47
+ static _init() {
48
+ var self;
49
+ self = this;
50
+ return luda.on('click', this._selector, function(e) {
51
+ var toggleChecked;
52
+ toggleChecked = false;
53
+ return luda.eventPath(e).some(function($path) {
54
+ var $toggle, toggleName;
55
+ if ($path instanceof Element) {
56
+ if ($path.hasAttribute(self._TOGGLE_ATTRIBUTE) || $path.hasAttribute(self._TOGGLE_FOR_ATTRIBUTE)) {
57
+ if (toggleName = $path.getAttribute(self._TOGGLE_FOR_ATTRIBUTE)) {
58
+ self.toggle(toggleName);
59
+ toggleChecked = true;
60
+ }
61
+ if ($path.hasAttribute(self._TOGGLE_ATTRIBUTE)) {
62
+ if ($path.hasAttribute(self._TOGGLE_TARGET_ATTRIBUTE)) {
63
+ $toggle = $path;
64
+ } else {
65
+ $toggle = luda.$parent(`[${self._TOGGLE_TARGET_ATTRIBUTE}]`, $path);
66
+ }
67
+ if ($toggle) {
68
+ self.toggle($toggle);
69
+ return toggleChecked = true;
70
+ }
71
+ }
72
+ } else if ($path.hasAttribute(self._NONE_TOGGLE_ATTRIBUTE)) {
73
+ return toggleChecked = true;
74
+ }
75
+ }
76
+ });
77
+ });
78
+ }
79
+
80
+ };
81
+
82
+ _Class._SCOPE = 'toggle';
83
+
84
+ _Class._TOGGLE_TARGET_ATTRIBUTE = 'data-toggle-target';
85
+
86
+ _Class._TOGGLE_ATTRIBUTE = 'data-toggle';
87
+
88
+ _Class._TOGGLE_FOR_ATTRIBUTE = 'data-toggle-for';
89
+
90
+ _Class._NONE_TOGGLE_ATTRIBUTE = 'data-none-toggle';
91
+
92
+ _Class._ACTIVE_CSS_CLASS = 'toggle-active';
93
+
94
+ _Class._SELECTORS = [`[${_Class._TOGGLE_FOR_ATTRIBUTE}]`, `[${_Class._TOGGLE_ATTRIBUTE}]`];
95
+
96
+ _Class._ACTIVED_EVENT_TYPE = `${_Class._SCOPE}:actived`;
97
+
98
+ _Class._DEACTIVED_EVENT_TYPE = `${_Class._SCOPE}:deactived`;
99
+
100
+ return _Class;
101
+
102
+ }).call(this));
103
+
104
+ })));
@@ -0,0 +1,314 @@
1
+ //= require ../install
2
+ //= require ../dom
3
+ //= require ../event
4
+ //= require ../component
5
+ (function (global, factory) {
6
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../install.js'), require('../dom.js'), require('../event.js'), require('../component.js')) :
7
+ typeof define === 'function' && define.amd ? define(['../install.js', '../dom.js', '../event.js', '../component.js'], factory) :
8
+ (factory());
9
+ }(this, (function () { 'use strict';
10
+
11
+ luda((function() {
12
+ var _Class;
13
+
14
+ _Class = class extends luda.Component {
15
+
16
+ // public
17
+ active(index) {
18
+ var action, activedIndex;
19
+ if (this._$items.length && !this._transiting) {
20
+ activedIndex = this._activeIndex;
21
+ if ((index != null) && index !== this._activeIndex && (0 <= index && index <= this._$items.length - 1)) {
22
+ this._transiting = true;
23
+ this._activeIndex = index;
24
+ action = index < activedIndex ? '_slidePrev' : '_slideNext';
25
+ return this[action](this._$items[activedIndex], activedIndex);
26
+ }
27
+ }
28
+ }
29
+
30
+ next() {
31
+ var activedIndex, index;
32
+ if (this._$items.length && !this._transiting) {
33
+ activedIndex = this._activeIndex;
34
+ index = activedIndex + 1;
35
+ if (index > this._$items.length - 1) {
36
+ if (!this._wrap) {
37
+ return;
38
+ }
39
+ index = 0;
40
+ }
41
+ this._transiting = true;
42
+ this._activeIndex = index;
43
+ this._slideNext(this._$items[activedIndex], activedIndex);
44
+ this._playTimeStamp = Date.now();
45
+ return this._pausedRemainTime = this._interval;
46
+ }
47
+ }
48
+
49
+ prev() {
50
+ var activedIndex, index;
51
+ if (this._$items.length && !this._transiting) {
52
+ activedIndex = this._activeIndex;
53
+ index = activedIndex - 1;
54
+ if (index < 0) {
55
+ if (!this._wrap) {
56
+ return;
57
+ }
58
+ index = this._$items.length - 1;
59
+ }
60
+ this._transiting = true;
61
+ this._activeIndex = index;
62
+ this._slidePrev(this._$items[activedIndex], activedIndex);
63
+ this._playTimeStamp = Date.now();
64
+ return this._pausedRemainTime = this._interval;
65
+ }
66
+ }
67
+
68
+ pause() {
69
+ if (this._intervaling != null) {
70
+ clearInterval(this._intervaling);
71
+ this._intervaling = null;
72
+ return this._pausedRemainTime = this._pausedRemainTime - (Date.now() - this._playTimeStamp);
73
+ }
74
+ }
75
+
76
+ play() {
77
+ var execute;
78
+ if (this._interval && this._$items.length > 1) {
79
+ this._playTimeStamp = Date.now();
80
+ this.pause();
81
+ execute = () => {
82
+ this.next();
83
+ return this._intervaling = setInterval(this.next.bind(this), this._interval);
84
+ };
85
+ return this._intervaling = setTimeout(execute, this._pausedRemainTime);
86
+ }
87
+ }
88
+
89
+ // private
90
+ _getConfig() {
91
+ var _$indicators, _$items, _$nextControl, _$prevControl, _activeIndex, _interval, _wrap;
92
+ _$items = luda.$unnested(this.constructor._ITEMS_SELECTOR, this._$component, this.constructor._SELECTOR);
93
+ _$indicators = luda.$unnested(this.constructor._INDICATORS_SELECTOR, this._$component, this.constructor._SELECTOR);
94
+ _$prevControl = luda.$child(this.constructor._PREV_CONTROL_SELECTOR, this._$component);
95
+ _$nextControl = luda.$child(this.constructor._NEXT_CONTROL_SELECTOR, this._$component);
96
+ _activeIndex = _$items.indexOf(luda.$child(`.${this.constructor._ITEM_ACTIVE_CSS_CLASS}`, this._$component));
97
+ if (_activeIndex === -1) {
98
+ _activeIndex = this.constructor._ACTIVE_INDEX;
99
+ }
100
+ _interval = this._$component.getAttribute(this.constructor._INTERVAL_ATTRIBUTE);
101
+ if (_interval === this.constructor._FALSE) {
102
+ _interval = false;
103
+ } else {
104
+ _interval = Math.abs(parseInt(_interval, 10)) || this.constructor._INTERVAL;
105
+ }
106
+ _wrap = this._$component.getAttribute(this.constructor._WRAP_ATTRIBUTE);
107
+ _wrap = _wrap === this.constructor._FALSE ? false : this.constructor._WRAP;
108
+ return {_$items, _$indicators, _$prevControl, _$nextControl, _activeIndex, _interval, _wrap};
109
+ }
110
+
111
+ _constructor() {
112
+ ({_$items: this._$items, _$indicators: this._$indicators, _$prevControl: this._$prevControl, _$nextControl: this._$nextControl, _activeIndex: this._activeIndex, _interval: this._interval, _wrap: this._wrap} = this._getConfig());
113
+ this._transiting = false;
114
+ this._intervaling = null;
115
+ this._playTimeStamp = 0;
116
+ this._pausedRemainTime = this._interval;
117
+ this._layout();
118
+ return this.play();
119
+ }
120
+
121
+ _onMutations(mutations) {
122
+ ({_$items: this._$items, _$indicators: this._$indicators, _$prevControl: this._$prevControl, _$nextControl: this._$nextControl, _activeIndex: this._activeIndex, _interval: this._interval, _wrap: this._wrap} = this._getConfig());
123
+ this._setIndicatorsState();
124
+ this._setDirectionControlState();
125
+ return this.play();
126
+ }
127
+
128
+ _destroy() {
129
+ return this.pause();
130
+ }
131
+
132
+ _layout() {
133
+ this._$items.forEach(($item, index) => {
134
+ $item.style.transition = 'none';
135
+ if (index > this._activeIndex) {
136
+ $item.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);
137
+ $item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);
138
+ $item.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);
139
+ } else if (index < this._activeIndex) {
140
+ $item.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);
141
+ $item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);
142
+ $item.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);
143
+ } else {
144
+ luda.dispatch($item, this.constructor._ACTIVED_EVENT_TYPE, index);
145
+ $item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);
146
+ $item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);
147
+ $item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);
148
+ }
149
+ luda.reflow($item);
150
+ return $item.style.transition = '';
151
+ });
152
+ this._setIndicatorsState();
153
+ return this._setDirectionControlState();
154
+ }
155
+
156
+ _slideNext($activedItem, activedIndex) {
157
+ var $item;
158
+ if (this._$items.length > 1) {
159
+ $item = this._$items[this._activeIndex];
160
+ luda.dispatch($item, this.constructor._ACTIVE_EVENT_TYPE, this._activeIndex);
161
+ $item.style.transition = 'none';
162
+ $item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);
163
+ $item.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);
164
+ luda.reflow($item);
165
+ $item.style.transition = '';
166
+ $item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);
167
+ $item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);
168
+ luda.dispatch($activedItem, this.constructor._DEACTIVE_EVENT_TYPE, activedIndex);
169
+ $activedItem.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);
170
+ $activedItem.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);
171
+ this._setIndicatorsState();
172
+ return this._setDirectionControlState();
173
+ }
174
+ }
175
+
176
+ _slidePrev($activedItem, activedIndex) {
177
+ var $item;
178
+ if (this._$items.length > 1) {
179
+ $item = this._$items[this._activeIndex];
180
+ luda.dispatch($item, this.constructor._ACTIVE_EVENT_TYPE, this._activeIndex);
181
+ $item.style.transition = 'none';
182
+ $item.classList.remove(this.constructor._ITEM_NEXT_CSS_CLASS);
183
+ $item.classList.add(this.constructor._ITEM_PREV_CSS_CLASS);
184
+ luda.reflow($item);
185
+ $item.style.transition = '';
186
+ $item.classList.remove(this.constructor._ITEM_PREV_CSS_CLASS);
187
+ $item.classList.add(this.constructor._ITEM_ACTIVE_CSS_CLASS);
188
+ luda.dispatch($activedItem, this.constructor._DEACTIVE_EVENT_TYPE, activedIndex);
189
+ $activedItem.classList.remove(this.constructor._ITEM_ACTIVE_CSS_CLASS);
190
+ $activedItem.classList.add(this.constructor._ITEM_NEXT_CSS_CLASS);
191
+ this._setIndicatorsState();
192
+ return this._setDirectionControlState();
193
+ }
194
+ }
195
+
196
+ _setIndicatorsState() {
197
+ return this._$indicators.forEach(($indicator, index) => {
198
+ return $indicator.disabled = index === this._activeIndex;
199
+ });
200
+ }
201
+
202
+ _setDirectionControlState() {
203
+ var ref, ref1, ref2, ref3;
204
+ if (this._$items.length <= 1) {
205
+ return (ref = this._$prevControl) != null ? ref.disabled = (ref1 = this._$nextControl) != null ? ref1.disabled = true : void 0 : void 0;
206
+ } else {
207
+ if ((ref2 = this._$prevControl) != null) {
208
+ ref2.disabled = this._activeIndex === 0 && !this._wrap;
209
+ }
210
+ return (ref3 = this._$nextControl) != null ? ref3.disabled = this._activeIndex === this._$items.length - 1 && !this._wrap : void 0;
211
+ }
212
+ }
213
+
214
+
215
+ // static private
216
+ static _init() {
217
+ var self;
218
+ self = this;
219
+ luda.on('transitionend', this._ITEMS_SELECTOR, function(e) {
220
+ var index, instance;
221
+ instance = self.query(luda.$parent(self._SELECTOR, this));
222
+ instance._transiting = false;
223
+ index = instance._$items.indexOf(this);
224
+ if (this.classList.contains(self._ITEM_ACTIVE_CSS_CLASS)) {
225
+ return luda.dispatch(this, self._ACTIVED_EVENT_TYPE, index);
226
+ } else {
227
+ return luda.dispatch(this, self._DEACTIVED_EVENT_TYPE, index);
228
+ }
229
+ });
230
+ luda.on('click', this._INDICATORS_SELECTOR, function(e) {
231
+ var instance;
232
+ instance = self.query(luda.$parent(self._SELECTOR, this));
233
+ return instance.active(instance._$indicators.indexOf(this));
234
+ });
235
+ luda.on('touchstart', this._SELECTOR, function(e) {
236
+ return self.query(this).pause();
237
+ });
238
+ luda.on('touchend', this._SELECTOR, function(e) {
239
+ return setTimeout(() => {
240
+ return self.query(this).play();
241
+ });
242
+ });
243
+ luda.on('mouseover', this._SELECTOR, function(e) {
244
+ return self.query(this).pause();
245
+ });
246
+ luda.on('mouseout', this._SELECTOR, function(e) {
247
+ return self.query(this).play();
248
+ });
249
+ luda.on(luda._SWIPE_LEFT_OR_UP, this._SELECTOR, function(startE, e) {
250
+ return self.query(this).next();
251
+ });
252
+ luda.on(luda._SWIPE_RIGHT_OR_DOWN, this._SELECTOR, function(startE, e) {
253
+ return self.query(this).prev();
254
+ });
255
+ luda.on('click', this._PREV_CONTROL_SELECTOR, function(e) {
256
+ return self.query(luda.$parent(self._SELECTOR, this)).prev();
257
+ });
258
+ return luda.on('click', this._NEXT_CONTROL_SELECTOR, function(e) {
259
+ return self.query(luda.$parent(self._SELECTOR, this)).next();
260
+ });
261
+ }
262
+
263
+ };
264
+
265
+ _Class._SCOPE = 'carousel';
266
+
267
+ _Class._SELECTOR = '.carousel';
268
+
269
+ _Class._ITEMS_SELECTOR = '.carousel-item';
270
+
271
+ _Class._PREV_CONTROL_SELECTOR = '.carousel-prev';
272
+
273
+ _Class._NEXT_CONTROL_SELECTOR = '.carousel-next';
274
+
275
+ _Class._INDICATORS_SELECTOR = '.carousel-indicators .btn';
276
+
277
+ _Class._INTERVAL_ATTRIBUTE = 'data-carousel-interval';
278
+
279
+ _Class._WRAP_ATTRIBUTE = 'data-carousel-wrap';
280
+
281
+ _Class._ITEM_ACTIVE_CSS_CLASS = 'carousel-item-active';
282
+
283
+ _Class._ITEM_NEXT_CSS_CLASS = 'carousel-item-next';
284
+
285
+ _Class._ITEM_PREV_CSS_CLASS = 'carousel-item-prev';
286
+
287
+ _Class._ACTIVE_INDEX = 0;
288
+
289
+ _Class._INTERVAL = 5000;
290
+
291
+ _Class._WRAP = true;
292
+
293
+ _Class._FALSE = 'false';
294
+
295
+ _Class._ACTIVE_EVENT_TYPE = `${_Class._SCOPE}:active`;
296
+
297
+ _Class._ACTIVED_EVENT_TYPE = `${_Class._SCOPE}:actived`;
298
+
299
+ _Class._DEACTIVE_EVENT_TYPE = `${_Class._SCOPE}:deactive`;
300
+
301
+ _Class._DEACTIVED_EVENT_TYPE = `${_Class._SCOPE}:deactived`;
302
+
303
+ _Class._observerConfig = {
304
+ childList: true,
305
+ attributes: true,
306
+ subtree: true,
307
+ attributeFilter: [_Class._INTERVAL_ATTRIBUTE, _Class._WRAP_ATTRIBUTE]
308
+ };
309
+
310
+ return _Class;
311
+
312
+ }).call(this));
313
+
314
+ })));