fomantic-ui 2.9.2-beta.8 → 2.9.2

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 (179) hide show
  1. package/CHANGELOG.md +35 -0
  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 +1 -1
  13. package/dist/components/button.min.css +1 -1
  14. package/dist/components/calendar.css +1 -1
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/calendar.min.css +1 -1
  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 +40 -40
  21. package/dist/components/checkbox.js +1 -1
  22. package/dist/components/checkbox.min.css +2 -2
  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 +1 -1
  27. package/dist/components/container.min.css +1 -1
  28. package/dist/components/dimmer.css +1 -1
  29. package/dist/components/dimmer.js +1 -1
  30. package/dist/components/dimmer.min.css +1 -1
  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 +8 -6
  35. package/dist/components/dropdown.js +1 -1
  36. package/dist/components/dropdown.min.css +2 -2
  37. package/dist/components/dropdown.min.js +1 -1
  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 +2 -2
  43. package/dist/components/emoji.min.css +2 -2
  44. package/dist/components/feed.css +1 -1
  45. package/dist/components/feed.min.css +1 -1
  46. package/dist/components/flag.css +1 -1
  47. package/dist/components/flag.min.css +1 -1
  48. package/dist/components/flyout.css +1 -1
  49. package/dist/components/flyout.js +1 -1
  50. package/dist/components/flyout.min.css +1 -1
  51. package/dist/components/flyout.min.js +1 -1
  52. package/dist/components/form.css +66 -37
  53. package/dist/components/form.js +115 -105
  54. package/dist/components/form.min.css +2 -2
  55. package/dist/components/form.min.js +2 -2
  56. package/dist/components/grid.css +7 -1
  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 +59 -25
  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 +1 -1
  69. package/dist/components/label.min.css +1 -1
  70. package/dist/components/list.css +1 -1
  71. package/dist/components/list.min.css +1 -1
  72. package/dist/components/loader.css +1 -1
  73. package/dist/components/loader.min.css +1 -1
  74. package/dist/components/menu.css +30 -6
  75. package/dist/components/menu.min.css +9 -1
  76. package/dist/components/message.css +1 -1
  77. package/dist/components/message.min.css +1 -1
  78. package/dist/components/modal.css +1 -1
  79. package/dist/components/modal.js +1 -1
  80. package/dist/components/modal.min.css +1 -1
  81. package/dist/components/modal.min.js +1 -1
  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 +147 -2
  89. package/dist/components/popup.js +18 -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 +1 -1
  107. package/dist/components/search.js +1 -1
  108. package/dist/components/search.min.css +1 -1
  109. package/dist/components/search.min.js +1 -1
  110. package/dist/components/segment.css +24 -2
  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 -10
  121. package/dist/components/site.js +1 -1
  122. package/dist/components/site.min.css +2 -2
  123. package/dist/components/site.min.js +1 -1
  124. package/dist/components/slider.css +9 -6
  125. package/dist/components/slider.js +1 -1
  126. package/dist/components/slider.min.css +9 -1
  127. package/dist/components/slider.min.js +1 -1
  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 +1 -1
  143. package/dist/components/table.min.css +1 -1
  144. package/dist/components/text.css +2 -2
  145. package/dist/components/text.min.css +2 -2
  146. package/dist/components/toast.css +1 -1
  147. package/dist/components/toast.js +1 -1
  148. package/dist/components/toast.min.css +1 -1
  149. package/dist/components/toast.min.js +1 -1
  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 +516 -185
  157. package/dist/semantic.js +158 -136
  158. package/dist/semantic.min.css +2 -2
  159. package/dist/semantic.min.js +2 -2
  160. package/package.json +2 -2
  161. package/src/definitions/behaviors/form.js +114 -104
  162. package/src/definitions/collections/form.less +4 -14
  163. package/src/definitions/collections/grid.less +9 -0
  164. package/src/definitions/collections/menu.less +39 -6
  165. package/src/definitions/elements/emoji.less +2 -2
  166. package/src/definitions/elements/input.less +6 -20
  167. package/src/definitions/elements/placeholder.less +1 -1
  168. package/src/definitions/elements/segment.less +27 -1
  169. package/src/definitions/elements/text.less +1 -1
  170. package/src/definitions/globals/site.less +0 -18
  171. package/src/definitions/modules/checkbox.less +39 -39
  172. package/src/definitions/modules/dropdown.less +6 -10
  173. package/src/definitions/modules/embed.less +1 -1
  174. package/src/definitions/modules/popup.js +17 -5
  175. package/src/definitions/modules/popup.less +47 -3
  176. package/src/definitions/modules/progress.less +1 -1
  177. package/src/definitions/modules/slider.less +10 -0
  178. package/src/themes/default/globals/variation.variables +4 -0
  179. package/src/themes/default/modules/popup.variables +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fomantic-ui",
