fomantic-ui 2.9.4-beta.65 → 2.9.4-beta.67
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/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -1
- 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 +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +1 -1
- 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 +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +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 +1 -1
- 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 +21 -4
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- 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/menu.css +1 -1
- package/dist/components/menu.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 +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1 -1
- 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 +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +4 -4
- 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 +1 -1
- 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 +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +49 -32
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/form.js +20 -3
- package/src/definitions/modules/shape.js +3 -3
- package/types/fomantic-ui-calendar.d.ts +17 -1
- package/types/fomantic-ui-dropdown.d.ts +3 -3
- package/types/fomantic-ui-flyout.d.ts +1 -1
- package/types/fomantic-ui-form.d.ts +1 -1
- package/types/fomantic-ui-modal.d.ts +2 -2
- package/types/fomantic-ui-search.d.ts +12 -7
- package/types/fomantic-ui-slider.d.ts +1 -1
- package/types/fomantic-ui-tab.d.ts +1 -1
- package/types/fomantic-ui-transition.d.ts +2 -2
package/package.json
CHANGED
@@ -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
|
@@ -948,7 +949,7 @@
|
|
948
949
|
$prompt.css('display', 'none');
|
949
950
|
}
|
950
951
|
$prompt
|
951
|
-
.appendTo($fieldGroup)
|
952
|
+
.appendTo($fieldGroup.filter('.' + className.error))
|
952
953
|
;
|
953
954
|
}
|
954
955
|
$prompt
|
@@ -1285,6 +1286,7 @@
|
|
1285
1286
|
$module.removeClass(className.initial);
|
1286
1287
|
// reset errors
|
1287
1288
|
formErrors = [];
|
1289
|
+
formErrorsTracker = {};
|
1288
1290
|
if (module.determine.isValid()) {
|
1289
1291
|
module.debug('Form has no validation errors, submitting');
|
1290
1292
|
module.set.success();
|
@@ -1388,7 +1390,22 @@
|
|
1388
1390
|
var invalidFields = module.validate.rule(field, rule, true) || [];
|
1389
1391
|
if (invalidFields.length > 0) {
|
1390
1392
|
module.debug('Field is invalid', identifier, rule.type);
|
1391
|
-
|
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
|
+
}
|
1392
1409
|
fieldValid = false;
|
1393
1410
|
if (showErrors) {
|
1394
1411
|
$(invalidFields).closest($group).addClass(className.error);
|
@@ -1403,7 +1420,7 @@
|
|
1403
1420
|
settings.onValid.call($field);
|
1404
1421
|
}
|
1405
1422
|
} else {
|
1406
|
-
if (showErrors) {
|
1423
|
+
if (showErrors && fieldErrors.length > 0) {
|
1407
1424
|
formErrors = formErrors.concat(fieldErrors);
|
1408
1425
|
module.add.prompt(identifier, fieldErrors, true);
|
1409
1426
|
settings.onInvalid.call($field, fieldErrors);
|
@@ -185,7 +185,7 @@
|
|
185
185
|
set: {
|
186
186
|
|
187
187
|
defaultSide: function () {
|
188
|
-
$activeSide = $side.filter('.' +
|
188
|
+
$activeSide = $side.filter('.' + className.active);
|
189
189
|
$nextSide = $activeSide.next(selector.side).length > 0
|
190
190
|
? $activeSide.next(selector.side)
|
191
191
|
: $side.first();
|
@@ -211,7 +211,7 @@
|
|
211
211
|
|
212
212
|
currentStageSize: function () {
|
213
213
|
var
|
214
|
-
$activeSide = $side.filter('.' +
|
214
|
+
$activeSide = $side.filter('.' + className.active),
|
215
215
|
width = $activeSide.outerWidth(true),
|
216
216
|
height = $activeSide.outerHeight(true)
|
217
217
|
;
|
@@ -227,7 +227,7 @@
|
|
227
227
|
var
|
228
228
|
$clone = $module.clone().addClass(className.loading),
|
229
229
|
$side = $clone.find('>' + selector.sides + '>' + selector.side),
|
230
|
-
$activeSide = $side.filter('.' +
|
230
|
+
$activeSide = $side.filter('.' + className.active),
|
231
231
|
$nextSide = nextIndex
|
232
232
|
? $side.eq(nextIndex)
|
233
233
|
: ($activeSide.next(selector.side).length > 0
|
@@ -327,7 +327,23 @@ declare namespace FomanticUI {
|
|
327
327
|
|
328
328
|
formatter: Calendar.FormatterSettings;
|
329
329
|
|
330
|
-
|
330
|
+
/**
|
331
|
+
* Customizable methods to parse a given date
|
332
|
+
* Has to return a date object
|
333
|
+
*/
|
334
|
+
parser: {
|
335
|
+
date: (text: string, settings: CalendarSettings) => Date;
|
336
|
+
}
|
337
|
+
|
338
|
+
/**
|
339
|
+
* DOM selector where the calendar popup should be attached to. By default (false) the calendar popup
|
340
|
+
* is attached as direct child of the triggering element.
|
341
|
+
*
|
342
|
+
* @default false
|
343
|
+
*/
|
344
|
+
context: string | JQuery | false
|
345
|
+
|
346
|
+
// end region
|
331
347
|
|
332
348
|
// region Callbacks
|
333
349
|
|
@@ -29,14 +29,14 @@ declare namespace FomanticUI {
|
|
29
29
|
* If a function is provided to callback, it's called after the dropdown-menu is shown.
|
30
30
|
* Set preventFocus to true if you don't want the dropdown field to focus after the menu is shown
|
31
31
|
*/
|
32
|
-
(behavior: 'show', callback?:
|
32
|
+
(behavior: 'show', callback?: () => void, preventFocus?: boolean): void;
|
33
33
|
|
34
34
|
/**
|
35
35
|
* Hides dropdown.
|
36
36
|
* If a function is provided to callback, it's called after the dropdown-menu is hidden.
|
37
37
|
* Set preventBlur to true if you don't want the dropdown field to blur after the menu is hidden
|
38
38
|
*/
|
39
|
-
(behavior: 'hide', callback?:
|
39
|
+
(behavior: 'hide', callback?: () => void, preventBlur?: boolean): void;
|
40
40
|
|
41
41
|
/**
|
42
42
|
* Clears dropdown of selection.
|
@@ -358,7 +358,7 @@ declare namespace FomanticUI {
|
|
358
358
|
* Whether to sort values when creating a dropdown automatically from a select element.
|
359
359
|
* @default false
|
360
360
|
*/
|
361
|
-
sortSelect: boolean | 'natural' |
|
361
|
+
sortSelect: boolean | 'natural' | ((a: any, b: any) => number);
|
362
362
|
|
363
363
|
/**
|
364
364
|
* Whether search selection will force currently selected choice when element is blurred.
|
@@ -6,7 +6,7 @@ declare namespace FomanticUI {
|
|
6
6
|
* Attaches flyout action to given selector.
|
7
7
|
* Default event if none specified is toggle.
|
8
8
|
*/
|
9
|
-
(behavior: 'attach events', selector: JQuery, event
|
9
|
+
(behavior: 'attach events', selector: JQuery, event?: string): JQuery;
|
10
10
|
|
11
11
|
/**
|
12
12
|
* Shows the flyout.
|
@@ -164,7 +164,7 @@ declare namespace FomanticUI {
|
|
164
164
|
(settings?: Partial<Pick<FormSettings, keyof FormSettings>>): JQuery;
|
165
165
|
}
|
166
166
|
|
167
|
-
type FormFields = Record<string, FormField | string[] | string |
|
167
|
+
type FormFields = Record<string, FormField | string[] | string | object>;
|
168
168
|
|
169
169
|
interface FormRule {
|
170
170
|
type: string;
|
@@ -5,12 +5,12 @@ declare namespace FomanticUI {
|
|
5
5
|
/**
|
6
6
|
* Shows the modal.
|
7
7
|
*/
|
8
|
-
(behavior: 'show', callback?:
|
8
|
+
(behavior: 'show', callback?: () => void): JQuery;
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Hides the modal.
|
12
12
|
*/
|
13
|
-
(behavior: 'hide', callback?:
|
13
|
+
(behavior: 'hide', callback?: () => void): JQuery;
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Toggles the modal.
|
@@ -5,7 +5,7 @@ declare namespace FomanticUI {
|
|
5
5
|
/**
|
6
6
|
* Search for value currently set in search input.
|
7
7
|
*/
|
8
|
-
(behavior: 'query', callback
|
8
|
+
(behavior: 'query', callback?: () => void): JQuery;
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Displays message in search results with text, using template matching type.
|
@@ -30,7 +30,7 @@ declare namespace FomanticUI {
|
|
30
30
|
/**
|
31
31
|
* Search remote endpoint for specified query and display results.
|
32
32
|
*/
|
33
|
-
(behavior: 'search remote', query: string, callback
|
33
|
+
(behavior: 'search remote', query: string, callback?: () => void): JQuery;
|
34
34
|
|
35
35
|
/**
|
36
36
|
* Search object for specified query and return results.
|
@@ -90,17 +90,17 @@ declare namespace FomanticUI {
|
|
90
90
|
/**
|
91
91
|
* Shows results container.
|
92
92
|
*/
|
93
|
-
(behavior: 'show results', callback
|
93
|
+
(behavior: 'show results', callback?: () => void): JQuery;
|
94
94
|
|
95
95
|
/**
|
96
96
|
* Hide results container.
|
97
97
|
*/
|
98
|
-
(behavior: 'hide results', callback
|
98
|
+
(behavior: 'hide results', callback?: () => void): JQuery;
|
99
99
|
|
100
100
|
/**
|
101
101
|
* Generates results using parser specified by 'settings.template'.
|
102
102
|
*/
|
103
|
-
(behavior: 'generate results', response:
|
103
|
+
(behavior: 'generate results', response: object): JQuery;
|
104
104
|
|
105
105
|
/**
|
106
106
|
* Removes all events.
|
@@ -183,10 +183,15 @@ declare namespace FomanticUI {
|
|
183
183
|
showNoResults: boolean;
|
184
184
|
|
185
185
|
/**
|
186
|
-
*
|
186
|
+
* Possible values
|
187
|
+
* * `exact` will force the exact search to be matched somewhere in the string.
|
188
|
+
* * `some` Will do the same as exact but supports multiple search values separated by whitespace. At least one word must match. (New in v2.9.1)
|
189
|
+
* * `all` is same as some but all words have to match in all given search fields of each record altogether. (New in v2.9.1)
|
190
|
+
* * `true` will use a fuzzy full text search.
|
191
|
+
* * `false` will only match to start of string.
|
187
192
|
* @default 'exact'
|
188
193
|
*/
|
189
|
-
fullTextSearch: 'exact' | boolean;
|
194
|
+
fullTextSearch: 'exact' | 'some' | 'all' | boolean;
|
190
195
|
|
191
196
|
/**
|
192
197
|
* List mapping display content to JSON property, either with API or 'source'.
|
@@ -89,7 +89,7 @@ declare namespace FomanticUI {
|
|
89
89
|
* You can specify a function here which consumes the current label value as parameter and should return a custom label text according to the given value.
|
90
90
|
* @default false
|
91
91
|
*/
|
92
|
-
interpretLabel: false |
|
92
|
+
interpretLabel: false | ((value: any) => string);
|
93
93
|
|
94
94
|
/**
|
95
95
|
* Show ticks on a labeled slider.
|
@@ -227,7 +227,7 @@ declare namespace FomanticUI {
|
|
227
227
|
* Callback right before the show transition should start.
|
228
228
|
* The 'showFunction' parameter has to be called inside the callback to trigger the transition show
|
229
229
|
*/
|
230
|
-
onBeforeShow(this: JQuery, showFunction:
|
230
|
+
onBeforeShow(this: JQuery, showFunction: () => void): void;
|
231
231
|
|
232
232
|
/**
|
233
233
|
* Callback once the show transition has finished.
|
@@ -244,7 +244,7 @@ declare namespace FomanticUI {
|
|
244
244
|
* Callback right before the hide transition should start.
|
245
245
|
* The 'hideFunction' parameter has to be called inside the callback to trigger the transition hide.
|
246
246
|
*/
|
247
|
-
onBeforeHide(this: JQuery, hideFunction:
|
247
|
+
onBeforeHide(this: JQuery, hideFunction: () => void): void;
|
248
248
|
|
249
249
|
/**
|
250
250
|
* Callback once the transition hide has finished.
|