fomantic-ui 2.9.1-beta.3 → 2.9.1-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (540) hide show
  1. package/.eslint/eqeqeq-rule.js +18 -0
  2. package/.eslint/index.js +29 -0
  3. package/.eslint/no-extra-parens-rule.js +17 -0
  4. package/.eslint/package.json +11 -0
  5. package/.eslintrc.js +123 -0
  6. package/.github/workflows/ci.yml +37 -4
  7. package/.github/workflows/nightly.yml +1 -1
  8. package/.github/workflows/release.yml +1 -1
  9. package/.prettierrc.js +12 -0
  10. package/.stylelintrc.js +48 -0
  11. package/README.md +1 -1
  12. package/dist/components/accordion.css +35 -53
  13. package/dist/components/accordion.js +568 -595
  14. package/dist/components/accordion.min.css +2 -2
  15. package/dist/components/accordion.min.js +2 -2
  16. package/dist/components/ad.css +34 -45
  17. package/dist/components/ad.min.css +2 -2
  18. package/dist/components/api.js +1157 -1179
  19. package/dist/components/api.min.js +2 -2
  20. package/dist/components/breadcrumb.css +5 -5
  21. package/dist/components/breadcrumb.min.css +2 -2
  22. package/dist/components/button.css +709 -1121
  23. package/dist/components/button.min.css +2 -2
  24. package/dist/components/calendar.css +24 -27
  25. package/dist/components/calendar.js +1934 -1809
  26. package/dist/components/calendar.min.css +2 -2
  27. package/dist/components/calendar.min.js +2 -2
  28. package/dist/components/card.css +219 -365
  29. package/dist/components/card.min.css +2 -2
  30. package/dist/components/checkbox.css +119 -187
  31. package/dist/components/checkbox.js +842 -841
  32. package/dist/components/checkbox.min.css +2 -2
  33. package/dist/components/checkbox.min.js +2 -2
  34. package/dist/components/comment.css +41 -59
  35. package/dist/components/comment.min.css +2 -2
  36. package/dist/components/container.css +7 -6
  37. package/dist/components/container.min.css +2 -2
  38. package/dist/components/dimmer.css +53 -172
  39. package/dist/components/dimmer.js +706 -737
  40. package/dist/components/dimmer.min.css +2 -2
  41. package/dist/components/dimmer.min.js +2 -2
  42. package/dist/components/divider.css +43 -61
  43. package/dist/components/divider.min.css +2 -2
  44. package/dist/components/dropdown.css +252 -386
  45. package/dist/components/dropdown.js +4179 -4236
  46. package/dist/components/dropdown.min.css +2 -2
  47. package/dist/components/dropdown.min.js +2 -2
  48. package/dist/components/embed.css +18 -29
  49. package/dist/components/embed.js +645 -675
  50. package/dist/components/embed.min.css +2 -2
  51. package/dist/components/embed.min.js +2 -2
  52. package/dist/components/emoji.css +9 -9
  53. package/dist/components/emoji.min.css +1 -1
  54. package/dist/components/feed.css +35 -57
  55. package/dist/components/feed.min.css +2 -2
  56. package/dist/components/flag.css +6 -4
  57. package/dist/components/flag.min.css +2 -2
  58. package/dist/components/flyout.css +86 -141
  59. package/dist/components/flyout.js +1457 -1465
  60. package/dist/components/flyout.min.css +2 -2
  61. package/dist/components/flyout.min.js +2 -2
  62. package/dist/components/form.css +244 -339
  63. package/dist/components/form.js +2020 -2004
  64. package/dist/components/form.min.css +2 -2
  65. package/dist/components/form.min.js +2 -2
  66. package/dist/components/grid.css +172 -319
  67. package/dist/components/grid.min.css +2 -2
  68. package/dist/components/header.css +118 -142
  69. package/dist/components/header.min.css +2 -2
  70. package/dist/components/icon.css +660 -718
  71. package/dist/components/icon.min.css +2 -2
  72. package/dist/components/image.css +39 -63
  73. package/dist/components/image.min.css +2 -2
  74. package/dist/components/input.css +356 -274
  75. package/dist/components/input.min.css +2 -2
  76. package/dist/components/item.css +84 -131
  77. package/dist/components/item.min.css +2 -2
  78. package/dist/components/label.css +359 -410
  79. package/dist/components/label.min.css +2 -2
  80. package/dist/components/list.css +49 -70
  81. package/dist/components/list.min.css +2 -2
  82. package/dist/components/loader.css +67 -155
  83. package/dist/components/loader.min.css +2 -2
  84. package/dist/components/menu.css +269 -431
  85. package/dist/components/menu.min.css +1 -1
  86. package/dist/components/message.css +125 -197
  87. package/dist/components/message.min.css +2 -2
  88. package/dist/components/modal.css +119 -154
  89. package/dist/components/modal.js +1488 -1486
  90. package/dist/components/modal.min.css +2 -2
  91. package/dist/components/modal.min.js +2 -2
  92. package/dist/components/nag.css +53 -63
  93. package/dist/components/nag.js +520 -526
  94. package/dist/components/nag.min.css +2 -2
  95. package/dist/components/nag.min.js +2 -2
  96. package/dist/components/placeholder.css +22 -42
  97. package/dist/components/placeholder.min.css +2 -2
  98. package/dist/components/popup.css +423 -201
  99. package/dist/components/popup.js +1454 -1456
  100. package/dist/components/popup.min.css +2 -2
  101. package/dist/components/popup.min.js +2 -2
  102. package/dist/components/progress.css +106 -211
  103. package/dist/components/progress.js +969 -997
  104. package/dist/components/progress.min.css +2 -2
  105. package/dist/components/progress.min.js +2 -2
  106. package/dist/components/rail.css +15 -20
  107. package/dist/components/rail.min.css +1 -1
  108. package/dist/components/rating.css +80 -121
  109. package/dist/components/rating.js +505 -523
  110. package/dist/components/rating.min.css +2 -2
  111. package/dist/components/rating.min.js +2 -2
  112. package/dist/components/reset.css +8 -13
  113. package/dist/components/reset.min.css +2 -2
  114. package/dist/components/reveal.css +44 -83
  115. package/dist/components/reveal.min.css +2 -2
  116. package/dist/components/search.css +69 -98
  117. package/dist/components/search.js +1493 -1534
  118. package/dist/components/search.min.css +2 -2
  119. package/dist/components/search.min.js +2 -2
  120. package/dist/components/segment.css +148 -224
  121. package/dist/components/segment.min.css +2 -2
  122. package/dist/components/shape.css +14 -30
  123. package/dist/components/shape.js +781 -810
  124. package/dist/components/shape.min.css +2 -2
  125. package/dist/components/shape.min.js +2 -2
  126. package/dist/components/sidebar.css +103 -206
  127. package/dist/components/sidebar.js +1061 -1099
  128. package/dist/components/sidebar.min.css +2 -2
  129. package/dist/components/sidebar.min.js +2 -2
  130. package/dist/components/site.css +28 -41
  131. package/dist/components/site.js +436 -476
  132. package/dist/components/site.min.css +2 -2
  133. package/dist/components/site.min.js +2 -2
  134. package/dist/components/slider.css +93 -121
  135. package/dist/components/slider.js +1310 -1311
  136. package/dist/components/slider.min.css +1 -1
  137. package/dist/components/slider.min.js +2 -2
  138. package/dist/components/state.js +639 -657
  139. package/dist/components/state.min.js +2 -2
  140. package/dist/components/statistic.css +75 -116
  141. package/dist/components/statistic.min.css +2 -2
  142. package/dist/components/step.css +77 -150
  143. package/dist/components/step.min.css +2 -2
  144. package/dist/components/sticky.css +1 -5
  145. package/dist/components/sticky.js +848 -901
  146. package/dist/components/sticky.min.css +2 -2
  147. package/dist/components/sticky.min.js +2 -2
  148. package/dist/components/tab.css +10 -14
  149. package/dist/components/tab.js +922 -965
  150. package/dist/components/tab.min.css +2 -2
  151. package/dist/components/tab.min.js +2 -2
  152. package/dist/components/table.css +547 -774
  153. package/dist/components/table.min.css +2 -2
  154. package/dist/components/text.css +32 -32
  155. package/dist/components/text.min.css +1 -1
  156. package/dist/components/toast.css +69 -147
  157. package/dist/components/toast.js +910 -884
  158. package/dist/components/toast.min.css +2 -2
  159. package/dist/components/toast.min.js +2 -2
  160. package/dist/components/transition.css +369 -1280
  161. package/dist/components/transition.js +1047 -1077
  162. package/dist/components/transition.min.css +2 -2
  163. package/dist/components/transition.min.js +2 -2
  164. package/dist/components/visibility.js +1213 -1245
  165. package/dist/components/visibility.min.js +2 -2
  166. package/dist/semantic.css +5637 -8398
  167. package/dist/semantic.js +29021 -29405
  168. package/dist/semantic.min.css +2 -2
  169. package/dist/semantic.min.js +2 -2
  170. package/dist/themes/basic/assets/fonts/icons.woff2 +0 -0
  171. package/dist/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  172. package/dist/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  173. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  174. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  175. package/dist/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  176. package/dist/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  177. package/dist/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  178. package/dist/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  179. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  180. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  181. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  182. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  183. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  184. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  185. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  186. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  187. package/dist/themes/github/assets/fonts/octicons.woff2 +0 -0
  188. package/examples/.eslintrc.js +6 -0
  189. package/examples/assets/show-examples.js +13 -13
  190. package/examples/components/sticky-context.html +1 -1
  191. package/examples/fixed.html +2 -2
  192. package/examples/grid.html +4 -4
  193. package/examples/login.html +1 -1
  194. package/examples/responsive.html +1 -1
  195. package/examples/sticky.html +3 -3
  196. package/gulpfile.js +13 -11
  197. package/package.json +18 -11
  198. package/scripts/nightly-version.js +83 -75
  199. package/src/_site/collections/menu.overrides +1 -1
  200. package/src/_site/elements/flag.variables +2 -2
  201. package/src/_site/globals/site.variables +1 -1
  202. package/src/_site/modules/embed.variables +3 -0
  203. package/src/definitions/behaviors/api.js +1158 -1180
  204. package/src/definitions/behaviors/form.js +2019 -2003
  205. package/src/definitions/behaviors/state.js +645 -663
  206. package/src/definitions/behaviors/visibility.js +1212 -1244
  207. package/src/definitions/collections/breadcrumb.less +43 -47
  208. package/src/definitions/collections/form.less +866 -884
  209. package/src/definitions/collections/grid.less +1680 -1699
  210. package/src/definitions/collections/menu.less +1521 -1544
  211. package/src/definitions/collections/message.less +294 -298
  212. package/src/definitions/collections/table.less +1657 -1661
  213. package/src/definitions/elements/button.less +1714 -1756
  214. package/src/definitions/elements/container.less +211 -211
  215. package/src/definitions/elements/divider.less +198 -211
  216. package/src/definitions/elements/emoji.less +41 -48
  217. package/src/definitions/elements/flag.less +46 -48
  218. package/src/definitions/elements/header.less +351 -359
  219. package/src/definitions/elements/icon.less +541 -484
  220. package/src/definitions/elements/image.less +216 -227
  221. package/src/definitions/elements/input.less +692 -698
  222. package/src/definitions/elements/label.less +784 -806
  223. package/src/definitions/elements/list.less +810 -814
  224. package/src/definitions/elements/loader.less +273 -268
  225. package/src/definitions/elements/placeholder.less +173 -170
  226. package/src/definitions/elements/rail.less +93 -93
  227. package/src/definitions/elements/reveal.less +192 -198
  228. package/src/definitions/elements/segment.less +742 -749
  229. package/src/definitions/elements/step.less +423 -437
  230. package/src/definitions/elements/text.less +34 -36
  231. package/src/definitions/globals/reset.less +11 -8
  232. package/src/definitions/globals/site.js +435 -475
  233. package/src/definitions/globals/site.less +108 -110
  234. package/src/definitions/modules/accordion.js +567 -594
  235. package/src/definitions/modules/accordion.less +244 -248
  236. package/src/definitions/modules/calendar.js +1933 -1808
  237. package/src/definitions/modules/calendar.less +100 -97
  238. package/src/definitions/modules/checkbox.js +841 -840
  239. package/src/definitions/modules/checkbox.less +531 -552
  240. package/src/definitions/modules/dimmer.js +705 -736
  241. package/src/definitions/modules/dimmer.less +294 -305
  242. package/src/definitions/modules/dropdown.js +4178 -4235
  243. package/src/definitions/modules/dropdown.less +1568 -1598
  244. package/src/definitions/modules/embed.js +644 -674
  245. package/src/definitions/modules/embed.less +82 -84
  246. package/src/definitions/modules/flyout.js +1456 -1464
  247. package/src/definitions/modules/flyout.less +445 -456
  248. package/src/definitions/modules/modal.js +1487 -1485
  249. package/src/definitions/modules/modal.less +458 -467
  250. package/src/definitions/modules/nag.js +519 -525
  251. package/src/definitions/modules/nag.less +136 -149
  252. package/src/definitions/modules/popup.js +1453 -1455
  253. package/src/definitions/modules/popup.less +737 -692
  254. package/src/definitions/modules/progress.js +968 -996
  255. package/src/definitions/modules/progress.less +523 -499
  256. package/src/definitions/modules/rating.js +504 -522
  257. package/src/definitions/modules/rating.less +98 -103
  258. package/src/definitions/modules/search.js +1492 -1533
  259. package/src/definitions/modules/search.less +374 -394
  260. package/src/definitions/modules/shape.js +780 -809
  261. package/src/definitions/modules/shape.less +70 -79
  262. package/src/definitions/modules/sidebar.js +1060 -1098
  263. package/src/definitions/modules/sidebar.less +463 -476
  264. package/src/definitions/modules/slider.js +1309 -1310
  265. package/src/definitions/modules/slider.less +309 -310
  266. package/src/definitions/modules/sticky.js +864 -917
  267. package/src/definitions/modules/sticky.less +17 -25
  268. package/src/definitions/modules/tab.js +921 -964
  269. package/src/definitions/modules/tab.less +48 -54
  270. package/src/definitions/modules/toast.js +909 -883
  271. package/src/definitions/modules/toast.less +589 -589
  272. package/src/definitions/modules/transition.js +1046 -1076
  273. package/src/definitions/modules/transition.less +65 -31
  274. package/src/definitions/views/ad.less +207 -208
  275. package/src/definitions/views/card.less +955 -973
  276. package/src/definitions/views/comment.less +192 -200
  277. package/src/definitions/views/feed.less +222 -226
  278. package/src/definitions/views/item.less +437 -448
  279. package/src/definitions/views/statistic.less +273 -279
  280. package/src/semantic.less +8 -6
  281. package/src/theme.config.example +53 -53
  282. package/src/theme.less +44 -35
  283. package/src/themes/amazon/elements/button.overrides +23 -24
  284. package/src/themes/amazon/elements/button.variables +18 -23
  285. package/src/themes/amazon/globals/site.variables +16 -17
  286. package/src/themes/basic/assets/fonts/icons.woff2 +0 -0
  287. package/src/themes/basic/collections/table.overrides +0 -1
  288. package/src/themes/basic/collections/table.variables +3 -3
  289. package/src/themes/basic/elements/button.overrides +0 -1
  290. package/src/themes/basic/elements/button.variables +9 -9
  291. package/src/themes/basic/elements/icon.overrides +9 -169
  292. package/src/themes/basic/elements/icon.variables +161 -18
  293. package/src/themes/basic/elements/step.overrides +2 -2
  294. package/src/themes/basic/elements/step.variables +2 -2
  295. package/src/themes/basic/globals/reset.overrides +1 -1
  296. package/src/themes/basic/globals/reset.variables +1 -1
  297. package/src/themes/basic/modules/progress.variables +2 -2
  298. package/src/themes/basic/views/card.overrides +0 -1
  299. package/src/themes/basic/views/card.variables +6 -6
  300. package/src/themes/bookish/elements/header.overrides +4 -4
  301. package/src/themes/bookish/elements/header.variables +5 -5
  302. package/src/themes/bootstrap3/elements/button.overrides +3 -0
  303. package/src/themes/bootstrap3/elements/button.variables +20 -25
  304. package/src/themes/chubby/collections/form.overrides +9 -9
  305. package/src/themes/chubby/collections/form.variables +3 -3
  306. package/src/themes/chubby/collections/menu.overrides +3 -0
  307. package/src/themes/chubby/collections/menu.variables +3 -3
  308. package/src/themes/chubby/elements/button.overrides +8 -10
  309. package/src/themes/chubby/elements/button.variables +10 -10
  310. package/src/themes/chubby/elements/header.overrides +1 -1
  311. package/src/themes/chubby/elements/header.variables +4 -4
  312. package/src/themes/chubby/modules/accordion.overrides +2 -2
  313. package/src/themes/chubby/modules/accordion.variables +4 -4
  314. package/src/themes/chubby/views/comment.overrides +5 -5
  315. package/src/themes/chubby/views/comment.variables +11 -11
  316. package/src/themes/classic/collections/table.variables +3 -3
  317. package/src/themes/classic/elements/button.variables +36 -43
  318. package/src/themes/classic/elements/header.variables +4 -4
  319. package/src/themes/classic/modules/progress.variables +3 -3
  320. package/src/themes/classic/views/card.overrides +25 -27
  321. package/src/themes/classic/views/card.variables +7 -7
  322. package/src/themes/colored/modules/checkbox.overrides +3 -0
  323. package/src/themes/colored/modules/checkbox.variables +1 -3
  324. package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  325. package/src/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  326. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  327. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  328. package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  329. package/src/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  330. package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  331. package/src/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  332. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  333. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  334. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  335. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  336. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  337. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  338. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  339. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  340. package/src/themes/default/collections/breadcrumb.variables +4 -4
  341. package/src/themes/default/collections/form.variables +15 -16
  342. package/src/themes/default/collections/grid.overrides +0 -1
  343. package/src/themes/default/collections/grid.variables +14 -16
  344. package/src/themes/default/collections/menu.variables +31 -45
  345. package/src/themes/default/collections/message.variables +84 -123
  346. package/src/themes/default/collections/table.overrides +3 -0
  347. package/src/themes/default/collections/table.variables +30 -34
  348. package/src/themes/default/elements/button.variables +45 -52
  349. package/src/themes/default/elements/container.variables +8 -16
  350. package/src/themes/default/elements/divider.overrides +8 -9
  351. package/src/themes/default/elements/divider.variables +5 -6
  352. package/src/themes/default/elements/emoji.overrides +0 -1
  353. package/src/themes/default/elements/emoji.variables +3555 -3555
  354. package/src/themes/default/elements/flag.variables +1594 -1594
  355. package/src/themes/default/elements/header.overrides +0 -1
  356. package/src/themes/default/elements/header.variables +21 -21
  357. package/src/themes/default/elements/icon.variables +2023 -2009
  358. package/src/themes/default/elements/image.variables +6 -7
  359. package/src/themes/default/elements/input.variables +11 -12
  360. package/src/themes/default/elements/label.variables +25 -26
  361. package/src/themes/default/elements/list.variables +17 -21
  362. package/src/themes/default/elements/loader.variables +16 -17
  363. package/src/themes/default/elements/placeholder.variables +12 -9
  364. package/src/themes/default/elements/rail.variables +4 -5
  365. package/src/themes/default/elements/reveal.variables +1 -1
  366. package/src/themes/default/elements/segment.variables +24 -36
  367. package/src/themes/default/elements/step.overrides +4 -4
  368. package/src/themes/default/elements/step.variables +19 -22
  369. package/src/themes/default/elements/text.variables +2 -3
  370. package/src/themes/default/globals/colors.less +588 -588
  371. package/src/themes/default/globals/reset.overrides +63 -59
  372. package/src/themes/default/globals/reset.variables +1 -1
  373. package/src/themes/default/globals/site.variables +1075 -1123
  374. package/src/themes/default/globals/variation.variables +13 -4
  375. package/src/themes/default/modules/accordion.overrides +11 -11
  376. package/src/themes/default/modules/accordion.variables +15 -20
  377. package/src/themes/default/modules/calendar.variables +2 -0
  378. package/src/themes/default/modules/chatroom.variables +1 -1
  379. package/src/themes/default/modules/checkbox.overrides +8 -9
  380. package/src/themes/default/modules/checkbox.variables +24 -33
  381. package/src/themes/default/modules/dimmer.variables +14 -17
  382. package/src/themes/default/modules/dropdown.overrides +17 -17
  383. package/src/themes/default/modules/dropdown.variables +29 -31
  384. package/src/themes/default/modules/embed.variables +9 -13
  385. package/src/themes/default/modules/flyout.variables +8 -8
  386. package/src/themes/default/modules/modal.variables +64 -67
  387. package/src/themes/default/modules/nag.variables +11 -14
  388. package/src/themes/default/modules/popup.variables +14 -13
  389. package/src/themes/default/modules/progress.variables +17 -19
  390. package/src/themes/default/modules/rating.variables +10 -12
  391. package/src/themes/default/modules/search.variables +12 -17
  392. package/src/themes/default/modules/shape.variables +7 -8
  393. package/src/themes/default/modules/sidebar.variables +4 -4
  394. package/src/themes/default/modules/slider.variables +55 -54
  395. package/src/themes/default/modules/sticky.variables +1 -1
  396. package/src/themes/default/modules/toast.variables +8 -8
  397. package/src/themes/default/modules/transition.overrides +936 -915
  398. package/src/themes/default/modules/transition.variables +8 -1
  399. package/src/themes/default/views/ad.variables +1 -1
  400. package/src/themes/default/views/card.variables +33 -45
  401. package/src/themes/default/views/comment.variables +7 -9
  402. package/src/themes/default/views/feed.variables +10 -10
  403. package/src/themes/default/views/item.variables +20 -23
  404. package/src/themes/default/views/statistic.variables +8 -8
  405. package/src/themes/duo/elements/loader.variables +1 -1
  406. package/src/themes/famfamfam/elements/flag.overrides +263 -268
  407. package/src/themes/famfamfam/elements/flag.variables +4 -4
  408. package/src/themes/fixed-width/collections/grid.variables +4 -4
  409. package/src/themes/fixed-width/modules/modal.variables +11 -13
  410. package/src/themes/flat/collections/form.overrides +9 -9
  411. package/src/themes/flat/collections/form.variables +16 -17
  412. package/src/themes/flat/globals/site.variables +69 -74
  413. package/src/themes/github/assets/fonts/octicons.woff2 +0 -0
  414. package/src/themes/github/collections/breadcrumb.variables +0 -1
  415. package/src/themes/github/collections/form.overrides +7 -8
  416. package/src/themes/github/collections/form.variables +16 -18
  417. package/src/themes/github/collections/grid.variables +1 -2
  418. package/src/themes/github/collections/menu.overrides +2 -2
  419. package/src/themes/github/collections/menu.variables +24 -26
  420. package/src/themes/github/collections/message.overrides +3 -3
  421. package/src/themes/github/collections/message.variables +12 -14
  422. package/src/themes/github/collections/table.variables +2 -2
  423. package/src/themes/github/elements/button.overrides +0 -1
  424. package/src/themes/github/elements/button.variables +26 -30
  425. package/src/themes/github/elements/header.variables +2 -2
  426. package/src/themes/github/elements/icon.overrides +3 -208
  427. package/src/themes/github/elements/icon.variables +234 -19
  428. package/src/themes/github/elements/image.variables +1 -1
  429. package/src/themes/github/elements/input.overrides +16 -16
  430. package/src/themes/github/elements/input.variables +4 -5
  431. package/src/themes/github/elements/label.overrides +3 -3
  432. package/src/themes/github/elements/label.variables +0 -1
  433. package/src/themes/github/elements/segment.variables +9 -10
  434. package/src/themes/github/elements/step.overrides +13 -13
  435. package/src/themes/github/elements/step.variables +6 -6
  436. package/src/themes/github/globals/site.variables +16 -16
  437. package/src/themes/github/modules/dropdown.overrides +18 -19
  438. package/src/themes/github/modules/dropdown.variables +8 -10
  439. package/src/themes/github/modules/popup.variables +0 -2
  440. package/src/themes/gmail/collections/message.overrides +3 -0
  441. package/src/themes/gmail/collections/message.variables +4 -4
  442. package/src/themes/instagram/views/card.overrides +4 -5
  443. package/src/themes/instagram/views/card.variables +7 -8
  444. package/src/themes/joypixels/elements/emoji.overrides +0 -2
  445. package/src/themes/joypixels/elements/emoji.variables +3554 -3554
  446. package/src/themes/material/collections/menu.overrides +1 -1
  447. package/src/themes/material/collections/menu.variables +4 -4
  448. package/src/themes/material/elements/button.overrides +7 -9
  449. package/src/themes/material/elements/button.variables +44 -46
  450. package/src/themes/material/elements/header.overrides +3 -3
  451. package/src/themes/material/elements/header.variables +8 -10
  452. package/src/themes/material/elements/icon.overrides +3 -934
  453. package/src/themes/material/elements/icon.variables +958 -18
  454. package/src/themes/material/globals/site.overrides +3 -0
  455. package/src/themes/material/globals/site.variables +83 -84
  456. package/src/themes/material/modules/dropdown.overrides +2 -2
  457. package/src/themes/material/modules/dropdown.variables +5 -5
  458. package/src/themes/material/modules/modal.overrides +3 -3
  459. package/src/themes/material/modules/modal.variables +4 -5
  460. package/src/themes/pulsar/elements/loader.overrides +23 -61
  461. package/src/themes/raised/elements/button.variables +8 -9
  462. package/src/themes/resetcss/globals/reset.overrides +115 -33
  463. package/src/themes/resetcss/globals/reset.variables +1 -1
  464. package/src/themes/round/elements/button.overrides +3 -0
  465. package/src/themes/round/elements/button.variables +33 -38
  466. package/src/themes/rtl/globals/site.overrides +1 -1
  467. package/src/themes/rtl/globals/site.variables +5 -6
  468. package/src/themes/striped/modules/progress.overrides +20 -16
  469. package/src/themes/systemfont/globals/reset.overrides +1 -1
  470. package/src/themes/systemfont/globals/site.variables +6 -6
  471. package/src/themes/timeline/views/feed.overrides +12 -12
  472. package/src/themes/timeline/views/feed.variables +8 -8
  473. package/src/themes/twitter/elements/button.overrides +4 -5
  474. package/src/themes/twitter/elements/button.variables +17 -18
  475. package/src/themes/twitter/elements/emoji.variables +3555 -3555
  476. package/tasks/.eslintrc.js +9 -0
  477. package/tasks/README.md +2 -4
  478. package/tasks/admin/components/create.js +268 -277
  479. package/tasks/admin/components/init.js +123 -129
  480. package/tasks/admin/components/update.js +151 -158
  481. package/tasks/admin/distributions/create.js +183 -189
  482. package/tasks/admin/distributions/init.js +125 -131
  483. package/tasks/admin/distributions/update.js +147 -153
  484. package/tasks/admin/publish.js +5 -9
  485. package/tasks/admin/register.js +37 -39
  486. package/tasks/admin/release.js +8 -12
  487. package/tasks/build/assets.js +43 -40
  488. package/tasks/build/css.js +230 -217
  489. package/tasks/build/javascript.js +120 -114
  490. package/tasks/build.js +11 -11
  491. package/tasks/check-install.js +15 -17
  492. package/tasks/clean.js +6 -6
  493. package/tasks/collections/README.md +3 -5
  494. package/tasks/collections/admin.js +34 -36
  495. package/tasks/collections/build.js +18 -21
  496. package/tasks/collections/docs.js +10 -13
  497. package/tasks/collections/install.js +10 -13
  498. package/tasks/collections/rtl.js +8 -12
  499. package/tasks/collections/various.js +9 -12
  500. package/tasks/config/admin/github.js +17 -19
  501. package/tasks/config/admin/oauth.example.js +4 -4
  502. package/tasks/config/admin/release.js +98 -98
  503. package/tasks/config/admin/templates/README.md +8 -8
  504. package/tasks/config/admin/templates/bower.json +3 -2
  505. package/tasks/config/admin/templates/component-package.js +9 -10
  506. package/tasks/config/admin/templates/css-package.js +19 -21
  507. package/tasks/config/admin/templates/less-package.js +12 -14
  508. package/tasks/config/admin/templates/package.json +5 -5
  509. package/tasks/config/defaults.js +116 -116
  510. package/tasks/config/docs.js +23 -23
  511. package/tasks/config/npm/gulpfile.js +15 -14
  512. package/tasks/config/project/config.js +124 -136
  513. package/tasks/config/project/install.js +722 -719
  514. package/tasks/config/project/release.js +34 -41
  515. package/tasks/config/tasks.js +168 -167
  516. package/tasks/config/user.js +28 -29
  517. package/tasks/docs/build.js +100 -96
  518. package/tasks/docs/metadata.js +91 -98
  519. package/tasks/docs/serve.js +84 -82
  520. package/tasks/install.js +373 -382
  521. package/tasks/rtl/build.js +3 -3
  522. package/tasks/rtl/watch.js +4 -3
  523. package/tasks/version.js +4 -6
  524. package/tasks/watch.js +29 -31
  525. package/test/.eslintrc.js +23 -0
  526. package/test/meteor/assets.js +11 -14
  527. package/test/meteor/fonts.js +12 -13
  528. package/test/modules/accordion.spec.js +6 -8
  529. package/test/modules/checkbox.spec.js +5 -7
  530. package/test/modules/dropdown.spec.js +5 -7
  531. package/test/modules/modal.spec.js +6 -8
  532. package/test/modules/module.spec.js +158 -178
  533. package/test/modules/popup.spec.js +5 -7
  534. package/test/modules/search.spec.js +5 -7
  535. package/test/modules/shape.spec.js +5 -7
  536. package/test/modules/sidebar.spec.js +5 -7
  537. package/test/modules/tab.spec.js +6 -8
  538. package/test/modules/transition.spec.js +5 -7
  539. package/test/modules/video.spec.js +5 -7
  540. package/.github/workflows/codeql.yml +0 -68
