mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
Add Clear Functionality in the SearchBox (#1989)
Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: huchenlei <huchenlei@proton.me>
This commit is contained in:
@@ -1,22 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="props.class">
|
<div :class="props.class">
|
||||||
<IconField>
|
<IconField>
|
||||||
<InputIcon :class="props.icon" />
|
|
||||||
<InputText
|
|
||||||
class="search-box-input"
|
|
||||||
:class="{ ['with-filter']: props.filterIcon }"
|
|
||||||
@input="handleInput"
|
|
||||||
:modelValue="props.modelValue"
|
|
||||||
:placeholder="props.placeholder"
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
v-if="props.filterIcon"
|
v-if="props.filterIcon"
|
||||||
class="p-inputicon"
|
class="p-inputicon filter-button"
|
||||||
:icon="props.filterIcon"
|
:icon="props.filterIcon"
|
||||||
text
|
text
|
||||||
severity="contrast"
|
severity="contrast"
|
||||||
@click="$emit('showFilter', $event)"
|
@click="$emit('showFilter', $event)"
|
||||||
/>
|
/>
|
||||||
|
<InputText
|
||||||
|
class="search-box-input w-full"
|
||||||
|
@input="handleInput"
|
||||||
|
:modelValue="props.modelValue"
|
||||||
|
:placeholder="props.placeholder"
|
||||||
|
/>
|
||||||
|
<InputIcon v-if="!props.modelValue" :class="props.icon" />
|
||||||
|
<Button
|
||||||
|
v-if="props.modelValue"
|
||||||
|
class="p-inputicon clear-button"
|
||||||
|
icon="pi pi-times"
|
||||||
|
text
|
||||||
|
severity="contrast"
|
||||||
|
@click="clearSearch"
|
||||||
|
/>
|
||||||
</IconField>
|
</IconField>
|
||||||
<div
|
<div
|
||||||
class="search-filters pt-2 flex flex-wrap gap-2"
|
class="search-filters pt-2 flex flex-wrap gap-2"
|
||||||
@@ -79,21 +86,19 @@ const handleInput = (event: Event) => {
|
|||||||
emit('update:modelValue', target.value)
|
emit('update:modelValue', target.value)
|
||||||
emitSearch(target.value)
|
emitSearch(target.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clearSearch = () => {
|
||||||
|
emit('update:modelValue', '')
|
||||||
|
emitSearch('')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-box-input {
|
:deep(.p-inputtext) {
|
||||||
width: 100%;
|
--p-form-field-padding-x: 0.625rem;
|
||||||
padding-left: 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-box-input.with-filter {
|
|
||||||
padding-right: 36px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-button.p-inputicon {
|
.p-button.p-inputicon {
|
||||||
padding: 0;
|
@apply p-0 w-auto border-none;
|
||||||
width: auto;
|
|
||||||
border: none !important;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5352,6 +5352,9 @@
|
|||||||
},
|
},
|
||||||
"tile_size": {
|
"tile_size": {
|
||||||
"name": "tile_size"
|
"name": "tile_size"
|
||||||
|
},
|
||||||
|
"overlap": {
|
||||||
|
"name": "overlap"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5319,6 +5319,9 @@
|
|||||||
"VAEEncodeTiled": {
|
"VAEEncodeTiled": {
|
||||||
"display_name": "VAEエンコード(タイル)",
|
"display_name": "VAEエンコード(タイル)",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"overlap": {
|
||||||
|
"name": "オーバーラップ"
|
||||||
|
},
|
||||||
"pixels": {
|
"pixels": {
|
||||||
"name": "ピクセル"
|
"name": "ピクセル"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5319,6 +5319,9 @@
|
|||||||
"VAEEncodeTiled": {
|
"VAEEncodeTiled": {
|
||||||
"display_name": "VAE 인코드 (타일)",
|
"display_name": "VAE 인코드 (타일)",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"overlap": {
|
||||||
|
"name": "중첩"
|
||||||
|
},
|
||||||
"pixels": {
|
"pixels": {
|
||||||
"name": "픽셀"
|
"name": "픽셀"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5319,6 +5319,9 @@
|
|||||||
"VAEEncodeTiled": {
|
"VAEEncodeTiled": {
|
||||||
"display_name": "Кодировать VAE (плитками)",
|
"display_name": "Кодировать VAE (плитками)",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"overlap": {
|
||||||
|
"name": "перекрытие"
|
||||||
|
},
|
||||||
"pixels": {
|
"pixels": {
|
||||||
"name": "пиксели"
|
"name": "пиксели"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5319,6 +5319,9 @@
|
|||||||
"VAEEncodeTiled": {
|
"VAEEncodeTiled": {
|
||||||
"display_name": "VAE编码(平铺)",
|
"display_name": "VAE编码(平铺)",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"overlap": {
|
||||||
|
"name": "重叠"
|
||||||
|
},
|
||||||
"pixels": {
|
"pixels": {
|
||||||
"name": "像素"
|
"name": "像素"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user