fomantic-ui 2.10.0-beta.7 → 2.10.0-beta.70

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 (362) hide show
  1. package/.eslintrc.js +6 -33
  2. package/.github/workflows/ci.yml +9 -9
  3. package/.github/workflows/depsreview.yml +1 -1
  4. package/.github/workflows/nightly.yml +7 -5
  5. package/.github/workflows/release.yml +2 -2
  6. package/.stylelintrc.js +1 -15
  7. package/CHANGELOG.md +5289 -2325
  8. package/README.md +11 -8
  9. package/changelog-setup.js +88 -72
  10. package/changelog-template.hbs +256 -251
  11. package/dist/components/accordion.css +1 -1
  12. package/dist/components/accordion.js +116 -164
  13. package/dist/components/accordion.min.css +1 -1
  14. package/dist/components/accordion.min.js +2 -2
  15. package/dist/components/ad.css +1 -1
  16. package/dist/components/ad.min.css +1 -1
  17. package/dist/components/api.js +190 -303
  18. package/dist/components/api.min.js +2 -2
  19. package/dist/components/breadcrumb.css +1 -1
  20. package/dist/components/breadcrumb.min.css +1 -1
  21. package/dist/components/button.css +5 -6
  22. package/dist/components/button.min.css +2 -2
  23. package/dist/components/calendar.css +3 -3
  24. package/dist/components/calendar.js +397 -482
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +2 -2
  27. package/dist/components/card.css +1 -1
  28. package/dist/components/card.min.css +1 -1
  29. package/dist/components/checkbox.css +1 -1
  30. package/dist/components/checkbox.js +105 -166
  31. package/dist/components/checkbox.min.css +1 -1
  32. package/dist/components/checkbox.min.js +2 -2
  33. package/dist/components/comment.css +1 -1
  34. package/dist/components/comment.min.css +1 -1
  35. package/dist/components/container.css +1 -1
  36. package/dist/components/container.min.css +1 -1
  37. package/dist/components/dimmer.css +2 -2
  38. package/dist/components/dimmer.js +75 -121
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +2 -2
  41. package/dist/components/divider.css +1 -1
  42. package/dist/components/divider.min.css +1 -1
  43. package/dist/components/dropdown.css +21 -35
  44. package/dist/components/dropdown.js +775 -1161
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +2 -2
  47. package/dist/components/embed.css +1 -1
  48. package/dist/components/embed.js +95 -146
  49. package/dist/components/embed.min.css +1 -1
  50. package/dist/components/embed.min.js +2 -2
  51. package/dist/components/emoji.css +3809 -7617
  52. package/dist/components/emoji.min.css +2 -2
  53. package/dist/components/feed.css +1 -1
  54. package/dist/components/feed.min.css +1 -1
  55. package/dist/components/flag.css +1 -1
  56. package/dist/components/flag.min.css +1 -1
  57. package/dist/components/flyout.css +1 -1
  58. package/dist/components/flyout.js +242 -336
  59. package/dist/components/flyout.min.css +1 -1
  60. package/dist/components/flyout.min.js +2 -2
  61. package/dist/components/form.css +3 -5
  62. package/dist/components/form.js +425 -554
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +2 -2
  65. package/dist/components/grid.css +2 -2
  66. package/dist/components/grid.min.css +2 -2
  67. package/dist/components/header.css +6 -6
  68. package/dist/components/header.min.css +2 -2
  69. package/dist/components/icon.css +10 -37
  70. package/dist/components/icon.min.css +2 -2
  71. package/dist/components/image.css +1 -1
  72. package/dist/components/image.min.css +1 -1
  73. package/dist/components/input.css +284 -12
  74. package/dist/components/input.min.css +2 -2
  75. package/dist/components/item.css +1 -1
  76. package/dist/components/item.min.css +1 -1
  77. package/dist/components/label.css +6 -14
  78. package/dist/components/label.min.css +2 -2
  79. package/dist/components/list.css +3 -3
  80. package/dist/components/list.min.css +2 -2
  81. package/dist/components/loader.css +53 -53
  82. package/dist/components/loader.min.css +2 -2
  83. package/dist/components/menu.css +45 -60
  84. package/dist/components/menu.min.css +2 -2
  85. package/dist/components/message.css +2 -2
  86. package/dist/components/message.min.css +2 -2
  87. package/dist/components/modal.css +5 -5
  88. package/dist/components/modal.js +274 -369
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +2 -2
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +109 -153
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +2 -2
  95. package/dist/components/placeholder.css +2 -2
  96. package/dist/components/placeholder.min.css +2 -2
  97. package/dist/components/popup.css +19 -73
  98. package/dist/components/popup.js +210 -303
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +2 -2
  101. package/dist/components/progress.css +4 -13
  102. package/dist/components/progress.js +128 -185
  103. package/dist/components/progress.min.css +2 -2
  104. package/dist/components/progress.min.js +2 -2
  105. package/dist/components/rail.css +1 -1
  106. package/dist/components/rail.min.css +1 -1
  107. package/dist/components/rating.css +1 -1
  108. package/dist/components/rating.js +92 -145
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +2 -2
  111. package/dist/components/reset.css +48 -208
  112. package/dist/components/reset.min.css +2 -2
  113. package/dist/components/reveal.css +2 -5
  114. package/dist/components/reveal.min.css +2 -2
  115. package/dist/components/search.css +2 -3
  116. package/dist/components/search.js +311 -425
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +2 -2
  119. package/dist/components/segment.css +6 -6
  120. package/dist/components/segment.min.css +2 -2
  121. package/dist/components/shape.css +1 -1
  122. package/dist/components/shape.js +173 -249
  123. package/dist/components/shape.min.css +1 -1
  124. package/dist/components/shape.min.js +2 -2
  125. package/dist/components/sidebar.css +1 -1
  126. package/dist/components/sidebar.js +138 -199
  127. package/dist/components/sidebar.min.css +1 -1
  128. package/dist/components/sidebar.min.js +2 -2
  129. package/dist/components/site.css +1 -1
  130. package/dist/components/site.js +59 -99
  131. package/dist/components/site.min.css +1 -1
  132. package/dist/components/site.min.js +2 -2
  133. package/dist/components/slider.css +1 -1
  134. package/dist/components/slider.js +267 -364
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +2 -2
  137. package/dist/components/state.js +88 -132
  138. package/dist/components/state.min.js +2 -2
  139. package/dist/components/statistic.css +1 -1
  140. package/dist/components/statistic.min.css +1 -1
  141. package/dist/components/step.css +4 -4
  142. package/dist/components/step.min.css +2 -2
  143. package/dist/components/sticky.css +1 -1
  144. package/dist/components/sticky.js +163 -228
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +2 -2
  147. package/dist/components/tab.css +1 -1
  148. package/dist/components/tab.js +192 -287
  149. package/dist/components/tab.min.css +1 -1
  150. package/dist/components/tab.min.js +2 -2
  151. package/dist/components/table.css +8 -8
  152. package/dist/components/table.min.css +2 -2
  153. package/dist/components/text.css +1 -1
  154. package/dist/components/text.min.css +1 -1
  155. package/dist/components/toast.css +1 -1
  156. package/dist/components/toast.js +118 -155
  157. package/dist/components/toast.min.css +1 -1
  158. package/dist/components/toast.min.js +2 -2
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +114 -193
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +2 -2
  163. package/dist/components/visibility.js +175 -271
  164. package/dist/components/visibility.min.js +2 -2
  165. package/dist/semantic.css +4479 -8221
  166. package/dist/semantic.js +5023 -7182
  167. package/dist/semantic.min.css +2 -2
  168. package/dist/semantic.min.js +2 -2
  169. package/examples/assets/show-examples.js +2 -4
  170. package/examples/attached.html +1 -1
  171. package/examples/components/menu.html +1 -1
  172. package/gulpfile.js +5 -7
  173. package/package.json +4 -5
  174. package/scripts/nightly-version.js +11 -14
  175. package/src/definitions/behaviors/api.js +189 -302
  176. package/src/definitions/behaviors/form.js +426 -555
  177. package/src/definitions/behaviors/state.js +87 -131
  178. package/src/definitions/behaviors/visibility.js +174 -270
  179. package/src/definitions/collections/breadcrumb.less +0 -1
  180. package/src/definitions/collections/form.less +3 -9
  181. package/src/definitions/collections/grid.less +1 -2
  182. package/src/definitions/collections/menu.less +106 -117
  183. package/src/definitions/collections/message.less +1 -2
  184. package/src/definitions/collections/table.less +7 -8
  185. package/src/definitions/elements/button.less +4 -6
  186. package/src/definitions/elements/container.less +0 -1
  187. package/src/definitions/elements/divider.less +1 -2
  188. package/src/definitions/elements/emoji.less +1 -1
  189. package/src/definitions/elements/flag.less +1 -1
  190. package/src/definitions/elements/header.less +4 -5
  191. package/src/definitions/elements/icon.less +10 -37
  192. package/src/definitions/elements/image.less +0 -1
  193. package/src/definitions/elements/input.less +4 -7
  194. package/src/definitions/elements/label.less +5 -14
  195. package/src/definitions/elements/list.less +2 -3
  196. package/src/definitions/elements/loader.less +10 -11
  197. package/src/definitions/elements/placeholder.less +1 -2
  198. package/src/definitions/elements/rail.less +0 -1
  199. package/src/definitions/elements/reveal.less +1 -5
  200. package/src/definitions/elements/segment.less +5 -6
  201. package/src/definitions/elements/step.less +3 -4
  202. package/src/definitions/elements/text.less +0 -1
  203. package/src/definitions/globals/reset.less +0 -1
  204. package/src/definitions/globals/site.js +58 -98
  205. package/src/definitions/globals/site.less +0 -1
  206. package/src/definitions/modules/accordion.js +115 -163
  207. package/src/definitions/modules/accordion.less +0 -1
  208. package/src/definitions/modules/calendar.js +396 -481
  209. package/src/definitions/modules/calendar.less +2 -3
  210. package/src/definitions/modules/checkbox.js +104 -165
  211. package/src/definitions/modules/checkbox.less +0 -1
  212. package/src/definitions/modules/dimmer.js +74 -120
  213. package/src/definitions/modules/dimmer.less +1 -2
  214. package/src/definitions/modules/dropdown.js +774 -1160
  215. package/src/definitions/modules/dropdown.less +27 -38
  216. package/src/definitions/modules/embed.js +94 -145
  217. package/src/definitions/modules/embed.less +0 -1
  218. package/src/definitions/modules/flyout.js +241 -335
  219. package/src/definitions/modules/flyout.less +0 -1
  220. package/src/definitions/modules/modal.js +273 -368
  221. package/src/definitions/modules/modal.less +3 -4
  222. package/src/definitions/modules/nag.js +108 -152
  223. package/src/definitions/modules/nag.less +0 -1
  224. package/src/definitions/modules/popup.js +209 -302
  225. package/src/definitions/modules/popup.less +18 -73
  226. package/src/definitions/modules/progress.js +127 -184
  227. package/src/definitions/modules/progress.less +3 -13
  228. package/src/definitions/modules/rating.js +93 -146
  229. package/src/definitions/modules/rating.less +0 -1
  230. package/src/definitions/modules/search.js +312 -426
  231. package/src/definitions/modules/search.less +2 -4
  232. package/src/definitions/modules/shape.js +172 -248
  233. package/src/definitions/modules/shape.less +0 -1
  234. package/src/definitions/modules/sidebar.js +137 -198
  235. package/src/definitions/modules/sidebar.less +0 -1
  236. package/src/definitions/modules/slider.js +266 -363
  237. package/src/definitions/modules/slider.less +0 -1
  238. package/src/definitions/modules/sticky.js +162 -227
  239. package/src/definitions/modules/sticky.less +0 -1
  240. package/src/definitions/modules/tab.js +191 -286
  241. package/src/definitions/modules/tab.less +0 -1
  242. package/src/definitions/modules/toast.js +117 -154
  243. package/src/definitions/modules/toast.less +0 -1
  244. package/src/definitions/modules/transition.js +113 -192
  245. package/src/definitions/modules/transition.less +1 -2
  246. package/src/definitions/views/ad.less +0 -1
  247. package/src/definitions/views/card.less +0 -1
  248. package/src/definitions/views/comment.less +0 -1
  249. package/src/definitions/views/feed.less +0 -1
  250. package/src/definitions/views/item.less +0 -1
  251. package/src/definitions/views/statistic.less +0 -1
  252. package/src/semantic.less +1 -1
  253. package/src/themes/amazon/elements/button.overrides +1 -1
  254. package/src/themes/amazon/elements/button.variables +5 -6
  255. package/src/themes/amazon/globals/site.variables +2 -3
  256. package/src/themes/bookish/elements/header.variables +2 -2
  257. package/src/themes/bootstrap3/elements/button.variables +4 -5
  258. package/src/themes/chubby/collections/menu.variables +1 -1
  259. package/src/themes/chubby/elements/button.overrides +4 -4
  260. package/src/themes/chubby/modules/accordion.overrides +1 -1
  261. package/src/themes/chubby/views/comment.overrides +2 -2
  262. package/src/themes/chubby/views/comment.variables +2 -2
  263. package/src/themes/classic/collections/table.variables +2 -2
  264. package/src/themes/classic/elements/button.variables +11 -11
  265. package/src/themes/classic/modules/progress.variables +2 -2
  266. package/src/themes/classic/views/card.variables +2 -2
  267. package/src/themes/default/collections/form.variables +2 -3
  268. package/src/themes/default/collections/menu.variables +28 -28
  269. package/src/themes/default/collections/message.variables +1 -1
  270. package/src/themes/default/collections/table.variables +4 -4
  271. package/src/themes/default/elements/button.variables +9 -10
  272. package/src/themes/default/elements/divider.variables +1 -1
  273. package/src/themes/default/elements/icon.variables +2 -2
  274. package/src/themes/default/elements/image.variables +1 -1
  275. package/src/themes/default/elements/input.variables +2 -2
  276. package/src/themes/default/elements/label.variables +4 -4
  277. package/src/themes/default/elements/list.variables +1 -1
  278. package/src/themes/default/elements/placeholder.variables +6 -6
  279. package/src/themes/default/elements/segment.variables +8 -8
  280. package/src/themes/default/globals/reset.overrides +45 -201
  281. package/src/themes/default/globals/site.variables +50 -50
  282. package/src/themes/default/globals/variation.variables +3 -2
  283. package/src/themes/default/modules/accordion.variables +0 -1
  284. package/src/themes/default/modules/checkbox.variables +1 -1
  285. package/src/themes/default/modules/dimmer.variables +12 -12
  286. package/src/themes/default/modules/dropdown.variables +17 -16
  287. package/src/themes/default/modules/embed.variables +2 -2
  288. package/src/themes/default/modules/flyout.variables +3 -3
  289. package/src/themes/default/modules/modal.variables +14 -14
  290. package/src/themes/default/modules/nag.variables +1 -1
  291. package/src/themes/default/modules/rating.variables +1 -1
  292. package/src/themes/default/modules/search.variables +1 -1
  293. package/src/themes/default/modules/shape.variables +1 -1
  294. package/src/themes/default/modules/sidebar.variables +2 -2
  295. package/src/themes/default/modules/toast.variables +4 -4
  296. package/src/themes/default/views/card.variables +6 -7
  297. package/src/themes/default/views/feed.variables +4 -4
  298. package/src/themes/default/views/item.variables +2 -3
  299. package/src/themes/flat/collections/form.variables +1 -1
  300. package/src/themes/flat/globals/site.variables +9 -9
  301. package/src/themes/github/collections/form.overrides +3 -3
  302. package/src/themes/github/collections/form.variables +3 -3
  303. package/src/themes/github/collections/menu.overrides +1 -1
  304. package/src/themes/github/collections/menu.variables +10 -10
  305. package/src/themes/github/collections/message.variables +6 -6
  306. package/src/themes/github/elements/button.variables +17 -17
  307. package/src/themes/github/elements/input.variables +3 -3
  308. package/src/themes/github/elements/segment.variables +2 -2
  309. package/src/themes/github/elements/step.overrides +4 -4
  310. package/src/themes/github/elements/step.variables +3 -3
  311. package/src/themes/github/globals/site.variables +2 -2
  312. package/src/themes/github/modules/dropdown.variables +1 -3
  313. package/src/themes/gmail/collections/message.variables +2 -2
  314. package/src/themes/material/collections/menu.variables +1 -1
  315. package/src/themes/material/elements/button.overrides +4 -4
  316. package/src/themes/material/elements/button.variables +5 -5
  317. package/src/themes/material/modules/dropdown.variables +1 -1
  318. package/src/themes/material/modules/modal.variables +1 -1
  319. package/src/themes/raised/elements/button.variables +1 -1
  320. package/src/themes/round/elements/button.variables +12 -12
  321. package/src/themes/striped/modules/progress.overrides +3 -3
  322. package/src/themes/timeline/views/feed.variables +2 -2
  323. package/src/themes/twitter/elements/button.overrides +1 -1
  324. package/src/themes/twitter/elements/button.variables +4 -5
  325. package/tasks/admin/components/create.js +87 -110
  326. package/tasks/admin/components/init.js +26 -33
  327. package/tasks/admin/components/update.js +46 -54
  328. package/tasks/admin/distributions/create.js +74 -125
  329. package/tasks/admin/distributions/init.js +27 -34
  330. package/tasks/admin/distributions/update.js +45 -53
  331. package/tasks/admin/register.js +11 -15
  332. package/tasks/build/assets.js +14 -18
  333. package/tasks/build/css.js +59 -68
  334. package/tasks/build/javascript.js +46 -54
  335. package/tasks/build.js +4 -6
  336. package/tasks/check-install.js +5 -7
  337. package/tasks/clean.js +2 -4
  338. package/tasks/collections/admin.js +13 -15
  339. package/tasks/collections/build.js +6 -8
  340. package/tasks/collections/docs.js +2 -4
  341. package/tasks/collections/install.js +2 -4
  342. package/tasks/collections/rtl.js +2 -4
  343. package/tasks/collections/various.js +2 -4
  344. package/tasks/config/admin/github.js +8 -10
  345. package/tasks/config/admin/templates/css-package.js +1 -3
  346. package/tasks/config/admin/templates/less-package.js +1 -3
  347. package/tasks/config/npm/gulpfile.js +4 -6
  348. package/tasks/config/project/config.js +26 -34
  349. package/tasks/config/project/install.js +58 -72
  350. package/tasks/config/project/release.js +7 -15
  351. package/tasks/config/tasks.js +23 -24
  352. package/tasks/config/user.js +9 -16
  353. package/tasks/docs/build.js +26 -31
  354. package/tasks/docs/metadata.js +35 -43
  355. package/tasks/docs/serve.js +20 -26
  356. package/tasks/install.js +77 -102
  357. package/tasks/rtl/build.js +2 -4
  358. package/tasks/rtl/watch.js +2 -4
  359. package/tasks/watch.js +9 -11
  360. package/test/meteor/assets.js +4 -4
  361. package/test/meteor/fonts.js +11 -13
  362. package/test/modules/module.spec.js +25 -27
@@ -19,47 +19,42 @@
19
19
  ? window
20
20
  : globalThis;
21
21
 
22
- $.fn.progress = function (parameters) {
23
- var
24
- $allModules = $(this),
22
+ $.fn.progress = function (...args) {
23
+ const $allModules = $(this);
25
24
 
26
- time = Date.now(),
27
- performance = [],
25
+ let time = Date.now();
26
+ let performance = [];
28
27
 
29
- query = arguments[0],
30
- methodInvoked = typeof query === 'string',
31
- queryArguments = [].slice.call(arguments, 1),
28
+ const parameters = args[0];
29
+ const methodInvoked = typeof parameters === 'string';
30
+ const queryArguments = args.slice(1);
32
31
 
33
- returnedValue
34
- ;
32
+ let returnedValue;
35
33
 
36
34
  $allModules.each(function () {
37
- var
38
- settings = $.isPlainObject(parameters)
39
- ? $.extend(true, {}, $.fn.progress.settings, parameters)
40
- : $.extend({}, $.fn.progress.settings),
41
-
42
- className = settings.className,
43
- metadata = settings.metadata,
44
- namespace = settings.namespace,
45
- selector = settings.selector,
46
- error = settings.error,
47
-
48
- eventNamespace = '.' + namespace,
49
- moduleNamespace = 'module-' + namespace,
50
-
51
- $module = $(this),
52
- $bars = $(this).find(selector.bar),
53
- $progresses = $(this).find(selector.progress),
54
- $label = $(this).find(selector.label),
55
-
56
- element = this,
57
- instance = $module.data(moduleNamespace),
58
-
59
- animating = false,
60
- module
61
- ;
62
- module = {
35
+ const settings = $.isPlainObject(parameters)
36
+ ? $.extend(true, {}, $.fn.progress.settings, parameters)
37
+ : $.extend({}, $.fn.progress.settings);
38
+
39
+ const className = settings.className;
40
+ const metadata = settings.metadata;
41
+ const namespace = settings.namespace;
42
+ const selector = settings.selector;
43
+ const error = settings.error;
44
+
45
+ const eventNamespace = '.' + namespace;
46
+ const moduleNamespace = 'module-' + namespace;
47
+
48
+ const $module = $(this);
49
+ const $bars = $(this).find(selector.bar);
50
+ const $progresses = $(this).find(selector.progress);
51
+ const $label = $(this).find(selector.label);
52
+
53
+ const element = this;
54
+ let instance = $module.data(moduleNamespace);
55
+
56
+ let animating = false;
57
+ const module = {
63
58
  helper: {
64
59
  sum: function (nums) {
65
60
  return Array.isArray(nums) ? nums.reduce(function (left, right) {
@@ -88,15 +83,15 @@
88
83
  * @returns {number} A precision. Could be 1, 10, 100, ... 1e+10.
89
84
  */
90
85
  derivePrecision: function (min, total) {
91
- var precisionPower = 0;
92
- var precision = 1;
93
- var ratio = min / total;
86
+ let precisionPower = 0;
87
+ let precision = 1;
88
+ let ratio = min / total;
94
89
  while (precisionPower < 10) {
95
90
  ratio *= precision;
96
91
  if (ratio > 1) {
97
92
  break;
98
93
  }
99
- precision = Math.pow(10, precisionPower++);
94
+ precision = 10 ** precisionPower++;
100
95
  }
101
96
 
102
97
  return precision;
@@ -104,7 +99,7 @@
104
99
  forceArray: function (element) {
105
100
  return Array.isArray(element)
106
101
  ? element
107
- : (!isNaN(element)
102
+ : (!Number.isNaN(Number(element))
108
103
  ? [element]
109
104
  : (typeof element === 'string' ? element.split(',') : [])); // eslint-disable-line unicorn/no-nested-ternary
110
105
  },
@@ -124,8 +119,7 @@
124
119
  module.verbose('Storing instance of progress', module);
125
120
  instance = module;
126
121
  $module
127
- .data(moduleNamespace, module)
128
- ;
122
+ .data(moduleNamespace, module);
129
123
  },
130
124
  destroy: function () {
131
125
  module.verbose('Destroying previous progress for', $module);
@@ -151,13 +145,11 @@
151
145
 
152
146
  read: {
153
147
  metadata: function () {
154
- var
155
- data = {
156
- percent: module.helper.forceArray($module.data(metadata.percent)),
157
- total: $module.data(metadata.total),
158
- value: module.helper.forceArray($module.data(metadata.value)),
159
- }
160
- ;
148
+ const data = {
149
+ percent: module.helper.forceArray($module.data(metadata.percent)),
150
+ total: $module.data(metadata.total),
151
+ value: module.helper.forceArray($module.data(metadata.value)),
152
+ };
161
153
  if (data.total !== undefined) {
162
154
  module.debug('Total value set from metadata', data.total);
163
155
  module.set.total(data.total);
@@ -195,8 +187,7 @@
195
187
  .one('transitionend' + eventNamespace, function (event) {
196
188
  clearTimeout(module.failSafeTimer);
197
189
  callback.call(this, event);
198
- })
199
- ;
190
+ });
200
191
  module.failSafeTimer = setTimeout(function () {
201
192
  $bars.triggerHandler('transitionend');
202
193
  }, settings.duration + settings.failSafeDelay);
@@ -205,10 +196,8 @@
205
196
  },
206
197
 
207
198
  increment: function (incrementValue) {
208
- var
209
- startValue,
210
- newValue
211
- ;
199
+ let startValue;
200
+ let newValue;
212
201
  if (module.has.total()) {
213
202
  startValue = module.get.value();
214
203
  incrementValue = incrementValue || 1;
@@ -222,11 +211,9 @@
222
211
  module.set.progress(newValue);
223
212
  },
224
213
  decrement: function (decrementValue) {
225
- var
226
- total = module.get.total(),
227
- startValue,
228
- newValue
229
- ;
214
+ const total = module.get.total();
215
+ let startValue;
216
+ let newValue;
230
217
  if (total) {
231
218
  startValue = module.get.value();
232
219
  decrementValue = decrementValue || 1;
@@ -252,29 +239,21 @@
252
239
  },
253
240
 
254
241
  get: {
255
- text: function (templateText, index) {
256
- if (!index) {
257
- index = 0;
258
- }
259
-
260
- var
261
- value = module.get.value(index),
262
- total = module.get.total(),
263
- percent = animating
264
- ? module.get.displayPercent(index)
265
- : module.get.percent(index),
266
- left = total !== false
267
- ? Math.max(0, total - value)
268
- : 100 - percent
269
- ;
270
- templateText = templateText || '';
242
+ text: function (templateText = '', index = 0) {
243
+ const value = module.get.value(index);
244
+ const total = module.get.total();
245
+ const percent = animating
246
+ ? module.get.displayPercent(index)
247
+ : module.get.percent(index);
248
+ const left = total !== false
249
+ ? Math.max(0, total - value)
250
+ : 100 - percent;
271
251
  templateText = templateText
272
252
  .replace('{value}', value)
273
253
  .replace('{total}', total || 0)
274
254
  .replace('{left}', left)
275
255
  .replace('{percent}', percent)
276
- .replace('{bar}', settings.text.bars[index] || '')
277
- ;
256
+ .replace('{bar}', settings.text.bars[index] || '');
278
257
  module.verbose('Adding variables to progress bar text', templateText);
279
258
 
280
259
  return templateText;
@@ -325,15 +304,13 @@
325
304
 
326
305
  // gets current displayed percentage (if animating values, this is the intermediary value)
327
306
  displayPercent: function (index) {
328
- var
329
- $bar = $($bars[index]),
330
- barWidth = $bar.width(),
331
- totalWidth = $module.width(),
332
- minDisplay = parseInt($bar.css('min-width'), 10),
333
- displayPercent = barWidth > minDisplay
334
- ? (barWidth / totalWidth) * 100
335
- : module.percent
336
- ;
307
+ const $bar = $($bars[index]);
308
+ const barWidth = $bar.width();
309
+ const totalWidth = $module.width();
310
+ const minDisplay = Number.parseInt($bar.css('min-width'), 10);
311
+ const displayPercent = barWidth > minDisplay
312
+ ? (barWidth / totalWidth) * 100
313
+ : module.percent;
337
314
 
338
315
  return settings.precision > 0
339
316
  ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
@@ -421,14 +398,14 @@
421
398
  barWidth: function (values) {
422
399
  module.debug('set bar width with ', values);
423
400
  values = module.helper.forceArray(values);
424
- var firstNonZeroIndex = -1;
425
- var lastNonZeroIndex = -1;
426
- var valuesSum = module.helper.sum(values);
427
- var barCounts = $bars.length;
428
- var isMultiple = barCounts > 1;
429
- var percents = values.map(function (value, index) {
430
- var allZero = index === barCounts - 1 && valuesSum === 0;
431
- var $bar = $($bars[index]);
401
+ let firstNonZeroIndex = -1;
402
+ let lastNonZeroIndex = -1;
403
+ const valuesSum = module.helper.sum(values);
404
+ const barCounts = $bars.length;
405
+ const isMultiple = barCounts > 1;
406
+ const percents = values.map(function (value, index) {
407
+ const allZero = index === barCounts - 1 && valuesSum === 0;
408
+ const $bar = $($bars[index]);
432
409
  if (value === 0 && isMultiple && !allZero) {
433
410
  $bar.css('display', 'none');
434
411
  } else {
@@ -445,23 +422,21 @@
445
422
  });
446
423
  }
447
424
 
448
- return parseFloat(value);
425
+ return Number.parseFloat(value);
449
426
  });
450
- values.forEach(function (_, index) {
451
- var $bar = $($bars[index]);
427
+ for (const [index, _] of values.entries()) {
428
+ const $bar = $($bars[index]);
452
429
  $bar.css({
453
430
  borderTopLeftRadius: index === firstNonZeroIndex ? '' : '0',
454
431
  borderBottomLeftRadius: index === firstNonZeroIndex ? '' : '0',
455
432
  borderTopRightRadius: index === lastNonZeroIndex ? '' : '0',
456
433
  borderBottomRightRadius: index === lastNonZeroIndex ? '' : '0',
457
434
  });
458
- });
435
+ }
459
436
  $module
460
- .attr('data-percent', percents)
461
- ;
437
+ .attr('data-percent', percents);
462
438
  },
463
- duration: function (duration) {
464
- duration = duration || settings.duration;
439
+ duration: function (duration = settings.duration) {
465
440
  duration = typeof duration === 'number'
466
441
  ? duration + 'ms'
467
442
  : duration;
@@ -469,8 +444,7 @@
469
444
  $bars
470
445
  .css({
471
446
  'transition-duration': duration,
472
- })
473
- ;
447
+ });
474
448
  },
475
449
  percent: function (percents) {
476
450
  percents = module.helper.forceArray(percents).map(function (percent) {
@@ -482,10 +456,10 @@
482
456
  ? Math.max(0, Math.min(100, percent))
483
457
  : percent;
484
458
  });
485
- var hasTotal = module.has.total();
486
- var totalPercent = module.helper.sum(percents);
487
- var isMultipleValues = percents.length > 1 && hasTotal;
488
- var sumTotal = module.helper.sum(module.helper.forceArray(module.value));
459
+ const hasTotal = module.has.total();
460
+ const totalPercent = module.helper.sum(percents);
461
+ const isMultipleValues = percents.length > 1 && hasTotal;
462
+ const sumTotal = module.helper.sum(module.helper.forceArray(module.value));
489
463
  if (isMultipleValues && sumTotal > module.total) {
490
464
  // Sum values instead of percents to avoid precision issues when summing floats
491
465
  module.error(error.sumExceedsTotal, sumTotal, module.total);
@@ -495,18 +469,17 @@
495
469
  } else if (totalPercent < 0) {
496
470
  module.error(error.tooLow, totalPercent);
497
471
  } else {
498
- var autoPrecision = settings.precision > 0
472
+ const autoPrecision = settings.precision > 0
499
473
  ? settings.precision
500
474
  : (isMultipleValues
501
475
  ? module.helper.derivePrecision(Math.min.apply(null, module.value), module.total)
502
476
  : 0);
503
477
 
504
478
  // round display percentage
505
- var roundedPercents = percents.map(function (percent) {
479
+ const roundedPercents = percents.map(function (percent) {
506
480
  return autoPrecision > 0
507
481
  ? Math.round(percent * (10 * autoPrecision)) / (10 * autoPrecision)
508
- : Math.round(percent)
509
- ;
482
+ : Math.round(percent);
510
483
  });
511
484
  module.percent = roundedPercents;
512
485
  if (hasTotal) {
@@ -522,21 +495,17 @@
522
495
  settings.onChange.call(element, percents, module.value, module.total);
523
496
  },
524
497
  labelInterval: function () {
525
- var
526
- animationCallback = function () {
527
- module.verbose('Bar finished animating, removing continuous label updates');
528
- clearInterval(module.interval);
529
- animating = false;
530
- module.set.labels();
531
- }
532
- ;
498
+ const animationCallback = function () {
499
+ module.verbose('Bar finished animating, removing continuous label updates');
500
+ clearInterval(module.interval);
501
+ animating = false;
502
+ module.set.labels();
503
+ };
533
504
  clearInterval(module.interval);
534
505
  module.bind.transitionEnd(animationCallback);
535
506
  animating = true;
536
507
  module.interval = setInterval(function () {
537
- var
538
- isInDOM = $.contains(document.documentElement, element)
539
- ;
508
+ const isInDOM = document.documentElement.contains(element);
540
509
  if (!isInDOM) {
541
510
  clearInterval(module.interval);
542
511
  animating = false;
@@ -556,10 +525,7 @@
556
525
  $label.text(text);
557
526
  }
558
527
  },
559
- state: function (percent) {
560
- percent = percent !== undefined
561
- ? percent
562
- : module.helper.sum(module.percent);
528
+ state: function (percent = module.helper.sum(module.percent)) {
563
529
  if (percent === 100) {
564
530
  if (settings.autoSuccess && $bars.length === 1 && !(module.is.warning() || module.is.error() || module.is.success())) {
565
531
  module.set.success();
@@ -582,7 +548,7 @@
582
548
  },
583
549
  barLabel: function (text) {
584
550
  $progresses.each(function (index, element) {
585
- var $progress = $(element);
551
+ const $progress = $(element);
586
552
  if (text !== undefined) {
587
553
  $progress.text(module.get.text(text, index));
588
554
  } else if (settings.label === 'ratio' && module.has.total()) {
@@ -594,8 +560,7 @@
594
560
  }
595
561
  });
596
562
  },
597
- active: function (text) {
598
- text = text || settings.text.active;
563
+ active: function (text = settings.text.active) {
599
564
  module.debug('Setting active state');
600
565
  if (settings.showActivity && !module.is.active()) {
601
566
  $module.addClass(className.active);
@@ -611,8 +576,7 @@
611
576
  settings.onActive.call(element, module.value, module.total);
612
577
  });
613
578
  },
614
- success: function (text, keepState) {
615
- text = text || settings.text.success || settings.text.active;
579
+ success: function (text = settings.text.success || settings.text.active, keepState = false) {
616
580
  module.debug('Setting success state');
617
581
  $module.addClass(className.success);
618
582
  module.remove.active();
@@ -630,8 +594,7 @@
630
594
  settings.onSuccess.call(element, module.total);
631
595
  });
632
596
  },
633
- warning: function (text, keepState) {
634
- text = text || settings.text.warning;
597
+ warning: function (text = settings.text.warning, keepState = false) {
635
598
  module.debug('Setting warning state');
636
599
  $module.addClass(className.warning);
637
600
  module.remove.active();
@@ -646,8 +609,7 @@
646
609
  settings.onWarning.call(element, module.value, module.total);
647
610
  });
648
611
  },
649
- error: function (text, keepState) {
650
- text = text || settings.text.error;
612
+ error: function (text = settings.text.error, keepState = false) {
651
613
  module.debug('Setting error state');
652
614
  $module.addClass(className.error);
653
615
  module.remove.active();
@@ -685,9 +647,7 @@
685
647
 
686
648
  update: {
687
649
  toNextValue: function () {
688
- var
689
- nextValue = module.nextValue
690
- ;
650
+ const nextValue = module.nextValue;
691
651
  if (nextValue) {
692
652
  module.debug('Update interval complete using last updated value', nextValue);
693
653
  module.update.progress(nextValue);
@@ -695,14 +655,12 @@
695
655
  }
696
656
  },
697
657
  progress: function (values) {
698
- var hasTotal = module.has.total();
658
+ const hasTotal = module.has.total();
699
659
  if (hasTotal) {
700
660
  module.set.value(values);
701
661
  }
702
- var percentCompletes = module.helper.forceArray(values).map(function (value) {
703
- var
704
- percentComplete
705
- ;
662
+ const percentCompletes = module.helper.forceArray(values).map(function (value) {
663
+ let percentComplete;
706
664
  value = module.get.numericValue(value);
707
665
  if (value === false) {
708
666
  module.error(error.nonNumeric, value);
@@ -745,39 +703,37 @@
745
703
  return module[name];
746
704
  }
747
705
  },
748
- debug: function () {
706
+ debug: function (...args) {
749
707
  if (!settings.silent && settings.debug) {
750
708
  if (settings.performance) {
751
- module.performance.log(arguments);
709
+ module.performance.log(args);
752
710
  } else {
753
711
  module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
754
- module.debug.apply(console, arguments);
712
+ module.debug.apply(console, args);
755
713
  }
756
714
  }
757
715
  },
758
- verbose: function () {
716
+ verbose: function (...args) {
759
717
  if (!settings.silent && settings.verbose && settings.debug) {
760
718
  if (settings.performance) {
761
- module.performance.log(arguments);
719
+ module.performance.log(args);
762
720
  } else {
763
721
  module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
764
- module.verbose.apply(console, arguments);
722
+ module.verbose.apply(console, args);
765
723
  }
766
724
  }
767
725
  },
768
- error: function () {
726
+ error: function (...args) {
769
727
  if (!settings.silent) {
770
728
  module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
771
- module.error.apply(console, arguments);
729
+ module.error.apply(console, args);
772
730
  }
773
731
  },
774
732
  performance: {
775
733
  log: function (message) {
776
- var
777
- currentTime,
778
- executionTime,
779
- previousTime
780
- ;
734
+ let currentTime;
735
+ let executionTime;
736
+ let previousTime;
781
737
  if (settings.performance) {
782
738
  currentTime = Date.now();
783
739
  previousTime = time || currentTime;
@@ -785,7 +741,7 @@
785
741
  time = currentTime;
786
742
  performance.push({
787
743
  Name: message[0],
788
- Arguments: [].slice.call(message, 1) || '',
744
+ Arguments: message.slice(1),
789
745
  Element: element,
790
746
  'Execution Time': executionTime,
791
747
  });
@@ -796,10 +752,8 @@
796
752
  }, 500);
797
753
  },
798
754
  display: function () {
799
- var
800
- title = settings.name + ':',
801
- totalTime = 0
802
- ;
755
+ let title = settings.name + ':';
756
+ let totalTime = 0;
803
757
  time = false;
804
758
  clearTimeout(module.performance.timer);
805
759
  $.each(performance, function (index, data) {
@@ -808,35 +762,24 @@
808
762
  title += ' ' + totalTime + 'ms';
809
763
  if (performance.length > 0) {
810
764
  console.groupCollapsed(title);
811
- if (console.table) {
812
- console.table(performance);
813
- } else {
814
- $.each(performance, function (index, data) {
815
- console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
816
- });
817
- }
765
+ console.table(performance);
818
766
  console.groupEnd();
819
767
  }
820
768
  performance = [];
821
769
  },
822
770
  },
823
- invoke: function (query, passedArguments, context) {
824
- var
825
- object = instance,
826
- maxDepth,
827
- found,
828
- response
829
- ;
830
- passedArguments = passedArguments || queryArguments;
831
- context = context || element;
771
+ invoke: function (query, passedArguments = queryArguments, context = element) {
772
+ let object = instance;
773
+ let maxDepth;
774
+ let found;
775
+ let response;
832
776
  if (typeof query === 'string' && object !== undefined) {
833
777
  query = query.split(/[ .]/);
834
778
  maxDepth = query.length - 1;
835
779
  $.each(query, function (depth, value) {
836
- var camelCaseValue = depth !== maxDepth
780
+ const camelCaseValue = depth !== maxDepth
837
781
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
838
- : query
839
- ;
782
+ : query;
840
783
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
841
784
  object = object[camelCaseValue];
842
785
  } else if (object[camelCaseValue] !== undefined) {
@@ -877,7 +820,7 @@
877
820
  if (instance === undefined) {
878
821
  module.initialize();
879
822
  }
880
- module.invoke(query);
823
+ module.invoke(parameters);
881
824
  } else {
882
825
  if (instance !== undefined) {
883
826
  instance.invoke('destroy');
@@ -91,10 +91,7 @@
91
91
  position: @progressPosition;
92
92
  width: @progressWidth;
93
93
  font-size: @progressSize;
94
- top: @progressTop;
95
- right: @progressRight;
96
- left: @progressLeft;
97
- bottom: @progressBottom;
94
+ inset: @progressTop @progressRight @progressBottom @progressLeft;
98
95
  color: @progressColor;
99
96
  text-shadow: @progressTextShadow;
100
97
  margin-top: @progressOffset;
@@ -117,10 +114,7 @@
117
114
  position: absolute;
118
115
  width: @labelWidth;
119
116
  font-size: @labelSize;
120
- top: @labelTop;
121
- right: @labelRight;
122
- left: @labelLeft;
123
- bottom: @labelBottom;
117
+ inset: @labelTop @labelRight @labelBottom @labelLeft;
124
118
  color: @labelColor;
125
119
  font-weight: @labelFontWeight;
126
120
  text-shadow: @labelTextShadow;
@@ -352,10 +346,7 @@
352
346
  content: "";
353
347
  opacity: 0;
354
348
  position: absolute;
355
- top: 0;
356
- left: 0;
357
- right: 0;
358
- bottom: 0;
349
+ inset: 0;
359
350
  background: @activePulseColor;
360
351
  border-radius: @barBorderRadius;
361
352
  animation: progress-active @activePulseDuration @defaultEasing infinite;
@@ -668,5 +659,4 @@
668
659
  }
669
660
  }
670
661
 
671
- // stylelint-disable no-invalid-position-at-import-rule
672
662
  @import (multiple, optional) "../../overrides.less";