pull/6462/head
tugcekucukoglu 2024-09-23 09:48:28 +03:00
parent c0ed5f22bc
commit afee6a32c5
2 changed files with 23 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* @module confirmationoptions
*
*/
import type { HintedString } from '@primevue/core';
import type { ButtonProps } from 'primevue/button';
/**
@ -41,6 +42,17 @@ export interface ConfirmationOptions {
* @defaultValue false
*/
blockScroll?: boolean | undefined;
/**
* A valid query selector or an HTMLElement to specify where the confirm dialog gets attached.
* Special keywords are 'body' for document body and 'self' for the element itself.
* @defaultValue body
*/
appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement;
/**
* Defines if background should be blocked when confirm dialog is displayed.
* @defaultValue false
*/
modal?: boolean | undefined;
/**
* Callback to execute when action is confirmed.
* @todo Next release should be able to change

View File

@ -3,9 +3,10 @@
v-model:visible="visible"
role="alertdialog"
:class="cx('root')"
:modal="true"
:modal="modal"
:header="header"
:blockScroll="blockScroll"
:appendTo="appendTo"
:position="position"
:breakpoints="breakpoints"
:closeOnEscape="closeOnEscape"
@ -125,6 +126,15 @@ export default {
}
},
computed: {
appendTo() {
return this.confirmation ? this.confirmation.appendTo : 'body';
},
target() {
return this.confirmation ? this.confirmation.target : null;
},
modal() {
return this.confirmation ? (this.confirmation.modal == null ? true : this.confirmation.modal) : true;
},
header() {
return this.confirmation ? this.confirmation.header : null;
},