fomantic-ui 2.10.0-beta.62 → 2.10.0-beta.64

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 (209) hide show
  1. package/.eslintrc.js +0 -1
  2. package/changelog-setup.js +10 -10
  3. package/dist/components/accordion.css +1 -1
  4. package/dist/components/accordion.js +40 -41
  5. package/dist/components/accordion.min.css +1 -1
  6. package/dist/components/accordion.min.js +2 -2
  7. package/dist/components/ad.css +1 -1
  8. package/dist/components/ad.min.css +1 -1
  9. package/dist/components/api.js +57 -61
  10. package/dist/components/api.min.js +2 -2
  11. package/dist/components/breadcrumb.css +1 -1
  12. package/dist/components/breadcrumb.min.css +1 -1
  13. package/dist/components/button.css +1 -1
  14. package/dist/components/button.min.css +1 -1
  15. package/dist/components/calendar.css +1 -1
  16. package/dist/components/calendar.js +186 -187
  17. package/dist/components/calendar.min.css +1 -1
  18. package/dist/components/calendar.min.js +2 -2
  19. package/dist/components/card.css +1 -1
  20. package/dist/components/card.min.css +1 -1
  21. package/dist/components/checkbox.css +1 -1
  22. package/dist/components/checkbox.js +29 -30
  23. package/dist/components/checkbox.min.css +1 -1
  24. package/dist/components/checkbox.min.js +2 -2
  25. package/dist/components/comment.css +1 -1
  26. package/dist/components/comment.min.css +1 -1
  27. package/dist/components/container.css +1 -1
  28. package/dist/components/container.min.css +1 -1
  29. package/dist/components/dimmer.css +1 -1
  30. package/dist/components/dimmer.js +22 -23
  31. package/dist/components/dimmer.min.css +1 -1
  32. package/dist/components/dimmer.min.js +2 -2
  33. package/dist/components/divider.css +1 -1
  34. package/dist/components/divider.min.css +1 -1
  35. package/dist/components/dropdown.css +1 -1
  36. package/dist/components/dropdown.js +293 -337
  37. package/dist/components/dropdown.min.css +1 -1
  38. package/dist/components/dropdown.min.js +2 -2
  39. package/dist/components/embed.css +1 -1
  40. package/dist/components/embed.js +33 -35
  41. package/dist/components/embed.min.css +1 -1
  42. package/dist/components/embed.min.js +2 -2
  43. package/dist/components/emoji.css +1 -1
  44. package/dist/components/emoji.min.css +1 -1
  45. package/dist/components/feed.css +1 -1
  46. package/dist/components/feed.min.css +1 -1
  47. package/dist/components/flag.css +1 -1
  48. package/dist/components/flag.min.css +1 -1
  49. package/dist/components/flyout.css +1 -1
  50. package/dist/components/flyout.js +74 -81
  51. package/dist/components/flyout.min.css +1 -1
  52. package/dist/components/flyout.min.js +2 -2
  53. package/dist/components/form.css +1 -1
  54. package/dist/components/form.js +141 -146
  55. package/dist/components/form.min.css +1 -1
  56. package/dist/components/form.min.js +2 -2
  57. package/dist/components/grid.css +1 -1
  58. package/dist/components/grid.min.css +1 -1
  59. package/dist/components/header.css +1 -1
  60. package/dist/components/header.min.css +1 -1
  61. package/dist/components/icon.css +1 -1
  62. package/dist/components/icon.min.css +1 -1
  63. package/dist/components/image.css +1 -1
  64. package/dist/components/image.min.css +1 -1
  65. package/dist/components/input.css +1 -1
  66. package/dist/components/input.min.css +1 -1
  67. package/dist/components/item.css +1 -1
  68. package/dist/components/item.min.css +1 -1
  69. package/dist/components/label.css +1 -1
  70. package/dist/components/label.min.css +1 -1
  71. package/dist/components/list.css +1 -1
  72. package/dist/components/list.min.css +1 -1
  73. package/dist/components/loader.css +1 -1
  74. package/dist/components/loader.min.css +1 -1
  75. package/dist/components/menu.css +1 -1
  76. package/dist/components/menu.min.css +1 -1
  77. package/dist/components/message.css +1 -1
  78. package/dist/components/message.min.css +1 -1
  79. package/dist/components/modal.css +1 -1
  80. package/dist/components/modal.js +80 -81
  81. package/dist/components/modal.min.css +1 -1
  82. package/dist/components/modal.min.js +2 -2
  83. package/dist/components/nag.css +1 -1
  84. package/dist/components/nag.js +27 -28
  85. package/dist/components/nag.min.css +1 -1
  86. package/dist/components/nag.min.js +2 -2
  87. package/dist/components/placeholder.css +1 -1
  88. package/dist/components/placeholder.min.css +1 -1
  89. package/dist/components/popup.css +1 -1
  90. package/dist/components/popup.js +62 -72
  91. package/dist/components/popup.min.css +1 -1
  92. package/dist/components/popup.min.js +2 -2
  93. package/dist/components/progress.css +1 -1
  94. package/dist/components/progress.js +51 -55
  95. package/dist/components/progress.min.css +1 -1
  96. package/dist/components/progress.min.js +2 -2
  97. package/dist/components/rail.css +1 -1
  98. package/dist/components/rail.min.css +1 -1
  99. package/dist/components/rating.css +1 -1
  100. package/dist/components/rating.js +33 -34
  101. package/dist/components/rating.min.css +1 -1
  102. package/dist/components/rating.min.js +2 -2
  103. package/dist/components/reset.css +1 -1
  104. package/dist/components/reset.min.css +1 -1
  105. package/dist/components/reveal.css +1 -1
  106. package/dist/components/reveal.min.css +1 -1
  107. package/dist/components/search.css +1 -1
  108. package/dist/components/search.js +96 -109
  109. package/dist/components/search.min.css +1 -1
  110. package/dist/components/search.min.js +2 -2
  111. package/dist/components/segment.css +1 -1
  112. package/dist/components/segment.min.css +1 -1
  113. package/dist/components/shape.css +1 -1
  114. package/dist/components/shape.js +44 -45
  115. package/dist/components/shape.min.css +1 -1
  116. package/dist/components/shape.min.js +2 -2
  117. package/dist/components/sidebar.css +1 -1
  118. package/dist/components/sidebar.js +56 -64
  119. package/dist/components/sidebar.min.css +1 -1
  120. package/dist/components/sidebar.min.js +2 -2
  121. package/dist/components/site.css +1 -1
  122. package/dist/components/site.js +16 -17
  123. package/dist/components/site.min.css +1 -1
  124. package/dist/components/site.min.js +2 -2
  125. package/dist/components/slider.css +1 -1
  126. package/dist/components/slider.js +143 -148
  127. package/dist/components/slider.min.css +1 -1
  128. package/dist/components/slider.min.js +2 -2
  129. package/dist/components/state.js +24 -25
  130. package/dist/components/state.min.js +2 -2
  131. package/dist/components/statistic.css +1 -1
  132. package/dist/components/statistic.min.css +1 -1
  133. package/dist/components/step.css +1 -1
  134. package/dist/components/step.min.css +1 -1
  135. package/dist/components/sticky.css +1 -1
  136. package/dist/components/sticky.js +42 -43
  137. package/dist/components/sticky.min.css +1 -1
  138. package/dist/components/sticky.min.js +2 -2
  139. package/dist/components/tab.css +1 -1
  140. package/dist/components/tab.js +57 -66
  141. package/dist/components/tab.min.css +1 -1
  142. package/dist/components/tab.min.js +2 -2
  143. package/dist/components/table.css +1 -1
  144. package/dist/components/table.min.css +1 -1
  145. package/dist/components/text.css +1 -1
  146. package/dist/components/text.min.css +1 -1
  147. package/dist/components/toast.css +1 -1
  148. package/dist/components/toast.js +32 -33
  149. package/dist/components/toast.min.css +1 -1
  150. package/dist/components/toast.min.js +2 -2
  151. package/dist/components/transition.css +1 -1
  152. package/dist/components/transition.js +38 -45
  153. package/dist/components/transition.min.css +1 -1
  154. package/dist/components/transition.min.js +2 -2
  155. package/dist/components/visibility.js +76 -77
  156. package/dist/components/visibility.min.js +2 -2
  157. package/dist/semantic.css +53 -53
  158. package/dist/semantic.js +1753 -1884
  159. package/dist/semantic.min.css +1 -1
  160. package/dist/semantic.min.js +2 -2
  161. package/package.json +1 -1
  162. package/scripts/nightly-version.js +3 -3
  163. package/src/definitions/behaviors/api.js +56 -60
  164. package/src/definitions/behaviors/form.js +140 -145
  165. package/src/definitions/behaviors/state.js +23 -24
  166. package/src/definitions/behaviors/visibility.js +75 -76
  167. package/src/definitions/globals/site.js +15 -16
  168. package/src/definitions/modules/accordion.js +39 -40
  169. package/src/definitions/modules/calendar.js +185 -186
  170. package/src/definitions/modules/checkbox.js +28 -29
  171. package/src/definitions/modules/dimmer.js +21 -22
  172. package/src/definitions/modules/dropdown.js +292 -336
  173. package/src/definitions/modules/embed.js +32 -34
  174. package/src/definitions/modules/flyout.js +73 -80
  175. package/src/definitions/modules/modal.js +79 -80
  176. package/src/definitions/modules/nag.js +26 -27
  177. package/src/definitions/modules/popup.js +61 -71
  178. package/src/definitions/modules/progress.js +50 -54
  179. package/src/definitions/modules/rating.js +32 -33
  180. package/src/definitions/modules/search.js +95 -108
  181. package/src/definitions/modules/shape.js +43 -44
  182. package/src/definitions/modules/sidebar.js +55 -63
  183. package/src/definitions/modules/slider.js +142 -147
  184. package/src/definitions/modules/sticky.js +41 -42
  185. package/src/definitions/modules/tab.js +56 -65
  186. package/src/definitions/modules/toast.js +31 -32
  187. package/src/definitions/modules/transition.js +37 -44
  188. package/tasks/admin/components/create.js +11 -11
  189. package/tasks/admin/components/init.js +11 -12
  190. package/tasks/admin/components/update.js +19 -20
  191. package/tasks/admin/distributions/create.js +24 -36
  192. package/tasks/admin/distributions/init.js +11 -12
  193. package/tasks/admin/distributions/update.js +18 -19
  194. package/tasks/admin/register.js +7 -7
  195. package/tasks/build/assets.js +1 -1
  196. package/tasks/build/css.js +1 -1
  197. package/tasks/build/javascript.js +1 -1
  198. package/tasks/config/admin/github.js +1 -1
  199. package/tasks/config/admin/templates/css-package.js +1 -1
  200. package/tasks/config/admin/templates/less-package.js +1 -1
  201. package/tasks/config/project/config.js +6 -6
  202. package/tasks/config/project/install.js +12 -12
  203. package/tasks/config/project/release.js +5 -11
  204. package/tasks/config/tasks.js +5 -5
  205. package/tasks/config/user.js +1 -4
  206. package/tasks/docs/metadata.js +11 -12
  207. package/tasks/install.js +9 -9
  208. package/test/meteor/assets.js +1 -1
  209. package/test/modules/module.spec.js +18 -18
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.62+40c7533 - Slider
2
+ * # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Slider
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -20,22 +20,22 @@
20
20
  : globalThis;
