30 lines
3.5 KiB
JavaScript
30 lines
3.5 KiB
JavaScript
import { Directive, HostBinding, HostListener, inject, } from '@angular/core';
|
|
import { DndDraggableDirective } from './dnd-draggable.directive';
|
|
import * as i0 from "@angular/core";
|
|
class DndHandleDirective {
|
|
draggable = true;
|
|
dndDraggableDirective = inject(DndDraggableDirective);
|
|
ngOnInit() {
|
|
this.dndDraggableDirective.registerDragHandle(this);
|
|
}
|
|
onDragEvent(event) {
|
|
event._dndUsingHandle = true;
|
|
}
|
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DndHandleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: DndHandleDirective, isStandalone: true, selector: "[dndHandle]", host: { listeners: { "dragstart": "onDragEvent($event)", "dragend": "onDragEvent($event)" }, properties: { "attr.draggable": "this.draggable" } }, ngImport: i0 });
|
|
}
|
|
export { DndHandleDirective };
|
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DndHandleDirective, decorators: [{
|
|
type: Directive,
|
|
args: [{ selector: '[dndHandle]', standalone: true }]
|
|
}], propDecorators: { draggable: [{
|
|
type: HostBinding,
|
|
args: ['attr.draggable']
|
|
}], onDragEvent: [{
|
|
type: HostListener,
|
|
args: ['dragstart', ['$event']]
|
|
}, {
|
|
type: HostListener,
|
|
args: ['dragend', ['$event']]
|
|
}] } });
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5kLWhhbmRsZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9kbmQvc3JjL2xpYi9kbmQtaGFuZGxlLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQU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