woodpecker/web/src/components/form/InputField.vue
renovate[bot] 22414744b0
chore(deps): update dependency eslint to v9 - abandoned (#3594)
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-06 15:16:59 +02:00

30 lines
782 B
Vue

<template>
<div class="flex flex-col mt-2 mb-4">
<div class="flex items-center mb-2">
<label class="text-wp-text-100 font-bold" :for="id" v-bind="$attrs">{{ label }}</label>
<DocsLink v-if="docsUrl" :topic="label" :url="docsUrl" class="ml-2" />
<slot v-else-if="$slots.titleActions" name="titleActions" />
</div>
<slot :id="id" />
<div v-if="$slots.description" class="ml-1 text-wp-text-alt-100">
<slot name="description" />
</div>
</div>
</template>
<script lang="ts" setup>
import DocsLink from '~/components/atomic/DocsLink.vue';
defineProps<{
label: string;
docsUrl?: string;
}>();
const id = (Math.random() + 1).toString(36).substring(7);
</script>
<script lang="ts">
export default {
inheritAttrs: false,
};
</script>