12345678910111213141516171819202122232425262728293031323334353637 |
- import { Directive, EventEmitter, Input } from '@angular/core';
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
- import * as i0 from "@angular/core";
- export class TabPanelDirective {
- constructor(elementRef, destroyRef, renderer) {
- this.elementRef = elementRef;
- this.destroyRef = destroyRef;
- this.renderer = renderer;
- this.ctTabPanel = '';
- this.hide = new EventEmitter();
- this.hide.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(hide => {
- this.renderer.addClass(this.elementRef.nativeElement, hide ? 'hidden' : 'flex');
- this.renderer.removeClass(this.elementRef.nativeElement, hide ? 'flex' : 'hidden');
- });
- }
- ngOnInit() {
- this.hide.next(true);
- }
- show() {
- this.renderer.addClass(this.elementRef.nativeElement, 'flex');
- this.renderer.removeClass(this.elementRef.nativeElement, 'hidden');
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: TabPanelDirective, deps: [{ token: i0.ElementRef }, { token: i0.DestroyRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: TabPanelDirective, isStandalone: true, selector: "[ctTabPanel]", inputs: { ctTabPanel: "ctTabPanel", hide: "hide" }, ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: TabPanelDirective, decorators: [{
- type: Directive,
- args: [{
- selector: '[ctTabPanel]',
- standalone: true,
- }]
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.DestroyRef }, { type: i0.Renderer2 }], propDecorators: { ctTabPanel: [{
- type: Input
- }], hide: [{
- type: Input
- }] } });
|