fomantic-ui 2.9.4-beta.9 → 2.9.4-beta.91

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 (273) 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 +6 -6
  5. package/.github/workflows/depsreview.yml +14 -0
  6. package/.github/workflows/nightly.yml +1 -1
  7. package/.github/workflows/release.yml +1 -1
  8. package/CONTRIBUTORS.md +2 -0
  9. package/README.md +2 -12
  10. package/dist/components/accordion.css +1 -1
  11. package/dist/components/accordion.js +4 -2
  12. package/dist/components/accordion.min.css +1 -1
  13. package/dist/components/accordion.min.js +2 -2
  14. package/dist/components/ad.css +1 -1
  15. package/dist/components/ad.min.css +1 -1
  16. package/dist/components/api.js +7 -3
  17. package/dist/components/api.min.js +2 -2
  18. package/dist/components/breadcrumb.css +1 -1
  19. package/dist/components/breadcrumb.min.css +1 -1
  20. package/dist/components/button.css +21 -3
  21. package/dist/components/button.min.css +2 -2
  22. package/dist/components/calendar.css +1 -1
  23. package/dist/components/calendar.js +17 -4
  24. package/dist/components/calendar.min.css +1 -1
  25. package/dist/components/calendar.min.js +3 -3
  26. package/dist/components/card.css +1 -1
  27. package/dist/components/card.min.css +1 -1
  28. package/dist/components/checkbox.css +1 -1
  29. package/dist/components/checkbox.js +10 -4
  30. package/dist/components/checkbox.min.css +1 -1
  31. package/dist/components/checkbox.min.js +3 -3
  32. package/dist/components/comment.css +1 -1
  33. package/dist/components/comment.min.css +1 -1
  34. package/dist/components/container.css +1 -1
  35. package/dist/components/container.min.css +1 -1
  36. package/dist/components/dimmer.css +7 -3
  37. package/dist/components/dimmer.js +4 -2
  38. package/dist/components/dimmer.min.css +2 -2
  39. package/dist/components/dimmer.min.js +2 -2
  40. package/dist/components/divider.css +1 -1
  41. package/dist/components/divider.min.css +1 -1
  42. package/dist/components/dropdown.css +46 -38
  43. package/dist/components/dropdown.js +109 -34
  44. package/dist/components/dropdown.min.css +2 -2
  45. package/dist/components/dropdown.min.js +3 -3
  46. package/dist/components/embed.css +1 -1
  47. package/dist/components/embed.js +17 -7
  48. package/dist/components/embed.min.css +1 -1
  49. package/dist/components/embed.min.js +3 -3
  50. package/dist/components/emoji.css +4309 -3713
  51. package/dist/components/emoji.min.css +2 -2
  52. package/dist/components/feed.css +12 -1
  53. package/dist/components/feed.min.css +2 -2
  54. package/dist/components/flag.css +3 -1
  55. package/dist/components/flag.min.css +2 -2
  56. package/dist/components/flyout.css +1 -1
  57. package/dist/components/flyout.js +4 -2
  58. package/dist/components/flyout.min.css +1 -1
  59. package/dist/components/flyout.min.js +2 -2
  60. package/dist/components/form.css +15 -3
  61. package/dist/components/form.js +66 -23
  62. package/dist/components/form.min.css +2 -2
  63. package/dist/components/form.min.js +3 -3
  64. package/dist/components/grid.css +5 -5
  65. package/dist/components/grid.min.css +2 -2
  66. package/dist/components/header.css +1 -1
  67. package/dist/components/header.min.css +1 -1
  68. package/dist/components/icon.css +1 -1
  69. package/dist/components/icon.min.css +1 -1
  70. package/dist/components/image.css +1 -1
  71. package/dist/components/image.min.css +1 -1
  72. package/dist/components/input.css +1 -1
  73. package/dist/components/input.min.css +1 -1
  74. package/dist/components/item.css +1 -1
  75. package/dist/components/item.min.css +1 -1
  76. package/dist/components/label.css +7 -1
  77. package/dist/components/label.min.css +2 -2
  78. package/dist/components/list.css +1 -1
  79. package/dist/components/list.min.css +1 -1
  80. package/dist/components/loader.css +1 -1
  81. package/dist/components/loader.min.css +1 -1
  82. package/dist/components/menu.css +1 -1
  83. package/dist/components/menu.min.css +1 -1
  84. package/dist/components/message.css +2 -1
  85. package/dist/components/message.min.css +2 -2
  86. package/dist/components/modal.css +1 -1
  87. package/dist/components/modal.js +7 -3
  88. package/dist/components/modal.min.css +1 -1
  89. package/dist/components/modal.min.js +2 -2
  90. package/dist/components/nag.css +1 -1
  91. package/dist/components/nag.js +11 -5
  92. package/dist/components/nag.min.css +1 -1
  93. package/dist/components/nag.min.js +3 -3
  94. package/dist/components/placeholder.css +1 -1
  95. package/dist/components/placeholder.min.css +1 -1
  96. package/dist/components/popup.css +1 -1
  97. package/dist/components/popup.js +10 -4
  98. package/dist/components/popup.min.css +1 -1
  99. package/dist/components/popup.min.js +2 -2
  100. package/dist/components/progress.css +15 -6
  101. package/dist/components/progress.js +4 -2
  102. package/dist/components/progress.min.css +2 -2
  103. package/dist/components/progress.min.js +2 -2
  104. package/dist/components/rail.css +1 -1
  105. package/dist/components/rail.min.css +1 -1
  106. package/dist/components/rating.css +1 -1
  107. package/dist/components/rating.js +4 -2
  108. package/dist/components/rating.min.css +1 -1
  109. package/dist/components/rating.min.js +2 -2
  110. package/dist/components/reset.css +1 -1
  111. package/dist/components/reset.min.css +1 -1
  112. package/dist/components/reveal.css +1 -1
  113. package/dist/components/reveal.min.css +1 -1
  114. package/dist/components/search.css +1 -1
  115. package/dist/components/search.js +67 -14
  116. package/dist/components/search.min.css +1 -1
  117. package/dist/components/search.min.js +3 -3
  118. package/dist/components/segment.css +1 -1
  119. package/dist/components/segment.min.css +1 -1
  120. package/dist/components/shape.css +1 -1
  121. package/dist/components/shape.js +7 -5
  122. package/dist/components/shape.min.css +1 -1
  123. package/dist/components/shape.min.js +3 -3
  124. package/dist/components/sidebar.css +1 -1
  125. package/dist/components/sidebar.js +4 -2
  126. package/dist/components/sidebar.min.css +1 -1
  127. package/dist/components/sidebar.min.js +2 -2
  128. package/dist/components/site.css +14 -6
  129. package/dist/components/site.js +4 -2
  130. package/dist/components/site.min.css +2 -2
  131. package/dist/components/site.min.js +2 -2
  132. package/dist/components/slider.css +152 -2
  133. package/dist/components/slider.js +142 -44
  134. package/dist/components/slider.min.css +2 -2
  135. package/dist/components/slider.min.js +3 -3
  136. package/dist/components/state.js +4 -2
  137. package/dist/components/state.min.js +2 -2
  138. package/dist/components/statistic.css +1 -1
  139. package/dist/components/statistic.min.css +1 -1
  140. package/dist/components/step.css +992 -86
  141. package/dist/components/step.min.css +2 -2
  142. package/dist/components/sticky.css +1 -1
  143. package/dist/components/sticky.js +4 -2
  144. package/dist/components/sticky.min.css +1 -1
  145. package/dist/components/sticky.min.js +2 -2
  146. package/dist/components/tab.css +1 -1
  147. package/dist/components/tab.js +4 -2
  148. package/dist/components/tab.min.css +1 -1
  149. package/dist/components/tab.min.js +2 -2
  150. package/dist/components/table.css +32 -21
  151. package/dist/components/table.min.css +2 -2
  152. package/dist/components/text.css +1 -1
  153. package/dist/components/text.min.css +1 -1
  154. package/dist/components/toast.css +1 -1
  155. package/dist/components/toast.js +7 -3
  156. package/dist/components/toast.min.css +1 -1
  157. package/dist/components/toast.min.js +3 -3
  158. package/dist/components/transition.css +1 -1
  159. package/dist/components/transition.js +7 -3
  160. package/dist/components/transition.min.css +1 -1
  161. package/dist/components/transition.min.js +2 -2
  162. package/dist/components/visibility.js +4 -2
  163. package/dist/components/visibility.min.js +2 -2
  164. package/dist/semantic.css +6139 -3943
  165. package/dist/semantic.js +530 -180
  166. package/dist/semantic.min.css +3 -3
  167. package/dist/semantic.min.js +3 -3
  168. package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
  169. package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  170. package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  171. package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
  172. package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
  173. package/package.json +14 -14
  174. package/src/definitions/behaviors/api.js +6 -2
  175. package/src/definitions/behaviors/form.js +65 -22
  176. package/src/definitions/behaviors/state.js +3 -1
  177. package/src/definitions/behaviors/visibility.js +3 -1
  178. package/src/definitions/collections/form.less +9 -2
  179. package/src/definitions/collections/grid.less +4 -4
  180. package/src/definitions/collections/message.less +1 -0
  181. package/src/definitions/collections/table.less +69 -54
  182. package/src/definitions/elements/button.less +27 -3
  183. package/src/definitions/elements/label.less +5 -0
  184. package/src/definitions/elements/step.less +399 -85
  185. package/src/definitions/globals/site.js +3 -1
  186. package/src/definitions/globals/site.less +17 -12
  187. package/src/definitions/modules/accordion.js +3 -1
  188. package/src/definitions/modules/calendar.js +16 -3
  189. package/src/definitions/modules/checkbox.js +9 -3
  190. package/src/definitions/modules/dimmer.js +3 -1
  191. package/src/definitions/modules/dimmer.less +8 -5
  192. package/src/definitions/modules/dropdown.js +108 -33
  193. package/src/definitions/modules/dropdown.less +43 -29
  194. package/src/definitions/modules/embed.js +16 -6
  195. package/src/definitions/modules/flyout.js +3 -1
  196. package/src/definitions/modules/modal.js +6 -2
  197. package/src/definitions/modules/nag.js +10 -4
  198. package/src/definitions/modules/popup.js +9 -3
  199. package/src/definitions/modules/progress.js +3 -1
  200. package/src/definitions/modules/progress.less +17 -5
  201. package/src/definitions/modules/rating.js +3 -1
  202. package/src/definitions/modules/search.js +66 -13
  203. package/src/definitions/modules/search.less +9 -2
  204. package/src/definitions/modules/shape.js +6 -4
  205. package/src/definitions/modules/sidebar.js +3 -1
  206. package/src/definitions/modules/slider.js +141 -43
  207. package/src/definitions/modules/slider.less +103 -8
  208. package/src/definitions/modules/sticky.js +3 -1
  209. package/src/definitions/modules/tab.js +3 -1
  210. package/src/definitions/modules/toast.js +6 -2
  211. package/src/definitions/modules/transition.js +6 -2
  212. package/src/definitions/views/feed.less +11 -0
  213. package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
  214. package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  215. package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  216. package/src/themes/default/elements/button.variables +3 -0
  217. package/src/themes/default/elements/emoji.variables +172 -23
  218. package/src/themes/default/elements/flag.variables +3 -3
  219. package/src/themes/default/elements/step.variables +33 -0
  220. package/src/themes/default/globals/site.variables +3 -0
  221. package/src/themes/default/globals/variation.variables +9 -0
  222. package/src/themes/default/modules/dropdown.variables +3 -0
  223. package/src/themes/default/modules/progress.variables +1 -1
  224. package/src/themes/default/modules/search.variables +3 -0
  225. package/src/themes/default/modules/slider.variables +10 -0
  226. package/src/themes/default/views/feed.variables +3 -0
  227. package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
  228. package/src/themes/joypixels/elements/emoji.variables +183 -22
  229. package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
  230. package/tasks/admin/components/create.js +4 -4
  231. package/tasks/admin/components/init.js +2 -2
  232. package/tasks/admin/components/update.js +3 -3
  233. package/tasks/admin/distributions/create.js +3 -3
  234. package/tasks/admin/distributions/init.js +2 -2
  235. package/tasks/admin/distributions/update.js +4 -4
  236. package/tasks/build/assets.js +1 -1
  237. package/tasks/build/css.js +19 -10
  238. package/tasks/build/javascript.js +12 -5
  239. package/tasks/check-install.js +1 -1
  240. package/tasks/config/defaults.js +2 -0
  241. package/tasks/config/tasks.js +1 -1
  242. package/tasks/docs/build.js +3 -3
  243. package/tasks/docs/metadata.js +1 -1
  244. package/tasks/docs/serve.js +3 -1
  245. package/tasks/install.js +2 -2
  246. package/tasks/watch.js +1 -1
  247. package/types/fomantic-ui-accordion.d.ts +1 -1
  248. package/types/fomantic-ui-api.d.ts +9 -3
  249. package/types/fomantic-ui-calendar.d.ts +110 -9
  250. package/types/fomantic-ui-checkbox.d.ts +14 -4
  251. package/types/fomantic-ui-dimmer.d.ts +1 -1
  252. package/types/fomantic-ui-dropdown.d.ts +82 -44
  253. package/types/fomantic-ui-embed.d.ts +19 -2
  254. package/types/fomantic-ui-flyout.d.ts +25 -11
  255. package/types/fomantic-ui-form.d.ts +123 -15
  256. package/types/fomantic-ui-modal.d.ts +101 -5
  257. package/types/fomantic-ui-nag.d.ts +4 -4
  258. package/types/fomantic-ui-popup.d.ts +38 -12
  259. package/types/fomantic-ui-progress.d.ts +12 -6
  260. package/types/fomantic-ui-rating.d.ts +1 -1
  261. package/types/fomantic-ui-search.d.ts +138 -22
  262. package/types/fomantic-ui-shape.d.ts +2 -2
  263. package/types/fomantic-ui-sidebar.d.ts +4 -4
  264. package/types/fomantic-ui-slider.d.ts +56 -4
  265. package/types/fomantic-ui-sticky.d.ts +1 -1
  266. package/types/fomantic-ui-tab.d.ts +6 -6
  267. package/types/fomantic-ui-toast.d.ts +14 -2
  268. package/types/fomantic-ui-transition.d.ts +41 -7
  269. package/types/fomantic-ui-visibility.d.ts +3 -3
  270. package/types/index.d.ts +25 -25
  271. package/types/tests.ts +188 -0
  272. package/types/tsconfig.json +1 -1
  273. 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.9+128b459
2
+ * # Fomantic UI - 2.9.4-beta.91+83986c3
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.9+128b459 - Site
12
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - 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.9+128b459 - Form Validation
468
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Form Validation
467
469
  * https://github.com/fomantic/Fomantic-UI/
468
470
  *
469
471
  *
@@ -502,6 +504,7 @@
502
504
  element = this,
503
505
 
504
506
  formErrors = [],
507
+ formErrorsTracker = {},
505
508
  keyHeldDown = false,
506
509
 
507
510
  // set at run-time
@@ -1002,6 +1005,13 @@
1002
1005
  fullFields[name].rules.push({ type: rule });
1003
1006
  });
1004
1007
  }
1008
+
1009
+ $.each(fullFields[name].rules, function (index, rule) {
1010
+ var ruleName = module.get.ruleName(rule);
1011
+ if (ruleName === 'empty') {
1012
+ module.warn('*** DEPRECATED *** : Rule "empty" for field "' + name + '" will be removed in a future version. -> Use "notEmpty" rule instead.');
1013
+ }
1014
+ });
1005
1015
  });
1006
1016
 
1007
1017
  return fullFields;
@@ -1015,9 +1025,10 @@
1015
1025
  ancillary = module.get.ancillaryValue(rule),
1016
1026
  $field = module.get.field(field.identifier),
1017
1027
  value = $field.val(),
1018
- prompt = isFunction(rule.prompt)
1019
- ? rule.prompt(value)
1020
- : rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
1028
+ promptCheck = rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
1029
+ prompt = String(isFunction(promptCheck)
1030
+ ? promptCheck.call($field[0], value)
1031
+ : promptCheck),
1021
1032
  requiresValue = prompt.search('{value}') !== -1,
1022
1033
  requiresName = prompt.search('{name}') !== -1,
1023
1034
  parts,
@@ -1055,10 +1066,10 @@
1055
1066
  },
1056
1067
  settings: function () {
1057
1068
  if ($.isPlainObject(parameters)) {
1058
- if (parameters.fields) {
1059
- parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
1060
- }
1061
1069
  settings = $.extend(true, {}, $.fn.form.settings, parameters);
1070
+ if (settings.fields) {
1071
+ settings.fields = module.get.fieldsFromShorthand(settings.fields);
1072
+ }
1062
1073
  validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
1063
1074
  module.verbose('Extending settings', validation, settings);
1064
1075
  } else {
@@ -1175,7 +1186,7 @@
1175
1186
  var
1176
1187
  $field = $(field),
1177
1188
  $calendar = $field.closest(selector.uiCalendar),
1178
- name = $field.prop('name'),
1189
+ name = $field.prop('name') || $field.prop('id'),
1179
1190
  value = $field.val(),
1180
1191
  isCheckbox = $field.is(selector.checkbox),
1181
1192
  isRadio = $field.is(selector.radio),
@@ -1404,7 +1415,7 @@
1404
1415
  $prompt.css('display', 'none');
1405
1416
  }
1406
1417
  $prompt
1407
- .appendTo($fieldGroup)
1418
+ .appendTo($fieldGroup.filter('.' + className.error))
1408
1419
  ;
1409
1420
  }
1410
1421
  $prompt
@@ -1701,20 +1712,20 @@
1701
1712
  isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
1702
1713
  isDisabled = $el.is(':disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
1703
1714
  validation = module.get.validation($el),
1704
- hasEmptyRule = validation
1715
+ hasNotEmptyRule = validation
1705
1716
  ? $.grep(validation.rules, function (rule) {
1706
- return rule.type === 'empty';
1707
- }) !== 0
1717
+ return ['notEmpty', 'checked', 'empty'].indexOf(rule.type) >= 0;
1718
+ }).length > 0
1708
1719
  : false,
1709
1720
  identifier = module.get.identifier(validation, $el)
1710
1721
  ;
1711
- if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
1722
+ if (isRequired && !isDisabled && !hasNotEmptyRule && identifier !== undefined) {
1712
1723
  if (isCheckbox) {
1713
1724
  module.verbose("Adding 'checked' rule on field", identifier);
1714
1725
  module.add.rule(identifier, 'checked');
1715
1726
  } else {
1716
- module.verbose("Adding 'empty' rule on field", identifier);
1717
- module.add.rule(identifier, 'empty');
1727
+ module.verbose("Adding 'notEmpty' rule on field", identifier);
1728
+ module.add.rule(identifier, 'notEmpty');
1718
1729
  }
1719
1730
  }
1720
1731
  });
@@ -1741,6 +1752,7 @@
1741
1752
  $module.removeClass(className.initial);
1742
1753
  // reset errors
1743
1754
  formErrors = [];
