@progress/kendo-angular-utils 0.1.1-dev.202208160834 → 0.1.1
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 +16 -44
- 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 -5
- 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/allowed-target.d.ts +1 -1
- package/drag-and-drop.module.d.ts +31 -0
- package/esm2015/drag-and-drop/dragtarget.directive.js +49 -62
- package/esm2015/drag-and-drop/droptarget.directive.js +14 -6
- 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 -5
- 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 +105 -90
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/drag-and-drop/events/drag-target/release-event.d.ts +0 -22
- package/esm2015/drag-and-drop/events/drag-target/release-event.js +0 -15
|
@@ -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,n){"use strict";function i(n){if(n&&n.__esModule)return n;var r=Object.create(null);return 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=i(s),l=i(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 p(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 d,u={name:"@progress/kendo-angular-utils",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1660638843,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,d=n.PreventableEvent),y);function y(t){var e=d.call(this)||this;return Object.assign(e,t),e}var D,E=function(t){Object.assign(this,t)},O=function(t){Object.assign(this,t)},b=(h(T,D=n.PreventableEvent),T);function T(t){var e=D.call(this)||this;return Object.assign(e,t),e}function S(t,e){return{event:t,payload:e}}function I(e,n,r){Object.keys(r).forEach(function(t){e.setStyle(n,t,r[t])})}function C(t){return null!=t}var P=function(t){this.element=t,this.hostClasses=!0,this.zIndex=10,this.touchAction="none"},k=(P.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:P,deps:[{token:o.ElementRef}],target:o.ɵɵFactoryTarget.Component}),P.ɵcmp=o.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:P,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:P,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"]}]}}),w.prototype.handleDragAndDrop=function(t){this.updateState(),r.dispatchDragAndDrop(this.state,t,this.callbacks)},w.prototype.setPressed=function(t){this.pressed=t},w.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)},w.prototype.setVelocity=function(t){this.velocity=t},w.prototype.setOffset=function(t){this.offset=t},w.prototype.setClientOffset=function(t){this.clientOffset=t},w.prototype.setPageOffset=function(t){this.pageOffset=t},w.prototype.setInitialClientOffset=function(t){this.initialClientOffset=t},w.prototype.setScrollOffset=function(t){this.scrollOffset=t},w.prototype.setInitialScrollOffset=function(t){this.initialScrollOffset=t},w.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}},w.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)}},w.prototype.ngOnDestroy=function(){this.scrollInterval&&(window.clearInterval(this.scrollInterval),this.scrollInterval=null)},w);function w(){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()}k.ɵfac=o.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:k,deps:[],target:o.ɵɵFactoryTarget.Injectable}),k.ɵprov=o.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:k,providedIn:"root"}),o.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:o,type:k,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[]}});var x=!1,R=!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=S(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=S(t,this.dragTarget);this.service.handleDragAndDrop(t)},A.prototype.onPointerUp=function(t){var e=this,t=(t.preventDefault(),S(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;(C(this.element)||C(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},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?x||(this.ngZone.run(function(){x=e.emitEvent("dragStart",{normalizedEvent:t,hostElement:e.nativeElement}).isDefaultPrevented()}),C(this.hintTemplate)&&(this.createHint(),C(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,y:t.clientY}):this.dragTimeout&&(clearTimeout(this.dragTimeout),this.dragTimeout=null)},A.prototype.handleDrag=function(t){var e,n,r,i=this;this.pressed&&(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(){R=i.emitEvent("drag",n).isDefaultPrevented()}),R||(r={x:0,y:0},r="horizontal"===this.restrictByAxis?{x:t.clientX-this.initialPosition.x+t.scrollX,y:0}:"vertical"===this.restrictByAxis?{x:0,y:t.clientY-this.initialPosition.y+t.scrollY}:{x:t.clientX-this.initialPosition.x+t.scrollX,y:t.clientY-this.initialPosition.y+t.scrollY},t=Math.abs(r.x)<this.threshold&&Math.abs(r.y)<this.threshold,!this.dragStarted&&t||(!this.dragStarted&&0<this.threshold&&(this.dragStarted=!0),t="translate("+r.x+"px, "+r.y+"px)",I(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 E({normalizedEvent:e,hostElement:n.nativeElement});n.release.emit(t)})},A.prototype.handleDragEnd=function(e){var t,n=this;this.dragStarted&&(this.dragStarted=!1,t=this.hint?this.hintElem:this.nativeElement,C(this.hint)&&(this.renderer.removeStyle(this.nativeElement,"opacity"),this.destroyHint()),this.renderer.removeStyle(t,"transform"),I(this.renderer,t,{transition:"transform .3s ease-in-out"}),this.ngZone.run(function(){var t=new O({normalizedEvent:e,hostElement:n.nativeElement});n.dragEnd.emit(t)}))},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()}),n.isDocumentAvailable()&&C(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 n.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(P);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 b(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.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,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:k},{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",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:k},{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}],release:[{type:s.Output}],dragEnd:[{type:s.Output}],touchAction:[{type:s.HostBinding,args:["style.touch-action"]}],dragHandles:[{type:s.ContentChildren,args:[m]}]}});var z=function(t){Object.assign(this,t)},F=function(t){Object.assign(this,t)},Z=function(t){Object.assign(this,t)},N=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,t=!0;if(C(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 z({event:e,element:n.element.nativeElement});n.dragEnter.emit(t)}))},M.prototype.handleDragLeave=function(e){var n=this;this.service.dropTarget=null,this.ngZone.run(function(){var t=new Z({event:e,element:n.element.nativeElement});n.dragLeave.emit(t)})},M.prototype.handleDragOver=function(e){var n=this;this.ngZone.run(function(){var t=new F({event:e,element:n.element.nativeElement});n.dragOver.emit(t)})},M.prototype.handleDrop=function(e){var n=this;this.ngZone.run(function(){var t=new N({event:e,element:n.element.nativeElement});n.drop.emit(t)}),this.service.setScrollOffset({x:0,y:0})},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:k},{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:k},{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,P],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,P],imports:[e.CommonModule],exports:[l,m,j,P]}),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:p([],g(V)),exports:p([],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=O,t.DragEnterEvent=z,t.DragEvent=b,t.DragHandleDirective=m,t.DragLeaveEvent=Z,t.DragOverEvent=F,t.DragStartEvent=v,t.DragTargetDirective=l,t.DropEvent=N,t.DropTargetDirective=j,t.HintComponent=P,t.PressEvent=f,t.ReleaseEvent=E,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:1663073506,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";
|
|
@@ -50,29 +50,30 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
50
50
|
restrictByAxis: DragAxis;
|
|
51
51
|
/**
|
|
52
52
|
* Fires when the user presses the DragTarget element.
|
|
53
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
54
53
|
*/
|
|
55
|
-
press: EventEmitter<
|
|
54
|
+
press: EventEmitter<DragTargetPressEvent>;
|
|
56
55
|
/**
|
|
57
56
|
* Fires when the dragging of the DragTarget element begins.
|
|
58
|
-
* This event is preventable.
|
|
57
|
+
* This event is preventable.
|
|
59
58
|
*/
|
|
60
|
-
dragStart: EventEmitter<
|
|
59
|
+
dragStart: EventEmitter<DragTargetDragStartEvent>;
|
|
61
60
|
/**
|
|
62
61
|
* Fires while the user drags the DragTarget element.
|
|
63
|
-
* This event is preventable.
|
|
62
|
+
* This event is preventable.
|
|
64
63
|
*/
|
|
65
|
-
drag: EventEmitter<
|
|
64
|
+
drag: EventEmitter<DragTargetDragEvent>;
|
|
66
65
|
/**
|
|
67
|
-
* Fires when the user
|
|
68
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
66
|
+
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
69
67
|
*/
|
|
70
|
-
|
|
68
|
+
dragReady: EventEmitter<any>;
|
|
71
69
|
/**
|
|
72
|
-
* Fires when the
|
|
73
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
70
|
+
* Fires when the user releases the DragTarget element after being pressed.
|
|
74
71
|
*/
|
|
75
|
-
|
|
72
|
+
release: EventEmitter<DragTargetPressEvent>;
|
|
73
|
+
/**
|
|
74
|
+
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
75
|
+
*/
|
|
76
|
+
dragEnd: EventEmitter<DragTargetDragEndEvent>;
|
|
76
77
|
touchAction: string;
|
|
77
78
|
private dragTarget;
|
|
78
79
|
private domSubscriptions;
|
|
@@ -81,6 +82,7 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
81
82
|
private dragStarted;
|
|
82
83
|
private pressed;
|
|
83
84
|
private dragTimeout;
|
|
85
|
+
private position;
|
|
84
86
|
/**
|
|
85
87
|
* @hidden
|
|
86
88
|
*/
|
|
@@ -114,46 +116,16 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
114
116
|
* @hidden
|
|
115
117
|
*/
|
|
116
118
|
private handleDragStart;
|
|
117
|
-
/**
|
|
118
|
-
* @hidden
|
|
119
|
-
*/
|
|
120
119
|
private handleDrag;
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
120
|
private handleRelease;
|
|
125
|
-
/**
|
|
126
|
-
* @hidden
|
|
127
|
-
*/
|
|
128
121
|
private handleDragEnd;
|
|
129
|
-
/**
|
|
130
|
-
* @hidden
|
|
131
|
-
*/
|
|
132
122
|
private initializeDraggable;
|
|
133
|
-
/**
|
|
134
|
-
* @hidden
|
|
135
|
-
*/
|
|
136
123
|
private attachDomHandlers;
|
|
137
|
-
/**
|
|
138
|
-
* @hidden
|
|
139
|
-
*/
|
|
140
124
|
private isDragHandle;
|
|
141
|
-
/**
|
|
142
|
-
* @hidden
|
|
143
|
-
*/
|
|
144
125
|
private getAutoScrollContainer;
|
|
145
|
-
/**
|
|
146
|
-
* @hidden
|
|
147
|
-
*/
|
|
148
126
|
private createHint;
|
|
149
|
-
/**
|
|
150
|
-
* @hidden
|
|
151
|
-
*/
|
|
152
127
|
private destroyHint;
|
|
153
|
-
/**
|
|
154
|
-
* @hidden
|
|
155
|
-
*/
|
|
156
128
|
private emitEvent;
|
|
157
129
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragTargetDirective, never>;
|
|
158
|
-
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"; "release": "release"; "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"]>;
|
|
159
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,8 +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 {
|
|
9
|
-
export { DragEvent } from './drag-event';
|
|
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
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { DragTargetDirective } from "../dragtarget.directive";
|
|
6
6
|
/**
|
|
7
7
|
* Represents the callback that is used by the
|
|
8
|
-
* [allowedDragTargets]({% slug api_utils_droptargetdirective %}#toc-alloweddragtargets) property.
|
|
8
|
+
* [`allowedDragTargets`]({% slug api_utils_droptargetdirective %}#toc-alloweddragtargets) property.
|
|
9
9
|
*
|
|
10
10
|
* ```ts-no-run
|
|
11
11
|
* isTargetAllowed(dragTarget) {
|
|
@@ -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]>;
|