Skip to content

Commit 50db225

Browse files
committed
chore: update builds
1 parent 533373a commit 50db225

6 files changed

+60
-11
lines changed

dist/autocomplete.angular.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
minLength: scope.options.minLength,
133133
autoselect: scope.options.autoselect,
134134
autoselectOnBlur: scope.options.autoselectOnBlur,
135+
tabAutocomplete: scope.options.tabAutocomplete,
135136
openOnFocus: scope.options.openOnFocus,
136137
templates: scope.options.templates,
137138
debug: scope.options.debug,
@@ -407,6 +408,7 @@
407408
this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
408409
this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;
409410
this.clearOnSelected = !!o.clearOnSelected;
411+
this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;
410412

411413
o.hint = !!o.hint;
412414

@@ -660,6 +662,12 @@
660662
},
661663

662664
_onTabKeyed: function onTabKeyed(type, $e) {
665+
if (!this.tabAutocomplete) {
666+
// Closing the dropdown enables further tabbing
667+
this.dropdown.close();
668+
return;
669+
}
670+
663671
var datum;
664672

665673
if (datum = this.dropdown.getDatumForCursor()) {
@@ -2319,6 +2327,8 @@
23192327

23202328
this.debounce = o.debounce;
23212329

2330+
this.cache = o.cache !== false;
2331+
23222332
this.templates = getTemplates(o.templates, this.displayFn);
23232333

23242334
this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});
@@ -2390,6 +2400,8 @@
23902400
.html(getSuggestionsHtml.apply(this, renderArgs))
23912401
.prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)
23922402
.append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);
2403+
} else if (suggestions && !Array.isArray(suggestions)) {
2404+
throw new TypeError('suggestions must be an array');
23932405
}
23942406

23952407
if (this.$menu) {
@@ -2517,7 +2529,10 @@
25172529
},
25182530

25192531
shouldFetchFromCache: function shouldFetchFromCache(query) {
2520-
return this.cachedQuery === query && this.cachedSuggestions && this.cachedSuggestions.length;
2532+
return this.cache &&
2533+
this.cachedQuery === query &&
2534+
this.cachedSuggestions &&
2535+
this.cachedSuggestions.length;
25212536
},
25222537

25232538
clearCachedSuggestions: function clearCachedSuggestions() {

dist/autocomplete.angular.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/autocomplete.jquery.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
minLength: o.minLength,
118118
autoselect: o.autoselect,
119119
autoselectOnBlur: o.autoselectOnBlur,
120+
tabAutocomplete: o.tabAutocomplete,
120121
openOnFocus: o.openOnFocus,
121122
templates: o.templates,
122123
debug: o.debug,
@@ -415,6 +416,7 @@
415416
this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
416417
this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;
417418
this.clearOnSelected = !!o.clearOnSelected;
419+
this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;
418420

419421
o.hint = !!o.hint;
420422

@@ -668,6 +670,12 @@
668670
},
669671

670672
_onTabKeyed: function onTabKeyed(type, $e) {
673+
if (!this.tabAutocomplete) {
674+
// Closing the dropdown enables further tabbing
675+
this.dropdown.close();
676+
return;
677+
}
678+
671679
var datum;
672680

673681
if (datum = this.dropdown.getDatumForCursor()) {
@@ -2368,6 +2376,8 @@
23682376

23692377
this.debounce = o.debounce;
23702378

2379+
this.cache = o.cache !== false;
2380+
23712381
this.templates = getTemplates(o.templates, this.displayFn);
23722382

23732383
this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});
@@ -2439,6 +2449,8 @@
24392449
.html(getSuggestionsHtml.apply(this, renderArgs))
24402450
.prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)
24412451
.append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);
2452+
} else if (suggestions && !Array.isArray(suggestions)) {
2453+
throw new TypeError('suggestions must be an array');
24422454
}
24432455

24442456
if (this.$menu) {
@@ -2566,7 +2578,10 @@
25662578
},
25672579

25682580
shouldFetchFromCache: function shouldFetchFromCache(query) {
2569-
return this.cachedQuery === query && this.cachedSuggestions && this.cachedSuggestions.length;
2581+
return this.cache &&
2582+
this.cachedQuery === query &&
2583+
this.cachedSuggestions &&
2584+
this.cachedSuggestions.length;
25702585
},
25712586

