vee-validate 2.2.9 → 2.2.13

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vee-validate v2.2.9
2
+ * vee-validate v2.2.13
3
3
  * (c) 2019 Abdelrahman Awad
4
4
  * @license MIT
5
5
  */
@@ -28,7 +28,7 @@ var isNaN$1 = function (value) {
28
28
  }
29
29
 
30
30
  // eslint-disable-next-line
31
- return value === value;
31
+ return typeof(value) === 'number' && value !== value;
32
32
  };
33
33
 
34
34
  /**
@@ -782,6 +782,10 @@ Dictionary.prototype.setMessage = function setMessage (locale, key, message) {
782
782
  attributes: {}
783
783
  };
784
784
  }
785
+
786
+ if (!this.container[locale].messages) {
787
+ this.container[locale].messages = {};
788
+ }
785
789
 
786
790
  this.container[locale].messages[key] = message;
787
791
  };
@@ -969,12 +973,15 @@ ErrorBag.prototype.clear = function clear (scope) {
969
973
  var this$1 = this;
970
974
 
971
975
  var matchesVM = isNullOrUndefined(this.vmId) ? function () { return true; } : function (i) { return i.vmId === this$1.vmId; };
972
- if (isNullOrUndefined(scope)) {
976
+ var matchesScope = function (i) { return i.scope === scope; };
977
+ if (arguments.length === 0) {
978
+ matchesScope = function () { return true; };
979
+ } else if (isNullOrUndefined(scope)) {
973
980
  scope = null;
974
981
  }
975
982
 
976
983
  for (var i = 0; i < this.items.length; ++i) {
977
- if (matchesVM(this.items[i]) && this.items[i].scope === scope) {
984
+ if (matchesVM(this.items[i]) && matchesScope(this.items[i])) {
978
985
  this.items.splice(i, 1);
979
986
  --i;
980
987
  }
@@ -1418,6 +1425,20 @@ function normalizeSlots (slots, ctx) {
1418
1425
  return arr.concat(slots[key]);
1419
1426
  }, []);
1420
1427
  }
1428
+ function createRenderless (h, children) {
1429
+ // Only render the first item of the node.
1430
+ if (Array.isArray(children) && children[0]) {
1431
+ return children[0];
1432
+ }
1433
+
1434
+ // a single node.
1435
+ if (children) {
1436
+ return children;
1437
+ }
1438
+
1439
+ // No slots, render nothing.
1440
+ return h();
1441
+ }
1421
1442
 
1422
1443
  /**
1423
1444
  * Generates the options required to construct a field.
@@ -1843,7 +1864,7 @@ var prototypeAccessors$1 = { validator: { configurable: true },isRequired: { con
1843
1864
 
1844
1865
  prototypeAccessors$1.validator.get = function () {
1845
1866
  if (!this.vm || !this.vm.$validator) {
1846
- return { validate: function () {} };
1867
+ return { validate: function () { return Promise.resolve(true); } };
1847
1868
  }
1848
1869
 
1849
1870
  return this.vm.$validator;
@@ -1971,6 +1992,8 @@ Field.prototype.isWaitingFor = function isWaitingFor (promise) {
1971
1992
  * Updates the field with changed data.
1972
1993
  */
