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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Sidebar
2
+ * # Fomantic-UI 2.10.0-beta.70+88a499a - Sidebar
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -19,74 +19,70 @@
19
19
  ? window
20
20
  : globalThis;
21
21
 
22
- $.fn.sidebar = function (parameters) {
23
- var
24
- $allModules = $(this),
25
- $window = $(window),
26
- $document = $(document),
27
- $body = $('body'),
28
- $html = $('html'),
29
- $head = $('head'),
30
-
31
- time = Date.now(),
32
- performance = [],
33
-
34
- query = arguments[0],
35
- methodInvoked = typeof query === 'string',
36
- queryArguments = [].slice.call(arguments, 1),
37
- contextCheck = function (context, win) {
38
- var $context;
39
- if ([window, document].indexOf(context) >= 0) {
40
- $context = $body;
41
- } else {
42
- $context = $(win.document).find(context);
43
- if ($context.length === 0) {
44
- $context = win.frameElement ? contextCheck(context, win.parent) : $body;
45
- }
22
+ $.fn.sidebar = function (...args) {
23
+ const $allModules = $(this);
24
+ const $window = $(window);
25
+ const $document = $(document);
26
+ const $body = $('body');
27
+ const $html = $('html');
28
+ const $head = $('head');
29
+
30
+ let time = Date.now();
31
+ let performance = [];
32
+
33
+ const parameters = args[0];
34
+ const methodInvoked = typeof parameters === 'string';
35
+ const queryArguments = args.slice(1);
36
+ const contextCheck = function (context, win) {
37
+ let $context;
38
+ if ([window, document].includes(context)) {
39
+ $context = $body;
40
+ } else {
41
+ $context = $(win.document).find(context);
42
+ if ($context.length === 0) {
43
+ $context = win.frameElement ? contextCheck(context, win.parent) : $body;
46
44
  }
45
+ }
47
46
 
48
- return $context;
49
- },
50
- returnedValue;
47
+ return $context;
48
+ };
49
+ let returnedValue;
51
50
 
52
51
  $allModules.each(function () {
53
- var
54
- settings = $.isPlainObject(parameters)
55
- ? $.extend(true, {}, $.fn.sidebar.settings, parameters)
56
- : $.extend({}, $.fn.sidebar.settings),
57
-
58
- selector = settings.selector,
59
- className = settings.className,
60
- namespace = settings.namespace,
61
- regExp = settings.regExp,
62
- error = settings.error,
52
+ const settings = $.isPlainObject(parameters)
53
+ ? $.extend(true, {}, $.fn.sidebar.settings, parameters)
54
+ : $.extend({}, $.fn.sidebar.settings);
63
55
 
64
- eventNamespace = '.' + namespace,
65
- moduleNamespace = 'module-' + namespace,
56
+ const selector = settings.selector;
57
+ const className = settings.className;
58
+ const namespace = settings.namespace;
59
+ const regExp = settings.regExp;
60
+ const error = settings.error;
66
61
 
67
- $module = $(this),
68
- $context = contextCheck(settings.context, window),
69
- isBody = $context[0] === $body[0],
62
+ const eventNamespace = '.' + namespace;
63
+ const moduleNamespace = 'module-' + namespace;
70
64
 
71
- $sidebars = $module.children(selector.sidebar),
72
- $fixed = $context.children(selector.fixed),
73
- $pusher = $context.children(selector.pusher),
74
- $style,
65
+ const $module = $(this);
66
+ let $context = contextCheck(settings.context, window);
67
+ const isBody = $context[0] === $body[0];
75
68
 
76
- element = this,
77
- instance = $module.data(moduleNamespace),
69
+ let $sidebars = $module.children(selector.sidebar);
70
+ let $fixed = $context.children(selector.fixed);
71
+ let $pusher = $context.children(selector.pusher);
72
+ let $style;
78
73
 
79
- elementNamespace,
80
- id,
81
- currentScroll,
82
- initialBodyMargin = '',
83
- tempBodyMargin = '',
84
- hadScrollbar = false,
74
+ const element = this;
75
+ let instance = $module.data(moduleNamespace);
85
76
 
86
- module
87
- ;
77
+ let elementNamespace;
78
+ let id;
79
+ let currentScroll;
80
+ let initialBodyMargin = '';
81
+ let initialBodyMarginInt = 0;
82
+ let tempBodyMargin = 0;
83
+ let hadScrollbar = false;
88
84
 
89
- module = {
85
+ const module = {
90
86
 
91
87
  initialize: function () {
92
88
  module.debug('Initializing sidebar', parameters);
@@ -111,8 +107,7 @@
111
107
  module.verbose('Storing instance of module', module);
112
108
  instance = module;
113
109
  $module
114
- .data(moduleNamespace, module)
115
- ;
110
+ .data(moduleNamespace, module);
116
111
  },
117
112
 
118
113
  create: {
@@ -127,8 +122,7 @@
127
122
  module.verbose('Destroying previous module for', $module);
128
123
  $module
129
124
  .off(eventNamespace)
130
- .removeData(moduleNamespace)
131
- ;
125
+ .removeData(moduleNamespace);
132
126
  // bound by uuid
133
127
  $context.off(elementNamespace);
134
128
  $window.off(elementNamespace);
@@ -138,10 +132,8 @@
138
132
  event: {
139
133
  clickaway: function (event) {
140
134
  if (settings.closable) {
141
- var
142
- clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target),
143
- clickedContext = $context.is(event.target)
144
- ;
135
+ const clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
136
+ const clickedContext = $context.is(event.target);
145
137
  if (clickedInPusher) {
146
138
  module.verbose('User clicked on dimmed page');
147
139
  module.hide();
@@ -175,8 +167,7 @@
175
167
  module.verbose('Adding clickaway events to context', $context);
176
168
  $context
177
169
  .on('click' + elementNamespace, module.event.clickaway)
178
- .on('touchend' + elementNamespace, module.event.clickaway)
179
- ;
170
+ .on('touchend' + elementNamespace, module.event.clickaway);
180
171
  },
181
172
  scrollLock: function () {
182
173
  if (settings.scrollLock) {
@@ -190,11 +181,9 @@
190
181
  }
191
182
  module.verbose('Adding events to contain sidebar scroll');
192
183
  $document
193
- .on('touchmove' + elementNamespace, module.event.touch)
194
- ;
184
+ .on('touchmove' + elementNamespace, module.event.touch);
195
185
  $module
196
- .on('scroll' + eventNamespace, module.event.containScroll)
197
- ;
186
+ .on('scroll' + eventNamespace, module.event.containScroll);
198
187
  },
199
188
  },
200
189
  unbind: {
@@ -215,19 +204,17 @@
215
204
 
216
205
  add: {
217
206
  inlineCSS: function () {
218
- var
219
- width = module.cache.width || $module.outerWidth(),
220
- height = module.cache.height || $module.outerHeight(),
221
- isRTL = module.is.rtl(),
222
- direction = module.get.direction(),
223
- distance = {
224
- left: width,
225
- right: -width,
226
- top: height,
227
- bottom: -height,
228
- },
229
- style
230
- ;
207
+ const width = module.cache.width || $module.outerWidth();
208
+ const height = module.cache.height || $module.outerHeight();
209
+ const isRTL = module.is.rtl();
210
+ const direction = module.get.direction();
211
+ const distance = {
212
+ left: width,
213
+ right: -width,
214
+ top: height,
215
+ bottom: -height,
216
+ };
217
+ let style;
231
218
 
232
219
  if (isRTL) {
233
220
  module.verbose('RTL detected, flipping widths');
@@ -254,8 +241,7 @@
254
241
 
255
242
  style += '</style>';
256
243
  $style = $(style)
257
- .appendTo($head)
258
- ;
244
+ .appendTo($head);
259
245
  module.debug('Adding sizing css to head', $style);
260
246
  },
261
247
  },
@@ -277,7 +263,7 @@
277
263
  repaint: function () {
278
264
  module.verbose('Forcing repaint event');
279
265
  element.style.display = 'none';
280
- var ignored = element.offsetHeight;
266
+ const ignored = element.offsetHeight;
281
267
  element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
282
268
  element.style.display = '';
283
269
  },
@@ -298,8 +284,7 @@
298
284
  .children()
299
285
  .not(selector.omitted)
300
286
  .not($sidebars)
301
- .wrapAll($pusher)
302
- ;
287
+ .wrapAll($pusher);
303
288
  module.refresh();
304
289
  }
305
290
  if ($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
@@ -315,17 +300,14 @@
315
300
  },
316
301
 
317
302
  attachEvents: function (selector, event) {
318
- var
319
- $toggle = $(selector)
320
- ;
303
+ const $toggle = $(selector);
321
304
  event = isFunction(module[event])
322
305
  ? module[event]
323
306
  : module.toggle;
324
307
  if ($toggle.length > 0) {
325
308
  module.debug('Attaching sidebar events to element', selector, event);
326
309
  $toggle
327
- .on('click' + eventNamespace, event)
328
- ;
310
+ .on('click' + eventNamespace, event);
329
311
  } else {
330
312
  module.error(error.notFound, selector);
331
313
  }
@@ -342,11 +324,9 @@
342
324
  save: {
343
325
  bodyMargin: function () {
344
326
  initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
345
- var
346
- bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10),
347
- bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
348
- ;
349
- tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
327
+ initialBodyMarginInt = Number.parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
328
+ const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
329
+ tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
350
330
  },
351
331
  },
352
332
  show: function (callback) {
@@ -415,21 +395,17 @@
415
395
  return module.othersVisible() || module.othersAnimating();
416
396
  },
417
397
 
418
- hideOthers: function (callback) {
419
- var
420
- $otherSidebars = $sidebars.not($module).filter('.' + className.visible),
421
- sidebarCount = $otherSidebars.length,
422
- callbackCount = 0
423
- ;
424
- callback = callback || function () {};
398
+ hideOthers: function (callback = function () {}) {
399
+ const $otherSidebars = $sidebars.not($module).filter('.' + className.visible);
400
+ const sidebarCount = $otherSidebars.length;
401
+ let callbackCount = 0;
425
402
  $otherSidebars
426
403
  .sidebar('hide', function () {
427
404
  callbackCount++;
428
- if (callbackCount === sidebarCount) {
405
+ if (callbackCount === sidebarCount && isFunction(callback)) {
429
406
  callback();
430
407
  }
431
- })
432
- ;
408
+ });
433
409
  },
434
410
 
435
411
  toggle: function () {
@@ -442,15 +418,10 @@
442
418
  },
443
419
 
444
420
  pushPage: function (callback) {
445
- var
446
- transition = module.get.transition(),
447
- $transition = transition === 'overlay' || module.othersActive()
448
- ? $module
449
- : $pusher,
450
- animate,
451
- dim,
452
- transitionEnd
453
- ;
421
+ const transition = module.get.transition();
422
+ const $transition = transition === 'overlay' || module.othersActive()
423
+ ? $module
424
+ : $pusher;
454
425
  callback = isFunction(callback)
455
426
  ? callback
456
427
  : function () {};
@@ -463,16 +434,16 @@
463
434
  module.bind.scrollLock();
464
435
  module.set.transition(transition);
465
436
  module.repaint();
466
- animate = function () {
437
+ const animate = function () {
467
438
  module.bind.clickaway();
468
439
  module.add.inlineCSS();
469
440
  module.set.animating();
470
441
  module.set.visible();
471
442
  };
472
- dim = function () {
443
+ const dim = function () {
473
444
  module.set.dimmed();
474
445
  };
475
- transitionEnd = function (event) {
446
+ const transitionEnd = function (event) {
476
447
  if (event.target === $transition[0]) {
477
448
  $transition.off('transitionend' + elementNamespace, transitionEnd);
478
449
  module.remove.animating();
@@ -488,14 +459,10 @@
488
459
  },
489
460
 
490
461
  pullPage: function (callback) {
491
- var
492
- transition = module.get.transition(),
493
- $transition = transition === 'overlay' || module.othersActive()
494
- ? $module
495
- : $pusher,
496
- animate,
497
- transitionEnd
498
- ;
462
+ const transition = module.get.transition();
463
+ const $transition = transition === 'overlay' || module.othersActive()
464
+ ? $module
465
+ : $pusher;
499
466
  callback = isFunction(callback)
500
467
  ? callback
501
468
  : function () {};
@@ -504,7 +471,7 @@
504
471
  module.unbind.clickaway();
505
472
  module.unbind.scrollLock();
506
473
 
507
- animate = function () {
474
+ const animate = function () {
508
475
  module.set.transition(transition);
509
476
  module.set.animating();
510
477
  if (settings.dimPage && !module.othersVisible()) {
@@ -512,7 +479,7 @@
512
479
  }
513
480
  module.remove.visible();
514
481
  };
515
- transitionEnd = function (event) {
482
+ const transitionEnd = function (event) {
516
483
  if (event.target === $transition[0]) {
517
484
  $transition.off('transitionend' + elementNamespace, transitionEnd);
518
485
  module.remove.animating();
@@ -553,13 +520,11 @@
553
520
 
554
521
  set: {
555
522
  bodyMargin: function () {
556
- var position = module.can.leftBodyScrollbar() ? 'left' : 'right';
523
+ const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
557
524
  $context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
558
525
  $context.find(selector.bodyFixed.replace('right', position)).each(function () {
559
- var
560
- el = $(this),
561
- attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
562
- ;
526
+ const el = $(this);
527
+ const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
563
528
  el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
564
529
  });
565
530
  },
@@ -594,12 +559,10 @@
594
559
  closing: function () {
595
560
  $pusher.addClass(className.closing);
596
561
  },
597
- transition: function (transition) {
598
- transition = transition || module.get.transition();
562
+ transition: function (transition = module.get.transition()) {
599
563
  $module.addClass(transition);
600
564
  },
601
- direction: function (direction) {
602
- direction = direction || module.get.direction();
565
+ direction: function (direction = module.get.direction()) {
603
566
  $module.addClass(className[direction]);
604
567
  },
605
568
  visible: function () {
@@ -636,12 +599,10 @@
636
599
  closing: function () {
637
600
  $pusher.removeClass(className.closing);
638
601
  },
639
- transition: function (transition) {
640
- transition = transition || module.get.transition();
602
+ transition: function (transition = module.get.transition()) {
641
603
  $module.removeClass(transition);
642
604
  },
643
- direction: function (direction) {
644
- direction = direction || module.get.direction();
605
+ direction: function (direction = module.get.direction()) {
645
606
  $module.removeClass(className[direction]);
646
607
  },
647
608
  visible: function () {
@@ -653,13 +614,11 @@
653
614
  },
654
615
  restore: {
655
616
  bodyMargin: function () {
656
- var position = module.can.leftBodyScrollbar() ? 'left' : 'right';
657
- $context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
617
+ const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
618
+ $context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
658
619
  $context.find(selector.bodyFixed.replace('right', position)).each(function () {
659
- var
660
- el = $(this),
661
- attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
662
- ;
620
+ const el = $(this);
621
+ const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
663
622
  el.css(attribute, '');
664
623
  });
665
624
  },
@@ -679,11 +638,8 @@
679
638
  return className.left;
680
639
  },
681
640
  transition: function () {
682
- var
683
- direction = module.get.direction(),
684
- transition
685
- ;
686
- transition = module.is.mobile()
641
+ const direction = module.get.direction();
642
+ const transition = module.is.mobile()
687
643
  ? (settings.mobileTransition === 'auto'
688
644
  ? settings.defaultTransition.mobile[direction]
689
645
  : settings.mobileTransition)
@@ -716,13 +672,11 @@
716
672
  return module.cache.isFirefox;
717
673
  },
718
674
  iframe: function () {
719
- return !(self === top);
675
+ return !(window.self === window.top);
720
676
  },
721
677
  mobile: function () {
722
- var
723
- userAgent = navigator.userAgent,
724
- isMobile = userAgent.match(regExp.mobile)
725
- ;
678
+ const userAgent = navigator.userAgent;
679
+ const isMobile = userAgent.match(regExp.mobile);
726
680
  if (isMobile) {
727
681
  module.verbose('Browser was found to be mobile', userAgent);
728
682
 
@@ -784,39 +738,37 @@
784
738
  return module[name];
785
739
  }
786
740
  },
787
- debug: function () {
741
+ debug: function (...args) {
788
742
  if (!settings.silent && settings.debug) {
789
743
  if (settings.performance) {
790
- module.performance.log(arguments);
744
+ module.performance.log(args);
791
745
  } else {
792
746
  module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
793
- module.debug.apply(console, arguments);
747
+ module.debug.apply(console, args);
794
748
  }
795
749
  }
796
750
  },
797
- verbose: function () {
751
+ verbose: function (...args) {
798
752
  if (!settings.silent && settings.verbose && settings.debug) {
799
753
  if (settings.performance) {
800
- module.performance.log(arguments);
754
+ module.performance.log(args);
801
755
  } else {
802
756
  module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
803
- module.verbose.apply(console, arguments);
757
+ module.verbose.apply(console, args);
804
758
  }
805
759
  }
806
760
  },
807
- error: function () {
761
+ error: function (...args) {
808
762
  if (!settings.silent) {
809
763
  module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
810
- module.error.apply(console, arguments);
764
+ module.error.apply(console, args);
811
765
  }
812
766
  },
813
767
  performance: {
814
768
  log: function (message) {
815
- var
816
- currentTime,
817
- executionTime,
818
- previousTime
819
- ;
769
+ let currentTime;
770
+ let executionTime;
771
+ let previousTime;
820
772
  if (settings.performance) {
821
773
  currentTime = Date.now();
822
774
  previousTime = time || currentTime;
@@ -824,7 +776,7 @@
824
776
  time = currentTime;
825
777
  performance.push({
826
778
  Name: message[0],
827
- Arguments: [].slice.call(message, 1) || '',
779
+ Arguments: message.slice(1),
828
780
  Element: element,
829
781
  'Execution Time': executionTime,
830
782
  });
@@ -835,10 +787,8 @@
835
787
  }, 500);
836
788
  },
837
789
  display: function () {
838
- var
839
- title = settings.name + ':',
840
- totalTime = 0
841
- ;
790
+ let title = settings.name + ':';
791
+ let totalTime = 0;
842
792
  time = false;
843
793
  clearTimeout(module.performance.timer);
844
794
  $.each(performance, function (index, data) {
@@ -847,35 +797,24 @@
847
797
  title += ' ' + totalTime + 'ms';
848
798
  if (performance.length > 0) {
849
799
  console.groupCollapsed(title);
850
- if (console.table) {
851
- console.table(performance);
852
- } else {
853
- $.each(performance, function (index, data) {
854
- console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
855
- });
856
- }
800
+ console.table(performance);
857
801
  console.groupEnd();
858
802
  }
859
803
  performance = [];
860
804
  },
861
805
  },
862
- invoke: function (query, passedArguments, context) {
863
- var
864
- object = instance,
865
- maxDepth,
866
- found,
867
- response
868
- ;
869
- passedArguments = passedArguments || queryArguments;
870
- context = context || element;
806
+ invoke: function (query, passedArguments = queryArguments, context = element) {
807
+ let object = instance;
808
+ let maxDepth;
809
+ let found;
810
+ let response;
871
811
  if (typeof query === 'string' && object !== undefined) {
872
812
  query = query.split(/[ .]/);
873
813
  maxDepth = query.length - 1;
874
814
  $.each(query, function (depth, value) {
875
- var camelCaseValue = depth !== maxDepth
815
+ const camelCaseValue = depth !== maxDepth
876
816
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
877
- : query
878
- ;
817
+ : query;
879
818
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
880
819
  object = object[camelCaseValue];
881
820
  } else if (object[camelCaseValue] !== undefined) {
@@ -916,7 +855,7 @@
916
855
  if (instance === undefined) {
917
856
  module.initialize();
918
857
  }
919
- module.invoke(query);
858
+ module.invoke(parameters);
920
859
  } else {
921
860
  if (instance !== undefined) {
922
861
  module.invoke('destroy');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Sidebar
2
+ * # Fomantic-UI 2.10.0-beta.70+88a499a - Sidebar
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *