@mythpe/quasar-ui-qui 0.2.20 → 0.2.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -14,7 +14,7 @@ import type { MTransitionProps as Props } from '../../types'
14
14
  import { useTransition } from './useTransition'
15
15
 
16
16
  const props = defineProps<Props>()
17
- const { getClasses } = useTransition(props)
17
+ const { computedProps } = useTransition(props)
18
18
 
19
19
  defineOptions({
20
20
  name: 'MTransition',
@@ -23,16 +23,7 @@ defineOptions({
23
23
  </script>
24
24
 
25
25
  <template>
26
- <transition
27
- v-bind="{
28
- ...$props,
29
- ...$attrs,
30
- enterActiveClass: getClasses('in'),
31
- leaveActiveClass: getClasses('out'),
32
- appear: !noAppear,
33
- css: !noCss
34
- }"
35
- >
26
+ <transition v-bind="computedProps">
36
27
  <slot />
37
28
  </transition>
38
29
  </template>
@@ -14,7 +14,7 @@ import type { MTransitionGroupProps as Props } from '../../types'
14
14
  import { useTransition } from './useTransition'
15
15
 
16
16
  const props = defineProps<Props>()
17
- const { getClasses } = useTransition(props)
17
+ const { computedProps } = useTransition(props)
18
18
 
19
19
  defineOptions({
20
20
  name: 'MTransitionGroup',
@@ -23,16 +23,7 @@ defineOptions({
23
23
  </script>
24
24
 
25
25
  <template>
26
- <transition-group
27
- v-bind="{
28
- ...$props,
29
- ...$attrs,
30
- enterActiveClass: getClasses('in'),
31
- leaveActiveClass: getClasses('out'),
32
- appear: !noAppear,
33
- css: !noCss
34
- }"
35
- >
26
+ <transition-group v-bind="computedProps">
36
27
  <slot />
37
28
  </transition-group>
38
29
  </template>
@@ -6,6 +6,8 @@
6
6
  * Github: https://github.com/mythpe
7
7
  */
8
8
 
9
+ import { computed } from 'vue'
10
+
9
11
  export function useTransition (props: any) {
10
12
  const getClasses = (mode: 'in' | 'out') => {
11
13
  if (mode === 'in' && props.enterActiveClass) {
@@ -50,5 +52,40 @@ export function useTransition (props: any) {
50
52
  }
51
53
  return classes.join(' ')
52
54
  }
53
- return { getClasses }
55
+ const computedProps = computed(() => {
56
+ const p = {
57
+ ...props,
58
+ enterActiveClass: getClasses('in'),
59
+ leaveActiveClass: getClasses('out'),
60
+ appear: !props.noAppear,
61
+ css: !props.noCss
62
+ }
63
+ const remove = [
64
+ 'in',
65
+ 'inSlower',
66
+ 'inSlow',
67
+ 'inFast',
68
+ 'inFaster',
69
+ 'inDelay',
70
+ 'inRepeat',
71
+ 'out',
72
+ 'outSlower',
73
+ 'outSlow',
74
+ 'outFast',
75
+ 'outFaster',
76
+ 'outDelay',
77
+ 'outRepeat',
78
+ 'noAppear',
79
+ 'noCss',
80
+ 'enterActiveClass',
81
+ 'leaveActiveClass',
82
+ 'appear',
83
+ 'css'
84
+ ]
85
+ for (const removeKey in remove) {
86
+ delete p[removeKey]
87
+ }
88
+ return p
89
+ })
90
+ return { getClasses, computedProps }
54
91
  }