1973
1994
  Field.prototype.update = function update (options) {
1995
+ var this$1 = this;
1996
+
1974
1997
  this.targetOf = options.targetOf || null;
1975
1998
  this.immediate = options.immediate || this.immediate || false;
1976
1999
  this.persist = options.persist || this.persist || false;
@@ -2004,6 +2027,13 @@ Field.prototype.update = function update (options) {
2004
2027
  this.flags.required = this.isRequired;
2005
2028
  }
2006
2029
 
2030
+ if (Object.keys(options.rules || {}).length === 0 && this.updated) {
2031
+ var resetFlag = this.flags.validated;
2032
+ this.validator.validate(("#" + (this.id))).then(function () {
2033
+ this$1.flags.validated = resetFlag;
2034
+ });
2035
+ }
2036
+
2007
2037
  // validate if it was validated before and field was updated and there was a rules mutation.
2008
2038
  if (this.flags.validated && options.rules !== undefined && this.updated) {
2009
2039
  this.validator.validate(("#" + (this.id)));
@@ -4187,7 +4217,7 @@ var messages = {
4187
4217
  if ( ref === void 0 ) ref = [];
4188
4218
  var decimals = ref[0]; if ( decimals === void 0 ) decimals = '*';
4189
4219
 
4190
- return ("The " + field + " field must be numeric and may contain " + (!decimals || decimals === '*' ? '' : decimals) + " decimal points.");
4220
+ return ("The " + field + " field must be numeric and may contain" + (!decimals || decimals === '*' ? '' : ' ' + decimals) + " decimal points.");
4191
4221
  },
4192
4222
  digits: function (field, ref) {
4193
4223
  var length = ref[0];
@@ -4673,7 +4703,7 @@ function parseTimezone (timezoneString) {
4673
4703
  if (token) {
4674
4704
  hours = parseInt(token[2], 10);
4675
4705
 
4676
- if (!validateTimezone(hours)) {
4706
+ if (!validateTimezone()) {
4677
4707
  return NaN
4678
4708
  }
4679
4709
 
@@ -6349,7 +6379,7 @@ function dateTimeLongFormatter (pattern, formatLong, options) {
6349
6379
  var timePattern = matchResult[2];
6350
6380
 
6351
6381
  if (!timePattern) {
6352
- return dateLongFormatter(pattern, formatLong, options)
6382
+ return dateLongFormatter(pattern, formatLong)
6353
6383
  }
6354
6384
 
6355
6385
  var dateTimeFormat;
@@ -6371,8 +6401,8 @@ function dateTimeLongFormatter (pattern, formatLong, options) {
6371
6401
  }
6372
6402
 
6373
6403
  return dateTimeFormat
6374
- .replace('{{date}}', dateLongFormatter(datePattern, formatLong, options))
6375
- .replace('{{time}}', timeLongFormatter(timePattern, formatLong, options))
6404
+ .replace('{{date}}', dateLongFormatter(datePattern, formatLong))
6405
+ .replace('{{time}}', timeLongFormatter(timePattern, formatLong))
6376
6406
  }
6377
6407
 
6378
6408
  var longFormatters = {
@@ -6908,40 +6938,6 @@ function isBefore (dirtyDate, dirtyDateToCompare, dirtyOptions) {
6908
6938
  return date.getTime() < dateToCompare.getTime()
6909
6939
  }
6910
6940
 
6911
- /**
6912
- * @name isDate
6913
- * @category Common Helpers
6914
- * @summary Is the given value a date?
6915
- *
6916
- * @description
6917
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
6918
- *
6919
- * @param {*} value - the value to check
6920
- * @param {Options} [options] - the object with options. Unused; present for FP submodule compatibility sake. See [Options]{@link https://date-fns.org/docs/Options}
6921
- * @returns {boolean} true if the given value is a date
6922
- * @throws {TypeError} 1 arguments required
6923
- *
6924
- * @example
6925
- * // For a valid date:
6926
- * var result = isDate(new Date())
6927
- * //=> true
6928
- *
6929
- * @example
6930
- * // For an invalid date:
6931
- * var result = isDate(new Date(NaN))
6932
- * //=> true
6933
- *
6934
- * @example
6935
- * // For some value:
6936
- * var result = isDate('2014-02-31')
6937
- * //=> false
6938
- *
6939
- * @example
6940
- * // For an object:
6941
- * var result = isDate({})
6942
- * //=> false
6943
- */
6944
-
6945
6941
  /**
6946
6942
  * @name isEqual
6947
6943
  * @category Common Helpers
@@ -8664,8 +8660,6 @@ function cleanEscapedString$1(input) {
8664
8660
  return input.match(escapedStringRegExp$1)[1].replace(doubleQuoteRegExp$1, "'")
8665
8661
  }
8666
8662
 
8667
- // This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
8668
-
8669
8663
  //
8670
8664
 
8671
8665
  /**
@@ -8996,29 +8990,34 @@ var assertString_1 = createCommonjsModule(function (module, exports) {
8996
8990
  Object.defineProperty(exports, "__esModule", {
8997
8991
  value: true
8998
8992
  });
8993
+ exports.default = assertString;
8999
8994
 
9000
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
8995
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
9001
8996
 
9002
- exports.default = assertString;
9003
8997
  function assertString(input) {
9004
8998
  var isString = typeof input === 'string' || input instanceof String;
9005
8999
 
9006
9000
  if (!isString) {
9007
- var invalidType = void 0;
9001
+ var invalidType;
9002
+
9008
9003
  if (input === null) {
9009
9004
  invalidType = 'null';
9010
9005
  } else {
9011
- invalidType = typeof input === 'undefined' ? 'undefined' : _typeof(input);
9006
+ invalidType = _typeof(input);
9007
+
9012
9008
  if (invalidType === 'object' && input.constructor && input.constructor.hasOwnProperty('name')) {
9013
9009
  invalidType = input.constructor.name;
9014
9010
  } else {
9015
- invalidType = 'a ' + invalidType;
9011
+ invalidType = "a ".concat(invalidType);
9016
9012
  }
9017
9013
  }
9018
- throw new TypeError('Expected string but received ' + invalidType + '.');
9014
+
9015
+ throw new TypeError("Expected string but received ".concat(invalidType, "."));
9019
9016
  }
9020
9017
  }
9021
- module.exports = exports['default'];
9018
+
9019
+ module.exports = exports.default;
9020
+ module.exports.default = exports.default;
9022
9021
  });
9023
9022
 
9024
9023
  unwrapExports(assertString_1);
@@ -9030,9 +9029,7 @@ Object.defineProperty(exports, "__esModule", {
9030
9029
  });
9031
9030
  exports.default = isCreditCard;
9032
9031
 
9033
-
9034
-
9035
- var _assertString2 = _interopRequireDefault(assertString_1);
9032
+ var _assertString = _interopRequireDefault(assertString_1);
9036
9033
 
9037
9034
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9038
9035
 
@@ -9041,20 +9038,25 @@ var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][
9041
9038
  /* eslint-enable max-len */
9042
9039
 
9043
9040
  function isCreditCard(str) {
9044
- (0, _assertString2.default)(str);
9041
+ (0, _assertString.default)(str);
9045
9042
  var sanitized = str.replace(/[- ]+/g, '');
9043
+
9046
9044
  if (!creditCard.test(sanitized)) {
9047
9045
  return false;
9048
9046
  }
9047
+
9049
9048
  var sum = 0;
9050
- var digit = void 0;
9051
- var tmpNum = void 0;
9052
- var shouldDouble = void 0;
9049
+ var digit;
9050
+ var tmpNum;
9051
+ var shouldDouble;
9052
+
9053
9053
  for (var i = sanitized.length - 1; i >= 0; i--) {
9054
9054
  digit = sanitized.substring(i, i + 1);
9055
9055
  tmpNum = parseInt(digit, 10);
9056
+
9056
9057
  if (shouldDouble) {
9057
9058
  tmpNum *= 2;
9059
+
9058
9060
  if (tmpNum >= 10) {
9059
9061
  sum += tmpNum % 10 + 1;
9060
9062
  } else {
@@ -9063,11 +9065,15 @@ function isCreditCard(str) {
9063
9065
  } else {
9064
9066
  sum += tmpNum;
9065
9067
  }
9068
+
9066
9069
  shouldDouble = !shouldDouble;
9067
9070
  }
9071
+
9068
9072
  return !!(sum % 10 === 0 ? sanitized : false);
9069
9073
  }
9070
- module.exports = exports['default'];
9074
+
9075
+ module.exports = exports.default;
9076
+ module.exports.default = exports.default;
9071
9077
  });
9072
9078
 
9073
9079
  var isCreditCard = unwrapExports(isCreditCard_1);
@@ -9233,18 +9239,22 @@ Object.defineProperty(exports, "__esModule", {
9233
9239
  value: true
9234
9240
  });
9235
9241
  exports.default = merge;
9242
+
9236
9243
  function merge() {
9237
9244
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9238
- var defaults = arguments[1];
9245
+ var defaults = arguments.length > 1 ? arguments[1] : undefined;
9239
9246
 
9240
9247
  for (var key in defaults) {
9241
9248
  if (typeof obj[key] === 'undefined') {
9242
9249
  obj[key] = defaults[key];
9243
9250
  }
9244
9251
  }
9252
+
9245
9253
  return obj;
9246
9254
  }
9247
- module.exports = exports['default'];
9255
+
9256
+ module.exports = exports.default;
9257
+ module.exports.default = exports.default;
9248
9258
  });
9249
9259
 
9250
9260
  unwrapExports(merge_1);
@@ -9254,23 +9264,21 @@ var isByteLength_1 = createCommonjsModule(function (module, exports) {
9254
9264
  Object.defineProperty(exports, "__esModule", {
9255
9265
  value: true
9256
9266
  });
9257
-
9258
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
9259
-
9260
9267
  exports.default = isByteLength;
9261
9268
 
9262
-
9263
-
9264
- var _assertString2 = _interopRequireDefault(assertString_1);
9269
+ var _assertString = _interopRequireDefault(assertString_1);
9265
9270
 
9266
9271
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9267
9272
 
9273
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
9274
+
9268
9275
  /* eslint-disable prefer-rest-params */
9269
9276
  function isByteLength(str, options) {
9270
- (0, _assertString2.default)(str);
9271
- var min = void 0;
9272
- var max = void 0;
9273
- if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
9277
+ (0, _assertString.default)(str);
9278
+ var min;
9279
+ var max;
9280
+
9281
+ if (_typeof(options) === 'object') {
9274
9282
  min = options.min || 0;
9275
9283
  max = options.max;
9276
9284
  } else {
@@ -9278,10 +9286,13 @@ function isByteLength(str, options) {
9278
9286
  min = arguments[1];
9279
9287
  max = arguments[2];
9280
9288
  }
9289
+
9281
9290
  var len = encodeURI(str).split(/%..|./).length - 1;
9282
9291
  return len >= min && (typeof max === 'undefined' || len <= max);
9283
9292
  }
9284
- module.exports = exports['default'];
9293
+
9294
+ module.exports = exports.default;
9295
+ module.exports.default = exports.default;
9285
9296
  });
9286
9297
 
9287
9298
  unwrapExports(isByteLength_1);
@@ -9293,13 +9304,9 @@ Object.defineProperty(exports, "__esModule", {
9293
9304
  });
9294
9305
  exports.default = isFQDN;
9295
9306
 
9307
+ var _assertString = _interopRequireDefault(assertString_1);
9296
9308
 
9297
-
9298
- var _assertString2 = _interopRequireDefault(assertString_1);
9299
-
9300
-
9301
-
9302
- var _merge2 = _interopRequireDefault(merge_1);
9309
+ var _merge = _interopRequireDefault(merge_1);
9303
9310
 
9304
9311
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9305
9312
 
@@ -9310,48 +9317,61 @@ var default_fqdn_options = {
9310
9317
  };
9311
9318
 
9312
9319
  function isFQDN(str, options) {
9313
- (0, _assertString2.default)(str);
9314
- options = (0, _merge2.default)(options, default_fqdn_options);
9315
-
9320
+ (0, _assertString.default)(str);
9321
+ options = (0, _merge.default)(options, default_fqdn_options);
9316
9322
  /* Remove the optional trailing dot before checking validity */
9323
+
9317
9324
  if (options.allow_trailing_dot && str[str.length - 1] === '.') {
9318
9325
  str = str.substring(0, str.length - 1);
9319
9326
  }
9327
+
9320
9328
  var parts = str.split('.');
9329
+
9321
9330
  for (var i = 0; i < parts.length; i++) {
9322
9331
  if (parts[i].length > 63) {
9323
9332
  return false;
9324
9333
  }
9325
9334
  }
9335
+
9326
9336
  if (options.require_tld) {
9327
9337
  var tld = parts.pop();
9338
+
9328
9339
  if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
9329
9340
  return false;
9330
- }
9331
- // disallow spaces
9341
+ } // disallow spaces
9342
+
9343
+
9332
9344
  if (/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(tld)) {
9333
9345
  return false;
9334
9346
  }
9335
9347
  }
9348
+
9336
9349
  for (var part, _i = 0; _i < parts.length; _i++) {
9337
9350
  part = parts[_i];
9351
+
9338
9352
  if (options.allow_underscores) {
9339
9353
  part = part.replace(/_/g, '');
9340
9354
  }
9355
+
9341
9356
  if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) {
9342
9357
  return false;
9343
- }
9344
- // disallow full-width chars
9358
+ } // disallow full-width chars
9359
+
9360
+
9345
9361
  if (/[\uff01-\uff5e]/.test(part)) {
9346
9362
  return false;
9347
9363
  }
9364
+
9348
9365
  if (part[0] === '-' || part[part.length - 1] === '-') {
9349
9366
  return false;
9350
9367
  }
9351
9368
  }
9369
+
9352
9370
  return true;
9353
9371
  }
9354
- module.exports = exports['default'];
9372
+
9373
+ module.exports = exports.default;
9374
+ module.exports.default = exports.default;
9355
9375
  });
