vue-tel-input 5.6.3 → 5.10.0
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/LICENSE +0 -0
- package/README.md +2 -2
- package/dist/css/component.css +1 -1
- package/dist/vue-tel-input.common.js +94 -37
- package/dist/vue-tel-input.common.js.map +1 -1
- package/dist/vue-tel-input.css +1 -1
- package/dist/vue-tel-input.umd.js +94 -37
- package/dist/vue-tel-input.umd.js.map +1 -1
- package/dist/vue-tel-input.umd.min.js +1 -1
- package/dist/vue-tel-input.umd.min.js.map +1 -1
- package/dist-modern/css/component.css +1 -1
- package/dist-modern/vue-tel-input.common.js +56 -6
- package/dist-modern/vue-tel-input.common.js.map +1 -1
- package/dist-modern/vue-tel-input.css +1 -1
- package/dist-modern/vue-tel-input.umd.js +56 -6
- package/dist-modern/vue-tel-input.umd.js.map +1 -1
- package/dist-modern/vue-tel-input.umd.min.js +1 -1
- package/dist-modern/vue-tel-input.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -5506,12 +5506,23 @@ var allProps = [{
|
|
|
5506
5506
|
type: Boolean,
|
|
5507
5507
|
description: 'Show flags in the dropdown selection and list',
|
|
5508
5508
|
inDemo: true
|
|
5509
|
+
}, {
|
|
5510
|
+
name: 'dropdownOptions.showSearchBox',
|
|
5511
|
+
default: false,
|
|
5512
|
+
type: Boolean,
|
|
5513
|
+
description: 'Show country search box',
|
|
5514
|
+
inDemo: true
|
|
5509
5515
|
}, {
|
|
5510
5516
|
name: 'dropdownOptions.tabindex',
|
|
5511
5517
|
default: 0,
|
|
5512
5518
|
type: Number,
|
|
5513
5519
|
description: 'Native dropdown <code>tabindex</code> attribute',
|
|
5514
5520
|
inDemo: false
|
|
5521
|
+
}, {
|
|
5522
|
+
name: 'dropdownOptions.width',
|
|
5523
|
+
default: '390px',
|
|
5524
|
+
type: String,
|
|
5525
|
+
description: 'Specify dropdown width'
|
|
5515
5526
|
}, {
|
|
5516
5527
|
name: 'ignoredCountries',
|
|
5517
5528
|
default: [],
|
|
@@ -5667,8 +5678,8 @@ var defaultOptions = [].concat(allProps).reduce(function (prv, crr) {
|
|
|
5667
5678
|
/* harmony default export */ const utils = ({
|
|
5668
5679
|
options: _objectSpread2({}, defaultOptions)
|
|
5669
5680
|
});
|
|
5670
|
-
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
5671
|
-
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['vue-tel-input', _vm.styleClasses, { disabled: _vm.disabled }]},[_c('div',{directives:[{name:"click-outside",rawName:"v-click-outside",value:(_vm.clickedOutside),expression:"clickedOutside"}],class:['vti__dropdown', { open: _vm.open, disabled: _vm.dropdownOptions.disabled }],attrs:{"tabindex":_vm.dropdownOptions.tabindex},on:{"keydown":[_vm.keyboardNav,function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.reset.apply(null, arguments)}],"click":_vm.toggleDropdown}},[_c('span',{staticClass:"vti__selection"},[(_vm.dropdownOptions.showFlags)?_c('
|
|
5681
|
+
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1dc3e612-vue-loader-template"}!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].rules[0].use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/vue-tel-input.vue?vue&type=template&id=0901b80c&
|
|
5682
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['vue-tel-input', _vm.styleClasses, { disabled: _vm.disabled }]},[_c('div',{directives:[{name:"click-outside",rawName:"v-click-outside",value:(_vm.clickedOutside),expression:"clickedOutside"}],class:['vti__dropdown', { open: _vm.open, disabled: _vm.dropdownOptions.disabled }],attrs:{"aria-label":"Country Code Selector","aria-haspopup":"listbox","aria-expanded":_vm.open,"role":"button","tabindex":_vm.dropdownOptions.tabindex},on:{"keydown":[_vm.keyboardNav,function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.toggleDropdown.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.reset.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"tab",9,$event.key,"Tab")){ return null; }return _vm.reset.apply(null, arguments)}],"click":_vm.toggleDropdown}},[_c('span',{staticClass:"vti__selection"},[(_vm.dropdownOptions.showFlags)?_c('span',{class:['vti__flag', _vm.activeCountryCode.toLowerCase()]}):_vm._e(),(_vm.dropdownOptions.showDialCodeInSelection)?_c('span',{staticClass:"vti__country-code"},[_vm._v(" +"+_vm._s(_vm.activeCountry && _vm.activeCountry.dialCode)+" ")]):_vm._e(),_vm._t("arrow-icon",function(){return [_c('span',{staticClass:"vti__dropdown-arrow"},[_vm._v(_vm._s(_vm.open ? "▲" : "▼"))])]},{"open":_vm.open})],2),(_vm.open)?_c('ul',{ref:"list",staticClass:"vti__dropdown-list",class:_vm.dropdownOpenDirection,style:({ width: _vm.dropdownOptions.width }),attrs:{"role":"listbox"}},[(_vm.dropdownOptions.showSearchBox)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.searchQuery),expression:"searchQuery"}],staticClass:"vti__input vti__search_box",attrs:{"aria-label":"Search by country name or country code","placeholder":_vm.sortedCountries[0].name,"type":"text"},domProps:{"value":(_vm.searchQuery)},on:{"input":function($event){if($event.target.composing){ return; }_vm.searchQuery=$event.target.value}}}):_vm._e(),_vm._l((_vm.sortedCountries),function(pb,index){return _c('li',{key:pb.iso2 + (pb.preferred ? '-preferred' : ''),class:['vti__dropdown-item', _vm.getItemClass(index, pb.iso2)],attrs:{"role":"option","tabindex":"-1","aria-selected":_vm.activeCountryCode === pb.iso2 && !pb.preferred},on:{"click":function($event){return _vm.choose(pb)},"mousemove":function($event){_vm.selectedIndex = index}}},[_c('div',{staticClass:"vti__flag-wrapper"},[(_vm.dropdownOptions.showFlags)?_c('span',{class:['vti__flag', pb.iso2.toLowerCase()]}):_vm._e()]),_c('strong',[_vm._v(_vm._s(pb.name))]),(_vm.dropdownOptions.showDialCodeInList)?_c('span',[_vm._v(" +"+_vm._s(pb.dialCode)+" ")]):_vm._e()])})],2):_vm._e()]),((_vm.inputOptions.type)==='checkbox')?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.phone),expression:"phone"}],ref:"input",class:['vti__input', _vm.inputOptions.styleClasses],attrs:{"autocomplete":_vm.inputOptions.autocomplete,"autofocus":_vm.inputOptions.autofocus,"disabled":_vm.disabled,"id":_vm.inputOptions.id,"maxlength":_vm.inputOptions.maxlength,"name":_vm.inputOptions.name,"placeholder":_vm.parsedPlaceholder,"readonly":_vm.inputOptions.readonly,"required":_vm.inputOptions.required,"tabindex":_vm.inputOptions.tabindex,"aria-describedby":_vm.inputOptions['aria-describedby'],"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.phone)?_vm._i(_vm.phone,null)>-1:(_vm.phone)},on:{"blur":_vm.onBlur,"focus":_vm.onFocus,"input":_vm.onInput,"keyup":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onEnter.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.onSpace.apply(null, arguments)}],"change":function($event){var $$a=_vm.phone,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.phone=$$a.concat([$$v]))}else{$$i>-1&&(_vm.phone=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.phone=$$c}}}}):((_vm.inputOptions.type)==='radio')?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.phone),expression:"phone"}],ref:"input",class:['vti__input', _vm.inputOptions.styleClasses],attrs:{"autocomplete":_vm.inputOptions.autocomplete,"autofocus":_vm.inputOptions.autofocus,"disabled":_vm.disabled,"id":_vm.inputOptions.id,"maxlength":_vm.inputOptions.maxlength,"name":_vm.inputOptions.name,"placeholder":_vm.parsedPlaceholder,"readonly":_vm.inputOptions.readonly,"required":_vm.inputOptions.required,"tabindex":_vm.inputOptions.tabindex,"aria-describedby":_vm.inputOptions['aria-describedby'],"type":"radio"},domProps:{"checked":_vm._q(_vm.phone,null)},on:{"blur":_vm.onBlur,"focus":_vm.onFocus,"input":_vm.onInput,"keyup":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onEnter.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.onSpace.apply(null, arguments)}],"change":function($event){_vm.phone=null}}}):_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.phone),expression:"phone"}],ref:"input",class:['vti__input', _vm.inputOptions.styleClasses],attrs:{"autocomplete":_vm.inputOptions.autocomplete,"autofocus":_vm.inputOptions.autofocus,"disabled":_vm.disabled,"id":_vm.inputOptions.id,"maxlength":_vm.inputOptions.maxlength,"name":_vm.inputOptions.name,"placeholder":_vm.parsedPlaceholder,"readonly":_vm.inputOptions.readonly,"required":_vm.inputOptions.required,"tabindex":_vm.inputOptions.tabindex,"aria-describedby":_vm.inputOptions['aria-describedby'],"type":_vm.inputOptions.type},domProps:{"value":(_vm.phone)},on:{"blur":_vm.onBlur,"focus":_vm.onFocus,"input":[function($event){if($event.target.composing){ return; }_vm.phone=$event.target.value},_vm.onInput],"keyup":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onEnter.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.onSpace.apply(null, arguments)}]}}),_vm._t("icon-right")],2)}
|
|
5672
5683
|
var staticRenderFns = []
|
|
5673
5684
|
|
|
5674
5685
|
|
|
@@ -8774,6 +8785,35 @@ var _excluded = ["metadata"];
|
|
|
8774
8785
|
//
|
|
8775
8786
|
//
|
|
8776
8787
|
//
|
|
8788
|
+
//
|
|
8789
|
+
//
|
|
8790
|
+
//
|
|
8791
|
+
//
|
|
8792
|
+
//
|
|
8793
|
+
//
|
|
8794
|
+
//
|
|
8795
|
+
//
|
|
8796
|
+
//
|
|
8797
|
+
//
|
|
8798
|
+
//
|
|
8799
|
+
//
|
|
8800
|
+
//
|
|
8801
|
+
//
|
|
8802
|
+
//
|
|
8803
|
+
//
|
|
8804
|
+
//
|
|
8805
|
+
//
|
|
8806
|
+
//
|
|
8807
|
+
//
|
|
8808
|
+
//
|
|
8809
|
+
//
|
|
8810
|
+
//
|
|
8811
|
+
//
|
|
8812
|
+
//
|
|
8813
|
+
//
|
|
8814
|
+
//
|
|
8815
|
+
//
|
|
8816
|
+
//
|
|
8777
8817
|
|
|
8778
8818
|
|
|
8779
8819
|
|
|
@@ -8913,7 +8953,8 @@ function getDefault(key) {
|
|
|
8913
8953
|
typeToFindInput: '',
|
|
8914
8954
|
typeToFindTimer: null,
|
|
8915
8955
|
dropdownOpenDirection: 'below',
|
|
8916
|
-
parsedPlaceholder: this.inputOptions.placeholder
|
|
8956
|
+
parsedPlaceholder: this.inputOptions.placeholder,
|
|
8957
|
+
searchQuery: ''
|
|
8917
8958
|
};
|
|
8918
8959
|
},
|
|
8919
8960
|
computed: {
|
|
@@ -8959,13 +9000,23 @@ function getDefault(key) {
|
|
|
8959
9000
|
return this.allCountries;
|
|
8960
9001
|
},
|
|
8961
9002
|
sortedCountries: function sortedCountries() {
|
|
9003
|
+
var _this2 = this;
|
|
9004
|
+
|
|
8962
9005
|
// Sort the list countries: from preferred countries to all countries
|
|
8963
9006
|
var preferredCountries = this.getCountries(this.preferredCountries).map(function (country) {
|
|
8964
9007
|
return _objectSpread2(_objectSpread2({}, country), {}, {
|
|
8965
9008
|
preferred: true
|
|
8966
9009
|
});
|
|
8967
9010
|
});
|
|
8968
|
-
|
|
9011
|
+
var countriesList = [].concat(_toConsumableArray(preferredCountries), _toConsumableArray(this.filteredCountries));
|
|
9012
|
+
|
|
9013
|
+
if (!this.dropdownOptions.showSearchBox) {
|
|
9014
|
+
return countriesList;
|
|
9015
|
+
}
|
|
9016
|
+
|
|
9017
|
+
return countriesList.filter(function (c) {
|
|
9018
|
+
return new RegExp(_this2.searchQuery, 'i').test(c.name) || new RegExp(_this2.searchQuery, 'i').test(c.iso2) || new RegExp(_this2.searchQuery, 'i').test(c.dialCode);
|
|
9019
|
+
});
|
|
8969
9020
|
},
|
|
8970
9021
|
phoneObject: function phoneObject() {
|
|
8971
9022
|
var _this$phone, _result$isValid, _result2;
|
|
@@ -9027,7 +9078,7 @@ function getDefault(key) {
|
|
|
9027
9078
|
this.$emit('validate', this.phoneObject);
|
|
9028
9079
|
},
|
|
9029
9080
|
'phoneObject.formatted': function phoneObjectFormatted(value) {
|
|
9030
|
-
var
|
|
9081
|
+
var _this3 = this;
|
|
9031
9082
|
|
|
9032
9083
|
if (!this.autoFormat || this.customValidate) {
|
|
9033
9084
|
return;
|
|
@@ -9036,8 +9087,8 @@ function getDefault(key) {
|
|
|
9036
9087
|
this.emitInput(value);
|
|
9037
9088
|
this.$nextTick(function () {
|
|
9038
9089
|
// In case `v-model` is not set, we need to update the `phone` to be new formatted value
|
|
9039
|
-
if (value && !
|
|
9040
|
-
|
|
9090
|
+
if (value && !_this3.value) {
|
|
9091
|
+
_this3.phone = value;
|
|
9041
9092
|
}
|
|
9042
9093
|
});
|
|
9043
9094
|
},
|
|
@@ -9048,13 +9099,13 @@ function getDefault(key) {
|
|
|
9048
9099
|
this.resetPlaceholder();
|
|
9049
9100
|
},
|
|
9050
9101
|
value: function value(_value, oldValue) {
|
|
9051
|
-
var
|
|
9102
|
+
var _this4 = this;
|
|
9052
9103
|
|
|
9053
9104
|
if (!this.testCharacters()) {
|
|
9054
9105
|
this.$nextTick(function () {
|
|
9055
|
-
|
|
9106
|
+
_this4.phone = oldValue;
|
|
9056
9107
|
|
|
9057
|
-
|
|
9108
|
+
_this4.onInput();
|
|
9058
9109
|
});
|
|
9059
9110
|
} else {
|
|
9060
9111
|
this.phone = _value;
|
|
@@ -9071,7 +9122,7 @@ function getDefault(key) {
|
|
|
9071
9122
|
}
|
|
9072
9123
|
},
|
|
9073
9124
|
mounted: function mounted() {
|
|
9074
|
-
var
|
|
9125
|
+
var _this5 = this;
|
|
9075
9126
|
|
|
9076
9127
|
if (this.value) {
|
|
9077
9128
|
this.phone = this.value.trim();
|
|
@@ -9079,15 +9130,15 @@ function getDefault(key) {
|
|
|
9079
9130
|
|
|
9080
9131
|
this.cleanInvalidCharacters();
|
|
9081
9132
|
this.initializeCountry().then(function () {
|
|
9082
|
-
var
|
|
9133
|
+
var _this5$inputOptions;
|
|
9083
9134
|
|
|
9084
|
-
if (!
|
|
9085
|
-
|
|
9135
|
+
if (!_this5.phone && (_this5$inputOptions = _this5.inputOptions) !== null && _this5$inputOptions !== void 0 && _this5$inputOptions.showDialCode && _this5.activeCountryCode) {
|
|
9136
|
+
_this5.phone = "+".concat(_this5.activeCountryCode);
|
|
9086
9137
|
}
|
|
9087
9138
|
|
|
9088
|
-
|
|
9139
|
+
_this5.$emit('validate', _this5.phoneObject);
|
|
9089
9140
|
}).catch(console.error).then(function () {
|
|
9090
|
-
|
|
9141
|
+
_this5.finishMounted = true;
|
|
9091
9142
|
});
|
|
9092
9143
|
},
|
|
9093
9144
|
methods: {
|
|
@@ -9106,15 +9157,15 @@ function getDefault(key) {
|
|
|
9106
9157
|
// .catch(console.error);
|
|
9107
9158
|
},
|
|
9108
9159
|
initializeCountry: function initializeCountry() {
|
|
9109
|
-
var
|
|
9160
|
+
var _this6 = this;
|
|
9110
9161
|
|
|
9111
9162
|
return new Promise(function (resolve) {
|
|
9112
|
-
var
|
|
9163
|
+
var _this6$phone;
|
|
9113
9164
|
|
|
9114
9165
|
/**
|
|
9115
9166
|
* 1. If the phone included prefix (i.e. +12), try to get the country and set it
|
|
9116
9167
|
*/
|
|
9117
|
-
if (((
|
|
9168
|
+
if (((_this6$phone = _this6.phone) === null || _this6$phone === void 0 ? void 0 : _this6$phone[0]) === '+') {
|
|
9118
9169
|
resolve();
|
|
9119
9170
|
return;
|
|
9120
9171
|
}
|
|
@@ -9123,19 +9174,19 @@ function getDefault(key) {
|
|
|
9123
9174
|
*/
|
|
9124
9175
|
|
|
9125
9176
|
|
|
9126
|
-
if (
|
|
9127
|
-
if (typeof
|
|
9128
|
-
|
|
9177
|
+
if (_this6.defaultCountry) {
|
|
9178
|
+
if (typeof _this6.defaultCountry === 'string') {
|
|
9179
|
+
_this6.choose(_this6.defaultCountry);
|
|
9129
9180
|
|
|
9130
9181
|
resolve();
|
|
9131
9182
|
return;
|
|
9132
9183
|
}
|
|
9133
9184
|
|
|
9134
|
-
if (typeof
|
|
9135
|
-
var country =
|
|
9185
|
+
if (typeof _this6.defaultCountry === 'number') {
|
|
9186
|
+
var country = _this6.findCountryByDialCode(_this6.defaultCountry);
|
|
9136
9187
|
|
|
9137
9188
|
if (country) {
|
|
9138
|
-
|
|
9189
|
+
_this6.choose(country.iso2);
|
|
9139
9190
|
|
|
9140
9191
|
resolve();
|
|
9141
9192
|
return;
|
|
@@ -9143,21 +9194,21 @@ function getDefault(key) {
|
|
|
9143
9194
|
}
|
|
9144
9195
|
}
|
|
9145
9196
|
|
|
9146
|
-
var fallbackCountry =
|
|
9197
|
+
var fallbackCountry = _this6.preferredCountries[0] || _this6.filteredCountries[0];
|
|
9147
9198
|
/**
|
|
9148
9199
|
* 3. Check if fetching country based on user's IP is allowed, set it as the default country
|
|
9149
9200
|
*/
|
|
9150
9201
|
|
|
9151
|
-
if (
|
|
9202
|
+
if (_this6.autoDefaultCountry) {
|
|
9152
9203
|
getCountry().then(function (res) {
|
|
9153
|
-
|
|
9204
|
+
_this6.choose(res || _this6.activeCountryCode);
|
|
9154
9205
|
}).catch(function (error) {
|
|
9155
9206
|
console.warn(error);
|
|
9156
9207
|
/**
|
|
9157
9208
|
* 4. Use the first country from preferred list (if available) or all countries list
|
|
9158
9209
|
*/
|
|
9159
9210
|
|
|
9160
|
-
|
|
9211
|
+
_this6.choose(fallbackCountry);
|
|
9161
9212
|
}).then(function () {
|
|
9162
9213
|
resolve();
|
|
9163
9214
|
});
|
|
@@ -9165,7 +9216,7 @@ function getDefault(key) {
|
|
|
9165
9216
|
/**
|
|
9166
9217
|
* 4. Use the first country from preferred list (if available) or all countries list
|
|
9167
9218
|
*/
|
|
9168
|
-
|
|
9219
|
+
_this6.choose(fallbackCountry);
|
|
9169
9220
|
|
|
9170
9221
|
resolve();
|
|
9171
9222
|
}
|
|
@@ -9176,11 +9227,11 @@ function getDefault(key) {
|
|
|
9176
9227
|
* Get the list of countries from the list of iso2 code
|
|
9177
9228
|
*/
|
|
9178
9229
|
getCountries: function getCountries() {
|
|
9179
|
-
var
|
|
9230
|
+
var _this7 = this;
|
|
9180
9231
|
|
|
9181
9232
|
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9182
9233
|
return list.map(function (countryCode) {
|
|
9183
|
-
return
|
|
9234
|
+
return _this7.findCountry(countryCode);
|
|
9184
9235
|
}).filter(Boolean);
|
|
9185
9236
|
},
|
|
9186
9237
|
findCountry: function findCountry() {
|
|
@@ -9299,18 +9350,21 @@ function getDefault(key) {
|
|
|
9299
9350
|
focus: function focus() {
|
|
9300
9351
|
this.$refs.input.focus();
|
|
9301
9352
|
},
|
|
9302
|
-
toggleDropdown: function toggleDropdown() {
|
|
9303
|
-
|
|
9353
|
+
toggleDropdown: function toggleDropdown(e) {
|
|
9354
|
+
var _e$path, _e$path$;
|
|
9355
|
+
|
|
9356
|
+
if (this.disabled || this.dropdownOptions.disabled || (e === null || e === void 0 ? void 0 : (_e$path = e.path) === null || _e$path === void 0 ? void 0 : (_e$path$ = _e$path[0]) === null || _e$path$ === void 0 ? void 0 : _e$path$.type) === 'text') {
|
|
9304
9357
|
return;
|
|
9305
9358
|
}
|
|
9306
9359
|
|
|
9360
|
+
this.searchQuery = '';
|
|
9307
9361
|
this.open = !this.open;
|
|
9308
9362
|
},
|
|
9309
9363
|
clickedOutside: function clickedOutside() {
|
|
9310
9364
|
this.open = false;
|
|
9311
9365
|
},
|
|
9312
9366
|
keyboardNav: function keyboardNav(e) {
|
|
9313
|
-
var
|
|
9367
|
+
var _this8 = this;
|
|
9314
9368
|
|
|
9315
9369
|
if (e.keyCode === 40) {
|
|
9316
9370
|
// down arrow
|
|
@@ -9324,6 +9378,7 @@ function getDefault(key) {
|
|
|
9324
9378
|
}
|
|
9325
9379
|
|
|
9326
9380
|
var selEle = this.$refs.list.children[this.selectedIndex];
|
|
9381
|
+
selEle.focus();
|
|
9327
9382
|
|
|
9328
9383
|
if (selEle.offsetTop + selEle.clientHeight > this.$refs.list.scrollTop + this.$refs.list.clientHeight) {
|
|
9329
9384
|
this.$refs.list.scrollTop = selEle.offsetTop - this.$refs.list.clientHeight + selEle.clientHeight;
|
|
@@ -9341,6 +9396,8 @@ function getDefault(key) {
|
|
|
9341
9396
|
|
|
9342
9397
|
var _selEle = this.$refs.list.children[this.selectedIndex];
|
|
9343
9398
|
|
|
9399
|
+
_selEle.focus();
|
|
9400
|
+
|
|
9344
9401
|
if (_selEle.offsetTop < this.$refs.list.scrollTop) {
|
|
9345
9402
|
this.$refs.list.scrollTop = _selEle.offsetTop;
|
|
9346
9403
|
}
|
|
@@ -9356,11 +9413,11 @@ function getDefault(key) {
|
|
|
9356
9413
|
this.typeToFindInput += e.key;
|
|
9357
9414
|
clearTimeout(this.typeToFindTimer);
|
|
9358
9415
|
this.typeToFindTimer = setTimeout(function () {
|
|
9359
|
-
|
|
9416
|
+
_this8.typeToFindInput = '';
|
|
9360
9417
|
}, 700); // don't include preferred countries so we jump to the right place in the alphabet
|
|
9361
9418
|
|
|
9362
9419
|
var typedCountryI = this.sortedCountries.slice(this.preferredCountries.length).findIndex(function (c) {
|
|
9363
|
-
return c.name.toLowerCase().startsWith(
|
|
9420
|
+
return c.name.toLowerCase().startsWith(_this8.typeToFindInput);
|
|
9364
9421
|
});
|
|
9365
9422
|
|
|
9366
9423
|
if (typedCountryI >= 0) {
|