0351d front end linting (#377)
* feat: disable custom script for trial users * after lint fix * frontend linting --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<transition @leave="onLeave">
|
||||
<div
|
||||
ref="collapsible"
|
||||
v-if="modelValue"
|
||||
ref="collapsible"
|
||||
v-on-click-outside.bubble="onClickAway"
|
||||
>
|
||||
<slot/>
|
||||
<slot />
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {vOnClickOutside} from '@vueuse/components'
|
||||
import { vOnClickOutside } from "@vueuse/components"
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {type: Boolean},
|
||||
maxHeight: {type: Number, default: 200},
|
||||
modelValue: { type: Boolean },
|
||||
maxHeight: { type: Number, default: 200 },
|
||||
})
|
||||
const emit = defineEmits(['click-away'])
|
||||
const emit = defineEmits(["click-away"])
|
||||
|
||||
const motion = ref(null)
|
||||
const collapsible = ref(null)
|
||||
@@ -25,28 +25,31 @@ const variants = {
|
||||
initial: {
|
||||
opacity: 0,
|
||||
y: -10,
|
||||
transition: {duration: 75, ease: 'easeIn'}
|
||||
transition: { duration: 75, ease: "easeIn" },
|
||||
},
|
||||
enter: {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
transition: {duration: 150, ease: 'easeOut'}
|
||||
}
|
||||
transition: { duration: 150, ease: "easeOut" },
|
||||
},
|
||||
}
|
||||
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
if (newValue) {
|
||||
nextTick(() => {
|
||||
motion.value = useMotion(collapsible.value, variants)
|
||||
})
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
nextTick(() => {
|
||||
motion.value = useMotion(collapsible.value, variants)
|
||||
})
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const onLeave = (el, done) => {
|
||||
motion.value.leave(done)
|
||||
}
|
||||
|
||||
const onClickAway = (event) => {
|
||||
emit('click-away', event)
|
||||
emit("click-away", event)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<transition v-if="name=='slideInUp'"
|
||||
enter-active-class="linear duration-300 overflow-hidden"
|
||||
enter-from-class="max-h-0"
|
||||
enter-to-class="max-h-screen"
|
||||
leave-active-class="linear duration-300 overflow-hidden"
|
||||
leave-from-class="max-h-screen"
|
||||
leave-to-class="max-h-0"
|
||||
<transition
|
||||
v-if="name == 'slideInUp'"
|
||||
enter-active-class="linear duration-300 overflow-hidden"
|
||||
enter-from-class="max-h-0"
|
||||
enter-to-class="max-h-screen"
|
||||
leave-active-class="linear duration-300 overflow-hidden"
|
||||
leave-from-class="max-h-screen"
|
||||
leave-to-class="max-h-0"
|
||||
>
|
||||
<slot />
|
||||
</transition>
|
||||
@@ -13,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'VTransition',
|
||||
props: { name: { default: 'slideInUp' } }
|
||||
name: "VTransition",
|
||||
props: { name: {type: String, default: "slideInUp" } },
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user