add dragstart event to Dialog component
parent
f663868463
commit
42a0f934fb
|
@ -22911,6 +22911,19 @@
|
||||||
"returnType": "void",
|
"returnType": "void",
|
||||||
"description": "Fired when a dialog gets unmaximized."
|
"description": "Fired when a dialog gets unmaximized."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "dragstart",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "event",
|
||||||
|
"optional": false,
|
||||||
|
"type": "Event",
|
||||||
|
"description": "Browser event."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType": "void",
|
||||||
|
"description": "Fired when a dialog drag begins."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "dragend",
|
"name": "dragend",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
|
|
@ -180,6 +180,17 @@ const DialogEvents = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'dragstart',
|
||||||
|
description: 'Fired when a dialog drag begins.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'event',
|
||||||
|
type: 'object',
|
||||||
|
description: 'Event Object'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'dragend',
|
name: 'dragend',
|
||||||
description: 'Fired when a dialog drag completes.',
|
description: 'Fired when a dialog drag completes.',
|
||||||
|
|
|
@ -401,6 +401,11 @@ export interface DialogEmitsOptions {
|
||||||
* @param {event} event - Browser event.
|
* @param {event} event - Browser event.
|
||||||
*/
|
*/
|
||||||
unmaximize(event: Event): void;
|
unmaximize(event: Event): void;
|
||||||
|
/**
|
||||||
|
* Fired when a dialog drag begins.
|
||||||
|
* @param {event} event - Browser event.
|
||||||
|
*/
|
||||||
|
dragstart(event: Event): void;
|
||||||
/**
|
/**
|
||||||
* Fired when a dialog drag completes.
|
* Fired when a dialog drag completes.
|
||||||
* @param {event} event - Browser event.
|
* @param {event} event - Browser event.
|
||||||
|
|
|
@ -79,7 +79,7 @@ export default {
|
||||||
name: 'Dialog',
|
name: 'Dialog',
|
||||||
extends: BaseDialog,
|
extends: BaseDialog,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
emits: ['update:visible', 'show', 'hide', 'after-hide', 'maximize', 'unmaximize', 'dragend'],
|
emits: ['update:visible', 'show', 'hide', 'after-hide', 'maximize', 'unmaximize', 'dragstart', 'dragend'],
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
dialogRef: computed(() => this._instance)
|
dialogRef: computed(() => this._instance)
|
||||||
|
@ -324,6 +324,8 @@ export default {
|
||||||
this.container.style.margin = '0';
|
this.container.style.margin = '0';
|
||||||
document.body.setAttribute('data-p-unselectable-text', 'true');
|
document.body.setAttribute('data-p-unselectable-text', 'true');
|
||||||
!this.isUnstyled && addStyle(document.body, { 'user-select': 'none' });
|
!this.isUnstyled && addStyle(document.body, { 'user-select': 'none' });
|
||||||
|
|
||||||
|
this.$emit('dragstart', event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bindGlobalListeners() {
|
bindGlobalListeners() {
|
||||||
|
|
Loading…
Reference in New Issue