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.
Files changed (170) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/emoji.css +1 -1
  42. package/dist/components/emoji.min.css +1 -1
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/flyout.css +1 -1
  48. package/dist/components/flyout.js +1 -1
  49. package/dist/components/flyout.min.css +1 -1
  50. package/dist/components/flyout.min.js +1 -1
  51. package/dist/components/form.css +1 -1
  52. package/dist/components/form.js +21 -4
  53. package/dist/components/form.min.css +1 -1
  54. package/dist/components/form.min.js +2 -2
  55. package/dist/components/grid.css +1 -1
  56. package/dist/components/grid.min.css +1 -1
  57. package/dist/components/header.css +1 -1
  58. package/dist/components/header.min.css +1 -1
  59. package/dist/components/icon.css +1 -1
  60. package/dist/components/icon.min.css +1 -1
  61. package/dist/components/image.css +1 -1
  62. package/dist/components/image.min.css +1 -1
  63. package/dist/components/input.css +1 -1
  64. package/dist/components/input.min.css +1 -1
  65. package/dist/components/item.css +1 -1
  66. package/dist/components/item.min.css +1 -1
  67. package/dist/components/label.css +1 -1
  68. package/dist/components/label.min.css +1 -1
  69. package/dist/components/list.css +1 -1
  70. package/dist/components/list.min.css +1 -1
  71. package/dist/components/loader.css +1 -1
  72. package/dist/components/loader.min.css +1 -1
  73. package/dist/components/menu.css +1 -1
  74. package/dist/components/menu.min.css +1 -1
  75. package/dist/components/message.css +1 -1
  76. package/dist/components/message.min.css +1 -1
  77. package/dist/components/modal.css +1 -1
  78. package/dist/components/modal.js +1 -1
  79. package/dist/components/modal.min.css +1 -1
  80. package/dist/components/modal.min.js +1 -1
  81. package/dist/components/nag.css +1 -1
  82. package/dist/components/nag.js +1 -1
  83. package/dist/components/nag.min.css +1 -1
  84. package/dist/components/nag.min.js +1 -1
  85. package/dist/components/placeholder.css +1 -1
  86. package/dist/components/placeholder.min.css +1 -1
  87. package/dist/components/popup.css +1 -1
  88. package/dist/components/popup.js +1 -1
  89. package/dist/components/popup.min.css +1 -1
  90. package/dist/components/popup.min.js +1 -1
  91. package/dist/components/progress.css +1 -1
  92. package/dist/components/progress.js +1 -1
  93. package/dist/components/progress.min.css +1 -1
  94. package/dist/components/progress.min.js +1 -1
  95. package/dist/components/rail.css +1 -1
  96. package/dist/components/rail.min.css +1 -1
  97. package/dist/components/rating.css +1 -1
  98. package/dist/components/rating.js +1 -1
  99. package/dist/components/rating.min.css +1 -1
  100. package/dist/components/rating.min.js +1 -1
  101. package/dist/components/reset.css +1 -1
  102. package/dist/components/reset.min.css +1 -1
  103. package/dist/components/reveal.css +1 -1
  104. package/dist/components/reveal.min.css +1 -1
  105. package/dist/components/search.css +1 -1
  106. package/dist/components/search.js +1 -1
  107. package/dist/components/search.min.css +1 -1
  108. package/dist/components/search.min.js +1 -1
  109. package/dist/components/segment.css +1 -1
  110. package/dist/components/segment.min.css +1 -1
  111. package/dist/components/shape.css +1 -1
  112. package/dist/components/shape.js +4 -4
  113. package/dist/components/shape.min.css +1 -1
  114. package/dist/components/shape.min.js +2 -2
  115. package/dist/components/sidebar.css +1 -1
  116. package/dist/components/sidebar.js +1 -1
  117. package/dist/components/sidebar.min.css +1 -1
  118. package/dist/components/sidebar.min.js +1 -1
  119. package/dist/components/site.css +1 -1
  120. package/dist/components/site.js +1 -1
  121. package/dist/components/site.min.css +1 -1
  122. package/dist/components/site.min.js +1 -1
  123. package/dist/components/slider.css +1 -1
  124. package/dist/components/slider.js +1 -1
  125. package/dist/components/slider.min.css +1 -1
  126. package/dist/components/slider.min.js +1 -1
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +1 -1
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +1 -1
  132. package/dist/components/step.min.css +1 -1
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +1 -1
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +1 -1
  137. package/dist/components/tab.css +1 -1
  138. package/dist/components/tab.js +1 -1
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +1 -1
  141. package/dist/components/table.css +1 -1
  142. package/dist/components/table.min.css +1 -1
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +1 -1
  146. package/dist/components/toast.js +1 -1
  147. package/dist/components/toast.min.css +1 -1
  148. package/dist/components/toast.min.js +1 -1
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +1 -1
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +1 -1
  153. package/dist/components/visibility.js +1 -1
  154. package/dist/components/visibility.min.js +1 -1
  155. package/dist/semantic.css +53 -53
  156. package/dist/semantic.js +49 -32
  157. package/dist/semantic.min.css +1 -1
  158. package/dist/semantic.min.js +2 -2
  159. package/package.json +1 -1
  160. package/src/definitions/behaviors/form.js +20 -3
  161. package/src/definitions/modules/shape.js +3 -3
  162. package/types/fomantic-ui-calendar.d.ts +17 -1
  163. package/types/fomantic-ui-dropdown.d.ts +3 -3
  164. package/types/fomantic-ui-flyout.d.ts +1 -1
  165. package/types/fomantic-ui-form.d.ts +1 -1
  166. package/types/fomantic-ui-modal.d.ts +2 -2
  167. package/types/fomantic-ui-search.d.ts +12 -7
  168. package/types/fomantic-ui-slider.d.ts +1 -1
  169. package/types/fomantic-ui-tab.d.ts +1 -1
  170. package/types/fomantic-ui-transition.d.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fomantic-ui",
