fomantic-ui 2.9.3-beta.7 → 2.9.3-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 (289) hide show
  1. package/.all-contributorsrc +2 -2
  2. package/.github/FUNDING.yml +1 -1
  3. package/.github/auto_assign.yml +1 -1
  4. package/.github/workflows/ci.yml +5 -5
  5. package/.github/workflows/nightly.yml +1 -1
  6. package/.github/workflows/release.yml +1 -1
  7. package/CONTRIBUTORS.md +1 -1
  8. package/README.md +5 -2
  9. package/SECURITY.md +2 -1
  10. package/dist/components/accordion.css +1 -1
  11. package/dist/components/accordion.js +2 -2
  12. package/dist/components/accordion.min.css +1 -1
  13. package/dist/components/accordion.min.js +2 -2
  14. package/dist/components/ad.css +1 -1
  15. package/dist/components/ad.min.css +1 -1
  16. package/dist/components/api.js +10 -9
  17. package/dist/components/api.min.js +2 -2
  18. package/dist/components/breadcrumb.css +1 -1
  19. package/dist/components/breadcrumb.min.css +1 -1
  20. package/dist/components/button.css +2 -2
  21. package/dist/components/button.min.css +2 -2
  22. package/dist/components/calendar.css +140 -3
  23. package/dist/components/calendar.js +2 -2
  24. package/dist/components/calendar.min.css +2 -2
  25. package/dist/components/calendar.min.js +2 -2
  26. package/dist/components/card.css +1 -1
  27. package/dist/components/card.min.css +1 -1
  28. package/dist/components/checkbox.css +50 -6
  29. package/dist/components/checkbox.js +5 -3
  30. package/dist/components/checkbox.min.css +2 -2
  31. package/dist/components/checkbox.min.js +2 -2
  32. package/dist/components/comment.css +6 -1
  33. package/dist/components/comment.min.css +2 -2
  34. package/dist/components/container.css +62 -1
  35. package/dist/components/container.min.css +2 -2
  36. package/dist/components/dimmer.css +3 -3
  37. package/dist/components/dimmer.js +2 -2
  38. package/dist/components/dimmer.min.css +2 -2
  39. package/dist/components/dimmer.min.js +2 -2
  40. package/dist/components/divider.css +1 -1
  41. package/dist/components/divider.min.css +1 -1
  42. package/dist/components/dropdown.css +101 -25
  43. package/dist/components/dropdown.js +29 -21
  44. package/dist/components/dropdown.min.css +2 -2
  45. package/dist/components/dropdown.min.js +2 -2
  46. package/dist/components/embed.css +1 -1
  47. package/dist/components/embed.js +2 -2
  48. package/dist/components/embed.min.css +1 -1
  49. package/dist/components/embed.min.js +2 -2
  50. package/dist/components/emoji.css +697 -249
  51. package/dist/components/emoji.min.css +2 -2
  52. package/dist/components/feed.css +486 -5
  53. package/dist/components/feed.min.css +2 -2
  54. package/dist/components/flag.css +3 -2
  55. package/dist/components/flag.min.css +2 -2
  56. package/dist/components/flyout.css +1 -1
  57. package/dist/components/flyout.js +5 -3
  58. package/dist/components/flyout.min.css +1 -1
  59. package/dist/components/flyout.min.js +2 -2
  60. package/dist/components/form.css +34 -32
  61. package/dist/components/form.js +72 -31
  62. package/dist/components/form.min.css +2 -2
  63. package/dist/components/form.min.js +2 -2
  64. package/dist/components/grid.css +107 -107
  65. package/dist/components/grid.min.css +2 -2
  66. package/dist/components/header.css +1 -1
  67. package/dist/components/header.min.css +1 -1
  68. package/dist/components/icon.css +62 -62
  69. package/dist/components/icon.min.css +2 -2
  70. package/dist/components/image.css +1 -1
  71. package/dist/components/image.min.css +1 -1
  72. package/dist/components/input.css +3 -27
  73. package/dist/components/input.min.css +2 -2
  74. package/dist/components/item.css +6 -1
  75. package/dist/components/item.min.css +2 -2
  76. package/dist/components/label.css +21 -2
  77. package/dist/components/label.min.css +2 -2
  78. package/dist/components/list.css +13 -13
  79. package/dist/components/list.min.css +2 -2
  80. package/dist/components/loader.css +282 -282
  81. package/dist/components/loader.min.css +2 -2
  82. package/dist/components/menu.css +13 -7
  83. package/dist/components/menu.min.css +2 -2
  84. package/dist/components/message.css +1 -1
  85. package/dist/components/message.min.css +1 -1
  86. package/dist/components/modal.css +5 -1
  87. package/dist/components/modal.js +10 -10
  88. package/dist/components/modal.min.css +2 -2
  89. package/dist/components/modal.min.js +2 -2
  90. package/dist/components/nag.css +1 -1
  91. package/dist/components/nag.js +3 -3
  92. package/dist/components/nag.min.css +1 -1
  93. package/dist/components/nag.min.js +2 -2
  94. package/dist/components/placeholder.css +1 -1
  95. package/dist/components/placeholder.min.css +1 -1
  96. package/dist/components/popup.css +3 -3
  97. package/dist/components/popup.js +11 -9
  98. package/dist/components/popup.min.css +2 -2
  99. package/dist/components/popup.min.js +2 -2
  100. package/dist/components/progress.css +1 -1
  101. package/dist/components/progress.js +2 -2
  102. package/dist/components/progress.min.css +1 -1
  103. package/dist/components/progress.min.js +2 -2
  104. package/dist/components/rail.css +1 -1
  105. package/dist/components/rail.min.css +1 -1
  106. package/dist/components/rating.css +1 -1
  107. package/dist/components/rating.js +2 -2
  108. package/dist/components/rating.min.css +1 -1
  109. package/dist/components/rating.min.js +2 -2
  110. package/dist/components/reset.css +1 -1
  111. package/dist/components/reset.min.css +1 -1
  112. package/dist/components/reveal.css +1 -1
  113. package/dist/components/reveal.min.css +1 -1
  114. package/dist/components/search.css +26 -1
  115. package/dist/components/search.js +5 -4
  116. package/dist/components/search.min.css +2 -2
  117. package/dist/components/search.min.js +2 -2
  118. package/dist/components/segment.css +159 -33
  119. package/dist/components/segment.min.css +2 -2
  120. package/dist/components/shape.css +1 -1
  121. package/dist/components/shape.js +2 -2
  122. package/dist/components/shape.min.css +1 -1
  123. package/dist/components/shape.min.js +2 -2
  124. package/dist/components/sidebar.css +1 -1
  125. package/dist/components/sidebar.js +2 -2
  126. package/dist/components/sidebar.min.css +1 -1
  127. package/dist/components/sidebar.min.js +2 -2
  128. package/dist/components/site.css +1 -1
  129. package/dist/components/site.js +2 -2
  130. package/dist/components/site.min.css +1 -1
  131. package/dist/components/site.min.js +2 -2
  132. package/dist/components/slider.css +1 -1
  133. package/dist/components/slider.js +126 -26
  134. package/dist/components/slider.min.css +1 -1
  135. package/dist/components/slider.min.js +2 -2
  136. package/dist/components/state.js +2 -2
  137. package/dist/components/state.min.js +2 -2
  138. package/dist/components/statistic.css +1 -1
  139. package/dist/components/statistic.min.css +1 -1
  140. package/dist/components/step.css +1 -1
  141. package/dist/components/step.min.css +1 -1
  142. package/dist/components/sticky.css +1 -1
  143. package/dist/components/sticky.js +2 -2
  144. package/dist/components/sticky.min.css +1 -1
  145. package/dist/components/sticky.min.js +2 -2
  146. package/dist/components/tab.css +1 -1
  147. package/dist/components/tab.js +6 -4
  148. package/dist/components/tab.min.css +1 -1
  149. package/dist/components/tab.min.js +2 -2
  150. package/dist/components/table.css +65 -1
  151. package/dist/components/table.min.css +2 -2
  152. package/dist/components/text.css +1 -1
  153. package/dist/components/text.min.css +1 -1
  154. package/dist/components/toast.css +6 -1
  155. package/dist/components/toast.js +2 -2
  156. package/dist/components/toast.min.css +2 -2
  157. package/dist/components/toast.min.js +2 -2
  158. package/dist/components/transition.css +1 -1
  159. package/dist/components/transition.js +3 -3
  160. package/dist/components/transition.min.css +1 -1
  161. package/dist/components/transition.min.js +2 -2
  162. package/dist/components/visibility.js +2 -2
  163. package/dist/components/visibility.min.js +2 -2
  164. package/dist/semantic.css +2822 -954
  165. package/dist/semantic.js +312 -153
  166. package/dist/semantic.min.css +2 -2
  167. package/dist/semantic.min.js +2 -2
  168. package/package.json +4 -3
  169. package/scripts/nightly-version.js +2 -2
  170. package/src/definitions/behaviors/api.js +9 -8
  171. package/src/definitions/behaviors/form.js +71 -30
  172. package/src/definitions/behaviors/state.js +1 -1
  173. package/src/definitions/behaviors/visibility.js +1 -1
  174. package/src/definitions/collections/form.less +9 -14
  175. package/src/definitions/collections/grid.less +106 -106
  176. package/src/definitions/collections/menu.less +29 -22
  177. package/src/definitions/collections/table.less +66 -0
  178. package/src/definitions/elements/button.less +1 -1
  179. package/src/definitions/elements/container.less +63 -0
  180. package/src/definitions/elements/icon.less +5 -5
  181. package/src/definitions/elements/input.less +2 -2
  182. package/src/definitions/elements/label.less +21 -1
  183. package/src/definitions/elements/list.less +13 -13
  184. package/src/definitions/elements/loader.less +71 -71
  185. package/src/definitions/elements/segment.less +110 -13
  186. package/src/definitions/globals/site.js +1 -1
  187. package/src/definitions/modules/accordion.js +1 -1
  188. package/src/definitions/modules/calendar.js +1 -1
  189. package/src/definitions/modules/calendar.less +40 -11
  190. package/src/definitions/modules/checkbox.js +4 -2
  191. package/src/definitions/modules/checkbox.less +61 -5
  192. package/src/definitions/modules/dimmer.js +1 -1
  193. package/src/definitions/modules/dimmer.less +2 -2
  194. package/src/definitions/modules/dropdown.js +28 -20
  195. package/src/definitions/modules/dropdown.less +124 -21
  196. package/src/definitions/modules/embed.js +1 -1
  197. package/src/definitions/modules/flyout.js +4 -2
  198. package/src/definitions/modules/modal.js +9 -9
  199. package/src/definitions/modules/modal.less +6 -0
  200. package/src/definitions/modules/nag.js +2 -2
  201. package/src/definitions/modules/popup.js +10 -8
  202. package/src/definitions/modules/popup.less +4 -4
  203. package/src/definitions/modules/progress.js +1 -1
  204. package/src/definitions/modules/rating.js +1 -1
  205. package/src/definitions/modules/search.js +4 -3
  206. package/src/definitions/modules/search.less +31 -0
  207. package/src/definitions/modules/shape.js +1 -1
  208. package/src/definitions/modules/sidebar.js +1 -1
  209. package/src/definitions/modules/slider.js +125 -25
  210. package/src/definitions/modules/sticky.js +1 -1
  211. package/src/definitions/modules/tab.js +5 -3
  212. package/src/definitions/modules/toast.js +1 -1
  213. package/src/definitions/modules/toast.less +7 -0
  214. package/src/definitions/modules/transition.js +2 -2
  215. package/src/definitions/views/comment.less +7 -0
  216. package/src/definitions/views/feed.less +238 -32
  217. package/src/definitions/views/item.less +7 -0
  218. package/src/theme.less +1 -1
  219. package/src/themes/amazon/elements/button.variables +5 -1
  220. package/src/themes/bootstrap3/elements/button.variables +5 -1
  221. package/src/themes/chubby/elements/header.variables +6 -1
  222. package/src/themes/default/collections/message.variables +3 -9
  223. package/src/themes/default/collections/table.variables +11 -8
  224. package/src/themes/default/elements/button.variables +8 -10
  225. package/src/themes/default/elements/container.variables +3 -0
  226. package/src/themes/default/elements/emoji.variables +179 -67
  227. package/src/themes/default/elements/flag.variables +1 -1
  228. package/src/themes/default/elements/label.variables +6 -1
  229. package/src/themes/default/elements/segment.variables +8 -0
  230. package/src/themes/default/globals/site.variables +362 -341
  231. package/src/themes/default/globals/variation.variables +24 -1
  232. package/src/themes/default/modules/calendar.variables +11 -0
  233. package/src/themes/default/modules/checkbox.variables +12 -0
  234. package/src/themes/default/modules/dropdown.variables +10 -4
  235. package/src/themes/default/modules/modal.variables +3 -0
  236. package/src/themes/default/modules/popup.variables +1 -1
  237. package/src/themes/default/modules/search.variables +3 -0
  238. package/src/themes/default/modules/toast.variables +6 -5
  239. package/src/themes/default/views/card.variables +4 -12
  240. package/src/themes/default/views/feed.variables +55 -1
  241. package/src/themes/default/views/item.variables +5 -5
  242. package/src/themes/flat/collections/form.variables +4 -4
  243. package/src/themes/flat/globals/site.variables +1 -1
  244. package/src/themes/github/elements/button.variables +5 -1
  245. package/src/themes/joypixels/elements/emoji.variables +182 -70
  246. package/src/themes/material/globals/site.variables +1 -1
  247. package/src/themes/twitter/elements/button.variables +5 -1
  248. package/src/themes/twitter/elements/emoji.variables +178 -66
  249. package/tasks/admin/components/create.js +1 -2
  250. package/tasks/admin/components/init.js +3 -4
  251. package/tasks/admin/components/update.js +2 -3
  252. package/tasks/admin/distributions/create.js +9 -5
  253. package/tasks/admin/distributions/init.js +3 -4
  254. package/tasks/admin/distributions/update.js +2 -3
  255. package/tasks/config/project/install.js +3 -0
  256. package/tasks/config/tasks.js +1 -8
  257. package/tasks/config/user.js +1 -1
  258. package/tasks/docs/build.js +2 -2
  259. package/tasks/docs/metadata.js +1 -1
  260. package/tasks/docs/serve.js +1 -1
  261. package/tasks/install.js +19 -10
  262. package/tasks/watch.js +1 -2
  263. package/types/fomantic-ui-accordion.d.ts +244 -0
  264. package/types/fomantic-ui-api.d.ts +555 -0
  265. package/types/fomantic-ui-calendar.d.ts +766 -0
  266. package/types/fomantic-ui-checkbox.d.ts +332 -0
  267. package/types/fomantic-ui-dimmer.d.ts +408 -0
  268. package/types/fomantic-ui-dropdown.d.ts +1183 -0
  269. package/types/fomantic-ui-embed.d.ts +326 -0
  270. package/types/fomantic-ui-flyout.d.ts +525 -0
  271. package/types/fomantic-ui-form.d.ts +651 -0
  272. package/types/fomantic-ui-modal.d.ts +471 -0
  273. package/types/fomantic-ui-nag.d.ts +270 -0
  274. package/types/fomantic-ui-popup.d.ts +523 -0
  275. package/types/fomantic-ui-progress.d.ts +459 -0
  276. package/types/fomantic-ui-rating.d.ts +187 -0
  277. package/types/fomantic-ui-search.d.ts +496 -0
  278. package/types/fomantic-ui-shape.d.ts +274 -0
  279. package/types/fomantic-ui-sidebar.d.ts +402 -0
  280. package/types/fomantic-ui-slider.d.ts +316 -0
  281. package/types/fomantic-ui-sticky.d.ts +215 -0
  282. package/types/fomantic-ui-tab.d.ts +361 -0
  283. package/types/fomantic-ui-tests.ts +25 -0
  284. package/types/fomantic-ui-toast.d.ts +514 -0
  285. package/types/fomantic-ui-transition.d.ts +355 -0
  286. package/types/fomantic-ui-visibility.d.ts +355 -0
  287. package/types/index.d.ts +63 -0
  288. package/types/tsconfig.json +23 -0
  289. package/types/tslint.json +1 -0
