@neocomplexx/ngx-neo-directives-mat
Version:
16 lines (14 loc) • 26.8 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@angular/material/tabs")):"function"==typeof define&&define.amd?define("@neocomplexx/ngx-neo-directives-mat",["exports","@angular/core","rxjs","rxjs/operators","@angular/forms","@angular/material/tabs"],t):t(((e=e||self).neocomplexx=e.neocomplexx||{},e.neocomplexx["ngx-neo-directives-mat"]={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.forms,e.ng.material.tabs)}(this,(function(e,t,n,i,o,s){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function r(e,t,n,i){var o,s=arguments.length,r=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function a(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{a(i.next(e))}catch(e){s(e)}}function l(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}a((i=i.apply(e,t||[])).next())}))}function u(e,t){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var c=function(){function e(e){this._el=e,this.setEnabled=!0,this.el=this._el}var n;return n=e,e.prototype.onKeyDown=function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),void n.setNextFocus(this.onReturn,this.setEnabled)},e.setNextFocus=function(e,t){if(void 0===t&&(t=!0),e instanceof Array)for(var n=!1,i=0;!n&&i<e.length;){if(o=e[i])if(o instanceof HTMLInputElement||o instanceof HTMLButtonElement||o instanceof HTMLSelectElement||o instanceof HTMLSelectElement)o.disabled||(o.focus(),n=!0);else if(o&&o.nativeElement instanceof HTMLInputElement||o.nativeElement instanceof HTMLButtonElement||o.nativeElement instanceof HTMLSelectElement)o.nativeElement.disabled||(o.nativeElement.focus(),n=!0);else(s=o.ctrInput)?(s=s.nativeElement)&&s instanceof HTMLInputElement&&(s.disabled||(s.focus(),n=!0)):(o=document.getElementById(o))&&(o.disabled&&t&&(o.disabled=!1),o.disabled||(o.focus(),n=!0));i++}else if(e){var o,s;if((o=e)instanceof HTMLInputElement||o instanceof HTMLButtonElement||o instanceof HTMLSelectElement)o.disabled&&(o.disabled=!1),o.focus();else(s=o.ctrInput)?(s=s.nativeElement)&&s instanceof HTMLInputElement&&(s.disabled&&(s.disabled=!1),s.focus()):(o=document.getElementById(e))&&(o.disabled&&t&&(o.disabled=!1),o.focus())}},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input(),l("design:type",Object)],e.prototype,"onReturn",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"setEnabled",void 0),r([t.HostListener("keydown",["$event"]),l("design:type",Function),l("design:paramtypes",[Object]),l("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=n=r([t.Directive({selector:"[onReturn]"}),l("design:paramtypes",[t.ElementRef])],e)}(),p=new t.InjectionToken("COMMAND_CONFIG"),d={executingCssClass:"executing"},m=function(){function e(e,t){this.renderer=e,this.element=t,this.stopPropagation=!1,this.setEnabled=!0,this.config=d,this.ownDisabledState=!1,this.commandDisabledChanged=!1}return e.prototype.ngOnInit=function(){var e=this;if(this.commandOptions=Object.assign({},this.config,this.commandOptions),!this.command)throw new Error("[commandDirective] command should be defined!");this.command.verifyCommandExecutionPipe(),this.command.setNextFocus(this.commandNextFocus),this.command.setEnabledValue(this.setEnabled),this.canExecute$$=this.command.canExecute$.pipe(i.tap((function(t){"button"===e.element.nativeElement.localName&&(e.commandDisabledChanged=!0,e.commandValue==e.command.executingParam&&(e.element.nativeElement.disabled=!t))}))).subscribe(),this.isExecuting$$=this.command.isExecuting$.pipe(i.tap((function(t){t?e.renderer.addClass(e.element.nativeElement,e.commandOptions.executingCssClass):e.renderer.removeClass(e.element.nativeElement,e.commandOptions.executingCssClass)}))).subscribe(),this.isMobileOperatingSystem()?(this.element.nativeElement.addEventListener("touchstart",(function(t){return a(e,void 0,void 0,(function(){return u(this,(function(e){return t.preventDefault(),t.stopPropagation(),"input"===this.element.nativeElement.localName||this.executeCommand(),[2]}))}))})),this.element.nativeElement.addEventListener("focusin",(function(t){return a(e,void 0,void 0,(function(){return u(this,(function(e){return t.preventDefault(),t.stopPropagation(),this.executeCommand(),[2]}))}))}))):(this.element.nativeElement.addEventListener("keydown",(function(t){return a(e,void 0,void 0,(function(){return u(this,(function(e){return 13!==t.which&&13!==t.keyCode||(t.preventDefault(),t.stopPropagation(),this.executeCommand()),[2]}))}))})),this.element.nativeElement.addEventListener("click",(function(t){return a(e,void 0,void 0,(function(){return u(this,(function(e){return"input"===this.element.nativeElement.localName||(t.preventDefault(),this.stopPropagation&&t.stopPropagation(),this.executeCommand()),[2]}))}))})))},e.prototype.executeCommand=function(){this.element.nativeElement.disabled||(this.command.canExecute=!0),this.command.verifyCommandExecutionPipe(),this.command.execute(this.commandValue)},e.prototype.ngOnDestroy=function(){this.command&&this.command.destroy(),this.canExecute$$&&this.canExecute$$.unsubscribe(),this.isExecuting$$&&this.isExecuting$$.unsubscribe()},e.prototype.isMobileOperatingSystem=function(){var e=navigator.userAgent||navigator.vendor;return(/windows phone/i.test(e)||/android/i.test(e)||/iPad|iPhone|iPod/.test(e))&&!0,!1},e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},r([t.Input(),l("design:type",Object)],e.prototype,"command",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"commandOptions",void 0),r([t.Input(),l("design:type",Boolean)],e.prototype,"commandCanExecute",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"commandValue",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"commandNextFocus",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"stopPropagation",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"setEnabled",void 0),e=r([t.Directive({selector:"[command]"}),l("design:paramtypes",[t.Renderer2,t.ElementRef])],e)}(),y=function(){function e(e,t,o,s){var r=this;this.executeParam=e,this.isAsync=o,this.delay=s,this.isExecuting=!1,this.isExecuting$=new n.BehaviorSubject(!1),this.canExecute=!0,this.executionPipe$=new n.Subject,this.setEnabled=!0,t?(this.canExecute$=n.combineLatest(this.isExecuting$,t,(function(e,t){return r.isExecuting=e,r.canExecute=!e&&t,r.canExecute})),this.canExecute$$=this.canExecute$.subscribe()):(this.canExecute$=this.isExecuting$.pipe(i.map((function(e){var t=!e;return r.canExecute=t,t}))),this.isExecuting$$=this.isExecuting$.pipe(i.tap((function(e){return r.isExecuting=e}))).subscribe()),this.buildExecutionPipe(e,o,s)}return e.prototype.verifyCommandExecutionPipe=function(){0===this.executionPipe$.observers.length&&this.buildExecutionPipe(this.executeParam,this.isAsync,this.delay)},e.prototype.execute=function(e){this.executingParam=e,this.executionPipe$.next(e)},e.prototype.executeWithResult=function(e){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.executingParam=e,this.executionPipe$.next(e),[4,this.result];case 1:return[2,t.sent()]}}))}))},e.prototype.destroy=function(){this.executionPipe$$&&this.executionPipe$$.unsubscribe(),this.canExecute$$&&this.canExecute$$.unsubscribe(),this.isExecuting$$&&this.isExecuting$$.unsubscribe(),this.isExecuting$&&this.isExecuting$.complete(),null!=this.asyncAction&&(this.asyncAction=null,this.resultAsyncAction=null)},e.prototype.buildExecutionPipe=function(e,t,o){var s=this,r=this.executionPipe$.pipe(i.filter((function(){return s.canExecute})),i.tap((function(){s.isExecuting$.next(!0),t&&null!=s.asyncAction&&(s.resultAsyncAction=s.asyncAction(void 0))})));r=(r=t?r.pipe(i.switchMap((function(t){if(o&&o>0){s.delaySubscribe&&s.delaySubscribe.unsubscribe();var i=n.timer(o);return s.delaySubscribe=i.subscribe((function(n){e(t)})),Promise.resolve(null)}var r=e(t);return Promise.resolve(r)}))):r.pipe(i.tap((function(t){e(t)})))).pipe(i.tap((function(){s.isExecuting$.next(!1),s.executingParam=void 0,t&&null!=s.asyncAction&&(s.resultAsyncAction=s.asyncAction(s.resultAsyncAction)),c.setNextFocus(s.elementNextFocus,s.setEnabled)}),(function(n){console.log("[command::excutionPipe$] do#2 error - set idle"+n.toString()),s.isExecuting$.next(!1),s.executingParam=void 0,t&&null!=s.asyncAction&&(s.resultAsyncAction=s.asyncAction(s.resultAsyncAction)),s.buildExecutionPipe(e,t,o)}))),this.executionPipe$$=r.subscribe()},e.prototype.setNextFocus=function(e){this.elementNextFocus=e},e.prototype.setEnabledValue=function(e){this.setEnabled=e},e}(),h=function(){function e(e){this._el=e,this.el=this._el}return e.prototype.onKeyDown=function(e){if("Delete"!==e.key&&"Tab"!==e.key&&"Backspace"!==e.key&&"ArrowLeft"!==e.key&&!e.altKey&&!e.ctrlKey&&"Home"!==e.key&&"End"!==e.key&&"PageDown"!==e.key&&"PageUp"!==e.key&&"ArrowRight"!==e.key&&"Control"!==e.key&&"Alt"!==e.key&&"Shift"!==e.key){var t=this._el.nativeElement.value;t&&t.length>=this.maxLength&&e.preventDefault()}},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input(),l("design:type",Object)],e.prototype,"maxLength",void 0),r([t.HostListener("keydown",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=r([t.Directive({selector:"[maxLength]"}),l("design:paramtypes",[t.ElementRef])],e)}(),v=function(){function e(e,t,n){this.el=e,this.renderer=t,this.model=n,this.allowNullValue=!1}return e.prototype.ngOnInit=function(){""===this.allowNullValue&&(this.allowNullValue=!0),this.regex=new RegExp("^\\d+$"),this.el.nativeElement.type="number"},e.prototype.blockPaste=function(e){var t=this,n=(e.clipboardData||window.clipboardData).getData("text/plain").split(",").join("."),i=n.lastIndexOf(".");i>-1&&(n=n.substring(0,i).split(".").join(""));var o=Array.from(n).map((function(e){return t.isOnlyNumber(e)})).reduce((function(e,t){return e&&t}),!0),s=this.regex.test(n);s&&this.el.nativeElement.max&&n.length>this.el.nativeElement.max.length&&(n=n.substr(0,this.el.nativeElement.max.length)),setTimeout((function(){t.el.nativeElement.value=o&&s?n:"0"}),10)},e.prototype.onfocus=function(){"0"==this.el.nativeElement.value&&(this.el.nativeElement.value=null)},e.prototype.onBlur=function(){""==this.el.nativeElement.value?this.allowNullValue?(this.el.nativeElement.value=null,this.model.control.setValue(null)):(this.el.nativeElement.value="0",this.model.control.setValue(0)):(this.el.nativeElement.type="text",this.el.nativeElement.type="number",this.el.nativeElement.max&&this.el.nativeElement.valueAsNumber>+this.el.nativeElement.max&&(this.el.nativeElement.value=this.el.nativeElement.max,this.model.control.setValue(this.el.nativeElement.valueAsNumber)))},e.prototype.onKeyUp=function(e){console.log(e);var t=this.el.nativeElement.value,n=(t=t.split("-").join("")).indexOf(".");if(n>-1&&(t=t.substring(0,n),this.el.nativeElement.value=t),!this.isSpecial(e)&&""!=t)return this.isOnlyNumber(e)?void(this.el.nativeElement.max&&this.el.nativeElement.valueAsNumber>+this.el.nativeElement.max&&(this.el.nativeElement.value=t.substring(0,t.length-1))):(e.preventDefault(),e.stopPropagation(),!1);8!=e.keyCode&&""==t||(this.prev=t)},e.prototype.onKeyDown=function(e){if(!this.isSpecial(e)){if(!this.isOnlyNumber(e))return e.preventDefault(),e.stopPropagation(),!1;var t=this.el.nativeElement.value;this.prev=t}},e.prototype.isSpecial=function(e){return"Delete"===e.key||"Tab"===e.key||9==e.keyCode||"Backspace"===e.key||8==e.keyCode||"ArrowLeft"===e.key||e.altKey||e.ctrlKey||"Home"===e.key||"End"===e.key||"PageDown"===e.key||"PageUp"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key||"Down"==e.keyIdentifier||"Up"==e.keyIdentifier||"Left"==e.keyIdentifier||"Right"==e.keyIdentifier},e.prototype.isOnlyNumber=function(e){return e instanceof KeyboardEvent?e.key>="0"&&e.key<="9"||e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105:e>="0"&&e<="9"},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:o.NgModel}]},r([t.Input(),l("design:type",Object)],e.prototype,"isNumber",void 0),r([t.Input("allowNullValue"),l("design:type",Object)],e.prototype,"allowNullValue",void 0),r([t.HostListener("paste",["$event"]),l("design:type",Function),l("design:paramtypes",[ClipboardEvent]),l("design:returntype",void 0)],e.prototype,"blockPaste",null),r([t.HostListener("focus"),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onfocus",null),r([t.HostListener("blur"),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onBlur",null),r([t.HostListener("keyup",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyUp",null),r([t.HostListener("keydown",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=r([t.Directive({selector:"[isNumber]"}),l("design:paramtypes",[t.ElementRef,t.Renderer2,o.NgModel])],e)}(),f=function(){function e(e){this.el=e}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){var e=this;this.subscription=n.timer(100).subscribe((function(){e.neoAutofocus&&e.setFocus(),e.subscription.unsubscribe()}))},e.prototype.setFocus=function(){if(this.el)if(this.el instanceof HTMLInputElement||this.el instanceof HTMLButtonElement||this.el instanceof HTMLSelectElement||this.el instanceof HTMLSelectElement)this.el.disabled||this.el.focus();else if(this.el&&this.el.nativeElement instanceof HTMLInputElement||this.el.nativeElement instanceof HTMLButtonElement||this.el.nativeElement instanceof HTMLSelectElement)this.el.nativeElement.disabled||this.el.nativeElement.focus();else{var e=this.el.ctrInput;e&&(e=e.nativeElement)&&e instanceof HTMLInputElement&&(e.disabled||e.focus())}},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input("neoAutofocus"),l("design:type",Boolean)],e.prototype,"neoAutofocus",void 0),e=r([t.Directive({selector:"[neoAutofocus]"}),l("design:paramtypes",[t.ElementRef])],e)}(),g=function(){function e(e){this.element=e}return e.prototype.onInputChange=function(e){var t=this.element.nativeElement.value;this._lastValue&&this._lastValue===t||(this._lastValue=t,this.changeCommand.execute(t))},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input(),l("design:type",Object)],e.prototype,"changeCommand",void 0),r([t.HostListener("keyup",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onInputChange",null),e=r([t.Directive({selector:"[changeCommand]"}),l("design:paramtypes",[t.ElementRef])],e)}(),E=function(){function e(e,t,n){this.el=e,this.renderer=t,this.model=n,this.allowNullValue=!1,this.decimals=2,this.haveDecimalPoint=!1}return e.prototype.ngOnInit=function(){var e,t;this.options&&!this.options.apply||(this.decimals=null!==(t=null===(e=this.options)||void 0===e?void 0:e.decimals)&&void 0!==t?t:2,""==this.decimals&&(this.decimals=2),""===this.allowNullValue&&(this.allowNullValue=!0),this.el.nativeElement.type="number",this.regex=new RegExp("^[0-9]+(\\.[0-9]{0,"+this.decimals+"})?$"))},e.prototype.blockPaste=function(e){var t=this;if(!this.options||this.options.apply){var n=(e.clipboardData||window.clipboardData).getData("text/plain").split(",").join("."),i=n.lastIndexOf(".");i>-1&&(i=(n=n.substring(0,i).split(".").join("")+n.substring(i)).lastIndexOf("."))+this.decimals<n.length&&(n=n.substring(0,i+this.decimals+1));var o=Array.from(n).map((function(e){return t.isNumber(e)})).reduce((function(e,t){return e&&t}),!0),s=this.regex.test(n);setTimeout((function(){t.el.nativeElement.value=o&&s?n:"0"}),10)}},e.prototype.onfocus=function(){this.options&&!this.options.apply||"0"==this.el.nativeElement.value&&(this.el.nativeElement.value=null)},e.prototype.onBlur=function(){this.options&&!this.options.apply||(""==this.el.nativeElement.value?this.allowNullValue?(this.el.nativeElement.value=null,this.model.control.setValue(null)):(this.el.nativeElement.value="0",this.model.control.setValue(0)):(this.el.nativeElement.type="text",this.el.nativeElement.type="number",this.el.nativeElement.max&&this.el.nativeElement.valueAsNumber>+this.el.nativeElement.max&&(this.el.nativeElement.value=this.el.nativeElement.max,this.model.control.setValue(this.el.nativeElement.valueAsNumber))))},e.prototype.onKeyUp=function(e){if(!this.options||this.options.apply){var t=this.el.nativeElement.value,n=(t=t.split("-").join("")).indexOf(".");if(n>-1&&(this.el.nativeElement.value=t.substring(0,n+1)+t.substring(n).split(".").join("")),this.haveDecimalPoint&&""==t&&this.prev>"")return this.haveDecimalPoint=!1,this.el.nativeElement.value=this.prev+(this.prev.endsWith(".0")?"":".0"),this.el.nativeElement.type="text",this.el.nativeElement.selectionStart=this.el.nativeElement.value.length-1,this.el.nativeElement.selectionEnd=this.el.nativeElement.value.length,void(this.el.nativeElement.type="number");if(this.isSpecial(e)||""==t){8!=e.keyCode&&""==t||(this.prev=t,(i=t.toString().indexOf("."))>=0&&(this.haveDecimalPoint=!1))}else{if(!this.isNumber(e))return e.preventDefault(),e.stopPropagation(),!1;var i;if(t)(i=(t=t.toString()).indexOf("."))>=0&&t.length-1-i>this.decimals&&this.renderer.setProperty(this.el.nativeElement,"value",t.slice(0,i+this.decimals+1));else this.renderer.setProperty(this.el.nativeElement,"value",this.prev)}}},e.prototype.onKeyDown=function(e){if((!this.options||this.options.apply)&&!this.isSpecial(e)){if(!this.isNumber(e))return e.preventDefault(),e.stopPropagation(),!1;var t=this.el.nativeElement.value;this.isDecimalPoint(e)&&(this.haveDecimalPoint=!0,t.endsWith(".0")||(this.el.nativeElement.value=t+".0",this.el.nativeElement.type="text",this.el.nativeElement.selectionStart=this.el.nativeElement.value.length-1,this.el.nativeElement.selectionEnd=this.el.nativeElement.value.length,this.el.nativeElement.type="number")),this.prev=t}},e.prototype.isSpecial=function(e){return"Delete"===e.key||"Tab"===e.key||9==e.keyCode||"Backspace"===e.key||8==e.keyCode||"ArrowLeft"===e.key||e.altKey||e.ctrlKey||"Home"===e.key||"End"===e.key||"PageDown"===e.key||"PageUp"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key||"Down"==e.keyIdentifier||"Up"==e.keyIdentifier},e.prototype.isNumber=function(e){return e instanceof KeyboardEvent?e.key>="0"&&e.key<="9"||e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105||"."===e.key||","===e.key||188===e.keyCode||190===e.keyCode||229===e.keyCode:e>="0"&&e<="9"||"."===e||","===e},e.prototype.isDecimalPoint=function(e){return"."===e.key||","===e.key||188===e.keyCode||190===e.keyCode||229===e.keyCode},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:o.NgModel}]},r([t.Input("isDecimal"),l("design:type",Object)],e.prototype,"options",void 0),r([t.Input("allowNullValue"),l("design:type",Object)],e.prototype,"allowNullValue",void 0),r([t.HostListener("paste",["$event"]),l("design:type",Function),l("design:paramtypes",[ClipboardEvent]),l("design:returntype",void 0)],e.prototype,"blockPaste",null),r([t.HostListener("focus"),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onfocus",null),r([t.HostListener("blur"),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onBlur",null),r([t.HostListener("keyup",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyUp",null),r([t.HostListener("keydown",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=r([t.Directive({selector:"[isDecimal]"}),l("design:paramtypes",[t.ElementRef,t.Renderer2,o.NgModel])],e)}();function b(e){return"Delete"===e.key||"Tab"===e.key||"Backspace"===e.key||"ArrowLeft"===e.key||"Left"===e.key||e.altKey||e.ctrlKey||"Home"===e.key||"End"===e.key||"PageDown"===e.key||"PageUp"===e.key||"ArrowRight"===e.key||"Right"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key}var x=function(){function e(e){this.el=e,this.previousInput=null,this.nextInput=null}return e.prototype.onKeyDown=function(e){return!("Backspace"!==e.key||!this.elementIsSelected())||(("Backspace"===e.key&&0===this.el.nativeElement.selectionStart||"ArrowLeft"===e.key||"Left"===e.key)&&this.previousInput&&this.previousInput instanceof HTMLInputElement&&!this.previousInput.disabled?(this.previousInput.focus(),!1):("ArrowRight"===e.key||"Right"===e.key)&&this.nextInput&&this.nextInput instanceof HTMLInputElement&&!this.nextInput.disabled?(this.nextInput.focus(),!1):void 0)},e.prototype.onKeyUp=function(e){if(!b(e)){var t=this.el.nativeElement.value;this.nextInput&&t.length>=this.el.nativeElement.maxLength&&this.nextInput.focus()}},e.prototype.onFocus=function(){this.el.nativeElement.select()},e.prototype.elementIsSelected=function(){return 0===this.el.nativeElement.selectionStart&&0!==this.el.nativeElement.selectionEnd},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input(),l("design:type",Object)],e.prototype,"previousInput",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"nextInput",void 0),r([t.HostListener("keydown",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyDown",null),r([t.HostListener("keyup",["$event"]),l("design:type",Function),l("design:paramtypes",[KeyboardEvent]),l("design:returntype",void 0)],e.prototype,"onKeyUp",null),r([t.HostListener("focus",[]),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onFocus",null),e=r([t.Directive({selector:"[compositeInput]"}),l("design:paramtypes",[t.ElementRef])],e)}(),k=function(){function e(e){this.el=e}return e.prototype.onResize=function(){this.matchHeight(this.el.nativeElement,this.matchHeightClassName)},e.prototype.ngAfterViewChecked=function(){this.matchHeight(this.el.nativeElement,this.matchHeightClassName)},e.prototype.matchHeight=function(e,t){if(e){var n=e.getElementsByClassName(t);if(n){Array.from(n).forEach((function(e){e.style.height="initial"}));var i=Array.from(n).map((function(e){return e.getBoundingClientRect().height})).reduce((function(e,t){return t>e?t:e}),0);Array.from(n).forEach((function(e){return e.style.height=i+"px"}))}}},e.ctorParameters=function(){return[{type:t.ElementRef}]},r([t.Input("neoMatchHeight"),l("design:type",String)],e.prototype,"matchHeightClassName",void 0),r([t.HostListener("window:resize"),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"onResize",null),e=r([t.Directive({selector:"[neoMatchHeight]"}),l("design:paramtypes",[t.ElementRef])],e)}(),I=function(){function e(e){this._el=e,this.el=this._el,this.onTabChanging=!1}return e.prototype.ngOnInit=function(){var e=this;this.tabSelectedId&&(this.tabSelectedIdSubscribe=this.tabSelectedId.subscribe((function(t){t>-1&&e.el.selectedIndex!==t&&(e.el.selectedIndex=t)})))},e.prototype.ngOnDestroy=function(){this.tabSelectedIdSubscribe&&this.tabSelectedIdSubscribe.unsubscribe()},e.prototype.cambiarTab=function(e,t){void 0===t&&(t=!1);var n=e.nextId;(t||this.tabSelectedId.value!==n)&&this.tabSelectedId.next(n)},e.ctorParameters=function(){return[{type:s.MatTabGroup}]},r([t.Input(),l("design:type",n.BehaviorSubject)],e.prototype,"tabSelectedId",void 0),r([t.Input(),l("design:type",Object)],e.prototype,"tabChangeController",void 0),e=r([t.Directive({selector:"[tabSelectedId], [tabChangeController]"}),l("design:paramtypes",[s.MatTabGroup])],e)}(),w=function(){function e(){}var n;return n=e,e.forRoot=function(e){return void 0===e&&(e={executingCssClass:"executing"}),{ngModule:n,providers:[{provide:p,useValue:e}]}},e=n=r([t.NgModule({imports:[],declarations:[m,c,h,v,f,g,E,x,k,I],exports:[m,c,h,v,f,g,E,x,k,I]})],e)}();e.COMMAND_CONFIG=p,e.COMMAND_DEFAULT_CONFIG=d,e.Command=y,e.CommandDirective=m,e.NeoAutofocusDirective=f,e.NeoChangeCommandDirective=g,e.NeoCompositeInputDirective=x,e.NeoDecimalNumbersDirective=E,e.NeoMatchHeightDirective=k,e.NeoNumbersDirective=v,e.NgxNeoDirectivesModule=w,e.OnReturnDirective=c,e.StringsDirective=h,e.isCommandKey=b,e.ɵa=x,e.ɵb=I,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=neocomplexx-ngx-neo-directives-mat.umd.min.js.map