fomantic-ui 2.9.4-beta.4 → 2.9.4-beta.41

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 (242) hide show
  1. package/.all-contributorsrc +20 -1
  2. package/.eslintrc.js +17 -0
  3. package/.github/FUNDING.yml +1 -1
  4. package/.github/workflows/ci.yml +5 -5
  5. package/.github/workflows/nightly.yml +1 -1
  6. package/.github/workflows/release.yml +1 -1
  7. package/CONTRIBUTORS.md +2 -0
  8. package/dist/components/accordion.css +1 -1
  9. package/dist/components/accordion.js +4 -2
  10. package/dist/components/accordion.min.css +1 -1
  11. package/dist/components/accordion.min.js +2 -2
  12. package/dist/components/ad.css +1 -1
  13. package/dist/components/ad.min.css +1 -1
  14. package/dist/components/api.js +7 -3
  15. package/dist/components/api.min.js +2 -2
  16. package/dist/components/breadcrumb.css +1 -1
  17. package/dist/components/breadcrumb.min.css +1 -1
  18. package/dist/components/button.css +19 -3
  19. package/dist/components/button.min.css +2 -2
  20. package/dist/components/calendar.css +1 -1
  21. package/dist/components/calendar.js +4 -2
  22. package/dist/components/calendar.min.css +1 -1
  23. package/dist/components/calendar.min.js +2 -2
  24. package/dist/components/card.css +1 -1
  25. package/dist/components/card.min.css +1 -1
  26. package/dist/components/checkbox.css +1 -1
  27. package/dist/components/checkbox.js +10 -4
  28. package/dist/components/checkbox.min.css +1 -1
  29. package/dist/components/checkbox.min.js +3 -3
  30. package/dist/components/comment.css +1 -1
  31. package/dist/components/comment.min.css +1 -1
  32. package/dist/components/container.css +1 -1
  33. package/dist/components/container.min.css +1 -1
  34. package/dist/components/dimmer.css +1 -1
  35. package/dist/components/dimmer.js +4 -2
  36. package/dist/components/dimmer.min.css +1 -1
  37. package/dist/components/dimmer.min.js +2 -2
  38. package/dist/components/divider.css +1 -1
  39. package/dist/components/divider.min.css +1 -1
  40. package/dist/components/dropdown.css +18 -20
  41. package/dist/components/dropdown.js +99 -31
  42. package/dist/components/dropdown.min.css +2 -2
  43. package/dist/components/dropdown.min.js +3 -3
  44. package/dist/components/embed.css +1 -1
  45. package/dist/components/embed.js +17 -7
  46. package/dist/components/embed.min.css +1 -1
  47. package/dist/components/embed.min.js +3 -3
  48. package/dist/components/emoji.css +1 -1
  49. package/dist/components/emoji.min.css +1 -1
  50. package/dist/components/feed.css +1 -1
  51. package/dist/components/feed.min.css +1 -1
  52. package/dist/components/flag.css +1 -1
  53. package/dist/components/flag.min.css +1 -1
  54. package/dist/components/flyout.css +1 -1
  55. package/dist/components/flyout.js +4 -2
  56. package/dist/components/flyout.min.css +1 -1
  57. package/dist/components/flyout.min.js +2 -2
  58. package/dist/components/form.css +15 -5
  59. package/dist/components/form.js +42 -17
  60. package/dist/components/form.min.css +2 -2
  61. package/dist/components/form.min.js +3 -3
  62. package/dist/components/grid.css +5 -5
  63. package/dist/components/grid.min.css +2 -2
  64. package/dist/components/header.css +4 -1
  65. package/dist/components/header.min.css +2 -2
  66. package/dist/components/icon.css +1 -1
  67. package/dist/components/icon.min.css +1 -1
  68. package/dist/components/image.css +1 -1
  69. package/dist/components/image.min.css +1 -1
  70. package/dist/components/input.css +30 -10
  71. package/dist/components/input.min.css +2 -2
  72. package/dist/components/item.css +1 -1
  73. package/dist/components/item.min.css +1 -1
  74. package/dist/components/label.css +1 -2
  75. package/dist/components/label.min.css +2 -2
  76. package/dist/components/list.css +1 -1
  77. package/dist/components/list.min.css +1 -1
  78. package/dist/components/loader.css +1 -1
  79. package/dist/components/loader.min.css +1 -1
  80. package/dist/components/menu.css +1 -2
  81. package/dist/components/menu.min.css +2 -2
  82. package/dist/components/message.css +1 -1
  83. package/dist/components/message.min.css +1 -1
  84. package/dist/components/modal.css +1 -1
  85. package/dist/components/modal.js +7 -3
  86. package/dist/components/modal.min.css +1 -1
  87. package/dist/components/modal.min.js +2 -2
  88. package/dist/components/nag.css +1 -1
  89. package/dist/components/nag.js +11 -5
  90. package/dist/components/nag.min.css +1 -1
  91. package/dist/components/nag.min.js +3 -3
  92. package/dist/components/placeholder.css +1 -1
  93. package/dist/components/placeholder.min.css +1 -1
  94. package/dist/components/popup.css +1 -2
  95. package/dist/components/popup.js +10 -4
  96. package/dist/components/popup.min.css +2 -2
  97. package/dist/components/popup.min.js +2 -2
  98. package/dist/components/progress.css +1 -1
  99. package/dist/components/progress.js +4 -2
  100. package/dist/components/progress.min.css +1 -1
  101. package/dist/components/progress.min.js +2 -2
  102. package/dist/components/rail.css +1 -1
  103. package/dist/components/rail.min.css +1 -1
  104. package/dist/components/rating.css +1 -1
  105. package/dist/components/rating.js +4 -2
  106. package/dist/components/rating.min.css +1 -1
  107. package/dist/components/rating.min.js +2 -2
  108. package/dist/components/reset.css +1 -1
  109. package/dist/components/reset.min.css +1 -1
  110. package/dist/components/reveal.css +1 -1
  111. package/dist/components/reveal.min.css +1 -1
  112. package/dist/components/search.css +1 -1
  113. package/dist/components/search.js +64 -12
  114. package/dist/components/search.min.css +1 -1
  115. package/dist/components/search.min.js +3 -3
  116. package/dist/components/segment.css +1 -1
  117. package/dist/components/segment.min.css +1 -1
  118. package/dist/components/shape.css +1 -1
  119. package/dist/components/shape.js +4 -2
  120. package/dist/components/shape.min.css +1 -1
  121. package/dist/components/shape.min.js +2 -2
  122. package/dist/components/sidebar.css +1 -1
  123. package/dist/components/sidebar.js +4 -2
  124. package/dist/components/sidebar.min.css +1 -1
  125. package/dist/components/sidebar.min.js +2 -2
  126. package/dist/components/site.css +1 -1
  127. package/dist/components/site.js +4 -2
  128. package/dist/components/site.min.css +1 -1
  129. package/dist/components/site.min.js +2 -2
  130. package/dist/components/slider.css +1 -1
  131. package/dist/components/slider.js +4 -2
  132. package/dist/components/slider.min.css +1 -1
  133. package/dist/components/slider.min.js +2 -2
  134. package/dist/components/state.js +4 -2
  135. package/dist/components/state.min.js +2 -2
  136. package/dist/components/statistic.css +1 -1
  137. package/dist/components/statistic.min.css +1 -1
  138. package/dist/components/step.css +1 -1
  139. package/dist/components/step.min.css +1 -1
  140. package/dist/components/sticky.css +1 -1
  141. package/dist/components/sticky.js +4 -2
  142. package/dist/components/sticky.min.css +1 -1
  143. package/dist/components/sticky.min.js +2 -2
  144. package/dist/components/tab.css +1 -1
  145. package/dist/components/tab.js +4 -2
  146. package/dist/components/tab.min.css +1 -1
  147. package/dist/components/tab.min.js +2 -2
  148. package/dist/components/table.css +7 -7
  149. package/dist/components/table.min.css +2 -2
  150. package/dist/components/text.css +1 -1
  151. package/dist/components/text.min.css +1 -1
  152. package/dist/components/toast.css +1 -1
  153. package/dist/components/toast.js +4 -2
  154. package/dist/components/toast.min.css +1 -1
  155. package/dist/components/toast.min.js +2 -2
  156. package/dist/components/transition.css +1 -1
  157. package/dist/components/transition.js +7 -3
  158. package/dist/components/transition.min.css +1 -1
  159. package/dist/components/transition.min.js +2 -2
  160. package/dist/components/visibility.js +4 -2
  161. package/dist/components/visibility.min.js +2 -2
  162. package/dist/semantic.css +152 -101
  163. package/dist/semantic.js +336 -121
  164. package/dist/semantic.min.css +3 -3
  165. package/dist/semantic.min.js +3 -3
  166. package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
  167. package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  168. package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  169. package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
  170. package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
  171. package/package.json +3 -3
  172. package/src/definitions/behaviors/api.js +6 -2
  173. package/src/definitions/behaviors/form.js +41 -16
  174. package/src/definitions/behaviors/state.js +3 -1
  175. package/src/definitions/behaviors/visibility.js +3 -1
  176. package/src/definitions/collections/form.less +14 -4
  177. package/src/definitions/collections/grid.less +4 -4
  178. package/src/definitions/collections/table.less +6 -6
  179. package/src/definitions/elements/button.less +25 -3
  180. package/src/definitions/elements/header.less +5 -0
  181. package/src/definitions/elements/input.less +14 -6
  182. package/src/definitions/globals/site.js +3 -1
  183. package/src/definitions/modules/accordion.js +3 -1
  184. package/src/definitions/modules/calendar.js +3 -1
  185. package/src/definitions/modules/checkbox.js +9 -3
  186. package/src/definitions/modules/dimmer.js +3 -1
  187. package/src/definitions/modules/dropdown.js +98 -30
  188. package/src/definitions/modules/dropdown.less +12 -5
  189. package/src/definitions/modules/embed.js +16 -6
  190. package/src/definitions/modules/flyout.js +3 -1
  191. package/src/definitions/modules/modal.js +6 -2
  192. package/src/definitions/modules/nag.js +10 -4
  193. package/src/definitions/modules/popup.js +9 -3
  194. package/src/definitions/modules/progress.js +3 -1
  195. package/src/definitions/modules/rating.js +3 -1
  196. package/src/definitions/modules/search.js +63 -11
  197. package/src/definitions/modules/search.less +9 -2
  198. package/src/definitions/modules/shape.js +3 -1
  199. package/src/definitions/modules/sidebar.js +3 -1
  200. package/src/definitions/modules/slider.js +3 -1
  201. package/src/definitions/modules/sticky.js +3 -1
  202. package/src/definitions/modules/tab.js +3 -1
  203. package/src/definitions/modules/toast.js +3 -1
  204. package/src/definitions/modules/transition.js +6 -2
  205. package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
  206. package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  207. package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  208. package/src/themes/default/collections/form.variables +1 -0
  209. package/src/themes/default/elements/button.variables +2 -0
  210. package/src/themes/default/globals/site.variables +3 -0
  211. package/src/themes/default/globals/variation.variables +3 -0
  212. package/src/themes/default/modules/dropdown.variables +3 -0
  213. package/src/themes/default/modules/search.variables +3 -0
  214. package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
  215. package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
  216. package/types/fomantic-ui-accordion.d.ts +1 -1
  217. package/types/fomantic-ui-api.d.ts +9 -3
  218. package/types/fomantic-ui-calendar.d.ts +93 -8
  219. package/types/fomantic-ui-checkbox.d.ts +14 -4
  220. package/types/fomantic-ui-dimmer.d.ts +1 -1
  221. package/types/fomantic-ui-dropdown.d.ts +36 -35
  222. package/types/fomantic-ui-embed.d.ts +1 -1
  223. package/types/fomantic-ui-flyout.d.ts +24 -10
  224. package/types/fomantic-ui-form.d.ts +123 -15
  225. package/types/fomantic-ui-modal.d.ts +75 -5
  226. package/types/fomantic-ui-nag.d.ts +4 -4
  227. package/types/fomantic-ui-popup.d.ts +11 -11
  228. package/types/fomantic-ui-progress.d.ts +12 -6
  229. package/types/fomantic-ui-rating.d.ts +1 -1
  230. package/types/fomantic-ui-search.d.ts +43 -13
  231. package/types/fomantic-ui-shape.d.ts +2 -2
  232. package/types/fomantic-ui-sidebar.d.ts +4 -4
  233. package/types/fomantic-ui-slider.d.ts +1 -1
  234. package/types/fomantic-ui-sticky.d.ts +1 -1
  235. package/types/fomantic-ui-tab.d.ts +5 -5
  236. package/types/fomantic-ui-toast.d.ts +7 -2
  237. package/types/fomantic-ui-transition.d.ts +29 -1
  238. package/types/fomantic-ui-visibility.d.ts +3 -3
  239. package/types/index.d.ts +25 -25
  240. package/types/tests.ts +188 -0
  241. package/types/tsconfig.json +1 -1
  242. package/types/fomantic-ui-tests.ts +0 -25
