fomantic-ui 2.9.1-beta.8 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) 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/auto_assign.yml +0 -1
  7. package/.github/workflows/ci.yml +37 -4
  8. package/.github/workflows/nightly.yml +1 -1
  9. package/.github/workflows/release.yml +1 -1
  10. package/.prettierrc.js +12 -0
  11. package/.stylelintrc.js +48 -0
  12. package/CHANGELOG.md +112 -0
  13. package/README.md +1 -1
  14. package/dist/components/accordion.css +35 -53
  15. package/dist/components/accordion.js +568 -595
  16. package/dist/components/accordion.min.css +2 -2
  17. package/dist/components/accordion.min.js +3 -3
  18. package/dist/components/ad.css +34 -45
  19. package/dist/components/ad.min.css +2 -2
  20. package/dist/components/api.js +1157 -1179
  21. package/dist/components/api.min.js +3 -3
  22. package/dist/components/breadcrumb.css +5 -5
  23. package/dist/components/breadcrumb.min.css +2 -2
  24. package/dist/components/button.css +709 -1111
  25. package/dist/components/button.min.css +2 -2
  26. package/dist/components/calendar.css +24 -27
  27. package/dist/components/calendar.js +1934 -1809
  28. package/dist/components/calendar.min.css +2 -2
  29. package/dist/components/calendar.min.js +3 -3
  30. package/dist/components/card.css +219 -365
  31. package/dist/components/card.min.css +2 -2
  32. package/dist/components/checkbox.css +120 -191
  33. package/dist/components/checkbox.js +842 -841
  34. package/dist/components/checkbox.min.css +2 -2
  35. package/dist/components/checkbox.min.js +3 -3
  36. package/dist/components/comment.css +41 -59
  37. package/dist/components/comment.min.css +2 -2
  38. package/dist/components/container.css +7 -6
  39. package/dist/components/container.min.css +2 -2
  40. package/dist/components/dimmer.css +53 -172
  41. package/dist/components/dimmer.js +706 -737
  42. package/dist/components/dimmer.min.css +2 -2
  43. package/dist/components/dimmer.min.js +3 -3
  44. package/dist/components/divider.css +43 -61
  45. package/dist/components/divider.min.css +2 -2
  46. package/dist/components/dropdown.css +252 -386
  47. package/dist/components/dropdown.js +4195 -4236
  48. package/dist/components/dropdown.min.css +2 -2
  49. package/dist/components/dropdown.min.js +3 -3
  50. package/dist/components/embed.css +18 -29
  51. package/dist/components/embed.js +645 -675
  52. package/dist/components/embed.min.css +2 -2
  53. package/dist/components/embed.min.js +3 -3
  54. package/dist/components/emoji.css +3556 -3556
  55. package/dist/components/emoji.min.css +1 -1
  56. package/dist/components/feed.css +35 -57
  57. package/dist/components/feed.min.css +2 -2
  58. package/dist/components/flag.css +270 -268
  59. package/dist/components/flag.min.css +2 -2
  60. package/dist/components/flyout.css +95 -141
  61. package/dist/components/flyout.js +1514 -1465
  62. package/dist/components/flyout.min.css +2 -2
  63. package/dist/components/flyout.min.js +3 -3
  64. package/dist/components/form.css +244 -339
  65. package/dist/components/form.js +2022 -2004
  66. package/dist/components/form.min.css +2 -2
  67. package/dist/components/form.min.js +3 -3
  68. package/dist/components/grid.css +183 -329
  69. package/dist/components/grid.min.css +2 -2
  70. package/dist/components/header.css +118 -142
  71. package/dist/components/header.min.css +2 -2
  72. package/dist/components/icon.css +662 -745
  73. package/dist/components/icon.min.css +2 -2
  74. package/dist/components/image.css +39 -63
  75. package/dist/components/image.min.css +2 -2
  76. package/dist/components/input.css +356 -274
  77. package/dist/components/input.min.css +2 -2
  78. package/dist/components/item.css +84 -131
  79. package/dist/components/item.min.css +2 -2
  80. package/dist/components/label.css +359 -410
  81. package/dist/components/label.min.css +2 -2
  82. package/dist/components/list.css +49 -70
  83. package/dist/components/list.min.css +2 -2
  84. package/dist/components/loader.css +67 -155
  85. package/dist/components/loader.min.css +2 -2
  86. package/dist/components/menu.css +270 -431
  87. package/dist/components/menu.min.css +1 -1
  88. package/dist/components/message.css +125 -197
  89. package/dist/components/message.min.css +2 -2
  90. package/dist/components/modal.css +120 -154
  91. package/dist/components/modal.js +1544 -1486
  92. package/dist/components/modal.min.css +2 -2
  93. package/dist/components/modal.min.js +3 -3
  94. package/dist/components/nag.css +53 -63
  95. package/dist/components/nag.js +520 -526
  96. package/dist/components/nag.min.css +2 -2
  97. package/dist/components/nag.min.js +3 -3
  98. package/dist/components/placeholder.css +22 -42
  99. package/dist/components/placeholder.min.css +2 -2
  100. package/dist/components/popup.css +424 -202
  101. package/dist/components/popup.js +1456 -1456
  102. package/dist/components/popup.min.css +2 -2
  103. package/dist/components/popup.min.js +3 -3
  104. package/dist/components/progress.css +106 -211
  105. package/dist/components/progress.js +969 -997
  106. package/dist/components/progress.min.css +2 -2
  107. package/dist/components/progress.min.js +3 -3
  108. package/dist/components/rail.css +15 -20
  109. package/dist/components/rail.min.css +1 -1
  110. package/dist/components/rating.css +80 -121
  111. package/dist/components/rating.js +507 -523
  112. package/dist/components/rating.min.css +2 -2
  113. package/dist/components/rating.min.js +3 -3
  114. package/dist/components/reset.css +8 -13
  115. package/dist/components/reset.min.css +2 -2
  116. package/dist/components/reveal.css +44 -83
  117. package/dist/components/reveal.min.css +2 -2
  118. package/dist/components/search.css +69 -98
  119. package/dist/components/search.js +1520 -1534
  120. package/dist/components/search.min.css +2 -2
  121. package/dist/components/search.min.js +3 -3
  122. package/dist/components/segment.css +148 -224
  123. package/dist/components/segment.min.css +2 -2
  124. package/dist/components/shape.css +14 -30
  125. package/dist/components/shape.js +783 -810
  126. package/dist/components/shape.min.css +2 -2
  127. package/dist/components/shape.min.js +3 -3
  128. package/dist/components/sidebar.css +103 -206
  129. package/dist/components/sidebar.js +1061 -1099
  130. package/dist/components/sidebar.min.css +2 -2
  131. package/dist/components/sidebar.min.js +3 -3
  132. package/dist/components/site.css +28 -41
  133. package/dist/components/site.js +436 -476
  134. package/dist/components/site.min.css +2 -2
  135. package/dist/components/site.min.js +3 -3
  136. package/dist/components/slider.css +93 -121
  137. package/dist/components/slider.js +1310 -1311
  138. package/dist/components/slider.min.css +1 -1
  139. package/dist/components/slider.min.js +3 -3
  140. package/dist/components/state.js +638 -657
  141. package/dist/components/state.min.js +3 -3
  142. package/dist/components/statistic.css +75 -116
  143. package/dist/components/statistic.min.css +2 -2
  144. package/dist/components/step.css +77 -150
  145. package/dist/components/step.min.css +2 -2
  146. package/dist/components/sticky.css +1 -5
  147. package/dist/components/sticky.js +847 -901
  148. package/dist/components/sticky.min.css +2 -2
  149. package/dist/components/sticky.min.js +3 -3
  150. package/dist/components/tab.css +10 -14
  151. package/dist/components/tab.js +902 -966
  152. package/dist/components/tab.min.css +2 -2
  153. package/dist/components/tab.min.js +3 -3
  154. package/dist/components/table.css +547 -774
  155. package/dist/components/table.min.css +2 -2
  156. package/dist/components/text.css +32 -32
  157. package/dist/components/text.min.css +1 -1
  158. package/dist/components/toast.css +69 -147
  159. package/dist/components/toast.js +910 -884
  160. package/dist/components/toast.min.css +2 -2
  161. package/dist/components/toast.min.js +3 -3
  162. package/dist/components/transition.css +299 -1356
  163. package/dist/components/transition.js +1048 -1077
  164. package/dist/components/transition.min.css +2 -2
  165. package/dist/components/transition.min.js +3 -3
  166. package/dist/components/visibility.js +1213 -1245
  167. package/dist/components/visibility.min.js +3 -3
  168. package/dist/semantic.css +9344 -12298
  169. package/dist/semantic.js +29181 -29423
  170. package/dist/semantic.min.css +3 -3
  171. package/dist/semantic.min.js +3 -3
  172. package/dist/themes/basic/assets/fonts/icons.woff2 +0 -0
  173. package/dist/themes/github/assets/fonts/octicons.woff2 +0 -0
  174. package/examples/.eslintrc.js +6 -0
  175. package/examples/assets/library/jquery.min.js +2 -4
  176. package/examples/assets/show-examples.js +13 -13
  177. package/examples/attached.html +1 -1
  178. package/examples/bootstrap.html +1 -1
  179. package/examples/components/button.html +1 -1
  180. package/examples/components/card.html +6 -6
  181. package/examples/components/input.html +1 -1
  182. package/examples/components/menu.html +1 -1
  183. package/examples/components/site.html +1 -1
  184. package/examples/components/sticky-context.html +2 -2
  185. package/examples/components/table.html +1 -1
  186. package/examples/fixed.html +3 -3
  187. package/examples/grid.html +5 -5
  188. package/examples/homepage.html +1 -1
  189. package/examples/login.html +2 -2
  190. package/examples/responsive.html +2 -2
  191. package/examples/sticky.html +4 -4
  192. package/examples/theming.html +1 -1
  193. package/gulpfile.js +13 -11
  194. package/package.json +17 -8
  195. package/scripts/nightly-version.js +83 -75
  196. package/src/_site/collections/menu.overrides +1 -1
  197. package/src/_site/elements/flag.variables +2 -2
  198. package/src/_site/globals/site.variables +1 -1
  199. package/src/_site/modules/embed.variables +3 -0
  200. package/src/definitions/behaviors/api.js +1158 -1180
  201. package/src/definitions/behaviors/form.js +2021 -2003
  202. package/src/definitions/behaviors/state.js +644 -663
  203. package/src/definitions/behaviors/visibility.js +1212 -1244
  204. package/src/definitions/collections/breadcrumb.less +43 -47
  205. package/src/definitions/collections/form.less +866 -884
  206. package/src/definitions/collections/grid.less +1681 -1699
  207. package/src/definitions/collections/menu.less +1522 -1544
  208. package/src/definitions/collections/message.less +294 -298
  209. package/src/definitions/collections/table.less +1657 -1661
  210. package/src/definitions/elements/button.less +1716 -1750
  211. package/src/definitions/elements/container.less +211 -211
  212. package/src/definitions/elements/divider.less +198 -211
  213. package/src/definitions/elements/emoji.less +41 -48
  214. package/src/definitions/elements/flag.less +46 -48
  215. package/src/definitions/elements/header.less +351 -359
  216. package/src/definitions/elements/icon.less +541 -484
  217. package/src/definitions/elements/image.less +216 -227
  218. package/src/definitions/elements/input.less +692 -699
  219. package/src/definitions/elements/label.less +784 -806
  220. package/src/definitions/elements/list.less +810 -814
  221. package/src/definitions/elements/loader.less +273 -268
  222. package/src/definitions/elements/placeholder.less +173 -170
  223. package/src/definitions/elements/rail.less +93 -93
  224. package/src/definitions/elements/reveal.less +192 -198
  225. package/src/definitions/elements/segment.less +742 -749
  226. package/src/definitions/elements/step.less +423 -437
  227. package/src/definitions/elements/text.less +34 -36
  228. package/src/definitions/globals/reset.less +11 -8
  229. package/src/definitions/globals/site.js +435 -475
  230. package/src/definitions/globals/site.less +108 -110
  231. package/src/definitions/modules/accordion.js +567 -594
  232. package/src/definitions/modules/accordion.less +244 -248
  233. package/src/definitions/modules/calendar.js +1933 -1808
  234. package/src/definitions/modules/calendar.less +100 -97
  235. package/src/definitions/modules/checkbox.js +841 -840
  236. package/src/definitions/modules/checkbox.less +531 -552
  237. package/src/definitions/modules/dimmer.js +705 -736
  238. package/src/definitions/modules/dimmer.less +294 -305
  239. package/src/definitions/modules/dropdown.js +4194 -4235
  240. package/src/definitions/modules/dropdown.less +1568 -1598
  241. package/src/definitions/modules/embed.js +644 -674
  242. package/src/definitions/modules/embed.less +82 -84
  243. package/src/definitions/modules/flyout.js +1513 -1464
  244. package/src/definitions/modules/flyout.less +453 -455
  245. package/src/definitions/modules/modal.js +1543 -1485
  246. package/src/definitions/modules/modal.less +459 -467
  247. package/src/definitions/modules/nag.js +519 -525
  248. package/src/definitions/modules/nag.less +136 -149
  249. package/src/definitions/modules/popup.js +1455 -1455
  250. package/src/definitions/modules/popup.less +738 -693
  251. package/src/definitions/modules/progress.js +968 -996
  252. package/src/definitions/modules/progress.less +523 -499
  253. package/src/definitions/modules/rating.js +506 -522
  254. package/src/definitions/modules/rating.less +98 -103
  255. package/src/definitions/modules/search.js +1519 -1533
  256. package/src/definitions/modules/search.less +374 -394
  257. package/src/definitions/modules/shape.js +782 -809
  258. package/src/definitions/modules/shape.less +70 -79
  259. package/src/definitions/modules/sidebar.js +1060 -1098
  260. package/src/definitions/modules/sidebar.less +463 -476
  261. package/src/definitions/modules/slider.js +1309 -1310
  262. package/src/definitions/modules/slider.less +309 -310
  263. package/src/definitions/modules/sticky.js +863 -917
  264. package/src/definitions/modules/sticky.less +17 -25
  265. package/src/definitions/modules/tab.js +901 -965
  266. package/src/definitions/modules/tab.less +48 -54
  267. package/src/definitions/modules/toast.js +909 -883
  268. package/src/definitions/modules/toast.less +589 -589
  269. package/src/definitions/modules/transition.js +1047 -1076
  270. package/src/definitions/modules/transition.less +58 -59
  271. package/src/definitions/views/ad.less +207 -208
  272. package/src/definitions/views/card.less +955 -973
  273. package/src/definitions/views/comment.less +192 -200
  274. package/src/definitions/views/feed.less +222 -226
  275. package/src/definitions/views/item.less +437 -448
  276. package/src/definitions/views/statistic.less +273 -279
  277. package/src/semantic.less +8 -6
  278. package/src/theme.config.example +53 -53
  279. package/src/theme.less +44 -35
  280. package/src/themes/amazon/elements/button.overrides +23 -24
  281. package/src/themes/amazon/elements/button.variables +18 -23
  282. package/src/themes/amazon/globals/site.variables +16 -17
  283. package/src/themes/basic/assets/fonts/icons.woff2 +0 -0
  284. package/src/themes/basic/collections/table.overrides +0 -1
  285. package/src/themes/basic/collections/table.variables +3 -3
  286. package/src/themes/basic/elements/button.overrides +0 -1
  287. package/src/themes/basic/elements/button.variables +9 -9
  288. package/src/themes/basic/elements/icon.overrides +9 -169
  289. package/src/themes/basic/elements/icon.variables +161 -18
  290. package/src/themes/basic/elements/step.overrides +2 -2
  291. package/src/themes/basic/elements/step.variables +2 -2
  292. package/src/themes/basic/globals/reset.overrides +1 -1
  293. package/src/themes/basic/globals/reset.variables +1 -1
  294. package/src/themes/basic/modules/progress.variables +2 -2
  295. package/src/themes/basic/views/card.overrides +0 -1
  296. package/src/themes/basic/views/card.variables +6 -6
  297. package/src/themes/bookish/elements/header.overrides +4 -4
  298. package/src/themes/bookish/elements/header.variables +5 -5
  299. package/src/themes/bootstrap3/elements/button.overrides +3 -0
  300. package/src/themes/bootstrap3/elements/button.variables +20 -25
  301. package/src/themes/chubby/collections/form.overrides +9 -9
  302. package/src/themes/chubby/collections/form.variables +3 -3
  303. package/src/themes/chubby/collections/menu.overrides +3 -0
  304. package/src/themes/chubby/collections/menu.variables +3 -3
  305. package/src/themes/chubby/elements/button.overrides +8 -10
  306. package/src/themes/chubby/elements/button.variables +10 -10
  307. package/src/themes/chubby/elements/header.overrides +1 -1
  308. package/src/themes/chubby/elements/header.variables +4 -4
  309. package/src/themes/chubby/modules/accordion.overrides +2 -2
  310. package/src/themes/chubby/modules/accordion.variables +4 -4
  311. package/src/themes/chubby/views/comment.overrides +5 -5
  312. package/src/themes/chubby/views/comment.variables +11 -11
  313. package/src/themes/classic/collections/table.variables +3 -3
  314. package/src/themes/classic/elements/button.variables +36 -43
  315. package/src/themes/classic/elements/header.variables +4 -4
  316. package/src/themes/classic/modules/progress.variables +3 -3
  317. package/src/themes/classic/views/card.overrides +25 -27
  318. package/src/themes/classic/views/card.variables +7 -7
  319. package/src/themes/colored/modules/checkbox.overrides +3 -0
  320. package/src/themes/colored/modules/checkbox.variables +1 -3
  321. package/src/themes/default/collections/breadcrumb.variables +4 -4
  322. package/src/themes/default/collections/form.variables +15 -16
  323. package/src/themes/default/collections/grid.overrides +0 -1
  324. package/src/themes/default/collections/grid.variables +15 -16
  325. package/src/themes/default/collections/menu.variables +31 -45
  326. package/src/themes/default/collections/message.variables +84 -123
  327. package/src/themes/default/collections/table.overrides +3 -0
  328. package/src/themes/default/collections/table.variables +30 -34
  329. package/src/themes/default/elements/button.variables +44 -53
  330. package/src/themes/default/elements/container.variables +8 -16
  331. package/src/themes/default/elements/divider.overrides +8 -9
  332. package/src/themes/default/elements/divider.variables +5 -6
  333. package/src/themes/default/elements/emoji.overrides +0 -1
  334. package/src/themes/default/elements/emoji.variables +3556 -3556
  335. package/src/themes/default/elements/flag.variables +1595 -1595
  336. package/src/themes/default/elements/header.overrides +0 -1
  337. package/src/themes/default/elements/header.variables +21 -21
  338. package/src/themes/default/elements/icon.variables +2016 -2012
  339. package/src/themes/default/elements/image.variables +6 -7
  340. package/src/themes/default/elements/input.variables +11 -12
  341. package/src/themes/default/elements/label.variables +25 -26
  342. package/src/themes/default/elements/list.variables +17 -21
  343. package/src/themes/default/elements/loader.variables +16 -17
  344. package/src/themes/default/elements/placeholder.variables +12 -9
  345. package/src/themes/default/elements/rail.variables +4 -5
  346. package/src/themes/default/elements/reveal.variables +1 -1
  347. package/src/themes/default/elements/segment.variables +24 -36
  348. package/src/themes/default/elements/step.overrides +4 -4
  349. package/src/themes/default/elements/step.variables +19 -22
  350. package/src/themes/default/elements/text.variables +2 -3
  351. package/src/themes/default/globals/colors.less +588 -588
  352. package/src/themes/default/globals/reset.overrides +63 -59
  353. package/src/themes/default/globals/reset.variables +1 -1
  354. package/src/themes/default/globals/site.variables +1074 -1123
  355. package/src/themes/default/globals/variation.variables +6 -4
  356. package/src/themes/default/modules/accordion.overrides +11 -11
  357. package/src/themes/default/modules/accordion.variables +15 -20
  358. package/src/themes/default/modules/calendar.variables +2 -0
  359. package/src/themes/default/modules/chatroom.variables +1 -1
  360. package/src/themes/default/modules/checkbox.overrides +9 -13
  361. package/src/themes/default/modules/checkbox.variables +24 -33
  362. package/src/themes/default/modules/dimmer.variables +14 -17
  363. package/src/themes/default/modules/dropdown.overrides +17 -17
  364. package/src/themes/default/modules/dropdown.variables +29 -31
  365. package/src/themes/default/modules/embed.variables +9 -13
  366. package/src/themes/default/modules/flyout.variables +10 -8
  367. package/src/themes/default/modules/modal.variables +64 -67
  368. package/src/themes/default/modules/nag.variables +11 -14
  369. package/src/themes/default/modules/popup.variables +14 -13
  370. package/src/themes/default/modules/progress.variables +17 -19
  371. package/src/themes/default/modules/rating.variables +10 -12
  372. package/src/themes/default/modules/search.variables +12 -17
  373. package/src/themes/default/modules/shape.variables +7 -8
  374. package/src/themes/default/modules/sidebar.variables +4 -4
  375. package/src/themes/default/modules/slider.variables +55 -54
  376. package/src/themes/default/modules/sticky.variables +1 -1
  377. package/src/themes/default/modules/toast.variables +8 -8
  378. package/src/themes/default/modules/transition.overrides +936 -915
  379. package/src/themes/default/modules/transition.variables +1 -1
  380. package/src/themes/default/views/ad.variables +1 -1
  381. package/src/themes/default/views/card.variables +33 -45
  382. package/src/themes/default/views/comment.variables +7 -9
  383. package/src/themes/default/views/feed.variables +10 -10
  384. package/src/themes/default/views/item.variables +20 -23
  385. package/src/themes/default/views/statistic.variables +8 -8
  386. package/src/themes/duo/elements/loader.variables +1 -1
  387. package/src/themes/famfamfam/elements/flag.overrides +263 -268
  388. package/src/themes/famfamfam/elements/flag.variables +4 -4
  389. package/src/themes/fixed-width/collections/grid.variables +4 -4
  390. package/src/themes/fixed-width/modules/modal.variables +11 -13
  391. package/src/themes/flat/collections/form.overrides +9 -9
  392. package/src/themes/flat/collections/form.variables +16 -17
  393. package/src/themes/flat/globals/site.variables +69 -74
  394. package/src/themes/github/assets/fonts/octicons.woff2 +0 -0
  395. package/src/themes/github/collections/breadcrumb.variables +0 -1
  396. package/src/themes/github/collections/form.overrides +7 -8
  397. package/src/themes/github/collections/form.variables +16 -18
  398. package/src/themes/github/collections/grid.variables +1 -2
  399. package/src/themes/github/collections/menu.overrides +2 -2
  400. package/src/themes/github/collections/menu.variables +24 -26
  401. package/src/themes/github/collections/message.overrides +3 -3
  402. package/src/themes/github/collections/message.variables +12 -14
  403. package/src/themes/github/collections/table.variables +2 -2
  404. package/src/themes/github/elements/button.overrides +0 -1
  405. package/src/themes/github/elements/button.variables +26 -30
  406. package/src/themes/github/elements/header.variables +2 -2
  407. package/src/themes/github/elements/icon.overrides +3 -208
  408. package/src/themes/github/elements/icon.variables +234 -19
  409. package/src/themes/github/elements/image.variables +1 -1
  410. package/src/themes/github/elements/input.overrides +16 -16
  411. package/src/themes/github/elements/input.variables +4 -5
  412. package/src/themes/github/elements/label.overrides +3 -3
  413. package/src/themes/github/elements/label.variables +0 -1
  414. package/src/themes/github/elements/segment.variables +9 -10
  415. package/src/themes/github/elements/step.overrides +13 -13
  416. package/src/themes/github/elements/step.variables +6 -6
  417. package/src/themes/github/globals/site.variables +16 -16
  418. package/src/themes/github/modules/dropdown.overrides +18 -19
  419. package/src/themes/github/modules/dropdown.variables +8 -10
  420. package/src/themes/github/modules/popup.variables +0 -2
  421. package/src/themes/gmail/collections/message.overrides +3 -0
  422. package/src/themes/gmail/collections/message.variables +4 -4
  423. package/src/themes/instagram/views/card.overrides +4 -5
  424. package/src/themes/instagram/views/card.variables +7 -8
  425. package/src/themes/joypixels/elements/emoji.overrides +0 -2
  426. package/src/themes/joypixels/elements/emoji.variables +3554 -3554
  427. package/src/themes/material/collections/menu.overrides +1 -1
  428. package/src/themes/material/collections/menu.variables +4 -4
  429. package/src/themes/material/elements/button.overrides +7 -9
  430. package/src/themes/material/elements/button.variables +44 -46
  431. package/src/themes/material/elements/header.overrides +3 -3
  432. package/src/themes/material/elements/header.variables +8 -10
  433. package/src/themes/material/elements/icon.overrides +3 -934
  434. package/src/themes/material/elements/icon.variables +958 -18
  435. package/src/themes/material/globals/site.overrides +3 -0
  436. package/src/themes/material/globals/site.variables +83 -84
  437. package/src/themes/material/modules/dropdown.overrides +2 -2
  438. package/src/themes/material/modules/dropdown.variables +5 -5
  439. package/src/themes/material/modules/modal.overrides +3 -3
  440. package/src/themes/material/modules/modal.variables +4 -5
  441. package/src/themes/pulsar/elements/loader.overrides +23 -61
  442. package/src/themes/raised/elements/button.variables +8 -9
  443. package/src/themes/resetcss/globals/reset.overrides +115 -33
  444. package/src/themes/resetcss/globals/reset.variables +1 -1
  445. package/src/themes/round/elements/button.overrides +3 -0
  446. package/src/themes/round/elements/button.variables +33 -38
  447. package/src/themes/rtl/globals/site.overrides +1 -1
  448. package/src/themes/rtl/globals/site.variables +5 -6
  449. package/src/themes/striped/modules/progress.overrides +20 -16
  450. package/src/themes/systemfont/globals/reset.overrides +1 -1
  451. package/src/themes/systemfont/globals/site.variables +6 -6
  452. package/src/themes/timeline/views/feed.overrides +12 -12
  453. package/src/themes/timeline/views/feed.variables +8 -8
  454. package/src/themes/twitter/elements/button.overrides +4 -5
  455. package/src/themes/twitter/elements/button.variables +17 -18
  456. package/src/themes/twitter/elements/emoji.variables +3556 -3556
  457. package/tasks/.eslintrc.js +9 -0
  458. package/tasks/README.md +2 -4
  459. package/tasks/admin/components/create.js +268 -277
  460. package/tasks/admin/components/init.js +123 -129
  461. package/tasks/admin/components/update.js +151 -158
  462. package/tasks/admin/distributions/create.js +183 -189
  463. package/tasks/admin/distributions/init.js +125 -131
  464. package/tasks/admin/distributions/update.js +147 -153
  465. package/tasks/admin/publish.js +5 -9
  466. package/tasks/admin/register.js +37 -39
  467. package/tasks/admin/release.js +8 -12
  468. package/tasks/build/assets.js +43 -40
  469. package/tasks/build/css.js +230 -217
  470. package/tasks/build/javascript.js +120 -114
  471. package/tasks/build.js +11 -11
  472. package/tasks/check-install.js +15 -17
  473. package/tasks/clean.js +6 -6
  474. package/tasks/collections/README.md +3 -5
  475. package/tasks/collections/admin.js +34 -36
  476. package/tasks/collections/build.js +19 -21
  477. package/tasks/collections/docs.js +11 -13
  478. package/tasks/collections/install.js +11 -13
  479. package/tasks/collections/rtl.js +9 -12
  480. package/tasks/collections/various.js +10 -12
  481. package/tasks/config/admin/github.js +17 -19
  482. package/tasks/config/admin/oauth.example.js +4 -4
  483. package/tasks/config/admin/release.js +98 -98
  484. package/tasks/config/admin/templates/README.md +8 -8
  485. package/tasks/config/admin/templates/bower.json +3 -2
  486. package/tasks/config/admin/templates/component-package.js +9 -10
  487. package/tasks/config/admin/templates/css-package.js +19 -21
  488. package/tasks/config/admin/templates/less-package.js +12 -14
  489. package/tasks/config/admin/templates/package.json +6 -6
  490. package/tasks/config/defaults.js +116 -116
  491. package/tasks/config/docs.js +23 -23
  492. package/tasks/config/npm/gulpfile.js +15 -14
  493. package/tasks/config/project/config.js +124 -136
  494. package/tasks/config/project/install.js +722 -719
  495. package/tasks/config/project/release.js +34 -41
  496. package/tasks/config/tasks.js +168 -167
  497. package/tasks/config/user.js +28 -32
  498. package/tasks/docs/build.js +100 -96
  499. package/tasks/docs/metadata.js +91 -98
  500. package/tasks/docs/serve.js +84 -82
  501. package/tasks/install.js +373 -382
  502. package/tasks/rtl/build.js +4 -3
  503. package/tasks/rtl/watch.js +4 -3
  504. package/tasks/version.js +4 -6
  505. package/tasks/watch.js +29 -31
  506. package/test/.eslintrc.js +23 -0
  507. package/test/meteor/assets.js +11 -14
  508. package/test/meteor/fonts.js +12 -13
  509. package/test/modules/accordion.spec.js +6 -8
  510. package/test/modules/checkbox.spec.js +5 -7
  511. package/test/modules/dropdown.spec.js +5 -7
  512. package/test/modules/modal.spec.js +6 -8
  513. package/test/modules/module.spec.js +158 -178
  514. package/test/modules/popup.spec.js +5 -7
  515. package/test/modules/search.spec.js +5 -7
  516. package/test/modules/shape.spec.js +5 -7
  517. package/test/modules/sidebar.spec.js +5 -7
  518. package/test/modules/tab.spec.js +6 -8
  519. package/test/modules/transition.spec.js +5 -7
  520. package/test/modules/video.spec.js +5 -7
  521. package/.github/workflows/codeql.yml +0 -68
