UNPKG

@lucasferreiralsf/angular-frontend-library

Version:

This is a set of custom angular components to easy the development of any Subway frontend project.

67 lines 7.26 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, Input, EventEmitter, Output } from '@angular/core'; var ButtonComponent = /** @class */ (function () { function ButtonComponent() { this.buttonClick = new EventEmitter(); /* if(this.testeVariavel === 'mat-button') { this.matButton = true; } */ } /** * @return {?} */ ButtonComponent.prototype.ngOnInit = /** * @return {?} */ function () { }; /** * @return {?} */ ButtonComponent.prototype.topButtonClick = /** * @return {?} */ function () { this.buttonClick.emit(); }; ButtonComponent.decorators = [ { type: Component, args: [{ selector: 'sb-button', template: "<div [ngSwitch]=\"materialTypeButton\">\r\n <button\r\n *ngSwitchCase=\"'mat-button'\"\r\n mat-button\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName || actionName == '' || actionName == null\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-raised-button'\"\r\n mat-raised-button\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-icon-button'\"\r\n mat-icon-button\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-fab'\"\r\n mat-fab\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-mini-fab'\"\r\n mat-mini-fab\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-stroked-button'\"\r\n mat-stroked-button\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n <button\r\n *ngSwitchCase=\"'mat-flat-button'\"\r\n mat-flat-button\r\n color=\"{{ color }}\"\r\n [ngClass]=\"fullWidth ? 'button-full-width' : ''\"\r\n [type]=\"typeButton\"\r\n [ngStyle]=\"customStyles\"\r\n (click)=\"topButtonClick()\"\r\n >\r\n <div *ngIf=\"actionName\">\r\n {{ actionName }}\r\n </div>\r\n <div *ngIf=\"!actionName\">\r\n <ng-content></ng-content>\r\n </div>\r\n </button>\r\n</div>\r\n", styles: [".button-full-width{width:100%}"] }] } ]; /** @nocollapse */ ButtonComponent.ctorParameters = function () { return []; }; ButtonComponent.propDecorators = { color: [{ type: Input }], actionName: [{ type: Input }], typeButton: [{ type: Input }], materialTypeButton: [{ type: Input }], fullWidth: [{ type: Input }], customStyles: [{ type: Input }], buttonClick: [{ type: Output }] }; return ButtonComponent; }()); export { ButtonComponent }; if (false) { /** @type {?} */ ButtonComponent.prototype.color; /** @type {?} */ ButtonComponent.prototype.actionName; /** @type {?} */ ButtonComponent.prototype.typeButton; /** @type {?} */ ButtonComponent.prototype.materialTypeButton; /** @type {?} */ ButtonComponent.prototype.fullWidth; /** @type {?} */ ButtonComponent.prototype.customStyles; /** @type {?} */ ButtonComponent.prototype.buttonClick; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BsdWNhc2ZlcnJlaXJhbHNmL2FuZ3VsYXItZnJvbnRlbmQtbGlicmFyeS8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2J1dHRvbi9idXR0b24uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRS9FO0lBZUU7UUFGVSxnQkFBVyxHQUFHLElBQUksWUFBWSxFQUFPLENBQUM7UUFHOUM7O1lBRUk7SUFDTixDQUFDOzs7O0lBRUQsa0NBQVE7OztJQUFSO0lBQ0EsQ0FBQzs7OztJQUVELHdDQUFjOzs7SUFBZDtRQUNFLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxFQUFFLENBQUM7SUFDMUIsQ0FBQzs7Z0JB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