UNPKG

@lucasferreiralsf/angular-frontend-library

Version:

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

59 lines 6.87 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, Input, EventEmitter, Output } from '@angular/core'; export class ButtonComponent { constructor() { this.buttonClick = new EventEmitter(); /* if(this.testeVariavel === 'mat-button') { this.matButton = true; } */ } /** * @return {?} */ ngOnInit() { } /** * @return {?} */ topButtonClick() { 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 = () => []; ButtonComponent.propDecorators = { color: [{ type: Input }], actionName: [{ type: Input }], typeButton: [{ type: Input }], materialTypeButton: [{ type: Input }], fullWidth: [{ type: Input }], customStyles: [{ type: Input }], buttonClick: [{ type: Output }] }; 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BsdWNhc2ZlcnJlaXJhbHNmL2FuZ3VsYXItZnJvbnRlbmQtbGlicmFyeS8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2J1dHRvbi9idXR0b24uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBTy9FLE1BQU0sT0FBTyxlQUFlO0lBVTFCO1FBRlUsZ0JBQVcsR0FBRyxJQUFJLFlBQVksRUFBTyxDQUFDO1FBRzlDOztZQUVJO0lBQ04sQ0FBQzs7OztJQUVELFFBQVE7SUFDUixDQUFDOzs7O0lBRUQsY0FBYztRQUNaLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxFQUFFLENBQUM7SUFDMUIsQ0FBQzs7O1lBMUJGLFNBQVMsU0FBQztnQkFDVCxRQUFRLEVBQUUsV0FBVztnQkFDckIsZ29HQUFzQzs7YUFFdkM7Ozs7O29CQUVFLEtBQ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