@@ -8,1107 +8,1078 @@
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
+ module.error(error.method, query);
964
+
965
+ return false;
966
+ }
967
+ });
968
+ }
969
+ if (isFunction(found)) {
970
+ response = found.apply(context, passedArguments);
971
+ } else if (found !== undefined) {
972
+ response = found;
973
+ }
974
+
975
+ if (Array.isArray(returnedValue)) {
976
+ returnedValue.push(response);
977
+ } else if (returnedValue !== undefined) {
978
+ returnedValue = [returnedValue, response];
979
+ } else if (response !== undefined) {
980
+ returnedValue = response;
981
+ }
982
+
983
+ return found !== undefined
984
+ ? found
985
+ : false;
986
+ },
987
+ };
988
+ module.initialize();
989
+ });
990
+
991
+ return returnedValue !== undefined
992
+ ? returnedValue
993
+ : this;
994
+ };
995
+
996
+ // Records if CSS transition is available
997
+ $.fn.transition.exists = {};
998
+
999
+ $.fn.transition.settings = {
1000
+
1001
+ // module info
1002
+ name: 'Transition',
1003
+
1004
+ // hide all output from this component regardless of other settings
1005
+ silent: false,
1006
+
1007
+ // debug content outputted to console
1008
+ debug: false,
1009
+
1010
+ // verbose debug output
1011
+ verbose: false,
1012
+
1013
+ // performance data output
1014
+ performance: true,
1015
+
1016
+ // event namespace
1017
+ namespace: 'transition',
1018
+
1019
+ // delay between animations in group
1020
+ interval: 0,
1021
+
1022
+ // whether group animations should be reversed
1023
+ reverse: 'auto',
1024
+
1025
+ // animation callback event
1026
+ onStart: function () {},
1027
+ onComplete: function () {},
1028
+ onShow: function () {},
1029
+ onBeforeShow: function (callback) {
1030
+ callback.call(this);
416
1031
  },
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
- }
1032
+ onVisible: function () {},
1033
+ onHide: function () {},
1034
+ onHidden: function () {},
1035
+ onBeforeHide: function (callback) {
1036
+ callback.call(this);
431
1037
  },
