fomantic-ui 2.9.4-beta.1 → 2.9.4-beta.100

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 (296) hide show
  1. package/.all-contributorsrc +29 -1
  2. package/.eslintrc.js +17 -0
  3. package/.github/FUNDING.yml +1 -1
  4. package/.github/workflows/ci.yml +8 -8
  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 +5 -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 +47 -12
  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 -40
  43. package/dist/components/dropdown.js +110 -35
  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 +3 -3
  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 +28 -7
  61. package/dist/components/form.js +74 -29
  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 +4 -1
  67. package/dist/components/header.min.css +2 -2
  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 +30 -10
  73. package/dist/components/input.min.css +2 -2
  74. package/dist/components/item.css +1 -1
  75. package/dist/components/item.min.css +1 -1
  76. package/dist/components/label.css +7 -2
  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 -2
  83. package/dist/components/menu.min.css +2 -2
  84. package/dist/components/message.css +2 -1
  85. package/dist/components/message.min.css +2 -2
  86. package/dist/components/modal.css +3 -3
  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 -2
  97. package/dist/components/popup.js +10 -4
  98. package/dist/components/popup.min.css +2 -2
  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 +34 -23
  115. package/dist/components/search.js +78 -14
  116. package/dist/components/search.min.css +2 -2
  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 +6226 -3986
  165. package/dist/semantic.js +580 -195
  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/semantic.json.example +1 -1
  175. package/src/definitions/behaviors/api.js +6 -2
  176. package/src/definitions/behaviors/form.js +73 -28
  177. package/src/definitions/behaviors/state.js +3 -1
  178. package/src/definitions/behaviors/visibility.js +3 -1
  179. package/src/definitions/collections/form.less +56 -27
  180. package/src/definitions/collections/grid.less +85 -70
  181. package/src/definitions/collections/menu.less +38 -27
  182. package/src/definitions/collections/message.less +1 -0
  183. package/src/definitions/collections/table.less +183 -157
  184. package/src/definitions/elements/button.less +61 -25
  185. package/src/definitions/elements/container.less +6 -4
  186. package/src/definitions/elements/divider.less +4 -1
  187. package/src/definitions/elements/emoji.less +3 -1
  188. package/src/definitions/elements/header.less +12 -4
  189. package/src/definitions/elements/icon.less +35 -28
  190. package/src/definitions/elements/input.less +35 -19
  191. package/src/definitions/elements/label.less +19 -8
  192. package/src/definitions/elements/list.less +28 -21
  193. package/src/definitions/elements/loader.less +17 -12
  194. package/src/definitions/elements/segment.less +12 -7
  195. package/src/definitions/elements/step.less +405 -87
  196. package/src/definitions/globals/site.js +3 -1
  197. package/src/definitions/globals/site.less +17 -12
  198. package/src/definitions/modules/accordion.js +3 -1
  199. package/src/definitions/modules/accordion.less +15 -13
  200. package/src/definitions/modules/calendar.js +46 -11
  201. package/src/definitions/modules/calendar.less +6 -4
  202. package/src/definitions/modules/checkbox.js +9 -3
  203. package/src/definitions/modules/checkbox.less +12 -6
  204. package/src/definitions/modules/dimmer.js +3 -1
  205. package/src/definitions/modules/dimmer.less +16 -10
  206. package/src/definitions/modules/dropdown.js +109 -34
  207. package/src/definitions/modules/dropdown.less +109 -78
  208. package/src/definitions/modules/embed.js +16 -6
  209. package/src/definitions/modules/flyout.js +3 -1
  210. package/src/definitions/modules/flyout.less +51 -45
  211. package/src/definitions/modules/modal.js +6 -2
  212. package/src/definitions/modules/modal.less +109 -82
  213. package/src/definitions/modules/nag.js +10 -4
  214. package/src/definitions/modules/nag.less +8 -4
  215. package/src/definitions/modules/popup.js +9 -3
  216. package/src/definitions/modules/popup.less +3 -1
  217. package/src/definitions/modules/progress.js +3 -1
  218. package/src/definitions/modules/progress.less +24 -6
  219. package/src/definitions/modules/rating.js +3 -1
  220. package/src/definitions/modules/search.js +77 -13
  221. package/src/definitions/modules/search.less +41 -25
  222. package/src/definitions/modules/shape.js +6 -4
  223. package/src/definitions/modules/sidebar.js +3 -1
  224. package/src/definitions/modules/slider.js +141 -43
  225. package/src/definitions/modules/slider.less +129 -27
  226. package/src/definitions/modules/sticky.js +3 -1
  227. package/src/definitions/modules/tab.js +3 -1
  228. package/src/definitions/modules/toast.js +6 -2
  229. package/src/definitions/modules/toast.less +35 -24
  230. package/src/definitions/modules/transition.js +6 -2
  231. package/src/definitions/views/card.less +7 -5
  232. package/src/definitions/views/feed.less +14 -1
  233. package/src/definitions/views/item.less +7 -5
  234. package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
  235. package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  236. package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  237. package/src/themes/default/collections/form.variables +1 -0
  238. package/src/themes/default/elements/button.variables +3 -0
  239. package/src/themes/default/elements/emoji.variables +172 -23
  240. package/src/themes/default/elements/flag.variables +3 -3
  241. package/src/themes/default/elements/step.variables +33 -0
  242. package/src/themes/default/globals/site.variables +3 -0
  243. package/src/themes/default/globals/variation.variables +24 -2
  244. package/src/themes/default/modules/dropdown.variables +3 -0
  245. package/src/themes/default/modules/progress.variables +1 -1
  246. package/src/themes/default/modules/search.variables +15 -12
  247. package/src/themes/default/modules/slider.variables +10 -0
  248. package/src/themes/default/views/feed.variables +3 -0
  249. package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
  250. package/src/themes/joypixels/elements/emoji.variables +183 -22
  251. package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
  252. package/tasks/admin/components/create.js +4 -4
  253. package/tasks/admin/components/init.js +2 -2
  254. package/tasks/admin/components/update.js +3 -3
  255. package/tasks/admin/distributions/create.js +3 -3
  256. package/tasks/admin/distributions/init.js +2 -2
  257. package/tasks/admin/distributions/update.js +4 -4
  258. package/tasks/build/assets.js +1 -1
  259. package/tasks/build/css.js +19 -10
  260. package/tasks/build/javascript.js +12 -5
  261. package/tasks/check-install.js +1 -1
  262. package/tasks/config/defaults.js +4 -0
  263. package/tasks/config/project/release.js +19 -1
  264. package/tasks/config/tasks.js +7 -7
  265. package/tasks/docs/build.js +3 -3
  266. package/tasks/docs/metadata.js +1 -1
  267. package/tasks/docs/serve.js +3 -1
  268. package/tasks/install.js +2 -2
  269. package/tasks/watch.js +1 -1
  270. package/types/fomantic-ui-accordion.d.ts +1 -1
  271. package/types/fomantic-ui-api.d.ts +9 -3
  272. package/types/fomantic-ui-calendar.d.ts +114 -13
  273. package/types/fomantic-ui-checkbox.d.ts +14 -4
  274. package/types/fomantic-ui-dimmer.d.ts +1 -1
  275. package/types/fomantic-ui-dropdown.d.ts +82 -44
  276. package/types/fomantic-ui-embed.d.ts +19 -2
  277. package/types/fomantic-ui-flyout.d.ts +25 -11
  278. package/types/fomantic-ui-form.d.ts +128 -20
  279. package/types/fomantic-ui-modal.d.ts +101 -5
  280. package/types/fomantic-ui-nag.d.ts +4 -4
  281. package/types/fomantic-ui-popup.d.ts +38 -12
  282. package/types/fomantic-ui-progress.d.ts +12 -6
  283. package/types/fomantic-ui-rating.d.ts +1 -1
  284. package/types/fomantic-ui-search.d.ts +138 -22
  285. package/types/fomantic-ui-shape.d.ts +2 -2
  286. package/types/fomantic-ui-sidebar.d.ts +4 -4
  287. package/types/fomantic-ui-slider.d.ts +56 -4
  288. package/types/fomantic-ui-sticky.d.ts +1 -1
  289. package/types/fomantic-ui-tab.d.ts +6 -6
  290. package/types/fomantic-ui-toast.d.ts +14 -2
  291. package/types/fomantic-ui-transition.d.ts +41 -7
  292. package/types/fomantic-ui-visibility.d.ts +3 -3
  293. package/types/index.d.ts +25 -25
  294. package/types/tests.ts +188 -0
  295. package/types/tsconfig.json +1 -1
  296. package/types/fomantic-ui-tests.ts +0 -25