@@ -290,7 +290,9 @@
290
290
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
291
291
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
292
292
  shouldRefreshInputs = true;
293
- ignoreAutofocus = false;
293
+ if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
294
+ ignoreAutofocus = false;
295
+ }
294
296
  }
295
297
  }
296
298
 
@@ -525,7 +527,7 @@
525
527
  },
526
528
  debounce: function (method, delay) {
527
529
  clearTimeout(module.timer);
528
- module.timer = setTimeout(method, delay);
530
+ module.timer = setTimeout(function () { method(); }, delay);
529
531
  },
530
532
  keyboard: function (event) {
531
533
  var
@@ -620,7 +622,7 @@
620
622
  ignoreRepeatedEvents = false;
621
623
  if (settings.allowMultiple) {
622
624
  if (module.others.active()) {
623
- $otherModals.filter('.' + className.active).find(selector.dimmer).addClass('active');
625
+ $otherModals.filter('.' + className.active).find(selector.dimmer).removeClass('out').addClass('transition fade in active');
624
626
  }
625
627
 
626
628
  if (settings.detachable) {
@@ -692,6 +694,8 @@
692
694
  onStart: function () {
693
695
  if (!module.others.active() && !module.others.animating() && !keepDimmed) {
694
696
  module.hideDimmer();
697
+ } else if (settings.allowMultiple) {
698
+ (hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('in').addClass('out');
695
699
  }
696
700
  if (settings.keyboardShortcuts && !module.others.active()) {
697
701
  module.remove.keyboardShortcuts();
@@ -704,11 +708,7 @@
704
708
  $previousModal.addClass(className.front);
705
709
  $module.removeClass(className.front);
706
710
 
707
- if (hideOthersToo) {
708
- $allModals.find(selector.dimmer).removeClass('active');
709
- } else {
710
- $previousModal.find(selector.dimmer).removeClass('active');
711
- }
711
+ (hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('active');
712
712
  }
713
713
  if (isFunction(settings.onHidden)) {
714
714
  settings.onHidden.call(element);
@@ -1273,7 +1273,7 @@
1273
1273
  });
1274
1274
  }
1275
1275
  clearTimeout(module.performance.timer);
1276
- module.performance.timer = setTimeout(module.performance.display, 500);
1276
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1277
1277
  },
1278
1278
  display: function () {
1279
1279
  var
@@ -481,6 +481,12 @@
481
481
  overflow: auto;
482
482
  overscroll-behavior: @overscrollBehavior;
483
483
  }
484
+ & when (@variationTableResizable) {
485
+ .ui.modal > .resizable.scrolling.content {
486
+ resize: @resizableDirection;
487
+ max-height: none;
488
+ }
489
+ }
484
490
  }
485
491
 
486
492
  & when (@variationModalOverlay) {
@@ -88,7 +88,7 @@
88
88
  }
89
89
 
90
90
  if (settings.displayTime > 0) {
91
- setTimeout(module.hide, settings.displayTime);
91
+ setTimeout(function () { module.hide(); }, settings.displayTime);
92
92
  }
93
93
  module.show();
94
94
  },
@@ -377,7 +377,7 @@
377
377
  });
