mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +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>
|
||||
<FloatLabel
|
||||
variant="in"
|
||||
:unstyled="hideLayoutField"
|
||||
:class="
|
||||
cn(
|
||||
'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
|
||||
@contextmenu.capture.stop
|
||||
/>
|
||||
<label :for="id">{{ displayName }}</label>
|
||||
<label v-if="!hideLayoutField" :for="id">{{ displayName }}</label>
|
||||
</FloatLabel>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import FloatLabel from 'primevue/floatlabel'
|
||||
import Textarea from 'primevue/textarea'
|
||||
import { computed, useId } from 'vue'
|
||||
import { computed, inject, useId } from 'vue'
|
||||
|
||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||
import { cn } from '@/utils/tailwindUtil'
|
||||
@@ -48,6 +49,8 @@ const { widget, placeholder = '' } = defineProps<{
|
||||
|
||||
const modelValue = defineModel<string>({ default: '' })
|
||||
|
||||
const hideLayoutField = inject<boolean>('hideLayoutField', false)
|
||||
|
||||
const filteredProps = computed(() =>
|
||||
filterWidgetProps(widget.options, INPUT_EXCLUDED_PROPS)
|
||||
)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<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
|
||||
v-if="stateLabel"
|
||||
:class="
|
||||
@@ -25,7 +29,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
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 { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||
@@ -43,6 +47,8 @@ const { widget } = defineProps<{
|
||||
|
||||
const modelValue = defineModel<boolean>()
|
||||
|
||||
const hideLayoutField = inject<boolean>('hideLayoutField', false)
|
||||
|
||||
const filteredProps = computed(() =>
|
||||
filterWidgetProps(widget.options, STANDARD_EXCLUDED_PROPS)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user