Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #152 from cuiyajie/main
Browse files Browse the repository at this point in the history
fix: component transitions
  • Loading branch information
selemondev authored Sep 25, 2023
2 parents 564fc0c + 2fd29b6 commit 6b6547e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,18 @@ onClickOutside(container, () => {
const attrsOmitted = omit(attrs, ['class'])
const contextMenuTransitions = {
enter: variant.value.enterActiveClass,
enterFrom: variant.value.enterFromClass,
enterTo: variant.value.enterToClass,
leave: variant.value.leaveActiveClass,
leaveFrom: variant.value.leaveFromClass,
leaveTo: variant.value.leaveToClass,
enterActiveClass: variant.value.enterActiveClass,
enterFromClass: variant.value.enterFromClass,
enterToClass: variant.value.enterToClass,
leaveActiveClass: variant.value.leaveActiveClass,
leaveFromClass: variant.value.leaveFromClass,
leaveToClass: variant.value.leaveToClass,
}
</script>

<template>
<div v-if="isOpen" ref="container" :class="wrapperClass" v-bind="attrsOmitted">
<!-- @vue-ignore -->
<Transition appear v-bind="contextMenuTransitions">
<div :class="[variant.contextMenuBase, variant.ring, variant.rounded, variant.shadow, variant.background]">
<slot />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const transitionClass = computed(() => {
<template>
<TransitionRoot :appear="appear" :show="isOpen" as="template">
<HDialog :class="wrapperClass" v-bind="attrsOmitted" @close="(e) => !preventClose && close(e)">
<TransitionChild v-if="overlay" as="template" :appear="appear" :bind="overlayTransitions">
<TransitionChild v-if="overlay" as="template" :appear="appear" v-bind="overlayTransitions">
<div :class="[variant.overlayBase, variant.overlayBackground]" />
</TransitionChild>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ function onMouseLeave() {
const attrsOmitted = omit(attrs, ['class'])
const popoverTransitions = {
enter: variant.value.transitionEnterActiveClass,
enterFrom: variant.value.transitionEnterFromClass,
enterTo: variant.value.transitionEnterToClass,
leave: variant.value.transitionLeaveActiveClass,
leaveFrom: variant.value.transitionLeaveFromClass,
leaveTo: variant.value.transitionLeaveToClass,
enterActiveClass: variant.value.transitionEnterActiveClass,
enterFromClass: variant.value.transitionEnterFromClass,
enterToClass: variant.value.transitionEnterToClass,
leaveClass: variant.value.transitionLeaveActiveClass,
leaveFromClass: variant.value.transitionLeaveFromClass,
leaveToClass: variant.value.transitionLeaveToClass,
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ function onMouseLeave() {
const attrsOmitted = omit(attrs, ['class'])
const toolTipTransitions = {
enter: variant.value.transitionEnterActiveClass,
enterFrom: variant.value.transitionEnterFromClass,
enterTo: variant.value.transitionEnterToClass,
leave: variant.value.transitionLeaveActiveClass,
leaveFrom: variant.value.transitionLeaveFromClass,
leaveTo: variant.value.transitionLeaveToClass,
enterActiveClass: variant.value.transitionEnterActiveClass,
enterFromClass: variant.value.transitionEnterFromClass,
enterToClass: variant.value.transitionEnterToClass,
leaveActiveClass: variant.value.transitionLeaveActiveClass,
leaveFromClass: variant.value.transitionLeaveFromClass,
leaveToClass: variant.value.transitionLeaveToClass,
}
</script>

Expand All @@ -123,6 +123,7 @@ const toolTipTransitions = {
</slot>

<div v-if="open && !prevent" ref="container" :class="[variant.container, variant.width]">
<!-- @vue-ignore -->
<Transition appear v-bind="toolTipTransitions">
<div :class="[variant.toolTipBase, variant.background, variant.color, variant.rounded, variant.shadow, variant.ring]">
<slot name="text">
Expand Down

0 comments on commit 6b6547e

Please sign in to comment.