UNPKG

nd-gui

Version:

UI components for NetDocuments

55 lines (52 loc) 3.15 kB
import { Component, Input, Output, ChangeDetectionStrategy, EventEmitter, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; var ButtonComponent = /** @class */ (function () { function ButtonComponent() { this.type = "primary"; this.label = "OK"; this.disabled = false; this.buttonClickEvent = new EventEmitter(); } ButtonComponent.prototype.ngOnInit = function () { if (this.type !== "primary" && this.type !== "secondary" && this.type !== "multi") { this.type = "primary"; } }; ButtonComponent.prototype.clickEvent = function (e) { if (!this.disabled) { this.buttonClickEvent.emit(e); } }; return ButtonComponent; }()); ButtonComponent.decorators = [ { type: Component, args: [{ selector: 'nd-button', template: "<input type=\"button\"\n [attr.id]=\"Id\"\n class=\"nd-button {{type}}\"\n [ngClass]=\"classList\"\n [class.disabled]=\"disabled\"\n (click)=\"clickEvent($event)\"\n [value]=\"label\"/>\n <ng-content></ng-content>\n", styles: [":host{margin:8px 20px 8px 8px;display:inline-block;position:relative}.nd-button{width:110px;height:38px;border-radius:1px;padding-left:15px;padding-right:15px;border:none;color:#fff;text-align:center;text-decoration:none;text-overflow:ellipsis;overflow:hidden;display:inline-block;font-size:12px;font-weight:600;cursor:pointer;outline:0}.nd-button:active,.nd-button:focus{outline:0}.nd-button.disabled{cursor:default}.nd-button.primary{background-color:#225582}.nd-button.primary:hover{background-color:#39668e}.nd-button.primary:active{background-color:#1e4c74}.nd-button.primary.disabled{background-color:#6488a7;color:#225582}.nd-button.secondary{background-color:#979797}.nd-button.secondary:hover{background-color:#a1a1a1}.nd-button.secondary:active{background-color:#878787}.nd-button.secondary.disabled{background-color:#b6b6b6;color:#979797}.nd-button.multi{background-color:#fff;color:#e66e25;border:1px solid #e66e25}.nd-button.multi:hover{background-color:#e66e25;color:#fff}.nd-button.multi:active{background-color:#d86722}.nd-button.multi.disabled{background-color:#ed9966;color:#e66e25;border-color:#ed9966}"], changeDetection: ChangeDetectionStrategy.OnPush },] }, ]; ButtonComponent.ctorParameters = function () { return []; }; ButtonComponent.propDecorators = { type: [{ type: Input }], label: [{ type: Input }], disabled: [{ type: Input }], classList: [{ type: Input }], Id: [{ type: Input }], buttonClickEvent: [{ type: Output, args: ["onClick",] }] }; var ndButttonModule = /** @class */ (function () { function ndButttonModule() { } return ndButttonModule; }()); ndButttonModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule], declarations: [ButtonComponent], exports: [ButtonComponent] },] }, ]; export { ndButttonModule, ButtonComponent }; //# sourceMappingURL=nd-gui-button.js.map