UNPKG

coer-elements

Version:

Library for Angular projects

88 lines (81 loc) 4.23 kB
import * as i0 from '@angular/core'; import { Pipe, NgModule } from '@angular/core'; import * as i1 from '@angular/platform-browser'; import { Tools, Numbers } from 'coer-elements/tools'; class HtmlPipe { constructor(sanitizer) { this.sanitizer = sanitizer; } transform(value) { return this.sanitizer.bypassSecurityTrustHtml(value); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: HtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: HtmlPipe, isStandalone: false, name: "html" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: HtmlPipe, decorators: [{ type: Pipe, args: [{ name: 'html', standalone: false }] }], ctorParameters: () => [{ type: i1.DomSanitizer }] }); class NoImagePipe { transform(value, type = 'IMAGE') { if (typeof value == 'string' && value.trim().toUpperCase() == 'LOADING') return 'coer-elements/images/loading.gif'; let NO_IMAGE = (type === 'IMAGE') ? 'coer-elements/images/no-image.png' : 'coer-elements/images/no-user.png'; if (Tools.IsOnlyWhiteSpace(value)) { return NO_IMAGE; } else if (typeof value === 'string') { return value; } //Files.ConvertToBase64(value as File).then(base64 => { return base64 }); return NO_IMAGE; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NoImagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: NoImagePipe, isStandalone: false, name: "noImage" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NoImagePipe, decorators: [{ type: Pipe, args: [{ name: 'noImage', standalone: false }] }] }); class NumericFormatPipe { transform(value, decimals = 0) { return Numbers.GetNumericFormat(value, decimals); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NumericFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: NumericFormatPipe, isStandalone: false, name: "numericFormat" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NumericFormatPipe, decorators: [{ type: Pipe, args: [{ name: 'numericFormat', standalone: false }] }] }); class PipesModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: PipesModule, declarations: [HtmlPipe, NoImagePipe, NumericFormatPipe], exports: [HtmlPipe, NoImagePipe, NumericFormatPipe] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PipesModule }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PipesModule, decorators: [{ type: NgModule, args: [{ declarations: [ HtmlPipe, NoImagePipe, NumericFormatPipe ], exports: [ HtmlPipe, NoImagePipe, NumericFormatPipe ] }] }] }); /** * Generated bundle index. Do not edit. */ export { HtmlPipe, NoImagePipe, NumericFormatPipe, PipesModule }; //# sourceMappingURL=coer-elements-pipes.mjs.map