fomantic-ui 2.9.1-beta.23 → 2.9.1-beta.24
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/.eslint/index.js +23 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +6 -11
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +22 -22
- 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 +47 -47
- 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 +69 -58
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +9 -9
- package/dist/components/checkbox.min.css +1 -1
- 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 +11 -11
- 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 +1 -1
- package/dist/components/dropdown.js +171 -173
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +1 -1
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +16 -16
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- 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 +21 -17
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +87 -87
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- 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 +1 -1
- package/dist/components/input.min.css +1 -1
- 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/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +30 -26
- 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 +7 -7
- 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 +1 -1
- package/dist/components/popup.js +45 -45
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +30 -32
- 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 +10 -10
- 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 +31 -31
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +34 -34
- 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 +21 -21
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +14 -14
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.js +33 -25
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +11 -11
- 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 +21 -21
- 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 +23 -23
- 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 +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +41 -17
- 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 +21 -21
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +21 -21
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +847 -800
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +3 -1
- package/src/definitions/behaviors/api.js +46 -46
- package/src/definitions/behaviors/form.js +86 -86
- package/src/definitions/behaviors/state.js +10 -10
- package/src/definitions/behaviors/visibility.js +20 -20
- package/src/definitions/globals/site.js +13 -13
- package/src/definitions/modules/accordion.js +21 -21
- package/src/definitions/modules/calendar.js +68 -57
- package/src/definitions/modules/checkbox.js +8 -8
- package/src/definitions/modules/dimmer.js +10 -10
- package/src/definitions/modules/dropdown.js +170 -172
- package/src/definitions/modules/embed.js +15 -15
- package/src/definitions/modules/flyout.js +20 -16
- package/src/definitions/modules/modal.js +29 -25
- package/src/definitions/modules/nag.js +6 -6
- package/src/definitions/modules/popup.js +44 -44
- package/src/definitions/modules/progress.js +29 -31
- package/src/definitions/modules/rating.js +9 -9
- package/src/definitions/modules/search.js +30 -30
- package/src/definitions/modules/shape.js +33 -33
- package/src/definitions/modules/sidebar.js +20 -20
- package/src/definitions/modules/slider.js +32 -24
- package/src/definitions/modules/sticky.js +20 -20
- package/src/definitions/modules/tab.js +22 -22
- package/src/definitions/modules/toast.js +40 -16
- package/src/definitions/modules/transition.js +20 -20
- package/tasks/admin/components/create.js +1 -1
- package/tasks/admin/components/init.js +1 -1
- package/tasks/admin/components/update.js +4 -4
- package/tasks/admin/distributions/create.js +2 -2
- package/tasks/admin/distributions/init.js +1 -1
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +5 -5
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +1 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/config/admin/github.js +3 -4
- package/tasks/config/npm/gulpfile.js +1 -1
- package/tasks/config/project/config.js +8 -6
- package/tasks/config/project/install.js +10 -10
- package/tasks/config/project/release.js +3 -2
- package/tasks/config/tasks.js +2 -2
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +1 -1
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +2 -1
- package/tasks/install.js +2 -2
- package/tasks/rtl/build.js +1 -3
- package/tasks/rtl/watch.js +1 -3
- package/tasks/version.js +1 -3
- package/tasks/watch.js +1 -1
package/dist/components/form.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.24+029436f - Form Validation
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
31
|
legacyParameters = arguments[1],
|
32
|
-
methodInvoked =
|
32
|
+
methodInvoked = typeof query === 'string',
|
33
33
|
queryArguments = [].slice.call(arguments, 1),
|
34
34
|
returnedValue
|
35
35
|
;
|
@@ -196,7 +196,7 @@
|
|
196
196
|
defaultValue = $field.data(metadata.defaultValue) || '',
|
197
197
|
isCheckbox = $element.is(selector.uiCheckbox),
|
198
198
|
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
|
199
|
-
isCalendar =
|
199
|
+
isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
|
200
200
|
isErrored = $fieldGroup.hasClass(className.error)
|
201
201
|
;
|
202
202
|
if (isErrored) {
|
@@ -230,7 +230,7 @@
|
|
230
230
|
defaultValue = $field.data(metadata.defaultValue),
|
231
231
|
isCheckbox = $element.is(selector.uiCheckbox),
|
232
232
|
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
|
233
|
-
isCalendar =
|
233
|
+
isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
|
234
234
|
isErrored = $fieldGroup.hasClass(className.error)
|
235
235
|
;
|
236
236
|
if (defaultValue === undefined) {
|
@@ -263,7 +263,7 @@
|
|
263
263
|
allValid = true
|
264
264
|
;
|
265
265
|
$.each(validation, function (fieldName, field) {
|
266
|
-
if (!
|
266
|
+
if (!module.validate.field(field, fieldName, true)) {
|
267
267
|
allValid = false;
|
268
268
|
}
|
269
269
|
});
|
@@ -276,7 +276,7 @@
|
|
276
276
|
$field.each(function (index, el) {
|
277
277
|
var
|
278
278
|
$el = $(el),
|
279
|
-
isCheckbox =
|
279
|
+
isCheckbox = $el.filter(selector.checkbox).length > 0,
|
280
280
|
isDirty
|
281
281
|
;
|
282
282
|
|
@@ -299,11 +299,11 @@
|
|
299
299
|
|
300
300
|
is: {
|
301
301
|
bracketedRule: function (rule) {
|
302
|
-
return
|
302
|
+
return rule.type && rule.type.match(settings.regExp.bracket);
|
303
303
|
},
|
304
304
|
// duck type rule test
|
305
305
|
shorthandRules: function (rules) {
|
306
|
-
return
|
306
|
+
return typeof rules === 'string' || Array.isArray(rules);
|
307
307
|
},
|
308
308
|
empty: function ($field) {
|
309
309
|
if (!$field || $field.length === 0) {
|
@@ -376,10 +376,10 @@
|
|
376
376
|
return initialValue !== currentValue;
|
377
377
|
},
|
378
378
|
justDirty: function () {
|
379
|
-
return
|
379
|
+
return history[0] === 'dirty';
|
380
380
|
},
|
381
381
|
justClean: function () {
|
382
|
-
return
|
382
|
+
return history[0] === 'clean';
|
383
383
|
},
|
384
384
|
},
|
385
385
|
|
@@ -397,7 +397,7 @@
|
|
397
397
|
key = event.which,
|
398
398
|
isInput = $field.is(selector.input),
|
399
399
|
isCheckbox = $field.is(selector.checkbox),
|
400
|
-
isInDropdown =
|
400
|
+
isInDropdown = $field.closest(selector.uiDropdown).length > 0,
|
401
401
|
keyCode = {
|
402
402
|
enter: 13,
|
403
403
|
escape: 27,
|
@@ -476,7 +476,7 @@
|
|
476
476
|
return false;
|
477
477
|
}
|
478
478
|
|
479
|
-
return
|
479
|
+
return rule.value !== undefined
|
480
480
|
? rule.value
|
481
481
|
: rule.type.match(settings.regExp.bracket)[1] + '';
|
482
482
|
},
|
@@ -495,11 +495,11 @@
|
|
495
495
|
return module.get.inputEvent();
|
496
496
|
},
|
497
497
|
inputEvent: function () {
|
498
|
-
return
|
498
|
+
return document.createElement('input').oninput !== undefined
|
499
499
|
? 'input'
|
500
|
-
: (document.createElement('input').onpropertychange !== undefined
|
500
|
+
: (document.createElement('input').onpropertychange !== undefined
|
501
501
|
? 'propertychange'
|
502
|
-
: 'keyup';
|
502
|
+
: 'keyup');
|
503
503
|
},
|
504
504
|
fieldsFromShorthand: function (fields) {
|
505
505
|
var
|
@@ -532,8 +532,8 @@
|
|
532
532
|
prompt = isFunction(rule.prompt)
|
533
533
|
? rule.prompt(value)
|
534
534
|
: rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
|
535
|
-
requiresValue =
|
536
|
-
requiresName =
|
535
|
+
requiresValue = prompt.search('{value}') !== -1,
|
536
|
+
requiresName = prompt.search('{name}') !== -1,
|
537
537
|
$label,
|
538
538
|
name,
|
539
539
|
parts,
|
@@ -542,13 +542,11 @@
|
|
542
542
|
if (ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
|
543
543
|
parts = ancillary.split('..', 2);
|
544
544
|
if (!rule.prompt) {
|
545
|
-
suffixPrompt =
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
: settings.prompt.range
|
551
|
-
);
|
545
|
+
suffixPrompt = parts[0] === ''
|
546
|
+
? settings.prompt.maxValue.replace(/{ruleValue}/g, '{max}')
|
547
|
+
: (parts[1] === ''
|
548
|
+
? settings.prompt.minValue.replace(/{ruleValue}/g, '{min}')
|
549
|
+
: settings.prompt.range);
|
552
550
|
prompt += suffixPrompt.replace(/{name}/g, ' ' + settings.text.and);
|
553
551
|
}
|
554
552
|
prompt = prompt.replace(/{min}/g, parts[0]);
|
@@ -559,7 +557,7 @@
|
|
559
557
|
}
|
560
558
|
if (requiresName) {
|
561
559
|
$label = $field.closest(selector.group).find('label').eq(0);
|
562
|
-
name =
|
560
|
+
name = $label.length == 1
|
563
561
|
? $label.text()
|
564
562
|
: $field.prop('placeholder') || settings.text.unspecifiedField;
|
565
563
|
prompt = prompt.replace(/{name}/g, name);
|
@@ -576,8 +574,8 @@
|
|
576
574
|
if ($.isPlainObject(parameters)) {
|
577
575
|
var
|
578
576
|
keys = Object.keys(parameters),
|
579
|
-
isLegacySettings =
|
580
|
-
?
|
577
|
+
isLegacySettings = keys.length > 0
|
578
|
+
? parameters[keys[0]].identifier !== undefined && parameters[keys[0]].rules !== undefined
|
581
579
|
: false
|
582
580
|
;
|
583
581
|
if (isLegacySettings) {
|
@@ -698,9 +696,9 @@
|
|
698
696
|
value = $field.val(),
|
699
697
|
isCheckbox = $field.is(selector.checkbox),
|
700
698
|
isRadio = $field.is(selector.radio),
|
701
|
-
isMultiple =
|
702
|
-
isCalendar =
|
703
|
-
isChecked =
|
699
|
+
isMultiple = name.indexOf('[]') !== -1,
|
700
|
+
isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
|
701
|
+
isChecked = isCheckbox
|
704
702
|
? $field.is(':checked')
|
705
703
|
: false
|
706
704
|
;
|
@@ -722,7 +720,7 @@
|
|
722
720
|
} else {
|
723
721
|
if (isRadio) {
|
724
722
|
if (values[name] === undefined || values[name] === false) {
|
725
|
-
values[name] =
|
723
|
+
values[name] = isChecked
|
726
724
|
? value || true
|
727
725
|
: false;
|
728
726
|
}
|
@@ -873,9 +871,9 @@
|
|
873
871
|
$field = module.get.field(identifier),
|
874
872
|
$fieldGroup = $field.closest($group),
|
875
873
|
$prompt = $fieldGroup.children(selector.prompt),
|
876
|
-
promptExists =
|
874
|
+
promptExists = $prompt.length > 0
|
877
875
|
;
|
878
|
-
errors =
|
876
|
+
errors = typeof errors === 'string'
|
879
877
|
? [errors]
|
880
878
|
: errors;
|
881
879
|
module.verbose('Adding field error state', identifier);
|
@@ -1014,11 +1012,11 @@
|
|
1014
1012
|
var
|
1015
1013
|
$el = $(el),
|
1016
1014
|
$parent = $el.parent(),
|
1017
|
-
isCheckbox =
|
1015
|
+
isCheckbox = $el.filter(selector.checkbox).length > 0,
|
1018
1016
|
isDropdown = $parent.is(selector.uiDropdown) && module.can.useElement('dropdown'),
|
1019
1017
|
$calendar = $el.closest(selector.uiCalendar),
|
1020
|
-
isCalendar =
|
1021
|
-
value =
|
1018
|
+
isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
|
1019
|
+
value = isCheckbox
|
1022
1020
|
? $el.is(':checked')
|
1023
1021
|
: $el.val()
|
1024
1022
|
;
|
@@ -1057,9 +1055,9 @@
|
|
1057
1055
|
isMultiple = Array.isArray(value),
|
1058
1056
|
isCheckbox = $element.is(selector.uiCheckbox) && module.can.useElement('checkbox'),
|
1059
1057
|
isDropdown = $element.is(selector.uiDropdown) && module.can.useElement('dropdown'),
|
1060
|
-
isRadio =
|
1061
|
-
isCalendar =
|
1062
|
-
fieldExists =
|
1058
|
+
isRadio = $field.is(selector.radio) && isCheckbox,
|
1059
|
+
isCalendar = $calendar.length > 0 && module.can.useElement('calendar'),
|
1060
|
+
fieldExists = $field.length > 0,
|
1063
1061
|
$multipleField
|
1064
1062
|
;
|
1065
1063
|
if (fieldExists) {
|
@@ -1135,7 +1133,7 @@
|
|
1135
1133
|
var
|
1136
1134
|
$el = $(el),
|
1137
1135
|
$elGroup = $el.closest($group),
|
1138
|
-
isCheckbox =
|
1136
|
+
isCheckbox = $el.filter(selector.checkbox).length > 0,
|
1139
1137
|
isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
|
1140
1138
|
isDisabled = $el.is(':disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
|
1141
1139
|
validation = module.get.validation($el),
|
@@ -1158,7 +1156,7 @@
|
|
1158
1156
|
});
|
1159
1157
|
},
|
1160
1158
|
optional: function (identifier, bool) {
|
1161
|
-
bool =
|
1159
|
+
bool = bool !== false;
|
1162
1160
|
$.each(validation, function (fieldName, field) {
|
1163
1161
|
if (identifier == fieldName || identifier == field.identifier) {
|
1164
1162
|
field.optional = bool;
|
@@ -1228,7 +1226,7 @@
|
|
1228
1226
|
|
1229
1227
|
// takes a validation object and returns whether field passes validation
|
1230
1228
|
field: function (field, fieldName, showErrors) {
|
1231
|
-
showErrors =
|
1229
|
+
showErrors = showErrors !== undefined
|
1232
1230
|
? showErrors
|
1233
1231
|
: true;
|
1234
1232
|
if (typeof field === 'string') {
|
@@ -1239,7 +1237,7 @@
|
|
1239
1237
|
var
|
1240
1238
|
identifier = field.identifier || fieldName,
|
1241
1239
|
$field = module.get.field(identifier),
|
1242
|
-
$dependsField =
|
1240
|
+
$dependsField = field.depends
|
1243
1241
|
? module.get.field(field.depends)
|
1244
1242
|
: false,
|
1245
1243
|
fieldValid = true,
|
@@ -1302,11 +1300,13 @@
|
|
1302
1300
|
invalidFields = [],
|
1303
1301
|
isCheckbox = $field.is(selector.checkbox),
|
1304
1302
|
isValid = function (field) {
|
1305
|
-
var value =
|
1303
|
+
var value = isCheckbox ? $(field).filter(':checked').val() : $(field).val();
|
1306
1304
|
// cast to string avoiding encoding special values
|
1307
|
-
value =
|
1305
|
+
value = value === undefined || value === '' || value === null
|
1308
1306
|
? ''
|
1309
|
-
: (settings.shouldTrim && rule.shouldTrim !== false) || rule.shouldTrim
|
1307
|
+
: ((settings.shouldTrim && rule.shouldTrim !== false) || rule.shouldTrim
|
1308
|
+
? String(value + '').trim()
|
1309
|
+
: String(value + ''));
|
1310
1310
|
|
1311
1311
|
return ruleFunction.call(field, value, ancillary, $module);
|
1312
1312
|
}
|
@@ -1442,7 +1442,7 @@
|
|
1442
1442
|
query = query.split(/[ .]/);
|
1443
1443
|
maxDepth = query.length - 1;
|
1444
1444
|
$.each(query, function (depth, value) {
|
1445
|
-
var camelCaseValue =
|
1445
|
+
var camelCaseValue = depth != maxDepth
|
1446
1446
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1447
1447
|
: query;
|
1448
1448
|
if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
|
@@ -1481,7 +1481,7 @@
|
|
1481
1481
|
module.initialize();
|
1482
1482
|
});
|
1483
1483
|
|
1484
|
-
return
|
1484
|
+
return returnedValue !== undefined
|
1485
1485
|
? returnedValue
|
1486
1486
|
: this;
|
1487
1487
|
};
|
@@ -1689,7 +1689,7 @@
|
|
1689
1689
|
|
1690
1690
|
// checkbox checked
|
1691
1691
|
checked: function () {
|
1692
|
-
return
|
1692
|
+
return $(this).filter(':checked').length > 0;
|
1693
1693
|
},
|
1694
1694
|
|
1695
1695
|
// is most likely an email
|
@@ -1713,10 +1713,10 @@
|
|
1713
1713
|
;
|
1714
1714
|
// regular expression specified as /baz/gi (flags)
|
1715
1715
|
if (regExpParts) {
|
1716
|
-
regExp =
|
1716
|
+
regExp = regExpParts.length >= 2
|
1717
1717
|
? regExpParts[1]
|
1718
1718
|
: regExp;
|
1719
|
-
flags =
|
1719
|
+
flags = regExpParts.length >= 3
|
1720
1720
|
? regExpParts[2]
|
1721
1721
|
: '';
|
1722
1722
|
}
|
@@ -1782,36 +1782,36 @@
|
|
1782
1782
|
|
1783
1783
|
// is value (case insensitive)
|
1784
1784
|
is: function (value, text) {
|
1785
|
-
text =
|
1785
|
+
text = typeof text === 'string'
|
1786
1786
|
? text.toLowerCase()
|
1787
1787
|
: text;
|
1788
|
-
value =
|
1788
|
+
value = typeof value === 'string'
|
1789
1789
|
? value.toLowerCase()
|
1790
1790
|
: value;
|
1791
1791
|
|
1792
|
-
return
|
1792
|
+
return value == text;
|
1793
1793
|
},
|
1794
1794
|
|
1795
1795
|
// is value
|
1796
1796
|
isExactly: function (value, text) {
|
1797
|
-
return
|
1797
|
+
return value == text;
|
1798
1798
|
},
|
1799
1799
|
|
1800
1800
|
// value is not another value (case insensitive)
|
1801
1801
|
not: function (value, notValue) {
|
1802
|
-
value =
|
1802
|
+
value = typeof value === 'string'
|
1803
1803
|
? value.toLowerCase()
|
1804
1804
|
: value;
|
1805
|
-
notValue =
|
1805
|
+
notValue = typeof notValue === 'string'
|
1806
1806
|
? notValue.toLowerCase()
|
1807
1807
|
: notValue;
|
1808
1808
|
|
1809
|
-
return
|
1809
|
+
return value != notValue;
|
1810
1810
|
},
|
1811
1811
|
|
1812
1812
|
// value is not another value (case sensitive)
|
1813
1813
|
notExactly: function (value, notValue) {
|
1814
|
-
return
|
1814
|
+
return value != notValue;
|
1815
1815
|
},
|
1816
1816
|
|
1817
1817
|
// value contains text (insensitive)
|
@@ -1819,7 +1819,7 @@
|
|
1819
1819
|
// escape regex characters
|
1820
1820
|
text = text.replace($.fn.form.settings.regExp.escape, '\\$&');
|
1821
1821
|
|
1822
|
-
return
|
1822
|
+
return value.search(new RegExp(text, 'i')) !== -1;
|
1823
1823
|
},
|
1824
1824
|
|
1825
1825
|
// value contains text (case sensitive)
|
@@ -1827,7 +1827,7 @@
|
|
1827
1827
|
// escape regex characters
|
1828
1828
|
text = text.replace($.fn.form.settings.regExp.escape, '\\$&');
|
1829
1829
|
|
1830
|
-
return
|
1830
|
+
return value.search(new RegExp(text)) !== -1;
|
1831
1831
|
},
|
1832
1832
|
|
1833
1833
|
// value contains text (insensitive)
|
@@ -1835,7 +1835,7 @@
|
|
1835
1835
|
// escape regex characters
|
1836
1836
|
text = text.replace($.fn.form.settings.regExp.escape, '\\$&');
|
1837
1837
|
|
1838
|
-
return
|
1838
|
+
return value.search(new RegExp(text, 'i')) === -1;
|
1839
1839
|
},
|
1840
1840
|
|
1841
1841
|
// value contains text (case sensitive)
|
@@ -1843,27 +1843,27 @@
|
|
1843
1843
|
// escape regex characters
|
1844
1844
|
text = text.replace($.fn.form.settings.regExp.escape, '\\$&');
|
1845
1845
|
|
1846
|
-
return
|
1846
|
+
return value.search(new RegExp(text)) === -1;
|
1847
1847
|
},
|
1848
1848
|
|
1849
1849
|
// is at least string length
|
1850
1850
|
minLength: function (value, requiredLength) {
|
1851
|
-
return
|
1852
|
-
?
|
1851
|
+
return value !== undefined
|
1852
|
+
? value.length >= requiredLength
|
1853
1853
|
: false;
|
1854
1854
|
},
|
1855
1855
|
|
1856
1856
|
// is exactly length
|
1857
1857
|
exactLength: function (value, requiredLength) {
|
1858
|
-
return
|
1859
|
-
?
|
1858
|
+
return value !== undefined
|
1859
|
+
? value.length == requiredLength
|
1860
1860
|
: false;
|
1861
1861
|
},
|
1862
1862
|
|
1863
1863
|
// is less than length
|
1864
1864
|
maxLength: function (value, maxLength) {
|
1865
|
-
return
|
1866
|
-
?
|
1865
|
+
return value !== undefined
|
1866
|
+
? value.length <= maxLength
|
1867
1867
|
: false;
|
1868
1868
|
},
|
1869
1869
|
|
@@ -1893,8 +1893,8 @@
|
|
1893
1893
|
}
|
1894
1894
|
}
|
1895
1895
|
|
1896
|
-
return
|
1897
|
-
?
|
1896
|
+
return matchingValue !== undefined
|
1897
|
+
? value.toString() == matchingValue.toString()
|
1898
1898
|
: false;
|
1899
1899
|
},
|
1900
1900
|
|
@@ -1925,8 +1925,8 @@
|
|
1925
1925
|
}
|
1926
1926
|
}
|
1927
1927
|
|
1928
|
-
return
|
1929
|
-
?
|
1928
|
+
return matchingValue !== undefined
|
1929
|
+
? value.toString() !== matchingValue.toString()
|
1930
1930
|
: false;
|
1931
1931
|
},
|
1932
1932
|
|
@@ -1976,7 +1976,7 @@
|
|
1976
1976
|
},
|
1977
1977
|
valid = {},
|
1978
1978
|
validCard = false,
|
1979
|
-
requiredTypes =
|
1979
|
+
requiredTypes = typeof cardTypes === 'string'
|
1980
1980
|
? cardTypes.split(',')
|
1981
1981
|
: false,
|
1982
1982
|
unionPay,
|
@@ -1997,8 +1997,8 @@
|
|
1997
1997
|
validation = cards[type];
|
1998
1998
|
if (validation) {
|
1999
1999
|
valid = {
|
2000
|
-
length:
|
2001
|
-
pattern:
|
2000
|
+
length: $.inArray(cardNumber.length, validation.length) !== -1,
|
2001
|
+
pattern: cardNumber.search(validation.pattern) !== -1,
|
2002
2002
|
};
|
2003
2003
|
if (valid.length > 0 && valid.pattern) {
|
2004
2004
|
validCard = true;
|
@@ -2013,8 +2013,8 @@
|
|
2013
2013
|
|
2014
2014
|
// skip luhn for UnionPay
|
2015
2015
|
unionPay = {
|
2016
|
-
number:
|
2017
|
-
pattern:
|
2016
|
+
number: $.inArray(cardNumber.length, cards.unionPay.length) !== -1,
|
2017
|
+
pattern: cardNumber.search(cards.unionPay.pattern) !== -1,
|
2018
2018
|
};
|
2019
2019
|
if (unionPay.number && unionPay.pattern) {
|
2020
2020
|
return true;
|
@@ -2035,7 +2035,7 @@
|
|
2035
2035
|
multiple ^= 1; // eslint-disable-line no-bitwise
|
2036
2036
|
}
|
2037
2037
|
|
2038
|
-
return
|
2038
|
+
return sum % 10 === 0 && sum > 0;
|
2039
2039
|
},
|
2040
2040
|
|
2041
2041
|
minCount: function (value, minCount) {
|
@@ -2043,21 +2043,21 @@
|
|
2043
2043
|
return true;
|
2044
2044
|
}
|
2045
2045
|
if (minCount == 1) {
|
2046
|
-
return
|
2046
|
+
return value !== '';
|
2047
2047
|
}
|
2048
2048
|
|
2049
|
-
return
|
2049
|
+
return value.split(',').length >= minCount;
|
2050
2050
|
},
|
2051
2051
|
|
2052
2052
|
exactCount: function (value, exactCount) {
|
2053
2053
|
if (exactCount == 0) {
|
2054
|
-
return
|
2054
|
+
return value === '';
|
2055
2055
|
}
|
2056
2056
|
if (exactCount == 1) {
|
2057
|
-
return
|
2057
|
+
return value !== '' && value.search(',') === -1;
|
2058
2058
|
}
|
2059
2059
|
|
2060
|
-
return
|
2060
|
+
return value.split(',').length == exactCount;
|
2061
2061
|
},
|
2062
2062
|
|
2063
2063
|
maxCount: function (value, maxCount) {
|
@@ -2065,10 +2065,10 @@
|
|
2065
2065
|
return false;
|
2066
2066
|
}
|
2067
2067
|
if (maxCount == 1) {
|
2068
|
-
return
|
2068
|
+
return value.search(',') === -1;
|
2069
2069
|
}
|
2070
2070
|
|
2071
|
-
return
|
2071
|
+
return value.split(',').length <= maxCount;
|
2072
2072
|
},
|
2073
2073
|
},
|
2074
2074
|
|
package/dist/components/grid.css
CHANGED
package/dist/components/icon.css
CHANGED
package/dist/components/item.css
CHANGED