fomantic-ui 2.9.1-beta.2 → 2.9.1-beta.21

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 (493) hide show
  1. package/.eslintrc.js +111 -0
  2. package/.github/workflows/ci.yml +14 -4
  3. package/.stylelintrc.js +59 -0
  4. package/dist/components/accordion.css +19 -26
  5. package/dist/components/accordion.js +568 -595
  6. package/dist/components/accordion.min.css +1 -1
  7. package/dist/components/accordion.min.js +2 -2
  8. package/dist/components/ad.css +31 -41
  9. package/dist/components/ad.min.css +1 -1
  10. package/dist/components/api.js +1156 -1179
  11. package/dist/components/api.min.js +2 -2
  12. package/dist/components/breadcrumb.css +1 -1
  13. package/dist/components/breadcrumb.min.css +1 -1
  14. package/dist/components/button.css +71 -106
  15. package/dist/components/button.min.css +1 -1
  16. package/dist/components/calendar.css +18 -16
  17. package/dist/components/calendar.js +1902 -1809
  18. package/dist/components/calendar.min.css +2 -2
  19. package/dist/components/calendar.min.js +2 -2
  20. package/dist/components/card.css +83 -115
  21. package/dist/components/card.min.css +1 -1
  22. package/dist/components/checkbox.css +47 -64
  23. package/dist/components/checkbox.js +842 -841
  24. package/dist/components/checkbox.min.css +1 -1
  25. package/dist/components/checkbox.min.js +2 -2
  26. package/dist/components/comment.css +37 -51
  27. package/dist/components/comment.min.css +1 -1
  28. package/dist/components/container.css +6 -5
  29. package/dist/components/container.min.css +2 -2
  30. package/dist/components/dimmer.css +31 -41
  31. package/dist/components/dimmer.js +708 -737
  32. package/dist/components/dimmer.min.css +1 -1
  33. package/dist/components/dimmer.min.js +2 -2
  34. package/dist/components/divider.css +32 -44
  35. package/dist/components/divider.min.css +1 -1
  36. package/dist/components/dropdown.css +129 -166
  37. package/dist/components/dropdown.js +4161 -4234
  38. package/dist/components/dropdown.min.css +2 -2
  39. package/dist/components/dropdown.min.js +2 -2
  40. package/dist/components/embed.css +13 -19
  41. package/dist/components/embed.js +651 -675
  42. package/dist/components/embed.min.css +1 -1
  43. package/dist/components/embed.min.js +2 -2
  44. package/dist/components/emoji.css +7 -6
  45. package/dist/components/feed.css +24 -32
  46. package/dist/components/feed.min.css +1 -1
  47. package/dist/components/flag.css +5 -3
  48. package/dist/components/flag.min.css +1 -1
  49. package/dist/components/flyout.css +44 -58
  50. package/dist/components/flyout.js +1464 -1465
  51. package/dist/components/flyout.min.css +2 -2
  52. package/dist/components/flyout.min.js +2 -2
  53. package/dist/components/form.css +85 -111
  54. package/dist/components/form.js +1979 -2004
  55. package/dist/components/form.min.css +1 -1
  56. package/dist/components/form.min.js +2 -2
  57. package/dist/components/grid.css +70 -96
  58. package/dist/components/grid.min.css +1 -1
  59. package/dist/components/header.css +47 -65
  60. package/dist/components/header.min.css +1 -1
  61. package/dist/components/icon.css +45 -66
  62. package/dist/components/icon.min.css +2 -2
  63. package/dist/components/image.css +32 -42
  64. package/dist/components/image.min.css +1 -1
  65. package/dist/components/input.css +182 -65
  66. package/dist/components/input.min.css +2 -2
  67. package/dist/components/item.css +55 -77
  68. package/dist/components/item.min.css +1 -1
  69. package/dist/components/label.css +68 -91
  70. package/dist/components/label.min.css +2 -2
  71. package/dist/components/list.css +44 -59
  72. package/dist/components/list.min.css +1 -1
  73. package/dist/components/loader.css +16 -22
  74. package/dist/components/loader.min.css +1 -1
  75. package/dist/components/menu.css +126 -186
  76. package/dist/components/message.css +25 -35
  77. package/dist/components/message.min.css +1 -1
  78. package/dist/components/modal.css +39 -40
  79. package/dist/components/modal.js +1491 -1485
  80. package/dist/components/modal.min.css +2 -2
  81. package/dist/components/modal.min.js +2 -2
  82. package/dist/components/nag.css +21 -28
  83. package/dist/components/nag.js +518 -526
  84. package/dist/components/nag.min.css +2 -2
  85. package/dist/components/nag.min.js +2 -2
  86. package/dist/components/placeholder.css +10 -12
  87. package/dist/components/placeholder.min.css +1 -1
  88. package/dist/components/popup.css +352 -59
  89. package/dist/components/popup.js +1437 -1456
  90. package/dist/components/popup.min.css +2 -2
  91. package/dist/components/popup.min.js +2 -2
  92. package/dist/components/progress.css +29 -39
  93. package/dist/components/progress.js +969 -997
  94. package/dist/components/progress.min.css +1 -1
  95. package/dist/components/progress.min.js +2 -2
  96. package/dist/components/rail.css +15 -20
  97. package/dist/components/rail.min.css +1 -1
  98. package/dist/components/rating.css +9 -13
  99. package/dist/components/rating.js +505 -523
  100. package/dist/components/rating.min.css +1 -1
  101. package/dist/components/rating.min.js +2 -2
  102. package/dist/components/reset.css +1 -1
  103. package/dist/components/reset.min.css +1 -1
  104. package/dist/components/reveal.css +19 -26
  105. package/dist/components/reveal.min.css +1 -1
  106. package/dist/components/search.css +43 -58
  107. package/dist/components/search.js +1498 -1534
  108. package/dist/components/search.min.css +2 -2
  109. package/dist/components/search.min.js +2 -2
  110. package/dist/components/segment.css +64 -83
  111. package/dist/components/segment.min.css +2 -2
  112. package/dist/components/shape.css +10 -14
  113. package/dist/components/shape.js +792 -809
  114. package/dist/components/shape.min.css +1 -1
  115. package/dist/components/shape.min.js +2 -2
  116. package/dist/components/sidebar.css +43 -58
  117. package/dist/components/sidebar.js +1071 -1098
  118. package/dist/components/sidebar.min.css +2 -2
  119. package/dist/components/sidebar.min.js +2 -2
  120. package/dist/components/site.css +5 -5
  121. package/dist/components/site.js +462 -476
  122. package/dist/components/site.min.css +1 -1
  123. package/dist/components/site.min.js +2 -2
  124. package/dist/components/slider.css +27 -37
  125. package/dist/components/slider.js +1287 -1306
  126. package/dist/components/slider.min.js +2 -2
  127. package/dist/components/state.js +639 -657
  128. package/dist/components/state.min.js +2 -2
  129. package/dist/components/statistic.css +32 -41
  130. package/dist/components/statistic.min.css +2 -2
  131. package/dist/components/step.css +26 -35
  132. package/dist/components/step.min.css +1 -1
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +857 -902
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +2 -2
  137. package/dist/components/tab.css +6 -8
  138. package/dist/components/tab.js +922 -963
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +2 -2
  141. package/dist/components/table.css +93 -119
  142. package/dist/components/table.min.css +2 -2
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +4 -6
  146. package/dist/components/toast.js +886 -887
  147. package/dist/components/toast.min.css +1 -1
  148. package/dist/components/toast.min.js +2 -2
  149. package/dist/components/transition.css +179 -42
  150. package/dist/components/transition.js +1041 -1077
  151. package/dist/components/transition.min.css +2 -2
  152. package/dist/components/transition.min.js +2 -2
  153. package/dist/components/visibility.js +1220 -1244
  154. package/dist/components/visibility.min.js +2 -2
  155. package/dist/semantic.css +2558 -1807
  156. package/dist/semantic.js +28960 -29413
  157. package/dist/semantic.min.css +2 -2
  158. package/dist/semantic.min.js +2 -2
  159. package/dist/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  160. package/dist/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  161. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  162. package/dist/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  163. package/dist/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  164. package/dist/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  165. package/dist/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  166. package/dist/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  167. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  168. package/dist/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  169. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  170. package/dist/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  171. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  172. package/dist/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  173. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  174. package/dist/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  175. package/examples/assets/show-examples.js +13 -13
  176. package/gulpfile.js +9 -10
  177. package/package.json +13 -8
  178. package/scripts/nightly-version.js +81 -75
  179. package/src/_site/collections/menu.overrides +1 -1
  180. package/src/_site/elements/flag.variables +2 -2
  181. package/src/_site/globals/site.variables +1 -1
  182. package/src/definitions/behaviors/api.js +1157 -1180
  183. package/src/definitions/behaviors/form.js +1978 -2003
  184. package/src/definitions/behaviors/state.js +645 -663
  185. package/src/definitions/behaviors/visibility.js +1219 -1243
  186. package/src/definitions/collections/breadcrumb.less +41 -45
  187. package/src/definitions/collections/form.less +864 -882
  188. package/src/definitions/collections/grid.less +1689 -1697
  189. package/src/definitions/collections/menu.less +1490 -1508
  190. package/src/definitions/collections/message.less +292 -295
  191. package/src/definitions/collections/table.less +1616 -1620
  192. package/src/definitions/elements/button.less +1710 -1754
  193. package/src/definitions/elements/container.less +209 -209
  194. package/src/definitions/elements/divider.less +200 -209
  195. package/src/definitions/elements/emoji.less +38 -45
  196. package/src/definitions/elements/flag.less +44 -46
  197. package/src/definitions/elements/header.less +337 -345
  198. package/src/definitions/elements/icon.less +516 -451
  199. package/src/definitions/elements/image.less +219 -225
  200. package/src/definitions/elements/input.less +657 -663
  201. package/src/definitions/elements/label.less +783 -804
  202. package/src/definitions/elements/list.less +808 -812
  203. package/src/definitions/elements/loader.less +269 -266
  204. package/src/definitions/elements/placeholder.less +171 -168
  205. package/src/definitions/elements/rail.less +91 -91
  206. package/src/definitions/elements/reveal.less +190 -196
  207. package/src/definitions/elements/segment.less +738 -747
  208. package/src/definitions/elements/step.less +424 -435
  209. package/src/definitions/elements/text.less +32 -34
  210. package/src/definitions/globals/reset.less +9 -6
  211. package/src/definitions/globals/site.js +461 -475
  212. package/src/definitions/globals/site.less +106 -108
  213. package/src/definitions/modules/accordion.js +567 -594
  214. package/src/definitions/modules/accordion.less +242 -246
  215. package/src/definitions/modules/calendar.js +1901 -1808
  216. package/src/definitions/modules/calendar.less +98 -95
  217. package/src/definitions/modules/checkbox.js +841 -840
  218. package/src/definitions/modules/checkbox.less +524 -545
  219. package/src/definitions/modules/dimmer.js +707 -736
  220. package/src/definitions/modules/dimmer.less +300 -303
  221. package/src/definitions/modules/dropdown.js +4160 -4233
  222. package/src/definitions/modules/dropdown.less +1570 -1596
  223. package/src/definitions/modules/embed.js +650 -674
  224. package/src/definitions/modules/embed.less +80 -82
  225. package/src/definitions/modules/flyout.js +1463 -1464
  226. package/src/definitions/modules/flyout.less +444 -454
  227. package/src/definitions/modules/modal.js +1490 -1484
  228. package/src/definitions/modules/modal.less +459 -465
  229. package/src/definitions/modules/nag.js +517 -525
  230. package/src/definitions/modules/nag.less +134 -147
  231. package/src/definitions/modules/popup.js +1436 -1455
  232. package/src/definitions/modules/popup.less +733 -690
  233. package/src/definitions/modules/progress.js +968 -996
  234. package/src/definitions/modules/progress.less +521 -497
  235. package/src/definitions/modules/rating.js +504 -522
  236. package/src/definitions/modules/rating.less +94 -101
  237. package/src/definitions/modules/search.js +1497 -1533
  238. package/src/definitions/modules/search.less +373 -392
  239. package/src/definitions/modules/shape.js +791 -808
  240. package/src/definitions/modules/shape.less +68 -77
  241. package/src/definitions/modules/sidebar.js +1070 -1097
  242. package/src/definitions/modules/sidebar.less +462 -474
  243. package/src/definitions/modules/slider.js +1286 -1305
  244. package/src/definitions/modules/slider.less +307 -308
  245. package/src/definitions/modules/sticky.js +873 -918
  246. package/src/definitions/modules/sticky.less +22 -23
  247. package/src/definitions/modules/tab.js +921 -962
  248. package/src/definitions/modules/tab.less +46 -52
  249. package/src/definitions/modules/toast.js +885 -886
  250. package/src/definitions/modules/toast.less +584 -586
  251. package/src/definitions/modules/transition.js +1040 -1076
  252. package/src/definitions/modules/transition.less +62 -28
  253. package/src/definitions/views/ad.less +205 -206
  254. package/src/definitions/views/card.less +963 -969
  255. package/src/definitions/views/comment.less +190 -198
  256. package/src/definitions/views/feed.less +220 -224
  257. package/src/definitions/views/item.less +435 -446
  258. package/src/definitions/views/statistic.less +271 -277
  259. package/src/theme.less +29 -32
  260. package/src/themes/amazon/elements/button.overrides +23 -24
  261. package/src/themes/amazon/elements/button.variables +11 -11
  262. package/src/themes/amazon/globals/site.variables +2 -3
  263. package/src/themes/basic/collections/table.overrides +0 -1
  264. package/src/themes/basic/collections/table.variables +3 -3
  265. package/src/themes/basic/elements/button.overrides +0 -1
  266. package/src/themes/basic/elements/button.variables +2 -2
  267. package/src/themes/basic/elements/icon.overrides +12 -13
  268. package/src/themes/basic/elements/icon.variables +13 -13
  269. package/src/themes/basic/elements/step.overrides +2 -2
  270. package/src/themes/basic/elements/step.variables +2 -2
  271. package/src/themes/basic/globals/reset.overrides +1 -1
  272. package/src/themes/basic/globals/reset.variables +1 -1
  273. package/src/themes/basic/views/card.overrides +0 -1
  274. package/src/themes/basic/views/card.variables +3 -3
  275. package/src/themes/bookish/elements/header.overrides +3 -3
  276. package/src/themes/bookish/elements/header.variables +2 -2
  277. package/src/themes/bootstrap3/elements/button.variables +7 -8
  278. package/src/themes/chubby/collections/form.overrides +9 -9
  279. package/src/themes/chubby/collections/form.variables +3 -3
  280. package/src/themes/chubby/collections/menu.variables +1 -1
  281. package/src/themes/chubby/elements/button.overrides +7 -9
  282. package/src/themes/chubby/elements/button.variables +2 -2
  283. package/src/themes/chubby/elements/header.variables +3 -3
  284. package/src/themes/chubby/modules/accordion.overrides +2 -2
  285. package/src/themes/chubby/modules/accordion.variables +3 -3
  286. package/src/themes/chubby/views/comment.overrides +5 -5
  287. package/src/themes/chubby/views/comment.variables +4 -4
  288. package/src/themes/classic/collections/table.variables +2 -2
  289. package/src/themes/classic/elements/button.variables +20 -21
  290. package/src/themes/classic/elements/header.variables +3 -3
  291. package/src/themes/classic/modules/progress.variables +1 -1
  292. package/src/themes/classic/views/card.overrides +14 -14
  293. package/src/themes/classic/views/card.variables +4 -4
  294. package/src/themes/colored/modules/checkbox.variables +1 -1
  295. package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  296. package/src/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  297. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  298. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  299. package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  300. package/src/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  301. package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  302. package/src/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  303. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  304. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  305. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  306. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  307. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  308. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  309. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  310. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  311. package/src/themes/default/collections/breadcrumb.variables +4 -4
  312. package/src/themes/default/collections/form.variables +12 -12
  313. package/src/themes/default/collections/grid.overrides +0 -1
  314. package/src/themes/default/collections/grid.variables +14 -16
  315. package/src/themes/default/collections/menu.variables +19 -31
  316. package/src/themes/default/collections/message.variables +83 -84
  317. package/src/themes/default/collections/table.variables +16 -18
  318. package/src/themes/default/elements/button.variables +30 -31
  319. package/src/themes/default/elements/container.variables +4 -12
  320. package/src/themes/default/elements/divider.overrides +8 -9
  321. package/src/themes/default/elements/divider.variables +4 -5
  322. package/src/themes/default/elements/emoji.overrides +0 -1
  323. package/src/themes/default/elements/emoji.variables +3555 -3555
  324. package/src/themes/default/elements/flag.variables +1594 -1594
  325. package/src/themes/default/elements/header.overrides +0 -1
  326. package/src/themes/default/elements/header.variables +16 -16
  327. package/src/themes/default/elements/icon.variables +2017 -2001
  328. package/src/themes/default/elements/image.variables +6 -7
  329. package/src/themes/default/elements/input.variables +10 -10
  330. package/src/themes/default/elements/label.variables +19 -20
  331. package/src/themes/default/elements/list.variables +16 -16
  332. package/src/themes/default/elements/loader.variables +15 -16
  333. package/src/themes/default/elements/placeholder.variables +6 -7
  334. package/src/themes/default/elements/rail.variables +4 -5
  335. package/src/themes/default/elements/segment.variables +18 -29
  336. package/src/themes/default/elements/step.overrides +4 -4
  337. package/src/themes/default/elements/step.variables +14 -16
  338. package/src/themes/default/elements/text.variables +2 -3
  339. package/src/themes/default/globals/colors.less +588 -588
  340. package/src/themes/default/globals/reset.overrides +57 -57
  341. package/src/themes/default/globals/reset.variables +1 -1
  342. package/src/themes/default/globals/site.variables +869 -875
  343. package/src/themes/default/globals/variation.variables +13 -4
  344. package/src/themes/default/modules/accordion.overrides +11 -11
  345. package/src/themes/default/modules/accordion.variables +14 -15
  346. package/src/themes/default/modules/calendar.variables +2 -0
  347. package/src/themes/default/modules/chatroom.variables +1 -1
  348. package/src/themes/default/modules/checkbox.overrides +6 -7
  349. package/src/themes/default/modules/checkbox.variables +17 -22
  350. package/src/themes/default/modules/dimmer.variables +7 -8
  351. package/src/themes/default/modules/dropdown.overrides +17 -17
  352. package/src/themes/default/modules/dropdown.variables +20 -21
  353. package/src/themes/default/modules/embed.variables +9 -10
  354. package/src/themes/default/modules/flyout.variables +6 -6
  355. package/src/themes/default/modules/modal.variables +18 -18
  356. package/src/themes/default/modules/nag.variables +11 -14
  357. package/src/themes/default/modules/popup.variables +14 -13
  358. package/src/themes/default/modules/progress.variables +10 -11
  359. package/src/themes/default/modules/rating.variables +10 -11
  360. package/src/themes/default/modules/search.variables +9 -11
  361. package/src/themes/default/modules/shape.variables +6 -6
  362. package/src/themes/default/modules/sidebar.variables +4 -4
  363. package/src/themes/default/modules/slider.variables +48 -49
  364. package/src/themes/default/modules/sticky.variables +1 -1
  365. package/src/themes/default/modules/toast.variables +1 -1
  366. package/src/themes/default/modules/transition.overrides +936 -915
  367. package/src/themes/default/modules/transition.variables +8 -1
  368. package/src/themes/default/views/card.variables +20 -22
  369. package/src/themes/default/views/comment.variables +6 -8
  370. package/src/themes/default/views/feed.variables +6 -6
  371. package/src/themes/default/views/item.variables +6 -9
  372. package/src/themes/default/views/statistic.variables +8 -8
  373. package/src/themes/duo/elements/loader.variables +1 -1
  374. package/src/themes/famfamfam/elements/flag.overrides +263 -268
  375. package/src/themes/famfamfam/elements/flag.variables +3 -3
  376. package/src/themes/fixed-width/collections/grid.variables +1 -1
  377. package/src/themes/fixed-width/modules/modal.variables +3 -5
  378. package/src/themes/flat/collections/form.overrides +9 -9
  379. package/src/themes/flat/collections/form.variables +4 -5
  380. package/src/themes/flat/globals/site.variables +61 -66
  381. package/src/themes/github/collections/breadcrumb.variables +0 -1
  382. package/src/themes/github/collections/form.overrides +7 -8
  383. package/src/themes/github/collections/form.variables +12 -13
  384. package/src/themes/github/collections/grid.variables +1 -2
  385. package/src/themes/github/collections/menu.overrides +2 -2
  386. package/src/themes/github/collections/menu.variables +11 -12
  387. package/src/themes/github/collections/message.overrides +3 -3
  388. package/src/themes/github/collections/message.variables +5 -5
  389. package/src/themes/github/collections/table.variables +1 -1
  390. package/src/themes/github/elements/button.overrides +0 -1
  391. package/src/themes/github/elements/button.variables +14 -14
  392. package/src/themes/github/elements/header.variables +2 -2
  393. package/src/themes/github/elements/icon.overrides +179 -179
  394. package/src/themes/github/elements/icon.variables +10 -10
  395. package/src/themes/github/elements/image.variables +1 -1
  396. package/src/themes/github/elements/input.overrides +16 -16
  397. package/src/themes/github/elements/input.variables +3 -3
  398. package/src/themes/github/elements/label.overrides +3 -3
  399. package/src/themes/github/elements/label.variables +0 -1
  400. package/src/themes/github/elements/segment.variables +2 -3
  401. package/src/themes/github/elements/step.overrides +13 -13
  402. package/src/themes/github/elements/step.variables +2 -2
  403. package/src/themes/github/globals/site.variables +2 -2
  404. package/src/themes/github/modules/dropdown.overrides +18 -19
  405. package/src/themes/github/modules/dropdown.variables +1 -1
  406. package/src/themes/github/modules/popup.variables +0 -2
  407. package/src/themes/instagram/views/card.overrides +3 -4
  408. package/src/themes/instagram/views/card.variables +3 -4
  409. package/src/themes/joypixels/elements/emoji.overrides +0 -2
  410. package/src/themes/joypixels/elements/emoji.variables +3554 -3554
  411. package/src/themes/material/collections/menu.variables +1 -1
  412. package/src/themes/material/elements/button.overrides +6 -8
  413. package/src/themes/material/elements/button.variables +28 -28
  414. package/src/themes/material/elements/header.overrides +2 -2
  415. package/src/themes/material/elements/header.variables +2 -4
  416. package/src/themes/material/elements/icon.overrides +932 -932
  417. package/src/themes/material/elements/icon.variables +11 -11
  418. package/src/themes/material/globals/site.variables +78 -79
  419. package/src/themes/material/modules/dropdown.overrides +1 -1
  420. package/src/themes/material/modules/dropdown.variables +1 -1
  421. package/src/themes/material/modules/modal.overrides +2 -2
  422. package/src/themes/material/modules/modal.variables +1 -2
  423. package/src/themes/pulsar/elements/loader.overrides +58 -58
  424. package/src/themes/raised/elements/button.variables +8 -8
  425. package/src/themes/resetcss/globals/reset.overrides +115 -33
  426. package/src/themes/resetcss/globals/reset.variables +1 -1
  427. package/src/themes/round/elements/button.variables +11 -14
  428. package/src/themes/rtl/globals/site.variables +5 -6
  429. package/src/themes/striped/modules/progress.overrides +20 -16
  430. package/src/themes/systemfont/globals/reset.overrides +1 -1
  431. package/src/themes/systemfont/globals/site.variables +5 -5
  432. package/src/themes/timeline/views/feed.overrides +12 -12
  433. package/src/themes/timeline/views/feed.variables +4 -4
  434. package/src/themes/twitter/elements/button.overrides +4 -5
  435. package/src/themes/twitter/elements/button.variables +6 -7
  436. package/src/themes/twitter/elements/emoji.variables +3555 -3555
  437. package/tasks/admin/components/create.js +274 -276
  438. package/tasks/admin/components/init.js +123 -130
  439. package/tasks/admin/components/update.js +149 -157
  440. package/tasks/admin/distributions/create.js +184 -187
  441. package/tasks/admin/distributions/init.js +123 -130
  442. package/tasks/admin/distributions/update.js +145 -152
  443. package/tasks/admin/publish.js +5 -7
  444. package/tasks/admin/register.js +36 -38
  445. package/tasks/admin/release.js +8 -10
  446. package/tasks/build/assets.js +42 -39
  447. package/tasks/build/css.js +225 -216
  448. package/tasks/build/javascript.js +118 -113
  449. package/tasks/build.js +10 -10
  450. package/tasks/check-install.js +14 -16
  451. package/tasks/clean.js +5 -5
  452. package/tasks/collections/admin.js +34 -36
  453. package/tasks/collections/build.js +18 -20
  454. package/tasks/collections/docs.js +9 -11
  455. package/tasks/collections/install.js +9 -11
  456. package/tasks/collections/rtl.js +9 -11
  457. package/tasks/collections/various.js +8 -10
  458. package/tasks/config/admin/github.js +17 -17
  459. package/tasks/config/admin/oauth.example.js +4 -4
  460. package/tasks/config/admin/release.js +98 -98
  461. package/tasks/config/admin/templates/component-package.js +9 -10
  462. package/tasks/config/admin/templates/css-package.js +18 -20
  463. package/tasks/config/admin/templates/less-package.js +11 -13
  464. package/tasks/config/defaults.js +116 -114
  465. package/tasks/config/docs.js +23 -23
  466. package/tasks/config/npm/gulpfile.js +8 -9
  467. package/tasks/config/project/config.js +127 -134
  468. package/tasks/config/project/install.js +715 -713
  469. package/tasks/config/project/release.js +32 -38
  470. package/tasks/config/tasks.js +165 -156
  471. package/tasks/config/user.js +23 -26
  472. package/tasks/docs/build.js +97 -95
  473. package/tasks/docs/metadata.js +90 -96
  474. package/tasks/docs/serve.js +80 -81
  475. package/tasks/install.js +370 -378
  476. package/tasks/rtl/build.js +2 -2
  477. package/tasks/rtl/watch.js +2 -2
  478. package/tasks/version.js +4 -4
  479. package/tasks/watch.js +28 -30
  480. package/test/meteor/assets.js +10 -13
  481. package/test/meteor/fonts.js +12 -13
  482. package/test/modules/accordion.spec.js +6 -8
  483. package/test/modules/checkbox.spec.js +5 -7
  484. package/test/modules/dropdown.spec.js +5 -7
  485. package/test/modules/modal.spec.js +6 -8
  486. package/test/modules/module.spec.js +158 -178
  487. package/test/modules/popup.spec.js +5 -7
  488. package/test/modules/search.spec.js +5 -7
  489. package/test/modules/shape.spec.js +5 -7
  490. package/test/modules/sidebar.spec.js +5 -7
  491. package/test/modules/tab.spec.js +6 -8
  492. package/test/modules/transition.spec.js +5 -7
  493. package/test/modules/video.spec.js +5 -7
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.1-beta.2+f5a64f3 - Toast
2
+ * # Fomantic-UI 2.9.1-beta.21+2722e1b - Toast
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -8,919 +8,918 @@
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
- $.toast = $.fn.toast = function(parameters) {
27
- var
28
- $allModules = $(this),
29
- moduleSelector = $allModules.selector || '',
30
-
31
- time = new Date().getTime(),
32
- performance = [],
33
-
34
- query = arguments[0],
35
- methodInvoked = (typeof query == 'string'),
36
- queryArguments = [].slice.call(arguments, 1),
37
- returnedValue
38
- ;
39
- $allModules
40
- .each(function() {
41
- var
42
- settings = ( $.isPlainObject(parameters) )
43
- ? $.extend(true, {}, $.fn.toast.settings, parameters)
44
- : $.extend({}, $.fn.toast.settings),
45
-
46
- className = settings.className,
47
- selector = settings.selector,
48
- error = settings.error,
49
- namespace = settings.namespace,
50
- fields = settings.fields,
51
-
52
- eventNamespace = '.' + namespace,
53
- moduleNamespace = namespace + '-module',
54
-
55
- $module = $(this),
56
- $toastBox,
57
- $toast,
58
- $actions,
59
- $progress,
60
- $progressBar,
61
- $animationObject,
62
- $close,
63
- $context = (settings.context)
64
- ? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
65
- : $('body'),
66
-
67
- isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
68
-
69
- element = this,
70
- instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
71
-
72
- id,
73
- module
74
- ;
75
- module = {
76
-
77
- initialize: function() {
78
- module.verbose('Initializing element');
79
- module.create.id();
80
- if (!module.has.container()) {
81
- module.create.container();
82
- }
83
- if(isToastComponent || settings.message !== '' || settings.title !== '' || module.get.iconClass() !== '' || settings.showImage || module.has.configActions()) {
84
- if(typeof settings.showProgress !== 'string' || [className.top,className.bottom].indexOf(settings.showProgress) === -1 ) {
85
- settings.showProgress = false;
86
- }
87
- module.create.toast();
88
- if(settings.closeOnClick && (settings.closeIcon || $($toast).find(selector.input).length > 0 || module.has.configActions())){
89
- settings.closeOnClick = false;
90
- }
91
- if(!settings.closeOnClick) {
92
- $toastBox.addClass(className.unclickable);
93
- }
94
- module.bind.events();
95
- }
96
- module.instantiate();
97
- if($toastBox) {
98
- module.show();
99
- }
100
- },
11
+ (function ($, window, document, undefined) {
12
+ 'use strict';
101
13
 
102
- instantiate: function() {
103
- module.verbose('Storing instance of toast');
104
- instance = module;
105
- $module
106
- .data(moduleNamespace, instance)
107
- ;
108
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
109
17
 
110
- destroy: function() {
111
- if($toastBox) {
112
- module.debug('Removing toast', $toastBox);
113
- module.unbind.events();
114
- $toastBox.remove();
115
- $toastBox = undefined;
116
- $toast = undefined;
117
- $animationObject = undefined;
118
- settings.onRemove.call($toastBox, element);
119
- $progress = undefined;
120
- $progressBar = undefined;
121
- $close = undefined;
122
- }
123
- $module
124
- .removeData(moduleNamespace)
125
- ;
126
- },
18
+ window = (typeof window != 'undefined' && window.Math == Math)
19
+ ? window
20
+ : globalThis;
127
21
 
128
- show: function(callback) {
129
- if(settings.onShow.call($toastBox, element) === false) {
130
- module.debug('onShow callback returned false, cancelling toast animation');
131
- return;
132
- }
133
- callback = callback || function(){};
134
- module.debug('Showing toast');
135
- module.animate.show(callback);
136
- },
22
+ $.toast = $.fn.toast = function (parameters) {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
137
26
 
138
- close: function(callback) {
139
- if(settings.onHide.call($toastBox, element) === false) {
140
- module.debug('onHide callback returned false, cancelling toast animation');
141
- return;
142
- }
143
- callback = callback || function(){};
144
- module.debug('Closing toast');
145
- module.remove.visible();
146
- module.unbind.events();
147
- module.animate.close(callback);
27
+ time = new Date().getTime(),
28
+ performance = [],
148
29
 
149
- },
30
+ query = arguments[0],
31
+ methodInvoked = (typeof query == 'string'),
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ returnedValue
34
+ ;
35
+ $allModules.each(function () {
36
+ var
37
+ settings = ($.isPlainObject(parameters))
38
+ ? $.extend(true, {}, $.fn.toast.settings, parameters)
39
+ : $.extend({}, $.fn.toast.settings),
40
+
41
+ className = settings.className,
42
+ selector = settings.selector,
43
+ error = settings.error,
44
+ namespace = settings.namespace,
45
+ fields = settings.fields,
46
+
47
+ eventNamespace = '.' + namespace,
48
+ moduleNamespace = namespace + '-module',
49
+
50
+ $module = $(this),
51
+ $toastBox,
52
+ $toast,
53
+ $actions,
54
+ $progress,
55
+ $progressBar,
56
+ $animationObject,
57
+ $close,
58
+ $context = (settings.context)
59
+ ? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
60
+ : $('body'),
61
+
62
+ isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
63
+
64
+ element = this,
65
+ instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
66
+
67
+ id,
68
+ module
69
+ ;
70
+ module = {
150
71
 
151
- create: {
152
- container: function() {
153
- module.verbose('Creating container');
154
- $context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '')}));
155
- },
156
- id: function() {
157
- id = (Math.random().toString(16) + '000000000').slice(2, 10);
158
- module.verbose('Creating unique id for element', id);
159
- },
160
- toast: function() {
161
- $toastBox = $('<div/>', {class: className.box});
162
- var iconClass = module.get.iconClass();
163
- if (!isToastComponent) {
164
- module.verbose('Creating toast');
165
- $toast = $('<div/>', {role: 'alert'});
166
- var $content = $('<div/>', {class: className.content});
167
- if (iconClass !== '') {
168
- $toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
169
- }
170
-
171
- if (settings.showImage) {
172
- $toast.append($('<img>', {
173
- class: className.image + ' ' + settings.classImage,
174
- src: settings.showImage
175
- }));
176
- }
177
- if (settings.title !== '') {
178
- var titleId = '_' + module.get.id() + 'title';
179
- $toast.attr('aria-labelledby', titleId);
180
- $content.append($('<div/>', {
181
- class: className.title,
182
- id: titleId,
183
- html: module.helpers.escape(settings.title, settings.preserveHTML)
184
- }));
185
- }
186
- var descId = '_' + module.get.id() + 'desc';
187
- $toast.attr('aria-describedby', descId);
188
- $content.append($('<div/>', {
189
- class: className.message,
190
- id: descId,
191
- html: module.helpers.escape(settings.message, settings.preserveHTML)
192
- }));
193
-
194
- $toast
195
- .addClass(settings.class + ' ' + className.toast)
196
- .append($content)
197
- ;
198
- $toast.css('opacity', settings.opacity);
199
- if (settings.closeIcon) {
200
- $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
201
- if($close.hasClass(className.left)) {
202
- $toast.prepend($close);
203
- } else {
204
- $toast.append($close);
205
- }
206
- }
207
- } else {
208
- $toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
209
- $close = $toast.find('> i'+module.helpers.toClass(className.close));
210
- settings.closeIcon = ($close.length > 0);
211
- if (iconClass !== '') {
212
- $toast.find(selector.icon).attr('class',iconClass + ' ' + className.icon);
213
- }
214
- if (settings.showImage) {
215
- $toast.find(selector.image).attr('src',settings.showImage);
216
- }
217
- if (settings.title !== '') {
218
- $toast.find(selector.title).html(module.helpers.escape(settings.title, settings.preserveHTML));
219
- }
220
- if (settings.message !== '') {
221
- $toast.find(selector.message).html(module.helpers.escape(settings.message, settings.preserveHTML));
222
- }
223
- }
224
- if ($toast.hasClass(className.compact)) {
225
- settings.compact = true;
226
- }
227
- if ($toast.hasClass('card')) {
228
- settings.compact = false;
229
- }
230
- $actions = $toast.find('.actions');
231
- if (module.has.configActions()) {
232
- if ($actions.length === 0) {
233
- $actions = $('<div/>', {class: className.actions + ' ' + (settings.classActions || '')}).appendTo($toast);
234
- }
235
- if($toast.hasClass('card') && !$actions.hasClass(className.attached)) {
236
- $actions.addClass(className.extraContent);
237
- if($actions.hasClass(className.vertical)) {
238
- $actions.removeClass(className.vertical);
239
- module.error(error.verticalCard);
240
- }
241
- }
242
- settings.actions.forEach(function (el) {
243
- var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
244
- text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
245
- cls = module.helpers.deQuote(el[fields.class] || ''),
246
- click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
247
- $actions.append($('<button/>', {
248
- html: icon + text,
249
- 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
250
- class: className.button + ' ' + cls,
251
- click: function () {
252
- var button = $(this);
253
- if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
254
- return;
72
+ initialize: function () {
73
+ module.verbose('Initializing element');
74
+ module.create.id();
75
+ if (!module.has.container()) {
76
+ module.create.container();
255
77
  }
256
- module.close();
257
- }
258
- }));
259
- });
260
- }
261
- if ($actions && $actions.hasClass(className.vertical)) {
262
- $toast.addClass(className.vertical);
263
- }
264
- if($actions.length > 0 && !$actions.hasClass(className.attached)) {
265
- if ($actions && (!$actions.hasClass(className.basic) || $actions.hasClass(className.left))) {
266
- $toast.addClass(className.actions);
267
- }
268
- }
269
- if(settings.displayTime === 'auto'){
270
- settings.displayTime = Math.max(settings.minDisplayTime, $toast.text().split(" ").length / settings.wordsPerMinute * 60000);
271
- }
272
- $toastBox.append($toast);
273
-
274
- if($actions.length > 0 && $actions.hasClass(className.attached)) {
275
- $actions.addClass(className.buttons);
276
- $actions.detach();
277
- $toast.addClass(className.attached);
278
- if (!$actions.hasClass(className.vertical)) {
279
- if ($actions.hasClass(className.top)) {
280
- $toastBox.prepend($actions);
281
- $toast.addClass(className.bottom);
282
- } else {
283
- $toastBox.append($actions);
284
- $toast.addClass(className.top);
285
- }
286
- } else {
287
- $toast.wrap(
288
- $('<div/>',{
289
- class:className.vertical + ' ' +
290
- className.attached + ' ' +
291
- (settings.compact ? className.compact : '')
292
- })
293
- );
294
- if($actions.hasClass(className.left)) {
295
- $toast.addClass(className.left).parent().addClass(className.left).prepend($actions);
296
- } else {
297
- $toast.parent().append($actions);
298
- }
299
- }
300
- }
301
- if($module !== $toast) {
302
- $module = $toast;
303
- element = $toast[0];
304
- }
305
- if(settings.displayTime > 0) {
306
- var progressingClass = className.progressing+' '+(settings.pauseOnHover ? className.pausable:'');
307
- if (!!settings.showProgress) {
308
- $progress = $('<div/>', {
309
- class: className.progress + ' ' + (settings.classProgress || settings.class),
310
- 'data-percent': ''
311
- });
312
- if(!settings.classProgress) {
313
- if ($toast.hasClass('toast') && !$toast.hasClass(className.inverted)) {
314
- $progress.addClass(className.inverted);
315
- } else {
316
- $progress.removeClass(className.inverted);
317
- }
318
- }
319
- $progressBar = $('<div/>', {class: 'bar '+(settings.progressUp ? 'up ' : 'down ')+progressingClass});
320
- $progress
321
- .addClass(settings.showProgress)
322
- .append($progressBar);
323
- if ($progress.hasClass(className.top)) {
324
- $toastBox.prepend($progress);
325
- } else {
326
- $toastBox.append($progress);
327
- }
328
- $progressBar.css('animation-duration', settings.displayTime / 1000 + 's');
329
- }
330
- $animationObject = $('<span/>',{class:'wait '+progressingClass});
331
- $animationObject.css('animation-duration', settings.displayTime / 1000 + 's');
332
- $animationObject.appendTo($toast);
333
- }
334
- if (settings.compact) {
335
- $toastBox.addClass(className.compact);
336
- $toast.addClass(className.compact);
337
- if($progress) {
338
- $progress.addClass(className.compact);
339
- }
340
- }
341
- if (settings.newestOnTop) {
342
- $toastBox.prependTo(module.get.container());
343
- }
344
- else {
345
- $toastBox.appendTo(module.get.container());
346
- }
347
- }
348
- },
78
+ if (isToastComponent || settings.message !== '' || settings.title !== '' || module.get.iconClass() !== '' || settings.showImage || module.has.configActions()) {
79
+ if (typeof settings.showProgress !== 'string' || [className.top, className.bottom].indexOf(settings.showProgress) === -1) {
80
+ settings.showProgress = false;
81
+ }
82
+ module.create.toast();
83
+ if (settings.closeOnClick && (settings.closeIcon || $($toast).find(selector.input).length > 0 || module.has.configActions())) {
84
+ settings.closeOnClick = false;
85
+ }
86
+ if (!settings.closeOnClick) {
87
+ $toastBox.addClass(className.unclickable);
88
+ }
89
+ module.bind.events();
90
+ }
91
+ module.instantiate();
92
+ if ($toastBox) {
93
+ module.show();
94
+ }
95
+ },
96
+
97
+ instantiate: function () {
98
+ module.verbose('Storing instance of toast');
99
+ instance = module;
100
+ $module
101
+ .data(moduleNamespace, instance)
102
+ ;
103
+ },
104
+
105
+ destroy: function () {
106
+ if ($toastBox) {
107
+ module.debug('Removing toast', $toastBox);
108
+ module.unbind.events();
109
+ $toastBox.remove();
110
+ $toastBox = undefined;
111
+ $toast = undefined;
112
+ $animationObject = undefined;
113
+ settings.onRemove.call($toastBox, element);
114
+ $progress = undefined;
115
+ $progressBar = undefined;
116
+ $close = undefined;
117
+ }
118
+ $module
119
+ .removeData(moduleNamespace)
120
+ ;
121
+ },
349
122
 
350
- bind: {
351
- events: function() {
352
- module.debug('Binding events to toast');
353
- if(settings.closeIcon) {
354
- $close.on('click' + eventNamespace, module.event.close);
355
- }
356
- $toast.on('click' + eventNamespace, module.event.click);
357
- if($animationObject) {
358
- $animationObject.on('animationend' + eventNamespace, module.event.close);
359
- }
360
- $toastBox
361
- .on('click' + eventNamespace, selector.approve, module.event.approve)
362
- .on('click' + eventNamespace, selector.deny, module.event.deny)
363
- ;
364
- }
365
- },
123
+ show: function (callback) {
124
+ if (settings.onShow.call($toastBox, element) === false) {
125
+ module.debug('onShow callback returned false, cancelling toast animation');
366
126
 
367
- unbind: {
368
- events: function() {
369
- module.debug('Unbinding events to toast');
370
- if(settings.closeIcon) {
371
- $close.off('click' + eventNamespace);
372
- }
373
- $toast.off('click' + eventNamespace);
374
- if($animationObject) {
375
- $animationObject.off('animationend' + eventNamespace);
376
- }
377
- $toastBox
378
- .off('click' + eventNamespace)
379
- ;
380
- }
381
- },
127
+ return;
128
+ }
129
+ callback = callback || function () {};
130
+ module.debug('Showing toast');
131
+ module.animate.show(callback);
132
+ },
382
133
 
383
- animate: {
384
- show: function(callback) {
385
- callback = $.isFunction(callback) ? callback : function(){};
386
- if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
387
- module.set.visible();
388
- $toastBox
389
- .transition({
390
- animation : settings.transition.showMethod + ' in',
391
- queue : false,
392
- debug : settings.debug,
393
- verbose : settings.verbose,
394
- silent : settings.silent,
395
- duration : settings.transition.showDuration,
396
- onComplete : function() {
397
- callback.call($toastBox, element);
398
- settings.onVisible.call($toastBox, element);
399
- }
400
- })
401
- ;
402
- }
403
- },
404
- close: function(callback) {
405
- callback = $.isFunction(callback) ? callback : function(){};
406
- if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
407
- $toastBox
408
- .transition({
409
- animation : settings.transition.hideMethod + ' out',
410
- queue : false,
411
- duration : settings.transition.hideDuration,
412
- debug : settings.debug,
413
- verbose : settings.verbose,
414
- silent : settings.silent,
415
- interval : 50,
416
-
417
- onBeforeHide: function(callback){
418
- callback = $.isFunction(callback)?callback : function(){};
419
- if(settings.transition.closeEasing !== ''){
420
- if($toastBox) {
421
- $toastBox.css('opacity', 0);
422
- $toastBox.wrap('<div/>').parent().hide(settings.transition.closeDuration, settings.transition.closeEasing, function () {
423
- if ($toastBox) {
424
- $toastBox.parent().remove();
425
- callback.call($toastBox);
426
- }
134
+ close: function (callback) {
135
+ if (settings.onHide.call($toastBox, element) === false) {
136
+ module.debug('onHide callback returned false, cancelling toast animation');
137
+
138
+ return;
139
+ }
140
+ callback = callback || function () {};
141
+ module.debug('Closing toast');
142
+ module.remove.visible();
143
+ module.unbind.events();
144
+ module.animate.close(callback);
145
+ },
146
+
147
+ create: {
148
+ container: function () {
149
+ module.verbose('Creating container');
150
+ $context.append($('<div/>', { class: settings.position + ' ' + className.container + ' ' + (settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '') }));
151
+ },
152
+ id: function () {
153
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
154
+ module.verbose('Creating unique id for element', id);
155
+ },
156
+ toast: function () {
157
+ $toastBox = $('<div/>', { class: className.box });
158
+ var iconClass = module.get.iconClass();
159
+ if (!isToastComponent) {
160
+ module.verbose('Creating toast');
161
+ $toast = $('<div/>', { role: 'alert' });
162
+ var $content = $('<div/>', { class: className.content });
163
+ if (iconClass !== '') {
164
+ $toast.append($('<i/>', { class: iconClass + ' ' + className.icon }));
165
+ }
166
+
167
+ if (settings.showImage) {
168
+ $toast.append($('<img>', {
169
+ class: className.image + ' ' + settings.classImage,
170
+ src: settings.showImage,
171
+ }));
172
+ }
173
+ if (settings.title !== '') {
174
+ var titleId = '_' + module.get.id() + 'title';
175
+ $toast.attr('aria-labelledby', titleId);
176
+ $content.append($('<div/>', {
177
+ class: className.title,
178
+ id: titleId,
179
+ html: module.helpers.escape(settings.title, settings.preserveHTML),
180
+ }));
181
+ }
182
+ var descId = '_' + module.get.id() + 'desc';
183
+ $toast.attr('aria-describedby', descId);
184
+ $content.append($('<div/>', {
185
+ class: className.message,
186
+ id: descId,
187
+ html: module.helpers.escape(settings.message, settings.preserveHTML),
188
+ }));
189
+
190
+ $toast
191
+ .addClass(settings.class + ' ' + className.toast)
192
+ .append($content)
193
+ ;
194
+ $toast.css('opacity', String(settings.opacity));
195
+ if (settings.closeIcon) {
196
+ $close = $('<i/>', {
197
+ class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''),
198
+ role: 'button',
199
+ tabindex: 0,
200
+ 'aria-label': settings.text.close,
201
+ });
202
+ if ($close.hasClass(className.left)) {
203
+ $toast.prepend($close);
204
+ } else {
205
+ $toast.append($close);
206
+ }
207
+ }
208
+ } else {
209
+ $toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
210
+ $close = $toast.find('> i' + module.helpers.toClass(className.close));
211
+ settings.closeIcon = ($close.length > 0);
212
+ if (iconClass !== '') {
213
+ $toast.find(selector.icon).attr('class', iconClass + ' ' + className.icon);
214
+ }
215
+ if (settings.showImage) {
216
+ $toast.find(selector.image).attr('src', settings.showImage);
217
+ }
218
+ if (settings.title !== '') {
219
+ $toast.find(selector.title).html(module.helpers.escape(settings.title, settings.preserveHTML));
220
+ }
221
+ if (settings.message !== '') {
222
+ $toast.find(selector.message).html(module.helpers.escape(settings.message, settings.preserveHTML));
223
+ }
224
+ }
225
+ if ($toast.hasClass(className.compact)) {
226
+ settings.compact = true;
227
+ }
228
+ if ($toast.hasClass('card')) {
229
+ settings.compact = false;
230
+ }
231
+ $actions = $toast.find('.actions');
232
+ if (module.has.configActions()) {
233
+ if ($actions.length === 0) {
234
+ $actions = $('<div/>', { class: className.actions + ' ' + (settings.classActions || '') }).appendTo($toast);
235
+ }
236
+ if ($toast.hasClass('card') && !$actions.hasClass(className.attached)) {
237
+ $actions.addClass(className.extraContent);
238
+ if ($actions.hasClass(className.vertical)) {
239
+ $actions.removeClass(className.vertical);
240
+ module.error(error.verticalCard);
241
+ }
242
+ }
243
+ settings.actions.forEach(function (el) {
244
+ var
245
+ icon = el[fields.icon] ? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
246
+ text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
247
+ cls = module.helpers.deQuote(el[fields.class] || ''),
248
+ click = el[fields.click] && isFunction(el[fields.click]) ? el[fields.click] : function () {}
249
+ ;
250
+ $actions.append($('<button/>', {
251
+ html: icon + text,
252
+ 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
253
+ class: className.button + ' ' + cls,
254
+ on: {
255
+ click: function () {
256
+ var $button = $(this);
257
+ if ($button.is(selector.approve) || $button.is(selector.deny) || click.call(element, $module) === false) {
258
+ return;
259
+ }
260
+ module.close();
261
+ },
262
+ },
263
+ }));
427
264
  });
428
- }
429
- } else {
430
- callback.call($toastBox);
431
- }
432
- },
433
- onComplete : function() {
434
- callback.call($toastBox, element);
435
- settings.onHidden.call($toastBox, element);
436
- module.destroy();
437
- }
438
- })
439
- ;
440
- }
441
- else {
442
- module.error(error.noTransition);
443
- }
444
- },
445
- pause: function() {
446
- $animationObject.css('animationPlayState','paused');
447
- if($progressBar) {
448
- $progressBar.css('animationPlayState', 'paused');
449
- }
450
- },
451
- continue: function() {
452
- $animationObject.css('animationPlayState','running');
453
- if($progressBar) {
454
- $progressBar.css('animationPlayState', 'running');
455
- }
456
- }
457
- },
265
+ }
266
+ if ($actions && $actions.hasClass(className.vertical)) {
267
+ $toast.addClass(className.vertical);
268
+ }
269
+ if ($actions.length > 0 && !$actions.hasClass(className.attached)) {
270
+ if ($actions && (!$actions.hasClass(className.basic) || $actions.hasClass(className.left))) {
271
+ $toast.addClass(className.actions);
272
+ }
273
+ }
274
+ if (settings.displayTime === 'auto') {
275
+ settings.displayTime = Math.max(settings.minDisplayTime, $toast.text().split(' ').length / settings.wordsPerMinute * 60000);
276
+ }
277
+ $toastBox.append($toast);
278
+
279
+ if ($actions.length > 0 && $actions.hasClass(className.attached)) {
280
+ $actions.addClass(className.buttons);
281
+ $actions.detach();
282
+ $toast.addClass(className.attached);
283
+ if (!$actions.hasClass(className.vertical)) {
284
+ if ($actions.hasClass(className.top)) {
285
+ $toastBox.prepend($actions);
286
+ $toast.addClass(className.bottom);
287
+ } else {
288
+ $toastBox.append($actions);
289
+ $toast.addClass(className.top);
290
+ }
291
+ } else {
292
+ $toast.wrap(
293
+ $('<div/>', {
294
+ class: className.vertical + ' '
295
+ + className.attached + ' '
296
+ + (settings.compact ? className.compact : ''),
297
+ })
298
+ );
299
+ if ($actions.hasClass(className.left)) {
300
+ $toast.addClass(className.left).parent().addClass(className.left).prepend($actions);
301
+ } else {
302
+ $toast.parent().append($actions);
303
+ }
304
+ }
305
+ }
306
+ if ($module !== $toast) {
307
+ $module = $toast;
308
+ element = $toast[0];
309
+ }
310
+ if (settings.displayTime > 0) {
311
+ var progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
312
+ if (!!settings.showProgress) {
313
+ $progress = $('<div/>', {
314
+ class: className.progress + ' ' + (settings.classProgress || settings.class),
315
+ 'data-percent': '',
316
+ });
317
+ if (!settings.classProgress) {
318
+ if ($toast.hasClass('toast') && !$toast.hasClass(className.inverted)) {
319
+ $progress.addClass(className.inverted);
320
+ } else {
321
+ $progress.removeClass(className.inverted);
322
+ }
323
+ }
324
+ $progressBar = $('<div/>', { class: 'bar ' + (settings.progressUp ? 'up ' : 'down ') + progressingClass });
325
+ $progress
326
+ .addClass(settings.showProgress)
327
+ .append($progressBar)
328
+ ;
329
+ if ($progress.hasClass(className.top)) {
330
+ $toastBox.prepend($progress);
331
+ } else {
332
+ $toastBox.append($progress);
333
+ }
334
+ $progressBar.css('animation-duration', settings.displayTime / 1000 + 's');
335
+ }
336
+ $animationObject = $('<span/>', { class: 'wait ' + progressingClass });
337
+ $animationObject.css('animation-duration', settings.displayTime / 1000 + 's');
338
+ $animationObject.appendTo($toast);
339
+ }
340
+ if (settings.compact) {
341
+ $toastBox.addClass(className.compact);
342
+ $toast.addClass(className.compact);
343
+ if ($progress) {
344
+ $progress.addClass(className.compact);
345
+ }
346
+ }
347
+ if (settings.newestOnTop) {
348
+ $toastBox.prependTo(module.get.container());
349
+ } else {
350
+ $toastBox.appendTo(module.get.container());
351
+ }
352
+ },
353
+ },
354
+
355
+ bind: {
356
+ events: function () {
357
+ module.debug('Binding events to toast');
358
+ if (settings.closeIcon) {
359
+ $close.on('click' + eventNamespace, module.event.close);
360
+ }
361
+ $toast.on('click' + eventNamespace, module.event.click);
362
+ if ($animationObject) {
363
+ $animationObject.on('animationend' + eventNamespace, module.event.close);
364
+ }
365
+ $toastBox
366
+ .on('click' + eventNamespace, selector.approve, module.event.approve)
367
+ .on('click' + eventNamespace, selector.deny, module.event.deny)
368
+ ;
369
+ },
370
+ },
371
+
372
+ unbind: {
373
+ events: function () {
374
+ module.debug('Unbinding events to toast');
375
+ if (settings.closeIcon) {
376
+ $close.off('click' + eventNamespace);
377
+ }
378
+ $toast.off('click' + eventNamespace);
379
+ if ($animationObject) {
380
+ $animationObject.off('animationend' + eventNamespace);
381
+ }
382
+ $toastBox
383
+ .off('click' + eventNamespace)
384
+ ;
385
+ },
386
+ },
387
+
388
+ animate: {
389
+ show: function (callback) {
390
+ callback = isFunction(callback) ? callback : function () {};
391
+ if (settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
392
+ module.set.visible();
393
+ $toastBox
394
+ .transition({
395
+ animation: settings.transition.showMethod + ' in',
396
+ queue: false,
397
+ debug: settings.debug,
398
+ verbose: settings.verbose,
399
+ silent: settings.silent,
400
+ duration: settings.transition.showDuration,
401
+ onComplete: function () {
402
+ callback.call($toastBox, element);
403
+ settings.onVisible.call($toastBox, element);
404
+ },
405
+ })
406
+ ;
407
+ }
408
+ },
409
+ close: function (callback) {
410
+ callback = isFunction(callback) ? callback : function () {};
411
+ if (settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
412
+ $toastBox
413
+ .transition({
414
+ animation: settings.transition.hideMethod + ' out',
415
+ queue: false,
416
+ duration: settings.transition.hideDuration,
417
+ debug: settings.debug,
418
+ verbose: settings.verbose,
419
+ silent: settings.silent,
420
+ interval: 50,
421
+
422
+ onBeforeHide: function (callback) {
423
+ callback = isFunction(callback) ? callback : function () {};
424
+ if (settings.transition.closeEasing !== '') {
425
+ if ($toastBox) {
426
+ $toastBox.css('opacity', '0');
427
+ $toastBox.wrap('<div/>').parent().hide(settings.transition.closeDuration, settings.transition.closeEasing, function () {
428
+ if ($toastBox) {
429
+ $toastBox.parent().remove();
430
+ callback.call($toastBox);
431
+ }
432
+ });
433
+ }
434
+ } else {
435
+ callback.call($toastBox);
436
+ }
437
+ },
438
+ onComplete: function () {
439
+ callback.call($toastBox, element);
440
+ settings.onHidden.call($toastBox, element);
441
+ module.destroy();
442
+ },
443
+ })
444
+ ;
445
+ } else {
446
+ module.error(error.noTransition);
447
+ }
448
+ },
449
+ pause: function () {
450
+ $animationObject.css('animationPlayState', 'paused');
451
+ if ($progressBar) {
452
+ $progressBar.css('animationPlayState', 'paused');
453
+ }
454
+ },
455
+ continue: function () {
456
+ $animationObject.css('animationPlayState', 'running');
457
+ if ($progressBar) {
458
+ $progressBar.css('animationPlayState', 'running');
459
+ }
460
+ },
461
+ },
462
+
463
+ has: {
464
+ container: function () {
465
+ module.verbose('Determining if there is already a container');
466
+
467
+ return module.get.containers().length > 0;
468
+ },
469
+ toast: function () {
470
+ return !!module.get.toast();
471
+ },
472
+ toasts: function () {
473
+ return module.get.toasts().length > 0;
474
+ },
475
+ configActions: function () {
476
+ return Array.isArray(settings.actions) && settings.actions.length > 0;
477
+ },
478
+ },
479
+
480
+ get: {
481
+ id: function () {
482
+ return id;
483
+ },
484
+ containers: function () {
485
+ return $context.children(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not(' + module.helpers.toClass(className.horizontal) + ')') + (settings.context && settings.context !== 'body' ? module.helpers.toClass(className.absolute) : ':not(' + module.helpers.toClass(className.absolute) + ')'));
486
+ },
487
+ container: function () {
488
+ return module.get.containers()[0];
489
+ },
490
+ toastBox: function () {
491
+ return $toastBox || null;
492
+ },
493
+ toast: function () {
494
+ return $toast || null;
495
+ },
496
+ toasts: function () {
497
+ return $(module.get.container()).find(selector.box);
498
+ },
499
+ iconClass: function () {
500
+ return typeof settings.showIcon === 'string' ? settings.showIcon : settings.showIcon && settings.icons[settings.class] ? settings.icons[settings.class] : '';
501
+ },
502
+ remainingTime: function () {
503
+ return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
504
+ },
505
+ },
506
+
507
+ set: {
508
+ visible: function () {
509
+ $toast.addClass(className.visible);
510
+ },
511
+ },
512
+
513
+ remove: {
514
+ visible: function () {
515
+ $toast.removeClass(className.visible);
516
+ },
517
+ },
518
+
519
+ event: {
520
+ close: function () {
521
+ module.close();
522
+ },
523
+ click: function (event) {
524
+ if ($(event.target).closest(selector.clickable).length === 0) {
525
+ if (settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
526
+ module.verbose('Click callback returned false or close denied by setting cancelling close');
527
+
528
+ return;
529
+ }
530
+ module.close();
531
+ }
532
+ },
533
+ approve: function () {
534
+ if (settings.onApprove.call(element, $module) === false) {
535
+ module.verbose('Approve callback returned false cancelling close');
536
+
537
+ return;
538
+ }
539
+ module.close();
540
+ },
541
+ deny: function () {
542
+ if (settings.onDeny.call(element, $module) === false) {
543
+ module.verbose('Deny callback returned false cancelling close');
544
+
545
+ return;
546
+ }
547
+ module.close();
548
+ },
549
+ },
550
+
551
+ helpers: {
552
+ toClass: function (selector) {
553
+ var
554
+ classes = selector.trim().split(/\s+/),
555
+ result = ''
556
+ ;
557
+
558
+ classes.forEach(function (element) {
559
+ result += '.' + element;
560
+ });
561
+
562
+ return result;
563
+ },
564
+ deQuote: function (string) {
565
+ return String(string).replace(/"/g, '');
566
+ },
567
+ escape: function (string, preserveHTML) {
568
+ if (preserveHTML) {
569
+ return string;
570
+ }
571
+ var
572
+ badChars = /[<>"'`]/g,
573
+ shouldEscape = /[&<>"'`]/,
574
+ escape = {
575
+ '<': '&lt;',
576
+ '>': '&gt;',
577
+ '"': '&quot;',
578
+ "'": '&#x27;',
579
+ '`': '&#x60;',
580
+ },
581
+ escapedChar = function (chr) {
582
+ return escape[chr];
583
+ }
584
+ ;
585
+ if (shouldEscape.test(string)) {
586
+ string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, '&amp;');
587
+
588
+ return string.replace(badChars, escapedChar);
589
+ }
590
+
591
+ return string;
592
+ },
593
+ },
594
+
595
+ can: {
596
+ useElement: function (element) {
597
+ if ($.fn[element] !== undefined) {
598
+ return true;
599
+ }
600
+ module.error(error.noElement.replace('{element}', element));
601
+
602
+ return false;
603
+ },
604
+ },
605
+
606
+ setting: function (name, value) {
607
+ module.debug('Changing setting', name, value);
608
+ if ($.isPlainObject(name)) {
609
+ $.extend(true, settings, name);
610
+ } else if (value !== undefined) {
611
+ if ($.isPlainObject(settings[name])) {
612
+ $.extend(true, settings[name], value);
613
+ } else {
614
+ settings[name] = value;
615
+ }
616
+ } else {
617
+ return settings[name];
618
+ }
619
+ },
620
+ internal: function (name, value) {
621
+ if ($.isPlainObject(name)) {
622
+ $.extend(true, module, name);
623
+ } else if (value !== undefined) {
624
+ module[name] = value;
625
+ } else {
626
+ return module[name];
627
+ }
628
+ },
629
+ debug: function () {
630
+ if (!settings.silent && settings.debug) {
631
+ if (settings.performance) {
632
+ module.performance.log(arguments);
633
+ } else {
634
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
635
+ module.debug.apply(console, arguments);
636
+ }
637
+ }
638
+ },
639
+ verbose: function () {
640
+ if (!settings.silent && settings.verbose && settings.debug) {
641
+ if (settings.performance) {
642
+ module.performance.log(arguments);
643
+ } else {
644
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
645
+ module.verbose.apply(console, arguments);
646
+ }
647
+ }
648
+ },
649
+ error: function () {
650
+ if (!settings.silent) {
651
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
652
+ module.error.apply(console, arguments);
653
+ }
654
+ },
655
+ performance: {
656
+ log: function (message) {
657
+ var
658
+ currentTime,
659
+ executionTime,
660
+ previousTime
661
+ ;
662
+ if (settings.performance) {
663
+ currentTime = new Date().getTime();
664
+ previousTime = time || currentTime;
665
+ executionTime = currentTime - previousTime;
666
+ time = currentTime;
667
+ performance.push({
668
+ Name: message[0],
669
+ Arguments: [].slice.call(message, 1) || '',
670
+ Element: element,
671
+ 'Execution Time': executionTime,
672
+ });
673
+ }
674
+ clearTimeout(module.performance.timer);
675
+ module.performance.timer = setTimeout(module.performance.display, 500);
676
+ },
677
+ display: function () {
678
+ var
679
+ title = settings.name + ':',
680
+ totalTime = 0
681
+ ;
682
+ time = false;
683
+ clearTimeout(module.performance.timer);
684
+ $.each(performance, function (index, data) {
685
+ totalTime += data['Execution Time'];
686
+ });
687
+ title += ' ' + totalTime + 'ms';
688
+ if (moduleSelector) {
689
+ title += ' \'' + moduleSelector + '\'';
690
+ }
691
+ if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
692
+ console.groupCollapsed(title);
693
+ if (console.table) {
694
+ console.table(performance);
695
+ } else {
696
+ $.each(performance, function (index, data) {
697
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
698
+ });
699
+ }
700
+ console.groupEnd();
701
+ }
702
+ performance = [];
703
+ },
704
+ },
705
+ invoke: function (query, passedArguments, context) {
706
+ var
707
+ object = instance,
708
+ maxDepth,
709
+ found,
710
+ response
711
+ ;
712
+ passedArguments = passedArguments || queryArguments;
713
+ context = context || element;
714
+ if (typeof query == 'string' && object !== undefined) {
715
+ query = query.split(/[\. ]/);
716
+ maxDepth = query.length - 1;
717
+ $.each(query, function (depth, value) {
718
+ var camelCaseValue = (depth != maxDepth)
719
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
720
+ : query
721
+ ;
722
+ if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
723
+ object = object[camelCaseValue];
724
+ } else if (object[camelCaseValue] !== undefined) {
725
+ found = object[camelCaseValue];
726
+
727
+ return false;
728
+ } else if ($.isPlainObject(object[value]) && (depth != maxDepth)) {
729
+ object = object[value];
730
+ } else if (object[value] !== undefined) {
731
+ found = object[value];
732
+
733
+ return false;
734
+ } else {
735
+ module.error(error.method, query);
736
+
737
+ return false;
738
+ }
739
+ });
740
+ }
741
+ if (isFunction(found)) {
742
+ response = found.apply(context, passedArguments);
743
+ } else if (found !== undefined) {
744
+ response = found;
745
+ }
746
+ if (Array.isArray(returnedValue)) {
747
+ returnedValue.push(response);
748
+ } else if (returnedValue !== undefined) {
749
+ returnedValue = [returnedValue, response];
750
+ } else if (response !== undefined) {
751
+ returnedValue = response;
752
+ }
458
753
 
459
- has: {
460
- container: function() {
461
- module.verbose('Determining if there is already a container');
462
- return module.get.containers().length > 0;
463
- },
464
- toast: function(){
465
- return !!module.get.toast();
466
- },
467
- toasts: function(){
468
- return module.get.toasts().length > 0;
469
- },
470
- configActions: function () {
471
- return Array.isArray(settings.actions) && settings.actions.length > 0;
472
- }
473
- },
754
+ return found;
755
+ },
756
+ };
474
757
 
475
- get: {
476
- id: function() {
477
- return id;
478
- },
479
- containers: function() {
480
- return $context.children(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')') + (settings.context && settings.context !== 'body' ? module.helpers.toClass(className.absolute) : ':not('+module.helpers.toClass(className.absolute)+')'));
481
- },
482
- container: function() {
483
- return module.get.containers()[0];
484
- },
485
- toastBox: function() {
486
- return $toastBox || null;
487
- },
488
- toast: function() {
489
- return $toast || null;
490
- },
491
- toasts: function() {
492
- return $(module.get.container()).find(selector.box);
493
- },
494
- iconClass: function() {
495
- return typeof settings.showIcon === 'string' ? settings.showIcon : settings.showIcon && settings.icons[settings.class] ? settings.icons[settings.class] : '';
496
- },
497
- remainingTime: function() {
498
- return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
499
- }
758
+ if (methodInvoked) {
759
+ if (instance === undefined) {
760
+ module.initialize();
761
+ }
762
+ module.invoke(query);
763
+ } else {
764
+ if (instance !== undefined) {
765
+ instance.invoke('destroy');
766
+ }
767
+ module.initialize();
768
+ returnedValue = $module;
769
+ }
770
+ });
771
+
772
+ return (returnedValue !== undefined)
773
+ ? returnedValue
774
+ : this;
775
+ };
776
+
777
+ $.fn.toast.settings = {
778
+
779
+ name: 'Toast',
780
+ namespace: 'toast',
781
+
782
+ silent: false,
783
+ debug: false,
784
+ verbose: false,
785
+ performance: true,
786
+
787
+ context: 'body',
788
+
789
+ position: 'top right',
790
+ horizontal: false,
791
+ class: 'neutral',
792
+ classProgress: false,
793
+ classActions: false,
794
+ classImage: 'mini',
795
+
796
+ title: '',
797
+ message: '',
798
+ displayTime: 3000, // set to zero to require manually dismissal, otherwise hides on its own
799
+ minDisplayTime: 1000, // minimum displaytime in case displayTime is set to 'auto'
800
+ wordsPerMinute: 120,
801
+ showIcon: false,
802
+ newestOnTop: false,
803
+ showProgress: false,
804
+ pauseOnHover: true,
805
+ progressUp: false, // if true, the bar will start at 0% and increase to 100%
806
+ opacity: 1,
807
+ compact: true,
808
+ closeIcon: false,
809
+ closeOnClick: true,
810
+ cloneModule: true,
811
+ actions: false,
812
+ preserveHTML: true,
813
+ showImage: false,
814
+
815
+ // transition settings
816
+ transition: {
817
+ showMethod: 'scale',
818
+ showDuration: 500,
819
+ hideMethod: 'scale',
820
+ hideDuration: 500,
821
+ closeEasing: 'easeOutCubic', // Set to empty string to stack the closed toast area immediately (old behaviour)
822
+ closeDuration: 500,
500
823
  },
501
824
 
502
- set: {
503
- visible: function() {
504
- $toast.addClass(className.visible);
505
- }
825
+ error: {
826
+ method: 'The method you called is not defined.',
827
+ noElement: 'This module requires ui {element}',
828
+ verticalCard: 'Vertical but not attached actions are not supported for card layout',
506
829
  },
507
830
 
508
- remove: {
509
- visible: function() {
510
- $toast.removeClass(className.visible);
511
- }
831
+ className: {
832
+ container: 'ui toast-container',
833
+ absolute: 'absolute',
834
+ box: 'floating toast-box',
835
+ progress: 'ui attached active progress',
836
+ toast: 'ui toast',
837
+ icon: 'centered icon',
838
+ visible: 'visible',
839
+ content: 'content',
840
+ title: 'ui header',
841
+ message: 'message',
842
+ actions: 'actions',
843
+ extraContent: 'extra content',
844
+ button: 'ui button',
845
+ buttons: 'ui buttons',
846
+ close: 'close icon',
847
+ image: 'ui image',
848
+ vertical: 'vertical',
849
+ horizontal: 'horizontal',
850
+ attached: 'attached',
851
+ inverted: 'inverted',
852
+ compact: 'compact',
853
+ pausable: 'pausable',
854
+ progressing: 'progressing',
855
+ top: 'top',
856
+ bottom: 'bottom',
857
+ left: 'left',
858
+ basic: 'basic',
859
+ unclickable: 'unclickable',
512
860
  },
513
861
 
514
- event: {
515
- close: function(){
516
- module.close();
517
- },
518
- click: function(event) {
519
- if($(event.target).closest(selector.clickable).length === 0) {
520
- if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
521
- module.verbose('Click callback returned false or close denied by setting cancelling close');
522
- return;
523
- }
524
- module.close();
525
- }
526
- },
527
- approve: function() {
528
- if(settings.onApprove.call(element, $module) === false) {
529
- module.verbose('Approve callback returned false cancelling close');
530
- return;
531
- }
532
- module.close();
533
- },
534
- deny: function() {
535
- if(settings.onDeny.call(element, $module) === false) {
536
- module.verbose('Deny callback returned false cancelling close');
537
- return;
538
- }
539
- module.close();
540
- }
862
+ text: {
863
+ close: 'Close',
541
864
  },
542
865
 
543
- helpers: {
544
- toClass: function(selector) {
545
- var
546
- classes = selector.trim().split(/\s+/),
547
- result = ''
548
- ;
549
-
550
- classes.forEach(function (element) {
551
- result += '.' + element;
552
- });
553
-
554
- return result;
555
- },
556
- deQuote: function(string) {
557
- return String(string).replace(/"/g,"");
558
- },
559
- escape: function(string, preserveHTML) {
560
- if (preserveHTML){
561
- return string;
562
- }
563
- var
564
- badChars = /[<>"'`]/g,
565
- shouldEscape = /[&<>"'`]/,
566
- escape = {
567
- "<": "&lt;",
568
- ">": "&gt;",
569
- '"': "&quot;",
570
- "'": "&#x27;",
571
- "`": "&#x60;"
572
- },
573
- escapedChar = function(chr) {
574
- return escape[chr];
575
- }
576
- ;
577
- if(shouldEscape.test(string)) {
578
- string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&amp;");
579
- return string.replace(badChars, escapedChar);
580
- }
581
- return string;
582
- }
866
+ icons: {
867
+ info: 'info',
868
+ success: 'checkmark',
869
+ warning: 'warning',
870
+ error: 'times',
583
871
  },
584
872
 
585
- can: {
586
- useElement: function(element){
587
- if ($.fn[element] !== undefined) {
588
- return true;
589
- }
590
- module.error(error.noElement.replace('{element}',element));
591
- return false;
592
- }
873
+ selector: {
874
+ container: '.ui.toast-container',
875
+ box: '.toast-box',
876
+ toast: '.ui.toast',
877
+ title: '.header',
878
+ message: '.message:not(.ui)',
879
+ image: '> img.image, > .image > img',
880
+ icon: '> i.icon',
881
+ input: 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
882
+ clickable: 'a, details, .ui.accordion',
883
+ approve: '.actions .positive, .actions .approve, .actions .ok',
884
+ deny: '.actions .negative, .actions .deny, .actions .cancel',
593
885
  },
594
886
 
595
- setting: function(name, value) {
596
- module.debug('Changing setting', name, value);
597
- if( $.isPlainObject(name) ) {
598
- $.extend(true, settings, name);
599
- }
600
- else if(value !== undefined) {
601
- if($.isPlainObject(settings[name])) {
602
- $.extend(true, settings[name], value);
603
- }
604
- else {
605
- settings[name] = value;
606
- }
607
- }
608
- else {
609
- return settings[name];
610
- }
611
- },
612
- internal: function(name, value) {
613
- if( $.isPlainObject(name) ) {
614
- $.extend(true, module, name);
615
- }
616
- else if(value !== undefined) {
617
- module[name] = value;
618
- }
619
- else {
620
- return module[name];
621
- }
622
- },
623
- debug: function() {
624
- if(!settings.silent && settings.debug) {
625
- if(settings.performance) {
626
- module.performance.log(arguments);
627
- }
628
- else {
629
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
630
- module.debug.apply(console, arguments);
631
- }
632
- }
633
- },
634
- verbose: function() {
635
- if(!settings.silent && settings.verbose && settings.debug) {
636
- if(settings.performance) {
637
- module.performance.log(arguments);
638
- }
639
- else {
640
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
641
- module.verbose.apply(console, arguments);
642
- }
643
- }
644
- },
645
- error: function() {
646
- if(!settings.silent) {
647
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
648
- module.error.apply(console, arguments);
649
- }
887
+ fields: {
888
+ class: 'class',
889
+ text: 'text',
890
+ icon: 'icon',
891
+ click: 'click',
650
892
  },
651
- performance: {
652
- log: function(message) {
653
- var
654
- currentTime,
655
- executionTime,
656
- previousTime
657
- ;
658
- if(settings.performance) {
659
- currentTime = new Date().getTime();
660
- previousTime = time || currentTime;
661
- executionTime = currentTime - previousTime;
662
- time = currentTime;
663
- performance.push({
664
- 'Name' : message[0],
665
- 'Arguments' : [].slice.call(message, 1) || '',
666
- 'Element' : element,
667
- 'Execution Time' : executionTime
668
- });
669
- }
670
- clearTimeout(module.performance.timer);
671
- module.performance.timer = setTimeout(module.performance.display, 500);
672
- },
673
- display: function() {
893
+
894
+ // callbacks
895
+ onShow: function () {},
896
+ onVisible: function () {},
897
+ onClick: function () {},
898
+ onHide: function () {},
899
+ onHidden: function () {},
900
+ onRemove: function () {},
901
+ onApprove: function () {},
902
+ onDeny: function () {},
903
+ };
904
+
905
+ $.extend($.easing, {
906
+ easeOutBounce: function (x) {
674
907
  var
675
- title = settings.name + ':',
676
- totalTime = 0
908
+ n1 = 7.5625,
909
+ d1 = 2.75
677
910
  ;
678
- time = false;
679
- clearTimeout(module.performance.timer);
680
- $.each(performance, function(index, data) {
681
- totalTime += data['Execution Time'];
682
- });
683
- title += ' ' + totalTime + 'ms';
684
- if(moduleSelector) {
685
- title += ' \'' + moduleSelector + '\'';
686
- }
687
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
688
- console.groupCollapsed(title);
689
- if(console.table) {
690
- console.table(performance);
691
- }
692
- else {
693
- $.each(performance, function(index, data) {
694
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
695
- });
696
- }
697
- console.groupEnd();
911
+ if (x < 1 / d1) {
912
+ return n1 * x * x;
913
+ } else if (x < 2 / d1) {
914
+ return n1 * (x -= 1.5 / d1) * x + 0.75;
915
+ } else if (x < 2.5 / d1) {
916
+ return n1 * (x -= 2.25 / d1) * x + 0.9375;
917
+ } else {
918
+ return n1 * (x -= 2.625 / d1) * x + 0.984375;
698
919
  }
699
- performance = [];
700
- }
701
920
  },
702
- invoke: function(query, passedArguments, context) {
703
- var
704
- object = instance,
705
- maxDepth,
706
- found,
707
- response
708
- ;
709
- passedArguments = passedArguments || queryArguments;
710
- context = context || element;
711
- if(typeof query == 'string' && object !== undefined) {
712
- query = query.split(/[\. ]/);
713
- maxDepth = query.length - 1;
714
- $.each(query, function(depth, value) {
715
- var camelCaseValue = (depth != maxDepth)
716
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
717
- : query
718
- ;
719
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
720
- object = object[camelCaseValue];
721
- }
722
- else if( object[camelCaseValue] !== undefined ) {
723
- found = object[camelCaseValue];
724
- return false;
725
- }
726
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
727
- object = object[value];
728
- }
729
- else if( object[value] !== undefined ) {
730
- found = object[value];
731
- return false;
732
- }
733
- else {
734
- module.error(error.method, query);
735
- return false;
736
- }
737
- });
738
- }
739
- if ( $.isFunction( found ) ) {
740
- response = found.apply(context, passedArguments);
741
- }
742
- else if(found !== undefined) {
743
- response = found;
744
- }
745
- if(Array.isArray(returnedValue)) {
746
- returnedValue.push(response);
747
- }
748
- else if(returnedValue !== undefined) {
749
- returnedValue = [returnedValue, response];
750
- }
751
- else if(response !== undefined) {
752
- returnedValue = response;
753
- }
754
- return found;
755
- }
756
- };
757
-
758
- if(methodInvoked) {
759
- if(instance === undefined) {
760
- module.initialize();
761
- }
762
- module.invoke(query);
763
- }
764
- else {
765
- if(instance !== undefined) {
766
- instance.invoke('destroy');
767
- }
768
- module.initialize();
769
- returnedValue = $module;
770
- }
771
- })
772
- ;
773
-
774
- return (returnedValue !== undefined)
775
- ? returnedValue
776
- : this
777
- ;
778
- };
779
-
780
- $.fn.toast.settings = {
781
-
782
- name : 'Toast',
783
- namespace : 'toast',
784
-
785
- silent : false,
786
- debug : false,
787
- verbose : false,
788
- performance : true,
789
-
790
- context : 'body',
791
-
792
- position : 'top right',
793
- horizontal : false,
794
- class : 'neutral',
795
- classProgress : false,
796
- classActions : false,
797
- classImage : 'mini',
798
-
799
- title : '',
800
- message : '',
801
- displayTime : 3000, // set to zero to require manually dismissal, otherwise hides on its own
802
- minDisplayTime : 1000, // minimum displaytime in case displayTime is set to 'auto'
803
- wordsPerMinute : 120,
804
- showIcon : false,
805
- newestOnTop : false,
806
- showProgress : false,
807
- pauseOnHover : true,
808
- progressUp : false, //if true, the bar will start at 0% and increase to 100%
809
- opacity : 1,
810
- compact : true,
811
- closeIcon : false,
812
- closeOnClick : true,
813
- cloneModule : true,
814
- actions : false,
815
- preserveHTML : true,
816
- showImage : false,
817
-
818
- // transition settings
819
- transition : {
820
- showMethod : 'scale',
821
- showDuration : 500,
822
- hideMethod : 'scale',
823
- hideDuration : 500,
824
- closeEasing : 'easeOutCubic', //Set to empty string to stack the closed toast area immediately (old behaviour)
825
- closeDuration: 500
826
- },
827
-
828
- error: {
829
- method : 'The method you called is not defined.',
830
- noElement : 'This module requires ui {element}',
831
- verticalCard : 'Vertical but not attached actions are not supported for card layout'
832
- },
833
-
834
- className : {
835
- container : 'ui toast-container',
836
- absolute : 'absolute',
837
- box : 'floating toast-box',
838
- progress : 'ui attached active progress',
839
- toast : 'ui toast',
840
- icon : 'centered icon',
841
- visible : 'visible',
842
- content : 'content',
843
- title : 'ui header',
844
- message : 'message',
845
- actions : 'actions',
846
- extraContent : 'extra content',
847
- button : 'ui button',
848
- buttons : 'ui buttons',
849
- close : 'close icon',
850
- image : 'ui image',
851
- vertical : 'vertical',
852
- horizontal : 'horizontal',
853
- attached : 'attached',
854
- inverted : 'inverted',
855
- compact : 'compact',
856
- pausable : 'pausable',
857
- progressing : 'progressing',
858
- top : 'top',
859
- bottom : 'bottom',
860
- left : 'left',
861
- basic : 'basic',
862
- unclickable : 'unclickable'
863
- },
864
-
865
- text: {
866
- close : 'Close'
867
- },
868
-
869
- icons : {
870
- info : 'info',
871
- success : 'checkmark',
872
- warning : 'warning',
873
- error : 'times'
874
- },
875
-
876
- selector : {
877
- container : '.ui.toast-container',
878
- box : '.toast-box',
879
- toast : '.ui.toast',
880
- title : '.header',
881
- message : '.message:not(.ui)',
882
- image : '> img.image, > .image > img',
883
- icon : '> i.icon',
884
- input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
885
- clickable : 'a, details, .ui.accordion',
886
- approve : '.actions .positive, .actions .approve, .actions .ok',
887
- deny : '.actions .negative, .actions .deny, .actions .cancel'
888
- },
889
-
890
- fields : {
891
- class : 'class',
892
- text : 'text',
893
- icon : 'icon',
894
- click : 'click'
895
- },
896
-
897
- // callbacks
898
- onShow : function(){},
899
- onVisible : function(){},
900
- onClick : function(){},
901
- onHide : function(){},
902
- onHidden : function(){},
903
- onRemove : function(){},
904
- onApprove : function(){},
905
- onDeny : function(){}
906
- };
907
-
908
- $.extend( $.easing, {
909
- easeOutBounce: function (x, t, b, c, d) {
910
- if ((t/=d) < (1/2.75)) {
911
- return c*(7.5625*t*t) + b;
912
- } else if (t < (2/2.75)) {
913
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
914
- } else if (t < (2.5/2.75)) {
915
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
916
- } else {
917
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
918
- }
919
- },
920
- easeOutCubic: function (t) {
921
- return (--t)*t*t+1;
922
- }
923
- });
924
-
925
-
926
- })( jQuery, window, document );
921
+ easeOutCubic: function (t) {
922
+ return (--t) * t * t + 1;
923
+ },
924
+ });
925
+ })(jQuery, window, document);