21
21
 
22
22
  $.fn.slider = function (...args) {
23
- let $allModules = $(this);
24
- let $document = $(document);
25
- let $window = $(window);
23
+ const $allModules = $(this);
24
+ const $document = $(document);
25
+ const $window = $(window);
26
26
 
27
27
  let time = Date.now();
28
28
  let performance = [];
29
29
 
30
- let parameters = args[0];
31
- let methodInvoked = typeof parameters === 'string';
32
- let queryArguments = args.slice(1);
30
+ const parameters = args[0];
31
+ const methodInvoked = typeof parameters === 'string';
32
+ const queryArguments = args.slice(1);
33
33
 
34
- let SINGLE_STEP = 1;
35
- let BIG_STEP = 2;
36
- let NO_STEP = 0;
37
- let SINGLE_BACKSTEP = -1;
38
- let BIG_BACKSTEP = -2;
34
+ const SINGLE_STEP = 1;
35
+ const BIG_STEP = 2;
36
+ const NO_STEP = 0;
37
+ const SINGLE_BACKSTEP = -1;
38
+ const BIG_BACKSTEP = -2;
39
39
 
40
40
  // Used to manage document bound events.
41
41
  // Use this so that we can distinguish between which document events are bound to which range.
@@ -44,22 +44,22 @@
44
44
  let returnedValue;
45
45
 
46
46
  $allModules.each(function () {
47
- let settings = $.isPlainObject(parameters)
47
+ const settings = $.isPlainObject(parameters)
48
48
  ? $.extend(true, {}, $.fn.slider.settings, parameters)
49
49
  : $.extend({}, $.fn.slider.settings);
50
50
 
51
- let className = settings.className;
52
- let metadata = settings.metadata;
53
- let namespace = settings.namespace;
54
- let error = settings.error;
55
- let keys = settings.keys;
56
- let interpretLabel = settings.interpretLabel;
51
+ const className = settings.className;
52
+ const metadata = settings.metadata;
53
+ const namespace = settings.namespace;
54
+ const error = settings.error;
55
+ const keys = settings.keys;
56
+ const interpretLabel = settings.interpretLabel;
57
57
 
58
58
  let isHover = false;
59
- let eventNamespace = '.' + namespace;
60
- let moduleNamespace = 'module-' + namespace;
59
+ const eventNamespace = '.' + namespace;
60
+ const moduleNamespace = 'module-' + namespace;
61
61
 
62
- let $module = $(this);
62
+ const $module = $(this);
63
63
  let $currThumb;
64
64
  let touchIdentifier;
65
65
  let $thumb;
@@ -68,7 +68,7 @@
68
68
  let $trackFill;
69
69
  let $labels;
70
70
 
71
- let element = this;
71
+ const element = this;
72
72
  let instance = $module.data(moduleNamespace);
73
73
 
74
74
  let documentEventID;
@@ -82,9 +82,8 @@
82
82
 
83
83
  let initialPosition;
84
84
  let initialLoad;
85
- let module;
86
85
 
87
- module = {
86
+ const module = {
88
87
 
89
88
  initialize: function () {
90
89
  module.debug('Initializing slider', settings);
@@ -178,13 +177,13 @@
178
177
  }
179
178
  },
180
179
  customLabel: function () {
181
- let $children = $labels.find('.label');
182
- let numChildren = $children.length;
183
- let min = module.get.min();
184
- let max = module.get.max();
180
+ const $children = $labels.find('.label');
181
+ const numChildren = $children.length;
182
+ const min = module.get.min();
183
+ const max = module.get.max();
185
184
  let ratio;
186
185
  $children.each(function (index) {
187
- let $child = $(this);
186
+ const $child = $(this);
188
187
  let attrValue = $child.attr('data-value');
189
188
  if (attrValue) {
190
189
  attrValue = attrValue > max
@@ -204,20 +203,20 @@
204
203
  } else {
205
204
  $labels = $module.append('<ul class="auto labels"></ul>').find('.labels');
206
205
  }
207
- let step = module.get.step();
208
- let precision = module.get.precision();
209
- let len = module.get.numLabels();
210
- let ignoreLabels = len - (settings.autoAdjustLabels !== 'fixed' ? 0 : module.get.max().toString().length + 4);
206
+ const step = module.get.step();
207
+ const precision = module.get.precision();
208
+ const len = module.get.numLabels();
209
+ const ignoreLabels = len - (settings.autoAdjustLabels !== 'fixed' ? 0 : module.get.max().toString().length + 4);
211
210
  for (let i = 0; i <= len; i++) {
212
- let stepValue = Math.round(((i * (step === 0 ? 1 : step)) + module.get.min()) * precision) / precision;
213
- let labelText = module.get.label(i, stepValue);
214
- let showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.includes(labelText);
215
- let $label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
211
+ const stepValue = Math.round(((i * (step === 0 ? 1 : step)) + module.get.min()) * precision) / precision;
212
+ const labelText = module.get.label(i, stepValue);
213
+ const showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.includes(labelText);
214
+ const $label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
216
215
  ? ((!(i % module.get.gapRatio()) && i < ignoreLabels) || i === len
217
216
  ? $('<li/>', { class: className.label, 'data-value': stepValue, html: showLabel ? labelText : '' })
218
217
  : $('<li/>', { class: 'halftick label', 'data-value': stepValue }))
219
218
  : null;
220
- let ratio = i / len;
219
+ const ratio = i / len;
221
220
  if ($label) {
222
221
  module.update.labelPosition(ratio, $label);
223
222
  $labels.append($label);
@@ -302,8 +301,8 @@
302
301
  down: function (event) {
303
302
  event.preventDefault();
304
303
  if (module.is.range()) {
305
- let eventPos = module.determine.eventPos(event);
306
- let newPos = module.determine.pos(eventPos);
304
+ const eventPos = module.determine.eventPos(event);
305
+ const newPos = module.determine.pos(eventPos);
307
306
  // Special handling if range mode and both thumbs have the same value
308
307
  if (settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
309
308
  initialPosition = newPos;
@@ -331,7 +330,7 @@
331
330
  return;
332
331
  }
333
332
  $currThumb = $(event.target);
334
- let touchEvent = event.touches ? event : event.originalEvent;
333
+ const touchEvent = event.touches ? event : event.originalEvent;
335
334
  touchIdentifier = touchEvent.targetTouches[0].identifier;
336
335
  if (previousValue === undefined) {
337
336
  previousValue = module.get.currentThumbValue();
@@ -347,13 +346,13 @@
347
346
  }
348
347
  let value = module.determine.valueFromEvent(event);
349
348
  if (event.type === 'mousemove' && $currThumb === undefined) {
350
- let eventPos = module.determine.eventPos(event);
351
- let newPos = module.determine.pos(eventPos);
349
+ const eventPos = module.determine.eventPos(event);
350
+ const newPos = module.determine.pos(eventPos);
352
351
  $currThumb = initialPosition > newPos ? $thumb : $secondThumb;
353
352
  }
354
353
  if (module.is.range() && (settings.minRange || settings.maxRange)) {
355
- let currentRangeDiff = module.get.currentRangeDiff(value);
356
- let isSecondThumb = $currThumb.hasClass('second');
354
+ const currentRangeDiff = module.get.currentRangeDiff(value);
355
+ const isSecondThumb = $currThumb.hasClass('second');
357
356
  if ((settings.minRange && currentRangeDiff < settings.minRange)
358
357
  || (settings.maxRange && currentRangeDiff > settings.maxRange)
359
358
  || (settings.preventCrossover && !isSecondThumb && value > module.secondThumbVal)
@@ -399,7 +398,7 @@
399
398
  if ($currThumb === undefined) {
400
399
  $currThumb = value <= module.get.currentThumbValue() ? $thumb : $secondThumb;
401
400
  }
402
- let currentRangeDiff = module.get.currentRangeDiff(value);
401
+ const currentRangeDiff = module.get.currentRangeDiff(value);
403
402
  if (settings.minRange && currentRangeDiff < settings.minRange) {
404
403
  value = module.get.edgeValue(value, settings.minRange);
405
404
  } else if (settings.maxRange && currentRangeDiff > settings.maxRange) {
@@ -432,7 +431,7 @@
432
431
  $document.trigger(event);
433
432
  }
434
433
  if (first || module.is.focused()) {
435
- let step = module.determine.keyMovement(event);
434
+ const step = module.determine.keyMovement(event);
436
435
  if (step !== NO_STEP) {
437
436
  event.preventDefault();
438
437
  switch (step) {
@@ -495,14 +494,14 @@
495
494
  if (!multiplier) {
496
495
  multiplier = 1;
497
496
  }
498
- let step = module.get.step();
499
- let currValue = module.get.currentThumbValue();
497
+ const step = module.get.step();
498
+ const currValue = module.get.currentThumbValue();
500
499
  module.verbose('Taking a step');
501
500
  if (step > 0) {
502
501
  module.set.value(currValue + step * multiplier);
503
502
  } else if (step === 0) {
504
- let precision = module.get.precision();
505
- let newValue = currValue + (multiplier / precision);
503
+ const precision = module.get.precision();
504
+ const newValue = currValue + (multiplier / precision);
506
505
  module.set.value(Math.round(newValue * precision) / precision);
507
506
  }
508
507
  },
@@ -511,14 +510,14 @@
511
510
  if (!multiplier) {
512
511
  multiplier = 1;
513
512
  }
514
- let step = module.get.step();
515
- let currValue = module.get.currentThumbValue();
513
+ const step = module.get.step();
514
+ const currValue = module.get.currentThumbValue();
516
515
  module.verbose('Going back a step');
517
516
  if (step > 0) {
518
517
  module.set.value(currValue - step * multiplier);
519
518
  } else if (step === 0) {
520
- let precision = module.get.precision();
521
- let newValue = currValue - (multiplier / precision);
519
+ const precision = module.get.precision();
520
+ const newValue = currValue - (multiplier / precision);
522
521
  module.set.value(Math.round(newValue * precision) / precision);
523
522
  }
524
523
  },
@@ -659,14 +658,14 @@
659
658
  precision: function () {
660
659
  if (module.cache.precision === undefined) {
661
660
  let decimalPlaces;
662
- let step = module.get.step();
661
+ const step = module.get.step();
663
662
  if (step !== 0) {
664
- let split = String(step).split('.');
663
+ const split = String(step).split('.');
665
664
  decimalPlaces = split.length === 2 ? split[1].length : 0;
666
665
  } else {
667
666
  decimalPlaces = settings.decimalPlaces;
668
667
  }
669
- let precision = 10 ** decimalPlaces;
668
+ const precision = 10 ** decimalPlaces;
670
669
  module.debug('Precision determined', precision);
671
670
  module.cache.precision = precision;
672
671
  }
@@ -678,11 +677,11 @@
678
677
  },
679
678
  max: function () {
680
679
  if (module.cache.max === undefined) {
681
- let step = module.get.step();
682
- let min = module.get.min();
683
- let precision = module.get.precision();
684
- let quotient = step === 0 ? 0 : Math.floor(Math.round(((settings.max - min) / step) * precision) / precision);
685
- let remainder = step === 0 ? 0 : (settings.max - min) % step;
680
+ const step = module.get.step();
681
+ const min = module.get.min();
682
+ const precision = module.get.precision();
683
+ const quotient = step === 0 ? 0 : Math.floor(Math.round(((settings.max - min) / step) * precision) / precision);
684
+ const remainder = step === 0 ? 0 : (settings.max - min) % step;
686
685
  if (remainder > 0) {
687
686
  module.debug('Max value not divisible by given step. Increasing max value.', settings.max, step);
688
687
  }
@@ -696,9 +695,9 @@
696
695
  },
697
696
  numLabels: function () {
698
697
  if (module.cache.numLabels === undefined) {
699
- let step = module.get.step();
700
- let precision = module.get.precision();
701
- let value = Math.round(((module.get.max() - module.get.min()) / (step === 0 ? 1 : step)) * precision) / precision;
698
+ const step = module.get.step();
699
+ const precision = module.get.precision();
700
+ const value = Math.round(((module.get.max() - module.get.min()) / (step === 0 ? 1 : step)) * precision) / precision;
702
701
  module.debug('Determined that there should be ' + value + ' labels');
703
702
  module.cache.numLabels = value;
704
703
  }
@@ -724,8 +723,8 @@
724
723
  return value;
725
724
  }
726
725
  let letterLabel = '';
727
- let letters = Array.isArray(settings.letters) ? settings.letters : [...String(settings.letters)];
728
- let lettersLen = letters.length;
726
+ const letters = Array.isArray(settings.letters) ? settings.letters : [...String(settings.letters)];
727
+ const lettersLen = letters.length;
729
728
 
730
729
  while (stepValue >= 0) {
731
730
  letterLabel = letters[stepValue % lettersLen] + letterLabel;
@@ -787,9 +786,9 @@
787
786
  let gapRatio = 1;
788
787
 
789
788
  if (settings.autoAdjustLabels) {
790
- let numLabels = module.get.numLabels();
791
- let primePlus = module.is.prime(numLabels) ? 1 : 0;
792
- let trackLength = module.get.trackLength();
789
+ const numLabels = module.get.numLabels();
790
+ const primePlus = module.is.prime(numLabels) ? 1 : 0;
791
+ const trackLength = module.get.trackLength();
793
792
  let gapCounter = 1;
794
793
 
795
794
  // While the distance between two labels is too short,
@@ -816,10 +815,10 @@
816
815
  : pagePos - module.get.trackOffset() - module.get.trackStartPos();
817
816
  },
818
817
  closestThumb: function (eventPos) {
819
- let thumbPos = parseFloat(module.determine.thumbPos($thumb));
820
- let thumbDelta = Math.abs(eventPos - thumbPos);
821
- let secondThumbPos = parseFloat(module.determine.thumbPos($secondThumb));
822
- let secondThumbDelta = Math.abs(eventPos - secondThumbPos);
818
+ const thumbPos = parseFloat(module.determine.thumbPos($thumb));
819
+ const thumbDelta = Math.abs(eventPos - thumbPos);
820
+ const secondThumbPos = parseFloat(module.determine.thumbPos($secondThumb));
821
+ const secondThumbDelta = Math.abs(eventPos - secondThumbPos);
823
822
  if (thumbDelta === secondThumbDelta && module.get.thumbValue() === module.get.min()) {
824
823
  return $secondThumb;
825
824
  }
@@ -827,10 +826,10 @@
827
826
  return thumbDelta <= secondThumbDelta ? $thumb : $secondThumb;
828
827
  },
829
828
  closestThumbPos: function (eventPos) {
830
- let thumbPos = parseFloat(module.determine.thumbPos($thumb));
831
- let thumbDelta = Math.abs(eventPos - thumbPos);
832
- let secondThumbPos = parseFloat(module.determine.thumbPos($secondThumb));
833
- let secondThumbDelta = Math.abs(eventPos - secondThumbPos);
829
+ const thumbPos = parseFloat(module.determine.thumbPos($thumb));
830
+ const thumbDelta = Math.abs(eventPos - thumbPos);
831
+ const secondThumbPos = parseFloat(module.determine.thumbPos($secondThumb));
832
+ const secondThumbDelta = Math.abs(eventPos - secondThumbPos);
834
833
 
835
834
  return thumbDelta <= secondThumbDelta ? thumbPos : secondThumbPos;
836
835
  },
@@ -840,30 +839,30 @@
840
839
  : (module.is.reversed() ? $element.css('right') : $element.css('left'));
841
840
  },
842
841
  positionFromValue: function (val) {
843
- let min = module.get.min();
844
- let max = module.get.max();
845
- let value = val > max
842
+ const min = module.get.min();
843
+ const max = module.get.max();
844
+ const value = val > max
846
845
  ? max
847
846
  : Math.max(val, min);
848
- let trackLength = module.get.trackLength();
849
- let ratio = (value - min) / (max - min);
850
- let position = Math.round(ratio * trackLength);
847
+ const trackLength = module.get.trackLength();
848
+ const ratio = (value - min) / (max - min);
849
+ const position = Math.round(ratio * trackLength);
851
850
  module.verbose('Determined position: ' + position + ' from value: ' + value);
852
851
 
853
852
  return position;
854
853
  },
855
854
  positionFromRatio: function (ratio) {
856
- let trackLength = module.get.trackLength();
857
- let step = module.get.step();
858
- let position = Math.round(ratio * trackLength);
859
- let adjustedPos = step === 0 ? position : Math.round(position / step) * step;
855
+ const trackLength = module.get.trackLength();
856
+ const step = module.get.step();
857
+ const position = Math.round(ratio * trackLength);
858
+ const adjustedPos = step === 0 ? position : Math.round(position / step) * step;
860
859
  module.verbose('Determined position: ' + position + ' from ratio: ' + ratio);
861
860
 
862
861
  return adjustedPos;
863
862
  },
864
863
  valueFromEvent: function (event) {
865
- let eventPos = module.determine.eventPos(event);
866
- let newPos = module.determine.pos(eventPos);
864
+ const eventPos = module.determine.eventPos(event);
865
+ const newPos = module.determine.pos(eventPos);
867
866
  let value;
868
867
  if (eventPos < module.get.trackOffset()) {
869
868
  value = module.is.reversed() ? module.get.max() : module.get.min();
@@ -876,13 +875,12 @@
876
875
  return value;
877
876
  },
878
877
  smoothValueFromEvent: function (event) {
879
- let min = module.get.min();
880
- let max = module.get.max();
881
- let trackLength = module.get.trackLength();
882
- let eventPos = module.determine.eventPos(event);
878
+ const min = module.get.min();
879
+ const max = module.get.max();
880
+ const trackLength = module.get.trackLength();
881
+ const eventPos = module.determine.eventPos(event);
883
882
  let newPos = eventPos - module.get.trackOffset();
884
883
  let ratio;
885
- let value;
886
884
  newPos = newPos < 0
887
885
  ? 0
888
886
  : Math.min(newPos, trackLength);
@@ -890,13 +888,12 @@
890
888
  if (module.is.reversed()) {
891
889
  ratio = 1 - ratio;
892
890
  }
893
- value = ratio * (max - min) + min;
894
891
 
895
- return value;
892
+ return ratio * (max - min) + min;
896
893
  },
897
894
  eventPos: function (event) {
898
895
  if (event.type === 'touchmove' || event.type === 'touchend') {
899
- let touchEvent = event.touches ? event : event.originalEvent;
896
+ const touchEvent = event.touches ? event : event.originalEvent;
900
897
  let touch = touchEvent.changedTouches[0]; // fall back to first touch if correct touch not found
901
898
  for (const t of touchEvent.touches) {
902
899
  if (t.identifier === touchIdentifier) {
@@ -905,25 +902,25 @@
905
902
  break;
906
903
  }
907
904
  }
908
- let touchY = touch.pageY;
909
- let touchX = touch.pageX;
905
+ const touchY = touch.pageY;
906
+ const touchX = touch.pageX;
910
907
 
911
908
  return module.is.vertical() ? touchY : touchX;
912
909
  }
913
- let clickY = event.pageY || event.originalEvent.pageY;
914
- let clickX = event.pageX || event.originalEvent.pageX;
910
+ const clickY = event.pageY || event.originalEvent.pageY;
911
+ const clickX = event.pageX || event.originalEvent.pageX;
915
912
 
916
913
  return module.is.vertical() ? clickY : clickX;
917
914
  },
918
915
  value: function (position) {
919
- let precision = module.get.precision();
920
- let startPos = module.is.reversed() ? module.get.trackEndPos() : module.get.trackStartPos();
921
- let endPos = module.is.reversed() ? module.get.trackStartPos() : module.get.trackEndPos();
922
- let ratio = (position - startPos) / (endPos - startPos);
923
- let range = module.get.max() - module.get.min();
924
- let step = module.get.step();
925
- let value = ratio * range;
926
- let difference = step === 0 ? value : Math.round(value / step) * step;
916
+ const precision = module.get.precision();
917
+ const startPos = module.is.reversed() ? module.get.trackEndPos() : module.get.trackStartPos();
918
+ const endPos = module.is.reversed() ? module.get.trackStartPos() : module.get.trackEndPos();
919
+ const ratio = (position - startPos) / (endPos - startPos);
920
+ const range = module.get.max() - module.get.min();
921
+ const step = module.get.step();
922
+ const value = ratio * range;
923
+ const difference = step === 0 ? value : Math.round(value / step) * step;
927
924
  module.verbose('Determined value based upon position: ' + position + ' as: ' + value);
928
925
  if (value !== difference) {
929
926
  module.verbose('Rounding value to closest step: ' + difference);
@@ -935,17 +932,17 @@
935
932
  return Math.round((difference + module.get.min()) * precision) / precision;
936
933
  },
937
934
  keyMovement: function (event) {
938
- let key = event.which;
939
- let downArrow = module.is.vertical()
935
+ const key = event.which;
936
+ const downArrow = module.is.vertical()
940
937
  ? (module.is.reversed() ? keys.downArrow : keys.upArrow)
941
938
  : keys.downArrow;
942
- let upArrow = module.is.vertical()
939
+ const upArrow = module.is.vertical()
943
940
  ? (module.is.reversed() ? keys.upArrow : keys.downArrow)
944
941
  : keys.upArrow;
945
- let leftArrow = !module.is.vertical()
942
+ const leftArrow = !module.is.vertical()
946
943
  ? (module.is.reversed() ? keys.rightArrow : keys.leftArrow)
947
944
  : keys.leftArrow;
948
- let rightArrow = !module.is.vertical()
945
+ const rightArrow = !module.is.vertical()
949
946
  ? (module.is.reversed() ? keys.leftArrow : keys.rightArrow)
950
947
  : keys.rightArrow;
951
948
  if (key === downArrow || key === leftArrow) {
@@ -966,30 +963,28 @@
966
963
  },
967
964
 
968
965
  handleNewValuePosition: function (val) {
969
- let min = module.get.min();
970
- let max = module.get.max();
971
- let newPos;
966
+ const min = module.get.min();
967
+ const max = module.get.max();
972
968
  if (val <= min) {
973
969
  val = min;
974
970
  } else if (val >= max) {
975
971
  val = max;
976
972
  }
977
- newPos = module.determine.positionFromValue(val);
978
973
 
979
- return newPos;
974
+ return module.determine.positionFromValue(val);
980
975
  },
981
976
 
982
977
  set: {
983
978
  active: function (thumbVal, secondThumbVal) {
984
979
  if (settings.highlightRange) {
985
980
  if (secondThumbVal < thumbVal) {
986
- let tempVal = secondThumbVal;
981
+ const tempVal = secondThumbVal;
987
982
  secondThumbVal = thumbVal;
988
983
  thumbVal = tempVal;
989
984
  }
990
- let $children = $labels.find('.label');
985
+ const $children = $labels.find('.label');
991
986
  $children.each(function (index) {
992
- let $child = $(this);
987
+ const $child = $(this);
993
988
  let attrValue = $child.attr('data-value');
994
989
  if (attrValue) {
995
990
  attrValue = parseInt(attrValue, 10);
@@ -1004,7 +999,7 @@
1004
999
  },
1005
1000
  value: function (newValue, fireChange) {
1006
1001
  fireChange = fireChange !== false;
1007
- let toReset = previousValue === undefined;
1002
+ const toReset = previousValue === undefined;
1008
1003
  previousValue = previousValue === undefined ? module.get.value() : previousValue;
1009
1004
  module.update.value(newValue, function (value, thumbVal, secondThumbVal) {
1010
1005
  if ((!initialLoad || settings.fireOnInit) && fireChange) {
@@ -1021,9 +1016,9 @@
1021
1016
  rangeValue: function (first, second, fireChange) {
1022
1017
  fireChange = fireChange !== false;
1023
1018
  if (module.is.range()) {
1024
- let min = module.get.min();
1025
- let max = module.get.max();
1026
- let toReset = previousValue === undefined;
1019
+ const min = module.get.min();
1020
+ const max = module.get.max();
1021
+ const toReset = previousValue === undefined;
1027
1022
  previousValue = previousValue === undefined ? module.get.value() : previousValue;
1028
1023
  if (first <= min) {
1029
1024
  first = min;
@@ -1054,7 +1049,7 @@
1054
1049
  }
1055
1050
  },
1056
1051
  position: function (position, which) {
1057
- let thumbVal = module.determine.value(position);
1052
+ const thumbVal = module.determine.value(position);
1058
1053
  if (which === 'second') {
1059
1054
  module.secondThumbVal = thumbVal;
1060
1055
  module.update.position(thumbVal, $secondThumb);
@@ -1069,8 +1064,8 @@
1069
1064
 
1070
1065
  update: {
1071
1066
  value: function (newValue, callback) {
1072
- let min = module.get.min();
1073
- let max = module.get.max();
1067
+ const min = module.get.min();
1068
+ const max = module.get.max();
1074
1069
  if (newValue <= min) {
1075
1070
  newValue = min;
1076
1071
  } else if (newValue >= max) {
@@ -1103,12 +1098,12 @@
1103
1098
  }
1104
1099
  },
1105
1100
  position: function (newValue, $element) {
1106
- let newPos = module.handleNewValuePosition(newValue);
1107
- let $targetThumb = $element || $currThumb;
1101
+ const newPos = module.handleNewValuePosition(newValue);
1102
+ const $targetThumb = $element || $currThumb;
1108
1103
  let thumbVal = module.thumbVal || module.get.min();
1109
1104
  let secondThumbVal = module.secondThumbVal || module.get.min();
1110
1105
  if (settings.showThumbTooltip) {
1111
- let precision = module.get.precision();
1106
+ const precision = module.get.precision();
1112
1107
  $targetThumb.attr('data-tooltip', Math.round(newValue * precision) / precision);
1113
1108
  }
1114
1109
  if (module.is.range()) {
@@ -1126,11 +1121,11 @@
1126
1121
  module.set.active(thumbVal, secondThumbVal);
1127
1122
  let trackPosValue;
1128
1123
  let thumbPosValue;
1129
- let min = module.get.min();
1130
- let max = module.get.max();
1131
- let thumbPosPercent = 100 * ((newValue - min) / (max - min));
1132
- let trackStartPosPercent = 100 * ((Math.min(thumbVal, secondThumbVal) - min) / (max - min));
1133
- let trackEndPosPercent = 100 * (1 - (Math.max(thumbVal, secondThumbVal) - min) / (max - min));
1124
+ const min = module.get.min();
1125
+ const max = module.get.max();
1126
+ const thumbPosPercent = 100 * ((newValue - min) / (max - min));
1127
+ const trackStartPosPercent = 100 * ((Math.min(thumbVal, secondThumbVal) - min) / (max - min));
1128
+ const trackEndPosPercent = 100 * (1 - (Math.max(thumbVal, secondThumbVal) - min) / (max - min));
1134
1129
  if (module.is.vertical()) {
1135
1130
  if (module.is.reversed()) {
1136
1131
  thumbPosValue = { bottom: 'calc(' + thumbPosPercent + '% - ' + offset + 'px)', top: 'auto' };
@@ -1151,15 +1146,15 @@
1151
1146
  module.debug('Setting slider position to ' + newPos);
1152
1147
  },
1153
1148
  labelPosition: function (ratio, $label) {
1154
- let startMargin = module.get.trackStartMargin();
1155
- let endMargin = module.get.trackEndMargin();
1156
- let posDir = module.is.vertical()
1149
+ const startMargin = module.get.trackStartMargin();
1150
+ const endMargin = module.get.trackEndMargin();
1151
+ const posDir = module.is.vertical()
1157
1152
  ? (module.is.reversed() ? 'bottom' : 'top')
1158
1153
  : (module.is.reversed() ? 'right' : 'left');
1159
- let startMarginMod = module.is.reversed() && !module.is.vertical()
1154
+ const startMarginMod = module.is.reversed() && !module.is.vertical()
1160
1155
  ? ' - '
1161
1156
  : ' + ';
1162
- let position = '(100% - ' + startMargin + ' - ' + endMargin + ') * ' + ratio;
1157
+ const position = '(100% - ' + startMargin + ' - ' + endMargin + ') * ' + ratio;
1163
1158
  $label.css(posDir, 'calc(' + position + startMarginMod + startMargin + ')');
1164
1159
  },
1165
1160
  },
@@ -1175,7 +1170,7 @@
1175
1170
 
1176
1171
  read: {
1177
1172
  metadata: function () {
1178
- let data = {
1173
+ const data = {
1179
1174
  thumbVal: $module.data(metadata.thumbVal),
1180
1175
  secondThumbVal: $module.data(metadata.secondThumbVal),
1181
1176
  };
@@ -1192,7 +1187,7 @@
1192
1187
  settings: function () {
1193
1188
  if (settings.start !== false) {
1194
1189
  if (module.is.range()) {
1195
- let rangeDiff = settings.end - settings.start;
1190
+ const rangeDiff = settings.end - settings.start;
1196
1191
  if (rangeDiff < 0
1197
1192
  || (settings.minRange && rangeDiff < settings.minRange)
1198
1193
  || (settings.maxRange && rangeDiff > settings.maxRange)
@@ -1310,7 +1305,7 @@
1310
1305
  query = query.split(/[ .]/);
1311
1306
  maxDepth = query.length - 1;
1312
1307
  $.each(query, function (depth, value) {
1313
- let camelCaseValue = depth !== maxDepth
1308
+ const camelCaseValue = depth !== maxDepth
1314
1309
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
1315
1310
  : query;
1316
1311
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.62+40c7533 - Slider
2
+ * # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Slider
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *