@progress/kendo-angular-utils 0.1.1-dev.202209081521 → 0.1.1-dev.202209131028
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kendo-angular-utils.umd.js +1 -1
- package/drag-and-drop/dragtarget.directive.d.ts +12 -34
- package/drag-and-drop/droptarget.directive.d.ts +5 -5
- package/drag-and-drop/events/drag-target/drag-event.d.ts +1 -1
- package/drag-and-drop/events/drag-target/end-event.d.ts +1 -1
- package/drag-and-drop/events/drag-target/index.d.ts +4 -4
- package/drag-and-drop/events/drag-target/press-event.d.ts +1 -1
- package/drag-and-drop/events/drag-target/start-event.d.ts +1 -1
- package/drag-and-drop/events/drop-target/drop-event.d.ts +1 -1
- package/drag-and-drop/events/drop-target/enter-event.d.ts +1 -1
- package/drag-and-drop/events/drop-target/index.d.ts +4 -4
- package/drag-and-drop/events/drop-target/leave-event.d.ts +1 -1
- package/drag-and-drop/events/drop-target/over-event.d.ts +1 -1
- package/drag-and-drop/models/index.d.ts +0 -1
- package/drag-and-drop.module.d.ts +31 -0
- package/esm2015/drag-and-drop/dragtarget.directive.js +29 -36
- package/esm2015/drag-and-drop/droptarget.directive.js +5 -5
- package/esm2015/drag-and-drop/events/drag-target/drag-event.js +1 -1
- package/esm2015/drag-and-drop/events/drag-target/end-event.js +1 -1
- package/esm2015/drag-and-drop/events/drag-target/index.js +4 -4
- package/esm2015/drag-and-drop/events/drag-target/press-event.js +1 -1
- package/esm2015/drag-and-drop/events/drag-target/start-event.js +1 -1
- package/esm2015/drag-and-drop/events/drop-target/drop-event.js +1 -1
- package/esm2015/drag-and-drop/events/drop-target/enter-event.js +1 -1
- package/esm2015/drag-and-drop/events/drop-target/index.js +4 -4
- package/esm2015/drag-and-drop/events/drop-target/leave-event.js +1 -1
- package/esm2015/drag-and-drop/events/drop-target/over-event.js +1 -1
- package/esm2015/drag-and-drop.module.js +33 -1
- package/esm2015/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-utils.js +75 -50
- package/main.d.ts +2 -1
- package/package.json +1 -1
- package/drag-and-drop/models/normalized-drag-event.d.ts +0 -6
- package/esm2015/drag-and-drop/models/normalized-drag-event.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@progress/kendo-licensing"),require("@progress/kendo-draggable-common"),require("@progress/kendo-angular-common")):"function"==typeof define&&define.amd?define("KendoAngularUtils",["exports","@angular/core","@angular/common","@progress/kendo-licensing","@progress/kendo-draggable-common","@progress/kendo-angular-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoAngularUtils={},t.ng.core,t.ng.common,t.KendoLicensing,t.KendoDraggableCommon,t.KendoAngularCommon)}(this,function(t,s,e,a,r,i){"use strict";function n(n){var r;return n&&n.__esModule?n:(r=Object.create(null),n&&Object.keys(n).forEach(function(t){var e;"default"!==t&&(e=Object.getOwnPropertyDescriptor(n,t),Object.defineProperty(r,t,e.get?e:{enumerable:!0,get:function(){return n[t]}}))}),r.default=n,Object.freeze(r))}var o=n(s),l=n(e),c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function g(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function d(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;var p,u={name:"@progress/kendo-angular-utils",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1662650462,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"},m=function(t){this.element=t,this.hostClass=!0},f=(m.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:m,deps:[{token:o.ElementRef}],target:o.ɵɵFactoryTarget.Directive}),m.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:m,selector:"[kendoDragHandle]",host:{properties:{"class.k-cursor-pointer":"this.hostClass"}},exportAs:["kendoDragHandle"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:m,decorators:[{type:s.Directive,args:[{selector:"[kendoDragHandle]",exportAs:"kendoDragHandle"}]}],ctorParameters:function(){return[{type:o.ElementRef}]},propDecorators:{hostClass:[{type:s.HostBinding,args:["class.k-cursor-pointer"]}]}}),function(t){Object.assign(this,t)}),v=(h(y,p=i.PreventableEvent),y);function y(t){var e=p.call(this)||this;return Object.assign(e,t),e}var D,E=function(t){Object.assign(this,t)},O=(h(b,D=i.PreventableEvent),b);function b(t){var e=D.call(this)||this;return Object.assign(e,t),e}function T(t,e){return{event:t,payload:e}}function S(e,n,r){Object.keys(r).forEach(function(t){e.setStyle(n,t,r[t])})}function I(t){return null!=t}var C=function(t){this.element=t,this.hostClasses=!0,this.zIndex=10,this.touchAction="none"},P=(C.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:C,deps:[{token:o.ElementRef}],target:o.ɵɵFactoryTarget.Component}),C.ɵcmp=o.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:C,selector:"ng-component",inputs:{template:"template",directive:"directive"},host:{properties:{"class.k-pos-absolute":"this.hostClasses","class.k-cursor-grab":"this.hostClasses","style.zIndex":"this.zIndex","style.touch-action":"this.touchAction"}},ngImport:o,template:'\n <ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">\n </ng-container>\n ',isInline:!0,directives:[{type:l.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet"]}]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:C,decorators:[{type:s.Component,args:[{template:'\n <ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">\n </ng-container>\n '}]}],ctorParameters:function(){return[{type:o.ElementRef}]},propDecorators:{template:[{type:s.Input}],directive:[{type:s.Input}],hostClasses:[{type:s.HostBinding,args:["class.k-pos-absolute"]},{type:s.HostBinding,args:["class.k-cursor-grab"]}],zIndex:[{type:s.HostBinding,args:["style.zIndex"]}],touchAction:[{type:s.HostBinding,args:["style.touch-action"]}]}}),k.prototype.handleDragAndDrop=function(t){this.updateState(),r.dispatchDragAndDrop(this.state,t,this.callbacks)},k.prototype.setPressed=function(t){this.pressed=t},k.prototype.setScrolling=function(t){var e,n=this;(this.isScrolling=t)?(e=r.getScrollableParent(document.elementFromPoint(this.clientOffset.x,this.clientOffset.y)),window.clearInterval(this.scrollInterval),this.scrollInterval=window.setInterval(function(){r.autoScroll(e,{x:n.velocity.x,y:n.velocity.y})},50)):this.scrollInterval&&(window.clearInterval(this.scrollInterval),this.scrollInterval=null)},k.prototype.setVelocity=function(t){this.velocity=t},k.prototype.setOffset=function(t){this.offset=t},k.prototype.setClientOffset=function(t){this.clientOffset=t},k.prototype.setPageOffset=function(t){this.pageOffset=t},k.prototype.setInitialClientOffset=function(t){this.initialClientOffset=t},k.prototype.setScrollOffset=function(t){this.scrollOffset=t},k.prototype.setInitialScrollOffset=function(t){this.initialScrollOffset=t},k.prototype.updateState=function(){this.state={drag:this.dragTarget,drop:this.dropTarget,drags:this.dragTargets,drops:this.dropTargets,pressed:this.pressed,ignoreMouse:this.ignoreMouse,autoScroll:this.autoScroll,isScrolling:this.isScrolling,scrollableParent:this.scrollableParent,autoScrollDirection:this.autoScrollDirection,initialClientOffset:this.initialClientOffset,clientOffset:this.clientOffset,initialScrollOffset:this.initialScrollOffset,scrollOffset:this.scrollOffset,offset:this.offset,pageOffset:this.pageOffset,velocity:this.velocity}},k.prototype.setCallbacks=function(){this.callbacks={onVelocityChange:this.setVelocity.bind(this),onOffsetChange:this.setOffset.bind(this),onClientOffsetChange:this.setClientOffset.bind(this),onPageOffsetChange:this.setPageOffset.bind(this),onInitialClientOffsetChange:this.setInitialClientOffset.bind(this),onScrollOffsetChange:this.setScrollOffset.bind(this),onInitialScrollOffsetChange:this.setInitialScrollOffset.bind(this),onIsPressedChange:this.setPressed.bind(this),onIsScrollingChange:this.setScrolling.bind(this)}},k.prototype.ngOnDestroy=function(){this.scrollInterval&&(window.clearInterval(this.scrollInterval),this.scrollInterval=null)},k);function k(){this.dragTarget=null,this.dropTarget=null,this.dragTargets=[],this.dropTargets=[],this.pressed=!1,this.ignoreMouse=!1,this.autoScroll=!0,this.isScrolling=!1,this.scrollableParent=null,this.autoScrollDirection={horizontal:!0,vertical:!0},this.initialClientOffset={x:0,y:0},this.clientOffset={x:0,y:0},this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},this.offset={x:0,y:0},this.pageOffset={x:0,y:0},this.velocity={x:0,y:0},this.callbacks={},this.scrollInterval=null,this.setCallbacks()}P.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,deps:[],target:o.ɵɵFactoryTarget.Injectable}),P.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[]}});var w=!1,x=!1,l=(Object.defineProperty(A.prototype,"nativeElement",{get:function(){return this.element.nativeElement},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hintElem",{get:function(){return this.hint.instance.element.nativeElement},enumerable:!1,configurable:!0}),A.prototype.onPointerDown=function(t){var e=this;this.dragHandles.length&&!this.isDragHandle(t.target)||(t.preventDefault(),t=T(t,this.dragTarget),this.service.handleDragAndDrop(t),this.service.autoScroll="object"==typeof this.autoScroll?!1!==this.autoScroll.enabled:this.autoScroll,this.service.scrollableParent=this.getAutoScrollContainer(),this.service.autoScrollDirection="object"==typeof this.autoScroll?this.autoScroll.direction:{horizontal:!0,vertical:!0},this.ngZone.runOutsideAngular(function(){e.attachDomHandlers()}))},A.prototype.onPointerMove=function(t){t.preventDefault();t=T(t,this.dragTarget);this.service.handleDragAndDrop(t)},A.prototype.onPointerUp=function(t){var e=this,t=(t.preventDefault(),T(t,this.dragTarget));this.service.handleDragAndDrop(t),this.ngZone.runOutsideAngular(function(){e.attachDomHandlers()})},A.prototype.ngOnInit=function(){this.initializeDraggable()},A.prototype.ngAfterContentInit=function(){var t=this;(I(this.element)||I(this.dragTarget))&&this.ngZone.runOutsideAngular(function(){t.attachDomHandlers(),t.dragHandles.length||t.renderer.addClass(t.nativeElement,"k-cursor-pointer")}),this.service.dragTargets.push(this.dragTarget)},A.prototype.ngOnDestroy=function(){this.domSubscriptions.forEach(function(t){return t()})},A.prototype.handlePress=function(e){var n=this;0<this.dragDelay?this.dragTimeout=setTimeout(function(){n.pressed=!0,n.ngZone.run(function(){n.dragReady.emit()})},this.dragDelay):this.pressed=!0,this.ngZone.run(function(){var t=new f({normalizedEvent:e,hostElement:n.nativeElement});n.press.emit(t)})},A.prototype.handleDragStart=function(t){var e=this;this.pressed?(this.ngZone.run(function(){w=e.emitEvent("dragStart",{normalizedEvent:t,hostElement:e.nativeElement}).isDefaultPrevented()}),w||(I(this.hintTemplate)&&(this.createHint(),I(this.hint)&&this.renderer.setStyle(this.nativeElement,"opacity","0.7")),this.dragStarted=0===this.threshold,this.service.dragTarget=this.dragTarget,(this.service.dragTargetDirective=this).initialPosition={x:t.clientX-this.position.x,y:t.clientY-this.position.y})):this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null)},A.prototype.handleDrag=function(t){var e,n,r=this;this.pressed&&!w&&(e=this.hint?this.hintElem:this.nativeElement,n=e===this.nativeElement?{normalizedEvent:t,hostElement:this.nativeElement}:{normalizedEvent:t,hostElement:this.nativeElement,hintElement:e},this.ngZone.run(function(){x=r.emitEvent("drag",n).isDefaultPrevented()}),x||("horizontal"===this.restrictByAxis?this.position={x:t.clientX-this.initialPosition.x+t.scrollX,y:0}:"vertical"===this.restrictByAxis?this.position={x:0,y:t.clientY-this.initialPosition.y+t.scrollY}:this.position={x:t.clientX-this.initialPosition.x+t.scrollX,y:t.clientY-this.initialPosition.y+t.scrollY},t=Math.abs(this.position.x)<this.threshold&&Math.abs(this.position.y)<this.threshold,!this.dragStarted&&t||(!this.dragStarted&&0<this.threshold&&(this.dragStarted=!0),t="translate("+this.position.x+"px, "+this.position.y+"px)",S(this.renderer,e,{transform:t,transition:"none"}))))},A.prototype.handleDragEnd=function(e){var n=this,t=(this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null,this.pressed=!1),I(this.service.dropTarget)&&!i.contains(this.service.dropTarget,this.service.dragTarget,!0)),r=this.hint?this.hintElem:this.nativeElement;(t||0<this.service.dropTargets.length)&&(this.renderer.removeStyle(r,"transform"),S(this.renderer,r,{transition:"transform .3s ease-in-out"}),this.position={x:0,y:0}),I(this.hint)&&(this.renderer.removeStyle(this.nativeElement,"opacity"),this.destroyHint()),this.service.dragTarget=null,this.service.dragTargetDirective=null,!this.dragStarted||w||x||(this.ngZone.run(function(){var t=new E({normalizedEvent:e,hostElement:n.nativeElement});n.dragEnd.emit(t)}),this.dragStarted=!1)},A.prototype.initializeDraggable=function(){this.dragTarget={element:this.nativeElement,hint:null,onPress:this.handlePress.bind(this),onRelease:this.handleDragEnd.bind(this),onDragStart:this.handleDragStart.bind(this),onDrag:this.handleDrag.bind(this)}},A.prototype.attachDomHandlers=function(){var t;0<this.domSubscriptions.length&&this.domSubscriptions.forEach(function(t){return t()}),i.isDocumentAvailable()&&I(this.element)&&(this.service.pressed?(this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),t=r.getScrollableParent(this.nativeElement),this.domSubscriptions=[this.renderer.listen(document,"pointermove",this.onPointerMove),this.renderer.listen(document,"mousemove",this.onPointerMove),this.renderer.listen(document,"touchmove",this.onPointerMove),this.renderer.listen(document,"pointerup",this.onPointerUp),this.renderer.listen(document,"pointercancel",this.onPointerUp),this.renderer.listen(document,"mouseup",this.onPointerUp),this.renderer.listen(document,"contextmenu",this.onPointerUp),this.renderer.listen(document,"touchend",this.onPointerUp),this.renderer.listen(document,"touchcancel",this.onPointerUp)],t&&(t===document.getElementsByTagName("html")[0]&&(t=document),this.domSubscriptions.push(this.renderer.listen(t,"scroll",this.onPointerMove)))):(this.onPointerDown=this.onPointerDown.bind(this),t=this.nativeElement,this.domSubscriptions=[this.renderer.listen(t,"pointerdown",this.onPointerDown),this.renderer.listen(t,"mousedown",this.onPointerDown),this.renderer.listen(t,"touchstart",this.onPointerDown)]))},A.prototype.isDragHandle=function(e){return this.dragHandles.toArray().some(function(t){return i.contains(t.element.nativeElement,e,!0)})},A.prototype.getAutoScrollContainer=function(){return"object"==typeof this.autoScroll&&this.autoScroll.boundaryElementRef&&this.autoScroll.boundaryElementRef.nativeElement?this.autoScroll.boundaryElementRef.nativeElement:null},A.prototype.createHint=function(){var t=this.resolver.resolveComponentFactory(C);this.hint=this.viewContainer.createComponent(t),this.hint.instance.template=this.hintTemplate,(this.hint.instance.directive=this).hint.changeDetectorRef.detectChanges(),this.dragTarget.hint=this.hint.instance.element.nativeElement},A.prototype.destroyHint=function(){this.hint.destroy(),this.hint.changeDetectorRef.detectChanges(),this.hint=null,this.dragTarget.hint=null},A.prototype.emitEvent=function(t,e){var n;switch(t){case"dragStart":n=new v(e);break;case"drag":n=new O(e)}return this[t].emit(n),n},A);function A(t,e,n,r,i,o){this.element=t,this.renderer=e,this.ngZone=n,this.service=r,this.viewContainer=i,this.resolver=o,this.threshold=0,this.autoScroll=!0,this.dragDelay=0,this.press=new s.EventEmitter,this.dragStart=new s.EventEmitter,this.drag=new s.EventEmitter,this.dragReady=new s.EventEmitter,this.dragEnd=new s.EventEmitter,this.touchAction="none",this.dragTarget=null,this.domSubscriptions=[],this.hint=null,this.initialPosition={x:0,y:0},this.dragStarted=!1,this.pressed=!1,this.dragTimeout=null,this.position={x:0,y:0},a.validatePackage(u)}l.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:l,deps:[{token:o.ElementRef},{token:o.Renderer2},{token:o.NgZone},{token:P},{token:o.ViewContainerRef},{token:o.ComponentFactoryResolver}],target:o.ɵɵFactoryTarget.Directive}),l.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:l,selector:"[kendoDragTarget]",inputs:{hintTemplate:"hintTemplate",threshold:"threshold",autoScroll:"autoScroll",link:"link",dragDelay:"dragDelay",restrictByAxis:"restrictByAxis"},outputs:{press:"press",dragStart:"dragStart",drag:"drag",dragReady:"dragReady",dragEnd:"dragEnd"},host:{properties:{"style.touch-action":"this.touchAction"}},queries:[{propertyName:"dragHandles",predicate:m}],exportAs:["kendoDragTarget"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:l,decorators:[{type:s.Directive,args:[{selector:"[kendoDragTarget]",exportAs:"kendoDragTarget"}]}],ctorParameters:function(){return[{type:o.ElementRef},{type:o.Renderer2},{type:o.NgZone},{type:P},{type:o.ViewContainerRef},{type:o.ComponentFactoryResolver}]},propDecorators:{hintTemplate:[{type:s.Input}],threshold:[{type:s.Input}],autoScroll:[{type:s.Input}],link:[{type:s.Input}],dragDelay:[{type:s.Input}],restrictByAxis:[{type:s.Input}],press:[{type:s.Output}],dragStart:[{type:s.Output}],drag:[{type:s.Output}],dragReady:[{type:s.Output}],dragEnd:[{type:s.Output}],touchAction:[{type:s.HostBinding,args:["style.touch-action"]}],dragHandles:[{type:s.ContentChildren,args:[m]}]}});var R=function(t){Object.assign(this,t)},z=function(t){Object.assign(this,t)},F=function(t){Object.assign(this,t)},Z=function(t){Object.assign(this,t)},j=(M.prototype.ngOnInit=function(){this.initializeDropTarget(),this.service.dropTargets.push(this.dropTarget)},M.prototype.handleDragEnter=function(e){var n=this;if(this.service.dragTarget){var t=!0;if(I(this.allowedDragTargets))switch(typeof this.allowedDragTargets){case"function":t=this.allowedDragTargets(this.service.dragTargetDirective);break;case"string":t=this.service.dragTargetDirective.link===this.allowedDragTargets;break;default:t=this.allowedDragTargets.some(function(t){return t===n.service.dragTargetDirective.link})}t&&(this.service.dropTarget=this.dropTarget,this.ngZone.run(function(){var t=new R({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragEnter.emit(t)}))}},M.prototype.handleDragLeave=function(e){var n=this;this.service.dropTarget=null,this.service.dragTarget&&this.ngZone.run(function(){var t=new F({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragLeave.emit(t)})},M.prototype.handleDragOver=function(e){var n=this;this.service.dragTarget&&this.ngZone.run(function(){var t=new z({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragOver.emit(t)})},M.prototype.handleDrop=function(e){var n=this;this.ngZone.run(function(){var t=new Z({normalizedEvent:e,hostElement:n.element.nativeElement});n.drop.emit(t)})},M.prototype.initializeDropTarget=function(){this.dropTarget={element:this.element.nativeElement,onDragEnter:this.handleDragEnter.bind(this),onDragLeave:this.handleDragLeave.bind(this),onDragOver:this.handleDragOver.bind(this),onDrop:this.handleDrop.bind(this)}},M);function M(t,e,n){this.service=t,this.element=e,this.ngZone=n,this.dragEnter=new s.EventEmitter,this.dragOver=new s.EventEmitter,this.dragLeave=new s.EventEmitter,this.drop=new s.EventEmitter,a.validatePackage(u)}j.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:j,deps:[{token:P},{token:o.ElementRef},{token:o.NgZone}],target:o.ɵɵFactoryTarget.Directive}),j.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:j,selector:"[kendoDropTarget]",inputs:{allowedDragTargets:"allowedDragTargets"},outputs:{dragEnter:"dragEnter",dragOver:"dragOver",dragLeave:"dragLeave",drop:"drop"},exportAs:["kendoDropTarget"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:j,decorators:[{type:s.Directive,args:[{selector:"[kendoDropTarget]",exportAs:"kendoDropTarget"}]}],ctorParameters:function(){return[{type:P},{type:o.ElementRef},{type:o.NgZone}]},propDecorators:{allowedDragTargets:[{type:s.Input}],dragEnter:[{type:s.Output}],dragOver:[{type:s.Output}],dragLeave:[{type:s.Output}],drop:[{type:s.Output}]}});var V=[l,m,j,C],H=function(){},V=(H.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:H,deps:[],target:o.ɵɵFactoryTarget.NgModule}),H.ɵmod=o.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:H,declarations:[l,m,j,C],imports:[e.CommonModule],exports:[l,m,j,C]}),H.ɵinj=o.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:H,imports:[[e.CommonModule]]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:H,decorators:[{type:s.NgModule,args:[{declarations:d([],g(V)),exports:d([],g(V)),imports:[e.CommonModule]}]}]}),function(){});V.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,deps:[],target:o.ɵɵFactoryTarget.NgModule}),V.ɵmod=o.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,exports:[H]}),V.ɵinj=o.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,imports:[H]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,decorators:[{type:s.NgModule,args:[{exports:[H]}]}]}),t.DragAndDropModule=H,t.DragEndEvent=E,t.DragEnterEvent=R,t.DragEvent=O,t.DragHandleDirective=m,t.DragLeaveEvent=F,t.DragOverEvent=z,t.DragStartEvent=v,t.DragTargetDirective=l,t.DropEvent=Z,t.DropTargetDirective=j,t.HintComponent=C,t.PressEvent=f,t.UtilsModule=V,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
5
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@progress/kendo-licensing"),require("@progress/kendo-draggable-common"),require("@progress/kendo-angular-common")):"function"==typeof define&&define.amd?define("KendoAngularUtils",["exports","@angular/core","@angular/common","@progress/kendo-licensing","@progress/kendo-draggable-common","@progress/kendo-angular-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoAngularUtils={},t.ng.core,t.ng.common,t.KendoLicensing,t.KendoDraggableCommon,t.KendoAngularCommon)}(this,function(t,s,e,a,r,i){"use strict";function n(n){var r;return n&&n.__esModule?n:(r=Object.create(null),n&&Object.keys(n).forEach(function(t){var e;"default"!==t&&(e=Object.getOwnPropertyDescriptor(n,t),Object.defineProperty(r,t,e.get?e:{enumerable:!0,get:function(){return n[t]}}))}),r.default=n,Object.freeze(r))}var o=n(s),l=n(e),c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function g(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function d(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;var p,u={name:"@progress/kendo-angular-utils",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1663064885,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"},m=function(t){this.element=t,this.hostClass=!0},f=(m.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:m,deps:[{token:o.ElementRef}],target:o.ɵɵFactoryTarget.Directive}),m.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:m,selector:"[kendoDragHandle]",host:{properties:{"class.k-cursor-pointer":"this.hostClass"}},exportAs:["kendoDragHandle"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:m,decorators:[{type:s.Directive,args:[{selector:"[kendoDragHandle]",exportAs:"kendoDragHandle"}]}],ctorParameters:function(){return[{type:o.ElementRef}]},propDecorators:{hostClass:[{type:s.HostBinding,args:["class.k-cursor-pointer"]}]}}),function(t){Object.assign(this,t)}),v=(h(y,p=i.PreventableEvent),y);function y(t){var e=p.call(this)||this;return Object.assign(e,t),e}var D,E=function(t){Object.assign(this,t)},T=(h(O,D=i.PreventableEvent),O);function O(t){var e=D.call(this)||this;return Object.assign(e,t),e}function b(t,e){return{event:t,payload:e}}function S(e,n,r){Object.keys(r).forEach(function(t){e.setStyle(n,t,r[t])})}function I(t){return null!=t}var C=function(t){this.element=t,this.hostClasses=!0,this.zIndex=10,this.touchAction="none"},P=(C.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:C,deps:[{token:o.ElementRef}],target:o.ɵɵFactoryTarget.Component}),C.ɵcmp=o.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:C,selector:"ng-component",inputs:{template:"template",directive:"directive"},host:{properties:{"class.k-pos-absolute":"this.hostClasses","class.k-cursor-grab":"this.hostClasses","style.zIndex":"this.zIndex","style.touch-action":"this.touchAction"}},ngImport:o,template:'\n <ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">\n </ng-container>\n ',isInline:!0,directives:[{type:l.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet"]}]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:C,decorators:[{type:s.Component,args:[{template:'\n <ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">\n </ng-container>\n '}]}],ctorParameters:function(){return[{type:o.ElementRef}]},propDecorators:{template:[{type:s.Input}],directive:[{type:s.Input}],hostClasses:[{type:s.HostBinding,args:["class.k-pos-absolute"]},{type:s.HostBinding,args:["class.k-cursor-grab"]}],zIndex:[{type:s.HostBinding,args:["style.zIndex"]}],touchAction:[{type:s.HostBinding,args:["style.touch-action"]}]}}),k.prototype.handleDragAndDrop=function(t){this.updateState(),r.dispatchDragAndDrop(this.state,t,this.callbacks)},k.prototype.setPressed=function(t){this.pressed=t},k.prototype.setScrolling=function(t){var e,n=this;(this.isScrolling=t)?(e=r.getScrollableParent(document.elementFromPoint(this.clientOffset.x,this.clientOffset.y)),window.clearInterval(this.scrollInterval),this.scrollInterval=window.setInterval(function(){r.autoScroll(e,{x:n.velocity.x,y:n.velocity.y})},50)):this.scrollInterval&&(window.clearInterval(this.scrollInterval),this.scrollInterval=null)},k.prototype.setVelocity=function(t){this.velocity=t},k.prototype.setOffset=function(t){this.offset=t},k.prototype.setClientOffset=function(t){this.clientOffset=t},k.prototype.setPageOffset=function(t){this.pageOffset=t},k.prototype.setInitialClientOffset=function(t){this.initialClientOffset=t},k.prototype.setScrollOffset=function(t){this.scrollOffset=t},k.prototype.setInitialScrollOffset=function(t){this.initialScrollOffset=t},k.prototype.updateState=function(){this.state={drag:this.dragTarget,drop:this.dropTarget,drags:this.dragTargets,drops:this.dropTargets,pressed:this.pressed,ignoreMouse:this.ignoreMouse,autoScroll:this.autoScroll,isScrolling:this.isScrolling,scrollableParent:this.scrollableParent,autoScrollDirection:this.autoScrollDirection,initialClientOffset:this.initialClientOffset,clientOffset:this.clientOffset,initialScrollOffset:this.initialScrollOffset,scrollOffset:this.scrollOffset,offset:this.offset,pageOffset:this.pageOffset,velocity:this.velocity}},k.prototype.setCallbacks=function(){this.callbacks={onVelocityChange:this.setVelocity.bind(this),onOffsetChange:this.setOffset.bind(this),onClientOffsetChange:this.setClientOffset.bind(this),onPageOffsetChange:this.setPageOffset.bind(this),onInitialClientOffsetChange:this.setInitialClientOffset.bind(this),onScrollOffsetChange:this.setScrollOffset.bind(this),onInitialScrollOffsetChange:this.setInitialScrollOffset.bind(this),onIsPressedChange:this.setPressed.bind(this),onIsScrollingChange:this.setScrolling.bind(this)}},k.prototype.ngOnDestroy=function(){this.scrollInterval&&(window.clearInterval(this.scrollInterval),this.scrollInterval=null)},k);function k(){this.dragTarget=null,this.dropTarget=null,this.dragTargets=[],this.dropTargets=[],this.pressed=!1,this.ignoreMouse=!1,this.autoScroll=!0,this.isScrolling=!1,this.scrollableParent=null,this.autoScrollDirection={horizontal:!0,vertical:!0},this.initialClientOffset={x:0,y:0},this.clientOffset={x:0,y:0},this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},this.offset={x:0,y:0},this.pageOffset={x:0,y:0},this.velocity={x:0,y:0},this.callbacks={},this.scrollInterval=null,this.setCallbacks()}P.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,deps:[],target:o.ɵɵFactoryTarget.Injectable}),P.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[]}});var w=!1,x=!1,l=(Object.defineProperty(A.prototype,"nativeElement",{get:function(){return this.element.nativeElement},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hintElem",{get:function(){return this.hint.instance.element.nativeElement},enumerable:!1,configurable:!0}),A.prototype.onPointerDown=function(t){var e=this;this.dragHandles.length&&!this.isDragHandle(t.target)||(t.preventDefault(),t=b(t,this.dragTarget),this.service.handleDragAndDrop(t),this.service.autoScroll="object"==typeof this.autoScroll?!1!==this.autoScroll.enabled:this.autoScroll,this.service.scrollableParent=this.getAutoScrollContainer(),this.service.autoScrollDirection="object"==typeof this.autoScroll?this.autoScroll.direction:{horizontal:!0,vertical:!0},this.ngZone.runOutsideAngular(function(){e.attachDomHandlers()}))},A.prototype.onPointerMove=function(t){t.preventDefault();t=b(t,this.dragTarget);this.service.handleDragAndDrop(t)},A.prototype.onPointerUp=function(t){var e=this,t=(t.preventDefault(),b(t,this.dragTarget));this.service.handleDragAndDrop(t),this.ngZone.runOutsideAngular(function(){e.attachDomHandlers()})},A.prototype.ngOnInit=function(){this.initializeDraggable()},A.prototype.ngAfterContentInit=function(){var t=this;(I(this.element)||I(this.dragTarget))&&this.ngZone.runOutsideAngular(function(){t.attachDomHandlers(),t.dragHandles.length||t.renderer.addClass(t.nativeElement,"k-cursor-pointer")}),this.service.dragTargets.push(this.dragTarget)},A.prototype.ngOnDestroy=function(){this.domSubscriptions.forEach(function(t){return t()})},A.prototype.handlePress=function(e){var n=this;0<this.dragDelay?this.dragTimeout=setTimeout(function(){n.pressed=!0,n.ngZone.run(function(){n.dragReady.emit()})},this.dragDelay):this.pressed=!0,this.ngZone.run(function(){var t=new f({normalizedEvent:e,hostElement:n.nativeElement});n.press.emit(t)})},A.prototype.handleDragStart=function(t){var e=this;this.pressed?(this.ngZone.run(function(){w=e.emitEvent("dragStart",{normalizedEvent:t,hostElement:e.nativeElement}).isDefaultPrevented()}),w||(I(this.hintTemplate)&&(this.createHint(),I(this.hint)&&this.renderer.setStyle(this.nativeElement,"opacity","0.7")),this.dragStarted=0===this.threshold,this.service.dragTarget=this.dragTarget,(this.service.dragTargetDirective=this).initialPosition={x:t.clientX-this.position.x,y:t.clientY-this.position.y})):this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null)},A.prototype.handleDrag=function(t){var e,n,r=this;this.pressed&&!w&&(e=this.hint?this.hintElem:this.nativeElement,n=e===this.nativeElement?{normalizedEvent:t,hostElement:this.nativeElement}:{normalizedEvent:t,hostElement:this.nativeElement,hintElement:e},this.ngZone.run(function(){x=r.emitEvent("drag",n).isDefaultPrevented()}),x||("horizontal"===this.restrictByAxis?this.position={x:t.clientX-this.initialPosition.x+t.scrollX,y:0}:"vertical"===this.restrictByAxis?this.position={x:0,y:t.clientY-this.initialPosition.y+t.scrollY}:this.position={x:t.clientX-this.initialPosition.x+t.scrollX,y:t.clientY-this.initialPosition.y+t.scrollY},t=Math.abs(this.position.x)<this.threshold&&Math.abs(this.position.y)<this.threshold,!this.dragStarted&&t||(!this.dragStarted&&0<this.threshold&&(this.dragStarted=!0),t="translate("+this.position.x+"px, "+this.position.y+"px)",S(this.renderer,e,{transform:t,transition:"none"}))))},A.prototype.handleRelease=function(e){var n=this;this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null,this.pressed=!1),this.service.dragTarget=null,this.service.dragTargetDirective=null,this.ngZone.run(function(){var t=new f({normalizedEvent:e,hostElement:n.nativeElement});n.release.emit(t)})},A.prototype.handleDragEnd=function(e){var n=this,t=(this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null,this.pressed=!1),I(this.service.dropTarget)&&!i.contains(this.service.dropTarget,this.service.dragTarget,!0)),r=this.hint?this.hintElem:this.nativeElement;(t||0<this.service.dropTargets.length)&&(this.renderer.removeStyle(r,"transform"),S(this.renderer,r,{transition:"transform .3s ease-in-out"}),this.position={x:0,y:0}),I(this.hint)&&(this.renderer.removeStyle(this.nativeElement,"opacity"),this.destroyHint()),this.service.dragTarget=null,this.service.dragTargetDirective=null,!this.dragStarted||w||x||(this.ngZone.run(function(){var t=new E({normalizedEvent:e,hostElement:n.nativeElement});n.dragEnd.emit(t)}),this.dragStarted=!1)},A.prototype.initializeDraggable=function(){this.dragTarget={element:this.nativeElement,hint:null,onPress:this.handlePress.bind(this),onRelease:this.handleRelease.bind(this),onDragStart:this.handleDragStart.bind(this),onDrag:this.handleDrag.bind(this),onDragEnd:this.handleDragEnd.bind(this)}},A.prototype.attachDomHandlers=function(){var t;0<this.domSubscriptions.length&&this.domSubscriptions.forEach(function(t){return t()}),i.isDocumentAvailable()&&I(this.element)&&(this.service.pressed?(this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),t=r.getScrollableParent(this.nativeElement),this.domSubscriptions=[this.renderer.listen(document,"pointermove",this.onPointerMove),this.renderer.listen(document,"mousemove",this.onPointerMove),this.renderer.listen(document,"touchmove",this.onPointerMove),this.renderer.listen(document,"pointerup",this.onPointerUp),this.renderer.listen(document,"pointercancel",this.onPointerUp),this.renderer.listen(document,"mouseup",this.onPointerUp),this.renderer.listen(document,"contextmenu",this.onPointerUp),this.renderer.listen(document,"touchend",this.onPointerUp),this.renderer.listen(document,"touchcancel",this.onPointerUp)],t&&(t===document.getElementsByTagName("html")[0]&&(t=document),this.domSubscriptions.push(this.renderer.listen(t,"scroll",this.onPointerMove)))):(this.onPointerDown=this.onPointerDown.bind(this),t=this.nativeElement,this.domSubscriptions=[this.renderer.listen(t,"pointerdown",this.onPointerDown),this.renderer.listen(t,"mousedown",this.onPointerDown),this.renderer.listen(t,"touchstart",this.onPointerDown)]))},A.prototype.isDragHandle=function(e){return this.dragHandles.toArray().some(function(t){return i.contains(t.element.nativeElement,e,!0)})},A.prototype.getAutoScrollContainer=function(){return"object"==typeof this.autoScroll&&this.autoScroll.boundaryElementRef&&this.autoScroll.boundaryElementRef.nativeElement?this.autoScroll.boundaryElementRef.nativeElement:null},A.prototype.createHint=function(){var t=this.resolver.resolveComponentFactory(C);this.hint=this.viewContainer.createComponent(t),this.hint.instance.template=this.hintTemplate,(this.hint.instance.directive=this).hint.changeDetectorRef.detectChanges(),this.dragTarget.hint=this.hint.instance.element.nativeElement},A.prototype.destroyHint=function(){this.hint.destroy(),this.hint.changeDetectorRef.detectChanges(),this.hint=null,this.dragTarget.hint=null},A.prototype.emitEvent=function(t,e){var n;switch(t){case"dragStart":n=new v(e);break;case"drag":n=new T(e)}return this[t].emit(n),n},A);function A(t,e,n,r,i,o){this.element=t,this.renderer=e,this.ngZone=n,this.service=r,this.viewContainer=i,this.resolver=o,this.threshold=0,this.autoScroll=!0,this.dragDelay=0,this.press=new s.EventEmitter,this.dragStart=new s.EventEmitter,this.drag=new s.EventEmitter,this.dragReady=new s.EventEmitter,this.release=new s.EventEmitter,this.dragEnd=new s.EventEmitter,this.touchAction="none",this.dragTarget=null,this.domSubscriptions=[],this.hint=null,this.initialPosition={x:0,y:0},this.dragStarted=!1,this.pressed=!1,this.dragTimeout=null,this.position={x:0,y:0},a.validatePackage(u)}l.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:l,deps:[{token:o.ElementRef},{token:o.Renderer2},{token:o.NgZone},{token:P},{token:o.ViewContainerRef},{token:o.ComponentFactoryResolver}],target:o.ɵɵFactoryTarget.Directive}),l.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:l,selector:"[kendoDragTarget]",inputs:{hintTemplate:"hintTemplate",threshold:"threshold",autoScroll:"autoScroll",link:"link",dragDelay:"dragDelay",restrictByAxis:"restrictByAxis"},outputs:{press:"press",dragStart:"dragStart",drag:"drag",dragReady:"dragReady",release:"release",dragEnd:"dragEnd"},host:{properties:{"style.touch-action":"this.touchAction"}},queries:[{propertyName:"dragHandles",predicate:m}],exportAs:["kendoDragTarget"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:l,decorators:[{type:s.Directive,args:[{selector:"[kendoDragTarget]",exportAs:"kendoDragTarget"}]}],ctorParameters:function(){return[{type:o.ElementRef},{type:o.Renderer2},{type:o.NgZone},{type:P},{type:o.ViewContainerRef},{type:o.ComponentFactoryResolver}]},propDecorators:{hintTemplate:[{type:s.Input}],threshold:[{type:s.Input}],autoScroll:[{type:s.Input}],link:[{type:s.Input}],dragDelay:[{type:s.Input}],restrictByAxis:[{type:s.Input}],press:[{type:s.Output}],dragStart:[{type:s.Output}],drag:[{type:s.Output}],dragReady:[{type:s.Output}],release:[{type:s.Output}],dragEnd:[{type:s.Output}],touchAction:[{type:s.HostBinding,args:["style.touch-action"]}],dragHandles:[{type:s.ContentChildren,args:[m]}]}});var H=function(t){Object.assign(this,t)},z=function(t){Object.assign(this,t)},Z=function(t){Object.assign(this,t)},F=function(t){Object.assign(this,t)},j=(M.prototype.ngOnInit=function(){this.initializeDropTarget(),this.service.dropTargets.push(this.dropTarget)},M.prototype.handleDragEnter=function(e){var n=this;if(this.service.dragTarget){var t=!0;if(I(this.allowedDragTargets))switch(typeof this.allowedDragTargets){case"function":t=this.allowedDragTargets(this.service.dragTargetDirective);break;case"string":t=this.service.dragTargetDirective.link===this.allowedDragTargets;break;default:t=this.allowedDragTargets.some(function(t){return t===n.service.dragTargetDirective.link})}t&&(this.service.dropTarget=this.dropTarget,this.ngZone.run(function(){var t=new H({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragEnter.emit(t)}))}},M.prototype.handleDragLeave=function(e){var n=this;this.service.dropTarget=null,this.service.dragTarget&&this.ngZone.run(function(){var t=new Z({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragLeave.emit(t)})},M.prototype.handleDragOver=function(e){var n=this;this.service.dragTarget&&this.ngZone.run(function(){var t=new z({normalizedEvent:e,hostElement:n.element.nativeElement});n.dragOver.emit(t)})},M.prototype.handleDrop=function(e){var n=this;this.ngZone.run(function(){var t=new F({normalizedEvent:e,hostElement:n.element.nativeElement});n.drop.emit(t)})},M.prototype.initializeDropTarget=function(){this.dropTarget={element:this.element.nativeElement,onDragEnter:this.handleDragEnter.bind(this),onDragLeave:this.handleDragLeave.bind(this),onDragOver:this.handleDragOver.bind(this),onDrop:this.handleDrop.bind(this)}},M);function M(t,e,n){this.service=t,this.element=e,this.ngZone=n,this.dragEnter=new s.EventEmitter,this.dragOver=new s.EventEmitter,this.dragLeave=new s.EventEmitter,this.drop=new s.EventEmitter,a.validatePackage(u)}j.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:j,deps:[{token:P},{token:o.ElementRef},{token:o.NgZone}],target:o.ɵɵFactoryTarget.Directive}),j.ɵdir=o.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:j,selector:"[kendoDropTarget]",inputs:{allowedDragTargets:"allowedDragTargets"},outputs:{dragEnter:"dragEnter",dragOver:"dragOver",dragLeave:"dragLeave",drop:"drop"},exportAs:["kendoDropTarget"],ngImport:o}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:j,decorators:[{type:s.Directive,args:[{selector:"[kendoDropTarget]",exportAs:"kendoDropTarget"}]}],ctorParameters:function(){return[{type:P},{type:o.ElementRef},{type:o.NgZone}]},propDecorators:{allowedDragTargets:[{type:s.Input}],dragEnter:[{type:s.Output}],dragOver:[{type:s.Output}],dragLeave:[{type:s.Output}],drop:[{type:s.Output}]}});var R=[l,m,j,C],V=function(){},R=(V.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,deps:[],target:o.ɵɵFactoryTarget.NgModule}),V.ɵmod=o.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,declarations:[l,m,j,C],imports:[e.CommonModule],exports:[l,m,j,C]}),V.ɵinj=o.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,imports:[[e.CommonModule]]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:V,decorators:[{type:s.NgModule,args:[{declarations:d([],g(R)),exports:d([],g(R)),imports:[e.CommonModule],entryComponents:[C]}]}]}),function(){});R.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:R,deps:[],target:o.ɵɵFactoryTarget.NgModule}),R.ɵmod=o.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:R,exports:[V]}),R.ɵinj=o.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:R,imports:[V]}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:R,decorators:[{type:s.NgModule,args:[{exports:[V]}]}]}),t.DragAndDropModule=V,t.DragHandleDirective=m,t.DragTargetDirective=l,t.DragTargetDragEndEvent=E,t.DragTargetDragEvent=T,t.DragTargetDragStartEvent=v,t.DragTargetPressEvent=f,t.DropTargetDirective=j,t.DropTargetDragEnterEvent=H,t.DropTargetDragLeaveEvent=Z,t.DropTargetDragOverEvent=z,t.DropTargetDropEvent=F,t.HintComponent=C,t.UtilsModule=R,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { EventEmitter, AfterContentInit, ElementRef, Renderer2, NgZone, OnInit, OnDestroy, QueryList, TemplateRef, ViewContainerRef, ComponentFactoryResolver } from "@angular/core";
|
|
6
6
|
import { DragHandleDirective } from "./draghandle.directive";
|
|
7
|
-
import {
|
|
7
|
+
import { DragTargetDragStartEvent, DragTargetDragEndEvent, DragTargetPressEvent, DragTargetDragEvent } from "./events/drag-target";
|
|
8
8
|
import { DragStateService } from "./drag-state.service";
|
|
9
9
|
import { AutoScrollOptions, DragAxis } from './models';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
@@ -51,25 +51,29 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
51
51
|
/**
|
|
52
52
|
* Fires when the user presses the DragTarget element.
|
|
53
53
|
*/
|
|
54
|
-
press: EventEmitter<
|
|
54
|
+
press: EventEmitter<DragTargetPressEvent>;
|
|
55
55
|
/**
|
|
56
56
|
* Fires when the dragging of the DragTarget element begins.
|
|
57
57
|
* This event is preventable.
|
|
58
58
|
*/
|
|
59
|
-
dragStart: EventEmitter<
|
|
59
|
+
dragStart: EventEmitter<DragTargetDragStartEvent>;
|
|
60
60
|
/**
|
|
61
61
|
* Fires while the user drags the DragTarget element.
|
|
62
62
|
* This event is preventable.
|
|
63
63
|
*/
|
|
64
|
-
drag: EventEmitter<
|
|
64
|
+
drag: EventEmitter<DragTargetDragEvent>;
|
|
65
65
|
/**
|
|
66
|
-
* Fires when the DragTarget's dragDelay has passed and the user is able to drag the element.
|
|
66
|
+
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
67
67
|
*/
|
|
68
68
|
dragReady: EventEmitter<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Fires when the user releases the DragTarget element after being pressed.
|
|
71
|
+
*/
|
|
72
|
+
release: EventEmitter<DragTargetPressEvent>;
|
|
69
73
|
/**
|
|
70
74
|
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
71
75
|
*/
|
|
72
|
-
dragEnd: EventEmitter<
|
|
76
|
+
dragEnd: EventEmitter<DragTargetDragEndEvent>;
|
|
73
77
|
touchAction: string;
|
|
74
78
|
private dragTarget;
|
|
75
79
|
private domSubscriptions;
|
|
@@ -112,42 +116,16 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
112
116
|
* @hidden
|
|
113
117
|
*/
|
|
114
118
|
private handleDragStart;
|
|
115
|
-
/**
|
|
116
|
-
* @hidden
|
|
117
|
-
*/
|
|
118
119
|
private handleDrag;
|
|
119
|
-
|
|
120
|
-
* @hidden
|
|
121
|
-
*/
|
|
120
|
+
private handleRelease;
|
|
122
121
|
private handleDragEnd;
|
|
123
|
-
/**
|
|
124
|
-
* @hidden
|
|
125
|
-
*/
|
|
126
122
|
private initializeDraggable;
|
|
127
|
-
/**
|
|
128
|
-
* @hidden
|
|
129
|
-
*/
|
|
130
123
|
private attachDomHandlers;
|
|
131
|
-
/**
|
|
132
|
-
* @hidden
|
|
133
|
-
*/
|
|
134
124
|
private isDragHandle;
|
|
135
|
-
/**
|
|
136
|
-
* @hidden
|
|
137
|
-
*/
|
|
138
125
|
private getAutoScrollContainer;
|
|
139
|
-
/**
|
|
140
|
-
* @hidden
|
|
141
|
-
*/
|
|
142
126
|
private createHint;
|
|
143
|
-
/**
|
|
144
|
-
* @hidden
|
|
145
|
-
*/
|
|
146
127
|
private destroyHint;
|
|
147
|
-
/**
|
|
148
|
-
* @hidden
|
|
149
|
-
*/
|
|
150
128
|
private emitEvent;
|
|
151
129
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragTargetDirective, never>;
|
|
152
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetDirective, "[kendoDragTarget]", ["kendoDragTarget"], { "hintTemplate": "hintTemplate"; "threshold": "threshold"; "autoScroll": "autoScroll"; "link": "link"; "dragDelay": "dragDelay"; "restrictByAxis": "restrictByAxis"; }, { "press": "press"; "dragStart": "dragStart"; "drag": "drag"; "dragReady": "dragReady"; "dragEnd": "dragEnd"; }, ["dragHandles"]>;
|
|
130
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetDirective, "[kendoDragTarget]", ["kendoDragTarget"], { "hintTemplate": "hintTemplate"; "threshold": "threshold"; "autoScroll": "autoScroll"; "link": "link"; "dragDelay": "dragDelay"; "restrictByAxis": "restrictByAxis"; }, { "press": "press"; "dragStart": "dragStart"; "drag": "drag"; "dragReady": "dragReady"; "release": "release"; "dragEnd": "dragEnd"; }, ["dragHandles"]>;
|
|
153
131
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { ElementRef, EventEmitter, NgZone, OnInit } from "@angular/core";
|
|
6
6
|
import { NormalizedDragEvent } from "@progress/kendo-draggable-common";
|
|
7
7
|
import { DragStateService } from "./drag-state.service";
|
|
8
|
-
import {
|
|
8
|
+
import { DropTargetDragEnterEvent, DropTargetDragOverEvent, DropTargetDragLeaveEvent, DropTargetDropEvent } from './events/drop-target';
|
|
9
9
|
import { AllowedTargetFn } from "./models";
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
@@ -23,22 +23,22 @@ export declare class DropTargetDirective implements OnInit {
|
|
|
23
23
|
* Fires when a DragTarget element enters the DropTarget.
|
|
24
24
|
* This event is preventable. Preventing it allows full logic customization.
|
|
25
25
|
*/
|
|
26
|
-
dragEnter: EventEmitter<
|
|
26
|
+
dragEnter: EventEmitter<DropTargetDragEnterEvent>;
|
|
27
27
|
/**
|
|
28
28
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
29
29
|
* This event is preventable. Preventing it allows full logic customization.
|
|
30
30
|
*/
|
|
31
|
-
dragOver: EventEmitter<
|
|
31
|
+
dragOver: EventEmitter<DropTargetDragOverEvent>;
|
|
32
32
|
/**
|
|
33
33
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
34
34
|
* This event is preventable. Preventing it allows full logic customization.
|
|
35
35
|
*/
|
|
36
|
-
dragLeave: EventEmitter<
|
|
36
|
+
dragLeave: EventEmitter<DropTargetDragLeaveEvent>;
|
|
37
37
|
/**
|
|
38
38
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
39
39
|
* This event is preventable. Preventing it allows full logic customization.
|
|
40
40
|
*/
|
|
41
|
-
drop: EventEmitter<
|
|
41
|
+
drop: EventEmitter<DropTargetDropEvent>;
|
|
42
42
|
constructor(service: DragStateService, element: ElementRef, ngZone: NgZone);
|
|
43
43
|
private dropTarget;
|
|
44
44
|
ngOnInit(): void;
|
|
@@ -7,7 +7,7 @@ import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* Arguments for the drag event of the DragTarget.
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class DragTargetDragEvent extends PreventableEvent {
|
|
11
11
|
/**
|
|
12
12
|
* The normalized drag event.
|
|
13
13
|
*/
|
|
@@ -6,7 +6,7 @@ import { NormalizedDragEvent } from '@progress/kendo-draggable-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the dragEnd event of the DragTarget.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class DragTargetDragEndEvent {
|
|
10
10
|
/**
|
|
11
11
|
* The normalized drag event.
|
|
12
12
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { DragTargetPressEvent } from './press-event';
|
|
6
|
+
export { DragTargetDragStartEvent } from './start-event';
|
|
7
|
+
export { DragTargetDragEndEvent } from './end-event';
|
|
8
|
+
export { DragTargetDragEvent } from './drag-event';
|
|
@@ -7,7 +7,7 @@ import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* Arguments for the dragStart event of the DragTarget.
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class DragTargetDragStartEvent extends PreventableEvent {
|
|
11
11
|
/**
|
|
12
12
|
* The normalized drag event.
|
|
13
13
|
*/
|
|
@@ -6,7 +6,7 @@ import { NormalizedDragEvent } from '@progress/kendo-draggable-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the dragEnter event of the DropTarget.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class DropTargetDragEnterEvent {
|
|
10
10
|
/**
|
|
11
11
|
* The normalized drag event.
|
|
12
12
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { DropTargetDragEnterEvent } from './enter-event';
|
|
6
|
+
export { DropTargetDragOverEvent } from './over-event';
|
|
7
|
+
export { DropTargetDragLeaveEvent } from './leave-event';
|
|
8
|
+
export { DropTargetDropEvent } from './drop-event';
|
|
@@ -6,7 +6,7 @@ import { NormalizedDragEvent } from '@progress/kendo-draggable-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the dragLeave event of the DropTarget.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class DropTargetDragLeaveEvent {
|
|
10
10
|
/**
|
|
11
11
|
* The normalized drag event.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ import { NormalizedDragEvent } from '@progress/kendo-draggable-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the dragOver event of the DropTarget.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class DropTargetDragOverEvent {
|
|
10
10
|
/**
|
|
11
11
|
* The normalized drag event.
|
|
12
12
|
*/
|
|
@@ -8,6 +8,37 @@ import * as i2 from "./drag-and-drop/draghandle.directive";
|
|
|
8
8
|
import * as i3 from "./drag-and-drop/droptarget.directive";
|
|
9
9
|
import * as i4 from "./drag-and-drop/hint.component";
|
|
10
10
|
import * as i5 from "@angular/common";
|
|
11
|
+
/**
|
|
12
|
+
* Represents the [NgModule]({{ site.data.urls.angular['ngmodules'] }})
|
|
13
|
+
* definition for the Drag and Drop directives.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* ```ts-no-run
|
|
18
|
+
* // Import the DragAndDrop module
|
|
19
|
+
* import { DragAndDropModule } from '@progress/kendo-angular-utils';
|
|
20
|
+
*
|
|
21
|
+
* // The browser platform with a compiler
|
|
22
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
23
|
+
*
|
|
24
|
+
* import { NgModule } from '@angular/core';
|
|
25
|
+
*
|
|
26
|
+
* // Import the app component
|
|
27
|
+
* import { AppComponent } from './app.component';
|
|
28
|
+
*
|
|
29
|
+
* // Define the app module
|
|
30
|
+
* _@NgModule({
|
|
31
|
+
* declarations: [AppComponent], // declare app component
|
|
32
|
+
* imports: [BrowserModule, DragAndDropModule], // import DragAndDropModule module
|
|
33
|
+
* bootstrap: [AppComponent]
|
|
34
|
+
* })
|
|
35
|
+
* export class AppModule {}
|
|
36
|
+
*
|
|
37
|
+
* // Compile and launch the module
|
|
38
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
11
42
|
export declare class DragAndDropModule {
|
|
12
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragAndDropModule, never>;
|
|
13
44
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DragAndDropModule, [typeof i1.DragTargetDirective, typeof i2.DragHandleDirective, typeof i3.DropTargetDirective, typeof i4.HintComponent], [typeof i5.CommonModule], [typeof i1.DragTargetDirective, typeof i2.DragHandleDirective, typeof i3.DropTargetDirective, typeof i4.HintComponent]>;
|
|
@@ -7,7 +7,7 @@ import { validatePackage } from '@progress/kendo-licensing';
|
|
|
7
7
|
import { packageMetadata } from '../package-metadata';
|
|
8
8
|
import { DragHandleDirective } from "./draghandle.directive";
|
|
9
9
|
import { getScrollableParent } from "@progress/kendo-draggable-common";
|
|
10
|
-
import {
|
|
10
|
+
import { DragTargetDragStartEvent, DragTargetDragEndEvent, DragTargetPressEvent, DragTargetDragEvent } from "./events/drag-target";
|
|
11
11
|
import { getAction, isPresent, setElementStyles, dragTargetTransition } from './util';
|
|
12
12
|
import { contains, isDocumentAvailable } from "@progress/kendo-angular-common";
|
|
13
13
|
import { HintComponent } from "./hint.component";
|
|
@@ -59,9 +59,13 @@ export class DragTargetDirective {
|
|
|
59
59
|
*/
|
|
60
60
|
this.drag = new EventEmitter();
|
|
61
61
|
/**
|
|
62
|
-
* Fires when the DragTarget's dragDelay has passed and the user is able to drag the element.
|
|
62
|
+
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
63
63
|
*/
|
|
64
64
|
this.dragReady = new EventEmitter();
|
|
65
|
+
/**
|
|
66
|
+
* Fires when the user releases the DragTarget element after being pressed.
|
|
67
|
+
*/
|
|
68
|
+
this.release = new EventEmitter();
|
|
65
69
|
/**
|
|
66
70
|
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
67
71
|
*/
|
|
@@ -158,7 +162,7 @@ export class DragTargetDirective {
|
|
|
158
162
|
this.pressed = true;
|
|
159
163
|
}
|
|
160
164
|
this.ngZone.run(() => {
|
|
161
|
-
const eventArgs = new
|
|
165
|
+
const eventArgs = new DragTargetPressEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
162
166
|
this.press.emit(eventArgs);
|
|
163
167
|
});
|
|
164
168
|
}
|
|
@@ -190,9 +194,6 @@ export class DragTargetDirective {
|
|
|
190
194
|
this.service.dragTargetDirective = this;
|
|
191
195
|
this.initialPosition = { x: event.clientX - this.position.x, y: event.clientY - this.position.y };
|
|
192
196
|
}
|
|
193
|
-
/**
|
|
194
|
-
* @hidden
|
|
195
|
-
*/
|
|
196
197
|
handleDrag(event) {
|
|
197
198
|
if (!this.pressed || isDragStartPrevented) {
|
|
198
199
|
return;
|
|
@@ -227,9 +228,19 @@ export class DragTargetDirective {
|
|
|
227
228
|
transition: 'none'
|
|
228
229
|
});
|
|
229
230
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
handleRelease(event) {
|
|
232
|
+
if (this.dragTimeout) {
|
|
233
|
+
clearTimeout(this.dragTimeout);
|
|
234
|
+
this.dragTimeout = null;
|
|
235
|
+
this.pressed = false;
|
|
236
|
+
}
|
|
237
|
+
this.service.dragTarget = null;
|
|
238
|
+
this.service.dragTargetDirective = null;
|
|
239
|
+
this.ngZone.run(() => {
|
|
240
|
+
const eventArgs = new DragTargetPressEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
241
|
+
this.release.emit(eventArgs);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
233
244
|
handleDragEnd(event) {
|
|
234
245
|
if (this.dragTimeout) {
|
|
235
246
|
clearTimeout(this.dragTimeout);
|
|
@@ -255,27 +266,22 @@ export class DragTargetDirective {
|
|
|
255
266
|
return;
|
|
256
267
|
}
|
|
257
268
|
this.ngZone.run(() => {
|
|
258
|
-
const eventArgs = new
|
|
269
|
+
const eventArgs = new DragTargetDragEndEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
259
270
|
this.dragEnd.emit(eventArgs);
|
|
260
271
|
});
|
|
261
272
|
this.dragStarted = false;
|
|
262
273
|
}
|
|
263
|
-
/**
|
|
264
|
-
* @hidden
|
|
265
|
-
*/
|
|
266
274
|
initializeDraggable() {
|
|
267
275
|
this.dragTarget = {
|
|
268
276
|
element: this.nativeElement,
|
|
269
277
|
hint: null,
|
|
270
278
|
onPress: this.handlePress.bind(this),
|
|
271
|
-
onRelease: this.
|
|
279
|
+
onRelease: this.handleRelease.bind(this),
|
|
272
280
|
onDragStart: this.handleDragStart.bind(this),
|
|
273
|
-
onDrag: this.handleDrag.bind(this)
|
|
281
|
+
onDrag: this.handleDrag.bind(this),
|
|
282
|
+
onDragEnd: this.handleDragEnd.bind(this)
|
|
274
283
|
};
|
|
275
284
|
}
|
|
276
|
-
/**
|
|
277
|
-
* @hidden
|
|
278
|
-
*/
|
|
279
285
|
attachDomHandlers() {
|
|
280
286
|
if (this.domSubscriptions.length > 0) {
|
|
281
287
|
this.domSubscriptions.forEach(subscription => subscription());
|
|
@@ -315,24 +321,15 @@ export class DragTargetDirective {
|
|
|
315
321
|
];
|
|
316
322
|
}
|
|
317
323
|
}
|
|
318
|
-
/**
|
|
319
|
-
* @hidden
|
|
320
|
-
*/
|
|
321
324
|
isDragHandle(el) {
|
|
322
325
|
return this.dragHandles.toArray().some(dh => contains(dh.element.nativeElement, el, true));
|
|
323
326
|
}
|
|
324
|
-
/**
|
|
325
|
-
* @hidden
|
|
326
|
-
*/
|
|
327
327
|
getAutoScrollContainer() {
|
|
328
328
|
return typeof this.autoScroll === 'object' &&
|
|
329
329
|
this.autoScroll.boundaryElementRef &&
|
|
330
330
|
this.autoScroll.boundaryElementRef.nativeElement ?
|
|
331
331
|
this.autoScroll.boundaryElementRef.nativeElement : null;
|
|
332
332
|
}
|
|
333
|
-
/**
|
|
334
|
-
* @hidden
|
|
335
|
-
*/
|
|
336
333
|
createHint() {
|
|
337
334
|
const hintComponent = this.resolver.resolveComponentFactory(HintComponent);
|
|
338
335
|
this.hint = this.viewContainer.createComponent(hintComponent);
|
|
@@ -341,26 +338,20 @@ export class DragTargetDirective {
|
|
|
341
338
|
this.hint.changeDetectorRef.detectChanges();
|
|
342
339
|
this.dragTarget.hint = this.hint.instance.element.nativeElement;
|
|
343
340
|
}
|
|
344
|
-
/**
|
|
345
|
-
* @hidden
|
|
346
|
-
*/
|
|
347
341
|
destroyHint() {
|
|
348
342
|
this.hint.destroy();
|
|
349
343
|
this.hint.changeDetectorRef.detectChanges();
|
|
350
344
|
this.hint = null;
|
|
351
345
|
this.dragTarget.hint = null;
|
|
352
346
|
}
|
|
353
|
-
/**
|
|
354
|
-
* @hidden
|
|
355
|
-
*/
|
|
356
347
|
emitEvent(event, args) {
|
|
357
348
|
let eventArgs;
|
|
358
349
|
switch (event) {
|
|
359
350
|
case 'dragStart':
|
|
360
|
-
eventArgs = new
|
|
351
|
+
eventArgs = new DragTargetDragStartEvent(args);
|
|
361
352
|
break;
|
|
362
353
|
case 'drag':
|
|
363
|
-
eventArgs = new
|
|
354
|
+
eventArgs = new DragTargetDragEvent(args);
|
|
364
355
|
break;
|
|
365
356
|
default:
|
|
366
357
|
break;
|
|
@@ -370,7 +361,7 @@ export class DragTargetDirective {
|
|
|
370
361
|
}
|
|
371
362
|
}
|
|
372
363
|
DragTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragTargetDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.DragStateService }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Directive });
|
|
373
|
-
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hintTemplate: "hintTemplate", threshold: "threshold", autoScroll: "autoScroll", link: "link", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis" }, outputs: { press: "press", dragStart: "dragStart", drag: "drag", dragReady: "dragReady", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "this.touchAction" } }, queries: [{ propertyName: "dragHandles", predicate: DragHandleDirective }], exportAs: ["kendoDragTarget"], ngImport: i0 });
|
|
364
|
+
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hintTemplate: "hintTemplate", threshold: "threshold", autoScroll: "autoScroll", link: "link", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis" }, outputs: { press: "press", dragStart: "dragStart", drag: "drag", dragReady: "dragReady", release: "release", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "this.touchAction" } }, queries: [{ propertyName: "dragHandles", predicate: DragHandleDirective }], exportAs: ["kendoDragTarget"], ngImport: i0 });
|
|
374
365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
375
366
|
type: Directive,
|
|
376
367
|
args: [{
|
|
@@ -397,6 +388,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
397
388
|
type: Output
|
|
398
389
|
}], dragReady: [{
|
|
399
390
|
type: Output
|
|
391
|
+
}], release: [{
|
|
392
|
+
type: Output
|
|
400
393
|
}], dragEnd: [{
|
|
401
394
|
type: Output
|
|
402
395
|
}], touchAction: [{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
|
6
6
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
7
|
import { packageMetadata } from '../package-metadata';
|
|
8
|
-
import {
|
|
8
|
+
import { DropTargetDragEnterEvent, DropTargetDragOverEvent, DropTargetDragLeaveEvent, DropTargetDropEvent } from './events/drop-target';
|
|
9
9
|
import { isPresent } from './util';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
import * as i1 from "./drag-state.service";
|
|
@@ -69,7 +69,7 @@ export class DropTargetDirective {
|
|
|
69
69
|
if (allowed) {
|
|
70
70
|
this.service.dropTarget = this.dropTarget;
|
|
71
71
|
this.ngZone.run(() => {
|
|
72
|
-
const eventArgs = new
|
|
72
|
+
const eventArgs = new DropTargetDragEnterEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
73
73
|
this.dragEnter.emit(eventArgs);
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -83,7 +83,7 @@ export class DropTargetDirective {
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
this.ngZone.run(() => {
|
|
86
|
-
const eventArgs = new
|
|
86
|
+
const eventArgs = new DropTargetDragLeaveEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
87
87
|
this.dragLeave.emit(eventArgs);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -95,7 +95,7 @@ export class DropTargetDirective {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
this.ngZone.run(() => {
|
|
98
|
-
const eventArgs = new
|
|
98
|
+
const eventArgs = new DropTargetDragOverEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
99
99
|
this.dragOver.emit(eventArgs);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -104,7 +104,7 @@ export class DropTargetDirective {
|
|
|
104
104
|
*/
|
|
105
105
|
handleDrop(event) {
|
|
106
106
|
this.ngZone.run(() => {
|
|
107
|
-
const eventArgs = new
|
|
107
|
+
const eventArgs = new DropTargetDropEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
108
108
|
this.drop.emit(eventArgs);
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -6,7 +6,7 @@ import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the drag event of the DragTarget.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class DragTargetDragEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { DragTargetPressEvent } from './press-event';
|
|
6
|
+
export { DragTargetDragStartEvent } from './start-event';
|
|
7
|
+
export { DragTargetDragEndEvent } from './end-event';
|
|
8
|
+
export { DragTargetDragEvent } from './drag-event';
|
|
@@ -6,7 +6,7 @@ import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
|
6
6
|
/**
|
|
7
7
|
* Arguments for the dragStart event of the DragTarget.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class DragTargetDragStartEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { DropTargetDragEnterEvent } from './enter-event';
|
|
6
|
+
export { DropTargetDragOverEvent } from './over-event';
|
|
7
|
+
export { DropTargetDragLeaveEvent } from './leave-event';
|
|
8
|
+
export { DropTargetDropEvent } from './drop-event';
|
|
@@ -15,6 +15,37 @@ const EXPORTS = [
|
|
|
15
15
|
DropTargetDirective,
|
|
16
16
|
HintComponent
|
|
17
17
|
];
|
|
18
|
+
/**
|
|
19
|
+
* Represents the [NgModule]({{ site.data.urls.angular['ngmodules'] }})
|
|
20
|
+
* definition for the Drag and Drop directives.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* ```ts-no-run
|
|
25
|
+
* // Import the DragAndDrop module
|
|
26
|
+
* import { DragAndDropModule } from '@progress/kendo-angular-utils';
|
|
27
|
+
*
|
|
28
|
+
* // The browser platform with a compiler
|
|
29
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
30
|
+
*
|
|
31
|
+
* import { NgModule } from '@angular/core';
|
|
32
|
+
*
|
|
33
|
+
* // Import the app component
|
|
34
|
+
* import { AppComponent } from './app.component';
|
|
35
|
+
*
|
|
36
|
+
* // Define the app module
|
|
37
|
+
* _@NgModule({
|
|
38
|
+
* declarations: [AppComponent], // declare app component
|
|
39
|
+
* imports: [BrowserModule, DragAndDropModule], // import DragAndDropModule module
|
|
40
|
+
* bootstrap: [AppComponent]
|
|
41
|
+
* })
|
|
42
|
+
* export class AppModule {}
|
|
43
|
+
*
|
|
44
|
+
* // Compile and launch the module
|
|
45
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
46
|
+
*
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
18
49
|
export class DragAndDropModule {
|
|
19
50
|
}
|
|
20
51
|
DragAndDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragAndDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -31,6 +62,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
31
62
|
args: [{
|
|
32
63
|
declarations: [...EXPORTS],
|
|
33
64
|
exports: [...EXPORTS],
|
|
34
|
-
imports: [CommonModule]
|
|
65
|
+
imports: [CommonModule],
|
|
66
|
+
entryComponents: [HintComponent]
|
|
35
67
|
}]
|
|
36
68
|
}] });
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-utils',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1663064885,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -17,7 +17,7 @@ const packageMetadata = {
|
|
|
17
17
|
name: '@progress/kendo-angular-utils',
|
|
18
18
|
productName: 'Kendo UI for Angular',
|
|
19
19
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
20
|
-
publishDate:
|
|
20
|
+
publishDate: 1663064885,
|
|
21
21
|
version: '',
|
|
22
22
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
23
23
|
};
|
|
@@ -47,7 +47,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
47
47
|
/**
|
|
48
48
|
* Arguments for the press event of the DragTarget.
|
|
49
49
|
*/
|
|
50
|
-
class
|
|
50
|
+
class DragTargetPressEvent {
|
|
51
51
|
/**
|
|
52
52
|
* @hidden
|
|
53
53
|
*/
|
|
@@ -59,7 +59,7 @@ class PressEvent {
|
|
|
59
59
|
/**
|
|
60
60
|
* Arguments for the dragStart event of the DragTarget.
|
|
61
61
|
*/
|
|
62
|
-
class
|
|
62
|
+
class DragTargetDragStartEvent extends PreventableEvent {
|
|
63
63
|
/**
|
|
64
64
|
* @hidden
|
|
65
65
|
*/
|
|
@@ -72,7 +72,7 @@ class DragStartEvent extends PreventableEvent {
|
|
|
72
72
|
/**
|
|
73
73
|
* Arguments for the dragEnd event of the DragTarget.
|
|
74
74
|
*/
|
|
75
|
-
class
|
|
75
|
+
class DragTargetDragEndEvent {
|
|
76
76
|
/**
|
|
77
77
|
* @hidden
|
|
78
78
|
*/
|
|
@@ -84,7 +84,7 @@ class DragEndEvent {
|
|
|
84
84
|
/**
|
|
85
85
|
* Arguments for the drag event of the DragTarget.
|
|
86
86
|
*/
|
|
87
|
-
class
|
|
87
|
+
class DragTargetDragEvent extends PreventableEvent {
|
|
88
88
|
/**
|
|
89
89
|
* @hidden
|
|
90
90
|
*/
|
|
@@ -330,9 +330,13 @@ class DragTargetDirective {
|
|
|
330
330
|
*/
|
|
331
331
|
this.drag = new EventEmitter();
|
|
332
332
|
/**
|
|
333
|
-
* Fires when the DragTarget's dragDelay has passed and the user is able to drag the element.
|
|
333
|
+
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
334
334
|
*/
|
|
335
335
|
this.dragReady = new EventEmitter();
|
|
336
|
+
/**
|
|
337
|
+
* Fires when the user releases the DragTarget element after being pressed.
|
|
338
|
+
*/
|
|
339
|
+
this.release = new EventEmitter();
|
|
336
340
|
/**
|
|
337
341
|
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
338
342
|
*/
|
|
@@ -429,7 +433,7 @@ class DragTargetDirective {
|
|
|
429
433
|
this.pressed = true;
|
|
430
434
|
}
|
|
431
435
|
this.ngZone.run(() => {
|
|
432
|
-
const eventArgs = new
|
|
436
|
+
const eventArgs = new DragTargetPressEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
433
437
|
this.press.emit(eventArgs);
|
|
434
438
|
});
|
|
435
439
|
}
|
|
@@ -461,9 +465,6 @@ class DragTargetDirective {
|
|
|
461
465
|
this.service.dragTargetDirective = this;
|
|
462
466
|
this.initialPosition = { x: event.clientX - this.position.x, y: event.clientY - this.position.y };
|
|
463
467
|
}
|
|
464
|
-
/**
|
|
465
|
-
* @hidden
|
|
466
|
-
*/
|
|
467
468
|
handleDrag(event) {
|
|
468
469
|
if (!this.pressed || isDragStartPrevented) {
|
|
469
470
|
return;
|
|
@@ -498,9 +499,19 @@ class DragTargetDirective {
|
|
|
498
499
|
transition: 'none'
|
|
499
500
|
});
|
|
500
501
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
handleRelease(event) {
|
|
503
|
+
if (this.dragTimeout) {
|
|
504
|
+
clearTimeout(this.dragTimeout);
|
|
505
|
+
this.dragTimeout = null;
|
|
506
|
+
this.pressed = false;
|
|
507
|
+
}
|
|
508
|
+
this.service.dragTarget = null;
|
|
509
|
+
this.service.dragTargetDirective = null;
|
|
510
|
+
this.ngZone.run(() => {
|
|
511
|
+
const eventArgs = new DragTargetPressEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
512
|
+
this.release.emit(eventArgs);
|
|
513
|
+
});
|
|
514
|
+
}
|
|
504
515
|
handleDragEnd(event) {
|
|
505
516
|
if (this.dragTimeout) {
|
|
506
517
|
clearTimeout(this.dragTimeout);
|
|
@@ -526,27 +537,22 @@ class DragTargetDirective {
|
|
|
526
537
|
return;
|
|
527
538
|
}
|
|
528
539
|
this.ngZone.run(() => {
|
|
529
|
-
const eventArgs = new
|
|
540
|
+
const eventArgs = new DragTargetDragEndEvent({ normalizedEvent: event, hostElement: this.nativeElement });
|
|
530
541
|
this.dragEnd.emit(eventArgs);
|
|
531
542
|
});
|
|
532
543
|
this.dragStarted = false;
|
|
533
544
|
}
|
|
534
|
-
/**
|
|
535
|
-
* @hidden
|
|
536
|
-
*/
|
|
537
545
|
initializeDraggable() {
|
|
538
546
|
this.dragTarget = {
|
|
539
547
|
element: this.nativeElement,
|
|
540
548
|
hint: null,
|
|
541
549
|
onPress: this.handlePress.bind(this),
|
|
542
|
-
onRelease: this.
|
|
550
|
+
onRelease: this.handleRelease.bind(this),
|
|
543
551
|
onDragStart: this.handleDragStart.bind(this),
|
|
544
|
-
onDrag: this.handleDrag.bind(this)
|
|
552
|
+
onDrag: this.handleDrag.bind(this),
|
|
553
|
+
onDragEnd: this.handleDragEnd.bind(this)
|
|
545
554
|
};
|
|
546
555
|
}
|
|
547
|
-
/**
|
|
548
|
-
* @hidden
|
|
549
|
-
*/
|
|
550
556
|
attachDomHandlers() {
|
|
551
557
|
if (this.domSubscriptions.length > 0) {
|
|
552
558
|
this.domSubscriptions.forEach(subscription => subscription());
|
|
@@ -586,24 +592,15 @@ class DragTargetDirective {
|
|
|
586
592
|
];
|
|
587
593
|
}
|
|
588
594
|
}
|
|
589
|
-
/**
|
|
590
|
-
* @hidden
|
|
591
|
-
*/
|
|
592
595
|
isDragHandle(el) {
|
|
593
596
|
return this.dragHandles.toArray().some(dh => contains(dh.element.nativeElement, el, true));
|
|
594
597
|
}
|
|
595
|
-
/**
|
|
596
|
-
* @hidden
|
|
597
|
-
*/
|
|
598
598
|
getAutoScrollContainer() {
|
|
599
599
|
return typeof this.autoScroll === 'object' &&
|
|
600
600
|
this.autoScroll.boundaryElementRef &&
|
|
601
601
|
this.autoScroll.boundaryElementRef.nativeElement ?
|
|
602
602
|
this.autoScroll.boundaryElementRef.nativeElement : null;
|
|
603
603
|
}
|
|
604
|
-
/**
|
|
605
|
-
* @hidden
|
|
606
|
-
*/
|
|
607
604
|
createHint() {
|
|
608
605
|
const hintComponent = this.resolver.resolveComponentFactory(HintComponent);
|
|
609
606
|
this.hint = this.viewContainer.createComponent(hintComponent);
|
|
@@ -612,26 +609,20 @@ class DragTargetDirective {
|
|
|
612
609
|
this.hint.changeDetectorRef.detectChanges();
|
|
613
610
|
this.dragTarget.hint = this.hint.instance.element.nativeElement;
|
|
614
611
|
}
|
|
615
|
-
/**
|
|
616
|
-
* @hidden
|
|
617
|
-
*/
|
|
618
612
|
destroyHint() {
|
|
619
613
|
this.hint.destroy();
|
|
620
614
|
this.hint.changeDetectorRef.detectChanges();
|
|
621
615
|
this.hint = null;
|
|
622
616
|
this.dragTarget.hint = null;
|
|
623
617
|
}
|
|
624
|
-
/**
|
|
625
|
-
* @hidden
|
|
626
|
-
*/
|
|
627
618
|
emitEvent(event, args) {
|
|
628
619
|
let eventArgs;
|
|
629
620
|
switch (event) {
|
|
630
621
|
case 'dragStart':
|
|
631
|
-
eventArgs = new
|
|
622
|
+
eventArgs = new DragTargetDragStartEvent(args);
|
|
632
623
|
break;
|
|
633
624
|
case 'drag':
|
|
634
|
-
eventArgs = new
|
|
625
|
+
eventArgs = new DragTargetDragEvent(args);
|
|
635
626
|
break;
|
|
636
627
|
default:
|
|
637
628
|
break;
|
|
@@ -641,7 +632,7 @@ class DragTargetDirective {
|
|
|
641
632
|
}
|
|
642
633
|
}
|
|
643
634
|
DragTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragTargetDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: DragStateService }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Directive });
|
|
644
|
-
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hintTemplate: "hintTemplate", threshold: "threshold", autoScroll: "autoScroll", link: "link", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis" }, outputs: { press: "press", dragStart: "dragStart", drag: "drag", dragReady: "dragReady", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "this.touchAction" } }, queries: [{ propertyName: "dragHandles", predicate: DragHandleDirective }], exportAs: ["kendoDragTarget"], ngImport: i0 });
|
|
635
|
+
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hintTemplate: "hintTemplate", threshold: "threshold", autoScroll: "autoScroll", link: "link", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis" }, outputs: { press: "press", dragStart: "dragStart", drag: "drag", dragReady: "dragReady", release: "release", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "this.touchAction" } }, queries: [{ propertyName: "dragHandles", predicate: DragHandleDirective }], exportAs: ["kendoDragTarget"], ngImport: i0 });
|
|
645
636
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
646
637
|
type: Directive,
|
|
647
638
|
args: [{
|
|
@@ -668,6 +659,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
668
659
|
type: Output
|
|
669
660
|
}], dragReady: [{
|
|
670
661
|
type: Output
|
|
662
|
+
}], release: [{
|
|
663
|
+
type: Output
|
|
671
664
|
}], dragEnd: [{
|
|
672
665
|
type: Output
|
|
673
666
|
}], touchAction: [{
|
|
@@ -681,7 +674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
681
674
|
/**
|
|
682
675
|
* Arguments for the dragEnter event of the DropTarget.
|
|
683
676
|
*/
|
|
684
|
-
class
|
|
677
|
+
class DropTargetDragEnterEvent {
|
|
685
678
|
/**
|
|
686
679
|
* @hidden
|
|
687
680
|
*/
|
|
@@ -693,7 +686,7 @@ class DragEnterEvent {
|
|
|
693
686
|
/**
|
|
694
687
|
* Arguments for the dragOver event of the DropTarget.
|
|
695
688
|
*/
|
|
696
|
-
class
|
|
689
|
+
class DropTargetDragOverEvent {
|
|
697
690
|
/**
|
|
698
691
|
* @hidden
|
|
699
692
|
*/
|
|
@@ -705,7 +698,7 @@ class DragOverEvent {
|
|
|
705
698
|
/**
|
|
706
699
|
* Arguments for the dragLeave event of the DropTarget.
|
|
707
700
|
*/
|
|
708
|
-
class
|
|
701
|
+
class DropTargetDragLeaveEvent {
|
|
709
702
|
/**
|
|
710
703
|
* @hidden
|
|
711
704
|
*/
|
|
@@ -717,7 +710,7 @@ class DragLeaveEvent {
|
|
|
717
710
|
/**
|
|
718
711
|
* Arguments for the drop event of the DropTarget.
|
|
719
712
|
*/
|
|
720
|
-
class
|
|
713
|
+
class DropTargetDropEvent {
|
|
721
714
|
/**
|
|
722
715
|
* @hidden
|
|
723
716
|
*/
|
|
@@ -786,7 +779,7 @@ class DropTargetDirective {
|
|
|
786
779
|
if (allowed) {
|
|
787
780
|
this.service.dropTarget = this.dropTarget;
|
|
788
781
|
this.ngZone.run(() => {
|
|
789
|
-
const eventArgs = new
|
|
782
|
+
const eventArgs = new DropTargetDragEnterEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
790
783
|
this.dragEnter.emit(eventArgs);
|
|
791
784
|
});
|
|
792
785
|
}
|
|
@@ -800,7 +793,7 @@ class DropTargetDirective {
|
|
|
800
793
|
return;
|
|
801
794
|
}
|
|
802
795
|
this.ngZone.run(() => {
|
|
803
|
-
const eventArgs = new
|
|
796
|
+
const eventArgs = new DropTargetDragLeaveEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
804
797
|
this.dragLeave.emit(eventArgs);
|
|
805
798
|
});
|
|
806
799
|
}
|
|
@@ -812,7 +805,7 @@ class DropTargetDirective {
|
|
|
812
805
|
return;
|
|
813
806
|
}
|
|
814
807
|
this.ngZone.run(() => {
|
|
815
|
-
const eventArgs = new
|
|
808
|
+
const eventArgs = new DropTargetDragOverEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
816
809
|
this.dragOver.emit(eventArgs);
|
|
817
810
|
});
|
|
818
811
|
}
|
|
@@ -821,7 +814,7 @@ class DropTargetDirective {
|
|
|
821
814
|
*/
|
|
822
815
|
handleDrop(event) {
|
|
823
816
|
this.ngZone.run(() => {
|
|
824
|
-
const eventArgs = new
|
|
817
|
+
const eventArgs = new DropTargetDropEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
825
818
|
this.drop.emit(eventArgs);
|
|
826
819
|
});
|
|
827
820
|
}
|
|
@@ -864,6 +857,37 @@ const EXPORTS = [
|
|
|
864
857
|
DropTargetDirective,
|
|
865
858
|
HintComponent
|
|
866
859
|
];
|
|
860
|
+
/**
|
|
861
|
+
* Represents the [NgModule]({{ site.data.urls.angular['ngmodules'] }})
|
|
862
|
+
* definition for the Drag and Drop directives.
|
|
863
|
+
*
|
|
864
|
+
* @example
|
|
865
|
+
*
|
|
866
|
+
* ```ts-no-run
|
|
867
|
+
* // Import the DragAndDrop module
|
|
868
|
+
* import { DragAndDropModule } from '@progress/kendo-angular-utils';
|
|
869
|
+
*
|
|
870
|
+
* // The browser platform with a compiler
|
|
871
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
872
|
+
*
|
|
873
|
+
* import { NgModule } from '@angular/core';
|
|
874
|
+
*
|
|
875
|
+
* // Import the app component
|
|
876
|
+
* import { AppComponent } from './app.component';
|
|
877
|
+
*
|
|
878
|
+
* // Define the app module
|
|
879
|
+
* _@NgModule({
|
|
880
|
+
* declarations: [AppComponent], // declare app component
|
|
881
|
+
* imports: [BrowserModule, DragAndDropModule], // import DragAndDropModule module
|
|
882
|
+
* bootstrap: [AppComponent]
|
|
883
|
+
* })
|
|
884
|
+
* export class AppModule {}
|
|
885
|
+
*
|
|
886
|
+
* // Compile and launch the module
|
|
887
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
888
|
+
*
|
|
889
|
+
* ```
|
|
890
|
+
*/
|
|
867
891
|
class DragAndDropModule {
|
|
868
892
|
}
|
|
869
893
|
DragAndDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DragAndDropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -880,7 +904,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
880
904
|
args: [{
|
|
881
905
|
declarations: [...EXPORTS],
|
|
882
906
|
exports: [...EXPORTS],
|
|
883
|
-
imports: [CommonModule]
|
|
907
|
+
imports: [CommonModule],
|
|
908
|
+
entryComponents: [HintComponent]
|
|
884
909
|
}]
|
|
885
910
|
}] });
|
|
886
911
|
|
|
@@ -931,5 +956,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
931
956
|
* Generated bundle index. Do not edit.
|
|
932
957
|
*/
|
|
933
958
|
|
|
934
|
-
export { DragAndDropModule,
|
|
959
|
+
export { DragAndDropModule, DragHandleDirective, DragTargetDirective, DragTargetDragEndEvent, DragTargetDragEvent, DragTargetDragStartEvent, DragTargetPressEvent, DropTargetDirective, DropTargetDragEnterEvent, DropTargetDragLeaveEvent, DropTargetDragOverEvent, DropTargetDropEvent, HintComponent, UtilsModule };
|
|
935
960
|
|
package/main.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { DragTargetDirective } from './drag-and-drop/dragtarget.directive';
|
|
|
8
8
|
export { DragHandleDirective } from './drag-and-drop/draghandle.directive';
|
|
9
9
|
export { DropTargetDirective } from './drag-and-drop/droptarget.directive';
|
|
10
10
|
export { HintComponent } from './drag-and-drop/hint.component';
|
|
11
|
-
export { DragAxis, AutoScrollOptions, AllowedTargetFn, ScrollDirection, Coordinates
|
|
11
|
+
export { DragAxis, AutoScrollOptions, AllowedTargetFn, ScrollDirection, Coordinates } from './drag-and-drop/models/index';
|
|
12
12
|
export * from './drag-and-drop/events/drag-target';
|
|
13
13
|
export * from './drag-and-drop/events/drop-target';
|
|
14
|
+
export { NormalizedDragEvent } from '@progress/kendo-draggable-common';
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { NormalizedDragEvent as NormalizedEvent } from "@progress/kendo-draggable-common";
|
|
6
|
-
export declare type NormalizedDragEvent = NormalizedEvent;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|