UNPKG

@pepperi/components

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.1.

37 lines (28 loc) 1.09 kB
import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; import { SessionService, LayoutService } from '@pepperi/lib'; export enum GROUP_BUTTONS_VIEW_TYPE { Regular, Dropdown, Split, } @Component({ selector: 'pepperi-group-buttons', templateUrl: './group-buttons.component.html', styleUrls: ['./group-buttons.component.scss'], }) export class GroupButtonsComponent implements OnInit, OnDestroy { GROUP_BUTTONS_VIEW_TYPE = GROUP_BUTTONS_VIEW_TYPE; @Input() viewType: GROUP_BUTTONS_VIEW_TYPE = GROUP_BUTTONS_VIEW_TYPE.Regular; @Input() buttons: any; @Input() buttonsClass: string; @Input() buttonsDisabled: string; @Output() buttonClick: EventEmitter<any> = new EventEmitter<any>(); constructor(public layoutService: LayoutService, public sessionService: SessionService) { } ngOnInit(): void { } ngOnDestroy() { if (this.buttonClick) this.buttonClick.unsubscribe(); } onButtonClicked(button) { this.buttonClick.emit(button); } }