package/dist/semantic.js CHANGED
@@ -1,15 +1,15 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.4-beta.4+34acb50
2
+ * # Fomantic UI - 2.9.4-beta.41+9e455a4
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
6
- * Copyright 2023 Contributors
6
+ * Copyright 2024 Contributors
7
7
  * Released under the MIT license
8
8
  * https://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Site
12
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Site
13
13
  * https://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -302,7 +302,9 @@
302
302
  });
303
303
  }
304
304
  clearTimeout(module.performance.timer);
305
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
305
+ module.performance.timer = setTimeout(function () {
306
+ module.performance.display();
307
+ }, 500);
306
308
  },
307
309
  display: function () {
308
310
  var
@@ -463,7 +465,7 @@
463
465
  })(jQuery, window, document);
464
466
 
465
467
  /*!
466
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Form Validation
468
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Form Validation
467
469
  * https://github.com/fomantic/Fomantic-UI/
468
470
  *
469
471
  *
@@ -1002,6 +1004,13 @@
1002
1004
  fullFields[name].rules.push({ type: rule });
1003
1005
  });
1004
1006
  }
1007
+
1008
+ $.each(fullFields[name].rules, function (index, rule) {
1009
+ var ruleName = module.get.ruleName(rule);
1010
+ if (ruleName === 'empty') {
1011
+ module.warn('*** DEPRECATED *** : Rule "empty" for field "' + name + '" will be removed in a future version. -> Use "notEmpty" rule instead.');
1012
+ }
1013
+ });
1005
1014
  });
1006
1015
 
1007
1016
  return fullFields;
@@ -1015,9 +1024,10 @@
1015
1024
  ancillary = module.get.ancillaryValue(rule),
1016
1025
  $field = module.get.field(field.identifier),
1017
1026
  value = $field.val(),
1018
- prompt = isFunction(rule.prompt)
1019
- ? rule.prompt(value)
1020
- : rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
1027
+ promptCheck = rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
1028
+ prompt = String(isFunction(promptCheck)
1029
+ ? promptCheck.call($field[0], value)
1030
+ : promptCheck),
1021
1031
  requiresValue = prompt.search('{value}') !== -1,
1022
1032
  requiresName = prompt.search('{name}') !== -1,
1023
1033
  parts,
@@ -1055,10 +1065,10 @@
1055
1065
  },
1056
1066
  settings: function () {
1057
1067
  if ($.isPlainObject(parameters)) {
1058
- if (parameters.fields) {
1059
- parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
1060
- }
1061
1068
  settings = $.extend(true, {}, $.fn.form.settings, parameters);
1069
+ if (settings.fields) {
1070
+ settings.fields = module.get.fieldsFromShorthand(settings.fields);
1071
+ }
1062
1072
  validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
1063
1073
  module.verbose('Extending settings', validation, settings);
1064
1074
  } else {
@@ -1175,7 +1185,7 @@
1175
1185
  var
1176
1186
  $field = $(field),
1177
1187
  $calendar = $field.closest(selector.uiCalendar),
1178
- name = $field.prop('name'),
1188
+ name = $field.prop('name') || $field.prop('id'),
1179
1189
  value = $field.val(),
1180
1190
  isCheckbox = $field.is(selector.checkbox),
1181
1191
  isRadio = $field.is(selector.radio),
@@ -1701,20 +1711,20 @@
1701
1711
  isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
1702
1712
  isDisabled = $el.is(':disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
1703
1713
  validation = module.get.validation($el),
1704
- hasEmptyRule = validation
1714
+ hasNotEmptyRule = validation
1705
1715
  ? $.grep(validation.rules, function (rule) {
1706
- return rule.type === 'empty';
1707
- }) !== 0
1716
+ return ['notEmpty', 'checked', 'empty'].indexOf(rule.type) >= 0;
1717
+ }).length > 0
1708
1718
  : false,
1709
1719
  identifier = module.get.identifier(validation, $el)
1710
1720
  ;
1711
- if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
1721
+ if (isRequired && !isDisabled && !hasNotEmptyRule && identifier !== undefined) {
1712
1722
  if (isCheckbox) {
1713
1723
  module.verbose("Adding 'checked' rule on field", identifier);
1714
1724
  module.add.rule(identifier, 'checked');
1715
1725
  } else {
1716
- module.verbose("Adding 'empty' rule on field", identifier);
1717
- module.add.rule(identifier, 'empty');
1726
+ module.verbose("Adding 'notEmpty' rule on field", identifier);
1727
+ module.add.rule(identifier, 'notEmpty');
1718
1728
  }
1719
1729
  }
1720
1730
  });
@@ -1813,13 +1823,14 @@
1813
1823
  fieldErrors = [],
1814
1824
  isDisabled = $field.filter(':not(:disabled)').length === 0,
1815
1825
  validationMessage = $field[0].validationMessage,
1826
+ noNativeValidation = field.noNativeValidation || settings.noNativeValidation || $field.filter('[formnovalidate],[novalidate]').length > 0 || $module.filter('[novalidate]').length > 0,
1816
1827
  errorLimit
1817
1828
  ;
1818
1829
  if (!field.identifier) {
1819
1830
  module.debug('Using field name as identifier', identifier);
1820
1831
  field.identifier = identifier;
1821
1832
  }
1822
- if (validationMessage) {
1833
+ if (validationMessage && !noNativeValidation) {
1823
1834
  module.debug('Field is natively invalid', identifier);
1824
1835
  fieldErrors.push(validationMessage);
1825
1836
  fieldValid = false;
@@ -1955,6 +1966,12 @@
1955
1966
  module.error.apply(console, arguments);
1956
1967
  }
1957
1968
  },
1969
+ warn: function () {
1970
+ if (!settings.silent) {
1971
+ module.warn = Function.prototype.bind.call(console.warn, console, settings.name + ':');
1972
+ module.warn.apply(console, arguments);
1973
+ }
1974
+ },
1958
1975
  performance: {
1959
1976
  log: function (message) {
1960
1977
  var
@@ -1975,7 +1992,9 @@
1975
1992
  });
1976
1993
  }
1977
1994
  clearTimeout(module.performance.timer);
1978
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1995
+ module.performance.timer = setTimeout(function () {
1996
+ module.performance.display();
1997
+ }, 500);
1979
1998
  },
1980
1999
  display: function () {
1981
2000
  var
@@ -2069,6 +2088,7 @@
2069
2088
  name: 'Form',
2070
2089
  namespace: 'form',
2071
2090
 
2091
+ silent: false,
2072
2092
  debug: false,
2073
2093
  verbose: false,
2074
2094
  performance: true,
@@ -2091,6 +2111,7 @@
2091
2111
  errorFocus: true,
2092
2112
  dateHandling: 'date', // 'date', 'input', 'formatter'
2093
2113
  errorLimit: 0,
2114
+ noNativeValidation: false,
2094
2115
 
2095
2116
  onValid: function () {},
2096
2117
  onInvalid: function () {},
@@ -2133,6 +2154,7 @@
2133
2154
  maxValue: '{name} must have a maximum value of {ruleValue}',
2134
2155
  minValue: '{name} must have a minimum value of {ruleValue}',
2135
2156
  empty: '{name} must have a value',
2157
+ notEmpty: '{name} must have a value',
2136
2158
  checked: '{name} must be checked',
2137
2159
  email: '{name} must be a valid e-mail',
2138
2160
  url: '{name} must be a valid url',
@@ -2265,10 +2287,15 @@
2265
2287
  rules: {
2266
2288
 
2267
2289
  // is not empty or blank string
2268
- empty: function (value) {
2290
+ notEmpty: function (value) {
2269
2291
  return !(value === undefined || value === '' || (Array.isArray(value) && value.length === 0));
2270
2292
  },
2271
2293
 
2294
+ /* Deprecated */
2295
+ empty: function (value) {
2296
+ return $.fn.form.settings.rules.notEmpty(value);
2297
+ },
2298
+
2272
2299
  // checkbox checked
