mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-17 02:27:36 -03:00
feat(randomizer): add lora pool Vue widget
This commit is contained in:
45
vue-widgets/src/components/lora-pool/shared/EditButton.vue
Normal file
45
vue-widgets/src/components/lora-pool/shared/EditButton.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<button class="edit-button" type="button" @click="$emit('click')">
|
||||
<svg class="edit-button__icon" viewBox="0 0 16 16" fill="currentColor">
|
||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
|
||||
</svg>
|
||||
<span class="edit-button__text">Edit</span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineEmits<{
|
||||
click: []
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 6px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--fg-color);
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
opacity: 0.6;
|
||||
transition: opacity 0.15s;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.edit-button:hover {
|
||||
opacity: 1;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.edit-button__icon {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.edit-button__text {
|
||||
font-weight: 400;
|
||||
}
|
||||
</style>
|
||||
109
vue-widgets/src/components/lora-pool/shared/FilterChip.vue
Normal file
109
vue-widgets/src/components/lora-pool/shared/FilterChip.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<span class="filter-chip" :class="variantClass">
|
||||
<span class="filter-chip__text">{{ label }}</span>
|
||||
<span v-if="count !== undefined" class="filter-chip__count">({{ count }})</span>
|
||||
<button
|
||||
v-if="removable"
|
||||
class="filter-chip__remove"
|
||||
@click.stop="$emit('remove')"
|
||||
type="button"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
label: string
|
||||
count?: number
|
||||
variant?: 'include' | 'exclude' | 'neutral' | 'path'
|
||||
removable?: boolean
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
remove: []
|
||||
}>()
|
||||
|
||||
const variantClass = computed(() => {
|
||||
return props.variant ? `filter-chip--${props.variant}` : ''
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.filter-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
background: var(--comfy-input-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--fg-color);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-chip__text {
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.filter-chip__count {
|
||||
opacity: 0.6;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.filter-chip__remove {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-left: 2px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: inherit;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0.6;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
|
||||
.filter-chip__remove:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Variants */
|
||||
.filter-chip--include {
|
||||
background: rgba(34, 197, 94, 0.15);
|
||||
border-color: rgba(34, 197, 94, 0.4);
|
||||
color: #22c55e;
|
||||
}
|
||||
|
||||
.filter-chip--exclude {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
border-color: rgba(239, 68, 68, 0.4);
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
.filter-chip--neutral {
|
||||
background: rgba(100, 100, 100, 0.3);
|
||||
border-color: rgba(150, 150, 150, 0.4);
|
||||
color: var(--fg-color);
|
||||
}
|
||||
|
||||
.filter-chip--path {
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
color: var(--fg-color);
|
||||
font-family: monospace;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user