Fixed #3753 - ConfirmDialog: Add draggable property

pull/3758/head
Tuğçe Küçükoğlu 2023-03-16 17:37:09 +03:00
parent baf767f1f5
commit bfca2f0feb
3 changed files with 28 additions and 1 deletions

View File

@ -10,6 +10,12 @@ const ConfirmDialogProps = [
type: 'object', type: 'object',
default: 'null', default: 'null',
description: 'Object literal to define widths per screen size.' description: 'Object literal to define widths per screen size.'
},
{
name: 'draggable',
type: 'boolean',
default: 'true',
description: 'Whether the dialog can be relocated by dragging.'
} }
]; ];

View File

@ -46,6 +46,11 @@ export interface ConfirmDialogProps {
* @see ConfirmDialogBreakpoints * @see ConfirmDialogBreakpoints
*/ */
breakpoints?: ConfirmDialogBreakpoints; breakpoints?: ConfirmDialogBreakpoints;
/**
* Enables dragging to change the position using header.
* @defaultValue true
*/
draggable?: boolean | undefined;
} }
/** /**

View File

@ -1,5 +1,17 @@
<template> <template>
<CDialog v-model:visible="visible" role="alertdialog" class="p-confirm-dialog" :modal="true" :header="header" :blockScroll="blockScroll" :position="position" :breakpoints="breakpoints" :closeOnEscape="closeOnEscape" @update:visible="onHide"> <CDialog
v-model:visible="visible"
role="alertdialog"
class="p-confirm-dialog"
:modal="true"
:header="header"
:blockScroll="blockScroll"
:position="position"
:breakpoints="breakpoints"
:closeOnEscape="closeOnEscape"
:draggable="draggable"
@update:visible="onHide"
>
<template v-if="!$slots.message"> <template v-if="!$slots.message">
<i v-if="confirmation.icon" :class="iconClass" /> <i v-if="confirmation.icon" :class="iconClass" />
<span class="p-confirm-dialog-message">{{ message }}</span> <span class="p-confirm-dialog-message">{{ message }}</span>
@ -24,6 +36,10 @@ export default {
breakpoints: { breakpoints: {
type: Object, type: Object,
default: null default: null
},
draggable: {
type: Boolean,
default: true
} }
}, },
confirmListener: null, confirmListener: null,