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,551 +8,535 @@
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.rating = 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.rating.settings, parameters)
44
- : $.extend({}, $.fn.rating.settings),
45
-
46
- namespace = settings.namespace,
47
- className = settings.className,
48
- metadata = settings.metadata,
49
- selector = settings.selector,
50
- cssVars = settings.cssVars,
51
-
52
- eventNamespace = '.' + namespace,
53
- moduleNamespace = 'module-' + namespace,
54
-
55
- element = this,
56
- instance = $(this).data(moduleNamespace),
57
-
58
- $module = $(this),
59
- $icon = $module.find(selector.icon),
60
-
61
- initialLoad,
62
- module
63
- ;
64
-
65
- module = {
66
-
67
- initialize: function() {
68
- module.verbose('Initializing rating module', settings);
69
-
70
- if($icon.length === 0) {
71
- module.setup.layout();
72
- }
73
-
74
- if(settings.interactive && !module.is.disabled()) {
75
- module.enable();
76
- }
77
- else {
78
- module.disable();
79
- }
80
- module.set.initialLoad();
81
- module.set.rating( module.get.initialRating() );
82
- module.remove.initialLoad();
83
- module.instantiate();
84
- },
11
+ (function ($, window, document) {
12
+ 'use strict';
85
13
 
86
- instantiate: function() {
87
- module.verbose('Instantiating module', settings);
88
- instance = module;
89
- $module
90
- .data(moduleNamespace, module)
91
- ;
92
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
93
17
 
94
- destroy: function() {
95
- module.verbose('Destroying previous instance', instance);
96
- module.remove.events();
97
- $module
98
- .removeData(moduleNamespace)
99
- ;
100
- },
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
101
21
 
102
- refresh: function() {
103
- $icon = $module.find(selector.icon);
104
- },
22
+ $.fn.rating = function (parameters) {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
105
26
 
106
- setup: {
107
- layout: function() {
108
- var
109
- maxRating = module.get.maxRating(),
110
- icon = module.get.icon(),
111
- html = $.fn.rating.settings.templates.icon(maxRating, icon)
112
- ;
113
- module.debug('Generating icon html dynamically');
114
- $module
115
- .html(html)
116
- ;
117
- module.refresh();
118
- }
119
- },
27
+ time = Date.now(),
28
+ performance = [],
120
29
 
121
- event: {
122
- mouseenter: function() {
30
+ query = arguments[0],
31
+ methodInvoked = typeof query === 'string',
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ returnedValue
34
+ ;
35
+ $allModules.each(function () {
123
36
  var
124
- $activeIcon = $(this)
125
- ;
126
- $activeIcon
127
- .nextAll()
128
- .removeClass(className.selected)
129
- ;
130
- $module
131
- .addClass(className.selected)
132
- ;
133
- $activeIcon
134
- .addClass(className.selected)
135
- .prevAll()
136
- .addClass(className.selected)
137
- ;
138
- },
139
- mouseleave: function() {
140
- $module
141
- .removeClass(className.selected)
142
- ;
143
- $icon
144
- .removeClass(className.selected)
145
- ;
146
- },
147
- click: function() {
148
- var
149
- $activeIcon = $(this),
150
- currentRating = module.get.rating(),
151
- rating = $icon.index($activeIcon) + 1,
152
- canClear = (settings.clearable == 'auto')
153
- ? ($icon.length === 1)
154
- : settings.clearable
37
+ settings = $.isPlainObject(parameters)
38
+ ? $.extend(true, {}, $.fn.rating.settings, parameters)
39
+ : $.extend({}, $.fn.rating.settings),
40
+
41
+ namespace = settings.namespace,
42
+ className = settings.className,
43
+ error = settings.error,
44
+ metadata = settings.metadata,
45
+ selector = settings.selector,
46
+ cssVars = settings.cssVars,
47
+
48
+ eventNamespace = '.' + namespace,
49
+ moduleNamespace = 'module-' + namespace,
50
+
51
+ element = this,
52
+ instance = $(this).data(moduleNamespace),
53
+
54
+ $module = $(this),
55
+ $icon = $module.find(selector.icon),
56
+
57
+ initialLoad,
58
+ module
155
59
  ;
156
- if(canClear && currentRating == rating) {
157
- module.clearRating();
158
- }
159
- else {
160
- module.set.rating( rating );
60
+
61
+ module = {
62
+
63
+ initialize: function () {
64
+ module.verbose('Initializing rating module', settings);
65
+
66
+ if ($icon.length === 0) {
67
+ module.setup.layout();
68
+ }
69
+
70
+ if (settings.interactive && !module.is.disabled()) {
71
+ module.enable();
72
+ } else {
73
+ module.disable();
74
+ }
75
+ module.set.initialLoad();
76
+ module.set.rating(module.get.initialRating());
77
+ module.remove.initialLoad();
78
+ module.instantiate();
79
+ },
80
+
81
+ instantiate: function () {
82
+ module.verbose('Instantiating module', settings);
83
+ instance = module;
84
+ $module
85
+ .data(moduleNamespace, module)
86
+ ;
87
+ },
88
+
89
+ destroy: function () {
90
+ module.verbose('Destroying previous instance', instance);
91
+ module.remove.events();
92
+ $module
93
+ .removeData(moduleNamespace)
94
+ ;
95
+ },
96
+
97
+ refresh: function () {
98
+ $icon = $module.find(selector.icon);
99
+ },
100
+
101
+ setup: {
102
+ layout: function () {
103
+ var
104
+ maxRating = module.get.maxRating(),
105
+ icon = module.get.icon(),
106
+ html = $.fn.rating.settings.templates.icon(maxRating, icon)
107
+ ;
108
+ module.debug('Generating icon html dynamically');
109
+ $module
110
+ .html(html)
111
+ ;
112
+ module.refresh();
113
+ },
114
+ },
115
+
116
+ event: {
117
+ mouseenter: function () {
118
+ var
119
+ $activeIcon = $(this)
120
+ ;
121
+ $activeIcon
122
+ .nextAll()
123
+ .removeClass(className.selected)
124
+ ;
125
+ $module
126
+ .addClass(className.selected)
127
+ ;
128
+ $activeIcon
129
+ .addClass(className.selected)
130
+ .prevAll()
131
+ .addClass(className.selected)
132
+ ;
133
+ },
134
+ mouseleave: function () {
135
+ $module
136
+ .removeClass(className.selected)
137
+ ;
138
+ $icon
139
+ .removeClass(className.selected)
140
+ ;
141
+ },
142
+ click: function () {
143
+ var
144
+ $activeIcon = $(this),
145
+ currentRating = module.get.rating(),
146
+ rating = $icon.index($activeIcon) + 1,
147
+ canClear = settings.clearable === 'auto'
148
+ ? $icon.length === 1
149
+ : settings.clearable
150
+ ;
151
+ if (canClear && currentRating === rating) {
152
+ module.clearRating();
153
+ } else {
154
+ module.set.rating(rating);
155
+ }
156
+ },
157
+ },
158
+
159
+ clearRating: function () {
160
+ module.debug('Clearing current rating');
161
+ module.set.rating(0);
162
+ },
163
+
164
+ bind: {
165
+ events: function () {
166
+ module.verbose('Binding events');
167
+ $module
168
+ .on('mouseenter' + eventNamespace, selector.icon, module.event.mouseenter)
169
+ .on('mouseleave' + eventNamespace, selector.icon, module.event.mouseleave)
170
+ .on('click' + eventNamespace, selector.icon, module.event.click)
171
+ ;
172
+ },
173
+ },
174
+
175
+ remove: {
176
+ events: function () {
177
+ module.verbose('Removing events');
178
+ $module
179
+ .off(eventNamespace)
180
+ ;
181
+ },
182
+ initialLoad: function () {
183
+ initialLoad = false;
184
+ },
185
+ },
186
+
187
+ enable: function () {
188
+ module.debug('Setting rating to interactive mode');
189
+ module.bind.events();
190
+ $module
191
+ .removeClass(className.disabled)
192
+ ;
193
+ },
194
+
195
+ disable: function () {
196
+ module.debug('Setting rating to read-only mode');
197
+ module.remove.events();
198
+ $module
199
+ .addClass(className.disabled)
200
+ ;
201
+ },
202
+
203
+ is: {
204
+ initialLoad: function () {
205
+ return initialLoad;
206
+ },
207
+ disabled: function () {
208
+ return $module.hasClass(className.disabled);
209
+ },
210
+ },
211
+
212
+ get: {
213
+ icon: function () {
214
+ var icon = $module.data(metadata.icon);
215
+ if (icon) {
216
+ $module.removeData(metadata.icon);
217
+ }
218
+
219
+ return icon || settings.icon;
220
+ },
221
+ initialRating: function () {
222
+ if ($module.data(metadata.rating) !== undefined) {
223
+ $module.removeData(metadata.rating);
224
+
225
+ return $module.data(metadata.rating);
226
+ }
227
+
228
+ return settings.initialRating;
229
+ },
230
+ maxRating: function () {
231
+ if ($module.data(metadata.maxRating) !== undefined) {
232
+ $module.removeData(metadata.maxRating);
233
+
234
+ return $module.data(metadata.maxRating);
235
+ }
236
+
237
+ return settings.maxRating;
238
+ },
239
+ rating: function () {
240
+ var
241
+ currentRating = $icon.filter('.' + className.active).length
242
+ ;
243
+ module.verbose('Current rating retrieved', currentRating);
244
+
245
+ return currentRating;
246
+ },
247
+ },
248
+
249
+ set: {
250
+ rating: function (rating) {
251
+ var
252
+ ratingIndex = Math.floor(
253
+ rating - 1 >= 0
254
+ ? rating - 1
255
+ : 0
256
+ ),
257
+ $activeIcon = $icon.eq(ratingIndex),
258
+ $partialActiveIcon = rating <= 1
259
+ ? $activeIcon
260
+ : $activeIcon.next(),
261
+ filledPercentage = (rating % 1) * 100
262
+ ;
263
+ $module
264
+ .removeClass(className.selected)
265
+ ;
266
+ $icon
267
+ .removeClass(className.selected)
268
+ .removeClass(className.active)
269
+ .removeClass(className.partiallyActive)
270
+ ;
271
+ if (rating > 0) {
272
+ module.verbose('Setting current rating to', rating);
273
+ $activeIcon
274
+ .prevAll()
275
+ .addBack()
276
+ .addClass(className.active)
277
+ ;
278
+ if ($activeIcon.next() && rating % 1 !== 0) {
279
+ $partialActiveIcon
280
+ .addClass(className.partiallyActive)
281
+ .addClass(className.active)
282
+ ;
283
+ $partialActiveIcon
284
+ .css(cssVars.filledCustomPropName, filledPercentage + '%')
285
+ ;
286
+ if ($partialActiveIcon.css('backgroundColor') === 'transparent') {
287
+ $partialActiveIcon
288
+ .removeClass(className.partiallyActive)
289
+ .removeClass(className.active)
290
+ ;
291
+ }
292
+ }
293
+ }
294
+ if (!module.is.initialLoad()) {
295
+ settings.onRate.call(element, rating);
296
+ }
297
+ },
298
+ initialLoad: function () {
299
+ initialLoad = true;
300
+ },
301
+ },
302
+
303
+ setting: function (name, value) {
304
+ module.debug('Changing setting', name, value);
305
+ if ($.isPlainObject(name)) {
306
+ $.extend(true, settings, name);
307
+ } else if (value !== undefined) {
308
+ if ($.isPlainObject(settings[name])) {
309
+ $.extend(true, settings[name], value);
310
+ } else {
311
+ settings[name] = value;
312
+ }
313
+ } else {
314
+ return settings[name];
315
+ }
316
+ },
317
+ internal: function (name, value) {
318
+ if ($.isPlainObject(name)) {
319
+ $.extend(true, module, name);
320
+ } else if (value !== undefined) {
321
+ module[name] = value;
322
+ } else {
323
+ return module[name];
324
+ }
325
+ },
326
+ debug: function () {
327
+ if (!settings.silent && settings.debug) {
328
+ if (settings.performance) {
329
+ module.performance.log(arguments);
330
+ } else {
331
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
332
+ module.debug.apply(console, arguments);
333
+ }
334
+ }
335
+ },
336
+ verbose: function () {
337
+ if (!settings.silent && settings.verbose && settings.debug) {
338
+ if (settings.performance) {
339
+ module.performance.log(arguments);
340
+ } else {
341
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
342
+ module.verbose.apply(console, arguments);
343
+ }
344
+ }
345
+ },
346
+ error: function () {
347
+ if (!settings.silent) {
348
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
349
+ module.error.apply(console, arguments);
350
+ }
351
+ },
352
+ performance: {
353
+ log: function (message) {
354
+ var
355
+ currentTime,
356
+ executionTime,
357
+ previousTime
358
+ ;
359
+ if (settings.performance) {
360
+ currentTime = Date.now();
361
+ previousTime = time || currentTime;
362
+ executionTime = currentTime - previousTime;
363
+ time = currentTime;
364
+ performance.push({
365
+ Name: message[0],
366
+ Arguments: [].slice.call(message, 1) || '',
367
+ Element: element,
368
+ 'Execution Time': executionTime,
369
+ });
370
+ }
371
+ clearTimeout(module.performance.timer);
372
+ module.performance.timer = setTimeout(module.performance.display, 500);
373
+ },
374
+ display: function () {
375
+ var
376
+ title = settings.name + ':',
377
+ totalTime = 0
378
+ ;
379
+ time = false;
380
+ clearTimeout(module.performance.timer);
381
+ $.each(performance, function (index, data) {
382
+ totalTime += data['Execution Time'];
383
+ });
384
+ title += ' ' + totalTime + 'ms';
385
+ if (moduleSelector) {
386
+ title += ' \'' + moduleSelector + '\'';
387
+ }
388
+ if ($allModules.length > 1) {
389
+ title += ' (' + $allModules.length + ')';
390
+ }
391
+ if (performance.length > 0) {
392
+ console.groupCollapsed(title);
393
+ if (console.table) {
394
+ console.table(performance);
395
+ } else {
396
+ $.each(performance, function (index, data) {
397
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
398
+ });
399
+ }
400
+ console.groupEnd();
401
+ }
402
+ performance = [];
403
+ },
404
+ },
405
+ invoke: function (query, passedArguments, context) {
406
+ var
407
+ object = instance,
408
+ maxDepth,
409
+ found,
410
+ response
411
+ ;
412
+ passedArguments = passedArguments || queryArguments;
413
+ context = context || element;
414
+ if (typeof query === 'string' && object !== undefined) {
415
+ query = query.split(/[ .]/);
416
+ maxDepth = query.length - 1;
417
+ $.each(query, function (depth, value) {
418
+ var camelCaseValue = depth !== maxDepth
419
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
420
+ : query
421
+ ;
422
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
423
+ object = object[camelCaseValue];
424
+ } else if (object[camelCaseValue] !== undefined) {
425
+ found = object[camelCaseValue];
426
+
427
+ return false;
428
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
429
+ object = object[value];
430
+ } else if (object[value] !== undefined) {
431
+ found = object[value];
432
+
433
+ return false;
434
+ } else {
435
+ module.error(error.method, query);
436
+
437
+ return false;
438
+ }
439
+ });
440
+ }
441
+ if (isFunction(found)) {
442
+ response = found.apply(context, passedArguments);
443
+ } else if (found !== undefined) {
444
+ response = found;
445
+ }
446
+ if (Array.isArray(returnedValue)) {
447
+ returnedValue.push(response);
448
+ } else if (returnedValue !== undefined) {
449
+ returnedValue = [returnedValue, response];
450
+ } else if (response !== undefined) {
451
+ returnedValue = response;
452
+ }
453
+
454
+ return found;
455
+ },
456
+ };
457
+ if (methodInvoked) {
458
+ if (instance === undefined) {
459
+ module.initialize();
460
+ }
461
+ module.invoke(query);
462
+ } else {
463
+ if (instance !== undefined) {
464
+ instance.invoke('destroy');
465
+ }
466
+ module.initialize();
161
467
  }
162
- }
163
- },
468
+ });
164
469
 
165
- clearRating: function() {
166
- module.debug('Clearing current rating');
167
- module.set.rating(0);
168
- },
470
+ return returnedValue !== undefined
471
+ ? returnedValue
472
+ : this;
473
+ };
169
474
 
170
- bind: {
171
- events: function() {
172
- module.verbose('Binding events');
173
- $module
174
- .on('mouseenter' + eventNamespace, selector.icon, module.event.mouseenter)
175
- .on('mouseleave' + eventNamespace, selector.icon, module.event.mouseleave)
176
- .on('click' + eventNamespace, selector.icon, module.event.click)
177
- ;
178
- }
179
- },
475
+ $.fn.rating.settings = {
180
476
 
181
- remove: {
182
- events: function() {
183
- module.verbose('Removing events');
184
- $module
185
- .off(eventNamespace)
186
- ;
187
- },
188
- initialLoad: function() {
189
- initialLoad = false;
190
- }
477
+ name: 'Rating',
478
+ namespace: 'rating',
479
+
480
+ icon: 'star',
481
+
482
+ silent: false,
483
+ debug: false,
484
+ verbose: false,
485
+ performance: true,
486
+
487
+ initialRating: 0,
488
+ interactive: true,
489
+ maxRating: 4,
490
+ clearable: 'auto',
491
+
492
+ fireOnInit: false,
493
+
494
+ onRate: function (rating) {},
495
+
496
+ error: {
497
+ method: 'The method you called is not defined',
191
498
  },
192
499
 
193
- enable: function() {
194
- module.debug('Setting rating to interactive mode');
195
- module.bind.events();
196
- $module
197
- .removeClass(className.disabled)
198
- ;
500
+ metadata: {
501
+ rating: 'rating',
502
+ maxRating: 'maxRating',
503
+ icon: 'icon',
199
504
  },
200
505
 
201
- disable: function() {
202
- module.debug('Setting rating to read-only mode');
203
- module.remove.events();
204
- $module
205
- .addClass(className.disabled)
206
- ;
506
+ className: {
507
+ active: 'active',
508
+ disabled: 'disabled',
509
+ selected: 'selected',
510
+ loading: 'loading',
511
+ partiallyActive: 'partial',
207
512
  },
208
513
 
209
- is: {
210
- initialLoad: function() {
211
- return initialLoad;
212
- },
213
- disabled: function() {
214
- return $module.hasClass(className.disabled);
215
- }
514
+ cssVars: {
515
+ filledCustomPropName: '--full',
216
516
  },
217
517
 
218
- get: {
219
- icon: function(){
220
- var icon = $module.data(metadata.icon);
221
- if (icon) {
222
- $module.removeData(metadata.icon);
223
- }
224
- return icon || settings.icon;
225
- },
226
- initialRating: function() {
227
- if($module.data(metadata.rating) !== undefined) {
228
- $module.removeData(metadata.rating);
229
- return $module.data(metadata.rating);
230
- }
231
- return settings.initialRating;
232
- },
233
- maxRating: function() {
234
- if($module.data(metadata.maxRating) !== undefined) {
235
- $module.removeData(metadata.maxRating);
236
- return $module.data(metadata.maxRating);
237
- }
238
- return settings.maxRating;
239
- },
240
- rating: function() {
241
- var
242
- currentRating = $icon.filter('.' + className.active).length
243
- ;
244
- module.verbose('Current rating retrieved', currentRating);
245
- return currentRating;
246
- }
518
+ selector: {
519
+ icon: '.icon',
247
520
  },
248
521
 
249
- set: {
250
- rating: function(rating) {
251
- var
252
- ratingIndex = Math.floor(
253
- (rating - 1 >= 0)
254
- ? (rating - 1)
255
- : 0
256
- ),
257
- $activeIcon = $icon.eq(ratingIndex),
258
- $partialActiveIcon = rating <= 1
259
- ? $activeIcon
260
- : $activeIcon.next()
261
- ,
262
- filledPercentage = (rating % 1) * 100
263
- ;
264
- $module
265
- .removeClass(className.selected)
266
- ;
267
- $icon
268
- .removeClass(className.selected)
269
- .removeClass(className.active)
270
- .removeClass(className.partiallyActive)
271
- ;
272
- if(rating > 0) {
273
- module.verbose('Setting current rating to', rating);
274
- $activeIcon
275
- .prevAll()
276
- .addBack()
277
- .addClass(className.active)
278
- ;
279
- if($activeIcon.next() && rating % 1 !== 0) {
280
- $partialActiveIcon
281
- .addClass(className.partiallyActive)
282
- .addClass(className.active)
283
- ;
284
- $partialActiveIcon
285
- .css(cssVars.filledCustomPropName, filledPercentage + '%')
522
+ templates: {
523
+ deQuote: function (string, encode) {
524
+ return String(string).replace(/"/g, encode ? '&quot;' : '');
525
+ },
526
+ icon: function (maxRating, iconClass) {
527
+ var
528
+ icon = 1,
529
+ html = '',
530
+ deQuote = $.fn.rating.settings.templates.deQuote
286
531
  ;
287
- if($partialActiveIcon.css('backgroundColor') === 'transparent') {
288
- $partialActiveIcon
289
- .removeClass(className.partiallyActive)
290
- .removeClass(className.active)
291
- ;
532
+ while (icon <= maxRating) {
533
+ html += '<i class="' + deQuote(iconClass) + ' icon"></i>';
534
+ icon++;
292
535
  }
293
- }
294
- }
295
- if(!module.is.initialLoad()) {
296
- settings.onRate.call(element, rating);
297
- }
298
- },
299
- initialLoad: function() {
300
- initialLoad = true;
301
- }
302
- },
303
536
 
304
- setting: function(name, value) {
305
- module.debug('Changing setting', name, value);
306
- if( $.isPlainObject(name) ) {
307
- $.extend(true, settings, name);
308
- }
309
- else if(value !== undefined) {
310
- if($.isPlainObject(settings[name])) {
311
- $.extend(true, settings[name], value);
312
- }
313
- else {
314
- settings[name] = value;
315
- }
316
- }
317
- else {
318
- return settings[name];
319
- }
537
+ return html;
538
+ },
320
539
  },
321
- internal: function(name, value) {
322
- if( $.isPlainObject(name) ) {
323
- $.extend(true, module, name);
324
- }
325
- else if(value !== undefined) {
326
- module[name] = value;
327
- }
328
- else {
329
- return module[name];
330
- }
331
- },
332
- debug: function() {
333
- if(!settings.silent && settings.debug) {
334
- if(settings.performance) {
335
- module.performance.log(arguments);
336
- }
337
- else {
338
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
339
- module.debug.apply(console, arguments);
340
- }
341
- }
342
- },
343
- verbose: function() {
344
- if(!settings.silent && settings.verbose && settings.debug) {
345
- if(settings.performance) {
346
- module.performance.log(arguments);
347
- }
348
- else {
349
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
350
- module.verbose.apply(console, arguments);
351
- }
352
- }
353
- },
354
- error: function() {
355
- if(!settings.silent) {
356
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
357
- module.error.apply(console, arguments);
358
- }
359
- },
360
- performance: {
361
- log: function(message) {
362
- var
363
- currentTime,
364
- executionTime,
365
- previousTime
366
- ;
367
- if(settings.performance) {
368
- currentTime = new Date().getTime();
369
- previousTime = time || currentTime;
370
- executionTime = currentTime - previousTime;
371
- time = currentTime;
372
- performance.push({
373
- 'Name' : message[0],
374
- 'Arguments' : [].slice.call(message, 1) || '',
375
- 'Element' : element,
376
- 'Execution Time' : executionTime
377
- });
378
- }
379
- clearTimeout(module.performance.timer);
380
- module.performance.timer = setTimeout(module.performance.display, 500);
381
- },
382
- display: function() {
383
- var
384
- title = settings.name + ':',
385
- totalTime = 0
386
- ;
387
- time = false;
388
- clearTimeout(module.performance.timer);
389
- $.each(performance, function(index, data) {
390
- totalTime += data['Execution Time'];
391
- });
392
- title += ' ' + totalTime + 'ms';
393
- if(moduleSelector) {
394
- title += ' \'' + moduleSelector + '\'';
395
- }
396
- if($allModules.length > 1) {
397
- title += ' ' + '(' + $allModules.length + ')';
398
- }
399
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
400
- console.groupCollapsed(title);
401
- if(console.table) {
402
- console.table(performance);
403
- }
404
- else {
405
- $.each(performance, function(index, data) {
406
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
407
- });
408
- }
409
- console.groupEnd();
410
- }
411
- performance = [];
412
- }
413
- },
414
- invoke: function(query, passedArguments, context) {
415
- var
416
- object = instance,
417
- maxDepth,
418
- found,
419
- response
420
- ;
421
- passedArguments = passedArguments || queryArguments;
422
- context = context || element;
423
- if(typeof query == 'string' && object !== undefined) {
424
- query = query.split(/[\. ]/);
425
- maxDepth = query.length - 1;
426
- $.each(query, function(depth, value) {
427
- var camelCaseValue = (depth != maxDepth)
428
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
429
- : query
430
- ;
431
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
432
- object = object[camelCaseValue];
433
- }
434
- else if( object[camelCaseValue] !== undefined ) {
435
- found = object[camelCaseValue];
436
- return false;
437
- }
438
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
439
- object = object[value];
440
- }
441
- else if( object[value] !== undefined ) {
442
- found = object[value];
443
- return false;
444
- }
445
- else {
446
- return false;
447
- }
448
- });
449
- }
450
- if ( $.isFunction( found ) ) {
451
- response = found.apply(context, passedArguments);
452
- }
453
- else if(found !== undefined) {
454
- response = found;
455
- }
456
- if(Array.isArray(returnedValue)) {
457
- returnedValue.push(response);
458
- }
459
- else if(returnedValue !== undefined) {
460
- returnedValue = [returnedValue, response];
461
- }
462
- else if(response !== undefined) {
463
- returnedValue = response;
464
- }
465
- return found;
466
- }
467
- };
468
- if(methodInvoked) {
469
- if(instance === undefined) {
470
- module.initialize();
471
- }
472
- module.invoke(query);
473
- }
474
- else {
475
- if(instance !== undefined) {
476
- instance.invoke('destroy');
477
- }
478
- module.initialize();
479
- }
480
- })
481
- ;
482
-
483
- return (returnedValue !== undefined)
484
- ? returnedValue
485
- : this
486
- ;
487
- };
488
-
489
- $.fn.rating.settings = {
490
-
491
- name : 'Rating',
492
- namespace : 'rating',
493
-
494
- icon : 'star',
495
-
496
- silent : false,
497
- debug : false,
498
- verbose : false,
499
- performance : true,
500
-
501
- initialRating : 0,
502
- interactive : true,
503
- maxRating : 4,
504
- clearable : 'auto',
505
-
506
- fireOnInit : false,
507
-
508
- onRate : function(rating){},
509
-
510
- error : {
511
- method : 'The method you called is not defined',
512
- noMaximum : 'No maximum rating specified. Cannot generate HTML automatically'
513
- },
514
-
515
-
516
- metadata: {
517
- rating : 'rating',
518
- maxRating : 'maxRating',
519
- icon : 'icon'
520
- },
521
-
522
- className : {
523
- active : 'active',
524
- disabled : 'disabled',
525
- selected : 'selected',
526
- loading : 'loading',
527
- partiallyActive : 'partial'
528
- },
529
-
530
- cssVars : {
531
- filledCustomPropName : '--full'
532
- },
533
-
534
- selector : {
535
- icon : '.icon'
536
- },
537
-
538
- templates: {
539
- deQuote: function(string, encode) {
540
- return String(string).replace(/"/g,encode ? "&quot;" : "");
541
- },
542
- icon: function(maxRating, iconClass) {
543
- var
544
- icon = 1,
545
- html = '',
546
- deQuote = $.fn.rating.settings.templates.deQuote
547
- ;
548
- while(icon <= maxRating) {
549
- html += '<i class="'+deQuote(iconClass)+' icon"></i>';
550
- icon++;
551
- }
552
- return html;
553
- }
554
- }
555
-
556
- };
557
540
 
558
- })( jQuery, window, document );
541
+ };
542
+ })(jQuery, window, document);