From f81312aeb02ef55affd2ae9e81a9b4cb4c2e6da2 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Fri, 11 Dec 2020 15:55:18 +0100 Subject: [PATCH] feat: query tabs auto focus --- src/renderer/components/QueryEditor.vue | 9 ++++++++- src/renderer/components/WorkspacePropsTable.vue | 8 ++++++-- src/renderer/components/WorkspaceQueryTab.vue | 6 +++++- src/renderer/store/modules/workspaces.store.js | 10 ++++++---- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/QueryEditor.vue b/src/renderer/components/QueryEditor.vue index 321a0c68..bb6dbbed 100644 --- a/src/renderer/components/QueryEditor.vue +++ b/src/renderer/components/QueryEditor.vue @@ -14,7 +14,8 @@ monaco.languages.registerCompletionItemProvider('sql', completionItemProvider(mo export default { name: 'QueryEditor', props: { - value: String + value: String, + autoFocus: { type: Boolean, default: false } }, data () { return { @@ -40,6 +41,12 @@ export default { const content = this.editor.getValue(); this.$emit('update:value', content); }); + + if (this.autoFocus) { + setTimeout(() => { + this.editor.focus(); + }, 20); + } }, beforeDestroy () { this.editor && this.editor.dispose(); diff --git a/src/renderer/components/WorkspacePropsTable.vue b/src/renderer/components/WorkspacePropsTable.vue index 1866c8ef..d6089525 100644 --- a/src/renderer/components/WorkspacePropsTable.vue +++ b/src/renderer/components/WorkspacePropsTable.vue @@ -29,14 +29,14 @@
-
+
{{ $t('word.name') }}
-
+
{{ $t('word.type') }}
@@ -231,4 +231,8 @@ export default { .vscroll { overflow: auto; } + +.min-100 { + min-width: 100px !important; +} diff --git a/src/renderer/components/WorkspaceQueryTab.vue b/src/renderer/components/WorkspaceQueryTab.vue index 0ef68bdf..7ef180c1 100644 --- a/src/renderer/components/WorkspaceQueryTab.vue +++ b/src/renderer/components/WorkspaceQueryTab.vue @@ -1,7 +1,11 @@