fomantic-ui 2.9.2-beta.9 → 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 (176) 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 +1 -1
  89. package/dist/components/popup.js +1 -1
  90. package/dist/components/popup.min.css +1 -1
  91. package/dist/components/popup.min.js +1 -1
  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 +337 -184
  157. package/dist/semantic.js +141 -131
  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/progress.less +1 -1
  175. package/src/definitions/modules/slider.less +10 -0
  176. package/src/themes/default/globals/variation.variables +4 -0
package/dist/semantic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.2-beta.9+f3fb845
2
+ * # Fomantic UI - 2.9.2
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.2-beta.9+f3fb845 - Site
12
+ * # Fomantic-UI 2.9.2 - 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.2-beta.9+f3fb845 - Form Validation
466
+ * # Fomantic-UI 2.9.2 - Form Validation
467
467
  * https://github.com/fomantic/Fomantic-UI/
468
468
  *
469
469
  *
@@ -657,7 +657,7 @@
657
657
  $prompt = $fieldGroup.find(selector.prompt),
658
658
  $calendar = $field.closest(selector.uiCalendar),
659
659
  defaultValue = $field.data(metadata.defaultValue) || '',
660
- isCheckbox = $element.is(selector.uiCheckbox),
660
+ isCheckbox = $field.is(selector.checkbox),
661
661
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
662
662
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
663
663
  isErrored = $fieldGroup.hasClass(className.error)
@@ -691,7 +691,7 @@
691
691
  $calendar = $field.closest(selector.uiCalendar),
692
692
  $prompt = $fieldGroup.find(selector.prompt),
693
693
  defaultValue = $field.data(metadata.defaultValue),
694
- isCheckbox = $element.is(selector.uiCheckbox),
694
+ isCheckbox = $field.is(selector.checkbox),
695
695
  isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
696
696
  isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
697
697
  isErrored = $fieldGroup.hasClass(className.error)
@@ -708,7 +708,7 @@
708
708
  module.verbose('Resetting dropdown value', $element, defaultValue);
709
709
  $element.dropdown('restore defaults', true);
