ngx-input-autosize
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -77,2 +77,5 @@ (function (global, factory) { | ||
}; | ||
AutosizeDirective.prototype.ngAfterViewChecked = function () { | ||
this.adjust(); | ||
}; | ||
AutosizeDirective.prototype.adjust = function () { | ||
@@ -79,0 +82,0 @@ if (this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth >= this.autosizeComponent.el.nativeElement.offsetWidth |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms","@angular/common"],t):t((e.ng=e.ng||{},e.ng.inputautosize={}),e.core,e.forms,e.common)}(this,function(e,t,n,o){"use strict";var i=function(){return function(e){this.el=e}}();i.decorators=[{type:t.Component,args:[{selector:"div[autosize]",template:'<span style="white-space:pre;" #shadowElement>{{autosizeValue}}</span>',styles:[":host { display:block;position: fixed; visibility:hidden; top: -9999px; left: 0px;}"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef}]},i.propDecorators={autosizeValue:[{type:t.Input,args:["autosizeValue"]}],shadowElement:[{type:t.ViewChild,args:["shadowElement"]}]};var r=function(){function e(e,t,n,o){this.resolver=e,this.element=t,this.vc=n,this.ngControl=o,this.supportedInputTypes=["text","search","tel","url","email","password","number"],this.cssProps=["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","boxSizing","borderLeftWidth","borderRightWidth","borderLeftStyle","borderRightStyle","paddingLeft","paddingRight","marginLeft","marginRight"],this.placeholder=""}return e.prototype.onInput=function(e){this.adjust()},e.prototype.ngOnInit=function(){var e=this,t=this.resolver.resolveComponentFactory(i);this.autosizeComponent=this.vc.createComponent(t).instance,this.placeholderAutoSizeComponent=this.vc.createComponent(t).instance;for(var n=0,o=this.cssProps;n<o.length;n++){var r=o[n];this.element.nativeElement.currentStyle?(this.autosizeComponent.shadowElement.nativeElement.style[r]=this.element.nativeElement.currentStyle[r],this.placeholderAutoSizeComponent.shadowElement.nativeElement.style[r]=this.element.nativeElement.currentStyle[r]):window.getComputedStyle&&(this.autosizeComponent.shadowElement.nativeElement.style[r]=getComputedStyle(this.element.nativeElement)[r],this.placeholderAutoSizeComponent.shadowElement.nativeElement.style[r]=getComputedStyle(this.element.nativeElement)[r])}this.ngControl.valueChanges&&this.ngControl.valueChanges.subscribe(function(t){e.autosizeComponent.autosizeValue=t,e.element.nativeElement.placeholder&&(e.placeholder=e.element.nativeElement.placeholder),e.placeholderAutoSizeComponent.autosizeValue=e.placeholder})},e.prototype.ngAfterContentChecked=function(){this.adjust()},e.prototype.adjust=function(){this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth>=this.autosizeComponent.el.nativeElement.offsetWidth&&!this.ngControl.value?this.element.nativeElement.style.width=this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth+"px":this.element.nativeElement.style.width=this.autosizeComponent.el.nativeElement.offsetWidth+"px"},e}();r.decorators=[{type:t.Directive,args:[{selector:"input[autosize]"}]}],r.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:t.ElementRef},{type:t.ViewContainerRef},{type:n.NgControl}]},r.propDecorators={onInput:[{type:t.HostListener,args:["input",["$event.target"]]}]};var s=function(){return function(){}}();s.decorators=[{type:t.NgModule,args:[{declarations:[r,i],imports:[o.CommonModule,n.FormsModule],exports:[r,i],entryComponents:[i]}]}],s.ctorParameters=function(){return[]},e.AutosizeComponent=i,e.AutosizeDirective=r,e.AutosizeInputModule=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms","@angular/common"],t):t((e.ng=e.ng||{},e.ng.inputautosize={}),e.core,e.forms,e.common)}(this,function(e,t,n,o){"use strict";var i=function(){return function(e){this.el=e}}();i.decorators=[{type:t.Component,args:[{selector:"div[autosize]",template:'<span style="white-space:pre;" #shadowElement>{{autosizeValue}}</span>',styles:[":host { display:block;position: fixed; visibility:hidden; top: -9999px; left: 0px;}"]}]}],i.ctorParameters=function(){return[{type:t.ElementRef}]},i.propDecorators={autosizeValue:[{type:t.Input,args:["autosizeValue"]}],shadowElement:[{type:t.ViewChild,args:["shadowElement"]}]};var r=function(){function e(e,t,n,o){this.resolver=e,this.element=t,this.vc=n,this.ngControl=o,this.supportedInputTypes=["text","search","tel","url","email","password","number"],this.cssProps=["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","boxSizing","borderLeftWidth","borderRightWidth","borderLeftStyle","borderRightStyle","paddingLeft","paddingRight","marginLeft","marginRight"],this.placeholder=""}return e.prototype.onInput=function(e){this.adjust()},e.prototype.ngOnInit=function(){var e=this,t=this.resolver.resolveComponentFactory(i);this.autosizeComponent=this.vc.createComponent(t).instance,this.placeholderAutoSizeComponent=this.vc.createComponent(t).instance;for(var n=0,o=this.cssProps;n<o.length;n++){var r=o[n];this.element.nativeElement.currentStyle?(this.autosizeComponent.shadowElement.nativeElement.style[r]=this.element.nativeElement.currentStyle[r],this.placeholderAutoSizeComponent.shadowElement.nativeElement.style[r]=this.element.nativeElement.currentStyle[r]):window.getComputedStyle&&(this.autosizeComponent.shadowElement.nativeElement.style[r]=getComputedStyle(this.element.nativeElement)[r],this.placeholderAutoSizeComponent.shadowElement.nativeElement.style[r]=getComputedStyle(this.element.nativeElement)[r])}this.ngControl.valueChanges&&this.ngControl.valueChanges.subscribe(function(t){e.autosizeComponent.autosizeValue=t,e.element.nativeElement.placeholder&&(e.placeholder=e.element.nativeElement.placeholder),e.placeholderAutoSizeComponent.autosizeValue=e.placeholder})},e.prototype.ngAfterContentChecked=function(){this.adjust()},e.prototype.ngAfterViewChecked=function(){this.adjust()},e.prototype.adjust=function(){this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth>=this.autosizeComponent.el.nativeElement.offsetWidth&&!this.ngControl.value?this.element.nativeElement.style.width=this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth+"px":this.element.nativeElement.style.width=this.autosizeComponent.el.nativeElement.offsetWidth+"px"},e}();r.decorators=[{type:t.Directive,args:[{selector:"input[autosize]"}]}],r.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:t.ElementRef},{type:t.ViewContainerRef},{type:n.NgControl}]},r.propDecorators={onInput:[{type:t.HostListener,args:["input",["$event.target"]]}]};var s=function(){return function(){}}();s.decorators=[{type:t.NgModule,args:[{declarations:[r,i],imports:[o.CommonModule,n.FormsModule],exports:[r,i],entryComponents:[i]}]}],s.ctorParameters=function(){return[]},e.AutosizeComponent=i,e.AutosizeDirective=r,e.AutosizeInputModule=s,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "ngx-input-autosize", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "A text input for Angular that resizes itself to the current content.", | ||
@@ -5,0 +5,0 @@ "main": "bundles/ngxinputautosize.umd.js", |
import { NgControl } from '@angular/forms'; | ||
import { AutosizeComponent } from './autosizeInput.component'; | ||
import { ElementRef, AfterContentChecked, OnInit, ViewContainerRef, ComponentFactoryResolver } from '@angular/core'; | ||
export declare class AutosizeDirective implements AfterContentChecked, OnInit { | ||
import { ElementRef, AfterContentChecked, OnInit, ViewContainerRef, ComponentFactoryResolver, AfterViewChecked } from '@angular/core'; | ||
export declare class AutosizeDirective implements AfterContentChecked, OnInit, AfterViewChecked { | ||
private resolver; | ||
@@ -19,3 +19,4 @@ private element; | ||
ngAfterContentChecked(): void; | ||
ngAfterViewChecked(): void; | ||
adjust(): void; | ||
} |
@@ -52,2 +52,5 @@ import { NgControl } from '@angular/forms'; | ||
}; | ||
AutosizeDirective.prototype.ngAfterViewChecked = function () { | ||
this.adjust(); | ||
}; | ||
AutosizeDirective.prototype.adjust = function () { | ||
@@ -54,0 +57,0 @@ if (this.placeholderAutoSizeComponent.el.nativeElement.offsetWidth >= this.autosizeComponent.el.nativeElement.offsetWidth |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"AutosizeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[autosize]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl"}]}],"onInput":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["input",["$event.target"]]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"adjust":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AutosizeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[autosize]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl"}]}],"onInput":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["input",["$event.target"]]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"adjust":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"AutosizeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[autosize]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl"}]}],"onInput":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["input",["$event.target"]]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"ngAfterViewChecked":[{"__symbolic":"method"}],"adjust":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AutosizeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[autosize]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/forms","name":"NgControl"}]}],"onInput":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["input",["$event.target"]]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterContentChecked":[{"__symbolic":"method"}],"ngAfterViewChecked":[{"__symbolic":"method"}],"adjust":[{"__symbolic":"method"}]}}}}] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34958
302