mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-24 17:43:45 +03:00
26 lines
615 B
TypeScript
26 lines
615 B
TypeScript
'use strict';
|
|
|
|
import { Component, EventEmitter, Output, Input } from '@angular/core';
|
|
import { CORE_DIRECTIVES } from '@angular/common';
|
|
|
|
@Component({
|
|
selector: 'zippy',
|
|
templateUrl: './zippy.html',
|
|
styleUrls: ['./zippy.css'],
|
|
directives: [CORE_DIRECTIVES]
|
|
})
|
|
export class Zippy {
|
|
@Input() type = 'general';
|
|
@Input() visible = false;
|
|
@Input() empty = false;
|
|
@Input() title;
|
|
@Output() open = new EventEmitter();
|
|
@Output() close = new EventEmitter();
|
|
|
|
toggle() {
|
|
this.visible = !this.visible;
|
|
if (this.empty) return;
|
|
(this.visible) ? this.open.next({}) : this.close.next({});
|
|
}
|
|
}
|