UNPKG

nd-gui

Version:

UI components for NetDocuments

63 lines (58 loc) 3.59 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) : typeof define === 'function' && define.amd ? define('nd-gui/button', ['exports', '@angular/core', '@angular/common'], factory) : (factory((global['nd-gui'] = global['nd-gui'] || {}, global['nd-gui'].button = {}),global.ng.core,global.ng.common)); }(this, (function (exports,core,common) { 'use strict'; var ButtonComponent = /** @class */ (function () { function ButtonComponent() { this.type = "primary"; this.label = "OK"; this.disabled = false; this.buttonClickEvent = new core.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: core.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: core.ChangeDetectionStrategy.OnPush },] }, ]; ButtonComponent.ctorParameters = function () { return []; }; ButtonComponent.propDecorators = { type: [{ type: core.Input }], label: [{ type: core.Input }], disabled: [{ type: core.Input }], classList: [{ type: core.Input }], Id: [{ type: core.Input }], buttonClickEvent: [{ type: core.Output, args: ["onClick",] }] }; var ndButttonModule = /** @class */ (function () { function ndButttonModule() { } return ndButttonModule; }()); ndButttonModule.decorators = [ { type: core.NgModule, args: [{ imports: [common.CommonModule], declarations: [ButtonComponent], exports: [ButtonComponent] },] }, ]; exports.ndButttonModule = ndButttonModule; exports.ButtonComponent = ButtonComponent; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=nd-gui-button.umd.js.map