!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@true-directive/base"),require("@angular/core"),require("rxjs"),require("@angular/forms"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@true-directive/grid",["exports","@true-directive/base","@angular/core","rxjs","@angular/forms","rxjs/operators","@angular/common"],e):e(((t=t||self)["true-directive"]=t["true-directive"]||{},t["true-directive"].grid={}),t.base,t.ng.core,t.rxjs,t.ng.forms,t.rxjs.operators,t.ng.common)}(this,function(t,e,i,n,r,o,s){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function l(t,e){function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function u(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function c(t,e){return function(i,n){e(i,n,t)}}function p(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var h=function(t){function e(){var e=t.call(this)||this;return e._onLocaleChanged=new n.BehaviorSubject(e.locale),e.onLocaleChanged=e._onLocaleChanged.asObservable(),e}return l(e,t),e.prototype.localeChangedEvent=function(t){this._onLocaleChanged.next(t)},e=u([i.Injectable(),p("design:paramtypes",[])],e)}(e.Internationalization),d=function(){function t(t){this.intl=t}return t.prototype.transform=function(t){return this.intl.translate(t)},t=u([i.Pipe({name:"trueTranslate",pure:!1}),p("design:paramtypes",[h])],t)}(),f=function(){function t(){this.name="events",this._onDataQuery=new n.Subject,this.onDataQuery=this._onDataQuery.asObservable(),this._onDataFetch=new n.Subject,this.onDataFetch=this._onDataFetch.asObservable(),this._onColumnsChanged=new n.Subject,this.onColumnsChanged=this._onColumnsChanged.asObservable(),this._onQueryChanged=new n.Subject,this.onQueryChanged=this._onQueryChanged.asObservable(),this._onSummariesChanged=new n.Subject,this.onSummariesChanged=this._onSummariesChanged.asObservable(),this._onValueChanged=new n.Subject,this.onValueChanged=this._onValueChanged.asObservable(),this._onCheckedChanged=new n.Subject,this.onCheckedChanged=this._onCheckedChanged.asObservable(),this._onDrag=new n.Subject,this.onDrag=this._onDrag.asObservable(),this._onDrop=new n.Subject,this.onDrop=this._onDrop.asObservable(),this._onColumnResizing=new n.Subject,this.onColumnResizing=this._onColumnResizing.asObservable(),this._onColumnResize=new n.Subject,this.onColumnResize=this._onColumnResize.asObservable(),this._onFilterShow=new n.Subject,this.onFilterShow=this._onFilterShow.asObservable(),this._onSelect=new n.Subject,this.onSelect=this._onSelect.asObservable(),this._onStartEditing=new n.Subject,this.onStartEditing=this._onStartEditing.asObservable(),this._onStopEditing=new n.Subject,this.onStopEditing=this._onStopEditing.asObservable(),this._onRowUnfiltered=new n.Subject,this.onRowUnfiltered=this._onRowUnfiltered.asObservable(),this._onHeaderContextMenu=new n.Subject,this.onHeaderContextMenu=this._onHeaderContextMenu.asObservable(),this._onCustomCellEvent=new n.Subject,this.onCustomCellEvent=this._onCustomCellEvent.asObservable()}return t.prototype.dataQueryEvent=function(t){this._onDataQuery.next(t)},t.prototype.dataFetchEvent=function(t){t.subject&&(t.subject.next(),t.subject.complete()),this._onDataFetch.next(t)},t.prototype.columnsChangedEvent=function(){this._onColumnsChanged.next()},t.prototype.queryChangedEvent=function(t){this._onQueryChanged.next(t)},t.prototype.summariesChangedEvent=function(t){this._onSummariesChanged.next(t)},t.prototype.valueChangedEvent=function(t){this._onValueChanged.next(t)},t.prototype.checkedChangedEvent=function(t){this._onCheckedChanged.next(t)},t.prototype.dragEvent=function(t){this._onDrag.next(t)},t.prototype.dropEvent=function(t){this._onDrop.next(t)},t.prototype.columnResizeEvent=function(t){this._onColumnResize.next(t)},t.prototype.filterShowEvent=function(t){this._onFilterShow.next(t)},t.prototype.selectEvent=function(t){this._onSelect.next(t)},t.prototype.startEditingEvent=function(t){this._onStartEditing.next(t)},t.prototype.stopEditingEvent=function(t){this._onStopEditing.next(t)},t.prototype.headerContextMenuEvent=function(t){this._onHeaderContextMenu.next(t)},t.prototype.customCellEvent=function(t){this._onCustomCellEvent.next(t)},t}(),g=function(t){function e(){var e=t.call(this)||this;return e._onFocusChanged=new n.Subject,e.onFocusChanged=e._onFocusChanged.asObservable(),e._onSelectionChanged=new n.Subject,e.onSelectionChanged=e._onSelectionChanged.asObservable(),e}return l(e,t),e.prototype.selectionChangedEvent=function(t){this._onSelectionChanged.next(t)},e.prototype.focusChangedEvent=function(t){this._onFocusChanged.next(t)},e}(e.Selection),y=function(){function t(){}return t.focusAndOpenKeyboard=function(t,e){if(t){var i=document.createElement("input");i.style.position="absolute",i.style.top=t.offsetTop+7+"px",i.style.left=t.offsetLeft+"px",i.style.height="0",i.style.opacity="0",document.body.appendChild(i),i.focus(),setTimeout(function(){t.focus(),t.click(),document.body.removeChild(i)},e)}},t.downloadCSV=function(t,e){var i=document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURIComponent(e)),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},t.copyToClipboard=function(t){var e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0.0",e.style.width="20px",e.style.height="20px",e.style.top="-40px",e.style.left="-40px",document.body.appendChild(e),e.focus(),e.select();try{return document.execCommand("copy")}catch(i){return!1}document.body.removeChild(e)},t}(),m=function(t){function r(e){var i=t.call(this)||this;return i.internationalization=e,i.focusChangedSubscription=i.selection.onFocusChanged.subscribe(function(t){i.layoutsHandler.updateLayoutSelections(t),i.focusChanged(t)}),i.selectionChangedSubscription=i.selection.onSelectionChanged.subscribe(function(t){i.layoutsHandler.updateLayoutSelections(t),i.events.selectEvent(t)}),i.localeChangedSubscription=i.internationalization.onLocaleChanged.subscribe(function(t){i.dataSource.valueFormatter.setLocale(t)}),i}return l(r,t),r.prototype.updateDataAsync=function(){var t=this,i=new n.Subject;return this.settings.requestData?(this.doQuery(i),this.events.columnsChangedEvent(),i):(this.recalcData().then(function(){var n;t.fetchData(new e.DataQuery(t._dataQueryCounter)),t.dataSource.resultRows&&(n=t.dataSource.resultRows.length),i.next(n),i.complete()}),i)},r.prototype.copySelectionToClipboard=function(t){y.copyToClipboard(this.getSelectedData(this.selection).toString(t,"\t"))},r.prototype.exportToCSV=function(t,e){void 0===e&&(e=","),y.downloadCSV(t,this.dataToExport().toString(!0,e,!0))},r.prototype.ngOnDestroy=function(){this.focusChangedSubscription.unsubscribe(),this.selectionChangedSubscription.unsubscribe(),this.localeChangedSubscription.unsubscribe()},r.prototype.registerHandlers=function(){t.prototype.registerHandlers.call(this),this.handlers.events=f,this.handlers.selection=g},u([e.AxInject("events"),p("design:type",f)],r.prototype,"events",void 0),u([e.AxInject("selection"),p("design:type",g)],r.prototype,"selection",void 0),r=u([i.Injectable(),p("design:paramtypes",[h])],r)}(e.GridState),v=function(){function t(){this.onChange=function(t){},this.onTouched=function(){},this.caption=""}var e;return e=t,t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){t!==this._value&&(this._value=t,this.onChange(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inversed",{get:function(){return this._inversed},enumerable:!0,configurable:!0}),t.prototype.blur=function(){this.onTouched()},t.prototype.writeValue=function(t){this._value!==t&&(this._value=t)},u([i.Input("caption"),p("design:type",String)],t.prototype,"caption",void 0),u([i.Input("inversed"),p("design:type",Object)],t.prototype,"_inversed",void 0),u([i.HostBinding("class.inversed"),p("design:type",Object),p("design:paramtypes",[])],t.prototype,"inversed",null),t=e=u([i.Component({selector:"true-checkbox",template:'\n      <true-checkbox-wrapper [class.inversed]="inversed">\n        <input type="checkbox" [(ngModel)]="value" (blur)="blur()"/>\n        <span caption>{{caption}}</span>\n      </true-checkbox-wrapper>\n    ',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return e}),multi:!0}]})],t)}(),b=function(){function t(){}return t=u([i.Component({selector:"true-checkbox-wrapper",template:'<label class="true-checkbox"><ng-content select="[caption]"></ng-content>\n      <ng-content select="input"></ng-content>\n      <span class="true-checkbox__checkmark"></span>\n    </label>'})],t)}(),w=function(){function t(){this.showError=!0,this.disabled=null,this.onBtnClick=new i.EventEmitter}return Object.defineProperty(t.prototype,"hasBtn",{get:function(){return this.icon!==undefined&&""!==this.icon},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasError",{get:function(){return this.error!==undefined&&""!==this.error},enumerable:!0,configurable:!0}),t.prototype.btnClick=function(t){this.onBtnClick.emit(t),t.stopPropagation()},u([i.HostBinding("class.true-input_with-btn"),p("design:type",Object),p("design:paramtypes",[])],t.prototype,"hasBtn",null),u([i.HostBinding("class.true-input_with-error"),p("design:type",Object),p("design:paramtypes",[])],t.prototype,"hasError",null),u([i.Input("icon"),p("design:type",String)],t.prototype,"icon",void 0),u([i.Input("error"),p("design:type",String)],t.prototype,"error",void 0),u([i.Input("showError"),p("design:type",Boolean)],t.prototype,"showError",void 0),u([i.Input("disabled"),p("design:type",Boolean)],t.prototype,"disabled",void 0),u([i.Output("btnClick"),p("design:type",i.EventEmitter)],t.prototype,"onBtnClick",void 0),t=u([i.Component({selector:"true-input-wrapper",template:'\n    <div>\n      <ng-content></ng-content><button\n          *ngIf="icon"\n          type="button"\n          tabindex="-1"\n          class="true-input__btn"\n          [attr.disabled]="disabled"\n          (click)="btnClick($event)">\n        <div [ngClass]="icon"></div>\n      </button>\n    </div>\n    <div *ngIf="showError" class="true-input__err-msg">{{error}}</div>\n    ',host:{"class":"true-input"},styles:["\n      :host {\n        overflow-x: visible;\n        word-wrap: normal;\n        display: inline-block;\n        vertical-align: baseline;\n        padding: 0;\n        margin: 0;\n      }\n\n      :host > div:first-child {\n        width: 100%;\n        height: 100%;\n        display: inline-flex;\n      }\n\n      .true-input__err-msg {\n        position: absolute;\n        display: none;\n      }\n\n      :host.true-input_with-error > .true-input__err-msg {\n        display: block;\n      }\n\n    "]})],t)}(),C=function(){function t(t,e,n){this.elementRef=t,this.changeDetector=e,this._renderer=n,this.transform0="translateX(15px)",this.transform1="translateX(0)",this.modalTransform0="translateY(-20px)",this.modalTransform1="translateY(0)",this.modalTransform2="translateY(20px)",this.snackTransform0="scale(0.85)",this.snackTransform1="scale(1.0)",this.snackTransform2="scale(1.5)",this.shiftDx=6,this.close=new i.EventEmitter,this.closed=new i.EventEmitter,this.show=new i.EventEmitter,this.position="RELATIVE",this.keepOnTargetClick=!0,this._x=-1,this._y=-1,this._visible=!1,this._stillVisible=!1,this._animating=!1,this._overlay=null}var n;return n=t,t.prototype.getZ=function(){return this.zIndex},t.prototype.getNextElement=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=null),void 0===n&&(n=!1),null===t&&(n=!0),null===i&&(i=this.popup.nativeElement);for(var r=0;r<i.children.length;r++){var o=e?i.children[i.children.length-r-1]:i.children[r];if(!o.hidden&&!o.disabled)if(o!==t){if(null!==o.offsetParent){if(n&&-1!==o.tabIndex&&("INPUT"===o.nodeName||"BUTTON"===o.nodeName||"SELECT"===o.nodeName||"TEXTAREA"===o.nodeName||o.tabIndex>0))return{found:n,element:o};var s=this.getNextElement(t,e,o,n);if(n=s.found,s.element)return s}}else n=!0}return{found:n,element:null}},t.prototype.popupMouseDown=function(t){this.zIndex>=n.z&&t.stopPropagation()},t.prototype.popupTouchStart=function(t){t.stopPropagation()},t.prototype.popupKeyDown=function(t){if(t.keyCode===e.Keys.ESCAPE&&(this.closePopup(),t.preventDefault(),t.stopPropagation()),t.keyCode===e.Keys.TAB){var i=this.getNextElement(t.target,t.shiftKey);null===i.element&&(i=this.getNextElement(null,t.shiftKey)),i.element&&i.element.focus(),t.preventDefault(),t.stopPropagation()}},t.prototype.addDocumentListeners=function(){this.documentContextMenuBound||(this.documentContextMenuBound=this.documentContextMenu.bind(this)),this.documentMouseDownBound||(this.documentMouseDownBound=this.documentMouseDown.bind(this)),this.documentTouchStartBound||(this.documentTouchStartBound=this.documentTouchStart.bind(this)),this.documentScrollBound||(this.documentScrollBound=this.documentScroll.bind(this)),this.documentResizeBound||(this.documentResizeBound=this.documentResize.bind(this)),document.addEventListener("contextmenu",this.documentContextMenuBound,!1),document.addEventListener("mousedown",this.documentMouseDownBound,!1),document.addEventListener("touchstart",this.documentTouchStartBound,!1),window.addEventListener("scroll",this.documentScrollBound,!1),window.addEventListener("resize",this.documentResizeBound,!1)},t.prototype.removeDocumentListeners=function(){document.removeEventListener("contextmenu",this.documentContextMenuBound,!1),document.removeEventListener("mousedown",this.documentMouseDownBound,!1),document.removeEventListener("touchstart",this.documentTouchStartBound,!1),window.removeEventListener("scroll",this.documentScrollBound,!1),window.removeEventListener("resize",this.documentResizeBound,!1)},t.prototype.maxZIndex=function(t){for(var e=0,i=t.parentNode;i&&i.style;)!isNaN(i.style.zIndex)&&i.style.zIndex>e&&(e=i.style.zIndex),i=i.parentNode;return+e},t.prototype.documentScroll=function(t){this.updatePosition()},t.prototype.documentResize=function(t){this.updatePosition()},t.prototype.checkClose=function(t){var i=t;return(this._target!==i||!this.keepOnTargetClick)&&(!(this._target&&e.Utils.isAncestor(this._target,i)&&this.keepOnTargetClick)&&(!e.Utils.isAncestor(this.popup.nativeElement,i)&&(!(this.zIndex<this.maxZIndex(i))&&(n.freeze>0?(n.freeze--,!1):(this.closePopup(),!0)))))},t.prototype.documentTouchStart=function(t){this.checkClose(t.target)},t.prototype.documentMouseDown=function(t){this.checkClose(t.target)},t.prototype.documentContextMenu=function(t){this.checkClose(t.target)},Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},enumerable:!0,configurable:!0}),t.prototype.makeOverlay=function(){var t=this;n.z++;var e=n.z;return this._overlay=this._renderer.createElement("div"),this._renderer.setStyle(this._overlay,"z-index",e),this._renderer.addClass(this._overlay,"true-modal-overlay"),this._renderer.appendChild(document.body,this._overlay),this._renderer.listen(this._overlay,"touchstart",function(e){t.closePopup(),e.stopPropagation(),e.preventDefault()}),this._renderer.listen(this._overlay,"mousedown",function(e){t.closePopup(),e.stopPropagation(),e.preventDefault()}),setTimeout(function(){t._renderer.setStyle(t._overlay,"opacity","1.0")},50),this._overlay},t.prototype.removeOverlay=function(){this._overlay&&(document.body.removeChild(this._overlay),n.z--),this._overlay=null},t.prototype.resetPosition=function(){this.popup.nativeElement.style.transform="scale(1.0)",this.popup.nativeElement.style.top="0px",this.popup.nativeElement.style.left="0px"},t.prototype.updatePosition=function(){if(-1!==this._x||-1!==this._y)return n.renderToBody&&(this.popup.nativeElement.style.position="fixed"),this.popup.nativeElement.style.left=this._x+"px",void(this.popup.nativeElement.style.top=this._y+"px");if("ABSOLUTE"===this.position)return this.popup.nativeElement.style.position="absolute",this.popup.nativeElement.style.top="unset",void(this.popup.nativeElement.style.left="unset");var t=this.popup.nativeElement.getBoundingClientRect();if("MODAL"===this.position||"SNACK"===this.position){var e=document.body.clientWidth,i=t.width,r=(e-i)/2;return r<=10&&(r=10,i=e-20),this.popup.nativeElement.style.left=r+"px",void(this.popup.nativeElement.style.top="35px")}var o=this._target.getBoundingClientRect(),s=o.left,a=o.bottom;"left"===this._direction.toLowerCase()&&(s=o.right-t.width+this.shiftDx),"right"===this._direction.toLowerCase()&&(s=o.right,a=o.top-this.shiftDx),a+t.height>window.innerHeight&&"right"!==this._direction&&(a=o.top-t.height),a+t.height>window.innerHeight&&"right"===this._direction&&(a=o.bottom-t.height+4),"AboveLeft"===this._direction&&(s=o.right-t.width+6,a=o.top-t.height),"AboveRight"===this._direction&&(s=o.left-6,a=o.top-t.height),s=s+t.width>window.innerWidth?window.innerWidth-t.width-4:s<0?4:s,a=a<0?4:a,this.popup.nativeElement.style.position="fixed",this.popup.nativeElement.style.left=s+"px",this.popup.nativeElement.style.top=a+"px"},t.prototype.resetAnimation=function(){var t=this.transform0;"MODAL"===this.position&&(t=this.modalTransform0),"SNACK"===this.position&&(t=this.snackTransform0),this.popup.nativeElement.style.opacity="0",this.popup.nativeElement.style.transform=t},t.prototype.startAnimation=function(){var t=this.transform1;"MODAL"===this.position&&(t=this.modalTransform1),"SNACK"===this.position&&(t=this.snackTransform1),this.popup.nativeElement.style.opacity="1.0",this.popup.nativeElement.style.transform=t},t.prototype.display=function(){var t=this;this._visible||(this._visible=!0,this.popup.nativeElement.style.display="none",this.resetAnimation(),this.resetPosition(),setTimeout(function(){"MODAL"===t.position||"SNACK"===t.position?(t.popup.nativeElement.style.position="fixed",t.popup.nativeElement.style.display="block","MODAL"===t.position?(t.makeOverlay(),t._overlay.appendChild(t.popup.nativeElement),t.resetAnimation()):(t._renderer.removeChild(t.elementRef.nativeElement,t.popup.nativeElement),t.changeDetector.detectChanges(),document.body.appendChild(t.popup.nativeElement),t.resetAnimation()),t.updatePosition()):(t.popup.nativeElement.style.display="block",t.updatePosition(),"RELATIVE"===t.position&&n.renderToBody&&(t.popup.nativeElement.style.opacity="0",t._renderer.removeChild(t.elementRef.nativeElement,t.popup.nativeElement),t.changeDetector.detectChanges(),document.body.appendChild(t.popup.nativeElement))),n.z++,t.zIndex=n.z,t.popup.nativeElement.style.zIndex=t.zIndex,t.resetAnimation(),setTimeout(function(){t.startAnimation(),"SNACK"===t.position&&t.closeSnack()},50),t.addDocumentListeners(),t.show.emit()}))},t.prototype.closeSnack=function(){var t=this;this._stillVisible=!0,setTimeout(function(){t._stillVisible&&(t.popup.nativeElement.style.opacity="0",t.popup.nativeElement.style.transform=t.snackTransform2,setTimeout(function(){t.closePopup()},300))},1e3)},t.prototype.showByXY=function(t,e){this._x=t,this._y=e,this.display()},t.prototype.showByTarget=function(t,e){void 0===t&&(t=null),void 0===e&&(e=""),this._target=t,this._direction=e,this.display()},t.prototype.showPopup=function(){this._visible&&this.closePopup(),this.showByTarget()},t.prototype.closePopup=function(t,i){if(void 0===t&&(t=null),void 0===i&&(i=!1),this._visible){this._visible=!1,this._stillVisible=!1;var r=new e.CloseEvent(t);r.confirmed=i,this.close.emit(r),r.isCanceled||(n.z--,n.z<=9&&(n.z=9),"MODAL"===this.position&&(this._overlay.removeChild(this.popup.nativeElement),this.removeOverlay(),this.elementRef.nativeElement.appendChild(this.popup.nativeElement)),"SNACK"===this.position&&(document.body.removeChild(this.popup.nativeElement),this.elementRef.nativeElement.appendChild(this.popup.nativeElement)),this._target=null,this._x=-1,this._y=-1,this.popup.nativeElement.style.display="none",this.resetAnimation(),"RELATIVE"===this.position&&n.renderToBody?(this._renderer.removeChild(document.body,this.popup.nativeElement),this.changeDetector.detectChanges(),this.elementRef.nativeElement.appendChild(this.popup.nativeElement)):this.changeDetector.detectChanges(),this.removeDocumentListeners(),this.closed.emit(t))}},t.prototype.toggle=function(t,e){this._visible?this.closePopup():this.showByTarget(t,e)},t.freeze=0,t.z=19,t.renderToBody=!0,u([i.ViewChild("popup",{"static":!0}),p("design:type",Object)],t.prototype,"popup",void 0),u([i.Output("close"),p("design:type",i.EventEmitter)],t.prototype,"close",void 0),u([i.Output("closed"),p("design:type",i.EventEmitter)],t.prototype,"closed",void 0),u([i.Output("show"),p("design:type",i.EventEmitter)],t.prototype,"show",void 0),u([i.Input("position"),p("design:type",String)],t.prototype,"position",void 0),u([i.Input("keepOnTargetClick"),p("design:type",Object)],t.prototype,"keepOnTargetClick",void 0),t=n=u([i.Component({selector:"true-popup",template:'\n    <div [style.zIndex]="getZ()" class="true-popup"\n      [class.true-snack]="position===\'SNACK\'"\n      (mousedown)="popupMouseDown($event)"\n      (touchstart)="popupTouchStart($event)"\n      (keydown)="popupKeyDown($event)" #popup>\n      <ng-content #content></ng-content>\n    </div>',host:{"(touchend)":"$event.stopPropagation()"},styles:["\n    :host > div {\n      position: fixed;\n      display: none;\n      opacity: 0.0;\n    }\n\n    .true-modal-overlay {\n      position: fixed;\n      left: 0;\n      right: 0;\n      top: 0;\n      bottom: 0;\n      opacity: 0.0;\n      overflow-y: auto;\n    }\n    "]}),p("design:paramtypes",[i.ElementRef,i.ChangeDetectorRef,i.Renderer2])],t)}(),_=function(){function t(t,e,n){this.intl=t,this.cd=e,this.el=n,this.onChange=function(t){},this.onTouched=function(){},this._value=null,this.mode="days",this.dateClick=new i.EventEmitter,this.escape=new i.EventEmitter,this.dayNames=[],this.weeks=[],this.monthRows=[],this.yearRows=[],this._minYear=0,this._maxYear=0}var n;return n=t,Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){t!==this._value&&(this._value=t,this.createWeeks(this._value),this.onChange(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueTime",{get:function(){var t=0;return null===this.value||isNaN(this.value.getTime())||(t=this.value.getTime()),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"monthYear",{get:function(){var t=this.calendarDateStart.getMonth(),e=this.calendarDateStart.getFullYear();return"days"===this.mode?this.intl.locale.longMonthNames[t]+" "+e:"months"===this.mode?e:"years"===this.mode?this._minYear+" - "+this._maxYear:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"today",{get:function(){return e.Dates.today()},enumerable:!0,configurable:!0}),t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.blur=function(){this.onTouched()},t.prototype.writeValue=function(t){this.value!==t&&(this.value=t)},t.prototype.setFocus=function(){this.days.nativeElement.focus()},t.prototype.isCurrentMonth=function(t){return e.Dates.dateBetween(t,this.calendarDateStart,this.calendarDateEnd)},t.prototype.go=function(t){if("days"===this.mode){var i=void 0;i=t>0?e.Dates.firstDateOfNextMonth(this.calendarDateStart):e.Dates.firstDateOfPrevMonth(this.calendarDateStart),this.createWeeks(i)}"months"===this.mode&&(this.calendarDateStart=new Date(this.calendarDateStart.getFullYear()+t,0,1),this.createMonths()),"years"===this.mode&&(this.calendarDateStart=new Date(this.calendarDateStart.getFullYear()+24*t,0,1),this.createYears())},t.prototype.toggleMode=function(){"years"===this.mode?(this.mode="days",this.createWeeks(this.calendarDateStart)):"months"===this.mode?(this.mode="years",this.createYears()):"days"===this.mode&&(this.mode="months",this.createMonths()),this.setMode()},t.prototype.setMode=function(){this.el.nativeElement.classList.remove("true-mode-days"),this.el.nativeElement.classList.remove("true-mode-months"),this.el.nativeElement.classList.remove("true-mode-years"),this.el.nativeElement.classList.add("true-mode-"+this.mode)},t.prototype.mousedown=function(t){t.stopPropagation()},t.prototype.calendarDateClick=function(t,e){"days"===this.mode&&(this.value=new Date(e),this.dateClick.emit(e)),"months"===this.mode&&(this.mode="days",this.createWeeks(new Date(e))),"years"===this.mode&&(this.calendarDateStart=new Date(e),this.mode="months",this.createMonths()),this.setMode(),t.preventDefault(),t.stopPropagation()},t.prototype.createDayNames=function(){this.dayNames=[];for(var t=e.Dates.firstDateOfWeek(e.Dates.today(),this.intl.locale.firstDayOfWeek),i=e.Dates.lastDateOfWeek(t,this.intl.locale.firstDayOfWeek),n=new Date(t);n.getTime()<=i.getTime();n=e.Dates.nextDate(n)){var r=n.getDay(),o=this.intl.locale.shortDayNames[r];this.dayNames.push(o)}},t.prototype.createMonths=function(){var t=this.calendarDateStart.getFullYear(),i=e.Dates.firstDateOfMonth(e.Dates.today()),n=-3;this.monthRows=[];for(var r=0;r<6;r++){for(var o=[],s=0;s<3;s++){var a=new Date(t,n,1);o.push({name:this.intl.locale.shortMonthNames[a.getMonth()]+" "+e.Dates.yearTwoDigits(a),date:a,selected:e.Dates.isSameMonth(a,this.value),today:a.getTime()===i.getTime(),current:e.Dates.isSameYear(a,this.calendarDateStart)}),n++}this.monthRows.push(o)}},t.prototype.createYears=function(){var t=this.calendarDateStart.getFullYear(),i=new Date(e.Dates.today().getFullYear(),0,1);new Date(this.calendarDateStart.getFullYear(),0,1);this._minYear=t-11;var n=this._minYear;this.yearRows=[];for(var r=0;r<6;r++){for(var o=[],s=0;s<4;s++){var a=new Date(n,0,1);o.push({name:n+"",date:a,selected:e.Dates.isSameYear(a,this.value),today:a.getTime()===i.getTime(),current:!0}),n++}this.yearRows.push(o)}this._maxYear=n-1},t.prototype.createWeeks=function(t){(null===t||isNaN(t.getTime()))&&(t=e.Dates.today());var i=this.intl.locale.firstDayOfWeek,n=e.Dates.firstDateOfMonth(t),r=e.Dates.lastDateOfMonth(t);if(!(this.weeks.length>0&&this.calendarDateStart!==undefined&&this.calendarDateStart.getTime()===n.getTime()&&this.calendarDateEnd!==undefined&&this.calendarDateEnd.getTime()===r.getTime())){this.weeks=[],this.calendarDateStart=n,this.calendarDateEnd=r;for(var o=e.Dates.firstDateOfWeek(n,i),s=new Date(o),a=0;a<6;){for(var l=[],u=e.Dates.lastDateOfWeek(s,i),c=new Date(s);c.getTime()<=u.getTime();c=e.Dates.nextDate(c))l.push(c);this.weeks.push(l),s=e.Dates.nextDate(u),a++}}},t.prototype.daysKeyDown=function(t){var i=0;t.keyCode===e.Keys.LEFT&&(i=-1),t.keyCode===e.Keys.UP&&(i=-7),t.keyCode===e.Keys.RIGHT&&(i=1),t.keyCode===e.Keys.DOWN&&(i=7),t.keyCode===e.Keys.ENTER&&(this.dateClick.emit(this.value),t.stopPropagation()),t.keyCode===e.Keys.ESCAPE&&(this.escape.emit(this.value),t.stopPropagation()),0!==i&&(this.value=e.Dates.addDays(null===this.value?e.Dates.today():this.value,i),t.stopPropagation())},t.prototype.ngOnInit=function(){this.createDayNames(),this.createWeeks(e.Dates.today())},u([i.ViewChild("days",{"static":!0}),p("design:type",Object)],t.prototype,"days",void 0),u([i.Output("dateClick"),p("design:type",i.EventEmitter)],t.prototype,"dateClick",void 0),u([i.Output("escape"),p("design:type",i.EventEmitter)],t.prototype,"escape",void 0),t=n=u([i.Component({selector:"true-calendar",template:'\x3c!-- Buttons --\x3e\r\n<div class="true-calendar__controls">\r\n  <div>\r\n    <button class="true-button" (click)="toggleMode()" ><b>{{monthYear}}</b></button>\r\n  </div>\r\n  <div>\r\n    <button class="true-button prev" (click)="go(-1)"><span class="true-icon-left-open"></span></button>\r\n    <button class="true-button next" (click)="go(1)"><span class="true-icon-right-open"></span></button>\r\n  </div>\r\n</div>\r\n\r\n\x3c!-- Day names in header --\x3e\r\n<table class="true-day-names">\r\n  <colGroup>\r\n    <col *ngFor="let d of dayNames" />\r\n  </colGroup>\r\n  <thead>\r\n    <tr>\r\n      <td *ngFor="let d of dayNames" [class.true-transparent]="mode!=\'days\'">{{d}}</td>\r\n    </tr>\r\n  </thead>\r\n  <tbody>\r\n    <tr><td colspan="7"></td></tr>\r\n  </tbody>\r\n</table>\r\n\r\n\x3c!-- Month days --\x3e\r\n<table #days class="true-days" tabindex="1" (keydown)="daysKeyDown($event)">\r\n  <colGroup>\r\n    <col *ngFor="let d of dayNames" />\r\n  </colGroup>\r\n  <tbody>\r\n    <tr *ngFor="let w of weeks">\r\n      <td *ngFor="let d of w"\r\n        (click)="calendarDateClick($event, d)"\r\n        [class.true-selected]="d.getTime() === valueTime"\r\n        [class.true-today]="d.getTime() === today.getTime()"\r\n        [class.true-current]="isCurrentMonth(d)">{{d.getDate()}}</td>\r\n    </tr>\r\n  </tbody>\r\n</table>\r\n\x3c!-- Months --\x3e\r\n<table class="true-months">\r\n  <colGroup>\r\n    <col *ngFor="let r of monthRows[0]" />\r\n  </colGroup>\r\n  <tbody>\r\n    <tr *ngFor="let r of monthRows">\r\n      <td *ngFor="let m of r"\r\n        (click)="calendarDateClick($event, m.date)"\r\n        [class.true-transparent]="m.hide"\r\n        [class.true-selected]="m.selected"\r\n        [class.true-today]="m.today"\r\n        [class.true-current]="m.current">{{m.name}}</td>\r\n    </tr>\r\n  </tbody>\r\n</table>\r\n\x3c!-- Years --\x3e\r\n<table class="true-years">\r\n  <colGroup>\r\n    <col *ngFor="let r of yearRows[0]" />\r\n  </colGroup>\r\n  <tbody>\r\n    <tr *ngFor="let r of yearRows">\r\n      <td *ngFor="let y of r"\r\n        (click)="calendarDateClick($event, y.date)"\r\n        [class.true-selected]="y.selected"\r\n        [class.true-today]="y.today"\r\n        [class.true-current]="1==1">{{y.name}}</td>\r\n    </tr>\r\n  </tbody>\r\n</table>\r\n',host:{"class":"true-calendar true-mode-days","(mousedown)":"mousedown($event)","(touchend)":"$event.stopPropagation()"},providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return n}),multi:!0}],styles:[":host>table{table-layout:fixed;border-collapse:separate}:host>table:focus{outline:0}:host table.true-days,:host table.true-months,:host table.true-years{display:none}:host.true-mode-days table.true-days,:host.true-mode-months table.true-months,:host.true-mode-years table.true-years{display:table}.true-calendar__controls{display:-webkit-box;display:flex;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between}.true-calendar__controls div:last-child{display:-webkit-box;display:flex;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}"]}),p("design:paramtypes",[h,i.ChangeDetectorRef,i.ElementRef])],t)}(),E=function(){function t(t,e){this._elementRef=t,this._renderer=e,this.usePopup=!0,this.currentPopupVisible=!1,this.disableTextEditor=!1,this.disabled=null,this.maxDropDownHeight="300px",this.blur=new i.EventEmitter,this.keydown=new i.EventEmitter,this.onChange=function(t){},this.onTouched=function(){},this._validBlur=!1,this._useAltDown=!0,this.shownByKey=!1,this._touched=!1,this._skipFocusOnPopupClose=!1}return Object.defineProperty(t.prototype,"popupPosition",{get:function(){return this.popup.position},set:function(t){this.currentPopupPosition=t,this.popup&&(this.popup.position=t)},enumerable:!0,configurable:!0}),t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},Object.defineProperty(t.prototype,"useAltDown",{get:function(){return this._useAltDown},set:function(t){this._useAltDown=t},enumerable:!0,configurable:!0}),t.prototype.fetchData=function(t,e){},t.prototype.inputBlur=function(t){this.onTouched();var i=t.relatedTarget;null===i||e.Utils.isAncestor(this.popup.popup.nativeElement,i)||null===i||e.Utils.isAncestor(this._elementRef.nativeElement,i)||(this.popup.visible&&!this._validBlur&&(this._skipFocusOnPopupClose=!0,this.popup.closePopup()),this._validBlur=!1,this.blur.emit(t))},t.prototype.inputClick=function(t){this.disabled||this.disableTextEditor&&(this.popupVisible?this.closePopup():this.showByTarget(),t.stopPropagation(),t.preventDefault())},t.prototype.inputTouchStart=function(t){this._touched=!0,this.disableTextEditor&&(t.stopPropagation(),t.preventDefault())},t.prototype.inputTouchMove=function(t){this._touched=!1},t.prototype.inputTouchEnd=function(t){!this.disabled&&this.disableTextEditor&&(!this.popupVisible&&this._touched&&(this.showByTarget(),t.cancelable&&t.preventDefault()),t.stopPropagation())},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){t!==this._value&&(this._value=t,this.onChange(t))},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.value!==t&&(this.value=t)},Object.defineProperty(t.prototype,"popupVisible",{get:function(){return!!this.popup&&this.popup.visible},enumerable:!0,configurable:!0}),t.prototype.focusPopup=function(){},t.prototype.processKey=function(t){return!1},t.prototype.showByTarget=function(){this.usePopup&&this.popup.showByTarget(this.input.nativeElement)},t.prototype.closePopup=function(){this.popup.closePopup()},t.prototype.inputInput=function(t){},t.prototype.inputKeyDown=function(t){var i=this;return t.keyCode===e.Keys.ESCAPE&&this.popup.visible?(this.closePopup(),t.stopPropagation(),void t.preventDefault()):t.keyCode!==e.Keys.DOWN||!t.altKey&&this.useAltDown||this.popup.visible?void(this.processKey(t)||this.keydown.emit(t)):(this.shownByKey=!0,this.showByTarget(),setTimeout(function(){return i.focusPopup()}),t.preventDefault(),void t.stopPropagation())},t.prototype.focus=function(){this.input.nativeElement.focus()},t.prototype.popupClose=function(t){var i=this;this._skipFocusOnPopupClose?this._skipFocusOnPopupClose=!1:e.Utils.detectMobile()||(this.input.nativeElement.focus(),setTimeout(function(){var t=i.input.nativeElement.value;t!==undefined&&!i.disableTextEditor&&i._renderer&&(i._renderer.setProperty(i.input.nativeElement,"selectionStart",0),i._renderer.setProperty(i.input.nativeElement,"selectionEnd",t.length))}))},t.prototype.inputFocus=function(t){if(this.disableTextEditor)this._renderer.setProperty(this.input.nativeElement,"selectionStart",0),this._renderer.setProperty(this.input.nativeElement,"selectionEnd",0);else{var e=this.input.nativeElement.value;this._renderer.setProperty(this.input.nativeElement,"selectionStart",0),this._renderer.setProperty(this.input.nativeElement,"selectionEnd",e.length)}},t.prototype.togglePopup=function(){var t=this;this.disabled||(this.popup.toggle(this.input.nativeElement,""),setTimeout(function(){t.popupVisible&&t.focusPopup()}))},t.prototype.btnClick=function(t){this.togglePopup()},t.prototype.setValueFromDisplayed=function(){},t.prototype.ngAfterViewInit=function(){this.popup.position=this.currentPopupPosition},t.prototype.ngOnDestroy=function(){this.popupVisible&&this.popup.closePopup()},u([i.ViewChild("popup",{"static":!1}),p("design:type",C)],t.prototype,"popup",void 0),u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],t.prototype,"input",void 0),u([i.Input("disableTextEditor"),p("design:type",Object)],t.prototype,"disableTextEditor",void 0),u([i.Input("disabled"),p("design:type",Boolean)],t.prototype,"disabled",void 0),u([i.Input("maxDropDownHeight"),p("design:type",Object)],t.prototype,"maxDropDownHeight",void 0),u([i.Input("popupPosition"),p("design:type",String),p("design:paramtypes",[String])],t.prototype,"popupPosition",null),u([i.Output("blur"),p("design:type",i.EventEmitter)],t.prototype,"blur",void 0),u([i.Output("keydown"),p("design:type",i.EventEmitter)],t.prototype,"keydown",void 0),u([i.Input("useAltDown"),p("design:type",Boolean),p("design:paramtypes",[Boolean])],t.prototype,"useAltDown",null),t=u([i.Component({selector:"true-drop-down-base",template:"",styles:[""]}),p("design:paramtypes",[i.ElementRef,i.Renderer2])],t)}(),k=function(){function t(t,n,r){var o=this;this._renderer=t,this._elementRef=n,this.intl=r,this._undo=[],this._redo=[],this._txtValue="",this._mask=new e.Mask,this.android_behavior=!1,this.stateChange=new i.EventEmitter,this.maskValueChanged=new i.EventEmitter,this._state=null,this._localeSubscription=this.intl.onLocaleChanged.subscribe(function(t){return o.setLocale(t)})}return Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(t){this._state!==t&&(this._state=t,this.stateChange.emit(this._state))},enumerable:!0,configurable:!0}),t.prototype.updateState=function(){},t.prototype.processAndroid=function(t){var i=this.currentRes(),n=e.Keys.whichKeyHasBeenPressed(this.last_res.newValue,t,this.last_res.selStart,i.selStart,this.last_res.selLength);this.processKey({keyCode:-1,key:n.code,char:n.char,shiftKey:!1,ctrlKey:!1,target:{selectionStart:this.last_res.selStart,selectionEnd:0},preventDefault:function(t){}})||this.setRes(this.last_res),this.android_behavior=!1},t.prototype.doInput=function(t){if(this.android_behavior)this.processAndroid(t);else{var e=this._mask.applyMask(t);e!==this._txtValue&&this.setText(e,!0)}},t.prototype.processKey=function(t){if(229===t.keyCode||0===t.keyCode||t.keyCode===undefined)return this.android_behavior=!0,void(this.last_res=this.currentRes());var i=t.char;i===undefined&&(i=t.key);var n=t.target.selectionStart,r=t.target.selectionEnd,o=this._txtValue;if(e.Keys.isFunctional(t.keyCode))return!0;if(t.keyCode===e.Keys.TAB||t.keyCode===e.Keys.ESCAPE)return!0;if(t.keyCode===e.Keys.HOME||t.keyCode===e.Keys.END)return!0;if(t.shiftKey&&(t.keyCode===e.Keys.DELETE||t.keyCode===e.Keys.INSERT))return!0;if(t.altKey&&(t.keyCode===e.Keys.DOWN||t.keyCode===e.Keys.UP))return!0;if(t.ctrlKey&&t.keyCode===e.Keys.Z){var s=this._undo.pop();return s&&(this._redo.push(this.getRes(o,n,r)),this.setRes(s)),t.preventDefault(),!1}if(t.ctrlKey&&t.keyCode===e.Keys.Y){var a=this._redo.pop();return a&&(this._undo.push(this.getRes(o,n,r)),this.setRes(a)),t.preventDefault(),!1}if(t.ctrlKey)return!0;if(0===n&&r===this._txtValue.length){if(t.keyCode===e.Keys.DELETE||t.keyCode===e.Keys.BACKSPACE)return!0;if(t.keyCode===e.Keys.LEFT)return!0;if(t.keyCode===e.Keys.RIGHT)return!0}0===n&&r===this._txtValue.length&&(o="",n=0,r=0);var l=this._mask.applyKeyAtPos(o,t.keyCode,i,n,r);if(null!==l&&l.action===e.MaskSectionAction.APPLY){if(l.newValue!==o&&(this._undo.push(this.getRes(o,n,r)),this._redo=[]),this.setRes(l),this.android_behavior)return!0;t.preventDefault()}return!1},t.prototype.setRes=function(t){this.android_behavior&&(t.selLength=0),this.setText(t.newValue),this._renderer.setProperty(this._elementRef.nativeElement,"selectionStart",t.selStart),this._renderer.setProperty(this._elementRef.nativeElement,"selectionEnd",t.selStart+t.selLength)},t.prototype.currentRes=function(){var t=new e.MaskResult(this._txtValue,e.MaskSectionAction.APPLY,0);return t.selStart=this._elementRef.nativeElement.selectionStart,t.selLength=this._elementRef.nativeElement.selectionEnd-t.selStart,t},t.prototype.getRes=function(t,i,n){var r=new e.MaskResult(t,e.MaskSectionAction.APPLY,0);return r.selStart=i,r.selLength=n-i,r},t.prototype.toModel=function(){},t.prototype.setText=function(t,e){void 0===e&&(e=!0),this._txtValue=t,this._renderer.setProperty(this._elementRef.nativeElement,"value",this._txtValue),e&&this.toModel()},t.prototype.setLocale=function(t){this._mask.setLocale(t)},t.prototype.ngOnDestroy=function(){this._localeSubscription.unsubscribe()},u([i.Output("stateChange"),p("design:type",Object)],t.prototype,"stateChange",void 0),u([i.Output("maskValueChanged"),p("design:type",Object)],t.prototype,"maskValueChanged",void 0),t=u([i.Directive({selector:"true-mask-base"}),p("design:paramtypes",[i.Renderer2,i.ElementRef,h])],t)}(),x=function(t){function n(e,i,n){var r=t.call(this,e,i,n)||this;return r._renderer=e,r._elementRef=i,r.intl=n,r.onChange=function(t){},r.onTouched=function(){},r}var o;return l(n,t),o=n,n.prototype.registerOnChange=function(t){this.onChange=t},n.prototype.registerOnTouched=function(t){this.onTouched=t},n.prototype.onInput=function(t){this.input(t.target.value)},n.prototype.blur=function(t){var e=this._mask.applyMask(this._txtValue);e!==this._txtValue&&this.setText(e),(null===this._dateValue||isNaN(this._dateValue.getTime()))&&(this._mask.settings.allowIncomplete||this.setText("")),this.onTouched()},n.prototype.updateState=function(){this._dateValue?isNaN(this._dateValue.getTime())?this.state=e.MaskState.TYPING:this.state=e.MaskState.OK:this.state=e.MaskState.EMPTY},n.prototype.toModel=function(){this._dateValue=e.DateParserFormatter.parse(this._txtValue,this._mask),this.maskValueChanged.emit(this._dateValue),this.onChange(this._dateValue),this.updateState()},n.prototype.processKey=function(e){return t.prototype.processKey.call(this,e)},n.prototype.input=function(t){this.doInput(t.target.value)},n.prototype.writeValue=function(t){this._dateValue=t;var i=e.DateParserFormatter.format(t,this._mask);i!==this._txtValue&&this.setText(i,!1),this.updateState()},Object.defineProperty(n.prototype,"pattern",{get:function(){return this._mask.pattern},set:function(t){this._mask.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"settings",{set:function(t){this._mask.settings=t},enumerable:!0,configurable:!0}),n.prototype.keyDown=function(t){return this.processKey(t)},n.prototype.setLocale=function(e){t.prototype.setLocale.call(this,e),this._mask.updateMask(),this.writeValue(this._dateValue)},u([i.HostListener("input",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],n.prototype,"onInput",null),u([i.HostListener("blur",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],n.prototype,"blur",null),u([i.HostListener("input",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],n.prototype,"input",null),u([i.Input("true-mask-date"),p("design:type",String),p("design:paramtypes",[String])],n.prototype,"pattern",null),u([i.Input("true-mask-settings"),p("design:type",e.MaskSettings),p("design:paramtypes",[e.MaskSettings])],n.prototype,"settings",null),u([i.HostListener("keydown",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],n.prototype,"keyDown",null),n=o=u([i.Directive({selector:"[true-mask-date]",providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return o}),multi:!0}]}),p("design:paramtypes",[i.Renderer2,i.ElementRef,h])],n)}(k),S=function(t){function n(e,i,n){var r=t.call(this,i,n)||this;return r.intl=e,r._elementRef=i,r._renderer=n,r._pattern="",r.showError=!0,r.inputClass="",r}var o;return l(n,t),o=n,Object.defineProperty(n.prototype,"pattern",{get:function(){return this._pattern},set:function(t){this._pattern=t,this.checkPattern()},enumerable:!0,configurable:!0}),n.prototype.checkPattern=function(){var t=!1;e.Mask.maskWithPattern(this.intl,this._pattern).sections.forEach(function(e){"d"!==e.sectionType.datePart&&"m"!==e.sectionType.datePart&&"y"!==e.sectionType.datePart&&"yy"!==e.sectionType.datePart&&"yyyy"!==e.sectionType.datePart||(t=!0)}),this.usePopup=t},n.prototype.getIcon=function(){return this.usePopup?"true-icon-calendar-empty":""},n.prototype.dateClick=function(t){this.popup.closePopup()},n.prototype.escape=function(t){this.popup.closePopup()},n.prototype.focusPopup=function(){this.calendar.setFocus()},n.prototype.acceptKey=function(t){this.maskDateDirective.keyDown(e.Keys.generateEvent(this.input.nativeElement,-1,e.Keys.keyChar(t),t.shiftKey,t.ctrlKey))},u([i.Input("pattern"),p("design:type",String),p("design:paramtypes",[String])],n.prototype,"pattern",null),u([i.Input("error"),p("design:type",String)],n.prototype,"error",void 0),u([i.Input("showError"),p("design:type",Boolean)],n.prototype,"showError",void 0),u([i.Input("inputClass"),p("design:type",String)],n.prototype,"inputClass",void 0),u([i.ViewChild("calendar",{"static":!1}),p("design:type",_)],n.prototype,"calendar",void 0),u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],n.prototype,"input",void 0),u([i.ViewChild("input",{"static":!0,read:x}),p("design:type",x)],n.prototype,"maskDateDirective",void 0),n=o=u([i.Component({selector:"true-datepicker",template:'<true-input-wrapper\r\n  (btnClick)="btnClick($event)"\r\n  class="true-datepicker__input"\r\n  [class.true-input_popup-visible]="popupVisible"\r\n  [disabled]="disabled"\r\n  [error]="error"\r\n  [showError]="showError"\r\n  [icon]="getIcon()"><input #input\r\n     [ngClass]="inputClass"\r\n     [true-mask-date]="pattern"\r\n     [readonly]="disableTextEditor"\r\n     [attr.disabled]="disabled"\r\n     [(ngModel)]="value"\r\n     (blur)="inputBlur($event)"\r\n     (focus)="inputFocus($event)"\r\n     (mousedown)="$event.stopPropagation()"\r\n     (keydown)="inputKeyDown($event)" />\r\n</true-input-wrapper><true-popup #popup (close)="popupClose($event)">\r\n  <true-calendar #calendar\r\n      *ngIf="popupVisible"\r\n      [(ngModel)]="value"\r\n      (escape)="escape($event)"\r\n      (dateClick)="dateClick($event)">\r\n  </true-calendar>\r\n</true-popup>\r\n',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return o}),multi:!0}],styles:["\n    :host {\n      padding: 0;\n    }\n    .true-datepicker__input {\n      width: 100%;\n      height: 100%;\n      padding: 0;\n      margin: 0;\n    }\n\n    input {\n      box-sizing: border-box;\n      width: 100%;\n      margin: 0;\n    }\n  "]}),p("design:paramtypes",[h,i.ElementRef,i.Renderer2])],n)}(E),D=function(){function t(t,e,n,r){this.state=t,this.elementRef=e,this.changeDetector=n,this.renderer=r,this.maxHeight=null,this.autoscrollx=new i.EventEmitter,this.scroll=new i.EventEmitter,this.scrollX=0,this.scrollY=0,this.scrollTimer=null,this.scrollSubscription=null,this.autoScrollInProgress=!1,this.scrollSpeedX=0,this.scrollSpeedY=0,this._scrollRect=null}return Object.defineProperty(t.prototype,"maxHeightU",{get:function(){return null===this.maxHeight?"unset":this.maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoWidth",{get:function(){return this.state.settings.columnAutoWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchFix",{get:function(){return(this.state.iOS||this.state.android)&&this.state.settings.enableTouchScroll},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollerH",{get:function(){return this.touchFix?this.datah:this.data},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollerV",{get:function(){return this.touchFix?this.dataArea:this.data},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientRect",{get:function(){return this.elementRef.nativeElement.getBoundingClientRect()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"centerRect",{get:function(){return this.touchFix?this.datah.nativeElement.getBoundingClientRect():this.data.nativeElement.getBoundingClientRect()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRect",{get:function(){return this.header.nativeElement.getBoundingClientRect()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRectLeft",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRectRight",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.dataScroll=function(t){this.doScroll(t),this.scroll.emit(t)},t.prototype.dataScrollH=function(t){this.doScroll(t,!0),this.scroll.emit(t)},Object.defineProperty(t.prototype,"isAutoScroll",{get:function(){return this.autoScrollInProgress},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollTop",{get:function(){return this.touchFix?this.dataArea.nativeElement.scrollTop:this.data.nativeElement.scrollTop},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollLeft",{get:function(){return this.touchFix?this.datah.nativeElement.scrollLeft:this.data.nativeElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollWidth",{get:function(){return this.touchFix?this.datah.nativeElement.scrollWidth:this.data.nativeElement.scrollWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollHeight",{get:function(){return this.data.nativeElement.scrollHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewPortHeight",{get:function(){return this.touchFix?this.dataArea.nativeElement.clientHeight:this.data.nativeElement.clientHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewPortWidth",{get:function(){return this.touchFix?this.dataArea.nativeElement.clientWidth:this.data.nativeElement.clientWidth},enumerable:!0,configurable:!0}),t.prototype.prepareAutoScroll=function(){this._scrollRect=this.centerRect},t.prototype.startAutoScroll=function(){var t=this;this.autoScrollInProgress||(this.scrollTimer||(this.scrollTimer=n.timer(this.state.st.autoScrollInterval,this.state.st.autoScrollInterval),this.scrollSubscription=this.scrollTimer.subscribe(function(e){return t.scrollIfNeeded()})),this.autoScrollInProgress=!0)},t.prototype.stopAutoScroll=function(){this._scrollRect=null,this.scrollSpeedY=0,this.scrollSpeedX=0,this.scrollSubscription&&(this.scrollSubscription.unsubscribe(),this.scrollTimer=null),this.autoScrollInProgress=!1},t.prototype.scrollIfNeeded=function(){var t=this.scrollLeft,e=this.scrollTop,i=this.scrollWidth,n=this.scrollHeight,r=t,o=e;this.elementRef.nativeElement.getBoundingClientRect();if(this.scrollSpeedY<0&&(o=e>=-this.scrollSpeedY?e+this.scrollSpeedY:0),this.scrollSpeedY>0){var s=n-this.scrollerV.nativeElement.clientHeight;o=t<=s-this.scrollSpeedY?e+this.scrollSpeedY:s}if(e===o){if(this.scrollSpeedX<0&&(r=t>=-this.scrollSpeedX?t+this.scrollSpeedX:0),this.scrollSpeedX>0){var a=i-this.scrollerH.nativeElement.clientWidth;r=t<=a-this.scrollSpeedX?t+this.scrollSpeedX:a}t!==r&&(this.scrollerH.nativeElement.scrollLeft=r,this.autoscrollx.emit(r-t))}else this.scrollerV.nativeElement.scrollTop=o},t.prototype.scrollTo=function(t,e){void 0===e&&(e=-1),e>=0&&(this.scrollerV.nativeElement.scrollTop=e),t>=0&&(this.scrollerH.nativeElement.scrollLeft=t)},t.prototype.fixScroll=function(){this.scrollerH.nativeElement.scrollLeft<0&&(this.scrollerH.nativeElement.scrollLeft=0)},t.prototype.checkAutoScrollX=function(t,e){var i=this._scrollRect;return i?(t<=i.left?this.scrollSpeedX=-this.state.st.autoScrollStep:t>=i.right?this.scrollSpeedX=this.state.st.autoScrollStep:this.scrollSpeedX=0,0!==this.scrollSpeedX&&this.startAutoScroll(),i):null},t.prototype.checkAutoScrollY=function(t){var e=this._scrollRect;if(!e)return null;t<e.top?this.scrollSpeedY=-this.state.st.autoScrollStep:t>e.bottom?this.scrollSpeedY=this.state.st.autoScrollStep:this.scrollSpeedY=0,0!==this.scrollSpeedY&&this.startAutoScroll()},t.prototype.scrollParts=function(){},t.prototype.doScroll=function(t,e){void 0===e&&(e=!1);var i=t.target;this.touchFix&&!e||this.scrollX===i.scrollLeft||(this.scrollX=i.scrollLeft,this.state.settings.showHeader&&(this.header.nativeElement.scrollLeft=this.scrollX),this.state.settings.showFooter&&(this.footer.nativeElement.scrollLeft=this.scrollX)),this.scrollY!==i.scrollTop&&this.scrollParts()},t.prototype.focus=function(){this.elementRef.nativeElement.focus()},u([i.ViewChild("header",{"static":!1}),p("design:type",Object)],t.prototype,"header",void 0),u([i.ViewChild("dataArea",{"static":!0}),p("design:type",Object)],t.prototype,"dataArea",void 0),u([i.ViewChild("data",{"static":!0}),p("design:type",Object)],t.prototype,"data",void 0),u([i.ViewChild("datah",{"static":!0}),p("design:type",Object)],t.prototype,"datah",void 0),u([i.ViewChild("footer",{"static":!1}),p("design:type",Object)],t.prototype,"footer",void 0),u([i.Input("maxHeight"),p("design:type",String)],t.prototype,"maxHeight",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"autoscrollx",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"scroll",void 0),u([i.HostBinding("class.true-v-scroll"),p("design:type",Object),p("design:paramtypes",[])],t.prototype,"autoWidth",null),u([i.HostBinding("class.true-fix-touch"),p("design:type",Object),p("design:paramtypes",[])],t.prototype,"touchFix",null),t=u([i.Component({selector:"true-scroller",template:'<div class="true-scroller-header-area" *ngIf="state.settings.showHeader">\r\n  <div #header class="true-scroller-header" [ngClass]="state.settings.appearance.headerAreaClass">\r\n    <ng-content select="[true-header]"></ng-content>\r\n  </div>\r\n</div>\r\n\r\n<div #dataArea class="true-scroller-data-area-scroller" (scroll)="dataScroll($event)">\r\n  <div class="true-scroller-data-area" [style.max-height]="maxHeightU">\r\n    <div #data class="true-scroller-data" [ngClass]="state.sta.scrollboxClass" (scroll)="dataScroll($event)">\r\n      <div #datah class="true-scroller-data-h" (scroll)="dataScrollH($event)">\r\n        <ng-content select="[true-data]"></ng-content>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n<div class="true-scroller-footer-area" *ngIf="state.settings.showFooter">\r\n  <div #footer class="true-scroller-footer"\r\n       [ngClass]="state.settings.appearance.footerAreaClass" >\r\n    <ng-content select="[true-footer]"></ng-content>\r\n  </div>\r\n</div>\r\n',styles:[":host{overflow-y:hidden;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:justify;justify-content:space-between;height:100%}:host:focus{outline:0}.true-scroller-footer-area,.true-scroller-header-area{overflow-x:hidden;flex-shrink:0;-webkit-box-flex:0;flex-grow:0;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;height:auto}.true-scroller-hidden{height:0!important}.true-scroller-header{overflow-x:hidden;-webkit-box-flex:1;flex-grow:1;box-sizing:border-box}.true-scroller-data-area-scroller{-webkit-box-flex:1;flex:1 1 auto;overflow-y:hidden;-ms-grid-row-align:stretch;align-self:stretch;height:100%}.true-scroller-data-area{height:100%;overflow-x:hidden;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:stretch;align-items:stretch}.true-scroller-data{-webkit-box-flex:1;flex:1 1 auto;overflow-y:auto;overflow-x:auto;box-sizing:border-box;max-width:100%}.true-scroller-data-h{overflow-x:visible;-webkit-overflow-scrolling:touch}:host.true-v-scroll .true-scroller-data{overflow-x:hidden!important;overflow-y:scroll!important;-webkit-overflow-scrolling:touch}:host.true-v-scroll .true-scroller-data .true-scroller-data-h{overflow-x:hidden!important}.true-scroller-footer{overflow-x:hidden;-webkit-box-flex:1;flex-grow:1}:host.true-fix-touch:not(.true-v-scroll) .true-scroller-data-area-scroller{height:1px;overflow-y:auto;-webkit-overflow-scrolling:touch}:host.true-fix-touch .true-scroller-data-area{height:auto;min-height:100%;display:-webkit-box;align-content:stretch;-webkit-overflow-scrolling:touch}:host.true-fix-touch .true-scroller-data{overflow-x:hidden!important;overflow-y:hidden!important;display:-webkit-box;display:flex;-webkit-box-align:stretch;align-items:stretch;-webkit-box-pack:center;justify-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}:host.true-fix-touch:not(.true-v-scroll) .true-scroller-data-h{overflow-x:auto;-webkit-overflow-scrolling:touch}:host.true-fix-touch.true-v-scroll .true-scroller-data-area-scroller{overflow-y:scroll!important;-webkit-overflow-scrolling:touch}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ElementRef,i.ChangeDetectorRef,i.Renderer2])],t)}(),P=function(){function t(){this.uiAction=null,this.windowResizeBound=null,this.touchMoveListenFunc=null,this.touchEndListenFunc=null,this.touchCancelListenFunc=null,this._touchListener=null}return t.prototype.addWindowResizeListener=function(){this.windowResizeBound||(this.windowResizeBound=this.windowResize.bind(this)),window.addEventListener("resize",this.windowResizeBound,!1)},t.prototype.addDocumentMouseListeners=function(){this.documentMouseMoveBound||(this.documentMouseMoveBound=this.documentMouseMove.bind(this)),this.documentMouseUpBound||(this.documentMouseUpBound=this.documentMouseUp.bind(this)),document.addEventListener("mousemove",this.documentMouseMoveBound,!1),document.addEventListener("mouseup",this.documentMouseUpBound,!1)},t.prototype.removeDocumentMouseListeners=function(){this.documentMouseMoveBound&&document.removeEventListener("mousemove",this.documentMouseMoveBound,!1),this.documentMouseUpBound&&document.removeEventListener("mouseup",this.documentMouseUpBound,!1),this.documentMouseMoveBound=null,this.documentMouseUpBound=null},t.prototype.addTouchListeners=function(t){this.removeTouchListeners(),this.touchStartBound=this.touchStart.bind(this),this.touchEndBound=this.touchEnd.bind(this),this.touchCancelBound=this.touchCancel.bind(this),t.addEventListener("touchstart",this.touchStartBound,{capture:!1,passive:!0,once:!1}),t.addEventListener("touchend",this.touchEndBound,{capture:!1,passive:!0,once:!1}),t.addEventListener("touchcancel",this.touchCancelBound,{capture:!1,passive:!0,once:!1}),this._touchListener=t},t.prototype.removeTouchListeners=function(){this.touchEndBound&&this._touchListener.removeEventListener("touchend",this.touchEndBound,!1),this.touchStartBound&&this._touchListener.removeEventListener("touchstart",this.touchStartBound,!1),this.touchCancelBound&&this._touchListener.removeEventListener("touchcancel",this.touchCancelBound,!1),this.touchStartBound=null,this.touchEndBound=null,this.touchCancelBound=null,this._touchListener=null},t.prototype.removeTouchMoveListeners=function(){this.touchMoveListenFunc&&this.touchMoveListenFunc(),this.touchEndListenFunc&&this.touchEndListenFunc(),this.touchCancelListenFunc&&this.touchCancelListenFunc(),this.touchMoveListenFunc=null,this.touchEndListenFunc=null,this.touchCancelListenFunc=null},t.prototype.windowResize=function(t){},t.prototype.touchStart=function(t){},t.prototype.touchEnd=function(t){},t.prototype.touchCancel=function(t){},t.prototype.documentMouseMove=function(t){},t.prototype.documentMouseUp=function(t){this.removeDocumentMouseListeners()},t.prototype.canDrop=function(t,e){},t.prototype.dragInProcess=function(t){},t.prototype.resizeInProcess=function(t){},t.prototype.showHeaderBtn=function(t){},t.prototype.hideHeaderBtns=function(){},t.prototype.ngOnDestroy=function(){this.windowResizeBound&&window.removeEventListener("resize",this.windowResizeBound,!1),this.windowResizeBound=null,this.removeDocumentMouseListeners(),this.removeTouchMoveListeners(),this.removeTouchListeners()},t=u([i.Injectable()],t)}(),R=function(){function t(t,e,i){this.fieldName=t,this.value=e,this.element=i,this._disabled=!1,this._selected=0,this._cellSelected=!1,this._disClass="true-cell-disabled",this._cfClass="true-cell-focused",this._rsClass="true-range-selected",this._maxLevel=5,this.rendered=!1,this.added=!1,this.skipped=!1}return t.prototype.toggleClass=function(t,e){return e?this.element.classList.add(t):this.element.classList.remove(t),e},t.prototype.setDisabled=function(t){this._disabled!==t&&(this._disabled=this.toggleClass(this._disClass,t))},t.prototype.setCellFocused=function(t){this._cellSelected!==t&&(this._cellSelected=this.toggleClass(this._cfClass,t))},t.prototype.setSelected=function(t){this._selected!==t&&(t>this._maxLevel&&(t=this._maxLevel),this._selected>0&&(this.element.classList.remove(this._rsClass),this.element.classList.remove(this._rsClass+this._selected)),t>0&&(this.element.classList.add(this._rsClass),this.element.classList.add(this._rsClass+t)),this._selected=t)},t.prototype.setChecked=function(t){this.cbElement&&(this.value=t,t?(this.cbElement.classList.remove("indeterminate"),this.cbElement.classList.add("checked")):null===t||t===undefined?(this.cbElement.classList.remove("checked"),this.cbElement.classList.add("indeterminate")):(this.cbElement.classList.remove("checked"),this.cbElement.classList.remove("indeterminate")))},t}(),O=function(){function t(t){this._renderer=t,this.ie=!1,this.valueChanged=!1,this.height=0,this.commit=new i.EventEmitter,this.change=new i.EventEmitter,this.cancel=new i.EventEmitter}return t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),this.value=t,this.valueChanged=e,this.height=i,this.ie=n,this.state.iOS&&y.focusAndOpenKeyboard(this.input.nativeElement,50)},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.inputChange=function(t){this.change.emit(t)},t.prototype.inputKeyDown=function(t){t.defaultPrevented||t.keyCode!==e.Keys.UP&&t.keyCode!==e.Keys.DOWN&&t.keyCode!==e.Keys.PAGE_UP&&t.keyCode!==e.Keys.PAGE_DOWN&&t.keyCode!==e.Keys.TAB&&(t.stopPropagation(),t.keyCode!==e.Keys.ESCAPE?t.keyCode!==e.Keys.ENTER||this.commit.emit(this.value):this.cancel.emit())},t.prototype.ngAfterContentInit=function(){var t=this;this.valueChanged?(this.input.nativeElement.focus(),this._renderer.setProperty(this.input.nativeElement,"value",this.value),this._renderer.setProperty(this.input.nativeElement,"selectionStart",this.value.length),this._renderer.setProperty(this.input.nativeElement,"selectionEnd",this.value.length)):this.state.iOS||setTimeout(function(){t.input.nativeElement.select(),t.input.nativeElement.focus()})},t.prototype.getClass=function(){return null!==this.height&&this.height>0?"true-grid__input-container":this.ie?"true-grid-editor-ie":"true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],t.prototype,"input",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),t=u([i.Component({selector:"true-editor-text",template:'<input #input class="true-grid-input"\n                  [(ngModel)]="value"\n                  (ngModelChange)="inputChange($event)"\n                  [style.height]="getH()"\n                  [ngClass]="getClass()"\n                  (mousedown)="inputMouseDown($event)"\n                  (keydown)="inputKeyDown($event)" />',styles:["\n    :host {\n      padding: 0;\n    }\n    "]}),p("design:paramtypes",[i.Renderer2])],t)}(),T=function(){function t(t){this._renderer=t,this.destroy$=new n.Subject,this.ie=!1,this.valueChanged=!1,this.height=0,this.wasShown=!1,this.initialized=!1,this._value=null,this.displayValue="",this.disableTextEditor=!1,this.commit=new i.EventEmitter,this.change=new i.EventEmitter,this.cancel=new i.EventEmitter,this._columns=null,this._settings=null,this._items=null,this._valueField=null,this._displayField=null}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.change.emit(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDropDownHeight",{get:function(){return this.state.settings.maxDropDownHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return null===this._columns&&(null!==this.column.optionsColumns?this._columns=this.column.optionsColumns:this._columns=[new e.Column("name","name",300,e.ColumnType.STRING)]),this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"settings",{get:function(){return null===this._settings&&(this._settings=e.GridSettings.minimal(),this._settings.appearance["class"]=this.state.settings.appearance["class"],this._settings.appearance.enableFocusedAppearance=!1,this._settings.showHeader=!1,this._settings.searchDelay=100),this._settings},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var t=this;null===this._items&&(this.column.optionsData instanceof n.Observable?this.column.optionsData.pipe(o.takeUntil(this.destroy$)).subscribe(function(e){t._items=e}):this._items=this.column.optionsData);return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueField",{get:function(){return null===this._valueField&&(this._valueField=this.columns[0].fieldName),this._valueField},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"displayField",{get:function(){return null===this._displayField&&(this._displayField=this.columns[0].fieldName),this._displayField},enumerable:!0,configurable:!0}),t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1),this.state.touchMode&&(this.input.popupPosition="MODAL",this.disableTextEditor=!0),e?(this.disableTextEditor?this.valueChanged=!1:(this.displayValue=t,this.valueChanged=!0),this.change.emit(null)):this._value=t,this.wasShown=r,this.height=i,this.ie=n},t.prototype.inputItemSelect=function(t){this.state.touchMode&&this.commit.emit(this.value)},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.inputKeyDown=function(t){t.defaultPrevented||(t.keyCode!==e.Keys.TAB?t.keyCode!==e.Keys.UP&&t.keyCode!==e.Keys.DOWN&&t.keyCode!==e.Keys.PAGE_UP&&t.keyCode!==e.Keys.PAGE_DOWN?(t.stopPropagation(),t.keyCode!==e.Keys.ESCAPE?t.keyCode!==e.Keys.ENTER||this.commit.emit(this.value):this.cancel.emit()):t.stopPropagation():this.input.setValueFromDisplayed())},t.prototype.ngAfterContentInit=function(){var t=this;this.valueChanged?(this.input.focus(),setTimeout(function(){t._renderer.setProperty(t.input.input.nativeElement,"value",t.displayValue),t._renderer.setProperty(t.input.input.nativeElement,"selectionStart",t.displayValue.length),t._renderer.setProperty(t.input.input.nativeElement,"selectionEnd",t.displayValue.length),t.input.displayValue=null===t.displayValue?"":t.displayValue,t.input.inputInput()})):this.state.touchMode?this.wasShown||setTimeout(function(){return t.input.showByTarget()}):setTimeout(function(){return t.input.focus()})},t.prototype.getClass=function(){return null!==this.height&&this.height>0?"true-grid__input-container":this.ie?"true-grid-editor-ie":"true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},t.prototype.ngOnDestroy=function(){this.destroy$.next(!0),this.destroy$.unsubscribe()},u([i.ViewChild("input",{"static":!0}),p("design:type",E)],t.prototype,"input",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),t=u([i.Component({selector:"true-editor-select-true",template:'<div [ngClass]="getClass()" [style.height]="getH()">\n              <true-select #input\n                class="true-editor-select__selector"\n                [(ngModel)]="value"\n                [style.height]="getH()"\n                [valueField]="valueField"\n                [displayField]="displayField"\n                [columns]="columns"\n                [settings]="settings"\n                [items]="items"\n                [useAltDown]="true"\n                [maxDropDownHeight]="maxDropDownHeight"\n                [disableTextEditor]="disableTextEditor"\n                (mousedown)="inputMouseDown($event)"\n                (itemSelect)="inputItemSelect($event)"\n                (keydown)="inputKeyDown($event)"></true-select>\n            </div>',styles:[":host{box-sizing:border-box;padding:0}.true-editor-select__selector{width:100%}.true-editor-select__selector ::ng-deep .true-select__input{height:100%}.true-editor-select__selector ::ng-deep input{border:0}.true-editor-select__container{padding:0;margin:0;background-color:#00f;box-sizing:border-box;height:100%}"]}),p("design:paramtypes",[i.Renderer2])],t)}(),M=function(){function t(t,e,n){var r=this;this._renderer=t,this._elementRef=e,this.intl=n,this.onChange=function(t){},this.onTouched=function(){},this._undo=[],this._redo=[],this._numValue=null,this._txtValue="",this.stateChange=new i.EventEmitter,this._state=null,this._separators=[".",","],this._format="{1.2}",this.android_behavior=!1,this._localeSubscription=this.intl.onLocaleChanged.subscribe(function(t){return r.setLocale(t)})}var n;return n=t,t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.blur=function(){var t=e.NumberParserFormatter.parse(this._txtValue,this.format,this._separators);null===t||isNaN(t)?this.setText(""):this.setText(e.NumberParserFormatter.format(t,this.format,this._separators)),this.onTouched()},Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(t){this._state!==t&&(this._state=t,this.stateChange.emit(this._state))},enumerable:!0,configurable:!0}),t.prototype.updateState=function(){null===this._numValue?this.state=e.MaskState.EMPTY:isNaN(this._numValue)?this.state=e.MaskState.TYPING:this.state=e.MaskState.OK},t.prototype.toModel=function(){""===this._txtValue?this._numValue=null:this._numValue=e.NumberParserFormatter.parse(this._txtValue,this.format,this._separators),this.onChange(this._numValue),this.updateState()},t.prototype.processAndroid=function(t){var i=this.currentRes(),n=e.Keys.whichKeyHasBeenPressed(this.last_res.newValue,t,this.last_res.selStart,i.selStart,this.last_res.selLength),r=this.last_res.selStart,o=this.last_res.selStart;""!==this.last_res.newValue&&t.length<=1&&(n=""===t?new e.KeyInfo(e.Keys.DELETE):new e.KeyInfo(0,t),r=0,o=this.last_res.newValue.length),this.processKey({keyCode:-1,key:n.code,char:n.char,shiftKey:!1,ctrlKey:!1,target:{selectionStart:r,selectionEnd:o},preventDefault:function(t){}})||this.setRes(this.last_res),this.android_behavior=!1},t.prototype.input=function(t){if(this.android_behavior)this.processAndroid(t);else{var i=e.NumberParserFormatter.parse(t,this.format,this._separators);null===i?this.setText(""):isNaN(i)||this.setText(e.NumberParserFormatter.format(i,this.format,this._separators),!0)}},t.prototype.writeValue=function(t){this._numValue=t;var i="";null!==t&&(i=e.NumberParserFormatter.format(t,this.format,this._separators)),i!==this._txtValue&&this.setText(i,!1),this.updateState()},Object.defineProperty(t.prototype,"format",{get:function(){return"currency"===this._format?this.intl.locale.currency:this._format},set:function(t){if(""!==this._txtValue&&this._format!==t){var i=this.currentRes();this._format=t;var n=e.NumberParserFormatter.reformat(this._txtValue,this.format,this._separators,i.selStart,i.selStart+i.selLength,!0);this.setRes(this.getRes(n.value,n.selStart,n.selEnd))}else this._format=t},enumerable:!0,configurable:!0}),t.prototype.keyDown=function(t){return this.processKey(t)},t.prototype.processKey=function(t){if(229===t.keyCode||0===t.keyCode||t.keyCode===undefined)return this.android_behavior=!0,void(this.last_res=this.currentRes());var i=e.Keys.keyChar(t),n=t.target.selectionStart,r=t.target.selectionEnd,o=this._txtValue,s=this.getRes(o,n,r);if(e.Keys.isFunctional(t.keyCode))return!0;if(t.keyCode===e.Keys.TAB||t.keyCode===e.Keys.ESCAPE)return!0;if(t.keyCode===e.Keys.HOME||t.keyCode===e.Keys.END)return!0;if(t.shiftKey&&(t.keyCode===e.Keys.DELETE||t.keyCode===e.Keys.INSERT))return!0;if(t.ctrlKey&&t.keyCode===e.Keys.Z){var a=this._undo.pop();return a&&(this._redo.push(this.getRes(o,n,r)),this.setRes(a)),t.preventDefault(),!1}if(t.ctrlKey&&t.keyCode===e.Keys.Y){var l=this._redo.pop();return l&&(this._undo.push(this.getRes(o,n,r)),this.setRes(l)),t.preventDefault(),!1}if(t.ctrlKey)return!0;0===n&&r===this._txtValue.length&&(o="",n=0,r=0);var u=!1;if(t.keyCode===e.Keys.BACKSPACE||t.keyCode===e.Keys.DELETE){var c=e.NumberParserFormatter.canAcceptKey(o,t.keyCode,i,this.format,this._separators,n,r);if(n===r&&(t.keyCode===e.Keys.BACKSPACE&&n>0&&(c&&(o=o.substring(0,n-1)+o.substring(r)),n--,r--),t.keyCode===e.Keys.DELETE&&(c?o=o.substring(0,n)+o.substring(r+1):(n++,r++)),u=!0),n<r){var p=o.substring(n,r);c&&(o=p.indexOf(this._separators[0])>=0?o.substring(0,n)+this._separators[0]+o.substring(r):o.substring(0,n)+o.substring(r)),r=n,u=!0}}if(1===i.length){if(o=o.substring(0,n)+o.substring(r),!e.NumberParserFormatter.canAcceptKey(o,t.keyCode,i,this.format,this._separators,n))return t.preventDefault(),!1;o=o.substring(0,n)+i+o.substring(n),r=++n,u=!0}if(u){o!==s.newValue&&(this._undo.push(s),this._redo=[]);var h=e.NumberParserFormatter.reformat(o,this.format,this._separators,n,r,!1);return this.setRes(this.getRes(h.value,h.selStart,h.selEnd)),this.android_behavior?!0:(t.preventDefault(),!1)}return!0},t.prototype.setRes=function(t){this.android_behavior&&(t.selLength=0),this.setText(t.newValue),this._renderer.setProperty(this._elementRef.nativeElement,"selectionStart",t.selStart),this._renderer.setProperty(this._elementRef.nativeElement,"selectionEnd",t.selStart+t.selLength)},t.prototype.currentRes=function(){var t=new e.MaskResult(this._txtValue,e.MaskSectionAction.APPLY,0);return t.selStart=this._elementRef.nativeElement.selectionStart,t.selLength=this._elementRef.nativeElement.selectionEnd-t.selStart,t},t.prototype.getRes=function(t,i,n){var r=new e.MaskResult(t,e.MaskSectionAction.APPLY,0);return r.selStart=i,r.selLength=n-i,r},t.prototype.setText=function(t,e){void 0===e&&(e=!0),this._txtValue=t,this._renderer.setProperty(this._elementRef.nativeElement,"value",this._txtValue),e&&this.toModel()},t.prototype.setLocale=function(t){this._separators[0]=t.separators[0],this._separators[1]=t.separators[1],this.writeValue(this._numValue)},t.prototype.ngOnDestroy=function(){this._localeSubscription.unsubscribe()},u([i.Output("ynStateChange"),p("design:type",Object)],t.prototype,"stateChange",void 0),u([i.Input("true-mask-number"),p("design:type",String),p("design:paramtypes",[String])],t.prototype,"format",null),u([i.HostListener("keydown",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],t.prototype,"keyDown",null),t=n=u([i.Directive({selector:"[true-mask-number]",host:{"(input)":"input($event.target.value)","(blur)":"blur()"},providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return n}),multi:!0}]}),p("design:paramtypes",[i.Renderer2,i.ElementRef,h])],t)}(),A=function(){function t(t){this._renderer=t,this.ie=!1,this.value=null,this.format="{1.2}",this.height=0,this.commit=new i.EventEmitter,this.cancel=new i.EventEmitter,this.change=new i.EventEmitter,this._initialized=!1}return t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),this.ie=n,this.valueChanged=e,this.valueTemp=t,this.height=i},t.prototype.ngAfterContentInit=function(){var t=this;if(this.valueChanged){var i=this.valueTemp;setTimeout(function(){if(null!==i&&""!==i){for(var n=0;n<i.length;n++){var r=e.Keys.generateEvent(t.input.nativeElement,99,i[n]);t.maskNumberDirective.processKey(r)}t._initialized=!0,t.inputChange(i)}t.input.nativeElement.focus()})}else this.value=this.valueTemp,setTimeout(function(){return t.input.nativeElement.select()}),this._initialized=!0},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.inputChange=function(t){this._initialized&&(isNaN(t)||""===t||null===t?this.change.emit(null):this.change.emit(+t))},t.prototype.inputKeyDown=function(t){t.defaultPrevented||t.keyCode!==e.Keys.UP&&t.keyCode!==e.Keys.DOWN&&t.keyCode!==e.Keys.PAGE_UP&&t.keyCode!==e.Keys.PAGE_DOWN&&t.keyCode!==e.Keys.TAB&&(t.stopPropagation(),t.keyCode!==e.Keys.ESCAPE?t.keyCode!==e.Keys.ENTER||this.commit.emit(this.value):this.cancel.emit())},t.prototype.getClass=function(){return null!==this.height&&this.height>0?"":this.ie?"true-grid-editor-ie":"true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},t.prototype.getFormat=function(){return""!==this.column.format?this.column.format:"{1}"},u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],t.prototype,"input",void 0),u([i.ViewChild("input",{read:M,"static":!0}),p("design:type",M)],t.prototype,"maskNumberDirective",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),t=u([i.Component({selector:"true-editor-number",template:'<input #input\n              class="true-grid-input true-editor-number__input true-grid__input-container"\n              [true-mask-number]="getFormat()"\n              [style.height]="getH()"\n              [ngClass]="getClass()"\n              [(ngModel)]="value"\n              (ngModelChange)="inputChange($event)"\n              (mousedown)="inputMouseDown($event)"\n              (keydown)="inputKeyDown($event)" />',styles:["\n    :host {\n      padding: 0;\n    }\n    .true-editor-number__input {\n      text-align: right;\n    }\n    "]}),p("design:paramtypes",[i.Renderer2])],t)}(),I=function(){function t(t){this.changeDetector=t,this.value=null,this.datepickerInputClass="true-grid-input",this.commit=new i.EventEmitter,this.cancel=new i.EventEmitter,this.change=new i.EventEmitter,this._initialized=!1}return t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),this.state.touchMode?this.datepicker.popupPosition="MODAL":this.datepicker.popupPosition="RELATIVE",this.ie=n,this.valueTemp=t,this.valueChanged=e,this.height=i,this.state.iOS&&y.focusAndOpenKeyboard(this.datepicker.input.nativeElement,50)},t.prototype.ngAfterContentInit=function(){var t=this;if(this.valueChanged){this.datepicker.focus();var i=this.valueTemp;setTimeout(function(){for(var n=0;n<i.length;n++){var r=e.Keys.generateEvent(null,0,i[n]);t.datepicker.acceptKey(r)}t._initialized=!0})}else this.value=this.valueTemp,setTimeout(function(){return t.datepicker.focus()}),this._initialized=!0},t.prototype.datepickerChange=function(t){this._initialized&&this.change.emit(this.purify(t))},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.inputKeyDown=function(t){t.keyCode!==e.Keys.UP&&t.keyCode!==e.Keys.DOWN&&t.keyCode!==e.Keys.TAB&&(t.keyCode!==e.Keys.ESCAPE?(t.stopPropagation(),t.keyCode!==e.Keys.ENTER||this.commit.emit(this.purify(this.value))):this.cancel.emit(!1))},t.prototype.getClass=function(){var t="true-editor-date__datepicker";return null!==this.height&&this.height>0?t:this.ie?t+" true-grid-editor-ie":t+" true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},t.prototype.purify=function(t){return t===undefined||null===t||isNaN(t.getTime())?null:t},u([i.ViewChild("datepicker",{"static":!0}),p("design:type",Object)],t.prototype,"datepicker",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),t=u([i.Component({selector:"true-editor-date",template:'<div class="true-grid__input-container" [style.height]="getH()">\n    <true-datepicker #datepicker\n      class="true-editor-date__datepicker"\n      [pattern]="column.format"\n      [ngClass]="getClass()"\n      [inputClass]="datepickerInputClass"\n      [showError]="false"\n      [(ngModel)]="value"\n      (keydown)="inputKeyDown($event)"\n      (ngModelChange)="datepickerChange($event)">\n    </true-datepicker>\n  </div>',styles:["\n    :host {\n      padding: 0;\n      margin: 0;\n      border: 0;\n    }\n    .true-editor-date__datepicker {\n      width: 100%;\n      height: 100%;\n      padding: 0;\n      margin: 0;\n    }\n    "]}),p("design:paramtypes",[i.ChangeDetectorRef])],t)}(),F=function(){function t(){this.event=new i.EventEmitter,this.disabled=!1}return t.prototype.init=function(t){this.value=t},t=u([i.Component({selector:"true-cell-html",template:'<div [innerHTML]="value"></div>',styles:["\n    :host {\n      padding: 0;\n    }\n    "]})],t)}(),L=function(){function t(){this.event=new i.EventEmitter,this.disabled=!1}return Object.defineProperty(t.prototype,"ref",{get:function(){return this.row[this.column.referenceField]},enumerable:!0,configurable:!0}),t.prototype.highlight=function(t){var e=this.state.dataSource.searchString.toLowerCase();if(""===e)return t;var i=t.toLowerCase().indexOf(e),n=t.substring(0,i),r=t.substring(i,i+e.length),o=t.substring(i+e.length);return i>=0?n+"<span class='true-hl'>"+r+"</span>"+o:t},t.prototype.init=function(t){var e=this.highlight(t),i="";""!==this.column.referenceTarget&&(i=' target="'+this.column.referenceTarget+'"');var n='<a href="'+this.ref+'"'+i+">"+e+"</a>";this.value=n,this.content.nativeElement.innerHTML=n},u([i.ViewChild("content",{"static":!0}),p("design:type",Object)],t.prototype,"content",void 0),t=u([i.Component({selector:"true-cell-ref",template:"<div #content></div>",styles:["\n    :host {\n      padding: 0;\n    }\n    "]})],t)}(),j=function(){function t(t,e,n,r,o){this._renderer=t,this._cfResolver=e,this._appRef=n,this._injector=r,this.elementRef=o,this.empty=!1,this.viewPortLeft=-1,this.viewPortWidth=-1,this.locale="",this.toggleCheckbox=new i.EventEmitter,this._left_rendered=-1,this._right_rendered=-1,this.cells=[],this.selectionMap=[],this._viewInitialized=!1,this._wasEditor=null,this._height0=null,this._locale0="",this._checkedAppearance=!1,this._subscribes=[],this._filter0="",this._editorRef=null,this._customCellRefs=[],this._skips=[]}return Object.defineProperty(t.prototype,"rowData",{get:function(){return this.state.dataSource.rowData(this.row)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"st",{get:function(){return this.state.settings},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sta",{get:function(){return this.state.settings.appearance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentRowIndex",{get:function(){return this.axI+this.layout.selection.displayedStartIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.elementRef.nativeElement.children},enumerable:!0,configurable:!0}),t.prototype.firstCellRect=function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];if(!e.classList.contains("true-cell-indent"))return e.getBoundingClientRect()}return null},t.prototype.firstCellClientHeight=function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];if(!e.classList.contains("true-cell-indent"))return e.clientHeight}return null},t.prototype.cellByXY=function(t,e){for(var i=this.cells[0].element.getBoundingClientRect().left,n=0;n<this.cells.length;n++){var r=this.cells[n],o=this.state.columnByFieldName(r.fieldName),s=r.skipped?o.displayedWidth:r.element.offsetWidth;if(t>=i&&t<i+s)return r.fieldName;i+=s}return""},t.prototype.cellHorizontalPos=function(t){for(var e=this.cells[0].element.offsetLeft,i=0;i<this.cells.length;i++){var n=this.cells[i],r=this.state.columnByFieldName(n.fieldName),o=n.skipped?r.displayedWidth:n.element.offsetWidth;if(n.fieldName===t)return{l:0===i?0:e,r:e+o};e+=o}return null},t.prototype.clearSelection=function(){this.cells.forEach(function(t){t.setSelected(0),t.setCellFocused(!1)})},t.prototype.getSelectionMap=function(t,e){for(var i=[],n=0;n<this.cells.length;n++)i.push(0);for(var r=0;r<t.ranges.length;r++){var o=t.ranges[r],s=o.rowIndex,a=o.rowIndex+o.rangeY;if(s>a){var l=a;a=s,s=l}if(!(this.currentRowIndex<s||this.currentRowIndex>a)){var u=o.columnIndex,c=u+o.rangeX;for(n=0;n<this.cells.length;n++)(n>=u&&n<=c||n<=u&&n>=c)&&i[n]++}}return i},t.prototype.setCellSelection=function(t,e){var i=this.layout.selection,n=this.selectionMap[e],r=this.currentRowIndex===i.focusedRowIndex&&e===i.focusedColumnIndex;return t.setSelected(n),t.setCellFocused(r),n},t.prototype.setSelection=function(){var t=this,e=this.layout.selection,i=this.state.check.isRowChecked(this.row);""!=this.state.sta.checkedRowClass&&(this.state.sta.enableCheckedAppearance||this._checkedAppearance)&&(i&&this.state.sta.enableCheckedAppearance?this.elementRef.nativeElement.classList.add(this.sta.checkedRowClass):this.elementRef.nativeElement.classList.remove(this.sta.checkedRowClass)),this._checkedAppearance=this.sta.enableCheckedAppearance,e.ranges.length<1&&!i?this.clearSelection():(this.selectionMap=this.getSelectionMap(e,i),this.cells.forEach(function(e,i){t.setCellSelection(e,i)}))},t.prototype.clear=function(t){void 0===t&&(t=!1),this._height0=t?this.firstCellClientHeight():null,this._subscribes.forEach(function(t){return t.unsubscribe()}),this._subscribes=[],this.cells.splice(0,this.cells.length),this.elementRef.nativeElement.innerHTML="",this._customCellRefs.length>0&&(this._customCellRefs.forEach(function(t){return t.destroy()}),this._customCellRefs.splice(0,this._customCellRefs.length)),this.clearEditor()},t.prototype.clearEditor=function(){var t=this;if(this._height0=this.firstCellClientHeight(),this._editorRef&&this._wasEditor){var e=this._wasEditor;this.cells.forEach(function(i){if(i.fieldName===e.fieldName&&t.rowData===e.row){i.element.style.height="unset",t._renderer.removeClass(i.element,"true-cell-input");for(var n=[],r=0;r<i.element.children.length;)n.push(i.element.children[r]),r++;n.forEach(function(e){return t._renderer.removeChild(i.element,e)});var o=t.state.columnByFieldName(e.fieldName),s=t.rowData,a=t.rowData[o.fieldName],l=t.getDisplayedValue(o,s,a);t.fillCell(i,o,s,!1,a,l),i.value=a}t._wasEditor=null})}},t.prototype.renderStub=function(t,e,i){if(!i.isBoolean){var n=this._renderer.createElement("span"),r=20+40*Math.random();n.style.width=r+"%",this._renderer.appendChild(e.element,n),this._renderer.addClass(n,"true-stub")}},t.prototype.renderBoolean=function(t,e,i,n){var r=this,o=this._renderer.createElement("div");this.st.canEditColumnCell(i)?(this._renderer.addClass(o,this.sta.checkboxClass),this._renderer.listen(o,"mousedown",function(t){return t.stopPropagation()}),this._renderer.listen(o,"dblclick",function(t){return t.stopPropagation()}),this._renderer.listen(o,"click",function(e){r.toggleCheckbox.emit({row:t,fieldName:i.fieldName}),e.stopPropagation()}),this._renderer.appendChild(e.element,o)):(this.sta.booleanClass.trim().split(" ").forEach(function(t){return r._renderer.addClass(o,t)}),this._renderer.appendChild(e.element,o));e.cbElement=o,e.setChecked(n)},t.prototype.renderCheckbox=function(t,e,i){var n=this,r=this._renderer.createElement("div");this._renderer.addClass(r,this.sta.checkboxClass),this.st.checkByCellClick||(this._renderer.listen(r,"mousedown",function(t){return t.stopPropagation()}),this._renderer.listen(r,"dblclick",function(t){return t.stopPropagation()}),this._renderer.listen(r,"click",function(t){n.toggleCheckbox.emit({row:n.row,fieldName:e.fieldName}),t.stopPropagation()})),t.cbElement=r,this._renderer.appendChild(t.element,r),t.setChecked(i)},t.prototype.getEditorComponentType=function(t){var i=O;return t.type===e.ColumnType.DATETIME&&(i=I),t.type===e.ColumnType.NUMBER&&(i=A),t.type===e.ColumnType.UNSAFE_HTML&&(i=T),null!==t.editorComponentType&&(i=t.editorComponentType),i},t.prototype.getDh=function(){var t=0;return 0!==this.axI&&!this.state.IE&&this.sta.horizontalLines&&(t=1),t},t.prototype.setEditorHeight=function(t){null===this._height0&&null!==this.state.ui.editorHeight?this._height0=this.state.ui.editorHeight:this.state.ui.editorHeight=this._height0,this._height0>=this.state.settings.rowHeight&&(t.element.style.height=this._height0-1+"px")},t.prototype.renderEditor=function(t,e,i,n){var r=this;this._renderer.addClass(e.element,"true-cell-input");var o=this.getEditorComponentType(i),s=this._cfResolver.resolveComponentFactory(o);this._editorRef=s.create(this._injector,[],e.element),this._appRef.attachView(this._editorRef.hostView),this._editorRef.instance.state=this.state,this._editorRef.instance.column=i,this._editorRef.instance.row=t,this.setEditorHeight(e);var a=this.getDh(),l=this._editorRef.instance.change.subscribe(function(t){r.state.ui.editorValue=t}),u=this._editorRef.instance.commit.subscribe(function(t){r.state.ui.commitEditor(r.row,i.fieldName,t)}),c=this._editorRef.instance.cancel.subscribe(function(){var t=r._wasEditor.clone();r.state.ui.stopEditing(t,!0,!0)});this._editorRef.instance.init(this.state.ui.editorValue,this.state.ui.editorValueChanged,this._height0+a,this.state.IE,this.state.ui.editorWasShown),this.state.ui.editorWasShown=!0,this.state.ui.editor&&(this._wasEditor=this.state.ui.editor.clone()),this._subscribes.push(l),this._subscribes.push(u),this._subscribes.push(c)},t.prototype.renderCustomCell=function(t,e,i,n,r){var o=this;void 0===r&&(r=F),this._renderer.addClass(e.element,"true-cell-custom");var s=this._cfResolver.resolveComponentFactory(r).create(this._injector,[],e.element);s.instance.state=this.state,s.instance.column=i,s.instance.row=t,this._appRef.attachView(s.hostView),s.instance.init(this.getDisplayedValue(i,t,n));var a=s.instance.event.subscribe(function(t){o.state.emitCustomCellEvent(t)});this._customCellRefs.push(s),this._subscribes.push(a)},t.prototype.getDisplayedValue=function(t,e,i){return this.state.dataSource.displayedValue(t,i,e)},t.prototype.fillCell=function(t,i,n,r,o,s){var a=this;if(this.state.st.cellClass(i).trim().split(" ").forEach(function(e){""!==e&&a._renderer.addClass(t.element,e)}),""!==i.classField&&n[i.classField]&&this._renderer.addClass(t.element,n[i.classField]),t.rendered=!0,t.fieldName=i.fieldName,"empty"===n.__ax)return this.renderStub(n,t,i),t;var l=t.element;if(i.isCheckbox)return this.renderCheckbox(t,i,o),t;if(i.isBoolean)return this.renderBoolean(n,t,i,o),t;if(i.type===e.ColumnType.REFERENCE)return this.renderCustomCell(n,t,i,o,L),t;if(null!==this.state.ui.editor&&this.state.ui.editor.fieldName===i.fieldName&&this.state.ui.editor.row===n)return this.renderEditor(n,t,i,o),t;if(null!==i.cellComponentType)return this.renderCustomCell(n,t,i,o,i.cellComponentType),t;if(i.type===e.ColumnType.HTML)return this.renderCustomCell(n,t,i,o),t;var u=i.type===e.ColumnType.UNSAFE_HTML;if(""!==this.state.dataSource.searchString&&this.state.st.searchHighlight&&(u=!0),u){var c=this.state.dataSource.searchString;l.innerHTML=e.CellHighlighter.highlight(c,i,o,s)}else l.innerText=s;return t},t.prototype.needRender=function(t,i,n){var r=!0;return this.st.renderMode!==e.RenderMode.VISIBLE?r:(this.viewPortLeft>=0&&!n&&(i>this.viewPortLeft+this.viewPortWidth&&(r=!1),i+t.headerWidth<this.viewPortLeft&&(r=!1)),r)},t.prototype.createTd=function(t){var e=this._renderer.createElement("td");return t>1&&this._renderer.setAttribute(e,"colspan",t+""),e},t.prototype.createCell=function(t,e,i,n,r){void 0===e&&(e=1),void 0===i&&(i=!1),void 0===r&&(r=!0);var o=this.rowData,s=null!==o?o[t.fieldName]:null,a=new R(t.fieldName,s,null);if(a.element=this.createTd(e),r){var l=this.getDisplayedValue(t,o,s);this.fillCell(a,t,o,i,s,l)}return a},t.prototype.needApplySpan=function(){return 1},t.prototype.createSkipCell=function(t){var e=this._renderer.createElement("td");return this._renderer.setAttribute(e,"colspan",t+""),e},t.prototype.renderRowEditor=function(){for(var t=0;t<this.layout.columns.length;t++){var e=this.layout.columns[t];if(!e.isBoolean){var i=this.cells[t];if(null!==this.state.ui.editor&&this.state.ui.editor.fieldName===e.fieldName&&this.state.ui.editor.row===this.rowData){var n=this.rowData[e.fieldName];return this.renderEditor(this.rowData,i,e,n),i}}}},t.prototype.renderRow=function(){this._locale0=this.locale,this._skips.splice(0,this._skips.length),this._wasEditor=null,this.empty||(this._filter0=this.state.dataSource.searchString),this.cells.splice(0,this.cells.length);var t=!0;if(this.empty){var e=this._renderer.createElement("td");return this._renderer.setAttribute(e,"colspan",this.layout.columns.length+""),void this._renderer.appendChild(this.elementRef.nativeElement,e)}for(var i=0,n=0,r=-1,o=-1,s=0;s<this.layout.columns.length;s++){var a=this.layout.columns[s],l=1,u=t;t&&!a.isCheckbox&&(l=this.needApplySpan(),t=!1);var c=this.needRender(a,i,u),p=this.createCell(a,l,u,i,c);if(this.cells.push(p),c){if(n>0){var h=this.createSkipCell(n);this._renderer.appendChild(this.elementRef.nativeElement,h),n=0,this._skips.push({element:h,fromIndex:r,toIndex:o})}this._renderer.appendChild(this.elementRef.nativeElement,p.element)}else 0===n&&(r=s),o=s,p.skipped=!0,n++;i+=a.headerWidth}if(n>0){h=this.createSkipCell(n);this._renderer.appendChild(this.elementRef.nativeElement,h),this._skips.push({element:h,fromIndex:r,toIndex:o})}this.setSelection(),this.setDisabledFields(),this._left_rendered=this.viewPortLeft,this._right_rendered=this.viewPortLeft+this.viewPortWidth},t.prototype.nextEl=function(t){for(var e=!1,i=0;i<this.children.length;i++)if(this.children[i]!==t){if(e)return this.children[i]}else e=!0;return null},t.prototype.unskip=function(t,e){for(var i=0;i<this._skips.length;i++){var n=this._skips[i];if(e>=n.fromIndex&&e<=n.toIndex){if(e===n.fromIndex)n.fromIndex++,this._renderer.insertBefore(this.elementRef.nativeElement,t.element,n.element);else if(e===n.toIndex){n.toIndex--;var r=this.nextEl(n.element);null!==r?this._renderer.insertBefore(this.elementRef.nativeElement,t.element,r):this._renderer.appendChild(this.elementRef.nativeElement,t.element)}else{var o=this.createSkipCell(e-n.fromIndex);this._renderer.insertBefore(this.elementRef.nativeElement,t.element,n.element),this._renderer.insertBefore(this.elementRef.nativeElement,o,t.element),this._skips.push({element:o,fromIndex:n.fromIndex,toIndex:e-1}),n.fromIndex=e+1}n.fromIndex>n.toIndex?(this._skips.splice(i,1),this._renderer.removeChild(this.elementRef.nativeElement,n.element)):this._renderer.setAttribute(n.element,"colspan",n.toIndex-n.fromIndex+1+""),t.skipped=!1;break}}},t.prototype.renderByViewPort=function(){for(var t=this.rowData,e=(this.viewPortLeft,this.viewPortWidth,this.viewPortLeft,0),i=0;i<this.layout.columns.length;i++){var n=this.layout.columns[i],r=this.cells[i];if(r){if(this.needRender(n,e,!1)&&i>0){if(!r.rendered){var o=r.value,s=this.getDisplayedValue(n,t,o);this.fillCell(r,n,t,0===i,o,s)}r.skipped&&this.unskip(r,i)}e+=n.headerWidth}}this._right_rendered<this.viewPortLeft+this.viewPortWidth&&(this._right_rendered=this.viewPortLeft+this.viewPortWidth),this._left_rendered>this.viewPortLeft&&(this._left_rendered=this.viewPortLeft)},t.prototype.checkEditor=function(){return null===this._wasEditor&&null===this.state.ui.editor||(null===this._wasEditor&&null!==this.state.ui.editor&&this.state.ui.editor.row!==this.rowData||null!==this._wasEditor&&null!==this.state.ui.editor&&this._wasEditor.row===this.state.ui.editor.row&&this._wasEditor.fieldName===this.state.ui.editor.fieldName)},t.prototype.checkColumns=function(){if(!this.layout)return!1;if(0===this.cells.length&&!this.layout.columns)return!0;if(this.cells.length>this.layout.columns.length+1)return!1;if(this.cells.length<this.layout.columns.length-1)return!1;for(var t=0,e=!1;t<this.cells.length;){if(!this.layout||!this.layout.columns[t])return!1;if(this.state.isTree&&this.layout.columns[t].fieldName!==this.cells[t].fieldName)return!1;if(this.layout.columns[t].fieldName!==this.cells[t].fieldName){if(t<this.cells.length-1&&this.layout.columns[t].fieldName===this.cells[t+1].fieldName){this.cells[t].element.offsetWidth;this._renderer.removeChild(this.elementRef.nativeElement,this.cells[t].element),this.cells.splice(t,1),this._skips.forEach(function(e){e.toIndex>t&&e.toIndex--,e.fromIndex>t&&e.fromIndex--});continue}if(t<this.cells.length-2&&this.layout.columns[t].fieldName===this.cells[t+2].fieldName){this._renderer.removeChild(this.elementRef.nativeElement,this.cells[t].element),this.cells.splice(t,1),this._skips.forEach(function(e){e.toIndex>t&&e.toIndex--,e.fromIndex>t&&e.fromIndex--});continue}if(!(t<this.layout.columns.length-1&&this.cells[t].fieldName===this.layout.columns[t+1].fieldName))return!1;if(this.cells[t].skipped)return!1;this.viewPortLeft=-1;var i=this.createCell(this.layout.columns[t]);i.setDisabled(this.state.dragDrop.disabledFields.indexOf(i.fieldName)>=0),this._renderer.insertBefore(this.elementRef.nativeElement,i.element,this.cells[t].element),this.cells.splice(t,0,i),this._skips.forEach(function(e){e.toIndex>t&&e.toIndex++,e.fromIndex>t&&e.fromIndex++}),e=!0,t++}t++}return this.renderByViewPort(),e&&this.setSelection(),!0},t.prototype.checkValues=function(){if(!this.layout)return!1;if(0===this.cells.length&&!this.layout.columns)return!0;if(this.cells.length!==this.layout.columns.length)return!1;if(this._filter0!==this.state.dataSource.searchString)return!1;for(var t=0;t<this.cells.length;){var e=this.cells[t],i=this.rowData;if((null!==i?i[e.fieldName]:null)!==e.value){if(!e.cbElement){if(this._wasEditor&&this._wasEditor.fieldName===e.fieldName&&this._wasEditor.row===this.rowData){t++;continue}return!1}e.setChecked(this.row[e.fieldName])}t++}return!0},t.prototype.setDisabledFields=function(){var t=this;this.cells.forEach(function(e){e.setDisabled(t.state.dragDrop.disabledFields.indexOf(e.fieldName)>=0)})},t.prototype.setParams=function(t){if(void 0===t&&(t=!1),t)return this.renderRow(),void(this._viewInitialized=!0);this._viewInitialized},t.prototype.checkViewPort=function(){return this._left_rendered<=this.viewPortLeft&&this._right_rendered>=this.viewPortLeft+this.viewPortWidth},t.prototype.check=function(){var t=this.locale!==this._locale0,e=!1;this._checkedAppearance!==this.sta.enableCheckedAppearance&&(e=!0);var i=!1,n=!this.checkColumns();return n||(i=!this.checkValues()),!(n||i||e||t)},t.prototype.ngOnChanges=function(t){this.setParams()},t.prototype.ngDoCheck=function(){if(this._viewInitialized){if(!this.check()){var t=this.state.ui.editor&&this.state.ui.editor.row===this.rowData;return this.clear(t),void this.renderRow()}this.checkEditor()||(this.clearEditor(),this.renderRowEditor()),this.checkViewPort()||this.renderByViewPort(),this.setSelection(),this.setDisabledFields()}},t.prototype.ngAfterContentInit=function(){this.setParams(!0)},t.prototype.ngOnDestroy=function(){this.clear()},u([i.Input(),p("design:type",Object)],t.prototype,"row",void 0),u([i.Input("true-state"),p("design:type",m)],t.prototype,"state",void 0),u([i.Input("true-i"),p("design:type",Number)],t.prototype,"axI",void 0),u([i.Input("true-layout"),p("design:type",e.GridLayout)],t.prototype,"layout",void 0),u([i.Input("true-empty"),p("design:type",Object)],t.prototype,"empty",void 0),u([i.Input("view-port-left"),p("design:type",Object)],t.prototype,"viewPortLeft",void 0),u([i.Input("view-port-width"),p("design:type",Object)],t.prototype,"viewPortWidth",void 0),u([i.Input("true-locale"),p("design:type",String)],t.prototype,"locale",void 0),u([i.Output("toggleCheckbox"),p("design:type",Object)],t.prototype,"toggleCheckbox",void 0),t=u([i.Directive({selector:"[true-row]"}),p("design:paramtypes",[i.Renderer2,i.ComponentFactoryResolver,i.ApplicationRef,i.Injector,i.ElementRef])],t)}(),V=function(){function t(){this._onClick=new n.Subject,this.onClick=this._onClick.asObservable(),this._onMouseEnter=new n.Subject,this.onMouseEnter=this._onMouseEnter.asObservable(),this._divide=!1,this.disabled=!1,this.onItemClick=new i.EventEmitter,this.onItemMouseEnter=new i.EventEmitter,this.onNeedClose=new i.EventEmitter,this._parentMenu=null}return Object.defineProperty(t.prototype,"divide",{get:function(){return this._divide},set:function(t){this._divide=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentMenu",{set:function(t){this._parentMenu=t},enumerable:!0,configurable:!0}),t.prototype.click=function(t){this.onItemClick.emit({originalEvent:t,target:this.button.nativeElement}),this.hasSubmenu()||this._onClick.next(t)},t.prototype.mouseEnter=function(t){this._onMouseEnter.next(this),this.onItemMouseEnter.emit({target:this.button.nativeElement,parent:this._parentMenu})},t.prototype.hasSubmenu=function(){return this.submenu!==undefined},t.prototype.closeSubMenu=function(){this.onNeedClose.emit(null)},u([i.Input("true-menu-show"),p("design:type",Object)],t.prototype,"submenu",void 0),u([i.Input("true-divide"),p("design:type",Boolean),p("design:paramtypes",[Boolean])],t.prototype,"divide",null),u([i.Input("disabled"),p("design:type",Boolean)],t.prototype,"disabled",void 0),u([i.Output("itemClick"),p("design:type",i.EventEmitter)],t.prototype,"onItemClick",void 0),u([i.Output("itemMouseEnter"),p("design:type",i.EventEmitter)],t.prototype,"onItemMouseEnter",void 0),u([i.Output("needClose"),p("design:type",i.EventEmitter)],t.prototype,"onNeedClose",void 0),u([i.ViewChild("button",{"static":!0}),p("design:type",Object)],t.prototype,"button",void 0),t=u([i.Component({selector:"true-menu-item",template:'\n    <button #button\n      [disabled]="disabled"\n      [class.true-menu-item_divide]="divide"\n      (click)="click($event)"\n      (mouseenter)="mouseEnter($event)">\n      <div><div><ng-content></ng-content></div><span *ngIf="hasSubmenu()" class="true-submenu true-icon-right-dir"></span></div>\n    </button>\n  ',host:{"[class.true-menu-item_divide]":"divide","class":"true-menu-item"},styles:["\n    button {\n      background: none;\n      border: none;\n      width: 100%;\n      text-align: left;\n    }\n\n    button > div {\n      width: 100%;\n      display: flex;\n      flex-direction: row;\n      align-items: baseline;\n      flex-wrap: nowrap;\n      justify-content: space-between;\n      text-align: left;\n    }\n\n    .true-submenu {\n      flex-grow: 0;\n    }\n\n  "]})],t)}(),B=function(){function t(){this.closed=new i.EventEmitter,this.show=new i.EventEmitter,this.position="RELATIVE",this._parentMenu=null}return t.prototype.popupClosed=function(t){this.closeSubMenus(null),this.closed.emit()},t.prototype.popupShow=function(t){this.show.emit()},Object.defineProperty(t.prototype,"visible",{get:function(){return this.popup.visible},enumerable:!0,configurable:!0}),t.prototype.showByXY=function(t,e){this.popup.showByXY(t,e)},t.prototype.showByTarget=function(t,e,i){void 0===t&&(t=null),void 0===e&&(e=""),void 0===i&&(i=null),this._parentMenu=i,this.popup.showByTarget(t,e)},t.prototype.togglePopup=function(t,e,i){void 0===t&&(t=null),void 0===e&&(e=""),void 0===i&&(i=null),this.visible?this.popup.closePopup(t,e):(this._parentMenu=i,this.popup.showByTarget(t,e))},t.prototype.closeSubMenus=function(t){this.items.forEach(function(e){e!==t&&e.closeSubMenu()})},t.prototype.closePopup=function(t){void 0===t&&(t=!0),null!==this._parentMenu&&t&&this._parentMenu.closePopup(!0),this.popup.closePopup()},t.prototype.addSubscription=function(t){this._subscription?this._subscription.add(t):this._subscription=t},t.prototype.ngAfterContentInit=function(){var t=this;this._subscription&&this._subscription.unsubscribe(),this.items.forEach(function(e){e.parentMenu=t;var i=e.onMouseEnter.subscribe(function(e){return t.closeSubMenus(e)});t.addSubscription(i);var n=e.onClick.subscribe(function(e){return t.closePopup(!0)});t.addSubscription(n)})},t.prototype.ngOnDestroy=function(){this._subscription&&this._subscription.unsubscribe()},u([i.ViewChild("popup",{"static":!0}),p("design:type",Object)],t.prototype,"popup",void 0),u([i.Output("closed"),p("design:type",i.EventEmitter)],t.prototype,"closed",void 0),u([i.Output("show"),p("design:type",i.EventEmitter)],t.prototype,"show",void 0),u([i.Input(),p("design:type",String)],t.prototype,"position",void 0),u([i.ContentChildren(V),p("design:type",i.QueryList)],t.prototype,"items",void 0),t=u([i.Component({selector:"true-menu",template:'\n    <true-popup #popup\n      [position]="position"\n      (closed)="popupClosed($event)"\n      (show)="popupShow($event)">\n      <div class="true-menu">\n        <ng-content></ng-content>\n      </div>\n    </true-popup>\n  '})],t)}(),N=function(){return function(t,e,i,n){void 0===e&&(e=""),void 0===i&&(i=""),void 0===n&&(n=!1),this.id=t,this.caption=e,this.cssClass=i,this.disabled=n}}(),K=function(){function t(){this.caption="...",this.showHeader=!0,this.showFooter=!0,this.buttons=[new N("ok","OK","primary",!1),new N("cancel","Cancel","primary outline",!1)]}return t["new"]=function(){var e=new t;return e.showHeader=!1,e.showFooter=!1,e.buttons=[],e},t.prototype.header=function(t){return this.showHeader=!0,this.caption=t,this},t.prototype.ok=function(t,e,i){return void 0===t&&(t="OK"),void 0===e&&(e="primary"),void 0===i&&(i=!1),this.showFooter=!0,this.buttons.push(new N("ok",t,e,i)),this},t.prototype.cancel=function(t,e,i){return void 0===t&&(t="Cancel"),void 0===e&&(e="primary outline"),void 0===i&&(i=!1),this.showFooter=!0,this.buttons.push(new N("cancel",t,e,i)),this},t.prototype.button=function(t,e,i,n){return void 0===e&&(e="Btn"),void 0===i&&(i="primary outline"),void 0===n&&(n=!1),this.showFooter=!0,this.buttons.push(new N(t,e,i,n)),this},t.closeButtonId="__ax_btn_close",t}(),H=function(){function t(t){this.intl=t,this.filter=null,this.rows=null,this.closed=new i.EventEmitter,this.setFilter=new i.EventEmitter,this.resetFilter=new i.EventEmitter,this._dialog=null,this._settings=null,this.selectMode=!1}return t.prototype.init=function(){},t.prototype.validate=function(){return!1},Object.defineProperty(t.prototype,"dialog",{get:function(){return null===this._dialog&&(this._dialog=K["new"]().header(this.intl.translate(this.filter.caption)).button("set",this.intl.translate("SET"),"primary").button("reset",this.intl.translate("Reset"),"primary outline",!this.filter.active)),this._dialog},enumerable:!0,configurable:!0}),t.prototype.dialogBtnClick=function(t){"set"===t.id&&this.validate()&&this.setFilter.emit(this.filter),"reset"===t.id&&this.resetFilter.emit(this.filter),this.closed.emit(t)},Object.defineProperty(t.prototype,"listSettings",{get:function(){if(!this._settings){var t=e.GridSettings.minimal();t.groupCollapseByDefault=!0,t.levelIndent=30,t.columnAutoWidth=!0,t.rowHeight=this.state.settings.filterItemRowHeight,t.checkByCellClick=!0,t.appearance["class"]=this.state.settings.appearance["class"],t.appearance.scrollboxClass=this.state.settings.appearance.scrollboxClass,this._settings=t}return this._settings},enumerable:!0,configurable:!0}),t.prototype.showOM=function(t){this.selectMode||(this.operatorMenu.position="ABSOLUTE",this.operatorMenu.togglePopup(t.target)),t.preventDefault()},t.prototype.operator=function(t){this.filter.operator=t,this.validate()},u([i.Input(),p("design:type",e.Filter)],t.prototype,"filter",void 0),u([i.Input(),p("design:type",Array)],t.prototype,"rows",void 0),u([i.ViewChild("operatorMenu",{"static":!0}),p("design:type",B)],t.prototype,"operatorMenu",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"closed",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"setFilter",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"resetFilter",void 0),t=u([i.Component({selector:"true-filter-base",template:"",styles:[""]}),p("design:paramtypes",[h])],t)}(),z=function(t){function n(i){var n=t.call(this,i)||this;return n.intl=i,n.filter=null,n.rows=null,n.inputError="",n.gridError="",n.operators=[e.FilterOperator.CONTAINS,e.FilterOperator.NOT_CONTAINS,e.FilterOperator.EQUALS,e.FilterOperator.NOT_EQUALS],n.listColumns=[new e.Column("checked","Checked",45,e.ColumnType.CHECKBOX,""),new e.Column("caption",n.intl.translate("(All)"),250,e.ColumnType.STRING,"")],n._items=null,n}return l(n,t),n.prototype.init=function(){var t=this;this.selectMode=this.filter.operator===e.FilterOperator.SET,this.selectMode&&(this.filter.operator=e.FilterOperator.CONTAINS),this.listColumns[1].type=this.filter.type,setTimeout(function(){t.selectMode||(t.input.nativeElement.select(),t.input.nativeElement.focus())},50)},n.prototype.validate=function(){var t=this;this.inputError="",this.gridError="";var i=[];if(this.filter.items.splice(0,this.filter.items.length),this.selectMode){if(this.filter.operator=e.FilterOperator.SET,this.filter.items.splice(0,this.filter.items.length),0===(i=this.items.filter(function(t){return t.checked})).length)return this.gridError="Select values",!1;i.forEach(function(e){return t.filter.items.push(e.value)})}else if((this.filter.operator===e.FilterOperator.CONTAINS||this.filter.operator===e.FilterOperator.NOT_CONTAINS)&&!this.filter.value)return this.inputError="Enter value",!1;return!0},n.prototype.noText=function(){return this.selectMode||this.filter.operator===e.FilterOperator.EMPTY||this.filter.operator===e.FilterOperator.NOT_EMPTY},n.prototype.getItems=function(){var t=this;return new Promise(function(e){var i=t.filter.fieldName,n=t.state.columnByFieldName(i);t.rows.concat().sort(function(t,e){return null===t[i]?-1:null===e[i]?1:t[i]>e[i]?1:-1}).forEach(function(e){var r=e[i],o=t.state.dataSource.displayedValue(n,r,e),s=null===o?"[empty]":o;0!==t._items.length&&t._items[t._items.length-1].value===r||t._items.push({checked:t.filter.items.indexOf(r)>=0,value:r,displayedValue:o,caption:s})}),e(t._items)})},Object.defineProperty(n.prototype,"items",{get:function(){var t=this;return null===this._items&&(this._items=[],setTimeout(function(){t.getItems().then(function(e){return t.grid.updateData()})},50)),this._items},enumerable:!0,configurable:!0}),n.prototype.toggleMode=function(t){t.preventDefault(),this.selectMode=!this.selectMode},u([i.Input(),p("design:type",e.Filter)],n.prototype,"filter",void 0),u([i.Input(),p("design:type",Array)],n.prototype,"rows",void 0),u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],n.prototype,"input",void 0),u([i.ViewChild("grid",{"static":!0}),p("design:type",Object)],n.prototype,"grid",void 0),u([i.ViewChild("operatorMenu",{"static":!0}),p("design:type",B)],n.prototype,"operatorMenu",void 0),n=u([i.Component({selector:"true-filter-text",template:'<true-dialog-wrapper\r\n  [dialog]="dialog"\r\n  (btnClick)="dialogBtnClick($event)">\r\n  <true-input-wrapper #inputWrapper class="true-filter-text" [error]="inputError" [showError]="false">\r\n    <input #input\r\n      [(ngModel)]="filter.value"\r\n      [disabled]="noText()"\r\n      autofocus />\r\n  </true-input-wrapper>\r\n  <div class="true-filter-text__options">\r\n    <a\r\n      href=""\r\n      class="true-link"\r\n      tabindex="1"\r\n      [class.true-link_disabled]="selectMode"\r\n      (click)="showOM($event)">{{filter.operator | trueTranslate}}<span [class.true-turned]="operatorMenu.visible"\r\n                                                              class="true-turnable true-icon-angle-down"></span>\r\n    </a>\r\n    <true-menu #operatorMenu>\r\n      <true-menu-item *ngFor="let o of operators" (itemClick)="operator(o)">\r\n        <span [class.true-icon-ok]="filter.operator === o"></span>{{o | trueTranslate}}\r\n      </true-menu-item>\r\n    </true-menu>\r\n    <a href=""\r\n       tabindex="2"\r\n       (click)="toggleMode($event)"\r\n       class="true-link true-filter-text__mode-selector">{{\'Select\' | trueTranslate}}<span [class.true-turned]="selectMode"\r\n                                                                 class="true-turnable true-icon-angle-down"></span>\r\n    </a>\r\n  </div>\r\n  <div class="true-filter-text__items" *ngIf="selectMode">\r\n    <true-grid #grid class="true-filter-text__grid"\r\n        [class.true-error-border]="gridError"\r\n        [columns]="listColumns"\r\n        [data]="items"\r\n        [settings]="listSettings">\r\n    </true-grid>\r\n  </div>\r\n</true-dialog-wrapper>\r\n',styles:["\n    :host {\n      display: block;\n      width: 25em;\n    }\n\n    .true-filter-text {\n      display: block;\n      width: 100%;\n    }\n\n    .true-filter-text input {\n      width: 100%;\n    }\n\n    .true-filter-text__options {\n      padding: 0;\n      margin: 0.8em 0 0 0.2em;\n    }\n\n    .true-filter-text__mode-selector {\n      float: right;\n    }\n\n    p {\n      padding: 0;\n      margin: 0.6em 0 0 0;\n    }\n\n    .true-link {\n      margin: 0 0.0em 0 0;\n    }\n\n    .true-filter-text__items {\n      padding-top: 1.5em;\n    }\n\n    .true-filter-text__grid {\n      transition: border-color 0.2s ease;\n      display: block;\n      width: 100%;\n      height: 20em;\n    }\n\n    .grid-error {\n      border-color: #a00;\n    }\n  "]}),p("design:paramtypes",[h])],n)}(H),U=function(t){function n(i){var n=t.call(this,i)||this;return n.intl=i,n.inputError1="",n.inputError2="",n.operators=[e.FilterOperator.BETWEEN,e.FilterOperator.NOT_BETWEEN],n.intervals=[{id:0,name:n.intl.translate("Today")},{id:1,name:n.intl.translate("Yesterday")},{id:2,name:n.intl.translate("This week")},{id:3,name:n.intl.translate("Last week")},{id:4,name:n.intl.translate("This month")},{id:5,name:n.intl.translate("Last month")}],n.intervalColumns=[new e.Column("name","Interval name",16,e.ColumnType.STRING)],n._intervalSettings=null,n}return l(n,t),Object.defineProperty(n.prototype,"curWeek1",{get:function(){return e.Dates.firstDateOfWeek(e.Dates.today(),this.intl.locale.firstDayOfWeek)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"curWeek2",{get:function(){return e.Dates.lastDateOfWeek(e.Dates.today(),this.intl.locale.firstDayOfWeek)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prevWeek2",{get:function(){return e.Dates.lastDateOfPrevWeek(e.Dates.today(),this.intl.locale.firstDayOfWeek)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prevWeek1",{get:function(){return e.Dates.firstDateOfWeek(this.prevWeek2,this.intl.locale.firstDayOfWeek)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"curMonth1",{get:function(){return e.Dates.firstDateOfMonth(e.Dates.today())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"curMonth2",{get:function(){return e.Dates.lastDateOfMonth(e.Dates.today())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prevMonth2",{get:function(){return e.Dates.lastDateOfPrevMonth(e.Dates.today())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prevMonth1",{get:function(){return e.Dates.firstDateOfPrevMonth(e.Dates.today())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentInterval",{get:function(){var t=null;return e.Dates.equals(e.Dates.today(),this.filter.value)&&e.Dates.equals(this.filter.value,this.filter.value2)&&(t=0),e.Dates.equals(e.Dates.yesterday(),this.filter.value)&&e.Dates.equals(this.filter.value,this.filter.value2)&&(t=1),e.Dates.equals(this.curWeek1,this.filter.value)&&e.Dates.equals(this.curWeek2,this.filter.value2)&&(t=2),e.Dates.equals(this.prevWeek1,this.filter.value)&&e.Dates.equals(this.prevWeek2,this.filter.value2)&&(t=3),e.Dates.equals(this.curMonth1,this.filter.value)&&e.Dates.equals(this.curMonth2,this.filter.value2)&&(t=4),e.Dates.equals(this.prevMonth1,this.filter.value)&&e.Dates.equals(this.prevMonth2,this.filter.value2)&&(t=5),t},set:function(t){switch(t){case 0:this.filter.value=e.Dates.today(),this.filter.value2=e.Dates.today();break;case 1:this.filter.value=e.Dates.yesterday(),this.filter.value2=e.Dates.yesterday();break;case 2:this.filter.value=this.curWeek1,this.filter.value2=this.curWeek2;break;case 3:this.filter.value=this.prevWeek1,this.filter.value2=this.prevWeek2;break;case 4:this.filter.value=this.curMonth1,this.filter.value2=this.curMonth2;break;case 5:this.filter.value=this.prevMonth1,this.filter.value2=this.prevMonth2}},enumerable:!0,configurable:!0}),n.prototype.init=function(){},n.prototype.validate=function(){return this.inputError1="",this.inputError2="",this.filter.items.splice(0,this.filter.items.length),null===this.filter.value&&(this.inputError1="Enter first date"),null===this.filter.value2&&(this.inputError2="Enter second date"),""==this.inputError1&&""==this.inputError2},Object.defineProperty(n.prototype,"intervalSettings",{get:function(){return this._intervalSettings||(this._intervalSettings=e.GridSettings.minimal(),this._intervalSettings.rowHeight=this.state.st.filterItemRowHeight,this._intervalSettings.widthUnit="em",this._intervalSettings.showHeader=!1,this._intervalSettings.columnAutoWidth=!1,this._intervalSettings.dataWordWrap=!1,this._intervalSettings.appearance.enableHoverAppearance=!0,null!==this.state&&(this._intervalSettings.appearance["class"]=this.state.settings.appearance["class"],this._intervalSettings.appearance.scrollboxClass=this.state.settings.appearance.scrollboxClass)),this._intervalSettings},enumerable:!0,configurable:!0}),n.prototype.focusFirst=function(){var t=this;e.Utils.detectMobile()||setTimeout(function(){return t.datepicker1.focus()})},n.prototype.ngAfterContentInit=function(){this.focusFirst()},u([i.ViewChild("datepicker1",{"static":!0}),p("design:type",Object)],n.prototype,"datepicker1",void 0),u([i.ViewChild("datepicker2",{"static":!0}),p("design:type",Object)],n.prototype,"datepicker2",void 0),u([i.ViewChild("intervalSelector",{"static":!0}),p("design:type",E)],n.prototype,"intervalSelector",void 0),n=u([i.Component({selector:"true-filter-date",template:'<true-dialog-wrapper\r\n  [dialog]="dialog"\r\n  (btnClick)="dialogBtnClick($event)">\r\n  <div class="true-filter-date__dates">\r\n    <true-datepicker #datepicker1\r\n      pattern="date"\r\n      class="true-filter-date__datepicker"\r\n      popupPosition="ABSOLUTE"\r\n      [error]="inputError1"\r\n      [showError]="false"\r\n      [(ngModel)]="filter.value">\r\n    </true-datepicker>\r\n    <div class="true-filter-date__dash">&ndash;</div>\r\n    <true-datepicker #datepicker2\r\n      pattern="date"\r\n      class="true-filter-date__datepicker"\r\n      popupPosition="ABSOLUTE"\r\n      [error]="inputError2"\r\n      [showError]="false"\r\n      [(ngModel)]="filter.value2">\r\n    </true-datepicker>\r\n    <true-select #intervalSelector\r\n        class="true-filter-date__selector"\r\n        [(ngModel)]="currentInterval"\r\n        popupPosition="ABSOLUTE"\r\n        [valueField]="\'id\'"\r\n        [columns]="intervalColumns"\r\n        [settings]="intervalSettings"\r\n        [items]="intervals"\r\n        [parentState]="state"\r\n        [disableTextEditor]="true">\r\n    </true-select>\r\n  </div>\r\n  <div class="true-filter-date__options">\r\n    <a href=""\r\n      tabindex="-1"\r\n      class="true-link"\r\n      (click)="showOM($event)">{{filter.operator | trueTranslate}}<span [class.true-turned]="operatorMenu.visible"\r\n                                                       class="true-turnable true-icon-angle-down"></span></a>\r\n    <true-menu #operatorMenu>\r\n      <true-menu-item *ngFor="let o of operators" (itemClick)="operator(o)">\r\n        <span [class.true-icon-ok]="filter.operator === o"></span>{{o | trueTranslate}}\r\n      </true-menu-item>\r\n    </true-menu>\r\n  </div>\r\n</true-dialog-wrapper>\r\n',styles:[":host{display:block;width:35em;max-width:90vw!important}.true-filter-date__dates{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;align-content:stretch;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:baseline;align-items:baseline}.true-filter-date__datepicker{margin:.3em;display:inline-block;width:9em;-webkit-box-flex:1;flex-grow:1}.true-filter-date__dash{-webkit-box-flex:1;flex-grow:1;text-align:center}.true-filter-date__selector{margin:.3em;width:12em;-webkit-box-flex:1;flex-grow:1}.true-filter-date__options{padding:0;margin:.8em 0 0 .2em}.true-filter-date__mode-selector{float:right}.true-link{margin:0}.true-filter-date__items{padding-top:1.5em}"]}),p("design:paramtypes",[h])],n)}(H),$=function(t){function n(i,n){var r=t.call(this,n)||this;return r._renderer=i,r.intl=n,r.inputError1="",r.inputError2="",r.gridError="",r.selectMode=null,r.operators=[e.FilterOperator.BETWEEN,e.FilterOperator.NOT_BETWEEN],r.listColumns=[new e.Column("checked","Checked",32,e.ColumnType.CHECKBOX,""),new e.Column("item","(All)",300,e.ColumnType.NUMBER,""),new e.Column("group","group",5,e.ColumnType.NUMBER,"")],r.groupedColumns=[r.listColumns[2]],r}return l(n,t),n.prototype.firstFocus=function(){var t=this;setTimeout(function(){t.selectMode=t.filter.operator===e.FilterOperator.SET||null,t.input1.nativeElement.select(),t.input1.nativeElement.focus()},10)},n.prototype.init=function(){this.firstFocus()},n.prototype.validate=function(){var t=this;this.inputError1="",this.inputError2="",this.gridError="",this.filter.items.splice(0,this.filter.items.length);return null===this.filter.value&&(this.inputError1="Enter first number"),null===this.filter.value2&&(this.inputError2="Enter second number"),""==this.inputError1&&""==this.inputError2&&(this.selectMode&&(this.filter.items.splice(0,this.filter.items.length),[].filter(function(t){return t.checked}).forEach(function(e){return t.filter.items.push(e.item)})),!0)},n.prototype.getFormat=function(){return this.filter.format&&""!=this.filter.format?this.filter.format:"{1-9.0-4}"},n.prototype.getNumFormat=function(t){return""===t&&(t="{1.0-2}"),e.NumberFormat.parseFormat(t)},n.prototype.displayedValue=function(t){var i=this.getNumFormat(this.filter.format);return e.NumberParserFormatter.format(t,i,this.intl.locale.separators)},n.prototype.inputFocus=function(t){var e=t.target.value;this._renderer.setProperty(t.target,"selectionStart",0),this._renderer.setProperty(t.target,"selectionEnd",e.length)},u([i.ViewChild("input1",{"static":!0}),p("design:type",Object)],n.prototype,"input1",void 0),u([i.ViewChild("input2",{"static":!0}),p("design:type",Object)],n.prototype,"input2",void 0),u([i.ViewChild("grid",{"static":!0}),p("design:type",Object)],n.prototype,"grid",void 0),n=u([i.Component({selector:"true-filter-number",template:'<true-dialog-wrapper\r\n  [dialog]="dialog"\r\n  (btnClick)="dialogBtnClick($event)">\r\n  <div class="true-filter-number__values">\r\n    <true-input-wrapper [error]="inputError1" [showError]="false">\r\n      <input #input1 type="text"\r\n        [attr.disabled]="selectMode"\r\n        [true-mask-number]="getFormat()"\r\n        [(ngModel)]="filter.value"\r\n        (focus)="inputFocus($event)" />\r\n    </true-input-wrapper>&nbsp;&ndash;&nbsp;<true-input-wrapper [error]="inputError2" [showError]="false">\r\n      <input #input2 type="text"\r\n        [attr.disabled]="selectMode"\r\n        [true-mask-number]="getFormat()"\r\n        [(ngModel)]="filter.value2"\r\n        (focus)="inputFocus($event)" />\r\n    </true-input-wrapper>\r\n  </div>\r\n  <div class="true-filter-number__options">\r\n    <a\r\n      href=""\r\n      tabindex="-1"\r\n      class="true-link"\r\n      [class.true-link_disabled]="selectMode"\r\n      (click)="showOM($event)">{{filter.operator | trueTranslate}}<span [class.true-turned]="operatorMenu.visible"\r\n                                                       class="true-turnable true-icon-angle-down"></span></a>\r\n    <true-menu #operatorMenu>\r\n      <true-menu-item *ngFor="let o of operators" (itemClick)="operator(o)">\r\n        <span [class.true-icon-ok]="filter.operator === o"></span>{{o | trueTranslate}}\r\n      </true-menu-item>\r\n    </true-menu>\r\n  </div>\r\n</true-dialog-wrapper>\r\n',styles:[":host{display:block;width:26em}.true-filter-number__values{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:nowrap;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:baseline;align-items:baseline}.true-filter-number__values input{text-align:right;display:inline-block;width:10em;margin:0}.true-filter-number__options{padding:0;margin:.8em 0 0 .2em}.true-filter-number__mode-selector{float:right}.true-filter-number__items{padding-top:1.5em}.true-filter-number__grid{display:block;width:100%;height:16em}"]}),p("design:paramtypes",[i.Renderer2,h])],n)}(H),W=function(t){function n(e){var i=t.call(this,e)||this;return i.intl=e,i}return l(n,t),n.prototype.init=function(){var t=this;setTimeout(function(){t.cb1.nativeElement.focus()},10)},n.prototype.validate=function(){return this.filter.operator===e.FilterOperator.SET&&0===this.filter.items.length&&(this.filter.items.push(null),(this.trueValues||this.falseValues)&&this.filter.items.indexOf(null)>=0&&this.filter.items.splice(this.filter.items.indexOf(null),1)),!0},Object.defineProperty(n.prototype,"trueValues",{get:function(){return this.filter.operator===e.FilterOperator.SET?this.filter.items.indexOf(!0)>=0:!0===this.filter.value},set:function(t){var i=this.falseValues;this.filter.operator=e.FilterOperator.SET,this.filter.clearItems(),i&&this.filter.items.push(!1),t&&this.filter.items.push(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"falseValues",{get:function(){return this.filter.operator===e.FilterOperator.SET?this.filter.items.indexOf(!1)>=0:!1===this.filter.value},set:function(t){var i=this.trueValues;this.filter.operator=e.FilterOperator.SET,this.filter.clearItems(),i&&this.filter.items.push(!0),t&&this.filter.items.push(!1)},enumerable:!0,configurable:!0}),u([i.ViewChild("cb1",{"static":!0}),p("design:type",Object)],n.prototype,"cb1",void 0),n=u([i.Component({selector:"true-filter-boolean",template:'<true-dialog-wrapper\r\n  #dialogWrapper\r\n  [dialog]="dialog"\r\n  (btnClick)="dialogBtnClick($event)">\r\n  <div class="true-filter-boolean__checkboxes">\r\n    <true-checkbox-wrapper class="true-filter-boolean__cb" >\r\n      <input #cb1 type="checkbox" [(ngModel)]="trueValues" /><span caption>{{\'True\' | trueTranslate}}</span>\r\n    </true-checkbox-wrapper>\r\n    <true-checkbox-wrapper class="true-filter-boolean__cb">\r\n      <input type="checkbox" [(ngModel)]="falseValues" /><span caption>{{\'False\' | trueTranslate}}</span>\r\n    </true-checkbox-wrapper>\r\n  </div>\r\n</true-dialog-wrapper>\r\n',styles:[":host{display:block;min-width:22em}.true-filter-boolean__checkboxes{padding:.5em 0;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:nowrap;justify-content:space-around;-webkit-box-align:baseline;align-items:baseline}"]}),p("design:paramtypes",[h])],n)}(H),Y=function(){function t(t,e,n){this.state=t,this._cfResolver=e,this._changeDetector=n,this.closed=new i.EventEmitter,this.show=new i.EventEmitter,this.setFilter=new i.EventEmitter,this.resetFilter=new i.EventEmitter,this._subscribes=[]}return Object.defineProperty(t.prototype,"visible",{get:function(){return this.popup.visible},enumerable:!0,configurable:!0}),t.prototype.popupClosed=function(t){this.closed.emit(t)},t.prototype.popupShow=function(t){this.show.emit()},t.prototype.createComponent=function(t,e,i){var n=this;this.unsubscribeAll(),this.container.clear();var r,o,s,a=this._cfResolver.resolveComponentFactory(t);this._componentRef=this.container.createComponent(a),this._componentRef.instance.filter=e,this._componentRef.instance.rows=i,this._componentRef.instance.state=this.state,this._componentRef.instance.init(),r=this._componentRef.instance.closed.subscribe(function(t){return n.closePopup()}),o=this._componentRef.instance.setFilter.subscribe(function(t){n.setFilter.emit(t),n.closePopup(!0)}),s=this._componentRef.instance.resetFilter.subscribe(function(t){n.resetFilter.emit(t),n.closePopup(!1)}),this._subscribes.push(r),this._subscribes.push(o),this._subscribes.push(s)},t.prototype.showByTarget=function(t,e,i,n){this.filter=e,this.createComponent(i,e,n),this.popup.showByTarget(t,"left")},t.prototype.closePopup=function(t){void 0===t&&(t=null),this._componentRef&&(this._componentRef.destroy(),this._componentRef=null),this.popup.closePopup(t)},t.prototype.unsubscribeAll=function(){this._subscribes.forEach(function(t){return t.unsubscribe()}),this._subscribes=[]},t.prototype.ngAfterContentInit=function(){this.unsubscribeAll()},t.prototype.ngOnDestroy=function(){this.unsubscribeAll()},t.prototype.changes=function(){this._changeDetector.detectChanges()},u([i.ViewChild("popup",{"static":!0}),p("design:type",Object)],t.prototype,"popup",void 0),u([i.ViewChild("container",{read:i.ViewContainerRef,"static":!0}),p("design:type",Object)],t.prototype,"container",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"closed",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"show",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"setFilter",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"resetFilter",void 0),t=u([i.Component({selector:"true-filter-popup",template:'\n    <true-popup #popup (closed)="popupClosed($event)" (show)="popupShow($event)">\n      <template #container></template>\n    </true-popup>\n  ',styles:["\n    div {\n      position: relative;\n    }\n    "]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ComponentFactoryResolver,i.ChangeDetectorRef])],t)}(),G=function(){function t(){this.target=null,this.items=[],this.show=new i.EventEmitter,this.closed=new i.EventEmitter,this.itemClick=new i.EventEmitter}return t.prototype.menuClosed=function(t){this.closed.emit(t)},t.prototype.itemClicked=function(t){this.itemClick.emit({target:this.target,action:t}),this.finish()},t.prototype.isDivide=function(t){var e=this.items.indexOf(t);return e>0&&this.items[e-1].group!==t.group},t.prototype.start=function(t,e,i){this.finish(),this.target=i,this.items=e,this.menu.showByXY(t.clientX,t.clientY)},t.prototype.finish=function(){this.target=null,this.menu.visible&&this.menu.closePopup()},u([i.ViewChild("menu",{"static":!0}),p("design:type",B)],t.prototype,"menu",void 0),u([i.Output("show"),p("design:type",i.EventEmitter)],t.prototype,"show",void 0),u([i.Output("closed"),p("design:type",i.EventEmitter)],t.prototype,"closed",void 0),u([i.Output("itemClick"),p("design:type",i.EventEmitter)],t.prototype,"itemClick",void 0),t=u([i.Component({selector:"true-menu-starter",template:'\n    <true-menu #menu\n      (show)="show.emit($event)"\n      (closed)="menuClosed($event)">\n      <true-menu-item\n        *ngFor="let t of items; let i=index"\n        [true-divide]="isDivide(t)"\n        (itemClick)="itemClicked(t)"\n        [disabled]="t.disabled"><span [ngClass]="t.icon"></span>{{t.name | trueTranslate}}</true-menu-item>\n    </true-menu>\n  '})],t)}(),X=function(t){function r(r,s,a,l,u){var c=t.call(this)||this;return c.state=r,c.intl=s,c.elementRef=a,c.changeDetector=l,c.keyValueDiffers=u,c.destroy$=new n.Subject,c._data=null,c.maxHeight=null,c.dataQuery=new i.EventEmitter,c.queryChanged=new i.EventEmitter,c.startProcess=new i.EventEmitter,c.endProcess=new i.EventEmitter,c.headerContextMenu=new i.EventEmitter,c.customCellEvent=new i.EventEmitter,c.menuAction=new i.EventEmitter,c.uiAction=null,c._initialized=!1,c._viewInitialized=!1,c._lastUpdateTime=0,c._lastScroll={pos:-1,renderedPos:-1,time:0},c.dataUpdating=!1,c.need_recalc_page=!0,c._prevOffset=-1,c._prevLimit=-1,c._currentAppearance="",c._currentRendered=[],c.viewPortLeft=-1,c.viewPortWidth=-1,c.RC=new e.RowCalculator(c.state),c._inProcess=!1,c.intl.onLocaleChanged.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c._viewInitialized&&c.detectChanges("locale")}),c.state.events.onDataQuery.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c.dataUpdating=!0,c.dataQuery.emit(t)}),c.state.events.onDataFetch.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c._viewInitialized&&(t.resetData&&c.scrollToTop(),c.renderData())}),c.state.events.onQueryChanged.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c._initialized&&c.updateData(),c.queryChanged.emit(c.state.getQuery())}),c.state.events.onFilterShow.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){return c.showFilter(t)}),c.state.events.onSummariesChanged.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c.state.updateSummaries(),c.updateView()}),c.state.events.onHeaderContextMenu.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){if(c.state.settings.enableHeaderContextMenu){var i=c.state.settings.headerContextMenuActions,n=c.state.dataSource.sortedByField(t.column.fieldName);i.length>0&&(i.forEach(function(t){t===e.MenuAction.SORT_ASC&&(t.disabled=n&&n.sortType===e.SortType.ASC),t===e.MenuAction.SORT_DESC&&(t.disabled=n&&n.sortType===e.SortType.DESC)}),c.menuStarter.start(t.event,c.state.settings.headerContextMenuActions,t.column),c.detectChanges(),t.event.preventDefault())}c.headerContextMenu.emit(t)}),c.state.events.onCustomCellEvent.pipe(o.takeUntil(c.destroy$)).subscribe(function(t){c.customCellEvent.emit(t)}),c}return l(r,t),Object.defineProperty(r.prototype,"data",{get:function(){return null!==this._data?this._data:this.state.model},set:function(t){var e=this;null!==this._data&&t===this._data||(null!==this._data&&(this._dataSubscription.unsubscribe(),this._data=null),t instanceof n.Observable?(this._data=t,this._dataSubscription=this._data.pipe(o.takeUntil(this.destroy$)).subscribe(function(t){e.state.model=t,e.updateData()})):this.state.model!==t&&(this.state.model=t,this._initialized&&this.updateData()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"rows",{get:function(){return this.state.model},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"resultRows",{get:function(){return this.state.dataSource.resultRows},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"locale",{get:function(){return this.intl.currentLocaleName},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"columns",{get:function(){return this.state.columns},set:function(t){this.state.columns=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"settings",{get:function(){return this.state.settings},set:function(t){this.state.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"searchString",{get:function(){return this.state.dataSource.searchString},set:function(t){var e=this;this.state.dataSource.searchString!==t&&(this.state.dataSource.searchString=t,setTimeout(function(){e.state.dataSource.searchString===t&&e.updateData()},this.state.settings.searchDelay))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"displayedRows",{get:function(){return this.state.settings.customTemplate?this.displayedRows_template:this.displayedRowsCenter},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"selection",{get:function(){return this.state.selection},enumerable:!0,configurable:!0}),r.prototype._headerParts=function(){return[this.gridHeader]},Object.defineProperty(r.prototype,"headerParts",{get:function(){return this._headerParts()},enumerable:!0,configurable:!0}),r.prototype._dataParts=function(){return[this.displayedRowsCenter]},Object.defineProperty(r.prototype,"dataParts",{get:function(){return this._dataParts()},enumerable:!0,configurable:!0}),r.prototype.immediateFilter=function(t){this.state.dataSource.searchString=t,this.updateData()},Object.defineProperty(r.prototype,"visibleRows",{get:function(){if(!this.state.dataSource.resultRows)return[];if(this._prevOffset!==this.state.pageInfo.offset||this._prevLimit!==this.state.pageInfo.limit||this.need_recalc_page){this.state.lazyLoader.query(this.state.pageInfo.offset);var t=(new e.PagePipe).transform(this.state.dataSource.resultRows,this.state.pageInfo);this._prevOffset=this.state.pageInfo.offset,this._prevLimit=this.state.pageInfo.limit,this._currentRendered=t,this.need_recalc_page=!1,this.state.displayedStartIndex=this.state.pageInfo.offset}return this._currentRendered},enumerable:!0,configurable:!0}),r.prototype.saveRowHeights=function(){var t=this;this.displayedRowsCenter.forEach(function(e){var i;i=t.state.IE?e.elementRef.nativeElement.getBoundingClientRect().height:e.elementRef.nativeElement.clientHeight,t.RC.setRowHeight(t.state.dataSource.resultRowCount,e.axI+t.state.pageInfo.offset,i)})},r.prototype.updatePage=function(t,i,n){void 0===i&&(i=!1),void 0===n&&(n=null),this.viewPortLeft===this.scroller.scrollLeft&&this.viewPortWidth===this.scroller.viewPortWidth||(this.viewPortLeft=this.scroller.scrollLeft,this.viewPortWidth=this.scroller.viewPortWidth,i=!0),i||this.saveRowHeights();var r=this.state.dataSource.resultRowCount;this.state.st.lazyLoading===e.LazyLoadingMode.FRAGMENTARY&&(r=this.state.dataSource.totalRowCount);var o=this.RC.updateRenderInfo(r,this.scroller.scrollTop,this.scroller.viewPortHeight,n);(i||o)&&this.detectChanges("page")},r.prototype.updateView=function(){this.detectChanges("view"),this.state.updateLayouts(),this.updatePage("updateView",!0)},r.prototype.cellPosition=function(t,i){var n=this.resultRows.indexOf(t);return new e.CellPosition(t,n,i)},r.prototype.startSelect=function(t,e){void 0===e&&(e=!1),this.state.ui.startSelect(t,e)},r.prototype.proceedToSelect=function(t){this.state.ui.proceedToSelect(t)},r.prototype.hideHeaderBtns=function(){this.headerParts.forEach(function(t){t.hideHeaderBtns()})},r.prototype.updateDataAsync=function(t){var e=this;this.data=t,this.startProcess.emit("DataUpdate"),this.elementRef.nativeElement.classList.add("processing");var i=this.state.updateDataAsync();return i.subscribe(function(t){e.endProcess.emit("DataUpdate")}),i},r.prototype.updateData=function(t){var e=this;void 0===t&&(t=!0),this._initialized||(t=!1),this.RC.clear(),t?(this.startProcess.emit("DataUpdate"),this.elementRef.nativeElement.classList.add("processing"),setTimeout(function(){e.state.updateData(),e.endProcess.emit("DataUpdate")},1)):this.state.updateData(t)},r.prototype.updateSummaries=function(){this.state.updateSummaries(),this.updateView()},r.prototype.fetchData=function(t,e,i){void 0===i&&(i=null),this.state.fetchData(t,e,i)},r.prototype.renderData=function(){var t=this;setTimeout(function(){return t.hideHeaderBtns()}),this.dataUpdating=!1,this.elementRef.nativeElement.classList.remove("processing"),this.need_recalc_page=!0,this.updatePage("renderData",!0),this.state.settings.columnAutoWidth&&this.checkSize(),this.scroller.scrollParts()},r.prototype.updatePageByScroll=function(){this.updatePage("scroll",!1),this._lastUpdateTime=Date.now()},r.prototype.gridScroll=function(t){var i=this,n=t.target.scrollTop,r=t.target.scrollLeft,o=r-this.viewPortLeft,s=n-this._lastScroll.renderedPos;this._lastScroll.pos=n,this.RC.currentScrollPos=n;var a=!1;if(Math.abs(s)>2*this.RC.currentRH&&(a=!0),Math.abs(o)>1&&this.state.settings.renderMode===e.RenderMode.VISIBLE&&(a=!0),a&&!(this._inProcess&&this.state.iOS||r<0||n<0||n>this.scroller.scrollHeight-this.scroller.viewPortHeight)){this._inProcess=!0;var l=Date.now();this._lastScroll.renderedPos=n,this._lastScroll.time=l;var u=l-this._lastUpdateTime,c=this.state.IE?40:10;if(u<c&&!this.state.safari)return setTimeout(function(){i._lastScroll.time===l&&i.updatePageByScroll()},4*c),void(this._inProcess=!1);this.updatePageByScroll(),this._inProcess=!1}},r.prototype.gridAutoScrollX=function(t){this.gridHeader.autoScrollX(t)},r.prototype.detectChanges=function(t,i){void 0===i&&(i=!1),i?this.updateData():this.state.settings.changeDetectionMode===e.DetectionMode.MANUAL&&this.changeDetector.detectChanges()},r.prototype.displayedRowsByXY=function(t,e,i){return this.displayedRows},r.prototype.rowLayouts=function(t){var i=[];if(!t.first)return i;var n=this.state.pageInfo.offset;return t.forEach(function(t){var r=new e.RowLayout;r.index=n,r.rowComponent=t,r.clientRect=t.elementRef.nativeElement.getBoundingClientRect(),i.push(r),n++}),i},r.prototype.rowByXY=function(t,i,n){return e.RowLayout.rowByXY(this.rowLayouts(t),i,n)},r.prototype.cellByXY=function(t,e,i){void 0===i&&(i=null);var n=this.displayedRowsByXY(t,e,i),r=this.rowByXY(n,t,e);return r&&r.rowComponent?this.state.ui.cellPosition(r.rowComponent.row,r.index,r.rowComponent.cellByXY(t,e)):null},r.prototype.refreshSelection=function(t){this.dataParts.forEach(function(t){return t&&t.forEach(function(t){return t.setSelection()})}),t&&this.scrollTo(t)},r.prototype.scrollToFocused=function(){this.state.selection.focusedCell&&this.scrollTo(this.state.selection.focusedCell)},r.prototype.scrollTo=function(t){var e=this;if(t){this.saveRowHeights();var i=t.rowIndex,n=t.fieldName,r=this.scroller.scrollTop,o=this.scroller.scrollLeft,s=this.scroller.viewPortHeight,a=this.scroller.viewPortWidth,l=this.RC.getRowTop(i),u=l+this.RC.getRowHeight(i);l<r?this.scroller.scrollTo(-1,l):u>r+s&&this.scroller.scrollTo(-1,u-s),this.displayedRowsCenter.some(function(i){if(i.row===t.row){var r=i.cellHorizontalPos(n);return r&&r.l<o&&e.scroller.scrollTo(r.l),r&&r.r>o+a&&e.scroller.scrollTo(r.r-a),!0}return!1})}},r.prototype.scrollToTop=function(){this.scroller.scrollTo(-1,0)},r.prototype.toggleClass=function(t,e){t?this.elementRef.nativeElement.classList.add(e):this.elementRef.nativeElement.classList.remove(e)},r.prototype.checkParts=function(t,e,i){},r.prototype.locateRow=function(t){return this.state.locateRow(t)},r.prototype.locateByKey=function(t,e){void 0===e&&(e=""),this.state.locateByKey(t,e)},r.prototype.clearSelection=function(){this.state.clearSelection()},r.prototype.trackRow=function(t,e){return e},r.prototype.checkSize=function(t){return void 0===t&&(t=!1),this.state.checkClientWidth(this.scroller.viewPortWidth)||this.state.checkClientHeight(this.scroller.viewPortHeight)?(this.need_recalc_page=!0,this._initialized&&this.updatePage("checkSize",!0),!0):(t&&this.updatePage("checkSize2",!0),!1)},r.prototype.windowResize=function(t){this.checkSize(!0)},r.prototype.showHeaderBtn=function(t){this.headerParts.forEach(function(e){e.showHeaderBtn(t)})},r.prototype.sort=function(t,e){void 0===e&&(e=!0),this.state.sort(t,e)},r.prototype.clearSorting=function(t){void 0===t&&(t=!0),this.state.sort([],t)},r.prototype.filter=function(t,e){void 0===e&&(e=!0),this.state.filter(t,e)},r.prototype.filterToString=function(t){return t.toString(this.intl,this.state.dataSource.valueFormatter)},r.prototype.filterClosed=function(t){t||this.hideHeaderBtns()},r.prototype.setFilter=function(t){this.state.setFilter(t)},r.prototype.resetFilter=function(t){this.state.resetFilter(t)},r.prototype.getFilterComponentType=function(t){var i=z;t.type===e.ColumnType.NUMBER&&(i=$),t.type===e.ColumnType.DATETIME&&(i=U),t.type===e.ColumnType.BOOLEAN&&(i=W);var n=this.state.columnByFieldName(t.fieldName);return n?(null!==n.filterComponentType&&(i=n.filterComponentType),i):null},r.prototype.showFilter=function(t){var e=this;this.menuStarter&&this.menuStarter.finish();var i="SPAN"===t.target.tagName?t.target.parentElement:t.target;if(this.filterPopup.visible){if(this.filterPopup.filter.fieldName===t.filter.fieldName)return void this.filterPopup.closePopup();this.filterPopup.closePopup()}this.hideHeaderBtns(),this.showHeaderBtn(t.filter.fieldName);var n=this.getFilterComponentType(t.filter);null!==n&&setTimeout(function(){e.filterPopup.showByTarget(i,t.filter,n,e.state.model)},10)},r.prototype.focus=function(){this.scroller.focus()},Object.defineProperty(r.prototype,"appearanceClass",{get:function(){return this.state.sta["class"]},enumerable:!0,configurable:!0}),r.prototype.setAppearance=function(){var t=this.appearanceClass;t!==this._currentAppearance&&(""!==this._currentAppearance&&this.elementRef.nativeElement.classList.remove(this._currentAppearance),this.elementRef.nativeElement.classList.add(t),this._currentAppearance=t)},r.prototype.menuItemClick=function(t){var i=t.target,n=t.action;n!==e.MenuAction.SORT_ASC?n!==e.MenuAction.SORT_DESC?n!==e.MenuAction.HIDE?this.menuAction.emit(t):this.state.hideColumn(i):this.sort([new e.SortInfo(i.fieldName,e.SortType.DESC)]):this.sort([new e.SortInfo(i.fieldName,e.SortType.ASC)])},r.prototype.ngOnInit=function(){this.state.settings.changeDetectionMode===e.DetectionMode.MANUAL&&this.changeDetector.detach(),this.setAppearance(),(this.state.iOS||this.state.android)&&this.elementRef.nativeElement.classList.add("true-fix-touch"),this.state.IE&&this.elementRef.nativeElement.classList.add("true-fix-ie"),this._settingsDiffer=this.keyValueDiffers.find(this.state.settings).create(),this._appearanceDiffer=this.keyValueDiffers.find(this.state.settings.appearance).create(),this._settingsDiffer.diff(this.state.settings),this._appearanceDiffer.diff(this.state.settings.appearance),this.updateData(),this._initialized=!0},r.prototype.ngAfterContentInit=function(){},r.prototype.ngAfterViewInit=function(){var t=this;this.state.checkClientWidth(this.scroller.viewPortWidth);var e=this.scroller.viewPortHeight;e<=this.state.settings.rowHeight?setTimeout(function(){return t.renderData()}):this.renderData(),this.state.checkClientHeight(e),this.addTouchListeners(this.gridData.nativeElement),this.addWindowResizeListener(),this._viewInitialized=!0},r.prototype.doCheckParts=function(){this.filterPopup&&this.filterPopup.visible&&this.filterPopup.changes()},r.prototype.ngDoCheck=function(){this.doCheckParts();var t=this._settingsDiffer.diff(this.state.settings),e=this._appearanceDiffer.diff(this.state.settings.appearance);if((t||e)&&this._viewInitialized)return this.setAppearance(),void(this.checkSize()||this.updateView());this.state.checkClientHeight(this.scroller.viewPortHeight)&&this._viewInitialized&&this.updatePage()},r.prototype.ngOnDestroy=function(){this.destroy$.next(!0),this.destroy$.unsubscribe(),t.prototype.ngOnDestroy.call(this)},u([i.Input("data"),p("design:type",Object),p("design:paramtypes",[Object])],r.prototype,"data",null),u([i.Input("columns"),p("design:type",Array),p("design:paramtypes",[Array])],r.prototype,"columns",null),u([i.Input("settings"),p("design:type",e.GridSettings),p("design:paramtypes",[e.GridSettings])],r.prototype,"settings",null),u([i.Input("maxHeight"),p("design:type",Number)],r.prototype,"maxHeight",void 0),u([i.Input("searchString"),p("design:type",String),p("design:paramtypes",[String])],r.prototype,"searchString",null),u([i.Output("dataQuery"),p("design:type",i.EventEmitter)],r.prototype,"dataQuery",void 0),u([i.Output("queryChanged"),p("design:type",i.EventEmitter)],r.prototype,"queryChanged",void 0),u([i.Output(),p("design:type",i.EventEmitter)],r.prototype,"startProcess",void 0),u([i.Output(),p("design:type",i.EventEmitter)],r.prototype,"endProcess",void 0),u([i.Output(),p("design:type",i.EventEmitter)],r.prototype,"headerContextMenu",void 0),u([i.Output(),p("design:type",i.EventEmitter)],r.prototype,"customCellEvent",void 0),u([i.Output(),p("design:type",i.EventEmitter)],r.prototype,"menuAction",void 0),u([i.ViewChild("menuStarter",{"static":!0}),p("design:type",G)],r.prototype,"menuStarter",void 0),u([i.ViewChild("filterPopup",{"static":!1}),p("design:type",Y)],r.prototype,"filterPopup",void 0),u([i.ViewChild("scroller",{"static":!0}),p("design:type",D)],r.prototype,"scroller",void 0),u([i.ViewChild("grid",{"static":!0}),p("design:type",Object)],r.prototype,"grid",void 0),u([i.ViewChild("gridHeader",{"static":!0}),p("design:type",Object)],r.prototype,"gridHeader",void 0),u([i.ViewChild("gridData",{"static":!0}),p("design:type",Object)],r.prototype,"gridData",void 0),u([i.ViewChild("dragItem",{"static":!0}),p("design:type",Object)],r.prototype,"dragItem",void 0),u([i.ContentChildren(j),p("design:type",i.QueryList)],r.prototype,"displayedRows_template",void 0),u([i.ViewChildren("displayedRows",{read:j}),p("design:type",i.QueryList)],r.prototype,"displayedRowsCenter",void 0),u([i.ViewChild("customTemplate",{"static":!0}),p("design:type",Object)],r.prototype,"customTemplate",void 0),r=u([i.Component({selector:"true-grid-view",template:'<true-menu-starter #menuStarter (itemClick)="menuItemClick($event)"></true-menu-starter>\r\n\x3c!-- Filter popup --\x3e\r\n<true-filter-popup #filterPopup *ngIf="state.settings.allowFilter"\r\n  (setFilter)="setFilter($event)"\r\n  (resetFilter)="resetFilter($event)"\r\n  (closed)="filterClosed($event)">\r\n</true-filter-popup>\r\n\x3c!-- Scroll manager --\x3e\r\n<true-scroller #scroller\r\n  tabindex="0"\r\n  (autoscrollx)="gridAutoScrollX($event)"\r\n  (scroll)="gridScroll($event)">\r\n  \x3c!-- Заголовки --\x3e\r\n  <true-grid-header #gridHeader true-header\r\n    [ngClass]="state.settings.appearance.headerAreaClass"\r\n    [layout]="state.layout"\r\n    [scroller]="scroller">\r\n  </true-grid-header>\r\n  <div true-data [ngClass]="settings.appearance.getDataClass()">\r\n    <table #gridData class="true-grid-data"\r\n          [class.true-grid-data_fixed-height]="state.settings.fixedRowHeight"\r\n          [style.width]="state.layout.dataWidth">\r\n      <colgroup>\r\n        \x3c!-- Level columns --\x3e\r\n        <col *ngFor="let c of state.layout.levelColumns" [style.width]="state.st.levelWidth" />\r\n        \x3c!-- Data columns --\x3e\r\n        <col *ngFor="let c of state.layout.columns" [style.width]="c.displayedWidthU" />\r\n      </colgroup>\r\n\r\n      <tbody *ngIf="!state.st.customTemplate">\r\n        <tr *ngFor="let r of RC.ghostRows(\'start\'); trackBy: RC.trackGhostRowStart" [style.height.px]="r.H" style="border:0">\r\n          <td [style.height.px]="r.H" style="padding:0; border-right: 0;">&nbsp;</td>\r\n        </tr>\r\n\r\n        <tr *ngFor="let r of visibleRows; let i=index; trackBy: trackRow;"\r\n            true-row\r\n            [row]="r"\r\n            [true-locale]="locale"\r\n            [true-layout]="state.layout"\r\n            [true-state]="state"\r\n            [true-i]="i"\r\n            [style.height.px]="state.settings.rowHeight"\r\n            #displayedRows>\r\n        </tr>\r\n        <tr *ngFor="let r of RC.ghostRows(\'end\')" [style.height.px]="r.H">\r\n          <td [style.height.px]="r.H" style="padding:0; border-right: 0;">&nbsp;</td>\r\n        </tr>\r\n        <tr *ngIf="visibleRows.length === 0"><td style="border: 0;"></td></tr>\r\n      </tbody>\r\n       \x3c!-- User\'s template --\x3e\r\n      <ng-content *ngIf="state.st.customTemplate" select="[true-body]"></ng-content>\r\n    </table>\r\n  </div>\r\n  \x3c!-- Footer --\x3e\r\n  <true-grid-footer #gridFooter true-footer [layout]="state.layout"></true-grid-footer>\r\n</true-scroller>\r\n',providers:[{provide:"gridState",useClass:m}],styles:[":host{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.true-grid{box-sizing:border-box;height:100%;width:100%}.true-grid-data{box-sizing:border-box;table-layout:fixed;border-spacing:0;border-collapse:collapse;outline:0}.true-grid-data td{overflow-x:hidden;overflow-y:hidden}.true-grid-drop-marker{box-sizing:border-box;visibility:hidden;position:fixed;width:3px;border:1px solid #757779;background-color:rgba(255,255,255,.05);pointer-events:none;z-index:7}.true-grid-data_fixed-height td:not(.true-cell-indent){white-space:nowrap}.true-grid-data_fixed-height td:not(.true-cell-indent):not(.true-cell-checkbox){text-overflow:ellipsis}.true-cell-checkbox.true-check-by-click{cursor:pointer}.true-grid-drag-item{visibility:hidden;position:fixed;overflow-x:hidden;text-overflow:ellipsis;pointer-events:none;z-index:8}::ng-deep .true-grid-btn{cursor:pointer;align-self:stretch;visibility:hidden;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;flex-shrink:0}::ng-deep .true-grid-btn span{display:inline-block}::ng-deep .true-align-right{text-align:right}::ng-deep .true-align-center{text-align:center}::ng-deep .true-align-left{text-align:left!important}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,h,i.ElementRef,i.ChangeDetectorRef,i.KeyValueDiffers])],r)}(P),Q=function(t){function n(e,n,r,s,a){var l=t.call(this,e,n,r,s,a)||this;return l.state=e,l.intl=n,l.elementRef=r,l.changeDetector=s,l.keyValueDiffers=a,l.rowMouseDown=new i.EventEmitter,l.rowMouseUp=new i.EventEmitter,l.rowClick=new i.EventEmitter,l.cellClick=new i.EventEmitter,l.rowDblClick=new i.EventEmitter,l.rowKeyDown=new i.EventEmitter,l.contextMenu=new i.EventEmitter,l.selectionChanged=new i.EventEmitter,l.checkedChanged=new i.EventEmitter,l.rowDrag=new i.EventEmitter(!1),l.rowDragged=new i.EventEmitter(!1),l._cellTouched=null,l._cellTouchedScrollPos={X:0,Y:0},l._dragColumn=!1,l._drag_x0=-1,l._drag_y0=-1,l._lastSel=0,l._paging=!1,l.state.events.onRowUnfiltered.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){setTimeout(function(){l.state.dataSource.removeResultRow(t)&&(l.state.layoutsHandler.updateSelectionIndices(),l.need_recalc_page=!0,l.updatePage("rowUnfiltered"))},100)}),l.state.events.onColumnsChanged.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){l.RC.clear(),l.checkSize(!0)}),l.state.events.onDrag.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){return l.dragColumn(t)}),l.state.events.onDrop.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){return l.dropColumn(t)}),l.state.events.onSelect.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){l.refreshSelection(t),l.selectionChanged.emit(l.state.selection)}),l.state.events.onValueChanged.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){return l.detectChanges("valueChanged")}),l.state.events.onCheckedChanged.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){return l.checkedChanged.emit(t)}),l.state.events.onStartEditing.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){return l.detectChanges("startEditing")}),l.state.events.onStopEditing.pipe(o.takeUntil(l.destroy$)).subscribe(function(t){l.detectChanges(),t&&l.state.settings.autoFocusAfterEditor&&l.focus()}),l}return l(n,t),Object.defineProperty(n.prototype,"isDragging",{get:function(){return this._dragColumn},enumerable:!0,configurable:!0}),n.prototype.startAction=function(t,i,n,r,o,s,a){if(void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=0),t&&t.row){this.scroller.prepareAutoScroll();var l=this.state.ui.startAction(t,o,s,a);l&&(this.uiAction=new e.UIAction(l,null,i,n),this.addDocumentMouseListeners())}},n.prototype.touchStart=function(t){if(this._lastScroll.time>0&&Date.now()-this._lastScroll.time<50)return;t.stopPropagation();var e=t.changedTouches;1===e.length&&(this._cellTouched=this.cellByXY(e[0].clientX,e[0].clientY),this._cellTouchedScrollPos={X:this.scroller.scrollLeft,Y:this.scroller.scrollTop})},Object.defineProperty(n.prototype,"touchScroll",{get:function(){return this._cellTouchedScrollPos.X!==this.scroller.scrollLeft||this._cellTouchedScrollPos.Y!==this.scroller.scrollTop},enumerable:!0,configurable:!0}),n.prototype.touchEnd=function(t){var i=t.changedTouches;if(i.length>=1){var n=this.cellByXY(i[0].clientX,i[0].clientY);if(null!==n&&n.equals(this._cellTouched)&&!this.touchScroll){if(this.state.settings.checkByCellClick&&this.state.check.canToggleCheck(n))this.state.ui.toggleCheck(n.row,n.fieldName);else{if(n.equals(this.state.selection.focusedCell))return this.state.ui.startAction(this._cellTouched,!1,!0),void t.stopPropagation();this.startAction(n,i[0].clientX,i[0].clientY,e.GridPart.CENTER,!1,!0)}this.state.ui.endSelect(n,!0)}}t.stopPropagation()},n.prototype.dataMouseDown=function(t){if(!this._cellTouched&&(this.rowMouseDown.emit(t),!t.defaultPrevented)){var i=this.cellByXY(t.clientX,t.clientY);if(this.state.ui.mouseDown(i,!1,t.button))return;this.startAction(i,t.clientX,t.clientY,e.GridPart.CENTER,t.ctrlKey,!1,t.button)}},n.prototype.doRowClick=function(t){this.state.ui.click(this.cellByXY(t.clientX,t.clientY))&&(t.stopPropagation(),t.preventDefault())},n.prototype.dataContextMenu=function(t){if(this.settings.enableDataContextMenu&&this.settings.dataContextMenuActions.length>0)return this.menuStarter.start(t,this.state.settings.dataContextMenuActions,"selection"),this.detectChanges(),void t.preventDefault();this.contextMenu.emit(new e.ContextMenuEvent(this.cellByXY(t.clientX,t.clientY),t))},n.prototype.dataRowClick=function(t,i){this.rowClick.emit(new e.RowClickEvent(i,t)),this.cellClick.emit(new e.CellClickEvent(this.cellByXY(t.clientX,t.clientY),t)),this._cellTouched?this._cellTouched=null:this.doRowClick(t)},n.prototype.dataRowDblClick=function(t,i){this.rowDblClick.emit(new e.RowClickEvent(i,t)),this.state.ui.dblClick(t,i)},n.prototype.processKey=function(t){var i=this;if(this.rowKeyDown.emit(t),!t.defaultPrevented){var n=t.keyCode;if(n===e.Keys.SPACE&&this.state.selection.focusedRow){var r=this.state.check.firstCheckableField();if(""!==r)return this.toggleCheckbox({row:this.state.selection.focusedRow,fieldName:r}),!0}var o=this.state.dataSource.resultRows.indexOf(this.state.selection.focusedRow);if(!this.state.st.fixedRowHeight&&(n===e.Keys.PAGE_DOWN||n===e.Keys.PAGE_UP)){if(this._paging)return!0;var s={fwd:4,back:4};return n===e.Keys.PAGE_DOWN?s.fwd=this.scroller.viewPortHeight/this.RC.currentRH+1:n===e.Keys.PAGE_UP&&(s.back=this.scroller.viewPortHeight/this.RC.currentRH+1),this.updatePage("keydown",!0,s),this._paging=!0,setTimeout(function(){var e=i.RC.pageCapacity(o,i.scroller.viewPortHeight,i.state.dataSource.resultRows.length);i.state.ui.processKey(e,t)&&t.stopPropagation(),i._paging=!1},50),!0}var a=this.RC.pageCapacity(o,this.scroller.viewPortHeight,this.state.dataSource.resultRows.length);return this.state.ui.processKey(a,t)}},n.prototype.dataKeyDown=function(t){this.processKey(t)&&(t.preventDefault(),t.stopPropagation())},n.prototype.checkAll=function(t){this.state.check.setColumnCheck(this.state.columnCollection.columnByFieldName(t),!0)},n.prototype.uncheckAll=function(t){this.state.check.setColumnCheck(this.state.columnCollection.columnByFieldName(t),!1)},n.prototype.doSelect=function(t){var e=this.cellByXY(t.clientX,t.clientY);e&&""!==e.fieldName&&this.state.ui.proceedToSelect(e),this.scroller.checkAutoScrollX(t.clientX),this.scroller.checkAutoScrollY(t.clientY)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.state.selection},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedData",{get:function(){return this.state.getSelectedData(this.selection).result},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"draggedRows",{get:function(){if(this.uiAction&&this.uiAction.target){if(null===this.uiAction.renderTarget){this.uiAction.renderTarget=[];for(var t=0;t<3&&t<this.uiAction.target.length;t++)this.uiAction.renderTarget.unshift(this.uiAction.target[t])}return this.uiAction.renderTarget}return[]},enumerable:!0,configurable:!0}),n.prototype.getDragTransform=function(t){var e=this.draggedRows.length;return"matrix("+Math.pow(.97,e-t-1)+", 0, 0, 1, "+-40+", "+(-t*this.state.settings.rowHeight+7*(e-t-1)-40)+")"},n.prototype.getDragWidth=function(){var t=0;return this.state.layoutDrag.columns.forEach(function(e){return t+=e.width}),t+this.state.settings.widthUnit},n.prototype.checkRowDrag=function(t){if(!this.state.settings.rowDrag)return!1;if(this.uiAction.action===e.UIActionType.ROW_DRAG)return!1;var i=t.clientX,n=t.clientY;return(Math.abs(i-this.uiAction.x)>9||Math.abs(n-this.uiAction.y)>9)&&(this.startDragRows(),!0)},n.prototype.startDragRows=function(){this.uiAction.action=e.UIActionType.ROW_DRAG,this.state.dragDrop.setDragItem(this.uiAction),this.setDragPosition(this.uiAction),this.detectChanges(),this.dragInProcess(!0),this.dragItem.nativeElement.style.visibility="visible"},n.prototype.specifyDropPosition=function(t,e,i){return t},n.prototype.dropInfo=function(t){var i=e.RowLayout.rowPosByXY(this.rowLayouts(this.displayedRows),t.clientX,t.clientY,this.state.isTree),n=i.rl;if(!n)return null;var r=this.scroller.centerRect,o=n.rowComponent.firstCellRect();i=this.specifyDropPosition(i,o.left,t);var s=this.state.canDrop(this.uiAction.target,n.rowComponent.row,i.pos),a=null;""!==s&&(a=n.rowComponent.row,i.pos=s);var l=("before"!==i.pos?n.clientRect.bottom:n.clientRect.top)-1,u=o.left,c=2,p=n.clientRect.width-(u-r.left);"last"===i.pos&&(u-=this.state.settings.levelIndent,p+=this.state.settings.levelIndent),"in"===i.pos&&(l-=n.clientRect.height-3,c=n.clientRect.height-6),u<r.left&&(u=r.left),u+p>n.clientRect.right&&(p=n.clientRect.right-u);var h=new DOMRect(u,l,p,c);return h.top<r.top-1||h.top>=r.bottom?null:{dropTarget:a,rowPosition:i,pos:i.pos,markerRect:h}},n.prototype.dragRows=function(t){this.uiAction.move(t.clientX,t.clientY),this.setDragPosition(this.uiAction);var e=this.dropInfo(t);return null===e||null===e.dropTarget?(this.toggleClass(!0,"true-drag-not-allowed"),this.toggleClass(!1,"true-drag-allowed"),this.hideMarker()):(this.showMarker(e.markerRect.left,e.markerRect.top,e.markerRect.width,e.markerRect.height,!0),this.toggleClass(!1,"true-drag-not-allowed"),this.toggleClass(!0,"true-drag-allowed")),this.scroller.checkAutoScrollY(t.clientY),e?e.rowPosition:null},n.prototype.endDragRows=function(t){this.hideMarker(),this.scroller.stopAutoScroll(),this.toggleClass(!1,"true-drag-not-allowed"),this.toggleClass(!1,"true-drag-allowed"),this.dragItem.nativeElement.style.visibility="hidden",this.dragInProcess(!1);var i=this.dropInfo(t);if(i&&i.dropTarget){var n=new e.RowDragEvent(this.uiAction.target,i.dropTarget,i.pos);this.rowDrag.emit(n),n.isCanceled||(this.state.moveRows(this.uiAction.target,i.dropTarget,i.pos),this.rowDragged.emit(n))}},n.prototype.documentMouseMove=function(i){if(t.prototype.documentMouseMove.call(this,i),this.uiAction){if(i.clientX===this.uiAction.x&&i.clientY===this.uiAction.y)return;if(this.checkRowDrag(i))return;if(this.uiAction.action===e.UIActionType.ROW_DRAG&&this.dragRows(i),this.uiAction.action===e.UIActionType.SELECT){if(Date.now()-this._lastSel<(this.state.IE?70:0))return;this._lastSel=Date.now(),this.doSelect(i),i.preventDefault(),i.stopPropagation()}}},n.prototype.documentMouseUp=function(i){if(this.uiAction.action===e.UIActionType.ROW_DRAG&&this.endDragRows(i),this.uiAction.action===e.UIActionType.SELECT){var n=this.cellByXY(i.clientX,i.clientY);n&&""!==n.fieldName&&(this.state.ui.endSelect(n,!1,i.button),this.focus())}t.prototype.documentMouseUp.call(this,i),this.rowMouseUp.emit(i),this.scroller.stopAutoScroll(),this.uiAction=null},n.prototype.resizeInProcess=function(t){this.toggleClass(t,"true-resize-in-process")},n.prototype.dragInProcess=function(t){this.toggleClass(t,"true-drag-in-process")},n.prototype.showMarker=function(t,e,i,n,r){this.dropMarker.nativeElement.style.top=e+"px",this.dropMarker.nativeElement.style.left=t+"px",this.dropMarker.nativeElement.style.width=i+"px",this.dropMarker.nativeElement.style.height=n+"px",this.dropMarker.nativeElement.style.visibility="visible"},n.prototype.hideMarker=function(){this.dropMarker.nativeElement.style.visibility="hidden"},n.prototype.proceedToResizeColumn=function(t){var e=this.scroller.clientRect,i=t.x;i>e.left&&i<e.right?this.showMarker(i,e.top+1,1,e.height-2):this.hideMarker(),t.x<e.left?this.scroller.scrollSpeedX=-this.state.st.autoScrollStep:t.x>e.right?this.scroller.scrollSpeedX=this.state.st.autoScrollStep:this.scroller.scrollSpeedX=0},n.prototype.resizeColumn=function(t){if("start"!==t.action)return"end"===t.action?(this.hideMarker(),void this.resizeInProcess(!1)):void this.proceedToResizeColumn(t.ui);this.resizeInProcess(!0)},n.prototype.setDragPosition=function(t){var e=this.state.iOS?window.pageYOffset:0;this.dragItem.nativeElement.style.left=t.x+t.targetOffsetX+"px",this.dragItem.nativeElement.style.top=e+t.y+t.targetOffsetY+"px"},n.prototype.isDragColumn=function(){return this._dragColumn},n.prototype.startDragColumn=function(t){this.filterPopup&&this.filterPopup.visible&&this.filterPopup.closePopup(),this._dragColumn=!0,this.scroller.prepareAutoScroll(),this.state.dragDrop.setDragItem(t),this.detectChanges("dragColumn"),this.setDragPosition(t),this.dragItem.nativeElement.style.visibility="visible",this.dragInProcess(!0)},n.prototype.commitDrag=function(){this.checkSize(),this.need_recalc_page=!0},n.prototype.dragColumn=function(t){if(this._dragColumn){if(this.setDragPosition(t),!(Math.abs(t.x-this._drag_x0)<5&&Math.abs(t.y-this._drag_y0)<5)){this._drag_x0=t.x,this._drag_y0=t.y;var i=null;this.headerParts.forEach(function(e){e&&!i&&(i=e.canDrop(t,!1))}),i&&(t.target instanceof e.ColumnBand?this.state.reorderBand(t.target,i):this.state.reorderColumn(t.target,i,!1),this.commitDrag());var n=this.scroller.checkAutoScrollX(t.x);this.checkParts(t.x,n,t.target)}}else this.startDragColumn(t)},n.prototype.dropColumn=function(t){var e=this;this._dragColumn=!1,this.scroller.stopAutoScroll(),this.dragItem.nativeElement.style.visibility="hidden";var i=null;this.headerParts.forEach(function(e){!i&&e&&(i=e.canDrop(t,!1))}),i?this.state.reorderColumn(t.target,i):this.state.fixDrag(t.target),this.state.dragDrop.clearDragItem(),this.dragInProcess(!1),setTimeout(function(){e.state.layoutsHandler.setLayoutsVisibility(),e.updatePage("dropColumn",!0),e.checkSize()},100)},n.prototype.toggleCheckbox=function(t){this.state.ui.toggleCheck(t.row,t.fieldName,t.value)},n.prototype.toggleCheckColumn=function(t){this.state.ui.toggleCheckColumn(t)},n.prototype.setAppearance=function(){t.prototype.setAppearance.call(this),this.dragItem.nativeElement.classList.add(this.state.sta.dragItemClass)},u([i.Output("rowMouseDown"),p("design:type",i.EventEmitter)],n.prototype,"rowMouseDown",void 0),u([i.Output("rowMouseUp"),p("design:type",i.EventEmitter)],n.prototype,"rowMouseUp",void 0),u([i.Output("rowClick"),p("design:type",i.EventEmitter)],n.prototype,"rowClick",void 0),u([i.Output("cellClick"),p("design:type",i.EventEmitter)],n.prototype,"cellClick",void 0),u([i.Output("rowDblClick"),p("design:type",i.EventEmitter)],n.prototype,"rowDblClick",void 0),u([i.Output("rowKeyDown"),p("design:type",i.EventEmitter)],n.prototype,"rowKeyDown",void 0),u([i.Output("contextMenu"),p("design:type",i.EventEmitter)],n.prototype,"contextMenu",void 0),u([i.Output("selectionChanged"),p("design:type",i.EventEmitter)],n.prototype,"selectionChanged",void 0),u([i.Output("checkedChanged"),p("design:type",i.EventEmitter)],n.prototype,"checkedChanged",void 0),u([i.Output(),p("design:type",i.EventEmitter)],n.prototype,"rowDrag",void 0),u([i.Output(),p("design:type",i.EventEmitter)],n.prototype,"rowDragged",void 0),u([i.ViewChild("dropMarker",{"static":!0}),p("design:type",Object)],n.prototype,"dropMarker",void 0),n=u([i.Component({selector:"true-grid",template:'<div #dropMarker class="true-grid-drop-marker"></div>\r\n\r\n<true-menu-starter #menuStarter (itemClick)="menuItemClick($event)"></true-menu-starter>\r\n\x3c!-- всплывающее окно для фильтров --\x3e\r\n<true-filter-popup #filterPopup *ngIf="state.settings.allowFilter"\r\n  (setFilter)="setFilter($event)"\r\n  (resetFilter)="resetFilter($event)"\r\n  (closed)="filterClosed($event)">\r\n</true-filter-popup>\r\n\x3c!-- Элемент, который перетаскивается мышью, при reordering columns --\x3e\r\n<div #dragItem true-drag-item class="true-grid-drag-item">\r\n  <true-grid-header *ngIf="isDragColumn()"\r\n    [ngClass]="state.settings.appearance.headerAreaClass"\r\n    [layout]="state.layoutDrag"></true-grid-header>\r\n  <div *ngIf="!isDragColumn()" class="true-drag-data" [ngClass]="settings.appearance.getDataClass()">\r\n    <table *ngFor="let r of draggedRows; let i=index"\r\n           [style.transform]="getDragTransform(i)"\r\n           [style.width]="getDragWidth()"\r\n           class="true-grid-data true-grid-data_fixed-height">\r\n      <colgroup>\r\n        <col *ngFor="let c of state.layoutDrag.columns" [style.width]="c.displayedWidthU" />\r\n      </colgroup>\r\n      <tbody>\r\n        <tr true-row\r\n            [row]="r"\r\n            [true-layout]="state.layoutDrag"\r\n            [true-state]="state"\r\n            [true-i]="i"\r\n            [style.height.px]="state.settings.rowHeight">\r\n        </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n</div>\r\n\x3c!-- Компонент, осуществляющий синхронный скроллинг данных и всех сопутствующих элементов --\x3e\r\n<true-scroller #scroller\r\n  tabindex="-1"\r\n  [maxHeight]="maxHeight"\r\n  (keydown)="dataKeyDown($event)"\r\n  (autoscrollx)="gridAutoScrollX($event)"\r\n  (scroll)="gridScroll($event)">\r\n  \x3c!-- Заголовки --\x3e\r\n  <true-grid-header #gridHeader true-header\r\n    [layout]="state.layout"\r\n    [scroller]="scroller"\r\n    (toggleCheckColumn)="toggleCheckColumn($event)"\r\n    (resizeColumn)="resizeColumn($event)">\r\n  </true-grid-header>\r\n  \x3c!-- Основная часть данных --\x3e\r\n  <div true-data [ngClass]="settings.appearance.getDataClass()">\r\n    <table #gridData class="true-grid-data"\r\n          [class.true-grid-data_fixed-height]="state.settings.fixedRowHeight"\r\n          [style.width]="state.layout.dataWidth"\r\n          (mousedown)="dataMouseDown($event)">\r\n      <colgroup>\r\n        \x3c!-- группировка и деревья --\x3e\r\n        <col *ngFor="let c of state.layout.levelColumns" [style.width]="state.st.levelWidth" />\r\n        \x3c!-- данные --\x3e\r\n        <col *ngFor="let c of state.layout.columns" [style.width]="c.displayedWidthU" />\r\n      </colgroup>\r\n\r\n      <tbody *ngIf="!state.st.customTemplate">\r\n        <tr *ngFor="let r of RC.ghostRows(\'start\'); trackBy: RC.trackGhostRowStart" [style.height.px]="r.H" style="border:0">\r\n          <td [style.height.px]="r.H" style="padding:0; border-right: 0;">&nbsp;</td>\r\n        </tr>\r\n        <tr *ngFor="let r of visibleRows; let i=index; trackBy: trackRow;"\r\n            true-row\r\n            [view-port-left]="viewPortLeft"\r\n            [view-port-width]="viewPortWidth"\r\n            [row]="r"\r\n            [true-locale]="locale"\r\n            [true-layout]="state.layout"\r\n            [true-state]="state"\r\n            [true-i]="i"\r\n            [style.height.px]="state.settings.rowHeight"\r\n            (toggleCheckbox)="toggleCheckbox($event)"\r\n            (click)="dataRowClick($event, r)"\r\n            (contextmenu)="dataContextMenu($event)"\r\n            (dblclick)="dataRowDblClick($event, r)"\r\n            #displayedRows>\r\n        </tr>\r\n        <tr *ngFor="let r of RC.ghostRows(\'end\')" [style.height.px]="r.H">\r\n          <td [style.height.px]="r.H" style="padding:0; border-right: 0;">&nbsp;</td>\r\n        </tr>\r\n        \x3c!--<tr *ngIf="visibleRows.length === 0"><td style="border: 0;"></td></tr>--\x3e \x3c!-- Вынести в стили --\x3e\r\n      </tbody>\r\n       \x3c!-- User\'s template --\x3e\r\n      <ng-content *ngIf="state.st.customTemplate" select="[true-body]"></ng-content>\r\n    </table>\r\n  </div>\r\n  \x3c!-- Footer --\x3e\r\n  <true-grid-footer #gridFooter true-footer [layout]="state.layout"></true-grid-footer>\r\n</true-scroller>\r\n',providers:[{provide:"gridState",useClass:m}],styles:[":host{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.true-grid{box-sizing:border-box;height:100%;width:100%}.true-grid-data{box-sizing:border-box;table-layout:fixed;border-spacing:0;border-collapse:collapse;outline:0}.true-grid-data td{overflow-x:hidden;overflow-y:hidden}.true-grid-drop-marker{box-sizing:border-box;visibility:hidden;position:fixed;width:3px;border:1px solid #757779;background-color:rgba(255,255,255,.05);pointer-events:none;z-index:7}.true-grid-data_fixed-height td:not(.true-cell-indent){white-space:nowrap}.true-grid-data_fixed-height td:not(.true-cell-indent):not(.true-cell-checkbox){text-overflow:ellipsis}.true-cell-checkbox.true-check-by-click{cursor:pointer}.true-grid-drag-item{visibility:hidden;position:fixed;overflow-x:hidden;text-overflow:ellipsis;pointer-events:none;z-index:8}::ng-deep .true-grid-btn{cursor:pointer;align-self:stretch;visibility:hidden;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;flex-shrink:0}::ng-deep .true-grid-btn span{display:inline-block}::ng-deep .true-align-right{text-align:right}::ng-deep .true-align-center{text-align:center}::ng-deep .true-align-left{text-align:left!important}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,h,i.ElementRef,i.ChangeDetectorRef,i.KeyValueDiffers])],n)}(X),q=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r._elementRef=e,r._renderer=n,r.displayValue="",r.dataQuery=new i.EventEmitter,r._focusedValue=null,r._valueField=null,r._displayField=null,r.columns=[],r.parentState=null,r._settings=null,r.itemSelect=new i.EventEmitter,r._onGrid=!1,r._empty=!1,r._updating=!1,r.useAltDown=!1,r}var o;return l(n,t),o=n,Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(t){t!==this._value&&(this._value=t,this.writeValue(this._value),this.onChange(t))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueField",{get:function(){return null===this._valueField&&this.columns.length>0?this.columns[0].fieldName:null===this._valueField?"id":this._valueField},set:function(t){this._valueField=t,this._settings&&(this._settings.keyField=this._valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayField",{get:function(){return null===this._displayField&&this.columns.length>0?this.columns[0].fieldName:null===this._displayField?"name":this._displayField},set:function(t){this._displayField=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"settings",{get:function(){return this._settings||(this._settings=e.GridSettings.minimal(),this._settings.keyField=this.valueField,this._settings.widthUnit="em",this._settings.showHeader=!1,this._settings.columnAutoWidth=!1,this._settings.enableTouchScroll=!1,this._settings.appearance.enableHoverAppearance=!0),this._settings},set:function(t){this._settings=t,this._settings.enableTouchScroll=!1},enumerable:!0,configurable:!0}),n.prototype.gridStartProcess=function(t){this._empty&&this.settings.requestData&&(this._empty=!1,this._updating=!0)},n.prototype.gridEndProcess=function(t){var e=this;setTimeout(function(){e.popup.visible?e.popup.updatePosition():e.showByTarget()}),this._updating=!1,0===this.grid.resultRows.length?this._empty=!0:this._empty=!1},n.prototype.gridDataQuery=function(t){this.dataQuery.emit(t)},n.prototype.writeValue=function(t){var e=this;this._value=t;var i=this.items.find(function(i){return i[e.valueField]===t});this.displayValue=i?i[this.displayField]:""},n.prototype.setValue=function(t,e){t===this._value&&e===this.displayValue||(this._focusedValue=t,this.displayValue=e,this.value=t)},n.prototype.empty=function(){return this._empty},n.prototype.updating=function(){return this._updating},n.prototype.fetchData=function(t,e){var i=this.getSelectedRow();i&&(this._focusedValue=i[this.valueField]),this.grid&&this.popupVisible&&(this.grid.fetchData(t,e),this._focusedValue?this.grid.locateByKey(this._focusedValue):null!==this._value&&this.grid.locateByKey(this._value))},n.prototype.gridWidth=function(){var t=0;return this.columns.forEach(function(e){return t+=e.width}),t+this.settings.widthUnit},n.prototype.popupShow=function(t){this._onGrid=!1,null!==this._value?this.grid.locateByKey(this._value,this.valueField):this.shownByKey&&this.grid.processKey(e.Keys.generateEvent(null,e.Keys.DOWN)),this.grid.checkSize()},n.prototype.processKey=function(t){return t.keyCode===e.Keys.ENTER?(this.setValueFromGrid(),this.popup.closePopup(),!0):!!this.popupVisible&&(t.keyCode===e.Keys.ESCAPE?(this.popup.closePopup(),t.preventDefault(),t.stopPropagation(),!0):(t.keyCode===e.Keys.DOWN||t.keyCode===e.Keys.UP)&&(this._onGrid=!0,this.grid.processKey(t),t.preventDefault(),!0))},n.prototype.gridRowClick=function(t){this._onGrid=!0,this._skipFocusOnPopupClose=!1,this.value=t.row[this.valueField],this.popup.closePopup(),this.itemSelect.emit(t.row)},n.prototype.iconClass=function(){var t="true-icon-angle-down true-turnable";return this.popupVisible&&(t+=" true-turned"),t},n.prototype.inputInput=function(t){var e=this;this.popupVisible||""===this.displayValue?(this.popupVisible&&setTimeout(function(){e.grid.searchString=e.displayValue}),""!==this.displayValue?this._value=null:this.setValue(null,"")):this.grid.searchString=this.displayValue},n.prototype.getSelectedRow=function(){return this.grid&&this.grid.state.selection.ranges.length>0?this.grid.state.selection.ranges[0].fromCell.row:null},n.prototype.containsDisplayed=function(t){return!this.displayValue||t!==undefined&&t.toLowerCase().indexOf(this.displayValue.toLowerCase())>=0},n.prototype.setValueFromGrid=function(){var t=this;if(this.popupVisible||!this.grid.state.model){var e=this.getSelectedRow();e&&(this._onGrid||this.containsDisplayed(e[this.displayField]))?this.setValue(e[this.valueField],e[this.displayField]):this.setValueFromDisplayed()}else{var i=this.grid.state.model.find(function(e){return e[t.displayField].toLowerCase()===t.displayValue.toLowerCase()});i?this.setValue(i[this.valueField],i[this.displayField]):this.setValue(null,"")}},n.prototype.setValueFromDisplayed=function(){var t=this,e=null;this.grid&&this.grid.resultRows&&(e=this.grid.resultRows.find(function(e){return e[t.displayField].toLowerCase()===t.displayValue.toLowerCase()})),e?this.setValue(e[this.valueField],e[this.displayField]):this.setValue(null,"")},n.prototype.inputBlur=function(i){if(this._skipFocusOnPopupClose=!0,(null===this.value||this.value===undefined)&&""!==this.displayValue){if(i.relatedTarget&&e.Utils.isAncestor(this.popup.elementRef.nativeElement,i.relatedTarget))return;this.closePopup(),this.setValueFromDisplayed()}t.prototype.inputBlur.call(this,i)},u([i.Output("dataQuery"),p("design:type",i.EventEmitter)],n.prototype,"dataQuery",void 0),u([i.Input("valueField"),p("design:type",String),p("design:paramtypes",[String])],n.prototype,"valueField",null),u([i.Input("displayField"),p("design:type",String),p("design:paramtypes",[String])],n.prototype,"displayField",null),u([i.Input(),p("design:type",Array)],n.prototype,"columns",void 0),u([i.Input(),p("design:type",Array)],n.prototype,"items",void 0),u([i.Input(),p("design:type",e.GridState)],n.prototype,"parentState",void 0),u([i.Input("settings"),p("design:type",Object),p("design:paramtypes",[Object])],n.prototype,"settings",null),u([i.Output("itemSelect"),p("design:type",i.EventEmitter)],n.prototype,"itemSelect",void 0),u([i.ViewChild("grid",{"static":!0}),p("design:type",Q)],n.prototype,"grid",void 0),n=o=u([i.Component({selector:"true-select",template:'\n      <true-input-wrapper\n        (btnClick)="btnClick($event)"\n        [disabled]="disabled"\n        class="true-select__input"\n        [class.true-input_popup-visible]="popupVisible"\n        [icon]="iconClass()">\n        <input #input\n               [(ngModel)]="displayValue"\n               [readonly]="disableTextEditor"\n               [attr.disabled]="disabled"\n               [class.true-disable-te]="disableTextEditor"\n               (input)="inputInput($event)"\n               (click)="inputClick($event)"\n               (touchstart)="inputTouchStart($event)"\n               (touchmove)="inputTouchMove($event)"\n               (touchend)="inputTouchEnd($event)"\n               (blur)="inputBlur($event)"\n               (focus)="inputFocus($event)"\n               (keydown)="inputKeyDown($event)"/>\n      </true-input-wrapper>\n      <true-popup #popup\n        (close)="popupClose($event)"\n        (show)="popupShow($event)" >\n        <true-grid #grid\n                 [class.true-select__grid_hidden]="empty()"\n                 class="true-select__grid"\n                 [maxHeight]="maxDropDownHeight"\n                 [columns]="columns"\n                 [data]="items"\n                 [settings]="settings"\n                 (dataQuery)="gridDataQuery($event)"\n                 (startProcess)="gridStartProcess($event)"\n                 (endProcess)="gridEndProcess($event)"\n                 (rowClick)="gridRowClick($event)">\n        </true-grid>\n        <div *ngIf="empty()" class="true-select__notfound" [style.width]="gridWidth()">Ничего не найдено</div>\n        <div *ngIf="updating()" class="true-select__updating">Загрузка...</div>\n      </true-popup>\n    ',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return o}),multi:!0}],styles:["\n\n    .true-select__input {\n      width: 100%;\n    }\n\n    input {\n      box-sizing: border-box;\n      width: 100%;\n      height: 100%;\n    }\n\n    .true-select__grid_hidden {\n      display: none;\n    }\n\n    .true-select__grid {\n      border: none !important;\n      cursor: pointer;\n    }\n\n    .true-select__notfound, .true-select__updating {\n      padding: 0.6em;\n      box-sizing: border-box;\n      color: #aaa;\n    }\n  "]}),p("design:paramtypes",[i.ElementRef,i.Renderer2])],n)}(E),Z=function(){function t(t){this.elementRef=t,this.text="",this.close=new i.EventEmitter,this.dialog=null}return t.prototype.closeAlert=function(){this.close.emit(null)},t.prototype.btnClick=function(t,e){this.close.emit(e)},t.prototype.overlayClick=function(t){this.close.emit(null)},t.prototype.init=function(t,e){var i=this;this.text=t,this.dialog=e,setTimeout(function(){i.alert.nativeElement.style.transform="translateY(0px)",i.alert.nativeElement.style.opacity="1.0",i.overlay.nativeElement.style.opacity="0.4"})},u([i.Input(),p("design:type",String)],t.prototype,"text",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"close",void 0),u([i.ViewChild("alert",{"static":!0}),p("design:type",Object)],t.prototype,"alert",void 0),u([i.ViewChild("overlay",{"static":!0}),p("design:type",Object)],t.prototype,"overlay",void 0),t=u([i.Component({selector:"true-dialog-alert",template:'<div #alert class="true-dialog-alert">\r\n  <div class="true-dialog-alert__content">{{text}}</div>\r\n  <div class="true-dialog-alert__footer">\r\n    <p>\r\n      <button\r\n        *ngFor="let b of dialog.buttons"\r\n        class="true-button"\r\n        [ngClass]="b.cssClass"\r\n        (click)="btnClick($event, b)"\r\n        [disabled]="b.disabled">{{b.caption}}</button>\r\n    </p>\r\n  </div>\r\n</div>\r\n<div #overlay\r\n     class="true-dialog-alert__overlay"\r\n     (click)="overlayClick($event)">\r\n</div>\r\n',styles:[":host{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;align-content:flex-start}.true-dialog-alert{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;align-content:flex-start;z-index:10;opacity:0;-webkit-transform:translateY(-15px);transform:translateY(-15px);-webkit-transition:opacity .2s,-webkit-transform .15s ease-out;transition:opacity .2s,transform .15s ease-out,-webkit-transform .15s ease-out}.true-dialog-alert .true-dialog-alert__content{display:block;padding:1em;text-align:center}.true-dialog-alert .true-dialog-alert__footer{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:end;justify-content:flex-end;padding:0 1.2em 1em}.true-dialog-alert .true-dialog-alert__footer p{margin:0}.true-dialog-alert .true-dialog-alert__footer button{padding:.4em 1em;margin-left:1em}.true-dialog-alert__overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.3);opacity:0;z-index:9;-webkit-transition:opacity .5s;transition:opacity .5s}"]}),p("design:paramtypes",[i.ElementRef])],t)}(),J=function(){function t(t){this._cfResolver=t,this.closeBtn=new N(K.closeButtonId),this.dialog=new K,this.btnClick=new i.EventEmitter,this._alert=null}return Object.defineProperty(t.prototype,"caption",{get:function(){return this.dialog?this.dialog.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alertVisible",{get:function(){return null!==this._alert},enumerable:!0,configurable:!0}),t.prototype.focus=function(){var t=this;setTimeout(function(){t.buttons.first.nativeElement.focus()})},t.prototype.closeAlert=function(){this.alertVisible&&this._alert.closeAlert()},t.prototype.confirm=function(t,e){var i=this;this._alert&&this._alert.closeAlert();var r=this._cfResolver.resolveComponentFactory(Z),s=this.alertContainer.createComponent(r);s.instance.init(t,e),s.instance.elementRef.nativeElement.style.position="absolute",s.instance.elementRef.nativeElement.style.top="0",s.instance.elementRef.nativeElement.style.left="0",s.instance.elementRef.nativeElement.style.bottom="0",s.instance.elementRef.nativeElement.style.right="0";var a=new n.Subject;return s.instance.close.pipe(o.take(1)).subscribe(function(t){a.next(t),a.complete(),s&&(s.destroy(),s=null,i._alert=null)}),this._alert=s.instance,a},t.prototype.ngOnDestroy=function(){this._alert&&this._alert.closeAlert()},u([i.Input(),p("design:type",K)],t.prototype,"dialog",void 0),u([i.Output(),p("design:type",i.EventEmitter)],t.prototype,"btnClick",void 0),u([i.ViewChild("alertContainer",{read:i.ViewContainerRef,"static":!0}),p("design:type",Object)],t.prototype,"alertContainer",void 0),u([i.ViewChildren("buttons"),p("design:type",i.QueryList)],t.prototype,"buttons",void 0),t=u([i.Component({selector:"true-dialog-wrapper",template:'<div *ngIf="dialog.showHeader" class="true-header">\r\n  <span>{{caption}}</span>\r\n  <button class="true-button flat" (click)="btnClick.emit(closeBtn)"><span class="true-close"></span></button>\r\n</div>\r\n<div class="true-body">\r\n  <div #alertContainer class="true-alert-container"></div>\r\n  <div class="true-content">\r\n    <ng-content></ng-content>\r\n  </div>\r\n  <div *ngIf="dialog.showFooter" class="true-footer">\r\n    <p>\r\n      <button\r\n        #buttons\r\n        *ngFor="let b of dialog.buttons"\r\n        class="true-button"\r\n        [ngClass]="b.cssClass"\r\n        (click)="btnClick.emit(b)"\r\n        [disabled]="b.disabled">{{b.caption}}</button>\r\n    </p>\r\n  </div>\r\n</div>\r\n',styles:[":host{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}:host>.true-header{position:relative;padding:.5em .7em;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:baseline;align-items:baseline;z-index:2}:host>.true-header>span{margin:0 .4em 0 .6em;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}:host>.true-body{position:relative;display:block;-webkit-box-flex:1;flex-grow:1;z-index:1}:host>.true-body .true-content{padding:.8em 1.2em}:host>.true-body .true-footer{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:end;justify-content:flex-end;padding:.8em 1.2em}:host>.true-body .true-footer p{margin:0}:host>.true-body .true-footer button{padding:.6em 1.4em;margin-left:1em}"]}),p("design:paramtypes",[i.ComponentFactoryResolver])],t)}(),tt=function(t){function n(e,n){var r=t.call(this)||this;return r.state=e,r.elementRef=n,r.toggleCheckColumn=new i.EventEmitter,r.captionMouseDown=new i.EventEmitter,r.captionMouseUp=new i.EventEmitter,r.captionTouchStart=new i.EventEmitter,r}return l(n,t),n.prototype.isFiltered=function(){return null!=this.state.dataSource.getFilter(this.column)},n.prototype.setState=function(t){"btn-visible"===t&&this.caption.nativeElement.classList.toggle("true-grid-btn-visible",!0)},n.prototype.removeState=function(t){"btn-visible"===t&&this.caption.nativeElement.classList.toggle("true-grid-btn-visible",!1)},n.prototype.btnIconClass=function(){var t="";return this.isFiltered()?t+=this.state.sta.filterBtnIconClass_active:t+=this.state.sta.filterBtnIconClass,t},n.prototype.isSorted=function(t){return null!==this.sorted},Object.defineProperty(n.prototype,"sorted",{get:function(){var t=this.state.dataSource.sortedByField(this.column.fieldName);return t?t.sortType:null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sortedUp",{get:function(){return this.sorted===e.SortType.ASC},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sortedDown",{get:function(){return this.sorted===e.SortType.DESC},enumerable:!0,configurable:!0}),n.prototype.sortIndicatorClass=function(){return this.sortedUp?this.state.sta.sortedUpIconClass:this.sortedDown?this.state.sta.sortedDownIconClass:""},n.prototype.toggleCheck=function(t){this.toggleCheckColumn.emit(t),t.preventDefault()},n.prototype.headerMouseDown=function(t){t.stopPropagation()},n.prototype.mouseDown=function(t){this.captionMouseDown.emit(t)},n.prototype.mouseUp=function(t){this.captionMouseUp.emit(t)},n.prototype.touchStart=function(t){this.captionTouchStart.emit(t)},n.prototype.contextMenu=function(t){this.state.headerContextMenu(t,this.column)},n.prototype.btnTouch=function(t){this.state.showFilter(t,this.column),t.stopPropagation(),t.cancelable&&t.preventDefault()},n.prototype.btnClick=function(t){this.state.showFilter(t,this.column)},n.prototype.btnMouseDown=function(t){t.stopPropagation(),t.preventDefault()},n.prototype.ngAfterContentInit=function(){this.addTouchListeners(this.caption.nativeElement)},u([i.Input("column"),p("design:type",e.Column)],n.prototype,"column",void 0),u([i.Output("toggleCheckColumn"),p("design:type",Object)],n.prototype,"toggleCheckColumn",void 0),u([i.Output("captionMouseDown"),p("design:type",Object)],n.prototype,"captionMouseDown",void 0),u([i.Output("captionMouseUp"),p("design:type",Object)],n.prototype,"captionMouseUp",void 0),u([i.Output("captionTouchStart"),p("design:type",Object)],n.prototype,"captionTouchStart",void 0),u([i.ViewChild("caption",{"static":!0}),p("design:type",Object)],n.prototype,"caption",void 0),u([i.ViewChild("btn",{"static":!0}),p("design:type",Object)],n.prototype,"btn",void 0),n=u([i.Component({selector:"true-grid-header-cell",template:'<div #caption\r\n  class="true-header-cell__caption"\r\n  [class.true-header-cell__checkbox]="column.isCheckbox"\r\n  [class.true-header-cell__filtered]="isFiltered()"\r\n  (contextmenu)="contextMenu($event)"\r\n  (touchstart)="touchStart($event)"\r\n  (mousedown)="mouseDown($event)"\r\n  (mouseup)="mouseUp($event)">\r\n\r\n  <div *ngIf="column.isCheckbox"\r\n    [ngClass]="state.settings.headerCheckboxClass(column.isChecked)"\r\n    (click)="toggleCheck($event)"></div>\r\n  <div *ngIf="isSorted(column)"\r\n        class="true-header-cell__sort-indicator" [ngClass]="sortIndicatorClass()"></div>\r\n  <div *ngIf="!column.isCheckbox"\r\n       [class.true-header-cell__txt_nowrap]="!state.settings.headerWordWrap"\r\n       class="true-header-cell__txt">\r\n    {{column.caption | trueTranslate}}\r\n  </div>\r\n\r\n  <div #btn *ngIf="!column.isCheckbox && state.settings.allowFilter && (column.allowFilter || isFiltered())"\r\n      class="true-grid-btn"\r\n      (click)="btnClick($event)"\r\n      (touchstart)="btnTouch($event)"\r\n      (mousedown)="btnMouseDown($event)">\r\n    <span [ngClass]="btnIconClass()"></span>\r\n  </div>\r\n</div>\r\n',host:{"class":"true-header-cell"},styles:[":host{cursor:default;display:block;height:100%}.true-header-cell__caption{height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:center;justify-content:center;-webkit-box-align:stretch;align-items:stretch;overflow-x:hidden}.true-header-cell__caption.true-header-cell__checkbox{-webkit-box-align:center;align-items:center;justify-content:space-around}.true-header-cell__caption .true-header-cell__sort-indicator{text-align:center;-ms-grid-row-align:center;align-self:center}.true-header-cell__caption .true-header-cell__txt{-ms-grid-row-align:center;align-self:center;overflow-x:hidden;-webkit-box-flex:1;flex-grow:1;overflow-y:hidden}.true-header-cell__caption .true-header-cell__txt_nowrap{white-space:nowrap;text-overflow:ellipsis}.true-grid-btn-visible .true-grid-btn,.true-header-cell__caption:hover .true-grid-btn{opacity:.2;visibility:visible}.true-header-cell__filtered .true-grid-btn{visibility:visible!important;opacity:1!important}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ElementRef])],n)}(P),et=function(){function t(t,e){this.state=t,this.elementRef=e,this.bandTouchstart=new i.EventEmitter}return t.prototype.bandMouseDown=function(t){},u([i.Input("band"),p("design:type",e.ColumnBand)],t.prototype,"band",void 0),u([i.Output("bandTouchstart"),p("design:type",Object)],t.prototype,"bandTouchstart",void 0),t=u([i.Component({selector:"true-grid-header-band",template:'\n  <div class="true-header-band__caption" [style.min-height.px]="state.settings.rowHeight"\n    (mousedown)="bandMouseDown($event)">\n    <div class="true-header-band__txt">\n      {{band.caption | trueTranslate}}\n    </div>\n  </div>\n  ',styles:["\n    .true-header-band__caption {\n      box-sizing: border-box;\n      display: flex;\n      flex-direction: row;\n      justify-content: space-between;\n      align-items: stretch;\n      overflow-x: hidden;\n      overflow-y: hidden;\n    }\n\n    .true-header-band__txt\n    {\n      align-self: center;\n      text-overflow: ellipsis;\n      overflow-x: hidden;\n      overflow-y: hidden;\n      flex-grow: 1;\n      white-space: nowrap;\n    }\n"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ElementRef])],t)}(),it=function(t){function n(e,n,r){var o=t.call(this)||this;return o.state=e,o.elementRef=n,o.renderer=r,o.resizeColumn=new i.EventEmitter,o.toggleCheckColumn=new i.EventEmitter,o._scrollerClientRect=null,o._touches=!1,o._markerVisible=!1,o}return l(n,t),n.prototype.resizeInProcess=function(t){this.gridHeaderTable&&(t?this.gridHeaderTable.nativeElement.classList.add("true-resize-in-process"):this.gridHeaderTable.nativeElement.classList.remove("true-resize-in-process"))},n.prototype.dragInProcess=function(t){this.gridHeaderTable&&(t?this.gridHeaderTable.nativeElement.classList.add("true-drag-in-process"):this.gridHeaderTable.nativeElement.classList.remove("true-drag-in-process"))},n.prototype.trackCol=function(t,e){return e},Object.defineProperty(n.prototype,"isAutoScroll",{get:function(){return!!this.scroller&&this.scroller.isAutoScroll},enumerable:!0,configurable:!0}),n.prototype.resizeMouseUp=function(t){},n.prototype.toggleCheck=function(t,e){this.toggleCheckColumn.emit(e)},n.prototype.headerCellMouseDown=function(t,e){if(0==t.button){var i=t.target.getBoundingClientRect(),n=Math.round(t.clientX);n<i.left+i.width/2?this.resizeMouseDownPrev(t,e):n>i.left+i.width/2&&this.resizeMouseDown(t,e)}},n.prototype.captionTouchMove=function(t,i){t.stopPropagation();var n=t.changedTouches;if(1===n.length&&this.uiAction.target===i){var r=n[0].clientX,o=n[0].clientY;if(this.checkReordering(r,o))return;this.uiAction.action===e.UIActionType.REORDER_COLUMN&&this.proceedReordering(r,o)}},n.prototype.captionTouchEnd=function(t){this.removeTouchMoveListeners(),this.scroller&&this.scroller.stopAutoScroll(),this.uiAction&&(this.uiAction&&this.uiAction.action===e.UIActionType.REORDER_COLUMN&&this.stopReordering(),t.stopPropagation(),t.cancelable&&t.preventDefault())},n.prototype.captionStartDrag=function(t,i){var n=this;if(!i.isCheckbox){var r,o;if(t.touches){if(!t.changedTouches||1!==t.changedTouches.length)return;r=t.changedTouches[0].clientX,o=t.changedTouches[0].clientY,this.removeTouchMoveListeners(),this.touchMoveListenFunc=this.renderer.listen(event.target,"touchmove",function(t){n.captionTouchMove(t,i)}),this.touchEndListenFunc=this.renderer.listen(event.target,"touchend",function(t){n.captionTouchEnd(t)}),this.touchCancelListenFunc=this.renderer.listen(event.target,"touchcancel",function(t){n.captionTouchEnd(t)})}else{if(this.addDocumentMouseListeners(),0!=t.button)return;r=t.clientX,o=t.clientY}var s=t.target.parentElement.getBoundingClientRect();this.uiAction=new e.UIAction(e.UIActionType.CLICK,i,r,o),this.uiAction.targetOffsetX=s.left-r,this.uiAction.targetOffsetY=s.top-o,t.stopPropagation()}},n.prototype.captionSort=function(t,i){if(t.touches){if(!t.changedTouches||1!==t.changedTouches.length)return}else if(0!=t.button)return;this.uiAction&&(t.defaultPrevented||this.uiAction.target===i&&this.uiAction.action===e.UIActionType.CLICK&&(!i.isCheckbox&&i.allowSorting&&(this.state.sortByColumn(i,t.shiftKey),t.stopPropagation(),t.preventDefault()),this.uiAction=null))},n.prototype.resizeMouseDown=function(t,e){e.canResize&&this.initResizing(t,e),t.stopPropagation()},n.prototype.resizeMouseDownPrev=function(t,e){var i=null,n=this.layout.columns.indexOf(e);n>0&&(i=this.layout.columns[n-1],this.initResizing(t,i)),t.stopPropagation()},n.prototype.showHeaderBtn=function(t){this.columnElements&&this.columnElements.forEach(function(e){e.column.fieldName===t&&e.setState("btn-visible")})},n.prototype.hideHeaderBtns=function(){this.columnElements&&this.columnElements.forEach(function(t){return t.removeState("btn-visible")})},Object.defineProperty(n.prototype,"renderedColumns",{get:function(){var t=[];return this.columnElements.forEach(function(e){t.push({boundingRect:e.elementRef.nativeElement.getBoundingClientRect(),item:e.column})}),t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"renderedBands",{get:function(){var t=[];return this.bandElements.forEach(function(e){t.push({boundingRect:e.elementRef.nativeElement.getBoundingClientRect(),item:e.band})}),t},enumerable:!0,configurable:!0}),n.prototype.canDrop=function(t,i){this._scrollerClientRect||(this._scrollerClientRect=this.scroller.clientRect);var n,r=this._scrollerClientRect,o=!1,s=!1;return this.layout.place===e.GridPart.CENTER&&(r=this.scroller.headerRect,o=this.state.showFixedLeft,s=this.state.showFixedRight),this.layout.place===e.GridPart.LEFT&&(r=this.scroller.headerRectLeft,o=!1,s=!0),this.layout.place===e.GridPart.RIGHT&&(r=this.scroller.headerRectRight,o=!0,s=!1),n=t.target instanceof e.Column?this.renderedColumns:this.renderedBands,this.layout.canDrop(t,n,r,o,s,this.state.columnCollection)},n.prototype.autoScrollX=function(t){this.uiAction&&(this.uiAction.x-=t)},n.prototype.initResizing=function(t,i){this.state&&!this.state.settings.columnResize||!1!==i.columnResize&&(this.addDocumentMouseListeners(),this.uiAction=new e.UIAction(e.UIActionType.RESIZE_COLUMN,i,t.clientX,t.clientY))},n.prototype.startResizing=function(){this.uiAction.initialized=!0,this.scroller.startAutoScroll(),this.resizeColumn.emit({action:"start",ui:this.uiAction})},n.prototype.initReordering=function(t,i){this.uiAction.action=e.UIActionType.REORDER_COLUMN;var n=this.uiAction.target.headerWidth;this.uiAction.target instanceof e.ColumnBand&&(n=0,this.uiAction.target.columns.forEach(function(t){return n+=t.displayedWidth})),n>300&&(this.uiAction.targetOffsetX<-250&&(this.uiAction.targetOffsetX=-150),n=300),this.uiAction.targetWidth=n,this.uiAction.initialized=!0,this.uiAction.move(t,i),this.state.dragDrop.drag(this.uiAction)},n.prototype.proceedReordering=function(t,e){this.uiAction.move(t,e),this.state.dragDrop.drag(this.uiAction)},n.prototype.stopReordering=function(){var t=this;setTimeout(function(){t.state.dragDrop.drop(t.uiAction),t.uiAction=null})},n.prototype.stopActions=function(){this.uiAction&&this.uiAction.action===e.UIActionType.REORDER_COLUMN&&this.stopReordering()},n.prototype.checkReordering=function(t,i){if(this.uiAction.action===e.UIActionType.CLICK&&this.state.settings.columnReorder&&(Math.abs(t-this.uiAction.x)>6||Math.abs(i-this.uiAction.y)>6)){if(this.uiAction.target instanceof e.Column&&this.uiAction.target.canReorder)return this.initReordering(t,i),!0;if(this.uiAction.target instanceof e.ColumnBand&&this.state.settings.bandReorder)return this.initReordering(t,i),!0}return!1},n.prototype.documentMouseMove=function(i){if(t.prototype.documentMouseMove.call(this,i),this.uiAction){var n=i.clientX,r=i.clientY;this.checkReordering(n,r)||(this.uiAction.action===e.UIActionType.REORDER_COLUMN&&this.proceedReordering(n,r),this.uiAction.initialized||this.uiAction.action!==e.UIActionType.RESIZE_COLUMN||!this.state.settings.columnResize?this.uiAction.action===e.UIActionType.RESIZE_COLUMN&&(this.uiAction.move(n,r),this.resizeColumn.emit({action:"",ui:this.uiAction})):this.startResizing())}},n.prototype.documentMouseUp=function(i){var n=this;t.prototype.documentMouseUp.call(this,i),this.scroller&&this.scroller.stopAutoScroll();var r=i.clientX;i.clientY;if(this.uiAction&&this.uiAction.action===e.UIActionType.REORDER_COLUMN&&(this.stopReordering(),i.stopPropagation(),i.preventDefault()),this.uiAction&&this.uiAction.action===e.UIActionType.RESIZE_COLUMN){var o=this.uiAction.x0,s=r,a=this.uiAction.target.width+s-o;a<this.state.settings.minColumnWidthOnResize&&(a=this.state.settings.minColumnWidthOnResize),this.state.resizeColumn(this.uiAction.target,a),setTimeout(function(){n.resizeColumn.emit({action:"end",ui:n.uiAction}),n.scroller.fixScroll(),n.uiAction=null}),i.stopPropagation(),i.preventDefault()}},u([i.Input("layout"),p("design:type",e.GridLayout)],n.prototype,"layout",void 0),u([i.Input("scroller"),p("design:type",D)],n.prototype,"scroller",void 0),u([i.Output("resizeColumn"),p("design:type",Object)],n.prototype,"resizeColumn",void 0),u([i.Output("toggleCheckColumn"),p("design:type",Object)],n.prototype,"toggleCheckColumn",void 0),u([i.ViewChild("gridHeaderTable",{"static":!0}),p("design:type",Object)],n.prototype,"gridHeaderTable",void 0),u([i.ViewChild("dropMarker",{"static":!0}),p("design:type",Object)],n.prototype,"dropMarker",void 0),u([i.ViewChildren("headerCell",{read:tt}),p("design:type",i.QueryList)],n.prototype,"columnElements",void 0),u([i.ViewChildren("headerBand",{read:et}),p("design:type",i.QueryList)],n.prototype,"bandElements",void 0),n=u([i.Component({selector:"true-grid-header",template:'<div #gridHeaderTable class="true-grid-header"\r\n        [ngClass]="state.settings.appearance.getHeaderClass()">\r\n  <table [style.width]="layout.headerWidth">\r\n    <colgroup>\r\n      <col *ngFor="let c of layout.columns" [style.width]="layout.displayedHeaderWidth(c)" /> \x3c!--layout.columnHeaderWidth(c)--\x3e\r\n      <col *ngIf="layout.isCenter" class="true-grid-re" [style.width]="state.st.hdWidth" />\r\n    </colgroup>\r\n    <thead>\r\n      <tr\r\n        *ngIf="layout.bands.length > 0 && state.settings.showBands"\r\n        [style.height.px]="state.settings.rowHeight">\r\n        <td *ngFor="let b of layout.bands"\r\n            [attr.colspan]="b.columns.length"\r\n            class="band">\r\n              <true-grid-header-band\r\n              [band]="b"\r\n              (bandTouchstart)="captionStartDrag($event, b)"\r\n              (mousedown)="captionStartDrag($event, b)"\r\n              #headerBand>\r\n            </true-grid-header-band>\r\n        </td>\r\n        <td *ngIf="layout.isCenter" style="border:0;"></td>\r\n      </tr>\r\n      <tr>\r\n        <td *ngFor="let c of layout.columns; trackBy: trackCol;"\r\n            [ngClass]="state.settings.headerCellClass(c)"\r\n            [style.height.px]="state.settings.rowHeight"\r\n            (mousedown)="headerCellMouseDown($event, c)">\r\n          <true-grid-header-cell #headerCell\r\n              [column]="c"\r\n              (toggleCheckColumn)="toggleCheck($event, c)"\r\n              (captionTouchStart)="captionStartDrag($event, c)"\r\n              (captionMouseDown)="captionStartDrag($event, c)"\r\n              (captionMouseUp)="captionSort($event, c)">\r\n          </true-grid-header-cell>\r\n        </td>\r\n        <td *ngIf="layout.isCenter" class="true-tt" style="border:0;"></td>\r\n      </tr>\r\n    </thead>\r\n  </table>\r\n</div>\r\n',styles:[".true-grid-drag-item>table,.true-grid-header>table{box-sizing:border-box;table-layout:fixed;border-spacing:0;border-collapse:collapse;outline:0}td.true-column-resizable{cursor:ew-resize}td:not(.true-column-resizable){cursor:default}td:not(.true-column-resizable)+td.true-column-resizable{padding-left:0!important}::ng-deep .true-grid-header td:not(.true-column-resizable):not(.true-column-nobtn):not(.true-header-cell__checkbox){padding-right:0!important}::ng-deep .true-grid-header td:not(.true-column-resizable):not(.true-column-nobtn):not(.true-header-cell__checkbox) .true-header-cell{padding-right:0!important}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ElementRef,i.Renderer2])],n)}(P),nt=function(t){function n(e,i){var n=t.call(this)||this;return n.state=e,n.elementRef=i,n}return l(n,t),u([i.Input("layout"),p("design:type",e.GridLayout)],n.prototype,"layout",void 0),n=u([i.Component({selector:"true-grid-footer",template:'<div #gridFooterTable class="true-grid-footer" [ngClass]="state.settings.appearance.getFooterClass()">\r\n  <table [style.width]="layout.headerWidth">\r\n    <colgroup>\r\n      <col *ngFor="let c of layout.columns" [style.width]="layout.displayedHeaderWidth(c)" />\r\n      <col *ngIf="layout.isCenter" class="true-grid-re" [style.width]="state.st.hdWidth" />\r\n    </colgroup>\r\n    <tfoot>\r\n      <tr>\r\n        <td *ngFor="let c of layout.columns"\r\n            [style.height.px]="state.settings.rowHeight"\r\n            [ngClass]="state.settings.footerCellClass(c)">\r\n            <true-grid-footer-cell [column]="c">\r\n            </true-grid-footer-cell>\r\n        </td>\r\n        <td *ngIf="layout.isCenter" style="border:0;"></td>\r\n      </tr>\r\n    </tfoot>\r\n  </table>\r\n</div>\r\n',styles:[".true-grid-footer>table{box-sizing:border-box;table-layout:fixed;border-spacing:0;border-collapse:collapse;outline:0}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,i.ElementRef])],n)}(P),rt=function(){function t(t,i,n,r){this.state=t,this.intl=i,this.elementRef=n,this.changeDetector=r,this._currentSummary=null,this.summaryTypes=[e.SummaryType.SUM,e.SummaryType.MIN,e.SummaryType.MAX,e.SummaryType.COUNT,e.SummaryType.AVERAGE]}return t.prototype.displayedValue=function(t){return t.type!=e.SummaryType.COUNT&&""!=this.column.format?this.state.dataSource.displayedValue(this.column,t.value,null):t.value},t.prototype.canApply=function(t){return t!==e.SummaryType.SUM&&t!==e.SummaryType.AVERAGE||this.column.type===e.ColumnType.NUMBER},t.prototype.hasAggr=function(t){return null!=this._currentSummary&&this._currentSummary.type===t},Object.defineProperty(t.prototype,"menuVisible",{get:function(){return this.menu.visible},enumerable:!0,configurable:!0}),t.prototype.menuClosed=function(t){this.elementRef.nativeElement.classList.remove("true-grid-btn-visible")},t.prototype.menuShow=function(t){this.elementRef.nativeElement.classList.add("true-grid-btn-visible")},t.prototype.setAggr=function(t){this.state.setSummary(this.column,t,this._currentSummary)},t.prototype.addAggr=function(t,e){this.state.addSummary(this.column,e)},t.prototype.toggleMenu=function(t,e){void 0===e&&(e=null);var i="SPAN"===t.target.tagName?t.target.parentElement:t.target;i.parentElement!==this.elementRef.nativeElement&&(i=i.parentElement),this.menuVisible?this.menu.closePopup():(this._currentSummary=e,this.menu.showByTarget(i,this.column.isNumeric?"AboveLeft":"AboveRight"),this.changeDetector.detectChanges())},u([i.Input("column"),p("design:type",e.Column)],t.prototype,"column",void 0),u([i.ViewChild("btn",{"static":!1}),p("design:type",Object)],t.prototype,"btn",void 0),u([i.ViewChild("menu",{"static":!1}),p("design:type",Object)],t.prototype,"menu",void 0),t=u([i.Component({selector:"true-grid-footer-cell",template:'<div *ngFor="let a of column.summaries"\r\n     class="true-aggr"\r\n     [style.height.px]="state.st.rowHeight"\r\n     (click)="toggleMenu($event, a)">\r\n  <div>\r\n    <span class="true-aggr-caption">{{a.type.footerText | trueTranslate}}&nbsp;</span>{{displayedValue(a)}}\r\n  </div>\r\n</div>\r\n<div\r\n  class="true-footer-btn-container"\r\n  *ngIf="!column.isCheckbox && column.summaries.length === 0">\r\n  <div #btn class="true-grid-btn" (click)="toggleMenu($event)"><span class="true-icon-sigma"></span></div>\r\n</div>\r\n\r\n<true-menu #menu\r\n  (show)="menuShow($event)"\r\n  (closed)="menuClosed($event)">\r\n  <true-menu-item\r\n    [hidden]="column.summaries.length === 0"\r\n    [true-menu-show]="submenu"\r\n    true-divide="true"><span></span>{{\'Add\' | trueTranslate}}</true-menu-item>\r\n  <true-menu-item\r\n    *ngFor="let t of summaryTypes; let i=index"\r\n    [true-divide]="i == 0 && column.summaries.length > 0"\r\n    (itemClick)="setAggr(t)"\r\n    [disabled]="!canApply(t)"><span [class.true-icon-ok]="hasAggr(t)"></span>{{t.name | trueTranslate}}</true-menu-item>\r\n  <true-menu-item (itemClick)="setAggr(null)" true-divide="true">\r\n    <span [class.true-icon-ok]="column.summaries.length === 0"></span>{{\'None\' | trueTranslate}}</true-menu-item>\r\n</true-menu>\r\n\r\n<true-menu #submenu>\r\n  <true-menu-item\r\n    *ngFor="let t of summaryTypes"\r\n    (itemClick)="addAggr($event, t)"\r\n    [disabled]="!canApply(t)"><span></span>{{t.name | trueTranslate}}</true-menu-item>\r\n</true-menu>\r\n',host:{"[class.num]":"column.isNumeric","[class.h100]":"column.summaries.length<=1"},styles:[":host{display:block;overflow-x:hidden}.true-aggr{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:center;align-items:center}.true-aggr div{white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}:host.num .true-aggr{-webkit-box-pack:end;justify-content:flex-end}:host.h100{height:100%}:host.h100 .true-aggr{height:100%}.true-footer-btn-container{box-sizing:border-box;height:100%;width:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}:host:hover .true-footer-btn-container .true-grid-btn{visibility:visible}:host.num .true-footer-btn-container{-webkit-box-pack:end;justify-content:flex-end}"]}),c(0,i.Inject("gridState")),p("design:paramtypes",[m,h,i.ElementRef,i.ChangeDetectorRef])],t)}(),ot=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.ie=!1,this.valueTemp=!1,this.valueChanged=!1,this.height=0,this.datepickerInputClass="true-grid-input",this._initialized=!1,this.commit=new i.EventEmitter,this.change=new i.EventEmitter,this.cancel=new i.EventEmitter}return Object.defineProperty(t.prototype,"popupVisible",{get:function(){return this.popup.visible},enumerable:!0,configurable:!0}),t.prototype.getIcon=function(){return"true-icon-calendar-empty"},t.prototype.datepickerChange=function(t){this._initialized&&this.change.emit(this.purify(t))},t.prototype.dateClick=function(t){this.inputChange(t),this.popup.closePopup()},t.prototype.togglePopup=function(){var t=this;this.popup.toggle(this._elementRef.nativeElement,""),setTimeout(function(){t.popupVisible&&t.focusPopup()})},t.prototype.btnClick=function(t){this.togglePopup()},t.prototype.popupClose=function(t){var i=this;e.Utils.detectMobile()||(this.input.nativeElement.focus(),setTimeout(function(){var t=i.input.nativeElement.value;t!==undefined&&i._renderer&&(i._renderer.setProperty(i.input.nativeElement,"selectionStart",0),i._renderer.setProperty(i.input.nativeElement,"selectionEnd",t.length))}))},t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),this.state.touchMode?this.popup.position="MODAL":this.popup.position="RELATIVE",this.valueTemp=t,this.valueChanged=e,this.height=i,this.ie=n,this.state.iOS&&y.focusAndOpenKeyboard(this.input.nativeElement,50)},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.inputChange=function(t){this.change.emit(t)},t.prototype.inputKeyDown=function(t){if(!t.defaultPrevented)return t.keyCode===e.Keys.DOWN&&t.altKey&&!this.popup.visible?(this.togglePopup(),t.preventDefault(),void t.stopPropagation()):void(t.keyCode!==e.Keys.UP&&t.keyCode!==e.Keys.DOWN&&t.keyCode!==e.Keys.PAGE_UP&&t.keyCode!==e.Keys.PAGE_DOWN&&t.keyCode!==e.Keys.TAB&&(t.stopPropagation(),t.keyCode!==e.Keys.ESCAPE?t.keyCode!==e.Keys.ENTER||this.commit.emit(this.value):this.cancel.emit()))},t.prototype.escape=function(t){this.popup.closePopup()},t.prototype.acceptKey=function(t){this.maskDateDirective.keyDown(e.Keys.generateEvent(this.input.nativeElement,-1,e.Keys.keyChar(t),t.shiftKey,t.ctrlKey))},t.prototype.ngAfterContentInit=function(){var t=this;if(this.valueChanged){this.input.nativeElement.focus();var i=this.valueTemp;setTimeout(function(){for(var n=0;n<i.length;n++){var r=e.Keys.generateEvent(null,0,i[n]);t.acceptKey(r)}t._initialized=!0})}else this.value=this.valueTemp,this.maskDateDirective.pattern=this.column.format,this.maskDateDirective.writeValue(this.value),setTimeout(function(){t.state.touchMode||t.input.nativeElement.select(),t.input.nativeElement.focus()}),this._initialized=!0},t.prototype.focusPopup=function(){this.calendar.setFocus()},t.prototype.getClass=function(){return null!==this.height&&this.height>0?"true-grid__input-container":this.ie?"true-grid-editor-ie":"true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},t.prototype.purify=function(t){return t===undefined||null===t||isNaN(t.getTime())?null:t},u([i.ViewChild("popup",{"static":!0}),p("design:type",C)],t.prototype,"popup",void 0),u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],t.prototype,"input",void 0),u([i.ViewChild("calendar",{"static":!0}),p("design:type",_)],t.prototype,"calendar",void 0),u([i.ViewChild("input",{read:x,"static":!0}),p("design:type",x)],t.prototype,"maskDateDirective",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),t=u([i.Component({selector:"true-editor-test",template:'<true-input-wrapper\n    class="true-datepicker__input"\n    (btnClick)="btnClick($event)"\n    [ngClass]="getClass()"\n    [style.height]="getH()"\n    [icon]="getIcon()"><input #input\n                  class="true-grid-input"\n                  [true-mask-date]="column.format"\n                  [(ngModel)]="value"\n                  (ngModelChange)="inputChange($event)"\n                  [style.height]="getH()"\n                  (mousedown)="inputMouseDown($event)"\n                  (keydown)="inputKeyDown($event)" /></true-input-wrapper><true-popup #popup (close)="popupClose($event)">\n                    <true-calendar #calendar\n                        *ngIf="popupVisible"\n                        [(ngModel)]="value"\n                        (escape)="escape($event)"\n                        (dateClick)="dateClick($event)">\n                    </true-calendar>\n                  </true-popup>',styles:["\n    :host {\n      padding: 0;\n    }\n    .true-datepicker__input {\n      border: 0;\n    }\n    "]}),p("design:paramtypes",[i.Renderer2,i.ElementRef])],t)}(),st=function(){function t(){this.ie=!1,this.value="",this.height=0,this.commit=new i.EventEmitter,this.cancel=new i.EventEmitter,this.change=new i.EventEmitter}return t.prototype.init=function(t,e,i,n,r){void 0===n&&(n=!1),this.ie=n,this.value=t,this.height=i},t.prototype.setValueAndFocus=function(t,e){this.input.nativeElement.focus()},t.prototype.inputMouseDown=function(t){t.stopPropagation()},t.prototype.processKey=function(t){},t.prototype.inputKeyDown=function(t){t.keyCode!==e.Keys.TAB&&(t.stopPropagation(),t.keyCode!==e.Keys.ESCAPE?t.keyCode!==e.Keys.ENTER||this.commit.emit(this.value):this.cancel.emit(!1))},t.prototype.inputBlur=function(t){this.cancel.emit(!0)},t.prototype.getClass=function(){return null!==this.height&&this.height>0?"":this.ie?"true-grid-editor-ie":"true-grid-editor-100p"},t.prototype.getH=function(){return null!==this.height&&this.height>0?this.height+"px":"100%"},u([i.ViewChild("input",{"static":!0}),p("design:type",Object)],t.prototype,"input",void 0),u([i.Output("commit"),p("design:type",i.EventEmitter)],t.prototype,"commit",void 0),u([i.Output("cancel"),p("design:type",i.EventEmitter)],t.prototype,"cancel",void 0),u([i.Output("change"),p("design:type",i.EventEmitter)],t.prototype,"change",void 0),t=u([i.Component({selector:"true-editor-select",template:'<select #input\n                  class="true-grid-input"\n                  [(ngModel)]="value"\n                  [style.height]="getH()"\n                  [ngClass]="getClass()"\n                  (mousedown)="inputMouseDown($event)"\n                  (keydown)="inputKeyDown($event)"\n                  (blur)="inputBlur($event)">\n                <option value="CELL">CELL</option>\n                <option value="ROW">ROW</option>\n              </select>\n                  ',styles:["\n    :host {\n      padding: 0;\n    }\n    "]})],t)}(),at=function(){function t(t){this._elementRef=t,this.isMenuItem=!1}return t.prototype.click=function(t){this.isMenuItem||this.menu.showByTarget(t.target),t.preventDefault()},t.prototype.closePopup=function(){this._elementRef.nativeElement.classList.remove("true-submenu-visible"),this.menu.closeSubMenus(null),this.menu.closePopup(!1)},t.prototype.itemMouseEnter=function(t){this.isMenuItem&&(this.menu.showByTarget(t.target,"right",t.parent),this._elementRef.nativeElement.classList.add("true-submenu-visible"))},t.prototype.needClose=function(t){this.closePopup()},t.prototype.ngOnInit=function(){this._elementRef.nativeElement.classList.contains("true-menu-item")&&(this.isMenuItem=!0)},u([i.Input("true-menu-show"),p("design:type",B)],t.prototype,"menu",void 0),t=u([i.Directive({selector:"[true-menu-show]",host:{"(click)":"click($event)","(itemMouseEnter)":"itemMouseEnter($event)","(needClose)":"needClose($event)"}}),p("design:paramtypes",[i.ElementRef])],t)}(),lt=function(t){function n(e,i,n){var r=t.call(this,e,i,n)||this;return r._renderer=e,r._elementRef=i,r.intl=n,r.onChange=function(t){},r.onTouched=function(){},r}var o;return l(n,t),o=n,n.prototype.registerOnChange=function(t){this.onChange=t},n.prototype.registerOnTouched=function(t){this.onTouched=t},n.prototype.blur=function(){var t=this._mask.applyMask(this._txtValue);""!==t||this._mask.settings.allowIncomplete?t!==this._txtValue&&this.setText(t):this.setText(""),this.onTouched()},n.prototype.input=function(t){this.doInput(t)},n.prototype.updateState=function(){""===this._txtValue?this.state=e.MaskState.EMPTY:this._mask.checkMask(this._txtValue)?this.state=e.MaskState.OK:this.state=e.MaskState.TYPING},n.prototype.toModel=function(){this.onChange(this._txtValue),this.updateState()},n.prototype.writeValue=function(t){this._txtValue!==t&&this.setText(t,!1),this.updateState()},Object.defineProperty(n.prototype,"pattern",{get:function(){return this._mask.pattern},set:function(t){if(""!==this._txtValue&&""!==this._mask.pattern&&this._mask.pattern!==t){var e=this.currentRes(),i=this._mask.pureValue(e.newValue);this._mask.pattern=t,e.newValue=this._mask.applyPureValue(i),this.setRes(e)}else this._mask.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"settings",{set:function(t){this._mask.settings=t},enumerable:!0,configurable:!0}),n.prototype.keyDown=function(t){return this.processKey(t)},u([i.Input("true-mask"),p("design:type",String),p("design:paramtypes",[String])],n.prototype,"pattern",null),u([i.Input("true-mask-settings"),p("design:type",e.MaskSettings),p("design:paramtypes",[e.MaskSettings])],n.prototype,"settings",null),u([i.HostListener("keydown",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],n.prototype,"keyDown",null),n=o=u([i.Directive({selector:"[true-mask]",host:{"(input)":"input($event.target.value)","(blur)":"blur()"},providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return o}),multi:!0}]}),p("design:paramtypes",[i.Renderer2,i.ElementRef,h])],n)}(k),ut=function(){function t(){}return t=u([i.NgModule({imports:[r.FormsModule,s.CommonModule],providers:[h],declarations:[D,Q,X,it,tt,et,nt,rt,j,Y,H,z,U,$,W,ot,O,st,I,A,T,F,L,E,w,b,J,Z,v,_,S,q,C,V,B,at,G,k,M,x,lt,d],entryComponents:[z,U,$,W,ot,O,st,I,A,T,F,L,Z,G],exports:[D,w,b,v,J,Z,C,S,_,q,X,Q,j,it,tt,et,nt,Y,B,V,G,lt,x,M,d]})],t)}();Object.defineProperty(t,"AxInject",{enumerable:!0,get:function(){return e.AxInject}}),Object.defineProperty(t,"AxInjectConsumer",{enumerable:!0,get:function(){return e.AxInjectConsumer}}),Object.defineProperty(t,"CellPosition",{enumerable:!0,get:function(){return e.CellPosition}}),Object.defineProperty(t,"CellRange",{enumerable:!0,get:function(){return e.CellRange}}),Object.defineProperty(t,"CheckedChangedEvent",{enumerable:!0,get:function(){return e.CheckedChangedEvent}}),Object.defineProperty(t,"Column",{enumerable:!0,get:function(){return e.Column}}),Object.defineProperty(t,"ColumnBand",{enumerable:!0,get:function(){return e.ColumnBand}}),Object.defineProperty(t,"ColumnCollection",{enumerable:!0,get:function(){return e.ColumnCollection}}),Object.defineProperty(t,"ColumnType",{enumerable:!0,get:function(){return e.ColumnType}}),Object.defineProperty(t,"DataQuery",{enumerable:!0,get:function(){return e.DataQuery}}),Object.defineProperty(t,"Dates",{enumerable:!0,get:function(){return e.Dates}}),Object.defineProperty(t,"DetectionMode",{enumerable:!0,get:function(){return e.DetectionMode}}),Object.defineProperty(t,"EditorShowMode",{enumerable:!0,get:function(){return e.EditorShowMode}}),Object.defineProperty(t,"Filter",{enumerable:!0,get:function(){return e.Filter}}),Object.defineProperty(t,"FilterOperator",{enumerable:!0,get:function(){return e.FilterOperator}}),Object.defineProperty(t,"GridLayout",{enumerable:!0,get:function(){return e.GridLayout}}),Object.defineProperty(t,"GridLayoutRange",{enumerable:!0,get:function(){return e.GridLayoutRange}}),Object.defineProperty(t,"GridPart",{enumerable:!0,get:function(){return e.GridPart}}),Object.defineProperty(t,"GridSettings",{enumerable:!0,get:function(){return e.GridSettings}}),Object.defineProperty(t,"GridState",{enumerable:!0,get:function(){return e.GridState}}),Object.defineProperty(t,"GridUIHandler",{enumerable:!0,get:function(){return e.GridUIHandler}}),Object.defineProperty(t,"Keys",{enumerable:!0,get:function(){return e.Keys}}),Object.defineProperty(t,"LayoutsHandler",{enumerable:!0,get:function(){return e.LayoutsHandler}}),Object.defineProperty(t,"LazyLoadingMode",{enumerable:!0,get:function(){return e.LazyLoadingMode}}),Object.defineProperty(t,"Locale",{enumerable:!0,get:function(){return e.Locale}}),Object.defineProperty(t,"MenuAction",{enumerable:!0,get:function(){return e.MenuAction}}),Object.defineProperty(t,"RenderMode",{enumerable:!0,get:function(){return e.RenderMode}}),Object.defineProperty(t,"SelectionMode",{enumerable:!0,get:function(){return e.SelectionMode}}),Object.defineProperty(t,"SortInfo",{enumerable:!0,get:function(){return e.SortInfo}}),Object.defineProperty(t,"SortType",{enumerable:!0,get:function(){return e.SortType}}),Object.defineProperty(t,"Summary",{enumerable:!0,get:function(){return e.Summary}}),Object.defineProperty(t,"SummaryPipe",{enumerable:!0,get:function(){return e.SummaryPipe}}),Object.defineProperty(t,"SummaryType",{enumerable:!0,get:function(){return e.SummaryType}}),Object.defineProperty(t,"UIAction",{enumerable:!0,get:function(){return e.UIAction}}),Object.defineProperty(t,"UIActionType",{enumerable:!0,get:function(){return e.UIActionType}}),Object.defineProperty(t,"Utils",{enumerable:!0,get:function(){return e.Utils}}),Object.defineProperty(t,"ValueChangedEvent",{enumerable:!0,get:function(){return e.ValueChangedEvent}}),t.BaseComponent=P,t.CalendarComponent=_,t.CheckboxComponent=v,t.CheckboxWrapperComponent=b,t.DatepickerComponent=S,t.DialogAlertComponent=Z,t.DialogButton=N,t.DialogInfo=K,t.DialogWrapperComponent=J,t.FilterBaseComponent=H,t.FilterBooleanComponent=W,t.FilterDateComponent=U,t.FilterNumberComponent=$,t.FilterPopupComponent=Y,t.GridComponent=Q,t.GridEvents=f,t.GridHeaderBandComponent=et,t.GridHeaderCellComponent=tt,t.GridHeaderComponent=it,t.GridStateService=m,t.InputWrapperComponent=w,t.InternationalizationService=h,t.MaskDateDirective=x,t.MaskNumberDirective=M,t.MenuComponent=B,t.MenuStarterComponent=G,t.PopupComponent=C,t.RowCell=R,t.RowDirective=j,t.ScrollerComponent=D,t.SelectComponent=q,t.TranslatePipe=d,t.TrueDirectiveGridModule=ut,t.ɵa=E,t.ɵb=k,t.ɵc=V,t.ɵd=X,t.ɵe=nt,t.ɵf=rt,t.ɵg=z,t.ɵh=ot,t.ɵi=O,t.ɵj=st,t.ɵk=I,t.ɵl=A,t.ɵm=T,t.ɵn=F,t.ɵo=L,t.ɵp=at,t.ɵq=lt,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=true-directive-grid.umd.min.js.map