angular-input-counter
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"CounterService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"ngInjectableDef":{}}},"CounterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"angular-input-counter","template":"<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n","styles":[":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"]}]}],"members":{"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"step":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"counterValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"editable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"counterChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":15,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"counter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"increment":[{"__symbolic":"method"}],"decrement":[{"__symbolic":"method"}]}},"AngularCounterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CounterComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":9,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/material/button","name":"MatButtonModule","line":11,"character":4}],"exports":[{"__symbolic":"reference","name":"CounterComponent"}]}]}],"members":{}}},"origins":{"CounterService":"./lib/counter.service","CounterComponent":"./lib/counter.component","AngularCounterModule":"./lib/counter.module"},"importAs":"angular-input-counter"} | ||
{"__symbolic":"module","version":4,"metadata":{"CounterService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"ngInjectableDef":{}}},"CounterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"angular-input-counter","template":"<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n","styles":[":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"]}]}],"members":{"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"step":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"counterValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"counterChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":15,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"counter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"increment":[{"__symbolic":"method"}],"decrement":[{"__symbolic":"method"}]}},"AngularCounterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CounterComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":9,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/material/button","name":"MatButtonModule","line":11,"character":4}],"exports":[{"__symbolic":"reference","name":"CounterComponent"}]}]}],"members":{}}},"origins":{"CounterService":"./lib/counter.service","CounterComponent":"./lib/counter.component","AngularCounterModule":"./lib/counter.module"},"importAs":"angular-input-counter"} |
@@ -36,5 +36,13 @@ (function (global, factory) { | ||
this.color = 'primary'; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
CounterComponent.prototype.ngOnInit = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.counterValue = this.counterValue || this.min; | ||
this.counterChange = new core.EventEmitter(); | ||
} | ||
}; | ||
Object.defineProperty(CounterComponent.prototype, "counter", { | ||
@@ -77,8 +85,6 @@ get: /** | ||
selector: 'angular-input-counter', | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
styles: [":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"] | ||
}] } | ||
]; | ||
/** @nocollapse */ | ||
CounterComponent.ctorParameters = function () { return []; }; | ||
CounterComponent.propDecorators = { | ||
@@ -91,3 +97,3 @@ min: [{ type: core.Input }], | ||
counterValue: [{ type: core.Input }], | ||
editable: [{ type: core.Input }], | ||
readonly: [{ type: core.Input }], | ||
counterChange: [{ type: core.Output }], | ||
@@ -112,3 +118,3 @@ counter: [{ type: core.Input }] | ||
/** @type {?} */ | ||
CounterComponent.prototype.editable; | ||
CounterComponent.prototype.readonly; | ||
/** @type {?} */ | ||
@@ -115,0 +121,0 @@ CounterComponent.prototype.counterChange; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/input"),require("@angular/material/icon"),require("@angular/material/button")):"function"==typeof define&&define.amd?define("angular-input-counter",["exports","@angular/core","@angular/material/input","@angular/material/icon","@angular/material/button"],e):e((t=t||self)["angular-input-counter"]={},t.ng.core,t.ng.material.input,t.ng.material.icon,t.ng.material.button)}(this,(function(t,e,n,r,a){"use strict";var o=function(){function t(){}return t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),u=function(){function t(){this.min=1,this.max=10,this.step=1,this.appearance="none",this.color="primary",this.counterValue=this.counterValue||this.min,this.counterChange=new e.EventEmitter}return Object.defineProperty(t.prototype,"counter",{get:function(){return this.counterValue},enumerable:!0,configurable:!0}),t.prototype.increment=function(){this.counterValue<this.max&&(this.counterValue=this.counterValue+this.step,this.counterChange.emit(this.counterValue))},t.prototype.decrement=function(){this.counterValue>this.min&&(this.counterValue=this.counterValue-this.step,this.counterChange.emit(this.counterValue))},t.decorators=[{type:e.Component,args:[{selector:"angular-input-counter",template:'<mat-form-field [appearance]="appearance">\n <button mat-mini-fab matPrefix [color]="color" (click)="decrement()" [disabled]="counterValue <= min">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type="text" [value]="counterValue" [readonly]="editable">\n\n <button mat-mini-fab matSuffix [color]="color" (click)="increment()" [disabled]="counterValue >= max">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n',styles:[":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={min:[{type:e.Input}],max:[{type:e.Input}],step:[{type:e.Input}],appearance:[{type:e.Input}],color:[{type:e.Input}],counterValue:[{type:e.Input}],editable:[{type:e.Input}],counterChange:[{type:e.Output}],counter:[{type:e.Input}]},t}();var i=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[u],imports:[n.MatInputModule,r.MatIconModule,a.MatButtonModule],exports:[u]}]}],t}();t.AngularCounterModule=i,t.CounterComponent=u,t.CounterService=o,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/input"),require("@angular/material/icon"),require("@angular/material/button")):"function"==typeof define&&define.amd?define("angular-input-counter",["exports","@angular/core","@angular/material/input","@angular/material/icon","@angular/material/button"],e):e((t=t||self)["angular-input-counter"]={},t.ng.core,t.ng.material.input,t.ng.material.icon,t.ng.material.button)}(this,(function(t,e,n,r,o){"use strict";var a=function(){function t(){}return t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),u=function(){function t(){this.min=1,this.max=10,this.step=1,this.appearance="none",this.color="primary"}return t.prototype.ngOnInit=function(){this.counterValue=this.counterValue||this.min,this.counterChange=new e.EventEmitter},Object.defineProperty(t.prototype,"counter",{get:function(){return this.counterValue},enumerable:!0,configurable:!0}),t.prototype.increment=function(){this.counterValue<this.max&&(this.counterValue=this.counterValue+this.step,this.counterChange.emit(this.counterValue))},t.prototype.decrement=function(){this.counterValue>this.min&&(this.counterValue=this.counterValue-this.step,this.counterChange.emit(this.counterValue))},t.decorators=[{type:e.Component,args:[{selector:"angular-input-counter",template:'<mat-form-field [appearance]="appearance">\n <button mat-mini-fab matPrefix [color]="color" (click)="decrement()" [disabled]="counterValue <= min">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type="text" [value]="counterValue" [readonly]="readonly">\n\n <button mat-mini-fab matSuffix [color]="color" (click)="increment()" [disabled]="counterValue >= max">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n',styles:[":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"]}]}],t.propDecorators={min:[{type:e.Input}],max:[{type:e.Input}],step:[{type:e.Input}],appearance:[{type:e.Input}],color:[{type:e.Input}],counterValue:[{type:e.Input}],readonly:[{type:e.Input}],counterChange:[{type:e.Output}],counter:[{type:e.Input}]},t}();var i=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[u],imports:[n.MatInputModule,r.MatIconModule,o.MatButtonModule],exports:[u]}]}],t}();t.AngularCounterModule=i,t.CounterComponent=u,t.CounterService=a,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=angular-input-counter.umd.min.js.map |
@@ -13,2 +13,7 @@ /** | ||
this.color = 'primary'; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
ngOnInit() { | ||
this.counterValue = this.counterValue || this.min; | ||
@@ -45,8 +50,6 @@ this.counterChange = new EventEmitter(); | ||
selector: 'angular-input-counter', | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
styles: [":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"] | ||
}] } | ||
]; | ||
/** @nocollapse */ | ||
CounterComponent.ctorParameters = () => []; | ||
CounterComponent.propDecorators = { | ||
@@ -59,3 +62,3 @@ min: [{ type: Input }], | ||
counterValue: [{ type: Input }], | ||
editable: [{ type: Input }], | ||
readonly: [{ type: Input }], | ||
counterChange: [{ type: Output }], | ||
@@ -78,6 +81,6 @@ counter: [{ type: Input }] | ||
/** @type {?} */ | ||
CounterComponent.prototype.editable; | ||
CounterComponent.prototype.readonly; | ||
/** @type {?} */ | ||
CounterComponent.prototype.counterChange; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLWlucHV0LWNvdW50ZXIvIiwic291cmNlcy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ZSA6IGJvb2xlYW47XG4gIEBPdXRwdXQoKSBjb3VudGVyQ2hhbmdlIDogIEV2ZW50RW1pdHRlcjxudW1iZXI+O1xuICBjb25zdHJ1Y3Rvcigpe1xuICAgIHRoaXMuY291bnRlclZhbHVlID0gdGhpcy5jb3VudGVyVmFsdWUgfHwgdGhpcy5taW47XG4gICAgdGhpcy5jb3VudGVyQ2hhbmdlID0gbmV3IEV2ZW50RW1pdHRlcigpO1xuXG4gIH1cblxuICBASW5wdXQoKVxuICBnZXQgY291bnRlcigpe1xuICAgIHJldHVybiB0aGlzLmNvdW50ZXJWYWx1ZTtcbiAgfVxuXG4gIGluY3JlbWVudCgpe1xuICAgIGlmKHRoaXMuY291bnRlclZhbHVlIDwgdGhpcy5tYXgpIHtcbiAgICAgIHRoaXMuY291bnRlclZhbHVlID0gdGhpcy5jb3VudGVyVmFsdWUgKyB0aGlzLnN0ZXA7XG4gICAgICB0aGlzLmNvdW50ZXJDaGFuZ2UuZW1pdCh0aGlzLmNvdW50ZXJWYWx1ZSk7XG4gICAgfVxuICB9XG5cbiAgZGVjcmVtZW50KCl7XG4gICAgaWYodGhpcy5jb3VudGVyVmFsdWUgPiB0aGlzLm1pbikge1xuICAgICAgdGhpcy5jb3VudGVyVmFsdWUgPSB0aGlzLmNvdW50ZXJWYWx1ZSAtIHRoaXMuc3RlcDtcbiAgICAgIHRoaXMuY291bnRlckNoYW5nZS5lbWl0KHRoaXMuY291bnRlclZhbHVlKTtcbiAgICB9XG4gIH1cblxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLWlucHV0LWNvdW50ZXIvIiwic291cmNlcyI6WyJsaWIvY291bnRlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUs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lckNoYW5nZSA6ICBFdmVudEVtaXR0ZXI8bnVtYmVyPjtcbiAgXG4gIG5nT25Jbml0KCkge1xuICAgIHRoaXMuY291bnRlclZhbHVlID0gdGhpcy5jb3VudGVyVmFsdWUgfHwgdGhpcy5taW47XG4gICAgdGhpcy5jb3VudGVyQ2hhbmdlID0gbmV3IEV2ZW50RW1pdHRlcigpO1xuICB9XG5cbiAgQElucHV0KClcbiAgZ2V0IGNvdW50ZXIoKXtcbiAgICByZXR1cm4gdGhpcy5jb3VudGVyVmFsdWU7XG4gIH1cblxuICBpbmNyZW1lbnQoKXtcbiAgICBpZih0aGlzLmNvdW50ZXJWYWx1ZSA8IHRoaXMubWF4KSB7XG4gICAgICB0aGlzLmNvdW50ZXJWYWx1ZSA9IHRoaXMuY291bnRlclZhbHVlICsgdGhpcy5zdGVwO1xuICAgICAgdGhpcy5jb3VudGVyQ2hhbmdlLmVtaXQodGhpcy5jb3VudGVyVmFsdWUpO1xuICAgIH1cbiAgfVxuXG4gIGRlY3JlbWVudCgpe1xuICAgIGlmKHRoaXMuY291bnRlclZhbHVlID4gdGhpcy5taW4pIHtcbiAgICAgIHRoaXMuY291bnRlclZhbHVlID0gdGhpcy5jb3VudGVyVmFsdWUgLSB0aGlzLnN0ZXA7XG4gICAgICB0aGlzLmNvdW50ZXJDaGFuZ2UuZW1pdCh0aGlzLmNvdW50ZXJWYWx1ZSk7XG4gICAgfVxuICB9XG5cbn1cbiJdfQ== |
@@ -13,5 +13,13 @@ /** | ||
this.color = 'primary'; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
CounterComponent.prototype.ngOnInit = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.counterValue = this.counterValue || this.min; | ||
this.counterChange = new EventEmitter(); | ||
} | ||
}; | ||
Object.defineProperty(CounterComponent.prototype, "counter", { | ||
@@ -54,8 +62,6 @@ get: /** | ||
selector: 'angular-input-counter', | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
styles: [":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"] | ||
}] } | ||
]; | ||
/** @nocollapse */ | ||
CounterComponent.ctorParameters = function () { return []; }; | ||
CounterComponent.propDecorators = { | ||
@@ -68,3 +74,3 @@ min: [{ type: Input }], | ||
counterValue: [{ type: Input }], | ||
editable: [{ type: Input }], | ||
readonly: [{ type: Input }], | ||
counterChange: [{ type: Output }], | ||
@@ -90,6 +96,6 @@ counter: [{ type: Input }] | ||
/** @type {?} */ | ||
CounterComponent.prototype.editable; | ||
CounterComponent.prototype.readonly; | ||
/** @type {?} */ | ||
CounterComponent.prototype.counterChange; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLWlucHV0LWNvdW50ZXIvIiwic291cmNlcyI6WyJsaWIvY291bnRlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI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7XG4gIEBJbnB1dCgpIGNvbG9yID0gJ3ByaW1hcnknO1xuICBASW5wdXQoKSBjb3VudGVyVmFsdWUgOiBudW1iZXI7XG4gIEBJbnB1dCgpIHJlYWRvbmx5IDogYm9vbGVhbjtcbiAgQE91dHB1dCgpIGNvdW50ZXJDaGFuZ2UgOiAgRXZlbnRFbWl0dGVyPG51bWJlcj47XG4gIFxuICBuZ09uSW5pdCgpIHtcbiAgICB0aGlzLmNvdW50ZXJWYWx1ZSA9IHRoaXMuY291bnRlclZhbHVlIHx8IHRoaXMubWluO1xuICAgIHRoaXMuY291bnRlckNoYW5nZSA9IG5ldyBFdmVudEVtaXR0ZXIoKTtcbiAgfVxuXG4gIEBJbnB1dCgpXG4gIGdldCBjb3VudGVyKCl7XG4gICAgcmV0dXJuIHRoaXMuY291bnRlclZhbHVlO1xuICB9XG5cbiAgaW5jcmVtZW50KCl7XG4gICAgaWYodGhpcy5jb3VudGVyVmFsdWUgPCB0aGlzLm1heCkge1xuICAgICAgdGhpcy5jb3VudGVyVmFsdWUgPSB0aGlzLmNvdW50ZXJWYWx1ZSArIHRoaXMuc3RlcDtcbiAgICAgIHRoaXMuY291bnRlckNoYW5nZS5lbWl0KHRoaXMuY291bnRlclZhbHVlKTtcbiAgICB9XG4gIH1cblxuICBkZWNyZW1lbnQoKXtcbiAgICBpZih0aGlzLmNvdW50ZXJWYWx1ZSA+IHRoaXMubWluKSB7XG4gICAgICB0aGlzLmNvdW50ZXJWYWx1ZSA9IHRoaXMuY291bnRlclZhbHVlIC0gdGhpcy5zdGVwO1xuICAgICAgdGhpcy5jb3VudGVyQ2hhbmdlLmVtaXQodGhpcy5jb3VudGVyVmFsdWUpO1xuICAgIH1cbiAgfVxuXG59XG4iXX0= |
@@ -33,2 +33,7 @@ import { Injectable, ɵɵdefineInjectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core'; | ||
this.color = 'primary'; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
ngOnInit() { | ||
this.counterValue = this.counterValue || this.min; | ||
@@ -65,8 +70,6 @@ this.counterChange = new EventEmitter(); | ||
selector: 'angular-input-counter', | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
styles: [":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"] | ||
}] } | ||
]; | ||
/** @nocollapse */ | ||
CounterComponent.ctorParameters = () => []; | ||
CounterComponent.propDecorators = { | ||
@@ -79,3 +82,3 @@ min: [{ type: Input }], | ||
counterValue: [{ type: Input }], | ||
editable: [{ type: Input }], | ||
readonly: [{ type: Input }], | ||
counterChange: [{ type: Output }], | ||
@@ -98,3 +101,3 @@ counter: [{ type: Input }] | ||
/** @type {?} */ | ||
CounterComponent.prototype.editable; | ||
CounterComponent.prototype.readonly; | ||
/** @type {?} */ | ||
@@ -101,0 +104,0 @@ CounterComponent.prototype.counterChange; |
@@ -35,5 +35,13 @@ import { Injectable, ɵɵdefineInjectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core'; | ||
this.color = 'primary'; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
CounterComponent.prototype.ngOnInit = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.counterValue = this.counterValue || this.min; | ||
this.counterChange = new EventEmitter(); | ||
} | ||
}; | ||
Object.defineProperty(CounterComponent.prototype, "counter", { | ||
@@ -76,8 +84,6 @@ get: /** | ||
selector: 'angular-input-counter', | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"editable\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
template: "<mat-form-field [appearance]=\"appearance\">\n <button mat-mini-fab matPrefix [color]=\"color\" (click)=\"decrement()\" [disabled]=\"counterValue <= min\">\n <mat-icon>remove</mat-icon>\n </button>\n <input matInput type=\"text\" [value]=\"counterValue\" [readonly]=\"readonly\">\n\n <button mat-mini-fab matSuffix [color]=\"color\" (click)=\"increment()\" [disabled]=\"counterValue >= max\">\n <mat-icon>add</mat-icon>\n </button>\n</mat-form-field>\n", | ||
styles: [":host ::ng-deep .mat-form-field-infix{width:100%;text-align:center}:host ::ng-deep .mat-mini-fab{width:32px;height:32px}:host ::ng-deep .mat-mini-fab .mat-button-wrapper{padding:3px}"] | ||
}] } | ||
]; | ||
/** @nocollapse */ | ||
CounterComponent.ctorParameters = function () { return []; }; | ||
CounterComponent.propDecorators = { | ||
@@ -90,3 +96,3 @@ min: [{ type: Input }], | ||
counterValue: [{ type: Input }], | ||
editable: [{ type: Input }], | ||
readonly: [{ type: Input }], | ||
counterChange: [{ type: Output }], | ||
@@ -111,3 +117,3 @@ counter: [{ type: Input }] | ||
/** @type {?} */ | ||
CounterComponent.prototype.editable; | ||
CounterComponent.prototype.readonly; | ||
/** @type {?} */ | ||
@@ -114,0 +120,0 @@ CounterComponent.prototype.counterChange; |
@@ -1,3 +0,3 @@ | ||
import { EventEmitter } from '@angular/core'; | ||
export declare class CounterComponent { | ||
import { EventEmitter, OnInit } from '@angular/core'; | ||
export declare class CounterComponent implements OnInit { | ||
min: number; | ||
@@ -9,5 +9,5 @@ max: number; | ||
counterValue: number; | ||
editable: boolean; | ||
readonly: boolean; | ||
counterChange: EventEmitter<number>; | ||
constructor(); | ||
ngOnInit(): void; | ||
readonly counter: number; | ||
@@ -14,0 +14,0 @@ increment(): void; |
{ | ||
"name": "angular-input-counter", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"author": "Dinesh Rawat <dineshrawat.mca@gmail.com>", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/dinesh-rawat/angular-input-counter/issues", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
62251
0.83%754
3.29%