@tak-ps/vue-tabler 3.41.0 → 3.43.0
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/CHANGELOG.md +8 -0
- package/components/input/Input.vue +9 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
## Version History
|
|
12
12
|
|
|
13
|
+
### v3.43.0
|
|
14
|
+
|
|
15
|
+
- :rocket: Reduce number of updates in `Input` and also declare all emits
|
|
16
|
+
|
|
17
|
+
### v3.42.0
|
|
18
|
+
|
|
19
|
+
- :bug: Use intermediary value so v-model can be used on text input
|
|
20
|
+
|
|
13
21
|
### v3.41.0
|
|
14
22
|
|
|
15
23
|
- :arrow_up: TablerInput `submit` event on `enter`
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
<template v-if='!rows || rows <= 1'>
|
|
6
6
|
<input
|
|
7
7
|
:disabled='disabled'
|
|
8
|
-
|
|
9
|
-
@input='event => current = event.target.value'
|
|
8
|
+
v-model='current'
|
|
10
9
|
@keyup.enter='$emit("submit")'
|
|
11
10
|
:type='computed_type'
|
|
12
11
|
:class='{
|
|
@@ -21,8 +20,7 @@
|
|
|
21
20
|
:disabled='disabled'
|
|
22
21
|
:wrap='wrap'
|
|
23
22
|
:rows='rows'
|
|
24
|
-
|
|
25
|
-
@input='event => current = event.target.value'
|
|
23
|
+
v-model='current'
|
|
26
24
|
@keyup.enter='$emit("submit")'
|
|
27
25
|
:type='computed_type'
|
|
28
26
|
:class='{
|
|
@@ -42,7 +40,7 @@ import TablerLabel from '../internal/Label.vue';
|
|
|
42
40
|
|
|
43
41
|
export default {
|
|
44
42
|
name: 'TablerInput',
|
|
45
|
-
emits: ['submit'],
|
|
43
|
+
emits: ['submit', 'update:modelValue'],
|
|
46
44
|
props: {
|
|
47
45
|
modelValue: {
|
|
48
46
|
type: [String, Number],
|
|
@@ -80,7 +78,7 @@ export default {
|
|
|
80
78
|
return {
|
|
81
79
|
help: false,
|
|
82
80
|
internal_error: '',
|
|
83
|
-
current: ''
|
|
81
|
+
current: this.modelValue || ''
|
|
84
82
|
}
|
|
85
83
|
},
|
|
86
84
|
computed: {
|
|
@@ -94,6 +92,11 @@ export default {
|
|
|
94
92
|
}
|
|
95
93
|
},
|
|
96
94
|
watch: {
|
|
95
|
+
modelValue: function() {
|
|
96
|
+
if (this.current !== String(this.modelValue)) {
|
|
97
|
+
this.current = String(this.modelValue);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
97
100
|
current: function() {
|
|
98
101
|
if (typeof this.modelValue === 'number' || this.type === 'number') {
|
|
99
102
|
const current = Number(this.current);
|