fomantic-ui 2.9.3-beta.9 → 2.9.3
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 +2 -2
- package/.github/FUNDING.yml +1 -1
- package/.github/auto_assign.yml +1 -1
- package/.github/workflows/ci.yml +5 -5
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CHANGELOG.md +131 -0
- package/CONTRIBUTORS.md +1 -1
- package/README.md +5 -2
- package/SECURITY.md +2 -1
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +2 -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 +10 -9
- 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 +2 -2
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +140 -3
- package/dist/components/calendar.js +2 -2
- package/dist/components/calendar.min.css +2 -2
- 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 +50 -6
- package/dist/components/checkbox.js +5 -3
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +6 -1
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +62 -1
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +3 -3
- package/dist/components/dimmer.js +2 -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 +101 -25
- package/dist/components/dropdown.js +29 -21
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +2 -2
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +697 -249
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +486 -5
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +3 -2
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +2 -33
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +34 -32
- package/dist/components/form.js +72 -31
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +107 -107
- 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 +62 -62
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +3 -27
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +6 -1
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +21 -2
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +13 -13
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +282 -282
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +13 -7
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +5 -1
- package/dist/components/modal.js +3 -3
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +3 -3
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +3 -3
- package/dist/components/popup.js +11 -9
- 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 +2 -2
- package/dist/components/progress.min.css +1 -1
- 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 +2 -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 +26 -1
- package/dist/components/search.js +5 -4
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +159 -33
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +2 -2
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +2 -32
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +2 -2
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +126 -26
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +2 -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 +2 -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 +6 -4
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +65 -1
- 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 +6 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +3 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +2 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +2822 -954
- package/dist/semantic.js +302 -206
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +5 -4
- package/scripts/nightly-version.js +2 -2
- package/src/definitions/behaviors/api.js +9 -8
- package/src/definitions/behaviors/form.js +71 -30
- package/src/definitions/behaviors/state.js +1 -1
- package/src/definitions/behaviors/visibility.js +1 -1
- package/src/definitions/collections/form.less +9 -14
- package/src/definitions/collections/grid.less +106 -106
- package/src/definitions/collections/menu.less +29 -22
- package/src/definitions/collections/table.less +66 -0
- package/src/definitions/elements/button.less +1 -1
- package/src/definitions/elements/container.less +63 -0
- package/src/definitions/elements/icon.less +5 -5
- package/src/definitions/elements/input.less +2 -2
- package/src/definitions/elements/label.less +21 -1
- package/src/definitions/elements/list.less +13 -13
- package/src/definitions/elements/loader.less +71 -71
- package/src/definitions/elements/segment.less +110 -13
- package/src/definitions/globals/site.js +1 -1
- package/src/definitions/modules/accordion.js +1 -1
- package/src/definitions/modules/calendar.js +1 -1
- package/src/definitions/modules/calendar.less +40 -11
- package/src/definitions/modules/checkbox.js +4 -2
- package/src/definitions/modules/checkbox.less +61 -5
- package/src/definitions/modules/dimmer.js +1 -1
- package/src/definitions/modules/dimmer.less +2 -2
- package/src/definitions/modules/dropdown.js +28 -20
- package/src/definitions/modules/dropdown.less +124 -21
- package/src/definitions/modules/embed.js +1 -1
- package/src/definitions/modules/flyout.js +1 -32
- package/src/definitions/modules/modal.js +2 -2
- package/src/definitions/modules/modal.less +6 -0
- package/src/definitions/modules/nag.js +2 -2
- package/src/definitions/modules/popup.js +10 -8
- package/src/definitions/modules/popup.less +4 -4
- package/src/definitions/modules/progress.js +1 -1
- package/src/definitions/modules/rating.js +1 -1
- package/src/definitions/modules/search.js +4 -3
- package/src/definitions/modules/search.less +31 -0
- package/src/definitions/modules/shape.js +1 -1
- package/src/definitions/modules/sidebar.js +1 -31
- package/src/definitions/modules/slider.js +125 -25
- package/src/definitions/modules/sticky.js +1 -1
- package/src/definitions/modules/tab.js +5 -3
- package/src/definitions/modules/toast.js +1 -1
- package/src/definitions/modules/toast.less +7 -0
- package/src/definitions/modules/transition.js +2 -2
- package/src/definitions/views/comment.less +7 -0
- package/src/definitions/views/feed.less +238 -32
- package/src/definitions/views/item.less +7 -0
- package/src/theme.less +1 -1
- package/src/themes/amazon/elements/button.variables +5 -1
- package/src/themes/bootstrap3/elements/button.variables +5 -1
- package/src/themes/chubby/elements/header.variables +6 -1
- package/src/themes/default/collections/message.variables +3 -9
- package/src/themes/default/collections/table.variables +11 -8
- package/src/themes/default/elements/button.variables +8 -10
- package/src/themes/default/elements/container.variables +3 -0
- package/src/themes/default/elements/emoji.variables +179 -67
- package/src/themes/default/elements/flag.variables +1 -1
- package/src/themes/default/elements/label.variables +6 -1
- package/src/themes/default/elements/segment.variables +8 -0
- package/src/themes/default/globals/site.variables +362 -341
- package/src/themes/default/globals/variation.variables +24 -1
- package/src/themes/default/modules/calendar.variables +11 -0
- package/src/themes/default/modules/checkbox.variables +12 -0
- package/src/themes/default/modules/dropdown.variables +10 -4
- package/src/themes/default/modules/modal.variables +3 -0
- package/src/themes/default/modules/popup.variables +1 -1
- package/src/themes/default/modules/search.variables +3 -0
- package/src/themes/default/modules/toast.variables +6 -5
- package/src/themes/default/views/card.variables +4 -12
- package/src/themes/default/views/feed.variables +55 -1
- package/src/themes/default/views/item.variables +5 -5
- package/src/themes/flat/collections/form.variables +4 -4
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/elements/button.variables +5 -1
- package/src/themes/joypixels/elements/emoji.variables +182 -70
- package/src/themes/material/globals/site.variables +1 -1
- package/src/themes/twitter/elements/button.variables +5 -1
- package/src/themes/twitter/elements/emoji.variables +178 -66
- package/tasks/admin/components/create.js +1 -2
- package/tasks/admin/components/init.js +3 -4
- package/tasks/admin/components/update.js +2 -3
- package/tasks/admin/distributions/create.js +9 -5
- package/tasks/admin/distributions/init.js +3 -4
- package/tasks/admin/distributions/update.js +2 -3
- package/tasks/config/project/install.js +3 -0
- package/tasks/config/tasks.js +1 -8
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +2 -2
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +1 -1
- package/tasks/install.js +19 -10
- package/tasks/watch.js +1 -2
- package/types/fomantic-ui-accordion.d.ts +244 -0
- package/types/fomantic-ui-api.d.ts +555 -0
- package/types/fomantic-ui-calendar.d.ts +766 -0
- package/types/fomantic-ui-checkbox.d.ts +332 -0
- package/types/fomantic-ui-dimmer.d.ts +408 -0
- package/types/fomantic-ui-dropdown.d.ts +1183 -0
- package/types/fomantic-ui-embed.d.ts +326 -0
- package/types/fomantic-ui-flyout.d.ts +525 -0
- package/types/fomantic-ui-form.d.ts +651 -0
- package/types/fomantic-ui-modal.d.ts +471 -0
- package/types/fomantic-ui-nag.d.ts +270 -0
- package/types/fomantic-ui-popup.d.ts +523 -0
- package/types/fomantic-ui-progress.d.ts +459 -0
- package/types/fomantic-ui-rating.d.ts +187 -0
- package/types/fomantic-ui-search.d.ts +496 -0
- package/types/fomantic-ui-shape.d.ts +274 -0
- package/types/fomantic-ui-sidebar.d.ts +402 -0
- package/types/fomantic-ui-slider.d.ts +316 -0
- package/types/fomantic-ui-sticky.d.ts +215 -0
- package/types/fomantic-ui-tab.d.ts +361 -0
- package/types/fomantic-ui-tests.ts +25 -0
- package/types/fomantic-ui-toast.d.ts +514 -0
- package/types/fomantic-ui-transition.d.ts +355 -0
- package/types/fomantic-ui-visibility.d.ts +355 -0
- package/types/index.d.ts +63 -0
- package/types/tsconfig.json +23 -0
- package/types/tslint.json +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fomantic-ui",
|
3
|
-
"version": "2.9.3
|
3
|
+
"version": "2.9.3",
|
4
4
|
"description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
|
5
5
|
"keywords": [
|
6
6
|
"fomantic-ui",
|
@@ -19,6 +19,7 @@
|
|
19
19
|
"license": "MIT",
|
20
20
|
"author": "Jack Lukic <jack@semantic-ui.com>",
|
21
21
|
"main": "dist/semantic.js",
|
22
|
+
"types": "./types/index.d.ts",
|
22
23
|
"repository": {
|
23
24
|
"type": "git",
|
24
25
|
"url": "https://github.com/fomantic/Fomantic-UI.git"
|
@@ -32,7 +33,7 @@
|
|
32
33
|
"dependencies": {
|
33
34
|
"@actions/core": "^1.6.0",
|
34
35
|
"@octokit/core": "^3.6.0",
|
35
|
-
"@octokit/rest": "^
|
36
|
+
"@octokit/rest": "^18.12.0",
|
36
37
|
"better-console": "^1.0.1",
|
37
38
|
"browserslist": "^4.21.4",
|
38
39
|
"del": "^6.1.1",
|
@@ -62,7 +63,7 @@
|
|
62
63
|
"gulp-uglify": "^3.0.1",
|
63
64
|
"inquirer": "^8.2.0",
|
64
65
|
"jquery": "^3.4.0",
|
65
|
-
"less": "^3.
|
66
|
+
"less": "^3.12.0 || ^4.0.0",
|
66
67
|
"map-stream": "^0.1.0",
|
67
68
|
"merge-stream": "^2.0.0",
|
68
69
|
"mkdirp": "^1.0.4",
|
@@ -91,4 +92,4 @@
|
|
91
92
|
},
|
92
93
|
"title": "Fomantic UI",
|
93
94
|
"style": "dist/semantic.css"
|
94
|
-
}
|
95
|
+
}
|
@@ -3,13 +3,13 @@ const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
4
4
|
const childProcess = require('child_process');
|
5
5
|
|
6
|
+
const process = require('process');
|
7
|
+
|
6
8
|
// npm
|
7
9
|
const fetch = require('node-fetch'); // eslint-disable-line import/no-extraneous-dependencies
|
8
10
|
const semver = require('semver'); // eslint-disable-line import/no-extraneous-dependencies
|
9
11
|
const actions = require('@actions/core');
|
10
12
|
|
11
|
-
// pkg
|
12
|
-
const process = require('process');
|
13
13
|
const pkg = require('../package.json');
|
14
14
|
|
15
15
|
const ghBase = 'https://api.github.com';
|
@@ -58,6 +58,7 @@
|
|
58
58
|
: $.extend({}, $.fn.api.settings),
|
59
59
|
|
60
60
|
// internal aliases
|
61
|
+
regExp = settings.regExp,
|
61
62
|
namespace = settings.namespace,
|
62
63
|
metadata = settings.metadata,
|
63
64
|
selector = settings.selector,
|
@@ -360,8 +361,8 @@
|
|
360
361
|
optionalVariables
|
361
362
|
;
|
362
363
|
if (url) {
|
363
|
-
requiredVariables = url.match(
|
364
|
-
optionalVariables = url.match(
|
364
|
+
requiredVariables = url.match(regExp.required);
|
365
|
+
optionalVariables = url.match(regExp.optional);
|
365
366
|
urlData = urlData || settings.urlData;
|
366
367
|
if (requiredVariables) {
|
367
368
|
module.debug('Looking for required URL variables', requiredVariables);
|
@@ -458,7 +459,7 @@
|
|
458
459
|
});
|
459
460
|
});
|
460
461
|
$.each(formArray, function (i, el) {
|
461
|
-
if (!
|
462
|
+
if (!regExp.validate.test(el.name)) {
|
462
463
|
return;
|
463
464
|
}
|
464
465
|
var
|
@@ -469,7 +470,7 @@
|
|
469
470
|
|| (String(floatValue) === el.value
|
470
471
|
? floatValue
|
471
472
|
: (el.value === 'false' ? false : el.value)),
|
472
|
-
nameKeys = el.name.match(
|
473
|
+
nameKeys = el.name.match(regExp.key) || [],
|
473
474
|
pushKey = el.name.replace(/\[]$/, '')
|
474
475
|
;
|
475
476
|
if (!(pushKey in pushes)) {
|
@@ -489,9 +490,9 @@
|
|
489
490
|
|
490
491
|
if (k === '' && !Array.isArray(value)) { // foo[]
|
491
492
|
value = build([], pushes[pushKey]++, value);
|
492
|
-
} else if (
|
493
|
+
} else if (regExp.fixed.test(k)) { // foo[n]
|
493
494
|
value = build([], k, value);
|
494
|
-
} else if (
|
495
|
+
} else if (regExp.named.test(k)) { // foo; foo[bar]
|
495
496
|
value = build({}, k, value);
|
496
497
|
}
|
497
498
|
}
|
@@ -646,7 +647,7 @@
|
|
646
647
|
module.debug('Adding error state');
|
647
648
|
module.set.error();
|
648
649
|
if (module.should.removeError()) {
|
649
|
-
setTimeout(module.remove.error, settings.errorDuration);
|
650
|
+
setTimeout(function () { module.remove.error(); }, settings.errorDuration);
|
650
651
|
}
|
651
652
|
}
|
652
653
|
module.debug('API Request failed', errorMessage, xhr);
|
@@ -970,7 +971,7 @@
|
|
970
971
|
});
|
971
972
|
}
|
972
973
|
clearTimeout(module.performance.timer);
|
973
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
974
|
+
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
|
974
975
|
},
|
975
976
|
display: function () {
|
976
977
|
var
|
@@ -77,6 +77,7 @@
|
|
77
77
|
initialize: function () {
|
78
78
|
// settings grabbed at run time
|
79
79
|
module.get.settings();
|
80
|
+
$module.addClass(className.initial);
|
80
81
|
if (methodInvoked) {
|
81
82
|
if (instance === undefined) {
|
82
83
|
module.instantiate();
|
@@ -130,10 +131,13 @@
|
|
130
131
|
module.bindEvents();
|
131
132
|
},
|
132
133
|
|
133
|
-
submit: function () {
|
134
|
+
submit: function (event) {
|
134
135
|
module.verbose('Submitting form', $module);
|
135
136
|
submitting = true;
|
136
137
|
$module.trigger('submit');
|
138
|
+
if (event) {
|
139
|
+
event.preventDefault();
|
140
|
+
}
|
137
141
|
},
|
138
142
|
|
139
143
|
attachEvents: function (selector, action) {
|
@@ -159,6 +163,7 @@
|
|
159
163
|
.on('click' + eventNamespace, selector.reset, module.reset)
|
160
164
|
.on('click' + eventNamespace, selector.clear, module.clear)
|
161
165
|
;
|
166
|
+
$field.on('invalid' + eventNamespace, module.event.field.invalid);
|
162
167
|
if (settings.keyboardShortcuts) {
|
163
168
|
$module.on('keydown' + eventNamespace, selector.field, module.event.field.keydown);
|
164
169
|
}
|
@@ -274,8 +279,12 @@
|
|
274
279
|
var
|
275
280
|
allValid = true
|
276
281
|
;
|
277
|
-
|
278
|
-
|
282
|
+
$field.each(function (index, el) {
|
283
|
+
var $el = $(el),
|
284
|
+
validation = module.get.validation($el) || {},
|
285
|
+
identifier = module.get.identifier(validation, $el)
|
286
|
+
;
|
287
|
+
if (!module.validate.field(validation, identifier, true)) {
|
279
288
|
allValid = false;
|
280
289
|
}
|
281
290
|
});
|
@@ -431,9 +440,8 @@
|
|
431
440
|
if (!event.ctrlKey && key === keyCode.enter && isInput && !isInDropdown && !isCheckbox) {
|
432
441
|
if (!keyHeldDown) {
|
433
442
|
$field.one('keyup' + eventNamespace, module.event.field.keyup);
|
434
|
-
module.submit();
|
443
|
+
module.submit(event);
|
435
444
|
module.debug('Enter pressed on input submitting form');
|
436
|
-
event.preventDefault();
|
437
445
|
}
|
438
446
|
keyHeldDown = true;
|
439
447
|
}
|
@@ -441,15 +449,18 @@
|
|
441
449
|
keyup: function () {
|
442
450
|
keyHeldDown = false;
|
443
451
|
},
|
452
|
+
invalid: function (event) {
|
453
|
+
event.preventDefault();
|
454
|
+
},
|
444
455
|
blur: function (event) {
|
445
456
|
var
|
446
457
|
$field = $(this),
|
447
|
-
|
448
|
-
|
458
|
+
validationRules = module.get.validation($field) || {},
|
459
|
+
identifier = module.get.identifier(validationRules, $field)
|
449
460
|
;
|
450
|
-
if (
|
461
|
+
if (settings.on === 'blur' || (!$module.hasClass(className.initial) && settings.revalidate)) {
|
451
462
|
module.debug('Revalidating field', $field, validationRules);
|
452
|
-
module.validate.field(validationRules);
|
463
|
+
module.validate.field(validationRules, identifier);
|
453
464
|
if (!settings.inline) {
|
454
465
|
module.validate.form(false, true);
|
455
466
|
}
|
@@ -458,14 +469,14 @@
|
|
458
469
|
change: function (event) {
|
459
470
|
var
|
460
471
|
$field = $(this),
|
461
|
-
|
462
|
-
|
472
|
+
validationRules = module.get.validation($field) || {},
|
473
|
+
identifier = module.get.identifier(validationRules, $field)
|
463
474
|
;
|
464
|
-
if (
|
475
|
+
if (settings.on === 'change' || (!$module.hasClass(className.initial) && settings.revalidate)) {
|
465
476
|
clearTimeout(module.timer);
|
466
477
|
module.timer = setTimeout(function () {
|
467
478
|
module.debug('Revalidating field', $field, validationRules);
|
468
|
-
module.validate.field(validationRules);
|
479
|
+
module.validate.field(validationRules, identifier);
|
469
480
|
if (!settings.inline) {
|
470
481
|
module.validate.form(false, true);
|
471
482
|
}
|
@@ -531,6 +542,9 @@
|
|
531
542
|
|
532
543
|
return fullFields;
|
533
544
|
},
|
545
|
+
identifier: function (validation, $el) {
|
546
|
+
return validation.identifier || $el.attr('id') || $el.attr('name') || $el.data(metadata.validate);
|
547
|
+
},
|
534
548
|
prompt: function (rule, field) {
|
535
549
|
var
|
536
550
|
ruleName = module.get.ruleName(rule),
|
@@ -897,7 +911,8 @@
|
|
897
911
|
$field = module.get.field(identifier),
|
898
912
|
$fieldGroup = $field.closest($group),
|
899
913
|
$prompt = $fieldGroup.children(selector.prompt),
|
900
|
-
promptExists = $prompt.length > 0
|
914
|
+
promptExists = $prompt.length > 0,
|
915
|
+
canTransition = settings.transition && module.can.useElement('transition')
|
901
916
|
;
|
902
917
|
module.verbose('Adding field error state', identifier);
|
903
918
|
if (!internal) {
|
@@ -906,8 +921,22 @@
|
|
906
921
|
;
|
907
922
|
}
|
908
923
|
if (settings.inline) {
|
924
|
+
if (promptExists) {
|
925
|
+
if (canTransition) {
|
926
|
+
if ($prompt.transition('is animating')) {
|
927
|
+
$prompt.transition('stop all');
|
928
|
+
}
|
929
|
+
} else if ($prompt.is(':animated')) {
|
930
|
+
$prompt.stop(true, true);
|
931
|
+
}
|
932
|
+
$prompt = $fieldGroup.children(selector.prompt);
|
933
|
+
promptExists = $prompt.length > 0;
|
934
|
+
}
|
909
935
|
if (!promptExists) {
|
910
936
|
$prompt = $('<div/>').addClass(className.label);
|
937
|
+
if (!canTransition) {
|
938
|
+
$prompt.css('display', 'none');
|
939
|
+
}
|
911
940
|
$prompt
|
912
941
|
.appendTo($fieldGroup)
|
913
942
|
;
|
@@ -916,7 +945,7 @@
|
|
916
945
|
.html(settings.templates.prompt(errors))
|
917
946
|
;
|
918
947
|
if (!promptExists) {
|
919
|
-
if (
|
948
|
+
if (canTransition) {
|
920
949
|
module.verbose('Displaying error with css transition', settings.transition);
|
921
950
|
$prompt.transition(settings.transition + ' in', settings.duration);
|
922
951
|
} else {
|
@@ -925,9 +954,9 @@
|
|
925
954
|
.fadeIn(settings.duration)
|
926
955
|
;
|
927
956
|
}
|
928
|
-
} else {
|
929
|
-
module.verbose('Inline errors are disabled, no inline error added', identifier);
|
930
957
|
}
|
958
|
+
} else {
|
959
|
+
module.verbose('Inline errors are disabled, no inline error added', identifier);
|
931
960
|
}
|
932
961
|
},
|
933
962
|
errors: function (errors) {
|
@@ -974,7 +1003,7 @@
|
|
974
1003
|
$message.empty();
|
975
1004
|
},
|
976
1005
|
states: function () {
|
977
|
-
$module.removeClass(className.error).removeClass(className.success);
|
1006
|
+
$module.removeClass(className.error).removeClass(className.success).addClass(className.initial);
|
978
1007
|
if (!settings.inline) {
|
979
1008
|
module.remove.errors();
|
980
1009
|
}
|
@@ -1211,7 +1240,7 @@
|
|
1211
1240
|
return rule.type === 'empty';
|
1212
1241
|
}) !== 0
|
1213
1242
|
: false,
|
1214
|
-
identifier =
|
1243
|
+
identifier = module.get.identifier(validation, $el)
|
1215
1244
|
;
|
1216
1245
|
if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
|
1217
1246
|
if (isCheckbox) {
|
@@ -1243,7 +1272,7 @@
|
|
1243
1272
|
if (keyHeldDown) {
|
1244
1273
|
return false;
|
1245
1274
|
}
|
1246
|
-
|
1275
|
+
$module.removeClass(className.initial);
|
1247
1276
|
// reset errors
|
1248
1277
|
formErrors = [];
|
1249
1278
|
if (module.determine.isValid()) {
|
@@ -1315,13 +1344,25 @@
|
|
1315
1344
|
? module.get.field(field.depends)
|
1316
1345
|
: false,
|
1317
1346
|
fieldValid = true,
|
1318
|
-
fieldErrors = []
|
1347
|
+
fieldErrors = [],
|
1348
|
+
isDisabled = $field.filter(':not(:disabled)').length === 0,
|
1349
|
+
validationMessage = $field[0].validationMessage,
|
1350
|
+
errorLimit
|
1319
1351
|
;
|
1320
1352
|
if (!field.identifier) {
|
1321
1353
|
module.debug('Using field name as identifier', identifier);
|
1322
1354
|
field.identifier = identifier;
|
1323
1355
|
}
|
1324
|
-
|
1356
|
+
if (validationMessage) {
|
1357
|
+
module.debug('Field is natively invalid', identifier);
|
1358
|
+
fieldErrors.push(validationMessage);
|
1359
|
+
fieldValid = false;
|
1360
|
+
if (showErrors) {
|
1361
|
+
$field.closest($group).addClass(className.error);
|
1362
|
+
}
|
1363
|
+
} else if (showErrors) {
|
1364
|
+
$field.closest($group).removeClass(className.error);
|
1365
|
+
}
|
1325
1366
|
if (isDisabled) {
|
1326
1367
|
module.debug('Field is disabled. Skipping', identifier);
|
1327
1368
|
} else if (field.optional && module.is.blank($field)) {
|
@@ -1329,11 +1370,9 @@
|
|
1329
1370
|
} else if (field.depends && module.is.empty($dependsField)) {
|
1330
1371
|
module.debug('Field depends on another value that is not present or empty. Skipping', $dependsField);
|
1331
1372
|
} else if (field.rules !== undefined) {
|
1332
|
-
|
1333
|
-
$field.closest($group).removeClass(className.error);
|
1334
|
-
}
|
1373
|
+
errorLimit = field.errorLimit || settings.errorLimit;
|
1335
1374
|
$.each(field.rules, function (index, rule) {
|
1336
|
-
if (module.has.field(identifier)) {
|
1375
|
+
if (module.has.field(identifier) && (!errorLimit || fieldErrors.length < errorLimit)) {
|
1337
1376
|
var invalidFields = module.validate.rule(field, rule, true) || [];
|
1338
1377
|
if (invalidFields.length > 0) {
|
1339
1378
|
module.debug('Field is invalid', identifier, rule.type);
|
@@ -1348,7 +1387,7 @@
|
|
1348
1387
|
}
|
1349
1388
|
if (fieldValid) {
|
1350
1389
|
if (showErrors) {
|
1351
|
-
module.remove.prompt(identifier
|
1390
|
+
module.remove.prompt(identifier);
|
1352
1391
|
settings.onValid.call($field);
|
1353
1392
|
}
|
1354
1393
|
} else {
|
@@ -1470,7 +1509,7 @@
|
|
1470
1509
|
});
|
1471
1510
|
}
|
1472
1511
|
clearTimeout(module.performance.timer);
|
1473
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
1512
|
+
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
|
1474
1513
|
},
|
1475
1514
|
display: function () {
|
1476
1515
|
var
|
@@ -1585,6 +1624,7 @@
|
|
1585
1624
|
preventLeaving: false,
|
1586
1625
|
errorFocus: true,
|
1587
1626
|
dateHandling: 'date', // 'date', 'input', 'formatter'
|
1627
|
+
errorLimit: 0,
|
1588
1628
|
|
1589
1629
|
onValid: function () {},
|
1590
1630
|
onInvalid: function () {},
|
@@ -1638,8 +1678,8 @@
|
|
1638
1678
|
isExactly: '{name} must be exactly "{ruleValue}"',
|
1639
1679
|
not: '{name} cannot be set to "{ruleValue}"',
|
1640
1680
|
notExactly: '{name} cannot be set to exactly "{ruleValue}"',
|
1641
|
-
|
1642
|
-
|
1681
|
+
contains: '{name} must contain "{ruleValue}"',
|
1682
|
+
containsExactly: '{name} must contain exactly "{ruleValue}"',
|
1643
1683
|
doesntContain: '{name} cannot contain "{ruleValue}"',
|
1644
1684
|
doesntContainExactly: '{name} cannot contain exactly "{ruleValue}"',
|
1645
1685
|
minLength: '{name} must be at least {ruleValue} characters',
|
@@ -1673,6 +1713,7 @@
|
|
1673
1713
|
},
|
1674
1714
|
|
1675
1715
|
className: {
|
1716
|
+
initial: 'initial',
|
1676
1717
|
error: 'error',
|
1677
1718
|
label: 'ui basic red pointing prompt label',
|
1678
1719
|
pressed: 'down',
|
@@ -482,7 +482,7 @@
|
|
482
482
|
});
|
483
483
|
}
|
484
484
|
clearTimeout(module.performance.timer);
|
485
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
485
|
+
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
|
486
486
|
},
|
487
487
|
display: function () {
|
488
488
|
var
|
@@ -1088,7 +1088,7 @@
|
|
1088
1088
|
});
|
1089
1089
|
}
|
1090
1090
|
clearTimeout(module.performance.timer);
|
1091
|
-
module.performance.timer = setTimeout(module.performance.display, 500);
|
1091
|
+
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
|
1092
1092
|
},
|
1093
1093
|
display: function () {
|
1094
1094
|
var
|
@@ -527,9 +527,10 @@
|
|
527
527
|
color: @c;
|
528
528
|
}
|
529
529
|
|
530
|
-
|
531
|
-
|
532
|
-
|
530
|
+
@supports selector(:has(.f)) {
|
531
|
+
.ui.form .fields:has(.@{state}) > label {
|
532
|
+
color: @c;
|
533
|
+
}
|
533
534
|
}
|
534
535
|
|
535
536
|
.ui.form .fields.@{state} .field .ui.label,
|
@@ -584,14 +585,7 @@
|
|
584
585
|
box-shadow: @formStates[@@state][boxShadow];
|
585
586
|
}
|
586
587
|
& when (@state=error) and (@variationFormInvalid) {
|
587
|
-
.ui.form .field input:
|
588
|
-
color: @c;
|
589
|
-
background: @bg;
|
590
|
-
border-color: @formStates[@@state][borderColor];
|
591
|
-
border-radius: @formStates[@@state][borderRadius];
|
592
|
-
box-shadow: @formStates[@@state][boxShadow];
|
593
|
-
}
|
594
|
-
.ui.form .field input:not(:-ms-input-placeholder):invalid when (@supportIE) {
|
588
|
+
.ui.form:not(.initial) .field input:invalid {
|
595
589
|
color: @c;
|
596
590
|
background: @bg;
|
597
591
|
border-color: @formStates[@@state][borderColor];
|
@@ -735,9 +729,10 @@
|
|
735
729
|
color: @lbg;
|
736
730
|
}
|
737
731
|
|
738
|
-
|
739
|
-
|
740
|
-
|
732
|
+
@supports selector(:has(.f)) {
|
733
|
+
.ui.inverted.form .fields:has(.@{state}) > label {
|
734
|
+
color: @lbg;
|
735
|
+
}
|
741
736
|
}
|
742
737
|
}
|
743
738
|
});
|