Sharkey/packages/frontend/src/components/form/slot.vue

40 lines
584 B
Vue
Raw Normal View History

2021-09-29 17:50:45 +02:00
<template>
2023-05-24 10:50:15 +02:00
<div>
<div :class="$style.label" @click="focus"><slot name="label"></slot></div>
<div :class="$style.content">
2021-09-29 17:50:45 +02:00
<slot></slot>
</div>
2023-05-24 10:50:15 +02:00
<div :class="$style.caption"><slot name="caption"></slot></div>
2021-09-29 17:50:45 +02:00
</div>
</template>
2022-09-05 11:51:23 +02:00
<script lang="ts" setup>
import { } from 'vue';
2021-09-29 17:50:45 +02:00
2022-09-05 11:51:23 +02:00
function focus() {
// TODO
}
2021-09-29 17:50:45 +02:00
</script>
2023-05-24 10:50:15 +02:00
<style lang="scss" module>
.label {
font-size: 0.85em;
padding: 0 0 8px 0;
user-select: none;
2021-09-29 17:50:45 +02:00
2023-05-24 10:50:15 +02:00
&:empty {
display: none;
2021-09-29 17:50:45 +02:00
}
2023-05-24 10:50:15 +02:00
}
2021-09-29 17:50:45 +02:00
2023-05-24 10:50:15 +02:00
.caption {
font-size: 0.85em;
padding: 8px 0 0 0;
color: var(--fgTransparentWeak);
2021-09-29 17:50:45 +02:00
2023-05-24 10:50:15 +02:00
&:empty {
display: none;
2021-09-29 17:50:45 +02:00
}
}
</style>