9356
9376
 
9357
9377
  var isFQDN = unwrapExports(isFQDN_1);
@@ -9363,9 +9383,7 @@ Object.defineProperty(exports, "__esModule", {
9363
9383
  });
9364
9384
  exports.default = isIP;
9365
9385
 
9366
-
9367
-
9368
- var _assertString2 = _interopRequireDefault(assertString_1);
9386
+ var _assertString = _interopRequireDefault(assertString_1);
9369
9387
 
9370
9388
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9371
9389
 
@@ -9374,15 +9392,16 @@ var ipv6Block = /^[0-9A-F]{1,4}$/i;
9374
9392
 
9375
9393
  function isIP(str) {
9376
9394
  var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
9377
-
9378
- (0, _assertString2.default)(str);
9395
+ (0, _assertString.default)(str);
9379
9396
  version = String(version);
9397
+
9380
9398
  if (!version) {
9381
9399
  return isIP(str, 4) || isIP(str, 6);
9382
9400
  } else if (version === '4') {
9383
9401
  if (!ipv4Maybe.test(str)) {
9384
9402
  return false;
9385
9403
  }
9404
+
9386
9405
  var parts = str.split('.').sort(function (a, b) {
9387
9406
  return a - b;
9388
9407
  });
@@ -9390,18 +9409,19 @@ function isIP(str) {
9390
9409
  } else if (version === '6') {
9391
9410
  var blocks = str.split(':');
9392
9411
  var foundOmissionBlock = false; // marker to indicate ::
9393
-
9394
9412
  // At least some OS accept the last 32 bits of an IPv6 address
9395
9413
  // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says
9396
9414
  // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses,
9397
9415
  // and '::a.b.c.d' is deprecated, but also valid.
9416
+
9398
9417
  var foundIPv4TransitionBlock = isIP(blocks[blocks.length - 1], 4);
9399
9418
  var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8;
9400
9419
 
9401
9420
  if (blocks.length > expectedNumberOfBlocks) {
9402
9421
  return false;
9403
- }
9404
- // initial or final ::
9422
+ } // initial or final ::
9423
+
9424
+
9405
9425
  if (str === '::') {
9406
9426
  return true;
9407
9427
  } else if (str.substr(0, 2) === '::') {
@@ -9421,19 +9441,25 @@ function isIP(str) {
9421
9441
  if (foundOmissionBlock) {
9422
9442
  return false; // multiple :: in address
9423
9443
  }
9444
+
9424
9445
  foundOmissionBlock = true;
9425
9446
  } else if (foundIPv4TransitionBlock && i === blocks.length - 1) ; else if (!ipv6Block.test(blocks[i])) {
9426
9447
  return false;
9427
9448
  }
9428
9449
  }
9450
+
9429
9451
  if (foundOmissionBlock) {
9430
9452
  return blocks.length >= 1;
9431
9453
  }
9454
+
9432
9455
  return blocks.length === expectedNumberOfBlocks;
9433
9456
  }
9457
+
9434
9458
  return false;
9435
9459
  }
