@enso-ui/transitions 2.0.5 → 2.0.9
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/index.js +2 -14
- package/package.json +2 -2
- package/src/transitions/Fade.vue +13 -8
- package/src/transitions/Mirror.vue +72 -0
- package/src/transitions/Slide.vue +19 -0
- package/src/transitions/Zoom.vue +10 -6
- package/src/transitions/FadeDown.vue +0 -14
- package/src/transitions/FadeLeft.vue +0 -14
- package/src/transitions/FadeRight.vue +0 -14
- package/src/transitions/FadeUp.vue +0 -14
- package/src/transitions/HorizontalFade.vue +0 -21
- package/src/transitions/HorizontalSlide.vue +0 -21
- package/src/transitions/SlideDown.vue +0 -14
- package/src/transitions/SlideLeft.vue +0 -14
- package/src/transitions/SlideRight.vue +0 -14
- package/src/transitions/SlideUp.vue +0 -14
package/index.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import Fade from './src/transitions/Fade.vue';
|
|
2
|
-
import FadeLeft from './src/transitions/FadeLeft.vue';
|
|
3
|
-
import FadeRight from './src/transitions/FadeRight.vue';
|
|
4
|
-
import FadeUp from './src/transitions/FadeUp.vue';
|
|
5
|
-
import FadeDown from './src/transitions/FadeDown.vue';
|
|
6
|
-
import SlideLeft from './src/transitions/SlideLeft.vue';
|
|
7
|
-
import SlideRight from './src/transitions/SlideRight.vue';
|
|
8
|
-
import SlideUp from './src/transitions/SlideUp.vue';
|
|
9
|
-
import SlideDown from './src/transitions/SlideDown.vue';
|
|
10
2
|
import Zoom from './src/transitions/Zoom.vue';
|
|
11
|
-
import
|
|
12
|
-
import HorizontalFade from './src/transitions/HorizontalFade.vue';
|
|
3
|
+
import Slide from './src/transitions/Slide.vue';
|
|
13
4
|
|
|
14
|
-
export {
|
|
15
|
-
Fade, SlideLeft, SlideRight, SlideUp, SlideDown, FadeLeft,
|
|
16
|
-
FadeRight, FadeUp, FadeDown, Zoom, HorizontalSlide, HorizontalFade,
|
|
17
|
-
};
|
|
5
|
+
export { Fade, Zoom, Slide };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/transitions",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "A collection of Vue transitions",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"autoprefixer": "^9.6.1",
|
|
32
32
|
"babel-eslint": "^10.0.1",
|
|
33
33
|
"cross-env": "^6.0.0",
|
|
34
|
-
"eslint": "^
|
|
34
|
+
"eslint": "^7.0.0",
|
|
35
35
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
36
36
|
"eslint-plugin-vue": "^8.0.3"
|
|
37
37
|
}
|
package/src/transitions/Fade.vue
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<mirror v-bind="$attrs"
|
|
3
|
+
effect="fade">
|
|
4
|
+
<template #default>
|
|
5
|
+
<slot/>
|
|
6
|
+
</template>
|
|
7
|
+
</mirror>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
|
+
import Mirror from './Mirror.vue';
|
|
12
|
+
|
|
11
13
|
export default {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
name: 'Fade',
|
|
15
|
+
|
|
16
|
+
components: { Mirror },
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition v-bind="$attrs"
|
|
3
|
+
appear
|
|
4
|
+
:enter-active-class="enterClass"
|
|
5
|
+
:leave-active-class="leaveClass">
|
|
6
|
+
<slot/>
|
|
7
|
+
</transition>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import 'animate.css';
|
|
12
|
+
|
|
13
|
+
const directions = {
|
|
14
|
+
'up': 'Up',
|
|
15
|
+
'down': 'Down',
|
|
16
|
+
'left': 'Left',
|
|
17
|
+
'right': 'Right',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const effects = ['back', 'bounce', 'fade', 'slide', 'zoom'];
|
|
21
|
+
|
|
22
|
+
const validateDirection = direction => Object.keys(directions)
|
|
23
|
+
.includes(direction.toLowerCase());
|
|
24
|
+
|
|
25
|
+
const validateEffect = effect => effects.includes(effect);
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'Mirror',
|
|
29
|
+
|
|
30
|
+
props: {
|
|
31
|
+
enter: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null,
|
|
34
|
+
validator: validateDirection,
|
|
35
|
+
},
|
|
36
|
+
leave: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: null,
|
|
39
|
+
validator: validateDirection,
|
|
40
|
+
},
|
|
41
|
+
effect: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
validator: validateEffect,
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
mounted() {
|
|
49
|
+
if (['back','slide'].includes(this.effect)
|
|
50
|
+
&& !this.leave && !this.enter) {
|
|
51
|
+
throw 'Missing direction for the given effect';
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
computed: {
|
|
56
|
+
enterClass() {
|
|
57
|
+
const direction = this.enter
|
|
58
|
+
? directions[this.enter.toLowerCase()]
|
|
59
|
+
: '';
|
|
60
|
+
|
|
61
|
+
return `animate__animated animate__${this.effect}In${direction}`;
|
|
62
|
+
},
|
|
63
|
+
leaveClass() {
|
|
64
|
+
const direction = this.leave
|
|
65
|
+
? directions[this.leave.toLowerCase()]
|
|
66
|
+
: '';
|
|
67
|
+
|
|
68
|
+
return `animate__animated animate__${this.effect}Out${direction}`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<mirror v-bind="$attrs"
|
|
3
|
+
effect="slide">
|
|
4
|
+
<template #default>
|
|
5
|
+
<slot/>
|
|
6
|
+
</template>
|
|
7
|
+
</mirror>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import Mirror from './Mirror.vue';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'Slide',
|
|
15
|
+
|
|
16
|
+
components: { Mirror },
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
</script>
|
package/src/transitions/Zoom.vue
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</
|
|
2
|
+
<mirror v-bind="$attrs"
|
|
3
|
+
effect="zoom">
|
|
4
|
+
<template #default>
|
|
5
|
+
<slot/>
|
|
6
|
+
</template>
|
|
7
|
+
</mirror>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
|
+
import Mirror from './Mirror.vue';
|
|
12
|
+
|
|
11
13
|
export default {
|
|
12
14
|
name: 'Zoom',
|
|
15
|
+
|
|
16
|
+
components: { Mirror },
|
|
13
17
|
};
|
|
14
18
|
</script>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition v-bind="$attrs"
|
|
3
|
-
appear
|
|
4
|
-
enter-active-class="animated fadeInRight"
|
|
5
|
-
leave-active-class="animated fadeOutRight">
|
|
6
|
-
<slot/>
|
|
7
|
-
</transition>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'FadeRight',
|
|
13
|
-
};
|
|
14
|
-
</script>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition v-bind="$attrs"
|
|
3
|
-
appear
|
|
4
|
-
:enter-active-class="`animated ${rtl ? 'fadeInRight' : 'fadeInLeft'}`"
|
|
5
|
-
:leave-active-class="`animated ${rtl ? 'fadeOutRight' : 'fadeOutLeft'}`">
|
|
6
|
-
<slot/>
|
|
7
|
-
</transition>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'HorizontalFade',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
rtl: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
</script>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition v-bind="$attrs"
|
|
3
|
-
appear
|
|
4
|
-
:enter-active-class="`animated ${rtl ? 'slideInRight' : 'slideInLeft'}`"
|
|
5
|
-
:leave-active-class="`animated ${rtl ? 'slideOutRight' : 'slideOutLeft'}`">
|
|
6
|
-
<slot/>
|
|
7
|
-
</transition>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'HorizontalSlide',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
rtl: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
</script>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition v-bind="$attrs"
|
|
3
|
-
appear
|
|
4
|
-
enter-active-class="animated slideInLeft"
|
|
5
|
-
leave-active-class="animated slideOutLeft">
|
|
6
|
-
<slot/>
|
|
7
|
-
</transition>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'SlideLeft',
|
|
13
|
-
};
|
|
14
|
-
</script>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition v-bind="$attrs"
|
|
3
|
-
appear
|
|
4
|
-
enter-active-class="animated slideInRight"
|
|
5
|
-
leave-active-class="animated slideOutRight">
|
|
6
|
-
<slot/>
|
|
7
|
-
</transition>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'SlideRight',
|
|
13
|
-
};
|
|
14
|
-
</script>
|