mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
fix: reset base components to use default props
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
-->
|
-->
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
v-model="selectedItems"
|
v-model="selectedItems"
|
||||||
v-bind="{ ...$attrs, options: filteredOptions }"
|
v-bind="$attrs"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
unstyled
|
unstyled
|
||||||
:max-selected-labels="0"
|
:max-selected-labels="0"
|
||||||
@@ -100,12 +100,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Fuse from 'fuse.js'
|
|
||||||
import Button from 'primevue/button'
|
import Button from 'primevue/button'
|
||||||
import MultiSelect, {
|
import MultiSelect, {
|
||||||
MultiSelectPassThroughMethodOptions
|
MultiSelectPassThroughMethodOptions
|
||||||
} from 'primevue/multiselect'
|
} from 'primevue/multiselect'
|
||||||
import { computed, toRefs, useAttrs } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
import SearchBox from '@/components/input/SearchBox.vue'
|
import SearchBox from '@/components/input/SearchBox.vue'
|
||||||
import { usePopoverSizing } from '@/composables/usePopoverSizing'
|
import { usePopoverSizing } from '@/composables/usePopoverSizing'
|
||||||
@@ -139,7 +138,6 @@ interface Props {
|
|||||||
// Note: options prop is intentionally omitted.
|
// Note: options prop is intentionally omitted.
|
||||||
// It's passed via $attrs to maximize PrimeVue API compatibility
|
// It's passed via $attrs to maximize PrimeVue API compatibility
|
||||||
}
|
}
|
||||||
const props = defineProps<Props>()
|
|
||||||
const {
|
const {
|
||||||
label,
|
label,
|
||||||
showSearchBox = false,
|
showSearchBox = false,
|
||||||
@@ -154,7 +152,7 @@ const {
|
|||||||
const selectedItems = defineModel<Option[]>({
|
const selectedItems = defineModel<Option[]>({
|
||||||
required: true
|
required: true
|
||||||
})
|
})
|
||||||
const searchQuery = defineModel<string>('searchQuery', { default: '' })
|
const searchQuery = defineModel<string>('searchQuery')
|
||||||
const selectedCount = computed(() => selectedItems.value.length)
|
const selectedCount = computed(() => selectedItems.value.length)
|
||||||
|
|
||||||
const popoverStyle = usePopoverSizing({
|
const popoverStyle = usePopoverSizing({
|
||||||
@@ -185,14 +183,9 @@ const pt = computed(() => ({
|
|||||||
dropdown: {
|
dropdown: {
|
||||||
class: 'flex shrink-0 cursor-pointer items-center justify-center px-3'
|
class: 'flex shrink-0 cursor-pointer items-center justify-center px-3'
|
||||||
},
|
},
|
||||||
listContainer: {
|
|
||||||
style: 'max-height: 460px;'
|
|
||||||
},
|
|
||||||
header: () => ({
|
header: () => ({
|
||||||
class:
|
class:
|
||||||
showSearchBox.value || showSelectedCount.value || showClearButton.value
|
showSearchBox || showSelectedCount || showClearButton ? 'block' : 'hidden'
|
||||||
? 'block'
|
|
||||||
: 'hidden'
|
|
||||||
}),
|
}),
|
||||||
// Overlay & list visuals unchanged
|
// Overlay & list visuals unchanged
|
||||||
overlay: {
|
overlay: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<i :class="icon" class="text-xs text-neutral" />
|
<i :class="icon" class="text-sm text-neutral" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -27,45 +27,4 @@ const { icon, active, onClick } = defineProps<{
|
|||||||
active?: boolean
|
active?: boolean
|
||||||
onClick: () => void
|
onClick: () => void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
// Icon map matching getCategoryIcon function exactly
|
|
||||||
const iconMap = {
|
|
||||||
// Main categories
|
|
||||||
list: ILucideList,
|
|
||||||
'graduation-cap': ILucideGraduationCap,
|
|
||||||
|
|
||||||
// Generation types
|
|
||||||
image: ILucideImage,
|
|
||||||
film: ILucideFilm,
|
|
||||||
box: ILucideBox,
|
|
||||||
'volume-2': ILucideVolume2,
|
|
||||||
|
|
||||||
// API and models
|
|
||||||
'hand-coins': ILucideHandCoins,
|
|
||||||
|
|
||||||
// LLMs and AI
|
|
||||||
'message-square-text': ILucideMessageSquareText,
|
|
||||||
|
|
||||||
// Performance and hardware
|
|
||||||
zap: ILucideZap,
|
|
||||||
command: ILucideCommand,
|
|
||||||
|
|
||||||
// Training
|
|
||||||
dumbbell: ILucideDumbbell,
|
|
||||||
|
|
||||||
// Extensions and tools
|
|
||||||
puzzle: ILucidePuzzle,
|
|
||||||
wrench: ILucideWrench,
|
|
||||||
|
|
||||||
// Fallbacks for common patterns
|
|
||||||
'maximize-2': ILucideMaximize2,
|
|
||||||
'sliders-horizontal': ILucideSlidersHorizontal,
|
|
||||||
'layout-grid': ILucideLayoutGrid,
|
|
||||||
folder: ILucideFolder
|
|
||||||
}
|
|
||||||
|
|
||||||
const iconComponent = computed(() => {
|
|
||||||
if (!icon) return ILucideFolder
|
|
||||||
return iconMap[icon as keyof typeof iconMap] || ILucideFolder
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user