UNPKG

@taiga-ui/core

Version:

Core library for creating Angular components and applications using Taiga UI

64 lines (58 loc) 3.24 kB
import * as i0 from '@angular/core'; import { Injectable, inject, TemplateRef, Directive, Input, Component, ChangeDetectionStrategy } from '@angular/core'; import { TuiPortalService, TuiPortals, tuiAsPortal } from '@taiga-ui/cdk/classes'; class TuiPopupService extends TuiPortalService { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopupService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopupService, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopupService, decorators: [{ type: Injectable, args: [{ providedIn: 'root', }] }] }); class TuiPopup { constructor() { this.template = inject(TemplateRef); this.service = inject(TuiPopupService); } set tuiPopup(show) { this.viewRef?.destroy(); if (show) { this.viewRef = this.service.addTemplate(this.template); } } ngOnDestroy() { this.viewRef?.destroy(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiPopup, isStandalone: true, selector: "ng-template[tuiPopup]", inputs: { tuiPopup: "tuiPopup" }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopup, decorators: [{ type: Directive, args: [{ standalone: true, selector: 'ng-template[tuiPopup]', }] }], propDecorators: { tuiPopup: [{ type: Input }] } }); class TuiPopups extends TuiPortals { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopups, deps: null, target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPopups, isStandalone: true, selector: "tui-popups", providers: [tuiAsPortal(TuiPopupService)], usesInheritance: true, ngImport: i0, template: '<ng-container #viewContainer />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPopups, decorators: [{ type: Component, args: [{ standalone: true, selector: 'tui-popups', template: '<ng-container #viewContainer />', changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsPortal(TuiPopupService)], }] }] }); /** * Generated bundle index. Do not edit. */ export { TuiPopup, TuiPopupService, TuiPopups }; //# sourceMappingURL=taiga-ui-core-directives-popup.mjs.map