@@ -17,6 +17,12 @@
17
17
 
18
18
  @import (multiple) "../../theme.config";
19
19
 
20
+ @notIndeterminate: if(@variationProgressIndeterminate, e(":not(.indeterminate)"));
21
+ @notSliding: if(@variationProgressSliding, e(":not(.sliding)"));
22
+ @notFilling: if(@variationProgressFilling, e(":not(.filling)"));
23
+ @notSwinging: if(@variationProgressSwinging, e(":not(.swinging)"));
24
+ @notBasic: if(@variationProgressBasic, e(":not(.basic)"));
25
+
20
26
  /*******************************
21
27
  Progress
22
28
  *******************************/
@@ -33,6 +39,14 @@
33
39
  border-radius: @borderRadius;
34
40
  }
35
41
 
42
+ & when (@variationProgressBasic) {
43
+ .ui.basic.progress {
44
+ background: transparent;
45
+ border: none;
46
+ box-shadow: none;
47
+ }
48
+ }
49
+
36
50
  .ui.progress:first-child {
37
51
  margin: @firstMargin;
38
52
  }
@@ -50,14 +64,16 @@
50
64
  line-height: 1;
51
65
  position: @barPosition;
52
66
  width: @barInitialWidth;
53
- min-width: @barMinWidth;
54
67
  background: @barBackground;
