mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
fix: hide label of textarea in right side panel + align switch to the left
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<FloatLabel
|
<FloatLabel
|
||||||
variant="in"
|
variant="in"
|
||||||
|
:unstyled="hideLayoutField"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'rounded-lg space-y-1 focus-within:ring focus-within:ring-component-node-widget-background-highlighted transition-all',
|
'rounded-lg space-y-1 focus-within:ring focus-within:ring-component-node-widget-background-highlighted transition-all',
|
||||||
@@ -23,14 +24,14 @@
|
|||||||
@pointerup.capture.stop
|
@pointerup.capture.stop
|
||||||
@contextmenu.capture.stop
|
@contextmenu.capture.stop
|
||||||
/>
|
/>
|
||||||
<label :for="id">{{ displayName }}</label>
|
<label v-if="!hideLayoutField" :for="id">{{ displayName }}</label>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import FloatLabel from 'primevue/floatlabel'
|
import FloatLabel from 'primevue/floatlabel'
|
||||||
import Textarea from 'primevue/textarea'
|
import Textarea from 'primevue/textarea'
|
||||||
import { computed, useId } from 'vue'
|
import { computed, inject, useId } from 'vue'
|
||||||
|
|
||||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||||
import { cn } from '@/utils/tailwindUtil'
|
import { cn } from '@/utils/tailwindUtil'
|
||||||
@@ -48,6 +49,8 @@ const { widget, placeholder = '' } = defineProps<{
|
|||||||
|
|
||||||
const modelValue = defineModel<string>({ default: '' })
|
const modelValue = defineModel<string>({ default: '' })
|
||||||
|
|
||||||
|
const hideLayoutField = inject<boolean>('hideLayoutField', false)
|
||||||
|
|
||||||
const filteredProps = computed(() =>
|
const filteredProps = computed(() =>
|
||||||
filterWidgetProps(widget.options, INPUT_EXCLUDED_PROPS)
|
filterWidgetProps(widget.options, INPUT_EXCLUDED_PROPS)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<WidgetLayoutField :widget>
|
<WidgetLayoutField :widget>
|
||||||
<div class="ml-auto flex w-fit items-center gap-2">
|
<div
|
||||||
|
:class="
|
||||||
|
cn('flex w-fit items-center gap-2', { 'ml-auto': !hideLayoutField })
|
||||||
|
"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
v-if="stateLabel"
|
v-if="stateLabel"
|
||||||
:class="
|
:class="
|
||||||
@@ -25,7 +29,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ToggleSwitch from 'primevue/toggleswitch'
|
import ToggleSwitch from 'primevue/toggleswitch'
|
||||||
import { computed } from 'vue'
|
import { computed, inject } from 'vue'
|
||||||
|
|
||||||
import type { IWidgetOptions } from '@/lib/litegraph/src/types/widgets'
|
import type { IWidgetOptions } from '@/lib/litegraph/src/types/widgets'
|
||||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||||
@@ -43,6 +47,8 @@ const { widget } = defineProps<{
|
|||||||
|
|
||||||
const modelValue = defineModel<boolean>()
|
const modelValue = defineModel<boolean>()
|
||||||
|
|
||||||
|
const hideLayoutField = inject<boolean>('hideLayoutField', false)
|
||||||
|
|
||||||
const filteredProps = computed(() =>
|
const filteredProps = computed(() =>
|
||||||
filterWidgetProps(widget.options, STANDARD_EXCLUDED_PROPS)
|
filterWidgetProps(widget.options, STANDARD_EXCLUDED_PROPS)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user