378
378
  }
379
379
  clearTimeout(module.performance.timer);
380
- module.performance.timer = setTimeout(module.performance.display, 500);
380
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
381
381
  },
382
382
  display: function () {
383
383
  var
@@ -194,7 +194,7 @@
194
194
  ;
195
195
  clearTimeout(module.hideTimer);
196
196
  if (!openedWithTouch || (openedWithTouch && settings.addTouchEvents)) {
197
- module.showTimer = setTimeout(module.show, delay);
197
+ module.showTimer = setTimeout(function () { module.show(); }, delay);
198
198
  }
199
199
  },
200
200
  end: function () {
@@ -204,7 +204,7 @@
204
204
  : settings.delay
205
205
  ;
206
206
  clearTimeout(module.showTimer);
207
- module.hideTimer = setTimeout(module.hide, delay);
207
+ module.hideTimer = setTimeout(function () { module.hide(); }, delay);
208
208
  },
209
209
  touchstart: function (event) {
210
210
  openedWithTouch = true;
@@ -248,9 +248,11 @@
248
248
  // generates popup html from metadata
249
249
  create: function () {
250
250
  var
251
+ targetSibling = $target.next(selector.popup),
252
+ contentFallback = !settings.popup && targetSibling.length === 0 ? $module.attr('title') : false,
251
253
  html = module.get.html(),
252
254
  title = module.get.title(),
253
- content = module.get.content()
255
+ content = module.get.content(contentFallback)
254
256
  ;
255
257
 
256
258
  if (html || content || title) {
@@ -291,10 +293,10 @@
291
293
  if (settings.hoverable) {
292
294
  module.bind.popup();
293
295
  }
294
- } else if ($target.next(selector.popup).length > 0) {
296
+ } else if (targetSibling.length > 0) {
295
297
  module.verbose('Pre-existing popup found');
296
298
  settings.inline = true;
297
- settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
299
+ settings.popup = targetSibling.data(metadata.activator, $module);
298
300
  module.refresh();
299
301
  if (settings.hoverable) {
300
302
  module.bind.popup();
@@ -484,10 +486,10 @@
484
486
 
485
487
  return $module.data(metadata.title) || settings.title;
486
488
  },
487
- content: function () {
489
+ content: function (fallback) {
488
490
  $module.removeData(metadata.content);
489
491
 
490
- return $module.data(metadata.content) || settings.content || $module.attr('title');
492
+ return $module.data(metadata.content) || settings.content || fallback;
491
493
  },
492
494
  variation: function () {
493
495
  $module.removeData(metadata.variation);
@@ -1242,7 +1244,7 @@
1242
1244
  });
1243
1245
  }
1244
1246
  clearTimeout(module.performance.timer);
1245
- module.performance.timer = setTimeout(module.performance.display, 500);
1247
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1246
1248
  },
1247
1249
  display: function () {
1248
1250
  var
@@ -117,7 +117,6 @@
117
117
  [data-tooltip]::before,
118
118
  [data-tooltip]::after {
119
119
  pointer-events: none;
120
- visibility: hidden;
121
120
  opacity: 0;
122
121
  transition:
123
122
  transform @tooltipDuration @tooltipEasing,
@@ -138,9 +137,10 @@
138
137
  [data-tooltip]::after {
139
138
  transform-origin: center bottom;
140
139
  }
140
+ [data-tooltip][data-variation~="visible"]::before,
141
+ [data-tooltip][data-variation~="visible"]::after,
141
142
  [data-tooltip]:hover::before,
142
143
  [data-tooltip]:hover::after {
143
- visibility: visible;
144
144
  pointer-events: auto;
145
145
  opacity: 1;
146
146
  }
@@ -833,8 +833,8 @@
833
833
  @color: @value;
834
834
  @c: @colors[@@color][color];
835
835
  @l: @colors[@@color][light];
836
- @cl: lighten(@c, @loadingColoredPercent);
837
- @ll: darken(@l, @loadingColoredPercent);
836
+ @cl: if(iscolor(@c), lighten(@c, @loadingColoredPercent), @c);
837
+ @ll: if(iscolor(@l), darken(@l, @loadingColoredPercent), @l);
838
838
 
839
839
  & when not (@variationPopupTooltip) {
840
840
  .ui.ui.ui.@{color}.popup::before,
@@ -791,7 +791,7 @@
791
791
  });
792
792
  }
793
793
  clearTimeout(module.performance.timer);
794
- module.performance.timer = setTimeout(module.performance.display, 500);
794
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
795
795
  },
