ngx-core-business
Version:
A comprehensive solution designed to streamline the development of enterprise-level Angular applications.
113 lines (104 loc) • 5.12 kB
JavaScript
import * as i0 from '@angular/core';
import { Pipe, NgModule } from '@angular/core';
import * as i1 from '@angular/platform-browser';
class BoldMatchesPipe {
transform(value, search) {
if (!search) {
return value;
}
const re = new RegExp(search, 'gi');
return value.replace(re, (match) => `<b>${match}</b>`);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BoldMatchesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: BoldMatchesPipe, isStandalone: false, name: "boldMatches" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BoldMatchesPipe, decorators: [{
type: Pipe,
args: [{
name: 'boldMatches',
standalone: false
}]
}] });
class BreakLinesPipe {
transform(value) {
// Añadir saltos de linea
return value.replace(/\n/g, '<br>');
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BreakLinesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: BreakLinesPipe, isStandalone: false, name: "breakLines" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BreakLinesPipe, decorators: [{
type: Pipe,
args: [{
name: 'breakLines',
standalone: false
}]
}] });
class SafeHtmlPipe {
constructor(sanitizer) {
this.sanitizer = sanitizer;
}
transform(value) {
return this.sanitizer.bypassSecurityTrustHtml(value);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SafeHtmlPipe, decorators: [{
type: Pipe,
args: [{
name: 'safeHtml',
standalone: false
}]
}], ctorParameters: () => [{ type: i1.DomSanitizer }] });
class ClickableLinksPipe {
transform(value) {
// Convertir urls a links
return value.replace(/\b(https?:\/\/[\S]+[\w])/gi, '<a href="$1" target="_blank">$1</a>');
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClickableLinksPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ClickableLinksPipe, isStandalone: false, name: "clickableLinks" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClickableLinksPipe, decorators: [{
type: Pipe,
args: [{
name: 'clickableLinks',
standalone: false
}]
}] });
class NgBizPipesModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgBizPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: NgBizPipesModule, declarations: [BoldMatchesPipe,
BreakLinesPipe,
ClickableLinksPipe,
SafeHtmlPipe], exports: [BoldMatchesPipe,
BreakLinesPipe,
ClickableLinksPipe,
SafeHtmlPipe] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgBizPipesModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgBizPipesModule, decorators: [{
type: NgModule,
args: [{
declarations: [
BoldMatchesPipe,
BreakLinesPipe,
ClickableLinksPipe,
SafeHtmlPipe,
],
exports: [
BoldMatchesPipe,
BreakLinesPipe,
ClickableLinksPipe,
SafeHtmlPipe,
]
}]
}] });
/*
* Public API Surface of ngx-core-business
*/
/**
* Generated bundle index. Do not edit.
*/
export { BoldMatchesPipe, BreakLinesPipe, ClickableLinksPipe, NgBizPipesModule, SafeHtmlPipe };
//# sourceMappingURL=ngx-core-business-pipes.mjs.map