@dimailn/vuetify 2.7.2-alpha22 → 2.7.2-alpha23
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/dist/vuetify.js +53 -33
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VForm/VForm.js +44 -30
- package/es5/components/VForm/VForm.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/validatable/index.js +8 -5
- package/es5/mixins/validatable/index.js.map +1 -1
- package/lib/components/VForm/VForm.js +40 -26
- package/lib/components/VForm/VForm.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/validatable/index.js +8 -4
- package/lib/mixins/validatable/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VForm/VForm.ts +61 -35
- package/src/components/VForm/__tests__/VForm.spec.ts +100 -80
- package/src/mixins/validatable/__tests__/validatable.spec.ts +194 -158
- package/src/mixins/validatable/index.ts +16 -18
package/dist/vuetify.js
CHANGED
|
@@ -16141,6 +16141,7 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
16141
16141
|
|
|
16142
16142
|
|
|
16143
16143
|
|
|
16144
|
+
// Helpers
|
|
16144
16145
|
|
|
16145
16146
|
|
|
16146
16147
|
/* @vue/component */
|
|
@@ -16173,39 +16174,50 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
16173
16174
|
handler: function handler(val) {
|
|
16174
16175
|
var errors = Object.values(val).includes(true);
|
|
16175
16176
|
this.$emit('input', !errors);
|
|
16177
|
+
this.$emit('update:modelValue', !errors);
|
|
16176
16178
|
},
|
|
16177
16179
|
deep: true,
|
|
16178
16180
|
immediate: true
|
|
16179
16181
|
}
|
|
16180
16182
|
},
|
|
16181
16183
|
methods: {
|
|
16184
|
+
getInputUid: function getInputUid(input) {
|
|
16185
|
+
return input.$.uid;
|
|
16186
|
+
},
|
|
16182
16187
|
watchInput: function watchInput(input) {
|
|
16183
16188
|
var _this = this;
|
|
16184
16189
|
|
|
16185
|
-
var
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16190
|
+
var inputId = this.getInputUid(input);
|
|
16191
|
+
|
|
16192
|
+
var createErrorWatcher = function createErrorWatcher(inputComponent) {
|
|
16193
|
+
if (typeof inputComponent.$watch === 'function') {
|
|
16194
|
+
return inputComponent.$watch('hasError', function (hasError) {
|
|
16195
|
+
_this.errorBag[inputId] = hasError;
|
|
16196
|
+
}, {
|
|
16197
|
+
immediate: true
|
|
16198
|
+
});
|
|
16199
|
+
} else {
|
|
16200
|
+
// Fallback для Vue 3
|
|
16201
|
+
return function () {};
|
|
16202
|
+
}
|
|
16191
16203
|
};
|
|
16192
16204
|
|
|
16193
16205
|
var watchers = {
|
|
16194
|
-
_uid:
|
|
16206
|
+
_uid: inputId,
|
|
16195
16207
|
valid: function valid() {},
|
|
16196
16208
|
shouldValidate: function shouldValidate() {}
|
|
16197
16209
|
};
|
|
16198
16210
|
|
|
16199
16211
|
if (this.lazyValidation) {
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
}
|
|
16212
|
+
if (typeof input.$watch === 'function') {
|
|
16213
|
+
watchers.shouldValidate = input.$watch('shouldValidate', function (shouldValidate) {
|
|
16214
|
+
if (!shouldValidate) return;
|
|
16215
|
+
if (_this.errorBag.hasOwnProperty(inputId)) return;
|
|
16216
|
+
watchers.valid = createErrorWatcher(input);
|
|
16217
|
+
});
|
|
16218
|
+
}
|
|
16207
16219
|
} else {
|
|
16208
|
-
watchers.valid =
|
|
16220
|
+
watchers.valid = createErrorWatcher(input);
|
|
16209
16221
|
}
|
|
16210
16222
|
|
|
16211
16223
|
return watchers;
|
|
@@ -16248,26 +16260,29 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
16248
16260
|
this.watchers.push(this.watchInput(input));
|
|
16249
16261
|
},
|
|
16250
16262
|
unregister: function unregister(input) {
|
|
16251
|
-
var
|
|
16252
|
-
|
|
16263
|
+
var _this = this;
|
|
16264
|
+
|
|
16265
|
+
var inputId = this.getInputUid(input);
|
|
16266
|
+
var foundInput = this.inputs.find(function (inputComponent) {
|
|
16267
|
+
return _this.getInputUid(inputComponent) === inputId;
|
|
16253
16268
|
});
|
|
16254
|
-
if (!
|
|
16255
|
-
var
|
|
16256
|
-
return
|
|
16269
|
+
if (!foundInput) return;
|
|
16270
|
+
var inputWatcher = this.watchers.find(function (watcher) {
|
|
16271
|
+
return watcher._uid === inputId;
|
|
16257
16272
|
});
|
|
16258
16273
|
|
|
16259
|
-
if (
|
|
16260
|
-
|
|
16261
|
-
|
|
16274
|
+
if (inputWatcher) {
|
|
16275
|
+
inputWatcher.valid();
|
|
16276
|
+
inputWatcher.shouldValidate();
|
|
16262
16277
|
}
|
|
16263
16278
|
|
|
16264
|
-
this.watchers = this.watchers.filter(function (
|
|
16265
|
-
return
|
|
16279
|
+
this.watchers = this.watchers.filter(function (watcher) {
|
|
16280
|
+
return watcher._uid !== inputId;
|
|
16266
16281
|
});
|
|
16267
|
-
this.inputs = this.inputs.filter(function (
|
|
16268
|
-
return
|
|
16282
|
+
this.inputs = this.inputs.filter(function (inputComponent) {
|
|
16283
|
+
return _this.getInputUid(inputComponent) !== inputId;
|
|
16269
16284
|
});
|
|
16270
|
-
delete this.errorBag[
|
|
16285
|
+
delete this.errorBag[inputId];
|
|
16271
16286
|
}
|
|
16272
16287
|
},
|
|
16273
16288
|
render: function render() {
|
|
@@ -35224,7 +35239,7 @@ function () {
|
|
|
35224
35239
|
|
|
35225
35240
|
Vuetify.install = _install__WEBPACK_IMPORTED_MODULE_0__["install"];
|
|
35226
35241
|
Vuetify.installed = false;
|
|
35227
|
-
Vuetify.version = "2.7.2-
|
|
35242
|
+
Vuetify.version = "2.7.2-alpha22";
|
|
35228
35243
|
Vuetify.config = {
|
|
35229
35244
|
silent: false
|
|
35230
35245
|
};
|
|
@@ -42928,7 +42943,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42928
42943
|
/* harmony import */ var _registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../registrable */ "./src/mixins/registrable/index.ts");
|
|
42929
42944
|
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
|
|
42930
42945
|
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
|
|
42931
|
-
/* harmony import */ var
|
|
42946
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue */ "vue");
|
|
42947
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_5__);
|
|
42932
42948
|
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
42933
42949
|
|
|
42934
42950
|
// Mixins
|
|
@@ -42939,11 +42955,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
42939
42955
|
|
|
42940
42956
|
|
|
42941
42957
|
|
|
42942
|
-
var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], Object(_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('form'), _themeable__WEBPACK_IMPORTED_MODULE_1__["default"]);
|
|
42943
42958
|
/* @vue/component */
|
|
42944
42959
|
|
|
42945
|
-
/* harmony default export */ __webpack_exports__["default"] = (
|
|
42960
|
+
/* harmony default export */ __webpack_exports__["default"] = (Object(vue__WEBPACK_IMPORTED_MODULE_5__["defineComponent"])({
|
|
42946
42961
|
name: 'validatable',
|
|
42962
|
+
extends: Object(_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('form'),
|
|
42963
|
+
mixins: [_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], _themeable__WEBPACK_IMPORTED_MODULE_1__["default"]],
|
|
42947
42964
|
props: {
|
|
42948
42965
|
disabled: {
|
|
42949
42966
|
type: Boolean,
|
|
@@ -42989,6 +43006,8 @@ var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_c
|
|
|
42989
43006
|
}
|
|
42990
43007
|
},
|
|
42991
43008
|
data: function data() {
|
|
43009
|
+
var _a;
|
|
43010
|
+
|
|
42992
43011
|
return {
|
|
42993
43012
|
errorBucket: [],
|
|
42994
43013
|
hasColor: false,
|
|
@@ -42996,7 +43015,7 @@ var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_c
|
|
|
42996
43015
|
hasInput: false,
|
|
42997
43016
|
isFocused: false,
|
|
42998
43017
|
isResetting: false,
|
|
42999
|
-
lazyValue: this.
|
|
43018
|
+
lazyValue: (_a = this.modelValue) !== null && _a !== void 0 ? _a : null,
|
|
43000
43019
|
valid: false
|
|
43001
43020
|
};
|
|
43002
43021
|
},
|
|
@@ -43045,6 +43064,7 @@ var baseMixins = Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_c
|
|
|
43045
43064
|
set: function set(val) {
|
|
43046
43065
|
this.lazyValue = val;
|
|
43047
43066
|
this.$emit('input', val);
|
|
43067
|
+
this.$emit('update:modelValue', val);
|
|
43048
43068
|
}
|
|
43049
43069
|
},
|
|
43050
43070
|
isDisabled: function isDisabled() {
|