796
796
  display: function () {
797
797
  var
@@ -368,7 +368,7 @@
368
368
  });
369
369
  }
370
370
  clearTimeout(module.performance.timer);
371
- module.performance.timer = setTimeout(module.performance.display, 500);
371
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
372
372
  },
373
373
  display: function () {
374
374
  var
@@ -169,7 +169,7 @@
169
169
  callback = function () {
170
170
  module.cancel.query();
171
171
  module.remove.focus();
172
- module.timer = setTimeout(module.hideResults, settings.hideDelay);
172
+ module.timer = setTimeout(function () { module.hideResults(); }, settings.hideDelay);
173
173
  }
174
174
  ;
175
175
  if (pageLostFocus) {
@@ -561,6 +561,7 @@
561
561
  if (cache) {
562
562
  module.debug('Reading result from cache', searchTerm);
563
563
  module.save.results(cache.results);
564
+ settings.onResults.call(element, cache.results, true);
564
565
  module.addResults(cache.html);
565
566
  module.inject.id(cache.results);
566
567
  callback();
@@ -1170,7 +1171,7 @@
1170
1171
  });
1171
1172
  }
1172
1173
  clearTimeout(module.performance.timer);
1173
- module.performance.timer = setTimeout(module.performance.display, 500);
1174
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1174
1175
  },
