vue-tel-input 6.0.0-beta.1 → 6.0.0-beta.5

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.
@@ -355,6 +355,12 @@ var allProps = [{
355
355
  type: Object,
356
356
  description: 'Options for dropdown, see below',
357
357
  inDemo: false
358
+ }, {
359
+ name: 'dropdownOptions.disabled',
360
+ default: false,
361
+ type: Boolean,
362
+ description: 'Disable dropdown',
363
+ inDemo: false
358
364
  }, {
359
365
  name: 'dropdownOptions.showDialCodeInList',
360
366
  default: true,
@@ -410,6 +416,12 @@ var allProps = [{
410
416
  // inDemo: false,
411
417
  // },
412
418
  {
419
+ name: 'inputOptions.aria-describedby',
420
+ default: '',
421
+ type: String,
422
+ description: 'Native input <code>aria-describedby</code> attribute',
423
+ inDemo: false
424
+ }, {
413
425
  name: 'inputOptions.id',
414
426
  default: '',
415
427
  type: String,
@@ -427,6 +439,12 @@ var allProps = [{
427
439
  type: String,
428
440
  description: 'Native input <code>name</code> attribute',
429
441
  inDemo: false
442
+ }, {
443
+ name: 'inputOptions.showDialCode',
444
+ default: false,
445
+ type: Boolean,
446
+ description: 'Show dial code in input',
447
+ inDemo: false
430
448
  }, {
431
449
  name: 'inputOptions.placeholder',
432
450
  default: 'Enter a phone number',
@@ -5151,7 +5169,7 @@ var es_function_name = __webpack_require__("b0c0");
5151
5169
  // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
5152
5170
  var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
5153
5171
 
5154
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/vue-tel-input.vue?vue&type=template&id=8d4798ea
5172
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/vue-tel-input.vue?vue&type=template&id=6b666c26
5155
5173
 
5156
5174
 
5157
5175
  var _hoisted_1 = {
@@ -5176,7 +5194,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5176
5194
  }]
5177
5195
  }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
5178
5196
  class: ['vti__dropdown', {
5179
- open: $data.open
5197
+ open: $data.open,
5198
+ disabled: $props.dropdownOptions.disabled
5180
5199
  }],
5181
5200
  tabindex: $props.dropdownOptions.tabindex,
5182
5201
  onKeydown: [_cache[2] || (_cache[2] = function () {
@@ -5230,6 +5249,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5230
5249
  required: $props.inputOptions.required,
5231
5250
  tabindex: $props.inputOptions.tabindex,
5232
5251
  value: $props.modelValue,
5252
+ "aria-describedby": $props.inputOptions['aria-describedby'],
5233
5253
  onBlur: _cache[6] || (_cache[6] = function () {
5234
5254
  return $options.onBlur && $options.onBlur.apply($options, arguments);
5235
5255
  }),
@@ -5244,9 +5264,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5244
5264
  }, ["enter"])), _cache[10] || (_cache[10] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withKeys"])(function () {
5245
5265
  return $options.onSpace && $options.onSpace.apply($options, arguments);
5246
5266
  }, ["space"]))]
5247
- }, null, 42, ["type", "autocomplete", "autofocus", "disabled", "id", "maxlength", "name", "placeholder", "readonly", "required", "tabindex", "value"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelDynamic"], $data.phone]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "icon-right")], 2);
5267
+ }, null, 42, ["type", "autocomplete", "autofocus", "disabled", "id", "maxlength", "name", "placeholder", "readonly", "required", "tabindex", "value", "aria-describedby"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelDynamic"], $data.phone]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "icon-right")], 2);
5248
5268
  }
5249
- // CONCATENATED MODULE: ./src/components/vue-tel-input.vue?vue&type=template&id=8d4798ea
5269
+ // CONCATENATED MODULE: ./src/components/vue-tel-input.vue?vue&type=template&id=6b666c26
5250
5270
 
5251
5271
  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
5252
5272
  var objectWithoutProperties = __webpack_require__("15fd");
@@ -8593,7 +8613,7 @@ function getDefault(key) {
8593
8613
  }
8594
8614
  },
8595
8615
  'phoneObject.countryCode': function phoneObjectCountryCode(value) {
8596
- this.activeCountryCode = value;
8616
+ this.activeCountryCode = value || '';
8597
8617
  },
8598
8618
  'phoneObject.valid': function phoneObjectValid() {
8599
8619
  this.$emit('validate', this.phoneObject);
@@ -8608,7 +8628,7 @@ function getDefault(key) {
8608
8628
  this.emitInput(value);
8609
8629
  this.$nextTick(function () {
8610
8630
  // In case `v-model` is not set, we need to update the `phone` to be new formatted value
8611
- if (value && !_this2.value) {
8631
+ if (value && !_this2.modelValue) {
8612
8632
  _this2.phone = value;
8613
8633
  }
8614
8634
  });
@@ -8645,8 +8665,8 @@ function getDefault(key) {
8645
8665
  mounted: function mounted() {
8646
8666
  var _this4 = this;
8647
8667
 
8648
- if (this.value) {
8649
- this.phone = this.value.trim();
8668
+ if (this.modelValue) {
8669
+ this.phone = this.modelValue.trim();
8650
8670
  }
8651
8671
 
8652
8672
  this.cleanInvalidCharacters();
@@ -8684,8 +8704,8 @@ function getDefault(key) {
8684
8704
  var _this5$phone;
8685
8705
 
8686
8706
  /**
8687
- * 1. If the phone included prefix (i.e. +12), try to get the country and set it
8688
- */
8707
+ * 1. If the phone included prefix (i.e. +12), try to get the country and set it
8708
+ */
8689
8709
  if (((_this5$phone = _this5.phone) === null || _this5$phone === void 0 ? void 0 : _this5$phone[0]) === '+') {
8690
8710
  resolve();
8691
8711
  return;
@@ -8735,8 +8755,8 @@ function getDefault(key) {
8735
8755
  });
8736
8756
  } else {
8737
8757
  /**
8738
- * 4. Use the first country from preferred list (if available) or all countries list
8739
- */
8758
+ * 4. Use the first country from preferred list (if available) or all countries list
8759
+ */
8740
8760
  _this5.choose(fallbackCountry);
8741
8761
 
8742
8762
  resolve();
@@ -8801,11 +8821,12 @@ function getDefault(key) {
8801
8821
  if ((_this$inputOptions = this.inputOptions) !== null && _this$inputOptions !== void 0 && _this$inputOptions.showDialCode && parsedCountry) {
8802
8822
  // Reset phone if the showDialCode is set
8803
8823
  this.phone = "+".concat(parsedCountry.dialCode);
8824
+ this.activeCountryCode = parsedCountry.iso2 || '';
8804
8825
  return;
8805
8826
  } // update value, even if international mode is NOT used
8806
8827
 
8807
8828
 
8808
- this.activeCountryCode = parsedCountry.iso2;
8829
+ this.activeCountryCode = parsedCountry.iso2 || '';
8809
8830
  this.emitInput(this.phone);
8810
8831
  },
8811
8832
  cleanInvalidCharacters: function cleanInvalidCharacters() {
@@ -8872,7 +8893,7 @@ function getDefault(key) {
8872
8893
  this.$refs.input.focus();
8873
8894
  },
8874
8895
  toggleDropdown: function toggleDropdown() {
8875
- if (this.disabled) {
8896
+ if (this.disabled || this.dropdownOptions.disabled) {
8876
8897
  return;
8877
8898
  }
8878
8899