3
- "version": "2.9.4-beta.65+f622ea8",
3
+ "version": "2.9.4-beta.67+eadc3d1",
4
4
  "description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
5
5
  "keywords": [
6
6
  "fomantic-ui",
@@ -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
- fieldErrors.push(module.get.prompt(rule, field));
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('.' + settings.className.active);
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('.' + settings.className.active),
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('.' + settings.className.active),
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
- // endregion
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?: Function, preventFocus?: boolean): void;
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?: Function, preventBlur?: boolean): void;
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' | Function;
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: Function): JQuery;
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?: Function): JQuery;
8
+ (behavior: 'show', callback?: () => void): JQuery;
9
9
 
10
10
  /**
11
11
  * Hides the modal.
12
12
  */
13
- (behavior: 'hide', callback?: Function): JQuery;
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: Function): JQuery;
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: Function): JQuery;
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: Function): JQuery;
93
+ (behavior: 'show results', callback?: () => void): JQuery;
94
94
 
95
95
  /**
96
96
  * Hide results container.
97
97
  */
98
- (behavior: 'hide results', callback: Function): JQuery;
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: Function): JQuery;
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
- * Specifying to "true" will use a fuzzy full text search, setting to "exact" will force the exact search to be matched somewhere in the string, setting to false will only match to start of string.
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 | Function;
92
+ interpretLabel: false | ((value: any) => string);
93
93
 
94
94
  /**
95
95
  * Show ticks on a labeled slider.
@@ -276,7 +276,7 @@ declare namespace FomanticUI {
276
276
  * Returns page title
277
277
  * @default Function
278
278
  */
279
- determineTitle: Function;
279
+ determineTitle: (tabPath: string) => string | void;
280
280
  }
281
281
 
282
282
  interface Selectors {
@@ -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: Function): void;
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: Function): void;
247
+ onBeforeHide(this: JQuery, hideFunction: () => void): void;
248
248
 
249
249
  /**
250
250
  * Callback once the transition hide has finished.