9436
- module.exports = exports['default'];
9460
+
9461
+ module.exports = exports.default;
9462
+ module.exports.default = exports.default;
9437
9463
  });
9438
9464
 
9439
9465
  var isIP = unwrapExports(isIP_1);
@@ -9445,25 +9471,15 @@ Object.defineProperty(exports, "__esModule", {
9445
9471
  });
9446
9472
  exports.default = isEmail;
9447
9473
 
9474
+ var _assertString = _interopRequireDefault(assertString_1);
9448
9475
 
9476
+ var _merge = _interopRequireDefault(merge_1);
9449
9477
 
9450
- var _assertString2 = _interopRequireDefault(assertString_1);
9451
-
9452
-
9453
-
9454
- var _merge2 = _interopRequireDefault(merge_1);
9455
-
9456
-
9478
+ var _isByteLength = _interopRequireDefault(isByteLength_1);
9457
9479
 
9458
- var _isByteLength2 = _interopRequireDefault(isByteLength_1);
9480
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
9459
9481
 
9460
-
9461
-
9462
- var _isFQDN2 = _interopRequireDefault(isFQDN_1);
9463
-
9464
-
9465
-
9466
- var _isIP2 = _interopRequireDefault(isIP_1);
9482
+ var _isIP = _interopRequireDefault(isIP_1);
9467
9483
 
