fomantic-ui 2.9.3-beta.2 → 2.9.3-beta.20

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 (246) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/dist/components/accordion.css +1 -1
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/accordion.min.css +1 -1
  5. package/dist/components/accordion.min.js +1 -1
  6. package/dist/components/ad.css +1 -1
  7. package/dist/components/ad.min.css +1 -1
  8. package/dist/components/api.js +1 -1
  9. package/dist/components/api.min.js +1 -1
  10. package/dist/components/breadcrumb.css +1 -1
  11. package/dist/components/breadcrumb.min.css +1 -1
  12. package/dist/components/button.css +2 -2
  13. package/dist/components/button.min.css +2 -2
  14. package/dist/components/calendar.css +6 -6
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/calendar.min.css +2 -2
  17. package/dist/components/calendar.min.js +1 -1
  18. package/dist/components/card.css +1 -1
  19. package/dist/components/card.min.css +1 -1
  20. package/dist/components/checkbox.css +1 -1
  21. package/dist/components/checkbox.js +1 -1
  22. package/dist/components/checkbox.min.css +1 -1
  23. package/dist/components/checkbox.min.js +1 -1
  24. package/dist/components/comment.css +1 -1
  25. package/dist/components/comment.min.css +1 -1
  26. package/dist/components/container.css +62 -1
  27. package/dist/components/container.min.css +2 -2
  28. package/dist/components/dimmer.css +3 -3
  29. package/dist/components/dimmer.js +1 -1
  30. package/dist/components/dimmer.min.css +2 -2
  31. package/dist/components/dimmer.min.js +1 -1
  32. package/dist/components/divider.css +1 -1
  33. package/dist/components/divider.min.css +1 -1
  34. package/dist/components/dropdown.css +42 -4
  35. package/dist/components/dropdown.js +22 -12
  36. package/dist/components/dropdown.min.css +2 -2
  37. package/dist/components/dropdown.min.js +2 -2
  38. package/dist/components/embed.css +1 -1
  39. package/dist/components/embed.js +1 -1
  40. package/dist/components/embed.min.css +1 -1
  41. package/dist/components/embed.min.js +1 -1
  42. package/dist/components/emoji.css +1 -1
  43. package/dist/components/emoji.min.css +1 -1
  44. package/dist/components/feed.css +1 -1
  45. package/dist/components/feed.min.css +1 -1
  46. package/dist/components/flag.css +3 -2
  47. package/dist/components/flag.min.css +2 -2
  48. package/dist/components/flyout.css +1 -1
  49. package/dist/components/flyout.js +26 -20
  50. package/dist/components/flyout.min.css +1 -1
  51. package/dist/components/flyout.min.js +2 -2
  52. package/dist/components/form.css +53 -20
  53. package/dist/components/form.js +74 -43
  54. package/dist/components/form.min.css +2 -2
  55. package/dist/components/form.min.js +2 -2
  56. package/dist/components/grid.css +107 -107
  57. package/dist/components/grid.min.css +2 -2
  58. package/dist/components/header.css +1 -1
  59. package/dist/components/header.min.css +1 -1
  60. package/dist/components/icon.css +1 -1
  61. package/dist/components/icon.min.css +1 -1
  62. package/dist/components/image.css +1 -1
  63. package/dist/components/image.min.css +1 -1
  64. package/dist/components/input.css +3 -27
  65. package/dist/components/input.min.css +2 -2
  66. package/dist/components/item.css +1 -1
  67. package/dist/components/item.min.css +1 -1
  68. package/dist/components/label.css +21 -2
  69. package/dist/components/label.min.css +2 -2
  70. package/dist/components/list.css +13 -13
  71. package/dist/components/list.min.css +2 -2
  72. package/dist/components/loader.css +282 -282
  73. package/dist/components/loader.min.css +2 -2
  74. package/dist/components/menu.css +9 -3
  75. package/dist/components/menu.min.css +2 -2
  76. package/dist/components/message.css +1 -1
  77. package/dist/components/message.min.css +1 -1
  78. package/dist/components/modal.css +10 -3
  79. package/dist/components/modal.js +31 -26
  80. package/dist/components/modal.min.css +2 -2
  81. package/dist/components/modal.min.js +2 -2
  82. package/dist/components/nag.css +1 -1
  83. package/dist/components/nag.js +1 -1
  84. package/dist/components/nag.min.css +1 -1
  85. package/dist/components/nag.min.js +1 -1
  86. package/dist/components/placeholder.css +1 -1
  87. package/dist/components/placeholder.min.css +1 -1
  88. package/dist/components/popup.css +41 -40
  89. package/dist/components/popup.js +8 -6
  90. package/dist/components/popup.min.css +2 -2
  91. package/dist/components/popup.min.js +2 -2
  92. package/dist/components/progress.css +1 -1
  93. package/dist/components/progress.js +1 -1
  94. package/dist/components/progress.min.css +1 -1
  95. package/dist/components/progress.min.js +1 -1
  96. package/dist/components/rail.css +1 -1
  97. package/dist/components/rail.min.css +1 -1
  98. package/dist/components/rating.css +1 -1
  99. package/dist/components/rating.js +1 -1
  100. package/dist/components/rating.min.css +1 -1
  101. package/dist/components/rating.min.js +1 -1
  102. package/dist/components/reset.css +1 -1
  103. package/dist/components/reset.min.css +1 -1
  104. package/dist/components/reveal.css +1 -1
  105. package/dist/components/reveal.min.css +1 -1
  106. package/dist/components/search.css +17 -1
  107. package/dist/components/search.js +3 -2
  108. package/dist/components/search.min.css +2 -2
  109. package/dist/components/search.min.js +2 -2
  110. package/dist/components/segment.css +159 -33
  111. package/dist/components/segment.min.css +2 -2
  112. package/dist/components/shape.css +1 -1
  113. package/dist/components/shape.js +1 -1
  114. package/dist/components/shape.min.css +1 -1
  115. package/dist/components/shape.min.js +1 -1
  116. package/dist/components/sidebar.css +1 -1
  117. package/dist/components/sidebar.js +1 -1
  118. package/dist/components/sidebar.min.css +1 -1
  119. package/dist/components/sidebar.min.js +1 -1
  120. package/dist/components/site.css +1 -1
  121. package/dist/components/site.js +1 -1
  122. package/dist/components/site.min.css +1 -1
  123. package/dist/components/site.min.js +1 -1
  124. package/dist/components/slider.css +1 -1
  125. package/dist/components/slider.js +122 -26
  126. package/dist/components/slider.min.css +1 -1
  127. package/dist/components/slider.min.js +2 -2
  128. package/dist/components/state.js +1 -1
  129. package/dist/components/state.min.js +1 -1
  130. package/dist/components/statistic.css +1 -1
  131. package/dist/components/statistic.min.css +1 -1
  132. package/dist/components/step.css +1 -1
  133. package/dist/components/step.min.css +1 -1
  134. package/dist/components/sticky.css +1 -1
  135. package/dist/components/sticky.js +1 -1
  136. package/dist/components/sticky.min.css +1 -1
  137. package/dist/components/sticky.min.js +1 -1
  138. package/dist/components/tab.css +1 -1
  139. package/dist/components/tab.js +1 -1
  140. package/dist/components/tab.min.css +1 -1
  141. package/dist/components/tab.min.js +1 -1
  142. package/dist/components/table.css +65 -1
  143. package/dist/components/table.min.css +2 -2
  144. package/dist/components/text.css +1 -1
  145. package/dist/components/text.min.css +1 -1
  146. package/dist/components/toast.css +6 -1
  147. package/dist/components/toast.js +2 -2
  148. package/dist/components/toast.min.css +2 -2
  149. package/dist/components/toast.min.js +2 -2
  150. package/dist/components/transition.css +1 -1
  151. package/dist/components/transition.js +1 -1
  152. package/dist/components/transition.min.css +1 -1
  153. package/dist/components/transition.min.js +1 -1
  154. package/dist/components/visibility.js +1 -1
  155. package/dist/components/visibility.min.js +1 -1
  156. package/dist/semantic.css +1055 -593
  157. package/dist/semantic.js +306 -155
  158. package/dist/semantic.min.css +2 -2
  159. package/dist/semantic.min.js +2 -2
  160. package/package.json +1 -1
  161. package/src/definitions/behaviors/form.js +73 -42
  162. package/src/definitions/collections/breadcrumb.less +2 -1
  163. package/src/definitions/collections/form.less +27 -13
  164. package/src/definitions/collections/grid.less +108 -107
  165. package/src/definitions/collections/menu.less +29 -21
  166. package/src/definitions/collections/message.less +2 -1
  167. package/src/definitions/collections/table.less +68 -1
  168. package/src/definitions/elements/button.less +4 -2
  169. package/src/definitions/elements/container.less +65 -1
  170. package/src/definitions/elements/divider.less +2 -1
  171. package/src/definitions/elements/emoji.less +2 -1
  172. package/src/definitions/elements/flag.less +2 -1
  173. package/src/definitions/elements/header.less +2 -1
  174. package/src/definitions/elements/icon.less +2 -1
  175. package/src/definitions/elements/image.less +2 -1
  176. package/src/definitions/elements/input.less +4 -3
  177. package/src/definitions/elements/label.less +23 -2
  178. package/src/definitions/elements/list.less +14 -13
  179. package/src/definitions/elements/loader.less +73 -72
  180. package/src/definitions/elements/placeholder.less +2 -1
  181. package/src/definitions/elements/rail.less +2 -1
  182. package/src/definitions/elements/reveal.less +2 -1
  183. package/src/definitions/elements/segment.less +112 -14
  184. package/src/definitions/elements/step.less +2 -1
  185. package/src/definitions/elements/text.less +2 -1
  186. package/src/definitions/globals/reset.less +2 -1
  187. package/src/definitions/globals/site.less +2 -1
  188. package/src/definitions/modules/accordion.less +2 -1
  189. package/src/definitions/modules/calendar.less +3 -2
  190. package/src/definitions/modules/checkbox.less +2 -1
  191. package/src/definitions/modules/dimmer.less +4 -3
  192. package/src/definitions/modules/dropdown.js +21 -11
  193. package/src/definitions/modules/dropdown.less +55 -4
  194. package/src/definitions/modules/embed.less +2 -1
  195. package/src/definitions/modules/flyout.js +25 -19
  196. package/src/definitions/modules/flyout.less +2 -1
  197. package/src/definitions/modules/modal.js +30 -25
  198. package/src/definitions/modules/modal.less +13 -3
  199. package/src/definitions/modules/nag.less +3 -1
  200. package/src/definitions/modules/popup.js +7 -5
  201. package/src/definitions/modules/popup.less +42 -39
  202. package/src/definitions/modules/progress.less +2 -1
  203. package/src/definitions/modules/rating.less +2 -1
  204. package/src/definitions/modules/search.js +2 -1
  205. package/src/definitions/modules/search.less +20 -1
  206. package/src/definitions/modules/shape.less +2 -1
  207. package/src/definitions/modules/sidebar.less +2 -1
  208. package/src/definitions/modules/slider.js +121 -25
  209. package/src/definitions/modules/slider.less +2 -1
  210. package/src/definitions/modules/sticky.less +2 -1
  211. package/src/definitions/modules/tab.less +2 -1
  212. package/src/definitions/modules/toast.js +1 -1
  213. package/src/definitions/modules/toast.less +9 -1
  214. package/src/definitions/modules/transition.less +2 -1
  215. package/src/definitions/views/ad.less +2 -1
  216. package/src/definitions/views/card.less +2 -1
  217. package/src/definitions/views/comment.less +2 -1
  218. package/src/definitions/views/feed.less +2 -1
  219. package/src/definitions/views/item.less +2 -1
  220. package/src/definitions/views/statistic.less +2 -1
  221. package/src/overrides.less +7 -0
  222. package/src/theme.less +7 -6
  223. package/src/themes/amazon/elements/button.variables +5 -1
  224. package/src/themes/bootstrap3/elements/button.variables +5 -1
  225. package/src/themes/chubby/elements/header.variables +6 -1
  226. package/src/themes/default/collections/message.variables +3 -9
  227. package/src/themes/default/collections/table.variables +3 -0
  228. package/src/themes/default/elements/button.variables +1 -3
  229. package/src/themes/default/elements/container.variables +3 -0
  230. package/src/themes/default/elements/flag.variables +1 -1
  231. package/src/themes/default/elements/label.variables +5 -0
  232. package/src/themes/default/elements/segment.variables +8 -0
  233. package/src/themes/default/globals/site.variables +20 -1
  234. package/src/themes/default/globals/variation.variables +7 -1
  235. package/src/themes/default/modules/dropdown.variables +6 -0
  236. package/src/themes/default/modules/modal.variables +4 -0
  237. package/src/themes/default/modules/popup.variables +3 -1
  238. package/src/themes/default/modules/search.variables +3 -0
  239. package/src/themes/default/modules/toast.variables +1 -0
  240. package/src/themes/default/views/card.variables +4 -12
  241. package/src/themes/github/elements/button.variables +5 -1
  242. package/src/themes/twitter/elements/button.variables +5 -1
  243. package/tasks/admin/distributions/create.js +8 -3
  244. package/tasks/config/project/install.js +3 -0
  245. package/tasks/config/tasks.js +1 -8
  246. package/tasks/install.js +15 -5
