@davvidess/angular-split
Version:
Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.
16 lines (14 loc) • 24.2 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@davvidess/angular-split",["exports","@angular/core","@angular/common","rxjs","rxjs/operators"],t):t(((e=e||self).davvidess=e.davvidess||{},e.davvidess["angular-split"]={}),e.ng.core,e.ng.common,e.rxjs,e.rxjs.operators)}(this,(function(e,t,i,n,r){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function s(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}function o(e){return void 0!==e.changedTouches&&e.changedTouches.length>0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:void 0!==e.clientX&&void 0!==e.clientY?{x:e.clientX,y:e.clientY}:null}function l(e,t){var i=e.nativeElement.getBoundingClientRect();return"horizontal"===t?i.width:i.height}function u(e){return"boolean"==typeof e?e:"false"!==e}function h(e,t){return null==e?t:(e=Number(e),!isNaN(e)&&e>=0?e:t)}function p(e,t){if("percent"===e){var i=t.reduce((function(e,t){return null!==t?e+t:e}),0);return t.every((function(e){return null!==e}))&&i>99.9&&i<100.1}if("pixel"===e)return 1===t.filter((function(e){return null===e})).length}function c(e){return null===e.size?null:!0===e.component.lockSize?e.size:null===e.component.minSize?null:e.component.minSize>e.size?e.size:e.component.minSize}function d(e){return null===e.size?null:!0===e.component.lockSize?e.size:null===e.component.maxSize?null:e.component.maxSize<e.size?e.size:e.component.maxSize}function f(e,t,i,n){return t.reduce((function(t,i){var r=function(e,t,i,n){if(0===i)return{areaSnapshot:t,pixelAbsorb:0,percentAfterAbsorption:t.sizePercentAtStart,pixelRemain:0};if(0===t.sizePixelAtStart&&i<0)return{areaSnapshot:t,pixelAbsorb:0,percentAfterAbsorption:0,pixelRemain:i};if("percent"===e)return function(e,t,i){var n=(e.sizePixelAtStart+t)/i*100;if(t>0){if(null!==e.area.maxSize&&n>e.area.maxSize){var r=e.area.maxSize/100*i;return{areaSnapshot:e,pixelAbsorb:r,percentAfterAbsorption:e.area.maxSize,pixelRemain:e.sizePixelAtStart+t-r}}return{areaSnapshot:e,pixelAbsorb:t,percentAfterAbsorption:n>100?100:n,pixelRemain:0}}if(t<0){if(null!==e.area.minSize&&n<e.area.minSize){var s=e.area.minSize/100*i;return{areaSnapshot:e,pixelAbsorb:s,percentAfterAbsorption:e.area.minSize,pixelRemain:e.sizePixelAtStart+t-s}}return n<0?{areaSnapshot:e,pixelAbsorb:-e.sizePixelAtStart,percentAfterAbsorption:0,pixelRemain:t+e.sizePixelAtStart}:{areaSnapshot:e,pixelAbsorb:t,percentAfterAbsorption:n,pixelRemain:0}}}(t,i,n);if("pixel"===e)return function(e,t,i){var n=e.sizePixelAtStart+t;if(t>0)return null!==e.area.maxSize&&n>e.area.maxSize?{areaSnapshot:e,pixelAbsorb:e.area.maxSize-e.sizePixelAtStart,percentAfterAbsorption:-1,pixelRemain:n-e.area.maxSize}:{areaSnapshot:e,pixelAbsorb:t,percentAfterAbsorption:-1,pixelRemain:0};if(t<0)return null!==e.area.minSize&&n<e.area.minSize?{areaSnapshot:e,pixelAbsorb:e.area.minSize+t-n,percentAfterAbsorption:-1,pixelRemain:n-e.area.minSize}:n<0?{areaSnapshot:e,pixelAbsorb:-e.sizePixelAtStart,percentAfterAbsorption:-1,pixelRemain:t+e.sizePixelAtStart}:{areaSnapshot:e,pixelAbsorb:t,percentAfterAbsorption:-1,pixelRemain:0}}(t,i)}(e,i,t.remain,n);return t.list.push(r),t.remain=r.pixelRemain,t}),{remain:i,list:[]})}function g(e,t){"percent"===e?t.areaSnapshot.area.size=t.percentAfterAbsorption:"pixel"===e&&null!==t.areaSnapshot.area.size&&(t.areaSnapshot.area.size=t.areaSnapshot.sizePixelAtStart+t.pixelAbsorb)}var m=function(){function e(e,i,r,s){this.ngZone=e,this.elRef=i,this.cdRef=r,this.renderer=s,this._direction="horizontal",this._unit="percent",this._gutterSize=11,this._gutterStep=1,this._restrictMove=!1,this._useTransition=!1,this._disabled=!1,this._dir="ltr",this._gutterDblClickDuration=0,this.dragStart=new t.EventEmitter(!1),this.dragEnd=new t.EventEmitter(!1),this.gutterClick=new t.EventEmitter(!1),this.gutterDblClick=new t.EventEmitter(!1),this.dragProgressSubject=new n.Subject,this.dragProgress$=this.dragProgressSubject.asObservable(),this.isDragging=!1,this.isWaitingClear=!1,this.dragListeners=[],this.snapshot=null,this.startPoint=null,this.endPoint=null,this.displayedAreas=[],this.hidedAreas=[],this._clickTimeout=null,this.direction=this._direction}return Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(e){this._direction="vertical"===e?"vertical":"horizontal",this.renderer.addClass(this.elRef.nativeElement,"as-"+this._direction),this.renderer.removeClass(this.elRef.nativeElement,"as-"+("vertical"===this._direction?"horizontal":"vertical")),this.build(!1,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"unit",{get:function(){return this._unit},set:function(e){this._unit="pixel"===e?"pixel":"percent",this.renderer.addClass(this.elRef.nativeElement,"as-"+this._unit),this.renderer.removeClass(this.elRef.nativeElement,"as-"+("pixel"===this._unit?"percent":"pixel")),this.build(!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gutterSize",{get:function(){return this._gutterSize},set:function(e){this._gutterSize=h(e,11),this.build(!1,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gutterStep",{get:function(){return this._gutterStep},set:function(e){this._gutterStep=h(e,1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restrictMove",{get:function(){return this._restrictMove},set:function(e){this._restrictMove=u(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useTransition",{get:function(){return this._useTransition},set:function(e){this._useTransition=u(e),this._useTransition?this.renderer.addClass(this.elRef.nativeElement,"as-transition"):this.renderer.removeClass(this.elRef.nativeElement,"as-transition")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=u(e),this._disabled?this.renderer.addClass(this.elRef.nativeElement,"as-disabled"):this.renderer.removeClass(this.elRef.nativeElement,"as-disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this._dir},set:function(e){this._dir="rtl"===e?"rtl":"ltr",this.renderer.setAttribute(this.elRef.nativeElement,"dir",this._dir)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gutterDblClickDuration",{get:function(){return this._gutterDblClickDuration},set:function(e){this._gutterDblClickDuration=h(e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionEnd",{get:function(){var e=this;return new n.Observable((function(t){return e.transitionEndSubscriber=t})).pipe(r.debounceTime(20))},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.ngZone.runOutsideAngular((function(){setTimeout((function(){return e.renderer.addClass(e.elRef.nativeElement,"as-init")}))}))},e.prototype.getNbGutters=function(){return 0===this.displayedAreas.length?0:this.displayedAreas.length-1},e.prototype.addArea=function(e){var t={component:e,order:0,size:0,minSize:null,maxSize:null};!0===e.visible?(this.displayedAreas.push(t),this.build(!0,!0)):this.hidedAreas.push(t)},e.prototype.removeArea=function(e){if(this.displayedAreas.some((function(t){return t.component===e}))){var t=this.displayedAreas.find((function(t){return t.component===e}));this.displayedAreas.splice(this.displayedAreas.indexOf(t),1),this.build(!0,!0)}else if(this.hidedAreas.some((function(t){return t.component===e}))){t=this.hidedAreas.find((function(t){return t.component===e}));this.hidedAreas.splice(this.hidedAreas.indexOf(t),1)}},e.prototype.updateArea=function(e,t,i){!0===e.visible&&this.build(t,i)},e.prototype.showArea=function(e){var t,i=this.hidedAreas.find((function(t){return t.component===e}));if(void 0!==i){var n=this.hidedAreas.splice(this.hidedAreas.indexOf(i),1);(t=this.displayedAreas).push.apply(t,a(n)),this.build(!0,!0)}},e.prototype.hideArea=function(e){var t,i=this.displayedAreas.find((function(t){return t.component===e}));if(void 0!==i){var n=this.displayedAreas.splice(this.displayedAreas.indexOf(i),1);n.forEach((function(e){e.order=0,e.size=0})),(t=this.hidedAreas).push.apply(t,a(n)),this.build(!0,!0)}},e.prototype.getVisibleAreaSizes=function(){return this.displayedAreas.map((function(e){return null===e.size?"*":e.size}))},e.prototype.setVisibleAreaSizes=function(e){if(e.length!==this.displayedAreas.length)return!1;var t=e.map((function(e){return h(e,null)}));return!1!==p(this.unit,t)&&(this.displayedAreas.forEach((function(e,i){return e.component._size=t[i]})),this.build(!1,!0),!0)},e.prototype.build=function(e,t){if(this.stopDragging(),!0===e&&(this.displayedAreas.every((function(e){return null!==e.component.order}))&&this.displayedAreas.sort((function(e,t){return e.component.order-t.component.order})),this.displayedAreas.forEach((function(e,t){e.order=2*t,e.component.setStyleOrder(e.order)}))),!0===t){var i=p(this.unit,this.displayedAreas.map((function(e){return e.component.size})));switch(this.unit){case"percent":var n=100/this.displayedAreas.length;this.displayedAreas.forEach((function(e){e.size=i?e.component.size:n,e.minSize=c(e),e.maxSize=d(e)}));break;case"pixel":if(i)this.displayedAreas.forEach((function(e){e.size=e.component.size,e.minSize=c(e),e.maxSize=d(e)}));else{var r=this.displayedAreas.filter((function(e){return null===e.component.size}));if(0===r.length&&this.displayedAreas.length>0)this.displayedAreas.forEach((function(e,t){e.size=0===t?null:e.component.size,e.minSize=0===t?null:c(e),e.maxSize=0===t?null:d(e)}));else if(r.length>1){var s=!1;this.displayedAreas.forEach((function(e){null===e.component.size?!1===s?(e.size=null,e.minSize=null,e.maxSize=null,s=!0):(e.size=100,e.minSize=null,e.maxSize=null):(e.size=e.component.size,e.minSize=c(e),e.maxSize=d(e))}))}}}}this.refreshStyleSizes(),this.cdRef.markForCheck()},e.prototype.refreshStyleSizes=function(){var e=this;if("percent"===this.unit)if(1===this.displayedAreas.length)this.displayedAreas[0].component.setStyleFlex(0,0,"100%",!1,!1);else{var t=this.getNbGutters()*this.gutterSize;this.displayedAreas.forEach((function(e){e.component.setStyleFlex(0,0,"calc( "+e.size+"% - "+e.size/100*t+"px )",null!==e.minSize&&e.minSize===e.size,null!==e.maxSize&&e.maxSize===e.size)}))}else"pixel"===this.unit&&this.displayedAreas.forEach((function(t){null===t.size?1===e.displayedAreas.length?t.component.setStyleFlex(1,1,"100%",!1,!1):t.component.setStyleFlex(1,1,"auto",!1,!1):1===e.displayedAreas.length?t.component.setStyleFlex(0,0,"100%",!1,!1):t.component.setStyleFlex(0,0,t.size+"px",null!==t.minSize&&t.minSize===t.size,null!==t.maxSize&&t.maxSize===t.size)}))},e.prototype.clickGutter=function(e,t){var i=this,n=o(e);this.startPoint&&this.startPoint.x===n.x&&this.startPoint.y===n.y&&(null!==this._clickTimeout?(window.clearTimeout(this._clickTimeout),this._clickTimeout=null,this.notify("dblclick",t),this.stopDragging()):this._clickTimeout=window.setTimeout((function(){i._clickTimeout=null,i.notify("click",t),i.stopDragging()}),this.gutterDblClickDuration))},e.prototype.startDragging=function(e,t,i){var n=this;e.preventDefault(),e.stopPropagation(),this.startPoint=o(e),null!==this.startPoint&&!0!==this.disabled&&!0!==this.isWaitingClear&&(this.snapshot={gutterNum:i,lastSteppedOffset:0,allAreasSizePixel:l(this.elRef,this.direction)-this.getNbGutters()*this.gutterSize,allInvolvedAreasSizePercent:100,areasBeforeGutter:[],areasAfterGutter:[]},this.displayedAreas.forEach((function(e){var i={area:e,sizePixelAtStart:l(e.component.elRef,n.direction),sizePercentAtStart:"percent"===n.unit?e.size:-1};e.order<t?!0===n.restrictMove?n.snapshot.areasBeforeGutter=[i]:n.snapshot.areasBeforeGutter.unshift(i):e.order>t&&(!0===n.restrictMove?0===n.snapshot.areasAfterGutter.length&&(n.snapshot.areasAfterGutter=[i]):n.snapshot.areasAfterGutter.push(i))})),this.snapshot.allInvolvedAreasSizePercent=a(this.snapshot.areasBeforeGutter,this.snapshot.areasAfterGutter).reduce((function(e,t){return e+t.sizePercentAtStart}),0),0!==this.snapshot.areasBeforeGutter.length&&0!==this.snapshot.areasAfterGutter.length&&(this.dragListeners.push(this.renderer.listen(this.elRef.nativeElement,"mouseup",this.stopDragging.bind(this))),this.dragListeners.push(this.renderer.listen(this.elRef.nativeElement,"touchend",this.stopDragging.bind(this))),this.dragListeners.push(this.renderer.listen(this.elRef.nativeElement,"touchcancel",this.stopDragging.bind(this))),this.ngZone.runOutsideAngular((function(){n.dragListeners.push(n.renderer.listen(n.elRef.nativeElement,"mousemove",n.dragEvent.bind(n))),n.dragListeners.push(n.renderer.listen(n.elRef.nativeElement,"touchmove",n.dragEvent.bind(n)))})),this.displayedAreas.forEach((function(e){return e.component.lockEvents()})),this.isDragging=!0,this.renderer.addClass(this.elRef.nativeElement,"as-dragging"),this.renderer.addClass(this.gutterEls.toArray()[this.snapshot.gutterNum-1].nativeElement,"as-dragged"),this.notify("start",this.snapshot.gutterNum)))},e.prototype.dragEvent=function(e){var t=this;if(e.preventDefault(),e.stopPropagation(),null!==this._clickTimeout&&(window.clearTimeout(this._clickTimeout),this._clickTimeout=null),!1!==this.isDragging&&(this.endPoint=o(e),null!==this.endPoint)){var i="horizontal"===this.direction?this.startPoint.x-this.endPoint.x:this.startPoint.y-this.endPoint.y;"rtl"===this.dir&&(i=-i);var n=Math.round(i/this.gutterStep)*this.gutterStep;if(n!==this.snapshot.lastSteppedOffset){this.snapshot.lastSteppedOffset=n;var r=f(this.unit,this.snapshot.areasBeforeGutter,-n,this.snapshot.allAreasSizePixel),s=f(this.unit,this.snapshot.areasAfterGutter,n,this.snapshot.allAreasSizePixel);if(0!==r.remain&&0!==s.remain?Math.abs(r.remain)===Math.abs(s.remain)||(Math.abs(r.remain)>Math.abs(s.remain)?s=f(this.unit,this.snapshot.areasAfterGutter,n+r.remain,this.snapshot.allAreasSizePixel):r=f(this.unit,this.snapshot.areasBeforeGutter,-(n-s.remain),this.snapshot.allAreasSizePixel)):0!==r.remain?s=f(this.unit,this.snapshot.areasAfterGutter,n+r.remain,this.snapshot.allAreasSizePixel):0!==s.remain&&(r=f(this.unit,this.snapshot.areasBeforeGutter,-(n-s.remain),this.snapshot.allAreasSizePixel)),"percent"===this.unit){var l=a(r.list,s.list),u=l.find((function(e){return 0!==e.percentAfterAbsorption&&e.percentAfterAbsorption!==e.areaSnapshot.area.minSize&&e.percentAfterAbsorption!==e.areaSnapshot.area.maxSize}));u&&(u.percentAfterAbsorption=this.snapshot.allInvolvedAreasSizePercent-l.filter((function(e){return e!==u})).reduce((function(e,t){return e+t.percentAfterAbsorption}),0))}r.list.forEach((function(e){return g(t.unit,e)})),s.list.forEach((function(e){return g(t.unit,e)})),this.refreshStyleSizes(),this.notify("progress",this.snapshot.gutterNum)}}},e.prototype.stopDragging=function(e){var t=this;if(e&&(e.preventDefault(),e.stopPropagation()),!1!==this.isDragging){for(this.displayedAreas.forEach((function(e){return e.component.unlockEvents()}));this.dragListeners.length>0;){var i=this.dragListeners.pop();i&&i()}this.isDragging=!1,!this.endPoint||this.startPoint.x===this.endPoint.x&&this.startPoint.y===this.endPoint.y||this.notify("end",this.snapshot.gutterNum),this.renderer.removeClass(this.elRef.nativeElement,"as-dragging"),this.renderer.removeClass(this.gutterEls.toArray()[this.snapshot.gutterNum-1].nativeElement,"as-dragged"),this.snapshot=null,this.isWaitingClear=!0,this.ngZone.runOutsideAngular((function(){setTimeout((function(){t.startPoint=null,t.endPoint=null,t.isWaitingClear=!1}))}))}},e.prototype.notify=function(e,t){var i=this,n=this.getVisibleAreaSizes();"start"===e?this.dragStart.emit({gutterNum:t,sizes:n}):"end"===e?this.dragEnd.emit({gutterNum:t,sizes:n}):"click"===e?this.gutterClick.emit({gutterNum:t,sizes:n}):"dblclick"===e?this.gutterDblClick.emit({gutterNum:t,sizes:n}):"transitionEnd"===e?this.transitionEndSubscriber&&this.ngZone.run((function(){return i.transitionEndSubscriber.next(n)})):"progress"===e&&this.dragProgressSubject.next({gutterNum:t,sizes:n})},e.prototype.ngOnDestroy=function(){this.stopDragging()},e.decorators=[{type:t.Component,args:[{selector:"as-split",exportAs:"asSplit",changeDetection:t.ChangeDetectionStrategy.OnPush,template:' <ng-content></ng-content>\n <ng-template ngFor [ngForOf]="displayedAreas" let-index="index" let-last="last">\n <div\n *ngIf="last === false"\n #gutterEls\n class="as-split-gutter"\n [style.flex-basis.px]="gutterSize"\n [style.order]="index * 2 + 1"\n (mousedown)="startDragging($event, index * 2 + 1, index + 1)"\n (touchstart)="startDragging($event, index * 2 + 1, index + 1)"\n (mouseup)="clickGutter($event, index + 1)"\n (touchend)="clickGutter($event, index + 1)"\n >\n <div class="as-split-gutter-icon"></div>\n </div>\n </ng-template>',encapsulation:t.ViewEncapsulation.Emulated,styles:[':host{display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;width:100%;height:100%}:host>.as-split-gutter{flex-grow:0;flex-shrink:0;background-color:#eee;display:flex;align-items:center;justify-content:center}:host>.as-split-gutter>.as-split-gutter-icon{width:100%;height:100%;background-position:center center;background-repeat:no-repeat}:host ::ng-deep>.as-split-area{flex-grow:0;flex-shrink:0;overflow-x:hidden;overflow-y:auto}:host ::ng-deep>.as-split-area.as-hidden{flex:0 1 0px!important;overflow-x:hidden;overflow-y:hidden}:host.as-horizontal{flex-direction:row}:host.as-horizontal>.as-split-gutter{flex-direction:row;cursor:col-resize;height:100%}:host.as-horizontal>.as-split-gutter>.as-split-gutter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==)}:host.as-horizontal ::ng-deep>.as-split-area{height:100%}:host.as-vertical{flex-direction:column}:host.as-vertical>.as-split-gutter{flex-direction:column;cursor:row-resize;width:100%}:host.as-vertical>.as-split-gutter .as-split-gutter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFCAMAAABl/6zIAAAABlBMVEUAAADMzMzIT8AyAAAAAXRSTlMAQObYZgAAABRJREFUeAFjYGRkwIMJSeMHlBkOABP7AEGzSuPKAAAAAElFTkSuQmCC)}:host.as-vertical ::ng-deep>.as-split-area{width:100%}:host.as-vertical ::ng-deep>.as-split-area.as-hidden{max-width:0}:host.as-disabled>.as-split-gutter{cursor:default}:host.as-disabled>.as-split-gutter .as-split-gutter-icon{background-image:url("")}:host.as-transition.as-init:not(.as-dragging) ::ng-deep>.as-split-area,:host.as-transition.as-init:not(.as-dragging)>.as-split-gutter{transition:flex-basis .3s}']}]}],e.ctorParameters=function(){return[{type:t.NgZone},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:t.Renderer2}]},e.propDecorators={direction:[{type:t.Input}],unit:[{type:t.Input}],gutterSize:[{type:t.Input}],gutterStep:[{type:t.Input}],restrictMove:[{type:t.Input}],useTransition:[{type:t.Input}],disabled:[{type:t.Input}],dir:[{type:t.Input}],gutterDblClickDuration:[{type:t.Input}],dragStart:[{type:t.Output}],dragEnd:[{type:t.Output}],gutterClick:[{type:t.Output}],gutterDblClick:[{type:t.Output}],transitionEnd:[{type:t.Output}],gutterEls:[{type:t.ViewChildren,args:["gutterEls"]}]},e}();var A=function(){function e(e,t,i,n){this.ngZone=e,this.elRef=t,this.renderer=i,this.split=n,this._order=null,this._size=null,this._minSize=null,this._maxSize=null,this._lockSize=!1,this._visible=!0,this.lockListeners=[],this.renderer.addClass(this.elRef.nativeElement,"as-split-area")}return Object.defineProperty(e.prototype,"order",{get:function(){return this._order},set:function(e){this._order=h(e,null),this.split.updateArea(this,!0,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this._size=h(e,null),this.split.updateArea(this,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minSize",{get:function(){return this._minSize},set:function(e){this._minSize=h(e,null),this.split.updateArea(this,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},set:function(e){this._maxSize=h(e,null),this.split.updateArea(this,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lockSize",{get:function(){return this._lockSize},set:function(e){this._lockSize=u(e),this.split.updateArea(this,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=u(e),this._visible?(this.split.showArea(this),this.renderer.removeClass(this.elRef.nativeElement,"as-hidden")):(this.split.hideArea(this),this.renderer.addClass(this.elRef.nativeElement,"as-hidden"))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.split.addArea(this),this.ngZone.runOutsideAngular((function(){e.transitionListener=e.renderer.listen(e.elRef.nativeElement,"transitionend",(function(t){"flex-basis"===t.propertyName&&e.split.notify("transitionEnd",-1)}))}))},e.prototype.setStyleOrder=function(e){this.renderer.setStyle(this.elRef.nativeElement,"order",e)},e.prototype.setStyleFlex=function(e,t,i,n,r){this.renderer.setStyle(this.elRef.nativeElement,"flex-grow",e),this.renderer.setStyle(this.elRef.nativeElement,"flex-shrink",t),this.renderer.setStyle(this.elRef.nativeElement,"flex-basis",i),!0===n?this.renderer.addClass(this.elRef.nativeElement,"as-min"):this.renderer.removeClass(this.elRef.nativeElement,"as-min"),!0===r?this.renderer.addClass(this.elRef.nativeElement,"as-max"):this.renderer.removeClass(this.elRef.nativeElement,"as-max")},e.prototype.lockEvents=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.lockListeners.push(e.renderer.listen(e.elRef.nativeElement,"selectstart",(function(e){return!1}))),e.lockListeners.push(e.renderer.listen(e.elRef.nativeElement,"dragstart",(function(e){return!1})))}))},e.prototype.unlockEvents=function(){for(;this.lockListeners.length>0;){var e=this.lockListeners.pop();e&&e()}},e.prototype.ngOnDestroy=function(){this.unlockEvents(),this.transitionListener&&this.transitionListener(),this.split.removeArea(this)},e.decorators=[{type:t.Directive,args:[{selector:"as-split-area, [as-split-area]",exportAs:"asSplitArea"}]}],e.ctorParameters=function(){return[{type:t.NgZone},{type:t.ElementRef},{type:t.Renderer2},{type:m}]},e.propDecorators={order:[{type:t.Input}],size:[{type:t.Input}],minSize:[{type:t.Input}],maxSize:[{type:t.Input}],lockSize:[{type:t.Input}],visible:[{type:t.Input}]},e}();var y=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.forChild=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule],declarations:[m,A],exports:[m,A]}]}],e}();e.AngularSplitModule=y,e.SplitAreaDirective=A,e.SplitComponent=m,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=davvidess-angular-split.umd.min.js.map