
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2104 Reviewed-by: konrad <k@knt.li> Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
84 lines
1.4 KiB
Vue
84 lines
1.4 KiB
Vue
<template>
|
|
<modal @close="$router.back()" :overflow="true" :wide="wide">
|
|
<card
|
|
:title="title"
|
|
:shadow="false"
|
|
:padding="false"
|
|
class="has-text-left"
|
|
:has-close="true"
|
|
@close="$router.back()"
|
|
:loading="loading"
|
|
>
|
|
<div class="p-4">
|
|
<slot />
|
|
</div>
|
|
|
|
<template #footer>
|
|
<slot name="footer">
|
|
<x-button
|
|
v-if="tertiary !== ''"
|
|
:shadow="false"
|
|
variant="tertiary"
|
|
@click.prevent.stop="$emit('tertiary')"
|
|
>
|
|
{{ tertiary }}
|
|
</x-button>
|
|
<x-button
|
|
variant="secondary"
|
|
@click.prevent.stop="$router.back()"
|
|
>
|
|
{{ $t('misc.cancel') }}
|
|
</x-button>
|
|
<x-button
|
|
variant="primary"
|
|
@click.prevent.stop="primary()"
|
|
:icon="primaryIcon"
|
|
:disabled="primaryDisabled || loading"
|
|
>
|
|
{{ primaryLabel || $t('misc.create') }}
|
|
</x-button>
|
|
</slot>
|
|
</template>
|
|
</card>
|
|
</modal>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineProps({
|
|
title: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
primaryLabel: {
|
|
type: String,
|
|
},
|
|
primaryIcon: {
|
|
type: String,
|
|
default: 'plus',
|
|
},
|
|
primaryDisabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
tertiary: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
wide: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
})
|
|
|
|
const emit = defineEmits(['create', 'primary', 'tertiary'])
|
|
|
|
function primary() {
|
|
emit('create')
|
|
emit('primary')
|
|
}
|
|
</script>
|