3
- "version": "2.9.2-beta.8+8838309",
3
+ "version": "2.9.2",
4
4
  "description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
5
5
  "keywords": [
6
6
  "fomantic-ui",
@@ -91,4 +91,4 @@
91
91
  },
92
92
  "title": "Fomantic UI",
93
93
  "style": "dist/semantic.css"
94
- }
94
+ }
@@ -193,7 +193,7 @@
193
193
  $prompt = $fieldGroup.find(selector.prompt),
194
194
  $calendar = $field.closest(selector.uiCalendar),
195
195
  defaultValue = $field.data(metadata.defaultValue) || '',
196
- isCheckbox = $element.is(selector.uiCheckbox),
196
+ isCheckbox = $field.is(selector.checkbox),
197
197
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
198
198
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
199
199
  isErrored = $fieldGroup.hasClass(className.error)
@@ -227,7 +227,7 @@
227
227
  $calendar = $field.closest(selector.uiCalendar),
228
228
  $prompt = $fieldGroup.find(selector.prompt),
229
229
  defaultValue = $field.data(metadata.defaultValue),
230
- isCheckbox = $element.is(selector.uiCheckbox),
230
+ isCheckbox = $field.is(selector.checkbox),
231
231
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
232
232
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
233
233
  isErrored = $fieldGroup.hasClass(className.error)
@@ -244,7 +244,7 @@
244
244
  module.verbose('Resetting dropdown value', $element, defaultValue);
245
245
  $element.dropdown('restore defaults', true);
