Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@limble/limble-tree

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@limble/limble-tree - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

6

bundles/limble-limble-tree.umd.js

@@ -920,4 +920,4 @@ (function (global, factory) {

var target = event.currentTarget;
var topLine = target.offsetHeight / 4; //an imaginary line 25% of the way down from the top of the element;
var bottomLine = topLine * 3; //an imaginary line 25% of the way up from the bottom of the element;
var topLine = target.offsetHeight / 3; //an imaginary line 1/3 of the way down from the top of the element;
var bottomLine = topLine * 2; //an imaginary line 1/3 of the way up from the bottom of the element;
if (event.offsetY < topLine &&

@@ -948,3 +948,3 @@ this.dropZoneAbove !== undefined &&

this.dropZoneBelow &&
this.branch.getChildren().length !== 0) {
this.branch.getChildren().length === 0) {
var dropCoordinates = __spread(this.branch.getCoordinates());

@@ -951,0 +951,0 @@ dropCoordinates[dropCoordinates.length - 1]++;

@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@angular/common")):"function"==typeof define&&define.amd?define("@limble/limble-tree",["exports","@angular/core","rxjs","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).limble=e.limble||{},e.limble["limble-tree"]={}),e.ng.core,e.rxjs,e.ng.common)}(this,(function(e,t,r,n){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */Object.create;function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}Object.create;var s=function(){function e(e){this.factoryResolver=e,this.factoryResolver=e}return e.prototype.appendComponent=function(e,t,r){void 0===r&&(r=null);var n=this.factoryResolver.resolveComponentFactory(e),o=t.createComponent(n);if(null!==r){var i=t.indexOf(o.hostView);t.detach(i),t.insert(o.hostView,r)}return o},e}();s.decorators=[{type:t.Injectable}],s.ctorParameters=function(){return[{type:t.ComponentFactoryResolver}]};var d=function(){function e(e){this.dropZoneService=e,this.active=!1}return e.prototype.dragenterHandler=function(){!0!==this.active&&void 0!==this.dropZoneInfo&&this.dropZoneService.swapActiveDropZone(this.dropZoneInfo)},e}();function c(e,t){var r,n;if(e.length!==t.length)return!1;try{for(var a=o(e.entries()),s=a.next();!s.done;s=a.next()){var d=i(s.value,2),l=d[0],p=d[1],h=t[l];if(p instanceof Array&&h instanceof Array){if(!c(p,h))return!1}else if(p!==h)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0}function l(e,t){return void 0!==e&&(!0===e.allowNesting||"function"==typeof e.allowNesting&&void 0!==t&&!0===e.allowNesting(t))}d.decorators=[{type:t.Component,args:[{selector:"drop-zone",template:'<div class="dropZoneContainer" (dragenter)="dragenterHandler()">\r\n <div [ngClass]="{ active: active, related: !active }"></div>\r\n</div>\r\n',styles:[".active{background:#f0f9ff;border:2px dashed #bed2db;border-radius:5px;height:100px}.active,.related{box-sizing:border-box;margin:10px 0;width:calc(100% - 20px)}.related{background:#fff6f0;border:1px dashed #dbccbe;border-radius:5px;height:20px;opacity:.8}.dropZoneContainer{position:relative}"]}]}],d.ctorParameters=function(){return[{type:h}]},d.propDecorators={active:[{type:t.Input}],dropZoneInfo:[{type:t.Input}]};var p=function(){function e(){}return e.prototype.set=function(e){this._tempData=e},e.prototype.get=function(){return this._tempData},e.prototype.delete=function(){this._tempData=void 0},e}();p.decorators=[{type:t.Injectable}];var h=function(){function e(e,t){this.componentCreatorService=e,this.tempService=t,this.activeDropZoneInfo=null,this.secondaryDropZones=[],this.dropZones=[]}return e.prototype.init=function(e,t){this.treeData=e,this.treeOptions=t},e.prototype.showSingleDropZone=function(e,t){void 0===t&&(t=!0),!0===t&&this.removeActiveAndSecondaryZones();var r=this.componentCreatorService.appendComponent(d,e.container);r.instance.active=t,r.instance.dropZoneInfo=e,!0===t?this.activeDropZoneInfo=e:this.secondaryDropZones.push(e)},e.prototype.removeActiveAndSecondaryZones=function(){var e,t,r;null===(r=this.activeDropZoneInfo)||void 0===r||r.container.clear(),this.activeDropZoneInfo=null;try{for(var n=o(this.secondaryDropZones),i=n.next();!i.done;i=n.next()){i.value.container.clear()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.secondaryDropZones=[]},e.prototype.getActiveDropZoneInfo=function(){return this.activeDropZoneInfo},e.prototype.getDropZones=function(){return this.dropZones},e.prototype.getSecondaryDropZones=function(){return this.secondaryDropZones},e.prototype.addDropZone=function(e){void 0===this.dropZones.find((function(t){return t.coordinates===e.coordinates}))&&this.dropZones.push(e)},e.prototype.clearDropZones=function(){this.removeActiveAndSecondaryZones(),this.dropZones=[]},e.prototype.isLastDropZoneInBranch=function(e){return this.getCoordinatesGroup(e).length-1<e[e.length-1]},e.prototype.isOnRoot=function(e){return 1===e.length},e.prototype.showDropZoneFamily=function(e,t,r){var n,o;if(void 0===t&&(t=!0),void 0===r&&(r=!1),this.showSingleDropZone(e,t),!this.isOnRoot(e.coordinates)&&this.isLastDropZoneInBranch(e.coordinates)&&"below"!==r){var i=a(e.coordinates);i.pop();var s=this.getNextSibling(i);if(null===s)throw new Error("Could not get secondary drop zone coordinates");void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,s)})))&&this.showDropZoneFamily(f,!1,"above")}if("above"!==r){if(0===e.coordinates[e.coordinates.length-1])return;var d=a(e.coordinates);if(d[d.length-1]--,this.coordinatesHasChildren(d)){var p=a(d);p.push(0);for(var h=p,v=this.getNextSibling(h);null!==v;)h=v,v=this.getNextSibling(h);void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,h)})))&&this.showDropZoneFamily(f,!1,"below")}else if(!c(null!==(o=null===(n=this.tempService.get())||void 0===n?void 0:n.getCoordinates())&&void 0!==o?o:[],d)){var u=this.getCoordinatesGroup(d)[d[d.length-1]];if(l(this.treeOptions,u)){var f,g=a(d);g.push(0),void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,g)})))&&this.showDropZoneFamily(f,!1,"below")}}}},e.prototype.coordinatesHasChildren=function(e){var t=this.getCoordinatesChildren(e);return void 0!==t&&t.length>0},e.prototype.swapActiveDropZone=function(e){if(null===this.getActiveDropZoneInfo())throw new Error("could not get active drop zone");if(-1===this.getSecondaryDropZones().findIndex((function(t){return t.coordinates===e.coordinates})))throw new Error("failed to swap active drop zone");this.showDropZoneFamily(e)},e.prototype.getNextSibling=function(e){var t=a(e),r=this.getCoordinatesGroup(t),n=t[t.length-1]++;return r.length<=n?null:t},e.prototype.getCoordinatesGroup=function(e){var t,r;if(void 0===this.treeData)throw new Error("treeData is not defined");var n=this.treeData,a=!0;try{for(var s=o(e.entries()),d=s.next();!d.done;d=s.next()){var c=i(d.value,2),l=c[0],p=c[1];if(l===e.length-1)break;var h=n[p].nodes;if(void 0===h){if(!0!==a)throw new Error("bad coordinates");n[p].nodes=[],h=n[p].nodes,a=!1}n=h}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n},e.prototype.getCoordinatesChildren=function(e){var t,r;if(void 0===this.treeData)throw new Error("treeData is not defined");var n=this.treeData;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=n[a.value].nodes;if(void 0===s)return;n=s}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:s},{type:p}]};var v=function(){function e(e){this.data=e,this.children=[],this.parent=null}return e.prototype.isRoot=function(){return null===this.parent},e.prototype.getParent=function(){return this.parent},e.prototype.setParent=function(e){this.parent=e},e.prototype.getCoordinates=function(){for(var e=[],t=this;null!==t.parent;){var r=t.getIndex();if(void 0===r)throw new Error("Unreachable error");e.unshift(r),t=t.parent}return e},e.prototype.getChild=function(e){return this.children[e]},e.prototype.getChildren=function(){return this.children},e.prototype.getIndex=function(){var e,t,r=this;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children.findIndex((function(e){return e===r})))&&void 0!==t?t:void 0},e.prototype.getDescendant=function(e){var t,r,n=this;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(void 0===(n=n.children[s]))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.prototype.findDescendant=function(e){var t,r;if(!0===e(this.data))return this;if(this.children.length>0)try{for(var n=o(this.children),i=n.next();!i.done;i=n.next()){var a=i.value.findDescendant(e);if(void 0!==a)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.appendChild=function(e){return null!==e.getParent()&&e.remove(),e.setParent(this),this.children.push(e),e},e.prototype.insertChild=function(e,t){var r=this.children.indexOf(e);return-1===r?(null!==e.getParent()&&e.remove(),e.setParent(this),this.children.splice(t,0,e)):t>r?(this.children.splice(t,0,e),this.removeChild(r),e.setParent(this)):(e.remove(),this.children.splice(t,0,e),e.setParent(this)),e},e.prototype.removeChild=function(e){var t=this.children.splice(e,1)[0];return t.setParent(null),t},e.prototype.remove=function(){var e=this.getIndex();if(null===this.parent||void 0===e)throw new Error("can't remove root");return this.parent.removeChild(e)},e}(),u=function(){function e(e,t){var n;this.treeService=e,this.changeDetectorRef=t,this.dropZoneInside$=new r.BehaviorSubject(this.dropZoneInside),this.indent=null===(n=this.treeService.treeOptions)||void 0===n?void 0:n.indent}return e.prototype.ngAfterViewInit=function(){this.dropZoneInside$.next(this.dropZoneInside),this.dropZoneInside$.complete(),this.reRender(),this.changeDetectorRef.detectChanges()},e.prototype.reRender=function(){if(void 0===this.host||void 0===this.branch)throw new Error("Failed to render limble tree branch");this.treeService.renderBranch(this.host,this.branch)},e}();u.decorators=[{type:t.Component,args:[{selector:"limble-tree-branch",template:'<div [style.marginLeft.px]="indent">\r\n <ng-template #dropZoneInside></ng-template>\r\n <span [hidden]="branch?.data.collapsed" class="limble-child-nodes">\r\n <ng-template #host></ng-template>\r\n </span>\r\n</div>\r\n',styles:["./limble-tree-branch.component.scss"]}]}],u.ctorParameters=function(){return[{type:g},{type:t.ChangeDetectorRef}]},u.propDecorators={branch:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],dropZoneInside:[{type:t.ViewChild,args:["dropZoneInside",{read:t.ViewContainerRef}]}],dropZoneInside$:[{type:t.Output}]};var f=function(){function e(e,t,r,n,o){this.componentCreatorService=e,this.changeDetectorRef=t,this.tempService=r,this.dropZoneService=n,this.treeService=o}return e.prototype.ngAfterViewInit=function(){this.registerDropZones(),this.renderSelf(),this.renderChildren(),this.checkForHandle(),this.changeDetectorRef.detectChanges()},e.prototype.dragstartHandler=function(e){var t;if(e.stopPropagation(),null!==e.dataTransfer&&void 0!==this.branch){var r=e.target;"LIMBLE-TREE-NODE"===(null===(t=r.parentElement)||void 0===t?void 0:t.tagName)&&(e.dataTransfer.effectAllowed="move",r.classList.add("dragging"),this.tempService.set(this.branch))}},e.prototype.dragendHandler=function(e){e.stopPropagation();var t=e.target,r=this.tempService.get();if(void 0!==r){this.tempService.delete(),t.classList.remove("dragging");var n=this.dropZoneService.getActiveDropZoneInfo();if(null!==n){if(this.dropZoneService.removeActiveAndSecondaryZones(),void 0===n.coordinates)throw new Error("could not determine drop zone location");this.treeService.move(r,n.coordinates)}}},e.prototype.dragoverHandler=function(e){var t,r,n;if(void 0!==this.tempService.get()&&void 0!==this.branch){var o=this.tempService.get();if(void 0!==o)if(o!==this.branch){var i=e.currentTarget.offsetHeight/4,s=3*i;if(e.offsetY<i&&void 0!==this.dropZoneAbove&&(null===(t=this.dropZoneService.getActiveDropZoneInfo())||void 0===t?void 0:t.container)!==this.dropZoneAbove){var d=a(this.branch.getCoordinates());this.dropZoneService.showDropZoneFamily({container:this.dropZoneAbove,coordinates:d})}else if(e.offsetY<s&&void 0!==this.dropZoneInside&&(null===(r=this.dropZoneService.getActiveDropZoneInfo())||void 0===r?void 0:r.container)!==this.dropZoneInside){(d=a(this.branch.getCoordinates())).push(0),this.dropZoneService.showDropZoneFamily({container:this.dropZoneInside,coordinates:d})}else if(e.offsetY>=s&&void 0!==this.dropZoneBelow&&(null===(n=this.dropZoneService.getActiveDropZoneInfo())||void 0===n?void 0:n.container)!==this.dropZoneBelow&&0!==this.branch.getChildren().length){(d=a(this.branch.getCoordinates()))[d.length-1]++,this.dropZoneService.showDropZoneFamily({container:this.dropZoneBelow,coordinates:d})}}else null!==this.dropZoneService.getActiveDropZoneInfo()&&this.dropZoneService.removeActiveAndSecondaryZones()}},e.prototype.renderSelf=function(){var e;if(void 0===this.nodeHost||void 0===this.branch)throw new Error("Failed to render tree node");var t=this.branch.data.component;if(void 0===t&&(t=null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.defaultComponent),void 0===t)throw new Error("limbleTree requires a component to render");var r=this.componentCreatorService.appendComponent(t.class,this.nodeHost);for(var n in r.instance.nodeData=this.branch.data,t.bindings)r.instance[n]=t.bindings[n]},e.prototype.renderChildren=function(){var e=this;if(void 0!==this.children){if(void 0===this.branch)throw new Error("branch is undefined");var t=this.componentCreatorService.appendComponent(u,this.children);t.instance.branch=this.branch,l(this.treeService.treeOptions,this.branch.data)&&t.instance.dropZoneInside$.subscribe((function(t){var r;if(void 0!==t&&!1!==(null===(r=e.treeService.treeOptions)||void 0===r?void 0:r.allowDragging)){if(e.dropZoneInside=t,void 0===e.branch)throw new Error("failed to register inner drop zone");var n=e.branch.getCoordinates();n.push(0),e.dropZoneService.addDropZone({container:e.dropZoneInside,coordinates:n})}}))}},e.prototype.registerDropZones=function(){var e;if(!1!==(null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.allowDragging)){if(void 0===this.dropZoneAbove||void 0===this.dropZoneBelow||void 0===this.branch)throw new Error("failed to register drop zones");var t=this.branch.getCoordinates(),r=a(t);this.dropZoneService.addDropZone({container:this.dropZoneAbove,coordinates:r});var n=a(t);n[n.length-1]++,this.dropZoneService.addDropZone({container:this.dropZoneBelow,coordinates:n})}},e.prototype.checkForHandle=function(){var e;if(void 0!==this.draggableDiv){var t,r,n=this.draggableDiv.nativeElement,o=n.querySelector(".limble-tree-handle");t=this.treeService.treeOptions,r=null===(e=this.branch)||void 0===e?void 0:e.data,void 0===t||!0!==t.allowDragging&&("function"!=typeof t.allowDragging||void 0===r||!0!==t.allowDragging(r))?n.setAttribute("draggable","false"):null===o?n.setAttribute("draggable","true"):(o.addEventListener("mousedown",(function(){n.setAttribute("draggable","true")})),o.addEventListener("mouseup",(function(){n.setAttribute("draggable","false")})))}},e}();f.decorators=[{type:t.Component,args:[{selector:"limble-tree-node",template:'<ng-template #dropZoneAbove></ng-template>\r\n<div\r\n (dragstart)="dragstartHandler($event)"\r\n (dragend)="dragendHandler($event)"\r\n #draggableDiv\r\n>\r\n <div (dragover)="dragoverHandler($event)">\r\n <ng-template #nodeHost></ng-template>\r\n </div>\r\n <ng-template #children></ng-template>\r\n</div>\r\n<ng-template #dropZoneBelow></ng-template>\r\n',styles:[".dragging{opacity:.33}"]}]}],f.ctorParameters=function(){return[{type:s},{type:t.ChangeDetectorRef},{type:p},{type:h},{type:g}]},f.propDecorators={branch:[{type:t.Input}],nodeHost:[{type:t.ViewChild,args:["nodeHost",{read:t.ViewContainerRef}]}],dropZoneAbove:[{type:t.ViewChild,args:["dropZoneAbove",{read:t.ViewContainerRef}]}],dropZoneBelow:[{type:t.ViewChild,args:["dropZoneBelow",{read:t.ViewContainerRef}]}],children:[{type:t.ViewChild,args:["children",{read:t.ViewContainerRef}]}],draggableDiv:[{type:t.ViewChild,args:["draggableDiv",{read:t.ElementRef}]}]};var g=function(){function e(e,t){this.componentCreatorService=e,this.dropZoneService=t,this.changes$=new r.ReplaySubject(1),this.drops$=new r.ReplaySubject(1),this.treeModel=new v(null)}return e.prototype.init=function(e,t,r){this.host=e,this.treeData=t,this.treeOptions=this.processOptions(r),this.render()},e.prototype.render=function(){var e,t,r,n;if(void 0===this.host||void 0===this.treeData||void 0===this.treeOptions)throw new Error("TreeModel not initialized");this.host.clear(),this.treeModel=new v(null),this.dropZoneService.clearDropZones(),this.dropZoneService.init(this.treeData,this.treeOptions);try{for(var i=o(this.treeData),a=i.next();!a.done;a=i.next()){var s=a.value,d=new v(s);this.treeModel.appendChild(d)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}try{for(var c=o(this.treeModel.getChildren()),l=c.next();!l.done;l=c.next()){d=l.value;this.componentCreatorService.appendComponent(f,this.host).instance.branch=d}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.changes$.next(null)},e.prototype.renderBranch=function(e,t){var r,n,i;if(void 0===this.treeModel)throw new Error("TreeModel not initialized");e.clear();try{for(var a=o(null!==(i=t.data.nodes)&&void 0!==i?i:[]),s=a.next();!s.done;s=a.next()){var d=s.value,c=new v(d);t.appendChild(c),this.componentCreatorService.appendComponent(f,e).instance.branch=c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}},e.prototype.processOptions=function(e){var t,r,n;return void 0===e&&(e={}),{defaultComponent:e.defaultComponent,indent:null!==(t=e.indent)&&void 0!==t?t:45,allowNesting:null===(r=e.allowNesting)||void 0===r||r,allowDragging:null===(n=e.allowDragging)||void 0===n||n}},e.prototype.move=function(e,t){var r=e.getParent(),n=e.getIndex();if(void 0===n)throw new Error("Cannot move the hidden root node");var o=a(t),i=o.pop();if(void 0===i)throw new Error("target coordinates are empty");var s=this.treeModel.getDescendant(o);if(void 0===s)throw new Error("could not get to target");s.insertChild(e,i),this.rebuildTreeData(),console.log(r),this.drops$.next({target:e.data,oldParent:null==r?void 0:r.data,oldIndex:n,newParent:s.data,newIndex:i}),this.render()},e.prototype.rebuildTreeData=function(){var e,t;if(null==this.treeData)throw new Error("Tree data not initialized");this.treeData.length=0;try{for(var r=o(this.treeModel.getChildren()),n=r.next();!n.done;n=r.next()){var i=n.value;this.treeData.push(this.rebuildBranch(i))}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.rebuildBranch=function(e){var t,r,n=e.data;n.nodes=[];try{for(var i=o(e.getChildren()),a=i.next();!a.done;a=i.next()){var s=a.value;n.nodes.push(this.rebuildBranch(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e}();g.decorators=[{type:t.Injectable}],g.ctorParameters=function(){return[{type:s},{type:h}]};var y=function(){function e(e,n,o){var i=this;this.treeService=e,this.changeDetectorRef=n,this.dropZoneService=o,this.treeChange=new t.EventEmitter,this.treeDrop=new t.EventEmitter,this.dropZoneInside$=new r.BehaviorSubject(this.dropZoneInside),this.changesSubscription=this.treeService.changes$.subscribe((function(){i.treeChange.emit()})),this.dropSubscription=this.treeService.drops$.subscribe((function(e){i.treeDrop.emit(e)}))}return e.prototype.ngAfterViewInit=function(){this.dropZoneInside$.next(this.dropZoneInside),this.dropZoneInside$.complete(),this.update(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnChanges=function(){void 0!==this.host&&void 0!==this.data&&this.update()},e.prototype.update=function(){if(void 0===this.host)throw new Error("Failed to render limble tree. Failure occurred at root.");if(void 0===this.data)throw new Error("limbleTree requires a data object");this.treeService.init(this.host,this.data,this.options)},e.prototype.dragoverHandler=function(e){null!==e.dataTransfer&&(e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.dragleaveHandler=function(e){var t=e.currentTarget,r=e.relatedTarget;t instanceof Node&&r instanceof Node&&!1===function(e,t){if(e===t)return!0;for(var r=t.parentNode;r!==document;){if(null===r)return;if(r===e)return!0;r=r.parentNode}return!1}(t,r)&&this.dropZoneService.removeActiveAndSecondaryZones()},e.prototype.ngOnDestroy=function(){this.changesSubscription.unsubscribe()},e}();y.decorators=[{type:t.Component,args:[{selector:"limble-tree-root",template:'<div\r\n (dragover)="dragoverHandler($event)"\r\n (dragleave)="dragleaveHandler($event)"\r\n>\r\n <ng-template #dropZoneInside></ng-template>\r\n <ng-template #host></ng-template>\r\n</div>\r\n',providers:[g],styles:[""]}]}],y.ctorParameters=function(){return[{type:g},{type:t.ChangeDetectorRef},{type:h}]},y.propDecorators={data:[{type:t.Input}],options:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],dropZoneInside:[{type:t.ViewChild,args:["dropZoneInside",{read:t.ViewContainerRef}]}],dropZoneInside$:[{type:t.Output}],treeChange:[{type:t.Output}],treeDrop:[{type:t.Output}]};var m=function(){};m.decorators=[{type:t.NgModule,args:[{declarations:[u,d,f,y],imports:[n.CommonModule],exports:[y],providers:[s,p,h]}]}],e.LimbleTreeModule=m,e.LimbleTreeRootComponent=y,e.ɵa=g,e.ɵb=s,e.ɵc=h,e.ɵd=p,e.ɵe=u,e.ɵf=d,e.ɵg=f,Object.defineProperty(e,"__esModule",{value:!0})}));
***************************************************************************** */Object.create;function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}Object.create;var s=function(){function e(e){this.factoryResolver=e,this.factoryResolver=e}return e.prototype.appendComponent=function(e,t,r){void 0===r&&(r=null);var n=this.factoryResolver.resolveComponentFactory(e),o=t.createComponent(n);if(null!==r){var i=t.indexOf(o.hostView);t.detach(i),t.insert(o.hostView,r)}return o},e}();s.decorators=[{type:t.Injectable}],s.ctorParameters=function(){return[{type:t.ComponentFactoryResolver}]};var d=function(){function e(e){this.dropZoneService=e,this.active=!1}return e.prototype.dragenterHandler=function(){!0!==this.active&&void 0!==this.dropZoneInfo&&this.dropZoneService.swapActiveDropZone(this.dropZoneInfo)},e}();function c(e,t){var r,n;if(e.length!==t.length)return!1;try{for(var a=o(e.entries()),s=a.next();!s.done;s=a.next()){var d=i(s.value,2),l=d[0],p=d[1],h=t[l];if(p instanceof Array&&h instanceof Array){if(!c(p,h))return!1}else if(p!==h)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0}function l(e,t){return void 0!==e&&(!0===e.allowNesting||"function"==typeof e.allowNesting&&void 0!==t&&!0===e.allowNesting(t))}d.decorators=[{type:t.Component,args:[{selector:"drop-zone",template:'<div class="dropZoneContainer" (dragenter)="dragenterHandler()">\r\n <div [ngClass]="{ active: active, related: !active }"></div>\r\n</div>\r\n',styles:[".active{background:#f0f9ff;border:2px dashed #bed2db;border-radius:5px;height:100px}.active,.related{box-sizing:border-box;margin:10px 0;width:calc(100% - 20px)}.related{background:#fff6f0;border:1px dashed #dbccbe;border-radius:5px;height:20px;opacity:.8}.dropZoneContainer{position:relative}"]}]}],d.ctorParameters=function(){return[{type:h}]},d.propDecorators={active:[{type:t.Input}],dropZoneInfo:[{type:t.Input}]};var p=function(){function e(){}return e.prototype.set=function(e){this._tempData=e},e.prototype.get=function(){return this._tempData},e.prototype.delete=function(){this._tempData=void 0},e}();p.decorators=[{type:t.Injectable}];var h=function(){function e(e,t){this.componentCreatorService=e,this.tempService=t,this.activeDropZoneInfo=null,this.secondaryDropZones=[],this.dropZones=[]}return e.prototype.init=function(e,t){this.treeData=e,this.treeOptions=t},e.prototype.showSingleDropZone=function(e,t){void 0===t&&(t=!0),!0===t&&this.removeActiveAndSecondaryZones();var r=this.componentCreatorService.appendComponent(d,e.container);r.instance.active=t,r.instance.dropZoneInfo=e,!0===t?this.activeDropZoneInfo=e:this.secondaryDropZones.push(e)},e.prototype.removeActiveAndSecondaryZones=function(){var e,t,r;null===(r=this.activeDropZoneInfo)||void 0===r||r.container.clear(),this.activeDropZoneInfo=null;try{for(var n=o(this.secondaryDropZones),i=n.next();!i.done;i=n.next()){i.value.container.clear()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.secondaryDropZones=[]},e.prototype.getActiveDropZoneInfo=function(){return this.activeDropZoneInfo},e.prototype.getDropZones=function(){return this.dropZones},e.prototype.getSecondaryDropZones=function(){return this.secondaryDropZones},e.prototype.addDropZone=function(e){void 0===this.dropZones.find((function(t){return t.coordinates===e.coordinates}))&&this.dropZones.push(e)},e.prototype.clearDropZones=function(){this.removeActiveAndSecondaryZones(),this.dropZones=[]},e.prototype.isLastDropZoneInBranch=function(e){return this.getCoordinatesGroup(e).length-1<e[e.length-1]},e.prototype.isOnRoot=function(e){return 1===e.length},e.prototype.showDropZoneFamily=function(e,t,r){var n,o;if(void 0===t&&(t=!0),void 0===r&&(r=!1),this.showSingleDropZone(e,t),!this.isOnRoot(e.coordinates)&&this.isLastDropZoneInBranch(e.coordinates)&&"below"!==r){var i=a(e.coordinates);i.pop();var s=this.getNextSibling(i);if(null===s)throw new Error("Could not get secondary drop zone coordinates");void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,s)})))&&this.showDropZoneFamily(f,!1,"above")}if("above"!==r){if(0===e.coordinates[e.coordinates.length-1])return;var d=a(e.coordinates);if(d[d.length-1]--,this.coordinatesHasChildren(d)){var p=a(d);p.push(0);for(var h=p,v=this.getNextSibling(h);null!==v;)h=v,v=this.getNextSibling(h);void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,h)})))&&this.showDropZoneFamily(f,!1,"below")}else if(!c(null!==(o=null===(n=this.tempService.get())||void 0===n?void 0:n.getCoordinates())&&void 0!==o?o:[],d)){var u=this.getCoordinatesGroup(d)[d[d.length-1]];if(l(this.treeOptions,u)){var f,g=a(d);g.push(0),void 0!==(f=this.getDropZones().find((function(e){return c(e.coordinates,g)})))&&this.showDropZoneFamily(f,!1,"below")}}}},e.prototype.coordinatesHasChildren=function(e){var t=this.getCoordinatesChildren(e);return void 0!==t&&t.length>0},e.prototype.swapActiveDropZone=function(e){if(null===this.getActiveDropZoneInfo())throw new Error("could not get active drop zone");if(-1===this.getSecondaryDropZones().findIndex((function(t){return t.coordinates===e.coordinates})))throw new Error("failed to swap active drop zone");this.showDropZoneFamily(e)},e.prototype.getNextSibling=function(e){var t=a(e),r=this.getCoordinatesGroup(t),n=t[t.length-1]++;return r.length<=n?null:t},e.prototype.getCoordinatesGroup=function(e){var t,r;if(void 0===this.treeData)throw new Error("treeData is not defined");var n=this.treeData,a=!0;try{for(var s=o(e.entries()),d=s.next();!d.done;d=s.next()){var c=i(d.value,2),l=c[0],p=c[1];if(l===e.length-1)break;var h=n[p].nodes;if(void 0===h){if(!0!==a)throw new Error("bad coordinates");n[p].nodes=[],h=n[p].nodes,a=!1}n=h}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n},e.prototype.getCoordinatesChildren=function(e){var t,r;if(void 0===this.treeData)throw new Error("treeData is not defined");var n=this.treeData;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=n[a.value].nodes;if(void 0===s)return;n=s}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e}();h.decorators=[{type:t.Injectable}],h.ctorParameters=function(){return[{type:s},{type:p}]};var v=function(){function e(e){this.data=e,this.children=[],this.parent=null}return e.prototype.isRoot=function(){return null===this.parent},e.prototype.getParent=function(){return this.parent},e.prototype.setParent=function(e){this.parent=e},e.prototype.getCoordinates=function(){for(var e=[],t=this;null!==t.parent;){var r=t.getIndex();if(void 0===r)throw new Error("Unreachable error");e.unshift(r),t=t.parent}return e},e.prototype.getChild=function(e){return this.children[e]},e.prototype.getChildren=function(){return this.children},e.prototype.getIndex=function(){var e,t,r=this;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children.findIndex((function(e){return e===r})))&&void 0!==t?t:void 0},e.prototype.getDescendant=function(e){var t,r,n=this;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(void 0===(n=n.children[s]))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.prototype.findDescendant=function(e){var t,r;if(!0===e(this.data))return this;if(this.children.length>0)try{for(var n=o(this.children),i=n.next();!i.done;i=n.next()){var a=i.value.findDescendant(e);if(void 0!==a)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.appendChild=function(e){return null!==e.getParent()&&e.remove(),e.setParent(this),this.children.push(e),e},e.prototype.insertChild=function(e,t){var r=this.children.indexOf(e);return-1===r?(null!==e.getParent()&&e.remove(),e.setParent(this),this.children.splice(t,0,e)):t>r?(this.children.splice(t,0,e),this.removeChild(r),e.setParent(this)):(e.remove(),this.children.splice(t,0,e),e.setParent(this)),e},e.prototype.removeChild=function(e){var t=this.children.splice(e,1)[0];return t.setParent(null),t},e.prototype.remove=function(){var e=this.getIndex();if(null===this.parent||void 0===e)throw new Error("can't remove root");return this.parent.removeChild(e)},e}(),u=function(){function e(e,t){var n;this.treeService=e,this.changeDetectorRef=t,this.dropZoneInside$=new r.BehaviorSubject(this.dropZoneInside),this.indent=null===(n=this.treeService.treeOptions)||void 0===n?void 0:n.indent}return e.prototype.ngAfterViewInit=function(){this.dropZoneInside$.next(this.dropZoneInside),this.dropZoneInside$.complete(),this.reRender(),this.changeDetectorRef.detectChanges()},e.prototype.reRender=function(){if(void 0===this.host||void 0===this.branch)throw new Error("Failed to render limble tree branch");this.treeService.renderBranch(this.host,this.branch)},e}();u.decorators=[{type:t.Component,args:[{selector:"limble-tree-branch",template:'<div [style.marginLeft.px]="indent">\r\n <ng-template #dropZoneInside></ng-template>\r\n <span [hidden]="branch?.data.collapsed" class="limble-child-nodes">\r\n <ng-template #host></ng-template>\r\n </span>\r\n</div>\r\n',styles:["./limble-tree-branch.component.scss"]}]}],u.ctorParameters=function(){return[{type:g},{type:t.ChangeDetectorRef}]},u.propDecorators={branch:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],dropZoneInside:[{type:t.ViewChild,args:["dropZoneInside",{read:t.ViewContainerRef}]}],dropZoneInside$:[{type:t.Output}]};var f=function(){function e(e,t,r,n,o){this.componentCreatorService=e,this.changeDetectorRef=t,this.tempService=r,this.dropZoneService=n,this.treeService=o}return e.prototype.ngAfterViewInit=function(){this.registerDropZones(),this.renderSelf(),this.renderChildren(),this.checkForHandle(),this.changeDetectorRef.detectChanges()},e.prototype.dragstartHandler=function(e){var t;if(e.stopPropagation(),null!==e.dataTransfer&&void 0!==this.branch){var r=e.target;"LIMBLE-TREE-NODE"===(null===(t=r.parentElement)||void 0===t?void 0:t.tagName)&&(e.dataTransfer.effectAllowed="move",r.classList.add("dragging"),this.tempService.set(this.branch))}},e.prototype.dragendHandler=function(e){e.stopPropagation();var t=e.target,r=this.tempService.get();if(void 0!==r){this.tempService.delete(),t.classList.remove("dragging");var n=this.dropZoneService.getActiveDropZoneInfo();if(null!==n){if(this.dropZoneService.removeActiveAndSecondaryZones(),void 0===n.coordinates)throw new Error("could not determine drop zone location");this.treeService.move(r,n.coordinates)}}},e.prototype.dragoverHandler=function(e){var t,r,n;if(void 0!==this.tempService.get()&&void 0!==this.branch){var o=this.tempService.get();if(void 0!==o)if(o!==this.branch){var i=e.currentTarget.offsetHeight/3,s=2*i;if(e.offsetY<i&&void 0!==this.dropZoneAbove&&(null===(t=this.dropZoneService.getActiveDropZoneInfo())||void 0===t?void 0:t.container)!==this.dropZoneAbove){var d=a(this.branch.getCoordinates());this.dropZoneService.showDropZoneFamily({container:this.dropZoneAbove,coordinates:d})}else if(e.offsetY<s&&void 0!==this.dropZoneInside&&(null===(r=this.dropZoneService.getActiveDropZoneInfo())||void 0===r?void 0:r.container)!==this.dropZoneInside){(d=a(this.branch.getCoordinates())).push(0),this.dropZoneService.showDropZoneFamily({container:this.dropZoneInside,coordinates:d})}else if(e.offsetY>=s&&void 0!==this.dropZoneBelow&&(null===(n=this.dropZoneService.getActiveDropZoneInfo())||void 0===n?void 0:n.container)!==this.dropZoneBelow&&0===this.branch.getChildren().length){(d=a(this.branch.getCoordinates()))[d.length-1]++,this.dropZoneService.showDropZoneFamily({container:this.dropZoneBelow,coordinates:d})}}else null!==this.dropZoneService.getActiveDropZoneInfo()&&this.dropZoneService.removeActiveAndSecondaryZones()}},e.prototype.renderSelf=function(){var e;if(void 0===this.nodeHost||void 0===this.branch)throw new Error("Failed to render tree node");var t=this.branch.data.component;if(void 0===t&&(t=null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.defaultComponent),void 0===t)throw new Error("limbleTree requires a component to render");var r=this.componentCreatorService.appendComponent(t.class,this.nodeHost);for(var n in r.instance.nodeData=this.branch.data,t.bindings)r.instance[n]=t.bindings[n]},e.prototype.renderChildren=function(){var e=this;if(void 0!==this.children){if(void 0===this.branch)throw new Error("branch is undefined");var t=this.componentCreatorService.appendComponent(u,this.children);t.instance.branch=this.branch,l(this.treeService.treeOptions,this.branch.data)&&t.instance.dropZoneInside$.subscribe((function(t){var r;if(void 0!==t&&!1!==(null===(r=e.treeService.treeOptions)||void 0===r?void 0:r.allowDragging)){if(e.dropZoneInside=t,void 0===e.branch)throw new Error("failed to register inner drop zone");var n=e.branch.getCoordinates();n.push(0),e.dropZoneService.addDropZone({container:e.dropZoneInside,coordinates:n})}}))}},e.prototype.registerDropZones=function(){var e;if(!1!==(null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.allowDragging)){if(void 0===this.dropZoneAbove||void 0===this.dropZoneBelow||void 0===this.branch)throw new Error("failed to register drop zones");var t=this.branch.getCoordinates(),r=a(t);this.dropZoneService.addDropZone({container:this.dropZoneAbove,coordinates:r});var n=a(t);n[n.length-1]++,this.dropZoneService.addDropZone({container:this.dropZoneBelow,coordinates:n})}},e.prototype.checkForHandle=function(){var e;if(void 0!==this.draggableDiv){var t,r,n=this.draggableDiv.nativeElement,o=n.querySelector(".limble-tree-handle");t=this.treeService.treeOptions,r=null===(e=this.branch)||void 0===e?void 0:e.data,void 0===t||!0!==t.allowDragging&&("function"!=typeof t.allowDragging||void 0===r||!0!==t.allowDragging(r))?n.setAttribute("draggable","false"):null===o?n.setAttribute("draggable","true"):(o.addEventListener("mousedown",(function(){n.setAttribute("draggable","true")})),o.addEventListener("mouseup",(function(){n.setAttribute("draggable","false")})))}},e}();f.decorators=[{type:t.Component,args:[{selector:"limble-tree-node",template:'<ng-template #dropZoneAbove></ng-template>\r\n<div\r\n (dragstart)="dragstartHandler($event)"\r\n (dragend)="dragendHandler($event)"\r\n #draggableDiv\r\n>\r\n <div (dragover)="dragoverHandler($event)">\r\n <ng-template #nodeHost></ng-template>\r\n </div>\r\n <ng-template #children></ng-template>\r\n</div>\r\n<ng-template #dropZoneBelow></ng-template>\r\n',styles:[".dragging{opacity:.33}"]}]}],f.ctorParameters=function(){return[{type:s},{type:t.ChangeDetectorRef},{type:p},{type:h},{type:g}]},f.propDecorators={branch:[{type:t.Input}],nodeHost:[{type:t.ViewChild,args:["nodeHost",{read:t.ViewContainerRef}]}],dropZoneAbove:[{type:t.ViewChild,args:["dropZoneAbove",{read:t.ViewContainerRef}]}],dropZoneBelow:[{type:t.ViewChild,args:["dropZoneBelow",{read:t.ViewContainerRef}]}],children:[{type:t.ViewChild,args:["children",{read:t.ViewContainerRef}]}],draggableDiv:[{type:t.ViewChild,args:["draggableDiv",{read:t.ElementRef}]}]};var g=function(){function e(e,t){this.componentCreatorService=e,this.dropZoneService=t,this.changes$=new r.ReplaySubject(1),this.drops$=new r.ReplaySubject(1),this.treeModel=new v(null)}return e.prototype.init=function(e,t,r){this.host=e,this.treeData=t,this.treeOptions=this.processOptions(r),this.render()},e.prototype.render=function(){var e,t,r,n;if(void 0===this.host||void 0===this.treeData||void 0===this.treeOptions)throw new Error("TreeModel not initialized");this.host.clear(),this.treeModel=new v(null),this.dropZoneService.clearDropZones(),this.dropZoneService.init(this.treeData,this.treeOptions);try{for(var i=o(this.treeData),a=i.next();!a.done;a=i.next()){var s=a.value,d=new v(s);this.treeModel.appendChild(d)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}try{for(var c=o(this.treeModel.getChildren()),l=c.next();!l.done;l=c.next()){d=l.value;this.componentCreatorService.appendComponent(f,this.host).instance.branch=d}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.changes$.next(null)},e.prototype.renderBranch=function(e,t){var r,n,i;if(void 0===this.treeModel)throw new Error("TreeModel not initialized");e.clear();try{for(var a=o(null!==(i=t.data.nodes)&&void 0!==i?i:[]),s=a.next();!s.done;s=a.next()){var d=s.value,c=new v(d);t.appendChild(c),this.componentCreatorService.appendComponent(f,e).instance.branch=c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}},e.prototype.processOptions=function(e){var t,r,n;return void 0===e&&(e={}),{defaultComponent:e.defaultComponent,indent:null!==(t=e.indent)&&void 0!==t?t:45,allowNesting:null===(r=e.allowNesting)||void 0===r||r,allowDragging:null===(n=e.allowDragging)||void 0===n||n}},e.prototype.move=function(e,t){var r=e.getParent(),n=e.getIndex();if(void 0===n)throw new Error("Cannot move the hidden root node");var o=a(t),i=o.pop();if(void 0===i)throw new Error("target coordinates are empty");var s=this.treeModel.getDescendant(o);if(void 0===s)throw new Error("could not get to target");s.insertChild(e,i),this.rebuildTreeData(),console.log(r),this.drops$.next({target:e.data,oldParent:null==r?void 0:r.data,oldIndex:n,newParent:s.data,newIndex:i}),this.render()},e.prototype.rebuildTreeData=function(){var e,t;if(null==this.treeData)throw new Error("Tree data not initialized");this.treeData.length=0;try{for(var r=o(this.treeModel.getChildren()),n=r.next();!n.done;n=r.next()){var i=n.value;this.treeData.push(this.rebuildBranch(i))}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.rebuildBranch=function(e){var t,r,n=e.data;n.nodes=[];try{for(var i=o(e.getChildren()),a=i.next();!a.done;a=i.next()){var s=a.value;n.nodes.push(this.rebuildBranch(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e}();g.decorators=[{type:t.Injectable}],g.ctorParameters=function(){return[{type:s},{type:h}]};var y=function(){function e(e,n,o){var i=this;this.treeService=e,this.changeDetectorRef=n,this.dropZoneService=o,this.treeChange=new t.EventEmitter,this.treeDrop=new t.EventEmitter,this.dropZoneInside$=new r.BehaviorSubject(this.dropZoneInside),this.changesSubscription=this.treeService.changes$.subscribe((function(){i.treeChange.emit()})),this.dropSubscription=this.treeService.drops$.subscribe((function(e){i.treeDrop.emit(e)}))}return e.prototype.ngAfterViewInit=function(){this.dropZoneInside$.next(this.dropZoneInside),this.dropZoneInside$.complete(),this.update(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnChanges=function(){void 0!==this.host&&void 0!==this.data&&this.update()},e.prototype.update=function(){if(void 0===this.host)throw new Error("Failed to render limble tree. Failure occurred at root.");if(void 0===this.data)throw new Error("limbleTree requires a data object");this.treeService.init(this.host,this.data,this.options)},e.prototype.dragoverHandler=function(e){null!==e.dataTransfer&&(e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.dragleaveHandler=function(e){var t=e.currentTarget,r=e.relatedTarget;t instanceof Node&&r instanceof Node&&!1===function(e,t){if(e===t)return!0;for(var r=t.parentNode;r!==document;){if(null===r)return;if(r===e)return!0;r=r.parentNode}return!1}(t,r)&&this.dropZoneService.removeActiveAndSecondaryZones()},e.prototype.ngOnDestroy=function(){this.changesSubscription.unsubscribe()},e}();y.decorators=[{type:t.Component,args:[{selector:"limble-tree-root",template:'<div\r\n (dragover)="dragoverHandler($event)"\r\n (dragleave)="dragleaveHandler($event)"\r\n>\r\n <ng-template #dropZoneInside></ng-template>\r\n <ng-template #host></ng-template>\r\n</div>\r\n',providers:[g],styles:[""]}]}],y.ctorParameters=function(){return[{type:g},{type:t.ChangeDetectorRef},{type:h}]},y.propDecorators={data:[{type:t.Input}],options:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],dropZoneInside:[{type:t.ViewChild,args:["dropZoneInside",{read:t.ViewContainerRef}]}],dropZoneInside$:[{type:t.Output}],treeChange:[{type:t.Output}],treeDrop:[{type:t.Output}]};var m=function(){};m.decorators=[{type:t.NgModule,args:[{declarations:[u,d,f,y],imports:[n.CommonModule],exports:[y],providers:[s,p,h]}]}],e.LimbleTreeModule=m,e.LimbleTreeRootComponent=y,e.ɵa=g,e.ɵb=s,e.ɵc=h,e.ɵd=p,e.ɵe=u,e.ɵf=d,e.ɵg=f,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=limble-limble-tree.umd.min.js.map

@@ -73,4 +73,4 @@ import { ChangeDetectorRef, Component, ElementRef, Input, ViewChild, ViewContainerRef } from "@angular/core";

const target = event.currentTarget;
const topLine = target.offsetHeight / 4; //an imaginary line 25% of the way down from the top of the element;
const bottomLine = topLine * 3; //an imaginary line 25% of the way up from the bottom of the element;
const topLine = target.offsetHeight / 3; //an imaginary line 1/3 of the way down from the top of the element;
const bottomLine = topLine * 2; //an imaginary line 1/3 of the way up from the bottom of the element;
if (event.offsetY < topLine &&

@@ -101,3 +101,3 @@ this.dropZoneAbove !== undefined &&

this.dropZoneBelow &&
this.branch.getChildren().length !== 0) {
this.branch.getChildren().length === 0) {
const dropCoordinates = [...this.branch.getCoordinates()];

@@ -224,2 +224,2 @@ dropCoordinates[dropCoordinates.length - 1]++;

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGltYmxlLXRyZWUtbm9kZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vcHJvamVjdHMvbGltYmxlLXRyZWUvc3JjLyIsInNvdXJjZXMiOlsibGliL2xpbWJsZS10cmVlLW5vZGUvbGltYmxlLXRyZWUtbm9kZS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVKLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsVUFBVSxFQUNWLEtBQUssRUFDTCxTQUFTLEVBQ1QsZ0JBQWdCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHlDQUF5QyxDQUFDO0FBQ2xGLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNsRSxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSxvREFBb0QsQ0FBQztBQUMvRixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDekQsT0FBTyxFQUFFLFdBQVcsRUFBR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RhdGEuY29tcG9uZW50O1xyXG4gICAgICBpZiAoY29tcG9uZW50ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgY29tcG9uZW50ID0gdGhpcy50cmVlU2VydmljZS50cmVlT3B0aW9ucz8uZGVmYXVsdENvbXBvbmVudDtcclxuICAgICAgfVxyXG4gICAgICBpZiAoY29tcG9uZW50ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwibGltYmxlVHJlZSByZXF1aXJlcyBhIGNvbXBvbmVudCB0byByZW5kZXJcIik7XHJcbiAgICAgIH1cclxuICAgICAgY29uc3QgY29tcG9uZW50UmVmID0gdGhpcy5jb21wb25lbnRDcmVhdG9yU2VydmljZS5hcHBlbmRDb21wb25lbnQ8YW55PihcclxuICAgICAgICAgY29tcG9uZW50LmNsYXNzLFxyXG4gICAgICAgICB0aGlzLm5vZGVIb3N0XHJcbiAgICAgICk7XHJcbiAgICAgIGNvbXBvbmVudFJlZi5pbnN0YW5jZS5ub2RlRGF0YSA9IHRoaXMuYnJhbmNoLmRhdGE7XHJcbiAgICAgIGZvciAoY29uc3QgYmluZGluZyBpbiBjb21wb25lbnQuYmluZGluZ3MpIHtcclxuICAgICAgICAgY29tcG9uZW50UmVmLmluc3RhbmNlW2JpbmRpbmddID0gY29tcG9uZW50LmJpbmRpbmdzW2JpbmRpbmddO1xyXG4gICAgICB9XHJcbiAgIH1cclxuXHJcbiAgIHByaXZhdGUgcmVuZGVyQ2hpbGRyZW4oKSB7XHJcbiAgICAgIGlmICh0aGlzLmNoaWxkcmVuICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgaWYgKHRoaXMuYnJhbmNoID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiYnJhbmNoIGlzIHVuZGVmaW5lZFwiKTtcclxuICAgICAgICAgfVxyXG4gICAgICAgICBjb25zdCBuZXdCcmFuY2hDb21wb25lbnQgPSB0aGlzLmNvbXBvbmVudENyZWF0b3JTZXJ2aWNlLmFwcGVuZENvbXBvbmVudDxMaW1ibGVUcmVlQnJhbmNoQ29tcG9uZW50PihcclxuICAgICAgICAgICAgTGltYmxlVHJlZUJyYW5jaENvbXBvbmVudCxcclxuICAgICAgICAgICAgdGhpcy5jaGlsZHJlblxyXG4gICAgICAgICApO1xyXG4gICAgICAgICBuZXdCcmFuY2hDb21wb25lbnQuaW5zdGFuY2UuYnJhbmNoID0gdGhpcy5icmFuY2g7XHJcbiAgICAgICAgIGlmIChpc05lc3RpbmdBbGxvd2VkKHRoaXMudHJlZVNlcnZpY2UudHJlZU9wdGlvbnMsIHRoaXMuYnJhbmNoLmRhdGEpKSB7XHJcbiAgICAgICAgICAgIG5ld0JyYW5jaENvbXBvbmVudC5pbnN0YW5jZS5kcm9wWm9uZUluc2lkZSQuc3Vic2NyaWJlKFxyXG4gICAgICAgICAgICAgICAoZHJvcFpvbmUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgaWYgKFxyXG4gICAgICAgICAgICAgICAgICAgICBkcm9wWm9uZSAhPT0gdW5kZWZpbmVkICYmXHJcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMudHJlZVNlcnZpY2UudHJlZU9wdGlvbnM/LmFsbG93RHJhZ2dpbmcgIT09IGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICkge1xyXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLmRyb3Bab25lSW5zaWRlID0gZHJvcFpvbmU7XHJcbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmJyYW5jaCA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImZhaWxlZCB0byByZWdpc3RlciBpbm5lciBkcm9wIHpvbmVcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgY29uc3QgZHJvcENvb3JkaW5hdGVzSW5zaWRlID0gdGhpcy5icmFuY2guZ2V0Q29vcmRpbmF0ZXMoKTtcclxuICAgICAgICAgICAgICAgICAgICAgZHJvcENvb3JkaW5hdGVzSW5zaWRlLnB1c2goMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJvcFpvbmVTZXJ2aWNlLmFkZERyb3Bab25lKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyOiB0aGlzLmRyb3Bab25lSW5zaWRlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogZHJvcENvb3JkaW5hdGVzSW5zaWRlXHJcbiAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgKTtcclxuICAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgIH1cclxuXHJcbiAgIHByaXZhdGUgcmVnaXN0ZXJEcm9wWm9uZXMoKSB7XHJcbiAgICAgIGlmICh0aGlzLnRyZWVTZXJ2aWNlLnRyZWVPcHRpb25zPy5hbGxvd0RyYWdnaW5nID09PSBmYWxzZSkge1xyXG4gICAgICAgICByZXR1cm47XHJcbiAgICAgIH1cclxuICAgICAgaWYgKFxyXG4gICAgICAgICB0aGlzLmRyb3Bab25lQWJvdmUgPT09IHVuZGVmaW5lZCB8fFxyXG4gICAgICAgICB0aGlzLmRyb3Bab25lQmVsb3cgPT09IHVuZGVmaW5lZCB8fFxyXG4gICAgICAgICB0aGlzLmJyYW5jaCA9PT0gdW5kZWZpbmVkXHJcbiAgICAgICkge1xyXG4gICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJmYWlsZWQgdG8gcmVnaXN0ZXIgZHJvcCB6b25lc1wiKTtcclxuICAgICAgfVxyXG4gICAgICBjb25zdCBjdXJyZW50Q29vcmRpbmF0ZXMgPSB0aGlzLmJyYW5jaC5nZXRDb29yZGluYXRlcygpO1xyXG4gICAgICBjb25zdCBkcm9wQ29vcmRp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0gdW5kZWZpbmVkIHx8IHRoaXMuYnJhbmNoID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRmFpbGVkIHRvIHJlbmRlciB0cmVlIG5vZGVcIik7XHJcbiAgICAgIH1cclxuICAgICAgbGV0IGNvbXBvbmVudCA9IHRoaXMuYnJhbmNoLmRhdGEuY29tcG9uZW50O1xyXG4gICAgICBpZiAoY29tcG9uZW50ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgY29tcG9uZW50ID0gdGhpcy50cmVlU2VydmljZS50cmVlT3B0aW9ucz8uZGVmYXVsdENvbXBvbmVudDtcclxuICAgICAgfVxyXG4gICAgICBpZiAoY29tcG9uZW50ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwibGltYmxlVHJlZSByZXF1aXJlcyBhIGNvbXBvbmVudCB0byByZW5kZXJcIik7XHJcbiAgICAgIH1cclxuICAgICAgY29uc3QgY29tcG9uZW50UmVmID0gdGhpcy5jb21wb25lbnRDcmVhdG9yU2VydmljZS5hcHBlbmRDb21wb25lbnQ8YW55PihcclxuICAgICAgICAgY29tcG9uZW50LmNsYXNzLFxyXG4gICAgICAgICB0aGlzLm5vZGVIb3N0XHJcbiAgICAgICk7XHJcbiAgICAgIGNvbXBvbmVudFJlZi5pbnN0YW5jZS5ub2RlRGF0YSA9IHRoaXMuYnJhbmNoLmRhdGE7XHJcbiAgICAgIGZvciAoY29uc3QgYmluZGluZyBpbiBjb21wb25lbnQuYmluZGluZ3MpIHtcclxuICAgICAgICAgY29tcG9uZW50UmVmLmluc3RhbmNlW2JpbmRpbmddID0gY29tcG9uZW50LmJpbmRpbmdzW2JpbmRpbmddO1xyXG4gICAgICB9XHJcbiAgIH1cclxuXHJcbiAgIHByaXZhdGUgcmVuZGVyQ2hpbGRyZW4oKSB7XHJcbiAgICAgIGlmICh0aGlzLmNoaWxkcmVuICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgaWYgKHRoaXMuYnJhbmNoID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiYnJhbmNoIGlzIHVuZGVmaW5lZFwiKTtcclxuICAgICAgICAgfVxyXG4gICAgICAgICBjb25zdCBuZXdCcmFuY2hDb21wb25lbnQgPSB0aGlzLmNvbXBvbmVudENyZWF0b3JTZXJ2aWNlLmFwcGVuZENvbXBvbmVudDxMaW1ibGVUcmVlQnJhbmNoQ29tcG9uZW50PihcclxuICAgICAgICAgICAgTGltYmxlVHJlZUJyYW5jaENvbXBvbmVudCxcclxuICAgICAgICAgICAgdGhpcy5jaGlsZHJlblxyXG4gICAgICAgICApO1xyXG4gICAgICAgICBuZXdCcmFuY2hDb21wb25lbnQuaW5zdGFuY2UuYnJhbmNoID0gdGhpcy5icmFuY2g7XHJcbiAgICAgICAgIGlmIChpc05lc3RpbmdBbGxvd2VkKHRoaXMudHJlZVNlcnZpY2UudHJlZU9wdGlvbnMsIHRoaXMuYnJhbmNoLmRhdGEpKSB7XHJcbiAgICAgICAgICAgIG5ld0JyYW5jaENvbXBvbmVudC5pbnN0YW5jZS5kcm9wWm9uZUluc2lkZSQuc3Vic2NyaWJlKFxyXG4gICAgICAgICAgICAgICAoZHJvcFpvbmUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgaWYgKFxyXG4gICAgICAgICAgICAgICAgICAgICBkcm9wWm9uZSAhPT0gdW5kZWZpbmVkICYmXHJcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMudHJlZVNlcnZpY2UudHJlZU9wdGlvbnM/LmFsbG93RHJhZ2dpbmcgIT09IGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICkge1xyXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLmRyb3Bab25lSW5zaWRlID0gZHJvcFpvbmU7XHJcbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmJyYW5jaCA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImZhaWxlZCB0byByZWdpc3RlciBpbm5lciBkcm9wIHpvbmVcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgY29uc3QgZHJvcENvb3JkaW5hdGVzSW5zaWRlID0gdGhpcy5icmFuY2guZ2V0Q29vcmRpbmF0ZXMoKTtcclxuICAgICAgICAgICAgICAgICAgICAgZHJvcENvb3JkaW5hdGVzSW5zaWRlLnB1c2goMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJvcFpvbmVTZXJ2aWNlLmFkZERyb3Bab25lKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyOiB0aGlzLmRyb3Bab25lSW5zaWRlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogZHJvcENvb3JkaW5hdGVzSW5zaWRlXHJcbiAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgKTtcclxuICAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgIH1cclxuXHJcbiAgIHByaXZhdGUgcmVnaXN0ZXJEcm9wWm9uZXMoKSB7XHJcbiAgICAgIGlmICh0aGlzLnRyZWVTZXJ2aWNlLnRyZWVPcHRpb25zPy5hbGxvd0RyYWdnaW5nID09PSBmYWxzZSkge1xyXG4gICAgICAgICByZXR1cm47XHJcbiAgICAgIH1cclxuICAgICAgaWYgKFxyXG4gICAgICAgICB0aGlzLmRyb3Bab25lQWJvdmUgPT09IHVuZGVmaW5lZCB8fFxyXG4gICAgICAgICB0aGlzLmRyb3Bab25lQmVsb3cgPT09IHVuZGVmaW5lZCB8fFxyXG4gICAgICAgICB0aGlzLmJyYW5jaCA9PT0gdW5kZWZpbmVkXHJcbiAgICAgICkge1xyXG4gICAgICAgICB0aHJ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W50LnF1ZXJ5U2VsZWN0b3IoXCIubGltYmxlLXRyZWUtaGFuZGxlXCIpO1xyXG4gICAgICBpZiAoIWlzRHJhZ2dpbmdBbGxvd2VkKHRoaXMudHJlZVNlcnZpY2UudHJlZU9wdGlvbnMsIHRoaXMuYnJhbmNoPy5kYXRhKSkge1xyXG4gICAgICAgICBlbGVtZW50LnNldEF0dHJpYnV0ZShcImRyYWdnYWJsZVwiLCBcImZhbHNlXCIpO1xyXG4gICAgICB9IGVsc2UgaWYgKGhhbmRsZSA9PT0gbnVsbCkge1xyXG4gICAgICAgICBlbGVtZW50LnNldEF0dHJpYnV0ZShcImRyYWdnYWJsZVwiLCBcInRydWVcIik7XHJcbiAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgIGhhbmRsZS5hZGRFdmVudExpc3RlbmVyKFwibW91c2Vkb3duXCIsICgpID0+IHtcclxuICAgICAgICAgICAgZWxlbWVudC5zZXRBdHRyaWJ1dGUoXCJkcmFnZ2FibGVcIiwgXCJ0cnVlXCIpO1xyXG4gICAgICAgICB9KTtcclxuICAgICAgICAgaGFuZGxlLmFkZEV2ZW50TGlzdGVuZXIoXCJtb3VzZXVwXCIsICgpID0+IHtcclxuICAgICAgICAgICAgZWxlbWVudC5zZXRBdHRyaWJ1dGUoXCJkcmFnZ2FibGVcIiwgXCJmYWxzZVwiKTtcclxuICAgICAgICAgfSk7XHJcbiAgICAgIH1cclxuICAgfVxyXG59XHJcbiJdfQ==

@@ -530,4 +530,4 @@ import { Injectable, ComponentFactoryResolver, Component, Input, ChangeDetectorRef, ViewChild, ViewContainerRef, Output, ElementRef, EventEmitter, NgModule } from '@angular/core';

const target = event.currentTarget;
const topLine = target.offsetHeight / 4; //an imaginary line 25% of the way down from the top of the element;
const bottomLine = topLine * 3; //an imaginary line 25% of the way up from the bottom of the element;
const topLine = target.offsetHeight / 3; //an imaginary line 1/3 of the way down from the top of the element;
const bottomLine = topLine * 2; //an imaginary line 1/3 of the way up from the bottom of the element;
if (event.offsetY < topLine &&

@@ -558,3 +558,3 @@ this.dropZoneAbove !== undefined &&

this.dropZoneBelow &&
this.branch.getChildren().length !== 0) {
this.branch.getChildren().length === 0) {
const dropCoordinates = [...this.branch.getCoordinates()];

@@ -561,0 +561,0 @@ dropCoordinates[dropCoordinates.length - 1]++;

{
"name": "@limble/limble-tree",
"version": "0.3.0",
"version": "0.3.1",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "^11.0.9",

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