import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';
import { IconComponent, SplitterComponent } from '@deepkit/desktop-ui';
@Component({
selector: 'deepkit-toggle-box',
template: `
@if (visible()) {
}
@if (visible()) {
}
`,
host: {
'[class.visible]': 'visible()',
'[style.flexBasis.px]': 'height()',
},
imports: [SplitterComponent, IconComponent],
changeDetection: ChangeDetectionStrategy.Eager,
styleUrls: ['./toggle-box.component.scss'],
})
export class ToggleBoxComponent {
visible = model(false);
height = model(170);
title = input('');
toggleVisibility() {
this.visible.update(v => !v);
}
}