710
710
  } else if (isCheckbox) {
711
- module.verbose('Resetting checkbox value', $element, defaultValue);
711
+ module.verbose('Resetting checkbox value', $field, defaultValue);
712
712
  $field.prop('checked', defaultValue);
713
713
  } else if (isCalendar) {
714
714
  $calendar.calendar('set date', defaultValue);
@@ -997,14 +997,12 @@
997
997
  : rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
998
998
  requiresValue = prompt.search('{value}') !== -1,
999
999
  requiresName = prompt.search('{name}') !== -1,
1000
- $label,
1001
- name,
1002
1000
  parts,
1003
1001
  suffixPrompt
1004
1002
  ;
1005
- if (ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
1003
+ if (ancillary && ['integer', 'decimal', 'number', 'size'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
1006
1004
  parts = ancillary.split('..', 2);
1007
- if (!rule.prompt) {
1005
+ if (!rule.prompt && ruleName !== 'size') {
1008
1006
  suffixPrompt = parts[0] === ''
1009
1007
  ? settings.prompt.maxValue.replace(/{ruleValue}/g, '{max}')
1010
1008
  : (parts[1] === ''
@@ -1015,15 +1013,14 @@
1015
1013
  prompt = prompt.replace(/{min}/g, parts[0]);
1016
1014
  prompt = prompt.replace(/{max}/g, parts[1]);
1017
1015
  }
1016
+ if (ancillary && ['match', 'different'].indexOf(ruleName) >= 0) {
1017
+ prompt = prompt.replace(/{ruleValue}/g, module.get.fieldLabel(ancillary, true));
1018
+ }
1018
1019
  if (requiresValue) {
1019
1020
  prompt = prompt.replace(/{value}/g, $field.val());
1020
1021
  }
1021
1022
  if (requiresName) {
1022
- $label = $field.closest(selector.group).find('label').eq(0);
1023
- name = $label.length === 1
1024
- ? $label.text()
1025
- : $field.prop('placeholder') || settings.text.unspecifiedField;
1026
- prompt = prompt.replace(/{name}/g, name);
1023
+ prompt = prompt.replace(/{name}/g, module.get.fieldLabel($field));
1027
1024
  }
1028
1025
  prompt = prompt.replace(/{identifier}/g, field.identifier);
1029
1026
  prompt = prompt.replace(/{ruleValue}/g, ancillary);
@@ -1063,7 +1060,7 @@
1063
1060
  // refresh selector cache
1064
1061
  (instance || module).refresh();
1065
1062
  },
1066
- field: function (identifier) {
1063
+ field: function (identifier, strict) {
1067
1064
  module.verbose('Finding field with identifier', identifier);
1068
1065
  identifier = module.escape.string(identifier);
1069
1066
  var t;
@@ -1085,18 +1082,29 @@
1085
1082
  }
1086
1083
  module.error(error.noField.replace('{identifier}', identifier));
1087
1084
 
1088
- return $('<input/>');
1085
+ return strict ? $() : $('<input/>');
1089
1086
  },
1090
- fields: function (fields) {
1087
+ fields: function (fields, strict) {
1091
1088
  var
1092
1089
  $fields = $()
1093
1090
  ;
1094
1091
  $.each(fields, function (index, name) {
1095
- $fields = $fields.add(module.get.field(name));
1092
+ $fields = $fields.add(module.get.field(name, strict));
1096
1093
  });
1097
1094
 
1098
1095
  return $fields;
1099
1096
  },
1097
+ fieldLabel: function (identifier, useIdAsFallback) {
1098
+ var $field = typeof identifier === 'string'
1099
+ ? module.get.field(identifier)
1100
+ : identifier,
1101
+ $label = $field.closest(selector.group).find('label').eq(0)
1102
+ ;
1103
+
1104
+ return $label.length === 1
1105
+ ? $label.text()
1106
+ : $field.prop('placeholder') || (useIdAsFallback ? identifier : settings.text.unspecifiedField);
1107
+ },
1100
1108
  validation: function ($field) {
1101
1109
  var
1102
1110
  fieldValidation,
@@ -1119,20 +1127,22 @@
1119
1127
 
1120
1128
  return fieldValidation || false;
1121
1129
  },
1122
- value: function (field) {
1130
+ value: function (field, strict) {
1123
1131
  var
1124
1132
  fields = [],
1125
- results
1133
+ results,
1134
+ resultKeys
1126
1135
  ;
1127
1136
  fields.push(field);
1128
- results = module.get.values.call(element, fields);
1137
+ results = module.get.values.call(element, fields, strict);
1138
+ resultKeys = Object.keys(results);
1129
1139
 
1130
- return results[field];
1140
+ return resultKeys.length > 0 ? results[resultKeys[0]] : undefined;
1131
1141
  },
1132
- values: function (fields) {
1142
+ values: function (fields, strict) {
1133
1143
  var
1134
- $fields = Array.isArray(fields)
1135
- ? module.get.fields(fields)
1144
+ $fields = Array.isArray(fields) && fields.length > 0
1145
+ ? module.get.fields(fields, strict)
1136
1146
  : $field,
1137
1147
  values = {}
1138
1148
  ;
@@ -1250,16 +1260,8 @@
1250
1260
 
1251
1261
  field: function (identifier) {
1252
1262
  module.verbose('Checking for existence of a field with identifier', identifier);
1253
- identifier = module.escape.string(identifier);
1254
- if (typeof identifier !== 'string') {
1255
- module.error(error.identifier, identifier);
1256
- }
1257
1263
 
1258
- return (
1259
- $field.filter('#' + identifier).length > 0
1260
- || $field.filter('[name="' + identifier + '"]').length > 0
1261
- || $field.filter('[data-' + metadata.validate + '="' + identifier + '"]').length > 0
1262
- );
1264
+ return module.get.field(identifier, true).length > 0;
1263
1265
  },
1264
1266
 
1265
1267
  },
@@ -1283,6 +1285,22 @@
1283
1285
  },
1284
1286
  },
1285
1287
 
1288
+ checkErrors: function (errors, internal) {
1289
+ if (!errors || errors.length === 0) {
1290
+ if (!internal) {
1291
+ module.error(settings.error.noErrorMessage);
1292
+ }
1293
+
1294
+ return false;
1295
+ }
1296
+ if (!internal) {
1297
+ errors = typeof errors === 'string'
1298
+ ? [errors]
1299
+ : errors;
1300
+ }
1301
+
1302
+ return errors;
1303
+ },
1286
1304
  add: {
1287
1305
  // alias
1288
1306
  rule: function (name, rules) {
@@ -1326,15 +1344,16 @@
1326
1344
  module.refreshEvents();
1327
1345
  },
1328
1346
  prompt: function (identifier, errors, internal) {
1347
+ errors = module.checkErrors(errors);
1348
+ if (errors === false) {
1349
+ return;
1350
+ }
1329
1351
  var
1330
1352
  $field = module.get.field(identifier),
1331
1353
  $fieldGroup = $field.closest($group),
1332
1354
  $prompt = $fieldGroup.children(selector.prompt),
1333
1355
  promptExists = $prompt.length > 0
1334
1356
  ;
1335
- errors = typeof errors === 'string'
1336
- ? [errors]
1337
- : errors;
1338
1357
  module.verbose('Adding field error state', identifier);
1339
1358
  if (!internal) {
1340
1359
  $fieldGroup
@@ -1367,11 +1386,40 @@
1367
1386
  }
1368
1387
  },
1369
1388
  errors: function (errors) {
1389
+ errors = module.checkErrors(errors);
1390
+ if (errors === false) {
1391
+ return;
1392
+ }
1370
1393
  module.debug('Adding form error messages', errors);
1371
1394
  module.set.error();
1372
- $message
1373
- .html(settings.templates.error(errors))
1374
- ;
1395
+ var customErrors = [],
1396
+ tempErrors
1397
+ ;
1398
+ if ($.isPlainObject(errors)) {
1399
+ $.each(Object.keys(errors), function (i, id) {
1400
+ if (module.checkErrors(errors[id], true) !== false) {
1401
+ if (settings.inline) {
1402
+ module.add.prompt(id, errors[id]);
1403
+ } else {
1404
+ tempErrors = module.checkErrors(errors[id]);
1405
+ if (tempErrors !== false) {
1406
+ $.each(tempErrors, function (index, tempError) {
1407
+ customErrors.push(settings.prompt.addErrors
1408
+ .replace(/{name}/g, module.get.fieldLabel(id))
1409
+ .replace(/{error}/g, tempError));
1410
+ });
1411
+ }
1412
+ }
1413
+ }
1414
+ });
1415
+ } else {
1416
+ customErrors = errors;
1417
+ }
1418
+ if (customErrors.length > 0) {
1419
+ $message
1420
+ .html(settings.templates.error(customErrors))
1421
+ ;
1422
+ }
1375
1423
  },
1376
1424
  },
1377
1425
 
@@ -1476,15 +1524,19 @@
1476
1524
  $el = $(el),
1477
1525
  $parent = $el.parent(),
1478
1526
  isCheckbox = $el.filter(selector.checkbox).length > 0,
1479
- isDropdown = $parent.is(selector.uiDropdown) && module.can.useElement('dropdown'),
1480
- $calendar = $el.closest(selector.uiCalendar),
1481
- isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
1527
+ isDropdown = ($parent.is(selector.uiDropdown) || $el.is(selector.uiDropdown)) && module.can.useElement('dropdown'),
1528
+ $calendar = $el.closest(selector.uiCalendar),
1529
+ isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
1482
1530
  value = isCheckbox
1483
1531
  ? $el.is(':checked')
1484
1532
  : $el.val()
1485
1533
  ;
1486
1534
  if (isDropdown) {
1487
- $parent.dropdown('save defaults');
1535
+ if ($parent.is(selector.uiDropdown)) {
1536
+ $parent.dropdown('save defaults');
1537
+ } else {
1538
+ $el.dropdown('save defaults');
1539
+ }
1488
1540
  } else if (isCalendar) {
1489
1541
  $calendar.calendar('refresh');
1490
1542
  }
@@ -1784,7 +1836,7 @@
1784
1836
  ? String(value + '').trim()
1785
1837
  : String(value + ''));
1786
1838
 
1787
- return ruleFunction.call(field, value, ancillary, $module);
1839
+ return ruleFunction.call(field, value, ancillary, module);
1788
1840
  }
1789
1841
  ;
1790
1842
  if (!isFunction(ruleFunction)) {
@@ -2045,17 +2097,19 @@
2045
2097
  notExactly: '{name} cannot be set to exactly "{ruleValue}"',
2046
2098
  contain: '{name} must contain "{ruleValue}"',
2047
2099
  containExactly: '{name} must contain exactly "{ruleValue}"',
2048
- doesntContain: '{name} cannot contain "{ruleValue}"',
2100
+ doesntContain: '{name} cannot contain "{ruleValue}"',
2049
2101
  doesntContainExactly: '{name} cannot contain exactly "{ruleValue}"',
2050
2102
  minLength: '{name} must be at least {ruleValue} characters',
2051
2103
  exactLength: '{name} must be exactly {ruleValue} characters',
2052
2104
  maxLength: '{name} cannot be longer than {ruleValue} characters',
2105
+ size: '{name} must have a length between {min} and {max} characters',
2053
2106
  match: '{name} must match {ruleValue} field',
2054
2107
  different: '{name} must have a different value than {ruleValue} field',
2055
2108
  creditCard: '{name} must be a valid credit card number',
2056
2109
  minCount: '{name} must have at least {ruleValue} choices',
2057
2110
  exactCount: '{name} must have exactly {ruleValue} choices',
2058
2111
  maxCount: '{name} must have {ruleValue} or less choices',
2112
+ addErrors: '{name}: {error}',
2059
2113
  },
2060
2114
 
2061
2115
  selector: {
@@ -2084,11 +2138,11 @@
2084
2138
  },
2085
2139
 
2086
2140
  error: {
2087
- identifier: 'You must specify a string identifier for each field',
2088
2141
  method: 'The method you called is not defined.',
2089
2142
  noRule: 'There is no rule matching the one you specified',
2090
2143
  noField: 'Field identifier {identifier} not found',
2091
2144
  noElement: 'This module requires ui {element}',
2145
+ noErrorMessage: 'No error message provided',
2092
2146
  },
2093
2147
 
2094
2148
  templates: {
@@ -2210,7 +2264,7 @@
2210
2264
  integer: function (value, range) {
2211
2265
  return $.fn.form.settings.rules.range(value, range, 'integer');
2212
2266
  },
2213
- range: function (value, range, regExp) {
2267
+ range: function (value, range, regExp, testLength) {
2214
2268
  if (typeof regExp === 'string') {
2215
2269
  regExp = $.fn.form.settings.regExp[regExp];
2216
2270
  }
@@ -2239,6 +2293,9 @@
2239
2293
  max = parts[1] - 0;
2240
2294
  }
2241
2295
  }
2296
+ if (testLength) {
2297
+ value = value.length;
2298
+ }
2242
2299
 
2243
2300
  return (
2244
2301
  regExp.test(value)
@@ -2324,51 +2381,27 @@
2324
2381
  },
2325
2382
 
2326
2383
  // is at least string length
2327
- minLength: function (value, requiredLength) {
2328
- return value !== undefined
2329
- ? value.length >= requiredLength
2330
- : false;
2384
+ minLength: function (value, minLength) {
2385
+ return $.fn.form.settings.rules.range(value, minLength + '..', 'integer', true);
2331
2386
  },
2332
2387
 
2333
2388
  // is exactly length
2334
2389
  exactLength: function (value, requiredLength) {
2335
- return value !== undefined
2336
- ? value.length === Number(requiredLength)
2337
- : false;
2390
+ return $.fn.form.settings.rules.range(value, requiredLength + '..' + requiredLength, 'integer', true);
2338
2391
  },
2339
2392
 
2340
2393
  // is less than length
2341
2394
  maxLength: function (value, maxLength) {
2342
- return value !== undefined
2343
- ? value.length <= maxLength
2344
- : false;
2395
+ return $.fn.form.settings.rules.range(value, '..' + maxLength, 'integer', true);
2396
+ },
2397
+
2398
+ size: function (value, range) {
2399
+ return $.fn.form.settings.rules.range(value, range, 'integer', true);
2345
2400
  },
2346
2401
 
2347
2402
  // matches another field
2348
- match: function (value, identifier, $module) {
2349
- var
2350
- matchingValue,
2351
- matchingElement
2352
- ;
2353
- matchingElement = $module.find('[data-validate="' + identifier + '"]');
2354
- if (matchingElement.length > 0) {
2355
- matchingValue = matchingElement.val();
2356
- } else {
2357
- matchingElement = $module.find('#' + identifier);
2358
- if (matchingElement.length > 0) {
2359
- matchingValue = matchingElement.val();
2360
- } else {
2361
- matchingElement = $module.find('[name="' + identifier + '"]');
2362
- if (matchingElement.length > 0) {
2363
- matchingValue = matchingElement.val();
2364
- } else {
2365
- matchingElement = $module.find('[name="' + identifier + '[]"]');
2366
- if (matchingElement.length > 0) {
2367
- matchingValue = matchingElement;
2368
- }
2369
- }
2370
- }
2371
- }
2403
+ match: function (value, identifier, module) {
2404
+ var matchingValue = module.get.value(identifier, true);
2372
2405
 
2373
2406
  return matchingValue !== undefined
2374
2407
  ? value.toString() === matchingValue.toString()
@@ -2376,31 +2409,8 @@
2376
2409
  },
2377
2410
 
2378
2411
  // different than another field
2379
- different: function (value, identifier, $module) {
2380
- // use either id or name of field
2381
- var
2382
- matchingValue,
2383
- matchingElement
2384
- ;
2385
- matchingElement = $module.find('[data-validate="' + identifier + '"]');
2386
- if (matchingElement.length > 0) {
2387
- matchingValue = matchingElement.val();
2388
- } else {
2389
- matchingElement = $module.find('#' + identifier);
2390
- if (matchingElement.length > 0) {
2391
- matchingValue = matchingElement.val();
2392
- } else {
2393
- matchingElement = $module.find('[name="' + identifier + '"]');
2394
- if (matchingElement.length > 0) {
2395
- matchingValue = matchingElement.val();
2396
- } else {
2397
- matchingElement = $module.find('[name="' + identifier + '[]"]');
2398
- if (matchingElement.length > 0) {
2399
- matchingValue = matchingElement;
2400
- }
2401
- }
2402
- }
2403
- }
2412
+ different: function (value, identifier, module) {
2413
+ var matchingValue = module.get.value(identifier, true);
2404
2414
 
2405
2415
  return matchingValue !== undefined
2406
2416
  ? value.toString() !== matchingValue.toString()
@@ -2559,7 +2569,7 @@
2559
2569
  })(jQuery, window, document);
2560
2570
 
2561
2571
  /*!
2562
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Accordion
2572
+ * # Fomantic-UI 2.9.2 - Accordion
2563
2573
  * https://github.com/fomantic/Fomantic-UI/
2564
2574
  *
2565
2575
  *
@@ -3157,7 +3167,7 @@
3157
3167
  })(jQuery, window, document);
3158
3168
 
3159
3169
  /*!
3160
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Calendar
3170
+ * # Fomantic-UI 2.9.2 - Calendar
3161
3171
  * https://github.com/fomantic/Fomantic-UI/
3162
3172
  *
3163
3173
  *
@@ -5173,7 +5183,7 @@
5173
5183
  })(jQuery, window, document);
5174
5184
 
5175
5185
  /*!
5176
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Checkbox
5186
+ * # Fomantic-UI 2.9.2 - Checkbox
5177
5187
  * https://github.com/fomantic/Fomantic-UI/
5178
5188
  *
5179
5189
  *
@@ -6058,7 +6068,7 @@
6058
6068
  })(jQuery, window, document);
6059
6069
 
6060
6070
  /*!
6061
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Dimmer
6071
+ * # Fomantic-UI 2.9.2 - Dimmer
6062
6072
  * https://github.com/fomantic/Fomantic-UI/
6063
6073
  *
6064
6074
  *
@@ -6793,7 +6803,7 @@
6793
6803
  })(jQuery, window, document);
6794
6804
 
6795
6805
  /*!
6796
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Dropdown
6806
+ * # Fomantic-UI 2.9.2 - Dropdown
6797
6807
  * https://github.com/fomantic/Fomantic-UI/
6798
6808
  *
6799
6809
  *
@@ -11128,7 +11138,7 @@
11128
11138
  })(jQuery, window, document);
11129
11139
 
11130
11140
  /*!
11131
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Embed
11141
+ * # Fomantic-UI 2.9.2 - Embed
11132
11142
  * https://github.com/fomantic/Fomantic-UI/
11133
11143
  *
11134
11144
  *
@@ -11812,7 +11822,7 @@
11812
11822
  })(jQuery, window, document);
11813
11823
 
11814
11824
  /*!
11815
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Flyout
11825
+ * # Fomantic-UI 2.9.2 - Flyout
11816
11826
  * https://github.com/fomantic/Fomantic-UI/
11817
11827
  *
11818
11828
  *
@@ -13380,7 +13390,7 @@
13380
13390
  })(jQuery, window, document);
13381
13391
 
13382
13392
  /*!
13383
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Modal
13393
+ * # Fomantic-UI 2.9.2 - Modal
13384
13394
  * https://github.com/fomantic/Fomantic-UI/
13385
13395
  *
13386
13396
  *
@@ -15002,7 +15012,7 @@
15002
15012
  })(jQuery, window, document);
15003
15013
 
15004
15014
  /*!
15005
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Nag
15015
+ * # Fomantic-UI 2.9.2 - Nag
15006
15016
  * https://github.com/fomantic/Fomantic-UI/
15007
15017
  *
15008
15018
  *
@@ -15555,7 +15565,7 @@
15555
15565
  })(jQuery, window, document);
15556
15566
 
15557
15567
  /*!
15558
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Popup
15568
+ * # Fomantic-UI 2.9.2 - Popup
15559
15569
  * https://github.com/fomantic/Fomantic-UI/
15560
15570
  *
15561
15571
  *
@@ -17103,7 +17113,7 @@
17103
17113
  })(jQuery, window, document);
17104
17114
 
17105
17115
  /*!
17106
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Progress
17116
+ * # Fomantic-UI 2.9.2 - Progress
17107
17117
  * https://github.com/fomantic/Fomantic-UI/
17108
17118
  *
17109
17119
  *
@@ -18086,7 +18096,7 @@
18086
18096
  })(jQuery, window, document);
18087
18097
 
18088
18098
  /*!
18089
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Slider
18099
+ * # Fomantic-UI 2.9.2 - Slider
18090
18100
  * https://github.com/fomantic/Fomantic-UI/
18091
18101
  *
18092
18102
  *
@@ -19439,7 +19449,7 @@
19439
19449
  })(jQuery, window, document);
19440
19450
 
19441
19451
  /*!
19442
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Rating
19452
+ * # Fomantic-UI 2.9.2 - Rating
19443
19453
  * https://github.com/fomantic/Fomantic-UI/
19444
19454
  *
19445
19455
  *
@@ -19982,7 +19992,7 @@
19982
19992
  })(jQuery, window, document);
19983
19993
 
19984
19994
  /*!
19985
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Search
19995
+ * # Fomantic-UI 2.9.2 - Search
19986
19996
  * https://github.com/fomantic/Fomantic-UI/
19987
19997
  *
19988
19998
  *
@@ -21563,7 +21573,7 @@
21563
21573
  })(jQuery, window, document);
21564
21574
 
21565
21575
  /*!
21566
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Shape
21576
+ * # Fomantic-UI 2.9.2 - Shape
21567
21577
  * https://github.com/fomantic/Fomantic-UI/
21568
21578
  *
21569
21579
  *
@@ -22363,7 +22373,7 @@
22363
22373
  })(jQuery, window, document);
22364
22374
 
22365
22375
  /*!
22366
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Sidebar
22376
+ * # Fomantic-UI 2.9.2 - Sidebar
22367
22377
  * https://github.com/fomantic/Fomantic-UI/
22368
22378
  *
22369
22379
  *
@@ -23439,7 +23449,7 @@
23439
23449
  })(jQuery, window, document);
23440
23450
 
23441
23451
  /*!
23442
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Sticky
23452
+ * # Fomantic-UI 2.9.2 - Sticky
23443
23453
  * https://github.com/fomantic/Fomantic-UI/
23444
23454
  *
23445
23455
  *
@@ -24354,7 +24364,7 @@
24354
24364
  })(jQuery, window, document);
24355
24365
 
24356
24366
  /*!
24357
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Tab
24367
+ * # Fomantic-UI 2.9.2 - Tab
24358
24368
  * https://github.com/fomantic/Fomantic-UI/
24359
24369
  *
24360
24370
  *
@@ -25310,7 +25320,7 @@
25310
25320
  })(jQuery, window, document);
25311
25321
 
25312
25322
  /*!
25313
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Toast
25323
+ * # Fomantic-UI 2.9.2 - Toast
25314
25324
  * https://github.com/fomantic/Fomantic-UI/
25315
25325
  *
25316
25326
  *
@@ -26263,7 +26273,7 @@
26263
26273
  })(jQuery, window, document);
26264
26274
 
26265
26275
  /*!
26266
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Transition
26276
+ * # Fomantic-UI 2.9.2 - Transition
26267
26277
  * https://github.com/fomantic/Fomantic-UI/
26268
26278
  *
26269
26279
  *
@@ -27298,7 +27308,7 @@
27298
27308
  })(jQuery, window, document);
27299
27309
 
27300
27310
  /*!
27301
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - API
27311
+ * # Fomantic-UI 2.9.2 - API
27302
27312
  * https://github.com/fomantic/Fomantic-UI/
27303
27313
  *
27304
27314
  *
@@ -28513,7 +28523,7 @@
28513
28523
  })(jQuery, window, document);
28514
28524
 
28515
28525
  /*!
28516
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - State
28526
+ * # Fomantic-UI 2.9.2 - State
28517
28527
  * https://github.com/fomantic/Fomantic-UI/
28518
28528
  *
28519
28529
  *
@@ -29206,7 +29216,7 @@
29206
29216
  })(jQuery, window, document);
29207
29217
 
29208
29218
  /*!
29209
- * # Fomantic-UI 2.9.2-beta.9+f3fb845 - Visibility
29219
+ * # Fomantic-UI 2.9.2 - Visibility
29210
29220
  * https://github.com/fomantic/Fomantic-UI/
29211
29221
  *
29212
29222
  *