first commit

This commit is contained in:
Adrian Zürcher
2025-10-12 14:56:18 +02:00
parent a9f2e11fe6
commit a908db4f38
92 changed files with 13273 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
<template>
<q-dialog ref="dialog">
<q-card :style="'width:' + props.width">
<q-card-section
v-if="props.dialogLabel"
class="text-h6 text-center"
:class="'text-' + props.labelColor"
>{{ props.dialogLabel }}</q-card-section
>
<q-card-section v-if="props.text" class="text-center" style="white-space: pre-line">{{
props.text
}}</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn
v-if="props.buttonCancelLabel"
:flat="props.buttonCancelFlat"
:label="props.buttonCancelLabel"
v-close-popup
>
</q-btn>
<q-btn
v-if="props.buttonOkLabel"
:flat="props.buttonOkFlat"
:label="props.buttonOkLabel"
:color="props.buttonOkColor"
v-close-popup
@click="confirm"
>
</q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const props = defineProps({
buttonOkLabel: {
type: String,
default: 'OK',
},
buttonOkColor: {
type: String,
default: '',
},
buttonOkFlat: {
type: Boolean,
default: true,
},
labelColor: {
type: String,
default: 'primary',
},
dialogLabel: {
type: String,
default: '',
},
text: {
type: String,
default: '',
},
buttonCancelLabel: {
type: String,
default: '',
},
buttonCancelFlat: {
type: Boolean,
default: true,
},
width: {
type: String,
default: '300px',
},
});
const emit = defineEmits(['update-confirm']);
const dialog = ref();
const localInput = ref();
const open = (input?: unknown) => {
localInput.value = input;
dialog.value?.show();
};
const confirm = () => {
emit('update-confirm', localInput.value);
};
defineExpose({ open });
</script>