UNPKG

@igo2/common

Version:
74 lines (67 loc) 3.68 kB
import * as i0 from '@angular/core'; import { Pipe, Input, Component, NgModule } from '@angular/core'; import * as i1 from '@angular/platform-browser'; class SanitizeHtmlPipe { _sanitizer; constructor(_sanitizer) { this._sanitizer = _sanitizer; } transform(v) { return this._sanitizer.bypassSecurityTrustHtml(v); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SanitizeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SanitizeHtmlPipe, isStandalone: true, name: "sanitizeHtml" }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SanitizeHtmlPipe, decorators: [{ type: Pipe, args: [{ name: 'sanitizeHtml', standalone: true }] }], ctorParameters: () => [{ type: i1.DomSanitizer }] }); class CustomHtmlComponent { get html() { return this._html; } set html(value) { this._html = value; } _html = ''; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomHtmlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CustomHtmlComponent, isStandalone: true, selector: "igo-custom-html", inputs: { html: "html" }, ngImport: i0, template: "<div class=\"custom-html\" [innerHTML]=\"html | sanitizeHtml\"></div>\n", styles: [":host .custom-html{padding:16px}\n"], dependencies: [{ kind: "pipe", type: SanitizeHtmlPipe, name: "sanitizeHtml" }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomHtmlComponent, decorators: [{ type: Component, args: [{ selector: 'igo-custom-html', imports: [SanitizeHtmlPipe], template: "<div class=\"custom-html\" [innerHTML]=\"html | sanitizeHtml\"></div>\n", styles: [":host .custom-html{padding:16px}\n"] }] }], propDecorators: { html: [{ type: Input }] } }); /** * @deprecated import the components/directives directly or CUSTOM_HTML_DIRECTIVES for the set */ class IgoCustomHtmlModule { static forRoot() { return { ngModule: IgoCustomHtmlModule }; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoCustomHtmlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IgoCustomHtmlModule, imports: [SanitizeHtmlPipe, CustomHtmlComponent], exports: [SanitizeHtmlPipe, CustomHtmlComponent] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoCustomHtmlModule }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoCustomHtmlModule, decorators: [{ type: NgModule, args: [{ imports: [SanitizeHtmlPipe, CustomHtmlComponent], exports: [SanitizeHtmlPipe, CustomHtmlComponent] }] }] }); const CUSTOM_HTML_DIRECTIVES = [ SanitizeHtmlPipe, CustomHtmlComponent ]; /** * Generated bundle index. Do not edit. */ export { CUSTOM_HTML_DIRECTIVES, CustomHtmlComponent, IgoCustomHtmlModule, SanitizeHtmlPipe }; //# sourceMappingURL=igo2-common-custom-html.mjs.map