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.
- package/CHANGELOG.md +35 -0
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +40 -40
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +8 -6
- package/dist/components/dropdown.js +1 -1
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +1 -1
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +2 -2
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +1 -1
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +1 -1
- package/dist/components/form.css +66 -37
- package/dist/components/form.js +115 -105
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +7 -1
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +59 -25
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +30 -6
- package/dist/components/menu.min.css +9 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +147 -2
- package/dist/components/popup.js +18 -6
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +24 -2
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -10
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +9 -6
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.css +9 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +2 -2
- package/dist/components/text.min.css +2 -2
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +516 -185
- package/dist/semantic.js +158 -136
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +2 -2
- package/src/definitions/behaviors/form.js +114 -104
- package/src/definitions/collections/form.less +4 -14
- package/src/definitions/collections/grid.less +9 -0
- package/src/definitions/collections/menu.less +39 -6
- package/src/definitions/elements/emoji.less +2 -2
- package/src/definitions/elements/input.less +6 -20
- package/src/definitions/elements/placeholder.less +1 -1
- package/src/definitions/elements/segment.less +27 -1
- package/src/definitions/elements/text.less +1 -1
- package/src/definitions/globals/site.less +0 -18
- package/src/definitions/modules/checkbox.less +39 -39
- package/src/definitions/modules/dropdown.less +6 -10
- package/src/definitions/modules/embed.less +1 -1
- package/src/definitions/modules/popup.js +17 -5
- package/src/definitions/modules/popup.less +47 -3
- package/src/definitions/modules/progress.less +1 -1
- package/src/definitions/modules/slider.less +10 -0
- package/src/themes/default/globals/variation.variables +4 -0
- package/src/themes/default/modules/popup.variables +8 -0
package/dist/semantic.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.2
|
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
|
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
|
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 = $
|
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 = $
|
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', $
|
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
|
-
|
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[
|
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
|
-
|
1373
|
-
|
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
|
1481
|
-
isCalendar
|
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.
|
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,
|
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
|
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,
|
2328
|
-
return value
|
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
|
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
|
2343
|
-
|
2344
|
-
|
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,
|
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,
|
2380
|
-
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
15568
|
+
* # Fomantic-UI 2.9.2 - Popup
|
15559
15569
|
* https://github.com/fomantic/Fomantic-UI/
|
15560
15570
|
*
|
15561
15571
|
*
|
@@ -15681,9 +15691,9 @@
|
|
15681
15691
|
}
|
15682
15692
|
}
|
15683
15693
|
if (settings.popup) {
|
15684
|
-
|
15694
|
+
module.set.invisible();
|
15685
15695
|
$offsetParent = module.get.offsetParent();
|
15686
|
-
|
15696
|
+
module.remove.invisible();
|
15687
15697
|
if (settings.movePopup && module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {
|
15688
15698
|
module.debug('Moving popup to the same offset parent as target');
|
15689
15699
|
$popup
|
@@ -16457,8 +16467,8 @@
|
|
16457
16467
|
.css(positioning)
|
16458
16468
|
.removeClass(className.position)
|
16459
16469
|
.addClass(position)
|
16460
|
-
.addClass(className.loading)
|
16461
16470
|
;
|
16471
|
+
module.set.invisible();
|
16462
16472
|
|
16463
16473
|
popupOffset = module.get.popupOffset();
|
16464
16474
|
|
@@ -16482,7 +16492,7 @@
|
|
16482
16492
|
module.debug('Popup could not find a position to display', $popup);
|
16483
16493
|
module.error(error.cannotPlace, element);
|
16484
16494
|
module.remove.attempts();
|
16485
|
-
module.remove.
|
16495
|
+
module.remove.invisible();
|
16486
16496
|
module.reset();
|
16487
16497
|
settings.onUnplaceable.call($popup, element);
|
16488
16498
|
|
@@ -16491,7 +16501,7 @@
|
|
16491
16501
|
}
|
16492
16502
|
module.debug('Position is on stage', position);
|
16493
16503
|
module.remove.attempts();
|
16494
|
-
module.remove.
|
16504
|
+
module.remove.invisible();
|
16495
16505
|
if (settings.setFluidWidth && module.is.fluid()) {
|
16496
16506
|
module.set.fluidWidth(calculations);
|
16497
16507
|
}
|
@@ -16505,6 +16515,14 @@
|
|
16505
16515
|
$popup.css('width', calculations.container.width);
|
16506
16516
|
},
|
16507
16517
|
|
16518
|
+
loading: function () {
|
16519
|
+
$popup.addClass(className.loading);
|
16520
|
+
},
|
16521
|
+
|
16522
|
+
invisible: function () {
|
16523
|
+
$popup.addClass(className.invisible);
|
16524
|
+
},
|
16525
|
+
|
16508
16526
|
variation: function (variation) {
|
16509
16527
|
variation = variation || module.get.variation();
|
16510
16528
|
if (variation && module.has.popup()) {
|
@@ -16522,6 +16540,9 @@
|
|
16522
16540
|
loading: function () {
|
16523
16541
|
$popup.removeClass(className.loading);
|
16524
16542
|
},
|
16543
|
+
invisible: function () {
|
16544
|
+
$popup.removeClass(className.invisible);
|
16545
|
+
},
|
16525
16546
|
variation: function (variation) {
|
16526
16547
|
variation = variation || module.get.variation();
|
16527
16548
|
if (variation) {
|
@@ -17031,6 +17052,7 @@
|
|
17031
17052
|
basic: 'basic',
|
17032
17053
|
animating: 'animating',
|
17033
17054
|
dropdown: 'dropdown',
|
17055
|
+
invisible: 'invisible',
|
17034
17056
|
fluid: 'fluid',
|
17035
17057
|
loading: 'loading',
|
17036
17058
|
popup: 'ui popup',
|
@@ -17091,7 +17113,7 @@
|
|
17091
17113
|
})(jQuery, window, document);
|
17092
17114
|
|
17093
17115
|
/*!
|
17094
|
-
* # Fomantic-UI 2.9.2
|
17116
|
+
* # Fomantic-UI 2.9.2 - Progress
|
17095
17117
|
* https://github.com/fomantic/Fomantic-UI/
|
17096
17118
|
*
|
17097
17119
|
*
|
@@ -18074,7 +18096,7 @@
|
|
18074
18096
|
})(jQuery, window, document);
|
18075
18097
|
|
18076
18098
|
/*!
|
18077
|
-
* # Fomantic-UI 2.9.2
|
18099
|
+
* # Fomantic-UI 2.9.2 - Slider
|
18078
18100
|
* https://github.com/fomantic/Fomantic-UI/
|
18079
18101
|
*
|
18080
18102
|
*
|
@@ -19427,7 +19449,7 @@
|
|
19427
19449
|
})(jQuery, window, document);
|
19428
19450
|
|
19429
19451
|
/*!
|
19430
|
-
* # Fomantic-UI 2.9.2
|
19452
|
+
* # Fomantic-UI 2.9.2 - Rating
|
19431
19453
|
* https://github.com/fomantic/Fomantic-UI/
|
19432
19454
|
*
|
19433
19455
|
*
|
@@ -19970,7 +19992,7 @@
|
|
19970
19992
|
})(jQuery, window, document);
|
19971
19993
|
|
19972
19994
|
/*!
|
19973
|
-
* # Fomantic-UI 2.9.2
|
19995
|
+
* # Fomantic-UI 2.9.2 - Search
|
19974
19996
|
* https://github.com/fomantic/Fomantic-UI/
|
19975
19997
|
*
|
19976
19998
|
*
|
@@ -21551,7 +21573,7 @@
|
|
21551
21573
|
})(jQuery, window, document);
|
21552
21574
|
|
21553
21575
|
/*!
|
21554
|
-
* # Fomantic-UI 2.9.2
|
21576
|
+
* # Fomantic-UI 2.9.2 - Shape
|
21555
21577
|
* https://github.com/fomantic/Fomantic-UI/
|
21556
21578
|
*
|
21557
21579
|
*
|
@@ -22351,7 +22373,7 @@
|
|
22351
22373
|
})(jQuery, window, document);
|
22352
22374
|
|
22353
22375
|
/*!
|
22354
|
-
* # Fomantic-UI 2.9.2
|
22376
|
+
* # Fomantic-UI 2.9.2 - Sidebar
|
22355
22377
|
* https://github.com/fomantic/Fomantic-UI/
|
22356
22378
|
*
|
22357
22379
|
*
|
@@ -23427,7 +23449,7 @@
|
|
23427
23449
|
})(jQuery, window, document);
|
23428
23450
|
|
23429
23451
|
/*!
|
23430
|
-
* # Fomantic-UI 2.9.2
|
23452
|
+
* # Fomantic-UI 2.9.2 - Sticky
|
23431
23453
|
* https://github.com/fomantic/Fomantic-UI/
|
23432
23454
|
*
|
23433
23455
|
*
|
@@ -24342,7 +24364,7 @@
|
|
24342
24364
|
})(jQuery, window, document);
|
24343
24365
|
|
24344
24366
|
/*!
|
24345
|
-
* # Fomantic-UI 2.9.2
|
24367
|
+
* # Fomantic-UI 2.9.2 - Tab
|
24346
24368
|
* https://github.com/fomantic/Fomantic-UI/
|
24347
24369
|
*
|
24348
24370
|
*
|
@@ -25298,7 +25320,7 @@
|
|
25298
25320
|
})(jQuery, window, document);
|
25299
25321
|
|
25300
25322
|
/*!
|
25301
|
-
* # Fomantic-UI 2.9.2
|
25323
|
+
* # Fomantic-UI 2.9.2 - Toast
|
25302
25324
|
* https://github.com/fomantic/Fomantic-UI/
|
25303
25325
|
*
|
25304
25326
|
*
|
@@ -26251,7 +26273,7 @@
|
|
26251
26273
|
})(jQuery, window, document);
|
26252
26274
|
|
26253
26275
|
/*!
|
26254
|
-
* # Fomantic-UI 2.9.2
|
26276
|
+
* # Fomantic-UI 2.9.2 - Transition
|
26255
26277
|
* https://github.com/fomantic/Fomantic-UI/
|
26256
26278
|
*
|
26257
26279
|
*
|
@@ -27286,7 +27308,7 @@
|
|
27286
27308
|
})(jQuery, window, document);
|
27287
27309
|
|
27288
27310
|
/*!
|
27289
|
-
* # Fomantic-UI 2.9.2
|
27311
|
+
* # Fomantic-UI 2.9.2 - API
|
27290
27312
|
* https://github.com/fomantic/Fomantic-UI/
|
27291
27313
|
*
|
27292
27314
|
*
|
@@ -28501,7 +28523,7 @@
|
|
28501
28523
|
})(jQuery, window, document);
|
28502
28524
|
|
28503
28525
|
/*!
|
28504
|
-
* # Fomantic-UI 2.9.2
|
28526
|
+
* # Fomantic-UI 2.9.2 - State
|
28505
28527
|
* https://github.com/fomantic/Fomantic-UI/
|
28506
28528
|
*
|
28507
28529
|
*
|
@@ -29194,7 +29216,7 @@
|
|
29194
29216
|
})(jQuery, window, document);
|
29195
29217
|
|
29196
29218
|
/*!
|
29197
|
-
* # Fomantic-UI 2.9.2
|
29219
|
+
* # Fomantic-UI 2.9.2 - Visibility
|
29198
29220
|
* https://github.com/fomantic/Fomantic-UI/
|
29199
29221
|
*
|
29200
29222
|
*
|