55
68
  border-radius: @barBorderRadius;
56
69
  transition: @barTransition;
57
70
  overflow: hidden;
71
+ &:not(:empty) {
72
+ min-width: @barMinWidth;
73
+ }
58
74
  }
59
- .ui.ui.ui.progress:not([data-percent]):not(.indeterminate) .bar,
60
- .ui.ui.ui.progress[data-percent="0"]:not(.indeterminate) .bar {
75
+ .ui.ui.ui.progress:not([data-percent])@{notIndeterminate} .bar:not(:empty),
76
+ .ui.ui.ui.progress[data-percent="0"]@{notIndeterminate} .bar:not(:empty) {
61
77
  background: transparent;
62
78
  }
63
79
  .ui.progress[data-percent="0"] .bar .progress {
@@ -328,7 +344,9 @@
328
344
 
329
345
  .ui.active.progress .bar {
330
346
  position: relative;
331
- min-width: @activeMinWidth;
347
+ &:not(:empty) {
348
+ min-width: @activeMinWidth;
349
+ }
332
350
  }
333
351
  .ui.active.progress .bar::after {
334
352
  content: "";
@@ -384,7 +402,7 @@
384
402
  Inverted
385
403
  --------------- */
386
404
 
387
- .ui.inverted.progress {
405
+ .ui.inverted.progress@{notBasic} {
388
406
  background: @invertedBackground;
389
407
  border: @invertedBorder;
390
408
  }
@@ -561,7 +579,7 @@
561
579
  animation-name: progress-filling;
562
580
  }
563
581
  }
564
- .ui.indeterminate.progress:not(.sliding):not(.filling):not(.swinging) .bar::before {
582
+ .ui.indeterminate.progress@{notSliding}@{notFilling}@{notSwinging} .bar::before {
565
583
  background: @indeterminatePulseColor;
566
584
  }
567
585
  & when (@variationProgressSliding) or (@variationProgressSwinging) or (@variationProgressFilling) {
@@ -368,7 +368,9 @@
368
368
  });
369
369
  }
370
370
  clearTimeout(module.performance.timer);
371
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
371
+ module.performance.timer = setTimeout(function () {
372
+ module.performance.display();
373
+ }, 500);
372
374
  },
373
375
  display: function () {
374
376
  var
@@ -126,6 +126,7 @@
126
126
  .on('mousedown' + eventNamespace, selector.results, module.event.result.mousedown)
127
127
  .on('mouseup' + eventNamespace, selector.results, module.event.result.mouseup)
128
128
  .on('click' + eventNamespace, selector.result, module.event.result.click)
129
+ .on('click' + eventNamespace, selector.remove, module.event.remove.click)
129
130
  ;
130
131
  },
131
132
  },
@@ -135,7 +136,10 @@
135
136
  // this makes sure $.extend does not add specified search fields to default fields
136
137
  // this is the only setting which should not extend defaults
137
138
  if (parameters && parameters.searchFields !== undefined) {
138
- settings.searchFields = parameters.searchFields;
139
+ settings.searchFields = Array.isArray(parameters.searchFields)
140
+ ? parameters.searchFields
141
+ : [parameters.searchFields]
142
+ ;
139
143
  }
140
144
  },
141
145
  },
