@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
|
@@ -6,22 +6,19 @@ import { inject as RegistrableInject } from '../registrable'
|
|
|
6
6
|
// Utilities
|
|
7
7
|
import { deepEqual } from '../../util/helpers'
|
|
8
8
|
import { consoleError } from '../../util/console'
|
|
9
|
-
import
|
|
9
|
+
import { defineComponent, PropType } from 'vue'
|
|
10
10
|
|
|
11
11
|
// Types
|
|
12
|
-
import { PropValidator } from 'vue/types/options'
|
|
13
12
|
import { InputMessage, InputValidationRules } from 'vuetify/types'
|
|
14
13
|
|
|
15
|
-
const baseMixins = mixins(
|
|
16
|
-
Colorable,
|
|
17
|
-
RegistrableInject<'form', any>('form'),
|
|
18
|
-
Themeable,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
14
|
/* @vue/component */
|
|
22
|
-
export default
|
|
15
|
+
export default defineComponent({
|
|
23
16
|
name: 'validatable',
|
|
24
17
|
|
|
18
|
+
extends: RegistrableInject<'form', any>('form'),
|
|
19
|
+
|
|
20
|
+
mixins: [Colorable, Themeable],
|
|
21
|
+
|
|
25
22
|
props: {
|
|
26
23
|
disabled: {
|
|
27
24
|
type: Boolean,
|
|
@@ -33,26 +30,26 @@ export default baseMixins.extend({
|
|
|
33
30
|
default: 1,
|
|
34
31
|
},
|
|
35
32
|
errorMessages: {
|
|
36
|
-
type: [String, Array]
|
|
33
|
+
type: [String, Array] as PropType<InputMessage | null>,
|
|
37
34
|
default: () => [],
|
|
38
|
-
}
|
|
35
|
+
},
|
|
39
36
|
messages: {
|
|
40
|
-
type: [String, Array]
|
|
37
|
+
type: [String, Array] as PropType<InputMessage | null>,
|
|
41
38
|
default: () => [],
|
|
42
|
-
}
|
|
39
|
+
},
|
|
43
40
|
readonly: {
|
|
44
41
|
type: Boolean,
|
|
45
42
|
default: null,
|
|
46
43
|
},
|
|
47
44
|
rules: {
|
|
48
|
-
type: Array
|
|
45
|
+
type: Array as PropType<InputValidationRules>,
|
|
49
46
|
default: () => [],
|
|
50
|
-
}
|
|
47
|
+
},
|
|
51
48
|
success: Boolean,
|
|
52
49
|
successMessages: {
|
|
53
|
-
type: [String, Array]
|
|
50
|
+
type: [String, Array] as PropType<InputMessage | null>,
|
|
54
51
|
default: () => [],
|
|
55
|
-
}
|
|
52
|
+
},
|
|
56
53
|
validateOnBlur: Boolean,
|
|
57
54
|
modelValue: { required: false },
|
|
58
55
|
},
|
|
@@ -65,7 +62,7 @@ export default baseMixins.extend({
|
|
|
65
62
|
hasInput: false,
|
|
66
63
|
isFocused: false,
|
|
67
64
|
isResetting: false,
|
|
68
|
-
lazyValue: this.
|
|
65
|
+
lazyValue: this.modelValue ?? null,
|
|
69
66
|
valid: false,
|
|
70
67
|
}
|
|
71
68
|
},
|
|
@@ -128,6 +125,7 @@ export default baseMixins.extend({
|
|
|
128
125
|
this.lazyValue = val
|
|
129
126
|
|
|
130
127
|
this.$emit('input', val)
|
|
128
|
+
this.$emit('update:modelValue', val)
|
|
131
129
|
},
|
|
132
130
|
},
|
|
133
131
|
isDisabled (): boolean {
|