1755
+ formErrorsTracker = {};
1744
1756
  if (module.determine.isValid()) {
1745
1757
  module.debug('Form has no validation errors, submitting');
1746
1758
  module.set.success();
@@ -1806,28 +1818,30 @@
1806
1818
  var
1807
1819
  identifier = field.identifier || fieldName,
1808
1820
  $field = module.get.field(identifier),
1821
+ $fieldGroup = $field.closest($group),
1809
1822
  $dependsField = field.depends
1810
1823
  ? module.get.field(field.depends)
1811
1824
  : false,
1812
1825
  fieldValid = true,
1813
1826
  fieldErrors = [],
1814
- isDisabled = $field.filter(':not(:disabled)').length === 0,
1827
+ isDisabled = $field.filter(':not(:disabled)').length === 0 || $fieldGroup.hasClass(className.disabled) || $fieldGroup.parent().hasClass(className.disabled),
1815
1828
  validationMessage = $field[0].validationMessage,
1829
+ noNativeValidation = field.noNativeValidation || settings.noNativeValidation || $field.filter('[formnovalidate],[novalidate]').length > 0 || $module.filter('[novalidate]').length > 0,
1816
1830
  errorLimit
1817
1831
  ;
1818
1832
  if (!field.identifier) {
1819
1833
  module.debug('Using field name as identifier', identifier);
1820
1834
  field.identifier = identifier;
1821
1835
  }
1822
- if (validationMessage) {
1836
+ if (validationMessage && !noNativeValidation && !isDisabled) {
1823
1837
  module.debug('Field is natively invalid', identifier);
1824
1838
  fieldErrors.push(validationMessage);
1825
1839
  fieldValid = false;
1826
1840
  if (showErrors) {
1827
- $field.closest($group).addClass(className.error);
1841
+ $fieldGroup.addClass(className.error);
1828
1842
  }
1829
1843
  } else if (showErrors) {
1830
- $field.closest($group).removeClass(className.error);
1844
+ $fieldGroup.removeClass(className.error);
1831
1845
  }
1832
1846
  if (isDisabled) {
1833
1847
  module.debug('Field is disabled. Skipping', identifier);
@@ -1842,7 +1856,22 @@
1842
1856
  var invalidFields = module.validate.rule(field, rule, true) || [];
1843
1857
  if (invalidFields.length > 0) {
1844
1858
  module.debug('Field is invalid', identifier, rule.type);
1845
- fieldErrors.push(module.get.prompt(rule, field));
1859
+ var fieldError = module.get.prompt(rule, field);
1860
+ if (!settings.inline) {
1861
+ if (
1862
+ // Always allow the first error prompt for new field identifiers
1863
+ (!(identifier in formErrorsTracker)
1864
+ // Also allow multiple error prompts per field identifier but make sure each prompt is unique
1865
+ || formErrorsTracker[identifier].indexOf(fieldError) === -1)
1866
+ // Limit the number of unique error prompts for every field identifier if specified
1867
+ && (!errorLimit || (formErrorsTracker[identifier] || []).length < errorLimit)
1868
+ ) {
1869
+ fieldErrors.push(fieldError);
1870
+ (formErrorsTracker[identifier] = formErrorsTracker[identifier] || []).push(fieldError);
1871
+ }
1872
+ } else {
1873
+ fieldErrors.push(fieldError);
1874
+ }
1846
1875
  fieldValid = false;
1847
1876
  if (showErrors) {
1848
1877
  $(invalidFields).closest($group).addClass(className.error);
@@ -1857,7 +1886,7 @@
1857
1886
  settings.onValid.call($field);
1858
1887
  }
1859
1888
  } else {
1860
- if (showErrors) {
1889
+ if (showErrors && fieldErrors.length > 0) {
1861
1890
  formErrors = formErrors.concat(fieldErrors);
1862
1891
  module.add.prompt(identifier, fieldErrors, true);
1863
1892
  settings.onInvalid.call($field, fieldErrors);
@@ -1955,6 +1984,12 @@
1955
1984
  module.error.apply(console, arguments);
1956
1985
  }
1957
1986
  },
1987
+ warn: function () {
1988
+ if (!settings.silent) {
1989
+ module.warn = Function.prototype.bind.call(console.warn, console, settings.name + ':');
1990
+ module.warn.apply(console, arguments);
1991
+ }
1992
+ },
1958
1993
  performance: {
1959
1994
  log: function (message) {
1960
1995
  var
@@ -1975,7 +2010,9 @@
1975
2010
  });
1976
2011
  }
1977
2012
  clearTimeout(module.performance.timer);
1978
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
2013
+ module.performance.timer = setTimeout(function () {
2014
+ module.performance.display();
2015
+ }, 500);
1979
2016
  },
1980
2017
  display: function () {
1981
2018
  var
@@ -2069,6 +2106,7 @@
2069
2106
  name: 'Form',
2070
2107
  namespace: 'form',
2071
2108
 
2109
+ silent: false,
2072
2110
  debug: false,
2073
2111
  verbose: false,
2074
2112
  performance: true,
@@ -2091,6 +2129,7 @@
2091
2129
  errorFocus: true,
2092
2130
  dateHandling: 'date', // 'date', 'input', 'formatter'
2093
2131
  errorLimit: 0,
2132
+ noNativeValidation: false,
2094
2133
 
2095
2134
  onValid: function () {},
2096
2135
  onInvalid: function () {},
@@ -2133,6 +2172,7 @@
2133
2172
  maxValue: '{name} must have a maximum value of {ruleValue}',
2134
2173
  minValue: '{name} must have a minimum value of {ruleValue}',
2135
2174
  empty: '{name} must have a value',
2175
+ notEmpty: '{name} must have a value',
2136
2176
  checked: '{name} must be checked',
2137
2177
  email: '{name} must be a valid e-mail',
2138
2178
  url: '{name} must be a valid url',
@@ -2265,10 +2305,15 @@
2265
2305
  rules: {
2266
2306
 
2267
2307
  // is not empty or blank string
2268
- empty: function (value) {
2308
+ notEmpty: function (value) {
2269
2309
  return !(value === undefined || value === '' || (Array.isArray(value) && value.length === 0));
2270
2310
  },
2271
2311
 
2312
+ /* Deprecated */
2313
+ empty: function (value) {
2314
+ return $.fn.form.settings.rules.notEmpty(value);
2315
+ },
2316
+
2272
2317
  // checkbox checked
2273
2318
  checked: function () {
2274
2319
  return $(this).filter(':checked').length > 0;
@@ -2620,7 +2665,7 @@
2620
2665
  })(jQuery, window, document);
2621
2666
 
2622
2667
  /*!
2623
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Accordion
2668
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Accordion
2624
2669
  * https://github.com/fomantic/Fomantic-UI/
2625
2670
  *
2626
2671
  *
@@ -3059,7 +3104,9 @@
3059
3104
  });
3060
3105
  }
3061
3106
  clearTimeout(module.performance.timer);
3062
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
3107
+ module.performance.timer = setTimeout(function () {
3108
+ module.performance.display();
3109
+ }, 500);
3063
3110
  },
3064
3111
  display: function () {
3065
3112
  var
@@ -3214,7 +3261,7 @@
3214
3261
  })(jQuery, window, document);
3215
3262
 
3216
3263
  /*!
3217
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Calendar
3264
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Calendar
3218
3265
  * https://github.com/fomantic/Fomantic-UI/
3219
3266
  *
3220
3267
  *
@@ -3317,7 +3364,17 @@
3317
3364
 
3318
3365
  destroy: function () {
3319
3366
  module.verbose('Destroying previous calendar for', element);
3320
- $module.removeData(moduleNamespace);
3367
+ $module.removeData([
3368
+ metadata.date,
3369
+ metadata.focusDate,
3370
+ metadata.startDate,
3371
+ metadata.endDate,
3372
+ metadata.minDate,
3373
+ metadata.maxDate,
3374
+ metadata.mode,
3375
+ metadata.monthOffset,
3376
+ moduleNamespace,
3377
+ ]);
3321
3378
  module.unbind.events();
3322
3379
  module.disconnect.classObserver();
3323
3380
  },
@@ -4694,7 +4751,9 @@
4694
4751
  });
4695
4752
  }
4696
4753
  clearTimeout(module.performance.timer);
4697
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
4754
+ module.performance.timer = setTimeout(function () {
4755
+ module.performance.display();
4756
+ }, 500);
4698
4757
  },
4699
4758
  display: function () {
4700
4759
  var
@@ -4902,7 +4961,8 @@
4902
4961
  text = settings.monthFirst || !/^\d{1,2}[./-]/.test(text) ? text : text.replace(/[./-]/g, '/').replace(/(\d+)\/(\d+)/, '$2/$1');
4903
4962
  var textDate = new Date(text);
4904
4963
  var numberOnly = text.match(/^\d+$/) !== null;
4905
- if (!numberOnly && !isNaN(textDate.getDate())) {
4964
+ var isShortYear = text.match(/^(?:\d{1,2}[./-]){2}\d{1,2}$/) !== null;
4965
+ if (!isShortYear && !numberOnly && !isNaN(textDate.getDate())) {
4906
4966
  return textDate;
4907
4967
  }
4908
4968
  text = text.toLowerCase();
@@ -5225,7 +5285,7 @@
5225
5285
  })(jQuery, window, document);
5226
5286
 
5227
5287
  /*!
5228
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Checkbox
5288
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Checkbox
5229
5289
  * https://github.com/fomantic/Fomantic-UI/
5230
5290
  *
5231
5291
  *
@@ -5436,7 +5496,7 @@
5436
5496
  ;
5437
5497
 
5438
5498
  var
5439
- r = module.get.radios(),
5499
+ r = module.get.radios().not(selector.disabled),
5440
5500
  rIndex = r.index($module),
5441
5501
  rLen = r.length,
5442
5502
  checkIndex = false
@@ -5454,7 +5514,10 @@
5454
5514
 
5455
5515
  return false;
5456
5516
  }
5457
- if (settings.beforeChecked.apply($(r[checkIndex]).children(selector.input)[0]) === false) {
5517
+ var nextOption = $(r[checkIndex]),
5518
+ nextInput = nextOption.children(selector.input),
5519
+ disallowOption = nextOption.hasClass(className.readOnly) || nextInput.prop('readonly');
5520
+ if (disallowOption || settings.beforeChecked.apply(nextInput[0]) === false) {
5458
5521
  module.verbose('Next option should not allow check, cancelling key navigation');
5459
5522
 
5460
5523
  return false;
@@ -5951,7 +6014,9 @@
5951
6014
  });
5952
6015
  }
5953
6016
  clearTimeout(module.performance.timer);
5954
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
6017
+ module.performance.timer = setTimeout(function () {
6018
+ module.performance.display();
6019
+ }, 500);
5955
6020
  },
5956
6021
  display: function () {
5957
6022
  var
@@ -6099,6 +6164,7 @@
6099
6164
 
6100
6165
  selector: {
6101
6166
  checkbox: '.ui.checkbox',
6167
+ disabled: '.disabled, :has(input[disabled])',
6102
6168
  label: 'label',
6103
6169
  input: 'input[type="checkbox"], input[type="radio"]',
6104
6170
  link: 'a[href]',
@@ -6108,7 +6174,7 @@
6108
6174
  })(jQuery, window, document);
6109
6175
 
6110
6176
  /*!
6111
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Dimmer
6177
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Dimmer
6112
6178
  * https://github.com/fomantic/Fomantic-UI/
6113
6179
  *
6114
6180
  *
@@ -6637,7 +6703,9 @@
6637
6703
  });
6638
6704
  }
6639
6705
  clearTimeout(module.performance.timer);
6640
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
6706
+ module.performance.timer = setTimeout(function () {
6707
+ module.performance.display();
6708
+ }, 500);
6641
6709
  },
6642
6710
  display: function () {
6643
6711
  var
@@ -6839,7 +6907,7 @@
6839
6907
  })(jQuery, window, document);
6840
6908
 
6841
6909
  /*!
6842
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Dropdown
6910
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Dropdown
6843
6911
  * https://github.com/fomantic/Fomantic-UI/
6844
6912
  *
6845
6913
  *
@@ -6967,6 +7035,9 @@
6967
7035
  module.change.values(settings.values);
6968
7036
  module.remove.initialLoad();
6969
7037
  }
7038
+ if (module.get.placeholderText() !== '') {
7039
+ module.set.placeholderText();
7040
+ }
6970
7041
 
6971
7042
  module.refreshData();
6972
7043
 
@@ -7633,7 +7704,7 @@
7633
7704
  }
7634
7705
  if (module.is.multiple()) {
7635
7706
  $.each(preSelected, function (index, value) {
7636
- $item.filter('[data-value="' + value + '"]')
7707
+ $item.filter('[data-' + metadata.value + '="' + value + '"]')
7637
7708
  .addClass(className.filtered)
7638
7709
  ;
7639
7710
  });
@@ -7730,11 +7801,13 @@
7730
7801
  ? query
7731
7802
  : module.get.query()
7732
7803
  ),
7733
- results = null,
7734
- escapedTerm = module.escape.string(searchTerm),
7735
- regExpFlags = (settings.ignoreSearchCase ? 'i' : '') + 'gm',
7804
+ results = null,
7805
+ escapedTerm = module.escape.string(searchTerm),
7806
+ regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
7807
+ regExpFlags = regExpIgnore + 'gm',
7736
7808
  beginsWithRegExp = new RegExp('^' + escapedTerm, regExpFlags)
7737
7809
  ;
7810
+ module.remove.filteredItem();
7738
7811
  // avoid loop if we're matching nothing
7739
7812
  if (module.has.query()) {
7740
7813
  results = [];
@@ -7778,12 +7851,34 @@
7778
7851
  ;
7779
7852
  }
7780
7853
  module.debug('Showing only matched items', searchTerm);
7781
- module.remove.filteredItem();
7782
7854
  if (results) {
7783
7855
  $item
7784
7856
  .not(results)
7785
7857
  .addClass(className.filtered)
7786
7858
  ;
7859
+ if (settings.highlightMatches && (settings.match === 'both' || settings.match === 'text')) {
7860
+ var querySplit = query.split(''),
7861
+ diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
7862
+ htmlReg = '(?![^<]*>)',
7863
+ markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
7864
+ markedReplacer = function () {
7865
+ var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
7866
+ return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
7867
+ });
7868
+
7869
+ return args.join('');
7870
+ }
7871
+ ;
7872
+ $.each(results, function (index, result) {
7873
+ var $result = $(result),
7874
+ markedHTML = module.get.choiceText($result, true)
7875
+ ;
7876
+ if (settings.ignoreDiacritics) {
7877
+ markedHTML = markedHTML.normalize('NFD');
7878
+ }
7879
+ $result.html(markedHTML.replace(markedRegExp, markedReplacer));
7880
+ });
7881
+ }
7787
7882
  }
7788
7883
 
7789
7884
  if (!module.has.query()) {
@@ -7819,8 +7914,10 @@
7819
7914
  termLength = term.length,
7820
7915
  queryLength = query.length
7821
7916
  ;
7822
- query = settings.ignoreSearchCase ? query.toLowerCase() : query;
7823
- term = settings.ignoreSearchCase ? term.toLowerCase() : term;
7917
+ if (settings.ignoreSearchCase) {
7918
+ query = query.toLowerCase();
7919
+ term = term.toLowerCase();
7920
+ }
7824
7921
  if (queryLength > termLength) {
7825
7922
  return false;
7826
7923
  }
@@ -8027,7 +8124,7 @@
8027
8124
  if (!itemActivated && !pageLostFocus) {
8028
8125
  if (settings.forceSelection) {
8029
8126
  module.forceSelection();
8030
- } else if (!settings.allowAdditions) {
8127
+ } else if (!settings.allowAdditions && !settings.keepSearchTerm && !module.has.menuSearch()) {
8031
8128
  module.remove.searchTerm();
8032
8129
  }
8033
8130
  module.hide();
@@ -8042,7 +8139,9 @@
8042
8139
  if (module.is.searchSelection()) {
8043
8140
  module.remove.searchTerm();
8044
8141
  }
8045
- module.hide();
8142
+ if (settings.collapseOnClearable) {
8143
+ module.hide();
8144
+ }
8046
8145
  event.stopPropagation();
8047
8146
  },
8048
8147
  },
@@ -8076,7 +8175,9 @@
8076
8175
  module.set.filtered();
8077
8176
  }
8078
8177
  clearTimeout(module.timer);
8079
- module.timer = setTimeout(function () { module.search(); }, settings.delay.search);
8178
+ module.timer = setTimeout(function () {
8179
+ module.search();
8180
+ }, settings.delay.search);
8080
8181
  },
8081
8182
  label: {
8082
8183
  click: function (event) {
@@ -8253,7 +8354,9 @@
8253
8354
  module.remove.userAddition();
8254
8355
  }
8255
8356
  if (!settings.keepSearchTerm) {
8256
- module.remove.filteredItem();
8357
+ if (module.is.multiple()) {
8358
+ module.remove.filteredItem();
8359
+ }
8257
8360
  module.remove.searchTerm();
8258
8361
  }
8259
8362
  if (!module.is.visible() && $target.length > 0) {
@@ -9427,7 +9530,7 @@
9427
9530
  } else {
9428
9531
  $combo.text(text);
9429
9532
  }
9430
- } else if (settings.action === 'activate') {
9533
+ } else if (settings.action === 'activate' || isFunction(settings.action)) {
9431
9534
  if (text !== module.get.placeholderText() || isNotPlaceholder) {
9432
9535
  $text.removeClass(className.placeholder);
9433
9536
  }
@@ -9487,7 +9590,7 @@
9487
9590
  module.set.scrollPosition($nextValue);
9488
9591
  $selectedItem.removeClass(className.selected);
9489
9592
  $nextValue.addClass(className.selected);
9490
- if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9593
+ if (settings.selectOnKeydown && module.is.single() && (!$nextItem || !$nextItem.hasClass(className.actionable))) {
9491
9594
  module.set.selectedItem($nextValue);
9492
9595
  }
9493
9596
  }
@@ -9608,19 +9711,27 @@
9608
9711
  $selectedItem = settings.allowAdditions
9609
9712
  ? $selectedItem || module.get.itemWithAdditions(value)
9610
9713
  : $selectedItem || module.get.item(value);
9611
- if (!$selectedItem) {
9714
+ if (!$selectedItem && value !== undefined) {
9612
9715
  return false;
9613
9716
  }
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()) {
9717
+ if (isMultiple) {
9718
+ if (!keepSearchTerm) {
9719
+ module.remove.searchWidth();
9720
+ }
9721
+ if (settings.useLabels) {
9722
+ module.remove.selectedItem();
9723
+ if (value === undefined) {
9724
+ module.remove.labels($module.find(selector.label), true);
9725
+ }
9726
+ }
9727
+ } else {
9619
9728
  module.remove.activeItem();
9620
9729
  module.remove.selectedItem();
9621
- } else if (settings.useLabels) {
9622
- module.remove.selectedItem();
9623
9730
  }
9731
+ if (!$selectedItem) {
9732
+ return false;
9733
+ }
9734
+ module.debug('Setting selected menu item to', $selectedItem);
9624
9735
  // select each item
9625
9736
  $selectedItem
9626
9737
  .each(function () {
@@ -9920,6 +10031,12 @@
9920
10031
  $item.removeClass(className.active);
9921
10032
  },
9922
10033
  filteredItem: function () {
10034
+ if (settings.highlightMatches) {
10035
+ $.each($item, function (index, item) {
10036
+ var $markItem = $(item);
10037
+ $markItem.html($markItem.html().replace(/<\/?mark>/g, ''));
10038
+ });
10039
+ }
9923
10040
  if (settings.useLabels && module.has.maxSelections()) {
9924
10041
  return;
9925
10042
  }
@@ -10264,7 +10381,12 @@
10264
10381
  return $selectedMenu.hasClass(className.leftward);
10265
10382
  },
10266
10383
  clearable: function () {
10267
- return $module.hasClass(className.clearable) || settings.clearable;
10384
+ var hasClearableClass = $module.hasClass(className.clearable);
10385
+ if (!hasClearableClass && settings.clearable) {
10386
+ $module.addClass(className.clearable);
10387
+ }
10388
+
10389
+ return hasClearableClass || settings.clearable;
10268
10390
  },
10269
10391
  disabled: function () {
10270
10392
  return $module.hasClass(className.disabled);
@@ -10587,12 +10709,16 @@
10587
10709
  show: function () {
10588
10710
  module.verbose('Delaying show event to ensure user intent');
10589
10711
  clearTimeout(module.timer);
10590
- module.timer = setTimeout(function () { module.show(); }, settings.delay.show);
10712
+ module.timer = setTimeout(function () {
10713
+ module.show();
10714
+ }, settings.delay.show);
10591
10715
  },
10592
10716
  hide: function () {
10593
10717
  module.verbose('Delaying hide event to ensure user intent');
10594
10718
  clearTimeout(module.timer);
10595
- module.timer = setTimeout(function () { module.hide(); }, settings.delay.hide);
10719
+ module.timer = setTimeout(function () {
10720
+ module.hide();
10721
+ }, settings.delay.hide);
10596
10722
  },
10597
10723
  },
10598
10724
 
@@ -10625,6 +10751,7 @@
10625
10751
  return text.replace(regExp.escape, '\\$&');
10626
10752
  },
10627
10753
  htmlEntities: function (string, forceAmpersand) {
10754
+ forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
10628
10755
  var
10629
10756
  badChars = /["'<>`]/g,
10630
10757
  shouldEscape = /["&'<>`]/,
@@ -10641,8 +10768,7 @@
10641
10768
  ;
10642
10769
  if (shouldEscape.test(string)) {
10643
10770
  string = string.replace(forceAmpersand ? /&/g : /&(?![\d#a-z]{1,12};)/gi, '&amp;');
10644
-
10645
- return string.replace(badChars, escapedChar);
10771
+ string = string.replace(badChars, escapedChar);
10646
10772
  }
10647
10773
 
10648
10774
  return string;
@@ -10718,7 +10844,9 @@
10718
10844
  });
10719
10845
  }
10720
10846
  clearTimeout(module.performance.timer);
10721
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
10847
+ module.performance.timer = setTimeout(function () {
10848
+ module.performance.display();
10849
+ }, 500);
10722
10850
  },
10723
10851
  display: function () {
10724
10852
  var
@@ -10845,6 +10973,7 @@
10845
10973
 
10846
10974
  match: 'both', // what to match against with search selection (both, text, or label)
10847
10975
  fullTextSearch: 'exact', // search anywhere in value (set to 'exact' to require exact matches)
10976
+ highlightMatches: false, // Whether search result should highlight matching strings
10848
10977
  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
10978
  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
10979
 
@@ -10878,6 +11007,7 @@
10878
11007
  headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
10879
11008
 
10880
11009
  collapseOnActionable: true, // whether the dropdown should collapse upon selection of an actionable item
11010
+ collapseOnClearable: false, // whether the dropdown should collapse upon clicking the clearable icon
10881
11011
 
10882
11012
  // label settings on multi-select
10883
11013
  label: {
@@ -10960,9 +11090,11 @@
10960
11090
  descriptionVertical: 'descriptionVertical', // whether description should be vertical
10961
11091
  value: 'value', // actual dropdown value
10962
11092
  text: 'text', // displayed text when selected
11093
+ data: 'data', // custom data attributes
10963
11094
  type: 'type', // type of dropdown element
10964
11095
  image: 'image', // optional image path
10965
11096
  imageClass: 'imageClass', // optional individual class for image
11097
+ alt: 'alt', // optional alt text for image
10966
11098
  icon: 'icon', // optional icon name
10967
11099
  iconClass: 'iconClass', // optional individual class for icon (for example to use flag instead)
10968
11100
  class: 'class', // optional individual class for item/header
@@ -11069,8 +11201,7 @@
11069
11201
  ;
11070
11202
  if (shouldEscape.test(string)) {
11071
11203
  string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
11072
-
11073
- return string.replace(badChars, escapedChar);
11204
+ string = string.replace(badChars, escapedChar);
11074
11205
  }
11075
11206
 
11076
11207
  return string;
@@ -11105,9 +11236,21 @@
11105
11236
  $.each(values, function (index, option) {
11106
11237
  var
11107
11238
  itemType = option[fields.type] || 'item',
11108
- isMenu = itemType.indexOf('menu') !== -1
11239
+ isMenu = itemType.indexOf('menu') !== -1,
11240
+ maybeData = '',
11241
+ dataObject = option[fields.data]
11109
11242
  ;
11110
-
11243
+ if (dataObject) {
11244
+ var dataKey,
11245
+ dataKeyEscaped
11246
+ ;
11247
+ for (dataKey in dataObject) {
11248
+ dataKeyEscaped = String(dataKey).replace(/\W/g, '');
11249
+ if (Object.prototype.hasOwnProperty.call(dataObject, dataKey) && ['text', 'value'].indexOf(dataKeyEscaped.toLowerCase()) === -1) {
11250
+ maybeData += ' data-' + dataKeyEscaped + '="' + deQuote(String(dataObject[dataKey])) + '"';
11251
+ }
11252
+ }
11253
+ }
11111
11254
  if (itemType === 'item' || isMenu) {
11112
11255
  var
11113
11256
  maybeText = option[fields.text]
@@ -11124,12 +11267,12 @@
11124
11267
  : '',
11125
11268
  hasDescription = escape(option[fields.description] || '', preserveHTML) !== ''
11126
11269
  ;
11127
- html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + '>';
11270
+ html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + maybeData + '>';
11128
11271
  if (isMenu) {
11129
11272
  html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
11130
11273
  }
11131
11274
  if (option[fields.image]) {
11132
- html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + '">';
11275
+ html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + (option[fields.alt] ? '" alt="' + deQuote(option[fields.alt]) : '') + '">';
11133
11276
  }
11134
11277
  if (option[fields.icon]) {
11135
11278
  html += '<i class="' + deQuote(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
@@ -11197,7 +11340,7 @@
11197
11340
  })(jQuery, window, document);
11198
11341
 
11199
11342
  /*!
11200
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Embed
11343
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Embed
11201
11344
  * https://github.com/fomantic/Fomantic-UI/
11202
11345
  *
11203
11346
  *
@@ -11317,11 +11460,12 @@
11317
11460
 
11318
11461
  createPlaceholder: function (placeholder) {
11319
11462
  var
11320
- icon = module.get.icon()
11463
+ icon = module.get.icon(),
11464
+ alt = module.get.alt()
11321
11465
  ;
11322
11466
  placeholder = placeholder || module.get.placeholder();
11323
- $module.html(templates.placeholder(placeholder, icon));
11324
- module.debug('Creating placeholder for embed', placeholder, icon);
11467
+ $module.html(templates.placeholder(placeholder, icon, alt));
11468
+ module.debug('Creating placeholder for embed', placeholder, icon, alt);
11325
11469
  },
11326
11470
 
11327
11471
  createEmbed: function (url) {
@@ -11401,6 +11545,9 @@
11401
11545
  placeholder: function () {
11402
11546
  return settings.placeholder || $module.data(metadata.placeholder);
11403
11547
  },
11548
+ alt: function () {
11549
+ return settings.alt || $module.data(metadata.alt);
11550
+ },
11404
11551
  icon: function () {
11405
11552
  return settings.icon || ($module.data(metadata.icon) !== undefined
11406
11553
  ? $module.data(metadata.icon)
@@ -11486,6 +11633,7 @@
11486
11633
  .removeData(metadata.id)
11487
11634
  .removeData(metadata.icon)
11488
11635
  .removeData(metadata.placeholder)
11636
+ .removeData(metadata.alt)
11489
11637
  .removeData(metadata.source)
11490
11638
  .removeData(metadata.url)
11491
11639
  ;
@@ -11638,7 +11786,9 @@
11638
11786
  });
11639
11787
  }
11640
11788
  clearTimeout(module.performance.timer);
11641
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
11789
+ module.performance.timer = setTimeout(function () {
11790
+ module.performance.display();
11791
+ }, 500);
11642
11792
  },
11643
11793
  display: function () {
11644
11794
  var
@@ -11753,6 +11903,8 @@
11753
11903
  source: false,
11754
11904
  url: false,
11755
11905
  id: false,
11906
+ placeholder: false,
11907
+ alt: false,
11756
11908
 
11757
11909
  // standard video settings
11758
11910
  autoplay: 'auto',
@@ -11775,6 +11927,7 @@
11775
11927
  id: 'id',
11776
11928
  icon: 'icon',
11777
11929
  placeholder: 'placeholder',
11930
+ alt: 'alt',
11778
11931
  source: 'source',
11779
11932
  url: 'url',
11780
11933
  },
@@ -11850,7 +12003,7 @@
11850
12003
  + ' width="100%" height="100%"'
11851
12004
  + ' msallowFullScreen allowFullScreen></iframe>';
11852
12005
  },
11853
- placeholder: function (image, icon) {
12006
+ placeholder: function (image, icon, alt) {
11854
12007
  var
11855
12008
  html = '',
11856
12009
  deQuote = $.fn.embed.settings.templates.deQuote
@@ -11859,7 +12012,7 @@
11859
12012
  html += '<i class="' + deQuote(icon) + ' icon"></i>';
11860
12013
  }
11861
12014
  if (image) {
11862
- html += '<img class="placeholder" src="' + deQuote(image) + '">';
12015
+ html += '<img class="placeholder" src="' + deQuote(image) + (alt ? '" alt="' + deQuote(alt) : '') + '">';
11863
12016
  }
11864
12017
 
11865
12018
  return html;
@@ -11876,7 +12029,7 @@
11876
12029
  })(jQuery, window, document);
11877
12030
 
11878
12031
  /*!
11879
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Flyout
12032
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Flyout
11880
12033
  * https://github.com/fomantic/Fomantic-UI/
11881
12034
  *
11882
12035
  *
@@ -13096,7 +13249,9 @@
13096
13249
  });
13097
13250
  }
13098
13251
  clearTimeout(module.performance.timer);
13099
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
13252
+ module.performance.timer = setTimeout(function () {
13253
+ module.performance.display();
13254
+ }, 500);
13100
13255
  },
13101
13256
  display: function () {
13102
13257
  var
@@ -13426,7 +13581,7 @@
13426
13581
  })(jQuery, window, document);
13427
13582
 
13428
13583
  /*!
13429
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Modal
13584
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Modal
13430
13585
  * https://github.com/fomantic/Fomantic-UI/
13431
13586
  *
13432
13587
  *
@@ -13954,7 +14109,9 @@
13954
14109
  },
13955
14110
  debounce: function (method, delay) {
13956
14111
  clearTimeout(module.timer);
13957
- module.timer = setTimeout(function () { method(); }, delay);
14112
+ module.timer = setTimeout(function () {
14113
+ method();
14114
+ }, delay);
13958
14115
  },
13959
14116
  keyboard: function (event) {
13960
14117
  var
@@ -14700,7 +14857,9 @@
14700
14857
  });
14701
14858
  }
14702
14859
  clearTimeout(module.performance.timer);
14703
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
14860
+ module.performance.timer = setTimeout(function () {
14861
+ module.performance.display();
14862
+ }, 500);
14704
14863
  },
14705
14864
  display: function () {
14706
14865
  var
@@ -15060,7 +15219,7 @@
15060
15219
  })(jQuery, window, document);
15061
15220
 
15062
15221
  /*!
15063
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Nag
15222
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Nag
15064
15223
  * https://github.com/fomantic/Fomantic-UI/
15065
15224
  *
15066
15225
  *
@@ -15149,7 +15308,9 @@
15149
15308
  }
15150
15309
 
15151
15310
  if (settings.displayTime > 0) {
15152
- setTimeout(function () { module.hide(); }, settings.displayTime);
15311
+ setTimeout(function () {
15312
+ module.hide();
15313
+ }, settings.displayTime);
15153
15314
  }
15154
15315
  module.show();
15155
15316
  },
@@ -15205,8 +15366,10 @@
15205
15366
  module.debug('Dismissing nag', settings.storageMethod, settings.key, settings.value, settings.expires);
15206
15367
  module.storage.set(settings.key, settings.value);
15207
15368
  }
15208
- event.stopImmediatePropagation();
15209
- event.preventDefault();
15369
+ if (event) {
15370
+ event.stopImmediatePropagation();
15371
+ event.preventDefault();
15372
+ }
15210
15373
  },
15211
15374
 
15212
15375
  should: {
@@ -15438,7 +15601,9 @@
15438
15601
  });
15439
15602
  }
15440
15603
  clearTimeout(module.performance.timer);
15441
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
15604
+ module.performance.timer = setTimeout(function () {
15605
+ module.performance.display();
15606
+ }, 500);
15442
15607
  },
15443
15608
  display: function () {
15444
15609
  var
@@ -15621,7 +15786,7 @@
15621
15786
  })(jQuery, window, document);
15622
15787
 
15623
15788
  /*!
15624
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Popup
15789
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Popup
15625
15790
  * https://github.com/fomantic/Fomantic-UI/
15626
15791
  *
15627
15792
  *
@@ -15816,7 +15981,9 @@
15816
15981
  ;
15817
15982
  clearTimeout(module.hideTimer);
15818
15983
  if (!openedWithTouch || (openedWithTouch && settings.addTouchEvents)) {
15819
- module.showTimer = setTimeout(function () { module.show(); }, delay);
15984
+ module.showTimer = setTimeout(function () {
15985
+ module.show();
15986
+ }, delay);
15820
15987
  }
15821
15988
  },
15822
15989
  end: function () {
@@ -15826,7 +15993,9 @@
15826
15993
  : settings.delay
15827
15994
  ;
15828
15995
  clearTimeout(module.showTimer);
15829
- module.hideTimer = setTimeout(function () { module.hide(); }, delay);
15996
+ module.hideTimer = setTimeout(function () {
15997
+ module.hide();
15998
+ }, delay);
15830
15999
  },
15831
16000
  touchstart: function (event) {
15832
16001
  openedWithTouch = true;
@@ -16866,7 +17035,9 @@
16866
17035
  });
16867
17036
  }
16868
17037
  clearTimeout(module.performance.timer);
16869
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
17038
+ module.performance.timer = setTimeout(function () {
17039
+ module.performance.display();
17040
+ }, 500);
16870
17041
  },
16871
17042
  display: function () {
16872
17043
  var
@@ -17177,7 +17348,7 @@
17177
17348
  })(jQuery, window, document);
17178
17349
 
17179
17350
  /*!
17180
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Progress
17351
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Progress
17181
17352
  * https://github.com/fomantic/Fomantic-UI/
17182
17353
  *
17183
17354
  *
@@ -17969,7 +18140,9 @@
17969
18140
  });
17970
18141
  }
17971
18142
  clearTimeout(module.performance.timer);
17972
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
18143
+ module.performance.timer = setTimeout(function () {
18144
+ module.performance.display();
18145
+ }, 500);
17973
18146
  },
17974
18147
  display: function () {
17975
18148
  var
@@ -18155,7 +18328,7 @@
18155
18328
  })(jQuery, window, document);
18156
18329
 
18157
18330
  /*!
18158
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Slider
18331
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Slider
18159
18332
  * https://github.com/fomantic/Fomantic-UI/
18160
18333
  *
18161
18334
  *
@@ -18188,8 +18361,6 @@
18188
18361
  methodInvoked = typeof query === 'string',
18189
18362
  queryArguments = [].slice.call(arguments, 1),
18190
18363
 
18191
- alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
18192
-
18193
18364
  SINGLE_STEP = 1,
18194
18365
  BIG_STEP = 2,
18195
18366
  NO_STEP = 0,
@@ -18238,7 +18409,6 @@
18238
18409
  position,
18239
18410
  secondPos,
18240
18411
  offset,
18241
- precision,
18242
18412
  gapRatio = 1,
18243
18413
  previousValue,
18244
18414
 
@@ -18281,6 +18451,7 @@
18281
18451
  clearInterval(instance.interval);
18282
18452
  module.unbind.events();
18283
18453
  module.unbind.slidingEvents();
18454
+ delete module.cache;
18284
18455
  $module.removeData(moduleNamespace);
18285
18456
  instance = undefined;
18286
18457
  },
@@ -18297,7 +18468,7 @@
18297
18468
  + '<div class="thumb"></div>'
18298
18469
  + '</div>');
18299
18470
  }
18300
- precision = module.get.precision();
18471
+ module.clear.cache();
18301
18472
  $thumb = $module.find('.thumb:not(.second)');
18302
18473
  if (settings.showThumbTooltip) {
18303
18474
  $thumb
@@ -18331,8 +18502,14 @@
18331
18502
  module.setup.autoLabel();
18332
18503
  }
18333
18504
 
18505
+ if (settings.highlightRange) {
18506
+ $labels.addClass(className.active);
18507
+ }
18508
+
18334
18509
  if (settings.showLabelTicks) {
18335
18510
  $module.addClass(className.ticked);
18511
+ } else if ($module.hasClass(className.ticked)) {
18512
+ settings.showLabelTicks = 'always';
18336
18513
  }
18337
18514
  }
18338
18515
  },
@@ -18367,14 +18544,20 @@
18367
18544
  } else {
18368
18545
  $labels = $module.append('<ul class="auto labels"></ul>').find('.labels');
18369
18546
  }
18370
- for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
18547
+ var step = module.get.step(),
18548
+ precision = module.get.precision(),
18549
+ len = module.get.numLabels(),
18550
+ ignoreLabels = len - (settings.autoAdjustLabels !== 'fixed' ? 0 : module.get.max().toString().length + 4)
18551
+ ;
18552
+ for (var i = 0; i <= len; i++) {
18371
18553
  var
18372
- labelText = module.get.label(i),
18554
+ stepValue = Math.round(((i * (step === 0 ? 1 : step)) + module.get.min()) * precision) / precision,
18555
+ labelText = module.get.label(i, stepValue),
18373
18556
  showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.indexOf(labelText) >= 0,
18374
18557
  $label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
18375
- ? (!(i % module.get.gapRatio())
18376
- ? $('<li class="label">' + (showLabel ? labelText : '') + '</li>')
18377
- : $('<li class="halftick label"></li>'))
18558
+ ? ((!(i % module.get.gapRatio()) && i < ignoreLabels) || i === len
18559
+ ? $('<li/>', { class: className.label, 'data-value': stepValue, html: showLabel ? labelText : '' })
18560
+ : $('<li/>', { class: 'halftick label', 'data-value': stepValue }))
18378
18561
  : null,
18379
18562
  ratio = i / len
18380
18563
  ;
@@ -18645,6 +18828,12 @@
18645
18828
  },
18646
18829
  },
18647
18830
 
18831
+ clear: {
18832
+ cache: function () {
18833
+ module.cache = {};
18834
+ },
18835
+ },
18836
+
18648
18837
  resync: function () {
18649
18838
  module.verbose('Resyncing thumb position based on value');
18650
18839
  if (module.is.range()) {
@@ -18694,6 +18883,25 @@
18694
18883
  },
18695
18884
 
18696
18885
  is: {
18886
+ prime: function (n) {
18887
+ if (module.cache['prime' + n] === undefined) {
18888
+ var p = true;
18889
+ for (var i = 2, s = Math.sqrt(n); i <= s; i++) {
18890
+ if (n % i === 0) {
18891
+ p = false;
18892
+
18893
+ break;
18894
+ }
18895
+ }
18896
+ if (p) {
18897
+ p = n > 1;
18898
+ }
18899
+
18900
+ module.cache['prime' + n] = p;
18901
+ }
18902
+
18903
+ return module.cache['prime' + n];
18904
+ },
18697
18905
  range: function () {
18698
18906
  var isRange = $module.hasClass(className.range);
18699
18907
  if (!isRange && (settings.minRange || settings.maxRange)) {
@@ -18808,62 +19016,87 @@
18808
19016
  return margin || '0px';
18809
19017
  },
18810
19018
  precision: function () {
18811
- var
18812
- decimalPlaces,
18813
- step = module.get.step()
18814
- ;
18815
- if (step !== 0) {
18816
- var split = String(step).split('.');
18817
- decimalPlaces = split.length === 2 ? split[1].length : 0;
18818
- } else {
18819
- decimalPlaces = settings.decimalPlaces;
19019
+ if (module.cache.precision === undefined) {
19020
+ var
19021
+ decimalPlaces,
19022
+ step = module.get.step()
19023
+ ;
19024
+ if (step !== 0) {
19025
+ var split = String(step).split('.');
19026
+ decimalPlaces = split.length === 2 ? split[1].length : 0;
19027
+ } else {
19028
+ decimalPlaces = settings.decimalPlaces;
19029
+ }
19030
+ var precision = Math.pow(10, decimalPlaces);
19031
+ module.debug('Precision determined', precision);
19032
+ module.cache.precision = precision;
18820
19033
  }
18821
- var precision = Math.pow(10, decimalPlaces);
18822
- module.debug('Precision determined', precision);
18823
19034
 
18824
- return precision;
19035
+ return module.cache.precision;
18825
19036
  },
18826
19037
  min: function () {
18827
19038
  return settings.min;
18828
19039
  },
18829
19040
  max: function () {
18830
- var
18831
- step = module.get.step(),
18832
- min = module.get.min(),
18833
- precision = module.get.precision(),
18834
- quotient = step === 0 ? 0 : Math.floor(Math.round(((settings.max - min) / step) * precision) / precision),
18835
- remainder = step === 0 ? 0 : (settings.max - min) % step
18836
- ;
19041
+ if (module.cache.max === undefined) {
19042
+ var
19043
+ step = module.get.step(),
19044
+ min = module.get.min(),
19045
+ precision = module.get.precision(),
19046
+ quotient = step === 0 ? 0 : Math.floor(Math.round(((settings.max - min) / step) * precision) / precision),
19047
+ remainder = step === 0 ? 0 : (settings.max - min) % step
19048
+ ;
19049
+ if (remainder > 0) {
19050
+ module.debug('Max value not divisible by given step. Increasing max value.', settings.max, step);
19051
+ }
19052
+ module.cache.max = remainder === 0 ? settings.max : min + quotient * step;
19053
+ }
18837
19054
 
18838
- return remainder === 0 ? settings.max : min + quotient * step;
19055
+ return module.cache.max;
18839
19056
  },
18840
19057
  step: function () {
18841
19058
  return settings.step;
18842
19059
  },
18843
19060
  numLabels: function () {
18844
- var step = module.get.step(),
18845
- precision = module.get.precision(),
18846
- value = Math.round(((module.get.max() - module.get.min()) / (step === 0 ? 1 : step)) * precision) / precision;
18847
- module.debug('Determined that there should be ' + value + ' labels');
19061
+ if (module.cache.numLabels === undefined) {
19062
+ var step = module.get.step(),
19063
+ precision = module.get.precision(),
19064
+ value = Math.round(((module.get.max() - module.get.min()) / (step === 0 ? 1 : step)) * precision) / precision;
19065
+ module.debug('Determined that there should be ' + value + ' labels');
19066
+ module.cache.numLabels = value;
19067
+ }
18848
19068
 
18849
- return value;
19069
+ return module.cache.numLabels;
18850
19070
  },
18851
19071
  labelType: function () {
18852
19072
  return settings.labelType;
18853
19073
  },
18854
- label: function (value) {
18855
- if (interpretLabel) {
18856
- return interpretLabel(value);
19074
+ label: function (value, stepValue) {
19075
+ if (isFunction(interpretLabel)) {
19076
+ return interpretLabel(value, stepValue, module);
18857
19077
  }
18858
19078
 
18859
19079
  switch (settings.labelType) {
18860
19080
  case settings.labelTypes.number: {
18861
- var step = module.get.step();
18862
-
18863
- return Math.round(((value * (step === 0 ? 1 : step)) + module.get.min()) * precision) / precision;
19081
+ return stepValue;
18864
19082
  }
18865
19083
  case settings.labelTypes.letter: {
18866
- return alphabet[value % 26];
19084
+ if (value < 0 || module.get.precision() > 1) {
19085
+ module.error(error.invalidLetterNumber, value);
19086
+
19087
+ return value;
19088
+ }
19089
+ var letterLabel = '',
19090
+ letters = Array.isArray(settings.letters) ? settings.letters : String(settings.letters).split(''),
19091
+ lettersLen = letters.length
19092
+ ;
19093
+
19094
+ while (stepValue >= 0) {
19095
+ letterLabel = letters[stepValue % lettersLen] + letterLabel;
19096
+ stepValue = Math.floor(stepValue / lettersLen) - 1;
19097
+ }
19098
+
19099
+ return letterLabel;
18867
19100
  }
18868
19101
  default: {
18869
19102
  return value;
@@ -18873,6 +19106,9 @@
18873
19106
  value: function () {
18874
19107
  return value;
18875
19108
  },
19109
+ settings: function () {
19110
+ return settings;
19111
+ },
18876
19112
  currentThumbValue: function () {
18877
19113
  return $currThumb !== undefined && $currThumb.hasClass('second') ? module.secondThumbVal : module.thumbVal;
18878
19114
  },
@@ -18917,6 +19153,7 @@
18917
19153
  if (settings.autoAdjustLabels) {
18918
19154
  var
18919
19155
  numLabels = module.get.numLabels(),
19156
+ primePlus = module.is.prime(numLabels) ? 1 : 0,
18920
19157
  trackLength = module.get.trackLength(),
18921
19158
  gapCounter = 1
18922
19159
  ;
@@ -18926,7 +19163,7 @@
18926
19163
  // and apply only if the modulo of the operation is an odd number.
18927
19164
  if (trackLength > 0) {
18928
19165
  while ((trackLength / numLabels) * gapCounter < settings.labelDistance) {
18929
- if (!(numLabels % gapCounter)) {
19166
+ if (!((numLabels + primePlus) % gapCounter) || settings.autoAdjustLabels === 'fixed') {
18930
19167
  gapRatio = gapCounter;
18931
19168
  }
18932
19169
  gapCounter += 1;
@@ -19064,6 +19301,7 @@
19064
19301
  },
19065
19302
  value: function (position) {
19066
19303
  var
19304
+ precision = module.get.precision(),
19067
19305
  startPos = module.is.reversed() ? module.get.trackEndPos() : module.get.trackStartPos(),
19068
19306
  endPos = module.is.reversed() ? module.get.trackStartPos() : module.get.trackEndPos(),
19069
19307
  ratio = (position - startPos) / (endPos - startPos),
@@ -19132,6 +19370,30 @@
19132
19370
  },
19133
19371
 
19134
19372
  set: {
19373
+ active: function (thumbVal, secondThumbVal) {
19374
+ if (settings.highlightRange) {
19375
+ if (secondThumbVal < thumbVal) {
19376
+ var tempVal = secondThumbVal;
19377
+ secondThumbVal = thumbVal;
19378
+ thumbVal = tempVal;
19379
+ }
19380
+ var $children = $labels.find('.label');
19381
+ $children.each(function (index) {
19382
+ var
19383
+ $child = $(this),
19384
+ attrValue = $child.attr('data-value')
19385
+ ;
19386
+ if (attrValue) {
19387
+ attrValue = parseInt(attrValue, 10);
19388
+ if (attrValue >= thumbVal && attrValue <= secondThumbVal) {
19389
+ $child.addClass(className.active);
19390
+ } else {
19391
+ $child.removeClass(className.active);
19392
+ }
19393
+ }
19394
+ });
19395
+ }
19396
+ },
19135
19397
  value: function (newValue, fireChange) {
19136
19398
  fireChange = fireChange !== false;
19137
19399
  var toReset = previousValue === undefined;
@@ -19259,6 +19521,7 @@
19259
19521
  position = newPos;
19260
19522
  thumbVal = newValue;
19261
19523
  }
19524
+ module.set.active(thumbVal, secondThumbVal);
19262
19525
  var
19263
19526
  trackPosValue,
19264
19527
  thumbPosValue,
@@ -19366,6 +19629,7 @@
19366
19629
  } else {
19367
19630
  return settings[name];
19368
19631
  }
19632
+ module.clear.cache();
19369
19633
  },
19370
19634
  internal: function (name, value) {
19371
19635
  if ($.isPlainObject(name)) {
@@ -19423,7 +19687,9 @@
19423
19687
  });
19424
19688
  }
19425
19689
  clearTimeout(module.performance.timer);
19426
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
19690
+ module.performance.timer = setTimeout(function () {
19691
+ module.performance.display();
19692
+ }, 500);
19427
19693
  },
19428
19694
  display: function () {
19429
19695
  var
@@ -19536,6 +19802,7 @@
19536
19802
  method: 'The method you called is not defined.',
19537
19803
  notrange: 'This slider is not a range slider',
19538
19804
  invalidRanges: 'Invalid range settings (start/end/minRange/maxRange)',
19805
+ invalidLetterNumber: 'Negative values or decimal places for labelType: "letter" are not supported',
19539
19806
  },
19540
19807
 
19541
19808
  metadata: {
@@ -19558,6 +19825,7 @@
19558
19825
  preventCrossover: true,
19559
19826
  fireOnInit: false,
19560
19827
  interpretLabel: false,
19828
+ letters: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
19561
19829
 
19562
19830
  // the decimal place to round to if step is undefined
19563
19831
  decimalPlaces: 2,
@@ -19575,6 +19843,8 @@
19575
19843
  vertical: 'vertical',
19576
19844
  range: 'range',
19577
19845
  smooth: 'smooth',
19846
+ label: 'label',
19847
+ active: 'active',
19578
19848
  },
19579
19849
 
19580
19850
  keys: {
@@ -19587,6 +19857,7 @@
19587
19857
  },
19588
19858
 
19589
19859
  restrictedLabels: [],
19860
+ highlightRange: false,
19590
19861
  showThumbTooltip: false,
19591
19862
  tooltipConfig: {
19592
19863
  position: 'top center',
@@ -19604,7 +19875,7 @@
19604
19875
  })(jQuery, window, document);
19605
19876
 
19606
19877
  /*!
19607
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Rating
19878
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Rating
19608
19879
  * https://github.com/fomantic/Fomantic-UI/
19609
19880
  *
19610
19881
  *
@@ -19973,7 +20244,9 @@
19973
20244
  });
19974
20245
  }
19975
20246
  clearTimeout(module.performance.timer);
19976
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
20247
+ module.performance.timer = setTimeout(function () {
20248
+ module.performance.display();
20249
+ }, 500);
19977
20250
  },
19978
20251
  display: function () {
19979
20252
  var
@@ -20143,7 +20416,7 @@
20143
20416
  })(jQuery, window, document);
20144
20417
 
20145
20418
  /*!
20146
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Search
20419
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Search
20147
20420
  * https://github.com/fomantic/Fomantic-UI/
20148
20421
  *
20149
20422
  *
@@ -20279,7 +20552,10 @@
20279
20552
  // this makes sure $.extend does not add specified search fields to default fields
20280
20553
  // this is the only setting which should not extend defaults
20281
20554
  if (parameters && parameters.searchFields !== undefined) {
20282
- settings.searchFields = parameters.searchFields;
20555
+ settings.searchFields = Array.isArray(parameters.searchFields)
20556
+ ? parameters.searchFields
20557
+ : [parameters.searchFields]
20558
+ ;
20283
20559
  }
20284
20560
  },
20285
20561
  },
@@ -20313,7 +20589,9 @@
20313
20589
  callback = function () {
20314
20590
  module.cancel.query();
20315
20591
  module.remove.focus();
20316
- module.timer = setTimeout(function () { module.hideResults(); }, settings.hideDelay);
20592
+ module.timer = setTimeout(function () {
20593
+ module.hideResults();
20594
+ }, settings.hideDelay);
20317
20595
  }
20318
20596
  ;
20319
20597
  if (pageLostFocus) {
@@ -20773,7 +21051,7 @@
20773
21051
  exactResults = [],
20774
21052
  fuzzyResults = [],
20775
21053
  searchExp = searchTerm.replace(regExp.escape, '\\$&'),
20776
- matchRegExp = new RegExp(regExp.beginsWith + searchExp, 'i'),
21054
+ matchRegExp = new RegExp(regExp.beginsWith + searchExp, settings.ignoreSearchCase ? 'i' : ''),
20777
21055
 
20778
21056
  // avoid duplicates when pushing results
20779
21057
  addResult = function (array, result) {
@@ -20809,13 +21087,14 @@
20809
21087
  var concatenatedContent = [];
20810
21088
  $.each(searchFields, function (index, field) {
20811
21089
  var
20812
- fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number')
21090
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
20813
21091
  ;
20814
21092
  if (fieldExists) {
20815
21093
  var text;
20816
21094
  text = typeof content[field] === 'string'
20817
21095
  ? module.remove.diacritics(content[field])
20818
21096
  : content[field].toString();
21097
+ text = $('<div/>', { html: text }).text().trim();
20819
21098
  if (settings.fullTextSearch === 'all') {
20820
21099
  concatenatedContent.push(text);
20821
21100
  if (index < lastSearchFieldIndex) {
@@ -20846,8 +21125,10 @@
20846
21125
  },
20847
21126
  },
20848
21127
  exactSearch: function (query, term) {
20849
- query = query.toLowerCase();
20850
- term = term.toLowerCase();
21128
+ if (settings.ignoreSearchCase) {
21129
+ query = query.toLowerCase();
21130
+ term = term.toLowerCase();
21131
+ }
20851
21132
 
20852
21133
  return term.indexOf(query) > -1;
20853
21134
  },
@@ -20874,8 +21155,10 @@
20874
21155
  if (typeof query !== 'string') {
20875
21156
  return false;
20876
21157
  }
20877
- query = query.toLowerCase();
20878
- term = term.toLowerCase();
21158
+ if (settings.ignoreSearchCase) {
21159
+ query = query.toLowerCase();
21160
+ term = term.toLowerCase();
21161
+ }
20879
21162
  if (queryLength > termLength) {
20880
21163
  return false;
20881
21164
  }
@@ -21230,6 +21513,39 @@
21230
21513
  response[fields.results] = response[fields.results].slice(0, settings.maxResults);
21231
21514
  }
21232
21515
  }
21516
+ if (settings.highlightMatches) {
21517
+ var results = response[fields.results],
21518
+ regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
21519
+ querySplit = module.get.value().split(''),
21520
+ diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
21521
+ htmlReg = '(?![^<]*>)',
21522
+ markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
21523
+ markedReplacer = function () {
21524
+ var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
21525
+ return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
21526
+ });
21527
+
21528
+ return args.join('');
21529
+ }
21530
+ ;
21531
+ $.each(results, function (label, content) {
21532
+ $.each(settings.searchFields, function (index, field) {
21533
+ var
21534
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
21535
+ ;
21536
+ if (fieldExists) {
21537
+ var markedHTML = typeof content[field] === 'string'
21538
+ ? content[field]
21539
+ : content[field].toString();
21540
+ if (settings.ignoreDiacritics) {
21541
+ markedHTML = markedHTML.normalize('NFD');
21542
+ }
21543
+ markedHTML = markedHTML.replace(/<\/?mark>/g, '');
21544
+ response[fields.results][label][field] = markedHTML.replace(markedRegExp, markedReplacer);
21545
+ }
21546
+ });
21547
+ });
21548
+ }
21233
21549
  if (isFunction(template)) {
21234
21550
  html = template(response, fields, settings.preserveHTML);
21235
21551
  } else {
@@ -21315,7 +21631,9 @@
21315
21631
  });
21316
21632
  }
21317
21633
  clearTimeout(module.performance.timer);
21318
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
21634
+ module.performance.timer = setTimeout(function () {
21635
+ module.performance.display();
21636
+ }, 500);
21319
21637
  },
21320
21638
  display: function () {
21321
21639
  var
@@ -21456,9 +21774,15 @@
21456
21774
  // search anywhere in value (set to 'exact' to require exact matches
21457
21775
  fullTextSearch: 'exact',
21458
21776
 
21777
+ // Whether search result should highlight matching strings
21778
+ highlightMatches: false,
21779
+
21459
21780
  // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
21460
21781
  ignoreDiacritics: false,
21461
21782
 
21783
+ // whether to consider case sensitivity on local searching
21784
+ ignoreSearchCase: true,
21785
+
21462
21786
  // whether to add events to prompt automatically
21463
21787
  automatic: true,
21464
21788
 
@@ -21537,6 +21861,7 @@
21537
21861
  categoryResults: 'results', // array of results (category view)
21538
21862
  description: 'description', // result description
21539
21863
  image: 'image', // result image
21864
+ alt: 'alt', // result alt text for image
21540
21865
  price: 'price', // result price
21541
21866
  results: 'results', // array of results (standard)
21542
21867
  title: 'title', // result title
@@ -21576,8 +21901,9 @@
21576
21901
  };
21577
21902
  if (shouldEscape.test(string)) {
21578
21903
  string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
21579
-
21580
- return string.replace(badChars, escapedChar);
21904
+ string = string.replace(badChars, escapedChar);
21905
+ // FUI controlled HTML is still allowed
21906
+ string = string.replace(/&lt;(\/)*mark&gt;/g, '<$1mark>');
21581
21907
  }
21582
21908
 
21583
21909
  return string;
@@ -21623,7 +21949,7 @@
21623
21949
  if (result[fields.image] !== undefined) {
21624
21950
  html += ''
21625
21951
  + '<div class="image">'
21626
- + ' <img src="' + result[fields.image].replace(/"/g, '') + '">'
21952
+ + ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '" alt="' + result[fields.alt].replace(/"/g, '') : '') + '">'
21627
21953
  + '</div>';
21628
21954
  }
21629
21955
  html += '<div class="content">';
@@ -21676,7 +22002,7 @@
21676
22002
  if (result[fields.image] !== undefined) {
21677
22003
  html += ''
21678
22004
  + '<div class="image">'
21679
- + ' <img src="' + result[fields.image].replace(/"/g, '') + '">'
22005
+ + ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '" alt="' + result[fields.alt].replace(/"/g, '') : '') + '">'
21680
22006
  + '</div>';
21681
22007
  }
21682
22008
  html += '<div class="content">';
@@ -21721,7 +22047,7 @@
21721
22047
  })(jQuery, window, document);
21722
22048
 
21723
22049
  /*!
21724
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Shape
22050
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Shape
21725
22051
  * https://github.com/fomantic/Fomantic-UI/
21726
22052
  *
21727
22053
  *
@@ -21907,7 +22233,7 @@
21907
22233
  set: {
21908
22234
 
21909
22235
  defaultSide: function () {
21910
- $activeSide = $side.filter('.' + settings.className.active);
22236
+ $activeSide = $side.filter('.' + className.active);
21911
22237
  $nextSide = $activeSide.next(selector.side).length > 0
21912
22238
  ? $activeSide.next(selector.side)
21913
22239
  : $side.first();
@@ -21933,7 +22259,7 @@
21933
22259
 
21934
22260
  currentStageSize: function () {
21935
22261
  var
21936
- $activeSide = $side.filter('.' + settings.className.active),
22262
+ $activeSide = $side.filter('.' + className.active),
21937
22263
  width = $activeSide.outerWidth(true),
21938
22264
  height = $activeSide.outerHeight(true)
21939
22265
  ;
@@ -21949,7 +22275,7 @@
21949
22275
  var
21950
22276
  $clone = $module.clone().addClass(className.loading),
21951
22277
  $side = $clone.find('>' + selector.sides + '>' + selector.side),
21952
- $activeSide = $side.filter('.' + settings.className.active),
22278
+ $activeSide = $side.filter('.' + className.active),
21953
22279
  $nextSide = nextIndex
21954
22280
  ? $side.eq(nextIndex)
21955
22281
  : ($activeSide.next(selector.side).length > 0
@@ -22345,7 +22671,9 @@
22345
22671
  });
22346
22672
  }
22347
22673
  clearTimeout(module.performance.timer);
22348
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
22674
+ module.performance.timer = setTimeout(function () {
22675
+ module.performance.display();
22676
+ }, 500);
22349
22677
  },
22350
22678
  display: function () {
22351
22679
  var
@@ -22517,7 +22845,7 @@
22517
22845
  })(jQuery, window, document);
22518
22846
 
22519
22847
  /*!
22520
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Sidebar
22848
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Sidebar
22521
22849
  * https://github.com/fomantic/Fomantic-UI/
22522
22850
  *
22523
22851
  *
@@ -23389,7 +23717,9 @@
23389
23717
  });
23390
23718
  }
23391
23719
  clearTimeout(module.performance.timer);
23392
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
23720
+ module.performance.timer = setTimeout(function () {
23721
+ module.performance.display();
23722
+ }, 500);
23393
23723
  },
23394
23724
  display: function () {
23395
23725
  var
@@ -23570,7 +23900,7 @@
23570
23900
  })(jQuery, window, document);
23571
23901
 
23572
23902
  /*!
23573
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Sticky
23903
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Sticky
23574
23904
  * https://github.com/fomantic/Fomantic-UI/
23575
23905
  *
23576
23906
  *
@@ -24317,7 +24647,9 @@
24317
24647
  });
24318
24648
  }
24319
24649
  clearTimeout(module.performance.timer);
24320
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 0);
24650
+ module.performance.timer = setTimeout(function () {
24651
+ module.performance.display();
24652
+ }, 0);
24321
24653
  },
24322
24654
  display: function () {
24323
24655
  var
@@ -24486,7 +24818,7 @@
24486
24818
  })(jQuery, window, document);
24487
24819
 
24488
24820
  /*!
24489
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Tab
24821
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Tab
24490
24822
  * https://github.com/fomantic/Fomantic-UI/
24491
24823
  *
24492
24824
  *
@@ -25275,7 +25607,9 @@
25275
25607
  });
25276
25608
  }
25277
25609
  clearTimeout(module.performance.timer);
25278
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
25610
+ module.performance.timer = setTimeout(function () {
25611
+ module.performance.display();
25612
+ }, 500);
25279
25613
  },
25280
25614
  display: function () {
25281
25615
  var
@@ -25452,7 +25786,7 @@
25452
25786
  })(jQuery, window, document);
25453
25787
 
25454
25788
  /*!
25455
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Toast
25789
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Toast
25456
25790
  * https://github.com/fomantic/Fomantic-UI/
25457
25791
  *
25458
25792
  *
@@ -25636,6 +25970,7 @@
25636
25970
  $toast.append($('<img>', {
25637
25971
  class: className.image + ' ' + settings.classImage,
25638
25972
  src: settings.showImage,
25973
+ alt: settings.alt || '',
25639
25974
  }));
25640
25975
  }
25641
25976
  if (settings.title !== '') {
@@ -25681,7 +26016,7 @@
25681
26016
  $toast.find(selector.icon).attr('class', iconClass + ' ' + className.icon);
25682
26017
  }
25683
26018
  if (settings.showImage) {
25684
- $toast.find(selector.image).attr('src', settings.showImage);
26019
+ $toast.find(selector.image).attr('src', settings.showImage).attr('alt', settings.alt || '');
25685
26020
  }
25686
26021
  if (settings.title !== '') {
25687
26022
  $toast.find(selector.title).html(module.helpers.escape(settings.title, settings.preserveHTML));
@@ -26155,7 +26490,9 @@
26155
26490
  });
26156
26491
  }
26157
26492
  clearTimeout(module.performance.timer);
26158
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
26493
+ module.performance.timer = setTimeout(function () {
26494
+ module.performance.display();
26495
+ }, 500);
26159
26496
  },
26160
26497
  display: function () {
26161
26498
  var
@@ -26292,6 +26629,7 @@
26292
26629
  actions: false,
26293
26630
  preserveHTML: true,
26294
26631
  showImage: false,
26632
+ alt: false,
26295
26633
 
26296
26634
  // transition settings
26297
26635
  transition: {
@@ -26413,7 +26751,7 @@
26413
26751
  })(jQuery, window, document);
26414
26752
 
26415
26753
  /*!
26416
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Transition
26754
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Transition
26417
26755
  * https://github.com/fomantic/Fomantic-UI/
26418
26756
  *
26419
26757
  *
@@ -26556,7 +26894,9 @@
26556
26894
  ? ($allModules.length - index) * interval
26557
26895
  : index * interval;
26558
26896
  module.debug('Delaying animation by', delay);
26559
- setTimeout(function () { module.animate(); }, delay);
26897
+ setTimeout(function () {
26898
+ module.animate();
26899
+ }, delay);
26560
26900
  },
26561
26901
 
26562
26902
  animate: function (overrideSettings) {
@@ -27263,7 +27603,9 @@
27263
27603
  });
27264
27604
  }
27265
27605
  clearTimeout(module.performance.timer);
27266
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
27606
+ module.performance.timer = setTimeout(function () {
27607
+ module.performance.display();
27608
+ }, 500);
27267
27609
  },
27268
27610
  display: function () {
27269
27611
  var
@@ -27444,7 +27786,7 @@
27444
27786
  })(jQuery, window, document);
27445
27787
 
27446
27788
  /*!
27447
- * # Fomantic-UI 2.9.4-beta.9+128b459 - API
27789
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - API
27448
27790
  * https://github.com/fomantic/Fomantic-UI/
27449
27791
  *
27450
27792
  *
@@ -28092,7 +28434,9 @@
28092
28434
  module.debug('Adding error state');
28093
28435
  module.set.error();
28094
28436
  if (module.should.removeError()) {
28095
- setTimeout(function () { module.remove.error(); }, settings.errorDuration);
28437
+ setTimeout(function () {
28438
+ module.remove.error();
28439
+ }, settings.errorDuration);
28096
28440
  }
28097
28441
  }
28098
28442
  module.debug('API Request failed', errorMessage, xhr);
@@ -28416,7 +28760,9 @@
28416
28760
  });
28417
28761
  }
28418
28762
  clearTimeout(module.performance.timer);
28419
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
28763
+ module.performance.timer = setTimeout(function () {
28764
+ module.performance.display();
28765
+ }, 500);
28420
28766
  },
28421
28767
  display: function () {
28422
28768
  var
@@ -28666,7 +29012,7 @@
28666
29012
  })(jQuery, window, document);
28667
29013
 
28668
29014
  /*!
28669
- * # Fomantic-UI 2.9.4-beta.9+128b459 - State
29015
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - State
28670
29016
  * https://github.com/fomantic/Fomantic-UI/
28671
29017
  *
28672
29018
  *
@@ -29149,7 +29495,9 @@
29149
29495
  });
29150
29496
  }
29151
29497
  clearTimeout(module.performance.timer);
29152
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
29498
+ module.performance.timer = setTimeout(function () {
29499
+ module.performance.display();
29500
+ }, 500);
29153
29501
  },
29154
29502
  display: function () {
29155
29503
  var
@@ -29362,7 +29710,7 @@
29362
29710
  })(jQuery, window, document);
29363
29711
 
29364
29712
  /*!
29365
- * # Fomantic-UI 2.9.4-beta.9+128b459 - Visibility
29713
+ * # Fomantic-UI 2.9.4-beta.91+83986c3 - Visibility
29366
29714
  * https://github.com/fomantic/Fomantic-UI/
29367
29715
  *
29368
29716
  *
@@ -30451,7 +30799,9 @@
30451
30799
  });
30452
30800
  }
30453
30801
  clearTimeout(module.performance.timer);
30454
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
30802
+ module.performance.timer = setTimeout(function () {
30803
+ module.performance.display();
30804
+ }, 500);
30455
30805
  },
30456
30806
  display: function () {
30457
30807
  var