mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
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:
@@ -87,22 +87,43 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
focus() {
|
||||
if (this.$refs.innerInput.$el) {
|
||||
// @ts-ignore
|
||||
(this.$refs.innerInput.$el.querySelector(this.type === 'textarea' ? 'textarea' : 'input') as HTMLInputElement).focus();
|
||||
}
|
||||
const innerInput = this.$refs.innerInput as Vue | undefined;
|
||||
|
||||
if (!innerInput) return;
|
||||
|
||||
const inputElement = innerInput.$el.querySelector(
|
||||
this.type === 'textarea' ? 'textarea' : 'input',
|
||||
);
|
||||
|
||||
if (!inputElement) return;
|
||||
|
||||
inputElement.focus();
|
||||
},
|
||||
blur() {
|
||||
if (this.$refs.innerInput.$el) {
|
||||
// @ts-ignore
|
||||
(this.$refs.innerInput.$el.querySelector(this.type === 'textarea' ? 'textarea' : 'input') as HTMLInputElement).blur();
|
||||
}
|
||||
const innerInput = this.$refs.innerInput as Vue | undefined;
|
||||
|
||||
if (!innerInput) return;
|
||||
|
||||
const inputElement = innerInput.$el.querySelector(
|
||||
this.type === 'textarea' ? 'textarea' : 'input',
|
||||
);
|
||||
|
||||
if (!inputElement) return;
|
||||
|
||||
inputElement.blur();
|
||||
},
|
||||
select() {
|
||||
if (this.$refs.innerInput.$el) {
|
||||
// @ts-ignore
|
||||
(this.$refs.innerInput.$el.querySelector(this.type === 'textarea' ? 'textarea' : 'input') as HTMLInputElement).select();
|
||||
}
|
||||
const innerInput = this.$refs.innerInput as Vue | undefined;
|
||||
|
||||
if (!innerInput) return;
|
||||
|
||||
const inputElement = innerInput.$el.querySelector(
|
||||
this.type === 'textarea' ? 'textarea' : 'input',
|
||||
);
|
||||
|
||||
if (!inputElement) return;
|
||||
|
||||
inputElement.select();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user