@@ -169,7 +173,9 @@
169
173
  callback = function () {
170
174
  module.cancel.query();
171
175
  module.remove.focus();
172
- module.timer = setTimeout(function () { module.hideResults(); }, settings.hideDelay);
176
+ module.timer = setTimeout(function () {
177
+ module.hideResults();
178
+ }, settings.hideDelay);
173
179
  }
174
180
  ;
175
181
  if (pageLostFocus) {
@@ -196,6 +202,12 @@
196
202
  callback();
197
203
  }
198
204
  },
205
+ remove: {
206
+ click: function () {
207
+ module.clear.value();
208
+ $prompt.trigger('focus');
209
+ },
210
+ },
199
211
  result: {
200
212
  mousedown: function () {
201
213
  module.resultsClicked = true;
@@ -629,7 +641,7 @@
629
641
  exactResults = [],
630
642
  fuzzyResults = [],
631
643
  searchExp = searchTerm.replace(regExp.escape, '\\$&'),
632
- matchRegExp = new RegExp(regExp.beginsWith + searchExp, 'i'),
644
+ matchRegExp = new RegExp(regExp.beginsWith + searchExp, settings.ignoreSearchCase ? 'i' : ''),
633
645
 
634
646
  // avoid duplicates when pushing results
635
647
  addResult = function (array, result) {
@@ -665,13 +677,14 @@
665
677
  var concatenatedContent = [];
666
678
  $.each(searchFields, function (index, field) {
667
679
  var
668
- fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number')
680
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
669
681
  ;
670
682
  if (fieldExists) {
671
683
  var text;
672
684
  text = typeof content[field] === 'string'
673
685
  ? module.remove.diacritics(content[field])
674
686
  : content[field].toString();
687
+ text = $('<div/>', { html: text }).text().trim();
675
688
  if (settings.fullTextSearch === 'all') {
676
689
  concatenatedContent.push(text);
677
690
  if (index < lastSearchFieldIndex) {
@@ -702,8 +715,10 @@
702
715
  },
703
716
  },
704
717
  exactSearch: function (query, term) {
705
- query = query.toLowerCase();
706
- term = term.toLowerCase();
718
+ if (settings.ignoreSearchCase) {
719
+ query = query.toLowerCase();
720
+ term = term.toLowerCase();
721
+ }
707
722
 
708
723
  return term.indexOf(query) > -1;
709
724
  },
@@ -730,8 +745,10 @@
730
745
  if (typeof query !== 'string') {
731
746
  return false;
732
747
  }
733
- query = query.toLowerCase();
734
- term = term.toLowerCase();
748
+ if (settings.ignoreSearchCase) {
749
+ query = query.toLowerCase();
750
+ term = term.toLowerCase();
751
+ }
735
752
  if (queryLength > termLength) {
736
753
  return false;
737
754
  }
@@ -827,6 +844,9 @@
827
844
  $module.data(metadata.cache, cache);
828
845
  }
829
846
  },
847
+ value: function () {
848
+ module.set.value('');
849
+ },
830
850
  },
831
851
 
832
852
  read: {
@@ -1086,6 +1106,39 @@
1086
1106
  response[fields.results] = response[fields.results].slice(0, settings.maxResults);
1087
1107
  }
1088
1108
  }
1109
+ if (settings.highlightMatches) {
1110
+ var results = response[fields.results],
1111
+ regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
1112
+ querySplit = module.get.value().split(''),
1113
+ diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
1114
+ htmlReg = '(?![^<]*>)',
1115
+ markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
1116
+ markedReplacer = function () {
1117
+ var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
1118
+ return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
1119
+ });
1120
+
1121
+ return args.join('');
1122
+ }
1123
+ ;
1124
+ $.each(results, function (label, content) {
1125
+ $.each(settings.searchFields, function (index, field) {
1126
+ var
1127
+ fieldExists = typeof content[field] === 'string' || typeof content[field] === 'number'
1128
+ ;
1129
+ if (fieldExists) {
1130
+ var markedHTML = typeof content[field] === 'string'
1131
+ ? content[field]
1132
+ : content[field].toString();
1133
+ if (settings.ignoreDiacritics) {
1134
+ markedHTML = markedHTML.normalize('NFD');
1135
+ }
1136
+ markedHTML = markedHTML.replace(/<\/?mark>/g, '');
1137
+ response[fields.results][label][field] = markedHTML.replace(markedRegExp, markedReplacer);
1138
+ }
1139
+ });
1140
+ });
1141
+ }
1089
1142
  if (isFunction(template)) {
1090
1143
  html = template(response, fields, settings.preserveHTML);
1091
1144
  } else {
@@ -1171,7 +1224,9 @@
1171
1224
  });
