fomantic-ui 2.9.4-beta.7 → 2.9.4-beta.70
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/.all-contributorsrc +20 -1
- package/.eslintrc.js +17 -0
- package/.github/FUNDING.yml +1 -1
- package/.github/workflows/ci.yml +5 -5
- package/.github/workflows/depsreview.yml +14 -0
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CONTRIBUTORS.md +2 -0
- package/README.md +2 -12
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -2
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +7 -3
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +21 -3
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +15 -3
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +3 -3
- 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 +10 -4
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +3 -3
- 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 +7 -3
- package/dist/components/dimmer.js +4 -2
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +46 -38
- package/dist/components/dropdown.js +104 -33
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +17 -7
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +12 -1
- package/dist/components/feed.min.css +2 -2
- 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 +4 -2
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +15 -3
- package/dist/components/form.js +66 -23
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +5 -5
- 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 +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/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +2 -1
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +7 -3
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +11 -5
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +3 -3
- 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 +10 -4
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +15 -6
- package/dist/components/progress.js +4 -2
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +2 -2
- 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 +4 -2
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- 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 +67 -14
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +3 -3
- 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 +7 -5
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +4 -2
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +14 -6
- package/dist/components/site.js +4 -2
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +4 -2
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +4 -2
- package/dist/components/state.min.js +2 -2
- 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 +4 -2
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +4 -2
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +32 -21
- package/dist/components/table.min.css +2 -2
- 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 +7 -3
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +7 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +4 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +234 -132
- package/dist/semantic.js +385 -136
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/package.json +14 -14
- package/src/definitions/behaviors/api.js +6 -2
- package/src/definitions/behaviors/form.js +65 -22
- package/src/definitions/behaviors/state.js +3 -1
- package/src/definitions/behaviors/visibility.js +3 -1
- package/src/definitions/collections/form.less +9 -2
- package/src/definitions/collections/grid.less +4 -4
- package/src/definitions/collections/message.less +1 -0
- package/src/definitions/collections/table.less +69 -54
- package/src/definitions/elements/button.less +27 -3
- package/src/definitions/globals/site.js +3 -1
- package/src/definitions/globals/site.less +17 -12
- package/src/definitions/modules/accordion.js +3 -1
- package/src/definitions/modules/calendar.js +14 -2
- package/src/definitions/modules/checkbox.js +9 -3
- package/src/definitions/modules/dimmer.js +3 -1
- package/src/definitions/modules/dimmer.less +8 -5
- package/src/definitions/modules/dropdown.js +103 -32
- package/src/definitions/modules/dropdown.less +43 -29
- package/src/definitions/modules/embed.js +16 -6
- package/src/definitions/modules/flyout.js +3 -1
- package/src/definitions/modules/modal.js +6 -2
- package/src/definitions/modules/nag.js +10 -4
- package/src/definitions/modules/popup.js +9 -3
- package/src/definitions/modules/progress.js +3 -1
- package/src/definitions/modules/progress.less +17 -5
- package/src/definitions/modules/rating.js +3 -1
- package/src/definitions/modules/search.js +66 -13
- package/src/definitions/modules/search.less +9 -2
- package/src/definitions/modules/shape.js +6 -4
- package/src/definitions/modules/sidebar.js +3 -1
- package/src/definitions/modules/slider.js +3 -1
- package/src/definitions/modules/sticky.js +3 -1
- package/src/definitions/modules/tab.js +3 -1
- package/src/definitions/modules/toast.js +6 -2
- package/src/definitions/modules/transition.js +6 -2
- package/src/definitions/views/feed.less +11 -0
- package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/src/themes/default/elements/button.variables +3 -0
- package/src/themes/default/globals/site.variables +3 -0
- package/src/themes/default/globals/variation.variables +3 -0
- package/src/themes/default/modules/dropdown.variables +3 -0
- package/src/themes/default/modules/progress.variables +1 -1
- package/src/themes/default/modules/search.variables +3 -0
- package/src/themes/default/views/feed.variables +3 -0
- package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/tasks/admin/components/create.js +4 -4
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +3 -3
- package/tasks/admin/distributions/create.js +3 -3
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +19 -10
- package/tasks/build/javascript.js +12 -5
- package/tasks/check-install.js +1 -1
- package/tasks/config/defaults.js +2 -0
- package/tasks/config/tasks.js +1 -1
- package/tasks/docs/build.js +3 -3
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +3 -1
- package/tasks/install.js +2 -2
- package/tasks/watch.js +1 -1
- package/types/fomantic-ui-accordion.d.ts +1 -1
- package/types/fomantic-ui-api.d.ts +9 -3
- package/types/fomantic-ui-calendar.d.ts +110 -9
- package/types/fomantic-ui-checkbox.d.ts +14 -4
- package/types/fomantic-ui-dimmer.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +76 -44
- package/types/fomantic-ui-embed.d.ts +19 -2
- package/types/fomantic-ui-flyout.d.ts +25 -11
- package/types/fomantic-ui-form.d.ts +123 -15
- package/types/fomantic-ui-modal.d.ts +101 -5
- package/types/fomantic-ui-nag.d.ts +4 -4
- package/types/fomantic-ui-popup.d.ts +38 -12
- package/types/fomantic-ui-progress.d.ts +12 -6
- package/types/fomantic-ui-rating.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +138 -22
- package/types/fomantic-ui-shape.d.ts +2 -2
- package/types/fomantic-ui-sidebar.d.ts +4 -4
- package/types/fomantic-ui-slider.d.ts +2 -2
- package/types/fomantic-ui-sticky.d.ts +1 -1
- package/types/fomantic-ui-tab.d.ts +6 -6
- package/types/fomantic-ui-toast.d.ts +14 -2
- package/types/fomantic-ui-transition.d.ts +41 -7
- package/types/fomantic-ui-visibility.d.ts +3 -3
- package/types/index.d.ts +25 -25
- package/types/tests.ts +188 -0
- package/types/tsconfig.json +1 -1
- package/types/fomantic-ui-tests.ts +0 -25
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fomantic-ui",
|
3
|
-
"version": "2.9.4-beta.
|
3
|
+
"version": "2.9.4-beta.70+6ca9e03",
|
4
4
|
"description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
|
5
5
|
"keywords": [
|
6
6
|
"fomantic-ui",
|
@@ -27,34 +27,33 @@
|
|
27
27
|
"scripts": {
|
28
28
|
"build": "gulp build",
|
29
29
|
"changelog": "auto-changelog -p",
|
30
|
-
"lint": "eslint --ext .js . && stylelint \"**/*.{css,less,overrides,variables}\"",
|
31
|
-
"lint-fix": "eslint --ext .js . --fix && stylelint \"**/*.{css,less,overrides,variables}\" --fix"
|
30
|
+
"lint": "eslint --ext .js,.ts . && stylelint \"**/*.{css,less,overrides,variables}\"",
|
31
|
+
"lint-fix": "eslint --ext .js,.ts . --fix && stylelint \"**/*.{css,less,overrides,variables}\" --fix"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@actions/core": "^1.6.0",
|
35
35
|
"@octokit/core": "^3.6.0",
|
36
36
|
"@octokit/rest": "^18.12.0",
|
37
|
-
"better-console": "^1.0.
|
37
|
+
"@fomantic/better-console": "^1.0.2",
|
38
38
|
"browserslist": "^4.21.4",
|
39
39
|
"del": "^6.1.1",
|
40
40
|
"extend": "^3.0.2",
|
41
|
-
"gulp": "^
|
41
|
+
"gulp": "^5.0.0",
|
42
42
|
"gulp-autoprefixer": "^8.0.0",
|
43
|
-
"gulp-chmod": "^
|
43
|
+
"gulp-chmod": "^3.0.0",
|
44
44
|
"gulp-clean-css": "^4.3.0",
|
45
45
|
"gulp-clone": "^2.0.1",
|
46
46
|
"gulp-concat": "^2.6.1",
|
47
|
-
"gulp-concat-css": "^3.1
|
48
|
-
"gulp-concat-filenames": "^1.2.
|
49
|
-
"gulp-
|
50
|
-
"gulp-dedupe": "^0.0.2",
|
47
|
+
"@fomantic/gulp-concat-css": "^3.2.1",
|
48
|
+
"@fomantic/gulp-concat-filenames": "^1.2.1",
|
49
|
+
"@fomantic/gulp-dedupe": "^0.0.3",
|
51
50
|
"gulp-flatten": "^0.4.0",
|
52
|
-
"gulp-git": "^2.
|
53
|
-
"gulp-header": "^2.
|
54
|
-
"gulp-if": "^
|
51
|
+
"@fomantic/gulp-git": "^2.11.1",
|
52
|
+
"@fomantic/gulp-header": "^2.1.1",
|
53
|
+
"gulp-if": "^3.0.0",
|
55
54
|
"gulp-json-editor": "^2.4.3",
|
56
55
|
"gulp-less": "^5.0.0",
|
57
|
-
"gulp-plumber": "^1.
|
56
|
+
"@fomantic/gulp-plumber": "^1.2.2",
|
58
57
|
"gulp-print": "^5.0.0",
|
59
58
|
"gulp-rename": "^1.4.0",
|
60
59
|
"gulp-replace": "^1.0.0",
|
@@ -68,6 +67,7 @@
|
|
68
67
|
"merge-stream": "^2.0.0",
|
69
68
|
"mkdirp": "^1.0.4",
|
70
69
|
"normalize-path": "^3.0.0",
|
70
|
+
"ordered-read-streams": "^1.0.1",
|
71
71
|
"replace-ext": "^1.0.0",
|
72
72
|
"require-dot-file": "^0.4.0",
|
73
73
|
"wrench-sui": "^0.0.3",
|
@@ -647,7 +647,9 @@
|
|
647
647
|
module.debug('Adding error state');
|
648
648
|
module.set.error();
|
649
649
|
if (module.should.removeError()) {
|
650
|
-
setTimeout(function () {
|
650
|
+
setTimeout(function () {
|
651
|
+
module.remove.error();
|
652
|
+
}, settings.errorDuration);
|
651
653
|
}
|
652
654
|
}
|
653
655
|
module.debug('API Request failed', errorMessage, xhr);
|
@@ -971,7 +973,9 @@
|
|
971
973
|
});
|
972
974
|
}
|
973
975
|
clearTimeout(module.performance.timer);
|
974
|
-
module.performance.timer = setTimeout(function () {
|
976
|
+
module.performance.timer = setTimeout(function () {
|
977
|
+
module.performance.display();
|
978
|
+
}, 500);
|
975
979
|
},
|
976
980
|
display: function () {
|
977
981
|
var
|
@@ -38,6 +38,7 @@
|
|
38
38
|
element = this,
|
39
39
|
|
40
40
|
formErrors = [],
|
41
|
+
formErrorsTracker = {},
|
41
42
|
keyHeldDown = false,
|
42
43
|
|
43
44
|
// set at run-time
|
@@ -538,6 +539,13 @@
|
|
538
539
|
fullFields[name].rules.push({ type: rule });
|
539
540
|
});
|
540
541
|
}
|
542
|
+
|
543
|
+
$.each(fullFields[name].rules, function (index, rule) {
|
544
|
+
var ruleName = module.get.ruleName(rule);
|
545
|
+
if (ruleName === 'empty') {
|
546
|
+
module.warn('*** DEPRECATED *** : Rule "empty" for field "' + name + '" will be removed in a future version. -> Use "notEmpty" rule instead.');
|
547
|
+
}
|
548
|
+
});
|
541
549
|
});
|
542
550
|
|
543
551
|
return fullFields;
|
@@ -551,9 +559,10 @@
|
|
551
559
|
ancillary = module.get.ancillaryValue(rule),
|
552
560
|
$field = module.get.field(field.identifier),
|
553
561
|
value = $field.val(),
|
554
|
-
|
555
|
-
|
556
|
-
|
562
|
+
promptCheck = rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
|
563
|
+
prompt = String(isFunction(promptCheck)
|
564
|
+
? promptCheck.call($field[0], value)
|
565
|
+
: promptCheck),
|
557
566
|
requiresValue = prompt.search('{value}') !== -1,
|
558
567
|
requiresName = prompt.search('{name}') !== -1,
|
559
568
|
parts,
|
@@ -591,10 +600,10 @@
|
|
591
600
|
},
|
592
601
|
settings: function () {
|
593
602
|
if ($.isPlainObject(parameters)) {
|
594
|
-
if (parameters.fields) {
|
595
|
-
parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
|
596
|
-
}
|
597
603
|
settings = $.extend(true, {}, $.fn.form.settings, parameters);
|
604
|
+
if (settings.fields) {
|
605
|
+
settings.fields = module.get.fieldsFromShorthand(settings.fields);
|
606
|
+
}
|
598
607
|
validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
|
599
608
|
module.verbose('Extending settings', validation, settings);
|
600
609
|
} else {
|
@@ -711,7 +720,7 @@
|
|
711
720
|
var
|
712
721
|
$field = $(field),
|
713
722
|
$calendar = $field.closest(selector.uiCalendar),
|
714
|
-
name = $field.prop('name'),
|
723
|
+
name = $field.prop('name') || $field.prop('id'),
|
715
724
|
value = $field.val(),
|
716
725
|
isCheckbox = $field.is(selector.checkbox),
|
717
726
|
isRadio = $field.is(selector.radio),
|
@@ -940,7 +949,7 @@
|
|
940
949
|
$prompt.css('display', 'none');
|
941
950
|
}
|
942
951
|
$prompt
|
943
|
-
.appendTo($fieldGroup)
|
952
|
+
.appendTo($fieldGroup.filter('.' + className.error))
|
944
953
|
;
|
945
954
|
}
|
946
955
|
$prompt
|
@@ -1237,20 +1246,20 @@
|
|
1237
1246
|
isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
|
1238
1247
|
isDisabled = $el.is(':disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
|
1239
1248
|
validation = module.get.validation($el),
|
1240
|
-
|
1249
|
+
hasNotEmptyRule = validation
|
1241
1250
|
? $.grep(validation.rules, function (rule) {
|
1242
|
-
return rule.type
|
1243
|
-
})
|
1251
|
+
return ['notEmpty', 'checked', 'empty'].indexOf(rule.type) >= 0;
|
1252
|
+
}).length > 0
|
1244
1253
|
: false,
|
1245
1254
|
identifier = module.get.identifier(validation, $el)
|
1246
1255
|
;
|
1247
|
-
if (isRequired && !isDisabled && !
|
1256
|
+
if (isRequired && !isDisabled && !hasNotEmptyRule && identifier !== undefined) {
|
1248
1257
|
if (isCheckbox) {
|
1249
1258
|
module.verbose("Adding 'checked' rule on field", identifier);
|
1250
1259
|
module.add.rule(identifier, 'checked');
|
1251
1260
|
} else {
|
1252
|
-
module.verbose("Adding '
|
1253
|
-
module.add.rule(identifier, '
|
1261
|
+
module.verbose("Adding 'notEmpty' rule on field", identifier);
|
1262
|
+
module.add.rule(identifier, 'notEmpty');
|
1254
1263
|
}
|
1255
1264
|
}
|
1256
1265
|
});
|
@@ -1277,6 +1286,7 @@
|
|
1277
1286
|
$module.removeClass(className.initial);
|
1278
1287
|
// reset errors
|
1279
1288
|
formErrors = [];
|
1289
|
+
formErrorsTracker = {};
|
1280
1290
|
if (module.determine.isValid()) {
|
1281
1291
|
module.debug('Form has no validation errors, submitting');
|
1282
1292
|
module.set.success();
|
@@ -1342,28 +1352,30 @@
|
|
1342
1352
|
var
|
1343
1353
|
identifier = field.identifier || fieldName,
|
1344
1354
|
$field = module.get.field(identifier),
|
1355
|
+
$fieldGroup = $field.closest($group),
|
1345
1356
|
$dependsField = field.depends
|
1346
1357
|
? module.get.field(field.depends)
|
1347
1358
|
: false,
|
1348
1359
|
fieldValid = true,
|
1349
1360
|
fieldErrors = [],
|
1350
|
-
isDisabled = $field.filter(':not(:disabled)').length === 0,
|
1361
|
+
isDisabled = $field.filter(':not(:disabled)').length === 0 || $fieldGroup.hasClass(className.disabled) || $fieldGroup.parent().hasClass(className.disabled),
|
1351
1362
|
validationMessage = $field[0].validationMessage,
|
1363
|
+
noNativeValidation = field.noNativeValidation || settings.noNativeValidation || $field.filter('[formnovalidate],[novalidate]').length > 0 || $module.filter('[novalidate]').length > 0,
|
1352
1364
|
errorLimit
|
1353
1365
|
;
|
1354
1366
|
if (!field.identifier) {
|
1355
1367
|
module.debug('Using field name as identifier', identifier);
|
1356
1368
|
field.identifier = identifier;
|
1357
1369
|
}
|
1358
|
-
if (validationMessage) {
|
1370
|
+
if (validationMessage && !noNativeValidation && !isDisabled) {
|
1359
1371
|
module.debug('Field is natively invalid', identifier);
|
1360
1372
|
fieldErrors.push(validationMessage);
|
1361
1373
|
fieldValid = false;
|
1362
1374
|
if (showErrors) {
|
1363
|
-
$
|
1375
|
+
$fieldGroup.addClass(className.error);
|
1364
1376
|
}
|
1365
1377
|
} else if (showErrors) {
|
1366
|
-
$
|
1378
|
+
$fieldGroup.removeClass(className.error);
|
1367
1379
|
}
|
1368
1380
|
if (isDisabled) {
|
1369
1381
|
module.debug('Field is disabled. Skipping', identifier);
|
@@ -1378,7 +1390,22 @@
|
|
1378
1390
|
var invalidFields = module.validate.rule(field, rule, true) || [];
|
1379
1391
|
if (invalidFields.length > 0) {
|
1380
1392
|
module.debug('Field is invalid', identifier, rule.type);
|
1381
|
-
|
1393
|
+
var fieldError = module.get.prompt(rule, field);
|
1394
|
+
if (!settings.inline) {
|
1395
|
+
if (
|
1396
|
+
// Always allow the first error prompt for new field identifiers
|
1397
|
+
(!(identifier in formErrorsTracker)
|
1398
|
+
// Also allow multiple error prompts per field identifier but make sure each prompt is unique
|
1399
|
+
|| formErrorsTracker[identifier].indexOf(fieldError) === -1)
|
1400
|
+
// Limit the number of unique error prompts for every field identifier if specified
|
1401
|
+
&& (!errorLimit || (formErrorsTracker[identifier] || []).length < errorLimit)
|
1402
|
+
) {
|
1403
|
+
fieldErrors.push(fieldError);
|
1404
|
+
(formErrorsTracker[identifier] = formErrorsTracker[identifier] || []).push(fieldError);
|
1405
|
+
}
|
1406
|
+
} else {
|
1407
|
+
fieldErrors.push(fieldError);
|
1408
|
+
}
|
1382
1409
|
fieldValid = false;
|
1383
1410
|
if (showErrors) {
|
1384
1411
|
$(invalidFields).closest($group).addClass(className.error);
|
@@ -1393,7 +1420,7 @@
|
|
1393
1420
|
settings.onValid.call($field);
|
1394
1421
|
}
|
1395
1422
|
} else {
|
1396
|
-
if (showErrors) {
|
1423
|
+
if (showErrors && fieldErrors.length > 0) {
|
1397
1424
|
formErrors = formErrors.concat(fieldErrors);
|
1398
1425
|
module.add.prompt(identifier, fieldErrors, true);
|
1399
1426
|
settings.onInvalid.call($field, fieldErrors);
|
@@ -1491,6 +1518,12 @@
|
|
1491
1518
|
module.error.apply(console, arguments);
|
1492
1519
|
}
|
1493
1520
|
},
|
1521
|
+
warn: function () {
|
1522
|
+
if (!settings.silent) {
|
1523
|
+
module.warn = Function.prototype.bind.call(console.warn, console, settings.name + ':');
|
1524
|
+
module.warn.apply(console, arguments);
|
1525
|
+
}
|
1526
|
+
},
|
1494
1527
|
performance: {
|
1495
1528
|
log: function (message) {
|
1496
1529
|
var
|
@@ -1511,7 +1544,9 @@
|
|
1511
1544
|
});
|
1512
1545
|
}
|
1513
1546
|
clearTimeout(module.performance.timer);
|
1514
|
-
module.performance.timer = setTimeout(function () {
|
1547
|
+
module.performance.timer = setTimeout(function () {
|
1548
|
+
module.performance.display();
|
1549
|
+
}, 500);
|
1515
1550
|
},
|
1516
1551
|
display: function () {
|
1517
1552
|
var
|
@@ -1605,6 +1640,7 @@
|
|
1605
1640
|
name: 'Form',
|
1606
1641
|
namespace: 'form',
|
1607
1642
|
|
1643
|
+
silent: false,
|
1608
1644
|
debug: false,
|
1609
1645
|
verbose: false,
|
1610
1646
|
performance: true,
|
@@ -1627,6 +1663,7 @@
|
|
1627
1663
|
errorFocus: true,
|
1628
1664
|
dateHandling: 'date', // 'date', 'input', 'formatter'
|
1629
1665
|
errorLimit: 0,
|
1666
|
+
noNativeValidation: false,
|
1630
1667
|
|
1631
1668
|
onValid: function () {},
|
1632
1669
|
onInvalid: function () {},
|
@@ -1669,6 +1706,7 @@
|
|
1669
1706
|
maxValue: '{name} must have a maximum value of {ruleValue}',
|
1670
1707
|
minValue: '{name} must have a minimum value of {ruleValue}',
|
1671
1708
|
empty: '{name} must have a value',
|
1709
|
+
notEmpty: '{name} must have a value',
|
1672
1710
|
checked: '{name} must be checked',
|
1673
1711
|
email: '{name} must be a valid e-mail',
|
1674
1712
|
url: '{name} must be a valid url',
|
@@ -1801,10 +1839,15 @@
|
|
1801
1839
|
rules: {
|
1802
1840
|
|
1803
1841
|
// is not empty or blank string
|
1804
|
-
|
1842
|
+
notEmpty: function (value) {
|
1805
1843
|
return !(value === undefined || value === '' || (Array.isArray(value) && value.length === 0));
|
1806
1844
|
},
|
1807
1845
|
|
1846
|
+
/* Deprecated */
|
1847
|
+
empty: function (value) {
|
1848
|
+
return $.fn.form.settings.rules.notEmpty(value);
|
1849
|
+
},
|
1850
|
+
|
1808
1851
|
// checkbox checked
|
1809
1852
|
checked: function () {
|
1810
1853
|
return $(this).filter(':checked').length > 0;
|
@@ -482,7 +482,9 @@
|
|
482
482
|
});
|
483
483
|
}
|
484
484
|
clearTimeout(module.performance.timer);
|
485
|
-
module.performance.timer = setTimeout(function () {
|
485
|
+
module.performance.timer = setTimeout(function () {
|
486
|
+
module.performance.display();
|
487
|
+
}, 500);
|
486
488
|
},
|
487
489
|
display: function () {
|
488
490
|
var
|
@@ -1088,7 +1088,9 @@
|
|
1088
1088
|
});
|
1089
1089
|
}
|
1090
1090
|
clearTimeout(module.performance.timer);
|
1091
|
-
module.performance.timer = setTimeout(function () {
|
1091
|
+
module.performance.timer = setTimeout(function () {
|
1092
|
+
module.performance.display();
|
1093
|
+
}, 500);
|
1092
1094
|
},
|
1093
1095
|
display: function () {
|
1094
1096
|
var
|
@@ -653,6 +653,7 @@
|
|
653
653
|
}
|
654
654
|
|
655
655
|
/* Placeholder */
|
656
|
+
.ui.form .@{state} .ui.dropdown > .default.text,
|
656
657
|
.ui.form .@{state} ::placeholder {
|
657
658
|
color: @formStates[@@state][inputPlaceholderColor];
|
658
659
|
}
|
@@ -660,6 +661,7 @@
|
|
660
661
|
color: @formStates[@@state][inputPlaceholderColor] !important;
|
661
662
|
}
|
662
663
|
|
664
|
+
.ui.form .@{state} .ui.dropdown > input:focus ~ .default.text,
|
663
665
|
.ui.form .@{state} :focus::placeholder {
|
664
666
|
color: @formStates[@@state][inputPlaceholderFocusColor];
|
665
667
|
}
|
@@ -847,12 +849,16 @@
|
|
847
849
|
}
|
848
850
|
}
|
849
851
|
|
850
|
-
.ui.ui.ui.ui.form .fields > label:empty::after,
|
851
|
-
.ui.ui.ui.ui.form .field > label:empty::after {
|
852
|
+
.ui.ui.ui.ui.form .fields:not(.required) > label:empty::after,
|
853
|
+
.ui.ui.ui.ui.form .fields:not(.grouped):not(.inline) > .field:not(.required) > label:empty::after {
|
852
854
|
content: " ";
|
853
855
|
display: inline-block;
|
854
856
|
}
|
855
857
|
|
858
|
+
.ui.ui.ui.ui.form .inline.fields .field:not(.required) > label:empty {
|
859
|
+
display: none;
|
860
|
+
}
|
861
|
+
|
856
862
|
/*******************************
|
857
863
|
Variations
|
858
864
|
*******************************/
|
@@ -866,6 +872,7 @@
|
|
866
872
|
.ui.form .inverted.segment label,
|
867
873
|
.ui.form .inverted.segment .ui.checkbox label,
|
868
874
|
.ui.inverted.form .ui.checkbox label,
|
875
|
+
.ui.inverted.form .grouped.fields > label,
|
869
876
|
.ui.inverted.form .inline.fields > label,
|
870
877
|
.ui.inverted.form .inline.fields .field > label,
|
871
878
|
.ui.inverted.form .inline.fields .field > p,
|
@@ -1723,10 +1723,10 @@
|
|
1723
1723
|
border-top: none !important;
|
1724
1724
|
}
|
1725
1725
|
& when (@variationGridInverted) {
|
1726
|
-
.ui.inverted.stackable.celled.grid > .column:not(.row),
|
1727
|
-
.ui.inverted.stackable.divided.grid > .column:not(.row),
|
1728
|
-
.ui.inverted.stackable.celled.grid > .row > .column,
|
1729
|
-
.ui.inverted.stackable.divided.grid > .row > .column {
|
1726
|
+
.ui.ui.inverted.stackable.celled.grid > .column:not(.row),
|
1727
|
+
.ui.ui.inverted.stackable.divided.grid > .column:not(.row),
|
1728
|
+
.ui.ui.inverted.stackable.celled.grid > .row > .column,
|
1729
|
+
.ui.ui.inverted.stackable.divided.grid > .row > .column {
|
1730
1730
|
border-top: @stackableInvertedMobileBorder;
|
1731
1731
|
}
|
1732
1732
|
}
|
@@ -117,16 +117,16 @@
|
|
117
117
|
.ui.table > tfoot > tr > td:first-child {
|
118
118
|
border-left: none;
|
119
119
|
}
|
120
|
-
.ui.table > tfoot > tr:
|
121
|
-
.ui.table > tfoot > tr:
|
120
|
+
.ui.table > tfoot > tr:last-child > th:first-child,
|
121
|
+
.ui.table > tfoot > tr:last-child > td:first-child {
|
122
122
|
border-radius: 0 0 0 @borderRadius;
|
123
123
|
}
|
124
|
-
.ui.table > tfoot > tr:
|
125
|
-
.ui.table > tfoot > tr:
|
124
|
+
.ui.table > tfoot > tr:last-child > th:last-child,
|
125
|
+
.ui.table > tfoot > tr:last-child > td:last-child {
|
126
126
|
border-radius: 0 0 @borderRadius 0;
|
127
127
|
}
|
128
|
-
.ui.table > tfoot > tr:
|
129
|
-
.ui.table > tfoot > tr:
|
128
|
+
.ui.table > tfoot > tr:last-child > th:only-child,
|
129
|
+
.ui.table > tfoot > tr:last-child > td:only-child {
|
130
130
|
border-radius: 0 0 @borderRadius @borderRadius;
|
131
131
|
}
|
132
132
|
|
@@ -458,13 +458,21 @@
|
|
458
458
|
display: block;
|
459
459
|
overflow-y: scroll;
|
460
460
|
overscroll-behavior: @overscrollBehavior;
|
461
|
-
scrollbar-width: thin; /* Firefox */
|
462
461
|
& > tr {
|
463
462
|
display: table;
|
464
463
|
table-layout: fixed;
|
465
464
|
width: 100%;
|
466
465
|
}
|
467
466
|
}
|
467
|
+
& when (@useCustomScrollbars) {
|
468
|
+
@supports (-moz-appearance: none) {
|
469
|
+
.ui.scrolling.table > thead,
|
470
|
+
.ui.scrolling.table > tfoot,
|
471
|
+
.ui.scrolling.table > tbody {
|
472
|
+
scrollbar-width: thin;
|
473
|
+
}
|
474
|
+
}
|
475
|
+
}
|
468
476
|
|
469
477
|
/* Camouflage scrollbars, we need them only to gain the same width as tbody */
|
470
478
|
.ui.scrolling.table > thead {
|
@@ -492,61 +500,68 @@
|
|
492
500
|
background: inherit;
|
493
501
|
border-radius: @borderRadius;
|
494
502
|
}
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
.ui.scrolling.table > tfoot {
|
499
|
-
scrollbar-color: currentColor currentColor;
|
500
|
-
& when (@supportIE) {
|
501
|
-
scrollbar-face-color: currentColor;
|
502
|
-
scrollbar-shadow-color: currentColor;
|
503
|
-
scrollbar-track-color: currentColor;
|
504
|
-
scrollbar-arrow-color: currentColor;
|
505
|
-
}
|
506
|
-
}
|
507
|
-
& when (@supportIE) {
|
508
|
-
/* IE scrollbar color needs hex values */
|
509
|
-
@media all and (-ms-high-contrast: none) {
|
510
|
-
.ui.scrolling.table > thead {
|
511
|
-
color: @headerBackgroundHex;
|
512
|
-
}
|
503
|
+
& when (@useCustomScrollbars) {
|
504
|
+
@supports (-moz-appearance: none) {
|
505
|
+
.ui.scrolling.table > thead,
|
513
506
|
.ui.scrolling.table > tfoot {
|
514
|
-
color:
|
507
|
+
scrollbar-color: currentColor currentColor;
|
515
508
|
}
|
516
|
-
|
517
|
-
|
518
|
-
|
509
|
+
}
|
510
|
+
|
511
|
+
& when (@supportIE) {
|
512
|
+
/* IE scrollbar color needs hex values */
|
513
|
+
@media all and (-ms-high-contrast: none) {
|
514
|
+
.ui.scrolling.table > thead,
|
515
|
+
.ui.scrolling.table > tfoot {
|
516
|
+
scrollbar-face-color: currentColor;
|
517
|
+
scrollbar-shadow-color: currentColor;
|
518
|
+
scrollbar-track-color: currentColor;
|
519
|
+
scrollbar-arrow-color: currentColor;
|
520
|
+
}
|
521
|
+
.ui.scrolling.table > thead {
|
522
|
+
color: @headerBackgroundHex;
|
519
523
|
}
|
520
|
-
.ui.
|
521
|
-
color: @
|
524
|
+
.ui.scrolling.table > tfoot {
|
525
|
+
color: @footerBackgroundHex;
|
526
|
+
}
|
527
|
+
& when (@variationTableInverted) {
|
528
|
+
.ui.inverted.scrolling.table > thead {
|
529
|
+
color: @invertedHeaderBackgroundHex;
|
530
|
+
}
|
531
|
+
.ui.inverted.scrolling.table > tfoot {
|
532
|
+
color: @invertedFooterBackgroundHex;
|
533
|
+
}
|
522
534
|
}
|
523
535
|
}
|
524
536
|
}
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
}
|
539
|
-
.ui.inverted.scrolling.table > tbody {
|
537
|
+
& when (@variationTableInverted) {
|
538
|
+
.ui.inverted.scrolling.table > tbody::-webkit-scrollbar-track {
|
539
|
+
background: @trackInvertedBackground;
|
540
|
+
}
|
541
|
+
.ui.inverted.scrolling.table > tbody::-webkit-scrollbar-thumb {
|
542
|
+
background: @thumbInvertedBackground;
|
543
|
+
}
|
544
|
+
.ui.inverted.scrolling.table > tbody::-webkit-scrollbar-thumb:window-inactive {
|
545
|
+
background: @thumbInvertedInactiveBackground;
|
546
|
+
}
|
547
|
+
.ui.inverted.scrolling.table > tbody::-webkit-scrollbar-thumb:hover {
|
548
|
+
background: @thumbInvertedHoverBackground;
|
549
|
+
}
|
540
550
|
& when (@supportIE) {
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
551
|
+
.ui.inverted.scrolling.table > tbody {
|
552
|
+
/* IE11 */
|
553
|
+
scrollbar-face-color: @thumbInvertedBackgroundHex;
|
554
|
+
scrollbar-shadow-color: @thumbInvertedBackgroundHex;
|
555
|
+
scrollbar-track-color: @trackInvertedBackgroundHex;
|
556
|
+
scrollbar-arrow-color: @trackInvertedBackgroundHex;
|
557
|
+
}
|
558
|
+
}
|
559
|
+
@supports (-moz-appearance: none) {
|
560
|
+
.ui.inverted.scrolling.table > tbody {
|
561
|
+
/* firefox: first color thumb, second track */
|
562
|
+
scrollbar-color: @thumbInvertedBackground @trackInvertedBackground;
|
563
|
+
}
|
546
564
|
}
|
547
|
-
|
548
|
-
/* firefox: first color thumb, second track */
|
549
|
-
scrollbar-color: @thumbInvertedBackground @trackInvertedBackground;
|
550
565
|
}
|
551
566
|
}
|
552
567
|
& when (@variationTableResizable) {
|
@@ -885,7 +885,7 @@
|
|
885
885
|
border-top: @basicGroupBorder;
|
886
886
|
}
|
887
887
|
|
888
|
-
.ui.basic.vertical.buttons:not(.spaced) .button:first-child {
|
888
|
+
.ui.basic.vertical.buttons:not(.spaced):not(.circular) .button:first-child {
|
889
889
|
border-top: none;
|
890
890
|
}
|
891
891
|
}
|
@@ -1095,15 +1095,39 @@
|
|
1095
1095
|
/* --------------
|
1096
1096
|
Circular
|
1097
1097
|
--------------- */
|
1098
|
-
|
1099
|
-
.ui.circular.button {
|
1098
|
+
.ui.ui.circular.buttons .button,
|
1099
|
+
.ui.ui.ui.ui.circular.button {
|
1100
1100
|
border-radius: @circularBorderRadius;
|
1101
|
+
min-width: @circularMinWidth;
|
1101
1102
|
}
|
1102
1103
|
|
1104
|
+
.ui.circular.buttons .button > .icon,
|
1103
1105
|
.ui.circular.button > .icon {
|
1104
1106
|
width: @circularIconWidth;
|
1105
1107
|
vertical-align: baseline;
|
1106
1108
|
}
|
1109
|
+
|
1110
|
+
.ui.circular.buttons:not(.vertical):not(.spaced) .button {
|
1111
|
+
margin-right: @circularGroupMargin;
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
& when (@variationButtonVertical) {
|
1115
|
+
.ui.vertical.circular.buttons .button {
|
1116
|
+
margin-bottom: @circularVerticalGroupMargin;
|
1117
|
+
}
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
& when (@variationButtonBasic) {
|
1121
|
+
.ui.circular.basic.buttons {
|
1122
|
+
border: none;
|
1123
|
+
& .button {
|
1124
|
+
border: @basicGroupBorder;
|
1125
|
+
&.basic {
|
1126
|
+
border: none;
|
1127
|
+
}
|
1128
|
+
}
|
1129
|
+
}
|
1130
|
+
}
|
1107
1131
|
}
|
1108
1132
|
|
1109
1133
|
& when (@variationButtonOr) {
|
@@ -292,7 +292,9 @@
|
|
292
292
|
});
|
293
293
|
}
|
294
294
|
clearTimeout(module.performance.timer);
|
295
|
-
module.performance.timer = setTimeout(function () {
|
295
|
+
module.performance.timer = setTimeout(function () {
|
296
|
+
module.performance.display();
|
297
|
+
}, 500);
|
296
298
|
},
|
297
299
|
display: function () {
|
298
300
|
var
|