@@ -8,1107 +8,1077 @@
8
8
  *
9
9
  */
10
10
 
11
- ;(function ($, window, document, undefined) {
12
-
13
- 'use strict';
14
-
15
- $.isFunction = $.isFunction || function(obj) {
16
- return typeof obj === "function" && typeof obj.nodeType !== "number";
17
- };
18
-
19
- window = (typeof window != 'undefined' && window.Math == Math)
20
- ? window
21
- : (typeof self != 'undefined' && self.Math == Math)
22
- ? self
23
- : Function('return this')()
24
- ;
25
-
26
- $.fn.transition = function() {
27
- var
28
- $allModules = $(this),
29
- moduleSelector = $allModules.selector || '',
30
-
31
- time = new Date().getTime(),
32
- performance = [],
33
-
34
- moduleArguments = arguments,
35
- query = moduleArguments[0],
36
- queryArguments = [].slice.call(arguments, 1),
37
- methodInvoked = (typeof query === 'string'),
38
-
39
- returnedValue
40
- ;
41
- $allModules
42
- .each(function(index) {
43
- var
44
- $module = $(this),
45
- element = this,
46
-
47
- // set at run time
48
- settings,
49
- instance,
50
-
51
- error,
52
- className,
53
- metadata,
54
- animationEnd,
55
-
56
- moduleNamespace,
57
- eventNamespace,
58
- module
59
- ;
60
-
61
- module = {
62
-
63
- initialize: function() {
64
-
65
- // get full settings
66
- settings = module.get.settings.apply(element, moduleArguments);
67
-
68
- // shorthand
69
- className = settings.className;
70
- error = settings.error;
71
- metadata = settings.metadata;
72
-
73
- // define namespace
74
- eventNamespace = '.' + settings.namespace;
75
- moduleNamespace = 'module-' + settings.namespace;
76
- instance = $module.data(moduleNamespace) || module;
77
-
78
- // get vendor specific events
79
- animationEnd = module.get.animationEndEvent();
80
-
81
- if(methodInvoked) {
82
- methodInvoked = module.invoke(query);
83
- }
84
-
85
- // method not invoked, lets run an animation
86
- if(methodInvoked === false) {
87
- module.verbose('Converted arguments into settings object', settings);
88
- if(settings.interval) {
89
- module.delay(settings.interval);
90
- }
91
- else {
92
- module.animate();
93
- }
94
- module.instantiate();
95
- }
96
- },
97
-
98
- instantiate: function() {
99
- module.verbose('Storing instance of module', module);
100
- instance = module;
101
- $module
102
- .data(moduleNamespace, instance)
103
- ;
104
- },
105
-
106
- destroy: function() {
107
- module.verbose('Destroying previous module for', element);
108
- $module
109
- .removeData(moduleNamespace)
110
- ;
111
- },
112
-
113
- refresh: function() {
114
- module.verbose('Refreshing display type on next animation');
115
- delete module.displayType;
116
- },
117
-
118
- forceRepaint: function() {
119
- module.verbose('Forcing element repaint');
120
- var
121
- $parentElement = $module.parent(),
122
- $nextElement = $module.next()
123
- ;
124
- if($nextElement.length === 0) {
125
- $module.detach().appendTo($parentElement);
126
- }
127
- else {
128
- $module.detach().insertBefore($nextElement);
129
- }
130
- },
131
-
132
- repaint: function() {
133
- module.verbose('Repainting element');
134
- var
135
- fakeAssignment = element.offsetWidth
136
- ;
137
- },
11
+ (function ($, window, document) {
12
+ 'use strict';
138
13
 
139
- delay: function(interval) {
140
- var
141
- direction = module.get.animationDirection(),
142
- shouldReverse,
143
- delay
144
- ;
145
- if(!direction) {
146
- direction = module.can.transition()
147
- ? module.get.direction()
148
- : 'static'
149
- ;
150
- }
151
- interval = (interval !== undefined)
152
- ? interval
153
- : settings.interval
154
- ;
155
- shouldReverse = (settings.reverse == 'auto' && direction == className.outward);
156
- delay = (shouldReverse || settings.reverse === true)
157
- ? ($allModules.length - index) * interval
158
- : index * interval
159
- ;
160
- module.debug('Delaying animation by', delay);
161
- setTimeout(module.animate, delay);
162
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
163
17
 
164
- animate: function(overrideSettings) {
165
- settings = overrideSettings || settings;
166
- if(!module.is.supported()) {
167
- module.error(error.support);
168
- return false;
169
- }
170
- module.debug('Preparing animation', settings.animation);
171
- if(module.is.animating()) {
172
- if(settings.queue) {
173
- if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
174
- module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
175
- }
176
- else {
177
- module.queue(settings.animation);
178
- }
179
- return false;
180
- }
181
- else if(!settings.allowRepeats && module.is.occurring()) {
182
- module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
183
- return false;
184
- }
185
- else {
186
- module.debug('New animation started, completing previous early', settings.animation);
187
- instance.complete();
188
- }
189
- }
190
- if( module.can.animate() ) {
191
- module.set.animating(settings.animation);
192
- }
193
- else {
194
- module.error(error.noAnimation, settings.animation, element);
195
- }
196
- },
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
197
21
 
198
- reset: function() {
199
- module.debug('Resetting animation to beginning conditions');
200
- module.remove.animationCallbacks();
201
- module.restore.conditions();
202
- module.remove.animating();
203
- },
22
+ $.fn.transition = function () {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
204
26
 
205
- queue: function(animation) {
206
- module.debug('Queueing animation of', animation);
207
- module.queuing = true;
208
- $module
209
- .one(animationEnd + '.queue' + eventNamespace, function() {
210
- module.queuing = false;
211
- module.repaint();
212
- module.animate.apply(this, settings);
213
- })
214
- ;
215
- },
27
+ time = Date.now(),
28
+ performance = [],
216
29
 
217
- complete: function (event) {
218
- if(event && event.target === element) {
219
- event.stopPropagation();
220
- }
221
- module.debug('Animation complete', settings.animation);
222
- module.remove.completeCallback();
223
- module.remove.failSafe();
224
- if(!module.is.looping()) {
225
- if( module.is.outward() ) {
226
- module.verbose('Animation is outward, hiding element');
227
- module.restore.conditions();
228
- module.hide();
229
- }
230
- else if( module.is.inward() ) {
231
- module.verbose('Animation is outward, showing element');
232
- module.restore.conditions();
233
- module.show();
234
- }
235
- else {
236
- module.verbose('Static animation completed');
237
- module.restore.conditions();
238
- settings.onComplete.call(element);
239
- }
240
- }
241
- },
30
+ moduleArguments = arguments,
31
+ query = moduleArguments[0],
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ methodInvoked = typeof query === 'string',
242
34
 
243
- force: {
244
- visible: function() {
35
+ returnedValue
36
+ ;
37
+ $allModules.each(function (index) {
245
38
  var
246
- style = $module.attr('style'),
247
- userStyle = module.get.userStyle(style),
248
- displayType = module.get.displayType(),
249
- overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
250
- inlineDisplay = $module[0].style.display,
251
- mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
252
- ;
253
- if (mustStayHidden){
254
- module.remove.transition();
255
- return false;
256
- }
257
- module.verbose('Overriding default display to show element', displayType);
258
- $module
259
- .attr('style', overrideStyle)
260
- ;
261
- return true;
262
- },
263
- hidden: function() {
264
- var
265
- style = $module.attr('style'),
266
- currentDisplay = $module.css('display'),
267
- emptyStyle = (style === undefined || style === '')
268
- ;
269
- if(currentDisplay !== 'none' && !module.is.hidden()) {
270
- module.verbose('Overriding default display to hide element');
271
- $module
272
- .css('display', 'none')
273
- ;
274
- }
275
- else if(emptyStyle) {
276
- $module
277
- .removeAttr('style')
278
- ;
279
- }
280
- }
281
- },
39
+ $module = $(this),
40
+ element = this,
282
41
 
283
- has: {
284
- direction: function(animation) {
285
- var
286
- hasDirection = false
287
- ;
288
- animation = animation || settings.animation;
289
- if(typeof animation === 'string') {
290
- animation = animation.split(' ');
291
- $.each(animation, function(index, word){
292
- if(word === className.inward || word === className.outward) {
293
- hasDirection = true;
294
- }
295
- });
296
- }
297
- return hasDirection;
298
- },
299
- inlineDisplay: function() {
300
- var
301
- style = $module.attr('style') || ''
302
- ;
303
- return Array.isArray(style.match(/display.*?;/, ''));
304
- }
305
- },
42
+ // set at run time
43
+ settings,
44
+ instance,
306
45
 
307
- set: {
308
- animating: function(animation) {
309
- // remove previous callbacks
310
- module.remove.completeCallback();
311
-
312
- // determine exact animation
313
- animation = animation || settings.animation;
314
- var animationClass = module.get.animationClass(animation);
315
-
316
- // save animation class in cache to restore class names
317
- module.save.animation(animationClass);
318
-
319
- if(module.force.visible()) {
320
- module.remove.hidden();
321
- module.remove.direction();
322
-
323
- module.start.animation(animationClass);
324
- }
325
- },
326
- duration: function(animationName, duration) {
327
- duration = duration || settings.duration;
328
- duration = (typeof duration == 'number')
329
- ? duration + 'ms'
330
- : duration
331
- ;
332
- if(duration || duration === 0) {
333
- module.verbose('Setting animation duration', duration);
334
- $module
335
- .css({
336
- 'animation-duration': duration
337
- })
338
- ;
339
- }
340
- },
341
- direction: function(direction) {
342
- direction = direction || module.get.direction();
343
- if(direction == className.inward) {
344
- module.set.inward();
345
- }
346
- else {
347
- module.set.outward();
348
- }
349
- },
350
- looping: function() {
351
- module.debug('Transition set to loop');
352
- $module
353
- .addClass(className.looping)
354
- ;
355
- },
356
- hidden: function() {
357
- $module
358
- .addClass(className.transition)
359
- .addClass(className.hidden)
360
- ;
361
- },
362
- inward: function() {
363
- module.debug('Setting direction to inward');
364
- $module
365
- .removeClass(className.outward)
366
- .addClass(className.inward)
367
- ;
368
- },
369
- outward: function() {
370
- module.debug('Setting direction to outward');
371
- $module
372
- .removeClass(className.inward)
373
- .addClass(className.outward)
374
- ;
375
- },
376
- visible: function() {
377
- $module
378
- .addClass(className.transition)
379
- .addClass(className.visible)
380
- ;
381
- }
382
- },
46
+ error,
47
+ className,
48
+ metadata,
49
+ animationEnd,
383
50
 
384
- start: {
385
- animation: function(animationClass) {
386
- animationClass = animationClass || module.get.animationClass();
387
- module.debug('Starting tween', animationClass);
388
- $module
389
- .addClass(animationClass)
390
- .one(animationEnd + '.complete' + eventNamespace, module.complete)
51
+ moduleNamespace,
52
+ eventNamespace,
53
+ module
391
54
  ;
392
- if(settings.useFailSafe) {
393
- module.add.failSafe();
394
- }
395
- module.set.duration(settings.duration);
396
- settings.onStart.call(element);
397
- }
398
- },
399
55
 
400
- save: {
401
- animation: function(animation) {
402
- if(!module.cache) {
403
- module.cache = {};
404
- }
405
- module.cache.animation = animation;
406
- },
407
- displayType: function(displayType) {
408
- if(displayType !== 'none') {
409
- $module.data(metadata.displayType, displayType);
410
- }
411
- },
412
- transitionExists: function(animation, exists) {
413
- $.fn.transition.exists[animation] = exists;
414
- module.verbose('Saving existence of transition', animation, exists);
415
- }
56
+ module = {
57
+
58
+ initialize: function () {
59
+ // get full settings
60
+ settings = module.get.settings.apply(element, moduleArguments);
61
+
62
+ // shorthand
63
+ className = settings.className;
64
+ error = settings.error;
65
+ metadata = settings.metadata;
66
+
67
+ // define namespace
68
+ eventNamespace = '.' + settings.namespace;
69
+ moduleNamespace = 'module-' + settings.namespace;
70
+ instance = $module.data(moduleNamespace) || module;
71
+
72
+ // get vendor specific events
73
+ animationEnd = module.get.animationEndEvent();
74
+
75
+ if (methodInvoked) {
76
+ methodInvoked = module.invoke(query);
77
+ }
78
+
79
+ // method not invoked, lets run an animation
80
+ if (methodInvoked === false) {
81
+ module.verbose('Converted arguments into settings object', settings);
82
+ if (settings.interval) {
83
+ module.delay(settings.interval);
84
+ } else {
85
+ module.animate();
86
+ }
87
+ module.instantiate();
88
+ }
89
+ },
90
+
91
+ instantiate: function () {
92
+ module.verbose('Storing instance of module', module);
93
+ instance = module;
94
+ $module
95
+ .data(moduleNamespace, instance)
96
+ ;
97
+ },
98
+
99
+ destroy: function () {
100
+ module.verbose('Destroying previous module for', element);
101
+ $module
102
+ .removeData(moduleNamespace)
103
+ ;
104
+ },
105
+
106
+ refresh: function () {
107
+ module.verbose('Refreshing display type on next animation');
108
+ delete module.displayType;
109
+ },
110
+
111
+ forceRepaint: function () {
112
+ module.verbose('Forcing element repaint');
113
+ var
114
+ $parentElement = $module.parent(),
115
+ $nextElement = $module.next()
116
+ ;
117
+ if ($nextElement.length === 0) {
118
+ $module.detach().appendTo($parentElement);
119
+ } else {
120
+ $module.detach().insertBefore($nextElement);
121
+ }
122
+ },
123
+
124
+ repaint: function () {
125
+ module.verbose('Repainting element');
126
+ var
127
+ fakeAssignment = element.offsetWidth
128
+ ;
129
+ },
130
+
131
+ delay: function (interval) {
132
+ var
133
+ direction = module.get.animationDirection(),
134
+ shouldReverse,
135
+ delay
136
+ ;
137
+ if (!direction) {
138
+ direction = module.can.transition()
139
+ ? module.get.direction()
140
+ : 'static';
141
+ }
142
+ interval = interval !== undefined
143
+ ? interval
144
+ : settings.interval;
145
+ shouldReverse = settings.reverse === 'auto' && direction === className.outward;
146
+ delay = shouldReverse || settings.reverse === true
147
+ ? ($allModules.length - index) * interval
148
+ : index * interval;
149
+ module.debug('Delaying animation by', delay);
150
+ setTimeout(module.animate, delay);
151
+ },
152
+
153
+ animate: function (overrideSettings) {
154
+ settings = overrideSettings || settings;
155
+ if (!module.is.supported()) {
156
+ module.error(error.support);
157
+
158
+ return false;
159
+ }
160
+ module.debug('Preparing animation', settings.animation);
161
+ if (module.is.animating()) {
162
+ if (settings.queue) {
163
+ if (!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
164
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
165
+ } else {
166
+ module.queue(settings.animation);
167
+ }
168
+
169
+ return false;
170
+ }
171
+ if (!settings.allowRepeats && module.is.occurring()) {
172
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
173
+
174
+ return false;
175
+ }
176
+
177
+ module.debug('New animation started, completing previous early', settings.animation);
178
+ instance.complete();
179
+ }
180
+ if (module.can.animate()) {
181
+ module.set.animating(settings.animation);
182
+ } else {
183
+ module.error(error.noAnimation, settings.animation, element);
184
+ }
185
+ },
186
+
187
+ reset: function () {
188
+ module.debug('Resetting animation to beginning conditions');
189
+ module.remove.animationCallbacks();
190
+ module.restore.conditions();
191
+ module.remove.animating();
192
+ },
193
+
194
+ queue: function (animation) {
195
+ module.debug('Queueing animation of', animation);
196
+ module.queuing = true;
197
+ $module
198
+ .one(animationEnd + '.queue' + eventNamespace, function () {
199
+ module.queuing = false;
200
+ module.repaint();
201
+ module.animate.apply(this, settings);
202
+ })
203
+ ;
204
+ },
205
+
206
+ complete: function (event) {
207
+ if (event && event.target === element) {
208
+ event.stopPropagation();
209
+ }
210
+ module.debug('Animation complete', settings.animation);
211
+ module.remove.completeCallback();
212
+ module.remove.failSafe();
213
+ if (!module.is.looping()) {
214
+ if (module.is.outward()) {
215
+ module.verbose('Animation is outward, hiding element');
216
+ module.restore.conditions();
217
+ module.hide();
218
+ } else if (module.is.inward()) {
219
+ module.verbose('Animation is outward, showing element');
220
+ module.restore.conditions();
221
+ module.show();
222
+ } else {
223
+ module.verbose('Static animation completed');
224
+ module.restore.conditions();
225
+ settings.onComplete.call(element);
226
+ }
227
+ }
228
+ },
229
+
230
+ force: {
231
+ visible: function () {
232
+ var
233
+ style = $module.attr('style'),
234
+ userStyle = module.get.userStyle(style),
235
+ displayType = module.get.displayType(),
236
+ overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
237
+ inlineDisplay = $module[0].style.display,
238
+ mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
239
+ ;
240
+ if (mustStayHidden) {
241
+ module.remove.transition();
242
+
243
+ return false;
244
+ }
245
+ module.verbose('Overriding default display to show element', displayType);
246
+ $module
247
+ .attr('style', overrideStyle)
248
+ ;
249
+
250
+ return true;
251
+ },
252
+ hidden: function () {
253
+ var
254
+ style = $module.attr('style'),
255
+ currentDisplay = $module.css('display'),
256
+ emptyStyle = style === undefined || style === ''
257
+ ;
258
+ if (currentDisplay !== 'none' && !module.is.hidden()) {
259
+ module.verbose('Overriding default display to hide element');
260
+ $module
261
+ .css('display', 'none')
262
+ ;
263
+ } else if (emptyStyle) {
264
+ $module
265
+ .removeAttr('style')
266
+ ;
267
+ }
268
+ },
269
+ },
270
+
271
+ has: {
272
+ direction: function (animation) {
273
+ var
274
+ hasDirection = false
275
+ ;
276
+ animation = animation || settings.animation;
277
+ if (typeof animation === 'string') {
278
+ animation = animation.split(' ');
279
+ $.each(animation, function (index, word) {
280
+ if (word === className.inward || word === className.outward) {
281
+ hasDirection = true;
282
+ }
283
+ });
284
+ }
285
+
286
+ return hasDirection;
287
+ },
288
+ inlineDisplay: function () {
289
+ var
290
+ style = $module.attr('style') || ''
291
+ ;
292
+
293
+ return Array.isArray(style.match(/display.*?;/, ''));
294
+ },
295
+ },
296
+
297
+ set: {
298
+ animating: function (animation) {
299
+ // remove previous callbacks
300
+ module.remove.completeCallback();
301
+
302
+ // determine exact animation
303
+ animation = animation || settings.animation;
304
+ var animationClass = module.get.animationClass(animation);
305
+
306
+ // save animation class in cache to restore class names
307
+ module.save.animation(animationClass);
308
+
309
+ if (module.force.visible()) {
310
+ module.remove.hidden();
311
+ module.remove.direction();
312
+
313
+ module.start.animation(animationClass);
314
+ }
315
+ },
316
+ duration: function (animationName, duration) {
317
+ duration = duration || settings.duration;
318
+ duration = typeof duration === 'number'
319
+ ? duration + 'ms'
320
+ : duration;
321
+ if (duration || duration === 0) {
322
+ module.verbose('Setting animation duration', duration);
323
+ $module
324
+ .css({
325
+ 'animation-duration': duration,
326
+ })
327
+ ;
328
+ }
329
+ },
330
+ direction: function (direction) {
331
+ direction = direction || module.get.direction();
332
+ if (direction === className.inward) {
333
+ module.set.inward();
334
+ } else {
335
+ module.set.outward();
336
+ }
337
+ },
338
+ looping: function () {
339
+ module.debug('Transition set to loop');
340
+ $module
341
+ .addClass(className.looping)
342
+ ;
343
+ },
344
+ hidden: function () {
345
+ $module
346
+ .addClass(className.transition)
347
+ .addClass(className.hidden)
348
+ ;
349
+ },
350
+ inward: function () {
351
+ module.debug('Setting direction to inward');
352
+ $module
353
+ .removeClass(className.outward)
354
+ .addClass(className.inward)
355
+ ;
356
+ },
357
+ outward: function () {
358
+ module.debug('Setting direction to outward');
359
+ $module
360
+ .removeClass(className.inward)
361
+ .addClass(className.outward)
362
+ ;
363
+ },
364
+ visible: function () {
365
+ $module
366
+ .addClass(className.transition)
367
+ .addClass(className.visible)
368
+ ;
369
+ },
370
+ },
371
+
372
+ start: {
373
+ animation: function (animationClass) {
374
+ animationClass = animationClass || module.get.animationClass();
375
+ module.debug('Starting tween', animationClass);
376
+ $module
377
+ .addClass(animationClass)
378
+ .one(animationEnd + '.complete' + eventNamespace, module.complete)
379
+ ;
380
+ if (settings.useFailSafe) {
381
+ module.add.failSafe();
382
+ }
383
+ module.set.duration(settings.duration);
384
+ settings.onStart.call(element);
385
+ },
386
+ },
387
+
388
+ save: {
389
+ animation: function (animation) {
390
+ if (!module.cache) {
391
+ module.cache = {};
392
+ }
393
+ module.cache.animation = animation;
394
+ },
395
+ displayType: function (displayType) {
396
+ if (displayType !== 'none') {
397
+ $module.data(metadata.displayType, displayType);
398
+ }
399
+ },
400
+ transitionExists: function (animation, exists) {
401
+ $.fn.transition.exists[animation] = exists;
402
+ module.verbose('Saving existence of transition', animation, exists);
403
+ },
404
+ },
405
+
406
+ restore: {
407
+ conditions: function () {
408
+ var
409
+ animation = module.get.currentAnimation()
410
+ ;
411
+ if (animation) {
412
+ $module
413
+ .removeClass(animation)
414
+ ;
415
+ module.verbose('Removing animation class', module.cache);
416
+ }
417
+ module.remove.duration();
418
+ },
419
+ },
420
+
421
+ add: {
422
+ failSafe: function () {
423
+ var
424
+ duration = module.get.duration()
425
+ ;
426
+ module.timer = setTimeout(function () {
427
+ $module.triggerHandler(animationEnd);
428
+ }, duration + settings.failSafeDelay);
429
+ module.verbose('Adding fail safe timer', module.timer);
430
+ },
431
+ },
432
+
433
+ remove: {
434
+ animating: function () {
435
+ $module.removeClass(className.animating);
436
+ },
437
+ animationCallbacks: function () {
438
+ module.remove.queueCallback();
439
+ module.remove.completeCallback();
440
+ },
441
+ queueCallback: function () {
442
+ $module.off('.queue' + eventNamespace);
443
+ },
444
+ completeCallback: function () {
445
+ $module.off('.complete' + eventNamespace);
446
+ },
447
+ display: function () {
448
+ $module.css('display', '');
449
+ },
450
+ direction: function () {
451
+ $module
452
+ .removeClass(className.inward)
453
+ .removeClass(className.outward)
454
+ ;
455
+ },
456
+ duration: function () {
457
+ $module
458
+ .css('animation-duration', '')
459
+ ;
460
+ },
461
+ failSafe: function () {
462
+ module.verbose('Removing fail safe timer', module.timer);
463
+ if (module.timer) {
464
+ clearTimeout(module.timer);
465
+ }
466
+ },
467
+ hidden: function () {
468
+ $module.removeClass(className.hidden);
469
+ },
470
+ visible: function () {
471
+ $module.removeClass(className.visible);
472
+ },
473
+ looping: function () {
474
+ module.debug('Transitions are no longer looping');
475
+ if (module.is.looping()) {
476
+ module.reset();
477
+ $module
478
+ .removeClass(className.looping)
479
+ ;
480
+ }
481
+ },
482
+ transition: function () {
483
+ $module
484
+ .removeClass(className.transition)
485
+ .removeClass(className.visible)
486
+ .removeClass(className.hidden)
487
+ ;
488
+ },
489
+ },
490
+ get: {
491
+ settings: function (animation, duration, onComplete) {
492
+ if (typeof animation === 'object') { // single settings object
493
+ return $.extend(true, {}, $.fn.transition.settings, animation);
494
+ }
495
+ if (typeof onComplete === 'function') { // all arguments provided
496
+ return $.extend({}, $.fn.transition.settings, {
497
+ animation: animation,
498
+ onComplete: onComplete,
499
+ duration: duration,
500
+ });
501
+ }
502
+ if (typeof duration === 'string' || typeof duration === 'number') { // only duration provided
503
+ return $.extend({}, $.fn.transition.settings, {
504
+ animation: animation,
505
+ duration: duration,
506
+ });
507
+ }
508
+ if (typeof duration === 'object') { // duration is actually settings object
509
+ return $.extend({}, $.fn.transition.settings, duration, {
510
+ animation: animation,
511
+ });
512
+ }
513
+ if (typeof duration === 'function') { // duration is actually callback
514
+ return $.extend({}, $.fn.transition.settings, {
515
+ animation: animation,
516
+ onComplete: duration,
517
+ });
518
+ }
519
+
520
+ // only animation provided
521
+ return $.extend({}, $.fn.transition.settings, {
522
+ animation: animation,
523
+ });
524
+ },
525
+ animationClass: function (animation) {
526
+ var
527
+ animationClass = animation || settings.animation,
528
+ directionClass = module.can.transition() && !module.has.direction()
529
+ ? module.get.direction() + ' '
530
+ : ''
531
+ ;
532
+
533
+ return className.animating + ' '
534
+ + className.transition + ' '
535
+ + directionClass
536
+ + animationClass;
537
+ },
538
+ currentAnimation: function () {
539
+ return module.cache && module.cache.animation !== undefined
540
+ ? module.cache.animation
541
+ : false;
542
+ },
543
+ currentDirection: function () {
544
+ return module.is.inward()
545
+ ? className.inward
546
+ : className.outward;
547
+ },
548
+ direction: function () {
549
+ return module.is.hidden() || !module.is.visible()
550
+ ? className.inward
551
+ : className.outward;
552
+ },
553
+ animationDirection: function (animation) {
554
+ var
555
+ direction
556
+ ;
557
+ animation = animation || settings.animation;
558
+ if (typeof animation === 'string') {
559
+ animation = animation.split(' ');
560
+ // search animation name for out/in class
561
+ $.each(animation, function (index, word) {
562
+ if (word === className.inward) {
563
+ direction = className.inward;
564
+ } else if (word === className.outward) {
565
+ direction = className.outward;
566
+ }
567
+ });
568
+ }
569
+ // return found direction
570
+ if (direction) {
571
+ return direction;
572
+ }
573
+
574
+ return false;
575
+ },
576
+ duration: function (duration) {
577
+ duration = duration || settings.duration;
578
+ if (duration === false) {
579
+ duration = $module.css('animation-duration') || 0;
580
+ }
581
+
582
+ return typeof duration === 'string'
583
+ ? (duration.indexOf('ms') > -1
584
+ ? parseFloat(duration)
585
+ : parseFloat(duration) * 1000)
586
+ : duration;
587
+ },
588
+ displayType: function (shouldDetermine) {
589
+ shouldDetermine = shouldDetermine !== undefined
590
+ ? shouldDetermine
591
+ : true;
592
+ if (settings.displayType) {
593
+ return settings.displayType;
594
+ }
595
+ if (shouldDetermine && $module.data(metadata.displayType) === undefined) {
596
+ var currentDisplay = $module.css('display');
597
+ if (currentDisplay === '' || currentDisplay === 'none') {
598
+ // create fake element to determine display state
599
+ module.can.transition(true);
600
+ } else {
601
+ module.save.displayType(currentDisplay);
602
+ }
603
+ }
604
+
605
+ return $module.data(metadata.displayType);
606
+ },
607
+ userStyle: function (style) {
608
+ style = style || $module.attr('style') || '';
609
+
610
+ return style.replace(/display.*?;/, '');
611
+ },
612
+ transitionExists: function (animation) {
613
+ return $.fn.transition.exists[animation];
614
+ },
615
+ animationStartEvent: function () {
616
+ var
617
+ element = document.createElement('div'),
618
+ animations = {
619
+ animation: 'animationstart',
620
+ OAnimation: 'oAnimationStart',
621
+ MozAnimation: 'mozAnimationStart',
622
+ WebkitAnimation: 'webkitAnimationStart',
623
+ },
624
+ animation
625
+ ;
626
+ for (animation in animations) {
627
+ if (element.style[animation] !== undefined) {
628
+ return animations[animation];
629
+ }
630
+ }
631
+
632
+ return false;
633
+ },
634
+ animationEndEvent: function () {
635
+ var
636
+ element = document.createElement('div'),
637
+ animations = {
638
+ animation: 'animationend',
639
+ OAnimation: 'oAnimationEnd',
640
+ MozAnimation: 'mozAnimationEnd',
641
+ WebkitAnimation: 'webkitAnimationEnd',
642
+ },
643
+ animation
644
+ ;
645
+ for (animation in animations) {
646
+ if (element.style[animation] !== undefined) {
647
+ return animations[animation];
648
+ }
649
+ }
650
+
651
+ return false;
652
+ },
653
+
654
+ },
655
+
656
+ can: {
657
+ transition: function (forced) {
658
+ var
659
+ animation = settings.animation,
660
+ transitionExists = module.get.transitionExists(animation),
661
+ displayType = module.get.displayType(false),
662
+ elementClass,
663
+ tagName,
664
+ $clone,
665
+ currentAnimation,
666
+ inAnimation,
667
+ directionExists
668
+ ;
669
+ if (transitionExists === undefined || forced) {
670
+ module.verbose('Determining whether animation exists');
671
+ elementClass = $module.attr('class');
672
+ tagName = $module.prop('tagName');
673
+
674
+ $clone = $('<' + tagName + ' />').addClass(elementClass).insertAfter($module);
675
+ currentAnimation = $clone
676
+ .addClass(animation)
677
+ .removeClass(className.inward)
678
+ .removeClass(className.outward)
679
+ .addClass(className.animating)
680
+ .addClass(className.transition)
681
+ .css('animationName')
682
+ ;
683
+ $clone.detach().insertAfter($module);
684
+ inAnimation = $clone
685
+ .addClass(className.inward)
686
+ .css('animationName')
687
+ ;
688
+ if (!displayType) {
689
+ $clone.detach().insertAfter($module);
690
+ displayType = $clone
691
+ .attr('class', elementClass)
692
+ .removeAttr('style')
693
+ .removeClass(className.hidden)
694
+ .removeClass(className.visible)
695
+ .show()
696
+ .css('display')
697
+ ;
698
+ module.verbose('Determining final display state', displayType);
699
+ module.save.displayType(displayType);
700
+ }
701
+
702
+ $clone.remove();
703
+ if (currentAnimation !== inAnimation) {
704
+ module.debug('Direction exists for animation', animation);
705
+ directionExists = true;
706
+ } else if (currentAnimation === 'none' || !currentAnimation) {
707
+ module.debug('No animation defined in css', animation);
708
+
709
+ return;
710
+ } else {
711
+ module.debug('Static animation found', animation, displayType);
712
+ directionExists = false;
713
+ }
714
+ module.save.transitionExists(animation, directionExists);
715
+ }
716
+
717
+ return transitionExists !== undefined
718
+ ? transitionExists
719
+ : directionExists;
720
+ },
721
+ animate: function () {
722
+ // can transition does not return a value if animation does not exist
723
+ return module.can.transition() !== undefined;
724
+ },
725
+ },
726
+
727
+ is: {
728
+ animating: function () {
729
+ return $module.hasClass(className.animating);
730
+ },
731
+ inward: function () {
732
+ return $module.hasClass(className.inward);
733
+ },
734
+ outward: function () {
735
+ return $module.hasClass(className.outward);
736
+ },
737
+ looping: function () {
738
+ return $module.hasClass(className.looping);
739
+ },
740
+ occurring: function (animation) {
741
+ animation = animation || settings.animation;
742
+ animation = '.' + animation.replace(' ', '.');
743
+
744
+ return $module.filter(animation).length > 0;
745
+ },
746
+ visible: function () {
747
+ return $module.is(':visible');
748
+ },
749
+ hidden: function () {
750
+ return $module.css('visibility') === 'hidden';
751
+ },
752
+ supported: function () {
753
+ return animationEnd !== false;
754
+ },
755
+ },
756
+
757
+ hide: function () {
758
+ if (settings.onHide.call(element) === false) {
759
+ module.verbose('Hide callback returned false cancelling hide');
760
+
761
+ return false;
762
+ }
763
+ module.verbose('Hiding element');
764
+ if (module.is.animating()) {
765
+ module.reset();
766
+ }
767
+ element.blur(); // IE will trigger focus change if element is not blurred before hiding
768
+ module.remove.display();
769
+ module.remove.visible();
770
+ settings.onBeforeHide.call(element, module.hideNow);
771
+ },
772
+
773
+ hideNow: function () {
774
+ module.set.hidden();
775
+ module.force.hidden();
776
+ settings.onHidden.call(element);
777
+ settings.onComplete.call(element);
778
+ },
779
+
780
+ show: function (display) {
781
+ if (module.force.visible() && settings.onShow.call(element) !== false) {
782
+ module.verbose('Showing element', display);
783
+ module.remove.hidden();
784
+ settings.onBeforeShow.call(element, module.showNow);
785
+ }
786
+ },
787
+
788
+ showNow: function () {
789
+ module.set.visible();
790
+ settings.onVisible.call(element);
791
+ settings.onComplete.call(element);
792
+ },
793
+
794
+ toggle: function () {
795
+ if (module.is.visible()) {
796
+ module.hide();
797
+ } else {
798
+ module.show();
799
+ }
800
+ },
801
+
802
+ stop: function () {
803
+ module.debug('Stopping current animation');
804
+ $module.triggerHandler(animationEnd);
805
+ },
806
+
807
+ stopAll: function () {
808
+ module.debug('Stopping all animation');
809
+ module.remove.queueCallback();
810
+ $module.triggerHandler(animationEnd);
811
+ },
812
+
813
+ clear: {
814
+ queue: function () {
815
+ module.debug('Clearing animation queue');
816
+ module.remove.queueCallback();
817
+ },
818
+ },
819
+
820
+ enable: function () {
821
+ module.verbose('Starting animation');
822
+ $module.removeClass(className.disabled);
823
+ },
824
+
825
+ disable: function () {
826
+ module.debug('Stopping animation');
827
+ $module.addClass(className.disabled);
828
+ },
829
+
830
+ setting: function (name, value) {
831
+ module.debug('Changing setting', name, value);
832
+ if ($.isPlainObject(name)) {
833
+ $.extend(true, settings, name);
834
+ } else if (value !== undefined) {
835
+ if ($.isPlainObject(settings[name])) {
836
+ $.extend(true, settings[name], value);
837
+ } else {
838
+ settings[name] = value;
839
+ }
840
+ } else {
841
+ return settings[name];
842
+ }
843
+ },
844
+ internal: function (name, value) {
845
+ if ($.isPlainObject(name)) {
846
+ $.extend(true, module, name);
847
+ } else if (value !== undefined) {
848
+ module[name] = value;
849
+ } else {
850
+ return module[name];
851
+ }
852
+ },
853
+ debug: function () {
854
+ if (!settings.silent && settings.debug) {
855
+ if (settings.performance) {
856
+ module.performance.log(arguments);
857
+ } else {
858
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
859
+ module.debug.apply(console, arguments);
860
+ }
861
+ }
862
+ },
863
+ verbose: function () {
864
+ if (!settings.silent && settings.verbose && settings.debug) {
865
+ if (settings.performance) {
866
+ module.performance.log(arguments);
867
+ } else {
868
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
869
+ module.verbose.apply(console, arguments);
870
+ }
871
+ }
872
+ },
873
+ error: function () {
874
+ if (!settings.silent) {
875
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
876
+ module.error.apply(console, arguments);
877
+ }
878
+ },
879
+ performance: {
880
+ log: function (message) {
881
+ var
882
+ currentTime,
883
+ executionTime,
884
+ previousTime
885
+ ;
886
+ if (settings.performance) {
887
+ currentTime = Date.now();
888
+ previousTime = time || currentTime;
889
+ executionTime = currentTime - previousTime;
890
+ time = currentTime;
891
+ performance.push({
892
+ Name: message[0],
893
+ Arguments: [].slice.call(message, 1) || '',
894
+ Element: element,
895
+ 'Execution Time': executionTime,
896
+ });
897
+ }
898
+ clearTimeout(module.performance.timer);
899
+ module.performance.timer = setTimeout(module.performance.display, 500);
900
+ },
901
+ display: function () {
902
+ var
903
+ title = settings.name + ':',
904
+ totalTime = 0
905
+ ;
906
+ time = false;
907
+ clearTimeout(module.performance.timer);
908
+ $.each(performance, function (index, data) {
909
+ totalTime += data['Execution Time'];
910
+ });
911
+ title += ' ' + totalTime + 'ms';
912
+ if (moduleSelector) {
913
+ title += ' \'' + moduleSelector + '\'';
914
+ }
915
+ if ($allModules.length > 1) {
916
+ title += ' (' + $allModules.length + ')';
917
+ }
918
+ if (performance.length > 0) {
919
+ console.groupCollapsed(title);
920
+ if (console.table) {
921
+ console.table(performance);
922
+ } else {
923
+ $.each(performance, function (index, data) {
924
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
925
+ });
926
+ }
927
+ console.groupEnd();
928
+ }
929
+ performance = [];
930
+ },
931
+ },
932
+ // modified for transition to return invoke success
933
+ invoke: function (query, passedArguments, context) {
934
+ var
935
+ object = instance,
936
+ maxDepth,
937
+ found,
938
+ response
939
+ ;
940
+ passedArguments = passedArguments || queryArguments;
941
+ context = context || element;
942
+ if (typeof query === 'string' && object !== undefined) {
943
+ query = query.split(/[ .]/);
944
+ maxDepth = query.length - 1;
945
+ $.each(query, function (depth, value) {
946
+ var camelCaseValue = depth !== maxDepth
947
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
948
+ : query
949
+ ;
950
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
951
+ object = object[camelCaseValue];
952
+ } else if (object[camelCaseValue] !== undefined) {
953
+ found = object[camelCaseValue];
954
+
955
+ return false;
956
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
957
+ object = object[value];
958
+ } else if (object[value] !== undefined) {
959
+ found = object[value];
960
+
961
+ return false;
962
+ } else {
963
+ return false;
964
+ }
965
+ });
966
+ }
967
+ if (isFunction(found)) {
968
+ response = found.apply(context, passedArguments);
969
+ } else if (found !== undefined) {
970
+ response = found;
971
+ }
972
+
973
+ if (Array.isArray(returnedValue)) {
974
+ returnedValue.push(response);
975
+ } else if (returnedValue !== undefined) {
976
+ returnedValue = [returnedValue, response];
977
+ } else if (response !== undefined) {
978
+ returnedValue = response;
979
+ }
980
+
981
+ return found !== undefined
982
+ ? found
983
+ : false;
984
+ },
985
+ };
986
+ module.initialize();
987
+ });
988
+
989
+ return returnedValue !== undefined
990
+ ? returnedValue
991
+ : this;
992
+ };
993
+
994
+ // Records if CSS transition is available
995
+ $.fn.transition.exists = {};
996
+
997
+ $.fn.transition.settings = {
998
+
999
+ // module info
1000
+ name: 'Transition',
1001
+
1002
+ // hide all output from this component regardless of other settings
1003
+ silent: false,
1004
+
1005
+ // debug content outputted to console
1006
+ debug: false,
1007
+
1008
+ // verbose debug output
1009
+ verbose: false,
1010
+
1011
+ // performance data output
1012
+ performance: true,
1013
+
1014
+ // event namespace
1015
+ namespace: 'transition',
1016
+
1017
+ // delay between animations in group
1018
+ interval: 0,
1019
+
1020
+ // whether group animations should be reversed
1021
+ reverse: 'auto',
1022
+
1023
+ // animation callback event
1024
+ onStart: function () {},
1025
+ onComplete: function () {},
1026
+ onShow: function () {},
1027
+ onBeforeShow: function (callback) {
1028
+ callback.call(this);
416
1029
  },
417
-
418
- restore: {
419
- conditions: function() {
420
- var
421
- animation = module.get.currentAnimation()
422
- ;
423
- if(animation) {
424
- $module
425
- .removeClass(animation)
426
- ;
427
- module.verbose('Removing animation class', module.cache);
428
- }
429
- module.remove.duration();
430
- }
1030
+ onVisible: function () {},
1031
+ onHide: function () {},
1032
+ onHidden: function () {},
1033
+ onBeforeHide: function (callback) {
1034
+ callback.call(this);
431
1035
  },
432
1036
 
433
- add: {
434
- failSafe: function() {
435
- var
436
- duration = module.get.duration()
437
- ;
438
- module.timer = setTimeout(function() {
439
- $module.triggerHandler(animationEnd);
440
- }, duration + settings.failSafeDelay);
441
- module.verbose('Adding fail safe timer', module.timer);
442
- }
443
- },
1037
+ // whether timeout should be used to ensure callback fires in cases animationend does not
1038
+ useFailSafe: true,
444
1039
 
445
- remove: {
446
- animating: function() {
447
- $module.removeClass(className.animating);
448
- },
449
- animationCallbacks: function() {
450
- module.remove.queueCallback();
451
- module.remove.completeCallback();
452
- },
453
- queueCallback: function() {
454
- $module.off('.queue' + eventNamespace);
455
- },
456
- completeCallback: function() {
457
- $module.off('.complete' + eventNamespace);
458
- },
459
- display: function() {
460
- $module.css('display', '');
461
- },
462
- direction: function() {
463
- $module
464
- .removeClass(className.inward)
465
- .removeClass(className.outward)
466
- ;
467
- },
468
- duration: function() {
469
- $module
470
- .css('animation-duration', '')
471
- ;
472
- },
473
- failSafe: function() {
474
- module.verbose('Removing fail safe timer', module.timer);
475
- if(module.timer) {
476
- clearTimeout(module.timer);
477
- }
478
- },
479
- hidden: function() {
480
- $module.removeClass(className.hidden);
481
- },
482
- visible: function() {
483
- $module.removeClass(className.visible);
484
- },
485
- looping: function() {
486
- module.debug('Transitions are no longer looping');
487
- if( module.is.looping() ) {
488
- module.reset();
489
- $module
490
- .removeClass(className.looping)
491
- ;
492
- }
493
- },
494
- transition: function() {
495
- $module
496
- .removeClass(className.transition)
497
- .removeClass(className.visible)
498
- .removeClass(className.hidden)
499
- ;
500
- }
501
- },
502
- get: {
503
- settings: function(animation, duration, onComplete) {
504
- // single settings object
505
- if(typeof animation == 'object') {
506
- return $.extend(true, {}, $.fn.transition.settings, animation);
507
- }
508
- // all arguments provided
509
- else if(typeof onComplete == 'function') {
510
- return $.extend({}, $.fn.transition.settings, {
511
- animation : animation,
512
- onComplete : onComplete,
513
- duration : duration
514
- });
515
- }
516
- // only duration provided
517
- else if(typeof duration == 'string' || typeof duration == 'number') {
518
- return $.extend({}, $.fn.transition.settings, {
519
- animation : animation,
520
- duration : duration
521
- });
522
- }
523
- // duration is actually settings object
524
- else if(typeof duration == 'object') {
525
- return $.extend({}, $.fn.transition.settings, duration, {
526
- animation : animation
527
- });
528
- }
529
- // duration is actually callback
530
- else if(typeof duration == 'function') {
531
- return $.extend({}, $.fn.transition.settings, {
532
- animation : animation,
533
- onComplete : duration
534
- });
535
- }
536
- // only animation provided
537
- else {
538
- return $.extend({}, $.fn.transition.settings, {
539
- animation : animation
540
- });
541
- }
542
- },
543
- animationClass: function(animation) {
544
- var
545
- animationClass = animation || settings.animation,
546
- directionClass = (module.can.transition() && !module.has.direction())
547
- ? module.get.direction() + ' '
548
- : ''
549
- ;
550
- return className.animating + ' '
551
- + className.transition + ' '
552
- + directionClass
553
- + animationClass
554
- ;
555
- },
556
- currentAnimation: function() {
557
- return (module.cache && module.cache.animation !== undefined)
558
- ? module.cache.animation
559
- : false
560
- ;
561
- },
562
- currentDirection: function() {
563
- return module.is.inward()
564
- ? className.inward
565
- : className.outward
566
- ;
567
- },
568
- direction: function() {
569
- return module.is.hidden() || !module.is.visible()
570
- ? className.inward
571
- : className.outward
572
- ;
573
- },
574
- animationDirection: function(animation) {
575
- var
576
- direction
577
- ;
578
- animation = animation || settings.animation;
579
- if(typeof animation === 'string') {
580
- animation = animation.split(' ');
581
- // search animation name for out/in class
582
- $.each(animation, function(index, word){
583
- if(word === className.inward) {
584
- direction = className.inward;
585
- }
586
- else if(word === className.outward) {
587
- direction = className.outward;
588
- }
589
- });
590
- }
591
- // return found direction
592
- if(direction) {
593
- return direction;
594
- }
595
- return false;
596
- },
597
- duration: function(duration) {
598
- duration = duration || settings.duration;
599
- if(duration === false) {
600
- duration = $module.css('animation-duration') || 0;
601
- }
602
- return (typeof duration === 'string')
603
- ? (duration.indexOf('ms') > -1)
604
- ? parseFloat(duration)
605
- : parseFloat(duration) * 1000
606
- : duration
607
- ;
608
- },
609
- displayType: function(shouldDetermine) {
610
- shouldDetermine = (shouldDetermine !== undefined)
611
- ? shouldDetermine
612
- : true
613
- ;
614
- if(settings.displayType) {
615
- return settings.displayType;
616
- }
617
- if(shouldDetermine && $module.data(metadata.displayType) === undefined) {
618
- var currentDisplay = $module.css('display');
619
- if(currentDisplay === '' || currentDisplay === 'none'){
620
- // create fake element to determine display state
621
- module.can.transition(true);
622
- } else {
623
- module.save.displayType(currentDisplay);
624
- }
625
- }
626
- return $module.data(metadata.displayType);
627
- },
628
- userStyle: function(style) {
629
- style = style || $module.attr('style') || '';
630
- return style.replace(/display.*?;/, '');
631
- },
632
- transitionExists: function(animation) {
633
- return $.fn.transition.exists[animation];
634
- },
635
- animationStartEvent: function() {
636
- var
637
- element = document.createElement('div'),
638
- animations = {
639
- 'animation' :'animationstart',
640
- 'OAnimation' :'oAnimationStart',
641
- 'MozAnimation' :'mozAnimationStart',
642
- 'WebkitAnimation' :'webkitAnimationStart'
643
- },
644
- animation
645
- ;
646
- for(animation in animations){
647
- if( element.style[animation] !== undefined ){
648
- return animations[animation];
649
- }
650
- }
651
- return false;
652
- },
653
- animationEndEvent: function() {
654
- var
655
- element = document.createElement('div'),
656
- animations = {
657
- 'animation' :'animationend',
658
- 'OAnimation' :'oAnimationEnd',
659
- 'MozAnimation' :'mozAnimationEnd',
660
- 'WebkitAnimation' :'webkitAnimationEnd'
661
- },
662
- animation
663
- ;
664
- for(animation in animations){
665
- if( element.style[animation] !== undefined ){
666
- return animations[animation];
667
- }
668
- }
669
- return false;
670
- }
1040
+ // delay in ms for fail safe
1041
+ failSafeDelay: 100,
671
1042
 
672
- },
1043
+ // whether EXACT animation can occur twice in a row
1044
+ allowRepeats: false,
673
1045
 
674
- can: {
675
- transition: function(forced) {
676
- var
677
- animation = settings.animation,
678
- transitionExists = module.get.transitionExists(animation),
679
- displayType = module.get.displayType(false),
680
- elementClass,
681
- tagName,
682
- $clone,
683
- currentAnimation,
684
- inAnimation,
685
- directionExists
686
- ;
687
- if( transitionExists === undefined || forced) {
688
- module.verbose('Determining whether animation exists');
689
- elementClass = $module.attr('class');
690
- tagName = $module.prop('tagName');
691
-
692
- $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
693
- currentAnimation = $clone
694
- .addClass(animation)
695
- .removeClass(className.inward)
696
- .removeClass(className.outward)
697
- .addClass(className.animating)
698
- .addClass(className.transition)
699
- .css('animationName')
700
- ;
701
- $clone.detach().insertAfter($module);
702
- inAnimation = $clone
703
- .addClass(className.inward)
704
- .css('animationName')
705
- ;
706
- if(!displayType) {
707
- $clone.detach().insertAfter($module);
708
- displayType = $clone
709
- .attr('class', elementClass)
710
- .removeAttr('style')
711
- .removeClass(className.hidden)
712
- .removeClass(className.visible)
713
- .show()
714
- .css('display')
715
- ;
716
- module.verbose('Determining final display state', displayType);
717
- module.save.displayType(displayType);
718
- }
719
-
720
- $clone.remove();
721
- if(currentAnimation != inAnimation) {
722
- module.debug('Direction exists for animation', animation);
723
- directionExists = true;
724
- }
725
- else if(currentAnimation == 'none' || !currentAnimation) {
726
- module.debug('No animation defined in css', animation);
727
- return;
728
- }
729
- else {
730
- module.debug('Static animation found', animation, displayType);
731
- directionExists = false;
732
- }
733
- module.save.transitionExists(animation, directionExists);
734
- }
735
- return (transitionExists !== undefined)
736
- ? transitionExists
737
- : directionExists
738
- ;
739
- },
740
- animate: function() {
741
- // can transition does not return a value if animation does not exist
742
- return (module.can.transition() !== undefined);
743
- }
744
- },
1046
+ // Override final display type on visible
1047
+ displayType: false,
745
1048
 
746
- is: {
747
- animating: function() {
748
- return $module.hasClass(className.animating);
749
- },
750
- inward: function() {
751
- return $module.hasClass(className.inward);
752
- },
753
- outward: function() {
754
- return $module.hasClass(className.outward);
755
- },
756
- looping: function() {
757
- return $module.hasClass(className.looping);
758
- },
759
- occurring: function(animation) {
760
- animation = animation || settings.animation;
761
- animation = '.' + animation.replace(' ', '.');
762
- return ( $module.filter(animation).length > 0 );
763
- },
764
- visible: function() {
765
- return $module.is(':visible');
766
- },
767
- hidden: function() {
768
- return $module.css('visibility') === 'hidden';
769
- },
770
- supported: function() {
771
- return(animationEnd !== false);
772
- }
773
- },
1049
+ // animation duration
1050
+ animation: 'fade',
1051
+ duration: false,
774
1052
 
775
- hide: function() {
776
- if(settings.onHide.call(element) === false) {
777
- module.verbose('Hide callback returned false cancelling hide');
778
- return false;
779
- }
780
- module.verbose('Hiding element');
781
- if( module.is.animating() ) {
782
- module.reset();
783
- }
784
- element.blur(); // IE will trigger focus change if element is not blurred before hiding
785
- module.remove.display();
786
- module.remove.visible();
787
- settings.onBeforeHide.call(element, module.hideNow);
788
- },
1053
+ // new animations will occur after previous ones
1054
+ queue: true,
789
1055
 
790
- hideNow: function() {
791
- module.set.hidden();
792
- module.force.hidden();
793
- settings.onHidden.call(element);
794
- settings.onComplete.call(element);
795
- },
796
-
797
- show: function(display) {
798
- if(module.force.visible() && settings.onShow.call(element) !== false) {
799
- module.verbose('Showing element', display);
800
- module.remove.hidden();
801
- settings.onBeforeShow.call(element, module.showNow);
802
- }
803
- },
804
-
805
- showNow: function(){
806
- module.set.visible();
807
- settings.onVisible.call(element);
808
- settings.onComplete.call(element);
809
- },
810
-
811
- toggle: function() {
812
- if( module.is.visible() ) {
813
- module.hide();
814
- }
815
- else {
816
- module.show();
817
- }
818
- },
819
-
820
- stop: function() {
821
- module.debug('Stopping current animation');
822
- $module.triggerHandler(animationEnd);
823
- },
824
-
825
- stopAll: function() {
826
- module.debug('Stopping all animation');
827
- module.remove.queueCallback();
828
- $module.triggerHandler(animationEnd);
829
- },
1056
+ // whether initially inline hidden objects should be skipped for transition
1057
+ skipInlineHidden: false,
830
1058
 
831
- clear: {
832
- queue: function() {
833
- module.debug('Clearing animation queue');
834
- module.remove.queueCallback();
835
- }
1059
+ metadata: {
1060
+ displayType: 'display',
836
1061
  },
837
1062
 
838
- enable: function() {
839
- module.verbose('Starting animation');
840
- $module.removeClass(className.disabled);
1063
+ className: {
1064
+ animating: 'animating',
1065
+ disabled: 'disabled',
1066
+ hidden: 'hidden',
1067
+ inward: 'in',
1068
+ loading: 'loading',
1069
+ looping: 'looping',
1070
+ outward: 'out',
1071
+ transition: 'transition',
1072
+ visible: 'visible',
841
1073
  },
842
1074
 
843
- disable: function() {
844
- module.debug('Stopping animation');
845
- $module.addClass(className.disabled);
1075
+ // possible errors
1076
+ error: {
1077
+ noAnimation: 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
1078
+ repeated: 'That animation is already occurring, cancelling repeated animation',
1079
+ method: 'The method you called is not defined',
1080
+ support: 'This browser does not support CSS animations',
846
1081
  },
847
1082
 
848
- setting: function(name, value) {
849
- module.debug('Changing setting', name, value);
850
- if( $.isPlainObject(name) ) {
851
- $.extend(true, settings, name);
852
- }
853
- else if(value !== undefined) {
854
- if($.isPlainObject(settings[name])) {
855
- $.extend(true, settings[name], value);
856
- }
857
- else {
858
- settings[name] = value;
859
- }
860
- }
861
- else {
862
- return settings[name];
863
- }
864
- },
865
- internal: function(name, value) {
866
- if( $.isPlainObject(name) ) {
867
- $.extend(true, module, name);
868
- }
869
- else if(value !== undefined) {
870
- module[name] = value;
871
- }
872
- else {
873
- return module[name];
874
- }
875
- },
876
- debug: function() {
877
- if(!settings.silent && settings.debug) {
878
- if(settings.performance) {
879
- module.performance.log(arguments);
880
- }
881
- else {
882
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
883
- module.debug.apply(console, arguments);
884
- }
885
- }
886
- },
887
- verbose: function() {
888
- if(!settings.silent && settings.verbose && settings.debug) {
889
- if(settings.performance) {
890
- module.performance.log(arguments);
891
- }
892
- else {
893
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
894
- module.verbose.apply(console, arguments);
895
- }
896
- }
897
- },
898
- error: function() {
899
- if(!settings.silent) {
900
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
901
- module.error.apply(console, arguments);
902
- }
903
- },
904
- performance: {
905
- log: function(message) {
906
- var
907
- currentTime,
908
- executionTime,
909
- previousTime
910
- ;
911
- if(settings.performance) {
912
- currentTime = new Date().getTime();
913
- previousTime = time || currentTime;
914
- executionTime = currentTime - previousTime;
915
- time = currentTime;
916
- performance.push({
917
- 'Name' : message[0],
918
- 'Arguments' : [].slice.call(message, 1) || '',
919
- 'Element' : element,
920
- 'Execution Time' : executionTime
921
- });
922
- }
923
- clearTimeout(module.performance.timer);
924
- module.performance.timer = setTimeout(module.performance.display, 500);
925
- },
926
- display: function() {
927
- var
928
- title = settings.name + ':',
929
- totalTime = 0
930
- ;
931
- time = false;
932
- clearTimeout(module.performance.timer);
933
- $.each(performance, function(index, data) {
934
- totalTime += data['Execution Time'];
935
- });
936
- title += ' ' + totalTime + 'ms';
937
- if(moduleSelector) {
938
- title += ' \'' + moduleSelector + '\'';
939
- }
940
- if($allModules.length > 1) {
941
- title += ' ' + '(' + $allModules.length + ')';
942
- }
943
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
944
- console.groupCollapsed(title);
945
- if(console.table) {
946
- console.table(performance);
947
- }
948
- else {
949
- $.each(performance, function(index, data) {
950
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
951
- });
952
- }
953
- console.groupEnd();
954
- }
955
- performance = [];
956
- }
957
- },
958
- // modified for transition to return invoke success
959
- invoke: function(query, passedArguments, context) {
960
- var
961
- object = instance,
962
- maxDepth,
963
- found,
964
- response
965
- ;
966
- passedArguments = passedArguments || queryArguments;
967
- context = context || element;
968
- if(typeof query == 'string' && object !== undefined) {
969
- query = query.split(/[\. ]/);
970
- maxDepth = query.length - 1;
971
- $.each(query, function(depth, value) {
972
- var camelCaseValue = (depth != maxDepth)
973
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
974
- : query
975
- ;
976
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
977
- object = object[camelCaseValue];
978
- }
979
- else if( object[camelCaseValue] !== undefined ) {
980
- found = object[camelCaseValue];
981
- return false;
982
- }
983
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
984
- object = object[value];
985
- }
986
- else if( object[value] !== undefined ) {
987
- found = object[value];
988
- return false;
989
- }
990
- else {
991
- return false;
992
- }
993
- });
994
- }
995
- if ( $.isFunction( found ) ) {
996
- response = found.apply(context, passedArguments);
997
- }
998
- else if(found !== undefined) {
999
- response = found;
1000
- }
1001
-
1002
- if(Array.isArray(returnedValue)) {
1003
- returnedValue.push(response);
1004
- }
1005
- else if(returnedValue !== undefined) {
1006
- returnedValue = [returnedValue, response];
1007
- }
1008
- else if(response !== undefined) {
1009
- returnedValue = response;
1010
- }
1011
- return (found !== undefined)
1012
- ? found
1013
- : false
1014
- ;
1015
- }
1016
- };
1017
- module.initialize();
1018
- })
1019
- ;
1020
- return (returnedValue !== undefined)
1021
- ? returnedValue
1022
- : this
1023
- ;
1024
- };
1025
-
1026
- // Records if CSS transition is available
1027
- $.fn.transition.exists = {};
1028
-
1029
- $.fn.transition.settings = {
1030
-
1031
- // module info
1032
- name : 'Transition',
1033
-
1034
- // hide all output from this component regardless of other settings
1035
- silent : false,
1036
-
1037
- // debug content outputted to console
1038
- debug : false,
1039
-
1040
- // verbose debug output
1041
- verbose : false,
1042
-
1043
- // performance data output
1044
- performance : true,
1045
-
1046
- // event namespace
1047
- namespace : 'transition',
1048
-
1049
- // delay between animations in group
1050
- interval : 0,
1051
-
1052
- // whether group animations should be reversed
1053
- reverse : 'auto',
1054
-
1055
- // animation callback event
1056
- onStart : function() {},
1057
- onComplete : function() {},
1058
- onShow : function() {},
1059
- onBeforeShow : function(callback) {callback.call(this)},
1060
- onVisible : function() {},
1061
- onHide : function() {},
1062
- onHidden : function() {},
1063
- onBeforeHide : function(callback) {callback.call(this)},
1064
-
1065
- // whether timeout should be used to ensure callback fires in cases animationend does not
1066
- useFailSafe : true,
1067
-
1068
- // delay in ms for fail safe
1069
- failSafeDelay : 100,
1070
-
1071
- // whether EXACT animation can occur twice in a row
1072
- allowRepeats : false,
1073
-
1074
- // Override final display type on visible
1075
- displayType : false,
1076
-
1077
- // animation duration
1078
- animation : 'fade',
1079
- duration : false,
1080
-
1081
- // new animations will occur after previous ones
1082
- queue : true,
1083
-
1084
- // whether initially inline hidden objects should be skipped for transition
1085
- skipInlineHidden: false,
1086
-
1087
- metadata : {
1088
- displayType: 'display'
1089
- },
1090
-
1091
- className : {
1092
- animating : 'animating',
1093
- disabled : 'disabled',
1094
- hidden : 'hidden',
1095
- inward : 'in',
1096
- loading : 'loading',
1097
- looping : 'looping',
1098
- outward : 'out',
1099
- transition : 'transition',
1100
- visible : 'visible'
1101
- },
1102
-
1103
- // possible errors
1104
- error: {
1105
- noAnimation : 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
1106
- repeated : 'That animation is already occurring, cancelling repeated animation',
1107
- method : 'The method you called is not defined',
1108
- support : 'This browser does not support CSS animations'
1109
- }
1110
-
1111
- };
1112
-
1113
-
1114
- })( jQuery, window, document );
1083
+ };
1084
+ })(jQuery, window, document);