@noction/vue-bezier 1.0.9 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/types/components/Collapse/CollapseTransition.vue.d.ts +66 -0
- package/dist/types/components/Fade/FadeTransition.vue.d.ts +66 -0
- package/dist/types/components/Scale/ScaleTransition.vue.d.ts +66 -0
- package/dist/types/components/Slide/SlideXLeftTransition.vue.d.ts +66 -0
- package/dist/types/components/Slide/SlideXRightTransition.vue.d.ts +66 -0
- package/dist/types/components/Slide/SlideYDownTransition.vue.d.ts +66 -0
- package/dist/types/components/Slide/SlideYUpTransition.vue.d.ts +66 -0
- package/dist/types/components/Zoom/ZoomCenterTransition.vue.d.ts +66 -0
- package/dist/types/components/Zoom/ZoomUpTransition.vue.d.ts +66 -0
- package/dist/types/components/Zoom/ZoomXTransition.vue.d.ts +66 -0
- package/dist/types/components/Zoom/ZoomYTransition.vue.d.ts +66 -0
- package/{src/components/index.ts → dist/types/components/index.d.ts} +0 -9
- package/dist/types/composables/buildComponentType.d.ts +4 -0
- package/dist/types/composables/index.d.ts +3 -0
- package/dist/types/composables/useHooks.d.ts +15 -0
- package/dist/types/main.d.ts +7 -0
- package/{src/types/index.ts → dist/types/types/index.d.ts} +10 -19
- package/dist/vue-bezier.js +184 -198
- package/dist/web-types.json +8 -8
- package/package.json +14 -15
- package/src/components/Collapse/CollapseTransition.vue +0 -127
- package/src/components/Fade/FadeTransition.vue +0 -52
- package/src/components/Scale/ScaleTransition.vue +0 -61
- package/src/components/Slide/SlideXLeftTransition.vue +0 -62
- package/src/components/Slide/SlideXRightTransition.vue +0 -60
- package/src/components/Slide/SlideYDownTransition.vue +0 -59
- package/src/components/Slide/SlideYUpTransition.vue +0 -61
- package/src/components/Slide/move.scss +0 -1
- package/src/components/Zoom/ZoomCenterTransition.vue +0 -62
- package/src/components/Zoom/ZoomUpTransition.vue +0 -63
- package/src/components/Zoom/ZoomXTransition.vue +0 -64
- package/src/components/Zoom/ZoomYTransition.vue +0 -65
- package/src/components/Zoom/move.scss +0 -1
- package/src/composables/buildComponentType.ts +0 -5
- package/src/composables/index.ts +0 -4
- package/src/composables/useHooks.ts +0 -110
- package/src/main.ts +0 -20
- package/src/vue-shim.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noction/vue-bezier",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "Vue3 reusable transition components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"transitions",
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"email": "soryngitlan@gmail.com"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"dist"
|
|
29
|
-
"src"
|
|
28
|
+
"dist"
|
|
30
29
|
],
|
|
31
30
|
"exports": {
|
|
32
31
|
".": "./dist/vue-bezier.js",
|
|
@@ -40,20 +39,20 @@
|
|
|
40
39
|
"types": "dist/types/main.d.ts",
|
|
41
40
|
"type": "module",
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@faker-js/faker": "^8.
|
|
44
|
-
"@types/node": "^20.
|
|
45
|
-
"@vitejs/plugin-vue": "^5.0.
|
|
46
|
-
"@vitest/coverage-v8": "^1.
|
|
47
|
-
"@vue/test-utils": "^2.4.
|
|
42
|
+
"@faker-js/faker": "^8.4.1",
|
|
43
|
+
"@types/node": "^20.11.17",
|
|
44
|
+
"@vitejs/plugin-vue": "^5.0.3",
|
|
45
|
+
"@vitest/coverage-v8": "^1.2.2",
|
|
46
|
+
"@vue/test-utils": "^2.4.4",
|
|
48
47
|
"cross-env": "^7.0.3",
|
|
49
|
-
"jsdom": "^
|
|
48
|
+
"jsdom": "^24.0.0",
|
|
50
49
|
"minimist": "^1.2.8",
|
|
51
|
-
"sass": "^1.
|
|
52
|
-
"vite": "^5.
|
|
53
|
-
"vitest": "^1.
|
|
54
|
-
"vue": "^3.
|
|
55
|
-
"vue-
|
|
56
|
-
"vue-
|
|
50
|
+
"sass": "^1.70.0",
|
|
51
|
+
"vite": "^5.1.1",
|
|
52
|
+
"vitest": "^1.2.2",
|
|
53
|
+
"vue": "^3.4.18",
|
|
54
|
+
"vue-docgen-web-types": "^0.1.8",
|
|
55
|
+
"vue-tsc": "^1.8.27"
|
|
57
56
|
},
|
|
58
57
|
"web-types": "./dist/web-types.json",
|
|
59
58
|
"scripts": {
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
move-class="collapse-move"
|
|
7
|
-
>
|
|
8
|
-
<slot />
|
|
9
|
-
</component>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script setup lang="ts">
|
|
13
|
-
import { BaseTransitionProps } from 'vue'
|
|
14
|
-
import { buildComponentType } from '../../composables'
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { getTimingValue, leave, setAbsolutePosition, setStyles } from '@/composables/useHooks'
|
|
17
|
-
|
|
18
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
19
|
-
delay: 0,
|
|
20
|
-
duration: 300,
|
|
21
|
-
group: false,
|
|
22
|
-
origin: '',
|
|
23
|
-
styles: () => ({
|
|
24
|
-
animationFillMode: 'both',
|
|
25
|
-
animationTimingFunction: 'ease-out'
|
|
26
|
-
}),
|
|
27
|
-
tag: 'span'
|
|
28
|
-
})
|
|
29
|
-
const emit = defineEmits<ComponentEvents>()
|
|
30
|
-
|
|
31
|
-
const componentType = buildComponentType(props)
|
|
32
|
-
|
|
33
|
-
const hooks: BaseTransitionProps = {
|
|
34
|
-
onAfterEnter (el) {
|
|
35
|
-
// for safari: remove class then reset height is necessary
|
|
36
|
-
el.style.transition = ''
|
|
37
|
-
el.style.height = ''
|
|
38
|
-
el.style.overflow = el.dataset.oldOverflow
|
|
39
|
-
|
|
40
|
-
emit('after-enter', el)
|
|
41
|
-
},
|
|
42
|
-
onAfterLeave (el) {
|
|
43
|
-
el.style.transition = ''
|
|
44
|
-
el.style.height = ''
|
|
45
|
-
el.style.overflow = el.dataset.oldOverflow
|
|
46
|
-
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
47
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
48
|
-
|
|
49
|
-
emit('after-leave', el)
|
|
50
|
-
},
|
|
51
|
-
onBeforeEnter (el) {
|
|
52
|
-
const enterDuration = getTimingValue(props.duration, 'enter')
|
|
53
|
-
|
|
54
|
-
el.style.transition = transitionStyle(enterDuration)
|
|
55
|
-
|
|
56
|
-
if (!el.dataset) el.dataset = {}
|
|
57
|
-
|
|
58
|
-
el.dataset.oldPaddingTop = el.style.paddingTop
|
|
59
|
-
el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
60
|
-
|
|
61
|
-
el.style.height = '0'
|
|
62
|
-
el.style.paddingTop = 0
|
|
63
|
-
el.style.paddingBottom = 0
|
|
64
|
-
|
|
65
|
-
setStyles(props, el)
|
|
66
|
-
|
|
67
|
-
emit('before-enter', el)
|
|
68
|
-
},
|
|
69
|
-
onBeforeLeave (el) {
|
|
70
|
-
if (!el.dataset) el.dataset = {}
|
|
71
|
-
|
|
72
|
-
el.dataset.oldPaddingTop = el.style.paddingTop
|
|
73
|
-
el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
74
|
-
el.dataset.oldOverflow = el.style.overflow
|
|
75
|
-
|
|
76
|
-
el.style.height = `${el.scrollHeight}px`
|
|
77
|
-
el.style.overflow = 'hidden'
|
|
78
|
-
|
|
79
|
-
setStyles(props, el)
|
|
80
|
-
|
|
81
|
-
emit('before-leave', el)
|
|
82
|
-
},
|
|
83
|
-
onEnter (el) {
|
|
84
|
-
el.dataset.oldOverflow = el.style.overflow
|
|
85
|
-
|
|
86
|
-
if (el.scrollHeight !== 0) {
|
|
87
|
-
el.style.height = `${el.scrollHeight}px`
|
|
88
|
-
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
89
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
90
|
-
} else {
|
|
91
|
-
el.style.height = ''
|
|
92
|
-
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
93
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
el.style.overflow = 'hidden'
|
|
97
|
-
},
|
|
98
|
-
onLeave (el, done: () => void) {
|
|
99
|
-
const leaveDuration = getTimingValue(props.duration, 'leave')
|
|
100
|
-
|
|
101
|
-
if (el.scrollHeight !== 0) {
|
|
102
|
-
// for safari: add class after set height, or it will jump to zero height suddenly, weired
|
|
103
|
-
el.style.transition = transitionStyle(leaveDuration)
|
|
104
|
-
el.style.height = 0
|
|
105
|
-
el.style.paddingTop = 0
|
|
106
|
-
el.style.paddingBottom = 0
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// necessary for transition-group
|
|
110
|
-
setAbsolutePosition(props, el)
|
|
111
|
-
|
|
112
|
-
leave(props, el, done)
|
|
113
|
-
emit('leave', el, done)
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const transitionStyle = (duration: number) => {
|
|
118
|
-
const durationInSeconds = duration / 1000
|
|
119
|
-
|
|
120
|
-
return `${durationInSeconds}s height ease-in-out, ${durationInSeconds}s padding-top ease-in-out, ${durationInSeconds}s padding-bottom ease-in-out`
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
</script>
|
|
124
|
-
|
|
125
|
-
<style>
|
|
126
|
-
.collapse-move { transition: transform .3s ease-in-out; }
|
|
127
|
-
</style>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
enter-active-class="fade-in"
|
|
6
|
-
move-class="fade-move"
|
|
7
|
-
leave-active-class="fade-out"
|
|
8
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
21
|
-
delay: 0,
|
|
22
|
-
duration: 300,
|
|
23
|
-
group: false,
|
|
24
|
-
origin: '',
|
|
25
|
-
styles: () => ({
|
|
26
|
-
animationFillMode: 'both',
|
|
27
|
-
animationTimingFunction: 'ease-out'
|
|
28
|
-
}),
|
|
29
|
-
tag: 'span'
|
|
30
|
-
})
|
|
31
|
-
const emit = defineEmits<ComponentEvents>()
|
|
32
|
-
|
|
33
|
-
const componentType = buildComponentType(props)
|
|
34
|
-
const hooks = useHooks(props, emit)
|
|
35
|
-
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style>
|
|
39
|
-
@keyframes fade-in {
|
|
40
|
-
from { opacity: 0; }
|
|
41
|
-
to { opacity: 1; }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@keyframes fade-out {
|
|
45
|
-
from { opacity: 1; }
|
|
46
|
-
to { opacity: 0; }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.fade-in { animation-name: fade-in; }
|
|
50
|
-
.fade-out { animation-name: fade-out; }
|
|
51
|
-
.fade-move { transition: transform .3s ease-out; }
|
|
52
|
-
</style>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="scale-in"
|
|
7
|
-
move-class="scale-move"
|
|
8
|
-
leave-active-class="scale-out"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
21
|
-
delay: 0,
|
|
22
|
-
duration: 300,
|
|
23
|
-
group: false,
|
|
24
|
-
origin: 'top left',
|
|
25
|
-
styles: () => ({
|
|
26
|
-
animationFillMode: 'both',
|
|
27
|
-
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
28
|
-
}),
|
|
29
|
-
tag: 'span'
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const emit = defineEmits<ComponentEvents>()
|
|
33
|
-
|
|
34
|
-
const componentType = buildComponentType(props)
|
|
35
|
-
const hooks = useHooks(props, emit)
|
|
36
|
-
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style>
|
|
40
|
-
@keyframes scale-in {
|
|
41
|
-
from {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
transform: scale(0);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
to { opacity: 1; }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes scale-out {
|
|
50
|
-
from { opacity: 1; }
|
|
51
|
-
|
|
52
|
-
to {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: scale(0);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.scale-in { animation-name: scale-in; }
|
|
59
|
-
.scale-out { animation-name: scale-out; }
|
|
60
|
-
.scale-move { transition: transform .3s cubic-bezier(.25, .8, .5, 1); }
|
|
61
|
-
</style>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="slide-x-left-in"
|
|
7
|
-
move-class="slide-move"
|
|
8
|
-
leave-active-class="slide-x-left-out"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
21
|
-
delay: 0,
|
|
22
|
-
duration: 300,
|
|
23
|
-
group: false,
|
|
24
|
-
origin: '',
|
|
25
|
-
styles: () => ({
|
|
26
|
-
animationFillMode: 'both',
|
|
27
|
-
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
28
|
-
}),
|
|
29
|
-
tag: 'span'
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const emit = defineEmits<ComponentEvents>()
|
|
33
|
-
|
|
34
|
-
const componentType = buildComponentType(props)
|
|
35
|
-
const hooks = useHooks(props, emit)
|
|
36
|
-
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style lang="scss">
|
|
40
|
-
@import 'move';
|
|
41
|
-
|
|
42
|
-
@keyframes slide-x-left-in {
|
|
43
|
-
from {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transform: translateX(-15px);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
to { opacity: 1; }
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@keyframes slide-x-left-out {
|
|
52
|
-
from { opacity: 1; }
|
|
53
|
-
|
|
54
|
-
to {
|
|
55
|
-
opacity: 0;
|
|
56
|
-
transform: translateX(-15px);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.slide-x-left-in { animation-name: slide-x-left-in; }
|
|
61
|
-
.slide-x-left-out { animation-name: slide-x-left-out; }
|
|
62
|
-
</style>
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="slide-x-right-in"
|
|
7
|
-
move-class="slide-move"
|
|
8
|
-
leave-active-class="slide-x-right-out"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
20
|
-
delay: 0,
|
|
21
|
-
duration: 300,
|
|
22
|
-
group: false,
|
|
23
|
-
origin: '',
|
|
24
|
-
styles: () => ({
|
|
25
|
-
animationFillMode: 'both',
|
|
26
|
-
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
27
|
-
}),
|
|
28
|
-
tag: 'span'
|
|
29
|
-
})
|
|
30
|
-
const emit = defineEmits<ComponentEvents>()
|
|
31
|
-
|
|
32
|
-
const componentType = buildComponentType(props)
|
|
33
|
-
const hooks = useHooks(props, emit)
|
|
34
|
-
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style lang="scss">
|
|
38
|
-
@import 'move';
|
|
39
|
-
|
|
40
|
-
@keyframes slide-x-right-in {
|
|
41
|
-
from {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
transform: translateX(15px);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
to { opacity: 1; }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes slide-x-right-out {
|
|
50
|
-
from { opacity: 1; }
|
|
51
|
-
|
|
52
|
-
to {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: translateX(15px);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.slide-x-right-in { animation-name: slide-x-right-in; }
|
|
59
|
-
.slide-x-right-out { animation-name: slide-x-right-out; }
|
|
60
|
-
</style>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="slide-y-down-in"
|
|
7
|
-
leave-active-class="slide-y-down-out"
|
|
8
|
-
>
|
|
9
|
-
<slot />
|
|
10
|
-
</component>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
15
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
16
|
-
|
|
17
|
-
defineOptions({ inheritAttrs: false })
|
|
18
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
19
|
-
delay: 0,
|
|
20
|
-
duration: 300,
|
|
21
|
-
group: false,
|
|
22
|
-
origin: '',
|
|
23
|
-
styles: () => ({
|
|
24
|
-
animationFillMode: 'both',
|
|
25
|
-
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
26
|
-
}),
|
|
27
|
-
tag: 'span'
|
|
28
|
-
})
|
|
29
|
-
const emit = defineEmits<ComponentEvents>()
|
|
30
|
-
|
|
31
|
-
const componentType = buildComponentType(props)
|
|
32
|
-
const hooks = useHooks(props, emit)
|
|
33
|
-
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<style lang="scss">
|
|
37
|
-
@import 'move';
|
|
38
|
-
|
|
39
|
-
@keyframes slide-y-down-in {
|
|
40
|
-
from {
|
|
41
|
-
opacity: 0;
|
|
42
|
-
transform: translateY(15px);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
to { opacity: 1; }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@keyframes slide-y-down-out {
|
|
49
|
-
from { opacity: 1; }
|
|
50
|
-
|
|
51
|
-
to {
|
|
52
|
-
opacity: 0;
|
|
53
|
-
transform: translateY(15px);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.slide-y-down-in { animation-name: slide-y-down-in; }
|
|
58
|
-
.slide-y-down-out { animation-name: slide-y-down-out; }
|
|
59
|
-
</style>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
type="animation"
|
|
6
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
7
|
-
enter-active-class="slide-y-in"
|
|
8
|
-
move-class="slide-move"
|
|
9
|
-
leave-active-class="slide-y-out"
|
|
10
|
-
>
|
|
11
|
-
<slot />
|
|
12
|
-
</component>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script setup lang="ts">
|
|
16
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
17
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
18
|
-
|
|
19
|
-
defineOptions({ inheritAttrs: false })
|
|
20
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
21
|
-
delay: 0,
|
|
22
|
-
duration: 300,
|
|
23
|
-
group: false,
|
|
24
|
-
origin: '',
|
|
25
|
-
styles: () => ({
|
|
26
|
-
animationFillMode: 'both',
|
|
27
|
-
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
28
|
-
}),
|
|
29
|
-
tag: 'span'
|
|
30
|
-
})
|
|
31
|
-
const emit = defineEmits<ComponentEvents>()
|
|
32
|
-
|
|
33
|
-
const componentType = buildComponentType(props)
|
|
34
|
-
const hooks = useHooks(props, emit)
|
|
35
|
-
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style lang="scss">
|
|
39
|
-
@import 'move';
|
|
40
|
-
|
|
41
|
-
@keyframes slide-y-in {
|
|
42
|
-
from {
|
|
43
|
-
opacity: 0;
|
|
44
|
-
transform: translateY(-15px);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
to { opacity: 1; }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@keyframes slide-y-out {
|
|
51
|
-
from { opacity: 1; }
|
|
52
|
-
|
|
53
|
-
to {
|
|
54
|
-
opacity: 0;
|
|
55
|
-
transform: translateY(-15px);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.slide-y-in { animation-name: slide-y-in; }
|
|
60
|
-
.slide-y-out { animation-name: slide-y-out; }
|
|
61
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.slide-move { transition: transform .3s; }
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="zoom-in"
|
|
7
|
-
move-class="zoom-move"
|
|
8
|
-
leave-active-class="zoom-out"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
20
|
-
delay: 0,
|
|
21
|
-
duration: 300,
|
|
22
|
-
group: false,
|
|
23
|
-
origin: '',
|
|
24
|
-
styles: () => ({
|
|
25
|
-
animationFillMode: 'both',
|
|
26
|
-
animationTimingFunction: 'ease-out'
|
|
27
|
-
}),
|
|
28
|
-
tag: 'span'
|
|
29
|
-
})
|
|
30
|
-
const emit = defineEmits<ComponentEvents>()
|
|
31
|
-
|
|
32
|
-
const componentType = buildComponentType(props)
|
|
33
|
-
const hooks = useHooks(props, emit)
|
|
34
|
-
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style lang="scss">
|
|
38
|
-
@import 'move';
|
|
39
|
-
|
|
40
|
-
@keyframes zoom-in {
|
|
41
|
-
0% {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
transform: scale3d(.3, .3, .3);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
50% { opacity: 1; }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes zoom-out {
|
|
50
|
-
0% { opacity: 1; }
|
|
51
|
-
|
|
52
|
-
50% {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: scale3d(.3, .3, .3);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
100% { opacity: 0; }
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.zoom-in { animation-name: zoom-in; }
|
|
61
|
-
.zoom-out { animation-name: zoom-out; }
|
|
62
|
-
</style>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="componentType"
|
|
4
|
-
:tag="props.tag"
|
|
5
|
-
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
-
enter-active-class="zoom-in-up"
|
|
7
|
-
move-class="zoom-move"
|
|
8
|
-
leave-active-class="zoom-out-up"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</component>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { ComponentEvents, ComponentProps } from '@/types'
|
|
16
|
-
import { buildComponentType, useHooks } from '@/composables'
|
|
17
|
-
|
|
18
|
-
defineOptions({ inheritAttrs: false })
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<ComponentProps>(), {
|
|
21
|
-
delay: 0,
|
|
22
|
-
duration: 300,
|
|
23
|
-
group: false,
|
|
24
|
-
origin: '',
|
|
25
|
-
styles: () => ({
|
|
26
|
-
animationFillMode: 'both',
|
|
27
|
-
animationTimingFunction: 'ease-out'
|
|
28
|
-
}),
|
|
29
|
-
tag: 'span'
|
|
30
|
-
})
|
|
31
|
-
const emit = defineEmits<ComponentEvents>()
|
|
32
|
-
|
|
33
|
-
const componentType = buildComponentType(props)
|
|
34
|
-
const hooks = useHooks(props, emit)
|
|
35
|
-
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style lang="scss">
|
|
39
|
-
@import 'move';
|
|
40
|
-
|
|
41
|
-
@keyframes zoom-in-up {
|
|
42
|
-
0% {
|
|
43
|
-
opacity: 0;
|
|
44
|
-
transform: scaleY(0);
|
|
45
|
-
transform-origin: top center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
50% { opacity: 1; }
|
|
49
|
-
|
|
50
|
-
100% { transform: scaleY(1); }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@keyframes zoom-out-up {
|
|
54
|
-
0% { opacity: 1; }
|
|
55
|
-
|
|
56
|
-
50% { transform: scaleY(0); }
|
|
57
|
-
|
|
58
|
-
100% { opacity: 0; }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.zoom-in-up { animation-name: zoom-in-up; }
|
|
62
|
-
.zoom-out-up { animation-name: zoom-out-up; }
|
|
63
|
-
</style>
|