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.
- package/.all-contributorsrc +29 -1
- package/.eslintrc.js +17 -0
- package/.github/FUNDING.yml +1 -1
- package/.github/workflows/ci.yml +8 -8
- package/.github/workflows/depsreview.yml +14 -0
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CONTRIBUTORS.md +5 -0
- package/README.md +2 -12
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -2
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +7 -3
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +21 -3
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +47 -12
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +10 -4
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +7 -3
- package/dist/components/dimmer.js +4 -2
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +46 -40
- package/dist/components/dropdown.js +110 -35
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +17 -7
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +4309 -3713
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +12 -1
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +3 -1
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +3 -3
- package/dist/components/flyout.js +4 -2
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +28 -7
- package/dist/components/form.js +74 -29
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +5 -5
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +4 -1
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +30 -10
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +7 -2
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -2
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +2 -1
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +3 -3
- package/dist/components/modal.js +7 -3
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +11 -5
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -2
- package/dist/components/popup.js +10 -4
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +15 -6
- package/dist/components/progress.js +4 -2
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +4 -2
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +34 -23
- package/dist/components/search.js +78 -14
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +7 -5
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +4 -2
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +14 -6
- package/dist/components/site.js +4 -2
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +152 -2
- package/dist/components/slider.js +142 -44
- package/dist/components/slider.min.css +2 -2
- package/dist/components/slider.min.js +3 -3
- package/dist/components/state.js +4 -2
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +992 -86
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +4 -2
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +4 -2
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +32 -21
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +7 -3
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +7 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +4 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +6226 -3986
- package/dist/semantic.js +580 -195
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/package.json +14 -14
- package/semantic.json.example +1 -1
- package/src/definitions/behaviors/api.js +6 -2
- package/src/definitions/behaviors/form.js +73 -28
- package/src/definitions/behaviors/state.js +3 -1
- package/src/definitions/behaviors/visibility.js +3 -1
- package/src/definitions/collections/form.less +56 -27
- package/src/definitions/collections/grid.less +85 -70
- package/src/definitions/collections/menu.less +38 -27
- package/src/definitions/collections/message.less +1 -0
- package/src/definitions/collections/table.less +183 -157
- package/src/definitions/elements/button.less +61 -25
- package/src/definitions/elements/container.less +6 -4
- package/src/definitions/elements/divider.less +4 -1
- package/src/definitions/elements/emoji.less +3 -1
- package/src/definitions/elements/header.less +12 -4
- package/src/definitions/elements/icon.less +35 -28
- package/src/definitions/elements/input.less +35 -19
- package/src/definitions/elements/label.less +19 -8
- package/src/definitions/elements/list.less +28 -21
- package/src/definitions/elements/loader.less +17 -12
- package/src/definitions/elements/segment.less +12 -7
- package/src/definitions/elements/step.less +405 -87
- package/src/definitions/globals/site.js +3 -1
- package/src/definitions/globals/site.less +17 -12
- package/src/definitions/modules/accordion.js +3 -1
- package/src/definitions/modules/accordion.less +15 -13
- package/src/definitions/modules/calendar.js +46 -11
- package/src/definitions/modules/calendar.less +6 -4
- package/src/definitions/modules/checkbox.js +9 -3
- package/src/definitions/modules/checkbox.less +12 -6
- package/src/definitions/modules/dimmer.js +3 -1
- package/src/definitions/modules/dimmer.less +16 -10
- package/src/definitions/modules/dropdown.js +109 -34
- package/src/definitions/modules/dropdown.less +109 -78
- package/src/definitions/modules/embed.js +16 -6
- package/src/definitions/modules/flyout.js +3 -1
- package/src/definitions/modules/flyout.less +51 -45
- package/src/definitions/modules/modal.js +6 -2
- package/src/definitions/modules/modal.less +109 -82
- package/src/definitions/modules/nag.js +10 -4
- package/src/definitions/modules/nag.less +8 -4
- package/src/definitions/modules/popup.js +9 -3
- package/src/definitions/modules/popup.less +3 -1
- package/src/definitions/modules/progress.js +3 -1
- package/src/definitions/modules/progress.less +24 -6
- package/src/definitions/modules/rating.js +3 -1
- package/src/definitions/modules/search.js +77 -13
- package/src/definitions/modules/search.less +41 -25
- package/src/definitions/modules/shape.js +6 -4
- package/src/definitions/modules/sidebar.js +3 -1
- package/src/definitions/modules/slider.js +141 -43
- package/src/definitions/modules/slider.less +129 -27
- package/src/definitions/modules/sticky.js +3 -1
- package/src/definitions/modules/tab.js +3 -1
- package/src/definitions/modules/toast.js +6 -2
- package/src/definitions/modules/toast.less +35 -24
- package/src/definitions/modules/transition.js +6 -2
- package/src/definitions/views/card.less +7 -5
- package/src/definitions/views/feed.less +14 -1
- package/src/definitions/views/item.less +7 -5
- package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/src/themes/default/collections/form.variables +1 -0
- package/src/themes/default/elements/button.variables +3 -0
- package/src/themes/default/elements/emoji.variables +172 -23
- package/src/themes/default/elements/flag.variables +3 -3
- package/src/themes/default/elements/step.variables +33 -0
- package/src/themes/default/globals/site.variables +3 -0
- package/src/themes/default/globals/variation.variables +24 -2
- package/src/themes/default/modules/dropdown.variables +3 -0
- package/src/themes/default/modules/progress.variables +1 -1
- package/src/themes/default/modules/search.variables +15 -12
- package/src/themes/default/modules/slider.variables +10 -0
- package/src/themes/default/views/feed.variables +3 -0
- package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/src/themes/joypixels/elements/emoji.variables +183 -22
- package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/tasks/admin/components/create.js +4 -4
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +3 -3
- package/tasks/admin/distributions/create.js +3 -3
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +19 -10
- package/tasks/build/javascript.js +12 -5
- package/tasks/check-install.js +1 -1
- package/tasks/config/defaults.js +4 -0
- package/tasks/config/project/release.js +19 -1
- package/tasks/config/tasks.js +7 -7
- package/tasks/docs/build.js +3 -3
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +3 -1
- package/tasks/install.js +2 -2
- package/tasks/watch.js +1 -1
- package/types/fomantic-ui-accordion.d.ts +1 -1
- package/types/fomantic-ui-api.d.ts +9 -3
- package/types/fomantic-ui-calendar.d.ts +114 -13
- package/types/fomantic-ui-checkbox.d.ts +14 -4
- package/types/fomantic-ui-dimmer.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +82 -44
- package/types/fomantic-ui-embed.d.ts +19 -2
- package/types/fomantic-ui-flyout.d.ts +25 -11
- package/types/fomantic-ui-form.d.ts +128 -20
- package/types/fomantic-ui-modal.d.ts +101 -5
- package/types/fomantic-ui-nag.d.ts +4 -4
- package/types/fomantic-ui-popup.d.ts +38 -12
- package/types/fomantic-ui-progress.d.ts +12 -6
- package/types/fomantic-ui-rating.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +138 -22
- package/types/fomantic-ui-shape.d.ts +2 -2
- package/types/fomantic-ui-sidebar.d.ts +4 -4
- package/types/fomantic-ui-slider.d.ts +56 -4
- package/types/fomantic-ui-sticky.d.ts +1 -1
- package/types/fomantic-ui-tab.d.ts +6 -6
- package/types/fomantic-ui-toast.d.ts +14 -2
- package/types/fomantic-ui-transition.d.ts +41 -7
- package/types/fomantic-ui-visibility.d.ts +3 -3
- package/types/index.d.ts +25 -25
- package/types/tests.ts +188 -0
- package/types/tsconfig.json +1 -1
- 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(
|
60
|
-
.ui.ui.ui.progress[data-percent="0"]:not(
|
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
|
-
|
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
|
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 () {
|
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 () {
|
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
|
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 =
|
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
|
-
|
706
|
-
|
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
|
-
|
734
|
-
|
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 () {
|
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, '&');
|
1435
|
-
|
1436
|
-
|
1498
|
+
string = string.replace(badChars, escapedChar);
|
1499
|
+
// FUI controlled HTML is still allowed
|
1500
|
+
string = string.replace(/<(\/)*mark>/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 (@
|
274
|
+
& when (@variationSearchClear) {
|
275
275
|
/* --------------
|
276
|
-
|
276
|
+
Clear Icon
|
277
277
|
--------------- */
|
278
278
|
|
279
|
-
.ui.search.
|
280
|
-
|
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
|
-
|
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
|
291
|
+
.ui.search input[type="search"]::-webkit-search-cancel-button {
|
292
|
+
-webkit-appearance: none;
|
295
293
|
cursor: pointer;
|
296
|
-
|
297
|
-
|
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
|
300
|
-
|
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
|
303
|
-
|
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 (@
|
569
|
-
each(@
|
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('.' +
|
188
|
+
$activeSide = $side.filter('.' + className.active);
|
189
189
|
$nextSide = $activeSide.next(selector.side).length > 0
|
190
190
|
? $activeSide.next(selector.side)
|
191
191
|
: $side.first();
|
@@ -211,7 +211,7 @@
|
|
211
211
|
|
212
212
|
currentStageSize: function () {
|
213
213
|
var
|
214
|
-
$activeSide = $side.filter('.' +
|
214
|
+
$activeSide = $side.filter('.' + className.active),
|
215
215
|
width = $activeSide.outerWidth(true),
|
216
216
|
height = $activeSide.outerHeight(true)
|
217
217
|
;
|
@@ -227,7 +227,7 @@
|
|
227
227
|
var
|
228
228
|
$clone = $module.clone().addClass(className.loading),
|
229
229
|
$side = $clone.find('>' + selector.sides + '>' + selector.side),
|
230
|
-
$activeSide = $side.filter('.' +
|
230
|
+
$activeSide = $side.filter('.' + className.active),
|
231
231
|
$nextSide = nextIndex
|
232
232
|
? $side.eq(nextIndex)
|
233
233
|
: ($activeSide.next(selector.side).length > 0
|
@@ -623,7 +623,9 @@
|
|
623
623
|
});
|
624
624
|
}
|
625
625
|
clearTimeout(module.performance.timer);
|
626
|
-
module.performance.timer = setTimeout(function () {
|
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 () {
|
874
|
+
module.performance.timer = setTimeout(function () {
|
875
|
+
module.performance.display();
|
876
|
+
}, 500);
|
875
877
|
},
|
876
878
|
display: function () {
|
877
879
|
var
|