vue-tel-input 5.5.0 → 5.6.3
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 +2 -2
- package/dist/css/component.css +1 -1
- package/dist/vue-tel-input.common.js +30 -12
- 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 +30 -12
- 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 +30 -12
- 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 +30 -12
- 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
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img width="
|
|
2
|
+
<img width="100" alt="vue-tel-input-logo" src="https://iamstevendao.github.io/vue-tel-input/hero.png"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# vue-tel-input
|
|
@@ -9,7 +9,7 @@ International Telephone Input with Vue.
|
|
|
9
9
|
[](https://www.npmjs.com/package/vue-tel-input) [](https://github.com/iamstevendao/vue-tel-input)
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<img width="
|
|
12
|
+
<img width="600" alt="In-action GIF" src="https://thumbs.gfycat.com/EducatedPoliteBluefintuna-size_restricted.gif"/>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
## Documentation and Demo
|
package/dist/css/component.css
CHANGED
|
@@ -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.
|
|
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}
|
|
@@ -5472,6 +5472,12 @@ var allProps = [{
|
|
|
5472
5472
|
type: Object,
|
|
5473
5473
|
description: 'Options for dropdown, see below',
|
|
5474
5474
|
inDemo: false
|
|
5475
|
+
}, {
|
|
5476
|
+
name: 'dropdownOptions.disabled',
|
|
5477
|
+
default: false,
|
|
5478
|
+
type: Boolean,
|
|
5479
|
+
description: 'Disable dropdown',
|
|
5480
|
+
inDemo: false
|
|
5475
5481
|
}, {
|
|
5476
5482
|
name: 'dropdownOptions.showDialCodeInList',
|
|
5477
5483
|
default: true,
|
|
@@ -5527,6 +5533,12 @@ var allProps = [{
|
|
|
5527
5533
|
// inDemo: false,
|
|
5528
5534
|
// },
|
|
5529
5535
|
{
|
|
5536
|
+
name: 'inputOptions.aria-describedby',
|
|
5537
|
+
default: '',
|
|
5538
|
+
type: String,
|
|
5539
|
+
description: 'Native input <code>aria-describedby</code> attribute',
|
|
5540
|
+
inDemo: false
|
|
5541
|
+
}, {
|
|
5530
5542
|
name: 'inputOptions.id',
|
|
5531
5543
|
default: '',
|
|
5532
5544
|
type: String,
|
|
@@ -5544,6 +5556,12 @@ var allProps = [{
|
|
|
5544
5556
|
type: String,
|
|
5545
5557
|
description: 'Native input <code>name</code> attribute',
|
|
5546
5558
|
inDemo: false
|
|
5559
|
+
}, {
|
|
5560
|
+
name: 'inputOptions.showDialCode',
|
|
5561
|
+
default: false,
|
|
5562
|
+
type: Boolean,
|
|
5563
|
+
description: 'Show dial code in input',
|
|
5564
|
+
inDemo: false
|
|
5547
5565
|
}, {
|
|
5548
5566
|
name: 'inputOptions.placeholder',
|
|
5549
5567
|
default: 'Enter a phone number',
|
|
@@ -5639,12 +5657,10 @@ var defaultOptions = [].concat(allProps).reduce(function (prv, crr) {
|
|
|
5639
5657
|
/* harmony default export */ const utils = ({
|
|
5640
5658
|
options: _objectSpread2({}, defaultOptions)
|
|
5641
5659
|
});
|
|
5642
|
-
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
5643
|
-
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 }],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.
|
|
5644
|
-
var staticRenderFns = [
|
|
5645
|
-
|
|
5660
|
+
;// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"10391616-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=fbdc7d32&
|
|
5661
|
+
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._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()])}),0):_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)}
|
|
5662
|
+
var staticRenderFns = []
|
|
5646
5663
|
|
|
5647
|
-
;// CONCATENATED MODULE: ./src/components/vue-tel-input.vue?vue&type=template&id=30b1c1c9&
|
|
5648
5664
|
|
|
5649
5665
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
5650
5666
|
|
|
@@ -8747,6 +8763,7 @@ var _excluded = ["metadata"];
|
|
|
8747
8763
|
//
|
|
8748
8764
|
//
|
|
8749
8765
|
//
|
|
8766
|
+
//
|
|
8750
8767
|
|
|
8751
8768
|
|
|
8752
8769
|
|
|
@@ -8994,7 +9011,7 @@ function getDefault(key) {
|
|
|
8994
9011
|
}
|
|
8995
9012
|
},
|
|
8996
9013
|
'phoneObject.countryCode': function phoneObjectCountryCode(value) {
|
|
8997
|
-
this.activeCountryCode = value;
|
|
9014
|
+
this.activeCountryCode = value || '';
|
|
8998
9015
|
},
|
|
8999
9016
|
'phoneObject.valid': function phoneObjectValid() {
|
|
9000
9017
|
this.$emit('validate', this.phoneObject);
|
|
@@ -9085,8 +9102,8 @@ function getDefault(key) {
|
|
|
9085
9102
|
var _this5$phone;
|
|
9086
9103
|
|
|
9087
9104
|
/**
|
|
9088
|
-
|
|
9089
|
-
|
|
9105
|
+
* 1. If the phone included prefix (i.e. +12), try to get the country and set it
|
|
9106
|
+
*/
|
|
9090
9107
|
if (((_this5$phone = _this5.phone) === null || _this5$phone === void 0 ? void 0 : _this5$phone[0]) === '+') {
|
|
9091
9108
|
resolve();
|
|
9092
9109
|
return;
|
|
@@ -9136,8 +9153,8 @@ function getDefault(key) {
|
|
|
9136
9153
|
});
|
|
9137
9154
|
} else {
|
|
9138
9155
|
/**
|
|
9139
|
-
|
|
9140
|
-
|
|
9156
|
+
* 4. Use the first country from preferred list (if available) or all countries list
|
|
9157
|
+
*/
|
|
9141
9158
|
_this5.choose(fallbackCountry);
|
|
9142
9159
|
|
|
9143
9160
|
resolve();
|
|
@@ -9202,11 +9219,12 @@ function getDefault(key) {
|
|
|
9202
9219
|
if ((_this$inputOptions = this.inputOptions) !== null && _this$inputOptions !== void 0 && _this$inputOptions.showDialCode && parsedCountry) {
|
|
9203
9220
|
// Reset phone if the showDialCode is set
|
|
9204
9221
|
this.phone = "+".concat(parsedCountry.dialCode);
|
|
9222
|
+
this.activeCountryCode = parsedCountry.iso2 || '';
|
|
9205
9223
|
return;
|
|
9206
9224
|
} // update value, even if international mode is NOT used
|
|
9207
9225
|
|
|
9208
9226
|
|
|
9209
|
-
this.activeCountryCode = parsedCountry.iso2;
|
|
9227
|
+
this.activeCountryCode = parsedCountry.iso2 || '';
|
|
9210
9228
|
this.emitInput(this.phone);
|
|
9211
9229
|
},
|
|
9212
9230
|
cleanInvalidCharacters: function cleanInvalidCharacters() {
|
|
@@ -9272,7 +9290,7 @@ function getDefault(key) {
|
|
|
9272
9290
|
this.$refs.input.focus();
|
|
9273
9291
|
},
|
|
9274
9292
|
toggleDropdown: function toggleDropdown() {
|
|
9275
|
-
if (this.disabled) {
|
|
9293
|
+
if (this.disabled || this.dropdownOptions.disabled) {
|
|
9276
9294
|
return;
|
|
9277
9295
|
}
|
|
9278
9296
|
|