25722587
clearCachedSuggestions: function clearCachedSuggestions() {

dist/autocomplete.jquery.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/autocomplete.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ return /******/ (function(modules) { // webpackBootstrap
112112
minLength: options.minLength,
113113
autoselect: options.autoselect,
114114
autoselectOnBlur: options.autoselectOnBlur,
115+
tabAutocomplete: options.tabAutocomplete,
115116
openOnFocus: options.openOnFocus,
116117
templates: options.templates,
117118
debug: options.debug,
@@ -167,7 +168,7 @@ return /******/ (function(modules) { // webpackBootstrap
167168
/* Zepto v1.2.0 - zepto event assets data - zeptojs.com/license */
168169
(function(global, factory) {
169170
module.exports = factory(global);
170-
}(/* this ##### UPDATED: here we want to use window/global instead of this which is the current file context ##### */ window, function(window) {
171+
}(/* this ##### UPDATED: here we want to use window/global instead of this which is the current file context ##### */ window, function(window) {
171172
var Zepto = (function() {
172173
var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,
173174
document = window.document,
@@ -1164,7 +1165,11 @@ return /******/ (function(modules) { // webpackBootstrap
11641165
handler.proxy = function(e){
11651166
e = compatible(e)
11661167
if (e.isImmediatePropagationStopped()) return
1167-
e.data = data
1168+
try {
1169+
var dataPropDescriptor = Object.getOwnPropertyDescriptor(e, 'data')
1170+
if (!dataPropDescriptor || dataPropDescriptor.writable)
1171+
e.data = data
1172+
} catch (e) {} // when using strict mode dataPropDescriptor will be undefined when e is InputEvent (even though data property exists). So we surround with try/catch
11681173
var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))
11691174
if (result === false) e.preventDefault(), e.stopPropagation()
11701175
return result
@@ -1665,6 +1670,7 @@ return /******/ (function(modules) { // webpackBootstrap
16651670
this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
16661671
this.autoWidth = (o.autoWidth === undefined) ? true : !!o.autoWidth;
16671672
this.clearOnSelected = !!o.clearOnSelected;
1673+
this.tabAutocomplete = (o.tabAutocomplete === undefined) ? true : !!o.tabAutocomplete;
16681674

16691675
o.hint = !!o.hint;
16701676

@@ -1918,6 +1924,12 @@ return /******/ (function(modules) { // webpackBootstrap
19181924
},
19191925

19201926
_onTabKeyed: function onTabKeyed(type, $e) {
1927+
if (!this.tabAutocomplete) {
1928+
// Closing the dropdown enables further tabbing
1929+
this.dropdown.close();
1930+
return;
1931+
}
1932+
19211933
var datum;
19221934

19231935
if (datum = this.dropdown.getDatumForCursor()) {
@@ -3618,6 +3630,8 @@ return /******/ (function(modules) { // webpackBootstrap
36183630

36193631
this.debounce = o.debounce;
36203632

3633+
this.cache = o.cache !== false;
3634+
36213635
this.templates = getTemplates(o.templates, this.displayFn);
36223636

36233637
this.css = _.mixin({}, css, o.appendTo ? css.appendTo : {});
@@ -3689,6 +3703,8 @@ return /******/ (function(modules) { // webpackBootstrap
36893703
.html(getSuggestionsHtml.apply(this, renderArgs))
36903704
.prepend(that.templates.header ? getHeaderHtml.apply(this, renderArgs) : null)
36913705
.append(that.templates.footer ? getFooterHtml.apply(this, renderArgs) : null);
3706+
} else if (suggestions && !Array.isArray(suggestions)) {
3707+
throw new TypeError('suggestions must be an array');
36923708
}
36933709

36943710
if (this.$menu) {
@@ -3816,7 +3832,10 @@ return /******/ (function(modules) { // webpackBootstrap
38163832
},
38173833

38183834
shouldFetchFromCache: function shouldFetchFromCache(query) {
3819-
return this.cachedQuery === query && this.cachedSuggestions && this.cachedSuggestions.length;
3835+
return this.cache &&
3836+
this.cachedQuery === query &&
3837+
this.cachedSuggestions &&
3838+
this.cachedSuggestions.length;
38203839
},
38213840

38223841
clearCachedSuggestions: function clearCachedSuggestions() {

dist/autocomplete.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)