fomantic-ui 2.10.0-beta.8 → 2.10.0-beta.81

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 (345) hide show
  1. package/.eslintrc.js +6 -23
  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 +8 -4
  9. package/changelog-setup.js +32 -10
  10. package/changelog-template.hbs +256 -251
  11. package/dist/components/accordion.css +1 -1
  12. package/dist/components/accordion.js +62 -73
  13. package/dist/components/accordion.min.css +1 -1
  14. package/dist/components/accordion.min.js +3 -3
  15. package/dist/components/ad.css +1 -1
  16. package/dist/components/ad.min.css +1 -1
  17. package/dist/components/api.js +101 -161
  18. package/dist/components/api.min.js +3 -3
  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 +283 -332
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +3 -3
  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 +58 -79
  31. package/dist/components/checkbox.min.css +1 -1
  32. package/dist/components/checkbox.min.js +3 -3
  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 +39 -52
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +3 -3
  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 +435 -531
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +3 -3
  47. package/dist/components/embed.css +1 -1
  48. package/dist/components/embed.js +55 -68
  49. package/dist/components/embed.min.css +1 -1
  50. package/dist/components/embed.min.js +3 -3
  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 +149 -168
  59. package/dist/components/flyout.min.css +1 -1
  60. package/dist/components/flyout.min.js +3 -3
  61. package/dist/components/form.css +3 -5
  62. package/dist/components/form.js +249 -269
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +3 -3
  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 +161 -170
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +3 -3
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +74 -88
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +3 -3
  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 +105 -138
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +3 -3
  101. package/dist/components/progress.css +4 -13
  102. package/dist/components/progress.js +75 -97
  103. package/dist/components/progress.min.css +2 -2
  104. package/dist/components/progress.min.js +3 -3
  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 +49 -61
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +3 -3
  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 +178 -198
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +3 -3
  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 +59 -69
  123. package/dist/components/shape.min.css +1 -1
  124. package/dist/components/shape.min.js +3 -3
  125. package/dist/components/sidebar.css +1 -1
  126. package/dist/components/sidebar.js +81 -101
  127. package/dist/components/sidebar.min.css +1 -1
  128. package/dist/components/sidebar.min.js +3 -3
  129. package/dist/components/site.css +1 -1
  130. package/dist/components/site.js +37 -58
  131. package/dist/components/site.min.css +1 -1
  132. package/dist/components/site.min.js +3 -3
  133. package/dist/components/slider.css +1 -1
  134. package/dist/components/slider.js +169 -183
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +3 -3
  137. package/dist/components/state.js +45 -59
  138. package/dist/components/state.min.js +3 -3
  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 +95 -117
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +3 -3
  147. package/dist/components/tab.css +1 -1
  148. package/dist/components/tab.js +83 -115
  149. package/dist/components/tab.min.css +1 -1
  150. package/dist/components/tab.min.js +3 -3
  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 +64 -74
  157. package/dist/components/toast.min.css +1 -1
  158. package/dist/components/toast.min.js +3 -3
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +61 -85
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +3 -3
  163. package/dist/components/visibility.js +120 -140
  164. package/dist/components/visibility.min.js +3 -3
  165. package/dist/semantic.css +4480 -8222
  166. package/dist/semantic.js +2886 -3485
  167. package/dist/semantic.min.css +3 -3
  168. package/dist/semantic.min.js +3 -3
  169. package/examples/attached.html +1 -1
  170. package/examples/components/menu.html +1 -1
  171. package/package.json +8 -5
  172. package/scripts/nightly-version.js +4 -4
  173. package/src/definitions/behaviors/api.js +100 -160
  174. package/src/definitions/behaviors/form.js +248 -268
  175. package/src/definitions/behaviors/state.js +44 -58
  176. package/src/definitions/behaviors/visibility.js +119 -139
  177. package/src/definitions/collections/breadcrumb.less +0 -1
  178. package/src/definitions/collections/form.less +3 -9
  179. package/src/definitions/collections/grid.less +1 -2
  180. package/src/definitions/collections/menu.less +106 -117
  181. package/src/definitions/collections/message.less +1 -2
  182. package/src/definitions/collections/table.less +7 -8
  183. package/src/definitions/elements/button.less +4 -6
  184. package/src/definitions/elements/container.less +0 -1
  185. package/src/definitions/elements/divider.less +1 -2
  186. package/src/definitions/elements/emoji.less +1 -1
  187. package/src/definitions/elements/flag.less +1 -1
  188. package/src/definitions/elements/header.less +4 -5
  189. package/src/definitions/elements/icon.less +10 -37
  190. package/src/definitions/elements/image.less +0 -1
  191. package/src/definitions/elements/input.less +4 -7
  192. package/src/definitions/elements/label.less +5 -14
  193. package/src/definitions/elements/list.less +2 -3
  194. package/src/definitions/elements/loader.less +10 -11
  195. package/src/definitions/elements/placeholder.less +1 -2
  196. package/src/definitions/elements/rail.less +0 -1
  197. package/src/definitions/elements/reveal.less +1 -5
  198. package/src/definitions/elements/segment.less +5 -6
  199. package/src/definitions/elements/step.less +3 -4
  200. package/src/definitions/elements/text.less +0 -1
  201. package/src/definitions/globals/reset.less +0 -1
  202. package/src/definitions/globals/site.js +36 -57
  203. package/src/definitions/globals/site.less +0 -1
  204. package/src/definitions/modules/accordion.js +61 -72
  205. package/src/definitions/modules/accordion.less +0 -1
  206. package/src/definitions/modules/calendar.js +282 -331
  207. package/src/definitions/modules/calendar.less +2 -3
  208. package/src/definitions/modules/checkbox.js +57 -78
  209. package/src/definitions/modules/checkbox.less +0 -1
  210. package/src/definitions/modules/dimmer.js +38 -51
  211. package/src/definitions/modules/dimmer.less +1 -2
  212. package/src/definitions/modules/dropdown.js +434 -530
  213. package/src/definitions/modules/dropdown.less +27 -38
  214. package/src/definitions/modules/embed.js +54 -67
  215. package/src/definitions/modules/embed.less +0 -1
  216. package/src/definitions/modules/flyout.js +148 -167
  217. package/src/definitions/modules/flyout.less +0 -1
  218. package/src/definitions/modules/modal.js +160 -169
  219. package/src/definitions/modules/modal.less +3 -4
  220. package/src/definitions/modules/nag.js +73 -87
  221. package/src/definitions/modules/nag.less +0 -1
  222. package/src/definitions/modules/popup.js +104 -137
  223. package/src/definitions/modules/popup.less +18 -73
  224. package/src/definitions/modules/progress.js +74 -96
  225. package/src/definitions/modules/progress.less +3 -13
  226. package/src/definitions/modules/rating.js +48 -60
  227. package/src/definitions/modules/rating.less +0 -1
  228. package/src/definitions/modules/search.js +177 -197
  229. package/src/definitions/modules/search.less +2 -4
  230. package/src/definitions/modules/shape.js +58 -68
  231. package/src/definitions/modules/shape.less +0 -1
  232. package/src/definitions/modules/sidebar.js +80 -100
  233. package/src/definitions/modules/sidebar.less +0 -1
  234. package/src/definitions/modules/slider.js +168 -182
  235. package/src/definitions/modules/slider.less +0 -1
  236. package/src/definitions/modules/sticky.js +94 -116
  237. package/src/definitions/modules/sticky.less +0 -1
  238. package/src/definitions/modules/tab.js +82 -114
  239. package/src/definitions/modules/tab.less +0 -1
  240. package/src/definitions/modules/toast.js +63 -73
  241. package/src/definitions/modules/toast.less +0 -1
  242. package/src/definitions/modules/transition.js +60 -84
  243. package/src/definitions/modules/transition.less +1 -2
  244. package/src/definitions/views/ad.less +0 -1
  245. package/src/definitions/views/card.less +0 -1
  246. package/src/definitions/views/comment.less +0 -1
  247. package/src/definitions/views/feed.less +0 -1
  248. package/src/definitions/views/item.less +0 -1
  249. package/src/definitions/views/statistic.less +0 -1
  250. package/src/semantic.less +1 -1
  251. package/src/themes/amazon/elements/button.overrides +1 -1
  252. package/src/themes/amazon/elements/button.variables +5 -6
  253. package/src/themes/amazon/globals/site.variables +2 -3
  254. package/src/themes/bookish/elements/header.variables +2 -2
  255. package/src/themes/bootstrap3/elements/button.variables +4 -5
  256. package/src/themes/chubby/collections/menu.variables +1 -1
  257. package/src/themes/chubby/elements/button.overrides +4 -4
  258. package/src/themes/chubby/modules/accordion.overrides +1 -1
  259. package/src/themes/chubby/views/comment.overrides +2 -2
  260. package/src/themes/chubby/views/comment.variables +2 -2
  261. package/src/themes/classic/collections/table.variables +2 -2
  262. package/src/themes/classic/elements/button.variables +11 -11
  263. package/src/themes/classic/modules/progress.variables +2 -2
  264. package/src/themes/classic/views/card.variables +2 -2
  265. package/src/themes/default/collections/form.variables +2 -3
  266. package/src/themes/default/collections/menu.variables +28 -28
  267. package/src/themes/default/collections/message.variables +1 -1
  268. package/src/themes/default/collections/table.variables +4 -4
  269. package/src/themes/default/elements/button.variables +9 -10
  270. package/src/themes/default/elements/divider.variables +1 -1
  271. package/src/themes/default/elements/icon.variables +2 -2
  272. package/src/themes/default/elements/image.variables +1 -1
  273. package/src/themes/default/elements/input.variables +2 -2
  274. package/src/themes/default/elements/label.variables +4 -4
  275. package/src/themes/default/elements/list.variables +1 -1
  276. package/src/themes/default/elements/placeholder.variables +6 -6
  277. package/src/themes/default/elements/segment.variables +8 -8
  278. package/src/themes/default/globals/reset.overrides +45 -201
  279. package/src/themes/default/globals/site.variables +50 -50
  280. package/src/themes/default/globals/variation.variables +3 -2
  281. package/src/themes/default/modules/accordion.variables +0 -1
  282. package/src/themes/default/modules/checkbox.variables +1 -1
  283. package/src/themes/default/modules/dimmer.variables +12 -12
  284. package/src/themes/default/modules/dropdown.variables +17 -16
  285. package/src/themes/default/modules/embed.variables +2 -2
  286. package/src/themes/default/modules/flyout.variables +3 -3
  287. package/src/themes/default/modules/modal.variables +14 -14
  288. package/src/themes/default/modules/nag.variables +1 -1
  289. package/src/themes/default/modules/rating.variables +1 -1
  290. package/src/themes/default/modules/search.variables +1 -1
  291. package/src/themes/default/modules/shape.variables +1 -1
  292. package/src/themes/default/modules/sidebar.variables +2 -2
  293. package/src/themes/default/modules/toast.variables +4 -4
  294. package/src/themes/default/views/card.variables +6 -7
  295. package/src/themes/default/views/feed.variables +4 -4
  296. package/src/themes/default/views/item.variables +2 -3
  297. package/src/themes/flat/collections/form.variables +1 -1
  298. package/src/themes/flat/globals/site.variables +9 -9
  299. package/src/themes/github/collections/form.overrides +3 -3
  300. package/src/themes/github/collections/form.variables +3 -3
  301. package/src/themes/github/collections/menu.overrides +1 -1
  302. package/src/themes/github/collections/menu.variables +10 -10
  303. package/src/themes/github/collections/message.variables +6 -6
  304. package/src/themes/github/elements/button.variables +17 -17
  305. package/src/themes/github/elements/input.variables +3 -3
  306. package/src/themes/github/elements/segment.variables +2 -2
  307. package/src/themes/github/elements/step.overrides +4 -4
  308. package/src/themes/github/elements/step.variables +3 -3
  309. package/src/themes/github/globals/site.variables +2 -2
  310. package/src/themes/github/modules/dropdown.variables +1 -3
  311. package/src/themes/gmail/collections/message.variables +2 -2
  312. package/src/themes/material/collections/menu.variables +1 -1
  313. package/src/themes/material/elements/button.overrides +4 -4
  314. package/src/themes/material/elements/button.variables +5 -5
  315. package/src/themes/material/modules/dropdown.variables +1 -1
  316. package/src/themes/material/modules/modal.variables +1 -1
  317. package/src/themes/raised/elements/button.variables +1 -1
  318. package/src/themes/round/elements/button.variables +12 -12
  319. package/src/themes/striped/modules/progress.overrides +3 -3
  320. package/src/themes/timeline/views/feed.variables +2 -2
  321. package/src/themes/twitter/elements/button.overrides +1 -1
  322. package/src/themes/twitter/elements/button.variables +4 -5
  323. package/tasks/admin/components/create.js +12 -15
  324. package/tasks/admin/components/init.js +11 -12
  325. package/tasks/admin/components/update.js +19 -20
  326. package/tasks/admin/distributions/create.js +30 -51
  327. package/tasks/admin/distributions/init.js +11 -12
  328. package/tasks/admin/distributions/update.js +18 -19
  329. package/tasks/admin/register.js +7 -7
  330. package/tasks/build/assets.js +1 -1
  331. package/tasks/build/css.js +5 -5
  332. package/tasks/build/javascript.js +1 -1
  333. package/tasks/config/admin/github.js +1 -1
  334. package/tasks/config/admin/templates/css-package.js +1 -1
  335. package/tasks/config/admin/templates/less-package.js +1 -1
  336. package/tasks/config/project/config.js +10 -10
  337. package/tasks/config/project/install.js +12 -12
  338. package/tasks/config/project/release.js +6 -12
  339. package/tasks/config/tasks.js +15 -11
  340. package/tasks/config/user.js +1 -4
  341. package/tasks/docs/metadata.js +18 -20
  342. package/tasks/install.js +14 -12
  343. package/test/meteor/assets.js +4 -4
  344. package/test/meteor/fonts.js +10 -11
  345. package/test/modules/module.spec.js +18 -18
