kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(ui): Empty section headers do not obstruct interaction with elements above
rodzic
6f67998f98
commit
2e3d8755e4
|
@ -1,6 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComponentProps } from 'vue-component-type-helpers'
|
import type { ComponentProps } from 'vue-component-type-helpers'
|
||||||
|
|
||||||
|
import { computed } from 'vue'
|
||||||
|
|
||||||
import Layout from '~/components/ui/Layout.vue'
|
import Layout from '~/components/ui/Layout.vue'
|
||||||
import Spacer from '~/components/ui/Spacer.vue'
|
import Spacer from '~/components/ui/Spacer.vue'
|
||||||
import Button from '~/components/ui/Button.vue'
|
import Button from '~/components/ui/Button.vue'
|
||||||
|
@ -20,6 +22,10 @@ const props = defineProps<{
|
||||||
[Operation in 'expand' | 'collapse']?: () => void
|
[Operation in 'expand' | 'collapse']?: () => void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const hasContent = computed(() => {
|
||||||
|
// @ts-expect-error too complex type thingy
|
||||||
|
return Object.keys(props).some(key => (key === 'expand' || key === 'collapse' || key === 'action' || key.startsWith('h')) && props[key])
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,13 +43,14 @@ const props = defineProps<{
|
||||||
<Layout
|
<Layout
|
||||||
flex
|
flex
|
||||||
no-gap
|
no-gap
|
||||||
style="
|
:style="`
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
align-self: baseline;
|
align-self: baseline;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
"
|
${ hasContent ? '' : 'pointer-events: none;'}
|
||||||
|
`"
|
||||||
>
|
>
|
||||||
<!-- Accordion? -->
|
<!-- Accordion? -->
|
||||||
|
|
||||||
|
@ -101,7 +108,9 @@ const props = defineProps<{
|
||||||
/>
|
/>
|
||||||
<Spacer grow />
|
<Spacer grow />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Action! You can either specify `to` or `onClick`. -->
|
<!-- Action! You can either specify `to` or `onClick`. -->
|
||||||
|
|
||||||
<component
|
<component
|
||||||
:is="'to' in action ? Link : Button"
|
:is="'to' in action ? Link : Button"
|
||||||
v-if="action"
|
v-if="action"
|
||||||
|
|
Ładowanie…
Reference in New Issue