primeng
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primeng) [ {
this.el = el;
this.zone = zone;
this.onDragStart = new EventEmitter();
this.onDragEnd = new EventEmitter();
this.onDrag = new EventEmitter();
}
get pDraggableDisabled() {
return this._pDraggableDisabled;
}
set pDraggableDisabled(_pDraggableDisabled) {
this._pDraggableDisabled = _pDraggableDisabled;
if (this._pDraggableDisabled) {
this.unbindMouseListeners();
}
else {
this.el.nativeElement.draggable = true;
this.bindMouseListeners();
}
}
ngAfterViewInit() {
if (!this.pDraggableDisabled) {
this.el.nativeElement.draggable = true;
this.bindMouseListeners();
}
}
bindDragListener() {
if (!this.dragListener) {
this.zone.runOutsideAngular(() => {
this.dragListener = this.drag.bind(this);
this.el.nativeElement.addEventListener('drag', this.dragListener);
});
}
}
unbindDragListener() {
if (this.dragListener) {
this.zone.runOutsideAngular(() => {
this.el.nativeElement.removeEventListener('drag', this.dragListener);
this.dragListener = null;
});
}
}
bindMouseListeners() {
if (!this.mouseDownListener && !this.mouseUpListener) {
this.zone.runOutsideAngular(() => {
this.mouseDownListener = this.mousedown.bind(this);
this.mouseUpListener = this.mouseup.bind(this);
this.el.nativeElement.addEventListener('mousedown', this.mouseDownListener);
this.el.nativeElement.addEventListener('mouseup', this.mouseUpListener);
});
}
}
unbindMouseListeners() {
if (this.mouseDownListener && this.mouseUpListener) {
this.zone.runOutsideAngular(() => {
this.el.nativeElement.removeEventListener('mousedown', this.mouseDownListener);
this.el.nativeElement.removeEventListener('mouseup', this.mouseUpListener);
this.mouseDownListener = null;
this.mouseUpListener = null;
});
}
}
drag(event) {
this.onDrag.emit(event);
}
dragStart(event) {
if (this.allowDrag() && !this.pDraggableDisabled) {
if (this.dragEffect) {
event.dataTransfer.effectAllowed = this.dragEffect;
}
event.dataTransfer.setData('text', this.scope);
this.onDragStart.emit(event);
this.bindDragListener();
}
else {
event.preventDefault();
}
}
dragEnd(event) {
this.onDragEnd.emit(event);
this.unbindDragListener();
}
mousedown(event) {
this.handle = event.target;
}
mouseup(event) {
this.handle = null;
}
allowDrag() {
if (this.dragHandle && this.handle)
return DomHandler.matches(this.handle, this.dragHandle);
else
return true;
}
ngOnDestroy() {
this.unbindDragListener();
this.unbindMouseListeners();
}
}
Draggable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Draggable, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
Draggable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: Draggable, selector: "[pDraggable]", inputs: { scope: ["pDraggable", "scope"], dragEffect: "dragEffect", dragHandle: "dragHandle", pDraggableDisabled: "pDraggableDisabled" }, outputs: { onDragStart: "onDragStart", onDragEnd: "onDragEnd", onDrag: "onDrag" }, host: { listeners: { "dragstart": "dragStart($event)", "dragend": "dragEnd($event)" }, classAttribute: "p-element" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Draggable, decorators: [{
type: Directive,
args: [{
selector: '[pDraggable]',
host: {
'class': 'p-element'
}
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { scope: [{
type: Input,
args: ['pDraggable']
}], dragEffect: [{
type: Input
}], dragHandle: [{
type: Input
}], onDragStart: [{
type: Output
}], onDragEnd: [{
type: Output
}], onDrag: [{
type: Output
}], pDraggableDisabled: [{
type: Input
}], dragStart: [{
type: HostListener,
args: ['dragstart', ['$event']]
}], dragEnd: [{
type: HostListener,
args: ['dragend', ['$event']]
}] } });
export class Droppable {
constructor(el, zone) {
this.el = el;
this.zone = zone;
this.onDragEnter = new EventEmitter();
this.onDragLeave = new EventEmitter();
this.onDrop = new EventEmitter();
}
ngAfterViewInit() {
if (!this.pDroppableDisabled) {
this.bindDragOverListener();
}
}
bindDragOverListener() {
if (!this.dragOverListener) {
this.zone.runOutsideAngular(() => {
this.dragOverListener = this.dragOver.bind(this);
this.el.nativeElement.addEventListener('dragover', this.dragOverListener);
});
}
}
unbindDragOverListener() {
if (this.dragOverListener) {
this.zone.runOutsideAngular(() => {
this.el.nativeElement.removeEventListener('dragover', this.dragOverListener);
this.dragOverListener = null;
});
}
}
dragOver(event) {
event.preventDefault();
}
drop(event) {
if (this.allowDrop(event)) {
DomHandler.removeClass(this.el.nativeElement, 'p-draggable-enter');
event.preventDefault();
this.onDrop.emit(event);
}
}
dragEnter(event) {
event.preventDefault();
if (this.dropEffect) {
event.dataTransfer.dropEffect = this.dropEffect;
}
DomHandler.addClass(this.el.nativeElement, 'p-draggable-enter');
this.onDragEnter.emit(event);
}
dragLeave(event) {
event.preventDefault();
DomHandler.removeClass(this.el.nativeElement, 'p-draggable-enter');
this.onDragLeave.emit(event);
}
allowDrop(event) {
let dragScope = event.dataTransfer.getData('text');
if (typeof (this.scope) == "string" && dragScope == this.scope) {
return true;
}
else if (this.scope instanceof Array) {
for (let j = 0; j < this.scope.length; j++) {
if (dragScope == this.scope[j]) {
return true;
}
}
}
return false;
}
ngOnDestroy() {
this.unbindDragOverListener();
}
}
Droppable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Droppable, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
Droppable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: Droppable, selector: "[pDroppable]", inputs: { scope: ["pDroppable", "scope"], pDroppableDisabled: "pDroppableDisabled", dropEffect: "dropEffect" }, outputs: { onDragEnter: "onDragEnter", onDragLeave: "onDragLeave", onDrop: "onDrop" }, host: { listeners: { "drop": "drop($event)", "dragenter": "dragEnter($event)", "dragleave": "dragLeave($event)" }, classAttribute: "p-element" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Droppable, decorators: [{
type: Directive,
args: [{
selector: '[pDroppable]',
host: {
'class': 'p-element'
}
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { scope: [{
type: Input,
args: ['pDroppable']
}], pDroppableDisabled: [{
type: Input
}], dropEffect: [{
type: Input
}], onDragEnter: [{
type: Output
}], onDragLeave: [{
type: Output
}], onDrop: [{
type: Output
}], drop: [{
type: HostListener,
args: ['drop', ['$event']]
}], dragEnter: [{
type: HostListener,
args: ['dragenter', ['$event']]
}], dragLeave: [{
type: HostListener,
args: ['dragleave', ['$event']]
}] } });
export class DragDropModule {
}
DragDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DragDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
DragDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: DragDropModule, declarations: [Draggable, Droppable], imports: [CommonModule], exports: [Draggable, Droppable] });
DragDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DragDropModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DragDropModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule],
exports: [Draggable, Droppable],
declarations: [Draggable, Droppable]
}]
}] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZ2Ryb3AuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvZHJhZ2Ryb3AvZHJhZ2Ryb3AudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFFBQVEsRUFBQyxTQUFTLEVBQW9DLFlBQVksRUFBQyxLQUFLLEVBQUMsTUFBTSxFQUFDLFlBQV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JpbmRNb3VzZUxpc3RlbmVycygpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYmluZERyYWdMaXN0ZW5lcigpIHtcbiAgICAgICAgaWYgKCF0aGlzLmRyYWdMaXN0ZW5lcikge1xuICAgICAgICAgICAgdGhpcy56b25lLnJ1bk91dHNpZGVBbmd1bGFyKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdMaXN0ZW5lciA9IHRoaXMuZHJhZy5iaW5kKHRoaXMpO1xuICAgICAgICAgICAgICAgIHRoaXMuZWwubmF0aXZlRWxlbWVudC5hZGRFdmVudExpc3RlbmVyKCdkcmFnJywgdGhpcy5kcmFnTGlzdGVuZXIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB1bmJpbmREcmFnTGlzdGVuZXIoKSB7XG4gICAgICAgIGlmICh0aGlzLmRyYWdMaXN0ZW5lcikge1xuICAgICAgICAgICAgdGhpcy56b25lLnJ1bk91dHNpZGVBbmd1bGFyKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmVsLm5hdGl2ZUVsZW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignZHJhZycsIHRoaXMuZHJhZ0xpc3RlbmVyKTtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdMaXN0ZW5lciA9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGJpbmRNb3VzZUxpc3RlbmVycygpIHtcbiAgICAgICAgaWYgKCF0aGlzLm1vdXNlRG93bkxpc3RlbmVyICYmICF0aGlzLm1vdXNlVXBMaXN0ZW5lcikge1xuICAgICAgICAgICAgdGhpcy56b25lLnJ1bk91dHNpZGVBbmd1bGFyKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLm1vdXNlRG93bkxpc3RlbmVyID0gdGhpcy5tb3VzZWRvd24uYmluZCh0aGlzKTtcbiAgICAgICAgICAgICAgICB0aGlzLm1vd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