UNPKG

@neocomplexx/ngx-neo-directives

Version:

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.5.

16 lines (14 loc) 24 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@ng-bootstrap/ng-bootstrap")):"function"==typeof define&&define.amd?define("@neocomplexx/ngx-neo-directives",["exports","@angular/core","rxjs","rxjs/operators","@angular/forms","@ng-bootstrap/ng-bootstrap"],t):t(((e=e||self).neocomplexx=e.neocomplexx||{},e.neocomplexx["ngx-neo-directives"]={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.forms,e.ngBootstrap)}(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){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}function a(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:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){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=(o=r.trys).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,a])}}}var l=function(){function e(e){this._el=e,this.setEnabled=!0,this.el=this._el}return e.prototype.onKeyDown=function(t){if(13===t.which||13===t.keyCode)return t.preventDefault(),void e.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.decorators=[{type:t.Directive,args:[{selector:"[onReturn]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={onReturn:[{type:t.Input}],setEnabled:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();var u=new t.InjectionToken("COMMAND_CONFIG"),c={executingCssClass:"executing"},p=function(){function e(e,t){this.renderer=e,this.element=t,this.stopPropagation=!1,this.setEnabled=!0,this.config=c,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 r(e,void 0,void 0,(function(){return a(this,(function(e){return t.preventDefault(),t.stopPropagation(),"input"===this.element.nativeElement.localName?[2]:(this.executeCommand(),[2])}))}))})),this.element.nativeElement.addEventListener("focusin",(function(t){return r(e,void 0,void 0,(function(){return a(this,(function(e){return t.preventDefault(),t.stopPropagation(),this.executeCommand(),[2]}))}))}))):(this.element.nativeElement.addEventListener("keydown",(function(t){return r(e,void 0,void 0,(function(){return a(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 r(e,void 0,void 0,(function(){return a(this,(function(e){return"input"===this.element.nativeElement.localName?[2]:(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)?!0:/android/i.test(e)?!0:/iPad|iPhone|iPod/.test(e)&&!0,!1},e.decorators=[{type:t.Directive,args:[{selector:"[command]"}]}],e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef}]},e.propDecorators={command:[{type:t.Input}],commandOptions:[{type:t.Input}],commandCanExecute:[{type:t.Input}],commandValue:[{type:t.Input}],stopPropagation:[{type:t.Input}],commandNextFocus:[{type:t.Input}],setEnabled:[{type:t.Input}]},e}();var h=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 r(this,void 0,void 0,(function(){return a(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)),l.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}();var m=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.decorators=[{type:t.Directive,args:[{selector:"[maxLength]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={maxLength:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();var y=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.decorators=[{type:t.Directive,args:[{selector:"[isNumber]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:o.NgModel}]},e.propDecorators={isNumber:[{type:t.Input}],allowNullValue:[{type:t.Input,args:["allowNullValue"]}],blockPaste:[{type:t.HostListener,args:["paste",["$event"]]}],onfocus:[{type:t.HostListener,args:["focus"]}],onBlur:[{type:t.HostListener,args:["blur"]}],onKeyUp:[{type:t.HostListener,args:["keyup",["$event"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();var d=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){if(t.length>0){var n=e.el;n.activeId!==t&&n.select(t)}})))},e.prototype.ngOnDestroy=function(){this.tabSelectedIdSubscribe&&this.tabSelectedIdSubscribe.unsubscribe()},e.prototype.onTabChange=function(e){return r(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this.onTabChanging?[2]:(this.onTabChanging=!0,this.tabChangeController?(e.preventDefault(),[4,this.tabChangeController.canChangeTab()]):[3,2]);case 1:return t.sent()&&this.cambiarTab(e,!0),[3,3];case 2:this.cambiarTab(e),t.label=3;case 3:return this.onTabChanging=!1,[2]}}))}))},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.decorators=[{type:t.Directive,args:[{selector:"[tabSelectedId], [tabChangeController]"}]}],e.ctorParameters=function(){return[{type:s.NgbTabset}]},e.propDecorators={tabSelectedId:[{type:t.Input}],tabChangeController:[{type:t.Input}],onTabChange:[{type:t.HostListener,args:["tabChange",["$event"]]}]},e}();var 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.decorators=[{type:t.Directive,args:[{selector:"[neoAutofocus]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={neoAutofocus:[{type:t.Input,args:["neoAutofocus"]}]},e}();var v=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.decorators=[{type:t.Directive,args:[{selector:"[changeCommand]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={changeCommand:[{type:t.Input}],onInputChange:[{type:t.HostListener,args:["keyup",["$event"]]}]},e}();var g=function(){function e(e,t,n){this.el=e,this.renderer=t,this.model=n,this.decimals=2,this.allowNullValue=!1,this.haveDecimalPoint=!1}return e.prototype.ngOnInit=function(){""==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,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(){"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){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.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.decorators=[{type:t.Directive,args:[{selector:"[isDecimal]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:o.NgModel}]},e.propDecorators={decimals:[{type:t.Input,args:["isDecimal"]}],allowNullValue:[{type:t.Input,args:["allowNullValue"]}],blockPaste:[{type:t.HostListener,args:["paste",["$event"]]}],onfocus:[{type:t.HostListener,args:["focus"]}],onBlur:[{type:t.HostListener,args:["blur"]}],onKeyUp:[{type:t.HostListener,args:["keyup",["$event"]]}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();function E(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 b=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(!E(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.decorators=[{type:t.Directive,args:[{selector:"[compositeInput]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={previousInput:[{type:t.Input}],nextInput:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}],onKeyUp:[{type:t.HostListener,args:["keyup",["$event"]]}],onFocus:[{type:t.HostListener,args:["focus",[]]}]},e}();var x=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.decorators=[{type:t.Directive,args:[{selector:"[neoMatchHeight]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={matchHeightClassName:[{type:t.Input,args:["neoMatchHeight"]}],onResize:[{type:t.HostListener,args:["window:resize"]}]},e}();var k=function(){function e(){}return e.forRoot=function(t){return void 0===t&&(t={executingCssClass:"executing"}),{ngModule:e,providers:[{provide:u,useValue:t}]}},e.decorators=[{type:t.NgModule,args:[{imports:[],declarations:[p,l,m,y,d,f,v,g,b,x],exports:[p,l,m,y,d,f,v,g,b,x]}]}],e}();e.COMMAND_CONFIG=u,e.COMMAND_DEFAULT_CONFIG=c,e.Command=h,e.CommandDirective=p,e.NeoAutofocusDirective=f,e.NeoChangeCommandDirective=v,e.NeoCompositeInputDirective=b,e.NeoDecimalNumbersDirective=g,e.NeoMatchHeightDirective=x,e.NeoNumbersDirective=y,e.NgbTabSetDirective=d,e.NgxNeoDirectivesModule=k,e.OnReturnDirective=l,e.StringsDirective=m,e.isCommandKey=E,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=neocomplexx-ngx-neo-directives.umd.min.js.map