Fix all type errors in design system (#3956)

* 📘 Fix type errors in design system

* 🔥 Remove unneeded `?`

* 🔧 Add design system to Vetur

* 📘 Improve typing of `$el`

* ♻️ Address feedback

* 📘 Type leftover `MouseEvent`

* 📘 Type `event.target` properly
This commit is contained in:
Iván Ovejero
2022-08-29 12:21:40 +02:00
committed by GitHub
parent 1e6b1b8227
commit 3ae6450f0b
29 changed files with 153 additions and 104 deletions

View File

@@ -155,7 +155,7 @@ export default mixins(Locale).extend({
this.$emit('validate', !this.validationError);
if (this.focusInitially && this.$refs.input) {
this.$refs.input.focus();
(this.$refs.input as HTMLTextAreaElement).focus();
}
},
computed: {
@@ -186,7 +186,7 @@ export default mixins(Locale).extend({
} as { [key: string]: IValidator | RuleGroup };
if (this.required) {
const error = getValidationError(this.value, validators, validators.REQUIRED as Validator);
const error = getValidationError(this.value, validators, validators.REQUIRED as IValidator);
if (error) {
return error;
}
@@ -199,7 +199,7 @@ export default mixins(Locale).extend({
const error = getValidationError(
this.value,
validators,
validators[rule.name] as Validator,
validators[rule.name] as IValidator,
rule.config,
);
if (error) {
@@ -235,9 +235,9 @@ export default mixins(Locale).extend({
onFocus() {
this.$emit('focus');
},
onEnter(e) {
e.stopPropagation();
e.preventDefault();
onEnter(event: Event) {
event.stopPropagation();
event.preventDefault();
this.$emit('enter');
},
},