46 lines
984 B
TypeScript
Raw Normal View History

2019-10-07 17:02:14 +09:00
import {
Component,
OnInit,
Input,
Output,
EventEmitter,
ViewChild
} from '@angular/core';
2019-09-25 17:41:16 +09:00
2019-10-02 14:34:17 +09:00
import { ucapAnimations } from '@ucap-webmessenger/ui';
2019-09-27 12:53:21 +09:00
import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync';
2019-10-07 17:02:14 +09:00
import { MatAccordion } from '@angular/material';
@Component({
selector: 'ucap-group-expansion-panel',
templateUrl: './expansion-panel.component.html',
2019-10-02 14:34:17 +09:00
styleUrls: ['./expansion-panel.component.scss'],
animations: ucapAnimations
})
export class ExpansionPanelComponent implements OnInit {
@Input()
2019-09-27 12:53:21 +09:00
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] }[];
@Output()
selectBuddy = new EventEmitter<UserInfo>();
2019-10-07 17:02:14 +09:00
@ViewChild('groupAccordion', { static: true }) groupAccordion: MatAccordion;
constructor() {}
ngOnInit() {}
2019-09-27 12:53:21 +09:00
onClickBuddy(buddy: UserInfo) {
this.selectBuddy.emit(buddy);
}
2019-10-07 17:02:14 +09:00
expandMore() {
this.groupAccordion.openAll();
}
expandLess() {
this.groupAccordion.closeAll();
}
}