@apipass/pipes 0.2.16 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/colors.scss +34 -34
- package/assets/css/icons.scss +30 -30
- package/{esm2015/apipass-pipes.js → esm2020/apipass-pipes.mjs} +4 -4
- package/{esm2015/lib/keys.pipe.js → esm2020/lib/keys.pipe.mjs} +32 -32
- package/esm2020/lib/pipe.module.mjs +35 -0
- package/esm2020/lib/safe-pipe.mjs +34 -0
- package/esm2020/lib/select.enum.filter.pipe.mjs +23 -0
- package/esm2020/lib/select.filter.pipe.mjs +23 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +5 -5
- package/fesm2015/apipass-pipes.mjs +141 -0
- package/fesm2015/apipass-pipes.mjs.map +1 -0
- package/fesm2020/apipass-pipes.mjs +141 -0
- package/fesm2020/apipass-pipes.mjs.map +1 -0
- package/{apipass-pipes.d.ts → index.d.ts} +5 -5
- package/lib/keys.pipe.d.ts +8 -8
- package/lib/pipe.module.d.ts +10 -9
- package/lib/safe-pipe.d.ts +10 -10
- package/lib/select.enum.filter.pipe.d.ts +8 -8
- package/lib/select.filter.pipe.d.ts +8 -8
- package/package.json +29 -19
- package/public-api.d.ts +5 -5
- package/bundles/apipass-pipes.umd.js +0 -172
- package/bundles/apipass-pipes.umd.js.map +0 -1
- package/bundles/apipass-pipes.umd.min.js +0 -2
- package/bundles/apipass-pipes.umd.min.js.map +0 -1
- package/esm2015/lib/pipe.module.js +0 -35
- package/esm2015/lib/safe-pipe.js +0 -34
- package/esm2015/lib/select.enum.filter.pipe.js +0 -23
- package/esm2015/lib/select.filter.pipe.js +0 -23
- package/fesm2015/apipass-pipes.js +0 -140
- package/fesm2015/apipass-pipes.js.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import { isArray } from 'rxjs/internal-compatibility';
|
|
4
|
+
import * as i1 from '@angular/platform-browser';
|
|
5
|
+
|
|
6
|
+
class SelectFilterPipe {
|
|
7
|
+
constructor() { }
|
|
8
|
+
transform(items, arg1, arg2) {
|
|
9
|
+
let searchText = arg1;
|
|
10
|
+
const termName = arg2;
|
|
11
|
+
if (!searchText) {
|
|
12
|
+
return items;
|
|
13
|
+
}
|
|
14
|
+
searchText = searchText.toLowerCase();
|
|
15
|
+
return items.filter(item => {
|
|
16
|
+
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
SelectFilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SelectFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
21
|
+
SelectFilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: SelectFilterPipe, name: "selectFilter" });
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SelectFilterPipe, decorators: [{
|
|
23
|
+
type: Pipe,
|
|
24
|
+
args: [{ name: 'selectFilter' }]
|
|
25
|
+
}], ctorParameters: function () { return []; } });
|
|
26
|
+
|
|
27
|
+
class SelectEnumFilterPipe {
|
|
28
|
+
constructor() {
|
|
29
|
+
}
|
|
30
|
+
transform(items, arg1) {
|
|
31
|
+
let searchText = arg1;
|
|
32
|
+
if (!searchText) {
|
|
33
|
+
return items;
|
|
34
|
+
}
|
|
35
|
+
searchText = searchText.toLowerCase();
|
|
36
|
+
return items.filter(item => {
|
|
37
|
+
return item.value.toLowerCase().indexOf(searchText) > -1;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
SelectEnumFilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SelectEnumFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
42
|
+
SelectEnumFilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: SelectEnumFilterPipe, name: "selectEnumFilter" });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SelectEnumFilterPipe, decorators: [{
|
|
44
|
+
type: Pipe,
|
|
45
|
+
args: [{ name: 'selectEnumFilter' }]
|
|
46
|
+
}], ctorParameters: function () { return []; } });
|
|
47
|
+
|
|
48
|
+
class EnumPipe {
|
|
49
|
+
transform(value, exception) {
|
|
50
|
+
const keys = [];
|
|
51
|
+
let add = true;
|
|
52
|
+
for (const enumMember in value) {
|
|
53
|
+
if (!value.hasOwnProperty(enumMember)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (add && !this.isException(value[enumMember], exception)) {
|
|
57
|
+
keys.push({ key: enumMember, value: value[enumMember] });
|
|
58
|
+
}
|
|
59
|
+
add = !add;
|
|
60
|
+
}
|
|
61
|
+
return keys;
|
|
62
|
+
}
|
|
63
|
+
isException(enumValue, exception) {
|
|
64
|
+
if (exception && isArray(exception)) {
|
|
65
|
+
return exception.some((exceptionValue) => enumValue === exceptionValue);
|
|
66
|
+
}
|
|
67
|
+
return exception ? enumValue === exception : false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
EnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
71
|
+
EnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: EnumPipe, name: "enum" });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: EnumPipe, decorators: [{
|
|
73
|
+
type: Pipe,
|
|
74
|
+
args: [{ name: 'enum' }]
|
|
75
|
+
}] });
|
|
76
|
+
|
|
77
|
+
class SafePipe {
|
|
78
|
+
constructor(sanitizer) {
|
|
79
|
+
this.sanitizer = sanitizer;
|
|
80
|
+
}
|
|
81
|
+
transform(value, type) {
|
|
82
|
+
switch (type) {
|
|
83
|
+
case 'html':
|
|
84
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
85
|
+
case 'style':
|
|
86
|
+
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
87
|
+
case 'script':
|
|
88
|
+
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
89
|
+
case 'url':
|
|
90
|
+
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
91
|
+
case 'resourceUrl':
|
|
92
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
93
|
+
default:
|
|
94
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
SafePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
99
|
+
SafePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: SafePipe, name: "safe" });
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SafePipe, decorators: [{
|
|
101
|
+
type: Pipe,
|
|
102
|
+
args: [{
|
|
103
|
+
name: 'safe'
|
|
104
|
+
}]
|
|
105
|
+
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
|
|
106
|
+
|
|
107
|
+
class PipeModule {
|
|
108
|
+
}
|
|
109
|
+
PipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: PipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
110
|
+
PipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: PipeModule, declarations: [SelectFilterPipe,
|
|
111
|
+
SelectEnumFilterPipe,
|
|
112
|
+
EnumPipe,
|
|
113
|
+
SafePipe], exports: [SelectFilterPipe,
|
|
114
|
+
SelectEnumFilterPipe,
|
|
115
|
+
EnumPipe,
|
|
116
|
+
SafePipe] });
|
|
117
|
+
PipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: PipeModule });
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: PipeModule, decorators: [{
|
|
119
|
+
type: NgModule,
|
|
120
|
+
args: [{
|
|
121
|
+
declarations: [
|
|
122
|
+
SelectFilterPipe,
|
|
123
|
+
SelectEnumFilterPipe,
|
|
124
|
+
EnumPipe,
|
|
125
|
+
SafePipe
|
|
126
|
+
],
|
|
127
|
+
exports: [
|
|
128
|
+
SelectFilterPipe,
|
|
129
|
+
SelectEnumFilterPipe,
|
|
130
|
+
EnumPipe,
|
|
131
|
+
SafePipe
|
|
132
|
+
],
|
|
133
|
+
}]
|
|
134
|
+
}] });
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Generated bundle index. Do not edit.
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
export { EnumPipe, PipeModule, SafePipe, SelectEnumFilterPipe, SelectFilterPipe };
|
|
141
|
+
//# sourceMappingURL=apipass-pipes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apipass-pipes.mjs","sources":["../../../projects/pipes/src/lib/select.filter.pipe.ts","../../../projects/pipes/src/lib/select.enum.filter.pipe.ts","../../../projects/pipes/src/lib/keys.pipe.ts","../../../projects/pipes/src/lib/safe-pipe.ts","../../../projects/pipes/src/lib/pipe.module.ts","../../../projects/pipes/src/apipass-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'selectFilter' })\r\nexport class SelectFilterPipe implements PipeTransform {\r\n\r\n constructor() { }\r\n\r\n transform(items: any[], arg1: any, arg2: any): any[] {\r\n let searchText = arg1;\r\n const termName = arg2;\r\n\r\n if (!searchText) {\r\n return items;\r\n }\r\n\r\n searchText = searchText.toLowerCase();\r\n\r\n return items.filter(item => {\r\n return item[termName].toLowerCase().indexOf(searchText) > -1;\r\n });\r\n }\r\n\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'selectEnumFilter' })\r\nexport class SelectEnumFilterPipe implements PipeTransform {\r\n\r\n constructor() {\r\n }\r\n\r\n transform(items: any[], arg1: any): any[] {\r\n let searchText = arg1;\r\n if (!searchText) {\r\n return items;\r\n }\r\n searchText = searchText.toLowerCase();\r\n return items.filter(item => {\r\n return item.value.toLowerCase().indexOf(searchText) > -1;\r\n });\r\n }\r\n\r\n}\r\n","import {Pipe, PipeTransform} from '@angular/core';\r\nimport {isArray} from 'rxjs/internal-compatibility';\r\n\r\n@Pipe({name: 'enum'})\r\nexport class EnumPipe implements PipeTransform {\r\n\r\n transform(value: any, exception?: any): any {\r\n const keys = [];\r\n let add = true;\r\n\r\n for (const enumMember in value) {\r\n if (!value.hasOwnProperty(enumMember)) {\r\n continue;\r\n }\r\n if (add && !this.isException(value[enumMember], exception)) {\r\n keys.push({key: enumMember, value: value[enumMember]});\r\n }\r\n add = !add;\r\n }\r\n\r\n return keys;\r\n }\r\n\r\n private isException(enumValue: any, exception: any): boolean {\r\n if (exception && isArray(exception)) {\r\n return exception.some((exceptionValue) => enumValue === exceptionValue);\r\n }\r\n\r\n return exception ? enumValue === exception : false;\r\n }\r\n\r\n}\r\n","import {Pipe, PipeTransform} from '@angular/core';\r\nimport {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from '@angular/platform-browser';\r\n\r\n@Pipe({\r\n name: 'safe'\r\n})\r\nexport class SafePipe implements PipeTransform {\r\n\r\n constructor(protected sanitizer: DomSanitizer) {\r\n }\r\n\r\n transform(value: string, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {\r\n switch (type) {\r\n case 'html':\r\n return this.sanitizer.bypassSecurityTrustHtml(value);\r\n case 'style':\r\n return this.sanitizer.bypassSecurityTrustStyle(value);\r\n case 'script':\r\n return this.sanitizer.bypassSecurityTrustScript(value);\r\n case 'url':\r\n return this.sanitizer.bypassSecurityTrustUrl(value);\r\n case 'resourceUrl':\r\n return this.sanitizer.bypassSecurityTrustResourceUrl(value);\r\n default:\r\n return this.sanitizer.bypassSecurityTrustHtml(value);\r\n }\r\n }\r\n\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {SelectFilterPipe} from './select.filter.pipe';\r\nimport {SelectEnumFilterPipe} from './select.enum.filter.pipe';\r\nimport {EnumPipe} from './keys.pipe';\r\nimport {SafePipe} from './safe-pipe';\r\n\r\n@NgModule({\r\n declarations: [\r\n SelectFilterPipe,\r\n SelectEnumFilterPipe,\r\n EnumPipe,\r\n SafePipe\r\n ],\r\n exports: [\r\n SelectFilterPipe,\r\n SelectEnumFilterPipe,\r\n EnumPipe,\r\n SafePipe\r\n ],\r\n})\r\nexport class PipeModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAGa,gBAAgB,CAAA;AAE3B,IAAA,WAAA,GAAA,GAAiB;AAEjB,IAAA,SAAS,CAAC,KAAY,EAAE,IAAS,EAAE,IAAS,EAAA;QAC1C,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,OAAO,KAAK,CAAC;AACd,SAAA;AAED,QAAA,UAAU,GAAG,UAAU,CAAC,W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BAAgB;QAChB,oBAAoB;QACpB,QAAQ;AACR,QAAA,QAAQ,aAGR,gBAAgB;QAChB,oBAAoB;QACpB,QAAQ;QACR,QAAQ,CAAA,EAAA,CAAA,CAAA;wGAGC,UAAU,EAAA,CAAA,CAAA;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAdtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,gBAAgB;wBAChB,oBAAoB;wBACpB,QAAQ;wBACR,QAAQ;AACT,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;wBAChB,oBAAoB;wBACpB,QAAQ;wBACR,QAAQ;AACT,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@apipass/pipes" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@apipass/pipes" />
|
|
5
|
+
export * from './public-api';
|
package/lib/keys.pipe.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class EnumPipe implements PipeTransform {
|
|
4
|
-
transform(value: any, exception?: any): any;
|
|
5
|
-
private isException;
|
|
6
|
-
static ɵfac: i0.ɵɵ
|
|
7
|
-
static ɵpipe: i0.ɵɵ
|
|
8
|
-
}
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class EnumPipe implements PipeTransform {
|
|
4
|
+
transform(value: any, exception?: any): any;
|
|
5
|
+
private isException;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EnumPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<EnumPipe, "enum", false>;
|
|
8
|
+
}
|
package/lib/pipe.module.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./select.filter.pipe";
|
|
3
|
-
import * as i2 from "./select.enum.filter.pipe";
|
|
4
|
-
import * as i3 from "./keys.pipe";
|
|
5
|
-
import * as i4 from "./safe-pipe";
|
|
6
|
-
export declare class PipeModule {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./select.filter.pipe";
|
|
3
|
+
import * as i2 from "./select.enum.filter.pipe";
|
|
4
|
+
import * as i3 from "./keys.pipe";
|
|
5
|
+
import * as i4 from "./safe-pipe";
|
|
6
|
+
export declare class PipeModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PipeModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PipeModule, [typeof i1.SelectFilterPipe, typeof i2.SelectEnumFilterPipe, typeof i3.EnumPipe, typeof i4.SafePipe], never, [typeof i1.SelectFilterPipe, typeof i2.SelectEnumFilterPipe, typeof i3.EnumPipe, typeof i4.SafePipe]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PipeModule>;
|
|
10
|
+
}
|
package/lib/safe-pipe.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl } from '@angular/platform-browser';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SafePipe implements PipeTransform {
|
|
5
|
-
protected sanitizer: DomSanitizer;
|
|
6
|
-
constructor(sanitizer: DomSanitizer);
|
|
7
|
-
transform(value: string, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl;
|
|
8
|
-
static ɵfac: i0.ɵɵ
|
|
9
|
-
static ɵpipe: i0.ɵɵ
|
|
10
|
-
}
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl } from '@angular/platform-browser';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SafePipe implements PipeTransform {
|
|
5
|
+
protected sanitizer: DomSanitizer;
|
|
6
|
+
constructor(sanitizer: DomSanitizer);
|
|
7
|
+
transform(value: string, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SafePipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SafePipe, "safe", false>;
|
|
10
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class SelectEnumFilterPipe implements PipeTransform {
|
|
4
|
-
constructor();
|
|
5
|
-
transform(items: any[], arg1: any): any[];
|
|
6
|
-
static ɵfac: i0.ɵɵ
|
|
7
|
-
static ɵpipe: i0.ɵɵ
|
|
8
|
-
}
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SelectEnumFilterPipe implements PipeTransform {
|
|
4
|
+
constructor();
|
|
5
|
+
transform(items: any[], arg1: any): any[];
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectEnumFilterPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SelectEnumFilterPipe, "selectEnumFilter", false>;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class SelectFilterPipe implements PipeTransform {
|
|
4
|
-
constructor();
|
|
5
|
-
transform(items: any[], arg1: any, arg2: any): any[];
|
|
6
|
-
static ɵfac: i0.ɵɵ
|
|
7
|
-
static ɵpipe: i0.ɵɵ
|
|
8
|
-
}
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SelectFilterPipe implements PipeTransform {
|
|
4
|
+
constructor();
|
|
5
|
+
transform(items: any[], arg1: any, arg2: any): any[];
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectFilterPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SelectFilterPipe, "selectFilter", false>;
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/pipes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "
|
|
6
|
-
"@angular/cdk": "
|
|
7
|
-
"@angular/common": "
|
|
8
|
-
"@angular/core": "
|
|
9
|
-
"@angular/forms": "
|
|
5
|
+
"@angular/animations": "15.0.3",
|
|
6
|
+
"@angular/cdk": "15.0.3",
|
|
7
|
+
"@angular/common": "15.0.3",
|
|
8
|
+
"@angular/core": "15.0.3",
|
|
9
|
+
"@angular/forms": "15.0.3"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"tslib": "2.0.0",
|
|
13
|
-
"@ngx-translate/core": "
|
|
14
|
-
"@ngx-translate/http-loader": "
|
|
13
|
+
"@ngx-translate/core": "14.0.0",
|
|
14
|
+
"@ngx-translate/http-loader": "7.0.0"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"fesm2015": "fesm2015/apipass-pipes.
|
|
21
|
-
"typings": "
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
"module": "fesm2015/apipass-pipes.mjs",
|
|
17
|
+
"es2020": "fesm2020/apipass-pipes.mjs",
|
|
18
|
+
"esm2020": "esm2020/apipass-pipes.mjs",
|
|
19
|
+
"fesm2020": "fesm2020/apipass-pipes.mjs",
|
|
20
|
+
"fesm2015": "fesm2015/apipass-pipes.mjs",
|
|
21
|
+
"typings": "index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
"./package.json": {
|
|
24
|
+
"default": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"esm2020": "./esm2020/apipass-pipes.mjs",
|
|
29
|
+
"es2020": "./fesm2020/apipass-pipes.mjs",
|
|
30
|
+
"es2015": "./fesm2015/apipass-pipes.mjs",
|
|
31
|
+
"node": "./fesm2015/apipass-pipes.mjs",
|
|
32
|
+
"default": "./fesm2020/apipass-pipes.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"sideEffects": false
|
|
36
|
+
}
|
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './lib/pipe.module';
|
|
2
|
-
export * from './lib/keys.pipe';
|
|
3
|
-
export * from './lib/safe-pipe';
|
|
4
|
-
export * from './lib/select.enum.filter.pipe';
|
|
5
|
-
export * from './lib/select.filter.pipe';
|
|
1
|
+
export * from './lib/pipe.module';
|
|
2
|
+
export * from './lib/keys.pipe';
|
|
3
|
+
export * from './lib/safe-pipe';
|
|
4
|
+
export * from './lib/select.enum.filter.pipe';
|
|
5
|
+
export * from './lib/select.filter.pipe';
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/internal-compatibility'), require('@angular/platform-browser')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@apipass/pipes', ['exports', '@angular/core', 'rxjs/internal-compatibility', '@angular/platform-browser'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.pipes = {}), global.ng.core, global.rxjs['internal-compatibility'], global.ng.platformBrowser));
|
|
5
|
-
}(this, (function (exports, i0, internalCompatibility, i1) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var SelectFilterPipe = /** @class */ (function () {
|
|
8
|
-
function SelectFilterPipe() {
|
|
9
|
-
}
|
|
10
|
-
SelectFilterPipe.prototype.transform = function (items, arg1, arg2) {
|
|
11
|
-
var searchText = arg1;
|
|
12
|
-
var termName = arg2;
|
|
13
|
-
if (!searchText) {
|
|
14
|
-
return items;
|
|
15
|
-
}
|
|
16
|
-
searchText = searchText.toLowerCase();
|
|
17
|
-
return items.filter(function (item) {
|
|
18
|
-
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
return SelectFilterPipe;
|
|
22
|
-
}());
|
|
23
|
-
SelectFilterPipe.ɵfac = function SelectFilterPipe_Factory(t) { return new (t || SelectFilterPipe)(); };
|
|
24
|
-
SelectFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectFilter", type: SelectFilterPipe, pure: true });
|
|
25
|
-
/*@__PURE__*/ (function () {
|
|
26
|
-
i0.ɵsetClassMetadata(SelectFilterPipe, [{
|
|
27
|
-
type: i0.Pipe,
|
|
28
|
-
args: [{ name: 'selectFilter' }]
|
|
29
|
-
}], function () { return []; }, null);
|
|
30
|
-
})();
|
|
31
|
-
|
|
32
|
-
var SelectEnumFilterPipe = /** @class */ (function () {
|
|
33
|
-
function SelectEnumFilterPipe() {
|
|
34
|
-
}
|
|
35
|
-
SelectEnumFilterPipe.prototype.transform = function (items, arg1) {
|
|
36
|
-
var searchText = arg1;
|
|
37
|
-
if (!searchText) {
|
|
38
|
-
return items;
|
|
39
|
-
}
|
|
40
|
-
searchText = searchText.toLowerCase();
|
|
41
|
-
return items.filter(function (item) {
|
|
42
|
-
return item.value.toLowerCase().indexOf(searchText) > -1;
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
return SelectEnumFilterPipe;
|
|
46
|
-
}());
|
|
47
|
-
SelectEnumFilterPipe.ɵfac = function SelectEnumFilterPipe_Factory(t) { return new (t || SelectEnumFilterPipe)(); };
|
|
48
|
-
SelectEnumFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectEnumFilter", type: SelectEnumFilterPipe, pure: true });
|
|
49
|
-
/*@__PURE__*/ (function () {
|
|
50
|
-
i0.ɵsetClassMetadata(SelectEnumFilterPipe, [{
|
|
51
|
-
type: i0.Pipe,
|
|
52
|
-
args: [{ name: 'selectEnumFilter' }]
|
|
53
|
-
}], function () { return []; }, null);
|
|
54
|
-
})();
|
|
55
|
-
|
|
56
|
-
var EnumPipe = /** @class */ (function () {
|
|
57
|
-
function EnumPipe() {
|
|
58
|
-
}
|
|
59
|
-
EnumPipe.prototype.transform = function (value, exception) {
|
|
60
|
-
var keys = [];
|
|
61
|
-
var add = true;
|
|
62
|
-
for (var enumMember in value) {
|
|
63
|
-
if (!value.hasOwnProperty(enumMember)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (add && !this.isException(value[enumMember], exception)) {
|
|
67
|
-
keys.push({ key: enumMember, value: value[enumMember] });
|
|
68
|
-
}
|
|
69
|
-
add = !add;
|
|
70
|
-
}
|
|
71
|
-
return keys;
|
|
72
|
-
};
|
|
73
|
-
EnumPipe.prototype.isException = function (enumValue, exception) {
|
|
74
|
-
if (exception && internalCompatibility.isArray(exception)) {
|
|
75
|
-
return exception.some(function (exceptionValue) { return enumValue === exceptionValue; });
|
|
76
|
-
}
|
|
77
|
-
return exception ? enumValue === exception : false;
|
|
78
|
-
};
|
|
79
|
-
return EnumPipe;
|
|
80
|
-
}());
|
|
81
|
-
EnumPipe.ɵfac = function EnumPipe_Factory(t) { return new (t || EnumPipe)(); };
|
|
82
|
-
EnumPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "enum", type: EnumPipe, pure: true });
|
|
83
|
-
/*@__PURE__*/ (function () {
|
|
84
|
-
i0.ɵsetClassMetadata(EnumPipe, [{
|
|
85
|
-
type: i0.Pipe,
|
|
86
|
-
args: [{ name: 'enum' }]
|
|
87
|
-
}], null, null);
|
|
88
|
-
})();
|
|
89
|
-
|
|
90
|
-
var SafePipe = /** @class */ (function () {
|
|
91
|
-
function SafePipe(sanitizer) {
|
|
92
|
-
this.sanitizer = sanitizer;
|
|
93
|
-
}
|
|
94
|
-
SafePipe.prototype.transform = function (value, type) {
|
|
95
|
-
switch (type) {
|
|
96
|
-
case 'html':
|
|
97
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
98
|
-
case 'style':
|
|
99
|
-
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
100
|
-
case 'script':
|
|
101
|
-
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
102
|
-
case 'url':
|
|
103
|
-
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
104
|
-
case 'resourceUrl':
|
|
105
|
-
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
106
|
-
default:
|
|
107
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
return SafePipe;
|
|
111
|
-
}());
|
|
112
|
-
SafePipe.ɵfac = function SafePipe_Factory(t) { return new (t || SafePipe)(i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
113
|
-
SafePipe.ɵpipe = i0.ɵɵdefinePipe({ name: "safe", type: SafePipe, pure: true });
|
|
114
|
-
/*@__PURE__*/ (function () {
|
|
115
|
-
i0.ɵsetClassMetadata(SafePipe, [{
|
|
116
|
-
type: i0.Pipe,
|
|
117
|
-
args: [{
|
|
118
|
-
name: 'safe'
|
|
119
|
-
}]
|
|
120
|
-
}], function () { return [{ type: i1.DomSanitizer }]; }, null);
|
|
121
|
-
})();
|
|
122
|
-
|
|
123
|
-
var PipeModule = /** @class */ (function () {
|
|
124
|
-
function PipeModule() {
|
|
125
|
-
}
|
|
126
|
-
return PipeModule;
|
|
127
|
-
}());
|
|
128
|
-
PipeModule.ɵmod = i0.ɵɵdefineNgModule({ type: PipeModule });
|
|
129
|
-
PipeModule.ɵinj = i0.ɵɵdefineInjector({ factory: function PipeModule_Factory(t) { return new (t || PipeModule)(); } });
|
|
130
|
-
(function () {
|
|
131
|
-
(typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PipeModule, { declarations: [SelectFilterPipe,
|
|
132
|
-
SelectEnumFilterPipe,
|
|
133
|
-
EnumPipe,
|
|
134
|
-
SafePipe], exports: [SelectFilterPipe,
|
|
135
|
-
SelectEnumFilterPipe,
|
|
136
|
-
EnumPipe,
|
|
137
|
-
SafePipe] });
|
|
138
|
-
})();
|
|
139
|
-
/*@__PURE__*/ (function () {
|
|
140
|
-
i0.ɵsetClassMetadata(PipeModule, [{
|
|
141
|
-
type: i0.NgModule,
|
|
142
|
-
args: [{
|
|
143
|
-
declarations: [
|
|
144
|
-
SelectFilterPipe,
|
|
145
|
-
SelectEnumFilterPipe,
|
|
146
|
-
EnumPipe,
|
|
147
|
-
SafePipe
|
|
148
|
-
],
|
|
149
|
-
exports: [
|
|
150
|
-
SelectFilterPipe,
|
|
151
|
-
SelectEnumFilterPipe,
|
|
152
|
-
EnumPipe,
|
|
153
|
-
SafePipe
|
|
154
|
-
],
|
|
155
|
-
}]
|
|
156
|
-
}], null, null);
|
|
157
|
-
})();
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Generated bundle index. Do not edit.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
exports.EnumPipe = EnumPipe;
|
|
164
|
-
exports.PipeModule = PipeModule;
|
|
165
|
-
exports.SafePipe = SafePipe;
|
|
166
|
-
exports.SelectEnumFilterPipe = SelectEnumFilterPipe;
|
|
167
|
-
exports.SelectFilterPipe = SelectFilterPipe;
|
|
168
|
-
|
|
169
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
170
|
-
|
|
171
|
-
})));
|
|
172
|
-
//# sourceMappingURL=apipass-pipes.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apipass-pipes.umd.js","sources":["../../../projects/pipes/src/lib/select.filter.pipe.ts","../../../projects/pipes/src/lib/select.enum.filter.pipe.ts","../../../projects/pipes/src/lib/keys.pipe.ts","../../../projects/pipes/src/lib/safe-pipe.ts","../../../projects/pipes/src/lib/pipe.module.ts","../../../projects/pipes/src/apipass-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'selectFilter' })\nexport class SelectFilterPipe implements PipeTransform {\n\n constructor() { }\n\n transform(items: any[], arg1: any, arg2: any): any[] {\n let searchText = arg1;\n const termName = arg2;\n\n if (!searchText) {\n return items;\n }\n\n searchText = searchText.toLowerCase();\n\n return items.filter(item => {\n return item[termName].toLowerCase().indexOf(searchText) > -1;\n });\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'selectEnumFilter' })\nexport class SelectEnumFilterPipe implements PipeTransform {\n\n constructor() {\n }\n\n transform(items: any[], arg1: any): any[] {\n let searchText = arg1;\n if (!searchText) {\n return items;\n }\n searchText = searchText.toLowerCase();\n return items.filter(item => {\n return item.value.toLowerCase().indexOf(searchText) > -1;\n });\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {isArray} from 'rxjs/internal-compatibility';\n\n@Pipe({name: 'enum'})\nexport class EnumPipe implements PipeTransform {\n\n transform(value: any, exception?: any): any {\n const keys = [];\n let add = true;\n\n for (const enumMember in value) {\n if (!value.hasOwnProperty(enumMember)) {\n continue;\n }\n if (add && !this.isException(value[enumMember], exception)) {\n keys.push({key: enumMember, value: value[enumMember]});\n }\n add = !add;\n }\n\n return keys;\n }\n\n private isException(enumValue: any, exception: any): boolean {\n if (exception && isArray(exception)) {\n return exception.some((exceptionValue) => enumValue === exceptionValue);\n }\n\n return exception ? enumValue === exception : false;\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from '@angular/platform-browser';\n\n@Pipe({\n name: 'safe'\n})\nexport class SafePipe implements PipeTransform {\n\n constructor(protected sanitizer: DomSanitizer) {\n }\n\n transform(value: string, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {\n switch (type) {\n case 'html':\n return this.sanitizer.bypassSecurityTrustHtml(value);\n case 'style':\n return this.sanitizer.bypassSecurityTrustStyle(value);\n case 'script':\n return this.sanitizer.bypassSecurityTrustScript(value);\n case 'url':\n return this.sanitizer.bypassSecurityTrustUrl(value);\n case 'resourceUrl':\n return this.sanitizer.bypassSecurityTrustResourceUrl(value);\n default:\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {SelectFilterPipe} from './select.filter.pipe';\nimport {SelectEnumFilterPipe} from './select.enum.filter.pipe';\nimport {EnumPipe} from './keys.pipe';\nimport {SafePipe} from './safe-pipe';\n\n@NgModule({\n declarations: [\n SelectFilterPipe,\n SelectEnumFilterPipe,\n EnumPipe,\n SafePipe\n ],\n exports: [\n SelectFilterPipe,\n SelectEnumFilterPipe,\n EnumPipe,\n SafePipe\n ],\n})\nexport class PipeModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Pipe","isArray","NgModule"],"mappings":";;;;;;;QAKE;SAAiB;QAEjB,oCAAS,GAAT,UAAU,KAAY,EAAE,IAAS,EAAE,IAAS;YAC1C,IAAI,UAAU,GAAG,IAAI,CAAC;YACtB,IAAM,QAAQ,GAAG,IAAI,CAAC;YAEtB,IAAI,CAAC,UAAU,EAAE;gBACf,OAAO,KA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,OAAI;uBAAC;wBACJ,IAAI,EAAE,MAAM;qBACb;;;;;QCeD;;;;kDAAa,UAAU;uGAAV,UAAU;;iFAAV,UAAU,mBAZnB,gBAAgB;gBAChB,oBAAoB;gBACpB,QAAQ;gBACR,QAAQ,aAGR,gBAAgB;gBAChB,oBAAoB;gBACpB,QAAQ;gBACR,QAAQ;;;6BAGC,UAAU;sBAdtBE,WAAQ;uBAAC;wBACR,YAAY,EAAE;4BACZ,gBAAgB;4BAChB,oBAAoB;4BACpB,QAAQ;4BACR,QAAQ;yBACT;wBACD,OAAO,EAAE;4BACP,gBAAgB;4BAChB,oBAAoB;4BACpB,QAAQ;4BACR,QAAQ;yBACT;qBACF;;;;ICnBD;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs/internal-compatibility"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@apipass/pipes",["exports","@angular/core","rxjs/internal-compatibility","@angular/platform-browser"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).apipass=e.apipass||{},e.apipass.pipes={}),e.ng.core,e.rxjs["internal-compatibility"],e.ng.platformBrowser)}(this,(function(e,t,r,n){"use strict";var i=function(){function e(){}return e.prototype.transform=function(e,t,r){var n=t,i=r;return n?(n=n.toLowerCase(),e.filter((function(e){return e[i].toLowerCase().indexOf(n)>-1}))):e},e}();i.ɵfac=function(e){return new(e||i)},i.ɵpipe=t.ɵɵdefinePipe({name:"selectFilter",type:i,pure:!0});var o=function(){function e(){}return e.prototype.transform=function(e,t){var r=t;return r?(r=r.toLowerCase(),e.filter((function(e){return e.value.toLowerCase().indexOf(r)>-1}))):e},e}();o.ɵfac=function(e){return new(e||o)},o.ɵpipe=t.ɵɵdefinePipe({name:"selectEnumFilter",type:o,pure:!0});var u=function(){function e(){}return e.prototype.transform=function(e,t){var r=[],n=!0;for(var i in e)e.hasOwnProperty(i)&&(n&&!this.isException(e[i],t)&&r.push({key:i,value:e[i]}),n=!n);return r},e.prototype.isException=function(e,t){return t&&r.isArray(t)?t.some((function(t){return e===t})):!!t&&e===t},e}();u.ɵfac=function(e){return new(e||u)},u.ɵpipe=t.ɵɵdefinePipe({name:"enum",type:u,pure:!0});var s=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e,t){switch(t){case"html":return this.sanitizer.bypassSecurityTrustHtml(e);case"style":return this.sanitizer.bypassSecurityTrustStyle(e);case"script":return this.sanitizer.bypassSecurityTrustScript(e);case"url":return this.sanitizer.bypassSecurityTrustUrl(e);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(e);default:return this.sanitizer.bypassSecurityTrustHtml(e)}},e}();s.ɵfac=function(e){return new(e||s)(t.ɵɵdirectiveInject(n.DomSanitizer))},s.ɵpipe=t.ɵɵdefinePipe({name:"safe",type:s,pure:!0});var a=function(){};a.ɵmod=t.ɵɵdefineNgModule({type:a}),a.ɵinj=t.ɵɵdefineInjector({factory:function(e){return new(e||a)}}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(a,{declarations:[i,o,u,s],exports:[i,o,u,s]}),e.EnumPipe=u,e.PipeModule=a,e.SafePipe=s,e.SelectEnumFilterPipe=o,e.SelectFilterPipe=i,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=apipass-pipes.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../projects/pipes/src/lib/select.filter.pipe.ts","../../../projects/pipes/src/lib/select.enum.filter.pipe.ts","../../../projects/pipes/src/lib/keys.pipe.ts","../../../projects/pipes/src/lib/safe-pipe.ts","../../../projects/pipes/src/lib/pipe.module.ts"],"names":["SelectFilterPipe","prototype","transform","items","arg1","arg2","searchText","termName","toLowerCase","filter","item","indexOf","pure","SelectEnumFilterPipe","value","EnumPipe","exception","keys","add","enumMember","hasOwnProperty","this","isException","push","key","enumValue","isArray","some","exceptionValue","SafePipe","sanitizer","type","bypassSecurityTrustHtml","bypassSecurityTrustStyle","bypassSecurityTrustScript","bypassSecurityTrustUrl","bypassSecurityTrustResourceUrl","i0","ɵɵdirectiveInject","i1","DomSanitizer","PipeModule","declarations","exports"],"mappings":"siBAKE,SAAAA,YAEAA,EAAAC,UAAAC,UAAA,SAAUC,EAAcC,EAAWC,GACjC,IAAIC,EAAaF,EACXG,EAAWF,EAEjB,OAAKC,GAILA,EAAaA,EAAWE,cAEjBL,EAAMM,QAAO,SAAAC,GAClB,OAAOA,EAAKH,GAAUC,cAAcG,QAAQL,IAAe,MANpDH,yCATAH,qDAAAA,EAAgBY,MAAA,qBCE3B,SAAAC,YAGAA,EAAAZ,UAAAC,UAAA,SAAUC,EAAcC,GACtB,IAAIE,EAAaF,EACjB,OAAKE,GAGLA,EAAaA,EAAWE,cACjBL,EAAMM,QAAO,SAAAC,GAClB,OAAOA,EAAKI,MAAMN,cAAcG,QAAQL,IAAe,MAJhDH,yCARAU,yDAAAA,EAAoBD,MAAA,qBCCjC,SAAAG,YAEEA,EAAAd,UAAAC,UAAA,SAAUY,EAAYE,GACpB,IAAMC,EAAO,GACTC,GAAM,EAEV,IAAK,IAAMC,KAAcL,EAClBA,EAAMM,eAAeD,KAGtBD,IAAQG,KAAKC,YAAYR,EAAMK,GAAaH,IAC9CC,EAAKM,KAAK,CAACC,IAAKL,EAAYL,MAAOA,EAAMK,KAE3CD,GAAOA,GAGT,OAAOD,GAGDF,EAAAd,UAAAqB,YAAA,SAAYG,EAAgBT,GAClC,OAAIA,GAAaU,EAAAA,QAAQV,GAChBA,EAAUW,MAAK,SAACC,GAAmB,OAAAH,IAAcG,OAGnDZ,GAAYS,IAAcT,yCAxBxBD,6CAAAA,EAAQH,MAAA,qBCInB,SAAAiB,EAAsBC,GAAAT,KAAAS,UAAAA,SAGtBD,EAAA5B,UAAAC,UAAA,SAAUY,EAAeiB,GACvB,OAAQA,GACN,IAAK,OACH,OAAOV,KAAKS,UAAUE,wBAAwBlB,GAChD,IAAK,QACH,OAAOO,KAAKS,UAAUG,yBAAyBnB,GACjD,IAAK,SACH,OAAOO,KAAKS,UAAUI,0BAA0BpB,GAClD,IAAK,MACH,OAAOO,KAAKS,UAAUK,uBAAuBrB,GAC/C,IAAK,cACH,OAAOO,KAAKS,UAAUM,+BAA+BtB,GACvD,QACE,OAAOO,KAAKS,UAAUE,wBAAwBlB,2CAlBzCe,GAAQQ,EAAAC,kBAAAC,EAAAC,yDAARX,EAAQjB,MAAA,UCcrB,6CAAa6B,iEAAAA,uEAAAA,EAAU,CAAAC,aAAA,CAZnB1C,EACAa,EACAE,EACAc,GAAQc,QAAA,CAGR3C,EACAa,EACAE,EACAc","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'selectFilter' })\nexport class SelectFilterPipe implements PipeTransform {\n\n constructor() { }\n\n transform(items: any[], arg1: any, arg2: any): any[] {\n let searchText = arg1;\n const termName = arg2;\n\n if (!searchText) {\n return items;\n }\n\n searchText = searchText.toLowerCase();\n\n return items.filter(item => {\n return item[termName].toLowerCase().indexOf(searchText) > -1;\n });\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'selectEnumFilter' })\nexport class SelectEnumFilterPipe implements PipeTransform {\n\n constructor() {\n }\n\n transform(items: any[], arg1: any): any[] {\n let searchText = arg1;\n if (!searchText) {\n return items;\n }\n searchText = searchText.toLowerCase();\n return items.filter(item => {\n return item.value.toLowerCase().indexOf(searchText) > -1;\n });\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {isArray} from 'rxjs/internal-compatibility';\n\n@Pipe({name: 'enum'})\nexport class EnumPipe implements PipeTransform {\n\n transform(value: any, exception?: any): any {\n const keys = [];\n let add = true;\n\n for (const enumMember in value) {\n if (!value.hasOwnProperty(enumMember)) {\n continue;\n }\n if (add && !this.isException(value[enumMember], exception)) {\n keys.push({key: enumMember, value: value[enumMember]});\n }\n add = !add;\n }\n\n return keys;\n }\n\n private isException(enumValue: any, exception: any): boolean {\n if (exception && isArray(exception)) {\n return exception.some((exceptionValue) => enumValue === exceptionValue);\n }\n\n return exception ? enumValue === exception : false;\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from '@angular/platform-browser';\n\n@Pipe({\n name: 'safe'\n})\nexport class SafePipe implements PipeTransform {\n\n constructor(protected sanitizer: DomSanitizer) {\n }\n\n transform(value: string, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {\n switch (type) {\n case 'html':\n return this.sanitizer.bypassSecurityTrustHtml(value);\n case 'style':\n return this.sanitizer.bypassSecurityTrustStyle(value);\n case 'script':\n return this.sanitizer.bypassSecurityTrustScript(value);\n case 'url':\n return this.sanitizer.bypassSecurityTrustUrl(value);\n case 'resourceUrl':\n return this.sanitizer.bypassSecurityTrustResourceUrl(value);\n default:\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {SelectFilterPipe} from './select.filter.pipe';\nimport {SelectEnumFilterPipe} from './select.enum.filter.pipe';\nimport {EnumPipe} from './keys.pipe';\nimport {SafePipe} from './safe-pipe';\n\n@NgModule({\n declarations: [\n SelectFilterPipe,\n SelectEnumFilterPipe,\n EnumPipe,\n SafePipe\n ],\n exports: [\n SelectFilterPipe,\n SelectEnumFilterPipe,\n EnumPipe,\n SafePipe\n ],\n})\nexport class PipeModule {\n}\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { SelectFilterPipe } from './select.filter.pipe';
|
|
3
|
-
import { SelectEnumFilterPipe } from './select.enum.filter.pipe';
|
|
4
|
-
import { EnumPipe } from './keys.pipe';
|
|
5
|
-
import { SafePipe } from './safe-pipe';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class PipeModule {
|
|
8
|
-
}
|
|
9
|
-
PipeModule.ɵmod = i0.ɵɵdefineNgModule({ type: PipeModule });
|
|
10
|
-
PipeModule.ɵinj = i0.ɵɵdefineInjector({ factory: function PipeModule_Factory(t) { return new (t || PipeModule)(); } });
|
|
11
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PipeModule, { declarations: [SelectFilterPipe,
|
|
12
|
-
SelectEnumFilterPipe,
|
|
13
|
-
EnumPipe,
|
|
14
|
-
SafePipe], exports: [SelectFilterPipe,
|
|
15
|
-
SelectEnumFilterPipe,
|
|
16
|
-
EnumPipe,
|
|
17
|
-
SafePipe] }); })();
|
|
18
|
-
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(PipeModule, [{
|
|
19
|
-
type: NgModule,
|
|
20
|
-
args: [{
|
|
21
|
-
declarations: [
|
|
22
|
-
SelectFilterPipe,
|
|
23
|
-
SelectEnumFilterPipe,
|
|
24
|
-
EnumPipe,
|
|
25
|
-
SafePipe
|
|
26
|
-
],
|
|
27
|
-
exports: [
|
|
28
|
-
SelectFilterPipe,
|
|
29
|
-
SelectEnumFilterPipe,
|
|
30
|
-
EnumPipe,
|
|
31
|
-
SafePipe
|
|
32
|
-
],
|
|
33
|
-
}]
|
|
34
|
-
}], null, null); })();
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9waXBlcy9zcmMvbGliL3BpcGUubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdkMsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxFQUFD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uICAgIEVudW1QaXBlLFxuICAgIFNhZmVQaXBlXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBTZWxlY3RGaWx0ZXJQaXBlLFxuICAgIFNlbGVjdEVudW1GaWx0ZXJQaXBlLFxuICAgIEVudW1QaXBlLFxuICAgIFNhZmVQaXBlXG4gIF0sXG59KVxuZXhwb3J0IGNsYXNzIFBpcGVNb2R1bGUge1xufVxuIl19
|
package/esm2015/lib/safe-pipe.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/platform-browser";
|
|
5
|
-
export class SafePipe {
|
|
6
|
-
constructor(sanitizer) {
|
|
7
|
-
this.sanitizer = sanitizer;
|
|
8
|
-
}
|
|
9
|
-
transform(value, type) {
|
|
10
|
-
switch (type) {
|
|
11
|
-
case 'html':
|
|
12
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
13
|
-
case 'style':
|
|
14
|
-
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
15
|
-
case 'script':
|
|
16
|
-
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
17
|
-
case 'url':
|
|
18
|
-
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
19
|
-
case 'resourceUrl':
|
|
20
|
-
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
21
|
-
default:
|
|
22
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
SafePipe.ɵfac = function SafePipe_Factory(t) { return new (t || SafePipe)(i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
27
|
-
SafePipe.ɵpipe = i0.ɵɵdefinePipe({ name: "safe", type: SafePipe, pure: true });
|
|
28
|
-
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(SafePipe, [{
|
|
29
|
-
type: Pipe,
|
|
30
|
-
args: [{
|
|
31
|
-
name: 'safe'
|
|
32
|
-
}]
|
|
33
|
-
}], function () { return [{ type: i1.DomSanitizer }]; }, null); })();
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FmZS1waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGlwZXMvc3JjL2xpYi9zYWZlLXBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLElBQUksRUFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxFQUFDLFlBQVksRUFBNEQsTUFBTSwyQkFBMkIsQ0FBQzs7O0FBS2xILE1BQU0sT0FBTyxRQUFRO0lBRW5CLFlBQXNCLFNBQXVCO1FBQXZCLGNBQVMsR0FBVCxTQUFTLENBQWM7SUFDN0MsQ0FBQztJQUVELFNBQVMsQ0FBQyxLQUFhLEVBQUUsSUFBWTtRQUNuQyxRQUFRLElBQUksRUFBRTtZQUNaLEtBQUssTUFBTTtnQkFDVCxPQUFPLElBQUksQ0FBQyxTQUFTLENBQUMsdUJBQXVCLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDdkQsS0FBSyxPQUFPO2dCQUNWLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyx3QkFBd0IsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUN4RCxLQUFLLFFBQVE7Z0JBQ1gsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLHlCQUF5QixDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQ3pELEtBQUssS0FBSztnQkFDUixPQUFPLElBQUksQ0FBQyxTQUFTLENBQUMsc0JBQXNCLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDdEQsS0FBSyxhQUFhO2dCQUNoQixPQUFPLElBQUksQ0FBQyx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