2273
2300
  checked: function () {
2274
2301
  return $(this).filter(':checked').length > 0;
@@ -2620,7 +2647,7 @@
2620
2647
  })(jQuery, window, document);
2621
2648
 
2622
2649
  /*!
2623
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Accordion
2650
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Accordion
2624
2651
  * https://github.com/fomantic/Fomantic-UI/
2625
2652
  *
2626
2653
  *
@@ -3059,7 +3086,9 @@
3059
3086
  });
3060
3087
  }
3061
3088
  clearTimeout(module.performance.timer);
3062
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
3089
+ module.performance.timer = setTimeout(function () {
3090
+ module.performance.display();
3091
+ }, 500);
3063
3092
  },
3064
3093
  display: function () {
3065
3094
  var
@@ -3214,7 +3243,7 @@
3214
3243
  })(jQuery, window, document);
3215
3244
 
3216
3245
  /*!
3217
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Calendar
3246
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Calendar
3218
3247
  * https://github.com/fomantic/Fomantic-UI/
3219
3248
  *
3220
3249
  *
@@ -4694,7 +4723,9 @@
4694
4723
  });
4695
4724
  }
4696
4725
  clearTimeout(module.performance.timer);
4697
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
4726
+ module.performance.timer = setTimeout(function () {
4727
+ module.performance.display();
4728
+ }, 500);
4698
4729
  },
4699
4730
  display: function () {
4700
4731
  var
@@ -5225,7 +5256,7 @@
5225
5256
  })(jQuery, window, document);
5226
5257
 
5227
5258
  /*!
5228
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Checkbox
5259
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Checkbox
5229
5260
  * https://github.com/fomantic/Fomantic-UI/
5230
5261
  *
5231
5262
  *
@@ -5436,7 +5467,7 @@
5436
5467
  ;
5437
5468
 
5438
5469
  var
5439
- r = module.get.radios(),
5470
+ r = module.get.radios().not(selector.disabled),
5440
5471
  rIndex = r.index($module),
5441
5472
  rLen = r.length,
5442
5473
  checkIndex = false
@@ -5454,7 +5485,10 @@
5454
5485
 
5455
5486
  return false;
5456
5487
  }
5457
- if (settings.beforeChecked.apply($(r[checkIndex]).children(selector.input)[0]) === false) {
5488
+ var nextOption = $(r[checkIndex]),
5489
+ nextInput = nextOption.children(selector.input),
5490
+ disallowOption = nextOption.hasClass(className.readOnly) || nextInput.prop('readonly');
5491
+ if (disallowOption || settings.beforeChecked.apply(nextInput[0]) === false) {
5458
5492
  module.verbose('Next option should not allow check, cancelling key navigation');
5459
5493
 
5460
5494
  return false;
@@ -5951,7 +5985,9 @@
5951
5985
  });
5952
5986
  }
5953
5987
  clearTimeout(module.performance.timer);
5954
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
5988
+ module.performance.timer = setTimeout(function () {
5989
+ module.performance.display();
5990
+ }, 500);
5955
5991
  },
5956
5992
  display: function () {
5957
5993
  var
@@ -6099,6 +6135,7 @@
6099
6135
 
6100
6136
  selector: {
6101
6137
  checkbox: '.ui.checkbox',
6138
+ disabled: '.disabled, :has(input[disabled])',
6102
6139
  label: 'label',
6103
6140
  input: 'input[type="checkbox"], input[type="radio"]',
6104
6141
  link: 'a[href]',
@@ -6108,7 +6145,7 @@
6108
6145
  })(jQuery, window, document);
6109
6146
 
6110
6147
  /*!
6111
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Dimmer
6148
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Dimmer
6112
6149
  * https://github.com/fomantic/Fomantic-UI/
6113
6150
  *
6114
6151
  *
@@ -6637,7 +6674,9 @@
6637
6674
  });
6638
6675
  }
6639
6676
  clearTimeout(module.performance.timer);
6640
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
6677
+ module.performance.timer = setTimeout(function () {
6678
+ module.performance.display();
6679
+ }, 500);
6641
6680
  },
6642
6681
  display: function () {
6643
6682
  var
@@ -6839,7 +6878,7 @@
6839
6878
  })(jQuery, window, document);
6840
6879
 
6841
6880
  /*!
6842
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Dropdown
6881
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Dropdown
6843
6882
  * https://github.com/fomantic/Fomantic-UI/
6844
6883
  *
6845
6884
  *
@@ -7633,7 +7672,7 @@
7633
7672
  }
7634
7673
  if (module.is.multiple()) {
7635
7674
  $.each(preSelected, function (index, value) {
7636
- $item.filter('[data-value="' + value + '"]')
7675
+ $item.filter('[data-' + metadata.value + '="' + value + '"]')
7637
7676
  .addClass(className.filtered)
7638
7677
  ;
7639
7678
  });
@@ -7730,11 +7769,13 @@
7730
7769
  ? query
7731
7770
  : module.get.query()
7732
7771
  ),
7733
- results = null,
7734
- escapedTerm = module.escape.string(searchTerm),
7735
- regExpFlags = (settings.ignoreSearchCase ? 'i' : '') + 'gm',
7772
+ results = null,
7773
+ escapedTerm = module.escape.string(searchTerm),
7774
+ regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
7775
+ regExpFlags = regExpIgnore + 'gm',
7736
7776
  beginsWithRegExp = new RegExp('^' + escapedTerm, regExpFlags)
7737
7777
  ;
7778
+ module.remove.filteredItem();
7738
7779
  // avoid loop if we're matching nothing
7739
7780
  if (module.has.query()) {
7740
7781
  results = [];
@@ -7778,12 +7819,34 @@
7778
7819
  ;
7779
7820
  }
7780
7821
  module.debug('Showing only matched items', searchTerm);
7781
- module.remove.filteredItem();
7782
7822
  if (results) {
7783
7823
  $item
7784
7824
  .not(results)
7785
7825
  .addClass(className.filtered)
7786
7826
  ;
7827
+ if (settings.highlightMatches && (settings.match === 'both' || settings.match === 'text')) {
7828
+ var querySplit = query.split(''),
7829
+ diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
7830
+ htmlReg = '(?![^<]*>)',
7831
+ markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
7832
+ markedReplacer = function () {
7833
+ var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
7834
+ return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
7835
+ });
7836
+
7837
+ return args.join('');
7838
+ }
7839
+ ;
7840
+ $.each(results, function (index, result) {
7841
+ var $result = $(result),
7842
+ markedHTML = module.get.choiceText($result, true)
7843
+ ;
7844
+ if (settings.ignoreDiacritics) {
7845
+ markedHTML = markedHTML.normalize('NFD');
7846
+ }
7847
+ $result.html(markedHTML.replace(markedRegExp, markedReplacer));
7848
+ });
7849
+ }
7787
7850
  }
7788
7851
 
7789
7852
  if (!module.has.query()) {
@@ -7819,8 +7882,10 @@
7819
7882
  termLength = term.length,
7820
7883
  queryLength = query.length
7821
7884
  ;
7822
- query = settings.ignoreSearchCase ? query.toLowerCase() : query;
7823
- term = settings.ignoreSearchCase ? term.toLowerCase() : term;
7885
+ if (settings.ignoreSearchCase) {
7886
+ query = query.toLowerCase();
7887
+ term = term.toLowerCase();
7888
+ }
7824
7889
  if (queryLength > termLength) {
7825
7890
  return false;
7826
7891
  }
@@ -8027,7 +8092,7 @@
8027
8092
  if (!itemActivated && !pageLostFocus) {
8028
8093
  if (settings.forceSelection) {
8029
8094
  module.forceSelection();
8030
- } else if (!settings.allowAdditions) {
8095
+ } else if (!settings.allowAdditions && !settings.keepSearchTerm && !module.has.menuSearch()) {
8031
8096
  module.remove.searchTerm();
8032
8097
  }
8033
8098
  module.hide();
@@ -8076,7 +8141,9 @@
8076
8141
  module.set.filtered();
8077
8142
  }
8078
8143
  clearTimeout(module.timer);
8079
- module.timer = setTimeout(function () { module.search(); }, settings.delay.search);
8144
+ module.timer = setTimeout(function () {
8145
+ module.search();
8146
+ }, settings.delay.search);
8080
8147
  },
8081
8148
  label: {
8082
8149
  click: function (event) {
@@ -8253,7 +8320,9 @@
8253
8320
  module.remove.userAddition();
8254
8321
  }
8255
8322
  if (!settings.keepSearchTerm) {
8256
- module.remove.filteredItem();
8323
+ if (module.is.multiple()) {
8324
+ module.remove.filteredItem();
8325
+ }
8257
8326
  module.remove.searchTerm();
8258
8327
  }
8259
8328
  if (!module.is.visible() && $target.length > 0) {
@@ -9427,7 +9496,7 @@
9427
9496
  } else {
9428
9497
  $combo.text(text);
9429
9498
  }
9430
- } else if (settings.action === 'activate') {
9499
+ } else if (settings.action === 'activate' || isFunction(settings.action)) {
9431
9500
  if (text !== module.get.placeholderText() || isNotPlaceholder) {
9432
9501
  $text.removeClass(className.placeholder);
9433
9502
  }
@@ -9608,19 +9677,27 @@
9608
9677
  $selectedItem = settings.allowAdditions
9609
9678
  ? $selectedItem || module.get.itemWithAdditions(value)
9610
9679
  : $selectedItem || module.get.item(value);
9611
- if (!$selectedItem) {
9680
+ if (!$selectedItem && value !== undefined) {
9612
9681
  return false;
9613
9682
  }
9614
- module.debug('Setting selected menu item to', $selectedItem);
9615
- if (module.is.multiple() && !keepSearchTerm) {
9616
- module.remove.searchWidth();
9617
- }
9618
- if (module.is.single()) {
9683
+ if (isMultiple) {
9684
+ if (!keepSearchTerm) {
9685
+ module.remove.searchWidth();
9686
+ }
9687
+ if (settings.useLabels) {
9688
+ module.remove.selectedItem();
9689
+ if (value === undefined) {
9690
+ module.remove.labels($module.find(selector.label), true);
9691
+ }
9692
+ }
9693
+ } else {
9619
9694
  module.remove.activeItem();
9620
9695
  module.remove.selectedItem();
9621
- } else if (settings.useLabels) {
9622
- module.remove.selectedItem();
9623
9696
  }
9697
+ if (!$selectedItem) {
9698
+ return false;
9699
+ }
9700
+ module.debug('Setting selected menu item to', $selectedItem);
9624
9701
  // select each item
9625
9702
  $selectedItem
9626
9703
  .each(function () {
@@ -9920,6 +9997,12 @@
9920
9997
  $item.removeClass(className.active);
9921
9998
  },
9922
9999
  filteredItem: function () {
10000
+ if (settings.highlightMatches) {
10001
+ $.each($item, function (index, item) {
10002
+ var $markItem = $(item);
10003
+ $markItem.html($markItem.html().replace(/<\/?mark>/g, ''));
10004
+ });
10005
+ }
9923
10006
  if (settings.useLabels && module.has.maxSelections()) {
9924
10007
  return;
9925
10008
  }
@@ -10264,7 +10347,12 @@
10264
10347
  return $selectedMenu.hasClass(className.leftward);
10265
10348
  },
10266
10349
  clearable: function () {
10267
- return $module.hasClass(className.clearable) || settings.clearable;
10350
+ var hasClearableClass = $module.hasClass(className.clearable);
10351
+ if (!hasClearableClass && settings.clearable) {
10352
+ $module.addClass(className.clearable);
10353
+ }
10354
+
10355
+ return hasClearableClass || settings.clearable;
10268
10356
  },
10269
10357
  disabled: function () {
10270
10358
  return $module.hasClass(className.disabled);
@@ -10587,12 +10675,16 @@
10587
10675
  show: function () {
10588
10676
  module.verbose('Delaying show event to ensure user intent');
10589
10677
  clearTimeout(module.timer);
10590
- module.timer = setTimeout(function () { module.show(); }, settings.delay.show);
10678
+ module.timer = setTimeout(function () {
10679
+ module.show();
10680
+ }, settings.delay.show);
10591
10681
  },
10592
10682
  hide: function () {
10593
10683
  module.verbose('Delaying hide event to ensure user intent');
10594
10684
  clearTimeout(module.timer);
10595
- module.timer = setTimeout(function () { module.hide(); }, settings.delay.hide);
10685
+ module.timer = setTimeout(function () {
10686
+ module.hide();
10687
+ }, settings.delay.hide);
10596
10688
  },
10597
10689
  },
10598
10690
 
@@ -10625,6 +10717,7 @@
10625
10717
  return text.replace(regExp.escape, '\\$&');
10626
10718
  },
10627
10719
  htmlEntities: function (string, forceAmpersand) {
10720
+ forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
10628
10721
  var
10629
10722
  badChars = /["'<>`]/g,
10630
10723
  shouldEscape = /["&'<>`]/,
@@ -10641,8 +10734,7 @@
10641
10734
  ;
10642
10735
  if (shouldEscape.test(string)) {
10643
10736
  string = string.replace(forceAmpersand ? /&/g : /&(?![\d#a-z]{1,12};)/gi, '&amp;');
10644
-
10645
- return string.replace(badChars, escapedChar);
10737
+ string = string.replace(badChars, escapedChar);
10646
10738
  }
10647
10739
 
10648
10740
  return string;
@@ -10718,7 +10810,9 @@
10718
10810
  });
10719
10811
  }
10720
10812
  clearTimeout(module.performance.timer);
10721
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
10813
+ module.performance.timer = setTimeout(function () {
10814
+ module.performance.display();
10815
+ }, 500);
10722
10816
  },
10723
10817
  display: function () {
10724
10818
  var
@@ -10845,6 +10939,7 @@
10845
10939
 
10846
10940
  match: 'both', // what to match against with search selection (both, text, or label)
10847
10941
  fullTextSearch: 'exact', // search anywhere in value (set to 'exact' to require exact matches)
10942
+ highlightMatches: false, // Whether search result should highlight matching strings
10848
10943
  ignoreDiacritics: false, // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
10849
10944
  hideDividers: false, // Whether to hide any divider elements (specified in selector.divider) that are sibling to any items when searched (set to true will hide all dividers, set to 'empty' will hide them when they are not followed by a visible item)
10850
10945
 
@@ -10960,6 +11055,7 @@
10960
11055
  descriptionVertical: 'descriptionVertical', // whether description should be vertical
10961
11056
  value: 'value', // actual dropdown value
10962
11057
  text: 'text', // displayed text when selected
11058
+ data: 'data', // custom data attributes
10963
11059
  type: 'type', // type of dropdown element
10964
11060
  image: 'image', // optional image path
10965
11061
  imageClass: 'imageClass', // optional individual class for image
@@ -11069,8 +11165,7 @@
11069
11165
  ;
11070
11166
  if (shouldEscape.test(string)) {
11071
11167
  string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
11072
-
11073
- return string.replace(badChars, escapedChar);
11168
+ string = string.replace(badChars, escapedChar);
11074
11169
  }
11075
11170
 
11076
11171
  return string;
@@ -11105,9 +11200,21 @@
11105
11200
  $.each(values, function (index, option) {
11106
11201
  var
11107
11202
  itemType = option[fields.type] || 'item',
11108
- isMenu = itemType.indexOf('menu') !== -1
11203
+ isMenu = itemType.indexOf('menu') !== -1,
11204
+ maybeData = '',
11205
+ dataObject = option[fields.data]
11109
11206
  ;
11110
-
11207
+ if (dataObject) {
11208
+ var dataKey,
11209
+ dataKeyEscaped
11210
+ ;
11211
+ for (dataKey in dataObject) {
11212
+ dataKeyEscaped = String(dataKey).replace(/\W/g, '');
11213
+ if (Object.prototype.hasOwnProperty.call(dataObject, dataKey) && ['text', 'value'].indexOf(dataKeyEscaped.toLowerCase()) === -1) {
11214
+ maybeData += ' data-' + dataKeyEscaped + '="' + deQuote(String(dataObject[dataKey])) + '"';
11215
+ }
11216
+ }
11217
+ }
11111
11218
  if (itemType === 'item' || isMenu) {
11112
11219
  var
11113
11220
  maybeText = option[fields.text]
@@ -11124,7 +11231,7 @@
11124
11231
  : '',
11125
11232
  hasDescription = escape(option[fields.description] || '', preserveHTML) !== ''
11126
11233
  ;
11127
- html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + '>';
11234
+ html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + maybeData + '>';
11128
11235
  if (isMenu) {
11129
11236
  html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
11130
11237
  }
@@ -11197,7 +11304,7 @@
11197
11304
  })(jQuery, window, document);
11198
11305
 
11199
11306
  /*!
11200
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Embed
11307
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Embed
11201
11308
  * https://github.com/fomantic/Fomantic-UI/
11202
11309
  *
11203
11310
  *
@@ -11317,11 +11424,12 @@
11317
11424
 
11318
11425
  createPlaceholder: function (placeholder) {
11319
11426
  var
11320
- icon = module.get.icon()
11427
+ icon = module.get.icon(),
11428
+ alt = module.get.alt()
11321
11429
  ;
11322
11430
  placeholder = placeholder || module.get.placeholder();
11323
- $module.html(templates.placeholder(placeholder, icon));
11324
- module.debug('Creating placeholder for embed', placeholder, icon);
11431
+ $module.html(templates.placeholder(placeholder, icon, alt));
11432
+ module.debug('Creating placeholder for embed', placeholder, icon, alt);
11325
11433
  },
11326
11434
 
11327
11435
  createEmbed: function (url) {
@@ -11401,6 +11509,9 @@
11401
11509
  placeholder: function () {
11402
11510
  return settings.placeholder || $module.data(metadata.placeholder);
11403
11511
  },
11512
+ alt: function () {
11513
+ return settings.alt || $module.data(metadata.alt);
11514
+ },
11404
11515
  icon: function () {
11405
11516
  return settings.icon || ($module.data(metadata.icon) !== undefined
11406
11517
  ? $module.data(metadata.icon)
@@ -11486,6 +11597,7 @@
11486
11597
  .removeData(metadata.id)
11487
11598
  .removeData(metadata.icon)
11488
11599
  .removeData(metadata.placeholder)
11600
+ .removeData(metadata.alt)
11489
11601
  .removeData(metadata.source)
11490
11602
  .removeData(metadata.url)
11491
11603
  ;
@@ -11638,7 +11750,9 @@
11638
11750
  });
11639
11751
  }
11640
11752
  clearTimeout(module.performance.timer);
11641
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
11753
+ module.performance.timer = setTimeout(function () {
11754
+ module.performance.display();
11755
+ }, 500);
11642
11756
  },
11643
11757
  display: function () {
11644
11758
  var
@@ -11753,6 +11867,8 @@
11753
11867
  source: false,
11754
11868
  url: false,
11755
11869
  id: false,
11870
+ placeholder: false,
11871
+ alt: false,
11756
11872
 
11757
11873
  // standard video settings
11758
11874
  autoplay: 'auto',
@@ -11775,6 +11891,7 @@
11775
11891
  id: 'id',
11776
11892
  icon: 'icon',
11777
11893
  placeholder: 'placeholder',
11894
+ alt: 'alt',
11778
11895
  source: 'source',
11779
11896
  url: 'url',
11780
11897
  },
@@ -11850,7 +11967,7 @@
11850
11967
  + ' width="100%" height="100%"'
11851
11968
  + ' msallowFullScreen allowFullScreen></iframe>';
11852
11969
  },
11853
- placeholder: function (image, icon) {
11970
+ placeholder: function (image, icon, alt) {
11854
11971
  var
11855
11972
  html = '',
11856
11973
  deQuote = $.fn.embed.settings.templates.deQuote
@@ -11859,7 +11976,7 @@
11859
11976
  html += '<i class="' + deQuote(icon) + ' icon"></i>';
11860
11977
  }
11861
11978
  if (image) {
11862
- html += '<img class="placeholder" src="' + deQuote(image) + '">';
11979
+ html += '<img class="placeholder" src="' + deQuote(image) + (alt ? '" alt="' + deQuote(alt) : '') + '">';
11863
11980
  }
11864
11981
 
11865
11982
  return html;
@@ -11876,7 +11993,7 @@
11876
11993
  })(jQuery, window, document);
11877
11994
 
11878
11995
  /*!
11879
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Flyout
11996
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Flyout
11880
11997
  * https://github.com/fomantic/Fomantic-UI/
11881
11998
  *
11882
11999
  *
@@ -13096,7 +13213,9 @@
13096
13213
  });
13097
13214
  }
13098
13215
  clearTimeout(module.performance.timer);
13099
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
13216
+ module.performance.timer = setTimeout(function () {
13217
+ module.performance.display();
13218
+ }, 500);
13100
13219
  },
13101
13220
  display: function () {
13102
13221
  var
@@ -13426,7 +13545,7 @@
13426
13545
  })(jQuery, window, document);
13427
13546
 
13428
13547
  /*!
13429
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Modal
13548
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Modal
13430
13549
  * https://github.com/fomantic/Fomantic-UI/
13431
13550
  *
13432
13551
  *
@@ -13954,7 +14073,9 @@
13954
14073
  },
13955
14074
  debounce: function (method, delay) {
13956
14075
  clearTimeout(module.timer);
13957
- module.timer = setTimeout(function () { method(); }, delay);
14076
+ module.timer = setTimeout(function () {
14077
+ method();
14078
+ }, delay);
13958
14079
  },
13959
14080
  keyboard: function (event) {
13960
14081
  var
@@ -14700,7 +14821,9 @@
14700
14821
  });
14701
14822
  }
14702
14823
  clearTimeout(module.performance.timer);
14703
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
14824
+ module.performance.timer = setTimeout(function () {
14825
+ module.performance.display();
14826
+ }, 500);
14704
14827
  },
14705
14828
  display: function () {
14706
14829
  var
@@ -15060,7 +15183,7 @@
15060
15183
  })(jQuery, window, document);
15061
15184
 
15062
15185
  /*!
15063
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Nag
15186
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Nag
15064
15187
  * https://github.com/fomantic/Fomantic-UI/
15065
15188
  *
15066
15189
  *
@@ -15149,7 +15272,9 @@
15149
15272
  }
15150
15273
 
15151
15274
  if (settings.displayTime > 0) {
15152
- setTimeout(function () { module.hide(); }, settings.displayTime);
15275
+ setTimeout(function () {
15276
+ module.hide();
15277
+ }, settings.displayTime);
15153
15278
  }
15154
15279
  module.show();
15155
15280
  },
@@ -15205,8 +15330,10 @@
15205
15330
  module.debug('Dismissing nag', settings.storageMethod, settings.key, settings.value, settings.expires);
15206
15331
  module.storage.set(settings.key, settings.value);
15207
15332
  }
15208
- event.stopImmediatePropagation();
15209
- event.preventDefault();
15333
+ if (event) {
15334
+ event.stopImmediatePropagation();
15335
+ event.preventDefault();
15336
+ }
15210
15337
  },
15211
15338
 
15212
15339
  should: {
@@ -15438,7 +15565,9 @@
15438
15565
  });
15439
15566
  }
15440
15567
  clearTimeout(module.performance.timer);
15441
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
15568
+ module.performance.timer = setTimeout(function () {
15569
+ module.performance.display();
15570
+ }, 500);
15442
15571
  },
15443
15572
  display: function () {
15444
15573
  var
@@ -15621,7 +15750,7 @@
15621
15750
  })(jQuery, window, document);
15622
15751
 
15623
15752
  /*!
15624
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Popup
15753
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Popup
15625
15754
  * https://github.com/fomantic/Fomantic-UI/
15626
15755
  *
15627
15756
  *
@@ -15816,7 +15945,9 @@
15816
15945
  ;
15817
15946
  clearTimeout(module.hideTimer);
15818
15947
  if (!openedWithTouch || (openedWithTouch && settings.addTouchEvents)) {
15819
- module.showTimer = setTimeout(function () { module.show(); }, delay);
15948
+ module.showTimer = setTimeout(function () {
15949
+ module.show();
15950
+ }, delay);
15820
15951
  }
15821
15952
  },
15822
15953
  end: function () {
@@ -15826,7 +15957,9 @@
15826
15957
  : settings.delay
15827
15958
  ;
15828
15959
  clearTimeout(module.showTimer);
15829
- module.hideTimer = setTimeout(function () { module.hide(); }, delay);
15960
+ module.hideTimer = setTimeout(function () {
15961
+ module.hide();
15962
+ }, delay);
15830
15963
  },
15831
15964
  touchstart: function (event) {
15832
15965
  openedWithTouch = true;
@@ -16866,7 +16999,9 @@
16866
16999
  });
16867
17000
  }
16868
17001
  clearTimeout(module.performance.timer);
16869
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
17002
+ module.performance.timer = setTimeout(function () {
17003
+ module.performance.display();
17004
+ }, 500);
16870
17005
  },
16871
17006
  display: function () {
16872
17007
  var
@@ -17177,7 +17312,7 @@
17177
17312
  })(jQuery, window, document);
17178
17313
 
17179
17314
  /*!
17180
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Progress
17315
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Progress
17181
17316
  * https://github.com/fomantic/Fomantic-UI/
17182
17317
  *
17183
17318
  *
@@ -17969,7 +18104,9 @@
17969
18104
  });
17970
18105
  }
17971
18106
  clearTimeout(module.performance.timer);
17972
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
18107
+ module.performance.timer = setTimeout(function () {
18108
+ module.performance.display();
18109
+ }, 500);
17973
18110
  },
17974
18111
  display: function () {
17975
18112
  var
@@ -18155,7 +18292,7 @@
18155
18292
  })(jQuery, window, document);
18156
18293
 
18157
18294
  /*!
18158
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Slider
18295
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Slider
18159
18296
  * https://github.com/fomantic/Fomantic-UI/
18160
18297
  *
18161
18298
  *
@@ -19423,7 +19560,9 @@
19423
19560
  });
19424
19561
  }
19425
19562
  clearTimeout(module.performance.timer);
19426
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
19563
+ module.performance.timer = setTimeout(function () {
19564
+ module.performance.display();
19565
+ }, 500);
19427
19566
  },
19428
19567
  display: function () {
19429
19568
  var
@@ -19604,7 +19743,7 @@
19604
19743
  })(jQuery, window, document);
19605
19744
 
19606
19745
  /*!
19607
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Rating
19746
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Rating
19608
19747
  * https://github.com/fomantic/Fomantic-UI/
19609
19748
  *
19610
19749
  *
@@ -19973,7 +20112,9 @@
19973
20112
  });
19974
20113
  }
19975
20114
  clearTimeout(module.performance.timer);
19976
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
20115
+ module.performance.timer = setTimeout(function () {
20116
+ module.performance.display();
20117
+ }, 500);
19977
20118
  },
19978
20119
  display: function () {
19979
20120
  var
@@ -20143,7 +20284,7 @@
20143
20284
  })(jQuery, window, document);
20144
20285
 
20145
20286
  /*!
20146
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Search
20287
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Search
20147
20288
  * https://github.com/fomantic/Fomantic-UI/
20148
20289
  *
20149
20290
  *
@@ -20279,7 +20420,10 @@
20279
20420
  // this makes sure $.extend does not add specified search fields to default fields
20280
20421
  // this is the only setting which should not extend defaults
20281
20422
  if (parameters && parameters.searchFields !== undefined) {
20282
- settings.searchFields = parameters.searchFields;
20423
+ settings.searchFields = Array.isArray(parameters.searchFields)
20424
+ ? parameters.searchFields
20425
+ : [parameters.searchFields]
20426
+ ;
20283
20427
  }
20284
20428
  },
20285
20429
  },
@@ -20313,7 +20457,9 @@
20313
20457
  callback = function () {
20314
20458
  module.cancel.query();
20315
20459
  module.remove.focus();
20316
- module.timer = setTimeout(function () { module.hideResults(); }, settings.hideDelay);
20460
+ module.timer = setTimeout(function () {
20461
+ module.hideResults();
20462
+ }, settings.hideDelay);
20317
20463
  }
20318
20464
  ;
20319
20465
  if (pageLostFocus) {
@@ -20773,7 +20919,7 @@
20773
20919
  exactResults = [],
20774
20920
  fuzzyResults = [],
20775
20921
  searchExp = searchTerm.replace(regExp.escape, '\\$&'),
20776
- matchRegExp = new RegExp(regExp.beginsWith + searchExp, 'i'),
20922
+ matchRegExp = new RegExp(regExp.beginsWith + searchExp, settings.ignoreSearchCase ? 'i' : ''),
20777
20923
 
20778
20924
  // avoid duplicates when pushing results
20779
20925
  addResult = function (array, result) {
@@ -20809,13 +20955,14 @@
20809
20955
  var concatenatedContent = [];
20810
20956
  $.each(searchFields, function (index, field) {
20811
20957
  var
20812
- fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number')
20958
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
20813
20959
  ;
20814
20960
  if (fieldExists) {
20815
20961
  var text;
20816
20962
  text = typeof content[field] === 'string'
20817
20963
  ? module.remove.diacritics(content[field])
20818
20964
  : content[field].toString();
20965
+ text = $('<div/>', { html: text }).text().trim();
20819
20966
  if (settings.fullTextSearch === 'all') {
20820
20967
  concatenatedContent.push(text);
20821
20968
  if (index < lastSearchFieldIndex) {
@@ -20846,8 +20993,10 @@
20846
20993
  },
20847
20994
  },
20848
20995
  exactSearch: function (query, term) {
20849
- query = query.toLowerCase();
20850
- term = term.toLowerCase();
20996
+ if (settings.ignoreSearchCase) {
20997
+ query = query.toLowerCase();
20998
+ term = term.toLowerCase();
20999
+ }
20851
21000
 
20852
21001
  return term.indexOf(query) > -1;
20853
21002
  },
@@ -20874,8 +21023,10 @@
20874
21023
  if (typeof query !== 'string') {
20875
21024
  return false;
20876
21025
  }
20877
- query = query.toLowerCase();
20878
- term = term.toLowerCase();
21026
+ if (settings.ignoreSearchCase) {
21027
+ query = query.toLowerCase();
21028
+ term = term.toLowerCase();
21029
+ }
20879
21030
  if (queryLength > termLength) {
20880
21031
  return false;
20881
21032
  }
@@ -21230,6 +21381,39 @@
21230
21381
  response[fields.results] = response[fields.results].slice(0, settings.maxResults);
21231
21382
  }
21232
21383
  }
21384
+ if (settings.highlightMatches) {
21385
+ var results = response[fields.results],
21386
+ regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
21387
+ querySplit = module.get.value().split(''),
21388
+ diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
21389
+ htmlReg = '(?![^<]*>)',
21390
+ markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
21391
+ markedReplacer = function () {
21392
+ var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
21393
+ return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
21394
+ });
21395
+
21396
+ return args.join('');
21397
+ }
21398
+ ;
21399
+ $.each(results, function (label, content) {
21400
+ $.each(settings.searchFields, function (index, field) {
21401
+ var
21402
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
21403
+ ;
21404
+ if (fieldExists) {
21405
+ var markedHTML = typeof content[field] === 'string'
21406
+ ? content[field]
21407
+ : content[field].toString();
21408
+ if (settings.ignoreDiacritics) {
21409
+ markedHTML = markedHTML.normalize('NFD');
21410
+ }
21411
+ markedHTML = markedHTML.replace(/<\/?mark>/g, '');
21412
+ response[fields.results][label][field] = markedHTML.replace(markedRegExp, markedReplacer);
21413
+ }
21414
+ });
21415
+ });
21416
+ }
21233
21417
  if (isFunction(template)) {
21234
21418
  html = template(response, fields, settings.preserveHTML);
21235
21419
  } else {
@@ -21315,7 +21499,9 @@
21315
21499
  });
21316
21500
  }
21317
21501
  clearTimeout(module.performance.timer);
21318
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
21502
+ module.performance.timer = setTimeout(function () {
21503
+ module.performance.display();
21504
+ }, 500);
21319
21505
  },
21320
21506
  display: function () {
21321
21507
  var
@@ -21456,9 +21642,15 @@
21456
21642
  // search anywhere in value (set to 'exact' to require exact matches
21457
21643
  fullTextSearch: 'exact',
21458
21644
 
21645
+ // Whether search result should highlight matching strings
21646
+ highlightMatches: false,
21647
+
21459
21648
  // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
21460
21649
  ignoreDiacritics: false,
21461
21650
 
21651
+ // whether to consider case sensitivity on local searching
21652
+ ignoreSearchCase: true,
21653
+
21462
21654
  // whether to add events to prompt automatically
21463
21655
  automatic: true,
21464
21656
 
@@ -21576,8 +21768,9 @@
21576
21768
  };
21577
21769
  if (shouldEscape.test(string)) {
21578
21770
  string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
21579
-
21580
- return string.replace(badChars, escapedChar);
21771
+ string = string.replace(badChars, escapedChar);
21772
+ // FUI controlled HTML is still allowed
21773
+ string = string.replace(/&lt;(\/)*mark&gt;/g, '<$1mark>');
21581
21774
  }
21582
21775
 
21583
21776
  return string;
@@ -21721,7 +21914,7 @@
21721
21914
  })(jQuery, window, document);
21722
21915
 
21723
21916
  /*!
21724
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Shape
21917
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Shape
21725
21918
  * https://github.com/fomantic/Fomantic-UI/
21726
21919
  *
21727
21920
  *
@@ -22345,7 +22538,9 @@
22345
22538
  });
22346
22539
  }
22347
22540
  clearTimeout(module.performance.timer);
22348
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
22541
+ module.performance.timer = setTimeout(function () {
22542
+ module.performance.display();
22543
+ }, 500);
22349
22544
  },
22350
22545
  display: function () {
22351
22546
  var
@@ -22517,7 +22712,7 @@
22517
22712
  })(jQuery, window, document);
22518
22713
 
22519
22714
  /*!
22520
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Sidebar
22715
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Sidebar
22521
22716
  * https://github.com/fomantic/Fomantic-UI/
22522
22717
  *
22523
22718
  *
@@ -23389,7 +23584,9 @@
23389
23584
  });
23390
23585
  }
23391
23586
  clearTimeout(module.performance.timer);
23392
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
23587
+ module.performance.timer = setTimeout(function () {
23588
+ module.performance.display();
23589
+ }, 500);
23393
23590
  },
23394
23591
  display: function () {
23395
23592
  var
@@ -23570,7 +23767,7 @@
23570
23767
  })(jQuery, window, document);
23571
23768
 
23572
23769
  /*!
23573
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Sticky
23770
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Sticky
23574
23771
  * https://github.com/fomantic/Fomantic-UI/
23575
23772
  *
23576
23773
  *
@@ -24317,7 +24514,9 @@
24317
24514
  });
24318
24515
  }
24319
24516
  clearTimeout(module.performance.timer);
24320
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 0);
24517
+ module.performance.timer = setTimeout(function () {
24518
+ module.performance.display();
24519
+ }, 0);
24321
24520
  },
24322
24521
  display: function () {
24323
24522
  var
@@ -24486,7 +24685,7 @@
24486
24685
  })(jQuery, window, document);
24487
24686
 
24488
24687
  /*!
24489
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Tab
24688
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Tab
24490
24689
  * https://github.com/fomantic/Fomantic-UI/
24491
24690
  *
24492
24691
  *
@@ -25275,7 +25474,9 @@
25275
25474
  });
25276
25475
  }
25277
25476
  clearTimeout(module.performance.timer);
25278
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
25477
+ module.performance.timer = setTimeout(function () {
25478
+ module.performance.display();
25479
+ }, 500);
25279
25480
  },
25280
25481
  display: function () {
25281
25482
  var
@@ -25452,7 +25653,7 @@
25452
25653
  })(jQuery, window, document);
25453
25654
 
25454
25655
  /*!
25455
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Toast
25656
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Toast
25456
25657
  * https://github.com/fomantic/Fomantic-UI/
25457
25658
  *
25458
25659
  *
@@ -26155,7 +26356,9 @@
26155
26356
  });
26156
26357
  }
26157
26358
  clearTimeout(module.performance.timer);
26158
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
26359
+ module.performance.timer = setTimeout(function () {
26360
+ module.performance.display();
26361
+ }, 500);
26159
26362
  },
26160
26363
  display: function () {
26161
26364
  var
@@ -26413,7 +26616,7 @@
26413
26616
  })(jQuery, window, document);
26414
26617
 
26415
26618
  /*!
26416
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Transition
26619
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Transition
26417
26620
  * https://github.com/fomantic/Fomantic-UI/
26418
26621
  *
26419
26622
  *
@@ -26556,7 +26759,9 @@
26556
26759
  ? ($allModules.length - index) * interval
26557
26760
  : index * interval;
26558
26761
  module.debug('Delaying animation by', delay);
26559
- setTimeout(function () { module.animate(); }, delay);
26762
+ setTimeout(function () {
26763
+ module.animate();
26764
+ }, delay);
26560
26765
  },
26561
26766
 
26562
26767
  animate: function (overrideSettings) {
@@ -27263,7 +27468,9 @@
27263
27468
  });
27264
27469
  }
27265
27470
  clearTimeout(module.performance.timer);
27266
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
27471
+ module.performance.timer = setTimeout(function () {
27472
+ module.performance.display();
27473
+ }, 500);
27267
27474
  },
27268
27475
  display: function () {
27269
27476
  var
@@ -27444,7 +27651,7 @@
27444
27651
  })(jQuery, window, document);
27445
27652
 
27446
27653
  /*!
27447
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - API
27654
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - API
27448
27655
  * https://github.com/fomantic/Fomantic-UI/
27449
27656
  *
27450
27657
  *
@@ -28092,7 +28299,9 @@
28092
28299
  module.debug('Adding error state');
28093
28300
  module.set.error();
28094
28301
  if (module.should.removeError()) {
28095
- setTimeout(function () { module.remove.error(); }, settings.errorDuration);
28302
+ setTimeout(function () {
28303
+ module.remove.error();
28304
+ }, settings.errorDuration);
28096
28305
  }
28097
28306
  }
28098
28307
  module.debug('API Request failed', errorMessage, xhr);
@@ -28416,7 +28625,9 @@
28416
28625
  });
28417
28626
  }
28418
28627
  clearTimeout(module.performance.timer);
28419
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
28628
+ module.performance.timer = setTimeout(function () {
28629
+ module.performance.display();
28630
+ }, 500);
28420
28631
  },
28421
28632
  display: function () {
28422
28633
  var
@@ -28666,7 +28877,7 @@
28666
28877
  })(jQuery, window, document);
28667
28878
 
28668
28879
  /*!
28669
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - State
28880
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - State
28670
28881
  * https://github.com/fomantic/Fomantic-UI/
28671
28882
  *
28672
28883
  *
@@ -29149,7 +29360,9 @@
29149
29360
  });
29150
29361
  }
29151
29362
  clearTimeout(module.performance.timer);
29152
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
29363
+ module.performance.timer = setTimeout(function () {
29364
+ module.performance.display();
29365
+ }, 500);
29153
29366
  },
29154
29367
  display: function () {
29155
29368
  var
@@ -29362,7 +29575,7 @@
29362
29575
  })(jQuery, window, document);
29363
29576
 
29364
29577
  /*!
29365
- * # Fomantic-UI 2.9.4-beta.4+34acb50 - Visibility
29578
+ * # Fomantic-UI 2.9.4-beta.41+9e455a4 - Visibility
29366
29579
  * https://github.com/fomantic/Fomantic-UI/
29367
29580
  *
29368
29581
  *
@@ -30451,7 +30664,9 @@
30451
30664
  });
30452
30665
  }
30453
30666
  clearTimeout(module.performance.timer);
30454
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
30667
+ module.performance.timer = setTimeout(function () {
30668
+ module.performance.display();
30669
+ }, 500);
30455
30670
  },
30456
30671
  display: function () {
30457
30672
  var