license import { Directive , ElementRef , Inject , Optional , Input } from '@angular/core' ; import { coerceBooleanProperty } from '@angular/cdk/coercion' ; import { CDK_DRAG_PARENT } from '../drag-parent' ; import { toggleNativeDragInteractions } from '../drag-styling' ; /** Handle that can be used to drag and CdkDrag instance. */ @ Directive ( { selector : '[cdkDragHandle]' , host : { 'class' : 'cdk-drag-handle' } } ) export class CdkDragHandle { /** Closest parent draggable instance. */ _parentDrag : { } | undefined ; /** Whether starting to drag through this handle is disabled. */ @ Input ( 'cdkDragHandleDisabled' ) get disabled ( ) : boolean { return this . _disabled ; } set disabled ( value ) { this . _disabled = coerceBooleanProperty ( value ) ; } private _disabled = false ; constructor ( public element , @ Inject ( CDK_DRAG_PARENT ) @ Optional ( ) parentDrag ? ) { this . _parentDrag = parentDrag ; toggleNativeDragInteractions ( element . nativeElement , false ) ; } }