246
246
  } else if (isCheckbox) {
247
- module.verbose('Resetting checkbox value', $element, defaultValue);
247
+ module.verbose('Resetting checkbox value', $field, defaultValue);
248
248
  $field.prop('checked', defaultValue);
249
249
  } else if (isCalendar) {
250
250
  $calendar.calendar('set date', defaultValue);
@@ -533,14 +533,12 @@
533
533
  : rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
534
534
  requiresValue = prompt.search('{value}') !== -1,
535
535
  requiresName = prompt.search('{name}') !== -1,
536
- $label,
537
- name,
538
536
  parts,
539
537
  suffixPrompt
540
538
  ;
541
- if (ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
539
+ if (ancillary && ['integer', 'decimal', 'number', 'size'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
542
540
  parts = ancillary.split('..', 2);
543
- if (!rule.prompt) {
541
+ if (!rule.prompt && ruleName !== 'size') {
544
542
  suffixPrompt = parts[0] === ''
545
543
  ? settings.prompt.maxValue.replace(/{ruleValue}/g, '{max}')
546
544
  : (parts[1] === ''
@@ -551,15 +549,14 @@
551
549
  prompt = prompt.replace(/{min}/g, parts[0]);
552
550
  prompt = prompt.replace(/{max}/g, parts[1]);
553
551
  }
552
+ if (ancillary && ['match', 'different'].indexOf(ruleName) >= 0) {
553
+ prompt = prompt.replace(/{ruleValue}/g, module.get.fieldLabel(ancillary, true));
554
+ }
554
555
  if (requiresValue) {
555
556
  prompt = prompt.replace(/{value}/g, $field.val());
556
557
  }
557
558
  if (requiresName) {
558
- $label = $field.closest(selector.group).find('label').eq(0);
559
- name = $label.length === 1
560
- ? $label.text()
561
- : $field.prop('placeholder') || settings.text.unspecifiedField;
562
- prompt = prompt.replace(/{name}/g, name);
559
+ prompt = prompt.replace(/{name}/g, module.get.fieldLabel($field));
563
560
  }
564
561
  prompt = prompt.replace(/{identifier}/g, field.identifier);
565
562
  prompt = prompt.replace(/{ruleValue}/g, ancillary);
@@ -599,7 +596,7 @@
599
596
  // refresh selector cache
600
597
  (instance || module).refresh();
601
598
  },
602
- field: function (identifier) {
599
+ field: function (identifier, strict) {
603
600
  module.verbose('Finding field with identifier', identifier);
604
601
  identifier = module.escape.string(identifier);
605
602
  var t;
@@ -621,18 +618,29 @@
621
618
  }
622
619
  module.error(error.noField.replace('{identifier}', identifier));
623
620
 
624
- return $('<input/>');
621
+ return strict ? $() : $('<input/>');
625
622
  },
626
- fields: function (fields) {
623
+ fields: function (fields, strict) {
627
624
  var
628
625
  $fields = $()
629
626
  ;
630
627
  $.each(fields, function (index, name) {
631
- $fields = $fields.add(module.get.field(name));
628
+ $fields = $fields.add(module.get.field(name, strict));
632
629
  });
633
630
 
634
631
  return $fields;
635
632
  },
633
+ fieldLabel: function (identifier, useIdAsFallback) {
634
+ var $field = typeof identifier === 'string'
635
+ ? module.get.field(identifier)
636
+ : identifier,
637
+ $label = $field.closest(selector.group).find('label').eq(0)
638
+ ;
639
+
640
+ return $label.length === 1
641
+ ? $label.text()
642
+ : $field.prop('placeholder') || (useIdAsFallback ? identifier : settings.text.unspecifiedField);
643
+ },
636
644
  validation: function ($field) {
637
645
  var
638
646
  fieldValidation,
@@ -655,20 +663,22 @@
655
663
 
656
664
  return fieldValidation || false;
657
665
  },
658
- value: function (field) {
666
+ value: function (field, strict) {
659
667
  var
660
668
  fields = [],
661
- results
669
+ results,
670
+ resultKeys
662
671
  ;
663
672
  fields.push(field);
664
- results = module.get.values.call(element, fields);
673
+ results = module.get.values.call(element, fields, strict);
674
+ resultKeys = Object.keys(results);
665
675
 
666
- return results[field];
676
+ return resultKeys.length > 0 ? results[resultKeys[0]] : undefined;
667
677
  },
668
- values: function (fields) {
678
+ values: function (fields, strict) {
669
679
  var
670
- $fields = Array.isArray(fields)
671
- ? module.get.fields(fields)
680
+ $fields = Array.isArray(fields) && fields.length > 0
681
+ ? module.get.fields(fields, strict)
672
682
  : $field,
673
683
  values = {}
674
684
  ;
@@ -786,16 +796,8 @@
786
796
 
787
797
  field: function (identifier) {
788
798
  module.verbose('Checking for existence of a field with identifier', identifier);
789
- identifier = module.escape.string(identifier);
790
- if (typeof identifier !== 'string') {
791
- module.error(error.identifier, identifier);
792
- }
793
799
 
794
- return (
795
- $field.filter('#' + identifier).length > 0
796
- || $field.filter('[name="' + identifier + '"]').length > 0
797
- || $field.filter('[data-' + metadata.validate + '="' + identifier + '"]').length > 0
798
- );
800
+ return module.get.field(identifier, true).length > 0;
799
801
  },
800
802
 
801
803
  },
@@ -819,6 +821,22 @@
819
821
  },
820
822
  },
821
823
 
824
+ checkErrors: function (errors, internal) {
825
+ if (!errors || errors.length === 0) {
826
+ if (!internal) {
827
+ module.error(settings.error.noErrorMessage);
828
+ }
829
+
830
+ return false;
831
+ }
832
+ if (!internal) {
833
+ errors = typeof errors === 'string'
834
+ ? [errors]
835
+ : errors;
836
+ }
837
+
838
+ return errors;
839
+ },
822
840
  add: {
823
841
  // alias
824
842
  rule: function (name, rules) {
@@ -862,15 +880,16 @@
862
880
  module.refreshEvents();
863
881
  },
864
882
  prompt: function (identifier, errors, internal) {
883
+ errors = module.checkErrors(errors);
884
+ if (errors === false) {
885
+ return;
886
+ }
865
887
  var
866
888
  $field = module.get.field(identifier),
867
889
  $fieldGroup = $field.closest($group),
868
890
  $prompt = $fieldGroup.children(selector.prompt),
869
891
  promptExists = $prompt.length > 0
870
892
  ;
871
- errors = typeof errors === 'string'
872
- ? [errors]
873
- : errors;
874
893
  module.verbose('Adding field error state', identifier);
875
894
  if (!internal) {
876
895
  $fieldGroup
@@ -903,11 +922,40 @@
903
922
  }
904
923
  },
905
924
  errors: function (errors) {
925
+ errors = module.checkErrors(errors);
926
+ if (errors === false) {
927
+ return;
928
+ }
906
929
  module.debug('Adding form error messages', errors);
907
930
  module.set.error();
908
- $message
909
- .html(settings.templates.error(errors))
931
+ var customErrors = [],
932
+ tempErrors
910
933
  ;
934
+ if ($.isPlainObject(errors)) {
935
+ $.each(Object.keys(errors), function (i, id) {
936
+ if (module.checkErrors(errors[id], true) !== false) {
937
+ if (settings.inline) {
938
+ module.add.prompt(id, errors[id]);
939
+ } else {
940
+ tempErrors = module.checkErrors(errors[id]);
941
+ if (tempErrors !== false) {
942
+ $.each(tempErrors, function (index, tempError) {
943
+ customErrors.push(settings.prompt.addErrors
944
+ .replace(/{name}/g, module.get.fieldLabel(id))
945
+ .replace(/{error}/g, tempError));
946
+ });
947
+ }
948
+ }
949
+ }
950
+ });
951
+ } else {
952
+ customErrors = errors;
953
+ }
954
+ if (customErrors.length > 0) {
955
+ $message
956
+ .html(settings.templates.error(customErrors))
957
+ ;
958
+ }
911
959
  },
912
960
  },
913
961
 
@@ -1012,15 +1060,19 @@
1012
1060
  $el = $(el),
1013
1061
  $parent = $el.parent(),
1014
1062
  isCheckbox = $el.filter(selector.checkbox).length > 0,
1015
- isDropdown = $parent.is(selector.uiDropdown) && module.can.useElement('dropdown'),
1016
- $calendar = $el.closest(selector.uiCalendar),
1017
- isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
1063
+ isDropdown = ($parent.is(selector.uiDropdown) || $el.is(selector.uiDropdown)) && module.can.useElement('dropdown'),
1064
+ $calendar = $el.closest(selector.uiCalendar),
1065
+ isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
1018
1066
  value = isCheckbox
1019
1067
  ? $el.is(':checked')
1020
1068
  : $el.val()
1021
1069
  ;
1022
1070
  if (isDropdown) {
1023
- $parent.dropdown('save defaults');
1071
+ if ($parent.is(selector.uiDropdown)) {
1072
+ $parent.dropdown('save defaults');
1073
+ } else {
1074
+ $el.dropdown('save defaults');
1075
+ }
1024
1076
  } else if (isCalendar) {
1025
1077
  $calendar.calendar('refresh');
1026
1078
  }
@@ -1320,7 +1372,7 @@
1320
1372
  ? String(value + '').trim()
1321
1373
  : String(value + ''));
1322
1374
 
1323
- return ruleFunction.call(field, value, ancillary, $module);
1375
+ return ruleFunction.call(field, value, ancillary, module);
1324
1376
  }
1325
1377
  ;
1326
1378
  if (!isFunction(ruleFunction)) {
@@ -1581,17 +1633,19 @@
1581
1633
  notExactly: '{name} cannot be set to exactly "{ruleValue}"',
1582
1634
  contain: '{name} must contain "{ruleValue}"',
1583
1635
  containExactly: '{name} must contain exactly "{ruleValue}"',
1584
- doesntContain: '{name} cannot contain "{ruleValue}"',
1636
+ doesntContain: '{name} cannot contain "{ruleValue}"',
1585
1637
  doesntContainExactly: '{name} cannot contain exactly "{ruleValue}"',
1586
1638
  minLength: '{name} must be at least {ruleValue} characters',
1587
1639
  exactLength: '{name} must be exactly {ruleValue} characters',
1588
1640
  maxLength: '{name} cannot be longer than {ruleValue} characters',
1641
+ size: '{name} must have a length between {min} and {max} characters',
1589
1642
  match: '{name} must match {ruleValue} field',
1590
1643
  different: '{name} must have a different value than {ruleValue} field',
1591
1644
  creditCard: '{name} must be a valid credit card number',
1592
1645
  minCount: '{name} must have at least {ruleValue} choices',
1593
1646
  exactCount: '{name} must have exactly {ruleValue} choices',
1594
1647
  maxCount: '{name} must have {ruleValue} or less choices',
1648
+ addErrors: '{name}: {error}',
1595
1649
  },
1596
1650
 
1597
1651
  selector: {
@@ -1620,11 +1674,11 @@
1620
1674
  },
1621
1675
 
1622
1676
  error: {
1623
- identifier: 'You must specify a string identifier for each field',
1624
1677
  method: 'The method you called is not defined.',
1625
1678
  noRule: 'There is no rule matching the one you specified',
1626
1679
  noField: 'Field identifier {identifier} not found',
1627
1680
  noElement: 'This module requires ui {element}',
1681
+ noErrorMessage: 'No error message provided',
1628
1682
  },
1629
1683
 
1630
1684
  templates: {
@@ -1746,7 +1800,7 @@
1746
1800
  integer: function (value, range) {
1747
1801
  return $.fn.form.settings.rules.range(value, range, 'integer');
1748
1802
  },
1749
- range: function (value, range, regExp) {
1803
+ range: function (value, range, regExp, testLength) {
1750
1804
  if (typeof regExp === 'string') {
1751
1805
  regExp = $.fn.form.settings.regExp[regExp];
1752
1806
  }
@@ -1775,6 +1829,9 @@
1775
1829
  max = parts[1] - 0;
1776
1830
  }
1777
1831
  }
1832
+ if (testLength) {
1833
+ value = value.length;
1834
+ }
1778
1835
 
1779
1836
  return (
1780
1837
  regExp.test(value)
@@ -1860,51 +1917,27 @@
1860
1917
  },
1861
1918
 
1862
1919
  // is at least string length
1863
- minLength: function (value, requiredLength) {
1864
- return value !== undefined
1865
- ? value.length >= requiredLength
1866
- : false;
1920
+ minLength: function (value, minLength) {
1921
+ return $.fn.form.settings.rules.range(value, minLength + '..', 'integer', true);
1867
1922
  },
1868
1923
 
1869
1924
  // is exactly length
1870
1925
  exactLength: function (value, requiredLength) {
1871
- return value !== undefined
1872
- ? value.length === Number(requiredLength)
1873
- : false;
1926
+ return $.fn.form.settings.rules.range(value, requiredLength + '..' + requiredLength, 'integer', true);
1874
1927
  },
1875
1928
 
1876
1929
  // is less than length
1877
1930
  maxLength: function (value, maxLength) {
1878
- return value !== undefined
1879
- ? value.length <= maxLength
1880
- : false;
1931
+ return $.fn.form.settings.rules.range(value, '..' + maxLength, 'integer', true);
1932
+ },
1933
+
1934
+ size: function (value, range) {
1935
+ return $.fn.form.settings.rules.range(value, range, 'integer', true);
1881
1936
  },
1882
1937
 
1883
1938
  // matches another field
1884
- match: function (value, identifier, $module) {
1885
- var
1886
- matchingValue,
1887
- matchingElement
1888
- ;
1889
- matchingElement = $module.find('[data-validate="' + identifier + '"]');
1890
- if (matchingElement.length > 0) {
1891
- matchingValue = matchingElement.val();
1892
- } else {
1893
- matchingElement = $module.find('#' + identifier);
1894
- if (matchingElement.length > 0) {
1895
- matchingValue = matchingElement.val();
1896
- } else {
1897
- matchingElement = $module.find('[name="' + identifier + '"]');
1898
- if (matchingElement.length > 0) {
1899
- matchingValue = matchingElement.val();
1900
- } else {
1901
- matchingElement = $module.find('[name="' + identifier + '[]"]');
1902
- if (matchingElement.length > 0) {
1903
- matchingValue = matchingElement;
1904
- }
1905
- }
1906
- }
1907
- }
1939
+ match: function (value, identifier, module) {
1940
+ var matchingValue = module.get.value(identifier, true);
1908
1941
 
1909
1942
  return matchingValue !== undefined
1910
1943
  ? value.toString() === matchingValue.toString()
@@ -1912,31 +1945,8 @@
1912
1945
  },
1913
1946
 
1914
1947
  // different than another field
1915
- different: function (value, identifier, $module) {
1916
- // use either id or name of field
1917
- var
1918
- matchingValue,
1919
- matchingElement
1920
- ;
1921
- matchingElement = $module.find('[data-validate="' + identifier + '"]');
1922
- if (matchingElement.length > 0) {
1923
- matchingValue = matchingElement.val();
1924
- } else {
1925
- matchingElement = $module.find('#' + identifier);
1926
- if (matchingElement.length > 0) {
1927
- matchingValue = matchingElement.val();
1928
- } else {
1929
- matchingElement = $module.find('[name="' + identifier + '"]');
1930
- if (matchingElement.length > 0) {
1931
- matchingValue = matchingElement.val();
1932
- } else {
1933
- matchingElement = $module.find('[name="' + identifier + '[]"]');
1934
- if (matchingElement.length > 0) {
1935
- matchingValue = matchingElement;
1936
- }
1937
- }
1938
- }
1939
- }
1948
+ different: function (value, identifier, module) {
1949
+ var matchingValue = module.get.value(identifier, true);
1940
1950
 
1941
1951
  return matchingValue !== undefined
1942
1952
  ? value.toString() !== matchingValue.toString()
@@ -383,26 +383,22 @@
383
383
  --------------------- */
384
384
 
385
385
  /* browsers require these rules separate */
386
- .ui.form ::-webkit-input-placeholder {
386
+ .ui.form ::placeholder {
387
387
  color: @inputPlaceholderColor;
388
388
  }
389
389
  .ui.form :-ms-input-placeholder when (@supportIE) {
390
390
  color: @inputPlaceholderColor !important;
391
391
  }
392
392
  .ui.form ::-moz-placeholder {
393
- color: @inputPlaceholderColor;
394
393
  opacity: 1;
395
394
  }
396
395
 
397
- .ui.form :focus::-webkit-input-placeholder {
396
+ .ui.form :focus::placeholder {
398
397
  color: @inputPlaceholderFocusColor;
399
398
  }
400
399
  .ui.form :focus:-ms-input-placeholder when (@supportIE) {
401
400
  color: @inputPlaceholderFocusColor !important;
402
401
  }
403
- .ui.form :focus::-moz-placeholder {
404
- color: @inputPlaceholderFocusColor;
405
- }
406
402
 
407
403
  /* --------------------
408
404
  Focus
@@ -649,25 +645,19 @@
649
645
  }
650
646
 
651
647
  /* Placeholder */
652
- .ui.form .@{state} ::-webkit-input-placeholder {
648
+ .ui.form .@{state} ::placeholder {
653
649
  color: @formStates[@@state][inputPlaceholderColor];
654
650
  }
655
651
  .ui.form .@{state} :-ms-input-placeholder when (@supportIE) {
656
652
  color: @formStates[@@state][inputPlaceholderColor] !important;
657
653
  }
658
- .ui.form .@{state} ::-moz-placeholder {
659
- color: @formStates[@@state][inputPlaceholderColor];
660
- }
661
654
 
662
- .ui.form .@{state} :focus::-webkit-input-placeholder {
655
+ .ui.form .@{state} :focus::placeholder {
663
656
  color: @formStates[@@state][inputPlaceholderFocusColor];
664
657
  }
665
658
  .ui.form .@{state} :focus:-ms-input-placeholder when (@supportIE) {
666
659
  color: @formStates[@@state][inputPlaceholderFocusColor] !important;
667
660
  }
668
- .ui.form .@{state} :focus::-moz-placeholder {
669
- color: @formStates[@@state][inputPlaceholderFocusColor];
670
- }
671
661
 
672
662
  /*------------------
673
663
  Dropdown State
@@ -1972,4 +1972,13 @@
1972
1972
  }
1973
1973
  }
1974
1974
 
1975
+ & when (@variationGridAttached) {
1976
+ .ui.grid .left.attached.column {
1977
+ padding-right: 0;
1978
+ }
1979
+ .ui.grid .right.attached.column {
1980
+ padding-left: 0;
1981
+ }
1982
+ }
1983
+
1975
1984
  .loadUIOverrides();
@@ -1,9 +1,8 @@
1
- /*
2
- * # Fomantic - Menu
1
+ /*!
2
+ * # Fomantic-UI - Menu
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
6
- * Copyright 2015 Contributor
7
6
  * Released under the MIT license
8
7
  * https://opensource.org/licenses/MIT
9
8
  *
@@ -796,7 +795,7 @@ Floated Menu / Item
796
795
  .ui.compact.menu .item:last-child {
797
796
  border-radius: 0 @borderRadius @borderRadius 0;
798
797
  }
799
- .ui.pagination.menu .item:last-child::before {
798
+ .ui.pagination.menu:not(.wrapping) .item:last-child::before {
800
799
  display: none;
801
800
  }
802
801
 
@@ -1490,12 +1489,17 @@ Floated Menu / Item
1490
1489
  }
1491
1490
 
1492
1491
  & when (@variationMenuCentered) {
1493
- .ui.center.aligned.menu,
1494
- .ui.centered.menu {
1492
+ .ui.center.aligned.menu:not(.fluid),
1493
+ .ui.centered.menu:not(.fluid) {
1495
1494
  display: inline-flex;
1496
1495
  transform: translateX(-50%);
1497
1496
  margin-left: 50%;
1498
1497
  }
1498
+ .ui.center.aligned.menu .item,
1499
+ .ui.centered.menu .item {
1500
+ flex: 1 0 auto;
1501
+ justify-content: center;
1502
+ }
1499
1503
  }
1500
1504
 
1501
1505
  & when (@variationMenuInverted) {
@@ -1915,6 +1919,35 @@ Floated Menu / Item
1915
1919
  }
1916
1920
  }
1917
1921
 
1922
+ & when (@variationMenuWrapping) {
1923
+ .ui.wrapping.menu {
1924
+ flex-wrap: wrap;
1925
+ & .item::before {
1926
+ right: auto;
1927
+ left: 0;
1928
+ }
1929
+ & .item:first-child::before {
1930
+ display: none;
1931
+ }
1932
+ &:not(.tabular) .item {
1933
+ &:last-of-type,
1934
+ &:last-child {
1935
+ border-right: @dividerSize solid @dividerBackground;
1936
+ }
1937
+ }
1938
+ }
1939
+ & when (@variationMenuWrapped) {
1940
+ .ui.wrapped.menu:not(.tabular) .item {
1941
+ &:first-child {
1942
+ border-bottom-left-radius: 0;
1943
+ }
1944
+ &:last-child {
1945
+ border-top-right-radius: 0;
1946
+ }
1947
+ }
1948
+ }
1949
+ }
1950
+
1918
1951
  /* --------------
1919
1952
  Sizes
1920
1953
  --------------- */
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * # Fomantic UI - Emoji
2
+ * # Fomantic-UI - Emoji
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
6
6
  * Released under the MIT license
7
- * https://github.com/fomantic/Fomantic-UI/blob/master/LICENSE.md
7
+ * https://opensource.org/licenses/MIT
8
8
  *
9
9
  */
10
10
 
@@ -64,11 +64,10 @@
64
64
 
65
65
  /* browsers require these rules separate */
66
66
 
67
- .ui.input > input::-webkit-input-placeholder {
67
+ .ui.input > input::placeholder {
68
68
  color: @placeholderColor;
69
69
  }
70
70
  .ui.input > input::-moz-placeholder {
71
- color: @placeholderColor;
72
71
  opacity: 1;
73
72
  }
74
73
  .ui.input > input:-ms-input-placeholder when (@supportIE) {
@@ -148,12 +147,8 @@
148
147
  color: @focusColor;
149
148
  box-shadow: @focusBoxShadow;
150
149
  }
151
- .ui.input.focus > input::-webkit-input-placeholder,
152
- .ui.input > input:focus::-webkit-input-placeholder {
153
- color: @placeholderFocusColor;
154
- }
155
- .ui.input.focus > input::-moz-placeholder,
156
- .ui.input > input:focus::-moz-placeholder {
150
+ .ui.input.focus > input::placeholder,
151
+ .ui.input > input:focus::placeholder {
157
152
  color: @placeholderFocusColor;
158
153
  }
159
154
  & when (@supportIE) {
@@ -192,10 +187,7 @@
192
187
  }
193
188
 
194
189
  /* Placeholder */
195
- .ui.input.@{state} > input::-webkit-input-placeholder {
196
- color: @formStates[@@state][inputPlaceholderColor];
197
- }
198
- .ui.input.@{state} > input::-moz-placeholder {
190
+ .ui.input.@{state} > input::placeholder {
199
191
  color: @formStates[@@state][inputPlaceholderColor];
200
192
  }
201
193
  .ui.input.@{state} > input:-ms-input-placeholder when (@supportIE) {
@@ -203,10 +195,7 @@
203
195
  }
204
196
 
205
197
  /* Focused Placeholder */
206
- .ui.input.@{state} > input:focus::-webkit-input-placeholder {
207
- color: @formStates[@@state][inputPlaceholderFocusColor];
208
- }
209
- .ui.input.@{state} > input:focus::-moz-placeholder {
198
+ .ui.input.@{state} > input:focus::placeholder {
210
199
  color: @formStates[@@state][inputPlaceholderFocusColor];
211
200
  }
212
201
  .ui.input.@{state} > input:focus:-ms-input-placeholder when (@supportIE){
@@ -258,10 +247,7 @@
258
247
  color: inherit;
259
248
  }
260
249
 
261
- .ui.transparent.inverted.input > input::-webkit-input-placeholder {
262
- color: @transparentInvertedPlaceholderColor;
263
- }
264
- .ui.transparent.inverted.input > input::-moz-placeholder {
250
+ .ui.transparent.inverted.input > input::placeholder {
265
251
  color: @transparentInvertedPlaceholderColor;
266
252
  }
267
253
  .ui.transparent.inverted.input > input:-ms-input-placeholder when (@supportIE) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI - Loader
2
+ * # Fomantic-UI - Placeholder
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *