2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

incr: add transition and delays to popover

- use delay for quickview
- fix quickview height issue in autocomplete
This commit is contained in:
18alantom 2023-04-18 10:03:29 +05:30
parent e05ef41cec
commit fd1270f652
3 changed files with 54 additions and 16 deletions

View File

@ -62,14 +62,23 @@
@mouseleave="showQuickView = false"
@click="routeToLinkedDoc"
>
<feather-icon name="chevron-right" class="w-4 h-4 text-gray-600" />
<Popover
:show-popup="showQuickView"
:entry-delay="300"
placement="bottom"
>
<template #target>
<feather-icon
name="chevron-right"
class="w-4 h-4 text-gray-600"
/>
</template>
<template #content>
<QuickView :schema-name="linkSchemaName" :name="value" />
</template>
</Popover>
</button>
</div>
<Popover v-if="canLink" :show-popup="showQuickView" placement="bottom">
<template #content>
<QuickView :schema-name="linkSchemaName" :name="value" />
</template>
</Popover>
</template>
</Dropdown>
</template>

View File

@ -7,14 +7,25 @@
:handleBlur="handleBlur"
></slot>
</div>
<div
ref="popover"
:class="popoverClass"
class="bg-white rounded border shadow-lg popover-container relative z-10"
v-show="isOpen"
>
<slot name="content" :togglePopover="togglePopover"></slot>
</div>
<Transition>
<div
ref="popover"
:class="popoverClass"
class="
bg-white
rounded-md
border
shadow-xl
popover-container
relative
z-10
"
:style="{ 'transition-delay': `${isOpen ? entryDelay : exitDelay}ms` }"
v-show="isOpen"
>
<slot name="content" :togglePopover="togglePopover"></slot>
</div>
</Transition>
</div>
</template>
@ -31,6 +42,8 @@ export default {
default: null,
},
right: Boolean,
entryDelay: { type: Number, default: 0 },
exitDelay: { type: Number, default: 0 },
placement: {
type: String,
default: 'bottom-start',
@ -120,3 +133,14 @@ export default {
},
};
</script>
<style scoped>
.v-enter-active,
.v-leave-active {
transition: opacity 150ms ease-out;
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
</style>

View File

@ -4,8 +4,13 @@
class="p-2 flex justify-between"
:class="values.length ? 'border-b' : ''"
>
<p class="font-semibold text-base text-gray-900">{{ name }}</p>
<p class="font-semibold text-sm text-gray-600">
<p
class="font-semibold text-base text-gray-900"
v-if="schema?.naming !== 'random' && !schema?.isChild"
>
{{ name }}
</p>
<p class="font-semibold text-base text-gray-600">
{{ schema?.label ?? '' }}
</p>
</div>