package/dist/semantic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.3-beta.2+824a375
2
+ * # Fomantic UI - 2.9.3-beta.20+1e3f606
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Site
12
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Site
13
13
  * https://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -463,7 +463,7 @@
463
463
  })(jQuery, window, document);
464
464
 
465
465
  /*!
466
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Form Validation
466
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Form Validation
467
467
  * https://github.com/fomantic/Fomantic-UI/
468
468
  *
469
469
  *
@@ -486,6 +486,7 @@
486
486
  $.fn.form = function (parameters) {
487
487
  var
488
488
  $allModules = $(this),
489
+ $window = $(window),
489
490
 
490
491
  time = Date.now(),
491
492
  performance = [],
@@ -524,6 +525,8 @@
524
525
  namespace,
525
526
  moduleNamespace,
526
527
  eventNamespace,
528
+ attachEventsSelector,
529
+ attachEventsAction,
527
530
 
528
531
  submitting = false,
529
532
  dirty = false,
@@ -538,6 +541,7 @@
538
541
  initialize: function () {
539
542
  // settings grabbed at run time
540
543
  module.get.settings();
544
+ $module.addClass(className.initial);
541
545
  if (methodInvoked) {
542
546
  if (instance === undefined) {
543
547
  module.instantiate();
@@ -591,10 +595,13 @@
591
595
  module.bindEvents();
592
596
  },
593
597
 
594
- submit: function () {
598
+ submit: function (event) {
595
599
  module.verbose('Submitting form', $module);
596
600
  submitting = true;
597
601
  $module.trigger('submit');
602
+ if (event) {
603
+ event.preventDefault();
604
+ }
598
605
  },
599
606
 
600
607
  attachEvents: function (selector, action) {
@@ -606,6 +613,9 @@
606
613
  module[action]();
607
614
  event.preventDefault();
608
615
  });
616
+
617
+ attachEventsSelector = selector;
618
+ attachEventsAction = action;
609
619
  },
610
620
 
611
621
  bindEvents: function () {
@@ -617,6 +627,7 @@
617
627
  .on('click' + eventNamespace, selector.reset, module.reset)
618
628
  .on('click' + eventNamespace, selector.clear, module.clear)
619
629
  ;
630
+ $field.on('invalid' + eventNamespace, module.event.field.invalid);
620
631
  if (settings.keyboardShortcuts) {
621
632
  $module.on('keydown' + eventNamespace, selector.field, module.event.field.keydown);
622
633
  }
@@ -631,7 +642,7 @@
631
642
 
632
643
  // Dirty events
633
644
  if (settings.preventLeaving) {
634
- $(window).on('beforeunload' + eventNamespace, module.event.beforeUnload);
645
+ $window.on('beforeunload' + eventNamespace, module.event.beforeUnload);
635
646
  }
636
647
 
637
648
  $field.on('change' + eventNamespace
@@ -649,6 +660,9 @@
649
660
  $module.on('clean' + eventNamespace, function (e) {
650
661
  settings.onClean.call();
651
662
  });
663
+ if (attachEventsSelector) {
664
+ module.attachEvents(attachEventsSelector, attachEventsAction);
665
+ }
652
666
  },
653
667
 
654
668
  clear: function () {
@@ -697,6 +711,7 @@
697
711
  isCheckbox = $field.is(selector.checkbox),
698
712
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
699
713
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
714
+ isFile = $field.is(selector.file),
700
715
  isErrored = $fieldGroup.hasClass(className.error)
701
716
  ;
702
717
  if (defaultValue === undefined) {
@@ -717,7 +732,7 @@
717
732
  $calendar.calendar('set date', defaultValue);
718
733
  } else {
719
734
  module.verbose('Resetting field value', $field, defaultValue);
720
- $field.val(defaultValue);
735
+ $field.val(isFile ? '' : defaultValue);
721
736
  }
722
737
  });
723
738
  module.remove.states();
@@ -728,8 +743,12 @@
728
743
  var
729
744
  allValid = true
730
745
  ;
731
- $.each(validation, function (fieldName, field) {
732
- if (!module.validate.field(field, fieldName, true)) {
746
+ $field.each(function (index, el) {
747
+ var $el = $(el),
748
+ validation = module.get.validation($el) || {},
749
+ identifier = module.get.identifier(validation, $el)
750
+ ;
751
+ if (!module.validate.field(validation, identifier, true)) {
733
752
  allValid = false;
734
753
  }
735
754
  });
@@ -853,6 +872,13 @@
853
872
  $module.off(eventNamespace);
854
873
  $field.off(eventNamespace);
855
874
  $submit.off(eventNamespace);
875
+ if (settings.preventLeaving) {
876
+ $window.off(eventNamespace);
877
+ }
878
+ if (attachEventsSelector) {
879
+ $(attachEventsSelector).off(eventNamespace);
880
+ attachEventsSelector = undefined;
881
+ }
856
882
  },
857
883
 
858
884
  event: {
@@ -878,9 +904,8 @@
878
904
  if (!event.ctrlKey && key === keyCode.enter && isInput && !isInDropdown && !isCheckbox) {
879
905
  if (!keyHeldDown) {
880
906
  $field.one('keyup' + eventNamespace, module.event.field.keyup);
881
- module.submit();
907
+ module.submit(event);
882
908
  module.debug('Enter pressed on input submitting form');
883
- event.preventDefault();
884
909
  }
885
910
  keyHeldDown = true;
886
911
  }
@@ -888,15 +913,18 @@
888
913
  keyup: function () {
889
914
  keyHeldDown = false;
890
915
  },
916
+ invalid: function (event) {
917
+ event.preventDefault();
918
+ },
891
919
  blur: function (event) {
892
920
  var
893
921
  $field = $(this),
894
- $fieldGroup = $field.closest($group),
895
- validationRules = module.get.validation($field)
922
+ validationRules = module.get.validation($field) || {},
923
+ identifier = module.get.identifier(validationRules, $field)
896
924
  ;
897
- if (validationRules && (settings.on === 'blur' || ($fieldGroup.hasClass(className.error) && settings.revalidate))) {
925
+ if (settings.on === 'blur' || (!$module.hasClass(className.initial) && settings.revalidate)) {
898
926
  module.debug('Revalidating field', $field, validationRules);
899
- module.validate.field(validationRules);
927
+ module.validate.field(validationRules, identifier);
900
928
  if (!settings.inline) {
901
929
  module.validate.form(false, true);
902
930
  }
@@ -905,14 +933,14 @@
905
933
  change: function (event) {
906
934
  var
907
935
  $field = $(this),
908
- $fieldGroup = $field.closest($group),
909
- validationRules = module.get.validation($field)
936
+ validationRules = module.get.validation($field) || {},
937
+ identifier = module.get.identifier(validationRules, $field)
910
938
  ;
911
- if (validationRules && (settings.on === 'change' || ($fieldGroup.hasClass(className.error) && settings.revalidate))) {
939
+ if (settings.on === 'change' || (!$module.hasClass(className.initial) && settings.revalidate)) {
912
940
  clearTimeout(module.timer);
913
941
  module.timer = setTimeout(function () {
914
942
  module.debug('Revalidating field', $field, validationRules);
915
- module.validate.field(validationRules);
943
+ module.validate.field(validationRules, identifier);
916
944
  if (!settings.inline) {
917
945
  module.validate.form(false, true);
918
946
  }
@@ -954,18 +982,7 @@
954
982
  return rule.type;
955
983
  },
956
984
  changeEvent: function (type, $input) {
957
- if (type === 'checkbox' || type === 'radio' || type === 'hidden' || $input.is('select')) {
958
- return 'change';
959
- }
960
-
961
- return module.get.inputEvent();
962
- },
963
- inputEvent: function () {
964
- return document.createElement('input').oninput !== undefined
965
- ? 'input'
966
- : (document.createElement('input').onpropertychange !== undefined
967
- ? 'propertychange'
968
- : 'keyup');
985
+ return ['file', 'checkbox', 'radio', 'hidden'].indexOf(type) >= 0 || $input.is('select') ? 'change' : 'input';
969
986
  },
970
987
  fieldsFromShorthand: function (fields) {
971
988
  var
@@ -989,6 +1006,9 @@
989
1006
 
990
1007
  return fullFields;
991
1008
  },
1009
+ identifier: function (validation, $el) {
1010
+ return validation.identifier || $el.attr('id') || $el.attr('name') || $el.data(metadata.validate);
1011
+ },
992
1012
  prompt: function (rule, field) {
993
1013
  var
994
1014
  ruleName = module.get.ruleName(rule),
@@ -1101,7 +1121,7 @@
1101
1121
  var $field = typeof identifier === 'string'
1102
1122
  ? module.get.field(identifier)
1103
1123
  : identifier,
1104
- $label = $field.closest(selector.group).find('label').eq(0)
1124
+ $label = $field.closest(selector.group).find('label:not(:empty)').eq(0)
1105
1125
  ;
1106
1126
 
1107
1127
  return $label.length === 1
@@ -1432,7 +1452,7 @@
1432
1452
  $message.empty();
1433
1453
  },
1434
1454
  states: function () {
1435
- $module.removeClass(className.error).removeClass(className.success);
1455
+ $module.removeClass(className.error).removeClass(className.success).addClass(className.initial);
1436
1456
  if (!settings.inline) {
1437
1457
  module.remove.errors();
1438
1458
  }
@@ -1570,6 +1590,7 @@
1570
1590
  $field = module.get.field(key),
1571
1591
  $element = $field.parent(),
1572
1592
  $calendar = $field.closest(selector.uiCalendar),
1593
+ isFile = $field.is(selector.file),
1573
1594
  isMultiple = Array.isArray(value),
1574
1595
  isCheckbox = $element.is(selector.uiCheckbox) && module.can.useElement('checkbox'),
1575
1596
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
@@ -1612,7 +1633,7 @@
1612
1633
  $calendar.calendar('set date', value);
1613
1634
  } else {
1614
1635
  module.verbose('Setting field value', value, $field);
1615
- $field.val(value);
1636
+ $field.val(isFile ? '' : value);
1616
1637
  }
1617
1638
  }
1618
1639
  });
@@ -1668,7 +1689,7 @@
1668
1689
  return rule.type === 'empty';
1669
1690
  }) !== 0
1670
1691
  : false,
1671
- identifier = validation.identifier || $el.attr('id') || $el.attr('name') || $el.data(metadata.validate)
1692
+ identifier = module.get.identifier(validation, $el)
1672
1693
  ;
1673
1694
  if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
1674
1695
  if (isCheckbox) {
@@ -1700,7 +1721,7 @@
1700
1721
  if (keyHeldDown) {
1701
1722
  return false;
1702
1723
  }
1703
-
1724
+ $module.removeClass(className.initial);
1704
1725
  // reset errors
1705
1726
  formErrors = [];
1706
1727
  if (module.determine.isValid()) {
@@ -1772,13 +1793,24 @@
1772
1793
  ? module.get.field(field.depends)
1773
1794
  : false,
1774
1795
  fieldValid = true,
1775
- fieldErrors = []
1796
+ fieldErrors = [],
1797
+ isDisabled = $field.filter(':not(:disabled)').length === 0,
1798
+ validationMessage = $field[0].validationMessage
1776
1799
  ;
1777
1800
  if (!field.identifier) {
1778
1801
  module.debug('Using field name as identifier', identifier);
1779
1802
  field.identifier = identifier;
1780
1803
  }
1781
- var isDisabled = $field.filter(':not(:disabled)').length === 0;
1804
+ if (validationMessage) {
1805
+ module.debug('Field is natively invalid', identifier);
1806
+ fieldErrors.push(validationMessage);
1807
+ fieldValid = false;
1808
+ if (showErrors) {
1809
+ $field.closest($group).addClass(className.error);
1810
+ }
1811
+ } else if (showErrors) {
1812
+ $field.closest($group).removeClass(className.error);
1813
+ }
1782
1814
  if (isDisabled) {
1783
1815
  module.debug('Field is disabled. Skipping', identifier);
1784
1816
  } else if (field.optional && module.is.blank($field)) {
@@ -1786,9 +1818,6 @@
1786
1818
  } else if (field.depends && module.is.empty($dependsField)) {
1787
1819
  module.debug('Field depends on another value that is not present or empty. Skipping', $dependsField);
1788
1820
  } else if (field.rules !== undefined) {
1789
- if (showErrors) {
1790
- $field.closest($group).removeClass(className.error);
1791
- }
1792
1821
  $.each(field.rules, function (index, rule) {
1793
1822
  if (module.has.field(identifier)) {
1794
1823
  var invalidFields = module.validate.rule(field, rule, true) || [];
@@ -1805,7 +1834,7 @@
1805
1834
  }
1806
1835
  if (fieldValid) {
1807
1836
  if (showErrors) {
1808
- module.remove.prompt(identifier, fieldErrors);
1837
+ module.remove.prompt(identifier);
1809
1838
  settings.onValid.call($field);
1810
1839
  }
1811
1840
  } else {
@@ -2095,8 +2124,8 @@
2095
2124
  isExactly: '{name} must be exactly "{ruleValue}"',
2096
2125
  not: '{name} cannot be set to "{ruleValue}"',
2097
2126
  notExactly: '{name} cannot be set to exactly "{ruleValue}"',
2098
- contain: '{name} must contain "{ruleValue}"',
2099
- containExactly: '{name} must contain exactly "{ruleValue}"',
2127
+ contains: '{name} must contain "{ruleValue}"',
2128
+ containsExactly: '{name} must contain exactly "{ruleValue}"',
2100
2129
  doesntContain: '{name} cannot contain "{ruleValue}"',
2101
2130
  doesntContainExactly: '{name} cannot contain exactly "{ruleValue}"',
2102
2131
  minLength: '{name} must be at least {ruleValue} characters',
@@ -2115,9 +2144,10 @@
2115
2144
  selector: {
2116
2145
  checkbox: 'input[type="checkbox"], input[type="radio"]',
2117
2146
  clear: '.clear',
2118
- field: 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2147
+ field: 'input:not(.search):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2148
+ file: 'input[type="file"]',
2119
2149
  group: '.field',
2120
- input: 'input:not([type="file"])',
2150
+ input: 'input',
2121
2151
  message: '.error.message',
2122
2152
  prompt: '.prompt.label',
2123
2153
  radio: 'input[type="radio"]',
@@ -2129,6 +2159,7 @@
2129
2159
  },
2130
2160
 
2131
2161
  className: {
2162
+ initial: 'initial',
2132
2163
  error: 'error',
2133
2164
  label: 'ui basic red pointing prompt label',
2134
2165
  pressed: 'down',
@@ -2569,7 +2600,7 @@
2569
2600
  })(jQuery, window, document);
2570
2601
 
2571
2602
  /*!
2572
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Accordion
2603
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Accordion
2573
2604
  * https://github.com/fomantic/Fomantic-UI/
2574
2605
  *
2575
2606
  *
@@ -3163,7 +3194,7 @@
3163
3194
  })(jQuery, window, document);
3164
3195
 
3165
3196
  /*!
3166
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Calendar
3197
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Calendar
3167
3198
  * https://github.com/fomantic/Fomantic-UI/
3168
3199
  *
3169
3200
  *
@@ -5174,7 +5205,7 @@
5174
5205
  })(jQuery, window, document);
5175
5206
 
5176
5207
  /*!
5177
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Checkbox
5208
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Checkbox
5178
5209
  * https://github.com/fomantic/Fomantic-UI/
5179
5210
  *
5180
5211
  *
@@ -6055,7 +6086,7 @@
6055
6086
  })(jQuery, window, document);
6056
6087
 
6057
6088
  /*!
6058
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Dimmer
6089
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Dimmer
6059
6090
  * https://github.com/fomantic/Fomantic-UI/
6060
6091
  *
6061
6092
  *
@@ -6786,7 +6817,7 @@
6786
6817
  })(jQuery, window, document);
6787
6818
 
6788
6819
  /*!
6789
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Dropdown
6820
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Dropdown
6790
6821
  * https://github.com/fomantic/Fomantic-UI/
6791
6822
  *
6792
6823
  *
@@ -6889,7 +6920,8 @@
6889
6920
  selectObserver,
6890
6921
  menuObserver,
6891
6922
  classObserver,
6892
- module
6923
+ module,
6924
+ tempDisableApiCache = false
6893
6925
  ;
6894
6926
 
6895
6927
  module = {
@@ -7656,11 +7688,12 @@
7656
7688
  if (!$module.api('get request')) {
7657
7689
  module.setup.api();
7658
7690
  }
7659
- apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks);
7691
+ apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks, tempDisableApiCache ? { cache: false } : {});
7660
7692
  $module
7661
7693
  .api('setting', apiSettings)
7662
7694
  .api('query')
7663
7695
  ;
7696
+ tempDisableApiCache = false;
7664
7697
  },
7665
7698
 
7666
7699
  filterItems: function (query) {
@@ -8192,11 +8225,13 @@
8192
8225
  if (settings.allowAdditions) {
8193
8226
  module.remove.userAddition();
8194
8227
  }
8195
- module.remove.filteredItem();
8228
+ if (!settings.keepSearchTerm) {
8229
+ module.remove.filteredItem();
8230
+ module.remove.searchTerm();
8231
+ }
8196
8232
  if (!module.is.visible() && $target.length > 0) {
8197
8233
  module.show();
8198
8234
  }
8199
- module.remove.searchTerm();
8200
8235
  if (!module.is.focusedOnSearch() && skipRefocus !== true) {
8201
8236
  module.focusSearch(true);
8202
8237
  }
@@ -8382,7 +8417,9 @@
8382
8417
  module.verbose('Selecting item from keyboard shortcut', $selectedItem);
8383
8418
  module.event.item.click.call($selectedItem, event);
8384
8419
  if (module.is.searchSelection()) {
8385
- module.remove.searchTerm();
8420
+ if (!settings.keepSearchTerm) {
8421
+ module.remove.searchTerm();
8422
+ }
8386
8423
  if (module.is.multiple()) {
8387
8424
  $search.trigger('focus');
8388
8425
  }
@@ -8599,7 +8636,7 @@
8599
8636
  ? value
8600
8637
  : text;
8601
8638
  if (module.can.activate($(element))) {
8602
- module.set.selected(value, $(element));
8639
+ module.set.selected(value, $(element), false, settings.keepSearchTerm);
8603
8640
  if (!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8604
8641
  module.hideAndClear();
8605
8642
  }
@@ -9186,6 +9223,11 @@
9186
9223
  module.set.value('', null, null, preventChangeTrigger);
9187
9224
  },
9188
9225
 
9226
+ clearCache: function () {
9227
+ module.debug('Clearing API cache once');
9228
+ tempDisableApiCache = true;
9229
+ },
9230
+
9189
9231
  scrollPage: function (direction, $selectedItem) {
9190
9232
  var
9191
9233
  $currentItem = $selectedItem || module.get.selectedItem(),
@@ -9244,7 +9286,7 @@
9244
9286
  valueIsSet = searchValue !== ''
9245
9287
  ;
9246
9288
  if (isMultiple && hasSearchValue) {
9247
- module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
9289
+ module.verbose('Adjusting input width', searchWidth);
9248
9290
  $search.css('width', searchWidth + 'px');
9249
9291
  }
9250
9292
  if (hasSearchValue || (isSearchMultiple && valueIsSet)) {
@@ -9543,7 +9585,7 @@
9543
9585
  return false;
9544
9586
  }
9545
9587
  module.debug('Setting selected menu item to', $selectedItem);
9546
- if (module.is.multiple()) {
9588
+ if (module.is.multiple() && !keepSearchTerm) {
9547
9589
  module.remove.searchWidth();
9548
9590
  }
9549
9591
  if (module.is.single()) {
@@ -10236,7 +10278,7 @@
10236
10278
  return settings.apiSettings && module.can.useAPI();
10237
10279
  },
10238
10280
  noApiCache: function () {
10239
- return settings.apiSettings && !settings.apiSettings.cache;
10281
+ return tempDisableApiCache || (settings.apiSettings && !settings.apiSettings.cache);
10240
10282
  },
10241
10283
  single: function () {
10242
10284
  return !module.is.multiple();
@@ -10786,6 +10828,7 @@
10786
10828
  forceSelection: false, // force a choice on blur with search selection
10787
10829
 
10788
10830
  allowAdditions: false, // whether multiple select should allow user added values
10831
+ keepSearchTerm: false, // whether the search value should be kept and menu stays filtered on item selection
10789
10832
  ignoreCase: false, // whether to consider case sensitivity when creating labels
10790
10833
  ignoreSearchCase: true, // whether to consider case sensitivity when filtering items
10791
10834
  hideAdditions: true, // whether or not to hide special message prompting a user they can enter a value
@@ -10805,8 +10848,6 @@
10805
10848
  duration: 200, // duration of transition
10806
10849
  displayType: false, // displayType of transition
10807
10850
 
10808
- glyphWidth: 1.037, // widest glyph width in em (W is 1.037 em) used to calculate multiselect input width
10809
-
10810
10851
  headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
10811
10852
 
10812
10853
  collapseOnActionable: true, // whether the dropdown should collapse upon selection of an actionable item
@@ -11129,7 +11170,7 @@
11129
11170
  })(jQuery, window, document);
11130
11171
 
11131
11172
  /*!
11132
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Embed
11173
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Embed
11133
11174
  * https://github.com/fomantic/Fomantic-UI/
11134
11175
  *
11135
11176
  *
@@ -11808,7 +11849,7 @@
11808
11849
  })(jQuery, window, document);
11809
11850
 
11810
11851
  /*!
11811
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Flyout
11852
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Flyout
11812
11853
  * https://github.com/fomantic/Fomantic-UI/
11813
11854
  *
11814
11855
  *
@@ -11895,6 +11936,7 @@
11895
11936
  initialBodyMargin = '',
11896
11937
  tempBodyMargin = '',
11897
11938
  hadScrollbar = false,
11939
+ windowRefocused = false,
11898
11940
 
11899
11941
  elementNamespace,
11900
11942
  id,
@@ -12073,9 +12115,13 @@
12073
12115
  module.setup.heights();
12074
12116
  },
12075
12117
  focus: function () {
12076
- if (module.is.visible() && settings.autofocus && settings.dimPage) {
12118
+ windowRefocused = true;
12119
+ },
12120
+ click: function (event) {
12121
+ if (windowRefocused && document.activeElement !== event.target && module.is.visible() && settings.autofocus && settings.dimPage && $(document.activeElement).closest(selector.flyout).length === 0) {
12077
12122
  requestAnimationFrame(module.set.autofocus);
12078
12123
  }
12124
+ windowRefocused = false;
12079
12125
  },
12080
12126
  clickaway: function (event) {
12081
12127
  if (settings.closable) {
@@ -12182,6 +12228,9 @@
12182
12228
  $window
12183
12229
  .on('focus' + elementNamespace, module.event.focus)
12184
12230
  ;
12231
+ $context
12232
+ .on('click' + elementNamespace, module.event.click)
12233
+ ;
12185
12234
  },
12186
12235
  clickaway: function () {
12187
12236
  module.verbose('Adding clickaway events to context', $context);
@@ -12311,11 +12360,12 @@
12311
12360
 
12312
12361
  return nodes;
12313
12362
  },
12314
- shouldRefreshInputs = false
12363
+ shouldRefreshInputs = false,
12364
+ ignoreAutofocus = true
12315
12365
  ;
12316
12366
  mutations.every(function (mutation) {
12317
12367
  if (mutation.type === 'attributes') {
12318
- if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').length > 0)) {
12368
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
12319
12369
  shouldRefreshInputs = true;
12320
12370
  }
12321
12371
  } else {
@@ -12325,6 +12375,9 @@
12325
12375
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
12326
12376
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
12327
12377
  shouldRefreshInputs = true;
12378
+ if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
12379
+ ignoreAutofocus = false;
12380
+ }
12328
12381
  }
12329
12382
  }
12330
12383
 
@@ -12332,7 +12385,7 @@
12332
12385
  });
12333
12386
 
12334
12387
  if (shouldRefreshInputs) {
12335
- module.refreshInputs();
12388
+ module.refreshInputs(ignoreAutofocus);
12336
12389
  }
12337
12390
  });
12338
12391
  observer.observe(element, {
@@ -12357,7 +12410,7 @@
12357
12410
  $flyouts = $context.children(selector.flyout);
12358
12411
  },
12359
12412
 
12360
- refreshInputs: function () {
12413
+ refreshInputs: function (ignoreAutofocus) {
12361
12414
  if ($inputs) {
12362
12415
  $inputs
12363
12416
  .off('keydown' + elementNamespace)
@@ -12369,8 +12422,8 @@
12369
12422
  $inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
12370
12423
  return $(this).closest('.disabled').length === 0;
12371
12424
  });
12372
- if ($inputs.length === 0) {
12373
- $inputs = $module;
12425
+ if ($inputs.filter(':input').length === 0) {
12426
+ $inputs = $module.add($inputs);
12374
12427
  $module.attr('tabindex', -1);
12375
12428
  } else {
12376
12429
  $module.removeAttr('tabindex');
@@ -12381,7 +12434,7 @@
12381
12434
  $inputs.last()
12382
12435
  .on('keydown' + elementNamespace, module.event.inputKeyDown.last)
12383
12436
  ;
12384
- if (settings.autofocus && $inputs.filter(':focus').length === 0) {
12437
+ if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
12385
12438
  module.set.autofocus();
12386
12439
  }
12387
12440
  },
@@ -12659,20 +12712,14 @@
12659
12712
  var
12660
12713
  $autofocus = $inputs.filter('[autofocus]'),
12661
12714
  $rawInputs = $inputs.filter(':input'),
12662
- $input = $autofocus.length > 0
12663
- ? $autofocus.first()
12715
+ $input = ($autofocus.length > 0
12716
+ ? $autofocus
12664
12717
  : ($rawInputs.length > 0
12665
12718
  ? $rawInputs
12666
- : $inputs.filter(':not(i.close)')
12667
- ).first()
12719
+ : $module)
12720
+ ).first()
12668
12721
  ;
12669
- // check if only the close icon is remaining
12670
- if ($input.length === 0 && $inputs.length > 0) {
12671
- $input = $inputs.first();
12672
- }
12673
- if ($input.length > 0) {
12674
- $input.trigger('focus');
12675
- }
12722
+ $input.trigger('focus');
12676
12723
  },
12677
12724
  dimmerStyles: function () {
12678
12725
  if (settings.blurring) {
@@ -13383,7 +13430,7 @@
13383
13430
  })(jQuery, window, document);
13384
13431
 
13385
13432
  /*!
13386
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Modal
13433
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Modal
13387
13434
  * https://github.com/fomantic/Fomantic-UI/
13388
13435
  *
13389
13436
  *
@@ -13472,6 +13519,7 @@
13472
13519
  tempBodyMargin = '',
13473
13520
  keepScrollingClass = false,
13474
13521
  hadScrollbar = false,
13522
+ windowRefocused = false,
13475
13523
 
13476
13524
  elementEventNamespace,
13477
13525
  id,
@@ -13635,6 +13683,7 @@
13635
13683
  .off(eventNamespace)
13636
13684
  ;
13637
13685
  $window.off(elementEventNamespace);
13686
+ $context.off(elementEventNamespace);
13638
13687
  $dimmer.off(elementEventNamespace);
13639
13688
  $closeIcon.off(elementEventNamespace);
13640
13689
  if ($inputs) {
@@ -13656,11 +13705,12 @@
13656
13705
  return nodes;
13657
13706
  },
13658
13707
  shouldRefresh = false,
13659
- shouldRefreshInputs = false
13708
+ shouldRefreshInputs = false,
13709
+ ignoreAutofocus = true
13660
13710
  ;
13661
13711
  mutations.every(function (mutation) {
13662
13712
  if (mutation.type === 'attributes') {
13663
- if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').length > 0)) {
13713
+ if (observeAttributes && (mutation.attributeName === 'disabled' || $(mutation.target).find(':input').addBack(':input').filter(':visible').length > 0)) {
13664
13714
  shouldRefreshInputs = true;
13665
13715
  }
13666
13716
  } else {
@@ -13671,6 +13721,9 @@
13671
13721
  $removedInputs = $(collectNodes(mutation.removedNodes)).filter('a[href], [tabindex], :input');
13672
13722
  if ($addedInputs.length > 0 || $removedInputs.length > 0) {
13673
13723
  shouldRefreshInputs = true;
13724
+ if ($addedInputs.filter(':input').length > 0 || $removedInputs.filter(':input').length > 0) {
13725
+ ignoreAutofocus = false;
13726
+ }
13674
13727
  }
13675
13728
  }
13676
13729
 
@@ -13682,7 +13735,7 @@
13682
13735
  module.refresh();
13683
13736
  }
13684
13737
  if (shouldRefreshInputs) {
13685
- module.refreshInputs();
13738
+ module.refreshInputs(ignoreAutofocus);
13686
13739
  }
13687
13740
  });
13688
13741
  observer.observe(element, {
@@ -13710,7 +13763,7 @@
13710
13763
  $allModals = $otherModals.add($module);
13711
13764
  },
13712
13765
 
13713
- refreshInputs: function () {
13766
+ refreshInputs: function (ignoreAutofocus) {
13714
13767
  if ($inputs) {
13715
13768
  $inputs
13716
13769
  .off('keydown' + elementEventNamespace)
@@ -13719,8 +13772,8 @@
13719
13772
  $inputs = $module.find('a[href], [tabindex], :input:enabled').filter(':visible').filter(function () {
13720
13773
  return $(this).closest('.disabled').length === 0;
13721
13774
  });
13722
- if ($inputs.length === 0) {
13723
- $inputs = $module;
13775
+ if ($inputs.filter(':input').length === 0) {
13776
+ $inputs = $module.add($inputs);
13724
13777
  $module.attr('tabindex', -1);
13725
13778
  } else {
13726
13779
  $module.removeAttr('tabindex');
@@ -13731,7 +13784,7 @@
13731
13784
  $inputs.last()
13732
13785
  .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
13733
13786
  ;
13734
- if (settings.autofocus && $inputs.filter(':focus').length === 0) {
13787
+ if (!ignoreAutofocus && settings.autofocus && $inputs.filter(':focus').length === 0) {
13735
13788
  module.set.autofocus();
13736
13789
  }
13737
13790
  },
@@ -13769,6 +13822,9 @@
13769
13822
  .on('resize' + elementEventNamespace, module.event.resize)
13770
13823
  .on('focus' + elementEventNamespace, module.event.focus)
13771
13824
  ;
13825
+ $context
13826
+ .on('click' + elementEventNamespace, module.event.click)
13827
+ ;
13772
13828
  },
13773
13829
  scrollLock: function () {
13774
13830
  // touch events default to passive, due to changes in chrome to optimize mobile perf
@@ -13926,9 +13982,13 @@
13926
13982
  }
13927
13983
  },
13928
13984
  focus: function () {
13929
- if ($dimmable.dimmer('is active') && module.is.active() && settings.autofocus) {
13985
+ windowRefocused = true;
13986
+ },
13987
+ click: function (event) {
13988
+ if (windowRefocused && document.activeElement !== event.target && $dimmable.dimmer('is active') && module.is.active() && settings.autofocus && $(document.activeElement).closest(selector.modal).length === 0) {
13930
13989
  requestAnimationFrame(module.set.autofocus);
13931
13990
  }
13991
+ windowRefocused = false;
13932
13992
  },
13933
13993
  },
13934
13994
 
@@ -13993,7 +14053,7 @@
13993
14053
  ignoreRepeatedEvents = false;
13994
14054
  if (settings.allowMultiple) {
13995
14055
  if (module.others.active()) {
13996
- $otherModals.filter('.' + className.active).find(selector.dimmer).addClass('active');
14056
+ $otherModals.filter('.' + className.active).find(selector.dimmer).removeClass('out').addClass('transition fade in active');
13997
14057
  }
13998
14058
 
13999
14059
  if (settings.detachable) {
@@ -14065,6 +14125,8 @@
14065
14125
  onStart: function () {
14066
14126
  if (!module.others.active() && !module.others.animating() && !keepDimmed) {
14067
14127
  module.hideDimmer();
14128
+ } else if (settings.allowMultiple) {
14129
+ (hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('in').addClass('out');
14068
14130
  }
14069
14131
  if (settings.keyboardShortcuts && !module.others.active()) {
14070
14132
  module.remove.keyboardShortcuts();
@@ -14077,11 +14139,7 @@
14077
14139
  $previousModal.addClass(className.front);
14078
14140
  $module.removeClass(className.front);
14079
14141
 
14080
- if (hideOthersToo) {
14081
- $allModals.find(selector.dimmer).removeClass('active');
14082
- } else {
14083
- $previousModal.find(selector.dimmer).removeClass('active');
14084
- }
14142
+ (hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('active');
14085
14143
  }
14086
14144
  if (isFunction(settings.onHidden)) {
14087
14145
  settings.onHidden.call(element);
@@ -14438,20 +14496,14 @@
14438
14496
  var
14439
14497
  $autofocus = $inputs.filter('[autofocus]'),
14440
14498
  $rawInputs = $inputs.filter(':input'),
14441
- $input = $autofocus.length > 0
14442
- ? $autofocus.first()
14499
+ $input = ($autofocus.length > 0
14500
+ ? $autofocus
14443
14501
  : ($rawInputs.length > 0
14444
14502
  ? $rawInputs
14445
- : $inputs.filter(':not(i.close)')
14446
- ).first()
14503
+ : $module)
14504
+ ).first()
14447
14505
  ;
14448
- // check if only the close icon is remaining
14449
- if ($input.length === 0 && $inputs.length > 0) {
14450
- $input = $inputs.first();
14451
- }
14452
- if ($input.length > 0) {
14453
- $input.trigger('focus');
14454
- }
14506
+ $input.trigger('focus');
14455
14507
  },
14456
14508
  bodyMargin: function () {
14457
14509
  var position = module.can.leftBodyScrollbar() ? 'left' : 'right';
@@ -15012,7 +15064,7 @@
15012
15064
  })(jQuery, window, document);
15013
15065
 
15014
15066
  /*!
15015
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Nag
15067
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Nag
15016
15068
  * https://github.com/fomantic/Fomantic-UI/
15017
15069
  *
15018
15070
  *
@@ -15573,7 +15625,7 @@
15573
15625
  })(jQuery, window, document);
15574
15626
 
15575
15627
  /*!
15576
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Popup
15628
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Popup
15577
15629
  * https://github.com/fomantic/Fomantic-UI/
15578
15630
  *
15579
15631
  *
@@ -15822,9 +15874,11 @@
15822
15874
  // generates popup html from metadata
15823
15875
  create: function () {
15824
15876
  var
15877
+ targetSibling = $target.next(selector.popup),
15878
+ contentFallback = !settings.popup && targetSibling.length === 0 ? $module.attr('title') : false,
15825
15879
  html = module.get.html(),
15826
15880
  title = module.get.title(),
15827
- content = module.get.content()
15881
+ content = module.get.content(contentFallback)
15828
15882
  ;
15829
15883
 
15830
15884
  if (html || content || title) {
@@ -15865,10 +15919,10 @@
15865
15919
  if (settings.hoverable) {
15866
15920
  module.bind.popup();
15867
15921
  }
15868
- } else if ($target.next(selector.popup).length > 0) {
15922
+ } else if (targetSibling.length > 0) {
15869
15923
  module.verbose('Pre-existing popup found');
15870
15924
  settings.inline = true;
15871
- settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
15925
+ settings.popup = targetSibling.data(metadata.activator, $module);
15872
15926
  module.refresh();
15873
15927
  if (settings.hoverable) {
15874
15928
  module.bind.popup();
@@ -16058,10 +16112,10 @@
16058
16112
 
16059
16113
  return $module.data(metadata.title) || settings.title;
16060
16114
  },
16061
- content: function () {
16115
+ content: function (fallback) {
16062
16116
  $module.removeData(metadata.content);
16063
16117
 
16064
- return $module.data(metadata.content) || settings.content || $module.attr('title');
16118
+ return $module.data(metadata.content) || settings.content || fallback;
16065
16119
  },
16066
16120
  variation: function () {
16067
16121
  $module.removeData(metadata.variation);
@@ -17127,7 +17181,7 @@
17127
17181
  })(jQuery, window, document);
17128
17182
 
17129
17183
  /*!
17130
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Progress
17184
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Progress
17131
17185
  * https://github.com/fomantic/Fomantic-UI/
17132
17186
  *
17133
17187
  *
@@ -18105,7 +18159,7 @@
18105
18159
  })(jQuery, window, document);
18106
18160
 
18107
18161
  /*!
18108
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Slider
18162
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Slider
18109
18163
  * https://github.com/fomantic/Fomantic-UI/
18110
18164
  *
18111
18165
  *
@@ -18209,9 +18263,7 @@
18209
18263
  module.setup.layout();
18210
18264
  module.setup.labels();
18211
18265
 
18212
- if (!module.is.disabled()) {
18213
- module.bind.events();
18214
- }
18266
+ module.bind.events();
18215
18267
 
18216
18268
  module.read.metadata();
18217
18269
  module.read.settings();
@@ -18243,20 +18295,32 @@
18243
18295
  $module.attr('tabindex', 0);
18244
18296
  }
18245
18297
  if ($module.find('.inner').length === 0) {
18246
- $module.append("<div class='inner'>"
18247
- + "<div class='track'></div>"
18248
- + "<div class='track-fill'></div>"
18249
- + "<div class='thumb'></div>"
18298
+ $module.append('<div class="inner">'
18299
+ + '<div class="track"></div>'
18300
+ + '<div class="track-fill"></div>'
18301
+ + '<div class="thumb"></div>'
18250
18302
  + '</div>');
18251
18303
  }
18252
18304
  precision = module.get.precision();
18253
18305
  $thumb = $module.find('.thumb:not(.second)');
18306
+ if (settings.showThumbTooltip) {
18307
+ $thumb
18308
+ .attr('data-position', settings.tooltipConfig.position)
18309
+ .attr('data-variation', settings.tooltipConfig.variation)
18310
+ ;
18311
+ }
18254
18312
  $currThumb = $thumb;
18255
18313
  if (module.is.range()) {
18256
18314
  if ($module.find('.thumb.second').length === 0) {
18257
- $module.find('.inner').append("<div class='thumb second'></div>");
18315
+ $module.find('.inner').append('<div class="thumb second"></div>');
18258
18316
  }
18259
18317
  $secondThumb = $module.find('.thumb.second');
18318
+ if (settings.showThumbTooltip) {
18319
+ $secondThumb
18320
+ .attr('data-position', settings.tooltipConfig.position)
18321
+ .attr('data-variation', settings.tooltipConfig.variation)
18322
+ ;
18323
+ }
18260
18324
  }
18261
18325
  $track = $module.find('.track');
18262
18326
  $trackFill = $module.find('.track-fill');
@@ -18310,9 +18374,10 @@
18310
18374
  for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
18311
18375
  var
18312
18376
  labelText = module.get.label(i),
18313
- $label = labelText !== ''
18377
+ showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.indexOf(labelText) >= 0,
18378
+ $label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
18314
18379
  ? (!(i % module.get.gapRatio())
18315
- ? $('<li class="label">' + labelText + '</li>')
18380
+ ? $('<li class="label">' + (showLabel ? labelText : '') + '</li>')
18316
18381
  : $('<li class="halftick label"></li>'))
18317
18382
  : null,
18318
18383
  ratio = i / len
@@ -18456,6 +18521,18 @@
18456
18521
  ;
18457
18522
  $currThumb = initialPosition > newPos ? $thumb : $secondThumb;
18458
18523
  }
18524
+ if (module.is.range() && (settings.minRange || settings.maxRange)) {
18525
+ var currentRangeDiff = module.get.currentRangeDiff(value),
18526
+ isSecondThumb = $currThumb.hasClass('second')
18527
+ ;
18528
+ if ((settings.minRange && currentRangeDiff < settings.minRange)
18529
+ || (settings.maxRange && currentRangeDiff > settings.maxRange)
18530
+ || (settings.preventCrossover && !isSecondThumb && value > module.secondThumbVal)
18531
+ || (settings.preventCrossover && isSecondThumb && value < module.thumbVal)
18532
+ ) {
18533
+ return;
18534
+ }
18535
+ }
18459
18536
  if (module.get.step() === 0 || module.is.smooth()) {
18460
18537
  var
18461
18538
  thumbVal = module.thumbVal,
@@ -18491,6 +18568,17 @@
18491
18568
  return;
18492
18569
  }
18493
18570
  var value = module.determine.valueFromEvent(event);
18571
+ if (module.is.range() && (settings.minRange || settings.maxRange)) {
18572
+ if ($currThumb === undefined) {
18573
+ $currThumb = value <= module.get.currentThumbValue() ? $thumb : $secondThumb;
18574
+ }
18575
+ var currentRangeDiff = module.get.currentRangeDiff(value);
18576
+ if (settings.minRange && currentRangeDiff < settings.minRange) {
18577
+ value = module.get.edgeValue(value, settings.minRange);
18578
+ } else if (settings.maxRange && currentRangeDiff > settings.maxRange) {
18579
+ value = module.get.edgeValue(value, settings.maxRange);
18580
+ }
18581
+ }
18494
18582
  module.set.value(value);
18495
18583
  module.unbind.slidingEvents();
18496
18584
  touchIdentifier = undefined;
@@ -18507,6 +18595,9 @@
18507
18595
  }
18508
18596
  },
18509
18597
  keydown: function (event, first) {
18598
+ if (module.is.disabled()) {
18599
+ return;
18600
+ }
18510
18601
  if (settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
18511
18602
  $currThumb = undefined;
18512
18603
  }
@@ -18543,7 +18634,7 @@
18543
18634
  }
18544
18635
  },
18545
18636
  activateFocus: function (event) {
18546
- if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
18637
+ if (!module.is.disabled() && !module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
18547
18638
  event.preventDefault();
18548
18639
  module.event.keydown(event, true);
18549
18640
  $module.trigger('focus');
@@ -18608,7 +18699,13 @@
18608
18699
 
18609
18700
  is: {
18610
18701
  range: function () {
18611
- return $module.hasClass(settings.className.range);
18702
+ var isRange = $module.hasClass(className.range);
18703
+ if (!isRange && (settings.minRange || settings.maxRange)) {
18704
+ $module.addClass(className.range);
18705
+ isRange = true;
18706
+ }
18707
+
18708
+ return isRange;
18612
18709
  },
18613
18710
  hover: function () {
18614
18711
  return isHover;
@@ -18617,23 +18714,56 @@
18617
18714
  return $module.is(':focus');
18618
18715
  },
18619
18716
  disabled: function () {
18620
- return $module.hasClass(settings.className.disabled);
18717
+ return $module.hasClass(className.disabled);
18621
18718
  },
18622
18719
  labeled: function () {
18623
- return $module.hasClass(settings.className.labeled);
18720
+ var isLabeled = $module.hasClass(className.labeled);
18721
+ if (!isLabeled && (settings.restrictedLabels.length > 0 || settings.showLabelTicks !== false)) {
18722
+ $module.addClass(className.labeled);
18723
+ isLabeled = true;
18724
+ }
18725
+
18726
+ return isLabeled;
18624
18727
  },
18625
18728
  reversed: function () {
18626
- return $module.hasClass(settings.className.reversed);
18729
+ return $module.hasClass(className.reversed);
18627
18730
  },
18628
18731
  vertical: function () {
18629
- return $module.hasClass(settings.className.vertical);
18732
+ return $module.hasClass(className.vertical);
18630
18733
  },
18631
18734
  smooth: function () {
18632
- return settings.smooth || $module.hasClass(settings.className.smooth);
18735
+ return settings.smooth || $module.hasClass(className.smooth);
18633
18736
  },
18634
18737
  },
18635
18738
 
18636
18739
  get: {
18740
+ currentRangeDiff: function (value) {
18741
+ var currentRangeDiff;
18742
+ if ($currThumb.hasClass('second')) {
18743
+ currentRangeDiff = module.thumbVal < value
18744
+ ? value - module.thumbVal
18745
+ : module.thumbVal - value;
18746
+ } else {
18747
+ currentRangeDiff = module.secondThumbVal > value
18748
+ ? module.secondThumbVal - value
18749
+ : value - module.secondThumbVal;
18750
+ }
18751
+
18752
+ return currentRangeDiff;
18753
+ },
18754
+ edgeValue: function (value, edgeValue) {
18755
+ if ($currThumb.hasClass('second')) {
18756
+ value = module.thumbVal < value
18757
+ ? module.thumbVal + edgeValue
18758
+ : module.thumbVal - edgeValue;
18759
+ } else {
18760
+ value = module.secondThumbVal < value
18761
+ ? module.secondThumbVal + edgeValue
18762
+ : module.secondThumbVal - edgeValue;
18763
+ }
18764
+
18765
+ return value;
18766
+ },
18637
18767
  trackOffset: function () {
18638
18768
  if (module.is.vertical()) {
18639
18769
  return $track.offset().top;
@@ -18837,13 +18967,10 @@
18837
18967
  return thumbDelta <= secondThumbDelta ? thumbPos : secondThumbPos;
18838
18968
  },
18839
18969
  thumbPos: function ($element) {
18840
- var
18841
- pos = module.is.vertical()
18842
- ? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
18843
- : (module.is.reversed() ? $element.css('right') : $element.css('left'))
18970
+ return module.is.vertical()
18971
+ ? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
18972
+ : (module.is.reversed() ? $element.css('right') : $element.css('left'))
18844
18973
  ;
18845
-
18846
- return pos;
18847
18974
  },
18848
18975
  positionFromValue: function (val) {
18849
18976
  var
@@ -18867,6 +18994,7 @@
18867
18994
  position = Math.round(ratio * trackLength),
18868
18995
  adjustedPos = step === 0 ? position : Math.round(position / step) * step
18869
18996
  ;
18997
+ module.verbose('Determined position: ' + position + ' from ratio: ' + ratio);
18870
18998
 
18871
18999
  return adjustedPos;
18872
19000
  },
@@ -19090,12 +19218,12 @@
19090
19218
  }
19091
19219
  if (!$currThumb.hasClass('second')) {
19092
19220
  if (settings.preventCrossover && module.is.range()) {
19093
- newValue = Math.min(module.secondThumbVal, newValue);
19221
+ newValue = Math.min(module.secondThumbVal - (settings.minRange || 0), newValue);
19094
19222
  }
19095
19223
  module.thumbVal = newValue;
19096
19224
  } else {
19097
19225
  if (settings.preventCrossover && module.is.range()) {
19098
- newValue = Math.max(module.thumbVal, newValue);
19226
+ newValue = Math.max(module.thumbVal + (settings.minRange || 0), newValue);
19099
19227
  }
19100
19228
  module.secondThumbVal = newValue;
19101
19229
  }
@@ -19114,6 +19242,10 @@
19114
19242
  thumbVal = module.thumbVal || module.get.min(),
19115
19243
  secondThumbVal = module.secondThumbVal || module.get.min()
19116
19244
  ;
19245
+ if (settings.showThumbTooltip) {
19246
+ var precision = module.get.precision();
19247
+ $targetThumb.attr('data-tooltip', Math.round(newValue * precision) / precision);
19248
+ }
19117
19249
  if (module.is.range()) {
19118
19250
  if (!$targetThumb.hasClass('second')) {
19119
19251
  position = newPos;
@@ -19202,6 +19334,14 @@
19202
19334
  settings: function () {
19203
19335
  if (settings.start !== false) {
19204
19336
  if (module.is.range()) {
19337
+ var rangeDiff = settings.end - settings.start;
19338
+ if (rangeDiff < 0
19339
+ || (settings.minRange && rangeDiff < settings.minRange)
19340
+ || (settings.maxRange && rangeDiff > settings.maxRange)
19341
+ || (settings.minRange && settings.maxRange && settings.minRange > settings.maxRange)
19342
+ ) {
19343
+ module.error(error.invalidRanges, settings.start, settings.end, settings.minRange, settings.maxRange);
19344
+ }
19205
19345
  module.debug('Start position set from settings', settings.start, settings.end);
19206
19346
  module.set.rangeValue(settings.start, settings.end);
19207
19347
  } else {
@@ -19394,6 +19534,7 @@
19394
19534
  error: {
19395
19535
  method: 'The method you called is not defined.',
19396
19536
  notrange: 'This slider is not a range slider',
19537
+ invalidRanges: 'Invalid range settings (start/end/minRange/maxRange)',
19397
19538
  },
19398
19539
 
19399
19540
  metadata: {
@@ -19406,6 +19547,8 @@
19406
19547
  step: 1,
19407
19548
  start: 0,
19408
19549
  end: 20,
19550
+ minRange: false,
19551
+ maxRange: false,
19409
19552
  labelType: 'number',
19410
19553
  showLabelTicks: false,
19411
19554
  smooth: false,
@@ -19442,6 +19585,13 @@
19442
19585
  downArrow: 40,
19443
19586
  },
19444
19587
 
19588
+ restrictedLabels: [],
19589
+ showThumbTooltip: false,
19590
+ tooltipConfig: {
19591
+ position: 'top center',
19592
+ variation: 'tiny black',
19593
+ },
19594
+
19445
19595
  labelTypes: {
19446
19596
  number: 'number',
19447
19597
  letter: 'letter',
@@ -19453,7 +19603,7 @@
19453
19603
  })(jQuery, window, document);
19454
19604
 
19455
19605
  /*!
19456
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Rating
19606
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Rating
19457
19607
  * https://github.com/fomantic/Fomantic-UI/
19458
19608
  *
19459
19609
  *
@@ -19992,7 +20142,7 @@
19992
20142
  })(jQuery, window, document);
19993
20143
 
19994
20144
  /*!
19995
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Search
20145
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Search
19996
20146
  * https://github.com/fomantic/Fomantic-UI/
19997
20147
  *
19998
20148
  *
@@ -20554,6 +20704,7 @@
20554
20704
  if (cache) {
20555
20705
  module.debug('Reading result from cache', searchTerm);
20556
20706
  module.save.results(cache.results);
20707
+ settings.onResults.call(element, cache.results, true);
20557
20708
  module.addResults(cache.html);
20558
20709
  module.inject.id(cache.results);
20559
20710
  callback();
@@ -21338,7 +21489,7 @@
21338
21489
  onResultsAdd: false,
21339
21490
 
21340
21491
  onSearchQuery: function (query) {},
21341
- onResults: function (response) {},
21492
+ onResults: function (response, fromCache) {},
21342
21493
 
21343
21494
  onResultsOpen: function () {},
21344
21495
  onResultsClose: function () {},
@@ -21569,7 +21720,7 @@
21569
21720
  })(jQuery, window, document);
21570
21721
 
21571
21722
  /*!
21572
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Shape
21723
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Shape
21573
21724
  * https://github.com/fomantic/Fomantic-UI/
21574
21725
  *
21575
21726
  *
@@ -22365,7 +22516,7 @@
22365
22516
  })(jQuery, window, document);
22366
22517
 
22367
22518
  /*!
22368
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Sidebar
22519
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Sidebar
22369
22520
  * https://github.com/fomantic/Fomantic-UI/
22370
22521
  *
22371
22522
  *
@@ -23448,7 +23599,7 @@
23448
23599
  })(jQuery, window, document);
23449
23600
 
23450
23601
  /*!
23451
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Sticky
23602
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Sticky
23452
23603
  * https://github.com/fomantic/Fomantic-UI/
23453
23604
  *
23454
23605
  *
@@ -24364,7 +24515,7 @@
24364
24515
  })(jQuery, window, document);
24365
24516
 
24366
24517
  /*!
24367
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Tab
24518
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Tab
24368
24519
  * https://github.com/fomantic/Fomantic-UI/
24369
24520
  *
24370
24521
  *
@@ -25328,7 +25479,7 @@
25328
25479
  })(jQuery, window, document);
25329
25480
 
25330
25481
  /*!
25331
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Toast
25482
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Toast
25332
25483
  * https://github.com/fomantic/Fomantic-UI/
25333
25484
  *
25334
25485
  *
@@ -25446,11 +25597,11 @@
25446
25597
  if ($toastBox) {
25447
25598
  module.debug('Removing toast', $toastBox);
25448
25599
  module.unbind.events();
25600
+ settings.onRemove.call($toastBox, element);
25449
25601
  $toastBox.remove();
25450
25602
  $toastBox = undefined;
25451
25603
  $toast = undefined;
25452
25604
  $animationObject = undefined;
25453
- settings.onRemove.call($toastBox, element);
25454
25605
  $progress = undefined;
25455
25606
  $progressBar = undefined;
25456
25607
  $close = undefined;
@@ -26289,7 +26440,7 @@
26289
26440
  })(jQuery, window, document);
26290
26441
 
26291
26442
  /*!
26292
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Transition
26443
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Transition
26293
26444
  * https://github.com/fomantic/Fomantic-UI/
26294
26445
  *
26295
26446
  *
@@ -27320,7 +27471,7 @@
27320
27471
  })(jQuery, window, document);
27321
27472
 
27322
27473
  /*!
27323
- * # Fomantic-UI 2.9.3-beta.2+824a375 - API
27474
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - API
27324
27475
  * https://github.com/fomantic/Fomantic-UI/
27325
27476
  *
27326
27477
  *
@@ -28541,7 +28692,7 @@
28541
28692
  })(jQuery, window, document);
28542
28693
 
28543
28694
  /*!
28544
- * # Fomantic-UI 2.9.3-beta.2+824a375 - State
28695
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - State
28545
28696
  * https://github.com/fomantic/Fomantic-UI/
28546
28697
  *
28547
28698
  *
@@ -29237,7 +29388,7 @@
29237
29388
  })(jQuery, window, document);
29238
29389
 
29239
29390
  /*!
29240
- * # Fomantic-UI 2.9.3-beta.2+824a375 - Visibility
29391
+ * # Fomantic-UI 2.9.3-beta.20+1e3f606 - Visibility
29241
29392
  * https://github.com/fomantic/Fomantic-UI/
29242
29393
  *
29243
29394
  *