mirror of
https://github.com/lana-k/sqliteviz.git
synced 2026-11-04 00:39:24 +08:00
@@ -15,15 +15,27 @@
|
|||||||
:iconSize="20"
|
:iconSize="20"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<div :class="['text-field-container', { disabled }]">
|
||||||
type="text"
|
<input
|
||||||
:placeholder="placeholder"
|
type="text"
|
||||||
:class="{ error: errorMsg }"
|
:placeholder="placeholder"
|
||||||
:style="{ width: width }"
|
:class="{ error: errorMsg }"
|
||||||
:value="modelValue"
|
:style="{ width: width }"
|
||||||
:disabled="disabled"
|
:value="modelValue"
|
||||||
@input="$emit('update:modelValue', $event.target.value)"
|
:disabled="disabled"
|
||||||
/>
|
@input="$emit('update:modelValue', $event.target.value)"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
v-if="showClearButton"
|
||||||
|
type="button"
|
||||||
|
:disabled="disabled"
|
||||||
|
class="clear-btn"
|
||||||
|
@click="$emit('update:modelValue', '')"
|
||||||
|
>
|
||||||
|
<i class="myicon myicon-clear" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-show="errorMsg" class="text-field-error">{{ errorMsg }}</div>
|
<div v-show="errorMsg" class="text-field-error">{{ errorMsg }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -42,22 +54,40 @@ export default {
|
|||||||
width: String,
|
width: String,
|
||||||
hint: String,
|
hint: String,
|
||||||
maxHintWidth: { type: String, default: '149px' },
|
maxHintWidth: { type: String, default: '149px' },
|
||||||
disabled: Boolean
|
disabled: Boolean,
|
||||||
|
showClearButton: Boolean
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue']
|
emits: ['update:modelValue']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
input {
|
.text-field-container {
|
||||||
background: var(--color-white);
|
background: var(--color-white);
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--color-border);
|
||||||
color: var(--color-text-base);
|
|
||||||
border-radius: var(--border-radius-medium-2);
|
border-radius: var(--border-radius-medium-2);
|
||||||
height: 36px;
|
height: 36px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-field-container.disabled {
|
||||||
|
background: var(--color-bg-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-field-container.error {
|
||||||
|
border-color: var(--color-text-error);
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
background: inherit;
|
||||||
|
border: none;
|
||||||
|
color: var(--color-text-base);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,15 +100,10 @@ input:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input:disabled {
|
input:disabled {
|
||||||
background: var(--color-bg-light);
|
|
||||||
color: var(--color-text-light-2);
|
color: var(--color-text-light-2);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.error {
|
|
||||||
border-color: var(--color-text-error);
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-field-label {
|
.text-field-label {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--color-text-base);
|
color: var(--color-text-base);
|
||||||
@@ -121,4 +146,22 @@ input.error {
|
|||||||
padding: 6px;
|
padding: 6px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clear-btn {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
color: var(--color-border);
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear-btn i {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear-btn:not(:disabled):hover {
|
||||||
|
color: var(--color-danger);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
width="250px"
|
width="250px"
|
||||||
placeholder="Search nodes..."
|
placeholder="Search nodes..."
|
||||||
:errorMsg="regExpIsValid ? '' : 'Invalid regular expression'"
|
:errorMsg="regExpIsValid ? '' : 'Invalid regular expression'"
|
||||||
|
show-clear-button
|
||||||
class="query-input"
|
class="query-input"
|
||||||
@keydown.enter.prevent="search"
|
@keydown.enter.prevent="search"
|
||||||
@update:model-value="onSearchInput"
|
@update:model-value="onSearchInput"
|
||||||
@@ -199,6 +200,7 @@ export default {
|
|||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: var(--color-border-light);
|
border-color: var(--color-border-light);
|
||||||
border-radius: 0 0 0 4px;
|
border-radius: 0 0 0 4px;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graph-search-panel--search-controls {
|
.graph-search-panel--search-controls {
|
||||||
@@ -213,7 +215,7 @@ export default {
|
|||||||
.close-search-panel :deep(i) {
|
.close-search-panel :deep(i) {
|
||||||
transform: scaleX(-1);
|
transform: scaleX(-1);
|
||||||
}
|
}
|
||||||
.query-input :deep(input) {
|
.query-input :deep(.text-field-container) {
|
||||||
height: 26px;
|
height: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user