fomantic-ui 2.9.4-beta.7 → 2.9.4-beta.70
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 +20 -1
- package/.eslintrc.js +17 -0
- package/.github/FUNDING.yml +1 -1
- package/.github/workflows/ci.yml +5 -5
- package/.github/workflows/depsreview.yml +14 -0
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CONTRIBUTORS.md +2 -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 +15 -3
- 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 -38
- package/dist/components/dropdown.js +104 -33
- 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 +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +12 -1
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- 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 +15 -3
- package/dist/components/form.js +66 -23
- 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 +1 -1
- package/dist/components/header.min.css +1 -1
- 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 +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- 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 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +2 -1
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +1 -1
- 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 -1
- package/dist/components/popup.js +10 -4
- package/dist/components/popup.min.css +1 -1
- 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 +1 -1
- package/dist/components/search.js +67 -14
- package/dist/components/search.min.css +1 -1
- 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 +1 -1
- package/dist/components/slider.js +4 -2
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- 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 +1 -1
- package/dist/components/step.min.css +1 -1
- 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 +234 -132
- package/dist/semantic.js +385 -136
- 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/src/definitions/behaviors/api.js +6 -2
- package/src/definitions/behaviors/form.js +65 -22
- package/src/definitions/behaviors/state.js +3 -1
- package/src/definitions/behaviors/visibility.js +3 -1
- package/src/definitions/collections/form.less +9 -2
- package/src/definitions/collections/grid.less +4 -4
- package/src/definitions/collections/message.less +1 -0
- package/src/definitions/collections/table.less +69 -54
- package/src/definitions/elements/button.less +27 -3
- 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/calendar.js +14 -2
- package/src/definitions/modules/checkbox.js +9 -3
- package/src/definitions/modules/dimmer.js +3 -1
- package/src/definitions/modules/dimmer.less +8 -5
- package/src/definitions/modules/dropdown.js +103 -32
- package/src/definitions/modules/dropdown.less +43 -29
- package/src/definitions/modules/embed.js +16 -6
- package/src/definitions/modules/flyout.js +3 -1
- package/src/definitions/modules/modal.js +6 -2
- package/src/definitions/modules/nag.js +10 -4
- package/src/definitions/modules/popup.js +9 -3
- package/src/definitions/modules/progress.js +3 -1
- package/src/definitions/modules/progress.less +17 -5
- package/src/definitions/modules/rating.js +3 -1
- package/src/definitions/modules/search.js +66 -13
- package/src/definitions/modules/search.less +9 -2
- package/src/definitions/modules/shape.js +6 -4
- package/src/definitions/modules/sidebar.js +3 -1
- package/src/definitions/modules/slider.js +3 -1
- 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/transition.js +6 -2
- package/src/definitions/views/feed.less +11 -0
- 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/elements/button.variables +3 -0
- package/src/themes/default/globals/site.variables +3 -0
- package/src/themes/default/globals/variation.variables +3 -0
- 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 +3 -0
- package/src/themes/default/views/feed.variables +3 -0
- package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
- 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 +2 -0
- package/tasks/config/tasks.js +1 -1
- 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 +110 -9
- 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 +76 -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 +123 -15
- 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 +2 -2
- 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
@@ -148,18 +148,21 @@ a:hover {
|
|
148
148
|
body ::-webkit-scrollbar-thumb:hover {
|
149
149
|
background: @thumbHoverBackground;
|
150
150
|
}
|
151
|
-
|
152
|
-
|
151
|
+
& when (@supportIE) {
|
152
|
+
body .ui {
|
153
153
|
/* IE11 */
|
154
154
|
scrollbar-face-color: @thumbBackgroundHex;
|
155
155
|
scrollbar-shadow-color: @thumbBackgroundHex;
|
156
156
|
scrollbar-track-color: @trackBackgroundHex;
|
157
157
|
scrollbar-arrow-color: @trackBackgroundHex;
|
158
158
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
159
|
+
}
|
160
|
+
@supports (-moz-appearance: none) {
|
161
|
+
body .ui {
|
162
|
+
/* firefox: first color thumb, second track */
|
163
|
+
scrollbar-color: @thumbBackground @trackBackground;
|
164
|
+
scrollbar-width: thin;
|
165
|
+
}
|
163
166
|
}
|
164
167
|
|
165
168
|
/* Inverted UI */
|
@@ -175,18 +178,20 @@ a:hover {
|
|
175
178
|
body .ui.inverted:not(.dimmer)::-webkit-scrollbar-thumb:hover {
|
176
179
|
background: @thumbInvertedHoverBackground;
|
177
180
|
}
|
178
|
-
|
179
|
-
|
180
|
-
& when (@supportIE) {
|
181
|
+
& when (@supportIE) {
|
182
|
+
body .ui.inverted:not(.dimmer) {
|
181
183
|
/* IE11 */
|
182
184
|
scrollbar-face-color: @thumbInvertedBackgroundHex;
|
183
185
|
scrollbar-shadow-color: @thumbInvertedBackgroundHex;
|
184
186
|
scrollbar-track-color: @trackInvertedBackgroundHex;
|
185
187
|
scrollbar-arrow-color: @trackInvertedBackgroundHex;
|
186
188
|
}
|
187
|
-
|
188
|
-
|
189
|
-
|
189
|
+
}
|
190
|
+
@supports (-moz-appearance: none) {
|
191
|
+
body .ui.inverted:not(.dimmer) {
|
192
|
+
/* firefox: first color thumb, second track */
|
193
|
+
scrollbar-color: @thumbInvertedBackground @trackInvertedBackground;
|
194
|
+
}
|
190
195
|
}
|
191
196
|
}
|
192
197
|
|
@@ -438,7 +438,9 @@
|
|
438
438
|
});
|
439
439
|
}
|
440
440
|
clearTimeout(module.performance.timer);
|
441
|
-
module.performance.timer = setTimeout(function () {
|
441
|
+
module.performance.timer = setTimeout(function () {
|
442
|
+
module.performance.display();
|
443
|
+
}, 500);
|
442
444
|
},
|
443
445
|
display: function () {
|
444
446
|
var
|
@@ -102,7 +102,17 @@
|
|
102
102
|
|
103
103
|
destroy: function () {
|
104
104
|
module.verbose('Destroying previous calendar for', element);
|
105
|
-
$module.removeData(
|
105
|
+
$module.removeData([
|
106
|
+
metadata.date,
|
107
|
+
metadata.focusDate,
|
108
|
+
metadata.startDate,
|
109
|
+
metadata.endDate,
|
110
|
+
metadata.minDate,
|
111
|
+
metadata.maxDate,
|
112
|
+
metadata.mode,
|
113
|
+
metadata.monthOffset,
|
114
|
+
moduleNamespace,
|
115
|
+
]);
|
106
116
|
module.unbind.events();
|
107
117
|
module.disconnect.classObserver();
|
108
118
|
},
|
@@ -1479,7 +1489,9 @@
|
|
1479
1489
|
});
|
1480
1490
|
}
|
1481
1491
|
clearTimeout(module.performance.timer);
|
1482
|
-
module.performance.timer = setTimeout(function () {
|
1492
|
+
module.performance.timer = setTimeout(function () {
|
1493
|
+
module.performance.display();
|
1494
|
+
}, 500);
|
1483
1495
|
},
|
1484
1496
|
display: function () {
|
1485
1497
|
var
|
@@ -210,7 +210,7 @@
|
|
210
210
|
;
|
211
211
|
|
212
212
|
var
|
213
|
-
r = module.get.radios(),
|
213
|
+
r = module.get.radios().not(selector.disabled),
|
214
214
|
rIndex = r.index($module),
|
215
215
|
rLen = r.length,
|
216
216
|
checkIndex = false
|
@@ -228,7 +228,10 @@
|
|
228
228
|
|
229
229
|
return false;
|
230
230
|
}
|
231
|
-
|
231
|
+
var nextOption = $(r[checkIndex]),
|
232
|
+
nextInput = nextOption.children(selector.input),
|
233
|
+
disallowOption = nextOption.hasClass(className.readOnly) || nextInput.prop('readonly');
|
234
|
+
if (disallowOption || settings.beforeChecked.apply(nextInput[0]) === false) {
|
232
235
|
module.verbose('Next option should not allow check, cancelling key navigation');
|
233
236
|
|
234
237
|
return false;
|
@@ -725,7 +728,9 @@
|
|
725
728
|
});
|
726
729
|
}
|
727
730
|
clearTimeout(module.performance.timer);
|
728
|
-
module.performance.timer = setTimeout(function () {
|
731
|
+
module.performance.timer = setTimeout(function () {
|
732
|
+
module.performance.display();
|
733
|
+
}, 500);
|
729
734
|
},
|
730
735
|
display: function () {
|
731
736
|
var
|
@@ -873,6 +878,7 @@
|
|
873
878
|
|
874
879
|
selector: {
|
875
880
|
checkbox: '.ui.checkbox',
|
881
|
+
disabled: '.disabled, :has(input[disabled])',
|
876
882
|
label: 'label',
|
877
883
|
input: 'input[type="checkbox"], input[type="radio"]',
|
878
884
|
link: 'a[href]',
|
@@ -528,7 +528,9 @@
|
|
528
528
|
});
|
529
529
|
}
|
530
530
|
clearTimeout(module.performance.timer);
|
531
|
-
module.performance.timer = setTimeout(function () {
|
531
|
+
module.performance.timer = setTimeout(function () {
|
532
|
+
module.performance.display();
|
533
|
+
}, 500);
|
532
534
|
},
|
533
535
|
display: function () {
|
534
536
|
var
|
@@ -74,17 +74,20 @@
|
|
74
74
|
.ui.dimmer:not(.inverted)::-webkit-scrollbar-thumb:hover {
|
75
75
|
background: @thumbInvertedHoverBackground;
|
76
76
|
}
|
77
|
-
|
78
|
-
|
77
|
+
& when (@supportIE) {
|
78
|
+
.ui.dimmer:not(.inverted) {
|
79
79
|
/* IE11 */
|
80
80
|
scrollbar-face-color: @thumbInvertedBackgroundHex;
|
81
81
|
scrollbar-shadow-color: @thumbInvertedBackgroundHex;
|
82
82
|
scrollbar-track-color: @trackInvertedBackgroundHex;
|
83
83
|
scrollbar-arrow-color: @trackInvertedBackgroundHex;
|
84
84
|
}
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
}
|
86
|
+
@supports (-moz-appearance: none) {
|
87
|
+
.ui.dimmer:not(.inverted) {
|
88
|
+
/* firefox: first color thumb, second track */
|
89
|
+
scrollbar-color: @thumbInvertedBackground @trackInvertedBackground;
|
90
|
+
}
|
88
91
|
}
|
89
92
|
}
|
90
93
|
|
@@ -126,6 +126,8 @@
|
|
126
126
|
module.set.initialLoad();
|
127
127
|
module.change.values(settings.values);
|
128
128
|
module.remove.initialLoad();
|
129
|
+
} else if (module.get.placeholderText() !== '') {
|
130
|
+
module.set.placeholderText();
|
129
131
|
}
|
130
132
|
|
131
133
|
module.refreshData();
|
@@ -793,7 +795,7 @@
|
|
793
795
|
}
|
794
796
|
if (module.is.multiple()) {
|
795
797
|
$.each(preSelected, function (index, value) {
|
796
|
-
$item.filter('[data-value="' + value + '"]')
|
798
|
+
$item.filter('[data-' + metadata.value + '="' + value + '"]')
|
797
799
|
.addClass(className.filtered)
|
798
800
|
;
|
799
801
|
});
|
@@ -890,11 +892,13 @@
|
|
890
892
|
? query
|
891
893
|
: module.get.query()
|
892
894
|
),
|
893
|
-
results
|
894
|
-
escapedTerm
|
895
|
-
|
895
|
+
results = null,
|
896
|
+
escapedTerm = module.escape.string(searchTerm),
|
897
|
+
regExpIgnore = settings.ignoreSearchCase ? 'i' : '',
|
898
|
+
regExpFlags = regExpIgnore + 'gm',
|
896
899
|
beginsWithRegExp = new RegExp('^' + escapedTerm, regExpFlags)
|
897
900
|
;
|
901
|
+
module.remove.filteredItem();
|
898
902
|
// avoid loop if we're matching nothing
|
899
903
|
if (module.has.query()) {
|
900
904
|
results = [];
|
@@ -938,12 +942,34 @@
|
|
938
942
|
;
|
939
943
|
}
|
940
944
|
module.debug('Showing only matched items', searchTerm);
|
941
|
-
module.remove.filteredItem();
|
942
945
|
if (results) {
|
943
946
|
$item
|
944
947
|
.not(results)
|
945
948
|
.addClass(className.filtered)
|
946
949
|
;
|
950
|
+
if (settings.highlightMatches && (settings.match === 'both' || settings.match === 'text')) {
|
951
|
+
var querySplit = query.split(''),
|
952
|
+
diacriticReg = settings.ignoreDiacritics ? '[\u0300-\u036F]?' : '',
|
953
|
+
htmlReg = '(?![^<]*>)',
|
954
|
+
markedRegExp = new RegExp(htmlReg + '(' + querySplit.join(diacriticReg + ')(.*?)' + htmlReg + '(') + diacriticReg + ')', regExpIgnore),
|
955
|
+
markedReplacer = function () {
|
956
|
+
var args = [].slice.call(arguments, 1, querySplit.length * 2).map(function (x, i) {
|
957
|
+
return i & 1 ? x : '<mark>' + x + '</mark>'; // eslint-disable-line no-bitwise
|
958
|
+
});
|
959
|
+
|
960
|
+
return args.join('');
|
961
|
+
}
|
962
|
+
;
|
963
|
+
$.each(results, function (index, result) {
|
964
|
+
var $result = $(result),
|
965
|
+
markedHTML = module.get.choiceText($result, true)
|
966
|
+
;
|
967
|
+
if (settings.ignoreDiacritics) {
|
968
|
+
markedHTML = markedHTML.normalize('NFD');
|
969
|
+
}
|
970
|
+
$result.html(markedHTML.replace(markedRegExp, markedReplacer));
|
971
|
+
});
|
972
|
+
}
|
947
973
|
}
|
948
974
|
|
949
975
|
if (!module.has.query()) {
|
@@ -979,8 +1005,10 @@
|
|
979
1005
|
termLength = term.length,
|
980
1006
|
queryLength = query.length
|
981
1007
|
;
|
982
|
-
|
983
|
-
|
1008
|
+
if (settings.ignoreSearchCase) {
|
1009
|
+
query = query.toLowerCase();
|
1010
|
+
term = term.toLowerCase();
|
1011
|
+
}
|
984
1012
|
if (queryLength > termLength) {
|
985
1013
|
return false;
|
986
1014
|
}
|
@@ -1187,7 +1215,7 @@
|
|
1187
1215
|
if (!itemActivated && !pageLostFocus) {
|
1188
1216
|
if (settings.forceSelection) {
|
1189
1217
|
module.forceSelection();
|
1190
|
-
} else if (!settings.allowAdditions) {
|
1218
|
+
} else if (!settings.allowAdditions && !settings.keepSearchTerm && !module.has.menuSearch()) {
|
1191
1219
|
module.remove.searchTerm();
|
1192
1220
|
}
|
1193
1221
|
module.hide();
|
@@ -1236,7 +1264,9 @@
|
|
1236
1264
|
module.set.filtered();
|
1237
1265
|
}
|
1238
1266
|
clearTimeout(module.timer);
|
1239
|
-
module.timer = setTimeout(function () {
|
1267
|
+
module.timer = setTimeout(function () {
|
1268
|
+
module.search();
|
1269
|
+
}, settings.delay.search);
|
1240
1270
|
},
|
1241
1271
|
label: {
|
1242
1272
|
click: function (event) {
|
@@ -1413,7 +1443,9 @@
|
|
1413
1443
|
module.remove.userAddition();
|
1414
1444
|
}
|
1415
1445
|
if (!settings.keepSearchTerm) {
|
1416
|
-
module.
|
1446
|
+
if (module.is.multiple()) {
|
1447
|
+
module.remove.filteredItem();
|
1448
|
+
}
|
1417
1449
|
module.remove.searchTerm();
|
1418
1450
|
}
|
1419
1451
|
if (!module.is.visible() && $target.length > 0) {
|
@@ -2587,7 +2619,7 @@
|
|
2587
2619
|
} else {
|
2588
2620
|
$combo.text(text);
|
2589
2621
|
}
|
2590
|
-
} else if (settings.action === 'activate') {
|
2622
|
+
} else if (settings.action === 'activate' || isFunction(settings.action)) {
|
2591
2623
|
if (text !== module.get.placeholderText() || isNotPlaceholder) {
|
2592
2624
|
$text.removeClass(className.placeholder);
|
2593
2625
|
}
|
@@ -2647,7 +2679,7 @@
|
|
2647
2679
|
module.set.scrollPosition($nextValue);
|
2648
2680
|
$selectedItem.removeClass(className.selected);
|
2649
2681
|
$nextValue.addClass(className.selected);
|
2650
|
-
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
2682
|
+
if (settings.selectOnKeydown && module.is.single() && (!$nextItem || !$nextItem.hasClass(className.actionable))) {
|
2651
2683
|
module.set.selectedItem($nextValue);
|
2652
2684
|
}
|
2653
2685
|
}
|
@@ -2768,19 +2800,27 @@
|
|
2768
2800
|
$selectedItem = settings.allowAdditions
|
2769
2801
|
? $selectedItem || module.get.itemWithAdditions(value)
|
2770
2802
|
: $selectedItem || module.get.item(value);
|
2771
|
-
if (!$selectedItem) {
|
2803
|
+
if (!$selectedItem && value !== undefined) {
|
2772
2804
|
return false;
|
2773
2805
|
}
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2806
|
+
if (isMultiple) {
|
2807
|
+
if (!keepSearchTerm) {
|
2808
|
+
module.remove.searchWidth();
|
2809
|
+
}
|
2810
|
+
if (settings.useLabels) {
|
2811
|
+
module.remove.selectedItem();
|
2812
|
+
if (value === undefined) {
|
2813
|
+
module.remove.labels($module.find(selector.label), true);
|
2814
|
+
}
|
2815
|
+
}
|
2816
|
+
} else {
|
2779
2817
|
module.remove.activeItem();
|
2780
2818
|
module.remove.selectedItem();
|
2781
|
-
} else if (settings.useLabels) {
|
2782
|
-
module.remove.selectedItem();
|
2783
2819
|
}
|
2820
|
+
if (!$selectedItem) {
|
2821
|
+
return false;
|
2822
|
+
}
|
2823
|
+
module.debug('Setting selected menu item to', $selectedItem);
|
2784
2824
|
// select each item
|
2785
2825
|
$selectedItem
|
2786
2826
|
.each(function () {
|
@@ -3080,6 +3120,12 @@
|
|
3080
3120
|
$item.removeClass(className.active);
|
3081
3121
|
},
|
3082
3122
|
filteredItem: function () {
|
3123
|
+
if (settings.highlightMatches) {
|
3124
|
+
$.each($item, function (index, item) {
|
3125
|
+
var $markItem = $(item);
|
3126
|
+
$markItem.html($markItem.html().replace(/<\/?mark>/g, ''));
|
3127
|
+
});
|
3128
|
+
}
|
3083
3129
|
if (settings.useLabels && module.has.maxSelections()) {
|
3084
3130
|
return;
|
3085
3131
|
}
|
@@ -3424,7 +3470,12 @@
|
|
3424
3470
|
return $selectedMenu.hasClass(className.leftward);
|
3425
3471
|
},
|
3426
3472
|
clearable: function () {
|
3427
|
-
|
3473
|
+
var hasClearableClass = $module.hasClass(className.clearable);
|
3474
|
+
if (!hasClearableClass && settings.clearable) {
|
3475
|
+
$module.addClass(className.clearable);
|
3476
|
+
}
|
3477
|
+
|
3478
|
+
return hasClearableClass || settings.clearable;
|
3428
3479
|
},
|
3429
3480
|
disabled: function () {
|
3430
3481
|
return $module.hasClass(className.disabled);
|
@@ -3747,12 +3798,16 @@
|
|
3747
3798
|
show: function () {
|
3748
3799
|
module.verbose('Delaying show event to ensure user intent');
|
3749
3800
|
clearTimeout(module.timer);
|
3750
|
-
module.timer = setTimeout(function () {
|
3801
|
+
module.timer = setTimeout(function () {
|
3802
|
+
module.show();
|
3803
|
+
}, settings.delay.show);
|
3751
3804
|
},
|
3752
3805
|
hide: function () {
|
3753
3806
|
module.verbose('Delaying hide event to ensure user intent');
|
3754
3807
|
clearTimeout(module.timer);
|
3755
|
-
module.timer = setTimeout(function () {
|
3808
|
+
module.timer = setTimeout(function () {
|
3809
|
+
module.hide();
|
3810
|
+
}, settings.delay.hide);
|
3756
3811
|
},
|
3757
3812
|
},
|
3758
3813
|
|
@@ -3785,6 +3840,7 @@
|
|
3785
3840
|
return text.replace(regExp.escape, '\\$&');
|
3786
3841
|
},
|
3787
3842
|
htmlEntities: function (string, forceAmpersand) {
|
3843
|
+
forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
|
3788
3844
|
var
|
3789
3845
|
badChars = /["'<>`]/g,
|
3790
3846
|
shouldEscape = /["&'<>`]/,
|
@@ -3801,8 +3857,7 @@
|
|
3801
3857
|
;
|
3802
3858
|
if (shouldEscape.test(string)) {
|
3803
3859
|
string = string.replace(forceAmpersand ? /&/g : /&(?![\d#a-z]{1,12};)/gi, '&');
|
3804
|
-
|
3805
|
-
return string.replace(badChars, escapedChar);
|
3860
|
+
string = string.replace(badChars, escapedChar);
|
3806
3861
|
}
|
3807
3862
|
|
3808
3863
|
return string;
|
@@ -3878,7 +3933,9 @@
|
|
3878
3933
|
});
|
3879
3934
|
}
|
3880
3935
|
clearTimeout(module.performance.timer);
|
3881
|
-
module.performance.timer = setTimeout(function () {
|
3936
|
+
module.performance.timer = setTimeout(function () {
|
3937
|
+
module.performance.display();
|
3938
|
+
}, 500);
|
3882
3939
|
},
|
3883
3940
|
display: function () {
|
3884
3941
|
var
|
@@ -4005,6 +4062,7 @@
|
|
4005
4062
|
|
4006
4063
|
match: 'both', // what to match against with search selection (both, text, or label)
|
4007
4064
|
fullTextSearch: 'exact', // search anywhere in value (set to 'exact' to require exact matches)
|
4065
|
+
highlightMatches: false, // Whether search result should highlight matching strings
|
4008
4066
|
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...)
|
4009
4067
|
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)
|
4010
4068
|
|
@@ -4120,9 +4178,11 @@
|
|
4120
4178
|
descriptionVertical: 'descriptionVertical', // whether description should be vertical
|
4121
4179
|
value: 'value', // actual dropdown value
|
4122
4180
|
text: 'text', // displayed text when selected
|
4181
|
+
data: 'data', // custom data attributes
|
4123
4182
|
type: 'type', // type of dropdown element
|
4124
4183
|
image: 'image', // optional image path
|
4125
4184
|
imageClass: 'imageClass', // optional individual class for image
|
4185
|
+
alt: 'alt', // optional alt text for image
|
4126
4186
|
icon: 'icon', // optional icon name
|
4127
4187
|
iconClass: 'iconClass', // optional individual class for icon (for example to use flag instead)
|
4128
4188
|
class: 'class', // optional individual class for item/header
|
@@ -4229,8 +4289,7 @@
|
|
4229
4289
|
;
|
4230
4290
|
if (shouldEscape.test(string)) {
|
4231
4291
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
4232
|
-
|
4233
|
-
return string.replace(badChars, escapedChar);
|
4292
|
+
string = string.replace(badChars, escapedChar);
|
4234
4293
|
}
|
4235
4294
|
|
4236
4295
|
return string;
|
@@ -4265,9 +4324,21 @@
|
|
4265
4324
|
$.each(values, function (index, option) {
|
4266
4325
|
var
|
4267
4326
|
itemType = option[fields.type] || 'item',
|
4268
|
-
isMenu = itemType.indexOf('menu') !== -1
|
4327
|
+
isMenu = itemType.indexOf('menu') !== -1,
|
4328
|
+
maybeData = '',
|
4329
|
+
dataObject = option[fields.data]
|
4269
4330
|
;
|
4270
|
-
|
4331
|
+
if (dataObject) {
|
4332
|
+
var dataKey,
|
4333
|
+
dataKeyEscaped
|
4334
|
+
;
|
4335
|
+
for (dataKey in dataObject) {
|
4336
|
+
dataKeyEscaped = String(dataKey).replace(/\W/g, '');
|
4337
|
+
if (Object.prototype.hasOwnProperty.call(dataObject, dataKey) && ['text', 'value'].indexOf(dataKeyEscaped.toLowerCase()) === -1) {
|
4338
|
+
maybeData += ' data-' + dataKeyEscaped + '="' + deQuote(String(dataObject[dataKey])) + '"';
|
4339
|
+
}
|
4340
|
+
}
|
4341
|
+
}
|
4271
4342
|
if (itemType === 'item' || isMenu) {
|
4272
4343
|
var
|
4273
4344
|
maybeText = option[fields.text]
|
@@ -4284,12 +4355,12 @@
|
|
4284
4355
|
: '',
|
4285
4356
|
hasDescription = escape(option[fields.description] || '', preserveHTML) !== ''
|
4286
4357
|
;
|
4287
|
-
html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + '>';
|
4358
|
+
html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + maybeData + '>';
|
4288
4359
|
if (isMenu) {
|
4289
4360
|
html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
|
4290
4361
|
}
|
4291
4362
|
if (option[fields.image]) {
|
4292
|
-
html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + '">';
|
4363
|
+
html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + (option[fields.alt] ? '" alt="' + deQuote(option[fields.alt]) : '') + '">';
|
4293
4364
|
}
|
4294
4365
|
if (option[fields.icon]) {
|
4295
4366
|
html += '<i class="' + deQuote(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
|