432
1038
 
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
- },
1039
+ // whether timeout should be used to ensure callback fires in cases animationend does not
1040
+ useFailSafe: true,
444
1041
 
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
- }
1042
+ // delay in ms for fail safe
1043
+ failSafeDelay: 100,
671
1044
 
672
- },
1045
+ // whether EXACT animation can occur twice in a row
1046
+ allowRepeats: false,
673
1047
 
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
- },
1048
+ // Override final display type on visible
1049
+ displayType: false,
745
1050
 
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
- },
1051
+ // animation duration
1052
+ animation: 'fade',
1053
+ duration: false,
774
1054
 
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
- },
1055
+ // new animations will occur after previous ones
1056
+ queue: true,
789
1057
 
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
- },
1058
+ // whether initially inline hidden objects should be skipped for transition
1059
+ skipInlineHidden: false,
830
1060
 
831
- clear: {
832
- queue: function() {
833
- module.debug('Clearing animation queue');
834
- module.remove.queueCallback();
835
- }
1061
+ metadata: {
1062
+ displayType: 'display',
836
1063
  },
837
1064
 
838
- enable: function() {
839
- module.verbose('Starting animation');
840
- $module.removeClass(className.disabled);
1065
+ className: {
1066
+ animating: 'animating',
1067
+ disabled: 'disabled',
1068
+ hidden: 'hidden',
1069
+ inward: 'in',
1070
+ loading: 'loading',
1071
+ looping: 'looping',
1072
+ outward: 'out',
1073
+ transition: 'transition',
1074
+ visible: 'visible',
841
1075
  },
842
1076
 
843
- disable: function() {
844
- module.debug('Stopping animation');
845
- $module.addClass(className.disabled);
1077
+ // possible errors
1078
+ error: {
1079
+ noAnimation: 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
1080
+ method: 'The method you called is not defined',
1081
+ support: 'This browser does not support CSS animations',
846
1082
  },
847
1083
 
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 );
1084
+ };
1085
+ })(jQuery, window, document);