0
0
Fork 0

Merge pull request '#7524 hotfix-vnProgressModal' (!866) from 7524-hotfix-vnProgressModal into master

Reviewed-on: verdnatura/salix-front#866
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-10-24 12:10:26 +00:00
commit e26692fa51
1 changed files with 6 additions and 18 deletions

View File

@ -9,10 +9,6 @@ const $props = defineProps({
type: Number, //Progress value (1.0 > x > 0.0)
required: true,
},
showDialog: {
type: Boolean,
required: true,
},
cancelled: {
type: Boolean,
required: false,
@ -24,30 +20,22 @@ const emit = defineEmits(['cancel', 'close']);
const dialogRef = ref(null);
const _showDialog = computed({
get: () => $props.showDialog,
set: (value) => {
if (value) dialogRef.value.show();
},
const showDialog = defineModel('showDialog', {
type: Boolean,
default: false,
});
const _progress = computed(() => $props.progress);
const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`);
const cancel = () => {
dialogRef.value.hide();
emit('cancel');
};
</script>
<template>
<QDialog ref="dialogRef" v-model="_showDialog" @hide="onDialogHide">
<QDialog ref="dialogRef" v-model="showDialog" @hide="emit('close')">
<QCard class="full-width dialog">
<QCardSection class="row">
<span class="text-h6">{{ t('Progress') }}</span>
<QSpace />
<QBtn icon="close" flat round dense @click="emit('close')" />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection>
<div class="column">
@ -80,7 +68,7 @@ const cancel = () => {
type="button"
flat
class="text-primary"
@click="cancel()"
v-close-popup
>
{{ t('globals.cancel') }}
</QBtn>