1172
1225
  }
1173
1226
  clearTimeout(module.performance.timer);
1174
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
1227
+ module.performance.timer = setTimeout(function () {
1228
+ module.performance.display();
1229
+ }, 500);
1175
1230
  },
1176
1231
  display: function () {
1177
1232
  var
@@ -1312,9 +1367,15 @@
1312
1367
  // search anywhere in value (set to 'exact' to require exact matches
1313
1368
  fullTextSearch: 'exact',
1314
1369
 
1370
+ // Whether search result should highlight matching strings
1371
+ highlightMatches: false,
1372
+
1315
1373
  // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
1316
1374
  ignoreDiacritics: false,
1317
1375
 
1376
+ // whether to consider case sensitivity on local searching
1377
+ ignoreSearchCase: true,
1378
+
1318
1379
  // whether to add events to prompt automatically
1319
1380
  automatic: true,
1320
1381
 
@@ -1393,6 +1454,7 @@
1393
1454
  categoryResults: 'results', // array of results (category view)
1394
1455
  description: 'description', // result description
1395
1456
  image: 'image', // result image
1457
+ alt: 'alt', // result alt text for image
1396
1458
  price: 'price', // result price
1397
1459
  results: 'results', // array of results (standard)
1398
1460
  title: 'title', // result title
@@ -1404,6 +1466,7 @@
1404
1466
 
1405
1467
  selector: {
1406
1468
  prompt: '.prompt',
1469
+ remove: '> .icon.input > .remove.icon',
1407
1470
  searchButton: '.search.button',
1408
1471
  results: '.results',
1409
1472
  message: '.results > .message',
@@ -1432,8 +1495,9 @@
1432
1495
  };
1433
1496
  if (shouldEscape.test(string)) {
1434
1497
  string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
1435
-
1436
- return string.replace(badChars, escapedChar);
1498
+ string = string.replace(badChars, escapedChar);
1499
+ // FUI controlled HTML is still allowed
1500
+ string = string.replace(/&lt;(\/)*mark&gt;/g, '<$1mark>');
1437
1501
  }
1438
1502
 
1439
1503
  return string;
@@ -1479,7 +1543,7 @@
1479
1543
  if (result[fields.image] !== undefined) {
1480
1544
  html += ''
1481
1545
  + '<div class="image">'
1482
- + ' <img src="' + result[fields.image].replace(/"/g, '') + '">'
1546
+ + ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '" alt="' + result[fields.alt].replace(/"/g, '') : '') + '">'
1483
1547
  + '</div>';
1484
1548
  }
1485
1549
  html += '<div class="content">';
@@ -1532,7 +1596,7 @@
1532
1596
  if (result[fields.image] !== undefined) {
1533
1597
  html += ''
1534
1598
  + '<div class="image">'
1535
- + ' <img src="' + result[fields.image].replace(/"/g, '') + '">'
1599
+ + ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '" alt="' + result[fields.alt].replace(/"/g, '') : '') + '">'
1536
1600
  + '</div>';
1537
1601
  }
1538
1602
  html += '<div class="content">';
@@ -271,37 +271,46 @@
271
271
  Types
272
272
  *******************************/
273
273
 
274
- & when (@variationSearchSelection) {
274
+ & when (@variationSearchClear) {
275
275
  /* --------------
276
- Selection
276
+ Clear Icon
277
277
  --------------- */
278
278
 
279
- .ui.search.selection .prompt {
280
- border-radius: @selectionPromptBorderRadius;
279
+ .ui.search > .icon.input > .remove.icon {
280
+ pointer-events: all;
281
+ transition: @clearableIconTransition;
282
+ cursor: pointer;
283
+ opacity: @clearableIconOpacity;
284
+ &:hover {
285
+ opacity: @clearableIconHoverOpacity;
286
+ }
281
287
  }
282
-
283
- /* Remove input */
284
- .ui.search.selection > .icon.input > .remove.icon {
285
- pointer-events: none;
286
- position: absolute;
287
- left: auto;
288
- opacity: 0;
289
- color: @selectionCloseIconColor;
290
- top: @selectionCloseTop;
291
- right: @selectionCloseRight;
292
- transition: @selectionCloseTransition;
288
+ .ui.search > .icon.input:not([class*="left icon"]) > .icon ~ .remove.icon {
289
+ right: @clearableIconInputRight;
293
290
  }
294
- .ui.search.selection > .icon.input > .active.remove.icon {
291
+ .ui.search input[type="search"]::-webkit-search-cancel-button {
292
+ -webkit-appearance: none;
295
293
  cursor: pointer;
296
- opacity: @selectionCloseIconOpacity;
297
- pointer-events: auto;
294
+ transition: @clearableIconTransition;
295
+ opacity: @clearableIconOpacity;
296
+ background: @clearableIconBackground;
297
+ height: @clearableIconHeight;
298
+ width: @clearableIconWidth;
299
+ &:hover {
300
+ opacity: @clearableIconHoverOpacity;
301
+ }
302
+ }
303
+ & when (@variationSearchLoading) {
304
+ .ui.loading.search input[type="search"]::-webkit-search-cancel-button {
305
+ display: none;
306
+ }
298
307
  }
299
- .ui.search.selection > .icon.input:not([class*="left icon"]) > .icon ~ .remove.icon {
300
- right: @selectionCloseIconInputRight;
308
+ .ui.search > .icon.input > input:placeholder-shown ~ .remove.icon,
309
+ .ui.search.loading > .icon.input > .remove.icon {
310
+ display: none;
301
311
  }
302
- .ui.search.selection > .icon.input > .remove.icon:hover {
303
- opacity: @selectionCloseIconHoverOpacity;
304
- color: @selectionCloseIconHoverColor;
312
+ .ui.search > .icon.input > input:-ms-input-placeholder ~ .remove.icon when (@supportIE) {
313
+ display: none;
305
314
  }
306
315
  }
307
316
 
@@ -565,8 +574,8 @@
565
574
  .ui.search {
566
575
  font-size: @relativeMedium;
567
576
  }
568
- & when not (@variationFeedSizes = false) {
569
- each(@variationFeedSizes, {
577
+ & when not (@variationSearchSizes = false) {
578
+ each(@variationSearchSizes, {
570
579
  @s: @{value}SearchSize;
571
580
  .ui.@{value}.search {
572
581
  font-size: @@s;
@@ -574,6 +583,13 @@
574
583
  });
575
584
  }
576
585
 
586
+ & when (@variationSearchHighlightMatches) {
587
+ .ui.search > .results mark {
588
+ background: @highlightMatchesBackground;
589
+ color: @highlightMatchesColor;
590
+ }
591
+ }
592
+
577
593
  /* --------------
578
594
  Mobile
579
595
  --------------- */
@@ -185,7 +185,7 @@
185
185
  set: {
186
186
 
187
187
  defaultSide: function () {
188
- $activeSide = $side.filter('.' + settings.className.active);
188
+ $activeSide = $side.filter('.' + className.active);
189
189
  $nextSide = $activeSide.next(selector.side).length > 0
190
190
  ? $activeSide.next(selector.side)
191
191
  : $side.first();
@@ -211,7 +211,7 @@
211
211
 
212
212
  currentStageSize: function () {
213
213
  var
214
- $activeSide = $side.filter('.' + settings.className.active),
214
+ $activeSide = $side.filter('.' + className.active),
215
215
  width = $activeSide.outerWidth(true),
216
216
  height = $activeSide.outerHeight(true)
217
217
  ;
@@ -227,7 +227,7 @@
227
227
  var
228
228
  $clone = $module.clone().addClass(className.loading),
229
229
  $side = $clone.find('>' + selector.sides + '>' + selector.side),
230
- $activeSide = $side.filter('.' + settings.className.active),
230
+ $activeSide = $side.filter('.' + className.active),
231
231
  $nextSide = nextIndex
232
232
  ? $side.eq(nextIndex)
233
233
  : ($activeSide.next(selector.side).length > 0
@@ -623,7 +623,9 @@
623
623
  });
624
624
  }
625
625
  clearTimeout(module.performance.timer);
626
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
626
+ module.performance.timer = setTimeout(function () {
627
+ module.performance.display();
628
+ }, 500);
627
629
  },
628
630
  display: function () {
629
631
  var
@@ -871,7 +871,9 @@
871
871
  });
872
872
  }
873
873
  clearTimeout(module.performance.timer);
874
- module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
874
+ module.performance.timer = setTimeout(function () {
875
+ module.performance.display();
876
+ }, 500);
875
877
  },
876
878
  display: function () {
877
879
  var