1175
1176
  display: function () {
1176
1177
  var
@@ -1345,7 +1346,7 @@
1345
1346
  onResultsAdd: false,
1346
1347
 
1347
1348
  onSearchQuery: function (query) {},
1348
- onResults: function (response) {},
1349
+ onResults: function (response, fromCache) {},
1349
1350
 
1350
1351
  onResultsOpen: function () {},
1351
1352
  onResultsClose: function () {},
@@ -367,6 +367,19 @@
367
367
  transition: @categoryResultTransition;
368
368
  padding: @categoryResultPadding;
369
369
  }
370
+
371
+ & when (@variationSearchHorizontalCategory) {
372
+ .ui.horizontal.category.search > .results .category,
373
+ .ui.horizontal.category.search > .results .category > .name,
374
+ .ui.horizontal.category.search > .results .category > .results {
375
+ display: block;
376
+ }
377
+
378
+ .ui.horizontal.category.search > .results .category > .results {
379
+ width: 100%;
380
+ border-left: 0;
381
+ }
382
+ }
370
383
  }
371
384
 
372
385
  /*******************************
@@ -394,21 +407,39 @@
394
407
  @media only screen and (max-width: @largestMobileScreen) {
395
408
  .ui.scrolling.search > .results {
396
409
  max-height: @scrollingMobileMaxResultsHeight;
410
+ .resizable& when (@variationSearchResizable) {
411
+ height: @scrollingMobileMaxResultsHeight;
412
+ }
397
413
  }
398
414
  }
399
415
  @media only screen and (min-width: @tabletBreakpoint) {
400
416
  .ui.scrolling.search > .results {
401
417
  max-height: @scrollingTabletMaxResultsHeight;
418
+ .resizable& when (@variationSearchResizable) {
419
+ height: @scrollingTabletMaxResultsHeight;
420
+ }
402
421
  }
403
422
  }
404
423
  @media only screen and (min-width: @computerBreakpoint) {
405
424
  .ui.scrolling.search > .results {
406
425
  max-height: @scrollingComputerMaxResultsHeight;
426
+ .resizable& when (@variationSearchResizable) {
427
+ height: @scrollingComputerMaxResultsHeight;
428
+ }
407
429
  }
408
430
  }
409
431
  @media only screen and (min-width: @widescreenMonitorBreakpoint) {
410
432
  .ui.scrolling.search > .results {
411
433
  max-height: @scrollingWidescreenMaxResultsHeight;
434
+ .resizable& when (@variationSearchResizable) {
435
+ height: @scrollingWidescreenMaxResultsHeight;
436
+ }
437
+ }
438
+ }
439
+ & when (@variationSearchResizable) {
440
+ .ui.scrolling.resizable.search > .results {
441
+ resize: @resizableDirection;
442
+ max-height: none;
412
443
  }
413
444
  }
414
445
  }
@@ -623,7 +623,7 @@
623
623
  });
624
624
  }
625
625
  clearTimeout(module.performance.timer);
626
- module.performance.timer = setTimeout(module.performance.display, 500);
626
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
627
627
  },
628
628
  display: function () {
629
629
  var
@@ -898,7 +898,7 @@
898
898
  });
899
899
  }
900
900
  clearTimeout(module.performance.timer);
901
- module.performance.timer = setTimeout(module.performance.display, 500);
901
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
902
902
  },
903
903
  display: function () {
904
904
  var
@@ -135,20 +135,32 @@
135
135
  $module.attr('tabindex', 0);
136
136
  }
137
137
  if ($module.find('.inner').length === 0) {
138
- $module.append("<div class='inner'>"
139
- + "<div class='track'></div>"
140
- + "<div class='track-fill'></div>"
141
- + "<div class='thumb'></div>"
138
+ $module.append('<div class="inner">'
139
+ + '<div class="track"></div>'
140
+ + '<div class="track-fill"></div>'
141
+ + '<div class="thumb"></div>'
142
142
  + '</div>');
143
143
  }
144
144
  precision = module.get.precision();
145
145
  $thumb = $module.find('.thumb:not(.second)');
146
+ if (settings.showThumbTooltip) {
147
+ $thumb
148
+ .attr('data-position', settings.tooltipConfig.position)
149
+ .attr('data-variation', settings.tooltipConfig.variation)
150
+ ;
151
+ }
146
152
  $currThumb = $thumb;
147
153
  if (module.is.range()) {
148
154
  if ($module.find('.thumb.second').length === 0) {
149
- $module.find('.inner').append("<div class='thumb second'></div>");
155
+ $module.find('.inner').append('<div class="thumb second"></div>');
150
156
  }
151
157
  $secondThumb = $module.find('.thumb.second');
158
+ if (settings.showThumbTooltip) {
159
+ $secondThumb
160
+ .attr('data-position', settings.tooltipConfig.position)
161
+ .attr('data-variation', settings.tooltipConfig.variation)
162
+ ;
163
+ }
152
164
  }
153
165
  $track = $module.find('.track');
154
166
  $trackFill = $module.find('.track-fill');
@@ -202,9 +214,10 @@
202
214
  for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
203
215
  var
204
216
  labelText = module.get.label(i),
205
- $label = labelText !== ''
217
+ showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.indexOf(labelText) >= 0,
218
+ $label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
206
219
  ? (!(i % module.get.gapRatio())
207
- ? $('<li class="label">' + labelText + '</li>')
220
+ ? $('<li class="label">' + (showLabel ? labelText : '') + '</li>')
208
221
  : $('<li class="halftick label"></li>'))
209
222
  : null,
210
223
  ratio = i / len
@@ -348,6 +361,18 @@
348
361
  ;
349
362
  $currThumb = initialPosition > newPos ? $thumb : $secondThumb;
350
363
  }
364
+ if (module.is.range() && (settings.minRange || settings.maxRange)) {
365
+ var currentRangeDiff = module.get.currentRangeDiff(value),
366
+ isSecondThumb = $currThumb.hasClass('second')
367
+ ;
368
+ if ((settings.minRange && currentRangeDiff < settings.minRange)
369
+ || (settings.maxRange && currentRangeDiff > settings.maxRange)
370
+ || (settings.preventCrossover && !isSecondThumb && value > module.secondThumbVal)
371
+ || (settings.preventCrossover && isSecondThumb && value < module.thumbVal)
372
+ ) {
373
+ return;
374
+ }
375
+ }
351
376
  if (module.get.step() === 0 || module.is.smooth()) {
352
377
  var
353
378
  thumbVal = module.thumbVal,
@@ -383,6 +408,17 @@
383
408
  return;
384
409
  }
385
410
  var value = module.determine.valueFromEvent(event);
411
+ if (module.is.range() && (settings.minRange || settings.maxRange)) {
412
+ if ($currThumb === undefined) {
413
+ $currThumb = value <= module.get.currentThumbValue() ? $thumb : $secondThumb;
414
+ }
415
+ var currentRangeDiff = module.get.currentRangeDiff(value);
416
+ if (settings.minRange && currentRangeDiff < settings.minRange) {
417
+ value = module.get.edgeValue(value, settings.minRange);
418
+ } else if (settings.maxRange && currentRangeDiff > settings.maxRange) {
419
+ value = module.get.edgeValue(value, settings.maxRange);
420
+ }
421
+ }
386
422
  module.set.value(value);
387
423
  module.unbind.slidingEvents();
388
424
  touchIdentifier = undefined;
@@ -503,7 +539,13 @@
503
539
 
504
540
  is: {
505
541
  range: function () {
506
- return $module.hasClass(settings.className.range);
542
+ var isRange = $module.hasClass(className.range);
543
+ if (!isRange && (settings.minRange || settings.maxRange)) {
544
+ $module.addClass(className.range);
545
+ isRange = true;
546
+ }
547
+
548
+ return isRange;
507
549
  },
508
550
  hover: function () {
509
551
  return isHover;
@@ -512,23 +554,56 @@
512
554
  return $module.is(':focus');
513
555
  },
514
556
  disabled: function () {
515
- return $module.hasClass(settings.className.disabled);
557
+ return $module.hasClass(className.disabled);
516
558
  },
517
559
  labeled: function () {
518
- return $module.hasClass(settings.className.labeled);
560
+ var isLabeled = $module.hasClass(className.labeled);
561
+ if (!isLabeled && (settings.restrictedLabels.length > 0 || settings.showLabelTicks !== false)) {
562
+ $module.addClass(className.labeled);
563
+ isLabeled = true;
564
+ }
565
+
566
+ return isLabeled;
519
567
  },
520
568
  reversed: function () {
521
- return $module.hasClass(settings.className.reversed);
569
+ return $module.hasClass(className.reversed);
522
570
  },
523
571
  vertical: function () {
524
- return $module.hasClass(settings.className.vertical);
572
+ return $module.hasClass(className.vertical);
525
573
  },
526
574
  smooth: function () {
527
- return settings.smooth || $module.hasClass(settings.className.smooth);
575
+ return settings.smooth || $module.hasClass(className.smooth);
528
576
  },
529
577
  },
530
578
 
531
579
  get: {
580
+ currentRangeDiff: function (value) {
581
+ var currentRangeDiff;
582
+ if ($currThumb.hasClass('second')) {
583
+ currentRangeDiff = module.thumbVal < value
584
+ ? value - module.thumbVal
585
+ : module.thumbVal - value;
586
+ } else {
587
+ currentRangeDiff = module.secondThumbVal > value
588
+ ? module.secondThumbVal - value
589
+ : value - module.secondThumbVal;
590
+ }
591
+
592
+ return currentRangeDiff;
593
+ },
594
+ edgeValue: function (value, edgeValue) {
595
+ if ($currThumb.hasClass('second')) {
596
+ value = module.thumbVal < value
597
+ ? module.thumbVal + edgeValue
598
+ : module.thumbVal - edgeValue;
599
+ } else {
600
+ value = module.secondThumbVal < value
601
+ ? module.secondThumbVal + edgeValue
602
+ : module.secondThumbVal - edgeValue;
603
+ }
604
+
605
+ return value;
606
+ },
532
607
  trackOffset: function () {
533
608
  if (module.is.vertical()) {
534
609
  return $track.offset().top;
@@ -599,7 +674,8 @@
599
674
  var
600
675
  step = module.get.step(),
601
676
  min = module.get.min(),
602
- quotient = step === 0 ? 0 : Math.floor((settings.max - min) / step),
677
+ precision = module.get.precision(),
678
+ quotient = step === 0 ? 0 : Math.floor(Math.round(((settings.max - min) / step) * precision) / precision),
603
679
  remainder = step === 0 ? 0 : (settings.max - min) % step
604
680
  ;
605
681
 
@@ -609,7 +685,9 @@
609
685
  return settings.step;
610
686
  },
611
687
  numLabels: function () {
612
- var value = Math.round((module.get.max() - module.get.min()) / (module.get.step() === 0 ? 1 : module.get.step()));
688
+ var step = module.get.step(),
689
+ precision = module.get.precision(),
690
+ value = Math.round(((module.get.max() - module.get.min()) / (step === 0 ? 1 : step)) * precision) / precision;
613
691
  module.debug('Determined that there should be ' + value + ' labels');
614
692
 
615
693
  return value;
@@ -624,7 +702,9 @@
624
702
 
625
703
  switch (settings.labelType) {
626
704
  case settings.labelTypes.number: {
627
- return Math.round(((value * (module.get.step() === 0 ? 1 : module.get.step())) + module.get.min()) * precision) / precision;
705
+ var step = module.get.step();
706
+
707
+ return Math.round(((value * (step === 0 ? 1 : step)) + module.get.min()) * precision) / precision;
628
708
  }
629
709
  case settings.labelTypes.letter: {
630
710
  return alphabet[value % 26];
@@ -732,13 +812,10 @@
732
812
  return thumbDelta <= secondThumbDelta ? thumbPos : secondThumbPos;
733
813
  },
734
814
  thumbPos: function ($element) {
735
- var
736
- pos = module.is.vertical()
737
- ? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
738
- : (module.is.reversed() ? $element.css('right') : $element.css('left'))
815
+ return module.is.vertical()
816
+ ? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
817
+ : (module.is.reversed() ? $element.css('right') : $element.css('left'))
739
818
  ;
740
-
741
- return pos;
742
819
  },
743
820
  positionFromValue: function (val) {
744
821
  var
@@ -762,6 +839,7 @@
762
839
  position = Math.round(ratio * trackLength),
763
840
  adjustedPos = step === 0 ? position : Math.round(position / step) * step
764
841
  ;
842
+ module.verbose('Determined position: ' + position + ' from ratio: ' + ratio);
765
843
 
766
844
  return adjustedPos;
767
845
  },
@@ -985,12 +1063,12 @@
985
1063
  }
986
1064
  if (!$currThumb.hasClass('second')) {
987
1065
  if (settings.preventCrossover && module.is.range()) {
988
- newValue = Math.min(module.secondThumbVal, newValue);
1066
+ newValue = Math.min(module.secondThumbVal - (settings.minRange || 0), newValue);
989
1067
  }
990
1068
  module.thumbVal = newValue;
991
1069
  } else {
992
1070
  if (settings.preventCrossover && module.is.range()) {
993
- newValue = Math.max(module.thumbVal, newValue);
1071
+ newValue = Math.max(module.thumbVal + (settings.minRange || 0), newValue);
994
1072
  }
995
1073
  module.secondThumbVal = newValue;
996
1074
  }
@@ -1009,6 +1087,10 @@
1009
1087
  thumbVal = module.thumbVal || module.get.min(),
1010
1088
  secondThumbVal = module.secondThumbVal || module.get.min()
1011
1089
  ;
1090
+ if (settings.showThumbTooltip) {
1091
+ var precision = module.get.precision();
1092
+ $targetThumb.attr('data-tooltip', Math.round(newValue * precision) / precision);
1093
+ }
1012
1094
  if (module.is.range()) {
1013
1095
  if (!$targetThumb.hasClass('second')) {
1014
1096
  position = newPos;
@@ -1097,6 +1179,14 @@
1097
1179
  settings: function () {
1098
1180
  if (settings.start !== false) {
1099
1181
  if (module.is.range()) {
1182
+ var rangeDiff = settings.end - settings.start;
1183
+ if (rangeDiff < 0
1184
+ || (settings.minRange && rangeDiff < settings.minRange)
1185
+ || (settings.maxRange && rangeDiff > settings.maxRange)
1186
+ || (settings.minRange && settings.maxRange && settings.minRange > settings.maxRange)
1187
+ ) {
1188
+ module.error(error.invalidRanges, settings.start, settings.end, settings.minRange, settings.maxRange);
1189
+ }
1100
1190
  module.debug('Start position set from settings', settings.start, settings.end);
1101
1191
  module.set.rangeValue(settings.start, settings.end);
1102
1192
  } else {
@@ -1177,7 +1267,7 @@
1177
1267
  });
1178
1268
  }
1179
1269
  clearTimeout(module.performance.timer);
1180
- module.performance.timer = setTimeout(module.performance.display, 500);
1270
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1181
1271
  },
1182
1272
  display: function () {
1183
1273
  var
@@ -1289,6 +1379,7 @@
1289
1379
  error: {
1290
1380
  method: 'The method you called is not defined.',
1291
1381
  notrange: 'This slider is not a range slider',
1382
+ invalidRanges: 'Invalid range settings (start/end/minRange/maxRange)',
1292
1383
  },
1293
1384
 
1294
1385
  metadata: {
@@ -1301,6 +1392,8 @@
1301
1392
  step: 1,
1302
1393
  start: 0,
1303
1394
  end: 20,
1395
+ minRange: false,
1396
+ maxRange: false,
1304
1397
  labelType: 'number',
1305
1398
  showLabelTicks: false,
1306
1399
  smooth: false,
@@ -1337,6 +1430,13 @@
1337
1430
  downArrow: 40,
1338
1431
  },
1339
1432
 
1433
+ restrictedLabels: [],
1434
+ showThumbTooltip: false,
1435
+ tooltipConfig: {
1436
+ position: 'top center',
1437
+ variation: 'tiny black',
1438
+ },
1439
+
1340
1440
  labelTypes: {
1341
1441
  number: 'number',
1342
1442
  letter: 'letter',
@@ -746,7 +746,7 @@
746
746
  });
747
747
  }
748
748
  clearTimeout(module.performance.timer);
749
- module.performance.timer = setTimeout(module.performance.display, 0);
749
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 0);
750
750
  },
751
751
  display: function () {
752
752
  var