Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(connections):fix some styles #1382

Merged
merged 3 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions src/components/KeyValueEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@
<div class="editor-row" :style="{ 'max-height': maxHeight }">
<div v-for="(item, index) in dataList" class="editor-row" :key="index">
<el-input
:ref="`KeyRef${index}`"
placeholder="Key"
size="mini"
type="textarea"
autosize
resize="none"
:autosize="{ minRows: 1, maxRows: 3 }"
:disabled="disabled"
v-model="item.key"
class="input-prop user-prop-key"
@input="handleInputChange"
/>
<el-input
:ref="`ValueRef${index}`"
placeholder="Value"
size="mini"
type="textarea"
autosize
resize="none"
:autosize="{ minRows: 1, maxRows: 3 }"
:disabled="disabled"
v-model="item.value"
class="input-prop user-prop-value"
Expand Down Expand Up @@ -113,8 +117,33 @@ export default class KeyValueEditor extends Vue {
})
}

private resizeInput() {
interface ResizeTextarea {
resizeTextarea: () => void
}
this.dataList.forEach((_, i) => {
if (this.$refs[`ValueRef${i}`]) {
const valueRef = this.$refs[`ValueRef${i}`]
if (Array.isArray(valueRef)) {
;(valueRef[0] as unknown as ResizeTextarea).resizeTextarea()
}
}
if (this.$refs[`KeyRef${i}`]) {
const keyRef = this.$refs[`KeyRef${i}`]
if (Array.isArray(keyRef)) {
;(keyRef[0] as unknown as ResizeTextarea).resizeTextarea()
}
}
})
}

private created() {
this.processObjToArry()
window.addEventListener('resize', this.resizeInput)
}

private beforeDestroy() {
window.removeEventListener('resize', this.resizeInput)
}
}
</script>
Expand All @@ -135,17 +164,20 @@ export default class KeyValueEditor extends Vue {
.editor-row {
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
&:not(:last-child) {
margin-bottom: 10px;
}
.input-prop {
padding: 0px;
margin-right: 10px;
textarea {
padding: 4px 15px;
background: transparent;
border-radius: 4px;
overflow-y: hidden;
&:hover {
overflow-y: overlay;
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/SubscriptionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,10 @@ export default class SubscriptionsList extends Vue {
padding: 6px 16px;
height: 100%;
overflow-x: hidden;
overflow-y: overlay;
overflow-y: hidden;
&:hover {
overflow-y: overlay;
}
.topics-item {
cursor: pointer;
color: var(--color-text-title);
Expand Down
4 changes: 4 additions & 0 deletions src/views/connections/ConnectionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,10 @@ export default class ConnectionsList extends Vue {
}
.connections-list {
height: calc(100% - 59px);
overflow-y: hidden;
&:hover {
overflow-y: overlay;
}
.connections-list-skeleton {
margin: 0 16px;
}
Expand Down