mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 05:00:03 +00:00
Sizing cleanup
This commit is contained in:
@@ -16,37 +16,38 @@ defineProps<{
|
||||
const canAcceptDrop = ref(false)
|
||||
</script>
|
||||
<template>
|
||||
<drop-wrapper
|
||||
v-if="onDragOver && onDragDrop"
|
||||
:class="
|
||||
cn(
|
||||
'rounded-lg ring-inset ring-primary-500',
|
||||
canAcceptDrop && 'ring-4 bg-primary-500/10'
|
||||
)
|
||||
"
|
||||
@dragover.prevent="(e: DragEvent) => (canAcceptDrop = onDragOver!(e))"
|
||||
@dragleave="canAcceptDrop = false"
|
||||
@drop.stop.prevent="
|
||||
(e: DragEvent) => {
|
||||
onDragDrop!(e)
|
||||
canAcceptDrop = false
|
||||
}
|
||||
"
|
||||
>
|
||||
<!--Slot is wrapped to ensure it's last and doesn't have border-->
|
||||
<div><slot /></div>
|
||||
<drop-wrapper v-if="onDragOver && onDragDrop">
|
||||
<div
|
||||
v-if="dropIndicator"
|
||||
:class="
|
||||
cn(
|
||||
'flex flex-col items-center align-center border-dashed rounded-lg border grow-1 w-full border-border-subtle my-3 py-2',
|
||||
dropIndicator?.onClick && 'cursor-pointer'
|
||||
'rounded-lg ring-inset ring-primary-500',
|
||||
canAcceptDrop && 'ring-4 bg-primary-500/10'
|
||||
)
|
||||
"
|
||||
@click.prevent="(e: MouseEvent) => dropIndicator!.onClick?.(e)"
|
||||
@dragover.prevent="(e: DragEvent) => (canAcceptDrop = onDragOver!(e))"
|
||||
@dragleave="canAcceptDrop = false"
|
||||
@drop.stop.prevent="
|
||||
(e: DragEvent) => {
|
||||
onDragDrop!(e)
|
||||
canAcceptDrop = false
|
||||
}
|
||||
"
|
||||
>
|
||||
<span v-if="dropIndicator.label" v-text="dropIndicator.label" />
|
||||
<i v-if="dropIndicator.iconClass" :class="dropIndicator.iconClass" />
|
||||
<!--Slot is wrapped to ensure it's last and doesn't have border-->
|
||||
<div><slot /></div>
|
||||
<div
|
||||
v-if="dropIndicator"
|
||||
:class="
|
||||
cn(
|
||||
'flex flex-col items-center justify-center gap-2 border-dashed rounded-lg border h-25 w-full border-border-subtle my-3 py-2',
|
||||
dropIndicator?.onClick && 'cursor-pointer'
|
||||
)
|
||||
"
|
||||
@click.prevent="(e: MouseEvent) => dropIndicator!.onClick?.(e)"
|
||||
>
|
||||
<span v-if="dropIndicator.label" v-text="dropIndicator.label" />
|
||||
<i v-if="dropIndicator.iconClass" :class="dropIndicator.iconClass" />
|
||||
</div>
|
||||
</div>
|
||||
</drop-wrapper>
|
||||
<slot v-else />
|
||||
|
||||
Reference in New Issue
Block a user