vue-tel-input 5.6.0 → 5.7.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/README.md +4 -4
- package/dist/css/component.css +1 -1
- package/dist/vue-tel-input.common.js +72 -40
- 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 +72 -40
- 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 +35 -9
- 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 +35 -9
- 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 +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
.vue-tel-input{border-radius:3px;display:flex;border:1px solid #bbb;text-align:left}.vue-tel-input.disabled .dropdown,.vue-tel-input.disabled .selection,.vue-tel-input.disabled input{cursor:no-drop}.vue-tel-input:focus-within{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);border-color:#66afe9}.vti__dropdown{display:flex;flex-direction:column;align-content:center;justify-content:center;position:relative;padding:7px;cursor:pointer}.vti__dropdown.show{max-height:300px;overflow:scroll}.vti__dropdown.disabled,.vti__dropdown.open{background-color:#f3f3f3}.vti__dropdown.disabled{cursor:no-drop;outline:none}.vti__dropdown:hover{background-color:#f3f3f3}.vti__selection{font-size:.8em;display:flex;align-items:center}.vti__selection .vti__country-code{color:#666}.vti__flag{margin-right:5px;margin-left:5px}.vti__dropdown-list{z-index:1;padding:0;margin:0;text-align:left;list-style:none;max-height:200px;overflow-y:scroll;position:absolute;left:-1px;background-color:#fff;border:1px solid #ccc;width:390px}.vti__dropdown-list.below{top:33px}.vti__dropdown-list.above{top:auto;bottom:100%}.vti__dropdown-arrow{transform:scaleY(.5);display:inline-block;color:#666}.vti__dropdown-item{cursor:pointer;padding:4px 15px}.vti__dropdown-item.highlighted{background-color:#f3f3f3}.vti__dropdown-item.last-preferred{border-bottom:1px solid #cacaca}.vti__dropdown-item .vti__flag{display:inline-block;margin-right:5px}.vti__input{border:none;border-radius:0 2px 2px 0;width:100%;outline:none;padding-left:7px}
|
|
1
|
+
.vue-tel-input{border-radius:3px;display:flex;border:1px solid #bbb;text-align:left}.vue-tel-input.disabled .dropdown,.vue-tel-input.disabled .selection,.vue-tel-input.disabled input{cursor:no-drop}.vue-tel-input:focus-within{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);border-color:#66afe9}.vti__dropdown{display:flex;flex-direction:column;align-content:center;justify-content:center;position:relative;padding:7px;cursor:pointer}.vti__dropdown.show{max-height:300px;overflow:scroll}.vti__dropdown.disabled,.vti__dropdown.open{background-color:#f3f3f3}.vti__dropdown.disabled{cursor:no-drop;outline:none}.vti__dropdown:hover{background-color:#f3f3f3}.vti__selection{font-size:.8em;display:flex;align-items:center}.vti__selection .vti__country-code{color:#666}.vti__flag{margin-right:5px;margin-left:5px}.vti__dropdown-list{z-index:1;padding:0;margin:0;text-align:left;list-style:none;max-height:200px;overflow-y:scroll;position:absolute;left:-1px;background-color:#fff;border:1px solid #ccc;width:390px}.vti__dropdown-list.below{top:33px}.vti__dropdown-list.above{top:auto;bottom:100%}.vti__dropdown-arrow{transform:scaleY(.5);display:inline-block;color:#666}.vti__dropdown-item{cursor:pointer;padding:4px 15px}.vti__dropdown-item.highlighted{background-color:#f3f3f3}.vti__dropdown-item.last-preferred{border-bottom:1px solid #cacaca}.vti__dropdown-item .vti__flag{display:inline-block;margin-right:5px}.vti__input{border:none;border-radius:0 2px 2px 0;width:100%;outline:none;padding-left:7px}.vti__search_box{border:1px solid #ccc;width:94%;padding:7px;margin:2px 2px}
|
|
@@ -309,6 +309,12 @@ const allProps = [{
|
|
|
309
309
|
type: Boolean,
|
|
310
310
|
description: 'Show flags in the dropdown selection and list',
|
|
311
311
|
inDemo: true
|
|
312
|
+
}, {
|
|
313
|
+
name: 'dropdownOptions.showSearchBox',
|
|
314
|
+
default: false,
|
|
315
|
+
type: Boolean,
|
|
316
|
+
description: 'Show country search box',
|
|
317
|
+
inDemo: true
|
|
312
318
|
}, {
|
|
313
319
|
name: 'dropdownOptions.tabindex',
|
|
314
320
|
default: 0,
|
|
@@ -369,6 +375,12 @@ const allProps = [{
|
|
|
369
375
|
type: String,
|
|
370
376
|
description: 'Native input <code>name</code> attribute',
|
|
371
377
|
inDemo: false
|
|
378
|
+
}, {
|
|
379
|
+
name: 'inputOptions.showDialCode',
|
|
380
|
+
default: false,
|
|
381
|
+
type: Boolean,
|
|
382
|
+
description: 'Show dial code in input',
|
|
383
|
+
inDemo: false
|
|
372
384
|
}, {
|
|
373
385
|
name: 'inputOptions.placeholder',
|
|
374
386
|
default: 'Enter a phone number',
|
|
@@ -470,13 +482,11 @@ const defaultOptions = [...allProps].reduce((prv, crr) => {
|
|
|
470
482
|
options: { ...defaultOptions
|
|
471
483
|
}
|
|
472
484
|
});
|
|
473
|
-
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
474
|
-
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('div',{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)?_vm.
|
|
475
|
-
var staticRenderFns = [
|
|
485
|
+
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2f9a4d83-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=33071b52&
|
|
486
|
+
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('div',{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},[(_vm.dropdownOptions.showSearchBox)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.searchQuery),expression:"searchQuery"}],staticClass:"vti__input vti__search_box",attrs:{"placeholder":"Search by country name or country code","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)],on:{"click":function($event){return _vm.choose(pb)},"mousemove":function($event){_vm.selectedIndex = index}}},[(_vm.dropdownOptions.showFlags)?_c('div',{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)}
|
|
487
|
+
var staticRenderFns = []
|
|
476
488
|
|
|
477
489
|
|
|
478
|
-
;// CONCATENATED MODULE: ./src/components/vue-tel-input.vue?vue&type=template&id=13c114b8&
|
|
479
|
-
|
|
480
490
|
;// CONCATENATED MODULE: ./node_modules/libphonenumber-js/metadata.min.json.js
|
|
481
491
|
// This file is a workaround for a bug in web browsers' "native"
|
|
482
492
|
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
@@ -3517,6 +3527,13 @@ function getParents(node, memo) {
|
|
|
3517
3527
|
//
|
|
3518
3528
|
//
|
|
3519
3529
|
//
|
|
3530
|
+
//
|
|
3531
|
+
//
|
|
3532
|
+
//
|
|
3533
|
+
//
|
|
3534
|
+
//
|
|
3535
|
+
//
|
|
3536
|
+
//
|
|
3520
3537
|
|
|
3521
3538
|
|
|
3522
3539
|
|
|
@@ -3627,7 +3644,8 @@ function getDefault(key) {
|
|
|
3627
3644
|
typeToFindInput: '',
|
|
3628
3645
|
typeToFindTimer: null,
|
|
3629
3646
|
dropdownOpenDirection: 'below',
|
|
3630
|
-
parsedPlaceholder: this.inputOptions.placeholder
|
|
3647
|
+
parsedPlaceholder: this.inputOptions.placeholder,
|
|
3648
|
+
searchQuery: ''
|
|
3631
3649
|
};
|
|
3632
3650
|
},
|
|
3633
3651
|
|
|
@@ -3675,7 +3693,13 @@ function getDefault(key) {
|
|
|
3675
3693
|
const preferredCountries = this.getCountries(this.preferredCountries).map(country => ({ ...country,
|
|
3676
3694
|
preferred: true
|
|
3677
3695
|
}));
|
|
3678
|
-
|
|
3696
|
+
const countriesList = [...preferredCountries, ...this.filteredCountries];
|
|
3697
|
+
|
|
3698
|
+
if (!this.dropdownOptions.showSearchBox) {
|
|
3699
|
+
return countriesList;
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
return countriesList.filter(c => new RegExp(this.searchQuery, 'i').test(c.name) || new RegExp(this.searchQuery, 'i').test(c.iso2) || new RegExp(this.searchQuery, 'i').test(c.dialCode));
|
|
3679
3703
|
},
|
|
3680
3704
|
|
|
3681
3705
|
phoneObject() {
|
|
@@ -3918,6 +3942,7 @@ function getDefault(key) {
|
|
|
3918
3942
|
if (this.inputOptions?.showDialCode && parsedCountry) {
|
|
3919
3943
|
// Reset phone if the showDialCode is set
|
|
3920
3944
|
this.phone = `+${parsedCountry.dialCode}`;
|
|
3945
|
+
this.activeCountryCode = parsedCountry.iso2 || '';
|
|
3921
3946
|
return;
|
|
3922
3947
|
} // update value, even if international mode is NOT used
|
|
3923
3948
|
|
|
@@ -3997,11 +4022,12 @@ function getDefault(key) {
|
|
|
3997
4022
|
this.$refs.input.focus();
|
|
3998
4023
|
},
|
|
3999
4024
|
|
|
4000
|
-
toggleDropdown() {
|
|
4001
|
-
if (this.disabled || this.dropdownOptions.disabled) {
|
|
4025
|
+
toggleDropdown(e) {
|
|
4026
|
+
if (this.disabled || this.dropdownOptions.disabled || e?.path?.[0]?.type === 'text') {
|
|
4002
4027
|
return;
|
|
4003
4028
|
}
|
|
4004
4029
|
|
|
4030
|
+
this.searchQuery = '';
|
|
4005
4031
|
this.open = !this.open;
|
|
4006
4032
|
},
|
|
4007
4033
|
|