9468
9484
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9469
9485
 
@@ -9473,9 +9489,10 @@ var default_email_options = {
9473
9489
  allow_utf8_local_part: true,
9474
9490
  require_tld: true
9475
9491
  };
9476
-
9477
9492
  /* eslint-disable max-len */
9493
+
9478
9494
  /* eslint-disable no-control-regex */
9495
+
9479
9496
  var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
9480
9497
  var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
9481
9498
  var gmailUserPart = /^[a-z\d]+$/;
@@ -9483,14 +9500,16 @@ var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e
9483
9500
  var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
9484
9501
  var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
9485
9502
  /* eslint-enable max-len */
9503
+
9486
9504
  /* eslint-enable no-control-regex */
9487
9505
 
9488
9506
  function isEmail(str, options) {
9489
- (0, _assertString2.default)(str);
9490
- options = (0, _merge2.default)(options, default_email_options);
9507
+ (0, _assertString.default)(str);
9508
+ options = (0, _merge.default)(options, default_email_options);
9491
9509
 
9492
9510
  if (options.require_display_name || options.allow_display_name) {
9493
9511
  var display_email = str.match(displayName);
9512
+
9494
9513
  if (display_email) {
9495
9514
  str = display_email[1];
9496
9515
  } else if (options.require_display_name) {
@@ -9501,7 +9520,6 @@ function isEmail(str, options) {
9501
9520
  var parts = str.split('@');
9502
9521
  var domain = parts.pop();
9503
9522
  var user = parts.join('@');
9504
-
9505
9523
  var lower_domain = domain.toLowerCase();
9506
9524
 
9507
9525
  if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
@@ -9512,17 +9530,19 @@ function isEmail(str, options) {
9512
9530
  Gmail only normalizes single dots, removing them from here is pointless,
9513
9531
  should be done in normalizeEmail
9514
9532
  */
9515
- user = user.toLowerCase();
9533
+ user = user.toLowerCase(); // Removing sub-address from username before gmail validation
9516
9534
 
9517
- // Removing sub-address from username before gmail validation
9518
- var username = user.split('+')[0];
9535
+ var username = user.split('+')[0]; // Dots are not included in gmail length restriction
9519
9536
 
9520
- // Dots are not included in gmail length restriction
9521
- if (!(0, _isByteLength2.default)(username.replace('.', ''), { min: 6, max: 30 })) {
9537
+ if (!(0, _isByteLength.default)(username.replace('.', ''), {
9538
+ min: 6,
9539
+ max: 30
9540
+ })) {
9522
9541
  return false;
9523
9542
  }
9524
9543
 
9525
9544
  var _user_parts = username.split('.');
9545
+
9526
9546
  for (var i = 0; i < _user_parts.length; i++) {
9527
9547
  if (!gmailUserPart.test(_user_parts[i])) {
9528
9548
  return false;
@@ -9530,23 +9550,29 @@ function isEmail(str, options) {
9530
9550
  }
9531
9551
  }
9532
9552
 
9533
- if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
9553
+ if (!(0, _isByteLength.default)(user, {
9554
+ max: 64
9555
+ }) || !(0, _isByteLength.default)(domain, {
9556
+ max: 254
9557
+ })) {
9534
9558
  return false;
9535
9559
  }
9536
9560
 
9537
- if (!(0, _isFQDN2.default)(domain, { require_tld: options.require_tld })) {
9561
+ if (!(0, _isFQDN.default)(domain, {
9562
+ require_tld: options.require_tld
9563
+ })) {
9538
9564
  if (!options.allow_ip_domain) {
9539
9565
  return false;
9540
9566
  }
9541
9567
 
9542
- if (!(0, _isIP2.default)(domain)) {
9568
+ if (!(0, _isIP.default)(domain)) {
9543
9569
  if (!domain.startsWith('[') || !domain.endsWith(']')) {
9544
9570
  return false;
9545
9571
  }
9546
9572
 
9547
9573
  var noBracketdomain = domain.substr(1, domain.length - 2);
9548
9574
 
9549
- if (noBracketdomain.length === 0 || !(0, _isIP2.default)(noBracketdomain)) {
9575
+ if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
9550
9576
  return false;
9551
9577
  }
9552
9578
  }
@@ -9558,8 +9584,8 @@ function isEmail(str, options) {
9558
9584
  }
9559
9585
 
9560
9586
  var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
9561
-
9562
9587
  var user_parts = user.split('.');
9588
+
9563
9589
  for (var _i = 0; _i < user_parts.length; _i++) {
9564
9590
  if (!pattern.test(user_parts[_i])) {
9565
9591
  return false;
@@ -9568,7 +9594,9 @@ function isEmail(str, options) {
9568
9594
 
9569
9595
  return true;
9570
9596
  }
9571
- module.exports = exports['default'];
9597
+
9598
+ module.exports = exports.default;
9599
+ module.exports.default = exports.default;
9572
9600
  });
9573
9601
 
9574
9602
  var isEmail = unwrapExports(isEmail_1);
@@ -9953,21 +9981,13 @@ Object.defineProperty(exports, "__esModule", {
9953
9981
  });
9954
9982
  exports.default = isURL;
9955
9983
 
9984
+ var _assertString = _interopRequireDefault(assertString_1);
9956
9985
 
9986
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
9957
9987
 
9958
- var _assertString2 = _interopRequireDefault(assertString_1);
9959
-
9960
-
9961
-
9962
- var _isFQDN2 = _interopRequireDefault(isFQDN_1);
9963
-
9964
-
9988
+ var _isIP = _interopRequireDefault(isIP_1);
9965
9989
 
9966
- var _isIP2 = _interopRequireDefault(isIP_1);
9967
-
9968
-
9969
-
9970
- var _merge2 = _interopRequireDefault(merge_1);
9990
+ var _merge = _interopRequireDefault(merge_1);
9971
9991
 
9972
9992
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9973
9993
 
@@ -9981,7 +10001,6 @@ var default_url_options = {
9981
10001
  allow_trailing_dot: false,
9982
10002
  allow_protocol_relative_urls: false
9983
10003
  };
9984
-
9985
10004
  var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
9986
10005
 
9987
10006
  function isRegExp(obj) {
@@ -9991,40 +10010,37 @@ function isRegExp(obj) {
9991
10010
  function checkHost(host, matches) {
9992
10011
  for (var i = 0; i < matches.length; i++) {
9993
10012
  var match = matches[i];
10013
+
9994
10014
  if (host === match || isRegExp(match) && match.test(host)) {
9995
10015
  return true;
9996
10016
  }
9997
10017
  }
10018
+
9998
10019
  return false;
9999
10020
  }
10000
10021
 
10001
10022
  function isURL(url, options) {
10002
- (0, _assertString2.default)(url);
10023
+ (0, _assertString.default)(url);
10024
+
10003
10025
  if (!url || url.length >= 2083 || /[\s<>]/.test(url)) {
10004
10026
  return false;
10005
10027
  }
10028
+
10006
10029
  if (url.indexOf('mailto:') === 0) {
10007
10030
  return false;
10008
10031
  }
10009
- options = (0, _merge2.default)(options, default_url_options);
10010
- var protocol = void 0,
10011
- auth = void 0,
10012
- host = void 0,
10013
- hostname = void 0,
10014
- port = void 0,
10015
- port_str = void 0,
10016
- split = void 0,
10017
- ipv6 = void 0;
10018
10032
 
10033
+ options = (0, _merge.default)(options, default_url_options);
10034
+ var protocol, auth, host, hostname, port, port_str, split, ipv6;
10019
10035
  split = url.split('#');
10020
10036
  url = split.shift();
10021
-
10022
10037
  split = url.split('?');
10023
10038
  url = split.shift();
10024
-
10025
10039
  split = url.split('://');
10040
+
10026
10041
  if (split.length > 1) {
10027
10042
  protocol = split.shift().toLowerCase();
10043
+
10028
10044
  if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
10029
10045
  return false;
10030
10046
  }
@@ -10034,8 +10050,10 @@ function isURL(url, options) {
10034
10050
  if (!options.allow_protocol_relative_urls) {
10035
10051
  return false;
10036
10052
  }
10053
+
10037
10054
  split[0] = url.substr(2);
10038
10055
  }
10056
+
10039
10057
  url = split.join('://');
10040
10058
 
10041
10059
  if (url === '') {
@@ -10050,17 +10068,24 @@ function isURL(url, options) {
10050
10068
  }
10051
10069
 
10052
10070
  split = url.split('@');
10071
+
10053
10072
  if (split.length > 1) {
10073
+ if (options.disallow_auth) {
10074
+ return false;
10075
+ }
10076
+
10054
10077
  auth = split.shift();
10078
+
10055
10079
  if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
10056
10080
  return false;
10057
10081
  }
10058
10082
  }
10059
- hostname = split.join('@');
10060
10083
 
10084
+ hostname = split.join('@');
10061
10085
  port_str = null;
10062
10086
  ipv6 = null;
10063
10087
  var ipv6_match = hostname.match(wrapped_ipv6);
10088
+
10064
10089
  if (ipv6_match) {
10065
10090
  host = '';
10066
10091
  ipv6 = ipv6_match[1];
@@ -10068,6 +10093,7 @@ function isURL(url, options) {
10068
10093
  } else {
10069
10094
  split = hostname.split(':');
10070
10095
  host = split.shift();
10096
+
10071
10097
  if (split.length) {
10072
10098
  port_str = split.join(':');
10073
10099
  }
@@ -10075,12 +10101,13 @@ function isURL(url, options) {
10075
10101
 
10076
10102
  if (port_str !== null) {
10077
10103
  port = parseInt(port_str, 10);
10104
+
10078
10105
  if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {
10079
10106
  return false;
10080
10107
  }
10081
10108
  }
10082
10109
 
10083
- if (!(0, _isIP2.default)(host) && !(0, _isFQDN2.default)(host, options) && (!ipv6 || !(0, _isIP2.default)(ipv6, 6))) {
10110
+ if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) {
10084
10111
  return false;
10085
10112
  }
10086
10113
 
@@ -10089,13 +10116,16 @@ function isURL(url, options) {
10089
10116
  if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
10090
10117
  return false;
10091
10118
  }
10119
+
10092
10120
  if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
10093
10121
  return false;
10094
10122
  }
10095
10123
 
10096
10124
  return true;
10097
10125
  }
10098
- module.exports = exports['default'];
10126
+
10127
+ module.exports = exports.default;
10128
+ module.exports.default = exports.default;
10099
10129
  });
10100
10130
 
10101
10131
  var isURL = unwrapExports(isURL_1);
@@ -10355,6 +10385,10 @@ var ValidationProvider = {
10355
10385
  tag: {
10356
10386
  type: String,
10357
10387
  default: 'span'
10388
+ },
10389
+ slim: {
10390
+ type: Boolean,
10391
+ default: false
10358
10392
  }
10359
10393
  },
10360
10394
  watch: {
@@ -10444,7 +10478,7 @@ var ValidationProvider = {
10444
10478
  /* istanbul ignore next */
10445
10479
  if (!isCallable(slot)) {
10446
10480
  if (process.env.NODE_ENV !== 'production') {
10447
- warn('ValidationProvider expects a scoped slot. Did you forget to add "slot-scope" to your slot?');
10481
+ warn('ValidationProvider expects a scoped slot. Did you forget to add "v-slot" to your slot?');
10448
10482
  }
10449
10483
 
10450
10484
  return h(this.tag, this.$slots.default);
@@ -10456,7 +10490,7 @@ var ValidationProvider = {
10456
10490
  addListeners.call(this$1, input);
10457
10491
  });
10458
10492
 
10459
- return h(this.tag, nodes);
10493
+ return this.slim ? createRenderless(h, nodes) : h(this.tag, nodes);
10460
10494
  },
10461
10495
  beforeDestroy: function beforeDestroy () {
10462
10496
  // cleanup reference.
@@ -10725,7 +10759,7 @@ function updateRenderingContextRefs (ctx) {
10725
10759
 
10726
10760
  // vid was changed.
10727
10761
  if (id !== vid && ctx.$_veeObserver.refs[id] === ctx) {
10728
- ctx.$_veeObserver.unsubscribe(ctx);
10762
+ ctx.$_veeObserver.unsubscribe({ vid: id });
10729
10763
  }
10730
10764
 
10731
10765
  ctx.$_veeObserver.subscribe(ctx);
@@ -10810,12 +10844,17 @@ var ValidationObserver = {
10810
10844
  tag: {
10811
10845
  type: String,
10812
10846
  default: 'span'
10847
+ },
10848
+ slim: {
10849
+ type: Boolean,
10850
+ default: false
10813
10851
  }
10814
10852
  },
10815
10853
  data: function () { return ({
10816
10854
  vid: ("obs_" + (OBSERVER_COUNTER++)),
10817
10855
  refs: {},
10818
10856
  observers: [],
10857
+ persistedStore: {}
10819
10858
  }); },
10820
10859
  computed: {
10821
10860
  ctx: function ctx () {
@@ -10828,7 +10867,7 @@ var ValidationObserver = {
10828
10867
 
10829
10868
  return {
10830
10869
  then: function then (thenable) {
10831
- promise.then(function (success) {
10870
+ return promise.then(function (success) {
10832
10871
  if (success && isCallable(thenable)) {
10833
10872
  return Promise.resolve(thenable());
10834
10873
  }
@@ -10841,7 +10880,14 @@ var ValidationObserver = {
10841
10880
  reset: function () { return this$1.reset(); }
10842
10881
  };
10843
10882
 
10844
- return values(this.refs).concat( this.observers ).reduce(function (acc, provider) {
10883
+ return values(this.refs).concat( Object.keys(this.persistedStore).map(function (key) {
10884
+ return {
10885
+ vid: key,
10886
+ flags: this$1.persistedStore[key].flags,
10887
+ messages: this$1.persistedStore[key].errors
10888
+ };
10889
+ }),
10890
+ this.observers ).reduce(function (acc, provider) {
10845
10891
  Object.keys(flagMergingStrategy).forEach(function (flag) {
10846
10892
  var flags = provider.flags || provider.ctx;
10847
10893
  if (!(flag in acc)) {
@@ -10881,16 +10927,12 @@ var ValidationObserver = {
10881
10927
  }
10882
10928
  },
10883
10929
  render: function render (h) {
10884
- var slots = this.$scopedSlots.default;
10885
- this._persistedStore = this._persistedStore || {};
10886
- if (!isCallable(slots)) {
10887
- return h(this.tag, this.$slots.default);
10930
+ var slots = this.$slots.default || this.$scopedSlots.default || [];
10931
+ if (isCallable(slots)) {
10932
+ slots = slots(this.ctx);
10888
10933
  }
10889
10934
 
10890
- return h(this.tag, {
10891
- on: this.$listeners,
10892
- attrs: this.$attrs
10893
- }, slots(this.ctx));
10935
+ return this.slim ? createRenderless(h, slots) : h(this.tag, { on: this.$listeners, attrs: this.$attrs }, slots);
10894
10936
  },
10895
10937
  methods: {
10896
10938
  subscribe: function subscribe (subscriber, kind) {
@@ -10903,7 +10945,7 @@ var ValidationObserver = {
10903
10945
  }
10904
10946
 
10905
10947
  this.refs = Object.assign({}, this.refs, ( obj = {}, obj[subscriber.vid] = subscriber, obj ));
10906
- if (subscriber.persist && this._persistedStore[subscriber.vid]) {
10948
+ if (subscriber.persist && this.persistedStore[subscriber.vid]) {
10907
10949
  this.restoreProviderState(subscriber);
10908
10950
  }
10909
10951
  },
@@ -10928,15 +10970,22 @@ var ValidationObserver = {
10928
10970
  )).then(function (results) { return results.every(function (r) { return r; }); });
10929
10971
  },
10930
10972
  reset: function reset () {
10973
+ var this$1 = this;
10974
+
10975
+ Object.keys(this.persistedStore).forEach(function (key) {
10976
+ this$1.$delete(this$1.persistedStore, key);
10977
+ });
10931
10978
  return values(this.refs).concat( this.observers).forEach(function (ref) { return ref.reset(); });
10932
10979
  },
10933
10980
  restoreProviderState: function restoreProviderState (provider) {
10934
- var state = this._persistedStore[provider.vid];
10981
+ var state = this.persistedStore[provider.vid];
10935
10982
  provider.setFlags(state.flags);
10936
10983
  provider.applyResult(state);
10937
- delete this._persistedStore[provider.vid];
10984
+ this.$delete(this.persistedStore, provider.vid);
10938
10985
  },
10939
10986
  removeProvider: function removeProvider (vid) {
10987
+ var obj;
10988
+
10940
10989
  var provider = this.refs[vid];
10941
10990
  // save it for the next time.
10942
10991
  if (provider && provider.persist) {
@@ -10947,11 +10996,11 @@ var ValidationObserver = {
10947
10996
  }
10948
10997
  }
10949
10998
 
10950
- this._persistedStore[vid] = {
10951
- flags: provider.flags,
10952
- errors: provider.messages,
10953
- failedRules: provider.failedRules
10954
- };
10999
+ this.persistedStore = assign({}, this.persistedStore, ( obj = {}, obj[vid] = {
11000
+ flags: provider.flags,
11001
+ errors: provider.messages,
11002
+ failedRules: provider.failedRules
11003
+ }, obj ));
10955
11004
  }
10956
11005
 
10957
11006
  this.$delete(this.refs, vid);
@@ -11020,7 +11069,7 @@ function withValidation (component, ctxToProps) {
11020
11069
  return hoc;
11021
11070
  }
11022
11071
 
11023
- var version = '2.2.9';
11072
+ var version = '2.2.13';
11024
11073
 
11025
11074
  Object.keys(Rules).forEach(function (rule) {
11026
11075
  Validator.extend(rule, Rules[rule].validate, assign({}, Rules[rule].options, { paramNames: Rules[rule].paramNames }));