@@ -19,23 +19,24 @@
19
19
  ? window
20
20
  : globalThis;
21
21
 
22
- $.fn.flyout = function (parameters) {
23
- let $allModules = $(this);
24
- let $window = $(window);
25
- let $document = $(document);
26
- let $html = $('html');
27
- let $head = $('head');
28
- let $body = $('body');
22
+ $.fn.flyout = function (...args) {
23
+ const $window = $(window);
24
+ const $document = $(document);
25
+ const $head = $('head');
26
+ const $body = $('body');
27
+ const $allModules = isFunction(this)
28
+ ? $body
29
+ : $(this);
29
30
 
30
31
  let time = Date.now();
31
32
  let performance = [];
32
33
 
33
- let query = arguments[0];
34
- let methodInvoked = typeof query === 'string';
35
- let queryArguments = [].slice.call(arguments, 1);
36
- let contextCheck = function (context, win) {
34
+ const parameters = args[0];
35
+ const methodInvoked = typeof parameters === 'string';
36
+ const queryArguments = args.slice(1);
37
+ const contextCheck = function (context, win) {
37
38
  let $context;
38
- if ([window, document].indexOf(context) >= 0) {
39
+ if ([window, document].includes(context)) {
39
40
  $context = $body;
40
41
  } else {
41
42
  $context = $(win.document).find(context);
@@ -53,15 +54,15 @@
53
54
  ? $.extend(true, {}, $.fn.flyout.settings, parameters)
54
55
  : $.extend({}, $.fn.flyout.settings);
55
56
 
56
- let selector = settings.selector;
57
+ const selector = settings.selector;
57
58
  let className = settings.className;
58
59
  let namespace = settings.namespace;
59
60
  let fields = settings.fields;
60
- let regExp = settings.regExp;
61
+ const regExp = settings.regExp;
61
62
  let error = settings.error;
62
63
 
63
- let eventNamespace = '.' + namespace;
64
- let moduleNamespace = 'module-' + namespace;
64
+ const eventNamespace = '.' + namespace;
65
+ const moduleNamespace = 'module-' + namespace;
65
66
 
66
67
  let $module = $(this);
67
68
  let $context = contextCheck(settings.context, window);
@@ -73,15 +74,16 @@
73
74
  let $pusher = $context.children(selector.pusher);
74
75
  let $style;
75
76
 
76
- let isFlyoutComponent = $module.hasClass('flyout');
77
+ const isFlyoutComponent = $module.hasClass('flyout');
77
78
 
78
79
  let element = this;
79
80
  let instance = isFlyoutComponent ? $module.data(moduleNamespace) : undefined;
80
81
 
81
82
  let ignoreRepeatedEvents = false;
82
- let isBody = $context[0] === $body[0];
83
+ const isBody = $context[0] === $body[0];
83
84
  let initialBodyMargin = '';
84
- let tempBodyMargin = '';
85
+ let initialBodyMarginInt = 0;
86
+ let tempBodyMargin = 0;
85
87
  let hadScrollbar = false;
86
88
  let windowRefocused = false;
87
89
 
@@ -91,9 +93,7 @@
91
93
  let observeAttributes = false;
92
94
  let currentScroll;
93
95
 
94
- let module;
95
-
96
- module = {
96
+ const module = {
97
97
 
98
98
  initialize: function () {
99
99
  module.debug('Initializing flyout', parameters);
@@ -125,29 +125,31 @@
125
125
  } else {
126
126
  $actions.empty();
127
127
  }
128
- settings.actions.forEach(function (el) {
129
- let icon = el[fields.icon]
128
+ for (const el of settings.actions) {
129
+ const icon = el[fields.icon]
130
130
  ? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
131
131
  : '';
132
- let text = module.helpers.escape(el[fields.text] || '', settings);
133
- let cls = module.helpers.escape(el[fields.class] || '');
134
- let click = el[fields.click] && isFunction(el[fields.click])
132
+ const text = module.helpers.escape(el[fields.text] || '', settings);
133
+ const cls = module.helpers.escape(el[fields.class] || '');
134
+ const click = el[fields.click] && isFunction(el[fields.click])
135
135
  ? el[fields.click]
136
136
  : function () {};
137
+ const elementRef = element;
138
+ const $moduleRef = $module;
137
139
  $actions.append($('<button/>', {
138
140
  html: icon + text,
139
141
  'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
140
142
  class: className.button + ' ' + cls,
141
143
  on: {
142
144
  click: function () {
143
- if (click.call(element, $module) === false) {
145
+ if (click.call(elementRef, $moduleRef) === false) {
144
146
  return;
145
147
  }
146
148
  module.hide();
147
149
  },
148
150
  },
149
151
  }));
150
- });
152
+ }
151
153
  }
152
154
 
153
155
  // avoids locking rendering if initialized in onReady
@@ -195,12 +197,12 @@
195
197
  $module.append($closeIcon);
196
198
  }
197
199
  if (settings.title !== '') {
198
- let titleId = '_' + module.get.id() + 'title';
200
+ const titleId = '_' + module.get.id() + 'title';
199
201
  $module.attr('aria-labelledby', titleId);
200
202
  $('<div/>', { class: className.header, id: titleId }).appendTo($module);
201
203
  }
202
204
  if (settings.content !== '') {
203
- let descId = '_' + module.get.id() + 'desc';
205
+ const descId = '_' + module.get.id() + 'desc';
204
206
  $module.attr('aria-describedby', descId);
205
207
  $('<div/>', { class: className.content, id: descId }).appendTo($module);
206
208
  }
@@ -237,7 +239,7 @@
237
239
 
238
240
  event: {
239
241
  keyboard: function (event) {
240
- let keyCode = event.which;
242
+ const keyCode = event.which;
241
243
  if (keyCode === settings.keys.escape) {
242
244
  if (settings.closable) {
243
245
  module.debug('Escape key pressed hiding flyout');
@@ -262,8 +264,8 @@
262
264
  },
263
265
  clickaway: function (event) {
264
266
  if (settings.closable) {
265
- let clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
266
- let clickedContext = $context.is(event.target);
267
+ const clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
268
+ const clickedContext = $context.is(event.target);
267
269
  if (clickedInPusher) {
268
270
  module.verbose('User clicked on dimmed page');
269
271
  module.hide();
@@ -278,21 +280,21 @@
278
280
  module.hide();
279
281
  },
280
282
  closeKeyUp: function (event) {
281
- let keyCode = event.which;
283
+ const keyCode = event.which;
282
284
  if (keyCode === settings.keys.enter || keyCode === settings.keys.space) {
283
285
  module.hide();
284
286
  }
285
287
  },
286
288
  inputKeyDown: {
287
289
  first: function (event) {
288
- let keyCode = event.which;
290
+ const keyCode = event.which;
289
291
  if (keyCode === settings.keys.tab && event.shiftKey) {
290
292
  $inputs.last().trigger('focus');
291
293
  event.preventDefault();
292
294
  }
293
295
  },
294
296
  last: function (event) {
295
- let keyCode = event.which;
297
+ const keyCode = event.which;
296
298
  if (keyCode === settings.keys.tab && !event.shiftKey) {
297
299
  $inputs.first().trigger('focus');
298
300
  event.preventDefault();
@@ -398,11 +400,11 @@
398
400
 
399
401
  add: {
400
402
  inlineCSS: function () {
401
- let width = module.cache.width || $module.outerWidth();
402
- let height = module.cache.height || $module.outerHeight();
403
- let isRTL = module.is.rtl();
404
- let direction = module.get.direction();
405
- let distance = {
403
+ const width = module.cache.width || $module.outerWidth();
404
+ const height = module.cache.height || $module.outerHeight();
405
+ const isRTL = module.is.rtl();
406
+ const direction = module.get.direction();
407
+ const distance = {
406
408
  left: width,
407
409
  right: -width,
408
410
  top: height,
@@ -445,52 +447,49 @@
445
447
  },
446
448
  },
447
449
  observeChanges: function () {
448
- if ('MutationObserver' in window) {
449
- observer = new MutationObserver(function (mutations) {
450
- let collectNodes = function (parent) {
451
- let nodes = [];
452
- for (let c = 0, cl = parent.length; c < cl; c++) {
453
- Array.prototype.push.apply(nodes, collectNodes(parent[c].childNodes));
454
- nodes.push(parent[c]);
455
- }
450
+ observer = new MutationObserver(function (mutations) {
451
+ const collectNodes = function (parent) {
452
+ const nodes = [];
453
+ for (const c of parent) {
454
+ nodes.push(...collectNodes(c.childNodes), c);
455
+ }
456
456
 
457
- return nodes;
458
- };
459
- let shouldRefreshInputs = false;
460
- let ignoreAutofocus = true;
461
- mutations.every(function (mutation) {
462
- if (mutation.type === 'attributes') {
463
- if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
464
- shouldRefreshInputs = true;
465
- }
466
- } else {
467
- // mutationobserver only provides the parent nodes,
468
- // so let's collect all childs as well to find nested inputs
469
- let $addedInputs = $(collectNodes(mutation.addedNodes)).filter('a[href], [tabindex], :input:enabled').filter(':visible');
470
- let $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
471
- if ($addedInputs.length > 0 || $removedInputs.length > 0) {
472
- shouldRefreshInputs = true;
473
- if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
474
- ignoreAutofocus = false;
475
- }
457
+ return nodes;
458
+ };
459
+ let shouldRefreshInputs = false;
460
+ let ignoreAutofocus = true;
461
+ mutations.every(function (mutation) {
462
+ if (mutation.type === 'attributes') {
463
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
464
+ shouldRefreshInputs = true;
465
+ }
466
+ } else {
467
+ // mutationobserver only provides the parent nodes,
468
+ // so let's collect all childs as well to find nested inputs
469
+ const $addedInputs = $(collectNodes(mutation.addedNodes)).filter('a[href], [tabindex], :input:enabled').filter(':visible');
470
+ const $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
471
+ if ($addedInputs.length > 0 || $removedInputs.length > 0) {
472
+ shouldRefreshInputs = true;
473
+ if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
474
+ ignoreAutofocus = false;
476
475
  }
477
476
  }
478
-
479
- return !shouldRefreshInputs;
480
- });
481
-
482
- if (shouldRefreshInputs) {
483
- module.refreshInputs(ignoreAutofocus);
484
477
  }
478
+
479
+ return !shouldRefreshInputs;
485
480
  });
486
- observer.observe(element, {
487
- attributeFilter: ['class', 'disabled'],
488
- attributes: true,
489
- childList: true,
490
- subtree: true,
491
- });
492
- module.debug('Setting up mutation observer', observer);
493
- }
481
+
482
+ if (shouldRefreshInputs) {
483
+ module.refreshInputs(ignoreAutofocus);
484
+ }
485
+ });
486
+ observer.observe(element, {
487
+ attributeFilter: ['class', 'disabled'],
488
+ attributes: true,
489
+ childList: true,
490
+ subtree: true,
491
+ });
492
+ module.debug('Setting up mutation observer', observer);
494
493
  },
495
494
  refresh: function () {
496
495
  module.verbose('Refreshing selector cache');
@@ -565,10 +564,10 @@
565
564
  },
566
565
  heights: function () {
567
566
  module.debug('Setting up heights', $module);
568
- let $header = $module.children(selector.header);
569
- let $content = $module.children(selector.content);
570
- let $actions = $module.children(selector.actions);
571
- let newContentHeight = ($context.height() || 0) - ($header.outerHeight() || 0) - ($actions.outerHeight() || 0);
567
+ const $header = $module.children(selector.header);
568
+ const $content = $module.children(selector.content);
569
+ const $actions = $module.children(selector.actions);
570
+ const newContentHeight = ($context.height() || 0) - ($header.outerHeight() || 0) - ($actions.outerHeight() || 0);
572
571
  if (newContentHeight > 0) {
573
572
  $content.css('min-height', String(newContentHeight) + 'px');
574
573
  }
@@ -576,7 +575,7 @@
576
575
  },
577
576
 
578
577
  attachEvents: function (selector, event) {
579
- let $toggle = $(selector);
578
+ const $toggle = $(selector);
580
579
  event = isFunction(module[event])
581
580
  ? module[event]
582
581
  : module.toggle;
@@ -661,15 +660,14 @@
661
660
  return module.othersVisible() || module.othersAnimating();
662
661
  },
663
662
 
664
- hideOthers: function (callback) {
665
- let $otherFlyouts = $flyouts.not($module).filter('.' + className.visible);
666
- let flyoutCount = $otherFlyouts.length;
663
+ hideOthers: function (callback = function () {}) {
664
+ const $otherFlyouts = $flyouts.not($module).filter('.' + className.visible);
665
+ const flyoutCount = $otherFlyouts.length;
667
666
  let callbackCount = 0;
668
- callback = callback || function () {};
669
667
  $otherFlyouts
670
668
  .flyout('hide', function () {
671
669
  callbackCount++;
672
- if (callbackCount === flyoutCount) {
670
+ if (callbackCount === flyoutCount && isFunction(callback)) {
673
671
  callback();
674
672
  }
675
673
  });
@@ -685,9 +683,6 @@
685
683
  },
686
684
 
687
685
  pushPage: function (callback) {
688
- let animate;
689
- let dim;
690
- let transitionEnd;
691
686
  callback = isFunction(callback)
692
687
  ? callback
693
688
  : function () {};
@@ -696,16 +691,16 @@
696
691
  currentScroll = (isBody ? $window : $context).scrollTop();
697
692
  }
698
693
  module.bind.scrollLock();
699
- animate = function () {
694
+ const animate = function () {
700
695
  module.bind.clickaway();
701
696
  module.add.inlineCSS();
702
697
  module.set.animating();
703
698
  module.set.visible();
704
699
  };
705
- dim = function () {
700
+ const dim = function () {
706
701
  module.set.dimmed();
707
702
  };
708
- transitionEnd = function (event) {
703
+ const transitionEnd = function (event) {
709
704
  if (event.target === $module[0]) {
710
705
  $module.off('transitionend' + elementNamespace, transitionEnd);
711
706
  module.remove.animating();
@@ -721,8 +716,6 @@
721
716
  },
722
717
 
723
718
  pullPage: function (callback) {
724
- let animate;
725
- let transitionEnd;
726
719
  callback = isFunction(callback)
727
720
  ? callback
728
721
  : function () {};
@@ -736,7 +729,7 @@
736
729
  }
737
730
  }
738
731
 
739
- animate = function () {
732
+ const animate = function () {
740
733
  module.set.overlay();
741
734
  module.set.animating();
742
735
  if (settings.dimPage && !module.othersVisible()) {
@@ -744,7 +737,7 @@
744
737
  }
745
738
  module.remove.visible();
746
739
  };
747
- transitionEnd = function (event) {
740
+ const transitionEnd = function (event) {
748
741
  if (event.target === $module[0]) {
749
742
  $module.off('transitionend' + elementNamespace, transitionEnd);
750
743
  module.remove.animating();
@@ -788,9 +781,9 @@
788
781
  observeAttributes = state !== false;
789
782
  },
790
783
  autofocus: function () {
791
- let $autofocus = $inputs.filter('[autofocus]');
792
- let $rawInputs = $inputs.filter(':input');
793
- let $input = ($autofocus.length > 0
784
+ const $autofocus = $inputs.filter('[autofocus]');
785
+ const $rawInputs = $inputs.filter(':input');
786
+ const $input = ($autofocus.length > 0
794
787
  ? $autofocus
795
788
  : ($rawInputs.length > 0
796
789
  ? $rawInputs
@@ -806,11 +799,11 @@
806
799
  }
807
800
  },
808
801
  bodyMargin: function () {
809
- let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
802
+ const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
810
803
  $context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
811
804
  $context.find(selector.bodyFixed.replace('right', position)).each(function () {
812
- let el = $(this);
813
- let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
805
+ const el = $(this);
806
+ const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
814
807
  el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
815
808
  });
816
809
  },
@@ -838,8 +831,7 @@
838
831
  closing: function () {
839
832
  $pusher.addClass(className.closing);
840
833
  },
841
- direction: function (direction) {
842
- direction = direction || module.get.direction();
834
+ direction: function (direction = module.get.direction()) {
843
835
  $module.addClass(className[direction]);
844
836
  },
845
837
  visible: function () {
@@ -881,8 +873,7 @@
881
873
  closing: function () {
882
874
  $pusher.removeClass(className.closing);
883
875
  },
884
- direction: function (direction) {
885
- direction = direction || module.get.direction();
876
+ direction: function (direction = module.get.direction()) {
886
877
  $module.removeClass(className[direction]);
887
878
  },
888
879
  visible: function () {
@@ -930,17 +921,17 @@
930
921
 
931
922
  save: {
932
923
  focus: function () {
933
- let $activeElement = $(document.activeElement);
934
- let inCurrentFlyout = $activeElement.closest($module).length > 0;
924
+ const $activeElement = $(document.activeElement);
925
+ const inCurrentFlyout = $activeElement.closest($module).length > 0;
935
926
  if (!inCurrentFlyout) {
936
927
  $focusedElement = $(document.activeElement).trigger('blur');
937
928
  }
938
929
  },
939
930
  bodyMargin: function () {
940
931
  initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
941
- let bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
942
- let bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
943
- tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
932
+ initialBodyMarginInt = Number.parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
933
+ const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
934
+ tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
944
935
  },
945
936
  },
946
937
 
@@ -960,11 +951,11 @@
960
951
  return module.cache.isFirefox;
961
952
  },
962
953
  iframe: function () {
963
- return !(self === top);
954
+ return !(window.self === window.top);
964
955
  },
965
956
  mobile: function () {
966
- let userAgent = navigator.userAgent;
967
- let isMobile = userAgent.match(regExp.mobile);
957
+ const userAgent = navigator.userAgent;
958
+ const isMobile = userAgent.match(regExp.mobile);
968
959
  if (isMobile) {
969
960
  module.verbose('Browser was found to be mobile', userAgent);
970
961
 
@@ -1009,11 +1000,11 @@
1009
1000
  }
1010
1001
  },
1011
1002
  bodyMargin: function () {
1012
- let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
1013
- $context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
1003
+ const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
1004
+ $context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
1014
1005
  $context.find(selector.bodyFixed.replace('right', position)).each(function () {
1015
- let el = $(this);
1016
- let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
1006
+ const el = $(this);
1007
+ const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
1017
1008
  el.css(attribute, '');
1018
1009
  });
1019
1010
  },
@@ -1025,8 +1016,7 @@
1025
1016
  return string;
1026
1017
  }
1027
1018
 
1028
- const badChars = /["'<>]|&(?![\d#A-Za-z]{1,12};)/g;
1029
- const escape = {
1019
+ const escapeMap = {
1030
1020
  '"': '&quot;',
1031
1021
  '&': '&amp;',
1032
1022
  "'": '&apos;',
@@ -1034,7 +1024,7 @@
1034
1024
  '>': '&gt;',
1035
1025
  };
1036
1026
 
1037
- return string.replace(badChars, (chr) => escape[chr]);
1027
+ return String(string).replace(/["&'<>]/g, (chr) => escapeMap[chr]);
1038
1028
  },
1039
1029
  },
1040
1030
 
@@ -1061,30 +1051,30 @@
1061
1051
  return module[name];
1062
1052
  }
1063
1053
  },
1064
- debug: function () {
1054
+ debug: function (...args) {
1065
1055
  if (!settings.silent && settings.debug) {
1066
1056
  if (settings.performance) {
1067
- module.performance.log(arguments);
1057
+ module.performance.log(args);
1068
1058
  } else {
1069
1059
  module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
1070
- module.debug.apply(console, arguments);
1060
+ module.debug.apply(console, args);
1071
1061
  }
1072
1062
  }
1073
1063
  },
1074
- verbose: function () {
1064
+ verbose: function (...args) {
1075
1065
  if (!settings.silent && settings.verbose && settings.debug) {
1076
1066
  if (settings.performance) {
1077
- module.performance.log(arguments);
1067
+ module.performance.log(args);
1078
1068
  } else {
1079
1069
  module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
1080
- module.verbose.apply(console, arguments);
1070
+ module.verbose.apply(console, args);
1081
1071
  }
1082
1072
  }
1083
1073
  },
1084
- error: function () {
1074
+ error: function (...args) {
1085
1075
  if (!settings.silent) {
1086
1076
  module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
1087
- module.error.apply(console, arguments);
1077
+ module.error.apply(console, args);
1088
1078
  }
1089
1079
  },
1090
1080
  performance: {
@@ -1099,7 +1089,7 @@
1099
1089
  time = currentTime;
1100
1090
  performance.push({
1101
1091
  Name: message[0],
1102
- Arguments: [].slice.call(message, 1) || '',
1092
+ Arguments: message.slice(1),
1103
1093
  Element: element,
1104
1094
  'Execution Time': executionTime,
1105
1095
  });
@@ -1120,30 +1110,22 @@
1120
1110
  title += ' ' + totalTime + 'ms';
1121
1111
  if (performance.length > 0) {
1122
1112
  console.groupCollapsed(title);
1123
- if (console.table) {
1124
- console.table(performance);
1125
- } else {
1126
- $.each(performance, function (index, data) {
1127
- console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
1128
- });
1129
- }
1113
+ console.table(performance);
1130
1114
  console.groupEnd();
1131
1115
  }
1132
1116
  performance = [];
1133
1117
  },
1134
1118
  },
1135
- invoke: function (query, passedArguments, context) {
1119
+ invoke: function (query, passedArguments = queryArguments, context = element) {
1136
1120
  let object = instance;
1137
1121
  let maxDepth;
1138
1122
  let found;
1139
1123
  let response;
1140
- passedArguments = passedArguments || queryArguments;
1141
- context = element || context;
1142
1124
  if (typeof query === 'string' && object !== undefined) {
1143
1125
  query = query.split(/[ .]/);
1144
1126
  maxDepth = query.length - 1;
1145
1127
  $.each(query, function (depth, value) {
1146
- let camelCaseValue = depth !== maxDepth
1128
+ const camelCaseValue = depth !== maxDepth
1147
1129
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
1148
1130
  : query;
1149
1131
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
@@ -1184,10 +1166,10 @@
1184
1166
 
1185
1167
  if (methodInvoked) {
1186
1168
  if (instance === undefined) {
1187
- if (isFunction(settings.templates[query])) {
1169
+ if (isFunction(settings.templates[parameters])) {
1188
1170
  settings.autoShow = true;
1189
1171
  settings.className.flyout = settings.className.template;
1190
- settings = $.extend(true, {}, settings, settings.templates[query].apply(module, queryArguments));
1172
+ settings = $.extend(true, {}, settings, settings.templates[parameters].apply(module, queryArguments));
1191
1173
 
1192
1174
  // reassign shortcuts
1193
1175
  className = settings.className;
@@ -1197,8 +1179,8 @@
1197
1179
  }
1198
1180
  module.initialize();
1199
1181
  }
1200
- if (!isFunction(settings.templates[query])) {
1201
- module.invoke(query);
1182
+ if (!isFunction(settings.templates[parameters])) {
1183
+ module.invoke(parameters);
1202
1184
  }
1203
1185
  } else {
1204
1186
  if (instance !== undefined) {
@@ -1336,8 +1318,7 @@
1336
1318
  };
1337
1319
 
1338
1320
  $.fn.flyout.settings.templates = {
1339
- getArguments: function (args) {
1340
- let queryArguments = [].slice.call(args);
1321
+ getArguments: function (queryArguments) {
1341
1322
  if ($.isPlainObject(queryArguments[0])) {
1342
1323
  return $.extend({
1343
1324
  handler: function () {},
@@ -1355,9 +1336,9 @@
1355
1336
  title: queryArguments.pop() || '',
1356
1337
  };
1357
1338
  },
1358
- alert: function () {
1359
- let settings = this.get.settings();
1360
- let args = settings.templates.getArguments(arguments);
1339
+ alert: function (...args) {
1340
+ const settings = this.get.settings();
1341
+ args = settings.templates.getArguments(args);
1361
1342
 
1362
1343
  return {
1363
1344
  title: args.title,
@@ -1369,9 +1350,9 @@
1369
1350
  }],
1370
1351
  };
1371
1352
  },
1372
- confirm: function () {
1373
- let settings = this.get.settings();
1374
- let args = settings.templates.getArguments(arguments);
1353
+ confirm: function (...args) {
1354
+ const settings = this.get.settings();
1355
+ args = settings.templates.getArguments(args);
1375
1356
 
1376
1357
  return {
1377
1358
  title: args.title,
@@ -1391,11 +1372,11 @@
1391
1372
  }],
1392
1373
  };
1393
1374
  },
1394
- prompt: function () {
1395
- let $this = this;
1396
- let settings = this.get.settings();
1397
- let args = settings.templates.getArguments(arguments);
1398
- let input = $($.parseHTML(args.content)).filter('.ui.input');
1375
+ prompt: function (...args) {
1376
+ const $this = this;
1377
+ const settings = this.get.settings();
1378
+ args = settings.templates.getArguments(args);
1379
+ const input = $($.parseHTML(args.content)).filter('.ui.input');
1399
1380
  if (input.length === 0) {
1400
1381
  args.content += '<p><div class="' + settings.className.prompt + '"><input placeholder="' + this.helpers.escape(args.placeholder || '') + '" type="text" value="' + this.helpers.escape(args.defaultValue || '') + '"></div></p>';
1401
1382
  }
@@ -1407,8 +1388,8 @@
1407
1388
  text: settings.text.ok,
1408
1389
  class: settings.className.ok,
1409
1390
  click: function () {
1410
- let settings = $this.get.settings();
1411
- let inputField = $this.get.element().find(settings.selector.prompt)[0];
1391
+ const settings = $this.get.settings();
1392
+ const inputField = $this.get.element().find(settings.selector.prompt)[0];
1412
1393
  args.handler($(inputField).val());
1413
1394
  },
1414
1395
  }, {