@apipass/pipes 0.1.2 → 0.1.5-alpha.1
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/apipass-pipes.d.ts +5 -4
- package/assets/css/colors.scss +34 -34
- package/assets/css/icons.scss +30 -30
- package/bundles/apipass-pipes.umd.js +155 -130
- package/bundles/apipass-pipes.umd.js.map +1 -1
- package/bundles/apipass-pipes.umd.min.js +1 -1
- package/bundles/apipass-pipes.umd.min.js.map +1 -1
- package/esm2015/apipass-pipes.js +4 -4
- package/esm2015/lib/keys.pipe.js +32 -28
- package/esm2015/lib/pipe.module.js +35 -24
- package/esm2015/lib/safe-pipe.js +34 -32
- package/esm2015/lib/select.enum.filter.pipe.js +27 -25
- package/esm2015/lib/select.filter.pipe.js +27 -25
- package/esm2015/public-api.js +5 -5
- package/fesm2015/apipass-pipes.js +132 -119
- package/fesm2015/apipass-pipes.js.map +1 -1
- package/lib/keys.pipe.d.ts +8 -5
- package/lib/pipe.module.d.ts +9 -2
- package/lib/safe-pipe.d.ts +10 -7
- package/lib/select.enum.filter.pipe.d.ts +10 -7
- package/lib/select.filter.pipe.d.ts +10 -7
- package/package.json +10 -9
- package/public-api.d.ts +5 -5
- package/apipass-pipes.metadata.json +0 -1
|
@@ -1,24 +1,35 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9waXBlcy9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0gZnJvbSAnLi9rZXlzLnBpcGUnO1xuaW1wb3J0IHtTYWZlUGlwZX0gZnJvbSAnLi9zYWZlLXBpcGUnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtcbiAgICBTZWxlY3RGaWx0ZXJQaXBlLFxuICAgIFNlbGVjdEVudW1GaWx0ZXJQaXBlLFxuICAgIEVudW1QaXBlLFxuICAgIFNhZmVQaXBlXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBTZWxlY3RGaWx0ZXJQaXBlLFxuICAgIFNlbGVjdEVudW1GaWx0ZXJQaXBlLFxuICAgIEVudW1QaXBlLFxuICAgIFNhZmVQaXBlXG4gIF0sXG59KVxuZXhwb3J0IGNsYXNzIFBpcGVNb2R1bGUge1xufVxuIl19
|
package/esm2015/lib/safe-pipe.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
case '
|
|
12
|
-
return this.sanitizer.
|
|
13
|
-
case '
|
|
14
|
-
return this.sanitizer.
|
|
15
|
-
case '
|
|
16
|
-
return this.sanitizer.
|
|
17
|
-
case '
|
|
18
|
-
return this.sanitizer.
|
|
19
|
-
|
|
20
|
-
return this.sanitizer.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FmZS1waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGlwZXMvc3JjL2xpYi9zYWZlLXBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLElBQUksRUFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxFQUFDLFlBQVksRUFBNEQsTUFBTSwy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plci5ieXBhc3NTZWN1cml0eVRydXN0SHRtbCh2YWx1ZSk7XG4gICAgfVxuICB9XG5cbn1cbiJdfQ==
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
SelectEnumFilterPipe
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@ngx-translate/core";
|
|
5
|
+
export class SelectEnumFilterPipe {
|
|
6
|
+
constructor(translate) {
|
|
7
|
+
this.translate = translate;
|
|
8
|
+
}
|
|
9
|
+
transform(items, arg1) {
|
|
10
|
+
let searchText = arg1;
|
|
11
|
+
if (!searchText) {
|
|
12
|
+
return items;
|
|
13
|
+
}
|
|
14
|
+
searchText = searchText.toLowerCase();
|
|
15
|
+
return items.filter(item => {
|
|
16
|
+
const enumValue = this.translate.instant(item.value);
|
|
17
|
+
return enumValue.toLowerCase().indexOf(searchText) > -1;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
SelectEnumFilterPipe.ɵfac = function SelectEnumFilterPipe_Factory(t) { return new (t || SelectEnumFilterPipe)(i0.ɵɵdirectiveInject(i1.TranslateService)); };
|
|
22
|
+
SelectEnumFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectEnumFilter", type: SelectEnumFilterPipe, pure: true });
|
|
23
|
+
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(SelectEnumFilterPipe, [{
|
|
24
|
+
type: Pipe,
|
|
25
|
+
args: [{ name: 'selectEnumFilter' }]
|
|
26
|
+
}], function () { return [{ type: i1.TranslateService }]; }, null); })();
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmVudW0uZmlsdGVyLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9waXBlcy9zcmMvbGliL3NlbGVjdC5lbnVtLmZpbHRlci5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBQ3BELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDOzs7QUFHdkQsTUFBTSxPQUFPLG9CQUFvQjtJQUUvQixZQUFvQixTQUEyQjtRQUEzQixjQUFTLEdBQVQsU0FBUyxDQUFrQjtJQUMvQyxDQUFDO0lBRUQsU0FBUyxDQUFDLEtBQVksRUFBRSxJQUFTO1FBQy9CLElBQUksVUFBVSxHQUFHLElBQUksQ0FBQztRQUN0QixJQUFJLENBQUMsVUFBVSxFQUFFO1lBQ2YsT0FBTyxLQUFLLENBQUM7U0FDZDtRQUNELFVBQVUsR0FBRyxVQUFVLENBQUMsV0FBVyxFQUFFLENBQUM7UUFDdEMsT0FBTyxLQUFLLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFO1lBQ3pCLE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNyRCxPQUFPLFNBQVMsQ0FBQyxXQUFXLEVBQUUsQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7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e } from '@angular/core';
|
|
2
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
SelectFilterPipe
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@ngx-translate/core";
|
|
5
|
+
export class SelectFilterPipe {
|
|
6
|
+
constructor(translate) {
|
|
7
|
+
this.translate = translate;
|
|
8
|
+
}
|
|
9
|
+
transform(items, arg1, arg2) {
|
|
10
|
+
let searchText = arg1;
|
|
11
|
+
const termName = arg2;
|
|
12
|
+
if (!searchText) {
|
|
13
|
+
return items;
|
|
14
|
+
}
|
|
15
|
+
searchText = searchText.toLowerCase();
|
|
16
|
+
return items.filter(item => {
|
|
17
|
+
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
SelectFilterPipe.ɵfac = function SelectFilterPipe_Factory(t) { return new (t || SelectFilterPipe)(i0.ɵɵdirectiveInject(i1.TranslateService)); };
|
|
22
|
+
SelectFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectFilter", type: SelectFilterPipe, pure: true });
|
|
23
|
+
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(SelectFilterPipe, [{
|
|
24
|
+
type: Pipe,
|
|
25
|
+
args: [{ name: 'selectFilter' }]
|
|
26
|
+
}], function () { return [{ type: i1.TranslateService }]; }, null); })();
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,ey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0IHsgUGlwZSwgUGlwZVRyYW5zZm9ybSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgVHJhbnNsYXRlU2VydmljZSB9IGZyb20gJ0BuZ3gtdHJhbnNsYXRlL2NvcmUnO1xuXG5AUGlwZSh7IG5hbWU6ICdzZWxlY3RGaWx0ZXInIH0pXG5leHBvcnQgY2xhc3MgU2VsZWN0RmlsdGVyUGlwZSBpbXBsZW1lbnRzIFBpcGVUcmFuc2Zvcm0ge1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgdHJhbnNsYXRlOiBUcmFuc2xhdGVTZXJ2aWNlKSB7IH1cblxuICB0cmFuc2Zvcm0oaXRlbXM6IGFueVtdLCBhcmcxOiBhbnksIGFyZzI6IGFueSk6IGFueVtdIHtcbiAgICBsZXQgc2VhcmNoVGV4dCA9IGFyZzE7XG4gICAgY29uc3QgdGVybU5hbWUgPSBhcmcyO1xuXG4gICAgaWYgKCFzZWFyY2hUZXh0KSB7XG4gICAgICByZXR1cm4gaXRlbXM7XG4gICAgfVxuXG4gICAgc2VhcmNoVGV4dCA9IHNlYXJjaFRleHQudG9Mb3dlckNhc2UoKTtcblxuICAgIHJldHVybiBpdGVtcy5maWx0ZXIoaXRlbSA9PiB7XG4gICAgICByZXR1cm4gaXRlbVt0ZXJtTmFtZV0udG9Mb3dlckNhc2UoKS5pbmRleE9mKHNlYXJjaFRleHQpID4gLTE7XG4gICAgfSk7XG4gIH1cblxufVxuIl19
|
package/esm2015/public-api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
6
6
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3BpcGVzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL3BpcGUubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2tleXMucGlwZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zYWZlLXBpcGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VsZWN0LmVudW0uZmlsdGVyLnBpcGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VsZWN0LmZpbHRlci5waXBlJztcbiJdfQ==
|
|
@@ -1,131 +1,144 @@
|
|
|
1
|
-
import { Pipe, NgModule } from '@angular/core';
|
|
1
|
+
import { ɵɵdirectiveInject, ɵɵdefinePipe, ɵsetClassMetadata, Pipe, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
3
|
import { isArray } from 'rxjs/internal-compatibility';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
|
|
6
|
-
class SelectFilterPipe {
|
|
7
|
-
constructor(translate) {
|
|
8
|
-
this.translate = translate;
|
|
9
|
-
}
|
|
10
|
-
transform(items, arg1, arg2) {
|
|
11
|
-
let searchText = arg1;
|
|
12
|
-
const termName = arg2;
|
|
13
|
-
if (!searchText) {
|
|
14
|
-
return items;
|
|
15
|
-
}
|
|
16
|
-
searchText = searchText.toLowerCase();
|
|
17
|
-
return items.filter(item => {
|
|
18
|
-
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
SelectFilterPipe
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
];
|
|
6
|
+
class SelectFilterPipe {
|
|
7
|
+
constructor(translate) {
|
|
8
|
+
this.translate = translate;
|
|
9
|
+
}
|
|
10
|
+
transform(items, arg1, arg2) {
|
|
11
|
+
let searchText = arg1;
|
|
12
|
+
const termName = arg2;
|
|
13
|
+
if (!searchText) {
|
|
14
|
+
return items;
|
|
15
|
+
}
|
|
16
|
+
searchText = searchText.toLowerCase();
|
|
17
|
+
return items.filter(item => {
|
|
18
|
+
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
SelectFilterPipe.ɵfac = function SelectFilterPipe_Factory(t) { return new (t || SelectFilterPipe)(ɵɵdirectiveInject(TranslateService)); };
|
|
23
|
+
SelectFilterPipe.ɵpipe = ɵɵdefinePipe({ name: "selectFilter", type: SelectFilterPipe, pure: true });
|
|
24
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(SelectFilterPipe, [{
|
|
25
|
+
type: Pipe,
|
|
26
|
+
args: [{ name: 'selectFilter' }]
|
|
27
|
+
}], function () { return [{ type: TranslateService }]; }, null); })();
|
|
28
28
|
|
|
29
|
-
class SelectEnumFilterPipe {
|
|
30
|
-
constructor(translate) {
|
|
31
|
-
this.translate = translate;
|
|
32
|
-
}
|
|
33
|
-
transform(items, arg1) {
|
|
34
|
-
let searchText = arg1;
|
|
35
|
-
if (!searchText) {
|
|
36
|
-
return items;
|
|
37
|
-
}
|
|
38
|
-
searchText = searchText.toLowerCase();
|
|
39
|
-
return items.filter(item => {
|
|
40
|
-
const enumValue = this.translate.instant(item.value);
|
|
41
|
-
return enumValue.toLowerCase().indexOf(searchText) > -1;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
SelectEnumFilterPipe
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
];
|
|
29
|
+
class SelectEnumFilterPipe {
|
|
30
|
+
constructor(translate) {
|
|
31
|
+
this.translate = translate;
|
|
32
|
+
}
|
|
33
|
+
transform(items, arg1) {
|
|
34
|
+
let searchText = arg1;
|
|
35
|
+
if (!searchText) {
|
|
36
|
+
return items;
|
|
37
|
+
}
|
|
38
|
+
searchText = searchText.toLowerCase();
|
|
39
|
+
return items.filter(item => {
|
|
40
|
+
const enumValue = this.translate.instant(item.value);
|
|
41
|
+
return enumValue.toLowerCase().indexOf(searchText) > -1;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
SelectEnumFilterPipe.ɵfac = function SelectEnumFilterPipe_Factory(t) { return new (t || SelectEnumFilterPipe)(ɵɵdirectiveInject(TranslateService)); };
|
|
46
|
+
SelectEnumFilterPipe.ɵpipe = ɵɵdefinePipe({ name: "selectEnumFilter", type: SelectEnumFilterPipe, pure: true });
|
|
47
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(SelectEnumFilterPipe, [{
|
|
48
|
+
type: Pipe,
|
|
49
|
+
args: [{ name: 'selectEnumFilter' }]
|
|
50
|
+
}], function () { return [{ type: TranslateService }]; }, null); })();
|
|
51
51
|
|
|
52
|
-
class EnumPipe {
|
|
53
|
-
transform(value, exception) {
|
|
54
|
-
const keys = [];
|
|
55
|
-
let add = true;
|
|
56
|
-
for (const enumMember in value) {
|
|
57
|
-
if (!value.hasOwnProperty(enumMember)) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
if (add && !this.isException(value[enumMember], exception)) {
|
|
61
|
-
keys.push({ key: enumMember, value: value[enumMember] });
|
|
62
|
-
}
|
|
63
|
-
add = !add;
|
|
64
|
-
}
|
|
65
|
-
return keys;
|
|
66
|
-
}
|
|
67
|
-
isException(enumValue, exception) {
|
|
68
|
-
if (exception && isArray(exception)) {
|
|
69
|
-
return exception.some((exceptionValue) => enumValue === exceptionValue);
|
|
70
|
-
}
|
|
71
|
-
return exception ? enumValue === exception : false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
EnumPipe
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
class EnumPipe {
|
|
53
|
+
transform(value, exception) {
|
|
54
|
+
const keys = [];
|
|
55
|
+
let add = true;
|
|
56
|
+
for (const enumMember in value) {
|
|
57
|
+
if (!value.hasOwnProperty(enumMember)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (add && !this.isException(value[enumMember], exception)) {
|
|
61
|
+
keys.push({ key: enumMember, value: value[enumMember] });
|
|
62
|
+
}
|
|
63
|
+
add = !add;
|
|
64
|
+
}
|
|
65
|
+
return keys;
|
|
66
|
+
}
|
|
67
|
+
isException(enumValue, exception) {
|
|
68
|
+
if (exception && isArray(exception)) {
|
|
69
|
+
return exception.some((exceptionValue) => enumValue === exceptionValue);
|
|
70
|
+
}
|
|
71
|
+
return exception ? enumValue === exception : false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
EnumPipe.ɵfac = function EnumPipe_Factory(t) { return new (t || EnumPipe)(); };
|
|
75
|
+
EnumPipe.ɵpipe = ɵɵdefinePipe({ name: "enum", type: EnumPipe, pure: true });
|
|
76
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(EnumPipe, [{
|
|
77
|
+
type: Pipe,
|
|
78
|
+
args: [{ name: 'enum' }]
|
|
79
|
+
}], null, null); })();
|
|
77
80
|
|
|
78
|
-
class SafePipe {
|
|
79
|
-
constructor(sanitizer) {
|
|
80
|
-
this.sanitizer = sanitizer;
|
|
81
|
-
}
|
|
82
|
-
transform(value, type) {
|
|
83
|
-
switch (type) {
|
|
84
|
-
case 'html':
|
|
85
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
86
|
-
case 'style':
|
|
87
|
-
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
88
|
-
case 'script':
|
|
89
|
-
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
90
|
-
case 'url':
|
|
91
|
-
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
92
|
-
case 'resourceUrl':
|
|
93
|
-
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
94
|
-
default:
|
|
95
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
SafePipe
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
];
|
|
81
|
+
class SafePipe {
|
|
82
|
+
constructor(sanitizer) {
|
|
83
|
+
this.sanitizer = sanitizer;
|
|
84
|
+
}
|
|
85
|
+
transform(value, type) {
|
|
86
|
+
switch (type) {
|
|
87
|
+
case 'html':
|
|
88
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
89
|
+
case 'style':
|
|
90
|
+
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
91
|
+
case 'script':
|
|
92
|
+
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
93
|
+
case 'url':
|
|
94
|
+
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
95
|
+
case 'resourceUrl':
|
|
96
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
97
|
+
default:
|
|
98
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
SafePipe.ɵfac = function SafePipe_Factory(t) { return new (t || SafePipe)(ɵɵdirectiveInject(DomSanitizer)); };
|
|
103
|
+
SafePipe.ɵpipe = ɵɵdefinePipe({ name: "safe", type: SafePipe, pure: true });
|
|
104
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(SafePipe, [{
|
|
105
|
+
type: Pipe,
|
|
106
|
+
args: [{
|
|
107
|
+
name: 'safe'
|
|
108
|
+
}]
|
|
109
|
+
}], function () { return [{ type: DomSanitizer }]; }, null); })();
|
|
107
110
|
|
|
108
|
-
class PipeModule {
|
|
109
|
-
}
|
|
110
|
-
PipeModule
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
class PipeModule {
|
|
112
|
+
}
|
|
113
|
+
PipeModule.ɵmod = ɵɵdefineNgModule({ type: PipeModule });
|
|
114
|
+
PipeModule.ɵinj = ɵɵdefineInjector({ factory: function PipeModule_Factory(t) { return new (t || PipeModule)(); } });
|
|
115
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(PipeModule, { declarations: [SelectFilterPipe,
|
|
116
|
+
SelectEnumFilterPipe,
|
|
117
|
+
EnumPipe,
|
|
118
|
+
SafePipe], exports: [SelectFilterPipe,
|
|
119
|
+
SelectEnumFilterPipe,
|
|
120
|
+
EnumPipe,
|
|
121
|
+
SafePipe] }); })();
|
|
122
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(PipeModule, [{
|
|
123
|
+
type: NgModule,
|
|
124
|
+
args: [{
|
|
125
|
+
declarations: [
|
|
126
|
+
SelectFilterPipe,
|
|
127
|
+
SelectEnumFilterPipe,
|
|
128
|
+
EnumPipe,
|
|
129
|
+
SafePipe
|
|
130
|
+
],
|
|
131
|
+
exports: [
|
|
132
|
+
SelectFilterPipe,
|
|
133
|
+
SelectEnumFilterPipe,
|
|
134
|
+
EnumPipe,
|
|
135
|
+
SafePipe
|
|
136
|
+
],
|
|
137
|
+
}]
|
|
138
|
+
}], null, null); })();
|
|
126
139
|
|
|
127
|
-
/**
|
|
128
|
-
* Generated bundle index. Do not edit.
|
|
140
|
+
/**
|
|
141
|
+
* Generated bundle index. Do not edit.
|
|
129
142
|
*/
|
|
130
143
|
|
|
131
144
|
export { EnumPipe, PipeModule, SafePipe, SelectEnumFilterPipe, SelectFilterPipe };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apipass-pipes.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';\
|
|
1
|
+
{"version":3,"file":"apipass-pipes.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';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Pipe({ name: 'selectFilter' })\nexport class SelectFilterPipe implements PipeTransform {\n\n constructor(private translate: TranslateService) { }\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';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Pipe({ name: 'selectEnumFilter' })\nexport class SelectEnumFilterPipe implements PipeTransform {\n\n constructor(private translate: TranslateService) {\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 const enumValue = this.translate.instant(item.value);\n return enumValue.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":[],"mappings":";;;;;MAIa,gBAAgB;IAE3B,YAAoB,SAA2B;QAA3B,cAAS,GAAT,SAAS,CAAkB;KAAK;IAEpD,SAAS,CAAC,KAAY,EAAE,IAAS,EAAE,IAAS;QAC1C,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,KAAK,CAAC;SACd;QAED,UAAU,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QAEtC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI;YACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SAC9D,CAAC,CAAC;KACJ;;gFAjBU,gBAAgB;oEAAhB,gBAAgB;+CAAhB,gBAAgB;cAD5B,IAAI;eAAC,EAAE,IAAI,EAAE,cAAc,EAAE;;;MCCjB,oBAAoB;IAE/B,YAAoB,SAA2B;QAA3B,cAAS,GAAT,SAAS,CAAkB;KAC9C;IAED,SAAS,CAAC,KAAY,EAAE,IAAS;QAC/B,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,KAAK,CAAC;SACd;QACD,UAAU,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI;YACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,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I;YACV,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;YACvD,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;YACxD,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;YACzD,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YACtD,KAAK,aAAa;gBAChB,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC;YAC9D;gBACE,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;SACxD;KACF;;gEApBU,QAAQ;oDAAR,QAAQ;+CAAR,QAAQ;cAHpB,IAAI;eAAC;gBACJ,IAAI,EAAE,MAAM;aACb;;;MCeY,UAAU;;2CAAV,UAAU;gGAAV,UAAU;qFAAV,UAAU,mBAZnB,gBAAgB;QAChB,oBAAoB;QACpB,QAAQ;QACR,QAAQ,aAGR,gBAAgB;QAChB,oBAAoB;QACpB,QAAQ;QACR,QAAQ;+CAGC,UAAU;cAdtB,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,gBAAgB;oBAChB,oBAAoB;oBACpB,QAAQ;oBACR,QAAQ;iBACT;gBACD,OAAO,EAAE;oBACP,gBAAgB;oBAChB,oBAAoB;oBACpB,QAAQ;oBACR,QAAQ;iBACT;aACF;;;ACnBD;;;;;;"}
|
package/lib/keys.pipe.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.ɵɵFactoryDef<EnumPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDefWithMeta<EnumPipe, "enum">;
|
|
8
|
+
}
|
package/lib/pipe.module.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 ɵmod: i0.ɵɵNgModuleDefWithMeta<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]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDef<PipeModule>;
|
|
9
|
+
}
|
package/lib/safe-pipe.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl } from '@angular/platform-browser';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.ɵɵFactoryDef<SafePipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDefWithMeta<SafePipe, "safe">;
|
|
10
|
+
}
|