Socket
Socket
Sign inDemoInstall

@swimlane/ngx-dnd

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swimlane/ngx-dnd - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

2

bundles/swimlane-ngx-dnd.umd.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@swimlane/dragula"),require("tslib"),require("@angular/common")):"function"==typeof define&&define.amd?define("@swimlane/ngx-dnd",["exports","@angular/core","@swimlane/dragula","tslib","@angular/common"],t):t((e.swimlane=e.swimlane||{},e.swimlane["ngx-dnd"]={}),e.ng.core,null,e.tslib,e.ng.common)}(this,function(e,o,t,n,r){"use strict";var i=t,a=function(){function e(){this.droppableMap=new WeakMap,this.draggableMap=new WeakMap,this.dragulaOptions=this.createDrakeOptions(),this.drake=i([],this.dragulaOptions),this.registerEvents()}return e.prototype.register=function(e){this.droppableMap.set(e.container,e),this.drake.containers.push(e.container)},e.prototype.remove=function(e){this.droppableMap["delete"](e.container);var t=this.drake.containers.indexOf(e.container);-1<t&&this.drake.containers.splice(t,1)},e.prototype.registerDraggable=function(e){this.draggableMap.set(e.element,e)},e.prototype.removeDraggable=function(e){this.draggableMap["delete"](e.element)},e.prototype.createDrakeOptions=function(){var i=this;return{accepts:function(e,t){if(e.contains(t))return!1;var n=i.draggableMap.get(e),o=i.droppableMap.get(t);return!n||!o||n.dropZones.includes(o.dropZone)},copy:function(e,t){var n=i.droppableMap.get(t);return!!n&&n.copy},moves:function(e,t,n,o){var r=i.draggableMap.get(e);return!r||r.moves(t,n,o)},revertOnSpill:!0,direction:"vertical"}},e.prototype.registerEvents=function(){var u,g,m=this;this.drake.on("drag",function(e,t){if(g=undefined,(u=e)&&t){if(m.draggableMap.has(e)){var n=m.draggableMap.get(e);g=n.model,n.drag.emit({type:"drag",el:e,source:t,value:g})}if(m.droppableMap.has(t)){var o=m.droppableMap.get(t);m.dragulaOptions.removeOnSpill=o.removeOnSpill,o.drag.emit({type:"drag",el:e,source:t,sourceComponent:o,value:g})}}}),this.drake.on("drop",function(e,t,n){var o=m.droppableMap.get(t);if(o){var r=g,i=Array.prototype.indexOf.call(t.children,e);if(i<0)m.drake.cancel(!0);else{var a=m.droppableMap.get(n);if(a){var p=a.model,s=o.model,l=!(!p||!g),d=l?p.indexOf(g):-1;if(l&&d<0)return void m.drake.cancel(!0);if(s){var c=!p||u!==e;-1<d&&p&&t===n?p.splice(i,0,p.splice(d,1)[0]):(e.parentNode===t&&t.removeChild(e),c?r=JSON.parse(JSON.stringify(r)):(e.parentNode!==n&&m.drake.cancel(!0),p.splice(d,1)),s.splice(i,0,r))}}o.drop.emit({type:"drop",el:e,source:n,value:r,dropIndex:i})}}}),this.drake.on("remove",function(e,t,n){if(m.droppableMap.has(n)){var o=m.droppableMap.get(n),r=o.model,i=g&&r?r.indexOf(g):-1;-1<i&&(e.parentNode!==n&&n.appendChild(e),r.splice(i,1)),o.remove.emit({type:"remove",el:e,container:t,source:n,value:g})}}),this.drake.on("cancel",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).cancel.emit({type:"cancel",el:e,container:t,source:n,value:g})}),this.drake.on("over",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).over.emit({type:"over",el:e,container:t,source:n,value:g})}),this.drake.on("out",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).out.emit({type:"out",el:e,container:t,source:n,value:g})})},e.decorators=[{type:o.Injectable}],e.ctorParameters=function(){return[]},e}(),p=1e4;var s=function(){function e(e,t,n){this.el=e,this.renderer=t,this.drakesService=n,this.copy=!1,this.removeOnSpill=!1,this.drop=new o.EventEmitter,this.drag=new o.EventEmitter,this.over=new o.EventEmitter,this.out=new o.EventEmitter,this.remove=new o.EventEmitter,this.cancel=new o.EventEmitter}return Object.defineProperty(e.prototype,"container",{get:function(){return this.el.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropZone",{get:function(){return this._dropZone||this.ngxDroppable||this.defaultZone},set:function(e){this._dropZone=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.defaultZone="@@DefaultDropZone-"+p+++"@@",this.drakesService.register(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.over.subscribe(function(){e.renderer.addClass(e.container,"gu-over")}),this.out.subscribe(function(){e.renderer.removeClass(e.container,"gu-over")})},e.prototype.ngOnDestroy=function(){this.drakesService.remove(this)},e.decorators=[{type:o.Directive,args:[{selector:"[ngxDroppable]"}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:o.Renderer2},{type:a}]},e.propDecorators={model:[{type:o.Input}],copy:[{type:o.Input}],removeOnSpill:[{type:o.Input}],ngxDroppable:[{type:o.Input}],drop:[{type:o.Output}],drag:[{type:o.Output}],over:[{type:o.Output}],out:[{type:o.Output}],remove:[{type:o.Output}],cancel:[{type:o.Output}],dropZone:[{type:o.Input}]},e}(),l=function(){function e(e,t,n){this.el=e,this.drakesService=t,this.droppableDirective=n,this._moves=!0,this.handles=[],this.drag=new o.EventEmitter,this.dragDelay=200,this.dragDelayed=!0}return Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this.ngxDraggable||this._parentDropzones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHandle",{get:function(){return!!this.handles.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.el.nativeElement},enumerable:!0,configurable:!0}),e.prototype.onMove=function(e){this._moves&&!this.dragDelayed||(e.stopPropagation(),clearTimeout(this.touchTimeout))},e.prototype.onDown=function(){var e=this;this._moves&&(this.touchTimeout=setTimeout(function(){e.dragDelayed=!1},this.dragDelay))},e.prototype.onUp=function(){this._moves&&(clearTimeout(this.touchTimeout),this.dragDelayed=!0)},e.prototype.ngOnInit=function(){this.update()},e.prototype.update=function(){this._parentDropzones=[this.droppableDirective.dropZone],this.drakesService.registerDraggable(this),this.updateElements()},e.prototype.ngOnDestroy=function(){this.drakesService.removeDraggable(this)},e.prototype.updateElements=function(){var t=this.el.nativeElement,e=t.querySelectorAll("[ngxdraghandle]");this.handles=Array.from(e).filter(function(e){return function(e){for(;e.parentNode;)if((e=e.parentNode).hasAttribute&&e.hasAttribute("ngxdraggable"))return e}(e)===t})},e.prototype.canMove=function(e,t,n){return"boolean"==typeof this._moves?this._moves:"function"!=typeof this._moves||this._moves(this.model,e,t,n)},e.prototype.moves=function(e,t,n){return!!this.canMove(e,t,n)&&(!this.hasHandle||this.handles.some(function(e){return function(e,t){if(e===t)return!0;for(;(e=e.parentNode)&&e!==t;);return!!e}(t,e)}))},e.prototype.ngDoCheck=function(){this.updateElements()},e.decorators=[{type:o.Directive,args:[{selector:"[ngxDraggable]"}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:a},{type:s}]},e.propDecorators={ngxDraggable:[{type:o.Input}],model:[{type:o.Input}],dropZones:[{type:o.Input}],_moves:[{type:o.Input,args:["moves"]}],drag:[{type:o.Output}],onMove:[{type:o.HostListener,args:["touchmove",["$event"]]}],onDown:[{type:o.HostListener,args:["touchstart"]}],onUp:[{type:o.HostListener,args:["touchend"]}]},e}(),d=function(){function e(){}return e.decorators=[{type:o.Directive,args:[{selector:"[ngxDragHandle]"}]}],e}(),c=0;var u=function(){function e(){this.copy=!1,this.removeOnSpill=!1,this.dropZone="@@DefaultDropZone-"+c+++"@@",this.drop=new o.EventEmitter,this.drag=new o.EventEmitter,this.over=new o.EventEmitter,this.out=new o.EventEmitter,this.remove=new o.EventEmitter,this.cancel=new o.EventEmitter}return Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this._defaultZones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this._defaultZones=[this.dropZone]},e.prototype.ngAfterViewInit=function(){var t=this;this.droppable.drag.subscribe(function(e){return t.drag.emit(e)}),this.droppable.drop.subscribe(function(e){return t.drop.emit(e)}),this.droppable.over.subscribe(function(e){return t.over.emit(e)}),this.droppable.out.subscribe(function(e){return t.out.emit(e)}),this.droppable.remove.subscribe(function(e){return t.remove.emit(e)}),this.droppable.cancel.subscribe(function(e){return t.cancel.emit(e)})},e.decorators=[{type:o.Component,args:[{selector:"ngx-dnd-container",template:'<div\n ngxDroppable\n [dropZone]="dropZone"\n [model]="model"\n [copy]="copy"\n [ngClass]="{ \'gu-empty\': !model?.length }"\n [removeOnSpill]="removeOnSpill"\n class=\'ngx-dnd-container\'>\n <ng-container *ngIf="model">\n <ng-container *ngFor="let item of model">\n <ngx-dnd-item\n ngxDraggable\n [model]="item"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [copy]="copy"\n [moves]="moves"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass">\n </ngx-dnd-item>\n </ng-container>\n </ng-container>\n <ng-content *ngIf="!model"></ng-content>\n</div>\n',styles:[".ngx-dnd-container{background-color:rgba(255,255,255,.2);border:2px solid red;margin:10px;padding:10px}.ngx-dnd-container.gu-empty{border:2px dotted red}.ngx-dnd-container:nth-child(odd){background-color:rgba(0,0,0,.2)}.ngx-dnd-container .ex-moved{background-color:#e74c3c}.ngx-dnd-container .ex-over{background-color:rgba(255,255,255,.3)}.ngx-dnd-container .handle{padding:0 5px;margin-right:5px;background-color:rgba(0,0,0,.4);cursor:move}.no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}"],encapsulation:o.ViewEncapsulation.None}]}],e.propDecorators={model:[{type:o.Input}],copy:[{type:o.Input}],removeOnSpill:[{type:o.Input}],droppableItemClass:[{type:o.Input}],dropZone:[{type:o.Input}],dropZones:[{type:o.Input}],moves:[{type:o.Input}],template:[{type:o.Input},{type:o.ContentChild,args:[o.TemplateRef]}],droppable:[{type:o.Input},{type:o.ViewChild,args:[s]}],drop:[{type:o.Output}],drag:[{type:o.Output}],over:[{type:o.Output}],out:[{type:o.Output}],remove:[{type:o.Output}],cancel:[{type:o.Output}]},e}(),g=function(){function e(e,t){this.container=e,this.draggableDirective=t,this._copy=!1,this._removeOnSpill=!1}return Object.defineProperty(e.prototype,"dropZone",{get:function(){return this._dropZone||this.container.dropZone},set:function(e){this._dropZone=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this.container.dropZones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"droppableItemClass",{get:function(){return this._droppableItemClass||this.container.droppableItemClass},set:function(e){this._droppableItemClass=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removeOnSpill",{get:function(){return"boolean"==typeof this._removeOnSpill?this._removeOnSpill:this.container.removeOnSpill},set:function(e){this._removeOnSpill=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"copy",{get:function(){return"boolean"==typeof this._copy?this._copy:this.container.copy},set:function(e){this._copy=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHandle",{get:function(){return this.draggableDirective.hasHandle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"moveDisabled",{get:function(){return!this.draggableDirective.canMove()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classString",{get:function(){var e=["ngx-dnd-item",("function"==typeof this.droppableItemClass?this.droppableItemClass(this.model):this.droppableItemClass)||""];return this.moveDisabled&&e.push("move-disabled"),this.hasHandle&&e.push("has-handle"),e.join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return Array.isArray(this.model)?"array":typeof this.model},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.data={model:this.model,type:this.type,dropZone:this.dropZone,template:this.container.template}},e.decorators=[{type:o.Component,args:[{selector:"ngx-dnd-item",template:'<ng-container [ngSwitch]="type">\n\n <ng-container *ngSwitchCase="\'array\'">\n <ngx-dnd-container\n [model]="model"\n [template]="container.template"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass"\n [copy]="copy">\n </ngx-dnd-container>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'object\'">\n <ng-template\n *ngIf="container.template"\n [ngTemplateOutlet]="container.template"\n [ngTemplateOutletContext]="data">\n </ng-template>\n <ng-container *ngIf="!container.template">\n <div\n class="ngx-dnd-content">\n {{model.label}}\n </div>\n <ngx-dnd-container\n *ngIf="model.children"\n [model]="model.children"\n [template]="container.template"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass"\n [copy]="copy">\n </ngx-dnd-container>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'undefined\'">\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template\n *ngIf="container.template"\n [ngTemplateOutlet]="container.template"\n [ngTemplateOutletContext]="data">\n </ng-template>\n <div\n *ngIf="!container.template"\n class="ngx-dnd-content">\n {{model}}\n </div>\n </ng-container>\n\n</ng-container>\n\n\n\n\n\n\n\n',styles:[".ngx-dnd-item{margin:10px;padding:10px;background-color:rgba(0,0,0,.2);transition:opacity .4s ease-in-out;border:1px solid #add8e6;display:block}.ngx-dnd-item.has-handle [ngxDragHandle],.ngx-dnd-item.has-handle [ngxdraghandle],.ngx-dnd-item:not(.has-handle):not(.move-disabled){cursor:move;cursor:grab;cursor:-webkit-grab}.ngx-dnd-item .ngx-dnd-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ngx-dnd-item:hover{border:1px solid #00f}.gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2}"],encapsulation:o.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:u},{type:l}]},e.propDecorators={model:[{type:o.Input}],dropZone:[{type:o.Input}],dropZones:[{type:o.Input}],droppableItemClass:[{type:o.Input}],removeOnSpill:[{type:o.Input}],copy:[{type:o.Input}],classString:[{type:o.HostBinding,args:["class"]}]},e}(),m=[u,g],h=[l,s,d],f=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{imports:[r.CommonModule],declarations:n.__spread(m,h),exports:n.__spread(m,h),providers:[a]}]}],e}();e.DraggableDirective=l,e.DroppableDirective=s,e.DragHandleDirective=d,e.ItemComponent=g,e.ContainerComponent=u,e.DrakeStoreService=a,e.NgxDnDModule=f,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@swimlane/dragula"),require("@angular/common")):"function"==typeof define&&define.amd?define("@swimlane/ngx-dnd",["exports","@angular/core","@swimlane/dragula","@angular/common"],t):t((e.swimlane=e.swimlane||{},e.swimlane["ngx-dnd"]={}),e.ng.core,null,e.ng.common)}(this,function(e,o,t,n){"use strict";function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(p){r={error:p}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}var a=t,p=function(){function e(){this.droppableMap=new WeakMap,this.draggableMap=new WeakMap,this.dragulaOptions=this.createDrakeOptions(),this.drake=a([],this.dragulaOptions),this.registerEvents()}return e.prototype.register=function(e){this.droppableMap.set(e.container,e),this.drake.containers.push(e.container)},e.prototype.remove=function(e){this.droppableMap["delete"](e.container);var t=this.drake.containers.indexOf(e.container);-1<t&&this.drake.containers.splice(t,1)},e.prototype.registerDraggable=function(e){this.draggableMap.set(e.element,e)},e.prototype.removeDraggable=function(e){this.draggableMap["delete"](e.element)},e.prototype.createDrakeOptions=function(){var i=this;return{accepts:function(e,t){if(e.contains(t))return!1;var n=i.draggableMap.get(e),o=i.droppableMap.get(t);return!n||!o||n.dropZones.includes(o.dropZone)},copy:function(e,t){var n=i.droppableMap.get(t);return!!n&&n.copy},moves:function(e,t,n,o){var r=i.draggableMap.get(e);return!r||r.moves(t,n,o)},revertOnSpill:!0,direction:"vertical"}},e.prototype.registerEvents=function(){var u,g,m=this;this.drake.on("drag",function(e,t){if(g=undefined,(u=e)&&t){if(m.draggableMap.has(e)){var n=m.draggableMap.get(e);g=n.model,n.drag.emit({type:"drag",el:e,source:t,value:g})}if(m.droppableMap.has(t)){var o=m.droppableMap.get(t);m.dragulaOptions.removeOnSpill=o.removeOnSpill,o.drag.emit({type:"drag",el:e,source:t,sourceComponent:o,value:g})}}}),this.drake.on("drop",function(e,t,n){var o=m.droppableMap.get(t);if(o){var r=g,i=Array.prototype.indexOf.call(t.children,e);if(i<0)m.drake.cancel(!0);else{var a=m.droppableMap.get(n);if(a){var p=a.model,s=o.model,l=!(!p||!g),d=l?p.indexOf(g):-1;if(l&&d<0)return void m.drake.cancel(!0);if(s){var c=!p||u!==e;-1<d&&p&&t===n?p.splice(i,0,p.splice(d,1)[0]):(e.parentNode===t&&t.removeChild(e),c?r=JSON.parse(JSON.stringify(r)):(e.parentNode!==n&&m.drake.cancel(!0),p.splice(d,1)),s.splice(i,0,r))}}o.drop.emit({type:"drop",el:e,source:n,value:r,dropIndex:i})}}}),this.drake.on("remove",function(e,t,n){if(m.droppableMap.has(n)){var o=m.droppableMap.get(n),r=o.model,i=g&&r?r.indexOf(g):-1;-1<i&&(e.parentNode!==n&&n.appendChild(e),r.splice(i,1)),o.remove.emit({type:"remove",el:e,container:t,source:n,value:g})}}),this.drake.on("cancel",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).cancel.emit({type:"cancel",el:e,container:t,source:n,value:g})}),this.drake.on("over",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).over.emit({type:"over",el:e,container:t,source:n,value:g})}),this.drake.on("out",function(e,t,n){m.droppableMap.has(t)&&m.droppableMap.get(t).out.emit({type:"out",el:e,container:t,source:n,value:g})})},e.decorators=[{type:o.Injectable}],e.ctorParameters=function(){return[]},e}(),s=1e4;var l=function(){function e(e,t,n){this.el=e,this.renderer=t,this.drakesService=n,this.copy=!1,this.removeOnSpill=!1,this.drop=new o.EventEmitter,this.drag=new o.EventEmitter,this.over=new o.EventEmitter,this.out=new o.EventEmitter,this.remove=new o.EventEmitter,this.cancel=new o.EventEmitter}return Object.defineProperty(e.prototype,"container",{get:function(){return this.el.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropZone",{get:function(){return this._dropZone||this.ngxDroppable||this.defaultZone},set:function(e){this._dropZone=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.defaultZone="@@DefaultDropZone-"+s+++"@@",this.drakesService.register(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.over.subscribe(function(){e.renderer.addClass(e.container,"gu-over")}),this.out.subscribe(function(){e.renderer.removeClass(e.container,"gu-over")})},e.prototype.ngOnDestroy=function(){this.drakesService.remove(this)},e.decorators=[{type:o.Directive,args:[{selector:"[ngxDroppable]"}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:o.Renderer2},{type:p}]},e.propDecorators={model:[{type:o.Input}],copy:[{type:o.Input}],removeOnSpill:[{type:o.Input}],ngxDroppable:[{type:o.Input}],drop:[{type:o.Output}],drag:[{type:o.Output}],over:[{type:o.Output}],out:[{type:o.Output}],remove:[{type:o.Output}],cancel:[{type:o.Output}],dropZone:[{type:o.Input}]},e}(),d=function(){function e(e,t,n){this.el=e,this.drakesService=t,this.droppableDirective=n,this._moves=!0,this.handles=[],this.drag=new o.EventEmitter,this.dragDelay=200,this.dragDelayed=!0}return Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this.ngxDraggable||this._parentDropzones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHandle",{get:function(){return!!this.handles.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.el.nativeElement},enumerable:!0,configurable:!0}),e.prototype.onMove=function(e){this._moves&&!this.dragDelayed||(e.stopPropagation(),clearTimeout(this.touchTimeout))},e.prototype.onDown=function(){var e=this;this._moves&&(this.touchTimeout=setTimeout(function(){e.dragDelayed=!1},this.dragDelay))},e.prototype.onUp=function(){this._moves&&(clearTimeout(this.touchTimeout),this.dragDelayed=!0)},e.prototype.ngOnInit=function(){this.update()},e.prototype.update=function(){this._parentDropzones=[this.droppableDirective.dropZone],this.drakesService.registerDraggable(this),this.updateElements()},e.prototype.ngOnDestroy=function(){this.drakesService.removeDraggable(this)},e.prototype.updateElements=function(){var t=this.el.nativeElement,e=t.querySelectorAll("[ngxdraghandle]");this.handles=Array.from(e).filter(function(e){return function(e){for(;e.parentNode;)if((e=e.parentNode).hasAttribute&&e.hasAttribute("ngxdraggable"))return e}(e)===t})},e.prototype.canMove=function(e,t,n){return"boolean"==typeof this._moves?this._moves:"function"!=typeof this._moves||this._moves(this.model,e,t,n)},e.prototype.moves=function(e,t,n){return!!this.canMove(e,t,n)&&(!this.hasHandle||this.handles.some(function(e){return function(e,t){if(e===t)return!0;for(;(e=e.parentNode)&&e!==t;);return!!e}(t,e)}))},e.prototype.ngDoCheck=function(){this.updateElements()},e.decorators=[{type:o.Directive,args:[{selector:"[ngxDraggable]"}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:p},{type:l}]},e.propDecorators={ngxDraggable:[{type:o.Input}],model:[{type:o.Input}],dropZones:[{type:o.Input}],_moves:[{type:o.Input,args:["moves"]}],drag:[{type:o.Output}],onMove:[{type:o.HostListener,args:["touchmove",["$event"]]}],onDown:[{type:o.HostListener,args:["touchstart"]}],onUp:[{type:o.HostListener,args:["touchend"]}]},e}(),c=function(){function e(){}return e.decorators=[{type:o.Directive,args:[{selector:"[ngxDragHandle]"}]}],e}(),u=0;var g=function(){function e(){this.copy=!1,this.removeOnSpill=!1,this.dropZone="@@DefaultDropZone-"+u+++"@@",this.drop=new o.EventEmitter,this.drag=new o.EventEmitter,this.over=new o.EventEmitter,this.out=new o.EventEmitter,this.remove=new o.EventEmitter,this.cancel=new o.EventEmitter}return Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this._defaultZones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this._defaultZones=[this.dropZone]},e.prototype.ngAfterViewInit=function(){var t=this;this.droppable.drag.subscribe(function(e){return t.drag.emit(e)}),this.droppable.drop.subscribe(function(e){return t.drop.emit(e)}),this.droppable.over.subscribe(function(e){return t.over.emit(e)}),this.droppable.out.subscribe(function(e){return t.out.emit(e)}),this.droppable.remove.subscribe(function(e){return t.remove.emit(e)}),this.droppable.cancel.subscribe(function(e){return t.cancel.emit(e)})},e.decorators=[{type:o.Component,args:[{selector:"ngx-dnd-container",template:'<div\n ngxDroppable\n [dropZone]="dropZone"\n [model]="model"\n [copy]="copy"\n [ngClass]="{ \'gu-empty\': !model?.length }"\n [removeOnSpill]="removeOnSpill"\n class=\'ngx-dnd-container\'>\n <ng-container *ngIf="model">\n <ng-container *ngFor="let item of model">\n <ngx-dnd-item\n ngxDraggable\n [model]="item"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [copy]="copy"\n [moves]="moves"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass">\n </ngx-dnd-item>\n </ng-container>\n </ng-container>\n <ng-content *ngIf="!model"></ng-content>\n</div>\n',styles:[".ngx-dnd-container{background-color:rgba(255,255,255,.2);border:2px solid red;margin:10px;padding:10px}.ngx-dnd-container.gu-empty{border:2px dotted red}.ngx-dnd-container:nth-child(odd){background-color:rgba(0,0,0,.2)}.ngx-dnd-container .ex-moved{background-color:#e74c3c}.ngx-dnd-container .ex-over{background-color:rgba(255,255,255,.3)}.ngx-dnd-container .handle{padding:0 5px;margin-right:5px;background-color:rgba(0,0,0,.4);cursor:move}.no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}"],encapsulation:o.ViewEncapsulation.None}]}],e.propDecorators={model:[{type:o.Input}],copy:[{type:o.Input}],removeOnSpill:[{type:o.Input}],droppableItemClass:[{type:o.Input}],dropZone:[{type:o.Input}],dropZones:[{type:o.Input}],moves:[{type:o.Input}],template:[{type:o.Input},{type:o.ContentChild,args:[o.TemplateRef]}],droppable:[{type:o.Input},{type:o.ViewChild,args:[l]}],drop:[{type:o.Output}],drag:[{type:o.Output}],over:[{type:o.Output}],out:[{type:o.Output}],remove:[{type:o.Output}],cancel:[{type:o.Output}]},e}(),m=function(){function e(e,t){this.container=e,this.draggableDirective=t,this._copy=!1,this._removeOnSpill=!1}return Object.defineProperty(e.prototype,"dropZone",{get:function(){return this._dropZone||this.container.dropZone},set:function(e){this._dropZone=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropZones",{get:function(){return this._dropZones||this.container.dropZones},set:function(e){this._dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"droppableItemClass",{get:function(){return this._droppableItemClass||this.container.droppableItemClass},set:function(e){this._droppableItemClass=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removeOnSpill",{get:function(){return"boolean"==typeof this._removeOnSpill?this._removeOnSpill:this.container.removeOnSpill},set:function(e){this._removeOnSpill=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"copy",{get:function(){return"boolean"==typeof this._copy?this._copy:this.container.copy},set:function(e){this._copy=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHandle",{get:function(){return this.draggableDirective.hasHandle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"moveDisabled",{get:function(){return!this.draggableDirective.canMove()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classString",{get:function(){var e=["ngx-dnd-item",("function"==typeof this.droppableItemClass?this.droppableItemClass(this.model):this.droppableItemClass)||""];return this.moveDisabled&&e.push("move-disabled"),this.hasHandle&&e.push("has-handle"),e.join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return Array.isArray(this.model)?"array":typeof this.model},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.data={model:this.model,type:this.type,dropZone:this.dropZone,template:this.container.template}},e.decorators=[{type:o.Component,args:[{selector:"ngx-dnd-item",template:'<ng-container [ngSwitch]="type">\n\n <ng-container *ngSwitchCase="\'array\'">\n <ngx-dnd-container\n [model]="model"\n [template]="container.template"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass"\n [copy]="copy">\n </ngx-dnd-container>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'object\'">\n <ng-template\n *ngIf="container.template"\n [ngTemplateOutlet]="container.template"\n [ngTemplateOutletContext]="data">\n </ng-template>\n <ng-container *ngIf="!container.template">\n <div\n class="ngx-dnd-content">\n {{model.label}}\n </div>\n <ngx-dnd-container\n *ngIf="model.children"\n [model]="model.children"\n [template]="container.template"\n [dropZone]="dropZone"\n [dropZones]="dropZones"\n [removeOnSpill]="removeOnSpill"\n [droppableItemClass]="droppableItemClass"\n [copy]="copy">\n </ngx-dnd-container>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'undefined\'">\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template\n *ngIf="container.template"\n [ngTemplateOutlet]="container.template"\n [ngTemplateOutletContext]="data">\n </ng-template>\n <div\n *ngIf="!container.template"\n class="ngx-dnd-content">\n {{model}}\n </div>\n </ng-container>\n\n</ng-container>\n\n\n\n\n\n\n\n',styles:[".ngx-dnd-item{margin:10px;padding:10px;background-color:rgba(0,0,0,.2);transition:opacity .4s ease-in-out;border:1px solid #add8e6;display:block}.ngx-dnd-item.has-handle [ngxDragHandle],.ngx-dnd-item.has-handle [ngxdraghandle],.ngx-dnd-item:not(.has-handle):not(.move-disabled){cursor:move;cursor:grab;cursor:-webkit-grab}.ngx-dnd-item .ngx-dnd-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ngx-dnd-item:hover{border:1px solid #00f}.gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2}"],encapsulation:o.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:g},{type:d}]},e.propDecorators={model:[{type:o.Input}],dropZone:[{type:o.Input}],dropZones:[{type:o.Input}],droppableItemClass:[{type:o.Input}],removeOnSpill:[{type:o.Input}],copy:[{type:o.Input}],classString:[{type:o.HostBinding,args:["class"]}]},e}(),h=[g,m],f=[d,l,c],y=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{imports:[n.CommonModule],declarations:i(h,f),exports:i(h,f),providers:[p]}]}],e}();e.DraggableDirective=d,e.DroppableDirective=l,e.DragHandleDirective=c,e.ItemComponent=m,e.ContainerComponent=g,e.DrakeStoreService=p,e.NgxDnDModule=y,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=swimlane-ngx-dnd.umd.min.js.map
{
"name": "@swimlane/ngx-dnd",
"description": "Drag and Drop for Angular2 and beyond!",
"version": "5.0.1",
"version": "5.0.2",
"peerDependencies": {

@@ -6,0 +6,0 @@ "@angular/common": "^6.0.0-rc.0 || ^6.0.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc