@afeefa/vue-app 0.0.111 → 0.0.112
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.112
|
package/package.json
CHANGED
@@ -158,4 +158,8 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin) {
|
|
158
158
|
cursor: pointer;
|
159
159
|
}
|
160
160
|
}
|
161
|
+
|
162
|
+
.v-text-field :deep(.v-input__icon--clear) { // always show clear icon, https://github.com/vuetifyjs/vuetify/pull/15876
|
163
|
+
opacity: 1;
|
164
|
+
}
|
161
165
|
</style>
|
@@ -20,7 +20,7 @@ import { debounce } from '@a-vue/utils/debounce'
|
|
20
20
|
import { ComponentWidthMixin } from './mixins/ComponentWidthMixin'
|
21
21
|
|
22
22
|
@Component({
|
23
|
-
props: ['value', 'debounce', 'validator', 'rules', {dense: true, outlined: true, focus: false, number: false}]
|
23
|
+
props: ['value', 'debounce', 'validator', 'rules', {dense: true, outlined: true, clearable: false, focus: false, number: false}]
|
24
24
|
})
|
25
25
|
export default class ATextField extends Mixins(ComponentWidthMixin) {
|
26
26
|
$hasOptions = ['counter']
|
@@ -71,14 +71,15 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
|
|
71
71
|
|
72
72
|
attrs.dense = this.dense
|
73
73
|
attrs.outlined = this.outlined
|
74
|
+
attrs.clearable = this.clearable
|
74
75
|
return attrs
|
75
76
|
}
|
76
77
|
|
77
78
|
clear () {
|
78
|
-
if (this
|
79
|
+
if (this.clearable) {
|
79
80
|
this.setInternalValue('')
|
80
|
-
this.validate()
|
81
81
|
this.$emit('input', this.emptyValue)
|
82
|
+
this.validate()
|
82
83
|
}
|
83
84
|
}
|
84
85
|
|
@@ -86,12 +87,19 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
|
|
86
87
|
this.$emit('input:internal', this.internalValue)
|
87
88
|
|
88
89
|
const valid = this.validate()
|
90
|
+
|
89
91
|
if (!valid) {
|
90
92
|
return
|
91
93
|
}
|
92
94
|
|
93
95
|
const value = this.stringToNumber(this.internalValue)
|
94
96
|
|
97
|
+
// NaN means: wrong numerical value AND no validator present
|
98
|
+
// otherwise validator would return validate() -> false
|
99
|
+
if (Number.isNaN(value)) {
|
100
|
+
return
|
101
|
+
}
|
102
|
+
|
95
103
|
if (this.debounce) {
|
96
104
|
if (!this.debounceInputFunction) {
|
97
105
|
this.debounceInputFunction = debounce(value => {
|
@@ -44,7 +44,7 @@
|
|
44
44
|
small
|
45
45
|
angular
|
46
46
|
:has="{reset: !!modelToEdit.id}"
|
47
|
-
@save="$emit('save', modelToEdit, ignoreChangesOnClose)"
|
47
|
+
@save="$emit('save', modelToEdit, ignoreChangesOnClose, close)"
|
48
48
|
@reset="$refs.form.reset()"
|
49
49
|
/>
|
50
50
|
</a-row>
|
@@ -68,6 +68,10 @@ export default class EditModal extends Vue {
|
|
68
68
|
ignoreChangesOnClose_ = false
|
69
69
|
|
70
70
|
created () {
|
71
|
+
if (!this.model && !this.createModelToEdit) {
|
72
|
+
console.warn('You need to pass either a model or a model factory to <edit-modal>.')
|
73
|
+
}
|
74
|
+
|
71
75
|
if (this.show) { // open on create with v-show
|
72
76
|
this.open()
|
73
77
|
}
|